@xyo-network/previous-hash-store-indexeddb 2.74.4 → 2.75.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 (37) hide show
  1. package/dist/browser/IndexedDbPreviousHashStore.cjs +58 -0
  2. package/dist/{index.js.map → browser/IndexedDbPreviousHashStore.cjs.map} +1 -1
  3. package/dist/browser/IndexedDbPreviousHashStore.d.mts.map +1 -0
  4. package/dist/browser/IndexedDbPreviousHashStore.d.ts.map +1 -0
  5. package/dist/browser/IndexedDbPreviousHashStore.js +37 -0
  6. package/dist/browser/IndexedDbPreviousHashStore.js.map +1 -0
  7. package/dist/{index.js → browser/index.cjs} +1 -5
  8. package/dist/browser/index.cjs.map +1 -0
  9. package/dist/{index.d.mts.map → browser/index.d.mts.map} +1 -1
  10. package/dist/{index.d.ts.map → browser/index.d.ts.map} +1 -1
  11. package/dist/{index.mjs → browser/index.js} +1 -1
  12. package/dist/browser/index.js.map +1 -0
  13. package/dist/node/IndexedDbPreviousHashStore.d.mts +25 -0
  14. package/dist/node/IndexedDbPreviousHashStore.d.mts.map +1 -0
  15. package/dist/node/IndexedDbPreviousHashStore.d.ts +25 -0
  16. package/dist/node/IndexedDbPreviousHashStore.d.ts.map +1 -0
  17. package/dist/node/IndexedDbPreviousHashStore.js +60 -0
  18. package/dist/node/IndexedDbPreviousHashStore.js.map +1 -0
  19. package/dist/node/IndexedDbPreviousHashStore.mjs +36 -0
  20. package/dist/node/IndexedDbPreviousHashStore.mjs.map +1 -0
  21. package/dist/node/index.d.mts +2 -0
  22. package/dist/node/index.d.mts.map +1 -0
  23. package/dist/node/index.d.ts +2 -0
  24. package/dist/node/index.d.ts.map +1 -0
  25. package/dist/node/index.js +23 -0
  26. package/dist/node/index.js.map +1 -0
  27. package/dist/node/index.mjs +2 -0
  28. package/dist/node/index.mjs.map +1 -0
  29. package/package.json +25 -22
  30. package/dist/IndexedDbPreviousHashStore.d.mts.map +0 -1
  31. package/dist/IndexedDbPreviousHashStore.d.ts.map +0 -1
  32. package/dist/docs.json +0 -729
  33. package/dist/index.mjs.map +0 -1
  34. /package/dist/{IndexedDbPreviousHashStore.d.mts → browser/IndexedDbPreviousHashStore.d.mts} +0 -0
  35. /package/dist/{IndexedDbPreviousHashStore.d.ts → browser/IndexedDbPreviousHashStore.d.ts} +0 -0
  36. /package/dist/{index.d.mts → browser/index.d.mts} +0 -0
  37. /package/dist/{index.d.ts → browser/index.d.ts} +0 -0
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
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
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/IndexedDbPreviousHashStore.ts
21
+ var IndexedDbPreviousHashStore_exports = {};
22
+ __export(IndexedDbPreviousHashStore_exports, {
23
+ IndexedDbPreviousHashStore: () => IndexedDbPreviousHashStore
24
+ });
25
+ module.exports = __toCommonJS(IndexedDbPreviousHashStore_exports);
26
+ var import_idb = require("idb");
27
+ var IndexedDbPreviousHashStore = class _IndexedDbPreviousHashStore {
28
+ static CurrentSchemaVersion = 1;
29
+ db;
30
+ constructor() {
31
+ this.db = (0, import_idb.openDB)(this.dbName, _IndexedDbPreviousHashStore.CurrentSchemaVersion, {
32
+ upgrade: (db) => db.createObjectStore(this.storeName)
33
+ });
34
+ }
35
+ /**
36
+ * The database name.
37
+ */
38
+ get dbName() {
39
+ return "xyo";
40
+ }
41
+ /**
42
+ * The name of the object store.
43
+ */
44
+ get storeName() {
45
+ return "previous-hash";
46
+ }
47
+ async getItem(address) {
48
+ const value = await (await this.db).get(this.storeName, address);
49
+ return value ?? null;
50
+ }
51
+ async removeItem(address) {
52
+ await (await this.db).delete(this.storeName, address);
53
+ }
54
+ async setItem(address, previousHash) {
55
+ await (await this.db).put(this.storeName, previousHash, address);
56
+ }
57
+ };
58
+ //# sourceMappingURL=IndexedDbPreviousHashStore.cjs.map
@@ -1 +1 @@
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
+ {"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":[]}
@@ -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"}
@@ -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"}
@@ -0,0 +1,37 @@
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
+ };
37
+ //# sourceMappingURL=IndexedDbPreviousHashStore.js.map
@@ -0,0 +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":[]}
@@ -57,8 +57,4 @@ var IndexedDbPreviousHashStore = class _IndexedDbPreviousHashStore {
57
57
  await (await this.db).put(this.storeName, previousHash, address);
58
58
  }
