Skip to content

Commit

Permalink
wip review
Browse files Browse the repository at this point in the history
  • Loading branch information
J-Gann committed Dec 19, 2023
1 parent eeb5b34 commit 5a3018e
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 30 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 3.7.0

- add usecases for attribute succession
- refactor existing attribute use cases

## 3.6.2

- provenance sbom for the Docker Images
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nmshd/connector",
"version": "3.6.2",
"version": "3.7.2",
"private": true,
"description": "The Enmeshed Connector",
"homepage": "https://enmeshed.eu/integrate",
Expand Down
5 changes: 0 additions & 5 deletions packages/sdk/src/endpoints/AttributesEndpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
ConnectorRequest,
ConnectorResponse,
CreateAndShareRelationshipAttributeRequest,
CreateAttributeRequest,
CreateIdentityAttributeRequest,
ExecuteIQLQueryRequest,
ExecuteIdentityAttributeQueryRequest,
Expand All @@ -22,10 +21,6 @@ import {
import { Endpoint } from "./Endpoint";

export class AttributesEndpoint extends Endpoint {
public async createAttribute(request: CreateAttributeRequest): Promise<ConnectorResponse<ConnectorAttribute>> {
return await this.post("/api/v2/Attributes", request);
}

public async createIdentityAttribute(request: CreateIdentityAttributeRequest): Promise<ConnectorResponse<ConnectorAttribute>> {
return await this.post("/api/v2/Attributes/CreateIdentityAttribute", request);
}
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion packages/sdk/src/types/requests/ConnectorRequestContent.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IQLQuery, ThirdPartyAttributeQuery } from "../attributes";
import { ConnectorIdentityAttribute, ConnectorRelationshipAttribute } from "../attributes/ConnectorAttribute";
import { IdentityAttributeQuery } from "../attributes/IdentityAttributeQuery";
import { RelationshipAttributeQuery } from "../attributes/RelationshipAttributeQuery";
import { ConnectorIdentityAttribute, ConnectorRelationshipAttribute } from "../attributes/requests/ConnectorAttribute";

export interface ConnectorRequestContent {
"@type"?: string;
Expand Down
11 changes: 1 addition & 10 deletions test/attributes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,6 @@ describe("Execute AttributeQueries", () => {
const request = await client1.outgoingRequests.getRequest(createRequest.result.id);

expect(request.result.status).toBe("Completed");

// TODO: validate that shared attribute is correctly created on side of client 2
});
});

Expand All @@ -232,7 +230,6 @@ describe("Execute AttributeQueries", () => {

const result = await client1.attributes.shareIdentityAttribute({ attributeId: attribute.id, peer: client2Address });
expect(result.isSuccess).toBe(true);
// TODO: validate that shared attribute is correctly created on side of client 2
});
});

Expand Down Expand Up @@ -277,8 +274,6 @@ describe("Execute AttributeQueries", () => {
});

expect(notificationResult.isSuccess).toBe(true);

// TODO: validate succession on side of client 2
});
});

Expand Down Expand Up @@ -308,8 +303,6 @@ describe("Execute AttributeQueries", () => {
});

expect(succeedAttributeResponse.isSuccess).toBe(true);

// TODO: validate succession on side of client 2
});
});

Expand Down Expand Up @@ -338,7 +331,7 @@ describe("Execute AttributeQueries", () => {

expect(request.result.status).toBe("Completed");

const relationshipAttributeId = (message[0] as any).content.response.items[0].attributeId; // TODO: How to retrieve attribute id?
const relationshipAttributeId = (message[0] as any).content.response.items[0].attributeId;

const result = await client1.attributes.succeedRelationshipAttributeAndNotifyPeer({
predecessorId: relationshipAttributeId,
Expand All @@ -352,8 +345,6 @@ describe("Execute AttributeQueries", () => {
});

expect(result.isSuccess).toBe(true);

// TODO: validate succession on side of client 2
});
});
});
2 changes: 1 addition & 1 deletion test/lib/testUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export async function createIdentityAttribute(client: ConnectorClient, request:
return response.result;
}

export async function createRelationshipAttribute(client: ConnectorClient, request: CreateAndShareRelationshipAttributeRequest): Promise<ConnectorRequest> {
export async function createAndShareRelationshipAttribute(client: ConnectorClient, request: CreateAndShareRelationshipAttributeRequest): Promise<ConnectorRequest> {
const response = await client.attributes.createAndShareRelationshipAttribute(request);
expect(response).toBeSuccessful(ValidationSchema.ConnectorAttribute);
return response.result;
Expand Down

0 comments on commit 5a3018e

Please sign in to comment.