@aztec/kv-store 0.0.0-test.0

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 (166) hide show
  1. package/README.md +10 -0
  2. package/dest/config.d.ts +17 -0
  3. package/dest/config.d.ts.map +1 -0
  4. package/dest/config.js +24 -0
  5. package/dest/indexeddb/array.d.ts +21 -0
  6. package/dest/indexeddb/array.d.ts.map +1 -0
  7. package/dest/indexeddb/array.js +104 -0
  8. package/dest/indexeddb/index.d.ts +7 -0
  9. package/dest/indexeddb/index.d.ts.map +1 -0
  10. package/dest/indexeddb/index.js +19 -0
  11. package/dest/indexeddb/map.d.ts +26 -0
  12. package/dest/indexeddb/map.d.ts.map +1 -0
  13. package/dest/indexeddb/map.js +133 -0
  14. package/dest/indexeddb/set.d.ts +17 -0
  15. package/dest/indexeddb/set.d.ts.map +1 -0
  16. package/dest/indexeddb/set.js +24 -0
  17. package/dest/indexeddb/singleton.d.ts +16 -0
  18. package/dest/indexeddb/singleton.d.ts.map +1 -0
  19. package/dest/indexeddb/singleton.js +37 -0
  20. package/dest/indexeddb/store.d.ts +97 -0
  21. package/dest/indexeddb/store.d.ts.map +1 -0
  22. package/dest/indexeddb/store.js +164 -0
  23. package/dest/interfaces/array.d.ts +80 -0
  24. package/dest/interfaces/array.d.ts.map +1 -0
  25. package/dest/interfaces/array.js +3 -0
  26. package/dest/interfaces/array_test_suite.d.ts +3 -0
  27. package/dest/interfaces/array_test_suite.d.ts.map +1 -0
  28. package/dest/interfaces/array_test_suite.js +104 -0
  29. package/dest/interfaces/common.d.ts +23 -0
  30. package/dest/interfaces/common.d.ts.map +1 -0
  31. package/dest/interfaces/common.js +3 -0
  32. package/dest/interfaces/counter.d.ts +59 -0
  33. package/dest/interfaces/counter.d.ts.map +1 -0
  34. package/dest/interfaces/counter.js +1 -0
  35. package/dest/interfaces/index.d.ts +8 -0
  36. package/dest/interfaces/index.d.ts.map +1 -0
  37. package/dest/interfaces/index.js +6 -0
  38. package/dest/interfaces/map.d.ts +134 -0
  39. package/dest/interfaces/map.d.ts.map +1 -0
  40. package/dest/interfaces/map.js +3 -0
  41. package/dest/interfaces/map_test_suite.d.ts +3 -0
  42. package/dest/interfaces/map_test_suite.d.ts.map +1 -0
  43. package/dest/interfaces/map_test_suite.js +151 -0
  44. package/dest/interfaces/set.d.ts +44 -0
  45. package/dest/interfaces/set.d.ts.map +1 -0
  46. package/dest/interfaces/set.js +1 -0
  47. package/dest/interfaces/set_test_suite.d.ts +3 -0
  48. package/dest/interfaces/set_test_suite.d.ts.map +1 -0
  49. package/dest/interfaces/set_test_suite.js +96 -0
  50. package/dest/interfaces/singleton.d.ts +29 -0
  51. package/dest/interfaces/singleton.d.ts.map +1 -0
  52. package/dest/interfaces/singleton.js +4 -0
  53. package/dest/interfaces/singleton_test_suite.d.ts +3 -0
  54. package/dest/interfaces/singleton_test_suite.d.ts.map +1 -0
  55. package/dest/interfaces/singleton_test_suite.js +30 -0
  56. package/dest/interfaces/store.d.ts +145 -0
  57. package/dest/interfaces/store.d.ts.map +1 -0
  58. package/dest/interfaces/store.js +1 -0
  59. package/dest/interfaces/store_test_suite.d.ts +3 -0
  60. package/dest/interfaces/store_test_suite.d.ts.map +1 -0
  61. package/dest/interfaces/store_test_suite.js +37 -0
  62. package/dest/interfaces/utils.d.ts +16 -0
  63. package/dest/interfaces/utils.d.ts.map +1 -0
  64. package/dest/interfaces/utils.js +16 -0
  65. package/dest/lmdb/array.d.ts +23 -0
  66. package/dest/lmdb/array.d.ts.map +1 -0
  67. package/dest/lmdb/array.js +117 -0
  68. package/dest/lmdb/counter.d.ts +19 -0
  69. package/dest/lmdb/counter.d.ts.map +1 -0
  70. package/dest/lmdb/counter.js +50 -0
  71. package/dest/lmdb/index.d.ts +12 -0
  72. package/dest/lmdb/index.d.ts.map +1 -0
  73. package/dest/lmdb/index.js +25 -0
  74. package/dest/lmdb/map.d.ts +52 -0
  75. package/dest/lmdb/map.d.ts.map +1 -0
  76. package/dest/lmdb/map.js +222 -0
  77. package/dest/lmdb/set.d.ts +18 -0
  78. package/dest/lmdb/set.d.ts.map +1 -0
  79. package/dest/lmdb/set.js +32 -0
  80. package/dest/lmdb/singleton.d.ts +14 -0
  81. package/dest/lmdb/singleton.d.ts.map +1 -0
  82. package/dest/lmdb/singleton.js +26 -0
  83. package/dest/lmdb/store.d.ts +110 -0
  84. package/dest/lmdb/store.d.ts.map +1 -0
  85. package/dest/lmdb/store.js +216 -0
  86. package/dest/lmdb-v2/array.d.ts +18 -0
  87. package/dest/lmdb-v2/array.d.ts.map +1 -0
  88. package/dest/lmdb-v2/array.js +101 -0
  89. package/dest/lmdb-v2/factory.d.ts +12 -0
  90. package/dest/lmdb-v2/factory.d.ts.map +1 -0
  91. package/dest/lmdb-v2/factory.js +60 -0
  92. package/dest/lmdb-v2/index.d.ts +3 -0
  93. package/dest/lmdb-v2/index.d.ts.map +1 -0
  94. package/dest/lmdb-v2/index.js +2 -0
  95. package/dest/lmdb-v2/map.d.ts +86 -0
  96. package/dest/lmdb-v2/map.d.ts.map +1 -0
  97. package/dest/lmdb-v2/map.js +193 -0
  98. package/dest/lmdb-v2/message.d.ts +112 -0
  99. package/dest/lmdb-v2/message.d.ts.map +1 -0
  100. package/dest/lmdb-v2/message.js +18 -0
  101. package/dest/lmdb-v2/read_transaction.d.ts +14 -0
  102. package/dest/lmdb-v2/read_transaction.d.ts.map +1 -0
  103. package/dest/lmdb-v2/read_transaction.js +101 -0
  104. package/dest/lmdb-v2/singleton.d.ts +12 -0
  105. package/dest/lmdb-v2/singleton.d.ts.map +1 -0
  106. package/dest/lmdb-v2/singleton.js +31 -0
  107. package/dest/lmdb-v2/store.d.ts +43 -0
  108. package/dest/lmdb-v2/store.d.ts.map +1 -0
  109. package/dest/lmdb-v2/store.js +181 -0
  110. package/dest/lmdb-v2/utils.d.ts +19 -0
  111. package/dest/lmdb-v2/utils.d.ts.map +1 -0
  112. package/dest/lmdb-v2/utils.js +126 -0
  113. package/dest/lmdb-v2/write_transaction.d.ts +19 -0
  114. package/dest/lmdb-v2/write_transaction.d.ts.map +1 -0
  115. package/dest/lmdb-v2/write_transaction.js +254 -0
  116. package/dest/stores/index.d.ts +2 -0
  117. package/dest/stores/index.d.ts.map +1 -0
  118. package/dest/stores/index.js +1 -0
  119. package/dest/stores/l2_tips_store.d.ts +13 -0
  120. package/dest/stores/l2_tips_store.d.ts.map +1 -0
  121. package/dest/stores/l2_tips_store.js +65 -0
  122. package/dest/utils.d.ts +12 -0
  123. package/dest/utils.d.ts.map +1 -0
  124. package/dest/utils.js +24 -0
  125. package/package.json +99 -0
  126. package/src/config.ts +34 -0
  127. package/src/indexeddb/array.ts +118 -0
  128. package/src/indexeddb/index.ts +29 -0
  129. package/src/indexeddb/map.ts +142 -0
  130. package/src/indexeddb/set.ts +37 -0
  131. package/src/indexeddb/singleton.ts +49 -0
  132. package/src/indexeddb/store.ts +197 -0
  133. package/src/interfaces/array.ts +90 -0
  134. package/src/interfaces/array_test_suite.ts +130 -0
  135. package/src/interfaces/common.ts +20 -0
  136. package/src/interfaces/counter.ts +65 -0
  137. package/src/interfaces/index.ts +7 -0
  138. package/src/interfaces/map.ts +151 -0
  139. package/src/interfaces/map_test_suite.ts +143 -0
  140. package/src/interfaces/set.ts +48 -0
  141. package/src/interfaces/set_test_suite.ts +81 -0
  142. package/src/interfaces/singleton.ts +29 -0
  143. package/src/interfaces/singleton_test_suite.ts +46 -0
  144. package/src/interfaces/store.ts +177 -0
  145. package/src/interfaces/store_test_suite.ts +56 -0
  146. package/src/interfaces/utils.ts +21 -0
  147. package/src/lmdb/array.ts +139 -0
  148. package/src/lmdb/counter.ts +67 -0
  149. package/src/lmdb/index.ts +37 -0
  150. package/src/lmdb/map.ts +248 -0
  151. package/src/lmdb/set.ts +45 -0
  152. package/src/lmdb/singleton.ts +35 -0
  153. package/src/lmdb/store.ts +263 -0
  154. package/src/lmdb-v2/array.ts +115 -0
  155. package/src/lmdb-v2/factory.ts +98 -0
  156. package/src/lmdb-v2/index.ts +2 -0
  157. package/src/lmdb-v2/map.ts +233 -0
  158. package/src/lmdb-v2/message.ts +146 -0
  159. package/src/lmdb-v2/read_transaction.ts +116 -0
  160. package/src/lmdb-v2/singleton.ts +34 -0
  161. package/src/lmdb-v2/store.ts +237 -0
  162. package/src/lmdb-v2/utils.ts +150 -0
  163. package/src/lmdb-v2/write_transaction.ts +314 -0
  164. package/src/stores/index.ts +1 -0
  165. package/src/stores/l2_tips_store.ts +70 -0
  166. package/src/utils.ts +40 -0
