stream-chat 8.59.0 → 8.61.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -4,10 +4,10 @@ import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
4
4
  import _createClass from '@babel/runtime/helpers/createClass';
5
5
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
6
6
  import _regeneratorRuntime from '@babel/runtime/regenerator';
7
- import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
8
7
  import _extends from '@babel/runtime/helpers/extends';
9
8
  import _typeof from '@babel/runtime/helpers/typeof';
10
9
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
10
+ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
11
11
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
12
12
  import axios from 'axios';
13
13
  import https from 'https';
@@ -2738,6 +2738,50 @@ var Channel = /*#__PURE__*/function () {
2738
2738
  return queryMembers;
2739
2739
  }()
2740
2740
  /**
2741
+ * updateMemberPartial - Partial update a member
2742
+ *
2743
+ * @param {PartialUpdateMember<StreamChatGenerics>} updates
2744
+ * @param {{ user_id?: string }} [options] Option object, {user_id: 'jane'} to optionally specify the user id
2745
+ * @return {Promise<ChannelMemberResponse<StreamChatGenerics>>} Updated member
2746
+ */
2747
+
2748
+ }, {
2749
+ key: "updateMemberPartial",
2750
+ value: function () {
2751
+ var _updateMemberPartial = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(updates, options) {
2752
+ var url;
2753
+ return _regeneratorRuntime.wrap(function _callee6$(_context6) {
2754
+ while (1) {
2755
+ switch (_context6.prev = _context6.next) {
2756
+ case 0:
2757
+ url = new URL("".concat(this._channelURL(), "/member"));
2758
+
2759
+ if (options !== null && options !== void 0 && options.userId) {
2760
+ url.searchParams.append('user_id', options.userId);
2761
+ }
2762
+
2763
+ _context6.next = 4;
2764
+ return this.getClient().patch(url.toString(), updates);
2765
+
2766
+ case 4:
2767
+ return _context6.abrupt("return", _context6.sent);
2768
+
2769
+ case 5:
2770
+ case "end":
2771
+ return _context6.stop();
2772
+ }
2773
+ }
2774
+ }, _callee6, this);
2775
+ }));
2776
+
2777
+ function updateMemberPartial(_x7, _x8) {
2778
+ return _updateMemberPartial.apply(this, arguments);
2779
+ }
2780
+
2781
+ return updateMemberPartial;
2782
+ }()
2783
+ /**
2784
+ * @deprecated Use `updateMemberPartial` instead
2741
2785
  * partialUpdateMember - Partial update a member
2742
2786
  *
2743
2787
  * @param {string} user_id member user id
@@ -2749,34 +2793,34 @@ var Channel = /*#__PURE__*/function () {
2749
2793
  }, {
2750
2794
  key: "partialUpdateMember",
2751
2795
  value: function () {
2752
- var _partialUpdateMember = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(user_id, updates) {
2753
- return _regeneratorRuntime.wrap(function _callee6$(_context6) {
2796
+ var _partialUpdateMember = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(user_id, updates) {
2797
+ return _regeneratorRuntime.wrap(function _callee7$(_context7) {
2754
2798
  while (1) {
2755
- switch (_context6.prev = _context6.next) {
2799
+ switch (_context7.prev = _context7.next) {
2756
2800
  case 0:
2757
2801
  if (user_id) {
2758
- _context6.next = 2;
2802
+ _context7.next = 2;
2759
2803
  break;
2760
2804
  }
2761
2805
 
2762
2806
  throw Error('Please specify the user id');
2763
2807
 
2764
2808
  case 2:
2765
- _context6.next = 4;
2809
+ _context7.next = 4;
2766
2810
  return this.getClient().patch(this._channelURL() + "/member/".concat(encodeURIComponent(user_id)), updates);
2767
2811
 
2768
2812
  case 4:
2769
- return _context6.abrupt("return", _context6.sent);
2813
+ return _context7.abrupt("return", _context7.sent);
2770
2814
 
2771
2815
  case 5:
2772
2816
  case "end":
2773
- return _context6.stop();
2817
+ return _context7.stop();
2774
2818
  }
2775
2819
  }
2776
- }, _callee6, this);
2820
+ }, _callee7, this);
2777
2821
  }));
2778
2822
 
2779
- function partialUpdateMember(_x7, _x8) {
2823
+ function partialUpdateMember(_x9, _x10) {
2780
2824
  return _partialUpdateMember.apply(this, arguments);
2781
2825
  }
2782
2826
 
@@ -2795,13 +2839,13 @@ var Channel = /*#__PURE__*/function () {
2795
2839
  }, {
2796
2840
  key: "sendReaction",
2797
2841
  value: function () {
2798
- var _sendReaction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(messageID, reaction, options) {
2799
- return _regeneratorRuntime.wrap(function _callee7$(_context7) {
2842
+ var _sendReaction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(messageID, reaction, options) {
2843
+ return _regeneratorRuntime.wrap(function _callee8$(_context8) {
2800
2844
  while (1) {
2801
- switch (_context7.prev = _context7.next) {
2845
+ switch (_context8.prev = _context8.next) {
2802
2846
  case 0:
2803
2847
  if (messageID) {
2804
- _context7.next = 2;
2848
+ _context8.next = 2;
2805
2849
  break;
2806
2850
  }
2807
2851
 
@@ -2809,30 +2853,30 @@ var Channel = /*#__PURE__*/function () {
2809
2853
 
2810
2854
  case 2:
2811
2855
  if (!(!reaction || Object.keys(reaction).length === 0)) {
2812
- _context7.next = 4;
2856
+ _context8.next = 4;
2813
2857
  break;
2814
2858
  }
2815
2859
 
2816
2860
  throw Error("Reaction object is missing");
2817
2861
 
2818
2862
  case 4:
2819
- _context7.next = 6;
2863
+ _context8.next = 6;
2820
2864
  return this.getClient().post(this.getClient().baseURL + "/messages/".concat(encodeURIComponent(messageID), "/reaction"), _objectSpread$c({
2821
2865
  reaction: reaction
2822
2866
  }, options));
2823
2867
 
2824
2868
  case 6:
2825
- return _context7.abrupt("return", _context7.sent);
2869
+ return _context8.abrupt("return", _context8.sent);
2826
2870
 
2827
2871
  case 7:
2828
2872
  case "end":
2829
- return _context7.stop();
2873
+ return _context8.stop();
2830
2874
  }
2831
2875
  }
2832
- }, _callee7, this);
2876
+ }, _callee8, this);
2833
2877
  }));
2834
2878
 
2835
- function sendReaction(_x9, _x10, _x11) {
2879
+ function sendReaction(_x11, _x12, _x13) {
2836
2880
  return _sendReaction.apply(this, arguments);
2837
2881
  }
2838
2882
 
@@ -2879,39 +2923,39 @@ var Channel = /*#__PURE__*/function () {
2879
2923
  }, {
2880
2924
  key: "update",
2881
2925
  value: function () {
2882
- var _update2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
2926
+ var _update2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
2883
2927
  var channelData,
2884
2928
  updateMessage,
2885
2929
  options,
2886
2930
  reserved,
2887
- _args8 = arguments;
2888
- return _regeneratorRuntime.wrap(function _callee8$(_context8) {
2931
+ _args9 = arguments;
2932
+ return _regeneratorRuntime.wrap(function _callee9$(_context9) {
2889
2933
  while (1) {
2890
- switch (_context8.prev = _context8.next) {
2934
+ switch (_context9.prev = _context9.next) {
2891
2935
  case 0:
2892
- channelData = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {};
2893
- updateMessage = _args8.length > 1 ? _args8[1] : undefined;
2894
- options = _args8.length > 2 ? _args8[2] : undefined;
2936
+ channelData = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : {};
2937
+ updateMessage = _args9.length > 1 ? _args9[1] : undefined;
2938
+ options = _args9.length > 2 ? _args9[2] : undefined;
2895
2939
  // Strip out reserved names that will result in API errors.
2896
2940
  reserved = ['config', 'cid', 'created_by', 'id', 'member_count', 'type', 'created_at', 'updated_at', 'last_message_at', 'own_capabilities'];
2897
2941
  reserved.forEach(function (key) {
2898
2942
  delete channelData[key];
2899
2943
  });
2900
- _context8.next = 7;
2944
+ _context9.next = 7;
2901
2945
  return this._update(_objectSpread$c({
2902
2946
  message: updateMessage,
2903
2947
  data: channelData
2904
2948
  }, options));
2905
2949
 
2906
2950
  case 7:
2907
- return _context8.abrupt("return", _context8.sent);
2951
+ return _context9.abrupt("return", _context9.sent);
2908
2952
 
2909
2953
  case 8:
2910
2954
  case "end":
2911
- return _context8.stop();
2955
+ return _context9.stop();
2912
2956
  }
2913
2957
  }
2914
- }, _callee8, this);
2958
+ }, _callee9, this);
2915
2959
  }));
2916
2960
 
2917
2961
  function update() {
@@ -2931,19 +2975,19 @@ var Channel = /*#__PURE__*/function () {
2931
2975
  }, {
2932
2976
  key: "updatePartial",
2933
2977
  value: function () {
2934
- var _updatePartial = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(update) {
2978
+ var _updatePartial = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(update) {
2935
2979
  var _this$data2, _this$data3;
2936
2980
 
2937
2981
  var data, areCapabilitiesChanged;
2938
- return _regeneratorRuntime.wrap(function _callee9$(_context9) {
2982
+ return _regeneratorRuntime.wrap(function _callee10$(_context10) {
2939
2983
  while (1) {
2940
- switch (_context9.prev = _context9.next) {
2984
+ switch (_context10.prev = _context10.next) {
2941
2985
  case 0:
2942
- _context9.next = 2;
2986
+ _context10.next = 2;
2943
2987
  return this.getClient().patch(this._channelURL(), update);
2944
2988
 
2945
2989
  case 2:
2946
- data = _context9.sent;
2990
+ data = _context10.sent;
2947
2991
  areCapabilitiesChanged = _toConsumableArray(data.channel.own_capabilities || []).sort().join() !== _toConsumableArray(Array.isArray((_this$data2 = this.data) === null || _this$data2 === void 0 ? void 0 : _this$data2.own_capabilities) ? (_this$data3 = this.data) === null || _this$data3 === void 0 ? void 0 : _this$data3.own_capabilities : []).sort().join();
2948
2992
  this.data = data.channel; // If the capabiltities are changed, we trigger the `capabilities.changed` event.
2949
2993
 
@@ -2955,17 +2999,17 @@ var Channel = /*#__PURE__*/function () {
2955
2999
  });
2956
3000
  }
2957
3001
 
2958
- return _context9.abrupt("return", data);
3002
+ return _context10.abrupt("return", data);
2959
3003
 
2960
3004
  case 7:
2961
3005
  case "end":
2962
- return _context9.stop();
3006
+ return _context10.stop();
2963
3007
  }
2964
3008
  }
2965
- }, _callee9, this);
3009
+ }, _callee10, this);
2966
3010
  }));
2967
3011
 
2968
- function updatePartial(_x12) {
3012
+ function updatePartial(_x14) {
2969
3013
  return _updatePartial.apply(this, arguments);
2970
3014
  }
2971
3015
 
@@ -2981,31 +3025,31 @@ var Channel = /*#__PURE__*/function () {
2981
3025
  }, {
2982
3026
  key: "enableSlowMode",
2983
3027
  value: function () {
2984
- var _enableSlowMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(coolDownInterval) {
3028
+ var _enableSlowMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(coolDownInterval) {
2985
3029
  var data;
2986
- return _regeneratorRuntime.wrap(function _callee10$(_context10) {
3030
+ return _regeneratorRuntime.wrap(function _callee11$(_context11) {
2987
3031
  while (1) {
2988
- switch (_context10.prev = _context10.next) {
3032
+ switch (_context11.prev = _context11.next) {
2989
3033
  case 0:
2990
- _context10.next = 2;
3034
+ _context11.next = 2;
2991
3035
  return this.getClient().post(this._channelURL(), {
2992
3036
  cooldown: coolDownInterval
2993
3037
  });
2994
3038
 
2995
3039
  case 2:
2996
- data = _context10.sent;
3040
+ data = _context11.sent;
2997
3041
  this.data = data.channel;
2998
- return _context10.abrupt("return", data);
3042
+ return _context11.abrupt("return", data);
2999
3043
 
3000
3044
  case 5:
3001
3045
  case "end":
3002
- return _context10.stop();
3046
+ return _context11.stop();
3003
3047
  }
3004
3048
  }
3005
- }, _callee10, this);
3049
+ }, _callee11, this);
3006
3050
  }));
3007
3051
 
3008
- function enableSlowMode(_x13) {
3052
+ function enableSlowMode(_x15) {
3009
3053
  return _enableSlowMode.apply(this, arguments);
3010
3054
  }
3011
3055
 
@@ -3020,28 +3064,28 @@ var Channel = /*#__PURE__*/function () {
3020
3064
  }, {
3021
3065
  key: "disableSlowMode",
3022
3066
  value: function () {
3023
- var _disableSlowMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {
3067
+ var _disableSlowMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
3024
3068
  var data;
3025
- return _regeneratorRuntime.wrap(function _callee11$(_context11) {
3069
+ return _regeneratorRuntime.wrap(function _callee12$(_context12) {
3026
3070
  while (1) {
3027
- switch (_context11.prev = _context11.next) {
3071
+ switch (_context12.prev = _context12.next) {
3028
3072
  case 0:
3029
- _context11.next = 2;
3073
+ _context12.next = 2;
3030
3074
  return this.getClient().post(this._channelURL(), {
3031
3075
  cooldown: 0
3032
3076
  });
3033
3077
 
3034
3078
  case 2:
3035
- data = _context11.sent;
3079
+ data = _context12.sent;
3036
3080
  this.data = data.channel;
3037
- return _context11.abrupt("return", data);
3081
+ return _context12.abrupt("return", data);
3038
3082
 
3039
3083
  case 5:
3040
3084
  case "end":
3041
- return _context11.stop();
3085
+ return _context12.stop();
3042
3086
  }
3043
3087
  }
3044
- }, _callee11, this);
3088
+ }, _callee12, this);
3045
3089
  }));
3046
3090
 
3047
3091
  function disableSlowMode() {
@@ -3061,26 +3105,26 @@ var Channel = /*#__PURE__*/function () {
3061
3105
  }, {
3062
3106
  key: "delete",
3063
3107
  value: function () {
3064
- var _delete2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
3108
+ var _delete2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13() {
3065
3109
  var options,
3066
- _args12 = arguments;
3067
- return _regeneratorRuntime.wrap(function _callee12$(_context12) {
3110
+ _args13 = arguments;
3111
+ return _regeneratorRuntime.wrap(function _callee13$(_context13) {
3068
3112
  while (1) {
3069
- switch (_context12.prev = _context12.next) {
3113
+ switch (_context13.prev = _context13.next) {
3070
3114
  case 0:
3071
- options = _args12.length > 0 && _args12[0] !== undefined ? _args12[0] : {};
3072
- _context12.next = 3;
3115
+ options = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : {};
3116
+ _context13.next = 3;
3073
3117
  return this.getClient().delete(this._channelURL(), _objectSpread$c({}, options));
3074
3118
 
3075
3119
  case 3:
3076
- return _context12.abrupt("return", _context12.sent);
3120
+ return _context13.abrupt("return", _context13.sent);
3077
3121
 
3078
3122
  case 4:
3079
3123
  case "end":
3080
- return _context12.stop();
3124
+ return _context13.stop();
3081
3125
  }
3082
3126
  }
3083
- }, _callee12, this);
3127
+ }, _callee13, this);
3084
3128
  }));
3085
3129
 
3086
3130
  function _delete() {
@@ -3098,26 +3142,26 @@ var Channel = /*#__PURE__*/function () {
3098
3142
  }, {
3099
3143
  key: "truncate",
3100
3144
  value: function () {
3101
- var _truncate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13() {
3145
+ var _truncate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
3102
3146
  var options,
3103
- _args13 = arguments;
3104
- return _regeneratorRuntime.wrap(function _callee13$(_context13) {
3147
+ _args14 = arguments;
3148
+ return _regeneratorRuntime.wrap(function _callee14$(_context14) {
3105
3149
  while (1) {
3106
- switch (_context13.prev = _context13.next) {
3150
+ switch (_context14.prev = _context14.next) {
3107
3151
  case 0:
3108
- options = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : {};
3109
- _context13.next = 3;
3152
+ options = _args14.length > 0 && _args14[0] !== undefined ? _args14[0] : {};
3153
+ _context14.next = 3;
3110
3154
  return this.getClient().post(this._channelURL() + '/truncate', options);
3111
3155
 
3112
3156
  case 3:
3113
- return _context13.abrupt("return", _context13.sent);
3157
+ return _context14.abrupt("return", _context14.sent);
3114
3158
 
3115
3159
  case 4:
3116
3160
  case "end":
3117
- return _context13.stop();
3161
+ return _context14.stop();
3118
3162
  }
3119
3163
  }
3120
- }, _callee13, this);
3164
+ }, _callee14, this);
3121
3165
  }));
3122
3166
 
3123
3167
  function truncate() {
@@ -3137,28 +3181,28 @@ var Channel = /*#__PURE__*/function () {
3137
3181
  }, {
3138
3182
  key: "acceptInvite",
3139
3183
  value: function () {
3140
- var _acceptInvite = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
3184
+ var _acceptInvite = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15() {
3141
3185
  var options,
3142
- _args14 = arguments;
3143
- return _regeneratorRuntime.wrap(function _callee14$(_context14) {
3186
+ _args15 = arguments;
3187
+ return _regeneratorRuntime.wrap(function _callee15$(_context15) {
3144
3188
  while (1) {
3145
- switch (_context14.prev = _context14.next) {
3189
+ switch (_context15.prev = _context15.next) {
3146
3190
  case 0:
3147
- options = _args14.length > 0 && _args14[0] !== undefined ? _args14[0] : {};
3148
- _context14.next = 3;
3191
+ options = _args15.length > 0 && _args15[0] !== undefined ? _args15[0] : {};
3192
+ _context15.next = 3;
3149
3193
  return this._update(_objectSpread$c({
3150
3194
  accept_invite: true
3151
3195
  }, options));
3152
3196
 
3153
3197
  case 3:
3154
- return _context14.abrupt("return", _context14.sent);
3198
+ return _context15.abrupt("return", _context15.sent);
3155
3199
 
3156
3200
  case 4:
3157
3201
  case "end":
3158
- return _context14.stop();
3202
+ return _context15.stop();
3159
3203
  }
3160
3204
  }
3161
- }, _callee14, this);
3205
+ }, _callee15, this);
3162
3206
  }));
3163
3207
 
3164
3208
  function acceptInvite() {
@@ -3178,28 +3222,28 @@ var Channel = /*#__PURE__*/function () {
3178
3222
  }, {
3179
3223
  key: "rejectInvite",
3180
3224
  value: function () {
3181
- var _rejectInvite = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15() {
3225
+ var _rejectInvite = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16() {
3182
3226
  var options,
3183
- _args15 = arguments;
3184
- return _regeneratorRuntime.wrap(function _callee15$(_context15) {
3227
+ _args16 = arguments;
3228
+ return _regeneratorRuntime.wrap(function _callee16$(_context16) {
3185
3229
  while (1) {
3186
- switch (_context15.prev = _context15.next) {
3230
+ switch (_context16.prev = _context16.next) {
3187
3231
  case 0:
3188
- options = _args15.length > 0 && _args15[0] !== undefined ? _args15[0] : {};
3189
- _context15.next = 3;
3232
+ options = _args16.length > 0 && _args16[0] !== undefined ? _args16[0] : {};
3233
+ _context16.next = 3;
3190
3234
  return this._update(_objectSpread$c({
3191
3235
  reject_invite: true
3192
3236
  }, options));
3193
3237
 
3194
3238
  case 3:
3195
- return _context15.abrupt("return", _context15.sent);
3239
+ return _context16.abrupt("return", _context16.sent);
3196
3240
 
3197
3241
  case 4:
3198
3242
  case "end":
3199
- return _context15.stop();
3243
+ return _context16.stop();
3200
3244
  }
3201
3245
  }
3202
- }, _callee15, this);
3246
+ }, _callee16, this);
3203
3247
  }));
3204
3248
 
3205
3249
  function rejectInvite() {
@@ -3220,32 +3264,32 @@ var Channel = /*#__PURE__*/function () {
3220
3264
  }, {
3221
3265
  key: "addMembers",
3222
3266
  value: function () {
3223
- var _addMembers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(members, message) {
3267
+ var _addMembers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(members, message) {
3224
3268
  var options,
3225
- _args16 = arguments;
3226
- return _regeneratorRuntime.wrap(function _callee16$(_context16) {
3269
+ _args17 = arguments;
3270
+ return _regeneratorRuntime.wrap(function _callee17$(_context17) {
3227
3271
  while (1) {
3228
- switch (_context16.prev = _context16.next) {
3272
+ switch (_context17.prev = _context17.next) {
3229
3273
  case 0:
3230
- options = _args16.length > 2 && _args16[2] !== undefined ? _args16[2] : {};
3231
- _context16.next = 3;
3274
+ options = _args17.length > 2 && _args17[2] !== undefined ? _args17[2] : {};
3275
+ _context17.next = 3;
3232
3276
  return this._update(_objectSpread$c({
3233
3277
  add_members: members,
3234
3278
  message: message
3235
3279
  }, options));
3236
3280
 
3237
3281
  case 3:
3238
- return _context16.abrupt("return", _context16.sent);
3282
+ return _context17.abrupt("return", _context17.sent);
3239
3283
 
3240
3284
  case 4:
3241
3285
  case "end":
3242
- return _context16.stop();
3286
+ return _context17.stop();
3243
3287
  }
3244
3288
  }
3245
- }, _callee16, this);
3289
+ }, _callee17, this);
3246
3290
  }));
3247
3291
 
3248
- function addMembers(_x14, _x15) {
3292
+ function addMembers(_x16, _x17) {
3249
3293
  return _addMembers.apply(this, arguments);
3250
3294
  }
3251
3295
 
@@ -3263,32 +3307,32 @@ var Channel = /*#__PURE__*/function () {
3263
3307
  }, {
3264
3308
  key: "addModerators",
3265
3309
  value: function () {
3266
- var _addModerators = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(members, message) {
3310
+ var _addModerators = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18(members, message) {
3267
3311
  var options,
3268
- _args17 = arguments;
3269
- return _regeneratorRuntime.wrap(function _callee17$(_context17) {
3312
+ _args18 = arguments;
3313
+ return _regeneratorRuntime.wrap(function _callee18$(_context18) {
3270
3314
  while (1) {
3271
- switch (_context17.prev = _context17.next) {
3315
+ switch (_context18.prev = _context18.next) {
3272
3316
  case 0:
3273
- options = _args17.length > 2 && _args17[2] !== undefined ? _args17[2] : {};
3274
- _context17.next = 3;
3317
+ options = _args18.length > 2 && _args18[2] !== undefined ? _args18[2] : {};
3318
+ _context18.next = 3;
3275
3319
  return this._update(_objectSpread$c({
3276
3320
  add_moderators: members,
3277
3321
  message: message
3278
3322
  }, options));
3279
3323
 
3280
3324
  case 3:
3281
- return _context17.abrupt("return", _context17.sent);
3325
+ return _context18.abrupt("return", _context18.sent);
3282
3326
 
3283
3327
  case 4:
3284
3328
  case "end":
3285
- return _context17.stop();
3329
+ return _context18.stop();
3286
3330
  }
3287
3331
  }
3288
- }, _callee17, this);
3332
+ }, _callee18, this);
3289
3333
  }));
3290
3334
 
3291
- function addModerators(_x16, _x17) {
3335
+ function addModerators(_x18, _x19) {
3292
3336
  return _addModerators.apply(this, arguments);
3293
3337
  }
3294
3338
 
@@ -3306,32 +3350,32 @@ var Channel = /*#__PURE__*/function () {
3306
3350
  }, {
3307
3351
  key: "assignRoles",
3308
3352
  value: function () {
3309
- var _assignRoles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18(roles, message) {
3353
+ var _assignRoles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(roles, message) {
3310
3354
  var options,
3311
- _args18 = arguments;
3312
- return _regeneratorRuntime.wrap(function _callee18$(_context18) {
3355
+ _args19 = arguments;
3356
+ return _regeneratorRuntime.wrap(function _callee19$(_context19) {
3313
3357
  while (1) {
3314
- switch (_context18.prev = _context18.next) {
3358
+ switch (_context19.prev = _context19.next) {
3315
3359
  case 0:
3316
- options = _args18.length > 2 && _args18[2] !== undefined ? _args18[2] : {};
3317
- _context18.next = 3;
3360
+ options = _args19.length > 2 && _args19[2] !== undefined ? _args19[2] : {};
3361
+ _context19.next = 3;
3318
3362
  return this._update(_objectSpread$c({
3319
3363
  assign_roles: roles,
3320
3364
  message: message
3321
3365
  }, options));
3322
3366
 
3323
3367
  case 3:
3324
- return _context18.abrupt("return", _context18.sent);
3368
+ return _context19.abrupt("return", _context19.sent);
3325
3369
 
3326
3370
  case 4:
3327
3371
  case "end":
3328
- return _context18.stop();
3372
+ return _context19.stop();
3329
3373
  }
3330
3374
  }
3331
- }, _callee18, this);
3375
+ }, _callee19, this);
3332
3376
  }));
3333
3377
 
3334
- function assignRoles(_x18, _x19) {
3378
+ function assignRoles(_x20, _x21) {
3335
3379
  return _assignRoles.apply(this, arguments);
3336
3380
  }
3337
3381
 
@@ -3349,32 +3393,32 @@ var Channel = /*#__PURE__*/function () {
3349
3393
  }, {
3350
3394
  key: "inviteMembers",
3351
3395
  value: function () {
3352
- var _inviteMembers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(members, message) {
3396
+ var _inviteMembers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20(members, message) {
3353
3397
  var options,
3354
- _args19 = arguments;
3355
- return _regeneratorRuntime.wrap(function _callee19$(_context19) {
3398
+ _args20 = arguments;
3399
+ return _regeneratorRuntime.wrap(function _callee20$(_context20) {
3356
3400
  while (1) {
3357
- switch (_context19.prev = _context19.next) {
3401
+ switch (_context20.prev = _context20.next) {
3358
3402
  case 0:
3359
- options = _args19.length > 2 && _args19[2] !== undefined ? _args19[2] : {};
3360
- _context19.next = 3;
3403
+ options = _args20.length > 2 && _args20[2] !== undefined ? _args20[2] : {};
3404
+ _context20.next = 3;
3361
3405
  return this._update(_objectSpread$c({
3362
3406
  invites: members,
3363
3407
  message: message
3364
3408
  }, options));
3365
3409
 
3366
3410
  case 3:
3367
- return _context19.abrupt("return", _context19.sent);
3411
+ return _context20.abrupt("return", _context20.sent);
3368
3412
 
3369
3413
  case 4:
3370
3414
  case "end":
3371
- return _context19.stop();
3415
+ return _context20.stop();
3372
3416
  }
3373
3417
  }
3374
- }, _callee19, this);
3418
+ }, _callee20, this);
3375
3419
  }));
3376
3420
 
3377
- function inviteMembers(_x20, _x21) {
3421
+ function inviteMembers(_x22, _x23) {
3378
3422
  return _inviteMembers.apply(this, arguments);
3379
3423
  }
3380
3424
 
@@ -3392,32 +3436,32 @@ var Channel = /*#__PURE__*/function () {
3392
3436
  }, {
3393
3437
  key: "removeMembers",
3394
3438
  value: function () {
3395
- var _removeMembers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20(members, message) {
3439
+ var _removeMembers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21(members, message) {
3396
3440
  var options,
3397
- _args20 = arguments;
3398
- return _regeneratorRuntime.wrap(function _callee20$(_context20) {
3441
+ _args21 = arguments;
3442
+ return _regeneratorRuntime.wrap(function _callee21$(_context21) {
3399
3443
  while (1) {
3400
- switch (_context20.prev = _context20.next) {
3444
+ switch (_context21.prev = _context21.next) {
3401
3445
  case 0:
3402
- options = _args20.length > 2 && _args20[2] !== undefined ? _args20[2] : {};
3403
- _context20.next = 3;
3446
+ options = _args21.length > 2 && _args21[2] !== undefined ? _args21[2] : {};
3447
+ _context21.next = 3;
3404
3448
  return this._update(_objectSpread$c({
3405
3449
  remove_members: members,
3406
3450
  message: message
3407
3451
  }, options));
3408
3452
 
3409
3453
  case 3:
3410
- return _context20.abrupt("return", _context20.sent);
3454
+ return _context21.abrupt("return", _context21.sent);
3411
3455
 
3412
3456
  case 4:
3413
3457
  case "end":
3414
- return _context20.stop();
3458
+ return _context21.stop();
3415
3459
  }
3416
3460
  }
3417
- }, _callee20, this);
3461
+ }, _callee21, this);
3418
3462
  }));
3419
3463
 
3420
- function removeMembers(_x22, _x23) {
3464
+ function removeMembers(_x24, _x25) {
3421
3465
  return _removeMembers.apply(this, arguments);
3422
3466
  }
3423
3467
 
@@ -3435,32 +3479,32 @@ var Channel = /*#__PURE__*/function () {
3435
3479
  }, {
3436
3480
  key: "demoteModerators",
3437
3481
  value: function () {
3438
- var _demoteModerators = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21(members, message) {
3482
+ var _demoteModerators = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22(members, message) {
3439
3483
  var options,
3440
- _args21 = arguments;
3441
- return _regeneratorRuntime.wrap(function _callee21$(_context21) {
3484
+ _args22 = arguments;
3485
+ return _regeneratorRuntime.wrap(function _callee22$(_context22) {
3442
3486
  while (1) {
3443
- switch (_context21.prev = _context21.next) {
3487
+ switch (_context22.prev = _context22.next) {
3444
3488
  case 0:
3445
- options = _args21.length > 2 && _args21[2] !== undefined ? _args21[2] : {};
3446
- _context21.next = 3;
3489
+ options = _args22.length > 2 && _args22[2] !== undefined ? _args22[2] : {};
3490
+ _context22.next = 3;
3447
3491
  return this._update(_objectSpread$c({
3448
3492
  demote_moderators: members,
3449
3493
  message: message
3450
3494
  }, options));
3451
3495
 
3452
3496
  case 3:
3453
- return _context21.abrupt("return", _context21.sent);
3497
+ return _context22.abrupt("return", _context22.sent);
3454
3498
 
3455
3499
  case 4:
3456
3500
  case "end":
3457
- return _context21.stop();
3501
+ return _context22.stop();
3458
3502
  }
3459
3503
  }
3460
- }, _callee21, this);
3504
+ }, _callee22, this);
3461
3505
  }));
3462
3506
 
3463
- function demoteModerators(_x24, _x25) {
3507
+ function demoteModerators(_x26, _x27) {
3464
3508
  return _demoteModerators.apply(this, arguments);
3465
3509
  }
3466
3510
 
@@ -3476,29 +3520,29 @@ var Channel = /*#__PURE__*/function () {
3476
3520
  }, {
3477
3521
  key: "_update",
3478
3522
  value: function () {
3479
- var _update3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22(payload) {
3523
+ var _update3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23(payload) {
3480
3524
  var data;
3481
- return _regeneratorRuntime.wrap(function _callee22$(_context22) {
3525
+ return _regeneratorRuntime.wrap(function _callee23$(_context23) {
3482
3526
  while (1) {
3483
- switch (_context22.prev = _context22.next) {
3527
+ switch (_context23.prev = _context23.next) {
3484
3528
  case 0:
3485
- _context22.next = 2;
3529
+ _context23.next = 2;
3486
3530
  return this.getClient().post(this._channelURL(), payload);
3487
3531
 
3488
3532
  case 2:
3489
- data = _context22.sent;
3533
+ data = _context23.sent;
3490
3534
  this.data = data.channel;
3491
- return _context22.abrupt("return", data);
3535
+ return _context23.abrupt("return", data);
3492
3536
 
3493
3537
  case 5:
3494
3538
  case "end":
3495
- return _context22.stop();
3539
+ return _context23.stop();
3496
3540
  }
3497
3541
  }
3498
- }, _callee22, this);
3542
+ }, _callee23, this);
3499
3543
  }));
3500
3544
 
3501
- function _update(_x26) {
3545
+ function _update(_x28) {
3502
3546
  return _update3.apply(this, arguments);
3503
3547
  }
3504
3548
 
@@ -3520,28 +3564,28 @@ var Channel = /*#__PURE__*/function () {
3520
3564
  }, {
3521
3565
  key: "mute",
3522
3566
  value: function () {
3523
- var _mute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23() {
3567
+ var _mute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24() {
3524
3568
  var opts,
3525
- _args23 = arguments;
3526
- return _regeneratorRuntime.wrap(function _callee23$(_context23) {
3569
+ _args24 = arguments;
3570
+ return _regeneratorRuntime.wrap(function _callee24$(_context24) {
3527
3571
  while (1) {
3528
- switch (_context23.prev = _context23.next) {
3572
+ switch (_context24.prev = _context24.next) {
3529
3573
  case 0:
3530
- opts = _args23.length > 0 && _args23[0] !== undefined ? _args23[0] : {};
3531
- _context23.next = 3;
3574
+ opts = _args24.length > 0 && _args24[0] !== undefined ? _args24[0] : {};
3575
+ _context24.next = 3;
3532
3576
  return this.getClient().post(this.getClient().baseURL + '/moderation/mute/channel', _objectSpread$c({
3533
3577
  channel_cid: this.cid
3534
3578
  }, opts));
3535
3579
 
3536
3580
  case 3:
3537
- return _context23.abrupt("return", _context23.sent);
3581
+ return _context24.abrupt("return", _context24.sent);
3538
3582
 
3539
3583
  case 4:
3540
3584
  case "end":
3541
- return _context23.stop();
3585
+ return _context24.stop();
3542
3586
  }
3543
3587
  }
3544
- }, _callee23, this);
3588
+ }, _callee24, this);
3545
3589
  }));
3546
3590
 
3547
3591
  function mute() {
@@ -3562,28 +3606,28 @@ var Channel = /*#__PURE__*/function () {
3562
3606
  }, {
3563
3607
  key: "unmute",
3564
3608
  value: function () {
3565
- var _unmute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24() {
3609
+ var _unmute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25() {
3566
3610
  var opts,
3567
- _args24 = arguments;
3568
- return _regeneratorRuntime.wrap(function _callee24$(_context24) {
3611
+ _args25 = arguments;
3612
+ return _regeneratorRuntime.wrap(function _callee25$(_context25) {
3569
3613
  while (1) {
3570
- switch (_context24.prev = _context24.next) {
3614
+ switch (_context25.prev = _context25.next) {
3571
3615
  case 0:
3572
- opts = _args24.length > 0 && _args24[0] !== undefined ? _args24[0] : {};
3573
- _context24.next = 3;
3616
+ opts = _args25.length > 0 && _args25[0] !== undefined ? _args25[0] : {};
3617
+ _context25.next = 3;
3574
3618
  return this.getClient().post(this.getClient().baseURL + '/moderation/unmute/channel', _objectSpread$c({
3575
3619
  channel_cid: this.cid
3576
3620
  }, opts));
3577
3621
 
3578
3622
  case 3:
3579
- return _context24.abrupt("return", _context24.sent);
3623
+ return _context25.abrupt("return", _context25.sent);
3580
3624
 
3581
3625
  case 4:
3582
3626
  case "end":
3583
- return _context24.stop();
3627
+ return _context25.stop();
3584
3628
  }
3585
3629
  }
3586
- }, _callee24, this);
3630
+ }, _callee25, this);
3587
3631
  }));
3588
3632
 
3589
3633
  function unmute() {
@@ -3608,29 +3652,29 @@ var Channel = /*#__PURE__*/function () {
3608
3652
  }, {
3609
3653
  key: "archive",
3610
3654
  value: function () {
3611
- var _archive = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25() {
3655
+ var _archive = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26() {
3612
3656
  var opts,
3613
3657
  cli,
3614
3658
  uid,
3615
3659
  resp,
3616
- _args25 = arguments;
3617
- return _regeneratorRuntime.wrap(function _callee25$(_context25) {
3660
+ _args26 = arguments;
3661
+ return _regeneratorRuntime.wrap(function _callee26$(_context26) {
3618
3662
  while (1) {
3619
- switch (_context25.prev = _context25.next) {
3663
+ switch (_context26.prev = _context26.next) {
3620
3664
  case 0:
3621
- opts = _args25.length > 0 && _args25[0] !== undefined ? _args25[0] : {};
3665
+ opts = _args26.length > 0 && _args26[0] !== undefined ? _args26[0] : {};
3622
3666
  cli = this.getClient();
3623
3667
  uid = opts.user_id || cli.userID;
3624
3668
 
3625
3669
  if (uid) {
3626
- _context25.next = 5;
3670
+ _context26.next = 5;
3627
3671
  break;
3628
3672
  }
3629
3673
 
3630
3674
  throw Error('A user_id is required for archiving a channel');
3631
3675
 
3632
3676
  case 5:
3633
- _context25.next = 7;
3677
+ _context26.next = 7;
3634
3678
  return this.partialUpdateMember(uid, {
3635
3679
  set: {
3636
3680
  archived: true
@@ -3638,15 +3682,15 @@ var Channel = /*#__PURE__*/function () {
3638
3682
  });
3639
3683
 
3640
3684
  case 7:
3641
- resp = _context25.sent;
3642
- return _context25.abrupt("return", resp.channel_member);
3685
+ resp = _context26.sent;
3686
+ return _context26.abrupt("return", resp.channel_member);
3643
3687
 
3644
3688
  case 9:
3645
3689
  case "end":
3646
- return _context25.stop();
3690
+ return _context26.stop();
3647
3691
  }
3648
3692
  }
3649
- }, _callee25, this);
3693
+ }, _callee26, this);
3650
3694
  }));
3651
3695
 
3652
3696
  function archive() {
@@ -3671,29 +3715,29 @@ var Channel = /*#__PURE__*/function () {
3671
3715
  }, {
3672
3716
  key: "unarchive",
3673
3717
  value: function () {
3674
- var _unarchive = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26() {
3718
+ var _unarchive = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27() {
3675
3719
  var opts,
3676
3720
  cli,
3677
3721
  uid,
3678
3722
  resp,
3679
- _args26 = arguments;
3680
- return _regeneratorRuntime.wrap(function _callee26$(_context26) {
3723
+ _args27 = arguments;
3724
+ return _regeneratorRuntime.wrap(function _callee27$(_context27) {
3681
3725
  while (1) {
3682
- switch (_context26.prev = _context26.next) {
3726
+ switch (_context27.prev = _context27.next) {
3683
3727
  case 0:
3684
- opts = _args26.length > 0 && _args26[0] !== undefined ? _args26[0] : {};
3728
+ opts = _args27.length > 0 && _args27[0] !== undefined ? _args27[0] : {};
3685
3729
  cli = this.getClient();
3686
3730
  uid = opts.user_id || cli.userID;
3687
3731
 
3688
3732
  if (uid) {
3689
- _context26.next = 5;
3733
+ _context27.next = 5;
3690
3734
  break;
3691
3735
  }
3692
3736
 
3693
3737
  throw Error('A user_id is required for unarchiving a channel');
3694
3738
 
3695
3739
  case 5:
3696
- _context26.next = 7;
3740
+ _context27.next = 7;
3697
3741
  return this.partialUpdateMember(uid, {
3698
3742
  set: {
3699
3743
  archived: false
@@ -3701,15 +3745,15 @@ var Channel = /*#__PURE__*/function () {
3701
3745
  });
3702
3746
 
3703
3747
  case 7:
3704
- resp = _context26.sent;
3705
- return _context26.abrupt("return", resp.channel_member);
3748
+ resp = _context27.sent;
3749
+ return _context27.abrupt("return", resp.channel_member);
3706
3750
 
3707
3751
  case 9:
3708
3752
  case "end":
3709
- return _context26.stop();
3753
+ return _context27.stop();
3710
3754
  }
3711
3755
  }
3712
- }, _callee26, this);
3756
+ }, _callee27, this);
3713
3757
  }));
3714
3758
 
3715
3759
  function unarchive() {
@@ -3734,29 +3778,29 @@ var Channel = /*#__PURE__*/function () {
3734
3778
  }, {
3735
3779
  key: "pin",
3736
3780
  value: function () {
3737
- var _pin = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27() {
3781
+ var _pin = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee28() {
3738
3782
  var opts,
3739
3783
  cli,
3740
3784
  uid,
3741
3785
  resp,
3742
- _args27 = arguments;
3743
- return _regeneratorRuntime.wrap(function _callee27$(_context27) {
3786
+ _args28 = arguments;
3787
+ return _regeneratorRuntime.wrap(function _callee28$(_context28) {
3744
3788
  while (1) {
3745
- switch (_context27.prev = _context27.next) {
3789
+ switch (_context28.prev = _context28.next) {
3746
3790
  case 0:
3747
- opts = _args27.length > 0 && _args27[0] !== undefined ? _args27[0] : {};
3791
+ opts = _args28.length > 0 && _args28[0] !== undefined ? _args28[0] : {};
3748
3792
  cli = this.getClient();
3749
3793
  uid = opts.user_id || cli.userID;
3750
3794
 
3751
3795
  if (uid) {
3752
- _context27.next = 5;
3796
+ _context28.next = 5;
3753
3797
  break;
3754
3798
  }
3755
3799
 
3756
3800
  throw new Error('A user_id is required for pinning a channel');
3757
3801
 
3758
3802
  case 5:
3759
- _context27.next = 7;
3803
+ _context28.next = 7;
3760
3804
  return this.partialUpdateMember(uid, {
3761
3805
  set: {
3762
3806
  pinned: true
@@ -3764,15 +3808,15 @@ var Channel = /*#__PURE__*/function () {
3764
3808
  });
3765
3809
 
3766
3810
  case 7:
3767
- resp = _context27.sent;
3768
- return _context27.abrupt("return", resp.channel_member);
3811
+ resp = _context28.sent;
3812
+ return _context28.abrupt("return", resp.channel_member);
3769
3813
 
3770
3814
  case 9:
3771
3815
  case "end":
3772
- return _context27.stop();
3816
+ return _context28.stop();
3773
3817
  }
3774
3818
  }
3775
- }, _callee27, this);
3819
+ }, _callee28, this);
3776
3820
  }));
3777
3821
 
3778
3822
  function pin() {
@@ -3797,29 +3841,29 @@ var Channel = /*#__PURE__*/function () {
3797
3841
  }, {
3798
3842
  key: "unpin",
3799
3843
  value: function () {
3800
- var _unpin = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee28() {
3844
+ var _unpin = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee29() {
3801
3845
  var opts,
3802
3846
  cli,
3803
3847
  uid,
3804
3848
  resp,
3805
- _args28 = arguments;
3806
- return _regeneratorRuntime.wrap(function _callee28$(_context28) {
3849
+ _args29 = arguments;
3850
+ return _regeneratorRuntime.wrap(function _callee29$(_context29) {
3807
3851
  while (1) {
3808
- switch (_context28.prev = _context28.next) {
3852
+ switch (_context29.prev = _context29.next) {
3809
3853
  case 0:
3810
- opts = _args28.length > 0 && _args28[0] !== undefined ? _args28[0] : {};
3854
+ opts = _args29.length > 0 && _args29[0] !== undefined ? _args29[0] : {};
3811
3855
  cli = this.getClient();
3812
3856
  uid = opts.user_id || cli.userID;
3813
3857
 
3814
3858
  if (uid) {
3815
- _context28.next = 5;
3859
+ _context29.next = 5;
3816
3860
  break;
3817
3861
  }
3818
3862
 
3819
3863
  throw new Error('A user_id is required for unpinning a channel');
3820
3864
 
3821
3865
  case 5:
3822
- _context28.next = 7;
3866
+ _context29.next = 7;
3823
3867
  return this.partialUpdateMember(uid, {
3824
3868
  set: {
3825
3869
  pinned: false
@@ -3827,15 +3871,15 @@ var Channel = /*#__PURE__*/function () {
3827
3871
  });
3828
3872
 
3829
3873
  case 7:
3830
- resp = _context28.sent;
3831
- return _context28.abrupt("return", resp.channel_member);
3874
+ resp = _context29.sent;
3875
+ return _context29.abrupt("return", resp.channel_member);
3832
3876
 
3833
3877
  case 9:
3834
3878
  case "end":
3835
- return _context28.stop();
3879
+ return _context29.stop();
3836
3880
  }
3837
3881
  }
3838
- }, _callee28, this);
3882
+ }, _callee29, this);
3839
3883
  }));
3840
3884
 
3841
3885
  function unpin() {
@@ -3882,18 +3926,18 @@ var Channel = /*#__PURE__*/function () {
3882
3926
  }, {
3883
3927
  key: "keystroke",
3884
3928
  value: function () {
3885
- var _keystroke = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee29(parent_id, options) {
3929
+ var _keystroke = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30(parent_id, options) {
3886
3930
  var now, diff;
3887
- return _regeneratorRuntime.wrap(function _callee29$(_context29) {
3931
+ return _regeneratorRuntime.wrap(function _callee30$(_context30) {
3888
3932
  while (1) {
3889
- switch (_context29.prev = _context29.next) {
3933
+ switch (_context30.prev = _context30.next) {
3890
3934
  case 0:
3891
3935
  if (this._isTypingIndicatorsEnabled()) {
3892
- _context29.next = 2;
3936
+ _context30.next = 2;
3893
3937
  break;
3894
3938
  }
3895
3939
 
3896
- return _context29.abrupt("return");
3940
+ return _context30.abrupt("return");
3897
3941
 
3898
3942
  case 2:
3899
3943
  now = new Date();
@@ -3902,12 +3946,12 @@ var Channel = /*#__PURE__*/function () {
3902
3946
  this.isTyping = true; // send a typing.start every 2 seconds
3903
3947
 
3904
3948
  if (!(diff === null || diff > 2000)) {
3905
- _context29.next = 10;
3949
+ _context30.next = 10;
3906
3950
  break;
3907
3951
  }
3908
3952
 
3909
3953
  this.lastTypingEvent = new Date();
3910
- _context29.next = 10;
3954
+ _context30.next = 10;
3911
3955
  return this.sendEvent(_objectSpread$c({
3912
3956
  type: 'typing.start',
3913
3957
  parent_id: parent_id
@@ -3915,13 +3959,13 @@ var Channel = /*#__PURE__*/function () {
3915
3959
 
3916
3960
  case 10:
3917
3961
  case "end":
3918
- return _context29.stop();
3962
+ return _context30.stop();
3919
3963
  }
3920
3964
  }
3921
- }, _callee29, this);
3965
+ }, _callee30, this);
3922
3966
  }));
3923
3967
 
3924
- function keystroke(_x27, _x28) {
3968
+ function keystroke(_x29, _x30) {
3925
3969
  return _keystroke.apply(this, arguments);
3926
3970
  }
3927
3971
 
@@ -3939,15 +3983,15 @@ var Channel = /*#__PURE__*/function () {
3939
3983
  }, {
3940
3984
  key: "updateAIState",
3941
3985
  value: function () {
3942
- var _updateAIState = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30(messageId, state) {
3986
+ var _updateAIState = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31(messageId, state) {
3943
3987
  var options,
3944
- _args30 = arguments;
3945
- return _regeneratorRuntime.wrap(function _callee30$(_context30) {
3988
+ _args31 = arguments;
3989
+ return _regeneratorRuntime.wrap(function _callee31$(_context31) {
3946
3990
  while (1) {
3947
- switch (_context30.prev = _context30.next) {
3991
+ switch (_context31.prev = _context31.next) {
3948
3992
  case 0:
3949
- options = _args30.length > 2 && _args30[2] !== undefined ? _args30[2] : {};
3950
- _context30.next = 3;
3993
+ options = _args31.length > 2 && _args31[2] !== undefined ? _args31[2] : {};
3994
+ _context31.next = 3;
3951
3995
  return this.sendEvent(_objectSpread$c(_objectSpread$c({}, options), {}, {
3952
3996
  type: 'ai_indicator.update',
3953
3997
  message_id: messageId,
@@ -3956,13 +4000,13 @@ var Channel = /*#__PURE__*/function () {
3956
4000
 
3957
4001
  case 3:
3958
4002
  case "end":
3959
- return _context30.stop();
4003
+ return _context31.stop();
3960
4004
  }
3961
4005
  }
3962
- }, _callee30, this);
4006
+ }, _callee31, this);
3963
4007
  }));
3964
4008
 
3965
- function updateAIState(_x29, _x30) {
4009
+ function updateAIState(_x31, _x32) {
3966
4010
  return _updateAIState.apply(this, arguments);
3967
4011
  }
3968
4012
 
@@ -3976,22 +4020,22 @@ var Channel = /*#__PURE__*/function () {
3976
4020
  }, {
3977
4021
  key: "clearAIIndicator",
3978
4022
  value: function () {
3979
- var _clearAIIndicator = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31() {
3980
- return _regeneratorRuntime.wrap(function _callee31$(_context31) {
4023
+ var _clearAIIndicator = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee32() {
4024
+ return _regeneratorRuntime.wrap(function _callee32$(_context32) {
3981
4025
  while (1) {
3982
- switch (_context31.prev = _context31.next) {
4026
+ switch (_context32.prev = _context32.next) {
3983
4027
  case 0:
3984
- _context31.next = 2;
4028
+ _context32.next = 2;
3985
4029
  return this.sendEvent({
3986
4030
  type: 'ai_indicator.clear'
3987
4031
  });
3988
4032
 
3989
4033
  case 2:
3990
4034
  case "end":
3991
- return _context31.stop();
4035
+ return _context32.stop();
3992
4036
  }
3993
4037
  }
3994
- }, _callee31, this);
4038
+ }, _callee32, this);
3995
4039
  }));
3996
4040
 
3997
4041
  function clearAIIndicator() {
@@ -4008,22 +4052,22 @@ var Channel = /*#__PURE__*/function () {
4008
4052
  }, {
4009
4053
  key: "stopAIResponse",
4010
4054
  value: function () {
4011
- var _stopAIResponse = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee32() {
4012
- return _regeneratorRuntime.wrap(function _callee32$(_context32) {
4055
+ var _stopAIResponse = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee33() {
4056
+ return _regeneratorRuntime.wrap(function _callee33$(_context33) {
4013
4057
  while (1) {
4014
- switch (_context32.prev = _context32.next) {
4058
+ switch (_context33.prev = _context33.next) {
4015
4059
  case 0:
4016
- _context32.next = 2;
4060
+ _context33.next = 2;
4017
4061
  return this.sendEvent({
4018
4062
  type: 'ai_indicator.stop'
4019
4063
  });
4020
4064
 
4021
4065
  case 2:
4022
4066
  case "end":
4023
- return _context32.stop();
4067
+ return _context33.stop();
4024
4068
  }
4025
4069
  }
4026
- }, _callee32, this);
4070
+ }, _callee33, this);
4027
4071
  }));
4028
4072
 
4029
4073
  function stopAIResponse() {
@@ -4041,22 +4085,22 @@ var Channel = /*#__PURE__*/function () {
4041
4085
  }, {
4042
4086
  key: "stopTyping",
4043
4087
  value: function () {
4044
- var _stopTyping = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee33(parent_id, options) {
4045
- return _regeneratorRuntime.wrap(function _callee33$(_context33) {
4088
+ var _stopTyping = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee34(parent_id, options) {
4089
+ return _regeneratorRuntime.wrap(function _callee34$(_context34) {
4046
4090
  while (1) {
4047
- switch (_context33.prev = _context33.next) {
4091
+ switch (_context34.prev = _context34.next) {
4048
4092
  case 0:
4049
4093
  if (this._isTypingIndicatorsEnabled()) {
4050
- _context33.next = 2;
4094
+ _context34.next = 2;
4051
4095
  break;
4052
4096
  }
4053
4097
 
4054
- return _context33.abrupt("return");
4098
+ return _context34.abrupt("return");
4055
4099
 
4056
4100
  case 2:
4057
4101
  this.lastTypingEvent = null;
4058
4102
  this.isTyping = false;
4059
- _context33.next = 6;
4103
+ _context34.next = 6;
4060
4104
  return this.sendEvent(_objectSpread$c({
4061
4105
  type: 'typing.stop',
4062
4106
  parent_id: parent_id
@@ -4064,13 +4108,13 @@ var Channel = /*#__PURE__*/function () {
4064
4108
 
4065
4109
  case 6:
4066
4110
  case "end":
4067
- return _context33.stop();
4111
+ return _context34.stop();
4068
4112
  }
4069
4113
  }
4070
- }, _callee33, this);
4114
+ }, _callee34, this);
4071
4115
  }));
4072
4116
 
4073
- function stopTyping(_x31, _x32) {
4117
+ function stopTyping(_x33, _x34) {
4074
4118
  return _stopTyping.apply(this, arguments);
4075
4119
  }
4076
4120
 
@@ -4122,39 +4166,39 @@ var Channel = /*#__PURE__*/function () {
4122
4166
  }, {
4123
4167
  key: "markRead",
4124
4168
  value: function () {
4125
- var _markRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee34() {
4169
+ var _markRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee35() {
4126
4170
  var _this$getConfig2;
4127
4171
 
4128
4172
  var data,
4129
- _args34 = arguments;
4130
- return _regeneratorRuntime.wrap(function _callee34$(_context34) {
4173
+ _args35 = arguments;
4174
+ return _regeneratorRuntime.wrap(function _callee35$(_context35) {
4131
4175
  while (1) {
4132
- switch (_context34.prev = _context34.next) {
4176
+ switch (_context35.prev = _context35.next) {
4133
4177
  case 0:
4134
- data = _args34.length > 0 && _args34[0] !== undefined ? _args34[0] : {};
4178
+ data = _args35.length > 0 && _args35[0] !== undefined ? _args35[0] : {};
4135
4179
 
4136
4180
  this._checkInitialized();
4137
4181
 
4138
4182
  if (!(!((_this$getConfig2 = this.getConfig()) !== null && _this$getConfig2 !== void 0 && _this$getConfig2.read_events) && !this.getClient()._isUsingServerAuth())) {
4139
- _context34.next = 4;
4183
+ _context35.next = 4;
4140
4184
  break;
4141
4185
  }
4142
4186
 
4143
- return _context34.abrupt("return", Promise.resolve(null));
4187
+ return _context35.abrupt("return", Promise.resolve(null));
4144
4188
 
4145
4189
  case 4:
4146
- _context34.next = 6;
4190
+ _context35.next = 6;
4147
4191
  return this.getClient().post(this._channelURL() + '/read', _objectSpread$c({}, data));
4148
4192
 
4149
4193
  case 6:
4150
- return _context34.abrupt("return", _context34.sent);
4194
+ return _context35.abrupt("return", _context35.sent);
4151
4195
 
4152
4196
  case 7:
4153
4197
  case "end":
4154
- return _context34.stop();
4198
+ return _context35.stop();
4155
4199
  }
4156
4200
  }
4157
- }, _callee34, this);
4201
+ }, _callee35, this);
4158
4202
  }));
4159
4203
 
4160
4204
  function markRead() {
@@ -4173,38 +4217,38 @@ var Channel = /*#__PURE__*/function () {
4173
4217
  }, {
4174
4218
  key: "markUnread",
4175
4219
  value: function () {
4176
- var _markUnread = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee35(data) {
4220
+ var _markUnread = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee36(data) {
4177
4221
  var _this$getConfig3;
4178
4222
 
4179
- return _regeneratorRuntime.wrap(function _callee35$(_context35) {
4223
+ return _regeneratorRuntime.wrap(function _callee36$(_context36) {
4180
4224
  while (1) {
4181
- switch (_context35.prev = _context35.next) {
4225
+ switch (_context36.prev = _context36.next) {
4182
4226
  case 0:
4183
4227
  this._checkInitialized();
4184
4228
 
4185
4229
  if (!(!((_this$getConfig3 = this.getConfig()) !== null && _this$getConfig3 !== void 0 && _this$getConfig3.read_events) && !this.getClient()._isUsingServerAuth())) {
4186
- _context35.next = 3;
4230
+ _context36.next = 3;
4187
4231
  break;
4188
4232
  }
4189
4233
 
4190
- return _context35.abrupt("return", Promise.resolve(null));
4234
+ return _context36.abrupt("return", Promise.resolve(null));
4191
4235
 
4192
4236
  case 3:
4193
- _context35.next = 5;
4237
+ _context36.next = 5;
4194
4238
  return this.getClient().post(this._channelURL() + '/unread', _objectSpread$c({}, data));
4195
4239
 
4196
4240
  case 5:
4197
- return _context35.abrupt("return", _context35.sent);
4241
+ return _context36.abrupt("return", _context36.sent);
4198
4242
 
4199
4243
  case 6:
4200
4244
  case "end":
4201
- return _context35.stop();
4245
+ return _context36.stop();
4202
4246
  }
4203
4247
  }
4204
- }, _callee35, this);
4248
+ }, _callee36, this);
4205
4249
  }));
4206
4250
 
4207
- function markUnread(_x33) {
4251
+ function markUnread(_x35) {
4208
4252
  return _markUnread.apply(this, arguments);
4209
4253
  }
4210
4254
 
@@ -4239,11 +4283,11 @@ var Channel = /*#__PURE__*/function () {
4239
4283
  }, {
4240
4284
  key: "watch",
4241
4285
  value: function () {
4242
- var _watch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee36(options) {
4286
+ var _watch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee37(options) {
4243
4287
  var defaultOptions, combined, state;
4244
- return _regeneratorRuntime.wrap(function _callee36$(_context36) {
4288
+ return _regeneratorRuntime.wrap(function _callee37$(_context37) {
4245
4289
  while (1) {
4246
- switch (_context36.prev = _context36.next) {
4290
+ switch (_context37.prev = _context37.next) {
4247
4291
  case 0:
4248
4292
  defaultOptions = {
4249
4293
  state: true,
@@ -4251,7 +4295,7 @@ var Channel = /*#__PURE__*/function () {
4251
4295
  presence: false
4252
4296
  }; // Make sure we wait for the connect promise if there is a pending one
4253
4297
 
4254
- _context36.next = 3;
4298
+ _context37.next = 3;
4255
4299
  return this.getClient().wsPromise;
4256
4300
 
4257
4301
  case 3:
@@ -4260,11 +4304,11 @@ var Channel = /*#__PURE__*/function () {
4260
4304
  }
4261
4305
 
4262
4306
  combined = _objectSpread$c(_objectSpread$c({}, defaultOptions), options);
4263
- _context36.next = 7;
4307
+ _context37.next = 7;
4264
4308
  return this.query(combined, 'latest');
4265
4309
 
4266
4310
  case 7:
4267
- state = _context36.sent;
4311
+ state = _context37.sent;
4268
4312
  this.initialized = true;
4269
4313
  this.data = state.channel;
4270
4314
 
@@ -4273,17 +4317,17 @@ var Channel = /*#__PURE__*/function () {
4273
4317
  channel: this
4274
4318
  });
4275
4319
 
4276
- return _context36.abrupt("return", state);
4320
+ return _context37.abrupt("return", state);
4277
4321
 
4278
4322
  case 12:
4279
4323
  case "end":
4280
- return _context36.stop();
4324
+ return _context37.stop();
4281
4325
  }
4282
4326
  }
4283
- }, _callee36, this);
4327
+ }, _callee37, this);
4284
4328
  }));
4285
4329
 
4286
- function watch(_x34) {
4330
+ function watch(_x36) {
4287
4331
  return _watch.apply(this, arguments);
4288
4332
  }
4289
4333
 
@@ -4298,31 +4342,31 @@ var Channel = /*#__PURE__*/function () {
4298
4342
  }, {
4299
4343
  key: "stopWatching",
4300
4344
  value: function () {
4301
- var _stopWatching = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee37() {
4345
+ var _stopWatching = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee38() {
4302
4346
  var response;
4303
- return _regeneratorRuntime.wrap(function _callee37$(_context37) {
4347
+ return _regeneratorRuntime.wrap(function _callee38$(_context38) {
4304
4348
  while (1) {
4305
- switch (_context37.prev = _context37.next) {
4349
+ switch (_context38.prev = _context38.next) {
4306
4350
  case 0:
4307
- _context37.next = 2;
4351
+ _context38.next = 2;
4308
4352
  return this.getClient().post(this._channelURL() + '/stop-watching', {});
4309
4353
 
4310
4354
  case 2:
4311
- response = _context37.sent;
4355
+ response = _context38.sent;
4312
4356
 
4313
4357
  this._client.logger('info', "channel:watch() - stopped watching channel ".concat(this.cid), {
4314
4358
  tags: ['channel'],
4315
4359
  channel: this
4316
4360
  });
4317
4361
 
4318
- return _context37.abrupt("return", response);
4362
+ return _context38.abrupt("return", response);
4319
4363
 
4320
4364
  case 5:
4321
4365
  case "end":
4322
- return _context37.stop();
4366
+ return _context38.stop();
4323
4367
  }
4324
4368
  }
4325
- }, _callee37, this);
4369
+ }, _callee38, this);
4326
4370
  }));
4327
4371
 
4328
4372
  function stopWatching() {
@@ -4345,37 +4389,37 @@ var Channel = /*#__PURE__*/function () {
4345
4389
  }, {
4346
4390
  key: "getReplies",
4347
4391
  value: function () {
4348
- var _getReplies = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee38(parent_id, options, sort) {
4392
+ var _getReplies = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee39(parent_id, options, sort) {
4349
4393
  var normalizedSort, data;
4350
- return _regeneratorRuntime.wrap(function _callee38$(_context38) {
4394
+ return _regeneratorRuntime.wrap(function _callee39$(_context39) {
4351
4395
  while (1) {
4352
- switch (_context38.prev = _context38.next) {
4396
+ switch (_context39.prev = _context39.next) {
4353
4397
  case 0:
4354
4398
  normalizedSort = sort ? normalizeQuerySort(sort) : undefined;
4355
- _context38.next = 3;
4399
+ _context39.next = 3;
4356
4400
  return this.getClient().get(this.getClient().baseURL + "/messages/".concat(encodeURIComponent(parent_id), "/replies"), _objectSpread$c({
4357
4401
  sort: normalizedSort
4358
4402
  }, options));
4359
4403
 
4360
4404
  case 3:
4361
- data = _context38.sent;
4405
+ data = _context39.sent;
4362
4406
 
4363
4407
  // add any messages to our thread state
4364
4408
  if (data.messages) {
4365
4409
  this.state.addMessagesSorted(data.messages);
4366
4410
  }
4367
4411
 
4368
- return _context38.abrupt("return", data);
4412
+ return _context39.abrupt("return", data);
4369
4413
 
4370
4414
  case 6:
4371
4415
  case "end":
4372
- return _context38.stop();
4416
+ return _context39.stop();
4373
4417
  }
4374
4418
  }
4375
- }, _callee38, this);
4419
+ }, _callee39, this);
4376
4420
  }));
4377
4421
 
4378
- function getReplies(_x35, _x36, _x37) {
4422
+ function getReplies(_x37, _x38, _x39) {
4379
4423
  return _getReplies.apply(this, arguments);
4380
4424
  }
4381
4425
 
@@ -4393,15 +4437,15 @@ var Channel = /*#__PURE__*/function () {
4393
4437
  }, {
4394
4438
  key: "getPinnedMessages",
4395
4439
  value: function () {
4396
- var _getPinnedMessages = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee39(options) {
4440
+ var _getPinnedMessages = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee40(options) {
4397
4441
  var sort,
4398
- _args39 = arguments;
4399
- return _regeneratorRuntime.wrap(function _callee39$(_context39) {
4442
+ _args40 = arguments;
4443
+ return _regeneratorRuntime.wrap(function _callee40$(_context40) {
4400
4444
  while (1) {
4401
- switch (_context39.prev = _context39.next) {
4445
+ switch (_context40.prev = _context40.next) {
4402
4446
  case 0:
4403
- sort = _args39.length > 1 && _args39[1] !== undefined ? _args39[1] : [];
4404
- _context39.next = 3;
4447
+ sort = _args40.length > 1 && _args40[1] !== undefined ? _args40[1] : [];
4448
+ _context40.next = 3;
4405
4449
  return this.getClient().get(this._channelURL() + '/pinned_messages', {
4406
4450
  payload: _objectSpread$c(_objectSpread$c({}, options), {}, {
4407
4451
  sort: normalizeQuerySort(sort)
@@ -4409,17 +4453,17 @@ var Channel = /*#__PURE__*/function () {
4409
4453
  });
4410
4454
 
4411
4455
  case 3:
4412
- return _context39.abrupt("return", _context39.sent);
4456
+ return _context40.abrupt("return", _context40.sent);
4413
4457
 
4414
4458
  case 4:
4415
4459
  case "end":
4416
- return _context39.stop();
4460
+ return _context40.stop();
4417
4461
  }
4418
4462
  }
4419
- }, _callee39, this);
4463
+ }, _callee40, this);
4420
4464
  }));
4421
4465
 
4422
- function getPinnedMessages(_x38) {
4466
+ function getPinnedMessages(_x40) {
4423
4467
  return _getPinnedMessages.apply(this, arguments);
4424
4468
  }
4425
4469
 
@@ -4555,7 +4599,7 @@ var Channel = /*#__PURE__*/function () {
4555
4599
  * @return {Promise<QueryChannelAPIResponse<StreamChatGenerics>>} Returns a query response
4556
4600
  */
4557
4601
  function () {
4558
- var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee40(options) {
4602
+ var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee41(options) {
4559
4603
  var _options$messages$lim, _options$messages, _this$data6, _this$data7;
4560
4604
 
4561
4605
  var messageSetToAddToIfDoesNotExist,
@@ -4565,14 +4609,14 @@ var Channel = /*#__PURE__*/function () {
4565
4609
  _this$_initializeStat,
4566
4610
  messageSet,
4567
4611
  areCapabilitiesChanged,
4568
- _args40 = arguments;
4612
+ _args41 = arguments;
4569
4613
 
4570
- return _regeneratorRuntime.wrap(function _callee40$(_context40) {
4614
+ return _regeneratorRuntime.wrap(function _callee41$(_context41) {
4571
4615
  while (1) {
4572
- switch (_context40.prev = _context40.next) {
4616
+ switch (_context41.prev = _context41.next) {
4573
4617
  case 0:
4574
- messageSetToAddToIfDoesNotExist = _args40.length > 1 && _args40[1] !== undefined ? _args40[1] : 'current';
4575
- _context40.next = 3;
4618
+ messageSetToAddToIfDoesNotExist = _args41.length > 1 && _args41[1] !== undefined ? _args41[1] : 'current';
4619
+ _context41.next = 3;
4576
4620
  return this.getClient().wsPromise;
4577
4621
 
4578
4622
  case 3:
@@ -4582,14 +4626,14 @@ var Channel = /*#__PURE__*/function () {
4582
4626
  queryURL += "/".concat(encodeURIComponent(this.id));
4583
4627
  }
4584
4628
 
4585
- _context40.next = 7;
4629
+ _context41.next = 7;
4586
4630
  return this.getClient().post(queryURL + '/query', _objectSpread$c({
4587
4631
  data: this._data,
4588
4632
  state: true
4589
4633
  }, options));
4590
4634
 
4591
4635
  case 7:
4592
- state = _context40.sent;
4636
+ state = _context41.sent;
4593
4637
 
4594
4638
  // update the channel id if it was missing
4595
4639
  if (!this.id) {
@@ -4644,17 +4688,17 @@ var Channel = /*#__PURE__*/function () {
4644
4688
  isLatestMessageSet: messageSet.isLatest
4645
4689
  }
4646
4690
  });
4647
- return _context40.abrupt("return", state);
4691
+ return _context41.abrupt("return", state);
4648
4692
 
4649
4693
  case 19:
4650
4694
  case "end":
4651
- return _context40.stop();
4695
+ return _context41.stop();
4652
4696
  }
4653
4697
  }
4654
- }, _callee40, this);
4698
+ }, _callee41, this);
4655
4699
  }));
4656
4700
 
4657
- function query(_x39) {
4701
+ function query(_x41) {
4658
4702
  return _query.apply(this, arguments);
4659
4703
  }
4660
4704
 
@@ -4671,31 +4715,31 @@ var Channel = /*#__PURE__*/function () {
4671
4715
  }, {
4672
4716
  key: "banUser",
4673
4717
  value: function () {
4674
- var _banUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee41(targetUserID, options) {
4675
- return _regeneratorRuntime.wrap(function _callee41$(_context41) {
4718
+ var _banUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42(targetUserID, options) {
4719
+ return _regeneratorRuntime.wrap(function _callee42$(_context42) {
4676
4720
  while (1) {
4677
- switch (_context41.prev = _context41.next) {
4721
+ switch (_context42.prev = _context42.next) {
4678
4722
  case 0:
4679
4723
  this._checkInitialized();
4680
4724
 
4681
- _context41.next = 3;
4725
+ _context42.next = 3;
4682
4726
  return this.getClient().banUser(targetUserID, _objectSpread$c(_objectSpread$c({}, options), {}, {
4683
4727
  type: this.type,
4684
4728
  id: this.id
4685
4729
  }));
4686
4730
 
4687
4731
  case 3:
4688
- return _context41.abrupt("return", _context41.sent);
4732
+ return _context42.abrupt("return", _context42.sent);
4689
4733
 
4690
4734
  case 4:
4691
4735
  case "end":
4692
- return _context41.stop();
4736
+ return _context42.stop();
4693
4737
  }
4694
4738
  }
4695
- }, _callee41, this);
4739
+ }, _callee42, this);
4696
4740
  }));
4697
4741
 
4698
- function banUser(_x40, _x41) {
4742
+ function banUser(_x42, _x43) {
4699
4743
  return _banUser.apply(this, arguments);
4700
4744
  }
4701
4745
 
@@ -4713,34 +4757,34 @@ var Channel = /*#__PURE__*/function () {
4713
4757
  }, {
4714
4758
  key: "hide",
4715
4759
  value: function () {
4716
- var _hide = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42() {
4760
+ var _hide = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee43() {
4717
4761
  var userId,
4718
4762
  clearHistory,
4719
- _args42 = arguments;
4720
- return _regeneratorRuntime.wrap(function _callee42$(_context42) {
4763
+ _args43 = arguments;
4764
+ return _regeneratorRuntime.wrap(function _callee43$(_context43) {
4721
4765
  while (1) {
4722
- switch (_context42.prev = _context42.next) {
4766
+ switch (_context43.prev = _context43.next) {
4723
4767
  case 0:
4724
- userId = _args42.length > 0 && _args42[0] !== undefined ? _args42[0] : null;
4725
- clearHistory = _args42.length > 1 && _args42[1] !== undefined ? _args42[1] : false;
4768
+ userId = _args43.length > 0 && _args43[0] !== undefined ? _args43[0] : null;
4769
+ clearHistory = _args43.length > 1 && _args43[1] !== undefined ? _args43[1] : false;
4726
4770
 
4727
4771
  this._checkInitialized();
4728
4772
 
4729
- _context42.next = 5;
4773
+ _context43.next = 5;
4730
4774
  return this.getClient().post("".concat(this._channelURL(), "/hide"), {
4731
4775
  user_id: userId,
4732
4776
  clear_history: clearHistory
4733
4777
  });
4734
4778
 
4735
4779
  case 5:
4736
- return _context42.abrupt("return", _context42.sent);
4780
+ return _context43.abrupt("return", _context43.sent);
4737
4781
 
4738
4782
  case 6:
4739
4783
  case "end":
4740
- return _context42.stop();
4784
+ return _context43.stop();
4741
4785
  }
4742
4786
  }
4743
- }, _callee42, this);
4787
+ }, _callee43, this);
4744
4788
  }));
4745
4789
 
4746
4790
  function hide() {
@@ -4759,31 +4803,31 @@ var Channel = /*#__PURE__*/function () {
4759
4803
  }, {
4760
4804
  key: "show",
4761
4805
  value: function () {
4762
- var _show = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee43() {
4806
+ var _show = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44() {
4763
4807
  var userId,
4764
- _args43 = arguments;
4765
- return _regeneratorRuntime.wrap(function _callee43$(_context43) {
4808
+ _args44 = arguments;
4809
+ return _regeneratorRuntime.wrap(function _callee44$(_context44) {
4766
4810
  while (1) {
4767
- switch (_context43.prev = _context43.next) {
4811
+ switch (_context44.prev = _context44.next) {
4768
4812
  case 0:
4769
- userId = _args43.length > 0 && _args43[0] !== undefined ? _args43[0] : null;
4813
+ userId = _args44.length > 0 && _args44[0] !== undefined ? _args44[0] : null;
4770
4814
 
4771
4815
  this._checkInitialized();
4772
4816
 
4773
- _context43.next = 4;
4817
+ _context44.next = 4;
4774
4818
  return this.getClient().post("".concat(this._channelURL(), "/show"), {
4775
4819
  user_id: userId
4776
4820
  });
4777
4821
 
4778
4822
  case 4:
4779
- return _context43.abrupt("return", _context43.sent);
4823
+ return _context44.abrupt("return", _context44.sent);
4780
4824
 
4781
4825
  case 5:
4782
4826
  case "end":
4783
- return _context43.stop();
4827
+ return _context44.stop();
4784
4828
  }
4785
4829
  }
4786
- }, _callee43, this);
4830
+ }, _callee44, this);
4787
4831
  }));
4788
4832
 
4789
4833
  function show() {
@@ -4802,31 +4846,31 @@ var Channel = /*#__PURE__*/function () {
4802
4846
  }, {
4803
4847
  key: "unbanUser",
4804
4848
  value: function () {
4805
- var _unbanUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44(targetUserID) {
4806
- return _regeneratorRuntime.wrap(function _callee44$(_context44) {
4849
+ var _unbanUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45(targetUserID) {
4850
+ return _regeneratorRuntime.wrap(function _callee45$(_context45) {
4807
4851
  while (1) {
4808
- switch (_context44.prev = _context44.next) {
4852
+ switch (_context45.prev = _context45.next) {
4809
4853
  case 0:
4810
4854
  this._checkInitialized();
4811
4855
 
4812
- _context44.next = 3;
4856
+ _context45.next = 3;
4813
4857
  return this.getClient().unbanUser(targetUserID, {
4814
4858
  type: this.type,
4815
4859
  id: this.id
4816
4860
  });
4817
4861
 
4818
4862
  case 3:
4819
- return _context44.abrupt("return", _context44.sent);
4863
+ return _context45.abrupt("return", _context45.sent);
4820
4864
 
4821
4865
  case 4:
4822
4866
  case "end":
4823
- return _context44.stop();
4867
+ return _context45.stop();
4824
4868
  }
4825
4869
  }
4826
- }, _callee44, this);
4870
+ }, _callee45, this);
4827
4871
  }));
4828
4872
 
4829
- function unbanUser(_x42) {
4873
+ function unbanUser(_x44) {
4830
4874
  return _unbanUser.apply(this, arguments);
4831
4875
  }
4832
4876
 
@@ -4843,31 +4887,31 @@ var Channel = /*#__PURE__*/function () {
4843
4887
  }, {
4844
4888
  key: "shadowBan",
4845
4889
  value: function () {
4846
- var _shadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45(targetUserID, options) {
4847
- return _regeneratorRuntime.wrap(function _callee45$(_context45) {
4890
+ var _shadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46(targetUserID, options) {
4891
+ return _regeneratorRuntime.wrap(function _callee46$(_context46) {
4848
4892
  while (1) {
4849
- switch (_context45.prev = _context45.next) {
4893
+ switch (_context46.prev = _context46.next) {
4850
4894
  case 0:
4851
4895
  this._checkInitialized();
4852
4896
 
4853
- _context45.next = 3;
4897
+ _context46.next = 3;
4854
4898
  return this.getClient().shadowBan(targetUserID, _objectSpread$c(_objectSpread$c({}, options), {}, {
4855
4899
  type: this.type,
4856
4900
  id: this.id
4857
4901
  }));
4858
4902
 
4859
4903
  case 3:
4860
- return _context45.abrupt("return", _context45.sent);
4904
+ return _context46.abrupt("return", _context46.sent);
4861
4905
 
4862
4906
  case 4:
4863
4907
  case "end":
4864
- return _context45.stop();
4908
+ return _context46.stop();
4865
4909
  }
4866
4910
  }
4867
- }, _callee45, this);
4911
+ }, _callee46, this);
4868
4912
  }));
4869
4913
 
4870
- function shadowBan(_x43, _x44) {
4914
+ function shadowBan(_x45, _x46) {
4871
4915
  return _shadowBan.apply(this, arguments);
4872
4916
  }
4873
4917
 
@@ -4883,31 +4927,31 @@ var Channel = /*#__PURE__*/function () {
4883
4927
  }, {
4884
4928
  key: "removeShadowBan",
4885
4929
  value: function () {
4886
- var _removeShadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46(targetUserID) {
4887
- return _regeneratorRuntime.wrap(function _callee46$(_context46) {
4930
+ var _removeShadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee47(targetUserID) {
4931
+ return _regeneratorRuntime.wrap(function _callee47$(_context47) {
4888
4932
  while (1) {
4889
- switch (_context46.prev = _context46.next) {
4933
+ switch (_context47.prev = _context47.next) {
4890
4934
  case 0:
4891
4935
  this._checkInitialized();
4892
4936
 
4893
- _context46.next = 3;
4937
+ _context47.next = 3;
4894
4938
  return this.getClient().removeShadowBan(targetUserID, {
4895
4939
  type: this.type,
4896
4940
  id: this.id
4897
4941
  });
4898
4942
 
4899
4943
  case 3:
4900
- return _context46.abrupt("return", _context46.sent);
4944
+ return _context47.abrupt("return", _context47.sent);
4901
4945
 
4902
4946
  case 4:
4903
4947
  case "end":
4904
- return _context46.stop();
4948
+ return _context47.stop();
4905
4949
  }
4906
4950
  }
4907
- }, _callee46, this);
4951
+ }, _callee47, this);
4908
4952
  }));
4909
4953
 
4910
- function removeShadowBan(_x45) {
4954
+ function removeShadowBan(_x47) {
4911
4955
  return _removeShadowBan.apply(this, arguments);
4912
4956
  }
4913
4957
 
@@ -4923,26 +4967,26 @@ var Channel = /*#__PURE__*/function () {
4923
4967
  }, {
4924
4968
  key: "createCall",
4925
4969
  value: function () {
4926
- var _createCall = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee47(options) {
4927
- return _regeneratorRuntime.wrap(function _callee47$(_context47) {
4970
+ var _createCall = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee48(options) {
4971
+ return _regeneratorRuntime.wrap(function _callee48$(_context48) {
4928
4972
  while (1) {
4929
- switch (_context47.prev = _context47.next) {
4973
+ switch (_context48.prev = _context48.next) {
4930
4974
  case 0:
4931
- _context47.next = 2;
4975
+ _context48.next = 2;
4932
4976
  return this.getClient().post(this._channelURL() + '/call', options);
4933
4977
 
4934
4978
  case 2:
4935
- return _context47.abrupt("return", _context47.sent);
4979
+ return _context48.abrupt("return", _context48.sent);
4936
4980
 
4937
4981
  case 3:
4938
4982
  case "end":
4939
- return _context47.stop();
4983
+ return _context48.stop();
4940
4984
  }
4941
4985
  }
4942
- }, _callee47, this);
4986
+ }, _callee48, this);
4943
4987
  }));
4944
4988
 
4945
- function createCall(_x46) {
4989
+ function createCall(_x48) {
4946
4990
  return _createCall.apply(this, arguments);
4947
4991
  }
4948
4992
 
@@ -4958,26 +5002,26 @@ var Channel = /*#__PURE__*/function () {
4958
5002
  }, {
4959
5003
  key: "vote",
4960
5004
  value: function () {
4961
- var _vote2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee48(messageId, pollId, _vote) {
4962
- return _regeneratorRuntime.wrap(function _callee48$(_context48) {
5005
+ var _vote2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49(messageId, pollId, _vote) {
5006
+ return _regeneratorRuntime.wrap(function _callee49$(_context49) {
4963
5007
  while (1) {
4964
- switch (_context48.prev = _context48.next) {
5008
+ switch (_context49.prev = _context49.next) {
4965
5009
  case 0:
4966
- _context48.next = 2;
5010
+ _context49.next = 2;
4967
5011
  return this.getClient().castPollVote(messageId, pollId, _vote);
4968
5012
 
4969
5013
  case 2:
4970
- return _context48.abrupt("return", _context48.sent);
5014
+ return _context49.abrupt("return", _context49.sent);
4971
5015
 
4972
5016
  case 3:
4973
5017
  case "end":
4974
- return _context48.stop();
5018
+ return _context49.stop();
4975
5019
  }
4976
5020
  }
4977
- }, _callee48, this);
5021
+ }, _callee49, this);
4978
5022
  }));
4979
5023
 
4980
- function vote(_x47, _x48, _x49) {
5024
+ function vote(_x49, _x50, _x51) {
4981
5025
  return _vote2.apply(this, arguments);
4982
5026
  }
4983
5027
 
@@ -4986,26 +5030,26 @@ var Channel = /*#__PURE__*/function () {
4986
5030
  }, {
4987
5031
  key: "removeVote",
4988
5032
  value: function () {
4989
- var _removeVote = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49(messageId, pollId, voteId) {
4990
- return _regeneratorRuntime.wrap(function _callee49$(_context49) {
5033
+ var _removeVote = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee50(messageId, pollId, voteId) {
5034
+ return _regeneratorRuntime.wrap(function _callee50$(_context50) {
4991
5035
  while (1) {
4992
- switch (_context49.prev = _context49.next) {
5036
+ switch (_context50.prev = _context50.next) {
4993
5037
  case 0:
4994
- _context49.next = 2;
5038
+ _context50.next = 2;
4995
5039
  return this.getClient().removePollVote(messageId, pollId, voteId);
4996
5040
 
4997
5041
  case 2:
4998
- return _context49.abrupt("return", _context49.sent);
5042
+ return _context50.abrupt("return", _context50.sent);
4999
5043
 
5000
5044
  case 3:
5001
5045
  case "end":
5002
- return _context49.stop();
5046
+ return _context50.stop();
5003
5047
  }
5004
5048
  }
5005
- }, _callee49, this);
5049
+ }, _callee50, this);
5006
5050
  }));
5007
5051
 
5008
- function removeVote(_x50, _x51, _x52) {
5052
+ function removeVote(_x52, _x53, _x54) {
5009
5053
  return _removeVote.apply(this, arguments);
5010
5054
  }
5011
5055
 
@@ -5024,28 +5068,28 @@ var Channel = /*#__PURE__*/function () {
5024
5068
  }, {
5025
5069
  key: "createDraft",
5026
5070
  value: function () {
5027
- var _createDraft = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee50(message) {
5028
- return _regeneratorRuntime.wrap(function _callee50$(_context50) {
5071
+ var _createDraft = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee51(message) {
5072
+ return _regeneratorRuntime.wrap(function _callee51$(_context51) {
5029
5073
  while (1) {
5030
- switch (_context50.prev = _context50.next) {
5074
+ switch (_context51.prev = _context51.next) {
5031
5075
  case 0:
5032
- _context50.next = 2;
5076
+ _context51.next = 2;
5033
5077
  return this.getClient().post(this._channelURL() + '/draft', {
5034
5078
  message: message
5035
5079
  });
5036
5080
 
5037
5081
  case 2:
5038
- return _context50.abrupt("return", _context50.sent);
5082
+ return _context51.abrupt("return", _context51.sent);
5039
5083
 
5040
5084
  case 3:
5041
5085
  case "end":
5042
- return _context50.stop();
5086
+ return _context51.stop();
5043
5087
  }
5044
5088
  }
5045
- }, _callee50, this);
5089
+ }, _callee51, this);
5046
5090
  }));
5047
5091
 
5048
- function createDraft(_x53) {
5092
+ function createDraft(_x55) {
5049
5093
  return _createDraft.apply(this, arguments);
5050
5094
  }
5051
5095
 
@@ -5063,30 +5107,30 @@ var Channel = /*#__PURE__*/function () {
5063
5107
  }, {
5064
5108
  key: "deleteDraft",
5065
5109
  value: function () {
5066
- var _deleteDraft = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee51() {
5110
+ var _deleteDraft = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee52() {
5067
5111
  var _ref2,
5068
5112
  parent_id,
5069
- _args51 = arguments;
5113
+ _args52 = arguments;
5070
5114
 
5071
- return _regeneratorRuntime.wrap(function _callee51$(_context51) {
5115
+ return _regeneratorRuntime.wrap(function _callee52$(_context52) {
5072
5116
  while (1) {
5073
- switch (_context51.prev = _context51.next) {
5117
+ switch (_context52.prev = _context52.next) {
5074
5118
  case 0:
5075
- _ref2 = _args51.length > 0 && _args51[0] !== undefined ? _args51[0] : {}, parent_id = _ref2.parent_id;
5076
- _context51.next = 3;
5119
+ _ref2 = _args52.length > 0 && _args52[0] !== undefined ? _args52[0] : {}, parent_id = _ref2.parent_id;
5120
+ _context52.next = 3;
5077
5121
  return this.getClient().delete(this._channelURL() + '/draft', {
5078
5122
  parent_id: parent_id
5079
5123
  });
5080
5124
 
5081
5125
  case 3:
5082
- return _context51.abrupt("return", _context51.sent);
5126
+ return _context52.abrupt("return", _context52.sent);
5083
5127
 
5084
5128
  case 4:
5085
5129
  case "end":
5086
- return _context51.stop();
5130
+ return _context52.stop();
5087
5131
  }
5088
5132
  }
5089
- }, _callee51, this);
5133
+ }, _callee52, this);
5090
5134
  }));
5091
5135
 
5092
5136
  function deleteDraft() {
@@ -5107,30 +5151,30 @@ var Channel = /*#__PURE__*/function () {
5107
5151
  }, {
5108
5152
  key: "getDraft",
5109
5153
  value: function () {
5110
- var _getDraft = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee52() {
5154
+ var _getDraft = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee53() {
5111
5155
  var _ref3,
5112
5156
  parent_id,
5113
- _args52 = arguments;
5157
+ _args53 = arguments;
5114
5158
 
5115
- return _regeneratorRuntime.wrap(function _callee52$(_context52) {
5159
+ return _regeneratorRuntime.wrap(function _callee53$(_context53) {
5116
5160
  while (1) {
5117
- switch (_context52.prev = _context52.next) {
5161
+ switch (_context53.prev = _context53.next) {
5118
5162
  case 0:
5119
- _ref3 = _args52.length > 0 && _args52[0] !== undefined ? _args52[0] : {}, parent_id = _ref3.parent_id;
5120
- _context52.next = 3;
5163
+ _ref3 = _args53.length > 0 && _args53[0] !== undefined ? _args53[0] : {}, parent_id = _ref3.parent_id;
5164
+ _context53.next = 3;
5121
5165
  return this.getClient().get(this._channelURL() + '/draft', {
5122
5166
  parent_id: parent_id
5123
5167
  });
5124
5168
 
5125
5169
  case 3:
5126
- return _context52.abrupt("return", _context52.sent);
5170
+ return _context53.abrupt("return", _context53.sent);
5127
5171
 
5128
5172
  case 4:
5129
5173
  case "end":
5130
- return _context52.stop();
5174
+ return _context53.stop();
5131
5175
  }
5132
5176
  }
5133
- }, _callee52, this);
5177
+ }, _callee53, this);
5134
5178
  }));
5135
5179
 
5136
5180
  function getDraft() {
@@ -5209,7 +5253,7 @@ var Channel = /*#__PURE__*/function () {
5209
5253
  }, {
5210
5254
  key: "_handleChannelEvent",
5211
5255
  value: function _handleChannelEvent(event) {
5212
- var _event$user, _event$user2, _event$user3, _event$user5, _event$user6, _event$channel, _event$member, _channelState$members, _event$member2, _event$member2$user, _event$user9, _event$user11, _channelState$members2, _event$user12, _channelState$members3;
5256
+ var _event$user, _event$user2, _event$user3, _event$user5, _event$user6, _event$channel, _event$user9, _event$user11, _channelState$members, _event$user12, _channelState$members2;
5213
5257
 
5214
5258
  var channel = this;
5215
5259
 
@@ -5383,15 +5427,31 @@ var Channel = /*#__PURE__*/function () {
5383
5427
 
5384
5428
  case 'member.added':
5385
5429
  case 'member.updated':
5386
- if ((_event$member = event.member) !== null && _event$member !== void 0 && _event$member.user) {
5387
- channelState.members = _objectSpread$c(_objectSpread$c({}, channelState.members), {}, _defineProperty({}, event.member.user.id, event.member));
5388
- }
5430
+ {
5431
+ var _memberCopy$user;
5389
5432
 
5390
- if (typeof ((_channelState$members = channelState.membership.user) === null || _channelState$members === void 0 ? void 0 : _channelState$members.id) === 'string' && typeof ((_event$member2 = event.member) === null || _event$member2 === void 0 ? void 0 : (_event$member2$user = _event$member2.user) === null || _event$member2$user === void 0 ? void 0 : _event$member2$user.id) === 'string' && event.member.user.id === channelState.membership.user.id) {
5391
- channelState.membership = event.member;
5392
- }
5433
+ var memberCopy = _objectSpread$c({}, event.member);
5393
5434
 
5394
- break;
5435
+ if (memberCopy.pinned_at === null) {
5436
+ delete memberCopy.pinned_at;
5437
+ }
5438
+
5439
+ if (memberCopy.archived_at === null) {
5440
+ delete memberCopy.archived_at;
5441
+ }
5442
+
5443
+ if (memberCopy !== null && memberCopy !== void 0 && memberCopy.user) {
5444
+ channelState.members = _objectSpread$c(_objectSpread$c({}, channelState.members), {}, _defineProperty({}, memberCopy.user.id, memberCopy));
5445
+ }
5446
+
5447
+ var currentUserId = this.getClient().userID;
5448
+
5449
+ if (typeof currentUserId === 'string' && typeof (memberCopy === null || memberCopy === void 0 ? void 0 : (_memberCopy$user = memberCopy.user) === null || _memberCopy$user === void 0 ? void 0 : _memberCopy$user.id) === 'string' && memberCopy.user.id === currentUserId) {
5450
+ channelState.membership = memberCopy;
5451
+ }
5452
+
5453
+ break;
5454
+ }
5395
5455
 
5396
5456
  case 'member.removed':
5397
5457
  if ((_event$user9 = event.user) !== null && _event$user9 !== void 0 && _event$user9.id) {
@@ -5492,7 +5552,7 @@ var Channel = /*#__PURE__*/function () {
5492
5552
  channelState.members[event.user.id] = _objectSpread$c(_objectSpread$c({}, channelState.members[event.user.id] || {}), {}, {
5493
5553
  shadow_banned: !!event.shadow,
5494
5554
  banned: !event.shadow,
5495
- user: _objectSpread$c(_objectSpread$c({}, ((_channelState$members2 = channelState.members[event.user.id]) === null || _channelState$members2 === void 0 ? void 0 : _channelState$members2.user) || {}), event.user)
5555
+ user: _objectSpread$c(_objectSpread$c({}, ((_channelState$members = channelState.members[event.user.id]) === null || _channelState$members === void 0 ? void 0 : _channelState$members.user) || {}), event.user)
5496
5556
  });
5497
5557
  break;
5498
5558
 
@@ -5501,7 +5561,7 @@ var Channel = /*#__PURE__*/function () {
5501
5561
  channelState.members[event.user.id] = _objectSpread$c(_objectSpread$c({}, channelState.members[event.user.id] || {}), {}, {
5502
5562
  shadow_banned: false,
5503
5563
  banned: false,
5504
- user: _objectSpread$c(_objectSpread$c({}, ((_channelState$members3 = channelState.members[event.user.id]) === null || _channelState$members3 === void 0 ? void 0 : _channelState$members3.user) || {}), event.user)
5564
+ user: _objectSpread$c(_objectSpread$c({}, ((_channelState$members2 = channelState.members[event.user.id]) === null || _channelState$members2 === void 0 ? void 0 : _channelState$members2.user) || {}), event.user)
5505
5565
  });
5506
5566
  break;
5507
5567
  } // any event can send over the online count
@@ -11774,6 +11834,10 @@ var StreamChat = /*#__PURE__*/function () {
11774
11834
 
11775
11835
  _defineProperty(this, "deviceIdentifier", void 0);
11776
11836
 
11837
+ _defineProperty(this, "appIdentifier", void 0);
11838
+
11839
+ _defineProperty(this, "cachedUserAgent", void 0);
11840
+
11777
11841
  _defineProperty(this, "nextRequestAbortController", null);
11778
11842
 
11779
11843
  _defineProperty(this, "_getConnectionID", function () {
@@ -12511,6 +12575,55 @@ var StreamChat = /*#__PURE__*/function () {
12511
12575
 
12512
12576
  _defineProperty(this, "markAllRead", this.markChannelsRead);
12513
12577
 
12578
+ _defineProperty(this, "getUserAgent", function () {
12579
+ // An explicit override (deprecated `setUserAgent`) always wins and is never cached.
12580
+ if (_this.userAgent) {
12581
+ return _this.userAgent;
12582
+ } // Computed once, then memoized for the client's lifetime - inputs read on
12583
+ // the first call (sdk/app/device identifiers, build-time env) are not re-read.
12584
+
12585
+
12586
+ if (!_this.cachedUserAgent) {
12587
+ var _this$sdkIdentifier, _this$appIdentifier, _this$deviceIdentifie;
12588
+
12589
+ var version = "8.61.0";
12590
+
12591
+ var _ref8 = (_this$sdkIdentifier = _this.sdkIdentifier) !== null && _this$sdkIdentifier !== void 0 ? _this$sdkIdentifier : {},
12592
+ sdkName = _ref8.name,
12593
+ sdkVersion = _ref8.version;
12594
+
12595
+ var _ref9 = (_this$appIdentifier = _this.appIdentifier) !== null && _this$appIdentifier !== void 0 ? _this$appIdentifier : {},
12596
+ appName = _ref9.name,
12597
+ appVersion = _ref9.version;
12598
+
12599
+ var _ref10 = (_this$deviceIdentifie = _this.deviceIdentifier) !== null && _this$deviceIdentifie !== void 0 ? _this$deviceIdentifie : {},
12600
+ os = _ref10.os,
12601
+ deviceModel = _ref10.model;
12602
+
12603
+ var head = sdkName ? "stream-chat-".concat(sdkName, "-v").concat(sdkVersion, "-llc-v").concat(version) : "stream-chat-js-v".concat(version, "-").concat(_this.node ? 'node' : 'browser');
12604
+ _this.cachedUserAgent = [head].concat(_toConsumableArray(Object.entries({
12605
+ app: appName,
12606
+ app_version: appVersion,
12607
+ os: os,
12608
+ device_model: deviceModel,
12609
+ client_bundle: ""
12610
+ }).filter(function (_ref11) {
12611
+ var _ref12 = _slicedToArray(_ref11, 2),
12612
+ value = _ref12[1];
12613
+
12614
+ return value && value.length > 0;
12615
+ }).map(function (_ref13) {
12616
+ var _ref14 = _slicedToArray(_ref13, 2),
12617
+ key = _ref14[0],
12618
+ value = _ref14[1];
12619
+
12620
+ return "".concat(key, "=").concat(value);
12621
+ }))).join('|');
12622
+ }
12623
+
12624
+ return _this.cachedUserAgent;
12625
+ });
12626
+
12514
12627
  _defineProperty(this, "_isUsingServerAuth", function () {
12515
12628
  return !!_this.secret;
12516
12629
  });
@@ -14287,13 +14400,13 @@ var StreamChat = /*#__PURE__*/function () {
14287
14400
  key: "getRateLimits",
14288
14401
  value: function () {
14289
14402
  var _getRateLimits = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee29(params) {
14290
- var _ref8, serverSide, web, android, ios, endpoints;
14403
+ var _ref15, serverSide, web, android, ios, endpoints;
14291
14404
 
14292
14405
  return _regeneratorRuntime.wrap(function _callee29$(_context29) {
14293
14406
  while (1) {
14294
14407
  switch (_context29.prev = _context29.next) {
14295
14408
  case 0:
14296
- _ref8 = params || {}, serverSide = _ref8.serverSide, web = _ref8.web, android = _ref8.android, ios = _ref8.ios, endpoints = _ref8.endpoints;
14409
+ _ref15 = params || {}, serverSide = _ref15.serverSide, web = _ref15.web, android = _ref15.android, ios = _ref15.ios, endpoints = _ref15.endpoints;
14297
14410
  return _context29.abrupt("return", this.get(this.baseURL + '/rate_limits', {
14298
14411
  server_side: serverSide,
14299
14412
  web: web,
@@ -14318,9 +14431,9 @@ var StreamChat = /*#__PURE__*/function () {
14318
14431
  }()
14319
14432
  }, {
14320
14433
  key: "_addChannelConfig",
14321
- value: function _addChannelConfig(_ref9) {
14322
- var cid = _ref9.cid,
14323
- config = _ref9.config;
14434
+ value: function _addChannelConfig(_ref16) {
14435
+ var cid = _ref16.cid,
14436
+ config = _ref16.config;
14324
14437
 
14325
14438
  if (this._cacheEnabled()) {
14326
14439
  this.configs[cid] = config;
@@ -16116,6 +16229,8 @@ var StreamChat = /*#__PURE__*/function () {
16116
16229
  * @param {boolean} options.watch Subscribes the user to the channels of the threads.
16117
16230
  * @param {number} options.participant_limit Limits the number of participants returned per threads.
16118
16231
  * @param {number} options.reply_limit Limits the number of replies returned per threads.
16232
+ * @param {ThreadFilters} options.filter MongoDB style filters for threads
16233
+ * @param {ThreadSort} options.sort MongoDB style sort for threads
16119
16234
  *
16120
16235
  * @returns {{ threads: Thread<StreamChatGenerics>[], next: string }} Returns the list of threads and the next cursor.
16121
16236
  */
@@ -16128,6 +16243,7 @@ var StreamChat = /*#__PURE__*/function () {
16128
16243
 
16129
16244
  var options,
16130
16245
  optionsWithDefaults,
16246
+ requestBody,
16131
16247
  response,
16132
16248
  _args66 = arguments;
16133
16249
  return _regeneratorRuntime.wrap(function _callee66$(_context66) {
@@ -16141,10 +16257,20 @@ var StreamChat = /*#__PURE__*/function () {
16141
16257
  reply_limit: 3,
16142
16258
  watch: true
16143
16259
  }, options);
16144
- _context66.next = 4;
16145
- return this.post("".concat(this.baseURL, "/threads"), optionsWithDefaults);
16260
+ requestBody = _objectSpread$1({}, optionsWithDefaults);
16146
16261
 
16147
- case 4:
16262
+ if (optionsWithDefaults.filter && Object.keys(optionsWithDefaults.filter).length > 0) {
16263
+ requestBody.filter = optionsWithDefaults.filter;
16264
+ }
16265
+
16266
+ if (optionsWithDefaults.sort && (Array.isArray(optionsWithDefaults.sort) ? optionsWithDefaults.sort.length > 0 : Object.keys(optionsWithDefaults.sort).length > 0)) {
16267
+ requestBody.sort = normalizeQuerySort(optionsWithDefaults.sort);
16268
+ }
16269
+
16270
+ _context66.next = 7;
16271
+ return this.post("".concat(this.baseURL, "/threads"), requestBody);
16272
+
16273
+ case 7:
16148
16274
  response = _context66.sent;
16149
16275
  return _context66.abrupt("return", {
16150
16276
  threads: response.threads.map(function (thread) {
@@ -16156,7 +16282,7 @@ var StreamChat = /*#__PURE__*/function () {
16156
16282
  next: response.next
16157
16283
  });
16158
16284
 
16159
- case 6:
16285
+ case 9:
16160
16286
  case "end":
16161
16287
  return _context66.stop();
16162
16288
  }
@@ -16306,47 +16432,13 @@ var StreamChat = /*#__PURE__*/function () {
16306
16432
  return partialUpdateThread;
16307
16433
  }()
16308
16434
  }, {
16309
- key: "getUserAgent",
16310
- value: function getUserAgent() {
16311
- var _this$deviceIdentifie;
16312
-
16313
- if (this.userAgent) {
16314
- return this.userAgent;
16315
- }
16316
-
16317
- var version = "8.59.0";
16318
- var clientBundle = "";
16319
- var userAgentString = '';
16320
-
16321
- if (this.sdkIdentifier) {
16322
- userAgentString = "stream-chat-".concat(this.sdkIdentifier.name, "-v").concat(this.sdkIdentifier.version, "-llc-v").concat(version);
16323
- } else {
16324
- userAgentString = "stream-chat-js-v".concat(version, "-").concat(this.node ? 'node' : 'browser');
16325
- }
16326
-
16327
- var _ref10 = (_this$deviceIdentifie = this.deviceIdentifier) !== null && _this$deviceIdentifie !== void 0 ? _this$deviceIdentifie : {},
16328
- os = _ref10.os,
16329
- model = _ref10.model;
16330
-
16331
- return [// reports the device OS, if provided
16332
- ['os', os], // reports the device model, if provided
16333
- ['device_model', model], // reports which bundle is being picked from the exports
16334
- ['client_bundle', clientBundle]].reduce(function (withArguments, _ref11) {
16335
- var _ref12 = _slicedToArray(_ref11, 2),
16336
- key = _ref12[0],
16337
- value = _ref12[1];
16338
-
16339
- return value && value.length > 0 ? withArguments.concat("|".concat(key, "=").concat(value)) : withArguments;
16340
- }, userAgentString);
16341
- }
16435
+ key: "setUserAgent",
16436
+ value:
16342
16437
  /**
16343
16438
  * @deprecated use sdkIdentifier instead
16344
16439
  * @param userAgent
16345
16440
  */
16346
-
16347
- }, {
16348
- key: "setUserAgent",
16349
- value: function setUserAgent(userAgent) {
16441
+ function setUserAgent(userAgent) {
16350
16442
  this.userAgent = userAgent;
16351
16443
  }
16352
16444
  /**
@@ -16382,10 +16474,10 @@ var StreamChat = /*#__PURE__*/function () {
16382
16474
  });
16383
16475
  }
16384
16476
 
16385
- var _ref13 = this.options.axiosRequestConfig || {},
16386
- axiosRequestConfigParams = _ref13.params,
16387
- axiosRequestConfigHeaders = _ref13.headers,
16388
- axiosRequestConfigRest = _objectWithoutProperties(_ref13, _excluded2);
16477
+ var _ref17 = this.options.axiosRequestConfig || {},
16478
+ axiosRequestConfigParams = _ref17.params,
16479
+ axiosRequestConfigHeaders = _ref17.headers,
16480
+ axiosRequestConfigRest = _objectWithoutProperties(_ref17, _excluded2);
16389
16481
 
16390
16482
  return _objectSpread$1(_objectSpread$1(_objectSpread$1({
16391
16483
  params: _objectSpread$1(_objectSpread$1({
@@ -17728,13 +17820,13 @@ var StreamChat = /*#__PURE__*/function () {
17728
17820
  }, {
17729
17821
  key: "deletePushProvider",
17730
17822
  value: function () {
17731
- var _deletePushProvider = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee97(_ref14) {
17823
+ var _deletePushProvider = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee97(_ref18) {
17732
17824
  var type, name;
17733
17825
  return _regeneratorRuntime.wrap(function _callee97$(_context97) {
17734
17826
  while (1) {
17735
17827
  switch (_context97.prev = _context97.next) {
17736
17828
  case 0:
17737
- type = _ref14.type, name = _ref14.name;
17829
+ type = _ref18.type, name = _ref18.name;
17738
17830
  _context97.next = 3;
17739
17831
  return this.delete(this.baseURL + "/push_providers/".concat(encodeURIComponent(type), "/").concat(encodeURIComponent(name)));
17740
17832