stream-chat 6.0.0 → 6.1.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 +298 -240
- 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 +298 -240
- package/dist/browser.js.map +1 -1
- package/dist/index.es.js +298 -240
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +298 -240
- package/dist/index.js.map +1 -1
- package/dist/types/channel.d.ts +2 -2
- package/dist/types/channel.d.ts.map +1 -1
- package/dist/types/client.d.ts +15 -1
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/types.d.ts +50 -1
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/channel.ts +6 -2
- package/src/client.ts +29 -0
- package/src/types.ts +74 -1
package/dist/browser.es.js
CHANGED
|
@@ -2685,14 +2685,16 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2685
2685
|
}, {
|
|
2686
2686
|
key: "_countMessageAsUnread",
|
|
2687
2687
|
value: function _countMessageAsUnread(message) {
|
|
2688
|
-
var _message$user, _message$user2;
|
|
2688
|
+
var _message$user, _message$user2, _this$data2, _this$data3;
|
|
2689
2689
|
|
|
2690
2690
|
if (message.shadowed) return false;
|
|
2691
2691
|
if (message.silent) return false;
|
|
2692
2692
|
if (message.parent_id && !message.show_in_channel) return false;
|
|
2693
2693
|
if (((_message$user = message.user) === null || _message$user === void 0 ? void 0 : _message$user.id) === this.getClient().userID) return false;
|
|
2694
2694
|
if ((_message$user2 = message.user) !== null && _message$user2 !== void 0 && _message$user2.id && this.getClient().userMuteStatus(message.user.id)) return false;
|
|
2695
|
-
if (message.type === 'system') return false;
|
|
2695
|
+
if (message.type === 'system') return false; // Return false if channel doesn't allow read events.
|
|
2696
|
+
|
|
2697
|
+
if (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 && _this$data3.own_capabilities.includes('read-events'))) return false;
|
|
2696
2698
|
if (this.muteStatus().muted) return false;
|
|
2697
2699
|
return true;
|
|
2698
2700
|
}
|
|
@@ -6997,6 +6999,13 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6997
6999
|
this.mutedUsers = event.me.mutes;
|
|
6998
7000
|
}
|
|
6999
7001
|
|
|
7002
|
+
if (event.type === 'notification.mark_read') {
|
|
7003
|
+
var activeChannelKeys = Object.keys(this.activeChannels);
|
|
7004
|
+
activeChannelKeys.forEach(function (activeChannelKey) {
|
|
7005
|
+
return _this3.activeChannels[activeChannelKey].state.unreadCount = 0;
|
|
7006
|
+
});
|
|
7007
|
+
}
|
|
7008
|
+
|
|
7000
7009
|
if ((event.type === 'channel.deleted' || event.type === 'notification.channel_deleted') && event.cid) {
|
|
7001
7010
|
var _this$activeChannels$;
|
|
7002
7011
|
|
|
@@ -8550,23 +8559,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8550
8559
|
return unflagUser;
|
|
8551
8560
|
}()
|
|
8552
8561
|
/**
|
|
8553
|
-
*
|
|
8562
|
+
* _queryFlags - Query flags.
|
|
8554
8563
|
*
|
|
8555
8564
|
* Note: Do not use this.
|
|
8556
8565
|
* It is present for internal usage only.
|
|
8557
8566
|
* This function can, and will, break and/or be removed at any point in time.
|
|
8558
8567
|
*
|
|
8559
8568
|
* @private
|
|
8560
|
-
* @param {
|
|
8561
|
-
* @param {
|
|
8569
|
+
* @param {FlagsFilters} filterConditions MongoDB style filter conditions
|
|
8570
|
+
* @param {FlagsPaginationOptions} options Option object, {limit: 10, offset:0}
|
|
8562
8571
|
*
|
|
8563
|
-
* @return {Promise<
|
|
8572
|
+
* @return {Promise<FlagsResponse<StreamChatGenerics>>} Flags Response
|
|
8564
8573
|
*/
|
|
8565
8574
|
|
|
8566
8575
|
}, {
|
|
8567
|
-
key: "
|
|
8576
|
+
key: "_queryFlags",
|
|
8568
8577
|
value: function () {
|
|
8569
|
-
var
|
|
8578
|
+
var _queryFlags2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42() {
|
|
8570
8579
|
var filterConditions,
|
|
8571
8580
|
options,
|
|
8572
8581
|
_args42 = arguments;
|
|
@@ -8577,7 +8586,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8577
8586
|
filterConditions = _args42.length > 0 && _args42[0] !== undefined ? _args42[0] : {};
|
|
8578
8587
|
options = _args42.length > 1 && _args42[1] !== undefined ? _args42[1] : {};
|
|
8579
8588
|
_context42.next = 4;
|
|
8580
|
-
return this.post(this.baseURL + '/moderation/
|
|
8589
|
+
return this.post(this.baseURL + '/moderation/flags', _objectSpread({
|
|
8581
8590
|
filter_conditions: filterConditions
|
|
8582
8591
|
}, options));
|
|
8583
8592
|
|
|
@@ -8592,6 +8601,55 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8592
8601
|
}, _callee42, this);
|
|
8593
8602
|
}));
|
|
8594
8603
|
|
|
8604
|
+
function _queryFlags() {
|
|
8605
|
+
return _queryFlags2.apply(this, arguments);
|
|
8606
|
+
}
|
|
8607
|
+
|
|
8608
|
+
return _queryFlags;
|
|
8609
|
+
}()
|
|
8610
|
+
/**
|
|
8611
|
+
* _queryFlagReports - Query flag reports.
|
|
8612
|
+
*
|
|
8613
|
+
* Note: Do not use this.
|
|
8614
|
+
* It is present for internal usage only.
|
|
8615
|
+
* This function can, and will, break and/or be removed at any point in time.
|
|
8616
|
+
*
|
|
8617
|
+
* @private
|
|
8618
|
+
* @param {FlagReportsFilters} filterConditions MongoDB style filter conditions
|
|
8619
|
+
* @param {FlagReportsPaginationOptions} options Option object, {limit: 10, offset:0}
|
|
8620
|
+
*
|
|
8621
|
+
* @return {Promise<FlagReportsResponse<StreamChatGenerics>>} Flag Reports Response
|
|
8622
|
+
*/
|
|
8623
|
+
|
|
8624
|
+
}, {
|
|
8625
|
+
key: "_queryFlagReports",
|
|
8626
|
+
value: function () {
|
|
8627
|
+
var _queryFlagReports2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee43() {
|
|
8628
|
+
var filterConditions,
|
|
8629
|
+
options,
|
|
8630
|
+
_args43 = arguments;
|
|
8631
|
+
return _regeneratorRuntime.wrap(function _callee43$(_context43) {
|
|
8632
|
+
while (1) {
|
|
8633
|
+
switch (_context43.prev = _context43.next) {
|
|
8634
|
+
case 0:
|
|
8635
|
+
filterConditions = _args43.length > 0 && _args43[0] !== undefined ? _args43[0] : {};
|
|
8636
|
+
options = _args43.length > 1 && _args43[1] !== undefined ? _args43[1] : {};
|
|
8637
|
+
_context43.next = 4;
|
|
8638
|
+
return this.post(this.baseURL + '/moderation/reports', _objectSpread({
|
|
8639
|
+
filter_conditions: filterConditions
|
|
8640
|
+
}, options));
|
|
8641
|
+
|
|
8642
|
+
case 4:
|
|
8643
|
+
return _context43.abrupt("return", _context43.sent);
|
|
8644
|
+
|
|
8645
|
+
case 5:
|
|
8646
|
+
case "end":
|
|
8647
|
+
return _context43.stop();
|
|
8648
|
+
}
|
|
8649
|
+
}
|
|
8650
|
+
}, _callee43, this);
|
|
8651
|
+
}));
|
|
8652
|
+
|
|
8595
8653
|
function _queryFlagReports() {
|
|
8596
8654
|
return _queryFlagReports2.apply(this, arguments);
|
|
8597
8655
|
}
|
|
@@ -8616,28 +8674,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8616
8674
|
}, {
|
|
8617
8675
|
key: "_reviewFlagReport",
|
|
8618
8676
|
value: function () {
|
|
8619
|
-
var _reviewFlagReport2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8677
|
+
var _reviewFlagReport2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44(id, reviewResult) {
|
|
8620
8678
|
var options,
|
|
8621
|
-
|
|
8622
|
-
return _regeneratorRuntime.wrap(function
|
|
8679
|
+
_args44 = arguments;
|
|
8680
|
+
return _regeneratorRuntime.wrap(function _callee44$(_context44) {
|
|
8623
8681
|
while (1) {
|
|
8624
|
-
switch (
|
|
8682
|
+
switch (_context44.prev = _context44.next) {
|
|
8625
8683
|
case 0:
|
|
8626
|
-
options =
|
|
8627
|
-
|
|
8684
|
+
options = _args44.length > 2 && _args44[2] !== undefined ? _args44[2] : {};
|
|
8685
|
+
_context44.next = 3;
|
|
8628
8686
|
return this.patch(this.baseURL + "/moderation/reports/".concat(id), _objectSpread({
|
|
8629
8687
|
review_result: reviewResult
|
|
8630
8688
|
}, options));
|
|
8631
8689
|
|
|
8632
8690
|
case 3:
|
|
8633
|
-
return
|
|
8691
|
+
return _context44.abrupt("return", _context44.sent);
|
|
8634
8692
|
|
|
8635
8693
|
case 4:
|
|
8636
8694
|
case "end":
|
|
8637
|
-
return
|
|
8695
|
+
return _context44.stop();
|
|
8638
8696
|
}
|
|
8639
8697
|
}
|
|
8640
|
-
},
|
|
8698
|
+
}, _callee44, this);
|
|
8641
8699
|
}));
|
|
8642
8700
|
|
|
8643
8701
|
function _reviewFlagReport(_x54, _x55) {
|
|
@@ -8662,28 +8720,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8662
8720
|
}, {
|
|
8663
8721
|
key: "_unblockMessage",
|
|
8664
8722
|
value: function () {
|
|
8665
|
-
var _unblockMessage2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8723
|
+
var _unblockMessage2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45(targetMessageID) {
|
|
8666
8724
|
var options,
|
|
8667
|
-
|
|
8668
|
-
return _regeneratorRuntime.wrap(function
|
|
8725
|
+
_args45 = arguments;
|
|
8726
|
+
return _regeneratorRuntime.wrap(function _callee45$(_context45) {
|
|
8669
8727
|
while (1) {
|
|
8670
|
-
switch (
|
|
8728
|
+
switch (_context45.prev = _context45.next) {
|
|
8671
8729
|
case 0:
|
|
8672
|
-
options =
|
|
8673
|
-
|
|
8730
|
+
options = _args45.length > 1 && _args45[1] !== undefined ? _args45[1] : {};
|
|
8731
|
+
_context45.next = 3;
|
|
8674
8732
|
return this.post(this.baseURL + '/moderation/unblock_message', _objectSpread({
|
|
8675
8733
|
target_message_id: targetMessageID
|
|
8676
8734
|
}, options));
|
|
8677
8735
|
|
|
8678
8736
|
case 3:
|
|
8679
|
-
return
|
|
8737
|
+
return _context45.abrupt("return", _context45.sent);
|
|
8680
8738
|
|
|
8681
8739
|
case 4:
|
|
8682
8740
|
case "end":
|
|
8683
|
-
return
|
|
8741
|
+
return _context45.stop();
|
|
8684
8742
|
}
|
|
8685
8743
|
}
|
|
8686
|
-
},
|
|
8744
|
+
}, _callee45, this);
|
|
8687
8745
|
}));
|
|
8688
8746
|
|
|
8689
8747
|
function _unblockMessage(_x56) {
|
|
@@ -8713,23 +8771,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8713
8771
|
* @return {Promise<APIResponse>}
|
|
8714
8772
|
*/
|
|
8715
8773
|
function () {
|
|
8716
|
-
var _markChannelsRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8774
|
+
var _markChannelsRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46() {
|
|
8717
8775
|
var data,
|
|
8718
|
-
|
|
8719
|
-
return _regeneratorRuntime.wrap(function
|
|
8776
|
+
_args46 = arguments;
|
|
8777
|
+
return _regeneratorRuntime.wrap(function _callee46$(_context46) {
|
|
8720
8778
|
while (1) {
|
|
8721
|
-
switch (
|
|
8779
|
+
switch (_context46.prev = _context46.next) {
|
|
8722
8780
|
case 0:
|
|
8723
|
-
data =
|
|
8724
|
-
|
|
8781
|
+
data = _args46.length > 0 && _args46[0] !== undefined ? _args46[0] : {};
|
|
8782
|
+
_context46.next = 3;
|
|
8725
8783
|
return this.post(this.baseURL + '/channels/read', _objectSpread({}, data));
|
|
8726
8784
|
|
|
8727
8785
|
case 3:
|
|
8728
8786
|
case "end":
|
|
8729
|
-
return
|
|
8787
|
+
return _context46.stop();
|
|
8730
8788
|
}
|
|
8731
8789
|
}
|
|
8732
|
-
},
|
|
8790
|
+
}, _callee46, this);
|
|
8733
8791
|
}));
|
|
8734
8792
|
|
|
8735
8793
|
function markChannelsRead() {
|
|
@@ -8804,25 +8862,25 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8804
8862
|
}, {
|
|
8805
8863
|
key: "translateMessage",
|
|
8806
8864
|
value: function () {
|
|
8807
|
-
var _translateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8808
|
-
return _regeneratorRuntime.wrap(function
|
|
8865
|
+
var _translateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee47(messageId, language) {
|
|
8866
|
+
return _regeneratorRuntime.wrap(function _callee47$(_context47) {
|
|
8809
8867
|
while (1) {
|
|
8810
|
-
switch (
|
|
8868
|
+
switch (_context47.prev = _context47.next) {
|
|
8811
8869
|
case 0:
|
|
8812
|
-
|
|
8870
|
+
_context47.next = 2;
|
|
8813
8871
|
return this.post(this.baseURL + "/messages/".concat(messageId, "/translate"), {
|
|
8814
8872
|
language: language
|
|
8815
8873
|
});
|
|
8816
8874
|
|
|
8817
8875
|
case 2:
|
|
8818
|
-
return
|
|
8876
|
+
return _context47.abrupt("return", _context47.sent);
|
|
8819
8877
|
|
|
8820
8878
|
case 3:
|
|
8821
8879
|
case "end":
|
|
8822
|
-
return
|
|
8880
|
+
return _context47.stop();
|
|
8823
8881
|
}
|
|
8824
8882
|
}
|
|
8825
|
-
},
|
|
8883
|
+
}, _callee47, this);
|
|
8826
8884
|
}));
|
|
8827
8885
|
|
|
8828
8886
|
function translateMessage(_x57, _x58) {
|
|
@@ -8927,14 +8985,14 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8927
8985
|
}, {
|
|
8928
8986
|
key: "updateMessage",
|
|
8929
8987
|
value: function () {
|
|
8930
|
-
var _updateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8988
|
+
var _updateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee48(message, userId, options) {
|
|
8931
8989
|
var clonedMessage, reservedMessageFields;
|
|
8932
|
-
return _regeneratorRuntime.wrap(function
|
|
8990
|
+
return _regeneratorRuntime.wrap(function _callee48$(_context48) {
|
|
8933
8991
|
while (1) {
|
|
8934
|
-
switch (
|
|
8992
|
+
switch (_context48.prev = _context48.next) {
|
|
8935
8993
|
case 0:
|
|
8936
8994
|
if (message.id) {
|
|
8937
|
-
|
|
8995
|
+
_context48.next = 2;
|
|
8938
8996
|
break;
|
|
8939
8997
|
}
|
|
8940
8998
|
|
|
@@ -8971,20 +9029,20 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8971
9029
|
});
|
|
8972
9030
|
}
|
|
8973
9031
|
|
|
8974
|
-
|
|
9032
|
+
_context48.next = 10;
|
|
8975
9033
|
return this.post(this.baseURL + "/messages/".concat(message.id), _objectSpread({
|
|
8976
9034
|
message: clonedMessage
|
|
8977
9035
|
}, options));
|
|
8978
9036
|
|
|
8979
9037
|
case 10:
|
|
8980
|
-
return
|
|
9038
|
+
return _context48.abrupt("return", _context48.sent);
|
|
8981
9039
|
|
|
8982
9040
|
case 11:
|
|
8983
9041
|
case "end":
|
|
8984
|
-
return
|
|
9042
|
+
return _context48.stop();
|
|
8985
9043
|
}
|
|
8986
9044
|
}
|
|
8987
|
-
},
|
|
9045
|
+
}, _callee48, this);
|
|
8988
9046
|
}));
|
|
8989
9047
|
|
|
8990
9048
|
function updateMessage(_x59, _x60, _x61) {
|
|
@@ -9010,14 +9068,14 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9010
9068
|
}, {
|
|
9011
9069
|
key: "partialUpdateMessage",
|
|
9012
9070
|
value: function () {
|
|
9013
|
-
var _partialUpdateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9071
|
+
var _partialUpdateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49(id, partialMessageObject, userId, options) {
|
|
9014
9072
|
var user;
|
|
9015
|
-
return _regeneratorRuntime.wrap(function
|
|
9073
|
+
return _regeneratorRuntime.wrap(function _callee49$(_context49) {
|
|
9016
9074
|
while (1) {
|
|
9017
|
-
switch (
|
|
9075
|
+
switch (_context49.prev = _context49.next) {
|
|
9018
9076
|
case 0:
|
|
9019
9077
|
if (id) {
|
|
9020
|
-
|
|
9078
|
+
_context49.next = 2;
|
|
9021
9079
|
break;
|
|
9022
9080
|
}
|
|
9023
9081
|
|
|
@@ -9032,20 +9090,20 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9032
9090
|
};
|
|
9033
9091
|
}
|
|
9034
9092
|
|
|
9035
|
-
|
|
9093
|
+
_context49.next = 6;
|
|
9036
9094
|
return this.put(this.baseURL + "/messages/".concat(id), _objectSpread(_objectSpread(_objectSpread({}, partialMessageObject), options), {}, {
|
|
9037
9095
|
user: user
|
|
9038
9096
|
}));
|
|
9039
9097
|
|
|
9040
9098
|
case 6:
|
|
9041
|
-
return
|
|
9099
|
+
return _context49.abrupt("return", _context49.sent);
|
|
9042
9100
|
|
|
9043
9101
|
case 7:
|
|
9044
9102
|
case "end":
|
|
9045
|
-
return
|
|
9103
|
+
return _context49.stop();
|
|
9046
9104
|
}
|
|
9047
9105
|
}
|
|
9048
|
-
},
|
|
9106
|
+
}, _callee49, this);
|
|
9049
9107
|
}));
|
|
9050
9108
|
|
|
9051
9109
|
function partialUpdateMessage(_x62, _x63, _x64, _x65) {
|
|
@@ -9057,11 +9115,11 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9057
9115
|
}, {
|
|
9058
9116
|
key: "deleteMessage",
|
|
9059
9117
|
value: function () {
|
|
9060
|
-
var _deleteMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9118
|
+
var _deleteMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee50(messageID, hardDelete) {
|
|
9061
9119
|
var params;
|
|
9062
|
-
return _regeneratorRuntime.wrap(function
|
|
9120
|
+
return _regeneratorRuntime.wrap(function _callee50$(_context50) {
|
|
9063
9121
|
while (1) {
|
|
9064
|
-
switch (
|
|
9122
|
+
switch (_context50.prev = _context50.next) {
|
|
9065
9123
|
case 0:
|
|
9066
9124
|
params = {};
|
|
9067
9125
|
|
|
@@ -9071,18 +9129,18 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9071
9129
|
};
|
|
9072
9130
|
}
|
|
9073
9131
|
|
|
9074
|
-
|
|
9132
|
+
_context50.next = 4;
|
|
9075
9133
|
return this.delete(this.baseURL + "/messages/".concat(messageID), params);
|
|
9076
9134
|
|
|
9077
9135
|
case 4:
|
|
9078
|
-
return
|
|
9136
|
+
return _context50.abrupt("return", _context50.sent);
|
|
9079
9137
|
|
|
9080
9138
|
case 5:
|
|
9081
9139
|
case "end":
|
|
9082
|
-
return
|
|
9140
|
+
return _context50.stop();
|
|
9083
9141
|
}
|
|
9084
9142
|
}
|
|
9085
|
-
},
|
|
9143
|
+
}, _callee50, this);
|
|
9086
9144
|
}));
|
|
9087
9145
|
|
|
9088
9146
|
function deleteMessage(_x66, _x67) {
|
|
@@ -9094,23 +9152,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9094
9152
|
}, {
|
|
9095
9153
|
key: "getMessage",
|
|
9096
9154
|
value: function () {
|
|
9097
|
-
var _getMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9098
|
-
return _regeneratorRuntime.wrap(function
|
|
9155
|
+
var _getMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee51(messageID) {
|
|
9156
|
+
return _regeneratorRuntime.wrap(function _callee51$(_context51) {
|
|
9099
9157
|
while (1) {
|
|
9100
|
-
switch (
|
|
9158
|
+
switch (_context51.prev = _context51.next) {
|
|
9101
9159
|
case 0:
|
|
9102
|
-
|
|
9160
|
+
_context51.next = 2;
|
|
9103
9161
|
return this.get(this.baseURL + "/messages/".concat(messageID));
|
|
9104
9162
|
|
|
9105
9163
|
case 2:
|
|
9106
|
-
return
|
|
9164
|
+
return _context51.abrupt("return", _context51.sent);
|
|
9107
9165
|
|
|
9108
9166
|
case 3:
|
|
9109
9167
|
case "end":
|
|
9110
|
-
return
|
|
9168
|
+
return _context51.stop();
|
|
9111
9169
|
}
|
|
9112
9170
|
}
|
|
9113
|
-
},
|
|
9171
|
+
}, _callee51, this);
|
|
9114
9172
|
}));
|
|
9115
9173
|
|
|
9116
9174
|
function getMessage(_x68) {
|
|
@@ -9122,7 +9180,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9122
9180
|
}, {
|
|
9123
9181
|
key: "getUserAgent",
|
|
9124
9182
|
value: function getUserAgent() {
|
|
9125
|
-
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "6.
|
|
9183
|
+
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "6.1.0");
|
|
9126
9184
|
}
|
|
9127
9185
|
}, {
|
|
9128
9186
|
key: "setUserAgent",
|
|
@@ -9317,25 +9375,25 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9317
9375
|
}, {
|
|
9318
9376
|
key: "sendUserCustomEvent",
|
|
9319
9377
|
value: function () {
|
|
9320
|
-
var _sendUserCustomEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9321
|
-
return _regeneratorRuntime.wrap(function
|
|
9378
|
+
var _sendUserCustomEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee52(targetUserID, event) {
|
|
9379
|
+
return _regeneratorRuntime.wrap(function _callee52$(_context52) {
|
|
9322
9380
|
while (1) {
|
|
9323
|
-
switch (
|
|
9381
|
+
switch (_context52.prev = _context52.next) {
|
|
9324
9382
|
case 0:
|
|
9325
|
-
|
|
9383
|
+
_context52.next = 2;
|
|
9326
9384
|
return this.post("".concat(this.baseURL, "/users/").concat(targetUserID, "/event"), {
|
|
9327
9385
|
event: event
|
|
9328
9386
|
});
|
|
9329
9387
|
|
|
9330
9388
|
case 2:
|
|
9331
|
-
return
|
|
9389
|
+
return _context52.abrupt("return", _context52.sent);
|
|
9332
9390
|
|
|
9333
9391
|
case 3:
|
|
9334
9392
|
case "end":
|
|
9335
|
-
return
|
|
9393
|
+
return _context52.stop();
|
|
9336
9394
|
}
|
|
9337
9395
|
}
|
|
9338
|
-
},
|
|
9396
|
+
}, _callee52, this);
|
|
9339
9397
|
}));
|
|
9340
9398
|
|
|
9341
9399
|
function sendUserCustomEvent(_x69, _x70) {
|
|
@@ -9406,29 +9464,29 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9406
9464
|
}, {
|
|
9407
9465
|
key: "createSegment",
|
|
9408
9466
|
value: function () {
|
|
9409
|
-
var _createSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9467
|
+
var _createSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee53(params) {
|
|
9410
9468
|
var _yield$this$post, segment;
|
|
9411
9469
|
|
|
9412
|
-
return _regeneratorRuntime.wrap(function
|
|
9470
|
+
return _regeneratorRuntime.wrap(function _callee53$(_context53) {
|
|
9413
9471
|
while (1) {
|
|
9414
|
-
switch (
|
|
9472
|
+
switch (_context53.prev = _context53.next) {
|
|
9415
9473
|
case 0:
|
|
9416
|
-
|
|
9474
|
+
_context53.next = 2;
|
|
9417
9475
|
return this.post(this.baseURL + "/segments", {
|
|
9418
9476
|
segment: params
|
|
9419
9477
|
});
|
|
9420
9478
|
|
|
9421
9479
|
case 2:
|
|
9422
|
-
_yield$this$post =
|
|
9480
|
+
_yield$this$post = _context53.sent;
|
|
9423
9481
|
segment = _yield$this$post.segment;
|
|
9424
|
-
return
|
|
9482
|
+
return _context53.abrupt("return", segment);
|
|
9425
9483
|
|
|
9426
9484
|
case 5:
|
|
9427
9485
|
case "end":
|
|
9428
|
-
return
|
|
9486
|
+
return _context53.stop();
|
|
9429
9487
|
}
|
|
9430
9488
|
}
|
|
9431
|
-
},
|
|
9489
|
+
}, _callee53, this);
|
|
9432
9490
|
}));
|
|
9433
9491
|
|
|
9434
9492
|
function createSegment(_x71) {
|
|
@@ -9448,27 +9506,27 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9448
9506
|
}, {
|
|
9449
9507
|
key: "getSegment",
|
|
9450
9508
|
value: function () {
|
|
9451
|
-
var _getSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9509
|
+
var _getSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee54(id) {
|
|
9452
9510
|
var _yield$this$get, segment;
|
|
9453
9511
|
|
|
9454
|
-
return _regeneratorRuntime.wrap(function
|
|
9512
|
+
return _regeneratorRuntime.wrap(function _callee54$(_context54) {
|
|
9455
9513
|
while (1) {
|
|
9456
|
-
switch (
|
|
9514
|
+
switch (_context54.prev = _context54.next) {
|
|
9457
9515
|
case 0:
|
|
9458
|
-
|
|
9516
|
+
_context54.next = 2;
|
|
9459
9517
|
return this.get(this.baseURL + "/segments/".concat(id));
|
|
9460
9518
|
|
|
9461
9519
|
case 2:
|
|
9462
|
-
_yield$this$get =
|
|
9520
|
+
_yield$this$get = _context54.sent;
|
|
9463
9521
|
segment = _yield$this$get.segment;
|
|
9464
|
-
return
|
|
9522
|
+
return _context54.abrupt("return", segment);
|
|
9465
9523
|
|
|
9466
9524
|
case 5:
|
|
9467
9525
|
case "end":
|
|
9468
|
-
return
|
|
9526
|
+
return _context54.stop();
|
|
9469
9527
|
}
|
|
9470
9528
|
}
|
|
9471
|
-
},
|
|
9529
|
+
}, _callee54, this);
|
|
9472
9530
|
}));
|
|
9473
9531
|
|
|
9474
9532
|
function getSegment(_x72) {
|
|
@@ -9487,27 +9545,27 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9487
9545
|
}, {
|
|
9488
9546
|
key: "listSegments",
|
|
9489
9547
|
value: function () {
|
|
9490
|
-
var _listSegments = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9548
|
+
var _listSegments = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee55(options) {
|
|
9491
9549
|
var _yield$this$get2, segments;
|
|
9492
9550
|
|
|
9493
|
-
return _regeneratorRuntime.wrap(function
|
|
9551
|
+
return _regeneratorRuntime.wrap(function _callee55$(_context55) {
|
|
9494
9552
|
while (1) {
|
|
9495
|
-
switch (
|
|
9553
|
+
switch (_context55.prev = _context55.next) {
|
|
9496
9554
|
case 0:
|
|
9497
|
-
|
|
9555
|
+
_context55.next = 2;
|
|
9498
9556
|
return this.get(this.baseURL + "/segments", options);
|
|
9499
9557
|
|
|
9500
9558
|
case 2:
|
|
9501
|
-
_yield$this$get2 =
|
|
9559
|
+
_yield$this$get2 = _context55.sent;
|
|
9502
9560
|
segments = _yield$this$get2.segments;
|
|
9503
|
-
return
|
|
9561
|
+
return _context55.abrupt("return", segments);
|
|
9504
9562
|
|
|
9505
9563
|
case 5:
|
|
9506
9564
|
case "end":
|
|
9507
|
-
return
|
|
9565
|
+
return _context55.stop();
|
|
9508
9566
|
}
|
|
9509
9567
|
}
|
|
9510
|
-
},
|
|
9568
|
+
}, _callee55, this);
|
|
9511
9569
|
}));
|
|
9512
9570
|
|
|
9513
9571
|
function listSegments(_x73) {
|
|
@@ -9528,29 +9586,29 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9528
9586
|
}, {
|
|
9529
9587
|
key: "updateSegment",
|
|
9530
9588
|
value: function () {
|
|
9531
|
-
var _updateSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9589
|
+
var _updateSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee56(id, params) {
|
|
9532
9590
|
var _yield$this$put, segment;
|
|
9533
9591
|
|
|
9534
|
-
return _regeneratorRuntime.wrap(function
|
|
9592
|
+
return _regeneratorRuntime.wrap(function _callee56$(_context56) {
|
|
9535
9593
|
while (1) {
|
|
9536
|
-
switch (
|
|
9594
|
+
switch (_context56.prev = _context56.next) {
|
|
9537
9595
|
case 0:
|
|
9538
|
-
|
|
9596
|
+
_context56.next = 2;
|
|
9539
9597
|
return this.put(this.baseURL + "/segments/".concat(id), {
|
|
9540
9598
|
segment: params
|
|
9541
9599
|
});
|
|
9542
9600
|
|
|
9543
9601
|
case 2:
|
|
9544
|
-
_yield$this$put =
|
|
9602
|
+
_yield$this$put = _context56.sent;
|
|
9545
9603
|
segment = _yield$this$put.segment;
|
|
9546
|
-
return
|
|
9604
|
+
return _context56.abrupt("return", segment);
|
|
9547
9605
|
|
|
9548
9606
|
case 5:
|
|
9549
9607
|
case "end":
|
|
9550
|
-
return
|
|
9608
|
+
return _context56.stop();
|
|
9551
9609
|
}
|
|
9552
9610
|
}
|
|
9553
|
-
},
|
|
9611
|
+
}, _callee56, this);
|
|
9554
9612
|
}));
|
|
9555
9613
|
|
|
9556
9614
|
function updateSegment(_x74, _x75) {
|
|
@@ -9570,19 +9628,19 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9570
9628
|
}, {
|
|
9571
9629
|
key: "deleteSegment",
|
|
9572
9630
|
value: function () {
|
|
9573
|
-
var _deleteSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9574
|
-
return _regeneratorRuntime.wrap(function
|
|
9631
|
+
var _deleteSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee57(id) {
|
|
9632
|
+
return _regeneratorRuntime.wrap(function _callee57$(_context57) {
|
|
9575
9633
|
while (1) {
|
|
9576
|
-
switch (
|
|
9634
|
+
switch (_context57.prev = _context57.next) {
|
|
9577
9635
|
case 0:
|
|
9578
|
-
return
|
|
9636
|
+
return _context57.abrupt("return", this.delete(this.baseURL + "/segments/".concat(id)));
|
|
9579
9637
|
|
|
9580
9638
|
case 1:
|
|
9581
9639
|
case "end":
|
|
9582
|
-
return
|
|
9640
|
+
return _context57.stop();
|
|
9583
9641
|
}
|
|
9584
9642
|
}
|
|
9585
|
-
},
|
|
9643
|
+
}, _callee57, this);
|
|
9586
9644
|
}));
|
|
9587
9645
|
|
|
9588
9646
|
function deleteSegment(_x76) {
|
|
@@ -9602,29 +9660,29 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9602
9660
|
}, {
|
|
9603
9661
|
key: "createCampaign",
|
|
9604
9662
|
value: function () {
|
|
9605
|
-
var _createCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9663
|
+
var _createCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee58(params) {
|
|
9606
9664
|
var _yield$this$post2, campaign;
|
|
9607
9665
|
|
|
9608
|
-
return _regeneratorRuntime.wrap(function
|
|
9666
|
+
return _regeneratorRuntime.wrap(function _callee58$(_context58) {
|
|
9609
9667
|
while (1) {
|
|
9610
|
-
switch (
|
|
9668
|
+
switch (_context58.prev = _context58.next) {
|
|
9611
9669
|
case 0:
|
|
9612
|
-
|
|
9670
|
+
_context58.next = 2;
|
|
9613
9671
|
return this.post(this.baseURL + "/campaigns", {
|
|
9614
9672
|
campaign: params
|
|
9615
9673
|
});
|
|
9616
9674
|
|
|
9617
9675
|
case 2:
|
|
9618
|
-
_yield$this$post2 =
|
|
9676
|
+
_yield$this$post2 = _context58.sent;
|
|
9619
9677
|
campaign = _yield$this$post2.campaign;
|
|
9620
|
-
return
|
|
9678
|
+
return _context58.abrupt("return", campaign);
|
|
9621
9679
|
|
|
9622
9680
|
case 5:
|
|
9623
9681
|
case "end":
|
|
9624
|
-
return
|
|
9682
|
+
return _context58.stop();
|
|
9625
9683
|
}
|
|
9626
9684
|
}
|
|
9627
|
-
},
|
|
9685
|
+
}, _callee58, this);
|
|
9628
9686
|
}));
|
|
9629
9687
|
|
|
9630
9688
|
function createCampaign(_x77) {
|
|
@@ -9644,27 +9702,27 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9644
9702
|
}, {
|
|
9645
9703
|
key: "getCampaign",
|
|
9646
9704
|
value: function () {
|
|
9647
|
-
var _getCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9705
|
+
var _getCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee59(id) {
|
|
9648
9706
|
var _yield$this$get3, campaign;
|
|
9649
9707
|
|
|
9650
|
-
return _regeneratorRuntime.wrap(function
|
|
9708
|
+
return _regeneratorRuntime.wrap(function _callee59$(_context59) {
|
|
9651
9709
|
while (1) {
|
|
9652
|
-
switch (
|
|
9710
|
+
switch (_context59.prev = _context59.next) {
|
|
9653
9711
|
case 0:
|
|
9654
|
-
|
|
9712
|
+
_context59.next = 2;
|
|
9655
9713
|
return this.get(this.baseURL + "/campaigns/".concat(id));
|
|
9656
9714
|
|
|
9657
9715
|
case 2:
|
|
9658
|
-
_yield$this$get3 =
|
|
9716
|
+
_yield$this$get3 = _context59.sent;
|
|
9659
9717
|
campaign = _yield$this$get3.campaign;
|
|
9660
|
-
return
|
|
9718
|
+
return _context59.abrupt("return", campaign);
|
|
9661
9719
|
|
|
9662
9720
|
case 5:
|
|
9663
9721
|
case "end":
|
|
9664
|
-
return
|
|
9722
|
+
return _context59.stop();
|
|
9665
9723
|
}
|
|
9666
9724
|
}
|
|
9667
|
-
},
|
|
9725
|
+
}, _callee59, this);
|
|
9668
9726
|
}));
|
|
9669
9727
|
|
|
9670
9728
|
function getCampaign(_x78) {
|
|
@@ -9683,27 +9741,27 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9683
9741
|
}, {
|
|
9684
9742
|
key: "listCampaigns",
|
|
9685
9743
|
value: function () {
|
|
9686
|
-
var _listCampaigns = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9744
|
+
var _listCampaigns = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee60(options) {
|
|
9687
9745
|
var _yield$this$get4, campaigns;
|
|
9688
9746
|
|
|
9689
|
-
return _regeneratorRuntime.wrap(function
|
|
9747
|
+
return _regeneratorRuntime.wrap(function _callee60$(_context60) {
|
|
9690
9748
|
while (1) {
|
|
9691
|
-
switch (
|
|
9749
|
+
switch (_context60.prev = _context60.next) {
|
|
9692
9750
|
case 0:
|
|
9693
|
-
|
|
9751
|
+
_context60.next = 2;
|
|
9694
9752
|
return this.get(this.baseURL + "/campaigns", options);
|
|
9695
9753
|
|
|
9696
9754
|
case 2:
|
|
9697
|
-
_yield$this$get4 =
|
|
9755
|
+
_yield$this$get4 = _context60.sent;
|
|
9698
9756
|
campaigns = _yield$this$get4.campaigns;
|
|
9699
|
-
return
|
|
9757
|
+
return _context60.abrupt("return", campaigns);
|
|
9700
9758
|
|
|
9701
9759
|
case 5:
|
|
9702
9760
|
case "end":
|
|
9703
|
-
return
|
|
9761
|
+
return _context60.stop();
|
|
9704
9762
|
}
|
|
9705
9763
|
}
|
|
9706
|
-
},
|
|
9764
|
+
}, _callee60, this);
|
|
9707
9765
|
}));
|
|
9708
9766
|
|
|
9709
9767
|
function listCampaigns(_x79) {
|
|
@@ -9724,29 +9782,29 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9724
9782
|
}, {
|
|
9725
9783
|
key: "updateCampaign",
|
|
9726
9784
|
value: function () {
|
|
9727
|
-
var _updateCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9785
|
+
var _updateCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee61(id, params) {
|
|
9728
9786
|
var _yield$this$put2, campaign;
|
|
9729
9787
|
|
|
9730
|
-
return _regeneratorRuntime.wrap(function
|
|
9788
|
+
return _regeneratorRuntime.wrap(function _callee61$(_context61) {
|
|
9731
9789
|
while (1) {
|
|
9732
|
-
switch (
|
|
9790
|
+
switch (_context61.prev = _context61.next) {
|
|
9733
9791
|
case 0:
|
|
9734
|
-
|
|
9792
|
+
_context61.next = 2;
|
|
9735
9793
|
return this.put(this.baseURL + "/campaigns/".concat(id), {
|
|
9736
9794
|
campaign: params
|
|
9737
9795
|
});
|
|
9738
9796
|
|
|
9739
9797
|
case 2:
|
|
9740
|
-
_yield$this$put2 =
|
|
9798
|
+
_yield$this$put2 = _context61.sent;
|
|
9741
9799
|
campaign = _yield$this$put2.campaign;
|
|
9742
|
-
return
|
|
9800
|
+
return _context61.abrupt("return", campaign);
|
|
9743
9801
|
|
|
9744
9802
|
case 5:
|
|
9745
9803
|
case "end":
|
|
9746
|
-
return
|
|
9804
|
+
return _context61.stop();
|
|
9747
9805
|
}
|
|
9748
9806
|
}
|
|
9749
|
-
},
|
|
9807
|
+
}, _callee61, this);
|
|
9750
9808
|
}));
|
|
9751
9809
|
|
|
9752
9810
|
function updateCampaign(_x80, _x81) {
|
|
@@ -9766,19 +9824,19 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9766
9824
|
}, {
|
|
9767
9825
|
key: "deleteCampaign",
|
|
9768
9826
|
value: function () {
|
|
9769
|
-
var _deleteCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9770
|
-
return _regeneratorRuntime.wrap(function
|
|
9827
|
+
var _deleteCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee62(id) {
|
|
9828
|
+
return _regeneratorRuntime.wrap(function _callee62$(_context62) {
|
|
9771
9829
|
while (1) {
|
|
9772
|
-
switch (
|
|
9830
|
+
switch (_context62.prev = _context62.next) {
|
|
9773
9831
|
case 0:
|
|
9774
|
-
return
|
|
9832
|
+
return _context62.abrupt("return", this.delete(this.baseURL + "/campaigns/".concat(id)));
|
|
9775
9833
|
|
|
9776
9834
|
case 1:
|
|
9777
9835
|
case "end":
|
|
9778
|
-
return
|
|
9836
|
+
return _context62.stop();
|
|
9779
9837
|
}
|
|
9780
9838
|
}
|
|
9781
|
-
},
|
|
9839
|
+
}, _callee62, this);
|
|
9782
9840
|
}));
|
|
9783
9841
|
|
|
9784
9842
|
function deleteCampaign(_x82) {
|
|
@@ -9799,30 +9857,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9799
9857
|
}, {
|
|
9800
9858
|
key: "scheduleCampaign",
|
|
9801
9859
|
value: function () {
|
|
9802
|
-
var _scheduleCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9860
|
+
var _scheduleCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee63(id, params) {
|
|
9803
9861
|
var sendAt, _yield$this$patch, campaign;
|
|
9804
9862
|
|
|
9805
|
-
return _regeneratorRuntime.wrap(function
|
|
9863
|
+
return _regeneratorRuntime.wrap(function _callee63$(_context63) {
|
|
9806
9864
|
while (1) {
|
|
9807
|
-
switch (
|
|
9865
|
+
switch (_context63.prev = _context63.next) {
|
|
9808
9866
|
case 0:
|
|
9809
9867
|
sendAt = params.sendAt;
|
|
9810
|
-
|
|
9868
|
+
_context63.next = 3;
|
|
9811
9869
|
return this.patch(this.baseURL + "/campaigns/".concat(id, "/schedule"), {
|
|
9812
9870
|
send_at: sendAt
|
|
9813
9871
|
});
|
|
9814
9872
|
|
|
9815
9873
|
case 3:
|
|
9816
|
-
_yield$this$patch =
|
|
9874
|
+
_yield$this$patch = _context63.sent;
|
|
9817
9875
|
campaign = _yield$this$patch.campaign;
|
|
9818
|
-
return
|
|
9876
|
+
return _context63.abrupt("return", campaign);
|
|
9819
9877
|
|
|
9820
9878
|
case 6:
|
|
9821
9879
|
case "end":
|
|
9822
|
-
return
|
|
9880
|
+
return _context63.stop();
|
|
9823
9881
|
}
|
|
9824
9882
|
}
|
|
9825
|
-
},
|
|
9883
|
+
}, _callee63, this);
|
|
9826
9884
|
}));
|
|
9827
9885
|
|
|
9828
9886
|
function scheduleCampaign(_x83, _x84) {
|
|
@@ -9842,27 +9900,27 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9842
9900
|
}, {
|
|
9843
9901
|
key: "stopCampaign",
|
|
9844
9902
|
value: function () {
|
|
9845
|
-
var _stopCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9903
|
+
var _stopCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee64(id) {
|
|
9846
9904
|
var _yield$this$patch2, campaign;
|
|
9847
9905
|
|
|
9848
|
-
return _regeneratorRuntime.wrap(function
|
|
9906
|
+
return _regeneratorRuntime.wrap(function _callee64$(_context64) {
|
|
9849
9907
|
while (1) {
|
|
9850
|
-
switch (
|
|
9908
|
+
switch (_context64.prev = _context64.next) {
|
|
9851
9909
|
case 0:
|
|
9852
|
-
|
|
9910
|
+
_context64.next = 2;
|
|
9853
9911
|
return this.patch(this.baseURL + "/campaigns/".concat(id, "/stop"));
|
|
9854
9912
|
|
|
9855
9913
|
case 2:
|
|
9856
|
-
_yield$this$patch2 =
|
|
9914
|
+
_yield$this$patch2 = _context64.sent;
|
|
9857
9915
|
campaign = _yield$this$patch2.campaign;
|
|
9858
|
-
return
|
|
9916
|
+
return _context64.abrupt("return", campaign);
|
|
9859
9917
|
|
|
9860
9918
|
case 5:
|
|
9861
9919
|
case "end":
|
|
9862
|
-
return
|
|
9920
|
+
return _context64.stop();
|
|
9863
9921
|
}
|
|
9864
9922
|
}
|
|
9865
|
-
},
|
|
9923
|
+
}, _callee64, this);
|
|
9866
9924
|
}));
|
|
9867
9925
|
|
|
9868
9926
|
function stopCampaign(_x85) {
|
|
@@ -9882,27 +9940,27 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9882
9940
|
}, {
|
|
9883
9941
|
key: "resumeCampaign",
|
|
9884
9942
|
value: function () {
|
|
9885
|
-
var _resumeCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9943
|
+
var _resumeCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee65(id) {
|
|
9886
9944
|
var _yield$this$patch3, campaign;
|
|
9887
9945
|
|
|
9888
|
-
return _regeneratorRuntime.wrap(function
|
|
9946
|
+
return _regeneratorRuntime.wrap(function _callee65$(_context65) {
|
|
9889
9947
|
while (1) {
|
|
9890
|
-
switch (
|
|
9948
|
+
switch (_context65.prev = _context65.next) {
|
|
9891
9949
|
case 0:
|
|
9892
|
-
|
|
9950
|
+
_context65.next = 2;
|
|
9893
9951
|
return this.patch(this.baseURL + "/campaigns/".concat(id, "/resume"));
|
|
9894
9952
|
|
|
9895
9953
|
case 2:
|
|
9896
|
-
_yield$this$patch3 =
|
|
9954
|
+
_yield$this$patch3 = _context65.sent;
|
|
9897
9955
|
campaign = _yield$this$patch3.campaign;
|
|
9898
|
-
return
|
|
9956
|
+
return _context65.abrupt("return", campaign);
|
|
9899
9957
|
|
|
9900
9958
|
case 5:
|
|
9901
9959
|
case "end":
|
|
9902
|
-
return
|
|
9960
|
+
return _context65.stop();
|
|
9903
9961
|
}
|
|
9904
9962
|
}
|
|
9905
|
-
},
|
|
9963
|
+
}, _callee65, this);
|
|
9906
9964
|
}));
|
|
9907
9965
|
|
|
9908
9966
|
function resumeCampaign(_x86) {
|
|
@@ -9922,30 +9980,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9922
9980
|
}, {
|
|
9923
9981
|
key: "testCampaign",
|
|
9924
9982
|
value: function () {
|
|
9925
|
-
var _testCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9983
|
+
var _testCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee66(id, params) {
|
|
9926
9984
|
var users, _yield$this$post3, campaign;
|
|
9927
9985
|
|
|
9928
|
-
return _regeneratorRuntime.wrap(function
|
|
9986
|
+
return _regeneratorRuntime.wrap(function _callee66$(_context66) {
|
|
9929
9987
|
while (1) {
|
|
9930
|
-
switch (
|
|
9988
|
+
switch (_context66.prev = _context66.next) {
|
|
9931
9989
|
case 0:
|
|
9932
9990
|
users = params.users;
|
|
9933
|
-
|
|
9991
|
+
_context66.next = 3;
|
|
9934
9992
|
return this.post(this.baseURL + "/campaigns/".concat(id, "/test"), {
|
|
9935
9993
|
users: users
|
|
9936
9994
|
});
|
|
9937
9995
|
|
|
9938
9996
|
case 3:
|
|
9939
|
-
_yield$this$post3 =
|
|
9997
|
+
_yield$this$post3 = _context66.sent;
|
|
9940
9998
|
campaign = _yield$this$post3.campaign;
|
|
9941
|
-
return
|
|
9999
|
+
return _context66.abrupt("return", campaign);
|
|
9942
10000
|
|
|
9943
10001
|
case 6:
|
|
9944
10002
|
case "end":
|
|
9945
|
-
return
|
|
10003
|
+
return _context66.stop();
|
|
9946
10004
|
}
|
|
9947
10005
|
}
|
|
9948
|
-
},
|
|
10006
|
+
}, _callee66, this);
|
|
9949
10007
|
}));
|
|
9950
10008
|
|
|
9951
10009
|
function testCampaign(_x87, _x88) {
|
|
@@ -9964,21 +10022,21 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9964
10022
|
}, {
|
|
9965
10023
|
key: "enrichURL",
|
|
9966
10024
|
value: function () {
|
|
9967
|
-
var _enrichURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9968
|
-
return _regeneratorRuntime.wrap(function
|
|
10025
|
+
var _enrichURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee67(url) {
|
|
10026
|
+
return _regeneratorRuntime.wrap(function _callee67$(_context67) {
|
|
9969
10027
|
while (1) {
|
|
9970
|
-
switch (
|
|
10028
|
+
switch (_context67.prev = _context67.next) {
|
|
9971
10029
|
case 0:
|
|
9972
|
-
return
|
|
10030
|
+
return _context67.abrupt("return", this.get(this.baseURL + "/og", {
|
|
9973
10031
|
url: url
|
|
9974
10032
|
}));
|
|
9975
10033
|
|
|
9976
10034
|
case 1:
|
|
9977
10035
|
case "end":
|
|
9978
|
-
return
|
|
10036
|
+
return _context67.stop();
|
|
9979
10037
|
}
|
|
9980
10038
|
}
|
|
9981
|
-
},
|
|
10039
|
+
}, _callee67, this);
|
|
9982
10040
|
}));
|
|
9983
10041
|
|
|
9984
10042
|
function enrichURL(_x89) {
|
|
@@ -9998,19 +10056,19 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9998
10056
|
}, {
|
|
9999
10057
|
key: "getTask",
|
|
10000
10058
|
value: function () {
|
|
10001
|
-
var _getTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
10002
|
-
return _regeneratorRuntime.wrap(function
|
|
10059
|
+
var _getTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee68(id) {
|
|
10060
|
+
return _regeneratorRuntime.wrap(function _callee68$(_context68) {
|
|
10003
10061
|
while (1) {
|
|
10004
|
-
switch (
|
|
10062
|
+
switch (_context68.prev = _context68.next) {
|
|
10005
10063
|
case 0:
|
|
10006
|
-
return
|
|
10064
|
+
return _context68.abrupt("return", this.get("".concat(this.baseURL, "/tasks/").concat(id)));
|
|
10007
10065
|
|
|
10008
10066
|
case 1:
|
|
10009
10067
|
case "end":
|
|
10010
|
-
return
|
|
10068
|
+
return _context68.stop();
|
|
10011
10069
|
}
|
|
10012
10070
|
}
|
|
10013
|
-
},
|
|
10071
|
+
}, _callee68, this);
|
|
10014
10072
|
}));
|
|
10015
10073
|
|
|
10016
10074
|
function getTask(_x90) {
|
|
@@ -10031,28 +10089,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10031
10089
|
}, {
|
|
10032
10090
|
key: "deleteChannels",
|
|
10033
10091
|
value: function () {
|
|
10034
|
-
var _deleteChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
10092
|
+
var _deleteChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee69(cids) {
|
|
10035
10093
|
var options,
|
|
10036
|
-
|
|
10037
|
-
return _regeneratorRuntime.wrap(function
|
|
10094
|
+
_args69 = arguments;
|
|
10095
|
+
return _regeneratorRuntime.wrap(function _callee69$(_context69) {
|
|
10038
10096
|
while (1) {
|
|
10039
|
-
switch (
|
|
10097
|
+
switch (_context69.prev = _context69.next) {
|
|
10040
10098
|
case 0:
|
|
10041
|
-
options =
|
|
10042
|
-
|
|
10099
|
+
options = _args69.length > 1 && _args69[1] !== undefined ? _args69[1] : {};
|
|
10100
|
+
_context69.next = 3;
|
|
10043
10101
|
return this.post(this.baseURL + "/channels/delete", _objectSpread({
|
|
10044
10102
|
cids: cids
|
|
10045
10103
|
}, options));
|
|
10046
10104
|
|
|
10047
10105
|
case 3:
|
|
10048
|
-
return
|
|
10106
|
+
return _context69.abrupt("return", _context69.sent);
|
|
10049
10107
|
|
|
10050
10108
|
case 4:
|
|
10051
10109
|
case "end":
|
|
10052
|
-
return
|
|
10110
|
+
return _context69.stop();
|
|
10053
10111
|
}
|
|
10054
10112
|
}
|
|
10055
|
-
},
|
|
10113
|
+
}, _callee69, this);
|
|
10056
10114
|
}));
|
|
10057
10115
|
|
|
10058
10116
|
function deleteChannels(_x91) {
|
|
@@ -10073,13 +10131,13 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10073
10131
|
}, {
|
|
10074
10132
|
key: "deleteUsers",
|
|
10075
10133
|
value: function () {
|
|
10076
|
-
var _deleteUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
10077
|
-
return _regeneratorRuntime.wrap(function
|
|
10134
|
+
var _deleteUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee70(user_ids, options) {
|
|
10135
|
+
return _regeneratorRuntime.wrap(function _callee70$(_context70) {
|
|
10078
10136
|
while (1) {
|
|
10079
|
-
switch (
|
|
10137
|
+
switch (_context70.prev = _context70.next) {
|
|
10080
10138
|
case 0:
|
|
10081
10139
|
if (!((options === null || options === void 0 ? void 0 : options.user) !== 'soft' && (options === null || options === void 0 ? void 0 : options.user) !== 'hard')) {
|
|
10082
|
-
|
|
10140
|
+
_context70.next = 2;
|
|
10083
10141
|
break;
|
|
10084
10142
|
}
|
|
10085
10143
|
|
|
@@ -10087,7 +10145,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10087
10145
|
|
|
10088
10146
|
case 2:
|
|
10089
10147
|
if (!(options.messages !== undefined && options.messages !== 'soft' && options.messages !== 'hard')) {
|
|
10090
|
-
|
|
10148
|
+
_context70.next = 4;
|
|
10091
10149
|
break;
|
|
10092
10150
|
}
|
|
10093
10151
|
|
|
@@ -10095,27 +10153,27 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10095
10153
|
|
|
10096
10154
|
case 4:
|
|
10097
10155
|
if (!(options.conversations !== undefined && options.conversations !== 'soft' && options.conversations !== 'hard')) {
|
|
10098
|
-
|
|
10156
|
+
_context70.next = 6;
|
|
10099
10157
|
break;
|
|
10100
10158
|
}
|
|
10101
10159
|
|
|
10102
10160
|
throw new Error('Invalid delete user options. conversations must be one of [soft hard]');
|
|
10103
10161
|
|
|
10104
10162
|
case 6:
|
|
10105
|
-
|
|
10163
|
+
_context70.next = 8;
|
|
10106
10164
|
return this.post(this.baseURL + "/users/delete", _objectSpread({
|
|
10107
10165
|
user_ids: user_ids
|
|
10108
10166
|
}, options));
|
|
10109
10167
|
|
|
10110
10168
|
case 8:
|
|
10111
|
-
return
|
|
10169
|
+
return _context70.abrupt("return", _context70.sent);
|
|
10112
10170
|
|
|
10113
10171
|
case 9:
|
|
10114
10172
|
case "end":
|
|
10115
|
-
return
|
|
10173
|
+
return _context70.stop();
|
|
10116
10174
|
}
|
|
10117
10175
|
}
|
|
10118
|
-
},
|
|
10176
|
+
}, _callee70, this);
|
|
10119
10177
|
}));
|
|
10120
10178
|
|
|
10121
10179
|
function deleteUsers(_x92, _x93) {
|
|
@@ -10140,25 +10198,25 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10140
10198
|
}, {
|
|
10141
10199
|
key: "_createImport",
|
|
10142
10200
|
value: function () {
|
|
10143
|
-
var _createImport2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
10144
|
-
return _regeneratorRuntime.wrap(function
|
|
10201
|
+
var _createImport2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee71(filename) {
|
|
10202
|
+
return _regeneratorRuntime.wrap(function _callee71$(_context71) {
|
|
10145
10203
|
while (1) {
|
|
10146
|
-
switch (
|
|
10204
|
+
switch (_context71.prev = _context71.next) {
|
|
10147
10205
|
case 0:
|
|
10148
|
-
|
|
10206
|
+
_context71.next = 2;
|
|
10149
10207
|
return this.post(this.baseURL + "/imports", {
|
|
10150
10208
|
filename: filename
|
|
10151
10209
|
});
|
|
10152
10210
|
|
|
10153
10211
|
case 2:
|
|
10154
|
-
return
|
|
10212
|
+
return _context71.abrupt("return", _context71.sent);
|
|
10155
10213
|
|
|
10156
10214
|
case 3:
|
|
10157
10215
|
case "end":
|
|
10158
|
-
return
|
|
10216
|
+
return _context71.stop();
|
|
10159
10217
|
}
|
|
10160
10218
|
}
|
|
10161
|
-
},
|
|
10219
|
+
}, _callee71, this);
|
|
10162
10220
|
}));
|
|
10163
10221
|
|
|
10164
10222
|
function _createImport(_x94) {
|
|
@@ -10183,23 +10241,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10183
10241
|
}, {
|
|
10184
10242
|
key: "_getImport",
|
|
10185
10243
|
value: function () {
|
|
10186
|
-
var _getImport2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
10187
|
-
return _regeneratorRuntime.wrap(function
|
|
10244
|
+
var _getImport2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee72(id) {
|
|
10245
|
+
return _regeneratorRuntime.wrap(function _callee72$(_context72) {
|
|
10188
10246
|
while (1) {
|
|
10189
|
-
switch (
|
|
10247
|
+
switch (_context72.prev = _context72.next) {
|
|
10190
10248
|
case 0:
|
|
10191
|
-
|
|
10249
|
+
_context72.next = 2;
|
|
10192
10250
|
return this.get(this.baseURL + "/imports/".concat(id));
|
|
10193
10251
|
|
|
10194
10252
|
case 2:
|
|
10195
|
-
return
|
|
10253
|
+
return _context72.abrupt("return", _context72.sent);
|
|
10196
10254
|
|
|
10197
10255
|
case 3:
|
|
10198
10256
|
case "end":
|
|
10199
|
-
return
|
|
10257
|
+
return _context72.stop();
|
|
10200
10258
|
}
|
|
10201
10259
|
}
|
|
10202
|
-
},
|
|
10260
|
+
}, _callee72, this);
|
|
10203
10261
|
}));
|
|
10204
10262
|
|
|
10205
10263
|
function _getImport(_x95) {
|
|
@@ -10224,23 +10282,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10224
10282
|
}, {
|
|
10225
10283
|
key: "_listImports",
|
|
10226
10284
|
value: function () {
|
|
10227
|
-
var _listImports2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
10228
|
-
return _regeneratorRuntime.wrap(function
|
|
10285
|
+
var _listImports2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee73(options) {
|
|
10286
|
+
return _regeneratorRuntime.wrap(function _callee73$(_context73) {
|
|
10229
10287
|
while (1) {
|
|
10230
|
-
switch (
|
|
10288
|
+
switch (_context73.prev = _context73.next) {
|
|
10231
10289
|
case 0:
|
|
10232
|
-
|
|
10290
|
+
_context73.next = 2;
|
|
10233
10291
|
return this.get(this.baseURL + "/imports", options);
|
|
10234
10292
|
|
|
10235
10293
|
case 2:
|
|
10236
|
-
return
|
|
10294
|
+
return _context73.abrupt("return", _context73.sent);
|
|
10237
10295
|
|
|
10238
10296
|
case 3:
|
|
10239
10297
|
case "end":
|
|
10240
|
-
return
|
|
10298
|
+
return _context73.stop();
|
|
10241
10299
|
}
|
|
10242
10300
|
}
|
|
10243
|
-
},
|
|
10301
|
+
}, _callee73, this);
|
|
10244
10302
|
}));
|
|
10245
10303
|
|
|
10246
10304
|
function _listImports(_x96) {
|