@@ -0,0 +1,151 @@
1
+ import { toArray } from '@aztec/foundation/iterable';
2
+ import { expect } from 'chai';
3
+ import { isSyncStore } from './utils.js';
4
+ export function describeAztecMap(testName, getStore, forceAsync = false) {
5
+ describe(testName, ()=>{
6
+ let store;
7
+ let map;
8
+ beforeEach(async ()=>{
9
+ store = await getStore();
10
+ map = store.openMultiMap('test');
11
+ });
12
+ afterEach(async ()=>{
13
+ await store.delete();
14
+ });
15
+ async function get(key, sut = map) {
16
+ return isSyncStore(store) && !forceAsync ? sut.get(key) : await sut.getAsync(key);
17
+ }
18
+ async function entries() {
19
+ return isSyncStore(store) && !forceAsync ? await toArray(map.entries()) : await toArray(map.entriesAsync());
20
+ }
21
+ async function values() {
22
+ return isSyncStore(store) && !forceAsync ? await toArray(map.values()) : await toArray(map.valuesAsync());
23
+ }
24
+ async function keys(range, sut = map) {
25
+ return isSyncStore(store) && !forceAsync ? await toArray(sut.keys(range)) : await toArray(sut.keysAsync(range));
26
+ }
27
+ async function getValues(key) {
28
+ return isSyncStore(store) && !forceAsync ? await toArray(map.getValues(key)) : await toArray(map.getValuesAsync(key));
29
+ }
30
+ it('should be able to set and get values', async ()=>{
31
+ await map.set('foo', 'bar');
32
+ await map.set('baz', 'qux');
33
+ expect(await get('foo')).to.equal('bar');
34
+ expect(await get('baz')).to.equal('qux');
35
+ expect(await get('quux')).to.equal(undefined);
36
+ });
37
+ it('should be able to set values if they do not exist', async ()=>{
38
+ expect(await map.setIfNotExists('foo', 'bar')).to.equal(true);
39
+ expect(await map.setIfNotExists('foo', 'baz')).to.equal(false);
40
+ expect(await get('foo')).to.equal('bar');
41
+ });
42
+ it('should be able to delete values', async ()=>{
43
+ await map.set('foo', 'bar');
44
+ await map.set('baz', 'qux');
45
+ await map.delete('foo');
46
+ expect(await get('foo')).to.equal(undefined);
47
+ expect(await get('baz')).to.equal('qux');
48
+ });
49
+ it('should be able to iterate over entries when there are no keys', async ()=>{
50
+ expect(await entries()).to.deep.equal([]);
51
+ });
52
+ it('should be able to iterate over entries', async ()=>{
53
+ await map.set('foo', 'bar');
54
+ await map.set('baz', 'qux');
55
+ expect(await entries()).to.deep.equal([
56
+ [
57
+ 'baz',
58
+ 'qux'
59
+ ],
60
+ [
61
+ 'foo',
62
+ 'bar'
63
+ ]
64
+ ]);
65
+ });
66
+ it('should be able to iterate over values', async ()=>{
67
+ await map.set('foo', 'bar');
68
+ await map.set('baz', 'quux');
69
+ expect(await values()).to.deep.equal([
70
+ 'quux',
71
+ 'bar'
72
+ ]);
73
+ });
74
+ it('should be able to iterate over keys', async ()=>{
75
+ await map.set('foo', 'bar');
76
+ await map.set('baz', 'qux');
77
+ expect(await keys()).to.deep.equal([
78
+ 'baz',
79
+ 'foo'
80
+ ]);
81
+ });
82
+ it('should be able to get multiple values for a single key', async ()=>{
83
+ await map.set('foo', 'bar');
84
+ await map.set('foo', 'baz');
85
+ expect(await getValues('foo')).to.deep.equal([
86
+ 'bar',
87
+ 'baz'
88
+ ]);
89
+ });
90
+ it('should be able to delete individual values for a single key', async ()=>{
91
+ await map.set('foo', 'bar');
92
+ await map.set('foo', 'baz');
93
+ await map.deleteValue('foo', 'bar');
94
+ expect(await getValues('foo')).to.deep.equal([
95
+ 'baz'
96
+ ]);
97
+ });
98
+ it('supports range queries', async ()=>{
99
+ await map.set('a', 'a');
100
+ await map.set('b', 'b');
101
+ await map.set('c', 'c');
102
+ await map.set('d', 'd');
103
+ expect(await keys({
104
+ start: 'b',
105
+ end: 'c'
106
+ })).to.deep.equal([
107
+ 'b'
108
+ ]);
109
+ expect(await keys({
110
+ start: 'b'
111
+ })).to.deep.equal([
112
+ 'b',
113
+ 'c',
114
+ 'd'
115
+ ]);
116
+ expect(await keys({
117
+ end: 'c'
118
+ })).to.deep.equal([
119
+ 'a',
120
+ 'b'
121
+ ]);
122
+ expect(await keys({
123
+ start: 'b',
124
+ end: 'c',
125
+ reverse: true
126
+ })).to.deep.equal([
127
+ 'c'
128
+ ]);
129
+ expect(await keys({
130
+ start: 'b',
131
+ limit: 1
132
+ })).to.deep.equal([
133
+ 'b'
134
+ ]);
135
+ expect(await keys({
136
+ start: 'b',
137
+ reverse: true
138
+ })).to.deep.equal([
139
+ 'd',
140
+ 'c'
141
+ ]);
142
+ expect(await keys({
143
+ end: 'b',
144
+ reverse: true
145
+ })).to.deep.equal([
146
+ 'b',
147
+ 'a'
148
+ ]);
149
+ });
150
+ });
151
+ }
@@ -0,0 +1,44 @@
1
+ import type { Key, Range } from './common.js';
2
+ /**
3
+ * A set backed by a persistent store.
4
+ */
5
+ interface AztecBaseSet<K extends Key> {
6
+ /**
7
+ * Adds the given value.
8
+ * @param key - The key to add.
9
+ */
10
+ add(key: K): Promise<void>;
11
+ /**
12
+ * Deletes the given key.
13
+ * @param key - The key to delete.
14
+ */
15
+ delete(key: K): Promise<void>;
16
+ }
17
+ export interface AztecSet<K extends Key> extends AztecBaseSet<K> {
18
+ /**
19
+ * Checks if a key exists in the set.
20
+ * @param key - The key to check
21
+ * @returns True if the key exists, false otherwise
22
+ */
23
+ has(key: K): boolean;
24
+ /**
25
+ * Iterates over the sets's keys entries in the key's natural order
26
+ * @param range - The range of keys to iterate over
27
+ */
28
+ entries(range?: Range<K>): IterableIterator<K>;
29
+ }
30
+ export interface AztecAsyncSet<K extends Key> extends AztecBaseSet<K> {
31
+ /**
32
+ * Checks if a key exists in the set.
33
+ * @param key - The key to check
34
+ * @returns True if the key exists, false otherwise
35
+ */
36
+ hasAsync(key: K): Promise<boolean>;
37
+ /**
38
+ * Iterates over the sets's keys entries in the key's natural order
39
+ * @param range - The range of keys to iterate over
40
+ */
41
+ entriesAsync(range?: Range<K>): AsyncIterableIterator<K>;
42
+ }
43
+ export {};
44
+ //# sourceMappingURL=set.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set.d.ts","sourceRoot":"","sources":["../../src/interfaces/set.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAE9C;;GAEG;AACH,UAAU,YAAY,CAAC,CAAC,SAAS,GAAG;IAClC;;;OAGG;IACH,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3B;;;OAGG;IACH,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/B;AAED,MAAM,WAAW,QAAQ,CAAC,CAAC,SAAS,GAAG,CAAE,SAAQ,YAAY,CAAC,CAAC,CAAC;IAC9D;;;;OAIG;IACH,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC;IAErB;;;OAGG;IACH,OAAO,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;CAChD;AAED,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,GAAG,CAAE,SAAQ,YAAY,CAAC,CAAC,CAAC;IACnE;;;;OAIG;IACH,QAAQ,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEnC;;;OAGG;IACH,YAAY,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAC;CAC1D"}
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,3 @@
1
+ import type { AztecAsyncKVStore, AztecKVStore } from './store.js';
2
+ export declare function describeAztecSet(testName: string, getStore: () => AztecKVStore | Promise<AztecAsyncKVStore>, forceAsync?: boolean): void;
3
+ //# sourceMappingURL=set_test_suite.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set_test_suite.d.ts","sourceRoot":"","sources":["../../src/interfaces/set_test_suite.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAGlE,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,YAAY,GAAG,OAAO,CAAC,iBAAiB,CAAC,EACzD,UAAU,GAAE,OAAe,QAoE5B"}
@@ -0,0 +1,96 @@
1
+ import { toArray } from '@aztec/foundation/iterable';
2
+ import { expect } from 'chai';
3
+ import { isSyncStore } from './utils.js';
4
+ export function describeAztecSet(testName, getStore, forceAsync = false) {
5
+ describe(testName, ()=>{
6
+ let store;
7
+ let set;
8
+ beforeEach(async ()=>{
9
+ store = await getStore();
10
+ set = store.openSet('test');
11
+ });
12
+ afterEach(async ()=>{
13
+ await store.delete();
14
+ });
15
+ async function has(key) {
16
+ return isSyncStore(store) && !forceAsync ? set.has(key) : await set.hasAsync(key);
17
+ }
18
+ async function entries(range) {
19
+ return isSyncStore(store) && !forceAsync ? await toArray(set.entries(range)) : await toArray(set.entriesAsync(range));
20
+ }
21
+ it('should be able to set and get values', async ()=>{
22
+ await set.add('foo');
23
+ await set.add('baz');
24
+ expect(await has('foo')).to.equal(true);
25
+ expect(await has('baz')).to.equal(true);
26
+ expect(await has('bar')).to.equal(false);
27
+ });
28
+ it('should be able to delete values', async ()=>{
29
+ await set.add('foo');
30
+ await set.add('baz');
31
+ await set.delete('foo');
32
+ expect(await has('foo')).to.equal(false);
33
+ expect(await has('baz')).to.equal(true);
34
+ });
35
+ it('should be able to iterate over entries', async ()=>{
36
+ await set.add('baz');
37
+ await set.add('foo');
38
+ expect(await entries()).to.deep.equal([
39
+ 'baz',
40
+ 'foo'
41
+ ]);
42
+ });
43
+ it('supports range queries', async ()=>{
44
+ await set.add('a');
45
+ await set.add('b');
46
+ await set.add('c');
47
+ await set.add('d');
48
+ expect(await entries({
49
+ start: 'b',
50
+ end: 'c'
51
+ })).to.deep.equal([
52
+ 'b'
53
+ ]);
54
+ expect(await entries({
55
+ start: 'b'
56
+ })).to.deep.equal([
57
+ 'b',
58
+ 'c',
59
+ 'd'
60
+ ]);
61
+ expect(await entries({
62
+ end: 'c'
63
+ })).to.deep.equal([
64
+ 'a',
65
+ 'b'
66
+ ]);
67
+ expect(await entries({
68
+ start: 'b',
69
+ end: 'c',
70
+ reverse: true
71
+ })).to.deep.equal([
72
+ 'c'
73
+ ]);
74
+ expect(await entries({
75
+ start: 'b',
76
+ limit: 1
77
+ })).to.deep.equal([
78
+ 'b'
79
+ ]);
80
+ expect(await entries({
81
+ start: 'b',
82
+ reverse: true
83
+ })).to.deep.equal([
84
+ 'd',
85
+ 'c'
86
+ ]);
87
+ expect(await entries({
88
+ end: 'b',
89
+ reverse: true
90
+ })).to.deep.equal([
91
+ 'b',
92
+ 'a'
93
+ ]);
94
+ });
95
+ });
96
+ }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Represents a singleton value in the database.
3
+ * Note: The singleton loses type info so it's recommended to serialize to buffer when storing it.
4
+ */
5
+ interface AztecBaseSingleton<T> {
6
+ /**
7
+ * Sets the value.
8
+ * @param val - The new value
9
+ */
10
+ set(val: T): Promise<boolean>;
11
+ /**
12
+ * Deletes the value.
13
+ */
14
+ delete(): Promise<boolean>;
15
+ }
16
+ export interface AztecSingleton<T> extends AztecBaseSingleton<T> {
17
+ /**
18
+ * Gets the value.
19
+ */
20
+ get(): T | undefined;
21
+ }
22
+ export interface AztecAsyncSingleton<T> extends AztecBaseSingleton<T> {
23
+ /**
24
+ * Gets the value.
25
+ */
26
+ getAsync(): Promise<T | undefined>;
27
+ }
28
+ export {};
29
+ //# sourceMappingURL=singleton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"singleton.d.ts","sourceRoot":"","sources":["../../src/interfaces/singleton.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,UAAU,kBAAkB,CAAC,CAAC;IAC5B;;;OAGG;IACH,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAE9B;;OAEG;IACH,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;CAC5B;AACD,MAAM,WAAW,cAAc,CAAC,CAAC,CAAE,SAAQ,kBAAkB,CAAC,CAAC,CAAC;IAC9D;;OAEG;IACH,GAAG,IAAI,CAAC,GAAG,SAAS,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB,CAAC,CAAC,CAAE,SAAQ,kBAAkB,CAAC,CAAC,CAAC;IACnE;;OAEG;IACH,QAAQ,IAAI,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;CACpC"}
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Represents a singleton value in the database.
3
+ * Note: The singleton loses type info so it's recommended to serialize to buffer when storing it.
4
+ */ export { };
@@ -0,0 +1,3 @@
1
+ import type { AztecAsyncKVStore, AztecKVStore } from './store.js';
2
+ export declare function describeAztecSingleton(testName: string, getStore: () => AztecKVStore | Promise<AztecAsyncKVStore>, forceAsync?: boolean): void;
3
+ //# sourceMappingURL=singleton_test_suite.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"singleton_test_suite.d.ts","sourceRoot":"","sources":["../../src/interfaces/singleton_test_suite.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAGlE,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,YAAY,GAAG,OAAO,CAAC,iBAAiB,CAAC,EACzD,UAAU,GAAE,OAAe,QAoC5B"}
@@ -0,0 +1,30 @@
1
+ import { expect } from 'chai';
2
+ import { isSyncStore } from './utils.js';
3
+ export function describeAztecSingleton(testName, getStore, forceAsync = false) {
4
+ describe(testName, ()=>{
5
+ let store;
6
+ let singleton;
7
+ beforeEach(async ()=>{
8
+ store = await getStore();
9
+ singleton = store.openSingleton('test');
10
+ });
11
+ afterEach(async ()=>{
12
+ await store.delete();
13
+ });
14
+ async function get() {
15
+ return isSyncStore(store) && !forceAsync ? singleton.get() : await singleton.getAsync();
16
+ }
17
+ it('returns undefined if the value is not set', async ()=>{
18
+ expect(await get()).to.equal(undefined);
19
+ });
20
+ it('should be able to set and get values', async ()=>{
21
+ expect(await singleton.set('foo')).to.equal(true);
22
+ expect(await get()).to.equal('foo');
23
+ });
24
+ it('overwrites the value if it is set again', async ()=>{
25
+ expect(await singleton.set('foo')).to.equal(true);
26
+ expect(await singleton.set('bar')).to.equal(true);
27
+ expect(await get()).to.equal('bar');
28
+ });
29
+ });
30
+ }
@@ -0,0 +1,145 @@
1
+ import type { AztecArray, AztecAsyncArray } from './array.js';
2
+ import type { Key, StoreSize } from './common.js';
3
+ import type { AztecAsyncCounter, AztecCounter } from './counter.js';
4
+ import type { AztecAsyncMap, AztecAsyncMultiMap, AztecMap, AztecMapWithSize, AztecMultiMap, AztecMultiMapWithSize } from './map.js';
5
+ import type { AztecAsyncSet, AztecSet } from './set.js';
6
+ import type { AztecAsyncSingleton, AztecSingleton } from './singleton.js';
7
+ /** A key-value store */
8
+ export interface AztecKVStore {
9
+ syncGetters: true;
10
+ /**
11
+ * Creates a new map.
12
+ * @param name - The name of the map
13
+ * @returns The map
14
+ */
15
+ openMap<K extends Key, V>(name: string): AztecMap<K, V>;
16
+ /**
17
+ * Creates a new set.
18
+ * @param name - The name of the set
19
+ * @returns The set
20
+ */
21
+ openSet<K extends Key>(name: string): AztecSet<K>;
22
+ /**
23
+ * Creates a new multi-map.
24
+ * @param name - The name of the multi-map
25
+ * @returns The multi-map
26
+ */
27
+ openMultiMap<K extends Key, V>(name: string): AztecMultiMap<K, V>;
28
+ /**
29
+ * Creates a new multi-map with size.
30
+ * @param name - The name of the multi-map
31
+ * @returns The multi-map
32
+ */
33
+ openMultiMapWithSize<K extends Key, V>(name: string): AztecMultiMapWithSize<K, V>;
34
+ /**
35
+ * Creates a new map with size.
36
+ * @param name - The name of the map
37
+ * @returns The map
38
+ */
39
+ openMapWithSize<K extends Key, V>(name: string): AztecMapWithSize<K, V>;
40
+ /**
41
+ * Creates a new array.
42
+ * @param name - The name of the array
43
+ * @returns The array
44
+ */
45
+ openArray<T>(name: string): AztecArray<T>;
46
+ /**
47
+ * Creates a new singleton.
48
+ * @param name - The name of the singleton
49
+ * @returns The singleton
50
+ */
51
+ openSingleton<T>(name: string): AztecSingleton<T>;
52
+ /**
53
+ * Creates a new count map.
54
+ * @param name - name of the counter
55
+ */
56
+ openCounter<K extends Key>(name: string): AztecCounter<K>;
57
+ /**
58
+ * Starts a transaction. All calls to read/write data while in a transaction are queued and executed atomically.
59
+ * @param callback - The callback to execute in a transaction
60
+ */
61
+ transaction<T extends Exclude<any, Promise<any>>>(callback: () => T): Promise<T>;
62
+ /**
63
+ * Clears all entries in the store
64
+ */
65
+ clear(): Promise<void>;
66
+ /**
67
+ * Forks the store.
68
+ */
69
+ fork(): Promise<AztecKVStore>;
70
+ /**
71
+ * Deletes the store
72
+ */
73
+ delete(): Promise<void>;
74
+ /**
75
+ * Estimates the size of the store in bytes.
76
+ */
77
+ estimateSize(): Promise<StoreSize>;
78
+ /**
79
+ * Closes the store
80
+ */
81
+ close(): Promise<void>;
82
+ }
83
+ export interface AztecAsyncKVStore {
84
+ /**
85
+ * Creates a new map.
86
+ * @param name - The name of the map
87
+ * @returns The map
88
+ */
89
+ openMap<K extends Key, V>(name: string): AztecAsyncMap<K, V>;
90
+ /**
91
+ * Creates a new set.
92
+ * @param name - The name of the set
93
+ * @returns The set
94
+ */
95
+ openSet<K extends Key>(name: string): AztecAsyncSet<K>;
96
+ /**
97
+ * Creates a new multi-map.
98
+ * @param name - The name of the multi-map
99
+ * @returns The multi-map
100
+ */
101
+ openMultiMap<K extends Key, V>(name: string): AztecAsyncMultiMap<K, V>;
102
+ /**
103
+ * Creates a new array.
104
+ * @param name - The name of the array
105
+ * @returns The array
106
+ */
107
+ openArray<T>(name: string): AztecAsyncArray<T>;
108
+ /**
109
+ * Creates a new singleton.
110
+ * @param name - The name of the singleton
111
+ * @returns The singleton
112
+ */
113
+ openSingleton<T>(name: string): AztecAsyncSingleton<T>;
114
+ /**
115
+ * Creates a new count map.
116
+ * @param name - name of the counter
117
+ */
118
+ openCounter<K extends Key>(name: string): AztecAsyncCounter<K>;
119
+ /**
120
+ * Starts a transaction. All calls to read/write data while in a transaction are queued and executed atomically.
121
+ * @param callback - The callback to execute in a transaction
122
+ */
123
+ transactionAsync<T extends Exclude<any, Promise<any>>>(callback: () => Promise<T>): Promise<T>;
124
+ /**
125
+ * Clears all entries in the store
126
+ */
127
+ clear(): Promise<void>;
128
+ /**
129
+ * Forks the store.
130
+ */
131
+ fork(): Promise<AztecAsyncKVStore>;
132
+ /**
133
+ * Deletes the store
134
+ */
135
+ delete(): Promise<void>;
136
+ /**
137
+ * Estimates the size of the store in bytes.
138
+ */
139
+ estimateSize(): Promise<StoreSize>;
140
+ /**
141
+ * Closes the store
142
+ */
143
+ close(): Promise<void>;
144
+ }
145
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/interfaces/store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,KAAK,EACV,aAAa,EACb,kBAAkB,EAClB,QAAQ,EACR,gBAAgB,EAChB,aAAa,EACb,qBAAqB,EACtB,MAAM,UAAU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CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAE/F;;OAEG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB;;OAEG;IACH,IAAI,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAEnC;;OAEG;IACH,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAExB;;OAEG;IACH,YAAY,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC;IAEnC;;OAEG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB"}
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,3 @@
1
+ import type { AztecAsyncKVStore, AztecKVStore } from './store.js';
2
+ export declare function describeAztecStore(testName: string, getPersistentStore: () => Promise<AztecKVStore | AztecAsyncKVStore>, getPersistentNoPathStore: () => Promise<AztecKVStore | AztecAsyncKVStore>, getEphemeralStore: () => Promise<AztecKVStore | AztecAsyncKVStore>): void;
3
+ //# sourceMappingURL=store_test_suite.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store_test_suite.d.ts","sourceRoot":"","sources":["../../src/interfaces/store_test_suite.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAGlE,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,kBAAkB,EAAE,MAAM,OAAO,CAAC,YAAY,GAAG,iBAAiB,CAAC,EACnE,wBAAwB,EAAE,MAAM,OAAO,CAAC,YAAY,GAAG,iBAAiB,CAAC,EACzE,iBAAiB,EAAE,MAAM,OAAO,CAAC,YAAY,GAAG,iBAAiB,CAAC,QA6CnE"}
@@ -0,0 +1,37 @@
1
+ import { expect } from 'chai';
2
+ import { isSyncStore } from './utils.js';
3
+ export function describeAztecStore(testName, getPersistentStore, getPersistentNoPathStore, getEphemeralStore) {
4
+ describe(testName, ()=>{
5
+ async function get(store, singleton) {
6
+ return isSyncStore(store) ? singleton.get() : await singleton.getAsync();
7
+ }
8
+ const itForks = async (store)=>{
9
+ const singleton = store.openSingleton('singleton');
10
+ await singleton.set('foo');
11
+ const forkedStore = await store.fork();
12
+ const forkedSingleton = forkedStore.openSingleton('singleton');
13
+ expect(await get(store, singleton)).to.equal('foo');
14
+ await forkedSingleton.set('bar');
15
+ expect(await get(store, singleton)).to.equal('foo');
16
+ expect(await get(forkedStore, forkedSingleton)).to.equal('bar');
17
+ await forkedSingleton.delete();
18
+ expect(await get(store, singleton)).to.equal('foo');
19
+ await forkedStore.delete();
20
+ };
21
+ it('forks a persistent store', async ()=>{
22
+ const store = await getPersistentStore();
23
+ await itForks(store);
24
+ await store.delete();
25
+ });
26
+ it('forks a persistent store with no path', async ()=>{
27
+ const store = await getPersistentNoPathStore();
28
+ await itForks(store);
29
+ await store.delete();
30
+ });
31
+ it('forks an ephemeral store', async ()=>{
32
+ const store = await getEphemeralStore();
33
+ await itForks(store);
34
+ await store.delete();
35
+ });
36
+ });
37
+ }
@@ -0,0 +1,16 @@
1
+ import type { AztecAsyncKVStore, AztecKVStore } from './store.js';
2
+ export declare const mockLogger: {
3
+ debug: (msg: string, data: any) => void;
4
+ info: (msg: string, data: any) => void;
5
+ warn: (msg: string, data: any) => void;
6
+ error: (msg: string, data: any) => void;
7
+ fatal: (msg: string, data: any) => void;
8
+ silent: (_msg: string, _data: any) => void;
9
+ verbose: (msg: string, data: any) => void;
10
+ trace: (msg: string, data: any) => void;
11
+ level: "trace";
12
+ isLevelEnabled: (_level: string) => boolean;
13
+ module: string;
14
+ };
15
+ export declare function isSyncStore(store: AztecKVStore | AztecAsyncKVStore): store is AztecAsyncKVStore;
16
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/interfaces/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAGlE,eAAO,MAAM,UAAU;iBACR,MAAM,QAAQ,GAAG;gBAClB,MAAM,QAAQ,GAAG;gBACjB,MAAM,QAAQ,GAAG;iBAChB,MAAM,QAAQ,GAAG;iBACjB,MAAM,QAAQ,GAAG;mBACf,MAAM,SAAS,GAAG;mBAClB,MAAM,QAAQ,GAAG;iBACnB,MAAM,QAAQ,GAAG;;6BAEL,MAAM;;CAEhC,CAAC;AAGF,wBAAgB,WAAW,CAAC,KAAK,EAAE,YAAY,GAAG,iBAAiB,GAAG,KAAK,IAAI,iBAAiB,CAE/F"}
@@ -0,0 +1,16 @@
1
+ /* eslint-disable no-console */ export const mockLogger = {
2
+ debug: (msg, data)=>console.log(msg, data),
3
+ info: (msg, data)=>console.log(msg, data),
4
+ warn: (msg, data)=>console.log(msg, data),
5
+ error: (msg, data)=>console.error(msg, data),
6
+ fatal: (msg, data)=>console.error(msg, data),
7
+ silent: (_msg, _data)=>{},
8
+ verbose: (msg, data)=>console.log(msg, data),
9
+ trace: (msg, data)=>console.log(msg, data),
10
+ level: 'trace',
11
+ isLevelEnabled: (_level)=>true,
12
+ module: 'kv-store:mock-logger'
13
+ };
14
+ /* eslint-enable no-console */ export function isSyncStore(store) {
15
+ return store.syncGetters === true;
16
+ }
@@ -0,0 +1,23 @@
1
+ import type { Database, Key } from 'lmdb';
2
+ import type { AztecArray, AztecAsyncArray } from '../interfaces/array.js';
3
+ /**
4
+ * An persistent array backed by LMDB.
5
+ */
6
+ export declare class LmdbAztecArray<T> implements AztecArray<T>, AztecAsyncArray<T> {
7
+ #private;
8
+ constructor(db: Database<unknown, Key>, arrName: string);
9
+ get length(): number;
10
+ lengthAsync(): Promise<number>;
11
+ push(...vals: T[]): Promise<number>;
12
+ pop(): Promise<T | undefined>;
13
+ at(index: number): T | undefined;
14
+ atAsync(index: number): Promise<T | undefined>;
15
+ setAt(index: number, val: T): Promise<boolean>;
16
+ entries(): IterableIterator<[number, T]>;
17
+ entriesAsync(): AsyncIterableIterator<[number, T]>;
18
+ values(): IterableIterator<T>;
19
+ valuesAsync(): AsyncIterableIterator<T>;
20
+ [Symbol.iterator](): IterableIterator<T>;
21
+ [Symbol.asyncIterator](): AsyncIterableIterator<T>;
22
+ }
23
+ //# sourceMappingURL=array.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../src/lmdb/array.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAE1C,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAM1E;;GAEG;AACH,qBAAa,cAAc,CAAC,CAAC,CAAE,YAAW,UAAU,CAAC,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC;;gBAK7D,EAAE,EAAE,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,MAAM;IAMvD,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;IAI9B,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAcnC,GAAG,IAAI,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAiB7B,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAchC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAI9C,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAY7C,OAAO,IAAI,gBAAgB,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAkBlC,YAAY,IAAI,qBAAqB,CAAC,CAAC,MAAM,EAAE,CAAC,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