stream-chat 4.5.0-beta.0 → 5.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -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
 
@@ -701,7 +701,7 @@ var ChannelState = /*#__PURE__*/function () {
701
701
  return ChannelState;
702
702
  }();
703
703
 
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; }
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; }
705
705
 
706
706
  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
707
 
@@ -758,7 +758,7 @@ var isValidEventType = function isValidEventType(eventType) {
758
758
  return IS_VALID_EVENT_MAP_TYPE[eventType] || false;
759
759
  };
760
760
 
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; } } }; }
761
+ 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
762
 
763
763
  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
764
 
@@ -948,13 +948,23 @@ function convertErrorToJson(err) {
948
948
  return jsonObj;
949
949
  }
950
950
  /**
951
- * isOnline safely return the navigator.online value
951
+ * isOnline safely return the navigator.online value for browser env
952
952
  * if navigator is not in global object, it always return true
953
953
  */
954
954
 
955
955
  function isOnline() {
956
956
  var nav = typeof navigator !== 'undefined' ? navigator : typeof window !== 'undefined' && window.navigator ? window.navigator : undefined;
957
- if (!nav) return true;
957
+
958
+ if (!nav) {
959
+ console.warn('isOnline failed to access window.navigator and assume browser is online');
960
+ return true;
961
+ } // RN navigator has undefined for onLine
962
+
963
+
964
+ if (typeof nav.onLine !== 'boolean') {
965
+ return true;
966
+ }
967
+
958
968
  return nav.onLine;
959
969
  }
960
970
  /**
@@ -974,13 +984,13 @@ function removeConnectionEventListeners(cb) {
974
984
  }
975
985
  }
976
986
 
977
- 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; } } }; }
987
+ 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; } } }; }
978
988
 
979
989
  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); }
980
990
 
981
991
  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; }
982
992
 
983
- 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; }
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; }
984
994
 
985
995
  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; }
986
996
 
@@ -2565,6 +2575,50 @@ var Channel = /*#__PURE__*/function () {
2565
2575
 
2566
2576
  return getReplies;
2567
2577
  }()
