stream-chat 5.0.0 → 5.1.2

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
@@ -89,7 +89,7 @@ var decodeBase64 = function decodeBase64(s) {
89
89
  return r;
90
90
  };
91
91
 
92
- 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; }
92
+ 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; }
93
93
 
94
94
  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(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; }
95
95
 
@@ -312,6 +312,12 @@ var ChannelState = /*#__PURE__*/function () {
312
312
  for (var i = 0; i < newMessages.length; i += 1) {
313
313
  var _this$_channel;
314
314
 
315
+ var isFromShadowBannedUser = newMessages[i].shadowed;
316
+
317
+ if (isFromShadowBannedUser) {
318
+ continue;
319
+ }
320
+
315
321
  var message = this.formatMessage(newMessages[i]);
316
322
 
317
323
  if (message.user && (_this$_channel = this._channel) !== null && _this$_channel !== void 0 && _this$_channel.cid) {
@@ -701,7 +707,7 @@ var ChannelState = /*#__PURE__*/function () {
701
707
  return ChannelState;
702
708
  }();
703
709
 
704
- 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; }
710
+ 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; }
705
711
 
706
712
  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(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; }
707
713
 
@@ -758,7 +764,7 @@ var isValidEventType = function isValidEventType(eventType) {
758
764
  return IS_VALID_EVENT_MAP_TYPE[eventType] || false;
759
765
  };
760
766
 
761
- function _createForOfIteratorHelper$3(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$3(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 = o[Symbol.iterator](); }, 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; } } }; }
767
+ function _createForOfIteratorHelper$3(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$3(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; } } }; }
762
768
 
763
769
  function _unsupportedIterableToArray$3(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$3(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$3(o, minLen); }
764
770
 
@@ -804,6 +810,10 @@ function isFileWebAPI(uri) {
804
810
  return typeof window !== 'undefined' && 'File' in window && uri instanceof File;
805
811
  }
806
812
 
813
+ function isBlobWebAPI(uri) {
814
+ return typeof window !== 'undefined' && 'Blob' in window && uri instanceof Blob;
815
+ }
816
+
807
817
  function isOwnUser(user) {
808
818
  return (user === null || user === void 0 ? void 0 : user.total_unread_count) !== undefined;
809
819
  }
@@ -823,7 +833,7 @@ function isOwnUserBaseProperty(property) {
823
833
  function addFileToFormData(uri, name, contentType) {
824
834
  var data = new FormData();
825
835
 
826
- if (isReadableStream(uri) || isBuffer(uri) || isFileWebAPI(uri)) {
836
+ if (isReadableStream(uri) || isBuffer(uri) || isFileWebAPI(uri) || isBlobWebAPI(uri)) {
827
837
  if (name) data.append('file', uri, name);else data.append('file', uri);
828
838
  } else {
829
839
  data.append('file', {
@@ -984,13 +994,13 @@ function removeConnectionEventListeners(cb) {
984
994
  }
985
995
  }
986
996
 
987
- function _createForOfIteratorHelper$2(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$2(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 = o[Symbol.iterator](); }, 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; } } }; }
997
+ function _createForOfIteratorHelper$2(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$2(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; } } }; }
988
998
 
989
999
  function _unsupportedIterableToArray$2(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$2(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$2(o, minLen); }
990
1000
 
991
1001
  function _arrayLikeToArray$2(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; }
992
1002
 
993
- 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; }
1003
+ 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; }
994
1004
 
995
1005
  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(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; }
996
1006
 
@@ -2575,6 +2585,50 @@ var Channel = /*#__PURE__*/function () {
2575
2585
 
2576
2586
  return getReplies;
2577
2587
  }()
