@telegenta/webclient 2.0.12 → 3.0.1

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.
Files changed (105) hide show
  1. package/README.md +102 -81
  2. package/demos/add_phone_number.html +8 -7
  3. package/demos/calldata_available.html +5 -5
  4. package/demos/embedded_config.html +3 -3
  5. package/demos/event_client.html +226 -211
  6. package/demos/phone_client.html +540 -514
  7. package/demos/styles.css +0 -0
  8. package/dist/telegenta.js +3663 -0
  9. package/dist/telegenta.min.js +1 -0
  10. package/docs/EventClient.html +3 -1093
  11. package/docs/EventServiceNotConnected.html +3 -0
  12. package/docs/InvalidMediaDevice.html +3 -0
  13. package/docs/InvalidOptions.html +3 -0
  14. package/docs/InvalidParameter.html +3 -0
  15. package/docs/LogHandler.html +7 -0
  16. package/docs/MediaNotPrepared.html +3 -0
  17. package/docs/NoActiveSession.html +3 -0
  18. package/docs/NotAllowed.html +3 -0
  19. package/docs/NotReady.html +3 -0
  20. package/docs/Phone.html +4 -2837
  21. package/docs/Request.html +3 -0
  22. package/docs/Requestor.html +3 -0
  23. package/docs/Session.html +3 -2599
  24. package/docs/UnableToConnect.html +3 -0
  25. package/docs/data/search.json +1 -0
  26. package/docs/event-client.js.html +352 -0
  27. package/docs/exceptions.js.html +104 -0
  28. package/docs/fonts/Inconsolata-Regular.ttf +0 -0
  29. package/docs/fonts/OpenSans-Regular.ttf +0 -0
  30. package/docs/fonts/WorkSans-Bold.ttf +0 -0
  31. package/docs/global.html +5 -4950
  32. package/docs/index.html +3 -66
  33. package/docs/logger.js.html +106 -0
  34. package/docs/phone-client.js.html +2175 -0
  35. package/docs/requestor.js.html +223 -0
  36. package/docs/scripts/core.js +726 -0
  37. package/docs/scripts/core.min.js +23 -0
  38. package/docs/scripts/resize.js +90 -0
  39. package/docs/scripts/search.js +265 -0
  40. package/docs/scripts/search.min.js +6 -0
  41. package/docs/scripts/{prettify → third-party}/Apache-License-2.0.txt +202 -202
  42. package/docs/scripts/third-party/fuse.js +9 -0
  43. package/docs/scripts/third-party/hljs-line-num-original.js +369 -0
  44. package/docs/scripts/third-party/hljs-line-num.js +1 -0
  45. package/docs/scripts/third-party/hljs-original.js +5171 -0
  46. package/docs/scripts/third-party/hljs.js +1 -0
  47. package/docs/scripts/third-party/popper.js +5 -0
  48. package/docs/scripts/third-party/tippy.js +1 -0
  49. package/docs/scripts/third-party/tocbot.js +672 -0
  50. package/docs/scripts/third-party/tocbot.min.js +1 -0
  51. package/docs/styles/clean-jsdoc-theme-base.css +1159 -0
  52. package/docs/styles/clean-jsdoc-theme-dark.css +412 -0
  53. package/docs/styles/clean-jsdoc-theme-light.css +482 -0
  54. package/docs/styles/clean-jsdoc-theme-scrollbar.css +30 -0
  55. package/docs/styles/clean-jsdoc-theme-without-scrollbar.min.css +1 -0
  56. package/docs/styles/clean-jsdoc-theme.min.css +1 -0
  57. package/package.json +38 -26
  58. package/babel.config.js +0 -16
  59. package/browser/telegenta.min.js +0 -1
  60. package/demos/telegenta.min.js +0 -1
  61. package/docs/fonts/OpenSans-Bold-webfont.eot +0 -0
  62. package/docs/fonts/OpenSans-Bold-webfont.svg +0 -1830
  63. package/docs/fonts/OpenSans-Bold-webfont.woff +0 -0
  64. package/docs/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  65. package/docs/fonts/OpenSans-BoldItalic-webfont.svg +0 -1830
  66. package/docs/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  67. package/docs/fonts/OpenSans-Italic-webfont.eot +0 -0
  68. package/docs/fonts/OpenSans-Italic-webfont.svg +0 -1830
  69. package/docs/fonts/OpenSans-Italic-webfont.woff +0 -0
  70. package/docs/fonts/OpenSans-Light-webfont.eot +0 -0
  71. package/docs/fonts/OpenSans-Light-webfont.svg +0 -1831
  72. package/docs/fonts/OpenSans-Light-webfont.woff +0 -0
  73. package/docs/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  74. package/docs/fonts/OpenSans-LightItalic-webfont.svg +0 -1835
  75. package/docs/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  76. package/docs/fonts/OpenSans-Regular-webfont.eot +0 -0
  77. package/docs/fonts/OpenSans-Regular-webfont.svg +0 -1831
  78. package/docs/fonts/OpenSans-Regular-webfont.woff +0 -0
  79. package/docs/fonts/OpenSans-Semibold-webfont.eot +0 -0
  80. package/docs/fonts/OpenSans-Semibold-webfont.svg +0 -1830
  81. package/docs/fonts/OpenSans-Semibold-webfont.ttf +0 -0
  82. package/docs/fonts/OpenSans-Semibold-webfont.woff +0 -0
  83. package/docs/fonts/OpenSans-SemiboldItalic-webfont.eot +0 -0
  84. package/docs/fonts/OpenSans-SemiboldItalic-webfont.svg +0 -1830
  85. package/docs/fonts/OpenSans-SemiboldItalic-webfont.ttf +0 -0
  86. package/docs/fonts/OpenSans-SemiboldItalic-webfont.woff +0 -0
  87. package/docs/scripts/linenumber.js +0 -25
  88. package/docs/scripts/prettify/lang-css.js +0 -2
  89. package/docs/scripts/prettify/prettify.js +0 -28
  90. package/docs/styles/jsdoc-default.css +0 -692
  91. package/docs/styles/prettify-jsdoc.css +0 -111
  92. package/docs/styles/prettify-tomorrow.css +0 -132
  93. package/embedded_client/embedded_phone.js +0 -325
  94. package/embedded_client/index.html +0 -201
  95. package/embedded_client/server.php +0 -28
  96. package/embedded_client/styles.css +0 -310
  97. package/embedded_client/tiny_rest_client.php +0 -73
  98. package/embedded_client/webphone_sprites.png +0 -0
  99. package/es5/event-client.js +0 -277
  100. package/es5/index.js +0 -44
  101. package/es5/phone-client.js +0 -1336
  102. package/src/event-client.js +0 -1
  103. package/src/index.js +0 -10
  104. package/src/phone-client.js +0 -1
  105. package/webpack.config.js +0 -39
