@openframe-org/criteria-set-protocol 3.0.0-alpha.3 → 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.
@@ -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
- type: z.ZodNullable<z.ZodEnum<{
11
- number: "number";
12
- boolean: "boolean";
13
- percentage: "percentage";
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
- }, z.core.$catchall<z.ZodAny>>;
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,31 +62,40 @@ 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
- type: z.ZodNullable<z.ZodEnum<{
58
- number: "number";
59
- boolean: "boolean";
60
- percentage: "percentage";
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
- }, z.core.$catchall<z.ZodAny>>>;
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<{
72
90
  hideFromBreadcrumbs: z.ZodLiteral<true>;
73
- breadcrumbTextFormat: z.ZodNullable<z.ZodNever>;
91
+ breadcrumbTextFormat: z.ZodOptional<z.ZodNever>;
74
92
  }, z.core.$strip>, z.ZodObject<{
75
93
  hideFromBreadcrumbs: z.ZodDefault<z.ZodNullable<z.ZodLiteral<false>>>;
76
94
  breadcrumbTextFormat: z.ZodString;
77
95
  }, z.core.$strip>]>;
78
96
  export declare const documentTreeOptionsSchema: z.ZodUnion<[z.ZodObject<{
79
97
  hideFromDocumentTree: z.ZodLiteral<true>;
80
- documentTreeFolderTextFormat: z.ZodNullable<z.ZodNever>;
98
+ documentTreeFolderTextFormat: z.ZodOptional<z.ZodNever>;
81
99
  }, z.core.$strip>, z.ZodObject<{
82
100
  hideFromDocumentTree: z.ZodNullable<z.ZodLiteral<false>>;
83
101
  documentTreeFolderTextFormat: z.ZodString;
@@ -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
- type: z.ZodNullable<z.ZodEnum<{
93
- number: "number";
94
- boolean: "boolean";
95
- percentage: "percentage";
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
- }, z.core.$catchall<z.ZodAny>>;
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
- exports.elementDataSchema = zod_1.z
24
- .object({
25
- type: zod_1.z
26
- .enum(["number", "percentage", "boolean"])
27
- .nullable()
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
- .catchall(zod_1.z.any())
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"])
@@ -73,7 +85,7 @@ exports.breadcrumbOptionsSchema = zod_1.z
73
85
  hideFromBreadcrumbs: zod_1.z
74
86
  .literal(true)
75
87
  .describe("Whether to hide the element from the breadcrumbs"),
76
- breadcrumbTextFormat: zod_1.z.never().nullable()
88
+ breadcrumbTextFormat: zod_1.z.never().optional()
77
89
  })
78
90
  .or(zod_1.z.object({
79
91
  hideFromBreadcrumbs: zod_1.z
@@ -90,7 +102,7 @@ exports.documentTreeOptionsSchema = zod_1.z
90
102
  hideFromDocumentTree: zod_1.z
91
103
  .literal(true)
92
104
  .describe("Whether to hide the element from the document tree folder structure"),
93
- documentTreeFolderTextFormat: zod_1.z.never().nullable()
105
+ documentTreeFolderTextFormat: zod_1.z.never().optional()
94
106
  })
95
107
  .or(zod_1.z.object({
96
108
  hideFromDocumentTree: zod_1.z