2578
+ /**
2579
+ * getPinnedMessages - List list pinned messages of the channel
2580
+ *
2581
+ * @param {PinnedMessagePaginationOptions & { user?: UserResponse<UserType>; user_id?: string }} options Pagination params, ie {limit:10, id_lte: 10}
2582
+ * @param {PinnedMessagesSort} sort defines sorting direction of pinned messages
2583
+ *
2584
+ * @return {Promise<GetRepliesAPIResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>} A response with a list of messages
2585
+ */
2586
+
2587
+ }, {
2588
+ key: "getPinnedMessages",
2589
+ value: function () {
2590
+ var _getPinnedMessages = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30(options) {
2591
+ var sort,
2592
+ _args30 = arguments;
2593
+ return _regeneratorRuntime.wrap(function _callee30$(_context30) {
2594
+ while (1) {
2595
+ switch (_context30.prev = _context30.next) {
2596
+ case 0:
2597
+ sort = _args30.length > 1 && _args30[1] !== undefined ? _args30[1] : [];
2598
+ _context30.next = 3;
2599
+ return this.getClient().get(this.getClient().baseURL + "/channels/".concat(this.type, "/").concat(this.id, "/pinned_messages"), {
2600
+ payload: _objectSpread$5(_objectSpread$5({}, options), {}, {
2601
+ sort: normalizeQuerySort(sort)
2602
+ })
2603
+ });
2604
+
2605
+ case 3:
2606
+ return _context30.abrupt("return", _context30.sent);
2607
+
2608
+ case 4:
2609
+ case "end":
2610
+ return _context30.stop();
2611
+ }
2612
+ }
2613
+ }, _callee30, this);
2614
+ }));
2615
+
2616
+ function getPinnedMessages(_x29) {
2617
+ return _getPinnedMessages.apply(this, arguments);
2618
+ }
2619
+
2620
+ return getPinnedMessages;
2621
+ }()
2568
2622
  /**
2569
2623
  * getReactions - List the reactions, supports pagination
2570
2624
  *
@@ -2692,13 +2746,13 @@ var Channel = /*#__PURE__*/function () {
2692
2746
  * @return {Promise<ChannelAPIResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>} Returns a query response
2693
2747
  */
2694
2748
  function () {
2695
- var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30(options) {
2749
+ var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31(options) {
2696
2750
  var queryURL, state, membersStr, tempChannelCid;
2697
- return _regeneratorRuntime.wrap(function _callee30$(_context30) {
2751
+ return _regeneratorRuntime.wrap(function _callee31$(_context31) {
2698
2752
  while (1) {
2699
- switch (_context30.prev = _context30.next) {
2753
+ switch (_context31.prev = _context31.next) {
2700
2754
  case 0:
2701
- _context30.next = 2;
2755
+ _context31.next = 2;
2702
2756
  return this.getClient().wsPromise;
2703
2757
 
2704
2758
  case 2:
@@ -2708,14 +2762,14 @@ var Channel = /*#__PURE__*/function () {
2708
2762
  queryURL += "/".concat(this.id);
2709
2763
  }
2710
2764
 
2711
- _context30.next = 6;
2765
+ _context31.next = 6;
2712
2766
  return this.getClient().post(queryURL + '/query', _objectSpread$5({
2713
2767
  data: this._data,
2714
2768
  state: true
2715
2769
  }, options));
2716
2770
 
2717
2771
  case 6:
2718
- state = _context30.sent;
2772
+ state = _context31.sent;
2719
2773
 
2720
2774
  // update the channel id if it was missing
2721
2775
  if (!this.id) {
@@ -2745,17 +2799,17 @@ var Channel = /*#__PURE__*/function () {
2745
2799
 
2746
2800
  this._initializeState(state);
2747
2801
 
2748
- return _context30.abrupt("return", state);
2802
+ return _context31.abrupt("return", state);
2749
2803
 
2750
2804
  case 11:
2751
2805
  case "end":
2752
- return _context30.stop();
2806
+ return _context31.stop();
2753
2807
  }
2754
2808
  }
2755
- }, _callee30, this);
2809
+ }, _callee31, this);
2756
2810
  }));
2757
2811
 
2758
- function query(_x29) {
2812
+ function query(_x30) {
2759
2813
  return _query.apply(this, arguments);
2760
2814
  }
2761
2815
 
@@ -2772,31 +2826,31 @@ var Channel = /*#__PURE__*/function () {
2772
2826
  }, {
2773
2827
  key: "banUser",
2774
2828
  value: function () {
2775
- var _banUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31(targetUserID, options) {
2776
- return _regeneratorRuntime.wrap(function _callee31$(_context31) {
2829
+ var _banUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee32(targetUserID, options) {
2830
+ return _regeneratorRuntime.wrap(function _callee32$(_context32) {
2777
2831
  while (1) {
2778
- switch (_context31.prev = _context31.next) {
2832
+ switch (_context32.prev = _context32.next) {
2779
2833
  case 0:
2780
2834
  this._checkInitialized();
2781
2835
 
2782
- _context31.next = 3;
2836
+ _context32.next = 3;
2783
2837
  return this.getClient().banUser(targetUserID, _objectSpread$5(_objectSpread$5({}, options), {}, {
2784
2838
  type: this.type,
2785
2839
  id: this.id
2786
2840
  }));
2787
2841
 
2788
2842
  case 3:
2789
- return _context31.abrupt("return", _context31.sent);
2843
+ return _context32.abrupt("return", _context32.sent);
2790
2844
 
2791
2845
  case 4:
2792
2846
  case "end":
2793
- return _context31.stop();
2847
+ return _context32.stop();
2794
2848
  }
2795
2849
  }
2796
- }, _callee31, this);
2850
+ }, _callee32, this);
2797
2851
  }));
2798
2852
 
2799
- function banUser(_x30, _x31) {
2853
+ function banUser(_x31, _x32) {
2800
2854
  return _banUser.apply(this, arguments);
2801
2855
  }
2802
2856
 
@@ -2814,34 +2868,34 @@ var Channel = /*#__PURE__*/function () {
2814
2868
  }, {
2815
2869
  key: "hide",
2816
2870
  value: function () {
2817
- var _hide = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee32() {
2871
+ var _hide = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee33() {
2818
2872
  var userId,
2819
2873
  clearHistory,
2820
- _args32 = arguments;
2821
- return _regeneratorRuntime.wrap(function _callee32$(_context32) {
2874
+ _args33 = arguments;
2875
+ return _regeneratorRuntime.wrap(function _callee33$(_context33) {
2822
2876
  while (1) {
2823
- switch (_context32.prev = _context32.next) {
2877
+ switch (_context33.prev = _context33.next) {
2824
2878
  case 0:
2825
- userId = _args32.length > 0 && _args32[0] !== undefined ? _args32[0] : null;
2826
- clearHistory = _args32.length > 1 && _args32[1] !== undefined ? _args32[1] : false;
2879
+ userId = _args33.length > 0 && _args33[0] !== undefined ? _args33[0] : null;
2880
+ clearHistory = _args33.length > 1 && _args33[1] !== undefined ? _args33[1] : false;
2827
2881
 
2828
2882
  this._checkInitialized();
2829
2883
 
2830
- _context32.next = 5;
2884
+ _context33.next = 5;
2831
2885
  return this.getClient().post("".concat(this._channelURL(), "/hide"), {
2832
2886
  user_id: userId,
2833
2887
  clear_history: clearHistory
2834
2888
  });
2835
2889
 
2836
2890
  case 5:
2837
- return _context32.abrupt("return", _context32.sent);
2891
+ return _context33.abrupt("return", _context33.sent);
2838
2892
 
2839
2893
  case 6:
2840
2894
  case "end":
2841
- return _context32.stop();
2895
+ return _context33.stop();
2842
2896
  }
2843
2897
  }
2844
- }, _callee32, this);
2898
+ }, _callee33, this);
2845
2899
  }));
2846
2900
 
2847
2901
  function hide() {
@@ -2860,31 +2914,31 @@ var Channel = /*#__PURE__*/function () {
2860
2914
  }, {
2861
2915
  key: "show",
2862
2916
  value: function () {
2863
- var _show = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee33() {
2917
+ var _show = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee34() {
2864
2918
  var userId,
2865
- _args33 = arguments;
2866
- return _regeneratorRuntime.wrap(function _callee33$(_context33) {
2919
+ _args34 = arguments;
2920
+ return _regeneratorRuntime.wrap(function _callee34$(_context34) {
2867
2921
  while (1) {
2868
- switch (_context33.prev = _context33.next) {
2922
+ switch (_context34.prev = _context34.next) {
2869
2923
  case 0:
2870
- userId = _args33.length > 0 && _args33[0] !== undefined ? _args33[0] : null;
2924
+ userId = _args34.length > 0 && _args34[0] !== undefined ? _args34[0] : null;
2871
2925
 
2872
2926
  this._checkInitialized();
2873
2927
 
2874
- _context33.next = 4;
2928
+ _context34.next = 4;
2875
2929
  return this.getClient().post("".concat(this._channelURL(), "/show"), {
2876
2930
  user_id: userId
2877
2931
  });
2878
2932
 
2879
2933
  case 4:
2880
- return _context33.abrupt("return", _context33.sent);
2934
+ return _context34.abrupt("return", _context34.sent);
2881
2935
 
2882
2936
  case 5:
2883
2937
  case "end":
2884
- return _context33.stop();
2938
+ return _context34.stop();
2885
2939
  }
2886
2940
  }
2887
- }, _callee33, this);
2941
+ }, _callee34, this);
2888
2942
  }));
2889
2943
 
2890
2944
  function show() {
@@ -2903,31 +2957,31 @@ var Channel = /*#__PURE__*/function () {
2903
2957
  }, {
2904
2958
  key: "unbanUser",
2905
2959
  value: function () {
2906
- var _unbanUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee34(targetUserID) {
2907
- return _regeneratorRuntime.wrap(function _callee34$(_context34) {
2960
+ var _unbanUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee35(targetUserID) {
2961
+ return _regeneratorRuntime.wrap(function _callee35$(_context35) {
2908
2962
  while (1) {
2909
- switch (_context34.prev = _context34.next) {
2963
+ switch (_context35.prev = _context35.next) {
2910
2964
  case 0:
2911
2965
  this._checkInitialized();
2912
2966
 
2913
- _context34.next = 3;
2967
+ _context35.next = 3;
2914
2968
  return this.getClient().unbanUser(targetUserID, {
2915
2969
  type: this.type,
2916
2970
  id: this.id
2917
2971
  });
2918
2972
 
2919
2973
  case 3:
2920
- return _context34.abrupt("return", _context34.sent);
2974
+ return _context35.abrupt("return", _context35.sent);
2921
2975
 
2922
2976
  case 4:
2923
2977
  case "end":
2924
- return _context34.stop();
2978
+ return _context35.stop();
2925
2979
  }
2926
2980
  }
2927
- }, _callee34, this);
2981
+ }, _callee35, this);
2928
2982
  }));
2929
2983
 
2930
- function unbanUser(_x32) {
2984
+ function unbanUser(_x33) {
2931
2985
  return _unbanUser.apply(this, arguments);
2932
2986
  }
2933
2987
 
@@ -2944,31 +2998,31 @@ var Channel = /*#__PURE__*/function () {
2944
2998
  }, {
2945
2999
  key: "shadowBan",
2946
3000
  value: function () {
2947
- var _shadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee35(targetUserID, options) {
2948
- return _regeneratorRuntime.wrap(function _callee35$(_context35) {
3001
+ var _shadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee36(targetUserID, options) {
3002
+ return _regeneratorRuntime.wrap(function _callee36$(_context36) {
2949
3003
  while (1) {
2950
- switch (_context35.prev = _context35.next) {
3004
+ switch (_context36.prev = _context36.next) {
2951
3005
  case 0:
2952
3006
  this._checkInitialized();
2953
3007
 
2954
- _context35.next = 3;
3008
+ _context36.next = 3;
2955
3009
  return this.getClient().shadowBan(targetUserID, _objectSpread$5(_objectSpread$5({}, options), {}, {
2956
3010
  type: this.type,
2957
3011
  id: this.id
2958
3012
  }));
2959
3013
 
2960
3014
  case 3:
2961
- return _context35.abrupt("return", _context35.sent);
3015
+ return _context36.abrupt("return", _context36.sent);
2962
3016
 
2963
3017
  case 4:
2964
3018
  case "end":
2965
- return _context35.stop();
3019
+ return _context36.stop();
2966
3020
  }
2967
3021
  }
2968
- }, _callee35, this);
3022
+ }, _callee36, this);
2969
3023
  }));
2970
3024
 
2971
- function shadowBan(_x33, _x34) {
3025
+ function shadowBan(_x34, _x35) {
2972
3026
  return _shadowBan.apply(this, arguments);
2973
3027
  }
2974
3028
 
@@ -2984,31 +3038,31 @@ var Channel = /*#__PURE__*/function () {
2984
3038
  }, {
2985
3039
  key: "removeShadowBan",
2986
3040
  value: function () {
2987
- var _removeShadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee36(targetUserID) {
2988
- return _regeneratorRuntime.wrap(function _callee36$(_context36) {
3041
+ var _removeShadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee37(targetUserID) {
3042
+ return _regeneratorRuntime.wrap(function _callee37$(_context37) {
2989
3043
  while (1) {
2990
- switch (_context36.prev = _context36.next) {
3044
+ switch (_context37.prev = _context37.next) {
2991
3045
  case 0:
2992
3046
  this._checkInitialized();
2993
3047
 
2994
- _context36.next = 3;
3048
+ _context37.next = 3;
2995
3049
  return this.getClient().removeShadowBan(targetUserID, {
2996
3050
  type: this.type,
2997
3051
  id: this.id
2998
3052
  });
2999
3053
 
3000
3054
  case 3:
3001
- return _context36.abrupt("return", _context36.sent);
3055
+ return _context37.abrupt("return", _context37.sent);
3002
3056
 
3003
3057
  case 4:
3004
3058
  case "end":
3005
- return _context36.stop();
3059
+ return _context37.stop();
3006
3060
  }
3007
3061
  }
3008
- }, _callee36, this);
3062
+ }, _callee37, this);
3009
3063
  }));
3010
3064
 
3011
- function removeShadowBan(_x35) {
3065
+ function removeShadowBan(_x36) {
3012
3066
  return _removeShadowBan.apply(this, arguments);
3013
3067
  }
3014
3068
 
@@ -3230,7 +3284,12 @@ var Channel = /*#__PURE__*/function () {
3230
3284
 
3231
3285
  case 'channel.updated':
3232
3286
  if (event.channel) {
3233
- channel.data = event.channel;
3287
+ var _event$channel$hidden, _event$channel, _channel$data, _event$channel$own_ca, _event$channel2, _channel$data2;
3288
+
3289
+ channel.data = _objectSpread$5(_objectSpread$5({}, event.channel), {}, {
3290
+ 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,
3291
+ 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
3292
+ });
3234
3293
  }
3235
3294
 
3236
3295
  break;
@@ -3417,7 +3476,7 @@ var Channel = /*#__PURE__*/function () {
3417
3476
  return Channel;
3418
3477
  }();
3419
3478
 
3420
- 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; } } }; }
3479
+ 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; } } }; }
3421
3480
 
3422
3481
  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); }
3423
3482
 
@@ -3492,7 +3551,7 @@ var ClientState = /*#__PURE__*/function () {
3492
3551
  return ClientState;
3493
3552
  }();
3494
3553
 
3495
- 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; }
3554
+ 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; }
3496
3555
 
3497
3556
  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; }
3498
3557
  var InsightMetrics = function InsightMetrics() {
@@ -3606,7 +3665,7 @@ function buildWsSuccessAfterFailureInsight(connection) {
3606
3665
  return buildWsBaseInsight(connection);
3607
3666
  }
3608
3667
 
3609
- 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; }
3668
+ 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; }
3610
3669
 
3611
3670
  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; }
3612
3671
 
@@ -4524,7 +4583,7 @@ var StableWSConnection = /*#__PURE__*/function () {
4524
4583
  return StableWSConnection;
4525
4584
  }();
4526
4585
 
4527
- 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; }
4586
+ 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; }
4528
4587
 
4529
4588
  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; }
4530
4589
 
@@ -4939,7 +4998,7 @@ function isWSFailure(err) {
4939
4998
  }
4940
4999
  }
4941
5000
 
4942
- 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; }
5001
+ 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; }
4943
5002
 
4944
5003
  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; }
4945
5004
  var ConnectionState;
@@ -5147,27 +5206,35 @@ var WSConnectionFallback = /*#__PURE__*/function () {
5147
5206
  reconnect = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : false;
5148
5207
 
5149
5208
  if (!(_this.state === ConnectionState.Connecting)) {
5150
- _context3.next = 3;
5209
+ _context3.next = 4;
5151
5210
  break;
5152
5211
  }
5153
5212
 
5154
- throw new Error('connecting already in progress');
5213
+ _this._log('connect() - connecting already in progress', {
5214
+ reconnect: reconnect
5215
+ }, 'warn');
5155
5216
 
5156
- case 3:
5217
+ return _context3.abrupt("return");
5218
+
5219
+ case 4:
5157
5220
  if (!(_this.state === ConnectionState.Connected)) {
5158
- _context3.next = 5;
5221
+ _context3.next = 7;
5159
5222
  break;
5160
5223
  }
5161
5224
 
5162
- throw new Error('already connected and polling');
5225
+ _this._log('connect() - already connected and polling', {
5226
+ reconnect: reconnect
5227
+ }, 'warn');
5163
5228
 
5164
- case 5:
5229
+ return _context3.abrupt("return");
5230
+
5231
+ case 7:
5165
5232
  _this._setState(ConnectionState.Connecting);
5166
5233
 
5167
5234
  _this.connectionID = undefined; // connect should be sent with empty connection_id so API creates one
5168
5235
 
5169
- _context3.prev = 7;
5170
- _context3.next = 10;
5236
+ _context3.prev = 9;
5237
+ _context3.next = 12;
5171
5238
  return _this._req({
5172
5239
  json: _this.client._buildWSPayload()
5173
5240
  }, {
@@ -5175,7 +5242,7 @@ var WSConnectionFallback = /*#__PURE__*/function () {
5175
5242
  }, // 8s
5176
5243
  reconnect);
5177
5244
 
5178
- case 10:
5245
+ case 12:
5179
5246
  _yield$_this$_req = _context3.sent;
5180
5247
  event = _yield$_this$_req.event;
5181
5248
 
@@ -5191,30 +5258,31 @@ var WSConnectionFallback = /*#__PURE__*/function () {
5191
5258
 
5192
5259
  return _context3.abrupt("return", event);
5193
5260
 
5194
- case 19:
5195
- _context3.prev = 19;
5196
- _context3.t0 = _context3["catch"](7);
5261
+ case 21:
5262
+ _context3.prev = 21;
5263
+ _context3.t0 = _context3["catch"](9);
5197
5264
 
5198
5265
  _this._setState(ConnectionState.Closed);
5199
5266
 
5200
5267
  throw _context3.t0;
5201
5268
 
5202
- case 23:
5269
+ case 25:
5203
5270
  case "end":
5204
5271
  return _context3.stop();
5205
5272
  }
5206
5273
  }
5207
- }, _callee3, null, [[7, 19]]);
5274
+ }, _callee3, null, [[9, 21]]);
5208
5275
  })));
