@oak-digital/types-4-strapi-2 1.0.3 → 1.0.5

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.
@@ -2,22 +2,22 @@ import { z } from 'zod';
2
2
  export declare const strapiContentType: z.ZodObject<{
3
3
  attributes: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
4
4
  __t4s_required: z.ZodOptional<z.ZodBoolean>;
5
- pluginOptions: z.ZodAny;
5
+ pluginOptions: z.ZodOptional<z.ZodAny>;
6
6
  required: z.ZodOptional<z.ZodBoolean>;
7
7
  type: z.ZodEnum<["text", "string"]>;
8
8
  }, "strip", z.ZodTypeAny, {
9
9
  __t4s_required?: boolean;
10
10
  pluginOptions?: any;
11
11
  required?: boolean;
12
- type?: "text" | "string";
12
+ type?: "string" | "text";
13
13
  }, {
14
14
  __t4s_required?: boolean;
15
15
  pluginOptions?: any;
16
16
  required?: boolean;
17
- type?: "text" | "string";
17
+ type?: "string" | "text";
18
18
  }>, z.ZodObject<{
19
19
  __t4s_required: z.ZodOptional<z.ZodBoolean>;
20
- pluginOptions: z.ZodAny;
20
+ pluginOptions: z.ZodOptional<z.ZodAny>;
21
21
  required: z.ZodOptional<z.ZodBoolean>;
22
22
  type: z.ZodLiteral<"email">;
23
23
  }, "strip", z.ZodTypeAny, {
@@ -32,7 +32,7 @@ export declare const strapiContentType: z.ZodObject<{
32
32
  type?: "email";
33
33
  }>, z.ZodObject<{
34
34
  __t4s_required: z.ZodOptional<z.ZodBoolean>;
35
- pluginOptions: z.ZodAny;
35
+ pluginOptions: z.ZodOptional<z.ZodAny>;
36
36
  required: z.ZodOptional<z.ZodBoolean>;
37
37
  type: z.ZodLiteral<"uid">;
38
38
  targetField: z.ZodOptional<z.ZodString>;
@@ -50,7 +50,7 @@ export declare const strapiContentType: z.ZodObject<{
50
50
  targetField?: string;
51
51
  }>, z.ZodObject<{
52
52
  __t4s_required: z.ZodOptional<z.ZodBoolean>;
53
- pluginOptions: z.ZodAny;
53
+ pluginOptions: z.ZodOptional<z.ZodAny>;
54
54
  required: z.ZodOptional<z.ZodBoolean>;
55
55
  type: z.ZodLiteral<"richtext">;
56
56
  }, "strip", z.ZodTypeAny, {
@@ -65,7 +65,7 @@ export declare const strapiContentType: z.ZodObject<{
65
65
  type?: "richtext";
66
66
  }>, z.ZodObject<{
67
67
  __t4s_required: z.ZodOptional<z.ZodBoolean>;
68
- pluginOptions: z.ZodAny;
68
+ pluginOptions: z.ZodOptional<z.ZodAny>;
69
69
  required: z.ZodOptional<z.ZodBoolean>;
70
70
  type: z.ZodLiteral<"json">;
71
71
  }, "strip", z.ZodTypeAny, {
@@ -80,7 +80,7 @@ export declare const strapiContentType: z.ZodObject<{
80
80
  type?: "json";
81
81
  }>, z.ZodObject<{
82
82
  __t4s_required: z.ZodOptional<z.ZodBoolean>;
83
- pluginOptions: z.ZodAny;
83
+ pluginOptions: z.ZodOptional<z.ZodAny>;
84
84
  required: z.ZodOptional<z.ZodBoolean>;
85
85
  type: z.ZodLiteral<"password">;
86
86
  }, "strip", z.ZodTypeAny, {
@@ -93,9 +93,9 @@ export declare const strapiContentType: z.ZodObject<{
93
93
  pluginOptions?: any;
94
94
  required?: boolean;
95
95
  type?: "password";
96
- }>, z.ZodUnion<[z.ZodObject<{
96
+ }>, z.ZodObject<{
97
97
  __t4s_required: z.ZodOptional<z.ZodBoolean>;
98
- pluginOptions: z.ZodAny;
98
+ pluginOptions: z.ZodOptional<z.ZodAny>;
99
99
  required: z.ZodOptional<z.ZodBoolean>;
100
100
  type: z.ZodLiteral<"integer">;
101
101
  }, "strip", z.ZodTypeAny, {
@@ -110,7 +110,7 @@ export declare const strapiContentType: z.ZodObject<{
110
110
  type?: "integer";
111
111
  }>, z.ZodObject<{
112
112
  __t4s_required: z.ZodOptional<z.ZodBoolean>;
113
- pluginOptions: z.ZodAny;
113
+ pluginOptions: z.ZodOptional<z.ZodAny>;
114
114
  required: z.ZodOptional<z.ZodBoolean>;
115
115
  type: z.ZodLiteral<"float">;
116
116
  }, "strip", z.ZodTypeAny, {
@@ -125,7 +125,7 @@ export declare const strapiContentType: z.ZodObject<{
125
125
  type?: "float";
126
126
  }>, z.ZodObject<{
127
127
  __t4s_required: z.ZodOptional<z.ZodBoolean>;
128
- pluginOptions: z.ZodAny;
128
+ pluginOptions: z.ZodOptional<z.ZodAny>;
129
129
  required: z.ZodOptional<z.ZodBoolean>;
130
130
  type: z.ZodLiteral<"biginteger">;
131
131
  }, "strip", z.ZodTypeAny, {
@@ -140,7 +140,7 @@ export declare const strapiContentType: z.ZodObject<{
140
140
  type?: "biginteger";
141
141
  }>, z.ZodObject<{
142
142
  __t4s_required: z.ZodOptional<z.ZodBoolean>;
143
- pluginOptions: z.ZodAny;
143
+ pluginOptions: z.ZodOptional<z.ZodAny>;
144
144
  required: z.ZodOptional<z.ZodBoolean>;
145
145
  type: z.ZodLiteral<"decimal">;
146
146
  }, "strip", z.ZodTypeAny, {
@@ -153,9 +153,9 @@ export declare const strapiContentType: z.ZodObject<{
153
153
  pluginOptions?: any;
154
154
  required?: boolean;
155
155
  type?: "decimal";
156
- }>]>, z.ZodObject<{
156
+ }>, z.ZodObject<{
157
157
  __t4s_required: z.ZodOptional<z.ZodBoolean>;
158
- pluginOptions: z.ZodAny;
158
+ pluginOptions: z.ZodOptional<z.ZodAny>;
159
159
  required: z.ZodOptional<z.ZodBoolean>;
160
160
  type: z.ZodLiteral<"enumeration">;
161
161
  enum: z.ZodArray<z.ZodString, "many">;
@@ -171,9 +171,9 @@ export declare const strapiContentType: z.ZodObject<{
171
171
  required?: boolean;
172
172
  type?: "enumeration";
173
173
  enum?: string[];
174
- }>, z.ZodUnion<[z.ZodObject<{
174
+ }>, z.ZodObject<{
175
175
  __t4s_required: z.ZodOptional<z.ZodBoolean>;
176
- pluginOptions: z.ZodAny;
176
+ pluginOptions: z.ZodOptional<z.ZodAny>;
177
177
  required: z.ZodOptional<z.ZodBoolean>;
178
178
  type: z.ZodLiteral<"date">;
179
179
  }, "strip", z.ZodTypeAny, {
@@ -188,7 +188,7 @@ export declare const strapiContentType: z.ZodObject<{
188
188
  type?: "date";
189
189
  }>, z.ZodObject<{
190
190
  __t4s_required: z.ZodOptional<z.ZodBoolean>;
191
- pluginOptions: z.ZodAny;
191
+ pluginOptions: z.ZodOptional<z.ZodAny>;
192
192
  required: z.ZodOptional<z.ZodBoolean>;
193
193
  type: z.ZodLiteral<"datetime">;
194
194
  }, "strip", z.ZodTypeAny, {
@@ -203,7 +203,7 @@ export declare const strapiContentType: z.ZodObject<{
203
203
  type?: "datetime";
204
204
  }>, z.ZodObject<{
205
205
  __t4s_required: z.ZodOptional<z.ZodBoolean>;
206
- pluginOptions: z.ZodAny;
206
+ pluginOptions: z.ZodOptional<z.ZodAny>;
207
207
  required: z.ZodOptional<z.ZodBoolean>;
208
208
  type: z.ZodLiteral<"time">;
209
209
  }, "strip", z.ZodTypeAny, {
@@ -216,9 +216,9 @@ export declare const strapiContentType: z.ZodObject<{
216
216
  pluginOptions?: any;
217
217
  required?: boolean;
218
218
  type?: "time";
219
- }>]>, z.ZodObject<{
219
+ }>, z.ZodObject<{
220
220
  __t4s_required: z.ZodOptional<z.ZodBoolean>;
221
- pluginOptions: z.ZodAny;
221
+ pluginOptions: z.ZodOptional<z.ZodAny>;
222
222
  required: z.ZodOptional<z.ZodBoolean>;
223
223
  type: z.ZodLiteral<"media">;
224
224
  multiple: z.ZodOptional<z.ZodBoolean>;
@@ -239,7 +239,7 @@ export declare const strapiContentType: z.ZodObject<{
239
239
  allowedTypes?: ("images" | "videos" | "audios" | "files")[];
240
240
  }>, z.ZodObject<{
241
241
  __t4s_required: z.ZodOptional<z.ZodBoolean>;
242
- pluginOptions: z.ZodAny;
242
+ pluginOptions: z.ZodOptional<z.ZodAny>;
243
243
  required: z.ZodOptional<z.ZodBoolean>;
244
244
  type: z.ZodLiteral<"boolean">;
245
245
  }, "strip", z.ZodTypeAny, {
@@ -252,9 +252,9 @@ export declare const strapiContentType: z.ZodObject<{
252
252
  pluginOptions?: any;
253
253
  required?: boolean;
254
254
  type?: "boolean";
255
- }>, z.ZodUnion<[z.ZodObject<{
255
+ }>, z.ZodObject<{
256
256
  __t4s_required: z.ZodOptional<z.ZodBoolean>;
257
- pluginOptions: z.ZodAny;
257
+ pluginOptions: z.ZodOptional<z.ZodAny>;
258
258
  required: z.ZodOptional<z.ZodBoolean>;
259
259
  type: z.ZodLiteral<"relation">;
260
260
  target: z.ZodString;
@@ -275,7 +275,7 @@ export declare const strapiContentType: z.ZodObject<{
275
275
  relation?: "oneToOne";
276
276
  }>, z.ZodObject<{
277
277
  __t4s_required: z.ZodOptional<z.ZodBoolean>;
278
- pluginOptions: z.ZodAny;
278
+ pluginOptions: z.ZodOptional<z.ZodAny>;
279
279
  required: z.ZodOptional<z.ZodBoolean>;
280
280
  type: z.ZodLiteral<"relation">;
281
281
  target: z.ZodString;
@@ -299,7 +299,7 @@ export declare const strapiContentType: z.ZodObject<{
299
299
  inversedBy?: string;
300
300
  }>, z.ZodObject<{
301
301
  __t4s_required: z.ZodOptional<z.ZodBoolean>;
302
- pluginOptions: z.ZodAny;
302
+ pluginOptions: z.ZodOptional<z.ZodAny>;
303
303
  required: z.ZodOptional<z.ZodBoolean>;
304
304
  type: z.ZodLiteral<"relation">;
305
305
  target: z.ZodString;
@@ -323,7 +323,7 @@ export declare const strapiContentType: z.ZodObject<{
323
323
  relation?: "oneToMany";
324
324
  }>, z.ZodObject<{
325
325
  __t4s_required: z.ZodOptional<z.ZodBoolean>;
326
- pluginOptions: z.ZodAny;
326
+ pluginOptions: z.ZodOptional<z.ZodAny>;
327
327
  required: z.ZodOptional<z.ZodBoolean>;
328
328
  type: z.ZodLiteral<"relation">;
329
329
  target: z.ZodString;
@@ -347,7 +347,7 @@ export declare const strapiContentType: z.ZodObject<{
347
347
  inversedBy?: string;
348
348
  }>, z.ZodObject<{
349
349
  __t4s_required: z.ZodOptional<z.ZodBoolean>;
350
- pluginOptions: z.ZodAny;
350
+ pluginOptions: z.ZodOptional<z.ZodAny>;
351
351
  required: z.ZodOptional<z.ZodBoolean>;
352
352
  type: z.ZodLiteral<"relation">;
353
353
  target: z.ZodString;
@@ -374,7 +374,7 @@ export declare const strapiContentType: z.ZodObject<{
374
374
  mappedBy?: string;
375
375
  }>, z.ZodObject<{
376
376
  __t4s_required: z.ZodOptional<z.ZodBoolean>;
377
- pluginOptions: z.ZodAny;
377
+ pluginOptions: z.ZodOptional<z.ZodAny>;
378
378
  required: z.ZodOptional<z.ZodBoolean>;
379
379
  type: z.ZodLiteral<"relation">;
380
380
  target: z.ZodString;
@@ -394,26 +394,44 @@ export declare const strapiContentType: z.ZodObject<{
394
394
  target?: string;
395
395
  relation?: "oneToMany";
396
396
  }>, z.ZodObject<{
397
+ __t4s_required: z.ZodOptional<z.ZodBoolean>;
398
+ pluginOptions: z.ZodOptional<z.ZodAny>;
399
+ required: z.ZodOptional<z.ZodBoolean>;
397
400
  type: z.ZodLiteral<"relation">;
398
401
  relation: z.ZodLiteral<"morphToMany">;
399
402
  }, "strip", z.ZodTypeAny, {
403
+ __t4s_required?: boolean;
404
+ pluginOptions?: any;
405
+ required?: boolean;
400
406
  type?: "relation";
401
407
  relation?: "morphToMany";
402
408
  }, {
409
+ __t4s_required?: boolean;
410
+ pluginOptions?: any;
411
+ required?: boolean;
403
412
  type?: "relation";
404
413
  relation?: "morphToMany";
405
414
  }>, z.ZodObject<{
415
+ __t4s_required: z.ZodOptional<z.ZodBoolean>;
416
+ pluginOptions: z.ZodOptional<z.ZodAny>;
417
+ required: z.ZodOptional<z.ZodBoolean>;
406
418
  type: z.ZodLiteral<"relation">;
407
419
  relation: z.ZodLiteral<"morphToOne">;
408
420
  }, "strip", z.ZodTypeAny, {
421
+ __t4s_required?: boolean;
422
+ pluginOptions?: any;
423
+ required?: boolean;
409
424
  type?: "relation";
410
425
  relation?: "morphToOne";
411
426
  }, {
427
+ __t4s_required?: boolean;
428
+ pluginOptions?: any;
429
+ required?: boolean;
412
430
  type?: "relation";
413
431
  relation?: "morphToOne";
414
- }>]>, z.ZodObject<{
432
+ }>, z.ZodObject<{
415
433
  __t4s_required: z.ZodOptional<z.ZodBoolean>;
416
- pluginOptions: z.ZodAny;
434
+ pluginOptions: z.ZodOptional<z.ZodAny>;
417
435
  required: z.ZodOptional<z.ZodBoolean>;
418
436
  type: z.ZodLiteral<"component">;
419
437
  repeatable: z.ZodOptional<z.ZodBoolean>;
@@ -432,9 +450,24 @@ export declare const strapiContentType: z.ZodObject<{
432
450
  type?: "component";
433
451
  repeatable?: boolean;
434
452
  component?: string;
435
- }>]>, z.ZodObject<{
453
+ }>, z.ZodObject<{
436
454
  __t4s_required: z.ZodOptional<z.ZodBoolean>;
437
- pluginOptions: z.ZodAny;
455
+ pluginOptions: z.ZodOptional<z.ZodAny>;
456
+ required: z.ZodOptional<z.ZodBoolean>;
457
+ type: z.ZodEffects<z.ZodType<"any", z.ZodTypeDef, "any">, "any", "any">;
458
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
459
+ __t4s_required: z.ZodOptional<z.ZodBoolean>;
460
+ pluginOptions: z.ZodOptional<z.ZodAny>;
461
+ required: z.ZodOptional<z.ZodBoolean>;
462
+ type: z.ZodEffects<z.ZodType<"any", z.ZodTypeDef, "any">, "any", "any">;
463
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
464
+ __t4s_required: z.ZodOptional<z.ZodBoolean>;
465
+ pluginOptions: z.ZodOptional<z.ZodAny>;
466
+ required: z.ZodOptional<z.ZodBoolean>;
467
+ type: z.ZodEffects<z.ZodType<"any", z.ZodTypeDef, "any">, "any", "any">;
468
+ }, z.ZodTypeAny, "passthrough">>]>, z.ZodObject<{
469
+ __t4s_required: z.ZodOptional<z.ZodBoolean>;
470
+ pluginOptions: z.ZodOptional<z.ZodAny>;
438
471
  required: z.ZodOptional<z.ZodBoolean>;
439
472
  type: z.ZodLiteral<"dynamiczone">;
440
473
  components: z.ZodArray<z.ZodString, "many">;
@@ -466,7 +499,7 @@ export declare const strapiContentType: z.ZodObject<{
466
499
  __t4s_required?: boolean;
467
500
  pluginOptions?: any;
468
501
  required?: boolean;
469
- type?: "text" | "string";
502
+ type?: "string" | "text";
470
503
  } | {
471
504
  __t4s_required?: boolean;
472
505
  pluginOptions?: any;
@@ -594,9 +627,15 @@ export declare const strapiContentType: z.ZodObject<{
594
627
  target?: string;
595
628
  relation?: "oneToMany";
596
629
  } | {
630
+ __t4s_required?: boolean;
631
+ pluginOptions?: any;
632
+ required?: boolean;
597
633
  type?: "relation";
598
634
  relation?: "morphToMany";
599
635
  } | {
636
+ __t4s_required?: boolean;
637
+ pluginOptions?: any;
638
+ required?: boolean;
600
639
  type?: "relation";
601
640
  relation?: "morphToOne";
602
641
  } | {
@@ -612,7 +651,12 @@ export declare const strapiContentType: z.ZodObject<{
612
651
  required?: boolean;
613
652
  type?: "dynamiczone";
614
653
  components?: string[];
615
- }>;
654
+ } | z.objectOutputType<{
655
+ __t4s_required: z.ZodOptional<z.ZodBoolean>;
656
+ pluginOptions: z.ZodOptional<z.ZodAny>;
657
+ required: z.ZodOptional<z.ZodBoolean>;
658
+ type: z.ZodEffects<z.ZodType<"any", z.ZodTypeDef, "any">, "any", "any">;
659
+ }, z.ZodTypeAny, "passthrough">>;
616
660
  collectionName?: string;
617
661
  options?: {
618
662
  draftAndPublish?: boolean;
@@ -624,7 +668,7 @@ export declare const strapiContentType: z.ZodObject<{
624
668
  __t4s_required?: boolean;
625
669
  pluginOptions?: any;
626
670
  required?: boolean;
627
- type?: "text" | "string";
671
+ type?: "string" | "text";
628
672
  } | {
629
673
  __t4s_required?: boolean;
630
674
  pluginOptions?: any;
@@ -752,9 +796,15 @@ export declare const strapiContentType: z.ZodObject<{
752
796
  target?: string;
753
797
  relation?: "oneToMany";
754
798
  } | {
799
+ __t4s_required?: boolean;
800
+ pluginOptions?: any;
801
+ required?: boolean;
755
802
  type?: "relation";
756
803
  relation?: "morphToMany";
757
804
  } | {
805
+ __t4s_required?: boolean;
806
+ pluginOptions?: any;
807
+ required?: boolean;
758
808
  type?: "relation";
759
809
  relation?: "morphToOne";
760
810
  } | {
@@ -770,7 +820,12 @@ export declare const strapiContentType: z.ZodObject<{
770
820
  required?: boolean;
771
821
  type?: "dynamiczone";
772
822
  components?: string[];
773
- }>;
823
+ } | z.objectInputType<{
824
+ __t4s_required: z.ZodOptional<z.ZodBoolean>;
825
+ pluginOptions: z.ZodOptional<z.ZodAny>;
826
+ required: z.ZodOptional<z.ZodBoolean>;
827
+ type: z.ZodEffects<z.ZodType<"any", z.ZodTypeDef, "any">, "any", "any">;
828
+ }, z.ZodTypeAny, "passthrough">>;
774
829
  collectionName?: string;
775
830
  options?: {
776
831
  draftAndPublish?: boolean;
@@ -778,4 +833,4 @@ export declare const strapiContentType: z.ZodObject<{
778
833
  pluginOptions?: Record<string, any>;
779
834
  uid?: string;
780
835
  }>;
781
- export declare type StrapiContentType = z.infer<typeof strapiContentType>;
836
+ export type StrapiContentType = z.infer<typeof strapiContentType>;
@@ -1,4 +1,4 @@
1
1
  export declare const caseTypesArray: readonly ["camel", "capital", "dot", "snake", "pascal", "constant", "kebab"];
2
- export declare type caseType = typeof caseTypesArray[number];
2
+ export type caseType = typeof caseTypesArray[number];
3
3
  export declare function checkCaseType(caseName: caseType): caseName is caseType;
4
4
  export declare function changeCase(text: string, caseName: caseType): string;
@@ -1,7 +1,7 @@
1
1
  import { File } from '../file/File';
2
2
  import { InterfaceWriter } from './types/writer';
3
3
  import prettier from 'prettier';
4
- declare type BasicWriterOptions = {
4
+ type BasicWriterOptions = {
5
5
  /**
6
6
  * Warning: this will delete all files in the output directory!
7
7
  * @default false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oak-digital/types-4-strapi-2",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Typescript interface generator for Strapi 4 models",
5
5
  "bin": {
6
6
  "t4s": "./bin/index.js"
@@ -30,7 +30,7 @@
30
30
  "eslint": "^8.22.0",
31
31
  "rimraf": "^4.4.1",
32
32
  "ts-node": "^10.9.1",
33
- "typescript": "^4.7.4"
33
+ "typescript": "^5.4.5"
34
34
  },
35
35
  "dependencies": {
36
36
  "change-case": "^4.1.2",