webitel-sdk 26.4.32 → 26.4.34
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/index.cjs +26 -8
- package/index.cjs.map +1 -1
- package/index.mjs +26 -8
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/socket/agent.d.ts +2 -0
- package/socket/agent.d.ts.map +1 -1
- package/socket/call.d.ts +1 -1
- package/socket/conversation.d.ts +1 -1
- package/socket/task.d.ts +4 -1
- package/socket/task.d.ts.map +1 -1
- package/version.d.ts +1 -1
package/index.cjs
CHANGED
|
@@ -66734,7 +66734,7 @@ _defineProperty(SipPhone$1, "userAgent", `Webitel-Phone/${version$1}`);
|
|
|
66734
66734
|
_defineProperty(SipPhone$1, "sipVersion", version$1);
|
|
66735
66735
|
//#endregion
|
|
66736
66736
|
//#region src/version.ts
|
|
66737
|
-
const version = "26.4.
|
|
66737
|
+
const version = "26.4.34";
|
|
66738
66738
|
//#endregion
|
|
66739
66739
|
//#region src/socket/errors.ts
|
|
66740
66740
|
/**
|
|
@@ -67189,6 +67189,8 @@ var Task = class {
|
|
|
67189
67189
|
"_autoAnswerTimerId",
|
|
67190
67190
|
void 0
|
|
67191
67191
|
);
|
|
67192
|
+
_defineProperty(this, "_baseProcessingSec", 0);
|
|
67193
|
+
_defineProperty(this, "_renewedSec", 0);
|
|
67192
67194
|
this.id = e.attempt_id;
|
|
67193
67195
|
this.state = "offering";
|
|
67194
67196
|
this.setState(e.status);
|
|
@@ -67363,7 +67365,10 @@ var Task = class {
|
|
|
67363
67365
|
setProcessing(now, p) {
|
|
67364
67366
|
this.state = "processing";
|
|
67365
67367
|
this.closedAt = now;
|
|
67366
|
-
if (!this.startProcessingAt)
|
|
67368
|
+
if (!this.startProcessingAt) {
|
|
67369
|
+
this.startProcessingAt = Date.now();
|
|
67370
|
+
this._baseProcessingSec = p.sec;
|
|
67371
|
+
}
|
|
67367
67372
|
if (p.sec && !p.timeout) p.timeout = Date.now() + p.sec * 1e3;
|
|
67368
67373
|
this._processing = p;
|
|
67369
67374
|
}
|
|
@@ -67404,9 +67409,8 @@ var Task = class {
|
|
|
67404
67409
|
* @returns {number | null}
|
|
67405
67410
|
*/
|
|
67406
67411
|
get processingSec() {
|
|
67407
|
-
var _this$_processing2;
|
|
67408
|
-
|
|
67409
|
-
return this._processing.sec;
|
|
67412
|
+
var _this$_processing$sec, _this$_processing2;
|
|
67413
|
+
return (_this$_processing$sec = (_this$_processing2 = this._processing) === null || _this$_processing2 === void 0 ? void 0 : _this$_processing2.sec) !== null && _this$_processing$sec !== void 0 ? _this$_processing$sec : null;
|
|
67410
67414
|
}
|
|
67411
67415
|
/**
|
|
67412
67416
|
* Отримати спробу.
|
|
@@ -67554,10 +67558,16 @@ var Task = class {
|
|
|
67554
67558
|
* @returns {Promise<any>}
|
|
67555
67559
|
*/
|
|
67556
67560
|
async renew(sec) {
|
|
67557
|
-
|
|
67561
|
+
const renewSec = sec || this.processingSec;
|
|
67562
|
+
const res = await this.client.request("cc_renewal", {
|
|
67558
67563
|
attempt_id: this.id,
|
|
67559
|
-
renewal_sec:
|
|
67564
|
+
renewal_sec: renewSec
|
|
67560
67565
|
});
|
|
67566
|
+
this._renewedSec += renewSec !== null && renewSec !== void 0 ? renewSec : 0;
|
|
67567
|
+
return res;
|
|
67568
|
+
}
|
|
67569
|
+
get totalProcessingSec() {
|
|
67570
|
+
return this._processing ? this._baseProcessingSec + this._renewedSec : null;
|
|
67561
67571
|
}
|
|
67562
67572
|
/**
|
|
67563
67573
|
* Виконати дію з формою.
|
|
@@ -67744,6 +67754,7 @@ var Agent = class {
|
|
|
67744
67754
|
_defineProperty(this, "_channels", void 0);
|
|
67745
67755
|
_defineProperty(this, "_listOfflineMembers", void 0);
|
|
67746
67756
|
_defineProperty(this, "lastStatusChange", void 0);
|
|
67757
|
+
_defineProperty(this, "_waitingChatsSize", 0);
|
|
67747
67758
|
this.task = /* @__PURE__ */ new Map();
|
|
67748
67759
|
this._channels = /* @__PURE__ */ new Map();
|
|
67749
67760
|
this.initChannels(info.channels);
|
|
@@ -67761,6 +67772,9 @@ var Agent = class {
|
|
|
67761
67772
|
get agentId() {
|
|
67762
67773
|
return this.info.agent_id;
|
|
67763
67774
|
}
|
|
67775
|
+
get waitingChatsSize() {
|
|
67776
|
+
return this._waitingChatsSize;
|
|
67777
|
+
}
|
|
67764
67778
|
/**
|
|
67765
67779
|
* Метод, що повертає статус "On Demand".
|
|
67766
67780
|
* @method
|
|
@@ -67864,6 +67878,7 @@ var Agent = class {
|
|
|
67864
67878
|
if (e) {
|
|
67865
67879
|
this.waitingListCalls.length = 0;
|
|
67866
67880
|
this.waitingListChats.length = 0;
|
|
67881
|
+
this._waitingChatsSize = 0;
|
|
67867
67882
|
if (this.status !== "online") return;
|
|
67868
67883
|
for (const el of e.calls || []) this.waitingListCalls.push({
|
|
67869
67884
|
displayName: el.communication.name || "",
|
|
@@ -67874,6 +67889,7 @@ var Agent = class {
|
|
|
67874
67889
|
queue: el.queue,
|
|
67875
67890
|
wait: el.wait
|
|
67876
67891
|
});
|
|
67892
|
+
if (Array.isArray(e.chats)) this._waitingChatsSize = e.chats.length;
|
|
67877
67893
|
for (const el of e.chats || []) {
|
|
67878
67894
|
this.waitingListChats.push({
|
|
67879
67895
|
chat: el.communication.chat || "",
|
|
@@ -67899,7 +67915,8 @@ var Agent = class {
|
|
|
67899
67915
|
deleteWaitingAttempt(e) {
|
|
67900
67916
|
if (e) {
|
|
67901
67917
|
const attemptId = e.attempt_id;
|
|
67902
|
-
if (
|
|
67918
|
+
if (removeWaitingList(this.waitingListCalls, attemptId)) return;
|
|
67919
|
+
if (removeWaitingList(this.waitingListChats, attemptId)) this._waitingChatsSize--;
|
|
67903
67920
|
}
|
|
67904
67921
|
}
|
|
67905
67922
|
/**
|
|
@@ -68103,6 +68120,7 @@ var Agent = class {
|
|
|
68103
68120
|
} else {
|
|
68104
68121
|
this.waitingListCalls.length = 0;
|
|
68105
68122
|
this.waitingListChats.length = 0;
|
|
68123
|
+
this._waitingChatsSize = 0;
|
|
68106
68124
|
}
|
|
68107
68125
|
this.info.online_status = formatStatusPreset(e.status_preset);
|
|
68108
68126
|
this.info.status = e.status;
|