5209
5276
 
5210
5277
  _defineProperty(this, "isHealthy", function () {
5211
- return _this.connectionID && _this.state === ConnectionState.Connected;
5278
+ return !!_this.connectionID && _this.state === ConnectionState.Connected;
5212
5279
  });
5213
5280
 
5214
5281
  _defineProperty(this, "disconnect", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
5215
5282
  var _this$cancelToken3;
5216
5283
 
5217
5284
  var timeout,
5285
+ connection_id,
5218
5286
  _args4 = arguments;
5219
5287
  return _regeneratorRuntime.wrap(function _callee4$(_context4) {
5220
5288
  while (1) {
@@ -5227,36 +5295,37 @@ var WSConnectionFallback = /*#__PURE__*/function () {
5227
5295
 
5228
5296
  (_this$cancelToken3 = _this.cancelToken) === null || _this$cancelToken3 === void 0 ? void 0 : _this$cancelToken3.cancel('disconnect() is called');
5229
5297
  _this.cancelToken = undefined;
5230
- _context4.prev = 5;
5231
- _context4.next = 8;
5298
+ connection_id = _this.connectionID;
5299
+ _this.connectionID = undefined;
5300
+ _context4.prev = 7;
5301
+ _context4.next = 10;
5232
5302
  return _this._req({
5233
- close: true
5303
+ close: true,
5304
+ connection_id: connection_id
5234
5305
  }, {
5235
5306
  timeout: timeout
5236
5307
  }, false);
5237
5308
 
5238
- case 8:
5239
- _this.connectionID = undefined;
5240
-
5309
+ case 10:
5241
5310
  _this._log("disconnect() - Closed connectionID");
5242
5311
 
5243
- _context4.next = 15;
5312
+ _context4.next = 16;
5244
5313
  break;
5245
5314
 
5246
- case 12:
5247
- _context4.prev = 12;
5248
- _context4.t0 = _context4["catch"](5);
5315
+ case 13:
5316
+ _context4.prev = 13;
5317
+ _context4.t0 = _context4["catch"](7);
5249
5318
 
5250
5319
  _this._log("disconnect() - Failed", {
5251
5320
  err: _context4.t0
5252
- });
5321
+ }, 'error');
5253
5322
 
5254
- case 15:
5323
+ case 16:
5255
5324
  case "end":
5256
5325
  return _context4.stop();
5257
5326
  }
5258
5327
  }
5259
- }, _callee4, null, [[5, 12]]);
5328
+ }, _callee4, null, [[7, 13]]);
5260
5329
  })));
5261
5330
 
5262
5331
  this.client = client;
@@ -5305,13 +5374,15 @@ var WSConnectionFallback = /*#__PURE__*/function () {
5305
5374
  return WSConnectionFallback;
5306
5375
  }();
5307
5376
 
5308
- 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; } } }; }
5377
+ var _excluded = ["created_at", "updated_at", "last_active", "online"];
5378
+
5379
+ 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; } } }; }
5309
5380
 
5310
5381
  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); }
5311
5382
 
5312
5383
  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; }
5313
5384
 
5314
- 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; }
5385
+ 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; }
5315
5386
 
5316
5387
  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; }
5317
5388
 
@@ -6069,8 +6140,6 @@ var StreamChat = /*#__PURE__*/function () {
6069
6140
  return JSON.stringify({
6070
6141
  user_id: _this.userID,
6071
6142
  user_details: _this._user,
6072
- user_token: _this.tokenManager.getToken(),
6073
- server_determines_connection_id: true,
6074
6143
  device: _this.options.device,
6075
6144
  client_request_id: client_request_id
6076
6145
  });
@@ -6618,7 +6687,7 @@ var StreamChat = /*#__PURE__*/function () {
6618
6687
  case 11:
6619
6688
  this.anonymous = false; // eslint-disable-next-line @typescript-eslint/no-unused-vars
6620
6689
 
6621
- _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"]);
6690
+ _response$user = response.user, _response$user.created_at, _response$user.updated_at, _response$user.last_active, _response$user.online, guestUser = _objectWithoutProperties(_response$user, _excluded);
6622
6691
  _context14.next = 15;
6623
6692
  return this.connectUser(guestUser, response.access_token);
6624
6693
 
@@ -6981,23 +7050,41 @@ var StreamChat = /*#__PURE__*/function () {
6981
7050
  client: this
6982
7051
  });
6983
7052
  _context15.prev = 8;
6984
- _context15.next = 11;
7053
+
7054
+ if (!this.wsFallback) {
7055
+ _context15.next = 13;
7056
+ break;
7057
+ }
7058
+
7059
+ _context15.next = 12;
7060
+ return this.wsFallback.connect();
7061
+
7062
+ case 12:
7063
+ return _context15.abrupt("return", _context15.sent);
7064
+
7065
+ case 13:
7066
+ _context15.next = 15;
6985
7067
  return this.wsConnection.connect(this.options.enableWSFallback ? this.defaultWSTimeoutWithFallback : this.defaultWSTimeout);
6986
7068
 
6987
- case 11:
7069
+ case 15:
6988
7070
  return _context15.abrupt("return", _context15.sent);
6989
7071
 
6990
- case 14:
6991
- _context15.prev = 14;
7072
+ case 18:
7073
+ _context15.prev = 18;
6992
7074
  _context15.t0 = _context15["catch"](8);
6993
7075
 
6994
7076
  if (!(this.options.enableWSFallback && isWSFailure(_context15.t0) && isOnline())) {
6995
- _context15.next = 24;
7077
+ _context15.next = 29;
6996
7078
  break;
6997
7079
  }
6998
7080
 
6999
7081
  this.logger('info', 'client:connect() - WS failed, fallback to longpoll', {
7000
7082
  tags: ['connection', 'client']
7083
+ }); // @ts-expect-error
7084
+
7085
+ this.dispatchEvent({
7086
+ type: 'transport.changed',
7087
+ mode: 'longpoll'
7001
7088
  });
7002
7089
 
7003
7090
  this.wsConnection._destroyCurrentWSConnection();
@@ -7007,21 +7094,21 @@ var StreamChat = /*#__PURE__*/function () {
7007
7094
  this.wsFallback = new WSConnectionFallback({
7008
7095
  client: this
7009
7096
  });
7010
- _context15.next = 23;
7097
+ _context15.next = 28;
7011
7098
  return this.wsFallback.connect();
7012
7099
 
7013
- case 23:
7100
+ case 28:
7014
7101
  return _context15.abrupt("return", _context15.sent);
7015
7102
 
7016
- case 24:
7103
+ case 29:
7017
7104
  throw _context15.t0;
7018
7105
 
7019
- case 25:
7106
+ case 30:
7020
7107
  case "end":
7021
7108
  return _context15.stop();
7022
7109
  }
7023
7110
  }
7024
- }, _callee15, this, [[8, 14]]);
7111
+ }, _callee15, this, [[8, 18]]);
7025
7112
  }));
7026
7113
 
