@xyo-network/previous-hash-store-storage 5.3.29 → 5.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -38,213 +38,6 @@ bun add {{name}}
38
38
 
39
39
  See the [LICENSE](LICENSE) file for license rights and limitations (LGPL-3.0-only).
40
40
 
41
- ## Reference
42
-
43
- ### packages
44
-
45
- ### protocol
46
-
47
- ### packages
48
-
49
- ### crypto
50
-
51
- ### packages
52
-
53
- ### previous-hash-store
54
-
55
- ### packages
56
-
57
- ### storage
58
-
59
- ### .temp-typedoc
60
-
61
- ### classes
62
-
63
- ### <a id="StoragePreviousHashStore"></a>StoragePreviousHashStore
64
-
65
- [**@xyo-network/previous-hash-store-storage**](#../README)
66
-
67
- ***
68
-
69
- ## Implements
70
-
71
- - `PreviousHashStore`
72
-
73
- ## Constructors
74
-
75
- ### Constructor
76
-
77
- ```ts
78
- new StoragePreviousHashStore(opts?): StoragePreviousHashStore;
79
- ```
80
-
81
- ### Parameters
82
-
83
- #### opts?
84
-
85
- [`StoragePreviousHashOpts`](#../type-aliases/StoragePreviousHashOpts)
86
-
87
- ### Returns
88
-
89
- `StoragePreviousHashStore`
90
-
91
- ## Properties
92
-
93
- ### DefaultNamespace
94
-
95
- ```ts
96
- readonly static DefaultNamespace: "xyo-previous-hash-store" = 'xyo-previous-hash-store';
97
- ```
98
-
99
- ***
100
-
101
- ### DefaultStorageType
102
-
103
- ```ts
104
- readonly static DefaultStorageType: Storage = 'local';
105
- ```
106
-
107
- ## Accessors
108
-
109
- ### namespace
110
-
111
- ### Get Signature
112
-
113
- ```ts
114
- get namespace(): string;
115
- ```
116
-
117
- #### Returns
118
-
119
- `string`
120
-
121
- ***
122
-
123
- ### type
124
-
125
- ### Get Signature
126
-
127
- ```ts
128
- get type(): Storage;
129
- ```
130
-
131
- #### Returns
132
-
133
- [`Storage`](#../type-aliases/Storage)
134
-
135
- ## Methods
136
-
137
- ### getItem()
138
-
139
- ```ts
140
- getItem(address): Promise<BrandedHash | null>;
141
- ```
142
-
143
- ### Parameters
144
-
145
- #### address
146
-
147
- `BrandedAddress`
148
-
149
- ### Returns
150
-
151
- `Promise`\<`BrandedHash` \| `null`\>
152
-
153
- ### Implementation of
154
-
155
- ```ts
156
- PreviousHashStore.getItem
157
- ```
158
-
159
- ***
160
-
161
- ### removeItem()
162
-
163
- ```ts
164
- removeItem(address): Promise<void>;
165
- ```
166
-
167
- ### Parameters
168
-
169
- #### address
170
-
171
- `BrandedAddress`
172
-
173
- ### Returns
174
-
175
- `Promise`\<`void`\>
176
-
177
- ### Implementation of
178
-
179
- ```ts
180
- PreviousHashStore.removeItem
181
- ```
182
-
183
- ***
184
-
185
- ### setItem()
186
-
187
- ```ts
188
- setItem(address, previousHash): Promise<void>;
189
- ```
190
-
191
- ### Parameters
192
-
193
- #### address
194
-
195
- `BrandedAddress`
196
-
197
- #### previousHash
198
-
199
- `BrandedHash`
200
-
201
- ### Returns
202
-
203
- `Promise`\<`void`\>
204
-
205
- ### Implementation of
206
-
207
- ```ts
208
- PreviousHashStore.setItem
209
- ```
210
-
211
- ### type-aliases
212
-
213
- ### <a id="Storage"></a>Storage
214
-
215
- [**@xyo-network/previous-hash-store-storage**](#../README)
216
-
217
- ***
218
-
219
- ```ts
220
- type Storage = "local" | "session" | "page";
221
- ```
222
-
223
- ### <a id="StoragePreviousHashOpts"></a>StoragePreviousHashOpts
224
-
225
- [**@xyo-network/previous-hash-store-storage**](#../README)
226
-
227
- ***
228
-
229
- ```ts
230
- type StoragePreviousHashOpts = object;
231
- ```
232
-
233
- ## Properties
234
-
235
- ### namespace?
236
-
237
- ```ts
238
- optional namespace?: string;
239
- ```
240
-
241
- ***
242
-
243
- ### type?
244
-
245
- ```ts
246
- optional type?: Storage;
247
- ```
248
41
 
249
42
 
250
43
  [logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
@@ -1,10 +1,10 @@
1
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
- export type StoragePreviousHashOpts = {
4
+ export interface StoragePreviousHashOpts {
5
5
  namespace?: string;
6
6
  type?: Storage;
7
- };
7
+ }
8
8
  export declare class StoragePreviousHashStore implements PreviousHashStore {
9
9
  static readonly DefaultNamespace = "xyo-previous-hash-store";
10
10
  static readonly DefaultStorageType: Storage;
@@ -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,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
+ {"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,WAAW,uBAAuB;IACtC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf;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/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
+ {"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 interface 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,10 +1,10 @@
1
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
- export type StoragePreviousHashOpts = {
4
+ export interface StoragePreviousHashOpts {
5
5
  namespace?: string;
6
6
  type?: Storage;
7
- };
7
+ }
8
8
  export declare class StoragePreviousHashStore implements PreviousHashStore {
9
9
  static readonly DefaultNamespace = "xyo-previous-hash-store";
10
10
  static readonly DefaultStorageType: Storage;
@@ -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,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
+ {"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,WAAW,uBAAuB;IACtC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf;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/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
+ {"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 interface 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,10 +1,10 @@
1
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
- export type StoragePreviousHashOpts = {
4
+ export interface StoragePreviousHashOpts {
5
5
  namespace?: string;
6
6
  type?: Storage;
7
- };
7
+ }
8
8
  export declare class StoragePreviousHashStore implements PreviousHashStore {
9
9
  static readonly DefaultNamespace = "xyo-previous-hash-store";
10
10
  static readonly DefaultStorageType: Storage;
@@ -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,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
+ {"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,WAAW,uBAAuB;IACtC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf;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/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
+ {"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 interface 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.3.29",
3
+ "version": "5.4.0",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -22,12 +22,10 @@
22
22
  "exports": {
23
23
  ".": {
24
24
  "types": "./dist/neutral/index.d.ts",
25
- "import": "./dist/neutral/index.mjs",
26
25
  "default": "./dist/neutral/index.mjs"
27
26
  },
28
27
  "./package.json": "./package.json"
29
28
  },
30
- "types": "dist/neutral/index.d.ts",
31
29
  "files": [
32
30
  "dist",
33
31
  "!**/*.bench.*",
@@ -37,27 +35,24 @@
37
35
  ],
38
36
  "dependencies": {
39
37
  "store2": "~2.14.4",
40
- "@xyo-network/previous-hash-store-model": "~5.3.29"
38
+ "@xyo-network/previous-hash-store-model": "~5.4.0"
41
39
  },
42
40
  "devDependencies": {
43
41
  "@opentelemetry/api": "^1.9.1",
44
- "@types/node": "^25.5.2",
45
- "@types/uuid": "~11.0.0",
46
- "@xylabs/sdk-js": "^5.0.95",
47
- "@xylabs/ts-scripts-common": "~7.8.4",
48
- "@xylabs/ts-scripts-pnpm": "~7.8.4",
49
- "@xylabs/tsconfig": "~7.8.4",
50
- "axios": "^1.14.0",
42
+ "@types/node": "^25.6.0",
43
+ "@xylabs/sdk-js": "^5.0.97",
44
+ "@xylabs/toolchain": "~7.10.8",
45
+ "@xylabs/tsconfig": "~7.10.8",
51
46
  "esbuild": "^0.28.0",
52
47
  "pako": "~2.1.0",
53
48
  "typescript": "~5.9.3",
54
49
  "uuid": "~13.0.0",
55
- "vite": "^8.0.5",
56
- "vitest": "~4.1.2",
50
+ "vite": "^8.0.8",
51
+ "vitest": "~4.1.4",
57
52
  "zod": "^4.3.6"
58
53
  },
59
54
  "peerDependencies": {
60
- "@xylabs/sdk-js": "^5"
55
+ "@xylabs/sdk-js": "^5.0.97"
61
56
  },
62
57
  "publishConfig": {
63
58
  "access": "public"