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