stream-chat 8.14.2 → 8.14.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.
@@ -6487,7 +6487,7 @@ var StreamChat = /*#__PURE__*/function () {
6487
6487
  _this._logApiRequest(type, url, data, requestConfig);
6488
6488
 
6489
6489
  _context5.t0 = type;
6490
- _context5.next = _context5.t0 === 'get' ? 9 : _context5.t0 === 'delete' ? 13 : _context5.t0 === 'post' ? 17 : _context5.t0 === 'put' ? 21 : _context5.t0 === 'patch' ? 25 : _context5.t0 === 'options' ? 29 : 33;
6490
+ _context5.next = _context5.t0 === 'get' ? 9 : _context5.t0 === 'delete' ? 13 : _context5.t0 === 'post' ? 17 : _context5.t0 === 'postForm' ? 21 : _context5.t0 === 'put' ? 25 : _context5.t0 === 'patch' ? 29 : _context5.t0 === 'options' ? 33 : 37;
6491
6491
  break;
6492
6492
 
6493
6493
  case 9:
@@ -6496,7 +6496,7 @@ var StreamChat = /*#__PURE__*/function () {
6496
6496
 
6497
6497
  case 11:
6498
6498
  response = _context5.sent;
6499
- return _context5.abrupt("break", 34);
6499
+ return _context5.abrupt("break", 38);
6500
6500
 
6501
6501
  case 13:
6502
6502
  _context5.next = 15;
@@ -6504,7 +6504,7 @@ var StreamChat = /*#__PURE__*/function () {
6504
6504
 
6505
6505
  case 15:
6506
6506
  response = _context5.sent;
6507
- return _context5.abrupt("break", 34);
6507
+ return _context5.abrupt("break", 38);
6508
6508
 
6509
6509
  case 17:
6510
6510
  _context5.next = 19;
@@ -6512,43 +6512,51 @@ var StreamChat = /*#__PURE__*/function () {
6512
6512
 
6513
6513
  case 19:
6514
6514
  response = _context5.sent;
6515
- return _context5.abrupt("break", 34);
6515
+ return _context5.abrupt("break", 38);
6516
6516
 
6517
6517
  case 21:
6518
6518
  _context5.next = 23;
6519
- return _this.axiosInstance.put(url, data, requestConfig);
6519
+ return _this.axiosInstance.postForm(url, data, requestConfig);
6520
6520
 
6521
6521
  case 23:
6522
6522
  response = _context5.sent;
6523
- return _context5.abrupt("break", 34);
6523
+ return _context5.abrupt("break", 38);
6524
6524
 
6525
6525
  case 25:
6526
6526
  _context5.next = 27;
6527
- return _this.axiosInstance.patch(url, data, requestConfig);
6527
+ return _this.axiosInstance.put(url, data, requestConfig);
6528
6528
 
6529
6529
  case 27:
6530
6530
  response = _context5.sent;
6531
- return _context5.abrupt("break", 34);
6531
+ return _context5.abrupt("break", 38);
6532
6532
 
6533
6533
  case 29:
6534
6534
  _context5.next = 31;
6535
- return _this.axiosInstance.options(url, requestConfig);
6535
+ return _this.axiosInstance.patch(url, data, requestConfig);
6536
6536
 
6537
6537
  case 31:
6538
6538
  response = _context5.sent;
6539
- return _context5.abrupt("break", 34);
6539
+ return _context5.abrupt("break", 38);
6540
6540
 
6541
6541
  case 33:
6542
+ _context5.next = 35;
6543
+ return _this.axiosInstance.options(url, requestConfig);
6544
+
6545
+ case 35:
6546
+ response = _context5.sent;
6547
+ return _context5.abrupt("break", 38);
6548
+
6549
+ case 37:
6542
6550
  throw new Error('Invalid request type');
6543
6551
 
6544
- case 34:
6552
+ case 38:
6545
6553
  _this._logApiResponse(type, url, response);
6546
6554
 
6547
6555
  _this.consecutiveFailures = 0;
6548
6556
  return _context5.abrupt("return", _this.handleResponse(response));
6549
6557
 
6550
- case 39:
6551
- _context5.prev = 39;
6558
+ case 43:
6559
+ _context5.prev = 43;
6552
6560
  _context5.t1 = _context5["catch"](4);
6553
6561
  _context5.t1.client_request_id = (_requestConfig$header = requestConfig.headers) === null || _requestConfig$header === void 0 ? void 0 : _requestConfig$header['x-client-request-id'];
6554
6562
 
@@ -6557,44 +6565,44 @@ var StreamChat = /*#__PURE__*/function () {
6557
6565
  _this.consecutiveFailures += 1;
6558
6566
 
6559
6567
  if (!_context5.t1.response) {
6560
- _context5.next = 56;
6568
+ _context5.next = 60;
6561
6569
  break;
6562
6570
  }
6563
6571
 
6564
6572
  if (!(_context5.t1.response.data.code === chatCodes.TOKEN_EXPIRED && !_this.tokenManager.isStatic())) {
6565
- _context5.next = 53;
6573
+ _context5.next = 57;
6566
6574
  break;
6567
6575
  }
6568
6576
 
6569
6577
  if (!(_this.consecutiveFailures > 1)) {
6570
- _context5.next = 49;
6578
+ _context5.next = 53;
6571
6579
  break;
6572
6580
  }
6573
6581
 
6574
- _context5.next = 49;
6582
+ _context5.next = 53;
6575
6583
  return sleep(retryInterval(_this.consecutiveFailures));
6576
6584
 
6577
- case 49:
6585
+ case 53:
6578
6586
  _this.tokenManager.loadToken();
6579
6587
 
6580
- _context5.next = 52;
6588
+ _context5.next = 56;
6581
6589
  return _this.doAxiosRequest(type, url, data, options);
6582
6590
 
6583
- case 52:
6591
+ case 56:
6584
6592
  return _context5.abrupt("return", _context5.sent);
6585
6593
 
6586
- case 53:
6594
+ case 57:
6587
6595
  return _context5.abrupt("return", _this.handleResponse(_context5.t1.response));
6588
6596
 
6589
- case 56:
6597
+ case 60:
6590
6598
  throw _context5.t1;
6591
6599
 
6592
- case 57:
6600
+ case 61:
6593
6601
  case "end":
6594
6602
  return _context5.stop();
6595
6603
  }
6596
6604
  }
6597
- }, _callee5, null, [[4, 39]]);
6605
+ }, _callee5, null, [[4, 43]]);
6598
6606
  }));
6599
6607
 
6600
6608
  return function (_x5, _x6, _x7) {
@@ -7673,7 +7681,7 @@ var StreamChat = /*#__PURE__*/function () {
7673
7681
  value: function sendFile(url, uri, name, contentType, user) {
7674
7682
  var data = addFileToFormData(uri, name, contentType);
7675
7683
  if (user != null) data.append('user', JSON.stringify(user));
7676
- return this.doAxiosRequest('post', url, data, {
7684
+ return this.doAxiosRequest('postForm', url, data, {
7677
7685
  headers: data.getHeaders ? data.getHeaders() : {},
7678
7686
  // node vs browser
7679
7687
  config: {
@@ -10164,7 +10172,7 @@ var StreamChat = /*#__PURE__*/function () {
10164
10172
  }, {
10165
10173
  key: "getUserAgent",
10166
10174
  value: function getUserAgent() {
10167
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.14.2");
10175
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.14.3");
10168
10176
  }
10169
10177
  }, {
10170
10178
  key: "setUserAgent",