7027
7114
  function connect() {
@@ -8034,27 +8121,15 @@ var StreamChat = /*#__PURE__*/function () {
8034
8121
  while (1) {
8035
8122
  switch (_context32.prev = _context32.next) {
8036
8123
  case 0:
8037
- if ((options === null || options === void 0 ? void 0 : options.user_id) !== undefined) {
8038
- options.banned_by_id = options.user_id;
8039
- delete options.user_id;
8040
- console.warn("banUser: 'user_id' is deprecated, please consider switching to 'banned_by_id'");
8041
- }
8042
-
8043
- if ((options === null || options === void 0 ? void 0 : options.user) !== undefined) {
8044
- options.banned_by = options.user;
8045
- delete options.user;
8046
- console.warn("banUser: 'user' is deprecated, please consider switching to 'banned_by'");
8047
- }
8048
-
8049
- _context32.next = 4;
8124
+ _context32.next = 2;
8050
8125
  return this.post(this.baseURL + '/moderation/ban', _objectSpread({
8051
8126
  target_user_id: targetUserID
8052
8127
  }, options));
8053
8128
 
8054
- case 4:
8129
+ case 2:
8055
8130
  return _context32.abrupt("return", _context32.sent);
8056
8131
 
8057
- case 5:
8132
+ case 3:
8058
8133
  case "end":
8059
8134
  return _context32.stop();
8060
8135
  }
@@ -8440,6 +8515,101 @@ var StreamChat = /*#__PURE__*/function () {
8440
8515
 
8441
8516
  return unflagUser;
8442
8517
  }()
8518
+ /**
8519
+ * _queryFlagReports - Query flag reports.
8520
+ *
8521
+ * Note: Do not use this.
8522
+ * It is present for internal usage only.
8523
+ * This function can, and will, break and/or be removed at any point in time.
8524
+ *
8525
+ * @param {FlagReportsFilters} filterConditions MongoDB style filter conditions
8526
+ * @param {FlagReportsPaginationOptions} options Option object, {limit: 10, offset:0}
8527
+ *
8528
+ * @return {Promise<FlagReportsResponse<ChannelType, CommandType, UserType>>} Flag Reports Response
8529
+ */
8530
+
8531
+ }, {
8532
+ key: "_queryFlagReports",
8533
+ value: function () {
8534
+ var _queryFlagReports2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42() {
8535
+ var filterConditions,
8536
+ options,
8537
+ _args42 = arguments;
8538
+ return _regeneratorRuntime.wrap(function _callee42$(_context42) {
8539
+ while (1) {
8540
+ switch (_context42.prev = _context42.next) {
8541
+ case 0:
8542
+ filterConditions = _args42.length > 0 && _args42[0] !== undefined ? _args42[0] : {};
8543
+ options = _args42.length > 1 && _args42[1] !== undefined ? _args42[1] : {};
8544
+ _context42.next = 4;
8545
+ return this.post(this.baseURL + '/moderation/reports', _objectSpread({
8546
+ filter_conditions: filterConditions
8547
+ }, options));
8548
+
8549
+ case 4:
8550
+ return _context42.abrupt("return", _context42.sent);
8551
+
8552
+ case 5:
8553
+ case "end":
8554
+ return _context42.stop();
8555
+ }
8556
+ }
8557
+ }, _callee42, this);
8558
+ }));
8559
+
8560
+ function _queryFlagReports() {
8561
+ return _queryFlagReports2.apply(this, arguments);
8562
+ }
8563
+
8564
+ return _queryFlagReports;
8565
+ }()
8566
+ /**
8567
+ * _reviewFlagReport - review flag report
8568
+ *
8569
+ * Note: Do not use this.
8570
+ * It is present for internal usage only.
8571
+ * This function can, and will, break and/or be removed at any point in time.
8572
+ *
8573
+ * @param {string} [id] flag report to review
8574
+ * @param {string} [reviewResult] flag report review result
8575
+ * @param {string} [options.user_id] currentUserID, only used with serverside auth
8576
+ * @param {string} [options.review_details] custom information about review result
8577
+ * @returns {Promise<ReviewFlagReportResponse>>}
8578
+ */
8579
+
8580
+ }, {
8581
+ key: "_reviewFlagReport",
8582
+ value: function () {
8583
+ var _reviewFlagReport2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee43(id, reviewResult) {
8584
+ var options,
8585
+ _args43 = arguments;
8586
+ return _regeneratorRuntime.wrap(function _callee43$(_context43) {
8587
+ while (1) {
8588
+ switch (_context43.prev = _context43.next) {
8589
+ case 0:
8590
+ options = _args43.length > 2 && _args43[2] !== undefined ? _args43[2] : {};
8591
+ _context43.next = 3;
8592
+ return this.patch(this.baseURL + "/moderation/reports/".concat(id), _objectSpread({
8593
+ review_result: reviewResult
8594
+ }, options));
8595
+
8596
+ case 3:
8597
+ return _context43.abrupt("return", _context43.sent);
8598
+
8599
+ case 4:
8600
+ case "end":
8601
+ return _context43.stop();
8602
+ }
8603
+ }
8604
+ }, _callee43, this);
8605
+ }));
8606
+
8607
+ function _reviewFlagReport(_x54, _x55) {
8608
+ return _reviewFlagReport2.apply(this, arguments);
8609
+ }
8610
+
8611
+ return _reviewFlagReport;
8612
+ }()
8443
8613
  /**
8444
8614
  * @deprecated use markChannelsRead instead
8445
8615
  *
@@ -8461,23 +8631,23 @@ var StreamChat = /*#__PURE__*/function () {
8461
8631
  * @return {Promise<APIResponse>}
8462
8632
  */
8463
8633
  function () {
8464
- var _markChannelsRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42() {
8634
+ var _markChannelsRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44() {
8465
8635
  var data,
8466
- _args42 = arguments;
8467
- return _regeneratorRuntime.wrap(function _callee42$(_context42) {
8636
+ _args44 = arguments;
8637
+ return _regeneratorRuntime.wrap(function _callee44$(_context44) {
8468
8638
  while (1) {
8469
- switch (_context42.prev = _context42.next) {
8639
+ switch (_context44.prev = _context44.next) {
8470
8640
  case 0:
8471
- data = _args42.length > 0 && _args42[0] !== undefined ? _args42[0] : {};
8472
- _context42.next = 3;
8641
+ data = _args44.length > 0 && _args44[0] !== undefined ? _args44[0] : {};
8642
+ _context44.next = 3;
8473
8643
  return this.post(this.baseURL + '/channels/read', _objectSpread({}, data));
8474
8644
 
8475
8645
  case 3:
8476
8646
  case "end":
8477
- return _context42.stop();
8647
+ return _context44.stop();
8478
8648
  }
8479
8649
  }
8480
- }, _callee42, this);
8650
+ }, _callee44, this);
8481
8651
  }));
8482
8652
 
8483
8653
  function markChannelsRead() {
@@ -8552,28 +8722,28 @@ var StreamChat = /*#__PURE__*/function () {
8552
8722
  }, {
8553
8723
  key: "translateMessage",
8554
8724
  value: function () {
8555
- var _translateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee43(messageId, language) {
8556
- return _regeneratorRuntime.wrap(function _callee43$(_context43) {
8725
+ var _translateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45(messageId, language) {
8726
+ return _regeneratorRuntime.wrap(function _callee45$(_context45) {
8557
8727
  while (1) {
8558
- switch (_context43.prev = _context43.next) {
8728
+ switch (_context45.prev = _context45.next) {
8559
8729
  case 0:
8560
- _context43.next = 2;
8730
+ _context45.next = 2;
8561
8731
  return this.post(this.baseURL + "/messages/".concat(messageId, "/translate"), {
8562
8732
  language: language
8563
8733
  });
8564
8734
 
8565
8735
  case 2:
8566
- return _context43.abrupt("return", _context43.sent);
8736
+ return _context45.abrupt("return", _context45.sent);
8567
8737
 
8568
8738
  case 3:
8569
8739
  case "end":
8570
- return _context43.stop();
8740
+ return _context45.stop();
8571
8741
  }
8572
8742
  }
8573
- }, _callee43, this);
8743
+ }, _callee45, this);
8574
8744
  }));
8575
8745
 
8576
- function translateMessage(_x54, _x55) {
8746
+ function translateMessage(_x56, _x57) {
8577
8747
  return _translateMessage.apply(this, arguments);
8578
8748
  }
8579
8749
 
@@ -8587,7 +8757,7 @@ var StreamChat = /*#__PURE__*/function () {
8587
8757
  }, {
8588
8758
  key: "_normalizeExpiration",
8589
8759
  value: function _normalizeExpiration(timeoutOrExpirationDate) {
8590
- var pinExpires;
8760
+ var pinExpires = null;
8591
8761
 
8592
8762
  if (typeof timeoutOrExpirationDate === 'number') {
8593
8763
  var now = new Date();
@@ -8628,20 +8798,22 @@ var StreamChat = /*#__PURE__*/function () {
8628
8798
  * pinMessage - pins the message
8629
8799
  * @param {string | { id: string }} messageOrMessageId message object or message id
8630
8800
  * @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
8631
- * @param {string | { id: string }} [userId]
8801
+ * @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
8802
+ * @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
8632
8803
  */
8633
8804
 
8634
8805
  }, {
8635
8806
  key: "pinMessage",
8636
- value: function pinMessage(messageOrMessageId, timeoutOrExpirationDate, userId) {
8807
+ value: function pinMessage(messageOrMessageId, timeoutOrExpirationDate, pinnedBy, pinnedAt) {
8637
8808
  var messageId = this._validateAndGetMessageId(messageOrMessageId, 'Please specify the message id when calling unpinMessage');
8638
8809
 
8639
8810
  return this.partialUpdateMessage(messageId, {
8640
8811
  set: {
8641
8812
  pinned: true,
8642
- pin_expires: this._normalizeExpiration(timeoutOrExpirationDate)
8813
+ pin_expires: this._normalizeExpiration(timeoutOrExpirationDate),
8814
+ pinned_at: this._normalizeExpiration(pinnedAt)
8643
8815
  }
8644
- }, userId);
8816
+ }, pinnedBy);
8645
8817
  }
8646
8818
  /**
8647
8819
  * unpinMessage - unpins the message that was previously pinned
@@ -8673,14 +8845,14 @@ var StreamChat = /*#__PURE__*/function () {
8673
8845
  }, {
8674
8846
  key: "updateMessage",
8675
8847
  value: function () {
8676
- var _updateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44(message, userId, options) {
8848
+ var _updateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46(message, userId, options) {
8677
8849
  var clonedMessage, reservedMessageFields;
8678
- return _regeneratorRuntime.wrap(function _callee44$(_context44) {
8850
+ return _regeneratorRuntime.wrap(function _callee46$(_context46) {
8679
8851
  while (1) {
8680
- switch (_context44.prev = _context44.next) {
8852
+ switch (_context46.prev = _context46.next) {
8681
8853
  case 0:
8682
8854
  if (message.id) {
8683
- _context44.next = 2;
8855
+ _context46.next = 2;
8684
8856
  break;
8685
8857
  }
8686
8858
 
@@ -8717,23 +8889,23 @@ var StreamChat = /*#__PURE__*/function () {
8717
8889
  });
8718
8890
  }
8719
8891
 
8720
- _context44.next = 10;
8892
+ _context46.next = 10;
8721
8893
  return this.post(this.baseURL + "/messages/".concat(message.id), _objectSpread({
8722
8894
  message: clonedMessage
8723
8895
  }, options));
8724
8896
 
8725
8897
  case 10:
8726
- return _context44.abrupt("return", _context44.sent);
8898
+ return _context46.abrupt("return", _context46.sent);
8727
8899
 
8728
8900
  case 11:
8729
8901
  case "end":
8730
- return _context44.stop();
8902
+ return _context46.stop();
8731
8903
  }
8732
8904
  }
8733
- }, _callee44, this);
8905
+ }, _callee46, this);
8734
8906
  }));
8735
8907
 
8736
- function updateMessage(_x56, _x57, _x58) {
8908
+ function updateMessage(_x58, _x59, _x60) {
8737
8909
  return _updateMessage.apply(this, arguments);
8738
8910
  }
8739
8911
 
@@ -8756,14 +8928,14 @@ var StreamChat = /*#__PURE__*/function () {
8756
8928
  }, {
8757
8929
  key: "partialUpdateMessage",
8758
8930
  value: function () {
8759
- var _partialUpdateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45(id, partialMessageObject, userId, options) {
8931
+ var _partialUpdateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee47(id, partialMessageObject, userId, options) {
8760
8932
  var user;
8761
- return _regeneratorRuntime.wrap(function _callee45$(_context45) {
8933
+ return _regeneratorRuntime.wrap(function _callee47$(_context47) {
8762
8934
  while (1) {
8763
- switch (_context45.prev = _context45.next) {
8935
+ switch (_context47.prev = _context47.next) {
8764
8936
  case 0:
8765
8937
  if (id) {
8766
- _context45.next = 2;
8938
+ _context47.next = 2;
8767
8939
  break;
8768
8940
  }
8769
8941
 
@@ -8778,23 +8950,23 @@ var StreamChat = /*#__PURE__*/function () {
8778
8950
  };
8779
8951
  }
8780
8952
 
8781
- _context45.next = 6;
8953
+ _context47.next = 6;
8782
8954
  return this.put(this.baseURL + "/messages/".concat(id), _objectSpread(_objectSpread(_objectSpread({}, partialMessageObject), options), {}, {
8783
8955
  user: user
8784
8956
  }));
8785
8957
 
8786
8958
  case 6:
8787
- return _context45.abrupt("return", _context45.sent);
8959
+ return _context47.abrupt("return", _context47.sent);
8788
8960
 
8789
8961
  case 7:
8790
8962
  case "end":
8791
- return _context45.stop();
8963
+ return _context47.stop();
8792
8964
  }
8793
8965
  }
8794
- }, _callee45, this);
8966
+ }, _callee47, this);
8795
8967
  }));
8796
8968
 
8797
- function partialUpdateMessage(_x59, _x60, _x61, _x62) {
8969
+ function partialUpdateMessage(_x61, _x62, _x63, _x64) {
8798
8970
  return _partialUpdateMessage.apply(this, arguments);
8799
8971
  }
8800
8972
 
@@ -8803,11 +8975,11 @@ var StreamChat = /*#__PURE__*/function () {
8803
8975
  }, {
8804
8976
  key: "deleteMessage",
8805
8977
  value: function () {
8806
- var _deleteMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46(messageID, hardDelete) {
8978
+ var _deleteMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee48(messageID, hardDelete) {
8807
8979
  var params;
8808
- return _regeneratorRuntime.wrap(function _callee46$(_context46) {
8980
+ return _regeneratorRuntime.wrap(function _callee48$(_context48) {
8809
8981
  while (1) {
8810
- switch (_context46.prev = _context46.next) {
8982
+ switch (_context48.prev = _context48.next) {
8811
8983
  case 0:
8812
8984
  params = {};
8813
8985
 
@@ -8817,21 +8989,21 @@ var StreamChat = /*#__PURE__*/function () {
8817
8989
  };
8818
8990
  }
8819
8991
 
8820
- _context46.next = 4;
8992
+ _context48.next = 4;
8821
8993
  return this.delete(this.baseURL + "/messages/".concat(messageID), params);
8822
8994
 
8823
8995
  case 4:
8824
- return _context46.abrupt("return", _context46.sent);
8996
+ return _context48.abrupt("return", _context48.sent);
8825
8997
 
8826
8998
  case 5:
8827
8999
  case "end":
8828
- return _context46.stop();
9000
+ return _context48.stop();
8829
9001
  }
8830
9002
  }
8831
- }, _callee46, this);
9003
+ }, _callee48, this);
8832
9004
  }));
8833
9005
 
8834
- function deleteMessage(_x63, _x64) {
9006
+ function deleteMessage(_x65, _x66) {
8835
9007
  return _deleteMessage.apply(this, arguments);
8836
9008
  }
8837
9009
 
@@ -8840,26 +9012,26 @@ var StreamChat = /*#__PURE__*/function () {
8840
9012
  }, {
8841
9013
  key: "getMessage",
8842
9014
  value: function () {
8843
- var _getMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee47(messageID) {
8844
- return _regeneratorRuntime.wrap(function _callee47$(_context47) {
9015
+ var _getMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49(messageID) {
9016
+ return _regeneratorRuntime.wrap(function _callee49$(_context49) {
8845
9017
  while (1) {
8846
- switch (_context47.prev = _context47.next) {
9018
+ switch (_context49.prev = _context49.next) {
8847
9019
  case 0:
8848
- _context47.next = 2;
9020
+ _context49.next = 2;
8849
9021
  return this.get(this.baseURL + "/messages/".concat(messageID));
8850
9022
 
8851
9023
  case 2:
8852
- return _context47.abrupt("return", _context47.sent);
9024
+ return _context49.abrupt("return", _context49.sent);
8853
9025
 
8854
9026
  case 3:
8855
9027
  case "end":
8856
- return _context47.stop();
9028
+ return _context49.stop();
8857
9029
  }
8858
9030
  }
8859
- }, _callee47, this);
9031
+ }, _callee49, this);
8860
9032
  }));
8861
9033
 
8862
- function getMessage(_x65) {
9034
+ function getMessage(_x67) {
8863
9035
  return _getMessage.apply(this, arguments);
8864
9036
  }
8865
9037
 
@@ -8868,7 +9040,7 @@ var StreamChat = /*#__PURE__*/function () {
8868
9040
  }, {
8869
9041
  key: "getUserAgent",
8870
9042
  value: function getUserAgent() {
8871
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "4.5.0-beta.0");
9043
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "5.1.1");
8872
9044
  }
8873
9045
  }, {
8874
9046
  key: "setUserAgent",
@@ -8903,12 +9075,11 @@ var StreamChat = /*#__PURE__*/function () {
8903
9075
  }
8904
9076
 
8905
9077
  return _objectSpread({
8906
- params: _objectSpread(_objectSpread({
8907
- user_id: this.userID
8908
- }, options.params), {}, {
8909
- api_key: this.key,
8910
- connection_id: this._getConnectionID()
8911
- }),
9078
+ params: _objectSpread({
9079
+ user_id: this.userID,
9080
+ connection_id: this._getConnectionID(),
9081
+ api_key: this.key
9082
+ }, options.params),
8912
9083
  headers: _objectSpread(_objectSpread({}, authorization), {}, {
8913
9084
  'stream-auth-type': this.getAuthType(),
8914
9085
  'X-Stream-Client': this.getUserAgent()
@@ -9064,28 +9235,28 @@ var StreamChat = /*#__PURE__*/function () {
9064
9235
  }, {
9065
9236
  key: "sendUserCustomEvent",
9066
9237
  value: function () {
9067
- var _sendUserCustomEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee48(targetUserID, event) {
9068
- return _regeneratorRuntime.wrap(function _callee48$(_context48) {
9238
+ var _sendUserCustomEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee50(targetUserID, event) {
9239
+ return _regeneratorRuntime.wrap(function _callee50$(_context50) {
9069
9240
  while (1) {
9070
- switch (_context48.prev = _context48.next) {
9241
+ switch (_context50.prev = _context50.next) {
9071
9242
  case 0:
9072
- _context48.next = 2;
9243
+ _context50.next = 2;
9073
9244
  return this.post("".concat(this.baseURL, "/users/").concat(targetUserID, "/event"), {
9074
9245
  event: event
9075
9246
  });
9076
9247
 
9077
9248
  case 2:
9078
- return _context48.abrupt("return", _context48.sent);
9249
+ return _context50.abrupt("return", _context50.sent);
9079
9250
 
9080
9251
  case 3:
9081
9252
  case "end":
9082
- return _context48.stop();
9253
+ return _context50.stop();
9083
9254
  }
9084
9255
  }
9085
- }, _callee48, this);
9256
+ }, _callee50, this);
9086
9257
  }));
9087
9258
 
9088
- function sendUserCustomEvent(_x66, _x67) {
9259
+ function sendUserCustomEvent(_x68, _x69) {
9089
9260
  return _sendUserCustomEvent.apply(this, arguments);
9090
9261
  }
9091
9262
 
@@ -9148,32 +9319,32 @@ var StreamChat = /*#__PURE__*/function () {
9148
9319
  }, {
9149
9320
  key: "createSegment",
9150
9321
  value: function () {
9151
- var _createSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49(params) {
9322
+ var _createSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee51(params) {
9152
9323
  var _yield$this$post, segment;
9153
9324
 
9154
- return _regeneratorRuntime.wrap(function _callee49$(_context49) {
9325
+ return _regeneratorRuntime.wrap(function _callee51$(_context51) {
9155
9326
  while (1) {
9156
- switch (_context49.prev = _context49.next) {
9327
+ switch (_context51.prev = _context51.next) {
9157
9328
  case 0:
9158
- _context49.next = 2;
9329
+ _context51.next = 2;
9159
9330
  return this.post(this.baseURL + "/segments", {
9160
9331
  segment: params
9161
9332
  });
9162
9333
 
9163
9334
  case 2:
9164
- _yield$this$post = _context49.sent;
9335
+ _yield$this$post = _context51.sent;
9165
9336
  segment = _yield$this$post.segment;
9166
- return _context49.abrupt("return", segment);
9337
+ return _context51.abrupt("return", segment);
9167
9338
 
9168
9339
  case 5:
9169
9340
  case "end":
9170
- return _context49.stop();
9341
+ return _context51.stop();
9171
9342
  }
9172
9343
  }
9173
- }, _callee49, this);
9344
+ }, _callee51, this);
9174
9345
  }));
9175
9346
 
9176
- function createSegment(_x68) {
9347
+ function createSegment(_x70) {
9177
9348
  return _createSegment.apply(this, arguments);
9178
9349
  }
9179
9350
 
@@ -9190,30 +9361,30 @@ var StreamChat = /*#__PURE__*/function () {
9190
9361
  }, {
9191
9362
  key: "getSegment",
9192
9363
  value: function () {
9193
- var _getSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee50(id) {
9364
+ var _getSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee52(id) {
9194
9365
  var _yield$this$get, segment;
9195
9366
 
9196
- return _regeneratorRuntime.wrap(function _callee50$(_context50) {
9367
+ return _regeneratorRuntime.wrap(function _callee52$(_context52) {
9197
9368
  while (1) {
9198
- switch (_context50.prev = _context50.next) {
9369
+ switch (_context52.prev = _context52.next) {
9199
9370
  case 0:
9200
- _context50.next = 2;
9371
+ _context52.next = 2;
9201
9372
  return this.get(this.baseURL + "/segments/".concat(id));
9202
9373
 
9203
9374
  case 2:
9204
- _yield$this$get = _context50.sent;
9375
+ _yield$this$get = _context52.sent;
9205
9376
  segment = _yield$this$get.segment;
9206
- return _context50.abrupt("return", segment);
9377
+ return _context52.abrupt("return", segment);
9207
9378
 
9208
9379
  case 5:
9209
9380
  case "end":
9210
- return _context50.stop();
9381
+ return _context52.stop();
9211
9382
  }
9212
9383
  }
9213
- }, _callee50, this);
9384
+ }, _callee52, this);
9214
9385
  }));
9215
9386
 
9216
- function getSegment(_x69) {
9387
+ function getSegment(_x71) {
9217
9388
  return _getSegment.apply(this, arguments);
9218
9389
  }
9219
9390
 
@@ -9229,30 +9400,30 @@ var StreamChat = /*#__PURE__*/function () {
9229
9400
  }, {
9230
9401
  key: "listSegments",
9231
9402
  value: function () {
9232
- var _listSegments = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee51(options) {
9403
+ var _listSegments = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee53(options) {
9233
9404
  var _yield$this$get2, segments;
9234
9405
 
9235
- return _regeneratorRuntime.wrap(function _callee51$(_context51) {
9406
+ return _regeneratorRuntime.wrap(function _callee53$(_context53) {
9236
9407
  while (1) {
9237
- switch (_context51.prev = _context51.next) {
9408
+ switch (_context53.prev = _context53.next) {
9238
9409
  case 0:
9239
- _context51.next = 2;
9410
+ _context53.next = 2;
9240
9411
  return this.get(this.baseURL + "/segments", options);
9241
9412
 
9242
9413
  case 2:
9243
- _yield$this$get2 = _context51.sent;
9414
+ _yield$this$get2 = _context53.sent;
9244
9415
  segments = _yield$this$get2.segments;
9245
- return _context51.abrupt("return", segments);
9416
+ return _context53.abrupt("return", segments);
9246
9417
 
9247
9418
  case 5:
9248
9419
  case "end":
9249
- return _context51.stop();
9420
+ return _context53.stop();
9250
9421
  }
9251
9422
  }
9252
- }, _callee51, this);
9423
+ }, _callee53, this);
9253
9424
  }));
9254
9425
 
9255
- function listSegments(_x70) {
9426
+ function listSegments(_x72) {
9256
9427
  return _listSegments.apply(this, arguments);
9257
9428
  }
9258
9429
 
@@ -9270,32 +9441,32 @@ var StreamChat = /*#__PURE__*/function () {
9270
9441
  }, {
9271
9442
  key: "updateSegment",
9272
9443
  value: function () {
9273
- var _updateSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee52(id, params) {
9444
+ var _updateSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee54(id, params) {
9274
9445
  var _yield$this$put, segment;
9275
9446
 
9276
- return _regeneratorRuntime.wrap(function _callee52$(_context52) {
9447
+ return _regeneratorRuntime.wrap(function _callee54$(_context54) {
9277
9448
  while (1) {
9278
- switch (_context52.prev = _context52.next) {
9449
+ switch (_context54.prev = _context54.next) {
9279
9450
  case 0:
9280
- _context52.next = 2;
9451
+ _context54.next = 2;
9281
9452
  return this.put(this.baseURL + "/segments/".concat(id), {
9282
9453
  segment: params
9283
9454
  });
9284
9455
 
9285
9456
  case 2:
9286
- _yield$this$put = _context52.sent;
9457
+ _yield$this$put = _context54.sent;
9287
9458
  segment = _yield$this$put.segment;
9288
- return _context52.abrupt("return", segment);
9459
+ return _context54.abrupt("return", segment);
9289
9460
 
9290
9461
  case 5:
9291
9462
  case "end":
9292
- return _context52.stop();
9463
+ return _context54.stop();
9293
9464
  }
9294
9465
  }
9295
- }, _callee52, this);
9466
+ }, _callee54, this);
9296
9467
  }));
9297
9468
 
9298
- function updateSegment(_x71, _x72) {
9469
+ function updateSegment(_x73, _x74) {
9299
9470
  return _updateSegment.apply(this, arguments);
9300
9471
  }
9301
9472
 
@@ -9312,22 +9483,22 @@ var StreamChat = /*#__PURE__*/function () {
9312
9483
  }, {
9313
9484
  key: "deleteSegment",
9314
9485
  value: function () {
9315
- var _deleteSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee53(id) {
9316
- return _regeneratorRuntime.wrap(function _callee53$(_context53) {
9486
+ var _deleteSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee55(id) {
9487
+ return _regeneratorRuntime.wrap(function _callee55$(_context55) {
9317
9488
  while (1) {
9318
- switch (_context53.prev = _context53.next) {
9489
+ switch (_context55.prev = _context55.next) {
9319
9490
  case 0:
9320
- return _context53.abrupt("return", this.delete(this.baseURL + "/segments/".concat(id)));
9491
+ return _context55.abrupt("return", this.delete(this.baseURL + "/segments/".concat(id)));
9321
9492
 
9322
9493
  case 1:
9323
9494
  case "end":
9324
- return _context53.stop();
9495
+ return _context55.stop();
9325
9496
  }
9326
9497
  }
9327
- }, _callee53, this);
9498
+ }, _callee55, this);
9328
9499
  }));
9329
9500
 
9330
- function deleteSegment(_x73) {
9501
+ function deleteSegment(_x75) {
9331
9502
  return _deleteSegment.apply(this, arguments);
9332
9503
  }
9333
9504
 
@@ -9344,32 +9515,32 @@ var StreamChat = /*#__PURE__*/function () {
9344
9515
  }, {
9345
9516
  key: "createCampaign",
9346
9517
  value: function () {
9347
- var _createCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee54(params) {
9518
+ var _createCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee56(params) {
9348
9519
  var _yield$this$post2, campaign;
9349
9520
 
9350
- return _regeneratorRuntime.wrap(function _callee54$(_context54) {
9521
+ return _regeneratorRuntime.wrap(function _callee56$(_context56) {
9351
9522
  while (1) {
9352
- switch (_context54.prev = _context54.next) {
9523
+ switch (_context56.prev = _context56.next) {
9353
9524
  case 0:
9354
- _context54.next = 2;
9525
+ _context56.next = 2;
9355
9526
  return this.post(this.baseURL + "/campaigns", {
9356
9527
  campaign: params
9357
9528
  });
9358
9529
 
9359
9530
  case 2:
9360
- _yield$this$post2 = _context54.sent;
9531
+ _yield$this$post2 = _context56.sent;
9361
9532
  campaign = _yield$this$post2.campaign;
9362
- return _context54.abrupt("return", campaign);
9533
+ return _context56.abrupt("return", campaign);
9363
9534
 
9364
9535
  case 5:
9365
9536
  case "end":
9366
- return _context54.stop();
9537
+ return _context56.stop();
9367
9538
  }
9368
9539
  }
9369
- }, _callee54, this);
9540
+ }, _callee56, this);
9370
9541
  }));
9371
9542
 
9372
- function createCampaign(_x74) {
9543
+ function createCampaign(_x76) {
9373
9544
  return _createCampaign.apply(this, arguments);
9374
9545
  }
9375
9546
 
@@ -9386,30 +9557,30 @@ var StreamChat = /*#__PURE__*/function () {
9386
9557
  }, {
9387
9558
  key: "getCampaign",
9388
9559
  value: function () {
9389
- var _getCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee55(id) {
9560
+ var _getCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee57(id) {
9390
9561
  var _yield$this$get3, campaign;
9391
9562
 
9392
- return _regeneratorRuntime.wrap(function _callee55$(_context55) {
9563
+ return _regeneratorRuntime.wrap(function _callee57$(_context57) {
9393
9564
  while (1) {
9394
- switch (_context55.prev = _context55.next) {
9565
+ switch (_context57.prev = _context57.next) {
9395
9566
  case 0:
9396
- _context55.next = 2;
9567
+ _context57.next = 2;
9397
9568
  return this.get(this.baseURL + "/campaigns/".concat(id));
9398
9569
 
9399
9570
  case 2:
9400
- _yield$this$get3 = _context55.sent;
9571
+ _yield$this$get3 = _context57.sent;
9401
9572
  campaign = _yield$this$get3.campaign;
9402
- return _context55.abrupt("return", campaign);
9573
+ return _context57.abrupt("return", campaign);
9403
9574
 
9404
9575
  case 5:
9405
9576
  case "end":
9406
- return _context55.stop();
9577
+ return _context57.stop();
9407
9578
  }
9408
9579
  }
9409
- }, _callee55, this);
9580
+ }, _callee57, this);
9410
9581
  }));
9411
9582
 
9412
- function getCampaign(_x75) {
9583
+ function getCampaign(_x77) {
9413
9584
  return _getCampaign.apply(this, arguments);
9414
9585
  }
9415
9586
 
@@ -9425,30 +9596,30 @@ var StreamChat = /*#__PURE__*/function () {
9425
9596
  }, {
9426
9597
  key: "listCampaigns",
9427
9598
  value: function () {
9428
- var _listCampaigns = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee56(options) {
9599
+ var _listCampaigns = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee58(options) {
9429
9600
  var _yield$this$get4, campaigns;
9430
9601
 
9431
- return _regeneratorRuntime.wrap(function _callee56$(_context56) {
9602
+ return _regeneratorRuntime.wrap(function _callee58$(_context58) {
9432
9603
  while (1) {
9433
- switch (_context56.prev = _context56.next) {
9604
+ switch (_context58.prev = _context58.next) {
9434
9605
  case 0:
9435
- _context56.next = 2;
9606
+ _context58.next = 2;
9436
9607
  return this.get(this.baseURL + "/campaigns", options);
9437
9608
 
9438
9609
  case 2:
9439
- _yield$this$get4 = _context56.sent;
9610
+ _yield$this$get4 = _context58.sent;
9440
9611
  campaigns = _yield$this$get4.campaigns;
9441
- return _context56.abrupt("return", campaigns);
9612
+ return _context58.abrupt("return", campaigns);
9442
9613
 
9443
9614
  case 5:
9444
9615
  case "end":
9445
- return _context56.stop();
9616
+ return _context58.stop();
9446
9617
  }
9447
9618
  }
9448
- }, _callee56, this);
9619
+ }, _callee58, this);
9449
9620
  }));
9450
9621
 
9451
- function listCampaigns(_x76) {
9622
+ function listCampaigns(_x78) {
9452
9623
  return _listCampaigns.apply(this, arguments);
9453
9624
  }
9454
9625
 
@@ -9466,32 +9637,32 @@ var StreamChat = /*#__PURE__*/function () {
9466
9637
  }, {
9467
9638
  key: "updateCampaign",
9468
9639
  value: function () {
9469
- var _updateCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee57(id, params) {
9640
+ var _updateCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee59(id, params) {
9470
9641
  var _yield$this$put2, campaign;
9471
9642
 
9472
- return _regeneratorRuntime.wrap(function _callee57$(_context57) {
9643
+ return _regeneratorRuntime.wrap(function _callee59$(_context59) {
9473
9644
  while (1) {
9474
- switch (_context57.prev = _context57.next) {
9645
+ switch (_context59.prev = _context59.next) {
9475
9646
  case 0:
9476
- _context57.next = 2;
9647
+ _context59.next = 2;
9477
9648
  return this.put(this.baseURL + "/campaigns/".concat(id), {
9478
9649
  campaign: params
9479
9650
  });
9480
9651
 
9481
9652
  case 2:
9482
- _yield$this$put2 = _context57.sent;
9653
+ _yield$this$put2 = _context59.sent;
9483
9654
  campaign = _yield$this$put2.campaign;
9484
- return _context57.abrupt("return", campaign);
9655
+ return _context59.abrupt("return", campaign);
9485
9656
 
9486
9657
  case 5:
9487
9658
  case "end":
9488
- return _context57.stop();
9659
+ return _context59.stop();
9489
9660
  }
9490
9661
  }
9491
- }, _callee57, this);
9662
+ }, _callee59, this);
9492
9663
  }));
9493
9664
 
9494
- function updateCampaign(_x77, _x78) {
9665
+ function updateCampaign(_x79, _x80) {
9495
9666
  return _updateCampaign.apply(this, arguments);
9496
9667
  }
9497
9668
 
@@ -9508,22 +9679,22 @@ var StreamChat = /*#__PURE__*/function () {
9508
9679
  }, {
9509
9680
  key: "deleteCampaign",
9510
9681
  value: function () {
9511
- var _deleteCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee58(id) {
9512
- return _regeneratorRuntime.wrap(function _callee58$(_context58) {
9682
+ var _deleteCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee60(id) {
9683
+ return _regeneratorRuntime.wrap(function _callee60$(_context60) {
9513
9684
  while (1) {
9514
- switch (_context58.prev = _context58.next) {
9685
+ switch (_context60.prev = _context60.next) {
9515
9686
  case 0:
9516
- return _context58.abrupt("return", this.delete(this.baseURL + "/campaigns/".concat(id)));
9687
+ return _context60.abrupt("return", this.delete(this.baseURL + "/campaigns/".concat(id)));
9517
9688
 
9518
9689
  case 1:
9519
9690
  case "end":
9520
- return _context58.stop();
9691
+ return _context60.stop();
9521
9692
  }
9522
9693
  }
9523
- }, _callee58, this);
9694
+ }, _callee60, this);
9524
9695
  }));
9525
9696
 
9526
- function deleteCampaign(_x79) {
9697
+ function deleteCampaign(_x81) {
9527
9698
  return _deleteCampaign.apply(this, arguments);
9528
9699
  }
9529
9700
 
@@ -9541,33 +9712,33 @@ var StreamChat = /*#__PURE__*/function () {
9541
9712
  }, {
9542
9713
  key: "scheduleCampaign",
9543
9714
  value: function () {
9544
- var _scheduleCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee59(id, params) {
9715
+ var _scheduleCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee61(id, params) {
9545
9716
  var sendAt, _yield$this$patch, campaign;
9546
9717
 
9547
- return _regeneratorRuntime.wrap(function _callee59$(_context59) {
9718
+ return _regeneratorRuntime.wrap(function _callee61$(_context61) {
9548
9719
  while (1) {
9549
- switch (_context59.prev = _context59.next) {
9720
+ switch (_context61.prev = _context61.next) {
9550
9721
  case 0:
9551
9722
  sendAt = params.sendAt;
9552
- _context59.next = 3;
9723
+ _context61.next = 3;
9553
9724
  return this.patch(this.baseURL + "/campaigns/".concat(id, "/schedule"), {
9554
9725
  send_at: sendAt
9555
9726
  });
9556
9727
 
9557
9728
  case 3:
9558
- _yield$this$patch = _context59.sent;
9729
+ _yield$this$patch = _context61.sent;
9559
9730
  campaign = _yield$this$patch.campaign;
9560
- return _context59.abrupt("return", campaign);
9731
+ return _context61.abrupt("return", campaign);
9561
9732
 
9562
9733
  case 6:
9563
9734
  case "end":
9564
- return _context59.stop();
9735
+ return _context61.stop();
9565
9736
  }
9566
9737
  }
9567
- }, _callee59, this);
9738
+ }, _callee61, this);
9568
9739
  }));
9569
9740
 
9570
- function scheduleCampaign(_x80, _x81) {
9741
+ function scheduleCampaign(_x82, _x83) {
9571
9742
  return _scheduleCampaign.apply(this, arguments);
9572
9743
  }
9573
9744
 
@@ -9584,30 +9755,30 @@ var StreamChat = /*#__PURE__*/function () {
9584
9755
  }, {
9585
9756
  key: "stopCampaign",
9586
9757
  value: function () {
9587
- var _stopCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee60(id) {
9758
+ var _stopCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee62(id) {
9588
9759
  var _yield$this$patch2, campaign;
9589
9760
 
9590
- return _regeneratorRuntime.wrap(function _callee60$(_context60) {
9761
+ return _regeneratorRuntime.wrap(function _callee62$(_context62) {
9591
9762
  while (1) {
9592
- switch (_context60.prev = _context60.next) {
9763
+ switch (_context62.prev = _context62.next) {
9593
9764
  case 0:
9594
- _context60.next = 2;
9765
+ _context62.next = 2;
9595
9766
  return this.patch(this.baseURL + "/campaigns/".concat(id, "/stop"));
9596
9767
 
9597
9768
  case 2:
9598
- _yield$this$patch2 = _context60.sent;
9769
+ _yield$this$patch2 = _context62.sent;
9599
9770
  campaign = _yield$this$patch2.campaign;
9600
- return _context60.abrupt("return", campaign);
9771
+ return _context62.abrupt("return", campaign);
9601
9772
 
9602
9773
  case 5:
9603
9774
  case "end":
9604
- return _context60.stop();
9775
+ return _context62.stop();
9605
9776
  }
9606
9777
  }
9607
- }, _callee60, this);
9778
+ }, _callee62, this);
9608
9779
  }));
9609
9780
 
9610
- function stopCampaign(_x82) {
9781
+ function stopCampaign(_x84) {
9611
9782
  return _stopCampaign.apply(this, arguments);
9612
9783
  }
9613
9784
 
@@ -9624,30 +9795,30 @@ var StreamChat = /*#__PURE__*/function () {
9624
9795
  }, {
9625
9796
  key: "resumeCampaign",
9626
9797
  value: function () {
9627
- var _resumeCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee61(id) {
9798
+ var _resumeCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee63(id) {
9628
9799
  var _yield$this$patch3, campaign;
9629
9800
 
9630
- return _regeneratorRuntime.wrap(function _callee61$(_context61) {
9801
+ return _regeneratorRuntime.wrap(function _callee63$(_context63) {
9631
9802
  while (1) {
9632
- switch (_context61.prev = _context61.next) {
9803
+ switch (_context63.prev = _context63.next) {
9633
9804
  case 0:
9634
- _context61.next = 2;
9805
+ _context63.next = 2;
9635
9806
  return this.patch(this.baseURL + "/campaigns/".concat(id, "/resume"));
9636
9807
 
9637
9808
  case 2:
9638
- _yield$this$patch3 = _context61.sent;
9809
+ _yield$this$patch3 = _context63.sent;
9639
9810
  campaign = _yield$this$patch3.campaign;
9640
- return _context61.abrupt("return", campaign);
9811
+ return _context63.abrupt("return", campaign);
9641
9812
 
9642
9813
  case 5:
9643
9814
  case "end":
9644
- return _context61.stop();
9815
+ return _context63.stop();
9645
9816
  }
9646
9817
  }
9647
- }, _callee61, this);
9818
+ }, _callee63, this);
9648
9819
  }));
9649
9820
 
9650
- function resumeCampaign(_x83) {
9821
+ function resumeCampaign(_x85) {
9651
9822
  return _resumeCampaign.apply(this, arguments);
9652
9823
  }
9653
9824
 
@@ -9664,33 +9835,33 @@ var StreamChat = /*#__PURE__*/function () {
9664
9835
  }, {
9665
9836
  key: "testCampaign",
9666
9837
  value: function () {
9667
- var _testCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee62(id, params) {
9838
+ var _testCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee64(id, params) {
9668
9839
  var users, _yield$this$post3, campaign;
9669
9840
 
9670
- return _regeneratorRuntime.wrap(function _callee62$(_context62) {
9841
+ return _regeneratorRuntime.wrap(function _callee64$(_context64) {
9671
9842
  while (1) {
9672
- switch (_context62.prev = _context62.next) {
9843
+ switch (_context64.prev = _context64.next) {
9673
9844
  case 0:
9674
9845
  users = params.users;
9675
- _context62.next = 3;
9846
+ _context64.next = 3;
9676
9847
  return this.post(this.baseURL + "/campaigns/".concat(id, "/test"), {
9677
9848
  users: users
9678
9849
  });
9679
9850
 
9680
9851
  case 3:
9681
- _yield$this$post3 = _context62.sent;
9852
+ _yield$this$post3 = _context64.sent;
9682
9853
  campaign = _yield$this$post3.campaign;
9683
- return _context62.abrupt("return", campaign);
9854
+ return _context64.abrupt("return", campaign);
9684
9855
 
9685
9856
  case 6:
9686
9857
  case "end":
9687
- return _context62.stop();
9858
+ return _context64.stop();
9688
9859
  }
9689
9860
  }
9690
- }, _callee62, this);
9861
+ }, _callee64, this);
9691
9862
  }));
9692
9863
 
9693
- function testCampaign(_x84, _x85) {
9864
+ function testCampaign(_x86, _x87) {
9694
9865
  return _testCampaign.apply(this, arguments);
9695
9866
  }
9696
9867
 
@@ -9706,24 +9877,24 @@ var StreamChat = /*#__PURE__*/function () {
9706
9877
  }, {
9707
9878
  key: "enrichURL",
9708
9879
  value: function () {
9709
- var _enrichURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee63(url) {
9710
- return _regeneratorRuntime.wrap(function _callee63$(_context63) {
9880
+ var _enrichURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee65(url) {
9881
+ return _regeneratorRuntime.wrap(function _callee65$(_context65) {
9711
9882
  while (1) {
9712
- switch (_context63.prev = _context63.next) {
9883
+ switch (_context65.prev = _context65.next) {
9713
9884
  case 0:
9714
- return _context63.abrupt("return", this.get(this.baseURL + "/og", {
9885
+ return _context65.abrupt("return", this.get(this.baseURL + "/og", {
9715
9886
  url: url
9716
9887
  }));
9717
9888
 
9718
9889
  case 1:
9719
9890
  case "end":
9720
- return _context63.stop();
9891
+ return _context65.stop();
9721
9892
  }
9722
9893
  }
9723
- }, _callee63, this);
9894
+ }, _callee65, this);
9724
9895
  }));
9725
9896
 
9726
- function enrichURL(_x86) {
9897
+ function enrichURL(_x88) {
9727
9898
  return _enrichURL.apply(this, arguments);
9728
9899
  }
9729
9900
 
@@ -9740,22 +9911,22 @@ var StreamChat = /*#__PURE__*/function () {
9740
9911
  }, {
9741
9912
  key: "getTask",
9742
9913
  value: function () {
9743
- var _getTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee64(id) {
9744
- return _regeneratorRuntime.wrap(function _callee64$(_context64) {
9914
+ var _getTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee66(id) {
9915
+ return _regeneratorRuntime.wrap(function _callee66$(_context66) {
9745
9916
  while (1) {
9746
- switch (_context64.prev = _context64.next) {
9917
+ switch (_context66.prev = _context66.next) {
9747
9918
  case 0:
9748
- return _context64.abrupt("return", this.get("".concat(this.baseURL, "/tasks/").concat(id)));
9919
+ return _context66.abrupt("return", this.get("".concat(this.baseURL, "/tasks/").concat(id)));
9749
9920
 
9750
9921
  case 1:
9751
9922
  case "end":
9752
- return _context64.stop();
9923
+ return _context66.stop();
9753
9924
  }
9754
9925
  }
9755
- }, _callee64, this);
9926
+ }, _callee66, this);
9756
9927
  }));
9757
9928
 
9758
- function getTask(_x87) {
9929
+ function getTask(_x89) {
9759
9930
  return _getTask.apply(this, arguments);
9760
9931
  }
9761
9932
 
@@ -9773,31 +9944,31 @@ var StreamChat = /*#__PURE__*/function () {
9773
9944
  }, {
9774
9945
  key: "deleteChannels",
9775
9946
  value: function () {
9776
- var _deleteChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee65(cids) {
9947
+ var _deleteChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee67(cids) {
9777
9948
  var options,
9778
- _args65 = arguments;
9779
- return _regeneratorRuntime.wrap(function _callee65$(_context65) {
9949
+ _args67 = arguments;
9950
+ return _regeneratorRuntime.wrap(function _callee67$(_context67) {
9780
9951
  while (1) {
9781
- switch (_context65.prev = _context65.next) {
9952
+ switch (_context67.prev = _context67.next) {
9782
9953
  case 0:
9783
- options = _args65.length > 1 && _args65[1] !== undefined ? _args65[1] : {};
9784
- _context65.next = 3;
9954
+ options = _args67.length > 1 && _args67[1] !== undefined ? _args67[1] : {};
9955
+ _context67.next = 3;
9785
9956
  return this.post(this.baseURL + "/channels/delete", _objectSpread({
9786
9957
  cids: cids
9787
9958
  }, options));
9788
9959
 
9789
9960
  case 3:
9790
- return _context65.abrupt("return", _context65.sent);
9961
+ return _context67.abrupt("return", _context67.sent);
9791
9962
 
9792
9963
  case 4:
9793
9964
  case "end":
9794
- return _context65.stop();
9965
+ return _context67.stop();
9795
9966
  }
9796
9967
  }
9797
- }, _callee65, this);
9968
+ }, _callee67, this);
9798
9969
  }));
9799
9970
 
9800
- function deleteChannels(_x88) {
9971
+ function deleteChannels(_x90) {
9801
9972
  return _deleteChannels.apply(this, arguments);
9802
9973
  }
9803
9974
 
@@ -9815,13 +9986,13 @@ var StreamChat = /*#__PURE__*/function () {
9815
9986
  }, {
9816
9987
  key: "deleteUsers",
9817
9988
  value: function () {
9818
- var _deleteUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee66(user_ids, options) {
9819
- return _regeneratorRuntime.wrap(function _callee66$(_context66) {
9989
+ var _deleteUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee68(user_ids, options) {
9990
+ return _regeneratorRuntime.wrap(function _callee68$(_context68) {
9820
9991
  while (1) {
9821
- switch (_context66.prev = _context66.next) {
9992
+ switch (_context68.prev = _context68.next) {
9822
9993
  case 0:
9823
9994
  if (!((options === null || options === void 0 ? void 0 : options.user) !== 'soft' && (options === null || options === void 0 ? void 0 : options.user) !== 'hard')) {
9824
- _context66.next = 2;
9995
+ _context68.next = 2;
9825
9996
  break;
9826
9997
  }
9827
9998
 
@@ -9829,7 +10000,7 @@ var StreamChat = /*#__PURE__*/function () {
9829
10000
 
9830
10001
  case 2:
9831
10002
  if (!(options.messages !== undefined && options.messages !== 'soft' && options.messages !== 'hard')) {
9832
- _context66.next = 4;
10003
+ _context68.next = 4;
9833
10004
  break;
9834
10005
  }
9835
10006
 
@@ -9837,30 +10008,30 @@ var StreamChat = /*#__PURE__*/function () {
9837
10008
 
9838
10009
  case 4:
9839
10010
  if (!(options.conversations !== undefined && options.conversations !== 'soft' && options.conversations !== 'hard')) {
9840
- _context66.next = 6;
10011
+ _context68.next = 6;
9841
10012
  break;
9842
10013
  }
9843
10014
 
9844
10015
  throw new Error('Invalid delete user options. conversations must be one of [soft hard]');
9845
10016
 
9846
10017
  case 6:
9847
- _context66.next = 8;
10018
+ _context68.next = 8;
9848
10019
  return this.post(this.baseURL + "/users/delete", _objectSpread({
9849
10020
  user_ids: user_ids
9850
10021
  }, options));
9851
10022
 
9852
10023
  case 8:
9853
- return _context66.abrupt("return", _context66.sent);
10024
+ return _context68.abrupt("return", _context68.sent);
9854
10025
 
9855
10026
  case 9:
9856
10027
  case "end":
9857
- return _context66.stop();
10028
+ return _context68.stop();
9858
10029
  }
9859
10030
  }
9860
- }, _callee66, this);
10031
+ }, _callee68, this);
9861
10032
  }));
9862
10033
 
9863
- function deleteUsers(_x89, _x90) {
10034
+ function deleteUsers(_x91, _x92) {
9864
10035
  return _deleteUsers.apply(this, arguments);
9865
10036
  }
9866
10037