@jibb-open/jssdk 3.17.7 → 3.18.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.
- package/api/auth.js +126 -1
- package/api/cisco.js +37 -1
- package/api/eventbus.js +150 -1
- package/api/index.js +21 -1
- package/api/meeting.js +332 -1
- package/api/recording.js +55 -1
- package/api/user.js +24 -1
- package/api/webexbot.js +23 -1
- package/api/whiteboard.js +116 -1
- package/config.js +9 -1
- package/package.json +3 -1
- package/types/exceptions.js +68 -1
- package/types/jibb.pb.js +7067 -1
- package/types/proto.js +5 -1
- package/types/types.js +167 -1
- package/utils/cached_variable.js +18 -1
- package/utils/future.js +24 -1
- package/utils/http/http.axios.js +38 -1
- package/utils/http/index.js +9 -1
- package/utils/index.js +4 -1
- package/utils/logger/index.js +9 -1
- package/utils/logger/logger.empty.js +9 -1
- package/utils/logger/logger.pino.js +12 -1
- package/ws/connection_base.js +125 -1
- package/ws/eventbus.js +293 -1
- package/ws/index.js +11 -1
- package/ws/ipsa.js +161 -1
- package/ws/meeting.js +179 -1
- package/ws/observable_connection.js +91 -1
- package/ws/retry_connection.js +107 -1
package/ws/meeting.js
CHANGED
|
@@ -1 +1,179 @@
|
|
|
1
|
-
|
|
1
|
+
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
|
2
|
+
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
|
3
|
+
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
4
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
5
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
|
6
|
+
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
|
7
|
+
import "core-js/modules/es.array-buffer.constructor.js";
|
|
8
|
+
import "core-js/modules/es.array-buffer.slice.js";
|
|
9
|
+
import "core-js/modules/es.global-this.js";
|
|
10
|
+
import "core-js/modules/es.promise.js";
|
|
11
|
+
import "core-js/modules/es.typed-array.uint8-array.js";
|
|
12
|
+
import "core-js/modules/es.typed-array.fill.js";
|
|
13
|
+
import "core-js/modules/es.typed-array.set.js";
|
|
14
|
+
import "core-js/modules/es.typed-array.sort.js";
|
|
15
|
+
import "core-js/modules/es.typed-array.to-locale-string.js";
|
|
16
|
+
import "core-js/modules/es.weak-map.js";
|
|
17
|
+
import "core-js/modules/web.dom-collections.iterator.js";
|
|
18
|
+
import "core-js/modules/web.url.js";
|
|
19
|
+
import "core-js/modules/web.url.to-json.js";
|
|
20
|
+
import "core-js/modules/web.url-search-params.js";
|
|
21
|
+
import { getUserClaims } from '../api/auth.js';
|
|
22
|
+
import { Config } from "../config.js";
|
|
23
|
+
import { logger } from "../utils/logger/index.js";
|
|
24
|
+
import { MeetingClaims } from "../types/types.js";
|
|
25
|
+
import { meeting, types } from "../types/proto.js";
|
|
26
|
+
import { PermissionDeniedError, SessionTimeoutError } from '../types/exceptions.js';
|
|
27
|
+
import { ObservableRetryConnection } from './observable_connection.js';
|
|
28
|
+
let Message = meeting.Message;
|
|
29
|
+
let ErrorCode = types.Code;
|
|
30
|
+
if ((globalThis === null || globalThis === void 0 ? void 0 : globalThis.WebSocket) == undefined) {
|
|
31
|
+
import("isomorphic-ws").then(webSocket => {
|
|
32
|
+
globalThis.WebSocket = webSocket.default;
|
|
33
|
+
}).catch(err => {
|
|
34
|
+
console.log(err);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
var _expiryTimer = /*#__PURE__*/new WeakMap();
|
|
38
|
+
var _MeetingConnectionImp_brand = /*#__PURE__*/new WeakSet();
|
|
39
|
+
class MeetingConnectionImp extends ObservableRetryConnection {
|
|
40
|
+
constructor() {
|
|
41
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
42
|
+
maxRetryCount: 10,
|
|
43
|
+
minRetryIntervalMs: 500,
|
|
44
|
+
maxRetryIntervalMs: 32000
|
|
45
|
+
};
|
|
46
|
+
super('meeting', options);
|
|
47
|
+
_classPrivateMethodInitSpec(this, _MeetingConnectionImp_brand);
|
|
48
|
+
_classPrivateFieldInitSpec(this, _expiryTimer, void 0);
|
|
49
|
+
this.meetingId = null;
|
|
50
|
+
this.meetingToken = null;
|
|
51
|
+
_classPrivateFieldSet(_expiryTimer, this, null);
|
|
52
|
+
}
|
|
53
|
+
start(meetingToken) {
|
|
54
|
+
this.meetingToken = meetingToken;
|
|
55
|
+
this.meetingClaims = new MeetingClaims(meetingToken);
|
|
56
|
+
this.meetingId = this.meetingClaims.meetindId;
|
|
57
|
+
this.name = "meeting-".concat(this.meetingId);
|
|
58
|
+
let seconds = this.meetingClaims.getSecondsUntilExpiry();
|
|
59
|
+
if (seconds <= 0) {
|
|
60
|
+
let e = new PermissionDeniedError("meeting token expired");
|
|
61
|
+
this.onError(e);
|
|
62
|
+
throw e;
|
|
63
|
+
}
|
|
64
|
+
_classPrivateFieldSet(_expiryTimer, this, setTimeout(() => {
|
|
65
|
+
this.stop();
|
|
66
|
+
this.onError(new SessionTimeoutError("meeting token expired"));
|
|
67
|
+
}, seconds));
|
|
68
|
+
super.start();
|
|
69
|
+
}
|
|
70
|
+
stop() {
|
|
71
|
+
clearTimeout(_classPrivateFieldGet(_expiryTimer, this));
|
|
72
|
+
super.stop();
|
|
73
|
+
}
|
|
74
|
+
async getURI() {
|
|
75
|
+
try {
|
|
76
|
+
if (this.meetingClaims.isExpired()) {
|
|
77
|
+
let e = new PermissionDeniedError("meeting token expired");
|
|
78
|
+
this.onError(e);
|
|
79
|
+
throw e;
|
|
80
|
+
}
|
|
81
|
+
} catch (err) {
|
|
82
|
+
let e = new PermissionDeniedError(err);
|
|
83
|
+
throw e;
|
|
84
|
+
}
|
|
85
|
+
let base = new URL(Config.apiBaseURL);
|
|
86
|
+
let url = base.host + (base.pathname !== '/' ? base.pathname : '');
|
|
87
|
+
return "wss://" + url + "/ws/meetings/" + this.meetingId + "?meeting_token=" + this.meetingToken;
|
|
88
|
+
}
|
|
89
|
+
async onData(msg) {
|
|
90
|
+
try {
|
|
91
|
+
if (msg instanceof ArrayBuffer) {
|
|
92
|
+
let buffer = new Uint8Array(msg);
|
|
93
|
+
let event = Message.decode(buffer);
|
|
94
|
+
if (event !== null && event !== void 0 && event.update) {
|
|
95
|
+
this.notify('onMeetingUpdate', event.update);
|
|
96
|
+
await _assertClassBrand(_MeetingConnectionImp_brand, this, _sendImageAck).call(this, event.update.userId);
|
|
97
|
+
}
|
|
98
|
+
if (event !== null && event !== void 0 && event.drawing) this.notify('onDrawing', event.drawing);else if (event !== null && event !== void 0 && event.mousePointer) this.notify('onMousePointer', event.mousePointer);else if (event !== null && event !== void 0 && event.indexPointer) this.notify('onIndexPointer', event.indexPointer);else if (event !== null && event !== void 0 && event.join) this.notify('onMeetingJoin', event.join);else if (event !== null && event !== void 0 && event.leave) this.notify('onMeetingLeave', event.leave);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
} catch (err) {
|
|
102
|
+
logger.error(err);
|
|
103
|
+
}
|
|
104
|
+
this.parseJSONResponse(msg);
|
|
105
|
+
}
|
|
106
|
+
async sendMousePointer(x, y, email) {
|
|
107
|
+
let username = "";
|
|
108
|
+
if (email != "") {
|
|
109
|
+
username = email;
|
|
110
|
+
} else {
|
|
111
|
+
try {
|
|
112
|
+
let claims = await getUserClaims();
|
|
113
|
+
username = claims.email;
|
|
114
|
+
} catch (err) {
|
|
115
|
+
username = email;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
let msg = Message.fromObject({
|
|
119
|
+
mousePointer: {
|
|
120
|
+
email: username,
|
|
121
|
+
x: x,
|
|
122
|
+
y: y
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
let buf = Message.encode(msg).finish();
|
|
126
|
+
await this.write(buf);
|
|
127
|
+
}
|
|
128
|
+
async sendIndexPointer(x, y, email) {
|
|
129
|
+
let username = "";
|
|
130
|
+
if (email != "") {
|
|
131
|
+
username = email;
|
|
132
|
+
} else {
|
|
133
|
+
try {
|
|
134
|
+
let claims = await getUserClaims();
|
|
135
|
+
username = claims.email;
|
|
136
|
+
} catch (err) {
|
|
137
|
+
username = email;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
let msg = Message.fromObject({
|
|
141
|
+
indexPointer: {
|
|
142
|
+
email: username,
|
|
143
|
+
x: x,
|
|
144
|
+
y: y
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
let buf = Message.encode(msg).finish();
|
|
148
|
+
await this.write(buf);
|
|
149
|
+
}
|
|
150
|
+
async sendDrawing(_ref) {
|
|
151
|
+
let {
|
|
152
|
+
email,
|
|
153
|
+
data
|
|
154
|
+
} = _ref;
|
|
155
|
+
let msg = Message.fromObject({
|
|
156
|
+
drawing: {
|
|
157
|
+
email: email,
|
|
158
|
+
data: data
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
logger.debug("".concat(this.name, ".Drawing: "), Message.toObject(msg));
|
|
162
|
+
let buf = Message.encode(msg).finish();
|
|
163
|
+
await this.write(buf);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
async function _sendImageAck(userId) {
|
|
167
|
+
let msg = Message.fromObject({
|
|
168
|
+
imageAck: {
|
|
169
|
+
userId: userId
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
let buf = Message.encode(msg).finish();
|
|
173
|
+
await this.write(buf);
|
|
174
|
+
}
|
|
175
|
+
export let MeetingConnection = new MeetingConnectionImp({
|
|
176
|
+
maxRetryCount: 10,
|
|
177
|
+
minRetryIntervalMs: 500,
|
|
178
|
+
maxRetryIntervalMs: 8000
|
|
179
|
+
});
|
|
@@ -1 +1,91 @@
|
|
|
1
|
-
|
|
1
|
+
import "core-js/modules/es.weak-map.js";
|
|
2
|
+
import "core-js/modules/web.dom-collections.iterator.js";
|
|
3
|
+
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
|
4
|
+
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
5
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
6
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
|
7
|
+
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
|
8
|
+
import { logger } from "../utils/logger/index.js";
|
|
9
|
+
import { RetryConnection } from "./retry_connection.js";
|
|
10
|
+
var _lastId = /*#__PURE__*/new WeakMap();
|
|
11
|
+
export class Observable {
|
|
12
|
+
constructor() {
|
|
13
|
+
_classPrivateFieldInitSpec(this, _lastId, void 0);
|
|
14
|
+
this.observers = new Map();
|
|
15
|
+
_classPrivateFieldSet(_lastId, this, 0);
|
|
16
|
+
}
|
|
17
|
+
addEventListener(observer) {
|
|
18
|
+
_classPrivateFieldSet(_lastId, this, _classPrivateFieldGet(_lastId, this) + 1);
|
|
19
|
+
this.observers.set(_classPrivateFieldGet(_lastId, this), observer);
|
|
20
|
+
return _classPrivateFieldGet(_lastId, this);
|
|
21
|
+
}
|
|
22
|
+
removeEventListeners() {
|
|
23
|
+
this.observers = new Map();
|
|
24
|
+
}
|
|
25
|
+
removeEventListener(id) {
|
|
26
|
+
try {
|
|
27
|
+
this.observers.delete(id);
|
|
28
|
+
} catch (err) {
|
|
29
|
+
logger.error(err);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
notify(eventName) {
|
|
33
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
34
|
+
args[_key - 1] = arguments[_key];
|
|
35
|
+
}
|
|
36
|
+
this.observers.forEach(o => {
|
|
37
|
+
try {
|
|
38
|
+
let fn = o[eventName];
|
|
39
|
+
fn && fn(...args);
|
|
40
|
+
} catch (err) {
|
|
41
|
+
logger.error("Error occured notifying event ".concat(eventName), err);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export class ObservableRetryConnection extends RetryConnection {
|
|
47
|
+
constructor(connectionName) {
|
|
48
|
+
let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
49
|
+
maxRetryCount: 10,
|
|
50
|
+
minRetryIntervalMs: 500,
|
|
51
|
+
maxRetryIntervalMs: 32000
|
|
52
|
+
};
|
|
53
|
+
super(connectionName, props);
|
|
54
|
+
this.observable = new Observable();
|
|
55
|
+
}
|
|
56
|
+
addEventListener(observer) {
|
|
57
|
+
return this.observable.addEventListener(observer);
|
|
58
|
+
}
|
|
59
|
+
removeEventListeners() {
|
|
60
|
+
this.observable.removeEventListeners();
|
|
61
|
+
}
|
|
62
|
+
removeEventListener(id) {
|
|
63
|
+
this.observable.removeEventListener(id);
|
|
64
|
+
}
|
|
65
|
+
notify(eventName) {
|
|
66
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
67
|
+
args[_key2 - 1] = arguments[_key2];
|
|
68
|
+
}
|
|
69
|
+
this.observable.notify(eventName, ...args);
|
|
70
|
+
}
|
|
71
|
+
onDisconnected() {
|
|
72
|
+
super.onDisconnected();
|
|
73
|
+
this.observable.notify("onDisconnected");
|
|
74
|
+
}
|
|
75
|
+
onConnected() {
|
|
76
|
+
super.onConnected();
|
|
77
|
+
this.observable.notify("onConnected");
|
|
78
|
+
}
|
|
79
|
+
onStarted() {
|
|
80
|
+
super.onStarted();
|
|
81
|
+
this.observable.notify("onStarted");
|
|
82
|
+
}
|
|
83
|
+
onStopped() {
|
|
84
|
+
super.onStopped();
|
|
85
|
+
this.observable.notify("onStopped");
|
|
86
|
+
}
|
|
87
|
+
onError(e) {
|
|
88
|
+
super.onError(e);
|
|
89
|
+
this.observable.notify("onError", e);
|
|
90
|
+
}
|
|
91
|
+
}
|
package/ws/retry_connection.js
CHANGED
|
@@ -1 +1,107 @@
|
|
|
1
|
-
|
|
1
|
+
import "core-js/modules/es.weak-map.js";
|
|
2
|
+
import "core-js/modules/web.dom-collections.iterator.js";
|
|
3
|
+
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
|
4
|
+
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
|
5
|
+
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
6
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
7
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
|
8
|
+
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
|
9
|
+
import { PermissionDeniedError, SessionTimeoutError, TooManyConnectionsError } from "../types/exceptions.js";
|
|
10
|
+
import { logger } from "../utils/logger/index.js";
|
|
11
|
+
import { ConnectionBase } from "./connection_base.js";
|
|
12
|
+
var _started = /*#__PURE__*/new WeakMap();
|
|
13
|
+
var _connectionTimer = /*#__PURE__*/new WeakMap();
|
|
14
|
+
var _resetCountersTimer = /*#__PURE__*/new WeakMap();
|
|
15
|
+
var _RetryConnection_brand = /*#__PURE__*/new WeakSet();
|
|
16
|
+
export class RetryConnection extends ConnectionBase {
|
|
17
|
+
constructor(connectionName) {
|
|
18
|
+
let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
19
|
+
maxRetryCount: 10,
|
|
20
|
+
minRetryIntervalMs: 500,
|
|
21
|
+
maxRetryIntervalMs: 32000
|
|
22
|
+
};
|
|
23
|
+
super(connectionName);
|
|
24
|
+
_classPrivateMethodInitSpec(this, _RetryConnection_brand);
|
|
25
|
+
_classPrivateFieldInitSpec(this, _started, void 0);
|
|
26
|
+
_classPrivateFieldInitSpec(this, _connectionTimer, void 0);
|
|
27
|
+
_classPrivateFieldInitSpec(this, _resetCountersTimer, void 0);
|
|
28
|
+
this.maxRetryCount = props.maxRetryCount || 10;
|
|
29
|
+
this.minRetryIntervalMs = props.minRetryIntervalMs || 500;
|
|
30
|
+
this.maxRetryIntervalMs = props.maxRetryIntervalMs || 32000;
|
|
31
|
+
_classPrivateFieldSet(_connectionTimer, this, null);
|
|
32
|
+
_classPrivateFieldSet(_resetCountersTimer, this, null);
|
|
33
|
+
_classPrivateFieldSet(_started, this, false);
|
|
34
|
+
_assertClassBrand(_RetryConnection_brand, this, _resetCounters).call(this);
|
|
35
|
+
}
|
|
36
|
+
start() {
|
|
37
|
+
if (!this.isStarted()) {
|
|
38
|
+
logger.info("".concat(this.name, ": starting..."));
|
|
39
|
+
_classPrivateFieldSet(_started, this, true);
|
|
40
|
+
_assertClassBrand(_RetryConnection_brand, this, _resetCounters).call(this);
|
|
41
|
+
_assertClassBrand(_RetryConnection_brand, this, _reconnect).call(this);
|
|
42
|
+
this.onStarted();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
stop() {
|
|
46
|
+
logger.info("".concat(this.name, ": stopping..."));
|
|
47
|
+
_classPrivateFieldSet(_started, this, false);
|
|
48
|
+
this.disconnect();
|
|
49
|
+
this.onStopped();
|
|
50
|
+
}
|
|
51
|
+
isStarted() {
|
|
52
|
+
return _classPrivateFieldGet(_started, this);
|
|
53
|
+
}
|
|
54
|
+
onDisconnected() {
|
|
55
|
+
super.onDisconnected();
|
|
56
|
+
_assertClassBrand(_RetryConnection_brand, this, _reconnect).call(this);
|
|
57
|
+
}
|
|
58
|
+
onStarted() {}
|
|
59
|
+
onStopped() {}
|
|
60
|
+
onError(err) {
|
|
61
|
+
super.onError(err);
|
|
62
|
+
if (err instanceof TooManyConnectionsError || err instanceof PermissionDeniedError || err instanceof SessionTimeoutError) this.stop();
|
|
63
|
+
}
|
|
64
|
+
disconnect() {
|
|
65
|
+
clearTimeout(_classPrivateFieldGet(_connectionTimer, this));
|
|
66
|
+
clearTimeout(_classPrivateFieldGet(_resetCountersTimer, this));
|
|
67
|
+
super.disconnect();
|
|
68
|
+
}
|
|
69
|
+
setCounters() {
|
|
70
|
+
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
71
|
+
maxRetryCount: 10,
|
|
72
|
+
minRetryIntervalMs: 500,
|
|
73
|
+
maxRetryIntervalMs: 32000
|
|
74
|
+
};
|
|
75
|
+
this.maxRetryCount = props.maxRetryCount || 10;
|
|
76
|
+
this.minRetryIntervalMs = props.minRetryIntervalMs || 500;
|
|
77
|
+
this.maxRetryIntervalMs = props.maxRetryIntervalMs || 32000;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function _reconnect() {
|
|
81
|
+
if (!this.isStarted()) return;else if (this.retryCount > this.maxRetryCount) {
|
|
82
|
+
this.stop();
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
let diff = Math.max(this.nexRetryTime - Date.now(), 0);
|
|
86
|
+
if (diff > 0) {
|
|
87
|
+
logger.debug(this);
|
|
88
|
+
logger.info("".concat(this.name, ": retrying connection in ").concat(this.retryIntervalMs, "ms]"));
|
|
89
|
+
}
|
|
90
|
+
clearTimeout(_classPrivateFieldGet(_resetCountersTimer, this));
|
|
91
|
+
this.retryIntervalMs = Math.min(this.retryIntervalMs * 2, this.maxRetryIntervalMs);
|
|
92
|
+
this.retryCount = this.retryCount + 1;
|
|
93
|
+
this.nexRetryTime = Date.now() + this.retryIntervalMs;
|
|
94
|
+
_classPrivateFieldSet(_connectionTimer, this, setTimeout(() => {
|
|
95
|
+
this.connect().catch(err => {
|
|
96
|
+
this.onError(err);
|
|
97
|
+
});
|
|
98
|
+
}, diff));
|
|
99
|
+
_classPrivateFieldSet(_resetCountersTimer, this, setTimeout(() => {
|
|
100
|
+
_assertClassBrand(_RetryConnection_brand, this, _resetCounters).call(this);
|
|
101
|
+
}, 60000));
|
|
102
|
+
}
|
|
103
|
+
function _resetCounters() {
|
|
104
|
+
this.retryCount = 0;
|
|
105
|
+
this.retryIntervalMs = this.minRetryIntervalMs;
|
|
106
|
+
this.nexRetryTime = Date.now();
|
|
107
|
+
}
|