@openframe-org/criteria-set-protocol 1.2.2 → 1.3.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.
@@ -1,3 +1,4 @@
1
1
  export * from './criteria-set-id-param-schema';
2
- export * from './tree-and-matrix-body-schema';
2
+ export * from './tree-body-schema';
3
+ export * from './matrix-body-schema';
3
4
  export * from './version-param-schema';
@@ -15,5 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./criteria-set-id-param-schema"), exports);
18
- __exportStar(require("./tree-and-matrix-body-schema"), exports);
18
+ __exportStar(require("./tree-body-schema"), exports);
19
+ __exportStar(require("./matrix-body-schema"), exports);
19
20
  __exportStar(require("./version-param-schema"), exports);
@@ -0,0 +1,19 @@
1
+ import * as yup from 'yup';
2
+ /**
3
+ * Validates the request body for the matrix endpoints
4
+ */
5
+ export declare const matrixBodySchema: 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
+ }, "">;
@@ -0,0 +1,38 @@
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.matrixBodySchema = void 0;
27
+ const yup = __importStar(require("yup"));
28
+ /**
29
+ * Validates the request body for the matrix endpoints
30
+ */
31
+ exports.matrixBodySchema = 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
+ });
@@ -0,0 +1,17 @@
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
+ }, "">;
@@ -0,0 +1,37 @@
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
+ });
@@ -48,9 +48,8 @@ export type CriteriaTree = {
48
48
  };
49
49
  type BaseElement<Type extends CriteriaTreeElementType> = {
50
50
  type: Type;
51
- id: string;
52
51
  title: string;
53
- code?: string;
52
+ code: string;
54
53
  tags?: string[];
55
54
  documentation?: DocumentationItem[];
56
55
  data?: Record<string, any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openframe-org/criteria-set-protocol",
3
- "version": "1.2.2",
3
+ "version": "1.3.0",
4
4
  "description": "A protocol and tools for defining and working with criteria sets",
5
5
  "private": false,
6
6
  "author": "Andrés Angulo <aa@openframe.org>",