@openframe-org/criteria-set-protocol 2.0.29 → 2.1.0
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.js +48 -25
- package/dist/v1/schemas/common.js +79 -45
- package/dist/v1/schemas/criteria-set.d.ts +8 -0
- package/dist/v1/schemas/criteria-set.js +21 -4
- package/dist/v1/schemas/criteria-tree.d.ts +240 -60
- package/dist/v1/schemas/criteria-tree.js +15 -4
- package/dist/v1/schemas/criterion.d.ts +62 -11
- package/dist/v1/schemas/criterion.js +44 -6
- package/dist/v1/schemas/data-map.js +17 -6
- package/dist/v1/schemas/documentation.js +16 -8
- package/dist/v1/schemas/metadata.js +38 -15
- package/dist/v1/schemas/request/criteria-set-id-param-schema.js +6 -3
- package/dist/v1/schemas/request/matrix-request-body-schema.js +17 -5
- package/dist/v1/schemas/request/tree-and-data-request-body-schema.js +13 -4
- package/dist/v1/schemas/request/version-param-schema.js +6 -3
- package/dist/v1/schemas/response.js +10 -6
- package/dist/v1/schemas/task-group.d.ts +26 -9
- package/dist/v1/schemas/task-group.js +28 -7
- package/dist/v1/schemas/task-item.d.ts +0 -8
- package/dist/v1/schemas/task-item.js +107 -44
- package/dist/v1/schemas/task.d.ts +22 -7
- package/dist/v1/schemas/task.js +28 -6
- package/dist/v1/schemas/theme.d.ts +94 -13
- package/dist/v1/schemas/theme.js +56 -14
- package/dist/v1/types/criteria.d.ts +2 -1
- package/dist/v1/utils.d.ts +0 -8
- package/dist/v1/utils.js +1 -19
- package/package.json +7 -5
|
@@ -2,34 +2,57 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.certificationDefinitionSchema = exports.percentageBasedCertificationDefinitionSchema = exports.numberBasedCertificationDefinitionSchema = exports.percentageBasedCertificationDefinitionRulesSchema = exports.numberBasedCertificationDefinitionRulesSchema = exports.certificationDefinitionTypeSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
exports.certificationDefinitionTypeSchema = zod_1.z
|
|
6
|
-
"number",
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
exports.certificationDefinitionTypeSchema = zod_1.z
|
|
6
|
+
.enum(["number", "percentage"])
|
|
7
|
+
.describe("CertificationDefinitionType");
|
|
8
|
+
exports.numberBasedCertificationDefinitionRulesSchema = zod_1.z
|
|
9
|
+
.object({
|
|
10
10
|
minimum: zod_1.z.number().optional(),
|
|
11
11
|
exclusiveMinimum: zod_1.z.number().optional(),
|
|
12
12
|
maximum: zod_1.z.number().optional(),
|
|
13
13
|
exclusiveMaximum: zod_1.z.number().optional(),
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
14
|
+
})
|
|
15
|
+
.describe("NumberBasedCertificationDefinitionRules");
|
|
16
|
+
exports.percentageBasedCertificationDefinitionRulesSchema = exports.numberBasedCertificationDefinitionRulesSchema.describe("PercentageBasedCertificationDefinitionRules");
|
|
17
|
+
const abstractCertificationDefinitionSchema = zod_1.z
|
|
18
|
+
.object({
|
|
19
|
+
type: exports.certificationDefinitionTypeSchema.describe("Type of certification definition"),
|
|
20
|
+
code: zod_1.z
|
|
21
|
+
.string()
|
|
22
|
+
.describe("Unique identifier code for the certification, such as 'platinum' or 'ecolabel'"),
|
|
23
|
+
icon: zod_1.z
|
|
24
|
+
.string()
|
|
25
|
+
.optional()
|
|
26
|
+
.describe("Optional icon URL for the certification"),
|
|
27
|
+
name: zod_1.z.string().describe("Display name of the certification"),
|
|
28
|
+
description: zod_1.z
|
|
29
|
+
.string()
|
|
30
|
+
.optional()
|
|
31
|
+
.describe("Optional detailed description of the certification"),
|
|
32
|
+
rulesText: zod_1.z
|
|
33
|
+
.string()
|
|
34
|
+
.describe("Human-readable text describing the certification rules"),
|
|
35
|
+
})
|
|
36
|
+
.describe("Abstract base schema for certification definitions");
|
|
37
|
+
exports.numberBasedCertificationDefinitionSchema = abstractCertificationDefinitionSchema
|
|
38
|
+
.extend({
|
|
39
|
+
type: zod_1.z
|
|
40
|
+
.literal("number")
|
|
41
|
+
.describe("Specifies this as a number-based certification"),
|
|
42
|
+
rules: exports.numberBasedCertificationDefinitionRulesSchema.describe("Rules specific to number-based certification"),
|
|
43
|
+
})
|
|
44
|
+
.describe("NumberBasedCertificationDefinition");
|
|
45
|
+
exports.percentageBasedCertificationDefinitionSchema = abstractCertificationDefinitionSchema
|
|
46
|
+
.extend({
|
|
47
|
+
type: zod_1.z
|
|
48
|
+
.literal("percentage")
|
|
49
|
+
.describe("Specifies this as a percentage-based certification"),
|
|
50
|
+
rules: exports.percentageBasedCertificationDefinitionRulesSchema.describe("Rules specific to percentage-based certification"),
|
|
51
|
+
})
|
|
52
|
+
.describe("PercentageBasedCertificationDefinition");
|
|
53
|
+
exports.certificationDefinitionSchema = zod_1.z
|
|
54
|
+
.discriminatedUnion("type", [
|
|
33
55
|
exports.numberBasedCertificationDefinitionSchema,
|
|
34
56
|
exports.percentageBasedCertificationDefinitionSchema,
|
|
35
|
-
])
|
|
57
|
+
])
|
|
58
|
+
.describe("CertificationDefinition");
|
|
@@ -3,51 +3,85 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.abstractElementSchema = exports.criteriaTreeElementTypeSchema = exports.elementDataSchema = exports.taskItemValueSchema = exports.taskItemScalarValueSchema = exports.colorSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const documentation_1 = require("./documentation");
|
|
6
|
-
exports.colorSchema = zod_1.z
|
|
7
|
-
|
|
6
|
+
exports.colorSchema = zod_1.z
|
|
7
|
+
.union([
|
|
8
|
+
zod_1.z.string().describe("Hex color string"),
|
|
8
9
|
zod_1.z.object({
|
|
9
|
-
red: zod_1.z.number(),
|
|
10
|
-
green: zod_1.z.number(),
|
|
11
|
-
blue: zod_1.z.number(),
|
|
10
|
+
red: zod_1.z.number().describe("Red component (0-255)"),
|
|
11
|
+
green: zod_1.z.number().describe("Green component (0-255)"),
|
|
12
|
+
blue: zod_1.z.number().describe("Blue component (0-255)"),
|
|
12
13
|
}),
|
|
13
|
-
])
|
|
14
|
+
])
|
|
15
|
+
.describe("Color");
|
|
14
16
|
// These are not "common" and are task-item specific, but generate a circular dependency if moved to task-item.ts
|
|
15
|
-
exports.taskItemScalarValueSchema = zod_1.z
|
|
16
|
-
zod_1.z.string(),
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
zod_1.z.
|
|
20
|
-
|
|
21
|
-
exports.
|
|
22
|
-
|
|
23
|
-
zod_1.z
|
|
24
|
-
])
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
value: exports.taskItemValueSchema.optional(),
|
|
28
|
-
text: zod_1.z.string().optional(),
|
|
29
|
-
maximumValue: zod_1.z
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
17
|
+
exports.taskItemScalarValueSchema = zod_1.z
|
|
18
|
+
.union([zod_1.z.string(), zod_1.z.number(), zod_1.z.boolean(), zod_1.z.null()])
|
|
19
|
+
.describe("TaskItemScalarValue - Basic scalar value types that can be used in task items");
|
|
20
|
+
exports.taskItemValueSchema = zod_1.z
|
|
21
|
+
.union([exports.taskItemScalarValueSchema, zod_1.z.array(exports.taskItemScalarValueSchema)])
|
|
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(["percentage", "number"])
|
|
27
|
+
.optional()
|
|
28
|
+
.describe("Type of numeric data (percentage or number)"),
|
|
29
|
+
value: exports.taskItemValueSchema.optional().describe("Value of the element"),
|
|
30
|
+
text: zod_1.z.string().optional().describe("Text representation of the value"),
|
|
31
|
+
maximumValue: zod_1.z
|
|
32
|
+
.number()
|
|
33
|
+
.optional()
|
|
34
|
+
.describe("Maximum allowed value (inclusive)"),
|
|
35
|
+
minimumValue: zod_1.z
|
|
36
|
+
.number()
|
|
37
|
+
.optional()
|
|
38
|
+
.describe("Minimum allowed value (inclusive)"),
|
|
39
|
+
exclusiveMaximum: zod_1.z
|
|
40
|
+
.number()
|
|
41
|
+
.optional()
|
|
42
|
+
.describe("Maximum allowed value (exclusive)"),
|
|
43
|
+
exclusiveMinimum: zod_1.z
|
|
44
|
+
.number()
|
|
45
|
+
.optional()
|
|
46
|
+
.describe("Minimum allowed value (exclusive)"),
|
|
47
|
+
step: zod_1.z
|
|
48
|
+
.number()
|
|
49
|
+
.optional()
|
|
50
|
+
.describe("Increment/decrement step size for numeric inputs"),
|
|
51
|
+
total: zod_1.z
|
|
52
|
+
.number()
|
|
53
|
+
.optional()
|
|
54
|
+
.describe("Total value, understood as 'value'/'total'"),
|
|
55
|
+
readOnly: zod_1.z
|
|
56
|
+
.boolean()
|
|
57
|
+
.optional()
|
|
58
|
+
.describe("Whether the element value can be modified"),
|
|
59
|
+
})
|
|
60
|
+
.describe("Element data containing value constraints and metadata");
|
|
61
|
+
exports.criteriaTreeElementTypeSchema = zod_1.z
|
|
62
|
+
.enum(["theme", "criterion", "task-group", "task", "task-item"])
|
|
63
|
+
.describe("CriteriaTreeElementType - Types of elements that can exist in the criteria tree hierarchy");
|
|
64
|
+
exports.abstractElementSchema = zod_1.z
|
|
65
|
+
.object({
|
|
66
|
+
type: exports.criteriaTreeElementTypeSchema.describe("CriteriaTreeElementType of the tree element"),
|
|
67
|
+
title: zod_1.z.string().describe("Display title of the element"),
|
|
68
|
+
longFormTitle: zod_1.z
|
|
69
|
+
.string()
|
|
70
|
+
.optional()
|
|
71
|
+
.describe("Extended or full-length title"),
|
|
72
|
+
code: zod_1.z.string().describe("Unique identifier code"),
|
|
73
|
+
tags: zod_1.z
|
|
74
|
+
.array(zod_1.z.string())
|
|
75
|
+
.optional()
|
|
76
|
+
.describe("List of classification tags"),
|
|
77
|
+
documentation: zod_1.z
|
|
78
|
+
.array(documentation_1.documentationItemSchema)
|
|
79
|
+
.optional()
|
|
80
|
+
.describe("Associated documentation items"),
|
|
81
|
+
data: exports.elementDataSchema.optional().describe("Element data"),
|
|
82
|
+
sortOrder: zod_1.z
|
|
83
|
+
.number()
|
|
84
|
+
.optional()
|
|
85
|
+
.describe("Custom sorting position within parent"),
|
|
86
|
+
})
|
|
87
|
+
.describe("AbstractElement - Base schema for all tree elements");
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
export declare const DASHBOARD_CATEGORY_LISTING_TYPES: readonly ["per-criteria", "per-task"];
|
|
3
|
+
export declare const dashboardCategoryListingTypeSchema: z.ZodEnum<["per-criteria", "per-task"]>;
|
|
2
4
|
export declare const criteriaSetOptionsSchema: z.ZodObject<{
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Use dashboardRenderingType = renderDetailedViewInDashboard === false ? 'per-criteria' : 'per-task'
|
|
7
|
+
*/
|
|
3
8
|
renderDetailedViewInDashboard: z.ZodOptional<z.ZodBoolean>;
|
|
9
|
+
dashboardRenderingType: z.ZodOptional<z.ZodString>;
|
|
4
10
|
}, "strip", z.ZodTypeAny, {
|
|
5
11
|
renderDetailedViewInDashboard?: boolean | undefined;
|
|
12
|
+
dashboardRenderingType?: string | undefined;
|
|
6
13
|
}, {
|
|
7
14
|
renderDetailedViewInDashboard?: boolean | undefined;
|
|
15
|
+
dashboardRenderingType?: string | undefined;
|
|
8
16
|
}>;
|
|
@@ -1,7 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.criteriaSetOptionsSchema = void 0;
|
|
3
|
+
exports.criteriaSetOptionsSchema = exports.dashboardCategoryListingTypeSchema = exports.DASHBOARD_CATEGORY_LISTING_TYPES = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
exports.
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
exports.DASHBOARD_CATEGORY_LISTING_TYPES = [
|
|
6
|
+
"per-criteria",
|
|
7
|
+
"per-task",
|
|
8
|
+
];
|
|
9
|
+
exports.dashboardCategoryListingTypeSchema = zod_1.z.enum(exports.DASHBOARD_CATEGORY_LISTING_TYPES);
|
|
10
|
+
exports.criteriaSetOptionsSchema = zod_1.z
|
|
11
|
+
.object({
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use dashboardRenderingType = renderDetailedViewInDashboard === false ? 'per-criteria' : 'per-task'
|
|
14
|
+
*/
|
|
15
|
+
renderDetailedViewInDashboard: zod_1.z
|
|
16
|
+
.boolean()
|
|
17
|
+
.optional()
|
|
18
|
+
.describe("Deprecated. Use dashboardRenderingType = renderDetailedViewInDashboard === false ? 'per-criteria' : 'per-task'"),
|
|
19
|
+
dashboardRenderingType: zod_1.z
|
|
20
|
+
.string()
|
|
21
|
+
.optional()
|
|
22
|
+
.describe("Whether to render the criteria set in a dashboard as a list of criteria or as a list of tasks"),
|
|
23
|
+
})
|
|
24
|
+
.describe("CriteriaSetOptions - options for a criteria set");
|