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.esm.js
CHANGED
|
@@ -45440,22 +45440,26 @@ class Client extends EventEmitter {
|
|
|
45440
45440
|
call.hangupAt = c.hangup_at || 0;
|
|
45441
45441
|
// call.reportingAt = c.reporting_at || 0
|
|
45442
45442
|
if (c.task) {
|
|
45443
|
-
|
|
45444
|
-
|
|
45445
|
-
|
|
45446
|
-
|
|
45447
|
-
|
|
45448
|
-
|
|
45449
|
-
|
|
45450
|
-
|
|
45451
|
-
|
|
45452
|
-
|
|
45453
|
-
|
|
45454
|
-
|
|
45455
|
-
|
|
45456
|
-
|
|
45457
|
-
|
|
45443
|
+
let task = this.getTask(c.task.attempt_id);
|
|
45444
|
+
if (!task) {
|
|
45445
|
+
task = new Task(this, {
|
|
45446
|
+
attempt_id: c.task.attempt_id,
|
|
45447
|
+
channel: c.task.channel,
|
|
45448
|
+
status: c.task.status,
|
|
45449
|
+
timestamp: Date.now(),
|
|
45450
|
+
}, c.task);
|
|
45451
|
+
task.form = c.task.form || null;
|
|
45452
|
+
if (c.leaving_at && c.task.processing_sec) {
|
|
45453
|
+
task.startProcessingAt = c.leaving_at;
|
|
45454
|
+
task.setProcessing(c.leaving_at, {
|
|
45455
|
+
sec: c.task.processing_sec || 0,
|
|
45456
|
+
timeout: c.task.processing_timeout_at || null,
|
|
45457
|
+
renewal_sec: c.task.processing_renewal_sec || 0,
|
|
45458
|
+
});
|
|
45459
|
+
}
|
|
45458
45460
|
}
|
|
45461
|
+
call.task = task;
|
|
45462
|
+
call.queue.reporting = 'true';
|
|
45459
45463
|
}
|
|
45460
45464
|
this.callStore.set(call.id, call);
|
|
45461
45465
|
}
|
|
@@ -45473,22 +45477,26 @@ class Client extends EventEmitter {
|
|
|
45473
45477
|
c.createdAt = conv.created_at;
|
|
45474
45478
|
c.closedAt = conv.closed_at;
|
|
45475
45479
|
if (conv.task) {
|
|
45476
|
-
|
|
45477
|
-
|
|
45478
|
-
|
|
45479
|
-
|
|
45480
|
-
|
|
45481
|
-
|
|
45482
|
-
|
|
45483
|
-
|
|
45484
|
-
|
|
45485
|
-
|
|
45486
|
-
|
|
45487
|
-
|
|
45488
|
-
|
|
45489
|
-
|
|
45480
|
+
let task = this.getTask(conv.task.attempt_id);
|
|
45481
|
+
if (!task) {
|
|
45482
|
+
task = new Task(this, {
|
|
45483
|
+
attempt_id: conv.task.attempt_id,
|
|
45484
|
+
channel: conv.task.channel,
|
|
45485
|
+
status: conv.task.status,
|
|
45486
|
+
timestamp: Date.now(),
|
|
45487
|
+
}, conv.task // todo add app_id
|
|
45488
|
+
);
|
|
45489
|
+
if (conv.leaving_at && conv.task.processing_sec) {
|
|
45490
|
+
task.startProcessingAt = conv.leaving_at;
|
|
45491
|
+
task.setProcessing(conv.leaving_at, {
|
|
45492
|
+
sec: conv.task.processing_sec || 0,
|
|
45493
|
+
timeout: conv.task.processing_timeout_at || null,
|
|
45494
|
+
renewal_sec: conv.task.processing_renewal_sec || 0,
|
|
45495
|
+
});
|
|
45496
|
+
}
|
|
45497
|
+
task.form = conv.task.form || null;
|
|
45490
45498
|
}
|
|
45491
|
-
c.task
|
|
45499
|
+
c.task = task;
|
|
45492
45500
|
}
|
|
45493
45501
|
if (conv.invite_id) {
|
|
45494
45502
|
c.setInvite(conv.invite_id, conv.created_at);
|
|
@@ -45519,6 +45527,12 @@ class Client extends EventEmitter {
|
|
|
45519
45527
|
this.eventHandler.on(WEBSOCKET_EVENT_AGENT_STATUS, handler);
|
|
45520
45528
|
return res;
|
|
45521
45529
|
}
|
|
45530
|
+
getTask(id) {
|
|
45531
|
+
if (!this.agent) {
|
|
45532
|
+
return undefined;
|
|
45533
|
+
}
|
|
45534
|
+
return this.agent.task.get(id);
|
|
45535
|
+
}
|
|
45522
45536
|
subscribeTask(handler) {
|
|
45523
45537
|
this.eventHandler.on(TASK_EVENT, handler);
|
|
45524
45538
|
}
|