@openframe-org/criteria-set-protocol 2.2.1 → 2.2.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.
@@ -14,86 +14,34 @@ export declare const colorSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
14
14
  }>]>;
15
15
  export declare const taskItemScalarValueSchema: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
16
16
  export declare const taskItemValueSchema: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, "many">]>;
17
- export declare const elementDataSchema: z.ZodIntersection<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
18
- type: z.ZodOptional<z.ZodLiteral<"number">>;
17
+ export declare const elementDataSchema: z.ZodObject<{
18
+ type: z.ZodOptional<z.ZodEnum<["number", "percentage", "boolean"]>>;
19
19
  value: z.ZodOptional<z.ZodNumber>;
20
+ text: z.ZodOptional<z.ZodString>;
20
21
  total: z.ZodOptional<z.ZodNumber>;
21
22
  maximumValue: z.ZodOptional<z.ZodNumber>;
22
23
  minimumValue: z.ZodOptional<z.ZodNumber>;
23
24
  exclusiveMaximum: z.ZodOptional<z.ZodNumber>;
24
25
  exclusiveMinimum: z.ZodOptional<z.ZodNumber>;
25
26
  }, "strip", z.ZodTypeAny, {
26
- type?: "number" | undefined;
27
+ type?: "number" | "boolean" | "percentage" | undefined;
27
28
  total?: number | undefined;
28
29
  value?: number | undefined;
30
+ text?: string | undefined;
29
31
  maximumValue?: number | undefined;
30
32
  minimumValue?: number | undefined;
31
33
  exclusiveMaximum?: number | undefined;
32
34
  exclusiveMinimum?: number | undefined;
33
35
  }, {
34
- type?: "number" | undefined;
36
+ type?: "number" | "boolean" | "percentage" | undefined;
35
37
  total?: number | undefined;
36
38
  value?: number | undefined;
39
+ text?: string | undefined;
37
40
  maximumValue?: number | undefined;
38
41
  minimumValue?: number | undefined;
39
42
  exclusiveMaximum?: number | undefined;
40
43
  exclusiveMinimum?: number | undefined;
41
- }>, z.ZodObject<{
42
- maximumValue: z.ZodOptional<z.ZodNumber>;
43
- minimumValue: z.ZodOptional<z.ZodNumber>;
44
- exclusiveMaximum: z.ZodOptional<z.ZodNumber>;
45
- exclusiveMinimum: z.ZodOptional<z.ZodNumber>;
46
- } & {
47
- type: z.ZodLiteral<"percentage">;
48
- value: z.ZodOptional<z.ZodNumber>;
49
- total: z.ZodOptional<z.ZodNever>;
50
- }, "strip", z.ZodTypeAny, {
51
- type: "percentage";
52
- total?: undefined;
53
- value?: number | undefined;
54
- maximumValue?: number | undefined;
55
- minimumValue?: number | undefined;
56
- exclusiveMaximum?: number | undefined;
57
- exclusiveMinimum?: number | undefined;
58
- }, {
59
- type: "percentage";
60
- total?: undefined;
61
- value?: number | undefined;
62
- maximumValue?: number | undefined;
63
- minimumValue?: number | undefined;
64
- exclusiveMaximum?: number | undefined;
65
- exclusiveMinimum?: number | undefined;
66
- }>, z.ZodObject<{
67
- type: z.ZodLiteral<"boolean">;
68
- value: z.ZodOptional<z.ZodBoolean>;
69
- total: z.ZodOptional<z.ZodNever>;
70
- maximumValue: z.ZodOptional<z.ZodNever>;
71
- minimumValue: z.ZodOptional<z.ZodNever>;
72
- exclusiveMaximum: z.ZodOptional<z.ZodNever>;
73
- exclusiveMinimum: z.ZodOptional<z.ZodNever>;
74
- }, "strip", z.ZodTypeAny, {
75
- type: "boolean";
76
- total?: undefined;
77
- value?: boolean | undefined;
78
- maximumValue?: undefined;
79
- minimumValue?: undefined;
80
- exclusiveMaximum?: undefined;
81
- exclusiveMinimum?: undefined;
82
- }, {
83
- type: "boolean";
84
- total?: undefined;
85
- value?: boolean | undefined;
86
- maximumValue?: undefined;
87
- minimumValue?: undefined;
88
- exclusiveMaximum?: undefined;
89
- exclusiveMinimum?: undefined;
90
- }>]>, z.ZodObject<{
91
- text: z.ZodOptional<z.ZodString>;
92
- }, "strip", z.ZodTypeAny, {
93
- text?: string | undefined;
94
- }, {
95
- text?: string | undefined;
96
- }>>;
44
+ }>;
97
45
  export declare const criteriaTreeElementTypeSchema: z.ZodEnum<["theme", "criterion", "task-group", "task", "task-item"]>;
