stream-chat 5.1.2 → 5.5.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.
package/dist/index.es.js CHANGED
@@ -715,6 +715,7 @@ var EVENT_MAP = {
715
715
  'channel.created': true,
716
716
  'channel.deleted': true,
717
717
  'channel.hidden': true,
718
+ 'channel.kicked': true,
718
719
  'channel.muted': true,
719
720
  'channel.truncated': true,
720
721
  'channel.unmuted': true,
@@ -753,7 +754,8 @@ var EVENT_MAP = {
753
754
  'user.watching.stop': true,
754
755
  // local events
755
756
  'connection.changed': true,
756
- 'connection.recovered': true
757
+ 'connection.recovered': true,
758
+ 'transport.changed': true
757
759
  };
758
760
 
759
761
  var IS_VALID_EVENT_MAP_TYPE = _objectSpread$6(_objectSpread$6({}, EVENT_MAP), {}, {
@@ -1678,6 +1680,8 @@ var Channel = /*#__PURE__*/function () {
1678
1680
  /**
1679
1681
  * delete - Delete the channel. Messages are permanently removed.
1680
1682
  *
1683
+ * @param {boolean} [options.hard_delete] Defines if the channel is hard deleted or not
1684
+ *
1681
1685
  * @return {Promise<DeleteChannelAPIResponse<ChannelType, CommandType, UserType>>} The server response
1682
1686
  */
1683
1687
 
@@ -1685,17 +1689,20 @@ var Channel = /*#__PURE__*/function () {
1685
1689
  key: "delete",
1686
1690
  value: function () {
1687
1691
  var _delete2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {
1692
+ var options,
1693
+ _args11 = arguments;
1688
1694
  return _regeneratorRuntime.wrap(function _callee11$(_context11) {
1689
1695
  while (1) {
1690
1696
  switch (_context11.prev = _context11.next) {
1691
1697
  case 0:
1692
- _context11.next = 2;
1693
- return this.getClient().delete(this._channelURL(), {});
1698
+ options = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : {};
1699
+ _context11.next = 3;
1700
+ return this.getClient().delete(this._channelURL(), _objectSpread$5({}, options));
1694
1701
 
1695
- case 2:
1702
+ case 3:
1696
1703
  return _context11.abrupt("return", _context11.sent);
1697
1704
 
1698
- case 3:
1705
+ case 4:
1699
1706
  case "end":
1700
1707
  return _context11.stop();
1701
1708
  }
@@ -3193,7 +3200,8 @@ var Channel = /*#__PURE__*/function () {
3193
3200
  channelState.read[event.user.id] = {
3194
3201
  // because in client.ts the handleEvent call that flows to this sets this `event.received_at = new Date();`
3195
3202
  last_read: event.received_at,
3196
- user: event.user
3203
+ user: event.user,
3204
+ unread_messages: 0
3197
3205
  };
3198
3206
 
3199
3207
  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)) {
@@ -3250,7 +3258,8 @@ var Channel = /*#__PURE__*/function () {
3250
3258
  channelState.unreadCount = 0;
3251
3259
  channelState.read[event.user.id] = {
3252
3260
  last_read: new Date(event.created_at),
3253
- user: event.user
3261
+ user: event.user,
3262
+ unread_messages: 0
3254
3263
  };
3255
3264
  } else if (this._countMessageAsUnread(event.message)) {
3256
3265
  channelState.unreadCount = channelState.unreadCount + 1;
@@ -3274,7 +3283,16 @@ var Channel = /*#__PURE__*/function () {
3274
3283
 
3275
3284
  case 'channel.truncated':
3276
3285
  channelState.clearMessages();
3277
- channelState.unreadCount = 0;
3286
+ channelState.unreadCount = 0; // system messages don't increment unread counts
3287
+
3288
+ if (event.message) {
3289
+ channelState.addMessageSorted(event.message);
3290
+
3291
+ if (event.message.pinned) {
3292
+ channelState.addPinnedMessage(event.message);
3293
+ }
3294
+ }
3295
+
3278
3296
  break;
3279
3297
 
3280
3298
  case 'member.added':
@@ -3420,7 +3438,8 @@ var Channel = /*#__PURE__*/function () {
3420
3438
  if (user) {
3421
3439
  this.state.read[user.id] = {
3422
3440
  user: user,
3423
- last_read: last_read
3441
+ last_read: last_read,
3442
+ unread_messages: 0
3424
3443
  };
3425
3444
  }
3426
3445
  } // apply read state if part of the state
@@ -3432,16 +3451,17 @@ var Channel = /*#__PURE__*/function () {
3432
3451
 
3433
3452
  try {
3434
3453
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
3435
- var read = _step3.value;
3454
+ var _read$unread_messages;
3436
3455
 
3437
- var parsedRead = _objectSpread$5(_objectSpread$5({}, read), {}, {
3438
- last_read: new Date(read.last_read)
3439
- });
3440
-
3441
- this.state.read[read.user.id] = parsedRead;
3456
+ var read = _step3.value;
3457
+ this.state.read[read.user.id] = {
3458
+ last_read: new Date(read.last_read),
3459
+ unread_messages: (_read$unread_messages = read.unread_messages) !== null && _read$unread_messages !== void 0 ? _read$unread_messages : 0,
3460
+ user: read.user
3461
+ };
3442
3462
 
3443
- if (read.user.id === (user === null || user === void 0 ? void 0 : user.id) && typeof parsedRead.unread_messages === 'number') {
3444
- this.state.unreadCount = parsedRead.unread_messages;
3463
+ if (read.user.id === (user === null || user === void 0 ? void 0 : user.id)) {
3464
+ this.state.unreadCount = this.state.read[read.user.id].unread_messages;
3445
3465
  }
3446
3466
  }
3447
3467
  } catch (err) {
@@ -3793,6 +3813,12 @@ var StableWSConnection = /*#__PURE__*/function () {
3793
3813
 
3794
3814
  _defineProperty(this, "onmessage", function (wsID, event) {
3795
3815
  if (_this.wsID !== wsID) return;
3816
+
3817
+ _this._log('onmessage() - onmessage callback', {
3818
+ event: event,
3819
+ wsID: wsID
3820
+ });
3821
+
3796
3822
  var data = typeof event.data === 'string' ? JSON.parse(event.data) : null; // we wait till the first message before we consider the connection open..
3797
3823
  // the reason for this is that auth errors and similar errors trigger a ws.onopen and immediately
3798
3824
  // after that a ws.onclose..
@@ -3817,11 +3843,6 @@ var StableWSConnection = /*#__PURE__*/function () {
3817
3843
 
3818
3844
  _this.lastEvent = new Date();
3819
3845
 
3820
- _this._log('onmessage() - onmessage callback', {
3821
- event: event,
3822
- wsID: wsID
3823
- });
3824
-
3825
3846
  if (data && data.type === 'health.check') {
3826
3847
  _this.scheduleNextPing();
3827
3848
  }
@@ -4351,27 +4372,36 @@ var StableWSConnection = /*#__PURE__*/function () {
4351
4372
  this.requestID = randomId();
4352
4373
  this.client.insightMetrics.connectionStartTimestamp = new Date().getTime();
4353
4374
  _context5.prev = 5;
4354
- _context5.next = 8;
4375
+
4376
+ this._log("_connect() - waiting for token");
4377
+
4378
+ _context5.next = 9;
4355
4379
  return this.client.tokenManager.tokenReady();
4356
4380
 
4357
- case 8:
4381
+ case 9:
4358
4382
  this._setupConnectionPromise();
4359
4383
 
4360
4384
  wsURL = this._buildUrl();
4385
+
4386
+ this._log("_connect() - Connecting to ".concat(wsURL), {
4387
+ wsURL: wsURL,
4388
+ requestID: this.requestID
4389
+ });
4390
+
4361
4391
  this.ws = new WebSocket(wsURL);
4362
4392
  this.ws.onopen = this.onopen.bind(this, this.wsID);
4363
4393
  this.ws.onclose = this.onclose.bind(this, this.wsID);
4364
4394
  this.ws.onerror = this.onerror.bind(this, this.wsID);
4365
4395
  this.ws.onmessage = this.onmessage.bind(this, this.wsID);
4366
- _context5.next = 17;
4396
+ _context5.next = 19;
4367
4397
  return this.connectionOpen;
4368
4398
 
4369
- case 17:
4399
+ case 19:
4370
4400
  response = _context5.sent;
4371
4401
  this.isConnecting = false;
4372
4402
 
4373
4403
  if (!response) {
4374
- _context5.next = 23;
4404
+ _context5.next = 25;
4375
4405
  break;
4376
4406
  }
4377
4407
 
@@ -4384,12 +4414,12 @@ var StableWSConnection = /*#__PURE__*/function () {
4384
4414
 
4385
4415
  return _context5.abrupt("return", response);
4386
4416
 
4387
- case 23:
4388
- _context5.next = 30;
4417
+ case 25:
4418
+ _context5.next = 32;
4389
4419
  break;
4390
4420
 
4391
- case 25:
4392
- _context5.prev = 25;
4421
+ case 27:
4422
+ _context5.prev = 27;
4393
4423
  _context5.t0 = _context5["catch"](5);
4394
4424
  this.isConnecting = false;
4395
4425
 
@@ -4402,12 +4432,12 @@ var StableWSConnection = /*#__PURE__*/function () {
4402
4432
 
4403
4433
  throw _context5.t0;
4404
4434
 
4405
- case 30:
4435
+ case 32:
4406
4436
  case "end":
4407
4437
  return _context5.stop();
4408
4438
  }
4409
4439
  }
4410
- }, _callee5, this, [[5, 25]]);
4440
+ }, _callee5, this, [[5, 27]]);
4411
4441
  }));
4412
4442
 
4413
4443
  function _connect() {
@@ -6559,7 +6589,6 @@ var StreamChat = /*#__PURE__*/function () {
6559
6589
  apnTemplate: '{}', //if app doesn't have apn configured it will error
6560
6590
  firebaseTemplate: '{}', //if app doesn't have firebase configured it will error
6561
6591
  firebaseDataTemplate: '{}', //if app doesn't have firebase configured it will error
6562
- huaweiDataTemplate: '{}' //if app doesn't have huawei configured it will error
6563
6592
  skipDevices: true, // skip config/device checks and sending to real devices
6564
6593
  }
6565
6594
  */
@@ -6576,7 +6605,7 @@ var StreamChat = /*#__PURE__*/function () {
6576
6605
  case 0:
6577
6606
  data = _args12.length > 1 && _args12[1] !== undefined ? _args12[1] : {};
6578
6607
  _context12.next = 3;
6579
- return this.post(this.baseURL + '/check_push', _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
6608
+ return this.post(this.baseURL + '/check_push', _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
6580
6609
  user_id: userID
6581
6610
  }, data.messageID ? {
6582
6611
  message_id: data.messageID
@@ -6586,8 +6615,6 @@ var StreamChat = /*#__PURE__*/function () {
6586
6615
  firebase_template: data.firebaseTemplate
6587
6616
  } : {}), data.firebaseDataTemplate ? {
6588
6617
  firebase_data_template: data.firebaseDataTemplate
6589
- } : {}), data.huaweiDataTemplate ? {
6590
- huawei_data_template: data.huaweiDataTemplate
6591
6618
  } : {}), data.skipDevices ? {
6592
6619
  skip_devices: true
6593
6620
  } : {}));
@@ -8532,6 +8559,7 @@ var StreamChat = /*#__PURE__*/function () {
8532
8559
  * It is present for internal usage only.
8533
8560
  * This function can, and will, break and/or be removed at any point in time.
8534
8561
  *
8562
+ * @private
8535
8563
  * @param {FlagReportsFilters} filterConditions MongoDB style filter conditions
8536
8564
  * @param {FlagReportsPaginationOptions} options Option object, {limit: 10, offset:0}
8537
8565
  *
@@ -8580,6 +8608,7 @@ var StreamChat = /*#__PURE__*/function () {
8580
8608
  * It is present for internal usage only.
8581
8609
  * This function can, and will, break and/or be removed at any point in time.
8582
8610
  *
8611
+ * @private
8583
8612
  * @param {string} [id] flag report to review
8584
8613
  * @param {string} [reviewResult] flag report review result
8585
8614
  * @param {string} [options.user_id] currentUserID, only used with serverside auth
@@ -8620,6 +8649,52 @@ var StreamChat = /*#__PURE__*/function () {
8620
8649
 
8621
8650
  return _reviewFlagReport;
8622
8651
  }()
8652
+ /**
8653
+ * _unblockMessage - unblocks message blocked by automod
8654
+ *
8655
+ * Note: Do not use this.
8656
+ * It is present for internal usage only.
8657
+ * This function can, and will, break and/or be removed at any point in time.
8658
+ *
8659
+ * @private
8660
+ * @param {string} targetMessageID
8661
+ * @param {string} [options.user_id] currentUserID, only used with serverside auth
8662
+ * @returns {Promise<APIResponse>}
8663
+ */
8664
+
8665
+ }, {
8666
+ key: "_unblockMessage",
8667
+ value: function () {
8668
+ var _unblockMessage2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44(targetMessageID) {
8669
+ var options,
8670
+ _args44 = arguments;
8671
+ return _regeneratorRuntime.wrap(function _callee44$(_context44) {
8672
+ while (1) {
8673
+ switch (_context44.prev = _context44.next) {
8674
+ case 0:
8675
+ options = _args44.length > 1 && _args44[1] !== undefined ? _args44[1] : {};
8676
+ _context44.next = 3;
8677
+ return this.post(this.baseURL + '/moderation/unblock_message', _objectSpread({
8678
+ target_message_id: targetMessageID
8679
+ }, options));
8680
+
8681
+ case 3:
8682
+ return _context44.abrupt("return", _context44.sent);
8683
+
8684
+ case 4:
8685
+ case "end":
8686
+ return _context44.stop();
8687
+ }
8688
+ }
8689
+ }, _callee44, this);
8690
+ }));
8691
+
8692
+ function _unblockMessage(_x56) {
8693
+ return _unblockMessage2.apply(this, arguments);
8694
+ }
8695
+
8696
+ return _unblockMessage;
8697
+ }()
8623
8698
  /**
8624
8699
  * @deprecated use markChannelsRead instead
8625
8700
  *
@@ -8641,23 +8716,23 @@ var StreamChat = /*#__PURE__*/function () {
8641
8716
  * @return {Promise<APIResponse>}
8642
8717
  */
8643
8718
  function () {
8644
- var _markChannelsRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44() {
8719
+ var _markChannelsRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45() {
8645
8720
  var data,
8646
- _args44 = arguments;
8647
- return _regeneratorRuntime.wrap(function _callee44$(_context44) {
8721
+ _args45 = arguments;
8722
+ return _regeneratorRuntime.wrap(function _callee45$(_context45) {
8648
8723
  while (1) {
8649
- switch (_context44.prev = _context44.next) {
8724
+ switch (_context45.prev = _context45.next) {
8650
8725
  case 0:
8651
- data = _args44.length > 0 && _args44[0] !== undefined ? _args44[0] : {};
8652
- _context44.next = 3;
8726
+ data = _args45.length > 0 && _args45[0] !== undefined ? _args45[0] : {};
8727
+ _context45.next = 3;
8653
8728
  return this.post(this.baseURL + '/channels/read', _objectSpread({}, data));
8654
8729
 
8655
8730
  case 3:
8656
8731
  case "end":
8657
- return _context44.stop();
8732
+ return _context45.stop();
8658
8733
  }
8659
8734
  }
8660
- }, _callee44, this);
8735
+ }, _callee45, this);
8661
8736
  }));
8662
8737
 
8663
8738
  function markChannelsRead() {
@@ -8732,28 +8807,28 @@ var StreamChat = /*#__PURE__*/function () {
8732
8807
  }, {
8733
8808
  key: "translateMessage",
8734
8809
  value: function () {
8735
- var _translateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45(messageId, language) {
8736
- return _regeneratorRuntime.wrap(function _callee45$(_context45) {
8810
+ var _translateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46(messageId, language) {
8811
+ return _regeneratorRuntime.wrap(function _callee46$(_context46) {
8737
8812
  while (1) {
8738
- switch (_context45.prev = _context45.next) {
8813
+ switch (_context46.prev = _context46.next) {
8739
8814
  case 0:
8740
- _context45.next = 2;
8815
+ _context46.next = 2;
8741
8816
  return this.post(this.baseURL + "/messages/".concat(messageId, "/translate"), {
8742
8817
  language: language
8743
8818
  });
8744
8819
 
8745
8820
  case 2:
8746
- return _context45.abrupt("return", _context45.sent);
8821
+ return _context46.abrupt("return", _context46.sent);
8747
8822
 
8748
8823
  case 3:
8749
8824
  case "end":
8750
- return _context45.stop();
8825
+ return _context46.stop();
8751
8826
  }
8752
8827
  }
8753
- }, _callee45, this);
8828
+ }, _callee46, this);
8754
8829
  }));
8755
8830
 
8756
- function translateMessage(_x56, _x57) {
8831
+ function translateMessage(_x57, _x58) {
8757
8832
  return _translateMessage.apply(this, arguments);
8758
8833
  }
8759
8834
 
@@ -8855,14 +8930,14 @@ var StreamChat = /*#__PURE__*/function () {
8855
8930
  }, {
8856
8931
  key: "updateMessage",
8857
8932
  value: function () {
8858
- var _updateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46(message, userId, options) {
8933
+ var _updateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee47(message, userId, options) {
8859
8934
  var clonedMessage, reservedMessageFields;
8860
- return _regeneratorRuntime.wrap(function _callee46$(_context46) {
8935
+ return _regeneratorRuntime.wrap(function _callee47$(_context47) {
8861
8936
  while (1) {
8862
- switch (_context46.prev = _context46.next) {
8937
+ switch (_context47.prev = _context47.next) {
8863
8938
  case 0:
8864
8939
  if (message.id) {
8865
- _context46.next = 2;
8940
+ _context47.next = 2;
8866
8941
  break;
8867
8942
  }
8868
8943
 
@@ -8899,23 +8974,23 @@ var StreamChat = /*#__PURE__*/function () {
8899
8974
  });
8900
8975
  }
8901
8976
 
8902
- _context46.next = 10;
8977
+ _context47.next = 10;
8903
8978
  return this.post(this.baseURL + "/messages/".concat(message.id), _objectSpread({
8904
8979
  message: clonedMessage
8905
8980
  }, options));
8906
8981
 
8907
8982
  case 10:
8908
- return _context46.abrupt("return", _context46.sent);
8983
+ return _context47.abrupt("return", _context47.sent);
8909
8984
 
8910
8985
  case 11:
8911
8986
  case "end":
8912
- return _context46.stop();
8987
+ return _context47.stop();
8913
8988
  }
8914
8989
  }
8915
- }, _callee46, this);
8990
+ }, _callee47, this);
8916
8991
  }));
8917
8992
 
8918
- function updateMessage(_x58, _x59, _x60) {
8993
+ function updateMessage(_x59, _x60, _x61) {
8919
8994
  return _updateMessage.apply(this, arguments);
8920
8995
  }
8921
8996
 
@@ -8938,14 +9013,14 @@ var StreamChat = /*#__PURE__*/function () {
8938
9013
  }, {
8939
9014
  key: "partialUpdateMessage",
8940
9015
  value: function () {
8941
- var _partialUpdateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee47(id, partialMessageObject, userId, options) {
9016
+ var _partialUpdateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee48(id, partialMessageObject, userId, options) {
8942
9017
  var user;
8943
- return _regeneratorRuntime.wrap(function _callee47$(_context47) {
9018
+ return _regeneratorRuntime.wrap(function _callee48$(_context48) {
8944
9019
  while (1) {
8945
- switch (_context47.prev = _context47.next) {
9020
+ switch (_context48.prev = _context48.next) {
8946
9021
  case 0:
8947
9022
  if (id) {
8948
- _context47.next = 2;
9023
+ _context48.next = 2;
8949
9024
  break;
8950
9025
  }
8951
9026
 
@@ -8960,23 +9035,23 @@ var StreamChat = /*#__PURE__*/function () {
8960
9035
  };
8961
9036
  }
8962
9037
 
8963
- _context47.next = 6;
9038
+ _context48.next = 6;
8964
9039
  return this.put(this.baseURL + "/messages/".concat(id), _objectSpread(_objectSpread(_objectSpread({}, partialMessageObject), options), {}, {
8965
9040
  user: user
8966
9041
  }));
8967
9042
 
8968
9043
  case 6:
8969
- return _context47.abrupt("return", _context47.sent);
9044
+ return _context48.abrupt("return", _context48.sent);
8970
9045
 
8971
9046
  case 7:
8972
9047
  case "end":
8973
- return _context47.stop();
9048
+ return _context48.stop();
8974
9049
  }
8975
9050
  }
8976
- }, _callee47, this);
9051
+ }, _callee48, this);
8977
9052
  }));
8978
9053
 
8979
- function partialUpdateMessage(_x61, _x62, _x63, _x64) {
9054
+ function partialUpdateMessage(_x62, _x63, _x64, _x65) {
8980
9055
  return _partialUpdateMessage.apply(this, arguments);
8981
9056
  }
8982
9057
 
@@ -8985,11 +9060,11 @@ var StreamChat = /*#__PURE__*/function () {
8985
9060
  }, {
8986
9061
  key: "deleteMessage",
8987
9062
  value: function () {
8988
- var _deleteMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee48(messageID, hardDelete) {
9063
+ var _deleteMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49(messageID, hardDelete) {
8989
9064
  var params;
8990
- return _regeneratorRuntime.wrap(function _callee48$(_context48) {
9065
+ return _regeneratorRuntime.wrap(function _callee49$(_context49) {
8991
9066
  while (1) {
8992
- switch (_context48.prev = _context48.next) {
9067
+ switch (_context49.prev = _context49.next) {
8993
9068
  case 0:
8994
9069
  params = {};
8995
9070
 
@@ -8999,21 +9074,21 @@ var StreamChat = /*#__PURE__*/function () {
8999
9074
  };
9000
9075
  }
9001
9076
 
9002
- _context48.next = 4;
9077
+ _context49.next = 4;
9003
9078
  return this.delete(this.baseURL + "/messages/".concat(messageID), params);
9004
9079
 
9005
9080
  case 4:
9006
- return _context48.abrupt("return", _context48.sent);
9081
+ return _context49.abrupt("return", _context49.sent);
9007
9082
 
9008
9083
  case 5:
9009
9084
  case "end":
9010
- return _context48.stop();
9085
+ return _context49.stop();
9011
9086
  }
9012
9087
  }
9013
- }, _callee48, this);
9088
+ }, _callee49, this);
9014
9089
  }));
9015
9090
 
9016
- function deleteMessage(_x65, _x66) {
9091
+ function deleteMessage(_x66, _x67) {
9017
9092
  return _deleteMessage.apply(this, arguments);
9018
9093
  }
9019
9094
 
@@ -9022,26 +9097,26 @@ var StreamChat = /*#__PURE__*/function () {
9022
9097
  }, {
9023
9098
  key: "getMessage",
9024
9099
  value: function () {
9025
- var _getMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49(messageID) {
9026
- return _regeneratorRuntime.wrap(function _callee49$(_context49) {
9100
+ var _getMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee50(messageID) {
9101
+ return _regeneratorRuntime.wrap(function _callee50$(_context50) {
9027
9102
  while (1) {
9028
- switch (_context49.prev = _context49.next) {
9103
+ switch (_context50.prev = _context50.next) {
9029
9104
  case 0:
9030
- _context49.next = 2;
9105
+ _context50.next = 2;
9031
9106
  return this.get(this.baseURL + "/messages/".concat(messageID));
9032
9107
 
9033
9108
  case 2:
9034
- return _context49.abrupt("return", _context49.sent);
9109
+ return _context50.abrupt("return", _context50.sent);
9035
9110
 
9036
9111
  case 3:
9037
9112
  case "end":
9038
- return _context49.stop();
9113
+ return _context50.stop();
9039
9114
  }
9040
9115
  }
9041
- }, _callee49, this);
9116
+ }, _callee50, this);
9042
9117
  }));
9043
9118
 
9044
- function getMessage(_x67) {
9119
+ function getMessage(_x68) {
9045
9120
  return _getMessage.apply(this, arguments);
9046
9121
  }
9047
9122
 
@@ -9050,7 +9125,7 @@ var StreamChat = /*#__PURE__*/function () {
9050
9125
  }, {
9051
9126
  key: "getUserAgent",
9052
9127
  value: function getUserAgent() {
9053
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "5.1.2");
9128
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "5.5.0");
9054
9129
  }
9055
9130
  }, {
9056
9131
  key: "setUserAgent",
@@ -9245,28 +9320,28 @@ var StreamChat = /*#__PURE__*/function () {
9245
9320
  }, {
9246
9321
  key: "sendUserCustomEvent",
9247
9322
  value: function () {
9248
- var _sendUserCustomEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee50(targetUserID, event) {
9249
- return _regeneratorRuntime.wrap(function _callee50$(_context50) {
9323
+ var _sendUserCustomEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee51(targetUserID, event) {
9324
+ return _regeneratorRuntime.wrap(function _callee51$(_context51) {
9250
9325
  while (1) {
9251
- switch (_context50.prev = _context50.next) {
9326
+ switch (_context51.prev = _context51.next) {
9252
9327
  case 0:
9253
- _context50.next = 2;
9328
+ _context51.next = 2;
9254
9329
  return this.post("".concat(this.baseURL, "/users/").concat(targetUserID, "/event"), {
9255
9330
  event: event
9256
9331
  });
9257
9332
 
9258
9333
  case 2:
9259
- return _context50.abrupt("return", _context50.sent);
9334
+ return _context51.abrupt("return", _context51.sent);
9260
9335
 
9261
9336
  case 3:
9262
9337
  case "end":
9263
- return _context50.stop();
9338
+ return _context51.stop();
9264
9339
  }
9265
9340
  }
9266
- }, _callee50, this);
9341
+ }, _callee51, this);
9267
9342
  }));
9268
9343
 
9269
- function sendUserCustomEvent(_x68, _x69) {
9344
+ function sendUserCustomEvent(_x69, _x70) {
9270
9345
  return _sendUserCustomEvent.apply(this, arguments);
9271
9346
  }
9272
9347
 
@@ -9308,6 +9383,11 @@ var StreamChat = /*#__PURE__*/function () {
9308
9383
 
9309
9384
  return this.post("".concat(this.baseURL, "/export_channels"), payload);
9310
9385
  }
9386
+ }, {
9387
+ key: "exportUsers",
9388
+ value: function exportUsers(request) {
9389
+ return this.post("".concat(this.baseURL, "/export/users"), request);
9390
+ }
9311
9391
  }, {
9312
9392
  key: "exportChannel",
9313
9393
  value: function exportChannel(request, options) {
@@ -9329,32 +9409,32 @@ var StreamChat = /*#__PURE__*/function () {
9329
9409
  }, {
9330
9410
  key: "createSegment",
9331
9411
  value: function () {
9332
- var _createSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee51(params) {
9412
+ var _createSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee52(params) {
9333
9413
  var _yield$this$post, segment;
9334
9414
 
9335
- return _regeneratorRuntime.wrap(function _callee51$(_context51) {
9415
+ return _regeneratorRuntime.wrap(function _callee52$(_context52) {
9336
9416
  while (1) {
9337
- switch (_context51.prev = _context51.next) {
9417
+ switch (_context52.prev = _context52.next) {
9338
9418
  case 0:
9339
- _context51.next = 2;
9419
+ _context52.next = 2;
9340
9420
  return this.post(this.baseURL + "/segments", {
9341
9421
  segment: params
9342
9422
  });
9343
9423
 
9344
9424
  case 2:
9345
- _yield$this$post = _context51.sent;
9425
+ _yield$this$post = _context52.sent;
9346
9426
  segment = _yield$this$post.segment;
9347
- return _context51.abrupt("return", segment);
9427
+ return _context52.abrupt("return", segment);
9348
9428
 
9349
9429
  case 5:
9350
9430
  case "end":
9351
- return _context51.stop();
9431
+ return _context52.stop();
9352
9432
  }
9353
9433
  }
9354
- }, _callee51, this);
9434
+ }, _callee52, this);
9355
9435
  }));
9356
9436
 
9357
- function createSegment(_x70) {
9437
+ function createSegment(_x71) {
9358
9438
  return _createSegment.apply(this, arguments);
9359
9439
  }
9360
9440
 
@@ -9371,30 +9451,30 @@ var StreamChat = /*#__PURE__*/function () {
9371
9451
  }, {
9372
9452
  key: "getSegment",
9373
9453
  value: function () {
9374
- var _getSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee52(id) {
9454
+ var _getSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee53(id) {
9375
9455
  var _yield$this$get, segment;
9376
9456
 
9377
- return _regeneratorRuntime.wrap(function _callee52$(_context52) {
9457
+ return _regeneratorRuntime.wrap(function _callee53$(_context53) {
9378
9458
  while (1) {
9379
- switch (_context52.prev = _context52.next) {
9459
+ switch (_context53.prev = _context53.next) {
9380
9460
  case 0:
9381
- _context52.next = 2;
9461
+ _context53.next = 2;
9382
9462
  return this.get(this.baseURL + "/segments/".concat(id));
9383
9463
 
9384
9464
  case 2:
9385
- _yield$this$get = _context52.sent;
9465
+ _yield$this$get = _context53.sent;
9386
9466
  segment = _yield$this$get.segment;
9387
- return _context52.abrupt("return", segment);
9467
+ return _context53.abrupt("return", segment);
9388
9468
 
9389
9469
  case 5:
9390
9470
  case "end":
9391
- return _context52.stop();
9471
+ return _context53.stop();
9392
9472
  }
9393
9473
  }
9394
- }, _callee52, this);
9474
+ }, _callee53, this);
9395
9475
  }));
9396
9476
 
9397
- function getSegment(_x71) {
9477
+ function getSegment(_x72) {
9398
9478
  return _getSegment.apply(this, arguments);
9399
9479
  }
9400
9480
 
@@ -9410,30 +9490,30 @@ var StreamChat = /*#__PURE__*/function () {
9410
9490
  }, {
9411
9491
  key: "listSegments",
9412
9492
  value: function () {
9413
- var _listSegments = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee53(options) {
9493
+ var _listSegments = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee54(options) {
9414
9494
  var _yield$this$get2, segments;
9415
9495
 
9416
- return _regeneratorRuntime.wrap(function _callee53$(_context53) {
9496
+ return _regeneratorRuntime.wrap(function _callee54$(_context54) {
9417
9497
  while (1) {
9418
- switch (_context53.prev = _context53.next) {
9498
+ switch (_context54.prev = _context54.next) {
9419
9499
  case 0:
9420
- _context53.next = 2;
9500
+ _context54.next = 2;
9421
9501
  return this.get(this.baseURL + "/segments", options);
9422
9502
 
9423
9503
  case 2:
9424
- _yield$this$get2 = _context53.sent;
9504
+ _yield$this$get2 = _context54.sent;
9425
9505
  segments = _yield$this$get2.segments;
9426
- return _context53.abrupt("return", segments);
9506
+ return _context54.abrupt("return", segments);
9427
9507
 
9428
9508
  case 5:
9429
9509
  case "end":
9430
- return _context53.stop();
9510
+ return _context54.stop();
9431
9511
  }
9432
9512
  }
9433
- }, _callee53, this);
9513
+ }, _callee54, this);
9434
9514
  }));
9435
9515
 
9436
- function listSegments(_x72) {
9516
+ function listSegments(_x73) {
9437
9517
  return _listSegments.apply(this, arguments);
9438
9518
  }
9439
9519
 
@@ -9451,32 +9531,32 @@ var StreamChat = /*#__PURE__*/function () {
9451
9531
  }, {
9452
9532
  key: "updateSegment",
9453
9533
  value: function () {
9454
- var _updateSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee54(id, params) {
9534
+ var _updateSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee55(id, params) {
9455
9535
  var _yield$this$put, segment;
9456
9536
 
9457
- return _regeneratorRuntime.wrap(function _callee54$(_context54) {
9537
+ return _regeneratorRuntime.wrap(function _callee55$(_context55) {
9458
9538
  while (1) {
9459
- switch (_context54.prev = _context54.next) {
9539
+ switch (_context55.prev = _context55.next) {
9460
9540
  case 0:
9461
- _context54.next = 2;
9541
+ _context55.next = 2;
9462
9542
  return this.put(this.baseURL + "/segments/".concat(id), {
9463
9543
  segment: params
9464
9544
  });
9465
9545
 
9466
9546
  case 2:
9467
- _yield$this$put = _context54.sent;
9547
+ _yield$this$put = _context55.sent;
9468
9548
  segment = _yield$this$put.segment;
9469
- return _context54.abrupt("return", segment);
9549
+ return _context55.abrupt("return", segment);
9470
9550
 
9471
9551
  case 5:
9472
9552
  case "end":
9473
- return _context54.stop();
9553
+ return _context55.stop();
9474
9554
  }
9475
9555
  }
9476
- }, _callee54, this);
9556
+ }, _callee55, this);
9477
9557
  }));
9478
9558
 
9479
- function updateSegment(_x73, _x74) {
9559
+ function updateSegment(_x74, _x75) {
9480
9560
  return _updateSegment.apply(this, arguments);
9481
9561
  }
9482
9562
 
@@ -9493,22 +9573,22 @@ var StreamChat = /*#__PURE__*/function () {
9493
9573
  }, {
9494
9574
  key: "deleteSegment",
9495
9575
  value: function () {
9496
- var _deleteSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee55(id) {
9497
- return _regeneratorRuntime.wrap(function _callee55$(_context55) {
9576
+ var _deleteSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee56(id) {
9577
+ return _regeneratorRuntime.wrap(function _callee56$(_context56) {
9498
9578
  while (1) {
9499
- switch (_context55.prev = _context55.next) {
9579
+ switch (_context56.prev = _context56.next) {
9500
9580
  case 0:
9501
- return _context55.abrupt("return", this.delete(this.baseURL + "/segments/".concat(id)));
9581
+ return _context56.abrupt("return", this.delete(this.baseURL + "/segments/".concat(id)));
9502
9582
 
9503
9583
  case 1:
9504
9584
  case "end":
9505
- return _context55.stop();
9585
+ return _context56.stop();
9506
9586
  }
9507
9587
  }
9508
- }, _callee55, this);
9588
+ }, _callee56, this);
9509
9589
  }));
9510
9590
 
9511
- function deleteSegment(_x75) {
9591
+ function deleteSegment(_x76) {
9512
9592
  return _deleteSegment.apply(this, arguments);
9513
9593
  }
9514
9594
 
@@ -9525,32 +9605,32 @@ var StreamChat = /*#__PURE__*/function () {
9525
9605
  }, {
9526
9606
  key: "createCampaign",
9527
9607
  value: function () {
9528
- var _createCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee56(params) {
9608
+ var _createCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee57(params) {
9529
9609
  var _yield$this$post2, campaign;
9530
9610
 
9531
- return _regeneratorRuntime.wrap(function _callee56$(_context56) {
9611
+ return _regeneratorRuntime.wrap(function _callee57$(_context57) {
9532
9612
  while (1) {
9533
- switch (_context56.prev = _context56.next) {
9613
+ switch (_context57.prev = _context57.next) {
9534
9614
  case 0:
9535
- _context56.next = 2;
9615
+ _context57.next = 2;
9536
9616
  return this.post(this.baseURL + "/campaigns", {
9537
9617
  campaign: params
9538
9618
  });
9539
9619
 
9540
9620
  case 2:
9541
- _yield$this$post2 = _context56.sent;
9621
+ _yield$this$post2 = _context57.sent;
9542
9622
  campaign = _yield$this$post2.campaign;
9543
- return _context56.abrupt("return", campaign);
9623
+ return _context57.abrupt("return", campaign);
9544
9624
 
9545
9625
  case 5:
9546
9626
  case "end":
9547
- return _context56.stop();
9627
+ return _context57.stop();
9548
9628
  }
9549
9629
  }
9550
- }, _callee56, this);
9630
+ }, _callee57, this);
9551
9631
  }));
9552
9632
 
9553
- function createCampaign(_x76) {
9633
+ function createCampaign(_x77) {
9554
9634
  return _createCampaign.apply(this, arguments);
9555
9635
  }
9556
9636
 
@@ -9567,30 +9647,30 @@ var StreamChat = /*#__PURE__*/function () {
9567
9647
  }, {
9568
9648
  key: "getCampaign",
9569
9649
  value: function () {
9570
- var _getCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee57(id) {
9650
+ var _getCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee58(id) {
9571
9651
  var _yield$this$get3, campaign;
9572
9652
 
9573
- return _regeneratorRuntime.wrap(function _callee57$(_context57) {
9653
+ return _regeneratorRuntime.wrap(function _callee58$(_context58) {
9574
9654
  while (1) {
9575
- switch (_context57.prev = _context57.next) {
9655
+ switch (_context58.prev = _context58.next) {
9576
9656
  case 0:
9577
- _context57.next = 2;
9657
+ _context58.next = 2;
9578
9658
  return this.get(this.baseURL + "/campaigns/".concat(id));
9579
9659
 
9580
9660
  case 2:
9581
- _yield$this$get3 = _context57.sent;
9661
+ _yield$this$get3 = _context58.sent;
9582
9662
  campaign = _yield$this$get3.campaign;
9583
- return _context57.abrupt("return", campaign);
9663
+ return _context58.abrupt("return", campaign);
9584
9664
 
9585
9665
  case 5:
9586
9666
  case "end":
9587
- return _context57.stop();
9667
+ return _context58.stop();
9588
9668
  }
9589
9669
  }
9590
- }, _callee57, this);
9670
+ }, _callee58, this);
9591
9671
  }));
9592
9672
 
9593
- function getCampaign(_x77) {
9673
+ function getCampaign(_x78) {
9594
9674
  return _getCampaign.apply(this, arguments);
9595
9675
  }
9596
9676
 
@@ -9606,30 +9686,30 @@ var StreamChat = /*#__PURE__*/function () {
9606
9686
  }, {
9607
9687
  key: "listCampaigns",
9608
9688
  value: function () {
9609
- var _listCampaigns = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee58(options) {
9689
+ var _listCampaigns = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee59(options) {
9610
9690
  var _yield$this$get4, campaigns;
9611
9691
 
9612
- return _regeneratorRuntime.wrap(function _callee58$(_context58) {
9692
+ return _regeneratorRuntime.wrap(function _callee59$(_context59) {
9613
9693
  while (1) {
9614
- switch (_context58.prev = _context58.next) {
9694
+ switch (_context59.prev = _context59.next) {
9615
9695
  case 0:
9616
- _context58.next = 2;
9696
+ _context59.next = 2;
9617
9697
  return this.get(this.baseURL + "/campaigns", options);
9618
9698
 
9619
9699
  case 2:
9620
- _yield$this$get4 = _context58.sent;
9700
+ _yield$this$get4 = _context59.sent;
9621
9701
  campaigns = _yield$this$get4.campaigns;
9622
- return _context58.abrupt("return", campaigns);
9702
+ return _context59.abrupt("return", campaigns);
9623
9703
 
9624
9704
  case 5:
9625
9705
  case "end":
9626
- return _context58.stop();
9706
+ return _context59.stop();
9627
9707
  }
9628
9708
  }
9629
- }, _callee58, this);
9709
+ }, _callee59, this);
9630
9710
  }));
9631
9711
 
9632
- function listCampaigns(_x78) {
9712
+ function listCampaigns(_x79) {
9633
9713
  return _listCampaigns.apply(this, arguments);
9634
9714
  }
9635
9715
 
@@ -9647,32 +9727,32 @@ var StreamChat = /*#__PURE__*/function () {
9647
9727
  }, {
9648
9728
  key: "updateCampaign",
9649
9729
  value: function () {
9650
- var _updateCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee59(id, params) {
9730
+ var _updateCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee60(id, params) {
9651
9731
  var _yield$this$put2, campaign;
9652
9732
 
9653
- return _regeneratorRuntime.wrap(function _callee59$(_context59) {
9733
+ return _regeneratorRuntime.wrap(function _callee60$(_context60) {
9654
9734
  while (1) {
9655
- switch (_context59.prev = _context59.next) {
9735
+ switch (_context60.prev = _context60.next) {
9656
9736
  case 0:
9657
- _context59.next = 2;
9737
+ _context60.next = 2;
9658
9738
  return this.put(this.baseURL + "/campaigns/".concat(id), {
9659
9739
  campaign: params
9660
9740
  });
9661
9741
 
9662
9742
  case 2:
9663
- _yield$this$put2 = _context59.sent;
9743
+ _yield$this$put2 = _context60.sent;
9664
9744
  campaign = _yield$this$put2.campaign;
9665
- return _context59.abrupt("return", campaign);
9745
+ return _context60.abrupt("return", campaign);
9666
9746
 
9667
9747
  case 5:
9668
9748
  case "end":
9669
- return _context59.stop();
9749
+ return _context60.stop();
9670
9750
  }
9671
9751
  }
9672
- }, _callee59, this);
9752
+ }, _callee60, this);
9673
9753
  }));
9674
9754
 
9675
- function updateCampaign(_x79, _x80) {
9755
+ function updateCampaign(_x80, _x81) {
9676
9756
  return _updateCampaign.apply(this, arguments);
9677
9757
  }
9678
9758
 
@@ -9689,22 +9769,22 @@ var StreamChat = /*#__PURE__*/function () {
9689
9769
  }, {
9690
9770
  key: "deleteCampaign",
9691
9771
  value: function () {
9692
- var _deleteCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee60(id) {
9693
- return _regeneratorRuntime.wrap(function _callee60$(_context60) {
9772
+ var _deleteCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee61(id) {
9773
+ return _regeneratorRuntime.wrap(function _callee61$(_context61) {
9694
9774
  while (1) {
9695
- switch (_context60.prev = _context60.next) {
9775
+ switch (_context61.prev = _context61.next) {
9696
9776
  case 0:
9697
- return _context60.abrupt("return", this.delete(this.baseURL + "/campaigns/".concat(id)));
9777
+ return _context61.abrupt("return", this.delete(this.baseURL + "/campaigns/".concat(id)));
9698
9778
 
9699
9779
  case 1:
9700
9780
  case "end":
9701
- return _context60.stop();
9781
+ return _context61.stop();
9702
9782
  }
9703
9783
  }
9704
- }, _callee60, this);
9784
+ }, _callee61, this);
9705
9785
  }));
9706
9786
 
9707
- function deleteCampaign(_x81) {
9787
+ function deleteCampaign(_x82) {
9708
9788
  return _deleteCampaign.apply(this, arguments);
9709
9789
  }
9710
9790
 
@@ -9722,33 +9802,33 @@ var StreamChat = /*#__PURE__*/function () {
9722
9802
  }, {
9723
9803
  key: "scheduleCampaign",
9724
9804
  value: function () {
9725
- var _scheduleCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee61(id, params) {
9805
+ var _scheduleCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee62(id, params) {
9726
9806
  var sendAt, _yield$this$patch, campaign;
9727
9807
 
9728
- return _regeneratorRuntime.wrap(function _callee61$(_context61) {
9808
+ return _regeneratorRuntime.wrap(function _callee62$(_context62) {
9729
9809
  while (1) {
9730
- switch (_context61.prev = _context61.next) {
9810
+ switch (_context62.prev = _context62.next) {
9731
9811
  case 0:
9732
9812
  sendAt = params.sendAt;
9733
- _context61.next = 3;
9813
+ _context62.next = 3;
9734
9814
  return this.patch(this.baseURL + "/campaigns/".concat(id, "/schedule"), {
9735
9815
  send_at: sendAt
9736
9816
  });
9737
9817
 
9738
9818
  case 3:
9739
- _yield$this$patch = _context61.sent;
9819
+ _yield$this$patch = _context62.sent;
9740
9820
  campaign = _yield$this$patch.campaign;
9741
- return _context61.abrupt("return", campaign);
9821
+ return _context62.abrupt("return", campaign);
9742
9822
 
9743
9823
  case 6:
9744
9824
  case "end":
9745
- return _context61.stop();
9825
+ return _context62.stop();
9746
9826
  }
9747
9827
  }
9748
- }, _callee61, this);
9828
+ }, _callee62, this);
9749
9829
  }));
9750
9830
 
9751
- function scheduleCampaign(_x82, _x83) {
9831
+ function scheduleCampaign(_x83, _x84) {
9752
9832
  return _scheduleCampaign.apply(this, arguments);
9753
9833
  }
9754
9834
 
@@ -9765,30 +9845,30 @@ var StreamChat = /*#__PURE__*/function () {
9765
9845
  }, {
9766
9846
  key: "stopCampaign",
9767
9847
  value: function () {
9768
- var _stopCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee62(id) {
9848
+ var _stopCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee63(id) {
9769
9849
  var _yield$this$patch2, campaign;
9770
9850
 
9771
- return _regeneratorRuntime.wrap(function _callee62$(_context62) {
9851
+ return _regeneratorRuntime.wrap(function _callee63$(_context63) {
9772
9852
  while (1) {
9773
- switch (_context62.prev = _context62.next) {
9853
+ switch (_context63.prev = _context63.next) {
9774
9854
  case 0:
9775
- _context62.next = 2;
9855
+ _context63.next = 2;
9776
9856
  return this.patch(this.baseURL + "/campaigns/".concat(id, "/stop"));
9777
9857
 
9778
9858
  case 2:
9779
- _yield$this$patch2 = _context62.sent;
9859
+ _yield$this$patch2 = _context63.sent;
9780
9860
  campaign = _yield$this$patch2.campaign;
9781
- return _context62.abrupt("return", campaign);
9861
+ return _context63.abrupt("return", campaign);
9782
9862
 
9783
9863
  case 5:
9784
9864
  case "end":
9785
- return _context62.stop();
9865
+ return _context63.stop();
9786
9866
  }
9787
9867
  }
9788
- }, _callee62, this);
9868
+ }, _callee63, this);
9789
9869
  }));
9790
9870
 
9791
- function stopCampaign(_x84) {
9871
+ function stopCampaign(_x85) {
9792
9872
  return _stopCampaign.apply(this, arguments);
9793
9873
  }
9794
9874
 
@@ -9805,30 +9885,30 @@ var StreamChat = /*#__PURE__*/function () {
9805
9885
  }, {
9806
9886
  key: "resumeCampaign",
9807
9887
  value: function () {
9808
- var _resumeCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee63(id) {
9888
+ var _resumeCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee64(id) {
9809
9889
  var _yield$this$patch3, campaign;
9810
9890
 
9811
- return _regeneratorRuntime.wrap(function _callee63$(_context63) {
9891
+ return _regeneratorRuntime.wrap(function _callee64$(_context64) {
9812
9892
  while (1) {
9813
- switch (_context63.prev = _context63.next) {
9893
+ switch (_context64.prev = _context64.next) {
9814
9894
  case 0:
9815
- _context63.next = 2;
9895
+ _context64.next = 2;
9816
9896
  return this.patch(this.baseURL + "/campaigns/".concat(id, "/resume"));
9817
9897
 
9818
9898
  case 2:
9819
- _yield$this$patch3 = _context63.sent;
9899
+ _yield$this$patch3 = _context64.sent;
9820
9900
  campaign = _yield$this$patch3.campaign;
9821
- return _context63.abrupt("return", campaign);
9901
+ return _context64.abrupt("return", campaign);
9822
9902
 
9823
9903
  case 5:
9824
9904
  case "end":
9825
- return _context63.stop();
9905
+ return _context64.stop();
9826
9906
  }
9827
9907
  }
9828
- }, _callee63, this);
9908
+ }, _callee64, this);
9829
9909
  }));
9830
9910
 
9831
- function resumeCampaign(_x85) {
9911
+ function resumeCampaign(_x86) {
9832
9912
  return _resumeCampaign.apply(this, arguments);
9833
9913
  }
9834
9914
 
@@ -9845,33 +9925,33 @@ var StreamChat = /*#__PURE__*/function () {
9845
9925
  }, {
9846
9926
  key: "testCampaign",
9847
9927
  value: function () {
9848
- var _testCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee64(id, params) {
9928
+ var _testCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee65(id, params) {
9849
9929
  var users, _yield$this$post3, campaign;
9850
9930
 
9851
- return _regeneratorRuntime.wrap(function _callee64$(_context64) {
9931
+ return _regeneratorRuntime.wrap(function _callee65$(_context65) {
9852
9932
  while (1) {
9853
- switch (_context64.prev = _context64.next) {
9933
+ switch (_context65.prev = _context65.next) {
9854
9934
  case 0:
9855
9935
  users = params.users;
9856
- _context64.next = 3;
9936
+ _context65.next = 3;
9857
9937
  return this.post(this.baseURL + "/campaigns/".concat(id, "/test"), {
9858
9938
  users: users
9859
9939
  });
9860
9940
 
9861
9941
  case 3:
9862
- _yield$this$post3 = _context64.sent;
9942
+ _yield$this$post3 = _context65.sent;
9863
9943
  campaign = _yield$this$post3.campaign;
9864
- return _context64.abrupt("return", campaign);
9944
+ return _context65.abrupt("return", campaign);
9865
9945
 
9866
9946
  case 6:
9867
9947
  case "end":
9868
- return _context64.stop();
9948
+ return _context65.stop();
9869
9949
  }
9870
9950
  }
9871
- }, _callee64, this);
9951
+ }, _callee65, this);
9872
9952
  }));
9873
9953
 
9874
- function testCampaign(_x86, _x87) {
9954
+ function testCampaign(_x87, _x88) {
9875
9955
  return _testCampaign.apply(this, arguments);
9876
9956
  }
9877
9957
 
@@ -9887,24 +9967,24 @@ var StreamChat = /*#__PURE__*/function () {
9887
9967
  }, {
9888
9968
  key: "enrichURL",
9889
9969
  value: function () {
9890
- var _enrichURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee65(url) {
9891
- return _regeneratorRuntime.wrap(function _callee65$(_context65) {
9970
+ var _enrichURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee66(url) {
9971
+ return _regeneratorRuntime.wrap(function _callee66$(_context66) {
9892
9972
  while (1) {
9893
- switch (_context65.prev = _context65.next) {
9973
+ switch (_context66.prev = _context66.next) {
9894
9974
  case 0:
9895
- return _context65.abrupt("return", this.get(this.baseURL + "/og", {
9975
+ return _context66.abrupt("return", this.get(this.baseURL + "/og", {
9896
9976
  url: url
9897
9977
  }));
9898
9978
 
9899
9979
  case 1:
9900
9980
  case "end":
9901
- return _context65.stop();
9981
+ return _context66.stop();
9902
9982
  }
9903
9983
  }
9904
- }, _callee65, this);
9984
+ }, _callee66, this);
9905
9985
  }));
9906
9986
 
9907
- function enrichURL(_x88) {
9987
+ function enrichURL(_x89) {
9908
9988
  return _enrichURL.apply(this, arguments);
9909
9989
  }
9910
9990
 
@@ -9921,22 +10001,22 @@ var StreamChat = /*#__PURE__*/function () {
9921
10001
  }, {
9922
10002
  key: "getTask",
9923
10003
  value: function () {
9924
- var _getTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee66(id) {
9925
- return _regeneratorRuntime.wrap(function _callee66$(_context66) {
10004
+ var _getTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee67(id) {
10005
+ return _regeneratorRuntime.wrap(function _callee67$(_context67) {
9926
10006
  while (1) {
9927
- switch (_context66.prev = _context66.next) {
10007
+ switch (_context67.prev = _context67.next) {
9928
10008
  case 0:
9929
- return _context66.abrupt("return", this.get("".concat(this.baseURL, "/tasks/").concat(id)));
10009
+ return _context67.abrupt("return", this.get("".concat(this.baseURL, "/tasks/").concat(id)));
9930
10010
 
9931
10011
  case 1:
9932
10012
  case "end":
9933
- return _context66.stop();
10013
+ return _context67.stop();
9934
10014
  }
9935
10015
  }
9936
- }, _callee66, this);
10016
+ }, _callee67, this);
9937
10017
  }));
9938
10018
 
9939
- function getTask(_x89) {
10019
+ function getTask(_x90) {
9940
10020
  return _getTask.apply(this, arguments);
9941
10021
  }
9942
10022
 
@@ -9954,31 +10034,31 @@ var StreamChat = /*#__PURE__*/function () {
9954
10034
  }, {
9955
10035
  key: "deleteChannels",
9956
10036
  value: function () {
9957
- var _deleteChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee67(cids) {
10037
+ var _deleteChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee68(cids) {
9958
10038
  var options,
9959
- _args67 = arguments;
9960
- return _regeneratorRuntime.wrap(function _callee67$(_context67) {
10039
+ _args68 = arguments;
10040
+ return _regeneratorRuntime.wrap(function _callee68$(_context68) {
9961
10041
  while (1) {
9962
- switch (_context67.prev = _context67.next) {
10042
+ switch (_context68.prev = _context68.next) {
9963
10043
  case 0:
9964
- options = _args67.length > 1 && _args67[1] !== undefined ? _args67[1] : {};
9965
- _context67.next = 3;
10044
+ options = _args68.length > 1 && _args68[1] !== undefined ? _args68[1] : {};
10045
+ _context68.next = 3;
9966
10046
  return this.post(this.baseURL + "/channels/delete", _objectSpread({
9967
10047
  cids: cids
9968
10048
  }, options));
9969
10049
 
9970
10050
  case 3:
9971
- return _context67.abrupt("return", _context67.sent);
10051
+ return _context68.abrupt("return", _context68.sent);
9972
10052
 
9973
10053
  case 4:
9974
10054
  case "end":
9975
- return _context67.stop();
10055
+ return _context68.stop();
9976
10056
  }
9977
10057
  }
9978
- }, _callee67, this);
10058
+ }, _callee68, this);
9979
10059
  }));
9980
10060
 
9981
- function deleteChannels(_x90) {
10061
+ function deleteChannels(_x91) {
9982
10062
  return _deleteChannels.apply(this, arguments);
9983
10063
  }
9984
10064
 
@@ -9996,13 +10076,13 @@ var StreamChat = /*#__PURE__*/function () {
9996
10076
  }, {
9997
10077
  key: "deleteUsers",
9998
10078
  value: function () {
9999
- var _deleteUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee68(user_ids, options) {
10000
- return _regeneratorRuntime.wrap(function _callee68$(_context68) {
10079
+ var _deleteUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee69(user_ids, options) {
10080
+ return _regeneratorRuntime.wrap(function _callee69$(_context69) {
10001
10081
  while (1) {
10002
- switch (_context68.prev = _context68.next) {
10082
+ switch (_context69.prev = _context69.next) {
10003
10083
  case 0:
10004
10084
  if (!((options === null || options === void 0 ? void 0 : options.user) !== 'soft' && (options === null || options === void 0 ? void 0 : options.user) !== 'hard')) {
10005
- _context68.next = 2;
10085
+ _context69.next = 2;
10006
10086
  break;
10007
10087
  }
10008
10088
 
@@ -10010,7 +10090,7 @@ var StreamChat = /*#__PURE__*/function () {
10010
10090
 
10011
10091
  case 2:
10012
10092
  if (!(options.messages !== undefined && options.messages !== 'soft' && options.messages !== 'hard')) {
10013
- _context68.next = 4;
10093
+ _context69.next = 4;
10014
10094
  break;
10015
10095
  }
10016
10096
 
@@ -10018,35 +10098,160 @@ var StreamChat = /*#__PURE__*/function () {
10018
10098
 
10019
10099
  case 4:
10020
10100
  if (!(options.conversations !== undefined && options.conversations !== 'soft' && options.conversations !== 'hard')) {
10021
- _context68.next = 6;
10101
+ _context69.next = 6;
10022
10102
  break;
10023
10103
  }
10024
10104
 
10025
10105
  throw new Error('Invalid delete user options. conversations must be one of [soft hard]');
10026
10106
 
10027
10107
  case 6:
10028
- _context68.next = 8;
10108
+ _context69.next = 8;
10029
10109
  return this.post(this.baseURL + "/users/delete", _objectSpread({
10030
10110
  user_ids: user_ids
10031
10111
  }, options));
10032
10112
 
10033
10113
  case 8:
10034
- return _context68.abrupt("return", _context68.sent);
10114
+ return _context69.abrupt("return", _context69.sent);
10035
10115
 
10036
10116
  case 9:
10037
10117
  case "end":
10038
- return _context68.stop();
10118
+ return _context69.stop();
10039
10119
  }
10040
10120
  }
10041
- }, _callee68, this);
10121
+ }, _callee69, this);
10042
10122
  }));
10043
10123
 
10044
- function deleteUsers(_x91, _x92) {
10124
+ function deleteUsers(_x92, _x93) {
10045
10125
  return _deleteUsers.apply(this, arguments);
10046
10126
  }
10047
10127
 
10048
10128
  return deleteUsers;
10049
10129
  }()
10130
+ /**
10131
+ * _createImport - Create an Import Task.
10132
+ *
10133
+ * Note: Do not use this.
10134
+ * It is present for internal usage only.
10135
+ * This function can, and will, break and/or be removed at any point in time.
10136
+ *
10137
+ * @private
10138
+ * @param {string} filename filename of uploaded data
10139
+ *
10140
+ * @return {APIResponse & CreateImportResponse} An ImportTask
10141
+ */
10142
+
10143
+ }, {
10144
+ key: "_createImport",
10145
+ value: function () {
10146
+ var _createImport2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee70(filename) {
10147
+ return _regeneratorRuntime.wrap(function _callee70$(_context70) {
10148
+ while (1) {
10149
+ switch (_context70.prev = _context70.next) {
10150
+ case 0:
10151
+ _context70.next = 2;
10152
+ return this.post(this.baseURL + "/imports", {
10153
+ filename: filename
10154
+ });
10155
+
10156
+ case 2:
10157
+ return _context70.abrupt("return", _context70.sent);
10158
+
10159
+ case 3:
10160
+ case "end":
10161
+ return _context70.stop();
10162
+ }
10163
+ }
10164
+ }, _callee70, this);
10165
+ }));
10166
+
10167
+ function _createImport(_x94) {
10168
+ return _createImport2.apply(this, arguments);
10169
+ }
10170
+
10171
+ return _createImport;
10172
+ }()
10173
+ /**
10174
+ * _getImport - Get an Import Task.
10175
+ *
10176
+ * Note: Do not use this.
10177
+ * It is present for internal usage only.
10178
+ * This function can, and will, break and/or be removed at any point in time.
10179
+ *
10180
+ * @private
10181
+ * @param {string} id id of Import Task
10182
+ *
10183
+ * @return {APIResponse & GetImportResponse} An ImportTask
10184
+ */
10185
+
10186
+ }, {
10187
+ key: "_getImport",
10188
+ value: function () {
10189
+ var _getImport2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee71(id) {
10190
+ return _regeneratorRuntime.wrap(function _callee71$(_context71) {
10191
+ while (1) {
10192
+ switch (_context71.prev = _context71.next) {
10193
+ case 0:
10194
+ _context71.next = 2;
10195
+ return this.get(this.baseURL + "/imports/".concat(id));
10196
+
10197
+ case 2:
10198
+ return _context71.abrupt("return", _context71.sent);
10199
+
10200
+ case 3:
10201
+ case "end":
10202
+ return _context71.stop();
10203
+ }
10204
+ }
10205
+ }, _callee71, this);
10206
+ }));
10207
+
10208
+ function _getImport(_x95) {
10209
+ return _getImport2.apply(this, arguments);
10210
+ }
10211
+
10212
+ return _getImport;
10213
+ }()
10214
+ /**
10215
+ * _listImports - Lists Import Tasks.
10216
+ *
10217
+ * Note: Do not use this.
10218
+ * It is present for internal usage only.
10219
+ * This function can, and will, break and/or be removed at any point in time.
10220
+ *
10221
+ * @private
10222
+ * @param {ListImportsPaginationOptions} options pagination options
10223
+ *
10224
+ * @return {APIResponse & ListImportsResponse} An ImportTask
10225
+ */
10226
+
10227
+ }, {
10228
+ key: "_listImports",
10229
+ value: function () {
10230
+ var _listImports2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee72(options) {
10231
+ return _regeneratorRuntime.wrap(function _callee72$(_context72) {
10232
+ while (1) {
10233
+ switch (_context72.prev = _context72.next) {
10234
+ case 0:
10235
+ _context72.next = 2;
10236
+ return this.get(this.baseURL + "/imports", options);
10237
+
10238
+ case 2:
10239
+ return _context72.abrupt("return", _context72.sent);
10240
+
10241
+ case 3:
10242
+ case "end":
10243
+ return _context72.stop();
10244
+ }
10245
+ }
10246
+ }, _callee72, this);
10247
+ }));
10248
+
10249
+ function _listImports(_x96) {
10250
+ return _listImports2.apply(this, arguments);
10251
+ }
10252
+
10253
+ return _listImports;
10254
+ }()
10050
10255
  }], [{
10051
10256
  key: "getInstance",
10052
10257
  value: function getInstance(key, secretOrOptions, options) {