@rljson/rljson 0.0.86 → 0.0.87

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/rljson.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { hip, hsh } from "@rljson/hash";
2
2
  import { exampleJsonObject, jsonValueMatchesType, jsonValueType, jsonValueTypes } from "@rljson/json";
3
3
  import { nanoid } from "nanoid";
4
- //#region src/route/route.ts
4
+ // src/route/route.ts
5
5
  // @license
6
6
  var routeRefSeperator = "@";
7
7
  var routeSliceIdIndicators = ["(", ")"];
@@ -278,8 +278,7 @@ var Route = class Route {
278
278
  return this.segmentHasRef(segment) && Object.keys(segment).some((k) => k.endsWith("InsertHistoryRef"));
279
279
  }
280
280
  };
281
- //#endregion
282
- //#region src/example/bakery-example.ts
281
+ // src/example/bakery-example.ts
283
282
  // @license
284
283
  var bakeryExample = () => {
285
284
  const nutritionalValues = hip({
@@ -429,12 +428,10 @@ var bakeryExample = () => {
429
428
  })
430
429
  };
431
430
  };
432
- //#endregion
433
- //#region src/content/buffet.ts
431
+ // src/content/buffet.ts
434
432
  // @license
435
433
  var exampleBuffetsTable = () => bakeryExample().buffets;
436
- //#endregion
437
- //#region src/content/cake.ts
434
+ // src/content/cake.ts
438
435
  // @license
439
436
  /**
440
437
  * Sample Table as BoilerPlate for Tests and Examples
@@ -486,15 +483,13 @@ var createCakeTableCfg = (cakeKey) => ({
486
483
  * Provides an example cakes table for test purposes
487
484
  */
488
485
  var exampleCakesTable = () => bakeryExample().cakes;
489
- //#endregion
490
- //#region src/content/components.ts
486
+ // src/content/components.ts
491
487
  // @license
492
488
  /**
493
489
  * Provides an example components table for test purposes
494
490
  */
495
491
  var exampleComponentsTable = () => bakeryExample().nutritionalValues;
496
- //#endregion
497
- //#region src/content/layer.ts
492
+ // src/content/layer.ts
498
493
  // @license
499
494
  /**
500
495
  * Sample Table as BoilerPlate for Tests and Examples
@@ -555,8 +550,7 @@ var createLayerTableCfg = (layerKey) => ({
555
550
  * Provides an example layersTable for test purposes
556
551
  */
557
552
  var exampleLayersTable = () => bakeryExample().recipeLayers;
558
- //#endregion
559
- //#region src/content/revision.ts
553
+ // src/content/revision.ts
560
554
  // @license
