@cubejs-client/core 1.3.1 → 1.3.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.
@@ -11205,13 +11205,15 @@
11205
11205
  method = _ref.method,
11206
11206
  _ref$headers = _ref.headers,
11207
11207
  headers = _ref$headers === void 0 ? {} : _ref$headers,
11208
- credentials = _ref.credentials;
11208
+ credentials = _ref.credentials,
11209
+ fetchTimeout = _ref.fetchTimeout;
11209
11210
  _classCallCheck(this, HttpTransport);
11210
11211
  this.authorization = authorization;
11211
11212
  this.apiUrl = apiUrl;
11212
11213
  this.method = method;
11213
11214
  this.headers = headers;
11214
11215
  this.credentials = credentials;
11216
+ this.fetchTimeout = fetchTimeout;
11215
11217
  }
11216
11218
  _createClass(HttpTransport, [{
11217
11219
  key: "request",
@@ -11242,7 +11244,8 @@
11242
11244
  'x-request-id': baseRequestId && "".concat(baseRequestId, "-span-").concat(spanCounter++)
11243
11245
  }, _this.headers),
11244
11246
  credentials: _this.credentials,
11245
- body: requestMethod === 'POST' ? JSON.stringify(params) : null
11247
+ body: requestMethod === 'POST' ? JSON.stringify(params) : null,
11248
+ signal: _this.fetchTimeout ? AbortSignal.timeout(_this.fetchTimeout) : undefined
11246
11249
  });
11247
11250
  };
11248
11251
  return {
@@ -11529,6 +11532,7 @@
11529
11532
  this.pollInterval = options.pollInterval || 5;
11530
11533
  this.parseDateMeasures = options.parseDateMeasures;
11531
11534
  this.castNumerics = typeof options.castNumerics === 'boolean' ? options.castNumerics : false;
11535
+ this.networkErrorRetries = options.networkErrorRetries || 0;
11532
11536
  this.updateAuthorizationPromise = null;
11533
11537
  }
11534
11538
  _createClass(CubeApi, [{
@@ -11592,6 +11596,7 @@
11592
11596
  return _ref2.apply(this, arguments);
11593
11597
  };
11594
11598
  }();
11599
+ var networkRetries = this.networkErrorRetries;
11595
11600
  var loadImpl = /*#__PURE__*/function () {
11596
11601
  var _ref3 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee5(response, next) {
11597
11602
  var requestInstance, subscribeNext, continueWait, body, text, error, result;
@@ -11683,7 +11688,7 @@
11683
11688
  return _this.updateTransportAuthorization();
11684
11689
  case 8:
11685
11690
  skipAuthorizationUpdate = false;
11686
- if (!(response.status === 502)) {
11691
+ if (!(response.status === 502 || response.error && response.error.toLowerCase() === 'network error' && --networkRetries >= 0)) {
11687
11692
  _context5.next = 13;
11688
11693
  break;
11689
11694
  }