webitel-sdk 26.4.32 → 26.4.33

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 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.32";
66737
+ const version = "26.4.33";
66738
66738
  //#endregion
66739
66739
  //#region src/socket/errors.ts
66740
66740
  /**
@@ -67744,6 +67744,7 @@ var Agent = class {
67744
67744
  _defineProperty(this, "_channels", void 0);
67745
67745
  _defineProperty(this, "_listOfflineMembers", void 0);
67746
67746
  _defineProperty(this, "lastStatusChange", void 0);
67747
+ _defineProperty(this, "_waitingChatsSize", 0);
67747
67748
  this.task = /* @__PURE__ */ new Map();
67748
67749
  this._channels = /* @__PURE__ */ new Map();
67749
67750
  this.initChannels(info.channels);
@@ -67761,6 +67762,9 @@ var Agent = class {
67761
67762
  get agentId() {
67762
67763
  return this.info.agent_id;
67763
67764
  }
67765
+ get waitingChatsSize() {
67766
+ return this._waitingChatsSize;
67767
+ }
67764
67768
  /**
67765
67769
  * Метод, що повертає статус "On Demand".
67766
67770
  * @method
@@ -67864,6 +67868,7 @@ var Agent = class {
67864
67868
  if (e) {
67865
67869
  this.waitingListCalls.length = 0;
67866
67870
  this.waitingListChats.length = 0;
67871
+ this._waitingChatsSize = 0;
67867
67872
  if (this.status !== "online") return;
67868
67873
  for (const el of e.calls || []) this.waitingListCalls.push({
67869
67874
  displayName: el.communication.name || "",
@@ -67874,6 +67879,7 @@ var Agent = class {
67874
67879
  queue: el.queue,
67875
67880
  wait: el.wait
67876
67881
  });
67882
+ if (Array.isArray(e.chats)) this._waitingChatsSize = e.chats.length;
67877
67883
  for (const el of e.chats || []) {
67878
67884
  this.waitingListChats.push({
67879
67885
  chat: el.communication.chat || "",
@@ -67899,7 +67905,8 @@ var Agent = class {
67899
67905
  deleteWaitingAttempt(e) {
67900
67906
  if (e) {
67901
67907
  const attemptId = e.attempt_id;
67902
- if (!removeWaitingList(this.waitingListCalls, attemptId)) removeWaitingList(this.waitingListChats, attemptId);
67908
+ if (removeWaitingList(this.waitingListCalls, attemptId)) return;
67909
+ if (removeWaitingList(this.waitingListChats, attemptId)) this._waitingChatsSize--;
67903
67910
  }
67904
67911
  }
67905
67912
  /**
@@ -68103,6 +68110,7 @@ var Agent = class {
68103
68110
  } else {
68104
68111
  this.waitingListCalls.length = 0;
68105
68112
  this.waitingListChats.length = 0;
68113
+ this._waitingChatsSize = 0;
68106
68114
  }
68107
68115
  this.info.online_status = formatStatusPreset(e.status_preset);
68108
68116
  this.info.status = e.status;