diff --git a/agent-swagger.json b/agent-swagger.json index ddc983cbd6848d36128a6d3a29524818d7ccf673..386748ed774ada17758d9e65efb0fa075d8f137e 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 f5c5930942c10815a779d7b4666b4a878cf37935..e12bdd642916e7aa29c0d084e097e71bc015a242 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 b74c6d42e67bbe5b9b03f83962c9cb19a6a8ecf5..f68a4925283c56b008230588321d554655717643 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();