@openframe-org/criteria-set-protocol 2.0.0-beta.8 → 2.0.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/README.md +27 -34
- package/dist/index.d.ts +1 -1
- package/dist/v1/errors/DataValidationError.d.ts +1 -1
- package/dist/v1/errors/DataValidationError.js +1 -1
- package/dist/v1/errors/ParameterValidationError.d.ts +1 -1
- package/dist/v1/errors/ParameterValidationError.js +1 -1
- package/dist/v1/errors/ValidationError.d.ts +1 -1
- package/dist/v1/errors/ValidationError.js +1 -1
- package/dist/v1/errors/index.d.ts +4 -4
- package/dist/v1/errors/types.d.ts +1 -1
- package/dist/v1/index.d.ts +5 -5
- package/dist/v1/schemas/certification.d.ts +1 -1
- package/dist/v1/schemas/certification.js +13 -19
- package/dist/v1/schemas/common.d.ts +1 -1
- package/dist/v1/schemas/common.js +8 -16
- package/dist/v1/schemas/criteria-tree.d.ts +1 -49
- package/dist/v1/schemas/criteria-tree.js +5 -13
- package/dist/v1/schemas/criterion.d.ts +1 -10
- package/dist/v1/schemas/criterion.js +4 -4
- package/dist/v1/schemas/data-map.d.ts +1 -1
- package/dist/v1/schemas/data-map.js +1 -1
- package/dist/v1/schemas/documentation.d.ts +1 -1
- package/dist/v1/schemas/documentation.js +5 -9
- package/dist/v1/schemas/index.d.ts +13 -13
- package/dist/v1/schemas/metadata.d.ts +1 -1
- package/dist/v1/schemas/metadata.js +6 -6
- package/dist/v1/schemas/quality.d.ts +141 -469
- package/dist/v1/schemas/quality.js +7 -7
- package/dist/v1/schemas/request/criteria-set-id-param-schema.d.ts +1 -1
- package/dist/v1/schemas/request/criteria-set-id-param-schema.js +2 -3
- package/dist/v1/schemas/request/index.d.ts +4 -4
- package/dist/v1/schemas/request/matrix-body-schema.d.ts +1 -1
- package/dist/v1/schemas/request/matrix-body-schema.js +3 -5
- package/dist/v1/schemas/request/matrix-request-body-schema.d.ts +1 -1
- package/dist/v1/schemas/request/matrix-request-body-schema.js +6 -8
- package/dist/v1/schemas/request/tree-and-data-body-schema.d.ts +1 -1
- package/dist/v1/schemas/request/tree-and-data-body-schema.js +3 -5
- package/dist/v1/schemas/request/tree-and-data-request-body-schema.d.ts +1 -1
- package/dist/v1/schemas/request/tree-and-data-request-body-schema.js +5 -7
- package/dist/v1/schemas/request/version-param-schema.d.ts +1 -1
- package/dist/v1/schemas/request/version-param-schema.js +2 -3
- package/dist/v1/schemas/response.d.ts +2 -2
- package/dist/v1/schemas/response.js +1 -1
- package/dist/v1/schemas/task-group.d.ts +1 -8
- package/dist/v1/schemas/task-group.js +5 -5
- package/dist/v1/schemas/task-item.d.ts +1 -4
- package/dist/v1/schemas/task-item.js +27 -35
- package/dist/v1/schemas/task.d.ts +1 -6
- package/dist/v1/schemas/task.js +4 -4
- package/dist/v1/schemas/theme.d.ts +1 -12
- package/dist/v1/schemas/theme.js +4 -4
- package/dist/v1/services/i-criteria-set.service.d.ts +1 -1
- package/dist/v1/services/index.d.ts +2 -2
- package/dist/v1/services/manager.service.js +1 -4
- package/dist/v1/types/criteria.d.ts +2 -2
- package/dist/v1/types/express.d.ts +3 -3
- package/dist/v1/types/index.d.ts +2 -2
- package/dist/v1/utils.d.ts +3 -8
- package/dist/v1/utils.js +6 -6
- package/package.json +3 -11
|
@@ -2,28 +2,28 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.qualitySchema = exports.qualityStyleSchema = exports.colorSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const task_item_1 = require("./task-item");
|
|
5
6
|
const criterion_1 = require("./criterion");
|
|
6
|
-
const documentation_1 = require("./documentation");
|
|
7
7
|
exports.colorSchema = zod_1.z.union([
|
|
8
8
|
zod_1.z.string(),
|
|
9
9
|
zod_1.z.object({
|
|
10
10
|
red: zod_1.z.number(),
|
|
11
11
|
green: zod_1.z.number(),
|
|
12
|
-
blue: zod_1.z.number()
|
|
13
|
-
})
|
|
12
|
+
blue: zod_1.z.number()
|
|
13
|
+
})
|
|
14
14
|
]);
|
|
15
15
|
exports.qualityStyleSchema = zod_1.z.object({
|
|
16
16
|
primaryColor: exports.colorSchema,
|
|
17
|
-
secondaryColor: exports.colorSchema
|
|
17
|
+
secondaryColor: exports.colorSchema
|
|
18
18
|
});
|
|
19
19
|
exports.qualitySchema = zod_1.z.object({
|
|
20
|
-
type: zod_1.z.literal(
|
|
20
|
+
type: zod_1.z.literal('quality'),
|
|
21
21
|
title: zod_1.z.string(),
|
|
22
22
|
code: zod_1.z.string(),
|
|
23
23
|
tags: zod_1.z.array(zod_1.z.string()).optional(),
|
|
24
|
-
documentation: zod_1.z.array(
|
|
24
|
+
documentation: zod_1.z.array(task_item_1.documentationItemSchema).optional(),
|
|
25
25
|
data: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional(),
|
|
26
26
|
sortOrder: zod_1.z.number().optional(),
|
|
27
27
|
style: exports.qualityStyleSchema.optional(),
|
|
28
|
-
items: zod_1.z.array(criterion_1.criterionSchema)
|
|
28
|
+
items: zod_1.z.array(criterion_1.criterionSchema)
|
|
29
29
|
});
|
|
@@ -6,7 +6,6 @@ const zod_1 = require("zod");
|
|
|
6
6
|
* Validates the criteriaSetId parameter for endpoints which use it
|
|
7
7
|
*/
|
|
8
8
|
exports.criteriaSetIdParamSchema = zod_1.z.object({
|
|
9
|
-
criteriaSetId: zod_1.z
|
|
10
|
-
.
|
|
11
|
-
.regex(/^[a-zA-Z0-9.\-_]+$/, "Criteria set ID must contain only full stops, alphanumeric characters, dashes and underscores"),
|
|
9
|
+
criteriaSetId: zod_1.z.string()
|
|
10
|
+
.regex(/^[a-zA-Z0-9.\-_]+$/, 'Criteria set ID must contain only full stops, alphanumeric characters, dashes and underscores')
|
|
12
11
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
1
|
+
export * from './criteria-set-id-param-schema';
|
|
2
|
+
export * from './matrix-request-body-schema';
|
|
3
|
+
export * from './tree-and-data-request-body-schema';
|
|
4
|
+
export * from './version-param-schema';
|
|
@@ -6,11 +6,9 @@ const task_item_1 = require("../task-item");
|
|
|
6
6
|
/**
|
|
7
7
|
* Validates the request body for the matrix endpoints
|
|
8
8
|
*/
|
|
9
|
-
exports.matrixBodySchema = zod_1.z
|
|
10
|
-
.object({
|
|
9
|
+
exports.matrixBodySchema = zod_1.z.object({
|
|
11
10
|
locale: zod_1.z.string().optional(),
|
|
12
11
|
parameters: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional(),
|
|
13
12
|
values: task_item_1.taskItemValueMapSchema.optional(),
|
|
14
|
-
additional: zod_1.z.any().optional()
|
|
15
|
-
})
|
|
16
|
-
.optional();
|
|
13
|
+
additional: zod_1.z.any().optional()
|
|
14
|
+
}).optional();
|
|
@@ -6,11 +6,9 @@ const task_item_1 = require("../task-item");
|
|
|
6
6
|
/**
|
|
7
7
|
* Validates the request body for the matrix endpoints
|
|
8
8
|
*/
|
|
9
|
-
exports.matrixRequestBodySchema = zod_1.z
|
|
10
|
-
.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
})
|
|
16
|
-
.optional();
|
|
9
|
+
exports.matrixRequestBodySchema = zod_1.z.object({
|
|
10
|
+
locale: (0, zod_1.optional)(zod_1.z.string()),
|
|
11
|
+
parameters: (0, zod_1.optional)(zod_1.z.record(zod_1.z.string(), zod_1.z.any())),
|
|
12
|
+
values: (0, zod_1.optional)(task_item_1.taskItemValueMapSchema),
|
|
13
|
+
additional: (0, zod_1.optional)(zod_1.z.any())
|
|
14
|
+
}).optional();
|
|
@@ -6,10 +6,8 @@ const task_item_1 = require("../task-item");
|
|
|
6
6
|
/**
|
|
7
7
|
* Validates the request body for the tree and data endpoints
|
|
8
8
|
*/
|
|
9
|
-
exports.treeAndDataBodySchema = zod_1.z
|
|
10
|
-
.object({
|
|
9
|
+
exports.treeAndDataBodySchema = zod_1.z.object({
|
|
11
10
|
locale: zod_1.z.string().optional(),
|
|
12
11
|
parameters: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional(),
|
|
13
|
-
values: task_item_1.taskItemValueMapSchema.optional()
|
|
14
|
-
})
|
|
15
|
-
.optional();
|
|
12
|
+
values: task_item_1.taskItemValueMapSchema.optional()
|
|
13
|
+
}).optional();
|
|
@@ -6,10 +6,8 @@ const task_item_1 = require("../task-item");
|
|
|
6
6
|
/**
|
|
7
7
|
* Validates the request body for the tree and data endpoints
|
|
8
8
|
*/
|
|
9
|
-
exports.treeAndDataRequestBodySchema = zod_1.z
|
|
10
|
-
.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
})
|
|
15
|
-
.optional();
|
|
9
|
+
exports.treeAndDataRequestBodySchema = zod_1.z.object({
|
|
10
|
+
locale: (0, zod_1.optional)(zod_1.z.string()),
|
|
11
|
+
parameters: (0, zod_1.optional)(zod_1.z.record(zod_1.z.string(), zod_1.z.any())),
|
|
12
|
+
values: (0, zod_1.optional)(task_item_1.taskItemValueMapSchema)
|
|
13
|
+
}).optional();
|
|
@@ -6,7 +6,6 @@ const zod_1 = require("zod");
|
|
|
6
6
|
* Validates the version parameter for endpoints which use it
|
|
7
7
|
*/
|
|
8
8
|
exports.versionParamSchema = zod_1.z.object({
|
|
9
|
-
version: zod_1.z
|
|
10
|
-
.
|
|
11
|
-
.regex(/^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$/, "Service version must be a SemVer-formatted string which includes exclusively a major, minor and patch version"),
|
|
9
|
+
version: zod_1.z.string()
|
|
10
|
+
.regex(/^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$/, 'Service version must be a SemVer-formatted string which includes exclusively a major, minor and patch version')
|
|
12
11
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { z } from
|
|
3
|
-
import { Stream } from
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { Stream } from 'stream';
|
|
4
4
|
export declare const criteriaSetsAndVersionsSchema: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
|
|
5
5
|
id: z.ZodString;
|
|
6
6
|
version: z.ZodString;
|
|
@@ -8,5 +8,5 @@ exports.criteriaSetsAndVersionsSchema = zod_1.z.record(zod_1.z.string(), zod_1.z
|
|
|
8
8
|
exports.streamMatrixResponseSchema = zod_1.z.object({
|
|
9
9
|
filename: zod_1.z.string(),
|
|
10
10
|
contentType: zod_1.z.string(),
|
|
11
|
-
stream: zod_1.z.instanceof(stream_1.Stream)
|
|
11
|
+
stream: zod_1.z.instanceof(stream_1.Stream)
|
|
12
12
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from 'zod';
|
|
2
2
|
export declare const taskGroupOptionsSchema: z.ZodObject<{
|
|
3
3
|
hideCode: z.ZodOptional<z.ZodBoolean>;
|
|
4
4
|
hideFromHierarchy: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -353,7 +353,6 @@ export declare const taskGroupSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
353
353
|
}>]>;
|
|
354
354
|
description: z.ZodOptional<z.ZodString>;
|
|
355
355
|
providedData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, "many">]>>>;
|
|
356
|
-
valueReference: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, "many">]>>;
|
|
357
356
|
options: z.ZodOptional<z.ZodObject<{
|
|
358
357
|
hideCode: z.ZodOptional<z.ZodBoolean>;
|
|
359
358
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -421,7 +420,6 @@ export declare const taskGroupSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
421
420
|
text: string;
|
|
422
421
|
})[] | undefined;
|
|
423
422
|
sortOrder?: number | undefined;
|
|
424
|
-
valueReference?: string | number | boolean | (string | number | boolean | null)[] | null | undefined;
|
|
425
423
|
providedData?: Record<string, string | number | boolean | (string | number | boolean | null)[] | null> | undefined;
|
|
426
424
|
}, {
|
|
427
425
|
type: "task-item";
|
|
@@ -483,7 +481,6 @@ export declare const taskGroupSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
483
481
|
text: string;
|
|
484
482
|
})[] | undefined;
|
|
485
483
|
sortOrder?: number | undefined;
|
|
486
|
-
valueReference?: string | number | boolean | (string | number | boolean | null)[] | null | undefined;
|
|
487
484
|
providedData?: Record<string, string | number | boolean | (string | number | boolean | null)[] | null> | undefined;
|
|
488
485
|
}>>, "many">;
|
|
489
486
|
options: z.ZodOptional<z.ZodObject<{
|
|
@@ -557,7 +554,6 @@ export declare const taskGroupSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
557
554
|
text: string;
|
|
558
555
|
})[] | undefined;
|
|
559
556
|
sortOrder?: number | undefined;
|
|
560
|
-
valueReference?: string | number | boolean | (string | number | boolean | null)[] | null | undefined;
|
|
561
557
|
providedData?: Record<string, string | number | boolean | (string | number | boolean | null)[] | null> | undefined;
|
|
562
558
|
}[];
|
|
563
559
|
data?: (Record<string, any> & {
|
|
@@ -649,7 +645,6 @@ export declare const taskGroupSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
649
645
|
text: string;
|
|
650
646
|
})[] | undefined;
|
|
651
647
|
sortOrder?: number | undefined;
|
|
652
|
-
valueReference?: string | number | boolean | (string | number | boolean | null)[] | null | undefined;
|
|
653
648
|
providedData?: Record<string, string | number | boolean | (string | number | boolean | null)[] | null> | undefined;
|
|
654
649
|
}[];
|
|
655
650
|
data?: (Record<string, any> & {
|
|
@@ -756,7 +751,6 @@ export declare const taskGroupSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
756
751
|
text: string;
|
|
757
752
|
})[] | undefined;
|
|
758
753
|
sortOrder?: number | undefined;
|
|
759
|
-
valueReference?: string | number | boolean | (string | number | boolean | null)[] | null | undefined;
|
|
760
754
|
providedData?: Record<string, string | number | boolean | (string | number | boolean | null)[] | null> | undefined;
|
|
761
755
|
}[];
|
|
762
756
|
data?: (Record<string, any> & {
|
|
@@ -879,7 +873,6 @@ export declare const taskGroupSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
879
873
|
text: string;
|
|
880
874
|
})[] | undefined;
|
|
881
875
|
sortOrder?: number | undefined;
|
|
882
|
-
valueReference?: string | number | boolean | (string | number | boolean | null)[] | null | undefined;
|
|
883
876
|
providedData?: Record<string, string | number | boolean | (string | number | boolean | null)[] | null> | undefined;
|
|
884
877
|
}[];
|
|
885
878
|
data?: (Record<string, any> & {
|
|
@@ -5,12 +5,12 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const task_1 = require("./task");
|
|
6
6
|
const common_1 = require("./common");
|
|
7
7
|
exports.taskGroupOptionsSchema = zod_1.z.object({
|
|
8
|
-
hideCode: zod_1.z.boolean()
|
|
9
|
-
hideFromHierarchy: zod_1.z.boolean()
|
|
8
|
+
hideCode: (0, zod_1.optional)(zod_1.z.boolean()),
|
|
9
|
+
hideFromHierarchy: (0, zod_1.optional)(zod_1.z.boolean()),
|
|
10
10
|
});
|
|
11
11
|
exports.taskGroupSchema = common_1.abstractElementSchema.extend({
|
|
12
|
-
type: zod_1.z.literal(
|
|
13
|
-
category: zod_1.z.string()
|
|
12
|
+
type: zod_1.z.literal('task-group'),
|
|
13
|
+
category: (0, zod_1.optional)(zod_1.z.string()),
|
|
14
14
|
items: zod_1.z.array(zod_1.z.lazy(() => task_1.taskSchema)),
|
|
15
|
-
options: exports.taskGroupOptionsSchema
|
|
15
|
+
options: (0, zod_1.optional)(exports.taskGroupOptionsSchema),
|
|
16
16
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from 'zod';
|
|
2
2
|
export declare const taskItemScalarValueSchema: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
|
|
3
3
|
export declare const taskItemValueSchema: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, "many">]>;
|
|
4
4
|
export declare const taskItemValueMapSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, "many">]>>;
|
|
@@ -504,7 +504,6 @@ export declare const taskItemSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
504
504
|
}>]>;
|
|
505
505
|
description: z.ZodOptional<z.ZodString>;
|
|
506
506
|
providedData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, "many">]>>>;
|
|
507
|
-
valueReference: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, "many">]>>;
|
|
508
507
|
options: z.ZodOptional<z.ZodObject<{
|
|
509
508
|
hideCode: z.ZodOptional<z.ZodBoolean>;
|
|
510
509
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -572,7 +571,6 @@ export declare const taskItemSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
572
571
|
text: string;
|
|
573
572
|
})[] | undefined;
|
|
574
573
|
sortOrder?: number | undefined;
|
|
575
|
-
valueReference?: string | number | boolean | (string | number | boolean | null)[] | null | undefined;
|
|
576
574
|
providedData?: Record<string, string | number | boolean | (string | number | boolean | null)[] | null> | undefined;
|
|
577
575
|
}, {
|
|
578
576
|
type: "task-item";
|
|
@@ -634,6 +632,5 @@ export declare const taskItemSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
634
632
|
text: string;
|
|
635
633
|
})[] | undefined;
|
|
636
634
|
sortOrder?: number | undefined;
|
|
637
|
-
valueReference?: string | number | boolean | (string | number | boolean | null)[] | null | undefined;
|
|
638
635
|
providedData?: Record<string, string | number | boolean | (string | number | boolean | null)[] | null> | undefined;
|
|
639
636
|
}>;
|
|
@@ -7,68 +7,60 @@ exports.taskItemScalarValueSchema = zod_1.z.union([
|
|
|
7
7
|
zod_1.z.string(),
|
|
8
8
|
zod_1.z.number(),
|
|
9
9
|
zod_1.z.boolean(),
|
|
10
|
-
zod_1.z.null()
|
|
11
|
-
]);
|
|
12
|
-
exports.taskItemValueSchema = zod_1.z.union([
|
|
13
|
-
exports.taskItemScalarValueSchema,
|
|
14
|
-
zod_1.z.array(exports.taskItemScalarValueSchema),
|
|
10
|
+
zod_1.z.null()
|
|
15
11
|
]);
|
|
12
|
+
exports.taskItemValueSchema = zod_1.z.union([exports.taskItemScalarValueSchema, zod_1.z.array(exports.taskItemScalarValueSchema)]);
|
|
16
13
|
exports.taskItemValueMapSchema = zod_1.z.record(zod_1.z.string(), exports.taskItemValueSchema);
|
|
17
14
|
exports.pointOptionSchema = zod_1.z.object({
|
|
18
|
-
id: zod_1.z.string()
|
|
15
|
+
id: (0, zod_1.optional)(zod_1.z.string()),
|
|
19
16
|
text: zod_1.z.string(),
|
|
20
|
-
intro: zod_1.z.string()
|
|
21
|
-
outro: zod_1.z.string()
|
|
17
|
+
intro: (0, zod_1.optional)(zod_1.z.string()),
|
|
18
|
+
outro: (0, zod_1.optional)(zod_1.z.string()),
|
|
22
19
|
value: zod_1.z.union([zod_1.z.string(), zod_1.z.number(), zod_1.z.boolean(), zod_1.z.null()]),
|
|
23
20
|
});
|
|
24
21
|
const abstractDefinitionSchema = zod_1.z.object({
|
|
25
|
-
type: zod_1.z.enum([
|
|
22
|
+
type: zod_1.z.enum(['select-single', 'select-multiple', 'number', 'boolean']),
|
|
26
23
|
});
|
|
27
24
|
exports.selectSingleTypeSchema = abstractDefinitionSchema.extend({
|
|
28
|
-
type: zod_1.z.literal(
|
|
25
|
+
type: zod_1.z.literal('select-single'),
|
|
29
26
|
options: zod_1.z.array(exports.pointOptionSchema),
|
|
30
27
|
});
|
|
31
28
|
exports.selectMultipleTypeSchema = abstractDefinitionSchema.extend({
|
|
32
|
-
type: zod_1.z.literal(
|
|
29
|
+
type: zod_1.z.literal('select-multiple'),
|
|
33
30
|
options: zod_1.z.array(exports.pointOptionSchema),
|
|
34
31
|
});
|
|
35
32
|
exports.numberTypeSchema = abstractDefinitionSchema.extend({
|
|
36
|
-
type: zod_1.z.literal(
|
|
37
|
-
minimum: zod_1.z.number()
|
|
38
|
-
maximum: zod_1.z.number()
|
|
39
|
-
step: zod_1.z.number()
|
|
33
|
+
type: zod_1.z.literal('number'),
|
|
34
|
+
minimum: (0, zod_1.optional)(zod_1.z.number()),
|
|
35
|
+
maximum: (0, zod_1.optional)(zod_1.z.number()),
|
|
36
|
+
step: (0, zod_1.optional)(zod_1.z.number()),
|
|
40
37
|
});
|
|
41
38
|
exports.booleanTypeSchema = abstractDefinitionSchema.extend({
|
|
42
|
-
type: zod_1.z.literal(
|
|
43
|
-
labels: zod_1.z
|
|
44
|
-
.object({
|
|
39
|
+
type: zod_1.z.literal('boolean'),
|
|
40
|
+
labels: (0, zod_1.optional)(zod_1.z.object({
|
|
45
41
|
true: zod_1.z.string(),
|
|
46
42
|
false: zod_1.z.string(),
|
|
47
|
-
})
|
|
48
|
-
.optional(),
|
|
43
|
+
})),
|
|
49
44
|
});
|
|
50
|
-
exports.taskItemDefinitionSchema = zod_1.z.discriminatedUnion(
|
|
45
|
+
exports.taskItemDefinitionSchema = zod_1.z.discriminatedUnion('type', [
|
|
51
46
|
exports.selectSingleTypeSchema,
|
|
52
47
|
exports.selectMultipleTypeSchema,
|
|
53
48
|
exports.numberTypeSchema,
|
|
54
|
-
exports.booleanTypeSchema
|
|
49
|
+
exports.booleanTypeSchema
|
|
55
50
|
]);
|
|
56
|
-
exports.taskItemDataSchema = zod_1.z.intersection(zod_1.z.record(zod_1.z.string(), zod_1.z.any()), zod_1.z
|
|
57
|
-
.object({
|
|
51
|
+
exports.taskItemDataSchema = zod_1.z.intersection(zod_1.z.record(zod_1.z.string(), zod_1.z.any()), zod_1.z.object({
|
|
58
52
|
value: exports.taskItemValueSchema,
|
|
59
|
-
text: zod_1.z.string()
|
|
60
|
-
valueReference: exports.taskItemValueSchema
|
|
61
|
-
})
|
|
62
|
-
.partial());
|
|
53
|
+
text: (0, zod_1.optional)(zod_1.z.string()),
|
|
54
|
+
valueReference: (0, zod_1.optional)(exports.taskItemValueSchema),
|
|
55
|
+
}).partial());
|
|
63
56
|
exports.taskItemOptionsSchema = zod_1.z.object({
|
|
64
|
-
hideCode: zod_1.z.boolean()
|
|
57
|
+
hideCode: (0, zod_1.optional)(zod_1.z.boolean()),
|
|
65
58
|
});
|
|
66
59
|
exports.taskItemSchema = common_1.abstractElementSchema.extend({
|
|
67
|
-
type: zod_1.z.literal(
|
|
68
|
-
data: exports.taskItemDataSchema
|
|
60
|
+
type: zod_1.z.literal('task-item'),
|
|
61
|
+
data: (0, zod_1.optional)(exports.taskItemDataSchema),
|
|
69
62
|
definition: exports.taskItemDefinitionSchema,
|
|
70
|
-
description: zod_1.z.string()
|
|
71
|
-
providedData: exports.taskItemValueMapSchema
|
|
72
|
-
|
|
73
|
-
options: exports.taskItemOptionsSchema.optional(),
|
|
63
|
+
description: (0, zod_1.optional)(zod_1.z.string()),
|
|
64
|
+
providedData: (0, zod_1.optional)(exports.taskItemValueMapSchema),
|
|
65
|
+
options: (0, zod_1.optional)(exports.taskItemOptionsSchema),
|
|
74
66
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from 'zod';
|
|
2
2
|
export declare const taskOptionsSchema: z.ZodObject<{
|
|
3
3
|
hideCode: z.ZodOptional<z.ZodBoolean>;
|
|
4
4
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -282,7 +282,6 @@ export declare const taskSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
282
282
|
}>]>;
|
|
283
283
|
description: z.ZodOptional<z.ZodString>;
|
|
284
284
|
providedData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, "many">]>>>;
|
|
285
|
-
valueReference: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, "many">]>>;
|
|
286
285
|
options: z.ZodOptional<z.ZodObject<{
|
|
287
286
|
hideCode: z.ZodOptional<z.ZodBoolean>;
|
|
288
287
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -350,7 +349,6 @@ export declare const taskSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
350
349
|
text: string;
|
|
351
350
|
})[] | undefined;
|
|
352
351
|
sortOrder?: number | undefined;
|
|
353
|
-
valueReference?: string | number | boolean | (string | number | boolean | null)[] | null | undefined;
|
|
354
352
|
providedData?: Record<string, string | number | boolean | (string | number | boolean | null)[] | null> | undefined;
|
|
355
353
|
}, {
|
|
356
354
|
type: "task-item";
|
|
@@ -412,7 +410,6 @@ export declare const taskSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
412
410
|
text: string;
|
|
413
411
|
})[] | undefined;
|
|
414
412
|
sortOrder?: number | undefined;
|
|
415
|
-
valueReference?: string | number | boolean | (string | number | boolean | null)[] | null | undefined;
|
|
416
413
|
providedData?: Record<string, string | number | boolean | (string | number | boolean | null)[] | null> | undefined;
|
|
417
414
|
}>>, "many">;
|
|
418
415
|
options: z.ZodOptional<z.ZodObject<{
|
|
@@ -486,7 +483,6 @@ export declare const taskSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
486
483
|
text: string;
|
|
487
484
|
})[] | undefined;
|
|
488
485
|
sortOrder?: number | undefined;
|
|
489
|
-
valueReference?: string | number | boolean | (string | number | boolean | null)[] | null | undefined;
|
|
490
486
|
providedData?: Record<string, string | number | boolean | (string | number | boolean | null)[] | null> | undefined;
|
|
491
487
|
}[];
|
|
492
488
|
data?: (Record<string, any> & {
|
|
@@ -578,7 +574,6 @@ export declare const taskSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
578
574
|
text: string;
|
|
579
575
|
})[] | undefined;
|
|
580
576
|
sortOrder?: number | undefined;
|
|
581
|
-
valueReference?: string | number | boolean | (string | number | boolean | null)[] | null | undefined;
|
|
582
577
|
providedData?: Record<string, string | number | boolean | (string | number | boolean | null)[] | null> | undefined;
|
|
583
578
|
}[];
|
|
584
579
|
data?: (Record<string, any> & {
|
package/dist/v1/schemas/task.js
CHANGED
|
@@ -5,11 +5,11 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const task_item_1 = require("./task-item");
|
|
6
6
|
const common_1 = require("./common");
|
|
7
7
|
exports.taskOptionsSchema = zod_1.z.object({
|
|
8
|
-
hideCode: zod_1.z.boolean()
|
|
8
|
+
hideCode: (0, zod_1.optional)(zod_1.z.boolean()),
|
|
9
9
|
});
|
|
10
10
|
exports.taskSchema = common_1.abstractElementSchema.extend({
|
|
11
|
-
type: zod_1.z.literal(
|
|
12
|
-
description: zod_1.z.string()
|
|
11
|
+
type: zod_1.z.literal('task'),
|
|
12
|
+
description: (0, zod_1.optional)(zod_1.z.string()),
|
|
13
13
|
items: zod_1.z.array(zod_1.z.lazy(() => task_item_1.taskItemSchema)),
|
|
14
|
-
options: exports.taskOptionsSchema
|
|
14
|
+
options: (0, zod_1.optional)(exports.taskOptionsSchema),
|
|
15
15
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from 'zod';
|
|
2
2
|
export declare const themeStyleSchema: z.ZodObject<{
|
|
3
3
|
primaryColor: z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
4
4
|
red: z.ZodNumber;
|
|
@@ -584,7 +584,6 @@ export declare const themeSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
584
584
|
}>]>;
|
|
585
585
|
description: z.ZodOptional<z.ZodString>;
|
|
586
586
|
providedData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, "many">]>>>;
|
|
587
|
-
valueReference: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, "many">]>>;
|
|
588
587
|
options: z.ZodOptional<z.ZodObject<{
|
|
589
588
|
hideCode: z.ZodOptional<z.ZodBoolean>;
|
|
590
589
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -652,7 +651,6 @@ export declare const themeSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
652
651
|
text: string;
|
|
653
652
|
})[] | undefined;
|
|
654
653
|
sortOrder?: number | undefined;
|
|
655
|
-
valueReference?: string | number | boolean | (string | number | boolean | null)[] | null | undefined;
|
|
656
654
|
providedData?: Record<string, string | number | boolean | (string | number | boolean | null)[] | null> | undefined;
|
|
657
655
|
}, {
|
|
658
656
|
type: "task-item";
|
|
@@ -714,7 +712,6 @@ export declare const themeSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
714
712
|
text: string;
|
|
715
713
|
})[] | undefined;
|
|
716
714
|
sortOrder?: number | undefined;
|
|
717
|
-
valueReference?: string | number | boolean | (string | number | boolean | null)[] | null | undefined;
|
|
718
715
|
providedData?: Record<string, string | number | boolean | (string | number | boolean | null)[] | null> | undefined;
|
|
719
716
|
}>>, "many">;
|
|
720
717
|
options: z.ZodOptional<z.ZodObject<{
|
|
@@ -788,7 +785,6 @@ export declare const themeSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
788
785
|
text: string;
|
|
789
786
|
})[] | undefined;
|
|
790
787
|
sortOrder?: number | undefined;
|
|
791
|
-
valueReference?: string | number | boolean | (string | number | boolean | null)[] | null | undefined;
|
|
792
788
|
providedData?: Record<string, string | number | boolean | (string | number | boolean | null)[] | null> | undefined;
|
|
793
789
|
}[];
|
|
794
790
|
data?: (Record<string, any> & {
|
|
@@ -880,7 +876,6 @@ export declare const themeSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
880
876
|
text: string;
|
|
881
877
|
})[] | undefined;
|
|
882
878
|
sortOrder?: number | undefined;
|
|
883
|
-
valueReference?: string | number | boolean | (string | number | boolean | null)[] | null | undefined;
|
|
884
879
|
providedData?: Record<string, string | number | boolean | (string | number | boolean | null)[] | null> | undefined;
|
|
885
880
|
}[];
|
|
886
881
|
data?: (Record<string, any> & {
|
|
@@ -987,7 +982,6 @@ export declare const themeSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
987
982
|
text: string;
|
|
988
983
|
})[] | undefined;
|
|
989
984
|
sortOrder?: number | undefined;
|
|
990
|
-
valueReference?: string | number | boolean | (string | number | boolean | null)[] | null | undefined;
|
|
991
985
|
providedData?: Record<string, string | number | boolean | (string | number | boolean | null)[] | null> | undefined;
|
|
992
986
|
}[];
|
|
993
987
|
data?: (Record<string, any> & {
|
|
@@ -1110,7 +1104,6 @@ export declare const themeSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
1110
1104
|
text: string;
|
|
1111
1105
|
})[] | undefined;
|
|
1112
1106
|
sortOrder?: number | undefined;
|
|
1113
|
-
valueReference?: string | number | boolean | (string | number | boolean | null)[] | null | undefined;
|
|
1114
1107
|
providedData?: Record<string, string | number | boolean | (string | number | boolean | null)[] | null> | undefined;
|
|
1115
1108
|
}[];
|
|
1116
1109
|
data?: (Record<string, any> & {
|
|
@@ -1248,7 +1241,6 @@ export declare const themeSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
1248
1241
|
text: string;
|
|
1249
1242
|
})[] | undefined;
|
|
1250
1243
|
sortOrder?: number | undefined;
|
|
1251
|
-
valueReference?: string | number | boolean | (string | number | boolean | null)[] | null | undefined;
|
|
1252
1244
|
providedData?: Record<string, string | number | boolean | (string | number | boolean | null)[] | null> | undefined;
|
|
1253
1245
|
}[];
|
|
1254
1246
|
data?: (Record<string, any> & {
|
|
@@ -1401,7 +1393,6 @@ export declare const themeSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
1401
1393
|
text: string;
|
|
1402
1394
|
})[] | undefined;
|
|
1403
1395
|
sortOrder?: number | undefined;
|
|
1404
|
-
valueReference?: string | number | boolean | (string | number | boolean | null)[] | null | undefined;
|
|
1405
1396
|
providedData?: Record<string, string | number | boolean | (string | number | boolean | null)[] | null> | undefined;
|
|
1406
1397
|
}[];
|
|
1407
1398
|
data?: (Record<string, any> & {
|
|
@@ -1566,7 +1557,6 @@ export declare const themeSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
1566
1557
|
text: string;
|
|
1567
1558
|
})[] | undefined;
|
|
1568
1559
|
sortOrder?: number | undefined;
|
|
1569
|
-
valueReference?: string | number | boolean | (string | number | boolean | null)[] | null | undefined;
|
|
1570
1560
|
providedData?: Record<string, string | number | boolean | (string | number | boolean | null)[] | null> | undefined;
|
|
1571
1561
|
}[];
|
|
1572
1562
|
data?: (Record<string, any> & {
|
|
@@ -1760,7 +1750,6 @@ export declare const themeSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
1760
1750
|
text: string;
|
|
1761
1751
|
})[] | undefined;
|
|
1762
1752
|
sortOrder?: number | undefined;
|
|
1763
|
-
valueReference?: string | number | boolean | (string | number | boolean | null)[] | null | undefined;
|
|
1764
1753
|
providedData?: Record<string, string | number | boolean | (string | number | boolean | null)[] | null> | undefined;
|
|
1765
1754
|
}[];
|
|
1766
1755
|
data?: (Record<string, any> & {
|
package/dist/v1/schemas/theme.js
CHANGED
|
@@ -9,11 +9,11 @@ exports.themeStyleSchema = zod_1.z.object({
|
|
|
9
9
|
secondaryColor: common_1.colorSchema,
|
|
10
10
|
});
|
|
11
11
|
exports.themeOptionsSchema = zod_1.z.object({
|
|
12
|
-
hideCode: zod_1.z.boolean()
|
|
12
|
+
hideCode: (0, zod_1.optional)(zod_1.z.boolean()),
|
|
13
13
|
});
|
|
14
14
|
exports.themeSchema = common_1.abstractElementSchema.extend({
|
|
15
|
-
type: zod_1.z.literal(
|
|
16
|
-
style: exports.themeStyleSchema
|
|
15
|
+
type: zod_1.z.literal('theme'),
|
|
16
|
+
style: (0, zod_1.optional)(exports.themeStyleSchema),
|
|
17
17
|
items: zod_1.z.array(criterion_1.criterionSchema),
|
|
18
|
-
options: exports.themeOptionsSchema
|
|
18
|
+
options: (0, zod_1.optional)(exports.themeOptionsSchema),
|
|
19
19
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CriteriaTree, Metadata, DataMap, StreamMatrixResponse, TaskItemValueMap } from
|
|
1
|
+
import { CriteriaTree, Metadata, DataMap, StreamMatrixResponse, TaskItemValueMap } from '../types';
|
|
2
2
|
export type TreeAndMapParameters<ParametersType extends Record<string, any> = Record<string, any>> = {
|
|
3
3
|
parameters?: ParametersType;
|
|
4
4
|
values?: TaskItemValueMap | null;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from './i-criteria-set.service';
|
|
2
|
+
export * from './manager.service';
|
|
@@ -7,10 +7,7 @@ class ManagerService {
|
|
|
7
7
|
// Get the criteria sets and versions available to this service
|
|
8
8
|
getCriteriaSetsAndVersions() {
|
|
9
9
|
return Object.fromEntries(Object.entries(this.criteriaSetServices).map(([criteriaSetId, services]) => {
|
|
10
|
-
return [
|
|
11
|
-
criteriaSetId,
|
|
12
|
-
services.map((service) => service.getMetadata()),
|
|
13
|
-
];
|
|
10
|
+
return [criteriaSetId, services.map((service) => service.getMetadata())];
|
|
14
11
|
}));
|
|
15
12
|
}
|
|
16
13
|
// Get the criteria set with the given ID. If no version is requested, return the latest version
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { z } from
|
|
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 } from
|
|
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 } 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>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CriteriaTree, DataMap, Metadata } from
|
|
2
|
-
import { matrixRequestBodySchema, streamMatrixResponseSchema, treeAndDataRequestBodySchema } from
|
|
3
|
-
import { z } from
|
|
1
|
+
import { CriteriaTree, DataMap, Metadata } from './criteria';
|
|
2
|
+
import { matrixRequestBodySchema, streamMatrixResponseSchema, treeAndDataRequestBodySchema } from '../schemas';
|
|
3
|
+
import { z } from 'zod';
|
|
4
4
|
export type MetadataResponse = Metadata;
|
|
5
5
|
export type CriteriaTreeResponse = CriteriaTree;
|
|
6
6
|
export type DataMapResponse = DataMap;
|