Skip to content

Commit

Permalink
add async user export endpoint support (#860)
Browse files Browse the repository at this point in the history
Co-authored-by: Anatoly Rugalev <[email protected]>
  • Loading branch information
Siddhant Agarwal and Anatoly Rugalev committed Jan 13, 2022
1 parent cd8c719 commit a454d2b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ import {
FlagReportsResponse,
ReviewFlagReportOptions,
FlagReportsPaginationOptions,
ExportUsersRequest,
ExportUsersResponse,
} from './types';
import { InsightMetrics, postInsights } from './insights';

Expand Down Expand Up @@ -2808,6 +2810,10 @@ export class StreamChat<
return this.post<APIResponse & ExportChannelResponse>(`${this.baseURL}/export_channels`, payload);
}

exportUsers(request: ExportUsersRequest) {
return this.post<APIResponse & ExportUsersResponse>(`${this.baseURL}/export/users`, request);
}

exportChannel(request: ExportChannelRequest, options?: ExportChannelOptions) {
return this.exportChannels([request], options);
}
Expand Down
8 changes: 8 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,10 @@ export type ExportChannelResponse = {
task_id: string;
};

export type ExportUsersResponse = {
task_id: string;
};

export type ExportChannelStatusResponse = {
created_at?: string;
error?: {};
Expand Down Expand Up @@ -1737,6 +1741,10 @@ export type ExportChannelOptions = {
version?: string;
};

export type ExportUsersRequest = {
user_ids: string[];
};

export type Field = {
short?: boolean;
title?: string;
Expand Down

0 comments on commit a454d2b

Please sign in to comment.