@openframe-org/criteria-set-protocol 3.0.0-beta.1 → 3.0.0-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.
|
@@ -20,9 +20,7 @@ exports.taskItemScalarValueSchema = zod_1.z
|
|
|
20
20
|
exports.taskItemValueSchema = zod_1.z
|
|
21
21
|
.union([exports.taskItemScalarValueSchema, zod_1.z.array(exports.taskItemScalarValueSchema)])
|
|
22
22
|
.describe("TaskItemValue - Can be either a scalar value or an array of scalar values");
|
|
23
|
-
const abstractElementDataSchema = zod_1.z.object(
|
|
24
|
-
type: zod_1.z.enum(["number", "percentage", "boolean"])
|
|
25
|
-
}).catchall(zod_1.z.any());
|
|
23
|
+
const abstractElementDataSchema = zod_1.z.object().catchall(zod_1.z.any());
|
|
26
24
|
const abstractNumberElementDataSchema = abstractElementDataSchema.extend({
|
|
27
25
|
value: zod_1.z.number().nullable().describe("Value of the element"),
|
|
28
26
|
maximumValue: zod_1.z
|
|
@@ -41,11 +39,11 @@ const numberElementDataSchema = abstractNumberElementDataSchema.extend({
|
|
|
41
39
|
.number()
|
|
42
40
|
.nullable()
|
|
43
41
|
.describe("Total value, understood as 'value'/'total'")
|
|
44
|
-
});
|
|
42
|
+
}).catchall(zod_1.z.any());
|
|
45
43
|
const percentageElementDataSchema = abstractNumberElementDataSchema.extend({
|
|
46
44
|
type: zod_1.z.literal("percentage").describe("Type of data"),
|
|
47
45
|
total: zod_1.z.never().optional()
|
|
48
|
-
});
|
|
46
|
+
}).catchall(zod_1.z.any());
|
|
49
47
|
const booleanElementDataSchema = abstractElementDataSchema.extend({
|
|
50
48
|
type: zod_1.z.literal("boolean").describe("Type of data"),
|
|
51
49
|
value: zod_1.z.boolean().nullable().describe("Value of the element"),
|
|
@@ -53,7 +51,7 @@ const booleanElementDataSchema = abstractElementDataSchema.extend({
|
|
|
53
51
|
maximumValue: zod_1.z.never().optional(),
|
|
54
52
|
minimumValue: zod_1.z.never().optional(),
|
|
55
53
|
weight: zod_1.z.never().optional()
|
|
56
|
-
});
|
|
54
|
+
}).catchall(zod_1.z.any());
|
|
57
55
|
exports.elementDataSchema = zod_1.z.discriminatedUnion("type", [
|
|
58
56
|
numberElementDataSchema,
|
|
59
57
|
percentageElementDataSchema,
|
package/package.json
CHANGED