@xyo-network/previous-hash-store-indexeddb 2.104.0 → 2.105.0-rc.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.
@@ -35,7 +35,7 @@ var IndexedDbPreviousHashStore = class _IndexedDbPreviousHashStore {
35
35
  db;
36
36
  constructor() {
37
37
  this.db = (0, import_idb.openDB)(this.dbName, _IndexedDbPreviousHashStore.CurrentSchemaVersion, {
38
- upgrade: (db) => db.createObjectStore(this.storeName)
38
+ upgrade: /* @__PURE__ */ __name((db) => db.createObjectStore(this.storeName), "upgrade")
39
39
  });
40
40
  }
41
41
  /**
@@ -1 +1 @@
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
+ {"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,wBAACJ,OAAOA,GAAGK,kBAAkB,KAAKC,SAAS,GAA3C;IACX,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"]}
@@ -11,7 +11,7 @@ var IndexedDbPreviousHashStore = class _IndexedDbPreviousHashStore {
11
11
  db;
12
12
  constructor() {
13
13
  this.db = openDB(this.dbName, _IndexedDbPreviousHashStore.CurrentSchemaVersion, {
14
- upgrade: (db) => db.createObjectStore(this.storeName)
14
+ upgrade: /* @__PURE__ */ __name((db) => db.createObjectStore(this.storeName), "upgrade")
15
15
  });
16
16
  }
17
17
  /**
@@ -1 +1 @@
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
+ {"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,wBAACJ,OAAOA,GAAGK,kBAAkB,KAAKC,SAAS,GAA3C;IACX,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"]}
@@ -35,7 +35,7 @@ var IndexedDbPreviousHashStore = class _IndexedDbPreviousHashStore {
35
35
  db;
36
36
  constructor() {
37
37
  this.db = (0, import_idb.openDB)(this.dbName, _IndexedDbPreviousHashStore.CurrentSchemaVersion, {
38
- upgrade: (db) => db.createObjectStore(this.storeName)
38
+ upgrade: /* @__PURE__ */ __name((db) => db.createObjectStore(this.storeName), "upgrade")
39
39
  });
40
40
  }
41
41
  /**
@@ -1 +1 @@
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
+ {"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,wBAACJ,OAAOA,GAAGK,kBAAkB,KAAKC,SAAS,GAA3C;IACX,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"]}
@@ -11,7 +11,7 @@ var IndexedDbPreviousHashStore = class _IndexedDbPreviousHashStore {
11
11
  db;
12
12
  constructor() {
13
13
  this.db = openDB(this.dbName, _IndexedDbPreviousHashStore.CurrentSchemaVersion, {
14
- upgrade: (db) => db.createObjectStore(this.storeName)
14
+ upgrade: /* @__PURE__ */ __name((db) => db.createObjectStore(this.storeName), "upgrade")
15
15
  });
16
16
  }
17
17
  /**
@@ -1 +1 @@
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
+ {"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,wBAACJ,OAAOA,GAAGK,kBAAkB,KAAKC,SAAS,GAA3C;IACX,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"]}
@@ -18,10 +18,7 @@ var __copyProps = (to, from, except, desc) => {
18
18
  return to;
19
19
  };
20
20
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
- var __publicField = (obj, key, value) => {
22
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
23
- return value;
24
- };
21
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
25
22
 
26
23
  // src/index.ts
27
24
  var src_exports = {};
@@ -36,7 +33,7 @@ var _IndexedDbPreviousHashStore = class _IndexedDbPreviousHashStore {
36
33
  db;
37
34
  constructor() {
38
35
  this.db = (0, import_idb.openDB)(this.dbName, _IndexedDbPreviousHashStore.CurrentSchemaVersion, {
39
- upgrade: (db) => db.createObjectStore(this.storeName)
36
+ upgrade: /* @__PURE__ */ __name((db) => db.createObjectStore(this.storeName), "upgrade")
40
37
  });
41
38
  }
42
39
  /**
@@ -1 +1 @@
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"]}
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,wBAACL,OAAOA,GAAGM,kBAAkB,KAAKC,SAAS,GAA3C;IACX,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"]}
@@ -1,10 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
4
- var __publicField = (obj, key, value) => {
5
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
6
- return value;
7
- };
4
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
8
5
 
9
6
  // src/IndexedDbPreviousHashStore.ts
10
7
  import { openDB } from "idb";
@@ -12,7 +9,7 @@ var _IndexedDbPreviousHashStore = class _IndexedDbPreviousHashStore {
12
9
  db;
13
10
  constructor() {
14
11
  this.db = openDB(this.dbName, _IndexedDbPreviousHashStore.CurrentSchemaVersion, {
15
- upgrade: (db) => db.createObjectStore(this.storeName)
12
+ upgrade: /* @__PURE__ */ __name((db) => db.createObjectStore(this.storeName), "upgrade")
16
13
  });
17
14
  }
18
15
  /**
@@ -1 +1 @@
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"]}
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,wBAACL,OAAOA,GAAGM,kBAAkB,KAAKC,SAAS,GAA3C;IACX,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
@@ -12,13 +12,13 @@
12
12
  "description": "Primary SDK for using XYO Protocol 2.0",
13
13
  "dependencies": {
14
14
  "@xylabs/hex": "^3.5.1",
15
- "@xyo-network/previous-hash-store-model": "~2.104.0",
15
+ "@xyo-network/previous-hash-store-model": "~2.105.0-rc.1",
16
16
  "idb": "^8.0.0"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@types/uuid": "9.0.8",
20
- "@xylabs/ts-scripts-yarn3": "^3.10.4",
21
- "@xylabs/tsconfig": "^3.10.4",
20
+ "@xylabs/ts-scripts-yarn3": "^3.11.2",
21
+ "@xylabs/tsconfig": "^3.11.2",
22
22
  "fake-indexeddb": "^5.0.2",
23
23
  "typescript": "^5.4.5",
24
24
  "uuid": "^9.0.1"
@@ -61,6 +61,7 @@
61
61
  "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
62
62
  },
63
63
  "sideEffects": false,
64
- "version": "2.104.0",
65
- "type": "module"
64
+ "version": "2.105.0-rc.1",
65
+ "type": "module",
66
+ "stableVersion": "2.104.1"
66
67
  }