@middy/validator 4.6.2 → 4.6.3
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/package.json +12 -5
- package/transpile.cjs +39 -1
- package/transpile.js +39 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@middy/validator",
|
|
3
|
-
"version": "4.6.
|
|
3
|
+
"version": "4.6.3",
|
|
4
4
|
"description": "Validator middleware for the middy framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -78,13 +78,20 @@
|
|
|
78
78
|
"url": "https://github.com/sponsors/willfarrell"
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
|
-
"@middy/util": "4.6.
|
|
82
|
-
"ajv
|
|
81
|
+
"@middy/util": "4.6.3",
|
|
82
|
+
"ajv": "8.12.0",
|
|
83
|
+
"ajv-cmd": "0.3.4",
|
|
84
|
+
"ajv-errors": "3.0.0",
|
|
85
|
+
"ajv-formats": "2.1.1",
|
|
86
|
+
"ajv-formats-draft2019": "1.6.1",
|
|
87
|
+
"ajv-ftl-i18n": "0.1.1",
|
|
88
|
+
"ajv-keywords": "5.1.0",
|
|
89
|
+
"fast-uri": "2.2.0"
|
|
83
90
|
},
|
|
84
91
|
"devDependencies": {
|
|
85
|
-
"@middy/core": "4.6.
|
|
92
|
+
"@middy/core": "4.6.3",
|
|
86
93
|
"@types/http-errors": "^2.0.0",
|
|
87
94
|
"ajv-bsontype": "^1.0.7"
|
|
88
95
|
},
|
|
89
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "4873f6e64cc4a7dbe8739ed3e45ef458dfe0dba1"
|
|
90
97
|
}
|
package/transpile.cjs
CHANGED
|
@@ -37,5 +37,43 @@ const transpileSchema = (schema, ajvOptions)=>{
|
|
|
37
37
|
};
|
|
38
38
|
return (0, _compile.default)(schema, options);
|
|
39
39
|
};
|
|
40
|
-
const transpileLocale = _ftl
|
|
40
|
+
const transpileLocale = _ftl /*
|
|
41
|
+
import Ajv from 'ajv/dist/2020.js'
|
|
42
|
+
import ajvFormats from 'ajv-formats'
|
|
43
|
+
import ajvFormatsDraft2019 from 'ajv-formats-draft2019'
|
|
44
|
+
import ajvKeywords from 'ajv-keywords'
|
|
45
|
+
import ajvErrors from 'ajv-errors'
|
|
46
|
+
import uriResolver from 'fast-uri'
|
|
47
|
+
|
|
48
|
+
import { transpile } from 'ajv-ftl-i18n'
|
|
49
|
+
|
|
50
|
+
// import transpileFTL from 'ajv-cmd/ftl'
|
|
51
|
+
export const transpileFTL = transpile
|
|
52
|
+
|
|
53
|
+
// *** Start `ajv-cmd/compile` *** //
|
|
54
|
+
// import compileSchema from 'ajv-cmd/compile'
|
|
55
|
+
|
|
56
|
+
const defaultOptions = {
|
|
57
|
+
uriResolver // faster than default
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const instance = (options = {}) => {
|
|
61
|
+
options = { ...defaultOptions, ...options, keywords: [] }
|
|
62
|
+
|
|
63
|
+
const ajv = new Ajv(options)
|
|
64
|
+
ajvFormats(ajv)
|
|
65
|
+
ajvFormatsDraft2019(ajv)
|
|
66
|
+
ajvKeywords(ajv)
|
|
67
|
+
ajvErrors(ajv)
|
|
68
|
+
return ajv
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const compileSchema = (schema, options = {}) => {
|
|
72
|
+
options = { ...defaultOptions, ...options, keywords: [] }
|
|
73
|
+
const ajv = instance(options)
|
|
74
|
+
return ajv.compile(schema)
|
|
75
|
+
}
|
|
76
|
+
// *** End `ajv-cmd/compile` *** //
|
|
77
|
+
|
|
78
|
+
*/ .default;
|
|
41
79
|
|
package/transpile.js
CHANGED
|
@@ -16,5 +16,43 @@ export const transpileSchema = (schema, ajvOptions)=>{
|
|
|
16
16
|
};
|
|
17
17
|
return compileSchema(schema, options);
|
|
18
18
|
};
|
|
19
|
-
export const transpileLocale = transpileFTL
|
|
19
|
+
export const transpileLocale = transpileFTL /*
|
|
20
|
+
import Ajv from 'ajv/dist/2020.js'
|
|
21
|
+
import ajvFormats from 'ajv-formats'
|
|
22
|
+
import ajvFormatsDraft2019 from 'ajv-formats-draft2019'
|
|
23
|
+
import ajvKeywords from 'ajv-keywords'
|
|
24
|
+
import ajvErrors from 'ajv-errors'
|
|
25
|
+
import uriResolver from 'fast-uri'
|
|
26
|
+
|
|
27
|
+
import { transpile } from 'ajv-ftl-i18n'
|
|
28
|
+
|
|
29
|
+
// import transpileFTL from 'ajv-cmd/ftl'
|
|
30
|
+
export const transpileFTL = transpile
|
|
31
|
+
|
|
32
|
+
// *** Start `ajv-cmd/compile` *** //
|
|
33
|
+
// import compileSchema from 'ajv-cmd/compile'
|
|
34
|
+
|
|
35
|
+
const defaultOptions = {
|
|
36
|
+
uriResolver // faster than default
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const instance = (options = {}) => {
|
|
40
|
+
options = { ...defaultOptions, ...options, keywords: [] }
|
|
41
|
+
|
|
42
|
+
const ajv = new Ajv(options)
|
|
43
|
+
ajvFormats(ajv)
|
|
44
|
+
ajvFormatsDraft2019(ajv)
|
|
45
|
+
ajvKeywords(ajv)
|
|
46
|
+
ajvErrors(ajv)
|
|
47
|
+
return ajv
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const compileSchema = (schema, options = {}) => {
|
|
51
|
+
options = { ...defaultOptions, ...options, keywords: [] }
|
|
52
|
+
const ajv = instance(options)
|
|
53
|
+
return ajv.compile(schema)
|
|
54
|
+
}
|
|
55
|
+
// *** End `ajv-cmd/compile` *** //
|
|
56
|
+
|
|
57
|
+
*/ ;
|
|
20
58
|
|