@openframe-org/criteria-set-protocol 1.0.37 → 1.0.38

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.
@@ -0,0 +1,6 @@
1
+ import { ValidationError } from './ValidationError';
2
+ export declare class DataValidationError extends ValidationError {
3
+ code: string;
4
+ path?: string | undefined;
5
+ constructor(code: string, path?: string | undefined, args?: Record<string, unknown>);
6
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DataValidationError = void 0;
4
+ const ValidationError_1 = require("./ValidationError");
5
+ class DataValidationError extends ValidationError_1.ValidationError {
6
+ constructor(code, path, args) {
7
+ super('data', code, path, args);
8
+ this.code = code;
9
+ this.path = path;
10
+ }
11
+ }
12
+ exports.DataValidationError = DataValidationError;
@@ -0,0 +1,6 @@
1
+ import { ValidationError } from './ValidationError';
2
+ export declare class ParameterValidationError extends ValidationError {
3
+ code: string;
4
+ path?: string | undefined;
5
+ constructor(code: string, path?: string | undefined, args?: Record<string, unknown>);
6
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ParameterValidationError = void 0;
4
+ const ValidationError_1 = require("./ValidationError");
5
+ class ParameterValidationError extends ValidationError_1.ValidationError {
6
+ constructor(code, path, args) {
7
+ super('parameter', code, path, args);
8
+ this.code = code;
9
+ this.path = path;
10
+ }
11
+ }
12
+ exports.ParameterValidationError = ParameterValidationError;
@@ -0,0 +1,14 @@
1
+ import { ValidationErrorType } from './types';
2
+ export declare abstract class ValidationError extends Error {
3
+ errorType: ValidationErrorType;
4
+ code: string;
5
+ path?: string | undefined;
6
+ arguments?: Record<string, unknown>;
7
+ protected constructor(errorType: ValidationErrorType, code: string, path?: string | undefined, args?: Record<string, unknown>);
8
+ toJSON(): {
9
+ errorType: ValidationErrorType;
10
+ code: string;
11
+ path: string | undefined;
12
+ arguments: Record<string, unknown> | undefined;
13
+ };
14
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ValidationError = void 0;
4
+ class ValidationError extends Error {
5
+ constructor(errorType, code, path, args) {
6
+ super(`Validation error: ${errorType}`);
7
+ this.errorType = errorType;
8
+ this.code = code;
9
+ this.path = path;
10
+ this.arguments = args;
11
+ }
12
+ toJSON() {
13
+ return {
14
+ errorType: this.errorType,
15
+ code: this.code,
16
+ path: this.path,
17
+ arguments: this.arguments
18
+ };
19
+ }
20
+ }
21
+ exports.ValidationError = ValidationError;
@@ -0,0 +1,2 @@
1
+ export * from './DataValidationError';
2
+ export * from './types';
@@ -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("./DataValidationError"), exports);
18
+ __exportStar(require("./types"), exports);
@@ -0,0 +1 @@
1
+ export type ValidationErrorType = 'data' | 'parameter';
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -2,3 +2,4 @@ export * from './schemas';
2
2
  export * from './services';
3
3
  export * from './types';
4
4
  export * from './utils';
5
+ export * from './errors';
package/dist/v1/index.js CHANGED
@@ -18,3 +18,4 @@ __exportStar(require("./schemas"), exports);
18
18
  __exportStar(require("./services"), exports);
19
19
  __exportStar(require("./types"), exports);
20
20
  __exportStar(require("./utils"), exports);
21
+ __exportStar(require("./errors"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openframe-org/criteria-set-protocol",
3
- "version": "1.0.37",
3
+ "version": "1.0.38",
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>",