webitel-sdk 23.7.14 → 23.7.15
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/bundles/index.esm.js +18 -6
- package/bundles/index.esm.js.map +1 -1
- package/bundles/index.esm.min.js +1 -1
- package/bundles/index.esm.min.js.map +1 -1
- package/bundles/index.umd.js +18 -6
- package/bundles/index.umd.js.map +1 -1
- package/bundles/index.umd.min.js +1 -1
- package/bundles/index.umd.min.js.map +1 -1
- package/esm2015/socket/client.js +16 -4
- package/esm2015/socket/client.js.map +1 -1
- package/esm2015/socket/conversation.js +2 -2
- package/esm2015/socket/conversation.js.map +1 -1
- package/esm5/socket/client.js +16 -4
- package/esm5/socket/client.js.map +1 -1
- package/esm5/socket/conversation.js +2 -2
- package/esm5/socket/conversation.js.map +1 -1
- package/package.json +1 -1
- package/types/socket/client.d.ts +3 -2
- package/types/socket/client.d.ts.map +1 -1
package/bundles/index.esm.js
CHANGED
|
@@ -44079,8 +44079,8 @@ class Conversation {
|
|
|
44079
44079
|
};
|
|
44080
44080
|
if (i.hasOwnProperty('file')) {
|
|
44081
44081
|
if (i.file && i.file.id > 0) {
|
|
44082
|
-
i.file.url = this.client.fileUrlDownload(i.file.id);
|
|
44083
|
-
i.file.streamUrl = this.client.fileUrlStream(i.file.id);
|
|
44082
|
+
i.file.url = this.client.fileUrlDownload(i.file.id, i.file.mime);
|
|
44083
|
+
i.file.streamUrl = this.client.fileUrlStream(i.file.id, i.file.mime);
|
|
44084
44084
|
}
|
|
44085
44085
|
msg.file = i.file;
|
|
44086
44086
|
}
|
|
@@ -44809,11 +44809,13 @@ class Client extends EventEmitter {
|
|
|
44809
44809
|
}
|
|
44810
44810
|
return data;
|
|
44811
44811
|
}
|
|
44812
|
-
fileUrlDownload(fileId) {
|
|
44813
|
-
|
|
44812
|
+
fileUrlDownload(fileId, mime) {
|
|
44813
|
+
const params = this.fileUrlParams(mime);
|
|
44814
|
+
return `${this.basePath}/api/storage/file/${fileId}/download?${params.join('&')}`;
|
|
44814
44815
|
}
|
|
44815
|
-
fileUrlStream(fileId) {
|
|
44816
|
-
|
|
44816
|
+
fileUrlStream(fileId, mime) {
|
|
44817
|
+
const params = this.fileUrlParams(mime);
|
|
44818
|
+
return `${this.basePath}/api/storage/file/${fileId}/stream?${params.join('&')}`;
|
|
44817
44819
|
}
|
|
44818
44820
|
handleError(e) {
|
|
44819
44821
|
if (e) {
|
|
@@ -45187,6 +45189,16 @@ class Client extends EventEmitter {
|
|
|
45187
45189
|
this.callStore.delete(call.id);
|
|
45188
45190
|
this.eventHandler.emit(WEBSOCKET_EVENT_CALL, CallActions.Destroy, call);
|
|
45189
45191
|
}
|
|
45192
|
+
fileUrlParams(mime) {
|
|
45193
|
+
const params = [`access_token=${this._config.token}`];
|
|
45194
|
+
if (mime) {
|
|
45195
|
+
const source = mime.replace(/.*;source=([-._A-Za-z0-9/]+).*/, '$1');
|
|
45196
|
+
if (source) {
|
|
45197
|
+
params.push(`source=${source}`);
|
|
45198
|
+
}
|
|
45199
|
+
}
|
|
45200
|
+
return params;
|
|
45201
|
+
}
|
|
45190
45202
|
}
|
|
45191
45203
|
function isJobTask(task) {
|
|
45192
45204
|
return task.channel === ChannelName.Task;
|