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