stream-chat 8.14.4 → 8.15.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 +868 -627
- 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 +868 -627
- package/dist/browser.js.map +1 -1
- package/dist/index.es.js +868 -627
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +868 -627
- package/dist/index.js.map +1 -1
- package/dist/types/channel.d.ts.map +1 -1
- package/dist/types/channel_state.d.ts +1 -0
- package/dist/types/channel_state.d.ts.map +1 -1
- package/dist/types/client.d.ts +109 -28
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/events.d.ts +1 -0
- package/dist/types/events.d.ts.map +1 -1
- package/dist/types/types.d.ts +48 -23
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/channel.ts +28 -16
- package/src/channel_state.ts +7 -1
- package/src/client.ts +122 -50
- package/src/events.ts +1 -0
- package/src/types.ts +73 -29
package/dist/index.js
CHANGED
|
@@ -1568,7 +1568,6 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1568
1568
|
key: "sendMessage",
|
|
1569
1569
|
value: function () {
|
|
1570
1570
|
var _sendMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(message, options) {
|
|
1571
|
-
var sendMessageResponse;
|
|
1572
1571
|
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
|
1573
1572
|
while (1) {
|
|
1574
1573
|
switch (_context2.prev = _context2.next) {
|
|
@@ -1579,12 +1578,9 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1579
1578
|
}, options));
|
|
1580
1579
|
|
|
1581
1580
|
case 2:
|
|
1582
|
-
|
|
1583
|
-
// Reset unreadCount to 0.
|
|
1584
|
-
this.state.unreadCount = 0;
|
|
1585
|
-
return _context2.abrupt("return", sendMessageResponse);
|
|
1581
|
+
return _context2.abrupt("return", _context2.sent);
|
|
1586
1582
|
|
|
1587
|
-
case
|
|
1583
|
+
case 3:
|
|
1588
1584
|
case "end":
|
|
1589
1585
|
return _context2.stop();
|
|
1590
1586
|
}
|
|
@@ -3665,7 +3661,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3665
3661
|
}, {
|
|
3666
3662
|
key: "_handleChannelEvent",
|
|
3667
3663
|
value: function _handleChannelEvent(event) {
|
|
3668
|
-
var _event$user, _event$user2, _event$user3, _event$user5, _event$user6, _event$channel, _event$member, _event$user9, _event$
|
|
3664
|
+
var _event$user, _event$user2, _event$user3, _event$user5, _event$user6, _event$channel, _event$member, _event$user9, _event$user11, _channelState$members, _event$user12, _channelState$members2;
|
|
3669
3665
|
|
|
3670
3666
|
var channel = this;
|
|
3671
3667
|
|
|
@@ -3696,7 +3692,6 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3696
3692
|
var _event$user4, _this$getClient$user;
|
|
3697
3693
|
|
|
3698
3694
|
channelState.read[event.user.id] = {
|
|
3699
|
-
// because in client.ts the handleEvent call that flows to this sets this `event.received_at = new Date();`
|
|
3700
3695
|
last_read: new Date(event.created_at),
|
|
3701
3696
|
last_read_message_id: event.last_read_message_id,
|
|
3702
3697
|
user: event.user,
|
|
@@ -3753,7 +3748,13 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3753
3748
|
|
|
3754
3749
|
if (event.message.pinned) {
|
|
3755
3750
|
channelState.addPinnedMessage(event.message);
|
|
3756
|
-
}
|
|
3751
|
+
} // do not increase the unread count - the back-end does not increase the count neither in the following cases:
|
|
3752
|
+
// 1. the message is mine
|
|
3753
|
+
// 2. the message is a thread reply from any user
|
|
3754
|
+
|
|
3755
|
+
|
|
3756
|
+
var preventUnreadCountUpdate = ownMessage || isThreadMessage;
|
|
3757
|
+
if (preventUnreadCountUpdate) break;
|
|
3757
3758
|
|
|
3758
3759
|
if ((_event$user8 = event.user) !== null && _event$user8 !== void 0 && _event$user8.id) {
|
|
3759
3760
|
for (var userId in channelState.read) {
|
|
@@ -3769,9 +3770,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3769
3770
|
}
|
|
3770
3771
|
}
|
|
3771
3772
|
|
|
3772
|
-
if (
|
|
3773
|
-
channelState.unreadCount = 0;
|
|
3774
|
-
} else if (this._countMessageAsUnread(event.message)) {
|
|
3773
|
+
if (this._countMessageAsUnread(event.message)) {
|
|
3775
3774
|
channelState.unreadCount = channelState.unreadCount + 1;
|
|
3776
3775
|
}
|
|
3777
3776
|
}
|
|
@@ -3844,6 +3843,25 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3844
3843
|
|
|
3845
3844
|
break;
|
|
3846
3845
|
|
|
3846
|
+
case 'notification.mark_unread':
|
|
3847
|
+
{
|
|
3848
|
+
var _event$user10, _this$getClient$user3, _event$unread_message;
|
|
3849
|
+
|
|
3850
|
+
var _ownMessage = ((_event$user10 = event.user) === null || _event$user10 === void 0 ? void 0 : _event$user10.id) === ((_this$getClient$user3 = this.getClient().user) === null || _this$getClient$user3 === void 0 ? void 0 : _this$getClient$user3.id);
|
|
3851
|
+
|
|
3852
|
+
if (!(_ownMessage && event.user)) break;
|
|
3853
|
+
var unreadCount = (_event$unread_message = event.unread_messages) !== null && _event$unread_message !== void 0 ? _event$unread_message : 0;
|
|
3854
|
+
channelState.read[event.user.id] = {
|
|
3855
|
+
first_unread_message_id: event.first_unread_message_id,
|
|
3856
|
+
last_read: new Date(event.last_read_at),
|
|
3857
|
+
last_read_message_id: event.last_read_message_id,
|
|
3858
|
+
user: event.user,
|
|
3859
|
+
unread_messages: unreadCount
|
|
3860
|
+
};
|
|
3861
|
+
channelState.unreadCount = unreadCount;
|
|
3862
|
+
break;
|
|
3863
|
+
}
|
|
3864
|
+
|
|
3847
3865
|
case 'channel.updated':
|
|
3848
3866
|
if (event.channel) {
|
|
3849
3867
|
var _event$channel2, _channel$data, _event$channel$hidden, _event$channel3, _channel$data2, _event$channel$own_ca, _event$channel4, _channel$data3;
|
|
@@ -3910,7 +3928,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3910
3928
|
break;
|
|
3911
3929
|
|
|
3912
3930
|
case 'user.banned':
|
|
3913
|
-
if (!((_event$
|
|
3931
|
+
if (!((_event$user11 = event.user) !== null && _event$user11 !== void 0 && _event$user11.id)) break;
|
|
3914
3932
|
channelState.members[event.user.id] = _objectSpread$5(_objectSpread$5({}, channelState.members[event.user.id] || {}), {}, {
|
|
3915
3933
|
shadow_banned: !!event.shadow,
|
|
3916
3934
|
banned: !event.shadow,
|
|
@@ -3919,7 +3937,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3919
3937
|
break;
|
|
3920
3938
|
|
|
3921
3939
|
case 'user.unbanned':
|
|
3922
|
-
if (!((_event$
|
|
3940
|
+
if (!((_event$user12 = event.user) !== null && _event$user12 !== void 0 && _event$user12.id)) break;
|
|
3923
3941
|
channelState.members[event.user.id] = _objectSpread$5(_objectSpread$5({}, channelState.members[event.user.id] || {}), {}, {
|
|
3924
3942
|
shadow_banned: false,
|
|
3925
3943
|
banned: false,
|
|
@@ -6100,11 +6118,18 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
6100
6118
|
/*
|
|
6101
6119
|
DeleteUserOptions specifies a collection of one or more `user_ids` to be deleted.
|
|
6102
6120
|
|
|
6103
|
-
`user
|
|
6104
|
-
|
|
6105
|
-
|
|
6106
|
-
|
|
6107
|
-
`
|
|
6121
|
+
`user`:
|
|
6122
|
+
- soft: marks user as deleted and retains all user data
|
|
6123
|
+
- pruning: marks user as deleted and nullifies user information
|
|
6124
|
+
- hard: deletes user completely - this requires hard option for messages and conversation as well
|
|
6125
|
+
`conversations`:
|
|
6126
|
+
- soft: marks all conversation channels as deleted (same effect as Delete Channels with 'hard' option disabled)
|
|
6127
|
+
- hard: deletes channel and all its data completely including messages (same effect as Delete Channels with 'hard' option enabled)
|
|
6128
|
+
`messages`:
|
|
6129
|
+
- soft: marks all user messages as deleted without removing any related message data
|
|
6130
|
+
- pruning: marks all user messages as deleted, nullifies message information and removes some message data such as reactions and flags
|
|
6131
|
+
- hard: deletes messages completely with all related information
|
|
6132
|
+
`new_channel_owner_id`: any channels owned by the hard-deleted user will be transferred to this user ID
|
|
6108
6133
|
*/
|
|
6109
6134
|
// TODO: add better typing
|
|
6110
6135
|
var ErrorFromResponse = /*#__PURE__*/function (_Error) {
|
|
@@ -8479,6 +8504,14 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8479
8504
|
|
|
8480
8505
|
return getDevices;
|
|
8481
8506
|
}()
|
|
8507
|
+
/**
|
|
8508
|
+
* getUnreadCount - Returns unread counts for a single user
|
|
8509
|
+
*
|
|
8510
|
+
* @param {string} [userID] User ID.
|
|
8511
|
+
*
|
|
8512
|
+
* @return {<GetUnreadCountAPIResponse>}
|
|
8513
|
+
*/
|
|
8514
|
+
|
|
8482
8515
|
}, {
|
|
8483
8516
|
key: "getUnreadCount",
|
|
8484
8517
|
value: function () {
|
|
@@ -8509,6 +8542,44 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8509
8542
|
|
|
8510
8543
|
return getUnreadCount;
|
|
8511
8544
|
}()
|
|
8545
|
+
/**
|
|
8546
|
+
* getUnreadCountBatch - Returns unread counts for multiple users at once. Only works server side.
|
|
8547
|
+
*
|
|
8548
|
+
* @param {string[]} [userIDs] List of user IDs to fetch unread counts for.
|
|
8549
|
+
*
|
|
8550
|
+
* @return {<GetUnreadCountBatchAPIResponse>}
|
|
8551
|
+
*/
|
|
8552
|
+
|
|
8553
|
+
}, {
|
|
8554
|
+
key: "getUnreadCountBatch",
|
|
8555
|
+
value: function () {
|
|
8556
|
+
var _getUnreadCountBatch = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee25(userIDs) {
|
|
8557
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee25$(_context25) {
|
|
8558
|
+
while (1) {
|
|
8559
|
+
switch (_context25.prev = _context25.next) {
|
|
8560
|
+
case 0:
|
|
8561
|
+
_context25.next = 2;
|
|
8562
|
+
return this.post(this.baseURL + '/unread_batch', {
|
|
8563
|
+
user_ids: userIDs
|
|
8564
|
+
});
|
|
8565
|
+
|
|
8566
|
+
case 2:
|
|
8567
|
+
return _context25.abrupt("return", _context25.sent);
|
|
8568
|
+
|
|
8569
|
+
case 3:
|
|
8570
|
+
case "end":
|
|
8571
|
+
return _context25.stop();
|
|
8572
|
+
}
|
|
8573
|
+
}
|
|
8574
|
+
}, _callee25, this);
|
|
8575
|
+
}));
|
|
8576
|
+
|
|
8577
|
+
function getUnreadCountBatch(_x26) {
|
|
8578
|
+
return _getUnreadCountBatch.apply(this, arguments);
|
|
8579
|
+
}
|
|
8580
|
+
|
|
8581
|
+
return getUnreadCountBatch;
|
|
8582
|
+
}()
|
|
8512
8583
|
/**
|
|
8513
8584
|
* removeDevice - Removes the device with the given id. Clientside users can only delete their own devices
|
|
8514
8585
|
*
|
|
@@ -8520,12 +8591,12 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8520
8591
|
}, {
|
|
8521
8592
|
key: "removeDevice",
|
|
8522
8593
|
value: function () {
|
|
8523
|
-
var _removeDevice = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
8524
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
8594
|
+
var _removeDevice = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee26(id, userID) {
|
|
8595
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee26$(_context26) {
|
|
8525
8596
|
while (1) {
|
|
8526
|
-
switch (
|
|
8597
|
+
switch (_context26.prev = _context26.next) {
|
|
8527
8598
|
case 0:
|
|
8528
|
-
|
|
8599
|
+
_context26.next = 2;
|
|
8529
8600
|
return this.delete(this.baseURL + '/devices', _objectSpread({
|
|
8530
8601
|
id: id
|
|
8531
8602
|
}, userID ? {
|
|
@@ -8533,17 +8604,17 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8533
8604
|
} : {}));
|
|
8534
8605
|
|
|
8535
8606
|
case 2:
|
|
8536
|
-
return
|
|
8607
|
+
return _context26.abrupt("return", _context26.sent);
|
|
8537
8608
|
|
|
8538
8609
|
case 3:
|
|
8539
8610
|
case "end":
|
|
8540
|
-
return
|
|
8611
|
+
return _context26.stop();
|
|
8541
8612
|
}
|
|
8542
8613
|
}
|
|
8543
|
-
},
|
|
8614
|
+
}, _callee26, this);
|
|
8544
8615
|
}));
|
|
8545
8616
|
|
|
8546
|
-
function removeDevice(
|
|
8617
|
+
function removeDevice(_x27, _x28) {
|
|
8547
8618
|
return _removeDevice.apply(this, arguments);
|
|
8548
8619
|
}
|
|
8549
8620
|
|
|
@@ -8560,15 +8631,15 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8560
8631
|
}, {
|
|
8561
8632
|
key: "getRateLimits",
|
|
8562
8633
|
value: function () {
|
|
8563
|
-
var _getRateLimits = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
8634
|
+
var _getRateLimits = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee27(params) {
|
|
8564
8635
|
var _ref7, serverSide, web, android, ios, endpoints;
|
|
8565
8636
|
|
|
8566
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
8637
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee27$(_context27) {
|
|
8567
8638
|
while (1) {
|
|
8568
|
-
switch (
|
|
8639
|
+
switch (_context27.prev = _context27.next) {
|
|
8569
8640
|
case 0:
|
|
8570
8641
|
_ref7 = params || {}, serverSide = _ref7.serverSide, web = _ref7.web, android = _ref7.android, ios = _ref7.ios, endpoints = _ref7.endpoints;
|
|
8571
|
-
return
|
|
8642
|
+
return _context27.abrupt("return", this.get(this.baseURL + '/rate_limits', {
|
|
8572
8643
|
server_side: serverSide,
|
|
8573
8644
|
web: web,
|
|
8574
8645
|
android: android,
|
|
@@ -8578,13 +8649,13 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8578
8649
|
|
|
8579
8650
|
case 2:
|
|
8580
8651
|
case "end":
|
|
8581
|
-
return
|
|
8652
|
+
return _context27.stop();
|
|
8582
8653
|
}
|
|
8583
8654
|
}
|
|
8584
|
-
},
|
|
8655
|
+
}, _callee27, this);
|
|
8585
8656
|
}));
|
|
8586
8657
|
|
|
8587
|
-
function getRateLimits(
|
|
8658
|
+
function getRateLimits(_x29) {
|
|
8588
8659
|
return _getRateLimits.apply(this, arguments);
|
|
8589
8660
|
}
|
|
8590
8661
|
|
|
@@ -8675,26 +8746,26 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8675
8746
|
* @return {Promise<{ users: { [key: string]: UserResponse<StreamChatGenerics> } }>} list of updated users
|
|
8676
8747
|
*/
|
|
8677
8748
|
function () {
|
|
8678
|
-
var _partialUpdateUser = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
8679
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
8749
|
+
var _partialUpdateUser = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee28(partialUserObject) {
|
|
8750
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee28$(_context28) {
|
|
8680
8751
|
while (1) {
|
|
8681
|
-
switch (
|
|
8752
|
+
switch (_context28.prev = _context28.next) {
|
|
8682
8753
|
case 0:
|
|
8683
|
-
|
|
8754
|
+
_context28.next = 2;
|
|
8684
8755
|
return this.partialUpdateUsers([partialUserObject]);
|
|
8685
8756
|
|
|
8686
8757
|
case 2:
|
|
8687
|
-
return
|
|
8758
|
+
return _context28.abrupt("return", _context28.sent);
|
|
8688
8759
|
|
|
8689
8760
|
case 3:
|
|
8690
8761
|
case "end":
|
|
8691
|
-
return
|
|
8762
|
+
return _context28.stop();
|
|
8692
8763
|
}
|
|
8693
8764
|
}
|
|
8694
|
-
},
|
|
8765
|
+
}, _callee28, this);
|
|
8695
8766
|
}));
|
|
8696
8767
|
|
|
8697
|
-
function partialUpdateUser(
|
|
8768
|
+
function partialUpdateUser(_x30) {
|
|
8698
8769
|
return _partialUpdateUser.apply(this, arguments);
|
|
8699
8770
|
}
|
|
8700
8771
|
|
|
@@ -8711,29 +8782,29 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8711
8782
|
}, {
|
|
8712
8783
|
key: "upsertUsers",
|
|
8713
8784
|
value: function () {
|
|
8714
|
-
var _upsertUsers = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
8785
|
+
var _upsertUsers = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee29(users) {
|
|
8715
8786
|
var userMap, _iterator4, _step4, userObject;
|
|
8716
8787
|
|
|
8717
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
8788
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee29$(_context29) {
|
|
8718
8789
|
while (1) {
|
|
8719
|
-
switch (
|
|
8790
|
+
switch (_context29.prev = _context29.next) {
|
|
8720
8791
|
case 0:
|
|
8721
8792
|
userMap = {};
|
|
8722
8793
|
_iterator4 = _createForOfIteratorHelper(users);
|
|
8723
|
-
|
|
8794
|
+
_context29.prev = 2;
|
|
8724
8795
|
|
|
8725
8796
|
_iterator4.s();
|
|
8726
8797
|
|
|
8727
8798
|
case 4:
|
|
8728
8799
|
if ((_step4 = _iterator4.n()).done) {
|
|
8729
|
-
|
|
8800
|
+
_context29.next = 11;
|
|
8730
8801
|
break;
|
|
8731
8802
|
}
|
|
8732
8803
|
|
|
8733
8804
|
userObject = _step4.value;
|
|
8734
8805
|
|
|
8735
8806
|
if (userObject.id) {
|
|
8736
|
-
|
|
8807
|
+
_context29.next = 8;
|
|
8737
8808
|
break;
|
|
8738
8809
|
}
|
|
8739
8810
|
|
|
@@ -8743,44 +8814,44 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8743
8814
|
userMap[userObject.id] = userObject;
|
|
8744
8815
|
|
|
8745
8816
|
case 9:
|
|
8746
|
-
|
|
8817
|
+
_context29.next = 4;
|
|
8747
8818
|
break;
|
|
8748
8819
|
|
|
8749
8820
|
case 11:
|
|
8750
|
-
|
|
8821
|
+
_context29.next = 16;
|
|
8751
8822
|
break;
|
|
8752
8823
|
|
|
8753
8824
|
case 13:
|
|
8754
|
-
|
|
8755
|
-
|
|
8825
|
+
_context29.prev = 13;
|
|
8826
|
+
_context29.t0 = _context29["catch"](2);
|
|
8756
8827
|
|
|
8757
|
-
_iterator4.e(
|
|
8828
|
+
_iterator4.e(_context29.t0);
|
|
8758
8829
|
|
|
8759
8830
|
case 16:
|
|
8760
|
-
|
|
8831
|
+
_context29.prev = 16;
|
|
8761
8832
|
|
|
8762
8833
|
_iterator4.f();
|
|
8763
8834
|
|
|
8764
|
-
return
|
|
8835
|
+
return _context29.finish(16);
|
|
8765
8836
|
|
|
8766
8837
|
case 19:
|
|
8767
|
-
|
|
8838
|
+
_context29.next = 21;
|
|
8768
8839
|
return this.post(this.baseURL + '/users', {
|
|
8769
8840
|
users: userMap
|
|
8770
8841
|
});
|
|
8771
8842
|
|
|
8772
8843
|
case 21:
|
|
8773
|
-
return
|
|
8844
|
+
return _context29.abrupt("return", _context29.sent);
|
|
8774
8845
|
|
|
8775
8846
|
case 22:
|
|
8776
8847
|
case "end":
|
|
8777
|
-
return
|
|
8848
|
+
return _context29.stop();
|
|
8778
8849
|
}
|
|
8779
8850
|
}
|
|
8780
|
-
},
|
|
8851
|
+
}, _callee29, this, [[2, 13, 16, 19]]);
|
|
8781
8852
|
}));
|
|
8782
8853
|
|
|
8783
|
-
function upsertUsers(
|
|
8854
|
+
function upsertUsers(_x31) {
|
|
8784
8855
|
return _upsertUsers.apply(this, arguments);
|
|
8785
8856
|
}
|
|
8786
8857
|
|
|
@@ -8828,72 +8899,72 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8828
8899
|
* @return {Promise<{ users: { [key: string]: UserResponse<StreamChatGenerics> } }>}
|
|
8829
8900
|
*/
|
|
8830
8901
|
function () {
|
|
8831
|
-
var _partialUpdateUsers = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
8902
|
+
var _partialUpdateUsers = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee30(users) {
|
|
8832
8903
|
var _iterator5, _step5, userObject;
|
|
8833
8904
|
|
|
8834
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
8905
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee30$(_context30) {
|
|
8835
8906
|
while (1) {
|
|
8836
|
-
switch (
|
|
8907
|
+
switch (_context30.prev = _context30.next) {
|
|
8837
8908
|
case 0:
|
|
8838
8909
|
_iterator5 = _createForOfIteratorHelper(users);
|
|
8839
|
-
|
|
8910
|
+
_context30.prev = 1;
|
|
8840
8911
|
|
|
8841
8912
|
_iterator5.s();
|
|
8842
8913
|
|
|
8843
8914
|
case 3:
|
|
8844
8915
|
if ((_step5 = _iterator5.n()).done) {
|
|
8845
|
-
|
|
8916
|
+
_context30.next = 9;
|
|
8846
8917
|
break;
|
|
8847
8918
|
}
|
|
8848
8919
|
|
|
8849
8920
|
userObject = _step5.value;
|
|
8850
8921
|
|
|
8851
8922
|
if (userObject.id) {
|
|
8852
|
-
|
|
8923
|
+
_context30.next = 7;
|
|
8853
8924
|
break;
|
|
8854
8925
|
}
|
|
8855
8926
|
|
|
8856
8927
|
throw Error('User ID is required when updating a user');
|
|
8857
8928
|
|
|
8858
8929
|
case 7:
|
|
8859
|
-
|
|
8930
|
+
_context30.next = 3;
|
|
8860
8931
|
break;
|
|
8861
8932
|
|
|
8862
8933
|
case 9:
|
|
8863
|
-
|
|
8934
|
+
_context30.next = 14;
|
|
8864
8935
|
break;
|
|
8865
8936
|
|
|
8866
8937
|
case 11:
|
|
8867
|
-
|
|
8868
|
-
|
|
8938
|
+
_context30.prev = 11;
|
|
8939
|
+
_context30.t0 = _context30["catch"](1);
|
|
8869
8940
|
|
|
8870
|
-
_iterator5.e(
|
|
8941
|
+
_iterator5.e(_context30.t0);
|
|
8871
8942
|
|
|
8872
8943
|
case 14:
|
|
8873
|
-
|
|
8944
|
+
_context30.prev = 14;
|
|
8874
8945
|
|
|
8875
8946
|
_iterator5.f();
|
|
8876
8947
|
|
|
8877
|
-
return
|
|
8948
|
+
return _context30.finish(14);
|
|
8878
8949
|
|
|
8879
8950
|
case 17:
|
|
8880
|
-
|
|
8951
|
+
_context30.next = 19;
|
|
8881
8952
|
return this.patch(this.baseURL + '/users', {
|
|
8882
8953
|
users: users
|
|
8883
8954
|
});
|
|
8884
8955
|
|
|
8885
8956
|
case 19:
|
|
8886
|
-
return
|
|
8957
|
+
return _context30.abrupt("return", _context30.sent);
|
|
8887
8958
|
|
|
8888
8959
|
case 20:
|
|
8889
8960
|
case "end":
|
|
8890
|
-
return
|
|
8961
|
+
return _context30.stop();
|
|
8891
8962
|
}
|
|
8892
8963
|
}
|
|
8893
|
-
},
|
|
8964
|
+
}, _callee30, this, [[1, 11, 14, 17]]);
|
|
8894
8965
|
}));
|
|
8895
8966
|
|
|
8896
|
-
function partialUpdateUsers(
|
|
8967
|
+
function partialUpdateUsers(_x32) {
|
|
8897
8968
|
return _partialUpdateUsers.apply(this, arguments);
|
|
8898
8969
|
}
|
|
8899
8970
|
|
|
@@ -8902,26 +8973,26 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8902
8973
|
}, {
|
|
8903
8974
|
key: "deleteUser",
|
|
8904
8975
|
value: function () {
|
|
8905
|
-
var _deleteUser = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
8906
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
8976
|
+
var _deleteUser = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee31(userID, params) {
|
|
8977
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee31$(_context31) {
|
|
8907
8978
|
while (1) {
|
|
8908
|
-
switch (
|
|
8979
|
+
switch (_context31.prev = _context31.next) {
|
|
8909
8980
|
case 0:
|
|
8910
|
-
|
|
8981
|
+
_context31.next = 2;
|
|
8911
8982
|
return this.delete(this.baseURL + "/users/".concat(userID), params);
|
|
8912
8983
|
|
|
8913
8984
|
case 2:
|
|
8914
|
-
return
|
|
8985
|
+
return _context31.abrupt("return", _context31.sent);
|
|
8915
8986
|
|
|
8916
8987
|
case 3:
|
|
8917
8988
|
case "end":
|
|
8918
|
-
return
|
|
8989
|
+
return _context31.stop();
|
|
8919
8990
|
}
|
|
8920
8991
|
}
|
|
8921
|
-
},
|
|
8992
|
+
}, _callee31, this);
|
|
8922
8993
|
}));
|
|
8923
8994
|
|
|
8924
|
-
function deleteUser(
|
|
8995
|
+
function deleteUser(_x33, _x34) {
|
|
8925
8996
|
return _deleteUser.apply(this, arguments);
|
|
8926
8997
|
}
|
|
8927
8998
|
|
|
@@ -8938,28 +9009,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8938
9009
|
}, {
|
|
8939
9010
|
key: "restoreUsers",
|
|
8940
9011
|
value: function () {
|
|
8941
|
-
var _restoreUsers = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
8942
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9012
|
+
var _restoreUsers = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee32(user_ids) {
|
|
9013
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee32$(_context32) {
|
|
8943
9014
|
while (1) {
|
|
8944
|
-
switch (
|
|
9015
|
+
switch (_context32.prev = _context32.next) {
|
|
8945
9016
|
case 0:
|
|
8946
|
-
|
|
9017
|
+
_context32.next = 2;
|
|
8947
9018
|
return this.post(this.baseURL + "/users/restore", {
|
|
8948
9019
|
user_ids: user_ids
|
|
8949
9020
|
});
|
|
8950
9021
|
|
|
8951
9022
|
case 2:
|
|
8952
|
-
return
|
|
9023
|
+
return _context32.abrupt("return", _context32.sent);
|
|
8953
9024
|
|
|
8954
9025
|
case 3:
|
|
8955
9026
|
case "end":
|
|
8956
|
-
return
|
|
9027
|
+
return _context32.stop();
|
|
8957
9028
|
}
|
|
8958
9029
|
}
|
|
8959
|
-
},
|
|
9030
|
+
}, _callee32, this);
|
|
8960
9031
|
}));
|
|
8961
9032
|
|
|
8962
|
-
function restoreUsers(
|
|
9033
|
+
function restoreUsers(_x35) {
|
|
8963
9034
|
return _restoreUsers.apply(this, arguments);
|
|
8964
9035
|
}
|
|
8965
9036
|
|
|
@@ -8977,26 +9048,26 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8977
9048
|
}, {
|
|
8978
9049
|
key: "reactivateUser",
|
|
8979
9050
|
value: function () {
|
|
8980
|
-
var _reactivateUser = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
8981
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9051
|
+
var _reactivateUser = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee33(userID, options) {
|
|
9052
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee33$(_context33) {
|
|
8982
9053
|
while (1) {
|
|
8983
|
-
switch (
|
|
9054
|
+
switch (_context33.prev = _context33.next) {
|
|
8984
9055
|
case 0:
|
|
8985
|
-
|
|
9056
|
+
_context33.next = 2;
|
|
8986
9057
|
return this.post(this.baseURL + "/users/".concat(userID, "/reactivate"), _objectSpread({}, options));
|
|
8987
9058
|
|
|
8988
9059
|
case 2:
|
|
8989
|
-
return
|
|
9060
|
+
return _context33.abrupt("return", _context33.sent);
|
|
8990
9061
|
|
|
8991
9062
|
case 3:
|
|
8992
9063
|
case "end":
|
|
8993
|
-
return
|
|
9064
|
+
return _context33.stop();
|
|
8994
9065
|
}
|
|
8995
9066
|
}
|
|
8996
|
-
},
|
|
9067
|
+
}, _callee33, this);
|
|
8997
9068
|
}));
|
|
8998
9069
|
|
|
8999
|
-
function reactivateUser(
|
|
9070
|
+
function reactivateUser(_x36, _x37) {
|
|
9000
9071
|
return _reactivateUser.apply(this, arguments);
|
|
9001
9072
|
}
|
|
9002
9073
|
|
|
@@ -9014,28 +9085,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9014
9085
|
}, {
|
|
9015
9086
|
key: "reactivateUsers",
|
|
9016
9087
|
value: function () {
|
|
9017
|
-
var _reactivateUsers = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9018
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9088
|
+
var _reactivateUsers = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee34(user_ids, options) {
|
|
9089
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee34$(_context34) {
|
|
9019
9090
|
while (1) {
|
|
9020
|
-
switch (
|
|
9091
|
+
switch (_context34.prev = _context34.next) {
|
|
9021
9092
|
case 0:
|
|
9022
|
-
|
|
9093
|
+
_context34.next = 2;
|
|
9023
9094
|
return this.post(this.baseURL + "/users/reactivate", _objectSpread({
|
|
9024
9095
|
user_ids: user_ids
|
|
9025
9096
|
}, options));
|
|
9026
9097
|
|
|
9027
9098
|
case 2:
|
|
9028
|
-
return
|
|
9099
|
+
return _context34.abrupt("return", _context34.sent);
|
|
9029
9100
|
|
|
9030
9101
|
case 3:
|
|
9031
9102
|
case "end":
|
|
9032
|
-
return
|
|
9103
|
+
return _context34.stop();
|
|
9033
9104
|
}
|
|
9034
9105
|
}
|
|
9035
|
-
},
|
|
9106
|
+
}, _callee34, this);
|
|
9036
9107
|
}));
|
|
9037
9108
|
|
|
9038
|
-
function reactivateUsers(
|
|
9109
|
+
function reactivateUsers(_x38, _x39) {
|
|
9039
9110
|
return _reactivateUsers.apply(this, arguments);
|
|
9040
9111
|
}
|
|
9041
9112
|
|
|
@@ -9053,26 +9124,26 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9053
9124
|
}, {
|
|
9054
9125
|
key: "deactivateUser",
|
|
9055
9126
|
value: function () {
|
|
9056
|
-
var _deactivateUser = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9057
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9127
|
+
var _deactivateUser = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee35(userID, options) {
|
|
9128
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee35$(_context35) {
|
|
9058
9129
|
while (1) {
|
|
9059
|
-
switch (
|
|
9130
|
+
switch (_context35.prev = _context35.next) {
|
|
9060
9131
|
case 0:
|
|
9061
|
-
|
|
9132
|
+
_context35.next = 2;
|
|
9062
9133
|
return this.post(this.baseURL + "/users/".concat(userID, "/deactivate"), _objectSpread({}, options));
|
|
9063
9134
|
|
|
9064
9135
|
case 2:
|
|
9065
|
-
return
|
|
9136
|
+
return _context35.abrupt("return", _context35.sent);
|
|
9066
9137
|
|
|
9067
9138
|
case 3:
|
|
9068
9139
|
case "end":
|
|
9069
|
-
return
|
|
9140
|
+
return _context35.stop();
|
|
9070
9141
|
}
|
|
9071
9142
|
}
|
|
9072
|
-
},
|
|
9143
|
+
}, _callee35, this);
|
|
9073
9144
|
}));
|
|
9074
9145
|
|
|
9075
|
-
function deactivateUser(
|
|
9146
|
+
function deactivateUser(_x40, _x41) {
|
|
9076
9147
|
return _deactivateUser.apply(this, arguments);
|
|
9077
9148
|
}
|
|
9078
9149
|
|
|
@@ -9090,28 +9161,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9090
9161
|
}, {
|
|
9091
9162
|
key: "deactivateUsers",
|
|
9092
9163
|
value: function () {
|
|
9093
|
-
var _deactivateUsers = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9094
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9164
|
+
var _deactivateUsers = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee36(user_ids, options) {
|
|
9165
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee36$(_context36) {
|
|
9095
9166
|
while (1) {
|
|
9096
|
-
switch (
|
|
9167
|
+
switch (_context36.prev = _context36.next) {
|
|
9097
9168
|
case 0:
|
|
9098
|
-
|
|
9169
|
+
_context36.next = 2;
|
|
9099
9170
|
return this.post(this.baseURL + "/users/deactivate", _objectSpread({
|
|
9100
9171
|
user_ids: user_ids
|
|
9101
9172
|
}, options));
|
|
9102
9173
|
|
|
9103
9174
|
case 2:
|
|
9104
|
-
return
|
|
9175
|
+
return _context36.abrupt("return", _context36.sent);
|
|
9105
9176
|
|
|
9106
9177
|
case 3:
|
|
9107
9178
|
case "end":
|
|
9108
|
-
return
|
|
9179
|
+
return _context36.stop();
|
|
9109
9180
|
}
|
|
9110
9181
|
}
|
|
9111
|
-
},
|
|
9182
|
+
}, _callee36, this);
|
|
9112
9183
|
}));
|
|
9113
9184
|
|
|
9114
|
-
function deactivateUsers(
|
|
9185
|
+
function deactivateUsers(_x42, _x43) {
|
|
9115
9186
|
return _deactivateUsers.apply(this, arguments);
|
|
9116
9187
|
}
|
|
9117
9188
|
|
|
@@ -9120,26 +9191,26 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9120
9191
|
}, {
|
|
9121
9192
|
key: "exportUser",
|
|
9122
9193
|
value: function () {
|
|
9123
|
-
var _exportUser = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9124
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9194
|
+
var _exportUser = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee37(userID, options) {
|
|
9195
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee37$(_context37) {
|
|
9125
9196
|
while (1) {
|
|
9126
|
-
switch (
|
|
9197
|
+
switch (_context37.prev = _context37.next) {
|
|
9127
9198
|
case 0:
|
|
9128
|
-
|
|
9199
|
+
_context37.next = 2;
|
|
9129
9200
|
return this.get(this.baseURL + "/users/".concat(userID, "/export"), _objectSpread({}, options));
|
|
9130
9201
|
|
|
9131
9202
|
case 2:
|
|
9132
|
-
return
|
|
9203
|
+
return _context37.abrupt("return", _context37.sent);
|
|
9133
9204
|
|
|
9134
9205
|
case 3:
|
|
9135
9206
|
case "end":
|
|
9136
|
-
return
|
|
9207
|
+
return _context37.stop();
|
|
9137
9208
|
}
|
|
9138
9209
|
}
|
|
9139
|
-
},
|
|
9210
|
+
}, _callee37, this);
|
|
9140
9211
|
}));
|
|
9141
9212
|
|
|
9142
|
-
function exportUser(
|
|
9213
|
+
function exportUser(_x44, _x45) {
|
|
9143
9214
|
return _exportUser.apply(this, arguments);
|
|
9144
9215
|
}
|
|
9145
9216
|
|
|
@@ -9155,28 +9226,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9155
9226
|
}, {
|
|
9156
9227
|
key: "banUser",
|
|
9157
9228
|
value: function () {
|
|
9158
|
-
var _banUser = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9159
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9229
|
+
var _banUser = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee38(targetUserID, options) {
|
|
9230
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee38$(_context38) {
|
|
9160
9231
|
while (1) {
|
|
9161
|
-
switch (
|
|
9232
|
+
switch (_context38.prev = _context38.next) {
|
|
9162
9233
|
case 0:
|
|
9163
|
-
|
|
9234
|
+
_context38.next = 2;
|
|
9164
9235
|
return this.post(this.baseURL + '/moderation/ban', _objectSpread({
|
|
9165
9236
|
target_user_id: targetUserID
|
|
9166
9237
|
}, options));
|
|
9167
9238
|
|
|
9168
9239
|
case 2:
|
|
9169
|
-
return
|
|
9240
|
+
return _context38.abrupt("return", _context38.sent);
|
|
9170
9241
|
|
|
9171
9242
|
case 3:
|
|
9172
9243
|
case "end":
|
|
9173
|
-
return
|
|
9244
|
+
return _context38.stop();
|
|
9174
9245
|
}
|
|
9175
9246
|
}
|
|
9176
|
-
},
|
|
9247
|
+
}, _callee38, this);
|
|
9177
9248
|
}));
|
|
9178
9249
|
|
|
9179
|
-
function banUser(
|
|
9250
|
+
function banUser(_x46, _x47) {
|
|
9180
9251
|
return _banUser.apply(this, arguments);
|
|
9181
9252
|
}
|
|
9182
9253
|
|
|
@@ -9192,28 +9263,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9192
9263
|
}, {
|
|
9193
9264
|
key: "unbanUser",
|
|
9194
9265
|
value: function () {
|
|
9195
|
-
var _unbanUser = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9196
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9266
|
+
var _unbanUser = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee39(targetUserID, options) {
|
|
9267
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee39$(_context39) {
|
|
9197
9268
|
while (1) {
|
|
9198
|
-
switch (
|
|
9269
|
+
switch (_context39.prev = _context39.next) {
|
|
9199
9270
|
case 0:
|
|
9200
|
-
|
|
9271
|
+
_context39.next = 2;
|
|
9201
9272
|
return this.delete(this.baseURL + '/moderation/ban', _objectSpread({
|
|
9202
9273
|
target_user_id: targetUserID
|
|
9203
9274
|
}, options));
|
|
9204
9275
|
|
|
9205
9276
|
case 2:
|
|
9206
|
-
return
|
|
9277
|
+
return _context39.abrupt("return", _context39.sent);
|
|
9207
9278
|
|
|
9208
9279
|
case 3:
|
|
9209
9280
|
case "end":
|
|
9210
|
-
return
|
|
9281
|
+
return _context39.stop();
|
|
9211
9282
|
}
|
|
9212
9283
|
}
|
|
9213
|
-
},
|
|
9284
|
+
}, _callee39, this);
|
|
9214
9285
|
}));
|
|
9215
9286
|
|
|
9216
|
-
function unbanUser(
|
|
9287
|
+
function unbanUser(_x48, _x49) {
|
|
9217
9288
|
return _unbanUser.apply(this, arguments);
|
|
9218
9289
|
}
|
|
9219
9290
|
|
|
@@ -9229,28 +9300,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9229
9300
|
}, {
|
|
9230
9301
|
key: "shadowBan",
|
|
9231
9302
|
value: function () {
|
|
9232
|
-
var _shadowBan = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9233
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9303
|
+
var _shadowBan = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee40(targetUserID, options) {
|
|
9304
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee40$(_context40) {
|
|
9234
9305
|
while (1) {
|
|
9235
|
-
switch (
|
|
9306
|
+
switch (_context40.prev = _context40.next) {
|
|
9236
9307
|
case 0:
|
|
9237
|
-
|
|
9308
|
+
_context40.next = 2;
|
|
9238
9309
|
return this.banUser(targetUserID, _objectSpread({
|
|
9239
9310
|
shadow: true
|
|
9240
9311
|
}, options));
|
|
9241
9312
|
|
|
9242
9313
|
case 2:
|
|
9243
|
-
return
|
|
9314
|
+
return _context40.abrupt("return", _context40.sent);
|
|
9244
9315
|
|
|
9245
9316
|
case 3:
|
|
9246
9317
|
case "end":
|
|
9247
|
-
return
|
|
9318
|
+
return _context40.stop();
|
|
9248
9319
|
}
|
|
9249
9320
|
}
|
|
9250
|
-
},
|
|
9321
|
+
}, _callee40, this);
|
|
9251
9322
|
}));
|
|
9252
9323
|
|
|
9253
|
-
function shadowBan(
|
|
9324
|
+
function shadowBan(_x50, _x51) {
|
|
9254
9325
|
return _shadowBan.apply(this, arguments);
|
|
9255
9326
|
}
|
|
9256
9327
|
|
|
@@ -9266,28 +9337,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9266
9337
|
}, {
|
|
9267
9338
|
key: "removeShadowBan",
|
|
9268
9339
|
value: function () {
|
|
9269
|
-
var _removeShadowBan = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9270
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9340
|
+
var _removeShadowBan = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee41(targetUserID, options) {
|
|
9341
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee41$(_context41) {
|
|
9271
9342
|
while (1) {
|
|
9272
|
-
switch (
|
|
9343
|
+
switch (_context41.prev = _context41.next) {
|
|
9273
9344
|
case 0:
|
|
9274
|
-
|
|
9345
|
+
_context41.next = 2;
|
|
9275
9346
|
return this.unbanUser(targetUserID, _objectSpread({
|
|
9276
9347
|
shadow: true
|
|
9277
9348
|
}, options));
|
|
9278
9349
|
|
|
9279
9350
|
case 2:
|
|
9280
|
-
return
|
|
9351
|
+
return _context41.abrupt("return", _context41.sent);
|
|
9281
9352
|
|
|
9282
9353
|
case 3:
|
|
9283
9354
|
case "end":
|
|
9284
|
-
return
|
|
9355
|
+
return _context41.stop();
|
|
9285
9356
|
}
|
|
9286
9357
|
}
|
|
9287
|
-
},
|
|
9358
|
+
}, _callee41, this);
|
|
9288
9359
|
}));
|
|
9289
9360
|
|
|
9290
|
-
function removeShadowBan(
|
|
9361
|
+
function removeShadowBan(_x52, _x53) {
|
|
9291
9362
|
return _removeShadowBan.apply(this, arguments);
|
|
9292
9363
|
}
|
|
9293
9364
|
|
|
@@ -9304,15 +9375,15 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9304
9375
|
}, {
|
|
9305
9376
|
key: "muteUser",
|
|
9306
9377
|
value: function () {
|
|
9307
|
-
var _muteUser = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9378
|
+
var _muteUser = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee42(targetID, userID) {
|
|
9308
9379
|
var options,
|
|
9309
|
-
|
|
9310
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9380
|
+
_args42 = arguments;
|
|
9381
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee42$(_context42) {
|
|
9311
9382
|
while (1) {
|
|
9312
|
-
switch (
|
|
9383
|
+
switch (_context42.prev = _context42.next) {
|
|
9313
9384
|
case 0:
|
|
9314
|
-
options =
|
|
9315
|
-
|
|
9385
|
+
options = _args42.length > 2 && _args42[2] !== undefined ? _args42[2] : {};
|
|
9386
|
+
_context42.next = 3;
|
|
9316
9387
|
return this.post(this.baseURL + '/moderation/mute', _objectSpread(_objectSpread({
|
|
9317
9388
|
target_id: targetID
|
|
9318
9389
|
}, userID ? {
|
|
@@ -9320,17 +9391,17 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9320
9391
|
} : {}), options));
|
|
9321
9392
|
|
|
9322
9393
|
case 3:
|
|
9323
|
-
return
|
|
9394
|
+
return _context42.abrupt("return", _context42.sent);
|
|
9324
9395
|
|
|
9325
9396
|
case 4:
|
|
9326
9397
|
case "end":
|
|
9327
|
-
return
|
|
9398
|
+
return _context42.stop();
|
|
9328
9399
|
}
|
|
9329
9400
|
}
|
|
9330
|
-
},
|
|
9401
|
+
}, _callee42, this);
|
|
9331
9402
|
}));
|
|
9332
9403
|
|
|
9333
|
-
function muteUser(
|
|
9404
|
+
function muteUser(_x54, _x55) {
|
|
9334
9405
|
return _muteUser.apply(this, arguments);
|
|
9335
9406
|
}
|
|
9336
9407
|
|
|
@@ -9346,12 +9417,12 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9346
9417
|
}, {
|
|
9347
9418
|
key: "unmuteUser",
|
|
9348
9419
|
value: function () {
|
|
9349
|
-
var _unmuteUser = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9350
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9420
|
+
var _unmuteUser = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee43(targetID, currentUserID) {
|
|
9421
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee43$(_context43) {
|
|
9351
9422
|
while (1) {
|
|
9352
|
-
switch (
|
|
9423
|
+
switch (_context43.prev = _context43.next) {
|
|
9353
9424
|
case 0:
|
|
9354
|
-
|
|
9425
|
+
_context43.next = 2;
|
|
9355
9426
|
return this.post(this.baseURL + '/moderation/unmute', _objectSpread({
|
|
9356
9427
|
target_id: targetID
|
|
9357
9428
|
}, currentUserID ? {
|
|
@@ -9359,17 +9430,17 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9359
9430
|
} : {}));
|
|
9360
9431
|
|
|
9361
9432
|
case 2:
|
|
9362
|
-
return
|
|
9433
|
+
return _context43.abrupt("return", _context43.sent);
|
|
9363
9434
|
|
|
9364
9435
|
case 3:
|
|
9365
9436
|
case "end":
|
|
9366
|
-
return
|
|
9437
|
+
return _context43.stop();
|
|
9367
9438
|
}
|
|
9368
9439
|
}
|
|
9369
|
-
},
|
|
9440
|
+
}, _callee43, this);
|
|
9370
9441
|
}));
|
|
9371
9442
|
|
|
9372
|
-
function unmuteUser(
|
|
9443
|
+
function unmuteUser(_x56, _x57) {
|
|
9373
9444
|
return _unmuteUser.apply(this, arguments);
|
|
9374
9445
|
}
|
|
9375
9446
|
|
|
@@ -9404,31 +9475,31 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9404
9475
|
}, {
|
|
9405
9476
|
key: "flagMessage",
|
|
9406
9477
|
value: function () {
|
|
9407
|
-
var _flagMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9478
|
+
var _flagMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee44(targetMessageID) {
|
|
9408
9479
|
var options,
|
|
9409
|
-
|
|
9410
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9480
|
+
_args44 = arguments;
|
|
9481
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee44$(_context44) {
|
|
9411
9482
|
while (1) {
|
|
9412
|
-
switch (
|
|
9483
|
+
switch (_context44.prev = _context44.next) {
|
|
9413
9484
|
case 0:
|
|
9414
|
-
options =
|
|
9415
|
-
|
|
9485
|
+
options = _args44.length > 1 && _args44[1] !== undefined ? _args44[1] : {};
|
|
9486
|
+
_context44.next = 3;
|
|
9416
9487
|
return this.post(this.baseURL + '/moderation/flag', _objectSpread({
|
|
9417
9488
|
target_message_id: targetMessageID
|
|
9418
9489
|
}, options));
|
|
9419
9490
|
|
|
9420
9491
|
case 3:
|
|
9421
|
-
return
|
|
9492
|
+
return _context44.abrupt("return", _context44.sent);
|
|
9422
9493
|
|
|
9423
9494
|
case 4:
|
|
9424
9495
|
case "end":
|
|
9425
|
-
return
|
|
9496
|
+
return _context44.stop();
|
|
9426
9497
|
}
|
|
9427
9498
|
}
|
|
9428
|
-
},
|
|
9499
|
+
}, _callee44, this);
|
|
9429
9500
|
}));
|
|
9430
9501
|
|
|
9431
|
-
function flagMessage(
|
|
9502
|
+
function flagMessage(_x58) {
|
|
9432
9503
|
return _flagMessage.apply(this, arguments);
|
|
9433
9504
|
}
|
|
9434
9505
|
|
|
@@ -9444,31 +9515,31 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9444
9515
|
}, {
|
|
9445
9516
|
key: "flagUser",
|
|
9446
9517
|
value: function () {
|
|
9447
|
-
var _flagUser = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9518
|
+
var _flagUser = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee45(targetID) {
|
|
9448
9519
|
var options,
|
|
9449
|
-
|
|
9450
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9520
|
+
_args45 = arguments;
|
|
9521
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee45$(_context45) {
|
|
9451
9522
|
while (1) {
|
|
9452
|
-
switch (
|
|
9523
|
+
switch (_context45.prev = _context45.next) {
|
|
9453
9524
|
case 0:
|
|
9454
|
-
options =
|
|
9455
|
-
|
|
9525
|
+
options = _args45.length > 1 && _args45[1] !== undefined ? _args45[1] : {};
|
|
9526
|
+
_context45.next = 3;
|
|
9456
9527
|
return this.post(this.baseURL + '/moderation/flag', _objectSpread({
|
|
9457
9528
|
target_user_id: targetID
|
|
9458
9529
|
}, options));
|
|
9459
9530
|
|
|
9460
9531
|
case 3:
|
|
9461
|
-
return
|
|
9532
|
+
return _context45.abrupt("return", _context45.sent);
|
|
9462
9533
|
|
|
9463
9534
|
case 4:
|
|
9464
9535
|
case "end":
|
|
9465
|
-
return
|
|
9536
|
+
return _context45.stop();
|
|
9466
9537
|
}
|
|
9467
9538
|
}
|
|
9468
|
-
},
|
|
9539
|
+
}, _callee45, this);
|
|
9469
9540
|
}));
|
|
9470
9541
|
|
|
9471
|
-
function flagUser(
|
|
9542
|
+
function flagUser(_x59) {
|
|
9472
9543
|
return _flagUser.apply(this, arguments);
|
|
9473
9544
|
}
|
|
9474
9545
|
|
|
@@ -9484,31 +9555,31 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9484
9555
|
}, {
|
|
9485
9556
|
key: "unflagMessage",
|
|
9486
9557
|
value: function () {
|
|
9487
|
-
var _unflagMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9558
|
+
var _unflagMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee46(targetMessageID) {
|
|
9488
9559
|
var options,
|
|
9489
|
-
|
|
9490
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9560
|
+
_args46 = arguments;
|
|
9561
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee46$(_context46) {
|
|
9491
9562
|
while (1) {
|
|
9492
|
-
switch (
|
|
9563
|
+
switch (_context46.prev = _context46.next) {
|
|
9493
9564
|
case 0:
|
|
9494
|
-
options =
|
|
9495
|
-
|
|
9565
|
+
options = _args46.length > 1 && _args46[1] !== undefined ? _args46[1] : {};
|
|
9566
|
+
_context46.next = 3;
|
|
9496
9567
|
return this.post(this.baseURL + '/moderation/unflag', _objectSpread({
|
|
9497
9568
|
target_message_id: targetMessageID
|
|
9498
9569
|
}, options));
|
|
9499
9570
|
|
|
9500
9571
|
case 3:
|
|
9501
|
-
return
|
|
9572
|
+
return _context46.abrupt("return", _context46.sent);
|
|
9502
9573
|
|
|
9503
9574
|
case 4:
|
|
9504
9575
|
case "end":
|
|
9505
|
-
return
|
|
9576
|
+
return _context46.stop();
|
|
9506
9577
|
}
|
|
9507
9578
|
}
|
|
9508
|
-
},
|
|
9579
|
+
}, _callee46, this);
|
|
9509
9580
|
}));
|
|
9510
9581
|
|
|
9511
|
-
function unflagMessage(
|
|
9582
|
+
function unflagMessage(_x60) {
|
|
9512
9583
|
return _unflagMessage.apply(this, arguments);
|
|
9513
9584
|
}
|
|
9514
9585
|
|
|
@@ -9524,31 +9595,31 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9524
9595
|
}, {
|
|
9525
9596
|
key: "unflagUser",
|
|
9526
9597
|
value: function () {
|
|
9527
|
-
var _unflagUser = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9598
|
+
var _unflagUser = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee47(targetID) {
|
|
9528
9599
|
var options,
|
|
9529
|
-
|
|
9530
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9600
|
+
_args47 = arguments;
|
|
9601
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee47$(_context47) {
|
|
9531
9602
|
while (1) {
|
|
9532
|
-
switch (
|
|
9603
|
+
switch (_context47.prev = _context47.next) {
|
|
9533
9604
|
case 0:
|
|
9534
|
-
options =
|
|
9535
|
-
|
|
9605
|
+
options = _args47.length > 1 && _args47[1] !== undefined ? _args47[1] : {};
|
|
9606
|
+
_context47.next = 3;
|
|
9536
9607
|
return this.post(this.baseURL + '/moderation/unflag', _objectSpread({
|
|
9537
9608
|
target_user_id: targetID
|
|
9538
9609
|
}, options));
|
|
9539
9610
|
|
|
9540
9611
|
case 3:
|
|
9541
|
-
return
|
|
9612
|
+
return _context47.abrupt("return", _context47.sent);
|
|
9542
9613
|
|
|
9543
9614
|
case 4:
|
|
9544
9615
|
case "end":
|
|
9545
|
-
return
|
|
9616
|
+
return _context47.stop();
|
|
9546
9617
|
}
|
|
9547
9618
|
}
|
|
9548
|
-
},
|
|
9619
|
+
}, _callee47, this);
|
|
9549
9620
|
}));
|
|
9550
9621
|
|
|
9551
|
-
function unflagUser(
|
|
9622
|
+
function unflagUser(_x61) {
|
|
9552
9623
|
return _unflagUser.apply(this, arguments);
|
|
9553
9624
|
}
|
|
9554
9625
|
|
|
@@ -9565,29 +9636,29 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9565
9636
|
}, {
|
|
9566
9637
|
key: "getCallToken",
|
|
9567
9638
|
value: function () {
|
|
9568
|
-
var _getCallToken = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9639
|
+
var _getCallToken = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee48(callID) {
|
|
9569
9640
|
var options,
|
|
9570
|
-
|
|
9571
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9641
|
+
_args48 = arguments;
|
|
9642
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee48$(_context48) {
|
|
9572
9643
|
while (1) {
|
|
9573
|
-
switch (
|
|
9644
|
+
switch (_context48.prev = _context48.next) {
|
|
9574
9645
|
case 0:
|
|
9575
|
-
options =
|
|
9576
|
-
|
|
9646
|
+
options = _args48.length > 1 && _args48[1] !== undefined ? _args48[1] : {};
|
|
9647
|
+
_context48.next = 3;
|
|
9577
9648
|
return this.post(this.baseURL + "/calls/".concat(callID), _objectSpread({}, options));
|
|
9578
9649
|
|
|
9579
9650
|
case 3:
|
|
9580
|
-
return
|
|
9651
|
+
return _context48.abrupt("return", _context48.sent);
|
|
9581
9652
|
|
|
9582
9653
|
case 4:
|
|
9583
9654
|
case "end":
|
|
9584
|
-
return
|
|
9655
|
+
return _context48.stop();
|
|
9585
9656
|
}
|
|
9586
9657
|
}
|
|
9587
|
-
},
|
|
9658
|
+
}, _callee48, this);
|
|
9588
9659
|
}));
|
|
9589
9660
|
|
|
9590
|
-
function getCallToken(
|
|
9661
|
+
function getCallToken(_x62) {
|
|
9591
9662
|
return _getCallToken.apply(this, arguments);
|
|
9592
9663
|
}
|
|
9593
9664
|
|
|
@@ -9610,30 +9681,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9610
9681
|
}, {
|
|
9611
9682
|
key: "_queryFlags",
|
|
9612
9683
|
value: function () {
|
|
9613
|
-
var _queryFlags2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9684
|
+
var _queryFlags2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee49() {
|
|
9614
9685
|
var filterConditions,
|
|
9615
9686
|
options,
|
|
9616
|
-
|
|
9617
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9687
|
+
_args49 = arguments;
|
|
9688
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee49$(_context49) {
|
|
9618
9689
|
while (1) {
|
|
9619
|
-
switch (
|
|
9690
|
+
switch (_context49.prev = _context49.next) {
|
|
9620
9691
|
case 0:
|
|
9621
|
-
filterConditions =
|
|
9622
|
-
options =
|
|
9623
|
-
|
|
9692
|
+
filterConditions = _args49.length > 0 && _args49[0] !== undefined ? _args49[0] : {};
|
|
9693
|
+
options = _args49.length > 1 && _args49[1] !== undefined ? _args49[1] : {};
|
|
9694
|
+
_context49.next = 4;
|
|
9624
9695
|
return this.post(this.baseURL + '/moderation/flags', _objectSpread({
|
|
9625
9696
|
filter_conditions: filterConditions
|
|
9626
9697
|
}, options));
|
|
9627
9698
|
|
|
9628
9699
|
case 4:
|
|
9629
|
-
return
|
|
9700
|
+
return _context49.abrupt("return", _context49.sent);
|
|
9630
9701
|
|
|
9631
9702
|
case 5:
|
|
9632
9703
|
case "end":
|
|
9633
|
-
return
|
|
9704
|
+
return _context49.stop();
|
|
9634
9705
|
}
|
|
9635
9706
|
}
|
|
9636
|
-
},
|
|
9707
|
+
}, _callee49, this);
|
|
9637
9708
|
}));
|
|
9638
9709
|
|
|
9639
9710
|
function _queryFlags() {
|
|
@@ -9659,30 +9730,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9659
9730
|
}, {
|
|
9660
9731
|
key: "_queryFlagReports",
|
|
9661
9732
|
value: function () {
|
|
9662
|
-
var _queryFlagReports2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9733
|
+
var _queryFlagReports2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee50() {
|
|
9663
9734
|
var filterConditions,
|
|
9664
9735
|
options,
|
|
9665
|
-
|
|
9666
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9736
|
+
_args50 = arguments;
|
|
9737
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee50$(_context50) {
|
|
9667
9738
|
while (1) {
|
|
9668
|
-
switch (
|
|
9739
|
+
switch (_context50.prev = _context50.next) {
|
|
9669
9740
|
case 0:
|
|
9670
|
-
filterConditions =
|
|
9671
|
-
options =
|
|
9672
|
-
|
|
9741
|
+
filterConditions = _args50.length > 0 && _args50[0] !== undefined ? _args50[0] : {};
|
|
9742
|
+
options = _args50.length > 1 && _args50[1] !== undefined ? _args50[1] : {};
|
|
9743
|
+
_context50.next = 4;
|
|
9673
9744
|
return this.post(this.baseURL + '/moderation/reports', _objectSpread({
|
|
9674
9745
|
filter_conditions: filterConditions
|
|
9675
9746
|
}, options));
|
|
9676
9747
|
|
|
9677
9748
|
case 4:
|
|
9678
|
-
return
|
|
9749
|
+
return _context50.abrupt("return", _context50.sent);
|
|
9679
9750
|
|
|
9680
9751
|
case 5:
|
|
9681
9752
|
case "end":
|
|
9682
|
-
return
|
|
9753
|
+
return _context50.stop();
|
|
9683
9754
|
}
|
|
9684
9755
|
}
|
|
9685
|
-
},
|
|
9756
|
+
}, _callee50, this);
|
|
9686
9757
|
}));
|
|
9687
9758
|
|
|
9688
9759
|
function _queryFlagReports() {
|
|
@@ -9709,31 +9780,31 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9709
9780
|
}, {
|
|
9710
9781
|
key: "_reviewFlagReport",
|
|
9711
9782
|
value: function () {
|
|
9712
|
-
var _reviewFlagReport2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9783
|
+
var _reviewFlagReport2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee51(id, reviewResult) {
|
|
9713
9784
|
var options,
|
|
9714
|
-
|
|
9715
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9785
|
+
_args51 = arguments;
|
|
9786
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee51$(_context51) {
|
|
9716
9787
|
while (1) {
|
|
9717
|
-
switch (
|
|
9788
|
+
switch (_context51.prev = _context51.next) {
|
|
9718
9789
|
case 0:
|
|
9719
|
-
options =
|
|
9720
|
-
|
|
9790
|
+
options = _args51.length > 2 && _args51[2] !== undefined ? _args51[2] : {};
|
|
9791
|
+
_context51.next = 3;
|
|
9721
9792
|
return this.patch(this.baseURL + "/moderation/reports/".concat(id), _objectSpread({
|
|
9722
9793
|
review_result: reviewResult
|
|
9723
9794
|
}, options));
|
|
9724
9795
|
|
|
9725
9796
|
case 3:
|
|
9726
|
-
return
|
|
9797
|
+
return _context51.abrupt("return", _context51.sent);
|
|
9727
9798
|
|
|
9728
9799
|
case 4:
|
|
9729
9800
|
case "end":
|
|
9730
|
-
return
|
|
9801
|
+
return _context51.stop();
|
|
9731
9802
|
}
|
|
9732
9803
|
}
|
|
9733
|
-
},
|
|
9804
|
+
}, _callee51, this);
|
|
9734
9805
|
}));
|
|
9735
9806
|
|
|
9736
|
-
function _reviewFlagReport(
|
|
9807
|
+
function _reviewFlagReport(_x63, _x64) {
|
|
9737
9808
|
return _reviewFlagReport2.apply(this, arguments);
|
|
9738
9809
|
}
|
|
9739
9810
|
|
|
@@ -9751,31 +9822,31 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9751
9822
|
}, {
|
|
9752
9823
|
key: "unblockMessage",
|
|
9753
9824
|
value: function () {
|
|
9754
|
-
var _unblockMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9825
|
+
var _unblockMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee52(targetMessageID) {
|
|
9755
9826
|
var options,
|
|
9756
|
-
|
|
9757
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9827
|
+
_args52 = arguments;
|
|
9828
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee52$(_context52) {
|
|
9758
9829
|
while (1) {
|
|
9759
|
-
switch (
|
|
9830
|
+
switch (_context52.prev = _context52.next) {
|
|
9760
9831
|
case 0:
|
|
9761
|
-
options =
|
|
9762
|
-
|
|
9832
|
+
options = _args52.length > 1 && _args52[1] !== undefined ? _args52[1] : {};
|
|
9833
|
+
_context52.next = 3;
|
|
9763
9834
|
return this.post(this.baseURL + '/moderation/unblock_message', _objectSpread({
|
|
9764
9835
|
target_message_id: targetMessageID
|
|
9765
9836
|
}, options));
|
|
9766
9837
|
|
|
9767
9838
|
case 3:
|
|
9768
|
-
return
|
|
9839
|
+
return _context52.abrupt("return", _context52.sent);
|
|
9769
9840
|
|
|
9770
9841
|
case 4:
|
|
9771
9842
|
case "end":
|
|
9772
|
-
return
|
|
9843
|
+
return _context52.stop();
|
|
9773
9844
|
}
|
|
9774
9845
|
}
|
|
9775
|
-
},
|
|
9846
|
+
}, _callee52, this);
|
|
9776
9847
|
}));
|
|
9777
9848
|
|
|
9778
|
-
function unblockMessage(
|
|
9849
|
+
function unblockMessage(_x65) {
|
|
9779
9850
|
return _unblockMessage.apply(this, arguments);
|
|
9780
9851
|
}
|
|
9781
9852
|
|
|
@@ -9794,23 +9865,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9794
9865
|
* @return {Promise<APIResponse>}
|
|
9795
9866
|
*/
|
|
9796
9867
|
function () {
|
|
9797
|
-
var _markChannelsRead = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9868
|
+
var _markChannelsRead = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee53() {
|
|
9798
9869
|
var data,
|
|
9799
|
-
|
|
9800
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9870
|
+
_args53 = arguments;
|
|
9871
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee53$(_context53) {
|
|
9801
9872
|
while (1) {
|
|
9802
|
-
switch (
|
|
9873
|
+
switch (_context53.prev = _context53.next) {
|
|
9803
9874
|
case 0:
|
|
9804
|
-
data =
|
|
9805
|
-
|
|
9875
|
+
data = _args53.length > 0 && _args53[0] !== undefined ? _args53[0] : {};
|
|
9876
|
+
_context53.next = 3;
|
|
9806
9877
|
return this.post(this.baseURL + '/channels/read', _objectSpread({}, data));
|
|
9807
9878
|
|
|
9808
9879
|
case 3:
|
|
9809
9880
|
case "end":
|
|
9810
|
-
return
|
|
9881
|
+
return _context53.stop();
|
|
9811
9882
|
}
|
|
9812
9883
|
}
|
|
9813
|
-
},
|
|
9884
|
+
}, _callee53, this);
|
|
9814
9885
|
}));
|
|
9815
9886
|
|
|
9816
9887
|
function markChannelsRead() {
|
|
@@ -9885,28 +9956,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9885
9956
|
}, {
|
|
9886
9957
|
key: "translateMessage",
|
|
9887
9958
|
value: function () {
|
|
9888
|
-
var _translateMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9889
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9959
|
+
var _translateMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee54(messageId, language) {
|
|
9960
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee54$(_context54) {
|
|
9890
9961
|
while (1) {
|
|
9891
|
-
switch (
|
|
9962
|
+
switch (_context54.prev = _context54.next) {
|
|
9892
9963
|
case 0:
|
|
9893
|
-
|
|
9964
|
+
_context54.next = 2;
|
|
9894
9965
|
return this.post(this.baseURL + "/messages/".concat(messageId, "/translate"), {
|
|
9895
9966
|
language: language
|
|
9896
9967
|
});
|
|
9897
9968
|
|
|
9898
9969
|
case 2:
|
|
9899
|
-
return
|
|
9970
|
+
return _context54.abrupt("return", _context54.sent);
|
|
9900
9971
|
|
|
9901
9972
|
case 3:
|
|
9902
9973
|
case "end":
|
|
9903
|
-
return
|
|
9974
|
+
return _context54.stop();
|
|
9904
9975
|
}
|
|
9905
9976
|
}
|
|
9906
|
-
},
|
|
9977
|
+
}, _callee54, this);
|
|
9907
9978
|
}));
|
|
9908
9979
|
|
|
9909
|
-
function translateMessage(
|
|
9980
|
+
function translateMessage(_x66, _x67) {
|
|
9910
9981
|
return _translateMessage.apply(this, arguments);
|
|
9911
9982
|
}
|
|
9912
9983
|
|
|
@@ -10008,14 +10079,14 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10008
10079
|
}, {
|
|
10009
10080
|
key: "updateMessage",
|
|
10010
10081
|
value: function () {
|
|
10011
|
-
var _updateMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
10082
|
+
var _updateMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee55(message, userId, options) {
|
|
10012
10083
|
var clonedMessage, reservedMessageFields;
|
|
10013
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
10084
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee55$(_context55) {
|
|
10014
10085
|
while (1) {
|
|
10015
|
-
switch (
|
|
10086
|
+
switch (_context55.prev = _context55.next) {
|
|
10016
10087
|
case 0:
|
|
10017
10088
|
if (message.id) {
|
|
10018
|
-
|
|
10089
|
+
_context55.next = 2;
|
|
10019
10090
|
break;
|
|
10020
10091
|
}
|
|
10021
10092
|
|
|
@@ -10052,23 +10123,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10052
10123
|
});
|
|
10053
10124
|
}
|
|
10054
10125
|
|
|
10055
|
-
|
|
10126
|
+
_context55.next = 10;
|
|
10056
10127
|
return this.post(this.baseURL + "/messages/".concat(message.id), _objectSpread({
|
|
10057
10128
|
message: clonedMessage
|
|
10058
10129
|
}, options));
|
|
10059
10130
|
|
|
10060
10131
|
case 10:
|
|
10061
|
-
return
|
|
10132
|
+
return _context55.abrupt("return", _context55.sent);
|
|
10062
10133
|
|
|
10063
10134
|
case 11:
|
|
10064
10135
|
case "end":
|
|
10065
|
-
return
|
|
10136
|
+
return _context55.stop();
|
|
10066
10137
|
}
|
|
10067
10138
|
}
|
|
10068
|
-
},
|
|
10139
|
+
}, _callee55, this);
|
|
10069
10140
|
}));
|
|
10070
10141
|
|
|
10071
|
-
function updateMessage(
|
|
10142
|
+
function updateMessage(_x68, _x69, _x70) {
|
|
10072
10143
|
return _updateMessage.apply(this, arguments);
|
|
10073
10144
|
}
|
|
10074
10145
|
|
|
@@ -10091,14 +10162,14 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10091
10162
|
}, {
|
|
10092
10163
|
key: "partialUpdateMessage",
|
|
10093
10164
|
value: function () {
|
|
10094
|
-
var _partialUpdateMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
10165
|
+
var _partialUpdateMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee56(id, partialMessageObject, userId, options) {
|
|
10095
10166
|
var user;
|
|
10096
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
10167
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee56$(_context56) {
|
|
10097
10168
|
while (1) {
|
|
10098
|
-
switch (
|
|
10169
|
+
switch (_context56.prev = _context56.next) {
|
|
10099
10170
|
case 0:
|
|
10100
10171
|
if (id) {
|
|
10101
|
-
|
|
10172
|
+
_context56.next = 2;
|
|
10102
10173
|
break;
|
|
10103
10174
|
}
|
|
10104
10175
|
|
|
@@ -10113,23 +10184,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10113
10184
|
};
|
|
10114
10185
|
}
|
|
10115
10186
|
|
|
10116
|
-
|
|
10187
|
+
_context56.next = 6;
|
|
10117
10188
|
return this.put(this.baseURL + "/messages/".concat(id), _objectSpread(_objectSpread(_objectSpread({}, partialMessageObject), options), {}, {
|
|
10118
10189
|
user: user
|
|
10119
10190
|
}));
|
|
10120
10191
|
|
|
10121
10192
|
case 6:
|
|
10122
|
-
return
|
|
10193
|
+
return _context56.abrupt("return", _context56.sent);
|
|
10123
10194
|
|
|
10124
10195
|
case 7:
|
|
10125
10196
|
case "end":
|
|
10126
|
-
return
|
|
10197
|
+
return _context56.stop();
|
|
10127
10198
|
}
|
|
10128
10199
|
}
|
|
10129
|
-
},
|
|
10200
|
+
}, _callee56, this);
|
|
10130
10201
|
}));
|
|
10131
10202
|
|
|
10132
|
-
function partialUpdateMessage(
|
|
10203
|
+
function partialUpdateMessage(_x71, _x72, _x73, _x74) {
|
|
10133
10204
|
return _partialUpdateMessage.apply(this, arguments);
|
|
10134
10205
|
}
|
|
10135
10206
|
|
|
@@ -10138,11 +10209,11 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10138
10209
|
}, {
|
|
10139
10210
|
key: "deleteMessage",
|
|
10140
10211
|
value: function () {
|
|
10141
|
-
var _deleteMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
10212
|
+
var _deleteMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee57(messageID, hardDelete) {
|
|
10142
10213
|
var params;
|
|
10143
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
10214
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee57$(_context57) {
|
|
10144
10215
|
while (1) {
|
|
10145
|
-
switch (
|
|
10216
|
+
switch (_context57.prev = _context57.next) {
|
|
10146
10217
|
case 0:
|
|
10147
10218
|
params = {};
|
|
10148
10219
|
|
|
@@ -10152,21 +10223,21 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10152
10223
|
};
|
|
10153
10224
|
}
|
|
10154
10225
|
|
|
10155
|
-
|
|
10226
|
+
_context57.next = 4;
|
|
10156
10227
|
return this.delete(this.baseURL + "/messages/".concat(messageID), params);
|
|
10157
10228
|
|
|
10158
10229
|
case 4:
|
|
10159
|
-
return
|
|
10230
|
+
return _context57.abrupt("return", _context57.sent);
|
|
10160
10231
|
|
|
10161
10232
|
case 5:
|
|
10162
10233
|
case "end":
|
|
10163
|
-
return
|
|
10234
|
+
return _context57.stop();
|
|
10164
10235
|
}
|
|
10165
10236
|
}
|
|
10166
|
-
},
|
|
10237
|
+
}, _callee57, this);
|
|
10167
10238
|
}));
|
|
10168
10239
|
|
|
10169
|
-
function deleteMessage(
|
|
10240
|
+
function deleteMessage(_x75, _x76) {
|
|
10170
10241
|
return _deleteMessage.apply(this, arguments);
|
|
10171
10242
|
}
|
|
10172
10243
|
|
|
@@ -10175,26 +10246,26 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10175
10246
|
}, {
|
|
10176
10247
|
key: "getMessage",
|
|
10177
10248
|
value: function () {
|
|
10178
|
-
var _getMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
10179
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
10249
|
+
var _getMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee58(messageID) {
|
|
10250
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee58$(_context58) {
|
|
10180
10251
|
while (1) {
|
|
10181
|
-
switch (
|
|
10252
|
+
switch (_context58.prev = _context58.next) {
|
|
10182
10253
|
case 0:
|
|
10183
|
-
|
|
10254
|
+
_context58.next = 2;
|
|
10184
10255
|
return this.get(this.baseURL + "/messages/".concat(encodeURIComponent(messageID)));
|
|
10185
10256
|
|
|
10186
10257
|
case 2:
|
|
10187
|
-
return
|
|
10258
|
+
return _context58.abrupt("return", _context58.sent);
|
|
10188
10259
|
|
|
10189
10260
|
case 3:
|
|
10190
10261
|
case "end":
|
|
10191
|
-
return
|
|
10262
|
+
return _context58.stop();
|
|
10192
10263
|
}
|
|
10193
10264
|
}
|
|
10194
|
-
},
|
|
10265
|
+
}, _callee58, this);
|
|
10195
10266
|
}));
|
|
10196
10267
|
|
|
10197
|
-
function getMessage(
|
|
10268
|
+
function getMessage(_x77) {
|
|
10198
10269
|
return _getMessage.apply(this, arguments);
|
|
10199
10270
|
}
|
|
10200
10271
|
|
|
@@ -10203,7 +10274,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10203
10274
|
}, {
|
|
10204
10275
|
key: "getUserAgent",
|
|
10205
10276
|
value: function getUserAgent() {
|
|
10206
|
-
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.
|
|
10277
|
+
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.15.0");
|
|
10207
10278
|
}
|
|
10208
10279
|
}, {
|
|
10209
10280
|
key: "setUserAgent",
|
|
@@ -10422,28 +10493,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10422
10493
|
}, {
|
|
10423
10494
|
key: "sendUserCustomEvent",
|
|
10424
10495
|
value: function () {
|
|
10425
|
-
var _sendUserCustomEvent = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
10426
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
10496
|
+
var _sendUserCustomEvent = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee59(targetUserID, event) {
|
|
10497
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee59$(_context59) {
|
|
10427
10498
|
while (1) {
|
|
10428
|
-
switch (
|
|
10499
|
+
switch (_context59.prev = _context59.next) {
|
|
10429
10500
|
case 0:
|
|
10430
|
-
|
|
10501
|
+
_context59.next = 2;
|
|
10431
10502
|
return this.post("".concat(this.baseURL, "/users/").concat(targetUserID, "/event"), {
|
|
10432
10503
|
event: event
|
|
10433
10504
|
});
|
|
10434
10505
|
|
|
10435
10506
|
case 2:
|
|
10436
|
-
return
|
|
10507
|
+
return _context59.abrupt("return", _context59.sent);
|
|
10437
10508
|
|
|
10438
10509
|
case 3:
|
|
10439
10510
|
case "end":
|
|
10440
|
-
return
|
|
10511
|
+
return _context59.stop();
|
|
10441
10512
|
}
|
|
10442
10513
|
}
|
|
10443
|
-
},
|
|
10514
|
+
}, _callee59, this);
|
|
10444
10515
|
}));
|
|
10445
10516
|
|
|
10446
|
-
function sendUserCustomEvent(
|
|
10517
|
+
function sendUserCustomEvent(_x78, _x79) {
|
|
10447
10518
|
return _sendUserCustomEvent.apply(this, arguments);
|
|
10448
10519
|
}
|
|
10449
10520
|
|
|
@@ -10501,132 +10572,298 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10501
10572
|
return this.get("".concat(this.baseURL, "/export_channels/").concat(id));
|
|
10502
10573
|
}
|
|
10503
10574
|
/**
|
|
10504
|
-
* createSegment - Creates a
|
|
10575
|
+
* createSegment - Creates a segment
|
|
10505
10576
|
*
|
|
10577
|
+
* @private
|
|
10578
|
+
* @param {SegmentType} type Segment type
|
|
10579
|
+
* @param {string} id Segment ID (valid UUID)
|
|
10580
|
+
* @param {string} name Segment name (valid UUID)
|
|
10506
10581
|
* @param {SegmentData} params Segment data
|
|
10507
10582
|
*
|
|
10508
|
-
* @return {Segment} The
|
|
10583
|
+
* @return {Segment} The created Segment
|
|
10509
10584
|
*/
|
|
10510
10585
|
|
|
10511
10586
|
}, {
|
|
10512
10587
|
key: "createSegment",
|
|
10513
10588
|
value: function () {
|
|
10514
|
-
var _createSegment = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
10515
|
-
var _yield$this$post, segment;
|
|
10589
|
+
var _createSegment = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee60(type, id, name, data) {
|
|
10590
|
+
var body, _yield$this$post, segment;
|
|
10516
10591
|
|
|
10517
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
10592
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee60$(_context60) {
|
|
10518
10593
|
while (1) {
|
|
10519
|
-
switch (
|
|
10594
|
+
switch (_context60.prev = _context60.next) {
|
|
10520
10595
|
case 0:
|
|
10521
|
-
|
|
10522
|
-
|
|
10523
|
-
|
|
10524
|
-
|
|
10596
|
+
body = {
|
|
10597
|
+
id: id,
|
|
10598
|
+
type: type,
|
|
10599
|
+
name: name,
|
|
10600
|
+
data: data
|
|
10601
|
+
};
|
|
10602
|
+
_context60.next = 3;
|
|
10603
|
+
return this.post(this.baseURL + "/segments", body);
|
|
10525
10604
|
|
|
10526
|
-
case
|
|
10527
|
-
_yield$this$post =
|
|
10605
|
+
case 3:
|
|
10606
|
+
_yield$this$post = _context60.sent;
|
|
10528
10607
|
segment = _yield$this$post.segment;
|
|
10529
|
-
return
|
|
10608
|
+
return _context60.abrupt("return", segment);
|
|
10530
10609
|
|
|
10531
|
-
case
|
|
10610
|
+
case 6:
|
|
10532
10611
|
case "end":
|
|
10533
|
-
return
|
|
10612
|
+
return _context60.stop();
|
|
10534
10613
|
}
|
|
10535
10614
|
}
|
|
10536
|
-
},
|
|
10615
|
+
}, _callee60, this);
|
|
10537
10616
|
}));
|
|
10538
10617
|
|
|
10539
|
-
function createSegment(
|
|
10618
|
+
function createSegment(_x80, _x81, _x82, _x83) {
|
|
10540
10619
|
return _createSegment.apply(this, arguments);
|
|
10541
10620
|
}
|
|
10542
10621
|
|
|
10543
10622
|
return createSegment;
|
|
10544
10623
|
}()
|
|
10545
10624
|
/**
|
|
10546
|
-
*
|
|
10625
|
+
* createUserSegment - Creates a user segment
|
|
10547
10626
|
*
|
|
10627
|
+
* @param {string} id Segment ID (valid UUID)
|
|
10628
|
+
* @param {string} name Segment name
|
|
10629
|
+
* @param {SegmentData} data Segment data
|
|
10548
10630
|
*
|
|
10549
|
-
* @return {Segment
|
|
10631
|
+
* @return {Segment} The created Segment
|
|
10550
10632
|
*/
|
|
10551
10633
|
|
|
10552
10634
|
}, {
|
|
10553
|
-
key: "
|
|
10635
|
+
key: "createUserSegment",
|
|
10554
10636
|
value: function () {
|
|
10555
|
-
var
|
|
10556
|
-
|
|
10557
|
-
_args60 = arguments;
|
|
10558
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee60$(_context60) {
|
|
10637
|
+
var _createUserSegment = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee61(id, name, data) {
|
|
10638
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee61$(_context61) {
|
|
10559
10639
|
while (1) {
|
|
10560
|
-
switch (
|
|
10640
|
+
switch (_context61.prev = _context61.next) {
|
|
10561
10641
|
case 0:
|
|
10562
|
-
|
|
10563
|
-
|
|
10564
|
-
return this.get(this.baseURL + "/segments", {
|
|
10565
|
-
payload: _objectSpread({
|
|
10566
|
-
filter_conditions: filters
|
|
10567
|
-
}, options)
|
|
10568
|
-
});
|
|
10642
|
+
_context61.next = 2;
|
|
10643
|
+
return this.createSegment('user', id, name, data);
|
|
10569
10644
|
|
|
10570
|
-
case
|
|
10571
|
-
return
|
|
10645
|
+
case 2:
|
|
10646
|
+
return _context61.abrupt("return", _context61.sent);
|
|
10572
10647
|
|
|
10573
|
-
case
|
|
10648
|
+
case 3:
|
|
10574
10649
|
case "end":
|
|
10575
|
-
return
|
|
10650
|
+
return _context61.stop();
|
|
10576
10651
|
}
|
|
10577
10652
|
}
|
|
10578
|
-
},
|
|
10653
|
+
}, _callee61, this);
|
|
10579
10654
|
}));
|
|
10580
10655
|
|
|
10581
|
-
function
|
|
10582
|
-
return
|
|
10656
|
+
function createUserSegment(_x84, _x85, _x86) {
|
|
10657
|
+
return _createUserSegment.apply(this, arguments);
|
|
10583
10658
|
}
|
|
10584
10659
|
|
|
10585
|
-
return
|
|
10660
|
+
return createUserSegment;
|
|
10586
10661
|
}()
|
|
10587
10662
|
/**
|
|
10588
|
-
*
|
|
10663
|
+
* createChannelSegment - Creates a channel segment
|
|
10589
10664
|
*
|
|
10590
|
-
* @param {string} id Segment ID
|
|
10591
|
-
* @param {
|
|
10665
|
+
* @param {string} id Segment ID (valid UUID)
|
|
10666
|
+
* @param {string} name Segment name
|
|
10667
|
+
* @param {SegmentData} data Segment data
|
|
10592
10668
|
*
|
|
10593
|
-
* @return {Segment}
|
|
10669
|
+
* @return {Segment} The created Segment
|
|
10594
10670
|
*/
|
|
10595
10671
|
|
|
10596
10672
|
}, {
|
|
10597
|
-
key: "
|
|
10673
|
+
key: "createChannelSegment",
|
|
10598
10674
|
value: function () {
|
|
10599
|
-
var
|
|
10600
|
-
|
|
10601
|
-
|
|
10602
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee61$(_context61) {
|
|
10675
|
+
var _createChannelSegment = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee62(id, name, data) {
|
|
10676
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee62$(_context62) {
|
|
10603
10677
|
while (1) {
|
|
10604
|
-
switch (
|
|
10678
|
+
switch (_context62.prev = _context62.next) {
|
|
10605
10679
|
case 0:
|
|
10606
|
-
|
|
10607
|
-
return this.
|
|
10608
|
-
segment: params
|
|
10609
|
-
});
|
|
10680
|
+
_context62.next = 2;
|
|
10681
|
+
return this.createSegment('channel', id, name, data);
|
|
10610
10682
|
|
|
10611
10683
|
case 2:
|
|
10612
|
-
|
|
10613
|
-
segment = _yield$this$put.segment;
|
|
10614
|
-
return _context61.abrupt("return", segment);
|
|
10684
|
+
return _context62.abrupt("return", _context62.sent);
|
|
10615
10685
|
|
|
10616
|
-
case
|
|
10686
|
+
case 3:
|
|
10617
10687
|
case "end":
|
|
10618
|
-
return
|
|
10688
|
+
return _context62.stop();
|
|
10619
10689
|
}
|
|
10620
10690
|
}
|
|
10621
|
-
},
|
|
10691
|
+
}, _callee62, this);
|
|
10622
10692
|
}));
|
|
10623
10693
|
|
|
10624
|
-
function
|
|
10694
|
+
function createChannelSegment(_x87, _x88, _x89) {
|
|
10695
|
+
return _createChannelSegment.apply(this, arguments);
|
|
10696
|
+
}
|
|
10697
|
+
|
|
10698
|
+
return createChannelSegment;
|
|
10699
|
+
}()
|
|
10700
|
+
/**
|
|
10701
|
+
* updateSegment - Update a segment
|
|
10702
|
+
*
|
|
10703
|
+
* @param {string} id Segment ID
|
|
10704
|
+
* @param {Partial<UpdateSegmentData>} data Data to update
|
|
10705
|
+
*
|
|
10706
|
+
* @return {Segment} Updated Segment
|
|
10707
|
+
*/
|
|
10708
|
+
|
|
10709
|
+
}, {
|
|
10710
|
+
key: "updateSegment",
|
|
10711
|
+
value: function () {
|
|
10712
|
+
var _updateSegment = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee63(id, data) {
|
|
10713
|
+
var _yield$this$put, segment;
|
|
10714
|
+
|
|
10715
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee63$(_context63) {
|
|
10716
|
+
while (1) {
|
|
10717
|
+
switch (_context63.prev = _context63.next) {
|
|
10718
|
+
case 0:
|
|
10719
|
+
_context63.next = 2;
|
|
10720
|
+
return this.put(this.baseURL + "/segments/".concat(id), data);
|
|
10721
|
+
|
|
10722
|
+
case 2:
|
|
10723
|
+
_yield$this$put = _context63.sent;
|
|
10724
|
+
segment = _yield$this$put.segment;
|
|
10725
|
+
return _context63.abrupt("return", segment);
|
|
10726
|
+
|
|
10727
|
+
case 5:
|
|
10728
|
+
case "end":
|
|
10729
|
+
return _context63.stop();
|
|
10730
|
+
}
|
|
10731
|
+
}
|
|
10732
|
+
}, _callee63, this);
|
|
10733
|
+
}));
|
|
10734
|
+
|
|
10735
|
+
function updateSegment(_x90, _x91) {
|
|
10625
10736
|
return _updateSegment.apply(this, arguments);
|
|
10626
10737
|
}
|
|
10627
10738
|
|
|
10628
10739
|
return updateSegment;
|
|
10629
10740
|
}()
|
|
10741
|
+
/**
|
|
10742
|
+
* addSegmentTargets - Add targets to a segment
|
|
10743
|
+
*
|
|
10744
|
+
* @param {string} id Segment ID
|
|
10745
|
+
* @param {string[]} targets Targets to add to the segment
|
|
10746
|
+
*
|
|
10747
|
+
* @return {APIResponse} API response
|
|
10748
|
+
*/
|
|
10749
|
+
|
|
10750
|
+
}, {
|
|
10751
|
+
key: "addSegmentTargets",
|
|
10752
|
+
value: function () {
|
|
10753
|
+
var _addSegmentTargets = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee64(id, targets) {
|
|
10754
|
+
var body;
|
|
10755
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee64$(_context64) {
|
|
10756
|
+
while (1) {
|
|
10757
|
+
switch (_context64.prev = _context64.next) {
|
|
10758
|
+
case 0:
|
|
10759
|
+
body = {
|
|
10760
|
+
targets: targets
|
|
10761
|
+
};
|
|
10762
|
+
_context64.next = 3;
|
|
10763
|
+
return this.post(this.baseURL + "/segments/".concat(id, "/addtargets"), body);
|
|
10764
|
+
|
|
10765
|
+
case 3:
|
|
10766
|
+
return _context64.abrupt("return", _context64.sent);
|
|
10767
|
+
|
|
10768
|
+
case 4:
|
|
10769
|
+
case "end":
|
|
10770
|
+
return _context64.stop();
|
|
10771
|
+
}
|
|
10772
|
+
}
|
|
10773
|
+
}, _callee64, this);
|
|
10774
|
+
}));
|
|
10775
|
+
|
|
10776
|
+
function addSegmentTargets(_x92, _x93) {
|
|
10777
|
+
return _addSegmentTargets.apply(this, arguments);
|
|
10778
|
+
}
|
|
10779
|
+
|
|
10780
|
+
return addSegmentTargets;
|
|
10781
|
+
}()
|
|
10782
|
+
/**
|
|
10783
|
+
* deleteSegmentTargets - Delete targets from a segment
|
|
10784
|
+
*
|
|
10785
|
+
* @param {string} id Segment ID
|
|
10786
|
+
* @param {string[]} targets Targets to add to the segment
|
|
10787
|
+
*
|
|
10788
|
+
* @return {APIResponse} API response
|
|
10789
|
+
*/
|
|
10790
|
+
|
|
10791
|
+
}, {
|
|
10792
|
+
key: "deleteSegmentTargets",
|
|
10793
|
+
value: function () {
|
|
10794
|
+
var _deleteSegmentTargets = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee65(id, targets) {
|
|
10795
|
+
var body;
|
|
10796
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee65$(_context65) {
|
|
10797
|
+
while (1) {
|
|
10798
|
+
switch (_context65.prev = _context65.next) {
|
|
10799
|
+
case 0:
|
|
10800
|
+
body = {
|
|
10801
|
+
targets: targets
|
|
10802
|
+
};
|
|
10803
|
+
_context65.next = 3;
|
|
10804
|
+
return this.post(this.baseURL + "/segments/".concat(id, "/deletetargets"), body);
|
|
10805
|
+
|
|
10806
|
+
case 3:
|
|
10807
|
+
return _context65.abrupt("return", _context65.sent);
|
|
10808
|
+
|
|
10809
|
+
case 4:
|
|
10810
|
+
case "end":
|
|
10811
|
+
return _context65.stop();
|
|
10812
|
+
}
|
|
10813
|
+
}
|
|
10814
|
+
}, _callee65, this);
|
|
10815
|
+
}));
|
|
10816
|
+
|
|
10817
|
+
function deleteSegmentTargets(_x94, _x95) {
|
|
10818
|
+
return _deleteSegmentTargets.apply(this, arguments);
|
|
10819
|
+
}
|
|
10820
|
+
|
|
10821
|
+
return deleteSegmentTargets;
|
|
10822
|
+
}()
|
|
10823
|
+
/**
|
|
10824
|
+
* querySegments - Query Segments
|
|
10825
|
+
*
|
|
10826
|
+
* @param {filter} filter MongoDB style filter conditions
|
|
10827
|
+
* @param {QuerySegmentsOptions} options Options for sorting/paginating the results
|
|
10828
|
+
*
|
|
10829
|
+
* @return {Segment[]} Segments
|
|
10830
|
+
*/
|
|
10831
|
+
|
|
10832
|
+
}, {
|
|
10833
|
+
key: "querySegments",
|
|
10834
|
+
value: function () {
|
|
10835
|
+
var _querySegments = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee66(filter) {
|
|
10836
|
+
var options,
|
|
10837
|
+
_args66 = arguments;
|
|
10838
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee66$(_context66) {
|
|
10839
|
+
while (1) {
|
|
10840
|
+
switch (_context66.prev = _context66.next) {
|
|
10841
|
+
case 0:
|
|
10842
|
+
options = _args66.length > 1 && _args66[1] !== undefined ? _args66[1] : {};
|
|
10843
|
+
_context66.next = 3;
|
|
10844
|
+
return this.get(this.baseURL + "/segments", {
|
|
10845
|
+
payload: _objectSpread({
|
|
10846
|
+
filter: filter
|
|
10847
|
+
}, options)
|
|
10848
|
+
});
|
|
10849
|
+
|
|
10850
|
+
case 3:
|
|
10851
|
+
return _context66.abrupt("return", _context66.sent);
|
|
10852
|
+
|
|
10853
|
+
case 4:
|
|
10854
|
+
case "end":
|
|
10855
|
+
return _context66.stop();
|
|
10856
|
+
}
|
|
10857
|
+
}
|
|
10858
|
+
}, _callee66, this);
|
|
10859
|
+
}));
|
|
10860
|
+
|
|
10861
|
+
function querySegments(_x96) {
|
|
10862
|
+
return _querySegments.apply(this, arguments);
|
|
10863
|
+
}
|
|
10864
|
+
|
|
10865
|
+
return querySegments;
|
|
10866
|
+
}()
|
|
10630
10867
|
/**
|
|
10631
10868
|
* deleteSegment - Delete a Campaign Segment
|
|
10632
10869
|
*
|
|
@@ -10638,27 +10875,68 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10638
10875
|
}, {
|
|
10639
10876
|
key: "deleteSegment",
|
|
10640
10877
|
value: function () {
|
|
10641
|
-
var _deleteSegment = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
10642
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
10878
|
+
var _deleteSegment = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee67(id) {
|
|
10879
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee67$(_context67) {
|
|
10643
10880
|
while (1) {
|
|
10644
|
-
switch (
|
|
10881
|
+
switch (_context67.prev = _context67.next) {
|
|
10645
10882
|
case 0:
|
|
10646
|
-
|
|
10883
|
+
_context67.next = 2;
|
|
10884
|
+
return this.delete(this.baseURL + "/segments/".concat(id));
|
|
10647
10885
|
|
|
10648
|
-
case
|
|
10886
|
+
case 2:
|
|
10887
|
+
return _context67.abrupt("return", _context67.sent);
|
|
10888
|
+
|
|
10889
|
+
case 3:
|
|
10649
10890
|
case "end":
|
|
10650
|
-
return
|
|
10891
|
+
return _context67.stop();
|
|
10651
10892
|
}
|
|
10652
10893
|
}
|
|
10653
|
-
},
|
|
10894
|
+
}, _callee67, this);
|
|
10654
10895
|
}));
|
|
10655
10896
|
|
|
10656
|
-
function deleteSegment(
|
|
10897
|
+
function deleteSegment(_x97) {
|
|
10657
10898
|
return _deleteSegment.apply(this, arguments);
|
|
10658
10899
|
}
|
|
10659
10900
|
|
|
10660
10901
|
return deleteSegment;
|
|
10661
10902
|
}()
|
|
10903
|
+
/**
|
|
10904
|
+
* segmentTargetExists - Check if a target exists in a segment
|
|
10905
|
+
*
|
|
10906
|
+
* @param {string} segmentId Segment ID
|
|
10907
|
+
* @param {string} targetId Target ID
|
|
10908
|
+
*
|
|
10909
|
+
* @return {Promise<APIResponse>} The Server Response
|
|
10910
|
+
*/
|
|
10911
|
+
|
|
10912
|
+
}, {
|
|
10913
|
+
key: "segmentTargetExists",
|
|
10914
|
+
value: function () {
|
|
10915
|
+
var _segmentTargetExists = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee68(segmentId, targetId) {
|
|
10916
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee68$(_context68) {
|
|
10917
|
+
while (1) {
|
|
10918
|
+
switch (_context68.prev = _context68.next) {
|
|
10919
|
+
case 0:
|
|
10920
|
+
_context68.next = 2;
|
|
10921
|
+
return this.get(this.baseURL + "/segments/".concat(segmentId, "/target/").concat(targetId));
|
|
10922
|
+
|
|
10923
|
+
case 2:
|
|
10924
|
+
return _context68.abrupt("return", _context68.sent);
|
|
10925
|
+
|
|
10926
|
+
case 3:
|
|
10927
|
+
case "end":
|
|
10928
|
+
return _context68.stop();
|
|
10929
|
+
}
|
|
10930
|
+
}
|
|
10931
|
+
}, _callee68, this);
|
|
10932
|
+
}));
|
|
10933
|
+
|
|
10934
|
+
function segmentTargetExists(_x98, _x99) {
|
|
10935
|
+
return _segmentTargetExists.apply(this, arguments);
|
|
10936
|
+
}
|
|
10937
|
+
|
|
10938
|
+
return segmentTargetExists;
|
|
10939
|
+
}()
|
|
10662
10940
|
/**
|
|
10663
10941
|
* createCampaign - Creates a Campaign
|
|
10664
10942
|
*
|
|
@@ -10670,32 +10948,32 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10670
10948
|
}, {
|
|
10671
10949
|
key: "createCampaign",
|
|
10672
10950
|
value: function () {
|
|
10673
|
-
var _createCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
10951
|
+
var _createCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee69(params) {
|
|
10674
10952
|
var _yield$this$post2, campaign;
|
|
10675
10953
|
|
|
10676
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
10954
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee69$(_context69) {
|
|
10677
10955
|
while (1) {
|
|
10678
|
-
switch (
|
|
10956
|
+
switch (_context69.prev = _context69.next) {
|
|
10679
10957
|
case 0:
|
|
10680
|
-
|
|
10958
|
+
_context69.next = 2;
|
|
10681
10959
|
return this.post(this.baseURL + "/campaigns", {
|
|
10682
10960
|
campaign: params
|
|
10683
10961
|
});
|
|
10684
10962
|
|
|
10685
10963
|
case 2:
|
|
10686
|
-
_yield$this$post2 =
|
|
10964
|
+
_yield$this$post2 = _context69.sent;
|
|
10687
10965
|
campaign = _yield$this$post2.campaign;
|
|
10688
|
-
return
|
|
10966
|
+
return _context69.abrupt("return", campaign);
|
|
10689
10967
|
|
|
10690
10968
|
case 5:
|
|
10691
10969
|
case "end":
|
|
10692
|
-
return
|
|
10970
|
+
return _context69.stop();
|
|
10693
10971
|
}
|
|
10694
10972
|
}
|
|
10695
|
-
},
|
|
10973
|
+
}, _callee69, this);
|
|
10696
10974
|
}));
|
|
10697
10975
|
|
|
10698
|
-
function createCampaign(
|
|
10976
|
+
function createCampaign(_x100) {
|
|
10699
10977
|
return _createCampaign.apply(this, arguments);
|
|
10700
10978
|
}
|
|
10701
10979
|
|
|
@@ -10711,15 +10989,15 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10711
10989
|
}, {
|
|
10712
10990
|
key: "queryCampaigns",
|
|
10713
10991
|
value: function () {
|
|
10714
|
-
var _queryCampaigns = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
10992
|
+
var _queryCampaigns = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee70(filters) {
|
|
10715
10993
|
var options,
|
|
10716
|
-
|
|
10717
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
10994
|
+
_args70 = arguments;
|
|
10995
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee70$(_context70) {
|
|
10718
10996
|
while (1) {
|
|
10719
|
-
switch (
|
|
10997
|
+
switch (_context70.prev = _context70.next) {
|
|
10720
10998
|
case 0:
|
|
10721
|
-
options =
|
|
10722
|
-
|
|
10999
|
+
options = _args70.length > 1 && _args70[1] !== undefined ? _args70[1] : {};
|
|
11000
|
+
_context70.next = 3;
|
|
10723
11001
|
return this.get(this.baseURL + "/campaigns", {
|
|
10724
11002
|
payload: _objectSpread({
|
|
10725
11003
|
filter_conditions: filters
|
|
@@ -10727,17 +11005,17 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10727
11005
|
});
|
|
10728
11006
|
|
|
10729
11007
|
case 3:
|
|
10730
|
-
return
|
|
11008
|
+
return _context70.abrupt("return", _context70.sent);
|
|
10731
11009
|
|
|
10732
11010
|
case 4:
|
|
10733
11011
|
case "end":
|
|
10734
|
-
return
|
|
11012
|
+
return _context70.stop();
|
|
10735
11013
|
}
|
|
10736
11014
|
}
|
|
10737
|
-
},
|
|
11015
|
+
}, _callee70, this);
|
|
10738
11016
|
}));
|
|
10739
11017
|
|
|
10740
|
-
function queryCampaigns(
|
|
11018
|
+
function queryCampaigns(_x101) {
|
|
10741
11019
|
return _queryCampaigns.apply(this, arguments);
|
|
10742
11020
|
}
|
|
10743
11021
|
|
|
@@ -10755,32 +11033,32 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10755
11033
|
}, {
|
|
10756
11034
|
key: "updateCampaign",
|
|
10757
11035
|
value: function () {
|
|
10758
|
-
var _updateCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
11036
|
+
var _updateCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee71(id, params) {
|
|
10759
11037
|
var _yield$this$put2, campaign;
|
|
10760
11038
|
|
|
10761
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
11039
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee71$(_context71) {
|
|
10762
11040
|
while (1) {
|
|
10763
|
-
switch (
|
|
11041
|
+
switch (_context71.prev = _context71.next) {
|
|
10764
11042
|
case 0:
|
|
10765
|
-
|
|
11043
|
+
_context71.next = 2;
|
|
10766
11044
|
return this.put(this.baseURL + "/campaigns/".concat(id), {
|
|
10767
11045
|
campaign: params
|
|
10768
11046
|
});
|
|
10769
11047
|
|
|
10770
11048
|
case 2:
|
|
10771
|
-
_yield$this$put2 =
|
|
11049
|
+
_yield$this$put2 = _context71.sent;
|
|
10772
11050
|
campaign = _yield$this$put2.campaign;
|
|
10773
|
-
return
|
|
11051
|
+
return _context71.abrupt("return", campaign);
|
|
10774
11052
|
|
|
10775
11053
|
case 5:
|
|
10776
11054
|
case "end":
|
|
10777
|
-
return
|
|
11055
|
+
return _context71.stop();
|
|
10778
11056
|
}
|
|
10779
11057
|
}
|
|
10780
|
-
},
|
|
11058
|
+
}, _callee71, this);
|
|
10781
11059
|
}));
|
|
10782
11060
|
|
|
10783
|
-
function updateCampaign(
|
|
11061
|
+
function updateCampaign(_x102, _x103) {
|
|
10784
11062
|
return _updateCampaign.apply(this, arguments);
|
|
10785
11063
|
}
|
|
10786
11064
|
|
|
@@ -10797,25 +11075,25 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10797
11075
|
}, {
|
|
10798
11076
|
key: "deleteCampaign",
|
|
10799
11077
|
value: function () {
|
|
10800
|
-
var _deleteCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
11078
|
+
var _deleteCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee72(id) {
|
|
10801
11079
|
var params,
|
|
10802
|
-
|
|
10803
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
11080
|
+
_args72 = arguments;
|
|
11081
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee72$(_context72) {
|
|
10804
11082
|
while (1) {
|
|
10805
|
-
switch (
|
|
11083
|
+
switch (_context72.prev = _context72.next) {
|
|
10806
11084
|
case 0:
|
|
10807
|
-
params =
|
|
10808
|
-
return
|
|
11085
|
+
params = _args72.length > 1 && _args72[1] !== undefined ? _args72[1] : {};
|
|
11086
|
+
return _context72.abrupt("return", this.delete(this.baseURL + "/campaigns/".concat(id), params));
|
|
10809
11087
|
|
|
10810
11088
|
case 2:
|
|
10811
11089
|
case "end":
|
|
10812
|
-
return
|
|
11090
|
+
return _context72.stop();
|
|
10813
11091
|
}
|
|
10814
11092
|
}
|
|
10815
|
-
},
|
|
11093
|
+
}, _callee72, this);
|
|
10816
11094
|
}));
|
|
10817
11095
|
|
|
10818
|
-
function deleteCampaign(
|
|
11096
|
+
function deleteCampaign(_x104) {
|
|
10819
11097
|
return _deleteCampaign.apply(this, arguments);
|
|
10820
11098
|
}
|
|
10821
11099
|
|
|
@@ -10833,33 +11111,33 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10833
11111
|
}, {
|
|
10834
11112
|
key: "scheduleCampaign",
|
|
10835
11113
|
value: function () {
|
|
10836
|
-
var _scheduleCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
11114
|
+
var _scheduleCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee73(id, params) {
|
|
10837
11115
|
var scheduledFor, _yield$this$patch, campaign;
|
|
10838
11116
|
|
|
10839
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
11117
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee73$(_context73) {
|
|
10840
11118
|
while (1) {
|
|
10841
|
-
switch (
|
|
11119
|
+
switch (_context73.prev = _context73.next) {
|
|
10842
11120
|
case 0:
|
|
10843
11121
|
scheduledFor = params.scheduledFor;
|
|
10844
|
-
|
|
11122
|
+
_context73.next = 3;
|
|
10845
11123
|
return this.patch(this.baseURL + "/campaigns/".concat(id, "/schedule"), {
|
|
10846
11124
|
scheduled_for: scheduledFor
|
|
10847
11125
|
});
|
|
10848
11126
|
|
|
10849
11127
|
case 3:
|
|
10850
|
-
_yield$this$patch =
|
|
11128
|
+
_yield$this$patch = _context73.sent;
|
|
10851
11129
|
campaign = _yield$this$patch.campaign;
|
|
10852
|
-
return
|
|
11130
|
+
return _context73.abrupt("return", campaign);
|
|
10853
11131
|
|
|
10854
11132
|
case 6:
|
|
10855
11133
|
case "end":
|
|
10856
|
-
return
|
|
11134
|
+
return _context73.stop();
|
|
10857
11135
|
}
|
|
10858
11136
|
}
|
|
10859
|
-
},
|
|
11137
|
+
}, _callee73, this);
|
|
10860
11138
|
}));
|
|
10861
11139
|
|
|
10862
|
-
function scheduleCampaign(
|
|
11140
|
+
function scheduleCampaign(_x105, _x106) {
|
|
10863
11141
|
return _scheduleCampaign.apply(this, arguments);
|
|
10864
11142
|
}
|
|
10865
11143
|
|
|
@@ -10876,30 +11154,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10876
11154
|
}, {
|
|
10877
11155
|
key: "stopCampaign",
|
|
10878
11156
|
value: function () {
|
|
10879
|
-
var _stopCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
11157
|
+
var _stopCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee74(id) {
|
|
10880
11158
|
var _yield$this$patch2, campaign;
|
|
10881
11159
|
|
|
10882
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
11160
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee74$(_context74) {
|
|
10883
11161
|
while (1) {
|
|
10884
|
-
switch (
|
|
11162
|
+
switch (_context74.prev = _context74.next) {
|
|
10885
11163
|
case 0:
|
|
10886
|
-
|
|
11164
|
+
_context74.next = 2;
|
|
10887
11165
|
return this.patch(this.baseURL + "/campaigns/".concat(id, "/stop"));
|
|
10888
11166
|
|
|
10889
11167
|
case 2:
|
|
10890
|
-
_yield$this$patch2 =
|
|
11168
|
+
_yield$this$patch2 = _context74.sent;
|
|
10891
11169
|
campaign = _yield$this$patch2.campaign;
|
|
10892
|
-
return
|
|
11170
|
+
return _context74.abrupt("return", campaign);
|
|
10893
11171
|
|
|
10894
11172
|
case 5:
|
|
10895
11173
|
case "end":
|
|
10896
|
-
return
|
|
11174
|
+
return _context74.stop();
|
|
10897
11175
|
}
|
|
10898
11176
|
}
|
|
10899
|
-
},
|
|
11177
|
+
}, _callee74, this);
|
|
10900
11178
|
}));
|
|
10901
11179
|
|
|
10902
|
-
function stopCampaign(
|
|
11180
|
+
function stopCampaign(_x107) {
|
|
10903
11181
|
return _stopCampaign.apply(this, arguments);
|
|
10904
11182
|
}
|
|
10905
11183
|
|
|
@@ -10916,30 +11194,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10916
11194
|
}, {
|
|
10917
11195
|
key: "resumeCampaign",
|
|
10918
11196
|
value: function () {
|
|
10919
|
-
var _resumeCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
11197
|
+
var _resumeCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee75(id) {
|
|
10920
11198
|
var _yield$this$patch3, campaign;
|
|
10921
11199
|
|
|
10922
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
11200
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee75$(_context75) {
|
|
10923
11201
|
while (1) {
|
|
10924
|
-
switch (
|
|
11202
|
+
switch (_context75.prev = _context75.next) {
|
|
10925
11203
|
case 0:
|
|
10926
|
-
|
|
11204
|
+
_context75.next = 2;
|
|
10927
11205
|
return this.patch(this.baseURL + "/campaigns/".concat(id, "/resume"));
|
|
10928
11206
|
|
|
10929
11207
|
case 2:
|
|
10930
|
-
_yield$this$patch3 =
|
|
11208
|
+
_yield$this$patch3 = _context75.sent;
|
|
10931
11209
|
campaign = _yield$this$patch3.campaign;
|
|
10932
|
-
return
|
|
11210
|
+
return _context75.abrupt("return", campaign);
|
|
10933
11211
|
|
|
10934
11212
|
case 5:
|
|
10935
11213
|
case "end":
|
|
10936
|
-
return
|
|
11214
|
+
return _context75.stop();
|
|
10937
11215
|
}
|
|
10938
11216
|
}
|
|
10939
|
-
},
|
|
11217
|
+
}, _callee75, this);
|
|
10940
11218
|
}));
|
|
10941
11219
|
|
|
10942
|
-
function resumeCampaign(
|
|
11220
|
+
function resumeCampaign(_x108) {
|
|
10943
11221
|
return _resumeCampaign.apply(this, arguments);
|
|
10944
11222
|
}
|
|
10945
11223
|
|
|
@@ -10957,77 +11235,35 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10957
11235
|
}, {
|
|
10958
11236
|
key: "testCampaign",
|
|
10959
11237
|
value: function () {
|
|
10960
|
-
var _testCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
11238
|
+
var _testCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee76(id, params) {
|
|
10961
11239
|
var users;
|
|
10962
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
11240
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee76$(_context76) {
|
|
10963
11241
|
while (1) {
|
|
10964
|
-
switch (
|
|
11242
|
+
switch (_context76.prev = _context76.next) {
|
|
10965
11243
|
case 0:
|
|
10966
11244
|
users = params.users;
|
|
10967
|
-
|
|
11245
|
+
_context76.next = 3;
|
|
10968
11246
|
return this.post(this.baseURL + "/campaigns/".concat(id, "/test"), {
|
|
10969
11247
|
users: users
|
|
10970
11248
|
});
|
|
10971
11249
|
|
|
10972
11250
|
case 3:
|
|
10973
|
-
return
|
|
11251
|
+
return _context76.abrupt("return", _context76.sent);
|
|
10974
11252
|
|
|
10975
11253
|
case 4:
|
|
10976
11254
|
case "end":
|
|
10977
|
-
return
|
|
11255
|
+
return _context76.stop();
|
|
10978
11256
|
}
|
|
10979
11257
|
}
|
|
10980
|
-
},
|
|
11258
|
+
}, _callee76, this);
|
|
10981
11259
|
}));
|
|
10982
11260
|
|
|
10983
|
-
function testCampaign(
|
|
11261
|
+
function testCampaign(_x109, _x110) {
|
|
10984
11262
|
return _testCampaign.apply(this, arguments);
|
|
10985
11263
|
}
|
|
10986
11264
|
|
|
10987
11265
|
return testCampaign;
|
|
10988
11266
|
}()
|
|
10989
|
-
/**
|
|
10990
|
-
* queryRecipients - Query Campaign Recipient Results
|
|
10991
|
-
*
|
|
10992
|
-
*
|
|
10993
|
-
* @return {Recipient[]} Recipients
|
|
10994
|
-
*/
|
|
10995
|
-
|
|
10996
|
-
}, {
|
|
10997
|
-
key: "queryRecipients",
|
|
10998
|
-
value: function () {
|
|
10999
|
-
var _queryRecipients = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee71(filters) {
|
|
11000
|
-
var options,
|
|
11001
|
-
_args71 = arguments;
|
|
11002
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee71$(_context71) {
|
|
11003
|
-
while (1) {
|
|
11004
|
-
switch (_context71.prev = _context71.next) {
|
|
11005
|
-
case 0:
|
|
11006
|
-
options = _args71.length > 1 && _args71[1] !== undefined ? _args71[1] : {};
|
|
11007
|
-
_context71.next = 3;
|
|
11008
|
-
return this.get(this.baseURL + "/recipients", {
|
|
11009
|
-
payload: _objectSpread({
|
|
11010
|
-
filter_conditions: filters
|
|
11011
|
-
}, options)
|
|
11012
|
-
});
|
|
11013
|
-
|
|
11014
|
-
case 3:
|
|
11015
|
-
return _context71.abrupt("return", _context71.sent);
|
|
11016
|
-
|
|
11017
|
-
case 4:
|
|
11018
|
-
case "end":
|
|
11019
|
-
return _context71.stop();
|
|
11020
|
-
}
|
|
11021
|
-
}
|
|
11022
|
-
}, _callee71, this);
|
|
11023
|
-
}));
|
|
11024
|
-
|
|
11025
|
-
function queryRecipients(_x95) {
|
|
11026
|
-
return _queryRecipients.apply(this, arguments);
|
|
11027
|
-
}
|
|
11028
|
-
|
|
11029
|
-
return queryRecipients;
|
|
11030
|
-
}()
|
|
11031
11267
|
/**
|
|
11032
11268
|
* enrichURL - Get OpenGraph data of the given link
|
|
11033
11269
|
*
|
|
@@ -11038,24 +11274,24 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11038
11274
|
}, {
|
|
11039
11275
|
key: "enrichURL",
|
|
11040
11276
|
value: function () {
|
|
11041
|
-
var _enrichURL = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
11042
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
11277
|
+
var _enrichURL = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee77(url) {
|
|
11278
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee77$(_context77) {
|
|
11043
11279
|
while (1) {
|
|
11044
|
-
switch (
|
|
11280
|
+
switch (_context77.prev = _context77.next) {
|
|
11045
11281
|
case 0:
|
|
11046
|
-
return
|
|
11282
|
+
return _context77.abrupt("return", this.get(this.baseURL + "/og", {
|
|
11047
11283
|
url: url
|
|
11048
11284
|
}));
|
|
11049
11285
|
|
|
11050
11286
|
case 1:
|
|
11051
11287
|
case "end":
|
|
11052
|
-
return
|
|
11288
|
+
return _context77.stop();
|
|
11053
11289
|
}
|
|
11054
11290
|
}
|
|
11055
|
-
},
|
|
11291
|
+
}, _callee77, this);
|
|
11056
11292
|
}));
|
|
11057
11293
|
|
|
11058
|
-
function enrichURL(
|
|
11294
|
+
function enrichURL(_x111) {
|
|
11059
11295
|
return _enrichURL.apply(this, arguments);
|
|
11060
11296
|
}
|
|
11061
11297
|
|
|
@@ -11072,22 +11308,22 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11072
11308
|
}, {
|
|
11073
11309
|
key: "getTask",
|
|
11074
11310
|
value: function () {
|
|
11075
|
-
var _getTask = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
11076
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
11311
|
+
var _getTask = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee78(id) {
|
|
11312
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee78$(_context78) {
|
|
11077
11313
|
while (1) {
|
|
11078
|
-
switch (
|
|
11314
|
+
switch (_context78.prev = _context78.next) {
|
|
11079
11315
|
case 0:
|
|
11080
|
-
return
|
|
11316
|
+
return _context78.abrupt("return", this.get("".concat(this.baseURL, "/tasks/").concat(id)));
|
|
11081
11317
|
|
|
11082
11318
|
case 1:
|
|
11083
11319
|
case "end":
|
|
11084
|
-
return
|
|
11320
|
+
return _context78.stop();
|
|
11085
11321
|
}
|
|
11086
11322
|
}
|
|
11087
|
-
},
|
|
11323
|
+
}, _callee78, this);
|
|
11088
11324
|
}));
|
|
11089
11325
|
|
|
11090
|
-
function getTask(
|
|
11326
|
+
function getTask(_x112) {
|
|
11091
11327
|
return _getTask.apply(this, arguments);
|
|
11092
11328
|
}
|
|
11093
11329
|
|
|
@@ -11105,31 +11341,31 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11105
11341
|
}, {
|
|
11106
11342
|
key: "deleteChannels",
|
|
11107
11343
|
value: function () {
|
|
11108
|
-
var _deleteChannels = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
11344
|
+
var _deleteChannels = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee79(cids) {
|
|
11109
11345
|
var options,
|
|
11110
|
-
|
|
11111
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
11346
|
+
_args79 = arguments;
|
|
11347
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee79$(_context79) {
|
|
11112
11348
|
while (1) {
|
|
11113
|
-
switch (
|
|
11349
|
+
switch (_context79.prev = _context79.next) {
|
|
11114
11350
|
case 0:
|
|
11115
|
-
options =
|
|
11116
|
-
|
|
11351
|
+
options = _args79.length > 1 && _args79[1] !== undefined ? _args79[1] : {};
|
|
11352
|
+
_context79.next = 3;
|
|
11117
11353
|
return this.post(this.baseURL + "/channels/delete", _objectSpread({
|
|
11118
11354
|
cids: cids
|
|
11119
11355
|
}, options));
|
|
11120
11356
|
|
|
11121
11357
|
case 3:
|
|
11122
|
-
return
|
|
11358
|
+
return _context79.abrupt("return", _context79.sent);
|
|
11123
11359
|
|
|
11124
11360
|
case 4:
|
|
11125
11361
|
case "end":
|
|
11126
|
-
return
|
|
11362
|
+
return _context79.stop();
|
|
11127
11363
|
}
|
|
11128
11364
|
}
|
|
11129
|
-
},
|
|
11365
|
+
}, _callee79, this);
|
|
11130
11366
|
}));
|
|
11131
11367
|
|
|
11132
|
-
function deleteChannels(
|
|
11368
|
+
function deleteChannels(_x113) {
|
|
11133
11369
|
return _deleteChannels.apply(this, arguments);
|
|
11134
11370
|
}
|
|
11135
11371
|
|
|
@@ -11147,52 +11383,56 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11147
11383
|
}, {
|
|
11148
11384
|
key: "deleteUsers",
|
|
11149
11385
|
value: function () {
|
|
11150
|
-
var _deleteUsers = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
11151
|
-
|
|
11386
|
+
var _deleteUsers = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee80(user_ids) {
|
|
11387
|
+
var options,
|
|
11388
|
+
_args80 = arguments;
|
|
11389
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee80$(_context80) {
|
|
11152
11390
|
while (1) {
|
|
11153
|
-
switch (
|
|
11391
|
+
switch (_context80.prev = _context80.next) {
|
|
11154
11392
|
case 0:
|
|
11155
|
-
|
|
11156
|
-
|
|
11393
|
+
options = _args80.length > 1 && _args80[1] !== undefined ? _args80[1] : {};
|
|
11394
|
+
|
|
11395
|
+
if (!(typeof options.user !== 'undefined' && !['soft', 'hard', 'pruning'].includes(options.user))) {
|
|
11396
|
+
_context80.next = 3;
|
|
11157
11397
|
break;
|
|
11158
11398
|
}
|
|
11159
11399
|
|
|
11160
|
-
throw new Error('Invalid delete user options. user must be one of [soft hard]');
|
|
11400
|
+
throw new Error('Invalid delete user options. user must be one of [soft hard pruning]');
|
|
11161
11401
|
|
|
11162
|
-
case
|
|
11163
|
-
if (!(options.
|
|
11164
|
-
|
|
11402
|
+
case 3:
|
|
11403
|
+
if (!(typeof options.conversations !== 'undefined' && !['soft', 'hard'].includes(options.conversations))) {
|
|
11404
|
+
_context80.next = 5;
|
|
11165
11405
|
break;
|
|
11166
11406
|
}
|
|
11167
11407
|
|
|
11168
|
-
throw new Error('Invalid delete user options.
|
|
11408
|
+
throw new Error('Invalid delete user options. conversations must be one of [soft hard]');
|
|
11169
11409
|
|
|
11170
|
-
case
|
|
11171
|
-
if (!(options.
|
|
11172
|
-
|
|
11410
|
+
case 5:
|
|
11411
|
+
if (!(typeof options.messages !== 'undefined' && !['soft', 'hard', 'pruning'].includes(options.messages))) {
|
|
11412
|
+
_context80.next = 7;
|
|
11173
11413
|
break;
|
|
11174
11414
|
}
|
|
11175
11415
|
|
|
11176
|
-
throw new Error('Invalid delete user options.
|
|
11416
|
+
throw new Error('Invalid delete user options. messages must be one of [soft hard pruning]');
|
|
11177
11417
|
|
|
11178
|
-
case
|
|
11179
|
-
|
|
11418
|
+
case 7:
|
|
11419
|
+
_context80.next = 9;
|
|
11180
11420
|
return this.post(this.baseURL + "/users/delete", _objectSpread({
|
|
11181
11421
|
user_ids: user_ids
|
|
11182
11422
|
}, options));
|
|
11183
11423
|
|
|
11184
|
-
case 8:
|
|
11185
|
-
return _context75.abrupt("return", _context75.sent);
|
|
11186
|
-
|
|
11187
11424
|
case 9:
|
|
11425
|
+
return _context80.abrupt("return", _context80.sent);
|
|
11426
|
+
|
|
11427
|
+
case 10:
|
|
11188
11428
|
case "end":
|
|
11189
|
-
return
|
|
11429
|
+
return _context80.stop();
|
|
11190
11430
|
}
|
|
11191
11431
|
}
|
|
11192
|
-
},
|
|
11432
|
+
}, _callee80, this);
|
|
11193
11433
|
}));
|
|
11194
11434
|
|
|
11195
|
-
function deleteUsers(
|
|
11435
|
+
function deleteUsers(_x114) {
|
|
11196
11436
|
return _deleteUsers.apply(this, arguments);
|
|
11197
11437
|
}
|
|
11198
11438
|
|
|
@@ -11213,28 +11453,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11213
11453
|
}, {
|
|
11214
11454
|
key: "_createImportURL",
|
|
11215
11455
|
value: function () {
|
|
11216
|
-
var _createImportURL2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
11217
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
11456
|
+
var _createImportURL2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee81(filename) {
|
|
11457
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee81$(_context81) {
|
|
11218
11458
|
while (1) {
|
|
11219
|
-
switch (
|
|
11459
|
+
switch (_context81.prev = _context81.next) {
|
|
11220
11460
|
case 0:
|
|
11221
|
-
|
|
11461
|
+
_context81.next = 2;
|
|
11222
11462
|
return this.post(this.baseURL + "/import_urls", {
|
|
11223
11463
|
filename: filename
|
|
11224
11464
|
});
|
|
11225
11465
|
|
|
11226
11466
|
case 2:
|
|
11227
|
-
return
|
|
11467
|
+
return _context81.abrupt("return", _context81.sent);
|
|
11228
11468
|
|
|
11229
11469
|
case 3:
|
|
11230
11470
|
case "end":
|
|
11231
|
-
return
|
|
11471
|
+
return _context81.stop();
|
|
11232
11472
|
}
|
|
11233
11473
|
}
|
|
11234
|
-
},
|
|
11474
|
+
}, _callee81, this);
|
|
11235
11475
|
}));
|
|
11236
11476
|
|
|
11237
|
-
function _createImportURL(
|
|
11477
|
+
function _createImportURL(_x115) {
|
|
11238
11478
|
return _createImportURL2.apply(this, arguments);
|
|
11239
11479
|
}
|
|
11240
11480
|
|
|
@@ -11256,33 +11496,33 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11256
11496
|
}, {
|
|
11257
11497
|
key: "_createImport",
|
|
11258
11498
|
value: function () {
|
|
11259
|
-
var _createImport2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
11499
|
+
var _createImport2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee82(path) {
|
|
11260
11500
|
var options,
|
|
11261
|
-
|
|
11262
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
11501
|
+
_args82 = arguments;
|
|
11502
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee82$(_context82) {
|
|
11263
11503
|
while (1) {
|
|
11264
|
-
switch (
|
|
11504
|
+
switch (_context82.prev = _context82.next) {
|
|
11265
11505
|
case 0:
|
|
11266
|
-
options =
|
|
11506
|
+
options = _args82.length > 1 && _args82[1] !== undefined ? _args82[1] : {
|
|
11267
11507
|
mode: 'upsert'
|
|
11268
11508
|
};
|
|
11269
|
-
|
|
11509
|
+
_context82.next = 3;
|
|
11270
11510
|
return this.post(this.baseURL + "/imports", _objectSpread({
|
|
11271
11511
|
path: path
|
|
11272
11512
|
}, options));
|
|
11273
11513
|
|
|
11274
11514
|
case 3:
|
|
11275
|
-
return
|
|
11515
|
+
return _context82.abrupt("return", _context82.sent);
|
|
11276
11516
|
|
|
11277
11517
|
case 4:
|
|
11278
11518
|
case "end":
|
|
11279
|
-
return
|
|
11519
|
+
return _context82.stop();
|
|
11280
11520
|
}
|
|
11281
11521
|
}
|
|
11282
|
-
},
|
|
11522
|
+
}, _callee82, this);
|
|
11283
11523
|
}));
|
|
11284
11524
|
|
|
11285
|
-
function _createImport(
|
|
11525
|
+
function _createImport(_x116) {
|
|
11286
11526
|
return _createImport2.apply(this, arguments);
|
|
11287
11527
|
}
|
|
11288
11528
|
|
|
@@ -11304,26 +11544,26 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11304
11544
|
}, {
|
|
11305
11545
|
key: "_getImport",
|
|
11306
11546
|
value: function () {
|
|
11307
|
-
var _getImport2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
11308
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
11547
|
+
var _getImport2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee83(id) {
|
|
11548
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee83$(_context83) {
|
|
11309
11549
|
while (1) {
|
|
11310
|
-
switch (
|
|
11550
|
+
switch (_context83.prev = _context83.next) {
|
|
11311
11551
|
case 0:
|
|
11312
|
-
|
|
11552
|
+
_context83.next = 2;
|
|
11313
11553
|
return this.get(this.baseURL + "/imports/".concat(id));
|
|
11314
11554
|
|
|
11315
11555
|
case 2:
|
|
11316
|
-
return
|
|
11556
|
+
return _context83.abrupt("return", _context83.sent);
|
|
11317
11557
|
|
|
11318
11558
|
case 3:
|
|
11319
11559
|
case "end":
|
|
11320
|
-
return
|
|
11560
|
+
return _context83.stop();
|
|
11321
11561
|
}
|
|
11322
11562
|
}
|
|
11323
|
-
},
|
|
11563
|
+
}, _callee83, this);
|
|
11324
11564
|
}));
|
|
11325
11565
|
|
|
11326
|
-
function _getImport(
|
|
11566
|
+
function _getImport(_x117) {
|
|
11327
11567
|
return _getImport2.apply(this, arguments);
|
|
11328
11568
|
}
|
|
11329
11569
|
|
|
@@ -11345,26 +11585,26 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11345
11585
|
}, {
|
|
11346
11586
|
key: "_listImports",
|
|
11347
11587
|
value: function () {
|
|
11348
|
-
var _listImports2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
11349
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
11588
|
+
var _listImports2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee84(options) {
|
|
11589
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee84$(_context84) {
|
|
11350
11590
|
while (1) {
|
|
11351
|
-
switch (
|
|
11591
|
+
switch (_context84.prev = _context84.next) {
|
|
11352
11592
|
case 0:
|
|
11353
|
-
|
|
11593
|
+
_context84.next = 2;
|
|
11354
11594
|
return this.get(this.baseURL + "/imports", options);
|
|
11355
11595
|
|
|
11356
11596
|
case 2:
|
|
11357
|
-
return
|
|
11597
|
+
return _context84.abrupt("return", _context84.sent);
|
|
11358
11598
|
|
|
11359
11599
|
case 3:
|
|
11360
11600
|
case "end":
|
|
11361
|
-
return
|
|
11601
|
+
return _context84.stop();
|
|
11362
11602
|
}
|
|
11363
11603
|
}
|
|
11364
|
-
},
|
|
11604
|
+
}, _callee84, this);
|
|
11365
11605
|
}));
|
|
11366
11606
|
|
|
11367
|
-
function _listImports(
|
|
11607
|
+
function _listImports(_x118) {
|
|
11368
11608
|
return _listImports2.apply(this, arguments);
|
|
11369
11609
|
}
|
|
11370
11610
|
|
|
@@ -11383,28 +11623,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11383
11623
|
}, {
|
|
11384
11624
|
key: "upsertPushProvider",
|
|
11385
11625
|
value: function () {
|
|
11386
|
-
var _upsertPushProvider = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
11387
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
11626
|
+
var _upsertPushProvider = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee85(pushProvider) {
|
|
11627
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee85$(_context85) {
|
|
11388
11628
|
while (1) {
|
|
11389
|
-
switch (
|
|
11629
|
+
switch (_context85.prev = _context85.next) {
|
|
11390
11630
|
case 0:
|
|
11391
|
-
|
|
11631
|
+
_context85.next = 2;
|
|
11392
11632
|
return this.post(this.baseURL + "/push_providers", {
|
|
11393
11633
|
push_provider: pushProvider
|
|
11394
11634
|
});
|
|
11395
11635
|
|
|
11396
11636
|
case 2:
|
|
11397
|
-
return
|
|
11637
|
+
return _context85.abrupt("return", _context85.sent);
|
|
11398
11638
|
|
|
11399
11639
|
case 3:
|
|
11400
11640
|
case "end":
|
|
11401
|
-
return
|
|
11641
|
+
return _context85.stop();
|
|
11402
11642
|
}
|
|
11403
11643
|
}
|
|
11404
|
-
},
|
|
11644
|
+
}, _callee85, this);
|
|
11405
11645
|
}));
|
|
11406
11646
|
|
|
11407
|
-
function upsertPushProvider(
|
|
11647
|
+
function upsertPushProvider(_x119) {
|
|
11408
11648
|
return _upsertPushProvider.apply(this, arguments);
|
|
11409
11649
|
}
|
|
11410
11650
|
|
|
@@ -11423,28 +11663,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11423
11663
|
}, {
|
|
11424
11664
|
key: "deletePushProvider",
|
|
11425
11665
|
value: function () {
|
|
11426
|
-
var _deletePushProvider = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
11666
|
+
var _deletePushProvider = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee86(_ref10) {
|
|
11427
11667
|
var type, name;
|
|
11428
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
11668
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee86$(_context86) {
|
|
11429
11669
|
while (1) {
|
|
11430
|
-
switch (
|
|
11670
|
+
switch (_context86.prev = _context86.next) {
|
|
11431
11671
|
case 0:
|
|
11432
11672
|
type = _ref10.type, name = _ref10.name;
|
|
11433
|
-
|
|
11673
|
+
_context86.next = 3;
|
|
11434
11674
|
return this.delete(this.baseURL + "/push_providers/".concat(type, "/").concat(name));
|
|
11435
11675
|
|
|
11436
11676
|
case 3:
|
|
11437
|
-
return
|
|
11677
|
+
return _context86.abrupt("return", _context86.sent);
|
|
11438
11678
|
|
|
11439
11679
|
case 4:
|
|
11440
11680
|
case "end":
|
|
11441
|
-
return
|
|
11681
|
+
return _context86.stop();
|
|
11442
11682
|
}
|
|
11443
11683
|
}
|
|
11444
|
-
},
|
|
11684
|
+
}, _callee86, this);
|
|
11445
11685
|
}));
|
|
11446
11686
|
|
|
11447
|
-
function deletePushProvider(
|
|
11687
|
+
function deletePushProvider(_x120) {
|
|
11448
11688
|
return _deletePushProvider.apply(this, arguments);
|
|
11449
11689
|
}
|
|
11450
11690
|
|
|
@@ -11461,23 +11701,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11461
11701
|
}, {
|
|
11462
11702
|
key: "listPushProviders",
|
|
11463
11703
|
value: function () {
|
|
11464
|
-
var _listPushProviders = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
11465
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
11704
|
+
var _listPushProviders = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee87() {
|
|
11705
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee87$(_context87) {
|
|
11466
11706
|
while (1) {
|
|
11467
|
-
switch (
|
|
11707
|
+
switch (_context87.prev = _context87.next) {
|
|
11468
11708
|
case 0:
|
|
11469
|
-
|
|
11709
|
+
_context87.next = 2;
|
|
11470
11710
|
return this.get(this.baseURL + "/push_providers");
|
|
11471
11711
|
|
|
11472
11712
|
case 2:
|
|
11473
|
-
return
|
|
11713
|
+
return _context87.abrupt("return", _context87.sent);
|
|
11474
11714
|
|
|
11475
11715
|
case 3:
|
|
11476
11716
|
case "end":
|
|
11477
|
-
return
|
|
11717
|
+
return _context87.stop();
|
|
11478
11718
|
}
|
|
11479
11719
|
}
|
|
11480
|
-
},
|
|
11720
|
+
}, _callee87, this);
|
|
11481
11721
|
}));
|
|
11482
11722
|
|
|
11483
11723
|
function listPushProviders() {
|
|
@@ -11505,26 +11745,26 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11505
11745
|
}, {
|
|
11506
11746
|
key: "commitMessage",
|
|
11507
11747
|
value: function () {
|
|
11508
|
-
var _commitMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
11509
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
11748
|
+
var _commitMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee88(id) {
|
|
11749
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee88$(_context88) {
|
|
11510
11750
|
while (1) {
|
|
11511
|
-
switch (
|
|
11751
|
+
switch (_context88.prev = _context88.next) {
|
|
11512
11752
|
case 0:
|
|
11513
|
-
|
|
11753
|
+
_context88.next = 2;
|
|
11514
11754
|
return this.post(this.baseURL + "/messages/".concat(id, "/commit"));
|
|
11515
11755
|
|
|
11516
11756
|
case 2:
|
|
11517
|
-
return
|
|
11757
|
+
return _context88.abrupt("return", _context88.sent);
|
|
11518
11758
|
|
|
11519
11759
|
case 3:
|
|
11520
11760
|
case "end":
|
|
11521
|
-
return
|
|
11761
|
+
return _context88.stop();
|
|
11522
11762
|
}
|
|
11523
11763
|
}
|
|
11524
|
-
},
|
|
11764
|
+
}, _callee88, this);
|
|
11525
11765
|
}));
|
|
11526
11766
|
|
|
11527
|
-
function commitMessage(
|
|
11767
|
+
function commitMessage(_x121) {
|
|
11528
11768
|
return _commitMessage.apply(this, arguments);
|
|
11529
11769
|
}
|
|
11530
11770
|
|
|
@@ -11576,6 +11816,7 @@ var EVENT_MAP = {
|
|
|
11576
11816
|
'notification.invite_rejected': true,
|
|
11577
11817
|
'notification.invited': true,
|
|
11578
11818
|
'notification.mark_read': true,
|
|
11819
|
+
'notification.mark_unread': true,
|
|
11579
11820
|
'notification.message_new': true,
|
|
11580
11821
|
'notification.mutes_updated': true,
|
|
11581
11822
|
'notification.removed_from_channel': true,
|