@liminalfunctions/framework 1.0.66 → 1.0.67
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/dist/code_generation/utils/type_from_zod.js +2 -1
- package/dist/code_generation/utils/type_from_zod.js.map +1 -1
- package/package.json +1 -1
- package/src/code_generation/utils/type_from_zod.ts +2 -1
- package/test/2_0_client_library_basic_type_generation.test.ts +18 -18
- package/test/2_0_client_library_query_type_generation.test.ts +13 -13
- package/test/tmp/dist/types/brief_news_category_query.d.ts +5 -5
- package/test/tmp/dist/types/client_query.d.ts +3 -3
- package/test/tmp/dist/types/institution_query.d.ts +2 -2
- package/test/tmp/dist/types/project.d.ts +2 -2
- package/test/tmp/dist/types/project_post.d.ts +2 -2
- package/test/tmp/dist/types/project_put.d.ts +2 -2
- package/test/tmp/dist/types/project_query.d.ts +4 -4
- package/test/tmp/src/types/brief_news_category_query.ts +5 -5
- package/test/tmp/src/types/client_query.ts +3 -3
- package/test/tmp/src/types/institution_query.ts +2 -2
- package/test/tmp/src/types/project.ts +2 -2
- package/test/tmp/src/types/project_post.ts +2 -2
- package/test/tmp/src/types/project_put.ts +2 -2
- package/test/tmp/src/types/project_query.ts +4 -4
|
@@ -97,7 +97,8 @@ function parse_object(def, indent_level, loop_detector, skip_once) {
|
|
|
97
97
|
}
|
|
98
98
|
function parse_array(def, indent_level, loop_detector, skip_once) {
|
|
99
99
|
let retval = parse_zod(def.element, indent_level + 1, loop_detector, skip_once);
|
|
100
|
-
retval[
|
|
100
|
+
retval[0] = `(${retval[0]}`;
|
|
101
|
+
retval[retval.length - 1] = `${retval[retval.length - 1]})[]`;
|
|
101
102
|
return retval;
|
|
102
103
|
}
|
|
103
104
|
function parse_enum(def) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type_from_zod.js","sourceRoot":"","sources":["../../../src/code_generation/utils/type_from_zod.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MA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E,aAAa,EAAE,SAAS,CAAC,CAAC,CAAC;IACzG,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,KAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,GAAG,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QACxB,IAAG,CAAC,KAAK,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC1B,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;QACtD,CAAC;IACL,CAAC;IACD,OAAO,GAAG,CAAC;AACf,CAAC;AAGD,MAAM,mBAAmB,GAAG,sDAAsD,CAAA;AAClF,SAAS,YAAY,CAAC,SAAiB,EAAE;IACrC,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,KAAK,IAAI,CAAC,GAAG,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;QAAE,MAAM,IAAI,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC;IACvH,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
package/package.json
CHANGED
|
@@ -117,7 +117,8 @@ function parse_object(def: z.core.$ZodObjectDef, indent_level: number, loop_dete
|
|
|
117
117
|
function parse_array(def: z.core.$ZodArrayDef, indent_level: number, loop_detector: Map<any, validator_group>, skip_once: z.core.$ZodTypeDef): any {
|
|
118
118
|
//@ts-ignore
|
|
119
119
|
let retval = parse_zod(def.element as z.ZodType, indent_level + 1, loop_detector, skip_once)
|
|
120
|
-
retval[
|
|
120
|
+
retval[0] = `(${retval[0]}`
|
|
121
|
+
retval[retval.length - 1] = `${retval[retval.length - 1]})[]`
|
|
121
122
|
return retval;
|
|
122
123
|
}
|
|
123
124
|
|
|
@@ -296,7 +296,7 @@ describe('Client Library Generation: Basic Types', function () {
|
|
|
296
296
|
remove_whitespace(await readFile('./test/tmp/src/types/test_collection.ts', { encoding: 'utf-8' })),
|
|
297
297
|
remove_whitespace(`export type test_collection = {
|
|
298
298
|
"_id": string
|
|
299
|
-
"test": ("red" | "green" | "blue")[]
|
|
299
|
+
"test": (("red" | "green" | "blue"))[]
|
|
300
300
|
}`)
|
|
301
301
|
)
|
|
302
302
|
});
|
|
@@ -382,10 +382,10 @@ describe('Client Library Generation: Basic Types', function () {
|
|
|
382
382
|
remove_whitespace(await readFile('./test/tmp/src/types/test_collection.ts', { encoding: 'utf-8' })),
|
|
383
383
|
remove_whitespace(`export type test_collection = {
|
|
384
384
|
"_id": string
|
|
385
|
-
"field_string": string[]
|
|
386
|
-
"field_number": number[]
|
|
387
|
-
"field_boolean": boolean[]
|
|
388
|
-
"field_date": Date[]
|
|
385
|
+
"field_string": (string)[]
|
|
386
|
+
"field_number": (number)[]
|
|
387
|
+
"field_boolean": (boolean)[]
|
|
388
|
+
"field_date": (Date)[]
|
|
389
389
|
}`)
|
|
390
390
|
)
|
|
391
391
|
});
|
|
@@ -413,12 +413,12 @@ describe('Client Library Generation: Basic Types', function () {
|
|
|
413
413
|
remove_whitespace(await readFile('./test/tmp/src/types/test_collection.ts', { encoding: 'utf-8' })),
|
|
414
414
|
remove_whitespace(`export type test_collection = {
|
|
415
415
|
"_id": string
|
|
416
|
-
"field_array": {
|
|
417
|
-
"field_string": string[]
|
|
418
|
-
"field_number": number[]
|
|
419
|
-
"field_boolean": boolean[]
|
|
420
|
-
"field_date": Date[]
|
|
421
|
-
}[]
|
|
416
|
+
"field_array": ({
|
|
417
|
+
"field_string": (string)[]
|
|
418
|
+
"field_number": (number)[]
|
|
419
|
+
"field_boolean": (boolean)[]
|
|
420
|
+
"field_date": (Date)[]
|
|
421
|
+
})[]
|
|
422
422
|
}`)
|
|
423
423
|
)
|
|
424
424
|
});
|
|
@@ -447,12 +447,12 @@ describe('Client Library Generation: Basic Types', function () {
|
|
|
447
447
|
remove_whitespace(await readFile('./test/tmp/src/types/test_collection.ts', { encoding: 'utf-8' })),
|
|
448
448
|
remove_whitespace(`export type test_collection = {
|
|
449
449
|
"_id": string
|
|
450
|
-
"field_array": {
|
|
451
|
-
"field_string": string[]
|
|
452
|
-
"field_number": number[]
|
|
453
|
-
"field_boolean": boolean[]
|
|
454
|
-
"field_date": Date[]
|
|
455
|
-
}[][]
|
|
450
|
+
"field_array": (({
|
|
451
|
+
"field_string": (string)[]
|
|
452
|
+
"field_number": (number)[]
|
|
453
|
+
"field_boolean": (boolean)[]
|
|
454
|
+
"field_date": (Date)[]
|
|
455
|
+
})[])[]
|
|
456
456
|
}`)
|
|
457
457
|
)
|
|
458
458
|
});
|
|
@@ -587,7 +587,7 @@ describe('Client Library Generation: Basic Types', function () {
|
|
|
587
587
|
remove_whitespace(await readFile('./test/tmp/src/types/test_collection.ts', { encoding: 'utf-8' })),
|
|
588
588
|
remove_whitespace(`export type test_collection = {
|
|
589
589
|
"_id": string
|
|
590
|
-
"test": {[key: string]: string[]}
|
|
590
|
+
"test": {[key: string]: (string)[]}
|
|
591
591
|
}`)
|
|
592
592
|
)
|
|
593
593
|
});
|
|
@@ -65,7 +65,7 @@ describe('Client Library Generation: Query Types', function () {
|
|
|
65
65
|
"_id"?: string
|
|
66
66
|
"_id_gt"?: string
|
|
67
67
|
"_id_lt"?: string
|
|
68
|
-
"_id_in"?: string[]
|
|
68
|
+
"_id_in"?: (string)[]
|
|
69
69
|
"sort"?: ("_id")
|
|
70
70
|
}`)
|
|
71
71
|
)
|
|
@@ -93,11 +93,11 @@ describe('Client Library Generation: Query Types', function () {
|
|
|
93
93
|
"_id"?: string
|
|
94
94
|
"_id_gt"?: string
|
|
95
95
|
"_id_lt"?: string
|
|
96
|
-
"_id_in"?: string[]
|
|
96
|
+
"_id_in"?: (string)[]
|
|
97
97
|
"test"?: string
|
|
98
98
|
"test_gt"?: string
|
|
99
99
|
"test_lt"?: string
|
|
100
|
-
"test_in"?: string[]
|
|
100
|
+
"test_in"?: (string)[]
|
|
101
101
|
"sort"?: ("_id" | "test")
|
|
102
102
|
}`)
|
|
103
103
|
)
|
|
@@ -125,7 +125,7 @@ describe('Client Library Generation: Query Types', function () {
|
|
|
125
125
|
"_id"?: string
|
|
126
126
|
"_id_gt"?: string
|
|
127
127
|
"_id_lt"?: string
|
|
128
|
-
"_id_in"?: string[]
|
|
128
|
+
"_id_in"?: (string)[]
|
|
129
129
|
"test"?: number
|
|
130
130
|
"test_gt"?: number
|
|
131
131
|
"test_gte"?: number
|
|
@@ -158,7 +158,7 @@ describe('Client Library Generation: Query Types', function () {
|
|
|
158
158
|
"_id"?: string
|
|
159
159
|
"_id_gt"?: string
|
|
160
160
|
"_id_lt"?: string
|
|
161
|
-
"_id_in"?: string[]
|
|
161
|
+
"_id_in"?: (string)[]
|
|
162
162
|
"test"?: boolean
|
|
163
163
|
"sort"?: ("_id" | "test")
|
|
164
164
|
}`)
|
|
@@ -187,7 +187,7 @@ describe('Client Library Generation: Query Types', function () {
|
|
|
187
187
|
"_id"?: string
|
|
188
188
|
"_id_gt"?: string
|
|
189
189
|
"_id_lt"?: string
|
|
190
|
-
"_id_in"?: string[]
|
|
190
|
+
"_id_in"?: (string)[]
|
|
191
191
|
"test"?: Date
|
|
192
192
|
"test_gt"?: Date
|
|
193
193
|
"test_lt"?: Date
|
|
@@ -218,9 +218,9 @@ describe('Client Library Generation: Query Types', function () {
|
|
|
218
218
|
"_id"?: string
|
|
219
219
|
"_id_gt"?: string
|
|
220
220
|
"_id_lt"?: string
|
|
221
|
-
"_id_in"?: string[]
|
|
221
|
+
"_id_in"?: (string)[]
|
|
222
222
|
"test"?: ("red" | "green" | "blue")
|
|
223
|
-
"test_in"?: ("red" | "green" | "blue")[]
|
|
223
|
+
"test_in"?: (("red" | "green" | "blue"))[]
|
|
224
224
|
"sort"?: ("_id" | "test")
|
|
225
225
|
}`)
|
|
226
226
|
)
|
|
@@ -251,7 +251,7 @@ describe('Client Library Generation: Query Types', function () {
|
|
|
251
251
|
"_id"?: string
|
|
252
252
|
"_id_gt"?: string
|
|
253
253
|
"_id_lt"?: string
|
|
254
|
-
"_id_in"?: string[]
|
|
254
|
+
"_id_in"?: (string)[]
|
|
255
255
|
"sort"?: ("_id")
|
|
256
256
|
}`)
|
|
257
257
|
)
|
|
@@ -288,12 +288,12 @@ describe('Client Library Generation: Query Types', function () {
|
|
|
288
288
|
"_id"?: string
|
|
289
289
|
"_id_gt"?: string
|
|
290
290
|
"_id_lt"?: string
|
|
291
|
-
"_id_in"?: string[]
|
|
291
|
+
"_id_in"?: (string)[]
|
|
292
292
|
|
|
293
293
|
"test.field_string"?: string
|
|
294
294
|
"test.field_string_gt"?: string
|
|
295
295
|
"test.field_string_lt"?: string
|
|
296
|
-
"test.field_string_in"?: string[]
|
|
296
|
+
"test.field_string_in"?: (string)[]
|
|
297
297
|
|
|
298
298
|
"test.field_number"?: number
|
|
299
299
|
"test.field_number_gt"?: number
|
|
@@ -337,7 +337,7 @@ describe('Client Library Generation: Query Types', function () {
|
|
|
337
337
|
"_id"?: string
|
|
338
338
|
"_id_gt"?: string
|
|
339
339
|
"_id_lt"?: string
|
|
340
|
-
"_id_in"?: string[]
|
|
340
|
+
"_id_in"?: (string)[]
|
|
341
341
|
"field_string"?: string
|
|
342
342
|
"field_number"?: number
|
|
343
343
|
"field_boolean"?: boolean
|
|
@@ -368,7 +368,7 @@ describe('Client Library Generation: Query Types', function () {
|
|
|
368
368
|
"_id"?: string
|
|
369
369
|
"_id_gt"?: string
|
|
370
370
|
"_id_lt"?: string
|
|
371
|
-
"_id_in"?: string[]
|
|
371
|
+
"_id_in"?: (string)[]
|
|
372
372
|
"test"?: boolean
|
|
373
373
|
"sort"?: ("_id" | "test")
|
|
374
374
|
}`)
|
|
@@ -5,22 +5,22 @@ export type brief_news_category_query = {
|
|
|
5
5
|
"_id"?: string;
|
|
6
6
|
"_id_gt"?: string;
|
|
7
7
|
"_id_lt"?: string;
|
|
8
|
-
"_id_in"?: string[];
|
|
8
|
+
"_id_in"?: (string)[];
|
|
9
9
|
"name"?: string;
|
|
10
10
|
"name_gt"?: string;
|
|
11
11
|
"name_lt"?: string;
|
|
12
|
-
"name_in"?: string[];
|
|
12
|
+
"name_in"?: (string)[];
|
|
13
13
|
"slug"?: string;
|
|
14
14
|
"slug_gt"?: string;
|
|
15
15
|
"slug_lt"?: string;
|
|
16
|
-
"slug_in"?: string[];
|
|
16
|
+
"slug_in"?: (string)[];
|
|
17
17
|
"institution_id"?: string;
|
|
18
18
|
"institution_id_gt"?: string;
|
|
19
19
|
"institution_id_lt"?: string;
|
|
20
|
-
"institution_id_in"?: string[];
|
|
20
|
+
"institution_id_in"?: (string)[];
|
|
21
21
|
"client_id"?: string;
|
|
22
22
|
"client_id_gt"?: string;
|
|
23
23
|
"client_id_lt"?: string;
|
|
24
|
-
"client_id_in"?: string[];
|
|
24
|
+
"client_id_in"?: (string)[];
|
|
25
25
|
"sort"?: ("_id" | "name" | "slug" | "institution_id" | "client_id");
|
|
26
26
|
};
|
|
@@ -5,14 +5,14 @@ export type client_query = {
|
|
|
5
5
|
"_id"?: string;
|
|
6
6
|
"_id_gt"?: string;
|
|
7
7
|
"_id_lt"?: string;
|
|
8
|
-
"_id_in"?: string[];
|
|
8
|
+
"_id_in"?: (string)[];
|
|
9
9
|
"name"?: string;
|
|
10
10
|
"name_gt"?: string;
|
|
11
11
|
"name_lt"?: string;
|
|
12
|
-
"name_in"?: string[];
|
|
12
|
+
"name_in"?: (string)[];
|
|
13
13
|
"institution_id"?: string;
|
|
14
14
|
"institution_id_gt"?: string;
|
|
15
15
|
"institution_id_lt"?: string;
|
|
16
|
-
"institution_id_in"?: string[];
|
|
16
|
+
"institution_id_in"?: (string)[];
|
|
17
17
|
"sort"?: ("_id" | "name" | "institution_id");
|
|
18
18
|
};
|
|
@@ -5,10 +5,10 @@ export type institution_query = {
|
|
|
5
5
|
"_id"?: string;
|
|
6
6
|
"_id_gt"?: string;
|
|
7
7
|
"_id_lt"?: string;
|
|
8
|
-
"_id_in"?: string[];
|
|
8
|
+
"_id_in"?: (string)[];
|
|
9
9
|
"name"?: string;
|
|
10
10
|
"name_gt"?: string;
|
|
11
11
|
"name_lt"?: string;
|
|
12
|
-
"name_in"?: string[];
|
|
12
|
+
"name_in"?: (string)[];
|
|
13
13
|
"sort"?: ("_id" | "name");
|
|
14
14
|
};
|
|
@@ -5,19 +5,19 @@ export type project_query = {
|
|
|
5
5
|
"_id"?: string;
|
|
6
6
|
"_id_gt"?: string;
|
|
7
7
|
"_id_lt"?: string;
|
|
8
|
-
"_id_in"?: string[];
|
|
8
|
+
"_id_in"?: (string)[];
|
|
9
9
|
"name"?: string;
|
|
10
10
|
"name_gt"?: string;
|
|
11
11
|
"name_lt"?: string;
|
|
12
|
-
"name_in"?: string[];
|
|
12
|
+
"name_in"?: (string)[];
|
|
13
13
|
"institution_id"?: string;
|
|
14
14
|
"institution_id_gt"?: string;
|
|
15
15
|
"institution_id_lt"?: string;
|
|
16
|
-
"institution_id_in"?: string[];
|
|
16
|
+
"institution_id_in"?: (string)[];
|
|
17
17
|
"client_id"?: string;
|
|
18
18
|
"client_id_gt"?: string;
|
|
19
19
|
"client_id_lt"?: string;
|
|
20
|
-
"client_id_in"?: string[];
|
|
20
|
+
"client_id_in"?: (string)[];
|
|
21
21
|
"project_number"?: number;
|
|
22
22
|
"project_number_gt"?: number;
|
|
23
23
|
"project_number_gte"?: number;
|
|
@@ -5,22 +5,22 @@ export type brief_news_category_query = {
|
|
|
5
5
|
"_id"?: string
|
|
6
6
|
"_id_gt"?: string
|
|
7
7
|
"_id_lt"?: string
|
|
8
|
-
"_id_in"?: string[]
|
|
8
|
+
"_id_in"?: (string)[]
|
|
9
9
|
"name"?: string
|
|
10
10
|
"name_gt"?: string
|
|
11
11
|
"name_lt"?: string
|
|
12
|
-
"name_in"?: string[]
|
|
12
|
+
"name_in"?: (string)[]
|
|
13
13
|
"slug"?: string
|
|
14
14
|
"slug_gt"?: string
|
|
15
15
|
"slug_lt"?: string
|
|
16
|
-
"slug_in"?: string[]
|
|
16
|
+
"slug_in"?: (string)[]
|
|
17
17
|
"institution_id"?: string
|
|
18
18
|
"institution_id_gt"?: string
|
|
19
19
|
"institution_id_lt"?: string
|
|
20
|
-
"institution_id_in"?: string[]
|
|
20
|
+
"institution_id_in"?: (string)[]
|
|
21
21
|
"client_id"?: string
|
|
22
22
|
"client_id_gt"?: string
|
|
23
23
|
"client_id_lt"?: string
|
|
24
|
-
"client_id_in"?: string[]
|
|
24
|
+
"client_id_in"?: (string)[]
|
|
25
25
|
"sort"?: ("_id" | "name" | "slug" | "institution_id" | "client_id")
|
|
26
26
|
}
|
|
@@ -5,14 +5,14 @@ export type client_query = {
|
|
|
5
5
|
"_id"?: string
|
|
6
6
|
"_id_gt"?: string
|
|
7
7
|
"_id_lt"?: string
|
|
8
|
-
"_id_in"?: string[]
|
|
8
|
+
"_id_in"?: (string)[]
|
|
9
9
|
"name"?: string
|
|
10
10
|
"name_gt"?: string
|
|
11
11
|
"name_lt"?: string
|
|
12
|
-
"name_in"?: string[]
|
|
12
|
+
"name_in"?: (string)[]
|
|
13
13
|
"institution_id"?: string
|
|
14
14
|
"institution_id_gt"?: string
|
|
15
15
|
"institution_id_lt"?: string
|
|
16
|
-
"institution_id_in"?: string[]
|
|
16
|
+
"institution_id_in"?: (string)[]
|
|
17
17
|
"sort"?: ("_id" | "name" | "institution_id")
|
|
18
18
|
}
|
|
@@ -5,10 +5,10 @@ export type institution_query = {
|
|
|
5
5
|
"_id"?: string
|
|
6
6
|
"_id_gt"?: string
|
|
7
7
|
"_id_lt"?: string
|
|
8
|
-
"_id_in"?: string[]
|
|
8
|
+
"_id_in"?: (string)[]
|
|
9
9
|
"name"?: string
|
|
10
10
|
"name_gt"?: string
|
|
11
11
|
"name_lt"?: string
|
|
12
|
-
"name_in"?: string[]
|
|
12
|
+
"name_in"?: (string)[]
|
|
13
13
|
"sort"?: ("_id" | "name")
|
|
14
14
|
}
|
|
@@ -5,19 +5,19 @@ export type project_query = {
|
|
|
5
5
|
"_id"?: string
|
|
6
6
|
"_id_gt"?: string
|
|
7
7
|
"_id_lt"?: string
|
|
8
|
-
"_id_in"?: string[]
|
|
8
|
+
"_id_in"?: (string)[]
|
|
9
9
|
"name"?: string
|
|
10
10
|
"name_gt"?: string
|
|
11
11
|
"name_lt"?: string
|
|
12
|
-
"name_in"?: string[]
|
|
12
|
+
"name_in"?: (string)[]
|
|
13
13
|
"institution_id"?: string
|
|
14
14
|
"institution_id_gt"?: string
|
|
15
15
|
"institution_id_lt"?: string
|
|
16
|
-
"institution_id_in"?: string[]
|
|
16
|
+
"institution_id_in"?: (string)[]
|
|
17
17
|
"client_id"?: string
|
|
18
18
|
"client_id_gt"?: string
|
|
19
19
|
"client_id_lt"?: string
|
|
20
|
-
"client_id_in"?: string[]
|
|
20
|
+
"client_id_in"?: (string)[]
|
|
21
21
|
"project_number"?: number
|
|
22
22
|
"project_number_gt"?: number
|
|
23
23
|
"project_number_gte"?: number
|