Skip to content

Release/v7 #457

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 23 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
4efb038
Switch the default QR code format to the new one and remove the old o…
jkoenig134 May 14, 2025
c80172e
Merge branch 'main' into release/v7
mergify[bot] May 14, 2025
ac5b6c6
Remove the file based changelog (#459)
jkoenig134 May 14, 2025
34631ee
Simplify QR code generation (#458)
jkoenig134 May 14, 2025
9b74d73
Upgrade Runtime to version `7.0.0-alpha.26` and adapt to changes (#460)
britsta May 14, 2025
9adf852
Merge branch 'main' into release/v7
mergify[bot] May 15, 2025
1a815fe
Merge branch 'main' into release/v7
mergify[bot] May 15, 2025
e69bfc5
Merge branch 'main' into release/v7
jkoenig134 May 15, 2025
aab4e4a
Merge branch 'main' into release/v7
mergify[bot] May 16, 2025
d2043c8
Merge branch 'main' into release/v7
mergify[bot] May 16, 2025
317b77c
Merge branch 'main' into release/v7
mergify[bot] May 17, 2025
3030afb
Merge branch 'main' into release/v7
jkoenig134 May 19, 2025
43fabce
Merge branch 'main' into release/v7
jkoenig134 May 20, 2025
7480e52
Merge branch 'main' into release/v7
mergify[bot] May 20, 2025
b3ace0f
Merge branch 'main' into release/v7
mergify[bot] May 20, 2025
9f9a9ea
Merge branch 'main' into release/v7
mergify[bot] May 20, 2025
1f09098
Merge branch 'main' into release/v7
jkoenig134 May 22, 2025
68c4f87
Merge branch 'main' into release/v7
mergify[bot] May 23, 2025
18c3c56
Merge branch 'main' into release/v7
mergify[bot] May 23, 2025
fb08d48
Merge branch 'main' into release/v7
mergify[bot] May 23, 2025
3a07164
Merge branch 'main' into release/v7
jkoenig134 May 23, 2025
0326d29
Merge branch 'main' into release/v7
jkoenig134 May 23, 2025
7182aa9
Merge branch 'main' into release/v7
mergify[bot] May 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
635 changes: 0 additions & 635 deletions CHANGELOG.md

This file was deleted.

2,061 changes: 29 additions & 2,032 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"@js-soft/node-logger": "1.2.0",
"@js-soft/ts-utils": "^2.3.3",
"@nmshd/connector-types": "*",
"@nmshd/runtime": "6.50.0",
"@nmshd/runtime": "7.0.0-alpha.34",
"@nmshd/typescript-ioc": "^3.2.4",
"@nmshd/typescript-rest": "^3.1.4",
"agentkeepalive": "4.6.0",
Expand Down Expand Up @@ -114,8 +114,8 @@
"@js-soft/eslint-config-ts": "1.6.14",
"@js-soft/license-check": "1.0.9",
"@nmshd/connector-sdk": "*",
"@nmshd/content": "6.50.0",
"@nmshd/core-types": "6.50.0",
"@nmshd/content": "7.0.0-alpha.34",
"@nmshd/core-types": "7.0.0-alpha.34",
"@nmshd/typescript-rest-swagger": "^1.4.2",
"@types/amqplib": "^0.10.7",
"@types/compression": "^1.8.0",
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.50.0",
"@nmshd/content": "7.0.0-alpha.34",
"axios": "^1.9.0",
"form-data": "^4.0.2",
"qs": "^6.14.0"
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 @@ -18,7 +18,6 @@ import {
GetOwnSharedIdentityAttributesRequest,
GetPeerSharedIdentityAttributesRequest,
GetSharedVersionsOfAttributeRequest,
GetValidAttributesRequest,
NotifyPeerAboutRepositoryAttributeSuccessionRequest,
NotifyPeerAboutRepositoryAttributeSuccessionResponse,
SucceedAttributeRequest,
Expand Down Expand Up @@ -54,10 +53,6 @@ export class AttributesEndpoint extends Endpoint {
return await this.get(`/api/v2/Attributes/${attributeId}`);
}

public async getValidAttributes(request: GetValidAttributesRequest): Promise<ConnectorHttpResponse<ConnectorAttributes>> {
return await this.get("/api/v2/Attributes/Valid", request);
}

public async getAttributeTagCollection(): Promise<ConnectorHttpResponse<ConnectorAttributeTagCollection>> {
return await this.get("/api/v2/Attributes/TagCollection");
}
Expand Down
4 changes: 2 additions & 2 deletions packages/sdk/src/endpoints/FilesEndpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export class FilesEndpoint extends Endpoint {
return await this.download(`/api/v2/Files/${fileId}/Download`);
}

public async getQrCodeForFile(fileId: string, newQRCodeFormat?: boolean): Promise<ConnectorHttpResponse<ArrayBuffer>> {
return await this.downloadQrCode("GET", `/api/v2/Files/${fileId}`, { newQRCodeFormat: newQRCodeFormat ? "true" : undefined });
public async getQrCodeForFile(fileId: string): Promise<ConnectorHttpResponse<ArrayBuffer>> {
return await this.downloadQrCode("GET", `/api/v2/Files/${fileId}`);
}

public async createTokenForFile(fileId: string, request?: CreateTokenForFileRequest): Promise<ConnectorHttpResponse<ConnectorToken>> {
Expand Down
4 changes: 2 additions & 2 deletions packages/sdk/src/endpoints/RelationshipTemplatesEndpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ export class RelationshipTemplatesEndpoint extends Endpoint {
return await this.post("/api/v2/RelationshipTemplates/Own", request);
}

public async getQrCodeForOwnRelationshipTemplate(id: string, newQRCodeFormat?: boolean): Promise<ConnectorHttpResponse<ArrayBuffer>> {
return await this.downloadQrCode("GET", `/api/v2/RelationshipTemplates/${id}`, { newQRCodeFormat: newQRCodeFormat ? "true" : undefined });
public async getQrCodeForOwnRelationshipTemplate(id: string): Promise<ConnectorHttpResponse<ArrayBuffer>> {
return await this.downloadQrCode("GET", `/api/v2/RelationshipTemplates/${id}`);
}

public async createTokenForOwnRelationshipTemplate(id: string, request?: CreateTokenForOwnRelationshipTemplateRequest): Promise<ConnectorHttpResponse<ConnectorToken>> {
Expand Down
4 changes: 2 additions & 2 deletions packages/sdk/src/endpoints/TokensEndpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export class TokensEndpoint extends Endpoint {
return await this.get(`/api/v2/Tokens/${tokenId}`);
}

public async getQrCodeForToken(tokenId: string, newQRCodeFormat?: boolean): Promise<ConnectorHttpResponse<ArrayBuffer>> {
return await this.downloadQrCode("GET", `/api/v2/Tokens/${tokenId}`, { newQRCodeFormat: newQRCodeFormat ? "true" : undefined });
public async getQrCodeForToken(tokenId: string): Promise<ConnectorHttpResponse<ArrayBuffer>> {
return await this.downloadQrCode("GET", `/api/v2/Tokens/${tokenId}`);
}

public async getOwnTokens(request?: GetOwnTokensRequest): Promise<ConnectorHttpResponse<ConnectorTokens>> {
Expand Down
2 changes: 0 additions & 2 deletions packages/sdk/src/types/attributes/IQLQuery.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
export interface IQLQuery {
"@type": "IQLQuery";
queryString: string;
validFrom?: string;
validTo?: string;
attributeCreationHints?: {
valueType: string;
tags?: string[];
Expand Down
2 changes: 0 additions & 2 deletions packages/sdk/src/types/attributes/IdentityAttributeQuery.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
export interface IdentityAttributeQuery {
"@type"?: "IdentityAttributeQuery";
valueType: string;
validFrom?: string;
validTo?: string;
tags?: string[];
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
export interface RelationshipAttributeQuery {
"@type"?: "RelationshipAttributeQuery";
validFrom?: string;
validTo?: string;
key: string;
owner: string;
attributeCreationHints: RelationshipAttributeCreationHints;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ export interface ThirdPartyRelationshipAttributeQuery {
key: string;
owner: string;
thirdParty: string[];
validFrom?: string;
validTo?: string;
}
1 change: 0 additions & 1 deletion packages/sdk/src/types/attributes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export * from "./requests/GetOwnRepositoryAttributesRequest";
export * from "./requests/GetOwnSharedIdentityAttributesRequest";
export * from "./requests/GetPeerSharedIdentityAttributesRequest";
export * from "./requests/GetSharedVersionsOfAttributeRequest";
export * from "./requests/GetValidAttributesRequest";
export * from "./requests/NotifyPeerAboutRepositoryAttributeSuccessionRequest";
export * from "./requests/NotifyPeerAboutRepositoryAttributeSuccessionResponse";
export * from "./requests/SucceedAttributeRequest";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ export interface CanCreateRepositoryAttributeRequest {
content: {
value: AttributeValues.Identity.Json;
tags?: string[];
validFrom?: string;
validTo?: string;
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ export interface CreateRepositoryAttributeRequest {
content: {
value: AttributeValues.Identity.Json;
tags?: string[];
validFrom?: string;
validTo?: string;
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ export interface GetAttributesRequest {
"@type"?: string;
tags?: string[];
owner?: string;
validFrom?: string;
validTo?: string;
key?: string;
isTechnical?: string;
confidentiality?: "public" | "private" | "protected";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@ export interface GetOwnRepositoryAttributesRequest {
onlyLatestVersions?: boolean;
createdAt?: string;
"content.tags"?: string | string[];
"content.validFrom"?: string | string[];
"content.validTo"?: string | string[];
"content.value.@type"?: string | string[];
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
export interface GetOwnSharedIdentityAttributesRequest {
peer: string;
onlyValid?: boolean;
createdAt?: string;
"content.@type"?: string | string[];
"content.tags"?: string | string[];
"content.validFrom"?: string | string[];
"content.validTo"?: string | string[];
"content.key"?: string | string[];
"content.isTechnical"?: string | string[];
"content.confidentiality"?: string | string[];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
export interface GetPeerSharedIdentityAttributesRequest {
peer: string;
onlyValid?: boolean;
createdAt?: string;
"content.@type"?: string | string[];
"content.tags"?: string | string[];
"content.validFrom"?: string | string[];
"content.validTo"?: string | string[];
"content.key"?: string | string[];
"content.isTechnical"?: string | string[];
"content.confidentiality"?: string | string[];
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ export interface SucceedAttributeRequest {
successorContent: {
value: AttributeValues.Identity.Json | AttributeValues.Relationship.Json;
tags?: string[];
validFrom?: string;
validTo?: string;
};
}
3 changes: 1 addition & 2 deletions packages/sdk/src/types/files/ConnectorFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ export interface ConnectorFile {
createdByDevice: string;
expiresAt: string;
mimetype: string;
title: string;
title?: string;
description?: string;
truncatedReference: string;
reference: {
truncated: string;
url: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ export interface CreateTokenQrCodeForFileRequest {
passwordIsPin?: true;
passwordLocationIndicator?: string | number;
};
newQRCodeFormat?: boolean;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export interface UploadOwnFileRequest {
title: string;
title?: string;
description?: string;
expiresAt: string;
file: ArrayBuffer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export interface ConnectorRelationshipTemplate {
passwordIsPin?: true;
passwordLocationIndicator?: string | number;
};
truncatedReference: string;
reference: {
truncated: string;
url: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ export interface CreateTokenQrCodeForOwnRelationshipTemplateRequest {
passwordIsPin?: true;
passwordLocationIndicator?: string | number;
};
newQRCodeFormat?: boolean;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ArbitraryRelationshipCreationContentJSON, RelationshipCreationContentJSON } from "@nmshd/content";
import { ConnectorRelationshipTemplate } from "../relationshipTemplates/ConnectorRelationshipTemplate";
import { ConnectorIdentity } from "./ConnectorIdentity";
import { ConnectorPeerDeletionInfo } from "./ConnectorPeerDeletionInfo";
import { ConnectorRelationshipAuditLogEntry } from "./ConnectorRelationshipAuditLogEntry";
Expand All @@ -9,7 +8,7 @@ export interface ConnectorRelationshipAuditLog extends Array<ConnectorRelationsh

export interface ConnectorRelationship {
id: string;
template: ConnectorRelationshipTemplate;
templateId: string;
status: ConnectorRelationshipStatus;
peer: string;
peerDeletionInfo?: ConnectorPeerDeletionInfo;
Expand Down
1 change: 0 additions & 1 deletion packages/sdk/src/types/tokens/ConnectorToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export interface ConnectorToken {
passwordIsPin?: true;
passwordLocationIndicator?: string | number;
};
truncatedReference: string;
reference: {
truncated: string;
url: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"peerDependencies": {
"@js-soft/docdb-access-abstractions": "^1.1.0",
"@js-soft/ts-utils": "^2.3.3",
"@nmshd/runtime": "^6.50.0",
"@nmshd/runtime": "^7.0.0-alpha.34",
"@nmshd/typescript-rest": "^3.1.4",
"express": "^5.1.0"
},
Expand Down
16 changes: 0 additions & 16 deletions packages/types/src/QRCode.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/types/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ export * from "./ConnectorMode";
export * from "./ConnectorRuntimeModule";
export * from "./DocumentationLink";
export * from "./infrastructure";
export * from "./QRCode";
16 changes: 6 additions & 10 deletions packages/types/src/infrastructure/httpServer/BaseController.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Result } from "@js-soft/ts-utils";
import { Return } from "@nmshd/typescript-rest";
import express from "express";
import { QRCode } from "../../QRCode";
import * as qrcodeLibrary from "qrcode";
import { Envelope } from "./common/Envelope";
import { Mimetype } from "./common/Mimetype";

Expand Down Expand Up @@ -62,19 +62,15 @@ export abstract class BaseController {
.send(buffer);
}

protected async qrCode<T extends Result<any>>(
result: T,
qrPredicate: (result: T) => Promise<QRCode>,
filename: string,
response: express.Response,
status: number
): Promise<void> {
protected async qrCode<T extends Result<{ reference: { url: string } }>>(result: T, filename: string, response: express.Response, status: number): Promise<void> {
this.guard(result);

const mimetype = Mimetype.png();

const qrCode = await qrPredicate(result);
const buffer = Buffer.from(qrCode.asBase64(), "base64");
const reference = result.value.reference.url;
const dataUrl = await qrcodeLibrary.toDataURL(reference);
const base64 = dataUrl.split(",")[1];
const buffer = Buffer.from(base64, "base64");

response
.status(status)
Expand Down
22 changes: 6 additions & 16 deletions src/modules/coreHttpApi/controllers/AttributesController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,10 @@ export class AttributesController extends BaseController {
@Context context: ServiceContext,
@QueryParam("peer") peer: string,
@QueryParam("hideTechnical") hideTechnical?: boolean,
@QueryParam("onlyLatestVersions") onlyLatestVersions?: boolean,
@QueryParam("onlyValid") onlyValid?: boolean
@QueryParam("onlyLatestVersions") onlyLatestVersions?: boolean
): Promise<Envelope> {
const query: Record<string, any> = this.extractQuery(context.request.query, ["peer", "hideTechnical", "onlyLatestVersions", "onlyValid"]);
const result = await this.consumptionServices.attributes.getOwnSharedAttributes({ peer, hideTechnical, query, onlyLatestVersions, onlyValid });
const query: Record<string, any> = this.extractQuery(context.request.query, ["peer", "hideTechnical", "onlyLatestVersions"]);
const result = await this.consumptionServices.attributes.getOwnSharedAttributes({ peer, hideTechnical, query, onlyLatestVersions });
return this.ok(result);
}

Expand All @@ -96,12 +95,11 @@ export class AttributesController extends BaseController {
@Context context: ServiceContext,
@QueryParam("peer") peer: string,
@QueryParam("hideTechnical") hideTechnical?: boolean,
@QueryParam("onlyLatestVersions") onlyLatestVersions?: boolean,
@QueryParam("onlyValid") onlyValid?: boolean
@QueryParam("onlyLatestVersions") onlyLatestVersions?: boolean
): Promise<Envelope> {
const query: Record<string, any> = this.extractQuery(context.request.query, ["peer", "hideTechnical", "onlyLatestVersions", "onlyValid"]);
const query: Record<string, any> = this.extractQuery(context.request.query, ["peer", "hideTechnical", "onlyLatestVersions"]);

const result = await this.consumptionServices.attributes.getPeerSharedAttributes({ peer, hideTechnical, query, onlyLatestVersions, onlyValid });
const result = await this.consumptionServices.attributes.getPeerSharedAttributes({ peer, hideTechnical, query, onlyLatestVersions });
return this.ok(result);
}

Expand Down Expand Up @@ -131,14 +129,6 @@ export class AttributesController extends BaseController {
return this.ok(result);
}

@GET
@Path("/Valid")
@Accept("application/json")
public async getValidAttributes(@Context context: ServiceContext): Promise<Envelope> {
const result = await this.consumptionServices.attributes.getAttributes({ query: context.request.query, onlyValid: true });
return this.ok(result);
}

@GET
@Path("/TagCollection")
@Accept("application/json")
Expand Down
Loading