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.
- package/dist/cjs/index.browser.js +38 -7
- package/dist/cjs/index.browser.js.map +2 -2
- package/dist/cjs/index.node.js +39 -7
- package/dist/cjs/index.node.js.map +2 -2
- package/dist/esm/index.mjs +38 -7
- package/dist/esm/index.mjs.map +2 -2
- package/dist/types/client.d.ts +19 -1
- package/dist/types/messageComposer/attachmentIdentity.d.ts +2 -1
- package/dist/types/messageComposer/messageComposer.d.ts +8 -1
- package/dist/types/messageComposer/middleware/textComposer/commands.d.ts +2 -2
- package/dist/types/messageComposer/types.d.ts +8 -1
- package/dist/types/types.d.ts +114 -2
- package/dist/types/utils.d.ts +1 -0
- package/package.json +1 -1
- package/src/client.ts +24 -0
- package/src/messageComposer/attachmentIdentity.ts +5 -0
- package/src/messageComposer/messageComposer.ts +22 -10
- package/src/messageComposer/types.ts +9 -1
- package/src/types.ts +127 -2
|
@@ -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);
|
|
@@ -6980,10 +6982,12 @@ var initState6 = (composition) => {
|
|
|
6980
6982
|
id: MessageComposer.generateId(),
|
|
6981
6983
|
pollId: null,
|
|
6982
6984
|
quotedMessage: null,
|
|
6983
|
-
showReplyInChannel: false
|
|
6985
|
+
showReplyInChannel: false,
|
|
6986
|
+
editedMessage: null
|
|
6984
6987
|
};
|
|
6985
6988
|
}
|
|
6986
6989
|
const quotedMessage = composition.quoted_message;
|
|
6990
|
+
const editedMessage = compositionIsDraftResponse(composition) ? null : formatMessage(composition);
|
|
6987
6991
|
let message;
|
|
6988
6992
|
let draftId = null;
|
|
6989
6993
|
let id = MessageComposer.generateId();
|
|
@@ -6999,7 +7003,8 @@ var initState6 = (composition) => {
|
|
|
6999
7003
|
id,
|
|
7000
7004
|
pollId: message.poll_id ?? null,
|
|
7001
7005
|
quotedMessage: quotedMessage ? formatMessage(quotedMessage) : null,
|
|
7002
|
-
showReplyInChannel: false
|
|
7006
|
+
showReplyInChannel: false,
|
|
7007
|
+
editedMessage
|
|
7003
7008
|
};
|
|
7004
7009
|
};
|
|
7005
7010
|
var _MessageComposer = class _MessageComposer extends WithSubscriptions {
|
|
@@ -7011,6 +7016,9 @@ var _MessageComposer = class _MessageComposer extends WithSubscriptions {
|
|
|
7011
7016
|
client
|
|
7012
7017
|
}) {
|
|
7013
7018
|
super();
|
|
7019
|
+
this.setEditedMessage = (editedMessage) => {
|
|
7020
|
+
this.state.partialNext({ editedMessage: editedMessage ?? null });
|
|
7021
|
+
};
|
|
7014
7022
|
this.refreshId = () => {
|
|
7015
7023
|
this.state.partialNext({ id: _MessageComposer.generateId() });
|
|
7016
7024
|
};
|
|
@@ -7026,9 +7034,6 @@ var _MessageComposer = class _MessageComposer extends WithSubscriptions {
|
|
|
7026
7034
|
this.pollComposer.initState();
|
|
7027
7035
|
this.customDataManager.initState({ message });
|
|
7028
7036
|
this.state.next(initState6(composition));
|
|
7029
|
-
if (composition && !compositionIsDraftResponse(composition) && message && isLocalMessage(message)) {
|
|
7030
|
-
this.editedMessage = message;
|
|
7031
|
-
}
|
|
7032
7037
|
};
|
|
7033
7038
|
this.initStateFromChannelResponse = (channelApiResponse) => {
|
|
7034
7039
|
if (this.channel.cid !== channelApiResponse.channel.cid) {
|
|
@@ -7445,7 +7450,6 @@ var _MessageComposer = class _MessageComposer extends WithSubscriptions {
|
|
|
7445
7450
|
message = composition.message;
|
|
7446
7451
|
} else if (composition) {
|
|
7447
7452
|
message = formatMessage(composition);
|
|
7448
|
-
this.editedMessage = message;
|
|
7449
7453
|
}
|
|
7450
7454
|
this.attachmentManager = new AttachmentManager({ composer: this, message });
|
|
7451
7455
|
this.linkPreviewsManager = new LinkPreviewsManager({ composer: this, message });
|
|
@@ -7482,6 +7486,12 @@ var _MessageComposer = class _MessageComposer extends WithSubscriptions {
|
|
|
7482
7486
|
get config() {
|
|
7483
7487
|
return this.configState.getLatestValue();
|
|
7484
7488
|
}
|
|
7489
|
+
get editedMessage() {
|
|
7490
|
+
return this.state.getLatestValue().editedMessage ?? void 0;
|
|
7491
|
+
}
|
|
7492
|
+
set editedMessage(editedMessage) {
|
|
7493
|
+
this.state.partialNext({ editedMessage: editedMessage ?? null });
|
|
7494
|
+
}
|
|
7485
7495
|
get contextType() {
|
|
7486
7496
|
return _MessageComposer.evaluateContextType(this.compositionContext);
|
|
7487
7497
|
}
|
|
@@ -15093,7 +15103,7 @@ var StreamChat = class _StreamChat {
|
|
|
15093
15103
|
if (this.userAgent) {
|
|
15094
15104
|
return this.userAgent;
|
|
15095
15105
|
}
|
|
15096
|
-
const version = "9.
|
|
15106
|
+
const version = "9.32.0";
|
|
15097
15107
|
const clientBundle = "browser-cjs";
|
|
15098
15108
|
let userAgentString = "";
|
|
15099
15109
|
if (this.sdkIdentifier) {
|
|
@@ -16190,6 +16200,27 @@ var StreamChat = class _StreamChat {
|
|
|
16190
16200
|
...rest
|
|
16191
16201
|
});
|
|
16192
16202
|
}
|
|
16203
|
+
/**
|
|
16204
|
+
* queryTeamUsageStats - Queries team-level usage statistics from the warehouse database
|
|
16205
|
+
*
|
|
16206
|
+
* Returns all 16 metrics grouped by team with cursor-based pagination.
|
|
16207
|
+
*
|
|
16208
|
+
* Date Range Options (mutually exclusive):
|
|
16209
|
+
* - Use 'month' parameter (YYYY-MM format) for monthly aggregated values
|
|
16210
|
+
* - Use 'start_date'/'end_date' parameters (YYYY-MM-DD format) for daily breakdown
|
|
16211
|
+
* - If neither provided, defaults to current month (monthly mode)
|
|
16212
|
+
*
|
|
16213
|
+
* This endpoint is server-side only.
|
|
16214
|
+
*
|
|
16215
|
+
* @param {QueryTeamUsageStatsOptions} options The options for querying team usage stats
|
|
16216
|
+
* @returns {Promise<QueryTeamUsageStatsResponse>}
|
|
16217
|
+
*/
|
|
16218
|
+
async queryTeamUsageStats(options = {}) {
|
|
16219
|
+
return await this.post(
|
|
16220
|
+
`${this.baseURL}/stats/team_usage`,
|
|
16221
|
+
options
|
|
16222
|
+
);
|
|
16223
|
+
}
|
|
16193
16224
|
/**
|
|
16194
16225
|
* updateLocation - Updates a location
|
|
16195
16226
|
*
|