@xyo-network/previous-hash-store-indexeddb 2.75.0 → 2.75.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.
@@ -0,0 +1,25 @@
1
+ import { PreviousHashStore } from '@xyo-network/previous-hash-store-model';
2
+ import { DBSchema } from 'idb';
3
+ export interface PreviousHashStoreSchemaV1 extends DBSchema {
4
+ 'previous-hash': {
5
+ key: string;
6
+ value: string;
7
+ };
8
+ }
9
+ export declare class IndexedDbPreviousHashStore implements PreviousHashStore {
10
+ static readonly CurrentSchemaVersion = 1;
11
+ private readonly db;
12
+ constructor();
13
+ /**
14
+ * The database name.
15
+ */
16
+ get dbName(): "xyo";
17
+ /**
18
+ * The name of the object store.
19
+ */
20
+ get storeName(): "previous-hash";
21
+ getItem(address: string): Promise<string | null>;
22
+ removeItem(address: string): Promise<void>;
23
+ setItem(address: string, previousHash: string): Promise<void>;
24
+ }
25
+ //# sourceMappingURL=IndexedDbPreviousHashStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IndexedDbPreviousHashStore.d.ts","sourceRoot":"","sources":["../../src/IndexedDbPreviousHashStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAC1E,OAAO,EAAE,QAAQ,EAAwB,MAAM,KAAK,CAAA;AAEpD,MAAM,WAAW,yBAA0B,SAAQ,QAAQ;IACzD,eAAe,EAAE;QACf,GAAG,EAAE,MAAM,CAAA;QACX,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;CACF;AAED,qBAAa,0BAA2B,YAAW,iBAAiB;IAClE,MAAM,CAAC,QAAQ,CAAC,oBAAoB,KAAI;IACxC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAkD;;IAQrE;;OAEG;IACH,IAAI,MAAM,UAET;IAED;;OAEG;IACH,IAAI,SAAS,oBAEZ;IAEK,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAIhD,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAG1C,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGpE"}
@@ -1,10 +1,9 @@
1
- // src/IndexedDbPreviousHashStore.ts
2
1
  import { openDB } from "idb";
