stream-chat 9.30.1 → 9.32.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.
@@ -2353,6 +2353,7 @@ var isVideoAttachment = (attachment, supportedVideoFormat = []) => attachment.ty
2353
2353
  var isLocalVideoAttachment = (attachment) => isVideoAttachment(attachment) && isLocalAttachment(attachment);
2354
2354
  var isUploadedAttachment = (attachment) => isAudioAttachment(attachment) || isFileAttachment(attachment) || isImageAttachment(attachment) || isVideoAttachment(attachment) || isVoiceRecordingAttachment(attachment);
2355
2355
  var isSharedLocationResponse = (location) => !!location.latitude && !!location.longitude && !!location.channel_cid;
2356
+ var isGiphyAttachment = (attachment) => attachment.type === "giphy";
2356
2357
 
2357
2358
  // src/messageComposer/fileUtils.ts
2358
2359
  var isFile = (fileLike) => !!fileLike.lastModified && !("uri" in fileLike);
@@ -6792,10 +6793,12 @@ var initState6 = (composition) => {
6792
6793
  id: MessageComposer.generateId(),
6793
6794
  pollId: null,
6794
6795
  quotedMessage: null,
6795
- showReplyInChannel: false
6796
+ showReplyInChannel: false,
6797
+ editedMessage: null
6796
6798
  };
6797
6799
  }
6798
6800
  const quotedMessage = composition.quoted_message;
6801
+ const editedMessage = compositionIsDraftResponse(composition) ? null : formatMessage(composition);
6799
6802
  let message;
6800
6803
  let draftId = null;
6801
6804
  let id = MessageComposer.generateId();
@@ -6811,7 +6814,8 @@ var initState6 = (composition) => {
6811
6814
  id,
6812
6815
  pollId: message.poll_id ?? null,
6813
6816
  quotedMessage: quotedMessage ? formatMessage(quotedMessage) : null,
6814
- showReplyInChannel: false
6817
+ showReplyInChannel: false,
6818
+ editedMessage
6815
6819
  };
6816
6820
  };
6817
6821
  var _MessageComposer = class _MessageComposer extends WithSubscriptions {
@@ -6823,6 +6827,9 @@ var _MessageComposer = class _MessageComposer extends WithSubscriptions {
6823
6827
  client
6824
6828
  }) {
6825
6829
  super();
6830
+ this.setEditedMessage = (editedMessage) => {
6831
+ this.state.partialNext({ editedMessage: editedMessage ?? null });
6832
+ };
6826
6833
  this.refreshId = () => {
6827
6834
  this.state.partialNext({ id: _MessageComposer.generateId() });
6828
6835
  };
@@ -6838,9 +6845,6 @@ var _MessageComposer = class _MessageComposer extends WithSubscriptions {
6838
6845
  this.pollComposer.initState();
6839
6846
  this.customDataManager.initState({ message });
6840
6847
  this.state.next(initState6(composition));
6841
- if (composition && !compositionIsDraftResponse(composition) && message && isLocalMessage(message)) {
6842
- this.editedMessage = message;
6843
- }
6844
6848
  };
6845
6849
  this.initStateFromChannelResponse = (channelApiResponse) => {
6846
6850
  if (this.channel.cid !== channelApiResponse.channel.cid) {
@@ -7257,7 +7261,6 @@ var _MessageComposer = class _MessageComposer extends WithSubscriptions {
7257
7261
  message = composition.message;
7258
7262
  } else if (composition) {
7259
7263
  message = formatMessage(composition);
7260
- this.editedMessage = message;
7261
7264
  }
7262
7265
  this.attachmentManager = new AttachmentManager({ composer: this, message });
7263
7266
  this.linkPreviewsManager = new LinkPreviewsManager({ composer: this, message });
@@ -7294,6 +7297,12 @@ var _MessageComposer = class _MessageComposer extends WithSubscriptions {
7294
7297
  get config() {
7295
7298
  return this.configState.getLatestValue();
7296
7299
  }
7300
+ get editedMessage() {
7301
+ return this.state.getLatestValue().editedMessage ?? void 0;
7302
+ }
7303
+ set editedMessage(editedMessage) {
7304
+ this.state.partialNext({ editedMessage: editedMessage ?? null });
7305
+ }
7297
7306
  get contextType() {
7298
7307
  return _MessageComposer.evaluateContextType(this.compositionContext);
7299
7308
  }
@@ -14905,7 +14914,7 @@ var StreamChat = class _StreamChat {
14905
14914
  if (this.userAgent) {
14906
14915
  return this.userAgent;
14907
14916
  }
14908
- const version = "9.30.1";
14917
+ const version = "9.32.0";
14909
14918
  const clientBundle = "browser-esm";
14910
14919
  let userAgentString = "";
14911
14920
  if (this.sdkIdentifier) {
@@ -16002,6 +16011,27 @@ var StreamChat = class _StreamChat {
16002
16011
  ...rest
16003
16012
  });
16004
16013
  }
16014
+ /**
16015
+ * queryTeamUsageStats - Queries team-level usage statistics from the warehouse database
16016
+ *
16017
+ * Returns all 16 metrics grouped by team with cursor-based pagination.
16018
+ *
16019
+ * Date Range Options (mutually exclusive):
16020
+ * - Use 'month' parameter (YYYY-MM format) for monthly aggregated values
16021
+ * - Use 'start_date'/'end_date' parameters (YYYY-MM-DD format) for daily breakdown
16022
+ * - If neither provided, defaults to current month (monthly mode)
16023
+ *
16024
+ * This endpoint is server-side only.
16025
+ *
16026
+ * @param {QueryTeamUsageStatsOptions} options The options for querying team usage stats
16027
+ * @returns {Promise<QueryTeamUsageStatsResponse>}
16028
+ */
16029
+ async queryTeamUsageStats(options = {}) {
16030
+ return await this.post(
16031
+ `${this.baseURL}/stats/team_usage`,
16032
+ options
16033
+ );
16034
+ }
16005
16035
  /**
16006
16036
  * updateLocation - Updates a location
16007
16037
  *
@@ -17489,6 +17519,7 @@ export {
17489
17519
  isFileAttachment,
17490
17520
  isFileList,
17491
17521
  isFileReference,
17522
+ isGiphyAttachment,
17492
17523
  isImageAttachment,
17493
17524
  isImageFile,
17494
17525
  isLocalAttachment,