@voicenter-team/events-sdk 0.0.102 → 0.0.104

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.
@@ -1,6 +1,6 @@
1
1
  var _e = Object.defineProperty;
2
2
  var Re = (a, t, e) => t in a ? _e(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
3
- var X = (a, t, e) => (Re(a, typeof t != "symbol" ? t + "" : t, e), e);
3
+ var V = (a, t, e) => (Re(a, typeof t != "symbol" ? t + "" : t, e), e);
4
4
  import Ie from "ws";
5
5
  import xe, { LevelEnum as z, ActionNameEnum as Y, LogTypeEnum as Q } from "@voicenter-team/socketio-storage-logger";
6
6
  function Ue(a) {
@@ -148,7 +148,7 @@ function je(a) {
148
148
  })();
149
149
  var Pe = Te.exports;
150
150
  const Fe = /* @__PURE__ */ Ue(Pe);
151
- var ne = /* @__PURE__ */ ((a) => (a.BOOTSTRAP = "bootstrap", a.DEBUG_EXTENSIONS = "debugExtensions", a.DEBUG_QUEUE = "debugQueue", a.DEBUG_DIALER = "debugDialer", a.FULL = "full", a))(ne || {}), te = /* @__PURE__ */ ((a) => (a.MAIN = "main", a.NEXT = "next", a))(te || {}), Z = /* @__PURE__ */ ((a) => (a.USER = "User", a.TOKEN = "Token", a))(Z || {});
151
+ var te = /* @__PURE__ */ ((a) => (a.BOOTSTRAP = "bootstrap", a.DEBUG_EXTENSIONS = "debugExtensions", a.DEBUG_QUEUE = "debugQueue", a.DEBUG_DIALER = "debugDialer", a.FULL = "full", a))(te || {}), ne = /* @__PURE__ */ ((a) => (a.MAIN = "main", a.NEXT = "next", a))(ne || {}), Z = /* @__PURE__ */ ((a) => (a.USER = "User", a.TOKEN = "Token", a))(Z || {});
152
152
  class ae {
153
153
  static async getSessionStorageDataByKey(t, e = !0) {
154
154
  if (typeof chrome < "u" && typeof chrome.storage < "u") {
@@ -173,12 +173,12 @@ class ae {
173
173
  }
174
174
  class Me {
175
175
  constructor(t) {
176
- X(this, "delay", 1e3);
177
- X(this, "lastLoginTimestamp");
178
- X(this, "token");
179
- X(this, "refreshToken");
180
- X(this, "tokenExpiry");
181
- X(this, "storageKey");
176
+ V(this, "delay", 1e3);
177
+ V(this, "lastLoginTimestamp");
178
+ V(this, "token");
179
+ V(this, "refreshToken");
180
+ V(this, "tokenExpiry");
181
+ V(this, "storageKey");
182
182
  this.eventsSdkClass = t, this.eventsSdkClass = t, this.storageKey = "";
183
183
  }
184
184
  async login() {
@@ -232,7 +232,7 @@ class Me {
232
232
  throw new Error("Socket servers not defined");
233
233
  if (this.eventsSdkClass.options.isNewStack && !this.eventsSdkClass.servers.length)
234
234
  throw new Error("Socket servers not defined");
235
- this.eventsSdkClass.server && this.eventsSdkClass.socketIoClass.getSocketIoFunction(`v=${this.eventsSdkClass.server.Version}`), !this.eventsSdkClass.server && this.eventsSdkClass.URLList.length && this.eventsSdkClass.socketIoClass.getSocketIoFunction(`v=${t.Version}`), t.IdentityCode && (this.token = t.IdentityCode, this.eventsSdkClass.connect(te.MAIN)), t.Token && (this.token = t.Token, this.eventsSdkClass.connect(te.MAIN)), t.RefreshToken && t.IdentityCodeExpiry && this.eventsSdkClass.options.loginType === Z.USER && (this.refreshToken = t.RefreshToken, this.tokenExpiry = t.IdentityCodeExpiry, this.handleTokenExpiry()), t.RefreshToken && t.TokenExpiry && this.normalizeLoginType(this.eventsSdkClass.options.loginType) === Z.USER && (this.refreshToken = t.RefreshToken, this.tokenExpiry = t.TokenExpiry, this.handleTokenExpiry());
235
+ this.eventsSdkClass.server && this.eventsSdkClass.socketIoClass.getSocketIoFunction(`v=${this.eventsSdkClass.server.Version}`), !this.eventsSdkClass.server && this.eventsSdkClass.URLList.length && this.eventsSdkClass.socketIoClass.getSocketIoFunction(`v=${t.Version}`), t.IdentityCode && (this.token = t.IdentityCode, this.eventsSdkClass.connect(ne.MAIN)), t.Token && (this.token = t.Token, this.eventsSdkClass.connect(ne.MAIN)), t.RefreshToken && t.IdentityCodeExpiry && this.eventsSdkClass.options.loginType === Z.USER && (this.refreshToken = t.RefreshToken, this.tokenExpiry = t.IdentityCodeExpiry, this.handleTokenExpiry()), t.RefreshToken && t.TokenExpiry && this.normalizeLoginType(this.eventsSdkClass.options.loginType) === Z.USER && (this.refreshToken = t.RefreshToken, this.tokenExpiry = t.TokenExpiry, this.handleTokenExpiry());
236
236
  }
237
237
  handleTokenExpiry() {
238
238
  if (!this.eventsSdkClass.options.refreshTokenUrl)
@@ -369,7 +369,7 @@ const qe = {
369
369
  debug: !1
370
370
  }
371
371
  };
372
- function Xe() {
372
+ function Ve() {
373
373
  return typeof window < "u" && (typeof window.navigator > "u" || typeof window.navigator.userAgent > "u") && (window.navigator.userAgent = "react-native"), typeof self > "u" && typeof global == "object" && (global.self = global, global.WebSocket = Ie, typeof self.navigator > "u" && (self.navigator = { userAgent: "node" })), function a(t, e, s) {
374
374
  function o(l, d) {
375
375
  if (!e[l]) {
@@ -1541,9 +1541,9 @@ function Xe() {
1541
1541
  return A(m);
1542
1542
  }
1543
1543
  function d(C, b, A) {
1544
- for (var v = new Array(C.length), m = n(C.length, A), L = function(R, S, V) {
1545
- b(S, function(K, G) {
1546
- v[R] = G, V(K, v);
1544
+ for (var v = new Array(C.length), m = n(C.length, A), L = function(R, S, K) {
1545
+ b(S, function(X, $) {
1546
+ v[R] = $, K(X, v);
1547
1547
  });
1548
1548
  }, I = 0; I < C.length; I++)
1549
1549
  L(I, C[I], m);
@@ -1626,17 +1626,17 @@ function Xe() {
1626
1626
  if (C == "")
1627
1627
  return A(M, 0, 1);
1628
1628
  for (var m, L, I = "", R = 0, S = C.length; S > R; R++) {
1629
- var V = C.charAt(R);
1630
- if (V != ":")
1631
- I += V;
1629
+ var K = C.charAt(R);
1630
+ if (K != ":")
1631
+ I += K;
1632
1632
  else {
1633
1633
  if (I == "" || I != (m = Number(I)) || (L = C.substr(R + 1, m), I != L.length))
1634
1634
  return A(M, 0, 1);
1635
1635
  if (L.length) {
1636
1636
  if (v = e.decodePacket(L, b, !0), M.type == v.type && M.data == v.data)
1637
1637
  return A(M, 0, 1);
1638
- var K = A(v, R + m, S);
1639
- if (K === !1)
1638
+ var X = A(v, R + m, S);
1639
+ if (X === !1)
1640
1640
  return;
1641
1641
  }
1642
1642
  R += m, I = "";
@@ -1650,23 +1650,23 @@ function Xe() {
1650
1650
  });
1651
1651
  }
1652
1652
  return C.length ? void d(C, A, function(v, m) {
1653
- var L = m.reduce(function(S, V) {
1654
- var K;
1655
- return K = typeof V == "string" ? V.length : V.byteLength, S + K.toString().length + K + 2;
1653
+ var L = m.reduce(function(S, K) {
1654
+ var X;
1655
+ return X = typeof K == "string" ? K.length : K.byteLength, S + X.toString().length + X + 2;
1656
1656
  }, 0), I = new Uint8Array(L), R = 0;
1657
1657
  return m.forEach(function(S) {
1658
- var V = typeof S == "string", K = S;
1659
- if (V) {
1660
- for (var G = new Uint8Array(S.length), q = 0; q < S.length; q++)
1661
- G[q] = S.charCodeAt(q);
1662
- K = G.buffer;
1658
+ var K = typeof S == "string", X = S;
1659
+ if (K) {
1660
+ for (var $ = new Uint8Array(S.length), q = 0; q < S.length; q++)
1661
+ $[q] = S.charCodeAt(q);
1662
+ X = $.buffer;
1663
1663
  }
1664
- I[R++] = V ? 0 : 1;
1665
- for (var J = K.byteLength.toString(), q = 0; q < J.length; q++)
1664
+ I[R++] = K ? 0 : 1;
1665
+ for (var J = X.byteLength.toString(), q = 0; q < J.length; q++)
1666
1666
  I[R++] = parseInt(J[q]);
1667
1667
  I[R++] = 255;
1668
- for (var G = new Uint8Array(K), q = 0; q < G.length; q++)
1669
- I[R++] = G[q];
1668
+ for (var $ = new Uint8Array(X), q = 0; q < $.length; q++)
1669
+ I[R++] = $[q];
1670
1670
  }), b(I.buffer);
1671
1671
  }) : b(new ArrayBuffer(0));
1672
1672
  }, e.encodePayloadAsBlob = function(C, b) {
@@ -1678,10 +1678,10 @@ function Xe() {
1678
1678
  R[S] = L.charCodeAt(S);
1679
1679
  L = R.buffer, I[0] = 0;
1680
1680
  }
1681
- for (var V = L instanceof ArrayBuffer ? L.byteLength : L.size, K = V.toString(), G = new Uint8Array(K.length + 1), S = 0; S < K.length; S++)
1682
- G[S] = parseInt(K[S]);
1683
- if (G[K.length] = 255, _) {
1684
- var q = new _([I.buffer, G.buffer, L]);
1681
+ for (var K = L instanceof ArrayBuffer ? L.byteLength : L.size, X = K.toString(), $ = new Uint8Array(X.length + 1), S = 0; S < X.length; S++)
1682
+ $[S] = parseInt(X[S]);
1683
+ if ($[X.length] = 255, _) {
1684
+ var q = new _([I.buffer, $.buffer, L]);
1685
1685
  m(null, q);
1686
1686
  }
1687
1687
  });
@@ -1692,27 +1692,27 @@ function Xe() {
1692
1692
  }, e.decodePayloadAsBinary = function(C, b, A) {
1693
1693
  typeof b == "function" && (A = b, b = null);
1694
1694
  for (var v = C, m = [], L = !1; v.byteLength > 0; ) {
1695
- for (var I = new Uint8Array(v), R = I[0] === 0, S = "", V = 1; I[V] != 255; V++) {
1695
+ for (var I = new Uint8Array(v), R = I[0] === 0, S = "", K = 1; I[K] != 255; K++) {
1696
1696
  if (S.length > 310) {
1697
1697
  L = !0;
1698
1698
  break;
1699
1699
  }
1700
- S += I[V];
1700
+ S += I[K];
1701
1701
  }
1702
1702
  if (L)
1703
1703
  return A(M, 0, 1);
1704
1704
  v = c(v, 2 + S.length), S = parseInt(S);
1705
- var K = c(v, 0, S);
1705
+ var X = c(v, 0, S);
1706
1706
  if (R)
1707
1707
  try {
1708
- K = String.fromCharCode.apply(null, new Uint8Array(K));
1708
+ X = String.fromCharCode.apply(null, new Uint8Array(X));
1709
1709
  } catch {
1710
- var G = new Uint8Array(K);
1711
- K = "";
1712
- for (var V = 0; V < G.length; V++)
1713
- K += String.fromCharCode(G[V]);
1710
+ var $ = new Uint8Array(X);
1711
+ X = "";
1712
+ for (var K = 0; K < $.length; K++)
1713
+ X += String.fromCharCode($[K]);
1714
1714
  }
1715
- m.push(K), v = c(v, S);
1715
+ m.push(X), v = c(v, S);
1716
1716
  }
1717
1717
  var q = m.length;
1718
1718
  m.forEach(function(J, se) {
@@ -2305,19 +2305,19 @@ function Xe() {
2305
2305
  for (k in D)
2306
2306
  h.call(D, k) && x++;
2307
2307
  return w = D = null, x ? f = x == 2 ? function(B, N) {
2308
- var F, $ = {}, W = d.call(B) == r;
2308
+ var F, G = {}, W = d.call(B) == r;
2309
2309
  for (F in B)
2310
- W && F == "prototype" || h.call($, F) || !($[F] = 1) || !h.call(B, F) || N(F);
2310
+ W && F == "prototype" || h.call(G, F) || !(G[F] = 1) || !h.call(B, F) || N(F);
2311
2311
  } : function(B, N) {
2312
- var F, $, W = d.call(B) == r;
2312
+ var F, G, W = d.call(B) == r;
2313
2313
  for (F in B)
2314
- W && F == "prototype" || !h.call(B, F) || ($ = F === "constructor") || N(F);
2315
- ($ || h.call(B, F = "constructor")) && N(F);
2314
+ W && F == "prototype" || !h.call(B, F) || (G = F === "constructor") || N(F);
2315
+ (G || h.call(B, F = "constructor")) && N(F);
2316
2316
  } : (D = ["valueOf", "toString", "toLocaleString", "propertyIsEnumerable", "isPrototypeOf", "hasOwnProperty", "constructor"], f = function(B, N) {
2317
- var F, $, W = d.call(B) == r, H = !W && typeof B.constructor != "function" && b(B, "hasOwnProperty") ? B.hasOwnProperty : h;
2317
+ var F, G, W = d.call(B) == r, H = !W && typeof B.constructor != "function" && b(B, "hasOwnProperty") ? B.hasOwnProperty : h;
2318
2318
  for (F in B)
2319
2319
  W && F == "prototype" || !H.call(B, F) || N(F);
2320
- for ($ = D.length; F = D[--$]; H.call(B, F) && N(F))
2320
+ for (G = D.length; F = D[--G]; H.call(B, F) && N(F))
2321
2321
  ;
2322
2322
  }), f(E, O);
2323
2323
  }, !o("json-stringify")) {
@@ -2347,7 +2347,7 @@ function Xe() {
2347
2347
  }
2348
2348
  return w + '"';
2349
2349
  }, R = function(E, O, w, D, k, x, B) {
2350
- var N, F, $, W, H, oe, he, pe, ue, fe, ee, de, ce, ie, ge, ye;
2350
+ var N, F, G, W, H, oe, he, pe, ue, fe, ee, de, ce, ie, ge, ye;
2351
2351
  try {
2352
2352
  N = O[E];
2353
2353
  } catch {
@@ -2357,14 +2357,14 @@ function Xe() {
2357
2357
  typeof N.toJSON == "function" && (F != u && F != g && F != y || h.call(N, "toJSON")) && (N = N.toJSON(E));
2358
2358
  else if (N > -1 / 0 && 1 / 0 > N) {
2359
2359
  if (_) {
2360
- for (H = U(N / 864e5), $ = U(H / 365.2425) + 1970 - 1; _($ + 1, 0) <= H; $++)
2360
+ for (H = U(N / 864e5), G = U(H / 365.2425) + 1970 - 1; _(G + 1, 0) <= H; G++)
2361
2361
  ;
2362
- for (W = U((H - _($, 0)) / 30.42); _($, W + 1) <= H; W++)
2362
+ for (W = U((H - _(G, 0)) / 30.42); _(G, W + 1) <= H; W++)
2363
2363
  ;
2364
- H = 1 + H - _($, W), oe = (N % 864e5 + 864e5) % 864e5, he = U(oe / 36e5) % 24, pe = U(oe / 6e4) % 60, ue = U(oe / 1e3) % 60, fe = oe % 1e3;
2364
+ H = 1 + H - _(G, W), oe = (N % 864e5 + 864e5) % 864e5, he = U(oe / 36e5) % 24, pe = U(oe / 6e4) % 60, ue = U(oe / 1e3) % 60, fe = oe % 1e3;
2365
2365
  } else
2366
- $ = N.getUTCFullYear(), W = N.getUTCMonth(), H = N.getUTCDate(), he = N.getUTCHours(), pe = N.getUTCMinutes(), ue = N.getUTCSeconds(), fe = N.getUTCMilliseconds();
2367
- N = (0 >= $ || $ >= 1e4 ? (0 > $ ? "-" : "+") + m(6, 0 > $ ? -$ : $) : m(4, $)) + "-" + m(2, W + 1) + "-" + m(2, H) + "T" + m(2, he) + ":" + m(2, pe) + ":" + m(2, ue) + "." + m(3, fe) + "Z";
2366
+ G = N.getUTCFullYear(), W = N.getUTCMonth(), H = N.getUTCDate(), he = N.getUTCHours(), pe = N.getUTCMinutes(), ue = N.getUTCSeconds(), fe = N.getUTCMilliseconds();
2367
+ N = (0 >= G || G >= 1e4 ? (0 > G ? "-" : "+") + m(6, 0 > G ? -G : G) : m(4, G)) + "-" + m(2, W + 1) + "-" + m(2, H) + "T" + m(2, he) + ":" + m(2, pe) + ":" + m(2, ue) + "." + m(3, fe) + "Z";
2368
2368
  } else
2369
2369
  N = null;
2370
2370
  if (w && (N = w.call(O, E, N)), N === null)
@@ -2404,7 +2404,7 @@ function Xe() {
2404
2404
  k = O;
2405
2405
  else if (B == y) {
2406
2406
  x = {};
2407
- for (var N, F = 0, $ = O.length; $ > F; N = O[F++], B = d.call(N), (B == g || B == u) && (x[N] = 1))
2407
+ for (var N, F = 0, G = O.length; G > F; N = O[F++], B = d.call(N), (B == g || B == u) && (x[N] = 1))
2408
2408
  ;
2409
2409
  }
2410
2410
  }
@@ -2419,11 +2419,11 @@ function Xe() {
2419
2419
  };
2420
2420
  }
2421
2421
  if (!o("json-parse")) {
2422
- var S, V, K = String.fromCharCode, G = { 92: "\\", 34: '"', 47: "/", 98: "\b", 116: " ", 110: `
2422
+ var S, K, X = String.fromCharCode, $ = { 92: "\\", 34: '"', 47: "/", 98: "\b", 116: " ", 110: `
2423
2423
  `, 102: "\f", 114: "\r" }, q = function() {
2424
- throw S = V = null, SyntaxError();
2424
+ throw S = K = null, SyntaxError();
2425
2425
  }, J = function() {
2426
- for (var E, O, w, D, k, x = V, B = x.length; B > S; )
2426
+ for (var E, O, w, D, k, x = K, B = x.length; B > S; )
2427
2427
  switch (k = x.charCodeAt(S)) {
2428
2428
  case 9:
2429
2429
  case 10:
@@ -2452,12 +2452,12 @@ function Xe() {
2452
2452
  case 110:
2453
2453
  case 102:
2454
2454
  case 114:
2455
- E += G[k], S++;
2455
+ E += $[k], S++;
2456
2456
  break;
2457
2457
  case 117:
2458
2458
  for (O = ++S, w = S + 4; w > S; S++)
2459
2459
  k = x.charCodeAt(S), k >= 48 && 57 >= k || k >= 97 && 102 >= k || k >= 65 && 70 >= k || q();
2460
- E += K("0x" + x.slice(O, S));
2460
+ E += X("0x" + x.slice(O, S));
2461
2461
  break;
2462
2462
  default:
2463
2463
  q();
@@ -2532,7 +2532,7 @@ function Xe() {
2532
2532
  };
2533
2533
  p.parse = function(E, O) {
2534
2534
  var w, D;
2535
- return S = 0, V = "" + E, w = se(J()), J() != "$" && q(), S = V = null, O && d.call(O) == r ? Ce((D = {}, D[""] = w, D), "", O) : w;
2535
+ return S = 0, K = "" + E, w = se(J()), J() != "$" && q(), S = K = null, O && d.call(O) == r ? Ce((D = {}, D[""] = w, D), "", O) : w;
2536
2536
  };
2537
2537
  }
2538
2538
  }
@@ -2550,20 +2550,20 @@ function Xe() {
2550
2550
  }, {}]
2551
2551
  }, {}, [1])(1);
2552
2552
  }
2553
- const Ve = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2553
+ const Ke = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2554
2554
  __proto__: null,
2555
- default: Xe
2556
- }, Symbol.toStringTag, { value: "Module" })), Ke = /* @__PURE__ */ Object.assign({
2557
- "./v1_3_7.js": Ve
2558
- }), $e = /v\d+_\d+_\d+/;
2559
- function Ge(a) {
2555
+ default: Ve
2556
+ }, Symbol.toStringTag, { value: "Module" })), Xe = /* @__PURE__ */ Object.assign({
2557
+ "./v1_3_7.js": Ke
2558
+ }), Ge = /v\d+_\d+_\d+/;
2559
+ function $e(a) {
2560
2560
  return typeof a == "function";
2561
2561
  }
2562
- const Se = Object.entries(Ke).reduce(
2562
+ const Se = Object.entries(Xe).reduce(
2563
2563
  (a, t) => {
2564
2564
  var o;
2565
- const e = t[1].default, s = (o = t[0].match($e)) == null ? void 0 : o[0];
2566
- return Ge(e) && s && (a[s] = e()), a;
2565
+ const e = t[1].default, s = (o = t[0].match(Ge)) == null ? void 0 : o[0];
2566
+ return $e(e) && s && (a[s] = e()), a;
2567
2567
  },
2568
2568
  {}
2569
2569
  ), Ne = (a) => {
@@ -2753,26 +2753,26 @@ class le {
2753
2753
  var Oe = /* @__PURE__ */ ((a) => (a.UPDATE_MONITORED_EXTENSIONS = "updateMonitoredExtensions", a.KEEP_ALIVE = "keepalive", a))(Oe || {});
2754
2754
  class nt {
2755
2755
  constructor(t) {
2756
- X(this, "io");
2757
- X(this, "ioFunction");
2758
- X(this, "lastEventTimestamp", (/* @__PURE__ */ new Date()).getTime());
2759
- X(this, "doReconnect", !0);
2760
- X(this, "keepAliveInterval");
2761
- X(this, "keepReconnectInterval");
2762
- X(this, "keepReconnectTimeout");
2763
- X(this, "connected", !1);
2764
- X(this, "reconnectionTime", 20);
2756
+ V(this, "io");
2757
+ V(this, "ioFunction");
2758
+ V(this, "lastEventTimestamp", (/* @__PURE__ */ new Date()).getTime());
2759
+ V(this, "doReconnect", !0);
2760
+ V(this, "keepAliveInterval");
2761
+ V(this, "keepReconnectInterval");
2762
+ V(this, "keepReconnectTimeout");
2763
+ V(this, "connected", !1);
2764
+ V(this, "reconnectionTime", 20);
2765
2765
  this.eventsSdkClass = t, this.eventsSdkClass = t, typeof window < "u" && (window.addEventListener("offline", () => {
2766
2766
  this.closeAllConnections();
2767
2767
  }), window.addEventListener("online", () => {
2768
2768
  setTimeout(() => {
2769
- this.keepReconnectTimeout && clearTimeout(this.keepReconnectTimeout), this.eventsSdkClass.connect(te.NEXT);
2769
+ this.keepReconnectTimeout && clearTimeout(this.keepReconnectTimeout), this.eventsSdkClass.connect(ne.NEXT);
2770
2770
  }, 5e3);
2771
2771
  })), typeof self < "u" && typeof window > "u" && typeof global > "u" && (self.addEventListener("offline", () => {
2772
2772
  this.closeAllConnections();
2773
2773
  }), self.addEventListener("online", () => {
2774
2774
  setTimeout(() => {
2775
- this.keepReconnectTimeout && clearTimeout(this.keepReconnectTimeout), this.eventsSdkClass.connect(te.NEXT);
2775
+ this.keepReconnectTimeout && clearTimeout(this.keepReconnectTimeout), this.eventsSdkClass.connect(ne.NEXT);
2776
2776
  }, 5e3);
2777
2777
  }));
2778
2778
  }
@@ -2870,7 +2870,7 @@ class nt {
2870
2870
  connectionStatus: this.doReconnect ? re.TRYING_TO_CONNECT : re.DISCONNECTED
2871
2871
  }), this.eventsSdkClass.loggerClass.sdkDisconnect([t]), this.keepReconnectTimeout = setTimeout(
2872
2872
  () => {
2873
- this.reconnectionTime = this.reconnectionTime + 20, this.reconnectionTime > 120 && (this.reconnectionTime = 20), this.eventsSdkClass.connect(te.NEXT);
2873
+ this.reconnectionTime = this.reconnectionTime + 20, this.reconnectionTime > 120 && (this.reconnectionTime = 20), this.eventsSdkClass.connect(ne.NEXT);
2874
2874
  },
2875
2875
  this.reconnectionTime * 1e3
2876
2876
  ));
@@ -2880,7 +2880,7 @@ class nt {
2880
2880
  connectionStatus: this.doReconnect ? re.TRYING_TO_CONNECT : re.DISCONNECTED
2881
2881
  }), this.eventsSdkClass.loggerClass.sdkAttemptToConnectError(t), this.keepReconnectTimeout = setTimeout(
2882
2882
  () => {
2883
- this.reconnectionTime = this.reconnectionTime + 20, this.reconnectionTime > 60 && (this.reconnectionTime = 20), this.eventsSdkClass.connect(te.NEXT);
2883
+ this.reconnectionTime = this.reconnectionTime + 20, this.reconnectionTime > 60 && (this.reconnectionTime = 20), this.eventsSdkClass.connect(ne.NEXT);
2884
2884
  },
2885
2885
  this.reconnectionTime * 1e3
2886
2886
  );
@@ -2888,7 +2888,7 @@ class nt {
2888
2888
  }
2889
2889
  class rt {
2890
2890
  constructor(t) {
2891
- X(this, "storageLogger");
2891
+ V(this, "storageLogger");
2892
2892
  this.eventsSdkClass = t, this.eventsSdkClass = t;
2893
2893
  }
2894
2894
  init() {
@@ -2914,8 +2914,14 @@ class rt {
2914
2914
  this.storageLogger && await this.storageLogger.stop();
2915
2915
  }
2916
2916
  log(t) {
2917
- if (this.eventsSdkClass.options.useLogger)
2918
- if (this.storageLogger)
2917
+ if (console.log("IN SDK METHOD LOG 1", {
2918
+ data: t,
2919
+ useLogger: this.eventsSdkClass.options.useLogger
2920
+ }), this.eventsSdkClass.options.useLogger)
2921
+ if (console.log("IN SDK METHOD LOG 2", {
2922
+ storageLogger: this.storageLogger,
2923
+ LEVEL: t.Level
2924
+ }), this.storageLogger)
2919
2925
  switch (t.Level) {
2920
2926
  case z.INFO:
2921
2927
  this.storageLogger.log(t);
@@ -3037,13 +3043,19 @@ class rt {
3037
3043
  }
3038
3044
  eventLog(t, e) {
3039
3045
  const s = {
3040
- [ne.FULL]: [],
3041
- [ne.BOOTSTRAP]: [j.LOGIN_STATUS, j.LOGIN_SUCCESS, j.ALL_EXTENSION_STATUS, j.ALL_DIALER_STATUS],
3042
- [ne.DEBUG_EXTENSIONS]: [j.ALL_EXTENSION_STATUS, j.EXTENSION_EVENT, j.EXTENSIONS_UPDATED],
3043
- [ne.DEBUG_DIALER]: [j.ALL_DIALER_STATUS, j.DIALER_EVENT],
3044
- [ne.DEBUG_QUEUE]: [j.QUEUE_EVENT]
3046
+ [te.FULL]: [],
3047
+ [te.BOOTSTRAP]: [j.LOGIN_STATUS, j.LOGIN_SUCCESS, j.ALL_EXTENSION_STATUS, j.ALL_DIALER_STATUS],
3048
+ [te.DEBUG_EXTENSIONS]: [j.ALL_EXTENSION_STATUS, j.EXTENSION_EVENT, j.EXTENSIONS_UPDATED],
3049
+ [te.DEBUG_DIALER]: [j.ALL_DIALER_STATUS, j.DIALER_EVENT],
3050
+ [te.DEBUG_QUEUE]: [j.QUEUE_EVENT]
3045
3051
  };
3046
- this.eventsSdkClass.options.debugOption && (s[this.eventsSdkClass.options.debugOption].includes(t) || this.eventsSdkClass.options.debugOption === ne.FULL) && this.log({
3052
+ console.log("IN SDK METHOD EVENT LOG", {
3053
+ debugOptions: this.eventsSdkClass.options.debugOption
3054
+ }), this.eventsSdkClass.options.debugOption && (console.log("IN SDK METHOD EVENT LOG 2", {
3055
+ includes: s[this.eventsSdkClass.options.debugOption].includes(t),
3056
+ isFull: this.eventsSdkClass.options.debugOption === te.FULL,
3057
+ willLog: s[this.eventsSdkClass.options.debugOption].includes(t) || this.eventsSdkClass.options.debugOption === te.FULL
3058
+ }), (s[this.eventsSdkClass.options.debugOption].includes(t) || this.eventsSdkClass.options.debugOption === te.FULL) && (console.log("IN SDK METHOD EVENT LOG 3", "LOGGING EVENT"), this.log({
3047
3059
  Message: `Event name: ${t}`,
3048
3060
  Body: e,
3049
3061
  ActionName: Y.WSCONNECT,
@@ -3051,12 +3063,12 @@ class rt {
3051
3063
  Status: "Successful",
3052
3064
  Level: z.DEBUG,
3053
3065
  LogType: Q.INFO
3054
- });
3066
+ })));
3055
3067
  }
3056
3068
  }
3057
3069
  class st {
3058
3070
  constructor(t) {
3059
- X(this, "listeners", {
3071
+ V(this, "listeners", {
3060
3072
  [j.ALL_EXTENSION_STATUS]: [],
3061
3073
  [j.ALL_DIALER_STATUS]: [],
3062
3074
  [j.ALL_USERS_STATUS]: [],
@@ -3069,7 +3081,7 @@ class st {
3069
3081
  [j.ONLINE_STATUS_EVENT]: [],
3070
3082
  [j.EXTENSIONS_UPDATED]: []
3071
3083
  });
3072
- X(this, "allListeners", []);
3084
+ V(this, "allListeners", []);
3073
3085
  this.eventsSdkClass = t, this.eventsSdkClass = t;
3074
3086
  }
3075
3087
  on(t, e) {
@@ -3100,19 +3112,19 @@ class st {
3100
3112
  }
3101
3113
  class ct {
3102
3114
  constructor(t) {
3103
- X(this, "options");
3104
- X(this, "servers", []);
3105
- X(this, "URLList", []);
3106
- X(this, "server");
3107
- X(this, "URL");
3108
- X(this, "socket");
3109
- X(this, "mainServer");
3110
- X(this, "alreadyAttemptedOtherServers", []);
3111
- X(this, "authClass", new Me(this));
3112
- X(this, "socketIoClass", new nt(this));
3113
- X(this, "loggerClass", new rt(this));
3114
- X(this, "eventEmitterClass", new st(this));
3115
- X(this, "getCircularReplacer", () => {
3115
+ V(this, "options");
3116
+ V(this, "servers", []);
3117
+ V(this, "URLList", []);
3118
+ V(this, "server");
3119
+ V(this, "URL");
3120
+ V(this, "socket");
3121
+ V(this, "mainServer");
3122
+ V(this, "alreadyAttemptedOtherServers", []);
3123
+ V(this, "authClass", new Me(this));
3124
+ V(this, "socketIoClass", new nt(this));
3125
+ V(this, "loggerClass", new rt(this));
3126
+ V(this, "eventEmitterClass", new st(this));
3127
+ V(this, "getCircularReplacer", () => {
3116
3128
  const t = /* @__PURE__ */ new WeakSet();
3117
3129
  return (e, s) => {
3118
3130
  if (!(e === "socket" || e === "io" || e === "nsps")) {
@@ -3137,9 +3149,9 @@ class ct {
3137
3149
  this.socketIoClass.io && this.socketIoClass.io.emit(t, ...e);
3138
3150
  }
3139
3151
  connect(t) {
3140
- t === te.MAIN && this.findMainServer(), t === te.NEXT && this.findNextServer(), this.socketIoClass.doReconnect = !0;
3152
+ t === ne.MAIN && this.findMainServer(), t === ne.NEXT && this.findNextServer(), this.socketIoClass.doReconnect = !0;
3141
3153
  try {
3142
- this.loggerClass.start();
3154
+ this.loggerClass.init();
3143
3155
  } catch (e) {
3144
3156
  console.error(e);
3145
3157
  }
@@ -3188,7 +3200,7 @@ export {
3188
3200
  We as CallStatusEnum,
3189
3201
  He as CallTypeEnum,
3190
3202
  re as ConnectionStatusEnum,
3191
- ne as DebugOption,
3203
+ te as DebugOption,
3192
3204
  Ye as DialerTypeEnum,
3193
3205
  Qe as DirectionEnum,
3194
3206
  Ze as DoNotCallMeStatusCodeEnum,
@@ -3198,7 +3210,7 @@ export {
3198
3210
  Z as LoginType,
3199
3211
  tt as QueueEventReasonEnum,
3200
3212
  Oe as ServerListenerEventsEnum,
3201
- te as ServerParameter,
3213
+ ne as ServerParameter,
3202
3214
  ct as default
3203
3215
  };
3204
3216
  //# sourceMappingURL=voicenter-events-sdk.es.js.map