From 00d9ed1972bb05443bb72a2b334de6097fb4d3c2 Mon Sep 17 00:00:00 2001 From: Gleidson Daniel Silva Date: Thu, 24 Feb 2022 18:59:57 -0300 Subject: [PATCH] Chore: create definitions for e2e.setUserPublicAndPrivateKeys api call (#3775) --- app/definitions/rest/v1/e2e.ts | 5 +++++ app/definitions/rest/v1/index.ts | 4 +++- app/lib/rocketchat/services/restApi.ts | 4 +--- 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 app/definitions/rest/v1/e2e.ts diff --git a/app/definitions/rest/v1/e2e.ts b/app/definitions/rest/v1/e2e.ts new file mode 100644 index 00000000..4e41ef56 --- /dev/null +++ b/app/definitions/rest/v1/e2e.ts @@ -0,0 +1,5 @@ +export type E2eEndpoints = { + 'e2e.setUserPublicAndPrivateKeys': { + POST: (params: { public_key: string; private_key: string }) => void; + }; +}; diff --git a/app/definitions/rest/v1/index.ts b/app/definitions/rest/v1/index.ts index ae5f2926..83bb410d 100644 --- a/app/definitions/rest/v1/index.ts +++ b/app/definitions/rest/v1/index.ts @@ -14,6 +14,7 @@ import { OauthCustomConfiguration } from './settings'; import { UserEndpoints } from './user'; import { UsersEndpoints } from './users'; import { TeamsEndpoints } from './teams'; +import { E2eEndpoints } from './e2e'; export type Endpoints = ChannelsEndpoints & ChatEndpoints & @@ -30,4 +31,5 @@ export type Endpoints = ChannelsEndpoints & OauthCustomConfiguration & UserEndpoints & UsersEndpoints & - TeamsEndpoints; + TeamsEndpoints & + E2eEndpoints; diff --git a/app/lib/rocketchat/services/restApi.ts b/app/lib/rocketchat/services/restApi.ts index 81558c20..0ccf2203 100644 --- a/app/lib/rocketchat/services/restApi.ts +++ b/app/lib/rocketchat/services/restApi.ts @@ -34,10 +34,8 @@ export const createChannel = ({ return sdk.post(type ? 'groups.create' : 'channels.create', params); }; -export const e2eSetUserPublicAndPrivateKeys = (public_key: string, private_key: string): any => +export const e2eSetUserPublicAndPrivateKeys = (public_key: string, private_key: string) => // RC 2.2.0 - // TODO: missing definitions from server - // @ts-ignore sdk.post('e2e.setUserPublicAndPrivateKeys', { public_key, private_key }); export const e2eRequestSubscriptionKeys = (): any =>