@rljson/io 0.0.47 → 0.0.48

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.
@@ -9,35 +9,47 @@
9
9
  {
10
10
  "key": "_hash",
11
11
  "type": "string",
12
- "_hash": "df4oYftB-71Njv9FprRCeg"
12
+ "titleShort": "Hash",
13
+ "titleLong": "Row Hash",
14
+ "_hash": "2QxgcOKzL6zsVCo9Yi_5Ke"
13
15
  },
14
16
  {
15
17
  "key": "table",
16
18
  "type": "string",
17
- "_hash": "FmsYjsit04XJi02Sihdwl-"
19
+ "titleShort": "Table",
20
+ "titleLong": "Table Key",
21
+ "_hash": "dxePvdUNnwg2TdHEAPlzcL"
18
22
  },
19
23
  {
20
24
  "key": "predecessor",
21
25
  "type": "string",
22
- "_hash": "RlAk7Lj-lZf2KDlUk5fekZ"
26
+ "titleShort": "Predecessor",
27
+ "titleLong": "Predecessor Revision Hash",
28
+ "_hash": "DX2BPCXbaK-WFn4Oy9hYjg"
23
29
  },
24
30
  {
25
31
  "key": "successor",
26
32
  "type": "string",
27
- "_hash": "MJlFtQVty5oUJKVzzj5hyB"
33
+ "titleShort": "Successor",
34
+ "titleLong": "Successor Revision Hash",
35
+ "_hash": "w-IMk9JjuBkgt88ddVGV7B"
28
36
  },
29
37
  {
30
38
  "key": "timestamp",
31
39
  "type": "number",
32
- "_hash": "XpKYGh23thW6vONgQuoMHf"
40
+ "titleShort": "Timestamp",
41
+ "titleLong": "Revision Timestamp",
42
+ "_hash": "G9EloAJ1OVidMrffwSVrLt"
33
43
  },
34
44
  {
35
45
  "key": "id",
36
46
  "type": "string",
37
- "_hash": "eq2P3RIaSgy81i7PomNUvn"
47
+ "titleShort": "ID",
48
+ "titleLong": "Revision ID",
49
+ "_hash": "gwBBBa7SXFx2Zfz00JYdCR"
38
50
  }
39
51
  ],
40
- "_hash": "2ztQLyMtsFFIs0z_rvT6UL"
52
+ "_hash": "KFWwSAaR3bnqCwesHeAN4k"
41
53
  },
42
54
  {
43
55
  "key": "table0",
@@ -70,7 +82,7 @@
70
82
  "_hash": "wfRMrOPA2C9ogANQmzsI7K"
71
83
  },
