@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.
- package/dist/v1/schemas/certification.d.ts +12 -16
- package/dist/v1/schemas/certification.js +48 -25
- package/dist/v1/schemas/common.d.ts +9 -12
- 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 +585 -721
- package/dist/v1/schemas/criteria-tree.js +15 -4
- package/dist/v1/schemas/criterion.d.ts +126 -130
- package/dist/v1/schemas/criterion.js +44 -6
- package/dist/v1/schemas/data-map.js +17 -6
- package/dist/v1/schemas/documentation.d.ts +18 -24
- 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 +78 -112
- package/dist/v1/schemas/task-group.js +28 -7
- package/dist/v1/schemas/task-item.d.ts +55 -114
- package/dist/v1/schemas/task-item.js +107 -44
- package/dist/v1/schemas/task.d.ts +62 -94
- package/dist/v1/schemas/task.js +28 -6
- package/dist/v1/schemas/theme.d.ts +170 -148
- 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 +8 -6
package/dist/v1/schemas/theme.js
CHANGED
|
@@ -4,17 +4,59 @@ exports.themeSchema = exports.themeOptionsSchema = exports.themeStyleSchema = vo
|
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const criterion_1 = require("./criterion");
|
|
6
6
|
const common_1 = require("./common");
|
|
7
|
-
exports.themeStyleSchema = zod_1.z
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
7
|
+
exports.themeStyleSchema = zod_1.z
|
|
8
|
+
.object({
|
|
9
|
+
primaryColor: common_1.colorSchema.describe("The primary color used for theme styling"),
|
|
10
|
+
secondaryColor: common_1.colorSchema.describe("The secondary color used for theme styling"),
|
|
11
|
+
})
|
|
12
|
+
.describe("ThemeStyle - Style configuration for the theme's visual appearance");
|
|
13
|
+
exports.themeOptionsSchema = zod_1.z
|
|
14
|
+
.object({
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated use breadcrumbTextFormat instead, where breadcrumbTextFormat = hideCode === true ? ':code:' : ':title:'
|
|
17
|
+
*/
|
|
18
|
+
hideCode: zod_1.z
|
|
19
|
+
.boolean()
|
|
20
|
+
.optional()
|
|
21
|
+
.describe(`Deprecated. Use breadcrumbTextFormat instead, where breadcrumbTextFormat = hideCode === true ? ':code:' : ':title:'`),
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated use hideFromBreadcrumbs, hideFromDocumentTree and hideCodeInReport instead
|
|
24
|
+
*/
|
|
25
|
+
hideFromHierarchy: zod_1.z
|
|
26
|
+
.boolean()
|
|
27
|
+
.optional()
|
|
28
|
+
.describe("Deprecated. Use hideFromBreadcrumbs, hideFromDocumentTree and hideCodeInReport instead"),
|
|
29
|
+
breadcrumbTextFormat: zod_1.z
|
|
30
|
+
.string()
|
|
31
|
+
.optional()
|
|
32
|
+
.default(":title:")
|
|
33
|
+
.describe("The format of the breadcrumb text, use ':code:' and ':title:' to define where the code and/or title should be inserted"),
|
|
34
|
+
hideFromBreadcrumbs: zod_1.z
|
|
35
|
+
.boolean()
|
|
36
|
+
.optional()
|
|
37
|
+
.default(false)
|
|
38
|
+
.describe("Whether to hide the theme from the breadcrumbs"),
|
|
39
|
+
hideFromDocumentTree: zod_1.z
|
|
40
|
+
.boolean()
|
|
41
|
+
.optional()
|
|
42
|
+
.default(false)
|
|
43
|
+
.describe("Whether to hide the theme from the document tree structure"),
|
|
44
|
+
hideCodeInReport: zod_1.z
|
|
45
|
+
.boolean()
|
|
46
|
+
.optional()
|
|
47
|
+
.default(false)
|
|
48
|
+
.describe("Whether to hide the theme code in the generated PDF report"),
|
|
49
|
+
})
|
|
50
|
+
.describe("Configuration options for theme display and behavior");
|
|
51
|
+
exports.themeSchema = common_1.abstractElementSchema
|
|
52
|
+
.extend({
|
|
53
|
+
type: zod_1.z.literal("theme").describe("Identifies the schema type as a theme"),
|
|
54
|
+
style: exports.themeStyleSchema
|
|
55
|
+
.optional()
|
|
56
|
+
.describe("Visual styling configuration for the theme"),
|
|
57
|
+
items: zod_1.z.array(criterion_1.criterionSchema).describe("The criteria in this theme"),
|
|
58
|
+
options: exports.themeOptionsSchema
|
|
59
|
+
.optional()
|
|
60
|
+
.describe("Configuration options for the theme display and behavior"),
|
|
61
|
+
})
|
|
62
|
+
.describe("Theme - Represents a theme, which is the top layer of the criteria tree");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { booleanTypeSchema, certificationDefinitionSchema, certificationDefinitionTypeSchema, criteriaTreeElementSchema, criteriaTreeElementTypeSchema, criteriaTreeSchema, criterionSchema, dataMapSchema, metadataSchema, numberBasedCertificationDefinitionRulesSchema, numberBasedCertificationDefinitionSchema, numberTypeSchema, percentageBasedCertificationDefinitionRulesSchema, percentageBasedCertificationDefinitionSchema, pointOptionSchema, schemaDefinitionSchema, schemaDefinitionsSchema, selectMultipleTypeSchema, selectSingleTypeSchema, taskGroupSchema, taskItemDataSchema, taskItemDefinitionSchema, taskItemScalarValueSchema, taskItemSchema, taskItemValueMapSchema, taskItemValueSchema, taskSchema, colorSchema, elementDataSchema, themeOptionsSchema, themeSchema, themeStyleSchema, documentationItemSchema, inlineDocumentationItemSchema, linkDocumentationItemSchema, pdfDocumentationItemSchema, criteriaSetsAndVersionsSchema, taskGroupOptionsSchema, criterionOptionsSchema, taskOptionsSchema, taskItemOptionsSchema, criteriaSetOptionsSchema } from "../schemas";
|
|
2
|
+
import { booleanTypeSchema, certificationDefinitionSchema, certificationDefinitionTypeSchema, criteriaTreeElementSchema, criteriaTreeElementTypeSchema, criteriaTreeSchema, criterionSchema, dataMapSchema, metadataSchema, numberBasedCertificationDefinitionRulesSchema, numberBasedCertificationDefinitionSchema, numberTypeSchema, percentageBasedCertificationDefinitionRulesSchema, percentageBasedCertificationDefinitionSchema, pointOptionSchema, schemaDefinitionSchema, schemaDefinitionsSchema, selectMultipleTypeSchema, selectSingleTypeSchema, taskGroupSchema, taskItemDataSchema, taskItemDefinitionSchema, taskItemScalarValueSchema, taskItemSchema, taskItemValueMapSchema, taskItemValueSchema, taskSchema, colorSchema, elementDataSchema, themeOptionsSchema, themeSchema, themeStyleSchema, documentationItemSchema, inlineDocumentationItemSchema, linkDocumentationItemSchema, pdfDocumentationItemSchema, criteriaSetsAndVersionsSchema, taskGroupOptionsSchema, criterionOptionsSchema, taskOptionsSchema, taskItemOptionsSchema, criteriaSetOptionsSchema, dashboardCategoryListingTypeSchema } from "../schemas";
|
|
3
3
|
export type CertificationDefinitionType = z.infer<typeof certificationDefinitionTypeSchema>;
|
|
4
4
|
export type NumberBasedCertificationDefinitionRules = z.infer<typeof numberBasedCertificationDefinitionRulesSchema>;
|
|
5
5
|
export type PercentageBasedCertificationDefinitionRules = z.infer<typeof percentageBasedCertificationDefinitionRulesSchema>;
|
|
@@ -42,3 +42,4 @@ export type CriteriaTreeElementType = z.infer<typeof criteriaTreeElementTypeSche
|
|
|
42
42
|
export type DataMap = z.infer<typeof dataMapSchema>;
|
|
43
43
|
export type CriteriaSetsAndVersions = z.infer<typeof criteriaSetsAndVersionsSchema>;
|
|
44
44
|
export type CriteriaSetOptions = z.infer<typeof criteriaSetOptionsSchema>;
|
|
45
|
+
export type DashboardCategoryListingType = z.infer<typeof dashboardCategoryListingTypeSchema>;
|
package/dist/v1/utils.d.ts
CHANGED
|
@@ -8,14 +8,6 @@ export declare const isTaskItem: (element: CriteriaTreeElement) => element is Ta
|
|
|
8
8
|
* Convert a color object to a hex string
|
|
9
9
|
*/
|
|
10
10
|
export declare const toColorHexString: (color: Color) => string;
|
|
11
|
-
/**
|
|
12
|
-
* Check if a tree element should be hidden in the output
|
|
13
|
-
*/
|
|
14
|
-
export declare const shouldHideCode: (element: Pick<CriteriaTreeElement, "options">) => boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Get the qualified name of a tree element, which is the title with the code prepended if it is different
|
|
17
|
-
*/
|
|
18
|
-
export declare const getQualifiedName: (element: Pick<Exclude<CriteriaTreeElement, TaskItem>, "code" | "title" | "options">) => string;
|
|
19
11
|
/**
|
|
20
12
|
* Find an element in the criteria tree by its code
|
|
21
13
|
*/
|
package/dist/v1/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.findInTree = exports.
|
|
3
|
+
exports.findInTree = exports.toColorHexString = exports.isTaskItem = exports.isTask = exports.isTaskGroup = exports.isCriterion = exports.isTheme = void 0;
|
|
4
4
|
const isTheme = (element) => element.type === "theme";
|
|
5
5
|
exports.isTheme = isTheme;
|
|
6
6
|
const isCriterion = (element) => element.type === "criterion";
|
|
@@ -21,24 +21,6 @@ const toColorHexString = (color) => {
|
|
|
21
21
|
return `#${color.red.toString(16)}${color.green.toString(16)}${color.blue.toString(16)}`;
|
|
22
22
|
};
|
|
23
23
|
exports.toColorHexString = toColorHexString;
|
|
24
|
-
/**
|
|
25
|
-
* Check if a tree element should be hidden in the output
|
|
26
|
-
*/
|
|
27
|
-
const shouldHideCode = (element) => {
|
|
28
|
-
var _a;
|
|
29
|
-
return !!((_a = element.options) === null || _a === void 0 ? void 0 : _a.hideCode);
|
|
30
|
-
};
|
|
31
|
-
exports.shouldHideCode = shouldHideCode;
|
|
32
|
-
/**
|
|
33
|
-
* Get the qualified name of a tree element, which is the title with the code prepended if it is different
|
|
34
|
-
*/
|
|
35
|
-
const getQualifiedName = (element) => {
|
|
36
|
-
if (element.title === element.code || (0, exports.shouldHideCode)(element)) {
|
|
37
|
-
return element.title;
|
|
38
|
-
}
|
|
39
|
-
return `${element.code} ${element.title}`;
|
|
40
|
-
};
|
|
41
|
-
exports.getQualifiedName = getQualifiedName;
|
|
42
24
|
/**
|
|
43
25
|
* Find an element in the criteria tree by its code
|
|
44
26
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openframe-org/criteria-set-protocol",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "A protocol and tools for defining and working with criteria sets",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": "Andrés Angulo <aa@openframe.org>",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"prepublishOnly": "tsc",
|
|
12
12
|
"tc": "tsc --noEmit",
|
|
13
13
|
"format": "prettier --check .",
|
|
14
|
-
"format:write": "prettier --write ."
|
|
14
|
+
"format:write": "prettier --write .",
|
|
15
|
+
"dependency-test": "madge --circular --extensions ts ./"
|
|
15
16
|
},
|
|
16
17
|
"engines": {
|
|
17
18
|
"node": ">=22",
|
|
@@ -21,12 +22,13 @@
|
|
|
21
22
|
"dist/**/*"
|
|
22
23
|
],
|
|
23
24
|
"dependencies": {
|
|
24
|
-
"@types/node": "^22.
|
|
25
|
-
"zod": "^3.
|
|
25
|
+
"@types/node": "^22.15.21",
|
|
26
|
+
"zod": "^3.25.23"
|
|
26
27
|
},
|
|
27
28
|
"devDependencies": {
|
|
28
|
-
"prettier": "^3.
|
|
29
|
-
"typescript": "^5.
|
|
29
|
+
"prettier": "^3.5.3",
|
|
30
|
+
"typescript": "^5.8.3",
|
|
31
|
+
"madge": "^8.0.0"
|
|
30
32
|
},
|
|
31
33
|
"publishConfig": {
|
|
32
34
|
"access": "public",
|