@sphereon/ssi-sdk.presentation-exchange 0.11.1-next.65

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.
Files changed (70) hide show
  1. package/.yalc/@veramo/kv-store/LICENSE +201 -0
  2. package/.yalc/@veramo/kv-store/README.md +132 -0
  3. package/.yalc/@veramo/kv-store/build/index.d.ts +11 -0
  4. package/.yalc/@veramo/kv-store/build/index.js +45 -0
  5. package/.yalc/@veramo/kv-store/build/key-value-store.d.ts +27 -0
  6. package/.yalc/@veramo/kv-store/build/key-value-store.js +143 -0
  7. package/.yalc/@veramo/kv-store/build/key-value-types.d.ts +51 -0
  8. package/.yalc/@veramo/kv-store/build/key-value-types.js +3 -0
  9. package/.yalc/@veramo/kv-store/build/keyv/keyv-types.d.ts +62 -0
  10. package/.yalc/@veramo/kv-store/build/keyv/keyv-types.js +3 -0
  11. package/.yalc/@veramo/kv-store/build/keyv/keyv.d.ts +53 -0
  12. package/.yalc/@veramo/kv-store/build/keyv/keyv.js +385 -0
  13. package/.yalc/@veramo/kv-store/build/store-adapters/index.d.ts +3 -0
  14. package/.yalc/@veramo/kv-store/build/store-adapters/index.js +30 -0
  15. package/.yalc/@veramo/kv-store/build/store-adapters/tiered/index.d.ts +32 -0
  16. package/.yalc/@veramo/kv-store/build/store-adapters/tiered/index.js +301 -0
  17. package/.yalc/@veramo/kv-store/build/store-adapters/tiered/types.d.ts +14 -0
  18. package/.yalc/@veramo/kv-store/build/store-adapters/tiered/types.js +3 -0
  19. package/.yalc/@veramo/kv-store/build/store-adapters/typeorm/entities/keyValueStoreEntity.d.ts +11 -0
  20. package/.yalc/@veramo/kv-store/build/store-adapters/typeorm/entities/keyValueStoreEntity.js +50 -0
  21. package/.yalc/@veramo/kv-store/build/store-adapters/typeorm/index.d.ts +41 -0
  22. package/.yalc/@veramo/kv-store/build/store-adapters/typeorm/index.js +186 -0
  23. package/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/1.createKVDatabase.d.ts +14 -0
  24. package/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/1.createKVDatabase.js +90 -0
  25. package/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/index.d.ts +10 -0
  26. package/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/index.js +13 -0
  27. package/.yalc/@veramo/kv-store/build/store-adapters/typeorm/types.d.ts +15 -0
  28. package/.yalc/@veramo/kv-store/build/store-adapters/typeorm/types.js +3 -0
  29. package/.yalc/@veramo/kv-store/build/tsdoc-metadata.json +11 -0
  30. package/.yalc/@veramo/kv-store/package.json +39 -0
  31. package/.yalc/@veramo/kv-store/src/__tests__/keyv.test.ts +204 -0
  32. package/.yalc/@veramo/kv-store/src/__tests__/kvstore.test.ts +93 -0
  33. package/.yalc/@veramo/kv-store/src/index.ts +10 -0
  34. package/.yalc/@veramo/kv-store/src/key-value-store.ts +109 -0
  35. package/.yalc/@veramo/kv-store/src/key-value-types.ts +97 -0
  36. package/.yalc/@veramo/kv-store/src/keyv/keyv-types.ts +71 -0
  37. package/.yalc/@veramo/kv-store/src/keyv/keyv.ts +282 -0
  38. package/.yalc/@veramo/kv-store/src/store-adapters/index.ts +2 -0
  39. package/.yalc/@veramo/kv-store/src/store-adapters/tiered/index.ts +158 -0
  40. package/.yalc/@veramo/kv-store/src/store-adapters/tiered/types.ts +16 -0
  41. package/.yalc/@veramo/kv-store/src/store-adapters/typeorm/entities/keyValueStoreEntity.ts +20 -0
  42. package/.yalc/@veramo/kv-store/src/store-adapters/typeorm/index.ts +122 -0
  43. package/.yalc/@veramo/kv-store/src/store-adapters/typeorm/migrations/1.createKVDatabase.ts +47 -0
  44. package/.yalc/@veramo/kv-store/src/store-adapters/typeorm/migrations/index.ts +10 -0
  45. package/.yalc/@veramo/kv-store/src/store-adapters/typeorm/types.ts +18 -0
  46. package/.yalc/@veramo/kv-store/yalc.sig +1 -0
  47. package/LICENSE +201 -0
  48. package/README.md +56 -0
  49. package/dist/agent/PresentationExchange.d.ts +25 -0
  50. package/dist/agent/PresentationExchange.d.ts.map +1 -0
  51. package/dist/agent/PresentationExchange.js +182 -0
  52. package/dist/agent/PresentationExchange.js.map +1 -0
  53. package/dist/functions.d.ts +12 -0
  54. package/dist/functions.d.ts.map +1 -0
  55. package/dist/functions.js +41 -0
  56. package/dist/functions.js.map +1 -0
  57. package/dist/index.d.ts +9 -0
  58. package/dist/index.d.ts.map +1 -0
  59. package/dist/index.js +27 -0
  60. package/dist/index.js.map +1 -0
  61. package/dist/types/IPresentationExchange.d.ts +81 -0
  62. package/dist/types/IPresentationExchange.d.ts.map +1 -0
  63. package/dist/types/IPresentationExchange.js +3 -0
  64. package/dist/types/IPresentationExchange.js.map +1 -0
  65. package/package.json +67 -0
  66. package/plugin.schema.json +329 -0
  67. package/src/agent/PresentationExchange.ts +204 -0
  68. package/src/functions.ts +56 -0
  69. package/src/index.ts +8 -0
  70. package/src/types/IPresentationExchange.ts +114 -0
