Skip to content

Commit

Permalink
Chore(deps): bump the update-runtime group across 2 directories with …
Browse files Browse the repository at this point in the history
…3 updates (#326)
  • Loading branch information
dependabot[bot] authored Dec 10, 2024
1 parent bb1852e commit 6c7eb6b
Show file tree
Hide file tree
Showing 10 changed files with 141 additions and 50 deletions.
78 changes: 32 additions & 46 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"@js-soft/docdb-access-mongo": "1.1.9",
"@js-soft/node-logger": "1.2.0",
"@js-soft/ts-utils": "^2.3.3",
"@nmshd/runtime": "6.10.0",
"@nmshd/runtime": "6.13.0",
"@nmshd/typescript-ioc": "^3.2.4",
"@nmshd/typescript-rest": "^3.0.5",
"agentkeepalive": "4.5.0",
Expand Down Expand Up @@ -113,8 +113,8 @@
"@js-soft/eslint-config-ts": "1.6.13",
"@js-soft/license-check": "1.0.9",
"@nmshd/connector-sdk": "*",
"@nmshd/content": "6.10.0",
"@nmshd/core-types": "6.10.0",
"@nmshd/content": "6.13.0",
"@nmshd/core-types": "6.13.0",
"@nmshd/typescript-rest-swagger": "^1.4.1",
"@types/amqplib": "^0.10.6",
"@types/compression": "^1.7.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"build:schemas:watch": "npx nodemon -e ts -w 'src/types' --exec 'npm run build:schemas'"
},
"dependencies": {
"@nmshd/content": "6.10.0",
"@nmshd/content": "6.13.0",
"axios": "^1.7.9",
"form-data": "^4.0.1",
"qs": "^6.13.1"
Expand Down
5 changes: 5 additions & 0 deletions packages/sdk/src/endpoints/AttributesEndpoint.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
ConnectorAttribute,
ConnectorAttributeTagCollection,
ConnectorAttributes,
ConnectorHttpResponse,
CreateRepositoryAttributeRequest,
Expand Down Expand Up @@ -51,6 +52,10 @@ export class AttributesEndpoint extends Endpoint {
return await this.get("/api/v2/Attributes/Valid", request);
}

public async getAttributeTagCollection(): Promise<ConnectorHttpResponse<ConnectorAttributeTagCollection>> {
return await this.get("/api/v2/Attributes/TagCollection");
}

public async getOwnRepositoryAttributes(request?: GetOwnRepositoryAttributesRequest): Promise<ConnectorHttpResponse<ConnectorAttributes>> {
return await this.get("/api/v2/Attributes/Own/Repository", request);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export interface ConnectorAttributeTagCollection {
supportedLanguages: string[];
tagsForAttributeValueTypes: Record<string, Record<string, ConnectorAttributeTag>>;
}

export interface ConnectorAttributeTag {
displayNames: Record<string, string>;
children?: Record<string, ConnectorAttributeTag>;
}
1 change: 1 addition & 0 deletions packages/sdk/src/types/attributes/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export * from "./ConnectorAttribute";
export * from "./ConnectorAttributes";
export * from "./ConnectorAttributeTagCollection";
export * from "./IdentityAttributeQuery";
export * from "./IQLQuery";
export * from "./RelationshipAttributeQuery";
Expand Down
8 changes: 8 additions & 0 deletions src/modules/coreHttpApi/controllers/AttributesController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,14 @@ export class AttributesController extends BaseController {
return this.ok(result);
}

@GET
@Path("/TagCollection")
@Accept("application/json")
public async getAttributeTagCollection(): Promise<Envelope> {
const result = await this.consumptionServices.attributes.getAttributeTagCollection();
return this.ok(result);
}

@POST
@Path("/ExecuteIdentityAttributeQuery")
@Accept("application/json")
Expand Down
74 changes: 74 additions & 0 deletions src/modules/coreHttpApi/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1268,6 +1268,38 @@ paths:
403:
$ref: "#/components/responses/Forbidden"

/api/v2/Attributes/TagCollection:
get:
operationId: getAttributeTagCollection
description: List valid Tags for Attributes
tags:
- Attributes
responses:
200:
description: Success
content:
application/json:
schema:
type: object
properties:
result:
type: array
items:
$ref: "#/components/schemas/AttributeTagCollection"
required:
- result
headers:
X-Response-Duration-ms:
schema:
$ref: "#/components/schemas/HeaderContent_X-Response-Duration-ms"
X-Response-Time:
schema:
$ref: "#/components/schemas/HeaderContent_X-Response-Time"
401:
$ref: "#/components/responses/Unauthorized"
403:
$ref: "#/components/responses/Forbidden"

/api/v2/Attributes/ExecuteIdentityAttributeQuery:
post:
operationId: executeIdentityQuery
Expand Down Expand Up @@ -4875,6 +4907,48 @@ components:
required:
- "@type"

AttributeTagCollection:
type: object
additionalProperties: false
properties:
supportedLanguages:
type: array
items:
type: string
example: ["en", "de"]
tagsForAttributeValueTypes:
type: object
additionalProperties:
type: object
additionalProperties:
"$ref": "#/components/schemas/AttributeTag"
example:
PhoneNumber:
emergency:
displayNames: { de: "Notfallkontakt", en: "Emergency Contact" }
children:
first: { displayNames: { de: "Erster Notfallkontakt", en: "First Emergency Contact" } }
second: { displayNames: { de: "Zweiter Notfallkontakt", en: "Second Emergency Contact" } }
private: { displayNames: { de: "Privat", en: "Private" } }
required:
- supportedLanguages
- tagsForAttributeValueTypes

AttributeTag:
type: object
additionalProperties: false
properties:
children:
additionalProperties:
"$ref": "#/components/schemas/AttributeTag"
type: object
displayNames:
additionalProperties:
type: string
type: object
required:
- displayNames

ConnectorHealth:
type: object
properties:
Expand Down
7 changes: 7 additions & 0 deletions test/attributes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -623,3 +623,10 @@ describe("Delete attributes", () => {
expect(client3DeletedAttribute.isError).toBe(true);
});
});

describe("Attributes Tag Collection", () => {
test("should get all valid tags", async () => {
const response = await client1.attributes.getAttributeTagCollection();
expect(response).toBeSuccessful(ValidationSchema.ConnectorAttributeTagCollection);
});
});
1 change: 1 addition & 0 deletions test/lib/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export enum ValidationSchema {
ConnectorRequests = "ConnectorRequests",
ConnectorAttribute = "ConnectorAttribute",
ConnectorAttributes = "ConnectorAttributes",
ConnectorAttributeTagCollection = "ConnectorAttributeTagCollection",
SucceedAttributeResponse = "SucceedAttributeResponse"
}

Expand Down

0 comments on commit 6c7eb6b

Please sign in to comment.