stream-chat 8.59.0 → 8.61.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.es.js +589 -497
- package/dist/browser.es.js.map +1 -1
- package/dist/browser.full-bundle.min.js +1 -1
- package/dist/browser.full-bundle.min.js.map +1 -1
- package/dist/browser.js +590 -498
- package/dist/browser.js.map +1 -1
- package/dist/index.es.js +589 -497
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +590 -498
- package/dist/index.js.map +1 -1
- package/dist/types/channel.d.ts +12 -0
- package/dist/types/channel.d.ts.map +1 -1
- package/dist/types/client.d.ts +6 -54
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/types.d.ts +36 -2
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +7 -6
- package/src/channel.ts +40 -7
- package/src/client.ts +54 -26
- package/src/types.ts +49 -2
package/dist/browser.js
CHANGED
|
@@ -8,10 +8,10 @@ var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
|
|
|
8
8
|
var _createClass = require('@babel/runtime/helpers/createClass');
|
|
9
9
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
10
10
|
var _regeneratorRuntime = require('@babel/runtime/regenerator');
|
|
11
|
-
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
12
11
|
var _extends = require('@babel/runtime/helpers/extends');
|
|
13
12
|
var _typeof = require('@babel/runtime/helpers/typeof');
|
|
14
13
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
14
|
+
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
15
15
|
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
16
16
|
var axios = require('axios');
|
|
17
17
|
var FormData = require('form-data');
|
|
@@ -29,10 +29,10 @@ var _classCallCheck__default = /*#__PURE__*/_interopDefaultLegacy(_classCallChec
|
|
|
29
29
|
var _createClass__default = /*#__PURE__*/_interopDefaultLegacy(_createClass);
|
|
30
30
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
31
31
|
var _regeneratorRuntime__default = /*#__PURE__*/_interopDefaultLegacy(_regeneratorRuntime);
|
|
32
|
-
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
33
32
|
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
|
|
34
33
|
var _typeof__default = /*#__PURE__*/_interopDefaultLegacy(_typeof);
|
|
35
34
|
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
35
|
+
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
36
36
|
var _toConsumableArray__default = /*#__PURE__*/_interopDefaultLegacy(_toConsumableArray);
|
|
37
37
|
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
38
38
|
var FormData__default = /*#__PURE__*/_interopDefaultLegacy(FormData);
|
|
@@ -2762,6 +2762,50 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2762
2762
|
return queryMembers;
|
|
2763
2763
|
}()
|
|
2764
2764
|
/**
|
|
2765
|
+
* updateMemberPartial - Partial update a member
|
|
2766
|
+
*
|
|
2767
|
+
* @param {PartialUpdateMember<StreamChatGenerics>} updates
|
|
2768
|
+
* @param {{ user_id?: string }} [options] Option object, {user_id: 'jane'} to optionally specify the user id
|
|
2769
|
+
* @return {Promise<ChannelMemberResponse<StreamChatGenerics>>} Updated member
|
|
2770
|
+
*/
|
|
2771
|
+
|
|
2772
|
+
}, {
|
|
2773
|
+
key: "updateMemberPartial",
|
|
2774
|
+
value: function () {
|
|
2775
|
+
var _updateMemberPartial = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee6(updates, options) {
|
|
2776
|
+
var url;
|
|
2777
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee6$(_context6) {
|
|
2778
|
+
while (1) {
|
|
2779
|
+
switch (_context6.prev = _context6.next) {
|
|
2780
|
+
case 0:
|
|
2781
|
+
url = new URL("".concat(this._channelURL(), "/member"));
|
|
2782
|
+
|
|
2783
|
+
if (options !== null && options !== void 0 && options.userId) {
|
|
2784
|
+
url.searchParams.append('user_id', options.userId);
|
|
2785
|
+
}
|
|
2786
|
+
|
|
2787
|
+
_context6.next = 4;
|
|
2788
|
+
return this.getClient().patch(url.toString(), updates);
|
|
2789
|
+
|
|
2790
|
+
case 4:
|
|
2791
|
+
return _context6.abrupt("return", _context6.sent);
|
|
2792
|
+
|
|
2793
|
+
case 5:
|
|
2794
|
+
case "end":
|
|
2795
|
+
return _context6.stop();
|
|
2796
|
+
}
|
|
2797
|
+
}
|
|
2798
|
+
}, _callee6, this);
|
|
2799
|
+
}));
|
|
2800
|
+
|
|
2801
|
+
function updateMemberPartial(_x7, _x8) {
|
|
2802
|
+
return _updateMemberPartial.apply(this, arguments);
|
|
2803
|
+
}
|
|
2804
|
+
|
|
2805
|
+
return updateMemberPartial;
|
|
2806
|
+
}()
|
|
2807
|
+
/**
|
|
2808
|
+
* @deprecated Use `updateMemberPartial` instead
|
|
2765
2809
|
* partialUpdateMember - Partial update a member
|
|
2766
2810
|
*
|
|
2767
2811
|
* @param {string} user_id member user id
|
|
@@ -2773,34 +2817,34 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2773
2817
|
}, {
|
|
2774
2818
|
key: "partialUpdateMember",
|
|
2775
2819
|
value: function () {
|
|
2776
|
-
var _partialUpdateMember = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
2777
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
2820
|
+
var _partialUpdateMember = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee7(user_id, updates) {
|
|
2821
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee7$(_context7) {
|
|
2778
2822
|
while (1) {
|
|
2779
|
-
switch (
|
|
2823
|
+
switch (_context7.prev = _context7.next) {
|
|
2780
2824
|
case 0:
|
|
2781
2825
|
if (user_id) {
|
|
2782
|
-
|
|
2826
|
+
_context7.next = 2;
|
|
2783
2827
|
break;
|
|
2784
2828
|
}
|
|
2785
2829
|
|
|
2786
2830
|
throw Error('Please specify the user id');
|
|
2787
2831
|
|
|
2788
2832
|
case 2:
|
|
2789
|
-
|
|
2833
|
+
_context7.next = 4;
|
|
2790
2834
|
return this.getClient().patch(this._channelURL() + "/member/".concat(encodeURIComponent(user_id)), updates);
|
|
2791
2835
|
|
|
2792
2836
|
case 4:
|
|
2793
|
-
return
|
|
2837
|
+
return _context7.abrupt("return", _context7.sent);
|
|
2794
2838
|
|
|
2795
2839
|
case 5:
|
|
2796
2840
|
case "end":
|
|
2797
|
-
return
|
|
2841
|
+
return _context7.stop();
|
|
2798
2842
|
}
|
|
2799
2843
|
}
|
|
2800
|
-
},
|
|
2844
|
+
}, _callee7, this);
|
|
2801
2845
|
}));
|
|
2802
2846
|
|
|
2803
|
-
function partialUpdateMember(
|
|
2847
|
+
function partialUpdateMember(_x9, _x10) {
|
|
2804
2848
|
return _partialUpdateMember.apply(this, arguments);
|
|
2805
2849
|
}
|
|
2806
2850
|
|
|
@@ -2819,13 +2863,13 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2819
2863
|
}, {
|
|
2820
2864
|
key: "sendReaction",
|
|
2821
2865
|
value: function () {
|
|
2822
|
-
var _sendReaction = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
2823
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
2866
|
+
var _sendReaction = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee8(messageID, reaction, options) {
|
|
2867
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee8$(_context8) {
|
|
2824
2868
|
while (1) {
|
|
2825
|
-
switch (
|
|
2869
|
+
switch (_context8.prev = _context8.next) {
|
|
2826
2870
|
case 0:
|
|
2827
2871
|
if (messageID) {
|
|
2828
|
-
|
|
2872
|
+
_context8.next = 2;
|
|
2829
2873
|
break;
|
|
2830
2874
|
}
|
|
2831
2875
|
|
|
@@ -2833,30 +2877,30 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2833
2877
|
|
|
2834
2878
|
case 2:
|
|
2835
2879
|
if (!(!reaction || Object.keys(reaction).length === 0)) {
|
|
2836
|
-
|
|
2880
|
+
_context8.next = 4;
|
|
2837
2881
|
break;
|
|
2838
2882
|
}
|
|
2839
2883
|
|
|
2840
2884
|
throw Error("Reaction object is missing");
|
|
2841
2885
|
|
|
2842
2886
|
case 4:
|
|
2843
|
-
|
|
2887
|
+
_context8.next = 6;
|
|
2844
2888
|
return this.getClient().post(this.getClient().baseURL + "/messages/".concat(encodeURIComponent(messageID), "/reaction"), _objectSpread$c({
|
|
2845
2889
|
reaction: reaction
|
|
2846
2890
|
}, options));
|
|
2847
2891
|
|
|
2848
2892
|
case 6:
|
|
2849
|
-
return
|
|
2893
|
+
return _context8.abrupt("return", _context8.sent);
|
|
2850
2894
|
|
|
2851
2895
|
case 7:
|
|
2852
2896
|
case "end":
|
|
2853
|
-
return
|
|
2897
|
+
return _context8.stop();
|
|
2854
2898
|
}
|
|
2855
2899
|
}
|
|
2856
|
-
},
|
|
2900
|
+
}, _callee8, this);
|
|
2857
2901
|
}));
|
|
2858
2902
|
|
|
2859
|
-
function sendReaction(
|
|
2903
|
+
function sendReaction(_x11, _x12, _x13) {
|
|
2860
2904
|
return _sendReaction.apply(this, arguments);
|
|
2861
2905
|
}
|
|
2862
2906
|
|
|
@@ -2903,39 +2947,39 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2903
2947
|
}, {
|
|
2904
2948
|
key: "update",
|
|
2905
2949
|
value: function () {
|
|
2906
|
-
var _update2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
2950
|
+
var _update2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee9() {
|
|
2907
2951
|
var channelData,
|
|
2908
2952
|
updateMessage,
|
|
2909
2953
|
options,
|
|
2910
2954
|
reserved,
|
|
2911
|
-
|
|
2912
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
2955
|
+
_args9 = arguments;
|
|
2956
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee9$(_context9) {
|
|
2913
2957
|
while (1) {
|
|
2914
|
-
switch (
|
|
2958
|
+
switch (_context9.prev = _context9.next) {
|
|
2915
2959
|
case 0:
|
|
2916
|
-
channelData =
|
|
2917
|
-
updateMessage =
|
|
2918
|
-
options =
|
|
2960
|
+
channelData = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : {};
|
|
2961
|
+
updateMessage = _args9.length > 1 ? _args9[1] : undefined;
|
|
2962
|
+
options = _args9.length > 2 ? _args9[2] : undefined;
|
|
2919
2963
|
// Strip out reserved names that will result in API errors.
|
|
2920
2964
|
reserved = ['config', 'cid', 'created_by', 'id', 'member_count', 'type', 'created_at', 'updated_at', 'last_message_at', 'own_capabilities'];
|
|
2921
2965
|
reserved.forEach(function (key) {
|
|
2922
2966
|
delete channelData[key];
|
|
2923
2967
|
});
|
|
2924
|
-
|
|
2968
|
+
_context9.next = 7;
|
|
2925
2969
|
return this._update(_objectSpread$c({
|
|
2926
2970
|
message: updateMessage,
|
|
2927
2971
|
data: channelData
|
|
2928
2972
|
}, options));
|
|
2929
2973
|
|
|
2930
2974
|
case 7:
|
|
2931
|
-
return
|
|
2975
|
+
return _context9.abrupt("return", _context9.sent);
|
|
2932
2976
|
|
|
2933
2977
|
case 8:
|
|
2934
2978
|
case "end":
|
|
2935
|
-
return
|
|
2979
|
+
return _context9.stop();
|
|
2936
2980
|
}
|
|
2937
2981
|
}
|
|
2938
|
-
},
|
|
2982
|
+
}, _callee9, this);
|
|
2939
2983
|
}));
|
|
2940
2984
|
|
|
2941
2985
|
function update() {
|
|
@@ -2955,19 +2999,19 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2955
2999
|
}, {
|
|
2956
3000
|
key: "updatePartial",
|
|
2957
3001
|
value: function () {
|
|
2958
|
-
var _updatePartial = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3002
|
+
var _updatePartial = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee10(update) {
|
|
2959
3003
|
var _this$data2, _this$data3;
|
|
2960
3004
|
|
|
2961
3005
|
var data, areCapabilitiesChanged;
|
|
2962
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3006
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee10$(_context10) {
|
|
2963
3007
|
while (1) {
|
|
2964
|
-
switch (
|
|
3008
|
+
switch (_context10.prev = _context10.next) {
|
|
2965
3009
|
case 0:
|
|
2966
|
-
|
|
3010
|
+
_context10.next = 2;
|
|
2967
3011
|
return this.getClient().patch(this._channelURL(), update);
|
|
2968
3012
|
|
|
2969
3013
|
case 2:
|
|
2970
|
-
data =
|
|
3014
|
+
data = _context10.sent;
|
|
2971
3015
|
areCapabilitiesChanged = _toConsumableArray__default['default'](data.channel.own_capabilities || []).sort().join() !== _toConsumableArray__default['default'](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();
|
|
2972
3016
|
this.data = data.channel; // If the capabiltities are changed, we trigger the `capabilities.changed` event.
|
|
2973
3017
|
|
|
@@ -2979,17 +3023,17 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2979
3023
|
});
|
|
2980
3024
|
}
|
|
2981
3025
|
|
|
2982
|
-
return
|
|
3026
|
+
return _context10.abrupt("return", data);
|
|
2983
3027
|
|
|
2984
3028
|
case 7:
|
|
2985
3029
|
case "end":
|
|
2986
|
-
return
|
|
3030
|
+
return _context10.stop();
|
|
2987
3031
|
}
|
|
2988
3032
|
}
|
|
2989
|
-
},
|
|
3033
|
+
}, _callee10, this);
|
|
2990
3034
|
}));
|
|
2991
3035
|
|
|
2992
|
-
function updatePartial(
|
|
3036
|
+
function updatePartial(_x14) {
|
|
2993
3037
|
return _updatePartial.apply(this, arguments);
|
|
2994
3038
|
}
|
|
2995
3039
|
|
|
@@ -3005,31 +3049,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3005
3049
|
}, {
|
|
3006
3050
|
key: "enableSlowMode",
|
|
3007
3051
|
value: function () {
|
|
3008
|
-
var _enableSlowMode = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3052
|
+
var _enableSlowMode = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee11(coolDownInterval) {
|
|
3009
3053
|
var data;
|
|
3010
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3054
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee11$(_context11) {
|
|
3011
3055
|
while (1) {
|
|
3012
|
-
switch (
|
|
3056
|
+
switch (_context11.prev = _context11.next) {
|
|
3013
3057
|
case 0:
|
|
3014
|
-
|
|
3058
|
+
_context11.next = 2;
|
|
3015
3059
|
return this.getClient().post(this._channelURL(), {
|
|
3016
3060
|
cooldown: coolDownInterval
|
|
3017
3061
|
});
|
|
3018
3062
|
|
|
3019
3063
|
case 2:
|
|
3020
|
-
data =
|
|
3064
|
+
data = _context11.sent;
|
|
3021
3065
|
this.data = data.channel;
|
|
3022
|
-
return
|
|
3066
|
+
return _context11.abrupt("return", data);
|
|
3023
3067
|
|
|
3024
3068
|
case 5:
|
|
3025
3069
|
case "end":
|
|
3026
|
-
return
|
|
3070
|
+
return _context11.stop();
|
|
3027
3071
|
}
|
|
3028
3072
|
}
|
|
3029
|
-
},
|
|
3073
|
+
}, _callee11, this);
|
|
3030
3074
|
}));
|
|
3031
3075
|
|
|
3032
|
-
function enableSlowMode(
|
|
3076
|
+
function enableSlowMode(_x15) {
|
|
3033
3077
|
return _enableSlowMode.apply(this, arguments);
|
|
3034
3078
|
}
|
|
3035
3079
|
|
|
@@ -3044,28 +3088,28 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3044
3088
|
}, {
|
|
3045
3089
|
key: "disableSlowMode",
|
|
3046
3090
|
value: function () {
|
|
3047
|
-
var _disableSlowMode = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3091
|
+
var _disableSlowMode = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee12() {
|
|
3048
3092
|
var data;
|
|
3049
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3093
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee12$(_context12) {
|
|
3050
3094
|
while (1) {
|
|
3051
|
-
switch (
|
|
3095
|
+
switch (_context12.prev = _context12.next) {
|
|
3052
3096
|
case 0:
|
|
3053
|
-
|
|
3097
|
+
_context12.next = 2;
|
|
3054
3098
|
return this.getClient().post(this._channelURL(), {
|
|
3055
3099
|
cooldown: 0
|
|
3056
3100
|
});
|
|
3057
3101
|
|
|
3058
3102
|
case 2:
|
|
3059
|
-
data =
|
|
3103
|
+
data = _context12.sent;
|
|
3060
3104
|
this.data = data.channel;
|
|
3061
|
-
return
|
|
3105
|
+
return _context12.abrupt("return", data);
|
|
3062
3106
|
|
|
3063
3107
|
case 5:
|
|
3064
3108
|
case "end":
|
|
3065
|
-
return
|
|
3109
|
+
return _context12.stop();
|
|
3066
3110
|
}
|
|
3067
3111
|
}
|
|
3068
|
-
},
|
|
3112
|
+
}, _callee12, this);
|
|
3069
3113
|
}));
|
|
3070
3114
|
|
|
3071
3115
|
function disableSlowMode() {
|
|
@@ -3085,26 +3129,26 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3085
3129
|
}, {
|
|
3086
3130
|
key: "delete",
|
|
3087
3131
|
value: function () {
|
|
3088
|
-
var _delete2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3132
|
+
var _delete2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee13() {
|
|
3089
3133
|
var options,
|
|
3090
|
-
|
|
3091
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3134
|
+
_args13 = arguments;
|
|
3135
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee13$(_context13) {
|
|
3092
3136
|
while (1) {
|
|
3093
|
-
switch (
|
|
3137
|
+
switch (_context13.prev = _context13.next) {
|
|
3094
3138
|
case 0:
|
|
3095
|
-
options =
|
|
3096
|
-
|
|
3139
|
+
options = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : {};
|
|
3140
|
+
_context13.next = 3;
|
|
3097
3141
|
return this.getClient().delete(this._channelURL(), _objectSpread$c({}, options));
|
|
3098
3142
|
|
|
3099
3143
|
case 3:
|
|
3100
|
-
return
|
|
3144
|
+
return _context13.abrupt("return", _context13.sent);
|
|
3101
3145
|
|
|
3102
3146
|
case 4:
|
|
3103
3147
|
case "end":
|
|
3104
|
-
return
|
|
3148
|
+
return _context13.stop();
|
|
3105
3149
|
}
|
|
3106
3150
|
}
|
|
3107
|
-
},
|
|
3151
|
+
}, _callee13, this);
|
|
3108
3152
|
}));
|
|
3109
3153
|
|
|
3110
3154
|
function _delete() {
|
|
@@ -3122,26 +3166,26 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3122
3166
|
}, {
|
|
3123
3167
|
key: "truncate",
|
|
3124
3168
|
value: function () {
|
|
3125
|
-
var _truncate = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3169
|
+
var _truncate = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee14() {
|
|
3126
3170
|
var options,
|
|
3127
|
-
|
|
3128
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3171
|
+
_args14 = arguments;
|
|
3172
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee14$(_context14) {
|
|
3129
3173
|
while (1) {
|
|
3130
|
-
switch (
|
|
3174
|
+
switch (_context14.prev = _context14.next) {
|
|
3131
3175
|
case 0:
|
|
3132
|
-
options =
|
|
3133
|
-
|
|
3176
|
+
options = _args14.length > 0 && _args14[0] !== undefined ? _args14[0] : {};
|
|
3177
|
+
_context14.next = 3;
|
|
3134
3178
|
return this.getClient().post(this._channelURL() + '/truncate', options);
|
|
3135
3179
|
|
|
3136
3180
|
case 3:
|
|
3137
|
-
return
|
|
3181
|
+
return _context14.abrupt("return", _context14.sent);
|
|
3138
3182
|
|
|
3139
3183
|
case 4:
|
|
3140
3184
|
case "end":
|
|
3141
|
-
return
|
|
3185
|
+
return _context14.stop();
|
|
3142
3186
|
}
|
|
3143
3187
|
}
|
|
3144
|
-
},
|
|
3188
|
+
}, _callee14, this);
|
|
3145
3189
|
}));
|
|
3146
3190
|
|
|
3147
3191
|
function truncate() {
|
|
@@ -3161,28 +3205,28 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3161
3205
|
}, {
|
|
3162
3206
|
key: "acceptInvite",
|
|
3163
3207
|
value: function () {
|
|
3164
|
-
var _acceptInvite = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3208
|
+
var _acceptInvite = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee15() {
|
|
3165
3209
|
var options,
|
|
3166
|
-
|
|
3167
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3210
|
+
_args15 = arguments;
|
|
3211
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee15$(_context15) {
|
|
3168
3212
|
while (1) {
|
|
3169
|
-
switch (
|
|
3213
|
+
switch (_context15.prev = _context15.next) {
|
|
3170
3214
|
case 0:
|
|
3171
|
-
options =
|
|
3172
|
-
|
|
3215
|
+
options = _args15.length > 0 && _args15[0] !== undefined ? _args15[0] : {};
|
|
3216
|
+
_context15.next = 3;
|
|
3173
3217
|
return this._update(_objectSpread$c({
|
|
3174
3218
|
accept_invite: true
|
|
3175
3219
|
}, options));
|
|
3176
3220
|
|
|
3177
3221
|
case 3:
|
|
3178
|
-
return
|
|
3222
|
+
return _context15.abrupt("return", _context15.sent);
|
|
3179
3223
|
|
|
3180
3224
|
case 4:
|
|
3181
3225
|
case "end":
|
|
3182
|
-
return
|
|
3226
|
+
return _context15.stop();
|
|
3183
3227
|
}
|
|
3184
3228
|
}
|
|
3185
|
-
},
|
|
3229
|
+
}, _callee15, this);
|
|
3186
3230
|
}));
|
|
3187
3231
|
|
|
3188
3232
|
function acceptInvite() {
|
|
@@ -3202,28 +3246,28 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3202
3246
|
}, {
|
|
3203
3247
|
key: "rejectInvite",
|
|
3204
3248
|
value: function () {
|
|
3205
|
-
var _rejectInvite = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3249
|
+
var _rejectInvite = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee16() {
|
|
3206
3250
|
var options,
|
|
3207
|
-
|
|
3208
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3251
|
+
_args16 = arguments;
|
|
3252
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee16$(_context16) {
|
|
3209
3253
|
while (1) {
|
|
3210
|
-
switch (
|
|
3254
|
+
switch (_context16.prev = _context16.next) {
|
|
3211
3255
|
case 0:
|
|
3212
|
-
options =
|
|
3213
|
-
|
|
3256
|
+
options = _args16.length > 0 && _args16[0] !== undefined ? _args16[0] : {};
|
|
3257
|
+
_context16.next = 3;
|
|
3214
3258
|
return this._update(_objectSpread$c({
|
|
3215
3259
|
reject_invite: true
|
|
3216
3260
|
}, options));
|
|
3217
3261
|
|
|
3218
3262
|
case 3:
|
|
3219
|
-
return
|
|
3263
|
+
return _context16.abrupt("return", _context16.sent);
|
|
3220
3264
|
|
|
3221
3265
|
case 4:
|
|
3222
3266
|
case "end":
|
|
3223
|
-
return
|
|
3267
|
+
return _context16.stop();
|
|
3224
3268
|
}
|
|
3225
3269
|
}
|
|
3226
|
-
},
|
|
3270
|
+
}, _callee16, this);
|
|
3227
3271
|
}));
|
|
3228
3272
|
|
|
3229
3273
|
function rejectInvite() {
|
|
@@ -3244,32 +3288,32 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3244
3288
|
}, {
|
|
3245
3289
|
key: "addMembers",
|
|
3246
3290
|
value: function () {
|
|
3247
|
-
var _addMembers = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3291
|
+
var _addMembers = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee17(members, message) {
|
|
3248
3292
|
var options,
|
|
3249
|
-
|
|
3250
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3293
|
+
_args17 = arguments;
|
|
3294
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee17$(_context17) {
|
|
3251
3295
|
while (1) {
|
|
3252
|
-
switch (
|
|
3296
|
+
switch (_context17.prev = _context17.next) {
|
|
3253
3297
|
case 0:
|
|
3254
|
-
options =
|
|
3255
|
-
|
|
3298
|
+
options = _args17.length > 2 && _args17[2] !== undefined ? _args17[2] : {};
|
|
3299
|
+
_context17.next = 3;
|
|
3256
3300
|
return this._update(_objectSpread$c({
|
|
3257
3301
|
add_members: members,
|
|
3258
3302
|
message: message
|
|
3259
3303
|
}, options));
|
|
3260
3304
|
|
|
3261
3305
|
case 3:
|
|
3262
|
-
return
|
|
3306
|
+
return _context17.abrupt("return", _context17.sent);
|
|
3263
3307
|
|
|
3264
3308
|
case 4:
|
|
3265
3309
|
case "end":
|
|
3266
|
-
return
|
|
3310
|
+
return _context17.stop();
|
|
3267
3311
|
}
|
|
3268
3312
|
}
|
|
3269
|
-
},
|
|
3313
|
+
}, _callee17, this);
|
|
3270
3314
|
}));
|
|
3271
3315
|
|
|
3272
|
-
function addMembers(
|
|
3316
|
+
function addMembers(_x16, _x17) {
|
|
3273
3317
|
return _addMembers.apply(this, arguments);
|
|
3274
3318
|
}
|
|
3275
3319
|
|
|
@@ -3287,32 +3331,32 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3287
3331
|
}, {
|
|
3288
3332
|
key: "addModerators",
|
|
3289
3333
|
value: function () {
|
|
3290
|
-
var _addModerators = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3334
|
+
var _addModerators = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee18(members, message) {
|
|
3291
3335
|
var options,
|
|
3292
|
-
|
|
3293
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3336
|
+
_args18 = arguments;
|
|
3337
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee18$(_context18) {
|
|
3294
3338
|
while (1) {
|
|
3295
|
-
switch (
|
|
3339
|
+
switch (_context18.prev = _context18.next) {
|
|
3296
3340
|
case 0:
|
|
3297
|
-
options =
|
|
3298
|
-
|
|
3341
|
+
options = _args18.length > 2 && _args18[2] !== undefined ? _args18[2] : {};
|
|
3342
|
+
_context18.next = 3;
|
|
3299
3343
|
return this._update(_objectSpread$c({
|
|
3300
3344
|
add_moderators: members,
|
|
3301
3345
|
message: message
|
|
3302
3346
|
}, options));
|
|
3303
3347
|
|
|
3304
3348
|
case 3:
|
|
3305
|
-
return
|
|
3349
|
+
return _context18.abrupt("return", _context18.sent);
|
|
3306
3350
|
|
|
3307
3351
|
case 4:
|
|
3308
3352
|
case "end":
|
|
3309
|
-
return
|
|
3353
|
+
return _context18.stop();
|
|
3310
3354
|
}
|
|
3311
3355
|
}
|
|
3312
|
-
},
|
|
3356
|
+
}, _callee18, this);
|
|
3313
3357
|
}));
|
|
3314
3358
|
|
|
3315
|
-
function addModerators(
|
|
3359
|
+
function addModerators(_x18, _x19) {
|
|
3316
3360
|
return _addModerators.apply(this, arguments);
|
|
3317
3361
|
}
|
|
3318
3362
|
|
|
@@ -3330,32 +3374,32 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3330
3374
|
}, {
|
|
3331
3375
|
key: "assignRoles",
|
|
3332
3376
|
value: function () {
|
|
3333
|
-
var _assignRoles = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3377
|
+
var _assignRoles = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee19(roles, message) {
|
|
3334
3378
|
var options,
|
|
3335
|
-
|
|
3336
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3379
|
+
_args19 = arguments;
|
|
3380
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee19$(_context19) {
|
|
3337
3381
|
while (1) {
|
|
3338
|
-
switch (
|
|
3382
|
+
switch (_context19.prev = _context19.next) {
|
|
3339
3383
|
case 0:
|
|
3340
|
-
options =
|
|
3341
|
-
|
|
3384
|
+
options = _args19.length > 2 && _args19[2] !== undefined ? _args19[2] : {};
|
|
3385
|
+
_context19.next = 3;
|
|
3342
3386
|
return this._update(_objectSpread$c({
|
|
3343
3387
|
assign_roles: roles,
|
|
3344
3388
|
message: message
|
|
3345
3389
|
}, options));
|
|
3346
3390
|
|
|
3347
3391
|
case 3:
|
|
3348
|
-
return
|
|
3392
|
+
return _context19.abrupt("return", _context19.sent);
|
|
3349
3393
|
|
|
3350
3394
|
case 4:
|
|
3351
3395
|
case "end":
|
|
3352
|
-
return
|
|
3396
|
+
return _context19.stop();
|
|
3353
3397
|
}
|
|
3354
3398
|
}
|
|
3355
|
-
},
|
|
3399
|
+
}, _callee19, this);
|
|
3356
3400
|
}));
|
|
3357
3401
|
|
|
3358
|
-
function assignRoles(
|
|
3402
|
+
function assignRoles(_x20, _x21) {
|
|
3359
3403
|
return _assignRoles.apply(this, arguments);
|
|
3360
3404
|
}
|
|
3361
3405
|
|
|
@@ -3373,32 +3417,32 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3373
3417
|
}, {
|
|
3374
3418
|
key: "inviteMembers",
|
|
3375
3419
|
value: function () {
|
|
3376
|
-
var _inviteMembers = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3420
|
+
var _inviteMembers = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee20(members, message) {
|
|
3377
3421
|
var options,
|
|
3378
|
-
|
|
3379
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3422
|
+
_args20 = arguments;
|
|
3423
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee20$(_context20) {
|
|
3380
3424
|
while (1) {
|
|
3381
|
-
switch (
|
|
3425
|
+
switch (_context20.prev = _context20.next) {
|
|
3382
3426
|
case 0:
|
|
3383
|
-
options =
|
|
3384
|
-
|
|
3427
|
+
options = _args20.length > 2 && _args20[2] !== undefined ? _args20[2] : {};
|
|
3428
|
+
_context20.next = 3;
|
|
3385
3429
|
return this._update(_objectSpread$c({
|
|
3386
3430
|
invites: members,
|
|
3387
3431
|
message: message
|
|
3388
3432
|
}, options));
|
|
3389
3433
|
|
|
3390
3434
|
case 3:
|
|
3391
|
-
return
|
|
3435
|
+
return _context20.abrupt("return", _context20.sent);
|
|
3392
3436
|
|
|
3393
3437
|
case 4:
|
|
3394
3438
|
case "end":
|
|
3395
|
-
return
|
|
3439
|
+
return _context20.stop();
|
|
3396
3440
|
}
|
|
3397
3441
|
}
|
|
3398
|
-
},
|
|
3442
|
+
}, _callee20, this);
|
|
3399
3443
|
}));
|
|
3400
3444
|
|
|
3401
|
-
function inviteMembers(
|
|
3445
|
+
function inviteMembers(_x22, _x23) {
|
|
3402
3446
|
return _inviteMembers.apply(this, arguments);
|
|
3403
3447
|
}
|
|
3404
3448
|
|
|
@@ -3416,32 +3460,32 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3416
3460
|
}, {
|
|
3417
3461
|
key: "removeMembers",
|
|
3418
3462
|
value: function () {
|
|
3419
|
-
var _removeMembers = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3463
|
+
var _removeMembers = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee21(members, message) {
|
|
3420
3464
|
var options,
|
|
3421
|
-
|
|
3422
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3465
|
+
_args21 = arguments;
|
|
3466
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee21$(_context21) {
|
|
3423
3467
|
while (1) {
|
|
3424
|
-
switch (
|
|
3468
|
+
switch (_context21.prev = _context21.next) {
|
|
3425
3469
|
case 0:
|
|
3426
|
-
options =
|
|
3427
|
-
|
|
3470
|
+
options = _args21.length > 2 && _args21[2] !== undefined ? _args21[2] : {};
|
|
3471
|
+
_context21.next = 3;
|
|
3428
3472
|
return this._update(_objectSpread$c({
|
|
3429
3473
|
remove_members: members,
|
|
3430
3474
|
message: message
|
|
3431
3475
|
}, options));
|
|
3432
3476
|
|
|
3433
3477
|
case 3:
|
|
3434
|
-
return
|
|
3478
|
+
return _context21.abrupt("return", _context21.sent);
|
|
3435
3479
|
|
|
3436
3480
|
case 4:
|
|
3437
3481
|
case "end":
|
|
3438
|
-
return
|
|
3482
|
+
return _context21.stop();
|
|
3439
3483
|
}
|
|
3440
3484
|
}
|
|
3441
|
-
},
|
|
3485
|
+
}, _callee21, this);
|
|
3442
3486
|
}));
|
|
3443
3487
|
|
|
3444
|
-
function removeMembers(
|
|
3488
|
+
function removeMembers(_x24, _x25) {
|
|
3445
3489
|
return _removeMembers.apply(this, arguments);
|
|
3446
3490
|
}
|
|
3447
3491
|
|
|
@@ -3459,32 +3503,32 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3459
3503
|
}, {
|
|
3460
3504
|
key: "demoteModerators",
|
|
3461
3505
|
value: function () {
|
|
3462
|
-
var _demoteModerators = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3506
|
+
var _demoteModerators = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee22(members, message) {
|
|
3463
3507
|
var options,
|
|
3464
|
-
|
|
3465
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3508
|
+
_args22 = arguments;
|
|
3509
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee22$(_context22) {
|
|
3466
3510
|
while (1) {
|
|
3467
|
-
switch (
|
|
3511
|
+
switch (_context22.prev = _context22.next) {
|
|
3468
3512
|
case 0:
|
|
3469
|
-
options =
|
|
3470
|
-
|
|
3513
|
+
options = _args22.length > 2 && _args22[2] !== undefined ? _args22[2] : {};
|
|
3514
|
+
_context22.next = 3;
|
|
3471
3515
|
return this._update(_objectSpread$c({
|
|
3472
3516
|
demote_moderators: members,
|
|
3473
3517
|
message: message
|
|
3474
3518
|
}, options));
|
|
3475
3519
|
|
|
3476
3520
|
case 3:
|
|
3477
|
-
return
|
|
3521
|
+
return _context22.abrupt("return", _context22.sent);
|
|
3478
3522
|
|
|
3479
3523
|
case 4:
|
|
3480
3524
|
case "end":
|
|
3481
|
-
return
|
|
3525
|
+
return _context22.stop();
|
|
3482
3526
|
}
|
|
3483
3527
|
}
|
|
3484
|
-
},
|
|
3528
|
+
}, _callee22, this);
|
|
3485
3529
|
}));
|
|
3486
3530
|
|
|
3487
|
-
function demoteModerators(
|
|
3531
|
+
function demoteModerators(_x26, _x27) {
|
|
3488
3532
|
return _demoteModerators.apply(this, arguments);
|
|
3489
3533
|
}
|
|
3490
3534
|
|
|
@@ -3500,29 +3544,29 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3500
3544
|
}, {
|
|
3501
3545
|
key: "_update",
|
|
3502
3546
|
value: function () {
|
|
3503
|
-
var _update3 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3547
|
+
var _update3 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee23(payload) {
|
|
3504
3548
|
var data;
|
|
3505
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3549
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee23$(_context23) {
|
|
3506
3550
|
while (1) {
|
|
3507
|
-
switch (
|
|
3551
|
+
switch (_context23.prev = _context23.next) {
|
|
3508
3552
|
case 0:
|
|
3509
|
-
|
|
3553
|
+
_context23.next = 2;
|
|
3510
3554
|
return this.getClient().post(this._channelURL(), payload);
|
|
3511
3555
|
|
|
3512
3556
|
case 2:
|
|
3513
|
-
data =
|
|
3557
|
+
data = _context23.sent;
|
|
3514
3558
|
this.data = data.channel;
|
|
3515
|
-
return
|
|
3559
|
+
return _context23.abrupt("return", data);
|
|
3516
3560
|
|
|
3517
3561
|
case 5:
|
|
3518
3562
|
case "end":
|
|
3519
|
-
return
|
|
3563
|
+
return _context23.stop();
|
|
3520
3564
|
}
|
|
3521
3565
|
}
|
|
3522
|
-
},
|
|
3566
|
+
}, _callee23, this);
|
|
3523
3567
|
}));
|
|
3524
3568
|
|
|
3525
|
-
function _update(
|
|
3569
|
+
function _update(_x28) {
|
|
3526
3570
|
return _update3.apply(this, arguments);
|
|
3527
3571
|
}
|
|
3528
3572
|
|
|
@@ -3544,28 +3588,28 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3544
3588
|
}, {
|
|
3545
3589
|
key: "mute",
|
|
3546
3590
|
value: function () {
|
|
3547
|
-
var _mute = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3591
|
+
var _mute = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee24() {
|
|
3548
3592
|
var opts,
|
|
3549
|
-
|
|
3550
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3593
|
+
_args24 = arguments;
|
|
3594
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee24$(_context24) {
|
|
3551
3595
|
while (1) {
|
|
3552
|
-
switch (
|
|
3596
|
+
switch (_context24.prev = _context24.next) {
|
|
3553
3597
|
case 0:
|
|
3554
|
-
opts =
|
|
3555
|
-
|
|
3598
|
+
opts = _args24.length > 0 && _args24[0] !== undefined ? _args24[0] : {};
|
|
3599
|
+
_context24.next = 3;
|
|
3556
3600
|
return this.getClient().post(this.getClient().baseURL + '/moderation/mute/channel', _objectSpread$c({
|
|
3557
3601
|
channel_cid: this.cid
|
|
3558
3602
|
}, opts));
|
|
3559
3603
|
|
|
3560
3604
|
case 3:
|
|
3561
|
-
return
|
|
3605
|
+
return _context24.abrupt("return", _context24.sent);
|
|
3562
3606
|
|
|
3563
3607
|
case 4:
|
|
3564
3608
|
case "end":
|
|
3565
|
-
return
|
|
3609
|
+
return _context24.stop();
|
|
3566
3610
|
}
|
|
3567
3611
|
}
|
|
3568
|
-
},
|
|
3612
|
+
}, _callee24, this);
|
|
3569
3613
|
}));
|
|
3570
3614
|
|
|
3571
3615
|
function mute() {
|
|
@@ -3586,28 +3630,28 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3586
3630
|
}, {
|
|
3587
3631
|
key: "unmute",
|
|
3588
3632
|
value: function () {
|
|
3589
|
-
var _unmute = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3633
|
+
var _unmute = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee25() {
|
|
3590
3634
|
var opts,
|
|
3591
|
-
|
|
3592
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3635
|
+
_args25 = arguments;
|
|
3636
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee25$(_context25) {
|
|
3593
3637
|
while (1) {
|
|
3594
|
-
switch (
|
|
3638
|
+
switch (_context25.prev = _context25.next) {
|
|
3595
3639
|
case 0:
|
|
3596
|
-
opts =
|
|
3597
|
-
|
|
3640
|
+
opts = _args25.length > 0 && _args25[0] !== undefined ? _args25[0] : {};
|
|
3641
|
+
_context25.next = 3;
|
|
3598
3642
|
return this.getClient().post(this.getClient().baseURL + '/moderation/unmute/channel', _objectSpread$c({
|
|
3599
3643
|
channel_cid: this.cid
|
|
3600
3644
|
}, opts));
|
|
3601
3645
|
|
|
3602
3646
|
case 3:
|
|
3603
|
-
return
|
|
3647
|
+
return _context25.abrupt("return", _context25.sent);
|
|
3604
3648
|
|
|
3605
3649
|
case 4:
|
|
3606
3650
|
case "end":
|
|
3607
|
-
return
|
|
3651
|
+
return _context25.stop();
|
|
3608
3652
|
}
|
|
3609
3653
|
}
|
|
3610
|
-
},
|
|
3654
|
+
}, _callee25, this);
|
|
3611
3655
|
}));
|
|
3612
3656
|
|
|
3613
3657
|
function unmute() {
|
|
@@ -3632,29 +3676,29 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3632
3676
|
}, {
|
|
3633
3677
|
key: "archive",
|
|
3634
3678
|
value: function () {
|
|
3635
|
-
var _archive = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3679
|
+
var _archive = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee26() {
|
|
3636
3680
|
var opts,
|
|
3637
3681
|
cli,
|
|
3638
3682
|
uid,
|
|
3639
3683
|
resp,
|
|
3640
|
-
|
|
3641
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3684
|
+
_args26 = arguments;
|
|
3685
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee26$(_context26) {
|
|
3642
3686
|
while (1) {
|
|
3643
|
-
switch (
|
|
3687
|
+
switch (_context26.prev = _context26.next) {
|
|
3644
3688
|
case 0:
|
|
3645
|
-
opts =
|
|
3689
|
+
opts = _args26.length > 0 && _args26[0] !== undefined ? _args26[0] : {};
|
|
3646
3690
|
cli = this.getClient();
|
|
3647
3691
|
uid = opts.user_id || cli.userID;
|
|
3648
3692
|
|
|
3649
3693
|
if (uid) {
|
|
3650
|
-
|
|
3694
|
+
_context26.next = 5;
|
|
3651
3695
|
break;
|
|
3652
3696
|
}
|
|
3653
3697
|
|
|
3654
3698
|
throw Error('A user_id is required for archiving a channel');
|
|
3655
3699
|
|
|
3656
3700
|
case 5:
|
|
3657
|
-
|
|
3701
|
+
_context26.next = 7;
|
|
3658
3702
|
return this.partialUpdateMember(uid, {
|
|
3659
3703
|
set: {
|
|
3660
3704
|
archived: true
|
|
@@ -3662,15 +3706,15 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3662
3706
|
});
|
|
3663
3707
|
|
|
3664
3708
|
case 7:
|
|
3665
|
-
resp =
|
|
3666
|
-
return
|
|
3709
|
+
resp = _context26.sent;
|
|
3710
|
+
return _context26.abrupt("return", resp.channel_member);
|
|
3667
3711
|
|
|
3668
3712
|
case 9:
|
|
3669
3713
|
case "end":
|
|
3670
|
-
return
|
|
3714
|
+
return _context26.stop();
|
|
3671
3715
|
}
|
|
3672
3716
|
}
|
|
3673
|
-
},
|
|
3717
|
+
}, _callee26, this);
|
|
3674
3718
|
}));
|
|
3675
3719
|
|
|
3676
3720
|
function archive() {
|
|
@@ -3695,29 +3739,29 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3695
3739
|
}, {
|
|
3696
3740
|
key: "unarchive",
|
|
3697
3741
|
value: function () {
|
|
3698
|
-
var _unarchive = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3742
|
+
var _unarchive = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee27() {
|
|
3699
3743
|
var opts,
|
|
3700
3744
|
cli,
|
|
3701
3745
|
uid,
|
|
3702
3746
|
resp,
|
|
3703
|
-
|
|
3704
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3747
|
+
_args27 = arguments;
|
|
3748
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee27$(_context27) {
|
|
3705
3749
|
while (1) {
|
|
3706
|
-
switch (
|
|
3750
|
+
switch (_context27.prev = _context27.next) {
|
|
3707
3751
|
case 0:
|
|
3708
|
-
opts =
|
|
3752
|
+
opts = _args27.length > 0 && _args27[0] !== undefined ? _args27[0] : {};
|
|
3709
3753
|
cli = this.getClient();
|
|
3710
3754
|
uid = opts.user_id || cli.userID;
|
|
3711
3755
|
|
|
3712
3756
|
if (uid) {
|
|
3713
|
-
|
|
3757
|
+
_context27.next = 5;
|
|
3714
3758
|
break;
|
|
3715
3759
|
}
|
|
3716
3760
|
|
|
3717
3761
|
throw Error('A user_id is required for unarchiving a channel');
|
|
3718
3762
|
|
|
3719
3763
|
case 5:
|
|
3720
|
-
|
|
3764
|
+
_context27.next = 7;
|
|
3721
3765
|
return this.partialUpdateMember(uid, {
|
|
3722
3766
|
set: {
|
|
3723
3767
|
archived: false
|
|
@@ -3725,15 +3769,15 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3725
3769
|
});
|
|
3726
3770
|
|
|
3727
3771
|
case 7:
|
|
3728
|
-
resp =
|
|
3729
|
-
return
|
|
3772
|
+
resp = _context27.sent;
|
|
3773
|
+
return _context27.abrupt("return", resp.channel_member);
|
|
3730
3774
|
|
|
3731
3775
|
case 9:
|
|
3732
3776
|
case "end":
|
|
3733
|
-
return
|
|
3777
|
+
return _context27.stop();
|
|
3734
3778
|
}
|
|
3735
3779
|
}
|
|
3736
|
-
},
|
|
3780
|
+
}, _callee27, this);
|
|
3737
3781
|
}));
|
|
3738
3782
|
|
|
3739
3783
|
function unarchive() {
|
|
@@ -3758,29 +3802,29 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3758
3802
|
}, {
|
|
3759
3803
|
key: "pin",
|
|
3760
3804
|
value: function () {
|
|
3761
|
-
var _pin = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3805
|
+
var _pin = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee28() {
|
|
3762
3806
|
var opts,
|
|
3763
3807
|
cli,
|
|
3764
3808
|
uid,
|
|
3765
3809
|
resp,
|
|
3766
|
-
|
|
3767
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3810
|
+
_args28 = arguments;
|
|
3811
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee28$(_context28) {
|
|
3768
3812
|
while (1) {
|
|
3769
|
-
switch (
|
|
3813
|
+
switch (_context28.prev = _context28.next) {
|
|
3770
3814
|
case 0:
|
|
3771
|
-
opts =
|
|
3815
|
+
opts = _args28.length > 0 && _args28[0] !== undefined ? _args28[0] : {};
|
|
3772
3816
|
cli = this.getClient();
|
|
3773
3817
|
uid = opts.user_id || cli.userID;
|
|
3774
3818
|
|
|
3775
3819
|
if (uid) {
|
|
3776
|
-
|
|
3820
|
+
_context28.next = 5;
|
|
3777
3821
|
break;
|
|
3778
3822
|
}
|
|
3779
3823
|
|
|
3780
3824
|
throw new Error('A user_id is required for pinning a channel');
|
|
3781
3825
|
|
|
3782
3826
|
case 5:
|
|
3783
|
-
|
|
3827
|
+
_context28.next = 7;
|
|
3784
3828
|
return this.partialUpdateMember(uid, {
|
|
3785
3829
|
set: {
|
|
3786
3830
|
pinned: true
|
|
@@ -3788,15 +3832,15 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3788
3832
|
});
|
|
3789
3833
|
|
|
3790
3834
|
case 7:
|
|
3791
|
-
resp =
|
|
3792
|
-
return
|
|
3835
|
+
resp = _context28.sent;
|
|
3836
|
+
return _context28.abrupt("return", resp.channel_member);
|
|
3793
3837
|
|
|
3794
3838
|
case 9:
|
|
3795
3839
|
case "end":
|
|
3796
|
-
return
|
|
3840
|
+
return _context28.stop();
|
|
3797
3841
|
}
|
|
3798
3842
|
}
|
|
3799
|
-
},
|
|
3843
|
+
}, _callee28, this);
|
|
3800
3844
|
}));
|
|
3801
3845
|
|
|
3802
3846
|
function pin() {
|
|
@@ -3821,29 +3865,29 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3821
3865
|
}, {
|
|
3822
3866
|
key: "unpin",
|
|
3823
3867
|
value: function () {
|
|
3824
|
-
var _unpin = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3868
|
+
var _unpin = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee29() {
|
|
3825
3869
|
var opts,
|
|
3826
3870
|
cli,
|
|
3827
3871
|
uid,
|
|
3828
3872
|
resp,
|
|
3829
|
-
|
|
3830
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3873
|
+
_args29 = arguments;
|
|
3874
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee29$(_context29) {
|
|
3831
3875
|
while (1) {
|
|
3832
|
-
switch (
|
|
3876
|
+
switch (_context29.prev = _context29.next) {
|
|
3833
3877
|
case 0:
|
|
3834
|
-
opts =
|
|
3878
|
+
opts = _args29.length > 0 && _args29[0] !== undefined ? _args29[0] : {};
|
|
3835
3879
|
cli = this.getClient();
|
|
3836
3880
|
uid = opts.user_id || cli.userID;
|
|
3837
3881
|
|
|
3838
3882
|
if (uid) {
|
|
3839
|
-
|
|
3883
|
+
_context29.next = 5;
|
|
3840
3884
|
break;
|
|
3841
3885
|
}
|
|
3842
3886
|
|
|
3843
3887
|
throw new Error('A user_id is required for unpinning a channel');
|
|
3844
3888
|
|
|
3845
3889
|
case 5:
|
|
3846
|
-
|
|
3890
|
+
_context29.next = 7;
|
|
3847
3891
|
return this.partialUpdateMember(uid, {
|
|
3848
3892
|
set: {
|
|
3849
3893
|
pinned: false
|
|
@@ -3851,15 +3895,15 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3851
3895
|
});
|
|
3852
3896
|
|
|
3853
3897
|
case 7:
|
|
3854
|
-
resp =
|
|
3855
|
-
return
|
|
3898
|
+
resp = _context29.sent;
|
|
3899
|
+
return _context29.abrupt("return", resp.channel_member);
|
|
3856
3900
|
|
|
3857
3901
|
case 9:
|
|
3858
3902
|
case "end":
|
|
3859
|
-
return
|
|
3903
|
+
return _context29.stop();
|
|
3860
3904
|
}
|
|
3861
3905
|
}
|
|
3862
|
-
},
|
|
3906
|
+
}, _callee29, this);
|
|
3863
3907
|
}));
|
|
3864
3908
|
|
|
3865
3909
|
function unpin() {
|
|
@@ -3906,18 +3950,18 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3906
3950
|
}, {
|
|
3907
3951
|
key: "keystroke",
|
|
3908
3952
|
value: function () {
|
|
3909
|
-
var _keystroke = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
3953
|
+
var _keystroke = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee30(parent_id, options) {
|
|
3910
3954
|
var now, diff;
|
|
3911
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
3955
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee30$(_context30) {
|
|
3912
3956
|
while (1) {
|
|
3913
|
-
switch (
|
|
3957
|
+
switch (_context30.prev = _context30.next) {
|
|
3914
3958
|
case 0:
|
|
3915
3959
|
if (this._isTypingIndicatorsEnabled()) {
|
|
3916
|
-
|
|
3960
|
+
_context30.next = 2;
|
|
3917
3961
|
break;
|
|
3918
3962
|
}
|
|
3919
3963
|
|
|
3920
|
-
return
|
|
3964
|
+
return _context30.abrupt("return");
|
|
3921
3965
|
|
|
3922
3966
|
case 2:
|
|
3923
3967
|
now = new Date();
|
|
@@ -3926,12 +3970,12 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3926
3970
|
this.isTyping = true; // send a typing.start every 2 seconds
|
|
3927
3971
|
|
|
3928
3972
|
if (!(diff === null || diff > 2000)) {
|
|
3929
|
-
|
|
3973
|
+
_context30.next = 10;
|
|
3930
3974
|
break;
|
|
3931
3975
|
}
|
|
3932
3976
|
|
|
3933
3977
|
this.lastTypingEvent = new Date();
|
|
3934
|
-
|
|
3978
|
+
_context30.next = 10;
|
|
3935
3979
|
return this.sendEvent(_objectSpread$c({
|
|
3936
3980
|
type: 'typing.start',
|
|
3937
3981
|
parent_id: parent_id
|
|
@@ -3939,13 +3983,13 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3939
3983
|
|
|
3940
3984
|
case 10:
|
|
3941
3985
|
case "end":
|
|
3942
|
-
return
|
|
3986
|
+
return _context30.stop();
|
|
3943
3987
|
}
|
|
3944
3988
|
}
|
|
3945
|
-
},
|
|
3989
|
+
}, _callee30, this);
|
|
3946
3990
|
}));
|
|
3947
3991
|
|
|
3948
|
-
function keystroke(
|
|
3992
|
+
function keystroke(_x29, _x30) {
|
|
3949
3993
|
return _keystroke.apply(this, arguments);
|
|
3950
3994
|
}
|
|
3951
3995
|
|
|
@@ -3963,15 +4007,15 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3963
4007
|
}, {
|
|
3964
4008
|
key: "updateAIState",
|
|
3965
4009
|
value: function () {
|
|
3966
|
-
var _updateAIState = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
4010
|
+
var _updateAIState = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee31(messageId, state) {
|
|
3967
4011
|
var options,
|
|
3968
|
-
|
|
3969
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
4012
|
+
_args31 = arguments;
|
|
4013
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee31$(_context31) {
|
|
3970
4014
|
while (1) {
|
|
3971
|
-
switch (
|
|
4015
|
+
switch (_context31.prev = _context31.next) {
|
|
3972
4016
|
case 0:
|
|
3973
|
-
options =
|
|
3974
|
-
|
|
4017
|
+
options = _args31.length > 2 && _args31[2] !== undefined ? _args31[2] : {};
|
|
4018
|
+
_context31.next = 3;
|
|
3975
4019
|
return this.sendEvent(_objectSpread$c(_objectSpread$c({}, options), {}, {
|
|
3976
4020
|
type: 'ai_indicator.update',
|
|
3977
4021
|
message_id: messageId,
|
|
@@ -3980,13 +4024,13 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3980
4024
|
|
|
3981
4025
|
case 3:
|
|
3982
4026
|
case "end":
|
|
3983
|
-
return
|
|
4027
|
+
return _context31.stop();
|
|
3984
4028
|
}
|
|
3985
4029
|
}
|
|
3986
|
-
},
|
|
4030
|
+
}, _callee31, this);
|
|
3987
4031
|
}));
|
|
3988
4032
|
|
|
3989
|
-
function updateAIState(
|
|
4033
|
+
function updateAIState(_x31, _x32) {
|
|
3990
4034
|
return _updateAIState.apply(this, arguments);
|
|
3991
4035
|
}
|
|
3992
4036
|
|
|
@@ -4000,22 +4044,22 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4000
4044
|
}, {
|
|
4001
4045
|
key: "clearAIIndicator",
|
|
4002
4046
|
value: function () {
|
|
4003
|
-
var _clearAIIndicator = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
4004
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
4047
|
+
var _clearAIIndicator = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee32() {
|
|
4048
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee32$(_context32) {
|
|
4005
4049
|
while (1) {
|
|
4006
|
-
switch (
|
|
4050
|
+
switch (_context32.prev = _context32.next) {
|
|
4007
4051
|
case 0:
|
|
4008
|
-
|
|
4052
|
+
_context32.next = 2;
|
|
4009
4053
|
return this.sendEvent({
|
|
4010
4054
|
type: 'ai_indicator.clear'
|
|
4011
4055
|
});
|
|
4012
4056
|
|
|
4013
4057
|
case 2:
|
|
4014
4058
|
case "end":
|
|
4015
|
-
return
|
|
4059
|
+
return _context32.stop();
|
|
4016
4060
|
}
|
|
4017
4061
|
}
|
|
4018
|
-
},
|
|
4062
|
+
}, _callee32, this);
|
|
4019
4063
|
}));
|
|
4020
4064
|
|
|
4021
4065
|
function clearAIIndicator() {
|
|
@@ -4032,22 +4076,22 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4032
4076
|
}, {
|
|
4033
4077
|
key: "stopAIResponse",
|
|
4034
4078
|
value: function () {
|
|
4035
|
-
var _stopAIResponse = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
4036
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
4079
|
+
var _stopAIResponse = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee33() {
|
|
4080
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee33$(_context33) {
|
|
4037
4081
|
while (1) {
|
|
4038
|
-
switch (
|
|
4082
|
+
switch (_context33.prev = _context33.next) {
|
|
4039
4083
|
case 0:
|
|
4040
|
-
|
|
4084
|
+
_context33.next = 2;
|
|
4041
4085
|
return this.sendEvent({
|
|
4042
4086
|
type: 'ai_indicator.stop'
|
|
4043
4087
|
});
|
|
4044
4088
|
|
|
4045
4089
|
case 2:
|
|
4046
4090
|
case "end":
|
|
4047
|
-
return
|
|
4091
|
+
return _context33.stop();
|
|
4048
4092
|
}
|
|
4049
4093
|
}
|
|
4050
|
-
},
|
|
4094
|
+
}, _callee33, this);
|
|
4051
4095
|
}));
|
|
4052
4096
|
|
|
4053
4097
|
function stopAIResponse() {
|
|
@@ -4065,22 +4109,22 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4065
4109
|
}, {
|
|
4066
4110
|
key: "stopTyping",
|
|
4067
4111
|
value: function () {
|
|
4068
|
-
var _stopTyping = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
4069
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
4112
|
+
var _stopTyping = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee34(parent_id, options) {
|
|
4113
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee34$(_context34) {
|
|
4070
4114
|
while (1) {
|
|
4071
|
-
switch (
|
|
4115
|
+
switch (_context34.prev = _context34.next) {
|
|
4072
4116
|
case 0:
|
|
4073
4117
|
if (this._isTypingIndicatorsEnabled()) {
|
|
4074
|
-
|
|
4118
|
+
_context34.next = 2;
|
|
4075
4119
|
break;
|
|
4076
4120
|
}
|
|
4077
4121
|
|
|
4078
|
-
return
|
|
4122
|
+
return _context34.abrupt("return");
|
|
4079
4123
|
|
|
4080
4124
|
case 2:
|
|
4081
4125
|
this.lastTypingEvent = null;
|
|
4082
4126
|
this.isTyping = false;
|
|
4083
|
-
|
|
4127
|
+
_context34.next = 6;
|
|
4084
4128
|
return this.sendEvent(_objectSpread$c({
|
|
4085
4129
|
type: 'typing.stop',
|
|
4086
4130
|
parent_id: parent_id
|
|
@@ -4088,13 +4132,13 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4088
4132
|
|
|
4089
4133
|
case 6:
|
|
4090
4134
|
case "end":
|
|
4091
|
-
return
|
|
4135
|
+
return _context34.stop();
|
|
4092
4136
|
}
|
|
4093
4137
|
}
|
|
4094
|
-
},
|
|
4138
|
+
}, _callee34, this);
|
|
4095
4139
|
}));
|
|
4096
4140
|
|
|
4097
|
-
function stopTyping(
|
|
4141
|
+
function stopTyping(_x33, _x34) {
|
|
4098
4142
|
return _stopTyping.apply(this, arguments);
|
|
4099
4143
|
}
|
|
4100
4144
|
|
|
@@ -4146,39 +4190,39 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4146
4190
|
}, {
|
|
4147
4191
|
key: "markRead",
|
|
4148
4192
|
value: function () {
|
|
4149
|
-
var _markRead = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
4193
|
+
var _markRead = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee35() {
|
|
4150
4194
|
var _this$getConfig2;
|
|
4151
4195
|
|
|
4152
4196
|
var data,
|
|
4153
|
-
|
|
4154
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
4197
|
+
_args35 = arguments;
|
|
4198
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee35$(_context35) {
|
|
4155
4199
|
while (1) {
|
|
4156
|
-
switch (
|
|
4200
|
+
switch (_context35.prev = _context35.next) {
|
|
4157
4201
|
case 0:
|
|
4158
|
-
data =
|
|
4202
|
+
data = _args35.length > 0 && _args35[0] !== undefined ? _args35[0] : {};
|
|
4159
4203
|
|
|
4160
4204
|
this._checkInitialized();
|
|
4161
4205
|
|
|
4162
4206
|
if (!(!((_this$getConfig2 = this.getConfig()) !== null && _this$getConfig2 !== void 0 && _this$getConfig2.read_events) && !this.getClient()._isUsingServerAuth())) {
|
|
4163
|
-
|
|
4207
|
+
_context35.next = 4;
|
|
4164
4208
|
break;
|
|
4165
4209
|
}
|
|
4166
4210
|
|
|
4167
|
-
return
|
|
4211
|
+
return _context35.abrupt("return", Promise.resolve(null));
|
|
4168
4212
|
|
|
4169
4213
|
case 4:
|
|
4170
|
-
|
|
4214
|
+
_context35.next = 6;
|
|
4171
4215
|
return this.getClient().post(this._channelURL() + '/read', _objectSpread$c({}, data));
|
|
4172
4216
|
|
|
4173
4217
|
case 6:
|
|
4174
|
-
return
|
|
4218
|
+
return _context35.abrupt("return", _context35.sent);
|
|
4175
4219
|
|
|
4176
4220
|
case 7:
|
|
4177
4221
|
case "end":
|
|
4178
|
-
return
|
|
4222
|
+
return _context35.stop();
|
|
4179
4223
|
}
|
|
4180
4224
|
}
|
|
4181
|
-
},
|
|
4225
|
+
}, _callee35, this);
|
|
4182
4226
|
}));
|
|
4183
4227
|
|
|
4184
4228
|
function markRead() {
|
|
@@ -4197,38 +4241,38 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4197
4241
|
}, {
|
|
4198
4242
|
key: "markUnread",
|
|
4199
4243
|
value: function () {
|
|
4200
|
-
var _markUnread = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
4244
|
+
var _markUnread = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee36(data) {
|
|
4201
4245
|
var _this$getConfig3;
|
|
4202
4246
|
|
|
4203
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
4247
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee36$(_context36) {
|
|
4204
4248
|
while (1) {
|
|
4205
|
-
switch (
|
|
4249
|
+
switch (_context36.prev = _context36.next) {
|
|
4206
4250
|
case 0:
|
|
4207
4251
|
this._checkInitialized();
|
|
4208
4252
|
|
|
4209
4253
|
if (!(!((_this$getConfig3 = this.getConfig()) !== null && _this$getConfig3 !== void 0 && _this$getConfig3.read_events) && !this.getClient()._isUsingServerAuth())) {
|
|
4210
|
-
|
|
4254
|
+
_context36.next = 3;
|
|
4211
4255
|
break;
|
|
4212
4256
|
}
|
|
4213
4257
|
|
|
4214
|
-
return
|
|
4258
|
+
return _context36.abrupt("return", Promise.resolve(null));
|
|
4215
4259
|
|
|
4216
4260
|
case 3:
|
|
4217
|
-
|
|
4261
|
+
_context36.next = 5;
|
|
4218
4262
|
return this.getClient().post(this._channelURL() + '/unread', _objectSpread$c({}, data));
|
|
4219
4263
|
|
|
4220
4264
|
case 5:
|
|
4221
|
-
return
|
|
4265
|
+
return _context36.abrupt("return", _context36.sent);
|
|
4222
4266
|
|
|
4223
4267
|
case 6:
|
|
4224
4268
|
case "end":
|
|
4225
|
-
return
|
|
4269
|
+
return _context36.stop();
|
|
4226
4270
|
}
|
|
4227
4271
|
}
|
|
4228
|
-
},
|
|
4272
|
+
}, _callee36, this);
|
|
4229
4273
|
}));
|
|
4230
4274
|
|
|
4231
|
-
function markUnread(
|
|
4275
|
+
function markUnread(_x35) {
|
|
4232
4276
|
return _markUnread.apply(this, arguments);
|
|
4233
4277
|
}
|
|
4234
4278
|
|
|
@@ -4263,11 +4307,11 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4263
4307
|
}, {
|
|
4264
4308
|
key: "watch",
|
|
4265
4309
|
value: function () {
|
|
4266
|
-
var _watch = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
4310
|
+
var _watch = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee37(options) {
|
|
4267
4311
|
var defaultOptions, combined, state;
|
|
4268
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
4312
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee37$(_context37) {
|
|
4269
4313
|
while (1) {
|
|
4270
|
-
switch (
|
|
4314
|
+
switch (_context37.prev = _context37.next) {
|
|
4271
4315
|
case 0:
|
|
4272
4316
|
defaultOptions = {
|
|
4273
4317
|
state: true,
|
|
@@ -4275,7 +4319,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4275
4319
|
presence: false
|
|
4276
4320
|
}; // Make sure we wait for the connect promise if there is a pending one
|
|
4277
4321
|
|
|
4278
|
-
|
|
4322
|
+
_context37.next = 3;
|
|
4279
4323
|
return this.getClient().wsPromise;
|
|
4280
4324
|
|
|
4281
4325
|
case 3:
|
|
@@ -4284,11 +4328,11 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4284
4328
|
}
|
|
4285
4329
|
|
|
4286
4330
|
combined = _objectSpread$c(_objectSpread$c({}, defaultOptions), options);
|
|
4287
|
-
|
|
4331
|
+
_context37.next = 7;
|
|
4288
4332
|
return this.query(combined, 'latest');
|
|
4289
4333
|
|
|
4290
4334
|
case 7:
|
|
4291
|
-
state =
|
|
4335
|
+
state = _context37.sent;
|
|
4292
4336
|
this.initialized = true;
|
|
4293
4337
|
this.data = state.channel;
|
|
4294
4338
|
|
|
@@ -4297,17 +4341,17 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4297
4341
|
channel: this
|
|
4298
4342
|
});
|
|
4299
4343
|
|
|
4300
|
-
return
|
|
4344
|
+
return _context37.abrupt("return", state);
|
|
4301
4345
|
|
|
4302
4346
|
case 12:
|
|
4303
4347
|
case "end":
|
|
4304
|
-
return
|
|
4348
|
+
return _context37.stop();
|
|
4305
4349
|
}
|
|
4306
4350
|
}
|
|
4307
|
-
},
|
|
4351
|
+
}, _callee37, this);
|
|
4308
4352
|
}));
|
|
4309
4353
|
|
|
4310
|
-
function watch(
|
|
4354
|
+
function watch(_x36) {
|
|
4311
4355
|
return _watch.apply(this, arguments);
|
|
4312
4356
|
}
|
|
4313
4357
|
|
|
@@ -4322,31 +4366,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4322
4366
|
}, {
|
|
4323
4367
|
key: "stopWatching",
|
|
4324
4368
|
value: function () {
|
|
4325
|
-
var _stopWatching = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
4369
|
+
var _stopWatching = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee38() {
|
|
4326
4370
|
var response;
|
|
4327
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
4371
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee38$(_context38) {
|
|
4328
4372
|
while (1) {
|
|
4329
|
-
switch (
|
|
4373
|
+
switch (_context38.prev = _context38.next) {
|
|
4330
4374
|
case 0:
|
|
4331
|
-
|
|
4375
|
+
_context38.next = 2;
|
|
4332
4376
|
return this.getClient().post(this._channelURL() + '/stop-watching', {});
|
|
4333
4377
|
|
|
4334
4378
|
case 2:
|
|
4335
|
-
response =
|
|
4379
|
+
response = _context38.sent;
|
|
4336
4380
|
|
|
4337
4381
|
this._client.logger('info', "channel:watch() - stopped watching channel ".concat(this.cid), {
|
|
4338
4382
|
tags: ['channel'],
|
|
4339
4383
|
channel: this
|
|
4340
4384
|
});
|
|
4341
4385
|
|
|
4342
|
-
return
|
|
4386
|
+
return _context38.abrupt("return", response);
|
|
4343
4387
|
|
|
4344
4388
|
case 5:
|
|
4345
4389
|
case "end":
|
|
4346
|
-
return
|
|
4390
|
+
return _context38.stop();
|
|
4347
4391
|
}
|
|
4348
4392
|
}
|
|
4349
|
-
},
|
|
4393
|
+
}, _callee38, this);
|
|
4350
4394
|
}));
|
|
4351
4395
|
|
|
4352
4396
|
function stopWatching() {
|
|
@@ -4369,37 +4413,37 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4369
4413
|
}, {
|
|
4370
4414
|
key: "getReplies",
|
|
4371
4415
|
value: function () {
|
|
4372
|
-
var _getReplies = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
4416
|
+
var _getReplies = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee39(parent_id, options, sort) {
|
|
4373
4417
|
var normalizedSort, data;
|
|
4374
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
4418
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee39$(_context39) {
|
|
4375
4419
|
while (1) {
|
|
4376
|
-
switch (
|
|
4420
|
+
switch (_context39.prev = _context39.next) {
|
|
4377
4421
|
case 0:
|
|
4378
4422
|
normalizedSort = sort ? normalizeQuerySort(sort) : undefined;
|
|
4379
|
-
|
|
4423
|
+
_context39.next = 3;
|
|
4380
4424
|
return this.getClient().get(this.getClient().baseURL + "/messages/".concat(encodeURIComponent(parent_id), "/replies"), _objectSpread$c({
|
|
4381
4425
|
sort: normalizedSort
|
|
4382
4426
|
}, options));
|
|
4383
4427
|
|
|
4384
4428
|
case 3:
|
|
4385
|
-
data =
|
|
4429
|
+
data = _context39.sent;
|
|
4386
4430
|
|
|
4387
4431
|
// add any messages to our thread state
|
|
4388
4432
|
if (data.messages) {
|
|
4389
4433
|
this.state.addMessagesSorted(data.messages);
|
|
4390
4434
|
}
|
|
4391
4435
|
|
|
4392
|
-
return
|
|
4436
|
+
return _context39.abrupt("return", data);
|
|
4393
4437
|
|
|
4394
4438
|
case 6:
|
|
4395
4439
|
case "end":
|
|
4396
|
-
return
|
|
4440
|
+
return _context39.stop();
|
|
4397
4441
|
}
|
|
4398
4442
|
}
|
|
4399
|
-
},
|
|
4443
|
+
}, _callee39, this);
|
|
4400
4444
|
}));
|
|
4401
4445
|
|
|
4402
|
-
function getReplies(
|
|
4446
|
+
function getReplies(_x37, _x38, _x39) {
|
|
4403
4447
|
return _getReplies.apply(this, arguments);
|
|
4404
4448
|
}
|
|
4405
4449
|
|
|
@@ -4417,15 +4461,15 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4417
4461
|
}, {
|
|
4418
4462
|
key: "getPinnedMessages",
|
|
4419
4463
|
value: function () {
|
|
4420
|
-
var _getPinnedMessages = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
4464
|
+
var _getPinnedMessages = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee40(options) {
|
|
4421
4465
|
var sort,
|
|
4422
|
-
|
|
4423
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
4466
|
+
_args40 = arguments;
|
|
4467
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee40$(_context40) {
|
|
4424
4468
|
while (1) {
|
|
4425
|
-
switch (
|
|
4469
|
+
switch (_context40.prev = _context40.next) {
|
|
4426
4470
|
case 0:
|
|
4427
|
-
sort =
|
|
4428
|
-
|
|
4471
|
+
sort = _args40.length > 1 && _args40[1] !== undefined ? _args40[1] : [];
|
|
4472
|
+
_context40.next = 3;
|
|
4429
4473
|
return this.getClient().get(this._channelURL() + '/pinned_messages', {
|
|
4430
4474
|
payload: _objectSpread$c(_objectSpread$c({}, options), {}, {
|
|
4431
4475
|
sort: normalizeQuerySort(sort)
|
|
@@ -4433,17 +4477,17 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4433
4477
|
});
|
|
4434
4478
|
|
|
4435
4479
|
case 3:
|
|
4436
|
-
return
|
|
4480
|
+
return _context40.abrupt("return", _context40.sent);
|
|
4437
4481
|
|
|
4438
4482
|
case 4:
|
|
4439
4483
|
case "end":
|
|
4440
|
-
return
|
|
4484
|
+
return _context40.stop();
|
|
4441
4485
|
}
|
|
4442
4486
|
}
|
|
4443
|
-
},
|
|
4487
|
+
}, _callee40, this);
|
|
4444
4488
|
}));
|
|
4445
4489
|
|
|
4446
|
-
function getPinnedMessages(
|
|
4490
|
+
function getPinnedMessages(_x40) {
|
|
4447
4491
|
return _getPinnedMessages.apply(this, arguments);
|
|
4448
4492
|
}
|
|
4449
4493
|
|
|
@@ -4579,7 +4623,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4579
4623
|
* @return {Promise<QueryChannelAPIResponse<StreamChatGenerics>>} Returns a query response
|
|
4580
4624
|
*/
|
|
4581
4625
|
function () {
|
|
4582
|
-
var _query = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
4626
|
+
var _query = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee41(options) {
|
|
4583
4627
|
var _options$messages$lim, _options$messages, _this$data6, _this$data7;
|
|
4584
4628
|
|
|
4585
4629
|
var messageSetToAddToIfDoesNotExist,
|
|
@@ -4589,14 +4633,14 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4589
4633
|
_this$_initializeStat,
|
|
4590
4634
|
messageSet,
|
|
4591
4635
|
areCapabilitiesChanged,
|
|
4592
|
-
|
|
4636
|
+
_args41 = arguments;
|
|
4593
4637
|
|
|
4594
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
4638
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee41$(_context41) {
|
|
4595
4639
|
while (1) {
|
|
4596
|
-
switch (
|
|
4640
|
+
switch (_context41.prev = _context41.next) {
|
|
4597
4641
|
case 0:
|
|
4598
|
-
messageSetToAddToIfDoesNotExist =
|
|
4599
|
-
|
|
4642
|
+
messageSetToAddToIfDoesNotExist = _args41.length > 1 && _args41[1] !== undefined ? _args41[1] : 'current';
|
|
4643
|
+
_context41.next = 3;
|
|
4600
4644
|
return this.getClient().wsPromise;
|
|
4601
4645
|
|
|
4602
4646
|
case 3:
|
|
@@ -4606,14 +4650,14 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4606
4650
|
queryURL += "/".concat(encodeURIComponent(this.id));
|
|
4607
4651
|
}
|
|
4608
4652
|
|
|
4609
|
-
|
|
4653
|
+
_context41.next = 7;
|
|
4610
4654
|
return this.getClient().post(queryURL + '/query', _objectSpread$c({
|
|
4611
4655
|
data: this._data,
|
|
4612
4656
|
state: true
|
|
4613
4657
|
}, options));
|
|
4614
4658
|
|
|
4615
4659
|
case 7:
|
|
4616
|
-
state =
|
|
4660
|
+
state = _context41.sent;
|
|
4617
4661
|
|
|
4618
4662
|
// update the channel id if it was missing
|
|
4619
4663
|
if (!this.id) {
|
|
@@ -4668,17 +4712,17 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4668
4712
|
isLatestMessageSet: messageSet.isLatest
|
|
4669
4713
|
}
|
|
4670
4714
|
});
|
|
4671
|
-
return
|
|
4715
|
+
return _context41.abrupt("return", state);
|
|
4672
4716
|
|
|
4673
4717
|
case 19:
|
|
4674
4718
|
case "end":
|
|
4675
|
-
return
|
|
4719
|
+
return _context41.stop();
|
|
4676
4720
|
}
|
|
4677
4721
|
}
|
|
4678
|
-
},
|
|
4722
|
+
}, _callee41, this);
|
|
4679
4723
|
}));
|
|
4680
4724
|
|
|
4681
|
-
function query(
|
|
4725
|
+
function query(_x41) {
|
|
4682
4726
|
return _query.apply(this, arguments);
|
|
4683
4727
|
}
|
|
4684
4728
|
|
|
@@ -4695,31 +4739,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4695
4739
|
}, {
|
|
4696
4740
|
key: "banUser",
|
|
4697
4741
|
value: function () {
|
|
4698
|
-
var _banUser = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
4699
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
4742
|
+
var _banUser = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee42(targetUserID, options) {
|
|
4743
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee42$(_context42) {
|
|
4700
4744
|
while (1) {
|
|
4701
|
-
switch (
|
|
4745
|
+
switch (_context42.prev = _context42.next) {
|
|
4702
4746
|
case 0:
|
|
4703
4747
|
this._checkInitialized();
|
|
4704
4748
|
|
|
4705
|
-
|
|
4749
|
+
_context42.next = 3;
|
|
4706
4750
|
return this.getClient().banUser(targetUserID, _objectSpread$c(_objectSpread$c({}, options), {}, {
|
|
4707
4751
|
type: this.type,
|
|
4708
4752
|
id: this.id
|
|
4709
4753
|
}));
|
|
4710
4754
|
|
|
4711
4755
|
case 3:
|
|
4712
|
-
return
|
|
4756
|
+
return _context42.abrupt("return", _context42.sent);
|
|
4713
4757
|
|
|
4714
4758
|
case 4:
|
|
4715
4759
|
case "end":
|
|
4716
|
-
return
|
|
4760
|
+
return _context42.stop();
|
|
4717
4761
|
}
|
|
4718
4762
|
}
|
|
4719
|
-
},
|
|
4763
|
+
}, _callee42, this);
|
|
4720
4764
|
}));
|
|
4721
4765
|
|
|
4722
|
-
function banUser(
|
|
4766
|
+
function banUser(_x42, _x43) {
|
|
4723
4767
|
return _banUser.apply(this, arguments);
|
|
4724
4768
|
}
|
|
4725
4769
|
|
|
@@ -4737,34 +4781,34 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4737
4781
|
}, {
|
|
4738
4782
|
key: "hide",
|
|
4739
4783
|
value: function () {
|
|
4740
|
-
var _hide = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
4784
|
+
var _hide = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee43() {
|
|
4741
4785
|
var userId,
|
|
4742
4786
|
clearHistory,
|
|
4743
|
-
|
|
4744
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
4787
|
+
_args43 = arguments;
|
|
4788
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee43$(_context43) {
|
|
4745
4789
|
while (1) {
|
|
4746
|
-
switch (
|
|
4790
|
+
switch (_context43.prev = _context43.next) {
|
|
4747
4791
|
case 0:
|
|
4748
|
-
userId =
|
|
4749
|
-
clearHistory =
|
|
4792
|
+
userId = _args43.length > 0 && _args43[0] !== undefined ? _args43[0] : null;
|
|
4793
|
+
clearHistory = _args43.length > 1 && _args43[1] !== undefined ? _args43[1] : false;
|
|
4750
4794
|
|
|
4751
4795
|
this._checkInitialized();
|
|
4752
4796
|
|
|
4753
|
-
|
|
4797
|
+
_context43.next = 5;
|
|
4754
4798
|
return this.getClient().post("".concat(this._channelURL(), "/hide"), {
|
|
4755
4799
|
user_id: userId,
|
|
4756
4800
|
clear_history: clearHistory
|
|
4757
4801
|
});
|
|
4758
4802
|
|
|
4759
4803
|
case 5:
|
|
4760
|
-
return
|
|
4804
|
+
return _context43.abrupt("return", _context43.sent);
|
|
4761
4805
|
|
|
4762
4806
|
case 6:
|
|
4763
4807
|
case "end":
|
|
4764
|
-
return
|
|
4808
|
+
return _context43.stop();
|
|
4765
4809
|
}
|
|
4766
4810
|
}
|
|
4767
|
-
},
|
|
4811
|
+
}, _callee43, this);
|
|
4768
4812
|
}));
|
|
4769
4813
|
|
|
4770
4814
|
function hide() {
|
|
@@ -4783,31 +4827,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4783
4827
|
}, {
|
|
4784
4828
|
key: "show",
|
|
4785
4829
|
value: function () {
|
|
4786
|
-
var _show = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
4830
|
+
var _show = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee44() {
|
|
4787
4831
|
var userId,
|
|
4788
|
-
|
|
4789
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
4832
|
+
_args44 = arguments;
|
|
4833
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee44$(_context44) {
|
|
4790
4834
|
while (1) {
|
|
4791
|
-
switch (
|
|
4835
|
+
switch (_context44.prev = _context44.next) {
|
|
4792
4836
|
case 0:
|
|
4793
|
-
userId =
|
|
4837
|
+
userId = _args44.length > 0 && _args44[0] !== undefined ? _args44[0] : null;
|
|
4794
4838
|
|
|
4795
4839
|
this._checkInitialized();
|
|
4796
4840
|
|
|
4797
|
-
|
|
4841
|
+
_context44.next = 4;
|
|
4798
4842
|
return this.getClient().post("".concat(this._channelURL(), "/show"), {
|
|
4799
4843
|
user_id: userId
|
|
4800
4844
|
});
|
|
4801
4845
|
|
|
4802
4846
|
case 4:
|
|
4803
|
-
return
|
|
4847
|
+
return _context44.abrupt("return", _context44.sent);
|
|
4804
4848
|
|
|
4805
4849
|
case 5:
|
|
4806
4850
|
case "end":
|
|
4807
|
-
return
|
|
4851
|
+
return _context44.stop();
|
|
4808
4852
|
}
|
|
4809
4853
|
}
|
|
4810
|
-
},
|
|
4854
|
+
}, _callee44, this);
|
|
4811
4855
|
}));
|
|
4812
4856
|
|
|
4813
4857
|
function show() {
|
|
@@ -4826,31 +4870,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4826
4870
|
}, {
|
|
4827
4871
|
key: "unbanUser",
|
|
4828
4872
|
value: function () {
|
|
4829
|
-
var _unbanUser = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
4830
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
4873
|
+
var _unbanUser = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee45(targetUserID) {
|
|
4874
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee45$(_context45) {
|
|
4831
4875
|
while (1) {
|
|
4832
|
-
switch (
|
|
4876
|
+
switch (_context45.prev = _context45.next) {
|
|
4833
4877
|
case 0:
|
|
4834
4878
|
this._checkInitialized();
|
|
4835
4879
|
|
|
4836
|
-
|
|
4880
|
+
_context45.next = 3;
|
|
4837
4881
|
return this.getClient().unbanUser(targetUserID, {
|
|
4838
4882
|
type: this.type,
|
|
4839
4883
|
id: this.id
|
|
4840
4884
|
});
|
|
4841
4885
|
|
|
4842
4886
|
case 3:
|
|
4843
|
-
return
|
|
4887
|
+
return _context45.abrupt("return", _context45.sent);
|
|
4844
4888
|
|
|
4845
4889
|
case 4:
|
|
4846
4890
|
case "end":
|
|
4847
|
-
return
|
|
4891
|
+
return _context45.stop();
|
|
4848
4892
|
}
|
|
4849
4893
|
}
|
|
4850
|
-
},
|
|
4894
|
+
}, _callee45, this);
|
|
4851
4895
|
}));
|
|
4852
4896
|
|
|
4853
|
-
function unbanUser(
|
|
4897
|
+
function unbanUser(_x44) {
|
|
4854
4898
|
return _unbanUser.apply(this, arguments);
|
|
4855
4899
|
}
|
|
4856
4900
|
|
|
@@ -4867,31 +4911,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4867
4911
|
}, {
|
|
4868
4912
|
key: "shadowBan",
|
|
4869
4913
|
value: function () {
|
|
4870
|
-
var _shadowBan = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
4871
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
4914
|
+
var _shadowBan = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee46(targetUserID, options) {
|
|
4915
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee46$(_context46) {
|
|
4872
4916
|
while (1) {
|
|
4873
|
-
switch (
|
|
4917
|
+
switch (_context46.prev = _context46.next) {
|
|
4874
4918
|
case 0:
|
|
4875
4919
|
this._checkInitialized();
|
|
4876
4920
|
|
|
4877
|
-
|
|
4921
|
+
_context46.next = 3;
|
|
4878
4922
|
return this.getClient().shadowBan(targetUserID, _objectSpread$c(_objectSpread$c({}, options), {}, {
|
|
4879
4923
|
type: this.type,
|
|
4880
4924
|
id: this.id
|
|
4881
4925
|
}));
|
|
4882
4926
|
|
|
4883
4927
|
case 3:
|
|
4884
|
-
return
|
|
4928
|
+
return _context46.abrupt("return", _context46.sent);
|
|
4885
4929
|
|
|
4886
4930
|
case 4:
|
|
4887
4931
|
case "end":
|
|
4888
|
-
return
|
|
4932
|
+
return _context46.stop();
|
|
4889
4933
|
}
|
|
4890
4934
|
}
|
|
4891
|
-
},
|
|
4935
|
+
}, _callee46, this);
|
|
4892
4936
|
}));
|
|
4893
4937
|
|
|
4894
|
-
function shadowBan(
|
|
4938
|
+
function shadowBan(_x45, _x46) {
|
|
4895
4939
|
return _shadowBan.apply(this, arguments);
|
|
4896
4940
|
}
|
|
4897
4941
|
|
|
@@ -4907,31 +4951,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4907
4951
|
}, {
|
|
4908
4952
|
key: "removeShadowBan",
|
|
4909
4953
|
value: function () {
|
|
4910
|
-
var _removeShadowBan = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
4911
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
4954
|
+
var _removeShadowBan = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee47(targetUserID) {
|
|
4955
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee47$(_context47) {
|
|
4912
4956
|
while (1) {
|
|
4913
|
-
switch (
|
|
4957
|
+
switch (_context47.prev = _context47.next) {
|
|
4914
4958
|
case 0:
|
|
4915
4959
|
this._checkInitialized();
|
|
4916
4960
|
|
|
4917
|
-
|
|
4961
|
+
_context47.next = 3;
|
|
4918
4962
|
return this.getClient().removeShadowBan(targetUserID, {
|
|
4919
4963
|
type: this.type,
|
|
4920
4964
|
id: this.id
|
|
4921
4965
|
});
|
|
4922
4966
|
|
|
4923
4967
|
case 3:
|
|
4924
|
-
return
|
|
4968
|
+
return _context47.abrupt("return", _context47.sent);
|
|
4925
4969
|
|
|
4926
4970
|
case 4:
|
|
4927
4971
|
case "end":
|
|
4928
|
-
return
|
|
4972
|
+
return _context47.stop();
|
|
4929
4973
|
}
|
|
4930
4974
|
}
|
|
4931
|
-
},
|
|
4975
|
+
}, _callee47, this);
|
|
4932
4976
|
}));
|
|
4933
4977
|
|
|
4934
|
-
function removeShadowBan(
|
|
4978
|
+
function removeShadowBan(_x47) {
|
|
4935
4979
|
return _removeShadowBan.apply(this, arguments);
|
|
4936
4980
|
}
|
|
4937
4981
|
|
|
@@ -4947,26 +4991,26 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4947
4991
|
}, {
|
|
4948
4992
|
key: "createCall",
|
|
4949
4993
|
value: function () {
|
|
4950
|
-
var _createCall = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
4951
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
4994
|
+
var _createCall = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee48(options) {
|
|
4995
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee48$(_context48) {
|
|
4952
4996
|
while (1) {
|
|
4953
|
-
switch (
|
|
4997
|
+
switch (_context48.prev = _context48.next) {
|
|
4954
4998
|
case 0:
|
|
4955
|
-
|
|
4999
|
+
_context48.next = 2;
|
|
4956
5000
|
return this.getClient().post(this._channelURL() + '/call', options);
|
|
4957
5001
|
|
|
4958
5002
|
case 2:
|
|
4959
|
-
return
|
|
5003
|
+
return _context48.abrupt("return", _context48.sent);
|
|
4960
5004
|
|
|
4961
5005
|
case 3:
|
|
4962
5006
|
case "end":
|
|
4963
|
-
return
|
|
5007
|
+
return _context48.stop();
|
|
4964
5008
|
}
|
|
4965
5009
|
}
|
|
4966
|
-
},
|
|
5010
|
+
}, _callee48, this);
|
|
4967
5011
|
}));
|
|
4968
5012
|
|
|
4969
|
-
function createCall(
|
|
5013
|
+
function createCall(_x48) {
|
|
4970
5014
|
return _createCall.apply(this, arguments);
|
|
4971
5015
|
}
|
|
4972
5016
|
|
|
@@ -4982,26 +5026,26 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4982
5026
|
}, {
|
|
4983
5027
|
key: "vote",
|
|
4984
5028
|
value: function () {
|
|
4985
|
-
var _vote2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
4986
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
5029
|
+
var _vote2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee49(messageId, pollId, _vote) {
|
|
5030
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee49$(_context49) {
|
|
4987
5031
|
while (1) {
|
|
4988
|
-
switch (
|
|
5032
|
+
switch (_context49.prev = _context49.next) {
|
|
4989
5033
|
case 0:
|
|
4990
|
-
|
|
5034
|
+
_context49.next = 2;
|
|
4991
5035
|
return this.getClient().castPollVote(messageId, pollId, _vote);
|
|
4992
5036
|
|
|
4993
5037
|
case 2:
|
|
4994
|
-
return
|
|
5038
|
+
return _context49.abrupt("return", _context49.sent);
|
|
4995
5039
|
|
|
4996
5040
|
case 3:
|
|
4997
5041
|
case "end":
|
|
4998
|
-
return
|
|
5042
|
+
return _context49.stop();
|
|
4999
5043
|
}
|
|
5000
5044
|
}
|
|
5001
|
-
},
|
|
5045
|
+
}, _callee49, this);
|
|
5002
5046
|
}));
|
|
5003
5047
|
|
|
5004
|
-
function vote(
|
|
5048
|
+
function vote(_x49, _x50, _x51) {
|
|
5005
5049
|
return _vote2.apply(this, arguments);
|
|
5006
5050
|
}
|
|
5007
5051
|
|
|
@@ -5010,26 +5054,26 @@ var Channel = /*#__PURE__*/function () {
|
|
|
5010
5054
|
}, {
|
|
5011
5055
|
key: "removeVote",
|
|
5012
5056
|
value: function () {
|
|
5013
|
-
var _removeVote = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
5014
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
5057
|
+
var _removeVote = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee50(messageId, pollId, voteId) {
|
|
5058
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee50$(_context50) {
|
|
5015
5059
|
while (1) {
|
|
5016
|
-
switch (
|
|
5060
|
+
switch (_context50.prev = _context50.next) {
|
|
5017
5061
|
case 0:
|
|
5018
|
-
|
|
5062
|
+
_context50.next = 2;
|
|
5019
5063
|
return this.getClient().removePollVote(messageId, pollId, voteId);
|
|
5020
5064
|
|
|
5021
5065
|
case 2:
|
|
5022
|
-
return
|
|
5066
|
+
return _context50.abrupt("return", _context50.sent);
|
|
5023
5067
|
|
|
5024
5068
|
case 3:
|
|
5025
5069
|
case "end":
|
|
5026
|
-
return
|
|
5070
|
+
return _context50.stop();
|
|
5027
5071
|
}
|
|
5028
5072
|
}
|
|
5029
|
-
},
|
|
5073
|
+
}, _callee50, this);
|
|
5030
5074
|
}));
|
|
5031
5075
|
|
|
5032
|
-
function removeVote(
|
|
5076
|
+
function removeVote(_x52, _x53, _x54) {
|
|
5033
5077
|
return _removeVote.apply(this, arguments);
|
|
5034
5078
|
}
|
|
5035
5079
|
|
|
@@ -5048,28 +5092,28 @@ var Channel = /*#__PURE__*/function () {
|
|
|
5048
5092
|
}, {
|
|
5049
5093
|
key: "createDraft",
|
|
5050
5094
|
value: function () {
|
|
5051
|
-
var _createDraft = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
5052
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
5095
|
+
var _createDraft = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee51(message) {
|
|
5096
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee51$(_context51) {
|
|
5053
5097
|
while (1) {
|
|
5054
|
-
switch (
|
|
5098
|
+
switch (_context51.prev = _context51.next) {
|
|
5055
5099
|
case 0:
|
|
5056
|
-
|
|
5100
|
+
_context51.next = 2;
|
|
5057
5101
|
return this.getClient().post(this._channelURL() + '/draft', {
|
|
5058
5102
|
message: message
|
|
5059
5103
|
});
|
|
5060
5104
|
|
|
5061
5105
|
case 2:
|
|
5062
|
-
return
|
|
5106
|
+
return _context51.abrupt("return", _context51.sent);
|
|
5063
5107
|
|
|
5064
5108
|
case 3:
|
|
5065
5109
|
case "end":
|
|
5066
|
-
return
|
|
5110
|
+
return _context51.stop();
|
|
5067
5111
|
}
|
|
5068
5112
|
}
|
|
5069
|
-
},
|
|
5113
|
+
}, _callee51, this);
|
|
5070
5114
|
}));
|
|
5071
5115
|
|
|
5072
|
-
function createDraft(
|
|
5116
|
+
function createDraft(_x55) {
|
|
5073
5117
|
return _createDraft.apply(this, arguments);
|
|
5074
5118
|
}
|
|
5075
5119
|
|
|
@@ -5087,30 +5131,30 @@ var Channel = /*#__PURE__*/function () {
|
|
|
5087
5131
|
}, {
|
|
5088
5132
|
key: "deleteDraft",
|
|
5089
5133
|
value: function () {
|
|
5090
|
-
var _deleteDraft = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
5134
|
+
var _deleteDraft = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee52() {
|
|
5091
5135
|
var _ref2,
|
|
5092
5136
|
parent_id,
|
|
5093
|
-
|
|
5137
|
+
_args52 = arguments;
|
|
5094
5138
|
|
|
5095
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
5139
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee52$(_context52) {
|
|
5096
5140
|
while (1) {
|
|
5097
|
-
switch (
|
|
5141
|
+
switch (_context52.prev = _context52.next) {
|
|
5098
5142
|
case 0:
|
|
5099
|
-
_ref2 =
|
|
5100
|
-
|
|
5143
|
+
_ref2 = _args52.length > 0 && _args52[0] !== undefined ? _args52[0] : {}, parent_id = _ref2.parent_id;
|
|
5144
|
+
_context52.next = 3;
|
|
5101
5145
|
return this.getClient().delete(this._channelURL() + '/draft', {
|
|
5102
5146
|
parent_id: parent_id
|
|
5103
5147
|
});
|
|
5104
5148
|
|
|
5105
5149
|
case 3:
|
|
5106
|
-
return
|
|
5150
|
+
return _context52.abrupt("return", _context52.sent);
|
|
5107
5151
|
|
|
5108
5152
|
case 4:
|
|
5109
5153
|
case "end":
|
|
5110
|
-
return
|
|
5154
|
+
return _context52.stop();
|
|
5111
5155
|
}
|
|
5112
5156
|
}
|
|
5113
|
-
},
|
|
5157
|
+
}, _callee52, this);
|
|
5114
5158
|
}));
|
|
5115
5159
|
|
|
5116
5160
|
function deleteDraft() {
|
|
@@ -5131,30 +5175,30 @@ var Channel = /*#__PURE__*/function () {
|
|
|
5131
5175
|
}, {
|
|
5132
5176
|
key: "getDraft",
|
|
5133
5177
|
value: function () {
|
|
5134
|
-
var _getDraft = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
5178
|
+
var _getDraft = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee53() {
|
|
5135
5179
|
var _ref3,
|
|
5136
5180
|
parent_id,
|
|
5137
|
-
|
|
5181
|
+
_args53 = arguments;
|
|
5138
5182
|
|
|
5139
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
5183
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee53$(_context53) {
|
|
5140
5184
|
while (1) {
|
|
5141
|
-
switch (
|
|
5185
|
+
switch (_context53.prev = _context53.next) {
|
|
5142
5186
|
case 0:
|
|
5143
|
-
_ref3 =
|
|
5144
|
-
|
|
5187
|
+
_ref3 = _args53.length > 0 && _args53[0] !== undefined ? _args53[0] : {}, parent_id = _ref3.parent_id;
|
|
5188
|
+
_context53.next = 3;
|
|
5145
5189
|
return this.getClient().get(this._channelURL() + '/draft', {
|
|
5146
5190
|
parent_id: parent_id
|
|
5147
5191
|
});
|
|
5148
5192
|
|
|
5149
5193
|
case 3:
|
|
5150
|
-
return
|
|
5194
|
+
return _context53.abrupt("return", _context53.sent);
|
|
5151
5195
|
|
|
5152
5196
|
case 4:
|
|
5153
5197
|
case "end":
|
|
5154
|
-
return
|
|
5198
|
+
return _context53.stop();
|
|
5155
5199
|
}
|
|
5156
5200
|
}
|
|
5157
|
-
},
|
|
5201
|
+
}, _callee53, this);
|
|
5158
5202
|
}));
|
|
5159
5203
|
|
|
5160
5204
|
function getDraft() {
|
|
@@ -5233,7 +5277,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
5233
5277
|
}, {
|
|
5234
5278
|
key: "_handleChannelEvent",
|
|
5235
5279
|
value: function _handleChannelEvent(event) {
|
|
5236
|
-
var _event$user, _event$user2, _event$user3, _event$user5, _event$user6, _event$channel, _event$
|
|
5280
|
+
var _event$user, _event$user2, _event$user3, _event$user5, _event$user6, _event$channel, _event$user9, _event$user11, _channelState$members, _event$user12, _channelState$members2;
|
|
5237
5281
|
|
|
5238
5282
|
var channel = this;
|
|
5239
5283
|
|
|
@@ -5407,15 +5451,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
5407
5451
|
|
|
5408
5452
|
case 'member.added':
|
|
5409
5453
|
case 'member.updated':
|
|
5410
|
-
|
|
5411
|
-
|
|
5412
|
-
}
|
|
5454
|
+
{
|
|
5455
|
+
var _memberCopy$user;
|
|
5413
5456
|
|
|
5414
|
-
|
|
5415
|
-
channelState.membership = event.member;
|
|
5416
|
-
}
|
|
5457
|
+
var memberCopy = _objectSpread$c({}, event.member);
|
|
5417
5458
|
|
|
5418
|
-
|
|
5459
|
+
if (memberCopy.pinned_at === null) {
|
|
5460
|
+
delete memberCopy.pinned_at;
|
|
5461
|
+
}
|
|
5462
|
+
|
|
5463
|
+
if (memberCopy.archived_at === null) {
|
|
5464
|
+
delete memberCopy.archived_at;
|
|
5465
|
+
}
|
|
5466
|
+
|
|
5467
|
+
if (memberCopy !== null && memberCopy !== void 0 && memberCopy.user) {
|
|
5468
|
+
channelState.members = _objectSpread$c(_objectSpread$c({}, channelState.members), {}, _defineProperty__default['default']({}, memberCopy.user.id, memberCopy));
|
|
5469
|
+
}
|
|
5470
|
+
|
|
5471
|
+
var currentUserId = this.getClient().userID;
|
|
5472
|
+
|
|
5473
|
+
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) {
|
|
5474
|
+
channelState.membership = memberCopy;
|
|
5475
|
+
}
|
|
5476
|
+
|
|
5477
|
+
break;
|
|
5478
|
+
}
|
|
5419
5479
|
|
|
5420
5480
|
case 'member.removed':
|
|
5421
5481
|
if ((_event$user9 = event.user) !== null && _event$user9 !== void 0 && _event$user9.id) {
|
|
@@ -5516,7 +5576,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
5516
5576
|
channelState.members[event.user.id] = _objectSpread$c(_objectSpread$c({}, channelState.members[event.user.id] || {}), {}, {
|
|
5517
5577
|
shadow_banned: !!event.shadow,
|
|
5518
5578
|
banned: !event.shadow,
|
|
5519
|
-
user: _objectSpread$c(_objectSpread$c({}, ((_channelState$
|
|
5579
|
+
user: _objectSpread$c(_objectSpread$c({}, ((_channelState$members = channelState.members[event.user.id]) === null || _channelState$members === void 0 ? void 0 : _channelState$members.user) || {}), event.user)
|
|
5520
5580
|
});
|
|
5521
5581
|
break;
|
|
5522
5582
|
|
|
@@ -5525,7 +5585,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
5525
5585
|
channelState.members[event.user.id] = _objectSpread$c(_objectSpread$c({}, channelState.members[event.user.id] || {}), {}, {
|
|
5526
5586
|
shadow_banned: false,
|
|
5527
5587
|
banned: false,
|
|
5528
|
-
user: _objectSpread$c(_objectSpread$c({}, ((_channelState$
|
|
5588
|
+
user: _objectSpread$c(_objectSpread$c({}, ((_channelState$members2 = channelState.members[event.user.id]) === null || _channelState$members2 === void 0 ? void 0 : _channelState$members2.user) || {}), event.user)
|
|
5529
5589
|
});
|
|
5530
5590
|
break;
|
|
5531
5591
|
} // any event can send over the online count
|
|
@@ -11796,6 +11856,10 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11796
11856
|
|
|
11797
11857
|
_defineProperty__default['default'](this, "deviceIdentifier", void 0);
|
|
11798
11858
|
|
|
11859
|
+
_defineProperty__default['default'](this, "appIdentifier", void 0);
|
|
11860
|
+
|
|
11861
|
+
_defineProperty__default['default'](this, "cachedUserAgent", void 0);
|
|
11862
|
+
|
|
11799
11863
|
_defineProperty__default['default'](this, "nextRequestAbortController", null);
|
|
11800
11864
|
|
|
11801
11865
|
_defineProperty__default['default'](this, "_getConnectionID", function () {
|
|
@@ -12533,6 +12597,55 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
12533
12597
|
|
|
12534
12598
|
_defineProperty__default['default'](this, "markAllRead", this.markChannelsRead);
|
|
12535
12599
|
|
|
12600
|
+
_defineProperty__default['default'](this, "getUserAgent", function () {
|
|
12601
|
+
// An explicit override (deprecated `setUserAgent`) always wins and is never cached.
|
|
12602
|
+
if (_this.userAgent) {
|
|
12603
|
+
return _this.userAgent;
|
|
12604
|
+
} // Computed once, then memoized for the client's lifetime - inputs read on
|
|
12605
|
+
// the first call (sdk/app/device identifiers, build-time env) are not re-read.
|
|
12606
|
+
|
|
12607
|
+
|
|
12608
|
+
if (!_this.cachedUserAgent) {
|
|
12609
|
+
var _this$sdkIdentifier, _this$appIdentifier, _this$deviceIdentifie;
|
|
12610
|
+
|
|
12611
|
+
var version = "8.61.0";
|
|
12612
|
+
|
|
12613
|
+
var _ref8 = (_this$sdkIdentifier = _this.sdkIdentifier) !== null && _this$sdkIdentifier !== void 0 ? _this$sdkIdentifier : {},
|
|
12614
|
+
sdkName = _ref8.name,
|
|
12615
|
+
sdkVersion = _ref8.version;
|
|
12616
|
+
|
|
12617
|
+
var _ref9 = (_this$appIdentifier = _this.appIdentifier) !== null && _this$appIdentifier !== void 0 ? _this$appIdentifier : {},
|
|
12618
|
+
appName = _ref9.name,
|
|
12619
|
+
appVersion = _ref9.version;
|
|
12620
|
+
|
|
12621
|
+
var _ref10 = (_this$deviceIdentifie = _this.deviceIdentifier) !== null && _this$deviceIdentifie !== void 0 ? _this$deviceIdentifie : {},
|
|
12622
|
+
os = _ref10.os,
|
|
12623
|
+
deviceModel = _ref10.model;
|
|
12624
|
+
|
|
12625
|
+
var head = sdkName ? "stream-chat-".concat(sdkName, "-v").concat(sdkVersion, "-llc-v").concat(version) : "stream-chat-js-v".concat(version, "-").concat(_this.node ? 'node' : 'browser');
|
|
12626
|
+
_this.cachedUserAgent = [head].concat(_toConsumableArray__default['default'](Object.entries({
|
|
12627
|
+
app: appName,
|
|
12628
|
+
app_version: appVersion,
|
|
12629
|
+
os: os,
|
|
12630
|
+
device_model: deviceModel,
|
|
12631
|
+
client_bundle: ""
|
|
12632
|
+
}).filter(function (_ref11) {
|
|
12633
|
+
var _ref12 = _slicedToArray__default['default'](_ref11, 2),
|
|
12634
|
+
value = _ref12[1];
|
|
12635
|
+
|
|
12636
|
+
return value && value.length > 0;
|
|
12637
|
+
}).map(function (_ref13) {
|
|
12638
|
+
var _ref14 = _slicedToArray__default['default'](_ref13, 2),
|
|
12639
|
+
key = _ref14[0],
|
|
12640
|
+
value = _ref14[1];
|
|
12641
|
+
|
|
12642
|
+
return "".concat(key, "=").concat(value);
|
|
12643
|
+
}))).join('|');
|
|
12644
|
+
}
|
|
12645
|
+
|
|
12646
|
+
return _this.cachedUserAgent;
|
|
12647
|
+
});
|
|
12648
|
+
|
|
12536
12649
|
_defineProperty__default['default'](this, "_isUsingServerAuth", function () {
|
|
12537
12650
|
return !!_this.secret;
|
|
12538
12651
|
});
|
|
@@ -14309,13 +14422,13 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
14309
14422
|
key: "getRateLimits",
|
|
14310
14423
|
value: function () {
|
|
14311
14424
|
var _getRateLimits = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee29(params) {
|
|
14312
|
-
var
|
|
14425
|
+
var _ref15, serverSide, web, android, ios, endpoints;
|
|
14313
14426
|
|
|
14314
14427
|
return _regeneratorRuntime__default['default'].wrap(function _callee29$(_context29) {
|
|
14315
14428
|
while (1) {
|
|
14316
14429
|
switch (_context29.prev = _context29.next) {
|
|
14317
14430
|
case 0:
|
|
14318
|
-
|
|
14431
|
+
_ref15 = params || {}, serverSide = _ref15.serverSide, web = _ref15.web, android = _ref15.android, ios = _ref15.ios, endpoints = _ref15.endpoints;
|
|
14319
14432
|
return _context29.abrupt("return", this.get(this.baseURL + '/rate_limits', {
|
|
14320
14433
|
server_side: serverSide,
|
|
14321
14434
|
web: web,
|
|
@@ -14340,9 +14453,9 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
14340
14453
|
}()
|
|
14341
14454
|
}, {
|
|
14342
14455
|
key: "_addChannelConfig",
|
|
14343
|
-
value: function _addChannelConfig(
|
|
14344
|
-
var cid =
|
|
14345
|
-
config =
|
|
14456
|
+
value: function _addChannelConfig(_ref16) {
|
|
14457
|
+
var cid = _ref16.cid,
|
|
14458
|
+
config = _ref16.config;
|
|
14346
14459
|
|
|
14347
14460
|
if (this._cacheEnabled()) {
|
|
14348
14461
|
this.configs[cid] = config;
|
|
@@ -16138,6 +16251,8 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
16138
16251
|
* @param {boolean} options.watch Subscribes the user to the channels of the threads.
|
|
16139
16252
|
* @param {number} options.participant_limit Limits the number of participants returned per threads.
|
|
16140
16253
|
* @param {number} options.reply_limit Limits the number of replies returned per threads.
|
|
16254
|
+
* @param {ThreadFilters} options.filter MongoDB style filters for threads
|
|
16255
|
+
* @param {ThreadSort} options.sort MongoDB style sort for threads
|
|
16141
16256
|
*
|
|
16142
16257
|
* @returns {{ threads: Thread<StreamChatGenerics>[], next: string }} Returns the list of threads and the next cursor.
|
|
16143
16258
|
*/
|
|
@@ -16150,6 +16265,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
16150
16265
|
|
|
16151
16266
|
var options,
|
|
16152
16267
|
optionsWithDefaults,
|
|
16268
|
+
requestBody,
|
|
16153
16269
|
response,
|
|
16154
16270
|
_args66 = arguments;
|
|
16155
16271
|
return _regeneratorRuntime__default['default'].wrap(function _callee66$(_context66) {
|
|
@@ -16163,10 +16279,20 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
16163
16279
|
reply_limit: 3,
|
|
16164
16280
|
watch: true
|
|
16165
16281
|
}, options);
|
|
16166
|
-
|
|
16167
|
-
return this.post("".concat(this.baseURL, "/threads"), optionsWithDefaults);
|
|
16282
|
+
requestBody = _objectSpread$1({}, optionsWithDefaults);
|
|
16168
16283
|
|
|
16169
|
-
|
|
16284
|
+
if (optionsWithDefaults.filter && Object.keys(optionsWithDefaults.filter).length > 0) {
|
|
16285
|
+
requestBody.filter = optionsWithDefaults.filter;
|
|
16286
|
+
}
|
|
16287
|
+
|
|
16288
|
+
if (optionsWithDefaults.sort && (Array.isArray(optionsWithDefaults.sort) ? optionsWithDefaults.sort.length > 0 : Object.keys(optionsWithDefaults.sort).length > 0)) {
|
|
16289
|
+
requestBody.sort = normalizeQuerySort(optionsWithDefaults.sort);
|
|
16290
|
+
}
|
|
16291
|
+
|
|
16292
|
+
_context66.next = 7;
|
|
16293
|
+
return this.post("".concat(this.baseURL, "/threads"), requestBody);
|
|
16294
|
+
|
|
16295
|
+
case 7:
|
|
16170
16296
|
response = _context66.sent;
|
|
16171
16297
|
return _context66.abrupt("return", {
|
|
16172
16298
|
threads: response.threads.map(function (thread) {
|
|
@@ -16178,7 +16304,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
16178
16304
|
next: response.next
|
|
16179
16305
|
});
|
|
16180
16306
|
|
|
16181
|
-
case
|
|
16307
|
+
case 9:
|
|
16182
16308
|
case "end":
|
|
16183
16309
|
return _context66.stop();
|
|
16184
16310
|
}
|
|
@@ -16328,47 +16454,13 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
16328
16454
|
return partialUpdateThread;
|
|
16329
16455
|
}()
|
|
16330
16456
|
}, {
|
|
16331
|
-
key: "
|
|
16332
|
-
value:
|
|
16333
|
-
var _this$deviceIdentifie;
|
|
16334
|
-
|
|
16335
|
-
if (this.userAgent) {
|
|
16336
|
-
return this.userAgent;
|
|
16337
|
-
}
|
|
16338
|
-
|
|
16339
|
-
var version = "8.59.0";
|
|
16340
|
-
var clientBundle = "";
|
|
16341
|
-
var userAgentString = '';
|
|
16342
|
-
|
|
16343
|
-
if (this.sdkIdentifier) {
|
|
16344
|
-
userAgentString = "stream-chat-".concat(this.sdkIdentifier.name, "-v").concat(this.sdkIdentifier.version, "-llc-v").concat(version);
|
|
16345
|
-
} else {
|
|
16346
|
-
userAgentString = "stream-chat-js-v".concat(version, "-").concat(this.node ? 'node' : 'browser');
|
|
16347
|
-
}
|
|
16348
|
-
|
|
16349
|
-
var _ref10 = (_this$deviceIdentifie = this.deviceIdentifier) !== null && _this$deviceIdentifie !== void 0 ? _this$deviceIdentifie : {},
|
|
16350
|
-
os = _ref10.os,
|
|
16351
|
-
model = _ref10.model;
|
|
16352
|
-
|
|
16353
|
-
return [// reports the device OS, if provided
|
|
16354
|
-
['os', os], // reports the device model, if provided
|
|
16355
|
-
['device_model', model], // reports which bundle is being picked from the exports
|
|
16356
|
-
['client_bundle', clientBundle]].reduce(function (withArguments, _ref11) {
|
|
16357
|
-
var _ref12 = _slicedToArray__default['default'](_ref11, 2),
|
|
16358
|
-
key = _ref12[0],
|
|
16359
|
-
value = _ref12[1];
|
|
16360
|
-
|
|
16361
|
-
return value && value.length > 0 ? withArguments.concat("|".concat(key, "=").concat(value)) : withArguments;
|
|
16362
|
-
}, userAgentString);
|
|
16363
|
-
}
|
|
16457
|
+
key: "setUserAgent",
|
|
16458
|
+
value:
|
|
16364
16459
|
/**
|
|
16365
16460
|
* @deprecated use sdkIdentifier instead
|
|
16366
16461
|
* @param userAgent
|
|
16367
16462
|
*/
|
|
16368
|
-
|
|
16369
|
-
}, {
|
|
16370
|
-
key: "setUserAgent",
|
|
16371
|
-
value: function setUserAgent(userAgent) {
|
|
16463
|
+
function setUserAgent(userAgent) {
|
|
16372
16464
|
this.userAgent = userAgent;
|
|
16373
16465
|
}
|
|
16374
16466
|
/**
|
|
@@ -16404,10 +16496,10 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
16404
16496
|
});
|
|
16405
16497
|
}
|
|
16406
16498
|
|
|
16407
|
-
var
|
|
16408
|
-
axiosRequestConfigParams =
|
|
16409
|
-
axiosRequestConfigHeaders =
|
|
16410
|
-
axiosRequestConfigRest = _objectWithoutProperties__default['default'](
|
|
16499
|
+
var _ref17 = this.options.axiosRequestConfig || {},
|
|
16500
|
+
axiosRequestConfigParams = _ref17.params,
|
|
16501
|
+
axiosRequestConfigHeaders = _ref17.headers,
|
|
16502
|
+
axiosRequestConfigRest = _objectWithoutProperties__default['default'](_ref17, _excluded2);
|
|
16411
16503
|
|
|
16412
16504
|
return _objectSpread$1(_objectSpread$1(_objectSpread$1({
|
|
16413
16505
|
params: _objectSpread$1(_objectSpread$1({
|
|
@@ -17750,13 +17842,13 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
17750
17842
|
}, {
|
|
17751
17843
|
key: "deletePushProvider",
|
|
17752
17844
|
value: function () {
|
|
17753
|
-
var _deletePushProvider = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee97(
|
|
17845
|
+
var _deletePushProvider = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee97(_ref18) {
|
|
17754
17846
|
var type, name;
|
|
17755
17847
|
return _regeneratorRuntime__default['default'].wrap(function _callee97$(_context97) {
|
|
17756
17848
|
while (1) {
|
|
17757
17849
|
switch (_context97.prev = _context97.next) {
|
|
17758
17850
|
case 0:
|
|
17759
|
-
type =
|
|
17851
|
+
type = _ref18.type, name = _ref18.name;
|
|
17760
17852
|
_context97.next = 3;
|
|
17761
17853
|
return this.delete(this.baseURL + "/push_providers/".concat(encodeURIComponent(type), "/").concat(encodeURIComponent(name)));
|
|
17762
17854
|
|