561
555
  /**
562
556
  * Example revision object for test purposes
@@ -568,8 +562,7 @@ var exampleRevision = () => ({
568
562
  successor: "IqeoWJjZQNlr-NVk2QT15B",
569
563
  timestamp: 1743558427
570
564
  });
571
- //#endregion
572
- //#region src/content/slice-ids.ts
565
+ // src/content/slice-ids.ts
573
566
  // @license
574
567
  /**
575
568
  * Returns the slice ids table of the bakery example
@@ -613,8 +606,7 @@ var createSliceIdsTableCfg = (tableKey) => ({
613
606
  isRoot: false,
614
607
  isShared: true
615
608
  });
616
- //#endregion
617
- //#region src/content/tree.ts
609
+ // src/content/tree.ts
618
610
  // @license
619
611
  /**
620
612
  * Creates a TableCfg for Trees tables
@@ -770,8 +762,7 @@ var treeFromObject = (obj, skipRootCreation = false) => {
770
762
  }
771
763
  return result;
772
764
  };
773
- //#endregion
774
- //#region src/example.ts
765
+ // src/example.ts
775
766
  // @license
776
767
  var Example = class Example {
777
768
  static ok = {
@@ -1487,8 +1478,7 @@ var Example = class Example {
1487
1478
  }
1488
1479
  };
1489
1480
  };
1490
- //#endregion
1491
- //#region src/content/table-cfg.ts
1481
+ // src/content/table-cfg.ts
1492
1482
  // @license
1493
1483
  /**
1494
1484
  * Throws an error if the table configuration is not valid.
@@ -1581,8 +1571,7 @@ var exampleTableCfg = (tableCfg = void 0) => {
1581
1571
  isShared: false
1582
1572
  };
1583
1573
  };
1584
- //#endregion
1585
- //#region src/edit/edit-history.ts
1574
+ // src/edit/edit-history.ts
1586
1575
  // @license
1587
1576
  var createEditHistoryTableCfg = (cakeKey) => ({
1588
1577
  key: `${cakeKey}EditHistory`,
@@ -1625,8 +1614,7 @@ var createEditHistoryTableCfg = (cakeKey) => ({
1625
1614
  isRoot: false,
1626
1615
  isShared: true
1627
1616
  });
1628
- //#endregion
1629
- //#region src/edit/edit.ts
1617
+ // src/edit/edit.ts
1630
1618
  // @license
1631
1619
  var createEditTableCfg = (cakeKey) => ({
1632
1620
  key: `${cakeKey}Edits`,
@@ -1655,8 +1643,7 @@ var createEditTableCfg = (cakeKey) => ({
1655
1643
  isRoot: false,
1656
1644
  isShared: true
1657
1645
  });
1658
- //#endregion
1659
- //#region src/edit/multi-edit.ts
1646
+ // src/edit/multi-edit.ts
1660
1647
  // @license
1661
1648
  var createMultiEditTableCfg = (cakeKey) => ({
1662
1649
  key: `${cakeKey}MultiEdits`,
@@ -1686,12 +1673,10 @@ var createMultiEditTableCfg = (cakeKey) => ({
1686
1673
  isRoot: false,
1687
1674
  isShared: true
1688
1675
  });
1689
- //#endregion
1690
- //#region src/tools/object-depth.ts
1676
+ // src/tools/object-depth.ts
1691
1677
  // @license
1692
1678
  var objectDepth = (o) => Object(o) === o ? 1 + Math.max(-1, ...Object.values(o).map(objectDepth)) : 0;
1693
- //#endregion
1694
- //#region src/insert/insert-validator.ts
1679
+ // src/insert/insert-validator.ts
1695
1680
  // @license
1696
1681
  var InsertValidator = class InsertValidator {
1697
1682
  _insert;
@@ -1783,16 +1768,14 @@ var InsertValidator = class InsertValidator {
1783
1768
  var validateInsert = (insert) => {
1784
1769
  return InsertValidator.create(insert).validate();
1785
1770
  };
1786
- //#endregion
1787
- //#region src/insert/insert.ts
1771
+ // src/insert/insert.ts
1788
1772
  // @license
1789
1773
  var exampleInsert = () => ({
1790
1774
  route: "a/b/c",
1791
1775
  command: "add",
1792
1776
  value: { x: { y: { z: true } } }
1793
1777
  });
1794
- //#endregion
1795
- //#region src/insertHistory/insertHistory.ts
1778
+ // src/insertHistory/insertHistory.ts
1796
1779
  // @license
1797
1780
  /**
1798
1781
  * Creates a TableCfg for a InsertHistory table for the given table configuration
@@ -1858,8 +1841,7 @@ var createInsertHistoryTableCfg = (tableCfg) => ({
1858
1841
  * Provides an example insertHistory table for test purposes
1859
1842
  */
1860
1843
  var exampleInsertHistoryTable = () => bakeryExample().ingredientsInsertHistory;
1861
- //#endregion
1862
- //#region src/rljson.ts
1844
+ // src/rljson.ts
1863
1845
  // @license
1864
1846
  var reservedFieldNames = ["_data"];
