From 8764be29c6ad46cd3c6af2e530aa73376e682112 Mon Sep 17 00:00:00 2001 From: Zdravko Iliev <zdravko.iliev@vereign.com> Date: Mon, 4 Dec 2023 12:54:53 +0000 Subject: [PATCH] feat: add delete invitation endpoint --- agent-swagger.json | 20 ++++++++++++++++++++ libs/askar/src/askar-rest/rest.controller.ts | 5 +++++ libs/askar/src/askar/agent.service.ts | 4 ++++ 3 files changed, 29 insertions(+) diff --git a/agent-swagger.json b/agent-swagger.json index ddc983cb..386748ed 100644 --- a/agent-swagger.json +++ b/agent-swagger.json @@ -29,6 +29,26 @@ } } }, + "/api/v1/invitations/{id}": { + "delete": { + "operationId": "RestController_deleteInvitationById", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + } + }, "/api/v1/invitations/accept": { "post": { "operationId": "RestController_acceptInvitation", diff --git a/libs/askar/src/askar-rest/rest.controller.ts b/libs/askar/src/askar-rest/rest.controller.ts index f5c59309..e12bdd64 100644 --- a/libs/askar/src/askar-rest/rest.controller.ts +++ b/libs/askar/src/askar-rest/rest.controller.ts @@ -40,6 +40,11 @@ export class RestController { return this.agentService.createInvitation(createInvitationRequestDto); } + @Delete("/invitations/:id") + deleteInvitationById(@Param("id") id: string) { + return this.agentService.deleteInvitationById(id); + } + @Post("/invitations/accept") async acceptInvitation( @Body() createInvitationDto: CreateInvitationResponseDto, diff --git a/libs/askar/src/askar/agent.service.ts b/libs/askar/src/askar/agent.service.ts index b74c6d42..f68a4925 100644 --- a/libs/askar/src/askar/agent.service.ts +++ b/libs/askar/src/askar/agent.service.ts @@ -90,6 +90,10 @@ export class AgentService { return response; }; + deleteInvitationById = async (id: string) => { + return this.askar.agent.oob.deleteById(id); + }; + async fetchConnections(): Promise<ConnectionRecordDto[]> { const agentResponse = await this.askar.agent.connections.getAll(); -- GitLab