@openframe-org/criteria-set-protocol 2.0.7-beta.1 → 2.0.7-beta.2
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/v1/schemas/criteria-tree.d.ts +18 -18
- package/dist/v1/schemas/criterion.d.ts +3 -3
- package/dist/v1/schemas/task-group.d.ts +3 -3
- package/dist/v1/schemas/task-item.d.ts +3 -3
- package/dist/v1/schemas/task-item.js +2 -2
- package/dist/v1/schemas/task.d.ts +3 -3
- package/dist/v1/schemas/theme.d.ts +3 -3
- package/dist/v1/schemas/utils.d.ts +2 -3
- package/dist/v1/schemas/utils.js +5 -8
- package/package.json +1 -1
|
@@ -421,7 +421,7 @@ export declare const criteriaTreeSchema: z.ZodObject<z.objectUtil.extendShape<Pi
|
|
|
421
421
|
}, {
|
|
422
422
|
type: z.ZodLiteral<"task">;
|
|
423
423
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
424
|
-
items: z.ZodArray<z.ZodLazy<z.ZodObject<
|
|
424
|
+
items: z.ZodArray<z.ZodLazy<z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
425
425
|
type: z.ZodEnum<["theme", "criterion", "task-group", "task", "task-item"]>;
|
|
426
426
|
title: z.ZodString;
|
|
427
427
|
code: z.ZodString;
|
|
@@ -510,7 +510,7 @@ export declare const criteriaTreeSchema: z.ZodObject<z.objectUtil.extendShape<Pi
|
|
|
510
510
|
readOnly?: boolean | null | undefined;
|
|
511
511
|
}>>>;
|
|
512
512
|
sortOrder: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
513
|
-
}, {
|
|
513
|
+
}, "title">, {
|
|
514
514
|
type: z.ZodLiteral<"task-item">;
|
|
515
515
|
data: z.ZodOptional<z.ZodNullable<z.ZodObject<z.objectUtil.extendShape<{
|
|
516
516
|
type: z.ZodOptional<z.ZodNullable<z.ZodEnum<["percentage", "number"]>>>;
|
|
@@ -686,7 +686,7 @@ export declare const criteriaTreeSchema: z.ZodObject<z.objectUtil.extendShape<Pi
|
|
|
686
686
|
}, {
|
|
687
687
|
hideCode?: boolean | null | undefined;
|
|
688
688
|
}>>>;
|
|
689
|
-
}>, "
|
|
689
|
+
}>, "strip", z.ZodTypeAny, {
|
|
690
690
|
type: "task-item";
|
|
691
691
|
code: string;
|
|
692
692
|
definition: {
|
|
@@ -3253,7 +3253,7 @@ export declare const criteriaTreeElementSchema: z.ZodDiscriminatedUnion<"type",
|
|
|
3253
3253
|
}, {
|
|
3254
3254
|
type: z.ZodLiteral<"task">;
|
|
3255
3255
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
3256
|
-
items: z.ZodArray<z.ZodLazy<z.ZodObject<
|
|
3256
|
+
items: z.ZodArray<z.ZodLazy<z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
3257
3257
|
type: z.ZodEnum<["theme", "criterion", "task-group", "task", "task-item"]>;
|
|
3258
3258
|
title: z.ZodString;
|
|
3259
3259
|
code: z.ZodString;
|
|
@@ -3342,7 +3342,7 @@ export declare const criteriaTreeElementSchema: z.ZodDiscriminatedUnion<"type",
|
|
|
3342
3342
|
readOnly?: boolean | null | undefined;
|
|
3343
3343
|
}>>>;
|
|
3344
3344
|
sortOrder: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
3345
|
-
}, {
|
|
3345
|
+
}, "title">, {
|
|
3346
3346
|
type: z.ZodLiteral<"task-item">;
|
|
3347
3347
|
data: z.ZodOptional<z.ZodNullable<z.ZodObject<z.objectUtil.extendShape<{
|
|
3348
3348
|
type: z.ZodOptional<z.ZodNullable<z.ZodEnum<["percentage", "number"]>>>;
|
|
@@ -3518,7 +3518,7 @@ export declare const criteriaTreeElementSchema: z.ZodDiscriminatedUnion<"type",
|
|
|
3518
3518
|
}, {
|
|
3519
3519
|
hideCode?: boolean | null | undefined;
|
|
3520
3520
|
}>>>;
|
|
3521
|
-
}>, "
|
|
3521
|
+
}>, "strip", z.ZodTypeAny, {
|
|
3522
3522
|
type: "task-item";
|
|
3523
3523
|
code: string;
|
|
3524
3524
|
definition: {
|
|
@@ -5309,7 +5309,7 @@ export declare const criteriaTreeElementSchema: z.ZodDiscriminatedUnion<"type",
|
|
|
5309
5309
|
}, {
|
|
5310
5310
|
type: z.ZodLiteral<"task">;
|
|
5311
5311
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
5312
|
-
items: z.ZodArray<z.ZodLazy<z.ZodObject<
|
|
5312
|
+
items: z.ZodArray<z.ZodLazy<z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
5313
5313
|
type: z.ZodEnum<["theme", "criterion", "task-group", "task", "task-item"]>;
|
|
5314
5314
|
title: z.ZodString;
|
|
5315
5315
|
code: z.ZodString;
|
|
@@ -5398,7 +5398,7 @@ export declare const criteriaTreeElementSchema: z.ZodDiscriminatedUnion<"type",
|
|
|
5398
5398
|
readOnly?: boolean | null | undefined;
|
|
5399
5399
|
}>>>;
|
|
5400
5400
|
sortOrder: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
5401
|
-
}, {
|
|
5401
|
+
}, "title">, {
|
|
5402
5402
|
type: z.ZodLiteral<"task-item">;
|
|
5403
5403
|
data: z.ZodOptional<z.ZodNullable<z.ZodObject<z.objectUtil.extendShape<{
|
|
5404
5404
|
type: z.ZodOptional<z.ZodNullable<z.ZodEnum<["percentage", "number"]>>>;
|
|
@@ -5574,7 +5574,7 @@ export declare const criteriaTreeElementSchema: z.ZodDiscriminatedUnion<"type",
|
|
|
5574
5574
|
}, {
|
|
5575
5575
|
hideCode?: boolean | null | undefined;
|
|
5576
5576
|
}>>>;
|
|
5577
|
-
}>, "
|
|
5577
|
+
}>, "strip", z.ZodTypeAny, {
|
|
5578
5578
|
type: "task-item";
|
|
5579
5579
|
code: string;
|
|
5580
5580
|
definition: {
|
|
@@ -6800,7 +6800,7 @@ export declare const criteriaTreeElementSchema: z.ZodDiscriminatedUnion<"type",
|
|
|
6800
6800
|
}, {
|
|
6801
6801
|
type: z.ZodLiteral<"task">;
|
|
6802
6802
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
6803
|
-
items: z.ZodArray<z.ZodLazy<z.ZodObject<
|
|
6803
|
+
items: z.ZodArray<z.ZodLazy<z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
6804
6804
|
type: z.ZodEnum<["theme", "criterion", "task-group", "task", "task-item"]>;
|
|
6805
6805
|
title: z.ZodString;
|
|
6806
6806
|
code: z.ZodString;
|
|
@@ -6889,7 +6889,7 @@ export declare const criteriaTreeElementSchema: z.ZodDiscriminatedUnion<"type",
|
|
|
6889
6889
|
readOnly?: boolean | null | undefined;
|
|
6890
6890
|
}>>>;
|
|
6891
6891
|
sortOrder: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
6892
|
-
}, {
|
|
6892
|
+
}, "title">, {
|
|
6893
6893
|
type: z.ZodLiteral<"task-item">;
|
|
6894
6894
|
data: z.ZodOptional<z.ZodNullable<z.ZodObject<z.objectUtil.extendShape<{
|
|
6895
6895
|
type: z.ZodOptional<z.ZodNullable<z.ZodEnum<["percentage", "number"]>>>;
|
|
@@ -7065,7 +7065,7 @@ export declare const criteriaTreeElementSchema: z.ZodDiscriminatedUnion<"type",
|
|
|
7065
7065
|
}, {
|
|
7066
7066
|
hideCode?: boolean | null | undefined;
|
|
7067
7067
|
}>>>;
|
|
7068
|
-
}>, "
|
|
7068
|
+
}>, "strip", z.ZodTypeAny, {
|
|
7069
7069
|
type: "task-item";
|
|
7070
7070
|
code: string;
|
|
7071
7071
|
definition: {
|
|
@@ -7820,7 +7820,7 @@ export declare const criteriaTreeElementSchema: z.ZodDiscriminatedUnion<"type",
|
|
|
7820
7820
|
}, {
|
|
7821
7821
|
type: z.ZodLiteral<"task">;
|
|
7822
7822
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
7823
|
-
items: z.ZodArray<z.ZodLazy<z.ZodObject<
|
|
7823
|
+
items: z.ZodArray<z.ZodLazy<z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
7824
7824
|
type: z.ZodEnum<["theme", "criterion", "task-group", "task", "task-item"]>;
|
|
7825
7825
|
title: z.ZodString;
|
|
7826
7826
|
code: z.ZodString;
|
|
@@ -7909,7 +7909,7 @@ export declare const criteriaTreeElementSchema: z.ZodDiscriminatedUnion<"type",
|
|
|
7909
7909
|
readOnly?: boolean | null | undefined;
|
|
7910
7910
|
}>>>;
|
|
7911
7911
|
sortOrder: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
7912
|
-
}, {
|
|
7912
|
+
}, "title">, {
|
|
7913
7913
|
type: z.ZodLiteral<"task-item">;
|
|
7914
7914
|
data: z.ZodOptional<z.ZodNullable<z.ZodObject<z.objectUtil.extendShape<{
|
|
7915
7915
|
type: z.ZodOptional<z.ZodNullable<z.ZodEnum<["percentage", "number"]>>>;
|
|
@@ -8085,7 +8085,7 @@ export declare const criteriaTreeElementSchema: z.ZodDiscriminatedUnion<"type",
|
|
|
8085
8085
|
}, {
|
|
8086
8086
|
hideCode?: boolean | null | undefined;
|
|
8087
8087
|
}>>>;
|
|
8088
|
-
}>, "
|
|
8088
|
+
}>, "strip", z.ZodTypeAny, {
|
|
8089
8089
|
type: "task-item";
|
|
8090
8090
|
code: string;
|
|
8091
8091
|
definition: {
|
|
@@ -8445,7 +8445,7 @@ export declare const criteriaTreeElementSchema: z.ZodDiscriminatedUnion<"type",
|
|
|
8445
8445
|
text: string;
|
|
8446
8446
|
})[] | null | undefined;
|
|
8447
8447
|
sortOrder?: number | null | undefined;
|
|
8448
|
-
}>, z.ZodObject<
|
|
8448
|
+
}>, z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
8449
8449
|
type: z.ZodEnum<["theme", "criterion", "task-group", "task", "task-item"]>;
|
|
8450
8450
|
title: z.ZodString;
|
|
8451
8451
|
code: z.ZodString;
|
|
@@ -8534,7 +8534,7 @@ export declare const criteriaTreeElementSchema: z.ZodDiscriminatedUnion<"type",
|
|
|
8534
8534
|
readOnly?: boolean | null | undefined;
|
|
8535
8535
|
}>>>;
|
|
8536
8536
|
sortOrder: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
8537
|
-
}, {
|
|
8537
|
+
}, "title">, {
|
|
8538
8538
|
type: z.ZodLiteral<"task-item">;
|
|
8539
8539
|
data: z.ZodOptional<z.ZodNullable<z.ZodObject<z.objectUtil.extendShape<{
|
|
8540
8540
|
type: z.ZodOptional<z.ZodNullable<z.ZodEnum<["percentage", "number"]>>>;
|
|
@@ -8710,7 +8710,7 @@ export declare const criteriaTreeElementSchema: z.ZodDiscriminatedUnion<"type",
|
|
|
8710
8710
|
}, {
|
|
8711
8711
|
hideCode?: boolean | null | undefined;
|
|
8712
8712
|
}>>>;
|
|
8713
|
-
}>, "
|
|
8713
|
+
}>, "strip", z.ZodTypeAny, {
|
|
8714
8714
|
type: "task-item";
|
|
8715
8715
|
code: string;
|
|
8716
8716
|
definition: {
|
|
@@ -284,7 +284,7 @@ export declare const criterionSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
284
284
|
}, {
|
|
285
285
|
type: z.ZodLiteral<"task">;
|
|
286
286
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
287
|
-
items: z.ZodArray<z.ZodLazy<z.ZodObject<
|
|
287
|
+
items: z.ZodArray<z.ZodLazy<z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
288
288
|
type: z.ZodEnum<["theme", "criterion", "task-group", "task", "task-item"]>;
|
|
289
289
|
title: z.ZodString;
|
|
290
290
|
code: z.ZodString;
|
|
@@ -373,7 +373,7 @@ export declare const criterionSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
373
373
|
readOnly?: boolean | null | undefined;
|
|
374
374
|
}>>>;
|
|
375
375
|
sortOrder: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
376
|
-
}, {
|
|
376
|
+
}, "title">, {
|
|
377
377
|
type: z.ZodLiteral<"task-item">;
|
|
378
378
|
data: z.ZodOptional<z.ZodNullable<z.ZodObject<z.objectUtil.extendShape<{
|
|
379
379
|
type: z.ZodOptional<z.ZodNullable<z.ZodEnum<["percentage", "number"]>>>;
|
|
@@ -549,7 +549,7 @@ export declare const criterionSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
549
549
|
}, {
|
|
550
550
|
hideCode?: boolean | null | undefined;
|
|
551
551
|
}>>>;
|
|
552
|
-
}>, "
|
|
552
|
+
}>, "strip", z.ZodTypeAny, {
|
|
553
553
|
type: "task-item";
|
|
554
554
|
code: string;
|
|
555
555
|
definition: {
|
|
@@ -193,7 +193,7 @@ export declare const taskGroupSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
193
193
|
}, {
|
|
194
194
|
type: z.ZodLiteral<"task">;
|
|
195
195
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
196
|
-
items: z.ZodArray<z.ZodLazy<z.ZodObject<
|
|
196
|
+
items: z.ZodArray<z.ZodLazy<z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
197
197
|
type: z.ZodEnum<["theme", "criterion", "task-group", "task", "task-item"]>;
|
|
198
198
|
title: z.ZodString;
|
|
199
199
|
code: z.ZodString;
|
|
@@ -282,7 +282,7 @@ export declare const taskGroupSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
282
282
|
readOnly?: boolean | null | undefined;
|
|
283
283
|
}>>>;
|
|
284
284
|
sortOrder: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
285
|
-
}, {
|
|
285
|
+
}, "title">, {
|
|
286
286
|
type: z.ZodLiteral<"task-item">;
|
|
287
287
|
data: z.ZodOptional<z.ZodNullable<z.ZodObject<z.objectUtil.extendShape<{
|
|
288
288
|
type: z.ZodOptional<z.ZodNullable<z.ZodEnum<["percentage", "number"]>>>;
|
|
@@ -458,7 +458,7 @@ export declare const taskGroupSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
458
458
|
}, {
|
|
459
459
|
hideCode?: boolean | null | undefined;
|
|
460
460
|
}>>>;
|
|
461
|
-
}>, "
|
|
461
|
+
}>, "strip", z.ZodTypeAny, {
|
|
462
462
|
type: "task-item";
|
|
463
463
|
code: string;
|
|
464
464
|
definition: {
|
|
@@ -319,7 +319,7 @@ export declare const taskItemOptionsSchema: z.ZodObject<{
|
|
|
319
319
|
}, {
|
|
320
320
|
hideCode?: boolean | null | undefined;
|
|
321
321
|
}>;
|
|
322
|
-
export declare const taskItemSchema: z.ZodObject<
|
|
322
|
+
export declare const taskItemSchema: z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
323
323
|
type: z.ZodEnum<["theme", "criterion", "task-group", "task", "task-item"]>;
|
|
324
324
|
title: z.ZodString;
|
|
325
325
|
code: z.ZodString;
|
|
@@ -408,7 +408,7 @@ export declare const taskItemSchema: z.ZodObject<Omit<z.objectUtil.extendShape<{
|
|
|
408
408
|
readOnly?: boolean | null | undefined;
|
|
409
409
|
}>>>;
|
|
410
410
|
sortOrder: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
411
|
-
}, {
|
|
411
|
+
}, "title">, {
|
|
412
412
|
type: z.ZodLiteral<"task-item">;
|
|
413
413
|
data: z.ZodOptional<z.ZodNullable<z.ZodObject<z.objectUtil.extendShape<{
|
|
414
414
|
type: z.ZodOptional<z.ZodNullable<z.ZodEnum<["percentage", "number"]>>>;
|
|
@@ -584,7 +584,7 @@ export declare const taskItemSchema: z.ZodObject<Omit<z.objectUtil.extendShape<{
|
|
|
584
584
|
}, {
|
|
585
585
|
hideCode?: boolean | null | undefined;
|
|
586
586
|
}>>>;
|
|
587
|
-
}>, "
|
|
587
|
+
}>, "strip", z.ZodTypeAny, {
|
|
588
588
|
type: "task-item";
|
|
589
589
|
code: string;
|
|
590
590
|
definition: {
|
|
@@ -49,7 +49,7 @@ exports.taskItemDataSchema = common_1.elementDataSchema.extend({
|
|
|
49
49
|
exports.taskItemOptionsSchema = zod_1.z.object({
|
|
50
50
|
hideCode: zod_1.z.boolean().nullish(),
|
|
51
51
|
});
|
|
52
|
-
exports.taskItemSchema = common_1.abstractElementSchema.extend({
|
|
52
|
+
exports.taskItemSchema = common_1.abstractElementSchema.omit({ title: true }).extend({
|
|
53
53
|
type: zod_1.z.literal("task-item"),
|
|
54
54
|
data: exports.taskItemDataSchema.nullish(),
|
|
55
55
|
definition: exports.taskItemDefinitionSchema,
|
|
@@ -57,4 +57,4 @@ exports.taskItemSchema = common_1.abstractElementSchema.extend({
|
|
|
57
57
|
providedData: exports.taskItemValueMapSchema.nullish(),
|
|
58
58
|
valueReference: common_1.taskItemValueSchema.nullish(),
|
|
59
59
|
options: exports.taskItemOptionsSchema.nullish(),
|
|
60
|
-
})
|
|
60
|
+
});
|
|
@@ -98,7 +98,7 @@ export declare const taskSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
98
98
|
}, {
|
|
99
99
|
type: z.ZodLiteral<"task">;
|
|
100
100
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
101
|
-
items: z.ZodArray<z.ZodLazy<z.ZodObject<
|
|
101
|
+
items: z.ZodArray<z.ZodLazy<z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
102
102
|
type: z.ZodEnum<["theme", "criterion", "task-group", "task", "task-item"]>;
|
|
103
103
|
title: z.ZodString;
|
|
104
104
|
code: z.ZodString;
|
|
@@ -187,7 +187,7 @@ export declare const taskSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
187
187
|
readOnly?: boolean | null | undefined;
|
|
188
188
|
}>>>;
|
|
189
189
|
sortOrder: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
190
|
-
}, {
|
|
190
|
+
}, "title">, {
|
|
191
191
|
type: z.ZodLiteral<"task-item">;
|
|
192
192
|
data: z.ZodOptional<z.ZodNullable<z.ZodObject<z.objectUtil.extendShape<{
|
|
193
193
|
type: z.ZodOptional<z.ZodNullable<z.ZodEnum<["percentage", "number"]>>>;
|
|
@@ -363,7 +363,7 @@ export declare const taskSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
363
363
|
}, {
|
|
364
364
|
hideCode?: boolean | null | undefined;
|
|
365
365
|
}>>>;
|
|
366
|
-
}>, "
|
|
366
|
+
}>, "strip", z.ZodTypeAny, {
|
|
367
367
|
type: "task-item";
|
|
368
368
|
code: string;
|
|
369
369
|
definition: {
|
|
@@ -472,7 +472,7 @@ export declare const themeSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
472
472
|
}, {
|
|
473
473
|
type: z.ZodLiteral<"task">;
|
|
474
474
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
475
|
-
items: z.ZodArray<z.ZodLazy<z.ZodObject<
|
|
475
|
+
items: z.ZodArray<z.ZodLazy<z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
476
476
|
type: z.ZodEnum<["theme", "criterion", "task-group", "task", "task-item"]>;
|
|
477
477
|
title: z.ZodString;
|
|
478
478
|
code: z.ZodString;
|
|
@@ -561,7 +561,7 @@ export declare const themeSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
561
561
|
readOnly?: boolean | null | undefined;
|
|
562
562
|
}>>>;
|
|
563
563
|
sortOrder: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
564
|
-
}, {
|
|
564
|
+
}, "title">, {
|
|
565
565
|
type: z.ZodLiteral<"task-item">;
|
|
566
566
|
data: z.ZodOptional<z.ZodNullable<z.ZodObject<z.objectUtil.extendShape<{
|
|
567
567
|
type: z.ZodOptional<z.ZodNullable<z.ZodEnum<["percentage", "number"]>>>;
|
|
@@ -737,7 +737,7 @@ export declare const themeSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
737
737
|
}, {
|
|
738
738
|
hideCode?: boolean | null | undefined;
|
|
739
739
|
}>>>;
|
|
740
|
-
}>, "
|
|
740
|
+
}>, "strip", z.ZodTypeAny, {
|
|
741
741
|
type: "task-item";
|
|
742
742
|
code: string;
|
|
743
743
|
definition: {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { z, ZodTypeDef } from "zod";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* it will transform null values to undefined.
|
|
3
|
+
* Create a new schema that allows null and undefined values. It differs from nullish() in that it coerces null to undefined.
|
|
5
4
|
*/
|
|
6
|
-
export declare const optional: <T, O>(typeSchema: z.ZodType<T, z.ZodTypeDef, O>) => z.ZodType<T | null | undefined, z.ZodTypeDef, O
|
|
5
|
+
export declare const optional: <T, O>(typeSchema: z.ZodType<T, z.ZodTypeDef, O>) => z.ZodPipeline<z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodType<T, z.ZodTypeDef, O>>>, (T & {}) | undefined, O | null | undefined>, z.ZodOptional<z.ZodType<T, z.ZodTypeDef, O>>>;
|
package/dist/v1/schemas/utils.js
CHANGED
|
@@ -2,13 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.optional = void 0;
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
* it will transform null values to undefined.
|
|
5
|
+
* Create a new schema that allows null and undefined values. It differs from nullish() in that it coerces null to undefined.
|
|
7
6
|
*/
|
|
8
|
-
const optional = (typeSchema) =>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
.pipe(typeSchema.optional());
|
|
13
|
-
};
|
|
7
|
+
const optional = (typeSchema) => typeSchema
|
|
8
|
+
.nullish()
|
|
9
|
+
.transform((value) => (value === null ? undefined : value))
|
|
10
|
+
.pipe(typeSchema.optional());
|
|
14
11
|
exports.optional = optional;
|
package/package.json
CHANGED