From db85e8e6690c61240ff2eecd2f75a211b51b2b82 Mon Sep 17 00:00:00 2001 From: mkuhn Date: Thu, 4 Dec 2025 14:48:42 +0100 Subject: [PATCH 01/18] feat: add default presentations --- .../modules/openid4vc/OpenId4VcController.ts | 4 ++ .../src/modules/openid4vc/local/Holder.ts | 14 +++++++ .../attributes/types/VerifiableCredential.ts | 7 ++++ .../facades/consumption/OpenId4VcFacade.ts | 12 +++++- .../openid4vc/CreateDefaultPresentation.ts | 38 +++++++++++++++++++ .../useCases/consumption/openid4vc/index.ts | 1 + .../test/consumption/openid4vc.test.ts | 17 ++++++++- 7 files changed, 91 insertions(+), 2 deletions(-) create mode 100644 packages/runtime/src/useCases/consumption/openid4vc/CreateDefaultPresentation.ts diff --git a/packages/consumption/src/modules/openid4vc/OpenId4VcController.ts b/packages/consumption/src/modules/openid4vc/OpenId4VcController.ts index ce572bdee..c4695fdcc 100644 --- a/packages/consumption/src/modules/openid4vc/OpenId4VcController.ts +++ b/packages/consumption/src/modules/openid4vc/OpenId4VcController.ts @@ -105,4 +105,8 @@ export class OpenId4VcController extends ConsumptionBaseController { return { status: serverResponse.status, message: serverResponse.body }; } + + public async createDefaultPresentation(credential: VerifiableCredential): Promise { + return await this.holder.createDefaultPresentation(credential); + } } diff --git a/packages/consumption/src/modules/openid4vc/local/Holder.ts b/packages/consumption/src/modules/openid4vc/local/Holder.ts index 52c22f367..1d043ac55 100644 --- a/packages/consumption/src/modules/openid4vc/local/Holder.ts +++ b/packages/consumption/src/modules/openid4vc/local/Holder.ts @@ -8,11 +8,13 @@ import { KeyDidCreateOptions, Kms, MdocRecord, + SdJwtVcApi, SdJwtVcRecord, W3cJsonCredential, X509Module } from "@credo-ts/core"; import { OpenId4VciCredentialResponse, OpenId4VcModule, type OpenId4VciResolvedCredentialOffer, type OpenId4VpResolvedAuthorizationRequest } from "@credo-ts/openid4vc"; +import { VerifiableCredential } from "@nmshd/content"; import { AccountController } from "@nmshd/transport"; import { AttributesController, OwnIdentityAttribute } from "../../attributes"; import { BaseAgent } from "./BaseAgent"; @@ -203,6 +205,18 @@ export class Holder extends BaseAgent> return submissionResult.serverResponse; } + public async createDefaultPresentation(credential: VerifiableCredential): Promise { + if (credential.type !== ClaimFormat.SdJwtDc) throw new Error("Creating a default presentation is only supported for dc+sd-jwt credentials."); + + const sdJwtVcApi = this.agent.dependencyManager.resolve(SdJwtVcApi); + const presentation = await sdJwtVcApi.present({ + sdJwtVc: sdJwtVcApi.fromCompact(credential.value as string), + presentationFrame: credential.defaultDisclosures + }); + + return presentation; + } + public async exit(): Promise { await this.shutdown(); } diff --git a/packages/content/src/attributes/types/VerifiableCredential.ts b/packages/content/src/attributes/types/VerifiableCredential.ts index 290d23908..a5312365c 100644 --- a/packages/content/src/attributes/types/VerifiableCredential.ts +++ b/packages/content/src/attributes/types/VerifiableCredential.ts @@ -1,3 +1,4 @@ +import { IPresentationFrame } from "@credo-ts/core"; import { serialize, type, validate } from "@js-soft/ts-serval"; import { AbstractAttributeValue, AbstractAttributeValueJSON, IAbstractAttributeValue } from "../AbstractAttributeValue"; import { RenderHints, RenderHintsEditType, RenderHintsTechnicalType, ValueHints } from "../hints"; @@ -9,6 +10,7 @@ export interface VerifiableCredentialJSON extends AbstractAttributeValueJSON { type: string; displayInformation?: Record[]; key?: string; + defaultDisclosures?: IPresentationFrame; } export interface IVerifiableCredential extends IAbstractAttributeValue { @@ -16,6 +18,7 @@ export interface IVerifiableCredential extends IAbstractAttributeValue { type: string; displayInformation?: Record[]; key?: string; + defaultDisclosures?: IPresentationFrame; } @type("VerifiableCredential") @@ -36,6 +39,10 @@ export class VerifiableCredential extends AbstractAttributeValue { @validate({ nullable: true, max: PROPRIETARY_ATTRIBUTE_MAX_DESCRIPTION_LENGTH }) public key?: string; + @serialize({ any: true }) + @validate({ nullable: true }) + public defaultDisclosures?: IPresentationFrame; + public static get valueHints(): ValueHints { return ValueHints.from({}); } diff --git a/packages/runtime/src/extensibility/facades/consumption/OpenId4VcFacade.ts b/packages/runtime/src/extensibility/facades/consumption/OpenId4VcFacade.ts index 17ff55885..85df3715c 100644 --- a/packages/runtime/src/extensibility/facades/consumption/OpenId4VcFacade.ts +++ b/packages/runtime/src/extensibility/facades/consumption/OpenId4VcFacade.ts @@ -17,6 +17,11 @@ import { StoreCredentialsRequest, StoreCredentialsUseCase } from "../../../useCases"; +import { + CreateDefaultPresentationRequest, + CreateDefaultPresentationResponse, + CreateDefaultPresentationUseCase +} from "../../../useCases/consumption/openid4vc/CreateDefaultPresentation"; export class OpenId4VcFacade { public constructor( @@ -24,7 +29,8 @@ export class OpenId4VcFacade { @Inject private readonly requestCredentialsUseCase: RequestCredentialsUseCase, @Inject private readonly storeCredentialsUseCase: StoreCredentialsUseCase, @Inject private readonly resolveAuthorizationRequestUseCase: ResolveAuthorizationRequestUseCase, - @Inject private readonly acceptAuthorizationRequestUseCase: AcceptAuthorizationRequestUseCase + @Inject private readonly acceptAuthorizationRequestUseCase: AcceptAuthorizationRequestUseCase, + @Inject private readonly createDefaultPresentationUseCase: CreateDefaultPresentationUseCase ) {} public async resolveCredentialOffer(request: ResolveCredentialOfferRequest): Promise> { @@ -46,4 +52,8 @@ export class OpenId4VcFacade { public async acceptAuthorizationRequest(request: AcceptAuthorizationRequestRequest): Promise> { return await this.acceptAuthorizationRequestUseCase.execute(request); } + + public async createDefaultPresentation(request: CreateDefaultPresentationRequest): Promise> { + return await this.createDefaultPresentationUseCase.execute(request); + } } diff --git a/packages/runtime/src/useCases/consumption/openid4vc/CreateDefaultPresentation.ts b/packages/runtime/src/useCases/consumption/openid4vc/CreateDefaultPresentation.ts new file mode 100644 index 000000000..7bffc8695 --- /dev/null +++ b/packages/runtime/src/useCases/consumption/openid4vc/CreateDefaultPresentation.ts @@ -0,0 +1,38 @@ +import { Result } from "@js-soft/ts-utils"; +import { AttributesController, OpenId4VcController } from "@nmshd/consumption"; +import { VerifiableCredential } from "@nmshd/content"; +import { CoreId } from "@nmshd/core-types"; +import { Inject } from "@nmshd/typescript-ioc"; +import { RuntimeErrors, SchemaRepository, SchemaValidator, UseCase } from "../../common"; + +export interface CreateDefaultPresentationRequest { + attributeId: string; +} + +export interface CreateDefaultPresentationResponse { + presentation: string; +} + +class Validator extends SchemaValidator { + public constructor(@Inject schemaRepository: SchemaRepository) { + super(schemaRepository.getSchema("CreateDefaultPresentationRequest")); + } +} + +export class CreateDefaultPresentationUseCase extends UseCase { + public constructor( + @Inject private readonly openId4VcController: OpenId4VcController, + @Inject private readonly attributesController: AttributesController, + @Inject validator: Validator + ) { + super(validator); + } + + protected override async executeInternal(request: CreateDefaultPresentationRequest): Promise> { + const attribute = await this.attributesController.getLocalAttribute(CoreId.from(request.attributeId)); + if (!(attribute?.content.value instanceof VerifiableCredential)) return Result.fail(RuntimeErrors.general.recordNotFound("Attribute with Verifiable Credential")); + + const result = await this.openId4VcController.createDefaultPresentation(attribute.content.value); + return Result.ok({ presentation: result }); + } +} diff --git a/packages/runtime/src/useCases/consumption/openid4vc/index.ts b/packages/runtime/src/useCases/consumption/openid4vc/index.ts index d035ced3e..cb24a9a78 100644 --- a/packages/runtime/src/useCases/consumption/openid4vc/index.ts +++ b/packages/runtime/src/useCases/consumption/openid4vc/index.ts @@ -1,4 +1,5 @@ export * from "./AcceptAuthorizationRequest"; +export * from "./CreateDefaultPresentation"; export * from "./RequestCredentials"; export * from "./ResolveAuthorizationRequest"; export * from "./ResolveCredentialOffer"; diff --git a/packages/runtime/test/consumption/openid4vc.test.ts b/packages/runtime/test/consumption/openid4vc.test.ts index 3a12108ed..db285caf3 100644 --- a/packages/runtime/test/consumption/openid4vc.test.ts +++ b/packages/runtime/test/consumption/openid4vc.test.ts @@ -1,4 +1,4 @@ -import { VerifiableCredential } from "@nmshd/content"; +import { VerifiableCredential, VerifiableCredentialJSON } from "@nmshd/content"; import axios, { AxiosInstance } from "axios"; import path from "path"; import { DockerComposeEnvironment, GenericContainer, StartedDockerComposeEnvironment, StartedTestContainer, Wait } from "testcontainers"; @@ -17,6 +17,7 @@ describe("custom openid4vc service", () => { let axiosInstance: AxiosInstance; let dockerComposeStack: StartedDockerComposeEnvironment | undefined; + let attributeId: string; beforeAll(async () => { const runtimeServices = await runtimeServiceProvider.launch(1); @@ -78,6 +79,8 @@ describe("custom openid4vc service", () => { const credential = storeResult.value.content.value as unknown as VerifiableCredential; expect(credential.displayInformation?.[0].logo).toBeDefined(); expect(credential.displayInformation?.[0].name).toBe("Employee ID Card"); + + attributeId = storeResult.value.id; }); test("should be able to process a given credential presentation", async () => { @@ -169,6 +172,18 @@ describe("custom openid4vc service", () => { return composeStack; } + + test("one disclosure, no key binding", async () => { + const attribute = (await consumptionServices.attributes.getAttribute({ id: attributeId })).value; + const newAttribute = ( + await consumptionServices.attributes.createOwnIdentityAttribute({ + content: { value: { ...attribute.content.value, defaultDisclosures: { lob: true } } as VerifiableCredentialJSON } + }) + ).value; + + const defaultPresentation = await consumptionServices.openId4Vc.createDefaultPresentation({ attributeId: newAttribute.id }); + expect(defaultPresentation).toBeSuccessful(); + }); }); describe("EUDIPLO", () => { From 929df57f329c1e396ca5d7f945fed56f5b04ee48 Mon Sep 17 00:00:00 2001 From: mkuhn Date: Thu, 4 Dec 2025 15:45:47 +0100 Subject: [PATCH 02/18] chore: build schemas --- .../runtime/src/useCases/common/Schemas.ts | 201 ++++++++++++++++++ 1 file changed, 201 insertions(+) diff --git a/packages/runtime/src/useCases/common/Schemas.ts b/packages/runtime/src/useCases/common/Schemas.ts index 70abb6a4e..84a1cf12c 100644 --- a/packages/runtime/src/useCases/common/Schemas.ts +++ b/packages/runtime/src/useCases/common/Schemas.ts @@ -1863,6 +1863,19 @@ export const CanCreateOutgoingRequestRequest: any = { }, "key": { "type": "string" + }, + "defaultDisclosures": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" + } + ] + } } }, "required": [ @@ -1872,6 +1885,19 @@ export const CanCreateOutgoingRequestRequest: any = { ], "additionalProperties": false }, + "interface-1894649334-822-900-1894649334-0-4702": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" + } + ] + } + }, "WebsiteJSON": { "type": "object", "properties": { @@ -3922,6 +3948,19 @@ export const CompleteOutgoingRequestRequest: any = { }, "key": { "type": "string" + }, + "defaultDisclosures": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" + } + ] + } } }, "required": [ @@ -3931,6 +3970,19 @@ export const CompleteOutgoingRequestRequest: any = { ], "additionalProperties": false }, + "interface-1894649334-822-900-1894649334-0-4702": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" + } + ] + } + }, "WebsiteJSON": { "type": "object", "properties": { @@ -5967,6 +6019,19 @@ export const CreateAndCompleteOutgoingRequestFromRelationshipTemplateResponseReq }, "key": { "type": "string" + }, + "defaultDisclosures": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" + } + ] + } } }, "required": [ @@ -5976,6 +6041,19 @@ export const CreateAndCompleteOutgoingRequestFromRelationshipTemplateResponseReq ], "additionalProperties": false }, + "interface-1894649334-822-900-1894649334-0-4702": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" + } + ] + } + }, "WebsiteJSON": { "type": "object", "properties": { @@ -8629,6 +8707,19 @@ export const CreateOutgoingRequestRequest: any = { }, "key": { "type": "string" + }, + "defaultDisclosures": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" + } + ] + } } }, "required": [ @@ -8638,6 +8729,19 @@ export const CreateOutgoingRequestRequest: any = { ], "additionalProperties": false }, + "interface-1894649334-822-900-1894649334-0-4702": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" + } + ] + } + }, "WebsiteJSON": { "type": "object", "properties": { @@ -11694,6 +11798,19 @@ export const ReceivedIncomingRequestRequest: any = { }, "key": { "type": "string" + }, + "defaultDisclosures": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" + } + ] + } } }, "required": [ @@ -11703,6 +11820,19 @@ export const ReceivedIncomingRequestRequest: any = { ], "additionalProperties": false }, + "interface-1894649334-822-900-1894649334-0-4702": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" + } + ] + } + }, "WebsiteJSON": { "type": "object", "properties": { @@ -15754,6 +15884,19 @@ export const SucceedOwnIdentityAttributeRequest: any = { }, "key": { "type": "string" + }, + "defaultDisclosures": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" + } + ] + } } }, "required": [ @@ -15763,6 +15906,19 @@ export const SucceedOwnIdentityAttributeRequest: any = { ], "additionalProperties": false }, + "interface-1894649334-822-900-1894649334-0-4702": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" + } + ] + } + }, "WebsiteJSON": { "type": "object", "properties": { @@ -16958,6 +17114,25 @@ export const AcceptAuthorizationRequestRequest: any = { } } +export const CreateDefaultPresentationRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/CreateDefaultPresentationRequest", + "definitions": { + "CreateDefaultPresentationRequest": { + "type": "object", + "properties": { + "attributeId": { + "type": "string" + } + }, + "required": [ + "attributeId" + ], + "additionalProperties": false + } + } +} + export const RequestCredentialsRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", "$ref": "#/definitions/RequestCredentialsRequest", @@ -21169,6 +21344,19 @@ export const VerifiableCredential: any = { }, "key": { "type": "string" + }, + "defaultDisclosures": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" + } + ] + } } }, "required": [ @@ -21177,6 +21365,19 @@ export const VerifiableCredential: any = { "value" ], "additionalProperties": false + }, + "interface-1894649334-822-900-1894649334-0-4702": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" + } + ] + } } } } \ No newline at end of file From 4f5cbaaef16a3a67b1e33dd0f4bd54c02ad3decc Mon Sep 17 00:00:00 2001 From: mkuhn Date: Fri, 5 Dec 2025 10:34:22 +0100 Subject: [PATCH 03/18] feat: allow key binding --- .../src/modules/openid4vc/local/Holder.ts | 9 +- .../attributes/types/VerifiableCredential.ts | 6 +- .../runtime/src/useCases/common/Schemas.ts | 224 ++++++++++++------ .../test/consumption/openid4vc.test.ts | 30 ++- 4 files changed, 191 insertions(+), 78 deletions(-) diff --git a/packages/consumption/src/modules/openid4vc/local/Holder.ts b/packages/consumption/src/modules/openid4vc/local/Holder.ts index 1d043ac55..e2b1a2ea9 100644 --- a/packages/consumption/src/modules/openid4vc/local/Holder.ts +++ b/packages/consumption/src/modules/openid4vc/local/Holder.ts @@ -211,7 +211,14 @@ export class Holder extends BaseAgent> const sdJwtVcApi = this.agent.dependencyManager.resolve(SdJwtVcApi); const presentation = await sdJwtVcApi.present({ sdJwtVc: sdJwtVcApi.fromCompact(credential.value as string), - presentationFrame: credential.defaultDisclosures + presentationFrame: credential.defaultPresentation?.presentationFrame, + verifierMetadata: credential.defaultPresentation?.keyBinding + ? { + audience: "defaultPresentationAudience", + issuedAt: Date.now() / 1000, + nonce: "defaultPresentationNonce" + } + : undefined }); return presentation; diff --git a/packages/content/src/attributes/types/VerifiableCredential.ts b/packages/content/src/attributes/types/VerifiableCredential.ts index a5312365c..276a33062 100644 --- a/packages/content/src/attributes/types/VerifiableCredential.ts +++ b/packages/content/src/attributes/types/VerifiableCredential.ts @@ -10,7 +10,7 @@ export interface VerifiableCredentialJSON extends AbstractAttributeValueJSON { type: string; displayInformation?: Record[]; key?: string; - defaultDisclosures?: IPresentationFrame; + defaultPresentation?: { presentationFrame: IPresentationFrame; keyBinding?: boolean }; } export interface IVerifiableCredential extends IAbstractAttributeValue { @@ -18,7 +18,7 @@ export interface IVerifiableCredential extends IAbstractAttributeValue { type: string; displayInformation?: Record[]; key?: string; - defaultDisclosures?: IPresentationFrame; + defaultPresentation?: { presentationFrame: IPresentationFrame; keyBinding?: boolean }; } @type("VerifiableCredential") @@ -41,7 +41,7 @@ export class VerifiableCredential extends AbstractAttributeValue { @serialize({ any: true }) @validate({ nullable: true }) - public defaultDisclosures?: IPresentationFrame; + public defaultPresentation?: { presentationFrame: IPresentationFrame; keyBinding?: boolean }; public static get valueHints(): ValueHints { return ValueHints.from({}); diff --git a/packages/runtime/src/useCases/common/Schemas.ts b/packages/runtime/src/useCases/common/Schemas.ts index 84a1cf12c..5aa32b8ad 100644 --- a/packages/runtime/src/useCases/common/Schemas.ts +++ b/packages/runtime/src/useCases/common/Schemas.ts @@ -1864,18 +1864,30 @@ export const CanCreateOutgoingRequestRequest: any = { "key": { "type": "string" }, - "defaultDisclosures": { + "defaultPresentation": { "type": "object", - "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" + "properties": { + "presentationFrame": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" + } + ] } - ] - } + }, + "keyBinding": { + "type": "boolean" + } + }, + "required": [ + "presentationFrame" + ], + "additionalProperties": false } }, "required": [ @@ -3949,18 +3961,30 @@ export const CompleteOutgoingRequestRequest: any = { "key": { "type": "string" }, - "defaultDisclosures": { + "defaultPresentation": { "type": "object", - "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" + "properties": { + "presentationFrame": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" + } + ] } - ] - } + }, + "keyBinding": { + "type": "boolean" + } + }, + "required": [ + "presentationFrame" + ], + "additionalProperties": false } }, "required": [ @@ -6020,18 +6044,30 @@ export const CreateAndCompleteOutgoingRequestFromRelationshipTemplateResponseReq "key": { "type": "string" }, - "defaultDisclosures": { + "defaultPresentation": { "type": "object", - "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" + "properties": { + "presentationFrame": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" + } + ] } - ] - } + }, + "keyBinding": { + "type": "boolean" + } + }, + "required": [ + "presentationFrame" + ], + "additionalProperties": false } }, "required": [ @@ -8708,18 +8744,30 @@ export const CreateOutgoingRequestRequest: any = { "key": { "type": "string" }, - "defaultDisclosures": { + "defaultPresentation": { "type": "object", - "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" + "properties": { + "presentationFrame": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" + } + ] } - ] - } + }, + "keyBinding": { + "type": "boolean" + } + }, + "required": [ + "presentationFrame" + ], + "additionalProperties": false } }, "required": [ @@ -11799,18 +11847,30 @@ export const ReceivedIncomingRequestRequest: any = { "key": { "type": "string" }, - "defaultDisclosures": { + "defaultPresentation": { "type": "object", - "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" + "properties": { + "presentationFrame": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" + } + ] } - ] - } + }, + "keyBinding": { + "type": "boolean" + } + }, + "required": [ + "presentationFrame" + ], + "additionalProperties": false } }, "required": [ @@ -15885,18 +15945,30 @@ export const SucceedOwnIdentityAttributeRequest: any = { "key": { "type": "string" }, - "defaultDisclosures": { + "defaultPresentation": { "type": "object", - "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" + "properties": { + "presentationFrame": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" + } + ] } - ] - } + }, + "keyBinding": { + "type": "boolean" + } + }, + "required": [ + "presentationFrame" + ], + "additionalProperties": false } }, "required": [ @@ -21345,18 +21417,30 @@ export const VerifiableCredential: any = { "key": { "type": "string" }, - "defaultDisclosures": { + "defaultPresentation": { "type": "object", - "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" + "properties": { + "presentationFrame": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" + } + ] } - ] - } + }, + "keyBinding": { + "type": "boolean" + } + }, + "required": [ + "presentationFrame" + ], + "additionalProperties": false } }, "required": [ diff --git a/packages/runtime/test/consumption/openid4vc.test.ts b/packages/runtime/test/consumption/openid4vc.test.ts index db285caf3..3113f5d10 100644 --- a/packages/runtime/test/consumption/openid4vc.test.ts +++ b/packages/runtime/test/consumption/openid4vc.test.ts @@ -11,7 +11,7 @@ const fetchInstance: typeof fetch = (async (input: any, init: any) => { return response; }) as unknown as typeof fetch; -describe("custom openid4vc service", () => { +describe.only("custom openid4vc service", () => { const runtimeServiceProvider = new RuntimeServiceProvider(fetchInstance); let consumptionServices: ConsumptionServices; @@ -176,13 +176,35 @@ describe("custom openid4vc service", () => { test("one disclosure, no key binding", async () => { const attribute = (await consumptionServices.attributes.getAttribute({ id: attributeId })).value; const newAttribute = ( - await consumptionServices.attributes.createOwnIdentityAttribute({ - content: { value: { ...attribute.content.value, defaultDisclosures: { lob: true } } as VerifiableCredentialJSON } + await consumptionServices.attributes.succeedOwnIdentityAttribute({ + // create attribute runs into an error + predecessorId: attributeId, + successorContent: { value: { ...attribute.content.value, defaultPresentation: { presentationFrame: { degree: true } } } as VerifiableCredentialJSON } }) - ).value; + ).value.successor; + attributeId = newAttribute.id; const defaultPresentation = await consumptionServices.openId4Vc.createDefaultPresentation({ attributeId: newAttribute.id }); expect(defaultPresentation).toBeSuccessful(); + expect(defaultPresentation.value.presentation.split("~")).toHaveLength(2); // one disclosure + }); + + test("one disclosure, key binding", async () => { + const attribute = (await consumptionServices.attributes.getAttribute({ id: attributeId })).value; + const newAttribute = ( + await consumptionServices.attributes.succeedOwnIdentityAttribute({ + // create attribute runs into an error + predecessorId: attributeId, + successorContent: { + value: { ...attribute.content.value, defaultPresentation: { keyBinding: true, presentationFrame: { degree: true } } } as VerifiableCredentialJSON + } + }) + ).value.successor; + attributeId = newAttribute.id; + + const defaultPresentation = await consumptionServices.openId4Vc.createDefaultPresentation({ attributeId: newAttribute.id }); + expect(defaultPresentation).toBeSuccessful(); + expect(defaultPresentation.value.presentation.split("~")).toHaveLength(2); // one disclosure }); }); From e6370714773e62bcc05a0ab43a5a3ac3a56bd771 Mon Sep 17 00:00:00 2001 From: mkuhn Date: Fri, 5 Dec 2025 12:18:10 +0100 Subject: [PATCH 04/18] test: check presentation --- .../runtime/test/consumption/openid4vc.test.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/runtime/test/consumption/openid4vc.test.ts b/packages/runtime/test/consumption/openid4vc.test.ts index 3113f5d10..95ab1d9fd 100644 --- a/packages/runtime/test/consumption/openid4vc.test.ts +++ b/packages/runtime/test/consumption/openid4vc.test.ts @@ -11,7 +11,7 @@ const fetchInstance: typeof fetch = (async (input: any, init: any) => { return response; }) as unknown as typeof fetch; -describe.only("custom openid4vc service", () => { +describe("custom openid4vc service", () => { const runtimeServiceProvider = new RuntimeServiceProvider(fetchInstance); let consumptionServices: ConsumptionServices; @@ -186,7 +186,11 @@ describe.only("custom openid4vc service", () => { const defaultPresentation = await consumptionServices.openId4Vc.createDefaultPresentation({ attributeId: newAttribute.id }); expect(defaultPresentation).toBeSuccessful(); - expect(defaultPresentation.value.presentation.split("~")).toHaveLength(2); // one disclosure + const presentationParts = defaultPresentation.value.presentation.split("~"); + + // one disclosure + expect(presentationParts).toHaveLength(3); + expect(presentationParts.at(-1)).toBe(""); }); test("one disclosure, key binding", async () => { @@ -204,7 +208,11 @@ describe.only("custom openid4vc service", () => { const defaultPresentation = await consumptionServices.openId4Vc.createDefaultPresentation({ attributeId: newAttribute.id }); expect(defaultPresentation).toBeSuccessful(); - expect(defaultPresentation.value.presentation.split("~")).toHaveLength(2); // one disclosure + const presentationParts = defaultPresentation.value.presentation.split("~"); + + // one disclosure, one key binding jwt + expect(presentationParts).toHaveLength(3); + expect(presentationParts.at(-1)).toMatch(/^ey/); }); }); From ceb87791920ce1f504ed8c0443254367c4f89d26 Mon Sep 17 00:00:00 2001 From: mkuhn Date: Fri, 5 Dec 2025 13:41:20 +0100 Subject: [PATCH 05/18] test: change test order --- .../test/consumption/openid4vc.test.ts | 87 ++++++++++--------- 1 file changed, 44 insertions(+), 43 deletions(-) diff --git a/packages/runtime/test/consumption/openid4vc.test.ts b/packages/runtime/test/consumption/openid4vc.test.ts index 8163337d1..47d53dd20 100644 --- a/packages/runtime/test/consumption/openid4vc.test.ts +++ b/packages/runtime/test/consumption/openid4vc.test.ts @@ -17,7 +17,6 @@ describe("custom openid4vc service", () => { let axiosInstance: AxiosInstance; let dockerComposeStack: StartedDockerComposeEnvironment | undefined; - let attributeId: string; beforeAll(async () => { const runtimeServices = await runtimeServiceProvider.launch(1); @@ -47,6 +46,8 @@ describe("custom openid4vc service", () => { let credentialOfferUrl: string; describe("sd-jwt", () => { + let attributeId: string; + test("should process a given sd-jwt credential offer", async () => { const response = await axiosInstance.post("/issuance/credentialOffers", { credentialConfigurationIds: ["EmployeeIdCard-sdjwt"] @@ -159,6 +160,48 @@ describe("custom openid4vc service", () => { expect(acceptanceResult).toBeSuccessful(); expect(acceptanceResult.value.length).toBeGreaterThan(0); }); + + test("default presentation with one disclosure, no key binding", async () => { + const attribute = (await consumptionServices.attributes.getAttribute({ id: attributeId })).value; + const newAttribute = ( + await consumptionServices.attributes.succeedOwnIdentityAttribute({ + // create attribute runs into an error + predecessorId: attributeId, + successorContent: { value: { ...attribute.content.value, defaultPresentation: { presentationFrame: { degree: true } } } as VerifiableCredentialJSON } + }) + ).value.successor; + attributeId = newAttribute.id; + + const defaultPresentation = await consumptionServices.openId4Vc.createDefaultPresentation({ attributeId: newAttribute.id }); + expect(defaultPresentation).toBeSuccessful(); + const presentationParts = defaultPresentation.value.presentation.split("~"); + + // one disclosure + expect(presentationParts).toHaveLength(3); + expect(presentationParts.at(-1)).toBe(""); + }); + + test("default presentation with one disclosure and key binding", async () => { + const attribute = (await consumptionServices.attributes.getAttribute({ id: attributeId })).value; + const newAttribute = ( + await consumptionServices.attributes.succeedOwnIdentityAttribute({ + // create attribute runs into an error + predecessorId: attributeId, + successorContent: { + value: { ...attribute.content.value, defaultPresentation: { keyBinding: true, presentationFrame: { degree: true } } } as VerifiableCredentialJSON + } + }) + ).value.successor; + attributeId = newAttribute.id; + + const defaultPresentation = await consumptionServices.openId4Vc.createDefaultPresentation({ attributeId: newAttribute.id }); + expect(defaultPresentation).toBeSuccessful(); + const presentationParts = defaultPresentation.value.presentation.split("~"); + + // one disclosure, one key binding jwt + expect(presentationParts).toHaveLength(3); + expect(presentationParts.at(-1)).toMatch(/^ey/); + }); }); describe("mdoc", () => { @@ -272,48 +315,6 @@ describe("custom openid4vc service", () => { return composeStack; } - - test("one disclosure, no key binding", async () => { - const attribute = (await consumptionServices.attributes.getAttribute({ id: attributeId })).value; - const newAttribute = ( - await consumptionServices.attributes.succeedOwnIdentityAttribute({ - // create attribute runs into an error - predecessorId: attributeId, - successorContent: { value: { ...attribute.content.value, defaultPresentation: { presentationFrame: { degree: true } } } as VerifiableCredentialJSON } - }) - ).value.successor; - attributeId = newAttribute.id; - - const defaultPresentation = await consumptionServices.openId4Vc.createDefaultPresentation({ attributeId: newAttribute.id }); - expect(defaultPresentation).toBeSuccessful(); - const presentationParts = defaultPresentation.value.presentation.split("~"); - - // one disclosure - expect(presentationParts).toHaveLength(3); - expect(presentationParts.at(-1)).toBe(""); - }); - - test("one disclosure, key binding", async () => { - const attribute = (await consumptionServices.attributes.getAttribute({ id: attributeId })).value; - const newAttribute = ( - await consumptionServices.attributes.succeedOwnIdentityAttribute({ - // create attribute runs into an error - predecessorId: attributeId, - successorContent: { - value: { ...attribute.content.value, defaultPresentation: { keyBinding: true, presentationFrame: { degree: true } } } as VerifiableCredentialJSON - } - }) - ).value.successor; - attributeId = newAttribute.id; - - const defaultPresentation = await consumptionServices.openId4Vc.createDefaultPresentation({ attributeId: newAttribute.id }); - expect(defaultPresentation).toBeSuccessful(); - const presentationParts = defaultPresentation.value.presentation.split("~"); - - // one disclosure, one key binding jwt - expect(presentationParts).toHaveLength(3); - expect(presentationParts.at(-1)).toMatch(/^ey/); - }); }); describe("EUDIPLO", () => { From 1cd0a207e6672f57fbb586e6bf3c44dbeb188123 Mon Sep 17 00:00:00 2001 From: mkuhn Date: Fri, 5 Dec 2025 16:25:01 +0100 Subject: [PATCH 06/18] test: adapt tests after merge --- packages/runtime/test/consumption/openid4vc.test.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/runtime/test/consumption/openid4vc.test.ts b/packages/runtime/test/consumption/openid4vc.test.ts index f1a778286..ebf5e4af6 100644 --- a/packages/runtime/test/consumption/openid4vc.test.ts +++ b/packages/runtime/test/consumption/openid4vc.test.ts @@ -171,9 +171,9 @@ describe("custom openid4vc service", () => { }); test("default presentation with one disclosure, no key binding", async () => { - const attribute = (await consumptionServices.attributes.getAttribute({ id: attributeId })).value; + const attribute = (await runtimeServices1.consumption.attributes.getAttribute({ id: attributeId })).value; const newAttribute = ( - await consumptionServices.attributes.succeedOwnIdentityAttribute({ + await runtimeServices1.consumption.attributes.succeedOwnIdentityAttribute({ // create attribute runs into an error predecessorId: attributeId, successorContent: { value: { ...attribute.content.value, defaultPresentation: { presentationFrame: { degree: true } } } as VerifiableCredentialJSON } @@ -181,7 +181,7 @@ describe("custom openid4vc service", () => { ).value.successor; attributeId = newAttribute.id; - const defaultPresentation = await consumptionServices.openId4Vc.createDefaultPresentation({ attributeId: newAttribute.id }); + const defaultPresentation = await runtimeServices1.consumption.openId4Vc.createDefaultPresentation({ attributeId: newAttribute.id }); expect(defaultPresentation).toBeSuccessful(); const presentationParts = defaultPresentation.value.presentation.split("~"); @@ -191,9 +191,9 @@ describe("custom openid4vc service", () => { }); test("default presentation with one disclosure and key binding", async () => { - const attribute = (await consumptionServices.attributes.getAttribute({ id: attributeId })).value; + const attribute = (await runtimeServices1.consumption.attributes.getAttribute({ id: attributeId })).value; const newAttribute = ( - await consumptionServices.attributes.succeedOwnIdentityAttribute({ + await runtimeServices1.consumption.attributes.succeedOwnIdentityAttribute({ // create attribute runs into an error predecessorId: attributeId, successorContent: { @@ -203,7 +203,7 @@ describe("custom openid4vc service", () => { ).value.successor; attributeId = newAttribute.id; - const defaultPresentation = await consumptionServices.openId4Vc.createDefaultPresentation({ attributeId: newAttribute.id }); + const defaultPresentation = await runtimeServices1.consumption.openId4Vc.createDefaultPresentation({ attributeId: newAttribute.id }); expect(defaultPresentation).toBeSuccessful(); const presentationParts = defaultPresentation.value.presentation.split("~"); From 8a19cf677132ab11ac94f0bb8214263d1f49e8a0 Mon Sep 17 00:00:00 2001 From: mkuhn Date: Fri, 5 Dec 2025 16:54:20 +0100 Subject: [PATCH 07/18] test: set attribute id --- packages/runtime/test/consumption/openid4vc.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/runtime/test/consumption/openid4vc.test.ts b/packages/runtime/test/consumption/openid4vc.test.ts index ebf5e4af6..a3861748f 100644 --- a/packages/runtime/test/consumption/openid4vc.test.ts +++ b/packages/runtime/test/consumption/openid4vc.test.ts @@ -84,7 +84,8 @@ describe("custom openid4vc service", () => { }); const storeResult = await runtimeServices1.consumption.openId4Vc.storeCredentials({ credentialResponses: credentialResponseResult.value.credentialResponses }); expect(storeResult).toBeSuccessful(); - expect(typeof storeResult.value.id).toBe("string"); + attributeId = storeResult.value.id; + expect(typeof attributeId).toBe("string"); const credential = storeResult.value.content.value as unknown as VerifiableCredential; expect(credential.displayInformation?.[0].logo).toBeDefined(); From 8984231f969f5e1658a15f9a3677c9558636ddae Mon Sep 17 00:00:00 2001 From: mkuhn Date: Fri, 5 Dec 2025 16:55:21 +0100 Subject: [PATCH 08/18] feat: validate existence of configuration --- packages/consumption/src/modules/openid4vc/local/Holder.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/consumption/src/modules/openid4vc/local/Holder.ts b/packages/consumption/src/modules/openid4vc/local/Holder.ts index 94d5747a7..9cba43148 100644 --- a/packages/consumption/src/modules/openid4vc/local/Holder.ts +++ b/packages/consumption/src/modules/openid4vc/local/Holder.ts @@ -206,6 +206,7 @@ export class Holder extends BaseAgent> public async createDefaultPresentation(credential: VerifiableCredential): Promise { if (credential.type !== ClaimFormat.SdJwtDc) throw new Error("Creating a default presentation is only supported for dc+sd-jwt credentials."); + if (!credential.defaultPresentation) throw new Error("Default presentation not configured."); const sdJwtVcApi = this.agent.dependencyManager.resolve(SdJwtVcApi); const presentation = await sdJwtVcApi.present({ From a4fdfe5dcaf1fd97bde4309a4412c0fc82f15460 Mon Sep 17 00:00:00 2001 From: mkuhn Date: Fri, 5 Dec 2025 16:59:59 +0100 Subject: [PATCH 09/18] refactor: use case import --- .../extensibility/facades/consumption/OpenId4VcFacade.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/runtime/src/extensibility/facades/consumption/OpenId4VcFacade.ts b/packages/runtime/src/extensibility/facades/consumption/OpenId4VcFacade.ts index 85df3715c..f1abdb386 100644 --- a/packages/runtime/src/extensibility/facades/consumption/OpenId4VcFacade.ts +++ b/packages/runtime/src/extensibility/facades/consumption/OpenId4VcFacade.ts @@ -5,6 +5,9 @@ import { AcceptAuthorizationRequestRequest, AcceptAuthorizationRequestResponse, AcceptAuthorizationRequestUseCase, + CreateDefaultPresentationRequest, + CreateDefaultPresentationResponse, + CreateDefaultPresentationUseCase, RequestCredentialsRequest, RequestCredentialsResponse, RequestCredentialsUseCase, @@ -17,11 +20,6 @@ import { StoreCredentialsRequest, StoreCredentialsUseCase } from "../../../useCases"; -import { - CreateDefaultPresentationRequest, - CreateDefaultPresentationResponse, - CreateDefaultPresentationUseCase -} from "../../../useCases/consumption/openid4vc/CreateDefaultPresentation"; export class OpenId4VcFacade { public constructor( From 0ad4f2c5a1639935dde265413e50b9a0b7d07898 Mon Sep 17 00:00:00 2001 From: mkuhn Date: Mon, 8 Dec 2025 09:01:27 +0100 Subject: [PATCH 10/18] refactor: linter --- packages/consumption/src/modules/openid4vc/local/Holder.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/consumption/src/modules/openid4vc/local/Holder.ts b/packages/consumption/src/modules/openid4vc/local/Holder.ts index 9cba43148..68f9d4a63 100644 --- a/packages/consumption/src/modules/openid4vc/local/Holder.ts +++ b/packages/consumption/src/modules/openid4vc/local/Holder.ts @@ -211,8 +211,8 @@ export class Holder extends BaseAgent> const sdJwtVcApi = this.agent.dependencyManager.resolve(SdJwtVcApi); const presentation = await sdJwtVcApi.present({ sdJwtVc: sdJwtVcApi.fromCompact(credential.value as string), - presentationFrame: credential.defaultPresentation?.presentationFrame, - verifierMetadata: credential.defaultPresentation?.keyBinding + presentationFrame: credential.defaultPresentation.presentationFrame, + verifierMetadata: credential.defaultPresentation.keyBinding ? { audience: "defaultPresentationAudience", issuedAt: Date.now() / 1000, From 3ae602ee241bf33e0a770816b91e06a3de3f66c0 Mon Sep 17 00:00:00 2001 From: mkuhn Date: Mon, 8 Dec 2025 09:05:40 +0100 Subject: [PATCH 11/18] refactor: rename property to include ...config --- .../consumption/src/modules/openid4vc/local/Holder.ts | 6 +++--- .../content/src/attributes/types/VerifiableCredential.ts | 8 ++++---- packages/runtime/test/consumption/openid4vc.test.ts | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/consumption/src/modules/openid4vc/local/Holder.ts b/packages/consumption/src/modules/openid4vc/local/Holder.ts index 68f9d4a63..4c8941dbc 100644 --- a/packages/consumption/src/modules/openid4vc/local/Holder.ts +++ b/packages/consumption/src/modules/openid4vc/local/Holder.ts @@ -206,13 +206,13 @@ export class Holder extends BaseAgent> public async createDefaultPresentation(credential: VerifiableCredential): Promise { if (credential.type !== ClaimFormat.SdJwtDc) throw new Error("Creating a default presentation is only supported for dc+sd-jwt credentials."); - if (!credential.defaultPresentation) throw new Error("Default presentation not configured."); + if (!credential.defaultPresentationConfig) throw new Error("Default presentation not configured."); const sdJwtVcApi = this.agent.dependencyManager.resolve(SdJwtVcApi); const presentation = await sdJwtVcApi.present({ sdJwtVc: sdJwtVcApi.fromCompact(credential.value as string), - presentationFrame: credential.defaultPresentation.presentationFrame, - verifierMetadata: credential.defaultPresentation.keyBinding + presentationFrame: credential.defaultPresentationConfig.presentationFrame, + verifierMetadata: credential.defaultPresentationConfig.keyBinding ? { audience: "defaultPresentationAudience", issuedAt: Date.now() / 1000, diff --git a/packages/content/src/attributes/types/VerifiableCredential.ts b/packages/content/src/attributes/types/VerifiableCredential.ts index 576c37008..83b201627 100644 --- a/packages/content/src/attributes/types/VerifiableCredential.ts +++ b/packages/content/src/attributes/types/VerifiableCredential.ts @@ -9,18 +9,18 @@ export interface VerifiableCredentialJSON extends AbstractAttributeValueJSON { value: string | Record; type: string; displayInformation?: Record[]; - defaultPresentation?: { presentationFrame: IPresentationFrame; keyBinding?: boolean }; + defaultPresentationConfig?: { presentationFrame: IPresentationFrame; keyBinding?: boolean }; } export interface IVerifiableCredential extends IAbstractAttributeValue { value: string | Record; type: string; displayInformation?: Record[]; - defaultPresentation?: { presentationFrame: IPresentationFrame; keyBinding?: boolean }; + defaultPresentationConfig?: { presentationFrame: IPresentationFrame; keyBinding?: boolean }; } @type("VerifiableCredential") -export class VerifiableCredential extends AbstractAttributeValue { +export class VerifiableCredential extends AbstractAttributeValue implements IVerifiableCredential { @serialize({ any: true }) @validate({ customValidator: validateValue }) public value: string | Record; @@ -35,7 +35,7 @@ export class VerifiableCredential extends AbstractAttributeValue { @serialize({ any: true }) @validate({ nullable: true }) - public defaultPresentation?: { presentationFrame: IPresentationFrame; keyBinding?: boolean }; + public defaultPresentationConfig?: { presentationFrame: IPresentationFrame; keyBinding?: boolean }; public static get valueHints(): ValueHints { return ValueHints.from({}); diff --git a/packages/runtime/test/consumption/openid4vc.test.ts b/packages/runtime/test/consumption/openid4vc.test.ts index a3861748f..625662598 100644 --- a/packages/runtime/test/consumption/openid4vc.test.ts +++ b/packages/runtime/test/consumption/openid4vc.test.ts @@ -177,7 +177,7 @@ describe("custom openid4vc service", () => { await runtimeServices1.consumption.attributes.succeedOwnIdentityAttribute({ // create attribute runs into an error predecessorId: attributeId, - successorContent: { value: { ...attribute.content.value, defaultPresentation: { presentationFrame: { degree: true } } } as VerifiableCredentialJSON } + successorContent: { value: { ...attribute.content.value, defaultPresentationConfig: { presentationFrame: { degree: true } } } as VerifiableCredentialJSON } }) ).value.successor; attributeId = newAttribute.id; @@ -198,7 +198,7 @@ describe("custom openid4vc service", () => { // create attribute runs into an error predecessorId: attributeId, successorContent: { - value: { ...attribute.content.value, defaultPresentation: { keyBinding: true, presentationFrame: { degree: true } } } as VerifiableCredentialJSON + value: { ...attribute.content.value, defaultPresentationConfig: { keyBinding: true, presentationFrame: { degree: true } } } as VerifiableCredentialJSON } }) ).value.successor; From e97816421582953175d1075325c0568202c10ab0 Mon Sep 17 00:00:00 2001 From: mkuhn Date: Mon, 8 Dec 2025 10:09:46 +0100 Subject: [PATCH 12/18] chore: build schemas --- packages/runtime/src/useCases/common/Schemas.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/runtime/src/useCases/common/Schemas.ts b/packages/runtime/src/useCases/common/Schemas.ts index 8848b8833..26cc1846e 100644 --- a/packages/runtime/src/useCases/common/Schemas.ts +++ b/packages/runtime/src/useCases/common/Schemas.ts @@ -1864,7 +1864,7 @@ export const CanCreateOutgoingRequestRequest: any = { "type": "object" } }, - "defaultPresentation": { + "defaultPresentationConfig": { "type": "object", "properties": { "presentationFrame": { @@ -3994,7 +3994,7 @@ export const CompleteOutgoingRequestRequest: any = { "type": "object" } }, - "defaultPresentation": { + "defaultPresentationConfig": { "type": "object", "properties": { "presentationFrame": { @@ -6074,7 +6074,7 @@ export const CreateAndCompleteOutgoingRequestFromRelationshipTemplateResponseReq "type": "object" } }, - "defaultPresentation": { + "defaultPresentationConfig": { "type": "object", "properties": { "presentationFrame": { @@ -8774,7 +8774,7 @@ export const CreateOutgoingRequestRequest: any = { "type": "object" } }, - "defaultPresentation": { + "defaultPresentationConfig": { "type": "object", "properties": { "presentationFrame": { @@ -11913,7 +11913,7 @@ export const ReceivedIncomingRequestRequest: any = { "type": "object" } }, - "defaultPresentation": { + "defaultPresentationConfig": { "type": "object", "properties": { "presentationFrame": { @@ -16044,7 +16044,7 @@ export const SucceedOwnIdentityAttributeRequest: any = { "type": "object" } }, - "defaultPresentation": { + "defaultPresentationConfig": { "type": "object", "properties": { "presentationFrame": { @@ -21513,7 +21513,7 @@ export const VerifiableCredential: any = { "type": "object" } }, - "defaultPresentation": { + "defaultPresentationConfig": { "type": "object", "properties": { "presentationFrame": { From d1a75b977db593a85417fe8d6cd62b71cc725b5b Mon Sep 17 00:00:00 2001 From: mkuhn Date: Thu, 8 Jan 2026 19:47:32 +0100 Subject: [PATCH 13/18] feat: updated usage with token --- .../modules/openid4vc/OpenId4VcController.ts | 2 +- .../src/modules/openid4vc/local/Holder.ts | 25 +- .../attributes/types/VerifiableCredential.ts | 7 - .../facades/consumption/OpenId4VcFacade.ts | 13 +- .../runtime/src/useCases/common/Schemas.ts | 3842 ++++++++--------- .../openid4vc/CreateDefaultPresentation.ts | 38 - .../openid4vc/CreatePresentationToken.ts | 45 + .../useCases/consumption/openid4vc/index.ts | 2 +- .../test/consumption/openid4vc.test.ts | 51 +- 9 files changed, 1868 insertions(+), 2157 deletions(-) delete mode 100644 packages/runtime/src/useCases/consumption/openid4vc/CreateDefaultPresentation.ts create mode 100644 packages/runtime/src/useCases/consumption/openid4vc/CreatePresentationToken.ts diff --git a/packages/consumption/src/modules/openid4vc/OpenId4VcController.ts b/packages/consumption/src/modules/openid4vc/OpenId4VcController.ts index e13c36dbf..798471b83 100644 --- a/packages/consumption/src/modules/openid4vc/OpenId4VcController.ts +++ b/packages/consumption/src/modules/openid4vc/OpenId4VcController.ts @@ -125,7 +125,7 @@ export class OpenId4VcController extends ConsumptionBaseController { return { status: serverResponse.status, message: serverResponse.body }; } - public async createDefaultPresentation(credential: VerifiableCredential): Promise { + public async createDefaultPresentation(credential: VerifiableCredential): Promise { return await this.holder.createDefaultPresentation(credential); } } diff --git a/packages/consumption/src/modules/openid4vc/local/Holder.ts b/packages/consumption/src/modules/openid4vc/local/Holder.ts index 68bd99532..18a780c69 100644 --- a/packages/consumption/src/modules/openid4vc/local/Holder.ts +++ b/packages/consumption/src/modules/openid4vc/local/Holder.ts @@ -210,24 +210,25 @@ export class Holder extends BaseAgent> return submissionResult.serverResponse; } - public async createDefaultPresentation(credential: VerifiableCredential): Promise { - if (credential.type !== ClaimFormat.SdJwtDc) throw new Error("Creating a default presentation is only supported for dc+sd-jwt credentials."); - if (!credential.defaultPresentationConfig) throw new Error("Default presentation not configured."); + // hacky solution because credo doesn't support credentials without key binding + // TODO: use credentials without key binding once supported + public async createDefaultPresentation(credential: VerifiableCredential): Promise { + if (credential.type !== ClaimFormat.SdJwtDc) throw new Error("Only SD-JWT credentials have been tested so far with default presentation"); const sdJwtVcApi = this.agent.dependencyManager.resolve(SdJwtVcApi); const presentation = await sdJwtVcApi.present({ sdJwtVc: sdJwtVcApi.fromCompact(credential.value as string), - presentationFrame: credential.defaultPresentationConfig.presentationFrame, - verifierMetadata: credential.defaultPresentationConfig.keyBinding - ? { - audience: "defaultPresentationAudience", - issuedAt: Date.now() / 1000, - nonce: "defaultPresentationNonce" - } - : undefined + verifierMetadata: { + audience: "defaultPresentationAudience", + issuedAt: Date.now() / 1000, + nonce: "defaultPresentationNonce" + } }); - return presentation; + return VerifiableCredential.from({ + ...credential, + value: presentation + }); } public async exit(): Promise { diff --git a/packages/content/src/attributes/types/VerifiableCredential.ts b/packages/content/src/attributes/types/VerifiableCredential.ts index 83b201627..dee12cb09 100644 --- a/packages/content/src/attributes/types/VerifiableCredential.ts +++ b/packages/content/src/attributes/types/VerifiableCredential.ts @@ -1,4 +1,3 @@ -import { IPresentationFrame } from "@credo-ts/core"; import { serialize, type, validate } from "@js-soft/ts-serval"; import { AbstractAttributeValue, AbstractAttributeValueJSON, IAbstractAttributeValue } from "../AbstractAttributeValue"; import { RenderHints, RenderHintsEditType, RenderHintsTechnicalType, ValueHints } from "../hints"; @@ -9,14 +8,12 @@ export interface VerifiableCredentialJSON extends AbstractAttributeValueJSON { value: string | Record; type: string; displayInformation?: Record[]; - defaultPresentationConfig?: { presentationFrame: IPresentationFrame; keyBinding?: boolean }; } export interface IVerifiableCredential extends IAbstractAttributeValue { value: string | Record; type: string; displayInformation?: Record[]; - defaultPresentationConfig?: { presentationFrame: IPresentationFrame; keyBinding?: boolean }; } @type("VerifiableCredential") @@ -33,10 +30,6 @@ export class VerifiableCredential extends AbstractAttributeValue implements IVer @validate({ nullable: true, max: PROPRIETARY_ATTRIBUTE_MAX_DESCRIPTION_LENGTH }) public displayInformation?: Record[]; - @serialize({ any: true }) - @validate({ nullable: true }) - public defaultPresentationConfig?: { presentationFrame: IPresentationFrame; keyBinding?: boolean }; - public static get valueHints(): ValueHints { return ValueHints.from({}); } diff --git a/packages/runtime/src/extensibility/facades/consumption/OpenId4VcFacade.ts b/packages/runtime/src/extensibility/facades/consumption/OpenId4VcFacade.ts index f1abdb386..00b65dc75 100644 --- a/packages/runtime/src/extensibility/facades/consumption/OpenId4VcFacade.ts +++ b/packages/runtime/src/extensibility/facades/consumption/OpenId4VcFacade.ts @@ -1,13 +1,12 @@ import { Result } from "@js-soft/ts-utils"; -import { LocalAttributeDTO } from "@nmshd/runtime-types"; +import { LocalAttributeDTO, TokenDTO } from "@nmshd/runtime-types"; import { Inject } from "@nmshd/typescript-ioc"; import { AcceptAuthorizationRequestRequest, AcceptAuthorizationRequestResponse, AcceptAuthorizationRequestUseCase, - CreateDefaultPresentationRequest, - CreateDefaultPresentationResponse, - CreateDefaultPresentationUseCase, + CreatePresentationTokenRequest, + CreatePresentationTokenUseCase, RequestCredentialsRequest, RequestCredentialsResponse, RequestCredentialsUseCase, @@ -28,7 +27,7 @@ export class OpenId4VcFacade { @Inject private readonly storeCredentialsUseCase: StoreCredentialsUseCase, @Inject private readonly resolveAuthorizationRequestUseCase: ResolveAuthorizationRequestUseCase, @Inject private readonly acceptAuthorizationRequestUseCase: AcceptAuthorizationRequestUseCase, - @Inject private readonly createDefaultPresentationUseCase: CreateDefaultPresentationUseCase + @Inject private readonly createPresentationTokenUseCase: CreatePresentationTokenUseCase ) {} public async resolveCredentialOffer(request: ResolveCredentialOfferRequest): Promise> { @@ -51,7 +50,7 @@ export class OpenId4VcFacade { return await this.acceptAuthorizationRequestUseCase.execute(request); } - public async createDefaultPresentation(request: CreateDefaultPresentationRequest): Promise> { - return await this.createDefaultPresentationUseCase.execute(request); + public async createPresentationToken(request: CreatePresentationTokenRequest): Promise> { + return await this.createPresentationTokenUseCase.execute(request); } } diff --git a/packages/runtime/src/useCases/common/Schemas.ts b/packages/runtime/src/useCases/common/Schemas.ts index 35a3db015..36781852a 100644 --- a/packages/runtime/src/useCases/common/Schemas.ts +++ b/packages/runtime/src/useCases/common/Schemas.ts @@ -1889,31 +1889,6 @@ export const CanCreateOutgoingRequestRequest: any = { "items": { "type": "object" } - }, - "defaultPresentationConfig": { - "type": "object", - "properties": { - "presentationFrame": { - "type": "object", - "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" - } - ] - } - }, - "keyBinding": { - "type": "boolean" - } - }, - "required": [ - "presentationFrame" - ], - "additionalProperties": false } }, "required": [ @@ -1923,19 +1898,6 @@ export const CanCreateOutgoingRequestRequest: any = { ], "additionalProperties": false }, - "interface-1894649334-822-900-1894649334-0-4702": { - "type": "object", - "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" - } - ] - } - }, "WebsiteJSON": { "type": "object", "properties": { @@ -4046,31 +4008,6 @@ export const CompleteOutgoingRequestRequest: any = { "items": { "type": "object" } - }, - "defaultPresentationConfig": { - "type": "object", - "properties": { - "presentationFrame": { - "type": "object", - "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" - } - ] - } - }, - "keyBinding": { - "type": "boolean" - } - }, - "required": [ - "presentationFrame" - ], - "additionalProperties": false } }, "required": [ @@ -4080,19 +4017,6 @@ export const CompleteOutgoingRequestRequest: any = { ], "additionalProperties": false }, - "interface-1894649334-822-900-1894649334-0-4702": { - "type": "object", - "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" - } - ] - } - }, "WebsiteJSON": { "type": "object", "properties": { @@ -6152,31 +6076,6 @@ export const CreateAndCompleteOutgoingRequestFromRelationshipTemplateResponseReq "items": { "type": "object" } - }, - "defaultPresentationConfig": { - "type": "object", - "properties": { - "presentationFrame": { - "type": "object", - "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" - } - ] - } - }, - "keyBinding": { - "type": "boolean" - } - }, - "required": [ - "presentationFrame" - ], - "additionalProperties": false } }, "required": [ @@ -6186,19 +6085,6 @@ export const CreateAndCompleteOutgoingRequestFromRelationshipTemplateResponseReq ], "additionalProperties": false }, - "interface-1894649334-822-900-1894649334-0-4702": { - "type": "object", - "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" - } - ] - } - }, "WebsiteJSON": { "type": "object", "properties": { @@ -8878,31 +8764,6 @@ export const CreateOutgoingRequestRequest: any = { "items": { "type": "object" } - }, - "defaultPresentationConfig": { - "type": "object", - "properties": { - "presentationFrame": { - "type": "object", - "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" - } - ] - } - }, - "keyBinding": { - "type": "boolean" - } - }, - "required": [ - "presentationFrame" - ], - "additionalProperties": false } }, "required": [ @@ -8912,19 +8773,6 @@ export const CreateOutgoingRequestRequest: any = { ], "additionalProperties": false }, - "interface-1894649334-822-900-1894649334-0-4702": { - "type": "object", - "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" - } - ] - } - }, "WebsiteJSON": { "type": "object", "properties": { @@ -12044,31 +11892,6 @@ export const ReceivedIncomingRequestRequest: any = { "items": { "type": "object" } - }, - "defaultPresentationConfig": { - "type": "object", - "properties": { - "presentationFrame": { - "type": "object", - "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" - } - ] - } - }, - "keyBinding": { - "type": "boolean" - } - }, - "required": [ - "presentationFrame" - ], - "additionalProperties": false } }, "required": [ @@ -12078,19 +11901,6 @@ export const ReceivedIncomingRequestRequest: any = { ], "additionalProperties": false }, - "interface-1894649334-822-900-1894649334-0-4702": { - "type": "object", - "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" - } - ] - } - }, "WebsiteJSON": { "type": "object", "properties": { @@ -16204,31 +16014,6 @@ export const SucceedOwnIdentityAttributeRequest: any = { "items": { "type": "object" } - }, - "defaultPresentationConfig": { - "type": "object", - "properties": { - "presentationFrame": { - "type": "object", - "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" - } - ] - } - }, - "keyBinding": { - "type": "boolean" - } - }, - "required": [ - "presentationFrame" - ], - "additionalProperties": false } }, "required": [ @@ -16238,19 +16023,6 @@ export const SucceedOwnIdentityAttributeRequest: any = { ], "additionalProperties": false }, - "interface-1894649334-822-900-1894649334-0-4702": { - "type": "object", - "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" - } - ] - } - }, "WebsiteJSON": { "type": "object", "properties": { @@ -17447,247 +17219,219 @@ export const AcceptAuthorizationRequestRequest: any = { } } -export const CreateDefaultPresentationRequest: any = { +export const DownloadFileRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateDefaultPresentationRequest", + "$ref": "#/definitions/DownloadFileRequest", "definitions": { - "CreateDefaultPresentationRequest": { + "DownloadFileRequest": { "type": "object", "properties": { - "attributeId": { - "type": "string" + "id": { + "$ref": "#/definitions/FileIdString" } }, "required": [ - "attributeId" + "id" ], "additionalProperties": false + }, + "FileIdString": { + "type": "string", + "pattern": "FIL[A-Za-z0-9]{17}" } } } -export const RequestCredentialsRequest: any = { +export const LoadItemFromReferenceRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/RequestCredentialsRequest", + "$ref": "#/definitions/LoadItemFromReferenceRequest", "definitions": { - "RequestCredentialsRequest": { - "$ref": "#/definitions/AbstractRequestCredentialsRequest%3Calias-2033348025-74138-74264-2033348025-0-218439%3Cstring%2Cany%3E%3E" - }, - "AbstractRequestCredentialsRequest>": { - "anyOf": [ - { - "type": "object", - "additionalProperties": false, - "properties": { - "credentialOffer": { - "type": "object" + "LoadItemFromReferenceRequest": { + "type": "object", + "properties": { + "reference": { + "anyOf": [ + { + "$ref": "#/definitions/TokenReferenceString" }, - "credentialConfigurationIds": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "credentialConfigurationIds", - "credentialOffer" - ] - }, - { - "type": "object", - "additionalProperties": false, - "properties": { - "pinCode": { - "type": "string" + { + "$ref": "#/definitions/FileReferenceString" }, - "credentialOffer": { - "type": "object" + { + "$ref": "#/definitions/RelationshipTemplateReferenceString" }, - "credentialConfigurationIds": { - "type": "array", - "items": { - "type": "string" - } + { + "$ref": "#/definitions/URLTokenReferenceString" + }, + { + "$ref": "#/definitions/URLFileReferenceString" + }, + { + "$ref": "#/definitions/URLRelationshipTemplateReferenceString" } - }, - "required": [ - "credentialConfigurationIds", - "credentialOffer", - "pinCode" ] }, - { - "type": "object", - "additionalProperties": false, - "properties": { - "accessToken": { - "type": "string" - }, - "credentialOffer": { - "type": "object" - }, - "credentialConfigurationIds": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "accessToken", - "credentialConfigurationIds", - "credentialOffer" - ] - } - ] - } - } -} - -export const ResolveAuthorizationRequestRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/ResolveAuthorizationRequestRequest", - "definitions": { - "ResolveAuthorizationRequestRequest": { - "type": "object", - "properties": { - "authorizationRequestUrl": { + "password": { "type": "string" } }, "required": [ - "authorizationRequestUrl" + "reference" ], "additionalProperties": false + }, + "TokenReferenceString": { + "type": "string", + "pattern": "VE9L.{84}" + }, + "FileReferenceString": { + "type": "string", + "pattern": "RklM.{84}" + }, + "RelationshipTemplateReferenceString": { + "type": "string", + "pattern": "UkxU.{84}" + }, + "URLTokenReferenceString": { + "type": "string", + "pattern": "^https?:\\/\\/.*\\/r\\/TOK[a-zA-Z0-9]+(\\?app=.+)?#[a-zA-Z0-9-_]+$" + }, + "URLFileReferenceString": { + "type": "string", + "pattern": "^https?:\\/\\/.*\\/r\\/FIL[a-zA-Z0-9]+(\\?app=.+)?#[a-zA-Z0-9-_]+$" + }, + "URLRelationshipTemplateReferenceString": { + "type": "string", + "pattern": "^https?:\\/\\/.*\\/r\\/RLT[a-zA-Z0-9]+(\\?app=.+)?#[a-zA-Z0-9-_]+$" } } } -export const ResolveCredentialOfferRequest: any = { +export const RegisterPushNotificationTokenRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/ResolveCredentialOfferRequest", + "$ref": "#/definitions/RegisterPushNotificationTokenRequest", "definitions": { - "ResolveCredentialOfferRequest": { + "RegisterPushNotificationTokenRequest": { "type": "object", "properties": { - "credentialOfferUrl": { + "handle": { + "type": "string" + }, + "platform": { + "type": "string" + }, + "appId": { "type": "string" + }, + "environment": { + "type": "string", + "enum": [ + "Development", + "Production" + ] } }, "required": [ - "credentialOfferUrl" + "handle", + "platform", + "appId" ], "additionalProperties": false } } } -export const StoreCredentialsRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/StoreCredentialsRequest", - "definitions": { - "StoreCredentialsRequest": { - "type": "object", - "additionalProperties": false, - "properties": { - "credentialResponses": { - "type": "array", - "items": { - "type": "object" - } - } - }, - "required": [ - "credentialResponses" - ] - } - } -} - -export const CreateSettingRequest: any = { +export const CreateTokenForFileRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateSettingRequest", + "$ref": "#/definitions/CreateTokenForFileRequest", "definitions": { - "CreateSettingRequest": { + "CreateTokenForFileRequest": { "type": "object", "properties": { - "key": { - "type": "string" + "fileId": { + "$ref": "#/definitions/FileIdString" }, - "value": {}, - "reference": { - "$ref": "#/definitions/GenericIdString" + "expiresAt": { + "$ref": "#/definitions/ISO8601DateTimeString" }, - "scope": { - "type": "string", - "enum": [ - "Identity", - "Device", - "Relationship" - ] + "ephemeral": { + "type": "boolean" }, - "succeedsAt": { - "$ref": "#/definitions/ISO8601DateTimeString" + "forIdentity": { + "$ref": "#/definitions/AddressString" }, - "succeedsItem": { - "$ref": "#/definitions/LocalSettingIdString" + "passwordProtection": { + "type": "object", + "properties": { + "password": { + "type": "string", + "minLength": 1 + }, + "passwordIsPin": { + "type": "boolean", + "const": true + }, + "passwordLocationIndicator": {} + }, + "required": [ + "password" + ], + "additionalProperties": false } }, "required": [ - "key", - "value" + "fileId" ], "additionalProperties": false }, - "GenericIdString": { + "FileIdString": { "type": "string", - "pattern": "[A-Za-z0-9]{20}" + "pattern": "FIL[A-Za-z0-9]{17}" }, "ISO8601DateTimeString": { "type": "string", "errorMessage": "must match ISO8601 datetime format", "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" }, - "LocalSettingIdString": { + "AddressString": { "type": "string", - "pattern": "LCLSET[A-Za-z0-9]{14}" + "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" } } } -export const DeleteSettingRequest: any = { +export const DeleteFileRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/DeleteSettingRequest", + "$ref": "#/definitions/DeleteFileRequest", "definitions": { - "DeleteSettingRequest": { + "DeleteFileRequest": { "type": "object", "properties": { - "id": { - "$ref": "#/definitions/LocalSettingIdString" + "fileId": { + "$ref": "#/definitions/FileIdString" } }, "required": [ - "id" + "fileId" ], "additionalProperties": false }, - "LocalSettingIdString": { + "FileIdString": { "type": "string", - "pattern": "LCLSET[A-Za-z0-9]{14}" + "pattern": "FIL[A-Za-z0-9]{17}" } } } -export const GetSettingRequest: any = { +export const GetFileRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetSettingRequest", + "$ref": "#/definitions/GetFileRequest", "definitions": { - "GetSettingRequest": { + "GetFileRequest": { "type": "object", "properties": { "id": { - "$ref": "#/definitions/LocalSettingIdString" + "$ref": "#/definitions/FileIdString" } }, "required": [ @@ -17695,60 +17439,33 @@ export const GetSettingRequest: any = { ], "additionalProperties": false }, - "LocalSettingIdString": { + "FileIdString": { "type": "string", - "pattern": "LCLSET[A-Za-z0-9]{14}" - } - } -} - -export const GetSettingByKeyRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetSettingByKeyRequest", - "definitions": { - "GetSettingByKeyRequest": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "reference": { - "type": "string" - }, - "scope": { - "type": "string", - "enum": [ - "Identity", - "Device", - "Relationship" - ] - } - }, - "required": [ - "key" - ], - "additionalProperties": false + "pattern": "FIL[A-Za-z0-9]{17}" } } } -export const GetSettingsRequest: any = { +export const GetFilesRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetSettingsRequest", + "$ref": "#/definitions/GetFilesRequest", "definitions": { - "GetSettingsRequest": { + "GetFilesRequest": { "type": "object", "properties": { "query": { - "$ref": "#/definitions/GetSettingsQuery" + "$ref": "#/definitions/GetFilesQuery" + }, + "ownerRestriction": { + "$ref": "#/definitions/OwnerRestriction" } }, "additionalProperties": false }, - "GetSettingsQuery": { + "GetFilesQuery": { "type": "object", "properties": { - "key": { + "createdAt": { "anyOf": [ { "type": "string" @@ -17761,7 +17478,7 @@ export const GetSettingsRequest: any = { } ] }, - "scope": { + "createdBy": { "anyOf": [ { "type": "string" @@ -17774,7 +17491,7 @@ export const GetSettingsRequest: any = { } ] }, - "reference": { + "createdByDevice": { "anyOf": [ { "type": "string" @@ -17787,7 +17504,7 @@ export const GetSettingsRequest: any = { } ] }, - "createdAt": { + "description": { "anyOf": [ { "type": "string" @@ -17800,7 +17517,7 @@ export const GetSettingsRequest: any = { } ] }, - "succeedsItem": { + "expiresAt": { "anyOf": [ { "type": "string" @@ -17813,7 +17530,7 @@ export const GetSettingsRequest: any = { } ] }, - "succeedsAt": { + "filename": { "anyOf": [ { "type": "string" @@ -17825,102 +17542,106 @@ export const GetSettingsRequest: any = { } } ] - } - }, - "additionalProperties": false - } - } -} - -export const UpdateSettingRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/UpdateSettingRequest", - "definitions": { - "UpdateSettingRequest": { - "type": "object", - "properties": { - "id": { - "$ref": "#/definitions/LocalSettingIdString" }, - "value": {} - }, - "required": [ - "id", - "value" - ], - "additionalProperties": false - }, - "LocalSettingIdString": { - "type": "string", - "pattern": "LCLSET[A-Za-z0-9]{14}" - } - } -} - -export const UpsertSettingByKeyRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/UpsertSettingByKeyRequest", - "definitions": { - "UpsertSettingByKeyRequest": { - "type": "object", - "properties": { - "key": { - "type": "string" + "filesize": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - "value": {}, - "reference": { - "$ref": "#/definitions/GenericIdString" + "mimetype": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] }, - "scope": { - "type": "string", - "enum": [ - "Identity", - "Device", - "Relationship" + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } ] + }, + "isOwn": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "tags": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "ownershipToken": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "ownershipIsLocked": { + "type": "string" } }, - "required": [ - "key", - "value" - ], - "additionalProperties": false - }, - "GenericIdString": { - "type": "string", - "pattern": "[A-Za-z0-9]{20}" - } - } -} - -export const DownloadFileRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/DownloadFileRequest", - "definitions": { - "DownloadFileRequest": { - "type": "object", - "properties": { - "id": { - "$ref": "#/definitions/FileIdString" - } - }, - "required": [ - "id" - ], "additionalProperties": false }, - "FileIdString": { + "OwnerRestriction": { "type": "string", - "pattern": "FIL[A-Za-z0-9]{17}" + "enum": [ + "o", + "p" + ] } } } -export const LoadItemFromReferenceRequest: any = { +export const GetOrLoadFileRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/LoadItemFromReferenceRequest", + "$ref": "#/definitions/GetOrLoadFileRequest", "definitions": { - "LoadItemFromReferenceRequest": { + "GetOrLoadFileRequest": { "type": "object", "properties": { "reference": { @@ -17931,17 +17652,11 @@ export const LoadItemFromReferenceRequest: any = { { "$ref": "#/definitions/FileReferenceString" }, - { - "$ref": "#/definitions/RelationshipTemplateReferenceString" - }, { "$ref": "#/definitions/URLTokenReferenceString" }, { "$ref": "#/definitions/URLFileReferenceString" - }, - { - "$ref": "#/definitions/URLRelationshipTemplateReferenceString" } ] }, @@ -17952,7 +17667,8 @@ export const LoadItemFromReferenceRequest: any = { "required": [ "reference" ], - "additionalProperties": false + "additionalProperties": false, + "errorMessage": "token / file reference invalid" }, "TokenReferenceString": { "type": "string", @@ -17962,10 +17678,6 @@ export const LoadItemFromReferenceRequest: any = { "type": "string", "pattern": "RklM.{84}" }, - "RelationshipTemplateReferenceString": { - "type": "string", - "pattern": "UkxU.{84}" - }, "URLTokenReferenceString": { "type": "string", "pattern": "^https?:\\/\\/.*\\/r\\/TOK[a-zA-Z0-9]+(\\?app=.+)?#[a-zA-Z0-9-_]+$" @@ -17973,146 +17685,228 @@ export const LoadItemFromReferenceRequest: any = { "URLFileReferenceString": { "type": "string", "pattern": "^https?:\\/\\/.*\\/r\\/FIL[a-zA-Z0-9]+(\\?app=.+)?#[a-zA-Z0-9-_]+$" - }, - "URLRelationshipTemplateReferenceString": { - "type": "string", - "pattern": "^https?:\\/\\/.*\\/r\\/RLT[a-zA-Z0-9]+(\\?app=.+)?#[a-zA-Z0-9-_]+$" } } } -export const RegisterPushNotificationTokenRequest: any = { +export const RegenerateFileOwnershipTokenRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/RegisterPushNotificationTokenRequest", + "$ref": "#/definitions/RegenerateFileOwnershipTokenRequest", "definitions": { - "RegisterPushNotificationTokenRequest": { + "RegenerateFileOwnershipTokenRequest": { "type": "object", "properties": { - "handle": { - "type": "string" - }, - "platform": { - "type": "string" - }, - "appId": { - "type": "string" - }, - "environment": { - "type": "string", - "enum": [ - "Development", - "Production" - ] + "id": { + "$ref": "#/definitions/FileIdString" } }, "required": [ - "handle", - "platform", - "appId" + "id" ], "additionalProperties": false + }, + "FileIdString": { + "type": "string", + "pattern": "FIL[A-Za-z0-9]{17}" } } } -export const CreateTokenForFileRequest: any = { +export const UploadOwnFileRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateTokenForFileRequest", + "$ref": "#/definitions/UploadOwnFileRequest", "definitions": { - "CreateTokenForFileRequest": { + "UploadOwnFileRequest": { "type": "object", "properties": { - "fileId": { - "$ref": "#/definitions/FileIdString" - }, - "expiresAt": { - "$ref": "#/definitions/ISO8601DateTimeString" - }, - "ephemeral": { - "type": "boolean" - }, - "forIdentity": { - "$ref": "#/definitions/AddressString" - }, - "passwordProtection": { + "content": { "type": "object", "properties": { - "password": { - "type": "string", - "minLength": 1 + "BYTES_PER_ELEMENT": { + "type": "number" }, - "passwordIsPin": { - "type": "boolean", - "const": true + "buffer": { + "type": "object", + "properties": { + "byteLength": { + "type": "number" + } + }, + "required": [ + "byteLength" + ], + "additionalProperties": false }, - "passwordLocationIndicator": {} + "byteLength": { + "type": "number" + }, + "byteOffset": { + "type": "number" + }, + "length": { + "type": "number" + } }, "required": [ - "password" + "BYTES_PER_ELEMENT", + "buffer", + "byteLength", + "byteOffset", + "length" ], - "additionalProperties": false - } - }, + "additionalProperties": { + "type": "number" + } + }, + "filename": { + "type": "string" + }, + "mimetype": { + "type": "string" + }, + "expiresAt": { + "$ref": "#/definitions/ISO8601DateTimeString" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + } + }, "required": [ - "fileId" + "content", + "filename", + "mimetype" ], "additionalProperties": false }, - "FileIdString": { - "type": "string", - "pattern": "FIL[A-Za-z0-9]{17}" - }, "ISO8601DateTimeString": { "type": "string", "errorMessage": "must match ISO8601 datetime format", "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" + } + } +} + +export const UploadOwnFileValidatableRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/UploadOwnFileValidatableRequest", + "definitions": { + "UploadOwnFileValidatableRequest": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "mimetype": { + "type": "string" + }, + "expiresAt": { + "$ref": "#/definitions/ISO8601DateTimeString" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + "content": { + "type": "object" + } + }, + "required": [ + "content", + "filename", + "mimetype" + ], + "additionalProperties": false }, - "AddressString": { + "ISO8601DateTimeString": { "type": "string", - "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" + "errorMessage": "must match ISO8601 datetime format", + "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" } } } -export const DeleteFileRequest: any = { +export const GetIdentityDeletionProcessRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/DeleteFileRequest", + "$ref": "#/definitions/GetIdentityDeletionProcessRequest", "definitions": { - "DeleteFileRequest": { + "GetIdentityDeletionProcessRequest": { "type": "object", "properties": { - "fileId": { - "$ref": "#/definitions/FileIdString" + "id": { + "$ref": "#/definitions/IdentityDeletionProcessIdString" } }, "required": [ - "fileId" + "id" ], "additionalProperties": false }, - "FileIdString": { + "IdentityDeletionProcessIdString": { "type": "string", - "pattern": "FIL[A-Za-z0-9]{17}" + "pattern": "IDP[A-Za-z0-9]{17}" } } } -export const GetFileRequest: any = { +export const InitiateIdentityDeletionProcessRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetFileRequest", + "$ref": "#/definitions/InitiateIdentityDeletionProcessRequest", "definitions": { - "GetFileRequest": { + "InitiateIdentityDeletionProcessRequest": { + "type": "object", + "properties": { + "lengthOfGracePeriodInDays": { + "type": "number" + } + }, + "additionalProperties": false + } + } +} + +export const DownloadAttachmentRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/DownloadAttachmentRequest", + "definitions": { + "DownloadAttachmentRequest": { "type": "object", "properties": { "id": { + "$ref": "#/definitions/MessageIdString" + }, + "attachmentId": { "$ref": "#/definitions/FileIdString" } }, "required": [ - "id" + "id", + "attachmentId" ], "additionalProperties": false }, + "MessageIdString": { + "type": "string", + "pattern": "MSG[A-Za-z0-9]{17}" + }, "FileIdString": { "type": "string", "pattern": "FIL[A-Za-z0-9]{17}" @@ -18120,864 +17914,396 @@ export const GetFileRequest: any = { } } -export const GetFilesRequest: any = { +export const GetAnnouncementsRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetFilesRequest", + "$ref": "#/definitions/GetAnnouncementsRequest", "definitions": { - "GetFilesRequest": { + "GetAnnouncementsRequest": { "type": "object", "properties": { - "query": { - "$ref": "#/definitions/GetFilesQuery" - }, - "ownerRestriction": { - "$ref": "#/definitions/OwnerRestriction" + "language": { + "$ref": "#/definitions/LanguageISO639" } }, + "required": [ + "language" + ], "additionalProperties": false }, - "GetFilesQuery": { - "type": "object", - "properties": { - "createdAt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "createdBy": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "createdByDevice": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "expiresAt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "filename": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "filesize": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "mimetype": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "title": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "isOwn": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "tags": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "ownershipToken": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "ownershipIsLocked": { - "type": "string" - } - }, - "additionalProperties": false - }, - "OwnerRestriction": { + "LanguageISO639": { "type": "string", "enum": [ - "o", - "p" + "aa", + "ab", + "ae", + "af", + "ak", + "am", + "an", + "ar", + "as", + "av", + "ay", + "az", + "ba", + "be", + "bg", + "bi", + "bm", + "bn", + "bo", + "br", + "bs", + "ca", + "ce", + "ch", + "co", + "cr", + "cs", + "cu", + "cv", + "cy", + "da", + "de", + "dv", + "dz", + "ee", + "el", + "en", + "eo", + "es", + "et", + "eu", + "fa", + "ff", + "fi", + "fj", + "fo", + "fr", + "fy", + "ga", + "gd", + "gl", + "gn", + "gu", + "gv", + "ha", + "he", + "hi", + "ho", + "hr", + "ht", + "hu", + "hy", + "hz", + "ia", + "id", + "ie", + "ig", + "ii", + "ik", + "io", + "is", + "it", + "iu", + "ja", + "jv", + "ka", + "kg", + "ki", + "kj", + "kk", + "kl", + "km", + "kn", + "ko", + "kr", + "ks", + "ku", + "kv", + "kw", + "ky", + "la", + "lb", + "lg", + "li", + "ln", + "lo", + "lt", + "lu", + "lv", + "mg", + "mh", + "mi", + "mk", + "ml", + "mn", + "mr", + "ms", + "mt", + "my", + "na", + "nb", + "nd", + "ne", + "ng", + "nl", + "nn", + "no", + "nr", + "nv", + "ny", + "oc", + "oj", + "om", + "or", + "os", + "pa", + "pi", + "pl", + "ps", + "pt", + "qu", + "rm", + "rn", + "ro", + "ru", + "rw", + "sa", + "sc", + "sd", + "se", + "sg", + "si", + "sk", + "sl", + "sm", + "sn", + "so", + "sq", + "sr", + "ss", + "st", + "su", + "sv", + "sw", + "ta", + "te", + "tg", + "th", + "ti", + "tk", + "tl", + "tn", + "to", + "tr", + "ts", + "tt", + "tw", + "ty", + "ug", + "uk", + "ur", + "uz", + "ve", + "vi", + "vo", + "wa", + "wo", + "xh", + "yi", + "yo", + "za", + "zh", + "zu" ] } } } -export const GetOrLoadFileRequest: any = { +export const SendBackboneNotificationRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetOrLoadFileRequest", + "$ref": "#/definitions/SendBackboneNotificationRequest", "definitions": { - "GetOrLoadFileRequest": { + "SendBackboneNotificationRequest": { "type": "object", "properties": { - "reference": { - "anyOf": [ - { - "$ref": "#/definitions/TokenReferenceString" - }, - { - "$ref": "#/definitions/FileReferenceString" - }, - { - "$ref": "#/definitions/URLTokenReferenceString" - }, - { - "$ref": "#/definitions/URLFileReferenceString" - } - ] + "recipients": { + "type": "array", + "items": { + "$ref": "#/definitions/AddressString" + } }, - "password": { + "code": { "type": "string" } }, "required": [ - "reference" + "recipients", + "code" ], - "additionalProperties": false, - "errorMessage": "token / file reference invalid" - }, - "TokenReferenceString": { - "type": "string", - "pattern": "VE9L.{84}" - }, - "FileReferenceString": { - "type": "string", - "pattern": "RklM.{84}" - }, - "URLTokenReferenceString": { - "type": "string", - "pattern": "^https?:\\/\\/.*\\/r\\/TOK[a-zA-Z0-9]+(\\?app=.+)?#[a-zA-Z0-9-_]+$" + "additionalProperties": false }, - "URLFileReferenceString": { + "AddressString": { "type": "string", - "pattern": "^https?:\\/\\/.*\\/r\\/FIL[a-zA-Z0-9]+(\\?app=.+)?#[a-zA-Z0-9-_]+$" + "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" } } } -export const RegenerateFileOwnershipTokenRequest: any = { +export const CreateRelationshipChallengeRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/RegenerateFileOwnershipTokenRequest", + "$ref": "#/definitions/CreateRelationshipChallengeRequest", "definitions": { - "RegenerateFileOwnershipTokenRequest": { + "CreateRelationshipChallengeRequest": { "type": "object", "properties": { - "id": { - "$ref": "#/definitions/FileIdString" + "challengeType": { + "type": "string", + "const": "Relationship" + }, + "relationship": { + "$ref": "#/definitions/RelationshipIdString" } }, "required": [ - "id" + "challengeType", + "relationship" ], "additionalProperties": false }, - "FileIdString": { + "RelationshipIdString": { "type": "string", - "pattern": "FIL[A-Za-z0-9]{17}" + "pattern": "REL[A-Za-z0-9]{17}" } } } -export const UploadOwnFileRequest: any = { +export const isCreateRelationshipChallengeRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/UploadOwnFileRequest", + "$ref": "#/definitions/isCreateRelationshipChallengeRequest", "definitions": { - "UploadOwnFileRequest": { + "isCreateRelationshipChallengeRequest": { + "$comment": "(value: any) => value is CreateRelationshipChallengeRequest", "type": "object", "properties": { - "content": { + "namedArgs": { "type": "object", "properties": { - "BYTES_PER_ELEMENT": { - "type": "number" - }, - "buffer": { - "type": "object", - "properties": { - "byteLength": { - "type": "number" - } - }, - "required": [ - "byteLength" - ], - "additionalProperties": false - }, - "byteLength": { - "type": "number" - }, - "byteOffset": { - "type": "number" - }, - "length": { - "type": "number" - } + "value": {} }, "required": [ - "BYTES_PER_ELEMENT", - "buffer", - "byteLength", - "byteOffset", - "length" + "value" ], - "additionalProperties": { - "type": "number" - } - }, - "filename": { - "type": "string" - }, - "mimetype": { - "type": "string" - }, - "expiresAt": { - "$ref": "#/definitions/ISO8601DateTimeString" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - }, - "uniqueItems": true - } - }, - "required": [ - "content", - "filename", - "mimetype" - ], - "additionalProperties": false - }, - "ISO8601DateTimeString": { - "type": "string", - "errorMessage": "must match ISO8601 datetime format", - "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" - } - } -} - -export const UploadOwnFileValidatableRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/UploadOwnFileValidatableRequest", - "definitions": { - "UploadOwnFileValidatableRequest": { - "type": "object", - "properties": { - "filename": { - "type": "string" - }, - "mimetype": { - "type": "string" - }, - "expiresAt": { - "$ref": "#/definitions/ISO8601DateTimeString" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - }, - "uniqueItems": true - }, - "content": { - "type": "object" + "additionalProperties": false } - }, - "required": [ - "content", - "filename", - "mimetype" - ], - "additionalProperties": false - }, - "ISO8601DateTimeString": { - "type": "string", - "errorMessage": "must match ISO8601 datetime format", - "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" + } } } } -export const GetIdentityDeletionProcessRequest: any = { +export const CreateIdentityChallengeRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetIdentityDeletionProcessRequest", + "$ref": "#/definitions/CreateIdentityChallengeRequest", "definitions": { - "GetIdentityDeletionProcessRequest": { + "CreateIdentityChallengeRequest": { "type": "object", "properties": { - "id": { - "$ref": "#/definitions/IdentityDeletionProcessIdString" + "challengeType": { + "type": "string", + "const": "Identity" } }, "required": [ - "id" + "challengeType" ], "additionalProperties": false - }, - "IdentityDeletionProcessIdString": { - "type": "string", - "pattern": "IDP[A-Za-z0-9]{17}" } } } -export const InitiateIdentityDeletionProcessRequest: any = { +export const isCreateIdentityChallengeRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/InitiateIdentityDeletionProcessRequest", + "$ref": "#/definitions/isCreateIdentityChallengeRequest", "definitions": { - "InitiateIdentityDeletionProcessRequest": { + "isCreateIdentityChallengeRequest": { + "$comment": "(value: any) => value is CreateIdentityChallengeRequest", "type": "object", "properties": { - "lengthOfGracePeriodInDays": { - "type": "number" + "namedArgs": { + "type": "object", + "properties": { + "value": {} + }, + "required": [ + "value" + ], + "additionalProperties": false } - }, - "additionalProperties": false + } } } } -export const DownloadAttachmentRequest: any = { +export const CreateDeviceChallengeRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/DownloadAttachmentRequest", + "$ref": "#/definitions/CreateDeviceChallengeRequest", "definitions": { - "DownloadAttachmentRequest": { + "CreateDeviceChallengeRequest": { "type": "object", "properties": { - "id": { - "$ref": "#/definitions/MessageIdString" - }, - "attachmentId": { - "$ref": "#/definitions/FileIdString" + "challengeType": { + "type": "string", + "const": "Device" } }, "required": [ - "id", - "attachmentId" + "challengeType" ], "additionalProperties": false - }, - "MessageIdString": { - "type": "string", - "pattern": "MSG[A-Za-z0-9]{17}" - }, - "FileIdString": { - "type": "string", - "pattern": "FIL[A-Za-z0-9]{17}" } } } -export const GetAnnouncementsRequest: any = { +export const isCreateDeviceChallengeRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetAnnouncementsRequest", + "$ref": "#/definitions/isCreateDeviceChallengeRequest", "definitions": { - "GetAnnouncementsRequest": { + "isCreateDeviceChallengeRequest": { + "$comment": "(value: any) => value is CreateDeviceChallengeRequest", "type": "object", "properties": { - "language": { - "$ref": "#/definitions/LanguageISO639" + "namedArgs": { + "type": "object", + "properties": { + "value": {} + }, + "required": [ + "value" + ], + "additionalProperties": false } - }, - "required": [ - "language" - ], - "additionalProperties": false - }, - "LanguageISO639": { - "type": "string", - "enum": [ - "aa", - "ab", - "ae", - "af", - "ak", - "am", - "an", - "ar", - "as", - "av", - "ay", - "az", - "ba", - "be", - "bg", - "bi", - "bm", - "bn", - "bo", - "br", - "bs", - "ca", - "ce", - "ch", - "co", - "cr", - "cs", - "cu", - "cv", - "cy", - "da", - "de", - "dv", - "dz", - "ee", - "el", - "en", - "eo", - "es", - "et", - "eu", - "fa", - "ff", - "fi", - "fj", - "fo", - "fr", - "fy", - "ga", - "gd", - "gl", - "gn", - "gu", - "gv", - "ha", - "he", - "hi", - "ho", - "hr", - "ht", - "hu", - "hy", - "hz", - "ia", - "id", - "ie", - "ig", - "ii", - "ik", - "io", - "is", - "it", - "iu", - "ja", - "jv", - "ka", - "kg", - "ki", - "kj", - "kk", - "kl", - "km", - "kn", - "ko", - "kr", - "ks", - "ku", - "kv", - "kw", - "ky", - "la", - "lb", - "lg", - "li", - "ln", - "lo", - "lt", - "lu", - "lv", - "mg", - "mh", - "mi", - "mk", - "ml", - "mn", - "mr", - "ms", - "mt", - "my", - "na", - "nb", - "nd", - "ne", - "ng", - "nl", - "nn", - "no", - "nr", - "nv", - "ny", - "oc", - "oj", - "om", - "or", - "os", - "pa", - "pi", - "pl", - "ps", - "pt", - "qu", - "rm", - "rn", - "ro", - "ru", - "rw", - "sa", - "sc", - "sd", - "se", - "sg", - "si", - "sk", - "sl", - "sm", - "sn", - "so", - "sq", - "sr", - "ss", - "st", - "su", - "sv", - "sw", - "ta", - "te", - "tg", - "th", - "ti", - "tk", - "tl", - "tn", - "to", - "tr", - "ts", - "tt", - "tw", - "ty", - "ug", - "uk", - "ur", - "uz", - "ve", - "vi", - "vo", - "wa", - "wo", - "xh", - "yi", - "yo", - "za", - "zh", - "zu" - ] + } } } } -export const SendBackboneNotificationRequest: any = { +export const CreateChallengeRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/SendBackboneNotificationRequest", + "$ref": "#/definitions/CreateChallengeRequest", "definitions": { - "SendBackboneNotificationRequest": { - "type": "object", - "properties": { - "recipients": { - "type": "array", - "items": { - "$ref": "#/definitions/AddressString" - } + "CreateChallengeRequest": { + "anyOf": [ + { + "$ref": "#/definitions/CreateRelationshipChallengeRequest" }, - "code": { - "type": "string" + { + "$ref": "#/definitions/CreateIdentityChallengeRequest" + }, + { + "$ref": "#/definitions/CreateDeviceChallengeRequest" } - }, - "required": [ - "recipients", - "code" - ], - "additionalProperties": false - }, - "AddressString": { - "type": "string", - "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" - } - } -} - -export const CreateRelationshipChallengeRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateRelationshipChallengeRequest", - "definitions": { - "CreateRelationshipChallengeRequest": { - "type": "object", - "properties": { - "challengeType": { - "type": "string", - "const": "Relationship" - }, - "relationship": { - "$ref": "#/definitions/RelationshipIdString" - } - }, - "required": [ - "challengeType", - "relationship" - ], - "additionalProperties": false - }, - "RelationshipIdString": { - "type": "string", - "pattern": "REL[A-Za-z0-9]{17}" - } - } -} - -export const isCreateRelationshipChallengeRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/isCreateRelationshipChallengeRequest", - "definitions": { - "isCreateRelationshipChallengeRequest": { - "$comment": "(value: any) => value is CreateRelationshipChallengeRequest", - "type": "object", - "properties": { - "namedArgs": { - "type": "object", - "properties": { - "value": {} - }, - "required": [ - "value" - ], - "additionalProperties": false - } - } - } - } -} - -export const CreateIdentityChallengeRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateIdentityChallengeRequest", - "definitions": { - "CreateIdentityChallengeRequest": { - "type": "object", - "properties": { - "challengeType": { - "type": "string", - "const": "Identity" - } - }, - "required": [ - "challengeType" - ], - "additionalProperties": false - } - } -} - -export const isCreateIdentityChallengeRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/isCreateIdentityChallengeRequest", - "definitions": { - "isCreateIdentityChallengeRequest": { - "$comment": "(value: any) => value is CreateIdentityChallengeRequest", - "type": "object", - "properties": { - "namedArgs": { - "type": "object", - "properties": { - "value": {} - }, - "required": [ - "value" - ], - "additionalProperties": false - } - } - } - } -} - -export const CreateDeviceChallengeRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateDeviceChallengeRequest", - "definitions": { - "CreateDeviceChallengeRequest": { - "type": "object", - "properties": { - "challengeType": { - "type": "string", - "const": "Device" - } - }, - "required": [ - "challengeType" - ], - "additionalProperties": false - } - } -} - -export const isCreateDeviceChallengeRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/isCreateDeviceChallengeRequest", - "definitions": { - "isCreateDeviceChallengeRequest": { - "$comment": "(value: any) => value is CreateDeviceChallengeRequest", - "type": "object", - "properties": { - "namedArgs": { - "type": "object", - "properties": { - "value": {} - }, - "required": [ - "value" - ], - "additionalProperties": false - } - } - } - } -} - -export const CreateChallengeRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateChallengeRequest", - "definitions": { - "CreateChallengeRequest": { - "anyOf": [ - { - "$ref": "#/definitions/CreateRelationshipChallengeRequest" - }, - { - "$ref": "#/definitions/CreateIdentityChallengeRequest" - }, - { - "$ref": "#/definitions/CreateDeviceChallengeRequest" - } - ] + ] }, "CreateRelationshipChallengeRequest": { "type": "object", @@ -19335,289 +18661,631 @@ export const SetCommunicationLanguageRequest: any = { } }, "required": [ - "communicationLanguage" + "communicationLanguage" + ], + "additionalProperties": false + } + } +} + +export const UpdateCurrentDeviceRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/UpdateCurrentDeviceRequest", + "definitions": { + "UpdateCurrentDeviceRequest": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + } + }, + "additionalProperties": false + } + } +} + +export const UpdateDeviceRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/UpdateDeviceRequest", + "definitions": { + "UpdateDeviceRequest": { + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/DeviceIdString" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + } + }, + "required": [ + "id" + ], + "additionalProperties": false + }, + "DeviceIdString": { + "type": "string", + "pattern": "DVC[A-Za-z0-9]{17}" + } + } +} + +export const CreateIdentityRecoveryKitRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/CreateIdentityRecoveryKitRequest", + "definitions": { + "CreateIdentityRecoveryKitRequest": { + "type": "object", + "properties": { + "profileName": { + "type": "string" + }, + "passwordProtection": { + "type": "object", + "properties": { + "password": { + "type": "string", + "minLength": 1 + }, + "passwordIsPin": { + "type": "boolean", + "const": true + } + }, + "required": [ + "password" + ], + "additionalProperties": false + } + }, + "required": [ + "profileName", + "passwordProtection" + ], + "additionalProperties": false + } + } +} + +export const GetAttachmentMetadataRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/GetAttachmentMetadataRequest", + "definitions": { + "GetAttachmentMetadataRequest": { + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/MessageIdString" + }, + "attachmentId": { + "$ref": "#/definitions/FileIdString" + } + }, + "required": [ + "id", + "attachmentId" + ], + "additionalProperties": false + }, + "MessageIdString": { + "type": "string", + "pattern": "MSG[A-Za-z0-9]{17}" + }, + "FileIdString": { + "type": "string", + "pattern": "FIL[A-Za-z0-9]{17}" + } + } +} + +export const GetMessageRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/GetMessageRequest", + "definitions": { + "GetMessageRequest": { + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/MessageIdString" + } + }, + "required": [ + "id" + ], + "additionalProperties": false + }, + "MessageIdString": { + "type": "string", + "pattern": "MSG[A-Za-z0-9]{17}" + } + } +} + +export const GetMessagesRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/GetMessagesRequest", + "definitions": { + "GetMessagesRequest": { + "type": "object", + "properties": { + "query": { + "$ref": "#/definitions/GetMessagesQuery" + } + }, + "additionalProperties": false + }, + "GetMessagesQuery": { + "type": "object", + "properties": { + "isOwn": { + "type": "string" + }, + "createdBy": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "createdByDevice": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "createdAt": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "content.@type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "content.body": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "content.bodyFormat": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "content.subject": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "attachments": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "recipients.address": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "recipients.relationshipId": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "wasReadAt": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "participant": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, + "additionalProperties": false + } + } +} + +export const MarkMessageAsReadRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/MarkMessageAsReadRequest", + "definitions": { + "MarkMessageAsReadRequest": { + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/MessageIdString" + } + }, + "required": [ + "id" ], "additionalProperties": false + }, + "MessageIdString": { + "type": "string", + "pattern": "MSG[A-Za-z0-9]{17}" } } } -export const UpdateCurrentDeviceRequest: any = { +export const MarkMessageAsUnreadRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/UpdateCurrentDeviceRequest", + "$ref": "#/definitions/MarkMessageAsUnreadRequest", "definitions": { - "UpdateCurrentDeviceRequest": { + "MarkMessageAsUnreadRequest": { "type": "object", "properties": { - "name": { - "type": "string" + "id": { + "$ref": "#/definitions/MessageIdString" + } + }, + "required": [ + "id" + ], + "additionalProperties": false + }, + "MessageIdString": { + "type": "string", + "pattern": "MSG[A-Za-z0-9]{17}" + } + } +} + +export const SendMessageRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/SendMessageRequest", + "definitions": { + "SendMessageRequest": { + "type": "object", + "additionalProperties": false, + "properties": { + "recipients": { + "type": "array", + "items": { + "$ref": "#/definitions/AddressString" + }, + "minItems": 1, + "uniqueItems": true }, - "description": { - "type": "string" + "content": {}, + "attachments": { + "type": "array", + "items": { + "$ref": "#/definitions/FileIdString" + }, + "uniqueItems": true + } + }, + "required": [ + "content", + "recipients" + ] + }, + "AddressString": { + "type": "string", + "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" + }, + "FileIdString": { + "type": "string", + "pattern": "FIL[A-Za-z0-9]{17}" + } + } +} + +export const AcceptRelationshipRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/AcceptRelationshipRequest", + "definitions": { + "AcceptRelationshipRequest": { + "type": "object", + "properties": { + "relationshipId": { + "$ref": "#/definitions/RelationshipIdString" + } + }, + "required": [ + "relationshipId" + ], + "additionalProperties": false + }, + "RelationshipIdString": { + "type": "string", + "pattern": "REL[A-Za-z0-9]{17}" + } + } +} + +export const AcceptRelationshipReactivationRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/AcceptRelationshipReactivationRequest", + "definitions": { + "AcceptRelationshipReactivationRequest": { + "type": "object", + "properties": { + "relationshipId": { + "$ref": "#/definitions/RelationshipIdString" } }, + "required": [ + "relationshipId" + ], "additionalProperties": false + }, + "RelationshipIdString": { + "type": "string", + "pattern": "REL[A-Za-z0-9]{17}" } } } -export const UpdateDeviceRequest: any = { +export const CanCreateRelationshipRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/UpdateDeviceRequest", + "$ref": "#/definitions/CanCreateRelationshipRequest", "definitions": { - "UpdateDeviceRequest": { + "CanCreateRelationshipRequest": { "type": "object", "properties": { - "id": { - "$ref": "#/definitions/DeviceIdString" + "templateId": { + "$ref": "#/definitions/RelationshipTemplateIdString" }, - "name": { - "type": "string" + "creationContent": {} + }, + "required": [ + "templateId" + ], + "additionalProperties": false + }, + "RelationshipTemplateIdString": { + "type": "string", + "pattern": "RLT[A-Za-z0-9]{17}" + } + } +} + +export const CreateRelationshipRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/CreateRelationshipRequest", + "definitions": { + "CreateRelationshipRequest": { + "type": "object", + "properties": { + "templateId": { + "$ref": "#/definitions/RelationshipTemplateIdString" }, - "description": { - "type": "string" + "creationContent": {} + }, + "required": [ + "templateId", + "creationContent" + ], + "additionalProperties": false + }, + "RelationshipTemplateIdString": { + "type": "string", + "pattern": "RLT[A-Za-z0-9]{17}" + } + } +} + +export const DecomposeRelationshipRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/DecomposeRelationshipRequest", + "definitions": { + "DecomposeRelationshipRequest": { + "type": "object", + "properties": { + "relationshipId": { + "$ref": "#/definitions/RelationshipIdString" } }, "required": [ - "id" + "relationshipId" ], "additionalProperties": false }, - "DeviceIdString": { + "RelationshipIdString": { "type": "string", - "pattern": "DVC[A-Za-z0-9]{17}" + "pattern": "REL[A-Za-z0-9]{17}" } } } -export const CreateIdentityRecoveryKitRequest: any = { +export const GetAttributesForRelationshipRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateIdentityRecoveryKitRequest", + "$ref": "#/definitions/GetAttributesForRelationshipRequest", "definitions": { - "CreateIdentityRecoveryKitRequest": { + "GetAttributesForRelationshipRequest": { "type": "object", "properties": { - "profileName": { - "type": "string" + "id": { + "$ref": "#/definitions/RelationshipIdString" }, - "passwordProtection": { - "type": "object", - "properties": { - "password": { - "type": "string", - "minLength": 1 - }, - "passwordIsPin": { - "type": "boolean", - "const": true - } - }, - "required": [ - "password" - ], - "additionalProperties": false + "hideTechnical": { + "type": "boolean" + }, + "onlyLatestVersions": { + "type": "boolean", + "description": "default: true" } }, "required": [ - "profileName", - "passwordProtection" + "id" ], "additionalProperties": false + }, + "RelationshipIdString": { + "type": "string", + "pattern": "REL[A-Za-z0-9]{17}" } } } -export const GetAttachmentMetadataRequest: any = { +export const GetRelationshipRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetAttachmentMetadataRequest", + "$ref": "#/definitions/GetRelationshipRequest", "definitions": { - "GetAttachmentMetadataRequest": { + "GetRelationshipRequest": { "type": "object", "properties": { "id": { - "$ref": "#/definitions/MessageIdString" - }, - "attachmentId": { - "$ref": "#/definitions/FileIdString" + "$ref": "#/definitions/RelationshipIdString" } }, "required": [ - "id", - "attachmentId" + "id" ], "additionalProperties": false }, - "MessageIdString": { - "type": "string", - "pattern": "MSG[A-Za-z0-9]{17}" - }, - "FileIdString": { + "RelationshipIdString": { "type": "string", - "pattern": "FIL[A-Za-z0-9]{17}" + "pattern": "REL[A-Za-z0-9]{17}" } } } -export const GetMessageRequest: any = { +export const GetRelationshipByAddressRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetMessageRequest", + "$ref": "#/definitions/GetRelationshipByAddressRequest", "definitions": { - "GetMessageRequest": { + "GetRelationshipByAddressRequest": { "type": "object", "properties": { - "id": { - "$ref": "#/definitions/MessageIdString" + "address": { + "$ref": "#/definitions/AddressString" } }, "required": [ - "id" + "address" ], "additionalProperties": false }, - "MessageIdString": { + "AddressString": { "type": "string", - "pattern": "MSG[A-Za-z0-9]{17}" + "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" } } } -export const GetMessagesRequest: any = { +export const GetRelationshipsRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetMessagesRequest", + "$ref": "#/definitions/GetRelationshipsRequest", "definitions": { - "GetMessagesRequest": { + "GetRelationshipsRequest": { "type": "object", "properties": { "query": { - "$ref": "#/definitions/GetMessagesQuery" + "$ref": "#/definitions/GetRelationshipsQuery" } }, "additionalProperties": false }, - "GetMessagesQuery": { + "GetRelationshipsQuery": { "type": "object", "properties": { - "isOwn": { - "type": "string" - }, - "createdBy": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "createdByDevice": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "createdAt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "content.@type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "content.body": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "content.bodyFormat": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "content.subject": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "attachments": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "recipients.address": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "recipients.relationshipId": { + "peer": { "anyOf": [ { "type": "string" @@ -19630,7 +19298,7 @@ export const GetMessagesRequest: any = { } ] }, - "wasReadAt": { + "status": { "anyOf": [ { "type": "string" @@ -19643,7 +19311,7 @@ export const GetMessagesRequest: any = { } ] }, - "participant": { + "templateId": { "anyOf": [ { "type": "string" @@ -19662,98 +19330,57 @@ export const GetMessagesRequest: any = { } } -export const MarkMessageAsReadRequest: any = { +export const RejectRelationshipRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/MarkMessageAsReadRequest", + "$ref": "#/definitions/RejectRelationshipRequest", "definitions": { - "MarkMessageAsReadRequest": { + "RejectRelationshipRequest": { "type": "object", "properties": { - "id": { - "$ref": "#/definitions/MessageIdString" + "relationshipId": { + "$ref": "#/definitions/RelationshipIdString" } }, "required": [ - "id" + "relationshipId" ], "additionalProperties": false }, - "MessageIdString": { + "RelationshipIdString": { "type": "string", - "pattern": "MSG[A-Za-z0-9]{17}" + "pattern": "REL[A-Za-z0-9]{17}" } } } -export const MarkMessageAsUnreadRequest: any = { +export const RejectRelationshipReactivationRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/MarkMessageAsUnreadRequest", + "$ref": "#/definitions/RejectRelationshipReactivationRequest", "definitions": { - "MarkMessageAsUnreadRequest": { + "RejectRelationshipReactivationRequest": { "type": "object", "properties": { - "id": { - "$ref": "#/definitions/MessageIdString" + "relationshipId": { + "$ref": "#/definitions/RelationshipIdString" } }, "required": [ - "id" + "relationshipId" ], "additionalProperties": false }, - "MessageIdString": { - "type": "string", - "pattern": "MSG[A-Za-z0-9]{17}" - } - } -} - -export const SendMessageRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/SendMessageRequest", - "definitions": { - "SendMessageRequest": { - "type": "object", - "additionalProperties": false, - "properties": { - "recipients": { - "type": "array", - "items": { - "$ref": "#/definitions/AddressString" - }, - "minItems": 1, - "uniqueItems": true - }, - "content": {}, - "attachments": { - "type": "array", - "items": { - "$ref": "#/definitions/FileIdString" - }, - "uniqueItems": true - } - }, - "required": [ - "content", - "recipients" - ] - }, - "AddressString": { - "type": "string", - "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" - }, - "FileIdString": { + "RelationshipIdString": { "type": "string", - "pattern": "FIL[A-Za-z0-9]{17}" + "pattern": "REL[A-Za-z0-9]{17}" } } } -export const AcceptRelationshipRequest: any = { +export const RequestRelationshipReactivationRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/AcceptRelationshipRequest", + "$ref": "#/definitions/RequestRelationshipReactivationRequest", "definitions": { - "AcceptRelationshipRequest": { + "RequestRelationshipReactivationRequest": { "type": "object", "properties": { "relationshipId": { @@ -19772,11 +19399,11 @@ export const AcceptRelationshipRequest: any = { } } -export const AcceptRelationshipReactivationRequest: any = { +export const RevokeRelationshipRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/AcceptRelationshipReactivationRequest", + "$ref": "#/definitions/RevokeRelationshipRequest", "definitions": { - "AcceptRelationshipReactivationRequest": { + "RevokeRelationshipRequest": { "type": "object", "properties": { "relationshipId": { @@ -19795,171 +19422,297 @@ export const AcceptRelationshipReactivationRequest: any = { } } -export const CanCreateRelationshipRequest: any = { +export const RevokeRelationshipReactivationRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CanCreateRelationshipRequest", + "$ref": "#/definitions/RevokeRelationshipReactivationRequest", "definitions": { - "CanCreateRelationshipRequest": { + "RevokeRelationshipReactivationRequest": { "type": "object", "properties": { - "templateId": { - "$ref": "#/definitions/RelationshipTemplateIdString" - }, - "creationContent": {} + "relationshipId": { + "$ref": "#/definitions/RelationshipIdString" + } }, "required": [ - "templateId" + "relationshipId" ], "additionalProperties": false }, - "RelationshipTemplateIdString": { + "RelationshipIdString": { "type": "string", - "pattern": "RLT[A-Za-z0-9]{17}" + "pattern": "REL[A-Za-z0-9]{17}" } } } -export const CreateRelationshipRequest: any = { +export const TerminateRelationshipRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateRelationshipRequest", + "$ref": "#/definitions/TerminateRelationshipRequest", "definitions": { - "CreateRelationshipRequest": { + "TerminateRelationshipRequest": { "type": "object", "properties": { - "templateId": { - "$ref": "#/definitions/RelationshipTemplateIdString" - }, - "creationContent": {} + "relationshipId": { + "$ref": "#/definitions/RelationshipIdString" + } }, "required": [ - "templateId", - "creationContent" + "relationshipId" ], "additionalProperties": false }, - "RelationshipTemplateIdString": { + "RelationshipIdString": { "type": "string", - "pattern": "RLT[A-Za-z0-9]{17}" + "pattern": "REL[A-Za-z0-9]{17}" } } } -export const DecomposeRelationshipRequest: any = { +export const CreateOwnRelationshipTemplateRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/DecomposeRelationshipRequest", + "$ref": "#/definitions/CreateOwnRelationshipTemplateRequest", "definitions": { - "DecomposeRelationshipRequest": { + "CreateOwnRelationshipTemplateRequest": { "type": "object", "properties": { - "relationshipId": { - "$ref": "#/definitions/RelationshipIdString" + "expiresAt": { + "$ref": "#/definitions/ISO8601DateTimeString" + }, + "content": {}, + "maxNumberOfAllocations": { + "type": "number", + "minimum": 1 + }, + "forIdentity": { + "$ref": "#/definitions/AddressString" + }, + "passwordProtection": { + "type": "object", + "properties": { + "password": { + "type": "string", + "minLength": 1 + }, + "passwordIsPin": { + "type": "boolean", + "const": true + }, + "passwordLocationIndicator": {} + }, + "required": [ + "password" + ], + "additionalProperties": false } }, "required": [ - "relationshipId" + "expiresAt", + "content" ], "additionalProperties": false }, - "RelationshipIdString": { + "ISO8601DateTimeString": { "type": "string", - "pattern": "REL[A-Za-z0-9]{17}" + "errorMessage": "must match ISO8601 datetime format", + "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" + }, + "AddressString": { + "type": "string", + "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" } } } -export const GetAttributesForRelationshipRequest: any = { +export const CreateTokenForOwnRelationshipTemplateRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetAttributesForRelationshipRequest", + "$ref": "#/definitions/CreateTokenForOwnRelationshipTemplateRequest", "definitions": { - "GetAttributesForRelationshipRequest": { + "CreateTokenForOwnRelationshipTemplateRequest": { "type": "object", "properties": { - "id": { - "$ref": "#/definitions/RelationshipIdString" + "templateId": { + "$ref": "#/definitions/RelationshipTemplateIdString" }, - "hideTechnical": { + "expiresAt": { + "$ref": "#/definitions/ISO8601DateTimeString" + }, + "ephemeral": { "type": "boolean" }, - "onlyLatestVersions": { - "type": "boolean", - "description": "default: true" + "forIdentity": { + "$ref": "#/definitions/AddressString" + }, + "passwordProtection": { + "type": "object", + "properties": { + "password": { + "type": "string", + "minLength": 1 + }, + "passwordIsPin": { + "type": "boolean", + "const": true + }, + "passwordLocationIndicator": {} + }, + "required": [ + "password" + ], + "additionalProperties": false } }, "required": [ - "id" + "templateId" ], "additionalProperties": false }, - "RelationshipIdString": { + "RelationshipTemplateIdString": { "type": "string", - "pattern": "REL[A-Za-z0-9]{17}" + "pattern": "RLT[A-Za-z0-9]{17}" + }, + "ISO8601DateTimeString": { + "type": "string", + "errorMessage": "must match ISO8601 datetime format", + "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" + }, + "AddressString": { + "type": "string", + "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" } } } -export const GetRelationshipRequest: any = { +export const DeleteRelationshipTemplateRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetRelationshipRequest", + "$ref": "#/definitions/DeleteRelationshipTemplateRequest", "definitions": { - "GetRelationshipRequest": { + "DeleteRelationshipTemplateRequest": { "type": "object", "properties": { - "id": { - "$ref": "#/definitions/RelationshipIdString" + "templateId": { + "$ref": "#/definitions/RelationshipTemplateIdString" } }, "required": [ - "id" + "templateId" ], "additionalProperties": false }, - "RelationshipIdString": { + "RelationshipTemplateIdString": { "type": "string", - "pattern": "REL[A-Za-z0-9]{17}" + "pattern": "RLT[A-Za-z0-9]{17}" } } } -export const GetRelationshipByAddressRequest: any = { +export const GetRelationshipTemplateRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetRelationshipByAddressRequest", + "$ref": "#/definitions/GetRelationshipTemplateRequest", "definitions": { - "GetRelationshipByAddressRequest": { + "GetRelationshipTemplateRequest": { "type": "object", "properties": { - "address": { - "$ref": "#/definitions/AddressString" + "id": { + "$ref": "#/definitions/RelationshipTemplateIdString" } }, "required": [ - "address" + "id" ], "additionalProperties": false }, - "AddressString": { + "RelationshipTemplateIdString": { "type": "string", - "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" + "pattern": "RLT[A-Za-z0-9]{17}" } } } -export const GetRelationshipsRequest: any = { +export const GetRelationshipTemplatesRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetRelationshipsRequest", + "$ref": "#/definitions/GetRelationshipTemplatesRequest", "definitions": { - "GetRelationshipsRequest": { + "GetRelationshipTemplatesRequest": { "type": "object", "properties": { "query": { - "$ref": "#/definitions/GetRelationshipsQuery" + "$ref": "#/definitions/GetRelationshipTemplatesQuery" + }, + "ownerRestriction": { + "$ref": "#/definitions/OwnerRestriction" } }, "additionalProperties": false }, - "GetRelationshipsQuery": { + "GetRelationshipTemplatesQuery": { "type": "object", "properties": { - "peer": { + "isOwn": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "createdAt": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "expiresAt": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "createdBy": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "createdByDevice": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "maxNumberOfAllocations": { "anyOf": [ { "type": "string" @@ -19972,7 +19725,7 @@ export const GetRelationshipsRequest: any = { } ] }, - "status": { + "forIdentity": { "anyOf": [ { "type": "string" @@ -19985,7 +19738,34 @@ export const GetRelationshipsRequest: any = { } ] }, - "templateId": { + "passwordProtection": { + "type": "string", + "enum": [ + "", + "!" + ] + }, + "passwordProtection.password": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "passwordProtection.passwordIsPin": { + "type": "string", + "enum": [ + "true", + "!" + ] + }, + "passwordProtection.passwordLocationIndicator": { "anyOf": [ { "type": "string" @@ -20000,213 +19780,77 @@ export const GetRelationshipsRequest: any = { } }, "additionalProperties": false - } - } -} - -export const RejectRelationshipRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/RejectRelationshipRequest", - "definitions": { - "RejectRelationshipRequest": { - "type": "object", - "properties": { - "relationshipId": { - "$ref": "#/definitions/RelationshipIdString" - } - }, - "required": [ - "relationshipId" - ], - "additionalProperties": false - }, - "RelationshipIdString": { - "type": "string", - "pattern": "REL[A-Za-z0-9]{17}" - } - } -} - -export const RejectRelationshipReactivationRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/RejectRelationshipReactivationRequest", - "definitions": { - "RejectRelationshipReactivationRequest": { - "type": "object", - "properties": { - "relationshipId": { - "$ref": "#/definitions/RelationshipIdString" - } - }, - "required": [ - "relationshipId" - ], - "additionalProperties": false }, - "RelationshipIdString": { + "OwnerRestriction": { "type": "string", - "pattern": "REL[A-Za-z0-9]{17}" + "enum": [ + "o", + "p" + ] } } } -export const RequestRelationshipReactivationRequest: any = { +export const LoadPeerRelationshipTemplateRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/RequestRelationshipReactivationRequest", + "$ref": "#/definitions/LoadPeerRelationshipTemplateRequest", "definitions": { - "RequestRelationshipReactivationRequest": { + "LoadPeerRelationshipTemplateRequest": { "type": "object", "properties": { - "relationshipId": { - "$ref": "#/definitions/RelationshipIdString" + "reference": { + "anyOf": [ + { + "$ref": "#/definitions/TokenReferenceString" + }, + { + "$ref": "#/definitions/RelationshipTemplateReferenceString" + }, + { + "$ref": "#/definitions/URLTokenReferenceString" + }, + { + "$ref": "#/definitions/URLRelationshipTemplateReferenceString" + } + ] + }, + "password": { + "type": "string" } }, "required": [ - "relationshipId" + "reference" ], - "additionalProperties": false + "additionalProperties": false, + "errorMessage": "token / relationship template reference invalid" }, - "RelationshipIdString": { + "TokenReferenceString": { "type": "string", - "pattern": "REL[A-Za-z0-9]{17}" - } - } -} - -export const RevokeRelationshipRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/RevokeRelationshipRequest", - "definitions": { - "RevokeRelationshipRequest": { - "type": "object", - "properties": { - "relationshipId": { - "$ref": "#/definitions/RelationshipIdString" - } - }, - "required": [ - "relationshipId" - ], - "additionalProperties": false + "pattern": "VE9L.{84}" }, - "RelationshipIdString": { + "RelationshipTemplateReferenceString": { "type": "string", - "pattern": "REL[A-Za-z0-9]{17}" - } - } -} - -export const RevokeRelationshipReactivationRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/RevokeRelationshipReactivationRequest", - "definitions": { - "RevokeRelationshipReactivationRequest": { - "type": "object", - "properties": { - "relationshipId": { - "$ref": "#/definitions/RelationshipIdString" - } - }, - "required": [ - "relationshipId" - ], - "additionalProperties": false + "pattern": "UkxU.{84}" }, - "RelationshipIdString": { + "URLTokenReferenceString": { "type": "string", - "pattern": "REL[A-Za-z0-9]{17}" - } - } -} - -export const TerminateRelationshipRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/TerminateRelationshipRequest", - "definitions": { - "TerminateRelationshipRequest": { - "type": "object", - "properties": { - "relationshipId": { - "$ref": "#/definitions/RelationshipIdString" - } - }, - "required": [ - "relationshipId" - ], - "additionalProperties": false + "pattern": "^https?:\\/\\/.*\\/r\\/TOK[a-zA-Z0-9]+(\\?app=.+)?#[a-zA-Z0-9-_]+$" }, - "RelationshipIdString": { + "URLRelationshipTemplateReferenceString": { "type": "string", - "pattern": "REL[A-Za-z0-9]{17}" + "pattern": "^https?:\\/\\/.*\\/r\\/RLT[a-zA-Z0-9]+(\\?app=.+)?#[a-zA-Z0-9-_]+$" } } } -export const CreateOwnRelationshipTemplateRequest: any = { +export const CreateOwnTokenRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateOwnRelationshipTemplateRequest", + "$ref": "#/definitions/CreateOwnTokenRequest", "definitions": { - "CreateOwnRelationshipTemplateRequest": { + "CreateOwnTokenRequest": { "type": "object", "properties": { - "expiresAt": { - "$ref": "#/definitions/ISO8601DateTimeString" - }, "content": {}, - "maxNumberOfAllocations": { - "type": "number", - "minimum": 1 - }, - "forIdentity": { - "$ref": "#/definitions/AddressString" - }, - "passwordProtection": { - "type": "object", - "properties": { - "password": { - "type": "string", - "minLength": 1 - }, - "passwordIsPin": { - "type": "boolean", - "const": true - }, - "passwordLocationIndicator": {} - }, - "required": [ - "password" - ], - "additionalProperties": false - } - }, - "required": [ - "expiresAt", - "content" - ], - "additionalProperties": false - }, - "ISO8601DateTimeString": { - "type": "string", - "errorMessage": "must match ISO8601 datetime format", - "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" - }, - "AddressString": { - "type": "string", - "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" - } - } -} - -export const CreateTokenForOwnRelationshipTemplateRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateTokenForOwnRelationshipTemplateRequest", - "definitions": { - "CreateTokenForOwnRelationshipTemplateRequest": { - "type": "object", - "properties": { - "templateId": { - "$ref": "#/definitions/RelationshipTemplateIdString" - }, "expiresAt": { "$ref": "#/definitions/ISO8601DateTimeString" }, @@ -20236,13 +19880,11 @@ export const CreateTokenForOwnRelationshipTemplateRequest: any = { } }, "required": [ - "templateId" + "content", + "expiresAt", + "ephemeral" ], - "additionalProperties": false - }, - "RelationshipTemplateIdString": { - "type": "string", - "pattern": "RLT[A-Za-z0-9]{17}" + "additionalProperties": false }, "ISO8601DateTimeString": { "type": "string", @@ -20256,38 +19898,38 @@ export const CreateTokenForOwnRelationshipTemplateRequest: any = { } } -export const DeleteRelationshipTemplateRequest: any = { +export const DeleteTokenRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/DeleteRelationshipTemplateRequest", + "$ref": "#/definitions/DeleteTokenRequest", "definitions": { - "DeleteRelationshipTemplateRequest": { + "DeleteTokenRequest": { "type": "object", "properties": { - "templateId": { - "$ref": "#/definitions/RelationshipTemplateIdString" + "tokenId": { + "$ref": "#/definitions/TokenIdString" } }, "required": [ - "templateId" + "tokenId" ], "additionalProperties": false }, - "RelationshipTemplateIdString": { + "TokenIdString": { "type": "string", - "pattern": "RLT[A-Za-z0-9]{17}" + "pattern": "TOK[A-Za-z0-9]{17}" } } } -export const GetRelationshipTemplateRequest: any = { +export const GetTokenRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetRelationshipTemplateRequest", + "$ref": "#/definitions/GetTokenRequest", "definitions": { - "GetRelationshipTemplateRequest": { + "GetTokenRequest": { "type": "object", "properties": { "id": { - "$ref": "#/definitions/RelationshipTemplateIdString" + "$ref": "#/definitions/TokenIdString" } }, "required": [ @@ -20295,22 +19937,22 @@ export const GetRelationshipTemplateRequest: any = { ], "additionalProperties": false }, - "RelationshipTemplateIdString": { + "TokenIdString": { "type": "string", - "pattern": "RLT[A-Za-z0-9]{17}" + "pattern": "TOK[A-Za-z0-9]{17}" } } } -export const GetRelationshipTemplatesRequest: any = { +export const GetTokensRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetRelationshipTemplatesRequest", + "$ref": "#/definitions/GetTokensRequest", "definitions": { - "GetRelationshipTemplatesRequest": { + "GetTokensRequest": { "type": "object", "properties": { "query": { - "$ref": "#/definitions/GetRelationshipTemplatesQuery" + "$ref": "#/definitions/GetTokensQuery" }, "ownerRestriction": { "$ref": "#/definitions/OwnerRestriction" @@ -20318,7 +19960,7 @@ export const GetRelationshipTemplatesRequest: any = { }, "additionalProperties": false }, - "GetRelationshipTemplatesQuery": { + "GetTokensQuery": { "type": "object", "properties": { "isOwn": { @@ -20347,19 +19989,6 @@ export const GetRelationshipTemplatesRequest: any = { } ] }, - "expiresAt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, "createdBy": { "anyOf": [ { @@ -20386,7 +20015,7 @@ export const GetRelationshipTemplatesRequest: any = { } ] }, - "maxNumberOfAllocations": { + "expiresAt": { "anyOf": [ { "type": "string" @@ -20465,11 +20094,11 @@ export const GetRelationshipTemplatesRequest: any = { } } -export const LoadPeerRelationshipTemplateRequest: any = { +export const LoadPeerTokenRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/LoadPeerRelationshipTemplateRequest", + "$ref": "#/definitions/LoadPeerTokenRequest", "definitions": { - "LoadPeerRelationshipTemplateRequest": { + "LoadPeerTokenRequest": { "type": "object", "properties": { "reference": { @@ -20477,133 +20106,277 @@ export const LoadPeerRelationshipTemplateRequest: any = { { "$ref": "#/definitions/TokenReferenceString" }, - { - "$ref": "#/definitions/RelationshipTemplateReferenceString" - }, { "$ref": "#/definitions/URLTokenReferenceString" - }, - { - "$ref": "#/definitions/URLRelationshipTemplateReferenceString" } ] }, + "ephemeral": { + "type": "boolean" + }, "password": { "type": "string" } }, "required": [ - "reference" + "reference", + "ephemeral" ], "additionalProperties": false, - "errorMessage": "token / relationship template reference invalid" + "errorMessage": "token reference invalid" }, "TokenReferenceString": { "type": "string", "pattern": "VE9L.{84}" }, - "RelationshipTemplateReferenceString": { - "type": "string", - "pattern": "UkxU.{84}" - }, "URLTokenReferenceString": { "type": "string", "pattern": "^https?:\\/\\/.*\\/r\\/TOK[a-zA-Z0-9]+(\\?app=.+)?#[a-zA-Z0-9-_]+$" - }, - "URLRelationshipTemplateReferenceString": { - "type": "string", - "pattern": "^https?:\\/\\/.*\\/r\\/RLT[a-zA-Z0-9]+(\\?app=.+)?#[a-zA-Z0-9-_]+$" } } } -export const CreateOwnTokenRequest: any = { +export const CreatePresentationTokenRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateOwnTokenRequest", + "$ref": "#/definitions/CreatePresentationTokenRequest", "definitions": { - "CreateOwnTokenRequest": { + "CreatePresentationTokenRequest": { "type": "object", "properties": { - "content": {}, - "expiresAt": { - "$ref": "#/definitions/ISO8601DateTimeString" - }, - "ephemeral": { - "type": "boolean" + "attributeId": { + "type": "string" + } + }, + "required": [ + "attributeId" + ], + "additionalProperties": false + } + } +} + +export const RequestCredentialsRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/RequestCredentialsRequest", + "definitions": { + "RequestCredentialsRequest": { + "$ref": "#/definitions/AbstractRequestCredentialsRequest%3Calias-2033348025-74138-74264-2033348025-0-218439%3Cstring%2Cany%3E%3E" + }, + "AbstractRequestCredentialsRequest>": { + "anyOf": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "credentialOffer": { + "type": "object" + }, + "credentialConfigurationIds": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "credentialConfigurationIds", + "credentialOffer" + ] }, - "forIdentity": { - "$ref": "#/definitions/AddressString" + { + "type": "object", + "additionalProperties": false, + "properties": { + "pinCode": { + "type": "string" + }, + "credentialOffer": { + "type": "object" + }, + "credentialConfigurationIds": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "credentialConfigurationIds", + "credentialOffer", + "pinCode" + ] }, - "passwordProtection": { + { "type": "object", + "additionalProperties": false, "properties": { - "password": { - "type": "string", - "minLength": 1 + "accessToken": { + "type": "string" }, - "passwordIsPin": { - "type": "boolean", - "const": true + "credentialOffer": { + "type": "object" }, - "passwordLocationIndicator": {} + "credentialConfigurationIds": { + "type": "array", + "items": { + "type": "string" + } + } }, "required": [ - "password" - ], - "additionalProperties": false + "accessToken", + "credentialConfigurationIds", + "credentialOffer" + ] + } + ] + } + } +} + +export const ResolveAuthorizationRequestRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/ResolveAuthorizationRequestRequest", + "definitions": { + "ResolveAuthorizationRequestRequest": { + "type": "object", + "properties": { + "authorizationRequestUrl": { + "type": "string" + } + }, + "required": [ + "authorizationRequestUrl" + ], + "additionalProperties": false + } + } +} + +export const ResolveCredentialOfferRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/ResolveCredentialOfferRequest", + "definitions": { + "ResolveCredentialOfferRequest": { + "type": "object", + "properties": { + "credentialOfferUrl": { + "type": "string" + } + }, + "required": [ + "credentialOfferUrl" + ], + "additionalProperties": false + } + } +} + +export const StoreCredentialsRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/StoreCredentialsRequest", + "definitions": { + "StoreCredentialsRequest": { + "type": "object", + "additionalProperties": false, + "properties": { + "credentialResponses": { + "type": "array", + "items": { + "type": "object" + } + } + }, + "required": [ + "credentialResponses" + ] + } + } +} + +export const CreateSettingRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/CreateSettingRequest", + "definitions": { + "CreateSettingRequest": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": {}, + "reference": { + "$ref": "#/definitions/GenericIdString" + }, + "scope": { + "type": "string", + "enum": [ + "Identity", + "Device", + "Relationship" + ] + }, + "succeedsAt": { + "$ref": "#/definitions/ISO8601DateTimeString" + }, + "succeedsItem": { + "$ref": "#/definitions/LocalSettingIdString" } }, "required": [ - "content", - "expiresAt", - "ephemeral" + "key", + "value" ], "additionalProperties": false }, + "GenericIdString": { + "type": "string", + "pattern": "[A-Za-z0-9]{20}" + }, "ISO8601DateTimeString": { "type": "string", "errorMessage": "must match ISO8601 datetime format", "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" }, - "AddressString": { + "LocalSettingIdString": { "type": "string", - "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" + "pattern": "LCLSET[A-Za-z0-9]{14}" } } } -export const DeleteTokenRequest: any = { +export const DeleteSettingRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/DeleteTokenRequest", + "$ref": "#/definitions/DeleteSettingRequest", "definitions": { - "DeleteTokenRequest": { + "DeleteSettingRequest": { "type": "object", "properties": { - "tokenId": { - "$ref": "#/definitions/TokenIdString" + "id": { + "$ref": "#/definitions/LocalSettingIdString" } }, "required": [ - "tokenId" + "id" ], "additionalProperties": false }, - "TokenIdString": { + "LocalSettingIdString": { "type": "string", - "pattern": "TOK[A-Za-z0-9]{17}" + "pattern": "LCLSET[A-Za-z0-9]{14}" } } } -export const GetTokenRequest: any = { +export const GetSettingRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetTokenRequest", + "$ref": "#/definitions/GetSettingRequest", "definitions": { - "GetTokenRequest": { + "GetSettingRequest": { "type": "object", "properties": { "id": { - "$ref": "#/definitions/TokenIdString" + "$ref": "#/definitions/LocalSettingIdString" } }, "required": [ @@ -20611,59 +20384,60 @@ export const GetTokenRequest: any = { ], "additionalProperties": false }, - "TokenIdString": { + "LocalSettingIdString": { "type": "string", - "pattern": "TOK[A-Za-z0-9]{17}" + "pattern": "LCLSET[A-Za-z0-9]{14}" } } } -export const GetTokensRequest: any = { +export const GetSettingByKeyRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetTokensRequest", + "$ref": "#/definitions/GetSettingByKeyRequest", "definitions": { - "GetTokensRequest": { + "GetSettingByKeyRequest": { "type": "object", "properties": { - "query": { - "$ref": "#/definitions/GetTokensQuery" + "key": { + "type": "string" }, - "ownerRestriction": { - "$ref": "#/definitions/OwnerRestriction" + "reference": { + "type": "string" + }, + "scope": { + "type": "string", + "enum": [ + "Identity", + "Device", + "Relationship" + ] + } + }, + "required": [ + "key" + ], + "additionalProperties": false + } + } +} + +export const GetSettingsRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/GetSettingsRequest", + "definitions": { + "GetSettingsRequest": { + "type": "object", + "properties": { + "query": { + "$ref": "#/definitions/GetSettingsQuery" } }, "additionalProperties": false }, - "GetTokensQuery": { + "GetSettingsQuery": { "type": "object", "properties": { - "isOwn": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "createdAt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "createdBy": { + "key": { "anyOf": [ { "type": "string" @@ -20676,7 +20450,7 @@ export const GetTokensRequest: any = { } ] }, - "createdByDevice": { + "scope": { "anyOf": [ { "type": "string" @@ -20689,7 +20463,7 @@ export const GetTokensRequest: any = { } ] }, - "expiresAt": { + "reference": { "anyOf": [ { "type": "string" @@ -20702,7 +20476,7 @@ export const GetTokensRequest: any = { } ] }, - "forIdentity": { + "createdAt": { "anyOf": [ { "type": "string" @@ -20715,14 +20489,7 @@ export const GetTokensRequest: any = { } ] }, - "passwordProtection": { - "type": "string", - "enum": [ - "", - "!" - ] - }, - "passwordProtection.password": { + "succeedsItem": { "anyOf": [ { "type": "string" @@ -20735,14 +20502,7 @@ export const GetTokensRequest: any = { } ] }, - "passwordProtection.passwordIsPin": { - "type": "string", - "enum": [ - "true", - "!" - ] - }, - "passwordProtection.passwordLocationIndicator": { + "succeedsAt": { "anyOf": [ { "type": "string" @@ -20757,55 +20517,67 @@ export const GetTokensRequest: any = { } }, "additionalProperties": false + } + } +} + +export const UpdateSettingRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/UpdateSettingRequest", + "definitions": { + "UpdateSettingRequest": { + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/LocalSettingIdString" + }, + "value": {} + }, + "required": [ + "id", + "value" + ], + "additionalProperties": false }, - "OwnerRestriction": { + "LocalSettingIdString": { "type": "string", - "enum": [ - "o", - "p" - ] + "pattern": "LCLSET[A-Za-z0-9]{14}" } } } -export const LoadPeerTokenRequest: any = { +export const UpsertSettingByKeyRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/LoadPeerTokenRequest", + "$ref": "#/definitions/UpsertSettingByKeyRequest", "definitions": { - "LoadPeerTokenRequest": { + "UpsertSettingByKeyRequest": { "type": "object", "properties": { - "reference": { - "anyOf": [ - { - "$ref": "#/definitions/TokenReferenceString" - }, - { - "$ref": "#/definitions/URLTokenReferenceString" - } - ] + "key": { + "type": "string" }, - "ephemeral": { - "type": "boolean" + "value": {}, + "reference": { + "$ref": "#/definitions/GenericIdString" }, - "password": { - "type": "string" + "scope": { + "type": "string", + "enum": [ + "Identity", + "Device", + "Relationship" + ] } }, "required": [ - "reference", - "ephemeral" + "key", + "value" ], - "additionalProperties": false, - "errorMessage": "token reference invalid" - }, - "TokenReferenceString": { - "type": "string", - "pattern": "VE9L.{84}" + "additionalProperties": false }, - "URLTokenReferenceString": { + "GenericIdString": { "type": "string", - "pattern": "^https?:\\/\\/.*\\/r\\/TOK[a-zA-Z0-9]+(\\?app=.+)?#[a-zA-Z0-9-_]+$" + "pattern": "[A-Za-z0-9]{20}" } } } @@ -21754,31 +21526,6 @@ export const VerifiableCredential: any = { "items": { "type": "object" } - }, - "defaultPresentationConfig": { - "type": "object", - "properties": { - "presentationFrame": { - "type": "object", - "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" - } - ] - } - }, - "keyBinding": { - "type": "boolean" - } - }, - "required": [ - "presentationFrame" - ], - "additionalProperties": false } }, "required": [ @@ -21787,19 +21534,6 @@ export const VerifiableCredential: any = { "value" ], "additionalProperties": false - }, - "interface-1894649334-822-900-1894649334-0-4702": { - "type": "object", - "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/definitions/interface-1894649334-822-900-1894649334-0-4702" - } - ] - } } } } \ No newline at end of file diff --git a/packages/runtime/src/useCases/consumption/openid4vc/CreateDefaultPresentation.ts b/packages/runtime/src/useCases/consumption/openid4vc/CreateDefaultPresentation.ts deleted file mode 100644 index 7bffc8695..000000000 --- a/packages/runtime/src/useCases/consumption/openid4vc/CreateDefaultPresentation.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { Result } from "@js-soft/ts-utils"; -import { AttributesController, OpenId4VcController } from "@nmshd/consumption"; -import { VerifiableCredential } from "@nmshd/content"; -import { CoreId } from "@nmshd/core-types"; -import { Inject } from "@nmshd/typescript-ioc"; -import { RuntimeErrors, SchemaRepository, SchemaValidator, UseCase } from "../../common"; - -export interface CreateDefaultPresentationRequest { - attributeId: string; -} - -export interface CreateDefaultPresentationResponse { - presentation: string; -} - -class Validator extends SchemaValidator { - public constructor(@Inject schemaRepository: SchemaRepository) { - super(schemaRepository.getSchema("CreateDefaultPresentationRequest")); - } -} - -export class CreateDefaultPresentationUseCase extends UseCase { - public constructor( - @Inject private readonly openId4VcController: OpenId4VcController, - @Inject private readonly attributesController: AttributesController, - @Inject validator: Validator - ) { - super(validator); - } - - protected override async executeInternal(request: CreateDefaultPresentationRequest): Promise> { - const attribute = await this.attributesController.getLocalAttribute(CoreId.from(request.attributeId)); - if (!(attribute?.content.value instanceof VerifiableCredential)) return Result.fail(RuntimeErrors.general.recordNotFound("Attribute with Verifiable Credential")); - - const result = await this.openId4VcController.createDefaultPresentation(attribute.content.value); - return Result.ok({ presentation: result }); - } -} diff --git a/packages/runtime/src/useCases/consumption/openid4vc/CreatePresentationToken.ts b/packages/runtime/src/useCases/consumption/openid4vc/CreatePresentationToken.ts new file mode 100644 index 000000000..47b2dd97c --- /dev/null +++ b/packages/runtime/src/useCases/consumption/openid4vc/CreatePresentationToken.ts @@ -0,0 +1,45 @@ +import { Result } from "@js-soft/ts-utils"; +import { AttributesController, OpenId4VcController } from "@nmshd/consumption"; +import { VerifiableCredential } from "@nmshd/content"; +import { CoreDate, CoreId } from "@nmshd/core-types"; +import { TokenDTO } from "@nmshd/runtime-types"; +import { TokenController } from "@nmshd/transport"; +import { Inject } from "@nmshd/typescript-ioc"; +import { RuntimeErrors, SchemaRepository, SchemaValidator, UseCase } from "../../common"; +import { TokenMapper } from "../../transport"; + +export interface CreatePresentationTokenRequest { + attributeId: string; +} + +class Validator extends SchemaValidator { + public constructor(@Inject schemaRepository: SchemaRepository) { + super(schemaRepository.getSchema("CreatePresentationTokenRequest")); + } +} + +export class CreatePresentationTokenUseCase extends UseCase { + public constructor( + @Inject private readonly openId4VcController: OpenId4VcController, + @Inject private readonly attributesController: AttributesController, + @Inject private readonly tokenController: TokenController, + @Inject validator: Validator + ) { + super(validator); + } + + protected override async executeInternal(request: CreatePresentationTokenRequest): Promise> { + const attribute = await this.attributesController.getLocalAttribute(CoreId.from(request.attributeId)); + if (!(attribute?.content.value instanceof VerifiableCredential)) return Result.fail(RuntimeErrors.general.recordNotFound("Attribute with Verifiable Credential")); + + const presentation = await this.openId4VcController.createDefaultPresentation(attribute.content.value); + + const token = await this.tokenController.sendToken({ + content: presentation.toJSON(), + expiresAt: CoreDate.utc().add({ minutes: 1 }), + ephemeral: true + }); + + return Result.ok(TokenMapper.toTokenDTO(token, true)); + } +} diff --git a/packages/runtime/src/useCases/consumption/openid4vc/index.ts b/packages/runtime/src/useCases/consumption/openid4vc/index.ts index cb24a9a78..024905d25 100644 --- a/packages/runtime/src/useCases/consumption/openid4vc/index.ts +++ b/packages/runtime/src/useCases/consumption/openid4vc/index.ts @@ -1,5 +1,5 @@ export * from "./AcceptAuthorizationRequest"; -export * from "./CreateDefaultPresentation"; +export * from "./CreatePresentationToken"; export * from "./RequestCredentials"; export * from "./ResolveAuthorizationRequest"; export * from "./ResolveCredentialOffer"; diff --git a/packages/runtime/test/consumption/openid4vc.test.ts b/packages/runtime/test/consumption/openid4vc.test.ts index 3e11d705f..2c396d414 100644 --- a/packages/runtime/test/consumption/openid4vc.test.ts +++ b/packages/runtime/test/consumption/openid4vc.test.ts @@ -260,46 +260,23 @@ describe("custom openid4vc service", () => { expect(acceptanceResult.value.length).toBeGreaterThan(0); }); - test("default presentation with one disclosure, no key binding", async () => { - const attribute = (await runtimeServices1.consumption.attributes.getAttribute({ id: attributeId })).value; - const newAttribute = ( - await runtimeServices1.consumption.attributes.succeedOwnIdentityAttribute({ - // create attribute runs into an error - predecessorId: attributeId, - successorContent: { value: { ...attribute.content.value, defaultPresentationConfig: { presentationFrame: { degree: true } } } as VerifiableCredentialJSON } - }) - ).value.successor; - attributeId = newAttribute.id; - - const defaultPresentation = await runtimeServices1.consumption.openId4Vc.createDefaultPresentation({ attributeId: newAttribute.id }); - expect(defaultPresentation).toBeSuccessful(); - const presentationParts = defaultPresentation.value.presentation.split("~"); - - // one disclosure - expect(presentationParts).toHaveLength(3); - expect(presentationParts.at(-1)).toBe(""); - }); + test("presentation with token", async () => { + const token = (await runtimeServices1.consumption.openId4Vc.createPresentationToken({ attributeId })).value; - test("default presentation with one disclosure and key binding", async () => { - const attribute = (await runtimeServices1.consumption.attributes.getAttribute({ id: attributeId })).value; - const newAttribute = ( - await runtimeServices1.consumption.attributes.succeedOwnIdentityAttribute({ - // create attribute runs into an error - predecessorId: attributeId, - successorContent: { - value: { ...attribute.content.value, defaultPresentationConfig: { keyBinding: true, presentationFrame: { degree: true } } } as VerifiableCredentialJSON - } - }) - ).value.successor; - attributeId = newAttribute.id; + const loadedToken = (await runtimeServices1.anonymous.tokens.loadPeerToken({ reference: token.reference.url })).value; - const defaultPresentation = await runtimeServices1.consumption.openId4Vc.createDefaultPresentation({ attributeId: newAttribute.id }); - expect(defaultPresentation).toBeSuccessful(); - const presentationParts = defaultPresentation.value.presentation.split("~"); + const credential = ((await runtimeServices1.consumption.attributes.getAttribute({ id: attributeId })).value.content.value as VerifiableCredentialJSON).value; + const presentation = (loadedToken.content as VerifiableCredentialJSON).value; + expect(presentation.substring(0, credential.length)).toBe(credential); + expect(presentation.substring(credential.length, credential.length + 2)).toBe("ey"); - // one disclosure, one key binding jwt - expect(presentationParts).toHaveLength(3); - expect(presentationParts.at(-1)).toMatch(/^ey/); + const verificationResult = await axiosInstance.post("/presentation/verify", { + credential: presentation, + format: "dc+sd-jwt", + nonce: "defaultPresentationNonce", + audience: "defaultPresentationAudience" + }); + expect(verificationResult.data.result.verified).toBe(true); }); }); From f17d46f630918df85b237d9b2a904591f6be1bc3 Mon Sep 17 00:00:00 2001 From: mkuhn Date: Fri, 9 Jan 2026 11:56:04 +0100 Subject: [PATCH 14/18] fix: address circular dependency --- .../useCases/consumption/openid4vc/CreatePresentationToken.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/runtime/src/useCases/consumption/openid4vc/CreatePresentationToken.ts b/packages/runtime/src/useCases/consumption/openid4vc/CreatePresentationToken.ts index 47b2dd97c..4e5ad14cf 100644 --- a/packages/runtime/src/useCases/consumption/openid4vc/CreatePresentationToken.ts +++ b/packages/runtime/src/useCases/consumption/openid4vc/CreatePresentationToken.ts @@ -6,7 +6,7 @@ import { TokenDTO } from "@nmshd/runtime-types"; import { TokenController } from "@nmshd/transport"; import { Inject } from "@nmshd/typescript-ioc"; import { RuntimeErrors, SchemaRepository, SchemaValidator, UseCase } from "../../common"; -import { TokenMapper } from "../../transport"; +import { TokenMapper } from "../../transport/tokens/TokenMapper"; export interface CreatePresentationTokenRequest { attributeId: string; From b64a0dc724dec84a4427cf0993b6b2633a7f4705 Mon Sep 17 00:00:00 2001 From: mkuhn Date: Fri, 9 Jan 2026 13:33:50 +0100 Subject: [PATCH 15/18] test: update service image --- .dev/compose.openid4vc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.dev/compose.openid4vc.yml b/.dev/compose.openid4vc.yml index 790065d90..73906b76c 100644 --- a/.dev/compose.openid4vc.yml +++ b/.dev/compose.openid4vc.yml @@ -2,7 +2,7 @@ name: runtime-oid4vc-tests services: oid4vc-service: - image: ghcr.io/js-soft/openid4vc-service:1.2.0@sha256:653358212651a992d211a187a0d405f56ae50b05d6c95bbdc37e1647fd8e6c33 + image: ghcr.io/js-soft/openid4vc-service:1.3.0@sha256:0ec8d7e1479d168c4760cc0fb3f7d9273985bc2d74759f09cd39e0b50fa45f6b ports: - "9000:9000" platform: linux/amd64 From 089409750ef38f120848d08188db2b6c9d59a697 Mon Sep 17 00:00:00 2001 From: mkuhn Date: Fri, 9 Jan 2026 13:39:03 +0100 Subject: [PATCH 16/18] chore: build schemas --- .../runtime/src/useCases/common/Schemas.ts | 3790 ++++++++--------- 1 file changed, 1895 insertions(+), 1895 deletions(-) diff --git a/packages/runtime/src/useCases/common/Schemas.ts b/packages/runtime/src/useCases/common/Schemas.ts index 36781852a..c5b9ffd37 100644 --- a/packages/runtime/src/useCases/common/Schemas.ts +++ b/packages/runtime/src/useCases/common/Schemas.ts @@ -17219,219 +17219,247 @@ export const AcceptAuthorizationRequestRequest: any = { } } -export const DownloadFileRequest: any = { +export const CreatePresentationTokenRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/DownloadFileRequest", + "$ref": "#/definitions/CreatePresentationTokenRequest", "definitions": { - "DownloadFileRequest": { + "CreatePresentationTokenRequest": { "type": "object", "properties": { - "id": { - "$ref": "#/definitions/FileIdString" + "attributeId": { + "type": "string" } }, "required": [ - "id" + "attributeId" ], "additionalProperties": false - }, - "FileIdString": { - "type": "string", - "pattern": "FIL[A-Za-z0-9]{17}" } } } -export const LoadItemFromReferenceRequest: any = { +export const RequestCredentialsRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/LoadItemFromReferenceRequest", + "$ref": "#/definitions/RequestCredentialsRequest", "definitions": { - "LoadItemFromReferenceRequest": { - "type": "object", - "properties": { - "reference": { - "anyOf": [ - { - "$ref": "#/definitions/TokenReferenceString" + "RequestCredentialsRequest": { + "$ref": "#/definitions/AbstractRequestCredentialsRequest%3Calias-2033348025-74138-74264-2033348025-0-218439%3Cstring%2Cany%3E%3E" + }, + "AbstractRequestCredentialsRequest>": { + "anyOf": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "credentialOffer": { + "type": "object" }, - { - "$ref": "#/definitions/FileReferenceString" + "credentialConfigurationIds": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "credentialConfigurationIds", + "credentialOffer" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "pinCode": { + "type": "string" }, - { - "$ref": "#/definitions/RelationshipTemplateReferenceString" + "credentialOffer": { + "type": "object" }, - { - "$ref": "#/definitions/URLTokenReferenceString" + "credentialConfigurationIds": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "credentialConfigurationIds", + "credentialOffer", + "pinCode" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "accessToken": { + "type": "string" }, - { - "$ref": "#/definitions/URLFileReferenceString" + "credentialOffer": { + "type": "object" }, - { - "$ref": "#/definitions/URLRelationshipTemplateReferenceString" + "credentialConfigurationIds": { + "type": "array", + "items": { + "type": "string" + } } + }, + "required": [ + "accessToken", + "credentialConfigurationIds", + "credentialOffer" ] - }, - "password": { + } + ] + } + } +} + +export const ResolveAuthorizationRequestRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/ResolveAuthorizationRequestRequest", + "definitions": { + "ResolveAuthorizationRequestRequest": { + "type": "object", + "properties": { + "authorizationRequestUrl": { "type": "string" } }, "required": [ - "reference" + "authorizationRequestUrl" ], "additionalProperties": false - }, - "TokenReferenceString": { - "type": "string", - "pattern": "VE9L.{84}" - }, - "FileReferenceString": { - "type": "string", - "pattern": "RklM.{84}" - }, - "RelationshipTemplateReferenceString": { - "type": "string", - "pattern": "UkxU.{84}" - }, - "URLTokenReferenceString": { - "type": "string", - "pattern": "^https?:\\/\\/.*\\/r\\/TOK[a-zA-Z0-9]+(\\?app=.+)?#[a-zA-Z0-9-_]+$" - }, - "URLFileReferenceString": { - "type": "string", - "pattern": "^https?:\\/\\/.*\\/r\\/FIL[a-zA-Z0-9]+(\\?app=.+)?#[a-zA-Z0-9-_]+$" - }, - "URLRelationshipTemplateReferenceString": { - "type": "string", - "pattern": "^https?:\\/\\/.*\\/r\\/RLT[a-zA-Z0-9]+(\\?app=.+)?#[a-zA-Z0-9-_]+$" } } } -export const RegisterPushNotificationTokenRequest: any = { +export const ResolveCredentialOfferRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/RegisterPushNotificationTokenRequest", + "$ref": "#/definitions/ResolveCredentialOfferRequest", "definitions": { - "RegisterPushNotificationTokenRequest": { + "ResolveCredentialOfferRequest": { "type": "object", "properties": { - "handle": { - "type": "string" - }, - "platform": { - "type": "string" - }, - "appId": { + "credentialOfferUrl": { "type": "string" - }, - "environment": { - "type": "string", - "enum": [ - "Development", - "Production" - ] } }, "required": [ - "handle", - "platform", - "appId" + "credentialOfferUrl" ], "additionalProperties": false } } } -export const CreateTokenForFileRequest: any = { +export const StoreCredentialsRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateTokenForFileRequest", + "$ref": "#/definitions/StoreCredentialsRequest", "definitions": { - "CreateTokenForFileRequest": { + "StoreCredentialsRequest": { "type": "object", + "additionalProperties": false, "properties": { - "fileId": { - "$ref": "#/definitions/FileIdString" + "credentialResponses": { + "type": "array", + "items": { + "type": "object" + } + } + }, + "required": [ + "credentialResponses" + ] + } + } +} + +export const CreateSettingRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/CreateSettingRequest", + "definitions": { + "CreateSettingRequest": { + "type": "object", + "properties": { + "key": { + "type": "string" }, - "expiresAt": { - "$ref": "#/definitions/ISO8601DateTimeString" + "value": {}, + "reference": { + "$ref": "#/definitions/GenericIdString" }, - "ephemeral": { - "type": "boolean" + "scope": { + "type": "string", + "enum": [ + "Identity", + "Device", + "Relationship" + ] }, - "forIdentity": { - "$ref": "#/definitions/AddressString" + "succeedsAt": { + "$ref": "#/definitions/ISO8601DateTimeString" }, - "passwordProtection": { - "type": "object", - "properties": { - "password": { - "type": "string", - "minLength": 1 - }, - "passwordIsPin": { - "type": "boolean", - "const": true - }, - "passwordLocationIndicator": {} - }, - "required": [ - "password" - ], - "additionalProperties": false + "succeedsItem": { + "$ref": "#/definitions/LocalSettingIdString" } }, "required": [ - "fileId" + "key", + "value" ], "additionalProperties": false }, - "FileIdString": { + "GenericIdString": { "type": "string", - "pattern": "FIL[A-Za-z0-9]{17}" + "pattern": "[A-Za-z0-9]{20}" }, "ISO8601DateTimeString": { "type": "string", "errorMessage": "must match ISO8601 datetime format", "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" }, - "AddressString": { + "LocalSettingIdString": { "type": "string", - "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" + "pattern": "LCLSET[A-Za-z0-9]{14}" } } } -export const DeleteFileRequest: any = { +export const DeleteSettingRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/DeleteFileRequest", + "$ref": "#/definitions/DeleteSettingRequest", "definitions": { - "DeleteFileRequest": { + "DeleteSettingRequest": { "type": "object", "properties": { - "fileId": { - "$ref": "#/definitions/FileIdString" + "id": { + "$ref": "#/definitions/LocalSettingIdString" } }, "required": [ - "fileId" + "id" ], "additionalProperties": false }, - "FileIdString": { + "LocalSettingIdString": { "type": "string", - "pattern": "FIL[A-Za-z0-9]{17}" + "pattern": "LCLSET[A-Za-z0-9]{14}" } } } -export const GetFileRequest: any = { +export const GetSettingRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetFileRequest", + "$ref": "#/definitions/GetSettingRequest", "definitions": { - "GetFileRequest": { + "GetSettingRequest": { "type": "object", "properties": { "id": { - "$ref": "#/definitions/FileIdString" + "$ref": "#/definitions/LocalSettingIdString" } }, "required": [ @@ -17439,72 +17467,60 @@ export const GetFileRequest: any = { ], "additionalProperties": false }, - "FileIdString": { + "LocalSettingIdString": { "type": "string", - "pattern": "FIL[A-Za-z0-9]{17}" + "pattern": "LCLSET[A-Za-z0-9]{14}" } } } -export const GetFilesRequest: any = { +export const GetSettingByKeyRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetFilesRequest", + "$ref": "#/definitions/GetSettingByKeyRequest", "definitions": { - "GetFilesRequest": { + "GetSettingByKeyRequest": { "type": "object", "properties": { - "query": { - "$ref": "#/definitions/GetFilesQuery" + "key": { + "type": "string" }, - "ownerRestriction": { - "$ref": "#/definitions/OwnerRestriction" + "reference": { + "type": "string" + }, + "scope": { + "type": "string", + "enum": [ + "Identity", + "Device", + "Relationship" + ] + } + }, + "required": [ + "key" + ], + "additionalProperties": false + } + } +} + +export const GetSettingsRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/GetSettingsRequest", + "definitions": { + "GetSettingsRequest": { + "type": "object", + "properties": { + "query": { + "$ref": "#/definitions/GetSettingsQuery" } }, "additionalProperties": false }, - "GetFilesQuery": { + "GetSettingsQuery": { "type": "object", "properties": { - "createdAt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "createdBy": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "createdByDevice": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "description": { + "key": { "anyOf": [ { "type": "string" @@ -17517,7 +17533,7 @@ export const GetFilesRequest: any = { } ] }, - "expiresAt": { + "scope": { "anyOf": [ { "type": "string" @@ -17530,7 +17546,7 @@ export const GetFilesRequest: any = { } ] }, - "filename": { + "reference": { "anyOf": [ { "type": "string" @@ -17543,7 +17559,7 @@ export const GetFilesRequest: any = { } ] }, - "filesize": { + "createdAt": { "anyOf": [ { "type": "string" @@ -17556,7 +17572,7 @@ export const GetFilesRequest: any = { } ] }, - "mimetype": { + "succeedsItem": { "anyOf": [ { "type": "string" @@ -17569,7 +17585,7 @@ export const GetFilesRequest: any = { } ] }, - "title": { + "succeedsAt": { "anyOf": [ { "type": "string" @@ -17581,67 +17597,102 @@ export const GetFilesRequest: any = { } } ] + } + }, + "additionalProperties": false + } + } +} + +export const UpdateSettingRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/UpdateSettingRequest", + "definitions": { + "UpdateSettingRequest": { + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/LocalSettingIdString" }, - "isOwn": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "value": {} + }, + "required": [ + "id", + "value" + ], + "additionalProperties": false + }, + "LocalSettingIdString": { + "type": "string", + "pattern": "LCLSET[A-Za-z0-9]{14}" + } + } +} + +export const UpsertSettingByKeyRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/UpsertSettingByKeyRequest", + "definitions": { + "UpsertSettingByKeyRequest": { + "type": "object", + "properties": { + "key": { + "type": "string" }, - "tags": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] + "value": {}, + "reference": { + "$ref": "#/definitions/GenericIdString" }, - "ownershipToken": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } + "scope": { + "type": "string", + "enum": [ + "Identity", + "Device", + "Relationship" ] - }, - "ownershipIsLocked": { - "type": "string" } }, + "required": [ + "key", + "value" + ], "additionalProperties": false }, - "OwnerRestriction": { + "GenericIdString": { "type": "string", - "enum": [ - "o", - "p" - ] + "pattern": "[A-Za-z0-9]{20}" } } } -export const GetOrLoadFileRequest: any = { +export const DownloadFileRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetOrLoadFileRequest", + "$ref": "#/definitions/DownloadFileRequest", "definitions": { - "GetOrLoadFileRequest": { + "DownloadFileRequest": { + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/FileIdString" + } + }, + "required": [ + "id" + ], + "additionalProperties": false + }, + "FileIdString": { + "type": "string", + "pattern": "FIL[A-Za-z0-9]{17}" + } + } +} + +export const LoadItemFromReferenceRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/LoadItemFromReferenceRequest", + "definitions": { + "LoadItemFromReferenceRequest": { "type": "object", "properties": { "reference": { @@ -17652,11 +17703,17 @@ export const GetOrLoadFileRequest: any = { { "$ref": "#/definitions/FileReferenceString" }, + { + "$ref": "#/definitions/RelationshipTemplateReferenceString" + }, { "$ref": "#/definitions/URLTokenReferenceString" }, { "$ref": "#/definitions/URLFileReferenceString" + }, + { + "$ref": "#/definitions/URLRelationshipTemplateReferenceString" } ] }, @@ -17667,8 +17724,7 @@ export const GetOrLoadFileRequest: any = { "required": [ "reference" ], - "additionalProperties": false, - "errorMessage": "token / file reference invalid" + "additionalProperties": false }, "TokenReferenceString": { "type": "string", @@ -17678,6 +17734,10 @@ export const GetOrLoadFileRequest: any = { "type": "string", "pattern": "RklM.{84}" }, + "RelationshipTemplateReferenceString": { + "type": "string", + "pattern": "UkxU.{84}" + }, "URLTokenReferenceString": { "type": "string", "pattern": "^https?:\\/\\/.*\\/r\\/TOK[a-zA-Z0-9]+(\\?app=.+)?#[a-zA-Z0-9-_]+$" @@ -17685,228 +17745,146 @@ export const GetOrLoadFileRequest: any = { "URLFileReferenceString": { "type": "string", "pattern": "^https?:\\/\\/.*\\/r\\/FIL[a-zA-Z0-9]+(\\?app=.+)?#[a-zA-Z0-9-_]+$" + }, + "URLRelationshipTemplateReferenceString": { + "type": "string", + "pattern": "^https?:\\/\\/.*\\/r\\/RLT[a-zA-Z0-9]+(\\?app=.+)?#[a-zA-Z0-9-_]+$" } } } -export const RegenerateFileOwnershipTokenRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/RegenerateFileOwnershipTokenRequest", - "definitions": { - "RegenerateFileOwnershipTokenRequest": { - "type": "object", - "properties": { - "id": { - "$ref": "#/definitions/FileIdString" - } - }, - "required": [ - "id" - ], - "additionalProperties": false - }, - "FileIdString": { - "type": "string", - "pattern": "FIL[A-Za-z0-9]{17}" - } - } -} - -export const UploadOwnFileRequest: any = { +export const RegisterPushNotificationTokenRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/UploadOwnFileRequest", + "$ref": "#/definitions/RegisterPushNotificationTokenRequest", "definitions": { - "UploadOwnFileRequest": { + "RegisterPushNotificationTokenRequest": { "type": "object", "properties": { - "content": { - "type": "object", - "properties": { - "BYTES_PER_ELEMENT": { - "type": "number" - }, - "buffer": { - "type": "object", - "properties": { - "byteLength": { - "type": "number" - } - }, - "required": [ - "byteLength" - ], - "additionalProperties": false - }, - "byteLength": { - "type": "number" - }, - "byteOffset": { - "type": "number" - }, - "length": { - "type": "number" - } - }, - "required": [ - "BYTES_PER_ELEMENT", - "buffer", - "byteLength", - "byteOffset", - "length" - ], - "additionalProperties": { - "type": "number" - } - }, - "filename": { - "type": "string" - }, - "mimetype": { + "handle": { "type": "string" }, - "expiresAt": { - "$ref": "#/definitions/ISO8601DateTimeString" - }, - "title": { + "platform": { "type": "string" }, - "description": { + "appId": { "type": "string" }, - "tags": { - "type": "array", - "items": { - "type": "string" - }, - "uniqueItems": true + "environment": { + "type": "string", + "enum": [ + "Development", + "Production" + ] } }, "required": [ - "content", - "filename", - "mimetype" + "handle", + "platform", + "appId" ], "additionalProperties": false - }, - "ISO8601DateTimeString": { - "type": "string", - "errorMessage": "must match ISO8601 datetime format", - "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" } } } -export const UploadOwnFileValidatableRequest: any = { +export const CreateTokenForFileRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/UploadOwnFileValidatableRequest", + "$ref": "#/definitions/CreateTokenForFileRequest", "definitions": { - "UploadOwnFileValidatableRequest": { + "CreateTokenForFileRequest": { "type": "object", "properties": { - "filename": { - "type": "string" - }, - "mimetype": { - "type": "string" + "fileId": { + "$ref": "#/definitions/FileIdString" }, "expiresAt": { "$ref": "#/definitions/ISO8601DateTimeString" }, - "title": { - "type": "string" + "ephemeral": { + "type": "boolean" }, - "description": { - "type": "string" + "forIdentity": { + "$ref": "#/definitions/AddressString" }, - "tags": { - "type": "array", - "items": { - "type": "string" + "passwordProtection": { + "type": "object", + "properties": { + "password": { + "type": "string", + "minLength": 1 + }, + "passwordIsPin": { + "type": "boolean", + "const": true + }, + "passwordLocationIndicator": {} }, - "uniqueItems": true - }, - "content": { - "type": "object" + "required": [ + "password" + ], + "additionalProperties": false } }, "required": [ - "content", - "filename", - "mimetype" + "fileId" ], "additionalProperties": false }, + "FileIdString": { + "type": "string", + "pattern": "FIL[A-Za-z0-9]{17}" + }, "ISO8601DateTimeString": { "type": "string", "errorMessage": "must match ISO8601 datetime format", "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" + }, + "AddressString": { + "type": "string", + "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" } } } -export const GetIdentityDeletionProcessRequest: any = { +export const DeleteFileRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetIdentityDeletionProcessRequest", + "$ref": "#/definitions/DeleteFileRequest", "definitions": { - "GetIdentityDeletionProcessRequest": { + "DeleteFileRequest": { "type": "object", "properties": { - "id": { - "$ref": "#/definitions/IdentityDeletionProcessIdString" + "fileId": { + "$ref": "#/definitions/FileIdString" } }, "required": [ - "id" + "fileId" ], "additionalProperties": false }, - "IdentityDeletionProcessIdString": { + "FileIdString": { "type": "string", - "pattern": "IDP[A-Za-z0-9]{17}" - } - } -} - -export const InitiateIdentityDeletionProcessRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/InitiateIdentityDeletionProcessRequest", - "definitions": { - "InitiateIdentityDeletionProcessRequest": { - "type": "object", - "properties": { - "lengthOfGracePeriodInDays": { - "type": "number" - } - }, - "additionalProperties": false + "pattern": "FIL[A-Za-z0-9]{17}" } } } -export const DownloadAttachmentRequest: any = { +export const GetFileRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/DownloadAttachmentRequest", + "$ref": "#/definitions/GetFileRequest", "definitions": { - "DownloadAttachmentRequest": { + "GetFileRequest": { "type": "object", "properties": { "id": { - "$ref": "#/definitions/MessageIdString" - }, - "attachmentId": { "$ref": "#/definitions/FileIdString" } }, "required": [ - "id", - "attachmentId" + "id" ], "additionalProperties": false }, - "MessageIdString": { - "type": "string", - "pattern": "MSG[A-Za-z0-9]{17}" - }, "FileIdString": { "type": "string", "pattern": "FIL[A-Za-z0-9]{17}" @@ -17914,54 +17892,522 @@ export const DownloadAttachmentRequest: any = { } } -export const GetAnnouncementsRequest: any = { +export const GetFilesRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetAnnouncementsRequest", + "$ref": "#/definitions/GetFilesRequest", "definitions": { - "GetAnnouncementsRequest": { + "GetFilesRequest": { "type": "object", "properties": { - "language": { - "$ref": "#/definitions/LanguageISO639" + "query": { + "$ref": "#/definitions/GetFilesQuery" + }, + "ownerRestriction": { + "$ref": "#/definitions/OwnerRestriction" } }, - "required": [ - "language" - ], "additionalProperties": false }, - "LanguageISO639": { - "type": "string", - "enum": [ - "aa", - "ab", - "ae", - "af", - "ak", - "am", - "an", - "ar", - "as", - "av", - "ay", - "az", - "ba", - "be", - "bg", - "bi", - "bm", - "bn", - "bo", - "br", - "bs", - "ca", - "ce", - "ch", - "co", - "cr", - "cs", - "cu", - "cv", + "GetFilesQuery": { + "type": "object", + "properties": { + "createdAt": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "createdBy": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "createdByDevice": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "expiresAt": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "filename": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "filesize": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "mimetype": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "isOwn": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "tags": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "ownershipToken": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "ownershipIsLocked": { + "type": "string" + } + }, + "additionalProperties": false + }, + "OwnerRestriction": { + "type": "string", + "enum": [ + "o", + "p" + ] + } + } +} + +export const GetOrLoadFileRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/GetOrLoadFileRequest", + "definitions": { + "GetOrLoadFileRequest": { + "type": "object", + "properties": { + "reference": { + "anyOf": [ + { + "$ref": "#/definitions/TokenReferenceString" + }, + { + "$ref": "#/definitions/FileReferenceString" + }, + { + "$ref": "#/definitions/URLTokenReferenceString" + }, + { + "$ref": "#/definitions/URLFileReferenceString" + } + ] + }, + "password": { + "type": "string" + } + }, + "required": [ + "reference" + ], + "additionalProperties": false, + "errorMessage": "token / file reference invalid" + }, + "TokenReferenceString": { + "type": "string", + "pattern": "VE9L.{84}" + }, + "FileReferenceString": { + "type": "string", + "pattern": "RklM.{84}" + }, + "URLTokenReferenceString": { + "type": "string", + "pattern": "^https?:\\/\\/.*\\/r\\/TOK[a-zA-Z0-9]+(\\?app=.+)?#[a-zA-Z0-9-_]+$" + }, + "URLFileReferenceString": { + "type": "string", + "pattern": "^https?:\\/\\/.*\\/r\\/FIL[a-zA-Z0-9]+(\\?app=.+)?#[a-zA-Z0-9-_]+$" + } + } +} + +export const RegenerateFileOwnershipTokenRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/RegenerateFileOwnershipTokenRequest", + "definitions": { + "RegenerateFileOwnershipTokenRequest": { + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/FileIdString" + } + }, + "required": [ + "id" + ], + "additionalProperties": false + }, + "FileIdString": { + "type": "string", + "pattern": "FIL[A-Za-z0-9]{17}" + } + } +} + +export const UploadOwnFileRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/UploadOwnFileRequest", + "definitions": { + "UploadOwnFileRequest": { + "type": "object", + "properties": { + "content": { + "type": "object", + "properties": { + "BYTES_PER_ELEMENT": { + "type": "number" + }, + "buffer": { + "type": "object", + "properties": { + "byteLength": { + "type": "number" + } + }, + "required": [ + "byteLength" + ], + "additionalProperties": false + }, + "byteLength": { + "type": "number" + }, + "byteOffset": { + "type": "number" + }, + "length": { + "type": "number" + } + }, + "required": [ + "BYTES_PER_ELEMENT", + "buffer", + "byteLength", + "byteOffset", + "length" + ], + "additionalProperties": { + "type": "number" + } + }, + "filename": { + "type": "string" + }, + "mimetype": { + "type": "string" + }, + "expiresAt": { + "$ref": "#/definitions/ISO8601DateTimeString" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + } + }, + "required": [ + "content", + "filename", + "mimetype" + ], + "additionalProperties": false + }, + "ISO8601DateTimeString": { + "type": "string", + "errorMessage": "must match ISO8601 datetime format", + "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" + } + } +} + +export const UploadOwnFileValidatableRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/UploadOwnFileValidatableRequest", + "definitions": { + "UploadOwnFileValidatableRequest": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "mimetype": { + "type": "string" + }, + "expiresAt": { + "$ref": "#/definitions/ISO8601DateTimeString" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + "content": { + "type": "object" + } + }, + "required": [ + "content", + "filename", + "mimetype" + ], + "additionalProperties": false + }, + "ISO8601DateTimeString": { + "type": "string", + "errorMessage": "must match ISO8601 datetime format", + "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" + } + } +} + +export const GetIdentityDeletionProcessRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/GetIdentityDeletionProcessRequest", + "definitions": { + "GetIdentityDeletionProcessRequest": { + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/IdentityDeletionProcessIdString" + } + }, + "required": [ + "id" + ], + "additionalProperties": false + }, + "IdentityDeletionProcessIdString": { + "type": "string", + "pattern": "IDP[A-Za-z0-9]{17}" + } + } +} + +export const InitiateIdentityDeletionProcessRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/InitiateIdentityDeletionProcessRequest", + "definitions": { + "InitiateIdentityDeletionProcessRequest": { + "type": "object", + "properties": { + "lengthOfGracePeriodInDays": { + "type": "number" + } + }, + "additionalProperties": false + } + } +} + +export const DownloadAttachmentRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/DownloadAttachmentRequest", + "definitions": { + "DownloadAttachmentRequest": { + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/MessageIdString" + }, + "attachmentId": { + "$ref": "#/definitions/FileIdString" + } + }, + "required": [ + "id", + "attachmentId" + ], + "additionalProperties": false + }, + "MessageIdString": { + "type": "string", + "pattern": "MSG[A-Za-z0-9]{17}" + }, + "FileIdString": { + "type": "string", + "pattern": "FIL[A-Za-z0-9]{17}" + } + } +} + +export const GetAnnouncementsRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/GetAnnouncementsRequest", + "definitions": { + "GetAnnouncementsRequest": { + "type": "object", + "properties": { + "language": { + "$ref": "#/definitions/LanguageISO639" + } + }, + "required": [ + "language" + ], + "additionalProperties": false + }, + "LanguageISO639": { + "type": "string", + "enum": [ + "aa", + "ab", + "ae", + "af", + "ak", + "am", + "an", + "ar", + "as", + "av", + "ay", + "az", + "ba", + "be", + "bg", + "bi", + "bm", + "bn", + "bo", + "br", + "bs", + "ca", + "ce", + "ch", + "co", + "cr", + "cs", + "cu", + "cv", "cy", "da", "de", @@ -18232,567 +18678,161 @@ export const isCreateIdentityChallengeRequest: any = { "properties": { "namedArgs": { "type": "object", - "properties": { - "value": {} - }, - "required": [ - "value" - ], - "additionalProperties": false - } - } - } - } -} - -export const CreateDeviceChallengeRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateDeviceChallengeRequest", - "definitions": { - "CreateDeviceChallengeRequest": { - "type": "object", - "properties": { - "challengeType": { - "type": "string", - "const": "Device" - } - }, - "required": [ - "challengeType" - ], - "additionalProperties": false - } - } -} - -export const isCreateDeviceChallengeRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/isCreateDeviceChallengeRequest", - "definitions": { - "isCreateDeviceChallengeRequest": { - "$comment": "(value: any) => value is CreateDeviceChallengeRequest", - "type": "object", - "properties": { - "namedArgs": { - "type": "object", - "properties": { - "value": {} - }, - "required": [ - "value" - ], - "additionalProperties": false - } - } - } - } -} - -export const CreateChallengeRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateChallengeRequest", - "definitions": { - "CreateChallengeRequest": { - "anyOf": [ - { - "$ref": "#/definitions/CreateRelationshipChallengeRequest" - }, - { - "$ref": "#/definitions/CreateIdentityChallengeRequest" - }, - { - "$ref": "#/definitions/CreateDeviceChallengeRequest" - } - ] - }, - "CreateRelationshipChallengeRequest": { - "type": "object", - "properties": { - "challengeType": { - "type": "string", - "const": "Relationship" - }, - "relationship": { - "$ref": "#/definitions/RelationshipIdString" - } - }, - "required": [ - "challengeType", - "relationship" - ], - "additionalProperties": false - }, - "RelationshipIdString": { - "type": "string", - "pattern": "REL[A-Za-z0-9]{17}" - }, - "CreateIdentityChallengeRequest": { - "type": "object", - "properties": { - "challengeType": { - "type": "string", - "const": "Identity" - } - }, - "required": [ - "challengeType" - ], - "additionalProperties": false - }, - "CreateDeviceChallengeRequest": { - "type": "object", - "properties": { - "challengeType": { - "type": "string", - "const": "Device" - } - }, - "required": [ - "challengeType" - ], - "additionalProperties": false - } - } -} - -export const ValidateChallengeRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/ValidateChallengeRequest", - "definitions": { - "ValidateChallengeRequest": { - "type": "object", - "properties": { - "challengeString": { - "type": "string" - }, - "signature": { - "type": "string" - } - }, - "required": [ - "challengeString", - "signature" - ], - "additionalProperties": false - } - } -} - -export const DeleteDeviceRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/DeleteDeviceRequest", - "definitions": { - "DeleteDeviceRequest": { - "type": "object", - "properties": { - "id": { - "$ref": "#/definitions/DeviceIdString" - } - }, - "required": [ - "id" - ], - "additionalProperties": false - }, - "DeviceIdString": { - "type": "string", - "pattern": "DVC[A-Za-z0-9]{17}" - } - } -} - -export const FillDeviceOnboardingTokenWithNewDeviceRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/FillDeviceOnboardingTokenWithNewDeviceRequest", - "definitions": { - "FillDeviceOnboardingTokenWithNewDeviceRequest": { - "type": "object", - "properties": { - "reference": { - "anyOf": [ - { - "$ref": "#/definitions/TokenReferenceString" - }, - { - "$ref": "#/definitions/URLTokenReferenceString" - } - ] - }, - "profileName": { - "type": "string" - }, - "isAdmin": { - "type": "boolean" - } - }, - "required": [ - "reference" - ], - "additionalProperties": false - }, - "TokenReferenceString": { - "type": "string", - "pattern": "VE9L.{84}" - }, - "URLTokenReferenceString": { - "type": "string", - "pattern": "^https?:\\/\\/.*\\/r\\/TOK[a-zA-Z0-9]+(\\?app=.+)?#[a-zA-Z0-9-_]+$" - } - } -} - -export const GetDeviceRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetDeviceRequest", - "definitions": { - "GetDeviceRequest": { - "type": "object", - "properties": { - "id": { - "$ref": "#/definitions/DeviceIdString" + "properties": { + "value": {} + }, + "required": [ + "value" + ], + "additionalProperties": false } - }, - "required": [ - "id" - ], - "additionalProperties": false - }, - "DeviceIdString": { - "type": "string", - "pattern": "DVC[A-Za-z0-9]{17}" + } } } } -export const SetCommunicationLanguageRequest: any = { +export const CreateDeviceChallengeRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/SetCommunicationLanguageRequest", + "$ref": "#/definitions/CreateDeviceChallengeRequest", "definitions": { - "SetCommunicationLanguageRequest": { + "CreateDeviceChallengeRequest": { "type": "object", "properties": { - "communicationLanguage": { + "challengeType": { "type": "string", - "enum": [ - "aa", - "ab", - "ae", - "af", - "ak", - "am", - "an", - "ar", - "as", - "av", - "ay", - "az", - "ba", - "be", - "bg", - "bi", - "bm", - "bn", - "bo", - "br", - "bs", - "ca", - "ce", - "ch", - "co", - "cr", - "cs", - "cu", - "cv", - "cy", - "da", - "de", - "dv", - "dz", - "ee", - "el", - "en", - "eo", - "es", - "et", - "eu", - "fa", - "ff", - "fi", - "fj", - "fo", - "fr", - "fy", - "ga", - "gd", - "gl", - "gn", - "gu", - "gv", - "ha", - "he", - "hi", - "ho", - "hr", - "ht", - "hu", - "hy", - "hz", - "ia", - "id", - "ie", - "ig", - "ii", - "ik", - "io", - "is", - "it", - "iu", - "ja", - "jv", - "ka", - "kg", - "ki", - "kj", - "kk", - "kl", - "km", - "kn", - "ko", - "kr", - "ks", - "ku", - "kv", - "kw", - "ky", - "la", - "lb", - "lg", - "li", - "ln", - "lo", - "lt", - "lu", - "lv", - "mg", - "mh", - "mi", - "mk", - "ml", - "mn", - "mr", - "ms", - "mt", - "my", - "na", - "nb", - "nd", - "ne", - "ng", - "nl", - "nn", - "no", - "nr", - "nv", - "ny", - "oc", - "oj", - "om", - "or", - "os", - "pa", - "pi", - "pl", - "ps", - "pt", - "qu", - "rm", - "rn", - "ro", - "ru", - "rw", - "sa", - "sc", - "sd", - "se", - "sg", - "si", - "sk", - "sl", - "sm", - "sn", - "so", - "sq", - "sr", - "ss", - "st", - "su", - "sv", - "sw", - "ta", - "te", - "tg", - "th", - "ti", - "tk", - "tl", - "tn", - "to", - "tr", - "ts", - "tt", - "tw", - "ty", - "ug", - "uk", - "ur", - "uz", - "ve", - "vi", - "vo", - "wa", - "wo", - "xh", - "yi", - "yo", - "za", - "zh", - "zu" - ] + "const": "Device" } }, "required": [ - "communicationLanguage" + "challengeType" ], "additionalProperties": false } } } -export const UpdateCurrentDeviceRequest: any = { +export const isCreateDeviceChallengeRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/UpdateCurrentDeviceRequest", + "$ref": "#/definitions/isCreateDeviceChallengeRequest", "definitions": { - "UpdateCurrentDeviceRequest": { + "isCreateDeviceChallengeRequest": { + "$comment": "(value: any) => value is CreateDeviceChallengeRequest", "type": "object", "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" + "namedArgs": { + "type": "object", + "properties": { + "value": {} + }, + "required": [ + "value" + ], + "additionalProperties": false } - }, - "additionalProperties": false + } } } } -export const UpdateDeviceRequest: any = { +export const CreateChallengeRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/UpdateDeviceRequest", + "$ref": "#/definitions/CreateChallengeRequest", "definitions": { - "UpdateDeviceRequest": { + "CreateChallengeRequest": { + "anyOf": [ + { + "$ref": "#/definitions/CreateRelationshipChallengeRequest" + }, + { + "$ref": "#/definitions/CreateIdentityChallengeRequest" + }, + { + "$ref": "#/definitions/CreateDeviceChallengeRequest" + } + ] + }, + "CreateRelationshipChallengeRequest": { "type": "object", "properties": { - "id": { - "$ref": "#/definitions/DeviceIdString" - }, - "name": { - "type": "string" + "challengeType": { + "type": "string", + "const": "Relationship" }, - "description": { - "type": "string" + "relationship": { + "$ref": "#/definitions/RelationshipIdString" } }, "required": [ - "id" + "challengeType", + "relationship" ], "additionalProperties": false }, - "DeviceIdString": { + "RelationshipIdString": { "type": "string", - "pattern": "DVC[A-Za-z0-9]{17}" - } - } -} - -export const CreateIdentityRecoveryKitRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateIdentityRecoveryKitRequest", - "definitions": { - "CreateIdentityRecoveryKitRequest": { + "pattern": "REL[A-Za-z0-9]{17}" + }, + "CreateIdentityChallengeRequest": { "type": "object", "properties": { - "profileName": { - "type": "string" - }, - "passwordProtection": { - "type": "object", - "properties": { - "password": { - "type": "string", - "minLength": 1 - }, - "passwordIsPin": { - "type": "boolean", - "const": true - } - }, - "required": [ - "password" - ], - "additionalProperties": false + "challengeType": { + "type": "string", + "const": "Identity" } }, "required": [ - "profileName", - "passwordProtection" + "challengeType" + ], + "additionalProperties": false + }, + "CreateDeviceChallengeRequest": { + "type": "object", + "properties": { + "challengeType": { + "type": "string", + "const": "Device" + } + }, + "required": [ + "challengeType" ], "additionalProperties": false } } } -export const GetAttachmentMetadataRequest: any = { +export const ValidateChallengeRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetAttachmentMetadataRequest", + "$ref": "#/definitions/ValidateChallengeRequest", "definitions": { - "GetAttachmentMetadataRequest": { + "ValidateChallengeRequest": { "type": "object", "properties": { - "id": { - "$ref": "#/definitions/MessageIdString" + "challengeString": { + "type": "string" }, - "attachmentId": { - "$ref": "#/definitions/FileIdString" + "signature": { + "type": "string" } }, "required": [ - "id", - "attachmentId" + "challengeString", + "signature" ], "additionalProperties": false - }, - "MessageIdString": { - "type": "string", - "pattern": "MSG[A-Za-z0-9]{17}" - }, - "FileIdString": { - "type": "string", - "pattern": "FIL[A-Za-z0-9]{17}" } } } -export const GetMessageRequest: any = { +export const DeleteDeviceRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetMessageRequest", + "$ref": "#/definitions/DeleteDeviceRequest", "definitions": { - "GetMessageRequest": { + "DeleteDeviceRequest": { "type": "object", "properties": { "id": { - "$ref": "#/definitions/MessageIdString" + "$ref": "#/definitions/DeviceIdString" } }, "required": [ @@ -18800,492 +18840,439 @@ export const GetMessageRequest: any = { ], "additionalProperties": false }, - "MessageIdString": { + "DeviceIdString": { "type": "string", - "pattern": "MSG[A-Za-z0-9]{17}" + "pattern": "DVC[A-Za-z0-9]{17}" } } } -export const GetMessagesRequest: any = { +export const FillDeviceOnboardingTokenWithNewDeviceRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetMessagesRequest", + "$ref": "#/definitions/FillDeviceOnboardingTokenWithNewDeviceRequest", "definitions": { - "GetMessagesRequest": { - "type": "object", - "properties": { - "query": { - "$ref": "#/definitions/GetMessagesQuery" - } - }, - "additionalProperties": false - }, - "GetMessagesQuery": { + "FillDeviceOnboardingTokenWithNewDeviceRequest": { "type": "object", - "properties": { - "isOwn": { - "type": "string" - }, - "createdBy": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "createdByDevice": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "createdAt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "content.@type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "content.body": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "content.bodyFormat": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "content.subject": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "attachments": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "recipients.address": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "recipients.relationshipId": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "wasReadAt": { + "properties": { + "reference": { "anyOf": [ { - "type": "string" + "$ref": "#/definitions/TokenReferenceString" }, { - "type": "array", - "items": { - "type": "string" - } + "$ref": "#/definitions/URLTokenReferenceString" } ] }, - "participant": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } + "profileName": { + "type": "string" + }, + "isAdmin": { + "type": "boolean" + } + }, + "required": [ + "reference" + ], + "additionalProperties": false + }, + "TokenReferenceString": { + "type": "string", + "pattern": "VE9L.{84}" + }, + "URLTokenReferenceString": { + "type": "string", + "pattern": "^https?:\\/\\/.*\\/r\\/TOK[a-zA-Z0-9]+(\\?app=.+)?#[a-zA-Z0-9-_]+$" + } + } +} + +export const GetDeviceRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/GetDeviceRequest", + "definitions": { + "GetDeviceRequest": { + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/DeviceIdString" + } + }, + "required": [ + "id" + ], + "additionalProperties": false + }, + "DeviceIdString": { + "type": "string", + "pattern": "DVC[A-Za-z0-9]{17}" + } + } +} + +export const SetCommunicationLanguageRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/SetCommunicationLanguageRequest", + "definitions": { + "SetCommunicationLanguageRequest": { + "type": "object", + "properties": { + "communicationLanguage": { + "type": "string", + "enum": [ + "aa", + "ab", + "ae", + "af", + "ak", + "am", + "an", + "ar", + "as", + "av", + "ay", + "az", + "ba", + "be", + "bg", + "bi", + "bm", + "bn", + "bo", + "br", + "bs", + "ca", + "ce", + "ch", + "co", + "cr", + "cs", + "cu", + "cv", + "cy", + "da", + "de", + "dv", + "dz", + "ee", + "el", + "en", + "eo", + "es", + "et", + "eu", + "fa", + "ff", + "fi", + "fj", + "fo", + "fr", + "fy", + "ga", + "gd", + "gl", + "gn", + "gu", + "gv", + "ha", + "he", + "hi", + "ho", + "hr", + "ht", + "hu", + "hy", + "hz", + "ia", + "id", + "ie", + "ig", + "ii", + "ik", + "io", + "is", + "it", + "iu", + "ja", + "jv", + "ka", + "kg", + "ki", + "kj", + "kk", + "kl", + "km", + "kn", + "ko", + "kr", + "ks", + "ku", + "kv", + "kw", + "ky", + "la", + "lb", + "lg", + "li", + "ln", + "lo", + "lt", + "lu", + "lv", + "mg", + "mh", + "mi", + "mk", + "ml", + "mn", + "mr", + "ms", + "mt", + "my", + "na", + "nb", + "nd", + "ne", + "ng", + "nl", + "nn", + "no", + "nr", + "nv", + "ny", + "oc", + "oj", + "om", + "or", + "os", + "pa", + "pi", + "pl", + "ps", + "pt", + "qu", + "rm", + "rn", + "ro", + "ru", + "rw", + "sa", + "sc", + "sd", + "se", + "sg", + "si", + "sk", + "sl", + "sm", + "sn", + "so", + "sq", + "sr", + "ss", + "st", + "su", + "sv", + "sw", + "ta", + "te", + "tg", + "th", + "ti", + "tk", + "tl", + "tn", + "to", + "tr", + "ts", + "tt", + "tw", + "ty", + "ug", + "uk", + "ur", + "uz", + "ve", + "vi", + "vo", + "wa", + "wo", + "xh", + "yi", + "yo", + "za", + "zh", + "zu" ] } }, - "additionalProperties": false - } - } -} - -export const MarkMessageAsReadRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/MarkMessageAsReadRequest", - "definitions": { - "MarkMessageAsReadRequest": { - "type": "object", - "properties": { - "id": { - "$ref": "#/definitions/MessageIdString" - } - }, - "required": [ - "id" - ], - "additionalProperties": false - }, - "MessageIdString": { - "type": "string", - "pattern": "MSG[A-Za-z0-9]{17}" - } - } -} - -export const MarkMessageAsUnreadRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/MarkMessageAsUnreadRequest", - "definitions": { - "MarkMessageAsUnreadRequest": { - "type": "object", - "properties": { - "id": { - "$ref": "#/definitions/MessageIdString" - } - }, "required": [ - "id" + "communicationLanguage" ], "additionalProperties": false - }, - "MessageIdString": { - "type": "string", - "pattern": "MSG[A-Za-z0-9]{17}" } } } -export const SendMessageRequest: any = { +export const UpdateCurrentDeviceRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/SendMessageRequest", + "$ref": "#/definitions/UpdateCurrentDeviceRequest", "definitions": { - "SendMessageRequest": { + "UpdateCurrentDeviceRequest": { "type": "object", - "additionalProperties": false, "properties": { - "recipients": { - "type": "array", - "items": { - "$ref": "#/definitions/AddressString" - }, - "minItems": 1, - "uniqueItems": true + "name": { + "type": "string" }, - "content": {}, - "attachments": { - "type": "array", - "items": { - "$ref": "#/definitions/FileIdString" - }, - "uniqueItems": true - } - }, - "required": [ - "content", - "recipients" - ] - }, - "AddressString": { - "type": "string", - "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" - }, - "FileIdString": { - "type": "string", - "pattern": "FIL[A-Za-z0-9]{17}" - } - } -} - -export const AcceptRelationshipRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/AcceptRelationshipRequest", - "definitions": { - "AcceptRelationshipRequest": { - "type": "object", - "properties": { - "relationshipId": { - "$ref": "#/definitions/RelationshipIdString" - } - }, - "required": [ - "relationshipId" - ], - "additionalProperties": false - }, - "RelationshipIdString": { - "type": "string", - "pattern": "REL[A-Za-z0-9]{17}" - } - } -} - -export const AcceptRelationshipReactivationRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/AcceptRelationshipReactivationRequest", - "definitions": { - "AcceptRelationshipReactivationRequest": { - "type": "object", - "properties": { - "relationshipId": { - "$ref": "#/definitions/RelationshipIdString" + "description": { + "type": "string" } }, - "required": [ - "relationshipId" - ], "additionalProperties": false - }, - "RelationshipIdString": { - "type": "string", - "pattern": "REL[A-Za-z0-9]{17}" } } } -export const CanCreateRelationshipRequest: any = { +export const UpdateDeviceRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CanCreateRelationshipRequest", + "$ref": "#/definitions/UpdateDeviceRequest", "definitions": { - "CanCreateRelationshipRequest": { + "UpdateDeviceRequest": { "type": "object", "properties": { - "templateId": { - "$ref": "#/definitions/RelationshipTemplateIdString" + "id": { + "$ref": "#/definitions/DeviceIdString" }, - "creationContent": {} - }, - "required": [ - "templateId" - ], - "additionalProperties": false - }, - "RelationshipTemplateIdString": { - "type": "string", - "pattern": "RLT[A-Za-z0-9]{17}" - } - } -} - -export const CreateRelationshipRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateRelationshipRequest", - "definitions": { - "CreateRelationshipRequest": { - "type": "object", - "properties": { - "templateId": { - "$ref": "#/definitions/RelationshipTemplateIdString" + "name": { + "type": "string" }, - "creationContent": {} + "description": { + "type": "string" + } }, "required": [ - "templateId", - "creationContent" + "id" ], "additionalProperties": false }, - "RelationshipTemplateIdString": { + "DeviceIdString": { "type": "string", - "pattern": "RLT[A-Za-z0-9]{17}" + "pattern": "DVC[A-Za-z0-9]{17}" } } } -export const DecomposeRelationshipRequest: any = { +export const CreateIdentityRecoveryKitRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/DecomposeRelationshipRequest", + "$ref": "#/definitions/CreateIdentityRecoveryKitRequest", "definitions": { - "DecomposeRelationshipRequest": { + "CreateIdentityRecoveryKitRequest": { "type": "object", "properties": { - "relationshipId": { - "$ref": "#/definitions/RelationshipIdString" + "profileName": { + "type": "string" + }, + "passwordProtection": { + "type": "object", + "properties": { + "password": { + "type": "string", + "minLength": 1 + }, + "passwordIsPin": { + "type": "boolean", + "const": true + } + }, + "required": [ + "password" + ], + "additionalProperties": false } }, "required": [ - "relationshipId" + "profileName", + "passwordProtection" ], "additionalProperties": false - }, - "RelationshipIdString": { - "type": "string", - "pattern": "REL[A-Za-z0-9]{17}" } } } -export const GetAttributesForRelationshipRequest: any = { +export const GetAttachmentMetadataRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetAttributesForRelationshipRequest", + "$ref": "#/definitions/GetAttachmentMetadataRequest", "definitions": { - "GetAttributesForRelationshipRequest": { + "GetAttachmentMetadataRequest": { "type": "object", "properties": { "id": { - "$ref": "#/definitions/RelationshipIdString" - }, - "hideTechnical": { - "type": "boolean" + "$ref": "#/definitions/MessageIdString" }, - "onlyLatestVersions": { - "type": "boolean", - "description": "default: true" + "attachmentId": { + "$ref": "#/definitions/FileIdString" } }, "required": [ - "id" + "id", + "attachmentId" ], "additionalProperties": false }, - "RelationshipIdString": { + "MessageIdString": { "type": "string", - "pattern": "REL[A-Za-z0-9]{17}" - } - } -} - -export const GetRelationshipRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetRelationshipRequest", - "definitions": { - "GetRelationshipRequest": { - "type": "object", - "properties": { - "id": { - "$ref": "#/definitions/RelationshipIdString" - } - }, - "required": [ - "id" - ], - "additionalProperties": false + "pattern": "MSG[A-Za-z0-9]{17}" }, - "RelationshipIdString": { + "FileIdString": { "type": "string", - "pattern": "REL[A-Za-z0-9]{17}" + "pattern": "FIL[A-Za-z0-9]{17}" } } } -export const GetRelationshipByAddressRequest: any = { +export const GetMessageRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetRelationshipByAddressRequest", + "$ref": "#/definitions/GetMessageRequest", "definitions": { - "GetRelationshipByAddressRequest": { + "GetMessageRequest": { "type": "object", "properties": { - "address": { - "$ref": "#/definitions/AddressString" + "id": { + "$ref": "#/definitions/MessageIdString" } }, "required": [ - "address" + "id" ], "additionalProperties": false }, - "AddressString": { + "MessageIdString": { "type": "string", - "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" + "pattern": "MSG[A-Za-z0-9]{17}" } } } -export const GetRelationshipsRequest: any = { +export const GetMessagesRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetRelationshipsRequest", + "$ref": "#/definitions/GetMessagesRequest", "definitions": { - "GetRelationshipsRequest": { + "GetMessagesRequest": { "type": "object", "properties": { "query": { - "$ref": "#/definitions/GetRelationshipsQuery" + "$ref": "#/definitions/GetMessagesQuery" } }, "additionalProperties": false }, - "GetRelationshipsQuery": { + "GetMessagesQuery": { "type": "object", "properties": { - "peer": { + "isOwn": { + "type": "string" + }, + "createdBy": { "anyOf": [ { "type": "string" @@ -19298,7 +19285,7 @@ export const GetRelationshipsRequest: any = { } ] }, - "status": { + "createdByDevice": { "anyOf": [ { "type": "string" @@ -19311,7 +19298,124 @@ export const GetRelationshipsRequest: any = { } ] }, - "templateId": { + "createdAt": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "content.@type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "content.body": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "content.bodyFormat": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "content.subject": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "attachments": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "recipients.address": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "recipients.relationshipId": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "wasReadAt": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "participant": { "anyOf": [ { "type": "string" @@ -19330,57 +19434,98 @@ export const GetRelationshipsRequest: any = { } } -export const RejectRelationshipRequest: any = { +export const MarkMessageAsReadRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/RejectRelationshipRequest", + "$ref": "#/definitions/MarkMessageAsReadRequest", "definitions": { - "RejectRelationshipRequest": { + "MarkMessageAsReadRequest": { "type": "object", "properties": { - "relationshipId": { - "$ref": "#/definitions/RelationshipIdString" + "id": { + "$ref": "#/definitions/MessageIdString" } }, "required": [ - "relationshipId" + "id" ], "additionalProperties": false }, - "RelationshipIdString": { + "MessageIdString": { "type": "string", - "pattern": "REL[A-Za-z0-9]{17}" + "pattern": "MSG[A-Za-z0-9]{17}" } } } -export const RejectRelationshipReactivationRequest: any = { +export const MarkMessageAsUnreadRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/RejectRelationshipReactivationRequest", + "$ref": "#/definitions/MarkMessageAsUnreadRequest", "definitions": { - "RejectRelationshipReactivationRequest": { + "MarkMessageAsUnreadRequest": { "type": "object", "properties": { - "relationshipId": { - "$ref": "#/definitions/RelationshipIdString" + "id": { + "$ref": "#/definitions/MessageIdString" } }, "required": [ - "relationshipId" + "id" ], "additionalProperties": false }, - "RelationshipIdString": { + "MessageIdString": { "type": "string", - "pattern": "REL[A-Za-z0-9]{17}" + "pattern": "MSG[A-Za-z0-9]{17}" } } } -export const RequestRelationshipReactivationRequest: any = { +export const SendMessageRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/RequestRelationshipReactivationRequest", + "$ref": "#/definitions/SendMessageRequest", "definitions": { - "RequestRelationshipReactivationRequest": { + "SendMessageRequest": { + "type": "object", + "additionalProperties": false, + "properties": { + "recipients": { + "type": "array", + "items": { + "$ref": "#/definitions/AddressString" + }, + "minItems": 1, + "uniqueItems": true + }, + "content": {}, + "attachments": { + "type": "array", + "items": { + "$ref": "#/definitions/FileIdString" + }, + "uniqueItems": true + } + }, + "required": [ + "content", + "recipients" + ] + }, + "AddressString": { + "type": "string", + "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" + }, + "FileIdString": { + "type": "string", + "pattern": "FIL[A-Za-z0-9]{17}" + } + } +} + +export const AcceptRelationshipRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/AcceptRelationshipRequest", + "definitions": { + "AcceptRelationshipRequest": { "type": "object", "properties": { "relationshipId": { @@ -19399,11 +19544,11 @@ export const RequestRelationshipReactivationRequest: any = { } } -export const RevokeRelationshipRequest: any = { +export const AcceptRelationshipReactivationRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/RevokeRelationshipRequest", + "$ref": "#/definitions/AcceptRelationshipReactivationRequest", "definitions": { - "RevokeRelationshipRequest": { + "AcceptRelationshipReactivationRequest": { "type": "object", "properties": { "relationshipId": { @@ -19422,310 +19567,171 @@ export const RevokeRelationshipRequest: any = { } } -export const RevokeRelationshipReactivationRequest: any = { +export const CanCreateRelationshipRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/RevokeRelationshipReactivationRequest", + "$ref": "#/definitions/CanCreateRelationshipRequest", "definitions": { - "RevokeRelationshipReactivationRequest": { + "CanCreateRelationshipRequest": { "type": "object", "properties": { - "relationshipId": { - "$ref": "#/definitions/RelationshipIdString" - } + "templateId": { + "$ref": "#/definitions/RelationshipTemplateIdString" + }, + "creationContent": {} }, "required": [ - "relationshipId" + "templateId" ], "additionalProperties": false }, - "RelationshipIdString": { + "RelationshipTemplateIdString": { "type": "string", - "pattern": "REL[A-Za-z0-9]{17}" + "pattern": "RLT[A-Za-z0-9]{17}" } } } -export const TerminateRelationshipRequest: any = { +export const CreateRelationshipRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/TerminateRelationshipRequest", + "$ref": "#/definitions/CreateRelationshipRequest", "definitions": { - "TerminateRelationshipRequest": { + "CreateRelationshipRequest": { "type": "object", "properties": { - "relationshipId": { - "$ref": "#/definitions/RelationshipIdString" - } + "templateId": { + "$ref": "#/definitions/RelationshipTemplateIdString" + }, + "creationContent": {} }, "required": [ - "relationshipId" + "templateId", + "creationContent" ], "additionalProperties": false }, - "RelationshipIdString": { + "RelationshipTemplateIdString": { "type": "string", - "pattern": "REL[A-Za-z0-9]{17}" + "pattern": "RLT[A-Za-z0-9]{17}" } } } -export const CreateOwnRelationshipTemplateRequest: any = { +export const DecomposeRelationshipRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateOwnRelationshipTemplateRequest", + "$ref": "#/definitions/DecomposeRelationshipRequest", "definitions": { - "CreateOwnRelationshipTemplateRequest": { + "DecomposeRelationshipRequest": { "type": "object", "properties": { - "expiresAt": { - "$ref": "#/definitions/ISO8601DateTimeString" - }, - "content": {}, - "maxNumberOfAllocations": { - "type": "number", - "minimum": 1 - }, - "forIdentity": { - "$ref": "#/definitions/AddressString" - }, - "passwordProtection": { - "type": "object", - "properties": { - "password": { - "type": "string", - "minLength": 1 - }, - "passwordIsPin": { - "type": "boolean", - "const": true - }, - "passwordLocationIndicator": {} - }, - "required": [ - "password" - ], - "additionalProperties": false + "relationshipId": { + "$ref": "#/definitions/RelationshipIdString" } }, "required": [ - "expiresAt", - "content" + "relationshipId" ], "additionalProperties": false }, - "ISO8601DateTimeString": { - "type": "string", - "errorMessage": "must match ISO8601 datetime format", - "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" - }, - "AddressString": { + "RelationshipIdString": { "type": "string", - "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" + "pattern": "REL[A-Za-z0-9]{17}" } } } -export const CreateTokenForOwnRelationshipTemplateRequest: any = { +export const GetAttributesForRelationshipRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateTokenForOwnRelationshipTemplateRequest", + "$ref": "#/definitions/GetAttributesForRelationshipRequest", "definitions": { - "CreateTokenForOwnRelationshipTemplateRequest": { + "GetAttributesForRelationshipRequest": { "type": "object", "properties": { - "templateId": { - "$ref": "#/definitions/RelationshipTemplateIdString" - }, - "expiresAt": { - "$ref": "#/definitions/ISO8601DateTimeString" + "id": { + "$ref": "#/definitions/RelationshipIdString" }, - "ephemeral": { + "hideTechnical": { "type": "boolean" }, - "forIdentity": { - "$ref": "#/definitions/AddressString" - }, - "passwordProtection": { - "type": "object", - "properties": { - "password": { - "type": "string", - "minLength": 1 - }, - "passwordIsPin": { - "type": "boolean", - "const": true - }, - "passwordLocationIndicator": {} - }, - "required": [ - "password" - ], - "additionalProperties": false + "onlyLatestVersions": { + "type": "boolean", + "description": "default: true" } }, "required": [ - "templateId" + "id" ], "additionalProperties": false }, - "RelationshipTemplateIdString": { - "type": "string", - "pattern": "RLT[A-Za-z0-9]{17}" - }, - "ISO8601DateTimeString": { - "type": "string", - "errorMessage": "must match ISO8601 datetime format", - "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" - }, - "AddressString": { + "RelationshipIdString": { "type": "string", - "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" + "pattern": "REL[A-Za-z0-9]{17}" } } } -export const DeleteRelationshipTemplateRequest: any = { +export const GetRelationshipRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/DeleteRelationshipTemplateRequest", + "$ref": "#/definitions/GetRelationshipRequest", "definitions": { - "DeleteRelationshipTemplateRequest": { + "GetRelationshipRequest": { "type": "object", "properties": { - "templateId": { - "$ref": "#/definitions/RelationshipTemplateIdString" + "id": { + "$ref": "#/definitions/RelationshipIdString" } }, "required": [ - "templateId" + "id" ], "additionalProperties": false }, - "RelationshipTemplateIdString": { + "RelationshipIdString": { "type": "string", - "pattern": "RLT[A-Za-z0-9]{17}" + "pattern": "REL[A-Za-z0-9]{17}" } } } -export const GetRelationshipTemplateRequest: any = { +export const GetRelationshipByAddressRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetRelationshipTemplateRequest", + "$ref": "#/definitions/GetRelationshipByAddressRequest", "definitions": { - "GetRelationshipTemplateRequest": { + "GetRelationshipByAddressRequest": { "type": "object", "properties": { - "id": { - "$ref": "#/definitions/RelationshipTemplateIdString" + "address": { + "$ref": "#/definitions/AddressString" } }, "required": [ - "id" + "address" ], "additionalProperties": false }, - "RelationshipTemplateIdString": { + "AddressString": { "type": "string", - "pattern": "RLT[A-Za-z0-9]{17}" + "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" } } } -export const GetRelationshipTemplatesRequest: any = { +export const GetRelationshipsRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetRelationshipTemplatesRequest", + "$ref": "#/definitions/GetRelationshipsRequest", "definitions": { - "GetRelationshipTemplatesRequest": { + "GetRelationshipsRequest": { "type": "object", "properties": { "query": { - "$ref": "#/definitions/GetRelationshipTemplatesQuery" - }, - "ownerRestriction": { - "$ref": "#/definitions/OwnerRestriction" + "$ref": "#/definitions/GetRelationshipsQuery" } }, "additionalProperties": false }, - "GetRelationshipTemplatesQuery": { + "GetRelationshipsQuery": { "type": "object", "properties": { - "isOwn": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "createdAt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "expiresAt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "createdBy": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "createdByDevice": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "maxNumberOfAllocations": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "forIdentity": { + "peer": { "anyOf": [ { "type": "string" @@ -19733,19 +19739,12 @@ export const GetRelationshipTemplatesRequest: any = { { "type": "array", "items": { - "type": "string" - } - } - ] - }, - "passwordProtection": { - "type": "string", - "enum": [ - "", - "!" + "type": "string" + } + } ] }, - "passwordProtection.password": { + "status": { "anyOf": [ { "type": "string" @@ -19758,14 +19757,7 @@ export const GetRelationshipTemplatesRequest: any = { } ] }, - "passwordProtection.passwordIsPin": { - "type": "string", - "enum": [ - "true", - "!" - ] - }, - "passwordProtection.passwordLocationIndicator": { + "templateId": { "anyOf": [ { "type": "string" @@ -19780,77 +19772,213 @@ export const GetRelationshipTemplatesRequest: any = { } }, "additionalProperties": false + } + } +} + +export const RejectRelationshipRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/RejectRelationshipRequest", + "definitions": { + "RejectRelationshipRequest": { + "type": "object", + "properties": { + "relationshipId": { + "$ref": "#/definitions/RelationshipIdString" + } + }, + "required": [ + "relationshipId" + ], + "additionalProperties": false }, - "OwnerRestriction": { + "RelationshipIdString": { "type": "string", - "enum": [ - "o", - "p" - ] + "pattern": "REL[A-Za-z0-9]{17}" } } } -export const LoadPeerRelationshipTemplateRequest: any = { +export const RejectRelationshipReactivationRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/LoadPeerRelationshipTemplateRequest", + "$ref": "#/definitions/RejectRelationshipReactivationRequest", "definitions": { - "LoadPeerRelationshipTemplateRequest": { + "RejectRelationshipReactivationRequest": { "type": "object", "properties": { - "reference": { - "anyOf": [ - { - "$ref": "#/definitions/TokenReferenceString" - }, - { - "$ref": "#/definitions/RelationshipTemplateReferenceString" - }, - { - "$ref": "#/definitions/URLTokenReferenceString" - }, - { - "$ref": "#/definitions/URLRelationshipTemplateReferenceString" - } - ] - }, - "password": { - "type": "string" + "relationshipId": { + "$ref": "#/definitions/RelationshipIdString" } }, "required": [ - "reference" + "relationshipId" ], - "additionalProperties": false, - "errorMessage": "token / relationship template reference invalid" + "additionalProperties": false }, - "TokenReferenceString": { + "RelationshipIdString": { "type": "string", - "pattern": "VE9L.{84}" + "pattern": "REL[A-Za-z0-9]{17}" + } + } +} + +export const RequestRelationshipReactivationRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/RequestRelationshipReactivationRequest", + "definitions": { + "RequestRelationshipReactivationRequest": { + "type": "object", + "properties": { + "relationshipId": { + "$ref": "#/definitions/RelationshipIdString" + } + }, + "required": [ + "relationshipId" + ], + "additionalProperties": false }, - "RelationshipTemplateReferenceString": { + "RelationshipIdString": { "type": "string", - "pattern": "UkxU.{84}" + "pattern": "REL[A-Za-z0-9]{17}" + } + } +} + +export const RevokeRelationshipRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/RevokeRelationshipRequest", + "definitions": { + "RevokeRelationshipRequest": { + "type": "object", + "properties": { + "relationshipId": { + "$ref": "#/definitions/RelationshipIdString" + } + }, + "required": [ + "relationshipId" + ], + "additionalProperties": false }, - "URLTokenReferenceString": { + "RelationshipIdString": { "type": "string", - "pattern": "^https?:\\/\\/.*\\/r\\/TOK[a-zA-Z0-9]+(\\?app=.+)?#[a-zA-Z0-9-_]+$" + "pattern": "REL[A-Za-z0-9]{17}" + } + } +} + +export const RevokeRelationshipReactivationRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/RevokeRelationshipReactivationRequest", + "definitions": { + "RevokeRelationshipReactivationRequest": { + "type": "object", + "properties": { + "relationshipId": { + "$ref": "#/definitions/RelationshipIdString" + } + }, + "required": [ + "relationshipId" + ], + "additionalProperties": false }, - "URLRelationshipTemplateReferenceString": { + "RelationshipIdString": { "type": "string", - "pattern": "^https?:\\/\\/.*\\/r\\/RLT[a-zA-Z0-9]+(\\?app=.+)?#[a-zA-Z0-9-_]+$" + "pattern": "REL[A-Za-z0-9]{17}" } } } -export const CreateOwnTokenRequest: any = { +export const TerminateRelationshipRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateOwnTokenRequest", + "$ref": "#/definitions/TerminateRelationshipRequest", "definitions": { - "CreateOwnTokenRequest": { + "TerminateRelationshipRequest": { + "type": "object", + "properties": { + "relationshipId": { + "$ref": "#/definitions/RelationshipIdString" + } + }, + "required": [ + "relationshipId" + ], + "additionalProperties": false + }, + "RelationshipIdString": { + "type": "string", + "pattern": "REL[A-Za-z0-9]{17}" + } + } +} + +export const CreateOwnRelationshipTemplateRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/CreateOwnRelationshipTemplateRequest", + "definitions": { + "CreateOwnRelationshipTemplateRequest": { "type": "object", "properties": { + "expiresAt": { + "$ref": "#/definitions/ISO8601DateTimeString" + }, "content": {}, + "maxNumberOfAllocations": { + "type": "number", + "minimum": 1 + }, + "forIdentity": { + "$ref": "#/definitions/AddressString" + }, + "passwordProtection": { + "type": "object", + "properties": { + "password": { + "type": "string", + "minLength": 1 + }, + "passwordIsPin": { + "type": "boolean", + "const": true + }, + "passwordLocationIndicator": {} + }, + "required": [ + "password" + ], + "additionalProperties": false + } + }, + "required": [ + "expiresAt", + "content" + ], + "additionalProperties": false + }, + "ISO8601DateTimeString": { + "type": "string", + "errorMessage": "must match ISO8601 datetime format", + "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" + }, + "AddressString": { + "type": "string", + "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" + } + } +} + +export const CreateTokenForOwnRelationshipTemplateRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/CreateTokenForOwnRelationshipTemplateRequest", + "definitions": { + "CreateTokenForOwnRelationshipTemplateRequest": { + "type": "object", + "properties": { + "templateId": { + "$ref": "#/definitions/RelationshipTemplateIdString" + }, "expiresAt": { "$ref": "#/definitions/ISO8601DateTimeString" }, @@ -19880,12 +20008,14 @@ export const CreateOwnTokenRequest: any = { } }, "required": [ - "content", - "expiresAt", - "ephemeral" + "templateId" ], "additionalProperties": false }, + "RelationshipTemplateIdString": { + "type": "string", + "pattern": "RLT[A-Za-z0-9]{17}" + }, "ISO8601DateTimeString": { "type": "string", "errorMessage": "must match ISO8601 datetime format", @@ -19898,38 +20028,38 @@ export const CreateOwnTokenRequest: any = { } } -export const DeleteTokenRequest: any = { +export const DeleteRelationshipTemplateRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/DeleteTokenRequest", + "$ref": "#/definitions/DeleteRelationshipTemplateRequest", "definitions": { - "DeleteTokenRequest": { + "DeleteRelationshipTemplateRequest": { "type": "object", "properties": { - "tokenId": { - "$ref": "#/definitions/TokenIdString" + "templateId": { + "$ref": "#/definitions/RelationshipTemplateIdString" } }, "required": [ - "tokenId" + "templateId" ], "additionalProperties": false }, - "TokenIdString": { + "RelationshipTemplateIdString": { "type": "string", - "pattern": "TOK[A-Za-z0-9]{17}" + "pattern": "RLT[A-Za-z0-9]{17}" } } } -export const GetTokenRequest: any = { +export const GetRelationshipTemplateRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetTokenRequest", + "$ref": "#/definitions/GetRelationshipTemplateRequest", "definitions": { - "GetTokenRequest": { + "GetRelationshipTemplateRequest": { "type": "object", "properties": { "id": { - "$ref": "#/definitions/TokenIdString" + "$ref": "#/definitions/RelationshipTemplateIdString" } }, "required": [ @@ -19937,22 +20067,22 @@ export const GetTokenRequest: any = { ], "additionalProperties": false }, - "TokenIdString": { + "RelationshipTemplateIdString": { "type": "string", - "pattern": "TOK[A-Za-z0-9]{17}" + "pattern": "RLT[A-Za-z0-9]{17}" } } } -export const GetTokensRequest: any = { +export const GetRelationshipTemplatesRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetTokensRequest", + "$ref": "#/definitions/GetRelationshipTemplatesRequest", "definitions": { - "GetTokensRequest": { + "GetRelationshipTemplatesRequest": { "type": "object", "properties": { "query": { - "$ref": "#/definitions/GetTokensQuery" + "$ref": "#/definitions/GetRelationshipTemplatesQuery" }, "ownerRestriction": { "$ref": "#/definitions/OwnerRestriction" @@ -19960,7 +20090,7 @@ export const GetTokensRequest: any = { }, "additionalProperties": false }, - "GetTokensQuery": { + "GetRelationshipTemplatesQuery": { "type": "object", "properties": { "isOwn": { @@ -19989,6 +20119,19 @@ export const GetTokensRequest: any = { } ] }, + "expiresAt": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, "createdBy": { "anyOf": [ { @@ -20015,7 +20158,7 @@ export const GetTokensRequest: any = { } ] }, - "expiresAt": { + "maxNumberOfAllocations": { "anyOf": [ { "type": "string" @@ -20094,11 +20237,11 @@ export const GetTokensRequest: any = { } } -export const LoadPeerTokenRequest: any = { +export const LoadPeerRelationshipTemplateRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/LoadPeerTokenRequest", + "$ref": "#/definitions/LoadPeerRelationshipTemplateRequest", "definitions": { - "LoadPeerTokenRequest": { + "LoadPeerRelationshipTemplateRequest": { "type": "object", "properties": { "reference": { @@ -20107,337 +20250,166 @@ export const LoadPeerTokenRequest: any = { "$ref": "#/definitions/TokenReferenceString" }, { - "$ref": "#/definitions/URLTokenReferenceString" - } - ] - }, - "ephemeral": { - "type": "boolean" - }, - "password": { - "type": "string" - } - }, - "required": [ - "reference", - "ephemeral" - ], - "additionalProperties": false, - "errorMessage": "token reference invalid" - }, - "TokenReferenceString": { - "type": "string", - "pattern": "VE9L.{84}" - }, - "URLTokenReferenceString": { - "type": "string", - "pattern": "^https?:\\/\\/.*\\/r\\/TOK[a-zA-Z0-9]+(\\?app=.+)?#[a-zA-Z0-9-_]+$" - } - } -} - -export const CreatePresentationTokenRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreatePresentationTokenRequest", - "definitions": { - "CreatePresentationTokenRequest": { - "type": "object", - "properties": { - "attributeId": { - "type": "string" - } - }, - "required": [ - "attributeId" - ], - "additionalProperties": false - } - } -} - -export const RequestCredentialsRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/RequestCredentialsRequest", - "definitions": { - "RequestCredentialsRequest": { - "$ref": "#/definitions/AbstractRequestCredentialsRequest%3Calias-2033348025-74138-74264-2033348025-0-218439%3Cstring%2Cany%3E%3E" - }, - "AbstractRequestCredentialsRequest>": { - "anyOf": [ - { - "type": "object", - "additionalProperties": false, - "properties": { - "credentialOffer": { - "type": "object" - }, - "credentialConfigurationIds": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "credentialConfigurationIds", - "credentialOffer" - ] - }, - { - "type": "object", - "additionalProperties": false, - "properties": { - "pinCode": { - "type": "string" - }, - "credentialOffer": { - "type": "object" - }, - "credentialConfigurationIds": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "credentialConfigurationIds", - "credentialOffer", - "pinCode" - ] - }, - { - "type": "object", - "additionalProperties": false, - "properties": { - "accessToken": { - "type": "string" + "$ref": "#/definitions/RelationshipTemplateReferenceString" }, - "credentialOffer": { - "type": "object" + { + "$ref": "#/definitions/URLTokenReferenceString" }, - "credentialConfigurationIds": { - "type": "array", - "items": { - "type": "string" - } + { + "$ref": "#/definitions/URLRelationshipTemplateReferenceString" } - }, - "required": [ - "accessToken", - "credentialConfigurationIds", - "credentialOffer" - ] - } - ] - } - } -} - -export const ResolveAuthorizationRequestRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/ResolveAuthorizationRequestRequest", - "definitions": { - "ResolveAuthorizationRequestRequest": { - "type": "object", - "properties": { - "authorizationRequestUrl": { - "type": "string" - } - }, - "required": [ - "authorizationRequestUrl" - ], - "additionalProperties": false - } - } -} - -export const ResolveCredentialOfferRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/ResolveCredentialOfferRequest", - "definitions": { - "ResolveCredentialOfferRequest": { - "type": "object", - "properties": { - "credentialOfferUrl": { - "type": "string" - } - }, - "required": [ - "credentialOfferUrl" - ], - "additionalProperties": false - } - } -} - -export const StoreCredentialsRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/StoreCredentialsRequest", - "definitions": { - "StoreCredentialsRequest": { - "type": "object", - "additionalProperties": false, - "properties": { - "credentialResponses": { - "type": "array", - "items": { - "type": "object" - } - } - }, - "required": [ - "credentialResponses" - ] - } - } -} - -export const CreateSettingRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateSettingRequest", - "definitions": { - "CreateSettingRequest": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "value": {}, - "reference": { - "$ref": "#/definitions/GenericIdString" - }, - "scope": { - "type": "string", - "enum": [ - "Identity", - "Device", - "Relationship" ] - }, - "succeedsAt": { - "$ref": "#/definitions/ISO8601DateTimeString" - }, - "succeedsItem": { - "$ref": "#/definitions/LocalSettingIdString" + }, + "password": { + "type": "string" } }, "required": [ - "key", - "value" + "reference" ], - "additionalProperties": false + "additionalProperties": false, + "errorMessage": "token / relationship template reference invalid" }, - "GenericIdString": { + "TokenReferenceString": { "type": "string", - "pattern": "[A-Za-z0-9]{20}" + "pattern": "VE9L.{84}" }, - "ISO8601DateTimeString": { + "RelationshipTemplateReferenceString": { "type": "string", - "errorMessage": "must match ISO8601 datetime format", - "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" + "pattern": "UkxU.{84}" }, - "LocalSettingIdString": { + "URLTokenReferenceString": { "type": "string", - "pattern": "LCLSET[A-Za-z0-9]{14}" + "pattern": "^https?:\\/\\/.*\\/r\\/TOK[a-zA-Z0-9]+(\\?app=.+)?#[a-zA-Z0-9-_]+$" + }, + "URLRelationshipTemplateReferenceString": { + "type": "string", + "pattern": "^https?:\\/\\/.*\\/r\\/RLT[a-zA-Z0-9]+(\\?app=.+)?#[a-zA-Z0-9-_]+$" } } } -export const DeleteSettingRequest: any = { +export const CreateOwnTokenRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/DeleteSettingRequest", + "$ref": "#/definitions/CreateOwnTokenRequest", "definitions": { - "DeleteSettingRequest": { + "CreateOwnTokenRequest": { "type": "object", "properties": { - "id": { - "$ref": "#/definitions/LocalSettingIdString" + "content": {}, + "expiresAt": { + "$ref": "#/definitions/ISO8601DateTimeString" + }, + "ephemeral": { + "type": "boolean" + }, + "forIdentity": { + "$ref": "#/definitions/AddressString" + }, + "passwordProtection": { + "type": "object", + "properties": { + "password": { + "type": "string", + "minLength": 1 + }, + "passwordIsPin": { + "type": "boolean", + "const": true + }, + "passwordLocationIndicator": {} + }, + "required": [ + "password" + ], + "additionalProperties": false } }, "required": [ - "id" + "content", + "expiresAt", + "ephemeral" ], "additionalProperties": false }, - "LocalSettingIdString": { + "ISO8601DateTimeString": { "type": "string", - "pattern": "LCLSET[A-Za-z0-9]{14}" + "errorMessage": "must match ISO8601 datetime format", + "pattern": "^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$" + }, + "AddressString": { + "type": "string", + "pattern": "did:e:((([A-Za-z0-9]+(-[A-Za-z0-9]+)*)\\.)+[a-z]{2,}|localhost):dids:[0-9a-f]{22}" } } } -export const GetSettingRequest: any = { +export const DeleteTokenRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetSettingRequest", + "$ref": "#/definitions/DeleteTokenRequest", "definitions": { - "GetSettingRequest": { + "DeleteTokenRequest": { "type": "object", "properties": { - "id": { - "$ref": "#/definitions/LocalSettingIdString" + "tokenId": { + "$ref": "#/definitions/TokenIdString" } }, "required": [ - "id" + "tokenId" ], "additionalProperties": false }, - "LocalSettingIdString": { + "TokenIdString": { "type": "string", - "pattern": "LCLSET[A-Za-z0-9]{14}" + "pattern": "TOK[A-Za-z0-9]{17}" } } } -export const GetSettingByKeyRequest: any = { +export const GetTokenRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetSettingByKeyRequest", + "$ref": "#/definitions/GetTokenRequest", "definitions": { - "GetSettingByKeyRequest": { + "GetTokenRequest": { "type": "object", "properties": { - "key": { - "type": "string" - }, - "reference": { - "type": "string" - }, - "scope": { - "type": "string", - "enum": [ - "Identity", - "Device", - "Relationship" - ] + "id": { + "$ref": "#/definitions/TokenIdString" } }, "required": [ - "key" + "id" ], "additionalProperties": false + }, + "TokenIdString": { + "type": "string", + "pattern": "TOK[A-Za-z0-9]{17}" } } } -export const GetSettingsRequest: any = { +export const GetTokensRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetSettingsRequest", + "$ref": "#/definitions/GetTokensRequest", "definitions": { - "GetSettingsRequest": { + "GetTokensRequest": { "type": "object", "properties": { "query": { - "$ref": "#/definitions/GetSettingsQuery" + "$ref": "#/definitions/GetTokensQuery" + }, + "ownerRestriction": { + "$ref": "#/definitions/OwnerRestriction" } }, "additionalProperties": false }, - "GetSettingsQuery": { + "GetTokensQuery": { "type": "object", "properties": { - "key": { + "isOwn": { "anyOf": [ { "type": "string" @@ -20450,7 +20422,7 @@ export const GetSettingsRequest: any = { } ] }, - "scope": { + "createdAt": { "anyOf": [ { "type": "string" @@ -20463,7 +20435,7 @@ export const GetSettingsRequest: any = { } ] }, - "reference": { + "createdBy": { "anyOf": [ { "type": "string" @@ -20476,7 +20448,7 @@ export const GetSettingsRequest: any = { } ] }, - "createdAt": { + "createdByDevice": { "anyOf": [ { "type": "string" @@ -20489,7 +20461,7 @@ export const GetSettingsRequest: any = { } ] }, - "succeedsItem": { + "expiresAt": { "anyOf": [ { "type": "string" @@ -20502,7 +20474,7 @@ export const GetSettingsRequest: any = { } ] }, - "succeedsAt": { + "forIdentity": { "anyOf": [ { "type": "string" @@ -20514,70 +20486,98 @@ export const GetSettingsRequest: any = { } } ] - } - }, - "additionalProperties": false - } - } -} - -export const UpdateSettingRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/UpdateSettingRequest", - "definitions": { - "UpdateSettingRequest": { - "type": "object", - "properties": { - "id": { - "$ref": "#/definitions/LocalSettingIdString" }, - "value": {} + "passwordProtection": { + "type": "string", + "enum": [ + "", + "!" + ] + }, + "passwordProtection.password": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "passwordProtection.passwordIsPin": { + "type": "string", + "enum": [ + "true", + "!" + ] + }, + "passwordProtection.passwordLocationIndicator": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } }, - "required": [ - "id", - "value" - ], "additionalProperties": false }, - "LocalSettingIdString": { + "OwnerRestriction": { "type": "string", - "pattern": "LCLSET[A-Za-z0-9]{14}" + "enum": [ + "o", + "p" + ] } } } -export const UpsertSettingByKeyRequest: any = { +export const LoadPeerTokenRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/UpsertSettingByKeyRequest", + "$ref": "#/definitions/LoadPeerTokenRequest", "definitions": { - "UpsertSettingByKeyRequest": { + "LoadPeerTokenRequest": { "type": "object", "properties": { - "key": { - "type": "string" - }, - "value": {}, "reference": { - "$ref": "#/definitions/GenericIdString" - }, - "scope": { - "type": "string", - "enum": [ - "Identity", - "Device", - "Relationship" + "anyOf": [ + { + "$ref": "#/definitions/TokenReferenceString" + }, + { + "$ref": "#/definitions/URLTokenReferenceString" + } ] + }, + "ephemeral": { + "type": "boolean" + }, + "password": { + "type": "string" } }, "required": [ - "key", - "value" + "reference", + "ephemeral" ], - "additionalProperties": false + "additionalProperties": false, + "errorMessage": "token reference invalid" }, - "GenericIdString": { + "TokenReferenceString": { "type": "string", - "pattern": "[A-Za-z0-9]{20}" + "pattern": "VE9L.{84}" + }, + "URLTokenReferenceString": { + "type": "string", + "pattern": "^https?:\\/\\/.*\\/r\\/TOK[a-zA-Z0-9]+(\\?app=.+)?#[a-zA-Z0-9-_]+$" } } } From 833eb2524a6ccfdfac4380ecb66968d61c9b306e Mon Sep 17 00:00:00 2001 From: mkuhn Date: Fri, 9 Jan 2026 14:44:33 +0100 Subject: [PATCH 17/18] chore: cleaner qs dependency handling --- package-lock.json | 8 ++++---- packages/transport/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index b6df64187..dcb3a8183 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13060,9 +13060,9 @@ } }, "node_modules/qs": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz", - "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==", + "version": "6.14.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.1.tgz", + "integrity": "sha512-4EK3+xJl8Ts67nLYNwqw/dsFVnCf+qR7RgXSK9jEEm9unao3njwMDdmsdvoKBKHzxd7tCYz5e5M+SnMjdtXGQQ==", "license": "BSD-3-Clause", "dependencies": { "side-channel": "^1.1.0" @@ -16220,7 +16220,7 @@ "json-stringify-safe": "^5.0.1", "lodash": "^4.17.21", "luxon": "^3.7.2", - "qs": "^6.14.0", + "qs": "^6.14.1", "reflect-metadata": "^0.2.2", "ts-simple-nameof": "^1.3.3" }, diff --git a/packages/transport/package.json b/packages/transport/package.json index 174493cf8..cbec82fed 100644 --- a/packages/transport/package.json +++ b/packages/transport/package.json @@ -77,7 +77,7 @@ "json-stringify-safe": "^5.0.1", "lodash": "^4.17.21", "luxon": "^3.7.2", - "qs": "^6.14.0", + "qs": "^6.14.1", "reflect-metadata": "^0.2.2", "ts-simple-nameof": "^1.3.3" }, From 1d5b5d7e2bc61372db40aa50177de1949ace8f29 Mon Sep 17 00:00:00 2001 From: mkuhn Date: Fri, 9 Jan 2026 16:43:55 +0100 Subject: [PATCH 18/18] test: missing mdoc encryption --- packages/runtime/test/consumption/openid4vc.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/runtime/test/consumption/openid4vc.test.ts b/packages/runtime/test/consumption/openid4vc.test.ts index 2c396d414..ecbe82511 100644 --- a/packages/runtime/test/consumption/openid4vc.test.ts +++ b/packages/runtime/test/consumption/openid4vc.test.ts @@ -346,7 +346,8 @@ describe("custom openid4vc service", () => { } ] }, - version: "v1.draft21" + version: "v1.draft21", + encryptResponse: true }); expect(response.status).toBe(200); const responseData = await response.data;