stream-chat 9.10.1 → 9.11.0

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.
@@ -1,6 +1,6 @@
1
1
  import { ChannelState } from './channel_state';
2
2
  import type { StreamChat } from './client';
3
- import type { AIState, APIResponse, AscDesc, BanUserOptions, ChannelAPIResponse, ChannelData, ChannelMemberAPIResponse, ChannelMemberResponse, ChannelQueryOptions, ChannelResponse, ChannelUpdateOptions, CreateDraftResponse, DeleteChannelAPIResponse, DraftMessagePayload, Event, EventAPIResponse, EventHandler, EventTypes, GetDraftResponse, GetMultipleMessagesAPIResponse, GetReactionsAPIResponse, GetRepliesAPIResponse, LocalMessage, MarkReadOptions, MarkUnreadOptions, MemberFilters, MemberSort, Message, MessageFilters, MessageOptions, MessagePaginationOptions, MessageResponse, MessageSetType, MuteChannelAPIResponse, NewMemberPayload, PartialUpdateChannel, PartialUpdateChannelAPIResponse, PartialUpdateMember, PartialUpdateMemberAPIResponse, PinnedMessagePaginationOptions, PinnedMessagesSort, PollVoteData, PushPreference, QueryChannelAPIResponse, QueryMembersOptions, Reaction, ReactionAPIResponse, SearchAPIResponse, SearchOptions, SendMessageAPIResponse, SendMessageOptions, TruncateChannelAPIResponse, TruncateOptions, UpdateChannelAPIResponse, UpdateChannelOptions, UserResponse } from './types';
3
+ import type { AIState, APIResponse, AscDesc, BanUserOptions, ChannelAPIResponse, ChannelData, ChannelMemberAPIResponse, ChannelMemberResponse, ChannelQueryOptions, ChannelResponse, ChannelUpdateOptions, CreateDraftResponse, DeleteChannelAPIResponse, DraftMessagePayload, Event, EventAPIResponse, EventHandler, EventTypes, GetDraftResponse, GetMultipleMessagesAPIResponse, GetReactionsAPIResponse, GetRepliesAPIResponse, LocalMessage, MarkReadOptions, MarkUnreadOptions, MemberFilters, MemberSort, Message, MessageFilters, MessageOptions, MessagePaginationOptions, MessageResponse, MessageSetType, MuteChannelAPIResponse, NewMemberPayload, PartialUpdateChannel, PartialUpdateChannelAPIResponse, PartialUpdateMember, PartialUpdateMemberAPIResponse, PinnedMessagePaginationOptions, PinnedMessagesSort, PollVoteData, PushPreference, QueryChannelAPIResponse, QueryMembersOptions, Reaction, ReactionAPIResponse, SearchAPIResponse, SearchOptions, SendMessageAPIResponse, SendMessageOptions, SendReactionOptions, TruncateChannelAPIResponse, TruncateOptions, UpdateChannelAPIResponse, UpdateChannelOptions, UserResponse } from './types';
4
4
  import type { Role } from './permissions';
5
5
  import { MessageComposer } from './messageComposer';
6
6
  /**
@@ -147,10 +147,7 @@ export declare class Channel {
147
147
  *
148
148
  * @return {Promise<ReactionAPIResponse>} The Server Response
149
149
  */
150
- sendReaction(messageID: string, reaction: Reaction, options?: {
151
- enforce_unique?: boolean;
152
- skip_push?: boolean;
153
- }): Promise<ReactionAPIResponse>;
150
+ sendReaction(messageID: string, reaction: Reaction, options?: SendReactionOptions): Promise<ReactionAPIResponse>;
154
151
  /**
155
152
  * sendReaction - Send a reaction about a message
156
153
  *
@@ -160,10 +157,7 @@ export declare class Channel {
160
157
  *
161
158
  * @return {Promise<ReactionAPIResponse>} The Server Response
162
159
  */
163
- _sendReaction(messageID: string, reaction: Reaction, options?: {
164
- enforce_unique?: boolean;
165
- skip_push?: boolean;
166
- }): Promise<ReactionAPIResponse>;
160
+ _sendReaction(messageID: string, reaction: Reaction, options?: SendReactionOptions): Promise<ReactionAPIResponse>;
167
161
  deleteReaction(messageID: string, reactionType: string, user_id?: string): Promise<ReactionAPIResponse>;
