@revisium/schema-toolkit 0.21.0 → 0.21.2
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/dist/{chunk-SBO2UMI3.cjs → chunk-2PIMJSWJ.cjs} +0 -2
- package/dist/chunk-3MJP73IJ.js +1 -0
- package/dist/{chunk-62A5JJJ3.js → chunk-4U2RZHMX.js} +0 -2
- package/dist/{chunk-Q2UOTIMG.js → chunk-5DUMJHCA.js} +0 -2
- package/dist/{chunk-Z7M4ZGC6.cjs → chunk-7JWCZZPJ.cjs} +21 -23
- package/dist/{chunk-YFWOURZL.js → chunk-7PEC6ZYY.js} +0 -2
- package/dist/chunk-AV5EZUMZ.cjs +2 -0
- package/dist/{chunk-TMCRV6V5.js → chunk-AWFMSOHM.js} +0 -2
- package/dist/{chunk-X2VRR7V7.cjs → chunk-ERW5XVED.cjs} +0 -2
- package/dist/{chunk-XNFSFT7T.cjs → chunk-EVD5ZI55.cjs} +0 -2
- package/dist/{chunk-ZRNFSUOV.cjs → chunk-FL6PWPVJ.cjs} +0 -2
- package/dist/{chunk-TKMR6CQW.js → chunk-FTBRJODD.js} +0 -2
- package/dist/{chunk-R3MS2N4A.js → chunk-GJM63Q4K.js} +0 -2
- package/dist/{chunk-F4POD7AE.cjs → chunk-HJFM6E5M.cjs} +243 -90
- package/dist/{chunk-3DDUT57J.cjs → chunk-ITYABUR5.cjs} +0 -2
- package/dist/{chunk-BIBFHULN.js → chunk-IZMBM36H.js} +0 -2
- package/dist/chunk-J4RVO37K.cjs +2 -0
- package/dist/{chunk-UTSL45Q4.js → chunk-JLXX3SGF.js} +2 -4
- package/dist/{chunk-DRPNJ4YP.js → chunk-NO655UI5.js} +0 -2
- package/dist/chunk-OAUVP6CU.js +1 -0
- package/dist/{chunk-HH2LDPVV.cjs → chunk-ONW2OVNQ.cjs} +0 -2
- package/dist/{chunk-32FZHFIO.cjs → chunk-QKA7DJDN.cjs} +0 -2
- package/dist/{chunk-JWYYVKRT.cjs → chunk-RCCBUOGY.cjs} +0 -2
- package/dist/{chunk-MK3IKVZO.js → chunk-REVQG2NY.js} +176 -23
- package/dist/{chunk-IPL2CGVA.cjs → chunk-RQBW7ATZ.cjs} +0 -2
- package/dist/{chunk-WSPFHUHU.cjs → chunk-T3QQSHAC.cjs} +0 -2
- package/dist/{chunk-CGVYS7EK.cjs → chunk-VMELKZXD.cjs} +0 -2
- package/dist/{chunk-5VDDLW7U.js → chunk-WE4OLW5U.js} +0 -2
- package/dist/{chunk-JUOGJFTL.js → chunk-XKWWCXGB.js} +0 -2
- package/dist/{chunk-ZBPUTF3Q.js → chunk-ZPRBA4AQ.js} +0 -2
- package/dist/consts/index.cjs +4 -6
- package/dist/consts/index.js +2 -4
- package/dist/core/index.cjs +65 -67
- package/dist/core/index.js +4 -6
- package/dist/formula/index.cjs +7 -9
- package/dist/formula/index.js +1 -3
- package/dist/index.cjs +245 -247
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +15 -17
- package/dist/lib/index.cjs +51 -53
- package/dist/lib/index.js +7 -9
- package/dist/mocks/index.cjs +21 -23
- package/dist/mocks/index.js +2 -4
- package/dist/model/index.cjs +76 -78
- package/dist/model/index.d.cts +17 -4
- package/dist/model/index.d.ts +17 -4
- package/dist/model/index.js +4 -6
- package/dist/plugins/index.cjs +20 -22
- package/dist/plugins/index.js +2 -4
- package/dist/{typed-LSaUJayS.d.cts → typed-DjSH_5Vh.d.cts} +50 -3
- package/dist/{typed-BinPIf3R.d.ts → typed-KUia-LYN.d.ts} +50 -3
- package/dist/types/index.cjs +4 -6
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.js +2 -4
- package/dist/validation-schemas/index.cjs +18 -20
- package/dist/validation-schemas/index.js +1 -3
- package/package.json +1 -1
- package/dist/chunk-2NARA22J.js +0 -3
- package/dist/chunk-2NARA22J.js.map +0 -1
- package/dist/chunk-32FZHFIO.cjs.map +0 -1
- package/dist/chunk-3DDUT57J.cjs.map +0 -1
- package/dist/chunk-3FJZMVWA.js +0 -3
- package/dist/chunk-3FJZMVWA.js.map +0 -1
- package/dist/chunk-5VDDLW7U.js.map +0 -1
- package/dist/chunk-62A5JJJ3.js.map +0 -1
- package/dist/chunk-BIBFHULN.js.map +0 -1
- package/dist/chunk-BZWL424W.cjs +0 -4
- package/dist/chunk-BZWL424W.cjs.map +0 -1
- package/dist/chunk-CGVYS7EK.cjs.map +0 -1
- package/dist/chunk-DRPNJ4YP.js.map +0 -1
- package/dist/chunk-F4POD7AE.cjs.map +0 -1
- package/dist/chunk-HH2LDPVV.cjs.map +0 -1
- package/dist/chunk-IPL2CGVA.cjs.map +0 -1
- package/dist/chunk-JUOGJFTL.js.map +0 -1
- package/dist/chunk-JWYYVKRT.cjs.map +0 -1
- package/dist/chunk-L6HE7QPU.cjs +0 -4
- package/dist/chunk-L6HE7QPU.cjs.map +0 -1
- package/dist/chunk-MK3IKVZO.js.map +0 -1
- package/dist/chunk-Q2UOTIMG.js.map +0 -1
- package/dist/chunk-R3MS2N4A.js.map +0 -1
- package/dist/chunk-SBO2UMI3.cjs.map +0 -1
- package/dist/chunk-TKMR6CQW.js.map +0 -1
- package/dist/chunk-TMCRV6V5.js.map +0 -1
- package/dist/chunk-UTSL45Q4.js.map +0 -1
- package/dist/chunk-WSPFHUHU.cjs.map +0 -1
- package/dist/chunk-X2VRR7V7.cjs.map +0 -1
- package/dist/chunk-XNFSFT7T.cjs.map +0 -1
- package/dist/chunk-YFWOURZL.js.map +0 -1
- package/dist/chunk-Z7M4ZGC6.cjs.map +0 -1
- package/dist/chunk-ZBPUTF3Q.js.map +0 -1
- package/dist/chunk-ZRNFSUOV.cjs.map +0 -1
- package/dist/consts/index.cjs.map +0 -1
- package/dist/consts/index.js.map +0 -1
- package/dist/core/index.cjs.map +0 -1
- package/dist/core/index.js.map +0 -1
- package/dist/formula/index.cjs.map +0 -1
- package/dist/formula/index.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/index.cjs.map +0 -1
- package/dist/lib/index.js.map +0 -1
- package/dist/mocks/index.cjs.map +0 -1
- package/dist/mocks/index.js.map +0 -1
- package/dist/model/index.cjs.map +0 -1
- package/dist/model/index.js.map +0 -1
- package/dist/plugins/index.cjs.map +0 -1
- package/dist/plugins/index.js.map +0 -1
- package/dist/types/index.cjs.map +0 -1
- package/dist/types/index.js.map +0 -1
- package/dist/validation-schemas/index.cjs.map +0 -1
- package/dist/validation-schemas/index.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -144,5 +144,3 @@ var ajvFileSchema = {
|
|
|
144
144
|
};
|
|
145
145
|
|
|
146
146
|
export { ajvFileSchema, ajvRowCreatedAtSchema, ajvRowCreatedIdSchema, ajvRowHashSchema, ajvRowIdSchema, ajvRowPublishedAtSchema, ajvRowSchemaHashSchema, ajvRowUpdatedAtSchema, ajvRowVersionIdSchema, fileSchema, rowCreatedAtSchema, rowCreatedIdSchema, rowHashSchema, rowIdSchema, rowPublishedAtSchema, rowSchemaHashSchema, rowUpdatedAtSchema, rowVersionIdSchema };
|
|
147
|
-
//# sourceMappingURL=chunk-62A5JJJ3.js.map
|
|
148
|
-
//# sourceMappingURL=chunk-62A5JJJ3.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkITYABUR5_cjs = require('./chunk-ITYABUR5.cjs');
|
|
4
|
+
var chunkONW2OVNQ_cjs = require('./chunk-ONW2OVNQ.cjs');
|
|
5
5
|
|
|
6
6
|
// src/lib/createJsonSchemaStore.ts
|
|
7
7
|
var createJsonSchemaStore = (schema, refs = {}) => {
|
|
@@ -20,7 +20,7 @@ var createJsonSchemaStore = (schema, refs = {}) => {
|
|
|
20
20
|
return objectStore;
|
|
21
21
|
} else if (schema.type === "array") {
|
|
22
22
|
const itemsStore = createJsonSchemaStore(schema.items, refs);
|
|
23
|
-
const arrayStore = new
|
|
23
|
+
const arrayStore = new chunkONW2OVNQ_cjs.JsonArrayStore(itemsStore);
|
|
24
24
|
saveSharedFields(arrayStore, schema);
|
|
25
25
|
return arrayStore;
|
|
26
26
|
} else {
|
|
@@ -31,7 +31,7 @@ var createJsonSchemaStore = (schema, refs = {}) => {
|
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
var createJsonObjectSchemaStore = (value, refs) => {
|
|
34
|
-
const store = new
|
|
34
|
+
const store = new chunkONW2OVNQ_cjs.JsonObjectStore();
|
|
35
35
|
for (const requiredField of value.required) {
|
|
36
36
|
if (!value.properties[requiredField]) {
|
|
37
37
|
throw new Error(
|
|
@@ -46,7 +46,7 @@ var createJsonObjectSchemaStore = (value, refs) => {
|
|
|
46
46
|
};
|
|
47
47
|
var createPrimitiveStoreBySchema = (schema) => {
|
|
48
48
|
if (schema.type === "string") {
|
|
49
|
-
const stringStore = new
|
|
49
|
+
const stringStore = new chunkONW2OVNQ_cjs.JsonStringStore();
|
|
50
50
|
stringStore.foreignKey = schema.foreignKey;
|
|
51
51
|
stringStore.format = schema.format;
|
|
52
52
|
stringStore.enum = schema.enum;
|
|
@@ -55,11 +55,11 @@ var createPrimitiveStoreBySchema = (schema) => {
|
|
|
55
55
|
stringStore["x-formula"] = schema["x-formula"];
|
|
56
56
|
return stringStore;
|
|
57
57
|
} else if (schema.type === "number") {
|
|
58
|
-
const numberStore = new
|
|
58
|
+
const numberStore = new chunkONW2OVNQ_cjs.JsonNumberStore();
|
|
59
59
|
numberStore["x-formula"] = schema["x-formula"];
|
|
60
60
|
return numberStore;
|
|
61
61
|
} else if (schema.type === "boolean") {
|
|
62
|
-
const booleanStore = new
|
|
62
|
+
const booleanStore = new chunkONW2OVNQ_cjs.JsonBooleanStore();
|
|
63
63
|
booleanStore["x-formula"] = schema["x-formula"];
|
|
64
64
|
return booleanStore;
|
|
65
65
|
} else {
|
|
@@ -610,13 +610,13 @@ var getJsonValueStoreByPath = (root, path) => {
|
|
|
610
610
|
const segments = parsePath(path);
|
|
611
611
|
let current = root;
|
|
612
612
|
for (const seg of segments) {
|
|
613
|
-
if (current instanceof
|
|
613
|
+
if (current instanceof chunkONW2OVNQ_cjs.JsonObjectValueStore) {
|
|
614
614
|
const next = current.value[String(seg)];
|
|
615
615
|
if (!next) {
|
|
616
616
|
throw new Error(`Path not found at segment "${seg}"`);
|
|
617
617
|
}
|
|
618
618
|
current = next;
|
|
619
|
-
} else if (current instanceof
|
|
619
|
+
} else if (current instanceof chunkONW2OVNQ_cjs.JsonArrayValueStore) {
|
|
620
620
|
if (typeof seg !== "number") {
|
|
621
621
|
throw new Error(`Invalid array index "${seg}"`);
|
|
622
622
|
}
|
|
@@ -646,15 +646,15 @@ var replaceForeignKeyValue = (options) => {
|
|
|
646
646
|
|
|
647
647
|
// src/lib/resolveRefs.ts
|
|
648
648
|
var pluginRefs = {
|
|
649
|
-
["urn:jsonschema:io:revisium:row-id-schema:1.0.0" /* RowId */]:
|
|
650
|
-
["urn:jsonschema:io:revisium:row-version-id-schema:1.0.0" /* RowVersionId */]:
|
|
651
|
-
["urn:jsonschema:io:revisium:row-created-id-schema:1.0.0" /* RowCreatedId */]:
|
|
652
|
-
["urn:jsonschema:io:revisium:row-created-at-schema:1.0.0" /* RowCreatedAt */]:
|
|
653
|
-
["urn:jsonschema:io:revisium:row-published-at-schema:1.0.0" /* RowPublishedAt */]:
|
|
654
|
-
["urn:jsonschema:io:revisium:row-updated-at-schema:1.0.0" /* RowUpdatedAt */]:
|
|
655
|
-
["urn:jsonschema:io:revisium:row-hash-schema:1.0.0" /* RowHash */]:
|
|
656
|
-
["urn:jsonschema:io:revisium:row-schema-hash-schema:1.0.0" /* RowSchemaHash */]:
|
|
657
|
-
["urn:jsonschema:io:revisium:file-schema:1.0.0" /* File */]:
|
|
649
|
+
["urn:jsonschema:io:revisium:row-id-schema:1.0.0" /* RowId */]: chunkITYABUR5_cjs.rowIdSchema,
|
|
650
|
+
["urn:jsonschema:io:revisium:row-version-id-schema:1.0.0" /* RowVersionId */]: chunkITYABUR5_cjs.rowVersionIdSchema,
|
|
651
|
+
["urn:jsonschema:io:revisium:row-created-id-schema:1.0.0" /* RowCreatedId */]: chunkITYABUR5_cjs.rowCreatedIdSchema,
|
|
652
|
+
["urn:jsonschema:io:revisium:row-created-at-schema:1.0.0" /* RowCreatedAt */]: chunkITYABUR5_cjs.rowCreatedAtSchema,
|
|
653
|
+
["urn:jsonschema:io:revisium:row-published-at-schema:1.0.0" /* RowPublishedAt */]: chunkITYABUR5_cjs.rowPublishedAtSchema,
|
|
654
|
+
["urn:jsonschema:io:revisium:row-updated-at-schema:1.0.0" /* RowUpdatedAt */]: chunkITYABUR5_cjs.rowUpdatedAtSchema,
|
|
655
|
+
["urn:jsonschema:io:revisium:row-hash-schema:1.0.0" /* RowHash */]: chunkITYABUR5_cjs.rowHashSchema,
|
|
656
|
+
["urn:jsonschema:io:revisium:row-schema-hash-schema:1.0.0" /* RowSchemaHash */]: chunkITYABUR5_cjs.rowSchemaHashSchema,
|
|
657
|
+
["urn:jsonschema:io:revisium:file-schema:1.0.0" /* File */]: chunkITYABUR5_cjs.fileSchema
|
|
658
658
|
};
|
|
659
659
|
var resolveRefs = (schema) => {
|
|
660
660
|
const store = createJsonSchemaStore(schema, pluginRefs);
|
|
@@ -700,7 +700,7 @@ var SchemaTable = class {
|
|
|
700
700
|
return this.store.getPlainSchema();
|
|
701
701
|
}
|
|
702
702
|
addRow(rowId, data) {
|
|
703
|
-
const row =
|
|
703
|
+
const row = chunkONW2OVNQ_cjs.createJsonValueStore(this.store, rowId, data);
|
|
704
704
|
this.rows.set(rowId, row);
|
|
705
705
|
}
|
|
706
706
|
getRow(id) {
|
|
@@ -717,14 +717,14 @@ var SchemaTable = class {
|
|
|
717
717
|
}));
|
|
718
718
|
}
|
|
719
719
|
migrateRows(nextStore) {
|
|
720
|
-
const transformation =
|
|
720
|
+
const transformation = chunkONW2OVNQ_cjs.getTransformation(this.store, nextStore);
|
|
721
721
|
if (transformation) {
|
|
722
722
|
for (const [rowId, row] of this.rows) {
|
|
723
723
|
const rawNextValue = transformation(
|
|
724
724
|
row.getPlainValue(),
|
|
725
725
|
nextStore.default
|
|
726
726
|
);
|
|
727
|
-
const nextRow =
|
|
727
|
+
const nextRow = chunkONW2OVNQ_cjs.createJsonValueStore(nextStore, rowId, rawNextValue);
|
|
728
728
|
this.rows.set(rowId, nextRow);
|
|
729
729
|
}
|
|
730
730
|
}
|
|
@@ -764,5 +764,3 @@ exports.setValueByPath = setValueByPath;
|
|
|
764
764
|
exports.traverseStore = traverseStore;
|
|
765
765
|
exports.traverseValue = traverseValue;
|
|
766
766
|
exports.validateJsonFieldName = validateJsonFieldName;
|
|
767
|
-
//# sourceMappingURL=chunk-Z7M4ZGC6.cjs.map
|
|
768
|
-
//# sourceMappingURL=chunk-Z7M4ZGC6.cjs.map
|
|
@@ -2679,5 +2679,3 @@ function buildArrayItemsPath(parentPath) {
|
|
|
2679
2679
|
}
|
|
2680
2680
|
|
|
2681
2681
|
export { AbstractBasePath, ChangeCoalescer, ChangeCollector, CompositeRule, EMPTY_METADATA, EMPTY_PATH, EnumValidator, FIELD_NAME_ERROR_MESSAGE, ForeignKeyValidator, FormulaError, FormulaPathBuilder, FormulaSerializer, ItemsSegment, MaxLengthValidator, MaximumValidator, MinLengthValidator, MinimumValidator, NULL_NODE, NodePathIndex, PatchBuilder, PatchEnricher, PatchGenerator, PatternValidator, PropertySegment, RequiredValidator, ResolvedDependency, SchemaDiff, SchemaPropertyRule, SchemaSerializer, SchemaTruthyRule, ValidationEngine, ValidatorRegistry, ValidatorResolver, areNodesContentEqual, areNodesEqual, coalesceChanges, collectChanges, createArrayNode, createBooleanNode, createDefaultValidatorRegistry, createMobxProvider, createNumberNode, createObjectNode, createPath, createRefNode, createSchemaTree, createStringNode, createValidationEngine, isValidFieldName, jsonPointerToPath, jsonPointerToSegments, jsonPointerToSimplePath, makeAutoObservable, makeObservable, observable, reaction, resetReactivityProvider, runInAction, setReactivityProvider, validateFormulas, validateSchema };
|
|
2682
|
-
//# sourceMappingURL=chunk-TMCRV6V5.js.map
|
|
2683
|
-
//# sourceMappingURL=chunk-TMCRV6V5.js.map
|
|
@@ -678,5 +678,3 @@ exports.evaluateFormulas = evaluateFormulas;
|
|
|
678
678
|
exports.extractSchemaFormulas = extractSchemaFormulas;
|
|
679
679
|
exports.validateFormulaAgainstSchema = validateFormulaAgainstSchema;
|
|
680
680
|
exports.validateSchemaFormulas = validateSchemaFormulas;
|
|
681
|
-
//# sourceMappingURL=chunk-X2VRR7V7.cjs.map
|
|
682
|
-
//# sourceMappingURL=chunk-X2VRR7V7.cjs.map
|
|
@@ -759,5 +759,3 @@ var JsonArrayValueStore = class {
|
|
|
759
759
|
};
|
|
760
760
|
|
|
761
761
|
export { JsonArrayStore, JsonArrayValueStore, JsonBooleanStore, JsonBooleanValueStore, JsonNumberStore, JsonNumberValueStore, JsonObjectStore, JsonObjectValueStore, JsonStringStore, JsonStringValueStore, addSharedFieldsFromState, createJsonArrayValueStore, createJsonObjectValueStore, createJsonValueStore, createPrimitiveValueStore, equal, fromArrayToObject, fromArrayTransformation, fromBooleanToNumber, fromBooleanToString, fromNumberToBoolean, fromNumberToString, fromObjectToArray, fromObjectToPrimitive, fromPrimitiveToObject, fromStringToBoolean, fromStringToNumber, getTransformation, toArrayTransformation };
|
|
762
|
-
//# sourceMappingURL=chunk-TKMR6CQW.js.map
|
|
763
|
-
//# sourceMappingURL=chunk-TKMR6CQW.js.map
|
|
@@ -668,5 +668,3 @@ function setValueByPath(obj, path, value) {
|
|
|
668
668
|
}
|
|
669
669
|
|
|
670
670
|
export { collectFormulaNodes, evaluateFormulas, extractSchemaFormulas, validateFormulaAgainstSchema, validateSchemaFormulas };
|
|
671
|
-
//# sourceMappingURL=chunk-R3MS2N4A.js.map
|
|
672
|
-
//# sourceMappingURL=chunk-R3MS2N4A.js.map
|