72
84
  {
73
- "_hash": "er5aXXmEqihTA7Y1glILb4",
85
+ "_hash": "jERNpYntKnsV66yxoS2xOg",
74
86
  "key": "tableCfgs",
75
87
  "type": "tableCfgs",
76
88
  "isHead": false,
@@ -81,42 +93,58 @@
81
93
  {
82
94
  "key": "_hash",
83
95
  "type": "string",
84
- "_hash": "df4oYftB-71Njv9FprRCeg"
96
+ "titleShort": "Hash",
97
+ "titleLong": "Row Hash",
98
+ "_hash": "2QxgcOKzL6zsVCo9Yi_5Ke"
85
99
  },
86
100
  {
87
101
  "key": "key",
88
102
  "type": "string",
89
- "_hash": "tapEY-QdaJwWhz1PPZoG35"
103
+ "titleShort": "Key",
104
+ "titleLong": "Table Key",
105
+ "_hash": "vXW6G031fGusGpEgdnVWmt"
90
106
  },
91
107
  {
92
108
  "key": "type",
93
109
  "type": "string",
94
- "_hash": "zE7ALsNzu5JPgDD4AxeRCh"
110
+ "titleShort": "Type",
111
+ "titleLong": "Content Type",
112
+ "_hash": "X2upWVtQ02TKW3mj6SqU0c"
95
113
  },
96
114
  {
97
115
  "key": "isHead",
98
116
  "type": "boolean",
99
- "_hash": "ar8Hajt2UZDn-F21QLMyC_"
117
+ "titleShort": "Is Head",
118
+ "titleLong": "Is Head Table",
119
+ "_hash": "A-q9m5MVPMRVN6hk4pAMLH"
100
120
  },
101
121
  {
102
122
  "key": "isRoot",
103
123
  "type": "boolean",
104
- "_hash": "hedsCm_HtiiTuzJyTeMqhm"
124
+ "titleShort": "Is Root",
125
+ "titleLong": "Is Root Table",
126
+ "_hash": "qYiiwGCxzUtxlqIvZeU1rh"
105
127
  },
106
128
  {
107
129
  "key": "isShared",
108
130
  "type": "boolean",
109
- "_hash": "pxXOf3-3qCo9Z3FzC9JXSH"
131
+ "titleShort": "Is Shared",
132
+ "titleLong": "Is Shared Table",
133
+ "_hash": "jS9CqQBxXDhz1IB6PET4-P"
110
134
  },
111
135
  {
112
136
  "key": "previous",
113
137
  "type": "string",
114
- "_hash": "e0TEeDmSvJcLEMtrVxc0oW"
138
+ "titleShort": "Previous",
139
+ "titleLong": "Previous Table Configuration Hash",
140
+ "_hash": "0EgSa6oJSjOqjUCqlJzb5E"
115
141
  },
116
142
  {
117
143
  "key": "columns",
118
144
  "type": "jsonArray",
119
- "_hash": "aPmGTcNng9E1RvlEj1LtxB"
145
+ "titleShort": "Columns",
146
+ "titleLong": "Column Configurations",
147
+ "_hash": "GRV_4vc3xouarDpc1ZXE2_"
120
148
  }
121
149
  ]
122
150
  }
@@ -12,38 +12,50 @@
12
12
  {
13
13
  "key": "_hash",
14
14
  "type": "string",
15
- "_hash": "df4oYftB-71Njv9FprRCeg"
15
+ "titleShort": "Hash",
16
+ "titleLong": "Row Hash",
17
+ "_hash": "2QxgcOKzL6zsVCo9Yi_5Ke"
16
18
  },
17
19
  {
18
20
  "key": "table",
19
21
  "type": "string",
20
- "_hash": "FmsYjsit04XJi02Sihdwl-"
22
+ "titleShort": "Table",
23
+ "titleLong": "Table Key",
24
+ "_hash": "dxePvdUNnwg2TdHEAPlzcL"
21
25
  },
22
26
  {
23
27
  "key": "predecessor",
24
28
  "type": "string",
25
- "_hash": "RlAk7Lj-lZf2KDlUk5fekZ"
29
+ "titleShort": "Predecessor",
30
+ "titleLong": "Predecessor Revision Hash",
31
+ "_hash": "DX2BPCXbaK-WFn4Oy9hYjg"
26
32
  },
27
33
  {
28
34
  "key": "successor",
29
35
  "type": "string",
30
- "_hash": "MJlFtQVty5oUJKVzzj5hyB"
36
+ "titleShort": "Successor",
37
+ "titleLong": "Successor Revision Hash",
38
+ "_hash": "w-IMk9JjuBkgt88ddVGV7B"
31
39
  },
32
40
  {
33
41
  "key": "timestamp",
34
42
  "type": "number",
35
- "_hash": "XpKYGh23thW6vONgQuoMHf"
43
+ "titleShort": "Timestamp",
44
+ "titleLong": "Revision Timestamp",
45
+ "_hash": "G9EloAJ1OVidMrffwSVrLt"
36
46
  },
37
47
  {
38
48
  "key": "id",
39
49
  "type": "string",
40
- "_hash": "eq2P3RIaSgy81i7PomNUvn"
50
+ "titleShort": "ID",
51
+ "titleLong": "Revision ID",
52
+ "_hash": "gwBBBa7SXFx2Zfz00JYdCR"
41
53
  }
42
54
  ],
43
- "_hash": "2ztQLyMtsFFIs0z_rvT6UL"
55
+ "_hash": "KFWwSAaR3bnqCwesHeAN4k"
44
56
  },
