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