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/browser.js CHANGED
@@ -6512,7 +6512,7 @@ var StreamChat = /*#__PURE__*/function () {
6512
6512
  _this._logApiRequest(type, url, data, requestConfig);
6513
6513
 
6514
6514
  _context5.t0 = type;
6515
- _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;
6515
+ _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;
6516
6516
  break;
6517
6517
 
6518
6518
  case 9:
@@ -6521,7 +6521,7 @@ var StreamChat = /*#__PURE__*/function () {
6521
6521
 
6522
6522
  case 11:
6523
6523
  response = _context5.sent;
6524
- return _context5.abrupt("break", 34);
6524
+ return _context5.abrupt("break", 38);
6525
6525
 
6526
6526
  case 13:
6527
6527
  _context5.next = 15;
@@ -6529,7 +6529,7 @@ var StreamChat = /*#__PURE__*/function () {
6529
6529
 
6530
6530
  case 15:
6531
6531
  response = _context5.sent;
6532
- return _context5.abrupt("break", 34);
6532
+ return _context5.abrupt("break", 38);
6533
6533
 
6534
6534
  case 17:
6535
6535
  _context5.next = 19;
@@ -6537,43 +6537,51 @@ var StreamChat = /*#__PURE__*/function () {
6537
6537
 
6538
6538
  case 19:
6539
6539
  response = _context5.sent;
6540
- return _context5.abrupt("break", 34);
6540
+ return _context5.abrupt("break", 38);
6541
6541
 
6542
6542
  case 21:
6543
6543
  _context5.next = 23;
6544
- return _this.axiosInstance.put(url, data, requestConfig);
6544
+ return _this.axiosInstance.postForm(url, data, requestConfig);
6545
6545
 
6546
6546
  case 23:
6547
6547
  response = _context5.sent;
6548
- return _context5.abrupt("break", 34);
6548
+ return _context5.abrupt("break", 38);
6549
6549
 
6550
6550
  case 25:
6551
6551
  _context5.next = 27;
6552
- return _this.axiosInstance.patch(url, data, requestConfig);
6552
+ return _this.axiosInstance.put(url, data, requestConfig);
6553
6553
 
6554
6554
  case 27:
6555
6555
  response = _context5.sent;
6556
- return _context5.abrupt("break", 34);
6556
+ return _context5.abrupt("break", 38);
6557
6557
 
6558
6558
  case 29:
6559
6559
  _context5.next = 31;
6560
- return _this.axiosInstance.options(url, requestConfig);
6560
+ return _this.axiosInstance.patch(url, data, requestConfig);
6561
6561
 
6562
6562
  case 31:
6563
6563
  response = _context5.sent;
6564
- return _context5.abrupt("break", 34);
6564
+ return _context5.abrupt("break", 38);
6565
6565
 
6566
6566
  case 33:
6567
+ _context5.next = 35;
6568
+ return _this.axiosInstance.options(url, requestConfig);
6569
+
6570
+ case 35:
6571
+ response = _context5.sent;
6572
+ return _context5.abrupt("break", 38);
6573
+
6574
+ case 37:
6567
6575
  throw new Error('Invalid request type');
6568
6576
 
6569
- case 34:
6577
+ case 38:
6570
6578
  _this._logApiResponse(type, url, response);
6571
6579
 
6572
6580
  _this.consecutiveFailures = 0;
6573
6581
  return _context5.abrupt("return", _this.handleResponse(response));
6574
6582
 
6575
- case 39:
6576
- _context5.prev = 39;
6583
+ case 43:
6584
+ _context5.prev = 43;
6577
6585
  _context5.t1 = _context5["catch"](4);
6578
6586
  _context5.t1.client_request_id = (_requestConfig$header = requestConfig.headers) === null || _requestConfig$header === void 0 ? void 0 : _requestConfig$header['x-client-request-id'];
6579
6587
 
@@ -6582,44 +6590,44 @@ var StreamChat = /*#__PURE__*/function () {
6582
6590
  _this.consecutiveFailures += 1;
6583
6591
 
6584
6592
  if (!_context5.t1.response) {
6585
- _context5.next = 56;
6593
+ _context5.next = 60;
6586
6594
  break;
6587
6595
  }
6588
6596
 
6589
6597
  if (!(_context5.t1.response.data.code === chatCodes.TOKEN_EXPIRED && !_this.tokenManager.isStatic())) {
6590
- _context5.next = 53;
6598
+ _context5.next = 57;
6591
6599
  break;
6592
6600
  }
6593
6601
 
6594
6602
  if (!(_this.consecutiveFailures > 1)) {
6595
- _context5.next = 49;
6603
+ _context5.next = 53;
6596
6604
  break;
6597
6605
  }
6598
6606
 
6599
- _context5.next = 49;
6607
+ _context5.next = 53;
6600
6608
  return sleep(retryInterval(_this.consecutiveFailures));
6601
6609
 
6602
- case 49:
6610
+ case 53:
6603
6611
  _this.tokenManager.loadToken();
6604
6612
 
6605
- _context5.next = 52;
6613
+ _context5.next = 56;
6606
6614
  return _this.doAxiosRequest(type, url, data, options);
6607
6615
 
6608
- case 52:
6616
+ case 56:
6609
6617
  return _context5.abrupt("return", _context5.sent);
6610
6618
 
6611
- case 53:
6619
+ case 57:
6612
6620
  return _context5.abrupt("return", _this.handleResponse(_context5.t1.response));
6613
6621
 
6614
- case 56:
6622
+ case 60:
6615
6623
  throw _context5.t1;
6616
6624
 
6617
- case 57:
6625
+ case 61:
6618
6626
  case "end":
6619
6627
  return _context5.stop();
6620
6628
  }
6621
6629
  }
6622
- }, _callee5, null, [[4, 39]]);
6630
+ }, _callee5, null, [[4, 43]]);
6623
6631
  }));
6624
6632
 
6625
6633
  return function (_x5, _x6, _x7) {
@@ -7698,7 +7706,7 @@ var StreamChat = /*#__PURE__*/function () {
7698
7706
  value: function sendFile(url, uri, name, contentType, user) {
7699
7707
  var data = addFileToFormData(uri, name, contentType);
7700
7708
  if (user != null) data.append('user', JSON.stringify(user));
7701
- return this.doAxiosRequest('post', url, data, {
7709
+ return this.doAxiosRequest('postForm', url, data, {
7702
7710
  headers: data.getHeaders ? data.getHeaders() : {},
7703
7711
  // node vs browser
7704
7712
  config: {
@@ -10189,7 +10197,7 @@ var StreamChat = /*#__PURE__*/function () {
10189
10197
  }, {
10190
10198
  key: "getUserAgent",
10191
10199
  value: function getUserAgent() {
10192
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.14.2");
10200
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.14.3");
10193
10201
  }
10194
10202
  }, {
10195
10203
  key: "setUserAgent",