@revisium/schema-toolkit 0.20.2 → 0.21.1

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.
Files changed (140) hide show
  1. package/README.md +216 -0
  2. package/dist/FormulaPathBuilder-BUJRR0Am.d.cts +48 -0
  3. package/dist/FormulaPathBuilder-QR0htn-e.d.ts +48 -0
  4. package/dist/{chunk-VGADCIBG.cjs → chunk-2PIMJSWJ.cjs} +12 -8
  5. package/dist/chunk-3MJP73IJ.js +1 -0
  6. package/dist/{chunk-LLHQWDAR.js → chunk-4U2RZHMX.js} +19 -21
  7. package/dist/{chunk-Q2UOTIMG.js → chunk-5DUMJHCA.js} +0 -2
  8. package/dist/{chunk-V6JTSET2.cjs → chunk-7JWCZZPJ.cjs} +49 -51
  9. package/dist/{chunk-YFWOURZL.js → chunk-7PEC6ZYY.js} +0 -2
  10. package/dist/chunk-AV5EZUMZ.cjs +2 -0
  11. package/dist/{chunk-3JZKQWQH.js → chunk-AWFMSOHM.js} +5 -7
  12. package/dist/{chunk-X2VRR7V7.cjs → chunk-ERW5XVED.cjs} +0 -2
  13. package/dist/{chunk-XNFSFT7T.cjs → chunk-EVD5ZI55.cjs} +0 -2
  14. package/dist/{chunk-ZRNFSUOV.cjs → chunk-FL6PWPVJ.cjs} +0 -2
  15. package/dist/{chunk-55AMH44G.js → chunk-FTBRJODD.js} +28 -30
  16. package/dist/{chunk-R3MS2N4A.js → chunk-GJM63Q4K.js} +0 -2
  17. package/dist/{chunk-U5YDA3LA.js → chunk-HFMZITNE.js} +238 -31
  18. package/dist/{chunk-EGC32GPY.cjs → chunk-ITYABUR5.cjs} +19 -21
  19. package/dist/{chunk-R4CFU33U.js → chunk-IZMBM36H.js} +10 -9
  20. package/dist/chunk-J4RVO37K.cjs +2 -0
  21. package/dist/{chunk-QEV4Q4TR.js → chunk-JLXX3SGF.js} +30 -32
  22. package/dist/{chunk-MPF6VCB5.js → chunk-NO655UI5.js} +0 -2
  23. package/dist/chunk-OAUVP6CU.js +1 -0
  24. package/dist/{chunk-B3T6YB2D.cjs → chunk-ONW2OVNQ.cjs} +28 -30
  25. package/dist/{chunk-32FZHFIO.cjs → chunk-QKA7DJDN.cjs} +0 -2
  26. package/dist/{chunk-46ME2TAU.cjs → chunk-RCCBUOGY.cjs} +5 -7
  27. package/dist/{chunk-IPL2CGVA.cjs → chunk-RQBW7ATZ.cjs} +0 -2
  28. package/dist/{chunk-FZ2MS4Q5.cjs → chunk-S5SRXND6.cjs} +307 -97
  29. package/dist/{chunk-WSPFHUHU.cjs → chunk-T3QQSHAC.cjs} +0 -2
  30. package/dist/{chunk-J6SCHJKG.cjs → chunk-VMELKZXD.cjs} +0 -2
  31. package/dist/{chunk-5VDDLW7U.js → chunk-WE4OLW5U.js} +0 -2
  32. package/dist/{chunk-JUOGJFTL.js → chunk-XKWWCXGB.js} +0 -2
  33. package/dist/{chunk-ZBPUTF3Q.js → chunk-ZPRBA4AQ.js} +0 -2
  34. package/dist/consts/index.cjs +4 -6
  35. package/dist/consts/index.js +2 -4
  36. package/dist/core/index.cjs +65 -69
  37. package/dist/core/index.d.cts +6 -4
  38. package/dist/core/index.d.ts +6 -4
  39. package/dist/core/index.js +4 -8
  40. package/dist/formula/index.cjs +7 -9
  41. package/dist/formula/index.d.cts +1 -1
  42. package/dist/formula/index.d.ts +1 -1
  43. package/dist/formula/index.js +1 -3
  44. package/dist/index.cjs +269 -248
  45. package/dist/index.d.cts +8 -7
  46. package/dist/index.d.ts +8 -7
  47. package/dist/index.js +15 -18
  48. package/dist/{json-patch.types-DY7k9hxy.d.ts → json-patch.types-BpVnp08Z.d.ts} +1 -1
  49. package/dist/{json-patch.types-Cu0Medki.d.cts → json-patch.types-eM6pYC2P.d.cts} +1 -1
  50. package/dist/{json-string.store-C58zbl31.d.ts → json-string.store-DfdLcgnM.d.ts} +11 -11
  51. package/dist/{json-string.store-DuI--IL2.d.cts → json-string.store-cAOADo23.d.cts} +11 -11
  52. package/dist/lib/index.cjs +51 -54
  53. package/dist/lib/index.d.cts +3 -3
  54. package/dist/lib/index.d.ts +3 -3
  55. package/dist/lib/index.js +7 -10
  56. package/dist/mocks/index.cjs +30 -21
  57. package/dist/mocks/index.d.cts +22 -8
  58. package/dist/mocks/index.d.ts +22 -8
  59. package/dist/mocks/index.js +2 -5
  60. package/dist/model/index.cjs +85 -78
  61. package/dist/model/index.d.cts +171 -346
  62. package/dist/model/index.d.ts +171 -346
  63. package/dist/model/index.js +4 -9
  64. package/dist/plugins/index.cjs +20 -23
  65. package/dist/plugins/index.d.cts +10 -10
  66. package/dist/plugins/index.d.ts +10 -10
  67. package/dist/plugins/index.js +2 -5
  68. package/dist/{schema.types-B5OgKLpV.d.cts → schema.types-On_VGw2m.d.cts} +7 -6
  69. package/dist/{schema.types-B5OgKLpV.d.ts → schema.types-On_VGw2m.d.ts} +7 -6
  70. package/dist/typed-BRZhUqGG.d.ts +502 -0
  71. package/dist/typed-Cri0IYAn.d.cts +502 -0
  72. package/dist/types/index.cjs +6 -9
  73. package/dist/types/index.d.cts +7 -5
  74. package/dist/types/index.d.ts +7 -5
  75. package/dist/types/index.js +2 -5
  76. package/dist/{FormulaPathBuilder-DwlKOvVB.d.ts → types-BIvIURgy.d.cts} +37 -82
  77. package/dist/{FormulaPathBuilder-D9LkBcSv.d.cts → types-C_pTFtSY.d.ts} +37 -82
  78. package/dist/validation-schemas/index.cjs +18 -20
  79. package/dist/validation-schemas/index.js +1 -3
  80. package/package.json +1 -1
  81. package/dist/chunk-32FZHFIO.cjs.map +0 -1
  82. package/dist/chunk-3FJZMVWA.js +0 -3
  83. package/dist/chunk-3FJZMVWA.js.map +0 -1
  84. package/dist/chunk-3IKI64T2.js +0 -3
  85. package/dist/chunk-3IKI64T2.js.map +0 -1
  86. package/dist/chunk-3JZKQWQH.js.map +0 -1
  87. package/dist/chunk-46ME2TAU.cjs.map +0 -1
  88. package/dist/chunk-55AMH44G.js.map +0 -1
  89. package/dist/chunk-5VDDLW7U.js.map +0 -1
  90. package/dist/chunk-B3T6YB2D.cjs.map +0 -1
  91. package/dist/chunk-EGC32GPY.cjs.map +0 -1
  92. package/dist/chunk-FZ2MS4Q5.cjs.map +0 -1
  93. package/dist/chunk-G6ZKEVVU.cjs +0 -4
  94. package/dist/chunk-G6ZKEVVU.cjs.map +0 -1
  95. package/dist/chunk-IPL2CGVA.cjs.map +0 -1
  96. package/dist/chunk-J6SCHJKG.cjs.map +0 -1
  97. package/dist/chunk-JUOGJFTL.js.map +0 -1
  98. package/dist/chunk-L6HE7QPU.cjs +0 -4
  99. package/dist/chunk-L6HE7QPU.cjs.map +0 -1
  100. package/dist/chunk-LLHQWDAR.js.map +0 -1
  101. package/dist/chunk-MPF6VCB5.js.map +0 -1
  102. package/dist/chunk-NY3H6C7K.js +0 -3
  103. package/dist/chunk-NY3H6C7K.js.map +0 -1
  104. package/dist/chunk-Q2UOTIMG.js.map +0 -1
  105. package/dist/chunk-QEV4Q4TR.js.map +0 -1
  106. package/dist/chunk-R3MS2N4A.js.map +0 -1
  107. package/dist/chunk-R4CFU33U.js.map +0 -1
  108. package/dist/chunk-TBFTADML.cjs +0 -4
  109. package/dist/chunk-TBFTADML.cjs.map +0 -1
  110. package/dist/chunk-U5YDA3LA.js.map +0 -1
  111. package/dist/chunk-V6JTSET2.cjs.map +0 -1
  112. package/dist/chunk-VGADCIBG.cjs.map +0 -1
  113. package/dist/chunk-WSPFHUHU.cjs.map +0 -1
  114. package/dist/chunk-X2VRR7V7.cjs.map +0 -1
  115. package/dist/chunk-XNFSFT7T.cjs.map +0 -1
  116. package/dist/chunk-YFWOURZL.js.map +0 -1
  117. package/dist/chunk-ZBPUTF3Q.js.map +0 -1
  118. package/dist/chunk-ZRNFSUOV.cjs.map +0 -1
  119. package/dist/consts/index.cjs.map +0 -1
  120. package/dist/consts/index.js.map +0 -1
  121. package/dist/core/index.cjs.map +0 -1
  122. package/dist/core/index.js.map +0 -1
  123. package/dist/formula/index.cjs.map +0 -1
  124. package/dist/formula/index.js.map +0 -1
  125. package/dist/index.cjs.map +0 -1
  126. package/dist/index.js.map +0 -1
  127. package/dist/json-value-patch.types-CgiEpchp.d.ts +0 -24
  128. package/dist/json-value-patch.types-LEJxcIWR.d.cts +0 -24
  129. package/dist/lib/index.cjs.map +0 -1
  130. package/dist/lib/index.js.map +0 -1
  131. package/dist/mocks/index.cjs.map +0 -1
  132. package/dist/mocks/index.js.map +0 -1
  133. package/dist/model/index.cjs.map +0 -1
  134. package/dist/model/index.js.map +0 -1
  135. package/dist/plugins/index.cjs.map +0 -1
  136. package/dist/plugins/index.js.map +0 -1
  137. package/dist/types/index.cjs.map +0 -1
  138. package/dist/types/index.js.map +0 -1
  139. package/dist/validation-schemas/index.cjs.map +0 -1
  140. package/dist/validation-schemas/index.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkEGC32GPY_cjs = require('./chunk-EGC32GPY.cjs');
