stream-chat 5.1.0 → 5.3.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/README.md +17 -9
- package/dist/browser.es.js +313 -234
- 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 +313 -234
- package/dist/browser.js.map +1 -1
- package/dist/index.es.js +313 -234
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +313 -234
- package/dist/index.js.map +1 -1
- package/dist/types/channel.d.ts.map +1 -1
- package/dist/types/channel_state.d.ts +7 -4
- package/dist/types/channel_state.d.ts.map +1 -1
- package/dist/types/client.d.ts +30 -4
- 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 +29 -10
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils.d.ts.map +1 -1
- package/package.json +6 -1
- package/src/channel.ts +23 -5
- package/src/channel_state.ts +10 -1
- package/src/client.ts +27 -2
- package/src/events.ts +1 -0
- package/src/types.ts +31 -10
- package/src/utils.ts +5 -1
- package/CHANGELOG.md +0 -844
package/dist/index.es.js
CHANGED
|
@@ -312,6 +312,12 @@ var ChannelState = /*#__PURE__*/function () {
|
|
|
312
312
|
for (var i = 0; i < newMessages.length; i += 1) {
|
|
313
313
|
var _this$_channel;
|
|
314
314
|
|
|
315
|
+
var isFromShadowBannedUser = newMessages[i].shadowed;
|
|
316
|
+
|
|
317
|
+
if (isFromShadowBannedUser) {
|
|
318
|
+
continue;
|
|
319
|
+
}
|
|
320
|
+
|
|
315
321
|
var message = this.formatMessage(newMessages[i]);
|
|
316
322
|
|
|
317
323
|
if (message.user && (_this$_channel = this._channel) !== null && _this$_channel !== void 0 && _this$_channel.cid) {
|
|
@@ -709,6 +715,7 @@ var EVENT_MAP = {
|
|
|
709
715
|
'channel.created': true,
|
|
710
716
|
'channel.deleted': true,
|
|
711
717
|
'channel.hidden': true,
|
|
718
|
+
'channel.kicked': true,
|
|
712
719
|
'channel.muted': true,
|
|
713
720
|
'channel.truncated': true,
|
|
714
721
|
'channel.unmuted': true,
|
|
@@ -804,6 +811,10 @@ function isFileWebAPI(uri) {
|
|
|
804
811
|
return typeof window !== 'undefined' && 'File' in window && uri instanceof File;
|
|
805
812
|
}
|
|
806
813
|
|
|
814
|
+
function isBlobWebAPI(uri) {
|
|
815
|
+
return typeof window !== 'undefined' && 'Blob' in window && uri instanceof Blob;
|
|
816
|
+
}
|
|
817
|
+
|
|
807
818
|
function isOwnUser(user) {
|
|
808
819
|
return (user === null || user === void 0 ? void 0 : user.total_unread_count) !== undefined;
|
|
809
820
|
}
|
|
@@ -823,7 +834,7 @@ function isOwnUserBaseProperty(property) {
|
|
|
823
834
|
function addFileToFormData(uri, name, contentType) {
|
|
824
835
|
var data = new FormData();
|
|
825
836
|
|
|
826
|
-
if (isReadableStream(uri) || isBuffer(uri) || isFileWebAPI(uri)) {
|
|
837
|
+
if (isReadableStream(uri) || isBuffer(uri) || isFileWebAPI(uri) || isBlobWebAPI(uri)) {
|
|
827
838
|
if (name) data.append('file', uri, name);else data.append('file', uri);
|
|
828
839
|
} else {
|
|
829
840
|
data.append('file', {
|
|
@@ -3183,7 +3194,8 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3183
3194
|
channelState.read[event.user.id] = {
|
|
3184
3195
|
// because in client.ts the handleEvent call that flows to this sets this `event.received_at = new Date();`
|
|
3185
3196
|
last_read: event.received_at,
|
|
3186
|
-
user: event.user
|
|
3197
|
+
user: event.user,
|
|
3198
|
+
unread_messages: 0
|
|
3187
3199
|
};
|
|
3188
3200
|
|
|
3189
3201
|
if (((_event$user4 = event.user) === null || _event$user4 === void 0 ? void 0 : _event$user4.id) === ((_this$getClient$user = this.getClient().user) === null || _this$getClient$user === void 0 ? void 0 : _this$getClient$user.id)) {
|
|
@@ -3240,7 +3252,8 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3240
3252
|
channelState.unreadCount = 0;
|
|
3241
3253
|
channelState.read[event.user.id] = {
|
|
3242
3254
|
last_read: new Date(event.created_at),
|
|
3243
|
-
user: event.user
|
|
3255
|
+
user: event.user,
|
|
3256
|
+
unread_messages: 0
|
|
3244
3257
|
};
|
|
3245
3258
|
} else if (this._countMessageAsUnread(event.message)) {
|
|
3246
3259
|
channelState.unreadCount = channelState.unreadCount + 1;
|
|
@@ -3264,7 +3277,16 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3264
3277
|
|
|
3265
3278
|
case 'channel.truncated':
|
|
3266
3279
|
channelState.clearMessages();
|
|
3267
|
-
channelState.unreadCount = 0;
|
|
3280
|
+
channelState.unreadCount = 0; // system messages don't increment unread counts
|
|
3281
|
+
|
|
3282
|
+
if (event.message) {
|
|
3283
|
+
channelState.addMessageSorted(event.message);
|
|
3284
|
+
|
|
3285
|
+
if (event.message.pinned) {
|
|
3286
|
+
channelState.addPinnedMessage(event.message);
|
|
3287
|
+
}
|
|
3288
|
+
}
|
|
3289
|
+
|
|
3268
3290
|
break;
|
|
3269
3291
|
|
|
3270
3292
|
case 'member.added':
|
|
@@ -3284,7 +3306,12 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3284
3306
|
|
|
3285
3307
|
case 'channel.updated':
|
|
3286
3308
|
if (event.channel) {
|
|
3287
|
-
channel
|
|
3309
|
+
var _event$channel$hidden, _event$channel, _channel$data, _event$channel$own_ca, _event$channel2, _channel$data2;
|
|
3310
|
+
|
|
3311
|
+
channel.data = _objectSpread$5(_objectSpread$5({}, event.channel), {}, {
|
|
3312
|
+
hidden: (_event$channel$hidden = (_event$channel = event.channel) === null || _event$channel === void 0 ? void 0 : _event$channel.hidden) !== null && _event$channel$hidden !== void 0 ? _event$channel$hidden : (_channel$data = channel.data) === null || _channel$data === void 0 ? void 0 : _channel$data.hidden,
|
|
3313
|
+
own_capabilities: (_event$channel$own_ca = (_event$channel2 = event.channel) === null || _event$channel2 === void 0 ? void 0 : _event$channel2.own_capabilities) !== null && _event$channel$own_ca !== void 0 ? _event$channel$own_ca : (_channel$data2 = channel.data) === null || _channel$data2 === void 0 ? void 0 : _channel$data2.own_capabilities
|
|
3314
|
+
});
|
|
3288
3315
|
}
|
|
3289
3316
|
|
|
3290
3317
|
break;
|
|
@@ -3405,7 +3432,8 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3405
3432
|
if (user) {
|
|
3406
3433
|
this.state.read[user.id] = {
|
|
3407
3434
|
user: user,
|
|
3408
|
-
last_read: last_read
|
|
3435
|
+
last_read: last_read,
|
|
3436
|
+
unread_messages: 0
|
|
3409
3437
|
};
|
|
3410
3438
|
}
|
|
3411
3439
|
} // apply read state if part of the state
|
|
@@ -3417,16 +3445,17 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3417
3445
|
|
|
3418
3446
|
try {
|
|
3419
3447
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
3420
|
-
var
|
|
3421
|
-
|
|
3422
|
-
var parsedRead = _objectSpread$5(_objectSpread$5({}, read), {}, {
|
|
3423
|
-
last_read: new Date(read.last_read)
|
|
3424
|
-
});
|
|
3448
|
+
var _read$unread_messages;
|
|
3425
3449
|
|
|
3426
|
-
|
|
3450
|
+
var read = _step3.value;
|
|
3451
|
+
this.state.read[read.user.id] = {
|
|
3452
|
+
last_read: new Date(read.last_read),
|
|
3453
|
+
unread_messages: (_read$unread_messages = read.unread_messages) !== null && _read$unread_messages !== void 0 ? _read$unread_messages : 0,
|
|
3454
|
+
user: read.user
|
|
3455
|
+
};
|
|
3427
3456
|
|
|
3428
|
-
if (read.user.id === (user === null || user === void 0 ? void 0 : user.id)
|
|
3429
|
-
this.state.unreadCount =
|
|
3457
|
+
if (read.user.id === (user === null || user === void 0 ? void 0 : user.id)) {
|
|
3458
|
+
this.state.unreadCount = this.state.read[read.user.id].unread_messages;
|
|
3430
3459
|
}
|
|
3431
3460
|
}
|
|
3432
3461
|
} catch (err) {
|
|
@@ -6544,7 +6573,6 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6544
6573
|
apnTemplate: '{}', //if app doesn't have apn configured it will error
|
|
6545
6574
|
firebaseTemplate: '{}', //if app doesn't have firebase configured it will error
|
|
6546
6575
|
firebaseDataTemplate: '{}', //if app doesn't have firebase configured it will error
|
|
6547
|
-
huaweiDataTemplate: '{}' //if app doesn't have huawei configured it will error
|
|
6548
6576
|
skipDevices: true, // skip config/device checks and sending to real devices
|
|
6549
6577
|
}
|
|
6550
6578
|
*/
|
|
@@ -6561,7 +6589,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6561
6589
|
case 0:
|
|
6562
6590
|
data = _args12.length > 1 && _args12[1] !== undefined ? _args12[1] : {};
|
|
6563
6591
|
_context12.next = 3;
|
|
6564
|
-
return this.post(this.baseURL + '/check_push', _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(
|
|
6592
|
+
return this.post(this.baseURL + '/check_push', _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
6565
6593
|
user_id: userID
|
|
6566
6594
|
}, data.messageID ? {
|
|
6567
6595
|
message_id: data.messageID
|
|
@@ -6571,8 +6599,6 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6571
6599
|
firebase_template: data.firebaseTemplate
|
|
6572
6600
|
} : {}), data.firebaseDataTemplate ? {
|
|
6573
6601
|
firebase_data_template: data.firebaseDataTemplate
|
|
6574
|
-
} : {}), data.huaweiDataTemplate ? {
|
|
6575
|
-
huawei_data_template: data.huaweiDataTemplate
|
|
6576
6602
|
} : {}), data.skipDevices ? {
|
|
6577
6603
|
skip_devices: true
|
|
6578
6604
|
} : {}));
|
|
@@ -8517,6 +8543,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8517
8543
|
* It is present for internal usage only.
|
|
8518
8544
|
* This function can, and will, break and/or be removed at any point in time.
|
|
8519
8545
|
*
|
|
8546
|
+
* @private
|
|
8520
8547
|
* @param {FlagReportsFilters} filterConditions MongoDB style filter conditions
|
|
8521
8548
|
* @param {FlagReportsPaginationOptions} options Option object, {limit: 10, offset:0}
|
|
8522
8549
|
*
|
|
@@ -8565,6 +8592,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8565
8592
|
* It is present for internal usage only.
|
|
8566
8593
|
* This function can, and will, break and/or be removed at any point in time.
|
|
8567
8594
|
*
|
|
8595
|
+
* @private
|
|
8568
8596
|
* @param {string} [id] flag report to review
|
|
8569
8597
|
* @param {string} [reviewResult] flag report review result
|
|
8570
8598
|
* @param {string} [options.user_id] currentUserID, only used with serverside auth
|
|
@@ -8605,6 +8633,52 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8605
8633
|
|
|
8606
8634
|
return _reviewFlagReport;
|
|
8607
8635
|
}()
|
|
8636
|
+
/**
|
|
8637
|
+
* _unblockMessage - unblocks message blocked by automod
|
|
8638
|
+
*
|
|
8639
|
+
* Note: Do not use this.
|
|
8640
|
+
* It is present for internal usage only.
|
|
8641
|
+
* This function can, and will, break and/or be removed at any point in time.
|
|
8642
|
+
*
|
|
8643
|
+
* @private
|
|
8644
|
+
* @param {string} targetMessageID
|
|
8645
|
+
* @param {string} [options.user_id] currentUserID, only used with serverside auth
|
|
8646
|
+
* @returns {Promise<APIResponse>}
|
|
8647
|
+
*/
|
|
8648
|
+
|
|
8649
|
+
}, {
|
|
8650
|
+
key: "_unblockMessage",
|
|
8651
|
+
value: function () {
|
|
8652
|
+
var _unblockMessage2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44(targetMessageID) {
|
|
8653
|
+
var options,
|
|
8654
|
+
_args44 = arguments;
|
|
8655
|
+
return _regeneratorRuntime.wrap(function _callee44$(_context44) {
|
|
8656
|
+
while (1) {
|
|
8657
|
+
switch (_context44.prev = _context44.next) {
|
|
8658
|
+
case 0:
|
|
8659
|
+
options = _args44.length > 1 && _args44[1] !== undefined ? _args44[1] : {};
|
|
8660
|
+
_context44.next = 3;
|
|
8661
|
+
return this.post(this.baseURL + '/moderation/unblock_message', _objectSpread({
|
|
8662
|
+
target_message_id: targetMessageID
|
|
8663
|
+
}, options));
|
|
8664
|
+
|
|
8665
|
+
case 3:
|
|
8666
|
+
return _context44.abrupt("return", _context44.sent);
|
|
8667
|
+
|
|
8668
|
+
case 4:
|
|
8669
|
+
case "end":
|
|
8670
|
+
return _context44.stop();
|
|
8671
|
+
}
|
|
8672
|
+
}
|
|
8673
|
+
}, _callee44, this);
|
|
8674
|
+
}));
|
|
8675
|
+
|
|
8676
|
+
function _unblockMessage(_x56) {
|
|
8677
|
+
return _unblockMessage2.apply(this, arguments);
|
|
8678
|
+
}
|
|
8679
|
+
|
|
8680
|
+
return _unblockMessage;
|
|
8681
|
+
}()
|
|
8608
8682
|
/**
|
|
8609
8683
|
* @deprecated use markChannelsRead instead
|
|
8610
8684
|
*
|
|
@@ -8626,23 +8700,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8626
8700
|
* @return {Promise<APIResponse>}
|
|
8627
8701
|
*/
|
|
8628
8702
|
function () {
|
|
8629
|
-
var _markChannelsRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8703
|
+
var _markChannelsRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45() {
|
|
8630
8704
|
var data,
|
|
8631
|
-
|
|
8632
|
-
return _regeneratorRuntime.wrap(function
|
|
8705
|
+
_args45 = arguments;
|
|
8706
|
+
return _regeneratorRuntime.wrap(function _callee45$(_context45) {
|
|
8633
8707
|
while (1) {
|
|
8634
|
-
switch (
|
|
8708
|
+
switch (_context45.prev = _context45.next) {
|
|
8635
8709
|
case 0:
|
|
8636
|
-
data =
|
|
8637
|
-
|
|
8710
|
+
data = _args45.length > 0 && _args45[0] !== undefined ? _args45[0] : {};
|
|
8711
|
+
_context45.next = 3;
|
|
8638
8712
|
return this.post(this.baseURL + '/channels/read', _objectSpread({}, data));
|
|
8639
8713
|
|
|
8640
8714
|
case 3:
|
|
8641
8715
|
case "end":
|
|
8642
|
-
return
|
|
8716
|
+
return _context45.stop();
|
|
8643
8717
|
}
|
|
8644
8718
|
}
|
|
8645
|
-
},
|
|
8719
|
+
}, _callee45, this);
|
|
8646
8720
|
}));
|
|
8647
8721
|
|
|
8648
8722
|
function markChannelsRead() {
|
|
@@ -8717,28 +8791,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8717
8791
|
}, {
|
|
8718
8792
|
key: "translateMessage",
|
|
8719
8793
|
value: function () {
|
|
8720
|
-
var _translateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8721
|
-
return _regeneratorRuntime.wrap(function
|
|
8794
|
+
var _translateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46(messageId, language) {
|
|
8795
|
+
return _regeneratorRuntime.wrap(function _callee46$(_context46) {
|
|
8722
8796
|
while (1) {
|
|
8723
|
-
switch (
|
|
8797
|
+
switch (_context46.prev = _context46.next) {
|
|
8724
8798
|
case 0:
|
|
8725
|
-
|
|
8799
|
+
_context46.next = 2;
|
|
8726
8800
|
return this.post(this.baseURL + "/messages/".concat(messageId, "/translate"), {
|
|
8727
8801
|
language: language
|
|
8728
8802
|
});
|
|
8729
8803
|
|
|
8730
8804
|
case 2:
|
|
8731
|
-
return
|
|
8805
|
+
return _context46.abrupt("return", _context46.sent);
|
|
8732
8806
|
|
|
8733
8807
|
case 3:
|
|
8734
8808
|
case "end":
|
|
8735
|
-
return
|
|
8809
|
+
return _context46.stop();
|
|
8736
8810
|
}
|
|
8737
8811
|
}
|
|
8738
|
-
},
|
|
8812
|
+
}, _callee46, this);
|
|
8739
8813
|
}));
|
|
8740
8814
|
|
|
8741
|
-
function translateMessage(
|
|
8815
|
+
function translateMessage(_x57, _x58) {
|
|
8742
8816
|
return _translateMessage.apply(this, arguments);
|
|
8743
8817
|
}
|
|
8744
8818
|
|
|
@@ -8840,14 +8914,14 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8840
8914
|
}, {
|
|
8841
8915
|
key: "updateMessage",
|
|
8842
8916
|
value: function () {
|
|
8843
|
-
var _updateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8917
|
+
var _updateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee47(message, userId, options) {
|
|
8844
8918
|
var clonedMessage, reservedMessageFields;
|
|
8845
|
-
return _regeneratorRuntime.wrap(function
|
|
8919
|
+
return _regeneratorRuntime.wrap(function _callee47$(_context47) {
|
|
8846
8920
|
while (1) {
|
|
8847
|
-
switch (
|
|
8921
|
+
switch (_context47.prev = _context47.next) {
|
|
8848
8922
|
case 0:
|
|
8849
8923
|
if (message.id) {
|
|
8850
|
-
|
|
8924
|
+
_context47.next = 2;
|
|
8851
8925
|
break;
|
|
8852
8926
|
}
|
|
8853
8927
|
|
|
@@ -8884,23 +8958,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8884
8958
|
});
|
|
8885
8959
|
}
|
|
8886
8960
|
|
|
8887
|
-
|
|
8961
|
+
_context47.next = 10;
|
|
8888
8962
|
return this.post(this.baseURL + "/messages/".concat(message.id), _objectSpread({
|
|
8889
8963
|
message: clonedMessage
|
|
8890
8964
|
}, options));
|
|
8891
8965
|
|
|
8892
8966
|
case 10:
|
|
8893
|
-
return
|
|
8967
|
+
return _context47.abrupt("return", _context47.sent);
|
|
8894
8968
|
|
|
8895
8969
|
case 11:
|
|
8896
8970
|
case "end":
|
|
8897
|
-
return
|
|
8971
|
+
return _context47.stop();
|
|
8898
8972
|
}
|
|
8899
8973
|
}
|
|
8900
|
-
},
|
|
8974
|
+
}, _callee47, this);
|
|
8901
8975
|
}));
|
|
8902
8976
|
|
|
8903
|
-
function updateMessage(
|
|
8977
|
+
function updateMessage(_x59, _x60, _x61) {
|
|
8904
8978
|
return _updateMessage.apply(this, arguments);
|
|
8905
8979
|
}
|
|
8906
8980
|
|
|
@@ -8923,14 +8997,14 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8923
8997
|
}, {
|
|
8924
8998
|
key: "partialUpdateMessage",
|
|
8925
8999
|
value: function () {
|
|
8926
|
-
var _partialUpdateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9000
|
+
var _partialUpdateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee48(id, partialMessageObject, userId, options) {
|
|
8927
9001
|
var user;
|
|
8928
|
-
return _regeneratorRuntime.wrap(function
|
|
9002
|
+
return _regeneratorRuntime.wrap(function _callee48$(_context48) {
|
|
8929
9003
|
while (1) {
|
|
8930
|
-
switch (
|
|
9004
|
+
switch (_context48.prev = _context48.next) {
|
|
8931
9005
|
case 0:
|
|
8932
9006
|
if (id) {
|
|
8933
|
-
|
|
9007
|
+
_context48.next = 2;
|
|
8934
9008
|
break;
|
|
8935
9009
|
}
|
|
8936
9010
|
|
|
@@ -8945,23 +9019,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8945
9019
|
};
|
|
8946
9020
|
}
|
|
8947
9021
|
|
|
8948
|
-
|
|
9022
|
+
_context48.next = 6;
|
|
8949
9023
|
return this.put(this.baseURL + "/messages/".concat(id), _objectSpread(_objectSpread(_objectSpread({}, partialMessageObject), options), {}, {
|
|
8950
9024
|
user: user
|
|
8951
9025
|
}));
|
|
8952
9026
|
|
|
8953
9027
|
case 6:
|
|
8954
|
-
return
|
|
9028
|
+
return _context48.abrupt("return", _context48.sent);
|
|
8955
9029
|
|
|
8956
9030
|
case 7:
|
|
8957
9031
|
case "end":
|
|
8958
|
-
return
|
|
9032
|
+
return _context48.stop();
|
|
8959
9033
|
}
|
|
8960
9034
|
}
|
|
8961
|
-
},
|
|
9035
|
+
}, _callee48, this);
|
|
8962
9036
|
}));
|
|
8963
9037
|
|
|
8964
|
-
function partialUpdateMessage(
|
|
9038
|
+
function partialUpdateMessage(_x62, _x63, _x64, _x65) {
|
|
8965
9039
|
return _partialUpdateMessage.apply(this, arguments);
|
|
8966
9040
|
}
|
|
8967
9041
|
|
|
@@ -8970,11 +9044,11 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8970
9044
|
}, {
|
|
8971
9045
|
key: "deleteMessage",
|
|
8972
9046
|
value: function () {
|
|
8973
|
-
var _deleteMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9047
|
+
var _deleteMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49(messageID, hardDelete) {
|
|
8974
9048
|
var params;
|
|
8975
|
-
return _regeneratorRuntime.wrap(function
|
|
9049
|
+
return _regeneratorRuntime.wrap(function _callee49$(_context49) {
|
|
8976
9050
|
while (1) {
|
|
8977
|
-
switch (
|
|
9051
|
+
switch (_context49.prev = _context49.next) {
|
|
8978
9052
|
case 0:
|
|
8979
9053
|
params = {};
|
|
8980
9054
|
|
|
@@ -8984,21 +9058,21 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8984
9058
|
};
|
|
8985
9059
|
}
|
|
8986
9060
|
|
|
8987
|
-
|
|
9061
|
+
_context49.next = 4;
|
|
8988
9062
|
return this.delete(this.baseURL + "/messages/".concat(messageID), params);
|
|
8989
9063
|
|
|
8990
9064
|
case 4:
|
|
8991
|
-
return
|
|
9065
|
+
return _context49.abrupt("return", _context49.sent);
|
|
8992
9066
|
|
|
8993
9067
|
case 5:
|
|
8994
9068
|
case "end":
|
|
8995
|
-
return
|
|
9069
|
+
return _context49.stop();
|
|
8996
9070
|
}
|
|
8997
9071
|
}
|
|
8998
|
-
},
|
|
9072
|
+
}, _callee49, this);
|
|
8999
9073
|
}));
|
|
9000
9074
|
|
|
9001
|
-
function deleteMessage(
|
|
9075
|
+
function deleteMessage(_x66, _x67) {
|
|
9002
9076
|
return _deleteMessage.apply(this, arguments);
|
|
9003
9077
|
}
|
|
9004
9078
|
|
|
@@ -9007,26 +9081,26 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9007
9081
|
}, {
|
|
9008
9082
|
key: "getMessage",
|
|
9009
9083
|
value: function () {
|
|
9010
|
-
var _getMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9011
|
-
return _regeneratorRuntime.wrap(function
|
|
9084
|
+
var _getMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee50(messageID) {
|
|
9085
|
+
return _regeneratorRuntime.wrap(function _callee50$(_context50) {
|
|
9012
9086
|
while (1) {
|
|
9013
|
-
switch (
|
|
9087
|
+
switch (_context50.prev = _context50.next) {
|
|
9014
9088
|
case 0:
|
|
9015
|
-
|
|
9089
|
+
_context50.next = 2;
|
|
9016
9090
|
return this.get(this.baseURL + "/messages/".concat(messageID));
|
|
9017
9091
|
|
|
9018
9092
|
case 2:
|
|
9019
|
-
return
|
|
9093
|
+
return _context50.abrupt("return", _context50.sent);
|
|
9020
9094
|
|
|
9021
9095
|
case 3:
|
|
9022
9096
|
case "end":
|
|
9023
|
-
return
|
|
9097
|
+
return _context50.stop();
|
|
9024
9098
|
}
|
|
9025
9099
|
}
|
|
9026
|
-
},
|
|
9100
|
+
}, _callee50, this);
|
|
9027
9101
|
}));
|
|
9028
9102
|
|
|
9029
|
-
function getMessage(
|
|
9103
|
+
function getMessage(_x68) {
|
|
9030
9104
|
return _getMessage.apply(this, arguments);
|
|
9031
9105
|
}
|
|
9032
9106
|
|
|
@@ -9035,7 +9109,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9035
9109
|
}, {
|
|
9036
9110
|
key: "getUserAgent",
|
|
9037
9111
|
value: function getUserAgent() {
|
|
9038
|
-
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "5.
|
|
9112
|
+
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "5.3.0");
|
|
9039
9113
|
}
|
|
9040
9114
|
}, {
|
|
9041
9115
|
key: "setUserAgent",
|
|
@@ -9230,28 +9304,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9230
9304
|
}, {
|
|
9231
9305
|
key: "sendUserCustomEvent",
|
|
9232
9306
|
value: function () {
|
|
9233
|
-
var _sendUserCustomEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9234
|
-
return _regeneratorRuntime.wrap(function
|
|
9307
|
+
var _sendUserCustomEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee51(targetUserID, event) {
|
|
9308
|
+
return _regeneratorRuntime.wrap(function _callee51$(_context51) {
|
|
9235
9309
|
while (1) {
|
|
9236
|
-
switch (
|
|
9310
|
+
switch (_context51.prev = _context51.next) {
|
|
9237
9311
|
case 0:
|
|
9238
|
-
|
|
9312
|
+
_context51.next = 2;
|
|
9239
9313
|
return this.post("".concat(this.baseURL, "/users/").concat(targetUserID, "/event"), {
|
|
9240
9314
|
event: event
|
|
9241
9315
|
});
|
|
9242
9316
|
|
|
9243
9317
|
case 2:
|
|
9244
|
-
return
|
|
9318
|
+
return _context51.abrupt("return", _context51.sent);
|
|
9245
9319
|
|
|
9246
9320
|
case 3:
|
|
9247
9321
|
case "end":
|
|
9248
|
-
return
|
|
9322
|
+
return _context51.stop();
|
|
9249
9323
|
}
|
|
9250
9324
|
}
|
|
9251
|
-
},
|
|
9325
|
+
}, _callee51, this);
|
|
9252
9326
|
}));
|
|
9253
9327
|
|
|
9254
|
-
function sendUserCustomEvent(
|
|
9328
|
+
function sendUserCustomEvent(_x69, _x70) {
|
|
9255
9329
|
return _sendUserCustomEvent.apply(this, arguments);
|
|
9256
9330
|
}
|
|
9257
9331
|
|
|
@@ -9293,6 +9367,11 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9293
9367
|
|
|
9294
9368
|
return this.post("".concat(this.baseURL, "/export_channels"), payload);
|
|
9295
9369
|
}
|
|
9370
|
+
}, {
|
|
9371
|
+
key: "exportUsers",
|
|
9372
|
+
value: function exportUsers(request) {
|
|
9373
|
+
return this.post("".concat(this.baseURL, "/export/users"), request);
|
|
9374
|
+
}
|
|
9296
9375
|
}, {
|
|
9297
9376
|
key: "exportChannel",
|
|
9298
9377
|
value: function exportChannel(request, options) {
|
|
@@ -9314,32 +9393,32 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9314
9393
|
}, {
|
|
9315
9394
|
key: "createSegment",
|
|
9316
9395
|
value: function () {
|
|
9317
|
-
var _createSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9396
|
+
var _createSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee52(params) {
|
|
9318
9397
|
var _yield$this$post, segment;
|
|
9319
9398
|
|
|
9320
|
-
return _regeneratorRuntime.wrap(function
|
|
9399
|
+
return _regeneratorRuntime.wrap(function _callee52$(_context52) {
|
|
9321
9400
|
while (1) {
|
|
9322
|
-
switch (
|
|
9401
|
+
switch (_context52.prev = _context52.next) {
|
|
9323
9402
|
case 0:
|
|
9324
|
-
|
|
9403
|
+
_context52.next = 2;
|
|
9325
9404
|
return this.post(this.baseURL + "/segments", {
|
|
9326
9405
|
segment: params
|
|
9327
9406
|
});
|
|
9328
9407
|
|
|
9329
9408
|
case 2:
|
|
9330
|
-
_yield$this$post =
|
|
9409
|
+
_yield$this$post = _context52.sent;
|
|
9331
9410
|
segment = _yield$this$post.segment;
|
|
9332
|
-
return
|
|
9411
|
+
return _context52.abrupt("return", segment);
|
|
9333
9412
|
|
|
9334
9413
|
case 5:
|
|
9335
9414
|
case "end":
|
|
9336
|
-
return
|
|
9415
|
+
return _context52.stop();
|
|
9337
9416
|
}
|
|
9338
9417
|
}
|
|
9339
|
-
},
|
|
9418
|
+
}, _callee52, this);
|
|
9340
9419
|
}));
|
|
9341
9420
|
|
|
9342
|
-
function createSegment(
|
|
9421
|
+
function createSegment(_x71) {
|
|
9343
9422
|
return _createSegment.apply(this, arguments);
|
|
9344
9423
|
}
|
|
9345
9424
|
|
|
@@ -9356,30 +9435,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9356
9435
|
}, {
|
|
9357
9436
|
key: "getSegment",
|
|
9358
9437
|
value: function () {
|
|
9359
|
-
var _getSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9438
|
+
var _getSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee53(id) {
|
|
9360
9439
|
var _yield$this$get, segment;
|
|
9361
9440
|
|
|
9362
|
-
return _regeneratorRuntime.wrap(function
|
|
9441
|
+
return _regeneratorRuntime.wrap(function _callee53$(_context53) {
|
|
9363
9442
|
while (1) {
|
|
9364
|
-
switch (
|
|
9443
|
+
switch (_context53.prev = _context53.next) {
|
|
9365
9444
|
case 0:
|
|
9366
|
-
|
|
9445
|
+
_context53.next = 2;
|
|
9367
9446
|
return this.get(this.baseURL + "/segments/".concat(id));
|
|
9368
9447
|
|
|
9369
9448
|
case 2:
|
|
9370
|
-
_yield$this$get =
|
|
9449
|
+
_yield$this$get = _context53.sent;
|
|
9371
9450
|
segment = _yield$this$get.segment;
|
|
9372
|
-
return
|
|
9451
|
+
return _context53.abrupt("return", segment);
|
|
9373
9452
|
|
|
9374
9453
|
case 5:
|
|
9375
9454
|
case "end":
|
|
9376
|
-
return
|
|
9455
|
+
return _context53.stop();
|
|
9377
9456
|
}
|
|
9378
9457
|
}
|
|
9379
|
-
},
|
|
9458
|
+
}, _callee53, this);
|
|
9380
9459
|
}));
|
|
9381
9460
|
|
|
9382
|
-
function getSegment(
|
|
9461
|
+
function getSegment(_x72) {
|
|
9383
9462
|
return _getSegment.apply(this, arguments);
|
|
9384
9463
|
}
|
|
9385
9464
|
|
|
@@ -9395,30 +9474,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9395
9474
|
}, {
|
|
9396
9475
|
key: "listSegments",
|
|
9397
9476
|
value: function () {
|
|
9398
|
-
var _listSegments = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9477
|
+
var _listSegments = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee54(options) {
|
|
9399
9478
|
var _yield$this$get2, segments;
|
|
9400
9479
|
|
|
9401
|
-
return _regeneratorRuntime.wrap(function
|
|
9480
|
+
return _regeneratorRuntime.wrap(function _callee54$(_context54) {
|
|
9402
9481
|
while (1) {
|
|
9403
|
-
switch (
|
|
9482
|
+
switch (_context54.prev = _context54.next) {
|
|
9404
9483
|
case 0:
|
|
9405
|
-
|
|
9484
|
+
_context54.next = 2;
|
|
9406
9485
|
return this.get(this.baseURL + "/segments", options);
|
|
9407
9486
|
|
|
9408
9487
|
case 2:
|
|
9409
|
-
_yield$this$get2 =
|
|
9488
|
+
_yield$this$get2 = _context54.sent;
|
|
9410
9489
|
segments = _yield$this$get2.segments;
|
|
9411
|
-
return
|
|
9490
|
+
return _context54.abrupt("return", segments);
|
|
9412
9491
|
|
|
9413
9492
|
case 5:
|
|
9414
9493
|
case "end":
|
|
9415
|
-
return
|
|
9494
|
+
return _context54.stop();
|
|
9416
9495
|
}
|
|
9417
9496
|
}
|
|
9418
|
-
},
|
|
9497
|
+
}, _callee54, this);
|
|
9419
9498
|
}));
|
|
9420
9499
|
|
|
9421
|
-
function listSegments(
|
|
9500
|
+
function listSegments(_x73) {
|
|
9422
9501
|
return _listSegments.apply(this, arguments);
|
|
9423
9502
|
}
|
|
9424
9503
|
|
|
@@ -9436,32 +9515,32 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9436
9515
|
}, {
|
|
9437
9516
|
key: "updateSegment",
|
|
9438
9517
|
value: function () {
|
|
9439
|
-
var _updateSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9518
|
+
var _updateSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee55(id, params) {
|
|
9440
9519
|
var _yield$this$put, segment;
|
|
9441
9520
|
|
|
9442
|
-
return _regeneratorRuntime.wrap(function
|
|
9521
|
+
return _regeneratorRuntime.wrap(function _callee55$(_context55) {
|
|
9443
9522
|
while (1) {
|
|
9444
|
-
switch (
|
|
9523
|
+
switch (_context55.prev = _context55.next) {
|
|
9445
9524
|
case 0:
|
|
9446
|
-
|
|
9525
|
+
_context55.next = 2;
|
|
9447
9526
|
return this.put(this.baseURL + "/segments/".concat(id), {
|
|
9448
9527
|
segment: params
|
|
9449
9528
|
});
|
|
9450
9529
|
|
|
9451
9530
|
case 2:
|
|
9452
|
-
_yield$this$put =
|
|
9531
|
+
_yield$this$put = _context55.sent;
|
|
9453
9532
|
segment = _yield$this$put.segment;
|
|
9454
|
-
return
|
|
9533
|
+
return _context55.abrupt("return", segment);
|
|
9455
9534
|
|
|
9456
9535
|
case 5:
|
|
9457
9536
|
case "end":
|
|
9458
|
-
return
|
|
9537
|
+
return _context55.stop();
|
|
9459
9538
|
}
|
|
9460
9539
|
}
|
|
9461
|
-
},
|
|
9540
|
+
}, _callee55, this);
|
|
9462
9541
|
}));
|
|
9463
9542
|
|
|
9464
|
-
function updateSegment(
|
|
9543
|
+
function updateSegment(_x74, _x75) {
|
|
9465
9544
|
return _updateSegment.apply(this, arguments);
|
|
9466
9545
|
}
|
|
9467
9546
|
|
|
@@ -9478,22 +9557,22 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9478
9557
|
}, {
|
|
9479
9558
|
key: "deleteSegment",
|
|
9480
9559
|
value: function () {
|
|
9481
|
-
var _deleteSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9482
|
-
return _regeneratorRuntime.wrap(function
|
|
9560
|
+
var _deleteSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee56(id) {
|
|
9561
|
+
return _regeneratorRuntime.wrap(function _callee56$(_context56) {
|
|
9483
9562
|
while (1) {
|
|
9484
|
-
switch (
|
|
9563
|
+
switch (_context56.prev = _context56.next) {
|
|
9485
9564
|
case 0:
|
|
9486
|
-
return
|
|
9565
|
+
return _context56.abrupt("return", this.delete(this.baseURL + "/segments/".concat(id)));
|
|
9487
9566
|
|
|
9488
9567
|
case 1:
|
|
9489
9568
|
case "end":
|
|
9490
|
-
return
|
|
9569
|
+
return _context56.stop();
|
|
9491
9570
|
}
|
|
9492
9571
|
}
|
|
9493
|
-
},
|
|
9572
|
+
}, _callee56, this);
|
|
9494
9573
|
}));
|
|
9495
9574
|
|
|
9496
|
-
function deleteSegment(
|
|
9575
|
+
function deleteSegment(_x76) {
|
|
9497
9576
|
return _deleteSegment.apply(this, arguments);
|
|
9498
9577
|
}
|
|
9499
9578
|
|
|
@@ -9510,32 +9589,32 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9510
9589
|
}, {
|
|
9511
9590
|
key: "createCampaign",
|
|
9512
9591
|
value: function () {
|
|
9513
|
-
var _createCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9592
|
+
var _createCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee57(params) {
|
|
9514
9593
|
var _yield$this$post2, campaign;
|
|
9515
9594
|
|
|
9516
|
-
return _regeneratorRuntime.wrap(function
|
|
9595
|
+
return _regeneratorRuntime.wrap(function _callee57$(_context57) {
|
|
9517
9596
|
while (1) {
|
|
9518
|
-
switch (
|
|
9597
|
+
switch (_context57.prev = _context57.next) {
|
|
9519
9598
|
case 0:
|
|
9520
|
-
|
|
9599
|
+
_context57.next = 2;
|
|
9521
9600
|
return this.post(this.baseURL + "/campaigns", {
|
|
9522
9601
|
campaign: params
|
|
9523
9602
|
});
|
|
9524
9603
|
|
|
9525
9604
|
case 2:
|
|
9526
|
-
_yield$this$post2 =
|
|
9605
|
+
_yield$this$post2 = _context57.sent;
|
|
9527
9606
|
campaign = _yield$this$post2.campaign;
|
|
9528
|
-
return
|
|
9607
|
+
return _context57.abrupt("return", campaign);
|
|
9529
9608
|
|
|
9530
9609
|
case 5:
|
|
9531
9610
|
case "end":
|
|
9532
|
-
return
|
|
9611
|
+
return _context57.stop();
|
|
9533
9612
|
}
|
|
9534
9613
|
}
|
|
9535
|
-
},
|
|
9614
|
+
}, _callee57, this);
|
|
9536
9615
|
}));
|
|
9537
9616
|
|
|
9538
|
-
function createCampaign(
|
|
9617
|
+
function createCampaign(_x77) {
|
|
9539
9618
|
return _createCampaign.apply(this, arguments);
|
|
9540
9619
|
}
|
|
9541
9620
|
|
|
@@ -9552,30 +9631,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9552
9631
|
}, {
|
|
9553
9632
|
key: "getCampaign",
|
|
9554
9633
|
value: function () {
|
|
9555
|
-
var _getCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9634
|
+
var _getCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee58(id) {
|
|
9556
9635
|
var _yield$this$get3, campaign;
|
|
9557
9636
|
|
|
9558
|
-
return _regeneratorRuntime.wrap(function
|
|
9637
|
+
return _regeneratorRuntime.wrap(function _callee58$(_context58) {
|
|
9559
9638
|
while (1) {
|
|
9560
|
-
switch (
|
|
9639
|
+
switch (_context58.prev = _context58.next) {
|
|
9561
9640
|
case 0:
|
|
9562
|
-
|
|
9641
|
+
_context58.next = 2;
|
|
9563
9642
|
return this.get(this.baseURL + "/campaigns/".concat(id));
|
|
9564
9643
|
|
|
9565
9644
|
case 2:
|
|
9566
|
-
_yield$this$get3 =
|
|
9645
|
+
_yield$this$get3 = _context58.sent;
|
|
9567
9646
|
campaign = _yield$this$get3.campaign;
|
|
9568
|
-
return
|
|
9647
|
+
return _context58.abrupt("return", campaign);
|
|
9569
9648
|
|
|
9570
9649
|
case 5:
|
|
9571
9650
|
case "end":
|
|
9572
|
-
return
|
|
9651
|
+
return _context58.stop();
|
|
9573
9652
|
}
|
|
9574
9653
|
}
|
|
9575
|
-
},
|
|
9654
|
+
}, _callee58, this);
|
|
9576
9655
|
}));
|
|
9577
9656
|
|
|
9578
|
-
function getCampaign(
|
|
9657
|
+
function getCampaign(_x78) {
|
|
9579
9658
|
return _getCampaign.apply(this, arguments);
|
|
9580
9659
|
}
|
|
9581
9660
|
|
|
@@ -9591,30 +9670,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9591
9670
|
}, {
|
|
9592
9671
|
key: "listCampaigns",
|
|
9593
9672
|
value: function () {
|
|
9594
|
-
var _listCampaigns = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9673
|
+
var _listCampaigns = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee59(options) {
|
|
9595
9674
|
var _yield$this$get4, campaigns;
|
|
9596
9675
|
|
|
9597
|
-
return _regeneratorRuntime.wrap(function
|
|
9676
|
+
return _regeneratorRuntime.wrap(function _callee59$(_context59) {
|
|
9598
9677
|
while (1) {
|
|
9599
|
-
switch (
|
|
9678
|
+
switch (_context59.prev = _context59.next) {
|
|
9600
9679
|
case 0:
|
|
9601
|
-
|
|
9680
|
+
_context59.next = 2;
|
|
9602
9681
|
return this.get(this.baseURL + "/campaigns", options);
|
|
9603
9682
|
|
|
9604
9683
|
case 2:
|
|
9605
|
-
_yield$this$get4 =
|
|
9684
|
+
_yield$this$get4 = _context59.sent;
|
|
9606
9685
|
campaigns = _yield$this$get4.campaigns;
|
|
9607
|
-
return
|
|
9686
|
+
return _context59.abrupt("return", campaigns);
|
|
9608
9687
|
|
|
9609
9688
|
case 5:
|
|
9610
9689
|
case "end":
|
|
9611
|
-
return
|
|
9690
|
+
return _context59.stop();
|
|
9612
9691
|
}
|
|
9613
9692
|
}
|
|
9614
|
-
},
|
|
9693
|
+
}, _callee59, this);
|
|
9615
9694
|
}));
|
|
9616
9695
|
|
|
9617
|
-
function listCampaigns(
|
|
9696
|
+
function listCampaigns(_x79) {
|
|
9618
9697
|
return _listCampaigns.apply(this, arguments);
|
|
9619
9698
|
}
|
|
9620
9699
|
|
|
@@ -9632,32 +9711,32 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9632
9711
|
}, {
|
|
9633
9712
|
key: "updateCampaign",
|
|
9634
9713
|
value: function () {
|
|
9635
|
-
var _updateCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9714
|
+
var _updateCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee60(id, params) {
|
|
9636
9715
|
var _yield$this$put2, campaign;
|
|
9637
9716
|
|
|
9638
|
-
return _regeneratorRuntime.wrap(function
|
|
9717
|
+
return _regeneratorRuntime.wrap(function _callee60$(_context60) {
|
|
9639
9718
|
while (1) {
|
|
9640
|
-
switch (
|
|
9719
|
+
switch (_context60.prev = _context60.next) {
|
|
9641
9720
|
case 0:
|
|
9642
|
-
|
|
9721
|
+
_context60.next = 2;
|
|
9643
9722
|
return this.put(this.baseURL + "/campaigns/".concat(id), {
|
|
9644
9723
|
campaign: params
|
|
9645
9724
|
});
|
|
9646
9725
|
|
|
9647
9726
|
case 2:
|
|
9648
|
-
_yield$this$put2 =
|
|
9727
|
+
_yield$this$put2 = _context60.sent;
|
|
9649
9728
|
campaign = _yield$this$put2.campaign;
|
|
9650
|
-
return
|
|
9729
|
+
return _context60.abrupt("return", campaign);
|
|
9651
9730
|
|
|
9652
9731
|
case 5:
|
|
9653
9732
|
case "end":
|
|
9654
|
-
return
|
|
9733
|
+
return _context60.stop();
|
|
9655
9734
|
}
|
|
9656
9735
|
}
|
|
9657
|
-
},
|
|
9736
|
+
}, _callee60, this);
|
|
9658
9737
|
}));
|
|
9659
9738
|
|
|
9660
|
-
function updateCampaign(
|
|
9739
|
+
function updateCampaign(_x80, _x81) {
|
|
9661
9740
|
return _updateCampaign.apply(this, arguments);
|
|
9662
9741
|
}
|
|
9663
9742
|
|
|
@@ -9674,22 +9753,22 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9674
9753
|
}, {
|
|
9675
9754
|
key: "deleteCampaign",
|
|
9676
9755
|
value: function () {
|
|
9677
|
-
var _deleteCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9678
|
-
return _regeneratorRuntime.wrap(function
|
|
9756
|
+
var _deleteCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee61(id) {
|
|
9757
|
+
return _regeneratorRuntime.wrap(function _callee61$(_context61) {
|
|
9679
9758
|
while (1) {
|
|
9680
|
-
switch (
|
|
9759
|
+
switch (_context61.prev = _context61.next) {
|
|
9681
9760
|
case 0:
|
|
9682
|
-
return
|
|
9761
|
+
return _context61.abrupt("return", this.delete(this.baseURL + "/campaigns/".concat(id)));
|
|
9683
9762
|
|
|
9684
9763
|
case 1:
|
|
9685
9764
|
case "end":
|
|
9686
|
-
return
|
|
9765
|
+
return _context61.stop();
|
|
9687
9766
|
}
|
|
9688
9767
|
}
|
|
9689
|
-
},
|
|
9768
|
+
}, _callee61, this);
|
|
9690
9769
|
}));
|
|
9691
9770
|
|
|
9692
|
-
function deleteCampaign(
|
|
9771
|
+
function deleteCampaign(_x82) {
|
|
9693
9772
|
return _deleteCampaign.apply(this, arguments);
|
|
9694
9773
|
}
|
|
9695
9774
|
|
|
@@ -9707,33 +9786,33 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9707
9786
|
}, {
|
|
9708
9787
|
key: "scheduleCampaign",
|
|
9709
9788
|
value: function () {
|
|
9710
|
-
var _scheduleCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9789
|
+
var _scheduleCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee62(id, params) {
|
|
9711
9790
|
var sendAt, _yield$this$patch, campaign;
|
|
9712
9791
|
|
|
9713
|
-
return _regeneratorRuntime.wrap(function
|
|
9792
|
+
return _regeneratorRuntime.wrap(function _callee62$(_context62) {
|
|
9714
9793
|
while (1) {
|
|
9715
|
-
switch (
|
|
9794
|
+
switch (_context62.prev = _context62.next) {
|
|
9716
9795
|
case 0:
|
|
9717
9796
|
sendAt = params.sendAt;
|
|
9718
|
-
|
|
9797
|
+
_context62.next = 3;
|
|
9719
9798
|
return this.patch(this.baseURL + "/campaigns/".concat(id, "/schedule"), {
|
|
9720
9799
|
send_at: sendAt
|
|
9721
9800
|
});
|
|
9722
9801
|
|
|
9723
9802
|
case 3:
|
|
9724
|
-
_yield$this$patch =
|
|
9803
|
+
_yield$this$patch = _context62.sent;
|
|
9725
9804
|
campaign = _yield$this$patch.campaign;
|
|
9726
|
-
return
|
|
9805
|
+
return _context62.abrupt("return", campaign);
|
|
9727
9806
|
|
|
9728
9807
|
case 6:
|
|
9729
9808
|
case "end":
|
|
9730
|
-
return
|
|
9809
|
+
return _context62.stop();
|
|
9731
9810
|
}
|
|
9732
9811
|
}
|
|
9733
|
-
},
|
|
9812
|
+
}, _callee62, this);
|
|
9734
9813
|
}));
|
|
9735
9814
|
|
|
9736
|
-
function scheduleCampaign(
|
|
9815
|
+
function scheduleCampaign(_x83, _x84) {
|
|
9737
9816
|
return _scheduleCampaign.apply(this, arguments);
|
|
9738
9817
|
}
|
|
9739
9818
|
|
|
@@ -9750,30 +9829,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9750
9829
|
}, {
|
|
9751
9830
|
key: "stopCampaign",
|
|
9752
9831
|
value: function () {
|
|
9753
|
-
var _stopCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9832
|
+
var _stopCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee63(id) {
|
|
9754
9833
|
var _yield$this$patch2, campaign;
|
|
9755
9834
|
|
|
9756
|
-
return _regeneratorRuntime.wrap(function
|
|
9835
|
+
return _regeneratorRuntime.wrap(function _callee63$(_context63) {
|
|
9757
9836
|
while (1) {
|
|
9758
|
-
switch (
|
|
9837
|
+
switch (_context63.prev = _context63.next) {
|
|
9759
9838
|
case 0:
|
|
9760
|
-
|
|
9839
|
+
_context63.next = 2;
|
|
9761
9840
|
return this.patch(this.baseURL + "/campaigns/".concat(id, "/stop"));
|
|
9762
9841
|
|
|
9763
9842
|
case 2:
|
|
9764
|
-
_yield$this$patch2 =
|
|
9843
|
+
_yield$this$patch2 = _context63.sent;
|
|
9765
9844
|
campaign = _yield$this$patch2.campaign;
|
|
9766
|
-
return
|
|
9845
|
+
return _context63.abrupt("return", campaign);
|
|
9767
9846
|
|
|
9768
9847
|
case 5:
|
|
9769
9848
|
case "end":
|
|
9770
|
-
return
|
|
9849
|
+
return _context63.stop();
|
|
9771
9850
|
}
|
|
9772
9851
|
}
|
|
9773
|
-
},
|
|
9852
|
+
}, _callee63, this);
|
|
9774
9853
|
}));
|
|
9775
9854
|
|
|
9776
|
-
function stopCampaign(
|
|
9855
|
+
function stopCampaign(_x85) {
|
|
9777
9856
|
return _stopCampaign.apply(this, arguments);
|
|
9778
9857
|
}
|
|
9779
9858
|
|
|
@@ -9790,30 +9869,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9790
9869
|
}, {
|
|
9791
9870
|
key: "resumeCampaign",
|
|
9792
9871
|
value: function () {
|
|
9793
|
-
var _resumeCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9872
|
+
var _resumeCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee64(id) {
|
|
9794
9873
|
var _yield$this$patch3, campaign;
|
|
9795
9874
|
|
|
9796
|
-
return _regeneratorRuntime.wrap(function
|
|
9875
|
+
return _regeneratorRuntime.wrap(function _callee64$(_context64) {
|
|
9797
9876
|
while (1) {
|
|
9798
|
-
switch (
|
|
9877
|
+
switch (_context64.prev = _context64.next) {
|
|
9799
9878
|
case 0:
|
|
9800
|
-
|
|
9879
|
+
_context64.next = 2;
|
|
9801
9880
|
return this.patch(this.baseURL + "/campaigns/".concat(id, "/resume"));
|
|
9802
9881
|
|
|
9803
9882
|
case 2:
|
|
9804
|
-
_yield$this$patch3 =
|
|
9883
|
+
_yield$this$patch3 = _context64.sent;
|
|
9805
9884
|
campaign = _yield$this$patch3.campaign;
|
|
9806
|
-
return
|
|
9885
|
+
return _context64.abrupt("return", campaign);
|
|
9807
9886
|
|
|
9808
9887
|
case 5:
|
|
9809
9888
|
case "end":
|
|
9810
|
-
return
|
|
9889
|
+
return _context64.stop();
|
|
9811
9890
|
}
|
|
9812
9891
|
}
|
|
9813
|
-
},
|
|
9892
|
+
}, _callee64, this);
|
|
9814
9893
|
}));
|
|
9815
9894
|
|
|
9816
|
-
function resumeCampaign(
|
|
9895
|
+
function resumeCampaign(_x86) {
|
|
9817
9896
|
return _resumeCampaign.apply(this, arguments);
|
|
9818
9897
|
}
|
|
9819
9898
|
|
|
@@ -9830,33 +9909,33 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9830
9909
|
}, {
|
|
9831
9910
|
key: "testCampaign",
|
|
9832
9911
|
value: function () {
|
|
9833
|
-
var _testCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9912
|
+
var _testCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee65(id, params) {
|
|
9834
9913
|
var users, _yield$this$post3, campaign;
|
|
9835
9914
|
|
|
9836
|
-
return _regeneratorRuntime.wrap(function
|
|
9915
|
+
return _regeneratorRuntime.wrap(function _callee65$(_context65) {
|
|
9837
9916
|
while (1) {
|
|
9838
|
-
switch (
|
|
9917
|
+
switch (_context65.prev = _context65.next) {
|
|
9839
9918
|
case 0:
|
|
9840
9919
|
users = params.users;
|
|
9841
|
-
|
|
9920
|
+
_context65.next = 3;
|
|
9842
9921
|
return this.post(this.baseURL + "/campaigns/".concat(id, "/test"), {
|
|
9843
9922
|
users: users
|
|
9844
9923
|
});
|
|
9845
9924
|
|
|
9846
9925
|
case 3:
|
|
9847
|
-
_yield$this$post3 =
|
|
9926
|
+
_yield$this$post3 = _context65.sent;
|
|
9848
9927
|
campaign = _yield$this$post3.campaign;
|
|
9849
|
-
return
|
|
9928
|
+
return _context65.abrupt("return", campaign);
|
|
9850
9929
|
|
|
9851
9930
|
case 6:
|
|
9852
9931
|
case "end":
|
|
9853
|
-
return
|
|
9932
|
+
return _context65.stop();
|
|
9854
9933
|
}
|
|
9855
9934
|
}
|
|
9856
|
-
},
|
|
9935
|
+
}, _callee65, this);
|
|
9857
9936
|
}));
|
|
9858
9937
|
|
|
9859
|
-
function testCampaign(
|
|
9938
|
+
function testCampaign(_x87, _x88) {
|
|
9860
9939
|
return _testCampaign.apply(this, arguments);
|
|
9861
9940
|
}
|
|
9862
9941
|
|
|
@@ -9872,24 +9951,24 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9872
9951
|
}, {
|
|
9873
9952
|
key: "enrichURL",
|
|
9874
9953
|
value: function () {
|
|
9875
|
-
var _enrichURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9876
|
-
return _regeneratorRuntime.wrap(function
|
|
9954
|
+
var _enrichURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee66(url) {
|
|
9955
|
+
return _regeneratorRuntime.wrap(function _callee66$(_context66) {
|
|
9877
9956
|
while (1) {
|
|
9878
|
-
switch (
|
|
9957
|
+
switch (_context66.prev = _context66.next) {
|
|
9879
9958
|
case 0:
|
|
9880
|
-
return
|
|
9959
|
+
return _context66.abrupt("return", this.get(this.baseURL + "/og", {
|
|
9881
9960
|
url: url
|
|
9882
9961
|
}));
|
|
9883
9962
|
|
|
9884
9963
|
case 1:
|
|
9885
9964
|
case "end":
|
|
9886
|
-
return
|
|
9965
|
+
return _context66.stop();
|
|
9887
9966
|
}
|
|
9888
9967
|
}
|
|
9889
|
-
},
|
|
9968
|
+
}, _callee66, this);
|
|
9890
9969
|
}));
|
|
9891
9970
|
|
|
9892
|
-
function enrichURL(
|
|
9971
|
+
function enrichURL(_x89) {
|
|
9893
9972
|
return _enrichURL.apply(this, arguments);
|
|
9894
9973
|
}
|
|
9895
9974
|
|
|
@@ -9906,22 +9985,22 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9906
9985
|
}, {
|
|
9907
9986
|
key: "getTask",
|
|
9908
9987
|
value: function () {
|
|
9909
|
-
var _getTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9910
|
-
return _regeneratorRuntime.wrap(function
|
|
9988
|
+
var _getTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee67(id) {
|
|
9989
|
+
return _regeneratorRuntime.wrap(function _callee67$(_context67) {
|
|
9911
9990
|
while (1) {
|
|
9912
|
-
switch (
|
|
9991
|
+
switch (_context67.prev = _context67.next) {
|
|
9913
9992
|
case 0:
|
|
9914
|
-
return
|
|
9993
|
+
return _context67.abrupt("return", this.get("".concat(this.baseURL, "/tasks/").concat(id)));
|
|
9915
9994
|
|
|
9916
9995
|
case 1:
|
|
9917
9996
|
case "end":
|
|
9918
|
-
return
|
|
9997
|
+
return _context67.stop();
|
|
9919
9998
|
}
|
|
9920
9999
|
}
|
|
9921
|
-
},
|
|
10000
|
+
}, _callee67, this);
|
|
9922
10001
|
}));
|
|
9923
10002
|
|
|
9924
|
-
function getTask(
|
|
10003
|
+
function getTask(_x90) {
|
|
9925
10004
|
return _getTask.apply(this, arguments);
|
|
9926
10005
|
}
|
|
9927
10006
|
|
|
@@ -9939,31 +10018,31 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9939
10018
|
}, {
|
|
9940
10019
|
key: "deleteChannels",
|
|
9941
10020
|
value: function () {
|
|
9942
|
-
var _deleteChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
10021
|
+
var _deleteChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee68(cids) {
|
|
9943
10022
|
var options,
|
|
9944
|
-
|
|
9945
|
-
return _regeneratorRuntime.wrap(function
|
|
10023
|
+
_args68 = arguments;
|
|
10024
|
+
return _regeneratorRuntime.wrap(function _callee68$(_context68) {
|
|
9946
10025
|
while (1) {
|
|
9947
|
-
switch (
|
|
10026
|
+
switch (_context68.prev = _context68.next) {
|
|
9948
10027
|
case 0:
|
|
9949
|
-
options =
|
|
9950
|
-
|
|
10028
|
+
options = _args68.length > 1 && _args68[1] !== undefined ? _args68[1] : {};
|
|
10029
|
+
_context68.next = 3;
|
|
9951
10030
|
return this.post(this.baseURL + "/channels/delete", _objectSpread({
|
|
9952
10031
|
cids: cids
|
|
9953
10032
|
}, options));
|
|
9954
10033
|
|
|
9955
10034
|
case 3:
|
|
9956
|
-
return
|
|
10035
|
+
return _context68.abrupt("return", _context68.sent);
|
|
9957
10036
|
|
|
9958
10037
|
case 4:
|
|
9959
10038
|
case "end":
|
|
9960
|
-
return
|
|
10039
|
+
return _context68.stop();
|
|
9961
10040
|
}
|
|
9962
10041
|
}
|
|
9963
|
-
},
|
|
10042
|
+
}, _callee68, this);
|
|
9964
10043
|
}));
|
|
9965
10044
|
|
|
9966
|
-
function deleteChannels(
|
|
10045
|
+
function deleteChannels(_x91) {
|
|
9967
10046
|
return _deleteChannels.apply(this, arguments);
|
|
9968
10047
|
}
|
|
9969
10048
|
|
|
@@ -9981,13 +10060,13 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9981
10060
|
}, {
|
|
9982
10061
|
key: "deleteUsers",
|
|
9983
10062
|
value: function () {
|
|
9984
|
-
var _deleteUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9985
|
-
return _regeneratorRuntime.wrap(function
|
|
10063
|
+
var _deleteUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee69(user_ids, options) {
|
|
10064
|
+
return _regeneratorRuntime.wrap(function _callee69$(_context69) {
|
|
9986
10065
|
while (1) {
|
|
9987
|
-
switch (
|
|
10066
|
+
switch (_context69.prev = _context69.next) {
|
|
9988
10067
|
case 0:
|
|
9989
10068
|
if (!((options === null || options === void 0 ? void 0 : options.user) !== 'soft' && (options === null || options === void 0 ? void 0 : options.user) !== 'hard')) {
|
|
9990
|
-
|
|
10069
|
+
_context69.next = 2;
|
|
9991
10070
|
break;
|
|
9992
10071
|
}
|
|
9993
10072
|
|
|
@@ -9995,7 +10074,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9995
10074
|
|
|
9996
10075
|
case 2:
|
|
9997
10076
|
if (!(options.messages !== undefined && options.messages !== 'soft' && options.messages !== 'hard')) {
|
|
9998
|
-
|
|
10077
|
+
_context69.next = 4;
|
|
9999
10078
|
break;
|
|
10000
10079
|
}
|
|
10001
10080
|
|
|
@@ -10003,30 +10082,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10003
10082
|
|
|
10004
10083
|
case 4:
|
|
10005
10084
|
if (!(options.conversations !== undefined && options.conversations !== 'soft' && options.conversations !== 'hard')) {
|
|
10006
|
-
|
|
10085
|
+
_context69.next = 6;
|
|
10007
10086
|
break;
|
|
10008
10087
|
}
|
|
10009
10088
|
|
|
10010
10089
|
throw new Error('Invalid delete user options. conversations must be one of [soft hard]');
|
|
10011
10090
|
|
|
10012
10091
|
case 6:
|
|
10013
|
-
|
|
10092
|
+
_context69.next = 8;
|
|
10014
10093
|
return this.post(this.baseURL + "/users/delete", _objectSpread({
|
|
10015
10094
|
user_ids: user_ids
|
|
10016
10095
|
}, options));
|
|
10017
10096
|
|
|
10018
10097
|
case 8:
|
|
10019
|
-
return
|
|
10098
|
+
return _context69.abrupt("return", _context69.sent);
|
|
10020
10099
|
|
|
10021
10100
|
case 9:
|
|
10022
10101
|
case "end":
|
|
10023
|
-
return
|
|
10102
|
+
return _context69.stop();
|
|
10024
10103
|
}
|
|
10025
10104
|
}
|
|
10026
|
-
},
|
|
10105
|
+
}, _callee69, this);
|
|
10027
10106
|
}));
|
|
10028
10107
|
|
|
10029
|
-
function deleteUsers(
|
|
10108
|
+
function deleteUsers(_x92, _x93) {
|
|
10030
10109
|
return _deleteUsers.apply(this, arguments);
|
|
10031
10110
|
}
|
|
10032
10111
|
|