stream-chat 6.5.1 → 6.7.1

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
@@ -15,6 +15,11 @@ import FormData from 'form-data';
15
15
  import WebSocket from 'isomorphic-ws';
16
16
  import jwt from 'jsonwebtoken';
17
17
  import crypto$1 from 'crypto';
18
+ import _assertThisInitialized from '@babel/runtime/helpers/assertThisInitialized';
19
+ import _inherits from '@babel/runtime/helpers/inherits';
20
+ import _possibleConstructorReturn from '@babel/runtime/helpers/possibleConstructorReturn';
21
+ import _getPrototypeOf from '@babel/runtime/helpers/getPrototypeOf';
22
+ import _wrapNativeSuper from '@babel/runtime/helpers/wrapNativeSuper';
18
23
 
19
24
  function isString$1(arrayOrString) {
20
25
  return typeof arrayOrString === 'string';
@@ -716,7 +721,9 @@ var ChannelState = /*#__PURE__*/function () {
716
721
  this.threads[messageToRemove.parent_id] = threadMessages;
717
722
  isRemoved = removed;
718
723
  } else {
719
- var messageSetIndex = this.findMessageSetIndex(messageToRemove);
724
+ var _messageToRemove$mess;
725
+
726
+ var messageSetIndex = (_messageToRemove$mess = messageToRemove.messageSetIndex) !== null && _messageToRemove$mess !== void 0 ? _messageToRemove$mess : this.findMessageSetIndex(messageToRemove);
720
727
 
721
728
  if (messageSetIndex !== -1) {
722
729
  var _this$removeMessageFr3 = this.removeMessageFromArray(this.messageSets[messageSetIndex].messages, messageToRemove),
@@ -1066,6 +1073,7 @@ var EVENT_MAP = {
1066
1073
  'user.deleted': true,
1067
1074
  'user.presence.changed': true,
1068
1075
  'user.unbanned': true,
1076
+ 'user.unread_message_reminder': true,
1069
1077
  'user.updated': true,
1070
1078
  'user.watching.start': true,
1071
1079
  'user.watching.stop': true,
@@ -3413,6 +3421,41 @@ var Channel = /*#__PURE__*/function () {
3413
3421
 
3414
3422
  return removeShadowBan;
3415
3423
  }()
3424
+ /**
3425
+ * createCall - creates a call for the current channel
3426
+ *
3427
+ * @param {CreateCallOptions} options
3428
+ * @returns {Promise<CreateCallResponse>}
3429
+ */
3430
+
3431
+ }, {
3432
+ key: "createCall",
3433
+ value: function () {
3434
+ var _createCall = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee38(options) {
3435
+ return _regeneratorRuntime.wrap(function _callee38$(_context38) {
3436
+ while (1) {
3437
+ switch (_context38.prev = _context38.next) {
3438
+ case 0:
3439
+ _context38.next = 2;
3440
+ return this.getClient().post(this._channelURL() + '/call', options);
3441
+
3442
+ case 2:
3443
+ return _context38.abrupt("return", _context38.sent);
3444
+
3445
+ case 3:
3446
+ case "end":
3447
+ return _context38.stop();
3448
+ }
3449
+ }
3450
+ }, _callee38, this);
3451
+ }));
3452
+
3453
+ function createCall(_x37) {
3454
+ return _createCall.apply(this, arguments);
3455
+ }
3456
+
3457
+ return createCall;
3458
+ }()
3416
3459
  /**
3417
3460
  * on - Listen to events on this channel.
3418
3461
  *
@@ -3495,7 +3538,7 @@ var Channel = /*#__PURE__*/function () {
3495
3538
  }, {
3496
3539
  key: "_handleChannelEvent",
3497
3540
  value: function _handleChannelEvent(event) {
3498
- var _event$user, _event$user2, _event$user3, _event$user5, _event$user6, _event$member, _event$user9;
3541
+ var _event$user, _event$user2, _event$user3, _event$user5, _event$user6, _event$channel, _event$member, _event$user9;
3499
3542
 
3500
3543
  var channel = this;
3501
3544
 
@@ -3610,7 +3653,22 @@ var Channel = /*#__PURE__*/function () {
3610
3653
  break;
3611
3654
 
3612
3655
  case 'channel.truncated':
3613
- channelState.clearMessages();
3656
+ if ((_event$channel = event.channel) !== null && _event$channel !== void 0 && _event$channel.truncated_at) {
3657
+ var truncatedAt = +new Date(event.channel.truncated_at);
3658
+ channelState.messageSets.forEach(function (messageSet, messageSetIndex) {
3659
+ messageSet.messages.forEach(function (_ref2) {
3660
+ var createdAt = _ref2.created_at,
3661
+ id = _ref2.id;
3662
+ if (truncatedAt > +createdAt) channelState.removeMessage({
3663
+ id: id,
3664
+ messageSetIndex: messageSetIndex
3665
+ });
3666
+ });
3667
+ });
3668
+ } else {
3669
+ channelState.clearMessages();
3670
+ }
3671
+
3614
3672
  channelState.unreadCount = 0; // system messages don't increment unread counts
3615
3673
 
3616
3674
  if (event.message) {
@@ -3640,11 +3698,11 @@ var Channel = /*#__PURE__*/function () {
3640
3698
 
3641
3699
  case 'channel.updated':
3642
3700
  if (event.channel) {
3643
- var _event$channel$hidden, _event$channel, _channel$data, _event$channel$own_ca, _event$channel2, _channel$data2;
3701
+ var _event$channel$hidden, _event$channel2, _channel$data, _event$channel$own_ca, _event$channel3, _channel$data2;
3644
3702
 
3645
3703
  channel.data = _objectSpread$5(_objectSpread$5({}, event.channel), {}, {
3646
- 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,
3647
- 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
3704
+ hidden: (_event$channel$hidden = (_event$channel2 = event.channel) === null || _event$channel2 === void 0 ? void 0 : _event$channel2.hidden) !== null && _event$channel$hidden !== void 0 ? _event$channel$hidden : (_channel$data = channel.data) === null || _channel$data === void 0 ? void 0 : _channel$data.hidden,
3705
+ own_capabilities: (_event$channel$own_ca = (_event$channel3 = event.channel) === null || _event$channel3 === void 0 ? void 0 : _event$channel3.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
3648
3706
  });
3649
3707
  }
3650
3708
 
@@ -5376,6 +5434,9 @@ function isWSFailure(err) {
5376
5434
  return false;
5377
5435
  }
5378
5436
  }
5437
+ function isErrorResponse(res) {
5438
+ return !res.status || res.status < 200 || 300 <= res.status;
5439
+ }
5379
5440
 
5380
5441
  function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
5381
5442
 
@@ -5753,6 +5814,83 @@ var WSConnectionFallback = /*#__PURE__*/function () {
5753
5814
  return WSConnectionFallback;
5754
5815
  }();
5755
5816
 
5817
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
5818
+
5819
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
5820
+
5821
+ /**
5822
+ * Utility Types
5823
+ */
5824
+
5825
+ /* Unknown Record */
5826
+ //alias to avoid breaking change
5827
+
5828
+ /**
5829
+ * Response Types
5830
+ */
5831
+ // Thumb URL(thumb_url) is added considering video attachments as the backend will return the thumbnail in the response.
5832
+
5833
+ /**
5834
+ * Option Types
5835
+ */
5836
+ // TODO: rename to UpdateChannelOptions in the next major update and use it in channel._update and/or channel.update
5837
+
5838
+ /** @deprecated use MarkChannelsReadOptions instead */
5839
+ // TODO: rename to UpdateChannelTypeOptions in the next major update
5840
+
5841
+ /**
5842
+ * Event Types
5843
+ */
5844
+
5845
+ /**
5846
+ * Filter Types
5847
+ */
5848
+
5849
+ /**
5850
+ * Sort Types
5851
+ */
5852
+
5853
+ /**
5854
+ * Base Types
5855
+ */
5856
+
5857
+ /*
5858
+ DeleteUserOptions specifies a collection of one or more `user_ids` to be deleted.
5859
+
5860
+ `user` soft|hard determines if the user needs to be hard- or soft-deleted, where hard-delete
5861
+ implies that all related objects (messages, flags, etc) will be hard-deleted as well.
5862
+ `conversations` soft|hard will delete any 1to1 channels that the user was a member of.
5863
+ `messages` soft-hard will delete any messages that the user has sent.
5864
+ `new_channel_owner_id` any channels owned by the hard-deleted user will be transferred to this user ID
5865
+ */
5866
+ var ErrorFromResponse = /*#__PURE__*/function (_Error) {
5867
+ _inherits(ErrorFromResponse, _Error);
5868
+
5869
+ var _super = _createSuper(ErrorFromResponse);
5870
+
5871
+ function ErrorFromResponse() {
5872
+ var _this;
5873
+
5874
+ _classCallCheck(this, ErrorFromResponse);
5875
+
5876
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
5877
+ args[_key] = arguments[_key];
5878
+ }
5879
+
5880
+ _this = _super.call.apply(_super, [this].concat(args));
5881
+
5882
+ _defineProperty(_assertThisInitialized(_this), "code", void 0);
5883
+
5884
+ _defineProperty(_assertThisInitialized(_this), "response", void 0);
5885
+
5886
+ _defineProperty(_assertThisInitialized(_this), "status", void 0);
5887
+
5888
+ return _this;
5889
+ }
5890
+
5891
+ return ErrorFromResponse;
5892
+ }( /*#__PURE__*/_wrapNativeSuper(Error));
5893
+
5756
5894
  var _excluded = ["created_at", "updated_at", "last_active", "online"];
5757
5895
 
5758
5896
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
@@ -6732,7 +6870,7 @@ var StreamChat = /*#__PURE__*/function () {
6732
6870
  'notification_template": 'notification handlebars template',
6733
6871
  'bundle_id': 'com.apple.your.app',
6734
6872
  'development': true
6735
- },
6873
+ },
6736
6874
  'firebase_config': {
6737
6875
  'server_key': 'server key from fcm',
6738
6876
  'notification_template': 'notification handlebars template',
@@ -7283,7 +7421,7 @@ var StreamChat = /*#__PURE__*/function () {
7283
7421
  key: "errorFromResponse",
7284
7422
  value: function errorFromResponse(response) {
7285
7423
  var err;
7286
- err = new Error("StreamChat error HTTP code: ".concat(response.status));
7424
+ err = new ErrorFromResponse("StreamChat error HTTP code: ".concat(response.status));
7287
7425
 
7288
7426
  if (response.data && response.data.code) {
7289
7427
  err = new Error("StreamChat error code ".concat(response.data.code, ": ").concat(response.data.message));
@@ -7299,7 +7437,7 @@ var StreamChat = /*#__PURE__*/function () {
7299
7437
  value: function handleResponse(response) {
7300
7438
  var data = response.data;
7301
7439
 
7302
- if ((response.status + '')[0] !== '2') {
7440
+ if (isErrorResponse(response)) {
7303
7441
  throw this.errorFromResponse(response);
7304
7442
  }
7305
7443
 
@@ -8919,6 +9057,45 @@ var StreamChat = /*#__PURE__*/function () {
8919
9057
 
8920
9058
  return unflagUser;
8921
9059
  }()
9060
+ /**
9061
+ * getCallToken - retrieves the auth token needed to join a call
9062
+ *
9063
+ * @param {string} callID
9064
+ * @param {object} options
9065
+ * @returns {Promise<GetCallTokenResponse>}
9066
+ */
9067
+
9068
+ }, {
9069
+ key: "getCallToken",
9070
+ value: function () {
9071
+ var _getCallToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42(callID) {
9072
+ var options,
9073
+ _args42 = arguments;
9074
+ return _regeneratorRuntime.wrap(function _callee42$(_context42) {
9075
+ while (1) {
9076
+ switch (_context42.prev = _context42.next) {
9077
+ case 0:
9078
+ options = _args42.length > 1 && _args42[1] !== undefined ? _args42[1] : {};
9079
+ _context42.next = 3;
9080
+ return this.post(this.baseURL + "/calls/".concat(callID), _objectSpread({}, options));
9081
+
9082
+ case 3:
9083
+ return _context42.abrupt("return", _context42.sent);
9084
+
9085
+ case 4:
9086
+ case "end":
9087
+ return _context42.stop();
9088
+ }
9089
+ }
9090
+ }, _callee42, this);
9091
+ }));
9092
+
9093
+ function getCallToken(_x55) {
9094
+ return _getCallToken.apply(this, arguments);
9095
+ }
9096
+
9097
+ return getCallToken;
9098
+ }()
8922
9099
  /**
8923
9100
  * _queryFlags - Query flags.
8924
9101
  *
@@ -8936,30 +9113,30 @@ var StreamChat = /*#__PURE__*/function () {
8936
9113
  }, {
8937
9114
  key: "_queryFlags",
8938
9115
  value: function () {
8939
- var _queryFlags2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42() {
9116
+ var _queryFlags2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee43() {
8940
9117
  var filterConditions,
8941
9118
  options,
8942
- _args42 = arguments;
8943
- return _regeneratorRuntime.wrap(function _callee42$(_context42) {
9119
+ _args43 = arguments;
9120
+ return _regeneratorRuntime.wrap(function _callee43$(_context43) {
8944
9121
  while (1) {
8945
- switch (_context42.prev = _context42.next) {
9122
+ switch (_context43.prev = _context43.next) {
8946
9123
  case 0:
8947
- filterConditions = _args42.length > 0 && _args42[0] !== undefined ? _args42[0] : {};
8948
- options = _args42.length > 1 && _args42[1] !== undefined ? _args42[1] : {};
8949
- _context42.next = 4;
9124
+ filterConditions = _args43.length > 0 && _args43[0] !== undefined ? _args43[0] : {};
9125
+ options = _args43.length > 1 && _args43[1] !== undefined ? _args43[1] : {};
9126
+ _context43.next = 4;
8950
9127
  return this.post(this.baseURL + '/moderation/flags', _objectSpread({
8951
9128
  filter_conditions: filterConditions
8952
9129
  }, options));
8953
9130
 
8954
9131
  case 4:
8955
- return _context42.abrupt("return", _context42.sent);
9132
+ return _context43.abrupt("return", _context43.sent);
8956
9133
 
8957
9134
  case 5:
8958
9135
  case "end":
8959
- return _context42.stop();
9136
+ return _context43.stop();
8960
9137
  }
8961
9138
  }
8962
- }, _callee42, this);
9139
+ }, _callee43, this);
8963
9140
  }));
8964
9141
 
8965
9142
  function _queryFlags() {
@@ -8985,30 +9162,30 @@ var StreamChat = /*#__PURE__*/function () {
8985
9162
  }, {
8986
9163
  key: "_queryFlagReports",
8987
9164
  value: function () {
8988
- var _queryFlagReports2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee43() {
9165
+ var _queryFlagReports2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44() {
8989
9166
  var filterConditions,
8990
9167
  options,
8991
- _args43 = arguments;
8992
- return _regeneratorRuntime.wrap(function _callee43$(_context43) {
9168
+ _args44 = arguments;
9169
+ return _regeneratorRuntime.wrap(function _callee44$(_context44) {
8993
9170
  while (1) {
8994
- switch (_context43.prev = _context43.next) {
9171
+ switch (_context44.prev = _context44.next) {
8995
9172
  case 0:
8996
- filterConditions = _args43.length > 0 && _args43[0] !== undefined ? _args43[0] : {};
8997
- options = _args43.length > 1 && _args43[1] !== undefined ? _args43[1] : {};
8998
- _context43.next = 4;
9173
+ filterConditions = _args44.length > 0 && _args44[0] !== undefined ? _args44[0] : {};
9174
+ options = _args44.length > 1 && _args44[1] !== undefined ? _args44[1] : {};
9175
+ _context44.next = 4;
8999
9176
  return this.post(this.baseURL + '/moderation/reports', _objectSpread({
9000
9177
  filter_conditions: filterConditions
9001
9178
  }, options));
9002
9179
 
9003
9180
  case 4:
9004
- return _context43.abrupt("return", _context43.sent);
9181
+ return _context44.abrupt("return", _context44.sent);
9005
9182
 
9006
9183
  case 5:
9007
9184
  case "end":
9008
- return _context43.stop();
9185
+ return _context44.stop();
9009
9186
  }
9010
9187
  }
9011
- }, _callee43, this);
9188
+ }, _callee44, this);
9012
9189
  }));
9013
9190
 
9014
9191
  function _queryFlagReports() {
@@ -9035,31 +9212,31 @@ var StreamChat = /*#__PURE__*/function () {
9035
9212
  }, {
9036
9213
  key: "_reviewFlagReport",
9037
9214
  value: function () {
9038
- var _reviewFlagReport2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44(id, reviewResult) {
9215
+ var _reviewFlagReport2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45(id, reviewResult) {
9039
9216
  var options,
9040
- _args44 = arguments;
9041
- return _regeneratorRuntime.wrap(function _callee44$(_context44) {
9217
+ _args45 = arguments;
9218
+ return _regeneratorRuntime.wrap(function _callee45$(_context45) {
9042
9219
  while (1) {
9043
- switch (_context44.prev = _context44.next) {
9220
+ switch (_context45.prev = _context45.next) {
9044
9221
  case 0:
9045
- options = _args44.length > 2 && _args44[2] !== undefined ? _args44[2] : {};
9046
- _context44.next = 3;
9222
+ options = _args45.length > 2 && _args45[2] !== undefined ? _args45[2] : {};
9223
+ _context45.next = 3;
9047
9224
  return this.patch(this.baseURL + "/moderation/reports/".concat(id), _objectSpread({
9048
9225
  review_result: reviewResult
9049
9226
  }, options));
9050
9227
 
9051
9228
  case 3:
9052
- return _context44.abrupt("return", _context44.sent);
9229
+ return _context45.abrupt("return", _context45.sent);
9053
9230
 
9054
9231
  case 4:
9055
9232
  case "end":
9056
- return _context44.stop();
9233
+ return _context45.stop();
9057
9234
  }
9058
9235
  }
9059
- }, _callee44, this);
9236
+ }, _callee45, this);
9060
9237
  }));
9061
9238
 
9062
- function _reviewFlagReport(_x55, _x56) {
9239
+ function _reviewFlagReport(_x56, _x57) {
9063
9240
  return _reviewFlagReport2.apply(this, arguments);
9064
9241
  }
9065
9242
 
@@ -9081,31 +9258,31 @@ var StreamChat = /*#__PURE__*/function () {
9081
9258
  }, {
9082
9259
  key: "_unblockMessage",
9083
9260
  value: function () {
9084
- var _unblockMessage2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45(targetMessageID) {
9261
+ var _unblockMessage2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46(targetMessageID) {
9085
9262
  var options,
9086
- _args45 = arguments;
9087
- return _regeneratorRuntime.wrap(function _callee45$(_context45) {
9263
+ _args46 = arguments;
9264
+ return _regeneratorRuntime.wrap(function _callee46$(_context46) {
9088
9265
  while (1) {
9089
- switch (_context45.prev = _context45.next) {
9266
+ switch (_context46.prev = _context46.next) {
9090
9267
  case 0:
9091
- options = _args45.length > 1 && _args45[1] !== undefined ? _args45[1] : {};
9092
- _context45.next = 3;
9268
+ options = _args46.length > 1 && _args46[1] !== undefined ? _args46[1] : {};
9269
+ _context46.next = 3;
9093
9270
  return this.post(this.baseURL + '/moderation/unblock_message', _objectSpread({
9094
9271
  target_message_id: targetMessageID
9095
9272
  }, options));
9096
9273
 
9097
9274
  case 3:
9098
- return _context45.abrupt("return", _context45.sent);
9275
+ return _context46.abrupt("return", _context46.sent);
9099
9276
 
9100
9277
  case 4:
9101
9278
  case "end":
9102
- return _context45.stop();
9279
+ return _context46.stop();
9103
9280
  }
9104
9281
  }
9105
- }, _callee45, this);
9282
+ }, _callee46, this);
9106
9283
  }));
9107
9284
 
9108
- function _unblockMessage(_x57) {
9285
+ function _unblockMessage(_x58) {
9109
9286
  return _unblockMessage2.apply(this, arguments);
9110
9287
  }
9111
9288
 
@@ -9132,23 +9309,23 @@ var StreamChat = /*#__PURE__*/function () {
9132
9309
  * @return {Promise<APIResponse>}
9133
9310
  */
9134
9311
  function () {
9135
- var _markChannelsRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46() {
9312
+ var _markChannelsRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee47() {
9136
9313
  var data,
9137
- _args46 = arguments;
9138
- return _regeneratorRuntime.wrap(function _callee46$(_context46) {
9314
+ _args47 = arguments;
9315
+ return _regeneratorRuntime.wrap(function _callee47$(_context47) {
9139
9316
  while (1) {
9140
- switch (_context46.prev = _context46.next) {
9317
+ switch (_context47.prev = _context47.next) {
9141
9318
  case 0:
9142
- data = _args46.length > 0 && _args46[0] !== undefined ? _args46[0] : {};
9143
- _context46.next = 3;
9319
+ data = _args47.length > 0 && _args47[0] !== undefined ? _args47[0] : {};
9320
+ _context47.next = 3;
9144
9321
  return this.post(this.baseURL + '/channels/read', _objectSpread({}, data));
9145
9322
 
9146
9323
  case 3:
9147
9324
  case "end":
9148
- return _context46.stop();
9325
+ return _context47.stop();
9149
9326
  }
9150
9327
  }
9151
- }, _callee46, this);
9328
+ }, _callee47, this);
9152
9329
  }));
9153
9330
 
9154
9331
  function markChannelsRead() {
@@ -9223,28 +9400,28 @@ var StreamChat = /*#__PURE__*/function () {
9223
9400
  }, {
9224
9401
  key: "translateMessage",
9225
9402
  value: function () {
9226
- var _translateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee47(messageId, language) {
9227
- return _regeneratorRuntime.wrap(function _callee47$(_context47) {
9403
+ var _translateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee48(messageId, language) {
9404
+ return _regeneratorRuntime.wrap(function _callee48$(_context48) {
9228
9405
  while (1) {
9229
- switch (_context47.prev = _context47.next) {
9406
+ switch (_context48.prev = _context48.next) {
9230
9407
  case 0:
9231
- _context47.next = 2;
9408
+ _context48.next = 2;
9232
9409
  return this.post(this.baseURL + "/messages/".concat(messageId, "/translate"), {
9233
9410
  language: language
9234
9411
  });
9235
9412
 
9236
9413
  case 2:
9237
- return _context47.abrupt("return", _context47.sent);
9414
+ return _context48.abrupt("return", _context48.sent);
9238
9415
 
9239
9416
  case 3:
9240
9417
  case "end":
9241
- return _context47.stop();
9418
+ return _context48.stop();
9242
9419
  }
9243
9420
  }
9244
- }, _callee47, this);
9421
+ }, _callee48, this);
9245
9422
  }));
9246
9423
 
9247
- function translateMessage(_x58, _x59) {
9424
+ function translateMessage(_x59, _x60) {
9248
9425
  return _translateMessage.apply(this, arguments);
9249
9426
  }
9250
9427
 
@@ -9346,14 +9523,14 @@ var StreamChat = /*#__PURE__*/function () {
9346
9523
  }, {
9347
9524
  key: "updateMessage",
9348
9525
  value: function () {
9349
- var _updateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee48(message, userId, options) {
9526
+ var _updateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49(message, userId, options) {
9350
9527
  var clonedMessage, reservedMessageFields;
9351
- return _regeneratorRuntime.wrap(function _callee48$(_context48) {
9528
+ return _regeneratorRuntime.wrap(function _callee49$(_context49) {
9352
9529
  while (1) {
9353
- switch (_context48.prev = _context48.next) {
9530
+ switch (_context49.prev = _context49.next) {
9354
9531
  case 0:
9355
9532
  if (message.id) {
9356
- _context48.next = 2;
9533
+ _context49.next = 2;
9357
9534
  break;
9358
9535
  }
9359
9536
 
@@ -9390,23 +9567,23 @@ var StreamChat = /*#__PURE__*/function () {
9390
9567
  });
9391
9568
  }
9392
9569
 
9393
- _context48.next = 10;
9570
+ _context49.next = 10;
9394
9571
  return this.post(this.baseURL + "/messages/".concat(message.id), _objectSpread({
9395
9572
  message: clonedMessage
9396
9573
  }, options));
9397
9574
 
9398
9575
  case 10:
9399
- return _context48.abrupt("return", _context48.sent);
9576
+ return _context49.abrupt("return", _context49.sent);
9400
9577
 
9401
9578
  case 11:
9402
9579
  case "end":
9403
- return _context48.stop();
9580
+ return _context49.stop();
9404
9581
  }
9405
9582
  }
9406
- }, _callee48, this);
9583
+ }, _callee49, this);
9407
9584
  }));
9408
9585
 
9409
- function updateMessage(_x60, _x61, _x62) {
9586
+ function updateMessage(_x61, _x62, _x63) {
9410
9587
  return _updateMessage.apply(this, arguments);
9411
9588
  }
9412
9589
 
@@ -9429,14 +9606,14 @@ var StreamChat = /*#__PURE__*/function () {
9429
9606
  }, {
9430
9607
  key: "partialUpdateMessage",
9431
9608
  value: function () {
9432
- var _partialUpdateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49(id, partialMessageObject, userId, options) {
9609
+ var _partialUpdateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee50(id, partialMessageObject, userId, options) {
9433
9610
  var user;
9434
- return _regeneratorRuntime.wrap(function _callee49$(_context49) {
9611
+ return _regeneratorRuntime.wrap(function _callee50$(_context50) {
9435
9612
  while (1) {
9436
- switch (_context49.prev = _context49.next) {
9613
+ switch (_context50.prev = _context50.next) {
9437
9614
  case 0:
9438
9615
  if (id) {
9439
- _context49.next = 2;
9616
+ _context50.next = 2;
9440
9617
  break;
9441
9618
  }
9442
9619
 
@@ -9451,23 +9628,23 @@ var StreamChat = /*#__PURE__*/function () {
9451
9628
  };
9452
9629
  }
9453
9630
 
9454
- _context49.next = 6;
9631
+ _context50.next = 6;
9455
9632
  return this.put(this.baseURL + "/messages/".concat(id), _objectSpread(_objectSpread(_objectSpread({}, partialMessageObject), options), {}, {
9456
9633
  user: user
9457
9634
  }));
9458
9635
 
9459
9636
  case 6:
9460
- return _context49.abrupt("return", _context49.sent);
9637
+ return _context50.abrupt("return", _context50.sent);
9461
9638
 
9462
9639
  case 7:
9463
9640
  case "end":
9464
- return _context49.stop();
9641
+ return _context50.stop();
9465
9642
  }
9466
9643
  }
9467
- }, _callee49, this);
9644
+ }, _callee50, this);
9468
9645
  }));
9469
9646
 
9470
- function partialUpdateMessage(_x63, _x64, _x65, _x66) {
9647
+ function partialUpdateMessage(_x64, _x65, _x66, _x67) {
9471
9648
  return _partialUpdateMessage.apply(this, arguments);
9472
9649
  }
9473
9650
 
@@ -9476,11 +9653,11 @@ var StreamChat = /*#__PURE__*/function () {
9476
9653
  }, {
9477
9654
  key: "deleteMessage",
9478
9655
  value: function () {
9479
- var _deleteMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee50(messageID, hardDelete) {
9656
+ var _deleteMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee51(messageID, hardDelete) {
9480
9657
  var params;
9481
- return _regeneratorRuntime.wrap(function _callee50$(_context50) {
9658
+ return _regeneratorRuntime.wrap(function _callee51$(_context51) {
9482
9659
  while (1) {
9483
- switch (_context50.prev = _context50.next) {
9660
+ switch (_context51.prev = _context51.next) {
9484
9661
  case 0:
9485
9662
  params = {};
9486
9663
 
@@ -9490,21 +9667,21 @@ var StreamChat = /*#__PURE__*/function () {
9490
9667
  };
9491
9668
  }
9492
9669
 
9493
- _context50.next = 4;
9670
+ _context51.next = 4;
9494
9671
  return this.delete(this.baseURL + "/messages/".concat(messageID), params);
9495
9672
 
9496
9673
  case 4:
9497
- return _context50.abrupt("return", _context50.sent);
9674
+ return _context51.abrupt("return", _context51.sent);
9498
9675
 
9499
9676
  case 5:
9500
9677
  case "end":
9501
- return _context50.stop();
9678
+ return _context51.stop();
9502
9679
  }
9503
9680
  }
9504
- }, _callee50, this);
9681
+ }, _callee51, this);
9505
9682
  }));
9506
9683
 
9507
- function deleteMessage(_x67, _x68) {
9684
+ function deleteMessage(_x68, _x69) {
9508
9685
  return _deleteMessage.apply(this, arguments);
9509
9686
  }
9510
9687
 
@@ -9513,26 +9690,26 @@ var StreamChat = /*#__PURE__*/function () {
9513
9690
  }, {
9514
9691
  key: "getMessage",
9515
9692
  value: function () {
9516
- var _getMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee51(messageID) {
9517
- return _regeneratorRuntime.wrap(function _callee51$(_context51) {
9693
+ var _getMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee52(messageID) {
9694
+ return _regeneratorRuntime.wrap(function _callee52$(_context52) {
9518
9695
  while (1) {
9519
- switch (_context51.prev = _context51.next) {
9696
+ switch (_context52.prev = _context52.next) {
9520
9697
  case 0:
9521
- _context51.next = 2;
9698
+ _context52.next = 2;
9522
9699
  return this.get(this.baseURL + "/messages/".concat(messageID));
9523
9700
 
9524
9701
  case 2:
9525
- return _context51.abrupt("return", _context51.sent);
9702
+ return _context52.abrupt("return", _context52.sent);
9526
9703
 
9527
9704
  case 3:
9528
9705
  case "end":
9529
- return _context51.stop();
9706
+ return _context52.stop();
9530
9707
  }
9531
9708
  }
9532
- }, _callee51, this);
9709
+ }, _callee52, this);
9533
9710
  }));
9534
9711
 
9535
- function getMessage(_x69) {
9712
+ function getMessage(_x70) {
9536
9713
  return _getMessage.apply(this, arguments);
9537
9714
  }
9538
9715
 
@@ -9541,7 +9718,7 @@ var StreamChat = /*#__PURE__*/function () {
9541
9718
  }, {
9542
9719
  key: "getUserAgent",
9543
9720
  value: function getUserAgent() {
9544
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "6.5.1");
9721
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "6.7.1");
9545
9722
  }
9546
9723
  }, {
9547
9724
  key: "setUserAgent",
@@ -9736,28 +9913,28 @@ var StreamChat = /*#__PURE__*/function () {
9736
9913
  }, {
9737
9914
  key: "sendUserCustomEvent",
9738
9915
  value: function () {
9739
- var _sendUserCustomEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee52(targetUserID, event) {
9740
- return _regeneratorRuntime.wrap(function _callee52$(_context52) {
9916
+ var _sendUserCustomEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee53(targetUserID, event) {
9917
+ return _regeneratorRuntime.wrap(function _callee53$(_context53) {
9741
9918
  while (1) {
9742
- switch (_context52.prev = _context52.next) {
9919
+ switch (_context53.prev = _context53.next) {
9743
9920
  case 0:
9744
- _context52.next = 2;
9921
+ _context53.next = 2;
9745
9922
  return this.post("".concat(this.baseURL, "/users/").concat(targetUserID, "/event"), {
9746
9923
  event: event
9747
9924
  });
9748
9925
 
9749
9926
  case 2:
9750
- return _context52.abrupt("return", _context52.sent);
9927
+ return _context53.abrupt("return", _context53.sent);
9751
9928
 
9752
9929
  case 3:
9753
9930
  case "end":
9754
- return _context52.stop();
9931
+ return _context53.stop();
9755
9932
  }
9756
9933
  }
9757
- }, _callee52, this);
9934
+ }, _callee53, this);
9758
9935
  }));
9759
9936
 
9760
- function sendUserCustomEvent(_x70, _x71) {
9937
+ function sendUserCustomEvent(_x71, _x72) {
9761
9938
  return _sendUserCustomEvent.apply(this, arguments);
9762
9939
  }
9763
9940
 
@@ -9825,32 +10002,32 @@ var StreamChat = /*#__PURE__*/function () {
9825
10002
  }, {
9826
10003
  key: "createSegment",
9827
10004
  value: function () {
9828
- var _createSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee53(params) {
10005
+ var _createSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee54(params) {
9829
10006
  var _yield$this$post, segment;
9830
10007
 
9831
- return _regeneratorRuntime.wrap(function _callee53$(_context53) {
10008
+ return _regeneratorRuntime.wrap(function _callee54$(_context54) {
9832
10009
  while (1) {
9833
- switch (_context53.prev = _context53.next) {
10010
+ switch (_context54.prev = _context54.next) {
9834
10011
  case 0:
9835
- _context53.next = 2;
10012
+ _context54.next = 2;
9836
10013
  return this.post(this.baseURL + "/segments", {
9837
10014
  segment: params
9838
10015
  });
9839
10016
 
9840
10017
  case 2:
9841
- _yield$this$post = _context53.sent;
10018
+ _yield$this$post = _context54.sent;
9842
10019
  segment = _yield$this$post.segment;
9843
- return _context53.abrupt("return", segment);
10020
+ return _context54.abrupt("return", segment);
9844
10021
 
9845
10022
  case 5:
9846
10023
  case "end":
9847
- return _context53.stop();
10024
+ return _context54.stop();
9848
10025
  }
9849
10026
  }
9850
- }, _callee53, this);
10027
+ }, _callee54, this);
9851
10028
  }));
9852
10029
 
9853
- function createSegment(_x72) {
10030
+ function createSegment(_x73) {
9854
10031
  return _createSegment.apply(this, arguments);
9855
10032
  }
9856
10033
 
@@ -9867,30 +10044,30 @@ var StreamChat = /*#__PURE__*/function () {
9867
10044
  }, {
9868
10045
  key: "getSegment",
9869
10046
  value: function () {
9870
- var _getSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee54(id) {
10047
+ var _getSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee55(id) {
9871
10048
  var _yield$this$get, segment;
9872
10049
 
9873
- return _regeneratorRuntime.wrap(function _callee54$(_context54) {
10050
+ return _regeneratorRuntime.wrap(function _callee55$(_context55) {
9874
10051
  while (1) {
9875
- switch (_context54.prev = _context54.next) {
10052
+ switch (_context55.prev = _context55.next) {
9876
10053
  case 0:
9877
- _context54.next = 2;
10054
+ _context55.next = 2;
9878
10055
  return this.get(this.baseURL + "/segments/".concat(id));
9879
10056
 
9880
10057
  case 2:
9881
- _yield$this$get = _context54.sent;
10058
+ _yield$this$get = _context55.sent;
9882
10059
  segment = _yield$this$get.segment;
9883
- return _context54.abrupt("return", segment);
10060
+ return _context55.abrupt("return", segment);
9884
10061
 
9885
10062
  case 5:
9886
10063
  case "end":
9887
- return _context54.stop();
10064
+ return _context55.stop();
9888
10065
  }
9889
10066
  }
9890
- }, _callee54, this);
10067
+ }, _callee55, this);
9891
10068
  }));
9892
10069
 
9893
- function getSegment(_x73) {
10070
+ function getSegment(_x74) {
9894
10071
  return _getSegment.apply(this, arguments);
9895
10072
  }
9896
10073
 
@@ -9906,30 +10083,30 @@ var StreamChat = /*#__PURE__*/function () {
9906
10083
  }, {
9907
10084
  key: "listSegments",
9908
10085
  value: function () {
9909
- var _listSegments = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee55(options) {
10086
+ var _listSegments = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee56(options) {
9910
10087
  var _yield$this$get2, segments;
9911
10088
 
9912
- return _regeneratorRuntime.wrap(function _callee55$(_context55) {
10089
+ return _regeneratorRuntime.wrap(function _callee56$(_context56) {
9913
10090
  while (1) {
9914
- switch (_context55.prev = _context55.next) {
10091
+ switch (_context56.prev = _context56.next) {
9915
10092
  case 0:
9916
- _context55.next = 2;
10093
+ _context56.next = 2;
9917
10094
  return this.get(this.baseURL + "/segments", options);
9918
10095
 
9919
10096
  case 2:
9920
- _yield$this$get2 = _context55.sent;
10097
+ _yield$this$get2 = _context56.sent;
9921
10098
  segments = _yield$this$get2.segments;
9922
- return _context55.abrupt("return", segments);
10099
+ return _context56.abrupt("return", segments);
9923
10100
 
9924
10101
  case 5:
9925
10102
  case "end":
9926
- return _context55.stop();
10103
+ return _context56.stop();
9927
10104
  }
9928
10105
  }
9929
- }, _callee55, this);
10106
+ }, _callee56, this);
9930
10107
  }));
9931
10108
 
9932
- function listSegments(_x74) {
10109
+ function listSegments(_x75) {
9933
10110
  return _listSegments.apply(this, arguments);
9934
10111
  }
9935
10112
 
@@ -9947,32 +10124,32 @@ var StreamChat = /*#__PURE__*/function () {
9947
10124
  }, {
9948
10125
  key: "updateSegment",
9949
10126
  value: function () {
9950
- var _updateSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee56(id, params) {
10127
+ var _updateSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee57(id, params) {
9951
10128
  var _yield$this$put, segment;
9952
10129
 
9953
- return _regeneratorRuntime.wrap(function _callee56$(_context56) {
10130
+ return _regeneratorRuntime.wrap(function _callee57$(_context57) {
9954
10131
  while (1) {
9955
- switch (_context56.prev = _context56.next) {
10132
+ switch (_context57.prev = _context57.next) {
9956
10133
  case 0:
9957
- _context56.next = 2;
10134
+ _context57.next = 2;
9958
10135
  return this.put(this.baseURL + "/segments/".concat(id), {
9959
10136
  segment: params
9960
10137
  });
9961
10138
 
9962
10139
  case 2:
9963
- _yield$this$put = _context56.sent;
10140
+ _yield$this$put = _context57.sent;
9964
10141
  segment = _yield$this$put.segment;
9965
- return _context56.abrupt("return", segment);
10142
+ return _context57.abrupt("return", segment);
9966
10143
 
9967
10144
  case 5:
9968
10145
  case "end":
9969
- return _context56.stop();
10146
+ return _context57.stop();
9970
10147
  }
9971
10148
  }
9972
- }, _callee56, this);
10149
+ }, _callee57, this);
9973
10150
  }));
9974
10151
 
9975
- function updateSegment(_x75, _x76) {
10152
+ function updateSegment(_x76, _x77) {
9976
10153
  return _updateSegment.apply(this, arguments);
9977
10154
  }
9978
10155
 
@@ -9989,22 +10166,22 @@ var StreamChat = /*#__PURE__*/function () {
9989
10166
  }, {
9990
10167
  key: "deleteSegment",
9991
10168
  value: function () {
9992
- var _deleteSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee57(id) {
9993
- return _regeneratorRuntime.wrap(function _callee57$(_context57) {
10169
+ var _deleteSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee58(id) {
10170
+ return _regeneratorRuntime.wrap(function _callee58$(_context58) {
9994
10171
  while (1) {
9995
- switch (_context57.prev = _context57.next) {
10172
+ switch (_context58.prev = _context58.next) {
9996
10173
  case 0:
9997
- return _context57.abrupt("return", this.delete(this.baseURL + "/segments/".concat(id)));
10174
+ return _context58.abrupt("return", this.delete(this.baseURL + "/segments/".concat(id)));
9998
10175
 
9999
10176
  case 1:
10000
10177
  case "end":
10001
- return _context57.stop();
10178
+ return _context58.stop();
10002
10179
  }
10003
10180
  }
10004
- }, _callee57, this);
10181
+ }, _callee58, this);
10005
10182
  }));
10006
10183
 
10007
- function deleteSegment(_x77) {
10184
+ function deleteSegment(_x78) {
10008
10185
  return _deleteSegment.apply(this, arguments);
10009
10186
  }
10010
10187
 
@@ -10021,32 +10198,32 @@ var StreamChat = /*#__PURE__*/function () {
10021
10198
  }, {
10022
10199
  key: "createCampaign",
10023
10200
  value: function () {
10024
- var _createCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee58(params) {
10201
+ var _createCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee59(params) {
10025
10202
  var _yield$this$post2, campaign;
10026
10203
 
10027
- return _regeneratorRuntime.wrap(function _callee58$(_context58) {
10204
+ return _regeneratorRuntime.wrap(function _callee59$(_context59) {
10028
10205
  while (1) {
10029
- switch (_context58.prev = _context58.next) {
10206
+ switch (_context59.prev = _context59.next) {
10030
10207
  case 0:
10031
- _context58.next = 2;
10208
+ _context59.next = 2;
10032
10209
  return this.post(this.baseURL + "/campaigns", {
10033
10210
  campaign: params
10034
10211
  });
10035
10212
 
10036
10213
  case 2:
10037
- _yield$this$post2 = _context58.sent;
10214
+ _yield$this$post2 = _context59.sent;
10038
10215
  campaign = _yield$this$post2.campaign;
10039
- return _context58.abrupt("return", campaign);
10216
+ return _context59.abrupt("return", campaign);
10040
10217
 
10041
10218
  case 5:
10042
10219
  case "end":
10043
- return _context58.stop();
10220
+ return _context59.stop();
10044
10221
  }
10045
10222
  }
10046
- }, _callee58, this);
10223
+ }, _callee59, this);
10047
10224
  }));
10048
10225
 
10049
- function createCampaign(_x78) {
10226
+ function createCampaign(_x79) {
10050
10227
  return _createCampaign.apply(this, arguments);
10051
10228
  }
10052
10229
 
@@ -10063,30 +10240,30 @@ var StreamChat = /*#__PURE__*/function () {
10063
10240
  }, {
10064
10241
  key: "getCampaign",
10065
10242
  value: function () {
10066
- var _getCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee59(id) {
10243
+ var _getCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee60(id) {
10067
10244
  var _yield$this$get3, campaign;
10068
10245
 
10069
- return _regeneratorRuntime.wrap(function _callee59$(_context59) {
10246
+ return _regeneratorRuntime.wrap(function _callee60$(_context60) {
10070
10247
  while (1) {
10071
- switch (_context59.prev = _context59.next) {
10248
+ switch (_context60.prev = _context60.next) {
10072
10249
  case 0:
10073
- _context59.next = 2;
10250
+ _context60.next = 2;
10074
10251
  return this.get(this.baseURL + "/campaigns/".concat(id));
10075
10252
 
10076
10253
  case 2:
10077
- _yield$this$get3 = _context59.sent;
10254
+ _yield$this$get3 = _context60.sent;
10078
10255
  campaign = _yield$this$get3.campaign;
10079
- return _context59.abrupt("return", campaign);
10256
+ return _context60.abrupt("return", campaign);
10080
10257
 
10081
10258
  case 5:
10082
10259
  case "end":
10083
- return _context59.stop();
10260
+ return _context60.stop();
10084
10261
  }
10085
10262
  }
10086
- }, _callee59, this);
10263
+ }, _callee60, this);
10087
10264
  }));
10088
10265
 
10089
- function getCampaign(_x79) {
10266
+ function getCampaign(_x80) {
10090
10267
  return _getCampaign.apply(this, arguments);
10091
10268
  }
10092
10269
 
@@ -10102,30 +10279,30 @@ var StreamChat = /*#__PURE__*/function () {
10102
10279
  }, {
10103
10280
  key: "listCampaigns",
10104
10281
  value: function () {
10105
- var _listCampaigns = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee60(options) {
10282
+ var _listCampaigns = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee61(options) {
10106
10283
  var _yield$this$get4, campaigns;
10107
10284
 
10108
- return _regeneratorRuntime.wrap(function _callee60$(_context60) {
10285
+ return _regeneratorRuntime.wrap(function _callee61$(_context61) {
10109
10286
  while (1) {
10110
- switch (_context60.prev = _context60.next) {
10287
+ switch (_context61.prev = _context61.next) {
10111
10288
  case 0:
10112
- _context60.next = 2;
10289
+ _context61.next = 2;
10113
10290
  return this.get(this.baseURL + "/campaigns", options);
10114
10291
 
10115
10292
  case 2:
10116
- _yield$this$get4 = _context60.sent;
10293
+ _yield$this$get4 = _context61.sent;
10117
10294
  campaigns = _yield$this$get4.campaigns;
10118
- return _context60.abrupt("return", campaigns);
10295
+ return _context61.abrupt("return", campaigns);
10119
10296
 
10120
10297
  case 5:
10121
10298
  case "end":
10122
- return _context60.stop();
10299
+ return _context61.stop();
10123
10300
  }
10124
10301
  }
10125
- }, _callee60, this);
10302
+ }, _callee61, this);
10126
10303
  }));
10127
10304
 
10128
- function listCampaigns(_x80) {
10305
+ function listCampaigns(_x81) {
10129
10306
  return _listCampaigns.apply(this, arguments);
10130
10307
  }
10131
10308
 
@@ -10143,32 +10320,32 @@ var StreamChat = /*#__PURE__*/function () {
10143
10320
  }, {
10144
10321
  key: "updateCampaign",
10145
10322
  value: function () {
10146
- var _updateCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee61(id, params) {
10323
+ var _updateCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee62(id, params) {
10147
10324
  var _yield$this$put2, campaign;
10148
10325
 
10149
- return _regeneratorRuntime.wrap(function _callee61$(_context61) {
10326
+ return _regeneratorRuntime.wrap(function _callee62$(_context62) {
10150
10327
  while (1) {
10151
- switch (_context61.prev = _context61.next) {
10328
+ switch (_context62.prev = _context62.next) {
10152
10329
  case 0:
10153
- _context61.next = 2;
10330
+ _context62.next = 2;
10154
10331
  return this.put(this.baseURL + "/campaigns/".concat(id), {
10155
10332
  campaign: params
10156
10333
  });
10157
10334
 
10158
10335
  case 2:
10159
- _yield$this$put2 = _context61.sent;
10336
+ _yield$this$put2 = _context62.sent;
10160
10337
  campaign = _yield$this$put2.campaign;
10161
- return _context61.abrupt("return", campaign);
10338
+ return _context62.abrupt("return", campaign);
10162
10339
 
10163
10340
  case 5:
10164
10341
  case "end":
10165
- return _context61.stop();
10342
+ return _context62.stop();
10166
10343
  }
10167
10344
  }
10168
- }, _callee61, this);
10345
+ }, _callee62, this);
10169
10346
  }));
10170
10347
 
10171
- function updateCampaign(_x81, _x82) {
10348
+ function updateCampaign(_x82, _x83) {
10172
10349
  return _updateCampaign.apply(this, arguments);
10173
10350
  }
10174
10351
 
@@ -10185,22 +10362,22 @@ var StreamChat = /*#__PURE__*/function () {
10185
10362
  }, {
10186
10363
  key: "deleteCampaign",
10187
10364
  value: function () {
10188
- var _deleteCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee62(id) {
10189
- return _regeneratorRuntime.wrap(function _callee62$(_context62) {
10365
+ var _deleteCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee63(id) {
10366
+ return _regeneratorRuntime.wrap(function _callee63$(_context63) {
10190
10367
  while (1) {
10191
- switch (_context62.prev = _context62.next) {
10368
+ switch (_context63.prev = _context63.next) {
10192
10369
  case 0:
10193
- return _context62.abrupt("return", this.delete(this.baseURL + "/campaigns/".concat(id)));
10370
+ return _context63.abrupt("return", this.delete(this.baseURL + "/campaigns/".concat(id)));
10194
10371
 
10195
10372
  case 1:
10196
10373
  case "end":
10197
- return _context62.stop();
10374
+ return _context63.stop();
10198
10375
  }
10199
10376
  }
10200
- }, _callee62, this);
10377
+ }, _callee63, this);
10201
10378
  }));
10202
10379
 
10203
- function deleteCampaign(_x83) {
10380
+ function deleteCampaign(_x84) {
10204
10381
  return _deleteCampaign.apply(this, arguments);
10205
10382
  }
10206
10383
 
@@ -10210,7 +10387,7 @@ var StreamChat = /*#__PURE__*/function () {
10210
10387
  * scheduleCampaign - Schedule a Campaign
10211
10388
  *
10212
10389
  * @param {string} id Campaign ID
10213
- * @param {{sendAt: number}} params Schedule params
10390
+ * @param {{scheduledFor: number}} params Schedule params
10214
10391
  *
10215
10392
  * @return {Campaign} Scheduled Campaign
10216
10393
  */
@@ -10218,33 +10395,33 @@ var StreamChat = /*#__PURE__*/function () {
10218
10395
  }, {
10219
10396
  key: "scheduleCampaign",
10220
10397
  value: function () {
10221
- var _scheduleCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee63(id, params) {
10222
- var sendAt, _yield$this$patch, campaign;
10398
+ var _scheduleCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee64(id, params) {
10399
+ var scheduledFor, _yield$this$patch, campaign;
10223
10400
 
10224
- return _regeneratorRuntime.wrap(function _callee63$(_context63) {
10401
+ return _regeneratorRuntime.wrap(function _callee64$(_context64) {
10225
10402
  while (1) {
10226
- switch (_context63.prev = _context63.next) {
10403
+ switch (_context64.prev = _context64.next) {
10227
10404
  case 0:
10228
- sendAt = params.sendAt;
10229
- _context63.next = 3;
10405
+ scheduledFor = params.scheduledFor;
10406
+ _context64.next = 3;
10230
10407
  return this.patch(this.baseURL + "/campaigns/".concat(id, "/schedule"), {
10231
- send_at: sendAt
10408
+ scheduled_for: scheduledFor
10232
10409
  });
10233
10410
 
10234
10411
  case 3:
10235
- _yield$this$patch = _context63.sent;
10412
+ _yield$this$patch = _context64.sent;
10236
10413
  campaign = _yield$this$patch.campaign;
10237
- return _context63.abrupt("return", campaign);
10414
+ return _context64.abrupt("return", campaign);
10238
10415
 
10239
10416
  case 6:
10240
10417
  case "end":
10241
- return _context63.stop();
10418
+ return _context64.stop();
10242
10419
  }
10243
10420
  }
10244
- }, _callee63, this);
10421
+ }, _callee64, this);
10245
10422
  }));
10246
10423
 
10247
- function scheduleCampaign(_x84, _x85) {
10424
+ function scheduleCampaign(_x85, _x86) {
10248
10425
  return _scheduleCampaign.apply(this, arguments);
10249
10426
  }
10250
10427
 
@@ -10261,30 +10438,30 @@ var StreamChat = /*#__PURE__*/function () {
10261
10438
  }, {
10262
10439
  key: "stopCampaign",
10263
10440
  value: function () {
10264
- var _stopCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee64(id) {
10441
+ var _stopCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee65(id) {
10265
10442
  var _yield$this$patch2, campaign;
10266
10443
 
10267
- return _regeneratorRuntime.wrap(function _callee64$(_context64) {
10444
+ return _regeneratorRuntime.wrap(function _callee65$(_context65) {
10268
10445
  while (1) {
10269
- switch (_context64.prev = _context64.next) {
10446
+ switch (_context65.prev = _context65.next) {
10270
10447
  case 0:
10271
- _context64.next = 2;
10448
+ _context65.next = 2;
10272
10449
  return this.patch(this.baseURL + "/campaigns/".concat(id, "/stop"));
10273
10450
 
10274
10451
  case 2:
10275
- _yield$this$patch2 = _context64.sent;
10452
+ _yield$this$patch2 = _context65.sent;
10276
10453
  campaign = _yield$this$patch2.campaign;
10277
- return _context64.abrupt("return", campaign);
10454
+ return _context65.abrupt("return", campaign);
10278
10455
 
10279
10456
  case 5:
10280
10457
  case "end":
10281
- return _context64.stop();
10458
+ return _context65.stop();
10282
10459
  }
10283
10460
  }
10284
- }, _callee64, this);
10461
+ }, _callee65, this);
10285
10462
  }));
10286
10463
 
10287
- function stopCampaign(_x86) {
10464
+ function stopCampaign(_x87) {
10288
10465
  return _stopCampaign.apply(this, arguments);
10289
10466
  }
10290
10467
 
@@ -10301,30 +10478,30 @@ var StreamChat = /*#__PURE__*/function () {
10301
10478
  }, {
10302
10479
  key: "resumeCampaign",
10303
10480
  value: function () {
10304
- var _resumeCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee65(id) {
10481
+ var _resumeCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee66(id) {
10305
10482
  var _yield$this$patch3, campaign;
10306
10483
 
10307
- return _regeneratorRuntime.wrap(function _callee65$(_context65) {
10484
+ return _regeneratorRuntime.wrap(function _callee66$(_context66) {
10308
10485
  while (1) {
10309
- switch (_context65.prev = _context65.next) {
10486
+ switch (_context66.prev = _context66.next) {
10310
10487
  case 0:
10311
- _context65.next = 2;
10488
+ _context66.next = 2;
10312
10489
  return this.patch(this.baseURL + "/campaigns/".concat(id, "/resume"));
10313
10490
 
10314
10491
  case 2:
10315
- _yield$this$patch3 = _context65.sent;
10492
+ _yield$this$patch3 = _context66.sent;
10316
10493
  campaign = _yield$this$patch3.campaign;
10317
- return _context65.abrupt("return", campaign);
10494
+ return _context66.abrupt("return", campaign);
10318
10495
 
10319
10496
  case 5:
10320
10497
  case "end":
10321
- return _context65.stop();
10498
+ return _context66.stop();
10322
10499
  }
10323
10500
  }
10324
- }, _callee65, this);
10501
+ }, _callee66, this);
10325
10502
  }));
10326
10503
 
10327
- function resumeCampaign(_x87) {
10504
+ function resumeCampaign(_x88) {
10328
10505
  return _resumeCampaign.apply(this, arguments);
10329
10506
  }
10330
10507
 
@@ -10335,39 +10512,37 @@ var StreamChat = /*#__PURE__*/function () {
10335
10512
  *
10336
10513
  * @param {string} id Campaign ID
10337
10514
  * @param {{users: string[]}} params Test params
10338
- * @return {Campaign} Test Campaign
10515
+ *
10516
+ * @return {TestCampaignResponse} Test campaign response
10339
10517
  */
10340
10518
 
10341
10519
  }, {
10342
10520
  key: "testCampaign",
10343
10521
  value: function () {
10344
- var _testCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee66(id, params) {
10345
- var users, _yield$this$post3, campaign;
10346
-
10347
- return _regeneratorRuntime.wrap(function _callee66$(_context66) {
10522
+ var _testCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee67(id, params) {
10523
+ var users;
10524
+ return _regeneratorRuntime.wrap(function _callee67$(_context67) {
10348
10525
  while (1) {
10349
- switch (_context66.prev = _context66.next) {
10526
+ switch (_context67.prev = _context67.next) {
10350
10527
  case 0:
10351
10528
  users = params.users;
10352
- _context66.next = 3;
10529
+ _context67.next = 3;
10353
10530
  return this.post(this.baseURL + "/campaigns/".concat(id, "/test"), {
10354
10531
  users: users
10355
10532
  });
10356
10533
 
10357
10534
  case 3:
10358
- _yield$this$post3 = _context66.sent;
10359
- campaign = _yield$this$post3.campaign;
10360
- return _context66.abrupt("return", campaign);
10535
+ return _context67.abrupt("return", _context67.sent);
10361
10536
 
10362
- case 6:
10537
+ case 4:
10363
10538
  case "end":
10364
- return _context66.stop();
10539
+ return _context67.stop();
10365
10540
  }
10366
10541
  }
10367
- }, _callee66, this);
10542
+ }, _callee67, this);
10368
10543
  }));
10369
10544
 
10370
- function testCampaign(_x88, _x89) {
10545
+ function testCampaign(_x89, _x90) {
10371
10546
  return _testCampaign.apply(this, arguments);
10372
10547
  }
10373
10548
 
@@ -10383,24 +10558,24 @@ var StreamChat = /*#__PURE__*/function () {
10383
10558
  }, {
10384
10559
  key: "enrichURL",
10385
10560
  value: function () {
10386
- var _enrichURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee67(url) {
10387
- return _regeneratorRuntime.wrap(function _callee67$(_context67) {
10561
+ var _enrichURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee68(url) {
10562
+ return _regeneratorRuntime.wrap(function _callee68$(_context68) {
10388
10563
  while (1) {
10389
- switch (_context67.prev = _context67.next) {
10564
+ switch (_context68.prev = _context68.next) {
10390
10565
  case 0:
10391
- return _context67.abrupt("return", this.get(this.baseURL + "/og", {
10566
+ return _context68.abrupt("return", this.get(this.baseURL + "/og", {
10392
10567
  url: url
10393
10568
  }));
10394
10569
 
10395
10570
  case 1:
10396
10571
  case "end":
10397
- return _context67.stop();
10572
+ return _context68.stop();
10398
10573
  }
10399
10574
  }
10400
- }, _callee67, this);
10575
+ }, _callee68, this);
10401
10576
  }));
10402
10577
 
10403
- function enrichURL(_x90) {
10578
+ function enrichURL(_x91) {
10404
10579
  return _enrichURL.apply(this, arguments);
10405
10580
  }
10406
10581
 
@@ -10417,22 +10592,22 @@ var StreamChat = /*#__PURE__*/function () {
10417
10592
  }, {
10418
10593
  key: "getTask",
10419
10594
  value: function () {
10420
- var _getTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee68(id) {
10421
- return _regeneratorRuntime.wrap(function _callee68$(_context68) {
10595
+ var _getTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee69(id) {
10596
+ return _regeneratorRuntime.wrap(function _callee69$(_context69) {
10422
10597
  while (1) {
10423
- switch (_context68.prev = _context68.next) {
10598
+ switch (_context69.prev = _context69.next) {
10424
10599
  case 0:
10425
- return _context68.abrupt("return", this.get("".concat(this.baseURL, "/tasks/").concat(id)));
10600
+ return _context69.abrupt("return", this.get("".concat(this.baseURL, "/tasks/").concat(id)));
10426
10601
 
10427
10602
  case 1:
10428
10603
  case "end":
10429
- return _context68.stop();
10604
+ return _context69.stop();
10430
10605
  }
10431
10606
  }
10432
- }, _callee68, this);
10607
+ }, _callee69, this);
10433
10608
  }));
10434
10609
 
10435
- function getTask(_x91) {
10610
+ function getTask(_x92) {
10436
10611
  return _getTask.apply(this, arguments);
10437
10612
  }
10438
10613
 
@@ -10450,31 +10625,31 @@ var StreamChat = /*#__PURE__*/function () {
10450
10625
  }, {
10451
10626
  key: "deleteChannels",
10452
10627
  value: function () {
10453
- var _deleteChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee69(cids) {
10628
+ var _deleteChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee70(cids) {
10454
10629
  var options,
10455
- _args69 = arguments;
10456
- return _regeneratorRuntime.wrap(function _callee69$(_context69) {
10630
+ _args70 = arguments;
10631
+ return _regeneratorRuntime.wrap(function _callee70$(_context70) {
10457
10632
  while (1) {
10458
- switch (_context69.prev = _context69.next) {
10633
+ switch (_context70.prev = _context70.next) {
10459
10634
  case 0:
10460
- options = _args69.length > 1 && _args69[1] !== undefined ? _args69[1] : {};
10461
- _context69.next = 3;
10635
+ options = _args70.length > 1 && _args70[1] !== undefined ? _args70[1] : {};
10636
+ _context70.next = 3;
10462
10637
  return this.post(this.baseURL + "/channels/delete", _objectSpread({
10463
10638
  cids: cids
10464
10639
  }, options));
10465
10640
 
10466
10641
  case 3:
10467
- return _context69.abrupt("return", _context69.sent);
10642
+ return _context70.abrupt("return", _context70.sent);
10468
10643
 
10469
10644
  case 4:
10470
10645
  case "end":
10471
- return _context69.stop();
10646
+ return _context70.stop();
10472
10647
  }
10473
10648
  }
10474
- }, _callee69, this);
10649
+ }, _callee70, this);
10475
10650
  }));
10476
10651
 
10477
- function deleteChannels(_x92) {
10652
+ function deleteChannels(_x93) {
10478
10653
  return _deleteChannels.apply(this, arguments);
10479
10654
  }
10480
10655
 
@@ -10492,13 +10667,13 @@ var StreamChat = /*#__PURE__*/function () {
10492
10667
  }, {
10493
10668
  key: "deleteUsers",
10494
10669
  value: function () {
10495
- var _deleteUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee70(user_ids, options) {
10496
- return _regeneratorRuntime.wrap(function _callee70$(_context70) {
10670
+ var _deleteUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee71(user_ids, options) {
10671
+ return _regeneratorRuntime.wrap(function _callee71$(_context71) {
10497
10672
  while (1) {
10498
- switch (_context70.prev = _context70.next) {
10673
+ switch (_context71.prev = _context71.next) {
10499
10674
  case 0:
10500
10675
  if (!((options === null || options === void 0 ? void 0 : options.user) !== 'soft' && (options === null || options === void 0 ? void 0 : options.user) !== 'hard')) {
10501
- _context70.next = 2;
10676
+ _context71.next = 2;
10502
10677
  break;
10503
10678
  }
10504
10679
 
@@ -10506,7 +10681,7 @@ var StreamChat = /*#__PURE__*/function () {
10506
10681
 
10507
10682
  case 2:
10508
10683
  if (!(options.messages !== undefined && options.messages !== 'soft' && options.messages !== 'hard')) {
10509
- _context70.next = 4;
10684
+ _context71.next = 4;
10510
10685
  break;
10511
10686
  }
10512
10687
 
@@ -10514,30 +10689,30 @@ var StreamChat = /*#__PURE__*/function () {
10514
10689
 
10515
10690
  case 4:
10516
10691
  if (!(options.conversations !== undefined && options.conversations !== 'soft' && options.conversations !== 'hard')) {
10517
- _context70.next = 6;
10692
+ _context71.next = 6;
10518
10693
  break;
10519
10694
  }
10520
10695
 
10521
10696
  throw new Error('Invalid delete user options. conversations must be one of [soft hard]');
10522
10697
 
10523
10698
  case 6:
10524
- _context70.next = 8;
10699
+ _context71.next = 8;
10525
10700
  return this.post(this.baseURL + "/users/delete", _objectSpread({
10526
10701
  user_ids: user_ids
10527
10702
  }, options));
10528
10703
 
10529
10704
  case 8:
10530
- return _context70.abrupt("return", _context70.sent);
10705
+ return _context71.abrupt("return", _context71.sent);
10531
10706
 
10532
10707
  case 9:
10533
10708
  case "end":
10534
- return _context70.stop();
10709
+ return _context71.stop();
10535
10710
  }
10536
10711
  }
10537
- }, _callee70, this);
10712
+ }, _callee71, this);
10538
10713
  }));
10539
10714
 
10540
- function deleteUsers(_x93, _x94) {
10715
+ function deleteUsers(_x94, _x95) {
10541
10716
  return _deleteUsers.apply(this, arguments);
10542
10717
  }
10543
10718
 
@@ -10558,28 +10733,28 @@ var StreamChat = /*#__PURE__*/function () {
10558
10733
  }, {
10559
10734
  key: "_createImportURL",
10560
10735
  value: function () {
10561
- var _createImportURL2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee71(filename) {
10562
- return _regeneratorRuntime.wrap(function _callee71$(_context71) {
10736
+ var _createImportURL2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee72(filename) {
10737
+ return _regeneratorRuntime.wrap(function _callee72$(_context72) {
10563
10738
  while (1) {
10564
- switch (_context71.prev = _context71.next) {
10739
+ switch (_context72.prev = _context72.next) {
10565
10740
  case 0:
10566
- _context71.next = 2;
10741
+ _context72.next = 2;
10567
10742
  return this.post(this.baseURL + "/import_urls", {
10568
10743
  filename: filename
10569
10744
  });
10570
10745
 
10571
10746
  case 2:
10572
- return _context71.abrupt("return", _context71.sent);
10747
+ return _context72.abrupt("return", _context72.sent);
10573
10748
 
10574
10749
  case 3:
10575
10750
  case "end":
10576
- return _context71.stop();
10751
+ return _context72.stop();
10577
10752
  }
10578
10753
  }
10579
- }, _callee71, this);
10754
+ }, _callee72, this);
10580
10755
  }));
10581
10756
 
10582
- function _createImportURL(_x95) {
10757
+ function _createImportURL(_x96) {
10583
10758
  return _createImportURL2.apply(this, arguments);
10584
10759
  }
10585
10760
 
@@ -10601,33 +10776,33 @@ var StreamChat = /*#__PURE__*/function () {
10601
10776
  }, {
10602
10777
  key: "_createImport",
10603
10778
  value: function () {
10604
- var _createImport2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee72(path) {
10779
+ var _createImport2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee73(path) {
10605
10780
  var options,
10606
- _args72 = arguments;
10607
- return _regeneratorRuntime.wrap(function _callee72$(_context72) {
10781
+ _args73 = arguments;
10782
+ return _regeneratorRuntime.wrap(function _callee73$(_context73) {
10608
10783
  while (1) {
10609
- switch (_context72.prev = _context72.next) {
10784
+ switch (_context73.prev = _context73.next) {
10610
10785
  case 0:
10611
- options = _args72.length > 1 && _args72[1] !== undefined ? _args72[1] : {
10786
+ options = _args73.length > 1 && _args73[1] !== undefined ? _args73[1] : {
10612
10787
  mode: 'upsert'
10613
10788
  };
10614
- _context72.next = 3;
10789
+ _context73.next = 3;
10615
10790
  return this.post(this.baseURL + "/imports", _objectSpread({
10616
10791
  path: path
10617
10792
  }, options));
10618
10793
 
10619
10794
  case 3:
10620
- return _context72.abrupt("return", _context72.sent);
10795
+ return _context73.abrupt("return", _context73.sent);
10621
10796
 
10622
10797
  case 4:
10623
10798
  case "end":
10624
- return _context72.stop();
10799
+ return _context73.stop();
10625
10800
  }
10626
10801
  }
10627
- }, _callee72, this);
10802
+ }, _callee73, this);
10628
10803
  }));
10629
10804
 
10630
- function _createImport(_x96) {
10805
+ function _createImport(_x97) {
10631
10806
  return _createImport2.apply(this, arguments);
10632
10807
  }
10633
10808
 
@@ -10649,26 +10824,26 @@ var StreamChat = /*#__PURE__*/function () {
10649
10824
  }, {
10650
10825
  key: "_getImport",
10651
10826
  value: function () {
10652
- var _getImport2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee73(id) {
10653
- return _regeneratorRuntime.wrap(function _callee73$(_context73) {
10827
+ var _getImport2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee74(id) {
10828
+ return _regeneratorRuntime.wrap(function _callee74$(_context74) {
10654
10829
  while (1) {
10655
- switch (_context73.prev = _context73.next) {
10830
+ switch (_context74.prev = _context74.next) {
10656
10831
  case 0:
10657
- _context73.next = 2;
10832
+ _context74.next = 2;
10658
10833
  return this.get(this.baseURL + "/imports/".concat(id));
10659
10834
 
10660
10835
  case 2:
10661
- return _context73.abrupt("return", _context73.sent);
10836
+ return _context74.abrupt("return", _context74.sent);
10662
10837
 
10663
10838
  case 3:
10664
10839
  case "end":
10665
- return _context73.stop();
10840
+ return _context74.stop();
10666
10841
  }
10667
10842
  }
10668
- }, _callee73, this);
10843
+ }, _callee74, this);
10669
10844
  }));
10670
10845
 
10671
- function _getImport(_x97) {
10846
+ function _getImport(_x98) {
10672
10847
  return _getImport2.apply(this, arguments);
10673
10848
  }
10674
10849
 
@@ -10690,26 +10865,26 @@ var StreamChat = /*#__PURE__*/function () {
10690
10865
  }, {
10691
10866
  key: "_listImports",
10692
10867
  value: function () {
10693
- var _listImports2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee74(options) {
10694
- return _regeneratorRuntime.wrap(function _callee74$(_context74) {
10868
+ var _listImports2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee75(options) {
10869
+ return _regeneratorRuntime.wrap(function _callee75$(_context75) {
10695
10870
  while (1) {
10696
- switch (_context74.prev = _context74.next) {
10871
+ switch (_context75.prev = _context75.next) {
10697
10872
  case 0:
10698
- _context74.next = 2;
10873
+ _context75.next = 2;
10699
10874
  return this.get(this.baseURL + "/imports", options);
10700
10875
 
10701
10876
  case 2:
10702
- return _context74.abrupt("return", _context74.sent);
10877
+ return _context75.abrupt("return", _context75.sent);
10703
10878
 
10704
10879
  case 3:
10705
10880
  case "end":
10706
- return _context74.stop();
10881
+ return _context75.stop();
10707
10882
  }
10708
10883
  }
10709
- }, _callee74, this);
10884
+ }, _callee75, this);
10710
10885
  }));
10711
10886
 
10712
- function _listImports(_x98) {
10887
+ function _listImports(_x99) {
10713
10888
  return _listImports2.apply(this, arguments);
10714
10889
  }
10715
10890
 
@@ -10728,28 +10903,28 @@ var StreamChat = /*#__PURE__*/function () {
10728
10903
  }, {
10729
10904
  key: "upsertPushProvider",
10730
10905
  value: function () {
10731
- var _upsertPushProvider = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee75(pushProvider) {
10732
- return _regeneratorRuntime.wrap(function _callee75$(_context75) {
10906
+ var _upsertPushProvider = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee76(pushProvider) {
10907
+ return _regeneratorRuntime.wrap(function _callee76$(_context76) {
10733
10908
  while (1) {
10734
- switch (_context75.prev = _context75.next) {
10909
+ switch (_context76.prev = _context76.next) {
10735
10910
  case 0:
10736
- _context75.next = 2;
10911
+ _context76.next = 2;
10737
10912
  return this.post(this.baseURL + "/push_providers", {
10738
10913
  push_provider: pushProvider
10739
10914
  });
10740
10915
 
10741
10916
  case 2:
10742
- return _context75.abrupt("return", _context75.sent);
10917
+ return _context76.abrupt("return", _context76.sent);
10743
10918
 
10744
10919
  case 3:
10745
10920
  case "end":
10746
- return _context75.stop();
10921
+ return _context76.stop();
10747
10922
  }
10748
10923
  }
10749
- }, _callee75, this);
10924
+ }, _callee76, this);
10750
10925
  }));
10751
10926
 
10752
- function upsertPushProvider(_x99) {
10927
+ function upsertPushProvider(_x100) {
10753
10928
  return _upsertPushProvider.apply(this, arguments);
10754
10929
  }
10755
10930
 
@@ -10768,28 +10943,28 @@ var StreamChat = /*#__PURE__*/function () {
10768
10943
  }, {
10769
10944
  key: "deletePushProvider",
10770
10945
  value: function () {
10771
- var _deletePushProvider = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee76(_ref8) {
10946
+ var _deletePushProvider = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee77(_ref8) {
10772
10947
  var type, name;
10773
- return _regeneratorRuntime.wrap(function _callee76$(_context76) {
10948
+ return _regeneratorRuntime.wrap(function _callee77$(_context77) {
10774
10949
  while (1) {
10775
- switch (_context76.prev = _context76.next) {
10950
+ switch (_context77.prev = _context77.next) {
10776
10951
  case 0:
10777
10952
  type = _ref8.type, name = _ref8.name;
10778
- _context76.next = 3;
10953
+ _context77.next = 3;
10779
10954
  return this.delete(this.baseURL + "/push_providers/".concat(type, "/").concat(name));
10780
10955
 
10781
10956
  case 3:
10782
- return _context76.abrupt("return", _context76.sent);
10957
+ return _context77.abrupt("return", _context77.sent);
10783
10958
 
10784
10959
  case 4:
10785
10960
  case "end":
10786
- return _context76.stop();
10961
+ return _context77.stop();
10787
10962
  }
10788
10963
  }
10789
- }, _callee76, this);
10964
+ }, _callee77, this);
10790
10965
  }));
10791
10966
 
10792
- function deletePushProvider(_x100) {
10967
+ function deletePushProvider(_x101) {
10793
10968
  return _deletePushProvider.apply(this, arguments);
10794
10969
  }
10795
10970
 
@@ -10806,23 +10981,23 @@ var StreamChat = /*#__PURE__*/function () {
10806
10981
  }, {
10807
10982
  key: "listPushProviders",
10808
10983
  value: function () {
10809
- var _listPushProviders = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee77() {
10810
- return _regeneratorRuntime.wrap(function _callee77$(_context77) {
10984
+ var _listPushProviders = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee78() {
10985
+ return _regeneratorRuntime.wrap(function _callee78$(_context78) {
10811
10986
  while (1) {
10812
- switch (_context77.prev = _context77.next) {
10987
+ switch (_context78.prev = _context78.next) {
10813
10988
  case 0:
10814
- _context77.next = 2;
10989
+ _context78.next = 2;
10815
10990
  return this.get(this.baseURL + "/push_providers");
10816
10991
 
10817
10992
  case 2:
10818
- return _context77.abrupt("return", _context77.sent);
10993
+ return _context78.abrupt("return", _context78.sent);
10819
10994
 
10820
10995
  case 3:
10821
10996
  case "end":
10822
- return _context77.stop();
10997
+ return _context78.stop();
10823
10998
  }
10824
10999
  }
10825
- }, _callee77, this);
11000
+ }, _callee78, this);
10826
11001
  }));
10827
11002
 
10828
11003
  function listPushProviders() {
@@ -10925,5 +11100,5 @@ var BuiltinPermissions = {
10925
11100
  UseFrozenChannel: 'Send messages and reactions to frozen channels'
10926
11101
  };
10927
11102
 
10928
- export { Allow, AllowAll, AnyResource, AnyRole, BuiltinPermissions, BuiltinRoles, Channel, ChannelState, CheckSignature, ClientState, Deny, DenyAll, DevToken, EVENT_MAP, InsightMetrics, JWTServerToken, JWTUserToken, MaxPriority, MinPriority, Permission, StableWSConnection, StreamChat, TokenManager, UserFromToken, buildWsFatalInsight, buildWsSuccessAfterFailureInsight, chatCodes, decodeBase64, encodeBase64, isOwnUser, isValidEventType, logChatPromiseExecution, postInsights };
11103
+ export { Allow, AllowAll, AnyResource, AnyRole, BuiltinPermissions, BuiltinRoles, Channel, ChannelState, CheckSignature, ClientState, Deny, DenyAll, DevToken, EVENT_MAP, ErrorFromResponse, InsightMetrics, JWTServerToken, JWTUserToken, MaxPriority, MinPriority, Permission, StableWSConnection, StreamChat, TokenManager, UserFromToken, buildWsFatalInsight, buildWsSuccessAfterFailureInsight, chatCodes, decodeBase64, encodeBase64, isOwnUser, isValidEventType, logChatPromiseExecution, postInsights };
10929
11104
  //# sourceMappingURL=index.es.js.map