stream-chat 9.36.0 → 9.36.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -75,6 +75,11 @@ export declare class StreamChat {
75
75
  * manually calling queryChannels endpoint.
76
76
  */
77
77
  recoverStateOnReconnect?: boolean;
78
+ /**
79
+ * If true, we will not clean up threads when channel state is in initializing state.
80
+ * The main use case for SDKs who do independent state recovery for channels.
81
+ */
82
+ preventThreadCleanup: boolean;
78
83
  moderation: Moderation;
79
84
  mutedChannels: ChannelMute[];
80
85
  mutedUsers: Mute[];
@@ -2739,23 +2739,92 @@ export type DeleteMessageOptions = {
2739
2739
  hardDelete?: boolean;
2740
2740
  };
2741
2741
  export type SubmitActionOptions = {
2742
+ appeal_id?: string;
2742
2743
  ban?: {
2743
- channel_ban_only?: boolean;
2744
+ target_user_id?: string;
2745
+ shadow?: boolean;
2744
2746
  reason?: string;
2745
- timeout?: number;
2747
+ channel_ban_only?: boolean;
2748
+ channel_cid?: string;
2749
+ ip_ban?: boolean;
2746
2750
  delete_messages?: MessageDeletionStrategy;
2751
+ timeout?: number;
2752
+ };
2753
+ block?: {
2754
+ reason?: string;
2755
+ };
2756
+ custom?: {
2757
+ id: string;
2758
+ options?: Record<string, any>;
2759
+ };
2760
+ delete_activity?: {
2761
+ hard_delete?: boolean;
2762
+ reason?: string;
2763
+ entity_id?: string;
2764
+ entity_type?: string;
2765
+ };
2766
+ delete_comment?: {
2767
+ hard_delete?: boolean;
2768
+ reason?: string;
2769
+ entity_id?: string;
2770
+ entity_type?: string;
2747
2771
  };
2748
2772
  delete_message?: {
2749
2773
  hard_delete?: boolean;
2774
+ reason?: string;
2775
+ entity_id?: string;
2776
+ entity_type?: string;
2777
+ };
2778
+ delete_reaction?: {
2779
+ hard_delete?: boolean;
2780
+ reason?: string;
2781
+ entity_id?: string;
2782
+ entity_type?: string;
2750
2783
  };
2751
2784
  delete_user?: {
2752
- delete_conversation_channels?: boolean;
2753
2785
  hard_delete?: boolean;
2786
+ reason?: string;
2754
2787
  mark_messages_deleted?: boolean;
2788
+ delete_conversation_channels?: boolean;
2789
+ delete_feeds_content?: boolean;
2790
+ entity_id?: string;
2791
+ entity_type?: string;
2792
+ };
2793
+ end_call?: Record<string, never>;
2794
+ escalate?: {
2795
+ reason: string;
2796
+ category: string;
2797
+ priority: string;
2798
+ };
2799
+ flag?: {
2800
+ entity_type: string;
2801
+ entity_id: string;
2802
+ entity_creator_id?: string;
2803
+ reason?: string;
2804
+ moderation_payload?: ModerationPayload;
2805
+ custom?: Record<string, any>;
2806
+ };
2807
+ kick_user?: Record<string, never>;
2808
+ mark_reviewed?: {
2809
+ disable_marking_content_as_reviewed?: boolean;
2810
+ content_to_mark_as_reviewed_limit?: number;
2811
+ decision_reason?: string;
2812
+ };
2813
+ reject_appeal?: {
2814
+ decision_reason: string;
2815
+ };
2816
+ restore?: {
2817
+ decision_reason?: string;
2818
+ };
2819
+ shadow_block?: {
2820
+ reason?: string;
2755
2821
  };
2756
- restore?: {};
2757
2822
  unban?: {
2758
2823
  channel_cid?: string;
2824
+ decision_reason?: string;
2825
+ };
2826
+ unblock?: {
2827
+ decision_reason?: string;
2759
2828
  };
2760
2829
  user_id?: string;
2761
2830
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stream-chat",
3
- "version": "9.36.0",
3
+ "version": "9.36.2",
4
4
  "description": "JS SDK for the Stream Chat API",
5
5
  "homepage": "https://getstream.io/chat/",
6
6
  "author": {
@@ -243,7 +243,12 @@ export class ChannelState {
243
243
  .state.updateUserReference(message.user, this._channel.cid);
244
244
  }
245
245
 
246
- if (initializing && message.id && this.threads[message.id]) {
246
+ if (
247
+ initializing &&
248
+ message.id &&
249
+ this.threads[message.id] &&
250
+ !this._channel.getClient().preventThreadCleanup
251
+ ) {
247
252
  // If we are initializing the state of channel (e.g., in case of connection recovery),
248
253
  // then in that case we remove thread related to this message from threads object.
249
254
  // This way we can ensure that we don't have any stale data in thread object
package/src/client.ts CHANGED
@@ -321,6 +321,11 @@ export class StreamChat {
321
321
  * manually calling queryChannels endpoint.
322
322
  */
323
323
  recoverStateOnReconnect?: boolean;
324
+ /**
325
+ * If true, we will not clean up threads when channel state is in initializing state.
326
+ * The main use case for SDKs who do independent state recovery for channels.
327
+ */
328
+ preventThreadCleanup = false;
324
329
  moderation: Moderation;
325
330
  mutedChannels: ChannelMute[];
326
331
  mutedUsers: Mute[];
package/src/types.ts CHANGED
@@ -3721,23 +3721,94 @@ export type DeleteMessageOptions = {
3721
3721
  };
3722
3722
 
3723
3723
  export type SubmitActionOptions = {
3724
+ appeal_id?: string;
3724
3725
  ban?: {
3725
- channel_ban_only?: boolean;
3726
+ target_user_id?: string;
3727
+ shadow?: boolean;
3726
3728
  reason?: string;
3727
- timeout?: number;
3729
+ channel_ban_only?: boolean;
3730
+ channel_cid?: string;
3731
+ ip_ban?: boolean;
3728
3732
  delete_messages?: MessageDeletionStrategy;
3733
+ timeout?: number;
3734
+ };
3735
+ block?: {
3736
+ reason?: string;
3737
+ };
3738
+ custom?: {
3739
+ id: string;
3740
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3741
+ options?: Record<string, any>;
3742
+ };
3743
+ delete_activity?: {
3744
+ hard_delete?: boolean;
3745
+ reason?: string;
3746
+ entity_id?: string;
3747
+ entity_type?: string;
3748
+ };
3749
+ delete_comment?: {
3750
+ hard_delete?: boolean;
3751
+ reason?: string;
3752
+ entity_id?: string;
3753
+ entity_type?: string;
3729
3754
  };
3730
3755
  delete_message?: {
3731
3756
  hard_delete?: boolean;
3757
+ reason?: string;
3758
+ entity_id?: string;
3759
+ entity_type?: string;
3760
+ };
3761
+ delete_reaction?: {
3762
+ hard_delete?: boolean;
3763
+ reason?: string;
3764
+ entity_id?: string;
3765
+ entity_type?: string;
3732
3766
  };
3733
3767
  delete_user?: {
3734
- delete_conversation_channels?: boolean;
3735
3768
  hard_delete?: boolean;
3769
+ reason?: string;
3736
3770
  mark_messages_deleted?: boolean;
3771
+ delete_conversation_channels?: boolean;
3772
+ delete_feeds_content?: boolean;
3773
+ entity_id?: string;
3774
+ entity_type?: string;
3775
+ };
3776
+ end_call?: Record<string, never>;
3777
+ escalate?: {
3778
+ reason: string;
3779
+ category: string;
3780
+ priority: string;
3781
+ };
3782
+ flag?: {
3783
+ entity_type: string;
3784
+ entity_id: string;
3785
+ entity_creator_id?: string;
3786
+ reason?: string;
3787
+ moderation_payload?: ModerationPayload;
3788
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3789
+ custom?: Record<string, any>;
3790
+ };
3791
+ kick_user?: Record<string, never>;
3792
+ mark_reviewed?: {
3793
+ disable_marking_content_as_reviewed?: boolean;
3794
+ content_to_mark_as_reviewed_limit?: number;
3795
+ decision_reason?: string;
3796
+ };
3797
+ reject_appeal?: {
3798
+ decision_reason: string;
3799
+ };
3800
+ restore?: {
3801
+ decision_reason?: string;
3802
+ };
3803
+ shadow_block?: {
3804
+ reason?: string;
3737
3805
  };
3738
- restore?: {};
3739
3806
  unban?: {
3740
3807
  channel_cid?: string;
3808
+ decision_reason?: string;
3809
+ };
3810
+ unblock?: {
3811
+ decision_reason?: string;
3741
3812
  };
3742
3813
  user_id?: string;
3743
3814
  };