45
57
  {
46
- "_hash": "er5aXXmEqihTA7Y1glILb4",
58
+ "_hash": "jERNpYntKnsV66yxoS2xOg",
47
59
  "key": "tableCfgs",
48
60
  "type": "tableCfgs",
49
61
  "isHead": false,
@@ -54,47 +66,63 @@
54
66
  {
55
67
  "key": "_hash",
56
68
  "type": "string",
57
- "_hash": "df4oYftB-71Njv9FprRCeg"
69
+ "titleShort": "Hash",
70
+ "titleLong": "Row Hash",
71
+ "_hash": "2QxgcOKzL6zsVCo9Yi_5Ke"
58
72
  },
59
73
  {
60
74
  "key": "key",
61
75
  "type": "string",
62
- "_hash": "tapEY-QdaJwWhz1PPZoG35"
76
+ "titleShort": "Key",
77
+ "titleLong": "Table Key",
78
+ "_hash": "vXW6G031fGusGpEgdnVWmt"
63
79
  },
64
80
  {
65
81
  "key": "type",
66
82
  "type": "string",
67
- "_hash": "zE7ALsNzu5JPgDD4AxeRCh"
83
+ "titleShort": "Type",
84
+ "titleLong": "Content Type",
85
+ "_hash": "X2upWVtQ02TKW3mj6SqU0c"
68
86
  },
69
87
  {
70
88
  "key": "isHead",
71
89
  "type": "boolean",
72
- "_hash": "ar8Hajt2UZDn-F21QLMyC_"
90
+ "titleShort": "Is Head",
91
+ "titleLong": "Is Head Table",
92
+ "_hash": "A-q9m5MVPMRVN6hk4pAMLH"
73
93
  },
74
94
  {
75
95
  "key": "isRoot",
76
96
  "type": "boolean",
77
- "_hash": "hedsCm_HtiiTuzJyTeMqhm"
97
+ "titleShort": "Is Root",
98
+ "titleLong": "Is Root Table",
99
+ "_hash": "qYiiwGCxzUtxlqIvZeU1rh"
78
100
  },
79
101
  {
80
102
  "key": "isShared",
81
103
  "type": "boolean",
82
- "_hash": "pxXOf3-3qCo9Z3FzC9JXSH"
104
+ "titleShort": "Is Shared",
105
+ "titleLong": "Is Shared Table",
106
+ "_hash": "jS9CqQBxXDhz1IB6PET4-P"
83
107
  },
84
108
  {
85
109
  "key": "previous",
86
110
  "type": "string",
87
- "_hash": "e0TEeDmSvJcLEMtrVxc0oW"
111
+ "titleShort": "Previous",
112
+ "titleLong": "Previous Table Configuration Hash",
113
+ "_hash": "0EgSa6oJSjOqjUCqlJzb5E"
88
114
  },
89
115
  {
90
116
  "key": "columns",
91
117
  "type": "jsonArray",
92
- "_hash": "aPmGTcNng9E1RvlEj1LtxB"
118
+ "titleShort": "Columns",
119
+ "titleLong": "Column Configurations",
120
+ "_hash": "GRV_4vc3xouarDpc1ZXE2_"
93
121
  }
94
122
  ]
95
123
  }
96
124
  ],
97
- "_tableCfg": "er5aXXmEqihTA7Y1glILb4",
98
- "_hash": "_u8EEswMCQtr4EKdi4F2Ti"
125
+ "_tableCfg": "jERNpYntKnsV66yxoS2xOg",
126
+ "_hash": "6iuL4dWHnsKqfvyAdVizTC"
99
127
  }
100
128
  }
@@ -16,16 +16,33 @@
16
16
 
17
17
 
18
18
  import { hip, hsh, rmhsh } from '@rljson/hash';
19
- import { addColumnsToTableCfg, exampleTableCfg, Rljson, TableCfg, TableType } from '@rljson/rljson';
20
-
21
- import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it } from 'vitest';
19
+ import {
20
+ addColumnsToTableCfg,
21
+ exampleTableCfg,
22
+ Rljson,
23
+ TableCfg,
24
+ TableType,
25
+ } from '@rljson/rljson';
26
+
27
+ import {
28
+ afterAll,
29
+ afterEach,
30
+ beforeAll,
31
+ beforeEach,
32
+ describe,
33
+ expect,
34
+ it,
35
+ } from 'vitest';
22
36
 
