diff --git a/app/definitions/rest/v1/channels.ts b/app/definitions/rest/v1/channels.ts index d5270e0bc..640ade486 100644 --- a/app/definitions/rest/v1/channels.ts +++ b/app/definitions/rest/v1/channels.ts @@ -1,6 +1,6 @@ import { ITeam } from '../../ITeam'; import type { IMessage, IMessageFromServer } from '../../IMessage'; -import type { IRoom } from '../../IRoom'; +import type { IRoom, IServerRoomItem } from '../../IRoom'; import type { IUser } from '../../IUser'; export type ChannelsEndpoints = { @@ -29,6 +29,20 @@ export type ChannelsEndpoints = { messages: IMessageFromServer[]; }; }; + 'channels.create': { + POST: (params: { + name: string; + members: string[]; + readOnly: boolean; + extraData: { + broadcast: boolean; + encrypted: boolean; + teamId?: string; + }; + }) => { + group: Partial; + }; + }; 'channels.convertToTeam': { POST: (params: { channelId: string; channelName: string }) => { team: ITeam }; }; diff --git a/app/definitions/rest/v1/groups.ts b/app/definitions/rest/v1/groups.ts index d858d79d5..8868ac7de 100644 --- a/app/definitions/rest/v1/groups.ts +++ b/app/definitions/rest/v1/groups.ts @@ -1,6 +1,6 @@ import { ITeam } from '../../ITeam'; import type { IMessage, IMessageFromServer } from '../../IMessage'; -import type { IRoom } from '../../IRoom'; +import type { IRoom, IServerRoomItem } from '../../IRoom'; import type { IUser } from '../../IUser'; export type GroupsEndpoints = { @@ -23,6 +23,20 @@ export type GroupsEndpoints = { messages: IMessageFromServer[]; }; }; + 'groups.create': { + POST: (params: { + name: string; + members: string[]; + readOnly: boolean; + extraData: { + broadcast: boolean; + encrypted: boolean; + teamId?: string; + }; + }) => { + group: Partial; + }; + }; 'groups.convertToTeam': { POST: (params: { roomId: string; roomName: string }) => { team: ITeam }; }; diff --git a/app/definitions/rest/v1/omnichannel.ts b/app/definitions/rest/v1/omnichannel.ts index df4441370..3a7d6bcec 100644 --- a/app/definitions/rest/v1/omnichannel.ts +++ b/app/definitions/rest/v1/omnichannel.ts @@ -76,6 +76,9 @@ export type OmnichannelEndpoints = { GET: (params: { sort: string }) => PaginatedResult<{ agents: ILivechatDepartmentAgents[] }>; POST: (params: { upsert: string[]; remove: string[] }) => void; }; + 'livechat/department/:departmentId/?includeAgents=false': { + GET: () => PaginatedResult<{ department: ILivechatDepartment[] }>; + }; 'livechat/departments.available-by-unit/:id': { GET: (params: PaginatedRequest<{ text: string }>) => PaginatedResult<{ departments: ILivechatDepartment[]; diff --git a/app/lib/rocketchat/services/restApi.ts b/app/lib/rocketchat/services/restApi.ts index fa2fb91b8..a3f148f0a 100644 --- a/app/lib/rocketchat/services/restApi.ts +++ b/app/lib/rocketchat/services/restApi.ts @@ -19,7 +19,7 @@ export const createChannel = ({ broadcast: boolean; encrypted: boolean; teamId: string; -}): any => { +}) => { const params = { name, members: users, @@ -30,8 +30,6 @@ export const createChannel = ({ ...(teamId && { teamId }) } }; - // TODO: missing definitions from server - // @ts-ignore return sdk.post(type ? 'groups.create' : 'channels.create', params); }; @@ -83,7 +81,8 @@ export const forgotPassword = (email: string): any => // @ts-ignore sdk.post('users.forgotPassword', { email }); -export const sendConfirmationEmail = (email: string) => sdk.methodCallWrapper('sendConfirmationEmail', email); +export const sendConfirmationEmail = (email: string): Promise<{ message: string; success: boolean }> => + sdk.methodCallWrapper('sendConfirmationEmail', email); export const spotlight = (search: string, usernames: string, type: { users: boolean; rooms: boolean }) => // RC 0.51.0 @@ -406,7 +405,7 @@ export const forwardLivechat = (transferData: any) => // RC 0.36.0 sdk.methodCallWrapper('livechat:transfer', transferData); -export const getDepartmentInfo = (departmentId: string): any => +export const getDepartmentInfo = (departmentId: string) => // RC 2.2.0 sdk.get(`livechat/department/${departmentId}?includeAgents=false`); @@ -427,7 +426,15 @@ export const usersAutoComplete = (selector: any) => // RC 2.4.0 sdk.get('users.autocomplete', { selector }); -export const getRoutingConfig = () => +export const getRoutingConfig = (): Promise<{ + previewRoom: boolean; + showConnecting: boolean; + showQueue: boolean; + showQueueLink: boolean; + returnQueue: boolean; + enableTriggerAction: boolean; + autoAssignAgent: boolean; +}> => // RC 2.0.0 sdk.methodCallWrapper('livechat:getRoutingConfig'); diff --git a/app/views/RoomActionsView/index.tsx b/app/views/RoomActionsView/index.tsx index eda478605..7be3ae706 100644 --- a/app/views/RoomActionsView/index.tsx +++ b/app/views/RoomActionsView/index.tsx @@ -347,7 +347,7 @@ class RoomActionsView extends React.Component