@openframe-org/criteria-set-protocol 3.0.0-alpha.4 → 3.0.0-alpha.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.
- package/dist/v1/schemas/common.d.ts +54 -27
- package/dist/v1/schemas/common.js +26 -14
- package/dist/v1/schemas/criteria-tree.d.ts +378 -189
- package/dist/v1/schemas/criterion.d.ts +72 -36
- package/dist/v1/schemas/data-map.d.ts +88 -43
- package/dist/v1/schemas/task-group.d.ts +54 -27
- package/dist/v1/schemas/task-item.d.ts +36 -18
- package/dist/v1/schemas/task.d.ts +36 -18
- package/dist/v1/schemas/theme.d.ts +90 -45
- package/package.json +1 -1
|
@@ -6,19 +6,28 @@ export declare const colorSchema: z.ZodUnion<readonly [z.ZodString, z.ZodObject<
|
|
|
6
6
|
}, z.core.$strip>]>;
|
|
7
7
|
export declare const taskItemScalarValueSchema: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
|
|
8
8
|
export declare const taskItemValueSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>]>;
|
|
9
|
-
export declare const elementDataSchema: z.ZodObject<{
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
value: z.ZodNullable<z.ZodUnion<[z.ZodNumber, z.ZodBoolean]>>;
|
|
16
|
-
text: z.ZodNullable<z.ZodString>;
|
|
9
|
+
export declare const elementDataSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
|
10
|
+
value: z.ZodNullable<z.ZodNumber>;
|
|
11
|
+
maximumValue: z.ZodNullable<z.ZodNumber>;
|
|
12
|
+
minimumValue: z.ZodNullable<z.ZodNumber>;
|
|
13
|
+
weight: z.ZodNullable<z.ZodNumber>;
|
|
14
|
+
type: z.ZodLiteral<"number">;
|
|
17
15
|
total: z.ZodNullable<z.ZodNumber>;
|
|
16
|
+
}, z.core.$catchall<z.ZodAny>>, z.ZodObject<{
|
|
17
|
+
value: z.ZodNullable<z.ZodNumber>;
|
|
18
18
|
maximumValue: z.ZodNullable<z.ZodNumber>;
|
|
19
19
|
minimumValue: z.ZodNullable<z.ZodNumber>;
|
|
20
20
|
weight: z.ZodNullable<z.ZodNumber>;
|
|
21
|
-
|
|
21
|
+
type: z.ZodLiteral<"percentage">;
|
|
22
|
+
total: z.ZodOptional<z.ZodNever>;
|
|
23
|
+
}, z.core.$catchall<z.ZodAny>>]>, z.ZodObject<{
|
|
24
|
+
type: z.ZodLiteral<"boolean">;
|
|
25
|
+
value: z.ZodNullable<z.ZodBoolean>;
|
|
26
|
+
total: z.ZodOptional<z.ZodNever>;
|
|
27
|
+
maximumValue: z.ZodOptional<z.ZodNever>;
|
|
28
|
+
minimumValue: z.ZodOptional<z.ZodNever>;
|
|
29
|
+
weight: z.ZodOptional<z.ZodNever>;
|
|
30
|
+
}, z.core.$catchall<z.ZodAny>>]>;
|
|
22
31
|
export declare const criteriaTreeElementTypeSchema: z.ZodEnum<{
|
|
23
32
|
theme: "theme";
|
|
24
33
|
criterion: "criterion";
|
|
@@ -53,19 +62,28 @@ export declare const abstractElementSchema: z.ZodObject<{
|
|
|
53
62
|
type: z.ZodLiteral<"link">;
|
|
54
63
|
url: z.ZodString;
|
|
55
64
|
}, z.core.$strip>], "type">>>;
|
|
56
|
-
data: z.ZodNullable<z.ZodObject<{
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
value: z.ZodNullable<z.ZodUnion<[z.ZodNumber, z.ZodBoolean]>>;
|
|
63
|
-
text: z.ZodNullable<z.ZodString>;
|
|
65
|
+
data: z.ZodNullable<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
|
66
|
+
value: z.ZodNullable<z.ZodNumber>;
|
|
67
|
+
maximumValue: z.ZodNullable<z.ZodNumber>;
|
|
68
|
+
minimumValue: z.ZodNullable<z.ZodNumber>;
|
|
69
|
+
weight: z.ZodNullable<z.ZodNumber>;
|
|
70
|
+
type: z.ZodLiteral<"number">;
|
|
64
71
|
total: z.ZodNullable<z.ZodNumber>;
|
|
72
|
+
}, z.core.$catchall<z.ZodAny>>, z.ZodObject<{
|
|
73
|
+
value: z.ZodNullable<z.ZodNumber>;
|
|
65
74
|
maximumValue: z.ZodNullable<z.ZodNumber>;
|
|
66
75
|
minimumValue: z.ZodNullable<z.ZodNumber>;
|
|
67
76
|
weight: z.ZodNullable<z.ZodNumber>;
|
|
68
|
-
|
|
77
|
+
type: z.ZodLiteral<"percentage">;
|
|
78
|
+
total: z.ZodOptional<z.ZodNever>;
|
|
79
|
+
}, z.core.$catchall<z.ZodAny>>]>, z.ZodObject<{
|
|
80
|
+
type: z.ZodLiteral<"boolean">;
|
|
81
|
+
value: z.ZodNullable<z.ZodBoolean>;
|
|
82
|
+
total: z.ZodOptional<z.ZodNever>;
|
|
83
|
+
maximumValue: z.ZodOptional<z.ZodNever>;
|
|
84
|
+
minimumValue: z.ZodOptional<z.ZodNever>;
|
|
85
|
+
weight: z.ZodOptional<z.ZodNever>;
|
|
86
|
+
}, z.core.$catchall<z.ZodAny>>]>>;
|
|
69
87
|
sortOrder: z.ZodNullable<z.ZodNumber>;
|
|
70
88
|
}, z.core.$strip>;
|
|
71
89
|
export declare const breadcrumbOptionsSchema: z.ZodUnion<[z.ZodObject<{
|
|
@@ -88,16 +106,25 @@ export declare const criteriaTreeOptionsSchema: z.ZodObject<{
|
|
|
88
106
|
export declare const reportOptionsSchema: z.ZodObject<{
|
|
89
107
|
reportTitleTextFormat: z.ZodNullable<z.ZodString>;
|
|
90
108
|
}, z.core.$strip>;
|
|
91
|
-
export declare const treeResultSchema: z.ZodObject<{
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
value: z.ZodNullable<z.ZodUnion<[z.ZodNumber, z.ZodBoolean]>>;
|
|
98
|
-
text: z.ZodNullable<z.ZodString>;
|
|
109
|
+
export declare const treeResultSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
|
110
|
+
value: z.ZodNullable<z.ZodNumber>;
|
|
111
|
+
maximumValue: z.ZodNullable<z.ZodNumber>;
|
|
112
|
+
minimumValue: z.ZodNullable<z.ZodNumber>;
|
|
113
|
+
weight: z.ZodNullable<z.ZodNumber>;
|
|
114
|
+
type: z.ZodLiteral<"number">;
|
|
99
115
|
total: z.ZodNullable<z.ZodNumber>;
|
|
116
|
+
}, z.core.$catchall<z.ZodAny>>, z.ZodObject<{
|
|
117
|
+
value: z.ZodNullable<z.ZodNumber>;
|
|
100
118
|
maximumValue: z.ZodNullable<z.ZodNumber>;
|
|
101
119
|
minimumValue: z.ZodNullable<z.ZodNumber>;
|
|
102
120
|
weight: z.ZodNullable<z.ZodNumber>;
|
|
103
|
-
|
|
121
|
+
type: z.ZodLiteral<"percentage">;
|
|
122
|
+
total: z.ZodOptional<z.ZodNever>;
|
|
123
|
+
}, z.core.$catchall<z.ZodAny>>]>, z.ZodObject<{
|
|
124
|
+
type: z.ZodLiteral<"boolean">;
|
|
125
|
+
value: z.ZodNullable<z.ZodBoolean>;
|
|
126
|
+
total: z.ZodOptional<z.ZodNever>;
|
|
127
|
+
maximumValue: z.ZodOptional<z.ZodNever>;
|
|
128
|
+
minimumValue: z.ZodOptional<z.ZodNever>;
|
|
129
|
+
weight: z.ZodOptional<z.ZodNever>;
|
|
130
|
+
}, z.core.$catchall<z.ZodAny>>]>;
|
|
@@ -20,18 +20,11 @@ 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
|
-
|
|
24
|
-
.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
.describe("Type of data"),
|
|
29
|
-
value: zod_1.z.number().or(zod_1.z.boolean()).nullable().describe("Value of the element"),
|
|
30
|
-
text: zod_1.z.string().nullable().describe("Text representation of the value"),
|
|
31
|
-
total: zod_1.z
|
|
32
|
-
.number()
|
|
33
|
-
.nullable()
|
|
34
|
-
.describe("Total value, understood as 'value'/'total'"),
|
|
23
|
+
const abstractElementDataSchema = zod_1.z.object({
|
|
24
|
+
type: zod_1.z.enum(["number", "percentage", "boolean"])
|
|
25
|
+
}).catchall(zod_1.z.any());
|
|
26
|
+
const abstractNumberElementDataSchema = abstractElementDataSchema.extend({
|
|
27
|
+
value: zod_1.z.number().nullable().describe("Value of the element"),
|
|
35
28
|
maximumValue: zod_1.z
|
|
36
29
|
.number()
|
|
37
30
|
.nullable()
|
|
@@ -41,8 +34,27 @@ exports.elementDataSchema = zod_1.z
|
|
|
41
34
|
.nullable()
|
|
42
35
|
.describe("Minimum allowed value"),
|
|
43
36
|
weight: zod_1.z.number().nullable().describe("Weight of the element")
|
|
44
|
-
})
|
|
45
|
-
|
|
37
|
+
});
|
|
38
|
+
const numberElementDataSchema = abstractNumberElementDataSchema.extend({
|
|
39
|
+
type: zod_1.z.literal("number").describe("Type of data"),
|
|
40
|
+
total: zod_1.z
|
|
41
|
+
.number()
|
|
42
|
+
.nullable()
|
|
43
|
+
.describe("Total value, understood as 'value'/'total'"),
|
|
44
|
+
});
|
|
45
|
+
const percentageElementDataSchema = abstractNumberElementDataSchema.extend({
|
|
46
|
+
type: zod_1.z.literal("percentage").describe("Type of data"),
|
|
47
|
+
total: zod_1.z.never().optional()
|
|
48
|
+
});
|
|
49
|
+
const booleanElementDataSchema = abstractElementDataSchema.extend({
|
|
50
|
+
type: zod_1.z.literal("boolean").describe("Type of data"),
|
|
51
|
+
value: zod_1.z.boolean().nullable().describe("Value of the element"),
|
|
52
|
+
total: zod_1.z.never().optional(),
|
|
53
|
+
maximumValue: zod_1.z.never().optional(),
|
|
54
|
+
minimumValue: zod_1.z.never().optional(),
|
|
55
|
+
weight: zod_1.z.never().optional(),
|
|
56
|
+
});
|
|
57
|
+
exports.elementDataSchema = numberElementDataSchema.or(percentageElementDataSchema).or(booleanElementDataSchema)
|
|
46
58
|
.describe("ElementData - Element data containing value constraints and metadata");
|
|
47
59
|
exports.criteriaTreeElementTypeSchema = zod_1.z
|
|
48
60
|
.enum(["theme", "criterion", "task-group", "task", "task-item"])
|