stream-chat 5.1.0 → 5.3.0

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.
@@ -311,6 +311,12 @@ var ChannelState = /*#__PURE__*/function () {
311
311
  for (var i = 0; i < newMessages.length; i += 1) {
312
312
  var _this$_channel;
313
313
 
314
+ var isFromShadowBannedUser = newMessages[i].shadowed;
315
+
316
+ if (isFromShadowBannedUser) {
317
+ continue;
318
+ }
319
+
314
320
  var message = this.formatMessage(newMessages[i]);
315
321
 
316
322
  if (message.user && (_this$_channel = this._channel) !== null && _this$_channel !== void 0 && _this$_channel.cid) {
@@ -708,6 +714,7 @@ var EVENT_MAP = {
708
714
  'channel.created': true,
709
715
  'channel.deleted': true,
710
716
  'channel.hidden': true,
717
+ 'channel.kicked': true,
711
718
  'channel.muted': true,
712
719
  'channel.truncated': true,
713
720
  'channel.unmuted': true,
@@ -803,6 +810,10 @@ function isFileWebAPI(uri) {
803
810
  return typeof window !== 'undefined' && 'File' in window && uri instanceof File;
804
811
  }
805
812
 
813
+ function isBlobWebAPI(uri) {
814
+ return typeof window !== 'undefined' && 'Blob' in window && uri instanceof Blob;
815
+ }
816
+
806
817
  function isOwnUser(user) {
807
818
  return (user === null || user === void 0 ? void 0 : user.total_unread_count) !== undefined;
808
819
  }
@@ -822,7 +833,7 @@ function isOwnUserBaseProperty(property) {
822
833
  function addFileToFormData(uri, name, contentType) {
823
834
  var data = new FormData();
824
835
 
825
- if (isReadableStream(uri) || isBuffer(uri) || isFileWebAPI(uri)) {
836
+ if (isReadableStream(uri) || isBuffer(uri) || isFileWebAPI(uri) || isBlobWebAPI(uri)) {
826
837
  if (name) data.append('file', uri, name);else data.append('file', uri);
827
838
  } else {
828
839
  data.append('file', {
@@ -3182,7 +3193,8 @@ var Channel = /*#__PURE__*/function () {
3182
3193
  channelState.read[event.user.id] = {
3183
3194
  // because in client.ts the handleEvent call that flows to this sets this `event.received_at = new Date();`
3184
3195
  last_read: event.received_at,
3185
- user: event.user
3196
+ user: event.user,
3197
+ unread_messages: 0
3186
3198
  };
3187
3199
 
3188
3200
  if (((_event$user4 = event.user) === null || _event$user4 === void 0 ? void 0 : _event$user4.id) === ((_this$getClient$user = this.getClient().user) === null || _this$getClient$user === void 0 ? void 0 : _this$getClient$user.id)) {
@@ -3239,7 +3251,8 @@ var Channel = /*#__PURE__*/function () {
3239
3251
  channelState.unreadCount = 0;
3240
3252
  channelState.read[event.user.id] = {
3241
3253
  last_read: new Date(event.created_at),
3242
- user: event.user
3254
+ user: event.user,
3255
+ unread_messages: 0
3243
3256
  };
3244
3257
  } else if (this._countMessageAsUnread(event.message)) {
3245
3258
  channelState.unreadCount = channelState.unreadCount + 1;
@@ -3263,7 +3276,16 @@ var Channel = /*#__PURE__*/function () {
3263
3276
 
3264
3277
  case 'channel.truncated':
3265
3278
  channelState.clearMessages();
3266
- channelState.unreadCount = 0;
3279
+ channelState.unreadCount = 0; // system messages don't increment unread counts
3280
+
3281
+ if (event.message) {
3282
+ channelState.addMessageSorted(event.message);
3283
+
3284
+ if (event.message.pinned) {
3285
+ channelState.addPinnedMessage(event.message);
3286
+ }
3287
+ }
3288
+
3267
3289
  break;
3268
3290
 
3269
3291
  case 'member.added':
@@ -3283,7 +3305,12 @@ var Channel = /*#__PURE__*/function () {
3283
3305
 
3284
3306
  case 'channel.updated':
3285
3307
  if (event.channel) {
3286
- channel.data = event.channel;
3308
+ var _event$channel$hidden, _event$channel, _channel$data, _event$channel$own_ca, _event$channel2, _channel$data2;
3309
+
3310
+ channel.data = _objectSpread$5(_objectSpread$5({}, event.channel), {}, {
3311
+ hidden: (_event$channel$hidden = (_event$channel = event.channel) === null || _event$channel === void 0 ? void 0 : _event$channel.hidden) !== null && _event$channel$hidden !== void 0 ? _event$channel$hidden : (_channel$data = channel.data) === null || _channel$data === void 0 ? void 0 : _channel$data.hidden,
3312
+ own_capabilities: (_event$channel$own_ca = (_event$channel2 = event.channel) === null || _event$channel2 === void 0 ? void 0 : _event$channel2.own_capabilities) !== null && _event$channel$own_ca !== void 0 ? _event$channel$own_ca : (_channel$data2 = channel.data) === null || _channel$data2 === void 0 ? void 0 : _channel$data2.own_capabilities
3313
+ });
3287
3314
  }
3288
3315
 
3289
3316
  break;
@@ -3404,7 +3431,8 @@ var Channel = /*#__PURE__*/function () {
3404
3431
  if (user) {
3405
3432
  this.state.read[user.id] = {
3406
3433
  user: user,
3407
- last_read: last_read
3434
+ last_read: last_read,
3435
+ unread_messages: 0
3408
3436
  };
3409
3437
  }
3410
3438
  } // apply read state if part of the state
@@ -3416,16 +3444,17 @@ var Channel = /*#__PURE__*/function () {
3416
3444
 
3417
3445
  try {
3418
3446
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
3419
- var read = _step3.value;
3420
-
3421
- var parsedRead = _objectSpread$5(_objectSpread$5({}, read), {}, {
3422
- last_read: new Date(read.last_read)
3423
- });
3447
+ var _read$unread_messages;
3424
3448
 
3425
- this.state.read[read.user.id] = parsedRead;
3449
+ var read = _step3.value;
3450
+ this.state.read[read.user.id] = {
3451
+ last_read: new Date(read.last_read),
3452
+ unread_messages: (_read$unread_messages = read.unread_messages) !== null && _read$unread_messages !== void 0 ? _read$unread_messages : 0,
3453
+ user: read.user
3454
+ };
3426
3455
 
3427
- if (read.user.id === (user === null || user === void 0 ? void 0 : user.id) && typeof parsedRead.unread_messages === 'number') {
3428
- this.state.unreadCount = parsedRead.unread_messages;
3456
+ if (read.user.id === (user === null || user === void 0 ? void 0 : user.id)) {
3457
+ this.state.unreadCount = this.state.read[read.user.id].unread_messages;
3429
3458
  }
3430
3459
  }
3431
3460
  } catch (err) {
@@ -6541,7 +6570,6 @@ var StreamChat = /*#__PURE__*/function () {
6541
6570
  apnTemplate: '{}', //if app doesn't have apn configured it will error
6542
6571
  firebaseTemplate: '{}', //if app doesn't have firebase configured it will error
6543
6572
  firebaseDataTemplate: '{}', //if app doesn't have firebase configured it will error
6544
- huaweiDataTemplate: '{}' //if app doesn't have huawei configured it will error
6545
6573
  skipDevices: true, // skip config/device checks and sending to real devices
6546
6574
  }
6547
6575
  */
@@ -6558,7 +6586,7 @@ var StreamChat = /*#__PURE__*/function () {
6558
6586
  case 0:
6559
6587
  data = _args12.length > 1 && _args12[1] !== undefined ? _args12[1] : {};
6560
6588
  _context12.next = 3;
6561
- return this.post(this.baseURL + '/check_push', _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
6589
+ return this.post(this.baseURL + '/check_push', _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
6562
6590
  user_id: userID
6563
6591
  }, data.messageID ? {
6564
6592
  message_id: data.messageID
@@ -6568,8 +6596,6 @@ var StreamChat = /*#__PURE__*/function () {
6568
6596
  firebase_template: data.firebaseTemplate
6569
6597
  } : {}), data.firebaseDataTemplate ? {
6570
6598
  firebase_data_template: data.firebaseDataTemplate
6571
- } : {}), data.huaweiDataTemplate ? {
6572
- huawei_data_template: data.huaweiDataTemplate
6573
6599
  } : {}), data.skipDevices ? {
6574
6600
  skip_devices: true
6575
6601
  } : {}));
@@ -8514,6 +8540,7 @@ var StreamChat = /*#__PURE__*/function () {
8514
8540
  * It is present for internal usage only.
8515
8541
  * This function can, and will, break and/or be removed at any point in time.
8516
8542
  *
8543
+ * @private
8517
8544
  * @param {FlagReportsFilters} filterConditions MongoDB style filter conditions
8518
8545
  * @param {FlagReportsPaginationOptions} options Option object, {limit: 10, offset:0}
8519
8546
  *
@@ -8562,6 +8589,7 @@ var StreamChat = /*#__PURE__*/function () {
8562
8589
  * It is present for internal usage only.
8563
8590
  * This function can, and will, break and/or be removed at any point in time.
8564
8591
  *
8592
+ * @private
8565
8593
  * @param {string} [id] flag report to review
8566
8594
  * @param {string} [reviewResult] flag report review result
8567
8595
  * @param {string} [options.user_id] currentUserID, only used with serverside auth
@@ -8602,6 +8630,52 @@ var StreamChat = /*#__PURE__*/function () {
8602
8630
 
8603
8631
  return _reviewFlagReport;
8604
8632
  }()
8633
+ /**
8634
+ * _unblockMessage - unblocks message blocked by automod
8635
+ *
8636
+ * Note: Do not use this.
8637
+ * It is present for internal usage only.
8638
+ * This function can, and will, break and/or be removed at any point in time.
8639
+ *
8640
+ * @private
8641
+ * @param {string} targetMessageID
8642
+ * @param {string} [options.user_id] currentUserID, only used with serverside auth
8643
+ * @returns {Promise<APIResponse>}
8644
+ */
8645
+
8646
+ }, {
8647
+ key: "_unblockMessage",
8648
+ value: function () {
8649
+ var _unblockMessage2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44(targetMessageID) {
8650
+ var options,
8651
+ _args44 = arguments;
8652
+ return _regeneratorRuntime.wrap(function _callee44$(_context44) {
8653
+ while (1) {
8654
+ switch (_context44.prev = _context44.next) {
8655
+ case 0:
8656
+ options = _args44.length > 1 && _args44[1] !== undefined ? _args44[1] : {};
8657
+ _context44.next = 3;
8658
+ return this.post(this.baseURL + '/moderation/unblock_message', _objectSpread({
8659
+ target_message_id: targetMessageID
8660
+ }, options));
8661
+
8662
+ case 3:
8663
+ return _context44.abrupt("return", _context44.sent);
8664
+
8665
+ case 4:
8666
+ case "end":
8667
+ return _context44.stop();
8668
+ }
8669
+ }
8670
+ }, _callee44, this);
8671
+ }));
8672
+
8673
+ function _unblockMessage(_x56) {
8674
+ return _unblockMessage2.apply(this, arguments);
8675
+ }
8676
+
8677
+ return _unblockMessage;
8678
+ }()
8605
8679
  /**
8606
8680
  * @deprecated use markChannelsRead instead
8607
8681
  *
@@ -8623,23 +8697,23 @@ var StreamChat = /*#__PURE__*/function () {
8623
8697
  * @return {Promise<APIResponse>}
8624
8698
  */
8625
8699
  function () {
8626
- var _markChannelsRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44() {
8700
+ var _markChannelsRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45() {
8627
8701
  var data,
8628
- _args44 = arguments;
8629
- return _regeneratorRuntime.wrap(function _callee44$(_context44) {
8702
+ _args45 = arguments;
8703
+ return _regeneratorRuntime.wrap(function _callee45$(_context45) {
8630
8704
  while (1) {
8631
- switch (_context44.prev = _context44.next) {
8705
+ switch (_context45.prev = _context45.next) {
8632
8706
  case 0:
8633
- data = _args44.length > 0 && _args44[0] !== undefined ? _args44[0] : {};
8634
- _context44.next = 3;
8707
+ data = _args45.length > 0 && _args45[0] !== undefined ? _args45[0] : {};
8708
+ _context45.next = 3;
8635
8709
  return this.post(this.baseURL + '/channels/read', _objectSpread({}, data));
8636
8710
 
8637
8711
  case 3:
8638
8712
  case "end":
8639
- return _context44.stop();
8713
+ return _context45.stop();
8640
8714
  }
8641
8715
  }
8642
- }, _callee44, this);
8716
+ }, _callee45, this);
8643
8717
  }));
8644
8718
 
8645
8719
  function markChannelsRead() {
@@ -8714,28 +8788,28 @@ var StreamChat = /*#__PURE__*/function () {
8714
8788
  }, {
8715
8789
  key: "translateMessage",
8716
8790
  value: function () {
8717
- var _translateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45(messageId, language) {
8718
- return _regeneratorRuntime.wrap(function _callee45$(_context45) {
8791
+ var _translateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46(messageId, language) {
8792
+ return _regeneratorRuntime.wrap(function _callee46$(_context46) {
8719
8793
  while (1) {
8720
- switch (_context45.prev = _context45.next) {
8794
+ switch (_context46.prev = _context46.next) {
8721
8795
  case 0:
8722
- _context45.next = 2;
8796
+ _context46.next = 2;
8723
8797
  return this.post(this.baseURL + "/messages/".concat(messageId, "/translate"), {
8724
8798
  language: language
8725
8799
  });
8726
8800
 
8727
8801
  case 2:
8728
- return _context45.abrupt("return", _context45.sent);
8802
+ return _context46.abrupt("return", _context46.sent);
8729
8803
 
8730
8804
  case 3:
8731
8805
  case "end":
8732
- return _context45.stop();
8806
+ return _context46.stop();
8733
8807
  }
8734
8808
  }
8735
- }, _callee45, this);
8809
+ }, _callee46, this);
8736
8810
  }));
8737
8811
 
8738
- function translateMessage(_x56, _x57) {
8812
+ function translateMessage(_x57, _x58) {
8739
8813
  return _translateMessage.apply(this, arguments);
8740
8814
  }
8741
8815
 
@@ -8837,14 +8911,14 @@ var StreamChat = /*#__PURE__*/function () {
8837
8911
  }, {
8838
8912
  key: "updateMessage",
8839
8913
  value: function () {
8840
- var _updateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46(message, userId, options) {
8914
+ var _updateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee47(message, userId, options) {
8841
8915
  var clonedMessage, reservedMessageFields;
8842
- return _regeneratorRuntime.wrap(function _callee46$(_context46) {
8916
+ return _regeneratorRuntime.wrap(function _callee47$(_context47) {
8843
8917
  while (1) {
8844
- switch (_context46.prev = _context46.next) {
8918
+ switch (_context47.prev = _context47.next) {
8845
8919
  case 0:
8846
8920
  if (message.id) {
8847
- _context46.next = 2;
8921
+ _context47.next = 2;
8848
8922
  break;
8849
8923
  }
8850
8924
 
@@ -8881,23 +8955,23 @@ var StreamChat = /*#__PURE__*/function () {
8881
8955
  });
8882
8956
  }
8883
8957
 
8884
- _context46.next = 10;
8958
+ _context47.next = 10;
8885
8959
  return this.post(this.baseURL + "/messages/".concat(message.id), _objectSpread({
8886
8960
  message: clonedMessage
8887
8961
  }, options));
8888
8962
 
8889
8963
  case 10:
8890
- return _context46.abrupt("return", _context46.sent);
8964
+ return _context47.abrupt("return", _context47.sent);
8891
8965
 
8892
8966
  case 11:
8893
8967
  case "end":
8894
- return _context46.stop();
8968
+ return _context47.stop();
8895
8969
  }
8896
8970
  }
8897
- }, _callee46, this);
8971
+ }, _callee47, this);
8898
8972
  }));
8899
8973
 
8900
- function updateMessage(_x58, _x59, _x60) {
8974
+ function updateMessage(_x59, _x60, _x61) {
8901
8975
  return _updateMessage.apply(this, arguments);
8902
8976
  }
8903
8977
 
@@ -8920,14 +8994,14 @@ var StreamChat = /*#__PURE__*/function () {
8920
8994
  }, {
8921
8995
  key: "partialUpdateMessage",
8922
8996
  value: function () {
8923
- var _partialUpdateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee47(id, partialMessageObject, userId, options) {
8997
+ var _partialUpdateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee48(id, partialMessageObject, userId, options) {
8924
8998
  var user;
8925
- return _regeneratorRuntime.wrap(function _callee47$(_context47) {
8999
+ return _regeneratorRuntime.wrap(function _callee48$(_context48) {
8926
9000
  while (1) {
8927
- switch (_context47.prev = _context47.next) {
9001
+ switch (_context48.prev = _context48.next) {
8928
9002
  case 0:
8929
9003
  if (id) {
8930
- _context47.next = 2;
9004
+ _context48.next = 2;
8931
9005
  break;
8932
9006
  }
8933
9007
 
@@ -8942,23 +9016,23 @@ var StreamChat = /*#__PURE__*/function () {
8942
9016
  };
8943
9017
  }
8944
9018
 
8945
- _context47.next = 6;
9019
+ _context48.next = 6;
8946
9020
  return this.put(this.baseURL + "/messages/".concat(id), _objectSpread(_objectSpread(_objectSpread({}, partialMessageObject), options), {}, {
8947
9021
  user: user
8948
9022
  }));
8949
9023
 
8950
9024
  case 6:
8951
- return _context47.abrupt("return", _context47.sent);
9025
+ return _context48.abrupt("return", _context48.sent);
8952
9026
 
8953
9027
  case 7:
8954
9028
  case "end":
8955
- return _context47.stop();
9029
+ return _context48.stop();
8956
9030
  }
8957
9031
  }
8958
- }, _callee47, this);
9032
+ }, _callee48, this);
8959
9033
  }));
8960
9034
 
8961
- function partialUpdateMessage(_x61, _x62, _x63, _x64) {
9035
+ function partialUpdateMessage(_x62, _x63, _x64, _x65) {
8962
9036
  return _partialUpdateMessage.apply(this, arguments);
8963
9037
  }
8964
9038
 
@@ -8967,11 +9041,11 @@ var StreamChat = /*#__PURE__*/function () {
8967
9041
  }, {
8968
9042
  key: "deleteMessage",
8969
9043
  value: function () {
8970
- var _deleteMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee48(messageID, hardDelete) {
9044
+ var _deleteMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49(messageID, hardDelete) {
8971
9045
  var params;
8972
- return _regeneratorRuntime.wrap(function _callee48$(_context48) {
9046
+ return _regeneratorRuntime.wrap(function _callee49$(_context49) {
8973
9047
  while (1) {
8974
- switch (_context48.prev = _context48.next) {
9048
+ switch (_context49.prev = _context49.next) {
8975
9049
  case 0:
8976
9050
  params = {};
8977
9051
 
@@ -8981,21 +9055,21 @@ var StreamChat = /*#__PURE__*/function () {
8981
9055
  };
8982
9056
  }
8983
9057
 
8984
- _context48.next = 4;
9058
+ _context49.next = 4;
8985
9059
  return this.delete(this.baseURL + "/messages/".concat(messageID), params);
8986
9060
 
8987
9061
  case 4:
8988
- return _context48.abrupt("return", _context48.sent);
9062
+ return _context49.abrupt("return", _context49.sent);
8989
9063
 
8990
9064
  case 5:
8991
9065
  case "end":
8992
- return _context48.stop();
9066
+ return _context49.stop();
8993
9067
  }
8994
9068
  }
8995
- }, _callee48, this);
9069
+ }, _callee49, this);
8996
9070
  }));
8997
9071
 
8998
- function deleteMessage(_x65, _x66) {
9072
+ function deleteMessage(_x66, _x67) {
8999
9073
  return _deleteMessage.apply(this, arguments);
9000
9074
  }
9001
9075
 
@@ -9004,26 +9078,26 @@ var StreamChat = /*#__PURE__*/function () {
9004
9078
  }, {
9005
9079
  key: "getMessage",
9006
9080
  value: function () {
9007
- var _getMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49(messageID) {
9008
- return _regeneratorRuntime.wrap(function _callee49$(_context49) {
9081
+ var _getMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee50(messageID) {
9082
+ return _regeneratorRuntime.wrap(function _callee50$(_context50) {
9009
9083
  while (1) {
9010
- switch (_context49.prev = _context49.next) {
9084
+ switch (_context50.prev = _context50.next) {
9011
9085
  case 0:
9012
- _context49.next = 2;
9086
+ _context50.next = 2;
9013
9087
  return this.get(this.baseURL + "/messages/".concat(messageID));
9014
9088
 
9015
9089
  case 2:
9016
- return _context49.abrupt("return", _context49.sent);
9090
+ return _context50.abrupt("return", _context50.sent);
9017
9091
 
9018
9092
  case 3:
9019
9093
  case "end":
9020
- return _context49.stop();
9094
+ return _context50.stop();
9021
9095
  }
9022
9096
  }
9023
- }, _callee49, this);
9097
+ }, _callee50, this);
9024
9098
  }));
9025
9099
 
9026
- function getMessage(_x67) {
9100
+ function getMessage(_x68) {
9027
9101
  return _getMessage.apply(this, arguments);
9028
9102
  }
9029
9103
 
@@ -9032,7 +9106,7 @@ var StreamChat = /*#__PURE__*/function () {
9032
9106
  }, {
9033
9107
  key: "getUserAgent",
9034
9108
  value: function getUserAgent() {
9035
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "5.1.0");
9109
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "5.3.0");
9036
9110
  }
9037
9111
  }, {
9038
9112
  key: "setUserAgent",
@@ -9227,28 +9301,28 @@ var StreamChat = /*#__PURE__*/function () {
9227
9301
  }, {
9228
9302
  key: "sendUserCustomEvent",
9229
9303
  value: function () {
9230
- var _sendUserCustomEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee50(targetUserID, event) {
9231
- return _regeneratorRuntime.wrap(function _callee50$(_context50) {
9304
+ var _sendUserCustomEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee51(targetUserID, event) {
9305
+ return _regeneratorRuntime.wrap(function _callee51$(_context51) {
9232
9306
  while (1) {
9233
- switch (_context50.prev = _context50.next) {
9307
+ switch (_context51.prev = _context51.next) {
9234
9308
  case 0:
9235
- _context50.next = 2;
9309
+ _context51.next = 2;
9236
9310
  return this.post("".concat(this.baseURL, "/users/").concat(targetUserID, "/event"), {
9237
9311
  event: event
9238
9312
  });
9239
9313
 
9240
9314
  case 2:
9241
- return _context50.abrupt("return", _context50.sent);
9315
+ return _context51.abrupt("return", _context51.sent);
9242
9316
 
9243
9317
  case 3:
9244
9318
  case "end":
9245
- return _context50.stop();
9319
+ return _context51.stop();
9246
9320
  }
9247
9321
  }
9248
- }, _callee50, this);
9322
+ }, _callee51, this);
9249
9323
  }));
9250
9324
 
9251
- function sendUserCustomEvent(_x68, _x69) {
9325
+ function sendUserCustomEvent(_x69, _x70) {
9252
9326
  return _sendUserCustomEvent.apply(this, arguments);
9253
9327
  }
9254
9328
 
@@ -9290,6 +9364,11 @@ var StreamChat = /*#__PURE__*/function () {
9290
9364
 
9291
9365
  return this.post("".concat(this.baseURL, "/export_channels"), payload);
9292
9366
  }
9367
+ }, {
9368
+ key: "exportUsers",
9369
+ value: function exportUsers(request) {
9370
+ return this.post("".concat(this.baseURL, "/export/users"), request);
9371
+ }
9293
9372
  }, {
9294
9373
  key: "exportChannel",
9295
9374
  value: function exportChannel(request, options) {
@@ -9311,32 +9390,32 @@ var StreamChat = /*#__PURE__*/function () {
9311
9390
  }, {
9312
9391
  key: "createSegment",
9313
9392
  value: function () {
9314
- var _createSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee51(params) {
9393
+ var _createSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee52(params) {
9315
9394
  var _yield$this$post, segment;
9316
9395
 
9317
- return _regeneratorRuntime.wrap(function _callee51$(_context51) {
9396
+ return _regeneratorRuntime.wrap(function _callee52$(_context52) {
9318
9397
  while (1) {
9319
- switch (_context51.prev = _context51.next) {
9398
+ switch (_context52.prev = _context52.next) {
9320
9399
  case 0:
9321
- _context51.next = 2;
9400
+ _context52.next = 2;
9322
9401
  return this.post(this.baseURL + "/segments", {
9323
9402
  segment: params
9324
9403
  });
9325
9404
 
9326
9405
  case 2:
9327
- _yield$this$post = _context51.sent;
9406
+ _yield$this$post = _context52.sent;
9328
9407
  segment = _yield$this$post.segment;
9329
- return _context51.abrupt("return", segment);
9408
+ return _context52.abrupt("return", segment);
9330
9409
 
9331
9410
  case 5:
9332
9411
  case "end":
9333
- return _context51.stop();
9412
+ return _context52.stop();
9334
9413
  }
9335
9414
  }
9336
- }, _callee51, this);
9415
+ }, _callee52, this);
9337
9416
  }));
9338
9417
 
9339
- function createSegment(_x70) {
9418
+ function createSegment(_x71) {
9340
9419
  return _createSegment.apply(this, arguments);
9341
9420
  }
9342
9421
 
@@ -9353,30 +9432,30 @@ var StreamChat = /*#__PURE__*/function () {
9353
9432
  }, {
9354
9433
  key: "getSegment",
9355
9434
  value: function () {
9356
- var _getSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee52(id) {
9435
+ var _getSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee53(id) {
9357
9436
  var _yield$this$get, segment;
9358
9437
 
9359
- return _regeneratorRuntime.wrap(function _callee52$(_context52) {
9438
+ return _regeneratorRuntime.wrap(function _callee53$(_context53) {
9360
9439
  while (1) {
9361
- switch (_context52.prev = _context52.next) {
9440
+ switch (_context53.prev = _context53.next) {
9362
9441
  case 0:
9363
- _context52.next = 2;
9442
+ _context53.next = 2;
9364
9443
  return this.get(this.baseURL + "/segments/".concat(id));
9365
9444
 
9366
9445
  case 2:
9367
- _yield$this$get = _context52.sent;
9446
+ _yield$this$get = _context53.sent;
9368
9447
  segment = _yield$this$get.segment;
9369
- return _context52.abrupt("return", segment);
9448
+ return _context53.abrupt("return", segment);
9370
9449
 
9371
9450
  case 5:
9372
9451
  case "end":
9373
- return _context52.stop();
9452
+ return _context53.stop();
9374
9453
  }
9375
9454
  }
9376
- }, _callee52, this);
9455
+ }, _callee53, this);
9377
9456
  }));
9378
9457
 
9379
- function getSegment(_x71) {
9458
+ function getSegment(_x72) {
9380
9459
  return _getSegment.apply(this, arguments);
9381
9460
  }
9382
9461
 
@@ -9392,30 +9471,30 @@ var StreamChat = /*#__PURE__*/function () {
9392
9471
  }, {
9393
9472
  key: "listSegments",
9394
9473
  value: function () {
9395
- var _listSegments = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee53(options) {
9474
+ var _listSegments = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee54(options) {
9396
9475
  var _yield$this$get2, segments;
9397
9476
 
9398
- return _regeneratorRuntime.wrap(function _callee53$(_context53) {
9477
+ return _regeneratorRuntime.wrap(function _callee54$(_context54) {
9399
9478
  while (1) {
9400
- switch (_context53.prev = _context53.next) {
9479
+ switch (_context54.prev = _context54.next) {
9401
9480
  case 0:
9402
- _context53.next = 2;
9481
+ _context54.next = 2;
9403
9482
  return this.get(this.baseURL + "/segments", options);
9404
9483
 
9405
9484
  case 2:
9406
- _yield$this$get2 = _context53.sent;
9485
+ _yield$this$get2 = _context54.sent;
9407
9486
  segments = _yield$this$get2.segments;
9408
- return _context53.abrupt("return", segments);
9487
+ return _context54.abrupt("return", segments);
9409
9488
 
9410
9489
  case 5:
9411
9490
  case "end":
9412
- return _context53.stop();
9491
+ return _context54.stop();
9413
9492
  }
9414
9493
  }
9415
- }, _callee53, this);
9494
+ }, _callee54, this);
9416
9495
  }));
9417
9496
 
9418
- function listSegments(_x72) {
9497
+ function listSegments(_x73) {
9419
9498
  return _listSegments.apply(this, arguments);
9420
9499
  }
9421
9500
 
@@ -9433,32 +9512,32 @@ var StreamChat = /*#__PURE__*/function () {
9433
9512
  }, {
9434
9513
  key: "updateSegment",
9435
9514
  value: function () {
9436
- var _updateSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee54(id, params) {
9515
+ var _updateSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee55(id, params) {
9437
9516
  var _yield$this$put, segment;
9438
9517
 
9439
- return _regeneratorRuntime.wrap(function _callee54$(_context54) {
9518
+ return _regeneratorRuntime.wrap(function _callee55$(_context55) {
9440
9519
  while (1) {
9441
- switch (_context54.prev = _context54.next) {
9520
+ switch (_context55.prev = _context55.next) {
9442
9521
  case 0:
9443
- _context54.next = 2;
9522
+ _context55.next = 2;
9444
9523
  return this.put(this.baseURL + "/segments/".concat(id), {
9445
9524
  segment: params
9446
9525
  });
9447
9526
 
9448
9527
  case 2:
9449
- _yield$this$put = _context54.sent;
9528
+ _yield$this$put = _context55.sent;
9450
9529
  segment = _yield$this$put.segment;
9451
- return _context54.abrupt("return", segment);
9530
+ return _context55.abrupt("return", segment);
9452
9531
 
9453
9532
  case 5:
9454
9533
  case "end":
9455
- return _context54.stop();
9534
+ return _context55.stop();
9456
9535
  }
9457
9536
  }
9458
- }, _callee54, this);
9537
+ }, _callee55, this);
9459
9538
  }));
9460
9539
 
9461
- function updateSegment(_x73, _x74) {
9540
+ function updateSegment(_x74, _x75) {
9462
9541
  return _updateSegment.apply(this, arguments);
9463
9542
  }
9464
9543
 
@@ -9475,22 +9554,22 @@ var StreamChat = /*#__PURE__*/function () {
9475
9554
  }, {
9476
9555
  key: "deleteSegment",
9477
9556
  value: function () {
9478
- var _deleteSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee55(id) {
9479
- return _regeneratorRuntime.wrap(function _callee55$(_context55) {
9557
+ var _deleteSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee56(id) {
9558
+ return _regeneratorRuntime.wrap(function _callee56$(_context56) {
9480
9559
  while (1) {
9481
- switch (_context55.prev = _context55.next) {
9560
+ switch (_context56.prev = _context56.next) {
9482
9561
  case 0:
9483
- return _context55.abrupt("return", this.delete(this.baseURL + "/segments/".concat(id)));
9562
+ return _context56.abrupt("return", this.delete(this.baseURL + "/segments/".concat(id)));
9484
9563
 
9485
9564
  case 1:
9486
9565
  case "end":
9487
- return _context55.stop();
9566
+ return _context56.stop();
9488
9567
  }
9489
9568
  }
9490
- }, _callee55, this);
9569
+ }, _callee56, this);
9491
9570
  }));
9492
9571
 
9493
- function deleteSegment(_x75) {
9572
+ function deleteSegment(_x76) {
9494
9573
  return _deleteSegment.apply(this, arguments);
9495
9574
  }
9496
9575
 
@@ -9507,32 +9586,32 @@ var StreamChat = /*#__PURE__*/function () {
9507
9586
  }, {
9508
9587
  key: "createCampaign",
9509
9588
  value: function () {
9510
- var _createCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee56(params) {
9589
+ var _createCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee57(params) {
9511
9590
  var _yield$this$post2, campaign;
9512
9591
 
9513
- return _regeneratorRuntime.wrap(function _callee56$(_context56) {
9592
+ return _regeneratorRuntime.wrap(function _callee57$(_context57) {
9514
9593
  while (1) {
9515
- switch (_context56.prev = _context56.next) {
9594
+ switch (_context57.prev = _context57.next) {
9516
9595
  case 0:
9517
- _context56.next = 2;
9596
+ _context57.next = 2;
9518
9597
  return this.post(this.baseURL + "/campaigns", {
9519
9598
  campaign: params
9520
9599
  });
9521
9600
 
9522
9601
  case 2:
9523
- _yield$this$post2 = _context56.sent;
9602
+ _yield$this$post2 = _context57.sent;
9524
9603
  campaign = _yield$this$post2.campaign;
9525
- return _context56.abrupt("return", campaign);
9604
+ return _context57.abrupt("return", campaign);
9526
9605
 
9527
9606
  case 5:
9528
9607
  case "end":
9529
- return _context56.stop();
9608
+ return _context57.stop();
9530
9609
  }
9531
9610
  }
9532
- }, _callee56, this);
9611
+ }, _callee57, this);
9533
9612
  }));
9534
9613
 
9535
- function createCampaign(_x76) {
9614
+ function createCampaign(_x77) {
9536
9615
  return _createCampaign.apply(this, arguments);
9537
9616
  }
9538
9617
 
@@ -9549,30 +9628,30 @@ var StreamChat = /*#__PURE__*/function () {
9549
9628
  }, {
9550
9629
  key: "getCampaign",
9551
9630
  value: function () {
9552
- var _getCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee57(id) {
9631
+ var _getCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee58(id) {
9553
9632
  var _yield$this$get3, campaign;
9554
9633
 
9555
- return _regeneratorRuntime.wrap(function _callee57$(_context57) {
9634
+ return _regeneratorRuntime.wrap(function _callee58$(_context58) {
9556
9635
  while (1) {
9557
- switch (_context57.prev = _context57.next) {
9636
+ switch (_context58.prev = _context58.next) {
9558
9637
  case 0:
9559
- _context57.next = 2;
9638
+ _context58.next = 2;
9560
9639
  return this.get(this.baseURL + "/campaigns/".concat(id));
9561
9640
 
9562
9641
  case 2:
9563
- _yield$this$get3 = _context57.sent;
9642
+ _yield$this$get3 = _context58.sent;
9564
9643
  campaign = _yield$this$get3.campaign;
9565
- return _context57.abrupt("return", campaign);
9644
+ return _context58.abrupt("return", campaign);
9566
9645
 
9567
9646
  case 5:
9568
9647
  case "end":
9569
- return _context57.stop();
9648
+ return _context58.stop();
9570
9649
  }
9571
9650
  }
9572
- }, _callee57, this);
9651
+ }, _callee58, this);
9573
9652
  }));
9574
9653
 
9575
- function getCampaign(_x77) {
9654
+ function getCampaign(_x78) {
9576
9655
  return _getCampaign.apply(this, arguments);
9577
9656
  }
9578
9657
 
@@ -9588,30 +9667,30 @@ var StreamChat = /*#__PURE__*/function () {
9588
9667
  }, {
9589
9668
  key: "listCampaigns",
9590
9669
  value: function () {
9591
- var _listCampaigns = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee58(options) {
9670
+ var _listCampaigns = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee59(options) {
9592
9671
  var _yield$this$get4, campaigns;
9593
9672
 
9594
- return _regeneratorRuntime.wrap(function _callee58$(_context58) {
9673
+ return _regeneratorRuntime.wrap(function _callee59$(_context59) {
9595
9674
  while (1) {
9596
- switch (_context58.prev = _context58.next) {
9675
+ switch (_context59.prev = _context59.next) {
9597
9676
  case 0:
9598
- _context58.next = 2;
9677
+ _context59.next = 2;
9599
9678
  return this.get(this.baseURL + "/campaigns", options);
9600
9679
 
9601
9680
  case 2:
9602
- _yield$this$get4 = _context58.sent;
9681
+ _yield$this$get4 = _context59.sent;
9603
9682
  campaigns = _yield$this$get4.campaigns;
9604
- return _context58.abrupt("return", campaigns);
9683
+ return _context59.abrupt("return", campaigns);
9605
9684
 
9606
9685
  case 5:
9607
9686
  case "end":
9608
- return _context58.stop();
9687
+ return _context59.stop();
9609
9688
  }
9610
9689
  }
9611
- }, _callee58, this);
9690
+ }, _callee59, this);
9612
9691
  }));
9613
9692
 
9614
- function listCampaigns(_x78) {
9693
+ function listCampaigns(_x79) {
9615
9694
  return _listCampaigns.apply(this, arguments);
9616
9695
  }
9617
9696
 
@@ -9629,32 +9708,32 @@ var StreamChat = /*#__PURE__*/function () {
9629
9708
  }, {
9630
9709
  key: "updateCampaign",
9631
9710
  value: function () {
9632
- var _updateCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee59(id, params) {
9711
+ var _updateCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee60(id, params) {
9633
9712
  var _yield$this$put2, campaign;
9634
9713
 
9635
- return _regeneratorRuntime.wrap(function _callee59$(_context59) {
9714
+ return _regeneratorRuntime.wrap(function _callee60$(_context60) {
9636
9715
  while (1) {
9637
- switch (_context59.prev = _context59.next) {
9716
+ switch (_context60.prev = _context60.next) {
9638
9717
  case 0:
9639
- _context59.next = 2;
9718
+ _context60.next = 2;
9640
9719
  return this.put(this.baseURL + "/campaigns/".concat(id), {
9641
9720
  campaign: params
9642
9721
  });
9643
9722
 
9644
9723
  case 2:
9645
- _yield$this$put2 = _context59.sent;
9724
+ _yield$this$put2 = _context60.sent;
9646
9725
  campaign = _yield$this$put2.campaign;
9647
- return _context59.abrupt("return", campaign);
9726
+ return _context60.abrupt("return", campaign);
9648
9727
 
9649
9728
  case 5:
9650
9729
  case "end":
9651
- return _context59.stop();
9730
+ return _context60.stop();
9652
9731
  }
9653
9732
  }
9654
- }, _callee59, this);
9733
+ }, _callee60, this);
9655
9734
  }));
9656
9735
 
9657
- function updateCampaign(_x79, _x80) {
9736
+ function updateCampaign(_x80, _x81) {
9658
9737
  return _updateCampaign.apply(this, arguments);
9659
9738
  }
9660
9739
 
@@ -9671,22 +9750,22 @@ var StreamChat = /*#__PURE__*/function () {
9671
9750
  }, {
9672
9751
  key: "deleteCampaign",
9673
9752
  value: function () {
9674
- var _deleteCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee60(id) {
9675
- return _regeneratorRuntime.wrap(function _callee60$(_context60) {
9753
+ var _deleteCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee61(id) {
9754
+ return _regeneratorRuntime.wrap(function _callee61$(_context61) {
9676
9755
  while (1) {
9677
- switch (_context60.prev = _context60.next) {
9756
+ switch (_context61.prev = _context61.next) {
9678
9757
  case 0:
9679
- return _context60.abrupt("return", this.delete(this.baseURL + "/campaigns/".concat(id)));
9758
+ return _context61.abrupt("return", this.delete(this.baseURL + "/campaigns/".concat(id)));
9680
9759
 
9681
9760
  case 1:
9682
9761
  case "end":
9683
- return _context60.stop();
9762
+ return _context61.stop();
9684
9763
  }
9685
9764
  }
9686
- }, _callee60, this);
9765
+ }, _callee61, this);
9687
9766
  }));
9688
9767
 
9689
- function deleteCampaign(_x81) {
9768
+ function deleteCampaign(_x82) {
9690
9769
  return _deleteCampaign.apply(this, arguments);
9691
9770
  }
9692
9771
 
@@ -9704,33 +9783,33 @@ var StreamChat = /*#__PURE__*/function () {
9704
9783
  }, {
9705
9784
  key: "scheduleCampaign",
9706
9785
  value: function () {
9707
- var _scheduleCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee61(id, params) {
9786
+ var _scheduleCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee62(id, params) {
9708
9787
  var sendAt, _yield$this$patch, campaign;
9709
9788
 
9710
- return _regeneratorRuntime.wrap(function _callee61$(_context61) {
9789
+ return _regeneratorRuntime.wrap(function _callee62$(_context62) {
9711
9790
  while (1) {
9712
- switch (_context61.prev = _context61.next) {
9791
+ switch (_context62.prev = _context62.next) {
9713
9792
  case 0:
9714
9793
  sendAt = params.sendAt;
9715
- _context61.next = 3;
9794
+ _context62.next = 3;
9716
9795
  return this.patch(this.baseURL + "/campaigns/".concat(id, "/schedule"), {
9717
9796
  send_at: sendAt
9718
9797
  });
9719
9798
 
9720
9799
  case 3:
9721
- _yield$this$patch = _context61.sent;
9800
+ _yield$this$patch = _context62.sent;
9722
9801
  campaign = _yield$this$patch.campaign;
9723
- return _context61.abrupt("return", campaign);
9802
+ return _context62.abrupt("return", campaign);
9724
9803
 
9725
9804
  case 6:
9726
9805
  case "end":
9727
- return _context61.stop();
9806
+ return _context62.stop();
9728
9807
  }
9729
9808
  }
9730
- }, _callee61, this);
9809
+ }, _callee62, this);
9731
9810
  }));
9732
9811
 
9733
- function scheduleCampaign(_x82, _x83) {
9812
+ function scheduleCampaign(_x83, _x84) {
9734
9813
  return _scheduleCampaign.apply(this, arguments);
9735
9814
  }
9736
9815
 
@@ -9747,30 +9826,30 @@ var StreamChat = /*#__PURE__*/function () {
9747
9826
  }, {
9748
9827
  key: "stopCampaign",
9749
9828
  value: function () {
9750
- var _stopCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee62(id) {
9829
+ var _stopCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee63(id) {
9751
9830
  var _yield$this$patch2, campaign;
9752
9831
 
9753
- return _regeneratorRuntime.wrap(function _callee62$(_context62) {
9832
+ return _regeneratorRuntime.wrap(function _callee63$(_context63) {
9754
9833
  while (1) {
9755
- switch (_context62.prev = _context62.next) {
9834
+ switch (_context63.prev = _context63.next) {
9756
9835
  case 0:
9757
- _context62.next = 2;
9836
+ _context63.next = 2;
9758
9837
  return this.patch(this.baseURL + "/campaigns/".concat(id, "/stop"));
9759
9838
 
9760
9839
  case 2:
9761
- _yield$this$patch2 = _context62.sent;
9840
+ _yield$this$patch2 = _context63.sent;
9762
9841
  campaign = _yield$this$patch2.campaign;
9763
- return _context62.abrupt("return", campaign);
9842
+ return _context63.abrupt("return", campaign);
9764
9843
 
9765
9844
  case 5:
9766
9845
  case "end":
9767
- return _context62.stop();
9846
+ return _context63.stop();
9768
9847
  }
9769
9848
  }
9770
- }, _callee62, this);
9849
+ }, _callee63, this);
9771
9850
  }));
9772
9851
 
9773
- function stopCampaign(_x84) {
9852
+ function stopCampaign(_x85) {
9774
9853
  return _stopCampaign.apply(this, arguments);
9775
9854
  }
9776
9855
 
@@ -9787,30 +9866,30 @@ var StreamChat = /*#__PURE__*/function () {
9787
9866
  }, {
9788
9867
  key: "resumeCampaign",
9789
9868
  value: function () {
9790
- var _resumeCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee63(id) {
9869
+ var _resumeCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee64(id) {
9791
9870
  var _yield$this$patch3, campaign;
9792
9871
 
9793
- return _regeneratorRuntime.wrap(function _callee63$(_context63) {
9872
+ return _regeneratorRuntime.wrap(function _callee64$(_context64) {
9794
9873
  while (1) {
9795
- switch (_context63.prev = _context63.next) {
9874
+ switch (_context64.prev = _context64.next) {
9796
9875
  case 0:
9797
- _context63.next = 2;
9876
+ _context64.next = 2;
9798
9877
  return this.patch(this.baseURL + "/campaigns/".concat(id, "/resume"));
9799
9878
 
9800
9879
  case 2:
9801
- _yield$this$patch3 = _context63.sent;
9880
+ _yield$this$patch3 = _context64.sent;
9802
9881
  campaign = _yield$this$patch3.campaign;
9803
- return _context63.abrupt("return", campaign);
9882
+ return _context64.abrupt("return", campaign);
9804
9883
 
9805
9884
  case 5:
9806
9885
  case "end":
9807
- return _context63.stop();
9886
+ return _context64.stop();
9808
9887
  }
9809
9888
  }
9810
- }, _callee63, this);
9889
+ }, _callee64, this);
9811
9890
  }));
9812
9891
 
9813
- function resumeCampaign(_x85) {
9892
+ function resumeCampaign(_x86) {
9814
9893
  return _resumeCampaign.apply(this, arguments);
9815
9894
  }
9816
9895
 
@@ -9827,33 +9906,33 @@ var StreamChat = /*#__PURE__*/function () {
9827
9906
  }, {
9828
9907
  key: "testCampaign",
9829
9908
  value: function () {
9830
- var _testCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee64(id, params) {
9909
+ var _testCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee65(id, params) {
9831
9910
  var users, _yield$this$post3, campaign;
9832
9911
 
9833
- return _regeneratorRuntime.wrap(function _callee64$(_context64) {
9912
+ return _regeneratorRuntime.wrap(function _callee65$(_context65) {
9834
9913
  while (1) {
9835
- switch (_context64.prev = _context64.next) {
9914
+ switch (_context65.prev = _context65.next) {
9836
9915
  case 0:
9837
9916
  users = params.users;
9838
- _context64.next = 3;
9917
+ _context65.next = 3;
9839
9918
  return this.post(this.baseURL + "/campaigns/".concat(id, "/test"), {
9840
9919
  users: users
9841
9920
  });
9842
9921
 
9843
9922
  case 3:
9844
- _yield$this$post3 = _context64.sent;
9923
+ _yield$this$post3 = _context65.sent;
9845
9924
  campaign = _yield$this$post3.campaign;
9846
- return _context64.abrupt("return", campaign);
9925
+ return _context65.abrupt("return", campaign);
9847
9926
 
9848
9927
  case 6:
9849
9928
  case "end":
9850
- return _context64.stop();
9929
+ return _context65.stop();
9851
9930
  }
9852
9931
  }
9853
- }, _callee64, this);
9932
+ }, _callee65, this);
9854
9933
  }));
9855
9934
 
9856
- function testCampaign(_x86, _x87) {
9935
+ function testCampaign(_x87, _x88) {
9857
9936
  return _testCampaign.apply(this, arguments);
9858
9937
  }
9859
9938
 
@@ -9869,24 +9948,24 @@ var StreamChat = /*#__PURE__*/function () {
9869
9948
  }, {
9870
9949
  key: "enrichURL",
9871
9950
  value: function () {
9872
- var _enrichURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee65(url) {
9873
- return _regeneratorRuntime.wrap(function _callee65$(_context65) {
9951
+ var _enrichURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee66(url) {
9952
+ return _regeneratorRuntime.wrap(function _callee66$(_context66) {
9874
9953
  while (1) {
9875
- switch (_context65.prev = _context65.next) {
9954
+ switch (_context66.prev = _context66.next) {
9876
9955
  case 0:
9877
- return _context65.abrupt("return", this.get(this.baseURL + "/og", {
9956
+ return _context66.abrupt("return", this.get(this.baseURL + "/og", {
9878
9957
  url: url
9879
9958
  }));
9880
9959
 
9881
9960
  case 1:
9882
9961
  case "end":
9883
- return _context65.stop();
9962
+ return _context66.stop();
9884
9963
  }
9885
9964
  }
9886
- }, _callee65, this);
9965
+ }, _callee66, this);
9887
9966
  }));
9888
9967
 
9889
- function enrichURL(_x88) {
9968
+ function enrichURL(_x89) {
9890
9969
  return _enrichURL.apply(this, arguments);
9891
9970
  }
9892
9971
 
@@ -9903,22 +9982,22 @@ var StreamChat = /*#__PURE__*/function () {
9903
9982
  }, {
9904
9983
  key: "getTask",
9905
9984
  value: function () {
9906
- var _getTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee66(id) {
9907
- return _regeneratorRuntime.wrap(function _callee66$(_context66) {
9985
+ var _getTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee67(id) {
9986
+ return _regeneratorRuntime.wrap(function _callee67$(_context67) {
9908
9987
  while (1) {
9909
- switch (_context66.prev = _context66.next) {
9988
+ switch (_context67.prev = _context67.next) {
9910
9989
  case 0:
9911
- return _context66.abrupt("return", this.get("".concat(this.baseURL, "/tasks/").concat(id)));
9990
+ return _context67.abrupt("return", this.get("".concat(this.baseURL, "/tasks/").concat(id)));
9912
9991
 
9913
9992
  case 1:
9914
9993
  case "end":
9915
- return _context66.stop();
9994
+ return _context67.stop();
9916
9995
  }
9917
9996
  }
9918
- }, _callee66, this);
9997
+ }, _callee67, this);
9919
9998
  }));
9920
9999
 
9921
- function getTask(_x89) {
10000
+ function getTask(_x90) {
9922
10001
  return _getTask.apply(this, arguments);
9923
10002
  }
9924
10003
 
@@ -9936,31 +10015,31 @@ var StreamChat = /*#__PURE__*/function () {
9936
10015
  }, {
9937
10016
  key: "deleteChannels",
9938
10017
  value: function () {
9939
- var _deleteChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee67(cids) {
10018
+ var _deleteChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee68(cids) {
9940
10019
  var options,
9941
- _args67 = arguments;
9942
- return _regeneratorRuntime.wrap(function _callee67$(_context67) {
10020
+ _args68 = arguments;
10021
+ return _regeneratorRuntime.wrap(function _callee68$(_context68) {
9943
10022
  while (1) {
9944
- switch (_context67.prev = _context67.next) {
10023
+ switch (_context68.prev = _context68.next) {
9945
10024
  case 0:
9946
- options = _args67.length > 1 && _args67[1] !== undefined ? _args67[1] : {};
9947
- _context67.next = 3;
10025
+ options = _args68.length > 1 && _args68[1] !== undefined ? _args68[1] : {};
10026
+ _context68.next = 3;
9948
10027
  return this.post(this.baseURL + "/channels/delete", _objectSpread({
9949
10028
  cids: cids
9950
10029
  }, options));
9951
10030
 
9952
10031
  case 3:
9953
- return _context67.abrupt("return", _context67.sent);
10032
+ return _context68.abrupt("return", _context68.sent);
9954
10033
 
9955
10034
  case 4:
9956
10035
  case "end":
9957
- return _context67.stop();
10036
+ return _context68.stop();
9958
10037
  }
9959
10038
  }
9960
- }, _callee67, this);
10039
+ }, _callee68, this);
9961
10040
  }));
9962
10041
 
9963
- function deleteChannels(_x90) {
10042
+ function deleteChannels(_x91) {
9964
10043
  return _deleteChannels.apply(this, arguments);
9965
10044
  }
9966
10045
 
@@ -9978,13 +10057,13 @@ var StreamChat = /*#__PURE__*/function () {
9978
10057
  }, {
9979
10058
  key: "deleteUsers",
9980
10059
  value: function () {
9981
- var _deleteUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee68(user_ids, options) {
9982
- return _regeneratorRuntime.wrap(function _callee68$(_context68) {
10060
+ var _deleteUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee69(user_ids, options) {
10061
+ return _regeneratorRuntime.wrap(function _callee69$(_context69) {
9983
10062
  while (1) {
9984
- switch (_context68.prev = _context68.next) {
10063
+ switch (_context69.prev = _context69.next) {
9985
10064
  case 0:
9986
10065
  if (!((options === null || options === void 0 ? void 0 : options.user) !== 'soft' && (options === null || options === void 0 ? void 0 : options.user) !== 'hard')) {
9987
- _context68.next = 2;
10066
+ _context69.next = 2;
9988
10067
  break;
9989
10068
  }
9990
10069
 
@@ -9992,7 +10071,7 @@ var StreamChat = /*#__PURE__*/function () {
9992
10071
 
9993
10072
  case 2:
9994
10073
  if (!(options.messages !== undefined && options.messages !== 'soft' && options.messages !== 'hard')) {
9995
- _context68.next = 4;
10074
+ _context69.next = 4;
9996
10075
  break;
9997
10076
  }
9998
10077
 
@@ -10000,30 +10079,30 @@ var StreamChat = /*#__PURE__*/function () {
10000
10079
 
10001
10080
  case 4:
10002
10081
  if (!(options.conversations !== undefined && options.conversations !== 'soft' && options.conversations !== 'hard')) {
10003
- _context68.next = 6;
10082
+ _context69.next = 6;
10004
10083
  break;
10005
10084
  }
10006
10085
 
10007
10086
  throw new Error('Invalid delete user options. conversations must be one of [soft hard]');
10008
10087
 
10009
10088
  case 6:
10010
- _context68.next = 8;
10089
+ _context69.next = 8;
10011
10090
  return this.post(this.baseURL + "/users/delete", _objectSpread({
10012
10091
  user_ids: user_ids
10013
10092
  }, options));
10014
10093
 
10015
10094
  case 8:
10016
- return _context68.abrupt("return", _context68.sent);
10095
+ return _context69.abrupt("return", _context69.sent);
10017
10096
 
10018
10097
  case 9:
10019
10098
  case "end":
10020
- return _context68.stop();
10099
+ return _context69.stop();
10021
10100
  }
10022
10101
  }
10023
- }, _callee68, this);
10102
+ }, _callee69, this);
10024
10103
  }));
10025
10104
 
10026
- function deleteUsers(_x91, _x92) {
10105
+ function deleteUsers(_x92, _x93) {
10027
10106
  return _deleteUsers.apply(this, arguments);
10028
10107
  }
10029
10108