stream-chat 9.53.0 → 9.54.1
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.
- package/dist/cjs/index.browser.js +362 -79
- package/dist/cjs/index.browser.js.map +3 -3
- package/dist/cjs/index.node.js +362 -79
- package/dist/cjs/index.node.js.map +3 -3
- package/dist/esm/index.mjs +362 -79
- package/dist/esm/index.mjs.map +3 -3
- package/dist/types/client.d.ts +5 -73
- package/dist/types/connection.d.ts +12 -0
- package/dist/types/poll.d.ts +22 -4
- package/dist/types/poll_optimistic_votes.d.ts +63 -0
- package/dist/types/types.d.ts +36 -9
- package/dist/types/utils.d.ts +1 -3
- package/package.json +6 -1
- package/src/client.ts +3 -3
- package/src/connection.ts +47 -2
- package/src/messageComposer/middleware/messageComposer/linkPreviews.ts +20 -10
- package/src/poll.ts +95 -61
- package/src/poll_optimistic_votes.ts +321 -0
- package/src/thread.ts +11 -4
- package/src/types.ts +41 -9
package/src/types.ts
CHANGED
|
@@ -138,6 +138,7 @@ export type AppSettingsAPIResponse = APIResponse & {
|
|
|
138
138
|
auto_translation_enabled?: boolean;
|
|
139
139
|
before_message_send_hook_url?: string;
|
|
140
140
|
before_message_send_hook_attempt_timeout_ms?: number;
|
|
141
|
+
before_message_send_hook_system_messages?: boolean;
|
|
141
142
|
campaign_enabled?: boolean;
|
|
142
143
|
cdn_expiration_seconds?: number;
|
|
143
144
|
chat_primary_use_case?: string;
|
|
@@ -522,8 +523,10 @@ export type FlagMessageResponse = APIResponse & {
|
|
|
522
523
|
user: UserResponse;
|
|
523
524
|
approved_at?: string;
|
|
524
525
|
channel_cid?: string;
|
|
526
|
+
custom?: Record<string, unknown>;
|
|
525
527
|
details?: object; // Any JSON
|
|
526
528
|
message_user_id?: string;
|
|
529
|
+
reason?: string;
|
|
527
530
|
rejected_at?: string;
|
|
528
531
|
reviewed_at?: string;
|
|
529
532
|
reviewed_by?: string;
|
|
@@ -749,6 +752,7 @@ export type PushPreferencesResponse = {
|
|
|
749
752
|
/** Per-channel push preferences returned by the API (matches OpenAPI `ChannelPushPreferencesResponse`). */
|
|
750
753
|
export type ChannelPushPreference = {
|
|
751
754
|
chat_level?: ChatLevelPushPreference; // "all", "mentions", "direct_mentions", "all_mentions", "none", "default" or other custom strings
|
|
755
|
+
chat_preferences?: ChatPreferences;
|
|
752
756
|
disabled_until?: string;
|
|
753
757
|
};
|
|
754
758
|
|
|
@@ -803,9 +807,7 @@ export type MessageResponseBase = MessageBase & {
|
|
|
803
807
|
created_at?: string;
|
|
804
808
|
deleted_at?: string;
|
|
805
809
|
deleted_reply_count?: number;
|
|
806
|
-
i18n?:
|
|
807
|
-
language: TranslationLanguages;
|
|
808
|
-
};
|
|
810
|
+
i18n?: TranslatedField;
|
|
809
811
|
latest_reactions?: ReactionResponse[];
|
|
810
812
|
member?: ChannelMemberResponse;
|
|
811
813
|
mentioned_users?: UserResponse[];
|
|
@@ -1062,6 +1064,7 @@ export type UserResponse = CustomUserData & {
|
|
|
1062
1064
|
deactivated_at?: string;
|
|
1063
1065
|
deleted_at?: string;
|
|
1064
1066
|
image?: string;
|
|
1067
|
+
invisible?: boolean;
|
|
1065
1068
|
language?: TranslationLanguages | '';
|
|
1066
1069
|
last_active?: string;
|
|
1067
1070
|
name?: string;
|
|
@@ -1456,7 +1459,7 @@ export type UpdateChannelOptions = Partial<{
|
|
|
1456
1459
|
data: Omit<ChannelResponse, 'id' | 'cid'>;
|
|
1457
1460
|
demote_moderators: string[];
|
|
1458
1461
|
invites: string[];
|
|
1459
|
-
message:
|
|
1462
|
+
message: Message;
|
|
1460
1463
|
reject_invite: boolean;
|
|
1461
1464
|
remove_members: string[];
|
|
1462
1465
|
user: UserResponse;
|
|
@@ -1993,6 +1996,7 @@ export type ChannelFilters = QueryFilters<
|
|
|
1993
1996
|
app_banned?: 'only' | 'excluded';
|
|
1994
1997
|
has_unread?: boolean;
|
|
1995
1998
|
archived?: boolean;
|
|
1999
|
+
invite?: { $eq?: Exclude<InviteStatus, 'member'> } | Exclude<InviteStatus, 'member'>;
|
|
1996
2000
|
'member.user.name'?:
|
|
1997
2001
|
| RequireOnlyOne<{
|
|
1998
2002
|
$autocomplete?: string;
|
|
@@ -2015,8 +2019,19 @@ export type ChannelFilters = QueryFilters<
|
|
|
2015
2019
|
last_updated?:
|
|
2016
2020
|
| RequireOnlyOne<Pick<QueryFilter<string>, '$eq' | '$gt' | '$gte' | '$lt' | '$lte'>>
|
|
2017
2021
|
| PrimitiveFilter<string>;
|
|
2022
|
+
/**
|
|
2023
|
+
* With multi-tenancy, client-side queries without a `team` filter only return channels of
|
|
2024
|
+
* the user's teams; an empty filter (`team: {}`) queries across all teams.
|
|
2025
|
+
*/
|
|
2026
|
+
team?:
|
|
2027
|
+
| RequireOnlyOne<QueryFilter<ChannelResponse['team']>>
|
|
2028
|
+
| PrimitiveFilter<ChannelResponse['team']>
|
|
2029
|
+
| Record<string, never>;
|
|
2018
2030
|
} & {
|
|
2019
|
-
[Key in keyof Omit<
|
|
2031
|
+
[Key in keyof Omit<
|
|
2032
|
+
ChannelResponse,
|
|
2033
|
+
'name' | 'members' | 'team' | keyof CustomChannelData
|
|
2034
|
+
>]:
|
|
2020
2035
|
| RequireOnlyOne<QueryFilter<ChannelResponse[Key]>>
|
|
2021
2036
|
| PrimitiveFilter<ChannelResponse[Key]>;
|
|
2022
2037
|
}
|
|
@@ -3084,9 +3099,12 @@ export type PartialUpdateChannelFields = Partial<ChannelResponse> & {
|
|
|
3084
3099
|
config_overrides?: Partial<ChannelConfigFields>;
|
|
3085
3100
|
};
|
|
3086
3101
|
|
|
3102
|
+
/** Dot-notation path to a nested custom field, e.g. `channel_detail.topic`. */
|
|
3103
|
+
type NestedFieldPath = `${string}.${string}`;
|
|
3104
|
+
|
|
3087
3105
|
export type PartialUpdateChannel = {
|
|
3088
|
-
set?: PartialUpdateChannelFields;
|
|
3089
|
-
unset?: Array<keyof PartialUpdateChannelFields>;
|
|
3106
|
+
set?: PartialUpdateChannelFields & { [path: NestedFieldPath]: unknown };
|
|
3107
|
+
unset?: Array<keyof PartialUpdateChannelFields | NestedFieldPath>;
|
|
3090
3108
|
};
|
|
3091
3109
|
|
|
3092
3110
|
export type PartialUpdateMember = {
|
|
@@ -3106,8 +3124,8 @@ export type MessageUpdatableFields = Omit<
|
|
|
3106
3124
|
>;
|
|
3107
3125
|
|
|
3108
3126
|
export type PartialMessageUpdate = {
|
|
3109
|
-
set?: Partial<MessageUpdatableFields
|
|
3110
|
-
unset?: Array<keyof MessageUpdatableFields>;
|
|
3127
|
+
set?: Partial<MessageUpdatableFields> & { [path: NestedFieldPath]: unknown };
|
|
3128
|
+
unset?: Array<keyof MessageUpdatableFields | NestedFieldPath>;
|
|
3111
3129
|
};
|
|
3112
3130
|
|
|
3113
3131
|
export type PendingMessageResponse = {
|
|
@@ -3285,6 +3303,13 @@ export type TranslationLanguages =
|
|
|
3285
3303
|
| 'zh-TW'
|
|
3286
3304
|
| (string & {});
|
|
3287
3305
|
|
|
3306
|
+
// Server-owned translations for a single text field, keyed by language.
|
|
3307
|
+
export type TranslatedField = RequireAtLeastOne<
|
|
3308
|
+
Record<`${TranslationLanguages}_text`, string>
|
|
3309
|
+
> & {
|
|
3310
|
+
language: TranslationLanguages;
|
|
3311
|
+
};
|
|
3312
|
+
|
|
3288
3313
|
export type TypingStartEvent = Event;
|
|
3289
3314
|
|
|
3290
3315
|
export type ReservedUpdatedMessageFields = keyof typeof RESERVED_UPDATED_MESSAGE_FIELDS;
|
|
@@ -3486,6 +3511,7 @@ export type TaskStatus = {
|
|
|
3486
3511
|
|
|
3487
3512
|
export type TruncateOptions = {
|
|
3488
3513
|
hard_delete?: boolean;
|
|
3514
|
+
member_ids?: string[];
|
|
3489
3515
|
message?: Message;
|
|
3490
3516
|
skip_push?: boolean;
|
|
3491
3517
|
truncated_at?: Date;
|
|
@@ -3647,7 +3673,9 @@ export type PollResponse = CustomPollData &
|
|
|
3647
3673
|
allow_answers?: boolean;
|
|
3648
3674
|
allow_user_suggested_options?: boolean;
|
|
3649
3675
|
description?: string;
|
|
3676
|
+
description_i18n?: TranslatedField;
|
|
3650
3677
|
is_closed?: boolean;
|
|
3678
|
+
name_i18n?: TranslatedField;
|
|
3651
3679
|
voting_visibility?: VotingVisibility;
|
|
3652
3680
|
};
|
|
3653
3681
|
|
|
@@ -3658,6 +3686,7 @@ export type PollOption = {
|
|
|
3658
3686
|
text: string;
|
|
3659
3687
|
updated_at: string;
|
|
3660
3688
|
vote_count: number;
|
|
3689
|
+
text_i18n?: TranslatedField;
|
|
3661
3690
|
votes?: PollVote[];
|
|
3662
3691
|
};
|
|
3663
3692
|
|
|
@@ -3733,6 +3762,7 @@ export type PollOptionResponse = CustomPollData & {
|
|
|
3733
3762
|
text: string;
|
|
3734
3763
|
updated_at: string;
|
|
3735
3764
|
vote_count: number;
|
|
3765
|
+
text_i18n?: TranslatedField;
|
|
3736
3766
|
votes?: PollVote[];
|
|
3737
3767
|
};
|
|
3738
3768
|
|
|
@@ -3749,6 +3779,7 @@ export type PollVote = {
|
|
|
3749
3779
|
export type PollAnswer = Exclude<PollVote, 'option_id'> & {
|
|
3750
3780
|
answer_text: string;
|
|
3751
3781
|
is_answer: boolean; // this is absolutely redundant prop as answer_text indicates that a vote is an answer
|
|
3782
|
+
answer_text_i18n?: TranslatedField;
|
|
3752
3783
|
};
|
|
3753
3784
|
|
|
3754
3785
|
export type PollVotesAPIResponse = {
|
|
@@ -3866,6 +3897,7 @@ export type ReviewQueueItem = {
|
|
|
3866
3897
|
id: string;
|
|
3867
3898
|
moderation_payload: ModerationPayload;
|
|
3868
3899
|
moderation_payload_hash: string;
|
|
3900
|
+
message?: MessageResponse;
|
|
3869
3901
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3870
3902
|
options: any;
|
|
3871
3903
|
recommended_action: string;
|