From 3168e8bceaf46fff65d7f28512c972b6d1040059 Mon Sep 17 00:00:00 2001 From: Marius Kleidl Date: Mon, 12 Oct 2026 12:09:29 +0200 Subject: [PATCH] feat: support conversations: keep in deleteUsers --- src/client.ts | 4 ++-- src/types.ts | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/client.ts b/src/client.ts index 06989bfa9a..73ad613b76 100644 --- a/src/client.ts +++ b/src/client.ts @@ -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 ( diff --git a/src/types.ts b/src/types.ts index 550ac57bc3..b1bb56b638 100644 --- a/src/types.ts +++ b/src/types.ts @@ -3328,10 +3328,11 @@ 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 @@ -3339,7 +3340,7 @@ export type DeleteType = 'soft' | 'hard' | 'pruning'; `new_channel_owner_id`: any channels owned by the hard-deleted user will be transferred to this user ID */ export type DeleteUserOptions = { - conversations?: Exclude; + conversations?: Exclude | 'keep'; messages?: DeleteType; new_channel_owner_id?: string; user?: DeleteType;