stream-chat 8.37.0 → 8.38.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/browser.js CHANGED
@@ -118,9 +118,9 @@ var decodeBase64 = function decodeBase64(s) {
118
118
 
119
119
  var https = null;
120
120
 
121
- function ownKeys$8(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
121
+ function ownKeys$9(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
122
122
 
123
- function _objectSpread$8(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$8(Object(source), true).forEach(function (key) { _defineProperty__default['default'](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$8(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
123
+ function _objectSpread$9(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$9(Object(source), true).forEach(function (key) { _defineProperty__default['default'](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$9(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
124
124
 
125
125
  function _createForOfIteratorHelper$4(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$4(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function (_e) { function e(_x) { return _e.apply(this, arguments); } e.toString = function () { return _e.toString(); }; return e; }(function (e) { throw e; }), f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function (_e2) { function e(_x2) { return _e2.apply(this, arguments); } e.toString = function () { return _e2.toString(); }; return e; }(function (e) { didErr = true; err = e; }), f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
126
126
 
@@ -382,7 +382,7 @@ var axiosParamsSerializer = function axiosParamsSerializer(params) {
382
382
  */
383
383
 
384
384
  function formatMessage(message) {
385
- return _objectSpread$8(_objectSpread$8({}, message), {}, {
385
+ return _objectSpread$9(_objectSpread$9({}, message), {}, {
386
386
  /**
387
387
  * @deprecated please use `html`
388
388
  */
@@ -481,9 +481,9 @@ function maybeGetReactionGroupsFallback(groups, counts, scores) {
481
481
  return null;
482
482
  }
483
483
 
484
- function ownKeys$7(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
484
+ function ownKeys$8(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
485
485
 
486
- function _objectSpread$7(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$7(Object(source), true).forEach(function (key) { _defineProperty__default['default'](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$7(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
486
+ function _objectSpread$8(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$8(Object(source), true).forEach(function (key) { _defineProperty__default['default'](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$8(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
487
487
 
488
488
  /**
489
489
  * ChannelState - A container class for the channel state.
@@ -560,7 +560,7 @@ var ChannelState = /*#__PURE__*/function () {
560
560
  if (!message) return;
561
561
  if (message.poll_id !== pollVote.poll_id) return;
562
562
 
563
- var updatedPoll = _objectSpread$7({}, poll);
563
+ var updatedPoll = _objectSpread$8({}, poll);
564
564
 
565
565
  var ownVotes = _toConsumableArray__default['default'](((_message$poll = message.poll) === null || _message$poll === void 0 ? void 0 : _message$poll.own_votes) || []);
566
566
 
@@ -582,7 +582,7 @@ var ChannelState = /*#__PURE__*/function () {
582
582
 
583
583
  updatedPoll.own_votes = ownVotes;
584
584
 
585
- var newMessage = _objectSpread$7(_objectSpread$7({}, message), {}, {
585
+ var newMessage = _objectSpread$8(_objectSpread$8({}, message), {}, {
586
586
  poll: updatedPoll
587
587
  });
588
588
 
@@ -597,7 +597,7 @@ var ChannelState = /*#__PURE__*/function () {
597
597
  if (!message) return;
598
598
  if (message.poll_id !== pollVote.poll_id) return;
599
599
 
600
- var updatedPoll = _objectSpread$7({}, poll);
600
+ var updatedPoll = _objectSpread$8({}, poll);
601
601
 
602
602
  var ownVotes = _toConsumableArray__default['default'](((_message$poll2 = message.poll) === null || _message$poll2 === void 0 ? void 0 : _message$poll2.own_votes) || []);
603
603
 
@@ -607,7 +607,7 @@ var ChannelState = /*#__PURE__*/function () {
607
607
 
608
608
  updatedPoll.own_votes = ownVotes;
609
609
 
610
- var newMessage = _objectSpread$7(_objectSpread$7({}, message), {}, {
610
+ var newMessage = _objectSpread$8(_objectSpread$8({}, message), {}, {
611
611
  poll: updatedPoll
612
612
  });
613
613
 
@@ -622,7 +622,7 @@ var ChannelState = /*#__PURE__*/function () {
622
622
  if (!message) return;
623
623
  if (message.poll_id !== pollVote.poll_id) return;
624
624
 
625
- var updatedPoll = _objectSpread$7({}, poll);
625
+ var updatedPoll = _objectSpread$8({}, poll);
626
626
 
627
627
  var ownVotes = _toConsumableArray__default['default'](((_message$poll3 = message.poll) === null || _message$poll3 === void 0 ? void 0 : _message$poll3.own_votes) || []);
628
628
 
@@ -638,7 +638,7 @@ var ChannelState = /*#__PURE__*/function () {
638
638
 
639
639
  updatedPoll.own_votes = ownVotes;
640
640
 
641
- var newMessage = _objectSpread$7(_objectSpread$7({}, message), {}, {
641
+ var newMessage = _objectSpread$8(_objectSpread$8({}, message), {}, {
642
642
  poll: updatedPoll
643
643
  });
644
644
 
@@ -652,11 +652,11 @@ var ChannelState = /*#__PURE__*/function () {
652
652
 
653
653
  if (!message) return;
654
654
 
655
- var updatedPoll = _objectSpread$7(_objectSpread$7({}, poll), {}, {
655
+ var updatedPoll = _objectSpread$8(_objectSpread$8({}, poll), {}, {
656
656
  own_votes: _toConsumableArray__default['default'](((_message$poll4 = message.poll) === null || _message$poll4 === void 0 ? void 0 : _message$poll4.own_votes) || [])
657
657
  });
658
658
 
659
- var newMessage = _objectSpread$7(_objectSpread$7({}, message), {}, {
659
+ var newMessage = _objectSpread$8(_objectSpread$8({}, message), {}, {
660
660
  poll: updatedPoll
661
661
  });
662
662
 
@@ -671,7 +671,7 @@ var ChannelState = /*#__PURE__*/function () {
671
671
  var m = messages[i];
672
672
 
673
673
  if (((_m$user = m.user) === null || _m$user === void 0 ? void 0 : _m$user.id) === user.id) {
674
- messages[i] = _objectSpread$7(_objectSpread$7({}, m), {}, {
674
+ messages[i] = _objectSpread$8(_objectSpread$8({}, m), {}, {
675
675
  user: user
676
676
  });
677
677
  }
@@ -726,7 +726,7 @@ var ChannelState = /*#__PURE__*/function () {
726
726
  user: m.user
727
727
  };
728
728
  } else {
729
- messages[i] = _objectSpread$7(_objectSpread$7({}, m), {}, {
729
+ messages[i] = _objectSpread$8(_objectSpread$8({}, m), {}, {
730
730
  type: 'deleted',
731
731
  deleted_at: user.deleted_at
732
732
  });
@@ -833,7 +833,7 @@ var ChannelState = /*#__PURE__*/function () {
833
833
  }, {
834
834
  key: "formatMessage",
835
835
  value: function formatMessage(message) {
836
- return _objectSpread$7(_objectSpread$7({}, message), {}, {
836
+ return _objectSpread$8(_objectSpread$8({}, message), {}, {
837
837
  /**
838
838
  * @deprecated please use `html`
839
839
  */
@@ -1051,7 +1051,7 @@ var ChannelState = /*#__PURE__*/function () {
1051
1051
  var parseMessage = function parseMessage(m) {
1052
1052
  var _m$pinned_at, _m$updated_at;
1053
1053
 
1054
- return _objectSpread$7(_objectSpread$7({}, m), {}, {
1054
+ return _objectSpread$8(_objectSpread$8({}, m), {}, {
1055
1055
  created_at: m.created_at.toISOString(),
1056
1056
  pinned_at: (_m$pinned_at = m.pinned_at) === null || _m$pinned_at === void 0 ? void 0 : _m$pinned_at.toISOString(),
1057
1057
  updated_at: (_m$updated_at = m.updated_at) === null || _m$updated_at === void 0 ? void 0 : _m$updated_at.toISOString()
@@ -1061,8 +1061,8 @@ var ChannelState = /*#__PURE__*/function () {
1061
1061
  var update = function update(messages) {
1062
1062
  var updatedMessages = messages.reduce(function (acc, msg) {
1063
1063
  if (msg.quoted_message_id === message.id) {
1064
- acc.push(_objectSpread$7(_objectSpread$7({}, parseMessage(msg)), {}, {
1065
- quoted_message: remove ? _objectSpread$7(_objectSpread$7({}, message), {}, {
1064
+ acc.push(_objectSpread$8(_objectSpread$8({}, parseMessage(msg)), {}, {
1065
+ quoted_message: remove ? _objectSpread$8(_objectSpread$8({}, message), {}, {
1066
1066
  attachments: []
1067
1067
  }) : message
1068
1068
  }));
@@ -1546,9 +1546,9 @@ function _unsupportedIterableToArray$3(o, minLen) { if (!o) return; if (typeof o
1546
1546
 
1547
1547
  function _arrayLikeToArray$3(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
1548
1548
 
1549
- function ownKeys$6(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
1549
+ function ownKeys$7(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
1550
1550
 
1551
- function _objectSpread$6(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$6(Object(source), true).forEach(function (key) { _defineProperty__default['default'](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$6(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
1551
+ function _objectSpread$7(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$7(Object(source), true).forEach(function (key) { _defineProperty__default['default'](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$7(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
1552
1552
 
1553
1553
  /**
1554
1554
  * Channel - The Channel class manages it's own state.
@@ -1621,7 +1621,7 @@ var Channel = /*#__PURE__*/function () {
1621
1621
  while (1) {
1622
1622
  switch (_context.prev = _context.next) {
1623
1623
  case 0:
1624
- defaultOptions = _objectSpread$6(_objectSpread$6({}, options), {}, {
1624
+ defaultOptions = _objectSpread$7(_objectSpread$7({}, options), {}, {
1625
1625
  watch: false,
1626
1626
  state: false,
1627
1627
  presence: false
@@ -1693,7 +1693,7 @@ var Channel = /*#__PURE__*/function () {
1693
1693
 
1694
1694
  this.data = data; // this._data is used for the requests...
1695
1695
 
1696
- this._data = _objectSpread$6({}, data);
1696
+ this._data = _objectSpread$7({}, data);
1697
1697
  this.cid = "".concat(type, ":").concat(id);
1698
1698
  this.listeners = {}; // perhaps the state variable should be private
1699
1699
 
@@ -1755,7 +1755,7 @@ var Channel = /*#__PURE__*/function () {
1755
1755
  switch (_context2.prev = _context2.next) {
1756
1756
  case 0:
1757
1757
  _context2.next = 2;
1758
- return this.getClient().post(this._channelURL() + '/message', _objectSpread$6({
1758
+ return this.getClient().post(this._channelURL() + '/message', _objectSpread$7({
1759
1759
  message: message
1760
1760
  }, options));
1761
1761
 
@@ -1871,7 +1871,7 @@ var Channel = /*#__PURE__*/function () {
1871
1871
 
1872
1872
  case 3:
1873
1873
  // Return a list of channels
1874
- payload = _objectSpread$6(_objectSpread$6({
1874
+ payload = _objectSpread$7(_objectSpread$7({
1875
1875
  filter_conditions: {
1876
1876
  cid: this.cid
1877
1877
  }
@@ -1968,7 +1968,7 @@ var Channel = /*#__PURE__*/function () {
1968
1968
 
1969
1969
  _context5.next = 6;
1970
1970
  return this.getClient().get(this.getClient().baseURL + '/members', {
1971
- payload: _objectSpread$6({
1971
+ payload: _objectSpread$7({
1972
1972
  type: type,
1973
1973
  id: id,
1974
1974
  members: members,
@@ -2029,7 +2029,7 @@ var Channel = /*#__PURE__*/function () {
2029
2029
 
2030
2030
  case 4:
2031
2031
  _context6.next = 6;
2032
- return this.getClient().post(this.getClient().baseURL + "/messages/".concat(messageID, "/reaction"), _objectSpread$6({
2032
+ return this.getClient().post(this.getClient().baseURL + "/messages/".concat(messageID, "/reaction"), _objectSpread$7({
2033
2033
  reaction: reaction
2034
2034
  }, options));
2035
2035
 
@@ -2110,7 +2110,7 @@ var Channel = /*#__PURE__*/function () {
2110
2110
  delete channelData[key];
2111
2111
  });
2112
2112
  _context7.next = 7;
2113
- return this._update(_objectSpread$6({
2113
+ return this._update(_objectSpread$7({
2114
2114
  message: updateMessage,
2115
2115
  data: channelData
2116
2116
  }, options));
@@ -2282,7 +2282,7 @@ var Channel = /*#__PURE__*/function () {
2282
2282
  case 0:
2283
2283
  options = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : {};
2284
2284
  _context11.next = 3;
2285
- return this.getClient().delete(this._channelURL(), _objectSpread$6({}, options));
2285
+ return this.getClient().delete(this._channelURL(), _objectSpread$7({}, options));
2286
2286
 
2287
2287
  case 3:
2288
2288
  return _context11.abrupt("return", _context11.sent);
@@ -2358,7 +2358,7 @@ var Channel = /*#__PURE__*/function () {
2358
2358
  case 0:
2359
2359
  options = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : {};
2360
2360
  _context13.next = 3;
2361
- return this._update(_objectSpread$6({
2361
+ return this._update(_objectSpread$7({
2362
2362
  accept_invite: true
2363
2363
  }, options));
2364
2364
 
@@ -2399,7 +2399,7 @@ var Channel = /*#__PURE__*/function () {
2399
2399
  case 0:
2400
2400
  options = _args14.length > 0 && _args14[0] !== undefined ? _args14[0] : {};
2401
2401
  _context14.next = 3;
2402
- return this._update(_objectSpread$6({
2402
+ return this._update(_objectSpread$7({
2403
2403
  reject_invite: true
2404
2404
  }, options));
2405
2405
 
@@ -2441,7 +2441,7 @@ var Channel = /*#__PURE__*/function () {
2441
2441
  case 0:
2442
2442
  options = _args15.length > 2 && _args15[2] !== undefined ? _args15[2] : {};
2443
2443
  _context15.next = 3;
2444
- return this._update(_objectSpread$6({
2444
+ return this._update(_objectSpread$7({
2445
2445
  add_members: members,
2446
2446
  message: message
2447
2447
  }, options));
@@ -2484,7 +2484,7 @@ var Channel = /*#__PURE__*/function () {
2484
2484
  case 0:
2485
2485
  options = _args16.length > 2 && _args16[2] !== undefined ? _args16[2] : {};
2486
2486
  _context16.next = 3;
2487
- return this._update(_objectSpread$6({
2487
+ return this._update(_objectSpread$7({
2488
2488
  add_moderators: members,
2489
2489
  message: message
2490
2490
  }, options));
@@ -2527,7 +2527,7 @@ var Channel = /*#__PURE__*/function () {
2527
2527
  case 0:
2528
2528
  options = _args17.length > 2 && _args17[2] !== undefined ? _args17[2] : {};
2529
2529
  _context17.next = 3;
2530
- return this._update(_objectSpread$6({
2530
+ return this._update(_objectSpread$7({
2531
2531
  assign_roles: roles,
2532
2532
  message: message
2533
2533
  }, options));
@@ -2570,7 +2570,7 @@ var Channel = /*#__PURE__*/function () {
2570
2570
  case 0:
2571
2571
  options = _args18.length > 2 && _args18[2] !== undefined ? _args18[2] : {};
2572
2572
  _context18.next = 3;
2573
- return this._update(_objectSpread$6({
2573
+ return this._update(_objectSpread$7({
2574
2574
  invites: members,
2575
2575
  message: message
2576
2576
  }, options));
@@ -2613,7 +2613,7 @@ var Channel = /*#__PURE__*/function () {
2613
2613
  case 0:
2614
2614
  options = _args19.length > 2 && _args19[2] !== undefined ? _args19[2] : {};
2615
2615
  _context19.next = 3;
2616
- return this._update(_objectSpread$6({
2616
+ return this._update(_objectSpread$7({
2617
2617
  remove_members: members,
2618
2618
  message: message
2619
2619
  }, options));
@@ -2656,7 +2656,7 @@ var Channel = /*#__PURE__*/function () {
2656
2656
  case 0:
2657
2657
  options = _args20.length > 2 && _args20[2] !== undefined ? _args20[2] : {};
2658
2658
  _context20.next = 3;
2659
- return this._update(_objectSpread$6({
2659
+ return this._update(_objectSpread$7({
2660
2660
  demote_moderators: members,
2661
2661
  message: message
2662
2662
  }, options));
@@ -2741,7 +2741,7 @@ var Channel = /*#__PURE__*/function () {
2741
2741
  case 0:
2742
2742
  opts = _args22.length > 0 && _args22[0] !== undefined ? _args22[0] : {};
2743
2743
  _context22.next = 3;
2744
- return this.getClient().post(this.getClient().baseURL + '/moderation/mute/channel', _objectSpread$6({
2744
+ return this.getClient().post(this.getClient().baseURL + '/moderation/mute/channel', _objectSpread$7({
2745
2745
  channel_cid: this.cid
2746
2746
  }, opts));
2747
2747
 
@@ -2783,7 +2783,7 @@ var Channel = /*#__PURE__*/function () {
2783
2783
  case 0:
2784
2784
  opts = _args23.length > 0 && _args23[0] !== undefined ? _args23[0] : {};
2785
2785
  _context23.next = 3;
2786
- return this.getClient().post(this.getClient().baseURL + '/moderation/unmute/channel', _objectSpread$6({
2786
+ return this.getClient().post(this.getClient().baseURL + '/moderation/unmute/channel', _objectSpread$7({
2787
2787
  channel_cid: this.cid
2788
2788
  }, opts));
2789
2789
 
@@ -2868,7 +2868,7 @@ var Channel = /*#__PURE__*/function () {
2868
2868
 
2869
2869
  this.lastTypingEvent = new Date();
2870
2870
  _context24.next = 10;
2871
- return this.sendEvent(_objectSpread$6({
2871
+ return this.sendEvent(_objectSpread$7({
2872
2872
  type: 'typing.start',
2873
2873
  parent_id: parent_id
2874
2874
  }, options || {}));
@@ -2912,7 +2912,7 @@ var Channel = /*#__PURE__*/function () {
2912
2912
  this.lastTypingEvent = null;
2913
2913
  this.isTyping = false;
2914
2914
  _context25.next = 6;
2915
- return this.sendEvent(_objectSpread$6({
2915
+ return this.sendEvent(_objectSpread$7({
2916
2916
  type: 'typing.stop',
2917
2917
  parent_id: parent_id
2918
2918
  }, options || {}));
@@ -2999,7 +2999,7 @@ var Channel = /*#__PURE__*/function () {
2999
2999
 
3000
3000
  case 4:
3001
3001
  _context26.next = 6;
3002
- return this.getClient().post(this._channelURL() + '/read', _objectSpread$6({}, data));
3002
+ return this.getClient().post(this._channelURL() + '/read', _objectSpread$7({}, data));
3003
3003
 
3004
3004
  case 6:
3005
3005
  return _context26.abrupt("return", _context26.sent);
@@ -3046,7 +3046,7 @@ var Channel = /*#__PURE__*/function () {
3046
3046
 
3047
3047
  case 3:
3048
3048
  _context27.next = 5;
3049
- return this.getClient().post(this._channelURL() + '/unread', _objectSpread$6({}, data));
3049
+ return this.getClient().post(this._channelURL() + '/unread', _objectSpread$7({}, data));
3050
3050
 
3051
3051
  case 5:
3052
3052
  return _context27.abrupt("return", _context27.sent);
@@ -3114,7 +3114,7 @@ var Channel = /*#__PURE__*/function () {
3114
3114
  defaultOptions.watch = false;
3115
3115
  }
3116
3116
 
3117
- combined = _objectSpread$6(_objectSpread$6({}, defaultOptions), options);
3117
+ combined = _objectSpread$7(_objectSpread$7({}, defaultOptions), options);
3118
3118
  _context28.next = 7;
3119
3119
  return this.query(combined, 'latest');
3120
3120
 
@@ -3206,7 +3206,7 @@ var Channel = /*#__PURE__*/function () {
3206
3206
  case 0:
3207
3207
  normalizedSort = sort ? normalizeQuerySort(sort) : undefined;
3208
3208
  _context30.next = 3;
3209
- return this.getClient().get(this.getClient().baseURL + "/messages/".concat(parent_id, "/replies"), _objectSpread$6({
3209
+ return this.getClient().get(this.getClient().baseURL + "/messages/".concat(parent_id, "/replies"), _objectSpread$7({
3210
3210
  sort: normalizedSort
3211
3211
  }, options));
3212
3212
 
@@ -3256,7 +3256,7 @@ var Channel = /*#__PURE__*/function () {
3256
3256
  sort = _args31.length > 1 && _args31[1] !== undefined ? _args31[1] : [];
3257
3257
  _context31.next = 3;
3258
3258
  return this.getClient().get(this.getClient().baseURL + "/channels/".concat(this.type, "/").concat(this.id, "/pinned_messages"), {
3259
- payload: _objectSpread$6(_objectSpread$6({}, options), {}, {
3259
+ payload: _objectSpread$7(_objectSpread$7({}, options), {}, {
3260
3260
  sort: normalizeQuerySort(sort)
3261
3261
  })
3262
3262
  });
@@ -3290,7 +3290,7 @@ var Channel = /*#__PURE__*/function () {
3290
3290
  }, {
3291
3291
  key: "getReactions",
3292
3292
  value: function getReactions(message_id, options) {
3293
- return this.getClient().get(this.getClient().baseURL + "/messages/".concat(message_id, "/reactions"), _objectSpread$6({}, options));
3293
+ return this.getClient().get(this.getClient().baseURL + "/messages/".concat(message_id, "/reactions"), _objectSpread$7({}, options));
3294
3294
  }
3295
3295
  /**
3296
3296
  * getMessagesById - Retrieves a list of messages by ID
@@ -3438,7 +3438,7 @@ var Channel = /*#__PURE__*/function () {
3438
3438
  }
3439
3439
 
3440
3440
  _context32.next = 7;
3441
- return this.getClient().post(queryURL + '/query', _objectSpread$6({
3441
+ return this.getClient().post(queryURL + '/query', _objectSpread$7({
3442
3442
  data: this._data,
3443
3443
  state: true
3444
3444
  }, options));
@@ -3527,7 +3527,7 @@ var Channel = /*#__PURE__*/function () {
3527
3527
  this._checkInitialized();
3528
3528
 
3529
3529
  _context33.next = 3;
3530
- return this.getClient().banUser(targetUserID, _objectSpread$6(_objectSpread$6({}, options), {}, {
3530
+ return this.getClient().banUser(targetUserID, _objectSpread$7(_objectSpread$7({}, options), {}, {
3531
3531
  type: this.type,
3532
3532
  id: this.id
3533
3533
  }));
@@ -3699,7 +3699,7 @@ var Channel = /*#__PURE__*/function () {
3699
3699
  this._checkInitialized();
3700
3700
 
3701
3701
  _context37.next = 3;
3702
- return this.getClient().shadowBan(targetUserID, _objectSpread$6(_objectSpread$6({}, options), {}, {
3702
+ return this.getClient().shadowBan(targetUserID, _objectSpread$7(_objectSpread$7({}, options), {}, {
3703
3703
  type: this.type,
3704
3704
  id: this.id
3705
3705
  }));
@@ -4153,7 +4153,7 @@ var Channel = /*#__PURE__*/function () {
4153
4153
  });
4154
4154
  }
4155
4155
 
4156
- channel.data = _objectSpread$6(_objectSpread$6({}, event.channel), {}, {
4156
+ channel.data = _objectSpread$7(_objectSpread$7({}, event.channel), {}, {
4157
4157
  hidden: (_event$channel$hidden = (_event$channel3 = event.channel) === null || _event$channel3 === void 0 ? void 0 : _event$channel3.hidden) !== null && _event$channel$hidden !== void 0 ? _event$channel$hidden : (_channel$data2 = channel.data) === null || _channel$data2 === void 0 ? void 0 : _channel$data2.hidden,
4158
4158
  own_capabilities: (_event$channel$own_ca = (_event$channel4 = event.channel) === null || _event$channel4 === void 0 ? void 0 : _event$channel4.own_capabilities) !== null && _event$channel$own_ca !== void 0 ? _event$channel$own_ca : (_channel$data3 = channel.data) === null || _channel$data3 === void 0 ? void 0 : _channel$data3.own_capabilities
4159
4159
  });
@@ -4227,7 +4227,7 @@ var Channel = /*#__PURE__*/function () {
4227
4227
  break;
4228
4228
 
4229
4229
  case 'channel.hidden':
4230
- channel.data = _objectSpread$6(_objectSpread$6({}, channel.data), {}, {
4230
+ channel.data = _objectSpread$7(_objectSpread$7({}, channel.data), {}, {
4231
4231
  hidden: true
4232
4232
  });
4233
4233
 
@@ -4238,26 +4238,26 @@ var Channel = /*#__PURE__*/function () {
4238
4238
  break;
4239
4239
 
4240
4240
  case 'channel.visible':
4241
- channel.data = _objectSpread$6(_objectSpread$6({}, channel.data), {}, {
4241
+ channel.data = _objectSpread$7(_objectSpread$7({}, channel.data), {}, {
4242
4242
  hidden: false
4243
4243
  });
4244
4244
  break;
4245
4245
 
4246
4246
  case 'user.banned':
4247
4247
  if (!((_event$user11 = event.user) !== null && _event$user11 !== void 0 && _event$user11.id)) break;
4248
- channelState.members[event.user.id] = _objectSpread$6(_objectSpread$6({}, channelState.members[event.user.id] || {}), {}, {
4248
+ channelState.members[event.user.id] = _objectSpread$7(_objectSpread$7({}, channelState.members[event.user.id] || {}), {}, {
4249
4249
  shadow_banned: !!event.shadow,
4250
4250
  banned: !event.shadow,
4251
- user: _objectSpread$6(_objectSpread$6({}, ((_channelState$members = channelState.members[event.user.id]) === null || _channelState$members === void 0 ? void 0 : _channelState$members.user) || {}), event.user)
4251
+ user: _objectSpread$7(_objectSpread$7({}, ((_channelState$members = channelState.members[event.user.id]) === null || _channelState$members === void 0 ? void 0 : _channelState$members.user) || {}), event.user)
4252
4252
  });
4253
4253
  break;
4254
4254
 
4255
4255
  case 'user.unbanned':
4256
4256
  if (!((_event$user12 = event.user) !== null && _event$user12 !== void 0 && _event$user12.id)) break;
4257
- channelState.members[event.user.id] = _objectSpread$6(_objectSpread$6({}, channelState.members[event.user.id] || {}), {}, {
4257
+ channelState.members[event.user.id] = _objectSpread$7(_objectSpread$7({}, channelState.members[event.user.id] || {}), {}, {
4258
4258
  shadow_banned: false,
4259
4259
  banned: false,
4260
- user: _objectSpread$6(_objectSpread$6({}, ((_channelState$members2 = channelState.members[event.user.id]) === null || _channelState$members2 === void 0 ? void 0 : _channelState$members2.user) || {}), event.user)
4260
+ user: _objectSpread$7(_objectSpread$7({}, ((_channelState$members2 = channelState.members[event.user.id]) === null || _channelState$members2 === void 0 ? void 0 : _channelState$members2.user) || {}), event.user)
4261
4261
  });
4262
4262
  break;
4263
4263
  } // any event can send over the online count
@@ -4511,9 +4511,9 @@ var ClientState = /*#__PURE__*/function () {
4511
4511
  return ClientState;
4512
4512
  }();
4513
4513
 
4514
- function ownKeys$5(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
4514
+ function ownKeys$6(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
4515
4515
 
4516
- function _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$5(Object(source), true).forEach(function (key) { _defineProperty__default['default'](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$5(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
4516
+ function _objectSpread$6(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$6(Object(source), true).forEach(function (key) { _defineProperty__default['default'](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$6(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
4517
4517
  var InsightMetrics = function InsightMetrics() {
4518
4518
  _classCallCheck__default['default'](this, InsightMetrics);
4519
4519
 
@@ -4592,7 +4592,7 @@ var postInsights = /*#__PURE__*/function () {
4592
4592
  };
4593
4593
  }();
4594
4594
  function buildWsFatalInsight(connection, event) {
4595
- return _objectSpread$5(_objectSpread$5({}, event), buildWsBaseInsight(connection));
4595
+ return _objectSpread$6(_objectSpread$6({}, event), buildWsBaseInsight(connection));
4596
4596
  }
4597
4597
 
4598
4598
  function buildWsBaseInsight(connection) {
@@ -4625,9 +4625,9 @@ function buildWsSuccessAfterFailureInsight(connection) {
4625
4625
  return buildWsBaseInsight(connection);
4626
4626
  }
4627
4627
 
4628
- function ownKeys$4(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
4628
+ function ownKeys$5(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
4629
4629
 
4630
- function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$4(Object(source), true).forEach(function (key) { _defineProperty__default['default'](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$4(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
4630
+ function _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$5(Object(source), true).forEach(function (key) { _defineProperty__default['default'](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$5(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
4631
4631
 
4632
4632
  // Type guards to check WebSocket error type
4633
4633
  var isCloseEvent = function isCloseEvent(res) {
@@ -4991,7 +4991,7 @@ var StableWSConnection = /*#__PURE__*/function () {
4991
4991
  value: function _log(msg) {
4992
4992
  var extra = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
4993
4993
  var level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'info';
4994
- this.client.logger(level, 'connection:' + msg, _objectSpread$4({
4994
+ this.client.logger(level, 'connection:' + msg, _objectSpread$5({
4995
4995
  tags: ['connection']
4996
4996
  }, extra));
4997
4997
  }
@@ -5586,9 +5586,9 @@ var jwt = null;
5586
5586
 
5587
5587
  var crypto$1 = null;
5588
5588
 
5589
- function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
5589
+ function ownKeys$4(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
5590
5590
 
5591
- function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$3(Object(source), true).forEach(function (key) { _defineProperty__default['default'](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
5591
+ function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$4(Object(source), true).forEach(function (key) { _defineProperty__default['default'](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$4(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
5592
5592
 
5593
5593
  /**
5594
5594
  * Creates the JWT token that can be used for a UserSession
@@ -5609,7 +5609,7 @@ function JWTUserToken(apiSecret, userId) {
5609
5609
  throw new TypeError('userId should be a string');
5610
5610
  }
5611
5611
 
5612
- var payload = _objectSpread$3({
5612
+ var payload = _objectSpread$4({
5613
5613
  user_id: userId
5614
5614
  }, extraData); // make sure we return a clear error when jwt is shimmed (ie. browser build)
5615
5615
 
@@ -6013,9 +6013,9 @@ function isErrorResponse(res) {
6013
6013
  return !res.status || res.status < 200 || 300 <= res.status;
6014
6014
  }
6015
6015
 
6016
- function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
6016
+ function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
6017
6017
 
6018
- function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$2(Object(source), true).forEach(function (key) { _defineProperty__default['default'](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
6018
+ function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$3(Object(source), true).forEach(function (key) { _defineProperty__default['default'](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
6019
6019
  var ConnectionState;
6020
6020
 
6021
6021
  (function (ConnectionState) {
@@ -6078,7 +6078,7 @@ var WSConnectionFallback = /*#__PURE__*/function () {
6078
6078
  _context.next = 4;
6079
6079
  return _this.client.doAxiosRequest('get', _this.client.baseURL.replace(':3030', ':8900') + '/longpoll', // replace port if present for testing with local API
6080
6080
  undefined, {
6081
- config: _objectSpread$2(_objectSpread$2({}, config), {}, {
6081
+ config: _objectSpread$3(_objectSpread$3({}, config), {}, {
6082
6082
  cancelToken: (_this$cancelToken2 = _this.cancelToken) === null || _this$cancelToken2 === void 0 ? void 0 : _this$cancelToken2.token
6083
6083
  }),
6084
6084
  params: params
@@ -6356,7 +6356,7 @@ var WSConnectionFallback = /*#__PURE__*/function () {
6356
6356
  value: function _log(msg) {
6357
6357
  var extra = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6358
6358
  var level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'info';
6359
- this.client.logger(level, 'WSConnectionFallback:' + msg, _objectSpread$2({
6359
+ this.client.logger(level, 'WSConnectionFallback:' + msg, _objectSpread$3({
6360
6360
  tags: ['connection_fallback', 'connection']
6361
6361
  }, extra));
6362
6362
  }
@@ -6938,9 +6938,9 @@ exports.VotingVisibility = void 0;
6938
6938
 
6939
6939
  var _excluded$1 = ["parent_message_id", "parent_message", "latest_replies", "thread_participants", "reply_count", "channel", "read"];
6940
6940
 
6941
- function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
6941
+ function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
6942
6942
 
6943
- function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$1(Object(source), true).forEach(function (key) { _defineProperty__default['default'](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
6943
+ function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$2(Object(source), true).forEach(function (key) { _defineProperty__default['default'](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
6944
6944
 
6945
6945
  function _createForOfIteratorHelper$1(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$1(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
6946
6946
 
@@ -6997,7 +6997,7 @@ var Thread = /*#__PURE__*/function () {
6997
6997
  try {
6998
6998
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
6999
6999
  var r = _step.value;
7000
- this.read[r.user.id] = _objectSpread$1(_objectSpread$1({}, r), {}, {
7000
+ this.read[r.user.id] = _objectSpread$2(_objectSpread$2({}, r), {}, {
7001
7001
  last_read: new Date(r.last_read)
7002
7002
  });
7003
7003
  }
@@ -7095,6 +7095,424 @@ var Thread = /*#__PURE__*/function () {
7095
7095
  return Thread;
7096
7096
  }();
7097
7097
 
7098
+ function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
7099
+
7100
+ function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$1(Object(source), true).forEach(function (key) { _defineProperty__default['default'](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
7101
+ var MODERATION_ENTITY_TYPES = {
7102
+ user: 'stream:user',
7103
+ message: 'stream:chat:v1:message'
7104
+ }; // Moderation class provides all the endpoints related to moderation v2.
7105
+
7106
+ var Moderation = /*#__PURE__*/function () {
7107
+ function Moderation(client) {
7108
+ _classCallCheck__default['default'](this, Moderation);
7109
+
7110
+ _defineProperty__default['default'](this, "client", void 0);
7111
+
7112
+ this.client = client;
7113
+ }
7114
+ /**
7115
+ * Flag a user
7116
+ *
7117
+ * @param {string} flaggedUserID User ID to be flagged
7118
+ * @param {string} reason Reason for flagging the user
7119
+ * @param {Object} options Additional options for flagging the user
7120
+ * @param {string} options.user_id (For server side usage) User ID of the user who is flagging the target user
7121
+ * @param {Object} options.custom Additional data to be stored with the flag
7122
+ * @returns
7123
+ */
7124
+
7125
+
7126
+ _createClass__default['default'](Moderation, [{
7127
+ key: "flagUser",
7128
+ value: function () {
7129
+ var _flagUser = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee(flaggedUserID, reason) {
7130
+ var options,
7131
+ _args = arguments;
7132
+ return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
7133
+ while (1) {
7134
+ switch (_context.prev = _context.next) {
7135
+ case 0:
7136
+ options = _args.length > 2 && _args[2] !== undefined ? _args[2] : {};
7137
+ return _context.abrupt("return", this.flag(MODERATION_ENTITY_TYPES.user, flaggedUserID, '', reason, options));
7138
+
7139
+ case 2:
7140
+ case "end":
7141
+ return _context.stop();
7142
+ }
7143
+ }
7144
+ }, _callee, this);
7145
+ }));
7146
+
7147
+ function flagUser(_x, _x2) {
7148
+ return _flagUser.apply(this, arguments);
7149
+ }
7150
+
7151
+ return flagUser;
7152
+ }()
7153
+ /**
7154
+ * Flag a message
7155
+ *
7156
+ * @param {string} messageID Message ID to be flagged
7157
+ * @param {string} reason Reason for flagging the message
7158
+ * @param {Object} options Additional options for flagging the message
7159
+ * @param {string} options.user_id (For server side usage) User ID of the user who is flagging the target message
7160
+ * @param {Object} options.custom Additional data to be stored with the flag
7161
+ * @returns
7162
+ */
7163
+
7164
+ }, {
7165
+ key: "flagMessage",
7166
+ value: function () {
7167
+ var _flagMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(messageID, reason) {
7168
+ var options,
7169
+ _args2 = arguments;
7170
+ return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
7171
+ while (1) {
7172
+ switch (_context2.prev = _context2.next) {
7173
+ case 0:
7174
+ options = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : {};
7175
+ return _context2.abrupt("return", this.flag(MODERATION_ENTITY_TYPES.message, messageID, '', reason, options));
7176
+
7177
+ case 2:
7178
+ case "end":
7179
+ return _context2.stop();
7180
+ }
7181
+ }
7182
+ }, _callee2, this);
7183
+ }));
7184
+
7185
+ function flagMessage(_x3, _x4) {
7186
+ return _flagMessage.apply(this, arguments);
7187
+ }
7188
+
7189
+ return flagMessage;
7190
+ }()
7191
+ /**
7192
+ * Flag a user
7193
+ *
7194
+ * @param {string} entityType Entity type to be flagged
7195
+ * @param {string} entityId Entity ID to be flagged
7196
+ * @param {string} entityCreatorID User ID of the entity creator
7197
+ * @param {string} reason Reason for flagging the entity
7198
+ * @param {Object} options Additional options for flagging the entity
7199
+ * @param {string} options.user_id (For server side usage) User ID of the user who is flagging the target entity
7200
+ * @param {Object} options.moderation_payload Content to be flagged e.g., { texts: ['text1', 'text2'], images: ['image1', 'image2']}
7201
+ * @param {Object} options.custom Additional data to be stored with the flag
7202
+ * @returns
7203
+ */
7204
+
7205
+ }, {
7206
+ key: "flag",
7207
+ value: function () {
7208
+ var _flag = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(entityType, entityId, entityCreatorID, reason) {
7209
+ var options,
7210
+ _args3 = arguments;
7211
+ return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
7212
+ while (1) {
7213
+ switch (_context3.prev = _context3.next) {
7214
+ case 0:
7215
+ options = _args3.length > 4 && _args3[4] !== undefined ? _args3[4] : {};
7216
+ _context3.next = 3;
7217
+ return this.client.post(this.client.baseURL + '/api/v2/moderation/flag', _objectSpread$1({
7218
+ entity_type: entityType,
7219
+ entity_id: entityId,
7220
+ entity_creator_id: entityCreatorID,
7221
+ reason: reason
7222
+ }, options));
7223
+
7224
+ case 3:
7225
+ return _context3.abrupt("return", _context3.sent);
7226
+
7227
+ case 4:
7228
+ case "end":
7229
+ return _context3.stop();
7230
+ }
7231
+ }
7232
+ }, _callee3, this);
7233
+ }));
7234
+
7235
+ function flag(_x5, _x6, _x7, _x8) {
7236
+ return _flag.apply(this, arguments);
7237
+ }
7238
+
7239
+ return flag;
7240
+ }()
7241
+ /**
7242
+ * Mute a user
7243
+ * @param {string} targetID User ID to be muted
7244
+ * @param {Object} options Additional options for muting the user
7245
+ * @param {string} options.user_id (For server side usage) User ID of the user who is muting the target user
7246
+ * @param {number} options.timeout Timeout for the mute in minutes
7247
+ * @returns
7248
+ */
7249
+
7250
+ }, {
7251
+ key: "muteUser",
7252
+ value: function () {
7253
+ var _muteUser = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4(targetID) {
7254
+ var options,
7255
+ _args4 = arguments;
7256
+ return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
7257
+ while (1) {
7258
+ switch (_context4.prev = _context4.next) {
7259
+ case 0:
7260
+ options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
7261
+ _context4.next = 3;
7262
+ return this.client.post(this.client.baseURL + '/api/v2/moderation/mute', _objectSpread$1({
7263
+ target_ids: [targetID]
7264
+ }, options));
7265
+
7266
+ case 3:
7267
+ return _context4.abrupt("return", _context4.sent);
7268
+
7269
+ case 4:
7270
+ case "end":
7271
+ return _context4.stop();
7272
+ }
7273
+ }
7274
+ }, _callee4, this);
7275
+ }));
7276
+
7277
+ function muteUser(_x9) {
7278
+ return _muteUser.apply(this, arguments);
7279
+ }
7280
+
7281
+ return muteUser;
7282
+ }()
7283
+ /**
7284
+ * Unmute a user
7285
+ * @param {string} targetID User ID to be unmuted
7286
+ * @param {Object} options Additional options for unmuting the user
7287
+ * @param {string} options.user_id (For server side usage) User ID of the user who is unmuting the target user
7288
+ * @returns
7289
+ */
7290
+
7291
+ }, {
7292
+ key: "unmuteUser",
7293
+ value: function () {
7294
+ var _unmuteUser = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee5(targetID, options) {
7295
+ return _regeneratorRuntime__default['default'].wrap(function _callee5$(_context5) {
7296
+ while (1) {
7297
+ switch (_context5.prev = _context5.next) {
7298
+ case 0:
7299
+ _context5.next = 2;
7300
+ return this.client.post(this.client.baseURL + '/api/v2/moderation/unmute', _objectSpread$1({
7301
+ target_ids: [targetID]
7302
+ }, options));
7303
+
7304
+ case 2:
7305
+ return _context5.abrupt("return", _context5.sent);
7306
+
7307
+ case 3:
7308
+ case "end":
7309
+ return _context5.stop();
7310
+ }
7311
+ }
7312
+ }, _callee5, this);
7313
+ }));
7314
+
7315
+ function unmuteUser(_x10, _x11) {
7316
+ return _unmuteUser.apply(this, arguments);
7317
+ }
7318
+
7319
+ return unmuteUser;
7320
+ }()
7321
+ /**
7322
+ * Get moderation report for a user
7323
+ * @param {string} userID User ID for which moderation report is to be fetched
7324
+ * @param {Object} options Additional options for fetching the moderation report
7325
+ * @param {boolean} options.create_user_if_not_exists Create user if not exists
7326
+ * @param {boolean} options.include_user_blocks Include user blocks
7327
+ * @param {boolean} options.include_user_mutes Include user mutes
7328
+ */
7329
+
7330
+ }, {
7331
+ key: "getUserModerationReport",
7332
+ value: function () {
7333
+ var _getUserModerationReport = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee6(userID) {
7334
+ var options,
7335
+ _args6 = arguments;
7336
+ return _regeneratorRuntime__default['default'].wrap(function _callee6$(_context6) {
7337
+ while (1) {
7338
+ switch (_context6.prev = _context6.next) {
7339
+ case 0:
7340
+ options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
7341
+ _context6.next = 3;
7342
+ return this.client.get(this.client.baseURL + "/api/v2/moderation/user_report", _objectSpread$1({
7343
+ user_id: userID
7344
+ }, options));
7345
+
7346
+ case 3:
7347
+ return _context6.abrupt("return", _context6.sent);
7348
+
7349
+ case 4:
7350
+ case "end":
7351
+ return _context6.stop();
7352
+ }
7353
+ }
7354
+ }, _callee6, this);
7355
+ }));
7356
+
7357
+ function getUserModerationReport(_x12) {
7358
+ return _getUserModerationReport.apply(this, arguments);
7359
+ }
7360
+
7361
+ return getUserModerationReport;
7362
+ }()
7363
+ /**
7364
+ * Query review queue
7365
+ * @param {Object} filterConditions Filter conditions for querying review queue
7366
+ * @param {Object} sort Sort conditions for querying review queue
7367
+ * @param {Object} options Pagination options for querying review queue
7368
+ */
7369
+
7370
+ }, {
7371
+ key: "queryReviewQueue",
7372
+ value: function () {
7373
+ var _queryReviewQueue = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee7() {
7374
+ var filterConditions,
7375
+ sort,
7376
+ options,
7377
+ _args7 = arguments;
7378
+ return _regeneratorRuntime__default['default'].wrap(function _callee7$(_context7) {
7379
+ while (1) {
7380
+ switch (_context7.prev = _context7.next) {
7381
+ case 0:
7382
+ filterConditions = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {};
7383
+ sort = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : [];
7384
+ options = _args7.length > 2 && _args7[2] !== undefined ? _args7[2] : {};
7385
+ _context7.next = 5;
7386
+ return this.client.post(this.client.baseURL + '/api/v2/moderation/review_queue', _objectSpread$1({
7387
+ filter: filterConditions,
7388
+ sort: normalizeQuerySort(sort)
7389
+ }, options));
7390
+
7391
+ case 5:
7392
+ return _context7.abrupt("return", _context7.sent);
7393
+
7394
+ case 6:
7395
+ case "end":
7396
+ return _context7.stop();
7397
+ }
7398
+ }
7399
+ }, _callee7, this);
7400
+ }));
7401
+
7402
+ function queryReviewQueue() {
7403
+ return _queryReviewQueue.apply(this, arguments);
7404
+ }
7405
+
7406
+ return queryReviewQueue;
7407
+ }()
7408
+ /**
7409
+ * Upsert moderation config
7410
+ * @param {Object} config Moderation config to be upserted
7411
+ */
7412
+
7413
+ }, {
7414
+ key: "upsertConfig",
7415
+ value: function () {
7416
+ var _upsertConfig = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee8() {
7417
+ var config,
7418
+ _args8 = arguments;
7419
+ return _regeneratorRuntime__default['default'].wrap(function _callee8$(_context8) {
7420
+ while (1) {
7421
+ switch (_context8.prev = _context8.next) {
7422
+ case 0:
7423
+ config = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {};
7424
+ _context8.next = 3;
7425
+ return this.client.post(this.client.baseURL + '/api/v2/moderation/config', config);
7426
+
7427
+ case 3:
7428
+ return _context8.abrupt("return", _context8.sent);
7429
+
7430
+ case 4:
7431
+ case "end":
7432
+ return _context8.stop();
7433
+ }
7434
+ }
7435
+ }, _callee8, this);
7436
+ }));
7437
+
7438
+ function upsertConfig() {
7439
+ return _upsertConfig.apply(this, arguments);
7440
+ }
7441
+
7442
+ return upsertConfig;
7443
+ }()
7444
+ /**
7445
+ * Get moderation config
7446
+ * @param {string} key Key for which moderation config is to be fetched
7447
+ */
7448
+
7449
+ }, {
7450
+ key: "getConfig",
7451
+ value: function () {
7452
+ var _getConfig = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee9(key) {
7453
+ return _regeneratorRuntime__default['default'].wrap(function _callee9$(_context9) {
7454
+ while (1) {
7455
+ switch (_context9.prev = _context9.next) {
7456
+ case 0:
7457
+ _context9.next = 2;
7458
+ return this.client.get(this.client.baseURL + '/api/v2/moderation/config/' + key);
7459
+
7460
+ case 2:
7461
+ return _context9.abrupt("return", _context9.sent);
7462
+
7463
+ case 3:
7464
+ case "end":
7465
+ return _context9.stop();
7466
+ }
7467
+ }
7468
+ }, _callee9, this);
7469
+ }));
7470
+
7471
+ function getConfig(_x13) {
7472
+ return _getConfig.apply(this, arguments);
7473
+ }
7474
+
7475
+ return getConfig;
7476
+ }()
7477
+ }, {
7478
+ key: "submitAction",
7479
+ value: function () {
7480
+ var _submitAction = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee10(actionType, itemID) {
7481
+ var options,
7482
+ _args10 = arguments;
7483
+ return _regeneratorRuntime__default['default'].wrap(function _callee10$(_context10) {
7484
+ while (1) {
7485
+ switch (_context10.prev = _context10.next) {
7486
+ case 0:
7487
+ options = _args10.length > 2 && _args10[2] !== undefined ? _args10[2] : {};
7488
+ _context10.next = 3;
7489
+ return this.client.post(this.client.baseURL + '/api/v2/moderation/submit_action', _objectSpread$1({
7490
+ action_type: actionType,
7491
+ item_id: itemID
7492
+ }, options));
7493
+
7494
+ case 3:
7495
+ return _context10.abrupt("return", _context10.sent);
7496
+
7497
+ case 4:
7498
+ case "end":
7499
+ return _context10.stop();
7500
+ }
7501
+ }
7502
+ }, _callee10, this);
7503
+ }));
7504
+
7505
+ function submitAction(_x14, _x15) {
7506
+ return _submitAction.apply(this, arguments);
7507
+ }
7508
+
7509
+ return submitAction;
7510
+ }()
7511
+ }]);
7512
+
7513
+ return Moderation;
7514
+ }();
7515
+
7098
7516
  var _excluded = ["created_at", "updated_at", "last_active", "online"],
7099
7517
  _excluded2 = ["params", "headers"];
7100
7518
 
@@ -7147,6 +7565,8 @@ var StreamChat = /*#__PURE__*/function () {
7147
7565
 
7148
7566
  _defineProperty__default['default'](this, "recoverStateOnReconnect", void 0);
7149
7567
 
7568
+ _defineProperty__default['default'](this, "moderation", void 0);
7569
+
7150
7570
  _defineProperty__default['default'](this, "mutedChannels", void 0);
7151
7571
 
7152
7572
  _defineProperty__default['default'](this, "mutedUsers", void 0);
@@ -7908,7 +8328,8 @@ var StreamChat = /*#__PURE__*/function () {
7908
8328
  this.state = new ClientState(); // a list of channels to hide ws events from
7909
8329
 
7910
8330
  this.mutedChannels = [];
7911
- this.mutedUsers = []; // set the secret
8331
+ this.mutedUsers = [];
8332
+ this.moderation = new Moderation(this); // set the secret
7912
8333
 
7913
8334
  if (secretOrOptions && isString(secretOrOptions)) {
7914
8335
  this.secret = secretOrOptions;
@@ -7936,11 +8357,11 @@ var StreamChat = /*#__PURE__*/function () {
7936
8357
  this.axiosInstance = axios__default['default'].create(this.options);
7937
8358
  this.setBaseURL(this.options.baseURL || 'https://chat.stream-io-api.com');
7938
8359
 
7939
- if (typeof process !== 'undefined' && process.env.STREAM_LOCAL_TEST_RUN) {
8360
+ if (typeof process !== 'undefined' && 'env' in process && process.env.STREAM_LOCAL_TEST_RUN) {
7940
8361
  this.setBaseURL('http://localhost:3030');
7941
8362
  }
7942
8363
 
7943
- if (typeof process !== 'undefined' && process.env.STREAM_LOCAL_TEST_HOST) {
8364
+ if (typeof process !== 'undefined' && 'env' in process && process.env.STREAM_LOCAL_TEST_HOST) {
7944
8365
  this.setBaseURL('http://' + process.env.STREAM_LOCAL_TEST_HOST);
7945
8366
  } // WS connection is initialized when setUser is called
7946
8367
 
@@ -11572,7 +11993,7 @@ var StreamChat = /*#__PURE__*/function () {
11572
11993
  }, {
11573
11994
  key: "getUserAgent",
11574
11995
  value: function getUserAgent() {
11575
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.37.0");
11996
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.38.0");
11576
11997
  }
11577
11998
  }, {
11578
11999
  key: "setUserAgent",
@@ -13017,19 +13438,22 @@ var StreamChat = /*#__PURE__*/function () {
13017
13438
  /**
13018
13439
  * Creates a poll
13019
13440
  * @param params PollData The poll that will be created
13441
+ * @param userId string The user id (only serverside)
13020
13442
  * @returns {APIResponse & CreatePollAPIResponse} The poll
13021
13443
  */
13022
13444
 
13023
13445
  }, {
13024
13446
  key: "createPoll",
13025
13447
  value: function () {
13026
- var _createPoll = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee98(poll) {
13448
+ var _createPoll = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee98(poll, userId) {
13027
13449
  return _regeneratorRuntime__default['default'].wrap(function _callee98$(_context98) {
13028
13450
  while (1) {
13029
13451
  switch (_context98.prev = _context98.next) {
13030
13452
  case 0:
13031
13453
  _context98.next = 2;
13032
- return this.post(this.baseURL + "/polls", poll);
13454
+ return this.post(this.baseURL + "/polls", _objectSpread(_objectSpread({}, poll), userId ? {
13455
+ user_id: userId
13456
+ } : {}));
13033
13457
 
13034
13458
  case 2:
13035
13459
  return _context98.abrupt("return", _context98.sent);
@@ -13042,7 +13466,7 @@ var StreamChat = /*#__PURE__*/function () {
13042
13466
  }, _callee98, this);
13043
13467
  }));
13044
13468
 
13045
- function createPoll(_x136) {
13469
+ function createPoll(_x136, _x137) {
13046
13470
  return _createPoll.apply(this, arguments);
13047
13471
  }
13048
13472
 
@@ -13051,6 +13475,7 @@ var StreamChat = /*#__PURE__*/function () {
13051
13475
  /**
13052
13476
  * Retrieves a poll
13053
13477
  * @param id string The poll id
13478
+ * @param userId string The user id (only serverside)
13054
13479
  * @returns {APIResponse & GetPollAPIResponse} The poll
13055
13480
  */
13056
13481
 
@@ -13063,9 +13488,9 @@ var StreamChat = /*#__PURE__*/function () {
13063
13488
  switch (_context99.prev = _context99.next) {
13064
13489
  case 0:
13065
13490
  _context99.next = 2;
13066
- return this.get(this.baseURL + "/polls/".concat(id), _objectSpread({}, userId ? {
13491
+ return this.get(this.baseURL + "/polls/".concat(id), userId ? {
13067
13492
  user_id: userId
13068
- } : {}));
13493
+ } : {});
13069
13494
 
13070
13495
  case 2:
13071
13496
  return _context99.abrupt("return", _context99.sent);
@@ -13078,7 +13503,7 @@ var StreamChat = /*#__PURE__*/function () {
13078
13503
  }, _callee99, this);
13079
13504
  }));
13080
13505
 
13081
- function getPoll(_x137, _x138) {
13506
+ function getPoll(_x138, _x139) {
13082
13507
  return _getPoll.apply(this, arguments);
13083
13508
  }
13084
13509
 
@@ -13087,19 +13512,22 @@ var StreamChat = /*#__PURE__*/function () {
13087
13512
  /**
13088
13513
  * Updates a poll
13089
13514
  * @param poll PollData The poll that will be updated
13515
+ * @param userId string The user id (only serverside)
13090
13516
  * @returns {APIResponse & PollResponse} The poll
13091
13517
  */
13092
13518
 
13093
13519
  }, {
13094
13520
  key: "updatePoll",
13095
13521
  value: function () {
13096
- var _updatePoll = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee100(poll) {
13522
+ var _updatePoll = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee100(poll, userId) {
13097
13523
  return _regeneratorRuntime__default['default'].wrap(function _callee100$(_context100) {
13098
13524
  while (1) {
13099
13525
  switch (_context100.prev = _context100.next) {
13100
13526
  case 0:
13101
13527
  _context100.next = 2;
13102
- return this.put(this.baseURL + "/polls", poll);
13528
+ return this.put(this.baseURL + "/polls", _objectSpread(_objectSpread({}, poll), userId ? {
13529
+ user_id: userId
13530
+ } : {}));
13103
13531
 
13104
13532
  case 2:
13105
13533
  return _context100.abrupt("return", _context100.sent);
@@ -13112,7 +13540,7 @@ var StreamChat = /*#__PURE__*/function () {
13112
13540
  }, _callee100, this);
13113
13541
  }));
13114
13542
 
13115
- function updatePoll(_x139) {
13543
+ function updatePoll(_x140, _x141) {
13116
13544
  return _updatePoll.apply(this, arguments);
13117
13545
  }
13118
13546
 
@@ -13122,6 +13550,7 @@ var StreamChat = /*#__PURE__*/function () {
13122
13550
  * Partially updates a poll
13123
13551
  * @param id string The poll id
13124
13552
  * @param {PartialPollUpdate<StreamChatGenerics>} partialPollObject which should contain id and any of "set" or "unset" params;
13553
+ * @param userId string The user id (only serverside)
13125
13554
  * example: {id: "44f26af5-f2be-4fa7-9dac-71cf893781de", set:{field: value}, unset:["field2"]}
13126
13555
  * @returns {APIResponse & UpdatePollAPIResponse} The poll
13127
13556
  */
@@ -13129,13 +13558,15 @@ var StreamChat = /*#__PURE__*/function () {
13129
13558
  }, {
13130
13559
  key: "partialUpdatePoll",
13131
13560
  value: function () {
13132
- var _partialUpdatePoll = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee101(id, partialPollObject) {
13561
+ var _partialUpdatePoll = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee101(id, partialPollObject, userId) {
13133
13562
  return _regeneratorRuntime__default['default'].wrap(function _callee101$(_context101) {
13134
13563
  while (1) {
13135
13564
  switch (_context101.prev = _context101.next) {
13136
13565
  case 0:
13137
13566
  _context101.next = 2;
13138
- return this.patch(this.baseURL + "/polls/".concat(id), partialPollObject);
13567
+ return this.patch(this.baseURL + "/polls/".concat(id), _objectSpread(_objectSpread({}, partialPollObject), userId ? {
13568
+ user_id: userId
13569
+ } : {}));
13139
13570
 
13140
13571
  case 2:
13141
13572
  return _context101.abrupt("return", _context101.sent);
@@ -13148,7 +13579,7 @@ var StreamChat = /*#__PURE__*/function () {
13148
13579
  }, _callee101, this);
13149
13580
  }));
13150
13581
 
13151
- function partialUpdatePoll(_x140, _x141) {
13582
+ function partialUpdatePoll(_x142, _x143, _x144) {
13152
13583
  return _partialUpdatePoll.apply(this, arguments);
13153
13584
  }
13154
13585
 
@@ -13185,7 +13616,7 @@ var StreamChat = /*#__PURE__*/function () {
13185
13616
  }, _callee102, this);
13186
13617
  }));
13187
13618
 
13188
- function deletePoll(_x142, _x143) {
13619
+ function deletePoll(_x145, _x146) {
13189
13620
  return _deletePoll.apply(this, arguments);
13190
13621
  }
13191
13622
 
@@ -13194,22 +13625,25 @@ var StreamChat = /*#__PURE__*/function () {
13194
13625
  /**
13195
13626
  * Close a poll
13196
13627
  * @param id string The poll id
13628
+ * @param userId string The user id (only serverside)
13197
13629
  * @returns {APIResponse & UpdatePollAPIResponse} The poll
13198
13630
  */
13199
13631
 
13200
13632
  }, {
13201
13633
  key: "closePoll",
13202
13634
  value: function () {
13203
- var _closePoll = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee103(id) {
13635
+ var _closePoll = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee103(id, userId) {
13204
13636
  return _regeneratorRuntime__default['default'].wrap(function _callee103$(_context103) {
13205
13637
  while (1) {
13206
13638
  switch (_context103.prev = _context103.next) {
13207
13639
  case 0:
13208
- return _context103.abrupt("return", this.partialUpdatePoll(id, {
13640
+ return _context103.abrupt("return", this.partialUpdatePoll(id, _objectSpread({
13209
13641
  set: {
13210
13642
  is_closed: true
13211
13643
  }
13212
- }));
13644
+ }, userId ? {
13645
+ user_id: userId
13646
+ } : {})));
13213
13647
 
13214
13648
  case 1:
13215
13649
  case "end":
@@ -13219,7 +13653,7 @@ var StreamChat = /*#__PURE__*/function () {
13219
13653
  }, _callee103, this);
13220
13654
  }));
13221
13655
 
13222
- function closePoll(_x144) {
13656
+ function closePoll(_x147, _x148) {
13223
13657
  return _closePoll.apply(this, arguments);
13224
13658
  }
13225
13659
 
@@ -13229,19 +13663,22 @@ var StreamChat = /*#__PURE__*/function () {
13229
13663
  * Creates a poll option
13230
13664
  * @param pollId string The poll id
13231
13665
  * @param option PollOptionData The poll option that will be created
13666
+ * @param userId string The user id (only serverside)
13232
13667
  * @returns {APIResponse & PollOptionResponse} The poll option
13233
13668
  */
13234
13669
 
13235
13670
  }, {
13236
13671
  key: "createPollOption",
13237
13672
  value: function () {
13238
- var _createPollOption = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee104(pollId, option) {
13673
+ var _createPollOption = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee104(pollId, option, userId) {
13239
13674
  return _regeneratorRuntime__default['default'].wrap(function _callee104$(_context104) {
13240
13675
  while (1) {
13241
13676
  switch (_context104.prev = _context104.next) {
13242
13677
  case 0:
13243
13678
  _context104.next = 2;
13244
- return this.post(this.baseURL + "/polls/".concat(pollId, "/options"), option);
13679
+ return this.post(this.baseURL + "/polls/".concat(pollId, "/options"), _objectSpread(_objectSpread({}, option), userId ? {
13680
+ user_id: userId
13681
+ } : {}));
13245
13682
 
13246
13683
  case 2:
13247
13684
  return _context104.abrupt("return", _context104.sent);
@@ -13254,7 +13691,7 @@ var StreamChat = /*#__PURE__*/function () {
13254
13691
  }, _callee104, this);
13255
13692
  }));
13256
13693
 
13257
- function createPollOption(_x145, _x146) {
13694
+ function createPollOption(_x149, _x150, _x151) {
13258
13695
  return _createPollOption.apply(this, arguments);
13259
13696
  }
13260
13697
 
@@ -13264,19 +13701,22 @@ var StreamChat = /*#__PURE__*/function () {
13264
13701
  * Retrieves a poll option
13265
13702
  * @param pollId string The poll id
13266
13703
  * @param optionId string The poll option id
13704
+ * @param userId string The user id (only serverside)
13267
13705
  * @returns {APIResponse & PollOptionResponse} The poll option
13268
13706
  */
13269
13707
 
13270
13708
  }, {
13271
13709
  key: "getPollOption",
13272
13710
  value: function () {
13273
- var _getPollOption = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee105(pollId, optionId) {
13711
+ var _getPollOption = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee105(pollId, optionId, userId) {
13274
13712
  return _regeneratorRuntime__default['default'].wrap(function _callee105$(_context105) {
13275
13713
  while (1) {
13276
13714
  switch (_context105.prev = _context105.next) {
13277
13715
  case 0:
13278
13716
  _context105.next = 2;
13279
- return this.get(this.baseURL + "/polls/".concat(pollId, "/options/").concat(optionId));
13717
+ return this.get(this.baseURL + "/polls/".concat(pollId, "/options/").concat(optionId), userId ? {
13718
+ user_id: userId
13719
+ } : {});
13280
13720
 
13281
13721
  case 2:
13282
13722
  return _context105.abrupt("return", _context105.sent);
@@ -13289,7 +13729,7 @@ var StreamChat = /*#__PURE__*/function () {
13289
13729
  }, _callee105, this);
13290
13730
  }));
13291
13731
 
13292
- function getPollOption(_x147, _x148) {
13732
+ function getPollOption(_x152, _x153, _x154) {
13293
13733
  return _getPollOption.apply(this, arguments);
13294
13734
  }
13295
13735
 
@@ -13299,19 +13739,22 @@ var StreamChat = /*#__PURE__*/function () {
13299
13739
  * Updates a poll option
13300
13740
  * @param pollId string The poll id
13301
13741
  * @param option PollOptionData The poll option that will be updated
13742
+ * @param userId string The user id (only serverside)
13302
13743
  * @returns
13303
13744
  */
13304
13745
 
13305
13746
  }, {
13306
13747
  key: "updatePollOption",
13307
13748
  value: function () {
13308
- var _updatePollOption = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee106(pollId, option) {
13749
+ var _updatePollOption = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee106(pollId, option, userId) {
13309
13750
  return _regeneratorRuntime__default['default'].wrap(function _callee106$(_context106) {
13310
13751
  while (1) {
13311
13752
  switch (_context106.prev = _context106.next) {
13312
13753
  case 0:
13313
13754
  _context106.next = 2;
13314
- return this.put(this.baseURL + "/polls/".concat(pollId, "/options"), option);
13755
+ return this.put(this.baseURL + "/polls/".concat(pollId, "/options"), _objectSpread(_objectSpread({}, option), userId ? {
13756
+ user_id: userId
13757
+ } : {}));
13315
13758
 
13316
13759
  case 2:
13317
13760
  return _context106.abrupt("return", _context106.sent);
@@ -13324,7 +13767,7 @@ var StreamChat = /*#__PURE__*/function () {
13324
13767
  }, _callee106, this);
13325
13768
  }));
13326
13769
 
13327
- function updatePollOption(_x149, _x150) {
13770
+ function updatePollOption(_x155, _x156, _x157) {
13328
13771
  return _updatePollOption.apply(this, arguments);
13329
13772
  }
13330
13773
 
@@ -13334,19 +13777,22 @@ var StreamChat = /*#__PURE__*/function () {
13334
13777
  * Delete a poll option
13335
13778
  * @param pollId string The poll id
13336
13779
  * @param optionId string The poll option id
13780
+ * @param userId string The user id (only serverside)
13337
13781
  * @returns {APIResponse} The poll option
13338
13782
  */
13339
13783
 
13340
13784
  }, {
13341
13785
  key: "deletePollOption",
13342
13786
  value: function () {
13343
- var _deletePollOption = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee107(pollId, optionId) {
13787
+ var _deletePollOption = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee107(pollId, optionId, userId) {
13344
13788
  return _regeneratorRuntime__default['default'].wrap(function _callee107$(_context107) {
13345
13789
  while (1) {
13346
13790
  switch (_context107.prev = _context107.next) {
13347
13791
  case 0:
13348
13792
  _context107.next = 2;
13349
- return this.delete(this.baseURL + "/polls/".concat(pollId, "/options/").concat(optionId));
13793
+ return this.delete(this.baseURL + "/polls/".concat(pollId, "/options/").concat(optionId), userId ? {
13794
+ user_id: userId
13795
+ } : {});
13350
13796
 
13351
13797
  case 2:
13352
13798
  return _context107.abrupt("return", _context107.sent);
@@ -13359,7 +13805,7 @@ var StreamChat = /*#__PURE__*/function () {
13359
13805
  }, _callee107, this);
13360
13806
  }));
13361
13807
 
13362
- function deletePollOption(_x151, _x152) {
13808
+ function deletePollOption(_x158, _x159, _x160) {
13363
13809
  return _deletePollOption.apply(this, arguments);
13364
13810
  }
13365
13811
 
@@ -13370,29 +13816,29 @@ var StreamChat = /*#__PURE__*/function () {
13370
13816
  * @param messageId string The message id
13371
13817
  * @param pollId string The poll id
13372
13818
  * @param vote PollVoteData The vote that will be casted
13819
+ * @param userId string The user id (only serverside)
13373
13820
  * @returns {APIResponse & CastVoteAPIResponse} The poll vote
13374
13821
  */
13375
13822
 
13376
13823
  }, {
13377
13824
  key: "castPollVote",
13378
13825
  value: function () {
13379
- var _castPollVote = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee108(messageId, pollId, vote) {
13380
- var options,
13381
- _args108 = arguments;
13826
+ var _castPollVote = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee108(messageId, pollId, vote, userId) {
13382
13827
  return _regeneratorRuntime__default['default'].wrap(function _callee108$(_context108) {
13383
13828
  while (1) {
13384
13829
  switch (_context108.prev = _context108.next) {
13385
13830
  case 0:
13386
- options = _args108.length > 3 && _args108[3] !== undefined ? _args108[3] : {};
13387
- _context108.next = 3;
13831
+ _context108.next = 2;
13388
13832
  return this.post(this.baseURL + "/messages/".concat(messageId, "/polls/").concat(pollId, "/vote"), _objectSpread({
13389
13833
  vote: vote
13390
- }, options));
13834
+ }, userId ? {
13835
+ user_id: userId
13836
+ } : {}));
13391
13837
 
13392
- case 3:
13838
+ case 2:
13393
13839
  return _context108.abrupt("return", _context108.sent);
13394
13840
 
13395
- case 4:
13841
+ case 3:
13396
13842
  case "end":
13397
13843
  return _context108.stop();
13398
13844
  }
@@ -13400,7 +13846,7 @@ var StreamChat = /*#__PURE__*/function () {
13400
13846
  }, _callee108, this);
13401
13847
  }));
13402
13848
 
13403
- function castPollVote(_x153, _x154, _x155) {
13849
+ function castPollVote(_x161, _x162, _x163, _x164) {
13404
13850
  return _castPollVote.apply(this, arguments);
13405
13851
  }
13406
13852
 
@@ -13411,19 +13857,20 @@ var StreamChat = /*#__PURE__*/function () {
13411
13857
  * @param messageId string The message id
13412
13858
  * @param pollId string The poll id
13413
13859
  * @param answerText string The answer text
13860
+ * @param userId string The user id (only serverside)
13414
13861
  */
13415
13862
 
13416
13863
  }, {
13417
13864
  key: "addPollAnswer",
13418
13865
  value: function () {
13419
- var _addPollAnswer = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee109(messageId, pollId, answerText) {
13866
+ var _addPollAnswer = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee109(messageId, pollId, answerText, userId) {
13420
13867
  return _regeneratorRuntime__default['default'].wrap(function _callee109$(_context109) {
13421
13868
  while (1) {
13422
13869
  switch (_context109.prev = _context109.next) {
13423
13870
  case 0:
13424
13871
  return _context109.abrupt("return", this.castPollVote(messageId, pollId, {
13425
13872
  answer_text: answerText
13426
- }));
13873
+ }, userId));
13427
13874
 
13428
13875
  case 1:
13429
13876
  case "end":
@@ -13433,7 +13880,7 @@ var StreamChat = /*#__PURE__*/function () {
13433
13880
  }, _callee109, this);
13434
13881
  }));
13435
13882
 
13436
- function addPollAnswer(_x156, _x157, _x158) {
13883
+ function addPollAnswer(_x165, _x166, _x167, _x168) {
13437
13884
  return _addPollAnswer.apply(this, arguments);
13438
13885
  }
13439
13886
 
@@ -13442,13 +13889,15 @@ var StreamChat = /*#__PURE__*/function () {
13442
13889
  }, {
13443
13890
  key: "removePollVote",
13444
13891
  value: function () {
13445
- var _removePollVote = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee110(messageId, pollId, voteId) {
13892
+ var _removePollVote = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee110(messageId, pollId, voteId, userId) {
13446
13893
  return _regeneratorRuntime__default['default'].wrap(function _callee110$(_context110) {
13447
13894
  while (1) {
13448
13895
  switch (_context110.prev = _context110.next) {
13449
13896
  case 0:
13450
13897
  _context110.next = 2;
13451
- return this.delete(this.baseURL + "/messages/".concat(messageId, "/polls/").concat(pollId, "/vote/").concat(voteId));
13898
+ return this.delete(this.baseURL + "/messages/".concat(messageId, "/polls/").concat(pollId, "/vote/").concat(voteId), _objectSpread({}, userId ? {
13899
+ user_id: userId
13900
+ } : {}));
13452
13901
 
13453
13902
  case 2:
13454
13903
  return _context110.abrupt("return", _context110.sent);
@@ -13461,7 +13910,7 @@ var StreamChat = /*#__PURE__*/function () {
13461
13910
  }, _callee110, this);
13462
13911
  }));
13463
13912
 
13464
- function removePollVote(_x159, _x160, _x161) {
13913
+ function removePollVote(_x169, _x170, _x171, _x172) {
13465
13914
  return _removePollVote.apply(this, arguments);
13466
13915
  }
13467
13916
 
@@ -13472,6 +13921,7 @@ var StreamChat = /*#__PURE__*/function () {
13472
13921
  * @param filter
13473
13922
  * @param sort
13474
13923
  * @param options Option object, {limit: 10, offset:0}
13924
+ * @param userId string The user id (only serverside)
13475
13925
  * @returns {APIResponse & QueryPollsResponse} The polls
13476
13926
  */
13477
13927
 
@@ -13482,6 +13932,8 @@ var StreamChat = /*#__PURE__*/function () {
13482
13932
  var filter,
13483
13933
  sort,
13484
13934
  options,
13935
+ userId,
13936
+ q,
13485
13937
  _args111 = arguments;
13486
13938
  return _regeneratorRuntime__default['default'].wrap(function _callee111$(_context111) {
13487
13939
  while (1) {
@@ -13490,16 +13942,18 @@ var StreamChat = /*#__PURE__*/function () {
13490
13942
  filter = _args111.length > 0 && _args111[0] !== undefined ? _args111[0] : {};
13491
13943
  sort = _args111.length > 1 && _args111[1] !== undefined ? _args111[1] : [];
13492
13944
  options = _args111.length > 2 && _args111[2] !== undefined ? _args111[2] : {};
13493
- _context111.next = 5;
13494
- return this.post(this.baseURL + '/polls/query', _objectSpread({
13945
+ userId = _args111.length > 3 ? _args111[3] : undefined;
13946
+ q = userId ? "?user_id=".concat(userId) : '';
13947
+ _context111.next = 7;
13948
+ return this.post(this.baseURL + "/polls/query".concat(q), _objectSpread({
13495
13949
  filter: filter,
13496
13950
  sort: normalizeQuerySort(sort)
13497
13951
  }, options));
13498
13952
 
13499
- case 5:
13953
+ case 7:
13500
13954
  return _context111.abrupt("return", _context111.sent);
13501
13955
 
13502
- case 6:
13956
+ case 8:
13503
13957
  case "end":
13504
13958
  return _context111.stop();
13505
13959
  }
@@ -13519,7 +13973,8 @@ var StreamChat = /*#__PURE__*/function () {
13519
13973
  * @param filter
13520
13974
  * @param sort
13521
13975
  * @param options Option object, {limit: 10, offset:0}
13522
- * @returns {APIResponse & PollVotesAPIResponse} The poll votes
13976
+ * @param userId string The user id (only serverside)
13977
+ * @returns {APIResponse & PollVotesAPIResponse} The poll votes
13523
13978
  */
13524
13979
 
13525
13980
  }, {
@@ -13529,6 +13984,8 @@ var StreamChat = /*#__PURE__*/function () {
13529
13984
  var filter,
13530
13985
  sort,
13531
13986
  options,
13987
+ userId,
13988
+ q,
13532
13989
  _args112 = arguments;
13533
13990
  return _regeneratorRuntime__default['default'].wrap(function _callee112$(_context112) {
13534
13991
  while (1) {
@@ -13537,16 +13994,18 @@ var StreamChat = /*#__PURE__*/function () {
13537
13994
  filter = _args112.length > 1 && _args112[1] !== undefined ? _args112[1] : {};
13538
13995
  sort = _args112.length > 2 && _args112[2] !== undefined ? _args112[2] : [];
13539
13996
  options = _args112.length > 3 && _args112[3] !== undefined ? _args112[3] : {};
13540
- _context112.next = 5;
13541
- return this.post(this.baseURL + "/polls/".concat(pollId, "/votes"), _objectSpread({
13997
+ userId = _args112.length > 4 ? _args112[4] : undefined;
13998
+ q = userId ? "?user_id=".concat(userId) : '';
13999
+ _context112.next = 7;
14000
+ return this.post(this.baseURL + "/polls/".concat(pollId, "/votes").concat(q), _objectSpread({
13542
14001
  filter: filter,
13543
14002
  sort: normalizeQuerySort(sort)
13544
14003
  }, options));
13545
14004
 
13546
- case 5:
14005
+ case 7:
13547
14006
  return _context112.abrupt("return", _context112.sent);
13548
14007
 
13549
- case 6:
14008
+ case 8:
13550
14009
  case "end":
13551
14010
  return _context112.stop();
13552
14011
  }
@@ -13554,14 +14013,14 @@ var StreamChat = /*#__PURE__*/function () {
13554
14013
  }, _callee112, this);
13555
14014
  }));
13556
14015
 
13557
- function queryPollVotes(_x162) {
14016
+ function queryPollVotes(_x173) {
13558
14017
  return _queryPollVotes.apply(this, arguments);
13559
14018
  }
13560
14019
 
13561
14020
  return queryPollVotes;
13562
14021
  }()
13563
14022
  /**
13564
- * Queries message histories
14023
+ * Query message history
13565
14024
  * @param filter
13566
14025
  * @param sort
13567
14026
  * @param options Option object, {limit: 10}
@@ -13643,7 +14102,7 @@ var StreamChat = /*#__PURE__*/function () {
13643
14102
  }, _callee114, this);
13644
14103
  }));
13645
14104
 
13646
- function updateFlags(_x163, _x164) {
14105
+ function updateFlags(_x174, _x175) {
13647
14106
  return _updateFlags.apply(this, arguments);
13648
14107
  }
13649
14108
 
@@ -13820,8 +14279,10 @@ exports.ErrorFromResponse = ErrorFromResponse;
13820
14279
  exports.InsightMetrics = InsightMetrics;
13821
14280
  exports.JWTServerToken = JWTServerToken;
13822
14281
  exports.JWTUserToken = JWTUserToken;
14282
+ exports.MODERATION_ENTITY_TYPES = MODERATION_ENTITY_TYPES;
13823
14283
  exports.MaxPriority = MaxPriority;
13824
14284
  exports.MinPriority = MinPriority;
14285
+ exports.Moderation = Moderation;
13825
14286
  exports.Permission = Permission;
13826
14287
  exports.Segment = Segment;
13827
14288
  exports.StableWSConnection = StableWSConnection;