Unverified Commit 0582cdfa authored by Reinaldo Neto's avatar Reinaldo Neto Committed by GitHub
Browse files

Chore: Migrate REST API - e2eFetchMyKeys to Typescript (#3942)

parent 8af1d1ce
......@@ -15,4 +15,7 @@ export type E2eEndpoints = {
'e2e.setRoomKeyID': {
POST: (params: { rid: string; keyID: string }) => {};
};
'e2e.fetchMyKeys': {
GET: () => { public_key: string; private_key: string };
};
};
......@@ -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,
......
......@@ -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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment