@xyo-network/previous-hash-store-storage 2.84.19 → 2.85.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.
@@ -5,6 +5,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
8
9
  var __export = (target, all) => {
9
10
  for (var name in all)
10
11
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -37,6 +38,9 @@ module.exports = __toCommonJS(src_exports);
37
38
  // src/StoragePreviousHashStore.ts
38
39
  var import_store2 = __toESM(require("store2"), 1);
39
40
  var StoragePreviousHashStore = class _StoragePreviousHashStore {
41
+ static {
42
+ __name(this, "StoragePreviousHashStore");
43
+ }
40
44
  static DefaultNamespace = "xyo-previous-hash-store";
41
45
  static DefaultStorageType = "local";
42
46
  _namespace = _StoragePreviousHashStore.DefaultNamespace;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts","../../src/StoragePreviousHashStore.ts"],"sourcesContent":["export * from './StoragePreviousHashStore'\n","import { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\nimport store, { StoreBase } from 'store2'\n\nexport type Storage = 'local' | 'session' | 'page'\n\nexport type StoragePreviousHashOpts = {\n namespace?: string\n type?: Storage\n}\n\nexport class StoragePreviousHashStore implements PreviousHashStore {\n static readonly DefaultNamespace = 'xyo-previous-hash-store'\n static readonly DefaultStorageType: Storage = 'local'\n private _namespace = StoragePreviousHashStore.DefaultNamespace\n private _storage: StoreBase | undefined\n private _type: Storage = StoragePreviousHashStore.DefaultStorageType\n\n constructor(opts?: StoragePreviousHashOpts) {\n if (opts?.namespace) this._namespace = opts.namespace\n if (opts?.type) this._type = opts.type\n this._storage = store[this.type].namespace(this.namespace)\n }\n\n get namespace() {\n return this._namespace\n }\n\n get type(): Storage {\n return this._type\n }\n\n private get storage(): StoreBase {\n if (!this?._storage) this._storage = store[this.type].namespace(this.namespace)\n return this._storage\n }\n\n async getItem(address: string): Promise<string | null> {\n const value = await this.storage.get(address)\n return value ?? null\n }\n async removeItem(address: string): Promise<void> {\n await this.storage.remove(address)\n }\n async setItem(address: string, previousHash: string): Promise<void> {\n await this.storage.set(address, previousHash)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,oBAAiC;AAS1B,IAAM,2BAAN,MAAM,0BAAsD;AAAA,EACjE,OAAgB,mBAAmB;AAAA,EACnC,OAAgB,qBAA8B;AAAA,EACtC,aAAa,0BAAyB;AAAA,EACtC;AAAA,EACA,QAAiB,0BAAyB;AAAA,EAElD,YAAY,MAAgC;AAC1C,QAAI,MAAM;AAAW,WAAK,aAAa,KAAK;AAC5C,QAAI,MAAM;AAAM,WAAK,QAAQ,KAAK;AAClC,SAAK,WAAW,cAAAA,QAAM,KAAK,IAAI,EAAE,UAAU,KAAK,SAAS;AAAA,EAC3D;AAAA,EAEA,IAAI,YAAY;AACd,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAI,OAAgB;AAClB,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAY,UAAqB;AAC/B,QAAI,CAAC,MAAM;AAAU,WAAK,WAAW,cAAAA,QAAM,KAAK,IAAI,EAAE,UAAU,KAAK,SAAS;AAC9E,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,MAAM,QAAQ,SAAyC;AACrD,UAAM,QAAQ,MAAM,KAAK,QAAQ,IAAI,OAAO;AAC5C,WAAO,SAAS;AAAA,EAClB;AAAA,EACA,MAAM,WAAW,SAAgC;AAC/C,UAAM,KAAK,QAAQ,OAAO,OAAO;AAAA,EACnC;AAAA,EACA,MAAM,QAAQ,SAAiB,cAAqC;AAClE,UAAM,KAAK,QAAQ,IAAI,SAAS,YAAY;AAAA,EAC9C;AACF;","names":["store"]}
1
+ {"version":3,"sources":["../../src/index.ts","../../src/StoragePreviousHashStore.ts"],"sourcesContent":["export * from './StoragePreviousHashStore'\n","import { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\nimport store, { StoreBase } from 'store2'\n\nexport type Storage = 'local' | 'session' | 'page'\n\nexport type StoragePreviousHashOpts = {\n namespace?: string\n type?: Storage\n}\n\nexport class StoragePreviousHashStore implements PreviousHashStore {\n static readonly DefaultNamespace = 'xyo-previous-hash-store'\n static readonly DefaultStorageType: Storage = 'local'\n private _namespace = StoragePreviousHashStore.DefaultNamespace\n private _storage: StoreBase | undefined\n private _type: Storage = StoragePreviousHashStore.DefaultStorageType\n\n constructor(opts?: StoragePreviousHashOpts) {\n if (opts?.namespace) this._namespace = opts.namespace\n if (opts?.type) this._type = opts.type\n this._storage = store[this.type].namespace(this.namespace)\n }\n\n get namespace() {\n return this._namespace\n }\n\n get type(): Storage {\n return this._type\n }\n\n private get storage(): StoreBase {\n if (!this?._storage) this._storage = store[this.type].namespace(this.namespace)\n return this._storage\n }\n\n async getItem(address: string): Promise<string | null> {\n const value = await this.storage.get(address)\n return value ?? null\n }\n async removeItem(address: string): Promise<void> {\n await this.storage.remove(address)\n }\n async setItem(address: string, previousHash: string): Promise<void> {\n await this.storage.set(address, previousHash)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;ACCA,oBAAiC;AAS1B,IAAMA,2BAAN,MAAMA,0BAAAA;EATb,OASaA;;;EACX,OAAgBC,mBAAmB;EACnC,OAAgBC,qBAA8B;EACtCC,aAAaH,0BAAyBC;EACtCG;EACAC,QAAiBL,0BAAyBE;EAElDI,YAAYC,MAAgC;AAC1C,QAAIA,MAAMC;AAAW,WAAKL,aAAaI,KAAKC;AAC5C,QAAID,MAAME;AAAM,WAAKJ,QAAQE,KAAKE;AAClC,SAAKL,WAAWM,cAAAA,QAAM,KAAKD,IAAI,EAAED,UAAU,KAAKA,SAAS;EAC3D;EAEA,IAAIA,YAAY;AACd,WAAO,KAAKL;EACd;EAEA,IAAIM,OAAgB;AAClB,WAAO,KAAKJ;EACd;EAEA,IAAYM,UAAqB;AAC/B,QAAI,CAAC,MAAMP;AAAU,WAAKA,WAAWM,cAAAA,QAAM,KAAKD,IAAI,EAAED,UAAU,KAAKA,SAAS;AAC9E,WAAO,KAAKJ;EACd;EAEA,MAAMQ,QAAQC,SAAyC;AACrD,UAAMC,QAAQ,MAAM,KAAKH,QAAQI,IAAIF,OAAAA;AACrC,WAAOC,SAAS;EAClB;EACA,MAAME,WAAWH,SAAgC;AAC/C,UAAM,KAAKF,QAAQM,OAAOJ,OAAAA;EAC5B;EACA,MAAMK,QAAQL,SAAiBM,cAAqC;AAClE,UAAM,KAAKR,QAAQS,IAAIP,SAASM,YAAAA;EAClC;AACF;","names":["StoragePreviousHashStore","DefaultNamespace","DefaultStorageType","_namespace","_storage","_type","constructor","opts","namespace","type","store","storage","getItem","address","value","get","removeItem","remove","setItem","previousHash","set"]}
@@ -1,6 +1,12 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+
1
4
  // src/StoragePreviousHashStore.ts
2
5
  import store from "store2";
3
6
  var StoragePreviousHashStore = class _StoragePreviousHashStore {
7
+ static {
8
+ __name(this, "StoragePreviousHashStore");
9
+ }
4
10
  static DefaultNamespace = "xyo-previous-hash-store";
5
11
  static DefaultStorageType = "local";
6
12
  _namespace = _StoragePreviousHashStore.DefaultNamespace;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/StoragePreviousHashStore.ts"],"sourcesContent":["import { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\nimport store, { StoreBase } from 'store2'\n\nexport type Storage = 'local' | 'session' | 'page'\n\nexport type StoragePreviousHashOpts = {\n namespace?: string\n type?: Storage\n}\n\nexport class StoragePreviousHashStore implements PreviousHashStore {\n static readonly DefaultNamespace = 'xyo-previous-hash-store'\n static readonly DefaultStorageType: Storage = 'local'\n private _namespace = StoragePreviousHashStore.DefaultNamespace\n private _storage: StoreBase | undefined\n private _type: Storage = StoragePreviousHashStore.DefaultStorageType\n\n constructor(opts?: StoragePreviousHashOpts) {\n if (opts?.namespace) this._namespace = opts.namespace\n if (opts?.type) this._type = opts.type\n this._storage = store[this.type].namespace(this.namespace)\n }\n\n get namespace() {\n return this._namespace\n }\n\n get type(): Storage {\n return this._type\n }\n\n private get storage(): StoreBase {\n if (!this?._storage) this._storage = store[this.type].namespace(this.namespace)\n return this._storage\n }\n\n async getItem(address: string): Promise<string | null> {\n const value = await this.storage.get(address)\n return value ?? null\n }\n async removeItem(address: string): Promise<void> {\n await this.storage.remove(address)\n }\n async setItem(address: string, previousHash: string): Promise<void> {\n await this.storage.set(address, previousHash)\n }\n}\n"],"mappings":";AACA,OAAO,WAA0B;AAS1B,IAAM,2BAAN,MAAM,0BAAsD;AAAA,EACjE,OAAgB,mBAAmB;AAAA,EACnC,OAAgB,qBAA8B;AAAA,EACtC,aAAa,0BAAyB;AAAA,EACtC;AAAA,EACA,QAAiB,0BAAyB;AAAA,EAElD,YAAY,MAAgC;AAC1C,QAAI,MAAM;AAAW,WAAK,aAAa,KAAK;AAC5C,QAAI,MAAM;AAAM,WAAK,QAAQ,KAAK;AAClC,SAAK,WAAW,MAAM,KAAK,IAAI,EAAE,UAAU,KAAK,SAAS;AAAA,EAC3D;AAAA,EAEA,IAAI,YAAY;AACd,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAI,OAAgB;AAClB,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAY,UAAqB;AAC/B,QAAI,CAAC,MAAM;AAAU,WAAK,WAAW,MAAM,KAAK,IAAI,EAAE,UAAU,KAAK,SAAS;AAC9E,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,MAAM,QAAQ,SAAyC;AACrD,UAAM,QAAQ,MAAM,KAAK,QAAQ,IAAI,OAAO;AAC5C,WAAO,SAAS;AAAA,EAClB;AAAA,EACA,MAAM,WAAW,SAAgC;AAC/C,UAAM,KAAK,QAAQ,OAAO,OAAO;AAAA,EACnC;AAAA,EACA,MAAM,QAAQ,SAAiB,cAAqC;AAClE,UAAM,KAAK,QAAQ,IAAI,SAAS,YAAY;AAAA,EAC9C;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/StoragePreviousHashStore.ts"],"sourcesContent":["import { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\nimport store, { StoreBase } from 'store2'\n\nexport type Storage = 'local' | 'session' | 'page'\n\nexport type StoragePreviousHashOpts = {\n namespace?: string\n type?: Storage\n}\n\nexport class StoragePreviousHashStore implements PreviousHashStore {\n static readonly DefaultNamespace = 'xyo-previous-hash-store'\n static readonly DefaultStorageType: Storage = 'local'\n private _namespace = StoragePreviousHashStore.DefaultNamespace\n private _storage: StoreBase | undefined\n private _type: Storage = StoragePreviousHashStore.DefaultStorageType\n\n constructor(opts?: StoragePreviousHashOpts) {\n if (opts?.namespace) this._namespace = opts.namespace\n if (opts?.type) this._type = opts.type\n this._storage = store[this.type].namespace(this.namespace)\n }\n\n get namespace() {\n return this._namespace\n }\n\n get type(): Storage {\n return this._type\n }\n\n private get storage(): StoreBase {\n if (!this?._storage) this._storage = store[this.type].namespace(this.namespace)\n return this._storage\n }\n\n async getItem(address: string): Promise<string | null> {\n const value = await this.storage.get(address)\n return value ?? null\n }\n async removeItem(address: string): Promise<void> {\n await this.storage.remove(address)\n }\n async setItem(address: string, previousHash: string): Promise<void> {\n await this.storage.set(address, previousHash)\n }\n}\n"],"mappings":";;;;AACA,OAAOA,WAA0B;AAS1B,IAAMC,2BAAN,MAAMA,0BAAAA;EATb,OASaA;;;EACX,OAAgBC,mBAAmB;EACnC,OAAgBC,qBAA8B;EACtCC,aAAaH,0BAAyBC;EACtCG;EACAC,QAAiBL,0BAAyBE;EAElDI,YAAYC,MAAgC;AAC1C,QAAIA,MAAMC;AAAW,WAAKL,aAAaI,KAAKC;AAC5C,QAAID,MAAME;AAAM,WAAKJ,QAAQE,KAAKE;AAClC,SAAKL,WAAWM,MAAM,KAAKD,IAAI,EAAED,UAAU,KAAKA,SAAS;EAC3D;EAEA,IAAIA,YAAY;AACd,WAAO,KAAKL;EACd;EAEA,IAAIM,OAAgB;AAClB,WAAO,KAAKJ;EACd;EAEA,IAAYM,UAAqB;AAC/B,QAAI,CAAC,MAAMP;AAAU,WAAKA,WAAWM,MAAM,KAAKD,IAAI,EAAED,UAAU,KAAKA,SAAS;AAC9E,WAAO,KAAKJ;EACd;EAEA,MAAMQ,QAAQC,SAAyC;AACrD,UAAMC,QAAQ,MAAM,KAAKH,QAAQI,IAAIF,OAAAA;AACrC,WAAOC,SAAS;EAClB;EACA,MAAME,WAAWH,SAAgC;AAC/C,UAAM,KAAKF,QAAQM,OAAOJ,OAAAA;EAC5B;EACA,MAAMK,QAAQL,SAAiBM,cAAqC;AAClE,UAAM,KAAKR,QAAQS,IAAIP,SAASM,YAAAA;EAClC;AACF;","names":["store","StoragePreviousHashStore","DefaultNamespace","DefaultStorageType","_namespace","_storage","_type","constructor","opts","namespace","type","store","storage","getItem","address","value","get","removeItem","remove","setItem","previousHash","set"]}
@@ -5,6 +5,8 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
8
10
  var __export = (target, all) => {
9
11
  for (var name in all)
10
12
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -26,6 +28,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
28
  mod
27
29
  ));
28
30
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
31
+ var __publicField = (obj, key, value) => {
32
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
33
+ return value;
34
+ };
29
35
 
30
36
  // src/index.ts
31
37
  var src_exports = {};
@@ -36,9 +42,7 @@ module.exports = __toCommonJS(src_exports);
36
42
 
37
43
  // src/StoragePreviousHashStore.ts
38
44
  var import_store2 = __toESM(require("store2"), 1);
39
- var StoragePreviousHashStore = class _StoragePreviousHashStore {
40
- static DefaultNamespace = "xyo-previous-hash-store";
41
- static DefaultStorageType = "local";
45
+ var _StoragePreviousHashStore = class _StoragePreviousHashStore {
42
46
  _namespace = _StoragePreviousHashStore.DefaultNamespace;
43
47
  _storage;
44
48
  _type = _StoragePreviousHashStore.DefaultStorageType;
@@ -71,6 +75,10 @@ var StoragePreviousHashStore = class _StoragePreviousHashStore {
71
75
  await this.storage.set(address, previousHash);
72
76
  }
73
77
  };
78
+ __name(_StoragePreviousHashStore, "StoragePreviousHashStore");
79
+ __publicField(_StoragePreviousHashStore, "DefaultNamespace", "xyo-previous-hash-store");
80
+ __publicField(_StoragePreviousHashStore, "DefaultStorageType", "local");
81
+ var StoragePreviousHashStore = _StoragePreviousHashStore;
74
82
  // Annotate the CommonJS export names for ESM import in node:
75
83
  0 && (module.exports = {
76
84
  StoragePreviousHashStore
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts","../../src/StoragePreviousHashStore.ts"],"sourcesContent":["export * from './StoragePreviousHashStore'\n","import { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\nimport store, { StoreBase } from 'store2'\n\nexport type Storage = 'local' | 'session' | 'page'\n\nexport type StoragePreviousHashOpts = {\n namespace?: string\n type?: Storage\n}\n\nexport class StoragePreviousHashStore implements PreviousHashStore {\n static readonly DefaultNamespace = 'xyo-previous-hash-store'\n static readonly DefaultStorageType: Storage = 'local'\n private _namespace = StoragePreviousHashStore.DefaultNamespace\n private _storage: StoreBase | undefined\n private _type: Storage = StoragePreviousHashStore.DefaultStorageType\n\n constructor(opts?: StoragePreviousHashOpts) {\n if (opts?.namespace) this._namespace = opts.namespace\n if (opts?.type) this._type = opts.type\n this._storage = store[this.type].namespace(this.namespace)\n }\n\n get namespace() {\n return this._namespace\n }\n\n get type(): Storage {\n return this._type\n }\n\n private get storage(): StoreBase {\n if (!this?._storage) this._storage = store[this.type].namespace(this.namespace)\n return this._storage\n }\n\n async getItem(address: string): Promise<string | null> {\n const value = await this.storage.get(address)\n return value ?? null\n }\n async removeItem(address: string): Promise<void> {\n await this.storage.remove(address)\n }\n async setItem(address: string, previousHash: string): Promise<void> {\n await this.storage.set(address, previousHash)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,oBAAiC;AAS1B,IAAM,2BAAN,MAAM,0BAAsD;AAAA,EACjE,OAAgB,mBAAmB;AAAA,EACnC,OAAgB,qBAA8B;AAAA,EACtC,aAAa,0BAAyB;AAAA,EACtC;AAAA,EACA,QAAiB,0BAAyB;AAAA,EAElD,YAAY,MAAgC;AAC1C,QAAI,6BAAM;AAAW,WAAK,aAAa,KAAK;AAC5C,QAAI,6BAAM;AAAM,WAAK,QAAQ,KAAK;AAClC,SAAK,WAAW,cAAAA,QAAM,KAAK,IAAI,EAAE,UAAU,KAAK,SAAS;AAAA,EAC3D;AAAA,EAEA,IAAI,YAAY;AACd,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAI,OAAgB;AAClB,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAY,UAAqB;AAC/B,QAAI,EAAC,6BAAM;AAAU,WAAK,WAAW,cAAAA,QAAM,KAAK,IAAI,EAAE,UAAU,KAAK,SAAS;AAC9E,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,MAAM,QAAQ,SAAyC;AACrD,UAAM,QAAQ,MAAM,KAAK,QAAQ,IAAI,OAAO;AAC5C,WAAO,SAAS;AAAA,EAClB;AAAA,EACA,MAAM,WAAW,SAAgC;AAC/C,UAAM,KAAK,QAAQ,OAAO,OAAO;AAAA,EACnC;AAAA,EACA,MAAM,QAAQ,SAAiB,cAAqC;AAClE,UAAM,KAAK,QAAQ,IAAI,SAAS,YAAY;AAAA,EAC9C;AACF;","names":["store"]}
1
+ {"version":3,"sources":["../../src/index.ts","../../src/StoragePreviousHashStore.ts"],"sourcesContent":["export * from './StoragePreviousHashStore'\n","import { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\nimport store, { StoreBase } from 'store2'\n\nexport type Storage = 'local' | 'session' | 'page'\n\nexport type StoragePreviousHashOpts = {\n namespace?: string\n type?: Storage\n}\n\nexport class StoragePreviousHashStore implements PreviousHashStore {\n static readonly DefaultNamespace = 'xyo-previous-hash-store'\n static readonly DefaultStorageType: Storage = 'local'\n private _namespace = StoragePreviousHashStore.DefaultNamespace\n private _storage: StoreBase | undefined\n private _type: Storage = StoragePreviousHashStore.DefaultStorageType\n\n constructor(opts?: StoragePreviousHashOpts) {\n if (opts?.namespace) this._namespace = opts.namespace\n if (opts?.type) this._type = opts.type\n this._storage = store[this.type].namespace(this.namespace)\n }\n\n get namespace() {\n return this._namespace\n }\n\n get type(): Storage {\n return this._type\n }\n\n private get storage(): StoreBase {\n if (!this?._storage) this._storage = store[this.type].namespace(this.namespace)\n return this._storage\n }\n\n async getItem(address: string): Promise<string | null> {\n const value = await this.storage.get(address)\n return value ?? null\n }\n async removeItem(address: string): Promise<void> {\n await this.storage.remove(address)\n }\n async setItem(address: string, previousHash: string): Promise<void> {\n await this.storage.set(address, previousHash)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;ACCA,oBAAiC;AAS1B,IAAMA,4BAAN,MAAMA,0BAAAA;EAGHC,aAAaD,0BAAyBE;EACtCC;EACAC,QAAiBJ,0BAAyBK;EAElDC,YAAYC,MAAgC;AAC1C,QAAIA,6BAAMC;AAAW,WAAKP,aAAaM,KAAKC;AAC5C,QAAID,6BAAME;AAAM,WAAKL,QAAQG,KAAKE;AAClC,SAAKN,WAAWO,cAAAA,QAAM,KAAKD,IAAI,EAAED,UAAU,KAAKA,SAAS;EAC3D;EAEA,IAAIA,YAAY;AACd,WAAO,KAAKP;EACd;EAEA,IAAIQ,OAAgB;AAClB,WAAO,KAAKL;EACd;EAEA,IAAYO,UAAqB;AAC/B,QAAI,EAAC,6BAAMR;AAAU,WAAKA,WAAWO,cAAAA,QAAM,KAAKD,IAAI,EAAED,UAAU,KAAKA,SAAS;AAC9E,WAAO,KAAKL;EACd;EAEA,MAAMS,QAAQC,SAAyC;AACrD,UAAMC,QAAQ,MAAM,KAAKH,QAAQI,IAAIF,OAAAA;AACrC,WAAOC,SAAS;EAClB;EACA,MAAME,WAAWH,SAAgC;AAC/C,UAAM,KAAKF,QAAQM,OAAOJ,OAAAA;EAC5B;EACA,MAAMK,QAAQL,SAAiBM,cAAqC;AAClE,UAAM,KAAKR,QAAQS,IAAIP,SAASM,YAAAA;EAClC;AACF;AApCanB;AACX,cADWA,2BACKE,oBAAmB;AACnC,cAFWF,2BAEKK,sBAA8B;AAFzC,IAAML,2BAAN;","names":["StoragePreviousHashStore","_namespace","DefaultNamespace","_storage","_type","DefaultStorageType","constructor","opts","namespace","type","store","storage","getItem","address","value","get","removeItem","remove","setItem","previousHash","set"]}
@@ -1,8 +1,14 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
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
+ };
8
+
1
9
  // src/StoragePreviousHashStore.ts
2
10
  import store from "store2";
3
- var StoragePreviousHashStore = class _StoragePreviousHashStore {
4
- static DefaultNamespace = "xyo-previous-hash-store";
5
- static DefaultStorageType = "local";
11
+ var _StoragePreviousHashStore = class _StoragePreviousHashStore {
6
12
  _namespace = _StoragePreviousHashStore.DefaultNamespace;
7
13
  _storage;
8
14
  _type = _StoragePreviousHashStore.DefaultStorageType;
@@ -35,6 +41,10 @@ var StoragePreviousHashStore = class _StoragePreviousHashStore {
35
41
  await this.storage.set(address, previousHash);
36
42
  }
37
43
  };
44
+ __name(_StoragePreviousHashStore, "StoragePreviousHashStore");
45
+ __publicField(_StoragePreviousHashStore, "DefaultNamespace", "xyo-previous-hash-store");
46
+ __publicField(_StoragePreviousHashStore, "DefaultStorageType", "local");
47
+ var StoragePreviousHashStore = _StoragePreviousHashStore;
38
48
  export {
39
49
  StoragePreviousHashStore
40
50
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/StoragePreviousHashStore.ts"],"sourcesContent":["import { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\nimport store, { StoreBase } from 'store2'\n\nexport type Storage = 'local' | 'session' | 'page'\n\nexport type StoragePreviousHashOpts = {\n namespace?: string\n type?: Storage\n}\n\nexport class StoragePreviousHashStore implements PreviousHashStore {\n static readonly DefaultNamespace = 'xyo-previous-hash-store'\n static readonly DefaultStorageType: Storage = 'local'\n private _namespace = StoragePreviousHashStore.DefaultNamespace\n private _storage: StoreBase | undefined\n private _type: Storage = StoragePreviousHashStore.DefaultStorageType\n\n constructor(opts?: StoragePreviousHashOpts) {\n if (opts?.namespace) this._namespace = opts.namespace\n if (opts?.type) this._type = opts.type\n this._storage = store[this.type].namespace(this.namespace)\n }\n\n get namespace() {\n return this._namespace\n }\n\n get type(): Storage {\n return this._type\n }\n\n private get storage(): StoreBase {\n if (!this?._storage) this._storage = store[this.type].namespace(this.namespace)\n return this._storage\n }\n\n async getItem(address: string): Promise<string | null> {\n const value = await this.storage.get(address)\n return value ?? null\n }\n async removeItem(address: string): Promise<void> {\n await this.storage.remove(address)\n }\n async setItem(address: string, previousHash: string): Promise<void> {\n await this.storage.set(address, previousHash)\n }\n}\n"],"mappings":";AACA,OAAO,WAA0B;AAS1B,IAAM,2BAAN,MAAM,0BAAsD;AAAA,EACjE,OAAgB,mBAAmB;AAAA,EACnC,OAAgB,qBAA8B;AAAA,EACtC,aAAa,0BAAyB;AAAA,EACtC;AAAA,EACA,QAAiB,0BAAyB;AAAA,EAElD,YAAY,MAAgC;AAC1C,QAAI,6BAAM;AAAW,WAAK,aAAa,KAAK;AAC5C,QAAI,6BAAM;AAAM,WAAK,QAAQ,KAAK;AAClC,SAAK,WAAW,MAAM,KAAK,IAAI,EAAE,UAAU,KAAK,SAAS;AAAA,EAC3D;AAAA,EAEA,IAAI,YAAY;AACd,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAI,OAAgB;AAClB,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAY,UAAqB;AAC/B,QAAI,EAAC,6BAAM;AAAU,WAAK,WAAW,MAAM,KAAK,IAAI,EAAE,UAAU,KAAK,SAAS;AAC9E,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,MAAM,QAAQ,SAAyC;AACrD,UAAM,QAAQ,MAAM,KAAK,QAAQ,IAAI,OAAO;AAC5C,WAAO,SAAS;AAAA,EAClB;AAAA,EACA,MAAM,WAAW,SAAgC;AAC/C,UAAM,KAAK,QAAQ,OAAO,OAAO;AAAA,EACnC;AAAA,EACA,MAAM,QAAQ,SAAiB,cAAqC;AAClE,UAAM,KAAK,QAAQ,IAAI,SAAS,YAAY;AAAA,EAC9C;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/StoragePreviousHashStore.ts"],"sourcesContent":["import { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\nimport store, { StoreBase } from 'store2'\n\nexport type Storage = 'local' | 'session' | 'page'\n\nexport type StoragePreviousHashOpts = {\n namespace?: string\n type?: Storage\n}\n\nexport class StoragePreviousHashStore implements PreviousHashStore {\n static readonly DefaultNamespace = 'xyo-previous-hash-store'\n static readonly DefaultStorageType: Storage = 'local'\n private _namespace = StoragePreviousHashStore.DefaultNamespace\n private _storage: StoreBase | undefined\n private _type: Storage = StoragePreviousHashStore.DefaultStorageType\n\n constructor(opts?: StoragePreviousHashOpts) {\n if (opts?.namespace) this._namespace = opts.namespace\n if (opts?.type) this._type = opts.type\n this._storage = store[this.type].namespace(this.namespace)\n }\n\n get namespace() {\n return this._namespace\n }\n\n get type(): Storage {\n return this._type\n }\n\n private get storage(): StoreBase {\n if (!this?._storage) this._storage = store[this.type].namespace(this.namespace)\n return this._storage\n }\n\n async getItem(address: string): Promise<string | null> {\n const value = await this.storage.get(address)\n return value ?? null\n }\n async removeItem(address: string): Promise<void> {\n await this.storage.remove(address)\n }\n async setItem(address: string, previousHash: string): Promise<void> {\n await this.storage.set(address, previousHash)\n }\n}\n"],"mappings":";;;;;;;;;AACA,OAAOA,WAA0B;AAS1B,IAAMC,4BAAN,MAAMA,0BAAAA;EAGHC,aAAaD,0BAAyBE;EACtCC;EACAC,QAAiBJ,0BAAyBK;EAElDC,YAAYC,MAAgC;AAC1C,QAAIA,6BAAMC;AAAW,WAAKP,aAAaM,KAAKC;AAC5C,QAAID,6BAAME;AAAM,WAAKL,QAAQG,KAAKE;AAClC,SAAKN,WAAWO,MAAM,KAAKD,IAAI,EAAED,UAAU,KAAKA,SAAS;EAC3D;EAEA,IAAIA,YAAY;AACd,WAAO,KAAKP;EACd;EAEA,IAAIQ,OAAgB;AAClB,WAAO,KAAKL;EACd;EAEA,IAAYO,UAAqB;AAC/B,QAAI,EAAC,6BAAMR;AAAU,WAAKA,WAAWO,MAAM,KAAKD,IAAI,EAAED,UAAU,KAAKA,SAAS;AAC9E,WAAO,KAAKL;EACd;EAEA,MAAMS,QAAQC,SAAyC;AACrD,UAAMC,QAAQ,MAAM,KAAKH,QAAQI,IAAIF,OAAAA;AACrC,WAAOC,SAAS;EAClB;EACA,MAAME,WAAWH,SAAgC;AAC/C,UAAM,KAAKF,QAAQM,OAAOJ,OAAAA;EAC5B;EACA,MAAMK,QAAQL,SAAiBM,cAAqC;AAClE,UAAM,KAAKR,QAAQS,IAAIP,SAASM,YAAAA;EAClC;AACF;AApCanB;AACX,cADWA,2BACKE,oBAAmB;AACnC,cAFWF,2BAEKK,sBAA8B;AAFzC,IAAML,2BAAN;","names":["store","StoragePreviousHashStore","_namespace","DefaultNamespace","_storage","_type","DefaultStorageType","constructor","opts","namespace","type","store","storage","getItem","address","value","get","removeItem","remove","setItem","previousHash","set"]}
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "description": "Primary SDK for using XYO Protocol 2.0",
13
13
  "dependencies": {
14
- "@xyo-network/previous-hash-store-model": "~2.84.19",
14
+ "@xyo-network/previous-hash-store-model": "~2.85.1",
15
15
  "store2": "^2.14.2"
16
16
  },
17
17
  "devDependencies": {
@@ -58,6 +58,6 @@
58
58
  },
59
59
  "sideEffects": false,
60
60
  "types": "dist/node/index.d.ts",
61
- "version": "2.84.19",
61
+ "version": "2.85.1",
62
62
  "type": "module"
63
63
  }