Chore: Migrate REST API - e2eFetchMyKeys to Typescript (#3942)
This commit is contained in:
parent
8af1d1ceb5
commit
0582cdfa61
|
@ -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;
|
||||
};
|
Loading…
Reference in New Issue