98
46
  export declare const abstractElementSchema: z.ZodObject<{
99
47
  type: z.ZodEnum<["theme", "criterion", "task-group", "task", "task-item"]>;
@@ -147,119 +95,50 @@ export declare const abstractElementSchema: z.ZodObject<{
147
95
  label: string;
148
96
  text: string;
149
97
  }>]>, "many">>;
150
- data: z.ZodOptional<z.ZodIntersection<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
151
- type: z.ZodOptional<z.ZodLiteral<"number">>;
98
+ data: z.ZodOptional<z.ZodObject<{
99
+ type: z.ZodOptional<z.ZodEnum<["number", "percentage", "boolean"]>>;
152
100
  value: z.ZodOptional<z.ZodNumber>;
101
+ text: z.ZodOptional<z.ZodString>;
153
102
  total: z.ZodOptional<z.ZodNumber>;
154
103
  maximumValue: z.ZodOptional<z.ZodNumber>;
155
104
  minimumValue: z.ZodOptional<z.ZodNumber>;
156
105
  exclusiveMaximum: z.ZodOptional<z.ZodNumber>;
157
106
  exclusiveMinimum: z.ZodOptional<z.ZodNumber>;
158
107
  }, "strip", z.ZodTypeAny, {
159
- type?: "number" | undefined;
108
+ type?: "number" | "boolean" | "percentage" | undefined;
160
109
  total?: number | undefined;
161
110
  value?: number | undefined;
111
+ text?: string | undefined;
162
112
  maximumValue?: number | undefined;
163
113
  minimumValue?: number | undefined;
164
114
  exclusiveMaximum?: number | undefined;
165
115
  exclusiveMinimum?: number | undefined;
166
116
  }, {
167
- type?: "number" | undefined;
117
+ type?: "number" | "boolean" | "percentage" | undefined;
168
118
  total?: number | undefined;
169
119
  value?: number | undefined;
120
+ text?: string | undefined;
170
121
  maximumValue?: number | undefined;
171
122
  minimumValue?: number | undefined;
172
123
  exclusiveMaximum?: number | undefined;
173
124
  exclusiveMinimum?: number | undefined;
174
- }>, z.ZodObject<{
175
- maximumValue: z.ZodOptional<z.ZodNumber>;
176
- minimumValue: z.ZodOptional<z.ZodNumber>;
177
- exclusiveMaximum: z.ZodOptional<z.ZodNumber>;
178
- exclusiveMinimum: z.ZodOptional<z.ZodNumber>;
179
- } & {
180
- type: z.ZodLiteral<"percentage">;
181
- value: z.ZodOptional<z.ZodNumber>;
182
- total: z.ZodOptional<z.ZodNever>;
183
- }, "strip", z.ZodTypeAny, {
184
- type: "percentage";
185
- total?: undefined;
186
- value?: number | undefined;
187
- maximumValue?: number | undefined;
188
- minimumValue?: number | undefined;
189
- exclusiveMaximum?: number | undefined;
190
- exclusiveMinimum?: number | undefined;
191
- }, {
192
- type: "percentage";
193
- total?: undefined;
194
- value?: number | undefined;
195
- maximumValue?: number | undefined;
196
- minimumValue?: number | undefined;
197
- exclusiveMaximum?: number | undefined;
198
- exclusiveMinimum?: number | undefined;
199
- }>, z.ZodObject<{
200
- type: z.ZodLiteral<"boolean">;
201
- value: z.ZodOptional<z.ZodBoolean>;
202
- total: z.ZodOptional<z.ZodNever>;
203
- maximumValue: z.ZodOptional<z.ZodNever>;
204
- minimumValue: z.ZodOptional<z.ZodNever>;
205
- exclusiveMaximum: z.ZodOptional<z.ZodNever>;
206
- exclusiveMinimum: z.ZodOptional<z.ZodNever>;
207
- }, "strip", z.ZodTypeAny, {
208
- type: "boolean";
209
- total?: undefined;
210
- value?: boolean | undefined;
211
- maximumValue?: undefined;
212
- minimumValue?: undefined;
213
- exclusiveMaximum?: undefined;
214
- exclusiveMinimum?: undefined;
215
- }, {
216
- type: "boolean";
217
- total?: undefined;
218
- value?: boolean | undefined;
219
- maximumValue?: undefined;
220
- minimumValue?: undefined;
221
- exclusiveMaximum?: undefined;
222
- exclusiveMinimum?: undefined;
223
- }>]>, z.ZodObject<{
224
- text: z.ZodOptional<z.ZodString>;
225
- }, "strip", z.ZodTypeAny, {
226
- text?: string | undefined;
227
- }, {
228
- text?: string | undefined;
229
- }>>>;
125
+ }>>;
230
126
  sortOrder: z.ZodOptional<z.ZodNumber>;
