@openframe-org/criteria-set-protocol 2.0.28 → 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.
@@ -32,14 +32,13 @@ export declare const percentageBasedCertificationDefinitionRulesSchema: z.ZodObj
32
32
  exclusiveMaximum?: number | undefined;
33
33
  exclusiveMinimum?: number | undefined;
34
34
  }>;
35
- export declare const numberBasedCertificationDefinitionSchema: z.ZodObject<z.objectUtil.extendShape<{
36
- type: z.ZodEnum<["number", "percentage"]>;
35
+ export declare const numberBasedCertificationDefinitionSchema: z.ZodObject<{
37
36
  code: z.ZodString;
38
37
  icon: z.ZodOptional<z.ZodString>;
39
38
  name: z.ZodString;
40
39
  description: z.ZodOptional<z.ZodString>;
41
40
  rulesText: z.ZodString;
42
- }, {
41
+ } & {
43
42
  type: z.ZodLiteral<"number">;
44
43
  rules: z.ZodObject<{
45
44
  minimum: z.ZodOptional<z.ZodNumber>;
@@ -57,7 +56,7 @@ export declare const numberBasedCertificationDefinitionSchema: z.ZodObject<z.obj
57
56
  exclusiveMaximum?: number | undefined;
58
57
  exclusiveMinimum?: number | undefined;
59
58
  }>;
60
- }>, "strip", z.ZodTypeAny, {
59
+ }, "strip", z.ZodTypeAny, {
61
60
  code: string;
62
61
  name: string;
63
62
  type: "number";
@@ -84,14 +83,13 @@ export declare const numberBasedCertificationDefinitionSchema: z.ZodObject<z.obj
84
83
  description?: string | undefined;
85
84
  icon?: string | undefined;
86
85
  }>;
87
- export declare const percentageBasedCertificationDefinitionSchema: z.ZodObject<z.objectUtil.extendShape<{
88
- type: z.ZodEnum<["number", "percentage"]>;
86
+ export declare const percentageBasedCertificationDefinitionSchema: z.ZodObject<{
89
87
  code: z.ZodString;
90
88
  icon: z.ZodOptional<z.ZodString>;
91
89
  name: z.ZodString;
92
90
  description: z.ZodOptional<z.ZodString>;
93
91
  rulesText: z.ZodString;
94
- }, {
92
+ } & {
95
93
  type: z.ZodLiteral<"percentage">;
96
94
  rules: z.ZodObject<{
97
95
  minimum: z.ZodOptional<z.ZodNumber>;
@@ -109,7 +107,7 @@ export declare const percentageBasedCertificationDefinitionSchema: z.ZodObject<z
109
107
  exclusiveMaximum?: number | undefined;
110
108
  exclusiveMinimum?: number | undefined;
111
109
  }>;
112
- }>, "strip", z.ZodTypeAny, {
110
+ }, "strip", z.ZodTypeAny, {
113
111
  code: string;
114
112
  name: string;
115
113
  type: "percentage";
@@ -136,14 +134,13 @@ export declare const percentageBasedCertificationDefinitionSchema: z.ZodObject<z
136
134
  description?: string | undefined;
137
135
  icon?: string | undefined;
138
136
  }>;
139
- export declare const certificationDefinitionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<z.objectUtil.extendShape<{
140
- type: z.ZodEnum<["number", "percentage"]>;
137
+ export declare const certificationDefinitionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
141
138
  code: z.ZodString;
142
139
  icon: z.ZodOptional<z.ZodString>;
143
140
  name: z.ZodString;
144
141
  description: z.ZodOptional<z.ZodString>;
145
142
  rulesText: z.ZodString;
146
- }, {
143
+ } & {
147
144
  type: z.ZodLiteral<"number">;
148
145
  rules: z.ZodObject<{
149
146
  minimum: z.ZodOptional<z.ZodNumber>;
@@ -161,7 +158,7 @@ export declare const certificationDefinitionSchema: z.ZodDiscriminatedUnion<"typ
161
158
  exclusiveMaximum?: number | undefined;
162
159
  exclusiveMinimum?: number | undefined;
163
160
  }>;
164
- }>, "strip", z.ZodTypeAny, {
161
+ }, "strip", z.ZodTypeAny, {
165
162
  code: string;
166
163
  name: string;
167
164
  type: "number";
@@ -187,14 +184,13 @@ export declare const certificationDefinitionSchema: z.ZodDiscriminatedUnion<"typ
187
184
  };
188
185
  description?: string | undefined;
189
186
  icon?: string | undefined;
190
- }>, z.ZodObject<z.objectUtil.extendShape<{
191
- type: z.ZodEnum<["number", "percentage"]>;
187
+ }>, z.ZodObject<{
192
188
  code: z.ZodString;
193
189
  icon: z.ZodOptional<z.ZodString>;
194
190
  name: z.ZodString;
195
191
  description: z.ZodOptional<z.ZodString>;
196
192
  rulesText: z.ZodString;
197
- }, {
193
+ } & {
198
194
  type: z.ZodLiteral<"percentage">;
199
195
  rules: z.ZodObject<{
200
196
  minimum: z.ZodOptional<z.ZodNumber>;
@@ -212,7 +208,7 @@ export declare const certificationDefinitionSchema: z.ZodDiscriminatedUnion<"typ
212
208
  exclusiveMaximum?: number | undefined;
213
209
  exclusiveMinimum?: number | undefined;
214
210
  }>;
215
- }>, "strip", z.ZodTypeAny, {
211
+ }, "strip", z.ZodTypeAny, {
216
212
  code: string;
217
213
  name: string;
218
214
  type: "percentage";
@@ -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.enum([
6
- "number",
7
- "percentage",
8
- ]);
9
- exports.numberBasedCertificationDefinitionRulesSchema = zod_1.z.object({
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
- exports.percentageBasedCertificationDefinitionRulesSchema = exports.numberBasedCertificationDefinitionRulesSchema;
16
- const abstractCertificationDefinitionSchema = zod_1.z.object({
17
- type: exports.certificationDefinitionTypeSchema,
18
- code: zod_1.z.string(),
19
- icon: zod_1.z.string().optional(),
20
- name: zod_1.z.string(),
21
- description: zod_1.z.string().optional(),
22
- rulesText: zod_1.z.string(),
23
- });
24
- exports.numberBasedCertificationDefinitionSchema = abstractCertificationDefinitionSchema.extend({
25
- type: zod_1.z.literal("number"),
26
- rules: exports.numberBasedCertificationDefinitionRulesSchema,
27
- });
28
- exports.percentageBasedCertificationDefinitionSchema = abstractCertificationDefinitionSchema.extend({
29
- type: zod_1.z.literal("percentage"),
30
- rules: exports.percentageBasedCertificationDefinitionRulesSchema,
31
- });
32
- exports.certificationDefinitionSchema = zod_1.z.discriminatedUnion("type", [
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");
@@ -55,14 +55,13 @@ export declare const abstractElementSchema: z.ZodObject<{
55
55
  longFormTitle: z.ZodOptional<z.ZodString>;
56
56
  code: z.ZodString;
57
57
  tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
58
- documentation: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<z.objectUtil.extendShape<{
59
- type: z.ZodEnum<["pdf", "text", "link"]>;
58
+ documentation: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
60
59
  label: z.ZodString;
61
60
  text: z.ZodString;
62
- }, {
61
+ } & {
63
62
  type: z.ZodLiteral<"pdf">;
64
63
  url: z.ZodString;
65
- }>, "strip", z.ZodTypeAny, {
64
+ }, "strip", z.ZodTypeAny, {
66
65
  type: "pdf";
67
66
  url: string;
68
67
  label: string;
@@ -72,13 +71,12 @@ export declare const abstractElementSchema: z.ZodObject<{
72
71
  url: string;
73
72
  label: string;
74
73
  text: string;
75
- }>, z.ZodObject<z.objectUtil.extendShape<{
76
- type: z.ZodEnum<["pdf", "text", "link"]>;
74
+ }>, z.ZodObject<{
77
75
  label: z.ZodString;
78
76
  text: z.ZodString;
79
- }, {
77
+ } & {
80
78
  type: z.ZodLiteral<"text">;
81
- }>, "strip", z.ZodTypeAny, {
79
+ }, "strip", z.ZodTypeAny, {
82
80
  type: "text";
83
81
  label: string;
84
82
  text: string;
@@ -86,14 +84,13 @@ export declare const abstractElementSchema: z.ZodObject<{
86
84
  type: "text";
87
85
  label: string;
88
86
  text: string;
89
- }>, z.ZodObject<z.objectUtil.extendShape<{
90
- type: z.ZodEnum<["pdf", "text", "link"]>;
87
+ }>, z.ZodObject<{
91
88
  label: z.ZodString;
92
89
  text: z.ZodString;
93
- }, {
90
+ } & {
94
91
  type: z.ZodLiteral<"link">;
95
92
  url: z.ZodString;
96
- }>, "strip", z.ZodTypeAny, {
93
+ }, "strip", z.ZodTypeAny, {
97
94
  type: "link";
98
95
  url: string;
99
96
  label: string;
@@ -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.union([
7
- zod_1.z.string(),
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.union([
16
- zod_1.z.string(),
17
- zod_1.z.number(),
18
- zod_1.z.boolean(),
19
- zod_1.z.null(),
20
- ]);
21
- exports.taskItemValueSchema = zod_1.z.union([
22
- exports.taskItemScalarValueSchema,
23
- zod_1.z.array(exports.taskItemScalarValueSchema),
24
- ]);
25
- exports.elementDataSchema = zod_1.z.object({
26
- type: zod_1.z.enum(["percentage", "number"]).optional(),
27
- value: exports.taskItemValueSchema.optional(),
28
- text: zod_1.z.string().optional(),
29
- maximumValue: zod_1.z.number().optional(),
30
- minimumValue: zod_1.z.number().optional(),
31
- exclusiveMaximum: zod_1.z.number().optional(),
32
- exclusiveMinimum: zod_1.z.number().optional(),
33
- step: zod_1.z.number().optional(),
34
- total: zod_1.z.number().optional(),
35
- readOnly: zod_1.z.boolean().optional(),
36
- });
37
- exports.criteriaTreeElementTypeSchema = zod_1.z.enum([
38
- "theme",
39
- "criterion",
40
- "task-group",
41
- "task",
42
- "task-item",
43
- ]);
44
- exports.abstractElementSchema = zod_1.z.object({
45
- type: exports.criteriaTreeElementTypeSchema,
46
- title: zod_1.z.string(),
47
- longFormTitle: zod_1.z.string().optional(),
48
- code: zod_1.z.string(),
49
- tags: zod_1.z.array(zod_1.z.string()).optional(),
50
- documentation: zod_1.z.array(documentation_1.documentationItemSchema).optional(),
51
- data: exports.elementDataSchema.optional(),
52
- sortOrder: zod_1.z.number().optional(),
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.criteriaSetOptionsSchema = zod_1.z.object({
6
- renderDetailedViewInDashboard: zod_1.z.boolean().optional(),
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");