webitel-sdk 26.4.35 → 26.4.37

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
@@ -66709,7 +66709,7 @@ _defineProperty(SipPhone$1, "userAgent", `Webitel-Phone/${version$1}`);
66709
66709
  _defineProperty(SipPhone$1, "sipVersion", version$1);
66710
66710
  //#endregion
66711
66711
  //#region src/version.ts
66712
- const version = "26.4.35";
66712
+ const version = "26.4.37";
66713
66713
  //#endregion
66714
66714
  //#region src/socket/errors.ts
66715
66715
  /**
@@ -67380,12 +67380,20 @@ var Task = class {
67380
67380
  return this._processing.timeout;
67381
67381
  }
67382
67382
  /**
67383
+ * Чи увімкнене автозбереження постобробки в черзі.
67384
+ * @returns {boolean}
67385
+ */
67386
+ get processingAutosave() {
67387
+ var _this$_processing2;
67388
+ return !!((_this$_processing2 = this._processing) === null || _this$_processing2 === void 0 ? void 0 : _this$_processing2.autosave);
67389
+ }
67390
+ /**
67383
67391
  * Отримати тривалість обробки в секундах.
67384
67392
  * @returns {number | null}
67385
67393
  */
67386
67394
  get processingSec() {
67387
- var _this$_processing$sec, _this$_processing2;
67388
- 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;
67395
+ var _this$_processing$sec, _this$_processing3;
67396
+ return (_this$_processing$sec = (_this$_processing3 = this._processing) === null || _this$_processing3 === void 0 ? void 0 : _this$_processing3.sec) !== null && _this$_processing$sec !== void 0 ? _this$_processing$sec : null;
67389
67397
  }
67390
67398
  /**
67391
67399
  * Отримати спробу.
@@ -67448,8 +67456,8 @@ var Task = class {
67448
67456
  * @returns {number | null}
67449
67457
  */
67450
67458
  get renewalSec() {
67451
- var _this$_processing3;
67452
- if (!((_this$_processing3 = this._processing) === null || _this$_processing3 === void 0 ? void 0 : _this$_processing3.renewal_sec)) return null;
67459
+ var _this$_processing4;
67460
+ if (!((_this$_processing4 = this._processing) === null || _this$_processing4 === void 0 ? void 0 : _this$_processing4.renewal_sec)) return null;
67453
67461
  return this._processing.renewal_sec;
67454
67462
  }
67455
67463
  /**
@@ -67528,6 +67536,19 @@ var Task = class {
67528
67536
  return res;
67529
67537
  }
67530
67538
  /**
67539
+ * Зберегти чернетку звітності без завершення завдання.
67540
+ * Не змінює reportedAt.
67541
+ * @param {Reporting} reporting - Дані звітності.
67542
+ * @returns {Promise<any>}
67543
+ */
67544
+ async reportingDraft(reporting) {
67545
+ return this.client.request("cc_reporting", {
67546
+ attempt_id: this.id,
67547
+ ...reporting,
67548
+ draft: true
67549
+ });
67550
+ }
67551
+ /**
67531
67552
  * Оновити завдання.
67532
67553
  * @param {number} [sec] - Кількість секунд для оновлення.
67533
67554
  * @returns {Promise<any>}
@@ -70979,6 +71000,15 @@ var Client = class extends EventEmitter {
70979
71000
  }
70980
71001
  break;
70981
71002
  }
71003
+ case "system_settings": {
71004
+ const rawBody = e.body;
71005
+ if (!isSystemSettingsChange(rawBody)) {
71006
+ console.warn("[SDK] Invalid system settings payload received", rawBody);
71007
+ break;
71008
+ }
71009
+ this.emit(`system_settings_changed`, rawBody);
71010
+ break;
71011
+ }
70982
71012
  case "screen_share": {
70983
71013
  const body = e.body;
70984
71014
  switch (body.state) {
@@ -71319,6 +71349,7 @@ function isDestroyJob(state) {
71319
71349
  "closed"
71320
71350
  ].indexOf(state) > -1;
71321
71351
  }
71352
+ const isSystemSettingsChange = (data) => typeof data === "object" && data !== null && "name" in data && typeof data.name === "string";
71322
71353
  //#endregion
71323
71354
  //#region src/sip/external/session.ts
71324
71355
  var Session = class {