Skip to content

Commit

Permalink
Clear text in export (#764)
Browse files Browse the repository at this point in the history
  • Loading branch information
ferhatelmas committed Sep 3, 2021
1 parent 0ae5444 commit 33f627f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import {
EndpointName,
Event,
EventHandler,
ExportChannelOptions,
ExportChannelRequest,
ExportChannelResponse,
ExportChannelStatusResponse,
Expand Down Expand Up @@ -3056,18 +3057,22 @@ export class StreamChat<
return this.delete<APIResponse>(`${this.baseURL}/blocklists/${name}`);
}

exportChannels(request: Array<ExportChannelRequest>) {
exportChannels(
request: Array<ExportChannelRequest>,
options: ExportChannelOptions = {},
) {
const payload = {
channels: request,
...options,
};
return this.post<APIResponse & ExportChannelResponse>(
`${this.baseURL}/export_channels`,
payload,
);
}

exportChannel(request: ExportChannelRequest) {
return this.exportChannels([request]);
exportChannel(request: ExportChannelRequest, options?: ExportChannelOptions) {
return this.exportChannels([request], options);
}

getExportChannelStatus(id: string) {
Expand Down
4 changes: 4 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1797,6 +1797,10 @@ export type ExportChannelRequest = {
messages_until?: Date;
};

export type ExportChannelOptions = {
clear_deleted_message_text?: boolean;
};

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

0 comments on commit 33f627f

Please sign in to comment.