@openframe-org/criteria-set-protocol 2.0.9-alpha.0 → 2.0.11
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/services/i-versioned.service.d.ts +16 -0
- package/dist/services/i-versioned.service.js +2 -0
- package/dist/services/index.d.ts +2 -0
- package/dist/services/index.js +18 -0
- package/dist/services/versions.service.d.ts +38 -0
- package/dist/services/versions.service.js +49 -0
- package/dist/types.d.ts +2 -0
- package/dist/types.js +2 -0
- package/dist/v1/schemas/certification.d.ts +40 -40
- package/dist/v1/schemas/certification.js +6 -7
- package/dist/v1/schemas/common.d.ts +60 -29
- package/dist/v1/schemas/common.js +14 -15
- package/dist/v1/schemas/criteria-set-id-param-schema.d.ts +11 -0
- package/dist/v1/schemas/criteria-set-id-param-schema.js +11 -0
- package/dist/v1/schemas/criteria-tree.d.ts +1481 -614
- package/dist/v1/schemas/criteria-tree.js +1 -2
- package/dist/v1/schemas/criterion.d.ts +266 -116
- package/dist/v1/schemas/criterion.js +3 -4
- package/dist/v1/schemas/data-map.d.ts +1 -1
- package/dist/v1/schemas/data-map.js +1 -2
- package/dist/v1/schemas/download-matrix-body-schema.d.ts +15 -0
- package/dist/v1/schemas/download-matrix-body-schema.js +36 -0
- package/dist/v1/schemas/index.d.ts +0 -1
- package/dist/v1/schemas/index.js +0 -14
- package/dist/v1/schemas/matrix-body-schema.d.ts +20 -0
- package/dist/v1/schemas/matrix-body-schema.js +14 -0
- package/dist/v1/schemas/metadata.d.ts +12 -9
- package/dist/v1/schemas/metadata.js +6 -7
- package/dist/v1/schemas/quality.d.ts +498 -181
- package/dist/v1/schemas/quality.js +2 -2
- package/dist/v1/schemas/request/matrix-body-schema.d.ts +7 -2
- package/dist/v1/schemas/request/matrix-body-schema.js +7 -7
- package/dist/v1/schemas/request/matrix-request-body-schema.d.ts +7 -2
- package/dist/v1/schemas/request/matrix-request-body-schema.js +7 -7
- package/dist/v1/schemas/request/tree-and-data-body-schema.d.ts +6 -2
- package/dist/v1/schemas/request/tree-and-data-body-schema.js +6 -6
- package/dist/v1/schemas/request/tree-and-data-request-body-schema.d.ts +6 -2
- package/dist/v1/schemas/request/tree-and-data-request-body-schema.js +6 -6
- package/dist/v1/schemas/response.d.ts +10 -7
- package/dist/v1/schemas/task-group.d.ts +205 -89
- package/dist/v1/schemas/task-group.js +4 -5
- package/dist/v1/schemas/task-item.d.ts +129 -74
- package/dist/v1/schemas/task-item.js +19 -17
- package/dist/v1/schemas/task.d.ts +144 -62
- package/dist/v1/schemas/task.js +3 -4
- package/dist/v1/schemas/theme.d.ts +356 -146
- package/dist/v1/schemas/theme.js +3 -4
- package/dist/v1/schemas/tree-and-data-body-schema.d.ts +17 -0
- package/dist/v1/schemas/tree-and-data-body-schema.js +13 -0
- package/dist/v1/schemas/tree-and-matrix-body-schema.d.ts +19 -0
- package/dist/v1/schemas/tree-and-matrix-body-schema.js +38 -0
- package/dist/v1/schemas/tree-body-schema.d.ts +17 -0
- package/dist/v1/schemas/tree-body-schema.js +37 -0
- package/dist/v1/schemas/utils.d.ts +4 -1
- package/dist/v1/schemas/utils.js +7 -1
- package/dist/v1/schemas/version-param-schema.d.ts +11 -0
- package/dist/v1/schemas/version-param-schema.js +11 -0
- package/dist/v1/services/i-protocol-v1.service.d.ts +26 -0
- package/dist/v1/services/i-protocol-v1.service.js +2 -0
- package/dist/v1/types/express.d.ts +1 -0
- package/dist/v1/utils/color.d.ts +2 -0
- package/dist/v1/utils/color.js +10 -0
- package/dist/v1/utils/index.d.ts +7 -0
- package/dist/v1/utils/index.js +15 -0
- package/dist/v1/utils.d.ts +745 -6
- package/package.json +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ProtocolVersionServiceMap } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Interface for versioned services
|
|
4
|
+
*
|
|
5
|
+
* Services that implement this interface can be managed by the VersionsService
|
|
6
|
+
*/
|
|
7
|
+
export interface IVersionedService {
|
|
8
|
+
/**
|
|
9
|
+
* The SemVer version of the service
|
|
10
|
+
*/
|
|
11
|
+
version: string;
|
|
12
|
+
/**
|
|
13
|
+
* Whether the service supports the given protocol version
|
|
14
|
+
*/
|
|
15
|
+
supportsProtocol: <ProtocolVersion extends number>(protocolVersion: ProtocolVersion) => this is ProtocolVersionServiceMap<ProtocolVersion>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./i-versioned.service"), exports);
|
|
18
|
+
__exportStar(require("./versions.service"), exports);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { IVersionedService } from './i-versioned.service';
|
|
2
|
+
import { ProtocolVersionServiceMap } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Service for managing versions of services
|
|
5
|
+
*
|
|
6
|
+
* The VersionsService class is a utility class for services which implement different versions of the protocol, and different versions of their
|
|
7
|
+
* own service. For example, say you have a v1service, v11service, v2service and v21service with versions 1.0, 1.1, 2.0 and 2.1 respectively.
|
|
8
|
+
* The VersionsService class can be used to manage these services:
|
|
9
|
+
*
|
|
10
|
+
* const versionsService = new VersionsService([v1service, v11service, v2service, v21service]);
|
|
11
|
+
* versionsService.getLatestVersion(); // v21service
|
|
12
|
+
* versionsService.getServiceVersions(1); // [v1service, v11service]
|
|
13
|
+
* versionsService.getServiceVersions(2); // [v2service, v21service]
|
|
14
|
+
* versionsService.get('1.1'); // v11service
|
|
15
|
+
*/
|
|
16
|
+
export declare class VersionsService {
|
|
17
|
+
protected versions: IVersionedService[];
|
|
18
|
+
/**
|
|
19
|
+
* @param versions An array of services implementing IVersionedService
|
|
20
|
+
*/
|
|
21
|
+
constructor(versions: IVersionedService[]);
|
|
22
|
+
/**
|
|
23
|
+
* Get all services
|
|
24
|
+
*/
|
|
25
|
+
getAll(): IVersionedService[];
|
|
26
|
+
/**
|
|
27
|
+
* Retrieve the services which are compatible with the requested protocol version
|
|
28
|
+
*/
|
|
29
|
+
getServiceVersions<ProtocolVersion extends number, ProtocolImplementingService = ProtocolVersionServiceMap<ProtocolVersion>>(protocolVersion: ProtocolVersion): ProtocolImplementingService[];
|
|
30
|
+
/**
|
|
31
|
+
* Retrieve a service by version
|
|
32
|
+
*/
|
|
33
|
+
get(version: string): IVersionedService | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Retrieve the latest service
|
|
36
|
+
*/
|
|
37
|
+
getLatestVersion(): IVersionedService;
|
|
38
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VersionsService = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Service for managing versions of services
|
|
6
|
+
*
|
|
7
|
+
* The VersionsService class is a utility class for services which implement different versions of the protocol, and different versions of their
|
|
8
|
+
* own service. For example, say you have a v1service, v11service, v2service and v21service with versions 1.0, 1.1, 2.0 and 2.1 respectively.
|
|
9
|
+
* The VersionsService class can be used to manage these services:
|
|
10
|
+
*
|
|
11
|
+
* const versionsService = new VersionsService([v1service, v11service, v2service, v21service]);
|
|
12
|
+
* versionsService.getLatestVersion(); // v21service
|
|
13
|
+
* versionsService.getServiceVersions(1); // [v1service, v11service]
|
|
14
|
+
* versionsService.getServiceVersions(2); // [v2service, v21service]
|
|
15
|
+
* versionsService.get('1.1'); // v11service
|
|
16
|
+
*/
|
|
17
|
+
class VersionsService {
|
|
18
|
+
/**
|
|
19
|
+
* @param versions An array of services implementing IVersionedService
|
|
20
|
+
*/
|
|
21
|
+
constructor(versions) {
|
|
22
|
+
this.versions = versions;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get all services
|
|
26
|
+
*/
|
|
27
|
+
getAll() {
|
|
28
|
+
return this.versions;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Retrieve the services which are compatible with the requested protocol version
|
|
32
|
+
*/
|
|
33
|
+
getServiceVersions(protocolVersion) {
|
|
34
|
+
return this.versions.filter((service) => service.supportsProtocol(protocolVersion));
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Retrieve a service by version
|
|
38
|
+
*/
|
|
39
|
+
get(version) {
|
|
40
|
+
return this.versions.find((service) => service.version === version);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Retrieve the latest service
|
|
44
|
+
*/
|
|
45
|
+
getLatestVersion() {
|
|
46
|
+
return this.versions[this.versions.length - 1];
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.VersionsService = VersionsService;
|
package/dist/types.d.ts
ADDED
package/dist/types.js
ADDED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const certificationDefinitionTypeSchema: z.ZodEnum<["number", "percentage"]>;
|
|
3
3
|
export declare const numberBasedCertificationDefinitionRulesSchema: z.ZodObject<{
|
|
4
|
-
minimum: z.ZodOptional<z.
|
|
5
|
-
exclusiveMinimum: z.ZodOptional<z.
|
|
6
|
-
maximum: z.ZodOptional<z.
|
|
7
|
-
exclusiveMaximum: z.ZodOptional<z.
|
|
4
|
+
minimum: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
exclusiveMinimum: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
maximum: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
exclusiveMaximum: z.ZodOptional<z.ZodNumber>;
|
|
8
8
|
}, "strip", z.ZodTypeAny, {
|
|
9
9
|
minimum?: number | undefined;
|
|
10
10
|
maximum?: number | undefined;
|
|
@@ -17,10 +17,10 @@ export declare const numberBasedCertificationDefinitionRulesSchema: z.ZodObject<
|
|
|
17
17
|
exclusiveMinimum?: number | undefined;
|
|
18
18
|
}>;
|
|
19
19
|
export declare const percentageBasedCertificationDefinitionRulesSchema: z.ZodObject<{
|
|
20
|
-
minimum: z.ZodOptional<z.
|
|
21
|
-
exclusiveMinimum: z.ZodOptional<z.
|
|
22
|
-
maximum: z.ZodOptional<z.
|
|
23
|
-
exclusiveMaximum: z.ZodOptional<z.
|
|
20
|
+
minimum: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
exclusiveMinimum: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
maximum: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
exclusiveMaximum: z.ZodOptional<z.ZodNumber>;
|
|
24
24
|
}, "strip", z.ZodTypeAny, {
|
|
25
25
|
minimum?: number | undefined;
|
|
26
26
|
maximum?: number | undefined;
|
|
@@ -35,17 +35,17 @@ export declare const percentageBasedCertificationDefinitionRulesSchema: z.ZodObj
|
|
|
35
35
|
export declare const numberBasedCertificationDefinitionSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
36
36
|
type: z.ZodEnum<["number", "percentage"]>;
|
|
37
37
|
code: z.ZodString;
|
|
38
|
-
icon: z.ZodOptional<z.
|
|
38
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
39
39
|
name: z.ZodString;
|
|
40
|
-
description: z.ZodOptional<z.
|
|
40
|
+
description: z.ZodOptional<z.ZodString>;
|
|
41
41
|
rulesText: z.ZodString;
|
|
42
42
|
}, {
|
|
43
43
|
type: z.ZodLiteral<"number">;
|
|
44
44
|
rules: z.ZodObject<{
|
|
45
|
-
minimum: z.ZodOptional<z.
|
|
46
|
-
exclusiveMinimum: z.ZodOptional<z.
|
|
47
|
-
maximum: z.ZodOptional<z.
|
|
48
|
-
exclusiveMaximum: z.ZodOptional<z.
|
|
45
|
+
minimum: z.ZodOptional<z.ZodNumber>;
|
|
46
|
+
exclusiveMinimum: z.ZodOptional<z.ZodNumber>;
|
|
47
|
+
maximum: z.ZodOptional<z.ZodNumber>;
|
|
48
|
+
exclusiveMaximum: z.ZodOptional<z.ZodNumber>;
|
|
49
49
|
}, "strip", z.ZodTypeAny, {
|
|
50
50
|
minimum?: number | undefined;
|
|
51
51
|
maximum?: number | undefined;
|
|
@@ -58,9 +58,9 @@ export declare const numberBasedCertificationDefinitionSchema: z.ZodObject<z.obj
|
|
|
58
58
|
exclusiveMinimum?: number | undefined;
|
|
59
59
|
}>;
|
|
60
60
|
}>, "strip", z.ZodTypeAny, {
|
|
61
|
+
type: "number";
|
|
61
62
|
code: string;
|
|
62
63
|
name: string;
|
|
63
|
-
type: "number";
|
|
64
64
|
rulesText: string;
|
|
65
65
|
rules: {
|
|
66
66
|
minimum?: number | undefined;
|
|
@@ -71,9 +71,9 @@ export declare const numberBasedCertificationDefinitionSchema: z.ZodObject<z.obj
|
|
|
71
71
|
description?: string | undefined;
|
|
72
72
|
icon?: string | undefined;
|
|
73
73
|
}, {
|
|
74
|
+
type: "number";
|
|
74
75
|
code: string;
|
|
75
76
|
name: string;
|
|
76
|
-
type: "number";
|
|
77
77
|
rulesText: string;
|
|
78
78
|
rules: {
|
|
79
79
|
minimum?: number | undefined;
|
|
@@ -87,17 +87,17 @@ export declare const numberBasedCertificationDefinitionSchema: z.ZodObject<z.obj
|
|
|
87
87
|
export declare const percentageBasedCertificationDefinitionSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
88
88
|
type: z.ZodEnum<["number", "percentage"]>;
|
|
89
89
|
code: z.ZodString;
|
|
90
|
-
icon: z.ZodOptional<z.
|
|
90
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
91
91
|
name: z.ZodString;
|
|
92
|
-
description: z.ZodOptional<z.
|
|
92
|
+
description: z.ZodOptional<z.ZodString>;
|
|
93
93
|
rulesText: z.ZodString;
|
|
94
94
|
}, {
|
|
95
95
|
type: z.ZodLiteral<"percentage">;
|
|
96
96
|
rules: z.ZodObject<{
|
|
97
|
-
minimum: z.ZodOptional<z.
|
|
98
|
-
exclusiveMinimum: z.ZodOptional<z.
|
|
99
|
-
maximum: z.ZodOptional<z.
|
|
100
|
-
exclusiveMaximum: z.ZodOptional<z.
|
|
97
|
+
minimum: z.ZodOptional<z.ZodNumber>;
|
|
98
|
+
exclusiveMinimum: z.ZodOptional<z.ZodNumber>;
|
|
99
|
+
maximum: z.ZodOptional<z.ZodNumber>;
|
|
100
|
+
exclusiveMaximum: z.ZodOptional<z.ZodNumber>;
|
|
101
101
|
}, "strip", z.ZodTypeAny, {
|
|
102
102
|
minimum?: number | undefined;
|
|
103
103
|
maximum?: number | undefined;
|
|
@@ -110,9 +110,9 @@ export declare const percentageBasedCertificationDefinitionSchema: z.ZodObject<z
|
|
|
110
110
|
exclusiveMinimum?: number | undefined;
|
|
111
111
|
}>;
|
|
112
112
|
}>, "strip", z.ZodTypeAny, {
|
|
113
|
+
type: "percentage";
|
|
113
114
|
code: string;
|
|
114
115
|
name: string;
|
|
115
|
-
type: "percentage";
|
|
116
116
|
rulesText: string;
|
|
117
117
|
rules: {
|
|
118
118
|
minimum?: number | undefined;
|
|
@@ -123,9 +123,9 @@ export declare const percentageBasedCertificationDefinitionSchema: z.ZodObject<z
|
|
|
123
123
|
description?: string | undefined;
|
|
124
124
|
icon?: string | undefined;
|
|
125
125
|
}, {
|
|
126
|
+
type: "percentage";
|
|
126
127
|
code: string;
|
|
127
128
|
name: string;
|
|
128
|
-
type: "percentage";
|
|
129
129
|
rulesText: string;
|
|
130
130
|
rules: {
|
|
131
131
|
minimum?: number | undefined;
|
|
@@ -139,17 +139,17 @@ export declare const percentageBasedCertificationDefinitionSchema: z.ZodObject<z
|
|
|
139
139
|
export declare const certificationDefinitionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<z.objectUtil.extendShape<{
|
|
140
140
|
type: z.ZodEnum<["number", "percentage"]>;
|
|
141
141
|
code: z.ZodString;
|
|
142
|
-
icon: z.ZodOptional<z.
|
|
142
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
143
143
|
name: z.ZodString;
|
|
144
|
-
description: z.ZodOptional<z.
|
|
144
|
+
description: z.ZodOptional<z.ZodString>;
|
|
145
145
|
rulesText: z.ZodString;
|
|
146
146
|
}, {
|
|
147
147
|
type: z.ZodLiteral<"number">;
|
|
148
148
|
rules: z.ZodObject<{
|
|
149
|
-
minimum: z.ZodOptional<z.
|
|
150
|
-
exclusiveMinimum: z.ZodOptional<z.
|
|
151
|
-
maximum: z.ZodOptional<z.
|
|
152
|
-
exclusiveMaximum: z.ZodOptional<z.
|
|
149
|
+
minimum: z.ZodOptional<z.ZodNumber>;
|
|
150
|
+
exclusiveMinimum: z.ZodOptional<z.ZodNumber>;
|
|
151
|
+
maximum: z.ZodOptional<z.ZodNumber>;
|
|
152
|
+
exclusiveMaximum: z.ZodOptional<z.ZodNumber>;
|
|
153
153
|
}, "strip", z.ZodTypeAny, {
|
|
154
154
|
minimum?: number | undefined;
|
|
155
155
|
maximum?: number | undefined;
|
|
@@ -162,9 +162,9 @@ export declare const certificationDefinitionSchema: z.ZodDiscriminatedUnion<"typ
|
|
|
162
162
|
exclusiveMinimum?: number | undefined;
|
|
163
163
|
}>;
|
|
164
164
|
}>, "strip", z.ZodTypeAny, {
|
|
165
|
+
type: "number";
|
|
165
166
|
code: string;
|
|
166
167
|
name: string;
|
|
167
|
-
type: "number";
|
|
168
168
|
rulesText: string;
|
|
169
169
|
rules: {
|
|
170
170
|
minimum?: number | undefined;
|
|
@@ -175,9 +175,9 @@ export declare const certificationDefinitionSchema: z.ZodDiscriminatedUnion<"typ
|
|
|
175
175
|
description?: string | undefined;
|
|
176
176
|
icon?: string | undefined;
|
|
177
177
|
}, {
|
|
178
|
+
type: "number";
|
|
178
179
|
code: string;
|
|
179
180
|
name: string;
|
|
180
|
-
type: "number";
|
|
181
181
|
rulesText: string;
|
|
182
182
|
rules: {
|
|
183
183
|
minimum?: number | undefined;
|
|
@@ -190,17 +190,17 @@ export declare const certificationDefinitionSchema: z.ZodDiscriminatedUnion<"typ
|
|
|
190
190
|
}>, z.ZodObject<z.objectUtil.extendShape<{
|
|
191
191
|
type: z.ZodEnum<["number", "percentage"]>;
|
|
192
192
|
code: z.ZodString;
|
|
193
|
-
icon: z.ZodOptional<z.
|
|
193
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
194
194
|
name: z.ZodString;
|
|
195
|
-
description: z.ZodOptional<z.
|
|
195
|
+
description: z.ZodOptional<z.ZodString>;
|
|
196
196
|
rulesText: z.ZodString;
|
|
197
197
|
}, {
|
|
198
198
|
type: z.ZodLiteral<"percentage">;
|
|
199
199
|
rules: z.ZodObject<{
|
|
200
|
-
minimum: z.ZodOptional<z.
|
|
201
|
-
exclusiveMinimum: z.ZodOptional<z.
|
|
202
|
-
maximum: z.ZodOptional<z.
|
|
203
|
-
exclusiveMaximum: z.ZodOptional<z.
|
|
200
|
+
minimum: z.ZodOptional<z.ZodNumber>;
|
|
201
|
+
exclusiveMinimum: z.ZodOptional<z.ZodNumber>;
|
|
202
|
+
maximum: z.ZodOptional<z.ZodNumber>;
|
|
203
|
+
exclusiveMaximum: z.ZodOptional<z.ZodNumber>;
|
|
204
204
|
}, "strip", z.ZodTypeAny, {
|
|
205
205
|
minimum?: number | undefined;
|
|
206
206
|
maximum?: number | undefined;
|
|
@@ -213,9 +213,9 @@ export declare const certificationDefinitionSchema: z.ZodDiscriminatedUnion<"typ
|
|
|
213
213
|
exclusiveMinimum?: number | undefined;
|
|
214
214
|
}>;
|
|
215
215
|
}>, "strip", z.ZodTypeAny, {
|
|
216
|
+
type: "percentage";
|
|
216
217
|
code: string;
|
|
217
218
|
name: string;
|
|
218
|
-
type: "percentage";
|
|
219
219
|
rulesText: string;
|
|
220
220
|
rules: {
|
|
221
221
|
minimum?: number | undefined;
|
|
@@ -226,9 +226,9 @@ export declare const certificationDefinitionSchema: z.ZodDiscriminatedUnion<"typ
|
|
|
226
226
|
description?: string | undefined;
|
|
227
227
|
icon?: string | undefined;
|
|
228
228
|
}, {
|
|
229
|
+
type: "percentage";
|
|
229
230
|
code: string;
|
|
230
231
|
name: string;
|
|
231
|
-
type: "percentage";
|
|
232
232
|
rulesText: string;
|
|
233
233
|
rules: {
|
|
234
234
|
minimum?: number | undefined;
|
|
@@ -2,24 +2,23 @@
|
|
|
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
|
-
const utils_1 = require("./utils");
|
|
6
5
|
exports.certificationDefinitionTypeSchema = zod_1.z.enum([
|
|
7
6
|
"number",
|
|
8
7
|
"percentage",
|
|
9
8
|
]);
|
|
10
9
|
exports.numberBasedCertificationDefinitionRulesSchema = zod_1.z.object({
|
|
11
|
-
minimum:
|
|
12
|
-
exclusiveMinimum:
|
|
13
|
-
maximum:
|
|
14
|
-
exclusiveMaximum:
|
|
10
|
+
minimum: zod_1.z.number().optional(),
|
|
11
|
+
exclusiveMinimum: zod_1.z.number().optional(),
|
|
12
|
+
maximum: zod_1.z.number().optional(),
|
|
13
|
+
exclusiveMaximum: zod_1.z.number().optional(),
|
|
15
14
|
});
|
|
16
15
|
exports.percentageBasedCertificationDefinitionRulesSchema = exports.numberBasedCertificationDefinitionRulesSchema;
|
|
17
16
|
const abstractCertificationDefinitionSchema = zod_1.z.object({
|
|
18
17
|
type: exports.certificationDefinitionTypeSchema,
|
|
19
18
|
code: zod_1.z.string(),
|
|
20
|
-
icon:
|
|
19
|
+
icon: zod_1.z.string().optional(),
|
|
21
20
|
name: zod_1.z.string(),
|
|
22
|
-
description:
|
|
21
|
+
description: zod_1.z.string().optional(),
|
|
23
22
|
rulesText: zod_1.z.string(),
|
|
24
23
|
});
|
|
25
24
|
exports.numberBasedCertificationDefinitionSchema = abstractCertificationDefinitionSchema.extend({
|
|
@@ -15,16 +15,16 @@ export declare const colorSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
|
15
15
|
export declare const taskItemScalarValueSchema: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
|
|
16
16
|
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">]>;
|
|
17
17
|
export declare const elementDataSchema: z.ZodObject<{
|
|
18
|
-
type: z.ZodOptional<z.
|
|
19
|
-
value: z.ZodOptional<z.
|
|
20
|
-
text: z.ZodOptional<z.
|
|
21
|
-
maximumValue: z.ZodOptional<z.
|
|
22
|
-
minimumValue: z.ZodOptional<z.
|
|
23
|
-
exclusiveMaximum: z.ZodOptional<z.
|
|
24
|
-
exclusiveMinimum: z.ZodOptional<z.
|
|
25
|
-
step: z.ZodOptional<z.
|
|
26
|
-
total: z.ZodOptional<z.
|
|
27
|
-
readOnly: z.ZodOptional<z.
|
|
18
|
+
type: z.ZodOptional<z.ZodEnum<["percentage", "number"]>>;
|
|
19
|
+
value: 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">]>>;
|
|
20
|
+
text: z.ZodOptional<z.ZodString>;
|
|
21
|
+
maximumValue: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
minimumValue: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
exclusiveMaximum: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
exclusiveMinimum: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
step: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
28
28
|
}, "strip", z.ZodTypeAny, {
|
|
29
29
|
type?: "number" | "percentage" | undefined;
|
|
30
30
|
total?: number | undefined;
|
|
@@ -53,37 +53,68 @@ export declare const abstractElementSchema: z.ZodObject<{
|
|
|
53
53
|
type: z.ZodEnum<["theme", "criterion", "task-group", "task", "task-item"]>;
|
|
54
54
|
title: z.ZodString;
|
|
55
55
|
code: z.ZodString;
|
|
56
|
-
tags: z.ZodOptional<z.
|
|
57
|
-
documentation: z.ZodOptional<z.
|
|
56
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
57
|
+
documentation: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<z.objectUtil.extendShape<{
|
|
58
|
+
type: z.ZodEnum<["pdf", "text", "link"]>;
|
|
59
|
+
label: z.ZodString;
|
|
60
|
+
text: z.ZodString;
|
|
61
|
+
}, {
|
|
62
|
+
type: z.ZodLiteral<"pdf">;
|
|
63
|
+
url: z.ZodString;
|
|
64
|
+
}>, "strip", z.ZodTypeAny, {
|
|
58
65
|
type: "pdf";
|
|
59
66
|
url: string;
|
|
60
67
|
label: string;
|
|
61
68
|
text: string;
|
|
62
|
-
}
|
|
63
|
-
type: "
|
|
64
|
-
label: string;
|
|
65
|
-
text: string;
|
|
66
|
-
} | {
|
|
67
|
-
type: "link";
|
|
69
|
+
}, {
|
|
70
|
+
type: "pdf";
|
|
68
71
|
url: string;
|
|
69
72
|
label: string;
|
|
70
73
|
text: string;
|
|
71
|
-
}
|
|
72
|
-
type: "pdf"
|
|
73
|
-
|
|
74
|
+
}>, z.ZodObject<z.objectUtil.extendShape<{
|
|
75
|
+
type: z.ZodEnum<["pdf", "text", "link"]>;
|
|
76
|
+
label: z.ZodString;
|
|
77
|
+
text: z.ZodString;
|
|
78
|
+
}, {
|
|
79
|
+
type: z.ZodLiteral<"text">;
|
|
80
|
+
}>, "strip", z.ZodTypeAny, {
|
|
81
|
+
type: "text";
|
|
74
82
|
label: string;
|
|
75
83
|
text: string;
|
|
76
|
-
}
|
|
84
|
+
}, {
|
|
77
85
|
type: "text";
|
|
78
86
|
label: string;
|
|
79
87
|
text: string;
|
|
80
|
-
}
|
|
88
|
+
}>, z.ZodObject<z.objectUtil.extendShape<{
|
|
89
|
+
type: z.ZodEnum<["pdf", "text", "link"]>;
|
|
90
|
+
label: z.ZodString;
|
|
91
|
+
text: z.ZodString;
|
|
92
|
+
}, {
|
|
93
|
+
type: z.ZodLiteral<"link">;
|
|
94
|
+
url: z.ZodString;
|
|
95
|
+
}>, "strip", z.ZodTypeAny, {
|
|
96
|
+
type: "link";
|
|
97
|
+
url: string;
|
|
98
|
+
label: string;
|
|
99
|
+
text: string;
|
|
100
|
+
}, {
|
|
81
101
|
type: "link";
|
|
82
102
|
url: string;
|
|
83
103
|
label: string;
|
|
84
104
|
text: string;
|
|
85
|
-
}
|
|
86
|
-
data: z.ZodOptional<z.
|
|
105
|
+
}>]>, "many">>;
|
|
106
|
+
data: z.ZodOptional<z.ZodObject<{
|
|
107
|
+
type: z.ZodOptional<z.ZodEnum<["percentage", "number"]>>;
|
|
108
|
+
value: 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">]>>;
|
|
109
|
+
text: z.ZodOptional<z.ZodString>;
|
|
110
|
+
maximumValue: z.ZodOptional<z.ZodNumber>;
|
|
111
|
+
minimumValue: z.ZodOptional<z.ZodNumber>;
|
|
112
|
+
exclusiveMaximum: z.ZodOptional<z.ZodNumber>;
|
|
113
|
+
exclusiveMinimum: z.ZodOptional<z.ZodNumber>;
|
|
114
|
+
step: z.ZodOptional<z.ZodNumber>;
|
|
115
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
116
|
+
readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
117
|
+
}, "strip", z.ZodTypeAny, {
|
|
87
118
|
type?: "number" | "percentage" | undefined;
|
|
88
119
|
total?: number | undefined;
|
|
89
120
|
value?: string | number | boolean | (string | number | boolean | null)[] | null | undefined;
|
|
@@ -94,7 +125,7 @@ export declare const abstractElementSchema: z.ZodObject<{
|
|
|
94
125
|
exclusiveMinimum?: number | undefined;
|
|
95
126
|
step?: number | undefined;
|
|
96
127
|
readOnly?: boolean | undefined;
|
|
97
|
-
},
|
|
128
|
+
}, {
|
|
98
129
|
type?: "number" | "percentage" | undefined;
|
|
99
130
|
total?: number | undefined;
|
|
100
131
|
value?: string | number | boolean | (string | number | boolean | null)[] | null | undefined;
|
|
@@ -106,10 +137,10 @@ export declare const abstractElementSchema: z.ZodObject<{
|
|
|
106
137
|
step?: number | undefined;
|
|
107
138
|
readOnly?: boolean | undefined;
|
|
108
139
|
}>>;
|
|
109
|
-
sortOrder: z.ZodOptional<z.
|
|
140
|
+
sortOrder: z.ZodOptional<z.ZodNumber>;
|
|
110
141
|
}, "strip", z.ZodTypeAny, {
|
|
111
|
-
code: string;
|
|
112
142
|
type: "theme" | "criterion" | "task-group" | "task" | "task-item";
|
|
143
|
+
code: string;
|
|
113
144
|
title: string;
|
|
114
145
|
data?: {
|
|
115
146
|
type?: "number" | "percentage" | undefined;
|
|
@@ -141,8 +172,8 @@ export declare const abstractElementSchema: z.ZodObject<{
|
|
|
141
172
|
})[] | undefined;
|
|
142
173
|
sortOrder?: number | undefined;
|
|
143
174
|
}, {
|
|
144
|
-
code: string;
|
|
145
175
|
type: "theme" | "criterion" | "task-group" | "task" | "task-item";
|
|
176
|
+
code: string;
|
|
146
177
|
title: string;
|
|
147
178
|
data?: {
|
|
148
179
|
type?: "number" | "percentage" | undefined;
|
|
@@ -3,7 +3,6 @@ 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
|
-
const utils_1 = require("./utils");
|
|
7
6
|
exports.colorSchema = zod_1.z.union([
|
|
8
7
|
zod_1.z.string(),
|
|
9
8
|
zod_1.z.object({
|
|
@@ -24,16 +23,16 @@ exports.taskItemValueSchema = zod_1.z.union([
|
|
|
24
23
|
zod_1.z.array(exports.taskItemScalarValueSchema),
|
|
25
24
|
]);
|
|
26
25
|
exports.elementDataSchema = zod_1.z.object({
|
|
27
|
-
type:
|
|
28
|
-
value:
|
|
29
|
-
text:
|
|
30
|
-
maximumValue:
|
|
31
|
-
minimumValue:
|
|
32
|
-
exclusiveMaximum:
|
|
33
|
-
exclusiveMinimum:
|
|
34
|
-
step:
|
|
35
|
-
total:
|
|
36
|
-
readOnly:
|
|
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(),
|
|
37
36
|
});
|
|
38
37
|
exports.criteriaTreeElementTypeSchema = zod_1.z.enum([
|
|
39
38
|
"theme",
|
|
@@ -46,8 +45,8 @@ exports.abstractElementSchema = zod_1.z.object({
|
|
|
46
45
|
type: exports.criteriaTreeElementTypeSchema,
|
|
47
46
|
title: zod_1.z.string(),
|
|
48
47
|
code: zod_1.z.string(),
|
|
49
|
-
tags:
|
|
50
|
-
documentation:
|
|
51
|
-
data:
|
|
52
|
-
sortOrder:
|
|
48
|
+
tags: zod_1.z.array(zod_1.z.string()).optional(),
|
|
49
|
+
documentation: zod_1.z.array(documentation_1.documentationItemSchema).optional(),
|
|
50
|
+
data: exports.elementDataSchema.optional(),
|
|
51
|
+
sortOrder: zod_1.z.number().optional(),
|
|
53
52
|
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Validates the criteriaSetId parameter for endpoints which use it
|
|
4
|
+
*/
|
|
5
|
+
export declare const criteriaSetIdParamSchema: z.ZodObject<{
|
|
6
|
+
criteriaSetId: z.ZodString;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
criteriaSetId: string;
|
|
9
|
+
}, {
|
|
10
|
+
criteriaSetId: string;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.criteriaSetIdParamSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Validates the criteriaSetId parameter for endpoints which use it
|
|
7
|
+
*/
|
|
8
|
+
exports.criteriaSetIdParamSchema = zod_1.z.object({
|
|
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')
|
|
11
|
+
});
|