2588
+ /**
2589
+ * getPinnedMessages - List list pinned messages of the channel
2590
+ *
2591
+ * @param {PinnedMessagePaginationOptions & { user?: UserResponse<UserType>; user_id?: string }} options Pagination params, ie {limit:10, id_lte: 10}
2592
+ * @param {PinnedMessagesSort} sort defines sorting direction of pinned messages
2593
+ *
2594
+ * @return {Promise<GetRepliesAPIResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>} A response with a list of messages
2595
+ */
2596
+
2597
+ }, {
2598
+ key: "getPinnedMessages",
2599
+ value: function () {
2600
+ var _getPinnedMessages = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30(options) {
2601
+ var sort,
2602
+ _args30 = arguments;
2603
+ return _regeneratorRuntime.wrap(function _callee30$(_context30) {
2604
+ while (1) {
2605
+ switch (_context30.prev = _context30.next) {
2606
+ case 0:
2607
+ sort = _args30.length > 1 && _args30[1] !== undefined ? _args30[1] : [];
2608
+ _context30.next = 3;
2609
+ return this.getClient().get(this.getClient().baseURL + "/channels/".concat(this.type, "/").concat(this.id, "/pinned_messages"), {
2610
+ payload: _objectSpread$5(_objectSpread$5({}, options), {}, {
2611
+ sort: normalizeQuerySort(sort)
2612
+ })
2613
+ });
2614
+
2615
+ case 3:
2616
+ return _context30.abrupt("return", _context30.sent);
2617
+
2618
+ case 4:
2619
+ case "end":
2620
+ return _context30.stop();
2621
+ }
2622
+ }
2623
+ }, _callee30, this);
2624
+ }));
2625
+
2626
+ function getPinnedMessages(_x29) {
2627
+ return _getPinnedMessages.apply(this, arguments);
2628
+ }
2629
+
2630
+ return getPinnedMessages;
2631
+ }()
2578
2632
  /**
2579
2633
  * getReactions - List the reactions, supports pagination
2580
2634
  *
@@ -2702,13 +2756,13 @@ var Channel = /*#__PURE__*/function () {
2702
2756
  * @return {Promise<ChannelAPIResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>} Returns a query response
2703
2757
  */
2704
2758
  function () {
2705
- var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30(options) {
2759
+ var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31(options) {
2706
2760
  var queryURL, state, membersStr, tempChannelCid;
2707
- return _regeneratorRuntime.wrap(function _callee30$(_context30) {
2761
+ return _regeneratorRuntime.wrap(function _callee31$(_context31) {
2708
2762
  while (1) {
2709
- switch (_context30.prev = _context30.next) {
2763
+ switch (_context31.prev = _context31.next) {
2710
2764
  case 0:
2711
- _context30.next = 2;
2765
+ _context31.next = 2;
2712
2766
  return this.getClient().wsPromise;
2713
2767
 
2714
2768
  case 2:
@@ -2718,14 +2772,14 @@ var Channel = /*#__PURE__*/function () {
2718
2772
  queryURL += "/".concat(this.id);
2719
2773
  }
2720
2774
 
2721
- _context30.next = 6;
2775
+ _context31.next = 6;
2722
2776
  return this.getClient().post(queryURL + '/query', _objectSpread$5({
2723
2777
  data: this._data,
2724
2778
  state: true
2725
2779
  }, options));
2726
2780
 
2727
2781
  case 6:
2728
- state = _context30.sent;
2782
+ state = _context31.sent;
2729
2783
 
2730
2784
  // update the channel id if it was missing
2731
2785
  if (!this.id) {
@@ -2755,17 +2809,17 @@ var Channel = /*#__PURE__*/function () {
2755
2809
 
2756
2810
  this._initializeState(state);
2757
2811
 
2758
- return _context30.abrupt("return", state);
2812
+ return _context31.abrupt("return", state);
2759
2813
 
2760
2814
  case 11:
2761
2815
  case "end":
2762
- return _context30.stop();
2816
+ return _context31.stop();
2763
2817
  }
2764
2818
  }
2765
- }, _callee30, this);
2819
+ }, _callee31, this);
2766
2820
  }));
2767
2821
 
2768
- function query(_x29) {
2822
+ function query(_x30) {
2769
2823
  return _query.apply(this, arguments);
2770
2824
  }
2771
2825
 
@@ -2782,31 +2836,31 @@ var Channel = /*#__PURE__*/function () {
2782
2836
  }, {
2783
2837
  key: "banUser",
2784
2838
  value: function () {
2785
- var _banUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31(targetUserID, options) {
2786
- return _regeneratorRuntime.wrap(function _callee31$(_context31) {
2839
+ var _banUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee32(targetUserID, options) {
2840
+ return _regeneratorRuntime.wrap(function _callee32$(_context32) {
2787
2841
  while (1) {
2788
- switch (_context31.prev = _context31.next) {
2842
+ switch (_context32.prev = _context32.next) {
2789
2843
  case 0:
2790
2844
  this._checkInitialized();
2791
2845
 
2792
- _context31.next = 3;
2846
+ _context32.next = 3;
2793
2847
  return this.getClient().banUser(targetUserID, _objectSpread$5(_objectSpread$5({}, options), {}, {
2794
2848
  type: this.type,
2795
2849
  id: this.id
2796
2850
  }));
2797
2851
 
2798
2852
  case 3:
2799
- return _context31.abrupt("return", _context31.sent);
2853
+ return _context32.abrupt("return", _context32.sent);
2800
2854
 
2801
2855
  case 4:
2802
2856
  case "end":
2803
- return _context31.stop();
2857
+ return _context32.stop();
2804
2858
  }
2805
2859
  }
2806
- }, _callee31, this);
2860
+ }, _callee32, this);
2807
2861
  }));
2808
2862
 
2809
- function banUser(_x30, _x31) {
2863
+ function banUser(_x31, _x32) {
2810
2864
  return _banUser.apply(this, arguments);
2811
2865
  }
2812
2866
 
@@ -2824,34 +2878,34 @@ var Channel = /*#__PURE__*/function () {
2824
2878
  }, {
2825
2879
  key: "hide",
2826
2880
  value: function () {
2827
- var _hide = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee32() {
2881
+ var _hide = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee33() {
2828
2882
  var userId,
2829
2883
  clearHistory,
2830
- _args32 = arguments;
2831
- return _regeneratorRuntime.wrap(function _callee32$(_context32) {
2884
+ _args33 = arguments;
2885
+ return _regeneratorRuntime.wrap(function _callee33$(_context33) {
2832
2886
  while (1) {
2833
- switch (_context32.prev = _context32.next) {
2887
+ switch (_context33.prev = _context33.next) {
2834
2888
  case 0:
2835
- userId = _args32.length > 0 && _args32[0] !== undefined ? _args32[0] : null;
2836
- clearHistory = _args32.length > 1 && _args32[1] !== undefined ? _args32[1] : false;
2889
+ userId = _args33.length > 0 && _args33[0] !== undefined ? _args33[0] : null;
2890
+ clearHistory = _args33.length > 1 && _args33[1] !== undefined ? _args33[1] : false;
2837
2891
 
2838
2892
  this._checkInitialized();
2839
2893
 
2840
- _context32.next = 5;
2894
+ _context33.next = 5;
2841
2895
  return this.getClient().post("".concat(this._channelURL(), "/hide"), {
2842
2896
  user_id: userId,
2843
2897
  clear_history: clearHistory
2844
2898
  });
2845
2899
 
2846
2900
  case 5:
2847
- return _context32.abrupt("return", _context32.sent);
2901
+ return _context33.abrupt("return", _context33.sent);
2848
2902
 
2849
2903
  case 6:
2850
2904
  case "end":
2851
- return _context32.stop();
2905
+ return _context33.stop();
2852
2906
  }
2853
2907
  }
2854
- }, _callee32, this);
2908
+ }, _callee33, this);
2855
2909
  }));
2856
2910
 
2857
2911
  function hide() {
@@ -2870,31 +2924,31 @@ var Channel = /*#__PURE__*/function () {
2870
2924
  }, {
2871
2925
  key: "show",
2872
2926
  value: function () {
2873
- var _show = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee33() {
2927
+ var _show = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee34() {
2874
2928
  var userId,
2875
- _args33 = arguments;
2876
- return _regeneratorRuntime.wrap(function _callee33$(_context33) {
2929
+ _args34 = arguments;
2930
+ return _regeneratorRuntime.wrap(function _callee34$(_context34) {
2877
2931
  while (1) {
2878
- switch (_context33.prev = _context33.next) {
2932
+ switch (_context34.prev = _context34.next) {
2879
2933
  case 0:
2880
- userId = _args33.length > 0 && _args33[0] !== undefined ? _args33[0] : null;
2934
+ userId = _args34.length > 0 && _args34[0] !== undefined ? _args34[0] : null;
2881
2935
 
2882
2936
  this._checkInitialized();
2883
2937
 
2884
- _context33.next = 4;
2938
+ _context34.next = 4;
2885
2939
  return this.getClient().post("".concat(this._channelURL(), "/show"), {
2886
2940
  user_id: userId
2887
2941
  });
2888
2942
 
2889
2943
  case 4:
2890
- return _context33.abrupt("return", _context33.sent);
2944
+ return _context34.abrupt("return", _context34.sent);
2891
2945
 
2892
2946
  case 5:
2893
2947
  case "end":
2894
- return _context33.stop();
2948
+ return _context34.stop();
2895
2949
  }
2896
2950
  }
2897
- }, _callee33, this);
2951
+ }, _callee34, this);
2898
2952
  }));
2899
2953
 
2900
2954
  function show() {
@@ -2913,31 +2967,31 @@ var Channel = /*#__PURE__*/function () {
2913
2967
  }, {
2914
2968
  key: "unbanUser",
2915
2969
  value: function () {
2916
- var _unbanUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee34(targetUserID) {
2917
- return _regeneratorRuntime.wrap(function _callee34$(_context34) {
2970
+ var _unbanUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee35(targetUserID) {
2971
+ return _regeneratorRuntime.wrap(function _callee35$(_context35) {
2918
2972
  while (1) {
2919
- switch (_context34.prev = _context34.next) {
2973
+ switch (_context35.prev = _context35.next) {
2920
2974
  case 0:
2921
2975
  this._checkInitialized();
2922
2976
 
2923
- _context34.next = 3;
2977
+ _context35.next = 3;
2924
2978
  return this.getClient().unbanUser(targetUserID, {
2925
2979
  type: this.type,
2926
2980
  id: this.id
2927
2981
  });
2928
2982
 
2929
2983
  case 3:
2930
- return _context34.abrupt("return", _context34.sent);
2984
+ return _context35.abrupt("return", _context35.sent);
2931
2985
 
2932
2986
  case 4:
2933
2987
  case "end":
2934
- return _context34.stop();
2988
+ return _context35.stop();
2935
2989
  }
2936
2990
  }
2937
- }, _callee34, this);
2991
+ }, _callee35, this);
2938
2992
  }));
2939
2993
 
2940
- function unbanUser(_x32) {
2994
+ function unbanUser(_x33) {
2941
2995
  return _unbanUser.apply(this, arguments);
2942
2996
  }
2943
2997
 
@@ -2954,31 +3008,31 @@ var Channel = /*#__PURE__*/function () {
2954
3008
  }, {
2955
3009
  key: "shadowBan",
2956
3010
  value: function () {
2957
- var _shadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee35(targetUserID, options) {
2958
- return _regeneratorRuntime.wrap(function _callee35$(_context35) {
3011
+ var _shadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee36(targetUserID, options) {
3012
+ return _regeneratorRuntime.wrap(function _callee36$(_context36) {
2959
3013
  while (1) {
2960
- switch (_context35.prev = _context35.next) {
3014
+ switch (_context36.prev = _context36.next) {
2961
3015
  case 0:
2962
3016
  this._checkInitialized();
2963
3017
 
2964
- _context35.next = 3;
3018
+ _context36.next = 3;
2965
3019
  return this.getClient().shadowBan(targetUserID, _objectSpread$5(_objectSpread$5({}, options), {}, {
2966
3020
  type: this.type,
2967
3021
  id: this.id
2968
3022
  }));
2969
3023
 
2970
3024
  case 3:
2971
- return _context35.abrupt("return", _context35.sent);
3025
+ return _context36.abrupt("return", _context36.sent);
2972
3026
 
2973
3027
  case 4:
2974
3028
  case "end":
2975
- return _context35.stop();
3029
+ return _context36.stop();
2976
3030
  }
2977
3031
  }
2978
- }, _callee35, this);
3032
+ }, _callee36, this);
2979
3033
  }));
2980
3034
 
2981
- function shadowBan(_x33, _x34) {
3035
+ function shadowBan(_x34, _x35) {
2982
3036
  return _shadowBan.apply(this, arguments);
2983
3037
  }
2984
3038
 
@@ -2994,31 +3048,31 @@ var Channel = /*#__PURE__*/function () {
2994
3048
  }, {
2995
3049
  key: "removeShadowBan",
2996
3050
  value: function () {
2997
- var _removeShadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee36(targetUserID) {
2998
- return _regeneratorRuntime.wrap(function _callee36$(_context36) {
3051
+ var _removeShadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee37(targetUserID) {
3052
+ return _regeneratorRuntime.wrap(function _callee37$(_context37) {
2999
3053
  while (1) {
3000
- switch (_context36.prev = _context36.next) {
3054
+ switch (_context37.prev = _context37.next) {
3001
3055
  case 0:
3002
3056
  this._checkInitialized();
3003
3057
 
3004
- _context36.next = 3;
3058
+ _context37.next = 3;
3005
3059
  return this.getClient().removeShadowBan(targetUserID, {
3006
3060
  type: this.type,
3007
3061
  id: this.id
3008
3062
  });
3009
3063
 
3010
3064
  case 3:
3011
- return _context36.abrupt("return", _context36.sent);
3065
+ return _context37.abrupt("return", _context37.sent);
3012
3066
 
3013
3067
  case 4:
3014
3068
  case "end":
3015
- return _context36.stop();
3069
+ return _context37.stop();
3016
3070
  }
3017
3071
  }
3018
- }, _callee36, this);
3072
+ }, _callee37, this);
3019
3073
  }));
3020
3074
 
3021
- function removeShadowBan(_x35) {
3075
+ function removeShadowBan(_x36) {
3022
3076
  return _removeShadowBan.apply(this, arguments);
3023
3077
  }
3024
3078
 
@@ -3240,7 +3294,12 @@ var Channel = /*#__PURE__*/function () {
3240
3294
 
3241
3295
  case 'channel.updated':
3242
3296
  if (event.channel) {
3243
- channel.data = event.channel;
3297
+ var _event$channel$hidden, _event$channel, _channel$data, _event$channel$own_ca, _event$channel2, _channel$data2;
3298
+
3299
+ channel.data = _objectSpread$5(_objectSpread$5({}, event.channel), {}, {
3300
+ hidden: (_event$channel$hidden = (_event$channel = event.channel) === null || _event$channel === void 0 ? void 0 : _event$channel.hidden) !== null && _event$channel$hidden !== void 0 ? _event$channel$hidden : (_channel$data = channel.data) === null || _channel$data === void 0 ? void 0 : _channel$data.hidden,
3301
+ own_capabilities: (_event$channel$own_ca = (_event$channel2 = event.channel) === null || _event$channel2 === void 0 ? void 0 : _event$channel2.own_capabilities) !== null && _event$channel$own_ca !== void 0 ? _event$channel$own_ca : (_channel$data2 = channel.data) === null || _channel$data2 === void 0 ? void 0 : _channel$data2.own_capabilities
3302
+ });
3244
3303
  }
3245
3304
 
3246
3305
  break;
@@ -3427,7 +3486,7 @@ var Channel = /*#__PURE__*/function () {
3427
3486
  return Channel;
3428
3487
  }();
3429
3488
 
3430
- function _createForOfIteratorHelper$1(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { 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 = o[Symbol.iterator](); }, 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; } } }; }
3489
+ 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; } } }; }
3431
3490
 
3432
3491
  function _unsupportedIterableToArray$1(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$1(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen); }
3433
3492
 
@@ -3502,7 +3561,7 @@ var ClientState = /*#__PURE__*/function () {
3502
3561
  return ClientState;
3503
3562
  }();
3504
3563
 
3505
- 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; }
3564
+ 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; }
3506
3565
 
3507
3566
  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(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; }
3508
3567
  var InsightMetrics = function InsightMetrics() {
@@ -3616,7 +3675,7 @@ function buildWsSuccessAfterFailureInsight(connection) {
3616
3675
  return buildWsBaseInsight(connection);
3617
3676
  }
3618
3677
 
3619
- 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; }
3678
+ 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; }
3620
3679
 
3621
3680
  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(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; }
3622
3681
 
@@ -4534,7 +4593,7 @@ var StableWSConnection = /*#__PURE__*/function () {
4534
4593
  return StableWSConnection;
4535
4594
  }();
4536
4595
 
4537
- 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; }
4596
+ 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; }
4538
4597
 
4539
4598
  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(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; }
4540
4599
 
@@ -4949,7 +5008,7 @@ function isWSFailure(err) {
4949
5008
  }
4950
5009
  }
4951
5010
 
4952
- 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; }
5011
+ 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; }
4953
5012
 
4954
5013
  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(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; }
4955
5014
  var ConnectionState;
@@ -5157,27 +5216,35 @@ var WSConnectionFallback = /*#__PURE__*/function () {
5157
5216
  reconnect = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : false;
5158
5217
 
5159
5218
  if (!(_this.state === ConnectionState.Connecting)) {
5160
- _context3.next = 3;
5219
+ _context3.next = 4;
5161
5220
  break;
5162
5221
  }
5163
5222
 
5164
- throw new Error('connecting already in progress');
5223
+ _this._log('connect() - connecting already in progress', {
5224
+ reconnect: reconnect
5225
+ }, 'warn');
5165
5226
 
5166
- case 3:
5227
+ return _context3.abrupt("return");
5228
+
5229
+ case 4:
5167
5230
  if (!(_this.state === ConnectionState.Connected)) {
5168
- _context3.next = 5;
5231
+ _context3.next = 7;
5169
5232
  break;
5170
5233
  }
5171
5234
 
5172
- throw new Error('already connected and polling');
5235
+ _this._log('connect() - already connected and polling', {
5236
+ reconnect: reconnect
5237
+ }, 'warn');
5173
5238
 
5174
- case 5:
5239
+ return _context3.abrupt("return");
5240
+
5241
+ case 7:
5175
5242
  _this._setState(ConnectionState.Connecting);
5176
5243
 
5177
5244
  _this.connectionID = undefined; // connect should be sent with empty connection_id so API creates one
5178
5245
 
5179
- _context3.prev = 7;
5180
- _context3.next = 10;
5246
+ _context3.prev = 9;
5247
+ _context3.next = 12;
5181
5248
  return _this._req({
5182
5249
  json: _this.client._buildWSPayload()
5183
5250
  }, {
@@ -5185,7 +5252,7 @@ var WSConnectionFallback = /*#__PURE__*/function () {
5185
5252
  }, // 8s
5186
5253
  reconnect);
5187
5254
 
5188
- case 10:
5255
+ case 12:
5189
5256
  _yield$_this$_req = _context3.sent;
5190
5257
  event = _yield$_this$_req.event;
5191
5258
 
@@ -5201,30 +5268,31 @@ var WSConnectionFallback = /*#__PURE__*/function () {
5201
5268
 
5202
5269
  return _context3.abrupt("return", event);
5203
5270
 
5204
- case 19:
5205
- _context3.prev = 19;
5206
- _context3.t0 = _context3["catch"](7);
5271
+ case 21:
5272
+ _context3.prev = 21;
5273
+ _context3.t0 = _context3["catch"](9);
5207
5274
 
5208
5275
  _this._setState(ConnectionState.Closed);
5209
5276
 
5210
5277
  throw _context3.t0;
5211
5278
 
5212
- case 23:
5279
+ case 25:
5213
5280
  case "end":
5214
5281
  return _context3.stop();
5215
5282
  }
5216
5283
  }
5217
- }, _callee3, null, [[7, 19]]);
5284
+ }, _callee3, null, [[9, 21]]);
5218
5285
  })));
5219
5286
 
5220
5287
  _defineProperty(this, "isHealthy", function () {
5221
- return _this.connectionID && _this.state === ConnectionState.Connected;
5288
+ return !!_this.connectionID && _this.state === ConnectionState.Connected;
5222
5289
  });
5223
5290
 
5224
5291
  _defineProperty(this, "disconnect", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
5225
5292
  var _this$cancelToken3;
5226
5293
 
5227
5294
  var timeout,
5295
+ connection_id,
5228
5296
  _args4 = arguments;
5229
5297
  return _regeneratorRuntime.wrap(function _callee4$(_context4) {
5230
5298
  while (1) {
@@ -5237,36 +5305,37 @@ var WSConnectionFallback = /*#__PURE__*/function () {
5237
5305
 
5238
5306
  (_this$cancelToken3 = _this.cancelToken) === null || _this$cancelToken3 === void 0 ? void 0 : _this$cancelToken3.cancel('disconnect() is called');
5239
5307
  _this.cancelToken = undefined;
5240
- _context4.prev = 5;
5241
- _context4.next = 8;
5308
+ connection_id = _this.connectionID;
5309
+ _this.connectionID = undefined;
5310
+ _context4.prev = 7;
5311
+ _context4.next = 10;
5242
5312
  return _this._req({
5243
- close: true
5313
+ close: true,
5314
+ connection_id: connection_id
5244
5315
  }, {
5245
5316
  timeout: timeout
5246
5317
  }, false);
5247
5318
 
5248
- case 8:
5249
- _this.connectionID = undefined;
5250
-
5319
+ case 10:
5251
5320
  _this._log("disconnect() - Closed connectionID");
5252
5321
 
5253
- _context4.next = 15;
5322
+ _context4.next = 16;
5254
5323
  break;
5255
5324
 
5256
- case 12:
5257
- _context4.prev = 12;
5258
- _context4.t0 = _context4["catch"](5);
5325
+ case 13:
5326
+ _context4.prev = 13;
5327
+ _context4.t0 = _context4["catch"](7);
5259
5328
 
5260
5329
  _this._log("disconnect() - Failed", {
5261
5330
  err: _context4.t0
5262
5331
  }, 'error');
5263
5332
 
5264
- case 15:
5333
+ case 16:
5265
5334
  case "end":
5266
5335
  return _context4.stop();
5267
5336
  }
5268
5337
  }
5269
- }, _callee4, null, [[5, 12]]);
5338
+ }, _callee4, null, [[7, 13]]);
5270
5339
  })));
