stream-chat 5.0.0 → 5.1.2
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/README.md +0 -1
- package/dist/browser.es.js +525 -340
- 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 +525 -340
- package/dist/browser.js.map +1 -1
- package/dist/index.es.js +525 -340
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +525 -340
- package/dist/index.js.map +1 -1
- package/dist/types/channel.d.ts +13 -1
- package/dist/types/channel.d.ts.map +1 -1
- package/dist/types/channel_state.d.ts.map +1 -1
- package/dist/types/client.d.ts +35 -5
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/connection_fallback.d.ts +2 -2
- package/dist/types/connection_fallback.d.ts.map +1 -1
- package/dist/types/types.d.ts +84 -2
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils.d.ts.map +1 -1
- package/package.json +23 -29
- package/src/channel.ts +29 -1
- package/src/channel_state.ts +4 -0
- package/src/client.ts +64 -6
- package/src/connection_fallback.ts +9 -5
- package/src/types.ts +127 -1
- package/src/utils.ts +5 -1
package/dist/browser.es.js
CHANGED
|
@@ -88,7 +88,7 @@ var decodeBase64 = function decodeBase64(s) {
|
|
|
88
88
|
|
|
89
89
|
var https = null;
|
|
90
90
|
|
|
91
|
-
function ownKeys$7(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
91
|
+
function ownKeys$7(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
92
92
|
|
|
93
93
|
function _objectSpread$7(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$7(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$7(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
94
94
|
|
|
@@ -311,6 +311,12 @@ var ChannelState = /*#__PURE__*/function () {
|
|
|
311
311
|
for (var i = 0; i < newMessages.length; i += 1) {
|
|
312
312
|
var _this$_channel;
|
|
313
313
|
|
|
314
|
+
var isFromShadowBannedUser = newMessages[i].shadowed;
|
|
315
|
+
|
|
316
|
+
if (isFromShadowBannedUser) {
|
|
317
|
+
continue;
|
|
318
|
+
}
|
|
319
|
+
|
|
314
320
|
var message = this.formatMessage(newMessages[i]);
|
|
315
321
|
|
|
316
322
|
if (message.user && (_this$_channel = this._channel) !== null && _this$_channel !== void 0 && _this$_channel.cid) {
|
|
@@ -700,7 +706,7 @@ var ChannelState = /*#__PURE__*/function () {
|
|
|
700
706
|
return ChannelState;
|
|
701
707
|
}();
|
|
702
708
|
|
|
703
|
-
function ownKeys$6(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
709
|
+
function ownKeys$6(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
704
710
|
|
|
705
711
|
function _objectSpread$6(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$6(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$6(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
706
712
|
|
|
@@ -757,7 +763,7 @@ var isValidEventType = function isValidEventType(eventType) {
|
|
|
757
763
|
return IS_VALID_EVENT_MAP_TYPE[eventType] || false;
|
|
758
764
|
};
|
|
759
765
|
|
|
760
|
-
function _createForOfIteratorHelper$3(o, allowArrayLike) { var it
|
|
766
|
+
function _createForOfIteratorHelper$3(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$3(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function (_e) { function e(_x) { return _e.apply(this, arguments); } e.toString = function () { return _e.toString(); }; return e; }(function (e) { throw e; }), f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function (_e2) { function e(_x2) { return _e2.apply(this, arguments); } e.toString = function () { return _e2.toString(); }; return e; }(function (e) { didErr = true; err = e; }), f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
761
767
|
|
|
762
768
|
function _unsupportedIterableToArray$3(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$3(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$3(o, minLen); }
|
|
763
769
|
|
|
@@ -803,6 +809,10 @@ function isFileWebAPI(uri) {
|
|
|
803
809
|
return typeof window !== 'undefined' && 'File' in window && uri instanceof File;
|
|
804
810
|
}
|
|
805
811
|
|
|
812
|
+
function isBlobWebAPI(uri) {
|
|
813
|
+
return typeof window !== 'undefined' && 'Blob' in window && uri instanceof Blob;
|
|
814
|
+
}
|
|
815
|
+
|
|
806
816
|
function isOwnUser(user) {
|
|
807
817
|
return (user === null || user === void 0 ? void 0 : user.total_unread_count) !== undefined;
|
|
808
818
|
}
|
|
@@ -822,7 +832,7 @@ function isOwnUserBaseProperty(property) {
|
|
|
822
832
|
function addFileToFormData(uri, name, contentType) {
|
|
823
833
|
var data = new FormData();
|
|
824
834
|
|
|
825
|
-
if (isReadableStream(uri) || isBuffer(uri) || isFileWebAPI(uri)) {
|
|
835
|
+
if (isReadableStream(uri) || isBuffer(uri) || isFileWebAPI(uri) || isBlobWebAPI(uri)) {
|
|
826
836
|
if (name) data.append('file', uri, name);else data.append('file', uri);
|
|
827
837
|
} else {
|
|
828
838
|
data.append('file', {
|
|
@@ -983,13 +993,13 @@ function removeConnectionEventListeners(cb) {
|
|
|
983
993
|
}
|
|
984
994
|
}
|
|
985
995
|
|
|
986
|
-
function _createForOfIteratorHelper$2(o, allowArrayLike) { var it
|
|
996
|
+
function _createForOfIteratorHelper$2(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$2(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
987
997
|
|
|
988
998
|
function _unsupportedIterableToArray$2(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$2(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$2(o, minLen); }
|
|
989
999
|
|
|
990
1000
|
function _arrayLikeToArray$2(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
991
1001
|
|
|
992
|
-
function ownKeys$5(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
1002
|
+
function ownKeys$5(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
993
1003
|
|
|
994
1004
|
function _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$5(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$5(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
995
1005
|
|
|
@@ -2574,6 +2584,50 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2574
2584
|
|
|
2575
2585
|
return getReplies;
|
|
2576
2586
|
}()
|
|
2587
|
+
/**
|
|
2588
|
+
* getPinnedMessages - List list pinned messages of the channel
|
|
2589
|
+
*
|
|
2590
|
+
* @param {PinnedMessagePaginationOptions & { user?: UserResponse<UserType>; user_id?: string }} options Pagination params, ie {limit:10, id_lte: 10}
|
|
2591
|
+
* @param {PinnedMessagesSort} sort defines sorting direction of pinned messages
|
|
2592
|
+
*
|
|
2593
|
+
* @return {Promise<GetRepliesAPIResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>} A response with a list of messages
|
|
2594
|
+
*/
|
|
2595
|
+
|
|
2596
|
+
}, {
|
|
2597
|
+
key: "getPinnedMessages",
|
|
2598
|
+
value: function () {
|
|
2599
|
+
var _getPinnedMessages = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30(options) {
|
|
2600
|
+
var sort,
|
|
2601
|
+
_args30 = arguments;
|
|
2602
|
+
return _regeneratorRuntime.wrap(function _callee30$(_context30) {
|
|
2603
|
+
while (1) {
|
|
2604
|
+
switch (_context30.prev = _context30.next) {
|
|
2605
|
+
case 0:
|
|
2606
|
+
sort = _args30.length > 1 && _args30[1] !== undefined ? _args30[1] : [];
|
|
2607
|
+
_context30.next = 3;
|
|
2608
|
+
return this.getClient().get(this.getClient().baseURL + "/channels/".concat(this.type, "/").concat(this.id, "/pinned_messages"), {
|
|
2609
|
+
payload: _objectSpread$5(_objectSpread$5({}, options), {}, {
|
|
2610
|
+
sort: normalizeQuerySort(sort)
|
|
2611
|
+
})
|
|
2612
|
+
});
|
|
2613
|
+
|
|
2614
|
+
case 3:
|
|
2615
|
+
return _context30.abrupt("return", _context30.sent);
|
|
2616
|
+
|
|
2617
|
+
case 4:
|
|
2618
|
+
case "end":
|
|
2619
|
+
return _context30.stop();
|
|
2620
|
+
}
|
|
2621
|
+
}
|
|
2622
|
+
}, _callee30, this);
|
|
2623
|
+
}));
|
|
2624
|
+
|
|
2625
|
+
function getPinnedMessages(_x29) {
|
|
2626
|
+
return _getPinnedMessages.apply(this, arguments);
|
|
2627
|
+
}
|
|
2628
|
+
|
|
2629
|
+
return getPinnedMessages;
|
|
2630
|
+
}()
|
|
2577
2631
|
/**
|
|
2578
2632
|
* getReactions - List the reactions, supports pagination
|
|
2579
2633
|
*
|
|
@@ -2701,13 +2755,13 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2701
2755
|
* @return {Promise<ChannelAPIResponse<AttachmentType, ChannelType, CommandType, MessageType, ReactionType, UserType>>} Returns a query response
|
|
2702
2756
|
*/
|
|
2703
2757
|
function () {
|
|
2704
|
-
var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
2758
|
+
var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31(options) {
|
|
2705
2759
|
var queryURL, state, membersStr, tempChannelCid;
|
|
2706
|
-
return _regeneratorRuntime.wrap(function
|
|
2760
|
+
return _regeneratorRuntime.wrap(function _callee31$(_context31) {
|
|
2707
2761
|
while (1) {
|
|
2708
|
-
switch (
|
|
2762
|
+
switch (_context31.prev = _context31.next) {
|
|
2709
2763
|
case 0:
|
|
2710
|
-
|
|
2764
|
+
_context31.next = 2;
|
|
2711
2765
|
return this.getClient().wsPromise;
|
|
2712
2766
|
|
|
2713
2767
|
case 2:
|
|
@@ -2717,14 +2771,14 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2717
2771
|
queryURL += "/".concat(this.id);
|
|
2718
2772
|
}
|
|
2719
2773
|
|
|
2720
|
-
|
|
2774
|
+
_context31.next = 6;
|
|
2721
2775
|
return this.getClient().post(queryURL + '/query', _objectSpread$5({
|
|
2722
2776
|
data: this._data,
|
|
2723
2777
|
state: true
|
|
2724
2778
|
}, options));
|
|
2725
2779
|
|
|
2726
2780
|
case 6:
|
|
2727
|
-
state =
|
|
2781
|
+
state = _context31.sent;
|
|
2728
2782
|
|
|
2729
2783
|
// update the channel id if it was missing
|
|
2730
2784
|
if (!this.id) {
|
|
@@ -2754,17 +2808,17 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2754
2808
|
|
|
2755
2809
|
this._initializeState(state);
|
|
2756
2810
|
|
|
2757
|
-
return
|
|
2811
|
+
return _context31.abrupt("return", state);
|
|
2758
2812
|
|
|
2759
2813
|
case 11:
|
|
2760
2814
|
case "end":
|
|
2761
|
-
return
|
|
2815
|
+
return _context31.stop();
|
|
2762
2816
|
}
|
|
2763
2817
|
}
|
|
2764
|
-
},
|
|
2818
|
+
}, _callee31, this);
|
|
2765
2819
|
}));
|
|
2766
2820
|
|
|
2767
|
-
function query(
|
|
2821
|
+
function query(_x30) {
|
|
2768
2822
|
return _query.apply(this, arguments);
|
|
2769
2823
|
}
|
|
2770
2824
|
|
|
@@ -2781,31 +2835,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2781
2835
|
}, {
|
|
2782
2836
|
key: "banUser",
|
|
2783
2837
|
value: function () {
|
|
2784
|
-
var _banUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
2785
|
-
return _regeneratorRuntime.wrap(function
|
|
2838
|
+
var _banUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee32(targetUserID, options) {
|
|
2839
|
+
return _regeneratorRuntime.wrap(function _callee32$(_context32) {
|
|
2786
2840
|
while (1) {
|
|
2787
|
-
switch (
|
|
2841
|
+
switch (_context32.prev = _context32.next) {
|
|
2788
2842
|
case 0:
|
|
2789
2843
|
this._checkInitialized();
|
|
2790
2844
|
|
|
2791
|
-
|
|
2845
|
+
_context32.next = 3;
|
|
2792
2846
|
return this.getClient().banUser(targetUserID, _objectSpread$5(_objectSpread$5({}, options), {}, {
|
|
2793
2847
|
type: this.type,
|
|
2794
2848
|
id: this.id
|
|
2795
2849
|
}));
|
|
2796
2850
|
|
|
2797
2851
|
case 3:
|
|
2798
|
-
return
|
|
2852
|
+
return _context32.abrupt("return", _context32.sent);
|
|
2799
2853
|
|
|
2800
2854
|
case 4:
|
|
2801
2855
|
case "end":
|
|
2802
|
-
return
|
|
2856
|
+
return _context32.stop();
|
|
2803
2857
|
}
|
|
2804
2858
|
}
|
|
2805
|
-
},
|
|
2859
|
+
}, _callee32, this);
|
|
2806
2860
|
}));
|
|
2807
2861
|
|
|
2808
|
-
function banUser(
|
|
2862
|
+
function banUser(_x31, _x32) {
|
|
2809
2863
|
return _banUser.apply(this, arguments);
|
|
2810
2864
|
}
|
|
2811
2865
|
|
|
@@ -2823,34 +2877,34 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2823
2877
|
}, {
|
|
2824
2878
|
key: "hide",
|
|
2825
2879
|
value: function () {
|
|
2826
|
-
var _hide = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
2880
|
+
var _hide = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee33() {
|
|
2827
2881
|
var userId,
|
|
2828
2882
|
clearHistory,
|
|
2829
|
-
|
|
2830
|
-
return _regeneratorRuntime.wrap(function
|
|
2883
|
+
_args33 = arguments;
|
|
2884
|
+
return _regeneratorRuntime.wrap(function _callee33$(_context33) {
|
|
2831
2885
|
while (1) {
|
|
2832
|
-
switch (
|
|
2886
|
+
switch (_context33.prev = _context33.next) {
|
|
2833
2887
|
case 0:
|
|
2834
|
-
userId =
|
|
2835
|
-
clearHistory =
|
|
2888
|
+
userId = _args33.length > 0 && _args33[0] !== undefined ? _args33[0] : null;
|
|
2889
|
+
clearHistory = _args33.length > 1 && _args33[1] !== undefined ? _args33[1] : false;
|
|
2836
2890
|
|
|
2837
2891
|
this._checkInitialized();
|
|
2838
2892
|
|
|
2839
|
-
|
|
2893
|
+
_context33.next = 5;
|
|
2840
2894
|
return this.getClient().post("".concat(this._channelURL(), "/hide"), {
|
|
2841
2895
|
user_id: userId,
|
|
2842
2896
|
clear_history: clearHistory
|
|
2843
2897
|
});
|
|
2844
2898
|
|
|
2845
2899
|
case 5:
|
|
2846
|
-
return
|
|
2900
|
+
return _context33.abrupt("return", _context33.sent);
|
|
2847
2901
|
|
|
2848
2902
|
case 6:
|
|
2849
2903
|
case "end":
|
|
2850
|
-
return
|
|
2904
|
+
return _context33.stop();
|
|
2851
2905
|
}
|
|
2852
2906
|
}
|
|
2853
|
-
},
|
|
2907
|
+
}, _callee33, this);
|
|
2854
2908
|
}));
|
|
2855
2909
|
|
|
2856
2910
|
function hide() {
|
|
@@ -2869,31 +2923,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2869
2923
|
}, {
|
|
2870
2924
|
key: "show",
|
|
2871
2925
|
value: function () {
|
|
2872
|
-
var _show = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
2926
|
+
var _show = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee34() {
|
|
2873
2927
|
var userId,
|
|
2874
|
-
|
|
2875
|
-
return _regeneratorRuntime.wrap(function
|
|
2928
|
+
_args34 = arguments;
|
|
2929
|
+
return _regeneratorRuntime.wrap(function _callee34$(_context34) {
|
|
2876
2930
|
while (1) {
|
|
2877
|
-
switch (
|
|
2931
|
+
switch (_context34.prev = _context34.next) {
|
|
2878
2932
|
case 0:
|
|
2879
|
-
userId =
|
|
2933
|
+
userId = _args34.length > 0 && _args34[0] !== undefined ? _args34[0] : null;
|
|
2880
2934
|
|
|
2881
2935
|
this._checkInitialized();
|
|
2882
2936
|
|
|
2883
|
-
|
|
2937
|
+
_context34.next = 4;
|
|
2884
2938
|
return this.getClient().post("".concat(this._channelURL(), "/show"), {
|
|
2885
2939
|
user_id: userId
|
|
2886
2940
|
});
|
|
2887
2941
|
|
|
2888
2942
|
case 4:
|
|
2889
|
-
return
|
|
2943
|
+
return _context34.abrupt("return", _context34.sent);
|
|
2890
2944
|
|
|
2891
2945
|
case 5:
|
|
2892
2946
|
case "end":
|
|
2893
|
-
return
|
|
2947
|
+
return _context34.stop();
|
|
2894
2948
|
}
|
|
2895
2949
|
}
|
|
2896
|
-
},
|
|
2950
|
+
}, _callee34, this);
|
|
2897
2951
|
}));
|
|
2898
2952
|
|
|
2899
2953
|
function show() {
|
|
@@ -2912,31 +2966,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2912
2966
|
}, {
|
|
2913
2967
|
key: "unbanUser",
|
|
2914
2968
|
value: function () {
|
|
2915
|
-
var _unbanUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
2916
|
-
return _regeneratorRuntime.wrap(function
|
|
2969
|
+
var _unbanUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee35(targetUserID) {
|
|
2970
|
+
return _regeneratorRuntime.wrap(function _callee35$(_context35) {
|
|
2917
2971
|
while (1) {
|
|
2918
|
-
switch (
|
|
2972
|
+
switch (_context35.prev = _context35.next) {
|
|
2919
2973
|
case 0:
|
|
2920
2974
|
this._checkInitialized();
|
|
2921
2975
|
|
|
2922
|
-
|
|
2976
|
+
_context35.next = 3;
|
|
2923
2977
|
return this.getClient().unbanUser(targetUserID, {
|
|
2924
2978
|
type: this.type,
|
|
2925
2979
|
id: this.id
|
|
2926
2980
|
});
|
|
2927
2981
|
|
|
2928
2982
|
case 3:
|
|
2929
|
-
return
|
|
2983
|
+
return _context35.abrupt("return", _context35.sent);
|
|
2930
2984
|
|
|
2931
2985
|
case 4:
|
|
2932
2986
|
case "end":
|
|
2933
|
-
return
|
|
2987
|
+
return _context35.stop();
|
|
2934
2988
|
}
|
|
2935
2989
|
}
|
|
2936
|
-
},
|
|
2990
|
+
}, _callee35, this);
|
|
2937
2991
|
}));
|
|
2938
2992
|
|
|
2939
|
-
function unbanUser(
|
|
2993
|
+
function unbanUser(_x33) {
|
|
2940
2994
|
return _unbanUser.apply(this, arguments);
|
|
2941
2995
|
}
|
|
2942
2996
|
|
|
@@ -2953,31 +3007,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2953
3007
|
}, {
|
|
2954
3008
|
key: "shadowBan",
|
|
2955
3009
|
value: function () {
|
|
2956
|
-
var _shadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
2957
|
-
return _regeneratorRuntime.wrap(function
|
|
3010
|
+
var _shadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee36(targetUserID, options) {
|
|
3011
|
+
return _regeneratorRuntime.wrap(function _callee36$(_context36) {
|
|
2958
3012
|
while (1) {
|
|
2959
|
-
switch (
|
|
3013
|
+
switch (_context36.prev = _context36.next) {
|
|
2960
3014
|
case 0:
|
|
2961
3015
|
this._checkInitialized();
|
|
2962
3016
|
|
|
2963
|
-
|
|
3017
|
+
_context36.next = 3;
|
|
2964
3018
|
return this.getClient().shadowBan(targetUserID, _objectSpread$5(_objectSpread$5({}, options), {}, {
|
|
2965
3019
|
type: this.type,
|
|
2966
3020
|
id: this.id
|
|
2967
3021
|
}));
|
|
2968
3022
|
|
|
2969
3023
|
case 3:
|
|
2970
|
-
return
|
|
3024
|
+
return _context36.abrupt("return", _context36.sent);
|
|
2971
3025
|
|
|
2972
3026
|
case 4:
|
|
2973
3027
|
case "end":
|
|
2974
|
-
return
|
|
3028
|
+
return _context36.stop();
|
|
2975
3029
|
}
|
|
2976
3030
|
}
|
|
2977
|
-
},
|
|
3031
|
+
}, _callee36, this);
|
|
2978
3032
|
}));
|
|
2979
3033
|
|
|
2980
|
-
function shadowBan(
|
|
3034
|
+
function shadowBan(_x34, _x35) {
|
|
2981
3035
|
return _shadowBan.apply(this, arguments);
|
|
2982
3036
|
}
|
|
2983
3037
|
|
|
@@ -2993,31 +3047,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2993
3047
|
}, {
|
|
2994
3048
|
key: "removeShadowBan",
|
|
2995
3049
|
value: function () {
|
|
2996
|
-
var _removeShadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
2997
|
-
return _regeneratorRuntime.wrap(function
|
|
3050
|
+
var _removeShadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee37(targetUserID) {
|
|
3051
|
+
return _regeneratorRuntime.wrap(function _callee37$(_context37) {
|
|
2998
3052
|
while (1) {
|
|
2999
|
-
switch (
|
|
3053
|
+
switch (_context37.prev = _context37.next) {
|
|
3000
3054
|
case 0:
|
|
3001
3055
|
this._checkInitialized();
|
|
3002
3056
|
|
|
3003
|
-
|
|
3057
|
+
_context37.next = 3;
|
|
3004
3058
|
return this.getClient().removeShadowBan(targetUserID, {
|
|
3005
3059
|
type: this.type,
|
|
3006
3060
|
id: this.id
|
|
3007
3061
|
});
|
|
3008
3062
|
|
|
3009
3063
|
case 3:
|
|
3010
|
-
return
|
|
3064
|
+
return _context37.abrupt("return", _context37.sent);
|
|
3011
3065
|
|
|
3012
3066
|
case 4:
|
|
3013
3067
|
case "end":
|
|
3014
|
-
return
|
|
3068
|
+
return _context37.stop();
|
|
3015
3069
|
}
|
|
3016
3070
|
}
|
|
3017
|
-
},
|
|
3071
|
+
}, _callee37, this);
|
|
3018
3072
|
}));
|
|
3019
3073
|
|
|
3020
|
-
function removeShadowBan(
|
|
3074
|
+
function removeShadowBan(_x36) {
|
|
3021
3075
|
return _removeShadowBan.apply(this, arguments);
|
|
3022
3076
|
}
|
|
3023
3077
|
|
|
@@ -3239,7 +3293,12 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3239
3293
|
|
|
3240
3294
|
case 'channel.updated':
|
|
3241
3295
|
if (event.channel) {
|
|
3242
|
-
channel
|
|
3296
|
+
var _event$channel$hidden, _event$channel, _channel$data, _event$channel$own_ca, _event$channel2, _channel$data2;
|
|
3297
|
+
|
|
3298
|
+
channel.data = _objectSpread$5(_objectSpread$5({}, event.channel), {}, {
|
|
3299
|
+
hidden: (_event$channel$hidden = (_event$channel = event.channel) === null || _event$channel === void 0 ? void 0 : _event$channel.hidden) !== null && _event$channel$hidden !== void 0 ? _event$channel$hidden : (_channel$data = channel.data) === null || _channel$data === void 0 ? void 0 : _channel$data.hidden,
|
|
3300
|
+
own_capabilities: (_event$channel$own_ca = (_event$channel2 = event.channel) === null || _event$channel2 === void 0 ? void 0 : _event$channel2.own_capabilities) !== null && _event$channel$own_ca !== void 0 ? _event$channel$own_ca : (_channel$data2 = channel.data) === null || _channel$data2 === void 0 ? void 0 : _channel$data2.own_capabilities
|
|
3301
|
+
});
|
|
3243
3302
|
}
|
|
3244
3303
|
|
|
3245
3304
|
break;
|
|
@@ -3426,7 +3485,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3426
3485
|
return Channel;
|
|
3427
3486
|
}();
|
|
3428
3487
|
|
|
3429
|
-
function _createForOfIteratorHelper$1(o, allowArrayLike) { var it
|
|
3488
|
+
function _createForOfIteratorHelper$1(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$1(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
3430
3489
|
|
|
3431
3490
|
function _unsupportedIterableToArray$1(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$1(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen); }
|
|
3432
3491
|
|
|
@@ -3501,7 +3560,7 @@ var ClientState = /*#__PURE__*/function () {
|
|
|
3501
3560
|
return ClientState;
|
|
3502
3561
|
}();
|
|
3503
3562
|
|
|
3504
|
-
function ownKeys$4(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
3563
|
+
function ownKeys$4(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
3505
3564
|
|
|
3506
3565
|
function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$4(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$4(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
3507
3566
|
var InsightMetrics = function InsightMetrics() {
|
|
@@ -3615,7 +3674,7 @@ function buildWsSuccessAfterFailureInsight(connection) {
|
|
|
3615
3674
|
return buildWsBaseInsight(connection);
|
|
3616
3675
|
}
|
|
3617
3676
|
|
|
3618
|
-
function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
3677
|
+
function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
3619
3678
|
|
|
3620
3679
|
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$3(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
3621
3680
|
|
|
@@ -4537,7 +4596,7 @@ var jwt = null;
|
|
|
4537
4596
|
|
|
4538
4597
|
var crypto$1 = null;
|
|
4539
4598
|
|
|
4540
|
-
function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
4599
|
+
function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
4541
4600
|
|
|
4542
4601
|
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$2(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
4543
4602
|
|
|
@@ -4946,7 +5005,7 @@ function isWSFailure(err) {
|
|
|
4946
5005
|
}
|
|
4947
5006
|
}
|
|
4948
5007
|
|
|
4949
|
-
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
5008
|
+
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
4950
5009
|
|
|
4951
5010
|
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$1(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
4952
5011
|
var ConnectionState;
|
|
@@ -5154,27 +5213,35 @@ var WSConnectionFallback = /*#__PURE__*/function () {
|
|
|
5154
5213
|
reconnect = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : false;
|
|
5155
5214
|
|
|
5156
5215
|
if (!(_this.state === ConnectionState.Connecting)) {
|
|
5157
|
-
_context3.next =
|
|
5216
|
+
_context3.next = 4;
|
|
5158
5217
|
break;
|
|
5159
5218
|
}
|
|
5160
5219
|
|
|
5161
|
-
|
|
5220
|
+
_this._log('connect() - connecting already in progress', {
|
|
5221
|
+
reconnect: reconnect
|
|
5222
|
+
}, 'warn');
|
|
5162
5223
|
|
|
5163
|
-
|
|
5224
|
+
return _context3.abrupt("return");
|
|
5225
|
+
|
|
5226
|
+
case 4:
|
|
5164
5227
|
if (!(_this.state === ConnectionState.Connected)) {
|
|
5165
|
-
_context3.next =
|
|
5228
|
+
_context3.next = 7;
|
|
5166
5229
|
break;
|
|
5167
5230
|
}
|
|
5168
5231
|
|
|
5169
|
-
|
|
5232
|
+
_this._log('connect() - already connected and polling', {
|
|
5233
|
+
reconnect: reconnect
|
|
5234
|
+
}, 'warn');
|
|
5170
5235
|
|
|
5171
|
-
|
|
5236
|
+
return _context3.abrupt("return");
|
|
5237
|
+
|
|
5238
|
+
case 7:
|
|
5172
5239
|
_this._setState(ConnectionState.Connecting);
|
|
5173
5240
|
|
|
5174
5241
|
_this.connectionID = undefined; // connect should be sent with empty connection_id so API creates one
|
|
5175
5242
|
|
|
5176
|
-
_context3.prev =
|
|
5177
|
-
_context3.next =
|
|
5243
|
+
_context3.prev = 9;
|
|
5244
|
+
_context3.next = 12;
|
|
5178
5245
|
return _this._req({
|
|
5179
5246
|
json: _this.client._buildWSPayload()
|
|
5180
5247
|
}, {
|
|
@@ -5182,7 +5249,7 @@ var WSConnectionFallback = /*#__PURE__*/function () {
|
|
|
5182
5249
|
}, // 8s
|
|
5183
5250
|
reconnect);
|
|
5184
5251
|
|
|
5185
|
-
case
|
|
5252
|
+
case 12:
|
|
5186
5253
|
_yield$_this$_req = _context3.sent;
|
|
5187
5254
|
event = _yield$_this$_req.event;
|
|
5188
5255
|
|
|
@@ -5198,30 +5265,31 @@ var WSConnectionFallback = /*#__PURE__*/function () {
|
|
|
5198
5265
|
|
|
5199
5266
|
return _context3.abrupt("return", event);
|
|
5200
5267
|
|
|
5201
|
-
case
|
|
5202
|
-
_context3.prev =
|
|
5203
|
-
_context3.t0 = _context3["catch"](
|
|
5268
|
+
case 21:
|
|
5269
|
+
_context3.prev = 21;
|
|
5270
|
+
_context3.t0 = _context3["catch"](9);
|
|
5204
5271
|
|
|
5205
5272
|
_this._setState(ConnectionState.Closed);
|
|
5206
5273
|
|
|
5207
5274
|
throw _context3.t0;
|
|
5208
5275
|
|
|
5209
|
-
case
|
|
5276
|
+
case 25:
|
|
5210
5277
|
case "end":
|
|
5211
5278
|
return _context3.stop();
|
|
5212
5279
|
}
|
|
5213
5280
|
}
|
|
5214
|
-
}, _callee3, null, [[
|
|
5281
|
+
}, _callee3, null, [[9, 21]]);
|
|
5215
5282
|
})));
|
|
5216
5283
|
|
|
5217
5284
|
_defineProperty(this, "isHealthy", function () {
|
|
5218
|
-
return _this.connectionID && _this.state === ConnectionState.Connected;
|
|
5285
|
+
return !!_this.connectionID && _this.state === ConnectionState.Connected;
|
|
5219
5286
|
});
|
|
5220
5287
|
|
|
5221
5288
|
_defineProperty(this, "disconnect", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
5222
5289
|
var _this$cancelToken3;
|
|
5223
5290
|
|
|
5224
5291
|
var timeout,
|
|
5292
|
+
connection_id,
|
|
5225
5293
|
_args4 = arguments;
|
|
5226
5294
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
5227
5295
|
while (1) {
|
|
@@ -5234,36 +5302,37 @@ var WSConnectionFallback = /*#__PURE__*/function () {
|
|
|
5234
5302
|
|
|
5235
5303
|
(_this$cancelToken3 = _this.cancelToken) === null || _this$cancelToken3 === void 0 ? void 0 : _this$cancelToken3.cancel('disconnect() is called');
|
|
5236
5304
|
_this.cancelToken = undefined;
|
|
5237
|
-
|
|
5238
|
-
|
|
5305
|
+
connection_id = _this.connectionID;
|
|
5306
|
+
_this.connectionID = undefined;
|
|
5307
|
+
_context4.prev = 7;
|
|
5308
|
+
_context4.next = 10;
|
|
5239
5309
|
return _this._req({
|
|
5240
|
-
close: true
|
|
5310
|
+
close: true,
|
|
5311
|
+
connection_id: connection_id
|
|
5241
5312
|
}, {
|
|
5242
5313
|
timeout: timeout
|
|
5243
5314
|
}, false);
|
|
5244
5315
|
|
|
5245
|
-
case
|
|
5246
|
-
_this.connectionID = undefined;
|
|
5247
|
-
|
|
5316
|
+
case 10:
|
|
5248
5317
|
_this._log("disconnect() - Closed connectionID");
|
|
5249
5318
|
|
|
5250
|
-
_context4.next =
|
|
5319
|
+
_context4.next = 16;
|
|
5251
5320
|
break;
|
|
5252
5321
|
|
|
5253
|
-
case
|
|
5254
|
-
_context4.prev =
|
|
5255
|
-
_context4.t0 = _context4["catch"](
|
|
5322
|
+
case 13:
|
|
5323
|
+
_context4.prev = 13;
|
|
5324
|
+
_context4.t0 = _context4["catch"](7);
|
|
5256
5325
|
|
|
5257
5326
|
_this._log("disconnect() - Failed", {
|
|
5258
5327
|
err: _context4.t0
|
|
5259
5328
|
}, 'error');
|
|
5260
5329
|
|
|
5261
|
-
case
|
|
5330
|
+
case 16:
|
|
5262
5331
|
case "end":
|
|
5263
5332
|
return _context4.stop();
|
|
5264
5333
|
}
|
|
5265
5334
|
}
|
|
5266
|
-
}, _callee4, null, [[
|
|
5335
|
+
}, _callee4, null, [[7, 13]]);
|
|
5267
5336
|
})));
|
|
5268
5337
|
|
|
5269
5338
|
this.client = client;
|
|
@@ -5312,13 +5381,15 @@ var WSConnectionFallback = /*#__PURE__*/function () {
|
|
|
5312
5381
|
return WSConnectionFallback;
|
|
5313
5382
|
}();
|
|
5314
5383
|
|
|
5315
|
-
|
|
5384
|
+
var _excluded = ["created_at", "updated_at", "last_active", "online"];
|
|
5385
|
+
|
|
5386
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
5316
5387
|
|
|
5317
5388
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
5318
5389
|
|
|
5319
5390
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
5320
5391
|
|
|
5321
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
5392
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
5322
5393
|
|
|
5323
5394
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
5324
5395
|
|
|
@@ -6623,7 +6694,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6623
6694
|
case 11:
|
|
6624
6695
|
this.anonymous = false; // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6625
6696
|
|
|
6626
|
-
_response$user = response.user, _response$user.created_at, _response$user.updated_at, _response$user.last_active, _response$user.online, guestUser = _objectWithoutProperties(_response$user,
|
|
6697
|
+
_response$user = response.user, _response$user.created_at, _response$user.updated_at, _response$user.last_active, _response$user.online, guestUser = _objectWithoutProperties(_response$user, _excluded);
|
|
6627
6698
|
_context14.next = 15;
|
|
6628
6699
|
return this.connectUser(guestUser, response.access_token);
|
|
6629
6700
|
|
|
@@ -6986,23 +7057,41 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6986
7057
|
client: this
|
|
6987
7058
|
});
|
|
6988
7059
|
_context15.prev = 8;
|
|
6989
|
-
|
|
7060
|
+
|
|
7061
|
+
if (!this.wsFallback) {
|
|
7062
|
+
_context15.next = 13;
|
|
7063
|
+
break;
|
|
7064
|
+
}
|
|
7065
|
+
|
|
7066
|
+
_context15.next = 12;
|
|
7067
|
+
return this.wsFallback.connect();
|
|
7068
|
+
|
|
7069
|
+
case 12:
|
|
7070
|
+
return _context15.abrupt("return", _context15.sent);
|
|
7071
|
+
|
|
7072
|
+
case 13:
|
|
7073
|
+
_context15.next = 15;
|
|
6990
7074
|
return this.wsConnection.connect(this.options.enableWSFallback ? this.defaultWSTimeoutWithFallback : this.defaultWSTimeout);
|
|
6991
7075
|
|
|
6992
|
-
case
|
|
7076
|
+
case 15:
|
|
6993
7077
|
return _context15.abrupt("return", _context15.sent);
|
|
6994
7078
|
|
|
6995
|
-
case
|
|
6996
|
-
_context15.prev =
|
|
7079
|
+
case 18:
|
|
7080
|
+
_context15.prev = 18;
|
|
6997
7081
|
_context15.t0 = _context15["catch"](8);
|
|
6998
7082
|
|
|
6999
7083
|
if (!(this.options.enableWSFallback && isWSFailure(_context15.t0) && isOnline())) {
|
|
7000
|
-
_context15.next =
|
|
7084
|
+
_context15.next = 29;
|
|
7001
7085
|
break;
|
|
7002
7086
|
}
|
|
7003
7087
|
|
|
7004
7088
|
this.logger('info', 'client:connect() - WS failed, fallback to longpoll', {
|
|
7005
7089
|
tags: ['connection', 'client']
|
|
7090
|
+
}); // @ts-expect-error
|
|
7091
|
+
|
|
7092
|
+
this.dispatchEvent({
|
|
7093
|
+
type: 'transport.changed',
|
|
7094
|
+
mode: 'longpoll'
|
|
7006
7095
|
});
|
|
7007
7096
|
|
|
7008
7097
|
this.wsConnection._destroyCurrentWSConnection();
|
|
@@ -7012,21 +7101,21 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7012
7101
|
this.wsFallback = new WSConnectionFallback({
|
|
7013
7102
|
client: this
|
|
7014
7103
|
});
|
|
7015
|
-
_context15.next =
|
|
7104
|
+
_context15.next = 28;
|
|
7016
7105
|
return this.wsFallback.connect();
|
|
7017
7106
|
|
|
7018
|
-
case
|
|
7107
|
+
case 28:
|
|
7019
7108
|
return _context15.abrupt("return", _context15.sent);
|
|
7020
7109
|
|
|
7021
|
-
case
|
|
7110
|
+
case 29:
|
|
7022
7111
|
throw _context15.t0;
|
|
7023
7112
|
|
|
7024
|
-
case
|
|
7113
|
+
case 30:
|
|
7025
7114
|
case "end":
|
|
7026
7115
|
return _context15.stop();
|
|
7027
7116
|
}
|
|
7028
7117
|
}
|
|
7029
|
-
}, _callee15, this, [[8,
|
|
7118
|
+
}, _callee15, this, [[8, 18]]);
|
|
7030
7119
|
}));
|
|
7031
7120
|
|
|
7032
7121
|
function connect() {
|
|
@@ -8433,6 +8522,101 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8433
8522
|
|
|
8434
8523
|
return unflagUser;
|
|
8435
8524
|
}()
|
|
8525
|
+
/**
|
|
8526
|
+
* _queryFlagReports - Query flag reports.
|
|
8527
|
+
*
|
|
8528
|
+
* Note: Do not use this.
|
|
8529
|
+
* It is present for internal usage only.
|
|
8530
|
+
* This function can, and will, break and/or be removed at any point in time.
|
|
8531
|
+
*
|
|
8532
|
+
* @param {FlagReportsFilters} filterConditions MongoDB style filter conditions
|
|
8533
|
+
* @param {FlagReportsPaginationOptions} options Option object, {limit: 10, offset:0}
|
|
8534
|
+
*
|
|
8535
|
+
* @return {Promise<FlagReportsResponse<ChannelType, CommandType, UserType>>} Flag Reports Response
|
|
8536
|
+
*/
|
|
8537
|
+
|
|
8538
|
+
}, {
|
|
8539
|
+
key: "_queryFlagReports",
|
|
8540
|
+
value: function () {
|
|
8541
|
+
var _queryFlagReports2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42() {
|
|
8542
|
+
var filterConditions,
|
|
8543
|
+
options,
|
|
8544
|
+
_args42 = arguments;
|
|
8545
|
+
return _regeneratorRuntime.wrap(function _callee42$(_context42) {
|
|
8546
|
+
while (1) {
|
|
8547
|
+
switch (_context42.prev = _context42.next) {
|
|
8548
|
+
case 0:
|
|
8549
|
+
filterConditions = _args42.length > 0 && _args42[0] !== undefined ? _args42[0] : {};
|
|
8550
|
+
options = _args42.length > 1 && _args42[1] !== undefined ? _args42[1] : {};
|
|
8551
|
+
_context42.next = 4;
|
|
8552
|
+
return this.post(this.baseURL + '/moderation/reports', _objectSpread({
|
|
8553
|
+
filter_conditions: filterConditions
|
|
8554
|
+
}, options));
|
|
8555
|
+
|
|
8556
|
+
case 4:
|
|
8557
|
+
return _context42.abrupt("return", _context42.sent);
|
|
8558
|
+
|
|
8559
|
+
case 5:
|
|
8560
|
+
case "end":
|
|
8561
|
+
return _context42.stop();
|
|
8562
|
+
}
|
|
8563
|
+
}
|
|
8564
|
+
}, _callee42, this);
|
|
8565
|
+
}));
|
|
8566
|
+
|
|
8567
|
+
function _queryFlagReports() {
|
|
8568
|
+
return _queryFlagReports2.apply(this, arguments);
|
|
8569
|
+
}
|
|
8570
|
+
|
|
8571
|
+
return _queryFlagReports;
|
|
8572
|
+
}()
|
|
8573
|
+
/**
|
|
8574
|
+
* _reviewFlagReport - review flag report
|
|
8575
|
+
*
|
|
8576
|
+
* Note: Do not use this.
|
|
8577
|
+
* It is present for internal usage only.
|
|
8578
|
+
* This function can, and will, break and/or be removed at any point in time.
|
|
8579
|
+
*
|
|
8580
|
+
* @param {string} [id] flag report to review
|
|
8581
|
+
* @param {string} [reviewResult] flag report review result
|
|
8582
|
+
* @param {string} [options.user_id] currentUserID, only used with serverside auth
|
|
8583
|
+
* @param {string} [options.review_details] custom information about review result
|
|
8584
|
+
* @returns {Promise<ReviewFlagReportResponse>>}
|
|
8585
|
+
*/
|
|
8586
|
+
|
|
8587
|
+
}, {
|
|
8588
|
+
key: "_reviewFlagReport",
|
|
8589
|
+
value: function () {
|
|
8590
|
+
var _reviewFlagReport2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee43(id, reviewResult) {
|
|
8591
|
+
var options,
|
|
8592
|
+
_args43 = arguments;
|
|
8593
|
+
return _regeneratorRuntime.wrap(function _callee43$(_context43) {
|
|
8594
|
+
while (1) {
|
|
8595
|
+
switch (_context43.prev = _context43.next) {
|
|
8596
|
+
case 0:
|
|
8597
|
+
options = _args43.length > 2 && _args43[2] !== undefined ? _args43[2] : {};
|
|
8598
|
+
_context43.next = 3;
|
|
8599
|
+
return this.patch(this.baseURL + "/moderation/reports/".concat(id), _objectSpread({
|
|
8600
|
+
review_result: reviewResult
|
|
8601
|
+
}, options));
|
|
8602
|
+
|
|
8603
|
+
case 3:
|
|
8604
|
+
return _context43.abrupt("return", _context43.sent);
|
|
8605
|
+
|
|
8606
|
+
case 4:
|
|
8607
|
+
case "end":
|
|
8608
|
+
return _context43.stop();
|
|
8609
|
+
}
|
|
8610
|
+
}
|
|
8611
|
+
}, _callee43, this);
|
|
8612
|
+
}));
|
|
8613
|
+
|
|
8614
|
+
function _reviewFlagReport(_x54, _x55) {
|
|
8615
|
+
return _reviewFlagReport2.apply(this, arguments);
|
|
8616
|
+
}
|
|
8617
|
+
|
|
8618
|
+
return _reviewFlagReport;
|
|
8619
|
+
}()
|
|
8436
8620
|
/**
|
|
8437
8621
|
* @deprecated use markChannelsRead instead
|
|
8438
8622
|
*
|
|
@@ -8454,23 +8638,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8454
8638
|
* @return {Promise<APIResponse>}
|
|
8455
8639
|
*/
|
|
8456
8640
|
function () {
|
|
8457
|
-
var _markChannelsRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8641
|
+
var _markChannelsRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44() {
|
|
8458
8642
|
var data,
|
|
8459
|
-
|
|
8460
|
-
return _regeneratorRuntime.wrap(function
|
|
8643
|
+
_args44 = arguments;
|
|
8644
|
+
return _regeneratorRuntime.wrap(function _callee44$(_context44) {
|
|
8461
8645
|
while (1) {
|
|
8462
|
-
switch (
|
|
8646
|
+
switch (_context44.prev = _context44.next) {
|
|
8463
8647
|
case 0:
|
|
8464
|
-
data =
|
|
8465
|
-
|
|
8648
|
+
data = _args44.length > 0 && _args44[0] !== undefined ? _args44[0] : {};
|
|
8649
|
+
_context44.next = 3;
|
|
8466
8650
|
return this.post(this.baseURL + '/channels/read', _objectSpread({}, data));
|
|
8467
8651
|
|
|
8468
8652
|
case 3:
|
|
8469
8653
|
case "end":
|
|
8470
|
-
return
|
|
8654
|
+
return _context44.stop();
|
|
8471
8655
|
}
|
|
8472
8656
|
}
|
|
8473
|
-
},
|
|
8657
|
+
}, _callee44, this);
|
|
8474
8658
|
}));
|
|
8475
8659
|
|
|
8476
8660
|
function markChannelsRead() {
|
|
@@ -8545,28 +8729,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8545
8729
|
}, {
|
|
8546
8730
|
key: "translateMessage",
|
|
8547
8731
|
value: function () {
|
|
8548
|
-
var _translateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8549
|
-
return _regeneratorRuntime.wrap(function
|
|
8732
|
+
var _translateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45(messageId, language) {
|
|
8733
|
+
return _regeneratorRuntime.wrap(function _callee45$(_context45) {
|
|
8550
8734
|
while (1) {
|
|
8551
|
-
switch (
|
|
8735
|
+
switch (_context45.prev = _context45.next) {
|
|
8552
8736
|
case 0:
|
|
8553
|
-
|
|
8737
|
+
_context45.next = 2;
|
|
8554
8738
|
return this.post(this.baseURL + "/messages/".concat(messageId, "/translate"), {
|
|
8555
8739
|
language: language
|
|
8556
8740
|
});
|
|
8557
8741
|
|
|
8558
8742
|
case 2:
|
|
8559
|
-
return
|
|
8743
|
+
return _context45.abrupt("return", _context45.sent);
|
|
8560
8744
|
|
|
8561
8745
|
case 3:
|
|
8562
8746
|
case "end":
|
|
8563
|
-
return
|
|
8747
|
+
return _context45.stop();
|
|
8564
8748
|
}
|
|
8565
8749
|
}
|
|
8566
|
-
},
|
|
8750
|
+
}, _callee45, this);
|
|
8567
8751
|
}));
|
|
8568
8752
|
|
|
8569
|
-
function translateMessage(
|
|
8753
|
+
function translateMessage(_x56, _x57) {
|
|
8570
8754
|
return _translateMessage.apply(this, arguments);
|
|
8571
8755
|
}
|
|
8572
8756
|
|
|
@@ -8580,7 +8764,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8580
8764
|
}, {
|
|
8581
8765
|
key: "_normalizeExpiration",
|
|
8582
8766
|
value: function _normalizeExpiration(timeoutOrExpirationDate) {
|
|
8583
|
-
var pinExpires;
|
|
8767
|
+
var pinExpires = null;
|
|
8584
8768
|
|
|
8585
8769
|
if (typeof timeoutOrExpirationDate === 'number') {
|
|
8586
8770
|
var now = new Date();
|
|
@@ -8621,20 +8805,22 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8621
8805
|
* pinMessage - pins the message
|
|
8622
8806
|
* @param {string | { id: string }} messageOrMessageId message object or message id
|
|
8623
8807
|
* @param {undefined|null|number|string|Date} timeoutOrExpirationDate expiration date or timeout. Use number type to set timeout in seconds, string or Date to set exact expiration date
|
|
8624
|
-
* @param {string | { id: string }} [
|
|
8808
|
+
* @param {undefined|string | { id: string }} [pinnedBy] who will appear as a user who pinned a message. Only for server-side use. Provide `undefined` when pinning message client-side
|
|
8809
|
+
* @param {undefined|number|string|Date} pinnedAt date when message should be pinned. It affects the order of pinned messages. Use negative number to set relative time in the past, string or Date to set exact date of pin
|
|
8625
8810
|
*/
|
|
8626
8811
|
|
|
8627
8812
|
}, {
|
|
8628
8813
|
key: "pinMessage",
|
|
8629
|
-
value: function pinMessage(messageOrMessageId, timeoutOrExpirationDate,
|
|
8814
|
+
value: function pinMessage(messageOrMessageId, timeoutOrExpirationDate, pinnedBy, pinnedAt) {
|
|
8630
8815
|
var messageId = this._validateAndGetMessageId(messageOrMessageId, 'Please specify the message id when calling unpinMessage');
|
|
8631
8816
|
|
|
8632
8817
|
return this.partialUpdateMessage(messageId, {
|
|
8633
8818
|
set: {
|
|
8634
8819
|
pinned: true,
|
|
8635
|
-
pin_expires: this._normalizeExpiration(timeoutOrExpirationDate)
|
|
8820
|
+
pin_expires: this._normalizeExpiration(timeoutOrExpirationDate),
|
|
8821
|
+
pinned_at: this._normalizeExpiration(pinnedAt)
|
|
8636
8822
|
}
|
|
8637
|
-
},
|
|
8823
|
+
}, pinnedBy);
|
|
8638
8824
|
}
|
|
8639
8825
|
/**
|
|
8640
8826
|
* unpinMessage - unpins the message that was previously pinned
|
|
@@ -8666,14 +8852,14 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8666
8852
|
}, {
|
|
8667
8853
|
key: "updateMessage",
|
|
8668
8854
|
value: function () {
|
|
8669
|
-
var _updateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8855
|
+
var _updateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46(message, userId, options) {
|
|
8670
8856
|
var clonedMessage, reservedMessageFields;
|
|
8671
|
-
return _regeneratorRuntime.wrap(function
|
|
8857
|
+
return _regeneratorRuntime.wrap(function _callee46$(_context46) {
|
|
8672
8858
|
while (1) {
|
|
8673
|
-
switch (
|
|
8859
|
+
switch (_context46.prev = _context46.next) {
|
|
8674
8860
|
case 0:
|
|
8675
8861
|
if (message.id) {
|
|
8676
|
-
|
|
8862
|
+
_context46.next = 2;
|
|
8677
8863
|
break;
|
|
8678
8864
|
}
|
|
8679
8865
|
|
|
@@ -8710,23 +8896,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8710
8896
|
});
|
|
8711
8897
|
}
|
|
8712
8898
|
|
|
8713
|
-
|
|
8899
|
+
_context46.next = 10;
|
|
8714
8900
|
return this.post(this.baseURL + "/messages/".concat(message.id), _objectSpread({
|
|
8715
8901
|
message: clonedMessage
|
|
8716
8902
|
}, options));
|
|
8717
8903
|
|
|
8718
8904
|
case 10:
|
|
8719
|
-
return
|
|
8905
|
+
return _context46.abrupt("return", _context46.sent);
|
|
8720
8906
|
|
|
8721
8907
|
case 11:
|
|
8722
8908
|
case "end":
|
|
8723
|
-
return
|
|
8909
|
+
return _context46.stop();
|
|
8724
8910
|
}
|
|
8725
8911
|
}
|
|
8726
|
-
},
|
|
8912
|
+
}, _callee46, this);
|
|
8727
8913
|
}));
|
|
8728
8914
|
|
|
8729
|
-
function updateMessage(
|
|
8915
|
+
function updateMessage(_x58, _x59, _x60) {
|
|
8730
8916
|
return _updateMessage.apply(this, arguments);
|
|
8731
8917
|
}
|
|
8732
8918
|
|
|
@@ -8749,14 +8935,14 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8749
8935
|
}, {
|
|
8750
8936
|
key: "partialUpdateMessage",
|
|
8751
8937
|
value: function () {
|
|
8752
|
-
var _partialUpdateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8938
|
+
var _partialUpdateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee47(id, partialMessageObject, userId, options) {
|
|
8753
8939
|
var user;
|
|
8754
|
-
return _regeneratorRuntime.wrap(function
|
|
8940
|
+
return _regeneratorRuntime.wrap(function _callee47$(_context47) {
|
|
8755
8941
|
while (1) {
|
|
8756
|
-
switch (
|
|
8942
|
+
switch (_context47.prev = _context47.next) {
|
|
8757
8943
|
case 0:
|
|
8758
8944
|
if (id) {
|
|
8759
|
-
|
|
8945
|
+
_context47.next = 2;
|
|
8760
8946
|
break;
|
|
8761
8947
|
}
|
|
8762
8948
|
|
|
@@ -8771,23 +8957,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8771
8957
|
};
|
|
8772
8958
|
}
|
|
8773
8959
|
|
|
8774
|
-
|
|
8960
|
+
_context47.next = 6;
|
|
8775
8961
|
return this.put(this.baseURL + "/messages/".concat(id), _objectSpread(_objectSpread(_objectSpread({}, partialMessageObject), options), {}, {
|
|
8776
8962
|
user: user
|
|
8777
8963
|
}));
|
|
8778
8964
|
|
|
8779
8965
|
case 6:
|
|
8780
|
-
return
|
|
8966
|
+
return _context47.abrupt("return", _context47.sent);
|
|
8781
8967
|
|
|
8782
8968
|
case 7:
|
|
8783
8969
|
case "end":
|
|
8784
|
-
return
|
|
8970
|
+
return _context47.stop();
|
|
8785
8971
|
}
|
|
8786
8972
|
}
|
|
8787
|
-
},
|
|
8973
|
+
}, _callee47, this);
|
|
8788
8974
|
}));
|
|
8789
8975
|
|
|
8790
|
-
function partialUpdateMessage(
|
|
8976
|
+
function partialUpdateMessage(_x61, _x62, _x63, _x64) {
|
|
8791
8977
|
return _partialUpdateMessage.apply(this, arguments);
|
|
8792
8978
|
}
|
|
8793
8979
|
|
|
@@ -8796,11 +8982,11 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8796
8982
|
}, {
|
|
8797
8983
|
key: "deleteMessage",
|
|
8798
8984
|
value: function () {
|
|
8799
|
-
var _deleteMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8985
|
+
var _deleteMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee48(messageID, hardDelete) {
|
|
8800
8986
|
var params;
|
|
8801
|
-
return _regeneratorRuntime.wrap(function
|
|
8987
|
+
return _regeneratorRuntime.wrap(function _callee48$(_context48) {
|
|
8802
8988
|
while (1) {
|
|
8803
|
-
switch (
|
|
8989
|
+
switch (_context48.prev = _context48.next) {
|
|
8804
8990
|
case 0:
|
|
8805
8991
|
params = {};
|
|
8806
8992
|
|
|
@@ -8810,21 +8996,21 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8810
8996
|
};
|
|
8811
8997
|
}
|
|
8812
8998
|
|
|
8813
|
-
|
|
8999
|
+
_context48.next = 4;
|
|
8814
9000
|
return this.delete(this.baseURL + "/messages/".concat(messageID), params);
|
|
8815
9001
|
|
|
8816
9002
|
case 4:
|
|
8817
|
-
return
|
|
9003
|
+
return _context48.abrupt("return", _context48.sent);
|
|
8818
9004
|
|
|
8819
9005
|
case 5:
|
|
8820
9006
|
case "end":
|
|
8821
|
-
return
|
|
9007
|
+
return _context48.stop();
|
|
8822
9008
|
}
|
|
8823
9009
|
}
|
|
8824
|
-
},
|
|
9010
|
+
}, _callee48, this);
|
|
8825
9011
|
}));
|
|
8826
9012
|
|
|
8827
|
-
function deleteMessage(
|
|
9013
|
+
function deleteMessage(_x65, _x66) {
|
|
8828
9014
|
return _deleteMessage.apply(this, arguments);
|
|
8829
9015
|
}
|
|
8830
9016
|
|
|
@@ -8833,26 +9019,26 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8833
9019
|
}, {
|
|
8834
9020
|
key: "getMessage",
|
|
8835
9021
|
value: function () {
|
|
8836
|
-
var _getMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8837
|
-
return _regeneratorRuntime.wrap(function
|
|
9022
|
+
var _getMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49(messageID) {
|
|
9023
|
+
return _regeneratorRuntime.wrap(function _callee49$(_context49) {
|
|
8838
9024
|
while (1) {
|
|
8839
|
-
switch (
|
|
9025
|
+
switch (_context49.prev = _context49.next) {
|
|
8840
9026
|
case 0:
|
|
8841
|
-
|
|
9027
|
+
_context49.next = 2;
|
|
8842
9028
|
return this.get(this.baseURL + "/messages/".concat(messageID));
|
|
8843
9029
|
|
|
8844
9030
|
case 2:
|
|
8845
|
-
return
|
|
9031
|
+
return _context49.abrupt("return", _context49.sent);
|
|
8846
9032
|
|
|
8847
9033
|
case 3:
|
|
8848
9034
|
case "end":
|
|
8849
|
-
return
|
|
9035
|
+
return _context49.stop();
|
|
8850
9036
|
}
|
|
8851
9037
|
}
|
|
8852
|
-
},
|
|
9038
|
+
}, _callee49, this);
|
|
8853
9039
|
}));
|
|
8854
9040
|
|
|
8855
|
-
function getMessage(
|
|
9041
|
+
function getMessage(_x67) {
|
|
8856
9042
|
return _getMessage.apply(this, arguments);
|
|
8857
9043
|
}
|
|
8858
9044
|
|
|
@@ -8861,7 +9047,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8861
9047
|
}, {
|
|
8862
9048
|
key: "getUserAgent",
|
|
8863
9049
|
value: function getUserAgent() {
|
|
8864
|
-
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "5.
|
|
9050
|
+
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "5.1.2");
|
|
8865
9051
|
}
|
|
8866
9052
|
}, {
|
|
8867
9053
|
key: "setUserAgent",
|
|
@@ -8896,12 +9082,11 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8896
9082
|
}
|
|
8897
9083
|
|
|
8898
9084
|
return _objectSpread({
|
|
8899
|
-
params: _objectSpread(
|
|
8900
|
-
user_id: this.userID
|
|
8901
|
-
|
|
8902
|
-
api_key: this.key
|
|
8903
|
-
|
|
8904
|
-
}),
|
|
9085
|
+
params: _objectSpread({
|
|
9086
|
+
user_id: this.userID,
|
|
9087
|
+
connection_id: this._getConnectionID(),
|
|
9088
|
+
api_key: this.key
|
|
9089
|
+
}, options.params),
|
|
8905
9090
|
headers: _objectSpread(_objectSpread({}, authorization), {}, {
|
|
8906
9091
|
'stream-auth-type': this.getAuthType(),
|
|
8907
9092
|
'X-Stream-Client': this.getUserAgent()
|
|
@@ -9057,28 +9242,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9057
9242
|
}, {
|
|
9058
9243
|
key: "sendUserCustomEvent",
|
|
9059
9244
|
value: function () {
|
|
9060
|
-
var _sendUserCustomEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9061
|
-
return _regeneratorRuntime.wrap(function
|
|
9245
|
+
var _sendUserCustomEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee50(targetUserID, event) {
|
|
9246
|
+
return _regeneratorRuntime.wrap(function _callee50$(_context50) {
|
|
9062
9247
|
while (1) {
|
|
9063
|
-
switch (
|
|
9248
|
+
switch (_context50.prev = _context50.next) {
|
|
9064
9249
|
case 0:
|
|
9065
|
-
|
|
9250
|
+
_context50.next = 2;
|
|
9066
9251
|
return this.post("".concat(this.baseURL, "/users/").concat(targetUserID, "/event"), {
|
|
9067
9252
|
event: event
|
|
9068
9253
|
});
|
|
9069
9254
|
|
|
9070
9255
|
case 2:
|
|
9071
|
-
return
|
|
9256
|
+
return _context50.abrupt("return", _context50.sent);
|
|
9072
9257
|
|
|
9073
9258
|
case 3:
|
|
9074
9259
|
case "end":
|
|
9075
|
-
return
|
|
9260
|
+
return _context50.stop();
|
|
9076
9261
|
}
|
|
9077
9262
|
}
|
|
9078
|
-
},
|
|
9263
|
+
}, _callee50, this);
|
|
9079
9264
|
}));
|
|
9080
9265
|
|
|
9081
|
-
function sendUserCustomEvent(
|
|
9266
|
+
function sendUserCustomEvent(_x68, _x69) {
|
|
9082
9267
|
return _sendUserCustomEvent.apply(this, arguments);
|
|
9083
9268
|
}
|
|
9084
9269
|
|
|
@@ -9141,32 +9326,32 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9141
9326
|
}, {
|
|
9142
9327
|
key: "createSegment",
|
|
9143
9328
|
value: function () {
|
|
9144
|
-
var _createSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9329
|
+
var _createSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee51(params) {
|
|
9145
9330
|
var _yield$this$post, segment;
|
|
9146
9331
|
|
|
9147
|
-
return _regeneratorRuntime.wrap(function
|
|
9332
|
+
return _regeneratorRuntime.wrap(function _callee51$(_context51) {
|
|
9148
9333
|
while (1) {
|
|
9149
|
-
switch (
|
|
9334
|
+
switch (_context51.prev = _context51.next) {
|
|
9150
9335
|
case 0:
|
|
9151
|
-
|
|
9336
|
+
_context51.next = 2;
|
|
9152
9337
|
return this.post(this.baseURL + "/segments", {
|
|
9153
9338
|
segment: params
|
|
9154
9339
|
});
|
|
9155
9340
|
|
|
9156
9341
|
case 2:
|
|
9157
|
-
_yield$this$post =
|
|
9342
|
+
_yield$this$post = _context51.sent;
|
|
9158
9343
|
segment = _yield$this$post.segment;
|
|
9159
|
-
return
|
|
9344
|
+
return _context51.abrupt("return", segment);
|
|
9160
9345
|
|
|
9161
9346
|
case 5:
|
|
9162
9347
|
case "end":
|
|
9163
|
-
return
|
|
9348
|
+
return _context51.stop();
|
|
9164
9349
|
}
|
|
9165
9350
|
}
|
|
9166
|
-
},
|
|
9351
|
+
}, _callee51, this);
|
|
9167
9352
|
}));
|
|
9168
9353
|
|
|
9169
|
-
function createSegment(
|
|
9354
|
+
function createSegment(_x70) {
|
|
9170
9355
|
return _createSegment.apply(this, arguments);
|
|
9171
9356
|
}
|
|
9172
9357
|
|
|
@@ -9183,30 +9368,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9183
9368
|
}, {
|
|
9184
9369
|
key: "getSegment",
|
|
9185
9370
|
value: function () {
|
|
9186
|
-
var _getSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9371
|
+
var _getSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee52(id) {
|
|
9187
9372
|
var _yield$this$get, segment;
|
|
9188
9373
|
|
|
9189
|
-
return _regeneratorRuntime.wrap(function
|
|
9374
|
+
return _regeneratorRuntime.wrap(function _callee52$(_context52) {
|
|
9190
9375
|
while (1) {
|
|
9191
|
-
switch (
|
|
9376
|
+
switch (_context52.prev = _context52.next) {
|
|
9192
9377
|
case 0:
|
|
9193
|
-
|
|
9378
|
+
_context52.next = 2;
|
|
9194
9379
|
return this.get(this.baseURL + "/segments/".concat(id));
|
|
9195
9380
|
|
|
9196
9381
|
case 2:
|
|
9197
|
-
_yield$this$get =
|
|
9382
|
+
_yield$this$get = _context52.sent;
|
|
9198
9383
|
segment = _yield$this$get.segment;
|
|
9199
|
-
return
|
|
9384
|
+
return _context52.abrupt("return", segment);
|
|
9200
9385
|
|
|
9201
9386
|
case 5:
|
|
9202
9387
|
case "end":
|
|
9203
|
-
return
|
|
9388
|
+
return _context52.stop();
|
|
9204
9389
|
}
|
|
9205
9390
|
}
|
|
9206
|
-
},
|
|
9391
|
+
}, _callee52, this);
|
|
9207
9392
|
}));
|
|
9208
9393
|
|
|
9209
|
-
function getSegment(
|
|
9394
|
+
function getSegment(_x71) {
|
|
9210
9395
|
return _getSegment.apply(this, arguments);
|
|
9211
9396
|
}
|
|
9212
9397
|
|
|
@@ -9222,30 +9407,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9222
9407
|
}, {
|
|
9223
9408
|
key: "listSegments",
|
|
9224
9409
|
value: function () {
|
|
9225
|
-
var _listSegments = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9410
|
+
var _listSegments = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee53(options) {
|
|
9226
9411
|
var _yield$this$get2, segments;
|
|
9227
9412
|
|
|
9228
|
-
return _regeneratorRuntime.wrap(function
|
|
9413
|
+
return _regeneratorRuntime.wrap(function _callee53$(_context53) {
|
|
9229
9414
|
while (1) {
|
|
9230
|
-
switch (
|
|
9415
|
+
switch (_context53.prev = _context53.next) {
|
|
9231
9416
|
case 0:
|
|
9232
|
-
|
|
9417
|
+
_context53.next = 2;
|
|
9233
9418
|
return this.get(this.baseURL + "/segments", options);
|
|
9234
9419
|
|
|
9235
9420
|
case 2:
|
|
9236
|
-
_yield$this$get2 =
|
|
9421
|
+
_yield$this$get2 = _context53.sent;
|
|
9237
9422
|
segments = _yield$this$get2.segments;
|
|
9238
|
-
return
|
|
9423
|
+
return _context53.abrupt("return", segments);
|
|
9239
9424
|
|
|
9240
9425
|
case 5:
|
|
9241
9426
|
case "end":
|
|
9242
|
-
return
|
|
9427
|
+
return _context53.stop();
|
|
9243
9428
|
}
|
|
9244
9429
|
}
|
|
9245
|
-
},
|
|
9430
|
+
}, _callee53, this);
|
|
9246
9431
|
}));
|
|
9247
9432
|
|
|
9248
|
-
function listSegments(
|
|
9433
|
+
function listSegments(_x72) {
|
|
9249
9434
|
return _listSegments.apply(this, arguments);
|
|
9250
9435
|
}
|
|
9251
9436
|
|
|
@@ -9263,32 +9448,32 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9263
9448
|
}, {
|
|
9264
9449
|
key: "updateSegment",
|
|
9265
9450
|
value: function () {
|
|
9266
|
-
var _updateSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9451
|
+
var _updateSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee54(id, params) {
|
|
9267
9452
|
var _yield$this$put, segment;
|
|
9268
9453
|
|
|
9269
|
-
return _regeneratorRuntime.wrap(function
|
|
9454
|
+
return _regeneratorRuntime.wrap(function _callee54$(_context54) {
|
|
9270
9455
|
while (1) {
|
|
9271
|
-
switch (
|
|
9456
|
+
switch (_context54.prev = _context54.next) {
|
|
9272
9457
|
case 0:
|
|
9273
|
-
|
|
9458
|
+
_context54.next = 2;
|
|
9274
9459
|
return this.put(this.baseURL + "/segments/".concat(id), {
|
|
9275
9460
|
segment: params
|
|
9276
9461
|
});
|
|
9277
9462
|
|
|
9278
9463
|
case 2:
|
|
9279
|
-
_yield$this$put =
|
|
9464
|
+
_yield$this$put = _context54.sent;
|
|
9280
9465
|
segment = _yield$this$put.segment;
|
|
9281
|
-
return
|
|
9466
|
+
return _context54.abrupt("return", segment);
|
|
9282
9467
|
|
|
9283
9468
|
case 5:
|
|
9284
9469
|
case "end":
|
|
9285
|
-
return
|
|
9470
|
+
return _context54.stop();
|
|
9286
9471
|
}
|
|
9287
9472
|
}
|
|
9288
|
-
},
|
|
9473
|
+
}, _callee54, this);
|
|
9289
9474
|
}));
|
|
9290
9475
|
|
|
9291
|
-
function updateSegment(
|
|
9476
|
+
function updateSegment(_x73, _x74) {
|
|
9292
9477
|
return _updateSegment.apply(this, arguments);
|
|
9293
9478
|
}
|
|
9294
9479
|
|
|
@@ -9305,22 +9490,22 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9305
9490
|
}, {
|
|
9306
9491
|
key: "deleteSegment",
|
|
9307
9492
|
value: function () {
|
|
9308
|
-
var _deleteSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9309
|
-
return _regeneratorRuntime.wrap(function
|
|
9493
|
+
var _deleteSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee55(id) {
|
|
9494
|
+
return _regeneratorRuntime.wrap(function _callee55$(_context55) {
|
|
9310
9495
|
while (1) {
|
|
9311
|
-
switch (
|
|
9496
|
+
switch (_context55.prev = _context55.next) {
|
|
9312
9497
|
case 0:
|
|
9313
|
-
return
|
|
9498
|
+
return _context55.abrupt("return", this.delete(this.baseURL + "/segments/".concat(id)));
|
|
9314
9499
|
|
|
9315
9500
|
case 1:
|
|
9316
9501
|
case "end":
|
|
9317
|
-
return
|
|
9502
|
+
return _context55.stop();
|
|
9318
9503
|
}
|
|
9319
9504
|
}
|
|
9320
|
-
},
|
|
9505
|
+
}, _callee55, this);
|
|
9321
9506
|
}));
|
|
9322
9507
|
|
|
9323
|
-
function deleteSegment(
|
|
9508
|
+
function deleteSegment(_x75) {
|
|
9324
9509
|
return _deleteSegment.apply(this, arguments);
|
|
9325
9510
|
}
|
|
9326
9511
|
|
|
@@ -9337,32 +9522,32 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9337
9522
|
}, {
|
|
9338
9523
|
key: "createCampaign",
|
|
9339
9524
|
value: function () {
|
|
9340
|
-
var _createCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9525
|
+
var _createCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee56(params) {
|
|
9341
9526
|
var _yield$this$post2, campaign;
|
|
9342
9527
|
|
|
9343
|
-
return _regeneratorRuntime.wrap(function
|
|
9528
|
+
return _regeneratorRuntime.wrap(function _callee56$(_context56) {
|
|
9344
9529
|
while (1) {
|
|
9345
|
-
switch (
|
|
9530
|
+
switch (_context56.prev = _context56.next) {
|
|
9346
9531
|
case 0:
|
|
9347
|
-
|
|
9532
|
+
_context56.next = 2;
|
|
9348
9533
|
return this.post(this.baseURL + "/campaigns", {
|
|
9349
9534
|
campaign: params
|
|
9350
9535
|
});
|
|
9351
9536
|
|
|
9352
9537
|
case 2:
|
|
9353
|
-
_yield$this$post2 =
|
|
9538
|
+
_yield$this$post2 = _context56.sent;
|
|
9354
9539
|
campaign = _yield$this$post2.campaign;
|
|
9355
|
-
return
|
|
9540
|
+
return _context56.abrupt("return", campaign);
|
|
9356
9541
|
|
|
9357
9542
|
case 5:
|
|
9358
9543
|
case "end":
|
|
9359
|
-
return
|
|
9544
|
+
return _context56.stop();
|
|
9360
9545
|
}
|
|
9361
9546
|
}
|
|
9362
|
-
},
|
|
9547
|
+
}, _callee56, this);
|
|
9363
9548
|
}));
|
|
9364
9549
|
|
|
9365
|
-
function createCampaign(
|
|
9550
|
+
function createCampaign(_x76) {
|
|
9366
9551
|
return _createCampaign.apply(this, arguments);
|
|
9367
9552
|
}
|
|
9368
9553
|
|
|
@@ -9379,30 +9564,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9379
9564
|
}, {
|
|
9380
9565
|
key: "getCampaign",
|
|
9381
9566
|
value: function () {
|
|
9382
|
-
var _getCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9567
|
+
var _getCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee57(id) {
|
|
9383
9568
|
var _yield$this$get3, campaign;
|
|
9384
9569
|
|
|
9385
|
-
return _regeneratorRuntime.wrap(function
|
|
9570
|
+
return _regeneratorRuntime.wrap(function _callee57$(_context57) {
|
|
9386
9571
|
while (1) {
|
|
9387
|
-
switch (
|
|
9572
|
+
switch (_context57.prev = _context57.next) {
|
|
9388
9573
|
case 0:
|
|
9389
|
-
|
|
9574
|
+
_context57.next = 2;
|
|
9390
9575
|
return this.get(this.baseURL + "/campaigns/".concat(id));
|
|
9391
9576
|
|
|
9392
9577
|
case 2:
|
|
9393
|
-
_yield$this$get3 =
|
|
9578
|
+
_yield$this$get3 = _context57.sent;
|
|
9394
9579
|
campaign = _yield$this$get3.campaign;
|
|
9395
|
-
return
|
|
9580
|
+
return _context57.abrupt("return", campaign);
|
|
9396
9581
|
|
|
9397
9582
|
case 5:
|
|
9398
9583
|
case "end":
|
|
9399
|
-
return
|
|
9584
|
+
return _context57.stop();
|
|
9400
9585
|
}
|
|
9401
9586
|
}
|
|
9402
|
-
},
|
|
9587
|
+
}, _callee57, this);
|
|
9403
9588
|
}));
|
|
9404
9589
|
|
|
9405
|
-
function getCampaign(
|
|
9590
|
+
function getCampaign(_x77) {
|
|
9406
9591
|
return _getCampaign.apply(this, arguments);
|
|
9407
9592
|
}
|
|
9408
9593
|
|
|
@@ -9418,30 +9603,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9418
9603
|
}, {
|
|
9419
9604
|
key: "listCampaigns",
|
|
9420
9605
|
value: function () {
|
|
9421
|
-
var _listCampaigns = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9606
|
+
var _listCampaigns = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee58(options) {
|
|
9422
9607
|
var _yield$this$get4, campaigns;
|
|
9423
9608
|
|
|
9424
|
-
return _regeneratorRuntime.wrap(function
|
|
9609
|
+
return _regeneratorRuntime.wrap(function _callee58$(_context58) {
|
|
9425
9610
|
while (1) {
|
|
9426
|
-
switch (
|
|
9611
|
+
switch (_context58.prev = _context58.next) {
|
|
9427
9612
|
case 0:
|
|
9428
|
-
|
|
9613
|
+
_context58.next = 2;
|
|
9429
9614
|
return this.get(this.baseURL + "/campaigns", options);
|
|
9430
9615
|
|
|
9431
9616
|
case 2:
|
|
9432
|
-
_yield$this$get4 =
|
|
9617
|
+
_yield$this$get4 = _context58.sent;
|
|
9433
9618
|
campaigns = _yield$this$get4.campaigns;
|
|
9434
|
-
return
|
|
9619
|
+
return _context58.abrupt("return", campaigns);
|
|
9435
9620
|
|
|
9436
9621
|
case 5:
|
|
9437
9622
|
case "end":
|
|
9438
|
-
return
|
|
9623
|
+
return _context58.stop();
|
|
9439
9624
|
}
|
|
9440
9625
|
}
|
|
9441
|
-
},
|
|
9626
|
+
}, _callee58, this);
|
|
9442
9627
|
}));
|
|
9443
9628
|
|
|
9444
|
-
function listCampaigns(
|
|
9629
|
+
function listCampaigns(_x78) {
|
|
9445
9630
|
return _listCampaigns.apply(this, arguments);
|
|
9446
9631
|
}
|
|
9447
9632
|
|
|
@@ -9459,32 +9644,32 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9459
9644
|
}, {
|
|
9460
9645
|
key: "updateCampaign",
|
|
9461
9646
|
value: function () {
|
|
9462
|
-
var _updateCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9647
|
+
var _updateCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee59(id, params) {
|
|
9463
9648
|
var _yield$this$put2, campaign;
|
|
9464
9649
|
|
|
9465
|
-
return _regeneratorRuntime.wrap(function
|
|
9650
|
+
return _regeneratorRuntime.wrap(function _callee59$(_context59) {
|
|
9466
9651
|
while (1) {
|
|
9467
|
-
switch (
|
|
9652
|
+
switch (_context59.prev = _context59.next) {
|
|
9468
9653
|
case 0:
|
|
9469
|
-
|
|
9654
|
+
_context59.next = 2;
|
|
9470
9655
|
return this.put(this.baseURL + "/campaigns/".concat(id), {
|
|
9471
9656
|
campaign: params
|
|
9472
9657
|
});
|
|
9473
9658
|
|
|
9474
9659
|
case 2:
|
|
9475
|
-
_yield$this$put2 =
|
|
9660
|
+
_yield$this$put2 = _context59.sent;
|
|
9476
9661
|
campaign = _yield$this$put2.campaign;
|
|
9477
|
-
return
|
|
9662
|
+
return _context59.abrupt("return", campaign);
|
|
9478
9663
|
|
|
9479
9664
|
case 5:
|
|
9480
9665
|
case "end":
|
|
9481
|
-
return
|
|
9666
|
+
return _context59.stop();
|
|
9482
9667
|
}
|
|
9483
9668
|
}
|
|
9484
|
-
},
|
|
9669
|
+
}, _callee59, this);
|
|
9485
9670
|
}));
|
|
9486
9671
|
|
|
9487
|
-
function updateCampaign(
|
|
9672
|
+
function updateCampaign(_x79, _x80) {
|
|
9488
9673
|
return _updateCampaign.apply(this, arguments);
|
|
9489
9674
|
}
|
|
9490
9675
|
|
|
@@ -9501,22 +9686,22 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9501
9686
|
}, {
|
|
9502
9687
|
key: "deleteCampaign",
|
|
9503
9688
|
value: function () {
|
|
9504
|
-
var _deleteCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9505
|
-
return _regeneratorRuntime.wrap(function
|
|
9689
|
+
var _deleteCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee60(id) {
|
|
9690
|
+
return _regeneratorRuntime.wrap(function _callee60$(_context60) {
|
|
9506
9691
|
while (1) {
|
|
9507
|
-
switch (
|
|
9692
|
+
switch (_context60.prev = _context60.next) {
|
|
9508
9693
|
case 0:
|
|
9509
|
-
return
|
|
9694
|
+
return _context60.abrupt("return", this.delete(this.baseURL + "/campaigns/".concat(id)));
|
|
9510
9695
|
|
|
9511
9696
|
case 1:
|
|
9512
9697
|
case "end":
|
|
9513
|
-
return
|
|
9698
|
+
return _context60.stop();
|
|
9514
9699
|
}
|
|
9515
9700
|
}
|
|
9516
|
-
},
|
|
9701
|
+
}, _callee60, this);
|
|
9517
9702
|
}));
|
|
9518
9703
|
|
|
9519
|
-
function deleteCampaign(
|
|
9704
|
+
function deleteCampaign(_x81) {
|
|
9520
9705
|
return _deleteCampaign.apply(this, arguments);
|
|
9521
9706
|
}
|
|
9522
9707
|
|
|
@@ -9534,33 +9719,33 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9534
9719
|
}, {
|
|
9535
9720
|
key: "scheduleCampaign",
|
|
9536
9721
|
value: function () {
|
|
9537
|
-
var _scheduleCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9722
|
+
var _scheduleCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee61(id, params) {
|
|
9538
9723
|
var sendAt, _yield$this$patch, campaign;
|
|
9539
9724
|
|
|
9540
|
-
return _regeneratorRuntime.wrap(function
|
|
9725
|
+
return _regeneratorRuntime.wrap(function _callee61$(_context61) {
|
|
9541
9726
|
while (1) {
|
|
9542
|
-
switch (
|
|
9727
|
+
switch (_context61.prev = _context61.next) {
|
|
9543
9728
|
case 0:
|
|
9544
9729
|
sendAt = params.sendAt;
|
|
9545
|
-
|
|
9730
|
+
_context61.next = 3;
|
|
9546
9731
|
return this.patch(this.baseURL + "/campaigns/".concat(id, "/schedule"), {
|
|
9547
9732
|
send_at: sendAt
|
|
9548
9733
|
});
|
|
9549
9734
|
|
|
9550
9735
|
case 3:
|
|
9551
|
-
_yield$this$patch =
|
|
9736
|
+
_yield$this$patch = _context61.sent;
|
|
9552
9737
|
campaign = _yield$this$patch.campaign;
|
|
9553
|
-
return
|
|
9738
|
+
return _context61.abrupt("return", campaign);
|
|
9554
9739
|
|
|
9555
9740
|
case 6:
|
|
9556
9741
|
case "end":
|
|
9557
|
-
return
|
|
9742
|
+
return _context61.stop();
|
|
9558
9743
|
}
|
|
9559
9744
|
}
|
|
9560
|
-
},
|
|
9745
|
+
}, _callee61, this);
|
|
9561
9746
|
}));
|
|
9562
9747
|
|
|
9563
|
-
function scheduleCampaign(
|
|
9748
|
+
function scheduleCampaign(_x82, _x83) {
|
|
9564
9749
|
return _scheduleCampaign.apply(this, arguments);
|
|
9565
9750
|
}
|
|
9566
9751
|
|
|
@@ -9577,30 +9762,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9577
9762
|
}, {
|
|
9578
9763
|
key: "stopCampaign",
|
|
9579
9764
|
value: function () {
|
|
9580
|
-
var _stopCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9765
|
+
var _stopCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee62(id) {
|
|
9581
9766
|
var _yield$this$patch2, campaign;
|
|
9582
9767
|
|
|
9583
|
-
return _regeneratorRuntime.wrap(function
|
|
9768
|
+
return _regeneratorRuntime.wrap(function _callee62$(_context62) {
|
|
9584
9769
|
while (1) {
|
|
9585
|
-
switch (
|
|
9770
|
+
switch (_context62.prev = _context62.next) {
|
|
9586
9771
|
case 0:
|
|
9587
|
-
|
|
9772
|
+
_context62.next = 2;
|
|
9588
9773
|
return this.patch(this.baseURL + "/campaigns/".concat(id, "/stop"));
|
|
9589
9774
|
|
|
9590
9775
|
case 2:
|
|
9591
|
-
_yield$this$patch2 =
|
|
9776
|
+
_yield$this$patch2 = _context62.sent;
|
|
9592
9777
|
campaign = _yield$this$patch2.campaign;
|
|
9593
|
-
return
|
|
9778
|
+
return _context62.abrupt("return", campaign);
|
|
9594
9779
|
|
|
9595
9780
|
case 5:
|
|
9596
9781
|
case "end":
|
|
9597
|
-
return
|
|
9782
|
+
return _context62.stop();
|
|
9598
9783
|
}
|
|
9599
9784
|
}
|
|
9600
|
-
},
|
|
9785
|
+
}, _callee62, this);
|
|
9601
9786
|
}));
|
|
9602
9787
|
|
|
9603
|
-
function stopCampaign(
|
|
9788
|
+
function stopCampaign(_x84) {
|
|
9604
9789
|
return _stopCampaign.apply(this, arguments);
|
|
9605
9790
|
}
|
|
9606
9791
|
|
|
@@ -9617,30 +9802,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9617
9802
|
}, {
|
|
9618
9803
|
key: "resumeCampaign",
|
|
9619
9804
|
value: function () {
|
|
9620
|
-
var _resumeCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9805
|
+
var _resumeCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee63(id) {
|
|
9621
9806
|
var _yield$this$patch3, campaign;
|
|
9622
9807
|
|
|
9623
|
-
return _regeneratorRuntime.wrap(function
|
|
9808
|
+
return _regeneratorRuntime.wrap(function _callee63$(_context63) {
|
|
9624
9809
|
while (1) {
|
|
9625
|
-
switch (
|
|
9810
|
+
switch (_context63.prev = _context63.next) {
|
|
9626
9811
|
case 0:
|
|
9627
|
-
|
|
9812
|
+
_context63.next = 2;
|
|
9628
9813
|
return this.patch(this.baseURL + "/campaigns/".concat(id, "/resume"));
|
|
9629
9814
|
|
|
9630
9815
|
case 2:
|
|
9631
|
-
_yield$this$patch3 =
|
|
9816
|
+
_yield$this$patch3 = _context63.sent;
|
|
9632
9817
|
campaign = _yield$this$patch3.campaign;
|
|
9633
|
-
return
|
|
9818
|
+
return _context63.abrupt("return", campaign);
|
|
9634
9819
|
|
|
9635
9820
|
case 5:
|
|
9636
9821
|
case "end":
|
|
9637
|
-
return
|
|
9822
|
+
return _context63.stop();
|
|
9638
9823
|
}
|
|
9639
9824
|
}
|
|
9640
|
-
},
|
|
9825
|
+
}, _callee63, this);
|
|
9641
9826
|
}));
|
|
9642
9827
|
|
|
9643
|
-
function resumeCampaign(
|
|
9828
|
+
function resumeCampaign(_x85) {
|
|
9644
9829
|
return _resumeCampaign.apply(this, arguments);
|
|
9645
9830
|
}
|
|
9646
9831
|
|
|
@@ -9657,33 +9842,33 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9657
9842
|
}, {
|
|
9658
9843
|
key: "testCampaign",
|
|
9659
9844
|
value: function () {
|
|
9660
|
-
var _testCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9845
|
+
var _testCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee64(id, params) {
|
|
9661
9846
|
var users, _yield$this$post3, campaign;
|
|
9662
9847
|
|
|
9663
|
-
return _regeneratorRuntime.wrap(function
|
|
9848
|
+
return _regeneratorRuntime.wrap(function _callee64$(_context64) {
|
|
9664
9849
|
while (1) {
|
|
9665
|
-
switch (
|
|
9850
|
+
switch (_context64.prev = _context64.next) {
|
|
9666
9851
|
case 0:
|
|
9667
9852
|
users = params.users;
|
|
9668
|
-
|
|
9853
|
+
_context64.next = 3;
|
|
9669
9854
|
return this.post(this.baseURL + "/campaigns/".concat(id, "/test"), {
|
|
9670
9855
|
users: users
|
|
9671
9856
|
});
|
|
9672
9857
|
|
|
9673
9858
|
case 3:
|
|
9674
|
-
_yield$this$post3 =
|
|
9859
|
+
_yield$this$post3 = _context64.sent;
|
|
9675
9860
|
campaign = _yield$this$post3.campaign;
|
|
9676
|
-
return
|
|
9861
|
+
return _context64.abrupt("return", campaign);
|
|
9677
9862
|
|
|
9678
9863
|
case 6:
|
|
9679
9864
|
case "end":
|
|
9680
|
-
return
|
|
9865
|
+
return _context64.stop();
|
|
9681
9866
|
}
|
|
9682
9867
|
}
|
|
9683
|
-
},
|
|
9868
|
+
}, _callee64, this);
|
|
9684
9869
|
}));
|
|
9685
9870
|
|
|
9686
|
-
function testCampaign(
|
|
9871
|
+
function testCampaign(_x86, _x87) {
|
|
9687
9872
|
return _testCampaign.apply(this, arguments);
|
|
9688
9873
|
}
|
|
9689
9874
|
|
|
@@ -9699,24 +9884,24 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9699
9884
|
}, {
|
|
9700
9885
|
key: "enrichURL",
|
|
9701
9886
|
value: function () {
|
|
9702
|
-
var _enrichURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9703
|
-
return _regeneratorRuntime.wrap(function
|
|
9887
|
+
var _enrichURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee65(url) {
|
|
9888
|
+
return _regeneratorRuntime.wrap(function _callee65$(_context65) {
|
|
9704
9889
|
while (1) {
|
|
9705
|
-
switch (
|
|
9890
|
+
switch (_context65.prev = _context65.next) {
|
|
9706
9891
|
case 0:
|
|
9707
|
-
return
|
|
9892
|
+
return _context65.abrupt("return", this.get(this.baseURL + "/og", {
|
|
9708
9893
|
url: url
|
|
9709
9894
|
}));
|
|
9710
9895
|
|
|
9711
9896
|
case 1:
|
|
9712
9897
|
case "end":
|
|
9713
|
-
return
|
|
9898
|
+
return _context65.stop();
|
|
9714
9899
|
}
|
|
9715
9900
|
}
|
|
9716
|
-
},
|
|
9901
|
+
}, _callee65, this);
|
|
9717
9902
|
}));
|
|
9718
9903
|
|
|
9719
|
-
function enrichURL(
|
|
9904
|
+
function enrichURL(_x88) {
|
|
9720
9905
|
return _enrichURL.apply(this, arguments);
|
|
9721
9906
|
}
|
|
9722
9907
|
|
|
@@ -9733,22 +9918,22 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9733
9918
|
}, {
|
|
9734
9919
|
key: "getTask",
|
|
9735
9920
|
value: function () {
|
|
9736
|
-
var _getTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9737
|
-
return _regeneratorRuntime.wrap(function
|
|
9921
|
+
var _getTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee66(id) {
|
|
9922
|
+
return _regeneratorRuntime.wrap(function _callee66$(_context66) {
|
|
9738
9923
|
while (1) {
|
|
9739
|
-
switch (
|
|
9924
|
+
switch (_context66.prev = _context66.next) {
|
|
9740
9925
|
case 0:
|
|
9741
|
-
return
|
|
9926
|
+
return _context66.abrupt("return", this.get("".concat(this.baseURL, "/tasks/").concat(id)));
|
|
9742
9927
|
|
|
9743
9928
|
case 1:
|
|
9744
9929
|
case "end":
|
|
9745
|
-
return
|
|
9930
|
+
return _context66.stop();
|
|
9746
9931
|
}
|
|
9747
9932
|
}
|
|
9748
|
-
},
|
|
9933
|
+
}, _callee66, this);
|
|
9749
9934
|
}));
|
|
9750
9935
|
|
|
9751
|
-
function getTask(
|
|
9936
|
+
function getTask(_x89) {
|
|
9752
9937
|
return _getTask.apply(this, arguments);
|
|
9753
9938
|
}
|
|
9754
9939
|
|
|
@@ -9766,31 +9951,31 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9766
9951
|
}, {
|
|
9767
9952
|
key: "deleteChannels",
|
|
9768
9953
|
value: function () {
|
|
9769
|
-
var _deleteChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9954
|
+
var _deleteChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee67(cids) {
|
|
9770
9955
|
var options,
|
|
9771
|
-
|
|
9772
|
-
return _regeneratorRuntime.wrap(function
|
|
9956
|
+
_args67 = arguments;
|
|
9957
|
+
return _regeneratorRuntime.wrap(function _callee67$(_context67) {
|
|
9773
9958
|
while (1) {
|
|
9774
|
-
switch (
|
|
9959
|
+
switch (_context67.prev = _context67.next) {
|
|
9775
9960
|
case 0:
|
|
9776
|
-
options =
|
|
9777
|
-
|
|
9961
|
+
options = _args67.length > 1 && _args67[1] !== undefined ? _args67[1] : {};
|
|
9962
|
+
_context67.next = 3;
|
|
9778
9963
|
return this.post(this.baseURL + "/channels/delete", _objectSpread({
|
|
9779
9964
|
cids: cids
|
|
9780
9965
|
}, options));
|
|
9781
9966
|
|
|
9782
9967
|
case 3:
|
|
9783
|
-
return
|
|
9968
|
+
return _context67.abrupt("return", _context67.sent);
|
|
9784
9969
|
|
|
9785
9970
|
case 4:
|
|
9786
9971
|
case "end":
|
|
9787
|
-
return
|
|
9972
|
+
return _context67.stop();
|
|
9788
9973
|
}
|
|
9789
9974
|
}
|
|
9790
|
-
},
|
|
9975
|
+
}, _callee67, this);
|
|
9791
9976
|
}));
|
|
9792
9977
|
|
|
9793
|
-
function deleteChannels(
|
|
9978
|
+
function deleteChannels(_x90) {
|
|
9794
9979
|
return _deleteChannels.apply(this, arguments);
|
|
9795
9980
|
}
|
|
9796
9981
|
|
|
@@ -9808,13 +9993,13 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9808
9993
|
}, {
|
|
9809
9994
|
key: "deleteUsers",
|
|
9810
9995
|
value: function () {
|
|
9811
|
-
var _deleteUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9812
|
-
return _regeneratorRuntime.wrap(function
|
|
9996
|
+
var _deleteUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee68(user_ids, options) {
|
|
9997
|
+
return _regeneratorRuntime.wrap(function _callee68$(_context68) {
|
|
9813
9998
|
while (1) {
|
|
9814
|
-
switch (
|
|
9999
|
+
switch (_context68.prev = _context68.next) {
|
|
9815
10000
|
case 0:
|
|
9816
10001
|
if (!((options === null || options === void 0 ? void 0 : options.user) !== 'soft' && (options === null || options === void 0 ? void 0 : options.user) !== 'hard')) {
|
|
9817
|
-
|
|
10002
|
+
_context68.next = 2;
|
|
9818
10003
|
break;
|
|
9819
10004
|
}
|
|
9820
10005
|
|
|
@@ -9822,7 +10007,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9822
10007
|
|
|
9823
10008
|
case 2:
|
|
9824
10009
|
if (!(options.messages !== undefined && options.messages !== 'soft' && options.messages !== 'hard')) {
|
|
9825
|
-
|
|
10010
|
+
_context68.next = 4;
|
|
9826
10011
|
break;
|
|
9827
10012
|
}
|
|
9828
10013
|
|
|
@@ -9830,30 +10015,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9830
10015
|
|
|
9831
10016
|
case 4:
|
|
9832
10017
|
if (!(options.conversations !== undefined && options.conversations !== 'soft' && options.conversations !== 'hard')) {
|
|
9833
|
-
|
|
10018
|
+
_context68.next = 6;
|
|
9834
10019
|
break;
|
|
9835
10020
|
}
|
|
9836
10021
|
|
|
9837
10022
|
throw new Error('Invalid delete user options. conversations must be one of [soft hard]');
|
|
9838
10023
|
|
|
9839
10024
|
case 6:
|
|
9840
|
-
|
|
10025
|
+
_context68.next = 8;
|
|
9841
10026
|
return this.post(this.baseURL + "/users/delete", _objectSpread({
|
|
9842
10027
|
user_ids: user_ids
|
|
9843
10028
|
}, options));
|
|
9844
10029
|
|
|
9845
10030
|
case 8:
|
|
9846
|
-
return
|
|
10031
|
+
return _context68.abrupt("return", _context68.sent);
|
|
9847
10032
|
|
|
9848
10033
|
case 9:
|
|
9849
10034
|
case "end":
|
|
9850
|
-
return
|
|
10035
|
+
return _context68.stop();
|
|
9851
10036
|
}
|
|
9852
10037
|
}
|
|
9853
|
-
},
|
|
10038
|
+
}, _callee68, this);
|
|
9854
10039
|
}));
|
|
9855
10040
|
|
|
9856
|
-
function deleteUsers(
|
|
10041
|
+
function deleteUsers(_x91, _x92) {
|
|
9857
10042
|
return _deleteUsers.apply(this, arguments);
|
|
9858
10043
|
}
|
|
9859
10044
|
|