From 0444e9b846402c4e3534df8cd867508558df852b Mon Sep 17 00:00:00 2001 From: Alex Junior Date: Fri, 4 Mar 2022 23:29:12 -0300 Subject: [PATCH] Chore: Migrate REST API - updateJitsiTimeout to Typescript (#3822) * chore: add rest api return * chore: add rest api return --- app/definitions/rest/v1/index.ts | 4 +++- app/definitions/rest/v1/videoConference.ts | 5 +++++ app/lib/rocketchat/services/restApi.ts | 4 +--- 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 app/definitions/rest/v1/videoConference.ts diff --git a/app/definitions/rest/v1/index.ts b/app/definitions/rest/v1/index.ts index 61f19572e..4e899f106 100644 --- a/app/definitions/rest/v1/index.ts +++ b/app/definitions/rest/v1/index.ts @@ -15,6 +15,7 @@ import { UsersEndpoints } from './users'; import { TeamsEndpoints } from './teams'; import { E2eEndpoints } from './e2e'; import { SubscriptionsEndpoints } from './subscriptions'; +import { VideoConferenceEndpoints } from './videoConference'; export type Endpoints = ChannelsEndpoints & ChatEndpoints & @@ -32,4 +33,5 @@ export type Endpoints = ChannelsEndpoints & UsersEndpoints & TeamsEndpoints & E2eEndpoints & - SubscriptionsEndpoints; + SubscriptionsEndpoints & + VideoConferenceEndpoints; diff --git a/app/definitions/rest/v1/videoConference.ts b/app/definitions/rest/v1/videoConference.ts new file mode 100644 index 000000000..a7a1e3f70 --- /dev/null +++ b/app/definitions/rest/v1/videoConference.ts @@ -0,0 +1,5 @@ +export type VideoConferenceEndpoints = { + 'video-conference/jitsi.update-timeout': { + POST: (params: { roomId: string }) => void; + }; +}; diff --git a/app/lib/rocketchat/services/restApi.ts b/app/lib/rocketchat/services/restApi.ts index 40db3b020..5ebe74977 100644 --- a/app/lib/rocketchat/services/restApi.ts +++ b/app/lib/rocketchat/services/restApi.ts @@ -57,10 +57,8 @@ export const e2eRequestRoomKey = (rid: string, e2eKeyId: string) => // RC 0.70.0 sdk.methodCallWrapper('stream-notify-room-users', `${rid}/e2ekeyRequest`, rid, e2eKeyId); -export const updateJitsiTimeout = (roomId: string): any => +export const updateJitsiTimeout = (roomId: string) => // RC 0.74.0 - // TODO: missing definitions from server - // @ts-ignore sdk.post('video-conference/jitsi.update-timeout', { roomId }); export const register = (credentials: { name: string; email: string; pass: string; username: string }) =>