3
- var IndexedDbPreviousHashStore = class _IndexedDbPreviousHashStore {
2
+ class IndexedDbPreviousHashStore {
4
3
  static CurrentSchemaVersion = 1;
5
4
  db;
6
5
  constructor() {
7
- this.db = openDB(this.dbName, _IndexedDbPreviousHashStore.CurrentSchemaVersion, {
6
+ this.db = openDB(this.dbName, IndexedDbPreviousHashStore.CurrentSchemaVersion, {
8
7
  upgrade: (db) => db.createObjectStore(this.storeName)
9
8
  });
10
9
  }
@@ -30,7 +29,7 @@ var IndexedDbPreviousHashStore = class _IndexedDbPreviousHashStore {
30
29
  async setItem(address, previousHash) {
31
30
  await (await this.db).put(this.storeName, previousHash, address);
32
31
  }
33
- };
32
+ }
34
33
  export {
35
34
  IndexedDbPreviousHashStore
36
35
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/IndexedDbPreviousHashStore.ts"],"sourcesContent":["import { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\nimport { DBSchema, IDBPDatabase, openDB } from 'idb'\n\nexport interface PreviousHashStoreSchemaV1 extends DBSchema {\n 'previous-hash': {\n key: string\n value: string\n }\n}\n\nexport class IndexedDbPreviousHashStore implements PreviousHashStore {\n static readonly CurrentSchemaVersion = 1\n private readonly db: Promise<IDBPDatabase<PreviousHashStoreSchemaV1>>\n\n constructor() {\n this.db = openDB<PreviousHashStoreSchemaV1>(this.dbName, IndexedDbPreviousHashStore.CurrentSchemaVersion, {\n upgrade: (db) => db.createObjectStore(this.storeName),\n })\n }\n\n /**\n * The database name.\n */\n get dbName() {\n return 'xyo' as const\n }\n\n /**\n * The name of the object store.\n */\n get storeName() {\n return 'previous-hash' as const\n }\n\n async getItem(address: string): Promise<string | null> {\n const value = await (await this.db).get(this.storeName, address)\n return value ?? null\n }\n async removeItem(address: string): Promise<void> {\n await (await this.db).delete(this.storeName, address)\n }\n async setItem(address: string, previousHash: string): Promise<void> {\n await (await this.db).put(this.storeName, previousHash, address)\n }\n}\n"],"mappings":";AACA,SAAiC,cAAc;AASxC,IAAM,6BAAN,MAAM,4BAAwD;AAAA,EACnE,OAAgB,uBAAuB;AAAA,EACtB;AAAA,EAEjB,cAAc;AACZ,SAAK,KAAK,OAAkC,KAAK,QAAQ,4BAA2B,sBAAsB;AAAA,MACxG,SAAS,CAAC,OAAO,GAAG,kBAAkB,KAAK,SAAS;AAAA,IACtD,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,SAAS;AACX,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,YAAY;AACd,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,QAAQ,SAAyC;AACrD,UAAM,QAAQ,OAAO,MAAM,KAAK,IAAI,IAAI,KAAK,WAAW,OAAO;AAC/D,WAAO,SAAS;AAAA,EAClB;AAAA,EACA,MAAM,WAAW,SAAgC;AAC/C,WAAO,MAAM,KAAK,IAAI,OAAO,KAAK,WAAW,OAAO;AAAA,EACtD;AAAA,EACA,MAAM,QAAQ,SAAiB,cAAqC;AAClE,WAAO,MAAM,KAAK,IAAI,IAAI,KAAK,WAAW,cAAc,OAAO;AAAA,EACjE;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/IndexedDbPreviousHashStore.ts"],"sourcesContent":["import { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\nimport { DBSchema, IDBPDatabase, openDB } from 'idb'\n\nexport interface PreviousHashStoreSchemaV1 extends DBSchema {\n 'previous-hash': {\n key: string\n value: string\n }\n}\n\nexport class IndexedDbPreviousHashStore implements PreviousHashStore {\n static readonly CurrentSchemaVersion = 1\n private readonly db: Promise<IDBPDatabase<PreviousHashStoreSchemaV1>>\n\n constructor() {\n this.db = openDB<PreviousHashStoreSchemaV1>(this.dbName, IndexedDbPreviousHashStore.CurrentSchemaVersion, {\n upgrade: (db) => db.createObjectStore(this.storeName),\n })\n }\n\n /**\n * The database name.\n */\n get dbName() {\n return 'xyo' as const\n }\n\n /**\n * The name of the object store.\n */\n get storeName() {\n return 'previous-hash' as const\n }\n\n async getItem(address: string): Promise<string | null> {\n const value = await (await this.db).get(this.storeName, address)\n return value ?? null\n }\n async removeItem(address: string): Promise<void> {\n await (await this.db).delete(this.storeName, address)\n }\n async setItem(address: string, previousHash: string): Promise<void> {\n await (await this.db).put(this.storeName, previousHash, address)\n }\n}\n"],"mappings":"AACA,SAAiC,cAAc;AASxC,MAAM,2BAAwD;AAAA,EACnE,OAAgB,uBAAuB;AAAA,EACtB;AAAA,EAEjB,cAAc;AACZ,SAAK,KAAK,OAAkC,KAAK,QAAQ,2BAA2B,sBAAsB;AAAA,MACxG,SAAS,CAAC,OAAO,GAAG,kBAAkB,KAAK,SAAS;AAAA,IACtD,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,SAAS;AACX,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,YAAY;AACd,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,QAAQ,SAAyC;AACrD,UAAM,QAAQ,OAAO,MAAM,KAAK,IAAI,IAAI,KAAK,WAAW,OAAO;AAC/D,WAAO,SAAS;AAAA,EAClB;AAAA,EACA,MAAM,WAAW,SAAgC;AAC/C,WAAO,MAAM,KAAK,IAAI,OAAO,KAAK,WAAW,OAAO;AAAA,EACtD;AAAA,EACA,MAAM,QAAQ,SAAiB,cAAqC;AAClE,WAAO,MAAM,KAAK,IAAI,IAAI,KAAK,WAAW,cAAc,OAAO;AAAA,EACjE;AACF;","names":[]}
@@ -0,0 +1,2 @@
1
+ export * from './IndexedDbPreviousHashStore';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAA"}
@@ -1,37 +1,2 @@
1
- // src/IndexedDbPreviousHashStore.ts
2
- import { openDB } from "idb";
3
- var IndexedDbPreviousHashStore = class _IndexedDbPreviousHashStore {
4
- static CurrentSchemaVersion = 1;
5
- db;
6
- constructor() {
7
- this.db = openDB(this.dbName, _IndexedDbPreviousHashStore.CurrentSchemaVersion, {
8
- upgrade: (db) => db.createObjectStore(this.storeName)
9
- });
10
- }
11
- /**
12
- * The database name.
13
- */
14
- get dbName() {
15
- return "xyo";
16
- }
17
- /**
18
- * The name of the object store.
19
- */
20
- get storeName() {
21
- return "previous-hash";
22
- }
23
- async getItem(address) {
24
- const value = await (await this.db).get(this.storeName, address);
25
- return value ?? null;
26
- }
27
- async removeItem(address) {
28
- await (await this.db).delete(this.storeName, address);
29
- }
30
- async setItem(address, previousHash) {
31
- await (await this.db).put(this.storeName, previousHash, address);
32
- }
33
- };
34
- export {
35
- IndexedDbPreviousHashStore
36
- };
1
+ export * from "./IndexedDbPreviousHashStore";
37
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/IndexedDbPreviousHashStore.ts"],"sourcesContent":["import { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\nimport { DBSchema, IDBPDatabase, openDB } from 'idb'\n\nexport interface PreviousHashStoreSchemaV1 extends DBSchema {\n 'previous-hash': {\n key: string\n value: string\n }\n}\n\nexport class IndexedDbPreviousHashStore implements PreviousHashStore {\n static readonly CurrentSchemaVersion = 1\n private readonly db: Promise<IDBPDatabase<PreviousHashStoreSchemaV1>>\n\n constructor() {\n this.db = openDB<PreviousHashStoreSchemaV1>(this.dbName, IndexedDbPreviousHashStore.CurrentSchemaVersion, {\n upgrade: (db) => db.createObjectStore(this.storeName),\n })\n }\n\n /**\n * The database name.\n */\n get dbName() {\n return 'xyo' as const\n }\n\n /**\n * The name of the object store.\n */\n get storeName() {\n return 'previous-hash' as const\n }\n\n async getItem(address: string): Promise<string | null> {\n const value = await (await this.db).get(this.storeName, address)\n return value ?? null\n }\n async removeItem(address: string): Promise<void> {\n await (await this.db).delete(this.storeName, address)\n }\n async setItem(address: string, previousHash: string): Promise<void> {\n await (await this.db).put(this.storeName, previousHash, address)\n }\n}\n"],"mappings":";AACA,SAAiC,cAAc;AASxC,IAAM,6BAAN,MAAM,4BAAwD;AAAA,EACnE,OAAgB,uBAAuB;AAAA,EACtB;AAAA,EAEjB,cAAc;AACZ,SAAK,KAAK,OAAkC,KAAK,QAAQ,4BAA2B,sBAAsB;AAAA,MACxG,SAAS,CAAC,OAAO,GAAG,kBAAkB,KAAK,SAAS;AAAA,IACtD,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,SAAS;AACX,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,YAAY;AACd,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,QAAQ,SAAyC;AACrD,UAAM,QAAQ,OAAO,MAAM,KAAK,IAAI,IAAI,KAAK,WAAW,OAAO;AAC/D,WAAO,SAAS;AAAA,EAClB;AAAA,EACA,MAAM,WAAW,SAAgC;AAC/C,WAAO,MAAM,KAAK,IAAI,OAAO,KAAK,WAAW,OAAO;AAAA,EACtD;AAAA,EACA,MAAM,QAAQ,SAAiB,cAAqC;AAClE,WAAO,MAAM,KAAK,IAAI,IAAI,KAAK,WAAW,cAAc,OAAO;AAAA,EACjE;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export * from './IndexedDbPreviousHashStore'\n"],"mappings":"AAAA,cAAc;","names":[]}
package/dist/docs.json ADDED
@@ -0,0 +1,729 @@
1
+ {
2
+ "id": 0,
3
+ "name": "@xyo-network/previous-hash-store-indexeddb",
4
+ "variant": "project",
5
+ "kind": 1,
6
+ "flags": {},
7
+ "children": [
8
+ {
9
+ "id": 6,
10
+ "name": "IndexedDbPreviousHashStore",
11
+ "variant": "declaration",
12
+ "kind": 128,
13
+ "flags": {},
14
+ "children": [
15
+ {
16
+ "id": 8,
17
+ "name": "constructor",
18
+ "variant": "declaration",
19
+ "kind": 512,
20
+ "flags": {},
21
+ "sources": [
22
+ {
23
+ "fileName": "IndexedDbPreviousHashStore.ts",
24
+ "line": 15,
25
+ "character": 2,
26
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/ca3276aa9c376/packages/protocol/packages/account/packages/previous-hash-store/packages/indexeddb/src/IndexedDbPreviousHashStore.ts#L15"
27
+ }
28
+ ],
29
+ "signatures": [
30
+ {
31
+ "id": 9,
32
+ "name": "new IndexedDbPreviousHashStore",
33
+ "variant": "signature",
34
+ "kind": 16384,
35
+ "flags": {},
36
+ "sources": [
37
+ {
38
+ "fileName": "IndexedDbPreviousHashStore.ts",
39
+ "line": 15,
40
+ "character": 2,
41
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/ca3276aa9c376/packages/protocol/packages/account/packages/previous-hash-store/packages/indexeddb/src/IndexedDbPreviousHashStore.ts#L15"
42
+ }
43
+ ],
44
+ "type": {
45
+ "type": "reference",
46
+ "target": 6,
47
+ "name": "IndexedDbPreviousHashStore",
48
+ "package": "@xyo-network/previous-hash-store-indexeddb"
49
+ }
50
+ }
51
+ ]
52
+ },
53
+ {
54
+ "id": 10,
55
+ "name": "db",
56
+ "variant": "declaration",
57
+ "kind": 1024,
58
+ "flags": {
59
+ "isPrivate": true,
60
+ "isReadonly": true
61
+ },
62
+ "sources": [
63
+ {
64
+ "fileName": "IndexedDbPreviousHashStore.ts",
65
+ "line": 13,
66
+ "character": 19,
67
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/ca3276aa9c376/packages/protocol/packages/account/packages/previous-hash-store/packages/indexeddb/src/IndexedDbPreviousHashStore.ts#L13"
68
+ }
69
+ ],
70
+ "type": {
71
+ "type": "reference",
72
+ "target": {
73
+ "sourceFileName": "../../../../../../../../node_modules/typescript/lib/lib.es5.d.ts",
74
+ "qualifiedName": "Promise"
75
+ },
76
+ "typeArguments": [
77
+ {
78
+ "type": "reference",
79
+ "target": {
80
+ "sourceFileName": "../../../../../../../../node_modules/idb/build/entry.d.ts",
81
+ "qualifiedName": "IDBPDatabase"
82
+ },
83
+ "typeArguments": [
84
+ {
85
+ "type": "reference",
86
+ "target": 1,
87
+ "name": "PreviousHashStoreSchemaV1",
88
+ "package": "@xyo-network/previous-hash-store-indexeddb"
89
+ }
90
+ ],
91
+ "name": "IDBPDatabase",
92
+ "package": "idb"
93
+ }
94
+ ],
95
+ "name": "Promise",
96
+ "package": "typescript"
97
+ }
98
+ },
99
+ {
100
+ "id": 7,
101
+ "name": "CurrentSchemaVersion",
102
+ "variant": "declaration",
103
+ "kind": 1024,
104
+ "flags": {
105
+ "isStatic": true,
106
+ "isReadonly": true
107
+ },
108
+ "sources": [
109
+ {
110
+ "fileName": "IndexedDbPreviousHashStore.ts",
111
+ "line": 12,
112
+ "character": 18,
113
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/ca3276aa9c376/packages/protocol/packages/account/packages/previous-hash-store/packages/indexeddb/src/IndexedDbPreviousHashStore.ts#L12"
114
+ }
115
+ ],
116
+ "type": {
117
+ "type": "literal",
118
+ "value": 1
119
+ },
120
+ "defaultValue": "1"
121
+ },
122
+ {
123
+ "id": 11,
124
+ "name": "dbName",
125
+ "variant": "declaration",
126
+ "kind": 262144,
127
+ "flags": {},
128
+ "sources": [
129
+ {
130
+ "fileName": "IndexedDbPreviousHashStore.ts",
131
+ "line": 24,
132
+ "character": 6,
133
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/ca3276aa9c376/packages/protocol/packages/account/packages/previous-hash-store/packages/indexeddb/src/IndexedDbPreviousHashStore.ts#L24"
134
+ }
135
+ ],
136
+ "getSignature": {
137
+ "id": 12,
138
+ "name": "dbName",
139
+ "variant": "signature",
140
+ "kind": 524288,
141
+ "flags": {},
142
+ "comment": {
143
+ "summary": [
144
+ {
145
+ "kind": "text",
146
+ "text": "The database name."
147
+ }
148
+ ]
149
+ },
150
+ "sources": [
151
+ {
152
+ "fileName": "IndexedDbPreviousHashStore.ts",
153
+ "line": 24,
154
+ "character": 2,
155
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/ca3276aa9c376/packages/protocol/packages/account/packages/previous-hash-store/packages/indexeddb/src/IndexedDbPreviousHashStore.ts#L24"
156
+ }
157
+ ],
158
+ "type": {
159
+ "type": "literal",
160
+ "value": "xyo"
161
+ }
162
+ }
163
+ },
164
+ {
165
+ "id": 13,
166
+ "name": "storeName",
167
+ "variant": "declaration",
168
+ "kind": 262144,
169
+ "flags": {},
170
+ "sources": [
171
+ {
172
+ "fileName": "IndexedDbPreviousHashStore.ts",
173
+ "line": 31,
174
+ "character": 6,
175
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/ca3276aa9c376/packages/protocol/packages/account/packages/previous-hash-store/packages/indexeddb/src/IndexedDbPreviousHashStore.ts#L31"
176
+ }
177
+ ],
178
+ "getSignature": {
179
+ "id": 14,
180
+ "name": "storeName",
181
+ "variant": "signature",
182
+ "kind": 524288,
183
+ "flags": {},
184
+ "comment": {
185
+ "summary": [
186
+ {
187
+ "kind": "text",
188
+ "text": "The name of the object store."
189
+ }
190
+ ]
191
+ },
192
+ "sources": [
193
+ {
194
+ "fileName": "IndexedDbPreviousHashStore.ts",
195
+ "line": 31,
196
+ "character": 2,
197
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/ca3276aa9c376/packages/protocol/packages/account/packages/previous-hash-store/packages/indexeddb/src/IndexedDbPreviousHashStore.ts#L31"
198
+ }
199
+ ],
200
+ "type": {
201
+ "type": "literal",
202
+ "value": "previous-hash"
203
+ }
204
+ }
205
+ },
206
+ {
207
+ "id": 15,
208
+ "name": "getItem",
209
+ "variant": "declaration",
210
+ "kind": 2048,
211
+ "flags": {},
212
+ "sources": [
213
+ {
214
+ "fileName": "IndexedDbPreviousHashStore.ts",
215
+ "line": 35,
216
+ "character": 8,
217
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/ca3276aa9c376/packages/protocol/packages/account/packages/previous-hash-store/packages/indexeddb/src/IndexedDbPreviousHashStore.ts#L35"
218
+ }
219
+ ],
220
+ "signatures": [
221
+ {
222
+ "id": 16,
223
+ "name": "getItem",
224
+ "variant": "signature",
225
+ "kind": 4096,
226
+ "flags": {},
227
+ "sources": [
228
+ {
229
+ "fileName": "IndexedDbPreviousHashStore.ts",
230
+ "line": 35,
231
+ "character": 2,
232
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/ca3276aa9c376/packages/protocol/packages/account/packages/previous-hash-store/packages/indexeddb/src/IndexedDbPreviousHashStore.ts#L35"
233
+ }
234
+ ],
235
+ "parameters": [
236
+ {
237
+ "id": 17,
238
+ "name": "address",
239
+ "variant": "param",
240
+ "kind": 32768,
241
+ "flags": {},
242
+ "type": {
243
+ "type": "intrinsic",
244
+ "name": "string"
245
+ }
246
+ }
247
+ ],
248
+ "type": {
249
+ "type": "reference",
250
+ "target": {
251
+ "sourceFileName": "../../../../../../../../node_modules/typescript/lib/lib.es5.d.ts",
252
+ "qualifiedName": "Promise"
253
+ },
254
+ "typeArguments": [
255
+ {
256
+ "type": "union",
257
+ "types": [
258
+ {
259
+ "type": "literal",
260
+ "value": null
261
+ },
262
+ {
263
+ "type": "intrinsic",
264
+ "name": "string"
265
+ }
266
+ ]
267
+ }
268
+ ],
269
+ "name": "Promise",
270
+ "package": "typescript"
271
+ },
272
+ "implementationOf": {
273
+ "type": "reference",
274
+ "target": -1,
275
+ "name": "PreviousHashStore.getItem"
276
+ }
277
+ }
278
+ ],
279
+ "implementationOf": {
280
+ "type": "reference",
281
+ "target": -1,
282
+ "name": "PreviousHashStore.getItem"
283
+ }
284
+ },
285
+ {
286
+ "id": 18,
287
+ "name": "removeItem",
288
+ "variant": "declaration",
289
+ "kind": 2048,
290
+ "flags": {},
291
+ "sources": [
292
+ {
293
+ "fileName": "IndexedDbPreviousHashStore.ts",
294
+ "line": 39,
295
+ "character": 8,
296
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/ca3276aa9c376/packages/protocol/packages/account/packages/previous-hash-store/packages/indexeddb/src/IndexedDbPreviousHashStore.ts#L39"
297
+ }
298
+ ],
299
+ "signatures": [
300
+ {
301
+ "id": 19,
302
+ "name": "removeItem",
303
+ "variant": "signature",
304
+ "kind": 4096,
305
+ "flags": {},
306
+ "sources": [
307
+ {
308
+ "fileName": "IndexedDbPreviousHashStore.ts",
309
+ "line": 39,
310
+ "character": 2,
311
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/ca3276aa9c376/packages/protocol/packages/account/packages/previous-hash-store/packages/indexeddb/src/IndexedDbPreviousHashStore.ts#L39"
312
+ }
313
+ ],
314
+ "parameters": [
315
+ {
316
+ "id": 20,
317
+ "name": "address",
318
+ "variant": "param",
319
+ "kind": 32768,
320
+ "flags": {},
321
+ "type": {
322
+ "type": "intrinsic",
323
+ "name": "string"
324
+ }
325
+ }
326
+ ],
327
+ "type": {
328
+ "type": "reference",
329
+ "target": {
330
+ "sourceFileName": "../../../../../../../../node_modules/typescript/lib/lib.es5.d.ts",
331
+ "qualifiedName": "Promise"
332
+ },
333
+ "typeArguments": [
334
+ {
335
+ "type": "intrinsic",
336
+ "name": "void"
337
+ }
338
+ ],
339
+ "name": "Promise",
340
+ "package": "typescript"
341
+ },
342
+ "implementationOf": {
343
+ "type": "reference",
344
+ "target": -1,
345
+ "name": "PreviousHashStore.removeItem"
346
+ }
347
+ }
348
+ ],
349
+ "implementationOf": {
350
+ "type": "reference",
351
+ "target": -1,
352
+ "name": "PreviousHashStore.removeItem"
353
+ }
354
+ },
355
+ {
356
+ "id": 21,
357
+ "name": "setItem",
358
+ "variant": "declaration",
359
+ "kind": 2048,
360
+ "flags": {},
361
+ "sources": [
362
+ {
363
+ "fileName": "IndexedDbPreviousHashStore.ts",
364
+ "line": 42,
365
+ "character": 8,
366
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/ca3276aa9c376/packages/protocol/packages/account/packages/previous-hash-store/packages/indexeddb/src/IndexedDbPreviousHashStore.ts#L42"
367
+ }
368
+ ],
369
+ "signatures": [
370
+ {
371
+ "id": 22,
372
+ "name": "setItem",
373
+ "variant": "signature",
374
+ "kind": 4096,
375
+ "flags": {},
376
+ "sources": [
377
+ {
378
+ "fileName": "IndexedDbPreviousHashStore.ts",
379
+ "line": 42,
380
+ "character": 2,
381
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/ca3276aa9c376/packages/protocol/packages/account/packages/previous-hash-store/packages/indexeddb/src/IndexedDbPreviousHashStore.ts#L42"
382
+ }
383
+ ],
384
+ "parameters": [
385
+ {
386
+ "id": 23,
387
+ "name": "address",
388
+ "variant": "param",
389
+ "kind": 32768,
390
+ "flags": {},
391
+ "type": {
392
+ "type": "intrinsic",
393
+ "name": "string"
394
+ }
395
+ },
396
+ {
397
+ "id": 24,
398
+ "name": "previousHash",
399
+ "variant": "param",
400
+ "kind": 32768,
401
+ "flags": {},
402
+ "type": {
403
+ "type": "intrinsic",
404
+ "name": "string"
405
+ }
406
+ }
407
+ ],
408
+ "type": {
409
+ "type": "reference",
410
+ "target": {
411
+ "sourceFileName": "../../../../../../../../node_modules/typescript/lib/lib.es5.d.ts",
412
+ "qualifiedName": "Promise"
413
+ },
414
+ "typeArguments": [
415
+ {
416
+ "type": "intrinsic",
417
+ "name": "void"
418
+ }
419
+ ],
420
+ "name": "Promise",
421
+ "package": "typescript"
422
+ },
423
+ "implementationOf": {
424
+ "type": "reference",
425
+ "target": -1,
426
+ "name": "PreviousHashStore.setItem"
427
+ }
428
+ }
429
+ ],
430
+ "implementationOf": {
431
+ "type": "reference",
432
+ "target": -1,
433
+ "name": "PreviousHashStore.setItem"
434
+ }
435
+ }
436
+ ],
437
+ "groups": [
438
+ {
439
+ "title": "Constructors",
440
+ "children": [
441
+ 8
442
+ ]
443
+ },
444
+ {
445
+ "title": "Properties",
446
+ "children": [
447
+ 10,
448
+ 7
449
+ ]
450
+ },
451
+ {
452
+ "title": "Accessors",
453
+ "children": [
454
+ 11,
455
+ 13
456
+ ]
457
+ },
458
+ {
459
+ "title": "Methods",
460
+ "children": [
461
+ 15,
462
+ 18,
463
+ 21
464
+ ]
465
+ }
466
+ ],
467
+ "sources": [
468
+ {
469
+ "fileName": "IndexedDbPreviousHashStore.ts",
470
+ "line": 11,
471
+ "character": 13,
472
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/ca3276aa9c376/packages/protocol/packages/account/packages/previous-hash-store/packages/indexeddb/src/IndexedDbPreviousHashStore.ts#L11"
473
+ }
474
+ ],
475
+ "implementedTypes": [
476
+ {
477
+ "type": "reference",
478
+ "target": {
479
+ "sourceFileName": "../model/src/PreviousHashStore.ts",
480
+ "qualifiedName": "PreviousHashStore"
481
+ },
482
+ "name": "PreviousHashStore",
483
+ "package": "@xyo-network/previous-hash-store-model"
484
+ }
485
+ ]
486
+ },
487
+ {
488
+ "id": 1,
489
+ "name": "PreviousHashStoreSchemaV1",
490
+ "variant": "declaration",
491
+ "kind": 256,
492
+ "flags": {},
493
+ "children": [
494
+ {
495
+ "id": 2,
496
+ "name": "previous-hash",
497
+ "variant": "declaration",
498
+ "kind": 1024,
499
+ "flags": {},
500
+ "sources": [
501
+ {
502
+ "fileName": "IndexedDbPreviousHashStore.ts",
503
+ "line": 5,
504
+ "character": 2,
505
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/ca3276aa9c376/packages/protocol/packages/account/packages/previous-hash-store/packages/indexeddb/src/IndexedDbPreviousHashStore.ts#L5"
506
+ }
507
+ ],
508
+ "type": {
509
+ "type": "reflection",
510
+ "declaration": {
511
+ "id": 3,
512
+ "name": "__type",
513
+ "variant": "declaration",
514
+ "kind": 65536,
515
+ "flags": {},
516
+ "children": [
517
+ {
518
+ "id": 4,
519
+ "name": "key",
520
+ "variant": "declaration",
521
+ "kind": 1024,
522
+ "flags": {},
523
+ "sources": [
524
+ {
525
+ "fileName": "IndexedDbPreviousHashStore.ts",
526
+ "line": 6,
527
+ "character": 4,
528
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/ca3276aa9c376/packages/protocol/packages/account/packages/previous-hash-store/packages/indexeddb/src/IndexedDbPreviousHashStore.ts#L6"
529
+ }
530
+ ],
531
+ "type": {
532
+ "type": "intrinsic",
533
+ "name": "string"
534
+ }
535
+ },
536
+ {
537
+ "id": 5,
538
+ "name": "value",
539
+ "variant": "declaration",
540
+ "kind": 1024,
541
+ "flags": {},
542
+ "sources": [
543
+ {
544
+ "fileName": "IndexedDbPreviousHashStore.ts",
545
+ "line": 7,
546
+ "character": 4,
547
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/ca3276aa9c376/packages/protocol/packages/account/packages/previous-hash-store/packages/indexeddb/src/IndexedDbPreviousHashStore.ts#L7"
548
+ }
549
+ ],
550
+ "type": {
551
+ "type": "intrinsic",
552
+ "name": "string"
553
+ }
554
+ }
555
+ ],
556
+ "groups": [
557
+ {
558
+ "title": "Properties",
559
+ "children": [
560
+ 4,
561
+ 5
562
+ ]
563
+ }
564
+ ],
565
+ "sources": [
566
+ {
567
+ "fileName": "IndexedDbPreviousHashStore.ts",
568
+ "line": 5,
569
+ "character": 19,
570
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/ca3276aa9c376/packages/protocol/packages/account/packages/previous-hash-store/packages/indexeddb/src/IndexedDbPreviousHashStore.ts#L5"
571
+ }
572
+ ]
573
+ }
574
+ }
575
+ }
576
+ ],
577
+ "groups": [
578
+ {
579
+ "title": "Properties",
580
+ "children": [
581
+ 2
582
+ ]
583
+ }
584
+ ],
585
+ "sources": [
586
+ {
587
+ "fileName": "IndexedDbPreviousHashStore.ts",
588
+ "line": 4,
589
+ "character": 17,
590
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/ca3276aa9c376/packages/protocol/packages/account/packages/previous-hash-store/packages/indexeddb/src/IndexedDbPreviousHashStore.ts#L4"
591
+ }
592
+ ],
593
+ "extendedTypes": [
594
+ {
595
+ "type": "reference",
596
+ "target": {
597
+ "sourceFileName": "../../../../../../../../node_modules/idb/build/entry.d.ts",
598
+ "qualifiedName": "DBSchema"
599
+ },
600
+ "name": "DBSchema",
601
+ "package": "idb"
602
+ }
603
+ ]
604
+ }
605
+ ],
606
+ "groups": [
607
+ {
608
+ "title": "Classes",
609
+ "children": [
610
+ 6
611
+ ]
612
+ },
613
+ {
614
+ "title": "Interfaces",
615
+ "children": [
616
+ 1
617
+ ]
618
+ }
619
+ ],
620
+ "packageName": "@xyo-network/previous-hash-store-indexeddb",
621
+ "readme": [
622
+ {
623
+ "kind": "text",
624
+ "text": "[![logo][]](https://xyo.network)\n\nPart of [sdk-xyo-clint-js](https://www.npmjs.com/package/@xyo-network/sdk-xyo-client-js)\n\n## License\n\n> See the [LICENSE](LICENSE) file for license details\n\n## Credits\n\n[Made with 🔥 and ❄️ by XYO](https://xyo.network)\n\n[logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png"
625
+ }
626
+ ],
627
+ "symbolIdMap": {
628
+ "0": {
629
+ "sourceFileName": "src/index.ts",
630
+ "qualifiedName": ""
631
+ },
632
+ "1": {
633
+ "sourceFileName": "src/IndexedDbPreviousHashStore.ts",
634
+ "qualifiedName": "PreviousHashStoreSchemaV1"
635
+ },
636
+ "2": {
637
+ "sourceFileName": "src/IndexedDbPreviousHashStore.ts",
638
+ "qualifiedName": "PreviousHashStoreSchemaV1.previous-hash"
639
+ },
640
+ "3": {
641
+ "sourceFileName": "src/IndexedDbPreviousHashStore.ts",
642
+ "qualifiedName": "__type"
643
+ },
644
+ "4": {
645
+ "sourceFileName": "src/IndexedDbPreviousHashStore.ts",
646
+ "qualifiedName": "__type.key"
647
+ },
648
+ "5": {
649
+ "sourceFileName": "src/IndexedDbPreviousHashStore.ts",
650
+ "qualifiedName": "__type.value"
651
+ },
652
+ "6": {
653
+ "sourceFileName": "src/IndexedDbPreviousHashStore.ts",
654
+ "qualifiedName": "IndexedDbPreviousHashStore"
655
+ },
656
+ "7": {
657
+ "sourceFileName": "src/IndexedDbPreviousHashStore.ts",
658
+ "qualifiedName": "IndexedDbPreviousHashStore.CurrentSchemaVersion"
659
+ },
660
+ "8": {
661
+ "sourceFileName": "src/IndexedDbPreviousHashStore.ts",
662
+ "qualifiedName": "IndexedDbPreviousHashStore.__constructor"
663
+ },
664
+ "9": {
665
+ "sourceFileName": "src/IndexedDbPreviousHashStore.ts",
666
+ "qualifiedName": "IndexedDbPreviousHashStore"
667
+ },
668
+ "10": {
669
+ "sourceFileName": "src/IndexedDbPreviousHashStore.ts",
670
+ "qualifiedName": "IndexedDbPreviousHashStore.db"
671
+ },
672
+ "11": {
673
+ "sourceFileName": "src/IndexedDbPreviousHashStore.ts",
674
+ "qualifiedName": "IndexedDbPreviousHashStore.dbName"
675
+ },
676
+ "12": {
677
+ "sourceFileName": "src/IndexedDbPreviousHashStore.ts",
678
+ "qualifiedName": "IndexedDbPreviousHashStore.dbName"
679
+ },
680
+ "13": {
681
+ "sourceFileName": "src/IndexedDbPreviousHashStore.ts",
682
+ "qualifiedName": "IndexedDbPreviousHashStore.storeName"
683
+ },
684
+ "14": {
685
+ "sourceFileName": "src/IndexedDbPreviousHashStore.ts",
686
+ "qualifiedName": "IndexedDbPreviousHashStore.storeName"
687
+ },
688
+ "15": {
689
+ "sourceFileName": "src/IndexedDbPreviousHashStore.ts",
690
+ "qualifiedName": "IndexedDbPreviousHashStore.getItem"
691
+ },
692
+ "16": {
693
+ "sourceFileName": "src/IndexedDbPreviousHashStore.ts",
694
+ "qualifiedName": "IndexedDbPreviousHashStore.getItem"
695
+ },
696
+ "17": {
697
+ "sourceFileName": "src/IndexedDbPreviousHashStore.ts",
698
+ "qualifiedName": "address"
699
+ },
700
+ "18": {
701
+ "sourceFileName": "src/IndexedDbPreviousHashStore.ts",
702
+ "qualifiedName": "IndexedDbPreviousHashStore.removeItem"
703
+ },
704
+ "19": {
705
+ "sourceFileName": "src/IndexedDbPreviousHashStore.ts",
706
+ "qualifiedName": "IndexedDbPreviousHashStore.removeItem"
707
+ },
708
+ "20": {
709
+ "sourceFileName": "src/IndexedDbPreviousHashStore.ts",
710
+ "qualifiedName": "address"
711
+ },
712
+ "21": {
713
+ "sourceFileName": "src/IndexedDbPreviousHashStore.ts",
714
+ "qualifiedName": "IndexedDbPreviousHashStore.setItem"
715
+ },
716
+ "22": {
717
+ "sourceFileName": "src/IndexedDbPreviousHashStore.ts",
718
+ "qualifiedName": "IndexedDbPreviousHashStore.setItem"
719
+ },
720
+ "23": {
721
+ "sourceFileName": "src/IndexedDbPreviousHashStore.ts",
722
+ "qualifiedName": "address"
723
+ },
724
+ "24": {
725
+ "sourceFileName": "src/IndexedDbPreviousHashStore.ts",
726
+ "qualifiedName": "previousHash"
727
+ }
728
+ }
729
+ }
@@ -0,0 +1,25 @@
1
+ import { PreviousHashStore } from '@xyo-network/previous-hash-store-model';
2
+ import { DBSchema } from 'idb';
3
+ export interface PreviousHashStoreSchemaV1 extends DBSchema {
4
+ 'previous-hash': {
5
+ key: string;
6
+ value: string;
7
+ };
8
+ }
9
+ export declare class IndexedDbPreviousHashStore implements PreviousHashStore {
10
+ static readonly CurrentSchemaVersion = 1;
11
+ private readonly db;
12
+ constructor();
13
+ /**
14
+ * The database name.
15
+ */
16
+ get dbName(): "xyo";
17
+ /**
18
+ * The name of the object store.
19
+ */
20
+ get storeName(): "previous-hash";
21
+ getItem(address: string): Promise<string | null>;
22
+ removeItem(address: string): Promise<void>;
23
+ setItem(address: string, previousHash: string): Promise<void>;
24
+ }
25
+ //# sourceMappingURL=IndexedDbPreviousHashStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IndexedDbPreviousHashStore.d.ts","sourceRoot":"","sources":["../../src/IndexedDbPreviousHashStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAC1E,OAAO,EAAE,QAAQ,EAAwB,MAAM,KAAK,CAAA;AAEpD,MAAM,WAAW,yBAA0B,SAAQ,QAAQ;IACzD,eAAe,EAAE;QACf,GAAG,EAAE,MAAM,CAAA;QACX,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;CACF;AAED,qBAAa,0BAA2B,YAAW,iBAAiB;IAClE,MAAM,CAAC,QAAQ,CAAC,oBAAoB,KAAI;IACxC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAkD;;IAQrE;;OAEG;IACH,IAAI,MAAM,UAET;IAED;;OAEG;IACH,IAAI,SAAS,oBAEZ;IAEK,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAIhD,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAG1C,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGpE"}
@@ -16,17 +16,19 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/IndexedDbPreviousHashStore.ts
19
21
  var IndexedDbPreviousHashStore_exports = {};
20
22
  __export(IndexedDbPreviousHashStore_exports, {
21
23
  IndexedDbPreviousHashStore: () => IndexedDbPreviousHashStore
22
24
  });
23
25
  module.exports = __toCommonJS(IndexedDbPreviousHashStore_exports);
24
26
  var import_idb = require("idb");
25
- class IndexedDbPreviousHashStore {
27
+ var IndexedDbPreviousHashStore = class _IndexedDbPreviousHashStore {
26
28
  static CurrentSchemaVersion = 1;
27
29
  db;
28
30
  constructor() {
29
- this.db = (0, import_idb.openDB)(this.dbName, IndexedDbPreviousHashStore.CurrentSchemaVersion, {
31
+ this.db = (0, import_idb.openDB)(this.dbName, _IndexedDbPreviousHashStore.CurrentSchemaVersion, {
30
32
  upgrade: (db) => db.createObjectStore(this.storeName)
31
33
  });
32
34
  }
@@ -52,7 +54,7 @@ class IndexedDbPreviousHashStore {
52
54
  async setItem(address, previousHash) {
53
55
  await (await this.db).put(this.storeName, previousHash, address);
54
56
  }
55
- }
57
+ };
56
58
  // Annotate the CommonJS export names for ESM import in node:
57
59
  0 && (module.exports = {
58
60
  IndexedDbPreviousHashStore
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/IndexedDbPreviousHashStore.ts"],"sourcesContent":["import { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\nimport { DBSchema, IDBPDatabase, openDB } from 'idb'\n\nexport interface PreviousHashStoreSchemaV1 extends DBSchema {\n 'previous-hash': {\n key: string\n value: string\n }\n}\n\nexport class IndexedDbPreviousHashStore implements PreviousHashStore {\n static readonly CurrentSchemaVersion = 1\n private readonly db: Promise<IDBPDatabase<PreviousHashStoreSchemaV1>>\n\n constructor() {\n this.db = openDB<PreviousHashStoreSchemaV1>(this.dbName, IndexedDbPreviousHashStore.CurrentSchemaVersion, {\n upgrade: (db) => db.createObjectStore(this.storeName),\n })\n }\n\n /**\n * The database name.\n */\n get dbName() {\n return 'xyo' as const\n }\n\n /**\n * The name of the object store.\n */\n get storeName() {\n return 'previous-hash' as const\n }\n\n async getItem(address: string): Promise<string | null> {\n const value = await (await this.db).get(this.storeName, address)\n return value ?? null\n }\n async removeItem(address: string): Promise<void> {\n await (await this.db).delete(this.storeName, address)\n }\n async setItem(address: string, previousHash: string): Promise<void> {\n await (await this.db).put(this.storeName, previousHash, address)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,iBAA+C;AASxC,MAAM,2BAAwD;AAAA,EACnE,OAAgB,uBAAuB;AAAA,EACtB;AAAA,EAEjB,cAAc;AACZ,SAAK,SAAK,mBAAkC,KAAK,QAAQ,2BAA2B,sBAAsB;AAAA,MACxG,SAAS,CAAC,OAAO,GAAG,kBAAkB,KAAK,SAAS;AAAA,IACtD,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,SAAS;AACX,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,YAAY;AACd,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,QAAQ,SAAyC;AACrD,UAAM,QAAQ,OAAO,MAAM,KAAK,IAAI,IAAI,KAAK,WAAW,OAAO;AAC/D,WAAO,SAAS;AAAA,EAClB;AAAA,EACA,MAAM,WAAW,SAAgC;AAC/C,WAAO,MAAM,KAAK,IAAI,OAAO,KAAK,WAAW,OAAO;AAAA,EACtD;AAAA,EACA,MAAM,QAAQ,SAAiB,cAAqC;AAClE,WAAO,MAAM,KAAK,IAAI,IAAI,KAAK,WAAW,cAAc,OAAO;AAAA,EACjE;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/IndexedDbPreviousHashStore.ts"],"sourcesContent":["import { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\nimport { DBSchema, IDBPDatabase, openDB } from 'idb'\n\nexport interface PreviousHashStoreSchemaV1 extends DBSchema {\n 'previous-hash': {\n key: string\n value: string\n }\n}\n\nexport class IndexedDbPreviousHashStore implements PreviousHashStore {\n static readonly CurrentSchemaVersion = 1\n private readonly db: Promise<IDBPDatabase<PreviousHashStoreSchemaV1>>\n\n constructor() {\n this.db = openDB<PreviousHashStoreSchemaV1>(this.dbName, IndexedDbPreviousHashStore.CurrentSchemaVersion, {\n upgrade: (db) => db.createObjectStore(this.storeName),\n })\n }\n\n /**\n * The database name.\n */\n get dbName() {\n return 'xyo' as const\n }\n\n /**\n * The name of the object store.\n */\n get storeName() {\n return 'previous-hash' as const\n }\n\n async getItem(address: string): Promise<string | null> {\n const value = await (await this.db).get(this.storeName, address)\n return value ?? null\n }\n async removeItem(address: string): Promise<void> {\n await (await this.db).delete(this.storeName, address)\n }\n async setItem(address: string, previousHash: string): Promise<void> {\n await (await this.db).put(this.storeName, previousHash, address)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,iBAA+C;AASxC,IAAM,6BAAN,MAAM,4BAAwD;AAAA,EACnE,OAAgB,uBAAuB;AAAA,EACtB;AAAA,EAEjB,cAAc;AACZ,SAAK,SAAK,mBAAkC,KAAK,QAAQ,4BAA2B,sBAAsB;AAAA,MACxG,SAAS,CAAC,OAAO,GAAG,kBAAkB,KAAK,SAAS;AAAA,IACtD,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,SAAS;AACX,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,YAAY;AACd,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,QAAQ,SAAyC;AACrD,UAAM,QAAQ,OAAO,MAAM,KAAK,IAAI,IAAI,KAAK,WAAW,OAAO;AAC/D,WAAO,SAAS;AAAA,EAClB;AAAA,EACA,MAAM,WAAW,SAAgC;AAC/C,WAAO,MAAM,KAAK,IAAI,OAAO,KAAK,WAAW,OAAO;AAAA,EACtD;AAAA,EACA,MAAM,QAAQ,SAAiB,cAAqC;AAClE,WAAO,MAAM,KAAK,IAAI,IAAI,KAAK,WAAW,cAAc,OAAO;AAAA,EACjE;AACF;","names":[]}
@@ -1,9 +1,10 @@
1
+ // src/IndexedDbPreviousHashStore.ts
1
2
  import { openDB } from "idb";
2
- class IndexedDbPreviousHashStore {
3
+ var IndexedDbPreviousHashStore = class _IndexedDbPreviousHashStore {
3
4
  static CurrentSchemaVersion = 1;
4
5
  db;
5
6
  constructor() {
6
- this.db = openDB(this.dbName, IndexedDbPreviousHashStore.CurrentSchemaVersion, {
7
+ this.db = openDB(this.dbName, _IndexedDbPreviousHashStore.CurrentSchemaVersion, {
7
8
  upgrade: (db) => db.createObjectStore(this.storeName)
8
9
  });
9
10
  }
@@ -29,7 +30,7 @@ class IndexedDbPreviousHashStore {
29
30
  async setItem(address, previousHash) {
30
31
  await (await this.db).put(this.storeName, previousHash, address);
31
32
  }
32
- }
33
+ };
33
34
  export {
34
35
  IndexedDbPreviousHashStore
35
36
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/IndexedDbPreviousHashStore.ts"],"sourcesContent":["import { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\nimport { DBSchema, IDBPDatabase, openDB } from 'idb'\n\nexport interface PreviousHashStoreSchemaV1 extends DBSchema {\n 'previous-hash': {\n key: string\n value: string\n }\n}\n\nexport class IndexedDbPreviousHashStore implements PreviousHashStore {\n static readonly CurrentSchemaVersion = 1\n private readonly db: Promise<IDBPDatabase<PreviousHashStoreSchemaV1>>\n\n constructor() {\n this.db = openDB<PreviousHashStoreSchemaV1>(this.dbName, IndexedDbPreviousHashStore.CurrentSchemaVersion, {\n upgrade: (db) => db.createObjectStore(this.storeName),\n })\n }\n\n /**\n * The database name.\n */\n get dbName() {\n return 'xyo' as const\n }\n\n /**\n * The name of the object store.\n */\n get storeName() {\n return 'previous-hash' as const\n }\n\n async getItem(address: string): Promise<string | null> {\n const value = await (await this.db).get(this.storeName, address)\n return value ?? null\n }\n async removeItem(address: string): Promise<void> {\n await (await this.db).delete(this.storeName, address)\n }\n async setItem(address: string, previousHash: string): Promise<void> {\n await (await this.db).put(this.storeName, previousHash, address)\n }\n}\n"],"mappings":"AACA,SAAiC,cAAc;AASxC,MAAM,2BAAwD;AAAA,EACnE,OAAgB,uBAAuB;AAAA,EACtB;AAAA,EAEjB,cAAc;AACZ,SAAK,KAAK,OAAkC,KAAK,QAAQ,2BAA2B,sBAAsB;AAAA,MACxG,SAAS,CAAC,OAAO,GAAG,kBAAkB,KAAK,SAAS;AAAA,IACtD,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,SAAS;AACX,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,YAAY;AACd,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,QAAQ,SAAyC;AACrD,UAAM,QAAQ,OAAO,MAAM,KAAK,IAAI,IAAI,KAAK,WAAW,OAAO;AAC/D,WAAO,SAAS;AAAA,EAClB;AAAA,EACA,MAAM,WAAW,SAAgC;AAC/C,WAAO,MAAM,KAAK,IAAI,OAAO,KAAK,WAAW,OAAO;AAAA,EACtD;AAAA,EACA,MAAM,QAAQ,SAAiB,cAAqC;AAClE,WAAO,MAAM,KAAK,IAAI,IAAI,KAAK,WAAW,cAAc,OAAO;AAAA,EACjE;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/IndexedDbPreviousHashStore.ts"],"sourcesContent":["import { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\nimport { DBSchema, IDBPDatabase, openDB } from 'idb'\n\nexport interface PreviousHashStoreSchemaV1 extends DBSchema {\n 'previous-hash': {\n key: string\n value: string\n }\n}\n\nexport class IndexedDbPreviousHashStore implements PreviousHashStore {\n static readonly CurrentSchemaVersion = 1\n private readonly db: Promise<IDBPDatabase<PreviousHashStoreSchemaV1>>\n\n constructor() {\n this.db = openDB<PreviousHashStoreSchemaV1>(this.dbName, IndexedDbPreviousHashStore.CurrentSchemaVersion, {\n upgrade: (db) => db.createObjectStore(this.storeName),\n })\n }\n\n /**\n * The database name.\n */\n get dbName() {\n return 'xyo' as const\n }\n\n /**\n * The name of the object store.\n */\n get storeName() {\n return 'previous-hash' as const\n }\n\n async getItem(address: string): Promise<string | null> {\n const value = await (await this.db).get(this.storeName, address)\n return value ?? null\n }\n async removeItem(address: string): Promise<void> {\n await (await this.db).delete(this.storeName, address)\n }\n async setItem(address: string, previousHash: string): Promise<void> {\n await (await this.db).put(this.storeName, previousHash, address)\n }\n}\n"],"mappings":";AACA,SAAiC,cAAc;AASxC,IAAM,6BAAN,MAAM,4BAAwD;AAAA,EACnE,OAAgB,uBAAuB;AAAA,EACtB;AAAA,EAEjB,cAAc;AACZ,SAAK,KAAK,OAAkC,KAAK,QAAQ,4BAA2B,sBAAsB;AAAA,MACxG,SAAS,CAAC,OAAO,GAAG,kBAAkB,KAAK,SAAS;AAAA,IACtD,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,SAAS;AACX,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,YAAY;AACd,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,QAAQ,SAAyC;AACrD,UAAM,QAAQ,OAAO,MAAM,KAAK,IAAI,IAAI,KAAK,WAAW,OAAO;AAC/D,WAAO,SAAS;AAAA,EAClB;AAAA,EACA,MAAM,WAAW,SAAgC;AAC/C,WAAO,MAAM,KAAK,IAAI,OAAO,KAAK,WAAW,OAAO;AAAA,EACtD;AAAA,EACA,MAAM,QAAQ,SAAiB,cAAqC;AAClE,WAAO,MAAM,KAAK,IAAI,IAAI,KAAK,WAAW,cAAc,OAAO;AAAA,EACjE;AACF;","names":[]}
@@ -0,0 +1,2 @@
1
+ export * from './IndexedDbPreviousHashStore';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAA"}
@@ -3,6 +3,10 @@ var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
6
10
  var __copyProps = (to, from, except, desc) => {
7
11
  if (from && typeof from === "object" || typeof from === "function") {
8
12
  for (let key of __getOwnPropNames(from))
@@ -11,13 +15,50 @@ var __copyProps = (to, from, except, desc) => {
11
15
  }
12
16
  return to;
13
17
  };
14
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
16
21
  var src_exports = {};
22
+ __export(src_exports, {
23
+ IndexedDbPreviousHashStore: () => IndexedDbPreviousHashStore
24
+ });
17
25
  module.exports = __toCommonJS(src_exports);
18
- __reExport(src_exports, require("./IndexedDbPreviousHashStore"), module.exports);
26
+
27
+ // src/IndexedDbPreviousHashStore.ts
28
+ var import_idb = require("idb");
29
+ var IndexedDbPreviousHashStore = class _IndexedDbPreviousHashStore {
30
+ static CurrentSchemaVersion = 1;
31
+ db;
32
+ constructor() {
33
+ this.db = (0, import_idb.openDB)(this.dbName, _IndexedDbPreviousHashStore.CurrentSchemaVersion, {
34
+ upgrade: (db) => db.createObjectStore(this.storeName)
35
+ });
36
+ }
37
+ /**
38
+ * The database name.
39
+ */
40
+ get dbName() {
41
+ return "xyo";
42
+ }
43
+ /**
44
+ * The name of the object store.
45
+ */
46
+ get storeName() {
47
+ return "previous-hash";
48
+ }
49
+ async getItem(address) {
50
+ const value = await (await this.db).get(this.storeName, address);
51
+ return value ?? null;
52
+ }
53
+ async removeItem(address) {
54
+ await (await this.db).delete(this.storeName, address);
55
+ }
56
+ async setItem(address, previousHash) {
57
+ await (await this.db).put(this.storeName, previousHash, address);
58
+ }
59
+ };
19
60
  // Annotate the CommonJS export names for ESM import in node:
20
61
  0 && (module.exports = {
21
- ...require("./IndexedDbPreviousHashStore")
62
+ IndexedDbPreviousHashStore
22
63
  });
23
64
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export * from './IndexedDbPreviousHashStore'\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,yCAAd;","names":[]}
1
+ {"version":3,"sources":["../../src/index.ts","../../src/IndexedDbPreviousHashStore.ts"],"sourcesContent":["export * from './IndexedDbPreviousHashStore'\n","import { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\nimport { DBSchema, IDBPDatabase, openDB } from 'idb'\n\nexport interface PreviousHashStoreSchemaV1 extends DBSchema {\n 'previous-hash': {\n key: string\n value: string\n }\n}\n\nexport class IndexedDbPreviousHashStore implements PreviousHashStore {\n static readonly CurrentSchemaVersion = 1\n private readonly db: Promise<IDBPDatabase<PreviousHashStoreSchemaV1>>\n\n constructor() {\n this.db = openDB<PreviousHashStoreSchemaV1>(this.dbName, IndexedDbPreviousHashStore.CurrentSchemaVersion, {\n upgrade: (db) => db.createObjectStore(this.storeName),\n })\n }\n\n /**\n * The database name.\n */\n get dbName() {\n return 'xyo' as const\n }\n\n /**\n * The name of the object store.\n */\n get storeName() {\n return 'previous-hash' as const\n }\n\n async getItem(address: string): Promise<string | null> {\n const value = await (await this.db).get(this.storeName, address)\n return value ?? null\n }\n async removeItem(address: string): Promise<void> {\n await (await this.db).delete(this.storeName, address)\n }\n async setItem(address: string, previousHash: string): Promise<void> {\n await (await this.db).put(this.storeName, previousHash, address)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,iBAA+C;AASxC,IAAM,6BAAN,MAAM,4BAAwD;AAAA,EACnE,OAAgB,uBAAuB;AAAA,EACtB;AAAA,EAEjB,cAAc;AACZ,SAAK,SAAK,mBAAkC,KAAK,QAAQ,4BAA2B,sBAAsB;AAAA,MACxG,SAAS,CAAC,OAAO,GAAG,kBAAkB,KAAK,SAAS;AAAA,IACtD,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,SAAS;AACX,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,YAAY;AACd,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,QAAQ,SAAyC;AACrD,UAAM,QAAQ,OAAO,MAAM,KAAK,IAAI,IAAI,KAAK,WAAW,OAAO;AAC/D,WAAO,SAAS;AAAA,EAClB;AAAA,EACA,MAAM,WAAW,SAAgC;AAC/C,WAAO,MAAM,KAAK,IAAI,OAAO,KAAK,WAAW,OAAO;AAAA,EACtD;AAAA,EACA,MAAM,QAAQ,SAAiB,cAAqC;AAClE,WAAO,MAAM,KAAK,IAAI,IAAI,KAAK,WAAW,cAAc,OAAO;AAAA,EACjE;AACF;","names":[]}
@@ -1,2 +1,37 @@
1
- export * from "./IndexedDbPreviousHashStore";
1
+ // src/IndexedDbPreviousHashStore.ts
2
+ import { openDB } from "idb";
3
+ var IndexedDbPreviousHashStore = class _IndexedDbPreviousHashStore {
4
+ static CurrentSchemaVersion = 1;
5
+ db;
6
+ constructor() {
7
+ this.db = openDB(this.dbName, _IndexedDbPreviousHashStore.CurrentSchemaVersion, {
8
+ upgrade: (db) => db.createObjectStore(this.storeName)
9
+ });
10
+ }
11
+ /**
12
+ * The database name.
13
+ */
14
+ get dbName() {
15
+ return "xyo";
16
+ }
17
+ /**
18
+ * The name of the object store.
19
+ */
20
+ get storeName() {
21
+ return "previous-hash";
22
+ }
23
+ async getItem(address) {
24
+ const value = await (await this.db).get(this.storeName, address);
25
+ return value ?? null;
26
+ }
27
+ async removeItem(address) {
28
+ await (await this.db).delete(this.storeName, address);
29
+ }
30
+ async setItem(address, previousHash) {
31
+ await (await this.db).put(this.storeName, previousHash, address);
32
+ }
33
+ };
34
+ export {
35
+ IndexedDbPreviousHashStore
36
+ };
2
37
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export * from './IndexedDbPreviousHashStore'\n"],"mappings":"AAAA,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../src/IndexedDbPreviousHashStore.ts"],"sourcesContent":["import { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\nimport { DBSchema, IDBPDatabase, openDB } from 'idb'\n\nexport interface PreviousHashStoreSchemaV1 extends DBSchema {\n 'previous-hash': {\n key: string\n value: string\n }\n}\n\nexport class IndexedDbPreviousHashStore implements PreviousHashStore {\n static readonly CurrentSchemaVersion = 1\n private readonly db: Promise<IDBPDatabase<PreviousHashStoreSchemaV1>>\n\n constructor() {\n this.db = openDB<PreviousHashStoreSchemaV1>(this.dbName, IndexedDbPreviousHashStore.CurrentSchemaVersion, {\n upgrade: (db) => db.createObjectStore(this.storeName),\n })\n }\n\n /**\n * The database name.\n */\n get dbName() {\n return 'xyo' as const\n }\n\n /**\n * The name of the object store.\n */\n get storeName() {\n return 'previous-hash' as const\n }\n\n async getItem(address: string): Promise<string | null> {\n const value = await (await this.db).get(this.storeName, address)\n return value ?? null\n }\n async removeItem(address: string): Promise<void> {\n await (await this.db).delete(this.storeName, address)\n }\n async setItem(address: string, previousHash: string): Promise<void> {\n await (await this.db).put(this.storeName, previousHash, address)\n }\n}\n"],"mappings":";AACA,SAAiC,cAAc;AASxC,IAAM,6BAAN,MAAM,4BAAwD;AAAA,EACnE,OAAgB,uBAAuB;AAAA,EACtB;AAAA,EAEjB,cAAc;AACZ,SAAK,KAAK,OAAkC,KAAK,QAAQ,4BAA2B,sBAAsB;AAAA,MACxG,SAAS,CAAC,OAAO,GAAG,kBAAkB,KAAK,SAAS;AAAA,IACtD,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,SAAS;AACX,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,YAAY;AACd,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,QAAQ,SAAyC;AACrD,UAAM,QAAQ,OAAO,MAAM,KAAK,IAAI,IAAI,KAAK,WAAW,OAAO;AAC/D,WAAO,SAAS;AAAA,EAClB;AAAA,EACA,MAAM,WAAW,SAAgC;AAC/C,WAAO,MAAM,KAAK,IAAI,OAAO,KAAK,WAAW,OAAO;AAAA,EACtD;AAAA,EACA,MAAM,QAAQ,SAAiB,cAAqC;AAClE,WAAO,MAAM,KAAK,IAAI,IAAI,KAAK,WAAW,cAAc,OAAO;AAAA,EACjE;AACF;","names":[]}
package/package.json CHANGED
@@ -11,12 +11,12 @@
11
11
  },
12
12
  "description": "Primary SDK for using XYO Protocol 2.0",
13
13
  "dependencies": {
14
- "@xyo-network/previous-hash-store-model": "~2.75.0",
14
+ "@xyo-network/previous-hash-store-model": "~2.75.1",
15
15
  "idb": "^7.1.1"
16
16
  },
17
17
  "devDependencies": {
18
- "@xylabs/ts-scripts-yarn3": "^3.0.70",
19
- "@xylabs/tsconfig": "^3.0.70",
18
+ "@xylabs/ts-scripts-yarn3": "^3.0.77",
19
+ "@xylabs/tsconfig": "^3.0.77",
20
20
  "fake-indexeddb": "^4.0.2",
21
21
  "typescript": "^5.2.2"
22
22
  },
@@ -25,7 +25,7 @@
25
25
  ".": {
26
26
  "browser": {
27
27
  "require": {
28
- "types": "./dist/browser/index.d.ts",
28
+ "types": "./dist/browser/index.d.cts",
29
29
  "default": "./dist/browser/index.cjs"
30
30
  },
31
31
  "import": {
@@ -62,5 +62,5 @@
62
62
  },
63
63
  "sideEffects": false,
64
64
  "types": "dist/node/index.d.ts",
65
- "version": "2.75.0"
65
+ "version": "2.75.1"
66
66
  }