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