@openframe-org/criteria-set-protocol 3.0.0-alpha.1 → 3.0.0-alpha.11
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/certification.d.ts +54 -12
- package/dist/v1/schemas/certification.js +27 -7
- package/dist/v1/schemas/common.d.ts +54 -39
- package/dist/v1/schemas/common.js +31 -28
- package/dist/v1/schemas/criteria-tree.d.ts +413 -258
- package/dist/v1/schemas/criterion.d.ts +79 -51
- package/dist/v1/schemas/data-map.d.ts +85 -56
- package/dist/v1/schemas/metadata.d.ts +0 -4
- package/dist/v1/schemas/metadata.js +0 -11
- package/dist/v1/schemas/response.d.ts +0 -3
- package/dist/v1/schemas/task-group.d.ts +55 -34
- package/dist/v1/schemas/task-item.d.ts +36 -22
- package/dist/v1/schemas/task.d.ts +38 -24
- package/dist/v1/schemas/theme.d.ts +100 -65
- package/dist/v1/utils.js +1 -5
- package/package.json +1 -1
|
@@ -3,18 +3,32 @@ export declare const certificationDefinitionTypeSchema: z.ZodEnum<{
|
|
|
3
3
|
number: "number";
|
|
4
4
|
percentage: "percentage";
|
|
5
5
|
}>;
|
|
6
|
-
export declare const numberBasedCertificationDefinitionRulesSchema: z.ZodObject<{
|
|
6
|
+
export declare const numberBasedCertificationDefinitionRulesSchema: z.ZodIntersection<z.ZodUnion<readonly [z.ZodObject<{
|
|
7
7
|
minimum: z.ZodNullable<z.ZodNumber>;
|
|
8
|
+
exclusiveMinimum: z.ZodOptional<z.ZodNever>;
|
|
9
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
10
|
+
minimum: z.ZodOptional<z.ZodNever>;
|
|
8
11
|
exclusiveMinimum: z.ZodNullable<z.ZodNumber>;
|
|
12
|
+
}, z.core.$strip>]>, z.ZodUnion<readonly [z.ZodObject<{
|
|
9
13
|
maximum: z.ZodNullable<z.ZodNumber>;
|
|
14
|
+
exclusiveMaximum: z.ZodOptional<z.ZodNever>;
|
|
15
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
16
|
+
maximum: z.ZodOptional<z.ZodNever>;
|
|
10
17
|
exclusiveMaximum: z.ZodNullable<z.ZodNumber>;
|
|
11
|
-
}, z.core.$strip
|
|
12
|
-
export declare const percentageBasedCertificationDefinitionRulesSchema: z.ZodObject<{
|
|
18
|
+
}, z.core.$strip>]>>;
|
|
19
|
+
export declare const percentageBasedCertificationDefinitionRulesSchema: z.ZodIntersection<z.ZodUnion<readonly [z.ZodObject<{
|
|
13
20
|
minimum: z.ZodNullable<z.ZodNumber>;
|
|
21
|
+
exclusiveMinimum: z.ZodOptional<z.ZodNever>;
|
|
22
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
23
|
+
minimum: z.ZodOptional<z.ZodNever>;
|
|
14
24
|
exclusiveMinimum: z.ZodNullable<z.ZodNumber>;
|
|
25
|
+
}, z.core.$strip>]>, z.ZodUnion<readonly [z.ZodObject<{
|
|
15
26
|
maximum: z.ZodNullable<z.ZodNumber>;
|
|
27
|
+
exclusiveMaximum: z.ZodOptional<z.ZodNever>;
|
|
28
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
29
|
+
maximum: z.ZodOptional<z.ZodNever>;
|
|
16
30
|
exclusiveMaximum: z.ZodNullable<z.ZodNumber>;
|
|
17
|
-
}, z.core.$strip
|
|
31
|
+
}, z.core.$strip>]>>;
|
|
18
32
|
export declare const numberBasedCertificationDefinitionSchema: z.ZodObject<{
|
|
19
33
|
code: z.ZodString;
|
|
20
34
|
icon: z.ZodNullable<z.ZodString>;
|
|
@@ -22,12 +36,19 @@ export declare const numberBasedCertificationDefinitionSchema: z.ZodObject<{
|
|
|
22
36
|
description: z.ZodNullable<z.ZodString>;
|
|
23
37
|
rulesText: z.ZodString;
|
|
24
38
|
type: z.ZodLiteral<"number">;
|
|
25
|
-
rules: z.ZodObject<{
|
|
39
|
+
rules: z.ZodIntersection<z.ZodUnion<readonly [z.ZodObject<{
|
|
26
40
|
minimum: z.ZodNullable<z.ZodNumber>;
|
|
41
|
+
exclusiveMinimum: z.ZodOptional<z.ZodNever>;
|
|
42
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
43
|
+
minimum: z.ZodOptional<z.ZodNever>;
|
|
27
44
|
exclusiveMinimum: z.ZodNullable<z.ZodNumber>;
|
|
45
|
+
}, z.core.$strip>]>, z.ZodUnion<readonly [z.ZodObject<{
|
|
28
46
|
maximum: z.ZodNullable<z.ZodNumber>;
|
|
47
|
+
exclusiveMaximum: z.ZodOptional<z.ZodNever>;
|
|
48
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
49
|
+
maximum: z.ZodOptional<z.ZodNever>;
|
|
29
50
|
exclusiveMaximum: z.ZodNullable<z.ZodNumber>;
|
|
30
|
-
}, z.core.$strip
|
|
51
|
+
}, z.core.$strip>]>>;
|
|
31
52
|
}, z.core.$strip>;
|
|
32
53
|
export declare const percentageBasedCertificationDefinitionSchema: z.ZodObject<{
|
|
33
54
|
code: z.ZodString;
|
|
@@ -36,12 +57,19 @@ export declare const percentageBasedCertificationDefinitionSchema: z.ZodObject<{
|
|
|
36
57
|
description: z.ZodNullable<z.ZodString>;
|
|
37
58
|
rulesText: z.ZodString;
|
|
38
59
|
type: z.ZodLiteral<"percentage">;
|
|
39
|
-
rules: z.ZodObject<{
|
|
60
|
+
rules: z.ZodIntersection<z.ZodUnion<readonly [z.ZodObject<{
|
|
40
61
|
minimum: z.ZodNullable<z.ZodNumber>;
|
|
62
|
+
exclusiveMinimum: z.ZodOptional<z.ZodNever>;
|
|
63
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
64
|
+
minimum: z.ZodOptional<z.ZodNever>;
|
|
41
65
|
exclusiveMinimum: z.ZodNullable<z.ZodNumber>;
|
|
66
|
+
}, z.core.$strip>]>, z.ZodUnion<readonly [z.ZodObject<{
|
|
42
67
|
maximum: z.ZodNullable<z.ZodNumber>;
|
|
68
|
+
exclusiveMaximum: z.ZodOptional<z.ZodNever>;
|
|
69
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
70
|
+
maximum: z.ZodOptional<z.ZodNever>;
|
|
43
71
|
exclusiveMaximum: z.ZodNullable<z.ZodNumber>;
|
|
44
|
-
}, z.core.$strip
|
|
72
|
+
}, z.core.$strip>]>>;
|
|
45
73
|
}, z.core.$strip>;
|
|
46
74
|
export declare const certificationDefinitionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
47
75
|
code: z.ZodString;
|
|
@@ -50,12 +78,19 @@ export declare const certificationDefinitionSchema: z.ZodDiscriminatedUnion<[z.Z
|
|
|
50
78
|
description: z.ZodNullable<z.ZodString>;
|
|
51
79
|
rulesText: z.ZodString;
|
|
52
80
|
type: z.ZodLiteral<"number">;
|
|
53
|
-
rules: z.ZodObject<{
|
|
81
|
+
rules: z.ZodIntersection<z.ZodUnion<readonly [z.ZodObject<{
|
|
54
82
|
minimum: z.ZodNullable<z.ZodNumber>;
|
|
83
|
+
exclusiveMinimum: z.ZodOptional<z.ZodNever>;
|
|
84
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
85
|
+
minimum: z.ZodOptional<z.ZodNever>;
|
|
55
86
|
exclusiveMinimum: z.ZodNullable<z.ZodNumber>;
|
|
87
|
+
}, z.core.$strip>]>, z.ZodUnion<readonly [z.ZodObject<{
|
|
56
88
|
maximum: z.ZodNullable<z.ZodNumber>;
|
|
89
|
+
exclusiveMaximum: z.ZodOptional<z.ZodNever>;
|
|
90
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
91
|
+
maximum: z.ZodOptional<z.ZodNever>;
|
|
57
92
|
exclusiveMaximum: z.ZodNullable<z.ZodNumber>;
|
|
58
|
-
}, z.core.$strip
|
|
93
|
+
}, z.core.$strip>]>>;
|
|
59
94
|
}, z.core.$strip>, z.ZodObject<{
|
|
60
95
|
code: z.ZodString;
|
|
61
96
|
icon: z.ZodNullable<z.ZodString>;
|
|
@@ -63,10 +98,17 @@ export declare const certificationDefinitionSchema: z.ZodDiscriminatedUnion<[z.Z
|
|
|
63
98
|
description: z.ZodNullable<z.ZodString>;
|
|
64
99
|
rulesText: z.ZodString;
|
|
65
100
|
type: z.ZodLiteral<"percentage">;
|
|
66
|
-
rules: z.ZodObject<{
|
|
101
|
+
rules: z.ZodIntersection<z.ZodUnion<readonly [z.ZodObject<{
|
|
67
102
|
minimum: z.ZodNullable<z.ZodNumber>;
|
|
103
|
+
exclusiveMinimum: z.ZodOptional<z.ZodNever>;
|
|
104
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
105
|
+
minimum: z.ZodOptional<z.ZodNever>;
|
|
68
106
|
exclusiveMinimum: z.ZodNullable<z.ZodNumber>;
|
|
107
|
+
}, z.core.$strip>]>, z.ZodUnion<readonly [z.ZodObject<{
|
|
69
108
|
maximum: z.ZodNullable<z.ZodNumber>;
|
|
109
|
+
exclusiveMaximum: z.ZodOptional<z.ZodNever>;
|
|
110
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
111
|
+
maximum: z.ZodOptional<z.ZodNever>;
|
|
70
112
|
exclusiveMaximum: z.ZodNullable<z.ZodNumber>;
|
|
71
|
-
}, z.core.$strip
|
|
113
|
+
}, z.core.$strip>]>>;
|
|
72
114
|
}, z.core.$strip>], "type">;
|
|
@@ -5,13 +5,33 @@ const zod_1 = require("zod");
|
|
|
5
5
|
exports.certificationDefinitionTypeSchema = zod_1.z
|
|
6
6
|
.enum(["number", "percentage"])
|
|
7
7
|
.describe("CertificationDefinitionType");
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
})
|
|
8
|
+
const minimumOrExclusiveMinimum = zod_1.z.union([zod_1.z.object({
|
|
9
|
+
minimum: zod_1.z
|
|
10
|
+
.number()
|
|
11
|
+
.nullable()
|
|
12
|
+
.describe("Minimum value for the certification"),
|
|
13
|
+
exclusiveMinimum: zod_1.z.never().optional(),
|
|
14
|
+
}), zod_1.z.object({
|
|
15
|
+
minimum: zod_1.z.never().optional(),
|
|
16
|
+
exclusiveMinimum: zod_1.z
|
|
17
|
+
.number()
|
|
18
|
+
.nullable()
|
|
19
|
+
.describe("Exclusive minimum value for the certification"),
|
|
20
|
+
})]);
|
|
21
|
+
const maximumOrExclusiveMaximum = zod_1.z.union([zod_1.z.object({
|
|
22
|
+
maximum: zod_1.z
|
|
23
|
+
.number()
|
|
24
|
+
.nullable()
|
|
25
|
+
.describe("Maximum value for the certification"),
|
|
26
|
+
exclusiveMaximum: zod_1.z.never().optional(),
|
|
27
|
+
}), zod_1.z.object({
|
|
28
|
+
maximum: zod_1.z.never().optional(),
|
|
29
|
+
exclusiveMaximum: zod_1.z
|
|
30
|
+
.number()
|
|
31
|
+
.nullable()
|
|
32
|
+
.describe("Exclusive maximum value for the certification"),
|
|
33
|
+
})]);
|
|
34
|
+
exports.numberBasedCertificationDefinitionRulesSchema = zod_1.z.intersection(minimumOrExclusiveMinimum, maximumOrExclusiveMaximum)
|
|
15
35
|
.describe("NumberBasedCertificationDefinitionRules");
|
|
16
36
|
exports.percentageBasedCertificationDefinitionRulesSchema = exports.numberBasedCertificationDefinitionRulesSchema.describe("PercentageBasedCertificationDefinitionRules");
|
|
17
37
|
const abstractCertificationDefinitionSchema = zod_1.z
|
|
@@ -6,21 +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
|
-
exclusiveMaximum: z.ZodNullable<z.ZodNumber>;
|
|
21
|
-
exclusiveMinimum: z.ZodNullable<z.ZodNumber>;
|
|
22
20
|
weight: z.ZodNullable<z.ZodNumber>;
|
|
23
|
-
|
|
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>>]>;
|
|
24
31
|
export declare const criteriaTreeElementTypeSchema: z.ZodEnum<{
|
|
25
32
|
theme: "theme";
|
|
26
33
|
criterion: "criterion";
|
|
@@ -55,33 +62,40 @@ export declare const abstractElementSchema: z.ZodObject<{
|
|
|
55
62
|
type: z.ZodLiteral<"link">;
|
|
56
63
|
url: z.ZodString;
|
|
57
64
|
}, z.core.$strip>], "type">>>;
|
|
58
|
-
data: z.ZodNullable<z.ZodObject<{
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
value: z.ZodNullable<z.ZodUnion<[z.ZodNumber, z.ZodBoolean]>>;
|
|
65
|
-
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">;
|
|
66
71
|
total: z.ZodNullable<z.ZodNumber>;
|
|
72
|
+
}, z.core.$catchall<z.ZodAny>>, z.ZodObject<{
|
|
73
|
+
value: z.ZodNullable<z.ZodNumber>;
|
|
67
74
|
maximumValue: z.ZodNullable<z.ZodNumber>;
|
|
68
75
|
minimumValue: z.ZodNullable<z.ZodNumber>;
|
|
69
|
-
exclusiveMaximum: z.ZodNullable<z.ZodNumber>;
|
|
70
|
-
exclusiveMinimum: z.ZodNullable<z.ZodNumber>;
|
|
71
76
|
weight: z.ZodNullable<z.ZodNumber>;
|
|
72
|
-
|
|
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>>]>>;
|
|
73
87
|
sortOrder: z.ZodNullable<z.ZodNumber>;
|
|
74
88
|
}, z.core.$strip>;
|
|
75
89
|
export declare const breadcrumbOptionsSchema: z.ZodUnion<[z.ZodObject<{
|
|
76
90
|
hideFromBreadcrumbs: z.ZodLiteral<true>;
|
|
77
|
-
breadcrumbTextFormat: z.
|
|
91
|
+
breadcrumbTextFormat: z.ZodOptional<z.ZodNever>;
|
|
78
92
|
}, z.core.$strip>, z.ZodObject<{
|
|
79
93
|
hideFromBreadcrumbs: z.ZodDefault<z.ZodNullable<z.ZodLiteral<false>>>;
|
|
80
94
|
breadcrumbTextFormat: z.ZodString;
|
|
81
95
|
}, z.core.$strip>]>;
|
|
82
96
|
export declare const documentTreeOptionsSchema: z.ZodUnion<[z.ZodObject<{
|
|
83
97
|
hideFromDocumentTree: z.ZodLiteral<true>;
|
|
84
|
-
documentTreeFolderTextFormat: z.
|
|
98
|
+
documentTreeFolderTextFormat: z.ZodOptional<z.ZodNever>;
|
|
85
99
|
}, z.core.$strip>, z.ZodObject<{
|
|
86
100
|
hideFromDocumentTree: z.ZodNullable<z.ZodLiteral<false>>;
|
|
87
101
|
documentTreeFolderTextFormat: z.ZodString;
|
|
@@ -90,20 +104,21 @@ export declare const criteriaTreeOptionsSchema: z.ZodObject<{
|
|
|
90
104
|
criteriaTreeElementTextFormat: z.ZodString;
|
|
91
105
|
}, z.core.$strip>;
|
|
92
106
|
export declare const reportOptionsSchema: z.ZodObject<{
|
|
93
|
-
reportTitleTextFormat: z.
|
|
107
|
+
reportTitleTextFormat: z.ZodString;
|
|
94
108
|
}, z.core.$strip>;
|
|
95
|
-
export declare const treeResultSchema: z.ZodObject<{
|
|
96
|
-
type: z.
|
|
97
|
-
number: "number";
|
|
98
|
-
boolean: "boolean";
|
|
99
|
-
percentage: "percentage";
|
|
100
|
-
}>>;
|
|
101
|
-
value: z.ZodNullable<z.ZodUnion<[z.ZodNumber, z.ZodBoolean]>>;
|
|
102
|
-
text: z.ZodNullable<z.ZodString>;
|
|
109
|
+
export declare const treeResultSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
|
110
|
+
type: z.ZodLiteral<"number">;
|
|
103
111
|
total: z.ZodNullable<z.ZodNumber>;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}, z.core.$catchall<z.ZodAny
|
|
112
|
+
value: z.ZodNullable<z.ZodNumber>;
|
|
113
|
+
}, z.core.$catchall<z.ZodAny>>, z.ZodObject<{
|
|
114
|
+
type: z.ZodLiteral<"percentage">;
|
|
115
|
+
total: z.ZodOptional<z.ZodNever>;
|
|
116
|
+
value: z.ZodNullable<z.ZodNumber>;
|
|
117
|
+
}, z.core.$catchall<z.ZodAny>>]>, z.ZodObject<{
|
|
118
|
+
type: z.ZodLiteral<"boolean">;
|
|
119
|
+
value: z.ZodNullable<z.ZodBoolean>;
|
|
120
|
+
total: z.ZodOptional<z.ZodNever>;
|
|
121
|
+
maximumValue: z.ZodOptional<z.ZodNever>;
|
|
122
|
+
minimumValue: z.ZodOptional<z.ZodNever>;
|
|
123
|
+
weight: z.ZodOptional<z.ZodNever>;
|
|
124
|
+
}, z.core.$catchall<z.ZodAny>>]>;
|
|
@@ -20,37 +20,41 @@ 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()
|
|
38
|
-
.describe("Maximum allowed value
|
|
31
|
+
.describe("Maximum allowed value"),
|
|
39
32
|
minimumValue: zod_1.z
|
|
40
33
|
.number()
|
|
41
34
|
.nullable()
|
|
42
|
-
.describe("Minimum allowed value
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
35
|
+
.describe("Minimum allowed value"),
|
|
36
|
+
weight: zod_1.z.number().nullable().describe("Weight of the element")
|
|
37
|
+
});
|
|
38
|
+
const numberElementDataSchema = abstractNumberElementDataSchema.extend({
|
|
39
|
+
type: zod_1.z.literal("number").describe("Type of data"),
|
|
40
|
+
total: zod_1.z
|
|
48
41
|
.number()
|
|
49
42
|
.nullable()
|
|
50
|
-
.describe("
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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)
|
|
54
58
|
.describe("ElementData - Element data containing value constraints and metadata");
|
|
55
59
|
exports.criteriaTreeElementTypeSchema = zod_1.z
|
|
56
60
|
.enum(["theme", "criterion", "task-group", "task", "task-item"])
|
|
@@ -81,7 +85,7 @@ exports.breadcrumbOptionsSchema = zod_1.z
|
|
|
81
85
|
hideFromBreadcrumbs: zod_1.z
|
|
82
86
|
.literal(true)
|
|
83
87
|
.describe("Whether to hide the element from the breadcrumbs"),
|
|
84
|
-
breadcrumbTextFormat: zod_1.z.never().
|
|
88
|
+
breadcrumbTextFormat: zod_1.z.never().optional()
|
|
85
89
|
})
|
|
86
90
|
.or(zod_1.z.object({
|
|
87
91
|
hideFromBreadcrumbs: zod_1.z
|
|
@@ -98,7 +102,7 @@ exports.documentTreeOptionsSchema = zod_1.z
|
|
|
98
102
|
hideFromDocumentTree: zod_1.z
|
|
99
103
|
.literal(true)
|
|
100
104
|
.describe("Whether to hide the element from the document tree folder structure"),
|
|
101
|
-
documentTreeFolderTextFormat: zod_1.z.never().
|
|
105
|
+
documentTreeFolderTextFormat: zod_1.z.never().optional()
|
|
102
106
|
})
|
|
103
107
|
.or(zod_1.z.object({
|
|
104
108
|
hideFromDocumentTree: zod_1.z
|
|
@@ -119,7 +123,6 @@ exports.reportOptionsSchema = zod_1.z
|
|
|
119
123
|
.object({
|
|
120
124
|
reportTitleTextFormat: zod_1.z
|
|
121
125
|
.string()
|
|
122
|
-
.
|
|
123
|
-
.describe("The format of the report row text, use ':code:' and ':title:' to define where the code and/or title should be inserted, if not provided only the title will be rendered")
|
|
126
|
+
.describe("The format of the report row text, use ':code:' and ':title:' to define where the code and/or title should be inserted")
|
|
124
127
|
});
|
|
125
|
-
exports.treeResultSchema =
|
|
128
|
+
exports.treeResultSchema = numberElementDataSchema.omit({ weight: true, minimumValue: true, maximumValue: true }).or(percentageElementDataSchema.omit({ weight: true, minimumValue: true, maximumValue: true })).or(booleanElementDataSchema).describe("TreeResult - The result of the evaluation of a criteria set");
|