diff --git a/packages/kv-store/CHANGELOG.md b/packages/kv-store/CHANGELOG.md new file mode 100644 index 000000000..e69de29bb diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/LICENSE b/packages/kv-store/LICENSE similarity index 100% rename from packages/presentation-exchange/.yalc/@veramo/kv-store/LICENSE rename to packages/kv-store/LICENSE diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/README.md b/packages/kv-store/README.md similarity index 100% rename from packages/presentation-exchange/.yalc/@veramo/kv-store/README.md rename to packages/kv-store/README.md diff --git a/packages/kv-store/api-extractor.json b/packages/kv-store/api-extractor.json new file mode 100644 index 000000000..409d7f16c --- /dev/null +++ b/packages/kv-store/api-extractor.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "apiReport": { + "enabled": true, + "reportFolder": "./api", + "reportTempFolder": "./api" + }, + + "docModel": { + "enabled": true, + "apiJsonFilePath": "./api/.api.json" + }, + + "dtsRollup": { + "enabled": false + }, + "mainEntryPointFilePath": "/build/index.d.ts" +} diff --git a/packages/kv-store/package.json b/packages/kv-store/package.json new file mode 100644 index 000000000..60452e53d --- /dev/null +++ b/packages/kv-store/package.json @@ -0,0 +1,49 @@ +{ + "name": "@sphereon/ssi-sdk.kv-store-temp", + "description": "Key Value Store plugin", + "version": "0.11.0", + "source": "src/index.ts", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "scripts": { + "build": "tsc" + }, + "dependencies": { + "@veramo/utils": "4.2.0", + "events": "^3.3.0", + "debug": "^4.3.4", + "json-buffer": "^3.0.1", + "typeorm": "^0.3.10", + "uint8arrays": "^3.1.1" + }, + "devDependencies": { + "@veramo/cli": "4.2.0", + "@types/json-buffer": "^3.0.0", + "@types/debug": "^4.1.7", + "keyv": "^4.5.2", + "@keyv/test-suite": "^1.9.2", + "@keyv/sqlite": "^3.6.5", + "@keyv/compress-brotli": "^1.1.3", + "@keyv/compress-gzip": "^1.2.3", + "eslint": "^8.33.0", + "eslint-plugin-promise": "^6.1.1", + "timekeeper": "^2.2.0", + "typescript": "^4.9.5" + }, + "files": [ + "dist/**/*", + "src/**/*", + "README.md", + "LICENSE" + ], + "publishConfig": { + "access": "public" + }, + "repository": "git@github.com:uport-project/veramo.git", + "author": "Niels Klomp ", + "license": "Apache-2.0", + "keywords": [ + "Key Value Store", + "keyv" + ] +} diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/__tests__/keyv.test.ts b/packages/kv-store/src/__tests__/keyv.test.ts similarity index 90% rename from packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/__tests__/keyv.test.ts rename to packages/kv-store/src/__tests__/keyv.test.ts index 447e7f49f..e1e8714bd 100644 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/__tests__/keyv.test.ts +++ b/packages/kv-store/src/__tests__/keyv.test.ts @@ -3,10 +3,10 @@ import KeyvSqlite from '@keyv/sqlite' import timekeeper from 'timekeeper' import { Keyv } from '../keyv/keyv' import { DataSource } from 'typeorm' -import { KeyValueStoreEntity } from '../store-adapters/typeorm/entities/keyValueStoreEntity' +import { KeyValueStoreEntity } from '../store-adapters' import { KeyValueTieredStoreAdapter, KeyValueTypeORMStoreAdapter } from '../store-adapters' import { KeyvOptions } from '../keyv/keyv-types' -import { kvStoreMigrations } from '../store-adapters/typeorm/migrations' +import { kvStoreMigrations } from '../store-adapters' let dbConnection: DataSource beforeEach(async () => { @@ -61,29 +61,6 @@ describe('keyv sqlite store', () => { }) describe('keyv TypeORM store', () => { - /*let dbConnection: DataSource - - beforeEach(async () => { - dbConnection = await new DataSource({ - type: 'sqlite', - database: ':memory:', - logging: 'all', - migrationsRun: true, - synchronize: false, - migrations: [...kvStoreMigrations], - entities: [KeyValueStoreEntity], - }).initialize() - }) - - afterEach(async () => { - try { - (await dbConnection).destroy() - } catch (error) { - // the disconnect test will close the DB anyway - } - - }) -*/ it('should respect ttl', async () => { const store = new KeyValueTypeORMStoreAdapter({ dbConnection, namespace: 'test' }) const keyv = new Keyv(store) diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/src/__tests__/kvstore.test.ts b/packages/kv-store/src/__tests__/kvstore.test.ts similarity index 100% rename from packages/presentation-exchange/.yalc/@veramo/kv-store/src/__tests__/kvstore.test.ts rename to packages/kv-store/src/__tests__/kvstore.test.ts diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/index.ts b/packages/kv-store/src/index.ts similarity index 52% rename from packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/index.ts rename to packages/kv-store/src/index.ts index c72fc52ff..043ac6015 100644 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/index.ts +++ b/packages/kv-store/src/index.ts @@ -1,6 +1,6 @@ /** - * Provides a {@link @veramo/kv-store#KeyValueStore} for the - * {@link @veramo/core#Agent} plugin that implements {@link @veramo/kv-store#IKeyValueStore} interface + * Provides a {@link @sphereon/ssi-sdk.kv-store-temp#KeyValueStore} for the + * {@link @veramo/core#Agent} plugin that implements {@link @sphereon/ssi-sdk.kv-store-temp#IKeyValueStore} interface * * @packageDocumentation */ diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/key-value-store.ts b/packages/kv-store/src/key-value-store.ts similarity index 91% rename from packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/key-value-store.ts rename to packages/kv-store/src/key-value-store.ts index 8d2d3d282..f3088c0f1 100644 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/key-value-store.ts +++ b/packages/kv-store/src/key-value-store.ts @@ -1,16 +1,16 @@ -import { IKeyValueStore, IKeyValueStoreOnArgs, IKeyValueStoreOptions, IValueData } from './key-value-types' +import { IKeyValueStore, IKeyValueStoreOnArgs, IKeyValueStoreOptions, IValueData, ValueStoreType } from './key-value-types' import { Keyv } from './keyv/keyv' import { KeyvDeserializedData, KeyvOptions, KeyvStoredData } from './keyv/keyv-types' /** - * Agent plugin that implements {@link @veramo/kv-store#IKeyValueStore} interface + * Agent plugin that implements {@link @sphereon/ssi-sdk.kv-store-temp#IKeyValueStore} interface * @public */ -export class KeyValueStore implements IKeyValueStore { +export class KeyValueStore implements IKeyValueStore { /** * The main keyv typescript port which delegates to the storage adapters and takes care of some common functionality * - * @private + * @internal */ private readonly keyv: Keyv @@ -58,7 +58,7 @@ export class KeyValueStore implements IKeyValueStore { // Making sure we return the same array length as the amount of key(s) passed in if (result === null || result === undefined || result.length === 0) { result = new Array>() - keys.forEach(() => result.push({ value: undefined, expires: undefined } as KeyvDeserializedData)) + keys.forEach(() => result.push({ value: undefined, expires: undefined } as unknown as KeyvDeserializedData)) } return result.map((v) => (!!v ? this.toDeserializedValueData(v) : { value: undefined, expires: undefined })) } diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/key-value-types.ts b/packages/kv-store/src/key-value-types.ts similarity index 53% rename from packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/key-value-types.ts rename to packages/kv-store/src/key-value-types.ts index ddd382e90..d845f9bd7 100644 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/key-value-types.ts +++ b/packages/kv-store/src/key-value-types.ts @@ -1,43 +1,29 @@ /** * This is how the store will actually store the value. * It contains an optional `expires` property, which indicates when the value would expire + * + * @beta */ export interface IValueData { value: ValueType | undefined expires: number | undefined } +/** + * Event listener arguments + * + * @beta + */ export interface IKeyValueStoreOnArgs { eventName: string | symbol listener: (...args: any[]) => void } -/*export interface IKeyValueStoreGetArgs { - key: string -} - -export interface IKeyValueStoreGetManyArgs { - keys: string[] -} - -export interface IKeyValueStoreHasArgs { - key: string -} - -export interface IKeyValueStoreDeleteArgs { - key: string -} - -export interface IKeyValueStoreDeleteManyArgs { - keys: string[] -} - -export interface IKeyValueStoreSetArgs { - key: string - value: ValueType - ttl?: number -}*/ - +/** + * Options for the Key Value store + * + * @beta + */ export interface IKeyValueStoreOptions { [key: string]: any @@ -61,37 +47,93 @@ export interface IKeyValueStoreOptions { emitErrors?: boolean } +/** + * A store adapter implementation needs to provide namespace support + * + * @beta + */ export interface IKeyValueStoreAdapter { namespace?: string | undefined } -export interface IKeyValueStore { +/** + * The types that can be stored by a store adapter + * + * @public + */ +export type ValueStoreType = object | string | number | boolean + +/** + * A Key Value store is responsible for managing Values identified by keys. + * + * @beta + */ +export interface IKeyValueStore { /** * Get a single value by key. Can be undefined as the underlying store typically will not throw an error for a non existing key * - * @param key Contains the key to search for + * @param key - Contains the key to search for */ get(key: string): Promise /** * Get a single item as Value Data from the store. Will always return a Value Data Object, but the value in it can be undefined in case the actual store does not contain the value - * @param key Contains the key to search for + * + * @param key - Contains the key to search for */ getAsValueData(key: string): Promise> + /** + * Get multiple values from the store. Will always return an array with values, but the values can be undefined in case the actual store does not contain the value for the respective key + * + * @param keys - Contains the keys to search for + */ getMany(keys: string[]): Promise> + /** + * Get multiple items as Value Data from the store. Will always return an array with Value Data Object, but the value in it can be undefined in case the actual store does not contain the value + * + * @param keys - Contains the keys to search for + */ getManyAsValueData(keys: string[]): Promise>> + /** + * Store a single value + * + * @param key - The key + * @param value - The value + * @param ttl - An optional number how long to store the value in milliseconds. If not provided will be stored indefinitely + */ set(key: string, value: ValueType, ttl?: number): Promise> + /** + * Delete a value from the store by key + * + * @param key - The key to delete the value for + */ delete(key: string): Promise + /** + * Delete multiple values by provided keys + * + * @param keys - The keys to delete the values for + */ deleteMany(keys: string[]): Promise + /** + * Clear the whole store (delete all values) + */ clear(): Promise> + /** + * Determine whether the store has the value belonging to the provided key + * + * @param key The key to search for + */ has(key: string): Promise + /** + * Disconnect the backing store. After this operation the store typically cannot be reused, unless the store object is re-instantiated + */ disconnect(): Promise } diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/src/keyv/keyv-types.ts b/packages/kv-store/src/keyv/keyv-types.ts similarity index 100% rename from packages/presentation-exchange/.yalc/@veramo/kv-store/src/keyv/keyv-types.ts rename to packages/kv-store/src/keyv/keyv-types.ts diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/src/keyv/keyv.ts b/packages/kv-store/src/keyv/keyv.ts similarity index 100% rename from packages/presentation-exchange/.yalc/@veramo/kv-store/src/keyv/keyv.ts rename to packages/kv-store/src/keyv/keyv.ts diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/src/store-adapters/index.ts b/packages/kv-store/src/store-adapters/index.ts similarity index 100% rename from packages/presentation-exchange/.yalc/@veramo/kv-store/src/store-adapters/index.ts rename to packages/kv-store/src/store-adapters/index.ts diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/store-adapters/tiered/index.ts b/packages/kv-store/src/store-adapters/tiered/index.ts similarity index 98% rename from packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/store-adapters/tiered/index.ts rename to packages/kv-store/src/store-adapters/tiered/index.ts index ef5722c15..f6572f2dc 100644 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/store-adapters/tiered/index.ts +++ b/packages/kv-store/src/store-adapters/tiered/index.ts @@ -6,6 +6,10 @@ import { IKeyValueStoreAdapter } from '../../key-value-types' type KeyvTieredIndex = 'local' | 'remote' +/** + * Tiered keyv store adapter, combining 2 adapters/stores into one + * @alpha + */ export class KeyValueTieredStoreAdapter extends EventEmitter implements KeyvStore, IKeyValueStoreAdapter { opts: Options_ remote: KeyvStore diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/src/store-adapters/tiered/types.ts b/packages/kv-store/src/store-adapters/tiered/types.ts similarity index 100% rename from packages/presentation-exchange/.yalc/@veramo/kv-store/src/store-adapters/tiered/types.ts rename to packages/kv-store/src/store-adapters/tiered/types.ts diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/src/store-adapters/typeorm/entities/keyValueStoreEntity.ts b/packages/kv-store/src/store-adapters/typeorm/entities/keyValueStoreEntity.ts similarity index 100% rename from packages/presentation-exchange/.yalc/@veramo/kv-store/src/store-adapters/typeorm/entities/keyValueStoreEntity.ts rename to packages/kv-store/src/store-adapters/typeorm/entities/keyValueStoreEntity.ts diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/store-adapters/typeorm/index.ts b/packages/kv-store/src/store-adapters/typeorm/index.ts similarity index 84% rename from packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/store-adapters/typeorm/index.ts rename to packages/kv-store/src/store-adapters/typeorm/index.ts index 5d58eec7a..ffee8c7c2 100644 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/store-adapters/typeorm/index.ts +++ b/packages/kv-store/src/store-adapters/typeorm/index.ts @@ -11,6 +11,10 @@ export { KeyValueTypeORMOptions } from './types' export { KeyValueStoreEntity } from './entities/keyValueStoreEntity' export { kvStoreMigrations } from './migrations' +/** + * TypeORM based key value store adapter + * @beta + */ export class KeyValueTypeORMStoreAdapter extends EventEmitter implements KeyvStore, IKeyValueStoreAdapter { private readonly dbConnection: OrPromise readonly namespace: string @@ -33,7 +37,7 @@ export class KeyValueTypeORMStoreAdapter extends EventEmitter implements KeyvSto if (Array.isArray(key)) { return this.getMany(key, options) } - const connection = await getConnectedDb(this.dbConnection) + const connection = await _getConnectedDb(this.dbConnection) const result = await connection.getRepository(KeyValueStoreEntity).findOneBy({ key, }) @@ -41,7 +45,7 @@ export class KeyValueTypeORMStoreAdapter extends EventEmitter implements KeyvSto } async getMany(keys: string[], options?: { raw?: boolean }): Promise>> { - const connection = await getConnectedDb(this.dbConnection) + const connection = await _getConnectedDb(this.dbConnection) const results = await connection.getRepository(KeyValueStoreEntity).findBy({ key: In(keys), }) @@ -59,7 +63,7 @@ export class KeyValueTypeORMStoreAdapter extends EventEmitter implements KeyvSto } async set(key: string, value: string, ttl?: number): Promise> { - const connection = await getConnectedDb(this.dbConnection) + const connection = await _getConnectedDb(this.dbConnection) const entity = new KeyValueStoreEntity() entity.key = key entity.data = value @@ -72,13 +76,13 @@ export class KeyValueTypeORMStoreAdapter extends EventEmitter implements KeyvSto if (Array.isArray(key)) { return this.deleteMany(key) } - const connection = await getConnectedDb(this.dbConnection) + const connection = await _getConnectedDb(this.dbConnection) const result = await connection.getRepository(KeyValueStoreEntity).delete({ key }) return result.affected === 1 } async deleteMany(keys: string[]): Promise { - const connection = await getConnectedDb(this.dbConnection) + const connection = await _getConnectedDb(this.dbConnection) const results = await connection.getRepository(KeyValueStoreEntity).delete({ key: In(keys), }) @@ -86,14 +90,14 @@ export class KeyValueTypeORMStoreAdapter extends EventEmitter implements KeyvSto } async clear(): Promise { - const connection = await getConnectedDb(this.dbConnection) + const connection = await _getConnectedDb(this.dbConnection) await connection.getRepository(KeyValueStoreEntity).delete({ key: Like(`${this.namespace}:%`), }) } async has(key: string): Promise { - const connection = await getConnectedDb(this.dbConnection) + const connection = await _getConnectedDb(this.dbConnection) const result = await connection.getRepository(KeyValueStoreEntity).countBy({ key, }) @@ -101,7 +105,7 @@ export class KeyValueTypeORMStoreAdapter extends EventEmitter implements KeyvSto } async disconnect(): Promise { - const connection = await getConnectedDb(this.dbConnection) + const connection = await _getConnectedDb(this.dbConnection) connection.destroy() } } @@ -110,8 +114,9 @@ export class KeyValueTypeORMStoreAdapter extends EventEmitter implements KeyvSto * Ensures that the provided DataSource is connected. * * @param dbConnection - a TypeORM DataSource or a Promise that resolves to a DataSource + * @internal */ -export async function getConnectedDb(dbConnection: OrPromise): Promise { +export async function _getConnectedDb(dbConnection: OrPromise): Promise { if (dbConnection instanceof Promise) { return await dbConnection } else if (!dbConnection.isInitialized) { diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/src/store-adapters/typeorm/migrations/1.createKVDatabase.ts b/packages/kv-store/src/store-adapters/typeorm/migrations/1.createKVDatabase.ts similarity index 100% rename from packages/presentation-exchange/.yalc/@veramo/kv-store/src/store-adapters/typeorm/migrations/1.createKVDatabase.ts rename to packages/kv-store/src/store-adapters/typeorm/migrations/1.createKVDatabase.ts diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/src/store-adapters/typeorm/migrations/index.ts b/packages/kv-store/src/store-adapters/typeorm/migrations/index.ts similarity index 100% rename from packages/presentation-exchange/.yalc/@veramo/kv-store/src/store-adapters/typeorm/migrations/index.ts rename to packages/kv-store/src/store-adapters/typeorm/migrations/index.ts diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/src/store-adapters/typeorm/types.ts b/packages/kv-store/src/store-adapters/typeorm/types.ts similarity index 87% rename from packages/presentation-exchange/.yalc/@veramo/kv-store/src/store-adapters/typeorm/types.ts rename to packages/kv-store/src/store-adapters/typeorm/types.ts index fb2dcc33f..43b80fb8c 100644 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/src/store-adapters/typeorm/types.ts +++ b/packages/kv-store/src/store-adapters/typeorm/types.ts @@ -2,12 +2,19 @@ import { OrPromise } from '@veramo/utils' import { DataSource } from 'typeorm' import { KeyvDeserializedData } from '../../keyv/keyv-types' +/** + * @public + */ export type KeyValueTypeORMOptions = { dbConnection: OrPromise namespace?: string } +/** + * Internal options for the TypeORM adapter + * @internal + */ // eslint-disable-next-line @typescript-eslint/naming-convention export type Options_ = { validator: (value: any, key: string) => boolean diff --git a/packages/kv-store/tsconfig.json b/packages/kv-store/tsconfig.json new file mode 100644 index 000000000..5feeb67a7 --- /dev/null +++ b/packages/kv-store/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../tsconfig-base.json", + "compilerOptions": { + "esModuleInterop": true, + "rootDir": "src", + "outDir": "dist", + "declarationDir": "dist" + } +} diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/index.d.ts b/packages/presentation-exchange/.yalc/@veramo/kv-store/build/index.d.ts deleted file mode 100644 index 100b7cb44..000000000 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/index.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Provides a {@link @veramo/kv-store#KeyValueStore} for the - * {@link @veramo/core#Agent} plugin that implements {@link @veramo/kv-store#IKeyValueStore} interface - * - * @packageDocumentation - */ -export { KeyValueStore } from './key-value-store' -export * from './store-adapters/tiered/index' -export * from './store-adapters/typeorm/index' -export * from './key-value-types' -//# sourceMappingURL=index.d.ts.map diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/index.js b/packages/presentation-exchange/.yalc/@veramo/kv-store/build/index.js deleted file mode 100644 index 5ec5ef502..000000000 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/index.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict' -var __createBinding = - (this && this.__createBinding) || - (Object.create - ? function (o, m, k, k2) { - if (k2 === undefined) k2 = k - var desc = Object.getOwnPropertyDescriptor(m, k) - if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { - enumerable: true, - get: function () { - return m[k] - }, - } - } - Object.defineProperty(o, k2, desc) - } - : function (o, m, k, k2) { - if (k2 === undefined) k2 = k - o[k2] = m[k] - }) -var __exportStar = - (this && this.__exportStar) || - function (m, exports) { - for (var p in m) if (p !== 'default' && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p) - } -Object.defineProperty(exports, '__esModule', { value: true }) -exports.KeyValueStore = void 0 -/** - * Provides a {@link @veramo/kv-store#KeyValueStore} for the - * {@link @veramo/core#Agent} plugin that implements {@link @veramo/kv-store#IKeyValueStore} interface - * - * @packageDocumentation - */ -var key_value_store_1 = require('./key-value-store') -Object.defineProperty(exports, 'KeyValueStore', { - enumerable: true, - get: function () { - return key_value_store_1.KeyValueStore - }, -}) -__exportStar(require('./store-adapters/tiered/index'), exports) -__exportStar(require('./store-adapters/typeorm/index'), exports) -__exportStar(require('./key-value-types'), exports) -//# sourceMappingURL=index.js.map diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/key-value-store.d.ts b/packages/presentation-exchange/.yalc/@veramo/kv-store/build/key-value-store.d.ts deleted file mode 100644 index 14805470b..000000000 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/key-value-store.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { IKeyValueStore, IKeyValueStoreOnArgs, IKeyValueStoreOptions, IValueData } from './key-value-types' -/** - * Agent plugin that implements {@link @veramo/kv-store#IKeyValueStore} interface - * @public - */ -export declare class KeyValueStore implements IKeyValueStore { - /** - * The main keyv typescript port which delegates to the storage adapters and takes care of some common functionality - * - * @private - */ - private readonly keyv - constructor(options: IKeyValueStoreOptions) - get(key: string): Promise - getAsValueData(key: string): Promise> - getMany(keys: string[]): Promise> - getManyAsValueData(keys: string[]): Promise>> - set(key: string, value: ValueType, ttl?: number): Promise> - has(key: string): Promise - delete(key: string): Promise - deleteMany(keys: string[]): Promise - clear(): Promise> - disconnect(): Promise - kvStoreOn(args: IKeyValueStoreOnArgs): Promise> - private toDeserializedValueData -} -//# sourceMappingURL=key-value-store.d.ts.map diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/key-value-store.js b/packages/presentation-exchange/.yalc/@veramo/kv-store/build/key-value-store.js deleted file mode 100644 index dc8796972..000000000 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/key-value-store.js +++ /dev/null @@ -1,143 +0,0 @@ -'use strict' -var __awaiter = - (this && this.__awaiter) || - function (thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P - ? value - : new P(function (resolve) { - resolve(value) - }) - } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)) - } catch (e) { - reject(e) - } - } - function rejected(value) { - try { - step(generator['throw'](value)) - } catch (e) { - reject(e) - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected) - } - step((generator = generator.apply(thisArg, _arguments || [])).next()) - }) - } -Object.defineProperty(exports, '__esModule', { value: true }) -exports.KeyValueStore = void 0 -const keyv_1 = require('./keyv/keyv') -/** - * Agent plugin that implements {@link @veramo/kv-store#IKeyValueStore} interface - * @public - */ -class KeyValueStore { - constructor(options) { - this.keyv = new keyv_1.Keyv(options.uri, options) - } - get(key) { - return __awaiter(this, void 0, void 0, function* () { - const result = yield this.keyv.get(key, { raw: false }) - if (result === null || result === undefined) { - return undefined - } - return result - }) - } - getAsValueData(key) { - return __awaiter(this, void 0, void 0, function* () { - const result = yield this.keyv.get(key, { raw: true }) - if (result === null || result === undefined) { - // We always return a ValueData object for this method - return { value: undefined, expires: undefined } - } - return this.toDeserializedValueData(result) - }) - } - getMany(keys) { - return __awaiter(this, void 0, void 0, function* () { - if (!keys || keys.length === 0) { - return [] - } - let result = yield this.keyv.getMany(keys, { raw: false }) - // Making sure we return the same array length as the amount of key(s) passed in - if (result === null || result === undefined || result.length === 0) { - result = new Array() - keys.forEach(() => result.push(undefined)) - } - return result.map((v) => (!!v ? v : undefined)) - }) - } - getManyAsValueData(keys) { - return __awaiter(this, void 0, void 0, function* () { - if (!keys || keys.length === 0) { - return [] - } - let result = yield this.keyv.getMany(keys, { raw: true }) - // Making sure we return the same array length as the amount of key(s) passed in - if (result === null || result === undefined || result.length === 0) { - result = new Array() - keys.forEach(() => result.push({ value: undefined, expires: undefined })) - } - return result.map((v) => (!!v ? this.toDeserializedValueData(v) : { value: undefined, expires: undefined })) - }) - } - set(key, value, ttl) { - return __awaiter(this, void 0, void 0, function* () { - return this.keyv.set(key, value, ttl).then(() => this.getAsValueData(key)) - }) - } - has(key) { - return __awaiter(this, void 0, void 0, function* () { - return this.keyv.has(key) - }) - } - delete(key) { - return __awaiter(this, void 0, void 0, function* () { - return this.keyv.delete(key) - }) - } - deleteMany(keys) { - return __awaiter(this, void 0, void 0, function* () { - return Promise.all(keys.map((key) => this.keyv.delete(key))) - }) - } - clear() { - return __awaiter(this, void 0, void 0, function* () { - return this.keyv.clear().then(() => this) - }) - } - disconnect() { - return __awaiter(this, void 0, void 0, function* () { - return this.keyv.disconnect() - }) - } - // Public so parties using the kv store directly can add listeners if they want - kvStoreOn(args) { - return __awaiter(this, void 0, void 0, function* () { - this.keyv.on(args.eventName, args.listener) - return this - }) - } - toDeserializedValueData(result) { - if (result === null || result === undefined) { - throw Error(`Result cannot be undefined or null at this this point`) - } else if (typeof result !== 'object') { - return { value: result, expires: undefined } - } else if (!('value' in result)) { - return { value: result, expires: undefined } - } - if (!('expires' in result)) { - result.expires = undefined - } - return result - } -} -exports.KeyValueStore = KeyValueStore -//# sourceMappingURL=key-value-store.js.map diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/key-value-types.d.ts b/packages/presentation-exchange/.yalc/@veramo/kv-store/build/key-value-types.d.ts deleted file mode 100644 index eeffd56c4..000000000 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/key-value-types.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -/** - * This is how the store will actually store the value. - * It contains an optional `expires` property, which indicates when the value would expire - */ -export interface IValueData { - value: ValueType | undefined - expires: number | undefined -} -export interface IKeyValueStoreOnArgs { - eventName: string | symbol - listener: (...args: any[]) => void -} -export interface IKeyValueStoreOptions { - [key: string]: any - /** Namespace for the current instance. */ - namespace?: string | undefined - /** A custom serialization function. */ - /** The connection string URI. */ - uri?: string | undefined - /** The storage adapter instance to be used by Keyv. or any other implementation */ - store: IKeyValueStoreAdapter | Map - /** Default TTL. Can be overridden by specifying a TTL on `.set()`. */ - ttl?: number | undefined - /** Enable compression option **/ - emitErrors?: boolean -} -export interface IKeyValueStoreAdapter { - namespace?: string | undefined -} -export interface IKeyValueStore { - /** - * Get a single value by key. Can be undefined as the underlying store typically will not throw an error for a non existing key - * - * @param key Contains the key to search for - */ - get(key: string): Promise - /** - * Get a single item as Value Data from the store. Will always return a Value Data Object, but the value in it can be undefined in case the actual store does not contain the value - * @param key Contains the key to search for - */ - getAsValueData(key: string): Promise> - getMany(keys: string[]): Promise> - getManyAsValueData(keys: string[]): Promise>> - set(key: string, value: ValueType, ttl?: number): Promise> - delete(key: string): Promise - deleteMany(keys: string[]): Promise - clear(): Promise> - has(key: string): Promise - disconnect(): Promise -} -//# sourceMappingURL=key-value-types.d.ts.map diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/key-value-types.js b/packages/presentation-exchange/.yalc/@veramo/kv-store/build/key-value-types.js deleted file mode 100644 index b18e238d9..000000000 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/key-value-types.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' -Object.defineProperty(exports, '__esModule', { value: true }) -//# sourceMappingURL=key-value-types.js.map diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/keyv/keyv-types.d.ts b/packages/presentation-exchange/.yalc/@veramo/kv-store/build/keyv/keyv-types.d.ts deleted file mode 100644 index 2cc77cad0..000000000 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/keyv/keyv-types.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Please be aware these types are compatible with the keyv package, to ensure we can use its store-adapters for free. - * - * Be very careful when extending/changing!. Normally you will want to create an adapter or decorator for your additional behaviour or requirements - */ -import { OrPromise } from '@veramo/utils' -export interface KeyvOptions { - [key: string]: any - /** Namespace for the current instance. */ - namespace?: string | undefined - /** A custom serialization function. */ - serialize?: (data: KeyvDeserializedData) => OrPromise - /** A custom deserialization function. */ - deserialize?: (data: any) => OrPromise | undefined> - /** The connection string URI. */ - uri?: string | undefined - /** The storage adapter instance to be used by Keyv. */ - store?: KeyvStore | undefined - /** Default TTL. Can be overridden by specififying a TTL on `.set()`. */ - ttl?: number | undefined - /** Specify an adapter to use. e.g `'redis'` or `'mongodb'`. */ - adapter?: 'redis' | 'mongodb' | 'mongo' | 'sqlite' | 'postgresql' | 'postgres' | 'mysql' | object | string | undefined - /** Enable compression option **/ - compression?: KeyvCompressionAdapter | undefined - emitErrors?: boolean -} -export interface KeyvCompressionAdapter { - compress(value: any, options?: any): OrPromise - decompress(value: any, options?: any): OrPromise - serialize(value: any): OrPromise - deserialize(value: any): OrPromise -} -export interface KeyvDeserializedData { - value: Value - expires: number | undefined -} -export type KeyvStoredData = KeyvDeserializedData | string | Value | undefined -export interface KeyvStore { - namespace?: string | undefined - opts: KeyvOptions - on?(eventName: string | symbol, listener: (...args: any[]) => void): void - get( - key: string | string[], - options?: { - raw?: boolean - } - ): OrPromise | Array>> - getMany?( - keys: string[], - options?: { - raw?: boolean - } - ): OrPromise>> | undefined - iterator?(namespace?: string | undefined): AsyncGenerator - set(key: string, value: Value, ttl?: number): any - delete(key: string | string[]): OrPromise - deleteMany?(keys: string[]): OrPromise - clear(): OrPromise - has?(key: string): OrPromise - disconnect?(): void -} -//# sourceMappingURL=keyv-types.d.ts.map diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/keyv/keyv-types.js b/packages/presentation-exchange/.yalc/@veramo/kv-store/build/keyv/keyv-types.js deleted file mode 100644 index 305adbbfd..000000000 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/keyv/keyv-types.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' -Object.defineProperty(exports, '__esModule', { value: true }) -//# sourceMappingURL=keyv-types.js.map diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/keyv/keyv.d.ts b/packages/presentation-exchange/.yalc/@veramo/kv-store/build/keyv/keyv.d.ts deleted file mode 100644 index d7673e575..000000000 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/keyv/keyv.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -/// -import { EventEmitter } from 'events' -import { KeyvDeserializedData, KeyvOptions, KeyvStore, KeyvStoredData } from './keyv-types' -/** - * Please note that this is code adapted from @link https://github.com/jaredwray/keyv to support Typescript and ESM in Veramo - * - * The code should support the storage plugins available for the keyv project. - * Veramo itself supports NodeJS, Browser and React-Native environment. - * Please be aware that these requirements probably aren't true for any keyv storage plugins. - * - * 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. - * We believe that any Veramo Key Value store should use explicitly defined store-adapters. - * - * 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. - * Veramo exposes its own API/interfaces for the Key Value store, meaning we could also support any other implementation in the future - * - * The Veramo kv-store module provides out of the box support for in memory/maps, sqlite and typeorm implementations, - * including a tiered local/remote implementation that support all environments. - * - * We welcome any new storage modules - */ -export declare class Keyv extends EventEmitter implements KeyvStore { - readonly opts: KeyvOptions - readonly namespace: string - iterator?: (namespace?: string) => AsyncGenerator - constructor(uri?: string | Map | KeyvStore | undefined, options?: KeyvOptions) - get store(): Required> - get deserialize(): (data: any) => import('@veramo/utils').OrPromise | undefined> - get serialize(): (data: KeyvDeserializedData) => import('@veramo/utils').OrPromise - _checkIterableAdapter(): any - _getKeyPrefix(key: string): string - _getKeyPrefixArray(keys: string[]): string[] - _getKeyUnprefix(key: string): string - getMany( - keys: string[], - options?: { - raw?: boolean - } - ): Promise>> - get( - key: string | string[], - options?: { - raw?: boolean - } - ): Promise | KeyvStoredData[] | undefined> - private isExpired - set(key: string, value: Value, ttl?: number): Promise - delete(key: string | string[]): Promise - clear(): Promise - has(key: string): Promise - disconnect(): void -} -//# sourceMappingURL=keyv.d.ts.map diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/keyv/keyv.js b/packages/presentation-exchange/.yalc/@veramo/kv-store/build/keyv/keyv.js deleted file mode 100644 index 5620d367a..000000000 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/keyv/keyv.js +++ /dev/null @@ -1,385 +0,0 @@ -'use strict' -var __awaiter = - (this && this.__awaiter) || - function (thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P - ? value - : new P(function (resolve) { - resolve(value) - }) - } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)) - } catch (e) { - reject(e) - } - } - function rejected(value) { - try { - step(generator['throw'](value)) - } catch (e) { - reject(e) - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected) - } - step((generator = generator.apply(thisArg, _arguments || [])).next()) - }) - } -var __asyncValues = - (this && this.__asyncValues) || - function (o) { - if (!Symbol.asyncIterator) throw new TypeError('Symbol.asyncIterator is not defined.') - var m = o[Symbol.asyncIterator], - i - return m - ? m.call(o) - : ((o = typeof __values === 'function' ? __values(o) : o[Symbol.iterator]()), - (i = {}), - verb('next'), - verb('throw'), - verb('return'), - (i[Symbol.asyncIterator] = function () { - return this - }), - i) - function verb(n) { - i[n] = - o[n] && - function (v) { - return new Promise(function (resolve, reject) { - ;(v = o[n](v)), settle(resolve, reject, v.done, v.value) - }) - } - } - function settle(resolve, reject, d, v) { - Promise.resolve(v).then(function (v) { - resolve({ value: v, done: d }) - }, reject) - } - } -var __await = - (this && this.__await) || - function (v) { - return this instanceof __await ? ((this.v = v), this) : new __await(v) - } -var __asyncGenerator = - (this && this.__asyncGenerator) || - function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError('Symbol.asyncIterator is not defined.') - var g = generator.apply(thisArg, _arguments || []), - i, - q = [] - return ( - (i = {}), - verb('next'), - verb('throw'), - verb('return'), - (i[Symbol.asyncIterator] = function () { - return this - }), - i - ) - function verb(n) { - if (g[n]) - i[n] = function (v) { - return new Promise(function (a, b) { - q.push([n, v, a, b]) > 1 || resume(n, v) - }) - } - } - function resume(n, v) { - try { - step(g[n](v)) - } catch (e) { - settle(q[0][3], e) - } - } - function step(r) { - r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r) - } - function fulfill(value) { - resume('next', value) - } - function reject(value) { - resume('throw', value) - } - function settle(f, v) { - if ((f(v), q.shift(), q.length)) resume(q[0][0], q[0][1]) - } - } -var __importDefault = - (this && this.__importDefault) || - function (mod) { - return mod && mod.__esModule ? mod : { default: mod } - } -Object.defineProperty(exports, '__esModule', { value: true }) -exports.Keyv = void 0 -const events_1 = require('events') -const json_buffer_1 = __importDefault(require('json-buffer')) -/** - * Please note that this is code adapted from @link https://github.com/jaredwray/keyv to support Typescript and ESM in Veramo - * - * The code should support the storage plugins available for the keyv project. - * Veramo itself supports NodeJS, Browser and React-Native environment. - * Please be aware that these requirements probably aren't true for any keyv storage plugins. - * - * 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. - * We believe that any Veramo Key Value store should use explicitly defined store-adapters. - * - * 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. - * Veramo exposes its own API/interfaces for the Key Value store, meaning we could also support any other implementation in the future - * - * The Veramo kv-store module provides out of the box support for in memory/maps, sqlite and typeorm implementations, - * including a tiered local/remote implementation that support all environments. - * - * We welcome any new storage modules - */ -class Keyv extends events_1.EventEmitter { - constructor(uri, options) { - super() - const emitErrors = (options === null || options === void 0 ? void 0 : options.emitErrors) === undefined ? true : options.emitErrors - uri = uri !== null && uri !== void 0 ? uri : options === null || options === void 0 ? void 0 : options.uri - /*if (!uri) { - throw Error('No URI provided') - }*/ - this.opts = Object.assign( - Object.assign( - { namespace: 'keyv', serialize: json_buffer_1.default.stringify, deserialize: json_buffer_1.default.parse }, - typeof uri === 'string' ? { uri } : uri - ), - options - ) - if (!this.opts.store) { - if (typeof uri !== 'string') { - this.opts.store = uri - } /* else { - const adapterOptions = { ...this.opts } - this.opts.store = loadStore(adapterOptions) - }*/ - } - if (!this.opts.store) { - throw Error('No store') - } - if (this.opts.compression) { - const compression = this.opts.compression - this.opts.serialize = compression.serialize.bind(compression) - this.opts.deserialize = compression.deserialize.bind(compression) - } - if (typeof this.opts.store.on === 'function' && emitErrors) { - this.opts.store.on('error', (error) => this.emit('error', error)) - } - this.opts.store.namespace = this.opts.namespace || 'keyv' - this.namespace = this.opts.store.namespace - const generateIterator = (iterator, keyv) => - function () { - return __asyncGenerator(this, arguments, function* () { - var _a, e_1, _b, _c - try { - for ( - var _d = true, _e = __asyncValues(typeof iterator === 'function' ? iterator(keyv.store.namespace) : iterator), _f; - (_f = yield __await(_e.next())), (_a = _f.done), !_a; - - ) { - _c = _f.value - _d = false - try { - const [key, raw] = _c - const data = yield __await(keyv.deserialize(raw)) - if (keyv.store.namespace && !key.includes(keyv.store.namespace)) { - continue - } - if (data && typeof data.expires === 'number' && Date.now() > data.expires) { - keyv.delete(key) - continue - } - yield yield __await([keyv._getKeyUnprefix(key), data === null || data === void 0 ? void 0 : data.value]) - } finally { - _d = true - } - } - } catch (e_1_1) { - e_1 = { error: e_1_1 } - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e)) - } finally { - if (e_1) throw e_1.error - } - } - }) - } - // Attach iterators - // @ts-ignore - if (typeof this.store[Symbol.iterator] === 'function' && this.store instanceof Map) { - this.iterator = generateIterator(this.store, this) - } else if (typeof this.store.iterator === 'function' && this.store.opts && this._checkIterableAdapter()) { - this.iterator = generateIterator(this.store.iterator.bind(this.store), this) - } - } - get store() { - return this.opts.store - } - get deserialize() { - return this.opts.deserialize - } - get serialize() { - return this.opts.serialize - } - _checkIterableAdapter() { - return ( - (this.store.opts.dialect && iterableAdapters.includes(this.store.opts.dialect)) || - (this.store.opts.url && iterableAdapters.findIndex((element) => this.store.opts.url.includes(element)) >= 0) - ) - } - _getKeyPrefix(key) { - return `${this.opts.namespace}:${key}` - } - _getKeyPrefixArray(keys) { - return keys.map((key) => this._getKeyPrefix(key)) - } - _getKeyUnprefix(key) { - return key.split(':').splice(1).join(':') - } - getMany(keys, options) { - return __awaiter(this, void 0, void 0, function* () { - const keyPrefixed = this._getKeyPrefixArray(keys) - let promise - if (this.store.getMany !== undefined) { - promise = this.store.getMany(keyPrefixed, options) //.then(value => !!value ? value.values() : undefined) - // todo: Probably wise to check expired ValueData here, if the getMany does not implement this feature itself! - } else { - promise = Promise.all(keyPrefixed.map((k) => this.store.get(k, options))) - } - const allValues = Promise.resolve(promise) - const results = [] - return Promise.resolve(allValues) - .then((all) => { - keys.forEach((key, index) => { - const data = all[index] - let result = typeof data === 'string' ? this.deserialize(data) : !!data && this.opts.compression ? this.deserialize(data) : data - if (result && typeof result === 'object' && 'expires' in result && typeof result.expires === 'number' && Date.now() > result.expires) { - this.delete(key) - result = undefined - } - const final = options && options.raw ? result : result && typeof result === 'object' && 'value' in result ? result.value : result - results.push(final) - }) - }) - .then(() => Promise.all(results)) - }) - } - get(key, options) { - return __awaiter(this, void 0, void 0, function* () { - const isArray = Array.isArray(key) - return Promise.resolve() - .then(() => (isArray ? this.getMany(this._getKeyPrefixArray(key), options) : this.store.get(this._getKeyPrefix(key)))) - .then((data) => (typeof data === 'string' ? this.deserialize(data) : this.opts.compression ? this.deserialize(data) : data)) - .then((data) => { - if (data === undefined || data === null) { - return undefined - } - const rows = Array.isArray(data) ? data : [data] - if (isArray) { - const result = [] - for (let row of rows) { - if (row === undefined || row === null) { - result.push(undefined) - continue - } - if (this.isExpired(row)) { - this.delete(key).then(() => undefined) - result.push(undefined) - } else { - result.push(options && options.raw ? row : toValue(row)) - } - } - return result - } else if (!Array.isArray(data)) { - if (this.isExpired(data)) { - return this.delete(key).then(() => undefined) - } - } - return options && options.raw ? data : Array.isArray(data) ? data.map((d) => toValue(d)) : toValue(data) - }) - }) - } - isExpired(data) { - return ( - typeof data !== 'string' && - data && - typeof data === 'object' && - 'expires' in data && - typeof data.expires === 'number' && - Date.now() > data.expires - ) - } - set(key, value, ttl) { - const keyPrefixed = this._getKeyPrefix(key) - if (typeof ttl === 'undefined') { - ttl = this.opts.ttl - } - if (ttl === 0) { - ttl = undefined - } - // @ts-ignore - return Promise.resolve() - .then(() => { - const expires = typeof ttl === 'number' ? Date.now() + ttl : undefined - if (typeof value === 'symbol') { - this.emit('error', 'symbol cannot be serialized') - } - const input = { value, expires } - return this.serialize(input) - }) - .then((value) => this.store.set(keyPrefixed, value, ttl)) - .then(() => true) - } - delete(key) { - if (!Array.isArray(key)) { - const keyPrefixed = this._getKeyPrefix(key) - return Promise.resolve().then(() => this.store.delete(keyPrefixed)) - } - const keyPrefixed = this._getKeyPrefixArray(key) - if (this.store.deleteMany !== undefined) { - return Promise.resolve().then(() => this.store.deleteMany(keyPrefixed)) - } - const promises = [] - for (const key of keyPrefixed) { - promises.push(this.store.delete(key)) - } - return Promise.allSettled(promises).then((values) => values.every((x) => x.valueOf() === true)) - } - clear() { - return __awaiter(this, void 0, void 0, function* () { - return Promise.resolve().then(() => this.store.clear()) - }) - } - has(key) { - const keyPrefixed = this._getKeyPrefix(key) - return Promise.resolve().then(() => - __awaiter(this, void 0, void 0, function* () { - if (typeof this.store.has === 'function') { - return this.store.has(keyPrefixed) - } - const value = yield this.store.get(keyPrefixed) - return value !== undefined - }) - ) - } - disconnect() { - if (typeof this.store.disconnect === 'function') { - return this.store.disconnect() - } - } -} -exports.Keyv = Keyv -const iterableAdapters = ['sqlite', 'postgres', 'mysql', 'mongo', 'redis', 'tiered'] -function toValue(input) { - return input !== null && typeof input === 'object' && 'value' in input ? input.value : input -} -//# sourceMappingURL=keyv.js.map diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/index.d.ts b/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/index.d.ts deleted file mode 100644 index 9c83d9e66..000000000 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './tiered/index' -export * from './typeorm/index' -//# sourceMappingURL=index.d.ts.map diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/index.js b/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/index.js deleted file mode 100644 index 6b3e45398..000000000 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/index.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict' -var __createBinding = - (this && this.__createBinding) || - (Object.create - ? function (o, m, k, k2) { - if (k2 === undefined) k2 = k - var desc = Object.getOwnPropertyDescriptor(m, k) - if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { - enumerable: true, - get: function () { - return m[k] - }, - } - } - Object.defineProperty(o, k2, desc) - } - : function (o, m, k, k2) { - if (k2 === undefined) k2 = k - o[k2] = m[k] - }) -var __exportStar = - (this && this.__exportStar) || - function (m, exports) { - for (var p in m) if (p !== 'default' && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p) - } -Object.defineProperty(exports, '__esModule', { value: true }) -__exportStar(require('./tiered/index'), exports) -__exportStar(require('./typeorm/index'), exports) -//# sourceMappingURL=index.js.map diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/tiered/index.d.ts b/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/tiered/index.d.ts deleted file mode 100644 index 21d2d2461..000000000 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/tiered/index.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -/// -import { EventEmitter } from 'events' -import type { Options, Options_ } from './types' -import { KeyvStore, KeyvStoredData } from '../../keyv/keyv-types' -import { IKeyValueStoreAdapter } from '../../key-value-types' -export declare class KeyValueTieredStoreAdapter extends EventEmitter implements KeyvStore, IKeyValueStoreAdapter { - opts: Options_ - remote: KeyvStore - local: KeyvStore - iterationLimit?: string | number - namespace?: string | undefined - constructor({ remote, local, ...options }: Options) - get( - key: string | string[], - options?: { - raw?: boolean - } - ): Promise | Array>> - getMany( - keys: string[], - options?: { - raw?: boolean - } - ): Promise>> - set(key: string, value: any, ttl?: number): Promise - clear(): Promise - delete(key: string): Promise - deleteMany(keys: string[]): Promise - has(key: string): Promise - iterator(namespace?: string): AsyncGenerator -} -//# sourceMappingURL=index.d.ts.map diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/tiered/index.js b/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/tiered/index.js deleted file mode 100644 index efb1be79f..000000000 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/tiered/index.js +++ /dev/null @@ -1,301 +0,0 @@ -'use strict' -var __awaiter = - (this && this.__awaiter) || - function (thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P - ? value - : new P(function (resolve) { - resolve(value) - }) - } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)) - } catch (e) { - reject(e) - } - } - function rejected(value) { - try { - step(generator['throw'](value)) - } catch (e) { - reject(e) - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected) - } - step((generator = generator.apply(thisArg, _arguments || [])).next()) - }) - } -var __rest = - (this && this.__rest) || - function (s, e) { - var t = {} - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p] - if (s != null && typeof Object.getOwnPropertySymbols === 'function') - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]] - } - return t - } -var __asyncValues = - (this && this.__asyncValues) || - function (o) { - if (!Symbol.asyncIterator) throw new TypeError('Symbol.asyncIterator is not defined.') - var m = o[Symbol.asyncIterator], - i - return m - ? m.call(o) - : ((o = typeof __values === 'function' ? __values(o) : o[Symbol.iterator]()), - (i = {}), - verb('next'), - verb('throw'), - verb('return'), - (i[Symbol.asyncIterator] = function () { - return this - }), - i) - function verb(n) { - i[n] = - o[n] && - function (v) { - return new Promise(function (resolve, reject) { - ;(v = o[n](v)), settle(resolve, reject, v.done, v.value) - }) - } - } - function settle(resolve, reject, d, v) { - Promise.resolve(v).then(function (v) { - resolve({ value: v, done: d }) - }, reject) - } - } -var __await = - (this && this.__await) || - function (v) { - return this instanceof __await ? ((this.v = v), this) : new __await(v) - } -var __asyncGenerator = - (this && this.__asyncGenerator) || - function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError('Symbol.asyncIterator is not defined.') - var g = generator.apply(thisArg, _arguments || []), - i, - q = [] - return ( - (i = {}), - verb('next'), - verb('throw'), - verb('return'), - (i[Symbol.asyncIterator] = function () { - return this - }), - i - ) - function verb(n) { - if (g[n]) - i[n] = function (v) { - return new Promise(function (a, b) { - q.push([n, v, a, b]) > 1 || resume(n, v) - }) - } - } - function resume(n, v) { - try { - step(g[n](v)) - } catch (e) { - settle(q[0][3], e) - } - } - function step(r) { - r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r) - } - function fulfill(value) { - resume('next', value) - } - function reject(value) { - resume('throw', value) - } - function settle(f, v) { - if ((f(v), q.shift(), q.length)) resume(q[0][0], q[0][1]) - } - } -Object.defineProperty(exports, '__esModule', { value: true }) -exports.KeyValueTieredStoreAdapter = void 0 -const events_1 = require('events') -const keyv_1 = require('../../keyv/keyv') -class KeyValueTieredStoreAdapter extends events_1.EventEmitter { - constructor(_a) { - var { remote, local } = _a, - options = __rest(_a, ['remote', 'local']) - super() - this.opts = Object.assign({ validator: () => true, dialect: 'tiered' }, options) - // todo: since we are instantiating a new Keyv object in case we encounter a map, the key prefix applied twice, given it will be part of a an outer keyv object as well. - // Probably wise to simply create a Map Store class. As it is an in memory construct, and will work in terms of resolution it does not have highest priority - this.local = isMap(local) ? new keyv_1.Keyv(local) : local - this.remote = isMap(remote) ? new keyv_1.Keyv(remote) : remote - this.namespace = this.local.namespace - } - get(key, options) { - return __awaiter(this, void 0, void 0, function* () { - if (Array.isArray(key)) { - return yield this.getMany(key, options) - } - const localResult = yield this.local.get(key, options) - if (localResult === undefined || !this.opts.validator(localResult, key)) { - const remoteResult = yield this.remote.get(key, options) - if (remoteResult !== localResult) { - const value = !!remoteResult ? (typeof remoteResult === 'object' && 'value' in remoteResult ? remoteResult.value : remoteResult) : undefined - const ttl = - !!remoteResult && typeof remoteResult === 'object' && 'expires' in remoteResult && remoteResult.expires - ? remoteResult.expires - Date.now() - : undefined - if (!ttl || ttl > 0) { - yield this.local.set(key, value, ttl) - } else { - this.local.delete(key) - } - } - return remoteResult - } - return localResult - }) - } - getMany(keys, options) { - return __awaiter(this, void 0, void 0, function* () { - const promises = [] - for (const key of keys) { - promises.push(this.get(key, options)) - } - const values = yield Promise.all(promises) - const data = [] - for (const value of values) { - data.push(value) - } - return data - }) - } - set(key, value, ttl) { - return __awaiter(this, void 0, void 0, function* () { - const toSet = ['local', 'remote'] - return Promise.all( - toSet.map((store) => - __awaiter(this, void 0, void 0, function* () { - return this[store].set(key, value, ttl) - }) - ) - ) - }) - } - clear() { - return __awaiter(this, void 0, void 0, function* () { - const toClear = ['local'] - if (!this.opts.localOnly) { - toClear.push('remote') - } - yield Promise.all( - toClear.map((store) => - __awaiter(this, void 0, void 0, function* () { - return this[store].clear() - }) - ) - ) - return undefined - }) - } - delete(key) { - return __awaiter(this, void 0, void 0, function* () { - const toDelete = ['local'] - if (!this.opts.localOnly) { - toDelete.push('remote') - } - const deleted = yield Promise.all( - toDelete.map((store) => - __awaiter(this, void 0, void 0, function* () { - return this[store].delete(key) - }) - ) - ) - return deleted.every(Boolean) - }) - } - deleteMany(keys) { - return __awaiter(this, void 0, void 0, function* () { - const promises = [] - for (const key of keys) { - promises.push(this.delete(key)) - } - const values = yield Promise.all(promises) - return values.every(Boolean) - }) - } - has(key) { - return __awaiter(this, void 0, void 0, function* () { - let response - if (typeof this.local.has === 'function') { - response = this.local.has(key) - } else { - const value = yield this.local.get(key) - response = value !== undefined - } - if (!response || !this.opts.validator(response, key)) { - if (typeof this.remote.has === 'function') { - response = this.remote.has(key) - } else { - const value = yield this.remote.get(key) - response = value !== undefined - } - } - return response - }) - } - iterator(namespace) { - return __asyncGenerator(this, arguments, function* iterator_1() { - var _a, e_1, _b, _c - const limit = Number.parseInt(this.iterationLimit, 10) || 10 - this.remote.opts.iterationLimit = limit - if (this.remote && typeof this.remote.iterator === 'function') { - try { - for (var _d = true, _e = __asyncValues(this.remote.iterator(namespace)), _f; (_f = yield __await(_e.next())), (_a = _f.done), !_a; ) { - _c = _f.value - _d = false - try { - const entries = _c - yield yield __await(entries) - } finally { - _d = true - } - } - } catch (e_1_1) { - e_1 = { error: e_1_1 } - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e)) - } finally { - if (e_1) throw e_1.error - } - } - } - }) - } -} -exports.KeyValueTieredStoreAdapter = KeyValueTieredStoreAdapter -function isMap(map) { - if (map instanceof Map) { - return true - } else if ( - map && - typeof map.clear === 'function' && - typeof map.delete === 'function' && - typeof map.get === 'function' && - typeof map.has === 'function' && - typeof map.set === 'function' - ) { - return true - } - return false -} -//# sourceMappingURL=index.js.map diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/tiered/types.d.ts b/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/tiered/types.d.ts deleted file mode 100644 index 4c39e3f2d..000000000 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/tiered/types.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { IKeyValueStoreAdapter } from '../../key-value-types' -export type Options = { - local: IKeyValueStoreAdapter | Map - remote: IKeyValueStoreAdapter | Map - localOnly?: boolean - iterationLimit?: number | string -} -export type Options_ = { - validator: (value: any, key: string) => boolean - dialect: string - iterationLimit?: number | string - localOnly?: boolean -} -//# sourceMappingURL=types.d.ts.map diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/tiered/types.js b/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/tiered/types.js deleted file mode 100644 index 9ab487ded..000000000 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/tiered/types.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' -Object.defineProperty(exports, '__esModule', { value: true }) -//# sourceMappingURL=types.js.map diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/typeorm/entities/keyValueStoreEntity.d.ts b/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/typeorm/entities/keyValueStoreEntity.d.ts deleted file mode 100644 index 6d04e78ad..000000000 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/typeorm/entities/keyValueStoreEntity.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { BaseEntity } from 'typeorm' -/** - * - * @beta This API may change without a BREAKING CHANGE notice. - */ -export declare class KeyValueStoreEntity extends BaseEntity { - key: string - data: string - expires?: number -} -//# sourceMappingURL=keyValueStoreEntity.d.ts.map diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/typeorm/entities/keyValueStoreEntity.js b/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/typeorm/entities/keyValueStoreEntity.js deleted file mode 100644 index 2d7c75779..000000000 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/typeorm/entities/keyValueStoreEntity.js +++ /dev/null @@ -1,50 +0,0 @@ -'use strict' -var __decorate = - (this && this.__decorate) || - function (decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? (desc = Object.getOwnPropertyDescriptor(target, key)) : desc, - d - if (typeof Reflect === 'object' && typeof Reflect.decorate === 'function') r = Reflect.decorate(decorators, target, key, desc) - else - for (var i = decorators.length - 1; i >= 0; i--) if ((d = decorators[i])) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r - return c > 3 && r && Object.defineProperty(target, key, r), r - } -var __metadata = - (this && this.__metadata) || - function (k, v) { - if (typeof Reflect === 'object' && typeof Reflect.metadata === 'function') return Reflect.metadata(k, v) - } -Object.defineProperty(exports, '__esModule', { value: true }) -exports.KeyValueStoreEntity = void 0 -const typeorm_1 = require('typeorm') -/** - * - * @beta This API may change without a BREAKING CHANGE notice. - */ -let KeyValueStoreEntity = class KeyValueStoreEntity extends typeorm_1.BaseEntity {} -__decorate( - [ - (0, typeorm_1.PrimaryColumn)(), - // @ts-ignore - __metadata('design:type', String), - ], - KeyValueStoreEntity.prototype, - 'key', - void 0 -) -__decorate( - [ - (0, typeorm_1.Column)({ - type: 'text', - }), - // @ts-ignore - __metadata('design:type', String), - ], - KeyValueStoreEntity.prototype, - 'data', - void 0 -) -KeyValueStoreEntity = __decorate([(0, typeorm_1.Entity)('keyvaluestore')], KeyValueStoreEntity) -exports.KeyValueStoreEntity = KeyValueStoreEntity -//# sourceMappingURL=keyValueStoreEntity.js.map diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/typeorm/index.d.ts b/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/typeorm/index.d.ts deleted file mode 100644 index 6a0db7dda..000000000 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/typeorm/index.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -/// -import { EventEmitter } from 'events' -import { OrPromise } from '@veramo/utils' -import { DataSource } from 'typeorm' -import { KeyValueTypeORMOptions, Options_ } from './types' -import { KeyvStore, KeyvStoredData } from '../../keyv/keyv-types' -import { IKeyValueStoreAdapter } from '../../key-value-types' -export { KeyValueTypeORMOptions } from './types' -export { KeyValueStoreEntity } from './entities/keyValueStoreEntity' -export { kvStoreMigrations } from './migrations' -export declare class KeyValueTypeORMStoreAdapter extends EventEmitter implements KeyvStore, IKeyValueStoreAdapter { - private readonly dbConnection - readonly namespace: string - opts: Options_ - constructor(options: KeyValueTypeORMOptions) - get( - key: string | string[], - options?: { - raw?: boolean - } - ): Promise | Array>> - getMany( - keys: string[], - options?: { - raw?: boolean - } - ): Promise>> - set(key: string, value: string, ttl?: number): Promise> - delete(key: string | string[]): Promise - deleteMany(keys: string[]): Promise - clear(): Promise - has(key: string): Promise - disconnect(): Promise -} -/** - * Ensures that the provided DataSource is connected. - * - * @param dbConnection - a TypeORM DataSource or a Promise that resolves to a DataSource - */ -export declare function getConnectedDb(dbConnection: OrPromise): Promise -//# sourceMappingURL=index.d.ts.map diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/typeorm/index.js b/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/typeorm/index.js deleted file mode 100644 index d2e8d125a..000000000 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/typeorm/index.js +++ /dev/null @@ -1,186 +0,0 @@ -'use strict' -var __awaiter = - (this && this.__awaiter) || - function (thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P - ? value - : new P(function (resolve) { - resolve(value) - }) - } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)) - } catch (e) { - reject(e) - } - } - function rejected(value) { - try { - step(generator['throw'](value)) - } catch (e) { - reject(e) - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected) - } - step((generator = generator.apply(thisArg, _arguments || [])).next()) - }) - } -var __importDefault = - (this && this.__importDefault) || - function (mod) { - return mod && mod.__esModule ? mod : { default: mod } - } -Object.defineProperty(exports, '__esModule', { value: true }) -exports.getConnectedDb = exports.KeyValueTypeORMStoreAdapter = exports.kvStoreMigrations = exports.KeyValueStoreEntity = void 0 -const events_1 = require('events') -const typeorm_1 = require('typeorm') -const keyValueStoreEntity_1 = require('./entities/keyValueStoreEntity') -const json_buffer_1 = __importDefault(require('json-buffer')) -var keyValueStoreEntity_2 = require('./entities/keyValueStoreEntity') -Object.defineProperty(exports, 'KeyValueStoreEntity', { - enumerable: true, - get: function () { - return keyValueStoreEntity_2.KeyValueStoreEntity - }, -}) -var migrations_1 = require('./migrations') -Object.defineProperty(exports, 'kvStoreMigrations', { - enumerable: true, - get: function () { - return migrations_1.kvStoreMigrations - }, -}) -class KeyValueTypeORMStoreAdapter extends events_1.EventEmitter { - constructor(options) { - super() - this.dbConnection = options.dbConnection - this.namespace = options.namespace || 'keyv' - this.opts = Object.assign( - { validator: () => true, dialect: 'typeorm', serialize: json_buffer_1.default.stringify, deserialize: json_buffer_1.default.parse }, - options - ) - } - get(key, options) { - return __awaiter(this, void 0, void 0, function* () { - if (Array.isArray(key)) { - return this.getMany(key, options) - } - const connection = yield getConnectedDb(this.dbConnection) - const result = yield connection.getRepository(keyValueStoreEntity_1.KeyValueStoreEntity).findOneBy({ - key, - }) - return (options === null || options === void 0 ? void 0 : options.raw) !== true || !result - ? result === null || result === void 0 - ? void 0 - : result.data - : { - value: result === null || result === void 0 ? void 0 : result.data, - expires: result === null || result === void 0 ? void 0 : result.expires, - } - }) - } - getMany(keys, options) { - return __awaiter(this, void 0, void 0, function* () { - const connection = yield getConnectedDb(this.dbConnection) - const results = yield connection.getRepository(keyValueStoreEntity_1.KeyValueStoreEntity).findBy({ - key: (0, typeorm_1.In)(keys), - }) - const values = keys.map((key) => - __awaiter(this, void 0, void 0, function* () { - var _a - const result = results.find((result) => result.key === key) - return (options === null || options === void 0 ? void 0 : options.raw) !== true || !result - ? result === null || result === void 0 - ? void 0 - : result.data - : { - value: (result === null || result === void 0 ? void 0 : result.data) - ? (_a = yield this.opts.deserialize(result.data)) === null || _a === void 0 - ? void 0 - : _a.value - : undefined, - expires: result === null || result === void 0 ? void 0 : result.expires, - } - }) - ) - return Promise.all(values) - }) - } - set(key, value, ttl) { - return __awaiter(this, void 0, void 0, function* () { - const connection = yield getConnectedDb(this.dbConnection) - const entity = new keyValueStoreEntity_1.KeyValueStoreEntity() - entity.key = key - entity.data = value - entity.expires = ttl - yield connection.getRepository(keyValueStoreEntity_1.KeyValueStoreEntity).save(entity) - return { value: value, expires: ttl } - }) - } - delete(key) { - return __awaiter(this, void 0, void 0, function* () { - if (Array.isArray(key)) { - return this.deleteMany(key) - } - const connection = yield getConnectedDb(this.dbConnection) - const result = yield connection.getRepository(keyValueStoreEntity_1.KeyValueStoreEntity).delete({ key }) - return result.affected === 1 - }) - } - deleteMany(keys) { - return __awaiter(this, void 0, void 0, function* () { - const connection = yield getConnectedDb(this.dbConnection) - const results = yield connection.getRepository(keyValueStoreEntity_1.KeyValueStoreEntity).delete({ - key: (0, typeorm_1.In)(keys), - }) - return !!results.affected && results.affected >= 1 - }) - } - clear() { - return __awaiter(this, void 0, void 0, function* () { - const connection = yield getConnectedDb(this.dbConnection) - yield connection.getRepository(keyValueStoreEntity_1.KeyValueStoreEntity).delete({ - key: (0, typeorm_1.Like)(`${this.namespace}:%`), - }) - }) - } - has(key) { - return __awaiter(this, void 0, void 0, function* () { - const connection = yield getConnectedDb(this.dbConnection) - const result = yield connection.getRepository(keyValueStoreEntity_1.KeyValueStoreEntity).countBy({ - key, - }) - return result === 1 - }) - } - disconnect() { - return __awaiter(this, void 0, void 0, function* () { - const connection = yield getConnectedDb(this.dbConnection) - connection.destroy() - }) - } -} -exports.KeyValueTypeORMStoreAdapter = KeyValueTypeORMStoreAdapter -/** - * Ensures that the provided DataSource is connected. - * - * @param dbConnection - a TypeORM DataSource or a Promise that resolves to a DataSource - */ -function getConnectedDb(dbConnection) { - return __awaiter(this, void 0, void 0, function* () { - if (dbConnection instanceof Promise) { - return yield dbConnection - } else if (!dbConnection.isInitialized) { - return yield dbConnection.initialize() - } else { - return dbConnection - } - }) -} -exports.getConnectedDb = getConnectedDb -//# sourceMappingURL=index.js.map diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/1.createKVDatabase.d.ts b/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/1.createKVDatabase.d.ts deleted file mode 100644 index bbe1bc3b8..000000000 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/1.createKVDatabase.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { MigrationInterface, QueryRunner } from 'typeorm' -/** - * Create the database layout for Veramo 3.0 - * - * @public - */ -export declare class CreateKVDatabaseMigration implements MigrationInterface { - private readonly _tableName - readonly name: string - constructor(tableName?: string) - up(queryRunner: QueryRunner): Promise - down(queryRunner: QueryRunner): Promise -} -//# sourceMappingURL=1.createKVDatabase.d.ts.map diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/1.createKVDatabase.js b/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/1.createKVDatabase.js deleted file mode 100644 index 366ea1f94..000000000 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/1.createKVDatabase.js +++ /dev/null @@ -1,90 +0,0 @@ -'use strict' -var __awaiter = - (this && this.__awaiter) || - function (thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P - ? value - : new P(function (resolve) { - resolve(value) - }) - } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)) - } catch (e) { - reject(e) - } - } - function rejected(value) { - try { - step(generator['throw'](value)) - } catch (e) { - reject(e) - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected) - } - step((generator = generator.apply(thisArg, _arguments || [])).next()) - }) - } -var __importDefault = - (this && this.__importDefault) || - function (mod) { - return mod && mod.__esModule ? mod : { default: mod } - } -Object.defineProperty(exports, '__esModule', { value: true }) -exports.CreateKVDatabaseMigration = void 0 -const typeorm_1 = require('typeorm') -const debug_1 = __importDefault(require('debug')) -const debug = (0, debug_1.default)('veramo:kv-store:initial-migration') -/** - * Create the database layout for Veramo 3.0 - * - * @public - */ -class CreateKVDatabaseMigration { - constructor(tableName) { - this._tableName = tableName || 'keyvaluestore' - this.name = `CreateKVDatabase${tableName}1680297189001` - } - up(queryRunner) { - return __awaiter(this, void 0, void 0, function* () { - function getTableName(givenName) { - var _a - return ( - ((_a = queryRunner.connection.entityMetadatas.find((meta) => meta.givenTableName === givenName)) === null || _a === void 0 - ? void 0 - : _a.tableName) || givenName - ) - } - debug(`creating ${this._tableName} table`) - // CREATE TABLE "keyvaluestore" ("key" varchar PRIMARY KEY NOT NULL, "data" text NOT NULL) - yield queryRunner.createTable( - new typeorm_1.Table({ - name: getTableName(this._tableName), - columns: [ - { name: 'key', type: 'varchar', isPrimary: true }, - { name: 'data', type: 'text', isNullable: false }, - ], - indices: [ - { - columnNames: ['key'], - isUnique: true, - }, - ], - }), - true - ) - }) - } - down(queryRunner) { - return __awaiter(this, void 0, void 0, function* () { - throw new Error('illegal_operation: cannot roll back initial migration') - }) - } -} -exports.CreateKVDatabaseMigration = CreateKVDatabaseMigration -//# sourceMappingURL=1.createKVDatabase.js.map diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/index.d.ts b/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/index.d.ts deleted file mode 100644 index 34f3dde8d..000000000 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { CreateKVDatabaseMigration } from './1.createKVDatabase' -/** - * The migrations array that SHOULD be used when initializing a TypeORM database connection. - * - * These ensure the correct creation of tables and the proper migrations of data when tables change between versions. - * - * @public - */ -export declare const kvStoreMigrations: (typeof CreateKVDatabaseMigration)[] -//# sourceMappingURL=index.d.ts.map diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/index.js b/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/index.js deleted file mode 100644 index 22c67c933..000000000 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/index.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict' -Object.defineProperty(exports, '__esModule', { value: true }) -exports.kvStoreMigrations = void 0 -const _1_createKVDatabase_1 = require('./1.createKVDatabase') -/** - * The migrations array that SHOULD be used when initializing a TypeORM database connection. - * - * These ensure the correct creation of tables and the proper migrations of data when tables change between versions. - * - * @public - */ -exports.kvStoreMigrations = [_1_createKVDatabase_1.CreateKVDatabaseMigration] -//# sourceMappingURL=index.js.map diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/typeorm/types.d.ts b/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/typeorm/types.d.ts deleted file mode 100644 index 059f93cb5..000000000 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/typeorm/types.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { OrPromise } from '@veramo/utils' -import { DataSource } from 'typeorm' -import { KeyvDeserializedData } from '../../keyv/keyv-types' -export type KeyValueTypeORMOptions = { - dbConnection: OrPromise - namespace?: string -} -export type Options_ = { - validator: (value: any, key: string) => boolean - dialect: string - serialize: (data: KeyvDeserializedData) => OrPromise - /** A custom deserialization function. */ - deserialize: (data: any) => OrPromise | undefined> -} -//# sourceMappingURL=types.d.ts.map diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/typeorm/types.js b/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/typeorm/types.js deleted file mode 100644 index 9ab487ded..000000000 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/store-adapters/typeorm/types.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' -Object.defineProperty(exports, '__esModule', { value: true }) -//# sourceMappingURL=types.js.map diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/tsdoc-metadata.json b/packages/presentation-exchange/.yalc/@veramo/kv-store/build/tsdoc-metadata.json deleted file mode 100644 index 52f4aa531..000000000 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/build/tsdoc-metadata.json +++ /dev/null @@ -1,11 +0,0 @@ -// This file is read by tools that parse documentation comments conforming to the TSDoc standard. -// It should be published with your NPM package. It should not be tracked by Git. -{ - "tsdocVersion": "0.12", - "toolPackages": [ - { - "packageName": "@microsoft/api-extractor", - "packageVersion": "7.33.7" - } - ] -} diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/package.json b/packages/presentation-exchange/.yalc/@veramo/kv-store/package.json deleted file mode 100644 index c682bc18a..000000000 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "@veramo/kv-store", - "description": "Veramo Key Value Store plugin", - "version": "4.3.0", - "main": "build/index.js", - "types": "build/index.d.ts", - "scripts": { - "build": "tsc", - "test": "jest --config=../../jest.config.mjs", - "test:ci": "jest --config=../../jest.config.mjs", - "extract-api": "node ../cli/bin/veramo.js dev extract-api" - }, - "dependencies": { - "@veramo/utils": "4.3.0", - "debug": "^4.3.4", - "events": "^3.3.0", - "json-buffer": "^3.0.1", - "typeorm": "^0.3.10", - "uint8arrays": "^3.1.1" - }, - "files": [ - "build/**/*", - "src/**/*", - "README.md", - "LICENSE" - ], - "publishConfig": { - "access": "public" - }, - "repository": "git@github.com:uport-project/veramo.git", - "author": "Niels Klomp ", - "license": "Apache-2.0", - "keywords": [ - "Veramo", - "Key Value Store", - "keyv" - ], - "yalcSig": "bfd8bfc89f0050ba31664b2d7c3efc7a" -} diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/src/__tests__/keyv.test.ts b/packages/presentation-exchange/.yalc/@veramo/kv-store/src/__tests__/keyv.test.ts deleted file mode 100644 index 447e7f49f..000000000 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/src/__tests__/keyv.test.ts +++ /dev/null @@ -1,204 +0,0 @@ -import KeyvSqlite from '@keyv/sqlite' - -import timekeeper from 'timekeeper' -import { Keyv } from '../keyv/keyv' -import { DataSource } from 'typeorm' -import { KeyValueStoreEntity } from '../store-adapters/typeorm/entities/keyValueStoreEntity' -import { KeyValueTieredStoreAdapter, KeyValueTypeORMStoreAdapter } from '../store-adapters' -import { KeyvOptions } from '../keyv/keyv-types' -import { kvStoreMigrations } from '../store-adapters/typeorm/migrations' - -let dbConnection: DataSource -beforeEach(async () => { - dbConnection = await new DataSource({ - type: 'sqlite', - database: ':memory:', - logging: ['error'], - migrationsRun: true, - synchronize: false, - migrations: [...kvStoreMigrations], - entities: [KeyValueStoreEntity], - }).initialize() -}) -afterEach(async () => { - try { - if (dbConnection?.isInitialized) { - await (await dbConnection).destroy() - } - } catch (error) { - // the disconnect test will close the DB anyway - } -}) -describe('keyv MAP store', () => { - it('should respect ttl', async () => { - const store = new Map() - const keyv = new Keyv(store) - await keyv.set('key', 'value', 100) - - expect(await keyv.get('key')).toEqual('value') - timekeeper.freeze(Date.now() + 150) - expect(await keyv.get('key')).toBeUndefined() - }) - it('should work for all methods', async () => { - const store = new Map() - await testAllKeyvMethods(store) - }) -}) - -describe('keyv sqlite store', () => { - it('should respect ttl', async () => { - const keyv = new Keyv(new KeyvSqlite()) - await keyv.set('key', 'value', 100) - - expect(await keyv.get('key')).toEqual('value') - timekeeper.freeze(Date.now() + 150) - expect(await keyv.get('key')).toBeUndefined() - }) - it('should work for all methods', async () => { - const store = new KeyvSqlite() - await testAllKeyvMethods(store) - }) -}) - -describe('keyv TypeORM store', () => { - /*let dbConnection: DataSource - - beforeEach(async () => { - dbConnection = await new DataSource({ - type: 'sqlite', - database: ':memory:', - logging: 'all', - migrationsRun: true, - synchronize: false, - migrations: [...kvStoreMigrations], - entities: [KeyValueStoreEntity], - }).initialize() - }) - - afterEach(async () => { - try { - (await dbConnection).destroy() - } catch (error) { - // the disconnect test will close the DB anyway - } - - }) -*/ - it('should respect ttl', async () => { - const store = new KeyValueTypeORMStoreAdapter({ dbConnection, namespace: 'test' }) - const keyv = new Keyv(store) - await keyv.set('key', 'value', 100) - - expect(await keyv.get('key')).toEqual('value') - timekeeper.freeze(Date.now() + 150) - expect(await keyv.get('key')).toBeUndefined() - }) - - it('should set a value that can be retrieved from the proper namespace', async () => { - const store = new KeyValueTypeORMStoreAdapter({ dbConnection, namespace: 'test' }) - const keyv = new Keyv(store) - await keyv.set('key', 'value') - expect(await keyv.get('key')).toEqual('value') - - const alternateStore = new KeyValueTypeORMStoreAdapter({ dbConnection, namespace: 'another' }) - const alternateKeyv = new Keyv(alternateStore) - expect(await alternateKeyv.get('key')).toBeUndefined() - }) - - it('should set multiple values that can be retrieved', async () => { - const store = new KeyValueTypeORMStoreAdapter({ dbConnection, namespace: 'test' }) - const keyv = new Keyv(store) - for (let i = 0; i < 10; i++) { - await keyv.set(`${i}`, `value${i}`) - } - - let values = await keyv.getMany(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'nope']) - expect(values).toHaveLength(11) - - await keyv.delete('0') - expect(await keyv.getMany(['0'])).toHaveLength(1) - values = await keyv.getMany(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'nope']) - expect(values).toHaveLength(11) - expect(values[9]).toBe('value9') - expect(values[10]).toBeUndefined() - - await keyv.clear() - values = await keyv.getMany(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'nope']) - expect(values).toHaveLength(11) - expect(values[0]).toBeUndefined() - expect(values[9]).toBeUndefined() - expect(values[10]).toBeUndefined() - }) - it('should work for all methods', async () => { - const store = new KeyValueTypeORMStoreAdapter({ dbConnection, namespace: 'test-all' }) - await testAllKeyvMethods(store) - await store.disconnect() - }) -}) - -describe('keyv tiered store', () => { - it('should respect ttl', async () => { - const local: Map = new Map() - const remote = new KeyValueTypeORMStoreAdapter({ dbConnection }) - - const options: KeyvOptions = { - namespace: 'example', - store: new KeyValueTieredStoreAdapter({ local, remote }), - } - const keyv = new Keyv(undefined, options) - await keyv.set('key', 'value', 100) - - expect(await keyv.get('key')).toEqual('value') - timekeeper.freeze(Date.now() + 150) - expect(await keyv.get('key')).toBeUndefined() - await keyv.disconnect() - }) - it('should work for all methods', async () => { - const local: Map = new Map() - const remote = new KeyValueTypeORMStoreAdapter({ dbConnection }) - - const options: KeyvOptions = { - namespace: 'example', - store: new KeyValueTieredStoreAdapter({ local, remote }), - } - const store = new Keyv(undefined, options) - - // No raw match test, as remote and local have different raw values - await testAllKeyvMethods(store, false) - }) -}) - -async function testAllKeyvMethods(store: any, rawMatchTest = true) { - const keyv = new Keyv(store) - - // set value - await expect(keyv.set('key1', 'value1')).resolves.toEqual(true) - await expect(keyv.set('key2', 'value2')).resolves.toEqual(true) - - // get value by key - await expect(keyv.get('key1', { raw: false })).resolves.toEqual('value1') - await expect(keyv.get('key1', { raw: true })).resolves.toMatchObject({ value: 'value1' }) - - // get value by non-existing key - await expect(keyv.get('key3', { raw: false })).resolves.toBeUndefined() - await expect(keyv.get('key3', { raw: true })).resolves.toBeUndefined() - - // Get many as non-raw and raw - await expect(keyv.getMany(['key1', 'key2'], { raw: false })).resolves.toMatchObject(['value1', 'value2']) - if (rawMatchTest) { - await expect(keyv.getMany(['key1', 'key2'], { raw: true })).resolves.toMatchObject([{ value: 'value1' }, { value: 'value2' }]) - } - - // Check existence - await expect(keyv.has('key1')).resolves.toEqual(true) - await expect(keyv.has('key3')).resolves.toEqual(false) - - // delete key1 only - await expect(keyv.delete('key1')).resolves.toEqual(true) - await expect(keyv.has('key1')).resolves.toEqual(false) - await expect(keyv.has('key2')).resolves.toEqual(true) - - // clear - await keyv.clear() - await expect(keyv.has('key2')).resolves.toEqual(false) -} diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/src/index.ts b/packages/presentation-exchange/.yalc/@veramo/kv-store/src/index.ts deleted file mode 100644 index c72fc52ff..000000000 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/src/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Provides a {@link @veramo/kv-store#KeyValueStore} for the - * {@link @veramo/core#Agent} plugin that implements {@link @veramo/kv-store#IKeyValueStore} interface - * - * @packageDocumentation - */ -export { KeyValueStore } from './key-value-store' -export * from './store-adapters/tiered/index' -export * from './store-adapters/typeorm/index' -export * from './key-value-types' diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/src/key-value-store.ts b/packages/presentation-exchange/.yalc/@veramo/kv-store/src/key-value-store.ts deleted file mode 100644 index 8d2d3d282..000000000 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/src/key-value-store.ts +++ /dev/null @@ -1,109 +0,0 @@ -import { IKeyValueStore, IKeyValueStoreOnArgs, IKeyValueStoreOptions, IValueData } from './key-value-types' -import { Keyv } from './keyv/keyv' -import { KeyvDeserializedData, KeyvOptions, KeyvStoredData } from './keyv/keyv-types' - -/** - * Agent plugin that implements {@link @veramo/kv-store#IKeyValueStore} interface - * @public - */ -export class KeyValueStore implements IKeyValueStore { - /** - * The main keyv typescript port which delegates to the storage adapters and takes care of some common functionality - * - * @private - */ - private readonly keyv: Keyv - - constructor(options: IKeyValueStoreOptions) { - this.keyv = new Keyv(options.uri, options as KeyvOptions) - } - - async get(key: string): Promise { - const result = await this.keyv.get(key, { raw: false }) - if (result === null || result === undefined) { - return undefined - } - return result as ValueType - } - - async getAsValueData(key: string): Promise> { - const result = await this.keyv.get(key, { raw: true }) - if (result === null || result === undefined) { - // We always return a ValueData object for this method - return { value: undefined, expires: undefined } - } - return this.toDeserializedValueData(result) - } - - async getMany(keys: string[]): Promise> { - if (!keys || keys.length === 0) { - return [] - } - let result = await this.keyv.getMany(keys, { raw: false }) - - // Making sure we return the same array length as the amount of key(s) passed in - if (result === null || result === undefined || result.length === 0) { - result = new Array() - keys.forEach(() => result.push(undefined)) - } - return result.map((v) => (!!v ? (v as ValueType) : undefined)) - } - - async getManyAsValueData(keys: string[]): Promise>> { - if (!keys || keys.length === 0) { - return [] - } - let result = await this.keyv.getMany(keys, { raw: true }) - - // Making sure we return the same array length as the amount of key(s) passed in - if (result === null || result === undefined || result.length === 0) { - result = new Array>() - keys.forEach(() => result.push({ value: undefined, expires: undefined } as KeyvDeserializedData)) - } - return result.map((v) => (!!v ? this.toDeserializedValueData(v) : { value: undefined, expires: undefined })) - } - - async set(key: string, value: ValueType, ttl?: number): Promise> { - return this.keyv.set(key, value, ttl).then(() => this.getAsValueData(key)) - } - - async has(key: string): Promise { - return this.keyv.has(key) - } - - async delete(key: string): Promise { - return this.keyv.delete(key) - } - - async deleteMany(keys: string[]): Promise { - return Promise.all(keys.map((key) => this.keyv.delete(key))) - } - - async clear(): Promise> { - return this.keyv.clear().then(() => this) - } - - async disconnect(): Promise { - return this.keyv.disconnect() - } - - // Public so parties using the kv store directly can add listeners if they want - async kvStoreOn(args: IKeyValueStoreOnArgs): Promise> { - this.keyv.on(args.eventName, args.listener) - return this - } - - private toDeserializedValueData(result: any): IValueData { - if (result === null || result === undefined) { - throw Error(`Result cannot be undefined or null at this this point`) - } else if (typeof result !== 'object') { - return { value: result, expires: undefined } - } else if (!('value' in result)) { - return { value: result, expires: undefined } - } - if (!('expires' in result)) { - result.expires = undefined - } - return result as IValueData - } -} diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/src/key-value-types.ts b/packages/presentation-exchange/.yalc/@veramo/kv-store/src/key-value-types.ts deleted file mode 100644 index ddd382e90..000000000 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/src/key-value-types.ts +++ /dev/null @@ -1,97 +0,0 @@ -/** - * This is how the store will actually store the value. - * It contains an optional `expires` property, which indicates when the value would expire - */ -export interface IValueData { - value: ValueType | undefined - expires: number | undefined -} - -export interface IKeyValueStoreOnArgs { - eventName: string | symbol - listener: (...args: any[]) => void -} - -/*export interface IKeyValueStoreGetArgs { - key: string -} - -export interface IKeyValueStoreGetManyArgs { - keys: string[] -} - -export interface IKeyValueStoreHasArgs { - key: string -} - -export interface IKeyValueStoreDeleteArgs { - key: string -} - -export interface IKeyValueStoreDeleteManyArgs { - keys: string[] -} - -export interface IKeyValueStoreSetArgs { - key: string - value: ValueType - ttl?: number -}*/ - -export interface IKeyValueStoreOptions { - [key: string]: any - - /** Namespace for the current instance. */ - namespace?: string | undefined - - /** A custom serialization function. */ - /*serialize?: ((data: KeyvDeserializedData) => OrPromise) - /!** A custom deserialization function. *!/ - deserialize?: ((data: any) => OrPromise | undefined>);*/ - /** The connection string URI. */ - uri?: string | undefined - /** The storage adapter instance to be used by Keyv. or any other implementation */ - store: IKeyValueStoreAdapter | Map - /** Default TTL. Can be overridden by specifying a TTL on `.set()`. */ - ttl?: number | undefined - - /** Enable compression option **/ - /*compression?: KeyvCompressionAdapter | undefined;*/ - - emitErrors?: boolean -} - -export interface IKeyValueStoreAdapter { - namespace?: string | undefined -} - -export interface IKeyValueStore { - /** - * Get a single value by key. Can be undefined as the underlying store typically will not throw an error for a non existing key - * - * @param key Contains the key to search for - */ - get(key: string): Promise - - /** - * Get a single item as Value Data from the store. Will always return a Value Data Object, but the value in it can be undefined in case the actual store does not contain the value - * @param key Contains the key to search for - */ - getAsValueData(key: string): Promise> - - getMany(keys: string[]): Promise> - - getManyAsValueData(keys: string[]): Promise>> - - set(key: string, value: ValueType, ttl?: number): Promise> - - delete(key: string): Promise - - deleteMany(keys: string[]): Promise - - clear(): Promise> - - has(key: string): Promise - - disconnect(): Promise -} diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/src/store-adapters/tiered/index.ts b/packages/presentation-exchange/.yalc/@veramo/kv-store/src/store-adapters/tiered/index.ts deleted file mode 100644 index ef5722c15..000000000 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/src/store-adapters/tiered/index.ts +++ /dev/null @@ -1,158 +0,0 @@ -import { EventEmitter } from 'events' -import type { Options, Options_ } from './types' -import { KeyvStore, KeyvStoredData } from '../../keyv/keyv-types' -import { Keyv } from '../../keyv/keyv' -import { IKeyValueStoreAdapter } from '../../key-value-types' - -type KeyvTieredIndex = 'local' | 'remote' - -export class KeyValueTieredStoreAdapter extends EventEmitter implements KeyvStore, IKeyValueStoreAdapter { - opts: Options_ - remote: KeyvStore - local: KeyvStore - iterationLimit?: string | number - - namespace?: string | undefined - - constructor({ remote, local, ...options }: Options) { - super() - this.opts = { - validator: () => true, - dialect: 'tiered', - ...options, - } - - // todo: since we are instantiating a new Keyv object in case we encounter a map, the key prefix applied twice, given it will be part of a an outer keyv object as well. - // Probably wise to simply create a Map Store class. As it is an in memory construct, and will work in terms of resolution it does not have highest priority - this.local = (isMap(local) ? new Keyv(local as Map) : local) as KeyvStore - this.remote = (isMap(remote) ? new Keyv(remote as Map) : remote) as KeyvStore - this.namespace = this.local.namespace - } - - async get(key: string | string[], options?: { raw?: boolean }): Promise | Array>> { - if (Array.isArray(key)) { - return await this.getMany(key, options) - } - const localResult = (await this.local.get(key, options)) as KeyvStoredData - - if (localResult === undefined || !this.opts.validator(localResult, key)) { - const remoteResult = await this.remote.get(key, options) - - if (remoteResult !== localResult) { - const value = ( - !!remoteResult ? (typeof remoteResult === 'object' && 'value' in remoteResult ? remoteResult.value : remoteResult) : undefined - ) as Value - const ttl = - !!remoteResult && typeof remoteResult === 'object' && 'expires' in remoteResult && remoteResult.expires - ? remoteResult.expires - Date.now() - : undefined - if (!ttl || ttl > 0) { - await this.local.set(key, value, ttl) - } else { - this.local.delete(key) - } - } - return remoteResult - } - - return localResult - } - - async getMany(keys: string[], options?: { raw?: boolean }): Promise>> { - const promises: Array>> = [] - for (const key of keys) { - promises.push(this.get(key, options) as Promise>) - } - - const values = await Promise.all(promises) - const data: Array> | undefined = [] - for (const value of values) { - data.push(value as KeyvStoredData) - } - return data - } - - async set(key: string, value: any, ttl?: number) { - const toSet: KeyvTieredIndex[] = ['local', 'remote'] - return Promise.all(toSet.map(async (store) => this[store].set(key, value, ttl))) - } - - async clear(): Promise { - const toClear: KeyvTieredIndex[] = ['local'] - if (!this.opts.localOnly) { - toClear.push('remote') - } - - await Promise.all(toClear.map(async (store) => this[store].clear())) - - return undefined - } - - async delete(key: string): Promise { - const toDelete: KeyvTieredIndex[] = ['local'] - if (!this.opts.localOnly) { - toDelete.push('remote') - } - - const deleted = await Promise.all(toDelete.map(async (store) => this[store].delete(key))) - - return deleted.every(Boolean) - } - - async deleteMany(keys: string[]): Promise { - const promises = [] - for (const key of keys) { - promises.push(this.delete(key)) - } - - const values = await Promise.all(promises) - - return values.every(Boolean) - } - - async has(key: string): Promise { - let response - if (typeof this.local.has === 'function') { - response = this.local.has(key) - } else { - const value = await this.local.get(key) - response = value !== undefined - } - if (!response || !this.opts.validator(response, key)) { - if (typeof this.remote.has === 'function') { - response = this.remote.has(key) - } else { - const value = await this.remote.get(key) - response = value !== undefined - } - } - return response - } - - async *iterator(namespace?: string): AsyncGenerator { - const limit = Number.parseInt(this.iterationLimit as string, 10) || 10 - this.remote.opts.iterationLimit = limit - if (this.remote && typeof this.remote.iterator === 'function') { - for await (const entries of this.remote.iterator(namespace)) { - yield entries - } - } - } -} - -function isMap(map: any) { - if (map instanceof Map) { - return true - } else if ( - map && - typeof map.clear === 'function' && - typeof map.delete === 'function' && - typeof map.get === 'function' && - typeof map.has === 'function' && - typeof map.set === 'function' - ) { - return true - } - - return false -} diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/src/store-adapters/typeorm/index.ts b/packages/presentation-exchange/.yalc/@veramo/kv-store/src/store-adapters/typeorm/index.ts deleted file mode 100644 index 5d58eec7a..000000000 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/src/store-adapters/typeorm/index.ts +++ /dev/null @@ -1,122 +0,0 @@ -import { EventEmitter } from 'events' -import { OrPromise } from '@veramo/utils' -import { DataSource, In, Like } from 'typeorm' -import { KeyValueStoreEntity } from './entities/keyValueStoreEntity' -import { KeyValueTypeORMOptions, Options_ } from './types' -import { KeyvStore, KeyvStoredData } from '../../keyv/keyv-types' -import { IKeyValueStoreAdapter } from '../../key-value-types' -import JSONB from 'json-buffer' - -export { KeyValueTypeORMOptions } from './types' -export { KeyValueStoreEntity } from './entities/keyValueStoreEntity' -export { kvStoreMigrations } from './migrations' - -export class KeyValueTypeORMStoreAdapter extends EventEmitter implements KeyvStore, IKeyValueStoreAdapter { - private readonly dbConnection: OrPromise - readonly namespace: string - opts: Options_ - - constructor(options: KeyValueTypeORMOptions) { - super() - this.dbConnection = options.dbConnection - this.namespace = options.namespace || 'keyv' - this.opts = { - validator: () => true, - dialect: 'typeorm', - serialize: JSONB.stringify, - deserialize: JSONB.parse, - ...options, - } - } - - async get(key: string | string[], options?: { raw?: boolean }): Promise | Array>> { - if (Array.isArray(key)) { - return this.getMany(key, options) - } - const connection = await getConnectedDb(this.dbConnection) - const result = await connection.getRepository(KeyValueStoreEntity).findOneBy({ - key, - }) - return options?.raw !== true || !result ? result?.data : { value: result?.data, expires: result?.expires } - } - - async getMany(keys: string[], options?: { raw?: boolean }): Promise>> { - const connection = await getConnectedDb(this.dbConnection) - const results = await connection.getRepository(KeyValueStoreEntity).findBy({ - key: In(keys), - }) - const values = keys.map(async (key) => { - const result = results.find((result) => result.key === key) - return options?.raw !== true || !result - ? (result?.data as KeyvStoredData) - : ({ - value: result?.data ? (await this.opts.deserialize(result.data))?.value : undefined, - expires: result?.expires, - } as KeyvStoredData) - }) - - return Promise.all(values) - } - - async set(key: string, value: string, ttl?: number): Promise> { - const connection = await getConnectedDb(this.dbConnection) - const entity = new KeyValueStoreEntity() - entity.key = key - entity.data = value - entity.expires = ttl - await connection.getRepository(KeyValueStoreEntity).save(entity) - return { value: value, expires: ttl } - } - - async delete(key: string | string[]): Promise { - if (Array.isArray(key)) { - return this.deleteMany(key) - } - const connection = await getConnectedDb(this.dbConnection) - const result = await connection.getRepository(KeyValueStoreEntity).delete({ key }) - return result.affected === 1 - } - - async deleteMany(keys: string[]): Promise { - const connection = await getConnectedDb(this.dbConnection) - const results = await connection.getRepository(KeyValueStoreEntity).delete({ - key: In(keys), - }) - return !!results.affected && results.affected >= 1 - } - - async clear(): Promise { - const connection = await getConnectedDb(this.dbConnection) - await connection.getRepository(KeyValueStoreEntity).delete({ - key: Like(`${this.namespace}:%`), - }) - } - - async has(key: string): Promise { - const connection = await getConnectedDb(this.dbConnection) - const result = await connection.getRepository(KeyValueStoreEntity).countBy({ - key, - }) - return result === 1 - } - - async disconnect(): Promise { - const connection = await getConnectedDb(this.dbConnection) - connection.destroy() - } -} - -/** - * Ensures that the provided DataSource is connected. - * - * @param dbConnection - a TypeORM DataSource or a Promise that resolves to a DataSource - */ -export async function getConnectedDb(dbConnection: OrPromise): Promise { - if (dbConnection instanceof Promise) { - return await dbConnection - } else if (!dbConnection.isInitialized) { - return await (dbConnection).initialize() - } else { - return dbConnection - } -} diff --git a/packages/presentation-exchange/.yalc/@veramo/kv-store/yalc.sig b/packages/presentation-exchange/.yalc/@veramo/kv-store/yalc.sig deleted file mode 100644 index 44752dbc7..000000000 --- a/packages/presentation-exchange/.yalc/@veramo/kv-store/yalc.sig +++ /dev/null @@ -1 +0,0 @@ -bfd8bfc89f0050ba31664b2d7c3efc7a \ No newline at end of file diff --git a/packages/presentation-exchange/package.json b/packages/presentation-exchange/package.json index 190f1ebff..6ee0f4018 100644 --- a/packages/presentation-exchange/package.json +++ b/packages/presentation-exchange/package.json @@ -19,7 +19,7 @@ "@sphereon/ssi-types": "workspace:*", "@sphereon/ssi-sdk-ext.did-utils": "^0.12.0", "@veramo/core": "4.2.0", - "@veramo/kv-store": "file:.yalc/@veramo/kv-store" + "@sphereon/ssi-sdk.kv-store-temp": "workspace:*" }, "devDependencies": { "@types/json-buffer": "^3.0.0", diff --git a/packages/presentation-exchange/src/agent/PresentationExchange.ts b/packages/presentation-exchange/src/agent/PresentationExchange.ts index 397daa179..c853ca67f 100644 --- a/packages/presentation-exchange/src/agent/PresentationExchange.ts +++ b/packages/presentation-exchange/src/agent/PresentationExchange.ts @@ -15,7 +15,7 @@ import { import { FindCredentialsArgs, IAgentPlugin } from '@veramo/core' import { IPresentationExchange } from '../types/IPresentationExchange' -import { IKeyValueStore, IValueData, KeyValueStore } from '@veramo/kv-store' +import { IKeyValueStore, IValueData, KeyValueStore } from '@sphereon/ssi-sdk.kv-store-temp' import { Checked, IPresentationDefinition, PEX } from '@sphereon/pex' import { CredentialMapper, JWT_PROOF_TYPE_2020, W3CVerifiableCredential } from '@sphereon/ssi-types' import { InputDescriptorV1, InputDescriptorV2 } from '@sphereon/pex-models' diff --git a/packages/presentation-exchange/src/types/IPresentationExchange.ts b/packages/presentation-exchange/src/types/IPresentationExchange.ts index c4e91e2de..8ad7b5e88 100644 --- a/packages/presentation-exchange/src/types/IPresentationExchange.ts +++ b/packages/presentation-exchange/src/types/IPresentationExchange.ts @@ -9,7 +9,7 @@ import { PresentationPayload, } from '@veramo/core' import { W3CVerifiableCredential, W3CVerifiablePresentation } from '@sphereon/ssi-types' -import { IKeyValueStore, IValueData } from '@veramo/kv-store' +import { IKeyValueStore, IValueData } from '@sphereon/ssi-sdk.kv-store-temp' import { IPresentationDefinition, PEVersion, SelectResults } from '@sphereon/pex' import { Format, InputDescriptorV1, InputDescriptorV2 } from '@sphereon/pex-models' diff --git a/packages/presentation-exchange/tsconfig.json b/packages/presentation-exchange/tsconfig.json index 58ab726fa..94db6c826 100644 --- a/packages/presentation-exchange/tsconfig.json +++ b/packages/presentation-exchange/tsconfig.json @@ -15,6 +15,9 @@ }, { "path": "../agent-config" + }, + { + "path": "../kv-store" } ] } diff --git a/packages/presentation-exchange/yalc.lock b/packages/presentation-exchange/yalc.lock deleted file mode 100644 index 0d032f29f..000000000 --- a/packages/presentation-exchange/yalc.lock +++ /dev/null @@ -1,10 +0,0 @@ -{ - "version": "v1", - "packages": { - "@veramo/kv-store": { - "version": "4.3.0", - "signature": "bfd8bfc89f0050ba31664b2d7c3efc7a", - "file": true - } - } -} \ No newline at end of file diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/LICENSE b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/LICENSE deleted file mode 100644 index fd815d7f8..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2019 Consensys AG - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/README.md b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/README.md deleted file mode 100644 index a67d88026..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/README.md +++ /dev/null @@ -1,132 +0,0 @@ -# Veramo Key Value store - -A simple typed Key Value store with out of the box support for in memory/maps, sqlite and typeorm implementations for -usage in browser, NodeJS and React-Native. -It includes a tiered local/remote implementation that support all environments. - -# Usage in your application or module - -## setup - -Veramo provides 3 store adapters out of the box. The first is an in memory Map based store, the second is a TypeORM -based store, meaning we support multiple databases. Lastly there is a tiered store, which allows you to use a local and -remote store together. - -You should also be able to use store adapters from the [keyv](https://github.com/jaredwray/keyv) project. Be aware that -Veramo uses an internal fork of that project, as we have several constraints not present in the upstream project. As a -result the adapters are not guaranteed to work in your environment. -See [Keyv project relationship](#keyv-project-relationship) for more information. - -### Map based in memory store - -This is the simplest implementation where a Map is being used to store the Keys and Values - -```typescript -import { IKeyValueStore, IKeyValueStoreOptions, KeyValueStore } from '@veramo/key-value-store' - -const options: IKeyValueStoreOptions = { - namespace: 'example', - store: new Map(), -} -const kvStore: IKeyValueStore = new KeyValueStore({ options }) -``` - -### TypeORM store - -This implementation uses TypeORM using a simple entity to store the namespace prefixed key, an expiration value and the -value itself. It supports multiple database backends. - -```typescript -import { IKeyValueStore, IKeyValueStoreOptions, KeyValueStore, KeyValueStoreEntity, KeyValueTypeORMStoreAdapter } from '@veramo/key-value-store' -import { DataSource } from 'typeorm' - -const dbConnection: DataSource = await new DataSource({ - type: 'sqlite', - database: ':memory:', - logging: 'all', - migrationsRun: true, - synchronize: false, - entities: [KeyValueStoreEntity], -}).initialize() - -const options: IKeyValueStoreOptions = { - namespace: 'example', - store: new KeyValueTypeORMStoreAdapter({ dbConnection }), -} -const kvStore: IKeyValueStore = new KeyValueStore({ options }) -``` - -### Tiered store - -The tiered store expects a local store and a remote store. Obviously it makes most sense to have a memory based local -store and potentially more expensive/slower remote store - -```typescript -import { - kvStoreMigrations, - IKeyValueStore, - IKeyValueStoreOptions, - KeyValueStore, - KeyValueStoreEntity, - KeyValueTieredStoreAdapter, - KeyValueTypeORMStoreAdapter, -} from '@veramo/key-value-store' -import { DataSource } from 'typeorm' - -dbConnection = await new DataSource({ - type: 'sqlite', - database: ':memory:', - logging: 'all', - migrationsRun: true, - synchronize: false, - migrations: [...kvStoreMigrations], - entities: [KeyValueStoreEntity], -}).initialize() - -const local: Map = new Map() -const remote = new KeyValueTypeORMStoreAdapter({ dbConnection }) - -const options: IKeyValueStoreOptions = { - namespace: 'example', - store: new KeyValueTieredStoreAdapter({ local, remote }), -} -const kvStore: IKeyValueStore = new KeyValueStore({ options }) -``` - -## Usage - -After you have setup the Key Value Store as described above in your agent, it will be available in your agent. - -```typescript -kvStore.set('hello', { example: world }) // Stores the value object by key untill deleted -kvStore.set('expiring', { example: 'expiration' }, 1000) // Stores the value object by key for 1 second -const value = await kvStore.get('hello') // { example: world } -const values = await kvStore.getMany(['hello', 'expiring']) // [{ example: world }, {example: expiring}] - -if (await kvStore.has('hello')) { - await kvStore.delete('hello') // return a boolean for success. You can also call it on non existing keys, which will return false -} - -await kvStore.clear() // Removes all keys/values from the store -kvStore.disconnect() // disconnects the store from it backing adapter. You cannot reuse the store afterwards unlesss you initialize a new store. -``` - -# Keyv project relationship - -Please note that a large portion of the Veramo Key Value Store code is a port of -the [keyv](https://github.com/jaredwray/keyv) project, adding support for Typescript and ESM, so it can be used Veramo - -The ported code should support the storage plugins available for the keyv project, although testing has been limited -Veramo itself has a requirement to support NodeJS, Browser and React-Native environments. The port and the store -adapters included in Veramo run in these environments. -Please be aware that these requirements probably aren't true for any keyv storage plugins. - -One of the big changes compared to the upstream project is that this port does not have dynamic loading of adapters -based on URIs. We believe that any Veramo Key Value store should use explicit defined adapters. - -The keyv port is part of the Veramo Key Value Store module code itself, as we do not want to make an official maintained port at this point. - -Veramo exposes its own API/interfaces for the Key Value store, meaning we could also support any other implementation in -the future - -We welcome any new storage modules diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/index.d.ts b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/index.d.ts deleted file mode 100644 index 100b7cb44..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/index.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Provides a {@link @veramo/kv-store#KeyValueStore} for the - * {@link @veramo/core#Agent} plugin that implements {@link @veramo/kv-store#IKeyValueStore} interface - * - * @packageDocumentation - */ -export { KeyValueStore } from './key-value-store' -export * from './store-adapters/tiered/index' -export * from './store-adapters/typeorm/index' -export * from './key-value-types' -//# sourceMappingURL=index.d.ts.map diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/index.js b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/index.js deleted file mode 100644 index 5ec5ef502..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/index.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict' -var __createBinding = - (this && this.__createBinding) || - (Object.create - ? function (o, m, k, k2) { - if (k2 === undefined) k2 = k - var desc = Object.getOwnPropertyDescriptor(m, k) - if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { - enumerable: true, - get: function () { - return m[k] - }, - } - } - Object.defineProperty(o, k2, desc) - } - : function (o, m, k, k2) { - if (k2 === undefined) k2 = k - o[k2] = m[k] - }) -var __exportStar = - (this && this.__exportStar) || - function (m, exports) { - for (var p in m) if (p !== 'default' && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p) - } -Object.defineProperty(exports, '__esModule', { value: true }) -exports.KeyValueStore = void 0 -/** - * Provides a {@link @veramo/kv-store#KeyValueStore} for the - * {@link @veramo/core#Agent} plugin that implements {@link @veramo/kv-store#IKeyValueStore} interface - * - * @packageDocumentation - */ -var key_value_store_1 = require('./key-value-store') -Object.defineProperty(exports, 'KeyValueStore', { - enumerable: true, - get: function () { - return key_value_store_1.KeyValueStore - }, -}) -__exportStar(require('./store-adapters/tiered/index'), exports) -__exportStar(require('./store-adapters/typeorm/index'), exports) -__exportStar(require('./key-value-types'), exports) -//# sourceMappingURL=index.js.map diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/key-value-store.d.ts b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/key-value-store.d.ts deleted file mode 100644 index 14805470b..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/key-value-store.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { IKeyValueStore, IKeyValueStoreOnArgs, IKeyValueStoreOptions, IValueData } from './key-value-types' -/** - * Agent plugin that implements {@link @veramo/kv-store#IKeyValueStore} interface - * @public - */ -export declare class KeyValueStore implements IKeyValueStore { - /** - * The main keyv typescript port which delegates to the storage adapters and takes care of some common functionality - * - * @private - */ - private readonly keyv - constructor(options: IKeyValueStoreOptions) - get(key: string): Promise - getAsValueData(key: string): Promise> - getMany(keys: string[]): Promise> - getManyAsValueData(keys: string[]): Promise>> - set(key: string, value: ValueType, ttl?: number): Promise> - has(key: string): Promise - delete(key: string): Promise - deleteMany(keys: string[]): Promise - clear(): Promise> - disconnect(): Promise - kvStoreOn(args: IKeyValueStoreOnArgs): Promise> - private toDeserializedValueData -} -//# sourceMappingURL=key-value-store.d.ts.map diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/key-value-store.js b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/key-value-store.js deleted file mode 100644 index dc8796972..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/key-value-store.js +++ /dev/null @@ -1,143 +0,0 @@ -'use strict' -var __awaiter = - (this && this.__awaiter) || - function (thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P - ? value - : new P(function (resolve) { - resolve(value) - }) - } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)) - } catch (e) { - reject(e) - } - } - function rejected(value) { - try { - step(generator['throw'](value)) - } catch (e) { - reject(e) - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected) - } - step((generator = generator.apply(thisArg, _arguments || [])).next()) - }) - } -Object.defineProperty(exports, '__esModule', { value: true }) -exports.KeyValueStore = void 0 -const keyv_1 = require('./keyv/keyv') -/** - * Agent plugin that implements {@link @veramo/kv-store#IKeyValueStore} interface - * @public - */ -class KeyValueStore { - constructor(options) { - this.keyv = new keyv_1.Keyv(options.uri, options) - } - get(key) { - return __awaiter(this, void 0, void 0, function* () { - const result = yield this.keyv.get(key, { raw: false }) - if (result === null || result === undefined) { - return undefined - } - return result - }) - } - getAsValueData(key) { - return __awaiter(this, void 0, void 0, function* () { - const result = yield this.keyv.get(key, { raw: true }) - if (result === null || result === undefined) { - // We always return a ValueData object for this method - return { value: undefined, expires: undefined } - } - return this.toDeserializedValueData(result) - }) - } - getMany(keys) { - return __awaiter(this, void 0, void 0, function* () { - if (!keys || keys.length === 0) { - return [] - } - let result = yield this.keyv.getMany(keys, { raw: false }) - // Making sure we return the same array length as the amount of key(s) passed in - if (result === null || result === undefined || result.length === 0) { - result = new Array() - keys.forEach(() => result.push(undefined)) - } - return result.map((v) => (!!v ? v : undefined)) - }) - } - getManyAsValueData(keys) { - return __awaiter(this, void 0, void 0, function* () { - if (!keys || keys.length === 0) { - return [] - } - let result = yield this.keyv.getMany(keys, { raw: true }) - // Making sure we return the same array length as the amount of key(s) passed in - if (result === null || result === undefined || result.length === 0) { - result = new Array() - keys.forEach(() => result.push({ value: undefined, expires: undefined })) - } - return result.map((v) => (!!v ? this.toDeserializedValueData(v) : { value: undefined, expires: undefined })) - }) - } - set(key, value, ttl) { - return __awaiter(this, void 0, void 0, function* () { - return this.keyv.set(key, value, ttl).then(() => this.getAsValueData(key)) - }) - } - has(key) { - return __awaiter(this, void 0, void 0, function* () { - return this.keyv.has(key) - }) - } - delete(key) { - return __awaiter(this, void 0, void 0, function* () { - return this.keyv.delete(key) - }) - } - deleteMany(keys) { - return __awaiter(this, void 0, void 0, function* () { - return Promise.all(keys.map((key) => this.keyv.delete(key))) - }) - } - clear() { - return __awaiter(this, void 0, void 0, function* () { - return this.keyv.clear().then(() => this) - }) - } - disconnect() { - return __awaiter(this, void 0, void 0, function* () { - return this.keyv.disconnect() - }) - } - // Public so parties using the kv store directly can add listeners if they want - kvStoreOn(args) { - return __awaiter(this, void 0, void 0, function* () { - this.keyv.on(args.eventName, args.listener) - return this - }) - } - toDeserializedValueData(result) { - if (result === null || result === undefined) { - throw Error(`Result cannot be undefined or null at this this point`) - } else if (typeof result !== 'object') { - return { value: result, expires: undefined } - } else if (!('value' in result)) { - return { value: result, expires: undefined } - } - if (!('expires' in result)) { - result.expires = undefined - } - return result - } -} -exports.KeyValueStore = KeyValueStore -//# sourceMappingURL=key-value-store.js.map diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/key-value-types.d.ts b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/key-value-types.d.ts deleted file mode 100644 index eeffd56c4..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/key-value-types.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -/** - * This is how the store will actually store the value. - * It contains an optional `expires` property, which indicates when the value would expire - */ -export interface IValueData { - value: ValueType | undefined - expires: number | undefined -} -export interface IKeyValueStoreOnArgs { - eventName: string | symbol - listener: (...args: any[]) => void -} -export interface IKeyValueStoreOptions { - [key: string]: any - /** Namespace for the current instance. */ - namespace?: string | undefined - /** A custom serialization function. */ - /** The connection string URI. */ - uri?: string | undefined - /** The storage adapter instance to be used by Keyv. or any other implementation */ - store: IKeyValueStoreAdapter | Map - /** Default TTL. Can be overridden by specifying a TTL on `.set()`. */ - ttl?: number | undefined - /** Enable compression option **/ - emitErrors?: boolean -} -export interface IKeyValueStoreAdapter { - namespace?: string | undefined -} -export interface IKeyValueStore { - /** - * Get a single value by key. Can be undefined as the underlying store typically will not throw an error for a non existing key - * - * @param key Contains the key to search for - */ - get(key: string): Promise - /** - * Get a single item as Value Data from the store. Will always return a Value Data Object, but the value in it can be undefined in case the actual store does not contain the value - * @param key Contains the key to search for - */ - getAsValueData(key: string): Promise> - getMany(keys: string[]): Promise> - getManyAsValueData(keys: string[]): Promise>> - set(key: string, value: ValueType, ttl?: number): Promise> - delete(key: string): Promise - deleteMany(keys: string[]): Promise - clear(): Promise> - has(key: string): Promise - disconnect(): Promise -} -//# sourceMappingURL=key-value-types.d.ts.map diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/key-value-types.js b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/key-value-types.js deleted file mode 100644 index b18e238d9..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/key-value-types.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' -Object.defineProperty(exports, '__esModule', { value: true }) -//# sourceMappingURL=key-value-types.js.map diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/keyv/keyv-types.d.ts b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/keyv/keyv-types.d.ts deleted file mode 100644 index 2cc77cad0..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/keyv/keyv-types.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Please be aware these types are compatible with the keyv package, to ensure we can use its store-adapters for free. - * - * Be very careful when extending/changing!. Normally you will want to create an adapter or decorator for your additional behaviour or requirements - */ -import { OrPromise } from '@veramo/utils' -export interface KeyvOptions { - [key: string]: any - /** Namespace for the current instance. */ - namespace?: string | undefined - /** A custom serialization function. */ - serialize?: (data: KeyvDeserializedData) => OrPromise - /** A custom deserialization function. */ - deserialize?: (data: any) => OrPromise | undefined> - /** The connection string URI. */ - uri?: string | undefined - /** The storage adapter instance to be used by Keyv. */ - store?: KeyvStore | undefined - /** Default TTL. Can be overridden by specififying a TTL on `.set()`. */ - ttl?: number | undefined - /** Specify an adapter to use. e.g `'redis'` or `'mongodb'`. */ - adapter?: 'redis' | 'mongodb' | 'mongo' | 'sqlite' | 'postgresql' | 'postgres' | 'mysql' | object | string | undefined - /** Enable compression option **/ - compression?: KeyvCompressionAdapter | undefined - emitErrors?: boolean -} -export interface KeyvCompressionAdapter { - compress(value: any, options?: any): OrPromise - decompress(value: any, options?: any): OrPromise - serialize(value: any): OrPromise - deserialize(value: any): OrPromise -} -export interface KeyvDeserializedData { - value: Value - expires: number | undefined -} -export type KeyvStoredData = KeyvDeserializedData | string | Value | undefined -export interface KeyvStore { - namespace?: string | undefined - opts: KeyvOptions - on?(eventName: string | symbol, listener: (...args: any[]) => void): void - get( - key: string | string[], - options?: { - raw?: boolean - } - ): OrPromise | Array>> - getMany?( - keys: string[], - options?: { - raw?: boolean - } - ): OrPromise>> | undefined - iterator?(namespace?: string | undefined): AsyncGenerator - set(key: string, value: Value, ttl?: number): any - delete(key: string | string[]): OrPromise - deleteMany?(keys: string[]): OrPromise - clear(): OrPromise - has?(key: string): OrPromise - disconnect?(): void -} -//# sourceMappingURL=keyv-types.d.ts.map diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/keyv/keyv-types.js b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/keyv/keyv-types.js deleted file mode 100644 index 305adbbfd..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/keyv/keyv-types.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' -Object.defineProperty(exports, '__esModule', { value: true }) -//# sourceMappingURL=keyv-types.js.map diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/keyv/keyv.d.ts b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/keyv/keyv.d.ts deleted file mode 100644 index d7673e575..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/keyv/keyv.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -/// -import { EventEmitter } from 'events' -import { KeyvDeserializedData, KeyvOptions, KeyvStore, KeyvStoredData } from './keyv-types' -/** - * Please note that this is code adapted from @link https://github.com/jaredwray/keyv to support Typescript and ESM in Veramo - * - * The code should support the storage plugins available for the keyv project. - * Veramo itself supports NodeJS, Browser and React-Native environment. - * Please be aware that these requirements probably aren't true for any keyv storage plugins. - * - * 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. - * We believe that any Veramo Key Value store should use explicitly defined store-adapters. - * - * 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. - * Veramo exposes its own API/interfaces for the Key Value store, meaning we could also support any other implementation in the future - * - * The Veramo kv-store module provides out of the box support for in memory/maps, sqlite and typeorm implementations, - * including a tiered local/remote implementation that support all environments. - * - * We welcome any new storage modules - */ -export declare class Keyv extends EventEmitter implements KeyvStore { - readonly opts: KeyvOptions - readonly namespace: string - iterator?: (namespace?: string) => AsyncGenerator - constructor(uri?: string | Map | KeyvStore | undefined, options?: KeyvOptions) - get store(): Required> - get deserialize(): (data: any) => import('@veramo/utils').OrPromise | undefined> - get serialize(): (data: KeyvDeserializedData) => import('@veramo/utils').OrPromise - _checkIterableAdapter(): any - _getKeyPrefix(key: string): string - _getKeyPrefixArray(keys: string[]): string[] - _getKeyUnprefix(key: string): string - getMany( - keys: string[], - options?: { - raw?: boolean - } - ): Promise>> - get( - key: string | string[], - options?: { - raw?: boolean - } - ): Promise | KeyvStoredData[] | undefined> - private isExpired - set(key: string, value: Value, ttl?: number): Promise - delete(key: string | string[]): Promise - clear(): Promise - has(key: string): Promise - disconnect(): void -} -//# sourceMappingURL=keyv.d.ts.map diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/keyv/keyv.js b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/keyv/keyv.js deleted file mode 100644 index 5620d367a..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/keyv/keyv.js +++ /dev/null @@ -1,385 +0,0 @@ -'use strict' -var __awaiter = - (this && this.__awaiter) || - function (thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P - ? value - : new P(function (resolve) { - resolve(value) - }) - } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)) - } catch (e) { - reject(e) - } - } - function rejected(value) { - try { - step(generator['throw'](value)) - } catch (e) { - reject(e) - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected) - } - step((generator = generator.apply(thisArg, _arguments || [])).next()) - }) - } -var __asyncValues = - (this && this.__asyncValues) || - function (o) { - if (!Symbol.asyncIterator) throw new TypeError('Symbol.asyncIterator is not defined.') - var m = o[Symbol.asyncIterator], - i - return m - ? m.call(o) - : ((o = typeof __values === 'function' ? __values(o) : o[Symbol.iterator]()), - (i = {}), - verb('next'), - verb('throw'), - verb('return'), - (i[Symbol.asyncIterator] = function () { - return this - }), - i) - function verb(n) { - i[n] = - o[n] && - function (v) { - return new Promise(function (resolve, reject) { - ;(v = o[n](v)), settle(resolve, reject, v.done, v.value) - }) - } - } - function settle(resolve, reject, d, v) { - Promise.resolve(v).then(function (v) { - resolve({ value: v, done: d }) - }, reject) - } - } -var __await = - (this && this.__await) || - function (v) { - return this instanceof __await ? ((this.v = v), this) : new __await(v) - } -var __asyncGenerator = - (this && this.__asyncGenerator) || - function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError('Symbol.asyncIterator is not defined.') - var g = generator.apply(thisArg, _arguments || []), - i, - q = [] - return ( - (i = {}), - verb('next'), - verb('throw'), - verb('return'), - (i[Symbol.asyncIterator] = function () { - return this - }), - i - ) - function verb(n) { - if (g[n]) - i[n] = function (v) { - return new Promise(function (a, b) { - q.push([n, v, a, b]) > 1 || resume(n, v) - }) - } - } - function resume(n, v) { - try { - step(g[n](v)) - } catch (e) { - settle(q[0][3], e) - } - } - function step(r) { - r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r) - } - function fulfill(value) { - resume('next', value) - } - function reject(value) { - resume('throw', value) - } - function settle(f, v) { - if ((f(v), q.shift(), q.length)) resume(q[0][0], q[0][1]) - } - } -var __importDefault = - (this && this.__importDefault) || - function (mod) { - return mod && mod.__esModule ? mod : { default: mod } - } -Object.defineProperty(exports, '__esModule', { value: true }) -exports.Keyv = void 0 -const events_1 = require('events') -const json_buffer_1 = __importDefault(require('json-buffer')) -/** - * Please note that this is code adapted from @link https://github.com/jaredwray/keyv to support Typescript and ESM in Veramo - * - * The code should support the storage plugins available for the keyv project. - * Veramo itself supports NodeJS, Browser and React-Native environment. - * Please be aware that these requirements probably aren't true for any keyv storage plugins. - * - * 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. - * We believe that any Veramo Key Value store should use explicitly defined store-adapters. - * - * 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. - * Veramo exposes its own API/interfaces for the Key Value store, meaning we could also support any other implementation in the future - * - * The Veramo kv-store module provides out of the box support for in memory/maps, sqlite and typeorm implementations, - * including a tiered local/remote implementation that support all environments. - * - * We welcome any new storage modules - */ -class Keyv extends events_1.EventEmitter { - constructor(uri, options) { - super() - const emitErrors = (options === null || options === void 0 ? void 0 : options.emitErrors) === undefined ? true : options.emitErrors - uri = uri !== null && uri !== void 0 ? uri : options === null || options === void 0 ? void 0 : options.uri - /*if (!uri) { - throw Error('No URI provided') - }*/ - this.opts = Object.assign( - Object.assign( - { namespace: 'keyv', serialize: json_buffer_1.default.stringify, deserialize: json_buffer_1.default.parse }, - typeof uri === 'string' ? { uri } : uri - ), - options - ) - if (!this.opts.store) { - if (typeof uri !== 'string') { - this.opts.store = uri - } /* else { - const adapterOptions = { ...this.opts } - this.opts.store = loadStore(adapterOptions) - }*/ - } - if (!this.opts.store) { - throw Error('No store') - } - if (this.opts.compression) { - const compression = this.opts.compression - this.opts.serialize = compression.serialize.bind(compression) - this.opts.deserialize = compression.deserialize.bind(compression) - } - if (typeof this.opts.store.on === 'function' && emitErrors) { - this.opts.store.on('error', (error) => this.emit('error', error)) - } - this.opts.store.namespace = this.opts.namespace || 'keyv' - this.namespace = this.opts.store.namespace - const generateIterator = (iterator, keyv) => - function () { - return __asyncGenerator(this, arguments, function* () { - var _a, e_1, _b, _c - try { - for ( - var _d = true, _e = __asyncValues(typeof iterator === 'function' ? iterator(keyv.store.namespace) : iterator), _f; - (_f = yield __await(_e.next())), (_a = _f.done), !_a; - - ) { - _c = _f.value - _d = false - try { - const [key, raw] = _c - const data = yield __await(keyv.deserialize(raw)) - if (keyv.store.namespace && !key.includes(keyv.store.namespace)) { - continue - } - if (data && typeof data.expires === 'number' && Date.now() > data.expires) { - keyv.delete(key) - continue - } - yield yield __await([keyv._getKeyUnprefix(key), data === null || data === void 0 ? void 0 : data.value]) - } finally { - _d = true - } - } - } catch (e_1_1) { - e_1 = { error: e_1_1 } - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e)) - } finally { - if (e_1) throw e_1.error - } - } - }) - } - // Attach iterators - // @ts-ignore - if (typeof this.store[Symbol.iterator] === 'function' && this.store instanceof Map) { - this.iterator = generateIterator(this.store, this) - } else if (typeof this.store.iterator === 'function' && this.store.opts && this._checkIterableAdapter()) { - this.iterator = generateIterator(this.store.iterator.bind(this.store), this) - } - } - get store() { - return this.opts.store - } - get deserialize() { - return this.opts.deserialize - } - get serialize() { - return this.opts.serialize - } - _checkIterableAdapter() { - return ( - (this.store.opts.dialect && iterableAdapters.includes(this.store.opts.dialect)) || - (this.store.opts.url && iterableAdapters.findIndex((element) => this.store.opts.url.includes(element)) >= 0) - ) - } - _getKeyPrefix(key) { - return `${this.opts.namespace}:${key}` - } - _getKeyPrefixArray(keys) { - return keys.map((key) => this._getKeyPrefix(key)) - } - _getKeyUnprefix(key) { - return key.split(':').splice(1).join(':') - } - getMany(keys, options) { - return __awaiter(this, void 0, void 0, function* () { - const keyPrefixed = this._getKeyPrefixArray(keys) - let promise - if (this.store.getMany !== undefined) { - promise = this.store.getMany(keyPrefixed, options) //.then(value => !!value ? value.values() : undefined) - // todo: Probably wise to check expired ValueData here, if the getMany does not implement this feature itself! - } else { - promise = Promise.all(keyPrefixed.map((k) => this.store.get(k, options))) - } - const allValues = Promise.resolve(promise) - const results = [] - return Promise.resolve(allValues) - .then((all) => { - keys.forEach((key, index) => { - const data = all[index] - let result = typeof data === 'string' ? this.deserialize(data) : !!data && this.opts.compression ? this.deserialize(data) : data - if (result && typeof result === 'object' && 'expires' in result && typeof result.expires === 'number' && Date.now() > result.expires) { - this.delete(key) - result = undefined - } - const final = options && options.raw ? result : result && typeof result === 'object' && 'value' in result ? result.value : result - results.push(final) - }) - }) - .then(() => Promise.all(results)) - }) - } - get(key, options) { - return __awaiter(this, void 0, void 0, function* () { - const isArray = Array.isArray(key) - return Promise.resolve() - .then(() => (isArray ? this.getMany(this._getKeyPrefixArray(key), options) : this.store.get(this._getKeyPrefix(key)))) - .then((data) => (typeof data === 'string' ? this.deserialize(data) : this.opts.compression ? this.deserialize(data) : data)) - .then((data) => { - if (data === undefined || data === null) { - return undefined - } - const rows = Array.isArray(data) ? data : [data] - if (isArray) { - const result = [] - for (let row of rows) { - if (row === undefined || row === null) { - result.push(undefined) - continue - } - if (this.isExpired(row)) { - this.delete(key).then(() => undefined) - result.push(undefined) - } else { - result.push(options && options.raw ? row : toValue(row)) - } - } - return result - } else if (!Array.isArray(data)) { - if (this.isExpired(data)) { - return this.delete(key).then(() => undefined) - } - } - return options && options.raw ? data : Array.isArray(data) ? data.map((d) => toValue(d)) : toValue(data) - }) - }) - } - isExpired(data) { - return ( - typeof data !== 'string' && - data && - typeof data === 'object' && - 'expires' in data && - typeof data.expires === 'number' && - Date.now() > data.expires - ) - } - set(key, value, ttl) { - const keyPrefixed = this._getKeyPrefix(key) - if (typeof ttl === 'undefined') { - ttl = this.opts.ttl - } - if (ttl === 0) { - ttl = undefined - } - // @ts-ignore - return Promise.resolve() - .then(() => { - const expires = typeof ttl === 'number' ? Date.now() + ttl : undefined - if (typeof value === 'symbol') { - this.emit('error', 'symbol cannot be serialized') - } - const input = { value, expires } - return this.serialize(input) - }) - .then((value) => this.store.set(keyPrefixed, value, ttl)) - .then(() => true) - } - delete(key) { - if (!Array.isArray(key)) { - const keyPrefixed = this._getKeyPrefix(key) - return Promise.resolve().then(() => this.store.delete(keyPrefixed)) - } - const keyPrefixed = this._getKeyPrefixArray(key) - if (this.store.deleteMany !== undefined) { - return Promise.resolve().then(() => this.store.deleteMany(keyPrefixed)) - } - const promises = [] - for (const key of keyPrefixed) { - promises.push(this.store.delete(key)) - } - return Promise.allSettled(promises).then((values) => values.every((x) => x.valueOf() === true)) - } - clear() { - return __awaiter(this, void 0, void 0, function* () { - return Promise.resolve().then(() => this.store.clear()) - }) - } - has(key) { - const keyPrefixed = this._getKeyPrefix(key) - return Promise.resolve().then(() => - __awaiter(this, void 0, void 0, function* () { - if (typeof this.store.has === 'function') { - return this.store.has(keyPrefixed) - } - const value = yield this.store.get(keyPrefixed) - return value !== undefined - }) - ) - } - disconnect() { - if (typeof this.store.disconnect === 'function') { - return this.store.disconnect() - } - } -} -exports.Keyv = Keyv -const iterableAdapters = ['sqlite', 'postgres', 'mysql', 'mongo', 'redis', 'tiered'] -function toValue(input) { - return input !== null && typeof input === 'object' && 'value' in input ? input.value : input -} -//# sourceMappingURL=keyv.js.map diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/index.d.ts b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/index.d.ts deleted file mode 100644 index 9c83d9e66..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './tiered/index' -export * from './typeorm/index' -//# sourceMappingURL=index.d.ts.map diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/index.js b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/index.js deleted file mode 100644 index 6b3e45398..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/index.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict' -var __createBinding = - (this && this.__createBinding) || - (Object.create - ? function (o, m, k, k2) { - if (k2 === undefined) k2 = k - var desc = Object.getOwnPropertyDescriptor(m, k) - if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { - enumerable: true, - get: function () { - return m[k] - }, - } - } - Object.defineProperty(o, k2, desc) - } - : function (o, m, k, k2) { - if (k2 === undefined) k2 = k - o[k2] = m[k] - }) -var __exportStar = - (this && this.__exportStar) || - function (m, exports) { - for (var p in m) if (p !== 'default' && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p) - } -Object.defineProperty(exports, '__esModule', { value: true }) -__exportStar(require('./tiered/index'), exports) -__exportStar(require('./typeorm/index'), exports) -//# sourceMappingURL=index.js.map diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/tiered/index.d.ts b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/tiered/index.d.ts deleted file mode 100644 index 21d2d2461..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/tiered/index.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -/// -import { EventEmitter } from 'events' -import type { Options, Options_ } from './types' -import { KeyvStore, KeyvStoredData } from '../../keyv/keyv-types' -import { IKeyValueStoreAdapter } from '../../key-value-types' -export declare class KeyValueTieredStoreAdapter extends EventEmitter implements KeyvStore, IKeyValueStoreAdapter { - opts: Options_ - remote: KeyvStore - local: KeyvStore - iterationLimit?: string | number - namespace?: string | undefined - constructor({ remote, local, ...options }: Options) - get( - key: string | string[], - options?: { - raw?: boolean - } - ): Promise | Array>> - getMany( - keys: string[], - options?: { - raw?: boolean - } - ): Promise>> - set(key: string, value: any, ttl?: number): Promise - clear(): Promise - delete(key: string): Promise - deleteMany(keys: string[]): Promise - has(key: string): Promise - iterator(namespace?: string): AsyncGenerator -} -//# sourceMappingURL=index.d.ts.map diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/tiered/index.js b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/tiered/index.js deleted file mode 100644 index efb1be79f..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/tiered/index.js +++ /dev/null @@ -1,301 +0,0 @@ -'use strict' -var __awaiter = - (this && this.__awaiter) || - function (thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P - ? value - : new P(function (resolve) { - resolve(value) - }) - } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)) - } catch (e) { - reject(e) - } - } - function rejected(value) { - try { - step(generator['throw'](value)) - } catch (e) { - reject(e) - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected) - } - step((generator = generator.apply(thisArg, _arguments || [])).next()) - }) - } -var __rest = - (this && this.__rest) || - function (s, e) { - var t = {} - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p] - if (s != null && typeof Object.getOwnPropertySymbols === 'function') - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]] - } - return t - } -var __asyncValues = - (this && this.__asyncValues) || - function (o) { - if (!Symbol.asyncIterator) throw new TypeError('Symbol.asyncIterator is not defined.') - var m = o[Symbol.asyncIterator], - i - return m - ? m.call(o) - : ((o = typeof __values === 'function' ? __values(o) : o[Symbol.iterator]()), - (i = {}), - verb('next'), - verb('throw'), - verb('return'), - (i[Symbol.asyncIterator] = function () { - return this - }), - i) - function verb(n) { - i[n] = - o[n] && - function (v) { - return new Promise(function (resolve, reject) { - ;(v = o[n](v)), settle(resolve, reject, v.done, v.value) - }) - } - } - function settle(resolve, reject, d, v) { - Promise.resolve(v).then(function (v) { - resolve({ value: v, done: d }) - }, reject) - } - } -var __await = - (this && this.__await) || - function (v) { - return this instanceof __await ? ((this.v = v), this) : new __await(v) - } -var __asyncGenerator = - (this && this.__asyncGenerator) || - function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError('Symbol.asyncIterator is not defined.') - var g = generator.apply(thisArg, _arguments || []), - i, - q = [] - return ( - (i = {}), - verb('next'), - verb('throw'), - verb('return'), - (i[Symbol.asyncIterator] = function () { - return this - }), - i - ) - function verb(n) { - if (g[n]) - i[n] = function (v) { - return new Promise(function (a, b) { - q.push([n, v, a, b]) > 1 || resume(n, v) - }) - } - } - function resume(n, v) { - try { - step(g[n](v)) - } catch (e) { - settle(q[0][3], e) - } - } - function step(r) { - r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r) - } - function fulfill(value) { - resume('next', value) - } - function reject(value) { - resume('throw', value) - } - function settle(f, v) { - if ((f(v), q.shift(), q.length)) resume(q[0][0], q[0][1]) - } - } -Object.defineProperty(exports, '__esModule', { value: true }) -exports.KeyValueTieredStoreAdapter = void 0 -const events_1 = require('events') -const keyv_1 = require('../../keyv/keyv') -class KeyValueTieredStoreAdapter extends events_1.EventEmitter { - constructor(_a) { - var { remote, local } = _a, - options = __rest(_a, ['remote', 'local']) - super() - this.opts = Object.assign({ validator: () => true, dialect: 'tiered' }, options) - // todo: since we are instantiating a new Keyv object in case we encounter a map, the key prefix applied twice, given it will be part of a an outer keyv object as well. - // Probably wise to simply create a Map Store class. As it is an in memory construct, and will work in terms of resolution it does not have highest priority - this.local = isMap(local) ? new keyv_1.Keyv(local) : local - this.remote = isMap(remote) ? new keyv_1.Keyv(remote) : remote - this.namespace = this.local.namespace - } - get(key, options) { - return __awaiter(this, void 0, void 0, function* () { - if (Array.isArray(key)) { - return yield this.getMany(key, options) - } - const localResult = yield this.local.get(key, options) - if (localResult === undefined || !this.opts.validator(localResult, key)) { - const remoteResult = yield this.remote.get(key, options) - if (remoteResult !== localResult) { - const value = !!remoteResult ? (typeof remoteResult === 'object' && 'value' in remoteResult ? remoteResult.value : remoteResult) : undefined - const ttl = - !!remoteResult && typeof remoteResult === 'object' && 'expires' in remoteResult && remoteResult.expires - ? remoteResult.expires - Date.now() - : undefined - if (!ttl || ttl > 0) { - yield this.local.set(key, value, ttl) - } else { - this.local.delete(key) - } - } - return remoteResult - } - return localResult - }) - } - getMany(keys, options) { - return __awaiter(this, void 0, void 0, function* () { - const promises = [] - for (const key of keys) { - promises.push(this.get(key, options)) - } - const values = yield Promise.all(promises) - const data = [] - for (const value of values) { - data.push(value) - } - return data - }) - } - set(key, value, ttl) { - return __awaiter(this, void 0, void 0, function* () { - const toSet = ['local', 'remote'] - return Promise.all( - toSet.map((store) => - __awaiter(this, void 0, void 0, function* () { - return this[store].set(key, value, ttl) - }) - ) - ) - }) - } - clear() { - return __awaiter(this, void 0, void 0, function* () { - const toClear = ['local'] - if (!this.opts.localOnly) { - toClear.push('remote') - } - yield Promise.all( - toClear.map((store) => - __awaiter(this, void 0, void 0, function* () { - return this[store].clear() - }) - ) - ) - return undefined - }) - } - delete(key) { - return __awaiter(this, void 0, void 0, function* () { - const toDelete = ['local'] - if (!this.opts.localOnly) { - toDelete.push('remote') - } - const deleted = yield Promise.all( - toDelete.map((store) => - __awaiter(this, void 0, void 0, function* () { - return this[store].delete(key) - }) - ) - ) - return deleted.every(Boolean) - }) - } - deleteMany(keys) { - return __awaiter(this, void 0, void 0, function* () { - const promises = [] - for (const key of keys) { - promises.push(this.delete(key)) - } - const values = yield Promise.all(promises) - return values.every(Boolean) - }) - } - has(key) { - return __awaiter(this, void 0, void 0, function* () { - let response - if (typeof this.local.has === 'function') { - response = this.local.has(key) - } else { - const value = yield this.local.get(key) - response = value !== undefined - } - if (!response || !this.opts.validator(response, key)) { - if (typeof this.remote.has === 'function') { - response = this.remote.has(key) - } else { - const value = yield this.remote.get(key) - response = value !== undefined - } - } - return response - }) - } - iterator(namespace) { - return __asyncGenerator(this, arguments, function* iterator_1() { - var _a, e_1, _b, _c - const limit = Number.parseInt(this.iterationLimit, 10) || 10 - this.remote.opts.iterationLimit = limit - if (this.remote && typeof this.remote.iterator === 'function') { - try { - for (var _d = true, _e = __asyncValues(this.remote.iterator(namespace)), _f; (_f = yield __await(_e.next())), (_a = _f.done), !_a; ) { - _c = _f.value - _d = false - try { - const entries = _c - yield yield __await(entries) - } finally { - _d = true - } - } - } catch (e_1_1) { - e_1 = { error: e_1_1 } - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e)) - } finally { - if (e_1) throw e_1.error - } - } - } - }) - } -} -exports.KeyValueTieredStoreAdapter = KeyValueTieredStoreAdapter -function isMap(map) { - if (map instanceof Map) { - return true - } else if ( - map && - typeof map.clear === 'function' && - typeof map.delete === 'function' && - typeof map.get === 'function' && - typeof map.has === 'function' && - typeof map.set === 'function' - ) { - return true - } - return false -} -//# sourceMappingURL=index.js.map diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/tiered/types.d.ts b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/tiered/types.d.ts deleted file mode 100644 index 4c39e3f2d..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/tiered/types.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { IKeyValueStoreAdapter } from '../../key-value-types' -export type Options = { - local: IKeyValueStoreAdapter | Map - remote: IKeyValueStoreAdapter | Map - localOnly?: boolean - iterationLimit?: number | string -} -export type Options_ = { - validator: (value: any, key: string) => boolean - dialect: string - iterationLimit?: number | string - localOnly?: boolean -} -//# sourceMappingURL=types.d.ts.map diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/tiered/types.js b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/tiered/types.js deleted file mode 100644 index 9ab487ded..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/tiered/types.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' -Object.defineProperty(exports, '__esModule', { value: true }) -//# sourceMappingURL=types.js.map diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/typeorm/entities/keyValueStoreEntity.d.ts b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/typeorm/entities/keyValueStoreEntity.d.ts deleted file mode 100644 index 6d04e78ad..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/typeorm/entities/keyValueStoreEntity.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { BaseEntity } from 'typeorm' -/** - * - * @beta This API may change without a BREAKING CHANGE notice. - */ -export declare class KeyValueStoreEntity extends BaseEntity { - key: string - data: string - expires?: number -} -//# sourceMappingURL=keyValueStoreEntity.d.ts.map diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/typeorm/entities/keyValueStoreEntity.js b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/typeorm/entities/keyValueStoreEntity.js deleted file mode 100644 index 2d7c75779..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/typeorm/entities/keyValueStoreEntity.js +++ /dev/null @@ -1,50 +0,0 @@ -'use strict' -var __decorate = - (this && this.__decorate) || - function (decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? (desc = Object.getOwnPropertyDescriptor(target, key)) : desc, - d - if (typeof Reflect === 'object' && typeof Reflect.decorate === 'function') r = Reflect.decorate(decorators, target, key, desc) - else - for (var i = decorators.length - 1; i >= 0; i--) if ((d = decorators[i])) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r - return c > 3 && r && Object.defineProperty(target, key, r), r - } -var __metadata = - (this && this.__metadata) || - function (k, v) { - if (typeof Reflect === 'object' && typeof Reflect.metadata === 'function') return Reflect.metadata(k, v) - } -Object.defineProperty(exports, '__esModule', { value: true }) -exports.KeyValueStoreEntity = void 0 -const typeorm_1 = require('typeorm') -/** - * - * @beta This API may change without a BREAKING CHANGE notice. - */ -let KeyValueStoreEntity = class KeyValueStoreEntity extends typeorm_1.BaseEntity {} -__decorate( - [ - (0, typeorm_1.PrimaryColumn)(), - // @ts-ignore - __metadata('design:type', String), - ], - KeyValueStoreEntity.prototype, - 'key', - void 0 -) -__decorate( - [ - (0, typeorm_1.Column)({ - type: 'text', - }), - // @ts-ignore - __metadata('design:type', String), - ], - KeyValueStoreEntity.prototype, - 'data', - void 0 -) -KeyValueStoreEntity = __decorate([(0, typeorm_1.Entity)('keyvaluestore')], KeyValueStoreEntity) -exports.KeyValueStoreEntity = KeyValueStoreEntity -//# sourceMappingURL=keyValueStoreEntity.js.map diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/typeorm/index.d.ts b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/typeorm/index.d.ts deleted file mode 100644 index 6a0db7dda..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/typeorm/index.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -/// -import { EventEmitter } from 'events' -import { OrPromise } from '@veramo/utils' -import { DataSource } from 'typeorm' -import { KeyValueTypeORMOptions, Options_ } from './types' -import { KeyvStore, KeyvStoredData } from '../../keyv/keyv-types' -import { IKeyValueStoreAdapter } from '../../key-value-types' -export { KeyValueTypeORMOptions } from './types' -export { KeyValueStoreEntity } from './entities/keyValueStoreEntity' -export { kvStoreMigrations } from './migrations' -export declare class KeyValueTypeORMStoreAdapter extends EventEmitter implements KeyvStore, IKeyValueStoreAdapter { - private readonly dbConnection - readonly namespace: string - opts: Options_ - constructor(options: KeyValueTypeORMOptions) - get( - key: string | string[], - options?: { - raw?: boolean - } - ): Promise | Array>> - getMany( - keys: string[], - options?: { - raw?: boolean - } - ): Promise>> - set(key: string, value: string, ttl?: number): Promise> - delete(key: string | string[]): Promise - deleteMany(keys: string[]): Promise - clear(): Promise - has(key: string): Promise - disconnect(): Promise -} -/** - * Ensures that the provided DataSource is connected. - * - * @param dbConnection - a TypeORM DataSource or a Promise that resolves to a DataSource - */ -export declare function getConnectedDb(dbConnection: OrPromise): Promise -//# sourceMappingURL=index.d.ts.map diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/typeorm/index.js b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/typeorm/index.js deleted file mode 100644 index d2e8d125a..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/typeorm/index.js +++ /dev/null @@ -1,186 +0,0 @@ -'use strict' -var __awaiter = - (this && this.__awaiter) || - function (thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P - ? value - : new P(function (resolve) { - resolve(value) - }) - } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)) - } catch (e) { - reject(e) - } - } - function rejected(value) { - try { - step(generator['throw'](value)) - } catch (e) { - reject(e) - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected) - } - step((generator = generator.apply(thisArg, _arguments || [])).next()) - }) - } -var __importDefault = - (this && this.__importDefault) || - function (mod) { - return mod && mod.__esModule ? mod : { default: mod } - } -Object.defineProperty(exports, '__esModule', { value: true }) -exports.getConnectedDb = exports.KeyValueTypeORMStoreAdapter = exports.kvStoreMigrations = exports.KeyValueStoreEntity = void 0 -const events_1 = require('events') -const typeorm_1 = require('typeorm') -const keyValueStoreEntity_1 = require('./entities/keyValueStoreEntity') -const json_buffer_1 = __importDefault(require('json-buffer')) -var keyValueStoreEntity_2 = require('./entities/keyValueStoreEntity') -Object.defineProperty(exports, 'KeyValueStoreEntity', { - enumerable: true, - get: function () { - return keyValueStoreEntity_2.KeyValueStoreEntity - }, -}) -var migrations_1 = require('./migrations') -Object.defineProperty(exports, 'kvStoreMigrations', { - enumerable: true, - get: function () { - return migrations_1.kvStoreMigrations - }, -}) -class KeyValueTypeORMStoreAdapter extends events_1.EventEmitter { - constructor(options) { - super() - this.dbConnection = options.dbConnection - this.namespace = options.namespace || 'keyv' - this.opts = Object.assign( - { validator: () => true, dialect: 'typeorm', serialize: json_buffer_1.default.stringify, deserialize: json_buffer_1.default.parse }, - options - ) - } - get(key, options) { - return __awaiter(this, void 0, void 0, function* () { - if (Array.isArray(key)) { - return this.getMany(key, options) - } - const connection = yield getConnectedDb(this.dbConnection) - const result = yield connection.getRepository(keyValueStoreEntity_1.KeyValueStoreEntity).findOneBy({ - key, - }) - return (options === null || options === void 0 ? void 0 : options.raw) !== true || !result - ? result === null || result === void 0 - ? void 0 - : result.data - : { - value: result === null || result === void 0 ? void 0 : result.data, - expires: result === null || result === void 0 ? void 0 : result.expires, - } - }) - } - getMany(keys, options) { - return __awaiter(this, void 0, void 0, function* () { - const connection = yield getConnectedDb(this.dbConnection) - const results = yield connection.getRepository(keyValueStoreEntity_1.KeyValueStoreEntity).findBy({ - key: (0, typeorm_1.In)(keys), - }) - const values = keys.map((key) => - __awaiter(this, void 0, void 0, function* () { - var _a - const result = results.find((result) => result.key === key) - return (options === null || options === void 0 ? void 0 : options.raw) !== true || !result - ? result === null || result === void 0 - ? void 0 - : result.data - : { - value: (result === null || result === void 0 ? void 0 : result.data) - ? (_a = yield this.opts.deserialize(result.data)) === null || _a === void 0 - ? void 0 - : _a.value - : undefined, - expires: result === null || result === void 0 ? void 0 : result.expires, - } - }) - ) - return Promise.all(values) - }) - } - set(key, value, ttl) { - return __awaiter(this, void 0, void 0, function* () { - const connection = yield getConnectedDb(this.dbConnection) - const entity = new keyValueStoreEntity_1.KeyValueStoreEntity() - entity.key = key - entity.data = value - entity.expires = ttl - yield connection.getRepository(keyValueStoreEntity_1.KeyValueStoreEntity).save(entity) - return { value: value, expires: ttl } - }) - } - delete(key) { - return __awaiter(this, void 0, void 0, function* () { - if (Array.isArray(key)) { - return this.deleteMany(key) - } - const connection = yield getConnectedDb(this.dbConnection) - const result = yield connection.getRepository(keyValueStoreEntity_1.KeyValueStoreEntity).delete({ key }) - return result.affected === 1 - }) - } - deleteMany(keys) { - return __awaiter(this, void 0, void 0, function* () { - const connection = yield getConnectedDb(this.dbConnection) - const results = yield connection.getRepository(keyValueStoreEntity_1.KeyValueStoreEntity).delete({ - key: (0, typeorm_1.In)(keys), - }) - return !!results.affected && results.affected >= 1 - }) - } - clear() { - return __awaiter(this, void 0, void 0, function* () { - const connection = yield getConnectedDb(this.dbConnection) - yield connection.getRepository(keyValueStoreEntity_1.KeyValueStoreEntity).delete({ - key: (0, typeorm_1.Like)(`${this.namespace}:%`), - }) - }) - } - has(key) { - return __awaiter(this, void 0, void 0, function* () { - const connection = yield getConnectedDb(this.dbConnection) - const result = yield connection.getRepository(keyValueStoreEntity_1.KeyValueStoreEntity).countBy({ - key, - }) - return result === 1 - }) - } - disconnect() { - return __awaiter(this, void 0, void 0, function* () { - const connection = yield getConnectedDb(this.dbConnection) - connection.destroy() - }) - } -} -exports.KeyValueTypeORMStoreAdapter = KeyValueTypeORMStoreAdapter -/** - * Ensures that the provided DataSource is connected. - * - * @param dbConnection - a TypeORM DataSource or a Promise that resolves to a DataSource - */ -function getConnectedDb(dbConnection) { - return __awaiter(this, void 0, void 0, function* () { - if (dbConnection instanceof Promise) { - return yield dbConnection - } else if (!dbConnection.isInitialized) { - return yield dbConnection.initialize() - } else { - return dbConnection - } - }) -} -exports.getConnectedDb = getConnectedDb -//# sourceMappingURL=index.js.map diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/1.createKVDatabase.d.ts b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/1.createKVDatabase.d.ts deleted file mode 100644 index bbe1bc3b8..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/1.createKVDatabase.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { MigrationInterface, QueryRunner } from 'typeorm' -/** - * Create the database layout for Veramo 3.0 - * - * @public - */ -export declare class CreateKVDatabaseMigration implements MigrationInterface { - private readonly _tableName - readonly name: string - constructor(tableName?: string) - up(queryRunner: QueryRunner): Promise - down(queryRunner: QueryRunner): Promise -} -//# sourceMappingURL=1.createKVDatabase.d.ts.map diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/1.createKVDatabase.js b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/1.createKVDatabase.js deleted file mode 100644 index 366ea1f94..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/1.createKVDatabase.js +++ /dev/null @@ -1,90 +0,0 @@ -'use strict' -var __awaiter = - (this && this.__awaiter) || - function (thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P - ? value - : new P(function (resolve) { - resolve(value) - }) - } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)) - } catch (e) { - reject(e) - } - } - function rejected(value) { - try { - step(generator['throw'](value)) - } catch (e) { - reject(e) - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected) - } - step((generator = generator.apply(thisArg, _arguments || [])).next()) - }) - } -var __importDefault = - (this && this.__importDefault) || - function (mod) { - return mod && mod.__esModule ? mod : { default: mod } - } -Object.defineProperty(exports, '__esModule', { value: true }) -exports.CreateKVDatabaseMigration = void 0 -const typeorm_1 = require('typeorm') -const debug_1 = __importDefault(require('debug')) -const debug = (0, debug_1.default)('veramo:kv-store:initial-migration') -/** - * Create the database layout for Veramo 3.0 - * - * @public - */ -class CreateKVDatabaseMigration { - constructor(tableName) { - this._tableName = tableName || 'keyvaluestore' - this.name = `CreateKVDatabase${tableName}1680297189001` - } - up(queryRunner) { - return __awaiter(this, void 0, void 0, function* () { - function getTableName(givenName) { - var _a - return ( - ((_a = queryRunner.connection.entityMetadatas.find((meta) => meta.givenTableName === givenName)) === null || _a === void 0 - ? void 0 - : _a.tableName) || givenName - ) - } - debug(`creating ${this._tableName} table`) - // CREATE TABLE "keyvaluestore" ("key" varchar PRIMARY KEY NOT NULL, "data" text NOT NULL) - yield queryRunner.createTable( - new typeorm_1.Table({ - name: getTableName(this._tableName), - columns: [ - { name: 'key', type: 'varchar', isPrimary: true }, - { name: 'data', type: 'text', isNullable: false }, - ], - indices: [ - { - columnNames: ['key'], - isUnique: true, - }, - ], - }), - true - ) - }) - } - down(queryRunner) { - return __awaiter(this, void 0, void 0, function* () { - throw new Error('illegal_operation: cannot roll back initial migration') - }) - } -} -exports.CreateKVDatabaseMigration = CreateKVDatabaseMigration -//# sourceMappingURL=1.createKVDatabase.js.map diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/index.d.ts b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/index.d.ts deleted file mode 100644 index 34f3dde8d..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { CreateKVDatabaseMigration } from './1.createKVDatabase' -/** - * The migrations array that SHOULD be used when initializing a TypeORM database connection. - * - * These ensure the correct creation of tables and the proper migrations of data when tables change between versions. - * - * @public - */ -export declare const kvStoreMigrations: (typeof CreateKVDatabaseMigration)[] -//# sourceMappingURL=index.d.ts.map diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/index.js b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/index.js deleted file mode 100644 index 22c67c933..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/index.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict' -Object.defineProperty(exports, '__esModule', { value: true }) -exports.kvStoreMigrations = void 0 -const _1_createKVDatabase_1 = require('./1.createKVDatabase') -/** - * The migrations array that SHOULD be used when initializing a TypeORM database connection. - * - * These ensure the correct creation of tables and the proper migrations of data when tables change between versions. - * - * @public - */ -exports.kvStoreMigrations = [_1_createKVDatabase_1.CreateKVDatabaseMigration] -//# sourceMappingURL=index.js.map diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/typeorm/types.d.ts b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/typeorm/types.d.ts deleted file mode 100644 index 059f93cb5..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/typeorm/types.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { OrPromise } from '@veramo/utils' -import { DataSource } from 'typeorm' -import { KeyvDeserializedData } from '../../keyv/keyv-types' -export type KeyValueTypeORMOptions = { - dbConnection: OrPromise - namespace?: string -} -export type Options_ = { - validator: (value: any, key: string) => boolean - dialect: string - serialize: (data: KeyvDeserializedData) => OrPromise - /** A custom deserialization function. */ - deserialize: (data: any) => OrPromise | undefined> -} -//# sourceMappingURL=types.d.ts.map diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/typeorm/types.js b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/typeorm/types.js deleted file mode 100644 index 9ab487ded..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/store-adapters/typeorm/types.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' -Object.defineProperty(exports, '__esModule', { value: true }) -//# sourceMappingURL=types.js.map diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/tsdoc-metadata.json b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/tsdoc-metadata.json deleted file mode 100644 index 52f4aa531..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/build/tsdoc-metadata.json +++ /dev/null @@ -1,11 +0,0 @@ -// This file is read by tools that parse documentation comments conforming to the TSDoc standard. -// It should be published with your NPM package. It should not be tracked by Git. -{ - "tsdocVersion": "0.12", - "toolPackages": [ - { - "packageName": "@microsoft/api-extractor", - "packageVersion": "7.33.7" - } - ] -} diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/package.json b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/package.json deleted file mode 100644 index c682bc18a..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "@veramo/kv-store", - "description": "Veramo Key Value Store plugin", - "version": "4.3.0", - "main": "build/index.js", - "types": "build/index.d.ts", - "scripts": { - "build": "tsc", - "test": "jest --config=../../jest.config.mjs", - "test:ci": "jest --config=../../jest.config.mjs", - "extract-api": "node ../cli/bin/veramo.js dev extract-api" - }, - "dependencies": { - "@veramo/utils": "4.3.0", - "debug": "^4.3.4", - "events": "^3.3.0", - "json-buffer": "^3.0.1", - "typeorm": "^0.3.10", - "uint8arrays": "^3.1.1" - }, - "files": [ - "build/**/*", - "src/**/*", - "README.md", - "LICENSE" - ], - "publishConfig": { - "access": "public" - }, - "repository": "git@github.com:uport-project/veramo.git", - "author": "Niels Klomp ", - "license": "Apache-2.0", - "keywords": [ - "Veramo", - "Key Value Store", - "keyv" - ], - "yalcSig": "bfd8bfc89f0050ba31664b2d7c3efc7a" -} diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/__tests__/keyv.test.ts b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/__tests__/keyv.test.ts deleted file mode 100644 index 447e7f49f..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/__tests__/keyv.test.ts +++ /dev/null @@ -1,204 +0,0 @@ -import KeyvSqlite from '@keyv/sqlite' - -import timekeeper from 'timekeeper' -import { Keyv } from '../keyv/keyv' -import { DataSource } from 'typeorm' -import { KeyValueStoreEntity } from '../store-adapters/typeorm/entities/keyValueStoreEntity' -import { KeyValueTieredStoreAdapter, KeyValueTypeORMStoreAdapter } from '../store-adapters' -import { KeyvOptions } from '../keyv/keyv-types' -import { kvStoreMigrations } from '../store-adapters/typeorm/migrations' - -let dbConnection: DataSource -beforeEach(async () => { - dbConnection = await new DataSource({ - type: 'sqlite', - database: ':memory:', - logging: ['error'], - migrationsRun: true, - synchronize: false, - migrations: [...kvStoreMigrations], - entities: [KeyValueStoreEntity], - }).initialize() -}) -afterEach(async () => { - try { - if (dbConnection?.isInitialized) { - await (await dbConnection).destroy() - } - } catch (error) { - // the disconnect test will close the DB anyway - } -}) -describe('keyv MAP store', () => { - it('should respect ttl', async () => { - const store = new Map() - const keyv = new Keyv(store) - await keyv.set('key', 'value', 100) - - expect(await keyv.get('key')).toEqual('value') - timekeeper.freeze(Date.now() + 150) - expect(await keyv.get('key')).toBeUndefined() - }) - it('should work for all methods', async () => { - const store = new Map() - await testAllKeyvMethods(store) - }) -}) - -describe('keyv sqlite store', () => { - it('should respect ttl', async () => { - const keyv = new Keyv(new KeyvSqlite()) - await keyv.set('key', 'value', 100) - - expect(await keyv.get('key')).toEqual('value') - timekeeper.freeze(Date.now() + 150) - expect(await keyv.get('key')).toBeUndefined() - }) - it('should work for all methods', async () => { - const store = new KeyvSqlite() - await testAllKeyvMethods(store) - }) -}) - -describe('keyv TypeORM store', () => { - /*let dbConnection: DataSource - - beforeEach(async () => { - dbConnection = await new DataSource({ - type: 'sqlite', - database: ':memory:', - logging: 'all', - migrationsRun: true, - synchronize: false, - migrations: [...kvStoreMigrations], - entities: [KeyValueStoreEntity], - }).initialize() - }) - - afterEach(async () => { - try { - (await dbConnection).destroy() - } catch (error) { - // the disconnect test will close the DB anyway - } - - }) -*/ - it('should respect ttl', async () => { - const store = new KeyValueTypeORMStoreAdapter({ dbConnection, namespace: 'test' }) - const keyv = new Keyv(store) - await keyv.set('key', 'value', 100) - - expect(await keyv.get('key')).toEqual('value') - timekeeper.freeze(Date.now() + 150) - expect(await keyv.get('key')).toBeUndefined() - }) - - it('should set a value that can be retrieved from the proper namespace', async () => { - const store = new KeyValueTypeORMStoreAdapter({ dbConnection, namespace: 'test' }) - const keyv = new Keyv(store) - await keyv.set('key', 'value') - expect(await keyv.get('key')).toEqual('value') - - const alternateStore = new KeyValueTypeORMStoreAdapter({ dbConnection, namespace: 'another' }) - const alternateKeyv = new Keyv(alternateStore) - expect(await alternateKeyv.get('key')).toBeUndefined() - }) - - it('should set multiple values that can be retrieved', async () => { - const store = new KeyValueTypeORMStoreAdapter({ dbConnection, namespace: 'test' }) - const keyv = new Keyv(store) - for (let i = 0; i < 10; i++) { - await keyv.set(`${i}`, `value${i}`) - } - - let values = await keyv.getMany(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'nope']) - expect(values).toHaveLength(11) - - await keyv.delete('0') - expect(await keyv.getMany(['0'])).toHaveLength(1) - values = await keyv.getMany(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'nope']) - expect(values).toHaveLength(11) - expect(values[9]).toBe('value9') - expect(values[10]).toBeUndefined() - - await keyv.clear() - values = await keyv.getMany(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'nope']) - expect(values).toHaveLength(11) - expect(values[0]).toBeUndefined() - expect(values[9]).toBeUndefined() - expect(values[10]).toBeUndefined() - }) - it('should work for all methods', async () => { - const store = new KeyValueTypeORMStoreAdapter({ dbConnection, namespace: 'test-all' }) - await testAllKeyvMethods(store) - await store.disconnect() - }) -}) - -describe('keyv tiered store', () => { - it('should respect ttl', async () => { - const local: Map = new Map() - const remote = new KeyValueTypeORMStoreAdapter({ dbConnection }) - - const options: KeyvOptions = { - namespace: 'example', - store: new KeyValueTieredStoreAdapter({ local, remote }), - } - const keyv = new Keyv(undefined, options) - await keyv.set('key', 'value', 100) - - expect(await keyv.get('key')).toEqual('value') - timekeeper.freeze(Date.now() + 150) - expect(await keyv.get('key')).toBeUndefined() - await keyv.disconnect() - }) - it('should work for all methods', async () => { - const local: Map = new Map() - const remote = new KeyValueTypeORMStoreAdapter({ dbConnection }) - - const options: KeyvOptions = { - namespace: 'example', - store: new KeyValueTieredStoreAdapter({ local, remote }), - } - const store = new Keyv(undefined, options) - - // No raw match test, as remote and local have different raw values - await testAllKeyvMethods(store, false) - }) -}) - -async function testAllKeyvMethods(store: any, rawMatchTest = true) { - const keyv = new Keyv(store) - - // set value - await expect(keyv.set('key1', 'value1')).resolves.toEqual(true) - await expect(keyv.set('key2', 'value2')).resolves.toEqual(true) - - // get value by key - await expect(keyv.get('key1', { raw: false })).resolves.toEqual('value1') - await expect(keyv.get('key1', { raw: true })).resolves.toMatchObject({ value: 'value1' }) - - // get value by non-existing key - await expect(keyv.get('key3', { raw: false })).resolves.toBeUndefined() - await expect(keyv.get('key3', { raw: true })).resolves.toBeUndefined() - - // Get many as non-raw and raw - await expect(keyv.getMany(['key1', 'key2'], { raw: false })).resolves.toMatchObject(['value1', 'value2']) - if (rawMatchTest) { - await expect(keyv.getMany(['key1', 'key2'], { raw: true })).resolves.toMatchObject([{ value: 'value1' }, { value: 'value2' }]) - } - - // Check existence - await expect(keyv.has('key1')).resolves.toEqual(true) - await expect(keyv.has('key3')).resolves.toEqual(false) - - // delete key1 only - await expect(keyv.delete('key1')).resolves.toEqual(true) - await expect(keyv.has('key1')).resolves.toEqual(false) - await expect(keyv.has('key2')).resolves.toEqual(true) - - // clear - await keyv.clear() - await expect(keyv.has('key2')).resolves.toEqual(false) -} diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/__tests__/kvstore.test.ts b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/__tests__/kvstore.test.ts deleted file mode 100644 index 66b2a26bc..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/__tests__/kvstore.test.ts +++ /dev/null @@ -1,93 +0,0 @@ -import { KeyValueStore } from '../key-value-store' -import { IKeyValueStore } from '../key-value-types' - -interface TestValue { - stringProp: string - numberProp: number - objectProp: { - value: string | number - } -} - -let testValues: TestValue[] = [] - -for (let i = 0; i < 10; i++) { - testValues.push({ - stringProp: `stringValue${i}`, - numberProp: i, - objectProp: { - value: `objectValue${i}`, - }, - }) -} -describe('kvStore with MAP adapter', () => { - let kvStore: IKeyValueStore - beforeEach(async () => { - const store = new Map() - kvStore = new KeyValueStore({ store }) - for (let i = 0; i < 10; i++) { - await kvStore.set(`key${i}`, testValues[i]) - } - }) - afterEach(async () => { - try { - await kvStore.clear() - await kvStore.disconnect() - } catch (error) {} - }) - it('should get non-existing keys as undefined', async () => { - await expect(kvStore.get('nope')).resolves.toBeUndefined() - await expect(kvStore.getAsValueData('nope')).resolves.toMatchObject({ - value: undefined, - expires: undefined, - }) - }) - - it('should get single results', async () => { - for (let i = 0; i < 10; i++) { - await expect(kvStore.get(`key${i}`)).resolves.toEqual(testValues[i]) - await expect(kvStore.getAsValueData(`key${i}`)).resolves.toMatchObject({ - value: testValues[i], - expires: undefined, - }) - } - }) - - it('should get multiple results', async () => { - // Let's get multiple results - const manyResult = await kvStore.getMany(['key1', 'nope', 'key4']) - expect(manyResult).toHaveLength(3) - expect(manyResult[0]).toEqual(testValues[1]) - expect(manyResult[1]).toBeUndefined() - expect(manyResult[2]).toEqual(testValues[4]) - const manyValueResult = await kvStore.getManyAsValueData(['key1', 'nope', 'key4']) - expect(manyValueResult).toHaveLength(3) - expect(manyValueResult[0]).toEqual({ value: testValues[1], expires: undefined }) - expect(manyValueResult[1]).toEqual({ value: undefined, expires: undefined }) - expect(manyValueResult[2]).toEqual({ value: testValues[4], expires: undefined }) - }) - - it('should check existence of keys', async () => { - await expect(kvStore.has(`key1`)).resolves.toEqual(true) - await expect(kvStore.has(`nope`)).resolves.toEqual(false) - }) - - it('should delete an existing key', async () => { - await expect(kvStore.has(`key1`)).resolves.toEqual(true) - await expect(kvStore.delete(`key1`)).resolves.toEqual(true) - await expect(kvStore.has(`key1`)).resolves.toEqual(false) - }) - - it('should not throw an error when deleting a non-existing key', async () => { - await expect(kvStore.delete(`nope`)).resolves.toEqual(false) - }) - - it('should delete multiple values', async () => { - await expect(kvStore.deleteMany(['key2', 'nope', 'key6'])).resolves.toEqual([true, false, true]) - }) - - it('should clear all', async () => { - await kvStore.clear() - await expect(kvStore.has(`key1`)).resolves.toEqual(false) - }) -}) diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/index.ts b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/index.ts deleted file mode 100644 index c72fc52ff..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Provides a {@link @veramo/kv-store#KeyValueStore} for the - * {@link @veramo/core#Agent} plugin that implements {@link @veramo/kv-store#IKeyValueStore} interface - * - * @packageDocumentation - */ -export { KeyValueStore } from './key-value-store' -export * from './store-adapters/tiered/index' -export * from './store-adapters/typeorm/index' -export * from './key-value-types' diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/key-value-store.ts b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/key-value-store.ts deleted file mode 100644 index 8d2d3d282..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/key-value-store.ts +++ /dev/null @@ -1,109 +0,0 @@ -import { IKeyValueStore, IKeyValueStoreOnArgs, IKeyValueStoreOptions, IValueData } from './key-value-types' -import { Keyv } from './keyv/keyv' -import { KeyvDeserializedData, KeyvOptions, KeyvStoredData } from './keyv/keyv-types' - -/** - * Agent plugin that implements {@link @veramo/kv-store#IKeyValueStore} interface - * @public - */ -export class KeyValueStore implements IKeyValueStore { - /** - * The main keyv typescript port which delegates to the storage adapters and takes care of some common functionality - * - * @private - */ - private readonly keyv: Keyv - - constructor(options: IKeyValueStoreOptions) { - this.keyv = new Keyv(options.uri, options as KeyvOptions) - } - - async get(key: string): Promise { - const result = await this.keyv.get(key, { raw: false }) - if (result === null || result === undefined) { - return undefined - } - return result as ValueType - } - - async getAsValueData(key: string): Promise> { - const result = await this.keyv.get(key, { raw: true }) - if (result === null || result === undefined) { - // We always return a ValueData object for this method - return { value: undefined, expires: undefined } - } - return this.toDeserializedValueData(result) - } - - async getMany(keys: string[]): Promise> { - if (!keys || keys.length === 0) { - return [] - } - let result = await this.keyv.getMany(keys, { raw: false }) - - // Making sure we return the same array length as the amount of key(s) passed in - if (result === null || result === undefined || result.length === 0) { - result = new Array() - keys.forEach(() => result.push(undefined)) - } - return result.map((v) => (!!v ? (v as ValueType) : undefined)) - } - - async getManyAsValueData(keys: string[]): Promise>> { - if (!keys || keys.length === 0) { - return [] - } - let result = await this.keyv.getMany(keys, { raw: true }) - - // Making sure we return the same array length as the amount of key(s) passed in - if (result === null || result === undefined || result.length === 0) { - result = new Array>() - keys.forEach(() => result.push({ value: undefined, expires: undefined } as KeyvDeserializedData)) - } - return result.map((v) => (!!v ? this.toDeserializedValueData(v) : { value: undefined, expires: undefined })) - } - - async set(key: string, value: ValueType, ttl?: number): Promise> { - return this.keyv.set(key, value, ttl).then(() => this.getAsValueData(key)) - } - - async has(key: string): Promise { - return this.keyv.has(key) - } - - async delete(key: string): Promise { - return this.keyv.delete(key) - } - - async deleteMany(keys: string[]): Promise { - return Promise.all(keys.map((key) => this.keyv.delete(key))) - } - - async clear(): Promise> { - return this.keyv.clear().then(() => this) - } - - async disconnect(): Promise { - return this.keyv.disconnect() - } - - // Public so parties using the kv store directly can add listeners if they want - async kvStoreOn(args: IKeyValueStoreOnArgs): Promise> { - this.keyv.on(args.eventName, args.listener) - return this - } - - private toDeserializedValueData(result: any): IValueData { - if (result === null || result === undefined) { - throw Error(`Result cannot be undefined or null at this this point`) - } else if (typeof result !== 'object') { - return { value: result, expires: undefined } - } else if (!('value' in result)) { - return { value: result, expires: undefined } - } - if (!('expires' in result)) { - result.expires = undefined - } - return result as IValueData - } -} diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/key-value-types.ts b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/key-value-types.ts deleted file mode 100644 index ddd382e90..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/key-value-types.ts +++ /dev/null @@ -1,97 +0,0 @@ -/** - * This is how the store will actually store the value. - * It contains an optional `expires` property, which indicates when the value would expire - */ -export interface IValueData { - value: ValueType | undefined - expires: number | undefined -} - -export interface IKeyValueStoreOnArgs { - eventName: string | symbol - listener: (...args: any[]) => void -} - -/*export interface IKeyValueStoreGetArgs { - key: string -} - -export interface IKeyValueStoreGetManyArgs { - keys: string[] -} - -export interface IKeyValueStoreHasArgs { - key: string -} - -export interface IKeyValueStoreDeleteArgs { - key: string -} - -export interface IKeyValueStoreDeleteManyArgs { - keys: string[] -} - -export interface IKeyValueStoreSetArgs { - key: string - value: ValueType - ttl?: number -}*/ - -export interface IKeyValueStoreOptions { - [key: string]: any - - /** Namespace for the current instance. */ - namespace?: string | undefined - - /** A custom serialization function. */ - /*serialize?: ((data: KeyvDeserializedData) => OrPromise) - /!** A custom deserialization function. *!/ - deserialize?: ((data: any) => OrPromise | undefined>);*/ - /** The connection string URI. */ - uri?: string | undefined - /** The storage adapter instance to be used by Keyv. or any other implementation */ - store: IKeyValueStoreAdapter | Map - /** Default TTL. Can be overridden by specifying a TTL on `.set()`. */ - ttl?: number | undefined - - /** Enable compression option **/ - /*compression?: KeyvCompressionAdapter | undefined;*/ - - emitErrors?: boolean -} - -export interface IKeyValueStoreAdapter { - namespace?: string | undefined -} - -export interface IKeyValueStore { - /** - * Get a single value by key. Can be undefined as the underlying store typically will not throw an error for a non existing key - * - * @param key Contains the key to search for - */ - get(key: string): Promise - - /** - * Get a single item as Value Data from the store. Will always return a Value Data Object, but the value in it can be undefined in case the actual store does not contain the value - * @param key Contains the key to search for - */ - getAsValueData(key: string): Promise> - - getMany(keys: string[]): Promise> - - getManyAsValueData(keys: string[]): Promise>> - - set(key: string, value: ValueType, ttl?: number): Promise> - - delete(key: string): Promise - - deleteMany(keys: string[]): Promise - - clear(): Promise> - - has(key: string): Promise - - disconnect(): Promise -} diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/keyv/keyv-types.ts b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/keyv/keyv-types.ts deleted file mode 100644 index 9ce7b0207..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/keyv/keyv-types.ts +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Please be aware these types are compatible with the keyv package, to ensure we can use its store-adapters for free. - * - * Be very careful when extending/changing!. Normally you will want to create an adapter or decorator for your additional behaviour or requirements - */ -import { OrPromise } from '@veramo/utils' - -export interface KeyvOptions { - [key: string]: any - - /** Namespace for the current instance. */ - namespace?: string | undefined - /** A custom serialization function. */ - serialize?: (data: KeyvDeserializedData) => OrPromise - /** A custom deserialization function. */ - deserialize?: (data: any) => OrPromise | undefined> - /** The connection string URI. */ - uri?: string | undefined - /** The storage adapter instance to be used by Keyv. */ - store?: KeyvStore | undefined - /** Default TTL. Can be overridden by specififying a TTL on `.set()`. */ - ttl?: number | undefined - /** Specify an adapter to use. e.g `'redis'` or `'mongodb'`. */ - adapter?: 'redis' | 'mongodb' | 'mongo' | 'sqlite' | 'postgresql' | 'postgres' | 'mysql' | object | string | undefined - /** Enable compression option **/ - compression?: KeyvCompressionAdapter | undefined - - emitErrors?: boolean -} - -export interface KeyvCompressionAdapter { - compress(value: any, options?: any): OrPromise - - decompress(value: any, options?: any): OrPromise - - serialize(value: any): OrPromise - - deserialize(value: any): OrPromise -} - -export interface KeyvDeserializedData { - value: Value - expires: number | undefined -} - -export type KeyvStoredData = KeyvDeserializedData | string | Value | undefined - -export interface KeyvStore { - namespace?: string | undefined - - opts: KeyvOptions - - on?(eventName: string | symbol, listener: (...args: any[]) => void): void - get(key: string | string[], options?: { raw?: boolean }): OrPromise | Array>> - - getMany?(keys: string[], options?: { raw?: boolean }): OrPromise>> | undefined - - iterator?(namespace?: string | undefined): AsyncGenerator - - set(key: string, value: Value, ttl?: number): any - - delete(key: string | string[]): OrPromise - - deleteMany?(keys: string[]): OrPromise - - clear(): OrPromise - - has?(key: string): OrPromise - - disconnect?(): void -} diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/keyv/keyv.ts b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/keyv/keyv.ts deleted file mode 100644 index 16327cf96..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/keyv/keyv.ts +++ /dev/null @@ -1,282 +0,0 @@ -import { EventEmitter } from 'events' -import JSONB from 'json-buffer' -import { KeyvDeserializedData, KeyvOptions, KeyvStore, KeyvStoredData } from './keyv-types' - -/** - * Please note that this is code adapted from @link https://github.com/jaredwray/keyv to support Typescript and ESM in Veramo - * - * The code should support the storage plugins available for the keyv project. - * Veramo itself supports NodeJS, Browser and React-Native environment. - * Please be aware that these requirements probably aren't true for any keyv storage plugins. - * - * 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. - * We believe that any Veramo Key Value store should use explicitly defined store-adapters. - * - * 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. - * Veramo exposes its own API/interfaces for the Key Value store, meaning we could also support any other implementation in the future - * - * The Veramo kv-store module provides out of the box support for in memory/maps, sqlite and typeorm implementations, - * including a tiered local/remote implementation that support all environments. - * - * We welcome any new storage modules - */ -export class Keyv extends EventEmitter implements KeyvStore { - readonly opts: KeyvOptions - readonly namespace: string - iterator?: (namespace?: string) => AsyncGenerator - - constructor(uri?: string | Map | KeyvStore | undefined, options?: KeyvOptions) { - super() - const emitErrors = options?.emitErrors === undefined ? true : options.emitErrors - uri = uri ?? options?.uri - /*if (!uri) { - throw Error('No URI provided') - }*/ - this.opts = { - namespace: 'keyv', - serialize: JSONB.stringify, - deserialize: JSONB.parse, - ...(typeof uri === 'string' ? { uri } : uri), - ...options, - } - - if (!this.opts.store) { - if (typeof uri !== 'string') { - this.opts.store = uri as KeyvStore - } /* else { - const adapterOptions = { ...this.opts } - this.opts.store = loadStore(adapterOptions) - }*/ - } - if (!this.opts.store) { - throw Error('No store') - } - - if (this.opts.compression) { - const compression = this.opts.compression - this.opts.serialize = compression.serialize.bind(compression) - this.opts.deserialize = compression.deserialize.bind(compression) - } - - if (typeof this.opts.store.on === 'function' && emitErrors) { - this.opts.store.on('error', (error) => this.emit('error', error)) - } - - this.opts.store.namespace = this.opts.namespace || 'keyv' - this.namespace = this.opts.store.namespace - - const generateIterator = (iterator: any, keyv: Keyv) => - async function* () { - for await (const [key, raw] of typeof iterator === 'function' ? iterator(keyv.store.namespace) : iterator) { - const data = await keyv.deserialize(raw) - if (keyv.store.namespace && !key.includes(keyv.store.namespace)) { - continue - } - - if (data && typeof data.expires === 'number' && Date.now() > data.expires) { - keyv.delete(key) - continue - } - - yield [keyv._getKeyUnprefix(key), data?.value] - } - } - - // Attach iterators - // @ts-ignore - if (typeof this.store[Symbol.iterator] === 'function' && this.store instanceof Map) { - this.iterator = generateIterator(this.store, this) - } else if (typeof this.store.iterator === 'function' && this.store.opts && this._checkIterableAdapter()) { - this.iterator = generateIterator(this.store.iterator.bind(this.store), this) - } - } - - get store(): Required> { - return this.opts.store as Required> - } - - get deserialize() { - return this.opts.deserialize! - } - - get serialize() { - return this.opts.serialize! - } - - _checkIterableAdapter() { - return ( - (this.store.opts.dialect && iterableAdapters.includes(this.store.opts.dialect)) || - (this.store.opts.url && iterableAdapters.findIndex((element) => this.store.opts.url.includes(element)) >= 0) - ) - } - - _getKeyPrefix(key: string): string { - return `${this.opts.namespace}:${key}` - } - - _getKeyPrefixArray(keys: string[]): string[] { - return keys.map((key) => this._getKeyPrefix(key)) - } - - _getKeyUnprefix(key: string): string { - return key.split(':').splice(1).join(':') - } - - async getMany(keys: string[], options?: { raw?: boolean }): Promise>> { - const keyPrefixed = this._getKeyPrefixArray(keys) - let promise: Promise>> - if (this.store.getMany !== undefined) { - promise = this.store.getMany(keyPrefixed, options) as Promise[]> //.then(value => !!value ? value.values() : undefined) - // todo: Probably wise to check expired ValueData here, if the getMany does not implement this feature itself! - } else { - promise = Promise.all(keyPrefixed.map((k) => this.store.get(k, options) as Promise>)) - } - const allValues = Promise.resolve(promise) - const results: Promise>[] = [] - - return Promise.resolve(allValues) - .then((all) => { - keys.forEach((key, index) => { - const data = all[index] - - let result = typeof data === 'string' ? this.deserialize(data) : !!data && this.opts.compression ? this.deserialize(data) : data - - if (result && typeof result === 'object' && 'expires' in result && typeof result.expires === 'number' && Date.now() > result.expires) { - this.delete(key) - result = undefined - } - - const final = ( - options && options.raw ? result : result && typeof result === 'object' && 'value' in result ? result.value : result - ) as Promise> - - results.push(final) - }) - }) - .then(() => Promise.all(results)) - } - - async get( - key: string | string[], - options?: { raw?: boolean } - ): Promise | KeyvStoredData[] | undefined> { - const isArray = Array.isArray(key) - return Promise.resolve() - .then(() => (isArray ? this.getMany(this._getKeyPrefixArray(key), options) : this.store.get(this._getKeyPrefix(key)))) - .then((data) => (typeof data === 'string' ? this.deserialize(data) : this.opts.compression ? this.deserialize(data) : data)) - .then((data) => { - if (data === undefined || data === null) { - return undefined - } - const rows = Array.isArray(data) ? data : [data] - - if (isArray) { - const result = [] - - for (let row of rows) { - if (row === undefined || row === null) { - result.push(undefined) - continue - } - - if (this.isExpired(row)) { - this.delete(key).then(() => undefined) - result.push(undefined) - } else { - result.push(options && options.raw ? row : toValue(row)) - } - } - - return result - } else if (!Array.isArray(data)) { - if (this.isExpired(data)) { - return this.delete(key).then(() => undefined) - } - } - - return options && options.raw ? data : Array.isArray(data) ? data.map((d) => toValue(d)) : toValue(data) - }) - } - - private isExpired(data: KeyvDeserializedData | string | Value): boolean { - return ( - typeof data !== 'string' && - data && - typeof data === 'object' && - 'expires' in data && - typeof data.expires === 'number' && - Date.now() > data.expires - ) - } - - set(key: string, value: Value, ttl?: number) { - const keyPrefixed = this._getKeyPrefix(key) - if (typeof ttl === 'undefined') { - ttl = this.opts.ttl - } - if (ttl === 0) { - ttl = undefined - } - - // @ts-ignore - return Promise.resolve() - .then(() => { - const expires = typeof ttl === 'number' ? Date.now() + ttl : undefined - if (typeof value === 'symbol') { - this.emit('error', 'symbol cannot be serialized') - } - - const input = { value, expires } - return this.serialize(input) - }) - .then((value) => this.store.set(keyPrefixed, value as Value, ttl)) - .then(() => true) - } - - delete(key: string | string[]) { - if (!Array.isArray(key)) { - const keyPrefixed = this._getKeyPrefix(key) - return Promise.resolve().then(() => this.store.delete(keyPrefixed)) - } - - const keyPrefixed = this._getKeyPrefixArray(key) - if (this.store.deleteMany !== undefined) { - return Promise.resolve().then(() => this.store.deleteMany!(keyPrefixed)) - } - - const promises = [] - for (const key of keyPrefixed) { - promises.push(this.store.delete(key)) - } - - return Promise.allSettled(promises).then((values) => values.every((x) => x.valueOf() === true)) - } - - async clear(): Promise { - return Promise.resolve().then(() => this.store.clear()) - } - - has(key: string) { - const keyPrefixed = this._getKeyPrefix(key) - return Promise.resolve().then(async () => { - if (typeof this.store.has === 'function') { - return this.store.has(keyPrefixed) - } - - const value = await this.store.get(keyPrefixed) - return value !== undefined - }) - } - - disconnect() { - if (typeof this.store.disconnect === 'function') { - return this.store.disconnect() - } - } -} - -const iterableAdapters = ['sqlite', 'postgres', 'mysql', 'mongo', 'redis', 'tiered'] - -function toValue(input: KeyvDeserializedData | string | Value) { - return input !== null && typeof input === 'object' && 'value' in input ? input.value : input -} diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/store-adapters/index.ts b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/store-adapters/index.ts deleted file mode 100644 index 1fe352d0b..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/store-adapters/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './tiered/index' -export * from './typeorm/index' diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/store-adapters/tiered/types.ts b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/store-adapters/tiered/types.ts deleted file mode 100644 index d808e3735..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/store-adapters/tiered/types.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { IKeyValueStoreAdapter } from '../../key-value-types' - -export type Options = { - local: IKeyValueStoreAdapter | Map - remote: IKeyValueStoreAdapter | Map - localOnly?: boolean - iterationLimit?: number | string -} - -// eslint-disable-next-line @typescript-eslint/naming-convention -export type Options_ = { - validator: (value: any, key: string) => boolean - dialect: string - iterationLimit?: number | string - localOnly?: boolean -} diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/store-adapters/typeorm/entities/keyValueStoreEntity.ts b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/store-adapters/typeorm/entities/keyValueStoreEntity.ts deleted file mode 100644 index 787fc7575..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/store-adapters/typeorm/entities/keyValueStoreEntity.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { BaseEntity, Column, Entity, PrimaryColumn } from 'typeorm' - -/** - * - * @beta This API may change without a BREAKING CHANGE notice. - */ -@Entity('keyvaluestore') -export class KeyValueStoreEntity extends BaseEntity { - @PrimaryColumn() - // @ts-ignore - key: string - - @Column({ - type: 'text', - }) - // @ts-ignore - data: string - - expires?: number -} diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/store-adapters/typeorm/index.ts b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/store-adapters/typeorm/index.ts deleted file mode 100644 index 5d58eec7a..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/store-adapters/typeorm/index.ts +++ /dev/null @@ -1,122 +0,0 @@ -import { EventEmitter } from 'events' -import { OrPromise } from '@veramo/utils' -import { DataSource, In, Like } from 'typeorm' -import { KeyValueStoreEntity } from './entities/keyValueStoreEntity' -import { KeyValueTypeORMOptions, Options_ } from './types' -import { KeyvStore, KeyvStoredData } from '../../keyv/keyv-types' -import { IKeyValueStoreAdapter } from '../../key-value-types' -import JSONB from 'json-buffer' - -export { KeyValueTypeORMOptions } from './types' -export { KeyValueStoreEntity } from './entities/keyValueStoreEntity' -export { kvStoreMigrations } from './migrations' - -export class KeyValueTypeORMStoreAdapter extends EventEmitter implements KeyvStore, IKeyValueStoreAdapter { - private readonly dbConnection: OrPromise - readonly namespace: string - opts: Options_ - - constructor(options: KeyValueTypeORMOptions) { - super() - this.dbConnection = options.dbConnection - this.namespace = options.namespace || 'keyv' - this.opts = { - validator: () => true, - dialect: 'typeorm', - serialize: JSONB.stringify, - deserialize: JSONB.parse, - ...options, - } - } - - async get(key: string | string[], options?: { raw?: boolean }): Promise | Array>> { - if (Array.isArray(key)) { - return this.getMany(key, options) - } - const connection = await getConnectedDb(this.dbConnection) - const result = await connection.getRepository(KeyValueStoreEntity).findOneBy({ - key, - }) - return options?.raw !== true || !result ? result?.data : { value: result?.data, expires: result?.expires } - } - - async getMany(keys: string[], options?: { raw?: boolean }): Promise>> { - const connection = await getConnectedDb(this.dbConnection) - const results = await connection.getRepository(KeyValueStoreEntity).findBy({ - key: In(keys), - }) - const values = keys.map(async (key) => { - const result = results.find((result) => result.key === key) - return options?.raw !== true || !result - ? (result?.data as KeyvStoredData) - : ({ - value: result?.data ? (await this.opts.deserialize(result.data))?.value : undefined, - expires: result?.expires, - } as KeyvStoredData) - }) - - return Promise.all(values) - } - - async set(key: string, value: string, ttl?: number): Promise> { - const connection = await getConnectedDb(this.dbConnection) - const entity = new KeyValueStoreEntity() - entity.key = key - entity.data = value - entity.expires = ttl - await connection.getRepository(KeyValueStoreEntity).save(entity) - return { value: value, expires: ttl } - } - - async delete(key: string | string[]): Promise { - if (Array.isArray(key)) { - return this.deleteMany(key) - } - const connection = await getConnectedDb(this.dbConnection) - const result = await connection.getRepository(KeyValueStoreEntity).delete({ key }) - return result.affected === 1 - } - - async deleteMany(keys: string[]): Promise { - const connection = await getConnectedDb(this.dbConnection) - const results = await connection.getRepository(KeyValueStoreEntity).delete({ - key: In(keys), - }) - return !!results.affected && results.affected >= 1 - } - - async clear(): Promise { - const connection = await getConnectedDb(this.dbConnection) - await connection.getRepository(KeyValueStoreEntity).delete({ - key: Like(`${this.namespace}:%`), - }) - } - - async has(key: string): Promise { - const connection = await getConnectedDb(this.dbConnection) - const result = await connection.getRepository(KeyValueStoreEntity).countBy({ - key, - }) - return result === 1 - } - - async disconnect(): Promise { - const connection = await getConnectedDb(this.dbConnection) - connection.destroy() - } -} - -/** - * Ensures that the provided DataSource is connected. - * - * @param dbConnection - a TypeORM DataSource or a Promise that resolves to a DataSource - */ -export async function getConnectedDb(dbConnection: OrPromise): Promise { - if (dbConnection instanceof Promise) { - return await dbConnection - } else if (!dbConnection.isInitialized) { - return await (dbConnection).initialize() - } else { - return dbConnection - } -} diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/store-adapters/typeorm/migrations/1.createKVDatabase.ts b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/store-adapters/typeorm/migrations/1.createKVDatabase.ts deleted file mode 100644 index 81b06435b..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/store-adapters/typeorm/migrations/1.createKVDatabase.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { MigrationInterface, QueryRunner, Table } from 'typeorm' -import Debug from 'debug' -const debug = Debug('veramo:kv-store:initial-migration') - -/** - * Create the database layout for Veramo 3.0 - * - * @public - */ -export class CreateKVDatabaseMigration implements MigrationInterface { - private readonly _tableName: string - readonly name: string - - constructor(tableName?: string) { - this._tableName = tableName || 'keyvaluestore' - this.name = `CreateKVDatabase${tableName}1680297189001` - } - - async up(queryRunner: QueryRunner): Promise { - function getTableName(givenName: string): string { - return queryRunner.connection.entityMetadatas.find((meta) => meta.givenTableName === givenName)?.tableName || givenName - } - - debug(`creating ${this._tableName} table`) - // CREATE TABLE "keyvaluestore" ("key" varchar PRIMARY KEY NOT NULL, "data" text NOT NULL) - await queryRunner.createTable( - new Table({ - name: getTableName(this._tableName), - columns: [ - { name: 'key', type: 'varchar', isPrimary: true }, - { name: 'data', type: 'text', isNullable: false }, - ], - indices: [ - { - columnNames: ['key'], - isUnique: true, - }, - ], - }), - true - ) - } - - async down(queryRunner: QueryRunner): Promise { - throw new Error('illegal_operation: cannot roll back initial migration') - } -} diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/store-adapters/typeorm/migrations/index.ts b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/store-adapters/typeorm/migrations/index.ts deleted file mode 100644 index 6d6075eb5..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/store-adapters/typeorm/migrations/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { CreateKVDatabaseMigration } from './1.createKVDatabase' - -/** - * The migrations array that SHOULD be used when initializing a TypeORM database connection. - * - * These ensure the correct creation of tables and the proper migrations of data when tables change between versions. - * - * @public - */ -export const kvStoreMigrations = [CreateKVDatabaseMigration] diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/store-adapters/typeorm/types.ts b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/store-adapters/typeorm/types.ts deleted file mode 100644 index fb2dcc33f..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/src/store-adapters/typeorm/types.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { OrPromise } from '@veramo/utils' -import { DataSource } from 'typeorm' -import { KeyvDeserializedData } from '../../keyv/keyv-types' - -export type KeyValueTypeORMOptions = { - dbConnection: OrPromise - - namespace?: string -} - -// eslint-disable-next-line @typescript-eslint/naming-convention -export type Options_ = { - validator: (value: any, key: string) => boolean - dialect: string - serialize: (data: KeyvDeserializedData) => OrPromise - /** A custom deserialization function. */ - deserialize: (data: any) => OrPromise | undefined> -} diff --git a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/yalc.sig b/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/yalc.sig deleted file mode 100644 index 44752dbc7..000000000 --- a/packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store/yalc.sig +++ /dev/null @@ -1 +0,0 @@ -bfd8bfc89f0050ba31664b2d7c3efc7a \ No newline at end of file diff --git a/packages/siopv2-oid4vp-rp-auth/package.json b/packages/siopv2-oid4vp-rp-auth/package.json index 3e5112a99..2042d43c2 100644 --- a/packages/siopv2-oid4vp-rp-auth/package.json +++ b/packages/siopv2-oid4vp-rp-auth/package.json @@ -25,7 +25,7 @@ "@types/uuid": "^9.0.1", "@veramo/core": "4.2.0", "@veramo/credential-w3c": "4.2.0", - "@veramo/kv-store": "file:.yalc/@veramo/kv-store", + "@sphereon/ssi-sdk.kv-store-temp": "workspace:*", "cross-fetch": "^3.1.5", "uuid": "^8.3.2" }, diff --git a/packages/siopv2-oid4vp-rp-auth/tsconfig.json b/packages/siopv2-oid4vp-rp-auth/tsconfig.json index d535317e7..831f5f7e8 100644 --- a/packages/siopv2-oid4vp-rp-auth/tsconfig.json +++ b/packages/siopv2-oid4vp-rp-auth/tsconfig.json @@ -7,9 +7,20 @@ "esModuleInterop": true }, "references": [ - { "path": "../siopv2-oid4vp-common" }, - { "path": "../presentation-exchange" }, - { "path": "../ssi-types" }, - { "path": "../ssi-sdk-core" } + { + "path": "../siopv2-oid4vp-common" + }, + { + "path": "../presentation-exchange" + }, + { + "path": "../ssi-types" + }, + { + "path": "../ssi-sdk-core" + }, + { + "path": "../kv-store" + } ] } diff --git a/packages/siopv2-oid4vp-rp-auth/yalc.lock b/packages/siopv2-oid4vp-rp-auth/yalc.lock deleted file mode 100644 index 0d032f29f..000000000 --- a/packages/siopv2-oid4vp-rp-auth/yalc.lock +++ /dev/null @@ -1,10 +0,0 @@ -{ - "version": "v1", - "packages": { - "@veramo/kv-store": { - "version": "4.3.0", - "signature": "bfd8bfc89f0050ba31664b2d7c3efc7a", - "file": true - } - } -} \ No newline at end of file diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/LICENSE b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/LICENSE deleted file mode 100644 index fd815d7f8..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2019 Consensys AG - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/README.md b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/README.md deleted file mode 100644 index a67d88026..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/README.md +++ /dev/null @@ -1,132 +0,0 @@ -# Veramo Key Value store - -A simple typed Key Value store with out of the box support for in memory/maps, sqlite and typeorm implementations for -usage in browser, NodeJS and React-Native. -It includes a tiered local/remote implementation that support all environments. - -# Usage in your application or module - -## setup - -Veramo provides 3 store adapters out of the box. The first is an in memory Map based store, the second is a TypeORM -based store, meaning we support multiple databases. Lastly there is a tiered store, which allows you to use a local and -remote store together. - -You should also be able to use store adapters from the [keyv](https://github.com/jaredwray/keyv) project. Be aware that -Veramo uses an internal fork of that project, as we have several constraints not present in the upstream project. As a -result the adapters are not guaranteed to work in your environment. -See [Keyv project relationship](#keyv-project-relationship) for more information. - -### Map based in memory store - -This is the simplest implementation where a Map is being used to store the Keys and Values - -```typescript -import { IKeyValueStore, IKeyValueStoreOptions, KeyValueStore } from '@veramo/key-value-store' - -const options: IKeyValueStoreOptions = { - namespace: 'example', - store: new Map(), -} -const kvStore: IKeyValueStore = new KeyValueStore({ options }) -``` - -### TypeORM store - -This implementation uses TypeORM using a simple entity to store the namespace prefixed key, an expiration value and the -value itself. It supports multiple database backends. - -```typescript -import { IKeyValueStore, IKeyValueStoreOptions, KeyValueStore, KeyValueStoreEntity, KeyValueTypeORMStoreAdapter } from '@veramo/key-value-store' -import { DataSource } from 'typeorm' - -const dbConnection: DataSource = await new DataSource({ - type: 'sqlite', - database: ':memory:', - logging: 'all', - migrationsRun: true, - synchronize: false, - entities: [KeyValueStoreEntity], -}).initialize() - -const options: IKeyValueStoreOptions = { - namespace: 'example', - store: new KeyValueTypeORMStoreAdapter({ dbConnection }), -} -const kvStore: IKeyValueStore = new KeyValueStore({ options }) -``` - -### Tiered store - -The tiered store expects a local store and a remote store. Obviously it makes most sense to have a memory based local -store and potentially more expensive/slower remote store - -```typescript -import { - kvStoreMigrations, - IKeyValueStore, - IKeyValueStoreOptions, - KeyValueStore, - KeyValueStoreEntity, - KeyValueTieredStoreAdapter, - KeyValueTypeORMStoreAdapter, -} from '@veramo/key-value-store' -import { DataSource } from 'typeorm' - -dbConnection = await new DataSource({ - type: 'sqlite', - database: ':memory:', - logging: 'all', - migrationsRun: true, - synchronize: false, - migrations: [...kvStoreMigrations], - entities: [KeyValueStoreEntity], -}).initialize() - -const local: Map = new Map() -const remote = new KeyValueTypeORMStoreAdapter({ dbConnection }) - -const options: IKeyValueStoreOptions = { - namespace: 'example', - store: new KeyValueTieredStoreAdapter({ local, remote }), -} -const kvStore: IKeyValueStore = new KeyValueStore({ options }) -``` - -## Usage - -After you have setup the Key Value Store as described above in your agent, it will be available in your agent. - -```typescript -kvStore.set('hello', { example: world }) // Stores the value object by key untill deleted -kvStore.set('expiring', { example: 'expiration' }, 1000) // Stores the value object by key for 1 second -const value = await kvStore.get('hello') // { example: world } -const values = await kvStore.getMany(['hello', 'expiring']) // [{ example: world }, {example: expiring}] - -if (await kvStore.has('hello')) { - await kvStore.delete('hello') // return a boolean for success. You can also call it on non existing keys, which will return false -} - -await kvStore.clear() // Removes all keys/values from the store -kvStore.disconnect() // disconnects the store from it backing adapter. You cannot reuse the store afterwards unlesss you initialize a new store. -``` - -# Keyv project relationship - -Please note that a large portion of the Veramo Key Value Store code is a port of -the [keyv](https://github.com/jaredwray/keyv) project, adding support for Typescript and ESM, so it can be used Veramo - -The ported code should support the storage plugins available for the keyv project, although testing has been limited -Veramo itself has a requirement to support NodeJS, Browser and React-Native environments. The port and the store -adapters included in Veramo run in these environments. -Please be aware that these requirements probably aren't true for any keyv storage plugins. - -One of the big changes compared to the upstream project is that this port does not have dynamic loading of adapters -based on URIs. We believe that any Veramo Key Value store should use explicit defined adapters. - -The keyv port is part of the Veramo Key Value Store module code itself, as we do not want to make an official maintained port at this point. - -Veramo exposes its own API/interfaces for the Key Value store, meaning we could also support any other implementation in -the future - -We welcome any new storage modules diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/index.d.ts b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/index.d.ts deleted file mode 100644 index 100b7cb44..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/index.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Provides a {@link @veramo/kv-store#KeyValueStore} for the - * {@link @veramo/core#Agent} plugin that implements {@link @veramo/kv-store#IKeyValueStore} interface - * - * @packageDocumentation - */ -export { KeyValueStore } from './key-value-store' -export * from './store-adapters/tiered/index' -export * from './store-adapters/typeorm/index' -export * from './key-value-types' -//# sourceMappingURL=index.d.ts.map diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/index.js b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/index.js deleted file mode 100644 index 5ec5ef502..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/index.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict' -var __createBinding = - (this && this.__createBinding) || - (Object.create - ? function (o, m, k, k2) { - if (k2 === undefined) k2 = k - var desc = Object.getOwnPropertyDescriptor(m, k) - if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { - enumerable: true, - get: function () { - return m[k] - }, - } - } - Object.defineProperty(o, k2, desc) - } - : function (o, m, k, k2) { - if (k2 === undefined) k2 = k - o[k2] = m[k] - }) -var __exportStar = - (this && this.__exportStar) || - function (m, exports) { - for (var p in m) if (p !== 'default' && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p) - } -Object.defineProperty(exports, '__esModule', { value: true }) -exports.KeyValueStore = void 0 -/** - * Provides a {@link @veramo/kv-store#KeyValueStore} for the - * {@link @veramo/core#Agent} plugin that implements {@link @veramo/kv-store#IKeyValueStore} interface - * - * @packageDocumentation - */ -var key_value_store_1 = require('./key-value-store') -Object.defineProperty(exports, 'KeyValueStore', { - enumerable: true, - get: function () { - return key_value_store_1.KeyValueStore - }, -}) -__exportStar(require('./store-adapters/tiered/index'), exports) -__exportStar(require('./store-adapters/typeorm/index'), exports) -__exportStar(require('./key-value-types'), exports) -//# sourceMappingURL=index.js.map diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/key-value-store.d.ts b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/key-value-store.d.ts deleted file mode 100644 index 14805470b..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/key-value-store.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { IKeyValueStore, IKeyValueStoreOnArgs, IKeyValueStoreOptions, IValueData } from './key-value-types' -/** - * Agent plugin that implements {@link @veramo/kv-store#IKeyValueStore} interface - * @public - */ -export declare class KeyValueStore implements IKeyValueStore { - /** - * The main keyv typescript port which delegates to the storage adapters and takes care of some common functionality - * - * @private - */ - private readonly keyv - constructor(options: IKeyValueStoreOptions) - get(key: string): Promise - getAsValueData(key: string): Promise> - getMany(keys: string[]): Promise> - getManyAsValueData(keys: string[]): Promise>> - set(key: string, value: ValueType, ttl?: number): Promise> - has(key: string): Promise - delete(key: string): Promise - deleteMany(keys: string[]): Promise - clear(): Promise> - disconnect(): Promise - kvStoreOn(args: IKeyValueStoreOnArgs): Promise> - private toDeserializedValueData -} -//# sourceMappingURL=key-value-store.d.ts.map diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/key-value-store.js b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/key-value-store.js deleted file mode 100644 index dc8796972..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/key-value-store.js +++ /dev/null @@ -1,143 +0,0 @@ -'use strict' -var __awaiter = - (this && this.__awaiter) || - function (thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P - ? value - : new P(function (resolve) { - resolve(value) - }) - } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)) - } catch (e) { - reject(e) - } - } - function rejected(value) { - try { - step(generator['throw'](value)) - } catch (e) { - reject(e) - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected) - } - step((generator = generator.apply(thisArg, _arguments || [])).next()) - }) - } -Object.defineProperty(exports, '__esModule', { value: true }) -exports.KeyValueStore = void 0 -const keyv_1 = require('./keyv/keyv') -/** - * Agent plugin that implements {@link @veramo/kv-store#IKeyValueStore} interface - * @public - */ -class KeyValueStore { - constructor(options) { - this.keyv = new keyv_1.Keyv(options.uri, options) - } - get(key) { - return __awaiter(this, void 0, void 0, function* () { - const result = yield this.keyv.get(key, { raw: false }) - if (result === null || result === undefined) { - return undefined - } - return result - }) - } - getAsValueData(key) { - return __awaiter(this, void 0, void 0, function* () { - const result = yield this.keyv.get(key, { raw: true }) - if (result === null || result === undefined) { - // We always return a ValueData object for this method - return { value: undefined, expires: undefined } - } - return this.toDeserializedValueData(result) - }) - } - getMany(keys) { - return __awaiter(this, void 0, void 0, function* () { - if (!keys || keys.length === 0) { - return [] - } - let result = yield this.keyv.getMany(keys, { raw: false }) - // Making sure we return the same array length as the amount of key(s) passed in - if (result === null || result === undefined || result.length === 0) { - result = new Array() - keys.forEach(() => result.push(undefined)) - } - return result.map((v) => (!!v ? v : undefined)) - }) - } - getManyAsValueData(keys) { - return __awaiter(this, void 0, void 0, function* () { - if (!keys || keys.length === 0) { - return [] - } - let result = yield this.keyv.getMany(keys, { raw: true }) - // Making sure we return the same array length as the amount of key(s) passed in - if (result === null || result === undefined || result.length === 0) { - result = new Array() - keys.forEach(() => result.push({ value: undefined, expires: undefined })) - } - return result.map((v) => (!!v ? this.toDeserializedValueData(v) : { value: undefined, expires: undefined })) - }) - } - set(key, value, ttl) { - return __awaiter(this, void 0, void 0, function* () { - return this.keyv.set(key, value, ttl).then(() => this.getAsValueData(key)) - }) - } - has(key) { - return __awaiter(this, void 0, void 0, function* () { - return this.keyv.has(key) - }) - } - delete(key) { - return __awaiter(this, void 0, void 0, function* () { - return this.keyv.delete(key) - }) - } - deleteMany(keys) { - return __awaiter(this, void 0, void 0, function* () { - return Promise.all(keys.map((key) => this.keyv.delete(key))) - }) - } - clear() { - return __awaiter(this, void 0, void 0, function* () { - return this.keyv.clear().then(() => this) - }) - } - disconnect() { - return __awaiter(this, void 0, void 0, function* () { - return this.keyv.disconnect() - }) - } - // Public so parties using the kv store directly can add listeners if they want - kvStoreOn(args) { - return __awaiter(this, void 0, void 0, function* () { - this.keyv.on(args.eventName, args.listener) - return this - }) - } - toDeserializedValueData(result) { - if (result === null || result === undefined) { - throw Error(`Result cannot be undefined or null at this this point`) - } else if (typeof result !== 'object') { - return { value: result, expires: undefined } - } else if (!('value' in result)) { - return { value: result, expires: undefined } - } - if (!('expires' in result)) { - result.expires = undefined - } - return result - } -} -exports.KeyValueStore = KeyValueStore -//# sourceMappingURL=key-value-store.js.map diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/key-value-types.d.ts b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/key-value-types.d.ts deleted file mode 100644 index eeffd56c4..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/key-value-types.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -/** - * This is how the store will actually store the value. - * It contains an optional `expires` property, which indicates when the value would expire - */ -export interface IValueData { - value: ValueType | undefined - expires: number | undefined -} -export interface IKeyValueStoreOnArgs { - eventName: string | symbol - listener: (...args: any[]) => void -} -export interface IKeyValueStoreOptions { - [key: string]: any - /** Namespace for the current instance. */ - namespace?: string | undefined - /** A custom serialization function. */ - /** The connection string URI. */ - uri?: string | undefined - /** The storage adapter instance to be used by Keyv. or any other implementation */ - store: IKeyValueStoreAdapter | Map - /** Default TTL. Can be overridden by specifying a TTL on `.set()`. */ - ttl?: number | undefined - /** Enable compression option **/ - emitErrors?: boolean -} -export interface IKeyValueStoreAdapter { - namespace?: string | undefined -} -export interface IKeyValueStore { - /** - * Get a single value by key. Can be undefined as the underlying store typically will not throw an error for a non existing key - * - * @param key Contains the key to search for - */ - get(key: string): Promise - /** - * Get a single item as Value Data from the store. Will always return a Value Data Object, but the value in it can be undefined in case the actual store does not contain the value - * @param key Contains the key to search for - */ - getAsValueData(key: string): Promise> - getMany(keys: string[]): Promise> - getManyAsValueData(keys: string[]): Promise>> - set(key: string, value: ValueType, ttl?: number): Promise> - delete(key: string): Promise - deleteMany(keys: string[]): Promise - clear(): Promise> - has(key: string): Promise - disconnect(): Promise -} -//# sourceMappingURL=key-value-types.d.ts.map diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/key-value-types.js b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/key-value-types.js deleted file mode 100644 index b18e238d9..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/key-value-types.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' -Object.defineProperty(exports, '__esModule', { value: true }) -//# sourceMappingURL=key-value-types.js.map diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/keyv/keyv-types.d.ts b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/keyv/keyv-types.d.ts deleted file mode 100644 index 2cc77cad0..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/keyv/keyv-types.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Please be aware these types are compatible with the keyv package, to ensure we can use its store-adapters for free. - * - * Be very careful when extending/changing!. Normally you will want to create an adapter or decorator for your additional behaviour or requirements - */ -import { OrPromise } from '@veramo/utils' -export interface KeyvOptions { - [key: string]: any - /** Namespace for the current instance. */ - namespace?: string | undefined - /** A custom serialization function. */ - serialize?: (data: KeyvDeserializedData) => OrPromise - /** A custom deserialization function. */ - deserialize?: (data: any) => OrPromise | undefined> - /** The connection string URI. */ - uri?: string | undefined - /** The storage adapter instance to be used by Keyv. */ - store?: KeyvStore | undefined - /** Default TTL. Can be overridden by specififying a TTL on `.set()`. */ - ttl?: number | undefined - /** Specify an adapter to use. e.g `'redis'` or `'mongodb'`. */ - adapter?: 'redis' | 'mongodb' | 'mongo' | 'sqlite' | 'postgresql' | 'postgres' | 'mysql' | object | string | undefined - /** Enable compression option **/ - compression?: KeyvCompressionAdapter | undefined - emitErrors?: boolean -} -export interface KeyvCompressionAdapter { - compress(value: any, options?: any): OrPromise - decompress(value: any, options?: any): OrPromise - serialize(value: any): OrPromise - deserialize(value: any): OrPromise -} -export interface KeyvDeserializedData { - value: Value - expires: number | undefined -} -export type KeyvStoredData = KeyvDeserializedData | string | Value | undefined -export interface KeyvStore { - namespace?: string | undefined - opts: KeyvOptions - on?(eventName: string | symbol, listener: (...args: any[]) => void): void - get( - key: string | string[], - options?: { - raw?: boolean - } - ): OrPromise | Array>> - getMany?( - keys: string[], - options?: { - raw?: boolean - } - ): OrPromise>> | undefined - iterator?(namespace?: string | undefined): AsyncGenerator - set(key: string, value: Value, ttl?: number): any - delete(key: string | string[]): OrPromise - deleteMany?(keys: string[]): OrPromise - clear(): OrPromise - has?(key: string): OrPromise - disconnect?(): void -} -//# sourceMappingURL=keyv-types.d.ts.map diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/keyv/keyv-types.js b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/keyv/keyv-types.js deleted file mode 100644 index 305adbbfd..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/keyv/keyv-types.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' -Object.defineProperty(exports, '__esModule', { value: true }) -//# sourceMappingURL=keyv-types.js.map diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/keyv/keyv.d.ts b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/keyv/keyv.d.ts deleted file mode 100644 index d7673e575..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/keyv/keyv.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -/// -import { EventEmitter } from 'events' -import { KeyvDeserializedData, KeyvOptions, KeyvStore, KeyvStoredData } from './keyv-types' -/** - * Please note that this is code adapted from @link https://github.com/jaredwray/keyv to support Typescript and ESM in Veramo - * - * The code should support the storage plugins available for the keyv project. - * Veramo itself supports NodeJS, Browser and React-Native environment. - * Please be aware that these requirements probably aren't true for any keyv storage plugins. - * - * 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. - * We believe that any Veramo Key Value store should use explicitly defined store-adapters. - * - * 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. - * Veramo exposes its own API/interfaces for the Key Value store, meaning we could also support any other implementation in the future - * - * The Veramo kv-store module provides out of the box support for in memory/maps, sqlite and typeorm implementations, - * including a tiered local/remote implementation that support all environments. - * - * We welcome any new storage modules - */ -export declare class Keyv extends EventEmitter implements KeyvStore { - readonly opts: KeyvOptions - readonly namespace: string - iterator?: (namespace?: string) => AsyncGenerator - constructor(uri?: string | Map | KeyvStore | undefined, options?: KeyvOptions) - get store(): Required> - get deserialize(): (data: any) => import('@veramo/utils').OrPromise | undefined> - get serialize(): (data: KeyvDeserializedData) => import('@veramo/utils').OrPromise - _checkIterableAdapter(): any - _getKeyPrefix(key: string): string - _getKeyPrefixArray(keys: string[]): string[] - _getKeyUnprefix(key: string): string - getMany( - keys: string[], - options?: { - raw?: boolean - } - ): Promise>> - get( - key: string | string[], - options?: { - raw?: boolean - } - ): Promise | KeyvStoredData[] | undefined> - private isExpired - set(key: string, value: Value, ttl?: number): Promise - delete(key: string | string[]): Promise - clear(): Promise - has(key: string): Promise - disconnect(): void -} -//# sourceMappingURL=keyv.d.ts.map diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/keyv/keyv.js b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/keyv/keyv.js deleted file mode 100644 index 5620d367a..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/keyv/keyv.js +++ /dev/null @@ -1,385 +0,0 @@ -'use strict' -var __awaiter = - (this && this.__awaiter) || - function (thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P - ? value - : new P(function (resolve) { - resolve(value) - }) - } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)) - } catch (e) { - reject(e) - } - } - function rejected(value) { - try { - step(generator['throw'](value)) - } catch (e) { - reject(e) - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected) - } - step((generator = generator.apply(thisArg, _arguments || [])).next()) - }) - } -var __asyncValues = - (this && this.__asyncValues) || - function (o) { - if (!Symbol.asyncIterator) throw new TypeError('Symbol.asyncIterator is not defined.') - var m = o[Symbol.asyncIterator], - i - return m - ? m.call(o) - : ((o = typeof __values === 'function' ? __values(o) : o[Symbol.iterator]()), - (i = {}), - verb('next'), - verb('throw'), - verb('return'), - (i[Symbol.asyncIterator] = function () { - return this - }), - i) - function verb(n) { - i[n] = - o[n] && - function (v) { - return new Promise(function (resolve, reject) { - ;(v = o[n](v)), settle(resolve, reject, v.done, v.value) - }) - } - } - function settle(resolve, reject, d, v) { - Promise.resolve(v).then(function (v) { - resolve({ value: v, done: d }) - }, reject) - } - } -var __await = - (this && this.__await) || - function (v) { - return this instanceof __await ? ((this.v = v), this) : new __await(v) - } -var __asyncGenerator = - (this && this.__asyncGenerator) || - function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError('Symbol.asyncIterator is not defined.') - var g = generator.apply(thisArg, _arguments || []), - i, - q = [] - return ( - (i = {}), - verb('next'), - verb('throw'), - verb('return'), - (i[Symbol.asyncIterator] = function () { - return this - }), - i - ) - function verb(n) { - if (g[n]) - i[n] = function (v) { - return new Promise(function (a, b) { - q.push([n, v, a, b]) > 1 || resume(n, v) - }) - } - } - function resume(n, v) { - try { - step(g[n](v)) - } catch (e) { - settle(q[0][3], e) - } - } - function step(r) { - r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r) - } - function fulfill(value) { - resume('next', value) - } - function reject(value) { - resume('throw', value) - } - function settle(f, v) { - if ((f(v), q.shift(), q.length)) resume(q[0][0], q[0][1]) - } - } -var __importDefault = - (this && this.__importDefault) || - function (mod) { - return mod && mod.__esModule ? mod : { default: mod } - } -Object.defineProperty(exports, '__esModule', { value: true }) -exports.Keyv = void 0 -const events_1 = require('events') -const json_buffer_1 = __importDefault(require('json-buffer')) -/** - * Please note that this is code adapted from @link https://github.com/jaredwray/keyv to support Typescript and ESM in Veramo - * - * The code should support the storage plugins available for the keyv project. - * Veramo itself supports NodeJS, Browser and React-Native environment. - * Please be aware that these requirements probably aren't true for any keyv storage plugins. - * - * 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. - * We believe that any Veramo Key Value store should use explicitly defined store-adapters. - * - * 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. - * Veramo exposes its own API/interfaces for the Key Value store, meaning we could also support any other implementation in the future - * - * The Veramo kv-store module provides out of the box support for in memory/maps, sqlite and typeorm implementations, - * including a tiered local/remote implementation that support all environments. - * - * We welcome any new storage modules - */ -class Keyv extends events_1.EventEmitter { - constructor(uri, options) { - super() - const emitErrors = (options === null || options === void 0 ? void 0 : options.emitErrors) === undefined ? true : options.emitErrors - uri = uri !== null && uri !== void 0 ? uri : options === null || options === void 0 ? void 0 : options.uri - /*if (!uri) { - throw Error('No URI provided') - }*/ - this.opts = Object.assign( - Object.assign( - { namespace: 'keyv', serialize: json_buffer_1.default.stringify, deserialize: json_buffer_1.default.parse }, - typeof uri === 'string' ? { uri } : uri - ), - options - ) - if (!this.opts.store) { - if (typeof uri !== 'string') { - this.opts.store = uri - } /* else { - const adapterOptions = { ...this.opts } - this.opts.store = loadStore(adapterOptions) - }*/ - } - if (!this.opts.store) { - throw Error('No store') - } - if (this.opts.compression) { - const compression = this.opts.compression - this.opts.serialize = compression.serialize.bind(compression) - this.opts.deserialize = compression.deserialize.bind(compression) - } - if (typeof this.opts.store.on === 'function' && emitErrors) { - this.opts.store.on('error', (error) => this.emit('error', error)) - } - this.opts.store.namespace = this.opts.namespace || 'keyv' - this.namespace = this.opts.store.namespace - const generateIterator = (iterator, keyv) => - function () { - return __asyncGenerator(this, arguments, function* () { - var _a, e_1, _b, _c - try { - for ( - var _d = true, _e = __asyncValues(typeof iterator === 'function' ? iterator(keyv.store.namespace) : iterator), _f; - (_f = yield __await(_e.next())), (_a = _f.done), !_a; - - ) { - _c = _f.value - _d = false - try { - const [key, raw] = _c - const data = yield __await(keyv.deserialize(raw)) - if (keyv.store.namespace && !key.includes(keyv.store.namespace)) { - continue - } - if (data && typeof data.expires === 'number' && Date.now() > data.expires) { - keyv.delete(key) - continue - } - yield yield __await([keyv._getKeyUnprefix(key), data === null || data === void 0 ? void 0 : data.value]) - } finally { - _d = true - } - } - } catch (e_1_1) { - e_1 = { error: e_1_1 } - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e)) - } finally { - if (e_1) throw e_1.error - } - } - }) - } - // Attach iterators - // @ts-ignore - if (typeof this.store[Symbol.iterator] === 'function' && this.store instanceof Map) { - this.iterator = generateIterator(this.store, this) - } else if (typeof this.store.iterator === 'function' && this.store.opts && this._checkIterableAdapter()) { - this.iterator = generateIterator(this.store.iterator.bind(this.store), this) - } - } - get store() { - return this.opts.store - } - get deserialize() { - return this.opts.deserialize - } - get serialize() { - return this.opts.serialize - } - _checkIterableAdapter() { - return ( - (this.store.opts.dialect && iterableAdapters.includes(this.store.opts.dialect)) || - (this.store.opts.url && iterableAdapters.findIndex((element) => this.store.opts.url.includes(element)) >= 0) - ) - } - _getKeyPrefix(key) { - return `${this.opts.namespace}:${key}` - } - _getKeyPrefixArray(keys) { - return keys.map((key) => this._getKeyPrefix(key)) - } - _getKeyUnprefix(key) { - return key.split(':').splice(1).join(':') - } - getMany(keys, options) { - return __awaiter(this, void 0, void 0, function* () { - const keyPrefixed = this._getKeyPrefixArray(keys) - let promise - if (this.store.getMany !== undefined) { - promise = this.store.getMany(keyPrefixed, options) //.then(value => !!value ? value.values() : undefined) - // todo: Probably wise to check expired ValueData here, if the getMany does not implement this feature itself! - } else { - promise = Promise.all(keyPrefixed.map((k) => this.store.get(k, options))) - } - const allValues = Promise.resolve(promise) - const results = [] - return Promise.resolve(allValues) - .then((all) => { - keys.forEach((key, index) => { - const data = all[index] - let result = typeof data === 'string' ? this.deserialize(data) : !!data && this.opts.compression ? this.deserialize(data) : data - if (result && typeof result === 'object' && 'expires' in result && typeof result.expires === 'number' && Date.now() > result.expires) { - this.delete(key) - result = undefined - } - const final = options && options.raw ? result : result && typeof result === 'object' && 'value' in result ? result.value : result - results.push(final) - }) - }) - .then(() => Promise.all(results)) - }) - } - get(key, options) { - return __awaiter(this, void 0, void 0, function* () { - const isArray = Array.isArray(key) - return Promise.resolve() - .then(() => (isArray ? this.getMany(this._getKeyPrefixArray(key), options) : this.store.get(this._getKeyPrefix(key)))) - .then((data) => (typeof data === 'string' ? this.deserialize(data) : this.opts.compression ? this.deserialize(data) : data)) - .then((data) => { - if (data === undefined || data === null) { - return undefined - } - const rows = Array.isArray(data) ? data : [data] - if (isArray) { - const result = [] - for (let row of rows) { - if (row === undefined || row === null) { - result.push(undefined) - continue - } - if (this.isExpired(row)) { - this.delete(key).then(() => undefined) - result.push(undefined) - } else { - result.push(options && options.raw ? row : toValue(row)) - } - } - return result - } else if (!Array.isArray(data)) { - if (this.isExpired(data)) { - return this.delete(key).then(() => undefined) - } - } - return options && options.raw ? data : Array.isArray(data) ? data.map((d) => toValue(d)) : toValue(data) - }) - }) - } - isExpired(data) { - return ( - typeof data !== 'string' && - data && - typeof data === 'object' && - 'expires' in data && - typeof data.expires === 'number' && - Date.now() > data.expires - ) - } - set(key, value, ttl) { - const keyPrefixed = this._getKeyPrefix(key) - if (typeof ttl === 'undefined') { - ttl = this.opts.ttl - } - if (ttl === 0) { - ttl = undefined - } - // @ts-ignore - return Promise.resolve() - .then(() => { - const expires = typeof ttl === 'number' ? Date.now() + ttl : undefined - if (typeof value === 'symbol') { - this.emit('error', 'symbol cannot be serialized') - } - const input = { value, expires } - return this.serialize(input) - }) - .then((value) => this.store.set(keyPrefixed, value, ttl)) - .then(() => true) - } - delete(key) { - if (!Array.isArray(key)) { - const keyPrefixed = this._getKeyPrefix(key) - return Promise.resolve().then(() => this.store.delete(keyPrefixed)) - } - const keyPrefixed = this._getKeyPrefixArray(key) - if (this.store.deleteMany !== undefined) { - return Promise.resolve().then(() => this.store.deleteMany(keyPrefixed)) - } - const promises = [] - for (const key of keyPrefixed) { - promises.push(this.store.delete(key)) - } - return Promise.allSettled(promises).then((values) => values.every((x) => x.valueOf() === true)) - } - clear() { - return __awaiter(this, void 0, void 0, function* () { - return Promise.resolve().then(() => this.store.clear()) - }) - } - has(key) { - const keyPrefixed = this._getKeyPrefix(key) - return Promise.resolve().then(() => - __awaiter(this, void 0, void 0, function* () { - if (typeof this.store.has === 'function') { - return this.store.has(keyPrefixed) - } - const value = yield this.store.get(keyPrefixed) - return value !== undefined - }) - ) - } - disconnect() { - if (typeof this.store.disconnect === 'function') { - return this.store.disconnect() - } - } -} -exports.Keyv = Keyv -const iterableAdapters = ['sqlite', 'postgres', 'mysql', 'mongo', 'redis', 'tiered'] -function toValue(input) { - return input !== null && typeof input === 'object' && 'value' in input ? input.value : input -} -//# sourceMappingURL=keyv.js.map diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/index.d.ts b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/index.d.ts deleted file mode 100644 index 9c83d9e66..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './tiered/index' -export * from './typeorm/index' -//# sourceMappingURL=index.d.ts.map diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/index.js b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/index.js deleted file mode 100644 index 6b3e45398..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/index.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict' -var __createBinding = - (this && this.__createBinding) || - (Object.create - ? function (o, m, k, k2) { - if (k2 === undefined) k2 = k - var desc = Object.getOwnPropertyDescriptor(m, k) - if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { - enumerable: true, - get: function () { - return m[k] - }, - } - } - Object.defineProperty(o, k2, desc) - } - : function (o, m, k, k2) { - if (k2 === undefined) k2 = k - o[k2] = m[k] - }) -var __exportStar = - (this && this.__exportStar) || - function (m, exports) { - for (var p in m) if (p !== 'default' && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p) - } -Object.defineProperty(exports, '__esModule', { value: true }) -__exportStar(require('./tiered/index'), exports) -__exportStar(require('./typeorm/index'), exports) -//# sourceMappingURL=index.js.map diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/tiered/index.d.ts b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/tiered/index.d.ts deleted file mode 100644 index 21d2d2461..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/tiered/index.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -/// -import { EventEmitter } from 'events' -import type { Options, Options_ } from './types' -import { KeyvStore, KeyvStoredData } from '../../keyv/keyv-types' -import { IKeyValueStoreAdapter } from '../../key-value-types' -export declare class KeyValueTieredStoreAdapter extends EventEmitter implements KeyvStore, IKeyValueStoreAdapter { - opts: Options_ - remote: KeyvStore - local: KeyvStore - iterationLimit?: string | number - namespace?: string | undefined - constructor({ remote, local, ...options }: Options) - get( - key: string | string[], - options?: { - raw?: boolean - } - ): Promise | Array>> - getMany( - keys: string[], - options?: { - raw?: boolean - } - ): Promise>> - set(key: string, value: any, ttl?: number): Promise - clear(): Promise - delete(key: string): Promise - deleteMany(keys: string[]): Promise - has(key: string): Promise - iterator(namespace?: string): AsyncGenerator -} -//# sourceMappingURL=index.d.ts.map diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/tiered/index.js b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/tiered/index.js deleted file mode 100644 index efb1be79f..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/tiered/index.js +++ /dev/null @@ -1,301 +0,0 @@ -'use strict' -var __awaiter = - (this && this.__awaiter) || - function (thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P - ? value - : new P(function (resolve) { - resolve(value) - }) - } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)) - } catch (e) { - reject(e) - } - } - function rejected(value) { - try { - step(generator['throw'](value)) - } catch (e) { - reject(e) - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected) - } - step((generator = generator.apply(thisArg, _arguments || [])).next()) - }) - } -var __rest = - (this && this.__rest) || - function (s, e) { - var t = {} - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p] - if (s != null && typeof Object.getOwnPropertySymbols === 'function') - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]] - } - return t - } -var __asyncValues = - (this && this.__asyncValues) || - function (o) { - if (!Symbol.asyncIterator) throw new TypeError('Symbol.asyncIterator is not defined.') - var m = o[Symbol.asyncIterator], - i - return m - ? m.call(o) - : ((o = typeof __values === 'function' ? __values(o) : o[Symbol.iterator]()), - (i = {}), - verb('next'), - verb('throw'), - verb('return'), - (i[Symbol.asyncIterator] = function () { - return this - }), - i) - function verb(n) { - i[n] = - o[n] && - function (v) { - return new Promise(function (resolve, reject) { - ;(v = o[n](v)), settle(resolve, reject, v.done, v.value) - }) - } - } - function settle(resolve, reject, d, v) { - Promise.resolve(v).then(function (v) { - resolve({ value: v, done: d }) - }, reject) - } - } -var __await = - (this && this.__await) || - function (v) { - return this instanceof __await ? ((this.v = v), this) : new __await(v) - } -var __asyncGenerator = - (this && this.__asyncGenerator) || - function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError('Symbol.asyncIterator is not defined.') - var g = generator.apply(thisArg, _arguments || []), - i, - q = [] - return ( - (i = {}), - verb('next'), - verb('throw'), - verb('return'), - (i[Symbol.asyncIterator] = function () { - return this - }), - i - ) - function verb(n) { - if (g[n]) - i[n] = function (v) { - return new Promise(function (a, b) { - q.push([n, v, a, b]) > 1 || resume(n, v) - }) - } - } - function resume(n, v) { - try { - step(g[n](v)) - } catch (e) { - settle(q[0][3], e) - } - } - function step(r) { - r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r) - } - function fulfill(value) { - resume('next', value) - } - function reject(value) { - resume('throw', value) - } - function settle(f, v) { - if ((f(v), q.shift(), q.length)) resume(q[0][0], q[0][1]) - } - } -Object.defineProperty(exports, '__esModule', { value: true }) -exports.KeyValueTieredStoreAdapter = void 0 -const events_1 = require('events') -const keyv_1 = require('../../keyv/keyv') -class KeyValueTieredStoreAdapter extends events_1.EventEmitter { - constructor(_a) { - var { remote, local } = _a, - options = __rest(_a, ['remote', 'local']) - super() - this.opts = Object.assign({ validator: () => true, dialect: 'tiered' }, options) - // todo: since we are instantiating a new Keyv object in case we encounter a map, the key prefix applied twice, given it will be part of a an outer keyv object as well. - // Probably wise to simply create a Map Store class. As it is an in memory construct, and will work in terms of resolution it does not have highest priority - this.local = isMap(local) ? new keyv_1.Keyv(local) : local - this.remote = isMap(remote) ? new keyv_1.Keyv(remote) : remote - this.namespace = this.local.namespace - } - get(key, options) { - return __awaiter(this, void 0, void 0, function* () { - if (Array.isArray(key)) { - return yield this.getMany(key, options) - } - const localResult = yield this.local.get(key, options) - if (localResult === undefined || !this.opts.validator(localResult, key)) { - const remoteResult = yield this.remote.get(key, options) - if (remoteResult !== localResult) { - const value = !!remoteResult ? (typeof remoteResult === 'object' && 'value' in remoteResult ? remoteResult.value : remoteResult) : undefined - const ttl = - !!remoteResult && typeof remoteResult === 'object' && 'expires' in remoteResult && remoteResult.expires - ? remoteResult.expires - Date.now() - : undefined - if (!ttl || ttl > 0) { - yield this.local.set(key, value, ttl) - } else { - this.local.delete(key) - } - } - return remoteResult - } - return localResult - }) - } - getMany(keys, options) { - return __awaiter(this, void 0, void 0, function* () { - const promises = [] - for (const key of keys) { - promises.push(this.get(key, options)) - } - const values = yield Promise.all(promises) - const data = [] - for (const value of values) { - data.push(value) - } - return data - }) - } - set(key, value, ttl) { - return __awaiter(this, void 0, void 0, function* () { - const toSet = ['local', 'remote'] - return Promise.all( - toSet.map((store) => - __awaiter(this, void 0, void 0, function* () { - return this[store].set(key, value, ttl) - }) - ) - ) - }) - } - clear() { - return __awaiter(this, void 0, void 0, function* () { - const toClear = ['local'] - if (!this.opts.localOnly) { - toClear.push('remote') - } - yield Promise.all( - toClear.map((store) => - __awaiter(this, void 0, void 0, function* () { - return this[store].clear() - }) - ) - ) - return undefined - }) - } - delete(key) { - return __awaiter(this, void 0, void 0, function* () { - const toDelete = ['local'] - if (!this.opts.localOnly) { - toDelete.push('remote') - } - const deleted = yield Promise.all( - toDelete.map((store) => - __awaiter(this, void 0, void 0, function* () { - return this[store].delete(key) - }) - ) - ) - return deleted.every(Boolean) - }) - } - deleteMany(keys) { - return __awaiter(this, void 0, void 0, function* () { - const promises = [] - for (const key of keys) { - promises.push(this.delete(key)) - } - const values = yield Promise.all(promises) - return values.every(Boolean) - }) - } - has(key) { - return __awaiter(this, void 0, void 0, function* () { - let response - if (typeof this.local.has === 'function') { - response = this.local.has(key) - } else { - const value = yield this.local.get(key) - response = value !== undefined - } - if (!response || !this.opts.validator(response, key)) { - if (typeof this.remote.has === 'function') { - response = this.remote.has(key) - } else { - const value = yield this.remote.get(key) - response = value !== undefined - } - } - return response - }) - } - iterator(namespace) { - return __asyncGenerator(this, arguments, function* iterator_1() { - var _a, e_1, _b, _c - const limit = Number.parseInt(this.iterationLimit, 10) || 10 - this.remote.opts.iterationLimit = limit - if (this.remote && typeof this.remote.iterator === 'function') { - try { - for (var _d = true, _e = __asyncValues(this.remote.iterator(namespace)), _f; (_f = yield __await(_e.next())), (_a = _f.done), !_a; ) { - _c = _f.value - _d = false - try { - const entries = _c - yield yield __await(entries) - } finally { - _d = true - } - } - } catch (e_1_1) { - e_1 = { error: e_1_1 } - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e)) - } finally { - if (e_1) throw e_1.error - } - } - } - }) - } -} -exports.KeyValueTieredStoreAdapter = KeyValueTieredStoreAdapter -function isMap(map) { - if (map instanceof Map) { - return true - } else if ( - map && - typeof map.clear === 'function' && - typeof map.delete === 'function' && - typeof map.get === 'function' && - typeof map.has === 'function' && - typeof map.set === 'function' - ) { - return true - } - return false -} -//# sourceMappingURL=index.js.map diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/tiered/types.d.ts b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/tiered/types.d.ts deleted file mode 100644 index 4c39e3f2d..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/tiered/types.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { IKeyValueStoreAdapter } from '../../key-value-types' -export type Options = { - local: IKeyValueStoreAdapter | Map - remote: IKeyValueStoreAdapter | Map - localOnly?: boolean - iterationLimit?: number | string -} -export type Options_ = { - validator: (value: any, key: string) => boolean - dialect: string - iterationLimit?: number | string - localOnly?: boolean -} -//# sourceMappingURL=types.d.ts.map diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/tiered/types.js b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/tiered/types.js deleted file mode 100644 index 9ab487ded..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/tiered/types.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' -Object.defineProperty(exports, '__esModule', { value: true }) -//# sourceMappingURL=types.js.map diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/typeorm/entities/keyValueStoreEntity.d.ts b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/typeorm/entities/keyValueStoreEntity.d.ts deleted file mode 100644 index 6d04e78ad..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/typeorm/entities/keyValueStoreEntity.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { BaseEntity } from 'typeorm' -/** - * - * @beta This API may change without a BREAKING CHANGE notice. - */ -export declare class KeyValueStoreEntity extends BaseEntity { - key: string - data: string - expires?: number -} -//# sourceMappingURL=keyValueStoreEntity.d.ts.map diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/typeorm/entities/keyValueStoreEntity.js b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/typeorm/entities/keyValueStoreEntity.js deleted file mode 100644 index 2d7c75779..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/typeorm/entities/keyValueStoreEntity.js +++ /dev/null @@ -1,50 +0,0 @@ -'use strict' -var __decorate = - (this && this.__decorate) || - function (decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? (desc = Object.getOwnPropertyDescriptor(target, key)) : desc, - d - if (typeof Reflect === 'object' && typeof Reflect.decorate === 'function') r = Reflect.decorate(decorators, target, key, desc) - else - for (var i = decorators.length - 1; i >= 0; i--) if ((d = decorators[i])) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r - return c > 3 && r && Object.defineProperty(target, key, r), r - } -var __metadata = - (this && this.__metadata) || - function (k, v) { - if (typeof Reflect === 'object' && typeof Reflect.metadata === 'function') return Reflect.metadata(k, v) - } -Object.defineProperty(exports, '__esModule', { value: true }) -exports.KeyValueStoreEntity = void 0 -const typeorm_1 = require('typeorm') -/** - * - * @beta This API may change without a BREAKING CHANGE notice. - */ -let KeyValueStoreEntity = class KeyValueStoreEntity extends typeorm_1.BaseEntity {} -__decorate( - [ - (0, typeorm_1.PrimaryColumn)(), - // @ts-ignore - __metadata('design:type', String), - ], - KeyValueStoreEntity.prototype, - 'key', - void 0 -) -__decorate( - [ - (0, typeorm_1.Column)({ - type: 'text', - }), - // @ts-ignore - __metadata('design:type', String), - ], - KeyValueStoreEntity.prototype, - 'data', - void 0 -) -KeyValueStoreEntity = __decorate([(0, typeorm_1.Entity)('keyvaluestore')], KeyValueStoreEntity) -exports.KeyValueStoreEntity = KeyValueStoreEntity -//# sourceMappingURL=keyValueStoreEntity.js.map diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/typeorm/index.d.ts b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/typeorm/index.d.ts deleted file mode 100644 index 6a0db7dda..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/typeorm/index.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -/// -import { EventEmitter } from 'events' -import { OrPromise } from '@veramo/utils' -import { DataSource } from 'typeorm' -import { KeyValueTypeORMOptions, Options_ } from './types' -import { KeyvStore, KeyvStoredData } from '../../keyv/keyv-types' -import { IKeyValueStoreAdapter } from '../../key-value-types' -export { KeyValueTypeORMOptions } from './types' -export { KeyValueStoreEntity } from './entities/keyValueStoreEntity' -export { kvStoreMigrations } from './migrations' -export declare class KeyValueTypeORMStoreAdapter extends EventEmitter implements KeyvStore, IKeyValueStoreAdapter { - private readonly dbConnection - readonly namespace: string - opts: Options_ - constructor(options: KeyValueTypeORMOptions) - get( - key: string | string[], - options?: { - raw?: boolean - } - ): Promise | Array>> - getMany( - keys: string[], - options?: { - raw?: boolean - } - ): Promise>> - set(key: string, value: string, ttl?: number): Promise> - delete(key: string | string[]): Promise - deleteMany(keys: string[]): Promise - clear(): Promise - has(key: string): Promise - disconnect(): Promise -} -/** - * Ensures that the provided DataSource is connected. - * - * @param dbConnection - a TypeORM DataSource or a Promise that resolves to a DataSource - */ -export declare function getConnectedDb(dbConnection: OrPromise): Promise -//# sourceMappingURL=index.d.ts.map diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/typeorm/index.js b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/typeorm/index.js deleted file mode 100644 index d2e8d125a..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/typeorm/index.js +++ /dev/null @@ -1,186 +0,0 @@ -'use strict' -var __awaiter = - (this && this.__awaiter) || - function (thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P - ? value - : new P(function (resolve) { - resolve(value) - }) - } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)) - } catch (e) { - reject(e) - } - } - function rejected(value) { - try { - step(generator['throw'](value)) - } catch (e) { - reject(e) - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected) - } - step((generator = generator.apply(thisArg, _arguments || [])).next()) - }) - } -var __importDefault = - (this && this.__importDefault) || - function (mod) { - return mod && mod.__esModule ? mod : { default: mod } - } -Object.defineProperty(exports, '__esModule', { value: true }) -exports.getConnectedDb = exports.KeyValueTypeORMStoreAdapter = exports.kvStoreMigrations = exports.KeyValueStoreEntity = void 0 -const events_1 = require('events') -const typeorm_1 = require('typeorm') -const keyValueStoreEntity_1 = require('./entities/keyValueStoreEntity') -const json_buffer_1 = __importDefault(require('json-buffer')) -var keyValueStoreEntity_2 = require('./entities/keyValueStoreEntity') -Object.defineProperty(exports, 'KeyValueStoreEntity', { - enumerable: true, - get: function () { - return keyValueStoreEntity_2.KeyValueStoreEntity - }, -}) -var migrations_1 = require('./migrations') -Object.defineProperty(exports, 'kvStoreMigrations', { - enumerable: true, - get: function () { - return migrations_1.kvStoreMigrations - }, -}) -class KeyValueTypeORMStoreAdapter extends events_1.EventEmitter { - constructor(options) { - super() - this.dbConnection = options.dbConnection - this.namespace = options.namespace || 'keyv' - this.opts = Object.assign( - { validator: () => true, dialect: 'typeorm', serialize: json_buffer_1.default.stringify, deserialize: json_buffer_1.default.parse }, - options - ) - } - get(key, options) { - return __awaiter(this, void 0, void 0, function* () { - if (Array.isArray(key)) { - return this.getMany(key, options) - } - const connection = yield getConnectedDb(this.dbConnection) - const result = yield connection.getRepository(keyValueStoreEntity_1.KeyValueStoreEntity).findOneBy({ - key, - }) - return (options === null || options === void 0 ? void 0 : options.raw) !== true || !result - ? result === null || result === void 0 - ? void 0 - : result.data - : { - value: result === null || result === void 0 ? void 0 : result.data, - expires: result === null || result === void 0 ? void 0 : result.expires, - } - }) - } - getMany(keys, options) { - return __awaiter(this, void 0, void 0, function* () { - const connection = yield getConnectedDb(this.dbConnection) - const results = yield connection.getRepository(keyValueStoreEntity_1.KeyValueStoreEntity).findBy({ - key: (0, typeorm_1.In)(keys), - }) - const values = keys.map((key) => - __awaiter(this, void 0, void 0, function* () { - var _a - const result = results.find((result) => result.key === key) - return (options === null || options === void 0 ? void 0 : options.raw) !== true || !result - ? result === null || result === void 0 - ? void 0 - : result.data - : { - value: (result === null || result === void 0 ? void 0 : result.data) - ? (_a = yield this.opts.deserialize(result.data)) === null || _a === void 0 - ? void 0 - : _a.value - : undefined, - expires: result === null || result === void 0 ? void 0 : result.expires, - } - }) - ) - return Promise.all(values) - }) - } - set(key, value, ttl) { - return __awaiter(this, void 0, void 0, function* () { - const connection = yield getConnectedDb(this.dbConnection) - const entity = new keyValueStoreEntity_1.KeyValueStoreEntity() - entity.key = key - entity.data = value - entity.expires = ttl - yield connection.getRepository(keyValueStoreEntity_1.KeyValueStoreEntity).save(entity) - return { value: value, expires: ttl } - }) - } - delete(key) { - return __awaiter(this, void 0, void 0, function* () { - if (Array.isArray(key)) { - return this.deleteMany(key) - } - const connection = yield getConnectedDb(this.dbConnection) - const result = yield connection.getRepository(keyValueStoreEntity_1.KeyValueStoreEntity).delete({ key }) - return result.affected === 1 - }) - } - deleteMany(keys) { - return __awaiter(this, void 0, void 0, function* () { - const connection = yield getConnectedDb(this.dbConnection) - const results = yield connection.getRepository(keyValueStoreEntity_1.KeyValueStoreEntity).delete({ - key: (0, typeorm_1.In)(keys), - }) - return !!results.affected && results.affected >= 1 - }) - } - clear() { - return __awaiter(this, void 0, void 0, function* () { - const connection = yield getConnectedDb(this.dbConnection) - yield connection.getRepository(keyValueStoreEntity_1.KeyValueStoreEntity).delete({ - key: (0, typeorm_1.Like)(`${this.namespace}:%`), - }) - }) - } - has(key) { - return __awaiter(this, void 0, void 0, function* () { - const connection = yield getConnectedDb(this.dbConnection) - const result = yield connection.getRepository(keyValueStoreEntity_1.KeyValueStoreEntity).countBy({ - key, - }) - return result === 1 - }) - } - disconnect() { - return __awaiter(this, void 0, void 0, function* () { - const connection = yield getConnectedDb(this.dbConnection) - connection.destroy() - }) - } -} -exports.KeyValueTypeORMStoreAdapter = KeyValueTypeORMStoreAdapter -/** - * Ensures that the provided DataSource is connected. - * - * @param dbConnection - a TypeORM DataSource or a Promise that resolves to a DataSource - */ -function getConnectedDb(dbConnection) { - return __awaiter(this, void 0, void 0, function* () { - if (dbConnection instanceof Promise) { - return yield dbConnection - } else if (!dbConnection.isInitialized) { - return yield dbConnection.initialize() - } else { - return dbConnection - } - }) -} -exports.getConnectedDb = getConnectedDb -//# sourceMappingURL=index.js.map diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/1.createKVDatabase.d.ts b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/1.createKVDatabase.d.ts deleted file mode 100644 index bbe1bc3b8..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/1.createKVDatabase.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { MigrationInterface, QueryRunner } from 'typeorm' -/** - * Create the database layout for Veramo 3.0 - * - * @public - */ -export declare class CreateKVDatabaseMigration implements MigrationInterface { - private readonly _tableName - readonly name: string - constructor(tableName?: string) - up(queryRunner: QueryRunner): Promise - down(queryRunner: QueryRunner): Promise -} -//# sourceMappingURL=1.createKVDatabase.d.ts.map diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/1.createKVDatabase.js b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/1.createKVDatabase.js deleted file mode 100644 index 366ea1f94..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/1.createKVDatabase.js +++ /dev/null @@ -1,90 +0,0 @@ -'use strict' -var __awaiter = - (this && this.__awaiter) || - function (thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P - ? value - : new P(function (resolve) { - resolve(value) - }) - } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)) - } catch (e) { - reject(e) - } - } - function rejected(value) { - try { - step(generator['throw'](value)) - } catch (e) { - reject(e) - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected) - } - step((generator = generator.apply(thisArg, _arguments || [])).next()) - }) - } -var __importDefault = - (this && this.__importDefault) || - function (mod) { - return mod && mod.__esModule ? mod : { default: mod } - } -Object.defineProperty(exports, '__esModule', { value: true }) -exports.CreateKVDatabaseMigration = void 0 -const typeorm_1 = require('typeorm') -const debug_1 = __importDefault(require('debug')) -const debug = (0, debug_1.default)('veramo:kv-store:initial-migration') -/** - * Create the database layout for Veramo 3.0 - * - * @public - */ -class CreateKVDatabaseMigration { - constructor(tableName) { - this._tableName = tableName || 'keyvaluestore' - this.name = `CreateKVDatabase${tableName}1680297189001` - } - up(queryRunner) { - return __awaiter(this, void 0, void 0, function* () { - function getTableName(givenName) { - var _a - return ( - ((_a = queryRunner.connection.entityMetadatas.find((meta) => meta.givenTableName === givenName)) === null || _a === void 0 - ? void 0 - : _a.tableName) || givenName - ) - } - debug(`creating ${this._tableName} table`) - // CREATE TABLE "keyvaluestore" ("key" varchar PRIMARY KEY NOT NULL, "data" text NOT NULL) - yield queryRunner.createTable( - new typeorm_1.Table({ - name: getTableName(this._tableName), - columns: [ - { name: 'key', type: 'varchar', isPrimary: true }, - { name: 'data', type: 'text', isNullable: false }, - ], - indices: [ - { - columnNames: ['key'], - isUnique: true, - }, - ], - }), - true - ) - }) - } - down(queryRunner) { - return __awaiter(this, void 0, void 0, function* () { - throw new Error('illegal_operation: cannot roll back initial migration') - }) - } -} -exports.CreateKVDatabaseMigration = CreateKVDatabaseMigration -//# sourceMappingURL=1.createKVDatabase.js.map diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/index.d.ts b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/index.d.ts deleted file mode 100644 index 34f3dde8d..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { CreateKVDatabaseMigration } from './1.createKVDatabase' -/** - * The migrations array that SHOULD be used when initializing a TypeORM database connection. - * - * These ensure the correct creation of tables and the proper migrations of data when tables change between versions. - * - * @public - */ -export declare const kvStoreMigrations: (typeof CreateKVDatabaseMigration)[] -//# sourceMappingURL=index.d.ts.map diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/index.js b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/index.js deleted file mode 100644 index 22c67c933..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/typeorm/migrations/index.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict' -Object.defineProperty(exports, '__esModule', { value: true }) -exports.kvStoreMigrations = void 0 -const _1_createKVDatabase_1 = require('./1.createKVDatabase') -/** - * The migrations array that SHOULD be used when initializing a TypeORM database connection. - * - * These ensure the correct creation of tables and the proper migrations of data when tables change between versions. - * - * @public - */ -exports.kvStoreMigrations = [_1_createKVDatabase_1.CreateKVDatabaseMigration] -//# sourceMappingURL=index.js.map diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/typeorm/types.d.ts b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/typeorm/types.d.ts deleted file mode 100644 index 059f93cb5..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/typeorm/types.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { OrPromise } from '@veramo/utils' -import { DataSource } from 'typeorm' -import { KeyvDeserializedData } from '../../keyv/keyv-types' -export type KeyValueTypeORMOptions = { - dbConnection: OrPromise - namespace?: string -} -export type Options_ = { - validator: (value: any, key: string) => boolean - dialect: string - serialize: (data: KeyvDeserializedData) => OrPromise - /** A custom deserialization function. */ - deserialize: (data: any) => OrPromise | undefined> -} -//# sourceMappingURL=types.d.ts.map diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/typeorm/types.js b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/typeorm/types.js deleted file mode 100644 index 9ab487ded..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/store-adapters/typeorm/types.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict' -Object.defineProperty(exports, '__esModule', { value: true }) -//# sourceMappingURL=types.js.map diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/tsdoc-metadata.json b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/tsdoc-metadata.json deleted file mode 100644 index 52f4aa531..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/build/tsdoc-metadata.json +++ /dev/null @@ -1,11 +0,0 @@ -// This file is read by tools that parse documentation comments conforming to the TSDoc standard. -// It should be published with your NPM package. It should not be tracked by Git. -{ - "tsdocVersion": "0.12", - "toolPackages": [ - { - "packageName": "@microsoft/api-extractor", - "packageVersion": "7.33.7" - } - ] -} diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/package.json b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/package.json deleted file mode 100644 index c682bc18a..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "@veramo/kv-store", - "description": "Veramo Key Value Store plugin", - "version": "4.3.0", - "main": "build/index.js", - "types": "build/index.d.ts", - "scripts": { - "build": "tsc", - "test": "jest --config=../../jest.config.mjs", - "test:ci": "jest --config=../../jest.config.mjs", - "extract-api": "node ../cli/bin/veramo.js dev extract-api" - }, - "dependencies": { - "@veramo/utils": "4.3.0", - "debug": "^4.3.4", - "events": "^3.3.0", - "json-buffer": "^3.0.1", - "typeorm": "^0.3.10", - "uint8arrays": "^3.1.1" - }, - "files": [ - "build/**/*", - "src/**/*", - "README.md", - "LICENSE" - ], - "publishConfig": { - "access": "public" - }, - "repository": "git@github.com:uport-project/veramo.git", - "author": "Niels Klomp ", - "license": "Apache-2.0", - "keywords": [ - "Veramo", - "Key Value Store", - "keyv" - ], - "yalcSig": "bfd8bfc89f0050ba31664b2d7c3efc7a" -} diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/__tests__/kvstore.test.ts b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/__tests__/kvstore.test.ts deleted file mode 100644 index 66b2a26bc..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/__tests__/kvstore.test.ts +++ /dev/null @@ -1,93 +0,0 @@ -import { KeyValueStore } from '../key-value-store' -import { IKeyValueStore } from '../key-value-types' - -interface TestValue { - stringProp: string - numberProp: number - objectProp: { - value: string | number - } -} - -let testValues: TestValue[] = [] - -for (let i = 0; i < 10; i++) { - testValues.push({ - stringProp: `stringValue${i}`, - numberProp: i, - objectProp: { - value: `objectValue${i}`, - }, - }) -} -describe('kvStore with MAP adapter', () => { - let kvStore: IKeyValueStore - beforeEach(async () => { - const store = new Map() - kvStore = new KeyValueStore({ store }) - for (let i = 0; i < 10; i++) { - await kvStore.set(`key${i}`, testValues[i]) - } - }) - afterEach(async () => { - try { - await kvStore.clear() - await kvStore.disconnect() - } catch (error) {} - }) - it('should get non-existing keys as undefined', async () => { - await expect(kvStore.get('nope')).resolves.toBeUndefined() - await expect(kvStore.getAsValueData('nope')).resolves.toMatchObject({ - value: undefined, - expires: undefined, - }) - }) - - it('should get single results', async () => { - for (let i = 0; i < 10; i++) { - await expect(kvStore.get(`key${i}`)).resolves.toEqual(testValues[i]) - await expect(kvStore.getAsValueData(`key${i}`)).resolves.toMatchObject({ - value: testValues[i], - expires: undefined, - }) - } - }) - - it('should get multiple results', async () => { - // Let's get multiple results - const manyResult = await kvStore.getMany(['key1', 'nope', 'key4']) - expect(manyResult).toHaveLength(3) - expect(manyResult[0]).toEqual(testValues[1]) - expect(manyResult[1]).toBeUndefined() - expect(manyResult[2]).toEqual(testValues[4]) - const manyValueResult = await kvStore.getManyAsValueData(['key1', 'nope', 'key4']) - expect(manyValueResult).toHaveLength(3) - expect(manyValueResult[0]).toEqual({ value: testValues[1], expires: undefined }) - expect(manyValueResult[1]).toEqual({ value: undefined, expires: undefined }) - expect(manyValueResult[2]).toEqual({ value: testValues[4], expires: undefined }) - }) - - it('should check existence of keys', async () => { - await expect(kvStore.has(`key1`)).resolves.toEqual(true) - await expect(kvStore.has(`nope`)).resolves.toEqual(false) - }) - - it('should delete an existing key', async () => { - await expect(kvStore.has(`key1`)).resolves.toEqual(true) - await expect(kvStore.delete(`key1`)).resolves.toEqual(true) - await expect(kvStore.has(`key1`)).resolves.toEqual(false) - }) - - it('should not throw an error when deleting a non-existing key', async () => { - await expect(kvStore.delete(`nope`)).resolves.toEqual(false) - }) - - it('should delete multiple values', async () => { - await expect(kvStore.deleteMany(['key2', 'nope', 'key6'])).resolves.toEqual([true, false, true]) - }) - - it('should clear all', async () => { - await kvStore.clear() - await expect(kvStore.has(`key1`)).resolves.toEqual(false) - }) -}) diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/keyv/keyv-types.ts b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/keyv/keyv-types.ts deleted file mode 100644 index 9ce7b0207..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/keyv/keyv-types.ts +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Please be aware these types are compatible with the keyv package, to ensure we can use its store-adapters for free. - * - * Be very careful when extending/changing!. Normally you will want to create an adapter or decorator for your additional behaviour or requirements - */ -import { OrPromise } from '@veramo/utils' - -export interface KeyvOptions { - [key: string]: any - - /** Namespace for the current instance. */ - namespace?: string | undefined - /** A custom serialization function. */ - serialize?: (data: KeyvDeserializedData) => OrPromise - /** A custom deserialization function. */ - deserialize?: (data: any) => OrPromise | undefined> - /** The connection string URI. */ - uri?: string | undefined - /** The storage adapter instance to be used by Keyv. */ - store?: KeyvStore | undefined - /** Default TTL. Can be overridden by specififying a TTL on `.set()`. */ - ttl?: number | undefined - /** Specify an adapter to use. e.g `'redis'` or `'mongodb'`. */ - adapter?: 'redis' | 'mongodb' | 'mongo' | 'sqlite' | 'postgresql' | 'postgres' | 'mysql' | object | string | undefined - /** Enable compression option **/ - compression?: KeyvCompressionAdapter | undefined - - emitErrors?: boolean -} - -export interface KeyvCompressionAdapter { - compress(value: any, options?: any): OrPromise - - decompress(value: any, options?: any): OrPromise - - serialize(value: any): OrPromise - - deserialize(value: any): OrPromise -} - -export interface KeyvDeserializedData { - value: Value - expires: number | undefined -} - -export type KeyvStoredData = KeyvDeserializedData | string | Value | undefined - -export interface KeyvStore { - namespace?: string | undefined - - opts: KeyvOptions - - on?(eventName: string | symbol, listener: (...args: any[]) => void): void - get(key: string | string[], options?: { raw?: boolean }): OrPromise | Array>> - - getMany?(keys: string[], options?: { raw?: boolean }): OrPromise>> | undefined - - iterator?(namespace?: string | undefined): AsyncGenerator - - set(key: string, value: Value, ttl?: number): any - - delete(key: string | string[]): OrPromise - - deleteMany?(keys: string[]): OrPromise - - clear(): OrPromise - - has?(key: string): OrPromise - - disconnect?(): void -} diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/keyv/keyv.ts b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/keyv/keyv.ts deleted file mode 100644 index 16327cf96..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/keyv/keyv.ts +++ /dev/null @@ -1,282 +0,0 @@ -import { EventEmitter } from 'events' -import JSONB from 'json-buffer' -import { KeyvDeserializedData, KeyvOptions, KeyvStore, KeyvStoredData } from './keyv-types' - -/** - * Please note that this is code adapted from @link https://github.com/jaredwray/keyv to support Typescript and ESM in Veramo - * - * The code should support the storage plugins available for the keyv project. - * Veramo itself supports NodeJS, Browser and React-Native environment. - * Please be aware that these requirements probably aren't true for any keyv storage plugins. - * - * 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. - * We believe that any Veramo Key Value store should use explicitly defined store-adapters. - * - * 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. - * Veramo exposes its own API/interfaces for the Key Value store, meaning we could also support any other implementation in the future - * - * The Veramo kv-store module provides out of the box support for in memory/maps, sqlite and typeorm implementations, - * including a tiered local/remote implementation that support all environments. - * - * We welcome any new storage modules - */ -export class Keyv extends EventEmitter implements KeyvStore { - readonly opts: KeyvOptions - readonly namespace: string - iterator?: (namespace?: string) => AsyncGenerator - - constructor(uri?: string | Map | KeyvStore | undefined, options?: KeyvOptions) { - super() - const emitErrors = options?.emitErrors === undefined ? true : options.emitErrors - uri = uri ?? options?.uri - /*if (!uri) { - throw Error('No URI provided') - }*/ - this.opts = { - namespace: 'keyv', - serialize: JSONB.stringify, - deserialize: JSONB.parse, - ...(typeof uri === 'string' ? { uri } : uri), - ...options, - } - - if (!this.opts.store) { - if (typeof uri !== 'string') { - this.opts.store = uri as KeyvStore - } /* else { - const adapterOptions = { ...this.opts } - this.opts.store = loadStore(adapterOptions) - }*/ - } - if (!this.opts.store) { - throw Error('No store') - } - - if (this.opts.compression) { - const compression = this.opts.compression - this.opts.serialize = compression.serialize.bind(compression) - this.opts.deserialize = compression.deserialize.bind(compression) - } - - if (typeof this.opts.store.on === 'function' && emitErrors) { - this.opts.store.on('error', (error) => this.emit('error', error)) - } - - this.opts.store.namespace = this.opts.namespace || 'keyv' - this.namespace = this.opts.store.namespace - - const generateIterator = (iterator: any, keyv: Keyv) => - async function* () { - for await (const [key, raw] of typeof iterator === 'function' ? iterator(keyv.store.namespace) : iterator) { - const data = await keyv.deserialize(raw) - if (keyv.store.namespace && !key.includes(keyv.store.namespace)) { - continue - } - - if (data && typeof data.expires === 'number' && Date.now() > data.expires) { - keyv.delete(key) - continue - } - - yield [keyv._getKeyUnprefix(key), data?.value] - } - } - - // Attach iterators - // @ts-ignore - if (typeof this.store[Symbol.iterator] === 'function' && this.store instanceof Map) { - this.iterator = generateIterator(this.store, this) - } else if (typeof this.store.iterator === 'function' && this.store.opts && this._checkIterableAdapter()) { - this.iterator = generateIterator(this.store.iterator.bind(this.store), this) - } - } - - get store(): Required> { - return this.opts.store as Required> - } - - get deserialize() { - return this.opts.deserialize! - } - - get serialize() { - return this.opts.serialize! - } - - _checkIterableAdapter() { - return ( - (this.store.opts.dialect && iterableAdapters.includes(this.store.opts.dialect)) || - (this.store.opts.url && iterableAdapters.findIndex((element) => this.store.opts.url.includes(element)) >= 0) - ) - } - - _getKeyPrefix(key: string): string { - return `${this.opts.namespace}:${key}` - } - - _getKeyPrefixArray(keys: string[]): string[] { - return keys.map((key) => this._getKeyPrefix(key)) - } - - _getKeyUnprefix(key: string): string { - return key.split(':').splice(1).join(':') - } - - async getMany(keys: string[], options?: { raw?: boolean }): Promise>> { - const keyPrefixed = this._getKeyPrefixArray(keys) - let promise: Promise>> - if (this.store.getMany !== undefined) { - promise = this.store.getMany(keyPrefixed, options) as Promise[]> //.then(value => !!value ? value.values() : undefined) - // todo: Probably wise to check expired ValueData here, if the getMany does not implement this feature itself! - } else { - promise = Promise.all(keyPrefixed.map((k) => this.store.get(k, options) as Promise>)) - } - const allValues = Promise.resolve(promise) - const results: Promise>[] = [] - - return Promise.resolve(allValues) - .then((all) => { - keys.forEach((key, index) => { - const data = all[index] - - let result = typeof data === 'string' ? this.deserialize(data) : !!data && this.opts.compression ? this.deserialize(data) : data - - if (result && typeof result === 'object' && 'expires' in result && typeof result.expires === 'number' && Date.now() > result.expires) { - this.delete(key) - result = undefined - } - - const final = ( - options && options.raw ? result : result && typeof result === 'object' && 'value' in result ? result.value : result - ) as Promise> - - results.push(final) - }) - }) - .then(() => Promise.all(results)) - } - - async get( - key: string | string[], - options?: { raw?: boolean } - ): Promise | KeyvStoredData[] | undefined> { - const isArray = Array.isArray(key) - return Promise.resolve() - .then(() => (isArray ? this.getMany(this._getKeyPrefixArray(key), options) : this.store.get(this._getKeyPrefix(key)))) - .then((data) => (typeof data === 'string' ? this.deserialize(data) : this.opts.compression ? this.deserialize(data) : data)) - .then((data) => { - if (data === undefined || data === null) { - return undefined - } - const rows = Array.isArray(data) ? data : [data] - - if (isArray) { - const result = [] - - for (let row of rows) { - if (row === undefined || row === null) { - result.push(undefined) - continue - } - - if (this.isExpired(row)) { - this.delete(key).then(() => undefined) - result.push(undefined) - } else { - result.push(options && options.raw ? row : toValue(row)) - } - } - - return result - } else if (!Array.isArray(data)) { - if (this.isExpired(data)) { - return this.delete(key).then(() => undefined) - } - } - - return options && options.raw ? data : Array.isArray(data) ? data.map((d) => toValue(d)) : toValue(data) - }) - } - - private isExpired(data: KeyvDeserializedData | string | Value): boolean { - return ( - typeof data !== 'string' && - data && - typeof data === 'object' && - 'expires' in data && - typeof data.expires === 'number' && - Date.now() > data.expires - ) - } - - set(key: string, value: Value, ttl?: number) { - const keyPrefixed = this._getKeyPrefix(key) - if (typeof ttl === 'undefined') { - ttl = this.opts.ttl - } - if (ttl === 0) { - ttl = undefined - } - - // @ts-ignore - return Promise.resolve() - .then(() => { - const expires = typeof ttl === 'number' ? Date.now() + ttl : undefined - if (typeof value === 'symbol') { - this.emit('error', 'symbol cannot be serialized') - } - - const input = { value, expires } - return this.serialize(input) - }) - .then((value) => this.store.set(keyPrefixed, value as Value, ttl)) - .then(() => true) - } - - delete(key: string | string[]) { - if (!Array.isArray(key)) { - const keyPrefixed = this._getKeyPrefix(key) - return Promise.resolve().then(() => this.store.delete(keyPrefixed)) - } - - const keyPrefixed = this._getKeyPrefixArray(key) - if (this.store.deleteMany !== undefined) { - return Promise.resolve().then(() => this.store.deleteMany!(keyPrefixed)) - } - - const promises = [] - for (const key of keyPrefixed) { - promises.push(this.store.delete(key)) - } - - return Promise.allSettled(promises).then((values) => values.every((x) => x.valueOf() === true)) - } - - async clear(): Promise { - return Promise.resolve().then(() => this.store.clear()) - } - - has(key: string) { - const keyPrefixed = this._getKeyPrefix(key) - return Promise.resolve().then(async () => { - if (typeof this.store.has === 'function') { - return this.store.has(keyPrefixed) - } - - const value = await this.store.get(keyPrefixed) - return value !== undefined - }) - } - - disconnect() { - if (typeof this.store.disconnect === 'function') { - return this.store.disconnect() - } - } -} - -const iterableAdapters = ['sqlite', 'postgres', 'mysql', 'mongo', 'redis', 'tiered'] - -function toValue(input: KeyvDeserializedData | string | Value) { - return input !== null && typeof input === 'object' && 'value' in input ? input.value : input -} diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/store-adapters/index.ts b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/store-adapters/index.ts deleted file mode 100644 index 1fe352d0b..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/store-adapters/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './tiered/index' -export * from './typeorm/index' diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/store-adapters/tiered/index.ts b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/store-adapters/tiered/index.ts deleted file mode 100644 index ef5722c15..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/store-adapters/tiered/index.ts +++ /dev/null @@ -1,158 +0,0 @@ -import { EventEmitter } from 'events' -import type { Options, Options_ } from './types' -import { KeyvStore, KeyvStoredData } from '../../keyv/keyv-types' -import { Keyv } from '../../keyv/keyv' -import { IKeyValueStoreAdapter } from '../../key-value-types' - -type KeyvTieredIndex = 'local' | 'remote' - -export class KeyValueTieredStoreAdapter extends EventEmitter implements KeyvStore, IKeyValueStoreAdapter { - opts: Options_ - remote: KeyvStore - local: KeyvStore - iterationLimit?: string | number - - namespace?: string | undefined - - constructor({ remote, local, ...options }: Options) { - super() - this.opts = { - validator: () => true, - dialect: 'tiered', - ...options, - } - - // todo: since we are instantiating a new Keyv object in case we encounter a map, the key prefix applied twice, given it will be part of a an outer keyv object as well. - // Probably wise to simply create a Map Store class. As it is an in memory construct, and will work in terms of resolution it does not have highest priority - this.local = (isMap(local) ? new Keyv(local as Map) : local) as KeyvStore - this.remote = (isMap(remote) ? new Keyv(remote as Map) : remote) as KeyvStore - this.namespace = this.local.namespace - } - - async get(key: string | string[], options?: { raw?: boolean }): Promise | Array>> { - if (Array.isArray(key)) { - return await this.getMany(key, options) - } - const localResult = (await this.local.get(key, options)) as KeyvStoredData - - if (localResult === undefined || !this.opts.validator(localResult, key)) { - const remoteResult = await this.remote.get(key, options) - - if (remoteResult !== localResult) { - const value = ( - !!remoteResult ? (typeof remoteResult === 'object' && 'value' in remoteResult ? remoteResult.value : remoteResult) : undefined - ) as Value - const ttl = - !!remoteResult && typeof remoteResult === 'object' && 'expires' in remoteResult && remoteResult.expires - ? remoteResult.expires - Date.now() - : undefined - if (!ttl || ttl > 0) { - await this.local.set(key, value, ttl) - } else { - this.local.delete(key) - } - } - return remoteResult - } - - return localResult - } - - async getMany(keys: string[], options?: { raw?: boolean }): Promise>> { - const promises: Array>> = [] - for (const key of keys) { - promises.push(this.get(key, options) as Promise>) - } - - const values = await Promise.all(promises) - const data: Array> | undefined = [] - for (const value of values) { - data.push(value as KeyvStoredData) - } - return data - } - - async set(key: string, value: any, ttl?: number) { - const toSet: KeyvTieredIndex[] = ['local', 'remote'] - return Promise.all(toSet.map(async (store) => this[store].set(key, value, ttl))) - } - - async clear(): Promise { - const toClear: KeyvTieredIndex[] = ['local'] - if (!this.opts.localOnly) { - toClear.push('remote') - } - - await Promise.all(toClear.map(async (store) => this[store].clear())) - - return undefined - } - - async delete(key: string): Promise { - const toDelete: KeyvTieredIndex[] = ['local'] - if (!this.opts.localOnly) { - toDelete.push('remote') - } - - const deleted = await Promise.all(toDelete.map(async (store) => this[store].delete(key))) - - return deleted.every(Boolean) - } - - async deleteMany(keys: string[]): Promise { - const promises = [] - for (const key of keys) { - promises.push(this.delete(key)) - } - - const values = await Promise.all(promises) - - return values.every(Boolean) - } - - async has(key: string): Promise { - let response - if (typeof this.local.has === 'function') { - response = this.local.has(key) - } else { - const value = await this.local.get(key) - response = value !== undefined - } - if (!response || !this.opts.validator(response, key)) { - if (typeof this.remote.has === 'function') { - response = this.remote.has(key) - } else { - const value = await this.remote.get(key) - response = value !== undefined - } - } - return response - } - - async *iterator(namespace?: string): AsyncGenerator { - const limit = Number.parseInt(this.iterationLimit as string, 10) || 10 - this.remote.opts.iterationLimit = limit - if (this.remote && typeof this.remote.iterator === 'function') { - for await (const entries of this.remote.iterator(namespace)) { - yield entries - } - } - } -} - -function isMap(map: any) { - if (map instanceof Map) { - return true - } else if ( - map && - typeof map.clear === 'function' && - typeof map.delete === 'function' && - typeof map.get === 'function' && - typeof map.has === 'function' && - typeof map.set === 'function' - ) { - return true - } - - return false -} diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/store-adapters/tiered/types.ts b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/store-adapters/tiered/types.ts deleted file mode 100644 index d808e3735..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/store-adapters/tiered/types.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { IKeyValueStoreAdapter } from '../../key-value-types' - -export type Options = { - local: IKeyValueStoreAdapter | Map - remote: IKeyValueStoreAdapter | Map - localOnly?: boolean - iterationLimit?: number | string -} - -// eslint-disable-next-line @typescript-eslint/naming-convention -export type Options_ = { - validator: (value: any, key: string) => boolean - dialect: string - iterationLimit?: number | string - localOnly?: boolean -} diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/store-adapters/typeorm/entities/keyValueStoreEntity.ts b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/store-adapters/typeorm/entities/keyValueStoreEntity.ts deleted file mode 100644 index 787fc7575..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/store-adapters/typeorm/entities/keyValueStoreEntity.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { BaseEntity, Column, Entity, PrimaryColumn } from 'typeorm' - -/** - * - * @beta This API may change without a BREAKING CHANGE notice. - */ -@Entity('keyvaluestore') -export class KeyValueStoreEntity extends BaseEntity { - @PrimaryColumn() - // @ts-ignore - key: string - - @Column({ - type: 'text', - }) - // @ts-ignore - data: string - - expires?: number -} diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/store-adapters/typeorm/migrations/1.createKVDatabase.ts b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/store-adapters/typeorm/migrations/1.createKVDatabase.ts deleted file mode 100644 index 81b06435b..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/store-adapters/typeorm/migrations/1.createKVDatabase.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { MigrationInterface, QueryRunner, Table } from 'typeorm' -import Debug from 'debug' -const debug = Debug('veramo:kv-store:initial-migration') - -/** - * Create the database layout for Veramo 3.0 - * - * @public - */ -export class CreateKVDatabaseMigration implements MigrationInterface { - private readonly _tableName: string - readonly name: string - - constructor(tableName?: string) { - this._tableName = tableName || 'keyvaluestore' - this.name = `CreateKVDatabase${tableName}1680297189001` - } - - async up(queryRunner: QueryRunner): Promise { - function getTableName(givenName: string): string { - return queryRunner.connection.entityMetadatas.find((meta) => meta.givenTableName === givenName)?.tableName || givenName - } - - debug(`creating ${this._tableName} table`) - // CREATE TABLE "keyvaluestore" ("key" varchar PRIMARY KEY NOT NULL, "data" text NOT NULL) - await queryRunner.createTable( - new Table({ - name: getTableName(this._tableName), - columns: [ - { name: 'key', type: 'varchar', isPrimary: true }, - { name: 'data', type: 'text', isNullable: false }, - ], - indices: [ - { - columnNames: ['key'], - isUnique: true, - }, - ], - }), - true - ) - } - - async down(queryRunner: QueryRunner): Promise { - throw new Error('illegal_operation: cannot roll back initial migration') - } -} diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/store-adapters/typeorm/migrations/index.ts b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/store-adapters/typeorm/migrations/index.ts deleted file mode 100644 index 6d6075eb5..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/store-adapters/typeorm/migrations/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { CreateKVDatabaseMigration } from './1.createKVDatabase' - -/** - * The migrations array that SHOULD be used when initializing a TypeORM database connection. - * - * These ensure the correct creation of tables and the proper migrations of data when tables change between versions. - * - * @public - */ -export const kvStoreMigrations = [CreateKVDatabaseMigration] diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/store-adapters/typeorm/types.ts b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/store-adapters/typeorm/types.ts deleted file mode 100644 index fb2dcc33f..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/src/store-adapters/typeorm/types.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { OrPromise } from '@veramo/utils' -import { DataSource } from 'typeorm' -import { KeyvDeserializedData } from '../../keyv/keyv-types' - -export type KeyValueTypeORMOptions = { - dbConnection: OrPromise - - namespace?: string -} - -// eslint-disable-next-line @typescript-eslint/naming-convention -export type Options_ = { - validator: (value: any, key: string) => boolean - dialect: string - serialize: (data: KeyvDeserializedData) => OrPromise - /** A custom deserialization function. */ - deserialize: (data: any) => OrPromise | undefined> -} diff --git a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/yalc.sig b/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/yalc.sig deleted file mode 100644 index 44752dbc7..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store/yalc.sig +++ /dev/null @@ -1 +0,0 @@ -bfd8bfc89f0050ba31664b2d7c3efc7a \ No newline at end of file diff --git a/packages/siopv2-oid4vp-rp-rest-api/__tests__/database/config.ts b/packages/siopv2-oid4vp-rp-rest-api/__tests__/database/config.ts index b71ba1547..75da16557 100644 --- a/packages/siopv2-oid4vp-rp-rest-api/__tests__/database/config.ts +++ b/packages/siopv2-oid4vp-rp-rest-api/__tests__/database/config.ts @@ -1,8 +1,8 @@ import { Entities as VeramoDataStoreEntities, migrations as VeramoDataStoreMigrations } from '@veramo/data-store' import { DataStoreContactEntities, DataStoreMigrations } from '@sphereon/ssi-sdk.data-store' import { SqliteConnectionOptions } from 'typeorm/driver/sqlite/SqliteConnectionOptions' -import { KeyValueStoreEntity } from '@veramo/kv-store' -import { kvStoreMigrations } from '@veramo/kv-store' +import { KeyValueStoreEntity } from '@sphereon/ssi-sdk.kv-store-temp' +import { kvStoreMigrations } from '@sphereon/ssi-sdk.kv-store-temp' const DB_CONNECTION_NAME = 'default' const DB_ENCRYPTION_KEY = '29739248cad1bd1a0fc4d9b75cd4d2990de535baf5caadfdf8d8f86664aa830c' diff --git a/packages/siopv2-oid4vp-rp-rest-api/package.json b/packages/siopv2-oid4vp-rp-rest-api/package.json index 8b653ae9e..2180fc6d8 100644 --- a/packages/siopv2-oid4vp-rp-rest-api/package.json +++ b/packages/siopv2-oid4vp-rp-rest-api/package.json @@ -19,7 +19,7 @@ "@types/uuid": "^9.0.1", "@veramo/core": "4.2.0", "@veramo/credential-w3c": "4.2.0", - "@veramo/kv-store": "file:.yalc/@veramo/kv-store", + "@sphereon/ssi-sdk.kv-store-temp": "workspace:*", "body-parser": "^1.19.0", "cookie-parser": "^1.4.5", "cors": "^2.8.5", diff --git a/packages/siopv2-oid4vp-rp-rest-api/tsconfig.json b/packages/siopv2-oid4vp-rp-rest-api/tsconfig.json index 34028386e..f45919e4d 100644 --- a/packages/siopv2-oid4vp-rp-rest-api/tsconfig.json +++ b/packages/siopv2-oid4vp-rp-rest-api/tsconfig.json @@ -7,10 +7,23 @@ "esModuleInterop": true }, "references": [ - { "path": "../siopv2-oid4vp-common" }, - { "path": "../siopv2-oid4vp-rp-auth" }, - { "path": "../presentation-exchange" }, - { "path": "../ssi-types" }, - { "path": "../ssi-sdk-core" } + { + "path": "../siopv2-oid4vp-common" + }, + { + "path": "../siopv2-oid4vp-rp-auth" + }, + { + "path": "../presentation-exchange" + }, + { + "path": "../ssi-types" + }, + { + "path": "../ssi-sdk-core" + }, + { + "path": "../kv-store" + } ] } diff --git a/packages/siopv2-oid4vp-rp-rest-api/yalc.lock b/packages/siopv2-oid4vp-rp-rest-api/yalc.lock deleted file mode 100644 index 0d032f29f..000000000 --- a/packages/siopv2-oid4vp-rp-rest-api/yalc.lock +++ /dev/null @@ -1,10 +0,0 @@ -{ - "version": "v1", - "packages": { - "@veramo/kv-store": { - "version": "4.3.0", - "signature": "bfd8bfc89f0050ba31664b2d7c3efc7a", - "file": true - } - } -} \ No newline at end of file diff --git a/packages/siopv2-oid4vp-rp-rest-client/plugin.schema.json b/packages/siopv2-oid4vp-rp-rest-client/plugin.schema.json index 8a3ea2c1e..3b41a3710 100644 --- a/packages/siopv2-oid4vp-rp-rest-client/plugin.schema.json +++ b/packages/siopv2-oid4vp-rp-rest-client/plugin.schema.json @@ -29,12 +29,7 @@ "type": "string" } }, - "required": [ - "correlationId", - "definitionId", - "authRequestURI", - "authStatusURI" - ] + "required": ["correlationId", "definitionId", "authRequestURI", "authStatusURI"] }, "ISiopClientGetAuthStatusArgs": { "type": "object", @@ -49,9 +44,7 @@ "type": "string" } }, - "required": [ - "correlationId" - ] + "required": ["correlationId"] }, "AuthStatusResponse": { "type": "object", @@ -82,32 +75,15 @@ "$ref": "#/components/schemas/AuthorizationResponsePayload" } }, - "required": [ - "status", - "correlationId", - "definitionId", - "lastUpdated" - ] + "required": ["status", "correlationId", "definitionId", "lastUpdated"] }, "AuthorizationRequestStateStatus": { "type": "string", - "enum": [ - "created", - "sent", - "received", - "verified", - "error" - ] + "enum": ["created", "sent", "received", "verified", "error"] }, "AuthorizationResponseStateStatus": { "type": "string", - "enum": [ - "created", - "sent", - "received", - "verified", - "error" - ] + "enum": ["created", "sent", "received", "verified", "error"] }, "AuthorizationResponsePayload": { "type": "object", @@ -147,9 +123,7 @@ "$ref": "#/components/schemas/PresentationSubmission" } }, - "required": [ - "state" - ] + "required": ["state"] }, "W3CVerifiablePresentation": { "anyOf": [ @@ -223,10 +197,7 @@ "type": "string" } }, - "required": [ - "@context", - "proof" - ] + "required": ["@context", "proof"] }, "IProof": { "type": "object", @@ -282,12 +253,7 @@ } } }, - "required": [ - "type", - "created", - "proofPurpose", - "verificationMethod" - ] + "required": ["type", "created", "proofPurpose", "verificationMethod"] }, "IProofType": { "type": "string", @@ -446,14 +412,7 @@ "type": "string" } }, - "required": [ - "@context", - "credentialSubject", - "issuanceDate", - "issuer", - "proof", - "type" - ] + "required": ["@context", "credentialSubject", "issuanceDate", "issuer", "proof", "type"] }, "ICredentialSchemaType": { "anyOf": [ @@ -475,9 +434,7 @@ "type": "string" } }, - "required": [ - "id" - ] + "required": ["id"] }, "IIssuerId": { "type": "string" @@ -489,9 +446,7 @@ "type": "string" } }, - "required": [ - "id" - ] + "required": ["id"] }, "ICredentialStatus": { "type": "object", @@ -503,10 +458,7 @@ "type": "string" } }, - "required": [ - "id", - "type" - ] + "required": ["id", "type"] }, "CompactJWT": { "type": "string", @@ -531,11 +483,7 @@ "description": "List of descriptors of how the claims are being mapped to presentation definition" } }, - "required": [ - "id", - "definition_id", - "descriptor_map" - ], + "required": ["id", "definition_id", "descriptor_map"], "description": "It expresses how the inputs are presented as proofs to a Verifier." }, "Descriptor": { @@ -557,11 +505,7 @@ "description": "The Proof or JWT algorith that the proof is in" } }, - "required": [ - "id", - "path", - "format" - ], + "required": ["id", "path", "format"], "description": "descriptor map laying out the structure of the presentation submission." }, "ISiopClientRemoveAuthRequestSessionArgs": { @@ -577,9 +521,7 @@ "type": "string" } }, - "required": [ - "correlationId" - ] + "required": ["correlationId"] } }, "methods": { @@ -613,4 +555,4 @@ } } } -} \ No newline at end of file +} diff --git a/packages/tsconfig.json b/packages/tsconfig.json index 7b98ab9c9..404803d62 100644 --- a/packages/tsconfig.json +++ b/packages/tsconfig.json @@ -17,6 +17,7 @@ { "path": "contact-manager" }, { "path": "data-store" }, { "path": "wellknown-did-issuer" }, - { "path": "wellknown-did-verifier" } + { "path": "wellknown-did-verifier" }, + { "path": "kv-store" } ] } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 30caee2a3..b163530cf 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -157,7 +157,7 @@ importers: version: 3.1.5 typeorm: specifier: ^0.3.12 - version: 0.3.12(sqlite3@5.1.6)(ts-node@10.9.1) + version: 0.3.12(pg@8.11.0)(sqlite3@5.1.6)(ts-node@10.9.1) devDependencies: '@sphereon/ssi-sdk.agent-config': specifier: workspace:* @@ -185,12 +185,70 @@ importers: version: 4.3.4 typeorm: specifier: ^0.3.12 - version: 0.3.12(sqlite3@5.1.6)(ts-node@10.9.1) + version: 0.3.12(pg@8.11.0)(sqlite3@5.1.6)(ts-node@10.9.1) devDependencies: sqlite3: specifier: ^5.1.6 version: 5.1.6 + packages/kv-store: + dependencies: + '@veramo/utils': + specifier: 4.2.0 + version: 4.2.0 + debug: + specifier: ^4.3.4 + version: 4.3.4 + events: + specifier: ^3.3.0 + version: 3.3.0 + json-buffer: + specifier: ^3.0.1 + version: 3.0.1 + typeorm: + specifier: ^0.3.10 + version: 0.3.12(pg@8.11.0)(sqlite3@5.1.6)(ts-node@10.9.1) + uint8arrays: + specifier: ^3.1.1 + version: 3.1.1 + devDependencies: + '@keyv/compress-brotli': + specifier: ^1.1.3 + version: 1.1.3 + '@keyv/compress-gzip': + specifier: ^1.2.3 + version: 1.2.3 + '@keyv/sqlite': + specifier: ^3.6.5 + version: 3.6.5 + '@keyv/test-suite': + specifier: ^1.9.2 + version: 1.9.2 + '@types/debug': + specifier: ^4.1.7 + version: 4.1.7 + '@types/json-buffer': + specifier: ^3.0.0 + version: 3.0.0 + '@veramo/cli': + specifier: 4.2.0 + version: 4.2.0(@types/node@18.16.3)(ts-node@10.9.1) + eslint: + specifier: ^8.33.0 + version: 8.35.0 + eslint-plugin-promise: + specifier: ^6.1.1 + version: 6.1.1(eslint@8.35.0) + keyv: + specifier: ^4.5.2 + version: 4.5.2 + timekeeper: + specifier: ^2.2.0 + version: 2.2.0 + typescript: + specifier: ^4.9.5 + version: 4.9.5 + packages/ms-authenticator: dependencies: '@azure/msal-common': @@ -241,7 +299,7 @@ importers: version: 1.17.2 typeorm: specifier: ^0.3.12 - version: 0.3.12(sqlite3@5.1.6)(ts-node@10.9.1) + version: 0.3.12(pg@8.11.0)(sqlite3@5.1.6)(ts-node@10.9.1) devDependencies: '@sphereon/ssi-sdk.agent-config': specifier: workspace:* @@ -263,7 +321,7 @@ importers: version: 9.0.1 '@veramo/data-store': specifier: 4.2.0 - version: 4.2.0(patch_hash=feb5u2ygzsdf67qbxr2lxgqjyy)(sqlite3@5.1.6)(ts-node@10.9.1) + version: 4.2.0(patch_hash=feb5u2ygzsdf67qbxr2lxgqjyy)(pg@8.11.0)(sqlite3@5.1.6)(ts-node@10.9.1) jest: specifier: ^27.5.1 version: 27.5.1(ts-node@10.9.1) @@ -294,15 +352,15 @@ importers: '@sphereon/ssi-sdk-ext.did-utils': specifier: ^0.12.0 version: 0.12.0 + '@sphereon/ssi-sdk.kv-store-temp': + specifier: workspace:* + version: link:../kv-store '@sphereon/ssi-types': specifier: workspace:* version: link:../ssi-types '@veramo/core': specifier: 4.2.0 version: 4.2.0(patch_hash=c5oempznsz4br5w3tcuk2i2mau) - '@veramo/kv-store': - specifier: file:.yalc/@veramo/kv-store - version: file:packages/presentation-exchange/.yalc/@veramo/kv-store(ts-node@10.9.1) devDependencies: '@sphereon/did-uni-client': specifier: ^0.6.0 @@ -490,6 +548,9 @@ importers: '@sphereon/ssi-sdk.core': specifier: workspace:* version: link:../ssi-sdk-core + '@sphereon/ssi-sdk.kv-store-temp': + specifier: workspace:* + version: link:../kv-store '@sphereon/ssi-sdk.presentation-exchange': specifier: workspace:* version: link:../presentation-exchange @@ -511,9 +572,6 @@ importers: '@veramo/credential-w3c': specifier: 4.2.0 version: 4.2.0 - '@veramo/kv-store': - specifier: file:.yalc/@veramo/kv-store - version: file:packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store(ts-node@10.9.1) cross-fetch: specifier: ^3.1.5 version: 3.1.5 @@ -545,6 +603,9 @@ importers: '@sphereon/did-auth-siop': specifier: ^0.3.1-unstable.1 version: 0.3.1-unstable.1 + '@sphereon/ssi-sdk.kv-store-temp': + specifier: workspace:* + version: link:../kv-store '@sphereon/ssi-sdk.presentation-exchange': specifier: workspace:* version: link:../presentation-exchange @@ -566,9 +627,6 @@ importers: '@veramo/credential-w3c': specifier: 4.2.0 version: 4.2.0 - '@veramo/kv-store': - specifier: file:.yalc/@veramo/kv-store - version: file:packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store(ts-node@10.9.1) body-parser: specifier: ^1.19.0 version: 1.19.0 @@ -641,7 +699,7 @@ importers: version: 18.16.3 '@veramo/data-store': specifier: 4.2.0 - version: 4.2.0(patch_hash=feb5u2ygzsdf67qbxr2lxgqjyy)(sqlite3@5.1.6)(ts-node@10.9.1) + version: 4.2.0(patch_hash=feb5u2ygzsdf67qbxr2lxgqjyy)(pg@8.11.0)(sqlite3@5.1.6)(ts-node@10.9.1) '@veramo/did-manager': specifier: 4.2.0 version: 4.2.0 @@ -680,7 +738,7 @@ importers: version: 10.9.1(@types/node@18.16.3)(typescript@4.9.5) typeorm: specifier: ^0.3.12 - version: 0.3.12(sqlite3@5.1.6)(ts-node@10.9.1) + version: 0.3.12(pg@8.11.0)(sqlite3@5.1.6)(ts-node@10.9.1) packages/siopv2-oid4vp-rp-rest-client: dependencies: @@ -894,7 +952,7 @@ importers: version: 4.2.0 '@veramo/data-store': specifier: 4.2.0 - version: 4.2.0(patch_hash=feb5u2ygzsdf67qbxr2lxgqjyy)(sqlite3@5.1.6)(ts-node@10.9.1) + version: 4.2.0(patch_hash=feb5u2ygzsdf67qbxr2lxgqjyy)(pg@8.11.0)(sqlite3@5.1.6)(ts-node@10.9.1) '@veramo/did-manager': specifier: 4.2.0 version: 4.2.0 @@ -945,7 +1003,7 @@ importers: version: 0.1.3 '@veramo/data-store': specifier: 4.2.0 - version: 4.2.0(patch_hash=feb5u2ygzsdf67qbxr2lxgqjyy)(sqlite3@5.1.6)(ts-node@10.9.1) + version: 4.2.0(patch_hash=feb5u2ygzsdf67qbxr2lxgqjyy)(pg@8.11.0)(sqlite3@5.1.6)(ts-node@10.9.1) '@veramo/utils': specifier: 4.2.0 version: 4.2.0 @@ -957,7 +1015,7 @@ importers: version: 3.1.3 typeorm: specifier: ^0.3.12 - version: 0.3.12(sqlite3@5.1.6)(ts-node@10.9.1) + version: 0.3.12(pg@8.11.0)(sqlite3@5.1.6)(ts-node@10.9.1) uuid: specifier: ^8.3.2 version: 8.3.2 @@ -2307,6 +2365,24 @@ packages: resolution: {integrity: sha512-R524tD5VwOt3QRHr7N518nqTVR/HKgfWL4LypekcGuNQN8R4PWScvuRcRzrY39A28kLztMv+TJdiKuMNbkU1ug==} engines: {node: '>=8.9'} + /@chainsafe/as-sha256@0.4.1: + resolution: {integrity: sha512-IqeeGwQihK6Y2EYLFofqs2eY2ep1I2MvQXHzOAI+5iQN51OZlUkrLgyAugu2x86xZewDk5xas7lNczkzFzF62w==} + dev: true + + /@chainsafe/persistent-merkle-tree@0.6.1: + resolution: {integrity: sha512-gcENLemRR13+1MED2NeZBMA7FRS0xQPM7L2vhMqvKkjqtFT4YfjSVADq5U0iLuQLhFUJEMVuA8fbv5v+TN6O9A==} + dependencies: + '@chainsafe/as-sha256': 0.4.1 + '@noble/hashes': 1.2.0 + dev: true + + /@chainsafe/ssz@0.11.1: + resolution: {integrity: sha512-cB8dBkgGN6ZoeOKuk+rIRHKN0L5i9JLGeC0Lui71QX0TuLcQKwgbfkUexpyJxnGFatWf8yeJxlOjozMn/OTP0g==} + dependencies: + '@chainsafe/as-sha256': 0.4.1 + '@chainsafe/persistent-merkle-tree': 0.6.1 + dev: true + /@colors/colors@1.5.0: resolution: {integrity: sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==} engines: {node: '>=0.1.90'} @@ -2490,6 +2566,22 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true + /@ethereumjs/rlp@4.0.1: + resolution: {integrity: sha512-tqsQiBQDQdmPWE1xkkBq4rlSW5QZpLOUJ5RJh2/9fug+q9tnUhuZoVLk7s0scUIKTOzEtR72DFBXI4WiZcMpvw==} + engines: {node: '>=14'} + hasBin: true + dev: true + + /@ethereumjs/util@8.0.6: + resolution: {integrity: sha512-zFLG/gXtF3QUC7iKFn4PT6HCr+DEnlCbwUGKGtXoqjA+64T+e0FuqMjlo4bQIY2ngRzk3EtudKdGYC4g31ehhg==} + engines: {node: '>=14'} + dependencies: + '@chainsafe/ssz': 0.11.1 + '@ethereumjs/rlp': 4.0.1 + ethereum-cryptography: 2.0.0 + micro-ftch: 0.3.1 + dev: true + /@ethersproject/abi@5.7.0: resolution: {integrity: sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA==} dependencies: @@ -3447,11 +3539,53 @@ packages: '@jridgewell/resolve-uri': 3.1.1 '@jridgewell/sourcemap-codec': 1.4.15 + /@keyv/compress-brotli@1.1.3: + resolution: {integrity: sha512-6QdtGH/iHKj3GGN4a+m/EfhmfVeeVq2Z9yOlDwaHh18Pe9UncFCIJNpbahVdgxn2gedYjKOQR7s06SyPF2Y4Nw==} + engines: {node: '>= 12'} + dependencies: + compress-brotli: 1.3.8 + dev: true + + /@keyv/compress-gzip@1.2.3: + resolution: {integrity: sha512-nwPlHX18bWXNKbmIi0nGfwJlXvqusISbX9IpQssY0Uj/olddhz4s0K8hKJAFr13iEsD8PhJA5stnKB2UNwBasQ==} + engines: {node: '>= 12'} + dependencies: + '@types/pako': 2.0.0 + json-buffer: 3.0.1 + pako: 2.1.0 + dev: true + + /@keyv/sqlite@3.6.5: + resolution: {integrity: sha512-PZPsXcZYHPKUCX1DO7e6dTMGmk5aX7uW8QFzEavOPRMVloIp2QMv+Glt162pu+Dw5NunJinCbvD2DvYwinyNZw==} + engines: {node: '>= 12'} + dependencies: + pify: 5.0.0 + sqlite3: 5.1.6 + transitivePeerDependencies: + - bluebird + - encoding + - supports-color + dev: true + + /@keyv/test-suite@1.9.2: + resolution: {integrity: sha512-0pB36ZP22fBSeZuwwQRrFeuuRu6L10lEOJMv+5Fq6XXbXjN1Tvaoh7et6pqnk35qW0s0RSlOsY0m6lqydb7b6A==} + dependencies: + bignumber.js: 9.1.1 + delay: 5.0.0 + json-bigint: 1.0.0 + sqlite3: 5.1.6 + timekeeper: 2.2.0 + transitivePeerDependencies: + - bluebird + - encoding + - supports-color + dev: true + /@lerna/child-process@6.6.1: resolution: {integrity: sha512-yUCDCcRNNbI9UUsUB6FYEmDHpo5Tn/f0q5D7vhDP4i6Or8kBj82y7+e31hwfLvK2ykOYlDVs2MxAluH/+QUBOQ==} engines: {node: ^14.15.0 || >=16.0.0} dependencies: - chalk: 4.1.0 + chalk: 4.1.2 execa: 5.0.0 strong-log-transformer: 2.1.0 dev: true @@ -3693,6 +3827,61 @@ packages: - supports-color optional: true + /@metamask/eth-sig-util@5.1.0: + resolution: {integrity: sha512-mlgziIHYlA9pi/XZerChqg4NocdOgBPB9NmxgXWQO2U2hH8RGOJQrz6j/AIKkYxgCMIE2PY000+joOwXfzeTDQ==} + engines: {node: '>=14.0.0'} + dependencies: + '@ethereumjs/util': 8.0.6 + bn.js: 4.12.0 + ethereum-cryptography: 2.0.0 + ethjs-util: 0.1.6 + tweetnacl: 1.0.3 + tweetnacl-util: 0.15.1 + dev: true + + /@microsoft/api-extractor-model@7.26.9(@types/node@18.16.3): + resolution: {integrity: sha512-1AowqcRy5qMH/OB7UNkdXa4qLoJp58WFdJ026IMFS8skA0OOAOcvBV/Fi4L7fO1R/8uCMz5KHi3NsqVH4Li8xg==} + dependencies: + '@microsoft/tsdoc': 0.14.2 + '@microsoft/tsdoc-config': 0.16.2 + '@rushstack/node-core-library': 3.59.0(@types/node@18.16.3) + transitivePeerDependencies: + - '@types/node' + dev: true + + /@microsoft/api-extractor@7.34.9(@types/node@18.16.3): + resolution: {integrity: sha512-dasBIbqgHgxvfRfEOX4+ynNYQPnTYc6k7jkL3V4f/MoaS2xFUoIj/D71crrsDxf5MNMybjzeyZPdRNZdzvKBVw==} + hasBin: true + dependencies: + '@microsoft/api-extractor-model': 7.26.9(@types/node@18.16.3) + '@microsoft/tsdoc': 0.14.2 + '@microsoft/tsdoc-config': 0.16.2 + '@rushstack/node-core-library': 3.59.0(@types/node@18.16.3) + '@rushstack/rig-package': 0.3.18 + '@rushstack/ts-command-line': 4.13.2 + colors: 1.2.5 + lodash: 4.17.21 + resolve: 1.22.2 + semver: 7.3.8 + source-map: 0.6.1 + typescript: 4.8.4 + transitivePeerDependencies: + - '@types/node' + dev: true + + /@microsoft/tsdoc-config@0.16.2: + resolution: {integrity: sha512-OGiIzzoBLgWWR0UdRJX98oYO+XKGf7tiK4Zk6tQ/E4IJqGCe7dvkTvgDZV5cFJUzLGDOjeAXrnZoA6QkVySuxw==} + dependencies: + '@microsoft/tsdoc': 0.14.2 + ajv: 6.12.6 + jju: 1.4.0 + resolve: 1.19.0 + dev: true + + /@microsoft/tsdoc@0.14.2: + resolution: {integrity: sha512-9b8mPpKrfeGRuhFH5iO1iwCLeIIsV6+H1sRfxbkoGXIyQE2BTsPd9zqSqQJ+pv5sJ/hT5M1zvOFL02MnEezFug==} + dev: true + /@multiformats/base-x@4.0.1: resolution: {integrity: sha512-eMk0b9ReBbV23xXU693TAIrLyeO5iTgBZGSJfpqriG8UkYvr/hC9u9pyMlAakDNHWmbhMZCDs6KQO0jzKD8OTw==} dev: true @@ -4199,7 +4388,7 @@ packages: '@octokit/request-error': 3.0.3 '@octokit/types': 9.2.1 is-plain-object: 5.0.0 - node-fetch: 2.6.7 + node-fetch: 2.6.9 universal-user-agent: 6.0.0 transitivePeerDependencies: - encoding @@ -4489,9 +4678,57 @@ packages: /@react-native/polyfills@2.0.0: resolution: {integrity: sha512-K0aGNn1TjalKj+65D7ycc1//H9roAQ51GJVk5ZJQFb2teECGmzd86bYDC0aYdbRf7gtovescq4Zt6FR0tgXiHQ==} + /@rushstack/node-core-library@3.59.0(@types/node@18.16.3): + resolution: {integrity: sha512-f8ilzooAu8vj60dDe7weqHvR1NujOaKfe3TaNgAoT22rk+daUTmDtY3TlVGJ3HayVPmw3ffWToDatITi7Ic4ag==} + peerDependencies: + '@types/node': '*' + peerDependenciesMeta: + '@types/node': + optional: true + dependencies: + '@types/node': 18.16.3 + colors: 1.2.5 + fs-extra: 7.0.1 + import-lazy: 4.0.0 + jju: 1.4.0 + resolve: 1.22.2 + semver: 7.3.8 + z-schema: 5.0.5 + dev: true + + /@rushstack/rig-package@0.3.18: + resolution: {integrity: sha512-SGEwNTwNq9bI3pkdd01yCaH+gAsHqs0uxfGvtw9b0LJXH52qooWXnrFTRRLG1aL9pf+M2CARdrA9HLHJys3jiQ==} + dependencies: + resolve: 1.22.2 + strip-json-comments: 3.1.1 + dev: true + + /@rushstack/ts-command-line@4.13.2: + resolution: {integrity: sha512-bCU8qoL9HyWiciltfzg7GqdfODUeda/JpI0602kbN5YH22rzTxyqYvv7aRLENCM7XCQ1VRs7nMkEqgJUOU8Sag==} + dependencies: + '@types/argparse': 1.0.38 + argparse: 1.0.10 + colors: 1.2.5 + string-argv: 0.3.2 + dev: true + /@scure/base@1.1.1: resolution: {integrity: sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA==} - dev: false + + /@scure/bip32@1.3.0: + resolution: {integrity: sha512-bcKpo1oj54hGholplGLpqPHRbIsnbixFtc06nwuNM5/dwSXOq/AAYoIBRsBmnZJSdfeNW5rnff7NTAz3ZCqR9Q==} + dependencies: + '@noble/curves': 1.0.0 + '@noble/hashes': 1.2.0 + '@scure/base': 1.1.1 + dev: true + + /@scure/bip39@1.2.0: + resolution: {integrity: sha512-SX/uKq52cuxm4YFXWFaVByaSHJh2w3BnokVSeUJVCv6K7WulT9u2BuNRBhuFl8vAuYnzx9bEu9WgpcNYTrYieg==} + dependencies: + '@noble/hashes': 1.2.0 + '@scure/base': 1.1.1 + dev: true /@segment/loosely-validate-event@2.0.0: resolution: {integrity: sha512-ZMCSfztDBqwotkl848ODgVcAmN4OItEWDCkshcKz0/W6gGSQayuuCtWV/MlodFivAZD793d6UgANd6wCXUfrIw==} @@ -5513,6 +5750,10 @@ packages: minimatch: 9.0.0 dev: true + /@types/argparse@1.0.38: + resolution: {integrity: sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==} + dev: true + /@types/aria-query@5.0.1: resolution: {integrity: sha512-XTIieEY+gvJ39ChLcB4If5zHtPxt3Syj5rgZR+e1ctpmK8NjPf0zFqsz4JpLJT0xla9GFDKjy8Cpu331nrmE1Q==} dev: true @@ -5546,6 +5787,12 @@ packages: '@babel/types': 7.21.5 dev: true + /@types/blessed@0.1.21: + resolution: {integrity: sha512-nlJHCM/wDUtvhDF7FBW2fWTP1JIPMm16xKXTdaAgOaqXiT4VkB/GIc7LAX5BxhTR09BVeNF2JzxszHC9Tres2w==} + dependencies: + '@types/node': 18.16.3 + dev: true + /@types/body-parser@1.19.2: resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==} dependencies: @@ -5706,6 +5953,10 @@ packages: resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==} dev: true + /@types/pako@2.0.0: + resolution: {integrity: sha512-10+iaz93qR5WYxTo+PMifD5TSxiOtdRaxBf7INGGXMQgTCu8Z/7GYWYFUOS3q/G0nE5boj1r4FEB+WSy7s5gbA==} + dev: true + /@types/parse-json@4.0.0: resolution: {integrity: sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==} dev: true @@ -5769,6 +6020,13 @@ packages: /@types/stack-utils@2.0.1: resolution: {integrity: sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==} + /@types/swagger-ui-express@4.1.3: + resolution: {integrity: sha512-jqCjGU/tGEaqIplPy3WyQg+Nrp6y80DCFnDEAvVKWkJyv0VivSSDCChkppHRHAablvInZe6pijDFMnavtN0vqA==} + dependencies: + '@types/express': 4.17.17 + '@types/serve-static': 1.15.1 + dev: true + /@types/testing-library__jest-dom@5.14.5: resolution: {integrity: sha512-SBwbxYoyPIvxHbeHxTZX2Pe/74F/tX2/D3mMvzabdeJ25bBojfW0TyB8BHrbq/9zaaKICJZjLP+8r6AeZMFCuQ==} dependencies: @@ -6061,6 +6319,93 @@ packages: graphql: 15.8.0 wonka: 4.0.15 + /@veramo/cli@4.2.0(@types/node@18.16.3)(ts-node@10.9.1): + resolution: {integrity: sha512-73jG//N0ikpqbpUtokmydIjDKQeOysmHX0LFMP+zXh81kFhkGvEWk7Am9BBibKuWtq0uDCAXvk0TqsnK+Ajcqg==} + hasBin: true + dependencies: + '@microsoft/api-extractor': 7.34.9(@types/node@18.16.3) + '@microsoft/api-extractor-model': 7.26.9(@types/node@18.16.3) + '@types/blessed': 0.1.21 + '@types/swagger-ui-express': 4.1.3 + '@veramo/core': 4.2.0(patch_hash=c5oempznsz4br5w3tcuk2i2mau) + '@veramo/credential-eip712': 4.2.0 + '@veramo/credential-ld': 4.2.0 + '@veramo/credential-w3c': 4.2.0 + '@veramo/data-store': 4.2.0(patch_hash=feb5u2ygzsdf67qbxr2lxgqjyy)(pg@8.11.0)(sqlite3@5.1.6)(ts-node@10.9.1) + '@veramo/did-comm': 4.2.0 + '@veramo/did-discovery': 4.2.0 + '@veramo/did-jwt': 4.2.0 + '@veramo/did-manager': 4.2.0 + '@veramo/did-provider-ethr': 4.2.0 + '@veramo/did-provider-key': 4.2.0 + '@veramo/did-provider-web': 4.2.0 + '@veramo/did-resolver': 4.2.0 + '@veramo/key-manager': 4.2.0 + '@veramo/kms-local': 4.2.0 + '@veramo/message-handler': 4.2.0 + '@veramo/remote-client': 4.2.0 + '@veramo/remote-server': 4.2.0(express@4.18.2) + '@veramo/selective-disclosure': 4.2.0 + '@veramo/url-handler': 4.2.0 + blessed: 0.1.81 + commander: 9.5.0 + console-table-printer: 2.11.1 + cors: 2.8.5 + cross-fetch: 3.1.5 + date-fns: 2.30.0 + debug: 4.3.4 + did-resolver: 4.1.0 + dotenv: 16.0.3 + ethr-did-resolver: 8.0.0 + express: 4.18.2 + express-handlebars: 6.0.7 + fuzzy: 0.1.3 + handlebars: 4.7.7 + inquirer: 8.2.5 + inquirer-autocomplete-prompt: 2.0.0(inquirer@8.2.5) + json-schema: 0.4.0 + json5: 2.2.3 + jsonpointer: 5.0.1 + oas-resolver: 2.5.6 + openapi-types: 12.1.0 + passport: 0.6.0 + passport-http-bearer: 1.0.1 + pg: 8.11.0 + qrcode-terminal: 0.12.0 + sqlite3: 5.1.6 + swagger-ui-express: 4.6.3(express@4.18.2) + ts-json-schema-generator: 1.2.0 + typeorm: 0.3.12(pg@8.11.0)(sqlite3@5.1.6)(ts-node@10.9.1) + url-parse: 1.5.10 + web-did-resolver: 2.0.23 + ws: 8.13.0 + yaml: 2.2.2 + transitivePeerDependencies: + - '@google-cloud/spanner' + - '@sap/hana-client' + - '@types/node' + - better-sqlite3 + - bluebird + - bufferutil + - domexception + - encoding + - hdb-pool + - ioredis + - mongodb + - mssql + - mysql2 + - oracledb + - pg-native + - pg-query-stream + - redis + - sql.js + - supports-color + - ts-node + - typeorm-aurora-data-api-driver + - utf-8-validate + - web-streams-polyfill + dev: true + /@veramo/core@4.2.0(patch_hash=c5oempznsz4br5w3tcuk2i2mau): resolution: {integrity: sha512-HIqbXfCbwOAJelR5Ohsm22vr63cy6ND8Ua/+9wfMDAiymUUS7NryaJ/v6NRtnmIrNZqUMDdR9/TWdp4cCq5eBg==} dependencies: @@ -6074,6 +6419,19 @@ packages: - supports-color patched: true + /@veramo/credential-eip712@4.2.0: + resolution: {integrity: sha512-jPeRFH7Z/ajct4RYV56w42H8RJzrwZo476mWaFv1nVK68Yn18edqZj3xfGs1ADxpHoOW7QUPLW4oIp73+Ychsw==} + dependencies: + '@metamask/eth-sig-util': 5.1.0 + '@veramo/core': 4.2.0(patch_hash=c5oempznsz4br5w3tcuk2i2mau) + '@veramo/utils': 4.2.0 + debug: 4.3.4 + eip-712-types-generation: 0.1.6 + transitivePeerDependencies: + - encoding + - supports-color + dev: true + /@veramo/credential-ld@4.2.0: resolution: {integrity: sha512-NatTOEtqudRF8ag5wNrcaNvLAdOsPtDqujZbB16HBVlVavrcVPorPCMbFCUflTKabfDeVfXaoOuvP+W3EXBijQ==} dependencies: @@ -6119,7 +6477,7 @@ packages: - supports-color - web-streams-polyfill - /@veramo/data-store@4.2.0(patch_hash=feb5u2ygzsdf67qbxr2lxgqjyy)(sqlite3@5.1.6)(ts-node@10.9.1): + /@veramo/data-store@4.2.0(patch_hash=feb5u2ygzsdf67qbxr2lxgqjyy)(pg@8.11.0)(sqlite3@5.1.6)(ts-node@10.9.1): resolution: {integrity: sha512-gwinKYd//jOCXrdr2NefXOHnuUT8Vz2sHvSMFvm41UVD9QMpeKpTrTEqGoYG/eDg/1+U9aQlb+AI6bFUNNsk0Q==} dependencies: '@veramo/core': 4.2.0(patch_hash=c5oempznsz4br5w3tcuk2i2mau) @@ -6128,7 +6486,7 @@ packages: '@veramo/key-manager': 4.2.0 '@veramo/utils': 4.2.0 debug: 4.3.4 - typeorm: 0.3.12(sqlite3@5.1.6)(ts-node@10.9.1) + typeorm: 0.3.12(pg@8.11.0)(sqlite3@5.1.6)(ts-node@10.9.1) transitivePeerDependencies: - '@google-cloud/spanner' - '@sap/hana-client' @@ -6151,6 +6509,25 @@ packages: - typeorm-aurora-data-api-driver patched: true + /@veramo/did-comm@4.2.0: + resolution: {integrity: sha512-plnAYAXFmtEjoJE/kSxFZdVYOynNLkIUdnwkSrQOi5MPhcj8AEKQfXt8DecyIkfFCxuvdHPjEerBVbka1q7kZw==} + dependencies: + '@ethersproject/signing-key': 5.7.0 + '@stablelib/ed25519': 1.0.3 + '@veramo/core': 4.2.0(patch_hash=c5oempznsz4br5w3tcuk2i2mau) + '@veramo/message-handler': 4.2.0 + '@veramo/utils': 4.2.0 + cross-fetch: 3.1.5 + debug: 4.3.4 + did-jwt: 6.11.6 + did-resolver: 4.1.0 + uint8arrays: 3.1.1 + uuid: 9.0.0 + transitivePeerDependencies: + - encoding + - supports-color + dev: true + /@veramo/did-discovery@4.2.0: resolution: {integrity: sha512-U2baTL/KXgj84TF7hJxvUzh8oyfEQSsWSpqbRTQITE6bbSBaZiM/ZfgHRty8wuDFMFVV/f+xbkwdkOf3nY7SpQ==} dependencies: @@ -6333,6 +6710,36 @@ packages: - encoding - supports-color + /@veramo/selective-disclosure@4.2.0: + resolution: {integrity: sha512-yMvg0xWk1SawhgiR1HE+QRCJsrogXU3IjOCG1LX/eEhcLtgHE12BzLaX69dyh4+ZYCJGqguwODic4RzQDx2CNg==} + dependencies: + '@veramo/core': 4.2.0(patch_hash=c5oempznsz4br5w3tcuk2i2mau) + '@veramo/credential-w3c': 4.2.0 + '@veramo/did-jwt': 4.2.0 + '@veramo/message-handler': 4.2.0 + debug: 4.3.4 + did-jwt: 6.11.6 + uuid: 9.0.0 + transitivePeerDependencies: + - domexception + - encoding + - supports-color + - web-streams-polyfill + dev: true + + /@veramo/url-handler@4.2.0: + resolution: {integrity: sha512-IfU4bPLbTPT06VGI9L+RftvcwdrDfOrM56GR6ovSkA6znswzv+uGHMs2Z+ngJof0dD6M7w5JpEdgB9ec7IGbEA==} + dependencies: + '@veramo/core': 4.2.0(patch_hash=c5oempznsz4br5w3tcuk2i2mau) + '@veramo/message-handler': 4.2.0 + cross-fetch: 3.1.5 + debug: 4.3.4 + url-parse: 1.5.10 + transitivePeerDependencies: + - encoding + - supports-color + dev: true + /@veramo/utils@4.2.0: resolution: {integrity: sha512-jHkli0Qz9rFsWzPAdfJP3P2MFxvVMZPDXZvtVBm8x1fjAGrw/Htz/c5drhDAeBXnqPd9011/7cyvp6AOvdbc8Q==} dependencies: @@ -7165,7 +7572,6 @@ packages: /bignumber.js@9.1.1: resolution: {integrity: sha512-pHm4LsMJ6lzgNGVfZHjMoO8sdoRhOzOH4MLmY65Jg70bpxCKu5iOHNJyfF6OyvYw7t8Fpf35RuzUyqnQsj8Vig==} - dev: false /bin-links@4.0.1: resolution: {integrity: sha512-bmFEM39CyX336ZGGRsGPlc6jZHriIoHacOQcTt72MktIjpPhZoP4te2jOyUXF3BLILmJ8aNLncoPVeIIFlrDeA==} @@ -7205,6 +7611,12 @@ packages: /blakejs@1.2.1: resolution: {integrity: sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==} + /blessed@0.1.81: + resolution: {integrity: sha512-LoF5gae+hlmfORcG1M5+5XZi4LBmvlXTzwJWzUlPryN/SJdSflZvROM2TwkT0GMpq7oqT48NRd4GS7BiVBc5OQ==} + engines: {node: '>= 0.8.0'} + hasBin: true + dev: true + /blueimp-md5@2.19.0: resolution: {integrity: sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==} @@ -7383,6 +7795,10 @@ packages: /buffer-from@1.1.2: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} + /buffer-writer@2.0.0: + resolution: {integrity: sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==} + engines: {node: '>=4'} + /buffer-xor@1.0.3: resolution: {integrity: sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==} dev: true @@ -7471,7 +7887,7 @@ packages: promise-inflight: 1.0.1 rimraf: 3.0.2 ssri: 9.0.1 - tar: 6.1.11 + tar: 6.1.14 unique-filename: 2.0.1 transitivePeerDependencies: - bluebird @@ -7491,7 +7907,7 @@ packages: minipass-pipeline: 1.2.4 p-map: 4.0.0 ssri: 10.0.4 - tar: 6.1.11 + tar: 6.1.14 unique-filename: 3.0.0 dev: true @@ -7846,6 +8262,11 @@ packages: /colorette@1.4.0: resolution: {integrity: sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==} + /colors@1.2.5: + resolution: {integrity: sha512-erNRLao/Y3Fv54qUa0LBB+//Uf3YwMUmdJinN20yMXm9zdKKqH9wt7R9IIVZ+K7ShzfpLV/Zg8+VyrBJYB4lpg==} + engines: {node: '>=0.1.90'} + dev: true + /columnify@1.6.0: resolution: {integrity: sha512-lomjuFZKfM6MSAnV9aCZC9sc0qGbmZdfygNv+nCpqVkSKdCxCklLtd16O0EILGkImHw9ZpHkAnHaB+8Zxq5W6Q==} engines: {node: '>=8.0.0'} @@ -7931,6 +8352,14 @@ packages: /component-type@1.2.1: resolution: {integrity: sha512-Kgy+2+Uwr75vAi6ChWXgHuLvd+QLD7ssgpaRq2zCvt80ptvAfMc/hijcJxXkBa2wMlEZcJvC2H8Ubo+A9ATHIg==} + /compress-brotli@1.3.8: + resolution: {integrity: sha512-lVcQsjhxhIXsuupfy9fmZUFtAIdBmXA7EGY6GBdgZ++qkM9zG4YFT8iU7FoBxzryNDMOpD1HIFHUSX4D87oqhQ==} + engines: {node: '>= 12'} + dependencies: + '@types/json-buffer': 3.0.0 + json-buffer: 3.0.1 + dev: true + /compressible@2.0.18: resolution: {integrity: sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==} engines: {node: '>= 0.6'} @@ -7992,6 +8421,12 @@ packages: /console-control-strings@1.1.0: resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} + /console-table-printer@2.11.1: + resolution: {integrity: sha512-8LfFpbF/BczoxPwo2oltto5bph8bJkGOATXsg3E9ddMJOGnWJciKHldx2zDj5XIBflaKzPfVCjOTl6tMh7lErg==} + dependencies: + simple-wcswidth: 1.0.1 + dev: true + /content-disposition@0.5.4: resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==} engines: {node: '>= 0.6'} @@ -8154,7 +8589,6 @@ packages: dependencies: object-assign: 4.1.1 vary: 1.1.2 - dev: false /cosmiconfig@5.2.1: resolution: {integrity: sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==} @@ -8503,7 +8937,7 @@ packages: engines: {node: '>=10'} dependencies: globby: 11.1.0 - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 is-glob: 4.0.3 is-path-cwd: 2.2.0 is-path-inside: 3.0.3 @@ -8511,6 +8945,11 @@ packages: rimraf: 3.0.2 slash: 3.0.0 + /delay@5.0.0: + resolution: {integrity: sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw==} + engines: {node: '>=10'} + dev: true + /delayed-stream@1.0.0: resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} engines: {node: '>=0.4.0'} @@ -8736,6 +9175,12 @@ packages: /ee-first@1.1.1: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} + /eip-712-types-generation@0.1.6: + resolution: {integrity: sha512-O2zjZcGFKyuXxW3s5ATxA1EJzszWHKYASBqpIyIhXzvFW6YFkYdDIgsoAdLnX3ClZd6908xaOPPPbTVgXy0URQ==} + dependencies: + json-canonicalize: 1.0.6 + dev: true + /ejs@3.1.9: resolution: {integrity: sha512-rC+QVNMJWv+MtPgkt0y+0rVEIdbtxVADApW9JXrUVlzHetgcyczP/E7DJmWJ4fJCZF2cPcBk0laWO9ZHMG3DmQ==} engines: {node: '>=0.10.0'} @@ -9063,6 +9508,15 @@ packages: - supports-color dev: true + /eslint-plugin-promise@6.1.1(eslint@8.35.0): + resolution: {integrity: sha512-tjqWDwVZQo7UIPMeDReOpUgHCmCiH+ePnVT+5zVapL0uuHnegBUs2smM13CzOs2Xb5+MHMRFTs9v24yjba4Oig==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + dependencies: + eslint: 8.35.0 + dev: true + /eslint-scope@5.1.1: resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} engines: {node: '>=8.0.0'} @@ -9282,8 +9736,17 @@ packages: resolution: {integrity: sha512-GAb7mPvGgcfi1j+Bsnwm9af9Z7dLUKp+5cFm88+kMrKACfh9gLatGLVVK5pSGEG2pOGfrmqCRcuh3RtMjIg8GQ==} hasBin: true dependencies: - keccak256: 1.0.6 - meow: 5.0.0 + keccak256: 1.0.6 + meow: 5.0.0 + dev: true + + /ethereum-cryptography@2.0.0: + resolution: {integrity: sha512-g25m4EtfQGjstWgVE1aIz7XYYjf3kH5kG17ULWVB5dH6uLahsoltOhACzSxyDV+fhn4gbR4xRrOXGe6r2uh4Bg==} + dependencies: + '@noble/curves': 1.0.0 + '@noble/hashes': 1.2.0 + '@scure/bip32': 1.3.0 + '@scure/bip39': 1.2.0 dev: true /ethereum-public-key-to-address@0.0.2: @@ -9296,6 +9759,14 @@ packages: secp256k1: 3.8.0 dev: true + /ethjs-util@0.1.6: + resolution: {integrity: sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==} + engines: {node: '>=6.5.0', npm: '>=3'} + dependencies: + is-hex-prefixed: 1.0.0 + strip-hex-prefix: 1.0.0 + dev: true + /ethr-did-resolver@8.0.0: resolution: {integrity: sha512-iOsWa4qJAIt0kl6ilX1usOGq5j+Sqq5YR3OjmPSaaquvJNQUv0DjOn9656WSHvkknELmZAoXZH9naPGarTqldQ==} dependencies: @@ -9557,6 +10028,15 @@ packages: - supports-color - utf-8-validate + /express-handlebars@6.0.7: + resolution: {integrity: sha512-iYeMFpc/hMD+E6FNAZA5fgWeXnXr4rslOSPkeEV6TwdmpJ5lEXuWX0u9vFYs31P2MURctQq2batR09oeNj0LIg==} + engines: {node: '>=v12.22.9'} + dependencies: + glob: 8.1.0 + graceful-fs: 4.2.11 + handlebars: 4.7.7 + dev: true + /express-session@1.17.2: resolution: {integrity: sha512-mPcYcLA0lvh7D4Oqr5aNJFMtBMKPLl++OKKxkHzZ0U0oDq1rpKBnkR5f5vCHR26VeArlTOEF9td4x5IjICksRQ==} engines: {node: '>= 0.8.0'} @@ -10006,11 +10486,20 @@ packages: resolution: {integrity: sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==} engines: {node: '>=14.14'} dependencies: - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 jsonfile: 6.1.0 universalify: 2.0.0 dev: true + /fs-extra@7.0.1: + resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==} + engines: {node: '>=6 <7 || >=8'} + dependencies: + graceful-fs: 4.2.11 + jsonfile: 4.0.0 + universalify: 0.1.2 + dev: true + /fs-extra@8.1.0: resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==} engines: {node: '>=6 <7 || >=8'} @@ -10033,7 +10522,7 @@ packages: engines: {node: '>=10'} dependencies: at-least-node: 1.0.0 - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 jsonfile: 6.1.0 universalify: 2.0.0 @@ -10085,6 +10574,11 @@ packages: /functions-have-names@1.2.3: resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} + /fuzzy@0.1.3: + resolution: {integrity: sha512-/gZffu4ykarLrCiP3Ygsa86UAo1E5vEVlvTrpkKywXSbP9Xhln3oSp9QSV57gEq3JFFpGJ4GZ+5zdEp3FcUh4w==} + engines: {node: '>= 0.6.0'} + dev: true + /gauge@2.7.4: resolution: {integrity: sha512-14x4kjc6lkD3ltw589k0NrPD6cCNTD6CWoVUNpB85+DrtONoZn+Rug6xZU5RvSC4+TZPxA5AnBibQYAvZn41Hg==} dependencies: @@ -10327,7 +10821,7 @@ packages: fs.realpath: 1.0.0 inflight: 1.0.6 inherits: 2.0.4 - minimatch: 3.0.5 + minimatch: 3.1.2 once: 1.4.0 path-is-absolute: 1.0.1 dev: true @@ -10416,6 +10910,7 @@ packages: /graceful-fs@4.2.10: resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} + dev: true /graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} @@ -10753,6 +11248,11 @@ packages: engines: {node: '>=12.2'} dev: true + /import-lazy@4.0.0: + resolution: {integrity: sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==} + engines: {node: '>=8'} + dev: true + /import-local@3.1.0: resolution: {integrity: sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==} engines: {node: '>=8'} @@ -10811,6 +11311,20 @@ packages: validate-npm-package-name: 4.0.0 dev: true + /inquirer-autocomplete-prompt@2.0.0(inquirer@8.2.5): + resolution: {integrity: sha512-c2LljLP3ewVJe4AUZzKdA6oWjqhpy5pfsisHAjh7mP3WUQ/O02x5OLMMqcLOYuRHx6i2hlVSIhUv0xYGyFxFYA==} + engines: {node: '>=12'} + peerDependencies: + inquirer: ^8.0.0 + dependencies: + ansi-escapes: 4.3.2 + figures: 3.2.0 + inquirer: 8.2.5 + picocolors: 1.0.0 + run-async: 2.4.1 + rxjs: 7.8.1 + dev: true + /inquirer@7.3.3: resolution: {integrity: sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==} engines: {node: '>=8.0.0'} @@ -11073,6 +11587,11 @@ packages: dependencies: is-extglob: 2.1.1 + /is-hex-prefixed@1.0.0: + resolution: {integrity: sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA==} + engines: {node: '>=6.5.0', npm: '>=3'} + dev: true + /is-interactive@1.0.0: resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} engines: {node: '>=8'} @@ -11358,7 +11877,7 @@ packages: async: 3.2.4 chalk: 4.1.2 filelist: 1.0.4 - minimatch: 3.0.5 + minimatch: 3.1.2 dev: true /java-properties@1.0.2: @@ -11900,6 +12419,10 @@ packages: /jimp-compact@0.16.1: resolution: {integrity: sha512-dZ6Ra7u1G8c4Letq/B5EzAxj4tLFHL+cGtdpR+PVm4yzPDj+lCk+AbivWt1eOM+ikzkowtyV7qSqX6qr3t71Ww==} + /jju@1.4.0: + resolution: {integrity: sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==} + dev: true + /joi@17.9.2: resolution: {integrity: sha512-Itk/r+V4Dx0V3c7RLFdRh12IOjySm2/WGPMubBT92cQvRfYZhPM2W0hZlctjj72iES8jsRCwp7S/cRmWBnJ4nw==} dependencies: @@ -12066,9 +12589,18 @@ packages: engines: {node: '>=4'} hasBin: true + /json-bigint@1.0.0: + resolution: {integrity: sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==} + dependencies: + bignumber.js: 9.1.1 + dev: true + /json-buffer@3.0.1: resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} - dev: false + + /json-canonicalize@1.0.6: + resolution: {integrity: sha512-kP2iYpOS5SZHYhIaR1t9oG80d4uTY3jPoaBj+nimy3njtJk8+sRsVatN8pyJRDRtk9Su3+6XqA2U8k0dByJBUQ==} + dev: true /json-parse-better-errors@1.0.2: resolution: {integrity: sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==} @@ -12163,7 +12695,7 @@ packages: dependencies: universalify: 2.0.0 optionalDependencies: - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 /jsonld-checker@0.1.8: resolution: {integrity: sha512-jclmnPRrm5SEpaIV6IiSTJxplRAqIWHduQLsUfrYpZM41Ng48m1RN2/aUyHze/ynfO0D2UhlJBt8SdObsH5GBw==} @@ -12213,7 +12745,6 @@ packages: /jsonpointer@5.0.1: resolution: {integrity: sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==} engines: {node: '>=0.10.0'} - dev: false /jsonwebtoken@9.0.0: resolution: {integrity: sha512-tuGfYXxkQGDPnLJ7SibiQgVgeDgfbPq2k2ICcbgqW8WxWLBAxKQM/ZCu/IT8SOSwmaYl4dpTFCW5xZv7YbbWUw==} @@ -12269,6 +12800,12 @@ packages: readable-stream: 3.6.2 dev: true + /keyv@4.5.2: + resolution: {integrity: sha512-5MHbFaKn8cNSmVW7BYnijeAVlE4cYA/SVkifVgrh7yotnfhKmjuXpDKjrABLnT0SfHWV21P8ow07OGfRrNDg8g==} + dependencies: + json-buffer: 3.0.1 + dev: true + /kind-of@3.2.2: resolution: {integrity: sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==} engines: {node: '>=0.10.0'} @@ -12499,7 +13036,7 @@ packages: resolution: {integrity: sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==} engines: {node: '>=4'} dependencies: - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 parse-json: 4.0.0 pify: 3.0.0 strip-bom: 3.0.0 @@ -12509,7 +13046,7 @@ packages: resolution: {integrity: sha512-gUD/epcRms75Cw8RT1pUdHugZYM5ce64ucs2GEISABwkRsOQr0q2wm/MV2TKThycIe5e0ytRweW2RZxclogCdQ==} engines: {node: '>=8'} dependencies: - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 parse-json: 5.2.0 strip-bom: 4.0.0 type-fest: 0.6.0 @@ -12889,7 +13426,7 @@ packages: redent: 3.0.0 trim-newlines: 3.0.1 type-fest: 0.18.1 - yargs-parser: 20.2.4 + yargs-parser: 20.2.9 dev: true /merge-descriptors@1.0.1: @@ -13186,6 +13723,10 @@ packages: - supports-color - utf-8-validate + /micro-ftch@0.3.1: + resolution: {integrity: sha512-/0LLxhzP0tfiR5hcQebtudP56gUurs2CLkGarnCiB/OqEyUFQ6U3paQi/tgLv0hBJYt2rnr9MNpxz4fiiugstg==} + dev: true + /micromatch@3.1.10: resolution: {integrity: sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==} engines: {node: '>=0.10.0'} @@ -13533,7 +14074,7 @@ packages: array-differ: 3.0.0 array-union: 2.1.0 arrify: 2.0.1 - minimatch: 3.0.5 + minimatch: 3.1.2 dev: true /mute-stream@0.0.8: @@ -13790,13 +14331,13 @@ packages: dependencies: env-paths: 2.2.1 glob: 7.2.3 - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 make-fetch-happen: 10.2.1 nopt: 6.0.0 npmlog: 6.0.2 rimraf: 3.0.2 semver: 7.5.0 - tar: 6.1.11 + tar: 6.1.14 which: 2.0.2 transitivePeerDependencies: - bluebird @@ -14632,6 +15173,9 @@ packages: p-reduce: 2.1.0 dev: true + /packet-reader@1.0.0: + resolution: {integrity: sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==} + /pacote@13.6.2: resolution: {integrity: sha512-Gu8fU3GsvOPkak2CkbojR7vjs3k3P9cA6uazKTHdsdV0gpCEQq2opelnEv30KRQWgVzP5Vd/5umjcedma3MKtg==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} @@ -14657,7 +15201,7 @@ packages: read-package-json-fast: 2.0.3 rimraf: 3.0.2 ssri: 9.0.1 - tar: 6.1.11 + tar: 6.1.14 transitivePeerDependencies: - bluebird - supports-color @@ -14685,7 +15229,7 @@ packages: read-package-json-fast: 3.0.2 sigstore: 1.4.0 ssri: 10.0.4 - tar: 6.1.11 + tar: 6.1.14 transitivePeerDependencies: - bluebird - supports-color @@ -14693,7 +15237,6 @@ packages: /pako@2.1.0: resolution: {integrity: sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==} - dev: false /parent-module@1.0.1: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} @@ -14876,6 +15419,62 @@ packages: /pause@0.0.1: resolution: {integrity: sha512-KG8UEiEVkR3wGEb4m5yZkVCzigAD+cVEJck2CzYZO37ZGJfctvVptVO192MwrtPhzONn6go8ylnOdMhKqi4nfg==} + /pg-cloudflare@1.1.0: + resolution: {integrity: sha512-tGM8/s6frwuAIyRcJ6nWcIvd3+3NmUKIs6OjviIm1HPPFEt5MzQDOTBQyhPWg/m0kCl95M6gA1JaIXtS8KovOA==} + requiresBuild: true + optional: true + + /pg-connection-string@2.6.0: + resolution: {integrity: sha512-x14ibktcwlHKoHxx9X3uTVW9zIGR41ZB6QNhHb21OPNdCCO3NaRnpJuwKIQSR4u+Yqjx4HCvy7Hh7VSy1U4dGg==} + + /pg-int8@1.0.1: + resolution: {integrity: sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==} + engines: {node: '>=4.0.0'} + + /pg-pool@3.6.0(pg@8.11.0): + resolution: {integrity: sha512-clFRf2ksqd+F497kWFyM21tMjeikn60oGDmqMT8UBrynEwVEX/5R5xd2sdvdo1cZCFlguORNpVuqxIj+aK4cfQ==} + peerDependencies: + pg: '>=8.0' + dependencies: + pg: 8.11.0 + + /pg-protocol@1.6.0: + resolution: {integrity: sha512-M+PDm637OY5WM307051+bsDia5Xej6d9IR4GwJse1qA1DIhiKlksvrneZOYQq42OM+spubpcNYEo2FcKQrDk+Q==} + + /pg-types@2.2.0: + resolution: {integrity: sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==} + engines: {node: '>=4'} + dependencies: + pg-int8: 1.0.1 + postgres-array: 2.0.0 + postgres-bytea: 1.0.0 + postgres-date: 1.0.7 + postgres-interval: 1.2.0 + + /pg@8.11.0: + resolution: {integrity: sha512-meLUVPn2TWgJyLmy7el3fQQVwft4gU5NGyvV0XbD41iU9Jbg8lCH4zexhIkihDzVHJStlt6r088G6/fWeNjhXA==} + engines: {node: '>= 8.0.0'} + peerDependencies: + pg-native: '>=3.0.1' + peerDependenciesMeta: + pg-native: + optional: true + dependencies: + buffer-writer: 2.0.0 + packet-reader: 1.0.0 + pg-connection-string: 2.6.0 + pg-pool: 3.6.0(pg@8.11.0) + pg-protocol: 1.6.0 + pg-types: 2.2.0 + pgpass: 1.0.5 + optionalDependencies: + pg-cloudflare: 1.1.0 + + /pgpass@1.0.5: + resolution: {integrity: sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==} + dependencies: + split2: 4.2.0 + /picocolors@1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} @@ -14956,6 +15555,24 @@ packages: util-deprecate: 1.0.2 dev: true + /postgres-array@2.0.0: + resolution: {integrity: sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==} + engines: {node: '>=4'} + + /postgres-bytea@1.0.0: + resolution: {integrity: sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==} + engines: {node: '>=0.10.0'} + + /postgres-date@1.0.7: + resolution: {integrity: sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==} + engines: {node: '>=0.10.0'} + + /postgres-interval@1.2.0: + resolution: {integrity: sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==} + engines: {node: '>=0.10.0'} + dependencies: + xtend: 4.0.2 + /prelude-ls@1.1.2: resolution: {integrity: sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==} engines: {node: '>= 0.8.0'} @@ -15169,6 +15786,11 @@ packages: resolution: {integrity: sha512-Uu7ii+FQy4Qf82G4xu7ShHhjhGahEpCWc3x8UavY3CTcWV+ufmmCtwkr7ZKsX42jdL0kr1B5FKUeqJvAn51jzQ==} hasBin: true + /qrcode-terminal@0.12.0: + resolution: {integrity: sha512-EXtzRZmC+YGmGlDFbXKxQiMZNwCLEO6BANKXG4iCtSIM0yqc/pappSx3RIKr4r0uh5JsBckOXeKrB3Iz7mdQpQ==} + hasBin: true + dev: true + /qs@6.11.0: resolution: {integrity: sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==} engines: {node: '>=0.6'} @@ -15682,6 +16304,13 @@ packages: engines: {node: '>=10'} dev: true + /resolve@1.19.0: + resolution: {integrity: sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==} + dependencies: + is-core-module: 2.12.0 + path-parse: 1.0.7 + dev: true + /resolve@1.22.2: resolution: {integrity: sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==} hasBin: true @@ -15825,6 +16454,11 @@ packages: dependencies: ret: 0.1.15 + /safe-stable-stringify@2.4.3: + resolution: {integrity: sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==} + engines: {node: '>=10'} + dev: true + /safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} @@ -16138,6 +16772,10 @@ packages: bplist-parser: 0.3.1 plist: 3.0.6 + /simple-wcswidth@1.0.1: + resolution: {integrity: sha512-xMO/8eNREtaROt7tJvWJqHBDTMFN4eiQ5I4JRMuilwfnFcV5W9u7RUkueNkdw0jPqGMX36iCywelS5yilTuOxg==} + dev: true + /sisteransi@1.0.5: resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} @@ -16318,6 +16956,10 @@ packages: readable-stream: 3.6.2 dev: true + /split2@4.2.0: + resolution: {integrity: sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==} + engines: {node: '>= 10.x'} + /split@1.0.1: resolution: {integrity: sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==} dependencies: @@ -16425,6 +17067,11 @@ packages: stubs: 3.0.0 dev: true + /string-argv@0.3.2: + resolution: {integrity: sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==} + engines: {node: '>=0.6.19'} + dev: true + /string-length@4.0.2: resolution: {integrity: sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==} engines: {node: '>=10'} @@ -16552,6 +17199,13 @@ packages: engines: {node: '>=6'} dev: true + /strip-hex-prefix@1.0.0: + resolution: {integrity: sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A==} + engines: {node: '>=6.5.0', npm: '>=3'} + dependencies: + is-hex-prefixed: 1.0.0 + dev: true + /strip-indent@2.0.0: resolution: {integrity: sha512-RsSNPLpq6YUL7QYy44RnPVTn/lcVZtb48Uof3X5JLbF4zD/Gs7ZFDv2HWol+leoQN2mT86LAzSshGfkTlSOpsA==} engines: {node: '>=4'} @@ -16644,6 +17298,20 @@ packages: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} + /swagger-ui-dist@4.18.3: + resolution: {integrity: sha512-QW280Uvt234+TLo9NMPRa2Sj17RoorbQlR2eEY4R6Cs0LbdXhiO14YWX9OPBkBdiN64GQYz4zU8wlHLVi81lBg==} + dev: true + + /swagger-ui-express@4.6.3(express@4.18.2): + resolution: {integrity: sha512-CDje4PndhTD2HkgyKH3pab+LKspDeB/NhPN2OF1j+piYIamQqBYwAXWESOT1Yju2xFg51bRW9sUng2WxDjzArw==} + engines: {node: '>= v0.10.32'} + peerDependencies: + express: '>=4.0.0 || >=5.0.0-beta' + dependencies: + express: 4.18.2 + swagger-ui-dist: 4.18.3 + dev: true + /symbol-tree@3.2.4: resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} dev: true @@ -16863,6 +17531,10 @@ packages: /through@2.3.8: resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} + /timekeeper@2.2.0: + resolution: {integrity: sha512-W3AmPTJWZkRwu+iSNxPIsLZ2ByADsOLbbLxe46UJyWj3mlYLlwucKiq+/dPm0l9wTzqoF3/2PH0AGFCebjq23A==} + dev: true + /tmp@0.0.33: resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} engines: {node: '>=0.6.0'} @@ -17013,6 +17685,20 @@ packages: yargs-parser: 20.2.9 dev: true + /ts-json-schema-generator@1.2.0: + resolution: {integrity: sha512-tUMeO3ZvA12d3HHh7T/AK8W5hmUhDRNtqWRHSMN3ZRbUFt+UmV0oX8k1RK4SA+a+BKNHpmW2v06MS49e8Fi3Yg==} + engines: {node: '>=10.0.0'} + hasBin: true + dependencies: + '@types/json-schema': 7.0.11 + commander: 9.5.0 + glob: 8.1.0 + json5: 2.2.3 + normalize-path: 3.0.0 + safe-stable-stringify: 2.4.3 + typescript: 4.9.5 + dev: true + /ts-node@10.9.1(@types/node@18.15.3)(typescript@4.9.5): resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true @@ -17126,6 +17812,10 @@ packages: - supports-color dev: true + /tweetnacl-util@0.15.1: + resolution: {integrity: sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==} + dev: true + /tweetnacl@1.0.3: resolution: {integrity: sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==} dev: true @@ -17224,7 +17914,7 @@ packages: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} dev: true - /typeorm@0.3.12(sqlite3@5.1.6)(ts-node@10.9.1): + /typeorm@0.3.12(pg@8.11.0)(sqlite3@5.1.6)(ts-node@10.9.1): resolution: {integrity: sha512-sYSxBmCf1nJLLTcYtwqZ+lQIRtLPyUoO93rHTOKk9vJCyT4UfRtU7oRsJvfvKP3nnZTD1hzz2SEy2zwPEN6OyA==} engines: {node: '>= 12.9.0'} hasBin: true @@ -17293,6 +17983,7 @@ packages: glob: 8.1.0 js-yaml: 4.1.0 mkdirp: 2.1.6 + pg: 8.11.0 reflect-metadata: 0.1.13 sha.js: 2.4.11 sqlite3: 5.1.6 @@ -17304,6 +17995,12 @@ packages: transitivePeerDependencies: - supports-color + /typescript@4.8.4: + resolution: {integrity: sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==} + engines: {node: '>=4.2.0'} + hasBin: true + dev: true + /typescript@4.9.5: resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==} engines: {node: '>=4.2.0'} @@ -17877,7 +18574,7 @@ packages: /write-file-atomic@2.4.3: resolution: {integrity: sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==} dependencies: - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 imurmurhash: 0.1.4 signal-exit: 3.0.7 @@ -17911,7 +18608,7 @@ packages: engines: {node: '>=6'} dependencies: detect-indent: 5.0.0 - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 make-dir: 2.1.0 pify: 4.0.1 sort-keys: 2.0.0 @@ -18041,7 +18738,6 @@ packages: /yaml@2.2.2: resolution: {integrity: sha512-CBKFWExMn46Foo4cldiChEzn7S7SRV+wqiluAb6xmueD/fGyRHIhX8m14vVGgeFWjN540nKCNVj6P21eQjgTuA==} engines: {node: '>= 14'} - dev: false /yargs-parser@10.1.0: resolution: {integrity: sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==} @@ -18059,11 +18755,11 @@ packages: /yargs-parser@20.2.4: resolution: {integrity: sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==} engines: {node: '>=10'} + dev: true /yargs-parser@20.2.9: resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} engines: {node: '>=10'} - dev: true /yargs-parser@21.1.1: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} @@ -18095,7 +18791,7 @@ packages: require-directory: 2.1.1 string-width: 4.2.3 y18n: 5.0.8 - yargs-parser: 20.2.4 + yargs-parser: 20.2.9 /yargs@17.7.2: resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} @@ -18128,108 +18824,6 @@ packages: optionalDependencies: commander: 9.5.0 - file:packages/presentation-exchange/.yalc/@veramo/kv-store(ts-node@10.9.1): - resolution: {directory: packages/presentation-exchange/.yalc/@veramo/kv-store, type: directory} - id: file:packages/presentation-exchange/.yalc/@veramo/kv-store - name: '@veramo/kv-store' - version: 4.3.0 - dependencies: - '@veramo/utils': 4.2.0 - debug: 4.3.4 - events: 3.3.0 - json-buffer: 3.0.1 - typeorm: 0.3.12(sqlite3@5.1.6)(ts-node@10.9.1) - uint8arrays: 3.1.1 - transitivePeerDependencies: - - '@google-cloud/spanner' - - '@sap/hana-client' - - better-sqlite3 - - encoding - - hdb-pool - - ioredis - - mongodb - - mssql - - mysql2 - - oracledb - - pg - - pg-native - - pg-query-stream - - redis - - sql.js - - sqlite3 - - supports-color - - ts-node - - typeorm-aurora-data-api-driver - dev: false - - file:packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store(ts-node@10.9.1): - resolution: {directory: packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store, type: directory} - id: file:packages/siopv2-oid4vp-rp-auth/.yalc/@veramo/kv-store - name: '@veramo/kv-store' - version: 4.3.0 - dependencies: - '@veramo/utils': 4.2.0 - debug: 4.3.4 - events: 3.3.0 - json-buffer: 3.0.1 - typeorm: 0.3.12(sqlite3@5.1.6)(ts-node@10.9.1) - uint8arrays: 3.1.1 - transitivePeerDependencies: - - '@google-cloud/spanner' - - '@sap/hana-client' - - better-sqlite3 - - encoding - - hdb-pool - - ioredis - - mongodb - - mssql - - mysql2 - - oracledb - - pg - - pg-native - - pg-query-stream - - redis - - sql.js - - sqlite3 - - supports-color - - ts-node - - typeorm-aurora-data-api-driver - dev: false - - file:packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store(ts-node@10.9.1): - resolution: {directory: packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store, type: directory} - id: file:packages/siopv2-oid4vp-rp-rest-api/.yalc/@veramo/kv-store - name: '@veramo/kv-store' - version: 4.3.0 - dependencies: - '@veramo/utils': 4.2.0 - debug: 4.3.4 - events: 3.3.0 - json-buffer: 3.0.1 - typeorm: 0.3.12(sqlite3@5.1.6)(ts-node@10.9.1) - uint8arrays: 3.1.1 - transitivePeerDependencies: - - '@google-cloud/spanner' - - '@sap/hana-client' - - better-sqlite3 - - encoding - - hdb-pool - - ioredis - - mongodb - - mssql - - mysql2 - - oracledb - - pg - - pg-native - - pg-query-stream - - redis - - sql.js - - sqlite3 - - supports-color - - ts-node - - typeorm-aurora-data-api-driver - dev: false - github.com/uport-project/EcdsaSecp256k1RecoverySignature2020/ab0db52de6f4e6663ef271a48009ba26e688ef9b: resolution: {tarball: https://codeload.github.com/uport-project/EcdsaSecp256k1RecoverySignature2020/tar.gz/ab0db52de6f4e6663ef271a48009ba26e688ef9b} name: '@veramo-community/lds-ecdsa-secp256k1-recovery2020'