23
37
  import { Io, IoTestSetup, IoTools } from '@rljson/io';
24
38
 
25
- import { testMemSetup, testPeerServerSetup, testPeerSetup } from './io-conformance.setup.ts';
39
+ import {
40
+ testMemSetup,
41
+ testPeerServerSetup,
42
+ testPeerSetup,
43
+ } from './io-conformance.setup.ts';
26
44
  import { expectGolden, ExpectGoldenOptions } from './setup/goldens.ts';
27
45
 
28
-
29
46
  const ego: ExpectGoldenOptions = {
30
47
  npmUpdateGoldensEnabled: false,
31
48
  };
@@ -179,7 +196,7 @@ export const runIoConformanceTests = (
179
196
  await expect(
180
197
  io.createOrExtendTable({ tableCfg: tableCfg }),
181
198
  ).rejects.toThrow(
182
- 'Hash "wrongHash" does not match the newly calculated one "uX24nHRtwkXRsq8l46cNRZ". ' +
199
+ 'Hash "wrongHash" does not match the newly calculated one "9jZWK-5WPpnlQHCWSPg80D". ' +
183
200
  'Please make sure that all systems are producing the same hashes.',
184
201
  );
185
202
 
@@ -190,7 +207,7 @@ export const runIoConformanceTests = (
190
207
  }
191
208
 
192
209
  expect(message).toBe(
193
- 'Hash "wrongHash" does not match the newly calculated one "uX24nHRtwkXRsq8l46cNRZ". ' +
210
+ 'Hash "wrongHash" does not match the newly calculated one "9jZWK-5WPpnlQHCWSPg80D". ' +
194
211
  'Please make sure that all systems are producing the same hashes.',
195
212
  );
196
213
  });
@@ -404,7 +421,7 @@ export const runIoConformanceTests = (
404
421
  b: 5,
405
422
  },
406
423
  ],
407
- _tableCfg: '_SmasX0fD_A_0sshe6lnTt',
424
+ _tableCfg: 'GUGis7DIUDWCLFUJQZwJQ1',
408
425
  _type: 'components',
409
426
  },
410
427
  };
@@ -412,9 +429,24 @@ export const runIoConformanceTests = (
412
429
 
413
430
  // Update the table by adding a new column
414
431
  const tableCfg2 = addColumnsToTableCfg(tableCfg, [
415
- { key: 'keyA1', type: 'string' },
416
- { key: 'keyA2', type: 'string' },
417
- { key: 'keyB2', type: 'string' },
432
+ {
433
+ key: 'keyA1',
434
+ type: 'string',
435
+ titleShort: 'Key A1',
436
+ titleLong: 'Key A1',
437
+ },
438
+ {
439
+ key: 'keyA2',
440
+ type: 'string',
441
+ titleShort: 'Key A2',
442
+ titleLong: 'Key A2',
443
+ },
444
+ {
445
+ key: 'keyB2',
446
+ type: 'string',
447
+ titleShort: 'Key B2',
448
+ titleLong: 'Key B2',
449
+ },
418
450
  ]);
419
451
 
420
452
  await io.createOrExtendTable({ tableCfg: tableCfg2 });
@@ -460,7 +492,7 @@ export const runIoConformanceTests = (
460
492
  keyB2: 'b2',
461
493
  },
462
494
  ],
463
- _tableCfg: 'E1tCMshAuHRJg5Gz6M-Fqd',
495
+ _tableCfg: '73RBnYL3eR5SRPx7rMFiWN',
464
496
  _type: 'components',
465
497
  },
466
498
  });