@@ -0,0 +1,3 @@
1
+ 'use strict'
2
+ Object.defineProperty(exports, '__esModule', { value: true })
3
+ //# sourceMappingURL=keyv-types.js.map
@@ -0,0 +1,53 @@
1
+ /// <reference types="node" />
2
+ import { EventEmitter } from 'events'
3
+ import { KeyvDeserializedData, KeyvOptions, KeyvStore, KeyvStoredData } from './keyv-types'
4
+ /**
5
+ * Please note that this is code adapted from @link https://github.com/jaredwray/keyv to support Typescript and ESM in Veramo
6
+ *
7
+ * The code should support the storage plugins available for the keyv project.
8
+ * Veramo itself supports NodeJS, Browser and React-Native environment.
9
+ * Please be aware that these requirements probably aren't true for any keyv storage plugins.
10
+ *
11
+ * One of the big changes compared to the upstream project is that this port does not have dynamic loading of store-adapters based on URIs.
12
+ * We believe that any Veramo Key Value store should use explicitly defined store-adapters.
13
+ *
14
+ * The port is part of the Veramo Key Value Store module, as we do not want to make an official maintained port out of it.
15
+ * Veramo exposes its own API/interfaces for the Key Value store, meaning we could also support any other implementation in the future
16
+ *
17
+ * The Veramo kv-store module provides out of the box support for in memory/maps, sqlite and typeorm implementations,
18
+ * including a tiered local/remote implementation that support all environments.
19
+ *
20
+ * We welcome any new storage modules
21
+ */
22
+ export declare class Keyv<Value = any> extends EventEmitter implements KeyvStore<Value> {
23
+ readonly opts: KeyvOptions<Value>
24
+ readonly namespace: string
25
+ iterator?: (namespace?: string) => AsyncGenerator<any, void>
26
+ constructor(uri?: string | Map<string, Value | undefined> | KeyvStore<Value> | undefined, options?: KeyvOptions<Value>)
27
+ get store(): Required<KeyvStore<Value>>
28
+ get deserialize(): (data: any) => import('@veramo/utils').OrPromise<KeyvDeserializedData<Value> | undefined>
29
+ get serialize(): (data: KeyvDeserializedData<Value>) => import('@veramo/utils').OrPromise<string | undefined>
30
+ _checkIterableAdapter(): any
31
+ _getKeyPrefix(key: string): string
32
+ _getKeyPrefixArray(keys: string[]): string[]
33
+ _getKeyUnprefix(key: string): string
34
+ getMany(
35
+ keys: string[],
36
+ options?: {
37
+ raw?: boolean
38
+ }
39
+ ): Promise<Array<KeyvStoredData<Value>>>
40
+ get(
41
+ key: string | string[],
42
+ options?: {
43
+ raw?: boolean
44
+ }
45
+ ): Promise<Value | string | KeyvDeserializedData<Value> | KeyvStoredData<Value>[] | undefined>
46
+ private isExpired
47
+ set(key: string, value: Value, ttl?: number): Promise<boolean>
48
+ delete(key: string | string[]): Promise<boolean>
49
+ clear(): Promise<void>
50
+ has(key: string): Promise<boolean>
51
+ disconnect(): void
52
+ }
53
+ //# sourceMappingURL=keyv.d.ts.map
@@ -0,0 +1,385 @@
1
+ 'use strict'
2
+ var __awaiter =
3
+ (this && this.__awaiter) ||
4
+ function (thisArg, _arguments, P, generator) {
5
+ function adopt(value) {
6
+ return value instanceof P
7
+ ? value
8
+ : new P(function (resolve) {
9
+ resolve(value)
10
+ })
11
+ }
12
+ return new (P || (P = Promise))(function (resolve, reject) {
13
+ function fulfilled(value) {
14
+ try {
15
+ step(generator.next(value))
16
+ } catch (e) {
17
+ reject(e)
18
+ }
19
+ }
20
+ function rejected(value) {
21
+ try {
22
+ step(generator['throw'](value))
23
+ } catch (e) {
24
+ reject(e)
25
+ }
26
+ }
27
+ function step(result) {
28
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected)
29
+ }
30
+ step((generator = generator.apply(thisArg, _arguments || [])).next())
31
+ })
32
+ }
33
+ var __asyncValues =
34
+ (this && this.__asyncValues) ||
35
+ function (o) {
36
+ if (!Symbol.asyncIterator) throw new TypeError('Symbol.asyncIterator is not defined.')
37
+ var m = o[Symbol.asyncIterator],
38
+ i
39
+ return m
40
+ ? m.call(o)
41
+ : ((o = typeof __values === 'function' ? __values(o) : o[Symbol.iterator]()),
42
+ (i = {}),
43
+ verb('next'),
44
+ verb('throw'),
45
+ verb('return'),
46
+ (i[Symbol.asyncIterator] = function () {
47
+ return this
48
+ }),
49
+ i)
50
+ function verb(n) {
51
+ i[n] =
52
+ o[n] &&
53
+ function (v) {
54
+ return new Promise(function (resolve, reject) {
55
+ ;(v = o[n](v)), settle(resolve, reject, v.done, v.value)
56
+ })
57
+ }
58
+ }
59
+ function settle(resolve, reject, d, v) {
60
+ Promise.resolve(v).then(function (v) {
61
+ resolve({ value: v, done: d })
62
+ }, reject)
63
+ }
64
+ }
65
+ var __await =
66
+ (this && this.__await) ||
67
+ function (v) {
68
+ return this instanceof __await ? ((this.v = v), this) : new __await(v)
69
+ }
70
+ var __asyncGenerator =
71
+ (this && this.__asyncGenerator) ||
72
+ function (thisArg, _arguments, generator) {
73
+ if (!Symbol.asyncIterator) throw new TypeError('Symbol.asyncIterator is not defined.')
74
+ var g = generator.apply(thisArg, _arguments || []),
75
+ i,
76
+ q = []
77
+ return (
78
+ (i = {}),
79
+ verb('next'),
80
+ verb('throw'),
81
+ verb('return'),
82
+ (i[Symbol.asyncIterator] = function () {
83
+ return this
84
+ }),
85
+ i
86
+ )
87
+ function verb(n) {
88
+ if (g[n])
89
+ i[n] = function (v) {
90
+ return new Promise(function (a, b) {
91
+ q.push([n, v, a, b]) > 1 || resume(n, v)
92
+ })
93
+ }
94
+ }
95
+ function resume(n, v) {
96
+ try {
97
+ step(g[n](v))
98
+ } catch (e) {
99
+ settle(q[0][3], e)
100
+ }
101
+ }
102
+ function step(r) {
103
+ r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r)
104
+ }
105
+ function fulfill(value) {
106
+ resume('next', value)
107
+ }
108
+ function reject(value) {
109
+ resume('throw', value)
110
+ }
111
+ function settle(f, v) {
112
+ if ((f(v), q.shift(), q.length)) resume(q[0][0], q[0][1])
113
+ }
114
+ }
115
+ var __importDefault =
116
+ (this && this.__importDefault) ||
117
+ function (mod) {
118
+ return mod && mod.__esModule ? mod : { default: mod }
119
+ }
120
+ Object.defineProperty(exports, '__esModule', { value: true })
121
+ exports.Keyv = void 0
122
+ const events_1 = require('events')
123
+ const json_buffer_1 = __importDefault(require('json-buffer'))
124
+ /**
125
+ * Please note that this is code adapted from @link https://github.com/jaredwray/keyv to support Typescript and ESM in Veramo
126
+ *
127
+ * The code should support the storage plugins available for the keyv project.
128
+ * Veramo itself supports NodeJS, Browser and React-Native environment.
129
+ * Please be aware that these requirements probably aren't true for any keyv storage plugins.
130
+ *
131
+ * One of the big changes compared to the upstream project is that this port does not have dynamic loading of store-adapters based on URIs.
132
+ * We believe that any Veramo Key Value store should use explicitly defined store-adapters.
133
+ *
134
+ * The port is part of the Veramo Key Value Store module, as we do not want to make an official maintained port out of it.
135
+ * Veramo exposes its own API/interfaces for the Key Value store, meaning we could also support any other implementation in the future
136
+ *
137
+ * The Veramo kv-store module provides out of the box support for in memory/maps, sqlite and typeorm implementations,
138
+ * including a tiered local/remote implementation that support all environments.
139
+ *
140
+ * We welcome any new storage modules
141
+ */
142
+ class Keyv extends events_1.EventEmitter {
143
+ constructor(uri, options) {
144
+ super()
145
+ const emitErrors = (options === null || options === void 0 ? void 0 : options.emitErrors) === undefined ? true : options.emitErrors
146
+ uri = uri !== null && uri !== void 0 ? uri : options === null || options === void 0 ? void 0 : options.uri
147
+ /*if (!uri) {
148
+ throw Error('No URI provided')
149
+ }*/
150
+ this.opts = Object.assign(
151
+ Object.assign(
152
+ { namespace: 'keyv', serialize: json_buffer_1.default.stringify, deserialize: json_buffer_1.default.parse },
153
+ typeof uri === 'string' ? { uri } : uri
154
+ ),
155
+ options
156
+ )
157
+ if (!this.opts.store) {
158
+ if (typeof uri !== 'string') {
159
+ this.opts.store = uri
160
+ } /* else {
161
+ const adapterOptions = { ...this.opts }
162
+ this.opts.store = loadStore(adapterOptions)
163
+ }*/
164
+ }
165
+ if (!this.opts.store) {
166
+ throw Error('No store')
167
+ }
168
+ if (this.opts.compression) {
169
+ const compression = this.opts.compression
170
+ this.opts.serialize = compression.serialize.bind(compression)
171
+ this.opts.deserialize = compression.deserialize.bind(compression)
172
+ }
173
+ if (typeof this.opts.store.on === 'function' && emitErrors) {
174
+ this.opts.store.on('error', (error) => this.emit('error', error))
175
+ }
176
+ this.opts.store.namespace = this.opts.namespace || 'keyv'
177
+ this.namespace = this.opts.store.namespace
178
+ const generateIterator = (iterator, keyv) =>
179
+ function () {
180
+ return __asyncGenerator(this, arguments, function* () {
181
+ var _a, e_1, _b, _c
182
+ try {
183
+ for (
184
+ var _d = true, _e = __asyncValues(typeof iterator === 'function' ? iterator(keyv.store.namespace) : iterator), _f;
185
+ (_f = yield __await(_e.next())), (_a = _f.done), !_a;
186
+
187
+ ) {
188
+ _c = _f.value
189
+ _d = false
190
+ try {
191
+ const [key, raw] = _c
192
+ const data = yield __await(keyv.deserialize(raw))
193
+ if (keyv.store.namespace && !key.includes(keyv.store.namespace)) {
194
+ continue
195
+ }
196
+ if (data && typeof data.expires === 'number' && Date.now() > data.expires) {
197
+ keyv.delete(key)
198
+ continue
199
+ }
200
+ yield yield __await([keyv._getKeyUnprefix(key), data === null || data === void 0 ? void 0 : data.value])
201
+ } finally {
202
+ _d = true
203
+ }
204
+ }
205
+ } catch (e_1_1) {
206
+ e_1 = { error: e_1_1 }
207
+ } finally {
208
+ try {
209
+ if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e))
210
+ } finally {
211
+ if (e_1) throw e_1.error
212
+ }
213
+ }
214
+ })
215
+ }
216
+ // Attach iterators
217
+ // @ts-ignore
218
+ if (typeof this.store[Symbol.iterator] === 'function' && this.store instanceof Map) {
219
+ this.iterator = generateIterator(this.store, this)
220
+ } else if (typeof this.store.iterator === 'function' && this.store.opts && this._checkIterableAdapter()) {
221
+ this.iterator = generateIterator(this.store.iterator.bind(this.store), this)
222
+ }
223
+ }
224
+ get store() {
225
+ return this.opts.store
226
+ }
227
+ get deserialize() {
228
+ return this.opts.deserialize
229
+ }
230
+ get serialize() {
231
+ return this.opts.serialize
232
+ }
233
+ _checkIterableAdapter() {
234
+ return (
235
+ (this.store.opts.dialect && iterableAdapters.includes(this.store.opts.dialect)) ||
236
+ (this.store.opts.url && iterableAdapters.findIndex((element) => this.store.opts.url.includes(element)) >= 0)
237
+ )
238
+ }
239
+ _getKeyPrefix(key) {
240
+ return `${this.opts.namespace}:${key}`
241
+ }
242
+ _getKeyPrefixArray(keys) {
243
+ return keys.map((key) => this._getKeyPrefix(key))
244
+ }
245
+ _getKeyUnprefix(key) {
246
+ return key.split(':').splice(1).join(':')
247
+ }
248
+ getMany(keys, options) {
249
+ return __awaiter(this, void 0, void 0, function* () {
250
+ const keyPrefixed = this._getKeyPrefixArray(keys)
251
+ let promise
252
+ if (this.store.getMany !== undefined) {
253
+ promise = this.store.getMany(keyPrefixed, options) //.then(value => !!value ? value.values() : undefined)
254
+ // todo: Probably wise to check expired ValueData here, if the getMany does not implement this feature itself!
255
+ } else {
256
+ promise = Promise.all(keyPrefixed.map((k) => this.store.get(k, options)))
257
+ }
258
+ const allValues = Promise.resolve(promise)
259
+ const results = []
260
+ return Promise.resolve(allValues)
261
+ .then((all) => {
262
+ keys.forEach((key, index) => {
263
+ const data = all[index]
264
+ let result = typeof data === 'string' ? this.deserialize(data) : !!data && this.opts.compression ? this.deserialize(data) : data
265
+ if (result && typeof result === 'object' && 'expires' in result && typeof result.expires === 'number' && Date.now() > result.expires) {
266
+ this.delete(key)
267
+ result = undefined
268
+ }
269
+ const final = options && options.raw ? result : result && typeof result === 'object' && 'value' in result ? result.value : result
270
+ results.push(final)
271
+ })
272
+ })
273
+ .then(() => Promise.all(results))
274
+ })
275
+ }
276
+ get(key, options) {
277
+ return __awaiter(this, void 0, void 0, function* () {
278
+ const isArray = Array.isArray(key)
279
+ return Promise.resolve()
280
+ .then(() => (isArray ? this.getMany(this._getKeyPrefixArray(key), options) : this.store.get(this._getKeyPrefix(key))))
281
+ .then((data) => (typeof data === 'string' ? this.deserialize(data) : this.opts.compression ? this.deserialize(data) : data))
282
+ .then((data) => {
283
+ if (data === undefined || data === null) {
284
+ return undefined
285
+ }
286
+ const rows = Array.isArray(data) ? data : [data]
287
+ if (isArray) {
288
+ const result = []
289
+ for (let row of rows) {
290
+ if (row === undefined || row === null) {
291
+ result.push(undefined)
292
+ continue
293
+ }
294
+ if (this.isExpired(row)) {
295
+ this.delete(key).then(() => undefined)
296
+ result.push(undefined)
297
+ } else {
298
+ result.push(options && options.raw ? row : toValue(row))
299
+ }
300
+ }
301
+ return result
302
+ } else if (!Array.isArray(data)) {
303
+ if (this.isExpired(data)) {
304
+ return this.delete(key).then(() => undefined)
305
+ }
306
+ }
307
+ return options && options.raw ? data : Array.isArray(data) ? data.map((d) => toValue(d)) : toValue(data)
308
+ })
309
+ })
310
+ }
311
+ isExpired(data) {
312
+ return (
313
+ typeof data !== 'string' &&
314
+ data &&
315
+ typeof data === 'object' &&
316
+ 'expires' in data &&
317
+ typeof data.expires === 'number' &&
318
+ Date.now() > data.expires
319
+ )
320
+ }
321
+ set(key, value, ttl) {
322
+ const keyPrefixed = this._getKeyPrefix(key)
323
+ if (typeof ttl === 'undefined') {
324
+ ttl = this.opts.ttl
325
+ }
326
+ if (ttl === 0) {
327
+ ttl = undefined
328
+ }
329
+ // @ts-ignore
330
+ return Promise.resolve()
331
+ .then(() => {
332
+ const expires = typeof ttl === 'number' ? Date.now() + ttl : undefined
333
+ if (typeof value === 'symbol') {
334
+ this.emit('error', 'symbol cannot be serialized')
335
+ }
336
+ const input = { value, expires }
337
+ return this.serialize(input)
338
+ })
339
+ .then((value) => this.store.set(keyPrefixed, value, ttl))
340
+ .then(() => true)
341
+ }
342
+ delete(key) {
343
+ if (!Array.isArray(key)) {
344
+ const keyPrefixed = this._getKeyPrefix(key)
345
+ return Promise.resolve().then(() => this.store.delete(keyPrefixed))
346
+ }
347
+ const keyPrefixed = this._getKeyPrefixArray(key)
348
+ if (this.store.deleteMany !== undefined) {
349
+ return Promise.resolve().then(() => this.store.deleteMany(keyPrefixed))
350
+ }
351
+ const promises = []
352
+ for (const key of keyPrefixed) {
353
+ promises.push(this.store.delete(key))
354
+ }
355
+ return Promise.allSettled(promises).then((values) => values.every((x) => x.valueOf() === true))
356
+ }
357
+ clear() {
358
+ return __awaiter(this, void 0, void 0, function* () {
359
+ return Promise.resolve().then(() => this.store.clear())
360
+ })
361
+ }
362
+ has(key) {
363
+ const keyPrefixed = this._getKeyPrefix(key)
364
+ return Promise.resolve().then(() =>
365
+ __awaiter(this, void 0, void 0, function* () {
366
+ if (typeof this.store.has === 'function') {
367
+ return this.store.has(keyPrefixed)
368
+ }
369
+ const value = yield this.store.get(keyPrefixed)
370
+ return value !== undefined
371
+ })
372
+ )
373
+ }
374
+ disconnect() {
375
+ if (typeof this.store.disconnect === 'function') {
376
+ return this.store.disconnect()
377
+ }
378
+ }
379
+ }
380
+ exports.Keyv = Keyv
381
+ const iterableAdapters = ['sqlite', 'postgres', 'mysql', 'mongo', 'redis', 'tiered']
382
+ function toValue(input) {
383
+ return input !== null && typeof input === 'object' && 'value' in input ? input.value : input
384
+ }
385
+ //# sourceMappingURL=keyv.js.map
@@ -0,0 +1,3 @@
1
+ export * from './tiered/index'
2
+ export * from './typeorm/index'
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,30 @@
1
+ 'use strict'
2
+ var __createBinding =
3
+ (this && this.__createBinding) ||
4
+ (Object.create
5
+ ? function (o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k
7
+ var desc = Object.getOwnPropertyDescriptor(m, k)
8
+ if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = {
10
+ enumerable: true,
11
+ get: function () {
12
+ return m[k]
13
+ },
14
+ }
15
+ }
16
+ Object.defineProperty(o, k2, desc)
17
+ }
18
+ : function (o, m, k, k2) {
19
+ if (k2 === undefined) k2 = k
20
+ o[k2] = m[k]
21
+ })
22
+ var __exportStar =
23
+ (this && this.__exportStar) ||
24
+ function (m, exports) {
25
+ for (var p in m) if (p !== 'default' && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p)
26
+ }
27
+ Object.defineProperty(exports, '__esModule', { value: true })
28
+ __exportStar(require('./tiered/index'), exports)
29
+ __exportStar(require('./typeorm/index'), exports)
30
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,32 @@
1
+ /// <reference types="node" />
2
+ import { EventEmitter } from 'events'
3
+ import type { Options, Options_ } from './types'
4
+ import { KeyvStore, KeyvStoredData } from '../../keyv/keyv-types'
5
+ import { IKeyValueStoreAdapter } from '../../key-value-types'
6
+ export declare class KeyValueTieredStoreAdapter<Value> extends EventEmitter implements KeyvStore<Value>, IKeyValueStoreAdapter<Value> {
7
+ opts: Options_
8
+ remote: KeyvStore<Value>
9
+ local: KeyvStore<Value>
10
+ iterationLimit?: string | number
11
+ namespace?: string | undefined
12
+ constructor({ remote, local, ...options }: Options<Value>)
13
+ get(
14
+ key: string | string[],
15
+ options?: {
16
+ raw?: boolean
17
+ }
18
+ ): Promise<KeyvStoredData<Value> | Array<KeyvStoredData<Value>>>
19
+ getMany(
20
+ keys: string[],
21
+ options?: {
22
+ raw?: boolean
23
+ }
24
+ ): Promise<Array<KeyvStoredData<Value>>>
25
+ set(key: string, value: any, ttl?: number): Promise<any[]>
26
+ clear(): Promise<undefined>
27
+ delete(key: string): Promise<boolean>
28
+ deleteMany(keys: string[]): Promise<boolean>
29
+ has(key: string): Promise<boolean>
30
+ iterator(namespace?: string): AsyncGenerator<any, void, any>
31
+ }
32
+ //# sourceMappingURL=index.d.ts.map