231
127
  }, "strip", z.ZodTypeAny, {
232
128
  code: string;
233
129
  type: "theme" | "criterion" | "task-group" | "task" | "task-item";
234
130
  title: string;
235
131
  longFormTitle: string;
236
- data?: (({
237
- type?: "number" | undefined;
132
+ data?: {
133
+ type?: "number" | "boolean" | "percentage" | undefined;
238
134
  total?: number | undefined;
239
135
  value?: number | undefined;
136
+ text?: string | undefined;
240
137
  maximumValue?: number | undefined;
241
138
  minimumValue?: number | undefined;
242
139
  exclusiveMaximum?: number | undefined;
243
140
  exclusiveMinimum?: number | undefined;
244
- } | {
245
- type: "percentage";
246
- total?: undefined;
247
- value?: number | undefined;
248
- maximumValue?: number | undefined;
249
- minimumValue?: number | undefined;
250
- exclusiveMaximum?: number | undefined;
251
- exclusiveMinimum?: number | undefined;
252
- } | {
253
- type: "boolean";
254
- total?: undefined;
255
- value?: boolean | undefined;
256
- maximumValue?: undefined;
257
- minimumValue?: undefined;
258
- exclusiveMaximum?: undefined;
259
- exclusiveMinimum?: undefined;
260
- }) & {
261
- text?: string | undefined;
262
- }) | undefined;
141
+ } | undefined;
263
142
  tags?: string[] | undefined;
264
143
  documentation?: ({
265
144
  type: "pdf";
@@ -282,33 +161,16 @@ export declare const abstractElementSchema: z.ZodObject<{
282
161
  type: "theme" | "criterion" | "task-group" | "task" | "task-item";
283
162
  title: string;
284
163
  longFormTitle: string;
285
- data?: (({
286
- type?: "number" | undefined;
164
+ data?: {
165
+ type?: "number" | "boolean" | "percentage" | undefined;
287
166
  total?: number | undefined;
288
167
  value?: number | undefined;
168
+ text?: string | undefined;
289
169
  maximumValue?: number | undefined;
290
170
  minimumValue?: number | undefined;
291
171
  exclusiveMaximum?: number | undefined;
292
172
  exclusiveMinimum?: number | undefined;
293
- } | {
294
- type: "percentage";
295
- total?: undefined;
296
- value?: number | undefined;
297
- maximumValue?: number | undefined;
298
- minimumValue?: number | undefined;
299
- exclusiveMaximum?: number | undefined;
300
- exclusiveMinimum?: number | undefined;
301
- } | {
302
- type: "boolean";
303
- total?: undefined;
304
- value?: boolean | undefined;
305
- maximumValue?: undefined;
306
- minimumValue?: undefined;
307
- exclusiveMaximum?: undefined;
308
- exclusiveMinimum?: undefined;
309
- }) & {
310
- text?: string | undefined;
311
- }) | undefined;
173
+ } | undefined;
312
174
  tags?: string[] | undefined;
313
175
  documentation?: ({
314
176
  type: "pdf";
@@ -20,12 +20,14 @@ 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 numberBasedDataSchema = zod_1.z.object({
23
+ exports.elementDataSchema = zod_1.z
24
+ .object({
24
25
  type: zod_1.z
25
- .literal("number")
26
+ .enum(["number", "percentage", "boolean"])
26
27
  .optional()
27
- .describe("Type of numeric data (percentage or number)"),
28
+ .describe("Type of data"),
28
29
  value: zod_1.z.number().optional().describe("Value of the element"),
30
+ text: zod_1.z.string().optional().describe("Text representation of the value"),
29
31
  total: zod_1.z
30
32
  .number()
31
33
  .optional()
@@ -46,34 +48,7 @@ const numberBasedDataSchema = zod_1.z.object({
46
48
  .number()
47
49
  .optional()
48
50
  .describe("Minimum allowed value (exclusive)"),
49
- });
50
- const percentageBasedDataSchema = numberBasedDataSchema.omit({
51
- type: true,
52
- total: true
53
- }).extend({
54
- type: zod_1.z
55
- .literal("percentage")
56
- .describe("Type of numeric data (percentage or number)"),
57
- value: zod_1.z.number().optional().describe("Value of the element"),
58
- total: zod_1.z.never().optional(),
59
- });
60
- const booleanBasedDataSchema = zod_1.z.object({
61
- type: zod_1.z
62
- .literal("boolean")
63
- .describe("Type of numeric data (percentage or number)"),
64
- value: zod_1.z.boolean().optional().describe("Value of the element"),
65
- total: zod_1.z.never().optional(),
66
- maximumValue: zod_1.z.never().optional(),
67
- minimumValue: zod_1.z.never().optional(),
68
- exclusiveMaximum: zod_1.z.never().optional(),
69
- exclusiveMinimum: zod_1.z.never().optional(),
70
- });
71
- const valueDataSchema = zod_1.z.discriminatedUnion('type', [numberBasedDataSchema, percentageBasedDataSchema, booleanBasedDataSchema])
72
- .describe("ValueData - Data containing value constraints and metadata");
73
- exports.elementDataSchema = valueDataSchema.and(zod_1.z
74
- .object({
75
- text: zod_1.z.string().optional().describe("Text representation of the value"),
76
- }))
51
+ })
77
52
  .describe("ElementData - Element data containing value constraints and metadata");
78
53
  exports.criteriaTreeElementTypeSchema = zod_1.z
79
54
  .enum(["theme", "criterion", "task-group", "task", "task-item"])
@@ -82,9 +57,7 @@ exports.abstractElementSchema = zod_1.z
82
57
  .object({
83
58
  type: exports.criteriaTreeElementTypeSchema.describe("CriteriaTreeElementType of the tree element"),
84
59
  title: zod_1.z.string().describe("Display title of the element"),
85
- longFormTitle: zod_1.z
86
- .string()
87
- .describe("Extended or full-length title"),
60
+ longFormTitle: zod_1.z.string().describe("Extended or full-length title"),
88
61
  code: zod_1.z.string().describe("Unique identifier code"),
89
62
  tags: zod_1.z
90
63
  .array(zod_1.z.string())
@@ -9,7 +9,6 @@ exports.DASHBOARD_CATEGORY_LISTING_TYPES = [
9
9
  exports.dashboardCategoryListingTypeSchema = zod_1.z.enum(exports.DASHBOARD_CATEGORY_LISTING_TYPES);
10
10
  exports.criteriaSetOptionsSchema = zod_1.z
11
11
  .object({
12
- dashboardRenderingType: exports.dashboardCategoryListingTypeSchema
13
- .describe("Whether to render the criteria set in a dashboard as a list of criteria or as a list of tasks"),
12
+ dashboardRenderingType: exports.dashboardCategoryListingTypeSchema.describe("Whether to render the criteria set in a dashboard as a list of criteria or as a list of tasks"),
14
13
  })
15
14
  .describe("CriteriaSetOptions - options for a criteria set");