@@ -473,10 +505,30 @@ export const runIoConformanceTests = (
473
505
  const tableCfg: TableCfg = {
474
506
  ...exampleCfg,
475
507
  columns: [
476
- { key: '_hash', type: 'string' },
477
- { key: 'keyA1', type: 'string' },
478
- { key: 'keyA2', type: 'string' },
479
- { key: 'keyB2', type: 'string' },
508
+ {
509
+ key: '_hash',
510
+ type: 'string',
511
+ titleShort: 'Hash',
512
+ titleLong: 'Hash',
513
+ },
514
+ {
515
+ key: 'keyA1',
516
+ type: 'string',
517
+ titleShort: 'Key A1',
518
+ titleLong: 'Key A1',
519
+ },
520
+ {
521
+ key: 'keyA2',
522
+ type: 'string',
523
+ titleShort: 'Key A2',
524
+ titleLong: 'Key A2',
525
+ },
526
+ {
527
+ key: 'keyB2',
528
+ type: 'string',
529
+ titleShort: 'Key B2',
530
+ titleLong: 'Key B2',
531
+ },
480
532
  ],
481
533
  };
482
534
 
@@ -537,13 +589,48 @@ export const runIoConformanceTests = (
537
589
  const tableCfg: TableCfg = {
538
590
  ...exampleCfg,
539
591
  columns: [
540
- { key: '_hash', type: 'string' },
541
- { key: 'string', type: 'string' },
542
- { key: 'number', type: 'number' },
543
- { key: 'null', type: 'string' },
544
- { key: 'boolean', type: 'boolean' },
545
- { key: 'array', type: 'jsonArray' },
546
- { key: 'object', type: 'json' },
592
+ {
593
+ key: '_hash',
594
+ type: 'string',
595
+ titleShort: 'Hash',
596
+ titleLong: 'Hash',
597
+ },
598
+ {
599
+ key: 'string',
600
+ type: 'string',
601
+ titleShort: 'String',
602
+ titleLong: 'String',
603
+ },
604
+ {
605
+ key: 'number',
606
+ type: 'number',
607
+ titleShort: 'Number',
608
+ titleLong: 'Number',
609
+ },
610
+ {
611
+ key: 'null',
612
+ type: 'string',
613
+ titleShort: 'Null',
614
+ titleLong: 'Null',
615
+ },
616
+ {
617
+ key: 'boolean',
618
+ type: 'boolean',
619
+ titleShort: 'Boolean',
620
+ titleLong: 'Boolean',
621
+ },
622
+ {
623
+ key: 'array',
624
+ type: 'jsonArray',
625
+ titleShort: 'Array',
626
+ titleLong: 'Array',
627
+ },
628
+ {
629
+ key: 'object',
630
+ type: 'json',
631
+ titleShort: 'Object',
632
+ titleLong: 'Object',
633
+ },
547
634
  ],
548
635
  };
549
636
 
@@ -627,13 +714,48 @@ export const runIoConformanceTests = (
627
714
  const tableCfg: TableCfg = {
628
715
  ...exampleCfg,
629
716
  columns: [
630
- { key: '_hash', type: 'string' },
631
- { key: 'string', type: 'string' },
632
- { key: 'number', type: 'number' },
633
- { key: 'null', type: 'string' },
634
- { key: 'boolean', type: 'boolean' },
635
- { key: 'array', type: 'jsonArray' },
636
- { key: 'object', type: 'json' },
717
+ {
718
+ key: '_hash',
719
+ type: 'string',
720
+ titleShort: 'Hash',
721
+ titleLong: 'Hash',
722
+ },
723
+ {
724
+ key: 'string',
725
+ type: 'string',
726
+ titleShort: 'String',
727
+ titleLong: 'String',
728
+ },
729
+ {
730
+ key: 'number',
731
+ type: 'number',
732
+ titleShort: 'Number',
733
+ titleLong: 'Number',
734
+ },
735
+ {
736
+ key: 'null',
737
+ type: 'string',
738
+ titleShort: 'Null',
739
+ titleLong: 'Null',
740
+ },
741
+ {
742
+ key: 'boolean',
743
+ type: 'boolean',
744
+ titleShort: 'Boolean',
745
+ titleLong: 'Boolean',
746
+ },
747
+ {
748
+ key: 'array',
749
+ type: 'jsonArray',
750
+ titleShort: 'Array',
751
+ titleLong: 'Array',
752
+ },
753
+ {
754
+ key: 'object',
755
+ type: 'json',
756
+ titleShort: 'Object',
757
+ titleLong: 'Object',
758
+ },
637
759
  ],
638
760
  };
639
761