Chore: Migrate REST API - getDirectory to Typescript (#3898)

This commit is contained in:
Reinaldo Neto 2022-03-15 13:47:40 -03:00 committed by GitHub
parent 2cc4b9c1ba
commit ee336a84a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 4 deletions

View File

@ -0,0 +1,13 @@
import { IServerRoom } from '../../IRoom';
import { PaginatedResult } from '../helpers/PaginatedResult';
export type DirectoryEndpoint = {
directory: {
GET: (params: {
query: { [key: string]: string };
count: number;
offset: number;
sort: { [key: string]: number };
}) => PaginatedResult<{ result: IServerRoom[] }>;
};
};

View File

@ -17,6 +17,7 @@ import { E2eEndpoints } from './e2e';
import { SubscriptionsEndpoints } from './subscriptions';
import { VideoConferenceEndpoints } from './videoConference';
import { CommandsEndpoints } from './commands';
import { DirectoryEndpoint } from './directory';
export type Endpoints = ChannelsEndpoints &
ChatEndpoints &
@ -36,4 +37,5 @@ export type Endpoints = ChannelsEndpoints &
E2eEndpoints &
SubscriptionsEndpoints &
VideoConferenceEndpoints &
CommandsEndpoints;
CommandsEndpoints &
DirectoryEndpoint;

View File

@ -713,10 +713,18 @@ export const executeCommandPreview = (
tmid
});
export const getDirectory = ({ query, count, offset, sort }: { query: any; count: number; offset: number; sort: any }): any =>
export const getDirectory = ({
query,
count,
offset,
sort
}: {
query: { [key: string]: string };
count: number;
offset: number;
sort: { [key: string]: number };
}) =>
// RC 1.0
// TODO: missing definitions from server
// @ts-ignore
sdk.get('directory', {
query,
count,