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