Repository navigation
Expand file tree
/
Copy pathmicrocms-types.ts
More file actions
252 lines (214 loc) · 10 KB
/
Copy pathmicrocms-types.ts
File metadata and controls
252 lines (214 loc) · 10 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
// This file is generated by microcms-typegen. Do not edit by hand.
type __MicroCMSTypegenDepth = 0 | 1 | 2 | 3;
type __MicroCMSTypegenReadOptions = { depth?: __MicroCMSTypegenDepth };
type __MicroCMSTypegenPreviousDepth = { 0: 0; 1: 0; 2: 1; 3: 2 };
type __MicroCMSTypegenResolveDepth<Options extends __MicroCMSTypegenReadOptions> = Options extends { depth: infer Depth } ? Depth extends __MicroCMSTypegenDepth ? Depth : 1 : 1;
type __MicroCMSTypegenReferenceOptions<Options extends __MicroCMSTypegenReadOptions> = Omit<Options, 'depth'> & { depth: __MicroCMSTypegenPreviousDepth[__MicroCMSTypegenResolveDepth<Options>] };
type __MicroCMSTypegenExpand<Value> = Value extends readonly unknown[]
? { [Key in keyof Value]: __MicroCMSTypegenExpand<Value[Key]> }
: Value extends Record<string, unknown>
? { [Key in keyof Value]: __MicroCMSTypegenExpand<Value[Key]> }
: Value;
export type MicroCMSImage = { url: string; width?: number; height?: number; alt?: string };
export type MicroCMSFile = { url: string; fileSize: number };
type __MicroCMSTypegenBannerRead<Options extends __MicroCMSTypegenReadOptions = {}> = {
createdAt: string;
updatedAt: string;
publishedAt?: string;
revisedAt?: string;
image?: MicroCMSImage;
url?: string | null;
description?: string | null;
};
export type Banner = __MicroCMSTypegenBannerRead<{}>;
type __MicroCMSTypegenBannerUpdate = {
publishedAt?: string;
image?: string;
url?: string;
description?: string;
};
type __MicroCMSTypegenBlogsRead<Options extends __MicroCMSTypegenReadOptions = {}> = {
id: string;
createdAt: string;
updatedAt: string;
publishedAt?: string;
revisedAt?: string;
title?: string | null;
content?: string | null;
eyecatch?: MicroCMSImage;
category: (__MicroCMSTypegenResolveDepth<Options> extends 0 ? { id: string } : __MicroCMSTypegenCategoriesRead<__MicroCMSTypegenReferenceOptions<Options>>) | null;
};
export type Blogs = __MicroCMSTypegenBlogsRead<{}>;
type __MicroCMSTypegenBlogsCreate = {
publishedAt?: string;
title?: string;
content?: string;
eyecatch?: string;
category?: string;
};
type __MicroCMSTypegenBlogsUpdate = {
publishedAt?: string;
title?: string;
content?: string;
eyecatch?: string;
category?: string | Record<string, never>;
};
type __MicroCMSTypegenCategoriesRead<Options extends __MicroCMSTypegenReadOptions = {}> = {
id: string;
createdAt: string;
updatedAt: string;
publishedAt?: string;
revisedAt?: string;
name?: string | null;
};
export type Categories = __MicroCMSTypegenCategoriesRead<{}>;
type __MicroCMSTypegenCategoriesCreate = {
publishedAt?: string;
name?: string;
};
type __MicroCMSTypegenCategoriesUpdate = {
publishedAt?: string;
name?: string;
};
type __MicroCMSTypegenAllFieldsCustomFieldAlphaRead<Options extends __MicroCMSTypegenReadOptions = {}> = {
fieldId: "Alpha";
hoge?: string | null;
huga?: string | null;
};
export type AllFieldsCustomFieldAlpha = __MicroCMSTypegenAllFieldsCustomFieldAlphaRead<{}>;
type __MicroCMSTypegenAllFieldsCustomFieldAlphaCreate = {
fieldId: "Alpha";
hoge?: string;
huga?: string;
};
type __MicroCMSTypegenAllFieldsCustomFieldAlphaUpdate = {
fieldId: "Alpha";
hoge?: string;
huga?: string;
};
type __MicroCMSTypegenAllFieldsCustomFieldBetaRead<Options extends __MicroCMSTypegenReadOptions = {}> = {
fieldId: "Beta";
aa?: string | null;
bb?: MicroCMSImage;
cc?: string;
};
export type AllFieldsCustomFieldBeta = __MicroCMSTypegenAllFieldsCustomFieldBetaRead<{}>;
type __MicroCMSTypegenAllFieldsCustomFieldBetaCreate = {
fieldId: "Beta";
aa?: string;
bb?: string;
cc?: string;
};
type __MicroCMSTypegenAllFieldsCustomFieldBetaUpdate = {
fieldId: "Beta";
aa?: string;
bb?: string;
cc?: string;
};
type __MicroCMSTypegenAllFieldsCustomFieldGammaRead<Options extends __MicroCMSTypegenReadOptions = {}> = {
fieldId: "Gamma";
test?: string | null;
};
export type AllFieldsCustomFieldGamma = __MicroCMSTypegenAllFieldsCustomFieldGammaRead<{}>;
type __MicroCMSTypegenAllFieldsCustomFieldGammaCreate = {
fieldId: "Gamma";
test?: string;
};
type __MicroCMSTypegenAllFieldsCustomFieldGammaUpdate = {
fieldId: "Gamma";
test?: string;
};
type __MicroCMSTypegenAllFieldsCustomFieldDeltaRead<Options extends __MicroCMSTypegenReadOptions = {}> = {
fieldId: "Delta";
test?: string | null;
};
export type AllFieldsCustomFieldDelta = __MicroCMSTypegenAllFieldsCustomFieldDeltaRead<{}>;
type __MicroCMSTypegenAllFieldsCustomFieldDeltaCreate = {
fieldId: "Delta";
test?: string;
};
type __MicroCMSTypegenAllFieldsCustomFieldDeltaUpdate = {
fieldId: "Delta";
test?: string;
};
type __MicroCMSTypegenAllFieldsCustomFieldEpsilonRead<Options extends __MicroCMSTypegenReadOptions = {}> = {
fieldId: "Epsilon";
text?: string | null;
};
export type AllFieldsCustomFieldEpsilon = __MicroCMSTypegenAllFieldsCustomFieldEpsilonRead<{}>;
type __MicroCMSTypegenAllFieldsCustomFieldEpsilonCreate = {
fieldId: "Epsilon";
text?: string;
};
type __MicroCMSTypegenAllFieldsCustomFieldEpsilonUpdate = {
fieldId: "Epsilon";
text?: string;
};
type __MicroCMSTypegenAllFieldsRead<Options extends __MicroCMSTypegenReadOptions = {}> = {
id: string;
createdAt: string;
updatedAt: string;
publishedAt?: string;
revisedAt?: string;
text?: string | null;
textArea?: string | null;
oldRich?: string;
Rich?: string | null;
image?: MicroCMSImage;
images: MicroCMSImage[];
date?: string;
boolean: boolean;
select: ("hoge" | "hoge2")[];
num?: number | null;
file?: MicroCMSFile;
extend?: unknown;
ref: (__MicroCMSTypegenResolveDepth<Options> extends 0 ? { id: string } : __MicroCMSTypegenCategoriesRead<__MicroCMSTypegenReferenceOptions<Options>>) | null;
multi_ref: (__MicroCMSTypegenResolveDepth<Options> extends 0 ? { id: string } : __MicroCMSTypegenCategoriesRead<__MicroCMSTypegenReferenceOptions<Options>>)[];
custom: __MicroCMSTypegenAllFieldsCustomFieldAlphaRead<Options> | null;
repeat: (__MicroCMSTypegenAllFieldsCustomFieldBetaRead<Options> | __MicroCMSTypegenAllFieldsCustomFieldEpsilonRead<Options> | __MicroCMSTypegenAllFieldsCustomFieldGammaRead<Options> | __MicroCMSTypegenAllFieldsCustomFieldAlphaRead<Options> | __MicroCMSTypegenAllFieldsCustomFieldDeltaRead<Options>)[] | null;
};
export type AllFields = __MicroCMSTypegenAllFieldsRead<{}>;
type __MicroCMSTypegenAllFieldsCreate = {
publishedAt?: string;
text: string;
textArea?: string;
oldRich?: string;
Rich?: string;
image?: string;
images?: string[];
date?: string;
boolean?: boolean;
select?: ("hoge" | "hoge2")[];
num?: number;
file?: string;
extend?: Record<string, unknown>;
ref?: string;
multi_ref?: string[];
custom?: __MicroCMSTypegenAllFieldsCustomFieldAlphaCreate;
repeat?: (__MicroCMSTypegenAllFieldsCustomFieldBetaCreate | __MicroCMSTypegenAllFieldsCustomFieldEpsilonCreate | __MicroCMSTypegenAllFieldsCustomFieldGammaCreate | __MicroCMSTypegenAllFieldsCustomFieldAlphaCreate | __MicroCMSTypegenAllFieldsCustomFieldDeltaCreate)[];
};
type __MicroCMSTypegenAllFieldsUpdate = {
publishedAt?: string;
text?: string;
textArea?: string;
oldRich?: string;
Rich?: string;
image?: string;
images?: string[];
date?: string;
boolean?: boolean | null;
select?: ("hoge" | "hoge2")[];
num?: number | null;
file?: string;
extend?: Record<string, unknown>;
ref?: string | Record<string, never>;
multi_ref?: string[];
custom?: __MicroCMSTypegenAllFieldsCustomFieldAlphaUpdate | Record<string, never>;
repeat?: (__MicroCMSTypegenAllFieldsCustomFieldBetaUpdate | __MicroCMSTypegenAllFieldsCustomFieldEpsilonUpdate | __MicroCMSTypegenAllFieldsCustomFieldGammaUpdate | __MicroCMSTypegenAllFieldsCustomFieldAlphaUpdate | __MicroCMSTypegenAllFieldsCustomFieldDeltaUpdate)[];
};
export type ExampleServiceSchema = {
"banner": { kind: "object"; content: Banner; depths: { 0: __MicroCMSTypegenBannerRead<{ depth: 0 }>; 1: __MicroCMSTypegenBannerRead<{ depth: 1 }>; 2: __MicroCMSTypegenBannerRead<{ depth: 2 }>; 3: __MicroCMSTypegenBannerRead<{ depth: 3 }> }; fieldPaths: "createdAt" | "updatedAt" | "publishedAt" | "revisedAt" | "image" | "url" | "description"; update: __MicroCMSTypegenExpand<__MicroCMSTypegenBannerUpdate> };
"blogs": { kind: "list"; content: Blogs; depths: { 0: __MicroCMSTypegenBlogsRead<{ depth: 0 }>; 1: __MicroCMSTypegenBlogsRead<{ depth: 1 }>; 2: __MicroCMSTypegenBlogsRead<{ depth: 2 }>; 3: __MicroCMSTypegenBlogsRead<{ depth: 3 }> }; fieldPaths: "id" | "createdAt" | "updatedAt" | "publishedAt" | "revisedAt" | "title" | "content" | "eyecatch" | "category" | "category.id" | "category.createdAt" | "category.updatedAt" | "category.publishedAt" | "category.revisedAt" | "category.name"; create: __MicroCMSTypegenExpand<__MicroCMSTypegenBlogsCreate>; update: __MicroCMSTypegenExpand<__MicroCMSTypegenBlogsUpdate> };
"categories": { kind: "list"; content: Categories; depths: { 0: __MicroCMSTypegenCategoriesRead<{ depth: 0 }>; 1: __MicroCMSTypegenCategoriesRead<{ depth: 1 }>; 2: __MicroCMSTypegenCategoriesRead<{ depth: 2 }>; 3: __MicroCMSTypegenCategoriesRead<{ depth: 3 }> }; fieldPaths: "id" | "createdAt" | "updatedAt" | "publishedAt" | "revisedAt" | "name"; create: __MicroCMSTypegenExpand<__MicroCMSTypegenCategoriesCreate>; update: __MicroCMSTypegenExpand<__MicroCMSTypegenCategoriesUpdate> };
"all_fields": { kind: "list"; content: AllFields; depths: { 0: __MicroCMSTypegenAllFieldsRead<{ depth: 0 }>; 1: __MicroCMSTypegenAllFieldsRead<{ depth: 1 }>; 2: __MicroCMSTypegenAllFieldsRead<{ depth: 2 }>; 3: __MicroCMSTypegenAllFieldsRead<{ depth: 3 }> }; fieldPaths: "id" | "createdAt" | "updatedAt" | "publishedAt" | "revisedAt" | "text" | "textArea" | "oldRich" | "Rich" | "image" | "images" | "date" | "boolean" | "select" | "num" | "file" | "extend" | "ref" | "ref.id" | "ref.createdAt" | "ref.updatedAt" | "ref.publishedAt" | "ref.revisedAt" | "ref.name" | "multi_ref" | "multi_ref.id" | "multi_ref.createdAt" | "multi_ref.updatedAt" | "multi_ref.publishedAt" | "multi_ref.revisedAt" | "multi_ref.name" | "custom" | "repeat"; create: __MicroCMSTypegenExpand<__MicroCMSTypegenAllFieldsCreate>; update: __MicroCMSTypegenExpand<__MicroCMSTypegenAllFieldsUpdate> };
};