5271
5340
 
5272
5341
  this.client = client;
@@ -5315,13 +5384,15 @@ var WSConnectionFallback = /*#__PURE__*/function () {
5315
5384
  return WSConnectionFallback;
5316
5385
  }();
5317
5386
 
5318
- function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, 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; } } }; }
5387
+ var _excluded = ["created_at", "updated_at", "last_active", "online"];
5388
+
5389
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
5319
5390
 
5320
5391
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
5321
5392
 
5322
5393
  function _arrayLikeToArray(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; }
5323
5394
 
5324
- function ownKeys(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; }
5395
+ function ownKeys(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; }
5325
5396
 
5326
5397
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
5327
5398
 
@@ -6626,7 +6697,7 @@ var StreamChat = /*#__PURE__*/function () {
6626
6697
  case 11:
6627
6698
  this.anonymous = false; // eslint-disable-next-line @typescript-eslint/no-unused-vars
6628
6699
 
6629
- _response$user = response.user, _response$user.created_at, _response$user.updated_at, _response$user.last_active, _response$user.online, guestUser = _objectWithoutProperties(_response$user, ["created_at", "updated_at", "last_active", "online"]);
6700
+ _response$user = response.user, _response$user.created_at, _response$user.updated_at, _response$user.last_active, _response$user.online, guestUser = _objectWithoutProperties(_response$user, _excluded);
6630
6701
  _context14.next = 15;
6631
6702
  return this.connectUser(guestUser, response.access_token);
6632
6703
 
@@ -6989,23 +7060,41 @@ var StreamChat = /*#__PURE__*/function () {
6989
7060
  client: this
6990
7061
  });
6991
7062
  _context15.prev = 8;
6992
- _context15.next = 11;
7063
+
7064
+ if (!this.wsFallback) {
7065
+ _context15.next = 13;
7066
+ break;
7067
+ }
7068
+
7069
+ _context15.next = 12;
7070
+ return this.wsFallback.connect();
7071
+
7072
+ case 12:
7073
+ return _context15.abrupt("return", _context15.sent);
7074
+
7075
+ case 13:
7076
+ _context15.next = 15;
6993
7077
  return this.wsConnection.connect(this.options.enableWSFallback ? this.defaultWSTimeoutWithFallback : this.defaultWSTimeout);
6994
7078
 
6995
- case 11:
7079
+ case 15:
6996
7080
  return _context15.abrupt("return", _context15.sent);
6997
7081
 
6998
- case 14:
6999
- _context15.prev = 14;
7082
+ case 18:
7083
+ _context15.prev = 18;
7000
7084
  _context15.t0 = _context15["catch"](8);
7001
7085
 
7002
7086
  if (!(this.options.enableWSFallback && isWSFailure(_context15.t0) && isOnline())) {
7003
- _context15.next = 24;
7087
+ _context15.next = 29;
7004
7088
  break;
7005
7089
  }
7006
7090
 
7007
7091
  this.logger('info', 'client:connect() - WS failed, fallback to longpoll', {
7008
7092
  tags: ['connection', 'client']
7093
+ }); // @ts-expect-error
7094
+
7095
+ this.dispatchEvent({
7096
+ type: 'transport.changed',
7097
+ mode: 'longpoll'
7009
7098
  });
7010
7099
 
7011
7100
  this.wsConnection._destroyCurrentWSConnection();
@@ -7015,21 +7104,21 @@ var StreamChat = /*#__PURE__*/function () {
7015
7104
  this.wsFallback = new WSConnectionFallback({
7016
7105
  client: this
7017
7106
  });
7018
- _context15.next = 23;
7107
+ _context15.next = 28;
7019
7108
  return this.wsFallback.connect();
7020
7109
 
7021
- case 23:
7110
+ case 28:
7022
7111
  return _context15.abrupt("return", _context15.sent);
7023
7112
 
7024
- case 24:
7113
+ case 29:
7025
7114
  throw _context15.t0;
7026
7115
 
7027
- case 25:
7116
+ case 30:
7028
7117
  case "end":
7029
7118
  return _context15.stop();
7030
7119
  }
