@rljson/rljson 0.0.30 → 0.0.32

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
@@ -6,7 +6,7 @@ import { exampleJsonObject, jsonValueTypes, jsonValueMatchesType } from "@rljson
6
6
  // @license
7
7
  const bakeryExample = () => {
8
8
  const nutritionalValues = hip({
9
- _type: "properties",
9
+ _type: "ingredients",
10
10
  _data: [
11
11
  {
12
12
  energy: 364,
@@ -19,7 +19,7 @@ const bakeryExample = () => {
19
19
  _hash: ""
20
20
  });
21
21
  const ingredients = hip({
22
- _type: "properties",
22
+ _type: "ingredients",
23
23
  _data: [
24
24
  {
25
25
  name: "flour",
@@ -31,7 +31,7 @@ const bakeryExample = () => {
31
31
  _hash: ""
32
32
  });
33
33
  const recipeIngredients = hip({
34
- _type: "properties",
34
+ _type: "ingredients",
35
35
  _data: [
36
36
  {
37
37
  ingredientsRef: ingredients._data[0]._hash,
@@ -42,10 +42,10 @@ const bakeryExample = () => {
42
42
  _hash: ""
43
43
  });
44
44
  const recipes = hip({
45
- _type: "collections",
45
+ _type: "layers",
46
46
  _data: [
47
47
  {
48
- properties: "recipeIngredients",
48
+ ingredientsTable: "recipeIngredients",
49
49
  assign: {
50
50
  flour: recipeIngredients._data[0]._hash
51
51
  },
@@ -54,10 +54,10 @@ const bakeryExample = () => {
54
54
  ]
55
55
  });
56
56
  const layers = hip({
57
- _type: "collections",
57
+ _type: "layers",
58
58
  _data: [
59
59
  {
60
- properties: "recipes",
60
+ ingredientsTable: "recipes",
61
61
  assign: {
62
62
  slice0: recipes._data[0]._hash,
63
63
  slice1: recipes._data[0]._hash
@@ -66,7 +66,7 @@ const bakeryExample = () => {
66
66
  ]
67
67
  });
68
68
  const slices = hip({
69
- _type: "idSets",
69
+ _type: "sliceIds",
70
70
  _data: [
71
71
  {
72
72
  add: ["slice0", "slice1"],
@@ -80,9 +80,9 @@ const bakeryExample = () => {
80
80
  _type: "cakes",
81
81
  _data: [
82
82
  {
83
- idSetsTable: "slices",
83
+ sliceIdsTable: "slices",
84
84
  idSet: slices._data[0]._hash,
85
- collections: "layers",
85
+ layersTable: "layers",
86
86
  layers: {
87
87
  flour: layers._data[0]._hash
88
88
  },
@@ -120,11 +120,11 @@ const exampleBuffetsTable = () => bakeryExample().buffets;
120
120
  // @license
121
121
  const exampleCakesTable = () => bakeryExample().cakes;
122
122
  // @license
123
- const exampleCollectionsTable = () => bakeryExample().layers;
123
+ const exampleIngredientsTable = () => bakeryExample().nutritionalValues;
124
124
  // @license
125
- const exampleIdSetsTable = () => bakeryExample().slices;
125
+ const exampleLayersTable = () => bakeryExample().layers;
126
126
  // @license
127
- const examplePropertiesTable = () => bakeryExample().nutritionalValues;
127
+ const exampleSliceIdsTable = () => bakeryExample().slices;
128
128
  // @license
129
129
  const _Example = class _Example {
130
130
  };
@@ -136,7 +136,7 @@ __publicField(_Example, "ok", {
136
136
  binary: () => {
137
137
  return {
138
138
  table: {
139
- _type: "properties",
139
+ _type: "ingredients",
140
140
  _data: [
141
141
  { a: false, b: false },
142
142
  { a: false, b: true },
@@ -149,13 +149,13 @@ __publicField(_Example, "ok", {
149
149
  singleRow: () => {
150
150
  const tableCfgs = hip({
151
151
  _hash: "",
152
- _type: "properties",
152
+ _type: "ingredients",
153
153
  _data: [
154
154
  {
155
155
  version: 0,
156
156
  _hash: "",
157
157
  key: "table",
158
- type: "properties",
158
+ type: "ingredients",
159
159
  columns: {
160
160
  int: {
161
161
  key: "int",
@@ -196,7 +196,7 @@ __publicField(_Example, "ok", {
196
196
  const result = {
197
197
  tableCfgs,
198
198
  table: {
199
- _type: "properties",
199
+ _type: "ingredients",
200
200
  _tableCfg: tableCfgs._data[0]._hash,
201
201
  _data: [exampleJsonObject()],
202
202
  _hash: ""
@@ -207,7 +207,7 @@ __publicField(_Example, "ok", {
207
207
  multipleRows: () => {
208
208
  return {
209
209
  table: {
210
- _type: "properties",
210
+ _type: "ingredients",
211
211
  _data: [
212
212
  {
213
213
  string: "str0",
@@ -237,7 +237,7 @@ __publicField(_Example, "ok", {
237
237
  singleRef: () => {
238
238
  return {
239
239
  tableA: {
240
- _type: "properties",
240
+ _type: "ingredients",
241
241
  _data: [
242
242
  {
243
243
  keyA0: "a0"
@@ -248,7 +248,7 @@ __publicField(_Example, "ok", {
248
248
  ]
249
249
  },
250
250
  tableB: {
251
- _type: "properties",
251
+ _type: "ingredients",
252
252
  _data: [
253
253
  {
254
254
  tableARef: "KFQrf4mEz0UPmUaFHwH4T6"
@@ -258,47 +258,47 @@ __publicField(_Example, "ok", {
258
258
  };
259
259
  },
260
260
  complete: () => {
261
- const idSets = hip({
262
- _type: "idSets",
261
+ const sliceIds = hip({
262
+ _type: "sliceIds",
263
263
  _data: [
264
264
  {
265
265
  add: ["id0", "id1"]
266
266
  }
267
267
  ]
268
268
  });
269
- const properties = hip({
270
- _type: "properties",
269
+ const ingredients = hip({
270
+ _type: "ingredients",
271
271
  _data: [{ a: "0" }, { a: "1" }]
272
272
  });
273
- const property0 = properties._data[0];
274
- const property1 = properties._data[1];
275
- const collection0 = hip({
276
- idSetsTable: "idSets",
273
+ const ingredient0 = ingredients._data[0];
274
+ const ingredient1 = ingredients._data[1];
275
+ const layer0 = hip({
276
+ sliceIdsTable: "sliceIds",
277
277
  idSet: "MgHRBYSrhpyl4rvsOmAWcQ",
278
- properties: "properties",
278
+ ingredientsTable: "ingredients",
279
279
  assign: {}
280
280
  });
281
- const collection1 = hip({
282
- base: collection0._hash,
283
- idSetsTable: "idSets",
281
+ const layer1 = hip({
282
+ base: layer0._hash,
283
+ sliceIdsTable: "sliceIds",
284
284
  idSet: "MgHRBYSrhpyl4rvsOmAWcQ",
285
- properties: "properties",
285
+ ingredientsTable: "ingredients",
286
286
  assign: {
287
- id0: property0._hash,
288
- id1: property1._hash
287
+ id0: ingredient0._hash,
288
+ id1: ingredient1._hash
289
289
  }
290
290
  });
291
- const collections = hip({
292
- _type: "collections",
293
- _data: [collection0, collection1]
291
+ const layers = hip({
292
+ _type: "layers",
293
+ _data: [layer0, layer1]
294
294
  });
295
295
  const cake = hip({
296
- idSetsTable: "idSets",
297
- idSet: idSets._data[0]._hash,
298
- collections: "collections",
296
+ sliceIdsTable: "sliceIds",
297
+ idSet: sliceIds._data[0]._hash,
298
+ layersTable: "layers",
299
299
  layers: {
300
- layer0: collection0._hash,
301
- layer1: collection1._hash
300
+ layer0: layer0._hash,
301
+ layer1: layer1._hash
302
302
  }
303
303
  });
304
304
  const cakes = hip({
@@ -315,17 +315,17 @@ __publicField(_Example, "ok", {
315
315
  ref: cakes._data[0]._hash
316
316
  },
317
317
  {
318
- table: "collections",
319
- ref: collection0._hash
318
+ table: "layers",
319
+ ref: layer0._hash
320
320
  }
321
321
  ]
322
322
  }
323
323
  ]
324
324
  });
325
325
  return {
326
- idSets,
327
- properties,
328
- collections,
326
+ sliceIds,
327
+ ingredients,
328
+ layers,
329
329
  cakes,
330
330
  buffets
331
331
  };
@@ -336,7 +336,7 @@ __publicField(_Example, "broken", {
336
336
  brokenTableKey: () => {
337
337
  return {
338
338
  brok$en: {
339
- _type: "properties",
339
+ _type: "ingredients",
340
340
  _data: []
341
341
  }
342
342
  };
@@ -344,14 +344,14 @@ __publicField(_Example, "broken", {
344
344
  missingData: () => {
345
345
  return {
346
346
  table: {
347
- _type: "properties"
347
+ _type: "ingredients"
348
348
  }
349
349
  };
350
350
  },
351
351
  dataNotBeingAnArray: () => {
352
352
  return {
353
353
  table: {
354
- _type: "properties",
354
+ _type: "ingredients",
355
355
  _data: {}
356
356
  }
357
357
  };
@@ -359,7 +359,7 @@ __publicField(_Example, "broken", {
359
359
  missingRef: () => {
360
360
  return {
361
361
  tableA: {
362
- _type: "properties",
362
+ _type: "ingredients",
363
363
  _data: [
364
364
  {
365
365
  keyA0: "a0"
@@ -370,7 +370,7 @@ __publicField(_Example, "broken", {
370
370
  ]
371
371
  },
372
372
  tableB: {
373
- _type: "properties",
373
+ _type: "ingredients",
374
374
  _data: [
375
375
  {
376
376
  tableARef: "MISSINGREF"
@@ -383,7 +383,7 @@ __publicField(_Example, "broken", {
383
383
  missingReferencedTable: () => {
384
384
  return {
385
385
  tableB: {
386
- _type: "properties",
386
+ _type: "ingredients",
387
387
  _data: [
388
388
  {
389
389
  tableARef: "MISSINGREF"
@@ -402,44 +402,44 @@ __publicField(_Example, "broken", {
402
402
  return hip(result, true, false);
403
403
  }
404
404
  },
405
- collections: {
405
+ layers: {
406
406
  missingBase: () => {
407
407
  const result = _Example.ok.complete();
408
- const collection1 = result.collections._data[1];
409
- collection1.base = "MISSING";
408
+ const layer1 = result.layers._data[1];
409
+ layer1.base = "MISSING";
410
410
  return hip(result, true, false);
411
411
  },
412
- missingIdSet: () => {
412
+ missingSliceIdSet: () => {
413
413
  const result = _Example.ok.complete();
414
- const collection1 = result.collections._data[1];
415
- collection1.idSet = "MISSING1";
414
+ const layer1 = result.layers._data[1];
415
+ layer1.idSet = "MISSING1";
416
416
  return hip(result, true, false);
417
417
  },
418
- missingAssignedPropertyTable: () => {
418
+ missingAssignedIngredientTable: () => {
419
419
  const result = _Example.ok.complete();
420
- delete result.properties;
420
+ delete result.ingredients;
421
421
  return result;
422
422
  },
423
- missingAssignedProperty: () => {
423
+ missingAssignedIngredient: () => {
424
424
  const result = _Example.ok.complete();
425
- result.properties._data.splice(1, 2);
425
+ result.ingredients._data.splice(1, 2);
426
426
  return hip(result, true, false);
427
427
  }
428
428
  },
429
429
  cakes: {
430
- missingIdSet: () => {
430
+ missingSliceIdSet: () => {
431
431
  const result = _Example.ok.complete();
432
432
  result.cakes._data[0].idSet = "MISSING";
433
433
  hip(result.cakes, true, false);
434
434
  return result;
435
435
  },
436
- missingCollectionsTable: () => {
436
+ missingLayersTable: () => {
437
437
  const result = _Example.ok.complete();
438
- result.cakes._data[0].collections = "MISSING";
438
+ result.cakes._data[0].layersTable = "MISSING";
439
439
  hip(result.cakes, true, false);
440
440
  return result;
441
441
  },
442
- missingLayerCollection: () => {
442
+ missingCakeLayer: () => {
443
443
  const result = _Example.ok.complete();
444
444
  result.cakes._data[0].layers["layer0"] = "MISSING0";
445
445
  result.cakes._data[0].layers["layer1"] = "MISSING1";
@@ -483,24 +483,24 @@ const exampleTableCfg = (tableCfg = void 0) => {
483
483
  type: "number"
484
484
  }
485
485
  },
486
- type: (tableCfg == null ? void 0 : tableCfg.type) ?? "properties"
486
+ type: (tableCfg == null ? void 0 : tableCfg.type) ?? "ingredients"
487
487
  };
488
488
  };
489
489
  // @license
490
490
  const rljsonIndexed = (rljson) => {
491
491
  const result = {};
492
492
  for (const key in rljson) {
493
- const item = rljson[key];
494
- if (typeof item != "object") {
495
- result[key] = item;
493
+ const slice = rljson[key];
494
+ if (typeof slice != "object") {
495
+ result[key] = slice;
496
496
  continue;
497
497
  }
498
498
  const dataIndexed = {};
499
- result[key] = { ...item };
500
- if (!Array.isArray(item._data)) {
499
+ result[key] = { ...slice };
500
+ if (!Array.isArray(slice._data)) {
501
501
  continue;
502
502
  }
503
- for (const row of item._data) {
503
+ for (const row of slice._data) {
504
504
  const hashedRow = row._hash ? row : hsh(row);
505
505
  const hash = hashedRow._hash;
506
506
  dataIndexed[hash] = hashedRow;
@@ -511,7 +511,7 @@ const rljsonIndexed = (rljson) => {
511
511
  };
512
512
  // @license
513
513
  const reservedFieldNames = ["_type", "_data"];
514
- const reservedTableKeys = ["_hash", "idSets", "tableCfgs"];
514
+ const reservedTableKeys = ["_hash", "sliceIds", "tableCfgs"];
515
515
  const exampleRljson = () => Example.ok.singleRow();
516
516
  const iterateTables = (rljson, callback) => {
517
517
  for (const tableKey in rljson) {
@@ -526,16 +526,16 @@ const iterateTables = (rljson, callback) => {
526
526
  const contentTypes = [
527
527
  "buffets",
528
528
  "cakes",
529
- "collections",
530
- "idSets",
531
- "properties"
529
+ "layers",
530
+ "sliceIds",
531
+ "ingredients"
532
532
  ];
533
533
  const exampleTypedefs = () => {
534
534
  return {
535
535
  ref: "ref",
536
- itemId: "itemId",
536
+ sliceId: "sliceId",
537
537
  tableKey: "tableKey",
538
- contentType: "collections"
538
+ contentType: "layers"
539
539
  };
540
540
  };
541
541
  // @license
@@ -589,15 +589,15 @@ class _BaseValidator {
589
589
  () => this._tableTypesDoNotMatch(),
590
590
  // Check references
591
591
  () => this._refsNotFound(),
592
- // Check collections
593
- () => this._collectionBasesNotFound(),
594
- () => this._collectionIdSetsTableNotFound(),
595
- () => this._collectionIdSetNotFound(),
596
- () => this._collectionPropertyAssignmentsNotFound(),
592
+ // Check layers
593
+ () => this._layerBasesNotFound(),
594
+ () => this._layerSliceIdsTableNotFound(),
595
+ () => this._layerSliceIdsNotFound(),
596
+ () => this._layerIngredientAssignmentsNotFound(),
597
597
  // Check cakes
598
- () => this._cakeIdSetsTableNotFound(),
599
- () => this._cakeIdSetNotFound(),
600
- () => this._cakeCollectionTablesNotFound(),
598
+ () => this._cakeSliceIdsTableNotFound(),
599
+ () => this._cakeSliceIdsNotFound(),
600
+ () => this._cakeLayerTablesNotFound(),
601
601
  // Check buffets
602
602
  () => this._buffetReferencedTableNotFound()
603
603
  ];
@@ -976,147 +976,147 @@ class _BaseValidator {
976
976
  };
977
977
  }
978
978
  }
979
- _collectionBasesNotFound() {
980
- const brokenCollections = [];
979
+ _layerBasesNotFound() {
980
+ const brokenLayers = [];
981
981
  iterateTables(this.rljson, (tableKey, table) => {
982
- if (table._type !== "collections") {
982
+ if (table._type !== "layers") {
983
983
  return;
984
984
  }
985
- const collectionsIndexed = this.rljsonIndexed[tableKey];
986
- const collectionsTable = table;
987
- for (const collection of collectionsTable._data) {
988
- const baseRef = collection.base;
985
+ const layersIndexed = this.rljsonIndexed[tableKey];
986
+ const layersTable = table;
987
+ for (const layer of layersTable._data) {
988
+ const baseRef = layer.base;
989
989
  if (!baseRef) {
990
990
  continue;
991
991
  }
992
- const baseCollection = collectionsIndexed._data[baseRef];
993
- if (!baseCollection) {
994
- brokenCollections.push({
995
- collectionsTable: tableKey,
996
- brokenCollection: collection._hash,
997
- missingBaseCollection: baseRef
992
+ const baseLayer = layersIndexed._data[baseRef];
993
+ if (!baseLayer) {
994
+ brokenLayers.push({
995
+ layersTable: tableKey,
996
+ brokenLayer: layer._hash,
997
+ missingBaseLayer: baseRef
998
998
  });
999
999
  }
1000
1000
  }
1001
1001
  });
1002
- if (brokenCollections.length > 0) {
1003
- this.errors.collectionBasesNotFound = {
1004
- error: "Base collections are missing",
1005
- brokenCollections
1002
+ if (brokenLayers.length > 0) {
1003
+ this.errors.layerBasesNotFound = {
1004
+ error: "Base layers are missing",
1005
+ brokenLayers
1006
1006
  };
1007
1007
  }
1008
1008
  }
1009
- _collectionIdSetsTableNotFound() {
1010
- const brokenCollections = [];
1009
+ _layerSliceIdsTableNotFound() {
1010
+ const brokenLayers = [];
1011
1011
  iterateTables(this.rljson, (tableKey, table) => {
1012
- if (table._type !== "collections") {
1012
+ if (table._type !== "layers") {
1013
1013
  return;
1014
1014
  }
1015
- const collectionsTable = table;
1016
- for (const collection of collectionsTable._data) {
1017
- const idSets = collection.idSetsTable;
1018
- if (!idSets) {
1015
+ const layersTable = table;
1016
+ for (const layer of layersTable._data) {
1017
+ const sliceIds = layer.sliceIdsTable;
1018
+ if (!sliceIds) {
1019
1019
  continue;
1020
1020
  }
1021
- const idSetsTable = this.rljsonIndexed[idSets];
1022
- if (!idSetsTable) {
1023
- brokenCollections.push({
1024
- collectionsTable: tableKey,
1025
- collectionHash: collection._hash,
1026
- missingIdSetsTable: idSets
1021
+ const sliceIdsTable = this.rljsonIndexed[sliceIds];
1022
+ if (!sliceIdsTable) {
1023
+ brokenLayers.push({
1024
+ layersTable: tableKey,
1025
+ layerHash: layer._hash,
1026
+ missingSliceIdsTable: sliceIds
1027
1027
  });
1028
1028
  }
1029
1029
  }
1030
1030
  });
1031
- if (brokenCollections.length > 0) {
1032
- this.errors.collectionIdSetsTableNotFound = {
1031
+ if (brokenLayers.length > 0) {
1032
+ this.errors.layerSliceIdsTableNotFound = {
1033
1033
  error: "Id sets tables are missing",
1034
- brokenCollections
1034
+ brokenLayers
1035
1035
  };
1036
1036
  }
1037
1037
  }
1038
- _collectionIdSetNotFound() {
1039
- const brokenCollections = [];
1038
+ _layerSliceIdsNotFound() {
1039
+ const brokenLayers = [];
1040
1040
  iterateTables(this.rljson, (tableKey, table) => {
1041
- if (table._type !== "collections") {
1041
+ if (table._type !== "layers") {
1042
1042
  return;
1043
1043
  }
1044
- const collectionsTable = table;
1045
- for (const collection of collectionsTable._data) {
1046
- const idSetRef = collection.idSet;
1044
+ const layersTable = table;
1045
+ for (const layer of layersTable._data) {
1046
+ const idSetRef = layer.idSet;
1047
1047
  if (!idSetRef) {
1048
1048
  continue;
1049
1049
  }
1050
- const idSets = collection.idSetsTable;
1051
- const idSetsTable = this.rljsonIndexed[idSets];
1052
- const idSet = idSetsTable._data[idSetRef];
1050
+ const sliceIds = layer.sliceIdsTable;
1051
+ const sliceIdsTable = this.rljsonIndexed[sliceIds];
1052
+ const idSet = sliceIdsTable._data[idSetRef];
1053
1053
  if (!idSet) {
1054
- brokenCollections.push({
1055
- collectionsTable: tableKey,
1056
- collectionHash: collection._hash,
1057
- missingIdSet: idSetRef
1054
+ brokenLayers.push({
1055
+ layersTable: tableKey,
1056
+ layerHash: layer._hash,
1057
+ missingSliceIds: idSetRef
1058
1058
  });
1059
1059
  }
1060
1060
  }
1061
1061
  });
1062
- if (brokenCollections.length > 0) {
1063
- this.errors.collectionIdSetNotFound = {
1064
- error: "Id sets of collections are missing",
1065
- brokenCollections
1062
+ if (brokenLayers.length > 0) {
1063
+ this.errors.layerSliceIdsNotFound = {
1064
+ error: "Id sets of layers are missing",
1065
+ brokenLayers
1066
1066
  };
1067
1067
  }
1068
1068
  }
1069
- _collectionPropertyAssignmentsNotFound() {
1070
- const missingPropertyTables = [];
1069
+ _layerIngredientAssignmentsNotFound() {
1070
+ const missingIngredientTables = [];
1071
1071
  const brokenAssignments = [];
1072
1072
  iterateTables(this.rljson, (tableKey, table) => {
1073
- if (table._type !== "collections") {
1073
+ if (table._type !== "layers") {
1074
1074
  return;
1075
1075
  }
1076
- const collectionsTable = table;
1077
- for (const collection of collectionsTable._data) {
1078
- const propertyTableKey = collection.properties;
1079
- const propertiesTable = this.rljsonIndexed[propertyTableKey];
1080
- if (!propertiesTable) {
1081
- missingPropertyTables.push({
1082
- brokenCollection: collection._hash,
1083
- collectionsTable: tableKey,
1084
- missingPropertyTable: propertyTableKey
1076
+ const layersTable = table;
1077
+ for (const layer of layersTable._data) {
1078
+ const ingredientTableKey = layer.ingredientsTable;
1079
+ const ingredientsTable = this.rljsonIndexed[ingredientTableKey];
1080
+ if (!ingredientsTable) {
1081
+ missingIngredientTables.push({
1082
+ brokenLayer: layer._hash,
1083
+ layersTable: tableKey,
1084
+ missingIngredientTable: ingredientTableKey
1085
1085
  });
1086
1086
  continue;
1087
1087
  }
1088
- const assignments = collection.assign;
1089
- for (const itemId in assignments) {
1090
- if (itemId.startsWith("_")) {
1088
+ const assignments = layer.assign;
1089
+ for (const sliceId in assignments) {
1090
+ if (sliceId.startsWith("_")) {
1091
1091
  continue;
1092
1092
  }
1093
- const propertyHash = assignments[itemId];
1094
- if (!propertiesTable._data[propertyHash]) {
1093
+ const ingredientHash = assignments[sliceId];
1094
+ if (!ingredientsTable._data[ingredientHash]) {
1095
1095
  brokenAssignments.push({
1096
- collectionsTable: tableKey,
1097
- brokenCollection: collection._hash,
1098
- referencedPropertyTable: propertyTableKey,
1099
- brokenAssignment: itemId,
1100
- missingProperty: propertyHash
1096
+ layersTable: tableKey,
1097
+ brokenLayer: layer._hash,
1098
+ referencedIngredientTable: ingredientTableKey,
1099
+ brokenAssignment: sliceId,
1100
+ missingIngredient: ingredientHash
1101
1101
  });
1102
1102
  }
1103
1103
  }
1104
1104
  }
1105
1105
  });
1106
- if (missingPropertyTables.length > 0) {
1107
- this.errors.collectionPropertyTablesNotFound = {
1108
- error: "Collection property tables do not exist",
1109
- collections: missingPropertyTables
1106
+ if (missingIngredientTables.length > 0) {
1107
+ this.errors.layerIngredientTablesNotFound = {
1108
+ error: "Layer ingredient tables do not exist",
1109
+ layers: missingIngredientTables
1110
1110
  };
1111
1111
  }
1112
1112
  if (brokenAssignments.length > 0) {
1113
- this.errors.collectionPropertyAssignmentsNotFound = {
1114
- error: "Collection property assignments are broken",
1113
+ this.errors.layerIngredientAssignmentsNotFound = {
1114
+ error: "Layer ingredient assignments are broken",
1115
1115
  brokenAssignments
1116
1116
  };
1117
1117
  }
1118
1118
  }
1119
- _cakeIdSetsTableNotFound() {
1119
+ _cakeSliceIdsTableNotFound() {
1120
1120
  const brokenCakes = [];
1121
1121
  iterateTables(this.rljson, (tableKey, table) => {
1122
1122
  if (table._type !== "cakes") {
@@ -1124,28 +1124,28 @@ class _BaseValidator {
1124
1124
  }
1125
1125
  const cakesTable = table;
1126
1126
  for (const cake of cakesTable._data) {
1127
- const idSetsRef = cake.idSetsTable;
1128
- if (!idSetsRef) {
1127
+ const sliceIdsRef = cake.sliceIdsTable;
1128
+ if (!sliceIdsRef) {
1129
1129
  continue;
1130
1130
  }
1131
- const idSets = this.rljsonIndexed[idSetsRef];
1132
- if (!idSets) {
1131
+ const sliceIds = this.rljsonIndexed[sliceIdsRef];
1132
+ if (!sliceIds) {
1133
1133
  brokenCakes.push({
1134
1134
  cakeTable: tableKey,
1135
1135
  brokenCake: cake._hash,
1136
- missingIdSets: idSetsRef
1136
+ missingSliceIds: sliceIdsRef
1137
1137
  });
1138
1138
  }
1139
1139
  }
1140
1140
  });
1141
1141
  if (brokenCakes.length > 0) {
1142
- this.errors.cakeIdSetsTableNotFound = {
1142
+ this.errors.cakeSliceIdsTableNotFound = {
1143
1143
  error: "Id sets tables referenced by cakes are missing",
1144
1144
  brokenCakes
1145
1145
  };
1146
1146
  }
1147
1147
  }
1148
- _cakeIdSetNotFound() {
1148
+ _cakeSliceIdsNotFound() {
1149
1149
  const brokenCakes = [];
1150
1150
  iterateTables(this.rljson, (tableKey, table) => {
1151
1151
  if (table._type !== "cakes") {
@@ -1157,72 +1157,72 @@ class _BaseValidator {
1157
1157
  if (!idSetRef) {
1158
1158
  continue;
1159
1159
  }
1160
- const idSetsRef = cake.idSetsTable;
1161
- const idSets = this.rljsonIndexed[idSetsRef];
1162
- const idSet = idSets._data[idSetRef];
1160
+ const sliceIdsRef = cake.sliceIdsTable;
1161
+ const sliceIds = this.rljsonIndexed[sliceIdsRef];
1162
+ const idSet = sliceIds._data[idSetRef];
1163
1163
  if (!idSet) {
1164
1164
  brokenCakes.push({
1165
1165
  cakeTable: tableKey,
1166
1166
  brokenCake: cake._hash,
1167
- missingIdSet: idSetRef
1167
+ missingSliceIds: idSetRef
1168
1168
  });
1169
1169
  }
1170
1170
  }
1171
1171
  });
1172
1172
  if (brokenCakes.length > 0) {
1173
- this.errors.cakeIdSetNotFound = {
1173
+ this.errors.cakeSliceIdsNotFound = {
1174
1174
  error: "Id sets of cakes are missing",
1175
1175
  brokenCakes
1176
1176
  };
1177
1177
  }
1178
1178
  }
1179
- _cakeCollectionTablesNotFound() {
1180
- const missingCollectionTables = [];
1181
- const missingLayerCollections = [];
1179
+ _cakeLayerTablesNotFound() {
1180
+ const missingLayerTables = [];
1181
+ const missingCakeLayers = [];
1182
1182
  iterateTables(this.rljson, (tableKey, table) => {
1183
1183
  if (table._type !== "cakes") {
1184
1184
  return;
1185
1185
  }
1186
1186
  const cakesTable = table;
1187
1187
  for (const cake of cakesTable._data) {
1188
- const collectionsTableKey = cake.collections;
1189
- const collectionsTable = this.rljsonIndexed[collectionsTableKey];
1190
- if (!collectionsTable) {
1191
- missingCollectionTables.push({
1188
+ const layersTableKey = cake.layersTable;
1189
+ const layersTable = this.rljsonIndexed[layersTableKey];
1190
+ if (!layersTable) {
1191
+ missingLayerTables.push({
1192
1192
  cakeTable: tableKey,
1193
1193
  brokenCake: cake._hash,
1194
- missingCollectionsTable: collectionsTableKey
1194
+ missingLayersTable: layersTableKey
1195
1195
  });
1196
1196
  continue;
1197
1197
  }
1198
- for (const layer in cake.layers) {
1199
- if (layer.startsWith("_")) {
1198
+ for (const layerKey in cake.layers) {
1199
+ if (layerKey.startsWith("_")) {
1200
1200
  continue;
1201
1201
  }
1202
- const collectionRef = cake.layers[layer];
1203
- const collection = collectionsTable._data[collectionRef];
1204
- if (!collection) {
1205
- missingLayerCollections.push({
1202
+ const layerRef = cake.layers[layerKey];
1203
+ const layer = layersTable._data[layerRef];
1204
+ if (!layer) {
1205
+ missingCakeLayers.push({
1206
1206
  cakeTable: tableKey,
1207
1207
  brokenCake: cake._hash,
1208
- brokenLayerName: layer,
1209
- collectionsTable: collectionsTableKey,
1210
- missingCollection: collectionRef
1208
+ brokenLayerName: layerKey,
1209
+ layersTable: layersTableKey,
1210
+ missingLayer: layerRef
1211
1211
  });
1212
1212
  }
1213
1213
  }
1214
1214
  }
1215
1215
  });
1216
- if (missingCollectionTables.length > 0) {
1217
- this.errors.cakeCollectionTablesNotFound = {
1218
- error: "Collection tables of cakes are missing",
1219
- brokenCakes: missingCollectionTables
1216
+ if (missingLayerTables.length > 0) {
1217
+ this.errors.cakeLayerTablesNotFound = {
1218
+ error: "Layer tables of cakes are missing",
1219
+ brokenCakes: missingLayerTables
1220
1220
  };
1221
1221
  }
1222
- if (missingLayerCollections.length > 0) {
1223
- this.errors.cakeLayerCollectionsNotFound = {
1224
- error: "Layer collections of cakes are missing",
1225
- brokenCakes: missingLayerCollections
1222
+ if (missingCakeLayers.length > 0) {
1223
+ this.errors.cakeLayersNotFound = {
1224
+ error: "Layer layers of cakes are missing",
1225
+ brokenCakes: missingCakeLayers
1226
1226
  };
1227
1227
  }
1228
1228
  }
@@ -1319,10 +1319,10 @@ export {
1319
1319
  contentTypes,
1320
1320
  exampleBuffetsTable,
1321
1321
  exampleCakesTable,
1322
- exampleCollectionsTable,
1323
- exampleIdSetsTable,
1324
- examplePropertiesTable,
1322
+ exampleIngredientsTable,
1323
+ exampleLayersTable,
1325
1324
  exampleRljson,
1325
+ exampleSliceIdsTable,
1326
1326
  exampleTableCfg,
1327
1327
  exampleTableCfgTable,
1328
1328
  exampleTypedefs,