168
162
  /**
169
163
  * deleteReaction - Delete a reaction by user and type
@@ -755,6 +755,7 @@ export type UserResponse = CustomUserData & {
755
755
  teams_role?: TeamsRole;
756
756
  updated_at?: string;
757
757
  username?: string;
758
+ avg_response_time?: number;
758
759
  };
759
760
  export type TeamsRole = {
760
761
  [team: string]: string;
@@ -1738,6 +1739,7 @@ export type AppSettings = {
1738
1739
  sqs_key?: string;
1739
1740
  sqs_secret?: string;
1740
1741
  sqs_url?: string;
1742
+ user_response_time_enabled?: boolean;
1741
1743
  video_provider?: string;
1742
1744
  webhook_events?: Array<string> | null;
1743
1745
  webhook_url?: string;
@@ -2027,6 +2029,11 @@ export type SendMessageOptions = {
2027
2029
  };
2028
2030
  export type UpdateMessageOptions = {
2029
2031
  skip_enrich_url?: boolean;
2032
+ skip_push?: boolean;
2033
+ };
2034
+ export type SendReactionOptions = {
2035
+ enforce_unique?: boolean;
2036
+ skip_push?: boolean;
2030
2037
  };
2031
2038
  export type GetMessageOptions = {
2032
2039
  show_deleted_message?: boolean;
@@ -2101,6 +2108,7 @@ export type Reaction = CustomReactionData & {
2101
2108
  score?: number;
2102
2109
  user?: UserResponse | null;
2103
2110
  user_id?: string;
2111
+ emoji_code?: string;
2104
2112
  };
2105
2113
  export type Resource = 'AddLinks' | 'BanUser' | 'CreateChannel' | 'CreateMessage' | 'CreateReaction' | 'DeleteAttachment' | 'DeleteChannel' | 'DeleteMessage' | 'DeleteReaction' | 'EditUser' | 'MuteUser' | 'ReadChannel' | 'RunMessageAction' | 'UpdateChannel' | 'UpdateChannelMembers' | 'UpdateMessage' | 'UpdateUser' | 'UploadAttachment';
2106
2114
  export type SearchPayload = Omit<SearchOptions, 'sort'> & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stream-chat",
3
- "version": "9.10.1",
3
+ "version": "9.11.0",
4
4
  "description": "JS SDK for the Stream Chat API",
5
5
  "homepage": "https://getstream.io/chat/",
6
6
  "author": {
package/src/channel.ts CHANGED
@@ -62,6 +62,7 @@ import type {
62
62
  SearchPayload,
63
63
  SendMessageAPIResponse,
64
64
  SendMessageOptions,
65
+ SendReactionOptions,
65
66
  TruncateChannelAPIResponse,
66
67
  TruncateOptions,
67
68
  UpdateChannelAPIResponse,
@@ -420,7 +421,7 @@ export class Channel {
420
421
  async sendReaction(
421
422
  messageID: string,
422
423
  reaction: Reaction,
423
- options?: { enforce_unique?: boolean; skip_push?: boolean },
424
+ options?: SendReactionOptions,
424
425
  ) {
425
426
  if (!messageID) {
426
427
  throw Error(`Message id is missing`);
@@ -464,7 +465,7 @@ export class Channel {
464
465
  async _sendReaction(
465
466
  messageID: string,
466
467
  reaction: Reaction,
467
- options?: { enforce_unique?: boolean; skip_push?: boolean },
468
+ options?: SendReactionOptions,
468
469
  ) {
469
470
  if (!messageID) {
470
471
  throw Error(`Message id is missing`);
@@ -376,6 +376,10 @@ export class AttachmentManager {
376
376
  localAttachment.thumb_url = fileLike.thumb_url;
377
377
  }
378
378
 
379
+ if (isFileReference(fileLike) && fileLike.duration) {
380
+ localAttachment.duration = fileLike.duration;
381
+ }
382
+
379
383
  return localAttachment;
380
384
  };
381
385
 
package/src/types.ts CHANGED
@@ -888,6 +888,7 @@ export type UserResponse = CustomUserData & {
888
888
  teams_role?: TeamsRole;
889
889
  updated_at?: string;
890
890
  username?: string;
891
+ avg_response_time?: number;
891
892
  };
892
893
 
893
894
  export type TeamsRole = { [team: string]: string };
@@ -2254,6 +2255,7 @@ export type AppSettings = {
2254
2255
  sqs_key?: string;
2255
2256
  sqs_secret?: string;
2256
2257
  sqs_url?: string;
2258
+ user_response_time_enabled?: boolean;
2257
2259
  video_provider?: string;
2258
2260
  webhook_events?: Array<string> | null;
2259
2261
  webhook_url?: string;
@@ -2748,6 +2750,12 @@ export type SendMessageOptions = {
2748
2750
 
2749
2751
  export type UpdateMessageOptions = {
2750
2752
  skip_enrich_url?: boolean;
2753
+ skip_push?: boolean;
2754
+ };
2755
+
2756
+ export type SendReactionOptions = {
2757
+ enforce_unique?: boolean;
2758
+ skip_push?: boolean;
2751
2759
  };
2752
2760
 
2753
2761
  export type GetMessageOptions = {
@@ -2839,6 +2847,7 @@ export type Reaction = CustomReactionData & {
2839
2847
  score?: number;
2840
2848
  user?: UserResponse | null;
2841
2849
  user_id?: string;
2850
+ emoji_code?: string;
2842
2851
  };
2843
2852
 
2844
2853
  export type Resource =