diff --git a/CHANGELOG.md b/CHANGELOG.md index 87adebff..fd7b8c7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 3.7.2 + +-> SDK 4.0.0 + +- upgrade the runtime version to 4.0.0 + ## 3.7.1 - upgrade the runtime version to 3.7.0 diff --git a/package-lock.json b/package-lock.json index eeb6e8a1..afa94aa0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@nmshd/connector", - "version": "3.7.1", + "version": "3.7.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@nmshd/connector", - "version": "3.7.1", + "version": "3.7.2", "license": "MIT", "workspaces": [ ".", @@ -18,7 +18,7 @@ "@js-soft/node-logger": "1.1.1", "@js-soft/ts-utils": "^2.3.3", "@nmshd/iql": "^1.0.1", - "@nmshd/runtime": "3.7.0", + "@nmshd/runtime": "4.0.0", "agentkeepalive": "4.5.0", "amqplib": "^0.10.3", "axios": "^1.6.7", @@ -1612,9 +1612,9 @@ "license": "MIT" }, "node_modules/@nmshd/runtime": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/@nmshd/runtime/-/runtime-3.7.0.tgz", - "integrity": "sha512-yJ1GaLSdb5JWW6QJaV8qQCvaTcYJQt7CqSxtuGON8E8nrJ3jo1OfErr6j7cVHQgUbnEgaq+nyYg+GcVcN7XX3Q==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@nmshd/runtime/-/runtime-4.0.0.tgz", + "integrity": "sha512-u5Ln0TuVrny32dHdi1Wc7ENgXC3Ygh4nCGPnafXnDdK+fzCJoSBzoUzG0WeOemuaaCYdCnj+USSVnuFrO7nT2A==", "dependencies": { "@js-soft/docdb-querytranslator": "^1.1.2", "@js-soft/logging-abstractions": "^1.0.1", @@ -9950,7 +9950,7 @@ }, "packages/sdk": { "name": "@nmshd/connector-sdk", - "version": "3.0.0", + "version": "4.0.0", "license": "MIT", "dependencies": { "axios": "^1.6.7", diff --git a/package.json b/package.json index 2bcede3b..14688d75 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nmshd/connector", - "version": "3.7.1", + "version": "3.7.2", "private": true, "description": "The Enmeshed Connector", "homepage": "https://enmeshed.eu/integrate", @@ -65,7 +65,7 @@ "@js-soft/node-logger": "1.1.1", "@js-soft/ts-utils": "^2.3.3", "@nmshd/iql": "^1.0.1", - "@nmshd/runtime": "3.7.0", + "@nmshd/runtime": "4.0.0", "agentkeepalive": "4.5.0", "amqplib": "^0.10.3", "axios": "^1.6.7", diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 38a40533..07fe9108 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@nmshd/connector-sdk", - "version": "3.0.0", + "version": "4.0.0", "description": "the enmeshed connector sdk", "keywords": [ "enmeshed", diff --git a/packages/sdk/src/endpoints/AttributesEndpoint.ts b/packages/sdk/src/endpoints/AttributesEndpoint.ts index 65675f04..897b0b8f 100644 --- a/packages/sdk/src/endpoints/AttributesEndpoint.ts +++ b/packages/sdk/src/endpoints/AttributesEndpoint.ts @@ -9,8 +9,8 @@ import { ExecuteThirdPartyRelationshipAttributeQueryRequest, GetAttributesRequest, GetValidAttributesRequest, - NotifyPeerAboutIdentityAttributeSuccessionRequest, - NotifyPeerAboutIdentityAttributeSuccessionResponse, + NotifyPeerAboutRepositoryAttributeSuccessionRequest, + NotifyPeerAboutRepositoryAttributeSuccessionResponse, SucceedAttributeRequest, SucceedAttributeResponse } from "../types"; @@ -25,10 +25,10 @@ export class AttributesEndpoint extends Endpoint { return await this.post(`/api/v2/Attributes/${predecessorId}/Succeed`, request); } - public async notifyPeerAboutIdentityAttributeSuccession( + public async notifyPeerAboutRepositoryAttributeSuccession( attributeId: string, - request: NotifyPeerAboutIdentityAttributeSuccessionRequest - ): Promise> { + request: NotifyPeerAboutRepositoryAttributeSuccessionRequest + ): Promise> { return await this.post(`/api/v2/Attributes/${attributeId}/NotifyPeer`, request); } diff --git a/packages/sdk/src/types/attributes/index.ts b/packages/sdk/src/types/attributes/index.ts index c2a1d9d7..57aec1a3 100644 --- a/packages/sdk/src/types/attributes/index.ts +++ b/packages/sdk/src/types/attributes/index.ts @@ -11,7 +11,7 @@ export * from "./requests/ExecuteRelationshipAttributeQueryRequest"; export * from "./requests/ExecuteThirdPartyRelationshipAttributeQueryRequest"; export * from "./requests/GetAttributesRequest"; export * from "./requests/GetValidAttributesRequest"; -export * from "./requests/NotifyPeerAboutIdentityAttributeSuccessionRequest"; -export * from "./requests/NotifyPeerAboutIdentityAttributeSuccessionResponse"; +export * from "./requests/NotifyPeerAboutRepositoryAttributeSuccessionRequest"; +export * from "./requests/NotifyPeerAboutRepositoryAttributeSuccessionResponse"; export * from "./requests/SucceedAttributeRequest"; export * from "./requests/SucceedAttributeResponse"; diff --git a/packages/sdk/src/types/attributes/requests/NotifyPeerAboutIdentityAttributeSuccessionRequest.ts b/packages/sdk/src/types/attributes/requests/NotifyPeerAboutIdentityAttributeSuccessionRequest.ts deleted file mode 100644 index 282b355f..00000000 --- a/packages/sdk/src/types/attributes/requests/NotifyPeerAboutIdentityAttributeSuccessionRequest.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface NotifyPeerAboutIdentityAttributeSuccessionRequest { - peer: string; -} diff --git a/packages/sdk/src/types/attributes/requests/NotifyPeerAboutRepositoryAttributeSuccessionRequest.ts b/packages/sdk/src/types/attributes/requests/NotifyPeerAboutRepositoryAttributeSuccessionRequest.ts new file mode 100644 index 00000000..6b949eb2 --- /dev/null +++ b/packages/sdk/src/types/attributes/requests/NotifyPeerAboutRepositoryAttributeSuccessionRequest.ts @@ -0,0 +1,3 @@ +export interface NotifyPeerAboutRepositoryAttributeSuccessionRequest { + peer: string; +} diff --git a/packages/sdk/src/types/attributes/requests/NotifyPeerAboutIdentityAttributeSuccessionResponse.ts b/packages/sdk/src/types/attributes/requests/NotifyPeerAboutRepositoryAttributeSuccessionResponse.ts similarity index 69% rename from packages/sdk/src/types/attributes/requests/NotifyPeerAboutIdentityAttributeSuccessionResponse.ts rename to packages/sdk/src/types/attributes/requests/NotifyPeerAboutRepositoryAttributeSuccessionResponse.ts index 1705e6ad..08ae750a 100644 --- a/packages/sdk/src/types/attributes/requests/NotifyPeerAboutIdentityAttributeSuccessionResponse.ts +++ b/packages/sdk/src/types/attributes/requests/NotifyPeerAboutRepositoryAttributeSuccessionResponse.ts @@ -1,6 +1,6 @@ import { ConnectorAttribute } from "../ConnectorAttribute"; -export interface NotifyPeerAboutIdentityAttributeSuccessionResponse { +export interface NotifyPeerAboutRepositoryAttributeSuccessionResponse { predecessor: ConnectorAttribute; successor: ConnectorAttribute; notificationId: string; diff --git a/src/modules/coreHttpApi/controllers/AttributesController.ts b/src/modules/coreHttpApi/controllers/AttributesController.ts index e3187992..5ecbba51 100644 --- a/src/modules/coreHttpApi/controllers/AttributesController.ts +++ b/src/modules/coreHttpApi/controllers/AttributesController.ts @@ -30,7 +30,7 @@ export class AttributesController extends BaseController { if (typeof request?.content?.owner !== "undefined") delete request.content.owner; if (request?.content?.["@type"] === "IdentityAttribute") delete request.content["@type"]; - const result = await this.consumptionServices.attributes.createIdentityAttribute(request); + const result = await this.consumptionServices.attributes.createRepositoryAttribute(request); return this.created(result); } @@ -45,7 +45,7 @@ export class AttributesController extends BaseController { const predecessor = result.value; if (predecessor.content["@type"] === "IdentityAttribute") { - const result = await this.consumptionServices.attributes.succeedIdentityAttribute({ + const result = await this.consumptionServices.attributes.succeedRepositoryAttribute({ predecessorId: predecessorId, ...request }); @@ -62,8 +62,8 @@ export class AttributesController extends BaseController { @POST @Path("/:attributeId/NotifyPeer") @Accept("application/json") - public async notifyPeerAboutIdentityAttributeSuccession(@PathParam("attributeId") attributeId: string, request: any): Promise> { - const result = await this.consumptionServices.attributes.notifyPeerAboutIdentityAttributeSuccession({ attributeId: attributeId, peer: request.peer }); + public async notifyPeerAboutRepositoryAttributeSuccession(@PathParam("attributeId") attributeId: string, request: any): Promise> { + const result = await this.consumptionServices.attributes.notifyPeerAboutRepositoryAttributeSuccession({ attributeId: attributeId, peer: request.peer }); return this.created(result); } diff --git a/src/modules/coreHttpApi/openapi.yml b/src/modules/coreHttpApi/openapi.yml index 4ded569b..fc335165 100644 --- a/src/modules/coreHttpApi/openapi.yml +++ b/src/modules/coreHttpApi/openapi.yml @@ -544,7 +544,7 @@ paths: responses: 201: description: | - "Success. Returns the successor and predecessor own shared repository + "Success. Returns the successor and predecessor own shared identity attributes as well as the ID of the notification sent to the peer." content: application/json: diff --git a/test/attributes.test.ts b/test/attributes.test.ts index 7bf28c0b..408fa3c4 100644 --- a/test/attributes.test.ts +++ b/test/attributes.test.ts @@ -4,8 +4,8 @@ import { QueryParamConditions } from "./lib/QueryParamConditions"; import { createRepositoryAttribute, establishRelationship, - executeFullCreateAndShareIdentityAttributeFlow, executeFullCreateAndShareRelationshipAttributeFlow, + executeFullCreateAndShareRepositoryAttributeFlow, syncUntilHasMessageWithNotification, syncUntilHasMessages } from "./lib/testUtils"; @@ -98,7 +98,7 @@ describe("Attributes", () => { }); test("Should notify peer about Repository Attribute Succession", async () => { - const ownSharedRepositoryAttribute = await executeFullCreateAndShareIdentityAttributeFlow(client1, client2, { + const ownSharedIdentityAttribute = await executeFullCreateAndShareRepositoryAttributeFlow(client1, client2, { "@type": "IdentityAttribute", owner: client1Address, value: { @@ -107,9 +107,9 @@ describe("Attributes", () => { } }); - expect(ownSharedRepositoryAttribute.shareInfo?.sourceAttribute).toBeDefined(); + expect(ownSharedIdentityAttribute.shareInfo?.sourceAttribute).toBeDefined(); - const ownUnsharedRepositoryAttribute = await client1.attributes.getAttribute(ownSharedRepositoryAttribute.shareInfo!.sourceAttribute!); + const ownUnsharedRepositoryAttribute = await client1.attributes.getAttribute(ownSharedIdentityAttribute.shareInfo!.sourceAttribute!); const successionResponse = await client1.attributes.succeedAttribute(ownUnsharedRepositoryAttribute.result.id, { successorContent: { @@ -120,7 +120,7 @@ describe("Attributes", () => { } }); expect(successionResponse.isSuccess).toBe(true); - const notificationResponse = await client1.attributes.notifyPeerAboutIdentityAttributeSuccession(successionResponse.result.successor.id, { + const notificationResponse = await client1.attributes.notifyPeerAboutRepositoryAttributeSuccession(successionResponse.result.successor.id, { peer: client2Address }); expect(notificationResponse.isSuccess).toBe(true); diff --git a/test/lib/testUtils.ts b/test/lib/testUtils.ts index 339eb85b..f5f07671 100644 --- a/test/lib/testUtils.ts +++ b/test/lib/testUtils.ts @@ -314,7 +314,7 @@ export async function executeFullCreateAndShareRelationshipAttributeFlow( * * Returns the sender's own shared identity attribute. */ -export async function executeFullCreateAndShareIdentityAttributeFlow( +export async function executeFullCreateAndShareRepositoryAttributeFlow( sender: ConnectorClient, recipient: ConnectorClient, attributeContent: ConnectorIdentityAttribute