4
- var chunkB3T6YB2D_cjs = require('./chunk-B3T6YB2D.cjs');
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 = {}) => {
@@ -14,13 +14,13 @@ var createJsonSchemaStore = (schema, refs = {}) => {
14
14
  saveSharedFields(refStore, schema);
15
15
  refStore.$ref = schema.$ref;
16
16
  return refStore;
17
- } else if (schema.type === "object" /* Object */) {
17
+ } else if (schema.type === "object") {
18
18
  const objectStore = createJsonObjectSchemaStore(schema, refs);
19
19
  saveSharedFields(objectStore, schema);
20
20
  return objectStore;
21
- } else if (schema.type === "array" /* Array */) {
21
+ } else if (schema.type === "array") {
22
22
  const itemsStore = createJsonSchemaStore(schema.items, refs);
23
- const arrayStore = new chunkB3T6YB2D_cjs.JsonArrayStore(itemsStore);
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 chunkB3T6YB2D_cjs.JsonObjectStore();
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(
@@ -45,8 +45,8 @@ var createJsonObjectSchemaStore = (value, refs) => {
45
45
  return store;
46
46
  };
47
47
  var createPrimitiveStoreBySchema = (schema) => {
48
- if (schema.type === "string" /* String */) {
49
- const stringStore = new chunkB3T6YB2D_cjs.JsonStringStore();
48
+ if (schema.type === "string") {
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;
@@ -54,12 +54,12 @@ var createPrimitiveStoreBySchema = (schema) => {
54
54
  stringStore.pattern = schema.pattern;
55
55
  stringStore["x-formula"] = schema["x-formula"];
56
56
  return stringStore;
57
- } else if (schema.type === "number" /* Number */) {
58
- const numberStore = new chunkB3T6YB2D_cjs.JsonNumberStore();
57
+ } else if (schema.type === "number") {
58
+ const numberStore = new chunkONW2OVNQ_cjs.JsonNumberStore();
59
59
  numberStore["x-formula"] = schema["x-formula"];
60
60
  return numberStore;
61
- } else if (schema.type === "boolean" /* Boolean */) {
62
- const booleanStore = new chunkB3T6YB2D_cjs.JsonBooleanStore();
61
+ } else if (schema.type === "boolean") {
62
+ const booleanStore = new chunkONW2OVNQ_cjs.JsonBooleanStore();
63
63
  booleanStore["x-formula"] = schema["x-formula"];
64
64
  return booleanStore;
65
65
  } else {
@@ -88,7 +88,7 @@ var getJsonSchemaStoreByPath = (store, path) => {
88
88
  let currentToken = tokens.shift();
89
89
  let currentPath = "";
90
90
  while (currentToken) {
91
- if (currentStore.type === "object" /* Object */) {
91
+ if (currentStore.type === "object") {
92
92
  if (currentToken !== "properties") {
93
93
  throw new Error(
94
94
  `Expected "${currentPath}/properties/*" instead of ${currentPath}/${currentToken}/*`
@@ -106,7 +106,7 @@ var getJsonSchemaStoreByPath = (store, path) => {
106
106
  currentStore = foundCurrentStore;
107
107
  currentPath = `${currentPath}/${currentToken}`;
108
108
  currentToken = tokens.shift();
109
- } else if (currentStore.type === "array" /* Array */) {
109
+ } else if (currentStore.type === "array") {
110
110
  if (currentToken !== "items") {
111
111
  throw new Error(
112
112
  `Expected "${currentPath}/items/*" instead of ${currentPath}/${currentToken}/*`
@@ -178,9 +178,9 @@ var applyReplacePatch = (store, patch, refs = {}) => {
178
178
  if (!parent) {
179
179
  return patchStore;
180
180
  }
181
- if (parent.type === "object" /* Object */) {
181
+ if (parent.type === "object") {
182
182
  parent.migratePropertyWithStore(foundStore.name, patchStore);
183
- } else if (parent.type === "array" /* Array */) {
183
+ } else if (parent.type === "array") {
184
184
  parent.migrateItems(patchStore);
185
185
  } else {
186
186
  throw new Error("Invalid parent");
@@ -193,7 +193,7 @@ var applyRemovePatch = (rootStore, patch) => {
193
193
  if (!parent) {
194
194
  throw new Error("Parent does not exist");
195
195
  }
196
- if (parent.type !== "object" /* Object */) {
196
+ if (parent.type !== "object") {
197
197
  throw new Error("Cannot remove from non-object");
198
198
  }
199
199
  parent.removeProperty(foundStore.name);
@@ -205,7 +205,7 @@ var applyAddPatch = (rootStore, patch, refs = {}) => {
205
205
  if (!foundParent) {
206
206
  throw new Error("Parent does not exist");
207
207
  }
208
- if (foundParent.type !== "object" /* Object */) {
208
+ if (foundParent.type !== "object") {
209
209
  throw new Error("Cannot add to non-object");
210
210
  }
211
211
  if (foundParent.getProperty(field)) {
@@ -231,15 +231,15 @@ var applyMovePatch = (store, patch) => {
231
231
  if (!foundFromParent || !foundToParent) {
232
232
  throw new Error("Cannot move from or to non-existent parent");
233
233
  }
234
- if (foundFromParent.type !== "object" /* Object */) {
234
+ if (foundFromParent.type !== "object") {
235
235
  throw new Error("Cannot move from non-object parent");
236
236
  }
237
237
  const foundFromField = getJsonSchemaStoreByPath(store, patch.from);
238
- const isMovedPropertyInSameParentPatch = foundFromParent === foundToParent && foundFromParent.type === "object" /* Object */ && foundFromParent.getProperty(fromField);
238
+ const isMovedPropertyInSameParentPatch = foundFromParent === foundToParent && foundFromParent.type === "object" && foundFromParent.getProperty(fromField);
239
239
  if (isMovedPropertyInSameParentPatch) {
240
240
  return foundFromParent.changeName(fromField, toField);
241
241
  }
242
- if (foundToParent.type === "object" /* Object */) {
242
+ if (foundToParent.type === "object") {
243
243
  if (foundToParent.getProperty(toField)) {
244
244
  foundToParent.removeProperty(toField);
245
245
  }
@@ -247,7 +247,7 @@ var applyMovePatch = (store, patch) => {
247
247
  foundFromParent.removeProperty(fromField);
248
248
  return;
249
249
  }
250
- if (foundToParent.type === "array" /* Array */) {
250
+ if (foundToParent.type === "array") {
251
251
  foundFromParent.removeProperty(fromField);
252
252
  foundToParent.replaceItems(foundFromField);
253
253
  return;
@@ -260,9 +260,9 @@ var getDBJsonPathByJsonSchemaStore = (store) => {
260
260
  let node = store;
261
261
  let path = "";
262
262
  while (node.parent) {
263
- if (node.parent.type === "object" /* Object */) {
263
+ if (node.parent.type === "object") {
264
264
  path = `.${node.name}${path}`;
265
- } else if (node.parent.type === "array" /* Array */) {
265
+ } else if (node.parent.type === "array") {
266
266
  path = `[*]${path}`;
267
267
  }
268
268
  node = node.parent;
@@ -278,9 +278,9 @@ var getPathByStore = (store) => {
278
278
  let node = store;
279
279
  let path = "";
280
280
  while (node.parent) {
281
- if (node.parent.type === "object" /* Object */) {
281
+ if (node.parent.type === "object") {
282
282
  path = `/properties/${node.name}${path}`;
283
- } else if (node.parent.type === "array" /* Array */) {
283
+ } else if (node.parent.type === "array") {
284
284
  path = `/items${path}`;
285
285
  }
286
286
  node = node.parent;
@@ -294,11 +294,11 @@ var getPathByStore = (store) => {
294
294
  // src/lib/traverseStore.ts
295
295
  var traverseStore = (store, callback) => {
296
296
  callback(store);
297
- if (store.type === "object" /* Object */) {
297
+ if (store.type === "object") {
298
298
  Object.values(store.properties).forEach((item) => {
299
299
  traverseStore(item, callback);
300
300
  });
301
- } else if (store.type === "array" /* Array */) {
301
+ } else if (store.type === "array") {
302
302
  traverseStore(store.items, callback);
303
303
  }
304
304
  };
@@ -307,7 +307,7 @@ var traverseStore = (store, callback) => {
307
307
  var getForeignKeyPatchesFromSchema = (store, options) => {
308
308
  const stores = [];
309
309
  traverseStore(store, (item) => {
310
- if (item.type === "string" /* String */ && item.foreignKey === options.tableId) {
310
+ if (item.type === "string" && item.foreignKey === options.tableId) {
311
311
  item.foreignKey = options.nextTableId;
312
312
  const patch = {
313
313
  op: "replace",
@@ -324,7 +324,7 @@ var getForeignKeyPatchesFromSchema = (store, options) => {
324
324
  var getForeignKeysFromSchema = (store) => {
325
325
  const foreignKeys = /* @__PURE__ */ new Set();
326
326
  traverseStore(store, (item) => {
327
- if (item.type === "string" /* String */ && item.foreignKey) {
327
+ if (item.type === "string" && item.foreignKey) {
328
328
  foreignKeys.add(item.foreignKey);
329
329
  }
330
330
  });
@@ -334,11 +334,11 @@ var getForeignKeysFromSchema = (store) => {
334
334
  // src/lib/traverseValue.ts
335
335
  var traverseValue = (store, callback) => {
336
336
  callback(store);
337
- if (store.type === "object" /* Object */) {
337
+ if (store.type === "object") {
338
338
  Object.values(store.value).forEach((item) => {
339
339
  traverseValue(item, callback);
340
340
  });
341
- } else if (store.type === "array" /* Array */) {
341
+ } else if (store.type === "array") {
342
342
  store.value.forEach((itemValue) => {
343
343
  traverseValue(itemValue, callback);
344
344
  });
@@ -349,7 +349,7 @@ var traverseValue = (store, callback) => {
349
349
  var getForeignKeysFromValue = (value) => {
350
350
  const foreignKeys = /* @__PURE__ */ new Map();
351
351
  traverseValue(value, (item) => {
352
- if (item.type === "string" /* String */ && item.foreignKey) {
352
+ if (item.type === "string" && item.foreignKey) {
353
353
  let tableForeignKey = foreignKeys.get(item.foreignKey);
354
354
  if (!tableForeignKey) {
355
355
  tableForeignKey = /* @__PURE__ */ new Set();
@@ -369,7 +369,7 @@ var getInvalidFieldNamesInSchema = (schema, refs = {}) => {
369
369
  const schemaStore = createJsonSchemaStore(schema, refs);
370
370
  const invalidFields = [];
371
371
  traverseStore(schemaStore, (item) => {
372
- if (item.parent?.type === "object" /* Object */) {
372
+ if (item.parent?.type === "object") {
373
373
  if (!validateJsonFieldName(item.name)) {
374
374
  invalidFields.push(item);
375
375
  }
@@ -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 chunkB3T6YB2D_cjs.JsonObjectValueStore) {
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 chunkB3T6YB2D_cjs.JsonArrayValueStore) {
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
  }
@@ -636,7 +636,7 @@ var getJsonValueStoreByPath = (root, path) => {
636
636
  var replaceForeignKeyValue = (options) => {
637
637
  let wasUpdated = false;
638
638
  traverseValue(options.valueStore, (item) => {
639
- if (item.type === "string" /* String */ && item.foreignKey === options.foreignKey && item.value === options.value) {
639
+ if (item.type === "string" && item.foreignKey === options.foreignKey && item.value === options.value) {
640
640
  item.value = options.nextValue;
641
641
  wasUpdated = true;
642
642
  }
@@ -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 */]: chunkEGC32GPY_cjs.rowIdSchema,
650
- ["urn:jsonschema:io:revisium:row-version-id-schema:1.0.0" /* RowVersionId */]: chunkEGC32GPY_cjs.rowVersionIdSchema,
651
- ["urn:jsonschema:io:revisium:row-created-id-schema:1.0.0" /* RowCreatedId */]: chunkEGC32GPY_cjs.rowCreatedIdSchema,
652
- ["urn:jsonschema:io:revisium:row-created-at-schema:1.0.0" /* RowCreatedAt */]: chunkEGC32GPY_cjs.rowCreatedAtSchema,
653
- ["urn:jsonschema:io:revisium:row-published-at-schema:1.0.0" /* RowPublishedAt */]: chunkEGC32GPY_cjs.rowPublishedAtSchema,
654
- ["urn:jsonschema:io:revisium:row-updated-at-schema:1.0.0" /* RowUpdatedAt */]: chunkEGC32GPY_cjs.rowUpdatedAtSchema,
655
- ["urn:jsonschema:io:revisium:row-hash-schema:1.0.0" /* RowHash */]: chunkEGC32GPY_cjs.rowHashSchema,
656
- ["urn:jsonschema:io:revisium:row-schema-hash-schema:1.0.0" /* RowSchemaHash */]: chunkEGC32GPY_cjs.rowSchemaHashSchema,
657
- ["urn:jsonschema:io:revisium:file-schema:1.0.0" /* File */]: chunkEGC32GPY_cjs.fileSchema
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 = chunkB3T6YB2D_cjs.createJsonValueStore(this.store, rowId, data);
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 = chunkB3T6YB2D_cjs.getTransformation(this.store, nextStore);
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 = chunkB3T6YB2D_cjs.createJsonValueStore(nextStore, rowId, rawNextValue);
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-V6JTSET2.cjs.map
768
- //# sourceMappingURL=chunk-V6JTSET2.cjs.map
@@ -124,5 +124,3 @@ function deepEqual(a, b) {
124
124
  }
125
125
 
126
126
  export { computeValueDiff };
127
- //# sourceMappingURL=chunk-YFWOURZL.js.map
128
- //# sourceMappingURL=chunk-YFWOURZL.js.map
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+
@@ -1566,7 +1566,7 @@ var SchemaSerializer = class {
1566
1566
  required.push(child.name());
1567
1567
  }
1568
1568
  const result = {
1569
- type: "object" /* Object */,
1569
+ type: "object",
1570
1570
  properties,
1571
1571
  additionalProperties: false,
1572
1572
  required
@@ -1579,7 +1579,7 @@ var SchemaSerializer = class {
1579
1579
  throw new Error("Array node must have items");
1580
1580
  }
1581
1581
  const result = {
1582
- type: "array" /* Array */,
1582
+ type: "array",
1583
1583
  items: this.serialize(items)
1584
1584
  };
1585
1585
  return this.addMetadata(result, node);
@@ -1605,7 +1605,7 @@ var SchemaSerializer = class {
1605
1605
  }
1606
1606
  serializeString(node) {
1607
1607
  const result = {
1608
- type: "string" /* String */,
1608
+ type: "string",
1609
1609
  default: node.defaultValue() ?? ""
1610
1610
  };
1611
1611
  const foreignKey = node.foreignKey();
@@ -1625,7 +1625,7 @@ var SchemaSerializer = class {
1625
1625
  }
1626
1626
  serializeNumber(node) {
1627
1627
  const result = {
1628
- type: "number" /* Number */,
1628
+ type: "number",
1629
1629
  default: node.defaultValue() ?? 0
1630
1630
  };
1631
1631
  const formula = node.formula();
@@ -1637,7 +1637,7 @@ var SchemaSerializer = class {
1637
1637
  }
1638
1638
  serializeBoolean(node) {
1639
1639
  const result = {
1640
- type: "boolean" /* Boolean */,
1640
+ type: "boolean",
1641
1641
  default: node.defaultValue() ?? false
1642
1642
  };
1643
1643
  const formula = node.formula();
@@ -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-3JZKQWQH.js.map
2683
- //# sourceMappingURL=chunk-3JZKQWQH.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
@@ -15,5 +15,3 @@ var SystemSchemaIds = /* @__PURE__ */ ((SystemSchemaIds2) => {
15
15
  })(SystemSchemaIds || {});
16
16
 
17
17
  exports.SystemSchemaIds = SystemSchemaIds;
18
- //# sourceMappingURL=chunk-XNFSFT7T.cjs.map
19
- //# sourceMappingURL=chunk-XNFSFT7T.cjs.map
@@ -9,5 +9,3 @@ var FieldChangeType = /* @__PURE__ */ ((FieldChangeType2) => {
9
9
  })(FieldChangeType || {});
10
10
 
11
11
  exports.FieldChangeType = FieldChangeType;
12
- //# sourceMappingURL=chunk-ZRNFSUOV.cjs.map
13
- //# sourceMappingURL=chunk-ZRNFSUOV.cjs.map
@@ -19,7 +19,7 @@ var JsonStringStore = class extends EventEmitter {
19
19
  super();
20
20
  this.nodeId = nodeId;
21
21
  }
22
- type = "string" /* String */;
22
+ type = "string";
23
23
  $ref = "";
24
24
  name = "";
25
25
  parent = null;
@@ -75,7 +75,7 @@ var JsonNumberStore = class extends EventEmitter {
75
75
  super();
76
76
  this.nodeId = nodeId;
77
77
  }
78
- type = "number" /* Number */;
78
+ type = "number";
79
79
  $ref = "";
80
80
  name = "";
81
81
  parent = null;
@@ -121,7 +121,7 @@ var JsonBooleanStore = class extends EventEmitter {
121
121
  super();
122
122
  this.nodeId = nodeId;
123
123
  }
124
- type = "boolean" /* Boolean */;
124
+ type = "boolean";
125
125
  $ref = "";
126
126
  name = "";
127
127
  parent = null;
@@ -166,7 +166,7 @@ var JsonObjectStore = class {
166
166
  constructor(nodeId = nanoid()) {
167
167
  this.nodeId = nodeId;
168
168
  }
169
- type = "object" /* Object */;
169
+ type = "object";
170
170
  $ref = "";
171
171
  name = "";
172
172
  parent = null;
@@ -317,7 +317,7 @@ var JsonArrayStore = class {
317
317
  this.nodeId = nodeId;
318
318
  this.items.parent = this;
319
319
  }
320
- type = "array" /* Array */;
320
+ type = "array";
321
321
  $ref = "";
322
322
  name = "";
323
323
  parent = null;
@@ -393,7 +393,7 @@ var JsonStringValueStore = class {
393
393
  this.value = value;
394
394
  this.index = this.schema.registerValue(this);
395
395
  }
396
- type = "string" /* String */;
396
+ type = "string";
397
397
  index;
398
398
  parent = null;
399
399
  get foreignKey() {
@@ -412,7 +412,7 @@ var JsonNumberValueStore = class {
412
412
  this.value = value;
413
413
  this.index = this.schema.registerValue(this);
414
414
  }
415
- type = "number" /* Number */;
415
+ type = "number";
416
416
  index;
417
417
  parent = null;
418
418
  getPlainValue() {
@@ -428,7 +428,7 @@ var JsonBooleanValueStore = class {
428
428
  this.value = value;
429
429
  this.index = this.schema.registerValue(this);
430
430
  }
431
- type = "boolean" /* Boolean */;
431
+ type = "boolean";
432
432
  index;
433
433
  parent = null;
434
434
  getPlainValue() {
@@ -486,33 +486,33 @@ var fromArrayToObject = (_value, defaultValue) => {
486
486
  };
487
487
  var replaceTransformationsMapper = [
488
488
  {
489
- fromType: "number" /* Number */,
490
- toType: "string" /* String */,
489
+ fromType: "number",
490
+ toType: "string",
491
491
  transformation: fromNumberToString
492
492
  },
493
493
  {
494
- fromType: "string" /* String */,
495
- toType: "number" /* Number */,
494
+ fromType: "string",
495
+ toType: "number",
496
496
  transformation: fromStringToNumber
497
497
  },
498
498
  {
499
- fromType: "boolean" /* Boolean */,
500
- toType: "string" /* String */,
499
+ fromType: "boolean",
500
+ toType: "string",
501
501
  transformation: fromBooleanToString
502
502
  },
503
503
  {
504
- fromType: "string" /* String */,
505
- toType: "boolean" /* Boolean */,
504
+ fromType: "string",
505
+ toType: "boolean",
506
506
  transformation: fromStringToBoolean
507
507
  },
508
508
  {
509
- fromType: "boolean" /* Boolean */,
510
- toType: "number" /* Number */,
509
+ fromType: "boolean",
510
+ toType: "number",
511
511
  transformation: fromBooleanToNumber
512
512
  },
513
513
  {
514
- fromType: "number" /* Number */,
515
- toType: "boolean" /* Boolean */,
514
+ fromType: "number",
515
+ toType: "boolean",
516
516
  transformation: fromNumberToBoolean
517
517
  }
518
518
  ];
@@ -587,7 +587,7 @@ var JsonObjectValueStore = class {
587
587
  this.index = this.schema.registerValue(this);
588
588
  this.init();
589
589
  }
590
- type = "object" /* Object */;
590
+ type = "object";
591
591
  index;
592
592
  parent = null;
593
593
  getPlainValue() {
@@ -639,7 +639,7 @@ var JsonObjectValueStore = class {
639
639
  findValueAtSchemaLevel(targetSchema) {
640
640
  let current = this.parent;
641
641
  while (current) {
642
- if (current.type === "object" /* Object */) {
642
+ if (current.type === "object") {
643
643
  for (const [, fieldValue] of Object.entries(current.value)) {
644
644
  if (fieldValue.schema === targetSchema) {
645
645
  return fieldValue.getPlainValue();
@@ -673,9 +673,9 @@ var JsonObjectValueStore = class {
673
673
 
674
674
  // src/lib/createJsonValueStore.ts
675
675
  var createJsonValueStore = (schema, rowId, rawValue) => {
676
- if (schema.type === "object" /* Object */) {
676
+ if (schema.type === "object") {
677
677
  return createJsonObjectValueStore(schema, rowId, rawValue);
678
- } else if (schema.type === "array" /* Array */) {
678
+ } else if (schema.type === "array") {
679
679
  return createJsonArrayValueStore(schema, rowId, rawValue);
680
680
  } else {
681
681
  return createPrimitiveValueStore(schema, rowId, rawValue);
@@ -702,11 +702,11 @@ var createJsonArrayValueStore = (schema, rowId, rawValue) => {
702
702
  return new JsonArrayValueStore(schema, rowId, value);
703
703
  };
704
704
  var createPrimitiveValueStore = (schema, rowId, rawValue) => {
705
- if (schema.type === "string" /* String */) {
705
+ if (schema.type === "string") {
706
706
  return new JsonStringValueStore(schema, rowId, rawValue);
707
- } else if (schema.type === "number" /* Number */) {
707
+ } else if (schema.type === "number") {
708
708
  return new JsonNumberValueStore(schema, rowId, rawValue);
709
- } else if (schema.type === "boolean" /* Boolean */) {
709
+ } else if (schema.type === "boolean") {
710
710
  return new JsonBooleanValueStore(schema, rowId, rawValue);
711
711
  } else {
712
712
  throw new Error("this type is not allowed");
@@ -722,7 +722,7 @@ var JsonArrayValueStore = class {
722
722
  this.index = this.schema.registerValue(this);
723
723
  this.init();
724
724
  }
725
- type = "array" /* Array */;
725
+ type = "array";
726
726
  index;
727
727
  parent = null;
728
728
  getPlainValue() {
@@ -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-55AMH44G.js.map
763
- //# sourceMappingURL=chunk-55AMH44G.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