Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4656,10 +4656,10 @@ export class StreamChat {
}
if (
typeof options.conversations !== 'undefined' &&
!['soft', 'hard'].includes(options.conversations)
!['soft', 'hard', 'keep'].includes(options.conversations)
) {
throw new Error(
'Invalid delete user options. conversations must be one of [soft hard]',
'Invalid delete user options. conversations must be one of [soft hard keep]',
);
}
if (
Expand Down
5 changes: 3 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3328,18 +3328,19 @@ export type DeleteType = 'soft' | 'hard' | 'pruning';
`user`:
- soft: marks user as deleted and retains all user data
- pruning: marks user as deleted and nullifies user information
- hard: deletes user completely - this requires hard option for messages and conversation as well
- hard: deletes user completely - this requires hard option for messages, and hard or keep option for conversations
`conversations`:
- soft: marks all conversation channels as deleted (same effect as Delete Channels with 'hard' option disabled)
- hard: deletes channel and all its data completely including messages (same effect as Delete Channels with 'hard' option enabled)
- keep: doesn't delete any conversation channels. Use it with user hard, where an unset value defaults to hard
`messages`:
- soft: marks all user messages as deleted without removing any related message data
- pruning: marks all user messages as deleted, nullifies message information and removes some message data such as reactions and flags
- hard: deletes messages completely with all related information
`new_channel_owner_id`: any channels owned by the hard-deleted user will be transferred to this user ID
*/
export type DeleteUserOptions = {
conversations?: Exclude<DeleteType, 'pruning'>;
conversations?: Exclude<DeleteType, 'pruning'> | 'keep';
messages?: DeleteType;
new_channel_owner_id?: string;
user?: DeleteType;
Expand Down
Loading