@tsed/ajv 6.102.7 → 6.102.8
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/lib/cjs/index.js +12 -5
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/interfaces/interfaces.js +3 -0
- package/lib/cjs/interfaces/interfaces.js.map +1 -0
- package/lib/cjs/package.json +3 -0
- package/lib/esm/index.js +14 -7
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/interfaces/interfaces.js +2 -0
- package/lib/esm/interfaces/interfaces.js.map +1 -0
- package/lib/esm/package.json +3 -0
- package/lib/esm/services/AjvService.js +4 -4
- package/lib/esm/utils/defaultErrorFormatter.js +1 -1
- package/lib/types/index.d.ts +12 -13
- package/lib/types/interfaces/interfaces.d.ts +8 -0
- package/package.json +13 -11
- package/readme.md +1 -4
package/lib/cjs/index.js
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @file Automatically generated by barrelsby.
|
|
4
|
+
*/
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
const tslib_1 = require("tslib");
|
|
4
|
-
(0, tslib_1.__exportStar)(require("./errors/AjvValidationError"), exports);
|
|
5
|
-
(0, tslib_1.__exportStar)(require("./services/AjvService"), exports);
|
|
6
|
-
(0, tslib_1.__exportStar)(require("./services/Ajv"), exports);
|
|
7
|
-
(0, tslib_1.__exportStar)(require("./decorators/keyword"), exports);
|
|
8
|
-
(0, tslib_1.__exportStar)(require("./interfaces/KeywordMethods"), exports);
|
|
9
7
|
(0, tslib_1.__exportStar)(require("./decorators/formats"), exports);
|
|
8
|
+
(0, tslib_1.__exportStar)(require("./decorators/keyword"), exports);
|
|
9
|
+
(0, tslib_1.__exportStar)(require("./errors/AjvValidationError"), exports);
|
|
10
10
|
(0, tslib_1.__exportStar)(require("./interfaces/FormatsMethods"), exports);
|
|
11
|
+
(0, tslib_1.__exportStar)(require("./interfaces/IAjvSettings"), exports);
|
|
12
|
+
(0, tslib_1.__exportStar)(require("./interfaces/KeywordMethods"), exports);
|
|
13
|
+
(0, tslib_1.__exportStar)(require("./interfaces/interfaces"), exports);
|
|
14
|
+
(0, tslib_1.__exportStar)(require("./services/Ajv"), exports);
|
|
15
|
+
(0, tslib_1.__exportStar)(require("./services/AjvService"), exports);
|
|
16
|
+
(0, tslib_1.__exportStar)(require("./utils/defaultErrorFormatter"), exports);
|
|
17
|
+
(0, tslib_1.__exportStar)(require("./utils/getPath"), exports);
|
|
11
18
|
//# sourceMappingURL=index.js.map
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,oEAAqC;AACrC,oEAAqC;AACrC,2EAA4C;AAC5C,2EAA4C;AAC5C,yEAA0C;AAC1C,2EAA4C;AAC5C,uEAAwC;AACxC,8DAA+B;AAC/B,qEAAsC;AACtC,6EAA8C;AAC9C,+DAAgC","sourcesContent":["/**\n * @file Automatically generated by barrelsby.\n */\n\nexport * from \"./decorators/formats\";\nexport * from \"./decorators/keyword\";\nexport * from \"./errors/AjvValidationError\";\nexport * from \"./interfaces/FormatsMethods\";\nexport * from \"./interfaces/IAjvSettings\";\nexport * from \"./interfaces/KeywordMethods\";\nexport * from \"./interfaces/interfaces\";\nexport * from \"./services/Ajv\";\nexport * from \"./services/AjvService\";\nexport * from \"./utils/defaultErrorFormatter\";\nexport * from \"./utils/getPath\";\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/interfaces/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["import {IAjvSettings} from \"./IAjvSettings\";\n\ndeclare global {\n namespace TsED {\n interface Configuration {\n // @ts-ignore\n ajv?: IAjvSettings;\n }\n }\n}\n"]}
|
package/lib/esm/index.js
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export * from "./decorators/
|
|
5
|
-
export * from "./
|
|
6
|
-
export * from "./
|
|
7
|
-
export * from "./interfaces/FormatsMethods";
|
|
1
|
+
/**
|
|
2
|
+
* @file Automatically generated by barrelsby.
|
|
3
|
+
*/
|
|
4
|
+
export * from "./decorators/formats.js";
|
|
5
|
+
export * from "./decorators/keyword.js";
|
|
6
|
+
export * from "./errors/AjvValidationError.js";
|
|
7
|
+
export * from "./interfaces/FormatsMethods.js";
|
|
8
|
+
export * from "./interfaces/IAjvSettings.js";
|
|
9
|
+
export * from "./interfaces/KeywordMethods.js";
|
|
10
|
+
export * from "./interfaces/interfaces.js";
|
|
11
|
+
export * from "./services/Ajv.js";
|
|
12
|
+
export * from "./services/AjvService.js";
|
|
13
|
+
export * from "./utils/defaultErrorFormatter.js";
|
|
14
|
+
export * from "./utils/getPath.js";
|
|
8
15
|
//# sourceMappingURL=index.js.map
|
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iBAAiB,CAAC","sourcesContent":["/**\n * @file Automatically generated by barrelsby.\n */\n\nexport * from \"./decorators/formats\";\nexport * from \"./decorators/keyword\";\nexport * from \"./errors/AjvValidationError\";\nexport * from \"./interfaces/FormatsMethods\";\nexport * from \"./interfaces/IAjvSettings\";\nexport * from \"./interfaces/KeywordMethods\";\nexport * from \"./interfaces/interfaces\";\nexport * from \"./services/Ajv\";\nexport * from \"./services/AjvService\";\nexport * from \"./utils/defaultErrorFormatter\";\nexport * from \"./utils/getPath\";\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/interfaces/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["import {IAjvSettings} from \"./IAjvSettings\";\n\ndeclare global {\n namespace TsED {\n interface Configuration {\n // @ts-ignore\n ajv?: IAjvSettings;\n }\n }\n}\n"]}
|
|
@@ -3,10 +3,10 @@ import { deepClone, getValue, nameOf, prototypeOf, setValue } from "@tsed/core";
|
|
|
3
3
|
import { Constant, Inject, Injectable } from "@tsed/di";
|
|
4
4
|
import { getJsonSchema, JsonEntityStore, JsonSchema } from "@tsed/schema";
|
|
5
5
|
import Ajv from "ajv";
|
|
6
|
-
import { AjvValidationError } from "../errors/AjvValidationError";
|
|
7
|
-
import { defaultErrorFormatter } from "../utils/defaultErrorFormatter";
|
|
8
|
-
import "./Ajv";
|
|
9
|
-
import { getPath } from "../utils/getPath";
|
|
6
|
+
import { AjvValidationError } from "../errors/AjvValidationError.js";
|
|
7
|
+
import { defaultErrorFormatter } from "../utils/defaultErrorFormatter.js";
|
|
8
|
+
import "./Ajv.js";
|
|
9
|
+
import { getPath } from "../utils/getPath.js";
|
|
10
10
|
let AjvService = class AjvService {
|
|
11
11
|
async validate(value, options) {
|
|
12
12
|
let { schema, type, collectionType, ...additionalOptions } = this.mapOptions(options);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getPath } from "./getPath";
|
|
1
|
+
import { getPath } from "./getPath.js";
|
|
2
2
|
export function defaultErrorFormatter(error) {
|
|
3
3
|
const value = JSON.stringify(error.data === undefined ? "undefined" : error.data);
|
|
4
4
|
const join = (list) => list.filter(Boolean).join("").trim();
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export * from "./decorators/keyword";
|
|
5
|
-
export * from "./interfaces/KeywordMethods";
|
|
1
|
+
/**
|
|
2
|
+
* @file Automatically generated by barrelsby.
|
|
3
|
+
*/
|
|
6
4
|
export * from "./decorators/formats";
|
|
5
|
+
export * from "./decorators/keyword";
|
|
6
|
+
export * from "./errors/AjvValidationError";
|
|
7
7
|
export * from "./interfaces/FormatsMethods";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
8
|
+
export * from "./interfaces/IAjvSettings";
|
|
9
|
+
export * from "./interfaces/KeywordMethods";
|
|
10
|
+
export * from "./interfaces/interfaces";
|
|
11
|
+
export * from "./services/Ajv";
|
|
12
|
+
export * from "./services/AjvService";
|
|
13
|
+
export * from "./utils/defaultErrorFormatter";
|
|
14
|
+
export * from "./utils/getPath";
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/ajv",
|
|
3
|
-
"version": "6.102.
|
|
3
|
+
"version": "6.102.8",
|
|
4
4
|
"description": "AJV package for Ts.ED framework",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"main": "./lib/cjs/index.js",
|
|
7
|
+
"module": "./lib/esm/index.js",
|
|
7
8
|
"typings": "./lib/types/index.d.ts",
|
|
8
9
|
"exports": {
|
|
9
10
|
"types": "./lib/types/index.d.ts",
|
|
@@ -12,26 +13,27 @@
|
|
|
12
13
|
"default": "./lib/esm/index.js"
|
|
13
14
|
},
|
|
14
15
|
"scripts": {
|
|
15
|
-
"build": "yarn run build:esm && yarn run build:cjs",
|
|
16
|
+
"build": "yarn barrels && yarn run build:esm && yarn run build:cjs",
|
|
16
17
|
"build:cjs": "tsc --build tsconfig.compile.json",
|
|
17
|
-
"build:esm": "tsc --build tsconfig.compile.esm.json"
|
|
18
|
+
"build:esm": "tsc --build tsconfig.compile.esm.json",
|
|
19
|
+
"barrels": "yarn barrelsby --delete -d ./src -e \"\\.spec\\.ts\" -e \"__mock__\" -e \".benchmark.ts\""
|
|
18
20
|
},
|
|
19
21
|
"dependencies": {
|
|
20
22
|
"ajv-formats": "1.5.1",
|
|
21
23
|
"tslib": "2.2.0"
|
|
22
24
|
},
|
|
23
25
|
"devDependencies": {
|
|
24
|
-
"@tsed/core": "6.102.
|
|
25
|
-
"@tsed/di": "6.102.
|
|
26
|
-
"@tsed/exceptions": "6.102.
|
|
27
|
-
"@tsed/schema": "6.102.
|
|
26
|
+
"@tsed/core": "6.102.8",
|
|
27
|
+
"@tsed/di": "6.102.8",
|
|
28
|
+
"@tsed/exceptions": "6.102.8",
|
|
29
|
+
"@tsed/schema": "6.102.8",
|
|
28
30
|
"ajv": "8.9.0"
|
|
29
31
|
},
|
|
30
32
|
"peerDependencies": {
|
|
31
|
-
"@tsed/core": "^6.102.
|
|
32
|
-
"@tsed/di": "^6.102.
|
|
33
|
-
"@tsed/exceptions": "^6.102.
|
|
34
|
-
"@tsed/schema": "^6.102.
|
|
33
|
+
"@tsed/core": "^6.102.8",
|
|
34
|
+
"@tsed/di": "^6.102.8",
|
|
35
|
+
"@tsed/exceptions": "^6.102.8",
|
|
36
|
+
"@tsed/schema": "^6.102.8",
|
|
35
37
|
"ajv": ">=8.9.0"
|
|
36
38
|
},
|
|
37
39
|
"repository": "https://github.com/tsedio/tsed",
|
package/readme.md
CHANGED
|
@@ -32,9 +32,7 @@ Then import `@tsed/ajv` in your Server:
|
|
|
32
32
|
import {Configuration} from "@tsed/common";
|
|
33
33
|
import "@tsed/ajv"; // import ajv ts.ed module
|
|
34
34
|
|
|
35
|
-
@Configuration({
|
|
36
|
-
rootDir: __dirname
|
|
37
|
-
})
|
|
35
|
+
@Configuration({})
|
|
38
36
|
export class Server {}
|
|
39
37
|
```
|
|
40
38
|
|
|
@@ -90,7 +88,6 @@ import {Configuration} from "@tsed/common";
|
|
|
90
88
|
import "@tsed/ajv"; // import ajv ts.ed module
|
|
91
89
|
|
|
92
90
|
@Configuration({
|
|
93
|
-
rootDir: __dirname,
|
|
94
91
|
ajv: {
|
|
95
92
|
errorFormatter: (error) => `At ${error.modelName}${error.dataPath}, value '${error.data}' ${error.message}`,
|
|
96
93
|
options: {verbose: true}
|