webitel-sdk 26.4.26 → 26.4.28

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.mjs CHANGED
@@ -66698,7 +66698,7 @@ _defineProperty(SipPhone$1, "userAgent", `Webitel-Phone/${version$1}`);
66698
66698
  _defineProperty(SipPhone$1, "sipVersion", version$1);
66699
66699
  //#endregion
66700
66700
  //#region src/version.ts
66701
- const version = "26.4.26";
66701
+ const version = "26.4.28";
66702
66702
  //#endregion
66703
66703
  //#region src/socket/errors.ts
66704
66704
  /**
@@ -67670,6 +67670,11 @@ let ChannelType = /* @__PURE__ */ function(ChannelType) {
67670
67670
  ChannelType["IM"] = "im";
67671
67671
  return ChannelType;
67672
67672
  }({});
67673
+ const formatStatusPreset = (statusPreset) => {
67674
+ if (!statusPreset) return void 0;
67675
+ if (statusPreset.id <= 0 || statusPreset.name === "") return void 0;
67676
+ return statusPreset;
67677
+ };
67673
67678
  /**
67674
67679
  * Клас Agent: Використовується для представлення агента, що виконує завдання,
67675
67680
  * чати та дзвінки, а також управляє каналами та офлайн-учасниками.
@@ -67805,6 +67810,9 @@ var Agent = class {
67805
67810
  get stateDuration() {
67806
67811
  return Math.round((Date.now() - this.lastStatusChange) / 1e3);
67807
67812
  }
67813
+ get onlineSkill() {
67814
+ return this.info.online_status;
67815
+ }
67808
67816
  /**
67809
67817
  * Метод, що встановлює список членів, які очікують на відповідь.
67810
67818
  * @method
@@ -67997,8 +68005,8 @@ var Agent = class {
67997
68005
  * @param {boolean} [onDemand] - Статус "On Demand".
67998
68006
  * @returns {Promise<any>} - Об'єкт з інформацією про сесію агента.
67999
68007
  */
68000
- async online(channels, onDemand) {
68001
- return this.client.agentSetOnline(this.agentId, channels, onDemand);
68008
+ async online(channels, onDemand, onlineSkill) {
68009
+ return this.client.agentSetOnline(this.agentId, channels, onDemand, onlineSkill);
68002
68010
  }
68003
68011
  /**
68004
68012
  * Метод, що встановлює статус "Waiting" для агента.
@@ -68054,6 +68062,7 @@ var Agent = class {
68054
68062
  this.waitingListCalls.length = 0;
68055
68063
  this.waitingListChats.length = 0;
68056
68064
  }
68065
+ this.info.online_status = formatStatusPreset(e.status_preset);
68057
68066
  this.info.status = e.status;
68058
68067
  this.info.status_comment = e.status_comment;
68059
68068
  this.info.status_payload = e.status_payload ? e.status_payload : null;
@@ -70597,11 +70606,12 @@ var Client = class extends EventEmitter {
70597
70606
  async eavesdrop(req) {
70598
70607
  return this.request("call_eavesdrop", req);
70599
70608
  }
70600
- async agentSetOnline(agentId, channels, onDemand) {
70609
+ async agentSetOnline(agentId, channels, onDemand, online_skill) {
70601
70610
  return this.request("cc_agent_online", {
70602
70611
  agent_id: agentId,
70603
70612
  channels,
70604
- on_demand: onDemand
70613
+ on_demand: onDemand,
70614
+ online_skill
70605
70615
  });
70606
70616
  }
70607
70617
  async agentSetWaiting(agentId, channel) {