stream-chat 4.4.3-dev.0 → 4.4.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.
@@ -933,10 +933,17 @@ function getRandomBytes(length) {
933
933
  function convertErrorToJson(err) {
934
934
  var jsonObj = {};
935
935
  if (!err) return jsonObj;
936
- Object.getOwnPropertyNames(err).forEach(function (key) {
937
- // @ts-ignore
938
- jsonObj[key] = err[key];
939
- });
936
+
937
+ try {
938
+ Object.getOwnPropertyNames(err).forEach(function (key) {
939
+ jsonObj[key] = Object.getOwnPropertyDescriptor(err, key);
940
+ });
941
+ } catch (_) {
942
+ return {
943
+ error: 'failed to serialize the error'
944
+ };
945
+ }
946
+
940
947
  return jsonObj;
941
948
  }
942
949
 
@@ -3450,6 +3457,67 @@ var InsightMetrics = function InsightMetrics() {
3450
3457
  this.wsConsecutiveFailures = 0;
3451
3458
  this.instanceClientId = randomId();
3452
3459
  };
3460
+ /**
3461
+ * postInsights is not supposed to be used by end users directly within chat application, and thus is kept isolated
3462
+ * from all the client/connection code/logic.
3463
+ *
3464
+ * @param insightType
3465
+ * @param insights
3466
+ */
3467
+
3468
+ var postInsights = /*#__PURE__*/function () {
3469
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(insightType, insights) {
3470
+ var maxAttempts, i;
3471
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
3472
+ while (1) {
3473
+ switch (_context.prev = _context.next) {
3474
+ case 0:
3475
+ maxAttempts = 3;
3476
+ i = 0;
3477
+
3478
+ case 2:
3479
+ if (!(i < maxAttempts)) {
3480
+ _context.next = 17;
3481
+ break;
3482
+ }
3483
+
3484
+ _context.prev = 3;
3485
+ _context.next = 6;
3486
+ return axios.post("https://chat-insights.getstream.io/insights/".concat(insightType), insights);
3487
+
3488
+ case 6:
3489
+ _context.next = 13;
3490
+ break;
3491
+
3492
+ case 8:
3493
+ _context.prev = 8;
3494
+ _context.t0 = _context["catch"](3);
3495
+ _context.next = 12;
3496
+ return sleep((i + 1) * 3000);
3497
+
3498
+ case 12:
3499
+ return _context.abrupt("continue", 14);
3500
+
3501
+ case 13:
3502
+ return _context.abrupt("break", 17);
3503
+
3504
+ case 14:
3505
+ i++;
3506
+ _context.next = 2;
3507
+ break;
3508
+
3509
+ case 17:
3510
+ case "end":
3511
+ return _context.stop();
3512
+ }
3513
+ }
3514
+ }, _callee, null, [[3, 8]]);
3515
+ }));
3516
+
3517
+ return function postInsights(_x, _x2) {
3518
+ return _ref.apply(this, arguments);
3519
+ };
3520
+ }();
3453
3521
  function buildWsFatalInsight(connection, event) {
3454
3522
  return _objectSpread$2(_objectSpread$2({}, event), buildWsBaseInsight(connection));
3455
3523
  }
