2022-02-14 16:20:29 +00:00
|
|
|
import type { IMessage } from '../../IMessage';
|
2022-03-09 17:04:25 +00:00
|
|
|
import type { IRoomNotifications, IServerRoom } from '../../IRoom';
|
2022-02-14 16:20:29 +00:00
|
|
|
import type { IUser } from '../../IUser';
|
|
|
|
|
|
|
|
export type RoomsEndpoints = {
|
|
|
|
'rooms.autocomplete.channelAndPrivate': {
|
|
|
|
GET: (params: { selector: string }) => {
|
2022-03-08 16:25:27 +00:00
|
|
|
items: IServerRoom[];
|
2022-02-14 16:20:29 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
'rooms.autocomplete.channelAndPrivate.withPagination': {
|
|
|
|
GET: (params: { selector: string; offset?: number; count?: number; sort?: string }) => {
|
2022-03-08 16:25:27 +00:00
|
|
|
items: IServerRoom[];
|
2022-02-14 16:20:29 +00:00
|
|
|
count: number;
|
|
|
|
offset: number;
|
|
|
|
total: number;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
'rooms.autocomplete.availableForTeams': {
|
|
|
|
GET: (params: { name: string }) => {
|
2022-03-08 16:25:27 +00:00
|
|
|
items: IServerRoom[];
|
2022-02-14 16:20:29 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
'rooms.info': {
|
|
|
|
GET: (params: { roomId: string } | { roomName: string }) => {
|
2022-03-08 16:25:27 +00:00
|
|
|
room: IServerRoom;
|
2022-02-14 16:20:29 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
'rooms.createDiscussion': {
|
|
|
|
POST: (params: {
|
2022-03-08 16:25:27 +00:00
|
|
|
prid: IServerRoom['_id'];
|
2022-02-14 16:20:29 +00:00
|
|
|
pmid?: IMessage['_id'];
|
2022-03-08 16:25:27 +00:00
|
|
|
t_name: IServerRoom['fname'];
|
2022-02-14 16:20:29 +00:00
|
|
|
users?: IUser['username'][];
|
|
|
|
encrypted?: boolean;
|
|
|
|
reply?: string;
|
|
|
|
}) => {
|
2022-03-08 16:25:27 +00:00
|
|
|
discussion: IServerRoom;
|
2022-02-14 16:20:29 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
'rooms.favorite': {
|
|
|
|
POST: (params: { roomId: string; favorite: boolean }) => {};
|
|
|
|
};
|
2022-03-09 17:04:25 +00:00
|
|
|
'rooms.saveNotification': {
|
|
|
|
POST: (params: { roomId: string; notifications: IRoomNotifications }) => {};
|
|
|
|
};
|
2022-02-14 16:20:29 +00:00
|
|
|
};
|