1865
1847
  var reservedTableKeys = [
@@ -1912,8 +1894,7 @@ var iterateTables = async (rljson, callback) => {
1912
1894
  await Promise.all(array);
1913
1895
  if (errors.length) throw errors;
1914
1896
  };
1915
- //#endregion
1916
- //#region src/sync/ack-payload.ts
1897
+ // src/sync/ack-payload.ts
1917
1898
  // @license
1918
1899
  /**
1919
1900
  * Returns an example AckPayload where all clients confirmed receipt.
@@ -1933,8 +1914,7 @@ var ackPayloadPartialExample = () => ({
1933
1914
  receivedBy: 1,
1934
1915
  totalClients: 3
1935
1916
  });
1936
- //#endregion
1937
- //#region src/sync/client-id.ts
1917
+ // src/sync/client-id.ts
1938
1918
  // @license
1939
1919
  /**
1940
1920
  * Generates a new ClientId.
@@ -1960,8 +1940,7 @@ var isClientId = (id) => {
1960
1940
  * Returns an example ClientId for documentation and testing.
1961
1941
  */
1962
1942
  var clientIdExample = () => "client_ExAmPlE12345";
1963
- //#endregion
1964
- //#region src/sync/connector-payload.ts
1943
+ // src/sync/connector-payload.ts
1965
1944
  // @license
1966
1945
  /**
1967
1946
  * Returns a minimal example ConnectorPayload (backward-compatible format).
@@ -1988,8 +1967,7 @@ var connectorPayloadFullExample = () => ({
1988
1967
  n: 1
1989
1968
  }
1990
1969
  });
1991
- //#endregion
1992
- //#region src/sync/gap-fill.ts
1970
+ // src/sync/gap-fill.ts
1993
1971
  // @license
1994
1972
  /**
1995
1973
  * Returns an example GapFillRequest.
@@ -2014,8 +1992,7 @@ var gapFillResponseExample = () => ({
2014
1992
  seq: 7
2015
1993
  }]
2016
1994
  });
2017
- //#endregion
2018
- //#region src/sync/ref-stamp.ts
1995
+ // src/sync/ref-stamp.ts
2019
1996
  // @license
2020
1997
  /**
2021
1998
  * Orders two stamps lexicographically on `(domain, epoch, hub, n)`.
@@ -2064,8 +2041,7 @@ var stampPayloadExample = () => ({
2064
2041
  r: "1700000000001:EfGh",
2065
2042
  stamp: refStampExample()
2066
2043
  });
2067
- //#endregion
2068
- //#region src/sync/sync-config.ts
2044
+ // src/sync/sync-config.ts
2069
2045
  // @license
2070
2046
  /**
2071
2047
  * Default SyncConfig — all features disabled (backward-compatible mode).
@@ -2085,8 +2061,7 @@ var syncConfigFullExample = () => ({
2085
2061
  * Returns an example SyncConfig with only causal ordering enabled.
2086
2062
  */
2087
2063
  var syncConfigCausalOnlyExample = () => ({ causalOrdering: true });
2088
- //#endregion
2089
- //#region src/sync/sync-events.ts
2064
+ // src/sync/sync-events.ts
2090
2065
  // @license
2091
2066
  /**
2092
2067
  * Creates typed, route-specific socket event names for the sync protocol.
@@ -2102,8 +2077,7 @@ var syncEvents = (route) => ({
2102
2077
  bootstrap: `${route}:bootstrap`,
2103
2078
  stamp: `${route}:stamp`
2104
2079
  });
2105
- //#endregion
2106
- //#region src/tables/tables.ts
2080
+ // src/tables/tables.ts
2107
2081
  // @license
2108
2082
  /**
2109
2083
  * Read only view on the tables of an Rljson dump.
@@ -2187,8 +2161,7 @@ var Tables = class Tables {
2187
2161
  return typeof value === "object" && value !== null && typeof value._type === "string" && Array.isArray(value._data);
2188
2162
  }
2189
2163
  };
2190
- //#endregion
2191
- //#region src/tools/ref.ts
2164
+ // src/tools/ref.ts
2192
2165
  // @license
2193
2166
  /**
2194
2167
  * Returns the reference to a row: the hash that `hip` has written into it.
@@ -2217,8 +2190,7 @@ var rowOf = (table, hash) => {
2217
2190
  if (!row) throw new Error(`rowOf: The table has no row with hash "${hash}".`);
2218
2191
  return row;
2219
2192
  };
2220
- //#endregion
2221
- //#region src/tools/resolve-slice-ids.ts
2193
+ // src/tools/resolve-slice-ids.ts
2222
2194
  // @license
2223
2195
  /**
2224
2196
  * Merges a row of slice ids with the resolved slice ids of its base.
@@ -2255,8 +2227,7 @@ var resolveSliceIds = (table, row) => {
2255
2227
  }
2256
2228
  return chain.reduceRight(mergeSliceIds, []);
2257
2229
  };
2258
- //#endregion
2259
- //#region src/tools/remove-duplicates.ts
2230
+ // src/tools/remove-duplicates.ts
2260
2231
  // @license
2261
2232
  var removeDuplicates = (rljson) => {
2262
2233
  const result = {};
@@ -2275,8 +2246,7 @@ var removeDuplicates = (rljson) => {
2275
2246
  updateExistingHashes: true
2276
2247
  });
2277
2248
  };
2278
- //#endregion
2279
- //#region src/tools/time-id.ts
2249
+ // src/tools/time-id.ts
2280
2250
  // @license
2281
2251
  /**
2282
2252
  * Generates a new TimeId.
@@ -2321,8 +2291,7 @@ var getTimeIdUniquePart = (id) => {
2321
2291
  if (!isTimeId(id)) return null;
2322
2292
  return id.split(":")[1];
2323
2293
  };
2324
- //#endregion
2325
- //#region src/typedefs.ts
2294
+ // src/typedefs.ts
2326
2295
  // @license
2327
2296
  /**
2328
2297
  * Types of tables that can be stored in an Rljson object
@@ -2358,8 +2327,7 @@ var exampleTypedefs = () => {
2358
2327
  contentType: "layers"
2359
2328
  };
2360
2329
  };
2361
- //#endregion
2362
- //#region src/rljson-indexed.ts
2330
+ // src/rljson-indexed.ts
2363
2331
  // @license
2364
2332
  /**
2365
2333
  * Returns an rljson where all tables' rows are indexed by their hash.
@@ -2386,8 +2354,7 @@ var rljsonIndexed = (rljson) => {
2386
2354
  }
2387
2355
  return result;
2388
2356
  };
2389
- //#endregion
2390
- //#region src/validate/base-validator.ts
2357
+ // src/validate/base-validator.ts
2391
2358
  // @license
2392
2359
  var BaseValidator = class {
2393
2360
  name = "base";
@@ -3044,8 +3011,7 @@ var _BaseValidator = class {
3044
3011
  * @returns true if the field name is valid, false otherwise
3045
3012
  */
3046
3013
  var isValidFieldName = (fieldName) => BaseValidator.isValidFieldName(fieldName);
3047
- //#endregion
3048
- //#region src/validate/validate.ts
3014
+ // src/validate/validate.ts
3049
3015
  // @license
3050
3016
  var Validate = class {
3051
3017
  addValidator(validator) {
@@ -3070,8 +3036,6 @@ var Validate = class {
3070
3036
  }
3071
3037
  _validators = [];
3072
3038
  };
3073
- //#endregion
3074
- //#region src/index.ts
3039
+ // src/index.ts
3075
3040
  // @license
3076
- //#endregion
3077
3041
  export { BaseValidator, Example, InsertValidator, Route, Tables, Validate, ackPayloadExample, ackPayloadPartialExample, addColumnsToTableCfg, bakeryExample, clientId, clientIdExample, compareRefStamp, connectorPayloadExample, connectorPayloadFullExample, contentTypes, createCakeTableCfg, createEditHistoryTableCfg, createEditTableCfg, createInsertHistoryTableCfg, createLayerTableCfg, createMultiEditTableCfg, createSliceIdsTableCfg, createTreesTableCfg, exampleBuffetsTable, exampleCakesTable, exampleComponentsTable, exampleInsert, exampleInsertHistoryTable, exampleLayersTable, exampleRevision, exampleRljson, exampleSliceIdsTable, exampleTableCfg, exampleTableCfgTable, exampleTreesTable, exampleTypedefs, gapFillRequestExample, gapFillResponseExample, getTimeIdTimestamp, getTimeIdUniquePart, isClientId, isRefStamp, isTimeId, isValidFieldName, iterateTables, iterateTablesSync, mergeSliceIds, ref, refStampExample, removeDuplicates, reservedFieldNames, reservedTableKeys, resolveSliceIds, routeRefSeperator, routeSliceIdIndicators, routeSliceIdSeperator, rowOf, stampPayloadExample, syncConfigCausalOnlyExample, syncConfigDefault, syncConfigFullExample, syncEvents, throwOnInvalidTableCfg, timeId, treeFromObject, validateInsert, validateRljsonAgainstTableCfg };
@@ -1,2 +1,2 @@
1
1
  /** The version of the `@rljson/rljson` package. */
2
- export declare const rljsonVersion = "0.0.86";
2
+ export declare const rljsonVersion = "0.0.87";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rljson/rljson",
3
- "version": "0.0.86",
3
+ "version": "0.0.87",
4
4
  "description": "The RLJSON data format specification",
5
5
  "homepage": "https://github.com/rljson/rljson",
6
6
  "bugs": "https://github.com/rljson/rljson/issues",
@@ -20,28 +20,30 @@
20
20
  ],
21
21
  "type": "module",
22
22
  "devDependencies": {
23
- "@types/node": "^26.6.4",
24
- "@typescript-eslint/eslint-plugin": "^8.71.1",
25
- "@typescript-eslint/parser": "^8.71.1",
26
- "@vitest/coverage-v8": "^5.0.3",
23
+ "@rljson/dna-rljson": "^0.3.1",
24
+ "@tssuite/helix-js": "^0.5.1",
25
+ "@types/node": "^26.6.6",
26
+ "@typescript-eslint/eslint-plugin": "^8.72.1",
27
+ "@typescript-eslint/parser": "^8.72.1",
28
+ "@vitest/coverage-v8": "^5.0.5",
27
29
  "cross-env": "^10.1.0",
28
- "eslint": "^10.12.0",
29
- "eslint-plugin-jsdoc": "^65.2.1",
30
+ "eslint": "^10.13.0",
31
+ "eslint-plugin-jsdoc": "^65.4.2",
30
32
  "eslint-plugin-tsdoc": "^0.5.4",
31
33
  "globals": "^17.13.0",
32
34
  "jsdoc": "^4.0.5",
33
35
  "read-pkg": "^10.1.0",
34
36
  "typescript": "~6.0.3",
35
- "typescript-eslint": "^8.71.1",
36
- "vite": "^8.3.4",
37
+ "typescript-eslint": "^8.72.1",
38
+ "vite": "^8.3.5",
37
39
  "vite-node": "^6.0.0",
38
40
  "vite-plugin-dts": "^5.1.2",
39
41
  "vite-tsconfig-paths": "^6.1.1",
40
- "vitest": "^5.0.3",
42
+ "vitest": "^5.0.5",
41
43
  "vitest-dom": "^0.1.1"
42
44
  },
43
45
  "dependencies": {
44
- "@rljson/hash": "0.0.19",
46
+ "@rljson/hash": "0.0.20",
45
47
  "@rljson/json": "0.0.23",
46
48
  "nanoid": "^6.0.2"
47
49
  },