7031
7120
  }
7032
- }, _callee15, this, [[8, 14]]);
7121
+ }, _callee15, this, [[8, 18]]);
7033
7122
  }));
7034
7123
 
7035
7124
  function connect() {
@@ -8436,6 +8525,101 @@ var StreamChat = /*#__PURE__*/function () {
8436
8525
 
8437
8526
  return unflagUser;
8438
8527
  }()
8528
+ /**
8529
+ * _queryFlagReports - Query flag reports.
8530
+ *
8531
+ * Note: Do not use this.
8532
+ * It is present for internal usage only.
8533
+ * This function can, and will, break and/or be removed at any point in time.
8534
+ *
8535
+ * @param {FlagReportsFilters} filterConditions MongoDB style filter conditions
8536
+ * @param {FlagReportsPaginationOptions} options Option object, {limit: 10, offset:0}
8537
+ *
8538
+ * @return {Promise<FlagReportsResponse<ChannelType, CommandType, UserType>>} Flag Reports Response
8539
+ */
8540
+
8541
+ }, {
8542
+ key: "_queryFlagReports",
8543
+ value: function () {
8544
+ var _queryFlagReports2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42() {
8545
+ var filterConditions,
8546
+ options,
8547
+ _args42 = arguments;
8548
+ return _regeneratorRuntime.wrap(function _callee42$(_context42) {
8549
+ while (1) {
8550
+ switch (_context42.prev = _context42.next) {
8551
+ case 0:
8552
+ filterConditions = _args42.length > 0 && _args42[0] !== undefined ? _args42[0] : {};
8553
+ options = _args42.length > 1 && _args42[1] !== undefined ? _args42[1] : {};
8554
+ _context42.next = 4;
8555
+ return this.post(this.baseURL + '/moderation/reports', _objectSpread({
8556
+ filter_conditions: filterConditions
8557
+ }, options));
8558
+
8559
+ case 4:
8560
+ return _context42.abrupt("return", _context42.sent);
8561
+
8562
+ case 5:
8563
+ case "end":
8564
+ return _context42.stop();
8565
+ }
8566
+ }
8567
+ }, _callee42, this);
8568
+ }));
8569
+
8570
+ function _queryFlagReports() {
8571
+ return _queryFlagReports2.apply(this, arguments);
8572
+ }
8573
+
8574
+ return _queryFlagReports;
8575
+ }()
8576
+ /**
8577
+ * _reviewFlagReport - review flag report
8578
+ *
8579
+ * Note: Do not use this.
8580
+ * It is present for internal usage only.
8581
+ * This function can, and will, break and/or be removed at any point in time.
8582
+ *
8583
+ * @param {string} [id] flag report to review
8584
+ * @param {string} [reviewResult] flag report review result
8585
+ * @param {string} [options.user_id] currentUserID, only used with serverside auth
8586
+ * @param {string} [options.review_details] custom information about review result
8587
+ * @returns {Promise<ReviewFlagReportResponse>>}
8588
+ */
8589
+
8590
+ }, {
8591
+ key: "_reviewFlagReport",
8592
+ value: function () {
8593
+ var _reviewFlagReport2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee43(id, reviewResult) {
8594
+ var options,
8595
+ _args43 = arguments;
8596
+ return _regeneratorRuntime.wrap(function _callee43$(_context43) {
8597
+ while (1) {
8598
+ switch (_context43.prev = _context43.next) {
8599
+ case 0:
8600
+ options = _args43.length > 2 && _args43[2] !== undefined ? _args43[2] : {};
8601
+ _context43.next = 3;
8602
+ return this.patch(this.baseURL + "/moderation/reports/".concat(id), _objectSpread({
8603
+ review_result: reviewResult
8604
+ }, options));
8605
+
8606
+ case 3:
8607
+ return _context43.abrupt("return", _context43.sent);
8608
+
8609
+ case 4:
8610
+ case "end":
8611
+ return _context43.stop();
8612
+ }
8613
+ }
8614
+ }, _callee43, this);
8615
+ }));
8616
+
8617
+ function _reviewFlagReport(_x54, _x55) {
8618
+ return _reviewFlagReport2.apply(this, arguments);
8619
+ }
8620
+
8621
+ return _reviewFlagReport;
8622
+ }()
8439
8623
  /**
8440
8624
  * @deprecated use markChannelsRead instead
8441
8625
  *
@@ -8457,23 +8641,23 @@ var StreamChat = /*#__PURE__*/function () {
8457
8641
  * @return {Promise<APIResponse>}
8458
8642
  */
8459
8643
  function () {
8460
- var _markChannelsRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42() {
8644
+ var _markChannelsRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44() {
8461
8645
  var data,
8462
- _args42 = arguments;
8463
- return _regeneratorRuntime.wrap(function _callee42$(_context42) {
8646
+ _args44 = arguments;
8647
+ return _regeneratorRuntime.wrap(function _callee44$(_context44) {
8464
8648
  while (1) {
8465
- switch (_context42.prev = _context42.next) {
8649
+ switch (_context44.prev = _context44.next) {
8466
8650
  case 0:
8467
- data = _args42.length > 0 && _args42[0] !== undefined ? _args42[0] : {};
8468
- _context42.next = 3;
8651
+ data = _args44.length > 0 && _args44[0] !== undefined ? _args44[0] : {};
8652
+ _context44.next = 3;
8469
8653
  return this.post(this.baseURL + '/channels/read', _objectSpread({}, data));
8470
8654
 
8471
8655
  case 3:
8472
8656
  case "end":
8473
- return _context42.stop();
8657
+ return _context44.stop();
8474
8658
  }
8475
8659
  }
8476
- }, _callee42, this);
8660
+ }, _callee44, this);
8477
8661
  }));
8478
8662
 
8479
8663
  function markChannelsRead() {
@@ -8548,28 +8732,28 @@ var StreamChat = /*#__PURE__*/function () {
8548
8732
  }, {
8549
8733
  key: "translateMessage",
8550
8734
  value: function () {
8551
- var _translateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee43(messageId, language) {
8552
- return _regeneratorRuntime.wrap(function _callee43$(_context43) {
8735
+ var _translateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45(messageId, language) {
8736
+ return _regeneratorRuntime.wrap(function _callee45$(_context45) {
8553
8737
  while (1) {
8554
- switch (_context43.prev = _context43.next) {
8738
+ switch (_context45.prev = _context45.next) {
8555
8739
  case 0:
8556
- _context43.next = 2;
8740
+ _context45.next = 2;
8557
8741
  return this.post(this.baseURL + "/messages/".concat(messageId, "/translate"), {
8558
8742
  language: language
8559
8743
  });
8560
8744
 
8561
8745
  case 2:
8562
- return _context43.abrupt("return", _context43.sent);
8746
+ return _context45.abrupt("return", _context45.sent);
8563
8747
 
8564
8748
  case 3:
8565
8749
  case "end":
8566
- return _context43.stop();
8750
+ return _context45.stop();
8567
8751
  }
8568
8752
  }
8569
- }, _callee43, this);
8753
+ }, _callee45, this);
8570
8754
  }));
8571
8755
 
8572
- function translateMessage(_x54, _x55) {
8756
+ function translateMessage(_x56, _x57) {
8573
8757
  return _translateMessage.apply(this, arguments);
8574
8758
  }
8575
8759
 
@@ -8583,7 +8767,7 @@ var StreamChat = /*#__PURE__*/function () {
8583
8767
  }, {
8584
8768
  key: "_normalizeExpiration",
8585
8769
  value: function _normalizeExpiration(timeoutOrExpirationDate) {
8586
- var pinExpires;
8770
+ var pinExpires = null;
8587
8771
 
8588
8772
  if (typeof timeoutOrExpirationDate === 'number') {
8589
8773
  var now = new Date();
@@ -8624,20 +8808,22 @@ var StreamChat = /*#__PURE__*/function () {
8624
8808
  * pinMessage - pins the message
8625
8809
  * @param {string | { id: string }} messageOrMessageId message object or message id
8626
8810
  * @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
8627
- * @param {string | { id: string }} [userId]
8811
+ * @param {undefined|string | { id: string }} [pinnedBy] who will appear as a user who pinned a message. Only for server-side use. Provide `undefined` when pinning message client-side
8812
+ * @param {undefined|number|string|Date} pinnedAt date when message should be pinned. It affects the order of pinned messages. Use negative number to set relative time in the past, string or Date to set exact date of pin
8628
8813
  */
8629
8814
 
8630
8815
  }, {
8631
8816
  key: "pinMessage",
8632
- value: function pinMessage(messageOrMessageId, timeoutOrExpirationDate, userId) {
8817
+ value: function pinMessage(messageOrMessageId, timeoutOrExpirationDate, pinnedBy, pinnedAt) {
8633
8818
  var messageId = this._validateAndGetMessageId(messageOrMessageId, 'Please specify the message id when calling unpinMessage');
8634
8819
 
8635
8820
  return this.partialUpdateMessage(messageId, {
8636
8821
  set: {
8637
8822
  pinned: true,
8638
- pin_expires: this._normalizeExpiration(timeoutOrExpirationDate)
8823
+ pin_expires: this._normalizeExpiration(timeoutOrExpirationDate),
8824
+ pinned_at: this._normalizeExpiration(pinnedAt)
8639
8825
  }
8640
- }, userId);
8826
+ }, pinnedBy);
8641
8827
  }
8642
8828
  /**
8643
8829
  * unpinMessage - unpins the message that was previously pinned
@@ -8669,14 +8855,14 @@ var StreamChat = /*#__PURE__*/function () {
8669
8855
  }, {
8670
8856
  key: "updateMessage",
8671
8857
  value: function () {
8672
- var _updateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44(message, userId, options) {
8858
+ var _updateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46(message, userId, options) {
8673
8859
  var clonedMessage, reservedMessageFields;
8674
- return _regeneratorRuntime.wrap(function _callee44$(_context44) {
8860
+ return _regeneratorRuntime.wrap(function _callee46$(_context46) {
8675
8861
  while (1) {
8676
- switch (_context44.prev = _context44.next) {
8862
+ switch (_context46.prev = _context46.next) {
8677
8863
  case 0:
8678
8864
  if (message.id) {
8679
- _context44.next = 2;
8865
+ _context46.next = 2;
8680
8866
  break;
8681
8867
  }
8682
8868
 
@@ -8713,23 +8899,23 @@ var StreamChat = /*#__PURE__*/function () {
8713
8899
  });
8714
8900
  }
8715
8901
 
8716
- _context44.next = 10;
8902
+ _context46.next = 10;
8717
8903
  return this.post(this.baseURL + "/messages/".concat(message.id), _objectSpread({
8718
8904
  message: clonedMessage
8719
8905
  }, options));
8720
8906
 
8721
8907
  case 10:
8722
- return _context44.abrupt("return", _context44.sent);
8908
+ return _context46.abrupt("return", _context46.sent);
8723
8909
 
8724
8910
  case 11:
8725
8911
  case "end":
8726
- return _context44.stop();
8912
+ return _context46.stop();
8727
8913
  }
8728
8914
  }
8729
- }, _callee44, this);
8915
+ }, _callee46, this);
8730
8916
  }));
8731
8917
 
8732
- function updateMessage(_x56, _x57, _x58) {
8918
+ function updateMessage(_x58, _x59, _x60) {
8733
8919
  return _updateMessage.apply(this, arguments);
8734
8920
  }
8735
8921
 
@@ -8752,14 +8938,14 @@ var StreamChat = /*#__PURE__*/function () {
8752
8938
  }, {
8753
8939
  key: "partialUpdateMessage",
8754
8940
  value: function () {
8755
- var _partialUpdateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45(id, partialMessageObject, userId, options) {
8941
+ var _partialUpdateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee47(id, partialMessageObject, userId, options) {
8756
8942
  var user;
8757
- return _regeneratorRuntime.wrap(function _callee45$(_context45) {
8943
+ return _regeneratorRuntime.wrap(function _callee47$(_context47) {
8758
8944
  while (1) {
8759
- switch (_context45.prev = _context45.next) {
8945
+ switch (_context47.prev = _context47.next) {
8760
8946
  case 0:
8761
8947
  if (id) {
8762
- _context45.next = 2;
8948
+ _context47.next = 2;
8763
8949
  break;
8764
8950
  }
8765
8951
 
@@ -8774,23 +8960,23 @@ var StreamChat = /*#__PURE__*/function () {
8774
8960
  };
8775
8961
  }
8776
8962
 
8777
- _context45.next = 6;
8963
+ _context47.next = 6;
8778
8964
  return this.put(this.baseURL + "/messages/".concat(id), _objectSpread(_objectSpread(_objectSpread({}, partialMessageObject), options), {}, {
8779
8965
  user: user
8780
8966
  }));
8781
8967
 
8782
8968
  case 6:
8783
- return _context45.abrupt("return", _context45.sent);
8969
+ return _context47.abrupt("return", _context47.sent);
8784
8970
 
8785
8971
  case 7:
8786
8972
  case "end":
8787
- return _context45.stop();
8973
+ return _context47.stop();
8788
8974
  }
8789
8975
  }
8790
- }, _callee45, this);
8976
+ }, _callee47, this);
8791
8977
  }));
8792
8978
 
8793
- function partialUpdateMessage(_x59, _x60, _x61, _x62) {
8979
+ function partialUpdateMessage(_x61, _x62, _x63, _x64) {
8794
8980
  return _partialUpdateMessage.apply(this, arguments);
8795
8981
  }
8796
8982
 
@@ -8799,11 +8985,11 @@ var StreamChat = /*#__PURE__*/function () {
8799
8985
  }, {
8800
8986
  key: "deleteMessage",
8801
8987
  value: function () {
8802
- var _deleteMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46(messageID, hardDelete) {
8988
+ var _deleteMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee48(messageID, hardDelete) {
8803
8989
  var params;
8804
- return _regeneratorRuntime.wrap(function _callee46$(_context46) {
8990
+ return _regeneratorRuntime.wrap(function _callee48$(_context48) {
8805
8991
  while (1) {
8806
- switch (_context46.prev = _context46.next) {
8992
+ switch (_context48.prev = _context48.next) {
8807
8993
  case 0:
8808
8994
  params = {};
8809
8995
 
@@ -8813,21 +8999,21 @@ var StreamChat = /*#__PURE__*/function () {
8813
8999
  };
8814
9000
  }
8815
9001
 
8816
- _context46.next = 4;
9002
+ _context48.next = 4;
8817
9003
  return this.delete(this.baseURL + "/messages/".concat(messageID), params);
8818
9004
 
8819
9005
  case 4:
8820
- return _context46.abrupt("return", _context46.sent);
9006
+ return _context48.abrupt("return", _context48.sent);
8821
9007
 
8822
9008
  case 5:
8823
9009
  case "end":
8824
- return _context46.stop();
9010
+ return _context48.stop();
8825
9011
  }
8826
9012
  }
8827
- }, _callee46, this);
9013
+ }, _callee48, this);
8828
9014
  }));
8829
9015
 
8830
- function deleteMessage(_x63, _x64) {
9016
+ function deleteMessage(_x65, _x66) {
8831
9017
  return _deleteMessage.apply(this, arguments);
8832
9018
  }
8833
9019
 
@@ -8836,26 +9022,26 @@ var StreamChat = /*#__PURE__*/function () {
8836
9022
  }, {
8837
9023
  key: "getMessage",
8838
9024
  value: function () {
8839
- var _getMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee47(messageID) {
8840
- return _regeneratorRuntime.wrap(function _callee47$(_context47) {
9025
+ var _getMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49(messageID) {
9026
+ return _regeneratorRuntime.wrap(function _callee49$(_context49) {
8841
9027
  while (1) {
8842
- switch (_context47.prev = _context47.next) {
9028
+ switch (_context49.prev = _context49.next) {
8843
9029
  case 0:
8844
- _context47.next = 2;
9030
+ _context49.next = 2;
8845
9031
  return this.get(this.baseURL + "/messages/".concat(messageID));
8846
9032
 
8847
9033
  case 2:
8848
- return _context47.abrupt("return", _context47.sent);
9034
+ return _context49.abrupt("return", _context49.sent);
8849
9035
 
8850
9036
  case 3:
8851
9037
  case "end":
8852
- return _context47.stop();
9038
+ return _context49.stop();
8853
9039
  }
8854
9040
  }
8855
- }, _callee47, this);
9041
+ }, _callee49, this);
8856
9042
  }));
8857
9043
 
8858
- function getMessage(_x65) {
9044
+ function getMessage(_x67) {
8859
9045
  return _getMessage.apply(this, arguments);
8860
9046
  }
8861
9047
 
@@ -8864,7 +9050,7 @@ var StreamChat = /*#__PURE__*/function () {
8864
9050
  }, {
8865
9051
  key: "getUserAgent",
8866
9052
  value: function getUserAgent() {
8867
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "5.0.0");
9053
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "5.1.2");
8868
9054
  }
8869
9055
  }, {
8870
9056
  key: "setUserAgent",
@@ -8899,12 +9085,11 @@ var StreamChat = /*#__PURE__*/function () {
8899
9085
  }
8900
9086
 
8901
9087
  return _objectSpread({
8902
- params: _objectSpread(_objectSpread({
8903
- user_id: this.userID
8904
- }, options.params), {}, {
8905
- api_key: this.key,
8906
- connection_id: this._getConnectionID()
8907
- }),
9088
+ params: _objectSpread({
9089
+ user_id: this.userID,
9090
+ connection_id: this._getConnectionID(),
9091
+ api_key: this.key
9092
+ }, options.params),
8908
9093
  headers: _objectSpread(_objectSpread({}, authorization), {}, {
8909
9094
  'stream-auth-type': this.getAuthType(),
8910
9095
  'X-Stream-Client': this.getUserAgent()
@@ -9060,28 +9245,28 @@ var StreamChat = /*#__PURE__*/function () {
9060
9245
  }, {
9061
9246
  key: "sendUserCustomEvent",
9062
9247
  value: function () {
9063
- var _sendUserCustomEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee48(targetUserID, event) {
9064
- return _regeneratorRuntime.wrap(function _callee48$(_context48) {
9248
+ var _sendUserCustomEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee50(targetUserID, event) {
9249
+ return _regeneratorRuntime.wrap(function _callee50$(_context50) {
9065
9250
  while (1) {
9066
- switch (_context48.prev = _context48.next) {
9251
+ switch (_context50.prev = _context50.next) {
9067
9252
  case 0:
9068
- _context48.next = 2;
9253
+ _context50.next = 2;
9069
9254
  return this.post("".concat(this.baseURL, "/users/").concat(targetUserID, "/event"), {
9070
9255
  event: event
9071
9256
  });
9072
9257
 
9073
9258
  case 2:
9074
- return _context48.abrupt("return", _context48.sent);
9259
+ return _context50.abrupt("return", _context50.sent);
9075
9260
 
9076
9261
  case 3:
9077
9262
  case "end":
9078
- return _context48.stop();
9263
+ return _context50.stop();
9079
9264
  }
9080
9265
  }
9081
- }, _callee48, this);
9266
+ }, _callee50, this);
9082
9267
  }));
9083
9268
 
9084
- function sendUserCustomEvent(_x66, _x67) {
9269
+ function sendUserCustomEvent(_x68, _x69) {
9085
9270
  return _sendUserCustomEvent.apply(this, arguments);
9086
9271
  }
9087
9272
 
@@ -9144,32 +9329,32 @@ var StreamChat = /*#__PURE__*/function () {
9144
9329
  }, {
9145
9330
  key: "createSegment",
9146
9331
  value: function () {
9147
- var _createSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49(params) {
9332
+ var _createSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee51(params) {
9148
9333
  var _yield$this$post, segment;
9149
9334
 
9150
- return _regeneratorRuntime.wrap(function _callee49$(_context49) {
9335
+ return _regeneratorRuntime.wrap(function _callee51$(_context51) {
9151
9336
  while (1) {
9152
- switch (_context49.prev = _context49.next) {
9337
+ switch (_context51.prev = _context51.next) {
9153
9338
  case 0:
9154
- _context49.next = 2;
9339
+ _context51.next = 2;
9155
9340
  return this.post(this.baseURL + "/segments", {
9156
9341
  segment: params
9157
9342
  });
9158
9343
 
9159
9344
  case 2:
9160
- _yield$this$post = _context49.sent;
9345
+ _yield$this$post = _context51.sent;
9161
9346
  segment = _yield$this$post.segment;
9162
- return _context49.abrupt("return", segment);
9347
+ return _context51.abrupt("return", segment);
9163
9348
 
9164
9349
  case 5:
9165
9350
  case "end":
9166
- return _context49.stop();
9351
+ return _context51.stop();
9167
9352
  }
9168
9353
  }
9169
- }, _callee49, this);
9354
+ }, _callee51, this);
9170
9355
  }));
9171
9356
 
9172
- function createSegment(_x68) {
9357
+ function createSegment(_x70) {
9173
9358
  return _createSegment.apply(this, arguments);
9174
9359
  }
9175
9360
 
@@ -9186,30 +9371,30 @@ var StreamChat = /*#__PURE__*/function () {
9186
9371
  }, {
9187
9372
  key: "getSegment",
9188
9373
  value: function () {
9189
- var _getSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee50(id) {
9374
+ var _getSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee52(id) {
9190
9375
  var _yield$this$get, segment;
9191
9376
 
9192
- return _regeneratorRuntime.wrap(function _callee50$(_context50) {
9377
+ return _regeneratorRuntime.wrap(function _callee52$(_context52) {
9193
9378
  while (1) {
9194
- switch (_context50.prev = _context50.next) {
9379
+ switch (_context52.prev = _context52.next) {
9195
9380
  case 0:
9196
- _context50.next = 2;
9381
+ _context52.next = 2;
9197
9382
  return this.get(this.baseURL + "/segments/".concat(id));
9198
9383
 
9199
9384
  case 2:
9200
- _yield$this$get = _context50.sent;
9385
+ _yield$this$get = _context52.sent;
9201
9386
  segment = _yield$this$get.segment;
9202
- return _context50.abrupt("return", segment);
9387
+ return _context52.abrupt("return", segment);
9203
9388
 
9204
9389
  case 5:
9205
9390
  case "end":
9206
- return _context50.stop();
9391
+ return _context52.stop();
9207
9392
  }
9208
9393
  }
9209
- }, _callee50, this);
9394
+ }, _callee52, this);
9210
9395
  }));
9211
9396
 
9212
- function getSegment(_x69) {
9397
+ function getSegment(_x71) {
9213
9398
  return _getSegment.apply(this, arguments);
9214
9399
  }
9215
9400
 
@@ -9225,30 +9410,30 @@ var StreamChat = /*#__PURE__*/function () {
9225
9410
  }, {
9226
9411
  key: "listSegments",
9227
9412
  value: function () {
9228
- var _listSegments = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee51(options) {
9413
+ var _listSegments = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee53(options) {
9229
9414
  var _yield$this$get2, segments;
9230
9415
 
9231
- return _regeneratorRuntime.wrap(function _callee51$(_context51) {
9416
+ return _regeneratorRuntime.wrap(function _callee53$(_context53) {
9232
9417
  while (1) {
9233
- switch (_context51.prev = _context51.next) {
9418
+ switch (_context53.prev = _context53.next) {
9234
9419
  case 0:
9235
- _context51.next = 2;
9420
+ _context53.next = 2;
9236
9421
  return this.get(this.baseURL + "/segments", options);
9237
9422
 
9238
9423
  case 2:
9239
- _yield$this$get2 = _context51.sent;
9424
+ _yield$this$get2 = _context53.sent;
9240
9425
  segments = _yield$this$get2.segments;
9241
- return _context51.abrupt("return", segments);
9426
+ return _context53.abrupt("return", segments);
9242
9427
 
9243
9428
  case 5:
9244
9429
  case "end":
9245
- return _context51.stop();
9430
+ return _context53.stop();
9246
9431
  }
9247
9432
  }
9248
- }, _callee51, this);
9433
+ }, _callee53, this);
9249
9434
  }));
9250
9435
 
9251
- function listSegments(_x70) {
9436
+ function listSegments(_x72) {
9252
9437
  return _listSegments.apply(this, arguments);
9253
9438
  }
9254
9439
 
@@ -9266,32 +9451,32 @@ var StreamChat = /*#__PURE__*/function () {
9266
9451
  }, {
9267
9452
  key: "updateSegment",
9268
9453
  value: function () {
9269
- var _updateSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee52(id, params) {
9454
+ var _updateSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee54(id, params) {
9270
9455
  var _yield$this$put, segment;
9271
9456
 
9272
- return _regeneratorRuntime.wrap(function _callee52$(_context52) {
9457
+ return _regeneratorRuntime.wrap(function _callee54$(_context54) {
9273
9458
  while (1) {
9274
- switch (_context52.prev = _context52.next) {
9459
+ switch (_context54.prev = _context54.next) {
9275
9460
  case 0:
9276
- _context52.next = 2;
9461
+ _context54.next = 2;
9277
9462
  return this.put(this.baseURL + "/segments/".concat(id), {
9278
9463
  segment: params
9279
9464
  });
9280
9465
 
9281
9466
  case 2:
9282
- _yield$this$put = _context52.sent;
9467
+ _yield$this$put = _context54.sent;
9283
9468
  segment = _yield$this$put.segment;
9284
- return _context52.abrupt("return", segment);
9469
+ return _context54.abrupt("return", segment);
9285
9470
 
9286
9471
  case 5:
9287
9472
  case "end":
9288
- return _context52.stop();
9473
+ return _context54.stop();
9289
9474
  }
9290
9475
  }
9291
- }, _callee52, this);
9476
+ }, _callee54, this);
9292
9477
  }));
9293
9478
 
9294
- function updateSegment(_x71, _x72) {
9479
+ function updateSegment(_x73, _x74) {
9295
9480
  return _updateSegment.apply(this, arguments);
9296
9481
  }
9297
9482
 
@@ -9308,22 +9493,22 @@ var StreamChat = /*#__PURE__*/function () {
9308
9493
  }, {
9309
9494
  key: "deleteSegment",
9310
9495
  value: function () {
9311
- var _deleteSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee53(id) {
9312
- return _regeneratorRuntime.wrap(function _callee53$(_context53) {
9496
+ var _deleteSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee55(id) {
9497
+ return _regeneratorRuntime.wrap(function _callee55$(_context55) {
9313
9498
  while (1) {
9314
- switch (_context53.prev = _context53.next) {
9499
+ switch (_context55.prev = _context55.next) {
9315
9500
  case 0:
9316
- return _context53.abrupt("return", this.delete(this.baseURL + "/segments/".concat(id)));
9501
+ return _context55.abrupt("return", this.delete(this.baseURL + "/segments/".concat(id)));
9317
9502
 
9318
9503
  case 1:
9319
9504
  case "end":
9320
- return _context53.stop();
9505
+ return _context55.stop();
9321
9506
  }
9322
9507
  }
9323
- }, _callee53, this);
9508
+ }, _callee55, this);
9324
9509
  }));
9325
9510
 
9326
- function deleteSegment(_x73) {
9511
+ function deleteSegment(_x75) {
9327
9512
  return _deleteSegment.apply(this, arguments);
9328
9513
  }
9329
9514
 
@@ -9340,32 +9525,32 @@ var StreamChat = /*#__PURE__*/function () {
9340
9525
  }, {
9341
9526
  key: "createCampaign",
9342
9527
  value: function () {
9343
- var _createCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee54(params) {
9528
+ var _createCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee56(params) {
9344
9529
  var _yield$this$post2, campaign;
9345
9530
 
9346
- return _regeneratorRuntime.wrap(function _callee54$(_context54) {
9531
+ return _regeneratorRuntime.wrap(function _callee56$(_context56) {
9347
9532
  while (1) {
9348
- switch (_context54.prev = _context54.next) {
9533
+ switch (_context56.prev = _context56.next) {
9349
9534
  case 0:
9350
- _context54.next = 2;
9535
+ _context56.next = 2;
9351
9536
  return this.post(this.baseURL + "/campaigns", {
9352
9537
  campaign: params
9353
9538
  });
9354
9539
 
9355
9540
  case 2:
9356
- _yield$this$post2 = _context54.sent;
9541
+ _yield$this$post2 = _context56.sent;
9357
9542
  campaign = _yield$this$post2.campaign;
9358
- return _context54.abrupt("return", campaign);
9543
+ return _context56.abrupt("return", campaign);
9359
9544
 
9360
9545
  case 5:
9361
9546
  case "end":
9362
- return _context54.stop();
9547
+ return _context56.stop();
9363
9548
  }
9364
9549
  }
9365
- }, _callee54, this);
9550
+ }, _callee56, this);
9366
9551
  }));
9367
9552
 
9368
- function createCampaign(_x74) {
9553
+ function createCampaign(_x76) {
9369
9554
  return _createCampaign.apply(this, arguments);
9370
9555
  }
9371
9556
 
@@ -9382,30 +9567,30 @@ var StreamChat = /*#__PURE__*/function () {
9382
9567
  }, {
9383
9568
  key: "getCampaign",
9384
9569
  value: function () {
9385
- var _getCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee55(id) {
9570
+ var _getCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee57(id) {
9386
9571
  var _yield$this$get3, campaign;
9387
9572
 
9388
- return _regeneratorRuntime.wrap(function _callee55$(_context55) {
9573
+ return _regeneratorRuntime.wrap(function _callee57$(_context57) {
9389
9574
  while (1) {
9390
- switch (_context55.prev = _context55.next) {
9575
+ switch (_context57.prev = _context57.next) {
9391
9576
  case 0:
9392
- _context55.next = 2;
9577
+ _context57.next = 2;
9393
9578
  return this.get(this.baseURL + "/campaigns/".concat(id));
9394
9579
 
9395
9580
  case 2:
9396
- _yield$this$get3 = _context55.sent;
9581
+ _yield$this$get3 = _context57.sent;
9397
9582
  campaign = _yield$this$get3.campaign;
9398
- return _context55.abrupt("return", campaign);
9583
+ return _context57.abrupt("return", campaign);
9399
9584
 
9400
9585
  case 5:
9401
9586
  case "end":
9402
- return _context55.stop();
9587
+ return _context57.stop();
9403
9588
  }
9404
9589
  }
9405
- }, _callee55, this);
9590
+ }, _callee57, this);
9406
9591
  }));
9407
9592
 
9408
- function getCampaign(_x75) {
9593
+ function getCampaign(_x77) {
9409
9594
  return _getCampaign.apply(this, arguments);
9410
9595
  }
9411
9596
 
@@ -9421,30 +9606,30 @@ var StreamChat = /*#__PURE__*/function () {
9421
9606
  }, {
9422
9607
  key: "listCampaigns",
9423
9608
  value: function () {
9424
- var _listCampaigns = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee56(options) {
9609
+ var _listCampaigns = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee58(options) {
9425
9610
  var _yield$this$get4, campaigns;
9426
9611
 
9427
- return _regeneratorRuntime.wrap(function _callee56$(_context56) {
9612
+ return _regeneratorRuntime.wrap(function _callee58$(_context58) {
9428
9613
  while (1) {
9429
- switch (_context56.prev = _context56.next) {
9614
+ switch (_context58.prev = _context58.next) {
9430
9615
  case 0:
9431
- _context56.next = 2;
9616
+ _context58.next = 2;
9432
9617
  return this.get(this.baseURL + "/campaigns", options);
9433
9618
 
9434
9619
  case 2:
9435
- _yield$this$get4 = _context56.sent;
9620
+ _yield$this$get4 = _context58.sent;
9436
9621
  campaigns = _yield$this$get4.campaigns;
9437
- return _context56.abrupt("return", campaigns);
9622
+ return _context58.abrupt("return", campaigns);
9438
9623
 
9439
9624
  case 5:
9440
9625
  case "end":
9441
- return _context56.stop();
9626
+ return _context58.stop();
9442
9627
  }
9443
9628
  }
9444
- }, _callee56, this);
9629
+ }, _callee58, this);
9445
9630
  }));
9446
9631
 
9447
- function listCampaigns(_x76) {
9632
+ function listCampaigns(_x78) {
9448
9633
  return _listCampaigns.apply(this, arguments);
9449
9634
  }
9450
9635
 
@@ -9462,32 +9647,32 @@ var StreamChat = /*#__PURE__*/function () {
9462
9647
  }, {
9463
9648
  key: "updateCampaign",
9464
9649
  value: function () {
9465
- var _updateCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee57(id, params) {
9650
+ var _updateCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee59(id, params) {
9466
9651
  var _yield$this$put2, campaign;
9467
9652
 
9468
- return _regeneratorRuntime.wrap(function _callee57$(_context57) {
9653
+ return _regeneratorRuntime.wrap(function _callee59$(_context59) {
9469
9654
  while (1) {
9470
- switch (_context57.prev = _context57.next) {
9655
+ switch (_context59.prev = _context59.next) {
9471
9656
  case 0:
9472
- _context57.next = 2;
9657
+ _context59.next = 2;
9473
9658
  return this.put(this.baseURL + "/campaigns/".concat(id), {
9474
9659
  campaign: params
9475
9660
  });
9476
9661
 
9477
9662
  case 2:
9478
- _yield$this$put2 = _context57.sent;
9663
+ _yield$this$put2 = _context59.sent;
9479
9664
  campaign = _yield$this$put2.campaign;
9480
- return _context57.abrupt("return", campaign);
9665
+ return _context59.abrupt("return", campaign);
9481
9666
 
9482
9667
  case 5:
9483
9668
  case "end":
9484
- return _context57.stop();
9669
+ return _context59.stop();
9485
9670
  }
9486
9671
  }
9487
- }, _callee57, this);
9672
+ }, _callee59, this);
9488
9673
  }));
9489
9674
 
9490
- function updateCampaign(_x77, _x78) {
9675
+ function updateCampaign(_x79, _x80) {
9491
9676
  return _updateCampaign.apply(this, arguments);
9492
9677
  }
9493
9678
 
@@ -9504,22 +9689,22 @@ var StreamChat = /*#__PURE__*/function () {
9504
9689
  }, {
9505
9690
  key: "deleteCampaign",
9506
9691
  value: function () {
9507
- var _deleteCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee58(id) {
9508
- return _regeneratorRuntime.wrap(function _callee58$(_context58) {
9692
+ var _deleteCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee60(id) {
9693
+ return _regeneratorRuntime.wrap(function _callee60$(_context60) {
9509
9694
  while (1) {
9510
- switch (_context58.prev = _context58.next) {
9695
+ switch (_context60.prev = _context60.next) {
9511
9696
  case 0:
9512
- return _context58.abrupt("return", this.delete(this.baseURL + "/campaigns/".concat(id)));
9697
+ return _context60.abrupt("return", this.delete(this.baseURL + "/campaigns/".concat(id)));
9513
9698
 
9514
9699
  case 1:
9515
9700
  case "end":
9516
- return _context58.stop();
9701
+ return _context60.stop();
9517
9702
  }
9518
9703
  }
9519
- }, _callee58, this);
9704
+ }, _callee60, this);
9520
9705
  }));
9521
9706
 
9522
- function deleteCampaign(_x79) {
9707
+ function deleteCampaign(_x81) {
9523
9708
  return _deleteCampaign.apply(this, arguments);
9524
9709
  }
9525
9710
 
@@ -9537,33 +9722,33 @@ var StreamChat = /*#__PURE__*/function () {
9537
9722
  }, {
9538
9723
  key: "scheduleCampaign",
9539
9724
  value: function () {
9540
- var _scheduleCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee59(id, params) {
9725
+ var _scheduleCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee61(id, params) {
9541
9726
  var sendAt, _yield$this$patch, campaign;
9542
9727
 
9543
- return _regeneratorRuntime.wrap(function _callee59$(_context59) {
9728
+ return _regeneratorRuntime.wrap(function _callee61$(_context61) {
9544
9729
  while (1) {
9545
- switch (_context59.prev = _context59.next) {
9730
+ switch (_context61.prev = _context61.next) {
9546
9731
  case 0:
9547
9732
  sendAt = params.sendAt;
9548
- _context59.next = 3;
9733
+ _context61.next = 3;
9549
9734
  return this.patch(this.baseURL + "/campaigns/".concat(id, "/schedule"), {
9550
9735
  send_at: sendAt
9551
9736
  });
9552
9737
 
9553
9738
  case 3:
9554
- _yield$this$patch = _context59.sent;
9739
+ _yield$this$patch = _context61.sent;
9555
9740
  campaign = _yield$this$patch.campaign;
9556
- return _context59.abrupt("return", campaign);
9741
+ return _context61.abrupt("return", campaign);
9557
9742
 
9558
9743
  case 6:
9559
9744
  case "end":
9560
- return _context59.stop();
9745
+ return _context61.stop();
9561
9746
  }
9562
9747
  }
9563
- }, _callee59, this);
9748
+ }, _callee61, this);
9564
9749
  }));
9565
9750
 
9566
- function scheduleCampaign(_x80, _x81) {
9751
+ function scheduleCampaign(_x82, _x83) {
9567
9752
  return _scheduleCampaign.apply(this, arguments);
9568
9753
  }
9569
9754
 
@@ -9580,30 +9765,30 @@ var StreamChat = /*#__PURE__*/function () {
9580
9765
  }, {
9581
9766
  key: "stopCampaign",
9582
9767
  value: function () {
9583
- var _stopCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee60(id) {
9768
+ var _stopCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee62(id) {
9584
9769
  var _yield$this$patch2, campaign;
9585
9770
 
9586
- return _regeneratorRuntime.wrap(function _callee60$(_context60) {
9771
+ return _regeneratorRuntime.wrap(function _callee62$(_context62) {
9587
9772
  while (1) {
9588
- switch (_context60.prev = _context60.next) {
9773
+ switch (_context62.prev = _context62.next) {
9589
9774
  case 0:
9590
- _context60.next = 2;
9775
+ _context62.next = 2;
9591
9776
  return this.patch(this.baseURL + "/campaigns/".concat(id, "/stop"));
9592
9777
 
9593
9778
  case 2:
9594
- _yield$this$patch2 = _context60.sent;
9779
+ _yield$this$patch2 = _context62.sent;
9595
9780
  campaign = _yield$this$patch2.campaign;
9596
- return _context60.abrupt("return", campaign);
9781
+ return _context62.abrupt("return", campaign);
9597
9782
 
9598
9783
  case 5:
9599
9784
  case "end":
9600
- return _context60.stop();
9785
+ return _context62.stop();
9601
9786
  }
9602
9787
  }
9603
- }, _callee60, this);
9788
+ }, _callee62, this);
9604
9789
  }));
9605
9790
 
9606
- function stopCampaign(_x82) {
9791
+ function stopCampaign(_x84) {
9607
9792
  return _stopCampaign.apply(this, arguments);
9608
9793
  }
9609
9794
 
@@ -9620,30 +9805,30 @@ var StreamChat = /*#__PURE__*/function () {
9620
9805
  }, {
9621
9806
  key: "resumeCampaign",
9622
9807
  value: function () {
9623
- var _resumeCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee61(id) {
9808
+ var _resumeCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee63(id) {
9624
9809
  var _yield$this$patch3, campaign;
9625
9810
 
9626
- return _regeneratorRuntime.wrap(function _callee61$(_context61) {
9811
+ return _regeneratorRuntime.wrap(function _callee63$(_context63) {
9627
9812
  while (1) {
9628
- switch (_context61.prev = _context61.next) {
9813
+ switch (_context63.prev = _context63.next) {
9629
9814
  case 0:
9630
- _context61.next = 2;
9815
+ _context63.next = 2;
9631
9816
  return this.patch(this.baseURL + "/campaigns/".concat(id, "/resume"));
9632
9817
 
9633
9818
  case 2:
9634
- _yield$this$patch3 = _context61.sent;
9819
+ _yield$this$patch3 = _context63.sent;
9635
9820
  campaign = _yield$this$patch3.campaign;
9636
- return _context61.abrupt("return", campaign);
9821
+ return _context63.abrupt("return", campaign);
9637
9822
 
9638
9823
  case 5:
9639
9824
  case "end":
9640
- return _context61.stop();
9825
+ return _context63.stop();
9641
9826
  }
9642
9827
  }
9643
- }, _callee61, this);
9828
+ }, _callee63, this);
9644
9829
  }));
9645
9830
 
9646
- function resumeCampaign(_x83) {
9831
+ function resumeCampaign(_x85) {
9647
9832
  return _resumeCampaign.apply(this, arguments);
9648
9833
  }
9649
9834
 
@@ -9660,33 +9845,33 @@ var StreamChat = /*#__PURE__*/function () {
9660
9845
  }, {
9661
9846
  key: "testCampaign",
9662
9847
  value: function () {
9663
- var _testCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee62(id, params) {
9848
+ var _testCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee64(id, params) {
9664
9849
  var users, _yield$this$post3, campaign;
9665
9850
 
9666
- return _regeneratorRuntime.wrap(function _callee62$(_context62) {
9851
+ return _regeneratorRuntime.wrap(function _callee64$(_context64) {
9667
9852
  while (1) {
9668
- switch (_context62.prev = _context62.next) {
9853
+ switch (_context64.prev = _context64.next) {
9669
9854
  case 0:
9670
9855
  users = params.users;
9671
- _context62.next = 3;
9856
+ _context64.next = 3;
9672
9857
  return this.post(this.baseURL + "/campaigns/".concat(id, "/test"), {
9673
9858
  users: users
9674
9859
  });
9675
9860
 
9676
9861
  case 3:
9677
- _yield$this$post3 = _context62.sent;
9862
+ _yield$this$post3 = _context64.sent;
9678
9863
  campaign = _yield$this$post3.campaign;
9679
- return _context62.abrupt("return", campaign);
9864
+ return _context64.abrupt("return", campaign);
9680
9865
 
9681
9866
  case 6:
9682
9867
  case "end":
9683
- return _context62.stop();
9868
+ return _context64.stop();
9684
9869
  }
9685
9870
  }
9686
- }, _callee62, this);
9871
+ }, _callee64, this);
9687
9872
  }));
9688
9873
 
9689
- function testCampaign(_x84, _x85) {
9874
+ function testCampaign(_x86, _x87) {
9690
9875
  return _testCampaign.apply(this, arguments);
9691
9876
  }
9692
9877
 
@@ -9702,24 +9887,24 @@ var StreamChat = /*#__PURE__*/function () {
9702
9887
  }, {
9703
9888
  key: "enrichURL",
9704
9889
  value: function () {
9705
- var _enrichURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee63(url) {
9706
- return _regeneratorRuntime.wrap(function _callee63$(_context63) {
9890
+ var _enrichURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee65(url) {
9891
+ return _regeneratorRuntime.wrap(function _callee65$(_context65) {
9707
9892
  while (1) {
9708
- switch (_context63.prev = _context63.next) {
9893
+ switch (_context65.prev = _context65.next) {
9709
9894
  case 0:
9710
- return _context63.abrupt("return", this.get(this.baseURL + "/og", {
9895
+ return _context65.abrupt("return", this.get(this.baseURL + "/og", {
9711
9896
  url: url
9712
9897
  }));
9713
9898
 
9714
9899
  case 1:
9715
9900
  case "end":
9716
- return _context63.stop();
9901
+ return _context65.stop();
9717
9902
  }
9718
9903
  }
9719
- }, _callee63, this);
9904
+ }, _callee65, this);
9720
9905
  }));
9721
9906
 
9722
- function enrichURL(_x86) {
9907
+ function enrichURL(_x88) {
9723
9908
  return _enrichURL.apply(this, arguments);
9724
9909
  }
9725
9910
 
@@ -9736,22 +9921,22 @@ var StreamChat = /*#__PURE__*/function () {
9736
9921
  }, {
9737
9922
  key: "getTask",
9738
9923
  value: function () {
9739
- var _getTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee64(id) {
9740
- return _regeneratorRuntime.wrap(function _callee64$(_context64) {
9924
+ var _getTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee66(id) {
9925
+ return _regeneratorRuntime.wrap(function _callee66$(_context66) {
9741
9926
  while (1) {
9742
- switch (_context64.prev = _context64.next) {
9927
+ switch (_context66.prev = _context66.next) {
9743
9928
  case 0:
9744
- return _context64.abrupt("return", this.get("".concat(this.baseURL, "/tasks/").concat(id)));
9929
+ return _context66.abrupt("return", this.get("".concat(this.baseURL, "/tasks/").concat(id)));
9745
9930
 
9746
9931
  case 1:
9747
9932
  case "end":
9748
- return _context64.stop();
9933
+ return _context66.stop();
9749
9934
  }
9750
9935
  }
9751
- }, _callee64, this);
9936
+ }, _callee66, this);
9752
9937
  }));
9753
9938
 
9754
- function getTask(_x87) {
9939
+ function getTask(_x89) {
9755
9940
  return _getTask.apply(this, arguments);
9756
9941
  }
9757
9942
 
@@ -9769,31 +9954,31 @@ var StreamChat = /*#__PURE__*/function () {
9769
9954
  }, {
9770
9955
  key: "deleteChannels",
9771
9956
  value: function () {
9772
- var _deleteChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee65(cids) {
9957
+ var _deleteChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee67(cids) {
9773
9958
  var options,
9774
- _args65 = arguments;
9775
- return _regeneratorRuntime.wrap(function _callee65$(_context65) {
9959
+ _args67 = arguments;
9960
+ return _regeneratorRuntime.wrap(function _callee67$(_context67) {
9776
9961
  while (1) {
9777
- switch (_context65.prev = _context65.next) {
9962
+ switch (_context67.prev = _context67.next) {
9778
9963
  case 0:
9779
- options = _args65.length > 1 && _args65[1] !== undefined ? _args65[1] : {};
9780
- _context65.next = 3;
9964
+ options = _args67.length > 1 && _args67[1] !== undefined ? _args67[1] : {};
9965
+ _context67.next = 3;
9781
9966
  return this.post(this.baseURL + "/channels/delete", _objectSpread({
9782
9967
  cids: cids
9783
9968
  }, options));
9784
9969
 
9785
9970
  case 3:
9786
- return _context65.abrupt("return", _context65.sent);
9971
+ return _context67.abrupt("return", _context67.sent);
9787
9972
 
9788
9973
  case 4:
9789
9974
  case "end":
9790
- return _context65.stop();
9975
+ return _context67.stop();
9791
9976
  }
9792
9977
  }
9793
- }, _callee65, this);
9978
+ }, _callee67, this);
9794
9979
  }));
9795
9980
 
9796
- function deleteChannels(_x88) {
9981
+ function deleteChannels(_x90) {
9797
9982
  return _deleteChannels.apply(this, arguments);
9798
9983
  }
9799
9984
 
@@ -9811,13 +9996,13 @@ var StreamChat = /*#__PURE__*/function () {
9811
9996
  }, {
9812
9997
  key: "deleteUsers",
9813
9998
  value: function () {
9814
- var _deleteUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee66(user_ids, options) {
9815
- return _regeneratorRuntime.wrap(function _callee66$(_context66) {
9999
+ var _deleteUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee68(user_ids, options) {
10000
+ return _regeneratorRuntime.wrap(function _callee68$(_context68) {
9816
10001
  while (1) {
9817
- switch (_context66.prev = _context66.next) {
10002
+ switch (_context68.prev = _context68.next) {
9818
10003
  case 0:
9819
10004
  if (!((options === null || options === void 0 ? void 0 : options.user) !== 'soft' && (options === null || options === void 0 ? void 0 : options.user) !== 'hard')) {
9820
- _context66.next = 2;
10005
+ _context68.next = 2;
9821
10006
  break;
9822
10007
  }
9823
10008
 
@@ -9825,7 +10010,7 @@ var StreamChat = /*#__PURE__*/function () {
9825
10010
 
9826
10011
  case 2:
9827
10012
  if (!(options.messages !== undefined && options.messages !== 'soft' && options.messages !== 'hard')) {
9828
- _context66.next = 4;
10013
+ _context68.next = 4;
9829
10014
  break;
9830
10015
  }
9831
10016
 
@@ -9833,30 +10018,30 @@ var StreamChat = /*#__PURE__*/function () {
9833
10018
 
9834
10019
  case 4:
9835
10020
  if (!(options.conversations !== undefined && options.conversations !== 'soft' && options.conversations !== 'hard')) {
9836
- _context66.next = 6;
10021
+ _context68.next = 6;
9837
10022
  break;
9838
10023
  }
9839
10024
 
9840
10025
  throw new Error('Invalid delete user options. conversations must be one of [soft hard]');
9841
10026
 
9842
10027
  case 6:
9843
- _context66.next = 8;
10028
+ _context68.next = 8;
9844
10029
  return this.post(this.baseURL + "/users/delete", _objectSpread({
9845
10030
  user_ids: user_ids
9846
10031
  }, options));
9847
10032
 
9848
10033
  case 8:
9849
- return _context66.abrupt("return", _context66.sent);
10034
+ return _context68.abrupt("return", _context68.sent);
9850
10035
 
9851
10036
  case 9:
9852
10037
  case "end":
9853
- return _context66.stop();
10038
+ return _context68.stop();
9854
10039
  }
9855
10040
  }
9856
- }, _callee66, this);
10041
+ }, _callee68, this);
9857
10042
  }));
9858
10043
 
9859
- function deleteUsers(_x89, _x90) {
10044
+ function deleteUsers(_x91, _x92) {
9860
10045
  return _deleteUsers.apply(this, arguments);
9861
10046
  }
9862
10047