59
59
  };
60
- // Annotate the CommonJS export names for ESM import in node:
61
- 0 && (module.exports = {
62
- IndexedDbPreviousHashStore
63
- });
64
- //# sourceMappingURL=index.js.map
60
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
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 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAA"}
@@ -34,4 +34,4 @@ var IndexedDbPreviousHashStore = class _IndexedDbPreviousHashStore {
34
34
  export {
35
35
  IndexedDbPreviousHashStore
36
36
  };
37
- //# sourceMappingURL=index.mjs.map
37
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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":[]}
@@ -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"}
@@ -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"}
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
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
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var IndexedDbPreviousHashStore_exports = {};
20
+ __export(IndexedDbPreviousHashStore_exports, {
21
+ IndexedDbPreviousHashStore: () => IndexedDbPreviousHashStore
22
+ });
23
+ module.exports = __toCommonJS(IndexedDbPreviousHashStore_exports);
24
+ var import_idb = require("idb");
25
+ class IndexedDbPreviousHashStore {
26
+ static CurrentSchemaVersion = 1;
27
+ db;
28
+ constructor() {
29
+ this.db = (0, import_idb.openDB)(this.dbName, IndexedDbPreviousHashStore.CurrentSchemaVersion, {
30
+ upgrade: (db) => db.createObjectStore(this.storeName)
31
+ });
32
+ }
33
+ /**
34
+ * The database name.
35
+ */
36
+ get dbName() {
37
+ return "xyo";
38
+ }
39
+ /**
40
+ * The name of the object store.
41
+ */
42
+ get storeName() {
43
+ return "previous-hash";
44
+ }
45
+ async getItem(address) {
46
+ const value = await (await this.db).get(this.storeName, address);
47
+ return value ?? null;
48
+ }
49
+ async removeItem(address) {
50
+ await (await this.db).delete(this.storeName, address);
51
+ }
52
+ async setItem(address, previousHash) {
53
+ await (await this.db).put(this.storeName, previousHash, address);
54
+ }
55
+ }
56
+ // Annotate the CommonJS export names for ESM import in node:
57
+ 0 && (module.exports = {
58
+ IndexedDbPreviousHashStore
59
+ });
60
+ //# sourceMappingURL=IndexedDbPreviousHashStore.js.map
@@ -0,0 +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":[]}
@@ -0,0 +1,36 @@
1
+ import { openDB } from "idb";
2
+ class IndexedDbPreviousHashStore {
3
+ static CurrentSchemaVersion = 1;
4
+ db;
5
+ constructor() {
6
+ this.db = openDB(this.dbName, IndexedDbPreviousHashStore.CurrentSchemaVersion, {
7
+ upgrade: (db) => db.createObjectStore(this.storeName)
8
+ });
9
+ }
10
+ /**
11
+ * The database name.
12
+ */
13
+ get dbName() {
14
+ return "xyo";
15
+ }
16
+ /**
17
+ * The name of the object store.
18
+ */
19
+ get storeName() {
20
+ return "previous-hash";
21
+ }
22
+ async getItem(address) {
23
+ const value = await (await this.db).get(this.storeName, address);
24
+ return value ?? null;
25
+ }
26
+ async removeItem(address) {
27
+ await (await this.db).delete(this.storeName, address);
28
+ }
29
+ async setItem(address, previousHash) {
30
+ await (await this.db).put(this.storeName, previousHash, address);
31
+ }
32
+ }
33
+ export {
34
+ IndexedDbPreviousHashStore
35
+ };
36
+ //# sourceMappingURL=IndexedDbPreviousHashStore.mjs.map
@@ -0,0 +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":[]}
@@ -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"}
@@ -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"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
+ var src_exports = {};
17
+ module.exports = __toCommonJS(src_exports);
18
+ __reExport(src_exports, require("./IndexedDbPreviousHashStore"), module.exports);
19
+ // Annotate the CommonJS export names for ESM import in node:
20
+ 0 && (module.exports = {
21
+ ...require("./IndexedDbPreviousHashStore")
22
+ });
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export * from './IndexedDbPreviousHashStore'\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,yCAAd;","names":[]}
@@ -0,0 +1,2 @@
1
+ export * from "./IndexedDbPreviousHashStore";
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export * from './IndexedDbPreviousHashStore'\n"],"mappings":"AAAA,cAAc;","names":[]}
package/package.json CHANGED
@@ -11,43 +11,46 @@
11
11
  },
