@xyo-network/previous-hash-store-indexeddb 2.90.23 → 2.91.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.
- package/dist/browser/IndexedDbPreviousHashStore.d.cts +4 -3
- package/dist/browser/IndexedDbPreviousHashStore.d.cts.map +1 -1
- package/dist/browser/IndexedDbPreviousHashStore.d.mts +4 -3
- package/dist/browser/IndexedDbPreviousHashStore.d.mts.map +1 -1
- package/dist/browser/IndexedDbPreviousHashStore.d.ts +4 -3
- package/dist/browser/IndexedDbPreviousHashStore.d.ts.map +1 -1
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/node/IndexedDbPreviousHashStore.d.cts +4 -3
- package/dist/node/IndexedDbPreviousHashStore.d.cts.map +1 -1
- package/dist/node/IndexedDbPreviousHashStore.d.mts +4 -3
- package/dist/node/IndexedDbPreviousHashStore.d.mts.map +1 -1
- package/dist/node/IndexedDbPreviousHashStore.d.ts +4 -3
- package/dist/node/IndexedDbPreviousHashStore.d.ts.map +1 -1
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.js.map +1 -1
- package/package.json +5 -4
- package/src/IndexedDbPreviousHashStore.ts +5 -4
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Address, Hash } from '@xylabs/hex';
|
|
1
2
|
import { PreviousHashStore } from '@xyo-network/previous-hash-store-model';
|
|
2
3
|
import { DBSchema } from 'idb';
|
|
3
4
|
export interface PreviousHashStoreSchemaV1 extends DBSchema {
|
|
@@ -18,8 +19,8 @@ export declare class IndexedDbPreviousHashStore implements PreviousHashStore {
|
|
|
18
19
|
* The name of the object store.
|
|
19
20
|
*/
|
|
20
21
|
get storeName(): "previous-hash";
|
|
21
|
-
getItem(address:
|
|
22
|
-
removeItem(address:
|
|
23
|
-
setItem(address:
|
|
22
|
+
getItem(address: Address): Promise<Hash | null>;
|
|
23
|
+
removeItem(address: Address): Promise<void>;
|
|
24
|
+
setItem(address: Address, previousHash: string): Promise<void>;
|
|
24
25
|
}
|
|
25
26
|
//# sourceMappingURL=IndexedDbPreviousHashStore.d.ts.map
|
|
@@ -1 +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,
|
|
1
|
+
{"version":3,"file":"IndexedDbPreviousHashStore.d.ts","sourceRoot":"","sources":["../../src/IndexedDbPreviousHashStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAC3C,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,OAAO,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAI/C,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAG3C,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGrE"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Address, Hash } from '@xylabs/hex';
|
|
1
2
|
import { PreviousHashStore } from '@xyo-network/previous-hash-store-model';
|
|
2
3
|
import { DBSchema } from 'idb';
|
|
3
4
|
export interface PreviousHashStoreSchemaV1 extends DBSchema {
|
|
@@ -18,8 +19,8 @@ export declare class IndexedDbPreviousHashStore implements PreviousHashStore {
|
|
|
18
19
|
* The name of the object store.
|
|
19
20
|
*/
|
|
20
21
|
get storeName(): "previous-hash";
|
|
21
|
-
getItem(address:
|
|
22
|
-
removeItem(address:
|
|
23
|
-
setItem(address:
|
|
22
|
+
getItem(address: Address): Promise<Hash | null>;
|
|
23
|
+
removeItem(address: Address): Promise<void>;
|
|
24
|
+
setItem(address: Address, previousHash: string): Promise<void>;
|
|
24
25
|
}
|
|
25
26
|
//# sourceMappingURL=IndexedDbPreviousHashStore.d.ts.map
|
|
@@ -1 +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,
|
|
1
|
+
{"version":3,"file":"IndexedDbPreviousHashStore.d.ts","sourceRoot":"","sources":["../../src/IndexedDbPreviousHashStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAC3C,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,OAAO,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAI/C,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAG3C,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGrE"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Address, Hash } from '@xylabs/hex';
|
|
1
2
|
import { PreviousHashStore } from '@xyo-network/previous-hash-store-model';
|
|
2
3
|
import { DBSchema } from 'idb';
|
|
3
4
|
export interface PreviousHashStoreSchemaV1 extends DBSchema {
|
|
@@ -18,8 +19,8 @@ export declare class IndexedDbPreviousHashStore implements PreviousHashStore {
|
|
|
18
19
|
* The name of the object store.
|
|
19
20
|
*/
|
|
20
21
|
get storeName(): "previous-hash";
|
|
21
|
-
getItem(address:
|
|
22
|
-
removeItem(address:
|
|
23
|
-
setItem(address:
|
|
22
|
+
getItem(address: Address): Promise<Hash | null>;
|
|
23
|
+
removeItem(address: Address): Promise<void>;
|
|
24
|
+
setItem(address: Address, previousHash: string): Promise<void>;
|
|
24
25
|
}
|
|
25
26
|
//# sourceMappingURL=IndexedDbPreviousHashStore.d.ts.map
|
|
@@ -1 +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,
|
|
1
|
+
{"version":3,"file":"IndexedDbPreviousHashStore.d.ts","sourceRoot":"","sources":["../../src/IndexedDbPreviousHashStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAC3C,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,OAAO,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAI/C,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAG3C,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGrE"}
|
|
@@ -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:
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/IndexedDbPreviousHashStore.ts"],"sourcesContent":["export * from './IndexedDbPreviousHashStore'\n","import { Address, Hash } from '@xylabs/hex'\nimport { 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: Address): Promise<Hash | null> {\n const value = (await (await this.db).get(this.storeName, address)) as Hash\n return value ?? null\n }\n async removeItem(address: Address): Promise<void> {\n await (await this.db).delete(this.storeName, address)\n }\n async setItem(address: Address, previousHash: string): Promise<void> {\n await (await this.db).put(this.storeName, previousHash, address)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;ACEA,iBAA+C;AASxC,IAAMA,6BAAN,MAAMA,4BAAAA;EATb,OASaA;;;EACX,OAAgBC,uBAAuB;EACtBC;EAEjBC,cAAc;AACZ,SAAKD,SAAKE,mBAAkC,KAAKC,QAAQL,4BAA2BC,sBAAsB;MACxGK,SAAS,CAACJ,OAAOA,GAAGK,kBAAkB,KAAKC,SAAS;IACtD,CAAA;EACF;;;;EAKA,IAAIH,SAAS;AACX,WAAO;EACT;;;;EAKA,IAAIG,YAAY;AACd,WAAO;EACT;EAEA,MAAMC,QAAQC,SAAwC;AACpD,UAAMC,QAAS,OAAO,MAAM,KAAKT,IAAIU,IAAI,KAAKJ,WAAWE,OAAAA;AACzD,WAAOC,SAAS;EAClB;EACA,MAAME,WAAWH,SAAiC;AAChD,WAAO,MAAM,KAAKR,IAAIY,OAAO,KAAKN,WAAWE,OAAAA;EAC/C;EACA,MAAMK,QAAQL,SAAkBM,cAAqC;AACnE,WAAO,MAAM,KAAKd,IAAIe,IAAI,KAAKT,WAAWQ,cAAcN,OAAAA;EAC1D;AACF;","names":["IndexedDbPreviousHashStore","CurrentSchemaVersion","db","constructor","openDB","dbName","upgrade","createObjectStore","storeName","getItem","address","value","get","removeItem","delete","setItem","previousHash","put"]}
|
|
@@ -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:
|
|
1
|
+
{"version":3,"sources":["../../src/IndexedDbPreviousHashStore.ts"],"sourcesContent":["import { Address, Hash } from '@xylabs/hex'\nimport { 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: Address): Promise<Hash | null> {\n const value = (await (await this.db).get(this.storeName, address)) as Hash\n return value ?? null\n }\n async removeItem(address: Address): Promise<void> {\n await (await this.db).delete(this.storeName, address)\n }\n async setItem(address: Address, previousHash: string): Promise<void> {\n await (await this.db).put(this.storeName, previousHash, address)\n }\n}\n"],"mappings":";;;;AAEA,SAAiCA,cAAc;AASxC,IAAMC,6BAAN,MAAMA,4BAAAA;EATb,OASaA;;;EACX,OAAgBC,uBAAuB;EACtBC;EAEjBC,cAAc;AACZ,SAAKD,KAAKE,OAAkC,KAAKC,QAAQL,4BAA2BC,sBAAsB;MACxGK,SAAS,CAACJ,OAAOA,GAAGK,kBAAkB,KAAKC,SAAS;IACtD,CAAA;EACF;;;;EAKA,IAAIH,SAAS;AACX,WAAO;EACT;;;;EAKA,IAAIG,YAAY;AACd,WAAO;EACT;EAEA,MAAMC,QAAQC,SAAwC;AACpD,UAAMC,QAAS,OAAO,MAAM,KAAKT,IAAIU,IAAI,KAAKJ,WAAWE,OAAAA;AACzD,WAAOC,SAAS;EAClB;EACA,MAAME,WAAWH,SAAiC;AAChD,WAAO,MAAM,KAAKR,IAAIY,OAAO,KAAKN,WAAWE,OAAAA;EAC/C;EACA,MAAMK,QAAQL,SAAkBM,cAAqC;AACnE,WAAO,MAAM,KAAKd,IAAIe,IAAI,KAAKT,WAAWQ,cAAcN,OAAAA;EAC1D;AACF;","names":["openDB","IndexedDbPreviousHashStore","CurrentSchemaVersion","db","constructor","openDB","dbName","upgrade","createObjectStore","storeName","getItem","address","value","get","removeItem","delete","setItem","previousHash","put"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Address, Hash } from '@xylabs/hex';
|
|
1
2
|
import { PreviousHashStore } from '@xyo-network/previous-hash-store-model';
|
|
2
3
|
import { DBSchema } from 'idb';
|
|
3
4
|
export interface PreviousHashStoreSchemaV1 extends DBSchema {
|
|
@@ -18,8 +19,8 @@ export declare class IndexedDbPreviousHashStore implements PreviousHashStore {
|
|
|
18
19
|
* The name of the object store.
|
|
19
20
|
*/
|
|
20
21
|
get storeName(): "previous-hash";
|
|
21
|
-
getItem(address:
|
|
22
|
-
removeItem(address:
|
|
23
|
-
setItem(address:
|
|
22
|
+
getItem(address: Address): Promise<Hash | null>;
|
|
23
|
+
removeItem(address: Address): Promise<void>;
|
|
24
|
+
setItem(address: Address, previousHash: string): Promise<void>;
|
|
24
25
|
}
|
|
25
26
|
//# sourceMappingURL=IndexedDbPreviousHashStore.d.ts.map
|
|
@@ -1 +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,
|
|
1
|
+
{"version":3,"file":"IndexedDbPreviousHashStore.d.ts","sourceRoot":"","sources":["../../src/IndexedDbPreviousHashStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAC3C,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,OAAO,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAI/C,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAG3C,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGrE"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Address, Hash } from '@xylabs/hex';
|
|
1
2
|
import { PreviousHashStore } from '@xyo-network/previous-hash-store-model';
|
|
2
3
|
import { DBSchema } from 'idb';
|
|
3
4
|
export interface PreviousHashStoreSchemaV1 extends DBSchema {
|
|
@@ -18,8 +19,8 @@ export declare class IndexedDbPreviousHashStore implements PreviousHashStore {
|
|
|
18
19
|
* The name of the object store.
|
|
19
20
|
*/
|
|
20
21
|
get storeName(): "previous-hash";
|
|
21
|
-
getItem(address:
|
|
22
|
-
removeItem(address:
|
|
23
|
-
setItem(address:
|
|
22
|
+
getItem(address: Address): Promise<Hash | null>;
|
|
23
|
+
removeItem(address: Address): Promise<void>;
|
|
24
|
+
setItem(address: Address, previousHash: string): Promise<void>;
|
|
24
25
|
}
|
|
25
26
|
//# sourceMappingURL=IndexedDbPreviousHashStore.d.ts.map
|
|
@@ -1 +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,
|
|
1
|
+
{"version":3,"file":"IndexedDbPreviousHashStore.d.ts","sourceRoot":"","sources":["../../src/IndexedDbPreviousHashStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAC3C,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,OAAO,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAI/C,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAG3C,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGrE"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Address, Hash } from '@xylabs/hex';
|
|
1
2
|
import { PreviousHashStore } from '@xyo-network/previous-hash-store-model';
|
|
2
3
|
import { DBSchema } from 'idb';
|
|
3
4
|
export interface PreviousHashStoreSchemaV1 extends DBSchema {
|
|
@@ -18,8 +19,8 @@ export declare class IndexedDbPreviousHashStore implements PreviousHashStore {
|
|
|
18
19
|
* The name of the object store.
|
|
19
20
|
*/
|
|
20
21
|
get storeName(): "previous-hash";
|
|
21
|
-
getItem(address:
|
|
22
|
-
removeItem(address:
|
|
23
|
-
setItem(address:
|
|
22
|
+
getItem(address: Address): Promise<Hash | null>;
|
|
23
|
+
removeItem(address: Address): Promise<void>;
|
|
24
|
+
setItem(address: Address, previousHash: string): Promise<void>;
|
|
24
25
|
}
|
|
25
26
|
//# sourceMappingURL=IndexedDbPreviousHashStore.d.ts.map
|
|
@@ -1 +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,
|
|
1
|
+
{"version":3,"file":"IndexedDbPreviousHashStore.d.ts","sourceRoot":"","sources":["../../src/IndexedDbPreviousHashStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAC3C,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,OAAO,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAI/C,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAG3C,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGrE"}
|
package/dist/node/index.cjs.map
CHANGED
|
@@ -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:
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/IndexedDbPreviousHashStore.ts"],"sourcesContent":["export * from './IndexedDbPreviousHashStore'\n","import { Address, Hash } from '@xylabs/hex'\nimport { 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: Address): Promise<Hash | null> {\n const value = (await (await this.db).get(this.storeName, address)) as Hash\n return value ?? null\n }\n async removeItem(address: Address): Promise<void> {\n await (await this.db).delete(this.storeName, address)\n }\n async setItem(address: Address, previousHash: string): Promise<void> {\n await (await this.db).put(this.storeName, previousHash, address)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;ACEA,iBAA+C;AASxC,IAAMA,8BAAN,MAAMA,4BAAAA;EAEMC;EAEjBC,cAAc;AACZ,SAAKD,SAAKE,mBAAkC,KAAKC,QAAQJ,4BAA2BK,sBAAsB;MACxGC,SAAS,CAACL,OAAOA,GAAGM,kBAAkB,KAAKC,SAAS;IACtD,CAAA;EACF;;;;EAKA,IAAIJ,SAAS;AACX,WAAO;EACT;;;;EAKA,IAAII,YAAY;AACd,WAAO;EACT;EAEA,MAAMC,QAAQC,SAAwC;AACpD,UAAMC,QAAS,OAAO,MAAM,KAAKV,IAAIW,IAAI,KAAKJ,WAAWE,OAAAA;AACzD,WAAOC,SAAS;EAClB;EACA,MAAME,WAAWH,SAAiC;AAChD,WAAO,MAAM,KAAKT,IAAIa,OAAO,KAAKN,WAAWE,OAAAA;EAC/C;EACA,MAAMK,QAAQL,SAAkBM,cAAqC;AACnE,WAAO,MAAM,KAAKf,IAAIgB,IAAI,KAAKT,WAAWQ,cAAcN,OAAAA;EAC1D;AACF;AAlCaV;AACX,cADWA,6BACKK,wBAAuB;AADlC,IAAML,6BAAN;","names":["IndexedDbPreviousHashStore","db","constructor","openDB","dbName","CurrentSchemaVersion","upgrade","createObjectStore","storeName","getItem","address","value","get","removeItem","delete","setItem","previousHash","put"]}
|
package/dist/node/index.js.map
CHANGED
|
@@ -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:
|
|
1
|
+
{"version":3,"sources":["../../src/IndexedDbPreviousHashStore.ts"],"sourcesContent":["import { Address, Hash } from '@xylabs/hex'\nimport { 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: Address): Promise<Hash | null> {\n const value = (await (await this.db).get(this.storeName, address)) as Hash\n return value ?? null\n }\n async removeItem(address: Address): Promise<void> {\n await (await this.db).delete(this.storeName, address)\n }\n async setItem(address: Address, previousHash: string): Promise<void> {\n await (await this.db).put(this.storeName, previousHash, address)\n }\n}\n"],"mappings":";;;;;;;;;AAEA,SAAiCA,cAAc;AASxC,IAAMC,8BAAN,MAAMA,4BAAAA;EAEMC;EAEjBC,cAAc;AACZ,SAAKD,KAAKE,OAAkC,KAAKC,QAAQJ,4BAA2BK,sBAAsB;MACxGC,SAAS,CAACL,OAAOA,GAAGM,kBAAkB,KAAKC,SAAS;IACtD,CAAA;EACF;;;;EAKA,IAAIJ,SAAS;AACX,WAAO;EACT;;;;EAKA,IAAII,YAAY;AACd,WAAO;EACT;EAEA,MAAMC,QAAQC,SAAwC;AACpD,UAAMC,QAAS,OAAO,MAAM,KAAKV,IAAIW,IAAI,KAAKJ,WAAWE,OAAAA;AACzD,WAAOC,SAAS;EAClB;EACA,MAAME,WAAWH,SAAiC;AAChD,WAAO,MAAM,KAAKT,IAAIa,OAAO,KAAKN,WAAWE,OAAAA;EAC/C;EACA,MAAMK,QAAQL,SAAkBM,cAAqC;AACnE,WAAO,MAAM,KAAKf,IAAIgB,IAAI,KAAKT,WAAWQ,cAAcN,OAAAA;EAC1D;AACF;AAlCaV;AACX,cADWA,6BACKK,wBAAuB;AADlC,IAAML,6BAAN;","names":["openDB","IndexedDbPreviousHashStore","db","constructor","openDB","dbName","CurrentSchemaVersion","upgrade","createObjectStore","storeName","getItem","address","value","get","removeItem","delete","setItem","previousHash","put"]}
|
package/package.json
CHANGED
|
@@ -11,13 +11,14 @@
|
|
|
11
11
|
},
|
|
12
12
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@
|
|
14
|
+
"@xylabs/hex": "^3.0.2",
|
|
15
|
+
"@xyo-network/previous-hash-store-model": "~2.91.1",
|
|
15
16
|
"idb": "^8.0.0"
|
|
16
17
|
},
|
|
17
18
|
"devDependencies": {
|
|
18
19
|
"@types/uuid": "9.0.8",
|
|
19
|
-
"@xylabs/ts-scripts-yarn3": "^3.
|
|
20
|
-
"@xylabs/tsconfig": "^3.
|
|
20
|
+
"@xylabs/ts-scripts-yarn3": "^3.4.1",
|
|
21
|
+
"@xylabs/tsconfig": "^3.4.1",
|
|
21
22
|
"fake-indexeddb": "^5.0.2",
|
|
22
23
|
"typescript": "^5.3.3",
|
|
23
24
|
"uuid": "^9.0.1"
|
|
@@ -60,6 +61,6 @@
|
|
|
60
61
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
|
|
61
62
|
},
|
|
62
63
|
"sideEffects": false,
|
|
63
|
-
"version": "2.
|
|
64
|
+
"version": "2.91.1",
|
|
64
65
|
"type": "module"
|
|
65
66
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Address, Hash } from '@xylabs/hex'
|
|
1
2
|
import { PreviousHashStore } from '@xyo-network/previous-hash-store-model'
|
|
2
3
|
import { DBSchema, IDBPDatabase, openDB } from 'idb'
|
|
3
4
|
|
|
@@ -32,14 +33,14 @@ export class IndexedDbPreviousHashStore implements PreviousHashStore {
|
|
|
32
33
|
return 'previous-hash' as const
|
|
33
34
|
}
|
|
34
35
|
|
|
35
|
-
async getItem(address:
|
|
36
|
-
const value = await (await this.db).get(this.storeName, address)
|
|
36
|
+
async getItem(address: Address): Promise<Hash | null> {
|
|
37
|
+
const value = (await (await this.db).get(this.storeName, address)) as Hash
|
|
37
38
|
return value ?? null
|
|
38
39
|
}
|
|
39
|
-
async removeItem(address:
|
|
40
|
+
async removeItem(address: Address): Promise<void> {
|
|
40
41
|
await (await this.db).delete(this.storeName, address)
|
|
41
42
|
}
|
|
42
|
-
async setItem(address:
|
|
43
|
+
async setItem(address: Address, previousHash: string): Promise<void> {
|
|
43
44
|
await (await this.db).put(this.storeName, previousHash, address)
|
|
44
45
|
}
|
|
45
46
|
}
|