@xyo-network/previous-hash-store-storage 5.2.18 → 5.2.19
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/StoragePreviousHashStore.d.ts +1 -1
- package/dist/browser/StoragePreviousHashStore.d.ts.map +1 -1
- package/dist/browser/index.mjs.map +1 -1
- package/dist/neutral/StoragePreviousHashStore.d.ts +1 -1
- package/dist/neutral/StoragePreviousHashStore.d.ts.map +1 -1
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/node/StoragePreviousHashStore.d.ts +1 -1
- package/dist/node/StoragePreviousHashStore.d.ts.map +1 -1
- package/dist/node/index.mjs.map +1 -1
- package/package.json +7 -7
- package/src/StoragePreviousHashStore.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Address, Hash } from '@xylabs/
|
|
1
|
+
import type { Address, Hash } from '@xylabs/sdk-js';
|
|
2
2
|
import type { PreviousHashStore } from '@xyo-network/previous-hash-store-model';
|
|
3
3
|
export type Storage = 'local' | 'session' | 'page';
|
|
4
4
|
export type StoragePreviousHashOpts = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StoragePreviousHashStore.d.ts","sourceRoot":"","sources":["../../src/StoragePreviousHashStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"StoragePreviousHashStore.d.ts","sourceRoot":"","sources":["../../src/StoragePreviousHashStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAI/E,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAA;AAElD,MAAM,MAAM,uBAAuB,GAAG;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAA;AAED,qBAAa,wBAAyB,YAAW,iBAAiB;IAChE,MAAM,CAAC,QAAQ,CAAC,gBAAgB,6BAA4B;IAC5D,MAAM,CAAC,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAU;IACrD,OAAO,CAAC,UAAU,CAA4C;IAC9D,OAAO,CAAC,QAAQ,CAAuB;IACvC,OAAO,CAAC,KAAK,CAAuD;gBAExD,IAAI,CAAC,EAAE,uBAAuB;IAO1C,IAAI,SAAS,WAEZ;IAED,IAAI,IAAI,IAAI,OAAO,CAElB;IAED,OAAO,KAAK,OAAO,GAIlB;IAEK,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAK/C,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3C,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;CAGnE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/StoragePreviousHashStore.ts"],"sourcesContent":["import type { Address, Hash } from '@xylabs/
|
|
1
|
+
{"version":3,"sources":["../../src/StoragePreviousHashStore.ts"],"sourcesContent":["import type { Address, Hash } from '@xylabs/sdk-js'\nimport type { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\nimport type { StoreBase } from 'store2'\nimport store 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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this._storage = (store as any)[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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (!this?._storage) this._storage = (store as any)[this.type].namespace(this.namespace) as StoreBase\n return this._storage\n }\n\n async getItem(address: Address): Promise<Hash | null> {\n const value = await this.storage.get(address)\n return value ?? null\n }\n\n async removeItem(address: Address): Promise<void> {\n await this.storage.remove(address)\n }\n\n async setItem(address: Address, previousHash: Hash): Promise<void> {\n await this.storage.set(address, previousHash)\n }\n}\n"],"mappings":";AAGA,OAAO,WAAW;AASX,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,UAAW,MAAK,aAAa,KAAK;AAC5C,QAAI,MAAM,KAAM,MAAK,QAAQ,KAAK;AAElC,SAAK,WAAY,MAAc,KAAK,IAAI,EAAE,UAAU,KAAK,SAAS;AAAA,EACpE;AAAA,EAEA,IAAI,YAAY;AACd,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAI,OAAgB;AAClB,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAY,UAAqB;AAE/B,QAAI,CAAC,MAAM,SAAU,MAAK,WAAY,MAAc,KAAK,IAAI,EAAE,UAAU,KAAK,SAAS;AACvF,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,MAAM,QAAQ,SAAwC;AACpD,UAAM,QAAQ,MAAM,KAAK,QAAQ,IAAI,OAAO;AAC5C,WAAO,SAAS;AAAA,EAClB;AAAA,EAEA,MAAM,WAAW,SAAiC;AAChD,UAAM,KAAK,QAAQ,OAAO,OAAO;AAAA,EACnC;AAAA,EAEA,MAAM,QAAQ,SAAkB,cAAmC;AACjE,UAAM,KAAK,QAAQ,IAAI,SAAS,YAAY;AAAA,EAC9C;AACF;","names":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Address, Hash } from '@xylabs/
|
|
1
|
+
import type { Address, Hash } from '@xylabs/sdk-js';
|
|
2
2
|
import type { PreviousHashStore } from '@xyo-network/previous-hash-store-model';
|
|
3
3
|
export type Storage = 'local' | 'session' | 'page';
|
|
4
4
|
export type StoragePreviousHashOpts = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StoragePreviousHashStore.d.ts","sourceRoot":"","sources":["../../src/StoragePreviousHashStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"StoragePreviousHashStore.d.ts","sourceRoot":"","sources":["../../src/StoragePreviousHashStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAI/E,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAA;AAElD,MAAM,MAAM,uBAAuB,GAAG;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAA;AAED,qBAAa,wBAAyB,YAAW,iBAAiB;IAChE,MAAM,CAAC,QAAQ,CAAC,gBAAgB,6BAA4B;IAC5D,MAAM,CAAC,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAU;IACrD,OAAO,CAAC,UAAU,CAA4C;IAC9D,OAAO,CAAC,QAAQ,CAAuB;IACvC,OAAO,CAAC,KAAK,CAAuD;gBAExD,IAAI,CAAC,EAAE,uBAAuB;IAO1C,IAAI,SAAS,WAEZ;IAED,IAAI,IAAI,IAAI,OAAO,CAElB;IAED,OAAO,KAAK,OAAO,GAIlB;IAEK,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAK/C,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3C,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;CAGnE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/StoragePreviousHashStore.ts"],"sourcesContent":["import type { Address, Hash } from '@xylabs/
|
|
1
|
+
{"version":3,"sources":["../../src/StoragePreviousHashStore.ts"],"sourcesContent":["import type { Address, Hash } from '@xylabs/sdk-js'\nimport type { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\nimport type { StoreBase } from 'store2'\nimport store 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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this._storage = (store as any)[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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (!this?._storage) this._storage = (store as any)[this.type].namespace(this.namespace) as StoreBase\n return this._storage\n }\n\n async getItem(address: Address): Promise<Hash | null> {\n const value = await this.storage.get(address)\n return value ?? null\n }\n\n async removeItem(address: Address): Promise<void> {\n await this.storage.remove(address)\n }\n\n async setItem(address: Address, previousHash: Hash): Promise<void> {\n await this.storage.set(address, previousHash)\n }\n}\n"],"mappings":";AAGA,OAAO,WAAW;AASX,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,UAAW,MAAK,aAAa,KAAK;AAC5C,QAAI,MAAM,KAAM,MAAK,QAAQ,KAAK;AAElC,SAAK,WAAY,MAAc,KAAK,IAAI,EAAE,UAAU,KAAK,SAAS;AAAA,EACpE;AAAA,EAEA,IAAI,YAAY;AACd,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAI,OAAgB;AAClB,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAY,UAAqB;AAE/B,QAAI,CAAC,MAAM,SAAU,MAAK,WAAY,MAAc,KAAK,IAAI,EAAE,UAAU,KAAK,SAAS;AACvF,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,MAAM,QAAQ,SAAwC;AACpD,UAAM,QAAQ,MAAM,KAAK,QAAQ,IAAI,OAAO;AAC5C,WAAO,SAAS;AAAA,EAClB;AAAA,EAEA,MAAM,WAAW,SAAiC;AAChD,UAAM,KAAK,QAAQ,OAAO,OAAO;AAAA,EACnC;AAAA,EAEA,MAAM,QAAQ,SAAkB,cAAmC;AACjE,UAAM,KAAK,QAAQ,IAAI,SAAS,YAAY;AAAA,EAC9C;AACF;","names":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Address, Hash } from '@xylabs/
|
|
1
|
+
import type { Address, Hash } from '@xylabs/sdk-js';
|
|
2
2
|
import type { PreviousHashStore } from '@xyo-network/previous-hash-store-model';
|
|
3
3
|
export type Storage = 'local' | 'session' | 'page';
|
|
4
4
|
export type StoragePreviousHashOpts = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StoragePreviousHashStore.d.ts","sourceRoot":"","sources":["../../src/StoragePreviousHashStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"StoragePreviousHashStore.d.ts","sourceRoot":"","sources":["../../src/StoragePreviousHashStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAI/E,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAA;AAElD,MAAM,MAAM,uBAAuB,GAAG;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAA;AAED,qBAAa,wBAAyB,YAAW,iBAAiB;IAChE,MAAM,CAAC,QAAQ,CAAC,gBAAgB,6BAA4B;IAC5D,MAAM,CAAC,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAU;IACrD,OAAO,CAAC,UAAU,CAA4C;IAC9D,OAAO,CAAC,QAAQ,CAAuB;IACvC,OAAO,CAAC,KAAK,CAAuD;gBAExD,IAAI,CAAC,EAAE,uBAAuB;IAO1C,IAAI,SAAS,WAEZ;IAED,IAAI,IAAI,IAAI,OAAO,CAElB;IAED,OAAO,KAAK,OAAO,GAIlB;IAEK,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAK/C,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3C,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;CAGnE"}
|
package/dist/node/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/StoragePreviousHashStore.ts"],"sourcesContent":["import type { Address, Hash } from '@xylabs/
|
|
1
|
+
{"version":3,"sources":["../../src/StoragePreviousHashStore.ts"],"sourcesContent":["import type { Address, Hash } from '@xylabs/sdk-js'\nimport type { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\nimport type { StoreBase } from 'store2'\nimport store 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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this._storage = (store as any)[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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (!this?._storage) this._storage = (store as any)[this.type].namespace(this.namespace) as StoreBase\n return this._storage\n }\n\n async getItem(address: Address): Promise<Hash | null> {\n const value = await this.storage.get(address)\n return value ?? null\n }\n\n async removeItem(address: Address): Promise<void> {\n await this.storage.remove(address)\n }\n\n async setItem(address: Address, previousHash: Hash): Promise<void> {\n await this.storage.set(address, previousHash)\n }\n}\n"],"mappings":";AAGA,OAAO,WAAW;AASX,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,UAAW,MAAK,aAAa,KAAK;AAC5C,QAAI,MAAM,KAAM,MAAK,QAAQ,KAAK;AAElC,SAAK,WAAY,MAAc,KAAK,IAAI,EAAE,UAAU,KAAK,SAAS;AAAA,EACpE;AAAA,EAEA,IAAI,YAAY;AACd,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAI,OAAgB;AAClB,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAY,UAAqB;AAE/B,QAAI,CAAC,MAAM,SAAU,MAAK,WAAY,MAAc,KAAK,IAAI,EAAE,UAAU,KAAK,SAAS;AACvF,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,MAAM,QAAQ,SAAwC;AACpD,UAAM,QAAQ,MAAM,KAAK,QAAQ,IAAI,OAAO;AAC5C,WAAO,SAAS;AAAA,EAClB;AAAA,EAEA,MAAM,WAAW,SAAiC;AAChD,UAAM,KAAK,QAAQ,OAAO,OAAO;AAAA,EACnC;AAAA,EAEA,MAAM,QAAQ,SAAkB,cAAmC;AACjE,UAAM,KAAK,QAAQ,IAAI,SAAS,YAAY;AAAA,EAC9C;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/previous-hash-store-storage",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.19",
|
|
4
4
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -36,18 +36,18 @@
|
|
|
36
36
|
"!**/*.test.*"
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@xylabs/
|
|
40
|
-
"@xyo-network/previous-hash-store-model": "~5.2.
|
|
39
|
+
"@xylabs/sdk-js": "~5.0.61",
|
|
40
|
+
"@xyo-network/previous-hash-store-model": "~5.2.19",
|
|
41
41
|
"store2": "~2.14.4"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@types/node": "~
|
|
44
|
+
"@types/node": "~25.0.3",
|
|
45
45
|
"@types/uuid": "~11.0.0",
|
|
46
|
-
"@xylabs/ts-scripts-yarn3": "~7.2.
|
|
47
|
-
"@xylabs/tsconfig": "~7.2.
|
|
46
|
+
"@xylabs/ts-scripts-yarn3": "~7.2.32",
|
|
47
|
+
"@xylabs/tsconfig": "~7.2.32",
|
|
48
48
|
"typescript": "~5.9.3",
|
|
49
49
|
"uuid": "~13.0.0",
|
|
50
|
-
"vitest": "~4.0.
|
|
50
|
+
"vitest": "~4.0.16"
|
|
51
51
|
},
|
|
52
52
|
"publishConfig": {
|
|
53
53
|
"access": "public"
|