From 3060742652aae062fd2daafa2216680e7bd4e203 Mon Sep 17 00:00:00 2001 From: Niels Klomp Date: Sun, 27 Oct 2024 14:55:41 -0700 Subject: [PATCH] chore: try to fix metadata issue popping up all of a sudden --- packages/wellknown-did-issuer/__tests__/localAgent.test.ts | 2 +- packages/wellknown-did-issuer/__tests__/restAgent.test.ts | 2 +- packages/wellknown-did-issuer/agent.yml | 6 +++--- packages/wellknown-did-issuer/package.json | 1 + .../src/entities/DidConfigurationResourceEntity.ts | 2 +- packages/wellknown-did-issuer/src/index.ts | 1 + .../postgres/1661165115000-CreateWellknownDidIssuer.ts | 2 +- .../sqlite/1661161799000-CreateWellknownDidIssuer.ts | 2 +- packages/wellknown-did-issuer/tsconfig.json | 1 + pnpm-lock.yaml | 4 ++++ 10 files changed, 15 insertions(+), 8 deletions(-) diff --git a/packages/wellknown-did-issuer/__tests__/localAgent.test.ts b/packages/wellknown-did-issuer/__tests__/localAgent.test.ts index 3d426441d..bc92728c5 100644 --- a/packages/wellknown-did-issuer/__tests__/localAgent.test.ts +++ b/packages/wellknown-did-issuer/__tests__/localAgent.test.ts @@ -2,7 +2,7 @@ import { createObjects, getConfig } from '@sphereon/ssi-sdk.agent-config' import { DataSource } from 'typeorm' import wellKnownDidIssuerAgentLogic from './shared/wellKnownDidIssuerAgentLogic' -jest.setTimeout(60000) +jest.setTimeout(30000) let agent: any let dbConnection: Promise diff --git a/packages/wellknown-did-issuer/__tests__/restAgent.test.ts b/packages/wellknown-did-issuer/__tests__/restAgent.test.ts index c7cab8c9d..5cf5ff8db 100644 --- a/packages/wellknown-did-issuer/__tests__/restAgent.test.ts +++ b/packages/wellknown-did-issuer/__tests__/restAgent.test.ts @@ -13,7 +13,7 @@ import wellKnownDidIssuerAgentLogic from './shared/wellKnownDidIssuerAgentLogic' jest.setTimeout(60000) -const port = 3002 +const port = 3435 const basePath = '/agent' let serverAgent: IAgent diff --git a/packages/wellknown-did-issuer/agent.yml b/packages/wellknown-did-issuer/agent.yml index 9e560f3a1..6082bbce4 100644 --- a/packages/wellknown-did-issuer/agent.yml +++ b/packages/wellknown-did-issuer/agent.yml @@ -1,8 +1,8 @@ version: 3.0 constants: - baseUrl: http://localhost:3335 - port: 3335 + baseUrl: http://localhost:3435 + port: 3435 methods: - addLinkedDomainsService - getDidConfigurationResource @@ -41,8 +41,8 @@ dbConnection: $args: - items: - $require: '@veramo/data-store?t=object#Entities' - - $require: './packages/wellknown-did-issuer/dist?t=object#WellknownDidIssuerEntities' - $require: './packages/data-store?t=object#DataStoreDigitalCredentialEntities' + - $require: './packages/wellknown-did-issuer/dist?t=object#WellknownDidIssuerEntities' server: baseUrl: diff --git a/packages/wellknown-did-issuer/package.json b/packages/wellknown-did-issuer/package.json index 13b0fca6d..280d2a9a1 100644 --- a/packages/wellknown-did-issuer/package.json +++ b/packages/wellknown-did-issuer/package.json @@ -22,6 +22,7 @@ "@veramo/utils": "4.2.0", "debug": "^4.3.5", "did-jwt-vc": "3.1.3", + "class-validator": "^0.14.1", "typeorm": "^0.3.20", "uuid": "^9.0.1" }, diff --git a/packages/wellknown-did-issuer/src/entities/DidConfigurationResourceEntity.ts b/packages/wellknown-did-issuer/src/entities/DidConfigurationResourceEntity.ts index dc5adc251..ceeec9865 100644 --- a/packages/wellknown-did-issuer/src/entities/DidConfigurationResourceEntity.ts +++ b/packages/wellknown-did-issuer/src/entities/DidConfigurationResourceEntity.ts @@ -4,7 +4,7 @@ import { Credential, Identifier, Claim } from '@veramo/data-store' import { asArray, computeEntryHash, extractIssuer } from '@veramo/utils' import { Entity, Column, PrimaryColumn, CreateDateColumn, UpdateDateColumn, ManyToMany, JoinTable, BaseEntity } from 'typeorm' -@Entity('DidConfigurationResource') +@Entity('DidConfigurationResourceEntity', {name: 'DidConfigurationResource'}) export class DidConfigurationResourceEntity extends BaseEntity { @PrimaryColumn({ nullable: false }) origin!: string diff --git a/packages/wellknown-did-issuer/src/index.ts b/packages/wellknown-did-issuer/src/index.ts index 74fb37bca..551a0fe90 100644 --- a/packages/wellknown-did-issuer/src/index.ts +++ b/packages/wellknown-did-issuer/src/index.ts @@ -5,6 +5,7 @@ import { DidConfigurationResourceEntity } from './entities/DidConfigurationResou */ const schema = require('../plugin.schema.json') export { schema } +export { DidConfigurationResourceEntity } from './entities/DidConfigurationResourceEntity' export { WellKnownDidIssuer } from './agent/WellKnownDidIssuer' export * from './types/IWellKnownDidIssuer' export const WellknownDidIssuerEntities = [DidConfigurationResourceEntity] diff --git a/packages/wellknown-did-issuer/src/migrations/postgres/1661165115000-CreateWellknownDidIssuer.ts b/packages/wellknown-did-issuer/src/migrations/postgres/1661165115000-CreateWellknownDidIssuer.ts index 0663a09ba..508b22e6c 100644 --- a/packages/wellknown-did-issuer/src/migrations/postgres/1661165115000-CreateWellknownDidIssuer.ts +++ b/packages/wellknown-did-issuer/src/migrations/postgres/1661165115000-CreateWellknownDidIssuer.ts @@ -8,7 +8,7 @@ export class CreateWellknownDidIssuer1661165115000 implements MigrationInterface `CREATE TABLE "DidConfigurationResource" ("origin" varchar NOT NULL, "context" varchar NOT NULL, "created_at" TIMESTAMP NOT NULL DEFAULT now(), "last_updated_at" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "PK_Origin" PRIMARY KEY ("origin"))`, ) await queryRunner.query( - `CREATE TABLE "DidConfigurationResourceCredentials" ("didConfigurationResourceOrigin" varchar NOT NULL, "credentialHash" varchar NOT NULL)`, + `CREATE TABLE "DidConfigurationResourceCredentials" ("origin" varchar NOT NULL, "credentialHash" varchar NOT NULL)`, ) } diff --git a/packages/wellknown-did-issuer/src/migrations/sqlite/1661161799000-CreateWellknownDidIssuer.ts b/packages/wellknown-did-issuer/src/migrations/sqlite/1661161799000-CreateWellknownDidIssuer.ts index 534fb37cb..b5c2b8102 100644 --- a/packages/wellknown-did-issuer/src/migrations/sqlite/1661161799000-CreateWellknownDidIssuer.ts +++ b/packages/wellknown-did-issuer/src/migrations/sqlite/1661161799000-CreateWellknownDidIssuer.ts @@ -8,7 +8,7 @@ export class CreateWellknownDidIssuer1661161799000 implements MigrationInterface `CREATE TABLE "DidConfigurationResource" ("origin" varchar PRIMARY KEY NOT NULL, "context" varchar NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')))`, ) await queryRunner.query( - `CREATE TABLE "DidConfigurationResourceCredentials" ("didConfigurationResourceOrigin" varchar NOT NULL, "credentialHash" varchar NOT NULL)`, + `CREATE TABLE "DidConfigurationResourceCredentials" ("origin" varchar NOT NULL, "credentialHash" varchar NOT NULL)`, ) } diff --git a/packages/wellknown-did-issuer/tsconfig.json b/packages/wellknown-did-issuer/tsconfig.json index 85611d9e4..6640be860 100644 --- a/packages/wellknown-did-issuer/tsconfig.json +++ b/packages/wellknown-did-issuer/tsconfig.json @@ -3,6 +3,7 @@ "compilerOptions": { "rootDir": "src", "outDir": "dist", + "emitDecoratorMetadata": true, "esModuleInterop": true, "declarationDir": "dist", "experimentalDecorators": true, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bf4ea314c..c0447584a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3721,6 +3721,9 @@ importers: '@veramo/utils': specifier: 4.2.0 version: 4.2.0(encoding@0.1.13) + class-validator: + specifier: ^0.14.1 + version: 0.14.1 debug: specifier: ^4.3.5 version: 4.3.7 @@ -5794,6 +5797,7 @@ packages: '@sphereon/kmp-mdl-mdoc@0.2.0-SNAPSHOT.22': resolution: {integrity: sha512-uAZZExVy+ug9JLircejWa5eLtAZ7bnBP6xb7DO2+86LRsHNLh2k2jMWJYxp+iWtGHTsh6RYsZl14ScQLvjiQ/A==} + bundledDependencies: [] '@sphereon/lto-did-ts@0.1.8-unstable.0': resolution: {integrity: sha512-3jzwwuYX/VYuze+T9/yg4PcsJ5iNNwAfTp4WfS4aSfPFBErDAfKXqn6kOb0wFYGkhejr3Jz+rljPC2iKZiHiGA==}