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