stream-chat 5.1.1 → 5.4.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 +342 -253
- 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 +342 -253
- package/dist/browser.js.map +1 -1
- package/dist/index.es.js +342 -253
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +342 -253
- package/dist/index.js.map +1 -1
- package/dist/types/channel.d.ts +5 -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/connection.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 +22 -6
- package/src/channel_state.ts +10 -1
- package/src/client.ts +27 -2
- package/src/connection.ts +3 -1
- package/src/events.ts +1 -0
- package/src/types.ts +31 -10
- package/src/utils.ts +5 -1
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', {
|
|
@@ -1668,6 +1679,8 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1668
1679
|
/**
|
|
1669
1680
|
* delete - Delete the channel. Messages are permanently removed.
|
|
1670
1681
|
*
|
|
1682
|
+
* @param {boolean} [options.hard_delete] Defines if the channel is hard deleted or not
|
|
1683
|
+
*
|
|
1671
1684
|
* @return {Promise<DeleteChannelAPIResponse<ChannelType, CommandType, UserType>>} The server response
|
|
1672
1685
|
*/
|
|
1673
1686
|
|
|
@@ -1675,17 +1688,20 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1675
1688
|
key: "delete",
|
|
1676
1689
|
value: function () {
|
|
1677
1690
|
var _delete2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {
|
|
1691
|
+
var options,
|
|
1692
|
+
_args11 = arguments;
|
|
1678
1693
|
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
1679
1694
|
while (1) {
|
|
1680
1695
|
switch (_context11.prev = _context11.next) {
|
|
1681
1696
|
case 0:
|
|
1682
|
-
|
|
1683
|
-
|
|
1697
|
+
options = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : {};
|
|
1698
|
+
_context11.next = 3;
|
|
1699
|
+
return this.getClient().delete(this._channelURL(), _objectSpread$5({}, options));
|
|
1684
1700
|
|
|
1685
|
-
case
|
|
1701
|
+
case 3:
|
|
1686
1702
|
return _context11.abrupt("return", _context11.sent);
|
|
1687
1703
|
|
|
1688
|
-
case
|
|
1704
|
+
case 4:
|
|
1689
1705
|
case "end":
|
|
1690
1706
|
return _context11.stop();
|
|
1691
1707
|
}
|
|
@@ -3183,7 +3199,8 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3183
3199
|
channelState.read[event.user.id] = {
|
|
3184
3200
|
// because in client.ts the handleEvent call that flows to this sets this `event.received_at = new Date();`
|
|
3185
3201
|
last_read: event.received_at,
|
|
3186
|
-
user: event.user
|
|
3202
|
+
user: event.user,
|
|
3203
|
+
unread_messages: 0
|
|
3187
3204
|
};
|
|
3188
3205
|
|
|
3189
3206
|
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 +3257,8 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3240
3257
|
channelState.unreadCount = 0;
|
|
3241
3258
|
channelState.read[event.user.id] = {
|
|
3242
3259
|
last_read: new Date(event.created_at),
|
|
3243
|
-
user: event.user
|
|
3260
|
+
user: event.user,
|
|
3261
|
+
unread_messages: 0
|
|
3244
3262
|
};
|
|
3245
3263
|
} else if (this._countMessageAsUnread(event.message)) {
|
|
3246
3264
|
channelState.unreadCount = channelState.unreadCount + 1;
|
|
@@ -3264,7 +3282,16 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3264
3282
|
|
|
3265
3283
|
case 'channel.truncated':
|
|
3266
3284
|
channelState.clearMessages();
|
|
3267
|
-
channelState.unreadCount = 0;
|
|
3285
|
+
channelState.unreadCount = 0; // system messages don't increment unread counts
|
|
3286
|
+
|
|
3287
|
+
if (event.message) {
|
|
3288
|
+
channelState.addMessageSorted(event.message);
|
|
3289
|
+
|
|
3290
|
+
if (event.message.pinned) {
|
|
3291
|
+
channelState.addPinnedMessage(event.message);
|
|
3292
|
+
}
|
|
3293
|
+
}
|
|
3294
|
+
|
|
3268
3295
|
break;
|
|
3269
3296
|
|
|
3270
3297
|
case 'member.added':
|
|
@@ -3410,7 +3437,8 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3410
3437
|
if (user) {
|
|
3411
3438
|
this.state.read[user.id] = {
|
|
3412
3439
|
user: user,
|
|
3413
|
-
last_read: last_read
|
|
3440
|
+
last_read: last_read,
|
|
3441
|
+
unread_messages: 0
|
|
3414
3442
|
};
|
|
3415
3443
|
}
|
|
3416
3444
|
} // apply read state if part of the state
|
|
@@ -3422,16 +3450,17 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3422
3450
|
|
|
3423
3451
|
try {
|
|
3424
3452
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
3425
|
-
var
|
|
3426
|
-
|
|
3427
|
-
var parsedRead = _objectSpread$5(_objectSpread$5({}, read), {}, {
|
|
3428
|
-
last_read: new Date(read.last_read)
|
|
3429
|
-
});
|
|
3453
|
+
var _read$unread_messages;
|
|
3430
3454
|
|
|
3431
|
-
|
|
3455
|
+
var read = _step3.value;
|
|
3456
|
+
this.state.read[read.user.id] = {
|
|
3457
|
+
last_read: new Date(read.last_read),
|
|
3458
|
+
unread_messages: (_read$unread_messages = read.unread_messages) !== null && _read$unread_messages !== void 0 ? _read$unread_messages : 0,
|
|
3459
|
+
user: read.user
|
|
3460
|
+
};
|
|
3432
3461
|
|
|
3433
|
-
if (read.user.id === (user === null || user === void 0 ? void 0 : user.id)
|
|
3434
|
-
this.state.unreadCount =
|
|
3462
|
+
if (read.user.id === (user === null || user === void 0 ? void 0 : user.id)) {
|
|
3463
|
+
this.state.unreadCount = this.state.read[read.user.id].unread_messages;
|
|
3435
3464
|
}
|
|
3436
3465
|
}
|
|
3437
3466
|
} catch (err) {
|
|
@@ -3783,6 +3812,12 @@ var StableWSConnection = /*#__PURE__*/function () {
|
|
|
3783
3812
|
|
|
3784
3813
|
_defineProperty(this, "onmessage", function (wsID, event) {
|
|
3785
3814
|
if (_this.wsID !== wsID) return;
|
|
3815
|
+
|
|
3816
|
+
_this._log('onmessage() - onmessage callback', {
|
|
3817
|
+
event: event,
|
|
3818
|
+
wsID: wsID
|
|
3819
|
+
});
|
|
3820
|
+
|
|
3786
3821
|
var data = typeof event.data === 'string' ? JSON.parse(event.data) : null; // we wait till the first message before we consider the connection open..
|
|
3787
3822
|
// the reason for this is that auth errors and similar errors trigger a ws.onopen and immediately
|
|
3788
3823
|
// after that a ws.onclose..
|
|
@@ -3807,11 +3842,6 @@ var StableWSConnection = /*#__PURE__*/function () {
|
|
|
3807
3842
|
|
|
3808
3843
|
_this.lastEvent = new Date();
|
|
3809
3844
|
|
|
3810
|
-
_this._log('onmessage() - onmessage callback', {
|
|
3811
|
-
event: event,
|
|
3812
|
-
wsID: wsID
|
|
3813
|
-
});
|
|
3814
|
-
|
|
3815
3845
|
if (data && data.type === 'health.check') {
|
|
3816
3846
|
_this.scheduleNextPing();
|
|
3817
3847
|
}
|
|
@@ -4341,27 +4371,36 @@ var StableWSConnection = /*#__PURE__*/function () {
|
|
|
4341
4371
|
this.requestID = randomId();
|
|
4342
4372
|
this.client.insightMetrics.connectionStartTimestamp = new Date().getTime();
|
|
4343
4373
|
_context5.prev = 5;
|
|
4344
|
-
|
|
4374
|
+
|
|
4375
|
+
this._log("_connect() - waiting for token");
|
|
4376
|
+
|
|
4377
|
+
_context5.next = 9;
|
|
4345
4378
|
return this.client.tokenManager.tokenReady();
|
|
4346
4379
|
|
|
4347
|
-
case
|
|
4380
|
+
case 9:
|
|
4348
4381
|
this._setupConnectionPromise();
|
|
4349
4382
|
|
|
4350
4383
|
wsURL = this._buildUrl();
|
|
4384
|
+
|
|
4385
|
+
this._log("_connect() - Connecting to ".concat(wsURL), {
|
|
4386
|
+
wsURL: wsURL,
|
|
4387
|
+
requestID: this.requestID
|
|
4388
|
+
});
|
|
4389
|
+
|
|
4351
4390
|
this.ws = new WebSocket(wsURL);
|
|
4352
4391
|
this.ws.onopen = this.onopen.bind(this, this.wsID);
|
|
4353
4392
|
this.ws.onclose = this.onclose.bind(this, this.wsID);
|
|
4354
4393
|
this.ws.onerror = this.onerror.bind(this, this.wsID);
|
|
4355
4394
|
this.ws.onmessage = this.onmessage.bind(this, this.wsID);
|
|
4356
|
-
_context5.next =
|
|
4395
|
+
_context5.next = 19;
|
|
4357
4396
|
return this.connectionOpen;
|
|
4358
4397
|
|
|
4359
|
-
case
|
|
4398
|
+
case 19:
|
|
4360
4399
|
response = _context5.sent;
|
|
4361
4400
|
this.isConnecting = false;
|
|
4362
4401
|
|
|
4363
4402
|
if (!response) {
|
|
4364
|
-
_context5.next =
|
|
4403
|
+
_context5.next = 25;
|
|
4365
4404
|
break;
|
|
4366
4405
|
}
|
|
4367
4406
|
|
|
@@ -4374,12 +4413,12 @@ var StableWSConnection = /*#__PURE__*/function () {
|
|
|
4374
4413
|
|
|
4375
4414
|
return _context5.abrupt("return", response);
|
|
4376
4415
|
|
|
4377
|
-
case
|
|
4378
|
-
_context5.next =
|
|
4416
|
+
case 25:
|
|
4417
|
+
_context5.next = 32;
|
|
4379
4418
|
break;
|
|
4380
4419
|
|
|
4381
|
-
case
|
|
4382
|
-
_context5.prev =
|
|
4420
|
+
case 27:
|
|
4421
|
+
_context5.prev = 27;
|
|
4383
4422
|
_context5.t0 = _context5["catch"](5);
|
|
4384
4423
|
this.isConnecting = false;
|
|
4385
4424
|
|
|
@@ -4392,12 +4431,12 @@ var StableWSConnection = /*#__PURE__*/function () {
|
|
|
4392
4431
|
|
|
4393
4432
|
throw _context5.t0;
|
|
4394
4433
|
|
|
4395
|
-
case
|
|
4434
|
+
case 32:
|
|
4396
4435
|
case "end":
|
|
4397
4436
|
return _context5.stop();
|
|
4398
4437
|
}
|
|
4399
4438
|
}
|
|
4400
|
-
}, _callee5, this, [[5,
|
|
4439
|
+
}, _callee5, this, [[5, 27]]);
|
|
4401
4440
|
}));
|
|
4402
4441
|
|
|
4403
4442
|
function _connect() {
|
|
@@ -6549,7 +6588,6 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6549
6588
|
apnTemplate: '{}', //if app doesn't have apn configured it will error
|
|
6550
6589
|
firebaseTemplate: '{}', //if app doesn't have firebase configured it will error
|
|
6551
6590
|
firebaseDataTemplate: '{}', //if app doesn't have firebase configured it will error
|
|
6552
|
-
huaweiDataTemplate: '{}' //if app doesn't have huawei configured it will error
|
|
6553
6591
|
skipDevices: true, // skip config/device checks and sending to real devices
|
|
6554
6592
|
}
|
|
6555
6593
|
*/
|
|
@@ -6566,7 +6604,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6566
6604
|
case 0:
|
|
6567
6605
|
data = _args12.length > 1 && _args12[1] !== undefined ? _args12[1] : {};
|
|
6568
6606
|
_context12.next = 3;
|
|
6569
|
-
return this.post(this.baseURL + '/check_push', _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(
|
|
6607
|
+
return this.post(this.baseURL + '/check_push', _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
6570
6608
|
user_id: userID
|
|
6571
6609
|
}, data.messageID ? {
|
|
6572
6610
|
message_id: data.messageID
|
|
@@ -6576,8 +6614,6 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6576
6614
|
firebase_template: data.firebaseTemplate
|
|
6577
6615
|
} : {}), data.firebaseDataTemplate ? {
|
|
6578
6616
|
firebase_data_template: data.firebaseDataTemplate
|
|
6579
|
-
} : {}), data.huaweiDataTemplate ? {
|
|
6580
|
-
huawei_data_template: data.huaweiDataTemplate
|
|
6581
6617
|
} : {}), data.skipDevices ? {
|
|
6582
6618
|
skip_devices: true
|
|
6583
6619
|
} : {}));
|
|
@@ -8522,6 +8558,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8522
8558
|
* It is present for internal usage only.
|
|
8523
8559
|
* This function can, and will, break and/or be removed at any point in time.
|
|
8524
8560
|
*
|
|
8561
|
+
* @private
|
|
8525
8562
|
* @param {FlagReportsFilters} filterConditions MongoDB style filter conditions
|
|
8526
8563
|
* @param {FlagReportsPaginationOptions} options Option object, {limit: 10, offset:0}
|
|
8527
8564
|
*
|
|
@@ -8570,6 +8607,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8570
8607
|
* It is present for internal usage only.
|
|
8571
8608
|
* This function can, and will, break and/or be removed at any point in time.
|
|
8572
8609
|
*
|
|
8610
|
+
* @private
|
|
8573
8611
|
* @param {string} [id] flag report to review
|
|
8574
8612
|
* @param {string} [reviewResult] flag report review result
|
|
8575
8613
|
* @param {string} [options.user_id] currentUserID, only used with serverside auth
|
|
@@ -8610,6 +8648,52 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8610
8648
|
|
|
8611
8649
|
return _reviewFlagReport;
|
|
8612
8650
|
}()
|
|
8651
|
+
/**
|
|
8652
|
+
* _unblockMessage - unblocks message blocked by automod
|
|
8653
|
+
*
|
|
8654
|
+
* Note: Do not use this.
|
|
8655
|
+
* It is present for internal usage only.
|
|
8656
|
+
* This function can, and will, break and/or be removed at any point in time.
|
|
8657
|
+
*
|
|
8658
|
+
* @private
|
|
8659
|
+
* @param {string} targetMessageID
|
|
8660
|
+
* @param {string} [options.user_id] currentUserID, only used with serverside auth
|
|
8661
|
+
* @returns {Promise<APIResponse>}
|
|
8662
|
+
*/
|
|
8663
|
+
|
|
8664
|
+
}, {
|
|
8665
|
+
key: "_unblockMessage",
|
|
8666
|
+
value: function () {
|
|
8667
|
+
var _unblockMessage2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44(targetMessageID) {
|
|
8668
|
+
var options,
|
|
8669
|
+
_args44 = arguments;
|
|
8670
|
+
return _regeneratorRuntime.wrap(function _callee44$(_context44) {
|
|
8671
|
+
while (1) {
|
|
8672
|
+
switch (_context44.prev = _context44.next) {
|
|
8673
|
+
case 0:
|
|
8674
|
+
options = _args44.length > 1 && _args44[1] !== undefined ? _args44[1] : {};
|
|
8675
|
+
_context44.next = 3;
|
|
8676
|
+
return this.post(this.baseURL + '/moderation/unblock_message', _objectSpread({
|
|
8677
|
+
target_message_id: targetMessageID
|
|
8678
|
+
}, options));
|
|
8679
|
+
|
|
8680
|
+
case 3:
|
|
8681
|
+
return _context44.abrupt("return", _context44.sent);
|
|
8682
|
+
|
|
8683
|
+
case 4:
|
|
8684
|
+
case "end":
|
|
8685
|
+
return _context44.stop();
|
|
8686
|
+
}
|
|
8687
|
+
}
|
|
8688
|
+
}, _callee44, this);
|
|
8689
|
+
}));
|
|
8690
|
+
|
|
8691
|
+
function _unblockMessage(_x56) {
|
|
8692
|
+
return _unblockMessage2.apply(this, arguments);
|
|
8693
|
+
}
|
|
8694
|
+
|
|
8695
|
+
return _unblockMessage;
|
|
8696
|
+
}()
|
|
8613
8697
|
/**
|
|
8614
8698
|
* @deprecated use markChannelsRead instead
|
|
8615
8699
|
*
|
|
@@ -8631,23 +8715,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8631
8715
|
* @return {Promise<APIResponse>}
|
|
8632
8716
|
*/
|
|
8633
8717
|
function () {
|
|
8634
|
-
var _markChannelsRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8718
|
+
var _markChannelsRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45() {
|
|
8635
8719
|
var data,
|
|
8636
|
-
|
|
8637
|
-
return _regeneratorRuntime.wrap(function
|
|
8720
|
+
_args45 = arguments;
|
|
8721
|
+
return _regeneratorRuntime.wrap(function _callee45$(_context45) {
|
|
8638
8722
|
while (1) {
|
|
8639
|
-
switch (
|
|
8723
|
+
switch (_context45.prev = _context45.next) {
|
|
8640
8724
|
case 0:
|
|
8641
|
-
data =
|
|
8642
|
-
|
|
8725
|
+
data = _args45.length > 0 && _args45[0] !== undefined ? _args45[0] : {};
|
|
8726
|
+
_context45.next = 3;
|
|
8643
8727
|
return this.post(this.baseURL + '/channels/read', _objectSpread({}, data));
|
|
8644
8728
|
|
|
8645
8729
|
case 3:
|
|
8646
8730
|
case "end":
|
|
8647
|
-
return
|
|
8731
|
+
return _context45.stop();
|
|
8648
8732
|
}
|
|
8649
8733
|
}
|
|
8650
|
-
},
|
|
8734
|
+
}, _callee45, this);
|
|
8651
8735
|
}));
|
|
8652
8736
|
|
|
8653
8737
|
function markChannelsRead() {
|
|
@@ -8722,28 +8806,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8722
8806
|
}, {
|
|
8723
8807
|
key: "translateMessage",
|
|
8724
8808
|
value: function () {
|
|
8725
|
-
var _translateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8726
|
-
return _regeneratorRuntime.wrap(function
|
|
8809
|
+
var _translateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46(messageId, language) {
|
|
8810
|
+
return _regeneratorRuntime.wrap(function _callee46$(_context46) {
|
|
8727
8811
|
while (1) {
|
|
8728
|
-
switch (
|
|
8812
|
+
switch (_context46.prev = _context46.next) {
|
|
8729
8813
|
case 0:
|
|
8730
|
-
|
|
8814
|
+
_context46.next = 2;
|
|
8731
8815
|
return this.post(this.baseURL + "/messages/".concat(messageId, "/translate"), {
|
|
8732
8816
|
language: language
|
|
8733
8817
|
});
|
|
8734
8818
|
|
|
8735
8819
|
case 2:
|
|
8736
|
-
return
|
|
8820
|
+
return _context46.abrupt("return", _context46.sent);
|
|
8737
8821
|
|
|
8738
8822
|
case 3:
|
|
8739
8823
|
case "end":
|
|
8740
|
-
return
|
|
8824
|
+
return _context46.stop();
|
|
8741
8825
|
}
|
|
8742
8826
|
}
|
|
8743
|
-
},
|
|
8827
|
+
}, _callee46, this);
|
|
8744
8828
|
}));
|
|
8745
8829
|
|
|
8746
|
-
function translateMessage(
|
|
8830
|
+
function translateMessage(_x57, _x58) {
|
|
8747
8831
|
return _translateMessage.apply(this, arguments);
|
|
8748
8832
|
}
|
|
8749
8833
|
|
|
@@ -8845,14 +8929,14 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8845
8929
|
}, {
|
|
8846
8930
|
key: "updateMessage",
|
|
8847
8931
|
value: function () {
|
|
8848
|
-
var _updateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8932
|
+
var _updateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee47(message, userId, options) {
|
|
8849
8933
|
var clonedMessage, reservedMessageFields;
|
|
8850
|
-
return _regeneratorRuntime.wrap(function
|
|
8934
|
+
return _regeneratorRuntime.wrap(function _callee47$(_context47) {
|
|
8851
8935
|
while (1) {
|
|
8852
|
-
switch (
|
|
8936
|
+
switch (_context47.prev = _context47.next) {
|
|
8853
8937
|
case 0:
|
|
8854
8938
|
if (message.id) {
|
|
8855
|
-
|
|
8939
|
+
_context47.next = 2;
|
|
8856
8940
|
break;
|
|
8857
8941
|
}
|
|
8858
8942
|
|
|
@@ -8889,23 +8973,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8889
8973
|
});
|
|
8890
8974
|
}
|
|
8891
8975
|
|
|
8892
|
-
|
|
8976
|
+
_context47.next = 10;
|
|
8893
8977
|
return this.post(this.baseURL + "/messages/".concat(message.id), _objectSpread({
|
|
8894
8978
|
message: clonedMessage
|
|
8895
8979
|
}, options));
|
|
8896
8980
|
|
|
8897
8981
|
case 10:
|
|
8898
|
-
return
|
|
8982
|
+
return _context47.abrupt("return", _context47.sent);
|
|
8899
8983
|
|
|
8900
8984
|
case 11:
|
|
8901
8985
|
case "end":
|
|
8902
|
-
return
|
|
8986
|
+
return _context47.stop();
|
|
8903
8987
|
}
|
|
8904
8988
|
}
|
|
8905
|
-
},
|
|
8989
|
+
}, _callee47, this);
|
|
8906
8990
|
}));
|
|
8907
8991
|
|
|
8908
|
-
function updateMessage(
|
|
8992
|
+
function updateMessage(_x59, _x60, _x61) {
|
|
8909
8993
|
return _updateMessage.apply(this, arguments);
|
|
8910
8994
|
}
|
|
8911
8995
|
|
|
@@ -8928,14 +9012,14 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8928
9012
|
}, {
|
|
8929
9013
|
key: "partialUpdateMessage",
|
|
8930
9014
|
value: function () {
|
|
8931
|
-
var _partialUpdateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9015
|
+
var _partialUpdateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee48(id, partialMessageObject, userId, options) {
|
|
8932
9016
|
var user;
|
|
8933
|
-
return _regeneratorRuntime.wrap(function
|
|
9017
|
+
return _regeneratorRuntime.wrap(function _callee48$(_context48) {
|
|
8934
9018
|
while (1) {
|
|
8935
|
-
switch (
|
|
9019
|
+
switch (_context48.prev = _context48.next) {
|
|
8936
9020
|
case 0:
|
|
8937
9021
|
if (id) {
|
|
8938
|
-
|
|
9022
|
+
_context48.next = 2;
|
|
8939
9023
|
break;
|
|
8940
9024
|
}
|
|
8941
9025
|
|
|
@@ -8950,23 +9034,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8950
9034
|
};
|
|
8951
9035
|
}
|
|
8952
9036
|
|
|
8953
|
-
|
|
9037
|
+
_context48.next = 6;
|
|
8954
9038
|
return this.put(this.baseURL + "/messages/".concat(id), _objectSpread(_objectSpread(_objectSpread({}, partialMessageObject), options), {}, {
|
|
8955
9039
|
user: user
|
|
8956
9040
|
}));
|
|
8957
9041
|
|
|
8958
9042
|
case 6:
|
|
8959
|
-
return
|
|
9043
|
+
return _context48.abrupt("return", _context48.sent);
|
|
8960
9044
|
|
|
8961
9045
|
case 7:
|
|
8962
9046
|
case "end":
|
|
8963
|
-
return
|
|
9047
|
+
return _context48.stop();
|
|
8964
9048
|
}
|
|
8965
9049
|
}
|
|
8966
|
-
},
|
|
9050
|
+
}, _callee48, this);
|
|
8967
9051
|
}));
|
|
8968
9052
|
|
|
8969
|
-
function partialUpdateMessage(
|
|
9053
|
+
function partialUpdateMessage(_x62, _x63, _x64, _x65) {
|
|
8970
9054
|
return _partialUpdateMessage.apply(this, arguments);
|
|
8971
9055
|
}
|
|
8972
9056
|
|
|
@@ -8975,11 +9059,11 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8975
9059
|
}, {
|
|
8976
9060
|
key: "deleteMessage",
|
|
8977
9061
|
value: function () {
|
|
8978
|
-
var _deleteMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9062
|
+
var _deleteMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49(messageID, hardDelete) {
|
|
8979
9063
|
var params;
|
|
8980
|
-
return _regeneratorRuntime.wrap(function
|
|
9064
|
+
return _regeneratorRuntime.wrap(function _callee49$(_context49) {
|
|
8981
9065
|
while (1) {
|
|
8982
|
-
switch (
|
|
9066
|
+
switch (_context49.prev = _context49.next) {
|
|
8983
9067
|
case 0:
|
|
8984
9068
|
params = {};
|
|
8985
9069
|
|
|
@@ -8989,21 +9073,21 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8989
9073
|
};
|
|
8990
9074
|
}
|
|
8991
9075
|
|
|
8992
|
-
|
|
9076
|
+
_context49.next = 4;
|
|
8993
9077
|
return this.delete(this.baseURL + "/messages/".concat(messageID), params);
|
|
8994
9078
|
|
|
8995
9079
|
case 4:
|
|
8996
|
-
return
|
|
9080
|
+
return _context49.abrupt("return", _context49.sent);
|
|
8997
9081
|
|
|
8998
9082
|
case 5:
|
|
8999
9083
|
case "end":
|
|
9000
|
-
return
|
|
9084
|
+
return _context49.stop();
|
|
9001
9085
|
}
|
|
9002
9086
|
}
|
|
9003
|
-
},
|
|
9087
|
+
}, _callee49, this);
|
|
9004
9088
|
}));
|
|
9005
9089
|
|
|
9006
|
-
function deleteMessage(
|
|
9090
|
+
function deleteMessage(_x66, _x67) {
|
|
9007
9091
|
return _deleteMessage.apply(this, arguments);
|
|
9008
9092
|
}
|
|
9009
9093
|
|
|
@@ -9012,26 +9096,26 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9012
9096
|
}, {
|
|
9013
9097
|
key: "getMessage",
|
|
9014
9098
|
value: function () {
|
|
9015
|
-
var _getMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9016
|
-
return _regeneratorRuntime.wrap(function
|
|
9099
|
+
var _getMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee50(messageID) {
|
|
9100
|
+
return _regeneratorRuntime.wrap(function _callee50$(_context50) {
|
|
9017
9101
|
while (1) {
|
|
9018
|
-
switch (
|
|
9102
|
+
switch (_context50.prev = _context50.next) {
|
|
9019
9103
|
case 0:
|
|
9020
|
-
|
|
9104
|
+
_context50.next = 2;
|
|
9021
9105
|
return this.get(this.baseURL + "/messages/".concat(messageID));
|
|
9022
9106
|
|
|
9023
9107
|
case 2:
|
|
9024
|
-
return
|
|
9108
|
+
return _context50.abrupt("return", _context50.sent);
|
|
9025
9109
|
|
|
9026
9110
|
case 3:
|
|
9027
9111
|
case "end":
|
|
9028
|
-
return
|
|
9112
|
+
return _context50.stop();
|
|
9029
9113
|
}
|
|
9030
9114
|
}
|
|
9031
|
-
},
|
|
9115
|
+
}, _callee50, this);
|
|
9032
9116
|
}));
|
|
9033
9117
|
|
|
9034
|
-
function getMessage(
|
|
9118
|
+
function getMessage(_x68) {
|
|
9035
9119
|
return _getMessage.apply(this, arguments);
|
|
9036
9120
|
}
|
|
9037
9121
|
|
|
@@ -9040,7 +9124,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9040
9124
|
}, {
|
|
9041
9125
|
key: "getUserAgent",
|
|
9042
9126
|
value: function getUserAgent() {
|
|
9043
|
-
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "5.
|
|
9127
|
+
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "5.4.0");
|
|
9044
9128
|
}
|
|
9045
9129
|
}, {
|
|
9046
9130
|
key: "setUserAgent",
|
|
@@ -9235,28 +9319,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9235
9319
|
}, {
|
|
9236
9320
|
key: "sendUserCustomEvent",
|
|
9237
9321
|
value: function () {
|
|
9238
|
-
var _sendUserCustomEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9239
|
-
return _regeneratorRuntime.wrap(function
|
|
9322
|
+
var _sendUserCustomEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee51(targetUserID, event) {
|
|
9323
|
+
return _regeneratorRuntime.wrap(function _callee51$(_context51) {
|
|
9240
9324
|
while (1) {
|
|
9241
|
-
switch (
|
|
9325
|
+
switch (_context51.prev = _context51.next) {
|
|
9242
9326
|
case 0:
|
|
9243
|
-
|
|
9327
|
+
_context51.next = 2;
|
|
9244
9328
|
return this.post("".concat(this.baseURL, "/users/").concat(targetUserID, "/event"), {
|
|
9245
9329
|
event: event
|
|
9246
9330
|
});
|
|
9247
9331
|
|
|
9248
9332
|
case 2:
|
|
9249
|
-
return
|
|
9333
|
+
return _context51.abrupt("return", _context51.sent);
|
|
9250
9334
|
|
|
9251
9335
|
case 3:
|
|
9252
9336
|
case "end":
|
|
9253
|
-
return
|
|
9337
|
+
return _context51.stop();
|
|
9254
9338
|
}
|
|
9255
9339
|
}
|
|
9256
|
-
},
|
|
9340
|
+
}, _callee51, this);
|
|
9257
9341
|
}));
|
|
9258
9342
|
|
|
9259
|
-
function sendUserCustomEvent(
|
|
9343
|
+
function sendUserCustomEvent(_x69, _x70) {
|
|
9260
9344
|
return _sendUserCustomEvent.apply(this, arguments);
|
|
9261
9345
|
}
|
|
9262
9346
|
|
|
@@ -9298,6 +9382,11 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9298
9382
|
|
|
9299
9383
|
return this.post("".concat(this.baseURL, "/export_channels"), payload);
|
|
9300
9384
|
}
|
|
9385
|
+
}, {
|
|
9386
|
+
key: "exportUsers",
|
|
9387
|
+
value: function exportUsers(request) {
|
|
9388
|
+
return this.post("".concat(this.baseURL, "/export/users"), request);
|
|
9389
|
+
}
|
|
9301
9390
|
}, {
|
|
9302
9391
|
key: "exportChannel",
|
|
9303
9392
|
value: function exportChannel(request, options) {
|
|
@@ -9319,32 +9408,32 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9319
9408
|
}, {
|
|
9320
9409
|
key: "createSegment",
|
|
9321
9410
|
value: function () {
|
|
9322
|
-
var _createSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9411
|
+
var _createSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee52(params) {
|
|
9323
9412
|
var _yield$this$post, segment;
|
|
9324
9413
|
|
|
9325
|
-
return _regeneratorRuntime.wrap(function
|
|
9414
|
+
return _regeneratorRuntime.wrap(function _callee52$(_context52) {
|
|
9326
9415
|
while (1) {
|
|
9327
|
-
switch (
|
|
9416
|
+
switch (_context52.prev = _context52.next) {
|
|
9328
9417
|
case 0:
|
|
9329
|
-
|
|
9418
|
+
_context52.next = 2;
|
|
9330
9419
|
return this.post(this.baseURL + "/segments", {
|
|
9331
9420
|
segment: params
|
|
9332
9421
|
});
|
|
9333
9422
|
|
|
9334
9423
|
case 2:
|
|
9335
|
-
_yield$this$post =
|
|
9424
|
+
_yield$this$post = _context52.sent;
|
|
9336
9425
|
segment = _yield$this$post.segment;
|
|
9337
|
-
return
|
|
9426
|
+
return _context52.abrupt("return", segment);
|
|
9338
9427
|
|
|
9339
9428
|
case 5:
|
|
9340
9429
|
case "end":
|
|
9341
|
-
return
|
|
9430
|
+
return _context52.stop();
|
|
9342
9431
|
}
|
|
9343
9432
|
}
|
|
9344
|
-
},
|
|
9433
|
+
}, _callee52, this);
|
|
9345
9434
|
}));
|
|
9346
9435
|
|
|
9347
|
-
function createSegment(
|
|
9436
|
+
function createSegment(_x71) {
|
|
9348
9437
|
return _createSegment.apply(this, arguments);
|
|
9349
9438
|
}
|
|
9350
9439
|
|
|
@@ -9361,30 +9450,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9361
9450
|
}, {
|
|
9362
9451
|
key: "getSegment",
|
|
9363
9452
|
value: function () {
|
|
9364
|
-
var _getSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9453
|
+
var _getSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee53(id) {
|
|
9365
9454
|
var _yield$this$get, segment;
|
|
9366
9455
|
|
|
9367
|
-
return _regeneratorRuntime.wrap(function
|
|
9456
|
+
return _regeneratorRuntime.wrap(function _callee53$(_context53) {
|
|
9368
9457
|
while (1) {
|
|
9369
|
-
switch (
|
|
9458
|
+
switch (_context53.prev = _context53.next) {
|
|
9370
9459
|
case 0:
|
|
9371
|
-
|
|
9460
|
+
_context53.next = 2;
|
|
9372
9461
|
return this.get(this.baseURL + "/segments/".concat(id));
|
|
9373
9462
|
|
|
9374
9463
|
case 2:
|
|
9375
|
-
_yield$this$get =
|
|
9464
|
+
_yield$this$get = _context53.sent;
|
|
9376
9465
|
segment = _yield$this$get.segment;
|
|
9377
|
-
return
|
|
9466
|
+
return _context53.abrupt("return", segment);
|
|
9378
9467
|
|
|
9379
9468
|
case 5:
|
|
9380
9469
|
case "end":
|
|
9381
|
-
return
|
|
9470
|
+
return _context53.stop();
|
|
9382
9471
|
}
|
|
9383
9472
|
}
|
|
9384
|
-
},
|
|
9473
|
+
}, _callee53, this);
|
|
9385
9474
|
}));
|
|
9386
9475
|
|
|
9387
|
-
function getSegment(
|
|
9476
|
+
function getSegment(_x72) {
|
|
9388
9477
|
return _getSegment.apply(this, arguments);
|
|
9389
9478
|
}
|
|
9390
9479
|
|
|
@@ -9400,30 +9489,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9400
9489
|
}, {
|
|
9401
9490
|
key: "listSegments",
|
|
9402
9491
|
value: function () {
|
|
9403
|
-
var _listSegments = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9492
|
+
var _listSegments = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee54(options) {
|
|
9404
9493
|
var _yield$this$get2, segments;
|
|
9405
9494
|
|
|
9406
|
-
return _regeneratorRuntime.wrap(function
|
|
9495
|
+
return _regeneratorRuntime.wrap(function _callee54$(_context54) {
|
|
9407
9496
|
while (1) {
|
|
9408
|
-
switch (
|
|
9497
|
+
switch (_context54.prev = _context54.next) {
|
|
9409
9498
|
case 0:
|
|
9410
|
-
|
|
9499
|
+
_context54.next = 2;
|
|
9411
9500
|
return this.get(this.baseURL + "/segments", options);
|
|
9412
9501
|
|
|
9413
9502
|
case 2:
|
|
9414
|
-
_yield$this$get2 =
|
|
9503
|
+
_yield$this$get2 = _context54.sent;
|
|
9415
9504
|
segments = _yield$this$get2.segments;
|
|
9416
|
-
return
|
|
9505
|
+
return _context54.abrupt("return", segments);
|
|
9417
9506
|
|
|
9418
9507
|
case 5:
|
|
9419
9508
|
case "end":
|
|
9420
|
-
return
|
|
9509
|
+
return _context54.stop();
|
|
9421
9510
|
}
|
|
9422
9511
|
}
|
|
9423
|
-
},
|
|
9512
|
+
}, _callee54, this);
|
|
9424
9513
|
}));
|
|
9425
9514
|
|
|
9426
|
-
function listSegments(
|
|
9515
|
+
function listSegments(_x73) {
|
|
9427
9516
|
return _listSegments.apply(this, arguments);
|
|
9428
9517
|
}
|
|
9429
9518
|
|
|
@@ -9441,32 +9530,32 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9441
9530
|
}, {
|
|
9442
9531
|
key: "updateSegment",
|
|
9443
9532
|
value: function () {
|
|
9444
|
-
var _updateSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9533
|
+
var _updateSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee55(id, params) {
|
|
9445
9534
|
var _yield$this$put, segment;
|
|
9446
9535
|
|
|
9447
|
-
return _regeneratorRuntime.wrap(function
|
|
9536
|
+
return _regeneratorRuntime.wrap(function _callee55$(_context55) {
|
|
9448
9537
|
while (1) {
|
|
9449
|
-
switch (
|
|
9538
|
+
switch (_context55.prev = _context55.next) {
|
|
9450
9539
|
case 0:
|
|
9451
|
-
|
|
9540
|
+
_context55.next = 2;
|
|
9452
9541
|
return this.put(this.baseURL + "/segments/".concat(id), {
|
|
9453
9542
|
segment: params
|
|
9454
9543
|
});
|
|
9455
9544
|
|
|
9456
9545
|
case 2:
|
|
9457
|
-
_yield$this$put =
|
|
9546
|
+
_yield$this$put = _context55.sent;
|
|
9458
9547
|
segment = _yield$this$put.segment;
|
|
9459
|
-
return
|
|
9548
|
+
return _context55.abrupt("return", segment);
|
|
9460
9549
|
|
|
9461
9550
|
case 5:
|
|
9462
9551
|
case "end":
|
|
9463
|
-
return
|
|
9552
|
+
return _context55.stop();
|
|
9464
9553
|
}
|
|
9465
9554
|
}
|
|
9466
|
-
},
|
|
9555
|
+
}, _callee55, this);
|
|
9467
9556
|
}));
|
|
9468
9557
|
|
|
9469
|
-
function updateSegment(
|
|
9558
|
+
function updateSegment(_x74, _x75) {
|
|
9470
9559
|
return _updateSegment.apply(this, arguments);
|
|
9471
9560
|
}
|
|
9472
9561
|
|
|
@@ -9483,22 +9572,22 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9483
9572
|
}, {
|
|
9484
9573
|
key: "deleteSegment",
|
|
9485
9574
|
value: function () {
|
|
9486
|
-
var _deleteSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9487
|
-
return _regeneratorRuntime.wrap(function
|
|
9575
|
+
var _deleteSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee56(id) {
|
|
9576
|
+
return _regeneratorRuntime.wrap(function _callee56$(_context56) {
|
|
9488
9577
|
while (1) {
|
|
9489
|
-
switch (
|
|
9578
|
+
switch (_context56.prev = _context56.next) {
|
|
9490
9579
|
case 0:
|
|
9491
|
-
return
|
|
9580
|
+
return _context56.abrupt("return", this.delete(this.baseURL + "/segments/".concat(id)));
|
|
9492
9581
|
|
|
9493
9582
|
case 1:
|
|
9494
9583
|
case "end":
|
|
9495
|
-
return
|
|
9584
|
+
return _context56.stop();
|
|
9496
9585
|
}
|
|
9497
9586
|
}
|
|
9498
|
-
},
|
|
9587
|
+
}, _callee56, this);
|
|
9499
9588
|
}));
|
|
9500
9589
|
|
|
9501
|
-
function deleteSegment(
|
|
9590
|
+
function deleteSegment(_x76) {
|
|
9502
9591
|
return _deleteSegment.apply(this, arguments);
|
|
9503
9592
|
}
|
|
9504
9593
|
|
|
@@ -9515,32 +9604,32 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9515
9604
|
}, {
|
|
9516
9605
|
key: "createCampaign",
|
|
9517
9606
|
value: function () {
|
|
9518
|
-
var _createCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9607
|
+
var _createCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee57(params) {
|
|
9519
9608
|
var _yield$this$post2, campaign;
|
|
9520
9609
|
|
|
9521
|
-
return _regeneratorRuntime.wrap(function
|
|
9610
|
+
return _regeneratorRuntime.wrap(function _callee57$(_context57) {
|
|
9522
9611
|
while (1) {
|
|
9523
|
-
switch (
|
|
9612
|
+
switch (_context57.prev = _context57.next) {
|
|
9524
9613
|
case 0:
|
|
9525
|
-
|
|
9614
|
+
_context57.next = 2;
|
|
9526
9615
|
return this.post(this.baseURL + "/campaigns", {
|
|
9527
9616
|
campaign: params
|
|
9528
9617
|
});
|
|
9529
9618
|
|
|
9530
9619
|
case 2:
|
|
9531
|
-
_yield$this$post2 =
|
|
9620
|
+
_yield$this$post2 = _context57.sent;
|
|
9532
9621
|
campaign = _yield$this$post2.campaign;
|
|
9533
|
-
return
|
|
9622
|
+
return _context57.abrupt("return", campaign);
|
|
9534
9623
|
|
|
9535
9624
|
case 5:
|
|
9536
9625
|
case "end":
|
|
9537
|
-
return
|
|
9626
|
+
return _context57.stop();
|
|
9538
9627
|
}
|
|
9539
9628
|
}
|
|
9540
|
-
},
|
|
9629
|
+
}, _callee57, this);
|
|
9541
9630
|
}));
|
|
9542
9631
|
|
|
9543
|
-
function createCampaign(
|
|
9632
|
+
function createCampaign(_x77) {
|
|
9544
9633
|
return _createCampaign.apply(this, arguments);
|
|
9545
9634
|
}
|
|
9546
9635
|
|
|
@@ -9557,30 +9646,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9557
9646
|
}, {
|
|
9558
9647
|
key: "getCampaign",
|
|
9559
9648
|
value: function () {
|
|
9560
|
-
var _getCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9649
|
+
var _getCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee58(id) {
|
|
9561
9650
|
var _yield$this$get3, campaign;
|
|
9562
9651
|
|
|
9563
|
-
return _regeneratorRuntime.wrap(function
|
|
9652
|
+
return _regeneratorRuntime.wrap(function _callee58$(_context58) {
|
|
9564
9653
|
while (1) {
|
|
9565
|
-
switch (
|
|
9654
|
+
switch (_context58.prev = _context58.next) {
|
|
9566
9655
|
case 0:
|
|
9567
|
-
|
|
9656
|
+
_context58.next = 2;
|
|
9568
9657
|
return this.get(this.baseURL + "/campaigns/".concat(id));
|
|
9569
9658
|
|
|
9570
9659
|
case 2:
|
|
9571
|
-
_yield$this$get3 =
|
|
9660
|
+
_yield$this$get3 = _context58.sent;
|
|
9572
9661
|
campaign = _yield$this$get3.campaign;
|
|
9573
|
-
return
|
|
9662
|
+
return _context58.abrupt("return", campaign);
|
|
9574
9663
|
|
|
9575
9664
|
case 5:
|
|
9576
9665
|
case "end":
|
|
9577
|
-
return
|
|
9666
|
+
return _context58.stop();
|
|
9578
9667
|
}
|
|
9579
9668
|
}
|
|
9580
|
-
},
|
|
9669
|
+
}, _callee58, this);
|
|
9581
9670
|
}));
|
|
9582
9671
|
|
|
9583
|
-
function getCampaign(
|
|
9672
|
+
function getCampaign(_x78) {
|
|
9584
9673
|
return _getCampaign.apply(this, arguments);
|
|
9585
9674
|
}
|
|
9586
9675
|
|
|
@@ -9596,30 +9685,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9596
9685
|
}, {
|
|
9597
9686
|
key: "listCampaigns",
|
|
9598
9687
|
value: function () {
|
|
9599
|
-
var _listCampaigns = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9688
|
+
var _listCampaigns = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee59(options) {
|
|
9600
9689
|
var _yield$this$get4, campaigns;
|
|
9601
9690
|
|
|
9602
|
-
return _regeneratorRuntime.wrap(function
|
|
9691
|
+
return _regeneratorRuntime.wrap(function _callee59$(_context59) {
|
|
9603
9692
|
while (1) {
|
|
9604
|
-
switch (
|
|
9693
|
+
switch (_context59.prev = _context59.next) {
|
|
9605
9694
|
case 0:
|
|
9606
|
-
|
|
9695
|
+
_context59.next = 2;
|
|
9607
9696
|
return this.get(this.baseURL + "/campaigns", options);
|
|
9608
9697
|
|
|
9609
9698
|
case 2:
|
|
9610
|
-
_yield$this$get4 =
|
|
9699
|
+
_yield$this$get4 = _context59.sent;
|
|
9611
9700
|
campaigns = _yield$this$get4.campaigns;
|
|
9612
|
-
return
|
|
9701
|
+
return _context59.abrupt("return", campaigns);
|
|
9613
9702
|
|
|
9614
9703
|
case 5:
|
|
9615
9704
|
case "end":
|
|
9616
|
-
return
|
|
9705
|
+
return _context59.stop();
|
|
9617
9706
|
}
|
|
9618
9707
|
}
|
|
9619
|
-
},
|
|
9708
|
+
}, _callee59, this);
|
|
9620
9709
|
}));
|
|
9621
9710
|
|
|
9622
|
-
function listCampaigns(
|
|
9711
|
+
function listCampaigns(_x79) {
|
|
9623
9712
|
return _listCampaigns.apply(this, arguments);
|
|
9624
9713
|
}
|
|
9625
9714
|
|
|
@@ -9637,32 +9726,32 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9637
9726
|
}, {
|
|
9638
9727
|
key: "updateCampaign",
|
|
9639
9728
|
value: function () {
|
|
9640
|
-
var _updateCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9729
|
+
var _updateCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee60(id, params) {
|
|
9641
9730
|
var _yield$this$put2, campaign;
|
|
9642
9731
|
|
|
9643
|
-
return _regeneratorRuntime.wrap(function
|
|
9732
|
+
return _regeneratorRuntime.wrap(function _callee60$(_context60) {
|
|
9644
9733
|
while (1) {
|
|
9645
|
-
switch (
|
|
9734
|
+
switch (_context60.prev = _context60.next) {
|
|
9646
9735
|
case 0:
|
|
9647
|
-
|
|
9736
|
+
_context60.next = 2;
|
|
9648
9737
|
return this.put(this.baseURL + "/campaigns/".concat(id), {
|
|
9649
9738
|
campaign: params
|
|
9650
9739
|
});
|
|
9651
9740
|
|
|
9652
9741
|
case 2:
|
|
9653
|
-
_yield$this$put2 =
|
|
9742
|
+
_yield$this$put2 = _context60.sent;
|
|
9654
9743
|
campaign = _yield$this$put2.campaign;
|
|
9655
|
-
return
|
|
9744
|
+
return _context60.abrupt("return", campaign);
|
|
9656
9745
|
|
|
9657
9746
|
case 5:
|
|
9658
9747
|
case "end":
|
|
9659
|
-
return
|
|
9748
|
+
return _context60.stop();
|
|
9660
9749
|
}
|
|
9661
9750
|
}
|
|
9662
|
-
},
|
|
9751
|
+
}, _callee60, this);
|
|
9663
9752
|
}));
|
|
9664
9753
|
|
|
9665
|
-
function updateCampaign(
|
|
9754
|
+
function updateCampaign(_x80, _x81) {
|
|
9666
9755
|
return _updateCampaign.apply(this, arguments);
|
|
9667
9756
|
}
|
|
9668
9757
|
|
|
@@ -9679,22 +9768,22 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9679
9768
|
}, {
|
|
9680
9769
|
key: "deleteCampaign",
|
|
9681
9770
|
value: function () {
|
|
9682
|
-
var _deleteCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9683
|
-
return _regeneratorRuntime.wrap(function
|
|
9771
|
+
var _deleteCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee61(id) {
|
|
9772
|
+
return _regeneratorRuntime.wrap(function _callee61$(_context61) {
|
|
9684
9773
|
while (1) {
|
|
9685
|
-
switch (
|
|
9774
|
+
switch (_context61.prev = _context61.next) {
|
|
9686
9775
|
case 0:
|
|
9687
|
-
return
|
|
9776
|
+
return _context61.abrupt("return", this.delete(this.baseURL + "/campaigns/".concat(id)));
|
|
9688
9777
|
|
|
9689
9778
|
case 1:
|
|
9690
9779
|
case "end":
|
|
9691
|
-
return
|
|
9780
|
+
return _context61.stop();
|
|
9692
9781
|
}
|
|
9693
9782
|
}
|
|
9694
|
-
},
|
|
9783
|
+
}, _callee61, this);
|
|
9695
9784
|
}));
|
|
9696
9785
|
|
|
9697
|
-
function deleteCampaign(
|
|
9786
|
+
function deleteCampaign(_x82) {
|
|
9698
9787
|
return _deleteCampaign.apply(this, arguments);
|
|
9699
9788
|
}
|
|
9700
9789
|
|
|
@@ -9712,33 +9801,33 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9712
9801
|
}, {
|
|
9713
9802
|
key: "scheduleCampaign",
|
|
9714
9803
|
value: function () {
|
|
9715
|
-
var _scheduleCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9804
|
+
var _scheduleCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee62(id, params) {
|
|
9716
9805
|
var sendAt, _yield$this$patch, campaign;
|
|
9717
9806
|
|
|
9718
|
-
return _regeneratorRuntime.wrap(function
|
|
9807
|
+
return _regeneratorRuntime.wrap(function _callee62$(_context62) {
|
|
9719
9808
|
while (1) {
|
|
9720
|
-
switch (
|
|
9809
|
+
switch (_context62.prev = _context62.next) {
|
|
9721
9810
|
case 0:
|
|
9722
9811
|
sendAt = params.sendAt;
|
|
9723
|
-
|
|
9812
|
+
_context62.next = 3;
|
|
9724
9813
|
return this.patch(this.baseURL + "/campaigns/".concat(id, "/schedule"), {
|
|
9725
9814
|
send_at: sendAt
|
|
9726
9815
|
});
|
|
9727
9816
|
|
|
9728
9817
|
case 3:
|
|
9729
|
-
_yield$this$patch =
|
|
9818
|
+
_yield$this$patch = _context62.sent;
|
|
9730
9819
|
campaign = _yield$this$patch.campaign;
|
|
9731
|
-
return
|
|
9820
|
+
return _context62.abrupt("return", campaign);
|
|
9732
9821
|
|
|
9733
9822
|
case 6:
|
|
9734
9823
|
case "end":
|
|
9735
|
-
return
|
|
9824
|
+
return _context62.stop();
|
|
9736
9825
|
}
|
|
9737
9826
|
}
|
|
9738
|
-
},
|
|
9827
|
+
}, _callee62, this);
|
|
9739
9828
|
}));
|
|
9740
9829
|
|
|
9741
|
-
function scheduleCampaign(
|
|
9830
|
+
function scheduleCampaign(_x83, _x84) {
|
|
9742
9831
|
return _scheduleCampaign.apply(this, arguments);
|
|
9743
9832
|
}
|
|
9744
9833
|
|
|
@@ -9755,30 +9844,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9755
9844
|
}, {
|
|
9756
9845
|
key: "stopCampaign",
|
|
9757
9846
|
value: function () {
|
|
9758
|
-
var _stopCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9847
|
+
var _stopCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee63(id) {
|
|
9759
9848
|
var _yield$this$patch2, campaign;
|
|
9760
9849
|
|
|
9761
|
-
return _regeneratorRuntime.wrap(function
|
|
9850
|
+
return _regeneratorRuntime.wrap(function _callee63$(_context63) {
|
|
9762
9851
|
while (1) {
|
|
9763
|
-
switch (
|
|
9852
|
+
switch (_context63.prev = _context63.next) {
|
|
9764
9853
|
case 0:
|
|
9765
|
-
|
|
9854
|
+
_context63.next = 2;
|
|
9766
9855
|
return this.patch(this.baseURL + "/campaigns/".concat(id, "/stop"));
|
|
9767
9856
|
|
|
9768
9857
|
case 2:
|
|
9769
|
-
_yield$this$patch2 =
|
|
9858
|
+
_yield$this$patch2 = _context63.sent;
|
|
9770
9859
|
campaign = _yield$this$patch2.campaign;
|
|
9771
|
-
return
|
|
9860
|
+
return _context63.abrupt("return", campaign);
|
|
9772
9861
|
|
|
9773
9862
|
case 5:
|
|
9774
9863
|
case "end":
|
|
9775
|
-
return
|
|
9864
|
+
return _context63.stop();
|
|
9776
9865
|
}
|
|
9777
9866
|
}
|
|
9778
|
-
},
|
|
9867
|
+
}, _callee63, this);
|
|
9779
9868
|
}));
|
|
9780
9869
|
|
|
9781
|
-
function stopCampaign(
|
|
9870
|
+
function stopCampaign(_x85) {
|
|
9782
9871
|
return _stopCampaign.apply(this, arguments);
|
|
9783
9872
|
}
|
|
9784
9873
|
|
|
@@ -9795,30 +9884,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9795
9884
|
}, {
|
|
9796
9885
|
key: "resumeCampaign",
|
|
9797
9886
|
value: function () {
|
|
9798
|
-
var _resumeCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9887
|
+
var _resumeCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee64(id) {
|
|
9799
9888
|
var _yield$this$patch3, campaign;
|
|
9800
9889
|
|
|
9801
|
-
return _regeneratorRuntime.wrap(function
|
|
9890
|
+
return _regeneratorRuntime.wrap(function _callee64$(_context64) {
|
|
9802
9891
|
while (1) {
|
|
9803
|
-
switch (
|
|
9892
|
+
switch (_context64.prev = _context64.next) {
|
|
9804
9893
|
case 0:
|
|
9805
|
-
|
|
9894
|
+
_context64.next = 2;
|
|
9806
9895
|
return this.patch(this.baseURL + "/campaigns/".concat(id, "/resume"));
|
|
9807
9896
|
|
|
9808
9897
|
case 2:
|
|
9809
|
-
_yield$this$patch3 =
|
|
9898
|
+
_yield$this$patch3 = _context64.sent;
|
|
9810
9899
|
campaign = _yield$this$patch3.campaign;
|
|
9811
|
-
return
|
|
9900
|
+
return _context64.abrupt("return", campaign);
|
|
9812
9901
|
|
|
9813
9902
|
case 5:
|
|
9814
9903
|
case "end":
|
|
9815
|
-
return
|
|
9904
|
+
return _context64.stop();
|
|
9816
9905
|
}
|
|
9817
9906
|
}
|
|
9818
|
-
},
|
|
9907
|
+
}, _callee64, this);
|
|
9819
9908
|
}));
|
|
9820
9909
|
|
|
9821
|
-
function resumeCampaign(
|
|
9910
|
+
function resumeCampaign(_x86) {
|
|
9822
9911
|
return _resumeCampaign.apply(this, arguments);
|
|
9823
9912
|
}
|
|
9824
9913
|
|
|
@@ -9835,33 +9924,33 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9835
9924
|
}, {
|
|
9836
9925
|
key: "testCampaign",
|
|
9837
9926
|
value: function () {
|
|
9838
|
-
var _testCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9927
|
+
var _testCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee65(id, params) {
|
|
9839
9928
|
var users, _yield$this$post3, campaign;
|
|
9840
9929
|
|
|
9841
|
-
return _regeneratorRuntime.wrap(function
|
|
9930
|
+
return _regeneratorRuntime.wrap(function _callee65$(_context65) {
|
|
9842
9931
|
while (1) {
|
|
9843
|
-
switch (
|
|
9932
|
+
switch (_context65.prev = _context65.next) {
|
|
9844
9933
|
case 0:
|
|
9845
9934
|
users = params.users;
|
|
9846
|
-
|
|
9935
|
+
_context65.next = 3;
|
|
9847
9936
|
return this.post(this.baseURL + "/campaigns/".concat(id, "/test"), {
|
|
9848
9937
|
users: users
|
|
9849
9938
|
});
|
|
9850
9939
|
|
|
9851
9940
|
case 3:
|
|
9852
|
-
_yield$this$post3 =
|
|
9941
|
+
_yield$this$post3 = _context65.sent;
|
|
9853
9942
|
campaign = _yield$this$post3.campaign;
|
|
9854
|
-
return
|
|
9943
|
+
return _context65.abrupt("return", campaign);
|
|
9855
9944
|
|
|
9856
9945
|
case 6:
|
|
9857
9946
|
case "end":
|
|
9858
|
-
return
|
|
9947
|
+
return _context65.stop();
|
|
9859
9948
|
}
|
|
9860
9949
|
}
|
|
9861
|
-
},
|
|
9950
|
+
}, _callee65, this);
|
|
9862
9951
|
}));
|
|
9863
9952
|
|
|
9864
|
-
function testCampaign(
|
|
9953
|
+
function testCampaign(_x87, _x88) {
|
|
9865
9954
|
return _testCampaign.apply(this, arguments);
|
|
9866
9955
|
}
|
|
9867
9956
|
|
|
@@ -9877,24 +9966,24 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9877
9966
|
}, {
|
|
9878
9967
|
key: "enrichURL",
|
|
9879
9968
|
value: function () {
|
|
9880
|
-
var _enrichURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9881
|
-
return _regeneratorRuntime.wrap(function
|
|
9969
|
+
var _enrichURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee66(url) {
|
|
9970
|
+
return _regeneratorRuntime.wrap(function _callee66$(_context66) {
|
|
9882
9971
|
while (1) {
|
|
9883
|
-
switch (
|
|
9972
|
+
switch (_context66.prev = _context66.next) {
|
|
9884
9973
|
case 0:
|
|
9885
|
-
return
|
|
9974
|
+
return _context66.abrupt("return", this.get(this.baseURL + "/og", {
|
|
9886
9975
|
url: url
|
|
9887
9976
|
}));
|
|
9888
9977
|
|
|
9889
9978
|
case 1:
|
|
9890
9979
|
case "end":
|
|
9891
|
-
return
|
|
9980
|
+
return _context66.stop();
|
|
9892
9981
|
}
|
|
9893
9982
|
}
|
|
9894
|
-
},
|
|
9983
|
+
}, _callee66, this);
|
|
9895
9984
|
}));
|
|
9896
9985
|
|
|
9897
|
-
function enrichURL(
|
|
9986
|
+
function enrichURL(_x89) {
|
|
9898
9987
|
return _enrichURL.apply(this, arguments);
|
|
9899
9988
|
}
|
|
9900
9989
|
|
|
@@ -9911,22 +10000,22 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9911
10000
|
}, {
|
|
9912
10001
|
key: "getTask",
|
|
9913
10002
|
value: function () {
|
|
9914
|
-
var _getTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9915
|
-
return _regeneratorRuntime.wrap(function
|
|
10003
|
+
var _getTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee67(id) {
|
|
10004
|
+
return _regeneratorRuntime.wrap(function _callee67$(_context67) {
|
|
9916
10005
|
while (1) {
|
|
9917
|
-
switch (
|
|
10006
|
+
switch (_context67.prev = _context67.next) {
|
|
9918
10007
|
case 0:
|
|
9919
|
-
return
|
|
10008
|
+
return _context67.abrupt("return", this.get("".concat(this.baseURL, "/tasks/").concat(id)));
|
|
9920
10009
|
|
|
9921
10010
|
case 1:
|
|
9922
10011
|
case "end":
|
|
9923
|
-
return
|
|
10012
|
+
return _context67.stop();
|
|
9924
10013
|
}
|
|
9925
10014
|
}
|
|
9926
|
-
},
|
|
10015
|
+
}, _callee67, this);
|
|
9927
10016
|
}));
|
|
9928
10017
|
|
|
9929
|
-
function getTask(
|
|
10018
|
+
function getTask(_x90) {
|
|
9930
10019
|
return _getTask.apply(this, arguments);
|
|
9931
10020
|
}
|
|
9932
10021
|
|
|
@@ -9944,31 +10033,31 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9944
10033
|
}, {
|
|
9945
10034
|
key: "deleteChannels",
|
|
9946
10035
|
value: function () {
|
|
9947
|
-
var _deleteChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
10036
|
+
var _deleteChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee68(cids) {
|
|
9948
10037
|
var options,
|
|
9949
|
-
|
|
9950
|
-
return _regeneratorRuntime.wrap(function
|
|
10038
|
+
_args68 = arguments;
|
|
10039
|
+
return _regeneratorRuntime.wrap(function _callee68$(_context68) {
|
|
9951
10040
|
while (1) {
|
|
9952
|
-
switch (
|
|
10041
|
+
switch (_context68.prev = _context68.next) {
|
|
9953
10042
|
case 0:
|
|
9954
|
-
options =
|
|
9955
|
-
|
|
10043
|
+
options = _args68.length > 1 && _args68[1] !== undefined ? _args68[1] : {};
|
|
10044
|
+
_context68.next = 3;
|
|
9956
10045
|
return this.post(this.baseURL + "/channels/delete", _objectSpread({
|
|
9957
10046
|
cids: cids
|
|
9958
10047
|
}, options));
|
|
9959
10048
|
|
|
9960
10049
|
case 3:
|
|
9961
|
-
return
|
|
10050
|
+
return _context68.abrupt("return", _context68.sent);
|
|
9962
10051
|
|
|
9963
10052
|
case 4:
|
|
9964
10053
|
case "end":
|
|
9965
|
-
return
|
|
10054
|
+
return _context68.stop();
|
|
9966
10055
|
}
|
|
9967
10056
|
}
|
|
9968
|
-
},
|
|
10057
|
+
}, _callee68, this);
|
|
9969
10058
|
}));
|
|
9970
10059
|
|
|
9971
|
-
function deleteChannels(
|
|
10060
|
+
function deleteChannels(_x91) {
|
|
9972
10061
|
return _deleteChannels.apply(this, arguments);
|
|
9973
10062
|
}
|
|
9974
10063
|
|
|
@@ -9986,13 +10075,13 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9986
10075
|
}, {
|
|
9987
10076
|
key: "deleteUsers",
|
|
9988
10077
|
value: function () {
|
|
9989
|
-
var _deleteUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9990
|
-
return _regeneratorRuntime.wrap(function
|
|
10078
|
+
var _deleteUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee69(user_ids, options) {
|
|
10079
|
+
return _regeneratorRuntime.wrap(function _callee69$(_context69) {
|
|
9991
10080
|
while (1) {
|
|
9992
|
-
switch (
|
|
10081
|
+
switch (_context69.prev = _context69.next) {
|
|
9993
10082
|
case 0:
|
|
9994
10083
|
if (!((options === null || options === void 0 ? void 0 : options.user) !== 'soft' && (options === null || options === void 0 ? void 0 : options.user) !== 'hard')) {
|
|
9995
|
-
|
|
10084
|
+
_context69.next = 2;
|
|
9996
10085
|
break;
|
|
9997
10086
|
}
|
|
9998
10087
|
|
|
@@ -10000,7 +10089,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10000
10089
|
|
|
10001
10090
|
case 2:
|
|
10002
10091
|
if (!(options.messages !== undefined && options.messages !== 'soft' && options.messages !== 'hard')) {
|
|
10003
|
-
|
|
10092
|
+
_context69.next = 4;
|
|
10004
10093
|
break;
|
|
10005
10094
|
}
|
|
10006
10095
|
|
|
@@ -10008,30 +10097,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10008
10097
|
|
|
10009
10098
|
case 4:
|
|
10010
10099
|
if (!(options.conversations !== undefined && options.conversations !== 'soft' && options.conversations !== 'hard')) {
|
|
10011
|
-
|
|
10100
|
+
_context69.next = 6;
|
|
10012
10101
|
break;
|
|
10013
10102
|
}
|
|
10014
10103
|
|
|
10015
10104
|
throw new Error('Invalid delete user options. conversations must be one of [soft hard]');
|
|
10016
10105
|
|
|
10017
10106
|
case 6:
|
|
10018
|
-
|
|
10107
|
+
_context69.next = 8;
|
|
10019
10108
|
return this.post(this.baseURL + "/users/delete", _objectSpread({
|
|
10020
10109
|
user_ids: user_ids
|
|
10021
10110
|
}, options));
|
|
10022
10111
|
|
|
10023
10112
|
case 8:
|
|
10024
|
-
return
|
|
10113
|
+
return _context69.abrupt("return", _context69.sent);
|
|
10025
10114
|
|
|
10026
10115
|
case 9:
|
|
10027
10116
|
case "end":
|
|
10028
|
-
return
|
|
10117
|
+
return _context69.stop();
|
|
10029
10118
|
}
|
|
10030
10119
|
}
|
|
10031
|
-
},
|
|
10120
|
+
}, _callee69, this);
|
|
10032
10121
|
}));
|
|
10033
10122
|
|
|
10034
|
-
function deleteUsers(
|
|
10123
|
+
function deleteUsers(_x92, _x93) {
|
|
10035
10124
|
return _deleteUsers.apply(this, arguments);
|
|
10036
10125
|
}
|
|
10037
10126
|
|