@@ -3526,7 +3594,7 @@ var StableWSConnection = /*#__PURE__*/function () {
3526
3594
  userID = _ref.userID,
3527
3595
  wsBaseURL = _ref.wsBaseURL,
3528
3596
  device = _ref.device,
3529
- postInsights = _ref.postInsights,
3597
+ enableInsights = _ref.enableInsights,
3530
3598
  insightMetrics = _ref.insightMetrics;
3531
3599
 
3532
3600
  _classCallCheck(this, StableWSConnection);
@@ -3593,7 +3661,7 @@ var StableWSConnection = /*#__PURE__*/function () {
3593
3661
 
3594
3662
  _defineProperty(this, "wsID", void 0);
3595
3663
 
3596
- _defineProperty(this, "postInsights", void 0);
3664
+ _defineProperty(this, "enableInsights", void 0);
3597
3665
 
3598
3666
  _defineProperty(this, "insightMetrics", void 0);
3599
3667
 
@@ -3604,7 +3672,7 @@ var StableWSConnection = /*#__PURE__*/function () {
3604
3672
  user_token: _this.tokenManager.getToken(),
3605
3673
  server_determines_connection_id: true,
3606
3674
  device: _this.device,
3607
- request_id: reqID
3675
+ client_request_id: reqID
3608
3676
  };
3609
3677
  var qs = encodeURIComponent(JSON.stringify(params));
3610
3678
 
@@ -3947,7 +4015,7 @@ var StableWSConnection = /*#__PURE__*/function () {
3947
4015
 
3948
4016
  this._listenForConnectionChanges();
3949
4017
 
3950
- this.postInsights = postInsights;
4018
+ this.enableInsights = enableInsights;
3951
4019
  this.insightMetrics = insightMetrics;
3952
4020
  }
3953
4021
  /**
@@ -4237,8 +4305,7 @@ var StableWSConnection = /*#__PURE__*/function () {
4237
4305
  key: "_connect",
4238
4306
  value: function () {
4239
4307
  var _connect3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
4240
- var wsURL, response, _this$postInsights, insights;
4241
-
4308
+ var wsURL, response, insights;
4242
4309
  return _regeneratorRuntime.wrap(function _callee5$(_context5) {
4243
4310
  while (1) {
4244
4311
  switch (_context5.prev = _context5.next) {
@@ -4282,8 +4349,8 @@ var StableWSConnection = /*#__PURE__*/function () {
4282
4349
 
4283
4350
  this.connectionID = response.connection_id;
4284
4351
 
4285
- if (this.insightMetrics.wsConsecutiveFailures > 0 && this.postInsights) {
4286
- this.postInsights('ws_success_after_failure', buildWsSuccessAfterFailureInsight(this));
4352
+ if (this.insightMetrics.wsConsecutiveFailures > 0 && this.enableInsights) {
4353
+ postInsights('ws_success_after_failure', buildWsSuccessAfterFailureInsight(this));
4287
4354
  this.insightMetrics.wsConsecutiveFailures = 0;
4288
4355
  }
4289
4356
 
@@ -4298,12 +4365,11 @@ var StableWSConnection = /*#__PURE__*/function () {
4298
4365
  _context5.t0 = _context5["catch"](5);
4299
4366
  this.isConnecting = false;
4300
4367
 
4301
- if (this.postInsights) {
4368
+ if (this.enableInsights) {
4302
4369
  this.insightMetrics.wsConsecutiveFailures++;
4303
- this.insightMetrics.wsTotalFailures++; // @ts-ignore
4304
-
4370
+ this.insightMetrics.wsTotalFailures++;
4305
4371
  insights = buildWsFatalInsight(this, convertErrorToJson(_context5.t0));
4306
- (_this$postInsights = this.postInsights) === null || _this$postInsights === void 0 ? void 0 : _this$postInsights.call(this, 'ws_fatal', insights);
4372
+ postInsights === null || postInsights === void 0 ? void 0 : postInsights('ws_fatal', insights);
4307
4373
  }
4308
4374
 
4309
4375
  throw _context5.t0;
@@ -5109,7 +5175,9 @@ var StreamChat = /*#__PURE__*/function () {
5109
5175
  var options,
5110
5176
  requestConfig,
5111
5177
  response,
5178
+ _requestConfig$header,
5112
5179
  _args4 = arguments;
5180
+
5113
5181
  return _regeneratorRuntime.wrap(function _callee4$(_context4) {
5114
5182
  while (1) {
5115
5183
  switch (_context4.prev = _context4.next) {
@@ -5188,45 +5256,46 @@ var StreamChat = /*#__PURE__*/function () {
5188
5256
  case 39:
5189
5257
  _context4.prev = 39;
5190
5258
  _context4.t1 = _context4["catch"](4);
5259
+ _context4.t1.client_request_id = (_requestConfig$header = requestConfig.headers) === null || _requestConfig$header === void 0 ? void 0 : _requestConfig$header['x-client-request-id'];
5191
5260
 
5192
5261
  _this._logApiError(type, url, _context4.t1);
5193
5262
 
5194
5263
  _this.consecutiveFailures += 1;
5195
5264
 
5196
5265
  if (!_context4.t1.response) {
5197
- _context4.next = 55;
5266
+ _context4.next = 56;
5198
5267
  break;
5199
5268
  }
5200
5269
 
5201
5270
  if (!(_context4.t1.response.data.code === chatCodes.TOKEN_EXPIRED && !_this.tokenManager.isStatic())) {
5202
- _context4.next = 52;
5271
+ _context4.next = 53;
5203
5272
  break;
5204
5273
  }
5205
5274
 
5206
5275
  if (!(_this.consecutiveFailures > 1)) {
5207
- _context4.next = 48;
5276
+ _context4.next = 49;
5208
5277
  break;
5209
5278
  }
5210
5279
 
5211
- _context4.next = 48;
5280
+ _context4.next = 49;
5212
5281
  return sleep(retryInterval(_this.consecutiveFailures));
5213
5282
 
5214
- case 48:
5283
+ case 49:
5215
5284
  _this.tokenManager.loadToken();
5216
5285
 
5217
- _context4.next = 51;
5286
+ _context4.next = 52;
5218
5287
  return _this.doAxiosRequest(type, url, data, options);
5219
5288
 
5220
- case 51:
5289
+ case 52:
5221
5290
  return _context4.abrupt("return", _context4.sent);
5222
5291
 
5223
- case 52:
5292
+ case 53:
5224
5293
  return _context4.abrupt("return", _this.handleResponse(_context4.t1.response));
5225
5294
 
5226
- case 55:
5295
+ case 56:
5227
5296
  throw _context4.t1;
5228
5297
 
5229
- case 56:
5298
+ case 57:
5230
5299
  case "end":
5231
5300
  return _context4.stop();
5232
5301
  }
@@ -5527,67 +5596,6 @@ var StreamChat = /*#__PURE__*/function () {
5527
5596
  return !!_this.secret;
5528
5597
  });
5529
5598
 
5530
- _defineProperty(this, "postInsights", /*#__PURE__*/function () {
5531
- var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(insightType, insights) {
5532
- var maxAttempts, i;
5533
- return _regeneratorRuntime.wrap(function _callee6$(_context6) {
5534
- while (1) {
5535
- switch (_context6.prev = _context6.next) {
5536
- case 0:
5537
- maxAttempts = 3;
5538
- i = 0;
5539
-
5540
- case 2:
5541
- if (!(i < maxAttempts)) {
5542
- _context6.next = 18;
5543
- break;
5544
- }
5545
-
5546
- _context6.prev = 3;
5547
- _context6.next = 6;
5548
- return _this.axiosInstance.post("https://insights.stream-io-api.com/insights/".concat(insightType), insights);
5549
-
5550
- case 6:
5551
- _context6.next = 14;
5552
- break;
5553
-
5554
- case 8:
5555
- _context6.prev = 8;
5556
- _context6.t0 = _context6["catch"](3);
5557
-
5558
- _this.logger('warn', "failed to send insights event ".concat(insightType), {
5559
- tags: ['insights', 'connection'],
5560
- error: _context6.t0,
5561
- insights: insights
5562
- });
5563
-
5564
- _context6.next = 13;
5565
- return sleep((i + 1) * 3000);
5566
-
5567
- case 13:
5568
- return _context6.abrupt("continue", 15);
5569
-
5570
- case 14:
5571
- return _context6.abrupt("break", 18);
5572
-
5573
- case 15:
5574
- i++;
5575
- _context6.next = 2;
5576
- break;
5577
-
5578
- case 18:
5579
- case "end":
5580
- return _context6.stop();
5581
- }
5582
- }
5583
- }, _callee6, null, [[3, 8]]);
5584
- }));
5585
-
5586
- return function (_x7, _x8) {
5587
- return _ref6.apply(this, arguments);
5588
- };
5589
- }());
5590
-
5591
5599
  // set the key
5592
5600
  this.key = _key;
5593
5601
  this.listeners = {};
@@ -5620,7 +5628,7 @@ var StreamChat = /*#__PURE__*/function () {
5620
5628
  }
5621
5629
 
5622
5630
  this.axiosInstance = axios.create(this.options);
5623
- this.setBaseURL(this.options.baseURL || 'https://chat-us-east-1.stream-io-api.com');
5631
+ this.setBaseURL(this.options.baseURL || 'https://chat.stream-io-api.com');
5624
5632
 
5625
5633
  if (typeof process !== 'undefined' && process.env.STREAM_LOCAL_TEST_RUN) {
5626
5634
  this.setBaseURL('http://localhost:3030');
@@ -5792,32 +5800,32 @@ var StreamChat = /*#__PURE__*/function () {
5792
5800
  }
5793
5801
  */
5794
5802
  function () {
5795
- var _updateAppSettings = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(options) {
5803
+ var _updateAppSettings = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(options) {
5796
5804
  var _options$apn_config;
5797
5805
 
5798
- return _regeneratorRuntime.wrap(function _callee7$(_context7) {
5806
+ return _regeneratorRuntime.wrap(function _callee6$(_context6) {
5799
5807
  while (1) {
5800
- switch (_context7.prev = _context7.next) {
5808
+ switch (_context6.prev = _context6.next) {
5801
5809
  case 0:
5802
5810
  if ((_options$apn_config = options.apn_config) !== null && _options$apn_config !== void 0 && _options$apn_config.p12_cert) {
5803
5811
  options.apn_config.p12_cert = Buffer.from(options.apn_config.p12_cert).toString('base64');
5804
5812
  }
5805
5813
 
5806
- _context7.next = 3;
5814
+ _context6.next = 3;
5807
5815
  return this.patch(this.baseURL + '/app', options);
5808
5816
 
5809
5817
  case 3:
5810
- return _context7.abrupt("return", _context7.sent);
5818
+ return _context6.abrupt("return", _context6.sent);
5811
5819
 
5812
5820
  case 4:
5813
5821
  case "end":
5814
- return _context7.stop();
5822
+ return _context6.stop();
5815
5823
  }
5816
5824
  }
5817
- }, _callee7, this);
5825
+ }, _callee6, this);
5818
5826
  }));
5819
5827
 
5820
- function updateAppSettings(_x9) {
5828
+ function updateAppSettings(_x7) {
5821
5829
  return _updateAppSettings.apply(this, arguments);
5822
5830
  }
5823
5831
 
@@ -5830,28 +5838,28 @@ var StreamChat = /*#__PURE__*/function () {
5830
5838
  * Revokes all tokens on application level issued before given time
5831
5839
  */
5832
5840
  function () {
5833
- var _revokeTokens = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(before) {
5834
- return _regeneratorRuntime.wrap(function _callee8$(_context8) {
5841
+ var _revokeTokens = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(before) {
5842
+ return _regeneratorRuntime.wrap(function _callee7$(_context7) {
5835
5843
  while (1) {
5836
- switch (_context8.prev = _context8.next) {
5844
+ switch (_context7.prev = _context7.next) {
5837
5845
  case 0:
5838
- _context8.next = 2;
5846
+ _context7.next = 2;
5839
5847
  return this.updateAppSettings({
5840
5848
  revoke_tokens_issued_before: this._normalizeDate(before)
5841
5849
  });
5842
5850
 
5843
5851
  case 2:
5844
- return _context8.abrupt("return", _context8.sent);
5852
+ return _context7.abrupt("return", _context7.sent);
5845
5853
 
5846
5854
  case 3:
5847
5855
  case "end":
5848
- return _context8.stop();
5856
+ return _context7.stop();
5849
5857
  }
5850
5858
  }
5851
- }, _callee8, this);
5859
+ }, _callee7, this);
5852
5860
  }));
5853
5861
 
5854
- function revokeTokens(_x10) {
5862
+ function revokeTokens(_x8) {
5855
5863
  return _revokeTokens.apply(this, arguments);
5856
5864
  }
5857
5865
 
@@ -5864,26 +5872,26 @@ var StreamChat = /*#__PURE__*/function () {
5864
5872
  }, {
5865
5873
  key: "revokeUserToken",
5866
5874
  value: function () {
5867
- var _revokeUserToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(userID, before) {
5868
- return _regeneratorRuntime.wrap(function _callee9$(_context9) {
5875
+ var _revokeUserToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(userID, before) {
5876
+ return _regeneratorRuntime.wrap(function _callee8$(_context8) {
5869
5877
  while (1) {
5870
- switch (_context9.prev = _context9.next) {
5878
+ switch (_context8.prev = _context8.next) {
5871
5879
  case 0:
5872
- _context9.next = 2;
5880
+ _context8.next = 2;
5873
5881
  return this.revokeUsersToken([userID], before);
5874
5882
 
5875
5883
  case 2:
5876
- return _context9.abrupt("return", _context9.sent);
5884
+ return _context8.abrupt("return", _context8.sent);
5877
5885
 
5878
5886
  case 3:
5879
5887
  case "end":
5880
- return _context9.stop();
5888
+ return _context8.stop();
5881
5889
  }
5882
5890
  }
5883
- }, _callee9, this);
5891
+ }, _callee8, this);
5884
5892
  }));
5885
5893
 
5886
- function revokeUserToken(_x11, _x12) {
5894
+ function revokeUserToken(_x9, _x10) {
5887
5895
  return _revokeUserToken.apply(this, arguments);
5888
5896
  }
5889
5897
 
@@ -5896,12 +5904,12 @@ var StreamChat = /*#__PURE__*/function () {
5896
5904
  }, {
5897
5905
  key: "revokeUsersToken",
5898
5906
  value: function () {
5899
- var _revokeUsersToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(userIDs, before) {
5907
+ var _revokeUsersToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(userIDs, before) {
5900
5908
  var users, _iterator, _step, userID;
5901
5909
 
5902
- return _regeneratorRuntime.wrap(function _callee10$(_context10) {
5910
+ return _regeneratorRuntime.wrap(function _callee9$(_context9) {
5903
5911
  while (1) {
5904
- switch (_context10.prev = _context10.next) {
5912
+ switch (_context9.prev = _context9.next) {
5905
5913
  case 0:
5906
5914
  if (before === undefined) {
5907
5915
  before = new Date().toISOString();
@@ -5928,21 +5936,21 @@ var StreamChat = /*#__PURE__*/function () {
5928
5936
  _iterator.f();
5929
5937
  }
5930
5938
 
5931
- _context10.next = 6;
5939
+ _context9.next = 6;
5932
5940
  return this.partialUpdateUsers(users);
5933
5941
 
5934
5942
  case 6:
5935
- return _context10.abrupt("return", _context10.sent);
5943
+ return _context9.abrupt("return", _context9.sent);
5936
5944
 
5937
5945
  case 7:
5938
5946
  case "end":
5939
- return _context10.stop();
5947
+ return _context9.stop();
5940
5948
  }
5941
5949
  }
5942
- }, _callee10, this);
5950
+ }, _callee9, this);
5943
5951
  }));
5944
5952
 
5945
- function revokeUsersToken(_x13, _x14) {
5953
+ function revokeUsersToken(_x11, _x12) {
5946
5954
  return _revokeUsersToken.apply(this, arguments);
5947
5955
  }
5948
5956
 
@@ -5955,23 +5963,23 @@ var StreamChat = /*#__PURE__*/function () {
5955
5963
  }, {
5956
5964
  key: "getAppSettings",
5957
5965
  value: function () {
5958
- var _getAppSettings = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {
5959
- return _regeneratorRuntime.wrap(function _callee11$(_context11) {
5966
+ var _getAppSettings = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
5967
+ return _regeneratorRuntime.wrap(function _callee10$(_context10) {
5960
5968
  while (1) {
5961
- switch (_context11.prev = _context11.next) {
5969
+ switch (_context10.prev = _context10.next) {
5962
5970
  case 0:
5963
- _context11.next = 2;
5971
+ _context10.next = 2;
5964
5972
  return this.get(this.baseURL + '/app');
5965
5973
 
5966
5974
  case 2:
5967
- return _context11.abrupt("return", _context11.sent);
5975
+ return _context10.abrupt("return", _context10.sent);
5968
5976
 
5969
5977
  case 3:
5970
5978
  case "end":
5971
- return _context11.stop();
5979
+ return _context10.stop();
5972
5980
  }
5973
5981
  }
5974
- }, _callee11, this);
5982
+ }, _callee10, this);
5975
5983
  }));
5976
5984
 
5977
5985
  function getAppSettings() {
@@ -5998,15 +6006,15 @@ var StreamChat = /*#__PURE__*/function () {
5998
6006
  }, {
5999
6007
  key: "testPushSettings",
6000
6008
  value: function () {
6001
- var _testPushSettings = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(userID) {
6009
+ var _testPushSettings = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(userID) {
6002
6010
  var data,
6003
- _args12 = arguments;
6004
- return _regeneratorRuntime.wrap(function _callee12$(_context12) {
6011
+ _args11 = arguments;
6012
+ return _regeneratorRuntime.wrap(function _callee11$(_context11) {
6005
6013
  while (1) {
6006
- switch (_context12.prev = _context12.next) {
6014
+ switch (_context11.prev = _context11.next) {
6007
6015
  case 0:
6008
- data = _args12.length > 1 && _args12[1] !== undefined ? _args12[1] : {};
6009
- _context12.next = 3;
6016
+ data = _args11.length > 1 && _args11[1] !== undefined ? _args11[1] : {};
6017
+ _context11.next = 3;
6010
6018
  return this.post(this.baseURL + '/check_push', _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
6011
6019
  user_id: userID
6012
6020
  }, data.messageID ? {
@@ -6024,17 +6032,17 @@ var StreamChat = /*#__PURE__*/function () {
6024
6032
  } : {}));
6025
6033
 
6026
6034
  case 3:
6027
- return _context12.abrupt("return", _context12.sent);
6035
+ return _context11.abrupt("return", _context11.sent);
6028
6036
 
6029
6037
  case 4:
6030
6038
  case "end":
6031
- return _context12.stop();
6039
+ return _context11.stop();
6032
6040
  }
6033
6041
  }
6034
- }, _callee12, this);
6042
+ }, _callee11, this);
6035
6043
  }));
6036
6044
 
6037
- function testPushSettings(_x15) {
6045
+ function testPushSettings(_x13) {
6038
6046
  return _testPushSettings.apply(this, arguments);
6039
6047
  }
6040
6048
 
@@ -6054,26 +6062,26 @@ var StreamChat = /*#__PURE__*/function () {
6054
6062
  }, {
6055
6063
  key: "testSQSSettings",
6056
6064
  value: function () {
6057
- var _testSQSSettings = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13() {
6065
+ var _testSQSSettings = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
6058
6066
  var data,
6059
- _args13 = arguments;
6060
- return _regeneratorRuntime.wrap(function _callee13$(_context13) {
6067
+ _args12 = arguments;
6068
+ return _regeneratorRuntime.wrap(function _callee12$(_context12) {
6061
6069
  while (1) {
6062
- switch (_context13.prev = _context13.next) {
6070
+ switch (_context12.prev = _context12.next) {
6063
6071
  case 0:
6064
- data = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : {};
6065
- _context13.next = 3;
6072
+ data = _args12.length > 0 && _args12[0] !== undefined ? _args12[0] : {};
6073
+ _context12.next = 3;
6066
6074
  return this.post(this.baseURL + '/check_sqs', data);
6067
6075
 
6068
6076
  case 3:
6069
- return _context13.abrupt("return", _context13.sent);
6077
+ return _context12.abrupt("return", _context12.sent);
6070
6078
 
6071
6079
  case 4:
6072
6080
  case "end":
6073
- return _context13.stop();
6081
+ return _context12.stop();
6074
6082
  }
6075
6083
  }
6076
- }, _callee13, this);
6084
+ }, _callee12, this);
6077
6085
  }));
6078
6086
 
6079
6087
  function testSQSSettings() {
@@ -6100,50 +6108,50 @@ var StreamChat = /*#__PURE__*/function () {
6100
6108
  * @return {ConnectAPIResponse<ChannelType, CommandType, UserType>} Returns a promise that resolves when the connection is setup
6101
6109
  */
6102
6110
  function () {
6103
- var _setGuestUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(user) {
6111
+ var _setGuestUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(user) {
6104
6112
  var response, _response$user, guestUser;
6105
6113
 
6106
- return _regeneratorRuntime.wrap(function _callee14$(_context14) {
6114
+ return _regeneratorRuntime.wrap(function _callee13$(_context13) {
6107
6115
  while (1) {
6108
- switch (_context14.prev = _context14.next) {
6116
+ switch (_context13.prev = _context13.next) {
6109
6117
  case 0:
6110
6118
  this.anonymous = true;
6111
- _context14.prev = 1;
6112
- _context14.next = 4;
6119
+ _context13.prev = 1;
6120
+ _context13.next = 4;
6113
6121
  return this.post(this.baseURL + '/guest', {
6114
6122
  user: user
6115
6123
  });
6116
6124
 
6117
6125
  case 4:
6118
- response = _context14.sent;
6119
- _context14.next = 11;
6126
+ response = _context13.sent;
6127
+ _context13.next = 11;
6120
6128
  break;
6121
6129
 
6122
6130
  case 7:
6123
- _context14.prev = 7;
6124
- _context14.t0 = _context14["catch"](1);
6131
+ _context13.prev = 7;
6132
+ _context13.t0 = _context13["catch"](1);
6125
6133
  this.anonymous = false;
6126
- throw _context14.t0;
6134
+ throw _context13.t0;
6127
6135
 
6128
6136
  case 11:
6129
6137
  this.anonymous = false; // eslint-disable-next-line @typescript-eslint/no-unused-vars
6130
6138
 
6131
6139
  _response$user = response.user, _response$user.created_at, _response$user.updated_at, _response$user.last_active, _response$user.online, guestUser = _objectWithoutProperties(_response$user, ["created_at", "updated_at", "last_active", "online"]);
6132
- _context14.next = 15;
6140
+ _context13.next = 15;
6133
6141
  return this.connectUser(guestUser, response.access_token);
6134
6142
 
6135
6143
  case 15:
6136
- return _context14.abrupt("return", _context14.sent);
6144
+ return _context13.abrupt("return", _context13.sent);
6137
6145
 
6138
6146
  case 16:
6139
6147
  case "end":
6140
- return _context14.stop();
6148
+ return _context13.stop();
6141
6149
  }
6142
6150
  }
6143
- }, _callee14, this, [[1, 7]]);
6151
+ }, _callee13, this, [[1, 7]]);
6144
6152
  }));
6145
6153
 
6146
- function setGuestUser(_x16) {
6154
+ function setGuestUser(_x14) {
6147
6155
  return _setGuestUser.apply(this, arguments);
6148
6156
  }
6149
6157
 
@@ -6453,17 +6461,17 @@ var StreamChat = /*#__PURE__*/function () {
6453
6461
  * @private
6454
6462
  */
6455
6463
  function () {
6456
- var _connect = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15() {
6457
- var client, warmUpPromise, handshake;
6458
- return _regeneratorRuntime.wrap(function _callee15$(_context15) {
6464
+ var _connect = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
6465
+ var client;
6466
+ return _regeneratorRuntime.wrap(function _callee14$(_context14) {
6459
6467
  while (1) {
6460
- switch (_context15.prev = _context15.next) {
6468
+ switch (_context14.prev = _context14.next) {
6461
6469
  case 0:
6462
6470
  client = this;
6463
6471
  this.failures = 0;
6464
6472
 
6465
6473
  if (!(client.userID == null || this._user == null)) {
6466
- _context15.next = 4;
6474
+ _context14.next = 4;
6467
6475
  break;
6468
6476
  }
6469
6477
 
@@ -6471,7 +6479,7 @@ var StreamChat = /*#__PURE__*/function () {
6471
6479
 
6472
6480
  case 4:
6473
6481
  if (!(client.wsBaseURL == null)) {
6474
- _context15.next = 6;
6482
+ _context14.next = 6;
6475
6483
  break;
6476
6484
  }
6477
6485
 
@@ -6479,16 +6487,21 @@ var StreamChat = /*#__PURE__*/function () {
6479
6487
 
6480
6488
  case 6:
6481
6489
  if (!(client.clientID == null)) {
6482
- _context15.next = 8;
6490
+ _context14.next = 8;
6483
6491
  break;
6484
6492
  }
6485
6493
 
6486
6494
  throw Error('clientID is not set');
6487
6495
 
6488
6496
  case 8:
6489
- // The StableWSConnection handles all the reconnection logic.
6497
+ if (!this.wsConnection && (this.options.warmUp || this.options.enableInsights)) {
6498
+ this._sayHi();
6499
+ } // The StableWSConnection handles all the reconnection logic.
6500
+
6501
+
6490
6502
  this.wsConnection = new StableWSConnection({
6491
6503
  wsBaseURL: client.wsBaseURL,
6504
+ enableInsights: this.options.enableInsights,
6492
6505
  clientID: client.clientID,
6493
6506
  userID: client.userID,
6494
6507
  tokenManager: client.tokenManager,
@@ -6501,43 +6514,20 @@ var StreamChat = /*#__PURE__*/function () {
6501
6514
  eventCallback: this.dispatchEvent,
6502
6515
  logger: this.logger,
6503
6516
  device: this.options.device,
6504
- postInsights: this.options.enableInsights ? this.postInsights : undefined,
6505
6517
  insightMetrics: this.insightMetrics
6506
6518
  });
6507
-
6508
- if (this.options.warmUp) {
6509
- warmUpPromise = this.doAxiosRequest('options', this.baseURL + '/connect');
6510
- }
6511
-
6512
- _context15.next = 12;
6519
+ _context14.next = 12;
6513
6520
  return this.wsConnection.connect();
6514
6521
 
6515
6522
  case 12:
6516
- handshake = _context15.sent;
6517
- _context15.prev = 13;
6518
- _context15.next = 16;
6519
- return warmUpPromise;
6520
-
6521
- case 16:
6522
- _context15.next = 21;
6523
- break;
6524
-
6525
- case 18:
6526
- _context15.prev = 18;
6527
- _context15.t0 = _context15["catch"](13);
6528
- this.logger('error', 'Warmup request failed', {
6529
- error: _context15.t0
6530
- });
6531
-
6532
- case 21:
6533
- return _context15.abrupt("return", handshake);
6523
+ return _context14.abrupt("return", _context14.sent);
6534
6524
 
6535
- case 22:
6525
+ case 13:
6536
6526
  case "end":
6537
- return _context15.stop();
6527
+ return _context14.stop();
6538
6528
  }
6539
6529
  }
6540
- }, _callee15, this, [[13, 18]]);
6530
+ }, _callee14, this);
6541
6531
  }));
6542
6532
 
6543
6533
  function connect() {
@@ -6546,6 +6536,33 @@ var StreamChat = /*#__PURE__*/function () {
6546
6536
 
6547
6537
  return connect;
6548
6538
  }()
6539
+ /**
6540
+ * Check the connectivity with server for warmup purpose.
6541
+ *
6542
+ * @private
6543
+ */
6544
+
6545
+ }, {
6546
+ key: "_sayHi",
6547
+ value: function _sayHi() {
6548
+ var _this4 = this;
6549
+
6550
+ var client_request_id = randomId();
6551
+ var opts = {
6552
+ headers: {
6553
+ 'x-client-request-id': client_request_id
6554
+ }
6555
+ };
6556
+ this.doAxiosRequest('get', this.baseURL + '/hi', null, opts).catch(function (e) {
6557
+ if (_this4.options.enableInsights) {
6558
+ postInsights('http_hi_failed', {
6559
+ api_key: _this4.key,
6560
+ err: e,
6561
+ client_request_id: client_request_id
6562
+ });
6563
+ }
6564
+ });
6565
+ }
6549
6566
  /**
6550
6567
  * queryUsers - Query users and watch user presence
6551
6568
  *
@@ -6560,23 +6577,23 @@ var StreamChat = /*#__PURE__*/function () {
6560
6577
  }, {
6561
6578
  key: "queryUsers",
6562
6579
  value: function () {
6563
- var _queryUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(filterConditions) {
6580
+ var _queryUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(filterConditions) {
6564
6581
  var sort,
6565
6582
  options,
6566
6583
  defaultOptions,
6567
6584
  data,
6568
- _args16 = arguments;
6569
- return _regeneratorRuntime.wrap(function _callee16$(_context16) {
6585
+ _args15 = arguments;
6586
+ return _regeneratorRuntime.wrap(function _callee15$(_context15) {
6570
6587
  while (1) {
6571
- switch (_context16.prev = _context16.next) {
6588
+ switch (_context15.prev = _context15.next) {
6572
6589
  case 0:
6573
- sort = _args16.length > 1 && _args16[1] !== undefined ? _args16[1] : [];
6574
- options = _args16.length > 2 && _args16[2] !== undefined ? _args16[2] : {};
6590
+ sort = _args15.length > 1 && _args15[1] !== undefined ? _args15[1] : [];
6591
+ options = _args15.length > 2 && _args15[2] !== undefined ? _args15[2] : {};
6575
6592
  defaultOptions = {
6576
6593
  presence: false
6577
6594
  }; // Make sure we wait for the connect promise if there is a pending one
6578
6595
 
6579
- _context16.next = 5;
6596
+ _context15.next = 5;
6580
6597
  return this.setUserPromise;
6581
6598
 
6582
6599
  case 5:
@@ -6585,7 +6602,7 @@ var StreamChat = /*#__PURE__*/function () {
6585
6602
  } // Return a list of users
6586
6603
 
6587
6604
 
6588
- _context16.next = 8;
6605
+ _context15.next = 8;
6589
6606
  return this.get(this.baseURL + '/users', {
6590
6607
  payload: _objectSpread(_objectSpread({
6591
6608
  filter_conditions: filterConditions,
@@ -6594,19 +6611,19 @@ var StreamChat = /*#__PURE__*/function () {
6594
6611
  });
6595
6612
 
6596
6613
  case 8:
6597
- data = _context16.sent;
6614
+ data = _context15.sent;
6598
6615
  this.state.updateUsers(data.users);
6599
- return _context16.abrupt("return", data);
6616
+ return _context15.abrupt("return", data);
6600
6617
 
6601
6618
  case 11:
6602
6619
  case "end":
6603
- return _context16.stop();
6620
+ return _context15.stop();
6604
6621
  }
6605
6622
  }
6606
- }, _callee16, this);
6623
+ }, _callee15, this);
6607
6624
  }));
6608
6625
 
6609
- function queryUsers(_x17) {
6626
+ function queryUsers(_x15) {
6610
6627
  return _queryUsers.apply(this, arguments);
6611
6628
  }
6612
6629
 
@@ -6625,19 +6642,19 @@ var StreamChat = /*#__PURE__*/function () {
6625
6642
  }, {
6626
6643
  key: "queryBannedUsers",
6627
6644
  value: function () {
6628
- var _queryBannedUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17() {
6645
+ var _queryBannedUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16() {
6629
6646
  var filterConditions,
6630
6647
  sort,
6631
6648
  options,
6632
- _args17 = arguments;
6633
- return _regeneratorRuntime.wrap(function _callee17$(_context17) {
6649
+ _args16 = arguments;
6650
+ return _regeneratorRuntime.wrap(function _callee16$(_context16) {
6634
6651
  while (1) {
6635
- switch (_context17.prev = _context17.next) {
6652
+ switch (_context16.prev = _context16.next) {
6636
6653
  case 0:
6637
- filterConditions = _args17.length > 0 && _args17[0] !== undefined ? _args17[0] : {};
6638
- sort = _args17.length > 1 && _args17[1] !== undefined ? _args17[1] : [];
6639
- options = _args17.length > 2 && _args17[2] !== undefined ? _args17[2] : {};
6640
- _context17.next = 5;
6654
+ filterConditions = _args16.length > 0 && _args16[0] !== undefined ? _args16[0] : {};
6655
+ sort = _args16.length > 1 && _args16[1] !== undefined ? _args16[1] : [];
6656
+ options = _args16.length > 2 && _args16[2] !== undefined ? _args16[2] : {};
6657
+ _context16.next = 5;
6641
6658
  return this.get(this.baseURL + '/query_banned_users', {
6642
6659
  payload: _objectSpread({
6643
6660
  filter_conditions: filterConditions,
@@ -6646,14 +6663,14 @@ var StreamChat = /*#__PURE__*/function () {
6646
6663
  });
6647
6664
 
6648
6665
  case 5:
6649
- return _context17.abrupt("return", _context17.sent);
6666
+ return _context16.abrupt("return", _context16.sent);
6650
6667
 
6651
6668
  case 6:
6652
6669
  case "end":
6653
- return _context17.stop();
6670
+ return _context16.stop();
6654
6671
  }
6655
6672
  }
6656
- }, _callee17, this);
6673
+ }, _callee16, this);
6657
6674
  }));
6658
6675
 
6659
6676
  function queryBannedUsers() {
@@ -6674,17 +6691,17 @@ var StreamChat = /*#__PURE__*/function () {
6674
6691
  }, {
6675
6692
  key: "queryMessageFlags",
6676
6693
  value: function () {
6677
- var _queryMessageFlags = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18() {
6694
+ var _queryMessageFlags = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17() {
6678
6695
  var filterConditions,
6679
6696
  options,
6680
- _args18 = arguments;
6681
- return _regeneratorRuntime.wrap(function _callee18$(_context18) {
6697
+ _args17 = arguments;
6698
+ return _regeneratorRuntime.wrap(function _callee17$(_context17) {
6682
6699
  while (1) {
6683
- switch (_context18.prev = _context18.next) {
6700
+ switch (_context17.prev = _context17.next) {
6684
6701
  case 0:
6685
- filterConditions = _args18.length > 0 && _args18[0] !== undefined ? _args18[0] : {};
6686
- options = _args18.length > 1 && _args18[1] !== undefined ? _args18[1] : {};
6687
- _context18.next = 4;
6702
+ filterConditions = _args17.length > 0 && _args17[0] !== undefined ? _args17[0] : {};
6703
+ options = _args17.length > 1 && _args17[1] !== undefined ? _args17[1] : {};
6704
+ _context17.next = 4;
6688
6705
  return this.get(this.baseURL + '/moderation/flags/message', {
6689
6706
  payload: _objectSpread({
6690
6707
  filter_conditions: filterConditions
@@ -6692,14 +6709,14 @@ var StreamChat = /*#__PURE__*/function () {
6692
6709
  });
6693
6710
 
6694
6711
  case 4:
6695
- return _context18.abrupt("return", _context18.sent);
6712
+ return _context17.abrupt("return", _context17.sent);
6696
6713
 
6697
6714
  case 5:
6698
6715
  case "end":
6699
- return _context18.stop();
6716
+ return _context17.stop();
6700
6717
  }
6701
6718
  }
6702
- }, _callee18, this);
6719
+ }, _callee17, this);
6703
6720
  }));
6704
6721
 
6705
6722
  function queryMessageFlags() {
@@ -6724,7 +6741,7 @@ var StreamChat = /*#__PURE__*/function () {
6724
6741
  }, {
6725
6742
  key: "queryChannels",
6726
6743
  value: function () {
6727
- var _queryChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(filterConditions) {
6744
+ var _queryChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18(filterConditions) {
6728
6745
  var sort,
6729
6746
  options,
6730
6747
  stateOptions,
@@ -6740,15 +6757,15 @@ var StreamChat = /*#__PURE__*/function () {
6740
6757
  _step3,
6741
6758
  _channelState,
6742
6759
  c,
6743
- _args19 = arguments;
6760
+ _args18 = arguments;
6744
6761
 
6745
- return _regeneratorRuntime.wrap(function _callee19$(_context19) {
6762
+ return _regeneratorRuntime.wrap(function _callee18$(_context18) {
6746
6763
  while (1) {
6747
- switch (_context19.prev = _context19.next) {
6764
+ switch (_context18.prev = _context18.next) {
6748
6765
  case 0:
6749
- sort = _args19.length > 1 && _args19[1] !== undefined ? _args19[1] : [];
6750
- options = _args19.length > 2 && _args19[2] !== undefined ? _args19[2] : {};
6751
- stateOptions = _args19.length > 3 && _args19[3] !== undefined ? _args19[3] : {};
6766
+ sort = _args18.length > 1 && _args18[1] !== undefined ? _args18[1] : [];
6767
+ options = _args18.length > 2 && _args18[2] !== undefined ? _args18[2] : {};
6768
+ stateOptions = _args18.length > 3 && _args18[3] !== undefined ? _args18[3] : {};
6752
6769
  skipInitialization = stateOptions.skipInitialization;
6753
6770
  defaultOptions = {
6754
6771
  state: true,
@@ -6756,7 +6773,7 @@ var StreamChat = /*#__PURE__*/function () {
6756
6773
  presence: false
6757
6774
  }; // Make sure we wait for the connect promise if there is a pending one
6758
6775
 
6759
- _context19.next = 7;
6776
+ _context18.next = 7;
6760
6777
  return this.setUserPromise;
6761
6778
 
6762
6779
  case 7:
@@ -6769,11 +6786,11 @@ var StreamChat = /*#__PURE__*/function () {
6769
6786
  filter_conditions: filterConditions,
6770
6787
  sort: normalizeQuerySort(sort)
6771
6788
  }, defaultOptions), options);
6772
- _context19.next = 11;
6789
+ _context18.next = 11;
6773
6790
  return this.post(this.baseURL + '/channels', payload);
6774
6791
 
6775
6792
  case 11:
6776
- data = _context19.sent;
6793
+ data = _context18.sent;
6777
6794
  channels = []; // update our cache of the configs
6778
6795
 
6779
6796
  _iterator2 = _createForOfIteratorHelper(data.channels);
@@ -6815,17 +6832,17 @@ var StreamChat = /*#__PURE__*/function () {
6815
6832
  _iterator3.f();
6816
6833
  }
6817
6834
 
6818
- return _context19.abrupt("return", channels);
6835
+ return _context18.abrupt("return", channels);
6819
6836
 
6820
6837
  case 18:
6821
6838
  case "end":
6822
- return _context19.stop();
6839
+ return _context18.stop();
6823
6840
  }
6824
6841
  }
6825
- }, _callee19, this);
6842
+ }, _callee18, this);
6826
6843
  }));
6827
6844
 
6828
- function queryChannels(_x18) {
6845
+ function queryChannels(_x16) {
6829
6846
  return _queryChannels.apply(this, arguments);
6830
6847
  }
6831
6848
 
@@ -6844,18 +6861,18 @@ var StreamChat = /*#__PURE__*/function () {
6844
6861
  }, {
6845
6862
  key: "search",
6846
6863
  value: function () {
6847
- var _search = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20(filterConditions, query) {
6864
+ var _search = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(filterConditions, query) {
6848
6865
  var options,
6849
6866
  payload,
6850
- _args20 = arguments;
6851
- return _regeneratorRuntime.wrap(function _callee20$(_context20) {
6867
+ _args19 = arguments;
6868
+ return _regeneratorRuntime.wrap(function _callee19$(_context19) {
6852
6869
  while (1) {
6853
- switch (_context20.prev = _context20.next) {
6870
+ switch (_context19.prev = _context19.next) {
6854
6871
  case 0:
6855
- options = _args20.length > 2 && _args20[2] !== undefined ? _args20[2] : {};
6872
+ options = _args19.length > 2 && _args19[2] !== undefined ? _args19[2] : {};
6856
6873
 
6857
6874
  if (!(options.offset && (options.sort || options.next))) {
6858
- _context20.next = 3;
6875
+ _context19.next = 3;
6859
6876
  break;
6860
6877
  }
6861
6878
 
@@ -6869,49 +6886,49 @@ var StreamChat = /*#__PURE__*/function () {
6869
6886
  });
6870
6887
 
6871
6888
  if (!(typeof query === 'string')) {
6872
- _context20.next = 8;
6889
+ _context19.next = 8;
6873
6890
  break;
6874
6891
  }
6875
6892
 
6876
6893
  payload.query = query;
6877
- _context20.next = 13;
6894
+ _context19.next = 13;
6878
6895
  break;
6879
6896
 
6880
6897
  case 8:
6881
6898
  if (!(_typeof(query) === 'object')) {
6882
- _context20.next = 12;
6899
+ _context19.next = 12;
6883
6900
  break;
6884
6901
  }
6885
6902
 
6886
6903
  payload.message_filter_conditions = query;
6887
- _context20.next = 13;
6904
+ _context19.next = 13;
6888
6905
  break;
6889
6906
 
6890
6907
  case 12:
6891
6908
  throw Error("Invalid type ".concat(_typeof(query), " for query parameter"));
6892
6909
 
6893
6910
  case 13:
6894
- _context20.next = 15;
6911
+ _context19.next = 15;
6895
6912
  return this.setUserPromise;
6896
6913
 
6897
6914
  case 15:
6898
- _context20.next = 17;
6915
+ _context19.next = 17;
6899
6916
  return this.get(this.baseURL + '/search', {
6900
6917
  payload: payload
6901
6918
  });
6902
6919
 
6903
6920
  case 17:
6904
- return _context20.abrupt("return", _context20.sent);
6921
+ return _context19.abrupt("return", _context19.sent);
6905
6922
 
6906
6923
  case 18:
6907
6924
  case "end":
6908
- return _context20.stop();
6925
+ return _context19.stop();
6909
6926
  }
6910
6927
  }
6911
- }, _callee20, this);
6928
+ }, _callee19, this);
6912
6929
  }));
6913
6930
 
6914
- function search(_x19, _x20) {
6931
+ function search(_x17, _x18) {
6915
6932
  return _search.apply(this, arguments);
6916
6933
  }
6917
6934
 
@@ -6947,12 +6964,12 @@ var StreamChat = /*#__PURE__*/function () {
6947
6964
  }, {
6948
6965
  key: "addDevice",
6949
6966
  value: function () {
6950
- var _addDevice = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21(id, push_provider, userID) {
6951
- return _regeneratorRuntime.wrap(function _callee21$(_context21) {
6967
+ var _addDevice = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20(id, push_provider, userID) {
6968
+ return _regeneratorRuntime.wrap(function _callee20$(_context20) {
6952
6969
  while (1) {
6953
- switch (_context21.prev = _context21.next) {
6970
+ switch (_context20.prev = _context20.next) {
6954
6971
  case 0:
6955
- _context21.next = 2;
6972
+ _context20.next = 2;
6956
6973
  return this.post(this.baseURL + '/devices', _objectSpread({
6957
6974
  id: id,
6958
6975
  push_provider: push_provider
@@ -6961,17 +6978,17 @@ var StreamChat = /*#__PURE__*/function () {
6961
6978
  } : {}));
6962
6979
 
6963
6980
  case 2:
6964
- return _context21.abrupt("return", _context21.sent);
6981
+ return _context20.abrupt("return", _context20.sent);
6965
6982
 
6966
6983
  case 3:
6967
6984
  case "end":
6968
- return _context21.stop();
6985
+ return _context20.stop();
6969
6986
  }
6970
6987
  }
6971
- }, _callee21, this);
6988
+ }, _callee20, this);
6972
6989
  }));
6973
6990
 
6974
- function addDevice(_x21, _x22, _x23) {
6991
+ function addDevice(_x19, _x20, _x21) {
6975
6992
  return _addDevice.apply(this, arguments);
6976
6993
  }
6977
6994
 
@@ -6988,28 +7005,28 @@ var StreamChat = /*#__PURE__*/function () {
6988
7005
  }, {
6989
7006
  key: "getDevices",
6990
7007
  value: function () {
6991
- var _getDevices = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22(userID) {
6992
- return _regeneratorRuntime.wrap(function _callee22$(_context22) {
7008
+ var _getDevices = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21(userID) {
7009
+ return _regeneratorRuntime.wrap(function _callee21$(_context21) {
6993
7010
  while (1) {
6994
- switch (_context22.prev = _context22.next) {
7011
+ switch (_context21.prev = _context21.next) {
6995
7012
  case 0:
6996
- _context22.next = 2;
7013
+ _context21.next = 2;
6997
7014
  return this.get(this.baseURL + '/devices', userID ? {
6998
7015
  user_id: userID
6999
7016
  } : {});
7000
7017
 
7001
7018
  case 2:
7002
- return _context22.abrupt("return", _context22.sent);
7019
+ return _context21.abrupt("return", _context21.sent);
7003
7020
 
7004
7021
  case 3:
7005
7022
  case "end":
7006
- return _context22.stop();
7023
+ return _context21.stop();
7007
7024
  }
7008
7025
  }
7009
- }, _callee22, this);
7026
+ }, _callee21, this);
7010
7027
  }));
7011
7028
 
7012
- function getDevices(_x24) {
7029
+ function getDevices(_x22) {
7013
7030
  return _getDevices.apply(this, arguments);
7014
7031
  }
7015
7032
 
@@ -7026,12 +7043,12 @@ var StreamChat = /*#__PURE__*/function () {
7026
7043
  }, {
7027
7044
  key: "removeDevice",
7028
7045
  value: function () {
7029
- var _removeDevice = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23(id, userID) {
7030
- return _regeneratorRuntime.wrap(function _callee23$(_context23) {
7046
+ var _removeDevice = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22(id, userID) {
7047
+ return _regeneratorRuntime.wrap(function _callee22$(_context22) {
7031
7048
  while (1) {
7032
- switch (_context23.prev = _context23.next) {
7049
+ switch (_context22.prev = _context22.next) {
7033
7050
  case 0:
7034
- _context23.next = 2;
7051
+ _context22.next = 2;
7035
7052
  return this.delete(this.baseURL + '/devices', _objectSpread({
7036
7053
  id: id
7037
7054
  }, userID ? {
@@ -7039,17 +7056,17 @@ var StreamChat = /*#__PURE__*/function () {
7039
7056
  } : {}));
7040
7057
 
7041
7058
  case 2:
7042
- return _context23.abrupt("return", _context23.sent);
7059
+ return _context22.abrupt("return", _context22.sent);
7043
7060
 
7044
7061
  case 3:
7045
7062
  case "end":
7046
- return _context23.stop();
7063
+ return _context22.stop();
7047
7064
  }
7048
7065
  }
7049
- }, _callee23, this);
7066
+ }, _callee22, this);
7050
7067
  }));
7051
7068
 
7052
- function removeDevice(_x25, _x26) {
7069
+ function removeDevice(_x23, _x24) {
7053
7070
  return _removeDevice.apply(this, arguments);
7054
7071
  }
7055
7072
 
@@ -7066,15 +7083,15 @@ var StreamChat = /*#__PURE__*/function () {
7066
7083
  }, {
7067
7084
  key: "getRateLimits",
7068
7085
  value: function () {
7069
- var _getRateLimits = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24(params) {
7070
- var _ref7, serverSide, web, android, ios, endpoints;
7086
+ var _getRateLimits = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23(params) {
7087
+ var _ref6, serverSide, web, android, ios, endpoints;
7071
7088
 
7072
- return _regeneratorRuntime.wrap(function _callee24$(_context24) {
7089
+ return _regeneratorRuntime.wrap(function _callee23$(_context23) {
7073
7090
  while (1) {
7074
- switch (_context24.prev = _context24.next) {
7091
+ switch (_context23.prev = _context23.next) {
7075
7092
  case 0:
7076
- _ref7 = params || {}, serverSide = _ref7.serverSide, web = _ref7.web, android = _ref7.android, ios = _ref7.ios, endpoints = _ref7.endpoints;
7077
- return _context24.abrupt("return", this.get(this.baseURL + '/rate_limits', {
7093
+ _ref6 = params || {}, serverSide = _ref6.serverSide, web = _ref6.web, android = _ref6.android, ios = _ref6.ios, endpoints = _ref6.endpoints;
7094
+ return _context23.abrupt("return", this.get(this.baseURL + '/rate_limits', {
7078
7095
  server_side: serverSide,
7079
7096
  web: web,
7080
7097
  android: android,
@@ -7084,13 +7101,13 @@ var StreamChat = /*#__PURE__*/function () {
7084
7101
 
7085
7102
  case 2:
7086
7103
  case "end":
7087
- return _context24.stop();
7104
+ return _context23.stop();
7088
7105
  }
7089
7106
  }
7090
- }, _callee24, this);
7107
+ }, _callee23, this);
7091
7108
  }));
7092
7109
 
7093
- function getRateLimits(_x27) {
7110
+ function getRateLimits(_x25) {
7094
7111
  return _getRateLimits.apply(this, arguments);
7095
7112
  }
7096
7113
 
@@ -7172,26 +7189,26 @@ var StreamChat = /*#__PURE__*/function () {
7172
7189
  * @return {Promise<APIResponse & { users: { [key: string]: UserResponse<UserType> } }>} list of updated users
7173
7190
  */
7174
7191
  function () {
7175
- var _partialUpdateUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25(partialUserObject) {
7176
- return _regeneratorRuntime.wrap(function _callee25$(_context25) {
7192
+ var _partialUpdateUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24(partialUserObject) {
7193
+ return _regeneratorRuntime.wrap(function _callee24$(_context24) {
7177
7194
  while (1) {
7178
- switch (_context25.prev = _context25.next) {
7195
+ switch (_context24.prev = _context24.next) {
7179
7196
  case 0:
7180
- _context25.next = 2;
7197
+ _context24.next = 2;
7181
7198
  return this.partialUpdateUsers([partialUserObject]);
7182
7199
 
7183
7200
  case 2:
7184
- return _context25.abrupt("return", _context25.sent);
7201
+ return _context24.abrupt("return", _context24.sent);
7185
7202
 
7186
7203
  case 3:
7187
7204
  case "end":
7188
- return _context25.stop();
7205
+ return _context24.stop();
7189
7206
  }
7190
7207
  }
7191
- }, _callee25, this);
7208
+ }, _callee24, this);
7192
7209
  }));
7193
7210
 
7194
- function partialUpdateUser(_x28) {
7211
+ function partialUpdateUser(_x26) {
7195
7212
  return _partialUpdateUser.apply(this, arguments);
7196
7213
  }
7197
7214
 
@@ -7208,29 +7225,29 @@ var StreamChat = /*#__PURE__*/function () {
7208
7225
  }, {
7209
7226
  key: "upsertUsers",
7210
7227
  value: function () {
7211
- var _upsertUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26(users) {
7228
+ var _upsertUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25(users) {
7212
7229
  var userMap, _iterator4, _step4, userObject;
7213
7230
 
7214
- return _regeneratorRuntime.wrap(function _callee26$(_context26) {
7231
+ return _regeneratorRuntime.wrap(function _callee25$(_context25) {
7215
7232
  while (1) {
7216
- switch (_context26.prev = _context26.next) {
7233
+ switch (_context25.prev = _context25.next) {
7217
7234
  case 0:
7218
7235
  userMap = {};
7219
7236
  _iterator4 = _createForOfIteratorHelper(users);
7220
- _context26.prev = 2;
7237
+ _context25.prev = 2;
7221
7238
 
7222
7239
  _iterator4.s();
7223
7240
 
7224
7241
  case 4:
7225
7242
  if ((_step4 = _iterator4.n()).done) {
7226
- _context26.next = 11;
7243
+ _context25.next = 11;
7227
7244
  break;
7228
7245
  }
7229
7246
 
7230
7247
  userObject = _step4.value;
7231
7248
 
7232
7249
  if (userObject.id) {
7233
- _context26.next = 8;
7250
+ _context25.next = 8;
7234
7251
  break;
7235
7252
  }
7236
7253
 
@@ -7240,44 +7257,44 @@ var StreamChat = /*#__PURE__*/function () {
7240
7257
  userMap[userObject.id] = userObject;
7241
7258
 
7242
7259
  case 9:
7243
- _context26.next = 4;
7260
+ _context25.next = 4;
7244
7261
  break;
7245
7262
 
7246
7263
  case 11:
7247
- _context26.next = 16;
7264
+ _context25.next = 16;
7248
7265
  break;
7249
7266
 
7250
7267
  case 13:
7251
- _context26.prev = 13;
7252
- _context26.t0 = _context26["catch"](2);
7268
+ _context25.prev = 13;
7269
+ _context25.t0 = _context25["catch"](2);
7253
7270
 
7254
- _iterator4.e(_context26.t0);
7271
+ _iterator4.e(_context25.t0);
7255
7272
 
7256
7273
  case 16:
7257
- _context26.prev = 16;
7274
+ _context25.prev = 16;
7258
7275
 
7259
7276
  _iterator4.f();
7260
7277
 
7261
- return _context26.finish(16);
7278
+ return _context25.finish(16);
7262
7279
 
7263
7280
  case 19:
7264
- _context26.next = 21;
7281
+ _context25.next = 21;
7265
7282
  return this.post(this.baseURL + '/users', {
7266
7283
  users: userMap
7267
7284
  });
7268
7285
 
7269
7286
  case 21:
7270
- return _context26.abrupt("return", _context26.sent);
7287
+ return _context25.abrupt("return", _context25.sent);
7271
7288
 
7272
7289
  case 22:
7273
7290
  case "end":
7274
- return _context26.stop();
7291
+ return _context25.stop();
7275
7292
  }
7276
7293
  }
7277
- }, _callee26, this, [[2, 13, 16, 19]]);
7294
+ }, _callee25, this, [[2, 13, 16, 19]]);
7278
7295
  }));
7279
7296
 
7280
- function upsertUsers(_x29) {
7297
+ function upsertUsers(_x27) {
7281
7298
  return _upsertUsers.apply(this, arguments);
7282
7299
  }
7283
7300
 
@@ -7325,72 +7342,72 @@ var StreamChat = /*#__PURE__*/function () {
7325
7342
  * @return {Promise<APIResponse & { users: { [key: string]: UserResponse<UserType> } }>}
7326
7343
  */
7327
7344
  function () {
7328
- var _partialUpdateUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27(users) {
7345
+ var _partialUpdateUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26(users) {
7329
7346
  var _iterator5, _step5, userObject;
7330
7347
 
7331
- return _regeneratorRuntime.wrap(function _callee27$(_context27) {
7348
+ return _regeneratorRuntime.wrap(function _callee26$(_context26) {
7332
7349
  while (1) {
7333
- switch (_context27.prev = _context27.next) {
7350
+ switch (_context26.prev = _context26.next) {
7334
7351
  case 0:
7335
7352
  _iterator5 = _createForOfIteratorHelper(users);
7336
- _context27.prev = 1;
7353
+ _context26.prev = 1;
7337
7354
 
7338
7355
  _iterator5.s();
7339
7356
 
7340
7357
  case 3:
7341
7358
  if ((_step5 = _iterator5.n()).done) {
7342
- _context27.next = 9;
7359
+ _context26.next = 9;
7343
7360
  break;
7344
7361
  }
7345
7362
 
7346
7363
  userObject = _step5.value;
7347
7364
 
7348
7365
  if (userObject.id) {
7349
- _context27.next = 7;
7366
+ _context26.next = 7;
7350
7367
  break;
7351
7368
  }
7352
7369
 
7353
7370
  throw Error('User ID is required when updating a user');
7354
7371
 
7355
7372
  case 7:
7356
- _context27.next = 3;
7373
+ _context26.next = 3;
7357
7374
  break;
7358
7375
 
7359
7376
  case 9:
7360
- _context27.next = 14;
7377
+ _context26.next = 14;
7361
7378
  break;
7362
7379
 
7363
7380
  case 11:
7364
- _context27.prev = 11;
7365
- _context27.t0 = _context27["catch"](1);
7381
+ _context26.prev = 11;
7382
+ _context26.t0 = _context26["catch"](1);
7366
7383
 
7367
- _iterator5.e(_context27.t0);
7384
+ _iterator5.e(_context26.t0);
7368
7385
 
7369
7386
  case 14:
7370
- _context27.prev = 14;
7387
+ _context26.prev = 14;
7371
7388
 
7372
7389
  _iterator5.f();
7373
7390
 
7374
- return _context27.finish(14);
7391
+ return _context26.finish(14);
7375
7392
 
7376
7393
  case 17:
7377
- _context27.next = 19;
7394
+ _context26.next = 19;
7378
7395
  return this.patch(this.baseURL + '/users', {
7379
7396
  users: users
7380
7397
  });
7381
7398
 
7382
7399
  case 19:
7383
- return _context27.abrupt("return", _context27.sent);
7400
+ return _context26.abrupt("return", _context26.sent);
7384
7401
 
7385
7402
  case 20:
7386
7403
  case "end":
7387
- return _context27.stop();
7404
+ return _context26.stop();
7388
7405
  }
7389
7406
  }
7390
- }, _callee27, this, [[1, 11, 14, 17]]);
7407
+ }, _callee26, this, [[1, 11, 14, 17]]);
7391
7408
  }));
7392
7409
 
7393
- function partialUpdateUsers(_x30) {
7410
+ function partialUpdateUsers(_x28) {
7394
7411
  return _partialUpdateUsers.apply(this, arguments);
7395
7412
  }
7396
7413
 
@@ -7399,26 +7416,26 @@ var StreamChat = /*#__PURE__*/function () {
7399
7416
  }, {
7400
7417
  key: "deleteUser",
7401
7418
  value: function () {
7402
- var _deleteUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee28(userID, params) {
7403
- return _regeneratorRuntime.wrap(function _callee28$(_context28) {
7419
+ var _deleteUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27(userID, params) {
7420
+ return _regeneratorRuntime.wrap(function _callee27$(_context27) {
7404
7421
  while (1) {
7405
- switch (_context28.prev = _context28.next) {
7422
+ switch (_context27.prev = _context27.next) {
7406
7423
  case 0:
7407
- _context28.next = 2;
7424
+ _context27.next = 2;
7408
7425
  return this.delete(this.baseURL + "/users/".concat(userID), params);
7409
7426
 
7410
7427
  case 2:
7411
- return _context28.abrupt("return", _context28.sent);
7428
+ return _context27.abrupt("return", _context27.sent);
7412
7429
 
7413
7430
  case 3:
7414
7431
  case "end":
7415
- return _context28.stop();
7432
+ return _context27.stop();
7416
7433
  }
7417
7434
  }
7418
- }, _callee28, this);
7435
+ }, _callee27, this);
7419
7436
  }));
7420
7437
 
7421
- function deleteUser(_x31, _x32) {
7438
+ function deleteUser(_x29, _x30) {
7422
7439
  return _deleteUser.apply(this, arguments);
7423
7440
  }
7424
7441
 
@@ -7427,26 +7444,26 @@ var StreamChat = /*#__PURE__*/function () {
7427
7444
  }, {
7428
7445
  key: "reactivateUser",
7429
7446
  value: function () {
7430
- var _reactivateUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee29(userID, options) {
7431
- return _regeneratorRuntime.wrap(function _callee29$(_context29) {
7447
+ var _reactivateUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee28(userID, options) {
7448
+ return _regeneratorRuntime.wrap(function _callee28$(_context28) {
7432
7449
  while (1) {
7433
- switch (_context29.prev = _context29.next) {
7450
+ switch (_context28.prev = _context28.next) {
7434
7451
  case 0:
7435
- _context29.next = 2;
7452
+ _context28.next = 2;
7436
7453
  return this.post(this.baseURL + "/users/".concat(userID, "/reactivate"), _objectSpread({}, options));
7437
7454
 
7438
7455
  case 2:
7439
- return _context29.abrupt("return", _context29.sent);
7456
+ return _context28.abrupt("return", _context28.sent);
7440
7457
 
7441
7458
  case 3:
7442
7459
  case "end":
7443
- return _context29.stop();
7460
+ return _context28.stop();
7444
7461
  }
7445
7462
  }
7446
- }, _callee29, this);
7463
+ }, _callee28, this);
7447
7464
  }));
7448
7465
 
7449
- function reactivateUser(_x33, _x34) {
7466
+ function reactivateUser(_x31, _x32) {
7450
7467
  return _reactivateUser.apply(this, arguments);
7451
7468
  }
7452
7469
 
@@ -7455,26 +7472,26 @@ var StreamChat = /*#__PURE__*/function () {
7455
7472
  }, {
7456
7473
  key: "deactivateUser",
7457
7474
  value: function () {
7458
- var _deactivateUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30(userID, options) {
7459
- return _regeneratorRuntime.wrap(function _callee30$(_context30) {
7475
+ var _deactivateUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee29(userID, options) {
7476
+ return _regeneratorRuntime.wrap(function _callee29$(_context29) {
7460
7477
  while (1) {
7461
- switch (_context30.prev = _context30.next) {
7478
+ switch (_context29.prev = _context29.next) {
7462
7479
  case 0:
7463
- _context30.next = 2;
7480
+ _context29.next = 2;
7464
7481
  return this.post(this.baseURL + "/users/".concat(userID, "/deactivate"), _objectSpread({}, options));
7465
7482
 
7466
7483
  case 2:
7467
- return _context30.abrupt("return", _context30.sent);
7484
+ return _context29.abrupt("return", _context29.sent);
7468
7485
 
7469
7486
  case 3:
7470
7487
  case "end":
7471
- return _context30.stop();
7488
+ return _context29.stop();
7472
7489
  }
7473
7490
  }
7474
- }, _callee30, this);
7491
+ }, _callee29, this);
7475
7492
  }));
7476
7493
 
7477
- function deactivateUser(_x35, _x36) {
7494
+ function deactivateUser(_x33, _x34) {
7478
7495
  return _deactivateUser.apply(this, arguments);
7479
7496
  }
7480
7497
 
@@ -7483,26 +7500,26 @@ var StreamChat = /*#__PURE__*/function () {
7483
7500
  }, {
7484
7501
  key: "exportUser",
7485
7502
  value: function () {
7486
- var _exportUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31(userID, options) {
7487
- return _regeneratorRuntime.wrap(function _callee31$(_context31) {
7503
+ var _exportUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30(userID, options) {
7504
+ return _regeneratorRuntime.wrap(function _callee30$(_context30) {
7488
7505
  while (1) {
7489
- switch (_context31.prev = _context31.next) {
7506
+ switch (_context30.prev = _context30.next) {
7490
7507
  case 0:
7491
- _context31.next = 2;
7508
+ _context30.next = 2;
7492
7509
  return this.get(this.baseURL + "/users/".concat(userID, "/export"), _objectSpread({}, options));
7493
7510
 
7494
7511
  case 2:
7495
- return _context31.abrupt("return", _context31.sent);
7512
+ return _context30.abrupt("return", _context30.sent);
7496
7513
 
7497
7514
  case 3:
7498
7515
  case "end":
7499
- return _context31.stop();
7516
+ return _context30.stop();
7500
7517
  }
7501
7518
  }
7502
- }, _callee31, this);
7519
+ }, _callee30, this);
7503
7520
  }));
7504
7521
 
7505
- function exportUser(_x37, _x38) {
7522
+ function exportUser(_x35, _x36) {
7506
7523
  return _exportUser.apply(this, arguments);
7507
7524
  }
7508
7525
 
@@ -7518,10 +7535,10 @@ var StreamChat = /*#__PURE__*/function () {
7518
7535
  }, {
7519
7536
  key: "banUser",
7520
7537
  value: function () {
7521
- var _banUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee32(targetUserID, options) {
7522
- return _regeneratorRuntime.wrap(function _callee32$(_context32) {
7538
+ var _banUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31(targetUserID, options) {
7539
+ return _regeneratorRuntime.wrap(function _callee31$(_context31) {
7523
7540
  while (1) {
7524
- switch (_context32.prev = _context32.next) {
7541
+ switch (_context31.prev = _context31.next) {
7525
7542
  case 0:
7526
7543
  if ((options === null || options === void 0 ? void 0 : options.user_id) !== undefined) {
7527
7544
  options.banned_by_id = options.user_id;
@@ -7535,23 +7552,23 @@ var StreamChat = /*#__PURE__*/function () {
7535
7552
  console.warn("banUser: 'user' is deprecated, please consider switching to 'banned_by'");
7536
7553
  }
7537
7554
 
7538
- _context32.next = 4;
7555
+ _context31.next = 4;
7539
7556
  return this.post(this.baseURL + '/moderation/ban', _objectSpread({
7540
7557
  target_user_id: targetUserID
7541
7558
  }, options));
7542
7559
 
7543
7560
  case 4:
7544
- return _context32.abrupt("return", _context32.sent);
7561
+ return _context31.abrupt("return", _context31.sent);
7545
7562
 
7546
7563
  case 5:
7547
7564
  case "end":
7548
- return _context32.stop();
7565
+ return _context31.stop();
7549
7566
  }
7550
7567
  }
7551
- }, _callee32, this);
7568
+ }, _callee31, this);
7552
7569
  }));
7553
7570
 
7554
- function banUser(_x39, _x40) {
7571
+ function banUser(_x37, _x38) {
7555
7572
  return _banUser.apply(this, arguments);
7556
7573
  }
7557
7574
 
@@ -7567,28 +7584,28 @@ var StreamChat = /*#__PURE__*/function () {
7567
7584
  }, {
7568
7585
  key: "unbanUser",
7569
7586
  value: function () {
7570
- var _unbanUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee33(targetUserID, options) {
7571
- return _regeneratorRuntime.wrap(function _callee33$(_context33) {
7587
+ var _unbanUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee32(targetUserID, options) {
7588
+ return _regeneratorRuntime.wrap(function _callee32$(_context32) {
7572
7589
  while (1) {
7573
- switch (_context33.prev = _context33.next) {
7590
+ switch (_context32.prev = _context32.next) {
7574
7591
  case 0:
7575
- _context33.next = 2;
7592
+ _context32.next = 2;
7576
7593
  return this.delete(this.baseURL + '/moderation/ban', _objectSpread({
7577
7594
  target_user_id: targetUserID
7578
7595
  }, options));
7579
7596
 
7580
7597
  case 2:
7581
- return _context33.abrupt("return", _context33.sent);
7598
+ return _context32.abrupt("return", _context32.sent);
7582
7599
 
7583
7600
  case 3:
7584
7601
  case "end":
7585
- return _context33.stop();
7602
+ return _context32.stop();
7586
7603
  }
7587
7604
  }
7588
- }, _callee33, this);
7605
+ }, _callee32, this);
7589
7606
  }));
7590
7607
 
7591
- function unbanUser(_x41, _x42) {
7608
+ function unbanUser(_x39, _x40) {
7592
7609
  return _unbanUser.apply(this, arguments);
7593
7610
  }
7594
7611
 
@@ -7604,28 +7621,28 @@ var StreamChat = /*#__PURE__*/function () {
7604
7621
  }, {
7605
7622
  key: "shadowBan",
7606
7623
  value: function () {
7607
- var _shadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee34(targetUserID, options) {
7608
- return _regeneratorRuntime.wrap(function _callee34$(_context34) {
7624
+ var _shadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee33(targetUserID, options) {
7625
+ return _regeneratorRuntime.wrap(function _callee33$(_context33) {
7609
7626
  while (1) {
7610
- switch (_context34.prev = _context34.next) {
7627
+ switch (_context33.prev = _context33.next) {
7611
7628
  case 0:
7612
- _context34.next = 2;
7629
+ _context33.next = 2;
7613
7630
  return this.banUser(targetUserID, _objectSpread({
7614
7631
  shadow: true
7615
7632
  }, options));
7616
7633
 
7617
7634
  case 2:
7618
- return _context34.abrupt("return", _context34.sent);
7635
+ return _context33.abrupt("return", _context33.sent);
7619
7636
 
7620
7637
  case 3:
7621
7638
  case "end":
7622
- return _context34.stop();
7639
+ return _context33.stop();
7623
7640
  }
7624
7641
  }
7625
- }, _callee34, this);
7642
+ }, _callee33, this);
7626
7643
  }));
7627
7644
 
7628
- function shadowBan(_x43, _x44) {
7645
+ function shadowBan(_x41, _x42) {
7629
7646
  return _shadowBan.apply(this, arguments);
7630
7647
  }
7631
7648
 
@@ -7641,28 +7658,28 @@ var StreamChat = /*#__PURE__*/function () {
7641
7658
  }, {
7642
7659
  key: "removeShadowBan",
7643
7660
  value: function () {
7644
- var _removeShadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee35(targetUserID, options) {
7645
- return _regeneratorRuntime.wrap(function _callee35$(_context35) {
7661
+ var _removeShadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee34(targetUserID, options) {
7662
+ return _regeneratorRuntime.wrap(function _callee34$(_context34) {
7646
7663
  while (1) {
7647
- switch (_context35.prev = _context35.next) {
7664
+ switch (_context34.prev = _context34.next) {
7648
7665
  case 0:
7649
- _context35.next = 2;
7666
+ _context34.next = 2;
7650
7667
  return this.unbanUser(targetUserID, _objectSpread({
7651
7668
  shadow: true
7652
7669
  }, options));
7653
7670
 
7654
7671
  case 2:
7655
- return _context35.abrupt("return", _context35.sent);
7672
+ return _context34.abrupt("return", _context34.sent);
7656
7673
 
7657
7674
  case 3:
7658
7675
  case "end":
7659
- return _context35.stop();
7676
+ return _context34.stop();
7660
7677
  }
7661
7678
  }
7662
- }, _callee35, this);
7679
+ }, _callee34, this);
7663
7680
  }));
7664
7681
 
7665
- function removeShadowBan(_x45, _x46) {
7682
+ function removeShadowBan(_x43, _x44) {
7666
7683
  return _removeShadowBan.apply(this, arguments);
7667
7684
  }
7668
7685
 
@@ -7679,15 +7696,15 @@ var StreamChat = /*#__PURE__*/function () {
7679
7696
  }, {
7680
7697
  key: "muteUser",
7681
7698
  value: function () {
7682
- var _muteUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee36(targetID, userID) {
7699
+ var _muteUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee35(targetID, userID) {
7683
7700
  var options,
7684
- _args36 = arguments;
7685
- return _regeneratorRuntime.wrap(function _callee36$(_context36) {
7701
+ _args35 = arguments;
7702
+ return _regeneratorRuntime.wrap(function _callee35$(_context35) {
7686
7703
  while (1) {
7687
- switch (_context36.prev = _context36.next) {
7704
+ switch (_context35.prev = _context35.next) {
7688
7705
  case 0:
7689
- options = _args36.length > 2 && _args36[2] !== undefined ? _args36[2] : {};
7690
- _context36.next = 3;
7706
+ options = _args35.length > 2 && _args35[2] !== undefined ? _args35[2] : {};
7707
+ _context35.next = 3;
7691
7708
  return this.post(this.baseURL + '/moderation/mute', _objectSpread(_objectSpread({
7692
7709
  target_id: targetID
7693
7710
  }, userID ? {
@@ -7695,17 +7712,17 @@ var StreamChat = /*#__PURE__*/function () {
7695
7712
  } : {}), options));
7696
7713
 
7697
7714
  case 3:
7698
- return _context36.abrupt("return", _context36.sent);
7715
+ return _context35.abrupt("return", _context35.sent);
7699
7716
 
7700
7717
  case 4:
7701
7718
  case "end":
7702
- return _context36.stop();
7719
+ return _context35.stop();
7703
7720
  }
7704
7721
  }
7705
- }, _callee36, this);
7722
+ }, _callee35, this);
7706
7723
  }));
7707
7724
 
7708
- function muteUser(_x47, _x48) {
7725
+ function muteUser(_x45, _x46) {
7709
7726
  return _muteUser.apply(this, arguments);
7710
7727
  }
7711
7728
 
@@ -7721,12 +7738,12 @@ var StreamChat = /*#__PURE__*/function () {
7721
7738
  }, {
7722
7739
  key: "unmuteUser",
7723
7740
  value: function () {
7724
- var _unmuteUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee37(targetID, currentUserID) {
7725
- return _regeneratorRuntime.wrap(function _callee37$(_context37) {
7741
+ var _unmuteUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee36(targetID, currentUserID) {
7742
+ return _regeneratorRuntime.wrap(function _callee36$(_context36) {
7726
7743
  while (1) {
7727
- switch (_context37.prev = _context37.next) {
7744
+ switch (_context36.prev = _context36.next) {
7728
7745
  case 0:
7729
- _context37.next = 2;
7746
+ _context36.next = 2;
7730
7747
  return this.post(this.baseURL + '/moderation/unmute', _objectSpread({
7731
7748
  target_id: targetID
7732
7749
  }, currentUserID ? {
@@ -7734,17 +7751,17 @@ var StreamChat = /*#__PURE__*/function () {
7734
7751
  } : {}));
7735
7752
 
7736
7753
  case 2:
7737
- return _context37.abrupt("return", _context37.sent);
7754
+ return _context36.abrupt("return", _context36.sent);
7738
7755
 
7739
7756
  case 3:
7740
7757
  case "end":
7741
- return _context37.stop();
7758
+ return _context36.stop();
7742
7759
  }
7743
7760
  }
7744
- }, _callee37, this);
7761
+ }, _callee36, this);
7745
7762
  }));
7746
7763
 
7747
- function unmuteUser(_x49, _x50) {
7764
+ function unmuteUser(_x47, _x48) {
7748
7765
  return _unmuteUser.apply(this, arguments);
7749
7766
  }
7750
7767
 
@@ -7779,31 +7796,31 @@ var StreamChat = /*#__PURE__*/function () {
7779
7796
  }, {
7780
7797
  key: "flagMessage",
7781
7798
  value: function () {
7782
- var _flagMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee38(targetMessageID) {
7799
+ var _flagMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee37(targetMessageID) {
7783
7800
  var options,
7784
- _args38 = arguments;
7785
- return _regeneratorRuntime.wrap(function _callee38$(_context38) {
7801
+ _args37 = arguments;
7802
+ return _regeneratorRuntime.wrap(function _callee37$(_context37) {
7786
7803
  while (1) {
7787
- switch (_context38.prev = _context38.next) {
7804
+ switch (_context37.prev = _context37.next) {
7788
7805
  case 0:
7789
- options = _args38.length > 1 && _args38[1] !== undefined ? _args38[1] : {};
7790
- _context38.next = 3;
7806
+ options = _args37.length > 1 && _args37[1] !== undefined ? _args37[1] : {};
7807
+ _context37.next = 3;
7791
7808
  return this.post(this.baseURL + '/moderation/flag', _objectSpread({
7792
7809
  target_message_id: targetMessageID
7793
7810
  }, options));
7794
7811
 
7795
7812
  case 3:
7796
- return _context38.abrupt("return", _context38.sent);
7813
+ return _context37.abrupt("return", _context37.sent);
7797
7814
 
7798
7815
  case 4:
7799
7816
  case "end":
7800
- return _context38.stop();
7817
+ return _context37.stop();
7801
7818
  }
7802
7819
  }
7803
- }, _callee38, this);
7820
+ }, _callee37, this);
7804
7821
  }));
7805
7822
 
7806
- function flagMessage(_x51) {
7823
+ function flagMessage(_x49) {
7807
7824
  return _flagMessage.apply(this, arguments);
7808
7825
  }
7809
7826
 
@@ -7819,31 +7836,31 @@ var StreamChat = /*#__PURE__*/function () {
7819
7836
  }, {
7820
7837
  key: "flagUser",
7821
7838
  value: function () {
7822
- var _flagUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee39(targetID) {
7839
+ var _flagUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee38(targetID) {
7823
7840
  var options,
7824
- _args39 = arguments;
7825
- return _regeneratorRuntime.wrap(function _callee39$(_context39) {
7841
+ _args38 = arguments;
7842
+ return _regeneratorRuntime.wrap(function _callee38$(_context38) {
7826
7843
  while (1) {
7827
- switch (_context39.prev = _context39.next) {
7844
+ switch (_context38.prev = _context38.next) {
7828
7845
  case 0:
7829
- options = _args39.length > 1 && _args39[1] !== undefined ? _args39[1] : {};
7830
- _context39.next = 3;
7846
+ options = _args38.length > 1 && _args38[1] !== undefined ? _args38[1] : {};
7847
+ _context38.next = 3;
7831
7848
  return this.post(this.baseURL + '/moderation/flag', _objectSpread({
7832
7849
  target_user_id: targetID
7833
7850
  }, options));
7834
7851
 
7835
7852
  case 3:
7836
- return _context39.abrupt("return", _context39.sent);
7853
+ return _context38.abrupt("return", _context38.sent);
7837
7854
 
7838
7855
  case 4:
7839
7856
  case "end":
7840
- return _context39.stop();
7857
+ return _context38.stop();
7841
7858
  }
7842
7859
  }
7843
- }, _callee39, this);
7860
+ }, _callee38, this);
7844
7861
  }));
7845
7862
 
7846
- function flagUser(_x52) {
7863
+ function flagUser(_x50) {
7847
7864
  return _flagUser.apply(this, arguments);
7848
7865
  }
7849
7866
 
@@ -7859,31 +7876,31 @@ var StreamChat = /*#__PURE__*/function () {
7859
7876
  }, {
7860
7877
  key: "unflagMessage",
7861
7878
  value: function () {
7862
- var _unflagMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee40(targetMessageID) {
7879
+ var _unflagMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee39(targetMessageID) {
7863
7880
  var options,
7864
- _args40 = arguments;
7865
- return _regeneratorRuntime.wrap(function _callee40$(_context40) {
7881
+ _args39 = arguments;
7882
+ return _regeneratorRuntime.wrap(function _callee39$(_context39) {
7866
7883
  while (1) {
7867
- switch (_context40.prev = _context40.next) {
7884
+ switch (_context39.prev = _context39.next) {
7868
7885
  case 0:
7869
- options = _args40.length > 1 && _args40[1] !== undefined ? _args40[1] : {};
7870
- _context40.next = 3;
7886
+ options = _args39.length > 1 && _args39[1] !== undefined ? _args39[1] : {};
7887
+ _context39.next = 3;
7871
7888
  return this.post(this.baseURL + '/moderation/unflag', _objectSpread({
7872
7889
  target_message_id: targetMessageID
7873
7890
  }, options));
7874
7891
 
7875
7892
  case 3:
7876
- return _context40.abrupt("return", _context40.sent);
7893
+ return _context39.abrupt("return", _context39.sent);
7877
7894
 
7878
7895
  case 4:
7879
7896
  case "end":
7880
- return _context40.stop();
7897
+ return _context39.stop();
7881
7898
  }
7882
7899
  }
7883
- }, _callee40, this);
7900
+ }, _callee39, this);
7884
7901
  }));
7885
7902
 
7886
- function unflagMessage(_x53) {
7903
+ function unflagMessage(_x51) {
7887
7904
  return _unflagMessage.apply(this, arguments);
7888
7905
  }
7889
7906
 
@@ -7899,31 +7916,31 @@ var StreamChat = /*#__PURE__*/function () {
7899
7916
  }, {
7900
7917
  key: "unflagUser",
7901
7918
  value: function () {
7902
- var _unflagUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee41(targetID) {
7919
+ var _unflagUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee40(targetID) {
7903
7920
  var options,
7904
- _args41 = arguments;
7905
- return _regeneratorRuntime.wrap(function _callee41$(_context41) {
7921
+ _args40 = arguments;
7922
+ return _regeneratorRuntime.wrap(function _callee40$(_context40) {
7906
7923
  while (1) {
7907
- switch (_context41.prev = _context41.next) {
7924
+ switch (_context40.prev = _context40.next) {
7908
7925
  case 0:
7909
- options = _args41.length > 1 && _args41[1] !== undefined ? _args41[1] : {};
7910
- _context41.next = 3;
7926
+ options = _args40.length > 1 && _args40[1] !== undefined ? _args40[1] : {};
7927
+ _context40.next = 3;
7911
7928
  return this.post(this.baseURL + '/moderation/unflag', _objectSpread({
7912
7929
  target_user_id: targetID
7913
7930
  }, options));
7914
7931
 
7915
7932
  case 3:
7916
- return _context41.abrupt("return", _context41.sent);
7933
+ return _context40.abrupt("return", _context40.sent);
7917
7934
 
7918
7935
  case 4:
7919
7936
  case "end":
7920
- return _context41.stop();
7937
+ return _context40.stop();
7921
7938
  }
7922
7939
  }
7923
- }, _callee41, this);
7940
+ }, _callee40, this);
7924
7941
  }));
7925
7942
 
7926
- function unflagUser(_x54) {
7943
+ function unflagUser(_x52) {
7927
7944
  return _unflagUser.apply(this, arguments);
7928
7945
  }
7929
7946
 
@@ -7950,23 +7967,23 @@ var StreamChat = /*#__PURE__*/function () {
7950
7967
  * @return {Promise<APIResponse>}
7951
7968
  */
7952
7969
  function () {
7953
- var _markChannelsRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42() {
7970
+ var _markChannelsRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee41() {
7954
7971
  var data,
7955
- _args42 = arguments;
7956
- return _regeneratorRuntime.wrap(function _callee42$(_context42) {
7972
+ _args41 = arguments;
7973
+ return _regeneratorRuntime.wrap(function _callee41$(_context41) {
7957
7974
  while (1) {
7958
- switch (_context42.prev = _context42.next) {
7975
+ switch (_context41.prev = _context41.next) {
7959
7976
  case 0:
7960
- data = _args42.length > 0 && _args42[0] !== undefined ? _args42[0] : {};
7961
- _context42.next = 3;
7977
+ data = _args41.length > 0 && _args41[0] !== undefined ? _args41[0] : {};
7978
+ _context41.next = 3;
7962
7979
  return this.post(this.baseURL + '/channels/read', _objectSpread({}, data));
7963
7980
 
7964
7981
  case 3:
7965
7982
  case "end":
7966
- return _context42.stop();
7983
+ return _context41.stop();
7967
7984
  }
7968
7985
  }
7969
- }, _callee42, this);
7986
+ }, _callee41, this);
7970
7987
  }));
7971
7988
 
7972
7989
  function markChannelsRead() {
@@ -8041,28 +8058,28 @@ var StreamChat = /*#__PURE__*/function () {
8041
8058
  }, {
8042
8059
  key: "translateMessage",
8043
8060
  value: function () {
8044
- var _translateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee43(messageId, language) {
8045
- return _regeneratorRuntime.wrap(function _callee43$(_context43) {
8061
+ var _translateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42(messageId, language) {
8062
+ return _regeneratorRuntime.wrap(function _callee42$(_context42) {
8046
8063
  while (1) {
8047
- switch (_context43.prev = _context43.next) {
8064
+ switch (_context42.prev = _context42.next) {
8048
8065
  case 0:
8049
- _context43.next = 2;
8066
+ _context42.next = 2;
8050
8067
  return this.post(this.baseURL + "/messages/".concat(messageId, "/translate"), {
8051
8068
  language: language
8052
8069
  });
8053
8070
 
8054
8071
  case 2:
8055
- return _context43.abrupt("return", _context43.sent);
8072
+ return _context42.abrupt("return", _context42.sent);
8056
8073
 
8057
8074
  case 3:
8058
8075
  case "end":
8059
- return _context43.stop();
8076
+ return _context42.stop();
8060
8077
  }
8061
8078
  }
8062
- }, _callee43, this);
8079
+ }, _callee42, this);
8063
8080
  }));
8064
8081
 
8065
- function translateMessage(_x55, _x56) {
8082
+ function translateMessage(_x53, _x54) {
8066
8083
  return _translateMessage.apply(this, arguments);
8067
8084
  }
8068
8085
 
@@ -8162,14 +8179,14 @@ var StreamChat = /*#__PURE__*/function () {
8162
8179
  }, {
8163
8180
  key: "updateMessage",
8164
8181
  value: function () {
8165
- var _updateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44(message, userId, options) {
8182
+ var _updateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee43(message, userId, options) {
8166
8183
  var clonedMessage, reservedMessageFields;
8167
- return _regeneratorRuntime.wrap(function _callee44$(_context44) {
8184
+ return _regeneratorRuntime.wrap(function _callee43$(_context43) {
8168
8185
  while (1) {
8169
- switch (_context44.prev = _context44.next) {
8186
+ switch (_context43.prev = _context43.next) {
8170
8187
  case 0:
8171
8188
  if (message.id) {
8172
- _context44.next = 2;
8189
+ _context43.next = 2;
8173
8190
  break;
8174
8191
  }
8175
8192
 
@@ -8206,23 +8223,23 @@ var StreamChat = /*#__PURE__*/function () {
8206
8223
  });
8207
8224
  }
8208
8225
 
8209
- _context44.next = 10;
8226
+ _context43.next = 10;
8210
8227
  return this.post(this.baseURL + "/messages/".concat(message.id), _objectSpread({
8211
8228
  message: clonedMessage
8212
8229
  }, options));
8213
8230
 
8214
8231
  case 10:
8215
- return _context44.abrupt("return", _context44.sent);
8232
+ return _context43.abrupt("return", _context43.sent);
8216
8233
 
8217
8234
  case 11:
8218
8235
  case "end":
8219
- return _context44.stop();
8236
+ return _context43.stop();
8220
8237
  }
8221
8238
  }
8222
- }, _callee44, this);
8239
+ }, _callee43, this);
8223
8240
  }));
8224
8241
 
8225
- function updateMessage(_x57, _x58, _x59) {
8242
+ function updateMessage(_x55, _x56, _x57) {
8226
8243
  return _updateMessage.apply(this, arguments);
8227
8244
  }
8228
8245
 
@@ -8245,14 +8262,14 @@ var StreamChat = /*#__PURE__*/function () {
8245
8262
  }, {
8246
8263
  key: "partialUpdateMessage",
8247
8264
  value: function () {
8248
- var _partialUpdateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45(id, partialMessageObject, userId, options) {
8265
+ var _partialUpdateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44(id, partialMessageObject, userId, options) {
8249
8266
  var user;
8250
- return _regeneratorRuntime.wrap(function _callee45$(_context45) {
8267
+ return _regeneratorRuntime.wrap(function _callee44$(_context44) {
8251
8268
  while (1) {
8252
- switch (_context45.prev = _context45.next) {
8269
+ switch (_context44.prev = _context44.next) {
8253
8270
  case 0:
8254
8271
  if (id) {
8255
- _context45.next = 2;
8272
+ _context44.next = 2;
8256
8273
  break;
8257
8274
  }
8258
8275
 
@@ -8267,23 +8284,23 @@ var StreamChat = /*#__PURE__*/function () {
8267
8284
  };
8268
8285
  }
8269
8286
 
8270
- _context45.next = 6;
8287
+ _context44.next = 6;
8271
8288
  return this.put(this.baseURL + "/messages/".concat(id), _objectSpread(_objectSpread(_objectSpread({}, partialMessageObject), options), {}, {
8272
8289
  user: user
8273
8290
  }));
8274
8291
 
8275
8292
  case 6:
8276
- return _context45.abrupt("return", _context45.sent);
8293
+ return _context44.abrupt("return", _context44.sent);
8277
8294
 
8278
8295
  case 7:
8279
8296
  case "end":
8280
- return _context45.stop();
8297
+ return _context44.stop();
8281
8298
  }
8282
8299
  }
8283
- }, _callee45, this);
8300
+ }, _callee44, this);
8284
8301
  }));
8285
8302
 
8286
- function partialUpdateMessage(_x60, _x61, _x62, _x63) {
8303
+ function partialUpdateMessage(_x58, _x59, _x60, _x61) {
8287
8304
  return _partialUpdateMessage.apply(this, arguments);
8288
8305
  }
8289
8306
 
@@ -8292,11 +8309,11 @@ var StreamChat = /*#__PURE__*/function () {
8292
8309
  }, {
8293
8310
  key: "deleteMessage",
8294
8311
  value: function () {
8295
- var _deleteMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46(messageID, hardDelete) {
8312
+ var _deleteMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45(messageID, hardDelete) {
8296
8313
  var params;
8297
- return _regeneratorRuntime.wrap(function _callee46$(_context46) {
8314
+ return _regeneratorRuntime.wrap(function _callee45$(_context45) {
8298
8315
  while (1) {
8299
- switch (_context46.prev = _context46.next) {
8316
+ switch (_context45.prev = _context45.next) {
8300
8317
  case 0:
8301
8318
  params = {};
8302
8319
 
@@ -8306,21 +8323,21 @@ var StreamChat = /*#__PURE__*/function () {
8306
8323
  };
8307
8324
  }
8308
8325
 
8309
- _context46.next = 4;
8326
+ _context45.next = 4;
8310
8327
  return this.delete(this.baseURL + "/messages/".concat(messageID), params);
8311
8328
 
8312
8329
  case 4:
8313
- return _context46.abrupt("return", _context46.sent);
8330
+ return _context45.abrupt("return", _context45.sent);
8314
8331
 
8315
8332
  case 5:
8316
8333
  case "end":
8317
- return _context46.stop();
8334
+ return _context45.stop();
8318
8335
  }
8319
8336
  }
8320
- }, _callee46, this);
8337
+ }, _callee45, this);
8321
8338
  }));
8322
8339
 
8323
- function deleteMessage(_x64, _x65) {
8340
+ function deleteMessage(_x62, _x63) {
8324
8341
  return _deleteMessage.apply(this, arguments);
8325
8342
  }
8326
8343
 
@@ -8329,26 +8346,26 @@ var StreamChat = /*#__PURE__*/function () {
8329
8346
  }, {
8330
8347
  key: "getMessage",
8331
8348
  value: function () {
8332
- var _getMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee47(messageID) {
8333
- return _regeneratorRuntime.wrap(function _callee47$(_context47) {
8349
+ var _getMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46(messageID) {
8350
+ return _regeneratorRuntime.wrap(function _callee46$(_context46) {
8334
8351
  while (1) {
8335
- switch (_context47.prev = _context47.next) {
8352
+ switch (_context46.prev = _context46.next) {
8336
8353
  case 0:
8337
- _context47.next = 2;
8354
+ _context46.next = 2;
8338
8355
  return this.get(this.baseURL + "/messages/".concat(messageID));
8339
8356
 
8340
8357
  case 2:
8341
- return _context47.abrupt("return", _context47.sent);
8358
+ return _context46.abrupt("return", _context46.sent);
8342
8359
 
8343
8360
  case 3:
8344
8361
  case "end":
8345
- return _context47.stop();
8362
+ return _context46.stop();
8346
8363
  }
8347
8364
  }
8348
- }, _callee47, this);
8365
+ }, _callee46, this);
8349
8366
  }));
8350
8367
 
8351
- function getMessage(_x66) {
8368
+ function getMessage(_x64) {
8352
8369
  return _getMessage.apply(this, arguments);
8353
8370
  }
8354
8371
 
@@ -8357,7 +8374,7 @@ var StreamChat = /*#__PURE__*/function () {
8357
8374
  }, {
8358
8375
  key: "getUserAgent",
8359
8376
  value: function getUserAgent() {
8360
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "4.4.3-dev.0");
8377
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "4.4.3");
8361
8378
  }
8362
8379
  }, {
8363
8380
  key: "setUserAgent",
@@ -8371,7 +8388,7 @@ var StreamChat = /*#__PURE__*/function () {
8371
8388
  }, {
8372
8389
  key: "_enrichAxiosOptions",
8373
8390
  value: function _enrichAxiosOptions() {
8374
- var _this$wsConnection4;
8391
+ var _options$headers, _this$wsConnection4;
8375
8392
 
8376
8393
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
8377
8394
  params: {},
@@ -8381,6 +8398,12 @@ var StreamChat = /*#__PURE__*/function () {
8381
8398
 
8382
8399
  var token = this._getToken();
8383
8400
 
8401
+ if (!((_options$headers = options.headers) !== null && _options$headers !== void 0 && _options$headers['x-client-request-id'])) {
8402
+ options.headers = _objectSpread(_objectSpread({}, options.headers), {}, {
8403
+ 'x-client-request-id': randomId()
8404
+ });
8405
+ }
8406
+
8384
8407
  return _objectSpread({
8385
8408
  params: _objectSpread(_objectSpread({
8386
8409
  user_id: this.userID
@@ -8538,28 +8561,28 @@ var StreamChat = /*#__PURE__*/function () {
8538
8561
  }, {
8539
8562
  key: "sendUserCustomEvent",
8540
8563
  value: function () {
8541
- var _sendUserCustomEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee48(targetUserID, event) {
8542
- return _regeneratorRuntime.wrap(function _callee48$(_context48) {
8564
+ var _sendUserCustomEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee47(targetUserID, event) {
8565
+ return _regeneratorRuntime.wrap(function _callee47$(_context47) {
8543
8566
  while (1) {
8544
- switch (_context48.prev = _context48.next) {
8567
+ switch (_context47.prev = _context47.next) {
8545
8568
  case 0:
8546
- _context48.next = 2;
8569
+ _context47.next = 2;
8547
8570
  return this.post("".concat(this.baseURL, "/users/").concat(targetUserID, "/event"), {
8548
8571
  event: event
8549
8572
  });
8550
8573
 
8551
8574
  case 2:
8552
- return _context48.abrupt("return", _context48.sent);
8575
+ return _context47.abrupt("return", _context47.sent);
8553
8576
 
8554
8577
  case 3:
8555
8578
  case "end":
8556
- return _context48.stop();
8579
+ return _context47.stop();
8557
8580
  }
8558
8581
  }
8559
- }, _callee48, this);
8582
+ }, _callee47, this);
8560
8583
  }));
8561
8584
 
8562
- function sendUserCustomEvent(_x67, _x68) {
8585
+ function sendUserCustomEvent(_x65, _x66) {
8563
8586
  return _sendUserCustomEvent.apply(this, arguments);
8564
8587
  }
8565
8588
 
@@ -8622,32 +8645,32 @@ var StreamChat = /*#__PURE__*/function () {
8622
8645
  }, {
8623
8646
  key: "createSegment",
8624
8647
  value: function () {
8625
- var _createSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49(params) {
8648
+ var _createSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee48(params) {
8626
8649
  var _yield$this$post, segment;
8627
8650
 
8628
- return _regeneratorRuntime.wrap(function _callee49$(_context49) {
8651
+ return _regeneratorRuntime.wrap(function _callee48$(_context48) {
8629
8652
  while (1) {
8630
- switch (_context49.prev = _context49.next) {
8653
+ switch (_context48.prev = _context48.next) {
8631
8654
  case 0:
8632
- _context49.next = 2;
8655
+ _context48.next = 2;
8633
8656
  return this.post(this.baseURL + "/segments", {
8634
8657
  segment: params
8635
8658
  });
8636
8659
 
8637
8660
  case 2:
8638
- _yield$this$post = _context49.sent;
8661
+ _yield$this$post = _context48.sent;
8639
8662
  segment = _yield$this$post.segment;
8640
- return _context49.abrupt("return", segment);
8663
+ return _context48.abrupt("return", segment);
8641
8664
 
8642
8665
  case 5:
8643
8666
  case "end":
8644
- return _context49.stop();
8667
+ return _context48.stop();
8645
8668
  }
8646
8669
  }
8647
- }, _callee49, this);
8670
+ }, _callee48, this);
8648
8671
  }));
8649
8672
 
8650
- function createSegment(_x69) {
8673
+ function createSegment(_x67) {
8651
8674
  return _createSegment.apply(this, arguments);
8652
8675
  }
8653
8676
 
@@ -8664,30 +8687,30 @@ var StreamChat = /*#__PURE__*/function () {
8664
8687
  }, {
8665
8688
  key: "getSegment",
8666
8689
  value: function () {
8667
- var _getSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee50(id) {
8690
+ var _getSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49(id) {
8668
8691
  var _yield$this$get, segment;
8669
8692
 
8670
- return _regeneratorRuntime.wrap(function _callee50$(_context50) {
8693
+ return _regeneratorRuntime.wrap(function _callee49$(_context49) {
8671
8694
  while (1) {
8672
- switch (_context50.prev = _context50.next) {
8695
+ switch (_context49.prev = _context49.next) {
8673
8696
  case 0:
8674
- _context50.next = 2;
8697
+ _context49.next = 2;
8675
8698
  return this.get(this.baseURL + "/segments/".concat(id));
8676
8699
 
8677
8700
  case 2:
8678
- _yield$this$get = _context50.sent;
8701
+ _yield$this$get = _context49.sent;
8679
8702
  segment = _yield$this$get.segment;
8680
- return _context50.abrupt("return", segment);
8703
+ return _context49.abrupt("return", segment);
8681
8704
 
8682
8705
  case 5:
8683
8706
  case "end":
8684
- return _context50.stop();
8707
+ return _context49.stop();
8685
8708
  }
8686
8709
  }
8687
- }, _callee50, this);
8710
+ }, _callee49, this);
8688
8711
  }));
8689
8712
 
8690
- function getSegment(_x70) {
8713
+ function getSegment(_x68) {
8691
8714
  return _getSegment.apply(this, arguments);
8692
8715
  }
8693
8716
 
@@ -8703,30 +8726,30 @@ var StreamChat = /*#__PURE__*/function () {
8703
8726
  }, {
8704
8727
  key: "listSegments",
8705
8728
  value: function () {
8706
- var _listSegments = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee51(options) {
8729
+ var _listSegments = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee50(options) {
8707
8730
  var _yield$this$get2, segments;
8708
8731
 
8709
- return _regeneratorRuntime.wrap(function _callee51$(_context51) {
8732
+ return _regeneratorRuntime.wrap(function _callee50$(_context50) {
8710
8733
  while (1) {
8711
- switch (_context51.prev = _context51.next) {
8734
+ switch (_context50.prev = _context50.next) {
8712
8735
  case 0:
8713
- _context51.next = 2;
8736
+ _context50.next = 2;
8714
8737
  return this.get(this.baseURL + "/segments", options);
8715
8738
 
8716
8739
  case 2:
8717
- _yield$this$get2 = _context51.sent;
8740
+ _yield$this$get2 = _context50.sent;
8718
8741
  segments = _yield$this$get2.segments;
8719
- return _context51.abrupt("return", segments);
8742
+ return _context50.abrupt("return", segments);
8720
8743
 
8721
8744
  case 5:
8722
8745
  case "end":
8723
- return _context51.stop();
8746
+ return _context50.stop();
8724
8747
  }
8725
8748
  }
8726
- }, _callee51, this);
8749
+ }, _callee50, this);
8727
8750
  }));
8728
8751
 
8729
- function listSegments(_x71) {
8752
+ function listSegments(_x69) {
8730
8753
  return _listSegments.apply(this, arguments);
8731
8754
  }
8732
8755
 
@@ -8744,32 +8767,32 @@ var StreamChat = /*#__PURE__*/function () {
8744
8767
  }, {
8745
8768
  key: "updateSegment",
8746
8769
  value: function () {
8747
- var _updateSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee52(id, params) {
8770
+ var _updateSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee51(id, params) {
8748
8771
  var _yield$this$put, segment;
8749
8772
 
8750
- return _regeneratorRuntime.wrap(function _callee52$(_context52) {
8773
+ return _regeneratorRuntime.wrap(function _callee51$(_context51) {
8751
8774
  while (1) {
8752
- switch (_context52.prev = _context52.next) {
8775
+ switch (_context51.prev = _context51.next) {
8753
8776
  case 0:
8754
- _context52.next = 2;
8777
+ _context51.next = 2;
8755
8778
  return this.put(this.baseURL + "/segments/".concat(id), {
8756
8779
  segment: params
8757
8780
  });
8758
8781
 
8759
8782
  case 2:
8760
- _yield$this$put = _context52.sent;
8783
+ _yield$this$put = _context51.sent;
8761
8784
  segment = _yield$this$put.segment;
8762
- return _context52.abrupt("return", segment);
8785
+ return _context51.abrupt("return", segment);
8763
8786
 
8764
8787
  case 5:
8765
8788
  case "end":
8766
- return _context52.stop();
8789
+ return _context51.stop();
8767
8790
  }
8768
8791
  }
8769
- }, _callee52, this);
8792
+ }, _callee51, this);
8770
8793
  }));
8771
8794
 
8772
- function updateSegment(_x72, _x73) {
8795
+ function updateSegment(_x70, _x71) {
8773
8796
  return _updateSegment.apply(this, arguments);
8774
8797
  }
8775
8798
 
@@ -8786,22 +8809,22 @@ var StreamChat = /*#__PURE__*/function () {
8786
8809
  }, {
8787
8810
  key: "deleteSegment",
8788
8811
  value: function () {
8789
- var _deleteSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee53(id) {
8790
- return _regeneratorRuntime.wrap(function _callee53$(_context53) {
8812
+ var _deleteSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee52(id) {
8813
+ return _regeneratorRuntime.wrap(function _callee52$(_context52) {
8791
8814
  while (1) {
8792
- switch (_context53.prev = _context53.next) {
8815
+ switch (_context52.prev = _context52.next) {
8793
8816
  case 0:
8794
- return _context53.abrupt("return", this.delete(this.baseURL + "/segments/".concat(id)));
8817
+ return _context52.abrupt("return", this.delete(this.baseURL + "/segments/".concat(id)));
8795
8818
 
8796
8819
  case 1:
8797
8820
  case "end":
8798
- return _context53.stop();
8821
+ return _context52.stop();
8799
8822
  }
8800
8823
  }
8801
- }, _callee53, this);
8824
+ }, _callee52, this);
8802
8825
  }));
8803
8826
 
8804
- function deleteSegment(_x74) {
8827
+ function deleteSegment(_x72) {
8805
8828
  return _deleteSegment.apply(this, arguments);
8806
8829
  }
8807
8830
 
@@ -8818,32 +8841,32 @@ var StreamChat = /*#__PURE__*/function () {
8818
8841
  }, {
8819
8842
  key: "createCampaign",
8820
8843
  value: function () {
8821
- var _createCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee54(params) {
8844
+ var _createCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee53(params) {
8822
8845
  var _yield$this$post2, campaign;
8823
8846
 
8824
- return _regeneratorRuntime.wrap(function _callee54$(_context54) {
8847
+ return _regeneratorRuntime.wrap(function _callee53$(_context53) {
8825
8848
  while (1) {
8826
- switch (_context54.prev = _context54.next) {
8849
+ switch (_context53.prev = _context53.next) {
8827
8850
  case 0:
8828
- _context54.next = 2;
8851
+ _context53.next = 2;
8829
8852
  return this.post(this.baseURL + "/campaigns", {
8830
8853
  campaign: params
8831
8854
  });
8832
8855
 
8833
8856
  case 2:
8834
- _yield$this$post2 = _context54.sent;
8857
+ _yield$this$post2 = _context53.sent;
8835
8858
  campaign = _yield$this$post2.campaign;
8836
- return _context54.abrupt("return", campaign);
8859
+ return _context53.abrupt("return", campaign);
8837
8860
 
8838
8861
  case 5:
8839
8862
  case "end":
8840
- return _context54.stop();
8863
+ return _context53.stop();
8841
8864
  }
8842
8865
  }
8843
- }, _callee54, this);
8866
+ }, _callee53, this);
8844
8867
  }));
8845
8868
 
8846
- function createCampaign(_x75) {
8869
+ function createCampaign(_x73) {
8847
8870
  return _createCampaign.apply(this, arguments);
8848
8871
  }
8849
8872
 
@@ -8860,30 +8883,30 @@ var StreamChat = /*#__PURE__*/function () {
8860
8883
  }, {
8861
8884
  key: "getCampaign",
8862
8885
  value: function () {
8863
- var _getCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee55(id) {
8886
+ var _getCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee54(id) {
8864
8887
  var _yield$this$get3, campaign;
8865
8888
 
8866
- return _regeneratorRuntime.wrap(function _callee55$(_context55) {
8889
+ return _regeneratorRuntime.wrap(function _callee54$(_context54) {
8867
8890
  while (1) {
8868
- switch (_context55.prev = _context55.next) {
8891
+ switch (_context54.prev = _context54.next) {
8869
8892
  case 0:
8870
- _context55.next = 2;
8893
+ _context54.next = 2;
8871
8894
  return this.get(this.baseURL + "/campaigns/".concat(id));
8872
8895
 
8873
8896
  case 2:
8874
- _yield$this$get3 = _context55.sent;
8897
+ _yield$this$get3 = _context54.sent;
8875
8898
  campaign = _yield$this$get3.campaign;
8876
- return _context55.abrupt("return", campaign);
8899
+ return _context54.abrupt("return", campaign);
8877
8900
 
8878
8901
  case 5:
8879
8902
  case "end":
8880
- return _context55.stop();
8903
+ return _context54.stop();
8881
8904
  }
8882
8905
  }
8883
- }, _callee55, this);
8906
+ }, _callee54, this);
8884
8907
  }));
8885
8908
 
8886
- function getCampaign(_x76) {
8909
+ function getCampaign(_x74) {
8887
8910
  return _getCampaign.apply(this, arguments);
8888
8911
  }
8889
8912
 
@@ -8899,30 +8922,30 @@ var StreamChat = /*#__PURE__*/function () {
8899
8922
  }, {
8900
8923
  key: "listCampaigns",
8901
8924
  value: function () {
8902
- var _listCampaigns = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee56(options) {
8925
+ var _listCampaigns = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee55(options) {
8903
8926
  var _yield$this$get4, campaigns;
8904
8927
 
8905
- return _regeneratorRuntime.wrap(function _callee56$(_context56) {
8928
+ return _regeneratorRuntime.wrap(function _callee55$(_context55) {
8906
8929
  while (1) {
8907
- switch (_context56.prev = _context56.next) {
8930
+ switch (_context55.prev = _context55.next) {
8908
8931
  case 0:
8909
- _context56.next = 2;
8932
+ _context55.next = 2;
8910
8933
  return this.get(this.baseURL + "/campaigns", options);
8911
8934
 
8912
8935
  case 2:
8913
- _yield$this$get4 = _context56.sent;
8936
+ _yield$this$get4 = _context55.sent;
8914
8937
  campaigns = _yield$this$get4.campaigns;
8915
- return _context56.abrupt("return", campaigns);
8938
+ return _context55.abrupt("return", campaigns);
8916
8939
 
8917
8940
  case 5:
8918
8941
  case "end":
8919
- return _context56.stop();
8942
+ return _context55.stop();
8920
8943
  }
8921
8944
  }
8922
- }, _callee56, this);
8945
+ }, _callee55, this);
8923
8946
  }));
8924
8947
 
8925
- function listCampaigns(_x77) {
8948
+ function listCampaigns(_x75) {
8926
8949
  return _listCampaigns.apply(this, arguments);
8927
8950
  }
8928
8951
 
@@ -8940,32 +8963,32 @@ var StreamChat = /*#__PURE__*/function () {
8940
8963
  }, {
8941
8964
  key: "updateCampaign",
8942
8965
  value: function () {
8943
- var _updateCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee57(id, params) {
8966
+ var _updateCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee56(id, params) {
8944
8967
  var _yield$this$put2, campaign;
8945
8968
 
8946
- return _regeneratorRuntime.wrap(function _callee57$(_context57) {
8969
+ return _regeneratorRuntime.wrap(function _callee56$(_context56) {
8947
8970
  while (1) {
8948
- switch (_context57.prev = _context57.next) {
8971
+ switch (_context56.prev = _context56.next) {
8949
8972
  case 0:
8950
- _context57.next = 2;
8973
+ _context56.next = 2;
8951
8974
  return this.put(this.baseURL + "/campaigns/".concat(id), {
8952
8975
  campaign: params
8953
8976
  });
8954
8977
 
8955
8978
  case 2:
8956
- _yield$this$put2 = _context57.sent;
8979
+ _yield$this$put2 = _context56.sent;
8957
8980
  campaign = _yield$this$put2.campaign;
8958
- return _context57.abrupt("return", campaign);
8981
+ return _context56.abrupt("return", campaign);
8959
8982
 
8960
8983
  case 5:
8961
8984
  case "end":
8962
- return _context57.stop();
8985
+ return _context56.stop();
8963
8986
  }
8964
8987
  }
8965
- }, _callee57, this);
8988
+ }, _callee56, this);
8966
8989
  }));
8967
8990
 
8968
- function updateCampaign(_x78, _x79) {
8991
+ function updateCampaign(_x76, _x77) {
8969
8992
  return _updateCampaign.apply(this, arguments);
8970
8993
  }
8971
8994
 
@@ -8982,22 +9005,22 @@ var StreamChat = /*#__PURE__*/function () {
8982
9005
  }, {
8983
9006
  key: "deleteCampaign",
8984
9007
  value: function () {
8985
- var _deleteCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee58(id) {
8986
- return _regeneratorRuntime.wrap(function _callee58$(_context58) {
9008
+ var _deleteCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee57(id) {
9009
+ return _regeneratorRuntime.wrap(function _callee57$(_context57) {
8987
9010
  while (1) {
8988
- switch (_context58.prev = _context58.next) {
9011
+ switch (_context57.prev = _context57.next) {
8989
9012
  case 0:
8990
- return _context58.abrupt("return", this.delete(this.baseURL + "/campaigns/".concat(id)));
9013
+ return _context57.abrupt("return", this.delete(this.baseURL + "/campaigns/".concat(id)));
8991
9014
 
8992
9015
  case 1:
8993
9016
  case "end":
8994
- return _context58.stop();
9017
+ return _context57.stop();
8995
9018
  }
8996
9019
  }
8997
- }, _callee58, this);
9020
+ }, _callee57, this);
8998
9021
  }));
8999
9022
 
9000
- function deleteCampaign(_x80) {
9023
+ function deleteCampaign(_x78) {
9001
9024
  return _deleteCampaign.apply(this, arguments);
9002
9025
  }
9003
9026
 
@@ -9015,33 +9038,33 @@ var StreamChat = /*#__PURE__*/function () {
9015
9038
  }, {
9016
9039
  key: "scheduleCampaign",
9017
9040
  value: function () {
9018
- var _scheduleCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee59(id, params) {
9041
+ var _scheduleCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee58(id, params) {
9019
9042
  var sendAt, _yield$this$patch, campaign;
9020
9043
 
9021
- return _regeneratorRuntime.wrap(function _callee59$(_context59) {
9044
+ return _regeneratorRuntime.wrap(function _callee58$(_context58) {
9022
9045
  while (1) {
9023
- switch (_context59.prev = _context59.next) {
9046
+ switch (_context58.prev = _context58.next) {
9024
9047
  case 0:
9025
9048
  sendAt = params.sendAt;
9026
- _context59.next = 3;
9049
+ _context58.next = 3;
9027
9050
  return this.patch(this.baseURL + "/campaigns/".concat(id, "/schedule"), {
9028
9051
  send_at: sendAt
9029
9052
  });
9030
9053
 
9031
9054
  case 3:
9032
- _yield$this$patch = _context59.sent;
9055
+ _yield$this$patch = _context58.sent;
9033
9056
  campaign = _yield$this$patch.campaign;
9034
- return _context59.abrupt("return", campaign);
9057
+ return _context58.abrupt("return", campaign);
9035
9058
 
9036
9059
  case 6:
9037
9060
  case "end":
9038
- return _context59.stop();
9061
+ return _context58.stop();
9039
9062
  }
9040
9063
  }
9041
- }, _callee59, this);
9064
+ }, _callee58, this);
9042
9065
  }));
9043
9066
 
9044
- function scheduleCampaign(_x81, _x82) {
9067
+ function scheduleCampaign(_x79, _x80) {
9045
9068
  return _scheduleCampaign.apply(this, arguments);
9046
9069
  }
9047
9070
 
@@ -9058,30 +9081,30 @@ var StreamChat = /*#__PURE__*/function () {
9058
9081
  }, {
9059
9082
  key: "stopCampaign",
9060
9083
  value: function () {
9061
- var _stopCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee60(id) {
9084
+ var _stopCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee59(id) {
9062
9085
  var _yield$this$patch2, campaign;
9063
9086
 
9064
- return _regeneratorRuntime.wrap(function _callee60$(_context60) {
9087
+ return _regeneratorRuntime.wrap(function _callee59$(_context59) {
9065
9088
  while (1) {
9066
- switch (_context60.prev = _context60.next) {
9089
+ switch (_context59.prev = _context59.next) {
9067
9090
  case 0:
9068
- _context60.next = 2;
9091
+ _context59.next = 2;
9069
9092
  return this.patch(this.baseURL + "/campaigns/".concat(id, "/stop"));
9070
9093
 
9071
9094
  case 2:
9072
- _yield$this$patch2 = _context60.sent;
9095
+ _yield$this$patch2 = _context59.sent;
9073
9096
  campaign = _yield$this$patch2.campaign;
9074
- return _context60.abrupt("return", campaign);
9097
+ return _context59.abrupt("return", campaign);
9075
9098
 
9076
9099
  case 5:
9077
9100
  case "end":
9078
- return _context60.stop();
9101
+ return _context59.stop();
9079
9102
  }
9080
9103
  }
9081
- }, _callee60, this);
9104
+ }, _callee59, this);
9082
9105
  }));
9083
9106
 
9084
- function stopCampaign(_x83) {
9107
+ function stopCampaign(_x81) {
9085
9108
  return _stopCampaign.apply(this, arguments);
9086
9109
  }
9087
9110
 
@@ -9098,30 +9121,30 @@ var StreamChat = /*#__PURE__*/function () {
9098
9121
  }, {
9099
9122
  key: "resumeCampaign",
9100
9123
  value: function () {
9101
- var _resumeCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee61(id) {
9124
+ var _resumeCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee60(id) {
9102
9125
  var _yield$this$patch3, campaign;
9103
9126
 
9104
- return _regeneratorRuntime.wrap(function _callee61$(_context61) {
9127
+ return _regeneratorRuntime.wrap(function _callee60$(_context60) {
9105
9128
  while (1) {
9106
- switch (_context61.prev = _context61.next) {
9129
+ switch (_context60.prev = _context60.next) {
9107
9130
  case 0:
9108
- _context61.next = 2;
9131
+ _context60.next = 2;
9109
9132
  return this.patch(this.baseURL + "/campaigns/".concat(id, "/resume"));
9110
9133
 
9111
9134
  case 2:
9112
- _yield$this$patch3 = _context61.sent;
9135
+ _yield$this$patch3 = _context60.sent;
9113
9136
  campaign = _yield$this$patch3.campaign;
9114
- return _context61.abrupt("return", campaign);
9137
+ return _context60.abrupt("return", campaign);
9115
9138
 
9116
9139
  case 5:
9117
9140
  case "end":
9118
- return _context61.stop();
9141
+ return _context60.stop();
9119
9142
  }
9120
9143
  }
9121
- }, _callee61, this);
9144
+ }, _callee60, this);
9122
9145
  }));
9123
9146
 
9124
- function resumeCampaign(_x84) {
9147
+ function resumeCampaign(_x82) {
9125
9148
  return _resumeCampaign.apply(this, arguments);
9126
9149
  }
9127
9150
 
@@ -9138,33 +9161,33 @@ var StreamChat = /*#__PURE__*/function () {
9138
9161
  }, {
9139
9162
  key: "testCampaign",
9140
9163
  value: function () {
9141
- var _testCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee62(id, params) {
9164
+ var _testCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee61(id, params) {
9142
9165
  var users, _yield$this$post3, campaign;
9143
9166
 
9144
- return _regeneratorRuntime.wrap(function _callee62$(_context62) {
9167
+ return _regeneratorRuntime.wrap(function _callee61$(_context61) {
9145
9168
  while (1) {
9146
- switch (_context62.prev = _context62.next) {
9169
+ switch (_context61.prev = _context61.next) {
9147
9170
  case 0:
9148
9171
  users = params.users;
9149
- _context62.next = 3;
9172
+ _context61.next = 3;
9150
9173
  return this.post(this.baseURL + "/campaigns/".concat(id, "/test"), {
9151
9174
  users: users
9152
9175
  });
9153
9176
 
9154
9177
  case 3:
9155
- _yield$this$post3 = _context62.sent;
9178
+ _yield$this$post3 = _context61.sent;
9156
9179
  campaign = _yield$this$post3.campaign;
9157
- return _context62.abrupt("return", campaign);
9180
+ return _context61.abrupt("return", campaign);
9158
9181
 
9159
9182
  case 6:
9160
9183
  case "end":
9161
- return _context62.stop();
9184
+ return _context61.stop();
9162
9185
  }
9163
9186
  }
9164
- }, _callee62, this);
9187
+ }, _callee61, this);
9165
9188
  }));
9166
9189
 
9167
- function testCampaign(_x85, _x86) {
9190
+ function testCampaign(_x83, _x84) {
9168
9191
  return _testCampaign.apply(this, arguments);
9169
9192
  }
9170
9193
 
@@ -9180,24 +9203,24 @@ var StreamChat = /*#__PURE__*/function () {
9180
9203
  }, {
9181
9204
  key: "enrichURL",
9182
9205
  value: function () {
9183
- var _enrichURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee63(url) {
9184
- return _regeneratorRuntime.wrap(function _callee63$(_context63) {
9206
+ var _enrichURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee62(url) {
9207
+ return _regeneratorRuntime.wrap(function _callee62$(_context62) {
9185
9208
  while (1) {
9186
- switch (_context63.prev = _context63.next) {
9209
+ switch (_context62.prev = _context62.next) {
9187
9210
  case 0:
9188
- return _context63.abrupt("return", this.get(this.baseURL + "/og", {
9211
+ return _context62.abrupt("return", this.get(this.baseURL + "/og", {
9189
9212
  url: url
9190
9213
  }));
9191
9214
 
9192
9215
  case 1:
9193
9216
  case "end":
9194
- return _context63.stop();
9217
+ return _context62.stop();
9195
9218
  }
9196
9219
  }
9197
- }, _callee63, this);
9220
+ }, _callee62, this);
9198
9221
  }));
9199
9222
 
9200
- function enrichURL(_x87) {
9223
+ function enrichURL(_x85) {
9201
9224
  return _enrichURL.apply(this, arguments);
9202
9225
  }
9203
9226
 
@@ -9214,22 +9237,22 @@ var StreamChat = /*#__PURE__*/function () {
9214
9237
  }, {
9215
9238
  key: "getTask",
9216
9239
  value: function () {
9217
- var _getTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee64(id) {
9218
- return _regeneratorRuntime.wrap(function _callee64$(_context64) {
9240
+ var _getTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee63(id) {
9241
+ return _regeneratorRuntime.wrap(function _callee63$(_context63) {
9219
9242
  while (1) {
9220
- switch (_context64.prev = _context64.next) {
9243
+ switch (_context63.prev = _context63.next) {
9221
9244
  case 0:
9222
- return _context64.abrupt("return", this.get("".concat(this.baseURL, "/tasks/").concat(id)));
9245
+ return _context63.abrupt("return", this.get("".concat(this.baseURL, "/tasks/").concat(id)));
9223
9246
 
9224
9247
  case 1:
9225
9248
  case "end":
9226
- return _context64.stop();
9249
+ return _context63.stop();
9227
9250
  }
9228
9251
  }
9229
- }, _callee64, this);
9252
+ }, _callee63, this);
9230
9253
  }));
9231
9254
 
9232
- function getTask(_x88) {
9255
+ function getTask(_x86) {
9233
9256
  return _getTask.apply(this, arguments);
9234
9257
  }
9235
9258
 
@@ -9247,39 +9270,36 @@ var StreamChat = /*#__PURE__*/function () {
9247
9270
  }, {
9248
9271
  key: "deleteChannels",
9249
9272
  value: function () {
9250
- var _deleteChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee65(cids) {
9273
+ var _deleteChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee64(cids) {
9251
9274
  var options,
9252
- _args65 = arguments;
9253
- return _regeneratorRuntime.wrap(function _callee65$(_context65) {
9275
+ _args64 = arguments;
9276
+ return _regeneratorRuntime.wrap(function _callee64$(_context64) {
9254
9277
  while (1) {
9255
- switch (_context65.prev = _context65.next) {
9278
+ switch (_context64.prev = _context64.next) {
9256
9279
  case 0:
9257
- options = _args65.length > 1 && _args65[1] !== undefined ? _args65[1] : {};
9258
- _context65.next = 3;
9280
+ options = _args64.length > 1 && _args64[1] !== undefined ? _args64[1] : {};
9281
+ _context64.next = 3;
9259
9282
  return this.post(this.baseURL + "/channels/delete", _objectSpread({
9260
9283
  cids: cids
9261
9284
  }, options));
9262
9285
 
9263
9286
  case 3:
9264
- return _context65.abrupt("return", _context65.sent);
9287
+ return _context64.abrupt("return", _context64.sent);
9265
9288
 
9266
9289
  case 4:
9267
9290
  case "end":
9268
- return _context65.stop();
9291
+ return _context64.stop();
9269
9292
  }
9270
9293
  }
9271
- }, _callee65, this);
9294
+ }, _callee64, this);
9272
9295
  }));
9273
9296
 
9274
- function deleteChannels(_x89) {
9297
+ function deleteChannels(_x87) {
9275
9298
  return _deleteChannels.apply(this, arguments);
9276
9299
  }
9277
9300
 
9278
9301
  return deleteChannels;
9279
9302
  }()
9280
- }, {
9281
- key: "deleteUsers",
9282
- value:
9283
9303
  /**
9284
9304
  * deleteUsers - Batch Delete Users
9285
9305
  *
@@ -9288,14 +9308,17 @@ var StreamChat = /*#__PURE__*/function () {
9288
9308
  *
9289
9309
  * @return {APIResponse} A task ID
9290
9310
  */
9291
- function () {
9292
- var _deleteUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee66(user_ids, options) {
9293
- return _regeneratorRuntime.wrap(function _callee66$(_context66) {
9311
+
9312
+ }, {
9313
+ key: "deleteUsers",
9314
+ value: function () {
9315
+ var _deleteUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee65(user_ids, options) {
9316
+ return _regeneratorRuntime.wrap(function _callee65$(_context65) {
9294
9317
  while (1) {
9295
- switch (_context66.prev = _context66.next) {
9318
+ switch (_context65.prev = _context65.next) {
9296
9319
  case 0:
9297
9320
  if (!((options === null || options === void 0 ? void 0 : options.user) !== 'soft' && (options === null || options === void 0 ? void 0 : options.user) !== 'hard')) {
9298
- _context66.next = 2;
9321
+ _context65.next = 2;
9299
9322
  break;
9300
9323
  }
9301
9324
 
@@ -9303,7 +9326,7 @@ var StreamChat = /*#__PURE__*/function () {
9303
9326
 
9304
9327
  case 2:
9305
9328
  if (!(options.messages !== undefined && options.messages !== 'soft' && options.messages !== 'hard')) {
9306
- _context66.next = 4;
9329
+ _context65.next = 4;
9307
9330
  break;
9308
9331
  }
9309
9332
 
@@ -9311,30 +9334,30 @@ var StreamChat = /*#__PURE__*/function () {
9311
9334
 
9312
9335
  case 4:
9313
9336
  if (!(options.conversations !== undefined && options.conversations !== 'soft' && options.conversations !== 'hard')) {
9314
- _context66.next = 6;
9337
+ _context65.next = 6;
9315
9338
  break;
9316
9339
  }
9317
9340
 
9318
9341
  throw new Error('Invalid delete user options. conversations must be one of [soft hard]');
9319
9342
 
9320
9343
  case 6:
9321
- _context66.next = 8;
9344
+ _context65.next = 8;
9322
9345
  return this.post(this.baseURL + "/users/delete", _objectSpread({
9323
9346
  user_ids: user_ids
9324
9347
  }, options));
9325
9348
 
9326
9349
  case 8:
9327
- return _context66.abrupt("return", _context66.sent);
9350
+ return _context65.abrupt("return", _context65.sent);
9328
9351
 
9329
9352
  case 9:
9330
9353
  case "end":
9331
- return _context66.stop();
9354
+ return _context65.stop();
9332
9355
  }
9333
9356
  }
9334
- }, _callee66, this);
9357
+ }, _callee65, this);
9335
9358
  }));
9336
9359
 
9337
- function deleteUsers(_x90, _x91) {
9360
+ function deleteUsers(_x88, _x89) {
9338
9361
  return _deleteUsers.apply(this, arguments);
9339
9362
  }
9340
9363
 
@@ -9434,5 +9457,5 @@ var BuiltinPermissions = {
9434
9457
  UseFrozenChannel: 'Send messages and reactions to frozen channels'
9435
9458
  };
9436
9459
 
9437
- export { Allow, AllowAll, AnyResource, AnyRole, BuiltinPermissions, BuiltinRoles, Channel, ChannelState, CheckSignature, ClientState, Deny, DenyAll, DevToken, EVENT_MAP, InsightMetrics, JWTServerToken, JWTUserToken, MaxPriority, MinPriority, Permission, StableWSConnection, StreamChat, TokenManager, UserFromToken, buildWsFatalInsight, buildWsSuccessAfterFailureInsight, chatCodes, decodeBase64, encodeBase64, isOwnUser, isValidEventType, logChatPromiseExecution };
9460
+ export { Allow, AllowAll, AnyResource, AnyRole, BuiltinPermissions, BuiltinRoles, Channel, ChannelState, CheckSignature, ClientState, Deny, DenyAll, DevToken, EVENT_MAP, InsightMetrics, JWTServerToken, JWTUserToken, MaxPriority, MinPriority, Permission, StableWSConnection, StreamChat, TokenManager, UserFromToken, buildWsFatalInsight, buildWsSuccessAfterFailureInsight, chatCodes, decodeBase64, encodeBase64, isOwnUser, isValidEventType, logChatPromiseExecution, postInsights };
9438
9461
  //# sourceMappingURL=browser.es.js.map