webitel-sdk 23.9.4 → 23.9.5
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 +44 -30
- 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 +46 -32
- 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 +44 -30
- package/esm2015/socket/client.js.map +1 -1
- package/esm5/socket/client.js +46 -32
- package/esm5/socket/client.js.map +1 -1
- package/package.json +1 -1
- package/types/socket/client.d.ts +1 -0
- package/types/socket/client.d.ts.map +1 -1
package/bundles/index.umd.js
CHANGED
|
@@ -50306,7 +50306,7 @@
|
|
|
50306
50306
|
};
|
|
50307
50307
|
Client.prototype.subscribeCall = function (handler, data) {
|
|
50308
50308
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
50309
|
-
var calls, _i, _a, c, e, call;
|
|
50309
|
+
var calls, _i, _a, c, e, call, task;
|
|
50310
50310
|
return tslib.__generator(this, function (_b) {
|
|
50311
50311
|
switch (_b.label) {
|
|
50312
50312
|
case 0: return [4 /*yield*/, this.request("subscribe_call", data)];
|
|
@@ -50348,22 +50348,26 @@
|
|
|
50348
50348
|
call.hangupAt = c.hangup_at || 0;
|
|
50349
50349
|
// call.reportingAt = c.reporting_at || 0
|
|
50350
50350
|
if (c.task) {
|
|
50351
|
-
|
|
50352
|
-
|
|
50353
|
-
|
|
50354
|
-
|
|
50355
|
-
|
|
50356
|
-
|
|
50357
|
-
|
|
50358
|
-
|
|
50359
|
-
|
|
50360
|
-
|
|
50361
|
-
|
|
50362
|
-
|
|
50363
|
-
|
|
50364
|
-
|
|
50365
|
-
|
|
50351
|
+
task = this.getTask(c.task.attempt_id);
|
|
50352
|
+
if (!task) {
|
|
50353
|
+
task = new Task(this, {
|
|
50354
|
+
attempt_id: c.task.attempt_id,
|
|
50355
|
+
channel: c.task.channel,
|
|
50356
|
+
status: c.task.status,
|
|
50357
|
+
timestamp: Date.now(),
|
|
50358
|
+
}, c.task);
|
|
50359
|
+
task.form = c.task.form || null;
|
|
50360
|
+
if (c.leaving_at && c.task.processing_sec) {
|
|
50361
|
+
task.startProcessingAt = c.leaving_at;
|
|
50362
|
+
task.setProcessing(c.leaving_at, {
|
|
50363
|
+
sec: c.task.processing_sec || 0,
|
|
50364
|
+
timeout: c.task.processing_timeout_at || null,
|
|
50365
|
+
renewal_sec: c.task.processing_renewal_sec || 0,
|
|
50366
|
+
});
|
|
50367
|
+
}
|
|
50366
50368
|
}
|
|
50369
|
+
call.task = task;
|
|
50370
|
+
call.queue.reporting = 'true';
|
|
50367
50371
|
}
|
|
50368
50372
|
this.callStore.set(call.id, call);
|
|
50369
50373
|
}
|
|
@@ -50375,7 +50379,7 @@
|
|
|
50375
50379
|
};
|
|
50376
50380
|
Client.prototype.subscribeChat = function (handler, data) {
|
|
50377
50381
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
50378
|
-
var res, _i, _a, conv, messages, c;
|
|
50382
|
+
var res, _i, _a, conv, messages, c, task;
|
|
50379
50383
|
return tslib.__generator(this, function (_b) {
|
|
50380
50384
|
switch (_b.label) {
|
|
50381
50385
|
case 0: return [4 /*yield*/, this.request("subscribe_chat", data)];
|
|
@@ -50390,22 +50394,26 @@
|
|
|
50390
50394
|
c.createdAt = conv.created_at;
|
|
50391
50395
|
c.closedAt = conv.closed_at;
|
|
50392
50396
|
if (conv.task) {
|
|
50393
|
-
|
|
50394
|
-
|
|
50395
|
-
|
|
50396
|
-
|
|
50397
|
-
|
|
50398
|
-
|
|
50399
|
-
|
|
50400
|
-
|
|
50401
|
-
|
|
50402
|
-
|
|
50403
|
-
|
|
50404
|
-
|
|
50405
|
-
|
|
50406
|
-
|
|
50397
|
+
task = this.getTask(conv.task.attempt_id);
|
|
50398
|
+
if (!task) {
|
|
50399
|
+
task = new Task(this, {
|
|
50400
|
+
attempt_id: conv.task.attempt_id,
|
|
50401
|
+
channel: conv.task.channel,
|
|
50402
|
+
status: conv.task.status,
|
|
50403
|
+
timestamp: Date.now(),
|
|
50404
|
+
}, conv.task // todo add app_id
|
|
50405
|
+
);
|
|
50406
|
+
if (conv.leaving_at && conv.task.processing_sec) {
|
|
50407
|
+
task.startProcessingAt = conv.leaving_at;
|
|
50408
|
+
task.setProcessing(conv.leaving_at, {
|
|
50409
|
+
sec: conv.task.processing_sec || 0,
|
|
50410
|
+
timeout: conv.task.processing_timeout_at || null,
|
|
50411
|
+
renewal_sec: conv.task.processing_renewal_sec || 0,
|
|
50412
|
+
});
|
|
50413
|
+
}
|
|
50414
|
+
task.form = conv.task.form || null;
|
|
50407
50415
|
}
|
|
50408
|
-
c.task
|
|
50416
|
+
c.task = task;
|
|
50409
50417
|
}
|
|
50410
50418
|
if (conv.invite_id) {
|
|
50411
50419
|
c.setInvite(conv.invite_id, conv.created_at);
|
|
@@ -50457,6 +50465,12 @@
|
|
|
50457
50465
|
});
|
|
50458
50466
|
});
|
|
50459
50467
|
};
|
|
50468
|
+
Client.prototype.getTask = function (id) {
|
|
50469
|
+
if (!this.agent) {
|
|
50470
|
+
return undefined;
|
|
50471
|
+
}
|
|
50472
|
+
return this.agent.task.get(id);
|
|
50473
|
+
};
|
|
50460
50474
|
Client.prototype.subscribeTask = function (handler) {
|
|
50461
50475
|
this.eventHandler.on(TASK_EVENT, handler);
|
|
50462
50476
|
};
|