@@ -1,277 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.EventClient = void 0;
7
-
8
- var _common = require("@telegenta/common");
9
-
10
- const a0_0x3a92ef = a0_0x488e;
11
-
12
- (function (_0x12d3b3, _0x32fdfc) {
13
- const _0x5a3514 = a0_0x488e,
14
- _0x3c9baf = _0x12d3b3();
15
-
16
- while (!![]) {
17
- try {
18
- const _0x43507d = -parseInt(_0x5a3514(0x1b0)) / 0x1 * (parseInt(_0x5a3514(0x179)) / 0x2) + parseInt(_0x5a3514(0x1c9)) / 0x3 + -parseInt(_0x5a3514(0x1c7)) / 0x4 * (-parseInt(_0x5a3514(0x1a4)) / 0x5) + -parseInt(_0x5a3514(0x199)) / 0x6 + -parseInt(_0x5a3514(0x1c1)) / 0x7 * (-parseInt(_0x5a3514(0x1c6)) / 0x8) + parseInt(_0x5a3514(0x195)) / 0x9 + parseInt(_0x5a3514(0x1c8)) / 0xa * (parseInt(_0x5a3514(0x1a5)) / 0xb);
19
-
20
- if (_0x43507d === _0x32fdfc) break;else _0x3c9baf['push'](_0x3c9baf['shift']());
21
- } catch (_0x2f5b4c) {
22
- _0x3c9baf['push'](_0x3c9baf['shift']());
23
- }
24
- }
25
- })(a0_0x4c0a, 0xe39ca);
26
-
27
- function a0_0x488e(_0x47c6e3, _0x5aa6aa) {
28
- const _0x4c0a77 = a0_0x4c0a();
29
-
30
- return a0_0x488e = function a0_0x488e(_0x488e02, _0x3106bd) {
31
- _0x488e02 = _0x488e02 - 0x177;
32
- let _0x3b5d7b = _0x4c0a77[_0x488e02];
33
- return _0x3b5d7b;
34
- }, a0_0x488e(_0x47c6e3, _0x5aa6aa);
35
- }
36
-
37
- const PING_INTERVAL = 0x32,
38
- ES_DEFAULT_SERVER_URL = a0_0x3a92ef(0x196),
39
- RETRY_INTERVAL_START = 0x1 + Math[a0_0x3a92ef(0x188)](),
40
- RETRY_MAX_BACKOFF = 0x12c;
41
-
42
- class EventSubscription {
43
- constructor(_0x4fba20, _0x7c38f5, _0x59affb) {
44
- const _0xf29903 = a0_0x3a92ef;
45
- this['id'] = _0x4fba20, this[_0xf29903(0x19b)] = _0x7c38f5, this[_0xf29903(0x17c)] = _0x59affb;
46
- }
47
-
48
- [a0_0x3a92ef(0x186)](_0x53b5b2, _0x509ac7) {
49
- const _0x44d374 = a0_0x3a92ef;
50
- return this[_0x44d374(0x17c)][_0x44d374(0x1b3)](_0x53b5b2, [_0x509ac7]);
51
- }
52
-
53
- }
54
-
55
- function a0_0x4c0a() {
56
- const _0x485ce7 = ['resolve', 'Remote\x20unsubscribe\x20to\x20\x27', 'Invalid\x20subscription\x20id\x20for\x20event:\x20', 'ping', 'close', '_connectServer', 'warning', 'Unsubscribe\x20id:\x20', 'info', 'error', '1lZHOWt', '\x27\x20was\x20successful,\x20ID\x20=\x20', '\x27\x20failed:\x20', 'apply', '\x20payload:\x20', '_serverAddress', 'Received\x20event\x20for\x20subcription\x20id\x20', 'Connecting\x20to\x20event\x20server:\x20', '\x20failed:\x20', 'Your\x20event\x20specification\x20must\x20contain\x20event\x20name', '_reconnectRetrySeconds', 'floor', '_removeSubscription', '_previousSubscriptions', 'Auto\x20reconnect\x20disabled\x20(disconnecting?)', 'Unable\x20to\x20connect,\x20already\x20connected', 'ERROR', '56OrigyO', '_pingTimerObj', '_reconnectServer', 'connect', 'unsubscribe', '662456BZpuJo', '6008DSHkUD', '18990UxdhWi', '464130plrEsI', 'data', 'subscribe', 'splice', 'Subscription\x20to\x20\x27', 'hasOwnProperty', 'log', 'Unsubscribe\x20to\x20\x27', '1725680DTpKOJ', 'Unable\x20to\x20connect,\x20already\x20connecting', 'open', 'callback', 'catch', 'event_name', '_activeSubscriptions', 'reject', 'readyState', 'Disconnected\x20from\x20event\x20service', 'Unable\x20to\x20remove\x20subscription\x20', 'sendRequest', '_socket', 'doCallback', 'stringify', 'random', 'InvalidParameter', 'isConnected', 'Callback\x20had\x20unhandled\x20exception\x20', 'Successfully\x20connected\x20to\x20event\x20service', 'addEventListener', 'then', 'NoActiveSession', 'event', 'receiveMessage', 'Unable\x20to\x20connect,\x20socket\x20is\x20still\x20closing', 'Reconnecting\x20in\x20', 'Resubscribing\x20to\x20', '5429817MaKzsW', 'wss://api.telegenta.com/es/', 'LogHandler', '_autoReconnect', '8159778JjsSOL', 'Reconnect\x20attempt\x20successful', 'specification', 'You\x20must\x20specify\x20subscription\x20id', 'Event\x20', '_requestor', 'payload', 'debug', 'Websocket\x20connection\x20error', 'push', 'You\x20must\x20specify\x20both\x20event\x20spec\x20and\x20callback\x20function', '1855QvgqTM', '6820qcAMGe'];
57
-
58
- a0_0x4c0a = function a0_0x4c0a() {
59
- return _0x485ce7;
60
- };
61
-
62
- return a0_0x4c0a();
63
- }
64
-
65
- class EventClient {
66
- constructor() {
67
- let _0x1844da = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
68
-
69
- const _0x1e3a95 = a0_0x3a92ef;
70
- this[_0x1e3a95(0x185)] = null, this[_0x1e3a95(0x1bd)] = [], this[_0x1e3a95(0x17f)] = [], this[_0x1e3a95(0x1c2)] = null, this['_autoReconnect'] = ![], this[_0x1e3a95(0x1ba)] = RETRY_INTERVAL_START, this[_0x1e3a95(0x177)] = _0x1844da ? _0x1844da : new _common.Logger[_0x1e3a95(0x197)](_common.Logger['LOGLVL'][_0x1e3a95(0x1c0)]), this[_0x1e3a95(0x19e)] = new _common.Requestor(this[_0x1e3a95(0x177)]), this[_0x1e3a95(0x19e)]['on'](_0x1e3a95(0x190), _0x1f294f => {
71
- this['_handleIncomingEvent'](_0x1f294f);
72
- });
73
- }
74
-
75
- [a0_0x3a92ef(0x1c4)]() {
76
- let _0x38cd76 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
77
-
78
- const _0x427f96 = a0_0x3a92ef;
79
- return !_0x38cd76 && (_0x38cd76 = ES_DEFAULT_SERVER_URL), this['_serverAddress'] = _0x38cd76, this[_0x427f96(0x1bd)] = [], this[_0x427f96(0x17f)] = [], this[_0x427f96(0x1ab)]();
80
- }
81
-
82
- ['disconnect']() {
83
- const _0x2d8b68 = a0_0x3a92ef;
84
- if (this[_0x2d8b68(0x185)]['readyState'] !== 0x1) throw new _common.Exceptions[_0x2d8b68(0x18f)]();
85
- this[_0x2d8b68(0x17f)] = [], this['_autoReconnect'] = ![], this[_0x2d8b68(0x185)][_0x2d8b68(0x1aa)]();
86
- }
87
-
88
- [a0_0x3a92ef(0x18a)]() {
89
- const _0x5d06a4 = a0_0x3a92ef;
90
- return this['_socket'] ? this[_0x5d06a4(0x185)]['readyState'] === 0x1 : ![];
91
- }
92
-
93
- [a0_0x3a92ef(0x1cb)](_0x359a76, _0x56d21a) {
94
- const _0x56507c = a0_0x3a92ef;
95
- if (!_0x359a76 || !_0x56d21a) throw new _common.Exceptions['InvalidParameter'](_0x56507c(0x1a3));
96
- if (!_0x359a76[_0x56507c(0x1ce)](_0x56507c(0x17e))) throw new _common.Exceptions['InvalidParameter'](_0x56507c(0x1b9));
97
- if (!this['isConnected']()) throw new _common.Exceptions['NoActiveSession']();
98
-
99
- const _0x5a31a9 = this;
100
-
101
- return new Promise(function (_0x26a73e, _0x41e16b) {
102
- const _0x59862d = _0x56507c;
103
-
104
- _0x5a31a9[_0x59862d(0x19e)][_0x59862d(0x184)](_0x5a31a9[_0x59862d(0x185)], _0x59862d(0x1cb), _0x359a76)['then'](function (_0x4e69fa) {
105
- const _0x32a3c2 = _0x59862d;
106
- _0x5a31a9[_0x32a3c2(0x177)][_0x32a3c2(0x1a0)](_0x32a3c2(0x1cd) + _0x359a76[_0x32a3c2(0x17e)] + _0x32a3c2(0x1b1) + _0x4e69fa), _0x5a31a9['_activeSubscriptions'][_0x32a3c2(0x1a2)](new EventSubscription(_0x4e69fa, _0x359a76, _0x56d21a)), _0x26a73e(_0x4e69fa);
107
- }, function (_0x1db867) {
108
- const _0x23a90a = _0x59862d;
109
- _0x5a31a9[_0x23a90a(0x177)][_0x23a90a(0x1ac)](_0x23a90a(0x1cd) + _0x359a76[_0x23a90a(0x17e)] + _0x23a90a(0x1b2) + _0x1db867), _0x41e16b(_0x1db867);
110
- });
111
- });
112
- }
113
-
114
- [a0_0x3a92ef(0x1c5)](_0x52d30a) {
115
- const _0x10d0af = a0_0x3a92ef;
116
- if (!_0x52d30a) throw new _common.Exceptions[_0x10d0af(0x189)](_0x10d0af(0x19c));
117
- if (!this[_0x10d0af(0x18a)]()) throw new _common.Exceptions[_0x10d0af(0x18f)]();
118
-
119
- this['log'][_0x10d0af(0x1ae)](_0x10d0af(0x1ad) + _0x52d30a);
120
-
121
- const _0x284315 = this;
122
-
123
- return new Promise(function (_0x20375e, _0x3f48ba) {
124
- const _0x2d1127 = _0x10d0af;
125
-
126
- _0x284315[_0x2d1127(0x19e)][_0x2d1127(0x184)](_0x284315['_socket'], _0x2d1127(0x1c5), {
127
- 'id': _0x52d30a
128
- })[_0x2d1127(0x18e)](_0x29a9c2 => {
129
- const _0x101a81 = _0x2d1127;
130
- _0x284315[_0x101a81(0x177)][_0x101a81(0x1ae)](_0x101a81(0x178) + _0x52d30a + '\x27\x20was\x20successful'), _0x284315[_0x101a81(0x1bc)](_0x52d30a), _0x20375e(_0x29a9c2);
131
- }, _0x5b72 => {
132
- const _0x289da8 = _0x2d1127;
133
- _0x284315['log'][_0x289da8(0x1ac)](_0x289da8(0x1a7) + _0x52d30a + _0x289da8(0x1b2) + _0x5b72), _0x3f48ba(_0x5b72);
134
- });
135
- });
136
- }
137
-
138
- ['fireEvent'](_0x4e07b2, _0x1425fb) {
139
- const _0x2b8b60 = a0_0x3a92ef;
140
- if (!this['isConnected']()) throw new _common.Exceptions[_0x2b8b60(0x18f)]();
141
- return new Promise((_0x21b926, _0x43c4b8) => {
142
- const _0x5c44de = _0x2b8b60;
143
-
144
- this[_0x5c44de(0x19e)][_0x5c44de(0x184)](this[_0x5c44de(0x185)], _0x4e07b2, _0x1425fb)[_0x5c44de(0x18e)](_0x3ddee3 => {
145
- const _0x195a11 = _0x5c44de;
146
- this[_0x195a11(0x177)][_0x195a11(0x1ae)]('Event\x20' + _0x4e07b2 + '\x20was\x20successful'), _0x21b926(_0x3ddee3);
147
- }, _0x2de057 => {
148
- const _0x38e8bf = _0x5c44de;
149
- this[_0x38e8bf(0x177)][_0x38e8bf(0x1ac)](_0x38e8bf(0x19d) + _0x4e07b2 + '\x20failed:\x20' + _0x2de057), _0x43c4b8(_0x2de057);
150
- });
151
- });
152
- }
153
-
154
- ['_removeSubscription'](_0x3bdf69) {
155
- const _0x17968d = a0_0x3a92ef;
156
-
157
- for (let _0x246fdb in this['_activeSubscriptions']) {
158
- if (this[_0x17968d(0x17f)][_0x246fdb]['id'] === _0x3bdf69) return this['log'][_0x17968d(0x1a0)]('Removed\x20local\x20subscription:\x20' + _0x3bdf69), this[_0x17968d(0x17f)][_0x17968d(0x1cc)](_0x246fdb, 0x1), !![];
159
- }
160
-
161
- return this[_0x17968d(0x177)][_0x17968d(0x1ac)](_0x17968d(0x183) + _0x3bdf69 + '\x20locally,\x20not\x20found?'), ![];
162
- }
163
-
164
- [a0_0x3a92ef(0x1ab)]() {
165
- const _0x1a1223 = a0_0x3a92ef;
166
-
167
- this[_0x1a1223(0x177)]['info'](_0x1a1223(0x1b7) + this[_0x1a1223(0x1b5)]);
168
-
169
- const _0x4b4af8 = this;
170
-
171
- return new Promise(function (_0x29fa7b, _0x1f1a7e) {
172
- const _0x516214 = _0x1a1223;
173
- if (_0x4b4af8[_0x516214(0x185)]) switch (_0x4b4af8[_0x516214(0x185)][_0x516214(0x181)]) {
174
- case 0x0:
175
- _0x1f1a7e(_0x516214(0x17a));
176
-
177
- return;
178
-
179
- case 0x1:
180
- _0x1f1a7e(_0x516214(0x1bf));
181
-
182
- return;
183
-
184
- case 0x2:
185
- _0x1f1a7e(_0x516214(0x192));
186
-
187
- return;
188
- }
189
- _0x4b4af8['_socket'] = new WebSocket(_0x4b4af8['_serverAddress']);
190
-
191
- let _0x3897eb = ![];
192
-
193
- _0x4b4af8[_0x516214(0x185)][_0x516214(0x18d)](_0x516214(0x17b), function () {
194
- const _0x5128b4 = _0x516214;
195
- _0x4b4af8[_0x5128b4(0x177)][_0x5128b4(0x1ae)](_0x5128b4(0x18c)), _0x3897eb = !![], _0x4b4af8[_0x5128b4(0x198)] = !![], _0x4b4af8['_reconnectRetrySeconds'] = RETRY_INTERVAL_START, _0x4b4af8[_0x5128b4(0x185)][_0x5128b4(0x18d)]('message', function (_0x36a2b7) {
196
- const _0x1a692c = _0x5128b4;
197
-
198
- _0x4b4af8['_requestor'][_0x1a692c(0x191)](_0x4b4af8[_0x1a692c(0x185)], _0x36a2b7[_0x1a692c(0x1ca)]);
199
- }), clearTimeout(_0x4b4af8['_pingTimerObj']), _0x4b4af8[_0x5128b4(0x1c2)] = setInterval(function () {
200
- const _0x4c14e3 = _0x5128b4;
201
-
202
- _0x4b4af8['_requestor'][_0x4c14e3(0x1a9)](_0x4b4af8[_0x4c14e3(0x185)])[_0x4c14e3(0x18e)](function () {}, function (_0x49f44b) {
203
- const _0x1f256f = _0x4c14e3;
204
- _0x4b4af8['log'][_0x1f256f(0x1ac)]('Ping\x20failed:\x20' + _0x49f44b), _0x4b4af8[_0x1f256f(0x1c3)]();
205
- });
206
- }, PING_INTERVAL * 0x3e8), _0x4b4af8['_previousSubscriptions'] = _0x4b4af8['_activeSubscriptions'], _0x4b4af8[_0x5128b4(0x17f)] = [];
207
-
208
- for (let _0x4954be of _0x4b4af8[_0x5128b4(0x1bd)]) {
209
- _0x4b4af8['subscribe'](_0x4954be[_0x5128b4(0x19b)], _0x4954be[_0x5128b4(0x17c)])[_0x5128b4(0x17d)](function (_0x2049f8) {
210
- const _0x578b26 = _0x5128b4;
211
-
212
- _0x4b4af8[_0x578b26(0x177)][_0x578b26(0x1af)](_0x578b26(0x194) + _0x4954be['specification'][_0x578b26(0x17e)] + _0x578b26(0x1b8) + _0x2049f8);
213
- });
214
- }
215
-
216
- _0x29fa7b();
217
- }), _0x4b4af8[_0x516214(0x185)][_0x516214(0x18d)](_0x516214(0x1aa), function () {
218
- const _0x1f4b3b = _0x516214;
219
- _0x4b4af8[_0x1f4b3b(0x177)][_0x1f4b3b(0x1ae)](_0x1f4b3b(0x182)), clearTimeout(_0x4b4af8['_pingTimerObj']), _0x4b4af8['_reconnectServer']();
220
- }), _0x4b4af8[_0x516214(0x185)]['addEventListener'](_0x516214(0x1af), function (_0x16fff2) {
221
- const _0x15a513 = _0x516214;
222
- _0x4b4af8[_0x15a513(0x177)][_0x15a513(0x1af)](_0x15a513(0x1a1)), !_0x3897eb && _0x1f1a7e('Unable\x20to\x20connect:\x20' + _0x16fff2);
223
- });
224
- });
225
- }
226
-
227
- [a0_0x3a92ef(0x1c3)]() {
228
- const _0x32265b = a0_0x3a92ef;
229
-
230
- if (this['_autoReconnect']) {
231
- const _0x72029b = Math[_0x32265b(0x1bb)](this['_reconnectRetrySeconds']);
232
-
233
- this[_0x32265b(0x177)][_0x32265b(0x1ae)](_0x32265b(0x193) + _0x72029b + '\x20secs');
234
-
235
- const _0x2ddcc4 = this;
236
-
237
- setTimeout(function () {
238
- const _0x3652f9 = _0x32265b;
239
- _0x2ddcc4['_connectServer']()[_0x3652f9(0x18e)](function () {
240
- const _0x489ec1 = _0x3652f9;
241
-
242
- _0x2ddcc4[_0x489ec1(0x177)]['info'](_0x489ec1(0x19a));
243
- }, function () {
244
- const _0x3f13c0 = _0x3652f9;
245
-
246
- _0x2ddcc4[_0x3f13c0(0x177)][_0x3f13c0(0x1ac)]('Reconnect\x20attempt\x20failed');
247
- }), _0x2ddcc4[_0x3652f9(0x1ba)] <= RETRY_MAX_BACKOFF && (_0x2ddcc4['_reconnectRetrySeconds'] = _0x2ddcc4[_0x3652f9(0x1ba)] * 0x2);
248
- }, _0x2ddcc4[_0x32265b(0x1ba)] * 0x3e8);
249
- } else this['log'][_0x32265b(0x1ae)](_0x32265b(0x1be));
250
- }
251
-
252
- ['_handleIncomingEvent'](_0x325c99) {
253
- const _0x1255e8 = a0_0x3a92ef,
254
- _0x58dab0 = _0x325c99[_0x1255e8(0x1ca)]['subscription_id'];
255
-
256
- for (let _0x5b893c of this[_0x1255e8(0x17f)]) {
257
- if (_0x5b893c['id'] === _0x58dab0) {
258
- this[_0x1255e8(0x177)][_0x1255e8(0x1a0)](_0x1255e8(0x1b6) + _0x5b893c['id'] + _0x1255e8(0x1b4) + JSON[_0x1255e8(0x187)](_0x325c99[_0x1255e8(0x1ca)][_0x1255e8(0x19f)]));
259
-
260
- try {
261
- _0x5b893c['callback'](_0x325c99[_0x1255e8(0x1ca)]['payload']);
262
- } catch (_0x5d702d) {
263
- this[_0x1255e8(0x177)][_0x1255e8(0x1ac)](_0x1255e8(0x18b) + _0x5d702d), _0x325c99[_0x1255e8(0x1a6)]();
264
- }
265
-
266
- _0x325c99[_0x1255e8(0x1a6)]();
267
-
268
- return;
269
- }
270
- }
271
-
272
- _0x325c99[_0x1255e8(0x180)](_0x1255e8(0x1a8) + _0x58dab0);
273
- }
274
-
275
- }
276
-
277
- exports.EventClient = EventClient;
package/es5/index.js DELETED
@@ -1,44 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _common = require("@telegenta/common");
8
-
9
- Object.keys(_common).forEach(function (key) {
10
- if (key === "default" || key === "__esModule") return;
11
- if (key in exports && exports[key] === _common[key]) return;
12
- Object.defineProperty(exports, key, {
13
- enumerable: true,
14
- get: function get() {
15
- return _common[key];
16
- }
17
- });
18
- });
19
-
20
- var _eventClient = require("./event-client");
21
-
22
- Object.keys(_eventClient).forEach(function (key) {
23
- if (key === "default" || key === "__esModule") return;
24
- if (key in exports && exports[key] === _eventClient[key]) return;
25
- Object.defineProperty(exports, key, {
26
- enumerable: true,
27
- get: function get() {
28
- return _eventClient[key];
29
- }
30
- });
31
- });
32
-
33
- var _phoneClient = require("./phone-client");
34
-
35
- Object.keys(_phoneClient).forEach(function (key) {
36
- if (key === "default" || key === "__esModule") return;
37
- if (key in exports && exports[key] === _phoneClient[key]) return;
38
- Object.defineProperty(exports, key, {
39
- enumerable: true,
40
- get: function get() {
41
- return _phoneClient[key];
42
- }
43
- });
44
- });