@openframe-org/criteria-set-protocol 2.0.13 → 2.0.15
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/index.js +17 -7
- package/dist/v1/schemas/certification.d.ts +8 -8
- package/dist/v1/schemas/common.d.ts +5 -2
- package/dist/v1/schemas/common.js +1 -0
- package/dist/v1/schemas/criteria-tree.d.ts +248 -163
- package/dist/v1/schemas/criterion.d.ts +44 -29
- package/dist/v1/schemas/metadata.d.ts +2 -2
- package/dist/v1/schemas/quality.d.ts +181 -498
- package/dist/v1/schemas/quality.js +2 -2
- package/dist/v1/schemas/response.d.ts +2 -2
- package/dist/v1/schemas/task-group.d.ts +27 -19
- package/dist/v1/schemas/task-item.d.ts +5 -2
- package/dist/v1/schemas/task.d.ts +14 -14
- package/dist/v1/schemas/task.js +0 -2
- package/dist/v1/schemas/theme.d.ts +65 -41
- package/dist/v1/schemas/utils.d.ts +1 -4
- package/dist/v1/schemas/utils.js +1 -7
- package/dist/v1/types/express.d.ts +0 -1
- package/dist/v1/utils.d.ts +6 -750
- package/package.json +4 -4
- package/dist/services/i-versioned.service.d.ts +0 -16
- package/dist/services/i-versioned.service.js +0 -2
- package/dist/services/index.d.ts +0 -2
- package/dist/services/index.js +0 -18
- package/dist/services/versions.service.d.ts +0 -38
- package/dist/services/versions.service.js +0 -49
- package/dist/types.d.ts +0 -2
- package/dist/types.js +0 -2
- package/dist/v1/schemas/criteria-set-id-param-schema.d.ts +0 -11
- package/dist/v1/schemas/criteria-set-id-param-schema.js +0 -11
- package/dist/v1/schemas/download-matrix-body-schema.d.ts +0 -15
- package/dist/v1/schemas/download-matrix-body-schema.js +0 -36
- package/dist/v1/schemas/matrix-body-schema.d.ts +0 -20
- package/dist/v1/schemas/matrix-body-schema.js +0 -14
- package/dist/v1/schemas/tree-and-data-body-schema.d.ts +0 -17
- package/dist/v1/schemas/tree-and-data-body-schema.js +0 -13
- package/dist/v1/schemas/tree-and-matrix-body-schema.d.ts +0 -19
- package/dist/v1/schemas/tree-and-matrix-body-schema.js +0 -38
- package/dist/v1/schemas/tree-body-schema.d.ts +0 -17
- package/dist/v1/schemas/tree-body-schema.js +0 -37
- package/dist/v1/schemas/version-param-schema.d.ts +0 -11
- package/dist/v1/schemas/version-param-schema.js +0 -11
- package/dist/v1/services/i-protocol-v1.service.d.ts +0 -26
- package/dist/v1/services/i-protocol-v1.service.js +0 -2
- package/dist/v1/utils/color.d.ts +0 -2
- package/dist/v1/utils/color.js +0 -10
- package/dist/v1/utils/index.d.ts +0 -7
- package/dist/v1/utils/index.js +0 -15
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.0.15",
|
|
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>",
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@types/node": "^22.8.4",
|
|
25
|
-
"zod": "^3.
|
|
25
|
+
"zod": "^3.24.1"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"prettier": "^3.
|
|
29
|
-
"typescript": "^5.
|
|
28
|
+
"prettier": "^3.4.2",
|
|
29
|
+
"typescript": "^5.7.3"
|
|
30
30
|
},
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public",
|
|
@@ -1,16 +0,0 @@
|
|
|
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
|
-
}
|
package/dist/services/index.d.ts
DELETED
package/dist/services/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
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);
|
|
@@ -1,38 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
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
DELETED
package/dist/types.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
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
|
-
}>;
|
|
@@ -1,11 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as yup from 'yup';
|
|
2
|
-
/**
|
|
3
|
-
* Validates the request body for the download matrix endpoints
|
|
4
|
-
*/
|
|
5
|
-
export declare const downloadMatrixBodySchema: yup.ObjectSchema<{
|
|
6
|
-
body: {
|
|
7
|
-
values: {};
|
|
8
|
-
parameters: {};
|
|
9
|
-
};
|
|
10
|
-
}, yup.AnyObject, {
|
|
11
|
-
body: {
|
|
12
|
-
parameters: {};
|
|
13
|
-
values: {};
|
|
14
|
-
};
|
|
15
|
-
}, "">;
|
|
@@ -1,36 +0,0 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.downloadMatrixBodySchema = void 0;
|
|
27
|
-
const yup = __importStar(require("yup"));
|
|
28
|
-
/**
|
|
29
|
-
* Validates the request body for the download matrix endpoints
|
|
30
|
-
*/
|
|
31
|
-
exports.downloadMatrixBodySchema = yup.object({
|
|
32
|
-
body: yup.object({
|
|
33
|
-
parameters: yup.object().required(),
|
|
34
|
-
values: yup.object()
|
|
35
|
-
})
|
|
36
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* Validates the request body for the matrix endpoints
|
|
4
|
-
*/
|
|
5
|
-
export declare const matrixBodySchema: z.ZodOptional<z.ZodObject<{
|
|
6
|
-
locale: z.ZodOptional<z.ZodString>;
|
|
7
|
-
parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
8
|
-
values: 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">]>>>;
|
|
9
|
-
additional: z.ZodOptional<z.ZodAny>;
|
|
10
|
-
}, "strip", z.ZodTypeAny, {
|
|
11
|
-
values?: Record<string, string | number | boolean | (string | number | boolean | null)[] | null> | undefined;
|
|
12
|
-
locale?: string | undefined;
|
|
13
|
-
parameters?: Record<string, string> | undefined;
|
|
14
|
-
additional?: any;
|
|
15
|
-
}, {
|
|
16
|
-
values?: Record<string, string | number | boolean | (string | number | boolean | null)[] | null> | undefined;
|
|
17
|
-
locale?: string | undefined;
|
|
18
|
-
parameters?: Record<string, string> | undefined;
|
|
19
|
-
additional?: any;
|
|
20
|
-
}>>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.matrixBodySchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const task_item_1 = require("./task-item");
|
|
6
|
-
/**
|
|
7
|
-
* Validates the request body for the matrix endpoints
|
|
8
|
-
*/
|
|
9
|
-
exports.matrixBodySchema = zod_1.z.object({
|
|
10
|
-
locale: zod_1.z.string().optional(),
|
|
11
|
-
parameters: zod_1.z.record(zod_1.z.string()).optional(),
|
|
12
|
-
values: task_item_1.taskItemValueMapSchema.optional(),
|
|
13
|
-
additional: zod_1.z.any().optional()
|
|
14
|
-
}).optional();
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* Validates the request body for the tree and data endpoints
|
|
4
|
-
*/
|
|
5
|
-
export declare const treeAndDataBodySchema: z.ZodOptional<z.ZodObject<{
|
|
6
|
-
locale: z.ZodOptional<z.ZodString>;
|
|
7
|
-
parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
8
|
-
values: 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">]>>>;
|
|
9
|
-
}, "strip", z.ZodTypeAny, {
|
|
10
|
-
values?: Record<string, string | number | boolean | (string | number | boolean | null)[] | null> | undefined;
|
|
11
|
-
locale?: string | undefined;
|
|
12
|
-
parameters?: Record<string, string> | undefined;
|
|
13
|
-
}, {
|
|
14
|
-
values?: Record<string, string | number | boolean | (string | number | boolean | null)[] | null> | undefined;
|
|
15
|
-
locale?: string | undefined;
|
|
16
|
-
parameters?: Record<string, string> | undefined;
|
|
17
|
-
}>>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.treeAndDataBodySchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const task_item_1 = require("./task-item");
|
|
6
|
-
/**
|
|
7
|
-
* Validates the request body for the tree and data endpoints
|
|
8
|
-
*/
|
|
9
|
-
exports.treeAndDataBodySchema = zod_1.z.object({
|
|
10
|
-
locale: zod_1.z.string().optional(),
|
|
11
|
-
parameters: zod_1.z.record(zod_1.z.string()).optional(),
|
|
12
|
-
values: task_item_1.taskItemValueMapSchema.optional()
|
|
13
|
-
}).optional();
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import * as yup from 'yup';
|
|
2
|
-
/**
|
|
3
|
-
* Validates the request body for the tree and matrix endpoints
|
|
4
|
-
*/
|
|
5
|
-
export declare const treeAndMatrixBodySchema: yup.ObjectSchema<{
|
|
6
|
-
body: {
|
|
7
|
-
values?: {} | undefined;
|
|
8
|
-
locale?: string | undefined;
|
|
9
|
-
parameters?: {} | undefined;
|
|
10
|
-
additional?: {} | undefined;
|
|
11
|
-
} | undefined;
|
|
12
|
-
}, yup.AnyObject, {
|
|
13
|
-
body: {
|
|
14
|
-
locale: undefined;
|
|
15
|
-
parameters: {};
|
|
16
|
-
values: {};
|
|
17
|
-
additional: undefined;
|
|
18
|
-
};
|
|
19
|
-
}, "">;
|
|
@@ -1,38 +0,0 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.treeAndMatrixBodySchema = void 0;
|
|
27
|
-
const yup = __importStar(require("yup"));
|
|
28
|
-
/**
|
|
29
|
-
* Validates the request body for the tree and matrix endpoints
|
|
30
|
-
*/
|
|
31
|
-
exports.treeAndMatrixBodySchema = yup.object({
|
|
32
|
-
body: yup.object({
|
|
33
|
-
locale: yup.string().optional(),
|
|
34
|
-
parameters: yup.object().optional(),
|
|
35
|
-
values: yup.object().optional(),
|
|
36
|
-
additional: yup.mixed().optional()
|
|
37
|
-
}).optional()
|
|
38
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as yup from 'yup';
|
|
2
|
-
/**
|
|
3
|
-
* Validates the request body for the tree and data endpoints
|
|
4
|
-
*/
|
|
5
|
-
export declare const treeBodySchema: yup.ObjectSchema<{
|
|
6
|
-
body: {
|
|
7
|
-
values?: {} | undefined;
|
|
8
|
-
locale?: string | undefined;
|
|
9
|
-
parameters?: {} | undefined;
|
|
10
|
-
} | undefined;
|
|
11
|
-
}, yup.AnyObject, {
|
|
12
|
-
body: {
|
|
13
|
-
locale: undefined;
|
|
14
|
-
parameters: {};
|
|
15
|
-
values: {};
|
|
16
|
-
};
|
|
17
|
-
}, "">;
|
|
@@ -1,37 +0,0 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.treeBodySchema = void 0;
|
|
27
|
-
const yup = __importStar(require("yup"));
|
|
28
|
-
/**
|
|
29
|
-
* Validates the request body for the tree and data endpoints
|
|
30
|
-
*/
|
|
31
|
-
exports.treeBodySchema = yup.object({
|
|
32
|
-
body: yup.object({
|
|
33
|
-
locale: yup.string().optional(),
|
|
34
|
-
parameters: yup.object().optional(),
|
|
35
|
-
values: yup.object().optional()
|
|
36
|
-
}).optional()
|
|
37
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* Validates the version parameter for endpoints which use it
|
|
4
|
-
*/
|
|
5
|
-
export declare const versionParamSchema: z.ZodObject<{
|
|
6
|
-
version: z.ZodString;
|
|
7
|
-
}, "strip", z.ZodTypeAny, {
|
|
8
|
-
version: string;
|
|
9
|
-
}, {
|
|
10
|
-
version: string;
|
|
11
|
-
}>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.versionParamSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
/**
|
|
6
|
-
* Validates the version parameter for endpoints which use it
|
|
7
|
-
*/
|
|
8
|
-
exports.versionParamSchema = zod_1.z.object({
|
|
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')
|
|
11
|
-
});
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { CriteriaTree, StreamMatrixResponse, TaskItemValueMap, Metadata } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Interface for services which implement the v1 protocol
|
|
4
|
-
*/
|
|
5
|
-
export interface IProtocolV1Service {
|
|
6
|
-
/**
|
|
7
|
-
* Specific version of this service, SemVer-formatted
|
|
8
|
-
*/
|
|
9
|
-
version: string;
|
|
10
|
-
/**
|
|
11
|
-
* Get the criteria tree for the given criteria set ID and combination of parameters
|
|
12
|
-
*/
|
|
13
|
-
getCriteriaTree<Parameters>(criteriaSetId: string, parameters: Parameters, values?: TaskItemValueMap, locale?: string): Promise<CriteriaTree>;
|
|
14
|
-
/**
|
|
15
|
-
* Validate the given parameters for the given criteria set ID
|
|
16
|
-
*/
|
|
17
|
-
validateParameters<Parameters>(criteriaSetId: string, parameters: Parameters): void;
|
|
18
|
-
/**
|
|
19
|
-
* Stream the matrix for the given criteria set ID, parameter combination and value map
|
|
20
|
-
*/
|
|
21
|
-
streamMatrix<Parameters>(criteriaSetId: string, parameters: Parameters, values?: TaskItemValueMap, locale?: string): Promise<StreamMatrixResponse>;
|
|
22
|
-
/**
|
|
23
|
-
* Get the metadata of all criteria sets supported by this service
|
|
24
|
-
*/
|
|
25
|
-
getCriteriaSetMetadataList(): Metadata[];
|
|
26
|
-
}
|
package/dist/v1/utils/color.d.ts
DELETED
package/dist/v1/utils/color.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toColorHexString = void 0;
|
|
4
|
-
const toColorHexString = (color) => {
|
|
5
|
-
if (typeof color === 'string') {
|
|
6
|
-
return color;
|
|
7
|
-
}
|
|
8
|
-
return `#${color.red.toString(16)}${color.green.toString(16)}${color.blue.toString(16)}`;
|
|
9
|
-
};
|
|
10
|
-
exports.toColorHexString = toColorHexString;
|
package/dist/v1/utils/index.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { CriteriaTreeElement, Quality, Criterion, Task, TaskGroup, TaskItem } from '../types';
|
|
2
|
-
export { toColorHexString } from './color';
|
|
3
|
-
export declare const isQuality: (element: CriteriaTreeElement) => element is Quality;
|
|
4
|
-
export declare const isCriterion: (element: CriteriaTreeElement) => element is Criterion;
|
|
5
|
-
export declare const isTaskGroup: (element: CriteriaTreeElement) => element is TaskGroup;
|
|
6
|
-
export declare const isTask: (element: CriteriaTreeElement) => element is Task;
|
|
7
|
-
export declare const isTaskItem: (element: CriteriaTreeElement) => element is TaskItem;
|
package/dist/v1/utils/index.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isTaskItem = exports.isTask = exports.isTaskGroup = exports.isCriterion = exports.isQuality = exports.toColorHexString = void 0;
|
|
4
|
-
var color_1 = require("./color");
|
|
5
|
-
Object.defineProperty(exports, "toColorHexString", { enumerable: true, get: function () { return color_1.toColorHexString; } });
|
|
6
|
-
const isQuality = (element) => element.type === 'quality';
|
|
7
|
-
exports.isQuality = isQuality;
|
|
8
|
-
const isCriterion = (element) => element.type === 'criterion';
|
|
9
|
-
exports.isCriterion = isCriterion;
|
|
10
|
-
const isTaskGroup = (element) => element.type === 'task-group';
|
|
11
|
-
exports.isTaskGroup = isTaskGroup;
|
|
12
|
-
const isTask = (element) => element.type === 'task';
|
|
13
|
-
exports.isTask = isTask;
|
|
14
|
-
const isTaskItem = (element) => element.type === 'task-item';
|
|
15
|
-
exports.isTaskItem = isTaskItem;
|