stream-chat 9.54.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.
@@ -988,6 +988,7 @@ export declare class StreamChat {
988
988
  * @returns {Promise<APIResponse>}
989
989
  */
990
990
  flagMessage(targetMessageID: string, options?: {
991
+ custom?: Record<string, unknown>;
991
992
  reason?: string;
992
993
  user_id?: string;
993
994
  }): Promise<FlagMessageResponse>;
@@ -1120,75 +1121,10 @@ export declare class StreamChat {
1120
1121
  * @param {string} messageId
1121
1122
  * @param {string} language
1122
1123
  *
1123
- * @return {MessageResponse} Response that includes the message
1124
+ * @return {APIResponse & { message: MessageResponse }} Response that includes the translated message
1124
1125
  */
1125
- translateMessage(messageId: string, language: string): Promise<APIResponse & import("./custom_types").CustomMessageData & {
1126
- id: string;
1127
- attachments?: import("./types").Attachment[];
1128
- html?: string;
1129
- mml?: string;
1130
- parent_id?: string;
1131
- pin_expires?: string | null;
1132
- pinned?: boolean;
1133
- pinned_at?: string | null;
1134
- poll_id?: string;
1135
- quoted_message_id?: string;
1136
- restricted_visibility?: string[];
1137
- show_in_channel?: boolean;
1138
- silent?: boolean;
1139
- text?: string;
1140
- type?: import("./types").MessageLabel;
1141
- user?: UserResponse | null;
1142
- user_id?: string;
1143
- } & {
1144
- type: import("./types").MessageLabel;
1145
- args?: string;
1146
- before_message_send_failed?: boolean;
1147
- channel?: ChannelResponse;
1148
- cid?: string;
1149
- command?: string;
1150
- command_info?: {
1151
- name?: string;
1152
- };
1153
- created_at?: string;
1154
- deleted_at?: string;
1155
- deleted_reply_count?: number;
1156
- i18n?: import("./types").TranslatedField;
1157
- latest_reactions?: ReactionResponse[];
1158
- member?: import("./types").ChannelMemberResponse;
1159
- mentioned_users?: UserResponse[];
1160
- mentioned_channel?: boolean;
1161
- mentioned_here?: boolean;
1162
- mentioned_group_ids?: string[];
1163
- mentioned_groups?: import("./types").UserGroupResponse[];
1164
- mentioned_roles?: string[];
1165
- message_text_updated_at?: string;
1166
- moderation?: import("./types").ModerationResponse;
1167
- moderation_details?: import("./types").ModerationDetailsResponse;
1168
- own_reactions?: ReactionResponse[] | null;
1169
- pin_expires?: string | null;
1170
- pinned_at?: string | null;
1171
- pinned_by?: UserResponse | null;
1172
- poll?: import("./types").PollResponse;
1173
- reaction_counts?: {
1174
- [key: string]: number;
1175
- } | null;
1176
- reaction_groups?: {
1177
- [key: string]: import("./types").ReactionGroupResponse;
1178
- } | null;
1179
- reaction_scores?: {
1180
- [key: string]: number;
1181
- } | null;
1182
- reminder?: import("./types").ReminderResponseBase;
1183
- reply_count?: number;
1184
- shadowed?: boolean;
1185
- shared_location?: SharedLocationResponse;
1186
- status?: string;
1187
- thread_participants?: UserResponse[];
1188
- updated_at?: string;
1189
- deleted_for_me?: boolean;
1190
- } & {
1191
- quoted_message?: import("./types").MessageResponseBase;
1126
+ translateMessage(messageId: string, language: string): Promise<APIResponse & {
1127
+ message: MessageResponse;
1192
1128
  }>;
1193
1129
  /**
1194
1130
  * translate - translates the given text to provided language
@@ -38,6 +38,12 @@ export declare class StableWSConnection {
38
38
  StatusCode?: string | number;
39
39
  }) => void;
40
40
  requestID: string | undefined;
41
+ /**
42
+ * Set when the server sent a `connection.error` with code 40 (token expired) on an
43
+ * already established socket. The server closes the socket right after it, and the
44
+ * reconnect that follows must use a fresh token from the tokenProvider.
45
+ */
46
+ tokenExpiredByServer: boolean;
41
47
  resolvePromise?: (value: ConnectionOpen) => void;
42
48
  totalFailures: number;
43
49
  ws?: WebSocket;
@@ -99,6 +105,12 @@ export declare class StableWSConnection {
99
105
  onmessage: (wsID: number, event: WebSocket.MessageEvent) => void;
100
106
  onclose: (wsID: number, event: WebSocket.CloseEvent) => void;
101
107
  onerror: (wsID: number, event: WebSocket.ErrorEvent) => void;
108
+ /**
109
+ * _reconnectAfterFailure - Reconnects after the socket closed or failed. If the server
110
+ * reported that the token expired, the token is refreshed before reconnecting.
111
+ * Static tokens cannot be refreshed and reconnect as before.
112
+ */
113
+ _reconnectAfterFailure(): void;
102
114
  /**
103
115
  * _setHealth - Sets the connection to healthy or unhealthy.
104
116
  * Broadcasts an event in case the connection status changed.
@@ -437,8 +437,10 @@ export type FlagMessageResponse = APIResponse & {
437
437
  user: UserResponse;
438
438
  approved_at?: string;
439
439
  channel_cid?: string;
440
+ custom?: Record<string, unknown>;
440
441
  details?: object;
441
442
  message_user_id?: string;
443
+ reason?: string;
442
444
  rejected_at?: string;
443
445
  reviewed_at?: string;
444
446
  reviewed_by?: string;
@@ -623,6 +625,7 @@ export type PushPreferencesResponse = {
623
625
  /** Per-channel push preferences returned by the API (matches OpenAPI `ChannelPushPreferencesResponse`). */
624
626
  export type ChannelPushPreference = {
625
627
  chat_level?: ChatLevelPushPreference;
628
+ chat_preferences?: ChatPreferences;
626
629
  disabled_until?: string;
627
630
  };
628
631
  export type UpsertPushPreferencesResponse = APIResponse & {
@@ -894,6 +897,7 @@ export type UserResponse = CustomUserData & {
894
897
  deactivated_at?: string;
895
898
  deleted_at?: string;
896
899
  image?: string;
900
+ invisible?: boolean;
897
901
  language?: TranslationLanguages | '';
898
902
  last_active?: string;
899
903
  name?: string;
@@ -1259,7 +1263,7 @@ export type UpdateChannelOptions = Partial<{
1259
1263
  data: Omit<ChannelResponse, 'id' | 'cid'>;
1260
1264
  demote_moderators: string[];
1261
1265
  invites: string[];
1262
- message: MessageResponse;
1266
+ message: Message;
1263
1267
  reject_invite: boolean;
1264
1268
  remove_members: string[];
1265
1269
  user: UserResponse;
@@ -1636,6 +1640,9 @@ export type ChannelFilters = QueryFilters<ContainsOperator<Omit<CustomChannelDat
1636
1640
  app_banned?: 'only' | 'excluded';
1637
1641
  has_unread?: boolean;
1638
1642
  archived?: boolean;
1643
+ invite?: {
1644
+ $eq?: Exclude<InviteStatus, 'member'>;
1645
+ } | Exclude<InviteStatus, 'member'>;
1639
1646
  'member.user.name'?: RequireOnlyOne<{
1640
1647
  $autocomplete?: string;
1641
1648
  $eq?: string;
@@ -1646,8 +1653,13 @@ export type ChannelFilters = QueryFilters<ContainsOperator<Omit<CustomChannelDat
1646
1653
  } & QueryFilter<string>> | PrimitiveFilter<string>;
1647
1654
  pinned?: boolean;
1648
1655
  last_updated?: RequireOnlyOne<Pick<QueryFilter<string>, '$eq' | '$gt' | '$gte' | '$lt' | '$lte'>> | PrimitiveFilter<string>;
1656
+ /**
1657
+ * With multi-tenancy, client-side queries without a `team` filter only return channels of
1658
+ * the user's teams; an empty filter (`team: {}`) queries across all teams.
1659
+ */
1660
+ team?: RequireOnlyOne<QueryFilter<ChannelResponse['team']>> | PrimitiveFilter<ChannelResponse['team']> | Record<string, never>;
1649
1661
  } & {
1650
- [Key in keyof Omit<ChannelResponse, 'name' | 'members' | keyof CustomChannelData>]: RequireOnlyOne<QueryFilter<ChannelResponse[Key]>> | PrimitiveFilter<ChannelResponse[Key]>;
1662
+ [Key in keyof Omit<ChannelResponse, 'name' | 'members' | 'team' | keyof CustomChannelData>]: RequireOnlyOne<QueryFilter<ChannelResponse[Key]>> | PrimitiveFilter<ChannelResponse[Key]>;
1651
1663
  }>;
1652
1664
  export type DraftFilters = {
1653
1665
  channel_cid?: RequireOnlyOne<Pick<QueryFilter<DraftResponse['channel_cid']>, '$in' | '$eq'>> | PrimitiveFilter<DraftResponse['channel_cid']>;
@@ -2319,9 +2331,13 @@ export type Mute = {
2319
2331
  export type PartialUpdateChannelFields = Partial<ChannelResponse> & {
2320
2332
  config_overrides?: Partial<ChannelConfigFields>;
2321
2333
  };
2334
+ /** Dot-notation path to a nested custom field, e.g. `channel_detail.topic`. */
2335
+ type NestedFieldPath = `${string}.${string}`;
2322
2336
  export type PartialUpdateChannel = {
2323
- set?: PartialUpdateChannelFields;
2324
- unset?: Array<keyof PartialUpdateChannelFields>;
2337
+ set?: PartialUpdateChannelFields & {
2338
+ [path: NestedFieldPath]: unknown;
2339
+ };
2340
+ unset?: Array<keyof PartialUpdateChannelFields | NestedFieldPath>;
2325
2341
  };
2326
2342
  export type PartialUpdateMember = {
2327
2343
  set?: ChannelMemberUpdates;
@@ -2334,8 +2350,10 @@ export type PartialUserUpdate = {
2334
2350
  };
2335
2351
  export type MessageUpdatableFields = Omit<MessageResponse, 'cid' | 'created_at' | 'updated_at' | 'deleted_at' | 'user' | 'user_id'>;
2336
2352
  export type PartialMessageUpdate = {
2337
- set?: Partial<MessageUpdatableFields>;
2338
- unset?: Array<keyof MessageUpdatableFields>;
2353
+ set?: Partial<MessageUpdatableFields> & {
2354
+ [path: NestedFieldPath]: unknown;
2355
+ };
2356
+ unset?: Array<keyof MessageUpdatableFields | NestedFieldPath>;
2339
2357
  };
2340
2358
  export type PendingMessageResponse = {
2341
2359
  message: MessageResponse;
@@ -2584,6 +2602,7 @@ export type TaskStatus = {
2584
2602
  };
2585
2603
  export type TruncateOptions = {
2586
2604
  hard_delete?: boolean;
2605
+ member_ids?: string[];
2587
2606
  message?: Message;
2588
2607
  skip_push?: boolean;
2589
2608
  truncated_at?: Date;
@@ -2868,6 +2887,7 @@ export type ReviewQueueItem = {
2868
2887
  id: string;
2869
2888
  moderation_payload: ModerationPayload;
2870
2889
  moderation_payload_hash: string;
2890
+ message?: MessageResponse;
2871
2891
  options: any;
2872
2892
  recommended_action: string;
2873
2893
  results: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stream-chat",
3
- "version": "9.54.0",
3
+ "version": "9.54.1",
4
4
  "description": "JS SDK for the Stream Chat API",
5
5
  "homepage": "https://getstream.io/chat/",
6
6
  "author": {
@@ -66,6 +66,7 @@
66
66
  "@eslint/js": "^9.39.4",
67
67
  "@semantic-release/changelog": "^6.0.3",
68
68
  "@semantic-release/git": "^10.0.1",
69
+ "@stream-io/node-sdk": "^0.8.10",
69
70
  "@types/node": "^22.19.19",
70
71
  "@types/sinon": "^10.0.6",
71
72
  "@vitest/coverage-v8": "^4.1.10",
@@ -101,6 +102,10 @@
101
102
  "run-types-gen": "tsc -p test/typescript/tsconfig.json",
102
103
  "test-unit": "vitest",
103
104
  "test-coverage": "vitest run --coverage",
105
+ "test-docs": "vitest run --config test/docs-snippets/vitest.config.mts",
106
+ "test-docs-sweep": "vitest run --config test/docs-snippets/vitest.sweep.config.mts",
107
+ "test-docs-sync": "vitest run --config test/docs-snippets/vitest.sync.config.mts",
108
+ "types-docs": "tsc -p test/docs-snippets/tsconfig.json",
104
109
  "fix-staged": "lint-staged --config .lintstagedrc.fix.json --concurrent 1",
105
110
  "semantic-release": "semantic-release",
106
111
  "postinstall": "node -e \"require('fs').existsSync('scripts/install-husky.mjs') && import('./scripts/install-husky.mjs')\"",
package/src/client.ts CHANGED
@@ -3096,7 +3096,7 @@ export class StreamChat {
3096
3096
  */
3097
3097
  async flagMessage(
3098
3098
  targetMessageID: string,
3099
- options: { reason?: string; user_id?: string } = {},
3099
+ options: { custom?: Record<string, unknown>; reason?: string; user_id?: string } = {},
3100
3100
  ) {
3101
3101
  return await this.post<FlagMessageResponse>(this.baseURL + '/moderation/flag', {
3102
3102
  target_message_id: targetMessageID,
@@ -3330,10 +3330,10 @@ export class StreamChat {
3330
3330
  * @param {string} messageId
3331
3331
  * @param {string} language
3332
3332
  *
3333
- * @return {MessageResponse} Response that includes the message
3333
+ * @return {APIResponse & { message: MessageResponse }} Response that includes the translated message
3334
3334
  */
3335
3335
  async translateMessage(messageId: string, language: string) {
3336
- return await this.post<APIResponse & MessageResponse>(
3336
+ return await this.post<APIResponse & { message: MessageResponse }>(
3337
3337
  this.baseURL + `/messages/${encodeURIComponent(messageId)}/translate`,
3338
3338
  { language },
3339
3339
  );
package/src/connection.ts CHANGED
@@ -68,6 +68,12 @@ export class StableWSConnection {
68
68
  },
69
69
  ) => void;
70
70
  requestID: string | undefined;
71
+ /**
72
+ * Set when the server sent a `connection.error` with code 40 (token expired) on an
73
+ * already established socket. The server closes the socket right after it, and the
74
+ * reconnect that follows must use a fresh token from the tokenProvider.
75
+ */
76
+ tokenExpiredByServer: boolean;
71
77
  resolvePromise?: (value: ConnectionOpen) => void;
72
78
  totalFailures: number;
73
79
  ws?: WebSocket;
@@ -92,6 +98,8 @@ export class StableWSConnection {
92
98
  this.wsID = 1;
93
99
  /** Store the last event time for health checks */
94
100
  this.lastEvent = null;
101
+ /** Set when the server reports that the token of the open socket expired */
102
+ this.tokenExpiredByServer = false;
95
103
  /** Send a health check message every 25 seconds */
96
104
  this.pingInterval = 25 * 1000;
97
105
  this.connectionCheckTimeout = this.pingInterval + 10 * 1000;
@@ -229,6 +237,7 @@ export class StableWSConnection {
229
237
  this.wsID += 1;
230
238
  this.isConnecting = false;
231
239
  this.isDisconnected = true;
240
+ this.tokenExpiredByServer = false;
232
241
 
233
242
  // start by removing all the listeners
234
243
  if (this.healthCheckTimeoutRef) {
@@ -408,6 +417,13 @@ export class StableWSConnection {
408
417
 
409
418
  if (options.refreshToken) {
410
419
  await this.client.tokenManager.loadToken();
420
+
421
+ // Another reconnect may have started while the token was loading, e.g. when
422
+ // the socket fires both an error and a close event.
423
+ if (this.isConnecting || this.isHealthy) {
424
+ this._log('_reconnect() - Abort (4) since already connecting or healthy');
425
+ return;
426
+ }
411
427
  }
412
428
 
413
429
  try {
@@ -501,6 +517,17 @@ export class StableWSConnection {
501
517
  this.scheduleNextPing();
502
518
  }
503
519
 
520
+ // The server reports a token that expired after the connection was established
521
+ // (auto_disconnect_ws) and then closes the socket. Remember it so the reconnect
522
+ // refreshes the token first instead of retrying once with the expired token.
523
+ if (
524
+ data?.type === 'connection.error' &&
525
+ data?.error?.code === chatCodes.TOKEN_EXPIRED
526
+ ) {
527
+ this._log('onmessage() - server reported that the token expired', { wsID });
528
+ this.tokenExpiredByServer = true;
529
+ }
530
+
504
531
  this.client.dispatchEvent(data);
505
532
  this.scheduleConnectionCheck();
506
533
  };
@@ -535,7 +562,7 @@ export class StableWSConnection {
535
562
  this._log(`onclose() - WS connection closed. Calling reconnect ...`, { event });
536
563
 
537
564
  // reconnect if its an abnormal failure
538
- this._reconnect();
565
+ this._reconnectAfterFailure();
539
566
  }
540
567
  };
541
568
 
@@ -550,9 +577,26 @@ export class StableWSConnection {
550
577
  this.rejectPromise?.(this._errorFromWSEvent(event));
551
578
  this._log(`onerror() - WS connection resulted into error`, { event });
552
579
 
553
- this._reconnect();
580
+ this._reconnectAfterFailure();
554
581
  };
555
582
 
583
+ /**
584
+ * _reconnectAfterFailure - Reconnects after the socket closed or failed. If the server
585
+ * reported that the token expired, the token is refreshed before reconnecting.
586
+ * Static tokens cannot be refreshed and reconnect as before.
587
+ */
588
+ _reconnectAfterFailure() {
589
+ if (this.tokenExpiredByServer && !this.client.tokenManager.isStatic()) {
590
+ this._log(
591
+ '_reconnectAfterFailure() - token expired, so going to reload token and reconnect',
592
+ );
593
+ this._reconnect({ refreshToken: true });
594
+ return;
595
+ }
596
+
597
+ this._reconnect();
598
+ }
599
+
556
600
  /**
557
601
  * _setHealth - Sets the connection to healthy or unhealthy.
558
602
  * Broadcasts an event in case the connection status changed.
@@ -642,6 +686,7 @@ export class StableWSConnection {
642
686
  */
643
687
  _setupConnectionPromise = () => {
644
688
  this.isResolved = false;
689
+ this.tokenExpiredByServer = false;
645
690
  /** a promise that is resolved once ws.open is called */
646
691
  this.connectionOpen = new Promise<ConnectionOpen>((resolve, reject) => {
647
692
  this.resolvePromise = resolve;
package/src/poll.ts CHANGED
@@ -185,7 +185,15 @@ export class Poll {
185
185
  const { id, ...pollData } = extractPollData(event.poll);
186
186
  if (pollData.is_closed) this.closeConfirmed = true;
187
187
  // @ts-expect-error type mismatch
188
- this.state.partialNext({ ...pollData, lastActivityAt: new Date(event.created_at) });
188
+ this.state.partialNext({
189
+ ...pollData,
190
+ // Server-owned translations, which `extractPollData` (an update request) leaves out. Copied
191
+ // even when absent: the event carries the whole poll, and a change made under channel-only
192
+ // translation drops the stale ones.
193
+ description_i18n: event.poll.description_i18n,
194
+ lastActivityAt: new Date(event.created_at),
195
+ name_i18n: event.poll.name_i18n,
196
+ });
189
197
  this.upsertOfflineDb();
190
198
  };
191
199
 
package/src/thread.ts CHANGED
@@ -7,6 +7,8 @@ import {
7
7
  } from './utils';
8
8
  import type {
9
9
  AscDesc,
10
+ ChannelData,
11
+ ChannelResponse,
10
12
  EventTypes,
11
13
  LocalMessage,
12
14
  MessagePaginationOptions,
@@ -127,10 +129,15 @@ export class Thread extends WithSubscriptions {
127
129
  }) {
128
130
  super();
129
131
 
130
- const channel = client.channel(threadData.channel.type, threadData.channel.id, {
131
- // @ts-expect-error name is a "custom" property
132
- name: threadData.channel.name,
133
- });
132
+ // `name` is custom channel data: widening the types compiles
133
+ // whether or not the app augments `CustomChannelData` with it.
134
+ const channelResponse: ChannelResponse & { name?: string } = threadData.channel;
135
+ const channelData: ChannelData & { name?: string } = { name: channelResponse.name };
136
+ const channel = client.channel(
137
+ threadData.channel.type,
138
+ threadData.channel.id,
139
+ channelData,
140
+ );
134
141
  channel._hydrateMembers({
135
142
  members: threadData.channel.members ?? [],
136
143
  overrideCurrentState: false,
package/src/types.ts CHANGED
@@ -523,8 +523,10 @@ export type FlagMessageResponse = APIResponse & {
523
523
  user: UserResponse;
524
524
  approved_at?: string;
525
525
  channel_cid?: string;
526
+ custom?: Record<string, unknown>;
526
527
  details?: object; // Any JSON
527
528
  message_user_id?: string;
529
+ reason?: string;
528
530
  rejected_at?: string;
529
531
  reviewed_at?: string;
530
532
  reviewed_by?: string;
@@ -750,6 +752,7 @@ export type PushPreferencesResponse = {
750
752
  /** Per-channel push preferences returned by the API (matches OpenAPI `ChannelPushPreferencesResponse`). */
751
753
  export type ChannelPushPreference = {
752
754
  chat_level?: ChatLevelPushPreference; // "all", "mentions", "direct_mentions", "all_mentions", "none", "default" or other custom strings
755
+ chat_preferences?: ChatPreferences;
753
756
  disabled_until?: string;
754
757
  };
755
758
 
@@ -1061,6 +1064,7 @@ export type UserResponse = CustomUserData & {
1061
1064
  deactivated_at?: string;
1062
1065
  deleted_at?: string;
1063
1066
  image?: string;
1067
+ invisible?: boolean;
1064
1068
  language?: TranslationLanguages | '';
1065
1069
  last_active?: string;
1066
1070
  name?: string;
@@ -1455,7 +1459,7 @@ export type UpdateChannelOptions = Partial<{
1455
1459
  data: Omit<ChannelResponse, 'id' | 'cid'>;
1456
1460
  demote_moderators: string[];
1457
1461
  invites: string[];
1458
- message: MessageResponse;
1462
+ message: Message;
1459
1463
  reject_invite: boolean;
1460
1464
  remove_members: string[];
1461
1465
  user: UserResponse;
@@ -1992,6 +1996,7 @@ export type ChannelFilters = QueryFilters<
1992
1996
  app_banned?: 'only' | 'excluded';
1993
1997
  has_unread?: boolean;
1994
1998
  archived?: boolean;
1999
+ invite?: { $eq?: Exclude<InviteStatus, 'member'> } | Exclude<InviteStatus, 'member'>;
1995
2000
  'member.user.name'?:
1996
2001
  | RequireOnlyOne<{
1997
2002
  $autocomplete?: string;
@@ -2014,8 +2019,19 @@ export type ChannelFilters = QueryFilters<
2014
2019
  last_updated?:
2015
2020
  | RequireOnlyOne<Pick<QueryFilter<string>, '$eq' | '$gt' | '$gte' | '$lt' | '$lte'>>
2016
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>;
2017
2030
  } & {
2018
- [Key in keyof Omit<ChannelResponse, 'name' | 'members' | keyof CustomChannelData>]:
2031
+ [Key in keyof Omit<
2032
+ ChannelResponse,
2033
+ 'name' | 'members' | 'team' | keyof CustomChannelData
2034
+ >]:
2019
2035
  | RequireOnlyOne<QueryFilter<ChannelResponse[Key]>>
2020
2036
  | PrimitiveFilter<ChannelResponse[Key]>;
2021
2037
  }
@@ -3083,9 +3099,12 @@ export type PartialUpdateChannelFields = Partial<ChannelResponse> & {
3083
3099
  config_overrides?: Partial<ChannelConfigFields>;
3084
3100
  };
3085
3101
 
3102
+ /** Dot-notation path to a nested custom field, e.g. `channel_detail.topic`. */
3103
+ type NestedFieldPath = `${string}.${string}`;
3104
+
3086
3105
  export type PartialUpdateChannel = {
3087
- set?: PartialUpdateChannelFields;
3088
- unset?: Array<keyof PartialUpdateChannelFields>;
3106
+ set?: PartialUpdateChannelFields & { [path: NestedFieldPath]: unknown };
3107
+ unset?: Array<keyof PartialUpdateChannelFields | NestedFieldPath>;
3089
3108
  };
3090
3109
 
3091
3110
  export type PartialUpdateMember = {
@@ -3105,8 +3124,8 @@ export type MessageUpdatableFields = Omit<
3105
3124
  >;
3106
3125
 
3107
3126
  export type PartialMessageUpdate = {
3108
- set?: Partial<MessageUpdatableFields>;
3109
- unset?: Array<keyof MessageUpdatableFields>;
3127
+ set?: Partial<MessageUpdatableFields> & { [path: NestedFieldPath]: unknown };
3128
+ unset?: Array<keyof MessageUpdatableFields | NestedFieldPath>;
3110
3129
  };
3111
3130
 
3112
3131
  export type PendingMessageResponse = {
@@ -3492,6 +3511,7 @@ export type TaskStatus = {
3492
3511
 
3493
3512
  export type TruncateOptions = {
3494
3513
  hard_delete?: boolean;
3514
+ member_ids?: string[];
3495
3515
  message?: Message;
3496
3516
  skip_push?: boolean;
3497
3517
  truncated_at?: Date;
@@ -3877,6 +3897,7 @@ export type ReviewQueueItem = {
3877
3897
  id: string;
3878
3898
  moderation_payload: ModerationPayload;
3879
3899
  moderation_payload_hash: string;
3900
+ message?: MessageResponse;
3880
3901
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3881
3902
  options: any;
3882
3903
  recommended_action: string;