stream-chat 9.43.0 → 9.43.2
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 +17 -13
- package/dist/cjs/index.browser.js.map +2 -2
- package/dist/cjs/index.node.js +22 -13
- package/dist/cjs/index.node.js.map +2 -2
- package/dist/esm/index.mjs +17 -13
- package/dist/esm/index.mjs.map +2 -2
- package/dist/types/client.d.ts +8 -6
- package/dist/types/messageComposer/attachmentManager.d.ts +1 -1
- package/dist/types/messageComposer/middleware/textComposer/index.d.ts +1 -0
- package/dist/types/types.d.ts +140 -19
- package/dist/types/utils.d.ts +4 -2
- package/package.json +1 -1
- package/src/client.ts +22 -17
- package/src/connection.ts +5 -4
- package/src/messageComposer/MessageComposerEffectHandlers.ts +2 -0
- package/src/messageComposer/attachmentManager.ts +1 -2
- package/src/messageComposer/middleware/textComposer/index.ts +1 -0
- package/src/types.ts +160 -19
package/dist/cjs/index.node.js
CHANGED
|
@@ -161,12 +161,15 @@ __export(index_exports, {
|
|
|
161
161
|
defaultPollFieldChangeEventValidators: () => defaultPollFieldChangeEventValidators,
|
|
162
162
|
encodeBase64: () => encodeBase64,
|
|
163
163
|
ensureIsLocalAttachment: () => ensureIsLocalAttachment,
|
|
164
|
+
escapeCommandRegExp: () => escapeCommandRegExp,
|
|
164
165
|
extractPollData: () => extractPollData,
|
|
165
166
|
extractPollEnrichedData: () => extractPollEnrichedData,
|
|
166
167
|
formatMessage: () => formatMessage,
|
|
167
168
|
generateFileName: () => generateFileName,
|
|
168
169
|
getAttachmentTypeFromMimeType: () => getAttachmentTypeFromMimeType,
|
|
170
|
+
getCompleteCommandInString: () => getCompleteCommandInString,
|
|
169
171
|
getExtensionFromMimeType: () => getExtensionFromMimeType,
|
|
172
|
+
getRawCommandName: () => getRawCommandName,
|
|
170
173
|
getTokenizedSuggestionDisplayName: () => getTokenizedSuggestionDisplayName,
|
|
171
174
|
getTriggerCharWithToken: () => getTriggerCharWithToken,
|
|
172
175
|
insertItemWithTrigger: () => insertItemWithTrigger,
|
|
@@ -198,6 +201,7 @@ __export(index_exports, {
|
|
|
198
201
|
localMessageToNewMessagePayload: () => localMessageToNewMessagePayload,
|
|
199
202
|
logChatPromiseExecution: () => logChatPromiseExecution,
|
|
200
203
|
mapPollStateToResponse: () => mapPollStateToResponse,
|
|
204
|
+
notifyCommandDisabled: () => notifyCommandDisabled,
|
|
201
205
|
pollCompositionStateProcessors: () => pollCompositionStateProcessors,
|
|
202
206
|
pollStateChangeValidators: () => pollStateChangeValidators,
|
|
203
207
|
postInsights: () => postInsights,
|
|
@@ -205,6 +209,7 @@ __export(index_exports, {
|
|
|
205
209
|
readFileAsArrayBuffer: () => readFileAsArrayBuffer,
|
|
206
210
|
removeDiacritics: () => removeDiacritics,
|
|
207
211
|
replaceWordWithEntity: () => replaceWordWithEntity,
|
|
212
|
+
stripCommandFromText: () => stripCommandFromText,
|
|
208
213
|
textIsEmpty: () => textIsEmpty,
|
|
209
214
|
timeLeftMs: () => timeLeftMs
|
|
210
215
|
});
|
|
@@ -3254,7 +3259,7 @@ var _AttachmentManager = class _AttachmentManager {
|
|
|
3254
3259
|
this.setCustomUploadFn = (doUploadRequest) => {
|
|
3255
3260
|
this.composer.updateConfig({ attachments: { doUploadRequest } });
|
|
3256
3261
|
};
|
|
3257
|
-
this.cancelAttachmentUploads = (attachments) => {
|
|
3262
|
+
this.cancelAttachmentUploads = (attachments = this.attachments) => {
|
|
3258
3263
|
for (const { localMetadata } of attachments) {
|
|
3259
3264
|
this.client.uploadManager.deleteUploadRecord(localMetadata.id);
|
|
3260
3265
|
}
|
|
@@ -3272,7 +3277,6 @@ var _AttachmentManager = class _AttachmentManager {
|
|
|
3272
3277
|
};
|
|
3273
3278
|
};
|
|
3274
3279
|
this.initState = ({ message } = {}) => {
|
|
3275
|
-
this.cancelAttachmentUploads(this.attachments);
|
|
3276
3280
|
this.state.next(initState({ message }));
|
|
3277
3281
|
};
|
|
3278
3282
|
this.getSnapshot = () => {
|
|
@@ -4139,7 +4143,9 @@ var applyCommandActivationEffect = (effect, composer) => {
|
|
|
4139
4143
|
selection: { start: 0, end: 0 },
|
|
4140
4144
|
text: ""
|
|
4141
4145
|
});
|
|
4146
|
+
const attachmentsToCancel = composer.attachmentManager.attachments;
|
|
4142
4147
|
composer.attachmentManager.initState();
|
|
4148
|
+
composer.attachmentManager.cancelAttachmentUploads(attachmentsToCancel);
|
|
4143
4149
|
composer.linkPreviewsManager.initState();
|
|
4144
4150
|
composer.locationComposer.initState();
|
|
4145
4151
|
composer.pollComposer.initState();
|
|
@@ -10434,8 +10440,9 @@ var StableWSConnection = class {
|
|
|
10434
10440
|
this.onmessage = (wsID, event) => {
|
|
10435
10441
|
if (this.wsID !== wsID) return;
|
|
10436
10442
|
this._log("onmessage() - onmessage callback", { event, wsID });
|
|
10437
|
-
|
|
10438
|
-
|
|
10443
|
+
if (typeof event.data !== "string") return;
|
|
10444
|
+
const data = JSON.parse(event.data);
|
|
10445
|
+
if (!this.isResolved) {
|
|
10439
10446
|
this.isResolved = true;
|
|
10440
10447
|
if (data.error) {
|
|
10441
10448
|
this.rejectPromise?.(this._errorFromWSEvent(data, false));
|
|
@@ -10445,10 +10452,10 @@ var StableWSConnection = class {
|
|
|
10445
10452
|
this._setHealth(true);
|
|
10446
10453
|
}
|
|
10447
10454
|
this.lastEvent = /* @__PURE__ */ new Date();
|
|
10448
|
-
if (data
|
|
10455
|
+
if (data.type === "health.check") {
|
|
10449
10456
|
this.scheduleNextPing();
|
|
10450
10457
|
}
|
|
10451
|
-
this.client.
|
|
10458
|
+
this.client.dispatchEvent(data);
|
|
10452
10459
|
this.scheduleConnectionCheck();
|
|
10453
10460
|
};
|
|
10454
10461
|
this.onclose = (wsID, event) => {
|
|
@@ -13551,11 +13558,6 @@ var StreamChat = class _StreamChat {
|
|
|
13551
13558
|
method: `handleEvent;${event.type}`
|
|
13552
13559
|
});
|
|
13553
13560
|
};
|
|
13554
|
-
this.handleEvent = (messageEvent) => {
|
|
13555
|
-
const jsonString = messageEvent.data;
|
|
13556
|
-
const event = JSON.parse(jsonString);
|
|
13557
|
-
this.dispatchEvent(event);
|
|
13558
|
-
};
|
|
13559
13561
|
/**
|
|
13560
13562
|
* Updates the members, watchers and read references of the currently active channels that contain this user
|
|
13561
13563
|
*
|
|
@@ -14472,15 +14474,17 @@ var StreamChat = class _StreamChat {
|
|
|
14472
14474
|
defaultOptions.watch = false;
|
|
14473
14475
|
}
|
|
14474
14476
|
const { predefined_filter, filter_values, sort_values, ...restOptions } = options;
|
|
14477
|
+
const normalizedSort = normalizeQuerySort(sort);
|
|
14475
14478
|
const payload = predefined_filter ? {
|
|
14476
14479
|
predefined_filter,
|
|
14477
14480
|
filter_values,
|
|
14478
14481
|
sort_values,
|
|
14482
|
+
sort: normalizedSort,
|
|
14479
14483
|
...defaultOptions,
|
|
14480
14484
|
...restOptions
|
|
14481
14485
|
} : {
|
|
14482
14486
|
filter_conditions: filterConditions,
|
|
14483
|
-
sort:
|
|
14487
|
+
sort: normalizedSort,
|
|
14484
14488
|
...defaultOptions,
|
|
14485
14489
|
...restOptions
|
|
14486
14490
|
};
|
|
@@ -15643,7 +15647,7 @@ var StreamChat = class _StreamChat {
|
|
|
15643
15647
|
if (this.userAgent) {
|
|
15644
15648
|
return this.userAgent;
|
|
15645
15649
|
}
|
|
15646
|
-
const version = "9.43.
|
|
15650
|
+
const version = "9.43.2";
|
|
15647
15651
|
const clientBundle = "node-cjs";
|
|
15648
15652
|
let userAgentString = "";
|
|
15649
15653
|
if (this.sdkIdentifier) {
|
|
@@ -18377,12 +18381,15 @@ var FixedSizeQueueCache = class {
|
|
|
18377
18381
|
defaultPollFieldChangeEventValidators,
|
|
18378
18382
|
encodeBase64,
|
|
18379
18383
|
ensureIsLocalAttachment,
|
|
18384
|
+
escapeCommandRegExp,
|
|
18380
18385
|
extractPollData,
|
|
18381
18386
|
extractPollEnrichedData,
|
|
18382
18387
|
formatMessage,
|
|
18383
18388
|
generateFileName,
|
|
18384
18389
|
getAttachmentTypeFromMimeType,
|
|
18390
|
+
getCompleteCommandInString,
|
|
18385
18391
|
getExtensionFromMimeType,
|
|
18392
|
+
getRawCommandName,
|
|
18386
18393
|
getTokenizedSuggestionDisplayName,
|
|
18387
18394
|
getTriggerCharWithToken,
|
|
18388
18395
|
insertItemWithTrigger,
|
|
@@ -18414,6 +18421,7 @@ var FixedSizeQueueCache = class {
|
|
|
18414
18421
|
localMessageToNewMessagePayload,
|
|
18415
18422
|
logChatPromiseExecution,
|
|
18416
18423
|
mapPollStateToResponse,
|
|
18424
|
+
notifyCommandDisabled,
|
|
18417
18425
|
pollCompositionStateProcessors,
|
|
18418
18426
|
pollStateChangeValidators,
|
|
18419
18427
|
postInsights,
|
|
@@ -18421,6 +18429,7 @@ var FixedSizeQueueCache = class {
|
|
|
18421
18429
|
readFileAsArrayBuffer,
|
|
18422
18430
|
removeDiacritics,
|
|
18423
18431
|
replaceWordWithEntity,
|
|
18432
|
+
stripCommandFromText,
|
|
18424
18433
|
textIsEmpty,
|
|
18425
18434
|
timeLeftMs
|
|
18426
18435
|
});
|