stream-chat 4.4.3-dev.3 → 4.4.3

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