@alexify/metaschema 3.2.0 → 3.4.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.
- package/CHANGELOG.md +307 -1
- package/README.md +173 -89
- package/SECURITY.md +24 -1
- package/index.d.ts +601 -29
- package/package.json +28 -3
- package/src/checks.js +789 -0
- package/src/codec.js +201 -46
- package/src/coerce/index.d.ts +34 -0
- package/src/coerce/index.js +385 -0
- package/src/compile/emit.js +87 -28
- package/src/compile/index.js +9 -4
- package/src/context.js +6 -1
- package/src/definition/index.d.ts +19 -0
- package/src/definition/index.js +27 -0
- package/src/derive/index.d.ts +86 -0
- package/src/derive/index.js +273 -0
- package/src/errors.js +46 -4
- package/src/formats/index.d.ts +20 -8
- package/src/formats/index.js +450 -39
- package/src/generators/fromjsonschema.js +21 -2
- package/src/generators/index.js +1 -1
- package/src/generators/jsonschema.js +90 -21
- package/src/generators/typescript.js +11 -0
- package/src/index.js +3 -2
- package/src/issues.js +9 -7
- package/src/kinds.js +15 -3
- package/src/lint.js +38 -0
- package/src/locales/en.js +6 -0
- package/src/locales/uk.js +6 -0
- package/src/metadata.js +6 -24
- package/src/model/data.js +67 -10
- package/src/model/diff.js +7 -4
- package/src/model/index.js +1 -1
- package/src/model/infer.js +10 -3
- package/src/model/merge.js +16 -9
- package/src/model/restore.js +52 -7
- package/src/model/sample.js +28 -4
- package/src/model.js +54 -56
- package/src/mongodb/bson.js +130 -0
- package/src/mongodb/document.js +217 -0
- package/src/mongodb/index.d.ts +133 -0
- package/src/mongodb/index.js +24 -0
- package/src/mongodb/indexes.js +79 -0
- package/src/mongodb/update.js +258 -0
- package/src/preprocessor.js +1 -2
- package/src/prototypes/abstract.js +41 -67
- package/src/prototypes/collections.js +3 -90
- package/src/prototypes/flags.js +34 -0
- package/src/prototypes/json.js +0 -11
- package/src/prototypes/reference.js +0 -76
- package/src/prototypes/scalars.js +17 -96
- package/src/prototypes/schema.js +1 -10
- package/src/prototypes/tuple.js +0 -26
- package/src/prototypes/union.js +12 -82
- package/src/rules.js +33 -157
- package/src/schema.js +105 -220
- package/src/snapshot.js +216 -41
- package/src/stream/index.js +1 -1
- package/src/struct.js +6 -91
- package/src/types.js +43 -6
- package/src/util.js +43 -0
- package/src/validation.js +313 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alexify/metaschema",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"description": "Fast, zero-dependency metadata schema and interface definition language (IDL) for Node.js and browsers — validation and parsing with a JIT backend, domain models, TypeScript and JSON Schema",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Alex Dolid <dolid.sasha@gmail.com>",
|
|
@@ -54,6 +54,22 @@
|
|
|
54
54
|
"./formats": {
|
|
55
55
|
"types": "./src/formats/index.d.ts",
|
|
56
56
|
"default": "./src/formats/index.js"
|
|
57
|
+
},
|
|
58
|
+
"./derive": {
|
|
59
|
+
"types": "./src/derive/index.d.ts",
|
|
60
|
+
"default": "./src/derive/index.js"
|
|
61
|
+
},
|
|
62
|
+
"./coerce": {
|
|
63
|
+
"types": "./src/coerce/index.d.ts",
|
|
64
|
+
"default": "./src/coerce/index.js"
|
|
65
|
+
},
|
|
66
|
+
"./mongodb": {
|
|
67
|
+
"types": "./src/mongodb/index.d.ts",
|
|
68
|
+
"default": "./src/mongodb/index.js"
|
|
69
|
+
},
|
|
70
|
+
"./definition": {
|
|
71
|
+
"types": "./src/definition/index.d.ts",
|
|
72
|
+
"default": "./src/definition/index.js"
|
|
57
73
|
}
|
|
58
74
|
},
|
|
59
75
|
"directories": {
|
|
@@ -69,7 +85,12 @@
|
|
|
69
85
|
"LICENSE",
|
|
70
86
|
"SECURITY.md"
|
|
71
87
|
],
|
|
72
|
-
"sideEffects":
|
|
88
|
+
"sideEffects": [
|
|
89
|
+
"./index.js",
|
|
90
|
+
"./browser.js",
|
|
91
|
+
"./src/index.js",
|
|
92
|
+
"./src/validation.js"
|
|
93
|
+
],
|
|
73
94
|
"publishConfig": {
|
|
74
95
|
"access": "public"
|
|
75
96
|
},
|
|
@@ -77,6 +98,8 @@
|
|
|
77
98
|
"directory": "tests/types"
|
|
78
99
|
},
|
|
79
100
|
"keywords": [
|
|
101
|
+
"mongodb",
|
|
102
|
+
"bson",
|
|
80
103
|
"schema",
|
|
81
104
|
"metaschema",
|
|
82
105
|
"metadata",
|
|
@@ -106,6 +129,7 @@
|
|
|
106
129
|
"ajv": "^8.20.0",
|
|
107
130
|
"ajv-formats": "^3.0.1",
|
|
108
131
|
"arktype": "^2.2.8",
|
|
132
|
+
"bson": "7.3.3",
|
|
109
133
|
"c8": "^12.0.0",
|
|
110
134
|
"cytoscape": "^3.34.3",
|
|
111
135
|
"cytoscape-cose-bilkent": "^4.1.0",
|
|
@@ -135,11 +159,12 @@
|
|
|
135
159
|
"test:nojit": "node --disallow-code-generation-from-strings --require ./tests/helpers/jit.js --test tests/unit/*.test.js",
|
|
136
160
|
"test:coverage": "c8 --all --include 'src/**' --check-coverage --lines 98 --statements 98 --branches 90 --functions 100 --reporter text --reporter lcov node --test tests/unit/*.test.js",
|
|
137
161
|
"test:types": "tsd",
|
|
138
|
-
"check:dts": "tsc --noEmit --strict --target es2022 --skipLibCheck false index.d.ts src/locales/en.d.ts src/locales/uk.d.ts src/generators/index.d.ts src/compile/index.d.ts src/model/index.d.ts src/stream/index.d.ts src/formats/index.d.ts",
|
|
162
|
+
"check:dts": "tsc --noEmit --strict --target es2022 --skipLibCheck false index.d.ts src/locales/en.d.ts src/locales/uk.d.ts src/generators/index.d.ts src/compile/index.d.ts src/model/index.d.ts src/stream/index.d.ts src/formats/index.d.ts src/derive/index.d.ts src/coerce/index.d.ts src/mongodb/index.d.ts src/definition/index.d.ts",
|
|
139
163
|
"lint": "oxlint index.js browser.js src tests scripts bench",
|
|
140
164
|
"format": "oxfmt index.js browser.js src tests scripts bench",
|
|
141
165
|
"format:check": "oxfmt --check index.js browser.js src tests scripts bench",
|
|
142
166
|
"size": "node scripts/size.js",
|
|
167
|
+
"size:gate": "node scripts/size.js --max-gzip 22 --max-gzip-generators 8 --max-gzip-compile 5 --max-gzip-model 13 --max-gzip-stream 1.5 --max-gzip-formats 5 --max-gzip-derive 2.5 --max-gzip-coerce 2 --max-gzip-mongodb 4 --max-gzip-definition 11",
|
|
143
168
|
"bench": "node bench/bench.js",
|
|
144
169
|
"bench:compare": "node bench/compare.js",
|
|
145
170
|
"bench:releases": "node bench/releases.js",
|