Skip to content

Commit

Permalink
Remove object loading by id and key (#269)
Browse files Browse the repository at this point in the history
* refactor: update sdk

* fix: update test

* refactor: update openapi

* chore: bump runtime

* fix: update test

* chore: PR comments

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
jkoenig134 and mergify[bot] authored Sep 24, 2024
1 parent dff9f25 commit ecec859
Show file tree
Hide file tree
Showing 23 changed files with 2,475 additions and 587 deletions.
2,756 changes: 2,431 additions & 325 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/docdb-access-mongo": "1.1.9",
"@js-soft/node-logger": "1.2.0",
"@js-soft/ts-utils": "^2.3.3",
"@nmshd/runtime": "5.5.0",
"@nmshd/runtime": "6.0.0",
"agentkeepalive": "4.5.0",
"amqplib": "^0.10.4",
"axios": "^1.7.7",
Expand Down Expand Up @@ -113,8 +113,8 @@
"@js-soft/eslint-config-ts": "1.6.9",
"@js-soft/license-check": "1.0.9",
"@nmshd/connector-sdk": "*",
"@nmshd/content": "5.5.0",
"@nmshd/core-types": "5.5.0",
"@nmshd/content": "6.0.0",
"@nmshd/core-types": "6.0.0",
"@types/amqplib": "^0.10.5",
"@types/compression": "^1.7.5",
"@types/cors": "^2.8.17",
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": "5.5.0",
"@nmshd/content": "6.0.0",
"axios": "^1.7.7",
"form-data": "^4.0.0",
"qs": "^6.13.0"
Expand Down
4 changes: 0 additions & 4 deletions packages/sdk/src/endpoints/FilesEndpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import {
GetOwnFilesRequest,
GetPeerFilesRequest,
LoadPeerFileRequest,
TokenReference,
TruncatedFileReference,
UploadOwnFileRequest
} from "../types";
import { Endpoint } from "./Endpoint";
Expand Down Expand Up @@ -38,8 +36,6 @@ export class FilesEndpoint extends Endpoint {
return await this.get("/api/v2/Files/Own", request);
}

public async loadPeerFile(request: TruncatedFileReference): Promise<ConnectorHttpResponse<ConnectorFile>>;
public async loadPeerFile(request: TokenReference): Promise<ConnectorHttpResponse<ConnectorFile>>;
public async loadPeerFile(request: LoadPeerFileRequest): Promise<ConnectorHttpResponse<ConnectorFile>> {
return await this.post("/api/v2/Files/Peer", request);
}
Expand Down
6 changes: 1 addition & 5 deletions packages/sdk/src/endpoints/RelationshipTemplatesEndpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ import {
GetOwnTemplatesRequest as GetOwnRelationshipTemplatesRequest,
GetPeerRelationshipTemplatesRequest,
GetRelationshipTemplatesRequest,
LoadPeerRelationshipTemplateRequest,
RelationshipTemplateReference,
TruncatedRelationshipTemplateReference
LoadPeerRelationshipTemplateRequest
} from "../types";
import { Endpoint } from "./Endpoint";

Expand Down Expand Up @@ -56,8 +54,6 @@ export class RelationshipTemplatesEndpoint extends Endpoint {
return await this.get("/api/v2/RelationshipTemplates/Peer", request);
}

public async loadPeerRelationshipTemplate(request: TruncatedRelationshipTemplateReference): Promise<ConnectorHttpResponse<ConnectorRelationshipTemplate>>;
public async loadPeerRelationshipTemplate(request: RelationshipTemplateReference): Promise<ConnectorHttpResponse<ConnectorRelationshipTemplate>>;
public async loadPeerRelationshipTemplate(request: LoadPeerRelationshipTemplateRequest): Promise<ConnectorHttpResponse<ConnectorRelationshipTemplate>> {
return await this.post("/api/v2/RelationshipTemplates/Peer", request);
}
Expand Down
14 changes: 1 addition & 13 deletions packages/sdk/src/endpoints/TokensEndpoint.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
import { AxiosInstance } from "axios";
import {
ConnectorHttpResponse,
ConnectorToken,
ConnectorTokens,
CreateOwnTokenRequest,
GetOwnTokensRequest,
GetPeerTokensRequest,
LoadPeerTokenByReferenceRequest,
LoadPeerTokenByTruncatedReferenceRequest,
LoadPeerTokenRequest
} from "../types";
import { ConnectorHttpResponse, ConnectorToken, ConnectorTokens, CreateOwnTokenRequest, GetOwnTokensRequest, GetPeerTokensRequest, LoadPeerTokenRequest } from "../types";
import { Endpoint } from "./Endpoint";

export class TokensEndpoint extends Endpoint {
Expand Down Expand Up @@ -37,8 +27,6 @@ export class TokensEndpoint extends Endpoint {
return await this.get("/api/v2/Tokens/Peer", request);
}

public async loadPeerToken(request: LoadPeerTokenByReferenceRequest): Promise<ConnectorHttpResponse<ConnectorToken>>;
public async loadPeerToken(request: LoadPeerTokenByTruncatedReferenceRequest): Promise<ConnectorHttpResponse<ConnectorToken>>;
public async loadPeerToken(request: LoadPeerTokenRequest): Promise<ConnectorHttpResponse<ConnectorToken>> {
return await this.post("/api/v2/Tokens/Peer", request);
}
Expand Down
1 change: 0 additions & 1 deletion packages/sdk/src/types/files/ConnectorFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ export interface ConnectorFile {
isOwn: boolean;
title: string;
description?: string;
secretKey: string;
truncatedReference: string;
}
4 changes: 0 additions & 4 deletions packages/sdk/src/types/files/FileReference.ts

This file was deleted.

7 changes: 0 additions & 7 deletions packages/sdk/src/types/files/TruncatedFileReference.ts

This file was deleted.

2 changes: 0 additions & 2 deletions packages/sdk/src/types/files/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
export * from "./ConnectorFile";
export * from "./ConnectorFiles";
export * from "./FileReference";
export * from "./requests/CreateTokenForFileRequest";
export * from "./requests/CreateTokenQrCodeForFileRequest";
export * from "./requests/GetAllFilesRequest";
export * from "./requests/GetOwnFilesRequest";
export * from "./requests/GetPeerFilesRequest";
export * from "./requests/LoadPeerFileRequest";
export * from "./requests/UploadOwnFileRequest";
export * from "./TruncatedFileReference";
11 changes: 7 additions & 4 deletions packages/sdk/src/types/files/requests/LoadPeerFileRequest.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { FileReference } from "../FileReference";
import { TruncatedFileReference } from "../TruncatedFileReference";

export type LoadPeerFileRequest = TruncatedFileReference | FileReference;
export interface LoadPeerFileRequest {
/**
* starting with 'VE9L' for a truncated reference to a token containing a FileReference or
* starting with 'RklM' for a direct truncated FileReference
*/
reference: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ export interface ConnectorRelationshipTemplate {
createdAt: string;
content: RelationshipTemplateContentJSON | ArbitraryRelationshipTemplateContentJSON;
expiresAt?: string;
secretKey: string;
truncatedReference: string;
}

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions packages/sdk/src/types/relationshipTemplates/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
export * from "./ConnectorRelationshipTemplate";
export * from "./ConnectorRelationshipTemplates";
export * from "./RelationshipTemplateReference";
export * from "./requests/CreateOwnRelationshipTemplateRequest";
export * from "./requests/CreateTokenForOwnRelationshipTemplateRequest";
export * from "./requests/CreateTokenQrCodeForOwnRelationshipTemplateRequest";
export * from "./requests/GetOwnRelationshipTemplatesRequest";
export * from "./requests/GetPeerRelationshipTemplatesRequest";
export * from "./requests/GetRelationshipTemplatesRequest";
export * from "./requests/LoadPeerRelationshipTemplateRequest";
export * from "./TruncatedRelationshipTemplateReference";
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { RelationshipTemplateReference } from "../RelationshipTemplateReference";
import { TruncatedRelationshipTemplateReference } from "../TruncatedRelationshipTemplateReference";

export type LoadPeerRelationshipTemplateRequest = TruncatedRelationshipTemplateReference | RelationshipTemplateReference;
export interface LoadPeerRelationshipTemplateRequest {
/**
* starting with 'VE9L' for a truncated reference to a token containing a RelationshipTemplateReference or
* starting with 'UkxU' for a direct truncated RelationshipTemplateReference
*/
reference: string;
}
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 @@ -5,7 +5,6 @@ export interface ConnectorToken {
content: unknown;
createdAt: string;
expiresAt: string;
secretKey: string;
truncatedReference: string;
isEphemeral: boolean;
}
4 changes: 0 additions & 4 deletions packages/sdk/src/types/tokens/TokenReference.ts

This file was deleted.

3 changes: 0 additions & 3 deletions packages/sdk/src/types/tokens/TokenReferenceTruncated.ts

This file was deleted.

2 changes: 0 additions & 2 deletions packages/sdk/src/types/tokens/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@ export * from "./requests/CreateOwnTokenRequest";
export * from "./requests/GetOwnTokensRequest";
export * from "./requests/GetPeerTokensRequest";
export * from "./requests/LoadPeerTokenRequest";
export * from "./TokenReference";
export * from "./TokenReferenceTruncated";
10 changes: 1 addition & 9 deletions packages/sdk/src/types/tokens/requests/LoadPeerTokenRequest.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
export interface LoadPeerTokenByTruncatedReferenceRequest {
export interface LoadPeerTokenRequest {
reference: string;
ephemeral?: boolean;
}

export interface LoadPeerTokenByReferenceRequest {
id: string;
secretKey: string;
ephemeral?: boolean;
}

export type LoadPeerTokenRequest = LoadPeerTokenByReferenceRequest | LoadPeerTokenByTruncatedReferenceRequest;
Loading

0 comments on commit ecec859

Please sign in to comment.