stream-chat 8.50.0 → 8.52.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
@@ -7408,6 +7408,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
7408
7408
  /**
7409
7409
  * Response Types
7410
7410
  */
7411
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
7411
7412
  // TODO: Figure out a way to strongly type set and unset.
7412
7413
  // Thumb URL(thumb_url) is added considering video attachments as the backend will return the thumbnail in the response.
7413
7414
 
@@ -7582,7 +7583,43 @@ var DEFAULT_PAGE_LIMIT = 50;
7582
7583
  var DEFAULT_SORT = [{
7583
7584
  created_at: -1
7584
7585
  }];
7585
- var MARK_AS_READ_THROTTLE_TIMEOUT = 1000;
7586
+ var MARK_AS_READ_THROTTLE_TIMEOUT = 1000; // TODO: remove this once we move to API v2
7587
+
7588
+ var THREAD_RESPONSE_RESERVED_KEYS = {
7589
+ channel: true,
7590
+ channel_cid: true,
7591
+ created_at: true,
7592
+ created_by_user_id: true,
7593
+ parent_message_id: true,
7594
+ title: true,
7595
+ updated_at: true,
7596
+ latest_replies: true,
7597
+ active_participant_count: true,
7598
+ deleted_at: true,
7599
+ last_message_at: true,
7600
+ participant_count: true,
7601
+ reply_count: true,
7602
+ read: true,
7603
+ thread_participants: true,
7604
+ created_by: true,
7605
+ parent_message: true
7606
+ }; // TODO: remove this once we move to API v2
7607
+
7608
+ var constructCustomDataObject = function constructCustomDataObject(threadData) {
7609
+ var custom = {};
7610
+
7611
+ for (var key in threadData) {
7612
+ if (THREAD_RESPONSE_RESERVED_KEYS[key]) {
7613
+ continue;
7614
+ }
7615
+
7616
+ var customKey = key;
7617
+ custom[customKey] = threadData[customKey];
7618
+ }
7619
+
7620
+ return custom;
7621
+ };
7622
+
7586
7623
  var Thread = /*#__PURE__*/function () {
7587
7624
  function Thread(_ref) {
7588
7625
  var _this = this,
@@ -7590,7 +7627,7 @@ var Thread = /*#__PURE__*/function () {
7590
7627
  _threadData$reply_cou;
7591
7628
 
7592
7629
  var client = _ref.client,
7593
- threadData = _ref.threadData;
7630
+ _threadData = _ref.threadData;
7594
7631
 
7595
7632
  _classCallCheck(this, Thread);
7596
7633
 
@@ -7704,6 +7741,8 @@ var Thread = /*#__PURE__*/function () {
7704
7741
  return;
7705
7742
  }
7706
7743
 
7744
+ _this.unsubscribeFunctions.add(_this.subscribeThreadUpdated());
7745
+
7707
7746
  _this.unsubscribeFunctions.add(_this.subscribeMarkActiveThreadRead());
7708
7747
 
7709
7748
  _this.unsubscribeFunctions.add(_this.subscribeReloadActiveStaleThread());
@@ -7719,6 +7758,24 @@ var Thread = /*#__PURE__*/function () {
7719
7758
  _this.unsubscribeFunctions.add(_this.subscribeMessageUpdated());
7720
7759
  });
7721
7760
 
7761
+ _defineProperty(this, "subscribeThreadUpdated", function () {
7762
+ return _this.client.on('thread.updated', function (event) {
7763
+ if (!event.thread || event.thread.parent_message_id !== _this.id) {
7764
+ return;
7765
+ }
7766
+
7767
+ var threadData = event.thread;
7768
+
7769
+ _this.state.partialNext({
7770
+ title: threadData.title,
7771
+ updatedAt: new Date(threadData.updated_at),
7772
+ deletedAt: threadData.deleted_at ? new Date(threadData.deleted_at) : null,
7773
+ // TODO: use threadData.custom once we move to API v2
7774
+ custom: constructCustomDataObject(threadData)
7775
+ });
7776
+ }).unsubscribe;
7777
+ });
7778
+
7722
7779
  _defineProperty(this, "subscribeMarkActiveThreadRead", function () {
7723
7780
  return _this.state.subscribeWithSelector(function (nextValue) {
7724
7781
  return {
@@ -8146,12 +8203,12 @@ var Thread = /*#__PURE__*/function () {
8146
8203
  };
8147
8204
  }());
8148
8205
 
8149
- var _channel = client.channel(threadData.channel.type, threadData.channel.id, {
8150
- name: threadData.channel.name
8206
+ var _channel = client.channel(_threadData.channel.type, _threadData.channel.id, {
8207
+ name: _threadData.channel.name
8151
8208
  });
8152
8209
 
8153
8210
  _channel._hydrateMembers({
8154
- members: (_threadData$channel$m = threadData.channel.members) !== null && _threadData$channel$m !== void 0 ? _threadData$channel$m : [],
8211
+ members: (_threadData$channel$m = _threadData.channel.members) !== null && _threadData$channel$m !== void 0 ? _threadData$channel$m : [],
8155
8212
  overrideCurrentState: false
8156
8213
  }); // For when read object is undefined and due to that unreadMessageCount for
8157
8214
  // the current user isn't being incremented on message.new
@@ -8165,21 +8222,26 @@ var Thread = /*#__PURE__*/function () {
8165
8222
  last_read: new Date().toISOString()
8166
8223
  }] : [];
8167
8224
  this.state = new StateStore({
8225
+ // local only
8168
8226
  active: false,
8169
- channel: _channel,
8170
- createdAt: new Date(threadData.created_at),
8171
- deletedAt: threadData.deleted_at ? new Date(threadData.deleted_at) : null,
8172
8227
  isLoading: false,
8173
8228
  isStateStale: false,
8174
- pagination: repliesPaginationFromInitialThread(threadData),
8175
- parentMessage: formatMessage(threadData.parent_message),
8176
- participants: threadData.thread_participants,
8177
- read: formatReadState(!threadData.read || threadData.read.length === 0 ? placeholderReadResponse : threadData.read),
8178
- replies: threadData.latest_replies.map(formatMessage),
8179
- replyCount: (_threadData$reply_cou = threadData.reply_count) !== null && _threadData$reply_cou !== void 0 ? _threadData$reply_cou : 0,
8180
- updatedAt: threadData.updated_at ? new Date(threadData.updated_at) : null
8229
+ // 99.9% should never change
8230
+ channel: _channel,
8231
+ createdAt: new Date(_threadData.created_at),
8232
+ // rest
8233
+ deletedAt: _threadData.deleted_at ? new Date(_threadData.deleted_at) : null,
8234
+ pagination: repliesPaginationFromInitialThread(_threadData),
8235
+ parentMessage: formatMessage(_threadData.parent_message),
8236
+ participants: _threadData.thread_participants,
8237
+ read: formatReadState(!_threadData.read || _threadData.read.length === 0 ? placeholderReadResponse : _threadData.read),
8238
+ replies: _threadData.latest_replies.map(formatMessage),
8239
+ replyCount: (_threadData$reply_cou = _threadData.reply_count) !== null && _threadData$reply_cou !== void 0 ? _threadData$reply_cou : 0,
8240
+ updatedAt: _threadData.updated_at ? new Date(_threadData.updated_at) : null,
8241
+ title: _threadData.title,
8242
+ custom: constructCustomDataObject(_threadData)
8181
8243
  });
8182
- this.id = threadData.parent_message_id;
8244
+ this.id = _threadData.parent_message_id;
8183
8245
  this.client = client;
8184
8246
  }
8185
8247
 
@@ -14307,6 +14369,48 @@ var StreamChat = /*#__PURE__*/function () {
14307
14369
 
14308
14370
  return translateMessage;
14309
14371
  }()
14372
+ /**
14373
+ * translate - translates the given text to provided language
14374
+ *
14375
+ * @param {string} text
14376
+ * @param {string} destination_language
14377
+ * @param {string} source_language
14378
+ *
14379
+ * @return {TranslateResponse} Response that includes the message
14380
+ */
14381
+
14382
+ }, {
14383
+ key: "translate",
14384
+ value: function () {
14385
+ var _translate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee59(text, destination_language, source_language) {
14386
+ return _regeneratorRuntime.wrap(function _callee59$(_context59) {
14387
+ while (1) {
14388
+ switch (_context59.prev = _context59.next) {
14389
+ case 0:
14390
+ _context59.next = 2;
14391
+ return this.post(this.baseURL + "/translate", {
14392
+ text: text,
14393
+ source_language: source_language,
14394
+ destination_language: destination_language
14395
+ });
14396
+
14397
+ case 2:
14398
+ return _context59.abrupt("return", _context59.sent);
14399
+
14400
+ case 3:
14401
+ case "end":
14402
+ return _context59.stop();
14403
+ }
14404
+ }
14405
+ }, _callee59, this);
14406
+ }));
14407
+
14408
+ function translate(_x75, _x76, _x77) {
14409
+ return _translate.apply(this, arguments);
14410
+ }
14411
+
14412
+ return translate;
14413
+ }()
14310
14414
  /**
14311
14415
  * _normalizeExpiration - transforms expiration value into ISO string
14312
14416
  * @param {undefined|null|number|string|Date} timeoutOrExpirationDate expiration date or timeout. Use number type to set timeout in seconds, string or Date to set exact expiration date
@@ -14403,14 +14507,14 @@ var StreamChat = /*#__PURE__*/function () {
14403
14507
  }, {
14404
14508
  key: "updateMessage",
14405
14509
  value: function () {
14406
- var _updateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee59(message, userId, options) {
14510
+ var _updateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee60(message, userId, options) {
14407
14511
  var clonedMessage, reservedMessageFields;
14408
- return _regeneratorRuntime.wrap(function _callee59$(_context59) {
14512
+ return _regeneratorRuntime.wrap(function _callee60$(_context60) {
14409
14513
  while (1) {
14410
- switch (_context59.prev = _context59.next) {
14514
+ switch (_context60.prev = _context60.next) {
14411
14515
  case 0:
14412
14516
  if (message.id) {
14413
- _context59.next = 2;
14517
+ _context60.next = 2;
14414
14518
  break;
14415
14519
  }
14416
14520
 
@@ -14447,23 +14551,23 @@ var StreamChat = /*#__PURE__*/function () {
14447
14551
  });
14448
14552
  }
14449
14553
 
14450
- _context59.next = 10;
14554
+ _context60.next = 10;
14451
14555
  return this.post(this.baseURL + "/messages/".concat(encodeURIComponent(message.id)), _objectSpread({
14452
14556
  message: clonedMessage
14453
14557
  }, options));
14454
14558
 
14455
14559
  case 10:
14456
- return _context59.abrupt("return", _context59.sent);
14560
+ return _context60.abrupt("return", _context60.sent);
14457
14561
 
14458
14562
  case 11:
14459
14563
  case "end":
14460
- return _context59.stop();
14564
+ return _context60.stop();
14461
14565
  }
14462
14566
  }
14463
- }, _callee59, this);
14567
+ }, _callee60, this);
14464
14568
  }));
14465
14569
 
14466
- function updateMessage(_x75, _x76, _x77) {
14570
+ function updateMessage(_x78, _x79, _x80) {
14467
14571
  return _updateMessage.apply(this, arguments);
14468
14572
  }
14469
14573
 
@@ -14486,14 +14590,14 @@ var StreamChat = /*#__PURE__*/function () {
14486
14590
  }, {
14487
14591
  key: "partialUpdateMessage",
14488
14592
  value: function () {
14489
- var _partialUpdateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee60(id, partialMessageObject, userId, options) {
14593
+ var _partialUpdateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee61(id, partialMessageObject, userId, options) {
14490
14594
  var user;
14491
- return _regeneratorRuntime.wrap(function _callee60$(_context60) {
14595
+ return _regeneratorRuntime.wrap(function _callee61$(_context61) {
14492
14596
  while (1) {
14493
- switch (_context60.prev = _context60.next) {
14597
+ switch (_context61.prev = _context61.next) {
14494
14598
  case 0:
14495
14599
  if (id) {
14496
- _context60.next = 2;
14600
+ _context61.next = 2;
14497
14601
  break;
14498
14602
  }
14499
14603
 
@@ -14508,23 +14612,23 @@ var StreamChat = /*#__PURE__*/function () {
14508
14612
  };
14509
14613
  }
14510
14614
 
14511
- _context60.next = 6;
14615
+ _context61.next = 6;
14512
14616
  return this.put(this.baseURL + "/messages/".concat(encodeURIComponent(id)), _objectSpread(_objectSpread(_objectSpread({}, partialMessageObject), options), {}, {
14513
14617
  user: user
14514
14618
  }));
14515
14619
 
14516
14620
  case 6:
14517
- return _context60.abrupt("return", _context60.sent);
14621
+ return _context61.abrupt("return", _context61.sent);
14518
14622
 
14519
14623
  case 7:
14520
14624
  case "end":
14521
- return _context60.stop();
14625
+ return _context61.stop();
14522
14626
  }
14523
14627
  }
14524
- }, _callee60, this);
14628
+ }, _callee61, this);
14525
14629
  }));
14526
14630
 
14527
- function partialUpdateMessage(_x78, _x79, _x80, _x81) {
14631
+ function partialUpdateMessage(_x81, _x82, _x83, _x84) {
14528
14632
  return _partialUpdateMessage.apply(this, arguments);
14529
14633
  }
14530
14634
 
@@ -14533,11 +14637,11 @@ var StreamChat = /*#__PURE__*/function () {
14533
14637
  }, {
14534
14638
  key: "deleteMessage",
14535
14639
  value: function () {
14536
- var _deleteMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee61(messageID, hardDelete) {
14640
+ var _deleteMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee62(messageID, hardDelete) {
14537
14641
  var params;
14538
- return _regeneratorRuntime.wrap(function _callee61$(_context61) {
14642
+ return _regeneratorRuntime.wrap(function _callee62$(_context62) {
14539
14643
  while (1) {
14540
- switch (_context61.prev = _context61.next) {
14644
+ switch (_context62.prev = _context62.next) {
14541
14645
  case 0:
14542
14646
  params = {};
14543
14647
 
@@ -14547,21 +14651,21 @@ var StreamChat = /*#__PURE__*/function () {
14547
14651
  };
14548
14652
  }
14549
14653
 
14550
- _context61.next = 4;
14654
+ _context62.next = 4;
14551
14655
  return this.delete(this.baseURL + "/messages/".concat(encodeURIComponent(messageID)), params);
14552
14656
 
14553
14657
  case 4:
14554
- return _context61.abrupt("return", _context61.sent);
14658
+ return _context62.abrupt("return", _context62.sent);
14555
14659
 
14556
14660
  case 5:
14557
14661
  case "end":
14558
- return _context61.stop();
14662
+ return _context62.stop();
14559
14663
  }
14560
14664
  }
14561
- }, _callee61, this);
14665
+ }, _callee62, this);
14562
14666
  }));
14563
14667
 
14564
- function deleteMessage(_x82, _x83) {
14668
+ function deleteMessage(_x85, _x86) {
14565
14669
  return _deleteMessage.apply(this, arguments);
14566
14670
  }
14567
14671
 
@@ -14583,28 +14687,28 @@ var StreamChat = /*#__PURE__*/function () {
14583
14687
  }, {
14584
14688
  key: "undeleteMessage",
14585
14689
  value: function () {
14586
- var _undeleteMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee62(messageID, userID) {
14587
- return _regeneratorRuntime.wrap(function _callee62$(_context62) {
14690
+ var _undeleteMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee63(messageID, userID) {
14691
+ return _regeneratorRuntime.wrap(function _callee63$(_context63) {
14588
14692
  while (1) {
14589
- switch (_context62.prev = _context62.next) {
14693
+ switch (_context63.prev = _context63.next) {
14590
14694
  case 0:
14591
- _context62.next = 2;
14695
+ _context63.next = 2;
14592
14696
  return this.post(this.baseURL + "/messages/".concat(encodeURIComponent(messageID), "/undelete"), {
14593
14697
  undeleted_by: userID
14594
14698
  });
14595
14699
 
14596
14700
  case 2:
14597
- return _context62.abrupt("return", _context62.sent);
14701
+ return _context63.abrupt("return", _context63.sent);
14598
14702
 
14599
14703
  case 3:
14600
14704
  case "end":
14601
- return _context62.stop();
14705
+ return _context63.stop();
14602
14706
  }
14603
14707
  }
14604
- }, _callee62, this);
14708
+ }, _callee63, this);
14605
14709
  }));
14606
14710
 
14607
- function undeleteMessage(_x84, _x85) {
14711
+ function undeleteMessage(_x87, _x88) {
14608
14712
  return _undeleteMessage.apply(this, arguments);
14609
14713
  }
14610
14714
 
@@ -14613,26 +14717,26 @@ var StreamChat = /*#__PURE__*/function () {
14613
14717
  }, {
14614
14718
  key: "getMessage",
14615
14719
  value: function () {
14616
- var _getMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee63(messageID, options) {
14617
- return _regeneratorRuntime.wrap(function _callee63$(_context63) {
14720
+ var _getMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee64(messageID, options) {
14721
+ return _regeneratorRuntime.wrap(function _callee64$(_context64) {
14618
14722
  while (1) {
14619
- switch (_context63.prev = _context63.next) {
14723
+ switch (_context64.prev = _context64.next) {
14620
14724
  case 0:
14621
- _context63.next = 2;
14725
+ _context64.next = 2;
14622
14726
  return this.get(this.baseURL + "/messages/".concat(encodeURIComponent(messageID)), _objectSpread({}, options));
14623
14727
 
14624
14728
  case 2:
14625
- return _context63.abrupt("return", _context63.sent);
14729
+ return _context64.abrupt("return", _context64.sent);
14626
14730
 
14627
14731
  case 3:
14628
14732
  case "end":
14629
- return _context63.stop();
14733
+ return _context64.stop();
14630
14734
  }
14631
14735
  }
14632
- }, _callee63, this);
14736
+ }, _callee64, this);
14633
14737
  }));
14634
14738
 
14635
- function getMessage(_x86, _x87) {
14739
+ function getMessage(_x89, _x90) {
14636
14740
  return _getMessage.apply(this, arguments);
14637
14741
  }
14638
14742
 
@@ -14653,44 +14757,48 @@ var StreamChat = /*#__PURE__*/function () {
14653
14757
  }, {
14654
14758
  key: "queryThreads",
14655
14759
  value: function () {
14656
- var _queryThreads = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee64(options) {
14760
+ var _queryThreads = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee65() {
14657
14761
  var _this5 = this;
14658
14762
 
14659
- var opts, res;
14660
- return _regeneratorRuntime.wrap(function _callee64$(_context64) {
14763
+ var options,
14764
+ optionsWithDefaults,
14765
+ response,
14766
+ _args65 = arguments;
14767
+ return _regeneratorRuntime.wrap(function _callee65$(_context65) {
14661
14768
  while (1) {
14662
- switch (_context64.prev = _context64.next) {
14769
+ switch (_context65.prev = _context65.next) {
14663
14770
  case 0:
14664
- opts = _objectSpread({
14771
+ options = _args65.length > 0 && _args65[0] !== undefined ? _args65[0] : {};
14772
+ optionsWithDefaults = _objectSpread({
14665
14773
  limit: 10,
14666
14774
  participant_limit: 10,
14667
14775
  reply_limit: 3,
14668
14776
  watch: true
14669
14777
  }, options);
14670
- _context64.next = 3;
14671
- return this.post(this.baseURL + "/threads", opts);
14778
+ _context65.next = 4;
14779
+ return this.post("".concat(this.baseURL, "/threads"), optionsWithDefaults);
14672
14780
 
14673
- case 3:
14674
- res = _context64.sent;
14675
- return _context64.abrupt("return", {
14676
- threads: res.threads.map(function (thread) {
14781
+ case 4:
14782
+ response = _context65.sent;
14783
+ return _context65.abrupt("return", {
14784
+ threads: response.threads.map(function (thread) {
14677
14785
  return new Thread({
14678
14786
  client: _this5,
14679
14787
  threadData: thread
14680
14788
  });
14681
14789
  }),
14682
- next: res.next
14790
+ next: response.next
14683
14791
  });
14684
14792
 
14685
- case 5:
14793
+ case 6:
14686
14794
  case "end":
14687
- return _context64.stop();
14795
+ return _context65.stop();
14688
14796
  }
14689
14797
  }
14690
- }, _callee64, this);
14798
+ }, _callee65, this);
14691
14799
  }));
14692
14800
 
14693
- function queryThreads(_x88) {
14801
+ function queryThreads() {
14694
14802
  return _queryThreads.apply(this, arguments);
14695
14803
  }
14696
14804
 
@@ -14711,49 +14819,49 @@ var StreamChat = /*#__PURE__*/function () {
14711
14819
  }, {
14712
14820
  key: "getThread",
14713
14821
  value: function () {
14714
- var _getThread = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee65(messageId) {
14822
+ var _getThread = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee66(messageId) {
14715
14823
  var options,
14716
- opts,
14717
- res,
14718
- _args65 = arguments;
14719
- return _regeneratorRuntime.wrap(function _callee65$(_context65) {
14824
+ optionsWithDefaults,
14825
+ response,
14826
+ _args66 = arguments;
14827
+ return _regeneratorRuntime.wrap(function _callee66$(_context66) {
14720
14828
  while (1) {
14721
- switch (_context65.prev = _context65.next) {
14829
+ switch (_context66.prev = _context66.next) {
14722
14830
  case 0:
14723
- options = _args65.length > 1 && _args65[1] !== undefined ? _args65[1] : {};
14831
+ options = _args66.length > 1 && _args66[1] !== undefined ? _args66[1] : {};
14724
14832
 
14725
14833
  if (messageId) {
14726
- _context65.next = 3;
14834
+ _context66.next = 3;
14727
14835
  break;
14728
14836
  }
14729
14837
 
14730
- throw Error('Please specify the message id when calling partialUpdateThread');
14838
+ throw Error('Please specify the messageId when calling getThread');
14731
14839
 
14732
14840
  case 3:
14733
- opts = _objectSpread({
14841
+ optionsWithDefaults = _objectSpread({
14734
14842
  participant_limit: 100,
14735
14843
  reply_limit: 3,
14736
14844
  watch: true
14737
14845
  }, options);
14738
- _context65.next = 6;
14739
- return this.get(this.baseURL + "/threads/".concat(encodeURIComponent(messageId)), opts);
14846
+ _context66.next = 6;
14847
+ return this.get("".concat(this.baseURL, "/threads/").concat(encodeURIComponent(messageId)), optionsWithDefaults);
14740
14848
 
14741
14849
  case 6:
14742
- res = _context65.sent;
14743
- return _context65.abrupt("return", new Thread({
14850
+ response = _context66.sent;
14851
+ return _context66.abrupt("return", new Thread({
14744
14852
  client: this,
14745
- threadData: res.thread
14853
+ threadData: response.thread
14746
14854
  }));
14747
14855
 
14748
14856
  case 8:
14749
14857
  case "end":
14750
- return _context65.stop();
14858
+ return _context66.stop();
14751
14859
  }
14752
14860
  }
14753
- }, _callee65, this);
14861
+ }, _callee66, this);
14754
14862
  }));
14755
14863
 
14756
- function getThread(_x89) {
14864
+ function getThread(_x91) {
14757
14865
  return _getThread.apply(this, arguments);
14758
14866
  }
14759
14867
 
@@ -14771,15 +14879,15 @@ var StreamChat = /*#__PURE__*/function () {
14771
14879
  }, {
14772
14880
  key: "partialUpdateThread",
14773
14881
  value: function () {
14774
- var _partialUpdateThread = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee66(messageId, partialThreadObject) {
14882
+ var _partialUpdateThread = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee67(messageId, partialThreadObject) {
14775
14883
  var reservedThreadFields, _key5;
14776
14884
 
14777
- return _regeneratorRuntime.wrap(function _callee66$(_context66) {
14885
+ return _regeneratorRuntime.wrap(function _callee67$(_context67) {
14778
14886
  while (1) {
14779
- switch (_context66.prev = _context66.next) {
14887
+ switch (_context67.prev = _context67.next) {
14780
14888
  case 0:
14781
14889
  if (messageId) {
14782
- _context66.next = 2;
14890
+ _context67.next = 2;
14783
14891
  break;
14784
14892
  }
14785
14893
 
@@ -14788,44 +14896,44 @@ var StreamChat = /*#__PURE__*/function () {
14788
14896
  case 2:
14789
14897
  // check for reserved fields from ThreadResponse type within partialThreadObject's set and unset.
14790
14898
  // Throw error if any of the reserved field is found.
14791
- reservedThreadFields = ['created_at', 'id', 'last_message_at', 'type', 'updated_at', 'user', 'reply_count', 'participants', 'channel'];
14792
- _context66.t0 = _regeneratorRuntime.keys(_objectSpread(_objectSpread({}, partialThreadObject.set), partialThreadObject.unset));
14899
+ reservedThreadFields = ['created_at', 'id', 'last_message_at', 'type', 'updated_at', 'user', 'reply_count', 'participants', 'channel', 'custom'];
14900
+ _context67.t0 = _regeneratorRuntime.keys(_objectSpread(_objectSpread({}, partialThreadObject.set), partialThreadObject.unset));
14793
14901
 
14794
14902
  case 4:
14795
- if ((_context66.t1 = _context66.t0()).done) {
14796
- _context66.next = 10;
14903
+ if ((_context67.t1 = _context67.t0()).done) {
14904
+ _context67.next = 10;
14797
14905
  break;
14798
14906
  }
14799
14907
 
14800
- _key5 = _context66.t1.value;
14908
+ _key5 = _context67.t1.value;
14801
14909
 
14802
14910
  if (!reservedThreadFields.includes(_key5)) {
14803
- _context66.next = 8;
14911
+ _context67.next = 8;
14804
14912
  break;
14805
14913
  }
14806
14914
 
14807
14915
  throw Error("You cannot set ".concat(_key5, " field on Thread object. ").concat(_key5, " is reserved for server-side use. Please omit ").concat(_key5, " from your set object."));
14808
14916
 
14809
14917
  case 8:
14810
- _context66.next = 4;
14918
+ _context67.next = 4;
14811
14919
  break;
14812
14920
 
14813
14921
  case 10:
14814
- _context66.next = 12;
14815
- return this.patch(this.baseURL + "/threads/".concat(encodeURIComponent(messageId)), partialThreadObject);
14922
+ _context67.next = 12;
14923
+ return this.patch("".concat(this.baseURL, "/threads/").concat(encodeURIComponent(messageId)), partialThreadObject);
14816
14924
 
14817
14925
  case 12:
14818
- return _context66.abrupt("return", _context66.sent);
14926
+ return _context67.abrupt("return", _context67.sent);
14819
14927
 
14820
14928
  case 13:
14821
14929
  case "end":
14822
- return _context66.stop();
14930
+ return _context67.stop();
14823
14931
  }
14824
14932
  }
14825
- }, _callee66, this);
14933
+ }, _callee67, this);
14826
14934
  }));
14827
14935
 
14828
- function partialUpdateThread(_x90, _x91) {
14936
+ function partialUpdateThread(_x92, _x93) {
14829
14937
  return _partialUpdateThread.apply(this, arguments);
14830
14938
  }
14831
14939
 
@@ -14834,7 +14942,7 @@ var StreamChat = /*#__PURE__*/function () {
14834
14942
  }, {
14835
14943
  key: "getUserAgent",
14836
14944
  value: function getUserAgent() {
14837
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.50.0");
14945
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.52.0");
14838
14946
  }
14839
14947
  }, {
14840
14948
  key: "setUserAgent",
@@ -15053,28 +15161,28 @@ var StreamChat = /*#__PURE__*/function () {
15053
15161
  }, {
15054
15162
  key: "sendUserCustomEvent",
15055
15163
  value: function () {
15056
- var _sendUserCustomEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee67(targetUserID, event) {
15057
- return _regeneratorRuntime.wrap(function _callee67$(_context67) {
15164
+ var _sendUserCustomEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee68(targetUserID, event) {
15165
+ return _regeneratorRuntime.wrap(function _callee68$(_context68) {
15058
15166
  while (1) {
15059
- switch (_context67.prev = _context67.next) {
15167
+ switch (_context68.prev = _context68.next) {
15060
15168
  case 0:
15061
- _context67.next = 2;
15169
+ _context68.next = 2;
15062
15170
  return this.post("".concat(this.baseURL, "/users/").concat(encodeURIComponent(targetUserID), "/event"), {
15063
15171
  event: event
15064
15172
  });
15065
15173
 
15066
15174
  case 2:
15067
- return _context67.abrupt("return", _context67.sent);
15175
+ return _context68.abrupt("return", _context68.sent);
15068
15176
 
15069
15177
  case 3:
15070
15178
  case "end":
15071
- return _context67.stop();
15179
+ return _context68.stop();
15072
15180
  }
15073
15181
  }
15074
- }, _callee67, this);
15182
+ }, _callee68, this);
15075
15183
  }));
15076
15184
 
15077
- function sendUserCustomEvent(_x92, _x93) {
15185
+ function sendUserCustomEvent(_x94, _x95) {
15078
15186
  return _sendUserCustomEvent.apply(this, arguments);
15079
15187
  }
15080
15188
 
@@ -15171,28 +15279,28 @@ var StreamChat = /*#__PURE__*/function () {
15171
15279
  }, {
15172
15280
  key: "createSegment",
15173
15281
  value: function () {
15174
- var _createSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee68(type, id, data) {
15282
+ var _createSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee69(type, id, data) {
15175
15283
  var body;
15176
- return _regeneratorRuntime.wrap(function _callee68$(_context68) {
15284
+ return _regeneratorRuntime.wrap(function _callee69$(_context69) {
15177
15285
  while (1) {
15178
- switch (_context68.prev = _context68.next) {
15286
+ switch (_context69.prev = _context69.next) {
15179
15287
  case 0:
15180
15288
  this.validateServerSideAuth();
15181
15289
  body = _objectSpread({
15182
15290
  id: id,
15183
15291
  type: type
15184
15292
  }, data);
15185
- return _context68.abrupt("return", this.post(this.baseURL + "/segments", body));
15293
+ return _context69.abrupt("return", this.post(this.baseURL + "/segments", body));
15186
15294
 
15187
15295
  case 3:
15188
15296
  case "end":
15189
- return _context68.stop();
15297
+ return _context69.stop();
15190
15298
  }
15191
15299
  }
15192
- }, _callee68, this);
15300
+ }, _callee69, this);
15193
15301
  }));
15194
15302
 
15195
- function createSegment(_x94, _x95, _x96) {
15303
+ function createSegment(_x96, _x97, _x98) {
15196
15304
  return _createSegment.apply(this, arguments);
15197
15305
  }
15198
15306
 
@@ -15211,23 +15319,23 @@ var StreamChat = /*#__PURE__*/function () {
15211
15319
  }, {
15212
15320
  key: "createUserSegment",
15213
15321
  value: function () {
15214
- var _createUserSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee69(id, data) {
15215
- return _regeneratorRuntime.wrap(function _callee69$(_context69) {
15322
+ var _createUserSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee70(id, data) {
15323
+ return _regeneratorRuntime.wrap(function _callee70$(_context70) {
15216
15324
  while (1) {
15217
- switch (_context69.prev = _context69.next) {
15325
+ switch (_context70.prev = _context70.next) {
15218
15326
  case 0:
15219
15327
  this.validateServerSideAuth();
15220
- return _context69.abrupt("return", this.createSegment('user', id, data));
15328
+ return _context70.abrupt("return", this.createSegment('user', id, data));
15221
15329
 
15222
15330
  case 2:
15223
15331
  case "end":
15224
- return _context69.stop();
15332
+ return _context70.stop();
15225
15333
  }
15226
15334
  }
15227
- }, _callee69, this);
15335
+ }, _callee70, this);
15228
15336
  }));
15229
15337
 
15230
- function createUserSegment(_x97, _x98) {
15338
+ function createUserSegment(_x99, _x100) {
15231
15339
  return _createUserSegment.apply(this, arguments);
15232
15340
  }
15233
15341
 
@@ -15246,23 +15354,23 @@ var StreamChat = /*#__PURE__*/function () {
15246
15354
  }, {
15247
15355
  key: "createChannelSegment",
15248
15356
  value: function () {
15249
- var _createChannelSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee70(id, data) {
15250
- return _regeneratorRuntime.wrap(function _callee70$(_context70) {
15357
+ var _createChannelSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee71(id, data) {
15358
+ return _regeneratorRuntime.wrap(function _callee71$(_context71) {
15251
15359
  while (1) {
15252
- switch (_context70.prev = _context70.next) {
15360
+ switch (_context71.prev = _context71.next) {
15253
15361
  case 0:
15254
15362
  this.validateServerSideAuth();
15255
- return _context70.abrupt("return", this.createSegment('channel', id, data));
15363
+ return _context71.abrupt("return", this.createSegment('channel', id, data));
15256
15364
 
15257
15365
  case 2:
15258
15366
  case "end":
15259
- return _context70.stop();
15367
+ return _context71.stop();
15260
15368
  }
15261
15369
  }
15262
- }, _callee70, this);
15370
+ }, _callee71, this);
15263
15371
  }));
15264
15372
 
15265
- function createChannelSegment(_x99, _x100) {
15373
+ function createChannelSegment(_x101, _x102) {
15266
15374
  return _createChannelSegment.apply(this, arguments);
15267
15375
  }
15268
15376
 
@@ -15271,23 +15379,23 @@ var StreamChat = /*#__PURE__*/function () {
15271
15379
  }, {
15272
15380
  key: "getSegment",
15273
15381
  value: function () {
15274
- var _getSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee71(id) {
15275
- return _regeneratorRuntime.wrap(function _callee71$(_context71) {
15382
+ var _getSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee72(id) {
15383
+ return _regeneratorRuntime.wrap(function _callee72$(_context72) {
15276
15384
  while (1) {
15277
- switch (_context71.prev = _context71.next) {
15385
+ switch (_context72.prev = _context72.next) {
15278
15386
  case 0:
15279
15387
  this.validateServerSideAuth();
15280
- return _context71.abrupt("return", this.get(this.baseURL + "/segments/".concat(encodeURIComponent(id))));
15388
+ return _context72.abrupt("return", this.get(this.baseURL + "/segments/".concat(encodeURIComponent(id))));
15281
15389
 
15282
15390
  case 2:
15283
15391
  case "end":
15284
- return _context71.stop();
15392
+ return _context72.stop();
15285
15393
  }
15286
15394
  }
15287
- }, _callee71, this);
15395
+ }, _callee72, this);
15288
15396
  }));
15289
15397
 
15290
- function getSegment(_x101) {
15398
+ function getSegment(_x103) {
15291
15399
  return _getSegment.apply(this, arguments);
15292
15400
  }
15293
15401
 
@@ -15305,23 +15413,23 @@ var StreamChat = /*#__PURE__*/function () {
15305
15413
  }, {
15306
15414
  key: "updateSegment",
15307
15415
  value: function () {
15308
- var _updateSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee72(id, data) {
15309
- return _regeneratorRuntime.wrap(function _callee72$(_context72) {
15416
+ var _updateSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee73(id, data) {
15417
+ return _regeneratorRuntime.wrap(function _callee73$(_context73) {
15310
15418
  while (1) {
15311
- switch (_context72.prev = _context72.next) {
15419
+ switch (_context73.prev = _context73.next) {
15312
15420
  case 0:
15313
15421
  this.validateServerSideAuth();
15314
- return _context72.abrupt("return", this.put(this.baseURL + "/segments/".concat(encodeURIComponent(id)), data));
15422
+ return _context73.abrupt("return", this.put(this.baseURL + "/segments/".concat(encodeURIComponent(id)), data));
15315
15423
 
15316
15424
  case 2:
15317
15425
  case "end":
15318
- return _context72.stop();
15426
+ return _context73.stop();
15319
15427
  }
15320
15428
  }
15321
- }, _callee72, this);
15429
+ }, _callee73, this);
15322
15430
  }));
15323
15431
 
15324
- function updateSegment(_x102, _x103) {
15432
+ function updateSegment(_x104, _x105) {
15325
15433
  return _updateSegment.apply(this, arguments);
15326
15434
  }
15327
15435
 
@@ -15339,27 +15447,27 @@ var StreamChat = /*#__PURE__*/function () {
15339
15447
  }, {
15340
15448
  key: "addSegmentTargets",
15341
15449
  value: function () {
15342
- var _addSegmentTargets = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee73(id, targets) {
15450
+ var _addSegmentTargets = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee74(id, targets) {
15343
15451
  var body;
15344
- return _regeneratorRuntime.wrap(function _callee73$(_context73) {
15452
+ return _regeneratorRuntime.wrap(function _callee74$(_context74) {
15345
15453
  while (1) {
15346
- switch (_context73.prev = _context73.next) {
15454
+ switch (_context74.prev = _context74.next) {
15347
15455
  case 0:
15348
15456
  this.validateServerSideAuth();
15349
15457
  body = {
15350
15458
  target_ids: targets
15351
15459
  };
15352
- return _context73.abrupt("return", this.post(this.baseURL + "/segments/".concat(encodeURIComponent(id), "/addtargets"), body));
15460
+ return _context74.abrupt("return", this.post(this.baseURL + "/segments/".concat(encodeURIComponent(id), "/addtargets"), body));
15353
15461
 
15354
15462
  case 3:
15355
15463
  case "end":
15356
- return _context73.stop();
15464
+ return _context74.stop();
15357
15465
  }
15358
15466
  }
15359
- }, _callee73, this);
15467
+ }, _callee74, this);
15360
15468
  }));
15361
15469
 
15362
- function addSegmentTargets(_x104, _x105) {
15470
+ function addSegmentTargets(_x106, _x107) {
15363
15471
  return _addSegmentTargets.apply(this, arguments);
15364
15472
  }
15365
15473
 
@@ -15368,33 +15476,33 @@ var StreamChat = /*#__PURE__*/function () {
15368
15476
  }, {
15369
15477
  key: "querySegmentTargets",
15370
15478
  value: function () {
15371
- var _querySegmentTargets = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee74(id) {
15479
+ var _querySegmentTargets = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee75(id) {
15372
15480
  var filter,
15373
15481
  sort,
15374
15482
  options,
15375
- _args74 = arguments;
15376
- return _regeneratorRuntime.wrap(function _callee74$(_context74) {
15483
+ _args75 = arguments;
15484
+ return _regeneratorRuntime.wrap(function _callee75$(_context75) {
15377
15485
  while (1) {
15378
- switch (_context74.prev = _context74.next) {
15486
+ switch (_context75.prev = _context75.next) {
15379
15487
  case 0:
15380
- filter = _args74.length > 1 && _args74[1] !== undefined ? _args74[1] : {};
15381
- sort = _args74.length > 2 && _args74[2] !== undefined ? _args74[2] : [];
15382
- options = _args74.length > 3 && _args74[3] !== undefined ? _args74[3] : {};
15488
+ filter = _args75.length > 1 && _args75[1] !== undefined ? _args75[1] : {};
15489
+ sort = _args75.length > 2 && _args75[2] !== undefined ? _args75[2] : [];
15490
+ options = _args75.length > 3 && _args75[3] !== undefined ? _args75[3] : {};
15383
15491
  this.validateServerSideAuth();
15384
- return _context74.abrupt("return", this.post(this.baseURL + "/segments/".concat(encodeURIComponent(id), "/targets/query"), _objectSpread({
15492
+ return _context75.abrupt("return", this.post(this.baseURL + "/segments/".concat(encodeURIComponent(id), "/targets/query"), _objectSpread({
15385
15493
  filter: filter || {},
15386
15494
  sort: sort || []
15387
15495
  }, options)));
15388
15496
 
15389
15497
  case 5:
15390
15498
  case "end":
15391
- return _context74.stop();
15499
+ return _context75.stop();
15392
15500
  }
15393
15501
  }
15394
- }, _callee74, this);
15502
+ }, _callee75, this);
15395
15503
  }));
15396
15504
 
15397
- function querySegmentTargets(_x106) {
15505
+ function querySegmentTargets(_x108) {
15398
15506
  return _querySegmentTargets.apply(this, arguments);
15399
15507
  }
15400
15508
 
@@ -15412,27 +15520,27 @@ var StreamChat = /*#__PURE__*/function () {
15412
15520
  }, {
15413
15521
  key: "removeSegmentTargets",
15414
15522
  value: function () {
15415
- var _removeSegmentTargets = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee75(id, targets) {
15523
+ var _removeSegmentTargets = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee76(id, targets) {
15416
15524
  var body;
15417
- return _regeneratorRuntime.wrap(function _callee75$(_context75) {
15525
+ return _regeneratorRuntime.wrap(function _callee76$(_context76) {
15418
15526
  while (1) {
15419
- switch (_context75.prev = _context75.next) {
15527
+ switch (_context76.prev = _context76.next) {
15420
15528
  case 0:
15421
15529
  this.validateServerSideAuth();
15422
15530
  body = {
15423
15531
  target_ids: targets
15424
15532
  };
15425
- return _context75.abrupt("return", this.post(this.baseURL + "/segments/".concat(encodeURIComponent(id), "/deletetargets"), body));
15533
+ return _context76.abrupt("return", this.post(this.baseURL + "/segments/".concat(encodeURIComponent(id), "/deletetargets"), body));
15426
15534
 
15427
15535
  case 3:
15428
15536
  case "end":
15429
- return _context75.stop();
15537
+ return _context76.stop();
15430
15538
  }
15431
15539
  }
15432
- }, _callee75, this);
15540
+ }, _callee76, this);
15433
15541
  }));
15434
15542
 
15435
- function removeSegmentTargets(_x107, _x108) {
15543
+ function removeSegmentTargets(_x109, _x110) {
15436
15544
  return _removeSegmentTargets.apply(this, arguments);
15437
15545
  }
15438
15546
 
@@ -15450,29 +15558,29 @@ var StreamChat = /*#__PURE__*/function () {
15450
15558
  }, {
15451
15559
  key: "querySegments",
15452
15560
  value: function () {
15453
- var _querySegments = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee76(filter, sort) {
15561
+ var _querySegments = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee77(filter, sort) {
15454
15562
  var options,
15455
- _args76 = arguments;
15456
- return _regeneratorRuntime.wrap(function _callee76$(_context76) {
15563
+ _args77 = arguments;
15564
+ return _regeneratorRuntime.wrap(function _callee77$(_context77) {
15457
15565
  while (1) {
15458
- switch (_context76.prev = _context76.next) {
15566
+ switch (_context77.prev = _context77.next) {
15459
15567
  case 0:
15460
- options = _args76.length > 2 && _args76[2] !== undefined ? _args76[2] : {};
15568
+ options = _args77.length > 2 && _args77[2] !== undefined ? _args77[2] : {};
15461
15569
  this.validateServerSideAuth();
15462
- return _context76.abrupt("return", this.post(this.baseURL + "/segments/query", _objectSpread({
15570
+ return _context77.abrupt("return", this.post(this.baseURL + "/segments/query", _objectSpread({
15463
15571
  filter: filter,
15464
15572
  sort: sort
15465
15573
  }, options)));
15466
15574
 
15467
15575
  case 3:
15468
15576
  case "end":
15469
- return _context76.stop();
15577
+ return _context77.stop();
15470
15578
  }
15471
15579
  }
15472
- }, _callee76, this);
15580
+ }, _callee77, this);
15473
15581
  }));
15474
15582
 
15475
- function querySegments(_x109, _x110) {
15583
+ function querySegments(_x111, _x112) {
15476
15584
  return _querySegments.apply(this, arguments);
15477
15585
  }
15478
15586
 
@@ -15489,23 +15597,23 @@ var StreamChat = /*#__PURE__*/function () {
15489
15597
  }, {
15490
15598
  key: "deleteSegment",
15491
15599
  value: function () {
15492
- var _deleteSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee77(id) {
15493
- return _regeneratorRuntime.wrap(function _callee77$(_context77) {
15600
+ var _deleteSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee78(id) {
15601
+ return _regeneratorRuntime.wrap(function _callee78$(_context78) {
15494
15602
  while (1) {
15495
- switch (_context77.prev = _context77.next) {
15603
+ switch (_context78.prev = _context78.next) {
15496
15604
  case 0:
15497
15605
  this.validateServerSideAuth();
15498
- return _context77.abrupt("return", this.delete(this.baseURL + "/segments/".concat(encodeURIComponent(id))));
15606
+ return _context78.abrupt("return", this.delete(this.baseURL + "/segments/".concat(encodeURIComponent(id))));
15499
15607
 
15500
15608
  case 2:
15501
15609
  case "end":
15502
- return _context77.stop();
15610
+ return _context78.stop();
15503
15611
  }
15504
15612
  }
15505
- }, _callee77, this);
15613
+ }, _callee78, this);
15506
15614
  }));
15507
15615
 
15508
- function deleteSegment(_x111) {
15616
+ function deleteSegment(_x113) {
15509
15617
  return _deleteSegment.apply(this, arguments);
15510
15618
  }
15511
15619
 
@@ -15523,23 +15631,23 @@ var StreamChat = /*#__PURE__*/function () {
15523
15631
  }, {
15524
15632
  key: "segmentTargetExists",
15525
15633
  value: function () {
15526
- var _segmentTargetExists = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee78(segmentId, targetId) {
15527
- return _regeneratorRuntime.wrap(function _callee78$(_context78) {
15634
+ var _segmentTargetExists = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee79(segmentId, targetId) {
15635
+ return _regeneratorRuntime.wrap(function _callee79$(_context79) {
15528
15636
  while (1) {
15529
- switch (_context78.prev = _context78.next) {
15637
+ switch (_context79.prev = _context79.next) {
15530
15638
  case 0:
15531
15639
  this.validateServerSideAuth();
15532
- return _context78.abrupt("return", this.get(this.baseURL + "/segments/".concat(encodeURIComponent(segmentId), "/target/").concat(encodeURIComponent(targetId))));
15640
+ return _context79.abrupt("return", this.get(this.baseURL + "/segments/".concat(encodeURIComponent(segmentId), "/target/").concat(encodeURIComponent(targetId))));
15533
15641
 
15534
15642
  case 2:
15535
15643
  case "end":
15536
- return _context78.stop();
15644
+ return _context79.stop();
15537
15645
  }
15538
15646
  }
15539
- }, _callee78, this);
15647
+ }, _callee79, this);
15540
15648
  }));
15541
15649
 
15542
- function segmentTargetExists(_x112, _x113) {
15650
+ function segmentTargetExists(_x114, _x115) {
15543
15651
  return _segmentTargetExists.apply(this, arguments);
15544
15652
  }
15545
15653
 
@@ -15556,23 +15664,23 @@ var StreamChat = /*#__PURE__*/function () {
15556
15664
  }, {
15557
15665
  key: "createCampaign",
15558
15666
  value: function () {
15559
- var _createCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee79(params) {
15560
- return _regeneratorRuntime.wrap(function _callee79$(_context79) {
15667
+ var _createCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee80(params) {
15668
+ return _regeneratorRuntime.wrap(function _callee80$(_context80) {
15561
15669
  while (1) {
15562
- switch (_context79.prev = _context79.next) {
15670
+ switch (_context80.prev = _context80.next) {
15563
15671
  case 0:
15564
15672
  this.validateServerSideAuth();
15565
- return _context79.abrupt("return", this.post(this.baseURL + "/campaigns", _objectSpread({}, params)));
15673
+ return _context80.abrupt("return", this.post(this.baseURL + "/campaigns", _objectSpread({}, params)));
15566
15674
 
15567
15675
  case 2:
15568
15676
  case "end":
15569
- return _context79.stop();
15677
+ return _context80.stop();
15570
15678
  }
15571
15679
  }
15572
- }, _callee79, this);
15680
+ }, _callee80, this);
15573
15681
  }));
15574
15682
 
15575
- function createCampaign(_x114) {
15683
+ function createCampaign(_x116) {
15576
15684
  return _createCampaign.apply(this, arguments);
15577
15685
  }
15578
15686
 
@@ -15581,23 +15689,23 @@ var StreamChat = /*#__PURE__*/function () {
15581
15689
  }, {
15582
15690
  key: "getCampaign",
15583
15691
  value: function () {
15584
- var _getCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee80(id) {
15585
- return _regeneratorRuntime.wrap(function _callee80$(_context80) {
15692
+ var _getCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee81(id) {
15693
+ return _regeneratorRuntime.wrap(function _callee81$(_context81) {
15586
15694
  while (1) {
15587
- switch (_context80.prev = _context80.next) {
15695
+ switch (_context81.prev = _context81.next) {
15588
15696
  case 0:
15589
15697
  this.validateServerSideAuth();
15590
- return _context80.abrupt("return", this.get(this.baseURL + "/campaigns/".concat(encodeURIComponent(id))));
15698
+ return _context81.abrupt("return", this.get(this.baseURL + "/campaigns/".concat(encodeURIComponent(id))));
15591
15699
 
15592
15700
  case 2:
15593
15701
  case "end":
15594
- return _context80.stop();
15702
+ return _context81.stop();
15595
15703
  }
15596
15704
  }
15597
- }, _callee80, this);
15705
+ }, _callee81, this);
15598
15706
  }));
15599
15707
 
15600
- function getCampaign(_x115) {
15708
+ function getCampaign(_x117) {
15601
15709
  return _getCampaign.apply(this, arguments);
15602
15710
  }
15603
15711
 
@@ -15606,26 +15714,26 @@ var StreamChat = /*#__PURE__*/function () {
15606
15714
  }, {
15607
15715
  key: "startCampaign",
15608
15716
  value: function () {
15609
- var _startCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee81(id, options) {
15610
- return _regeneratorRuntime.wrap(function _callee81$(_context81) {
15717
+ var _startCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee82(id, options) {
15718
+ return _regeneratorRuntime.wrap(function _callee82$(_context82) {
15611
15719
  while (1) {
15612
- switch (_context81.prev = _context81.next) {
15720
+ switch (_context82.prev = _context82.next) {
15613
15721
  case 0:
15614
15722
  this.validateServerSideAuth();
15615
- return _context81.abrupt("return", this.post(this.baseURL + "/campaigns/".concat(encodeURIComponent(id), "/start"), {
15723
+ return _context82.abrupt("return", this.post(this.baseURL + "/campaigns/".concat(encodeURIComponent(id), "/start"), {
15616
15724
  scheduled_for: options === null || options === void 0 ? void 0 : options.scheduledFor,
15617
15725
  stop_at: options === null || options === void 0 ? void 0 : options.stopAt
15618
15726
  }));
15619
15727
 
15620
15728
  case 2:
15621
15729
  case "end":
15622
- return _context81.stop();
15730
+ return _context82.stop();
15623
15731
  }
15624
15732
  }
15625
- }, _callee81, this);
15733
+ }, _callee82, this);
15626
15734
  }));
15627
15735
 
15628
- function startCampaign(_x116, _x117) {
15736
+ function startCampaign(_x118, _x119) {
15629
15737
  return _startCampaign.apply(this, arguments);
15630
15738
  }
15631
15739
 
@@ -15641,30 +15749,30 @@ var StreamChat = /*#__PURE__*/function () {
15641
15749
  }, {
15642
15750
  key: "queryCampaigns",
15643
15751
  value: function () {
15644
- var _queryCampaigns = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee82(filter, sort, options) {
15645
- return _regeneratorRuntime.wrap(function _callee82$(_context82) {
15752
+ var _queryCampaigns = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee83(filter, sort, options) {
15753
+ return _regeneratorRuntime.wrap(function _callee83$(_context83) {
15646
15754
  while (1) {
15647
- switch (_context82.prev = _context82.next) {
15755
+ switch (_context83.prev = _context83.next) {
15648
15756
  case 0:
15649
15757
  this.validateServerSideAuth();
15650
- _context82.next = 3;
15758
+ _context83.next = 3;
15651
15759
  return this.post(this.baseURL + "/campaigns/query", _objectSpread({
15652
15760
  filter: filter,
15653
15761
  sort: sort
15654
15762
  }, options || {}));
15655
15763
 
15656
15764
  case 3:
15657
- return _context82.abrupt("return", _context82.sent);
15765
+ return _context83.abrupt("return", _context83.sent);
15658
15766
 
15659
15767
  case 4:
15660
15768
  case "end":
15661
- return _context82.stop();
15769
+ return _context83.stop();
15662
15770
  }
15663
15771
  }
15664
- }, _callee82, this);
15772
+ }, _callee83, this);
15665
15773
  }));
15666
15774
 
15667
- function queryCampaigns(_x118, _x119, _x120) {
15775
+ function queryCampaigns(_x120, _x121, _x122) {
15668
15776
  return _queryCampaigns.apply(this, arguments);
15669
15777
  }
15670
15778
 
@@ -15682,23 +15790,23 @@ var StreamChat = /*#__PURE__*/function () {
15682
15790
  }, {
15683
15791
  key: "updateCampaign",
15684
15792
  value: function () {
15685
- var _updateCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee83(id, params) {
15686
- return _regeneratorRuntime.wrap(function _callee83$(_context83) {
15793
+ var _updateCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee84(id, params) {
15794
+ return _regeneratorRuntime.wrap(function _callee84$(_context84) {
15687
15795
  while (1) {
15688
- switch (_context83.prev = _context83.next) {
15796
+ switch (_context84.prev = _context84.next) {
15689
15797
  case 0:
15690
15798
  this.validateServerSideAuth();
15691
- return _context83.abrupt("return", this.put(this.baseURL + "/campaigns/".concat(encodeURIComponent(id)), params));
15799
+ return _context84.abrupt("return", this.put(this.baseURL + "/campaigns/".concat(encodeURIComponent(id)), params));
15692
15800
 
15693
15801
  case 2:
15694
15802
  case "end":
15695
- return _context83.stop();
15803
+ return _context84.stop();
15696
15804
  }
15697
15805
  }
15698
- }, _callee83, this);
15806
+ }, _callee84, this);
15699
15807
  }));
15700
15808
 
15701
- function updateCampaign(_x121, _x122) {
15809
+ function updateCampaign(_x123, _x124) {
15702
15810
  return _updateCampaign.apply(this, arguments);
15703
15811
  }
15704
15812
 
@@ -15715,23 +15823,23 @@ var StreamChat = /*#__PURE__*/function () {
15715
15823
  }, {
15716
15824
  key: "deleteCampaign",
15717
15825
  value: function () {
15718
- var _deleteCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee84(id) {
15719
- return _regeneratorRuntime.wrap(function _callee84$(_context84) {
15826
+ var _deleteCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee85(id) {
15827
+ return _regeneratorRuntime.wrap(function _callee85$(_context85) {
15720
15828
  while (1) {
15721
- switch (_context84.prev = _context84.next) {
15829
+ switch (_context85.prev = _context85.next) {
15722
15830
  case 0:
15723
15831
  this.validateServerSideAuth();
15724
- return _context84.abrupt("return", this.delete(this.baseURL + "/campaigns/".concat(encodeURIComponent(id))));
15832
+ return _context85.abrupt("return", this.delete(this.baseURL + "/campaigns/".concat(encodeURIComponent(id))));
15725
15833
 
15726
15834
  case 2:
15727
15835
  case "end":
15728
- return _context84.stop();
15836
+ return _context85.stop();
15729
15837
  }
15730
15838
  }
15731
- }, _callee84, this);
15839
+ }, _callee85, this);
15732
15840
  }));
15733
15841
 
15734
- function deleteCampaign(_x123) {
15842
+ function deleteCampaign(_x125) {
15735
15843
  return _deleteCampaign.apply(this, arguments);
15736
15844
  }
15737
15845
 
@@ -15748,23 +15856,23 @@ var StreamChat = /*#__PURE__*/function () {
15748
15856
  }, {
15749
15857
  key: "stopCampaign",
15750
15858
  value: function () {
15751
- var _stopCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee85(id) {
15752
- return _regeneratorRuntime.wrap(function _callee85$(_context85) {
15859
+ var _stopCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee86(id) {
15860
+ return _regeneratorRuntime.wrap(function _callee86$(_context86) {
15753
15861
  while (1) {
15754
- switch (_context85.prev = _context85.next) {
15862
+ switch (_context86.prev = _context86.next) {
15755
15863
  case 0:
15756
15864
  this.validateServerSideAuth();
15757
- return _context85.abrupt("return", this.post(this.baseURL + "/campaigns/".concat(encodeURIComponent(id), "/stop")));
15865
+ return _context86.abrupt("return", this.post(this.baseURL + "/campaigns/".concat(encodeURIComponent(id), "/stop")));
15758
15866
 
15759
15867
  case 2:
15760
15868
  case "end":
15761
- return _context85.stop();
15869
+ return _context86.stop();
15762
15870
  }
15763
15871
  }
15764
- }, _callee85, this);
15872
+ }, _callee86, this);
15765
15873
  }));
15766
15874
 
15767
- function stopCampaign(_x124) {
15875
+ function stopCampaign(_x126) {
15768
15876
  return _stopCampaign.apply(this, arguments);
15769
15877
  }
15770
15878
 
@@ -15780,24 +15888,24 @@ var StreamChat = /*#__PURE__*/function () {
15780
15888
  }, {
15781
15889
  key: "enrichURL",
15782
15890
  value: function () {
15783
- var _enrichURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee86(url) {
15784
- return _regeneratorRuntime.wrap(function _callee86$(_context86) {
15891
+ var _enrichURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee87(url) {
15892
+ return _regeneratorRuntime.wrap(function _callee87$(_context87) {
15785
15893
  while (1) {
15786
- switch (_context86.prev = _context86.next) {
15894
+ switch (_context87.prev = _context87.next) {
15787
15895
  case 0:
15788
- return _context86.abrupt("return", this.get(this.baseURL + "/og", {
15896
+ return _context87.abrupt("return", this.get(this.baseURL + "/og", {
15789
15897
  url: url
15790
15898
  }));
15791
15899
 
15792
15900
  case 1:
15793
15901
  case "end":
15794
- return _context86.stop();
15902
+ return _context87.stop();
15795
15903
  }
15796
15904
  }
15797
- }, _callee86, this);
15905
+ }, _callee87, this);
15798
15906
  }));
15799
15907
 
15800
- function enrichURL(_x125) {
15908
+ function enrichURL(_x127) {
15801
15909
  return _enrichURL.apply(this, arguments);
15802
15910
  }
15803
15911
 
@@ -15814,22 +15922,22 @@ var StreamChat = /*#__PURE__*/function () {
15814
15922
  }, {
15815
15923
  key: "getTask",
15816
15924
  value: function () {
15817
- var _getTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee87(id) {
15818
- return _regeneratorRuntime.wrap(function _callee87$(_context87) {
15925
+ var _getTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee88(id) {
15926
+ return _regeneratorRuntime.wrap(function _callee88$(_context88) {
15819
15927
  while (1) {
15820
- switch (_context87.prev = _context87.next) {
15928
+ switch (_context88.prev = _context88.next) {
15821
15929
  case 0:
15822
- return _context87.abrupt("return", this.get("".concat(this.baseURL, "/tasks/").concat(encodeURIComponent(id))));
15930
+ return _context88.abrupt("return", this.get("".concat(this.baseURL, "/tasks/").concat(encodeURIComponent(id))));
15823
15931
 
15824
15932
  case 1:
15825
15933
  case "end":
15826
- return _context87.stop();
15934
+ return _context88.stop();
15827
15935
  }
15828
15936
  }
15829
- }, _callee87, this);
15937
+ }, _callee88, this);
15830
15938
  }));
15831
15939
 
15832
- function getTask(_x126) {
15940
+ function getTask(_x128) {
15833
15941
  return _getTask.apply(this, arguments);
15834
15942
  }
15835
15943
 
@@ -15847,31 +15955,31 @@ var StreamChat = /*#__PURE__*/function () {
15847
15955
  }, {
15848
15956
  key: "deleteChannels",
15849
15957
  value: function () {
15850
- var _deleteChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee88(cids) {
15958
+ var _deleteChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee89(cids) {
15851
15959
  var options,
15852
- _args88 = arguments;
15853
- return _regeneratorRuntime.wrap(function _callee88$(_context88) {
15960
+ _args89 = arguments;
15961
+ return _regeneratorRuntime.wrap(function _callee89$(_context89) {
15854
15962
  while (1) {
15855
- switch (_context88.prev = _context88.next) {
15963
+ switch (_context89.prev = _context89.next) {
15856
15964
  case 0:
15857
- options = _args88.length > 1 && _args88[1] !== undefined ? _args88[1] : {};
15858
- _context88.next = 3;
15965
+ options = _args89.length > 1 && _args89[1] !== undefined ? _args89[1] : {};
15966
+ _context89.next = 3;
15859
15967
  return this.post(this.baseURL + "/channels/delete", _objectSpread({
15860
15968
  cids: cids
15861
15969
  }, options));
15862
15970
 
15863
15971
  case 3:
15864
- return _context88.abrupt("return", _context88.sent);
15972
+ return _context89.abrupt("return", _context89.sent);
15865
15973
 
15866
15974
  case 4:
15867
15975
  case "end":
15868
- return _context88.stop();
15976
+ return _context89.stop();
15869
15977
  }
15870
15978
  }
15871
- }, _callee88, this);
15979
+ }, _callee89, this);
15872
15980
  }));
15873
15981
 
15874
- function deleteChannels(_x127) {
15982
+ function deleteChannels(_x129) {
15875
15983
  return _deleteChannels.apply(this, arguments);
15876
15984
  }
15877
15985
 
@@ -15889,17 +15997,17 @@ var StreamChat = /*#__PURE__*/function () {
15889
15997
  }, {
15890
15998
  key: "deleteUsers",
15891
15999
  value: function () {
15892
- var _deleteUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee89(user_ids) {
16000
+ var _deleteUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee90(user_ids) {
15893
16001
  var options,
15894
- _args89 = arguments;
15895
- return _regeneratorRuntime.wrap(function _callee89$(_context89) {
16002
+ _args90 = arguments;
16003
+ return _regeneratorRuntime.wrap(function _callee90$(_context90) {
15896
16004
  while (1) {
15897
- switch (_context89.prev = _context89.next) {
16005
+ switch (_context90.prev = _context90.next) {
15898
16006
  case 0:
15899
- options = _args89.length > 1 && _args89[1] !== undefined ? _args89[1] : {};
16007
+ options = _args90.length > 1 && _args90[1] !== undefined ? _args90[1] : {};
15900
16008
 
15901
16009
  if (!(typeof options.user !== 'undefined' && !['soft', 'hard', 'pruning'].includes(options.user))) {
15902
- _context89.next = 3;
16010
+ _context90.next = 3;
15903
16011
  break;
15904
16012
  }
15905
16013
 
@@ -15907,7 +16015,7 @@ var StreamChat = /*#__PURE__*/function () {
15907
16015
 
15908
16016
  case 3:
15909
16017
  if (!(typeof options.conversations !== 'undefined' && !['soft', 'hard'].includes(options.conversations))) {
15910
- _context89.next = 5;
16018
+ _context90.next = 5;
15911
16019
  break;
15912
16020
  }
15913
16021
 
@@ -15915,30 +16023,30 @@ var StreamChat = /*#__PURE__*/function () {
15915
16023
 
15916
16024
  case 5:
15917
16025
  if (!(typeof options.messages !== 'undefined' && !['soft', 'hard', 'pruning'].includes(options.messages))) {
15918
- _context89.next = 7;
16026
+ _context90.next = 7;
15919
16027
  break;
15920
16028
  }
15921
16029
 
15922
16030
  throw new Error('Invalid delete user options. messages must be one of [soft hard pruning]');
15923
16031
 
15924
16032
  case 7:
15925
- _context89.next = 9;
16033
+ _context90.next = 9;
15926
16034
  return this.post(this.baseURL + "/users/delete", _objectSpread({
15927
16035
  user_ids: user_ids
15928
16036
  }, options));
15929
16037
 
15930
16038
  case 9:
15931
- return _context89.abrupt("return", _context89.sent);
16039
+ return _context90.abrupt("return", _context90.sent);
15932
16040
 
15933
16041
  case 10:
15934
16042
  case "end":
15935
- return _context89.stop();
16043
+ return _context90.stop();
15936
16044
  }
15937
16045
  }
15938
- }, _callee89, this);
16046
+ }, _callee90, this);
15939
16047
  }));
15940
16048
 
15941
- function deleteUsers(_x128) {
16049
+ function deleteUsers(_x130) {
15942
16050
  return _deleteUsers.apply(this, arguments);
15943
16051
  }
15944
16052
 
@@ -15959,28 +16067,28 @@ var StreamChat = /*#__PURE__*/function () {
15959
16067
  }, {
15960
16068
  key: "_createImportURL",
15961
16069
  value: function () {
15962
- var _createImportURL2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee90(filename) {
15963
- return _regeneratorRuntime.wrap(function _callee90$(_context90) {
16070
+ var _createImportURL2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee91(filename) {
16071
+ return _regeneratorRuntime.wrap(function _callee91$(_context91) {
15964
16072
  while (1) {
15965
- switch (_context90.prev = _context90.next) {
16073
+ switch (_context91.prev = _context91.next) {
15966
16074
  case 0:
15967
- _context90.next = 2;
16075
+ _context91.next = 2;
15968
16076
  return this.post(this.baseURL + "/import_urls", {
15969
16077
  filename: filename
15970
16078
  });
15971
16079
 
15972
16080
  case 2:
15973
- return _context90.abrupt("return", _context90.sent);
16081
+ return _context91.abrupt("return", _context91.sent);
15974
16082
 
15975
16083
  case 3:
15976
16084
  case "end":
15977
- return _context90.stop();
16085
+ return _context91.stop();
15978
16086
  }
15979
16087
  }
15980
- }, _callee90, this);
16088
+ }, _callee91, this);
15981
16089
  }));
15982
16090
 
15983
- function _createImportURL(_x129) {
16091
+ function _createImportURL(_x131) {
15984
16092
  return _createImportURL2.apply(this, arguments);
15985
16093
  }
15986
16094
 
@@ -16002,33 +16110,33 @@ var StreamChat = /*#__PURE__*/function () {
16002
16110
  }, {
16003
16111
  key: "_createImport",
16004
16112
  value: function () {
16005
- var _createImport2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee91(path) {
16113
+ var _createImport2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee92(path) {
16006
16114
  var options,
16007
- _args91 = arguments;
16008
- return _regeneratorRuntime.wrap(function _callee91$(_context91) {
16115
+ _args92 = arguments;
16116
+ return _regeneratorRuntime.wrap(function _callee92$(_context92) {
16009
16117
  while (1) {
16010
- switch (_context91.prev = _context91.next) {
16118
+ switch (_context92.prev = _context92.next) {
16011
16119
  case 0:
16012
- options = _args91.length > 1 && _args91[1] !== undefined ? _args91[1] : {
16120
+ options = _args92.length > 1 && _args92[1] !== undefined ? _args92[1] : {
16013
16121
  mode: 'upsert'
16014
16122
  };
16015
- _context91.next = 3;
16123
+ _context92.next = 3;
16016
16124
  return this.post(this.baseURL + "/imports", _objectSpread({
16017
16125
  path: path
16018
16126
  }, options));
16019
16127
 
16020
16128
  case 3:
16021
- return _context91.abrupt("return", _context91.sent);
16129
+ return _context92.abrupt("return", _context92.sent);
16022
16130
 
16023
16131
  case 4:
16024
16132
  case "end":
16025
- return _context91.stop();
16133
+ return _context92.stop();
16026
16134
  }
16027
16135
  }
16028
- }, _callee91, this);
16136
+ }, _callee92, this);
16029
16137
  }));
16030
16138
 
16031
- function _createImport(_x130) {
16139
+ function _createImport(_x132) {
16032
16140
  return _createImport2.apply(this, arguments);
16033
16141
  }
16034
16142
 
@@ -16050,26 +16158,26 @@ var StreamChat = /*#__PURE__*/function () {
16050
16158
  }, {
16051
16159
  key: "_getImport",
16052
16160
  value: function () {
16053
- var _getImport2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee92(id) {
16054
- return _regeneratorRuntime.wrap(function _callee92$(_context92) {
16161
+ var _getImport2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee93(id) {
16162
+ return _regeneratorRuntime.wrap(function _callee93$(_context93) {
16055
16163
  while (1) {
16056
- switch (_context92.prev = _context92.next) {
16164
+ switch (_context93.prev = _context93.next) {
16057
16165
  case 0:
16058
- _context92.next = 2;
16166
+ _context93.next = 2;
16059
16167
  return this.get(this.baseURL + "/imports/".concat(encodeURIComponent(id)));
16060
16168
 
16061
16169
  case 2:
16062
- return _context92.abrupt("return", _context92.sent);
16170
+ return _context93.abrupt("return", _context93.sent);
16063
16171
 
16064
16172
  case 3:
16065
16173
  case "end":
16066
- return _context92.stop();
16174
+ return _context93.stop();
16067
16175
  }
16068
16176
  }
16069
- }, _callee92, this);
16177
+ }, _callee93, this);
16070
16178
  }));
16071
16179
 
16072
- function _getImport(_x131) {
16180
+ function _getImport(_x133) {
16073
16181
  return _getImport2.apply(this, arguments);
16074
16182
  }
16075
16183
 
@@ -16091,26 +16199,26 @@ var StreamChat = /*#__PURE__*/function () {
16091
16199
  }, {
16092
16200
  key: "_listImports",
16093
16201
  value: function () {
16094
- var _listImports2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee93(options) {
16095
- return _regeneratorRuntime.wrap(function _callee93$(_context93) {
16202
+ var _listImports2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee94(options) {
16203
+ return _regeneratorRuntime.wrap(function _callee94$(_context94) {
16096
16204
  while (1) {
16097
- switch (_context93.prev = _context93.next) {
16205
+ switch (_context94.prev = _context94.next) {
16098
16206
  case 0:
16099
- _context93.next = 2;
16207
+ _context94.next = 2;
16100
16208
  return this.get(this.baseURL + "/imports", options);
16101
16209
 
16102
16210
  case 2:
16103
- return _context93.abrupt("return", _context93.sent);
16211
+ return _context94.abrupt("return", _context94.sent);
16104
16212
 
16105
16213
  case 3:
16106
16214
  case "end":
16107
- return _context93.stop();
16215
+ return _context94.stop();
16108
16216
  }
16109
16217
  }
16110
- }, _callee93, this);
16218
+ }, _callee94, this);
16111
16219
  }));
16112
16220
 
16113
- function _listImports(_x132) {
16221
+ function _listImports(_x134) {
16114
16222
  return _listImports2.apply(this, arguments);
16115
16223
  }
16116
16224
 
@@ -16129,28 +16237,28 @@ var StreamChat = /*#__PURE__*/function () {
16129
16237
  }, {
16130
16238
  key: "upsertPushProvider",
16131
16239
  value: function () {
16132
- var _upsertPushProvider = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee94(pushProvider) {
16133
- return _regeneratorRuntime.wrap(function _callee94$(_context94) {
16240
+ var _upsertPushProvider = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee95(pushProvider) {
16241
+ return _regeneratorRuntime.wrap(function _callee95$(_context95) {
16134
16242
  while (1) {
16135
- switch (_context94.prev = _context94.next) {
16243
+ switch (_context95.prev = _context95.next) {
16136
16244
  case 0:
16137
- _context94.next = 2;
16245
+ _context95.next = 2;
16138
16246
  return this.post(this.baseURL + "/push_providers", {
16139
16247
  push_provider: pushProvider
16140
16248
  });
16141
16249
 
16142
16250
  case 2:
16143
- return _context94.abrupt("return", _context94.sent);
16251
+ return _context95.abrupt("return", _context95.sent);
16144
16252
 
16145
16253
  case 3:
16146
16254
  case "end":
16147
- return _context94.stop();
16255
+ return _context95.stop();
16148
16256
  }
16149
16257
  }
16150
- }, _callee94, this);
16258
+ }, _callee95, this);
16151
16259
  }));
16152
16260
 
16153
- function upsertPushProvider(_x133) {
16261
+ function upsertPushProvider(_x135) {
16154
16262
  return _upsertPushProvider.apply(this, arguments);
16155
16263
  }
16156
16264
 
@@ -16169,28 +16277,28 @@ var StreamChat = /*#__PURE__*/function () {
16169
16277
  }, {
16170
16278
  key: "deletePushProvider",
16171
16279
  value: function () {
16172
- var _deletePushProvider = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee95(_ref10) {
16280
+ var _deletePushProvider = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee96(_ref10) {
16173
16281
  var type, name;
16174
- return _regeneratorRuntime.wrap(function _callee95$(_context95) {
16282
+ return _regeneratorRuntime.wrap(function _callee96$(_context96) {
16175
16283
  while (1) {
16176
- switch (_context95.prev = _context95.next) {
16284
+ switch (_context96.prev = _context96.next) {
16177
16285
  case 0:
16178
16286
  type = _ref10.type, name = _ref10.name;
16179
- _context95.next = 3;
16287
+ _context96.next = 3;
16180
16288
  return this.delete(this.baseURL + "/push_providers/".concat(encodeURIComponent(type), "/").concat(encodeURIComponent(name)));
16181
16289
 
16182
16290
  case 3:
16183
- return _context95.abrupt("return", _context95.sent);
16291
+ return _context96.abrupt("return", _context96.sent);
16184
16292
 
16185
16293
  case 4:
16186
16294
  case "end":
16187
- return _context95.stop();
16295
+ return _context96.stop();
16188
16296
  }
16189
16297
  }
16190
- }, _callee95, this);
16298
+ }, _callee96, this);
16191
16299
  }));
16192
16300
 
16193
- function deletePushProvider(_x134) {
16301
+ function deletePushProvider(_x136) {
16194
16302
  return _deletePushProvider.apply(this, arguments);
16195
16303
  }
16196
16304
 
@@ -16207,23 +16315,23 @@ var StreamChat = /*#__PURE__*/function () {
16207
16315
  }, {
16208
16316
  key: "listPushProviders",
16209
16317
  value: function () {
16210
- var _listPushProviders = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee96() {
16211
- return _regeneratorRuntime.wrap(function _callee96$(_context96) {
16318
+ var _listPushProviders = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee97() {
16319
+ return _regeneratorRuntime.wrap(function _callee97$(_context97) {
16212
16320
  while (1) {
16213
- switch (_context96.prev = _context96.next) {
16321
+ switch (_context97.prev = _context97.next) {
16214
16322
  case 0:
16215
- _context96.next = 2;
16323
+ _context97.next = 2;
16216
16324
  return this.get(this.baseURL + "/push_providers");
16217
16325
 
16218
16326
  case 2:
16219
- return _context96.abrupt("return", _context96.sent);
16327
+ return _context97.abrupt("return", _context97.sent);
16220
16328
 
16221
16329
  case 3:
16222
16330
  case "end":
16223
- return _context96.stop();
16331
+ return _context97.stop();
16224
16332
  }
16225
16333
  }
16226
- }, _callee96, this);
16334
+ }, _callee97, this);
16227
16335
  }));
16228
16336
 
16229
16337
  function listPushProviders() {
@@ -16251,26 +16359,26 @@ var StreamChat = /*#__PURE__*/function () {
16251
16359
  }, {
16252
16360
  key: "commitMessage",
16253
16361
  value: function () {
16254
- var _commitMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee97(id) {
16255
- return _regeneratorRuntime.wrap(function _callee97$(_context97) {
16362
+ var _commitMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee98(id) {
16363
+ return _regeneratorRuntime.wrap(function _callee98$(_context98) {
16256
16364
  while (1) {
16257
- switch (_context97.prev = _context97.next) {
16365
+ switch (_context98.prev = _context98.next) {
16258
16366
  case 0:
16259
- _context97.next = 2;
16367
+ _context98.next = 2;
16260
16368
  return this.post(this.baseURL + "/messages/".concat(encodeURIComponent(id), "/commit"));
16261
16369
 
16262
16370
  case 2:
16263
- return _context97.abrupt("return", _context97.sent);
16371
+ return _context98.abrupt("return", _context98.sent);
16264
16372
 
16265
16373
  case 3:
16266
16374
  case "end":
16267
- return _context97.stop();
16375
+ return _context98.stop();
16268
16376
  }
16269
16377
  }
16270
- }, _callee97, this);
16378
+ }, _callee98, this);
16271
16379
  }));
16272
16380
 
16273
- function commitMessage(_x135) {
16381
+ function commitMessage(_x137) {
16274
16382
  return _commitMessage.apply(this, arguments);
16275
16383
  }
16276
16384
 
@@ -16286,28 +16394,28 @@ var StreamChat = /*#__PURE__*/function () {
16286
16394
  }, {
16287
16395
  key: "createPoll",
16288
16396
  value: function () {
16289
- var _createPoll = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee98(poll, userId) {
16290
- return _regeneratorRuntime.wrap(function _callee98$(_context98) {
16397
+ var _createPoll = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee99(poll, userId) {
16398
+ return _regeneratorRuntime.wrap(function _callee99$(_context99) {
16291
16399
  while (1) {
16292
- switch (_context98.prev = _context98.next) {
16400
+ switch (_context99.prev = _context99.next) {
16293
16401
  case 0:
16294
- _context98.next = 2;
16402
+ _context99.next = 2;
16295
16403
  return this.post(this.baseURL + "/polls", _objectSpread(_objectSpread({}, poll), userId ? {
16296
16404
  user_id: userId
16297
16405
  } : {}));
16298
16406
 
16299
16407
  case 2:
16300
- return _context98.abrupt("return", _context98.sent);
16408
+ return _context99.abrupt("return", _context99.sent);
16301
16409
 
16302
16410
  case 3:
16303
16411
  case "end":
16304
- return _context98.stop();
16412
+ return _context99.stop();
16305
16413
  }
16306
16414
  }
16307
- }, _callee98, this);
16415
+ }, _callee99, this);
16308
16416
  }));
16309
16417
 
16310
- function createPoll(_x136, _x137) {
16418
+ function createPoll(_x138, _x139) {
16311
16419
  return _createPoll.apply(this, arguments);
16312
16420
  }
16313
16421
 
@@ -16323,28 +16431,28 @@ var StreamChat = /*#__PURE__*/function () {
16323
16431
  }, {
16324
16432
  key: "getPoll",
16325
16433
  value: function () {
16326
- var _getPoll = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee99(id, userId) {
16327
- return _regeneratorRuntime.wrap(function _callee99$(_context99) {
16434
+ var _getPoll = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee100(id, userId) {
16435
+ return _regeneratorRuntime.wrap(function _callee100$(_context100) {
16328
16436
  while (1) {
16329
- switch (_context99.prev = _context99.next) {
16437
+ switch (_context100.prev = _context100.next) {
16330
16438
  case 0:
16331
- _context99.next = 2;
16439
+ _context100.next = 2;
16332
16440
  return this.get(this.baseURL + "/polls/".concat(encodeURIComponent(id)), userId ? {
16333
16441
  user_id: userId
16334
16442
  } : {});
16335
16443
 
16336
16444
  case 2:
16337
- return _context99.abrupt("return", _context99.sent);
16445
+ return _context100.abrupt("return", _context100.sent);
16338
16446
 
16339
16447
  case 3:
16340
16448
  case "end":
16341
- return _context99.stop();
16449
+ return _context100.stop();
16342
16450
  }
16343
16451
  }
16344
- }, _callee99, this);
16452
+ }, _callee100, this);
16345
16453
  }));
16346
16454
 
16347
- function getPoll(_x138, _x139) {
16455
+ function getPoll(_x140, _x141) {
16348
16456
  return _getPoll.apply(this, arguments);
16349
16457
  }
16350
16458
 
@@ -16360,28 +16468,28 @@ var StreamChat = /*#__PURE__*/function () {
16360
16468
  }, {
16361
16469
  key: "updatePoll",
16362
16470
  value: function () {
16363
- var _updatePoll = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee100(poll, userId) {
16364
- return _regeneratorRuntime.wrap(function _callee100$(_context100) {
16471
+ var _updatePoll = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee101(poll, userId) {
16472
+ return _regeneratorRuntime.wrap(function _callee101$(_context101) {
16365
16473
  while (1) {
16366
- switch (_context100.prev = _context100.next) {
16474
+ switch (_context101.prev = _context101.next) {
16367
16475
  case 0:
16368
- _context100.next = 2;
16476
+ _context101.next = 2;
16369
16477
  return this.put(this.baseURL + "/polls", _objectSpread(_objectSpread({}, poll), userId ? {
16370
16478
  user_id: userId
16371
16479
  } : {}));
16372
16480
 
16373
16481
  case 2:
16374
- return _context100.abrupt("return", _context100.sent);
16482
+ return _context101.abrupt("return", _context101.sent);
16375
16483
 
16376
16484
  case 3:
16377
16485
  case "end":
16378
- return _context100.stop();
16486
+ return _context101.stop();
16379
16487
  }
16380
16488
  }
16381
- }, _callee100, this);
16489
+ }, _callee101, this);
16382
16490
  }));
16383
16491
 
16384
- function updatePoll(_x140, _x141) {
16492
+ function updatePoll(_x142, _x143) {
16385
16493
  return _updatePoll.apply(this, arguments);
16386
16494
  }
16387
16495
 
@@ -16399,28 +16507,28 @@ var StreamChat = /*#__PURE__*/function () {
16399
16507
  }, {
16400
16508
  key: "partialUpdatePoll",
16401
16509
  value: function () {
16402
- var _partialUpdatePoll = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee101(id, partialPollObject, userId) {
16403
- return _regeneratorRuntime.wrap(function _callee101$(_context101) {
16510
+ var _partialUpdatePoll = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee102(id, partialPollObject, userId) {
16511
+ return _regeneratorRuntime.wrap(function _callee102$(_context102) {
16404
16512
  while (1) {
16405
- switch (_context101.prev = _context101.next) {
16513
+ switch (_context102.prev = _context102.next) {
16406
16514
  case 0:
16407
- _context101.next = 2;
16515
+ _context102.next = 2;
16408
16516
  return this.patch(this.baseURL + "/polls/".concat(encodeURIComponent(id)), _objectSpread(_objectSpread({}, partialPollObject), userId ? {
16409
16517
  user_id: userId
16410
16518
  } : {}));
16411
16519
 
16412
16520
  case 2:
16413
- return _context101.abrupt("return", _context101.sent);
16521
+ return _context102.abrupt("return", _context102.sent);
16414
16522
 
16415
16523
  case 3:
16416
16524
  case "end":
16417
- return _context101.stop();
16525
+ return _context102.stop();
16418
16526
  }
16419
16527
  }
16420
- }, _callee101, this);
16528
+ }, _callee102, this);
16421
16529
  }));
16422
16530
 
16423
- function partialUpdatePoll(_x142, _x143, _x144) {
16531
+ function partialUpdatePoll(_x144, _x145, _x146) {
16424
16532
  return _partialUpdatePoll.apply(this, arguments);
16425
16533
  }
16426
16534
 
@@ -16436,28 +16544,28 @@ var StreamChat = /*#__PURE__*/function () {
16436
16544
  }, {
16437
16545
  key: "deletePoll",
16438
16546
  value: function () {
16439
- var _deletePoll = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee102(id, userId) {
16440
- return _regeneratorRuntime.wrap(function _callee102$(_context102) {
16547
+ var _deletePoll = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee103(id, userId) {
16548
+ return _regeneratorRuntime.wrap(function _callee103$(_context103) {
16441
16549
  while (1) {
16442
- switch (_context102.prev = _context102.next) {
16550
+ switch (_context103.prev = _context103.next) {
16443
16551
  case 0:
16444
- _context102.next = 2;
16552
+ _context103.next = 2;
16445
16553
  return this.delete(this.baseURL + "/polls/".concat(encodeURIComponent(id)), _objectSpread({}, userId ? {
16446
16554
  user_id: userId
16447
16555
  } : {}));
16448
16556
 
16449
16557
  case 2:
16450
- return _context102.abrupt("return", _context102.sent);
16558
+ return _context103.abrupt("return", _context103.sent);
16451
16559
 
16452
16560
  case 3:
16453
16561
  case "end":
16454
- return _context102.stop();
16562
+ return _context103.stop();
16455
16563
  }
16456
16564
  }
16457
- }, _callee102, this);
16565
+ }, _callee103, this);
16458
16566
  }));
16459
16567
 
16460
- function deletePoll(_x145, _x146) {
16568
+ function deletePoll(_x147, _x148) {
16461
16569
  return _deletePoll.apply(this, arguments);
16462
16570
  }
16463
16571
 
@@ -16473,12 +16581,12 @@ var StreamChat = /*#__PURE__*/function () {
16473
16581
  }, {
16474
16582
  key: "closePoll",
16475
16583
  value: function () {
16476
- var _closePoll = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee103(id, userId) {
16477
- return _regeneratorRuntime.wrap(function _callee103$(_context103) {
16584
+ var _closePoll = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee104(id, userId) {
16585
+ return _regeneratorRuntime.wrap(function _callee104$(_context104) {
16478
16586
  while (1) {
16479
- switch (_context103.prev = _context103.next) {
16587
+ switch (_context104.prev = _context104.next) {
16480
16588
  case 0:
16481
- return _context103.abrupt("return", this.partialUpdatePoll(id, {
16589
+ return _context104.abrupt("return", this.partialUpdatePoll(id, {
16482
16590
  set: {
16483
16591
  is_closed: true
16484
16592
  }
@@ -16486,13 +16594,13 @@ var StreamChat = /*#__PURE__*/function () {
16486
16594
 
16487
16595
  case 1:
16488
16596
  case "end":
16489
- return _context103.stop();
16597
+ return _context104.stop();
16490
16598
  }
16491
16599
  }
16492
- }, _callee103, this);
16600
+ }, _callee104, this);
16493
16601
  }));
16494
16602
 
16495
- function closePoll(_x147, _x148) {
16603
+ function closePoll(_x149, _x150) {
16496
16604
  return _closePoll.apply(this, arguments);
16497
16605
  }
16498
16606
 
@@ -16509,28 +16617,28 @@ var StreamChat = /*#__PURE__*/function () {
16509
16617
  }, {
16510
16618
  key: "createPollOption",
16511
16619
  value: function () {
16512
- var _createPollOption = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee104(pollId, option, userId) {
16513
- return _regeneratorRuntime.wrap(function _callee104$(_context104) {
16620
+ var _createPollOption = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee105(pollId, option, userId) {
16621
+ return _regeneratorRuntime.wrap(function _callee105$(_context105) {
16514
16622
  while (1) {
16515
- switch (_context104.prev = _context104.next) {
16623
+ switch (_context105.prev = _context105.next) {
16516
16624
  case 0:
16517
- _context104.next = 2;
16625
+ _context105.next = 2;
16518
16626
  return this.post(this.baseURL + "/polls/".concat(encodeURIComponent(pollId), "/options"), _objectSpread(_objectSpread({}, option), userId ? {
16519
16627
  user_id: userId
16520
16628
  } : {}));
16521
16629
 
16522
16630
  case 2:
16523
- return _context104.abrupt("return", _context104.sent);
16631
+ return _context105.abrupt("return", _context105.sent);
16524
16632
 
16525
16633
  case 3:
16526
16634
  case "end":
16527
- return _context104.stop();
16635
+ return _context105.stop();
16528
16636
  }
16529
16637
  }
16530
- }, _callee104, this);
16638
+ }, _callee105, this);
16531
16639
  }));
16532
16640
 
16533
- function createPollOption(_x149, _x150, _x151) {
16641
+ function createPollOption(_x151, _x152, _x153) {
16534
16642
  return _createPollOption.apply(this, arguments);
16535
16643
  }
16536
16644
 
@@ -16547,28 +16655,28 @@ var StreamChat = /*#__PURE__*/function () {
16547
16655
  }, {
16548
16656
  key: "getPollOption",
16549
16657
  value: function () {
16550
- var _getPollOption = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee105(pollId, optionId, userId) {
16551
- return _regeneratorRuntime.wrap(function _callee105$(_context105) {
16658
+ var _getPollOption = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee106(pollId, optionId, userId) {
16659
+ return _regeneratorRuntime.wrap(function _callee106$(_context106) {
16552
16660
  while (1) {
16553
- switch (_context105.prev = _context105.next) {
16661
+ switch (_context106.prev = _context106.next) {
16554
16662
  case 0:
16555
- _context105.next = 2;
16663
+ _context106.next = 2;
16556
16664
  return this.get(this.baseURL + "/polls/".concat(encodeURIComponent(pollId), "/options/").concat(encodeURIComponent(optionId)), userId ? {
16557
16665
  user_id: userId
16558
16666
  } : {});
16559
16667
 
16560
16668
  case 2:
16561
- return _context105.abrupt("return", _context105.sent);
16669
+ return _context106.abrupt("return", _context106.sent);
16562
16670
 
16563
16671
  case 3:
16564
16672
  case "end":
16565
- return _context105.stop();
16673
+ return _context106.stop();
16566
16674
  }
16567
16675
  }
16568
- }, _callee105, this);
16676
+ }, _callee106, this);
16569
16677
  }));
16570
16678
 
16571
- function getPollOption(_x152, _x153, _x154) {
16679
+ function getPollOption(_x154, _x155, _x156) {
16572
16680
  return _getPollOption.apply(this, arguments);
16573
16681
  }
16574
16682
 
@@ -16585,28 +16693,28 @@ var StreamChat = /*#__PURE__*/function () {
16585
16693
  }, {
16586
16694
  key: "updatePollOption",
16587
16695
  value: function () {
16588
- var _updatePollOption = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee106(pollId, option, userId) {
16589
- return _regeneratorRuntime.wrap(function _callee106$(_context106) {
16696
+ var _updatePollOption = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee107(pollId, option, userId) {
16697
+ return _regeneratorRuntime.wrap(function _callee107$(_context107) {
16590
16698
  while (1) {
16591
- switch (_context106.prev = _context106.next) {
16699
+ switch (_context107.prev = _context107.next) {
16592
16700
  case 0:
16593
- _context106.next = 2;
16701
+ _context107.next = 2;
16594
16702
  return this.put(this.baseURL + "/polls/".concat(encodeURIComponent(pollId), "/options"), _objectSpread(_objectSpread({}, option), userId ? {
16595
16703
  user_id: userId
16596
16704
  } : {}));
16597
16705
 
16598
16706
  case 2:
16599
- return _context106.abrupt("return", _context106.sent);
16707
+ return _context107.abrupt("return", _context107.sent);
16600
16708
 
16601
16709
  case 3:
16602
16710
  case "end":
16603
- return _context106.stop();
16711
+ return _context107.stop();
16604
16712
  }
16605
16713
  }
16606
- }, _callee106, this);
16714
+ }, _callee107, this);
16607
16715
  }));
16608
16716
 
16609
- function updatePollOption(_x155, _x156, _x157) {
16717
+ function updatePollOption(_x157, _x158, _x159) {
16610
16718
  return _updatePollOption.apply(this, arguments);
16611
16719
  }
16612
16720
 
@@ -16623,28 +16731,28 @@ var StreamChat = /*#__PURE__*/function () {
16623
16731
  }, {
16624
16732
  key: "deletePollOption",
16625
16733
  value: function () {
16626
- var _deletePollOption = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee107(pollId, optionId, userId) {
16627
- return _regeneratorRuntime.wrap(function _callee107$(_context107) {
16734
+ var _deletePollOption = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee108(pollId, optionId, userId) {
16735
+ return _regeneratorRuntime.wrap(function _callee108$(_context108) {
16628
16736
  while (1) {
16629
- switch (_context107.prev = _context107.next) {
16737
+ switch (_context108.prev = _context108.next) {
16630
16738
  case 0:
16631
- _context107.next = 2;
16739
+ _context108.next = 2;
16632
16740
  return this.delete(this.baseURL + "/polls/".concat(encodeURIComponent(pollId), "/options/").concat(encodeURIComponent(optionId)), userId ? {
16633
16741
  user_id: userId
16634
16742
  } : {});
16635
16743
 
16636
16744
  case 2:
16637
- return _context107.abrupt("return", _context107.sent);
16745
+ return _context108.abrupt("return", _context108.sent);
16638
16746
 
16639
16747
  case 3:
16640
16748
  case "end":
16641
- return _context107.stop();
16749
+ return _context108.stop();
16642
16750
  }
16643
16751
  }
16644
- }, _callee107, this);
16752
+ }, _callee108, this);
16645
16753
  }));
16646
16754
 
16647
- function deletePollOption(_x158, _x159, _x160) {
16755
+ function deletePollOption(_x160, _x161, _x162) {
16648
16756
  return _deletePollOption.apply(this, arguments);
16649
16757
  }
16650
16758
 
@@ -16662,12 +16770,12 @@ var StreamChat = /*#__PURE__*/function () {
16662
16770
  }, {
16663
16771
  key: "castPollVote",
16664
16772
  value: function () {
16665
- var _castPollVote = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee108(messageId, pollId, vote, userId) {
16666
- return _regeneratorRuntime.wrap(function _callee108$(_context108) {
16773
+ var _castPollVote = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee109(messageId, pollId, vote, userId) {
16774
+ return _regeneratorRuntime.wrap(function _callee109$(_context109) {
16667
16775
  while (1) {
16668
- switch (_context108.prev = _context108.next) {
16776
+ switch (_context109.prev = _context109.next) {
16669
16777
  case 0:
16670
- _context108.next = 2;
16778
+ _context109.next = 2;
16671
16779
  return this.post(this.baseURL + "/messages/".concat(encodeURIComponent(messageId), "/polls/").concat(encodeURIComponent(pollId), "/vote"), _objectSpread({
16672
16780
  vote: vote
16673
16781
  }, userId ? {
@@ -16675,17 +16783,17 @@ var StreamChat = /*#__PURE__*/function () {
16675
16783
  } : {}));
16676
16784
 
16677
16785
  case 2:
16678
- return _context108.abrupt("return", _context108.sent);
16786
+ return _context109.abrupt("return", _context109.sent);
16679
16787
 
16680
16788
  case 3:
16681
16789
  case "end":
16682
- return _context108.stop();
16790
+ return _context109.stop();
16683
16791
  }
16684
16792
  }
16685
- }, _callee108, this);
16793
+ }, _callee109, this);
16686
16794
  }));
16687
16795
 
16688
- function castPollVote(_x161, _x162, _x163, _x164) {
16796
+ function castPollVote(_x163, _x164, _x165, _x166) {
16689
16797
  return _castPollVote.apply(this, arguments);
16690
16798
  }
16691
16799
 
@@ -16702,24 +16810,24 @@ var StreamChat = /*#__PURE__*/function () {
16702
16810
  }, {
16703
16811
  key: "addPollAnswer",
16704
16812
  value: function () {
16705
- var _addPollAnswer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee109(messageId, pollId, answerText, userId) {
16706
- return _regeneratorRuntime.wrap(function _callee109$(_context109) {
16813
+ var _addPollAnswer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee110(messageId, pollId, answerText, userId) {
16814
+ return _regeneratorRuntime.wrap(function _callee110$(_context110) {
16707
16815
  while (1) {
16708
- switch (_context109.prev = _context109.next) {
16816
+ switch (_context110.prev = _context110.next) {
16709
16817
  case 0:
16710
- return _context109.abrupt("return", this.castPollVote(messageId, pollId, {
16818
+ return _context110.abrupt("return", this.castPollVote(messageId, pollId, {
16711
16819
  answer_text: answerText
16712
16820
  }, userId));
16713
16821
 
16714
16822
  case 1:
16715
16823
  case "end":
16716
- return _context109.stop();
16824
+ return _context110.stop();
16717
16825
  }
16718
16826
  }
16719
- }, _callee109, this);
16827
+ }, _callee110, this);
16720
16828
  }));
16721
16829
 
16722
- function addPollAnswer(_x165, _x166, _x167, _x168) {
16830
+ function addPollAnswer(_x167, _x168, _x169, _x170) {
16723
16831
  return _addPollAnswer.apply(this, arguments);
16724
16832
  }
16725
16833
 
@@ -16728,28 +16836,28 @@ var StreamChat = /*#__PURE__*/function () {
16728
16836
  }, {
16729
16837
  key: "removePollVote",
16730
16838
  value: function () {
16731
- var _removePollVote = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee110(messageId, pollId, voteId, userId) {
16732
- return _regeneratorRuntime.wrap(function _callee110$(_context110) {
16839
+ var _removePollVote = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee111(messageId, pollId, voteId, userId) {
16840
+ return _regeneratorRuntime.wrap(function _callee111$(_context111) {
16733
16841
  while (1) {
16734
- switch (_context110.prev = _context110.next) {
16842
+ switch (_context111.prev = _context111.next) {
16735
16843
  case 0:
16736
- _context110.next = 2;
16844
+ _context111.next = 2;
16737
16845
  return this.delete(this.baseURL + "/messages/".concat(encodeURIComponent(messageId), "/polls/").concat(encodeURIComponent(pollId), "/vote/").concat(encodeURIComponent(voteId)), _objectSpread({}, userId ? {
16738
16846
  user_id: userId
16739
16847
  } : {}));
16740
16848
 
16741
16849
  case 2:
16742
- return _context110.abrupt("return", _context110.sent);
16850
+ return _context111.abrupt("return", _context111.sent);
16743
16851
 
16744
16852
  case 3:
16745
16853
  case "end":
16746
- return _context110.stop();
16854
+ return _context111.stop();
16747
16855
  }
16748
16856
  }
16749
- }, _callee110, this);
16857
+ }, _callee111, this);
16750
16858
  }));
16751
16859
 
16752
- function removePollVote(_x169, _x170, _x171, _x172) {
16860
+ function removePollVote(_x171, _x172, _x173, _x174) {
16753
16861
  return _removePollVote.apply(this, arguments);
16754
16862
  }
16755
16863
 
@@ -16767,37 +16875,37 @@ var StreamChat = /*#__PURE__*/function () {
16767
16875
  }, {
16768
16876
  key: "queryPolls",
16769
16877
  value: function () {
16770
- var _queryPolls = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee111() {
16878
+ var _queryPolls = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee112() {
16771
16879
  var filter,
16772
16880
  sort,
16773
16881
  options,
16774
16882
  userId,
16775
16883
  q,
16776
- _args111 = arguments;
16777
- return _regeneratorRuntime.wrap(function _callee111$(_context111) {
16884
+ _args112 = arguments;
16885
+ return _regeneratorRuntime.wrap(function _callee112$(_context112) {
16778
16886
  while (1) {
16779
- switch (_context111.prev = _context111.next) {
16887
+ switch (_context112.prev = _context112.next) {
16780
16888
  case 0:
16781
- filter = _args111.length > 0 && _args111[0] !== undefined ? _args111[0] : {};
16782
- sort = _args111.length > 1 && _args111[1] !== undefined ? _args111[1] : [];
16783
- options = _args111.length > 2 && _args111[2] !== undefined ? _args111[2] : {};
16784
- userId = _args111.length > 3 ? _args111[3] : undefined;
16889
+ filter = _args112.length > 0 && _args112[0] !== undefined ? _args112[0] : {};
16890
+ sort = _args112.length > 1 && _args112[1] !== undefined ? _args112[1] : [];
16891
+ options = _args112.length > 2 && _args112[2] !== undefined ? _args112[2] : {};
16892
+ userId = _args112.length > 3 ? _args112[3] : undefined;
16785
16893
  q = userId ? "?user_id=".concat(userId) : '';
16786
- _context111.next = 7;
16894
+ _context112.next = 7;
16787
16895
  return this.post(this.baseURL + "/polls/query".concat(q), _objectSpread({
16788
16896
  filter: filter,
16789
16897
  sort: normalizeQuerySort(sort)
16790
16898
  }, options));
16791
16899
 
16792
16900
  case 7:
16793
- return _context111.abrupt("return", _context111.sent);
16901
+ return _context112.abrupt("return", _context112.sent);
16794
16902
 
16795
16903
  case 8:
16796
16904
  case "end":
16797
- return _context111.stop();
16905
+ return _context112.stop();
16798
16906
  }
16799
16907
  }
16800
- }, _callee111, this);
16908
+ }, _callee112, this);
16801
16909
  }));
16802
16910
 
16803
16911
  function queryPolls() {
@@ -16819,40 +16927,40 @@ var StreamChat = /*#__PURE__*/function () {
16819
16927
  }, {
16820
16928
  key: "queryPollVotes",
16821
16929
  value: function () {
16822
- var _queryPollVotes = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee112(pollId) {
16930
+ var _queryPollVotes = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee113(pollId) {
16823
16931
  var filter,
16824
16932
  sort,
16825
16933
  options,
16826
16934
  userId,
16827
16935
  q,
16828
- _args112 = arguments;
16829
- return _regeneratorRuntime.wrap(function _callee112$(_context112) {
16936
+ _args113 = arguments;
16937
+ return _regeneratorRuntime.wrap(function _callee113$(_context113) {
16830
16938
  while (1) {
16831
- switch (_context112.prev = _context112.next) {
16939
+ switch (_context113.prev = _context113.next) {
16832
16940
  case 0:
16833
- filter = _args112.length > 1 && _args112[1] !== undefined ? _args112[1] : {};
16834
- sort = _args112.length > 2 && _args112[2] !== undefined ? _args112[2] : [];
16835
- options = _args112.length > 3 && _args112[3] !== undefined ? _args112[3] : {};
16836
- userId = _args112.length > 4 ? _args112[4] : undefined;
16941
+ filter = _args113.length > 1 && _args113[1] !== undefined ? _args113[1] : {};
16942
+ sort = _args113.length > 2 && _args113[2] !== undefined ? _args113[2] : [];
16943
+ options = _args113.length > 3 && _args113[3] !== undefined ? _args113[3] : {};
16944
+ userId = _args113.length > 4 ? _args113[4] : undefined;
16837
16945
  q = userId ? "?user_id=".concat(userId) : '';
16838
- _context112.next = 7;
16946
+ _context113.next = 7;
16839
16947
  return this.post(this.baseURL + "/polls/".concat(encodeURIComponent(pollId), "/votes").concat(q), _objectSpread({
16840
16948
  filter: filter,
16841
16949
  sort: normalizeQuerySort(sort)
16842
16950
  }, options));
16843
16951
 
16844
16952
  case 7:
16845
- return _context112.abrupt("return", _context112.sent);
16953
+ return _context113.abrupt("return", _context113.sent);
16846
16954
 
16847
16955
  case 8:
16848
16956
  case "end":
16849
- return _context112.stop();
16957
+ return _context113.stop();
16850
16958
  }
16851
16959
  }
16852
- }, _callee112, this);
16960
+ }, _callee113, this);
16853
16961
  }));
16854
16962
 
16855
- function queryPollVotes(_x173) {
16963
+ function queryPollVotes(_x175) {
16856
16964
  return _queryPollVotes.apply(this, arguments);
16857
16965
  }
16858
16966
 
@@ -16871,23 +16979,23 @@ var StreamChat = /*#__PURE__*/function () {
16871
16979
  }, {
16872
16980
  key: "queryPollAnswers",
16873
16981
  value: function () {
16874
- var _queryPollAnswers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee113(pollId) {
16982
+ var _queryPollAnswers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee114(pollId) {
16875
16983
  var filter,
16876
16984
  sort,
16877
16985
  options,
16878
16986
  userId,
16879
16987
  q,
16880
- _args113 = arguments;
16881
- return _regeneratorRuntime.wrap(function _callee113$(_context113) {
16988
+ _args114 = arguments;
16989
+ return _regeneratorRuntime.wrap(function _callee114$(_context114) {
16882
16990
  while (1) {
16883
- switch (_context113.prev = _context113.next) {
16991
+ switch (_context114.prev = _context114.next) {
16884
16992
  case 0:
16885
- filter = _args113.length > 1 && _args113[1] !== undefined ? _args113[1] : {};
16886
- sort = _args113.length > 2 && _args113[2] !== undefined ? _args113[2] : [];
16887
- options = _args113.length > 3 && _args113[3] !== undefined ? _args113[3] : {};
16888
- userId = _args113.length > 4 ? _args113[4] : undefined;
16993
+ filter = _args114.length > 1 && _args114[1] !== undefined ? _args114[1] : {};
16994
+ sort = _args114.length > 2 && _args114[2] !== undefined ? _args114[2] : [];
16995
+ options = _args114.length > 3 && _args114[3] !== undefined ? _args114[3] : {};
16996
+ userId = _args114.length > 4 ? _args114[4] : undefined;
16889
16997
  q = userId ? "?user_id=".concat(userId) : '';
16890
- _context113.next = 7;
16998
+ _context114.next = 7;
16891
16999
  return this.post(this.baseURL + "/polls/".concat(encodeURIComponent(pollId), "/votes").concat(q), _objectSpread({
16892
17000
  filter: _objectSpread(_objectSpread({}, filter), {}, {
16893
17001
  is_answer: true
@@ -16896,17 +17004,17 @@ var StreamChat = /*#__PURE__*/function () {
16896
17004
  }, options));
16897
17005
 
16898
17006
  case 7:
16899
- return _context113.abrupt("return", _context113.sent);
17007
+ return _context114.abrupt("return", _context114.sent);
16900
17008
 
16901
17009
  case 8:
16902
17010
  case "end":
16903
- return _context113.stop();
17011
+ return _context114.stop();
16904
17012
  }
16905
17013
  }
16906
- }, _callee113, this);
17014
+ }, _callee114, this);
16907
17015
  }));
16908
17016
 
16909
- function queryPollAnswers(_x174) {
17017
+ function queryPollAnswers(_x176) {
16910
17018
  return _queryPollAnswers.apply(this, arguments);
16911
17019
  }
16912
17020
 
@@ -16923,33 +17031,33 @@ var StreamChat = /*#__PURE__*/function () {
16923
17031
  }, {
16924
17032
  key: "queryMessageHistory",
16925
17033
  value: function () {
16926
- var _queryMessageHistory = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee114() {
17034
+ var _queryMessageHistory = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee115() {
16927
17035
  var filter,
16928
17036
  sort,
16929
17037
  options,
16930
- _args114 = arguments;
16931
- return _regeneratorRuntime.wrap(function _callee114$(_context114) {
17038
+ _args115 = arguments;
17039
+ return _regeneratorRuntime.wrap(function _callee115$(_context115) {
16932
17040
  while (1) {
16933
- switch (_context114.prev = _context114.next) {
17041
+ switch (_context115.prev = _context115.next) {
16934
17042
  case 0:
16935
- filter = _args114.length > 0 && _args114[0] !== undefined ? _args114[0] : {};
16936
- sort = _args114.length > 1 && _args114[1] !== undefined ? _args114[1] : [];
16937
- options = _args114.length > 2 && _args114[2] !== undefined ? _args114[2] : {};
16938
- _context114.next = 5;
17043
+ filter = _args115.length > 0 && _args115[0] !== undefined ? _args115[0] : {};
17044
+ sort = _args115.length > 1 && _args115[1] !== undefined ? _args115[1] : [];
17045
+ options = _args115.length > 2 && _args115[2] !== undefined ? _args115[2] : {};
17046
+ _context115.next = 5;
16939
17047
  return this.post(this.baseURL + '/messages/history', _objectSpread({
16940
17048
  filter: filter,
16941
17049
  sort: normalizeQuerySort(sort)
16942
17050
  }, options));
16943
17051
 
16944
17052
  case 5:
16945
- return _context114.abrupt("return", _context114.sent);
17053
+ return _context115.abrupt("return", _context115.sent);
16946
17054
 
16947
17055
  case 6:
16948
17056
  case "end":
16949
- return _context114.stop();
17057
+ return _context115.stop();
16950
17058
  }
16951
17059
  }
16952
- }, _callee114, this);
17060
+ }, _callee115, this);
16953
17061
  }));
16954
17062
 
16955
17063
  function queryMessageHistory() {
@@ -16970,32 +17078,32 @@ var StreamChat = /*#__PURE__*/function () {
16970
17078
  }, {
16971
17079
  key: "updateFlags",
16972
17080
  value: function () {
16973
- var _updateFlags = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee115(message_ids, reviewed_by) {
17081
+ var _updateFlags = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee116(message_ids, reviewed_by) {
16974
17082
  var options,
16975
- _args115 = arguments;
16976
- return _regeneratorRuntime.wrap(function _callee115$(_context115) {
17083
+ _args116 = arguments;
17084
+ return _regeneratorRuntime.wrap(function _callee116$(_context116) {
16977
17085
  while (1) {
16978
- switch (_context115.prev = _context115.next) {
17086
+ switch (_context116.prev = _context116.next) {
16979
17087
  case 0:
16980
- options = _args115.length > 2 && _args115[2] !== undefined ? _args115[2] : {};
16981
- _context115.next = 3;
17088
+ options = _args116.length > 2 && _args116[2] !== undefined ? _args116[2] : {};
17089
+ _context116.next = 3;
16982
17090
  return this.post(this.baseURL + '/automod/v1/moderation/update_flags', _objectSpread({
16983
17091
  message_ids: message_ids,
16984
17092
  reviewed_by: reviewed_by
16985
17093
  }, options));
16986
17094
 
16987
17095
  case 3:
16988
- return _context115.abrupt("return", _context115.sent);
17096
+ return _context116.abrupt("return", _context116.sent);
16989
17097
 
16990
17098
  case 4:
16991
17099
  case "end":
16992
- return _context115.stop();
17100
+ return _context116.stop();
16993
17101
  }
16994
17102
  }
16995
- }, _callee115, this);
17103
+ }, _callee116, this);
16996
17104
  }));
16997
17105
 
16998
- function updateFlags(_x175, _x176) {
17106
+ function updateFlags(_x177, _x178) {
16999
17107
  return _updateFlags.apply(this, arguments);
17000
17108
  }
17001
17109
 
@@ -17061,6 +17169,7 @@ var EVENT_MAP = {
17061
17169
  'reaction.deleted': true,
17062
17170
  'reaction.new': true,
17063
17171
  'reaction.updated': true,
17172
+ 'thread.updated': true,
17064
17173
  'typing.start': true,
17065
17174
  'typing.stop': true,
17066
17175
  'user.banned': true,