@factset/frontgate-js-sdk 6.10.2 → 6.10.3

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.
@@ -2298,7 +2298,7 @@ var __privateWrapper = (obj, member, setter, getter) => ({
2298
2298
  function isSubscriptionLossMessage(response) {
2299
2299
  return response.name === "Foundation::SubscriptionLossMessage";
2300
2300
  }
2301
- const PACKAGE_JSON = { version: "6.10.2", package: "@factset/frontgate-js-sdk" };
2301
+ const PACKAGE_JSON = { version: "6.10.3", package: "@factset/frontgate-js-sdk" };
2302
2302
  function getClientInformation() {
2303
2303
  const navigator2 = getNavigator();
2304
2304
  return {
@@ -3317,7 +3317,12 @@ var __privateWrapper = (obj, member, setter, getter) => ({
3317
3317
  const protocolPrefix = protocolType ? `${protocolType}.` : "";
3318
3318
  const subProtocols = [`${protocolPrefix}ws-${protocolVersion}.mdgms.com`];
3319
3319
  const wsConf = { url: wsUrl, subProtocols };
3320
- await this.hooks.callHook("frontgateConnection:beforeConnect", wsConf);
3320
+ try {
3321
+ await this.hooks.callHook("frontgateConnection:beforeConnect", wsConf);
3322
+ } catch (error) {
3323
+ __privateSet(this, _wsStateInternal, "disconnected");
3324
+ throw error;
3325
+ }
3321
3326
  this.log(LogLevel.DEBUG, `Connecting to ${wsConf.url} with subprotocols ${wsConf.subProtocols}`);
3322
3327
  const promise = new Promise((resolve, reject) => {
3323
3328
  if (!__privateGet(this, _wsConf)) {
@@ -3394,13 +3399,13 @@ var __privateWrapper = (obj, member, setter, getter) => ({
3394
3399
  });
3395
3400
  }
3396
3401
  isConnected() {
3397
- return __privateGet(this, _wsStateInternal) === "authenticated";
3402
+ return __privateGet(this, _instances, wsState_get) === "authenticated";
3398
3403
  }
3399
3404
  isDisconnected() {
3400
3405
  return __privateGet(this, _wsStateInternal) !== "authenticated";
3401
3406
  }
3402
3407
  isReadyToConnect() {
3403
- return __privateGet(this, _wsStateInternal) === "disconnected";
3408
+ return __privateGet(this, _instances, wsState_get) === "disconnected";
3404
3409
  }
3405
3410
  }, _ws = new WeakMap(), _wsConf = new WeakMap(), _wsStateInternal = new WeakMap(), _keepAliveTimer = new WeakMap(), _jobId = new WeakMap(), _idApplication = new WeakMap(), _idUser = new WeakMap(), _instances = new WeakSet(), wsState_get = function() {
3406
3411
  if (__privateGet(this, _ws) && __privateGet(this, _ws).readyState < 2) {
@@ -4221,15 +4226,16 @@ var __privateWrapper = (obj, member, setter, getter) => ({
4221
4226
  auth: {}
4222
4227
  };
4223
4228
  };
4224
- const reconnect = () => {
4229
+ const reconnect = (reconnectDelaysInMs) => {
4225
4230
  const mixinReconnect = (Base) => {
4226
4231
  var _reconnectAttempts, _reconnectDelays, _reconnectTimer, _a2;
4227
4232
  return _a2 = class extends Base {
4228
4233
  constructor(...args) {
4229
4234
  super(...args);
4230
4235
  __privateAdd(this, _reconnectAttempts, 0);
4231
- __privateAdd(this, _reconnectDelays, [1e3, 2e3, 4e3, 8e3, 16e3, 32e3]);
4236
+ __privateAdd(this, _reconnectDelays);
4232
4237
  __privateAdd(this, _reconnectTimer);
4238
+ __privateSet(this, _reconnectDelays, reconnectDelaysInMs ?? [1e3, 2e3, 4e3, 8e3, 16e3, 32e3]);
4233
4239
  const reconenctFn = (error) => {
4234
4240
  if (error.code !== 1e3) {
4235
4241
  if (__privateGet(this, _reconnectTimer)) {
@@ -4238,7 +4244,7 @@ var __privateWrapper = (obj, member, setter, getter) => ({
4238
4244
  __privateSet(this, _reconnectAttempts, 0);
4239
4245
  }
4240
4246
  let reconnectDelayIndex = __privateGet(this, _reconnectAttempts);
4241
- if (__privateGet(this, _reconnectAttempts) > __privateGet(this, _reconnectDelays).length) {
4247
+ if (__privateGet(this, _reconnectAttempts) >= __privateGet(this, _reconnectDelays).length) {
4242
4248
  reconnectDelayIndex = __privateGet(this, _reconnectDelays).length - 1;
4243
4249
  }
4244
4250
  const reconnectDelay = __privateGet(this, _reconnectDelays)[reconnectDelayIndex];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@factset/frontgate-js-sdk",
3
3
  "author": "Factset GmbH",
4
- "version": "6.10.2",
4
+ "version": "6.10.3",
5
5
  "description": "Typescript based client to request and subscribe values from mdg2 (frontgate)",
6
6
  "license": "Apache-2.0",
7
7
  "main": "./dist/lib/node/index.js",