diff --git a/app/definitions/rest/v1/e2e.ts b/app/definitions/rest/v1/e2e.ts index 44705c851..f23c0fac9 100644 --- a/app/definitions/rest/v1/e2e.ts +++ b/app/definitions/rest/v1/e2e.ts @@ -15,4 +15,7 @@ export type E2eEndpoints = { 'e2e.setRoomKeyID': { POST: (params: { rid: string; keyID: string }) => {}; }; + 'e2e.fetchMyKeys': { + GET: () => { public_key: string; private_key: string }; + }; }; diff --git a/app/lib/rocketchat/rocketchat.js b/app/lib/rocketchat/rocketchat.js index 639a42494..155b5a545 100644 --- a/app/lib/rocketchat/rocketchat.js +++ b/app/lib/rocketchat/rocketchat.js @@ -109,20 +109,6 @@ const RocketChat = { connect, shareExtensionInit, closeShareExtension, - - async e2eFetchMyKeys() { - // RC 0.70.0 - const result = await sdk.get('e2e.fetchMyKeys'); - // snake_case -> camelCase - if (result.success) { - return { - success: result.success, - publicKey: result.public_key, - privateKey: result.private_key - }; - } - return result; - }, loginTOTP, loginWithPassword, loginOAuthOrSso, diff --git a/app/lib/rocketchat/services/restApi.ts b/app/lib/rocketchat/services/restApi.ts index 73502fc79..db6124351 100644 --- a/app/lib/rocketchat/services/restApi.ts +++ b/app/lib/rocketchat/services/restApi.ts @@ -887,3 +887,17 @@ export const getRoomMembers = async ({ return result?.records; } }; + +export const e2eFetchMyKeys = async () => { + // RC 0.70.0 + const result = await sdk.get('e2e.fetchMyKeys'); + // snake_case -> camelCase + if (result.success) { + return { + success: result.success, + publicKey: result.public_key, + privateKey: result.private_key + }; + } + return result; +}; \ No newline at end of file