@oak-digital/types-4-strapi-2 1.0.6 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/content-types/reader.js +5 -6
- package/lib/interface/builtinInterfaces.d.ts +330 -218
- package/lib/interface/builtinInterfaces.js +3 -3
- package/lib/program/InterfaceManager.d.ts +13 -186
- package/lib/readers/by-file.d.ts +13 -186
- package/lib/readers/load-strapi/index.d.ts +14 -186
- package/lib/readers/types/attributes.d.ts +374 -528
- package/lib/readers/types/attributes.js +1 -1
- package/lib/readers/types/component.d.ts +99 -62
- package/lib/readers/types/content-type.d.ts +125 -87
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/utils/casing/index.js +3 -3
- package/lib/utils/index.js +2 -3
- package/package.json +57 -49
- package/.editorconfig +0 -9
- package/.eslintrc.json +0 -49
- package/.github/workflows/publish.yml +0 -48
- package/.prettierrc.json +0 -8
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { StrapiContentType } from '../types/content-type';
|
|
2
3
|
import { ContentTypeReader } from '../types/content-type-reader';
|
|
3
4
|
export declare class LoadStrapiReader implements ContentTypeReader {
|
|
4
5
|
private strapiRoot;
|
|
@@ -6,189 +7,17 @@ export declare class LoadStrapiReader implements ContentTypeReader {
|
|
|
6
7
|
constructor(strapiRoot: string);
|
|
7
8
|
readContentTypes(): Promise<Record<`api::${string}` | `plugin::${string}` | `admin::${string}` | `builtins::${string}`, {
|
|
8
9
|
name: string;
|
|
9
|
-
contentType:
|
|
10
|
-
attributes?: Record<string, {
|
|
11
|
-
__t4s_required?: boolean;
|
|
12
|
-
pluginOptions?: any;
|
|
13
|
-
required?: boolean;
|
|
14
|
-
type?: "string" | "text";
|
|
15
|
-
} | {
|
|
16
|
-
__t4s_required?: boolean;
|
|
17
|
-
pluginOptions?: any;
|
|
18
|
-
required?: boolean;
|
|
19
|
-
type?: "email";
|
|
20
|
-
} | {
|
|
21
|
-
__t4s_required?: boolean;
|
|
22
|
-
pluginOptions?: any;
|
|
23
|
-
required?: boolean;
|
|
24
|
-
type?: "uid";
|
|
25
|
-
targetField?: string;
|
|
26
|
-
} | {
|
|
27
|
-
__t4s_required?: boolean;
|
|
28
|
-
pluginOptions?: any;
|
|
29
|
-
required?: boolean;
|
|
30
|
-
type?: "richtext";
|
|
31
|
-
} | {
|
|
32
|
-
__t4s_required?: boolean;
|
|
33
|
-
pluginOptions?: any;
|
|
34
|
-
required?: boolean;
|
|
35
|
-
type?: "blocks";
|
|
36
|
-
} | {
|
|
37
|
-
__t4s_required?: boolean;
|
|
38
|
-
pluginOptions?: any;
|
|
39
|
-
required?: boolean;
|
|
40
|
-
type?: "json";
|
|
41
|
-
} | {
|
|
42
|
-
__t4s_required?: boolean;
|
|
43
|
-
pluginOptions?: any;
|
|
44
|
-
required?: boolean;
|
|
45
|
-
type?: "password";
|
|
46
|
-
} | {
|
|
47
|
-
__t4s_required?: boolean;
|
|
48
|
-
pluginOptions?: any;
|
|
49
|
-
required?: boolean;
|
|
50
|
-
type?: "integer";
|
|
51
|
-
} | {
|
|
52
|
-
__t4s_required?: boolean;
|
|
53
|
-
pluginOptions?: any;
|
|
54
|
-
required?: boolean;
|
|
55
|
-
type?: "float";
|
|
56
|
-
} | {
|
|
57
|
-
__t4s_required?: boolean;
|
|
58
|
-
pluginOptions?: any;
|
|
59
|
-
required?: boolean;
|
|
60
|
-
type?: "biginteger";
|
|
61
|
-
} | {
|
|
62
|
-
__t4s_required?: boolean;
|
|
63
|
-
pluginOptions?: any;
|
|
64
|
-
required?: boolean;
|
|
65
|
-
type?: "decimal";
|
|
66
|
-
} | {
|
|
67
|
-
__t4s_required?: boolean;
|
|
68
|
-
pluginOptions?: any;
|
|
69
|
-
required?: boolean;
|
|
70
|
-
type?: "enumeration";
|
|
71
|
-
enum?: string[];
|
|
72
|
-
} | {
|
|
73
|
-
__t4s_required?: boolean;
|
|
74
|
-
pluginOptions?: any;
|
|
75
|
-
required?: boolean;
|
|
76
|
-
type?: "date";
|
|
77
|
-
} | {
|
|
78
|
-
__t4s_required?: boolean;
|
|
79
|
-
pluginOptions?: any;
|
|
80
|
-
required?: boolean;
|
|
81
|
-
type?: "datetime";
|
|
82
|
-
} | {
|
|
83
|
-
__t4s_required?: boolean;
|
|
84
|
-
pluginOptions?: any;
|
|
85
|
-
required?: boolean;
|
|
86
|
-
type?: "time";
|
|
87
|
-
} | {
|
|
88
|
-
__t4s_required?: boolean;
|
|
89
|
-
pluginOptions?: any;
|
|
90
|
-
required?: boolean;
|
|
91
|
-
type?: "media";
|
|
92
|
-
multiple?: boolean;
|
|
93
|
-
allowedTypes?: ("images" | "videos" | "audios" | "files")[];
|
|
94
|
-
} | {
|
|
95
|
-
__t4s_required?: boolean;
|
|
96
|
-
pluginOptions?: any;
|
|
97
|
-
required?: boolean;
|
|
98
|
-
type?: "boolean";
|
|
99
|
-
} | {
|
|
100
|
-
__t4s_required?: boolean;
|
|
101
|
-
pluginOptions?: any;
|
|
102
|
-
required?: boolean;
|
|
103
|
-
type?: "relation";
|
|
104
|
-
target?: string;
|
|
105
|
-
relation?: "oneToOne";
|
|
106
|
-
} | {
|
|
107
|
-
__t4s_required?: boolean;
|
|
108
|
-
pluginOptions?: any;
|
|
109
|
-
required?: boolean;
|
|
110
|
-
type?: "relation";
|
|
111
|
-
target?: string;
|
|
112
|
-
relation?: "oneToOne";
|
|
113
|
-
inversedBy?: string;
|
|
114
|
-
} | {
|
|
115
|
-
__t4s_required?: boolean;
|
|
116
|
-
pluginOptions?: any;
|
|
117
|
-
required?: boolean;
|
|
118
|
-
type?: "relation";
|
|
119
|
-
target?: string;
|
|
120
|
-
mappedBy?: string;
|
|
121
|
-
relation?: "oneToMany";
|
|
122
|
-
} | {
|
|
123
|
-
__t4s_required?: boolean;
|
|
124
|
-
pluginOptions?: any;
|
|
125
|
-
required?: boolean;
|
|
126
|
-
type?: "relation";
|
|
127
|
-
target?: string;
|
|
128
|
-
relation?: "manyToOne";
|
|
129
|
-
inversedBy?: string;
|
|
130
|
-
} | {
|
|
131
|
-
__t4s_required?: boolean;
|
|
132
|
-
pluginOptions?: any;
|
|
133
|
-
required?: boolean;
|
|
134
|
-
type?: "relation";
|
|
135
|
-
target?: string;
|
|
136
|
-
relation?: "manyToMany";
|
|
137
|
-
inversedBy?: string;
|
|
138
|
-
mappedBy?: string;
|
|
139
|
-
} | {
|
|
140
|
-
__t4s_required?: boolean;
|
|
141
|
-
pluginOptions?: any;
|
|
142
|
-
required?: boolean;
|
|
143
|
-
type?: "relation";
|
|
144
|
-
target?: string;
|
|
145
|
-
relation?: "oneToMany";
|
|
146
|
-
} | {
|
|
147
|
-
__t4s_required?: boolean;
|
|
148
|
-
pluginOptions?: any;
|
|
149
|
-
required?: boolean;
|
|
150
|
-
type?: "relation";
|
|
151
|
-
relation?: "morphToMany";
|
|
152
|
-
} | {
|
|
153
|
-
__t4s_required?: boolean;
|
|
154
|
-
pluginOptions?: any;
|
|
155
|
-
required?: boolean;
|
|
156
|
-
type?: "relation";
|
|
157
|
-
relation?: "morphToOne";
|
|
158
|
-
} | {
|
|
159
|
-
__t4s_required?: boolean;
|
|
160
|
-
pluginOptions?: any;
|
|
161
|
-
required?: boolean;
|
|
162
|
-
type?: "component";
|
|
163
|
-
repeatable?: boolean;
|
|
164
|
-
component?: string;
|
|
165
|
-
} | {
|
|
166
|
-
__t4s_required?: boolean;
|
|
167
|
-
pluginOptions?: any;
|
|
168
|
-
required?: boolean;
|
|
169
|
-
type?: "dynamiczone";
|
|
170
|
-
components?: string[];
|
|
171
|
-
} | z.objectOutputType<{
|
|
172
|
-
__t4s_required: z.ZodOptional<z.ZodBoolean>;
|
|
173
|
-
pluginOptions: z.ZodOptional<z.ZodAny>;
|
|
174
|
-
required: z.ZodOptional<z.ZodBoolean>;
|
|
175
|
-
type: z.ZodEffects<z.ZodType<"any", z.ZodTypeDef, "any">, "any", "any">;
|
|
176
|
-
}, z.ZodTypeAny, "passthrough">>;
|
|
177
|
-
collectionName?: string;
|
|
178
|
-
options?: {
|
|
179
|
-
draftAndPublish?: boolean;
|
|
180
|
-
};
|
|
181
|
-
pluginOptions?: Record<string, any>;
|
|
182
|
-
uid?: string;
|
|
183
|
-
};
|
|
10
|
+
contentType: StrapiContentType;
|
|
184
11
|
} & ({
|
|
185
12
|
namespace: "api" | "plugin";
|
|
186
13
|
collection: string;
|
|
187
14
|
} | {
|
|
188
15
|
namespace: "admin";
|
|
189
|
-
collection?: null;
|
|
16
|
+
collection?: null | undefined;
|
|
190
17
|
})>>;
|
|
191
18
|
readComponents(): Promise<Record<string, {
|
|
19
|
+
options?: {};
|
|
20
|
+
uid?: string;
|
|
192
21
|
collectionName?: string;
|
|
193
22
|
attributes?: Record<string, {
|
|
194
23
|
__t4s_required?: boolean;
|
|
@@ -284,39 +113,39 @@ export declare class LoadStrapiReader implements ContentTypeReader {
|
|
|
284
113
|
pluginOptions?: any;
|
|
285
114
|
required?: boolean;
|
|
286
115
|
type?: "relation";
|
|
287
|
-
target?: string;
|
|
288
116
|
relation?: "oneToOne";
|
|
117
|
+
target?: string;
|
|
289
118
|
} | {
|
|
290
119
|
__t4s_required?: boolean;
|
|
291
120
|
pluginOptions?: any;
|
|
292
121
|
required?: boolean;
|
|
293
122
|
type?: "relation";
|
|
294
|
-
target?: string;
|
|
295
123
|
relation?: "oneToOne";
|
|
124
|
+
target?: string;
|
|
296
125
|
inversedBy?: string;
|
|
297
126
|
} | {
|
|
298
127
|
__t4s_required?: boolean;
|
|
299
128
|
pluginOptions?: any;
|
|
300
129
|
required?: boolean;
|
|
301
130
|
type?: "relation";
|
|
131
|
+
relation?: "oneToMany";
|
|
302
132
|
target?: string;
|
|
303
133
|
mappedBy?: string;
|
|
304
|
-
relation?: "oneToMany";
|
|
305
134
|
} | {
|
|
306
135
|
__t4s_required?: boolean;
|
|
307
136
|
pluginOptions?: any;
|
|
308
137
|
required?: boolean;
|
|
309
138
|
type?: "relation";
|
|
310
|
-
target?: string;
|
|
311
139
|
relation?: "manyToOne";
|
|
140
|
+
target?: string;
|
|
312
141
|
inversedBy?: string;
|
|
313
142
|
} | {
|
|
314
143
|
__t4s_required?: boolean;
|
|
315
144
|
pluginOptions?: any;
|
|
316
145
|
required?: boolean;
|
|
317
146
|
type?: "relation";
|
|
318
|
-
target?: string;
|
|
319
147
|
relation?: "manyToMany";
|
|
148
|
+
target?: string;
|
|
320
149
|
inversedBy?: string;
|
|
321
150
|
mappedBy?: string;
|
|
322
151
|
} | {
|
|
@@ -324,8 +153,8 @@ export declare class LoadStrapiReader implements ContentTypeReader {
|
|
|
324
153
|
pluginOptions?: any;
|
|
325
154
|
required?: boolean;
|
|
326
155
|
type?: "relation";
|
|
327
|
-
target?: string;
|
|
328
156
|
relation?: "oneToMany";
|
|
157
|
+
target?: string;
|
|
329
158
|
} | {
|
|
330
159
|
__t4s_required?: boolean;
|
|
331
160
|
pluginOptions?: any;
|
|
@@ -343,16 +172,15 @@ export declare class LoadStrapiReader implements ContentTypeReader {
|
|
|
343
172
|
pluginOptions?: any;
|
|
344
173
|
required?: boolean;
|
|
345
174
|
type?: "component";
|
|
346
|
-
repeatable?: boolean;
|
|
347
175
|
component?: string;
|
|
176
|
+
repeatable?: boolean;
|
|
348
177
|
} | z.objectOutputType<{
|
|
349
|
-
__t4s_required: z.ZodOptional<z.ZodBoolean>;
|
|
350
178
|
pluginOptions: z.ZodOptional<z.ZodAny>;
|
|
351
179
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
180
|
+
__t4s_required: z.ZodOptional<z.ZodBoolean>;
|
|
181
|
+
} & {
|
|
352
182
|
type: z.ZodEffects<z.ZodType<"any", z.ZodTypeDef, "any">, "any", "any">;
|
|
353
183
|
}, z.ZodTypeAny, "passthrough">>;
|
|
354
|
-
options?: {};
|
|
355
|
-
uid?: string;
|
|
356
184
|
}>>;
|
|
357
185
|
private loadStrapi;
|
|
358
186
|
}
|