stream-chat 9.31.0 → 9.33.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.
@@ -197,6 +197,7 @@ __export(index_exports, {
197
197
  isFileAttachment: () => isFileAttachment,
198
198
  isFileList: () => isFileList,
199
199
  isFileReference: () => isFileReference,
200
+ isGiphyAttachment: () => isGiphyAttachment,
200
201
  isImageAttachment: () => isImageAttachment,
201
202
  isImageFile: () => isImageFile,
202
203
  isLocalAttachment: () => isLocalAttachment,
@@ -2541,6 +2542,7 @@ var isVideoAttachment = (attachment, supportedVideoFormat = []) => attachment.ty
2541
2542
  var isLocalVideoAttachment = (attachment) => isVideoAttachment(attachment) && isLocalAttachment(attachment);
2542
2543
  var isUploadedAttachment = (attachment) => isAudioAttachment(attachment) || isFileAttachment(attachment) || isImageAttachment(attachment) || isVideoAttachment(attachment) || isVoiceRecordingAttachment(attachment);
2543
2544
  var isSharedLocationResponse = (location) => !!location.latitude && !!location.longitude && !!location.channel_cid;
2545
+ var isGiphyAttachment = (attachment) => attachment.type === "giphy";
2544
2546
 
2545
2547
  // src/messageComposer/fileUtils.ts
2546
2548
  var isFile = (fileLike) => !!fileLike.lastModified && !("uri" in fileLike);
@@ -4118,11 +4120,20 @@ var defaultPollFieldBlurEventValidators = {
4118
4120
  }
4119
4121
  };
4120
4122
  var isTargetedOptionTextUpdate = (value) => !Array.isArray(value) && typeof value?.index === "number" && typeof value?.text === "string";
4123
+ var clampMaxVotesAllowed = (value) => {
4124
+ if (value === "" || value == null) return "";
4125
+ const num = typeof value === "string" ? parseInt(value, 10) : Number(value);
4126
+ if (!Number.isInteger(num) || Number.isNaN(num)) return "";
4127
+ return String(Math.min(10, Math.max(2, num)));
4128
+ };
4121
4129
  var pollCompositionStateProcessors = {
4122
4130
  enforce_unique_vote: ({ value }) => ({
4123
4131
  enforce_unique_vote: value,
4124
4132
  max_votes_allowed: ""
4125
4133
  }),
4134
+ max_votes_allowed: ({ value }) => ({
4135
+ max_votes_allowed: clampMaxVotesAllowed(value)
4136
+ }),
4126
4137
  options: ({ value, data }) => {
4127
4138
  if (Array.isArray(value)) {
4128
4139
  return {
@@ -11906,7 +11917,6 @@ var DEFAULT_CHANNEL_MANAGER_OPTIONS = {
11906
11917
  lockChannelOrder: false
11907
11918
  };
11908
11919
  var DEFAULT_CHANNEL_MANAGER_PAGINATION_OPTIONS = {
11909
- limit: 10,
11910
11920
  offset: 0
11911
11921
  };
11912
11922
  var ChannelManager = class extends WithSubscriptions {
@@ -11980,7 +11990,7 @@ var ChannelManager = class extends WithSubscriptions {
11980
11990
  channels,
11981
11991
  pagination: {
11982
11992
  ...pagination,
11983
- hasNext: (channels?.length ?? 0) >= limit,
11993
+ hasNext: (channels?.length ?? 0) >= (limit ?? 1),
11984
11994
  isLoading: false,
11985
11995
  options: newOptions
11986
11996
  },
@@ -12105,7 +12115,7 @@ var ChannelManager = class extends WithSubscriptions {
12105
12115
  channels: uniqBy([...channels || [], ...nextChannels], "cid"),
12106
12116
  pagination: {
12107
12117
  ...pagination,
12108
- hasNext: (nextChannels?.length ?? 0) >= limit,
12118
+ hasNext: (nextChannels?.length ?? 0) >= (limit ?? 1),
12109
12119
  isLoading: false,
12110
12120
  isLoadingNext: false,
12111
12121
  options: newOptions
@@ -15101,7 +15111,7 @@ var StreamChat = class _StreamChat {
15101
15111
  if (this.userAgent) {
15102
15112
  return this.userAgent;
15103
15113
  }
15104
- const version = "9.31.0";
15114
+ const version = "9.33.0";
15105
15115
  const clientBundle = "browser-cjs";
15106
15116
  let userAgentString = "";
15107
15117
  if (this.sdkIdentifier) {
@@ -16198,6 +16208,27 @@ var StreamChat = class _StreamChat {
16198
16208
  ...rest
16199
16209
  });
16200
16210
  }
16211
+ /**
16212
+ * queryTeamUsageStats - Queries team-level usage statistics from the warehouse database
16213
+ *
16214
+ * Returns all 16 metrics grouped by team with cursor-based pagination.
16215
+ *
16216
+ * Date Range Options (mutually exclusive):
16217
+ * - Use 'month' parameter (YYYY-MM format) for monthly aggregated values
16218
+ * - Use 'start_date'/'end_date' parameters (YYYY-MM-DD format) for daily breakdown
16219
+ * - If neither provided, defaults to current month (monthly mode)
16220
+ *
16221
+ * This endpoint is server-side only.
16222
+ *
16223
+ * @param {QueryTeamUsageStatsOptions} options The options for querying team usage stats
16224
+ * @returns {Promise<QueryTeamUsageStatsResponse>}
16225
+ */
16226
+ async queryTeamUsageStats(options = {}) {
16227
+ return await this.post(
16228
+ `${this.baseURL}/stats/team_usage`,
16229
+ options
16230
+ );
16231
+ }
16201
16232
  /**
16202
16233
  * updateLocation - Updates a location
16203
16234
  *