@openframe-org/criteria-set-protocol 3.0.0-alpha.8 → 3.0.0-beta.1
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 +11 -11
- package/dist/v1/schemas/common.js +14 -6
- package/dist/v1/schemas/criteria-tree.d.ts +89 -89
- package/dist/v1/schemas/criterion.d.ts +20 -20
- package/dist/v1/schemas/criterion.js +1 -1
- package/dist/v1/schemas/data-map.d.ts +13 -13
- package/dist/v1/schemas/metadata.d.ts +0 -2
- package/dist/v1/schemas/metadata.js +2 -10
- package/dist/v1/schemas/request/matrix-request-body-schema.d.ts +0 -1
- package/dist/v1/schemas/request/matrix-request-body-schema.js +0 -4
- package/dist/v1/schemas/request/tree-and-data-request-body-schema.d.ts +0 -1
- package/dist/v1/schemas/request/tree-and-data-request-body-schema.js +2 -6
- package/dist/v1/schemas/response.d.ts +0 -2
- package/dist/v1/schemas/task-group.d.ts +11 -11
- package/dist/v1/schemas/task-item.d.ts +9 -9
- package/dist/v1/schemas/task-item.js +0 -1
- package/dist/v1/schemas/task.d.ts +9 -9
- package/dist/v1/schemas/task.js +0 -1
- package/dist/v1/schemas/theme.d.ts +26 -26
- package/dist/v1/schemas/theme.js +1 -1
- package/dist/v1/services/criteria-set.service.d.ts +0 -1
- package/dist/v1/utils.js +11 -4
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ 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.
|
|
9
|
+
export declare const elementDataSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
10
10
|
value: z.ZodNullable<z.ZodNumber>;
|
|
11
11
|
maximumValue: z.ZodNullable<z.ZodNumber>;
|
|
12
12
|
minimumValue: z.ZodNullable<z.ZodNumber>;
|
|
@@ -20,14 +20,14 @@ export declare const elementDataSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
|
|
20
20
|
weight: z.ZodNullable<z.ZodNumber>;
|
|
21
21
|
type: z.ZodLiteral<"percentage">;
|
|
22
22
|
total: z.ZodOptional<z.ZodNever>;
|
|
23
|
-
}, z.core.$catchall<z.ZodAny
|
|
23
|
+
}, z.core.$catchall<z.ZodAny>>, z.ZodObject<{
|
|
24
24
|
type: z.ZodLiteral<"boolean">;
|
|
25
25
|
value: z.ZodNullable<z.ZodBoolean>;
|
|
26
26
|
total: z.ZodOptional<z.ZodNever>;
|
|
27
27
|
maximumValue: z.ZodOptional<z.ZodNever>;
|
|
28
28
|
minimumValue: z.ZodOptional<z.ZodNever>;
|
|
29
29
|
weight: z.ZodOptional<z.ZodNever>;
|
|
30
|
-
}, z.core.$catchall<z.ZodAny>>]>;
|
|
30
|
+
}, z.core.$catchall<z.ZodAny>>], "type">;
|
|
31
31
|
export declare const criteriaTreeElementTypeSchema: z.ZodEnum<{
|
|
32
32
|
theme: "theme";
|
|
33
33
|
criterion: "criterion";
|
|
@@ -62,7 +62,7 @@ export declare const abstractElementSchema: z.ZodObject<{
|
|
|
62
62
|
type: z.ZodLiteral<"link">;
|
|
63
63
|
url: z.ZodString;
|
|
64
64
|
}, z.core.$strip>], "type">>>;
|
|
65
|
-
data: z.ZodNullable<z.
|
|
65
|
+
data: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
66
66
|
value: z.ZodNullable<z.ZodNumber>;
|
|
67
67
|
maximumValue: z.ZodNullable<z.ZodNumber>;
|
|
68
68
|
minimumValue: z.ZodNullable<z.ZodNumber>;
|
|
@@ -76,28 +76,28 @@ export declare const abstractElementSchema: z.ZodObject<{
|
|
|
76
76
|
weight: z.ZodNullable<z.ZodNumber>;
|
|
77
77
|
type: z.ZodLiteral<"percentage">;
|
|
78
78
|
total: z.ZodOptional<z.ZodNever>;
|
|
79
|
-
}, z.core.$catchall<z.ZodAny
|
|
79
|
+
}, z.core.$catchall<z.ZodAny>>, z.ZodObject<{
|
|
80
80
|
type: z.ZodLiteral<"boolean">;
|
|
81
81
|
value: z.ZodNullable<z.ZodBoolean>;
|
|
82
82
|
total: z.ZodOptional<z.ZodNever>;
|
|
83
83
|
maximumValue: z.ZodOptional<z.ZodNever>;
|
|
84
84
|
minimumValue: z.ZodOptional<z.ZodNever>;
|
|
85
85
|
weight: z.ZodOptional<z.ZodNever>;
|
|
86
|
-
}, z.core.$catchall<z.ZodAny>>]>>;
|
|
86
|
+
}, z.core.$catchall<z.ZodAny>>], "type">>;
|
|
87
87
|
sortOrder: z.ZodNullable<z.ZodNumber>;
|
|
88
88
|
}, z.core.$strip>;
|
|
89
89
|
export declare const breadcrumbOptionsSchema: z.ZodUnion<[z.ZodObject<{
|
|
90
90
|
hideFromBreadcrumbs: z.ZodLiteral<true>;
|
|
91
91
|
breadcrumbTextFormat: z.ZodOptional<z.ZodNever>;
|
|
92
92
|
}, z.core.$strip>, z.ZodObject<{
|
|
93
|
-
hideFromBreadcrumbs: z.ZodDefault<z.
|
|
93
|
+
hideFromBreadcrumbs: z.ZodDefault<z.ZodLiteral<false>>;
|
|
94
94
|
breadcrumbTextFormat: z.ZodString;
|
|
95
95
|
}, z.core.$strip>]>;
|
|
96
96
|
export declare const documentTreeOptionsSchema: z.ZodUnion<[z.ZodObject<{
|
|
97
97
|
hideFromDocumentTree: z.ZodLiteral<true>;
|
|
98
98
|
documentTreeFolderTextFormat: z.ZodOptional<z.ZodNever>;
|
|
99
99
|
}, z.core.$strip>, z.ZodObject<{
|
|
100
|
-
hideFromDocumentTree: z.
|
|
100
|
+
hideFromDocumentTree: z.ZodLiteral<false>;
|
|
101
101
|
documentTreeFolderTextFormat: z.ZodString;
|
|
102
102
|
}, z.core.$strip>]>;
|
|
103
103
|
export declare const criteriaTreeOptionsSchema: z.ZodObject<{
|
|
@@ -106,7 +106,7 @@ export declare const criteriaTreeOptionsSchema: z.ZodObject<{
|
|
|
106
106
|
export declare const reportOptionsSchema: z.ZodObject<{
|
|
107
107
|
reportTitleTextFormat: z.ZodString;
|
|
108
108
|
}, z.core.$strip>;
|
|
109
|
-
export declare const treeResultSchema: z.
|
|
109
|
+
export declare const treeResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
110
110
|
type: z.ZodLiteral<"number">;
|
|
111
111
|
total: z.ZodNullable<z.ZodNumber>;
|
|
112
112
|
value: z.ZodNullable<z.ZodNumber>;
|
|
@@ -114,11 +114,11 @@ export declare const treeResultSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
|
|
114
114
|
type: z.ZodLiteral<"percentage">;
|
|
115
115
|
total: z.ZodOptional<z.ZodNever>;
|
|
116
116
|
value: z.ZodNullable<z.ZodNumber>;
|
|
117
|
-
}, z.core.$catchall<z.ZodAny
|
|
117
|
+
}, z.core.$catchall<z.ZodAny>>, z.ZodObject<{
|
|
118
118
|
type: z.ZodLiteral<"boolean">;
|
|
119
119
|
value: z.ZodNullable<z.ZodBoolean>;
|
|
120
120
|
total: z.ZodOptional<z.ZodNever>;
|
|
121
121
|
maximumValue: z.ZodOptional<z.ZodNever>;
|
|
122
122
|
minimumValue: z.ZodOptional<z.ZodNever>;
|
|
123
123
|
weight: z.ZodOptional<z.ZodNever>;
|
|
124
|
-
}, z.core.$catchall<z.ZodAny>>]>;
|
|
124
|
+
}, z.core.$catchall<z.ZodAny>>], "type">;
|
|
@@ -40,7 +40,7 @@ const numberElementDataSchema = abstractNumberElementDataSchema.extend({
|
|
|
40
40
|
total: zod_1.z
|
|
41
41
|
.number()
|
|
42
42
|
.nullable()
|
|
43
|
-
.describe("Total value, understood as 'value'/'total'")
|
|
43
|
+
.describe("Total value, understood as 'value'/'total'")
|
|
44
44
|
});
|
|
45
45
|
const percentageElementDataSchema = abstractNumberElementDataSchema.extend({
|
|
46
46
|
type: zod_1.z.literal("percentage").describe("Type of data"),
|
|
@@ -52,9 +52,13 @@ const booleanElementDataSchema = abstractElementDataSchema.extend({
|
|
|
52
52
|
total: zod_1.z.never().optional(),
|
|
53
53
|
maximumValue: zod_1.z.never().optional(),
|
|
54
54
|
minimumValue: zod_1.z.never().optional(),
|
|
55
|
-
weight: zod_1.z.never().optional()
|
|
55
|
+
weight: zod_1.z.never().optional()
|
|
56
56
|
});
|
|
57
|
-
exports.elementDataSchema =
|
|
57
|
+
exports.elementDataSchema = zod_1.z.discriminatedUnion("type", [
|
|
58
|
+
numberElementDataSchema,
|
|
59
|
+
percentageElementDataSchema,
|
|
60
|
+
booleanElementDataSchema
|
|
61
|
+
])
|
|
58
62
|
.describe("ElementData - Element data containing value constraints and metadata");
|
|
59
63
|
exports.criteriaTreeElementTypeSchema = zod_1.z
|
|
60
64
|
.enum(["theme", "criterion", "task-group", "task", "task-item"])
|
|
@@ -90,7 +94,6 @@ exports.breadcrumbOptionsSchema = zod_1.z
|
|
|
90
94
|
.or(zod_1.z.object({
|
|
91
95
|
hideFromBreadcrumbs: zod_1.z
|
|
92
96
|
.literal(false)
|
|
93
|
-
.nullable()
|
|
94
97
|
.default(false)
|
|
95
98
|
.describe("Whether to hide the element from the breadcrumbs"),
|
|
96
99
|
breadcrumbTextFormat: zod_1.z
|
|
@@ -107,7 +110,6 @@ exports.documentTreeOptionsSchema = zod_1.z
|
|
|
107
110
|
.or(zod_1.z.object({
|
|
108
111
|
hideFromDocumentTree: zod_1.z
|
|
109
112
|
.literal(false)
|
|
110
|
-
.nullable()
|
|
111
113
|
.describe("Whether to hide the element from the document tree folder structure"),
|
|
112
114
|
documentTreeFolderTextFormat: zod_1.z
|
|
113
115
|
.string()
|
|
@@ -125,4 +127,10 @@ exports.reportOptionsSchema = zod_1.z
|
|
|
125
127
|
.string()
|
|
126
128
|
.describe("The format of the report row text, use ':code:' and ':title:' to define where the code and/or title should be inserted")
|
|
127
129
|
});
|
|
128
|
-
|
|
130
|
+
const numberTreeResult = numberElementDataSchema.omit({ weight: true, minimumValue: true, maximumValue: true });
|
|
131
|
+
const percentageTreeResult = percentageElementDataSchema.omit({ weight: true, minimumValue: true, maximumValue: true });
|
|
132
|
+
exports.treeResultSchema = zod_1.z.discriminatedUnion("type", [
|
|
133
|
+
numberTreeResult,
|
|
134
|
+
percentageTreeResult,
|
|
135
|
+
booleanElementDataSchema
|
|
136
|
+
]).describe("TreeResult - The result of the evaluation of a criteria set");
|