12
12
  "description": "Primary SDK for using XYO Protocol 2.0",
13
13
  "dependencies": {
14
- "@xyo-network/previous-hash-store-model": "~2.74.4",
14
+ "@xyo-network/previous-hash-store-model": "~2.75.0",
15
15
  "idb": "^7.1.1"
16
16
  },
17
17
  "devDependencies": {
18
- "@xylabs/ts-scripts-yarn3": "^3.0.28",
19
- "@xylabs/tsconfig": "^3.0.28",
18
+ "@xylabs/ts-scripts-yarn3": "^3.0.70",
19
+ "@xylabs/tsconfig": "^3.0.70",
20
20
  "fake-indexeddb": "^4.0.2",
21
21
  "typescript": "^5.2.2"
22
22
  },
23
23
  "docs": "dist/docs.json",
24
24
  "exports": {
25
25
  ".": {
26
- "require": {
27
- "types": "./dist/index.d.ts",
28
- "default": "./dist/index.js"
26
+ "browser": {
27
+ "require": {
28
+ "types": "./dist/browser/index.d.ts",
29
+ "default": "./dist/browser/index.cjs"
30
+ },
31
+ "import": {
32
+ "types": "./dist/browser/index.d.mts",
33
+ "default": "./dist/browser/index.js"
34
+ }
29
35
  },
30
- "import": {
31
- "types": "./dist/index.d.mts",
32
- "default": "./dist/index.mjs"
36
+ "node": {
37
+ "require": {
38
+ "types": "./dist/node/index.d.ts",
39
+ "default": "./dist/node/index.js"
40
+ },
41
+ "import": {
42
+ "types": "./dist/node/index.d.mts",
43
+ "default": "./dist/node/index.mjs"
44
+ }
33
45
  }
34
46
  },
35
- "./dist/docs.json": {
36
- "default": "./dist/docs.json"
37
- },
38
- "./cjs": {
39
- "default": "./dist/index.js"
40
- },
41
47
  "./docs": {
42
48
  "default": "./dist/docs.json"
43
49
  },
44
- "./esm": {
45
- "default": "./dist/index.mjs"
46
- },
47
50
  "./package.json": "./package.json"
48
51
  },
49
- "main": "dist/index.js",
50
- "module": "dist/index.mjs",
52
+ "main": "dist/node/index.js",
53
+ "module": "dist/node/index.mjs",
51
54
  "homepage": "https://xyo.network",
52
55
  "license": "LGPL-3.0",
53
56
  "publishConfig": {
@@ -58,6 +61,6 @@
58
61
  "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
59
62
  },
60
63
  "sideEffects": false,
61
- "types": "dist/index.d.ts",
62
- "version": "2.74.4"
64
+ "types": "dist/node/index.d.ts",
65
+ "version": "2.75.0"
63
66
  }
@@ -1 +0,0 @@
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 +0,0 @@
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"}
package/dist/docs.json DELETED
@@ -1,729 +0,0 @@
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/7baa54c6ef52c/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/7baa54c6ef52c/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/7baa54c6ef52c/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/7baa54c6ef52c/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/7baa54c6ef52c/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/7baa54c6ef52c/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/7baa54c6ef52c/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/7baa54c6ef52c/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/7baa54c6ef52c/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/7baa54c6ef52c/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/7baa54c6ef52c/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/7baa54c6ef52c/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/7baa54c6ef52c/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/7baa54c6ef52c/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/7baa54c6ef52c/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/7baa54c6ef52c/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/7baa54c6ef52c/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/7baa54c6ef52c/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/7baa54c6ef52c/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/7baa54c6ef52c/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
- }
@@ -1 +0,0 @@
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":[]}
File without changes
File without changes