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