diff --git a/package-lock.json b/package-lock.json index 82790b723..199a80f16 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12619,7 +12619,7 @@ "@types/luxon": "^3.4.2" }, "peerDependencies": { - "@nmshd/runtime": "^3.6.0" + "@nmshd/runtime": "^4.0.0" } }, "packages/consumption": { @@ -12671,7 +12671,7 @@ }, "packages/runtime": { "name": "@nmshd/runtime", - "version": "3.7.0", + "version": "4.0.0", "license": "MIT", "dependencies": { "@js-soft/docdb-querytranslator": "^1.1.2", diff --git a/packages/app-runtime/package.json b/packages/app-runtime/package.json index 624d171be..ce0a8fd2d 100644 --- a/packages/app-runtime/package.json +++ b/packages/app-runtime/package.json @@ -61,7 +61,7 @@ "@types/luxon": "^3.4.2" }, "peerDependencies": { - "@nmshd/runtime": "^3.6.0" + "@nmshd/runtime": "^4.0.0" }, "publishConfig": { "access": "public", diff --git a/packages/consumption/src/consumption/CoreErrors.ts b/packages/consumption/src/consumption/CoreErrors.ts index 86d200067..43d28b01e 100644 --- a/packages/consumption/src/consumption/CoreErrors.ts +++ b/packages/consumption/src/consumption/CoreErrors.ts @@ -29,10 +29,10 @@ class Attributes { return new CoreError("error.consumption.attributes.invalidSuccessionOfOwnSharedIdentityAttribute", errorMessage); } - public cannotSucceedPartOfComplexAttribute(parentId: string | CoreId) { + public cannotSucceedChildOfComplexAttribute(parentId: string | CoreId) { return new CoreError( - "error.consumption.attributes.cannotSucceedPartOfComplexAttribute", - `The attribute you want to succeed is part of a complex attribute (id: ${parentId}), and cannot be succeeded on its own. Instead, succeed the parent which will implicitly succeed all its children.` + "error.consumption.attributes.cannotSucceedChildOfComplexAttribute", + `The attribute you want to succeed is child attribute of a complex attribute (id: ${parentId}), and cannot be succeeded on its own. Instead, succeed the parent which will implicitly succeed all its children.` ); } diff --git a/packages/consumption/src/modules/attributes/AttributesController.ts b/packages/consumption/src/modules/attributes/AttributesController.ts index 4fb4001c2..4992ed8b9 100644 --- a/packages/consumption/src/modules/attributes/AttributesController.ts +++ b/packages/consumption/src/modules/attributes/AttributesController.ts @@ -781,7 +781,7 @@ export class AttributesController extends ConsumptionBaseController { } if (typeof successor.parentId !== "undefined") { - return ValidationResult.error(CoreErrors.attributes.cannotSucceedPartOfComplexAttribute(predecessorId.toString())); + return ValidationResult.error(CoreErrors.attributes.cannotSucceedChildOfComplexAttribute(predecessorId.toString())); } const predecessor = await this.getLocalAttribute(predecessorId); @@ -794,7 +794,7 @@ export class AttributesController extends ConsumptionBaseController { } if (typeof predecessor.parentId !== "undefined") { - return ValidationResult.error(CoreErrors.attributes.cannotSucceedPartOfComplexAttribute(predecessorId.toString())); + return ValidationResult.error(CoreErrors.attributes.cannotSucceedChildOfComplexAttribute(predecessorId.toString())); } if (!predecessor.content.owner.equals(CoreAddress.from(successor.content.owner))) { diff --git a/packages/consumption/test/modules/attributes/AttributesController.test.ts b/packages/consumption/test/modules/attributes/AttributesController.test.ts index f76156afd..807934934 100644 --- a/packages/consumption/test/modules/attributes/AttributesController.test.ts +++ b/packages/consumption/test/modules/attributes/AttributesController.test.ts @@ -657,7 +657,7 @@ describe("AttributesController", function () { const validationResult = await consumptionController.attributes.validateAttributeSuccessionCommon(predecessor.id, successorData); expect(validationResult).errorValidationResult({ - code: "error.consumption.attributes.cannotSucceedPartOfComplexAttribute" + code: "error.consumption.attributes.cannotSucceedChildOfComplexAttribute" }); }); @@ -728,7 +728,7 @@ describe("AttributesController", function () { const validationResult = await consumptionController.attributes.validateAttributeSuccessionCommon(predecessor.id, successorData); expect(validationResult).errorValidationResult({ - code: "error.consumption.attributes.cannotSucceedPartOfComplexAttribute" + code: "error.consumption.attributes.cannotSucceedChildOfComplexAttribute" }); }); diff --git a/packages/runtime/package.json b/packages/runtime/package.json index 650e83ed7..6adb01cca 100644 --- a/packages/runtime/package.json +++ b/packages/runtime/package.json @@ -1,6 +1,6 @@ { "name": "@nmshd/runtime", - "version": "3.7.0", + "version": "4.0.0", "description": "The enmeshed client runtime.", "homepage": "https://enmeshed.eu", "repository": { diff --git a/packages/runtime/src/Runtime.ts b/packages/runtime/src/Runtime.ts index 9594f1fbc..c8819c92e 100644 --- a/packages/runtime/src/Runtime.ts +++ b/packages/runtime/src/Runtime.ts @@ -22,21 +22,21 @@ import { ICoreAddress, IdentityController, MessageController, - RelationshipTemplateController, RelationshipsController, + RelationshipTemplateController, TokenController, Transport } from "@nmshd/transport"; import { Container, Scope } from "typescript-ioc"; -import { DatabaseSchemaUpgrader } from "./DatabaseSchemaUpgrader"; -import { RuntimeConfig } from "./RuntimeConfig"; -import { RuntimeLoggerFactory } from "./RuntimeLoggerFactory"; import { buildInformation } from "./buildInformation"; +import { DatabaseSchemaUpgrader } from "./DatabaseSchemaUpgrader"; import { DataViewExpander } from "./dataViews"; import { ModulesInitializedEvent, ModulesLoadedEvent, ModulesStartedEvent, RuntimeInitializedEvent, RuntimeInitializingEvent } from "./events"; import { EventProxy } from "./events/EventProxy"; import { AnonymousServices, ConsumptionServices, ModuleConfiguration, RuntimeModule, RuntimeModuleRegistry, TransportServices } from "./extensibility"; import { AttributeListenerModule, DeciderModule, MessageModule, NotificationModule, RequestModule } from "./modules"; +import { RuntimeConfig } from "./RuntimeConfig"; +import { RuntimeLoggerFactory } from "./RuntimeLoggerFactory"; import { RuntimeHealth } from "./types"; import { RuntimeErrors } from "./useCases"; import { SchemaRepository } from "./useCases/common/SchemaRepository"; diff --git a/packages/runtime/src/dataViews/DataViewExpander.ts b/packages/runtime/src/dataViews/DataViewExpander.ts index 822fd104f..bf5c4b91d 100644 --- a/packages/runtime/src/dataViews/DataViewExpander.ts +++ b/packages/runtime/src/dataViews/DataViewExpander.ts @@ -9,10 +9,10 @@ import { ErrorResponseItemJSON, FreeTextRequestItemJSON, GivenNameJSON, - IQLQueryJSON, IdentityAttribute, IdentityAttributeJSON, IdentityAttributeQueryJSON, + IQLQueryJSON, MailJSON, MiddleNameJSON, ProposeAttributeAcceptResponseItemJSON, @@ -81,8 +81,6 @@ import { RelationshipTemplateDTO } from "../types"; import { RuntimeErrors } from "../useCases"; -import { DataViewObject } from "./DataViewObject"; -import { DataViewTranslateable } from "./DataViewTranslateable"; import { LocalAttributeDVO, LocalAttributeListenerDVO, @@ -92,8 +90,8 @@ import { PeerAttributeDVO, PeerRelationshipAttributeDVO, ProcessedAttributeQueryDVO, - ProcessedIQLQueryDVO, ProcessedIdentityAttributeQueryDVO, + ProcessedIQLQueryDVO, ProcessedRelationshipAttributeQueryDVO, ProcessedThirdPartyRelationshipAttributeQueryDVO, RelationshipSettingDVO, @@ -115,8 +113,8 @@ import { AttributeQueryDVO, DraftIdentityAttributeDVO, DraftRelationshipAttributeDVO, - IQLQueryDVO, IdentityAttributeQueryDVO, + IQLQueryDVO, RelationshipAttributeQueryDVO, ThirdPartyRelationshipAttributeQueryDVO } from "./content/AttributeDVOs"; @@ -133,8 +131,10 @@ import { ResponseItemGroupDVO, ShareAttributeAcceptResponseItemDVO } from "./content/ResponseItemDVOs"; +import { DataViewObject } from "./DataViewObject"; +import { DataViewTranslateable } from "./DataViewTranslateable"; import { MessageDVO, MessageStatus, RecipientDVO } from "./transport/MessageDVO"; -import { RelationshipChangeDVO, RelationshipChangeResponseDVO, RelationshipDVO, RelationshipDirection } from "./transport/RelationshipDVO"; +import { RelationshipChangeDVO, RelationshipChangeResponseDVO, RelationshipDirection, RelationshipDVO } from "./transport/RelationshipDVO"; export class DataViewExpander { public constructor( diff --git a/packages/runtime/src/dataViews/consumption/LocalAttributeDVO.ts b/packages/runtime/src/dataViews/consumption/LocalAttributeDVO.ts index daa184d9f..4b2972ad1 100644 --- a/packages/runtime/src/dataViews/consumption/LocalAttributeDVO.ts +++ b/packages/runtime/src/dataViews/consumption/LocalAttributeDVO.ts @@ -1,6 +1,6 @@ import { IdentityAttributeJSON, RelationshipAttributeCreationHintsJSON, RelationshipAttributeJSON, RenderHintsJSON, ValueHintsJSON } from "@nmshd/content"; -import { DataViewObject } from "../DataViewObject"; import { AttributeQueryDVO } from "../content/AttributeDVOs"; +import { DataViewObject } from "../DataViewObject"; import { IdentityDVO } from "../transport"; /** diff --git a/packages/runtime/src/dataViews/consumption/LocalRequestDVO.ts b/packages/runtime/src/dataViews/consumption/LocalRequestDVO.ts index a029f6de4..2d0893632 100644 --- a/packages/runtime/src/dataViews/consumption/LocalRequestDVO.ts +++ b/packages/runtime/src/dataViews/consumption/LocalRequestDVO.ts @@ -1,6 +1,6 @@ import { LocalRequestStatus } from "@nmshd/consumption"; -import { DataViewObject } from "../DataViewObject"; import { RequestDVO, RequestItemDVO, RequestItemGroupDVO, ResponseDVO } from "../content"; +import { DataViewObject } from "../DataViewObject"; import { IdentityDVO } from "../transport"; export interface LocalRequestDVO extends DataViewObject { diff --git a/packages/runtime/src/dataViews/content/ResponseItemDVOs.ts b/packages/runtime/src/dataViews/content/ResponseItemDVOs.ts index ee86e4c46..901f8389b 100644 --- a/packages/runtime/src/dataViews/content/ResponseItemDVOs.ts +++ b/packages/runtime/src/dataViews/content/ResponseItemDVOs.ts @@ -1,6 +1,6 @@ import { ResponseItemResult } from "@nmshd/content"; -import { DataViewObject } from "../DataViewObject"; import { LocalAttributeDVO, LocalAttributeListenerDVO } from "../consumption"; +import { DataViewObject } from "../DataViewObject"; export interface ResponseItemGroupDVO { type: "ResponseItemGroupDVO"; diff --git a/packages/runtime/src/dataViews/transport/RelationshipDVO.ts b/packages/runtime/src/dataViews/transport/RelationshipDVO.ts index c0143e358..cbbd6a36e 100644 --- a/packages/runtime/src/dataViews/transport/RelationshipDVO.ts +++ b/packages/runtime/src/dataViews/transport/RelationshipDVO.ts @@ -1,6 +1,6 @@ import { RelationshipChangeStatus, RelationshipChangeType } from "@nmshd/transport"; -import { DataViewObject } from "../DataViewObject"; import { LocalAttributeDVO } from "../consumption"; +import { DataViewObject } from "../DataViewObject"; export enum RelationshipDirection { Outgoing = "Outgoing", diff --git a/packages/runtime/src/extensibility/facades/consumption/AttributesFacade.ts b/packages/runtime/src/extensibility/facades/consumption/AttributesFacade.ts index 04dcef621..fb6efced7 100644 --- a/packages/runtime/src/extensibility/facades/consumption/AttributesFacade.ts +++ b/packages/runtime/src/extensibility/facades/consumption/AttributesFacade.ts @@ -4,41 +4,41 @@ import { LocalAttributeDTO, LocalRequestDTO } from "../../../types"; import { CreateAndShareRelationshipAttributeRequest, CreateAndShareRelationshipAttributeUseCase, - CreateIdentityAttributeRequest, - CreateIdentityAttributeUseCase, - ExecuteIQLQueryRequest, - ExecuteIQLQueryUseCase, + CreateRepositoryAttributeRequest, + CreateRepositoryAttributeUseCase, ExecuteIdentityAttributeQueryRequest, ExecuteIdentityAttributeQueryUseCase, + ExecuteIQLQueryRequest, + ExecuteIQLQueryUseCase, ExecuteRelationshipAttributeQueryRequest, ExecuteRelationshipAttributeQueryUseCase, ExecuteThirdPartyRelationshipAttributeQueryRequest, ExecuteThirdPartyRelationshipAttributeQueryUseCase, GetAttributeRequest, - GetAttributeUseCase, GetAttributesRequest, GetAttributesUseCase, - GetOwnIdentityAttributesRequest, - GetOwnIdentityAttributesUseCase, + GetAttributeUseCase, GetOwnSharedAttributesRequest, GetOwnSharedAttributesUseCase, GetPeerSharedAttributesRequest, GetPeerSharedAttributesUseCase, - GetSharedVersionsOfIdentityAttributeRequest, - GetSharedVersionsOfIdentityAttributeUseCase, + GetRepositoryAttributesRequest, + GetRepositoryAttributesUseCase, + GetSharedVersionsOfRepositoryAttributeRequest, + GetSharedVersionsOfRepositoryAttributeUseCase, GetVersionsOfAttributeRequest, GetVersionsOfAttributeUseCase, - NotifyPeerAboutIdentityAttributeSuccessionRequest, - NotifyPeerAboutIdentityAttributeSuccessionResponse, - NotifyPeerAboutIdentityAttributeSuccessionUseCase, - ShareIdentityAttributeRequest, - ShareIdentityAttributeUseCase, - SucceedIdentityAttributeRequest, - SucceedIdentityAttributeResponse, - SucceedIdentityAttributeUseCase, + NotifyPeerAboutRepositoryAttributeSuccessionRequest, + NotifyPeerAboutRepositoryAttributeSuccessionResponse, + NotifyPeerAboutRepositoryAttributeSuccessionUseCase, + ShareRepositoryAttributeRequest, + ShareRepositoryAttributeUseCase, SucceedRelationshipAttributeAndNotifyPeerRequest, SucceedRelationshipAttributeAndNotifyPeerResponse, SucceedRelationshipAttributeAndNotifyPeerUseCase, + SucceedRepositoryAttributeRequest, + SucceedRepositoryAttributeResponse, + SucceedRepositoryAttributeUseCase, ValidateIQLQueryRequest, ValidateIQLQueryResponse, ValidateIQLQueryUseCase @@ -46,16 +46,16 @@ import { export class AttributesFacade { public constructor( - @Inject private readonly createIdentityAttributeUseCase: CreateIdentityAttributeUseCase, - @Inject private readonly shareIdentityAttributeUseCase: ShareIdentityAttributeUseCase, + @Inject private readonly createRepositoryAttributeUseCase: CreateRepositoryAttributeUseCase, + @Inject private readonly shareRepositoryAttributeUseCase: ShareRepositoryAttributeUseCase, @Inject private readonly getPeerSharedAttributesUseCase: GetPeerSharedAttributesUseCase, @Inject private readonly getOwnSharedAttributesUseCase: GetOwnSharedAttributesUseCase, - @Inject private readonly getOwnIdentityAttributesUseCase: GetOwnIdentityAttributesUseCase, + @Inject private readonly getRepositoryAttributesUseCase: GetRepositoryAttributesUseCase, @Inject private readonly getAttributeUseCase: GetAttributeUseCase, @Inject private readonly getAttributesUseCase: GetAttributesUseCase, @Inject private readonly getVersionsOfAttributeUseCase: GetVersionsOfAttributeUseCase, - @Inject private readonly getSharedVersionsOfIdentityAttributeUseCase: GetSharedVersionsOfIdentityAttributeUseCase, - @Inject private readonly succeedIdentityAttributeUseCase: SucceedIdentityAttributeUseCase, + @Inject private readonly getSharedVersionsOfRepositoryAttributeUseCase: GetSharedVersionsOfRepositoryAttributeUseCase, + @Inject private readonly succeedRepositoryAttributeUseCase: SucceedRepositoryAttributeUseCase, @Inject private readonly executeIdentityAttributeQueryUseCase: ExecuteIdentityAttributeQueryUseCase, @Inject private readonly executeRelationshipAttributeQueryUseCase: ExecuteRelationshipAttributeQueryUseCase, @Inject private readonly succeedRelationshipAttributeAndNotifyPeerUseCase: SucceedRelationshipAttributeAndNotifyPeerUseCase, @@ -63,11 +63,11 @@ export class AttributesFacade { @Inject private readonly executeIQLQueryUseCase: ExecuteIQLQueryUseCase, @Inject private readonly validateIQLQueryUseCase: ValidateIQLQueryUseCase, @Inject private readonly createAndShareRelationshipAttributeUseCase: CreateAndShareRelationshipAttributeUseCase, - @Inject private readonly notifyPeerAboutIdentityAttributeSuccessionUseCase: NotifyPeerAboutIdentityAttributeSuccessionUseCase + @Inject private readonly notifyPeerAboutRepositoryAttributeSuccessionUseCase: NotifyPeerAboutRepositoryAttributeSuccessionUseCase ) {} - public async createIdentityAttribute(request: CreateIdentityAttributeRequest): Promise> { - return await this.createIdentityAttributeUseCase.execute(request); + public async createRepositoryAttribute(request: CreateRepositoryAttributeRequest): Promise> { + return await this.createRepositoryAttributeUseCase.execute(request); } public async getPeerSharedAttributes(request: GetPeerSharedAttributesRequest): Promise> { @@ -78,8 +78,8 @@ export class AttributesFacade { return await this.getOwnSharedAttributesUseCase.execute(request); } - public async getOwnIdentityAttributes(request: GetOwnIdentityAttributesRequest): Promise> { - return await this.getOwnIdentityAttributesUseCase.execute(request); + public async getRepositoryAttributes(request: GetRepositoryAttributesRequest): Promise> { + return await this.getRepositoryAttributesUseCase.execute(request); } public async getAttribute(request: GetAttributeRequest): Promise> { @@ -94,8 +94,8 @@ export class AttributesFacade { return await this.getVersionsOfAttributeUseCase.execute(request); } - public async getSharedVersionsOfIdentityAttribute(request: GetSharedVersionsOfIdentityAttributeRequest): Promise> { - return await this.getSharedVersionsOfIdentityAttributeUseCase.execute(request); + public async getSharedVersionsOfRepositoryAttribute(request: GetSharedVersionsOfRepositoryAttributeRequest): Promise> { + return await this.getSharedVersionsOfRepositoryAttributeUseCase.execute(request); } public async executeIdentityAttributeQuery(request: ExecuteIdentityAttributeQueryRequest): Promise> { @@ -124,21 +124,21 @@ export class AttributesFacade { return await this.validateIQLQueryUseCase.execute(request); } - public async succeedIdentityAttribute(request: SucceedIdentityAttributeRequest): Promise> { - return await this.succeedIdentityAttributeUseCase.execute(request); + public async succeedRepositoryAttribute(request: SucceedRepositoryAttributeRequest): Promise> { + return await this.succeedRepositoryAttributeUseCase.execute(request); } - public async shareIdentityAttribute(request: ShareIdentityAttributeRequest): Promise> { - return await this.shareIdentityAttributeUseCase.execute(request); + public async shareRepositoryAttribute(request: ShareRepositoryAttributeRequest): Promise> { + return await this.shareRepositoryAttributeUseCase.execute(request); } public async createAndShareRelationshipAttribute(request: CreateAndShareRelationshipAttributeRequest): Promise> { return await this.createAndShareRelationshipAttributeUseCase.execute(request); } - public async notifyPeerAboutIdentityAttributeSuccession( - request: NotifyPeerAboutIdentityAttributeSuccessionRequest - ): Promise> { - return await this.notifyPeerAboutIdentityAttributeSuccessionUseCase.execute(request); + public async notifyPeerAboutRepositoryAttributeSuccession( + request: NotifyPeerAboutRepositoryAttributeSuccessionRequest + ): Promise> { + return await this.notifyPeerAboutRepositoryAttributeSuccessionUseCase.execute(request); } } diff --git a/packages/runtime/src/modules/AttributeListenerModule.ts b/packages/runtime/src/modules/AttributeListenerModule.ts index 7f0801661..5945b6619 100644 --- a/packages/runtime/src/modules/AttributeListenerModule.ts +++ b/packages/runtime/src/modules/AttributeListenerModule.ts @@ -1,7 +1,7 @@ import { RelationshipAttributeConfidentiality, ShareAttributeRequestItemJSON } from "@nmshd/content"; -import { RuntimeServices } from "../Runtime"; import { AttributeCreatedEvent, AttributeListenerTriggeredEvent } from "../events"; import { RuntimeModule } from "../extensibility"; +import { RuntimeServices } from "../Runtime"; import { LocalAttributeDTO, LocalAttributeListenerDTO } from "../types"; export class AttributeListenerModule extends RuntimeModule { diff --git a/packages/runtime/src/modules/DeciderModule.ts b/packages/runtime/src/modules/DeciderModule.ts index 66945c0b6..79584feee 100644 --- a/packages/runtime/src/modules/DeciderModule.ts +++ b/packages/runtime/src/modules/DeciderModule.ts @@ -1,6 +1,5 @@ import { LocalRequestStatus } from "@nmshd/consumption"; import { RequestItemJSON } from "@nmshd/content"; -import { RuntimeServices } from "../Runtime"; import { IncomingRequestStatusChangedEvent, MessageProcessedEvent, @@ -9,6 +8,7 @@ import { RelationshipTemplateProcessedResult } from "../events"; import { RuntimeModule } from "../extensibility"; +import { RuntimeServices } from "../Runtime"; export class DeciderModule extends RuntimeModule { public init(): void { diff --git a/packages/runtime/src/modules/RequestModule.ts b/packages/runtime/src/modules/RequestModule.ts index f0ddae616..daabe036b 100644 --- a/packages/runtime/src/modules/RequestModule.ts +++ b/packages/runtime/src/modules/RequestModule.ts @@ -9,7 +9,6 @@ import { ResponseWrapper, ResponseWrapperJSON } from "@nmshd/content"; -import { RuntimeServices } from "../Runtime"; import { IncomingRequestStatusChangedEvent, MessageProcessedEvent, @@ -21,6 +20,7 @@ import { } from "../events"; import { RelationshipTemplateProcessedEvent, RelationshipTemplateProcessedResult } from "../events/consumption/RelationshipTemplateProcessedEvent"; import { RuntimeModule } from "../extensibility/modules/RuntimeModule"; +import { RuntimeServices } from "../Runtime"; import { LocalRequestDTO, RelationshipStatus } from "../types"; export class RequestModule extends RuntimeModule { diff --git a/packages/runtime/src/useCases/common/RuntimeErrors.ts b/packages/runtime/src/useCases/common/RuntimeErrors.ts index 9fba99e9c..fccffca27 100644 --- a/packages/runtime/src/useCases/common/RuntimeErrors.ts +++ b/packages/runtime/src/useCases/common/RuntimeErrors.ts @@ -140,36 +140,36 @@ class Notifications { } class Attributes { - public isNoIdentityAttribute(attributeId: CoreId | string): ApplicationError { - return new ApplicationError("error.runtime.attributes.isNoIdentityAttribute", `Attribute '${attributeId.toString()}' is not an identity attribute.`); + public isNotRepositoryAttribute(attributeId: CoreId | string): ApplicationError { + return new ApplicationError("error.runtime.attributes.isNotRepositoryAttribute", `Attribute '${attributeId.toString()}' is not a repository attribute.`); } - public identityAttributeHasAlreadyBeenSharedWithPeer( + public repositoryAttributeHasAlreadyBeenSharedWithPeer( repositoryAttributeId: CoreId | string, peer: CoreAddress | string, ownSharedIdentityAttributeId: CoreId | string ): ApplicationError { return new ApplicationError( - "error.runtime.attributes.identityAttributeHasAlreadyBeenSharedWithPeer", - `Identity attribute '${repositoryAttributeId.toString()}' has already been shared with peer '${peer.toString()}'. Id of shared identity attribute: ${ownSharedIdentityAttributeId.toString()}.` + "error.runtime.attributes.repositoryAttributeHasAlreadyBeenSharedWithPeer", + `Repository attribute '${repositoryAttributeId.toString()}' has already been shared with peer '${peer.toString()}'. ID of own shared identity attribute: ${ownSharedIdentityAttributeId.toString()}.` ); } - public anotherVersionOfIdentityAttributeHasAlreadyBeenSharedWithPeer( + public anotherVersionOfRepositoryAttributeHasAlreadyBeenSharedWithPeer( repositoryAttributeId: CoreId | string, peer: CoreAddress | string, ownSharedIdentityAttributeId: CoreId | string ): ApplicationError { return new ApplicationError( - "error.runtime.attributes.anotherVersionOfIdentityAttributeHasAlreadyBeenSharedWithPeer", - `Another version of identity attribute '${repositoryAttributeId.toString()}' has already been shared with peer '${peer.toString()}'. Id of previously shared identity attribute: ${ownSharedIdentityAttributeId.toString()}.` + "error.runtime.attributes.anotherVersionOfRepositoryAttributeHasAlreadyBeenSharedWithPeer", + `Another version of repository attribute '${repositoryAttributeId.toString()}' has already been shared with peer '${peer.toString()}'. ID of previous own shared identity attribute: ${ownSharedIdentityAttributeId.toString()}.` ); } - public noOtherVersionOfIdentityAttributeHasBeenSharedWithPeerBefore(repositoryAttributeId: CoreId | string, peer: CoreAddress | string): ApplicationError { + public noOtherVersionOfRepositoryAttributeHasBeenSharedWithPeerBefore(repositoryAttributeId: CoreId | string, peer: CoreAddress | string): ApplicationError { return new ApplicationError( - "error.runtime.attributes.noOtherVersionOfIdentityAttributeHasBeenSharedWithPeerBefore", - `No other version of identity attribute '${repositoryAttributeId.toString()}' has been shared with peer '${peer.toString()}' before. If you wish to execute an initial sharing of this attribute, use 'ShareIdentityAttribute'.` + "error.runtime.attributes.noOtherVersionOfRepositoryAttributeHasBeenSharedWithPeerBefore", + `No other version of repository attribute '${repositoryAttributeId.toString()}' has been shared with peer '${peer.toString()}' before. If you wish to execute an initial sharing of this attribute, use 'ShareRepositoryAttribute'.` ); } } diff --git a/packages/runtime/src/useCases/common/Schemas.ts b/packages/runtime/src/useCases/common/Schemas.ts index f398e8c8f..6bc964013 100644 --- a/packages/runtime/src/useCases/common/Schemas.ts +++ b/packages/runtime/src/useCases/common/Schemas.ts @@ -14561,11 +14561,11 @@ export const CreateAndShareRelationshipAttributeRequest: any = { } } -export const CreateIdentityAttributeRequest: any = { +export const CreateRepositoryAttributeRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/CreateIdentityAttributeRequest", + "$ref": "#/definitions/CreateRepositoryAttributeRequest", "definitions": { - "CreateIdentityAttributeRequest": { + "CreateRepositoryAttributeRequest": { "type": "object", "properties": { "content": { @@ -16550,22 +16550,6 @@ export const GetAttributesRequest: any = { } } -export const GetOwnIdentityAttributesRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetOwnIdentityAttributesRequest", - "definitions": { - "GetOwnIdentityAttributesRequest": { - "type": "object", - "properties": { - "onlyLatestVersions": { - "type": "boolean" - } - }, - "additionalProperties": false - } - } -} - export const GetOwnSharedAttributesRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", "$ref": "#/definitions/GetOwnSharedAttributesRequest", @@ -16953,11 +16937,27 @@ export const GetPeerSharedAttributesRequest: any = { } } -export const GetSharedVersionsOfIdentityAttributeRequest: any = { +export const GetRepositoryAttributesRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/GetRepositoryAttributesRequest", + "definitions": { + "GetRepositoryAttributesRequest": { + "type": "object", + "properties": { + "onlyLatestVersions": { + "type": "boolean" + } + }, + "additionalProperties": false + } + } +} + +export const GetSharedVersionsOfRepositoryAttributeRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/GetSharedVersionsOfIdentityAttributeRequest", + "$ref": "#/definitions/GetSharedVersionsOfRepositoryAttributeRequest", "definitions": { - "GetSharedVersionsOfIdentityAttributeRequest": { + "GetSharedVersionsOfRepositoryAttributeRequest": { "type": "object", "properties": { "attributeId": { @@ -17012,11 +17012,11 @@ export const GetVersionsOfAttributeRequest: any = { } } -export const NotifyPeerAboutIdentityAttributeSuccessionRequest: any = { +export const NotifyPeerAboutRepositoryAttributeSuccessionRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/NotifyPeerAboutIdentityAttributeSuccessionRequest", + "$ref": "#/definitions/NotifyPeerAboutRepositoryAttributeSuccessionRequest", "definitions": { - "NotifyPeerAboutIdentityAttributeSuccessionRequest": { + "NotifyPeerAboutRepositoryAttributeSuccessionRequest": { "type": "object", "properties": { "attributeId": { @@ -17043,11 +17043,11 @@ export const NotifyPeerAboutIdentityAttributeSuccessionRequest: any = { } } -export const ShareIdentityAttributeRequest: any = { +export const ShareRepositoryAttributeRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/ShareIdentityAttributeRequest", + "$ref": "#/definitions/ShareRepositoryAttributeRequest", "definitions": { - "ShareIdentityAttributeRequest": { + "ShareRepositoryAttributeRequest": { "type": "object", "properties": { "attributeId": { @@ -17115,27 +17115,21 @@ export const ShareIdentityAttributeRequest: any = { } } -export const SucceedIdentityAttributeRequest: any = { +export const SucceedRelationshipAttributeAndNotifyPeerRequest: any = { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/SucceedIdentityAttributeRequest", + "$ref": "#/definitions/SucceedRelationshipAttributeAndNotifyPeerRequest", "definitions": { - "SucceedIdentityAttributeRequest": { + "SucceedRelationshipAttributeAndNotifyPeerRequest": { "type": "object", "properties": { "predecessorId": { - "type": "string" + "$ref": "#/definitions/AttributeIdString" }, "successorContent": { "type": "object", "properties": { "value": { - "$ref": "#/definitions/AttributeValues.Identity.Json" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } + "$ref": "#/definitions/AttributeValues.Relationship.Json" }, "validFrom": { "$ref": "#/definitions/ISO8601DateTimeString" @@ -17156,86 +17150,62 @@ export const SucceedIdentityAttributeRequest: any = { ], "additionalProperties": false }, - "AttributeValues.Identity.Json": { - "anyOf": [ - { - "$ref": "#/definitions/AttributeValues.Identity.Editable.Json" - }, - { - "$ref": "#/definitions/AttributeValues.Identity.Uneditable.Json" - } - ] + "AttributeIdString": { + "type": "string", + "pattern": "ATT[A-Za-z0-9]{17}" }, - "AttributeValues.Identity.Editable.Json": { + "AttributeValues.Relationship.Json": { "anyOf": [ { - "$ref": "#/definitions/AffiliationJSON" - }, - { - "$ref": "#/definitions/BirthDateJSON" - }, - { - "$ref": "#/definitions/BirthNameJSON" - }, - { - "$ref": "#/definitions/BirthPlaceJSON" - }, - { - "$ref": "#/definitions/CitizenshipJSON" - }, - { - "$ref": "#/definitions/CommunicationLanguageJSON" - }, - { - "$ref": "#/definitions/DeliveryBoxAddressJSON" + "$ref": "#/definitions/ProprietaryBooleanJSON" }, { - "$ref": "#/definitions/DisplayNameJSON" + "$ref": "#/definitions/ProprietaryCountryJSON" }, { - "$ref": "#/definitions/EMailAddressJSON" + "$ref": "#/definitions/ProprietaryEMailAddressJSON" }, { - "$ref": "#/definitions/FaxNumberJSON" + "$ref": "#/definitions/ProprietaryFileReferenceJSON" }, { - "$ref": "#/definitions/IdentityFileReferenceJSON" + "$ref": "#/definitions/ProprietaryFloatJSON" }, { - "$ref": "#/definitions/JobTitleJSON" + "$ref": "#/definitions/ProprietaryHEXColorJSON" }, { - "$ref": "#/definitions/NationalityJSON" + "$ref": "#/definitions/ProprietaryIntegerJSON" }, { - "$ref": "#/definitions/PersonNameJSON" + "$ref": "#/definitions/ProprietaryLanguageJSON" }, { - "$ref": "#/definitions/PhoneNumberJSON" + "$ref": "#/definitions/ProprietaryPhoneNumberJSON" }, { - "$ref": "#/definitions/PostOfficeBoxAddressJSON" + "$ref": "#/definitions/ProprietaryStringJSON" }, { - "$ref": "#/definitions/PseudonymJSON" + "$ref": "#/definitions/ProprietaryURLJSON" }, { - "$ref": "#/definitions/SexJSON" + "$ref": "#/definitions/ProprietaryJSONJSON" }, { - "$ref": "#/definitions/StreetAddressJSON" + "$ref": "#/definitions/ProprietaryXMLJSON" }, { - "$ref": "#/definitions/WebsiteJSON" + "$ref": "#/definitions/ConsentJSON" } ] }, - "AffiliationJSON": { + "ProprietaryBooleanJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "Affiliation" + "const": "ProprietaryBoolean" }, "@context": { "type": "string" @@ -17243,82 +17213,99 @@ export const SucceedIdentityAttributeRequest: any = { "@version": { "type": "string" }, - "organization": { - "type": "string" + "value": { + "type": "boolean" }, - "role": { + "title": { "type": "string" }, - "unit": { + "description": { "type": "string" + }, + "valueHintsOverride": { + "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ "@type", - "organization" + "title", + "value" ], "additionalProperties": false }, - "BirthDateJSON": { + "ValueHintsOverrideJSON": { "type": "object", + "additionalProperties": false, "properties": { "@type": { "type": "string", - "const": "BirthDate" - }, - "@context": { - "type": "string" + "const": "ValueHints" }, - "@version": { + "editHelp": { "type": "string" }, - "day": { + "min": { "type": "number" }, - "month": { + "max": { "type": "number" }, - "year": { - "type": "number" - } - }, - "required": [ - "@type", - "day", - "month", - "year" - ], - "additionalProperties": false - }, - "BirthNameJSON": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "const": "BirthName" + "pattern": { + "type": "string" + }, + "values": { + "type": "array", + "items": { + "$ref": "#/definitions/ValueHintsValueJSON" + } + }, + "defaultValue": { + "type": [ + "string", + "number", + "boolean" + ] + }, + "propertyHints": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ValueHintsJSON" + } }, "@context": { "type": "string" }, "@version": { "type": "string" + } + } + }, + "ValueHintsValueJSON": { + "type": "object", + "properties": { + "key": { + "type": [ + "string", + "number", + "boolean" + ] }, - "value": { + "displayName": { "type": "string" } }, "required": [ - "@type", - "value" + "key", + "displayName" ], "additionalProperties": false }, - "BirthPlaceJSON": { + "ValueHintsJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "BirthPlace" + "const": "ValueHints" }, "@context": { "type": "string" @@ -17326,29 +17313,49 @@ export const SucceedIdentityAttributeRequest: any = { "@version": { "type": "string" }, - "city": { + "editHelp": { "type": "string" }, - "country": { - "type": "string" + "min": { + "type": "number" }, - "state": { + "max": { + "type": "number" + }, + "pattern": { "type": "string" + }, + "values": { + "type": "array", + "items": { + "$ref": "#/definitions/ValueHintsValueJSON" + } + }, + "defaultValue": { + "type": [ + "string", + "number", + "boolean" + ] + }, + "propertyHints": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ValueHintsJSON" + } } }, "required": [ - "@type", - "city", - "country" + "@type" ], "additionalProperties": false }, - "CitizenshipJSON": { + "ProprietaryCountryJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "Citizenship" + "const": "ProprietaryCountry" }, "@context": { "type": "string" @@ -17358,20 +17365,30 @@ export const SucceedIdentityAttributeRequest: any = { }, "value": { "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "valueHintsOverride": { + "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ "@type", + "title", "value" ], "additionalProperties": false }, - "CommunicationLanguageJSON": { + "ProprietaryEMailAddressJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "CommunicationLanguage" + "const": "ProprietaryEMailAddress" }, "@context": { "type": "string" @@ -17381,20 +17398,30 @@ export const SucceedIdentityAttributeRequest: any = { }, "value": { "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "valueHintsOverride": { + "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ "@type", + "title", "value" ], "additionalProperties": false }, - "DeliveryBoxAddressJSON": { + "ProprietaryFileReferenceJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "DeliveryBoxAddress" + "const": "ProprietaryFileReference" }, "@context": { "type": "string" @@ -17402,48 +17429,32 @@ export const SucceedIdentityAttributeRequest: any = { "@version": { "type": "string" }, - "recipient": { - "type": "string" - }, - "userId": { - "type": "string" - }, - "deliveryBoxId": { - "type": "string" - }, - "zipCode": { - "type": "string" - }, - "city": { + "value": { "type": "string" }, - "country": { + "title": { "type": "string" }, - "phoneNumber": { + "description": { "type": "string" }, - "state": { - "type": "string" + "valueHintsOverride": { + "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ "@type", - "city", - "country", - "deliveryBoxId", - "recipient", - "userId", - "zipCode" + "title", + "value" ], "additionalProperties": false }, - "DisplayNameJSON": { + "ProprietaryFloatJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "DisplayName" + "const": "ProprietaryFloat" }, "@context": { "type": "string" @@ -17452,44 +17463,31 @@ export const SucceedIdentityAttributeRequest: any = { "type": "string" }, "value": { - "type": "string" - } - }, - "required": [ - "@type", - "value" - ], - "additionalProperties": false - }, - "EMailAddressJSON": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "const": "EMailAddress" + "type": "number" }, - "@context": { + "title": { "type": "string" }, - "@version": { + "description": { "type": "string" }, - "value": { - "type": "string" + "valueHintsOverride": { + "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ "@type", + "title", "value" ], "additionalProperties": false }, - "FaxNumberJSON": { + "ProprietaryHEXColorJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "FaxNumber" + "const": "ProprietaryHEXColor" }, "@context": { "type": "string" @@ -17499,43 +17497,30 @@ export const SucceedIdentityAttributeRequest: any = { }, "value": { "type": "string" - } - }, - "required": [ - "@type", - "value" - ], - "additionalProperties": false - }, - "IdentityFileReferenceJSON": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "const": "IdentityFileReference" }, - "@context": { + "title": { "type": "string" }, - "@version": { + "description": { "type": "string" }, - "value": { - "type": "string" + "valueHintsOverride": { + "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ "@type", + "title", "value" ], "additionalProperties": false }, - "JobTitleJSON": { + "ProprietaryIntegerJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "JobTitle" + "const": "ProprietaryInteger" }, "@context": { "type": "string" @@ -17544,44 +17529,31 @@ export const SucceedIdentityAttributeRequest: any = { "type": "string" }, "value": { - "type": "string" - } - }, - "required": [ - "@type", - "value" - ], - "additionalProperties": false - }, - "NationalityJSON": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "const": "Nationality" + "type": "number" }, - "@context": { + "title": { "type": "string" }, - "@version": { + "description": { "type": "string" }, - "value": { - "type": "string" + "valueHintsOverride": { + "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ "@type", + "title", "value" ], "additionalProperties": false }, - "PersonNameJSON": { + "ProprietaryLanguageJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "PersonName" + "const": "ProprietaryLanguage" }, "@context": { "type": "string" @@ -17589,35 +17561,32 @@ export const SucceedIdentityAttributeRequest: any = { "@version": { "type": "string" }, - "givenName": { - "type": "string" - }, - "middleName": { + "value": { "type": "string" }, - "surname": { + "title": { "type": "string" }, - "honorificSuffix": { + "description": { "type": "string" }, - "honorificPrefix": { - "type": "string" + "valueHintsOverride": { + "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ "@type", - "givenName", - "surname" + "title", + "value" ], "additionalProperties": false }, - "PhoneNumberJSON": { + "ProprietaryPhoneNumberJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "PhoneNumber" + "const": "ProprietaryPhoneNumber" }, "@context": { "type": "string" @@ -17627,20 +17596,30 @@ export const SucceedIdentityAttributeRequest: any = { }, "value": { "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "valueHintsOverride": { + "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ "@type", + "title", "value" ], "additionalProperties": false }, - "PostOfficeBoxAddressJSON": { + "ProprietaryStringJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "PostOfficeBoxAddress" + "const": "ProprietaryString" }, "@context": { "type": "string" @@ -17648,41 +17627,32 @@ export const SucceedIdentityAttributeRequest: any = { "@version": { "type": "string" }, - "recipient": { - "type": "string" - }, - "boxId": { - "type": "string" - }, - "zipCode": { + "value": { "type": "string" }, - "city": { + "title": { "type": "string" }, - "country": { + "description": { "type": "string" }, - "state": { - "type": "string" + "valueHintsOverride": { + "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ "@type", - "boxId", - "city", - "country", - "recipient", - "zipCode" + "title", + "value" ], "additionalProperties": false }, - "PseudonymJSON": { + "ProprietaryURLJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "Pseudonym" + "const": "ProprietaryURL" }, "@context": { "type": "string" @@ -17692,20 +17662,30 @@ export const SucceedIdentityAttributeRequest: any = { }, "value": { "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "valueHintsOverride": { + "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ "@type", + "title", "value" ], "additionalProperties": false }, - "SexJSON": { + "ProprietaryJSONJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "Sex" + "const": "ProprietaryJSON" }, "@context": { "type": "string" @@ -17713,22 +17693,27 @@ export const SucceedIdentityAttributeRequest: any = { "@version": { "type": "string" }, - "value": { + "title": { "type": "string" - } + }, + "description": { + "type": "string" + }, + "value": {} }, "required": [ "@type", + "title", "value" ], "additionalProperties": false }, - "StreetAddressJSON": { + "ProprietaryXMLJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "StreetAddress" + "const": "ProprietaryXML" }, "@context": { "type": "string" @@ -17736,45 +17721,34 @@ export const SucceedIdentityAttributeRequest: any = { "@version": { "type": "string" }, - "recipient": { - "type": "string" - }, - "street": { - "type": "string" - }, - "houseNo": { + "value": { "type": "string" }, - "zipCode": { + "title": { "type": "string" }, - "city": { + "description": { "type": "string" }, - "country": { - "type": "string" + "valueHintsOverride": { + "$ref": "#/definitions/ValueHintsOverrideJSON" }, - "state": { + "schemaURL": { "type": "string" } }, "required": [ "@type", - "city", - "country", - "houseNo", - "recipient", - "street", - "zipCode" + "title", + "value" ], "additionalProperties": false }, - "WebsiteJSON": { + "ConsentJSON": { "type": "object", "properties": { "@type": { - "type": "string", - "const": "Website" + "type": "string" }, "@context": { "type": "string" @@ -17782,89 +17756,148 @@ export const SucceedIdentityAttributeRequest: any = { "@version": { "type": "string" }, - "value": { + "consent": { + "type": "string" + }, + "link": { "type": "string" } }, "required": [ "@type", - "value" + "consent" ], "additionalProperties": false }, - "AttributeValues.Identity.Uneditable.Json": { - "anyOf": [ - { - "$ref": "#/definitions/AffiliationOrganizationJSON" - }, - { - "$ref": "#/definitions/AffiliationRoleJSON" - }, + "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 SucceedRepositoryAttributeRequest: any = { + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/SucceedRepositoryAttributeRequest", + "definitions": { + "SucceedRepositoryAttributeRequest": { + "type": "object", + "properties": { + "predecessorId": { + "type": "string" + }, + "successorContent": { + "type": "object", + "properties": { + "value": { + "$ref": "#/definitions/AttributeValues.Identity.Json" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "validFrom": { + "$ref": "#/definitions/ISO8601DateTimeString" + }, + "validTo": { + "$ref": "#/definitions/ISO8601DateTimeString" + } + }, + "required": [ + "value" + ], + "additionalProperties": false + } + }, + "required": [ + "predecessorId", + "successorContent" + ], + "additionalProperties": false + }, + "AttributeValues.Identity.Json": { + "anyOf": [ { - "$ref": "#/definitions/AffiliationUnitJSON" + "$ref": "#/definitions/AttributeValues.Identity.Editable.Json" }, { - "$ref": "#/definitions/BirthCityJSON" + "$ref": "#/definitions/AttributeValues.Identity.Uneditable.Json" + } + ] + }, + "AttributeValues.Identity.Editable.Json": { + "anyOf": [ + { + "$ref": "#/definitions/AffiliationJSON" }, { - "$ref": "#/definitions/BirthCountryJSON" + "$ref": "#/definitions/BirthDateJSON" }, { - "$ref": "#/definitions/BirthDayJSON" + "$ref": "#/definitions/BirthNameJSON" }, { - "$ref": "#/definitions/BirthMonthJSON" + "$ref": "#/definitions/BirthPlaceJSON" }, { - "$ref": "#/definitions/BirthStateJSON" + "$ref": "#/definitions/CitizenshipJSON" }, { - "$ref": "#/definitions/BirthYearJSON" + "$ref": "#/definitions/CommunicationLanguageJSON" }, { - "$ref": "#/definitions/CityJSON" + "$ref": "#/definitions/DeliveryBoxAddressJSON" }, { - "$ref": "#/definitions/CountryJSON" + "$ref": "#/definitions/DisplayNameJSON" }, { - "$ref": "#/definitions/GivenNameJSON" + "$ref": "#/definitions/EMailAddressJSON" }, { - "$ref": "#/definitions/HonorificPrefixJSON" + "$ref": "#/definitions/FaxNumberJSON" }, { - "$ref": "#/definitions/HonorificSuffixJSON" + "$ref": "#/definitions/IdentityFileReferenceJSON" }, { - "$ref": "#/definitions/HouseNumberJSON" + "$ref": "#/definitions/JobTitleJSON" }, { - "$ref": "#/definitions/MiddleNameJSON" + "$ref": "#/definitions/NationalityJSON" }, { - "$ref": "#/definitions/SchematizedXMLJSON" + "$ref": "#/definitions/PersonNameJSON" }, { - "$ref": "#/definitions/StateJSON" + "$ref": "#/definitions/PhoneNumberJSON" }, { - "$ref": "#/definitions/StreetJSON" + "$ref": "#/definitions/PostOfficeBoxAddressJSON" }, { - "$ref": "#/definitions/SurnameJSON" + "$ref": "#/definitions/PseudonymJSON" }, { - "$ref": "#/definitions/ZipCodeJSON" + "$ref": "#/definitions/SexJSON" + }, + { + "$ref": "#/definitions/StreetAddressJSON" + }, + { + "$ref": "#/definitions/WebsiteJSON" } ] }, - "AffiliationOrganizationJSON": { + "AffiliationJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "AffiliationOrganization" + "const": "Affiliation" }, "@context": { "type": "string" @@ -17872,22 +17905,28 @@ export const SucceedIdentityAttributeRequest: any = { "@version": { "type": "string" }, - "value": { + "organization": { + "type": "string" + }, + "role": { + "type": "string" + }, + "unit": { "type": "string" } }, "required": [ "@type", - "value" + "organization" ], "additionalProperties": false }, - "AffiliationRoleJSON": { + "BirthDateJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "AffiliationRole" + "const": "BirthDate" }, "@context": { "type": "string" @@ -17895,22 +17934,30 @@ export const SucceedIdentityAttributeRequest: any = { "@version": { "type": "string" }, - "value": { - "type": "string" + "day": { + "type": "number" + }, + "month": { + "type": "number" + }, + "year": { + "type": "number" } }, "required": [ "@type", - "value" + "day", + "month", + "year" ], "additionalProperties": false }, - "AffiliationUnitJSON": { + "BirthNameJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "AffiliationUnit" + "const": "BirthName" }, "@context": { "type": "string" @@ -17928,11 +17975,12 @@ export const SucceedIdentityAttributeRequest: any = { ], "additionalProperties": false }, - "BirthCityJSON": { + "BirthPlaceJSON": { "type": "object", "properties": { - "value": { - "type": "string" + "@type": { + "type": "string", + "const": "BirthPlace" }, "@context": { "type": "string" @@ -17940,22 +17988,29 @@ export const SucceedIdentityAttributeRequest: any = { "@version": { "type": "string" }, - "@type": { - "type": "string", - "const": "BirthCity" + "city": { + "type": "string" + }, + "country": { + "type": "string" + }, + "state": { + "type": "string" } }, "required": [ "@type", - "value" + "city", + "country" ], "additionalProperties": false }, - "BirthCountryJSON": { + "CitizenshipJSON": { "type": "object", "properties": { - "value": { - "type": "string" + "@type": { + "type": "string", + "const": "Citizenship" }, "@context": { "type": "string" @@ -17963,9 +18018,8 @@ export const SucceedIdentityAttributeRequest: any = { "@version": { "type": "string" }, - "@type": { - "type": "string", - "const": "BirthCountry" + "value": { + "type": "string" } }, "required": [ @@ -17974,12 +18028,12 @@ export const SucceedIdentityAttributeRequest: any = { ], "additionalProperties": false }, - "BirthDayJSON": { + "CommunicationLanguageJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "BirthDay" + "const": "CommunicationLanguage" }, "@context": { "type": "string" @@ -17988,7 +18042,7 @@ export const SucceedIdentityAttributeRequest: any = { "type": "string" }, "value": { - "type": "number" + "type": "string" } }, "required": [ @@ -17997,12 +18051,12 @@ export const SucceedIdentityAttributeRequest: any = { ], "additionalProperties": false }, - "BirthMonthJSON": { + "DeliveryBoxAddressJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "BirthMonth" + "const": "DeliveryBoxAddress" }, "@context": { "type": "string" @@ -18010,36 +18064,48 @@ export const SucceedIdentityAttributeRequest: any = { "@version": { "type": "string" }, - "value": { - "type": "number", - "enum": [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12 - ], - "description": "Month values: 1 (january) - 12 (december)" + "recipient": { + "type": "string" + }, + "userId": { + "type": "string" + }, + "deliveryBoxId": { + "type": "string" + }, + "zipCode": { + "type": "string" + }, + "city": { + "type": "string" + }, + "country": { + "type": "string" + }, + "phoneNumber": { + "type": "string" + }, + "state": { + "type": "string" } }, "required": [ "@type", - "value" + "city", + "country", + "deliveryBoxId", + "recipient", + "userId", + "zipCode" ], "additionalProperties": false }, - "BirthStateJSON": { + "DisplayNameJSON": { "type": "object", "properties": { - "value": { - "type": "string" + "@type": { + "type": "string", + "const": "DisplayName" }, "@context": { "type": "string" @@ -18047,9 +18113,8 @@ export const SucceedIdentityAttributeRequest: any = { "@version": { "type": "string" }, - "@type": { - "type": "string", - "const": "BirthState" + "value": { + "type": "string" } }, "required": [ @@ -18058,12 +18123,12 @@ export const SucceedIdentityAttributeRequest: any = { ], "additionalProperties": false }, - "BirthYearJSON": { + "EMailAddressJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "BirthYear" + "const": "EMailAddress" }, "@context": { "type": "string" @@ -18072,7 +18137,7 @@ export const SucceedIdentityAttributeRequest: any = { "type": "string" }, "value": { - "type": "number" + "type": "string" } }, "required": [ @@ -18081,12 +18146,12 @@ export const SucceedIdentityAttributeRequest: any = { ], "additionalProperties": false }, - "CityJSON": { + "FaxNumberJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "City" + "const": "FaxNumber" }, "@context": { "type": "string" @@ -18104,12 +18169,12 @@ export const SucceedIdentityAttributeRequest: any = { ], "additionalProperties": false }, - "CountryJSON": { + "IdentityFileReferenceJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "Country" + "const": "IdentityFileReference" }, "@context": { "type": "string" @@ -18127,12 +18192,12 @@ export const SucceedIdentityAttributeRequest: any = { ], "additionalProperties": false }, - "GivenNameJSON": { + "JobTitleJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "GivenName" + "const": "JobTitle" }, "@context": { "type": "string" @@ -18150,12 +18215,12 @@ export const SucceedIdentityAttributeRequest: any = { ], "additionalProperties": false }, - "HonorificPrefixJSON": { + "NationalityJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "HonorificPrefix" + "const": "Nationality" }, "@context": { "type": "string" @@ -18173,12 +18238,12 @@ export const SucceedIdentityAttributeRequest: any = { ], "additionalProperties": false }, - "HonorificSuffixJSON": { + "PersonNameJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "HonorificSuffix" + "const": "PersonName" }, "@context": { "type": "string" @@ -18186,45 +18251,35 @@ export const SucceedIdentityAttributeRequest: any = { "@version": { "type": "string" }, - "value": { + "givenName": { "type": "string" - } - }, - "required": [ - "@type", - "value" - ], - "additionalProperties": false - }, - "HouseNumberJSON": { - "type": "object", - "properties": { - "@type": { - "type": "string", - "const": "HouseNumber" }, - "@context": { + "middleName": { "type": "string" }, - "@version": { + "surname": { "type": "string" }, - "value": { + "honorificSuffix": { + "type": "string" + }, + "honorificPrefix": { "type": "string" } }, "required": [ "@type", - "value" + "givenName", + "surname" ], "additionalProperties": false }, - "MiddleNameJSON": { + "PhoneNumberJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "MiddleName" + "const": "PhoneNumber" }, "@context": { "type": "string" @@ -18242,12 +18297,12 @@ export const SucceedIdentityAttributeRequest: any = { ], "additionalProperties": false }, - "SchematizedXMLJSON": { + "PostOfficeBoxAddressJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "SchematizedXML" + "const": "PostOfficeBoxAddress" }, "@context": { "type": "string" @@ -18255,25 +18310,41 @@ export const SucceedIdentityAttributeRequest: any = { "@version": { "type": "string" }, - "value": { + "recipient": { "type": "string" }, - "schemaURL": { + "boxId": { + "type": "string" + }, + "zipCode": { + "type": "string" + }, + "city": { + "type": "string" + }, + "country": { + "type": "string" + }, + "state": { "type": "string" } }, "required": [ "@type", - "value" + "boxId", + "city", + "country", + "recipient", + "zipCode" ], "additionalProperties": false }, - "StateJSON": { + "PseudonymJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "State" + "const": "Pseudonym" }, "@context": { "type": "string" @@ -18291,12 +18362,12 @@ export const SucceedIdentityAttributeRequest: any = { ], "additionalProperties": false }, - "StreetJSON": { + "SexJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "Street" + "const": "Sex" }, "@context": { "type": "string" @@ -18314,12 +18385,12 @@ export const SucceedIdentityAttributeRequest: any = { ], "additionalProperties": false }, - "SurnameJSON": { + "StreetAddressJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "Surname" + "const": "StreetAddress" }, "@context": { "type": "string" @@ -18327,22 +18398,45 @@ export const SucceedIdentityAttributeRequest: any = { "@version": { "type": "string" }, - "value": { + "recipient": { + "type": "string" + }, + "street": { + "type": "string" + }, + "houseNo": { + "type": "string" + }, + "zipCode": { + "type": "string" + }, + "city": { + "type": "string" + }, + "country": { + "type": "string" + }, + "state": { "type": "string" } }, "required": [ "@type", - "value" + "city", + "country", + "houseNo", + "recipient", + "street", + "zipCode" ], "additionalProperties": false }, - "ZipCodeJSON": { + "WebsiteJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "ZipCode" + "const": "Website" }, "@context": { "type": "string" @@ -18360,105 +18454,79 @@ export const SucceedIdentityAttributeRequest: any = { ], "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 SucceedRelationshipAttributeAndNotifyPeerRequest: any = { - "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/SucceedRelationshipAttributeAndNotifyPeerRequest", - "definitions": { - "SucceedRelationshipAttributeAndNotifyPeerRequest": { - "type": "object", - "properties": { - "predecessorId": { - "$ref": "#/definitions/AttributeIdString" - }, - "successorContent": { - "type": "object", - "properties": { - "value": { - "$ref": "#/definitions/AttributeValues.Relationship.Json" - }, - "validFrom": { - "$ref": "#/definitions/ISO8601DateTimeString" - }, - "validTo": { - "$ref": "#/definitions/ISO8601DateTimeString" - } - }, - "required": [ - "value" - ], - "additionalProperties": false - } - }, - "required": [ - "predecessorId", - "successorContent" - ], - "additionalProperties": false - }, - "AttributeIdString": { - "type": "string", - "pattern": "ATT[A-Za-z0-9]{17}" - }, - "AttributeValues.Relationship.Json": { + "AttributeValues.Identity.Uneditable.Json": { "anyOf": [ { - "$ref": "#/definitions/ProprietaryBooleanJSON" + "$ref": "#/definitions/AffiliationOrganizationJSON" }, { - "$ref": "#/definitions/ProprietaryCountryJSON" + "$ref": "#/definitions/AffiliationRoleJSON" }, { - "$ref": "#/definitions/ProprietaryEMailAddressJSON" + "$ref": "#/definitions/AffiliationUnitJSON" }, { - "$ref": "#/definitions/ProprietaryFileReferenceJSON" + "$ref": "#/definitions/BirthCityJSON" }, { - "$ref": "#/definitions/ProprietaryFloatJSON" + "$ref": "#/definitions/BirthCountryJSON" }, { - "$ref": "#/definitions/ProprietaryHEXColorJSON" + "$ref": "#/definitions/BirthDayJSON" }, { - "$ref": "#/definitions/ProprietaryIntegerJSON" + "$ref": "#/definitions/BirthMonthJSON" }, { - "$ref": "#/definitions/ProprietaryLanguageJSON" + "$ref": "#/definitions/BirthStateJSON" }, { - "$ref": "#/definitions/ProprietaryPhoneNumberJSON" + "$ref": "#/definitions/BirthYearJSON" }, { - "$ref": "#/definitions/ProprietaryStringJSON" + "$ref": "#/definitions/CityJSON" }, { - "$ref": "#/definitions/ProprietaryURLJSON" + "$ref": "#/definitions/CountryJSON" }, { - "$ref": "#/definitions/ProprietaryJSONJSON" + "$ref": "#/definitions/GivenNameJSON" }, { - "$ref": "#/definitions/ProprietaryXMLJSON" + "$ref": "#/definitions/HonorificPrefixJSON" }, { - "$ref": "#/definitions/ConsentJSON" + "$ref": "#/definitions/HonorificSuffixJSON" + }, + { + "$ref": "#/definitions/HouseNumberJSON" + }, + { + "$ref": "#/definitions/MiddleNameJSON" + }, + { + "$ref": "#/definitions/SchematizedXMLJSON" + }, + { + "$ref": "#/definitions/StateJSON" + }, + { + "$ref": "#/definitions/StreetJSON" + }, + { + "$ref": "#/definitions/SurnameJSON" + }, + { + "$ref": "#/definitions/ZipCodeJSON" } ] }, - "ProprietaryBooleanJSON": { + "AffiliationOrganizationJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "ProprietaryBoolean" + "const": "AffiliationOrganization" }, "@context": { "type": "string" @@ -18467,98 +18535,136 @@ export const SucceedRelationshipAttributeAndNotifyPeerRequest: any = { "type": "string" }, "value": { - "type": "boolean" + "type": "string" + } + }, + "required": [ + "@type", + "value" + ], + "additionalProperties": false + }, + "AffiliationRoleJSON": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "const": "AffiliationRole" }, - "title": { + "@context": { "type": "string" }, - "description": { + "@version": { "type": "string" }, - "valueHintsOverride": { - "$ref": "#/definitions/ValueHintsOverrideJSON" + "value": { + "type": "string" } }, "required": [ "@type", - "title", "value" ], "additionalProperties": false }, - "ValueHintsOverrideJSON": { + "AffiliationUnitJSON": { "type": "object", - "additionalProperties": false, "properties": { "@type": { "type": "string", - "const": "ValueHints" + "const": "AffiliationUnit" }, - "editHelp": { + "@context": { "type": "string" }, - "min": { - "type": "number" - }, - "max": { - "type": "number" + "@version": { + "type": "string" }, - "pattern": { + "value": { + "type": "string" + } + }, + "required": [ + "@type", + "value" + ], + "additionalProperties": false + }, + "BirthCityJSON": { + "type": "object", + "properties": { + "value": { "type": "string" }, - "values": { - "type": "array", - "items": { - "$ref": "#/definitions/ValueHintsValueJSON" - } + "@context": { + "type": "string" }, - "defaultValue": { - "type": [ - "string", - "number", - "boolean" - ] + "@version": { + "type": "string" }, - "propertyHints": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/ValueHintsJSON" - } + "@type": { + "type": "string", + "const": "BirthCity" + } + }, + "required": [ + "@type", + "value" + ], + "additionalProperties": false + }, + "BirthCountryJSON": { + "type": "object", + "properties": { + "value": { + "type": "string" }, "@context": { "type": "string" }, "@version": { "type": "string" + }, + "@type": { + "type": "string", + "const": "BirthCountry" } - } + }, + "required": [ + "@type", + "value" + ], + "additionalProperties": false }, - "ValueHintsValueJSON": { + "BirthDayJSON": { "type": "object", "properties": { - "key": { - "type": [ - "string", - "number", - "boolean" - ] + "@type": { + "type": "string", + "const": "BirthDay" }, - "displayName": { + "@context": { "type": "string" + }, + "@version": { + "type": "string" + }, + "value": { + "type": "number" } }, "required": [ - "key", - "displayName" + "@type", + "value" ], "additionalProperties": false }, - "ValueHintsJSON": { + "BirthMonthJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "ValueHints" + "const": "BirthMonth" }, "@context": { "type": "string" @@ -18566,49 +18672,60 @@ export const SucceedRelationshipAttributeAndNotifyPeerRequest: any = { "@version": { "type": "string" }, - "editHelp": { + "value": { + "type": "number", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12 + ], + "description": "Month values: 1 (january) - 12 (december)" + } + }, + "required": [ + "@type", + "value" + ], + "additionalProperties": false + }, + "BirthStateJSON": { + "type": "object", + "properties": { + "value": { "type": "string" }, - "min": { - "type": "number" - }, - "max": { - "type": "number" - }, - "pattern": { + "@context": { "type": "string" }, - "values": { - "type": "array", - "items": { - "$ref": "#/definitions/ValueHintsValueJSON" - } - }, - "defaultValue": { - "type": [ - "string", - "number", - "boolean" - ] + "@version": { + "type": "string" }, - "propertyHints": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/ValueHintsJSON" - } + "@type": { + "type": "string", + "const": "BirthState" } }, "required": [ - "@type" + "@type", + "value" ], "additionalProperties": false }, - "ProprietaryCountryJSON": { + "BirthYearJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "ProprietaryCountry" + "const": "BirthYear" }, "@context": { "type": "string" @@ -18617,31 +18734,21 @@ export const SucceedRelationshipAttributeAndNotifyPeerRequest: any = { "type": "string" }, "value": { - "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "valueHintsOverride": { - "$ref": "#/definitions/ValueHintsOverrideJSON" + "type": "number" } }, "required": [ "@type", - "title", "value" ], "additionalProperties": false }, - "ProprietaryEMailAddressJSON": { + "CityJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "ProprietaryEMailAddress" + "const": "City" }, "@context": { "type": "string" @@ -18651,30 +18758,20 @@ export const SucceedRelationshipAttributeAndNotifyPeerRequest: any = { }, "value": { "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "valueHintsOverride": { - "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ "@type", - "title", "value" ], "additionalProperties": false }, - "ProprietaryFileReferenceJSON": { + "CountryJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "ProprietaryFileReference" + "const": "Country" }, "@context": { "type": "string" @@ -18684,30 +18781,20 @@ export const SucceedRelationshipAttributeAndNotifyPeerRequest: any = { }, "value": { "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "valueHintsOverride": { - "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ "@type", - "title", "value" ], "additionalProperties": false }, - "ProprietaryFloatJSON": { + "GivenNameJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "ProprietaryFloat" + "const": "GivenName" }, "@context": { "type": "string" @@ -18716,31 +18803,21 @@ export const SucceedRelationshipAttributeAndNotifyPeerRequest: any = { "type": "string" }, "value": { - "type": "number" - }, - "title": { "type": "string" - }, - "description": { - "type": "string" - }, - "valueHintsOverride": { - "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ "@type", - "title", "value" ], "additionalProperties": false }, - "ProprietaryHEXColorJSON": { + "HonorificPrefixJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "ProprietaryHEXColor" + "const": "HonorificPrefix" }, "@context": { "type": "string" @@ -18750,30 +18827,20 @@ export const SucceedRelationshipAttributeAndNotifyPeerRequest: any = { }, "value": { "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "valueHintsOverride": { - "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ "@type", - "title", "value" ], "additionalProperties": false }, - "ProprietaryIntegerJSON": { + "HonorificSuffixJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "ProprietaryInteger" + "const": "HonorificSuffix" }, "@context": { "type": "string" @@ -18782,31 +18849,21 @@ export const SucceedRelationshipAttributeAndNotifyPeerRequest: any = { "type": "string" }, "value": { - "type": "number" - }, - "title": { "type": "string" - }, - "description": { - "type": "string" - }, - "valueHintsOverride": { - "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ "@type", - "title", "value" ], "additionalProperties": false }, - "ProprietaryLanguageJSON": { + "HouseNumberJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "ProprietaryLanguage" + "const": "HouseNumber" }, "@context": { "type": "string" @@ -18816,30 +18873,20 @@ export const SucceedRelationshipAttributeAndNotifyPeerRequest: any = { }, "value": { "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "valueHintsOverride": { - "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ "@type", - "title", "value" ], "additionalProperties": false }, - "ProprietaryPhoneNumberJSON": { + "MiddleNameJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "ProprietaryPhoneNumber" + "const": "MiddleName" }, "@context": { "type": "string" @@ -18849,30 +18896,20 @@ export const SucceedRelationshipAttributeAndNotifyPeerRequest: any = { }, "value": { "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "valueHintsOverride": { - "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ "@type", - "title", "value" ], "additionalProperties": false }, - "ProprietaryStringJSON": { + "SchematizedXMLJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "ProprietaryString" + "const": "SchematizedXML" }, "@context": { "type": "string" @@ -18883,29 +18920,22 @@ export const SucceedRelationshipAttributeAndNotifyPeerRequest: any = { "value": { "type": "string" }, - "title": { - "type": "string" - }, - "description": { + "schemaURL": { "type": "string" - }, - "valueHintsOverride": { - "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ "@type", - "title", "value" ], "additionalProperties": false }, - "ProprietaryURLJSON": { + "StateJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "ProprietaryURL" + "const": "State" }, "@context": { "type": "string" @@ -18915,30 +18945,20 @@ export const SucceedRelationshipAttributeAndNotifyPeerRequest: any = { }, "value": { "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "valueHintsOverride": { - "$ref": "#/definitions/ValueHintsOverrideJSON" } }, "required": [ "@type", - "title", "value" ], "additionalProperties": false }, - "ProprietaryJSONJSON": { + "StreetJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "ProprietaryJSON" + "const": "Street" }, "@context": { "type": "string" @@ -18946,27 +18966,22 @@ export const SucceedRelationshipAttributeAndNotifyPeerRequest: any = { "@version": { "type": "string" }, - "title": { - "type": "string" - }, - "description": { + "value": { "type": "string" - }, - "value": {} + } }, "required": [ "@type", - "title", "value" ], "additionalProperties": false }, - "ProprietaryXMLJSON": { + "SurnameJSON": { "type": "object", "properties": { "@type": { "type": "string", - "const": "ProprietaryXML" + "const": "Surname" }, "@context": { "type": "string" @@ -18976,32 +18991,20 @@ export const SucceedRelationshipAttributeAndNotifyPeerRequest: any = { }, "value": { "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "valueHintsOverride": { - "$ref": "#/definitions/ValueHintsOverrideJSON" - }, - "schemaURL": { - "type": "string" } }, "required": [ "@type", - "title", "value" ], "additionalProperties": false }, - "ConsentJSON": { + "ZipCodeJSON": { "type": "object", "properties": { "@type": { - "type": "string" + "type": "string", + "const": "ZipCode" }, "@context": { "type": "string" @@ -19009,16 +19012,13 @@ export const SucceedRelationshipAttributeAndNotifyPeerRequest: any = { "@version": { "type": "string" }, - "consent": { - "type": "string" - }, - "link": { + "value": { "type": "string" } }, "required": [ "@type", - "consent" + "value" ], "additionalProperties": false }, diff --git a/packages/runtime/src/useCases/consumption/attributes/CreateIdentityAttribute.ts b/packages/runtime/src/useCases/consumption/attributes/CreateRepositoryAttribute.ts similarity index 77% rename from packages/runtime/src/useCases/consumption/attributes/CreateIdentityAttribute.ts rename to packages/runtime/src/useCases/consumption/attributes/CreateRepositoryAttribute.ts index 9b4da3a69..b7cc32a63 100644 --- a/packages/runtime/src/useCases/consumption/attributes/CreateIdentityAttribute.ts +++ b/packages/runtime/src/useCases/consumption/attributes/CreateRepositoryAttribute.ts @@ -7,7 +7,7 @@ import { LocalAttributeDTO } from "../../../types"; import { ISO8601DateTimeString, SchemaRepository, SchemaValidator, UseCase } from "../../common"; import { AttributeMapper } from "./AttributeMapper"; -export interface CreateIdentityAttributeRequest { +export interface CreateRepositoryAttributeRequest { content: { value: AttributeValues.Identity.Json; tags?: string[]; @@ -16,13 +16,13 @@ export interface CreateIdentityAttributeRequest { }; } -class Validator extends SchemaValidator { +class Validator extends SchemaValidator { public constructor(@Inject schemaRepository: SchemaRepository) { - super(schemaRepository.getSchema("CreateIdentityAttributeRequest")); + super(schemaRepository.getSchema("CreateRepositoryAttributeRequest")); } } -export class CreateIdentityAttributeUseCase extends UseCase { +export class CreateRepositoryAttributeUseCase extends UseCase { public constructor( @Inject private readonly attributeController: AttributesController, @Inject private readonly accountController: AccountController, @@ -31,7 +31,7 @@ export class CreateIdentityAttributeUseCase extends UseCase> { + protected async executeInternal(request: CreateRepositoryAttributeRequest): Promise> { const params = CreateLocalAttributeParams.from({ content: { "@type": "IdentityAttribute", diff --git a/packages/runtime/src/useCases/consumption/attributes/GetOwnIdentityAttributes.ts b/packages/runtime/src/useCases/consumption/attributes/GetRepositoryAttributes.ts similarity index 61% rename from packages/runtime/src/useCases/consumption/attributes/GetOwnIdentityAttributes.ts rename to packages/runtime/src/useCases/consumption/attributes/GetRepositoryAttributes.ts index afef03c9f..7e70824a5 100644 --- a/packages/runtime/src/useCases/consumption/attributes/GetOwnIdentityAttributes.ts +++ b/packages/runtime/src/useCases/consumption/attributes/GetRepositoryAttributes.ts @@ -1,23 +1,23 @@ import { Result } from "@js-soft/ts-utils"; import { AttributesController } from "@nmshd/consumption"; import { Inject } from "typescript-ioc"; +import { AttributeMapper } from ".."; import { LocalAttributeDTO } from "../../../types"; import { SchemaRepository, SchemaValidator, UseCase } from "../../common"; -import { AttributeMapper } from "../../consumption"; -export interface GetOwnIdentityAttributesRequest { +export interface GetRepositoryAttributesRequest { onlyLatestVersions?: boolean; } -export interface GetOwnIdentityAttributesResponse extends Array {} +export interface GetRepositoryAttributesResponse extends Array {} -class Validator extends SchemaValidator { +class Validator extends SchemaValidator { public constructor(@Inject schemaRepository: SchemaRepository) { - super(schemaRepository.getSchema("GetOwnIdentityAttributesRequest")); + super(schemaRepository.getSchema("GetRepositoryAttributesRequest")); } } -export class GetOwnIdentityAttributesUseCase extends UseCase { +export class GetRepositoryAttributesUseCase extends UseCase { public constructor( @Inject private readonly attributesController: AttributesController, @Inject validator: Validator @@ -25,7 +25,7 @@ export class GetOwnIdentityAttributesUseCase extends UseCase> { + protected async executeInternal(request: GetRepositoryAttributesRequest): Promise> { const query: any = { shareInfo: { $exists: false } }; diff --git a/packages/runtime/src/useCases/consumption/attributes/GetSharedVersionsOfIdentityAttribute.ts b/packages/runtime/src/useCases/consumption/attributes/GetSharedVersionsOfRepositoryAttribute.ts similarity index 77% rename from packages/runtime/src/useCases/consumption/attributes/GetSharedVersionsOfIdentityAttribute.ts rename to packages/runtime/src/useCases/consumption/attributes/GetSharedVersionsOfRepositoryAttribute.ts index 2c7b17d06..a527940a5 100644 --- a/packages/runtime/src/useCases/consumption/attributes/GetSharedVersionsOfIdentityAttribute.ts +++ b/packages/runtime/src/useCases/consumption/attributes/GetSharedVersionsOfRepositoryAttribute.ts @@ -6,19 +6,19 @@ import { LocalAttributeDTO } from "../../../types"; import { AddressString, AttributeIdString, RuntimeErrors, SchemaRepository, SchemaValidator, UseCase } from "../../common"; import { AttributeMapper } from "./AttributeMapper"; -export interface GetSharedVersionsOfIdentityAttributeRequest { +export interface GetSharedVersionsOfRepositoryAttributeRequest { attributeId: AttributeIdString; peers?: AddressString[]; onlyLatestVersions?: boolean; } -class Validator extends SchemaValidator { +class Validator extends SchemaValidator { public constructor(@Inject schemaRepository: SchemaRepository) { - super(schemaRepository.getSchema("GetSharedVersionsOfIdentityAttributeRequest")); + super(schemaRepository.getSchema("GetSharedVersionsOfRepositoryAttributeRequest")); } } -export class GetSharedVersionsOfIdentityAttributeUseCase extends UseCase { +export class GetSharedVersionsOfRepositoryAttributeUseCase extends UseCase { public constructor( @Inject private readonly accountController: AccountController, @Inject private readonly attributeController: AttributesController, @@ -27,7 +27,7 @@ export class GetSharedVersionsOfIdentityAttributeUseCase extends UseCase> { + protected async executeInternal(request: GetSharedVersionsOfRepositoryAttributeRequest): Promise> { const repositoryAttributeId = CoreId.from(request.attributeId); const repositoryAttribute = await this.attributeController.getLocalAttribute(repositoryAttributeId); @@ -36,7 +36,7 @@ export class GetSharedVersionsOfIdentityAttributeUseCase extends UseCase { +class Validator extends SchemaValidator { public constructor(@Inject schemaRepository: SchemaRepository) { - super(schemaRepository.getSchema("NotifyPeerAboutIdentityAttributeSuccessionRequest")); + super(schemaRepository.getSchema("NotifyPeerAboutRepositoryAttributeSuccessionRequest")); } } -export class NotifyPeerAboutIdentityAttributeSuccessionUseCase extends UseCase< - NotifyPeerAboutIdentityAttributeSuccessionRequest, - NotifyPeerAboutIdentityAttributeSuccessionResponse +export class NotifyPeerAboutRepositoryAttributeSuccessionUseCase extends UseCase< + NotifyPeerAboutRepositoryAttributeSuccessionRequest, + NotifyPeerAboutRepositoryAttributeSuccessionResponse > { public constructor( @Inject private readonly accountController: AccountController, @@ -37,7 +37,7 @@ export class NotifyPeerAboutIdentityAttributeSuccessionUseCase extends UseCase< super(validator); } - protected async executeInternal(request: NotifyPeerAboutIdentityAttributeSuccessionRequest): Promise> { + protected async executeInternal(request: NotifyPeerAboutRepositoryAttributeSuccessionRequest): Promise> { const repositoryAttributeSuccessorId = CoreId.from(request.attributeId); const repositoryAttributeSuccessor = await this.attributeController.getLocalAttribute(repositoryAttributeSuccessorId); @@ -46,17 +46,17 @@ export class NotifyPeerAboutIdentityAttributeSuccessionUseCase extends UseCase< } if (!repositoryAttributeSuccessor.isRepositoryAttribute(this.accountController.identity.address)) { - return Result.fail(RuntimeErrors.attributes.isNoIdentityAttribute(repositoryAttributeSuccessorId)); + return Result.fail(RuntimeErrors.attributes.isNotRepositoryAttribute(repositoryAttributeSuccessorId)); } const candidatePredecessors = await this.attributeController.getSharedVersionsOfRepositoryAttribute(repositoryAttributeSuccessorId, [CoreAddress.from(request.peer)]); if (candidatePredecessors.length === 0) { - return Result.fail(RuntimeErrors.attributes.noOtherVersionOfIdentityAttributeHasBeenSharedWithPeerBefore(repositoryAttributeSuccessorId, request.peer)); + return Result.fail(RuntimeErrors.attributes.noOtherVersionOfRepositoryAttributeHasBeenSharedWithPeerBefore(repositoryAttributeSuccessorId, request.peer)); } if (candidatePredecessors[0].shareInfo?.sourceAttribute?.toString() === request.attributeId) { - return Result.fail(RuntimeErrors.attributes.identityAttributeHasAlreadyBeenSharedWithPeer(request.attributeId, request.peer, candidatePredecessors[0].id)); + return Result.fail(RuntimeErrors.attributes.repositoryAttributeHasAlreadyBeenSharedWithPeer(request.attributeId, request.peer, candidatePredecessors[0].id)); } const ownSharedIdentityAttributePredecessor = candidatePredecessors[0]; diff --git a/packages/runtime/src/useCases/consumption/attributes/ShareIdentityAttribute.ts b/packages/runtime/src/useCases/consumption/attributes/ShareRepositoryAttribute.ts similarity index 77% rename from packages/runtime/src/useCases/consumption/attributes/ShareIdentityAttribute.ts rename to packages/runtime/src/useCases/consumption/attributes/ShareRepositoryAttribute.ts index 2095028d1..66ece3309 100644 --- a/packages/runtime/src/useCases/consumption/attributes/ShareIdentityAttribute.ts +++ b/packages/runtime/src/useCases/consumption/attributes/ShareRepositoryAttribute.ts @@ -7,7 +7,7 @@ import { LocalRequestDTO } from "../../../types"; import { AddressString, AttributeIdString, ISO8601DateTimeString, RuntimeErrors, SchemaRepository, SchemaValidator, UseCase } from "../../common"; import { RequestMapper } from "../requests"; -export interface ShareIdentityAttributeRequest { +export interface ShareRepositoryAttributeRequest { attributeId: AttributeIdString; peer: AddressString; requestMetadata?: { @@ -24,13 +24,13 @@ export interface ShareIdentityAttributeRequest { }; } -class Validator extends SchemaValidator { +class Validator extends SchemaValidator { public constructor(@Inject schemaRepository: SchemaRepository) { - super(schemaRepository.getSchema("ShareIdentityAttributeRequest")); + super(schemaRepository.getSchema("ShareRepositoryAttributeRequest")); } } -export class ShareIdentityAttributeUseCase extends UseCase { +export class ShareRepositoryAttributeUseCase extends UseCase { public constructor( @Inject private readonly attributeController: AttributesController, @Inject private readonly accountController: AccountController, @@ -41,7 +41,7 @@ export class ShareIdentityAttributeUseCase extends UseCase> { + protected async executeInternal(request: ShareRepositoryAttributeRequest): Promise> { const repositoryAttributeId = CoreId.from(request.attributeId); const repositoryAttribute = await this.attributeController.getLocalAttribute(repositoryAttributeId); @@ -50,7 +50,7 @@ export class ShareIdentityAttributeUseCase extends UseCase 0) { return Result.fail( - RuntimeErrors.attributes.identityAttributeHasAlreadyBeenSharedWithPeer(request.attributeId, request.peer, ownSharedIdentityAttributesOfRepositoryAttribute[0].id) + RuntimeErrors.attributes.repositoryAttributeHasAlreadyBeenSharedWithPeer(request.attributeId, request.peer, ownSharedIdentityAttributesOfRepositoryAttribute[0].id) ); } - const ownSharedIdentityAttributesOfRepositoryAttributeVersion = await this.attributeController.getSharedVersionsOfRepositoryAttribute( + const sharedVersionsOfRepositoryAttribute = await this.attributeController.getSharedVersionsOfRepositoryAttribute( repositoryAttributeId, [CoreAddress.from(request.peer)], false ); - if (ownSharedIdentityAttributesOfRepositoryAttributeVersion.length > 0) { + if (sharedVersionsOfRepositoryAttribute.length > 0) { return Result.fail( - RuntimeErrors.attributes.anotherVersionOfIdentityAttributeHasAlreadyBeenSharedWithPeer( + RuntimeErrors.attributes.anotherVersionOfRepositoryAttributeHasAlreadyBeenSharedWithPeer( request.attributeId, request.peer, - ownSharedIdentityAttributesOfRepositoryAttributeVersion[0].id + sharedVersionsOfRepositoryAttribute[0].id ) ); } diff --git a/packages/runtime/src/useCases/consumption/attributes/SucceedRelationshipAttributeAndNotifyPeer.ts b/packages/runtime/src/useCases/consumption/attributes/SucceedRelationshipAttributeAndNotifyPeer.ts index 7b67ac17c..258209cf9 100644 --- a/packages/runtime/src/useCases/consumption/attributes/SucceedRelationshipAttributeAndNotifyPeer.ts +++ b/packages/runtime/src/useCases/consumption/attributes/SucceedRelationshipAttributeAndNotifyPeer.ts @@ -1,5 +1,5 @@ import { Result } from "@js-soft/ts-utils"; -import { AttributeSuccessorParams, AttributesController, ConsumptionIds, CoreErrors } from "@nmshd/consumption"; +import { AttributesController, AttributeSuccessorParams, ConsumptionIds, CoreErrors } from "@nmshd/consumption"; import { AttributeValues, Notification, PeerSharedAttributeSucceededNotificationItem, RelationshipAttribute, RelationshipAttributeJSON } from "@nmshd/content"; import { AccountController, CoreId, MessageController } from "@nmshd/transport"; import { Inject } from "typescript-ioc"; diff --git a/packages/runtime/src/useCases/consumption/attributes/SucceedIdentityAttribute.ts b/packages/runtime/src/useCases/consumption/attributes/SucceedRepositoryAttribute.ts similarity index 80% rename from packages/runtime/src/useCases/consumption/attributes/SucceedIdentityAttribute.ts rename to packages/runtime/src/useCases/consumption/attributes/SucceedRepositoryAttribute.ts index 4d199af01..728d3f65e 100644 --- a/packages/runtime/src/useCases/consumption/attributes/SucceedIdentityAttribute.ts +++ b/packages/runtime/src/useCases/consumption/attributes/SucceedRepositoryAttribute.ts @@ -7,12 +7,12 @@ import { LocalAttributeDTO } from "../../../types"; import { ISO8601DateTimeString, SchemaRepository, SchemaValidator, UseCase } from "../../common"; import { AttributeMapper } from "./AttributeMapper"; -export interface SucceedIdentityAttributeResponse { +export interface SucceedRepositoryAttributeResponse { predecessor: LocalAttributeDTO; successor: LocalAttributeDTO; } -export interface SucceedIdentityAttributeRequest { +export interface SucceedRepositoryAttributeRequest { predecessorId: string; successorContent: { value: AttributeValues.Identity.Json; @@ -22,13 +22,13 @@ export interface SucceedIdentityAttributeRequest { }; } -class Validator extends SchemaValidator { +class Validator extends SchemaValidator { public constructor(@Inject schemaRepository: SchemaRepository) { - super(schemaRepository.getSchema("SucceedIdentityAttributeRequest")); + super(schemaRepository.getSchema("SucceedRepositoryAttributeRequest")); } } -export class SucceedIdentityAttributeUseCase extends UseCase { +export class SucceedRepositoryAttributeUseCase extends UseCase { public constructor( @Inject private readonly attributeController: AttributesController, @Inject private readonly accountController: AccountController, @@ -37,7 +37,7 @@ export class SucceedIdentityAttributeUseCase extends UseCase> { + protected async executeInternal(request: SucceedRepositoryAttributeRequest): Promise> { const predecessor = await this.attributeController.getLocalAttribute(CoreId.from(request.predecessorId)); if (typeof predecessor === "undefined") { return Result.fail(CoreErrors.attributes.predecessorDoesNotExist()); @@ -60,7 +60,7 @@ export class SucceedIdentityAttributeUseCase extends UseCase { await ensureActiveRelationship(services2.transport, services3.transport); // exchange IdentityAttibutes between all clients - await executeFullCreateAndShareIdentityAttributeFlow(services1, services2, { + await executeFullCreateAndShareRepositoryAttributeFlow(services1, services2, { content: { value: { "@type": "DisplayName", @@ -64,7 +64,7 @@ beforeAll(async () => { } } }); - await executeFullCreateAndShareIdentityAttributeFlow(services1, services3, { + await executeFullCreateAndShareRepositoryAttributeFlow(services1, services3, { content: { value: { "@type": "DisplayName", @@ -72,7 +72,7 @@ beforeAll(async () => { } } }); - await executeFullCreateAndShareIdentityAttributeFlow(services2, services1, { + await executeFullCreateAndShareRepositoryAttributeFlow(services2, services1, { content: { value: { "@type": "DisplayName", @@ -80,7 +80,7 @@ beforeAll(async () => { } } }); - await executeFullCreateAndShareIdentityAttributeFlow(services2, services3, { + await executeFullCreateAndShareRepositoryAttributeFlow(services2, services3, { content: { value: { "@type": "DisplayName", @@ -88,7 +88,7 @@ beforeAll(async () => { } } }); - await executeFullCreateAndShareIdentityAttributeFlow(services3, services1, { + await executeFullCreateAndShareRepositoryAttributeFlow(services3, services1, { content: { value: { "@type": "DisplayName", @@ -96,7 +96,7 @@ beforeAll(async () => { } } }); - await executeFullCreateAndShareIdentityAttributeFlow(services3, services2, { + await executeFullCreateAndShareRepositoryAttributeFlow(services3, services2, { content: { value: { "@type": "DisplayName", @@ -106,7 +106,7 @@ beforeAll(async () => { }); // exchange IdentityAttribute between some clients - const mailClient1 = await executeFullCreateAndShareIdentityAttributeFlow(services1, services2, { + const mailClient1 = await executeFullCreateAndShareRepositoryAttributeFlow(services1, services2, { content: { value: { "@type": "EMailAddress", @@ -114,7 +114,7 @@ beforeAll(async () => { } } }); - const mailClient2 = await executeFullCreateAndShareIdentityAttributeFlow(services2, services3, { + const mailClient2 = await executeFullCreateAndShareRepositoryAttributeFlow(services2, services3, { content: { value: { "@type": "EMailAddress", @@ -122,7 +122,7 @@ beforeAll(async () => { } } }); - const mailClient3 = await executeFullCreateAndShareIdentityAttributeFlow(services3, services1, { + const mailClient3 = await executeFullCreateAndShareRepositoryAttributeFlow(services3, services1, { content: { value: { "@type": "EMailAddress", @@ -133,7 +133,7 @@ beforeAll(async () => { // succeed some IdentityAttributes const { successor: succeededMailClient1 } = ( - await services1.consumption.attributes.succeedIdentityAttribute({ + await services1.consumption.attributes.succeedRepositoryAttribute({ predecessorId: mailClient1.shareInfo!.sourceAttribute!, successorContent: { value: { @@ -143,12 +143,12 @@ beforeAll(async () => { } }) ).value; - await services1.consumption.attributes.notifyPeerAboutIdentityAttributeSuccession({ + await services1.consumption.attributes.notifyPeerAboutRepositoryAttributeSuccession({ peer: services2.address, attributeId: succeededMailClient1.id }); - await services2.consumption.attributes.succeedIdentityAttribute({ + await services2.consumption.attributes.succeedRepositoryAttribute({ predecessorId: mailClient2.shareInfo!.sourceAttribute!, successorContent: { value: { @@ -159,7 +159,7 @@ beforeAll(async () => { }); const { successor: succeededMailClient3 } = ( - await services3.consumption.attributes.succeedIdentityAttribute({ + await services3.consumption.attributes.succeedRepositoryAttribute({ predecessorId: mailClient3.shareInfo!.sourceAttribute!, successorContent: { value: { @@ -170,7 +170,7 @@ beforeAll(async () => { }) ).value; const { successor: twiceSucceededMailClient3 } = ( - await services3.consumption.attributes.succeedIdentityAttribute({ + await services3.consumption.attributes.succeedRepositoryAttribute({ predecessorId: succeededMailClient3.id, successorContent: { value: { @@ -180,7 +180,7 @@ beforeAll(async () => { } }) ).value; - await services3.consumption.attributes.notifyPeerAboutIdentityAttributeSuccession({ + await services3.consumption.attributes.notifyPeerAboutRepositoryAttributeSuccession({ peer: services1.address, attributeId: twiceSucceededMailClient3.id }); @@ -300,9 +300,9 @@ beforeAll(async () => { }, 120000); afterAll(async () => await runtimeServiceProvider.stop()); -describe(CreateIdentityAttributeUseCase.name, () => { +describe(CreateRepositoryAttributeUseCase.name, () => { test("should create a repository attribute", async () => { - const request: CreateIdentityAttributeRequest = { + const request: CreateRepositoryAttributeRequest = { content: { value: { "@type": "GivenName", @@ -311,18 +311,18 @@ describe(CreateIdentityAttributeUseCase.name, () => { tags: ["tag1", "tag2"] } }; - const result = await services1.consumption.attributes.createIdentityAttribute(request); + const result = await services1.consumption.attributes.createRepositoryAttribute(request); expect(result.isError).toBe(false); const attribute = result.value; expect(attribute.content).toMatchObject(request.content); await services1.eventBus.waitForEvent(AttributeCreatedEvent, (e) => e.data.id === attribute.id); }); - test("should create LocalAttributes for each property of a complex Identity Attribute", async function () { + test("should create LocalAttributes for each child of a complex repository attribute", async function () { const attributesBeforeCreate = await services1.consumption.attributes.getAttributes({}); const nrAttributesBeforeCreate = attributesBeforeCreate.value.length; - const createIdentityAttributeParams: CreateIdentityAttributeRequest = { + const createRepositoryAttributeParams: CreateRepositoryAttributeRequest = { content: { value: { "@type": "StreetAddress", @@ -335,9 +335,9 @@ describe(CreateIdentityAttributeUseCase.name, () => { } } }; - const createIdentityAttributeResult = await services1.consumption.attributes.createIdentityAttribute(createIdentityAttributeParams); - expect(createIdentityAttributeResult).toBeSuccessful(); - const complexRepoAttribute = createIdentityAttributeResult.value; + const createRepositoryAttributeResult = await services1.consumption.attributes.createRepositoryAttribute(createRepositoryAttributeParams); + expect(createRepositoryAttributeResult).toBeSuccessful(); + const complexRepoAttribute = createRepositoryAttributeResult.value; const childAttributes = ( await services1.consumption.attributes.getAttributes({ @@ -372,9 +372,9 @@ describe(CreateIdentityAttributeUseCase.name, () => { }); }); -describe(ShareIdentityAttributeUseCase.name, () => { - test("should initialize the sharing of an identity attribute", async () => { - const createAttributeRequest: CreateIdentityAttributeRequest = { +describe(ShareRepositoryAttributeUseCase.name, () => { + test("should initialize the sharing of a repository attribute", async () => { + const createAttributeRequest: CreateRepositoryAttributeRequest = { content: { value: { "@type": "GivenName", @@ -383,14 +383,14 @@ describe(ShareIdentityAttributeUseCase.name, () => { tags: ["tag1", "tag2"] } }; - const createAttributeRequestResult = await services1.consumption.attributes.createIdentityAttribute(createAttributeRequest); + const createAttributeRequestResult = await services1.consumption.attributes.createRepositoryAttribute(createAttributeRequest); const attribute = createAttributeRequestResult.value; - const shareRequest: ShareIdentityAttributeRequest = { + const shareRequest: ShareRepositoryAttributeRequest = { attributeId: attribute.id, peer: services2.address }; - const shareRequestResult = await services1.consumption.attributes.shareIdentityAttribute(shareRequest); + const shareRequestResult = await services1.consumption.attributes.shareRepositoryAttribute(shareRequest); expect(shareRequestResult.isSuccess).toBe(true); const shareRequestId = shareRequestResult.value.id; @@ -417,7 +417,7 @@ describe(ShareIdentityAttributeUseCase.name, () => { }); test("should initialize the sharing of an identity attribute with metadata", async () => { - const createAttributeRequest: CreateIdentityAttributeRequest = { + const createAttributeRequest: CreateRepositoryAttributeRequest = { content: { value: { "@type": "GivenName", @@ -426,43 +426,43 @@ describe(ShareIdentityAttributeUseCase.name, () => { tags: ["tag1", "tag2"] } }; - const createAttributeRequestResult = await services1.consumption.attributes.createIdentityAttribute(createAttributeRequest); + const createAttributeRequestResult = await services1.consumption.attributes.createRepositoryAttribute(createAttributeRequest); const attribute = createAttributeRequestResult.value; const expiresAt = CoreDate.utc().add({ days: 1 }).toString(); - const shareRequest: ShareIdentityAttributeRequest = { + const shareRequest: ShareRepositoryAttributeRequest = { attributeId: attribute.id, peer: services2.address, requestMetadata: { - title: "A request Title", - description: "A request Description", + title: "A request title", + description: "A request description", metadata: { aKey: "aValue" }, expiresAt }, requestItemMetadata: { - title: "An item Title", - description: "An item Description", + title: "An item title", + description: "An item description", metadata: { aKey: "aValue" }, requireManualDecision: true } }; - const shareRequestResult = await services1.consumption.attributes.shareIdentityAttribute(shareRequest); + const shareRequestResult = await services1.consumption.attributes.shareRepositoryAttribute(shareRequest); expect(shareRequestResult.isSuccess).toBe(true); const request = shareRequestResult.value; - expect(request.content.title).toBe("A request Title"); - expect(request.content.description).toBe("A request Description"); + expect(request.content.title).toBe("A request title"); + expect(request.content.description).toBe("A request description"); expect(request.content.metadata).toStrictEqual({ aKey: "aValue" }); expect(request.content.expiresAt).toBe(expiresAt); - expect(request.content.items[0].title).toBe("An item Title"); - expect(request.content.items[0].description).toBe("An item Description"); + expect(request.content.items[0].title).toBe("An item title"); + expect(request.content.items[0].description).toBe("An item description"); expect(request.content.items[0].metadata).toStrictEqual({ aKey: "aValue" }); expect((request.content.items[0] as RequestItemJSONDerivations).requireManualDecision).toBe(true); }); test("should reject sharing an attribute, of which a previous version has been shared", async () => { - const ownSharedIdentityAttribute = await executeFullCreateAndShareIdentityAttributeFlow(services1, services2, { + const ownSharedIdentityAttribute = await executeFullCreateAndShareRepositoryAttributeFlow(services1, services2, { content: { value: { "@type": "GivenName", @@ -473,7 +473,7 @@ describe(ShareIdentityAttributeUseCase.name, () => { }); const { successor: successorRepoAttribute } = ( - await services1.consumption.attributes.succeedIdentityAttribute({ + await services1.consumption.attributes.succeedRepositoryAttribute({ predecessorId: ownSharedIdentityAttribute.shareInfo!.sourceAttribute!, successorContent: { value: { @@ -485,15 +485,15 @@ describe(ShareIdentityAttributeUseCase.name, () => { }) ).value; - const response = await services1.consumption.attributes.shareIdentityAttribute({ + const response = await services1.consumption.attributes.shareRepositoryAttribute({ attributeId: successorRepoAttribute.id, peer: services2.address }); - expect(response).toBeAnError(/.*/, "error.runtime.attributes.anotherVersionOfIdentityAttributeHasAlreadyBeenSharedWithPeer"); + expect(response).toBeAnError(/.*/, "error.runtime.attributes.anotherVersionOfRepositoryAttributeHasAlreadyBeenSharedWithPeer"); }); - test("should reject attempts to share the same attribute more than once", async () => { - const createIdentityAttributeRequest: CreateIdentityAttributeRequest = { + test("should reject attempts to share the same repository attribute more than once with the same peer", async () => { + const createRepositoryAttributeRequest: CreateRepositoryAttributeRequest = { content: { value: { "@type": "GivenName", @@ -502,14 +502,14 @@ describe(ShareIdentityAttributeUseCase.name, () => { tags: ["tag1", "tag2"] } }; - const createAttributeRequestResult = await services1.consumption.attributes.createIdentityAttribute(createIdentityAttributeRequest); + const createAttributeRequestResult = await services1.consumption.attributes.createRepositoryAttribute(createRepositoryAttributeRequest); const repositoryAttribute = createAttributeRequestResult.value; - const shareRequest: ShareIdentityAttributeRequest = { + const shareRequest: ShareRepositoryAttributeRequest = { attributeId: repositoryAttribute.id, peer: services2.address }; - const shareRequestResult = await services1.consumption.attributes.shareIdentityAttribute(shareRequest); + const shareRequestResult = await services1.consumption.attributes.shareRepositoryAttribute(shareRequest); const shareRequestId = shareRequestResult.value.id; await syncUntilHasMessageWithRequest(services2.transport, shareRequestId); @@ -523,8 +523,8 @@ describe(ShareIdentityAttributeUseCase.name, () => { return e.data.request.id === shareRequestId && e.data.newStatus === LocalRequestStatus.Completed; }); - const shareRequestResult2 = await services1.consumption.attributes.shareIdentityAttribute(shareRequest); - expect(shareRequestResult2).toBeAnError(/.*/, "error.runtime.attributes.identityAttributeHasAlreadyBeenSharedWithPeer"); + const shareRequestResult2 = await services1.consumption.attributes.shareRepositoryAttribute(shareRequest); + expect(shareRequestResult2).toBeAnError(/.*/, "error.runtime.attributes.repositoryAttributeHasAlreadyBeenSharedWithPeer"); }); test("should reject sharing relationship attribute", async () => { @@ -555,16 +555,16 @@ describe(ShareIdentityAttributeUseCase.name, () => { return e.data.request.id === requestId && e.data.newStatus === LocalRequestStatus.Completed; }); - const shareRequest: ShareIdentityAttributeRequest = { + const shareRequest: ShareRepositoryAttributeRequest = { attributeId: sharedAttributeId, peer: services2.address }; - const shareRequestResult = await services1.consumption.attributes.shareIdentityAttribute(shareRequest); - expect(shareRequestResult).toBeAnError(/.*/, "error.runtime.attributes.isNoIdentityAttribute"); + const shareRequestResult = await services1.consumption.attributes.shareRepositoryAttribute(shareRequest); + expect(shareRequestResult).toBeAnError(/.*/, "error.runtime.attributes.isNotRepositoryAttribute"); }); - test("should reject sharing peer shared attribute", async () => { - const createAttributeRequest: CreateIdentityAttributeRequest = { + test("should reject sharing a peer shared identity attribute", async () => { + const createAttributeRequest: CreateRepositoryAttributeRequest = { content: { value: { "@type": "GivenName", @@ -573,14 +573,14 @@ describe(ShareIdentityAttributeUseCase.name, () => { tags: ["tag1", "tag2"] } }; - const createAttributeRequestResult = await services2.consumption.attributes.createIdentityAttribute(createAttributeRequest); + const createAttributeRequestResult = await services2.consumption.attributes.createRepositoryAttribute(createAttributeRequest); const attribute = createAttributeRequestResult.value; - const shareRequest: ShareIdentityAttributeRequest = { + const shareRequest: ShareRepositoryAttributeRequest = { attributeId: attribute.id, peer: services1.address }; - const shareRequestResult = await services2.consumption.attributes.shareIdentityAttribute(shareRequest); + const shareRequestResult = await services2.consumption.attributes.shareRepositoryAttribute(shareRequest); expect(shareRequestResult.isSuccess).toBe(true); const shareRequestId = shareRequestResult.value.id; @@ -596,16 +596,16 @@ describe(ShareIdentityAttributeUseCase.name, () => { return e.data.request.id === shareRequestId && e.data.newStatus === LocalRequestStatus.Completed; }); - const shareRequest2: ShareIdentityAttributeRequest = { + const shareRequest2: ShareRepositoryAttributeRequest = { attributeId: sharedAttributeId, peer: services2.address }; - const shareRequestResult2 = await services2.consumption.attributes.shareIdentityAttribute(shareRequest2); - expect(shareRequestResult2).toBeAnError(/.*/, "error.runtime.attributes.isNoIdentityAttribute"); + const shareRequestResult2 = await services2.consumption.attributes.shareRepositoryAttribute(shareRequest2); + expect(shareRequestResult2).toBeAnError(/.*/, "error.runtime.attributes.isNotRepositoryAttribute"); }); - test("should reject sharing own shared attribute", async () => { - const createAttributeRequest: CreateIdentityAttributeRequest = { + test("should reject sharing an own shared identity attribute", async () => { + const createAttributeRequest: CreateRepositoryAttributeRequest = { content: { value: { "@type": "GivenName", @@ -614,14 +614,14 @@ describe(ShareIdentityAttributeUseCase.name, () => { tags: ["tag1", "tag2"] } }; - const createAttributeRequestResult = await services1.consumption.attributes.createIdentityAttribute(createAttributeRequest); + const createAttributeRequestResult = await services1.consumption.attributes.createRepositoryAttribute(createAttributeRequest); const attribute = createAttributeRequestResult.value; - const shareRequest: ShareIdentityAttributeRequest = { + const shareRequest: ShareRepositoryAttributeRequest = { attributeId: attribute.id, peer: services2.address }; - const shareRequestResult = await services1.consumption.attributes.shareIdentityAttribute(shareRequest); + const shareRequestResult = await services1.consumption.attributes.shareRepositoryAttribute(shareRequest); expect(shareRequestResult.isSuccess).toBe(true); const shareRequestId = shareRequestResult.value.id; @@ -637,36 +637,36 @@ describe(ShareIdentityAttributeUseCase.name, () => { return e.data.request.id === shareRequestId && e.data.newStatus === LocalRequestStatus.Completed; }); - const shareRequest2: ShareIdentityAttributeRequest = { + const shareRequest2: ShareRepositoryAttributeRequest = { attributeId: sharedAttributeId, peer: services2.address }; - const shareRequestResult2 = await services1.consumption.attributes.shareIdentityAttribute(shareRequest2); - expect(shareRequestResult2).toBeAnError(/.*/, "error.runtime.attributes.isNoIdentityAttribute"); + const shareRequestResult2 = await services1.consumption.attributes.shareRepositoryAttribute(shareRequest2); + expect(shareRequestResult2).toBeAnError(/.*/, "error.runtime.attributes.isNotRepositoryAttribute"); }); - test("should throw when source attribute doesn't exist", async () => { - const shareRequest: ShareIdentityAttributeRequest = { + test("should throw when repository attribute doesn't exist", async () => { + const shareRequest: ShareRepositoryAttributeRequest = { attributeId: (await CoreId.generate("ATT")).toString(), peer: services1.address }; - const shareRequestResult = await services1.consumption.attributes.shareIdentityAttribute(shareRequest); + const shareRequestResult = await services1.consumption.attributes.shareRepositoryAttribute(shareRequest); expect(shareRequestResult).toBeAnError(/.*/, "error.runtime.recordNotFound"); }); - test("should throw when source attribute id is invalid ", async () => { - const shareRequest: ShareIdentityAttributeRequest = { + test("should throw when repository attribute id is invalid ", async () => { + const shareRequest: ShareRepositoryAttributeRequest = { attributeId: CoreId.from("faulty").toString(), peer: services1.address }; - const shareRequestResult = await services1.consumption.attributes.shareIdentityAttribute(shareRequest); + const shareRequestResult = await services1.consumption.attributes.shareRepositoryAttribute(shareRequest); expect(shareRequestResult).toBeAnError(/.*/, "error.runtime.validation.invalidPropertyValue"); }); }); -describe(SucceedIdentityAttributeUseCase.name, () => { +describe(SucceedRepositoryAttributeUseCase.name, () => { test("should succeed a repository attribute", async () => { - const createAttributeRequest: CreateIdentityAttributeRequest = { + const createAttributeRequest: CreateRepositoryAttributeRequest = { content: { value: { "@type": "GivenName", @@ -675,9 +675,9 @@ describe(SucceedIdentityAttributeUseCase.name, () => { tags: ["tag1", "tag2"] } }; - const predecessor = (await services1.consumption.attributes.createIdentityAttribute(createAttributeRequest)).value; + const predecessor = (await services1.consumption.attributes.createRepositoryAttribute(createAttributeRequest)).value; - const succeedAttributeRequest: SucceedIdentityAttributeRequest = { + const succeedAttributeRequest: SucceedRepositoryAttributeRequest = { predecessorId: predecessor.id.toString(), successorContent: { value: { @@ -687,7 +687,7 @@ describe(SucceedIdentityAttributeUseCase.name, () => { tags: ["Bunsen", "Burner"] } }; - const result = await services1.consumption.attributes.succeedIdentityAttribute(succeedAttributeRequest); + const result = await services1.consumption.attributes.succeedRepositoryAttribute(succeedAttributeRequest); expect(result.isError).toBe(false); const { predecessor: updatedPredecessor, successor } = result.value; expect(updatedPredecessor.succeededBy).toStrictEqual(successor.id); @@ -698,7 +698,7 @@ describe(SucceedIdentityAttributeUseCase.name, () => { }); test("should throw if predecessor id is invalid", async () => { - const succeedAttributeRequest: SucceedIdentityAttributeRequest = { + const succeedAttributeRequest: SucceedRepositoryAttributeRequest = { predecessorId: CoreId.from("faulty").toString(), successorContent: { value: { @@ -708,12 +708,12 @@ describe(SucceedIdentityAttributeUseCase.name, () => { tags: ["Bunsen", "Burner"] } }; - const result = await services1.consumption.attributes.succeedIdentityAttribute(succeedAttributeRequest); + const result = await services1.consumption.attributes.succeedRepositoryAttribute(succeedAttributeRequest); expect(result).toBeAnError(/.*/, "error.consumption.attributes.predecessorDoesNotExist"); }); test("should throw if predecessor doesn't exist", async () => { - const succeedAttributeRequest: SucceedIdentityAttributeRequest = { + const succeedAttributeRequest: SucceedRepositoryAttributeRequest = { predecessorId: (await CoreId.generate("ATT")).toString(), successorContent: { value: { @@ -723,12 +723,12 @@ describe(SucceedIdentityAttributeUseCase.name, () => { tags: ["Bunsen", "Burner"] } }; - const result = await services1.consumption.attributes.succeedIdentityAttribute(succeedAttributeRequest); + const result = await services1.consumption.attributes.succeedRepositoryAttribute(succeedAttributeRequest); expect(result).toBeAnError(/.*/, "error.consumption.attributes.predecessorDoesNotExist"); }); test("validation should catch attempts of changing the value type", async () => { - const createAttributeRequest: CreateIdentityAttributeRequest = { + const createAttributeRequest: CreateRepositoryAttributeRequest = { content: { value: { "@type": "GivenName", @@ -737,9 +737,9 @@ describe(SucceedIdentityAttributeUseCase.name, () => { tags: ["tag1", "tag2"] } }; - const predecessor = (await services1.consumption.attributes.createIdentityAttribute(createAttributeRequest)).value; + const predecessor = (await services1.consumption.attributes.createRepositoryAttribute(createAttributeRequest)).value; - const succeedAttributeRequest: SucceedIdentityAttributeRequest = { + const succeedAttributeRequest: SucceedRepositoryAttributeRequest = { predecessorId: predecessor.id.toString(), successorContent: { value: { @@ -749,14 +749,14 @@ describe(SucceedIdentityAttributeUseCase.name, () => { tags: ["Bunsen", "Burner"] } }; - const result = await services1.consumption.attributes.succeedIdentityAttribute(succeedAttributeRequest); + const result = await services1.consumption.attributes.succeedRepositoryAttribute(succeedAttributeRequest); expect(result).toBeAnError(/.*/, "error.consumption.attributes.successionMustNotChangeValueType"); }); }); -describe(NotifyPeerAboutIdentityAttributeSuccessionUseCase.name, () => { +describe(NotifyPeerAboutRepositoryAttributeSuccessionUseCase.name, () => { test("should succeed shared identity attributes", async () => { - const sOSIAPredecessor = await executeFullCreateAndShareIdentityAttributeFlow(services1, services2, { + const sOSIAPredecessor = await executeFullCreateAndShareRepositoryAttributeFlow(services1, services2, { content: { value: { "@type": "GivenName", @@ -765,7 +765,7 @@ describe(NotifyPeerAboutIdentityAttributeSuccessionUseCase.name, () => { tags: ["tag1", "tag2"] } }); - const succeedIdentityAttributeRequest: SucceedIdentityAttributeRequest = { + const succeedRepositoryAttributeRequest: SucceedRepositoryAttributeRequest = { predecessorId: sOSIAPredecessor.shareInfo!.sourceAttribute!, successorContent: { value: { @@ -775,9 +775,9 @@ describe(NotifyPeerAboutIdentityAttributeSuccessionUseCase.name, () => { tags: ["Bunsen", "Burner"] } }; - const { successor: sRASuccessor1 } = (await services1.consumption.attributes.succeedIdentityAttribute(succeedIdentityAttributeRequest)).value; + const { successor: sRASuccessor1 } = (await services1.consumption.attributes.succeedRepositoryAttribute(succeedRepositoryAttributeRequest)).value; - const result = await services1.consumption.attributes.notifyPeerAboutIdentityAttributeSuccession({ + const result = await services1.consumption.attributes.notifyPeerAboutRepositoryAttributeSuccession({ attributeId: sRASuccessor1.id, peer: services2.address }); @@ -797,10 +797,10 @@ describe(NotifyPeerAboutIdentityAttributeSuccessionUseCase.name, () => { const sOwnSharedAttributes = (await services1.consumption.attributes.getOwnSharedAttributes({ peer: services2.address })).value; const sOSASuccessors = sOwnSharedAttributes.filter((x) => x.succeeds === sUpdatedOSIAPredecessor.id); expect(sOSASuccessors).toStrictEqual([sOSIASuccessor]); - expect(sOSIASuccessor.content.value).toStrictEqual(succeedIdentityAttributeRequest.successorContent.value); - expect((sOSIASuccessor as any).content.tags).toStrictEqual(succeedIdentityAttributeRequest.successorContent.tags); + expect(sOSIASuccessor.content.value).toStrictEqual(succeedRepositoryAttributeRequest.successorContent.value); + expect((sOSIASuccessor as any).content.tags).toStrictEqual(succeedRepositoryAttributeRequest.successorContent.tags); - const succeedIdentityAttributeRequest2: SucceedIdentityAttributeRequest = { + const succeedRepositoryAttributeRequest2: SucceedRepositoryAttributeRequest = { predecessorId: sRASuccessor1.id, successorContent: { value: { @@ -810,8 +810,8 @@ describe(NotifyPeerAboutIdentityAttributeSuccessionUseCase.name, () => { tags: ["Champions"] } }; - const { successor: sRASuccessor2 } = (await services1.consumption.attributes.succeedIdentityAttribute(succeedIdentityAttributeRequest2)).value; - const result2 = await services1.consumption.attributes.notifyPeerAboutIdentityAttributeSuccession({ + const { successor: sRASuccessor2 } = (await services1.consumption.attributes.succeedRepositoryAttribute(succeedRepositoryAttributeRequest2)).value; + const result2 = await services1.consumption.attributes.notifyPeerAboutRepositoryAttributeSuccession({ attributeId: sRASuccessor2.id, peer: services2.address }); @@ -819,7 +819,7 @@ describe(NotifyPeerAboutIdentityAttributeSuccessionUseCase.name, () => { }); test("should succeed a shared identity attribute skipping one version", async () => { - const sOSIAPredecessor = await executeFullCreateAndShareIdentityAttributeFlow(services1, services2, { + const sOSIAPredecessor = await executeFullCreateAndShareRepositoryAttributeFlow(services1, services2, { content: { value: { "@type": "GivenName", @@ -828,7 +828,7 @@ describe(NotifyPeerAboutIdentityAttributeSuccessionUseCase.name, () => { tags: ["tag1", "tag2"] } }); - const sSucceedIARequest1: SucceedIdentityAttributeRequest = { + const sSucceedIARequest1: SucceedRepositoryAttributeRequest = { predecessorId: sOSIAPredecessor.shareInfo!.sourceAttribute!, successorContent: { value: { @@ -838,8 +838,8 @@ describe(NotifyPeerAboutIdentityAttributeSuccessionUseCase.name, () => { tags: ["Bunsen", "Burner"] } }; - const { successor: sRASuccessor1 } = (await services1.consumption.attributes.succeedIdentityAttribute(sSucceedIARequest1)).value; - const sSucceedIARequest2: SucceedIdentityAttributeRequest = { + const { successor: sRASuccessor1 } = (await services1.consumption.attributes.succeedRepositoryAttribute(sSucceedIARequest1)).value; + const sSucceedIARequest2: SucceedRepositoryAttributeRequest = { predecessorId: sRASuccessor1.id, successorContent: { value: { @@ -848,9 +848,9 @@ describe(NotifyPeerAboutIdentityAttributeSuccessionUseCase.name, () => { } } }; - const { successor: sRASuccessor2 } = (await services1.consumption.attributes.succeedIdentityAttribute(sSucceedIARequest2)).value; + const { successor: sRASuccessor2 } = (await services1.consumption.attributes.succeedRepositoryAttribute(sSucceedIARequest2)).value; - const result = await services1.consumption.attributes.notifyPeerAboutIdentityAttributeSuccession({ + const result = await services1.consumption.attributes.notifyPeerAboutRepositoryAttributeSuccession({ attributeId: sRASuccessor2.id, peer: services2.address }); @@ -875,7 +875,7 @@ describe(NotifyPeerAboutIdentityAttributeSuccessionUseCase.name, () => { }); test("should throw an error if a later version of the attribute has been notified about already", async () => { - const sOSIAPredecessor = await executeFullCreateAndShareIdentityAttributeFlow(services1, services2, { + const sOSIAPredecessor = await executeFullCreateAndShareRepositoryAttributeFlow(services1, services2, { content: { value: { "@type": "GivenName", @@ -884,7 +884,7 @@ describe(NotifyPeerAboutIdentityAttributeSuccessionUseCase.name, () => { tags: ["tag1", "tag2"] } }); - const sSucceedIARequest1: SucceedIdentityAttributeRequest = { + const sSucceedIARequest1: SucceedRepositoryAttributeRequest = { predecessorId: sOSIAPredecessor.shareInfo!.sourceAttribute!, successorContent: { value: { @@ -894,8 +894,8 @@ describe(NotifyPeerAboutIdentityAttributeSuccessionUseCase.name, () => { tags: ["Bunsen", "Burner"] } }; - const { successor: sRASuccessor1 } = (await services1.consumption.attributes.succeedIdentityAttribute(sSucceedIARequest1)).value; - const sSucceedIARequest2: SucceedIdentityAttributeRequest = { + const { successor: sRASuccessor1 } = (await services1.consumption.attributes.succeedRepositoryAttribute(sSucceedIARequest1)).value; + const sSucceedIARequest2: SucceedRepositoryAttributeRequest = { predecessorId: sRASuccessor1.id, successorContent: { value: { @@ -904,9 +904,9 @@ describe(NotifyPeerAboutIdentityAttributeSuccessionUseCase.name, () => { } } }; - const { successor: sRASuccessor2 } = (await services1.consumption.attributes.succeedIdentityAttribute(sSucceedIARequest2)).value; + const { successor: sRASuccessor2 } = (await services1.consumption.attributes.succeedRepositoryAttribute(sSucceedIARequest2)).value; - const result = await services1.consumption.attributes.notifyPeerAboutIdentityAttributeSuccession({ + const result = await services1.consumption.attributes.notifyPeerAboutRepositoryAttributeSuccession({ attributeId: sRASuccessor2.id, peer: services2.address }); @@ -923,7 +923,7 @@ describe(NotifyPeerAboutIdentityAttributeSuccessionUseCase.name, () => { return e.data.predecessor.id === sUpdatedOSIAPredecessor.id && e.data.successor.id === sOSIASuccessor2Skipped1.id; }); - const result2 = await services1.consumption.attributes.notifyPeerAboutIdentityAttributeSuccession({ + const result2 = await services1.consumption.attributes.notifyPeerAboutRepositoryAttributeSuccession({ attributeId: sRASuccessor1.id, peer: services2.address }); @@ -931,7 +931,7 @@ describe(NotifyPeerAboutIdentityAttributeSuccessionUseCase.name, () => { }); test("should prevent attempts of notifying the same peer about the same attribute succession more than once", async () => { - const sOSIAPredecessor = await executeFullCreateAndShareIdentityAttributeFlow(services1, services2, { + const sOSIAPredecessor = await executeFullCreateAndShareRepositoryAttributeFlow(services1, services2, { content: { value: { "@type": "GivenName", @@ -940,7 +940,7 @@ describe(NotifyPeerAboutIdentityAttributeSuccessionUseCase.name, () => { tags: ["tag1", "tag2"] } }); - const sSucceedIARequest1: SucceedIdentityAttributeRequest = { + const sSucceedIARequest1: SucceedRepositoryAttributeRequest = { predecessorId: sOSIAPredecessor.shareInfo!.sourceAttribute!, successorContent: { value: { @@ -950,8 +950,8 @@ describe(NotifyPeerAboutIdentityAttributeSuccessionUseCase.name, () => { tags: ["Bunsen", "Burner"] } }; - const { successor: sRASuccessor1 } = (await services1.consumption.attributes.succeedIdentityAttribute(sSucceedIARequest1)).value; - const sSucceedIARequest2: SucceedIdentityAttributeRequest = { + const { successor: sRASuccessor1 } = (await services1.consumption.attributes.succeedRepositoryAttribute(sSucceedIARequest1)).value; + const sSucceedIARequest2: SucceedRepositoryAttributeRequest = { predecessorId: sRASuccessor1.id, successorContent: { value: { @@ -960,9 +960,9 @@ describe(NotifyPeerAboutIdentityAttributeSuccessionUseCase.name, () => { } } }; - const { successor: sRASuccessor2 } = (await services1.consumption.attributes.succeedIdentityAttribute(sSucceedIARequest2)).value; + const { successor: sRASuccessor2 } = (await services1.consumption.attributes.succeedRepositoryAttribute(sSucceedIARequest2)).value; - const result = await services1.consumption.attributes.notifyPeerAboutIdentityAttributeSuccession({ + const result = await services1.consumption.attributes.notifyPeerAboutRepositoryAttributeSuccession({ attributeId: sRASuccessor2.id, peer: services2.address }); @@ -979,16 +979,16 @@ describe(NotifyPeerAboutIdentityAttributeSuccessionUseCase.name, () => { return e.data.predecessor.id === sUpdatedOSIAPredecessor.id && e.data.successor.id === sOSIASuccessor2Skipped1.id; }); - const result2 = await services1.consumption.attributes.notifyPeerAboutIdentityAttributeSuccession({ + const result2 = await services1.consumption.attributes.notifyPeerAboutRepositoryAttributeSuccession({ attributeId: sRASuccessor2.id, peer: services2.address }); - expect(result2).toBeAnError(/.*/, "error.runtime.attributes.identityAttributeHasAlreadyBeenSharedWithPeer"); + expect(result2).toBeAnError(/.*/, "error.runtime.attributes.repositoryAttributeHasAlreadyBeenSharedWithPeer"); }); test("should prevent notifying a peer about identity attribute succession if no other version has been shared before", async () => { const repoAttribute = ( - await services1.consumption.attributes.createIdentityAttribute({ + await services1.consumption.attributes.createRepositoryAttribute({ content: { value: { "@type": "GivenName", @@ -998,8 +998,8 @@ describe(NotifyPeerAboutIdentityAttributeSuccessionUseCase.name, () => { }) ).value; - const result = await services1.consumption.attributes.notifyPeerAboutIdentityAttributeSuccession({ attributeId: repoAttribute.id, peer: services2.address }); - expect(result).toBeAnError(/.*/, "error.runtime.attributes.noOtherVersionOfIdentityAttributeHasBeenSharedWithPeerBefore"); + const result = await services1.consumption.attributes.notifyPeerAboutRepositoryAttributeSuccession({ attributeId: repoAttribute.id, peer: services2.address }); + expect(result).toBeAnError(/.*/, "error.runtime.attributes.noOtherVersionOfRepositoryAttributeHasBeenSharedWithPeerBefore"); }); }); @@ -1179,7 +1179,7 @@ describe("Get (shared) versions of attribute", () => { let ownSharedRelationshipAttributeVersion3: LocalAttributeDTO; beforeAll(async () => { // setup IdentityAttributes - ownSharedIdentityAttributeVersion1 = await executeFullCreateAndShareIdentityAttributeFlow(services1, services2, { + ownSharedIdentityAttributeVersion1 = await executeFullCreateAndShareRepositoryAttributeFlow(services1, services2, { content: { value: { "@type": "GivenName", @@ -1190,7 +1190,7 @@ describe("Get (shared) versions of attribute", () => { }); repositoryAttributeVersion1 = (await services1.consumption.attributes.getAttribute({ id: ownSharedIdentityAttributeVersion1.shareInfo!.sourceAttribute! })).value; - const succeedRepositoryAttributeRequest1: SucceedIdentityAttributeRequest = { + const succeedRepositoryAttributeRequest1: SucceedRepositoryAttributeRequest = { predecessorId: repositoryAttributeVersion1.id.toString(), successorContent: { value: { @@ -1200,10 +1200,10 @@ describe("Get (shared) versions of attribute", () => { tags: ["tag2"] } }; - const repositoryAttributeSuccessionResult1 = await services1.consumption.attributes.succeedIdentityAttribute(succeedRepositoryAttributeRequest1); + const repositoryAttributeSuccessionResult1 = await services1.consumption.attributes.succeedRepositoryAttribute(succeedRepositoryAttributeRequest1); ({ predecessor: repositoryAttributeVersion1, successor: repositoryAttributeVersion2 } = repositoryAttributeSuccessionResult1.value); - const succeedRepositoryAttributeRequest2: SucceedIdentityAttributeRequest = { + const succeedRepositoryAttributeRequest2: SucceedRepositoryAttributeRequest = { predecessorId: repositoryAttributeVersion2.id.toString(), successorContent: { value: { @@ -1213,11 +1213,11 @@ describe("Get (shared) versions of attribute", () => { tags: ["tag3"] } }; - const repositoryAttributeSuccessionResult2 = await services1.consumption.attributes.succeedIdentityAttribute(succeedRepositoryAttributeRequest2); + const repositoryAttributeSuccessionResult2 = await services1.consumption.attributes.succeedRepositoryAttribute(succeedRepositoryAttributeRequest2); ({ predecessor: repositoryAttributeVersion2, successor: repositoryAttributeVersion3 } = repositoryAttributeSuccessionResult2.value); ({ predecessor: ownSharedIdentityAttributeVersion1, successor: ownSharedIdentityAttributeVersion3 } = ( - await services1.consumption.attributes.notifyPeerAboutIdentityAttributeSuccession({ + await services1.consumption.attributes.notifyPeerAboutRepositoryAttributeSuccession({ attributeId: repositoryAttributeVersion3.id, peer: services2.address }) @@ -1232,7 +1232,7 @@ describe("Get (shared) versions of attribute", () => { return e.data.predecessor.id === ownSharedIdentityAttributeVersion1.id && e.data.successor.id === ownSharedIdentityAttributeVersion3.id; }); - const shareRequestResultPeer2 = await services1.consumption.attributes.shareIdentityAttribute({ + const shareRequestResultPeer2 = await services1.consumption.attributes.shareRepositoryAttribute({ attributeId: repositoryAttributeVersion3.id, peer: services3.address }); @@ -1375,11 +1375,11 @@ describe("Get (shared) versions of attribute", () => { }); }); - describe(GetSharedVersionsOfIdentityAttributeUseCase.name, () => { + describe(GetSharedVersionsOfRepositoryAttributeUseCase.name, () => { test("should get only latest shared version per peer of a repository attribute", async () => { const repositoryAttributeVersions = [repositoryAttributeVersion3, repositoryAttributeVersion2, repositoryAttributeVersion1]; for (const version of repositoryAttributeVersions) { - const result = await services1.consumption.attributes.getSharedVersionsOfIdentityAttribute({ attributeId: version.id }); + const result = await services1.consumption.attributes.getSharedVersionsOfRepositoryAttribute({ attributeId: version.id }); expect(result.isSuccess).toBe(true); const returnedVersions = result.value; @@ -1390,7 +1390,7 @@ describe("Get (shared) versions of attribute", () => { test("should get all shared versions of a repository attribute", async () => { const repositoryAttributeVersions = [repositoryAttributeVersion3, repositoryAttributeVersion2, repositoryAttributeVersion1]; for (const version of repositoryAttributeVersions) { - const result = await services1.consumption.attributes.getSharedVersionsOfIdentityAttribute({ attributeId: version.id, onlyLatestVersions: false }); + const result = await services1.consumption.attributes.getSharedVersionsOfRepositoryAttribute({ attributeId: version.id, onlyLatestVersions: false }); expect(result.isSuccess).toBe(true); const returnedVersions = result.value; @@ -1401,12 +1401,12 @@ describe("Get (shared) versions of attribute", () => { test("should get only latest shared version of a repository attribute for a specific peer", async () => { const repositoryAttributeVersions = [repositoryAttributeVersion3, repositoryAttributeVersion2, repositoryAttributeVersion1]; for (const version of repositoryAttributeVersions) { - const result1 = await services1.consumption.attributes.getSharedVersionsOfIdentityAttribute({ attributeId: version.id, peers: [services2.address] }); + const result1 = await services1.consumption.attributes.getSharedVersionsOfRepositoryAttribute({ attributeId: version.id, peers: [services2.address] }); expect(result1.isSuccess).toBe(true); const returnedVersions1 = result1.value; expect(returnedVersions1).toStrictEqual([ownSharedIdentityAttributeVersion3]); - const result2 = await services1.consumption.attributes.getSharedVersionsOfIdentityAttribute({ attributeId: version.id, peers: [services3.address] }); + const result2 = await services1.consumption.attributes.getSharedVersionsOfRepositoryAttribute({ attributeId: version.id, peers: [services3.address] }); expect(result2.isSuccess).toBe(true); const returnedVersions2 = result2.value; expect(returnedVersions2).toStrictEqual([ownSharedIdentityAttributeVersion3Peer2]); @@ -1416,7 +1416,7 @@ describe("Get (shared) versions of attribute", () => { test("should get all shared versions of a repository attribute for a specific peer", async () => { const repositoryAttributeVersions = [repositoryAttributeVersion3, repositoryAttributeVersion2, repositoryAttributeVersion1]; for (const version of repositoryAttributeVersions) { - const result1 = await services1.consumption.attributes.getSharedVersionsOfIdentityAttribute({ + const result1 = await services1.consumption.attributes.getSharedVersionsOfRepositoryAttribute({ attributeId: version.id, peers: [services2.address], onlyLatestVersions: false @@ -1425,7 +1425,7 @@ describe("Get (shared) versions of attribute", () => { const returnedVersions1 = result1.value; expect(returnedVersions1).toStrictEqual([ownSharedIdentityAttributeVersion3, ownSharedIdentityAttributeVersion1]); - const result2 = await services1.consumption.attributes.getSharedVersionsOfIdentityAttribute({ + const result2 = await services1.consumption.attributes.getSharedVersionsOfRepositoryAttribute({ attributeId: version.id, peers: [services3.address], onlyLatestVersions: false @@ -1436,8 +1436,8 @@ describe("Get (shared) versions of attribute", () => { } }); - test("should return an empty list calling getSharedVersionsOfIdentityAttribute with a nonexistent peer", async () => { - const result = await services1.consumption.attributes.getSharedVersionsOfIdentityAttribute({ + test("should return an empty list calling getSharedVersionsOfRepositoryAttribute with a nonexistent peer", async () => { + const result = await services1.consumption.attributes.getSharedVersionsOfRepositoryAttribute({ attributeId: repositoryAttributeVersion3.id, peers: ["id1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"] }); @@ -1446,14 +1446,14 @@ describe("Get (shared) versions of attribute", () => { expect(returnedVersions).toStrictEqual([]); }); - test("should throw trying to call getSharedVersionsOfIdentityAttribute with a nonexistent attributeId", async () => { - const result2 = await services1.consumption.attributes.getSharedVersionsOfIdentityAttribute({ attributeId: "ATTxxxxxxxxxxxxxxxxx" }); + test("should throw trying to call getSharedVersionsOfRepositoryAttribute with a nonexistent attributeId", async () => { + const result2 = await services1.consumption.attributes.getSharedVersionsOfRepositoryAttribute({ attributeId: "ATTxxxxxxxxxxxxxxxxx" }); expect(result2).toBeAnError(/.*/, "error.runtime.recordNotFound"); }); - test("should throw trying to call getSharedVersionsOfIdentityAttribute with a relationship attribute", async () => { - const result = await services1.consumption.attributes.getSharedVersionsOfIdentityAttribute({ attributeId: ownSharedRelationshipAttributeVersion3.id }); - expect(result).toBeAnError(/.*/, "error.runtime.attributes.isNoIdentityAttribute"); + test("should throw trying to call getSharedVersionsOfRepositoryAttribute with a relationship attribute", async () => { + const result = await services1.consumption.attributes.getSharedVersionsOfRepositoryAttribute({ attributeId: ownSharedRelationshipAttributeVersion3.id }); + expect(result).toBeAnError(/.*/, "error.runtime.attributes.isNotRepositoryAttribute"); }); }); }); diff --git a/packages/runtime/test/consumption/attributes.test.ts b/packages/runtime/test/consumption/attributes.test.ts index 4ef1bedb3..29d8738c6 100644 --- a/packages/runtime/test/consumption/attributes.test.ts +++ b/packages/runtime/test/consumption/attributes.test.ts @@ -2,21 +2,21 @@ import { AttributesController } from "@nmshd/consumption"; import { RelationshipAttributeConfidentiality } from "@nmshd/content"; import { CoreId } from "@nmshd/transport"; import { - CreateIdentityAttributeRequest, + CreateRepositoryAttributeRequest, ExecuteIdentityAttributeQueryUseCase, ExecuteRelationshipAttributeQueryUseCase, GetAttributesUseCase, GetAttributeUseCase, - GetOwnIdentityAttributesUseCase, GetOwnSharedAttributesUseCase, GetPeerSharedAttributesUseCase, + GetRepositoryAttributesUseCase, LocalAttributeDTO } from "../../src"; import { ensureActiveRelationship, - executeFullCreateAndShareIdentityAttributeFlow, executeFullCreateAndShareRelationshipAttributeFlow, - executeFullSucceedIdentityAttributeAndNotifyPeerFlow, + executeFullCreateAndShareRepositoryAttributeFlow, + executeFullSucceedRepositoryAttributeAndNotifyPeerFlow, RuntimeServiceProvider, TestRuntimeServices } from "../lib"; @@ -63,7 +63,7 @@ describe("get attribute(s)", () => { let identityAttributeIds: string[]; beforeAll(async function () { - const senderRequests: CreateIdentityAttributeRequest[] = [ + const senderRequests: CreateRepositoryAttributeRequest[] = [ { content: { value: { @@ -84,7 +84,7 @@ describe("get attribute(s)", () => { identityAttributeIds = []; for (const request of senderRequests) { - const identityAttribute = (await services1.consumption.attributes.createIdentityAttribute(request)).value; + const identityAttribute = (await services1.consumption.attributes.createRepositoryAttribute(request)).value; identityAttributeIds.push(identityAttribute.id); } @@ -165,7 +165,7 @@ describe("attribute queries", () => { let ownSharedRelationshipAttribute: LocalAttributeDTO; beforeAll(async function () { - const createIdentityAttributeRequest: CreateIdentityAttributeRequest = { + const createRepositoryAttributeRequest: CreateRepositoryAttributeRequest = { content: { value: { "@type": "PhoneNumber", @@ -173,7 +173,7 @@ describe("attribute queries", () => { } } }; - repositoryAttribute = (await services1.consumption.attributes.createIdentityAttribute(createIdentityAttributeRequest)).value; + repositoryAttribute = (await services1.consumption.attributes.createRepositoryAttribute(createRepositoryAttributeRequest)).value; ownSharedRelationshipAttribute = await executeFullCreateAndShareRelationshipAttributeFlow(services1, services2, { content: { @@ -254,7 +254,7 @@ describe("get repository, own shared and peer shared attributes", () => { beforeAll(async function () { // unshared succeeded repository attribute services1RepoSurnameV0 = ( - await services1.consumption.attributes.createIdentityAttribute({ + await services1.consumption.attributes.createRepositoryAttribute({ content: { value: { "@type": "Surname", @@ -265,7 +265,7 @@ describe("get repository, own shared and peer shared attributes", () => { ).value; ({ predecessor: services1RepoSurnameV0, successor: services1RepoSurnameV1 } = ( - await services1.consumption.attributes.succeedIdentityAttribute({ + await services1.consumption.attributes.succeedRepositoryAttribute({ predecessorId: services1RepoSurnameV0.id, successorContent: { value: { @@ -277,7 +277,7 @@ describe("get repository, own shared and peer shared attributes", () => { ).value); // own shared succeeded identity attribute - serives1SharedGivenNameV0 = await executeFullCreateAndShareIdentityAttributeFlow(services1, services2, { + serives1SharedGivenNameV0 = await executeFullCreateAndShareRepositoryAttributeFlow(services1, services2, { content: { value: { "@type": "GivenName", @@ -287,7 +287,7 @@ describe("get repository, own shared and peer shared attributes", () => { }); services1RepoGivenNameV0 = (await services1.consumption.attributes.getAttribute({ id: serives1SharedGivenNameV0.shareInfo!.sourceAttribute! })).value; - ({ predecessor: serives1SharedGivenNameV0, successor: services1SharedGivenNameV1 } = await executeFullSucceedIdentityAttributeAndNotifyPeerFlow(services1, services2, { + ({ predecessor: serives1SharedGivenNameV0, successor: services1SharedGivenNameV1 } = await executeFullSucceedRepositoryAttributeAndNotifyPeerFlow(services1, services2, { predecessorId: services1RepoGivenNameV0.id, successorContent: { value: { @@ -300,7 +300,7 @@ describe("get repository, own shared and peer shared attributes", () => { services1RepoGivenNameV1 = (await services1.consumption.attributes.getAttribute({ id: services1SharedGivenNameV1.shareInfo!.sourceAttribute! })).value; // peer shared identity attribute - await executeFullCreateAndShareIdentityAttributeFlow(services2, services1, { + await executeFullCreateAndShareRepositoryAttributeFlow(services2, services1, { content: { value: { "@type": "GivenName", @@ -383,19 +383,19 @@ describe("get repository, own shared and peer shared attributes", () => { await cleanupAttributes(); }); - describe(GetOwnIdentityAttributesUseCase.name, () => { - test("get only latest version of own identity attributes", async () => { - const result = await services1.consumption.attributes.getOwnIdentityAttributes({}); + describe(GetRepositoryAttributesUseCase.name, () => { + test("get only latest version of repository attributes", async () => { + const result = await services1.consumption.attributes.getRepositoryAttributes({}); expect(result).toBeSuccessful(); - const ownIdentityAttributes = result.value; - expect(ownIdentityAttributes).toStrictEqual([services1RepoSurnameV1, services1RepoGivenNameV1]); + const repositoryAttributes = result.value; + expect(repositoryAttributes).toStrictEqual([services1RepoSurnameV1, services1RepoGivenNameV1]); }); - test("get all versions of own identity attributes", async () => { - const result = await services1.consumption.attributes.getOwnIdentityAttributes({ onlyLatestVersions: false }); + test("get all versions of repository attributes", async () => { + const result = await services1.consumption.attributes.getRepositoryAttributes({ onlyLatestVersions: false }); expect(result).toBeSuccessful(); - const ownIdentityAttributes = result.value; - expect(ownIdentityAttributes).toStrictEqual([services1RepoSurnameV0, services1RepoSurnameV1, services1RepoGivenNameV0, services1RepoGivenNameV1]); + const repositoryAttributes = result.value; + expect(repositoryAttributes).toStrictEqual([services1RepoSurnameV0, services1RepoSurnameV1, services1RepoGivenNameV0, services1RepoGivenNameV1]); }); }); diff --git a/packages/runtime/test/consumption/iqlQuery.test.ts b/packages/runtime/test/consumption/iqlQuery.test.ts index 4b3235545..49fce8ce7 100644 --- a/packages/runtime/test/consumption/iqlQuery.test.ts +++ b/packages/runtime/test/consumption/iqlQuery.test.ts @@ -4,7 +4,7 @@ import { IQLQueryJSON, ReadAttributeRequestItemJSON } from "@nmshd/content"; import { DateTime } from "luxon"; import { ConsumptionServices, LocalAttributeDTO, LocalRequestDTO, MessageDTO, OutgoingRequestCreatedEvent, OutgoingRequestStatusChangedEvent, TransportServices } from "../../src"; import { IncomingRequestReceivedEvent, IncomingRequestStatusChangedEvent } from "../../src/events"; -import { RuntimeServiceProvider, establishRelationship, syncUntilHasMessages } from "../lib"; +import { establishRelationship, RuntimeServiceProvider, syncUntilHasMessages } from "../lib"; /* Disable timeout errors if we're debugging */ if (process.env.NODE_OPTIONS !== undefined && process.env.NODE_OPTIONS.search("inspect") !== -1) { @@ -41,7 +41,7 @@ describe("IQL Query", () => { await establishRelationship(sTransportServices, rTransportServices); - const response = await rConsumptionServices.attributes.createIdentityAttribute({ + const response = await rConsumptionServices.attributes.createRepositoryAttribute({ content: { value: { "@type": "GivenName", @@ -53,7 +53,7 @@ describe("IQL Query", () => { rLocalAttribute = response.value; - await rConsumptionServices.attributes.createIdentityAttribute({ + await rConsumptionServices.attributes.createRepositoryAttribute({ content: { value: { "@type": "GivenName", @@ -63,7 +63,7 @@ describe("IQL Query", () => { } }); - await rConsumptionServices.attributes.createIdentityAttribute({ + await rConsumptionServices.attributes.createRepositoryAttribute({ content: { value: { "@type": "GivenName", diff --git a/packages/runtime/test/consumption/notifications.test.ts b/packages/runtime/test/consumption/notifications.test.ts index 9e6ba18e1..5453effea 100644 --- a/packages/runtime/test/consumption/notifications.test.ts +++ b/packages/runtime/test/consumption/notifications.test.ts @@ -2,7 +2,7 @@ import { ConsumptionIds, LocalNotificationStatus } from "@nmshd/consumption"; import { Notification } from "@nmshd/content"; import { CoreIdHelper } from "@nmshd/transport"; import { ConsumptionServices, TransportServices } from "../../src"; -import { RuntimeServiceProvider, TestNotificationItem, TestNotificationItemProcessor, establishRelationship, sendAndReceiveNotification, syncUntilHasMessages } from "../lib"; +import { establishRelationship, RuntimeServiceProvider, sendAndReceiveNotification, syncUntilHasMessages, TestNotificationItem, TestNotificationItemProcessor } from "../lib"; const runtimeServiceProvider = new RuntimeServiceProvider(); let sTransportServices: TransportServices; diff --git a/packages/runtime/test/consumption/requests.test.ts b/packages/runtime/test/consumption/requests.test.ts index 420de277c..7cc064166 100644 --- a/packages/runtime/test/consumption/requests.test.ts +++ b/packages/runtime/test/consumption/requests.test.ts @@ -14,7 +14,7 @@ import { TransportServices } from "../../src"; import { IncomingRequestReceivedEvent, IncomingRequestStatusChangedEvent } from "../../src/events"; -import { RuntimeServiceProvider, establishRelationship, syncUntilHasMessages, syncUntilHasRelationships } from "../lib"; +import { establishRelationship, RuntimeServiceProvider, syncUntilHasMessages, syncUntilHasRelationships } from "../lib"; describe("Requests", () => { describe.each([ diff --git a/packages/runtime/test/dataViews/IQLQueryExpanded.test.ts b/packages/runtime/test/dataViews/IQLQueryExpanded.test.ts index 5d23ece37..e307b4273 100644 --- a/packages/runtime/test/dataViews/IQLQueryExpanded.test.ts +++ b/packages/runtime/test/dataViews/IQLQueryExpanded.test.ts @@ -20,7 +20,7 @@ describe("IQLQueryExpanded", () => { beforeAll(async () => { attributes.push( ( - await consumptionServices1.attributes.createIdentityAttribute({ + await consumptionServices1.attributes.createRepositoryAttribute({ content: { value: { "@type": "GivenName", @@ -33,7 +33,7 @@ describe("IQLQueryExpanded", () => { ); attributes.push( ( - await consumptionServices1.attributes.createIdentityAttribute({ + await consumptionServices1.attributes.createRepositoryAttribute({ content: { value: { "@type": "GivenName", @@ -45,7 +45,7 @@ describe("IQLQueryExpanded", () => { ); attributes.push( ( - await consumptionServices1.attributes.createIdentityAttribute({ + await consumptionServices1.attributes.createRepositoryAttribute({ content: { value: { "@type": "GivenName", @@ -58,7 +58,7 @@ describe("IQLQueryExpanded", () => { ); attributes.push( ( - await consumptionServices1.attributes.createIdentityAttribute({ + await consumptionServices1.attributes.createRepositoryAttribute({ content: { value: { "@type": "Surname", diff --git a/packages/runtime/test/dataViews/IdentityAttributeQueryExpanded.test.ts b/packages/runtime/test/dataViews/IdentityAttributeQueryExpanded.test.ts index 93d2d6f89..d11e5c7db 100644 --- a/packages/runtime/test/dataViews/IdentityAttributeQueryExpanded.test.ts +++ b/packages/runtime/test/dataViews/IdentityAttributeQueryExpanded.test.ts @@ -20,7 +20,7 @@ describe("IdentityAttributeQueryExpanded", () => { beforeAll(async () => { attributes.push( ( - await consumptionServices1.attributes.createIdentityAttribute({ + await consumptionServices1.attributes.createRepositoryAttribute({ content: { value: { "@type": "GivenName", @@ -32,7 +32,7 @@ describe("IdentityAttributeQueryExpanded", () => { ); attributes.push( ( - await consumptionServices1.attributes.createIdentityAttribute({ + await consumptionServices1.attributes.createRepositoryAttribute({ content: { value: { "@type": "GivenName", diff --git a/packages/runtime/test/dataViews/MessageDVO.test.ts b/packages/runtime/test/dataViews/MessageDVO.test.ts index dd1addf5f..892b78f43 100644 --- a/packages/runtime/test/dataViews/MessageDVO.test.ts +++ b/packages/runtime/test/dataViews/MessageDVO.test.ts @@ -1,7 +1,7 @@ import { GivenName, IdentityAttribute, MailJSON, ReadAttributeAcceptResponseItem, ReadAttributeRequestItem, ResponseItemResult, ResponseResult } from "@nmshd/content"; import { CoreAddress, CoreId } from "@nmshd/transport"; import { DataViewExpander, MailDVO, TransportServices } from "../../src"; -import { RuntimeServiceProvider, establishRelationshipWithContents, getRelationship, syncUntilHasMessages, uploadFile } from "../lib"; +import { establishRelationshipWithContents, getRelationship, RuntimeServiceProvider, syncUntilHasMessages, uploadFile } from "../lib"; const serviceProvider = new RuntimeServiceProvider(); let transportServices1: TransportServices; diff --git a/packages/runtime/test/dataViews/OwnSharedAttributeDVO.test.ts b/packages/runtime/test/dataViews/OwnSharedAttributeDVO.test.ts index 38a34fc1e..63238cbaf 100644 --- a/packages/runtime/test/dataViews/OwnSharedAttributeDVO.test.ts +++ b/packages/runtime/test/dataViews/OwnSharedAttributeDVO.test.ts @@ -1,6 +1,6 @@ import { AbstractIntegerJSON, AbstractStringJSON } from "@nmshd/content"; import { LocalAttributeDTO, RepositoryAttributeDVO } from "../../src"; -import { RuntimeServiceProvider, TestRuntimeServices, ensureActiveRelationship, executeFullCreateAndShareIdentityAttributeFlow } from "../lib"; +import { ensureActiveRelationship, executeFullCreateAndShareRepositoryAttributeFlow, RuntimeServiceProvider, TestRuntimeServices } from "../lib"; const serviceProvider = new RuntimeServiceProvider(); let services1: TestRuntimeServices; @@ -25,7 +25,7 @@ const ownSharedIdentityAttributes: LocalAttributeDTO[] = []; describe("SharedToPeerAttributeDVO", () => { beforeAll(async () => { ownSharedIdentityAttributes.push( - await executeFullCreateAndShareIdentityAttributeFlow(services1, services2, { + await executeFullCreateAndShareRepositoryAttributeFlow(services1, services2, { content: { value: { "@type": "BirthYear", @@ -35,7 +35,7 @@ describe("SharedToPeerAttributeDVO", () => { }) ); ownSharedIdentityAttributes.push( - await executeFullCreateAndShareIdentityAttributeFlow(services1, services2, { + await executeFullCreateAndShareRepositoryAttributeFlow(services1, services2, { content: { value: { "@type": "Sex", @@ -45,7 +45,7 @@ describe("SharedToPeerAttributeDVO", () => { }) ); ownSharedIdentityAttributes.push( - await executeFullCreateAndShareIdentityAttributeFlow(services1, services2, { + await executeFullCreateAndShareRepositoryAttributeFlow(services1, services2, { content: { value: { "@type": "Nationality", @@ -55,7 +55,7 @@ describe("SharedToPeerAttributeDVO", () => { }) ); ownSharedIdentityAttributes.push( - await executeFullCreateAndShareIdentityAttributeFlow(services1, services2, { + await executeFullCreateAndShareRepositoryAttributeFlow(services1, services2, { content: { value: { "@type": "CommunicationLanguage", diff --git a/packages/runtime/test/dataViews/RelationshipDVO.test.ts b/packages/runtime/test/dataViews/RelationshipDVO.test.ts index 5b189ddec..709dc5856 100644 --- a/packages/runtime/test/dataViews/RelationshipDVO.test.ts +++ b/packages/runtime/test/dataViews/RelationshipDVO.test.ts @@ -1,7 +1,7 @@ import { GivenName, IdentityAttribute, ReadAttributeAcceptResponseItem, ReadAttributeRequestItem, ResponseItemResult, ResponseResult } from "@nmshd/content"; import { CoreAddress, CoreId } from "@nmshd/transport"; import { DataViewExpander, TransportServices } from "../../src"; -import { RuntimeServiceProvider, establishRelationshipWithContents } from "../lib"; +import { establishRelationshipWithContents, RuntimeServiceProvider } from "../lib"; const serviceProvider = new RuntimeServiceProvider(); let transportServices1: TransportServices; diff --git a/packages/runtime/test/dataViews/RelationshipTemplateDVO.test.ts b/packages/runtime/test/dataViews/RelationshipTemplateDVO.test.ts index 107123b27..14ac91688 100644 --- a/packages/runtime/test/dataViews/RelationshipTemplateDVO.test.ts +++ b/packages/runtime/test/dataViews/RelationshipTemplateDVO.test.ts @@ -9,7 +9,7 @@ import { RelationshipTemplateDTO, RequestItemGroupDVO } from "../../src"; -import { RuntimeServiceProvider, TestRuntimeServices, createTemplate, syncUntilHasRelationships } from "../lib"; +import { createTemplate, RuntimeServiceProvider, syncUntilHasRelationships, TestRuntimeServices } from "../lib"; const serviceProvider = new RuntimeServiceProvider(); let templator: TestRuntimeServices; @@ -32,7 +32,7 @@ beforeEach(function () { describe("RelationshipTemplateDVO", () => { beforeAll(async () => { - await templator.consumption.attributes.createIdentityAttribute({ + await templator.consumption.attributes.createRepositoryAttribute({ content: { value: { "@type": "GivenName", @@ -40,7 +40,7 @@ describe("RelationshipTemplateDVO", () => { } } }); - await templator.consumption.attributes.createIdentityAttribute({ + await templator.consumption.attributes.createRepositoryAttribute({ content: { value: { "@type": "GivenName", @@ -48,7 +48,7 @@ describe("RelationshipTemplateDVO", () => { } } }); - await templator.consumption.attributes.createIdentityAttribute({ + await templator.consumption.attributes.createRepositoryAttribute({ content: { value: { "@type": "Surname", diff --git a/packages/runtime/test/dataViews/RepositoryAttributeDVO.test.ts b/packages/runtime/test/dataViews/RepositoryAttributeDVO.test.ts index 20040a045..3fb1f6111 100644 --- a/packages/runtime/test/dataViews/RepositoryAttributeDVO.test.ts +++ b/packages/runtime/test/dataViews/RepositoryAttributeDVO.test.ts @@ -1,5 +1,5 @@ import { AbstractIntegerJSON, AbstractStringJSON, BiologicalSex, BirthMonth } from "@nmshd/content"; -import { ConsumptionServices, CreateIdentityAttributeRequest, DataViewExpander, LocalAttributeDTO, RepositoryAttributeDVO } from "../../src"; +import { ConsumptionServices, CreateRepositoryAttributeRequest, DataViewExpander, LocalAttributeDTO, RepositoryAttributeDVO } from "../../src"; import { RuntimeServiceProvider } from "../lib"; const serviceProvider = new RuntimeServiceProvider(); @@ -18,7 +18,7 @@ describe("RepositoryAttributeDVO", () => { const attributes: LocalAttributeDTO[] = []; beforeAll(async () => { - const requests: CreateIdentityAttributeRequest[] = [ + const requests: CreateRepositoryAttributeRequest[] = [ { content: { value: { @@ -84,7 +84,7 @@ describe("RepositoryAttributeDVO", () => { } ]; for (const request of requests) { - const attribute = (await consumptionServices1.attributes.createIdentityAttribute(request)).value; + const attribute = (await consumptionServices1.attributes.createRepositoryAttribute(request)).value; attributes.push(attribute); } }); diff --git a/packages/runtime/test/dataViews/requestItems/ComplexReadAttributeRequestItemDVO.test.ts b/packages/runtime/test/dataViews/requestItems/ComplexReadAttributeRequestItemDVO.test.ts index c24fdf777..55bf3010a 100644 --- a/packages/runtime/test/dataViews/requestItems/ComplexReadAttributeRequestItemDVO.test.ts +++ b/packages/runtime/test/dataViews/requestItems/ComplexReadAttributeRequestItemDVO.test.ts @@ -1,22 +1,22 @@ import { AcceptReadAttributeRequestItemParametersWithNewAttributeJSON, LocalRequestStatus } from "@nmshd/consumption"; -import { IQLQuery, IdentityAttributeQuery, PersonName, PersonNameJSON, ReadAttributeRequestItem } from "@nmshd/content"; +import { IdentityAttributeQuery, IQLQuery, PersonName, PersonNameJSON, ReadAttributeRequestItem } from "@nmshd/content"; import { ConsumptionServices, DataViewExpander, DecidableReadAttributeRequestItemDVO, - IQLQueryDVO, IdentityAttributeQueryDVO, IncomingRequestStatusChangedEvent, + IQLQueryDVO, MessageDTO, OutgoingRequestStatusChangedEvent, - ProcessedIQLQueryDVO, ProcessedIdentityAttributeQueryDVO, + ProcessedIQLQueryDVO, ReadAttributeAcceptResponseItemDVO, ReadAttributeRequestItemDVO, RequestMessageDVO, TransportServices } from "../../../src"; -import { MockEventBus, RuntimeServiceProvider, establishRelationship, sendMessage, syncUntilHasMessages } from "../../lib"; +import { establishRelationship, MockEventBus, RuntimeServiceProvider, sendMessage, syncUntilHasMessages } from "../../lib"; const serviceProvider = new RuntimeServiceProvider(); let transportServices1: TransportServices; @@ -51,7 +51,7 @@ describe("ComplexReadAttributeRequestItemDVO with IdentityAttributeQuery", () => await establishRelationship(transportServices1, transportServices2); const recipientAddress = (await transportServices2.account.getIdentityInfo()).value.address; - await consumptionServices2.attributes.createIdentityAttribute({ + await consumptionServices2.attributes.createRepositoryAttribute({ content: { value: PersonName.from({ honorificPrefix: "Dr.", @@ -315,7 +315,7 @@ describe("ComplexReadAttributeRequestItemDVO with IQL", () => { await establishRelationship(transportServices1, transportServices2); const recipientAddress = (await transportServices2.account.getIdentityInfo()).value.address; - await consumptionServices2.attributes.createIdentityAttribute({ + await consumptionServices2.attributes.createRepositoryAttribute({ content: { value: PersonName.from({ honorificPrefix: "Dr.", diff --git a/packages/runtime/test/dataViews/requestItems/CreateIdentityAttributeRequestItemDVO.test.ts b/packages/runtime/test/dataViews/requestItems/CreateIdentityAttributeRequestItemDVO.test.ts index 5b7106b82..73ff62a7b 100644 --- a/packages/runtime/test/dataViews/requestItems/CreateIdentityAttributeRequestItemDVO.test.ts +++ b/packages/runtime/test/dataViews/requestItems/CreateIdentityAttributeRequestItemDVO.test.ts @@ -12,7 +12,7 @@ import { RequestMessageDVO, TransportServices } from "../../../src"; -import { MockEventBus, RuntimeServiceProvider, establishRelationship, sendMessage, syncUntilHasMessages } from "../../lib"; +import { establishRelationship, MockEventBus, RuntimeServiceProvider, sendMessage, syncUntilHasMessages } from "../../lib"; const serviceProvider = new RuntimeServiceProvider(); let sTransportServices: TransportServices; diff --git a/packages/runtime/test/dataViews/requestItems/ProposeAttributeRequestItemDVO.test.ts b/packages/runtime/test/dataViews/requestItems/ProposeAttributeRequestItemDVO.test.ts index 01dcbd877..f224775a8 100644 --- a/packages/runtime/test/dataViews/requestItems/ProposeAttributeRequestItemDVO.test.ts +++ b/packages/runtime/test/dataViews/requestItems/ProposeAttributeRequestItemDVO.test.ts @@ -15,7 +15,7 @@ import { RequestMessageDVO, TransportServices } from "../../../src"; -import { MockEventBus, RuntimeServiceProvider, establishRelationship, sendMessage, syncUntilHasMessages } from "../../lib"; +import { establishRelationship, MockEventBus, RuntimeServiceProvider, sendMessage, syncUntilHasMessages } from "../../lib"; const serviceProvider = new RuntimeServiceProvider(); let transportServices1: TransportServices; @@ -42,7 +42,7 @@ beforeAll(async () => { await establishRelationship(transportServices1, transportServices2); const recipientAddress = (await transportServices2.account.getIdentityInfo()).value.address; - await consumptionServices2.attributes.createIdentityAttribute({ + await consumptionServices2.attributes.createRepositoryAttribute({ content: { value: { "@type": "GivenName", @@ -51,7 +51,7 @@ beforeAll(async () => { } }); - await consumptionServices2.attributes.createIdentityAttribute({ + await consumptionServices2.attributes.createRepositoryAttribute({ content: { value: { "@type": "Surname", diff --git a/packages/runtime/test/dataViews/requestItems/ReadAttributeRequestItemDVO.test.ts b/packages/runtime/test/dataViews/requestItems/ReadAttributeRequestItemDVO.test.ts index b63f4e05c..5c5efafed 100644 --- a/packages/runtime/test/dataViews/requestItems/ReadAttributeRequestItemDVO.test.ts +++ b/packages/runtime/test/dataViews/requestItems/ReadAttributeRequestItemDVO.test.ts @@ -1,22 +1,22 @@ import { AcceptReadAttributeRequestItemParametersWithNewAttributeJSON, LocalRequestStatus } from "@nmshd/consumption"; -import { GivenNameJSON, IQLQuery, IdentityAttributeQuery, ReadAttributeRequestItem, SurnameJSON } from "@nmshd/content"; +import { GivenNameJSON, IdentityAttributeQuery, IQLQuery, ReadAttributeRequestItem, SurnameJSON } from "@nmshd/content"; import { ConsumptionServices, DataViewExpander, DecidableReadAttributeRequestItemDVO, - IQLQueryDVO, IdentityAttributeQueryDVO, IncomingRequestStatusChangedEvent, + IQLQueryDVO, MessageDTO, OutgoingRequestStatusChangedEvent, - ProcessedIQLQueryDVO, ProcessedIdentityAttributeQueryDVO, + ProcessedIQLQueryDVO, ReadAttributeAcceptResponseItemDVO, ReadAttributeRequestItemDVO, RequestMessageDVO, TransportServices } from "../../../src"; -import { MockEventBus, RuntimeServiceProvider, establishRelationship, sendMessage, syncUntilHasMessages } from "../../lib"; +import { establishRelationship, MockEventBus, RuntimeServiceProvider, sendMessage, syncUntilHasMessages } from "../../lib"; const serviceProvider = new RuntimeServiceProvider(); let transportServices1: TransportServices; @@ -51,7 +51,7 @@ describe("ReadAttributeRequestItemDVO with IdentityAttributeQuery", () => { await establishRelationship(transportServices1, transportServices2); const recipientAddress = (await transportServices2.account.getIdentityInfo()).value.address; - await consumptionServices2.attributes.createIdentityAttribute({ + await consumptionServices2.attributes.createRepositoryAttribute({ content: { value: { "@type": "GivenName", @@ -283,7 +283,7 @@ describe("ReadAttributeRequestItemDVO with IQL and results", () => { await establishRelationship(transportServices1, transportServices2); const recipientAddress = (await transportServices2.account.getIdentityInfo()).value.address; - await consumptionServices2.attributes.createIdentityAttribute({ + await consumptionServices2.attributes.createRepositoryAttribute({ content: { value: { "@type": "GivenName", @@ -502,7 +502,7 @@ describe("ReadAttributeRequestItemDVO with IQL and fallback", () => { await establishRelationship(transportServices1, transportServices2); const recipientAddress = (await transportServices2.account.getIdentityInfo()).value.address; - await consumptionServices2.attributes.createIdentityAttribute({ + await consumptionServices2.attributes.createRepositoryAttribute({ content: { value: { "@type": "GivenName", @@ -592,7 +592,7 @@ describe("ReadAttributeRequestItemDVO with IQL and fallback", () => { expect(requestItemDVO.mustBeAccepted).toBe(true); - const attribute = await consumptionServices2.attributes.createIdentityAttribute({ + const attribute = await consumptionServices2.attributes.createRepositoryAttribute({ content: { value: { "@type": "Surname", diff --git a/packages/runtime/test/dataViews/requestItems/ShareAttributeRequestItemDVO.test.ts b/packages/runtime/test/dataViews/requestItems/ShareAttributeRequestItemDVO.test.ts index 22367c1bf..bb5195b71 100644 --- a/packages/runtime/test/dataViews/requestItems/ShareAttributeRequestItemDVO.test.ts +++ b/packages/runtime/test/dataViews/requestItems/ShareAttributeRequestItemDVO.test.ts @@ -12,7 +12,7 @@ import { ShareAttributeRequestItemDVO, TransportServices } from "../../../src"; -import { MockEventBus, RuntimeServiceProvider, establishRelationship, sendMessage, syncUntilHasMessages } from "../../lib"; +import { establishRelationship, MockEventBus, RuntimeServiceProvider, sendMessage, syncUntilHasMessages } from "../../lib"; const serviceProvider = new RuntimeServiceProvider(); let sTransportServices: TransportServices; @@ -39,7 +39,7 @@ beforeAll(async () => { await establishRelationship(sTransportServices, rTransportServices); const rAddress = (await rTransportServices.account.getIdentityInfo()).value.address; - const senderAttribute = await sConsumptionServices.attributes.createIdentityAttribute({ + const senderAttribute = await sConsumptionServices.attributes.createRepositoryAttribute({ content: { value: { "@type": "DisplayName", diff --git a/packages/runtime/test/lib/testUtils.ts b/packages/runtime/test/lib/testUtils.ts index e76ffb03a..9290e8ccc 100644 --- a/packages/runtime/test/lib/testUtils.ts +++ b/packages/runtime/test/lib/testUtils.ts @@ -16,8 +16,8 @@ import { DateTime } from "luxon"; import { ConsumptionServices, CreateAndShareRelationshipAttributeRequest, - CreateIdentityAttributeRequest, CreateOutgoingRequestRequest, + CreateRepositoryAttributeRequest, CreateTokenForFileRequest, CreateTokenQRCodeForFileRequest, FileDTO, @@ -26,16 +26,16 @@ import { LocalNotificationDTO, MessageDTO, MessageSentEvent, - NotifyPeerAboutIdentityAttributeSuccessionRequest, + NotifyPeerAboutRepositoryAttributeSuccessionRequest, OutgoingRequestStatusChangedEvent, OwnSharedAttributeSucceededEvent, PeerSharedAttributeSucceededEvent, RelationshipDTO, RelationshipStatus, RelationshipTemplateDTO, - ShareIdentityAttributeRequest, - SucceedIdentityAttributeRequest, - SucceedIdentityAttributeResponse, + ShareRepositoryAttributeRequest, + SucceedRepositoryAttributeRequest, + SucceedRepositoryAttributeResponse, SyncEverythingResponse, TokenDTO, TransportServices, @@ -392,19 +392,19 @@ export async function executeFullCreateAndShareRelationshipAttributeFlow( * * Returns the sender's own shared identity attribute. */ -export async function executeFullCreateAndShareIdentityAttributeFlow( +export async function executeFullCreateAndShareRepositoryAttributeFlow( sender: TestRuntimeServices, recipient: TestRuntimeServices, - request: CreateIdentityAttributeRequest + request: CreateRepositoryAttributeRequest ): Promise { - const createAttributeRequestResult = await sender.consumption.attributes.createIdentityAttribute(request); + const createAttributeRequestResult = await sender.consumption.attributes.createRepositoryAttribute(request); const attribute = createAttributeRequestResult.value; - const shareRequest: ShareIdentityAttributeRequest = { + const shareRequest: ShareRepositoryAttributeRequest = { attributeId: attribute.id, peer: recipient.address }; - const shareRequestResult = await sender.consumption.attributes.shareIdentityAttribute(shareRequest); + const shareRequestResult = await sender.consumption.attributes.shareRepositoryAttribute(shareRequest); const shareRequestId = shareRequestResult.value.id; await syncUntilHasMessageWithRequest(recipient.transport, shareRequestId); @@ -429,19 +429,19 @@ export async function executeFullCreateAndShareIdentityAttributeFlow( * * Returns the sender's own shared predecessor and successor identity attribute. */ -export async function executeFullSucceedIdentityAttributeAndNotifyPeerFlow( +export async function executeFullSucceedRepositoryAttributeAndNotifyPeerFlow( sender: TestRuntimeServices, recipient: TestRuntimeServices, - request: SucceedIdentityAttributeRequest -): Promise { - const succeedAttributeRequestResult = await sender.consumption.attributes.succeedIdentityAttribute(request); + request: SucceedRepositoryAttributeRequest +): Promise { + const succeedAttributeRequestResult = await sender.consumption.attributes.succeedRepositoryAttribute(request); const repositorySuccessor = succeedAttributeRequestResult.value.successor; - const notifyRequest: NotifyPeerAboutIdentityAttributeSuccessionRequest = { + const notifyRequest: NotifyPeerAboutRepositoryAttributeSuccessionRequest = { attributeId: repositorySuccessor.id, peer: recipient.address }; - const notifyRequestResult = await sender.consumption.attributes.notifyPeerAboutIdentityAttributeSuccession(notifyRequest); + const notifyRequestResult = await sender.consumption.attributes.notifyPeerAboutRepositoryAttributeSuccession(notifyRequest); const notificationId = notifyRequestResult.value.notificationId; await syncUntilHasMessageWithNotification(recipient.transport, notificationId); @@ -454,7 +454,7 @@ export async function executeFullSucceedIdentityAttributeAndNotifyPeerFlow( return e.data.successor.id === notifyRequestResult.value.successor.id; }); - const senderOwnSharedIdentityAttributes: SucceedIdentityAttributeResponse = { + const senderOwnSharedIdentityAttributes: SucceedRepositoryAttributeResponse = { predecessor: notifyRequestResult.value.predecessor, successor: notifyRequestResult.value.successor }; diff --git a/packages/runtime/test/modules/AttributeListenerModule.test.ts b/packages/runtime/test/modules/AttributeListenerModule.test.ts index fab84b513..ae98376ed 100644 --- a/packages/runtime/test/modules/AttributeListenerModule.test.ts +++ b/packages/runtime/test/modules/AttributeListenerModule.test.ts @@ -1,6 +1,6 @@ import { IdentityAttributeJSON, RelationshipAttributeConfidentiality, RelationshipAttributeJSON, ShareAttributeRequestItemJSON } from "@nmshd/content"; import { AttributeListenerCreatedEvent, OutgoingRequestCreatedEvent } from "../../src"; -import { RuntimeServiceProvider, TestRuntimeServices, ensureActiveRelationship, exchangeAndAcceptRequestByMessage } from "../lib"; +import { ensureActiveRelationship, exchangeAndAcceptRequestByMessage, RuntimeServiceProvider, TestRuntimeServices } from "../lib"; const runtimeServiceProvider = new RuntimeServiceProvider(); let sender: TestRuntimeServices; @@ -63,7 +63,7 @@ describe("AttributeListenerModule", () => { value: { "@type": "GivenName", value: "John" } }; - await recipient.consumption.attributes.createIdentityAttribute({ content: { value: attributeContent.value } }); + await recipient.consumption.attributes.createRepositoryAttribute({ content: { value: attributeContent.value } }); await expect(recipient.eventBus).toHavePublished(OutgoingRequestCreatedEvent); expectShareAttributeRequestItemWith(attributeContent); diff --git a/packages/runtime/test/modules/DeciderModule.test.ts b/packages/runtime/test/modules/DeciderModule.test.ts index 2966a8f4c..3fcdc29fb 100644 --- a/packages/runtime/test/modules/DeciderModule.test.ts +++ b/packages/runtime/test/modules/DeciderModule.test.ts @@ -10,7 +10,7 @@ import { RelationshipTemplateProcessedResult, TransportServices } from "../../src"; -import { MockEventBus, RuntimeServiceProvider, TestRequestItem, establishRelationship, exchangeMessage } from "../lib"; +import { establishRelationship, exchangeMessage, MockEventBus, RuntimeServiceProvider, TestRequestItem } from "../lib"; const runtimeServiceProvider = new RuntimeServiceProvider(); let sTransportServices: TransportServices; diff --git a/packages/runtime/test/modules/NotificationModule.test.ts b/packages/runtime/test/modules/NotificationModule.test.ts index cdb338e6b..cd9f441c8 100644 --- a/packages/runtime/test/modules/NotificationModule.test.ts +++ b/packages/runtime/test/modules/NotificationModule.test.ts @@ -2,7 +2,7 @@ import { ConsumptionIds, LocalNotificationStatus } from "@nmshd/consumption"; import { Notification } from "@nmshd/content"; import { CoreId } from "@nmshd/transport"; import { ConsumptionServices, TransportServices } from "../../src"; -import { MockEventBus, RuntimeServiceProvider, TestNotificationItem, TestNotificationItemProcessor, establishRelationship, syncUntilHasMessages } from "../lib"; +import { establishRelationship, MockEventBus, RuntimeServiceProvider, syncUntilHasMessages, TestNotificationItem, TestNotificationItemProcessor } from "../lib"; const runtimeServiceProvider = new RuntimeServiceProvider(); let sTransportServices: TransportServices; diff --git a/packages/runtime/test/modules/RequestModule.test.ts b/packages/runtime/test/modules/RequestModule.test.ts index cfc64ed2a..758fc3105 100644 --- a/packages/runtime/test/modules/RequestModule.test.ts +++ b/packages/runtime/test/modules/RequestModule.test.ts @@ -23,7 +23,7 @@ import { RelationshipTemplateProcessedResult, TransportServices } from "../../src"; -import { MockEventBus, RuntimeServiceProvider, ensureActiveRelationship, exchangeTemplate, sendMessage, syncUntilHasMessages, syncUntilHasRelationships } from "../lib"; +import { ensureActiveRelationship, exchangeTemplate, MockEventBus, RuntimeServiceProvider, sendMessage, syncUntilHasMessages, syncUntilHasRelationships } from "../lib"; const runtimeServiceProvider = new RuntimeServiceProvider(); let sTransportServices: TransportServices; diff --git a/packages/runtime/test/transport/relationships.test.ts b/packages/runtime/test/transport/relationships.test.ts index dc32e5a63..57f4424f6 100644 --- a/packages/runtime/test/transport/relationships.test.ts +++ b/packages/runtime/test/transport/relationships.test.ts @@ -1,17 +1,17 @@ import { RelationshipAttributeConfidentiality } from "@nmshd/content"; import { GetRelationshipsQuery, LocalAttributeDTO, OwnSharedAttributeSucceededEvent, PeerSharedAttributeSucceededEvent } from "../../src"; import { - QueryParamConditions, - RuntimeServiceProvider, - TestRuntimeServices, createTemplate, ensureActiveRelationship, - executeFullCreateAndShareIdentityAttributeFlow, executeFullCreateAndShareRelationshipAttributeFlow, - executeFullSucceedIdentityAttributeAndNotifyPeerFlow, + executeFullCreateAndShareRepositoryAttributeFlow, + executeFullSucceedRepositoryAttributeAndNotifyPeerFlow, getRelationship, + QueryParamConditions, + RuntimeServiceProvider, syncUntilHasMessageWithNotification, - syncUntilHasRelationships + syncUntilHasRelationships, + TestRuntimeServices } from "../lib"; const serviceProvider = new RuntimeServiceProvider(); @@ -138,7 +138,7 @@ describe("Attributes for the relationship", () => { relationshipId = relationship.id; // create own shared attributes - ownSharedIdentityAttributeV0 = await executeFullCreateAndShareIdentityAttributeFlow(services1, services2, { + ownSharedIdentityAttributeV0 = await executeFullCreateAndShareRepositoryAttributeFlow(services1, services2, { content: { value: { "@type": "GivenName", @@ -148,15 +148,19 @@ describe("Attributes for the relationship", () => { }); const repositoryAttributeIdV0 = ownSharedIdentityAttributeV0.shareInfo!.sourceAttribute!; - ({ predecessor: ownSharedIdentityAttributeV0, successor: ownSharedIdentityAttributeV1 } = await executeFullSucceedIdentityAttributeAndNotifyPeerFlow(services1, services2, { - predecessorId: repositoryAttributeIdV0, - successorContent: { - value: { - "@type": "GivenName", - value: "New own name" + ({ predecessor: ownSharedIdentityAttributeV0, successor: ownSharedIdentityAttributeV1 } = await executeFullSucceedRepositoryAttributeAndNotifyPeerFlow( + services1, + services2, + { + predecessorId: repositoryAttributeIdV0, + successorContent: { + value: { + "@type": "GivenName", + value: "New own name" + } } } - })); + )); ownSharedRelationshipAttributeV0 = await executeFullCreateAndShareRelationshipAttributeFlow(services1, services2, { content: { @@ -195,7 +199,7 @@ describe("Attributes for the relationship", () => { }); // create peer shared attributes - peerSharedIdentityAttributeV0 = await executeFullCreateAndShareIdentityAttributeFlow(services2, services1, { + peerSharedIdentityAttributeV0 = await executeFullCreateAndShareRepositoryAttributeFlow(services2, services1, { content: { value: { "@type": "GivenName", @@ -205,7 +209,7 @@ describe("Attributes for the relationship", () => { }); const peerRepositoryAttributeIdV0 = peerSharedIdentityAttributeV0.shareInfo!.sourceAttribute!; - ({ predecessor: peerSharedIdentityAttributeV0, successor: peerSharedIdentityAttributeV1 } = await executeFullSucceedIdentityAttributeAndNotifyPeerFlow( + ({ predecessor: peerSharedIdentityAttributeV0, successor: peerSharedIdentityAttributeV1 } = await executeFullSucceedRepositoryAttributeAndNotifyPeerFlow( services2, services1, { diff --git a/packages/runtime/test/transport/tokens.test.ts b/packages/runtime/test/transport/tokens.test.ts index 9ebd3ed79..bd27322aa 100644 --- a/packages/runtime/test/transport/tokens.test.ts +++ b/packages/runtime/test/transport/tokens.test.ts @@ -1,6 +1,6 @@ import { CoreDate } from "@nmshd/transport"; import { GetTokensQuery, OwnerRestriction, TransportServices } from "../../src"; -import { QueryParamConditions, RuntimeServiceProvider, exchangeToken, uploadOwnToken } from "../lib"; +import { exchangeToken, QueryParamConditions, RuntimeServiceProvider, uploadOwnToken } from "../lib"; const serviceProvider = new RuntimeServiceProvider(); let transportServices1: TransportServices;