stream-chat 5.1.2 → 5.5.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 -8
- package/dist/browser.es.js +458 -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 +458 -253
- package/dist/browser.js.map +1 -1
- package/dist/index.es.js +458 -253
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +458 -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 +66 -3
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/connection.d.ts.map +1 -1
- package/dist/types/events.d.ts +2 -0
- package/dist/types/events.d.ts.map +1 -1
- package/dist/types/types.d.ts +54 -9
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +6 -1
- package/src/channel.ts +22 -6
- package/src/channel_state.ts +6 -1
- package/src/client.ts +81 -2
- package/src/connection.ts +3 -1
- package/src/events.ts +2 -0
- package/src/types.ts +62 -52
package/dist/browser.js
CHANGED
|
@@ -734,6 +734,7 @@ var EVENT_MAP = {
|
|
|
734
734
|
'channel.created': true,
|
|
735
735
|
'channel.deleted': true,
|
|
736
736
|
'channel.hidden': true,
|
|
737
|
+
'channel.kicked': true,
|
|
737
738
|
'channel.muted': true,
|
|
738
739
|
'channel.truncated': true,
|
|
739
740
|
'channel.unmuted': true,
|
|
@@ -772,7 +773,8 @@ var EVENT_MAP = {
|
|
|
772
773
|
'user.watching.stop': true,
|
|
773
774
|
// local events
|
|
774
775
|
'connection.changed': true,
|
|
775
|
-
'connection.recovered': true
|
|
776
|
+
'connection.recovered': true,
|
|
777
|
+
'transport.changed': true
|
|
776
778
|
};
|
|
777
779
|
|
|
778
780
|
var IS_VALID_EVENT_MAP_TYPE = _objectSpread$6(_objectSpread$6({}, EVENT_MAP), {}, {
|
|
@@ -1697,6 +1699,8 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1697
1699
|
/**
|
|
1698
1700
|
* delete - Delete the channel. Messages are permanently removed.
|
|
1699
1701
|
*
|
|
1702
|
+
* @param {boolean} [options.hard_delete] Defines if the channel is hard deleted or not
|
|
1703
|
+
*
|
|
1700
1704
|
* @return {Promise<DeleteChannelAPIResponse<ChannelType, CommandType, UserType>>} The server response
|
|
1701
1705
|
*/
|
|
1702
1706
|
|
|
@@ -1704,17 +1708,20 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1704
1708
|
key: "delete",
|
|
1705
1709
|
value: function () {
|
|
1706
1710
|
var _delete2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee11() {
|
|
1711
|
+
var options,
|
|
1712
|
+
_args11 = arguments;
|
|
1707
1713
|
return _regeneratorRuntime__default['default'].wrap(function _callee11$(_context11) {
|
|
1708
1714
|
while (1) {
|
|
1709
1715
|
switch (_context11.prev = _context11.next) {
|
|
1710
1716
|
case 0:
|
|
1711
|
-
|
|
1712
|
-
|
|
1717
|
+
options = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : {};
|
|
1718
|
+
_context11.next = 3;
|
|
1719
|
+
return this.getClient().delete(this._channelURL(), _objectSpread$5({}, options));
|
|
1713
1720
|
|
|
1714
|
-
case
|
|
1721
|
+
case 3:
|
|
1715
1722
|
return _context11.abrupt("return", _context11.sent);
|
|
1716
1723
|
|
|
1717
|
-
case
|
|
1724
|
+
case 4:
|
|
1718
1725
|
case "end":
|
|
1719
1726
|
return _context11.stop();
|
|
1720
1727
|
}
|
|
@@ -3212,7 +3219,8 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3212
3219
|
channelState.read[event.user.id] = {
|
|
3213
3220
|
// because in client.ts the handleEvent call that flows to this sets this `event.received_at = new Date();`
|
|
3214
3221
|
last_read: event.received_at,
|
|
3215
|
-
user: event.user
|
|
3222
|
+
user: event.user,
|
|
3223
|
+
unread_messages: 0
|
|
3216
3224
|
};
|
|
3217
3225
|
|
|
3218
3226
|
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)) {
|
|
@@ -3269,7 +3277,8 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3269
3277
|
channelState.unreadCount = 0;
|
|
3270
3278
|
channelState.read[event.user.id] = {
|
|
3271
3279
|
last_read: new Date(event.created_at),
|
|
3272
|
-
user: event.user
|
|
3280
|
+
user: event.user,
|
|
3281
|
+
unread_messages: 0
|
|
3273
3282
|
};
|
|
3274
3283
|
} else if (this._countMessageAsUnread(event.message)) {
|
|
3275
3284
|
channelState.unreadCount = channelState.unreadCount + 1;
|
|
@@ -3293,7 +3302,16 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3293
3302
|
|
|
3294
3303
|
case 'channel.truncated':
|
|
3295
3304
|
channelState.clearMessages();
|
|
3296
|
-
channelState.unreadCount = 0;
|
|
3305
|
+
channelState.unreadCount = 0; // system messages don't increment unread counts
|
|
3306
|
+
|
|
3307
|
+
if (event.message) {
|
|
3308
|
+
channelState.addMessageSorted(event.message);
|
|
3309
|
+
|
|
3310
|
+
if (event.message.pinned) {
|
|
3311
|
+
channelState.addPinnedMessage(event.message);
|
|
3312
|
+
}
|
|
3313
|
+
}
|
|
3314
|
+
|
|
3297
3315
|
break;
|
|
3298
3316
|
|
|
3299
3317
|
case 'member.added':
|
|
@@ -3439,7 +3457,8 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3439
3457
|
if (user) {
|
|
3440
3458
|
this.state.read[user.id] = {
|
|
3441
3459
|
user: user,
|
|
3442
|
-
last_read: last_read
|
|
3460
|
+
last_read: last_read,
|
|
3461
|
+
unread_messages: 0
|
|
3443
3462
|
};
|
|
3444
3463
|
}
|
|
3445
3464
|
} // apply read state if part of the state
|
|
@@ -3451,16 +3470,17 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3451
3470
|
|
|
3452
3471
|
try {
|
|
3453
3472
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
3454
|
-
var
|
|
3473
|
+
var _read$unread_messages;
|
|
3455
3474
|
|
|
3456
|
-
var
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3475
|
+
var read = _step3.value;
|
|
3476
|
+
this.state.read[read.user.id] = {
|
|
3477
|
+
last_read: new Date(read.last_read),
|
|
3478
|
+
unread_messages: (_read$unread_messages = read.unread_messages) !== null && _read$unread_messages !== void 0 ? _read$unread_messages : 0,
|
|
3479
|
+
user: read.user
|
|
3480
|
+
};
|
|
3461
3481
|
|
|
3462
|
-
if (read.user.id === (user === null || user === void 0 ? void 0 : user.id)
|
|
3463
|
-
this.state.unreadCount =
|
|
3482
|
+
if (read.user.id === (user === null || user === void 0 ? void 0 : user.id)) {
|
|
3483
|
+
this.state.unreadCount = this.state.read[read.user.id].unread_messages;
|
|
3464
3484
|
}
|
|
3465
3485
|
}
|
|
3466
3486
|
} catch (err) {
|
|
@@ -3812,6 +3832,12 @@ var StableWSConnection = /*#__PURE__*/function () {
|
|
|
3812
3832
|
|
|
3813
3833
|
_defineProperty__default['default'](this, "onmessage", function (wsID, event) {
|
|
3814
3834
|
if (_this.wsID !== wsID) return;
|
|
3835
|
+
|
|
3836
|
+
_this._log('onmessage() - onmessage callback', {
|
|
3837
|
+
event: event,
|
|
3838
|
+
wsID: wsID
|
|
3839
|
+
});
|
|
3840
|
+
|
|
3815
3841
|
var data = typeof event.data === 'string' ? JSON.parse(event.data) : null; // we wait till the first message before we consider the connection open..
|
|
3816
3842
|
// the reason for this is that auth errors and similar errors trigger a ws.onopen and immediately
|
|
3817
3843
|
// after that a ws.onclose..
|
|
@@ -3836,11 +3862,6 @@ var StableWSConnection = /*#__PURE__*/function () {
|
|
|
3836
3862
|
|
|
3837
3863
|
_this.lastEvent = new Date();
|
|
3838
3864
|
|
|
3839
|
-
_this._log('onmessage() - onmessage callback', {
|
|
3840
|
-
event: event,
|
|
3841
|
-
wsID: wsID
|
|
3842
|
-
});
|
|
3843
|
-
|
|
3844
3865
|
if (data && data.type === 'health.check') {
|
|
3845
3866
|
_this.scheduleNextPing();
|
|
3846
3867
|
}
|
|
@@ -4370,27 +4391,36 @@ var StableWSConnection = /*#__PURE__*/function () {
|
|
|
4370
4391
|
this.requestID = randomId();
|
|
4371
4392
|
this.client.insightMetrics.connectionStartTimestamp = new Date().getTime();
|
|
4372
4393
|
_context5.prev = 5;
|
|
4373
|
-
|
|
4394
|
+
|
|
4395
|
+
this._log("_connect() - waiting for token");
|
|
4396
|
+
|
|
4397
|
+
_context5.next = 9;
|
|
4374
4398
|
return this.client.tokenManager.tokenReady();
|
|
4375
4399
|
|
|
4376
|
-
case
|
|
4400
|
+
case 9:
|
|
4377
4401
|
this._setupConnectionPromise();
|
|
4378
4402
|
|
|
4379
4403
|
wsURL = this._buildUrl();
|
|
4404
|
+
|
|
4405
|
+
this._log("_connect() - Connecting to ".concat(wsURL), {
|
|
4406
|
+
wsURL: wsURL,
|
|
4407
|
+
requestID: this.requestID
|
|
4408
|
+
});
|
|
4409
|
+
|
|
4380
4410
|
this.ws = new WebSocket__default['default'](wsURL);
|
|
4381
4411
|
this.ws.onopen = this.onopen.bind(this, this.wsID);
|
|
4382
4412
|
this.ws.onclose = this.onclose.bind(this, this.wsID);
|
|
4383
4413
|
this.ws.onerror = this.onerror.bind(this, this.wsID);
|
|
4384
4414
|
this.ws.onmessage = this.onmessage.bind(this, this.wsID);
|
|
4385
|
-
_context5.next =
|
|
4415
|
+
_context5.next = 19;
|
|
4386
4416
|
return this.connectionOpen;
|
|
4387
4417
|
|
|
4388
|
-
case
|
|
4418
|
+
case 19:
|
|
4389
4419
|
response = _context5.sent;
|
|
4390
4420
|
this.isConnecting = false;
|
|
4391
4421
|
|
|
4392
4422
|
if (!response) {
|
|
4393
|
-
_context5.next =
|
|
4423
|
+
_context5.next = 25;
|
|
4394
4424
|
break;
|
|
4395
4425
|
}
|
|
4396
4426
|
|
|
@@ -4403,12 +4433,12 @@ var StableWSConnection = /*#__PURE__*/function () {
|
|
|
4403
4433
|
|
|
4404
4434
|
return _context5.abrupt("return", response);
|
|
4405
4435
|
|
|
4406
|
-
case
|
|
4407
|
-
_context5.next =
|
|
4436
|
+
case 25:
|
|
4437
|
+
_context5.next = 32;
|
|
4408
4438
|
break;
|
|
4409
4439
|
|
|
4410
|
-
case
|
|
4411
|
-
_context5.prev =
|
|
4440
|
+
case 27:
|
|
4441
|
+
_context5.prev = 27;
|
|
4412
4442
|
_context5.t0 = _context5["catch"](5);
|
|
4413
4443
|
this.isConnecting = false;
|
|
4414
4444
|
|
|
@@ -4421,12 +4451,12 @@ var StableWSConnection = /*#__PURE__*/function () {
|
|
|
4421
4451
|
|
|
4422
4452
|
throw _context5.t0;
|
|
4423
4453
|
|
|
4424
|
-
case
|
|
4454
|
+
case 32:
|
|
4425
4455
|
case "end":
|
|
4426
4456
|
return _context5.stop();
|
|
4427
4457
|
}
|
|
4428
4458
|
}
|
|
4429
|
-
}, _callee5, this, [[5,
|
|
4459
|
+
}, _callee5, this, [[5, 27]]);
|
|
4430
4460
|
}));
|
|
4431
4461
|
|
|
4432
4462
|
function _connect() {
|
|
@@ -6576,7 +6606,6 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6576
6606
|
apnTemplate: '{}', //if app doesn't have apn configured it will error
|
|
6577
6607
|
firebaseTemplate: '{}', //if app doesn't have firebase configured it will error
|
|
6578
6608
|
firebaseDataTemplate: '{}', //if app doesn't have firebase configured it will error
|
|
6579
|
-
huaweiDataTemplate: '{}' //if app doesn't have huawei configured it will error
|
|
6580
6609
|
skipDevices: true, // skip config/device checks and sending to real devices
|
|
6581
6610
|
}
|
|
6582
6611
|
*/
|
|
@@ -6593,7 +6622,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6593
6622
|
case 0:
|
|
6594
6623
|
data = _args12.length > 1 && _args12[1] !== undefined ? _args12[1] : {};
|
|
6595
6624
|
_context12.next = 3;
|
|
6596
|
-
return this.post(this.baseURL + '/check_push', _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(
|
|
6625
|
+
return this.post(this.baseURL + '/check_push', _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
6597
6626
|
user_id: userID
|
|
6598
6627
|
}, data.messageID ? {
|
|
6599
6628
|
message_id: data.messageID
|
|
@@ -6603,8 +6632,6 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6603
6632
|
firebase_template: data.firebaseTemplate
|
|
6604
6633
|
} : {}), data.firebaseDataTemplate ? {
|
|
6605
6634
|
firebase_data_template: data.firebaseDataTemplate
|
|
6606
|
-
} : {}), data.huaweiDataTemplate ? {
|
|
6607
|
-
huawei_data_template: data.huaweiDataTemplate
|
|
6608
6635
|
} : {}), data.skipDevices ? {
|
|
6609
6636
|
skip_devices: true
|
|
6610
6637
|
} : {}));
|
|
@@ -8549,6 +8576,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8549
8576
|
* It is present for internal usage only.
|
|
8550
8577
|
* This function can, and will, break and/or be removed at any point in time.
|
|
8551
8578
|
*
|
|
8579
|
+
* @private
|
|
8552
8580
|
* @param {FlagReportsFilters} filterConditions MongoDB style filter conditions
|
|
8553
8581
|
* @param {FlagReportsPaginationOptions} options Option object, {limit: 10, offset:0}
|
|
8554
8582
|
*
|
|
@@ -8597,6 +8625,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8597
8625
|
* It is present for internal usage only.
|
|
8598
8626
|
* This function can, and will, break and/or be removed at any point in time.
|
|
8599
8627
|
*
|
|
8628
|
+
* @private
|
|
8600
8629
|
* @param {string} [id] flag report to review
|
|
8601
8630
|
* @param {string} [reviewResult] flag report review result
|
|
8602
8631
|
* @param {string} [options.user_id] currentUserID, only used with serverside auth
|
|
@@ -8637,6 +8666,52 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8637
8666
|
|
|
8638
8667
|
return _reviewFlagReport;
|
|
8639
8668
|
}()
|
|
8669
|
+
/**
|
|
8670
|
+
* _unblockMessage - unblocks message blocked by automod
|
|
8671
|
+
*
|
|
8672
|
+
* Note: Do not use this.
|
|
8673
|
+
* It is present for internal usage only.
|
|
8674
|
+
* This function can, and will, break and/or be removed at any point in time.
|
|
8675
|
+
*
|
|
8676
|
+
* @private
|
|
8677
|
+
* @param {string} targetMessageID
|
|
8678
|
+
* @param {string} [options.user_id] currentUserID, only used with serverside auth
|
|
8679
|
+
* @returns {Promise<APIResponse>}
|
|
8680
|
+
*/
|
|
8681
|
+
|
|
8682
|
+
}, {
|
|
8683
|
+
key: "_unblockMessage",
|
|
8684
|
+
value: function () {
|
|
8685
|
+
var _unblockMessage2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee44(targetMessageID) {
|
|
8686
|
+
var options,
|
|
8687
|
+
_args44 = arguments;
|
|
8688
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee44$(_context44) {
|
|
8689
|
+
while (1) {
|
|
8690
|
+
switch (_context44.prev = _context44.next) {
|
|
8691
|
+
case 0:
|
|
8692
|
+
options = _args44.length > 1 && _args44[1] !== undefined ? _args44[1] : {};
|
|
8693
|
+
_context44.next = 3;
|
|
8694
|
+
return this.post(this.baseURL + '/moderation/unblock_message', _objectSpread({
|
|
8695
|
+
target_message_id: targetMessageID
|
|
8696
|
+
}, options));
|
|
8697
|
+
|
|
8698
|
+
case 3:
|
|
8699
|
+
return _context44.abrupt("return", _context44.sent);
|
|
8700
|
+
|
|
8701
|
+
case 4:
|
|
8702
|
+
case "end":
|
|
8703
|
+
return _context44.stop();
|
|
8704
|
+
}
|
|
8705
|
+
}
|
|
8706
|
+
}, _callee44, this);
|
|
8707
|
+
}));
|
|
8708
|
+
|
|
8709
|
+
function _unblockMessage(_x56) {
|
|
8710
|
+
return _unblockMessage2.apply(this, arguments);
|
|
8711
|
+
}
|
|
8712
|
+
|
|
8713
|
+
return _unblockMessage;
|
|
8714
|
+
}()
|
|
8640
8715
|
/**
|
|
8641
8716
|
* @deprecated use markChannelsRead instead
|
|
8642
8717
|
*
|
|
@@ -8658,23 +8733,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8658
8733
|
* @return {Promise<APIResponse>}
|
|
8659
8734
|
*/
|
|
8660
8735
|
function () {
|
|
8661
|
-
var _markChannelsRead = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
8736
|
+
var _markChannelsRead = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee45() {
|
|
8662
8737
|
var data,
|
|
8663
|
-
|
|
8664
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
8738
|
+
_args45 = arguments;
|
|
8739
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee45$(_context45) {
|
|
8665
8740
|
while (1) {
|
|
8666
|
-
switch (
|
|
8741
|
+
switch (_context45.prev = _context45.next) {
|
|
8667
8742
|
case 0:
|
|
8668
|
-
data =
|
|
8669
|
-
|
|
8743
|
+
data = _args45.length > 0 && _args45[0] !== undefined ? _args45[0] : {};
|
|
8744
|
+
_context45.next = 3;
|
|
8670
8745
|
return this.post(this.baseURL + '/channels/read', _objectSpread({}, data));
|
|
8671
8746
|
|
|
8672
8747
|
case 3:
|
|
8673
8748
|
case "end":
|
|
8674
|
-
return
|
|
8749
|
+
return _context45.stop();
|
|
8675
8750
|
}
|
|
8676
8751
|
}
|
|
8677
|
-
},
|
|
8752
|
+
}, _callee45, this);
|
|
8678
8753
|
}));
|
|
8679
8754
|
|
|
8680
8755
|
function markChannelsRead() {
|
|
@@ -8749,28 +8824,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8749
8824
|
}, {
|
|
8750
8825
|
key: "translateMessage",
|
|
8751
8826
|
value: function () {
|
|
8752
|
-
var _translateMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
8753
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
8827
|
+
var _translateMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee46(messageId, language) {
|
|
8828
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee46$(_context46) {
|
|
8754
8829
|
while (1) {
|
|
8755
|
-
switch (
|
|
8830
|
+
switch (_context46.prev = _context46.next) {
|
|
8756
8831
|
case 0:
|
|
8757
|
-
|
|
8832
|
+
_context46.next = 2;
|
|
8758
8833
|
return this.post(this.baseURL + "/messages/".concat(messageId, "/translate"), {
|
|
8759
8834
|
language: language
|
|
8760
8835
|
});
|
|
8761
8836
|
|
|
8762
8837
|
case 2:
|
|
8763
|
-
return
|
|
8838
|
+
return _context46.abrupt("return", _context46.sent);
|
|
8764
8839
|
|
|
8765
8840
|
case 3:
|
|
8766
8841
|
case "end":
|
|
8767
|
-
return
|
|
8842
|
+
return _context46.stop();
|
|
8768
8843
|
}
|
|
8769
8844
|
}
|
|
8770
|
-
},
|
|
8845
|
+
}, _callee46, this);
|
|
8771
8846
|
}));
|
|
8772
8847
|
|
|
8773
|
-
function translateMessage(
|
|
8848
|
+
function translateMessage(_x57, _x58) {
|
|
8774
8849
|
return _translateMessage.apply(this, arguments);
|
|
8775
8850
|
}
|
|
8776
8851
|
|
|
@@ -8872,14 +8947,14 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8872
8947
|
}, {
|
|
8873
8948
|
key: "updateMessage",
|
|
8874
8949
|
value: function () {
|
|
8875
|
-
var _updateMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
8950
|
+
var _updateMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee47(message, userId, options) {
|
|
8876
8951
|
var clonedMessage, reservedMessageFields;
|
|
8877
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
8952
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee47$(_context47) {
|
|
8878
8953
|
while (1) {
|
|
8879
|
-
switch (
|
|
8954
|
+
switch (_context47.prev = _context47.next) {
|
|
8880
8955
|
case 0:
|
|
8881
8956
|
if (message.id) {
|
|
8882
|
-
|
|
8957
|
+
_context47.next = 2;
|
|
8883
8958
|
break;
|
|
8884
8959
|
}
|
|
8885
8960
|
|
|
@@ -8916,23 +8991,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8916
8991
|
});
|
|
8917
8992
|
}
|
|
8918
8993
|
|
|
8919
|
-
|
|
8994
|
+
_context47.next = 10;
|
|
8920
8995
|
return this.post(this.baseURL + "/messages/".concat(message.id), _objectSpread({
|
|
8921
8996
|
message: clonedMessage
|
|
8922
8997
|
}, options));
|
|
8923
8998
|
|
|
8924
8999
|
case 10:
|
|
8925
|
-
return
|
|
9000
|
+
return _context47.abrupt("return", _context47.sent);
|
|
8926
9001
|
|
|
8927
9002
|
case 11:
|
|
8928
9003
|
case "end":
|
|
8929
|
-
return
|
|
9004
|
+
return _context47.stop();
|
|
8930
9005
|
}
|
|
8931
9006
|
}
|
|
8932
|
-
},
|
|
9007
|
+
}, _callee47, this);
|
|
8933
9008
|
}));
|
|
8934
9009
|
|
|
8935
|
-
function updateMessage(
|
|
9010
|
+
function updateMessage(_x59, _x60, _x61) {
|
|
8936
9011
|
return _updateMessage.apply(this, arguments);
|
|
8937
9012
|
}
|
|
8938
9013
|
|
|
@@ -8955,14 +9030,14 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8955
9030
|
}, {
|
|
8956
9031
|
key: "partialUpdateMessage",
|
|
8957
9032
|
value: function () {
|
|
8958
|
-
var _partialUpdateMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9033
|
+
var _partialUpdateMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee48(id, partialMessageObject, userId, options) {
|
|
8959
9034
|
var user;
|
|
8960
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9035
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee48$(_context48) {
|
|
8961
9036
|
while (1) {
|
|
8962
|
-
switch (
|
|
9037
|
+
switch (_context48.prev = _context48.next) {
|
|
8963
9038
|
case 0:
|
|
8964
9039
|
if (id) {
|
|
8965
|
-
|
|
9040
|
+
_context48.next = 2;
|
|
8966
9041
|
break;
|
|
8967
9042
|
}
|
|
8968
9043
|
|
|
@@ -8977,23 +9052,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8977
9052
|
};
|
|
8978
9053
|
}
|
|
8979
9054
|
|
|
8980
|
-
|
|
9055
|
+
_context48.next = 6;
|
|
8981
9056
|
return this.put(this.baseURL + "/messages/".concat(id), _objectSpread(_objectSpread(_objectSpread({}, partialMessageObject), options), {}, {
|
|
8982
9057
|
user: user
|
|
8983
9058
|
}));
|
|
8984
9059
|
|
|
8985
9060
|
case 6:
|
|
8986
|
-
return
|
|
9061
|
+
return _context48.abrupt("return", _context48.sent);
|
|
8987
9062
|
|
|
8988
9063
|
case 7:
|
|
8989
9064
|
case "end":
|
|
8990
|
-
return
|
|
9065
|
+
return _context48.stop();
|
|
8991
9066
|
}
|
|
8992
9067
|
}
|
|
8993
|
-
},
|
|
9068
|
+
}, _callee48, this);
|
|
8994
9069
|
}));
|
|
8995
9070
|
|
|
8996
|
-
function partialUpdateMessage(
|
|
9071
|
+
function partialUpdateMessage(_x62, _x63, _x64, _x65) {
|
|
8997
9072
|
return _partialUpdateMessage.apply(this, arguments);
|
|
8998
9073
|
}
|
|
8999
9074
|
|
|
@@ -9002,11 +9077,11 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9002
9077
|
}, {
|
|
9003
9078
|
key: "deleteMessage",
|
|
9004
9079
|
value: function () {
|
|
9005
|
-
var _deleteMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9080
|
+
var _deleteMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee49(messageID, hardDelete) {
|
|
9006
9081
|
var params;
|
|
9007
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9082
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee49$(_context49) {
|
|
9008
9083
|
while (1) {
|
|
9009
|
-
switch (
|
|
9084
|
+
switch (_context49.prev = _context49.next) {
|
|
9010
9085
|
case 0:
|
|
9011
9086
|
params = {};
|
|
9012
9087
|
|
|
@@ -9016,21 +9091,21 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9016
9091
|
};
|
|
9017
9092
|
}
|
|
9018
9093
|
|
|
9019
|
-
|
|
9094
|
+
_context49.next = 4;
|
|
9020
9095
|
return this.delete(this.baseURL + "/messages/".concat(messageID), params);
|
|
9021
9096
|
|
|
9022
9097
|
case 4:
|
|
9023
|
-
return
|
|
9098
|
+
return _context49.abrupt("return", _context49.sent);
|
|
9024
9099
|
|
|
9025
9100
|
case 5:
|
|
9026
9101
|
case "end":
|
|
9027
|
-
return
|
|
9102
|
+
return _context49.stop();
|
|
9028
9103
|
}
|
|
9029
9104
|
}
|
|
9030
|
-
},
|
|
9105
|
+
}, _callee49, this);
|
|
9031
9106
|
}));
|
|
9032
9107
|
|
|
9033
|
-
function deleteMessage(
|
|
9108
|
+
function deleteMessage(_x66, _x67) {
|
|
9034
9109
|
return _deleteMessage.apply(this, arguments);
|
|
9035
9110
|
}
|
|
9036
9111
|
|
|
@@ -9039,26 +9114,26 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9039
9114
|
}, {
|
|
9040
9115
|
key: "getMessage",
|
|
9041
9116
|
value: function () {
|
|
9042
|
-
var _getMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9043
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9117
|
+
var _getMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee50(messageID) {
|
|
9118
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee50$(_context50) {
|
|
9044
9119
|
while (1) {
|
|
9045
|
-
switch (
|
|
9120
|
+
switch (_context50.prev = _context50.next) {
|
|
9046
9121
|
case 0:
|
|
9047
|
-
|
|
9122
|
+
_context50.next = 2;
|
|
9048
9123
|
return this.get(this.baseURL + "/messages/".concat(messageID));
|
|
9049
9124
|
|
|
9050
9125
|
case 2:
|
|
9051
|
-
return
|
|
9126
|
+
return _context50.abrupt("return", _context50.sent);
|
|
9052
9127
|
|
|
9053
9128
|
case 3:
|
|
9054
9129
|
case "end":
|
|
9055
|
-
return
|
|
9130
|
+
return _context50.stop();
|
|
9056
9131
|
}
|
|
9057
9132
|
}
|
|
9058
|
-
},
|
|
9133
|
+
}, _callee50, this);
|
|
9059
9134
|
}));
|
|
9060
9135
|
|
|
9061
|
-
function getMessage(
|
|
9136
|
+
function getMessage(_x68) {
|
|
9062
9137
|
return _getMessage.apply(this, arguments);
|
|
9063
9138
|
}
|
|
9064
9139
|
|
|
@@ -9067,7 +9142,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9067
9142
|
}, {
|
|
9068
9143
|
key: "getUserAgent",
|
|
9069
9144
|
value: function getUserAgent() {
|
|
9070
|
-
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "5.
|
|
9145
|
+
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "5.5.0");
|
|
9071
9146
|
}
|
|
9072
9147
|
}, {
|
|
9073
9148
|
key: "setUserAgent",
|
|
@@ -9262,28 +9337,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9262
9337
|
}, {
|
|
9263
9338
|
key: "sendUserCustomEvent",
|
|
9264
9339
|
value: function () {
|
|
9265
|
-
var _sendUserCustomEvent = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9266
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9340
|
+
var _sendUserCustomEvent = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee51(targetUserID, event) {
|
|
9341
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee51$(_context51) {
|
|
9267
9342
|
while (1) {
|
|
9268
|
-
switch (
|
|
9343
|
+
switch (_context51.prev = _context51.next) {
|
|
9269
9344
|
case 0:
|
|
9270
|
-
|
|
9345
|
+
_context51.next = 2;
|
|
9271
9346
|
return this.post("".concat(this.baseURL, "/users/").concat(targetUserID, "/event"), {
|
|
9272
9347
|
event: event
|
|
9273
9348
|
});
|
|
9274
9349
|
|
|
9275
9350
|
case 2:
|
|
9276
|
-
return
|
|
9351
|
+
return _context51.abrupt("return", _context51.sent);
|
|
9277
9352
|
|
|
9278
9353
|
case 3:
|
|
9279
9354
|
case "end":
|
|
9280
|
-
return
|
|
9355
|
+
return _context51.stop();
|
|
9281
9356
|
}
|
|
9282
9357
|
}
|
|
9283
|
-
},
|
|
9358
|
+
}, _callee51, this);
|
|
9284
9359
|
}));
|
|
9285
9360
|
|
|
9286
|
-
function sendUserCustomEvent(
|
|
9361
|
+
function sendUserCustomEvent(_x69, _x70) {
|
|
9287
9362
|
return _sendUserCustomEvent.apply(this, arguments);
|
|
9288
9363
|
}
|
|
9289
9364
|
|
|
@@ -9325,6 +9400,11 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9325
9400
|
|
|
9326
9401
|
return this.post("".concat(this.baseURL, "/export_channels"), payload);
|
|
9327
9402
|
}
|
|
9403
|
+
}, {
|
|
9404
|
+
key: "exportUsers",
|
|
9405
|
+
value: function exportUsers(request) {
|
|
9406
|
+
return this.post("".concat(this.baseURL, "/export/users"), request);
|
|
9407
|
+
}
|
|
9328
9408
|
}, {
|
|
9329
9409
|
key: "exportChannel",
|
|
9330
9410
|
value: function exportChannel(request, options) {
|
|
@@ -9346,32 +9426,32 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9346
9426
|
}, {
|
|
9347
9427
|
key: "createSegment",
|
|
9348
9428
|
value: function () {
|
|
9349
|
-
var _createSegment = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9429
|
+
var _createSegment = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee52(params) {
|
|
9350
9430
|
var _yield$this$post, segment;
|
|
9351
9431
|
|
|
9352
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9432
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee52$(_context52) {
|
|
9353
9433
|
while (1) {
|
|
9354
|
-
switch (
|
|
9434
|
+
switch (_context52.prev = _context52.next) {
|
|
9355
9435
|
case 0:
|
|
9356
|
-
|
|
9436
|
+
_context52.next = 2;
|
|
9357
9437
|
return this.post(this.baseURL + "/segments", {
|
|
9358
9438
|
segment: params
|
|
9359
9439
|
});
|
|
9360
9440
|
|
|
9361
9441
|
case 2:
|
|
9362
|
-
_yield$this$post =
|
|
9442
|
+
_yield$this$post = _context52.sent;
|
|
9363
9443
|
segment = _yield$this$post.segment;
|
|
9364
|
-
return
|
|
9444
|
+
return _context52.abrupt("return", segment);
|
|
9365
9445
|
|
|
9366
9446
|
case 5:
|
|
9367
9447
|
case "end":
|
|
9368
|
-
return
|
|
9448
|
+
return _context52.stop();
|
|
9369
9449
|
}
|
|
9370
9450
|
}
|
|
9371
|
-
},
|
|
9451
|
+
}, _callee52, this);
|
|
9372
9452
|
}));
|
|
9373
9453
|
|
|
9374
|
-
function createSegment(
|
|
9454
|
+
function createSegment(_x71) {
|
|
9375
9455
|
return _createSegment.apply(this, arguments);
|
|
9376
9456
|
}
|
|
9377
9457
|
|
|
@@ -9388,30 +9468,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9388
9468
|
}, {
|
|
9389
9469
|
key: "getSegment",
|
|
9390
9470
|
value: function () {
|
|
9391
|
-
var _getSegment = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9471
|
+
var _getSegment = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee53(id) {
|
|
9392
9472
|
var _yield$this$get, segment;
|
|
9393
9473
|
|
|
9394
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9474
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee53$(_context53) {
|
|
9395
9475
|
while (1) {
|
|
9396
|
-
switch (
|
|
9476
|
+
switch (_context53.prev = _context53.next) {
|
|
9397
9477
|
case 0:
|
|
9398
|
-
|
|
9478
|
+
_context53.next = 2;
|
|
9399
9479
|
return this.get(this.baseURL + "/segments/".concat(id));
|
|
9400
9480
|
|
|
9401
9481
|
case 2:
|
|
9402
|
-
_yield$this$get =
|
|
9482
|
+
_yield$this$get = _context53.sent;
|
|
9403
9483
|
segment = _yield$this$get.segment;
|
|
9404
|
-
return
|
|
9484
|
+
return _context53.abrupt("return", segment);
|
|
9405
9485
|
|
|
9406
9486
|
case 5:
|
|
9407
9487
|
case "end":
|
|
9408
|
-
return
|
|
9488
|
+
return _context53.stop();
|
|
9409
9489
|
}
|
|
9410
9490
|
}
|
|
9411
|
-
},
|
|
9491
|
+
}, _callee53, this);
|
|
9412
9492
|
}));
|
|
9413
9493
|
|
|
9414
|
-
function getSegment(
|
|
9494
|
+
function getSegment(_x72) {
|
|
9415
9495
|
return _getSegment.apply(this, arguments);
|
|
9416
9496
|
}
|
|
9417
9497
|
|
|
@@ -9427,30 +9507,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9427
9507
|
}, {
|
|
9428
9508
|
key: "listSegments",
|
|
9429
9509
|
value: function () {
|
|
9430
|
-
var _listSegments = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9510
|
+
var _listSegments = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee54(options) {
|
|
9431
9511
|
var _yield$this$get2, segments;
|
|
9432
9512
|
|
|
9433
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9513
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee54$(_context54) {
|
|
9434
9514
|
while (1) {
|
|
9435
|
-
switch (
|
|
9515
|
+
switch (_context54.prev = _context54.next) {
|
|
9436
9516
|
case 0:
|
|
9437
|
-
|
|
9517
|
+
_context54.next = 2;
|
|
9438
9518
|
return this.get(this.baseURL + "/segments", options);
|
|
9439
9519
|
|
|
9440
9520
|
case 2:
|
|
9441
|
-
_yield$this$get2 =
|
|
9521
|
+
_yield$this$get2 = _context54.sent;
|
|
9442
9522
|
segments = _yield$this$get2.segments;
|
|
9443
|
-
return
|
|
9523
|
+
return _context54.abrupt("return", segments);
|
|
9444
9524
|
|
|
9445
9525
|
case 5:
|
|
9446
9526
|
case "end":
|
|
9447
|
-
return
|
|
9527
|
+
return _context54.stop();
|
|
9448
9528
|
}
|
|
9449
9529
|
}
|
|
9450
|
-
},
|
|
9530
|
+
}, _callee54, this);
|
|
9451
9531
|
}));
|
|
9452
9532
|
|
|
9453
|
-
function listSegments(
|
|
9533
|
+
function listSegments(_x73) {
|
|
9454
9534
|
return _listSegments.apply(this, arguments);
|
|
9455
9535
|
}
|
|
9456
9536
|
|
|
@@ -9468,32 +9548,32 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9468
9548
|
}, {
|
|
9469
9549
|
key: "updateSegment",
|
|
9470
9550
|
value: function () {
|
|
9471
|
-
var _updateSegment = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9551
|
+
var _updateSegment = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee55(id, params) {
|
|
9472
9552
|
var _yield$this$put, segment;
|
|
9473
9553
|
|
|
9474
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9554
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee55$(_context55) {
|
|
9475
9555
|
while (1) {
|
|
9476
|
-
switch (
|
|
9556
|
+
switch (_context55.prev = _context55.next) {
|
|
9477
9557
|
case 0:
|
|
9478
|
-
|
|
9558
|
+
_context55.next = 2;
|
|
9479
9559
|
return this.put(this.baseURL + "/segments/".concat(id), {
|
|
9480
9560
|
segment: params
|
|
9481
9561
|
});
|
|
9482
9562
|
|
|
9483
9563
|
case 2:
|
|
9484
|
-
_yield$this$put =
|
|
9564
|
+
_yield$this$put = _context55.sent;
|
|
9485
9565
|
segment = _yield$this$put.segment;
|
|
9486
|
-
return
|
|
9566
|
+
return _context55.abrupt("return", segment);
|
|
9487
9567
|
|
|
9488
9568
|
case 5:
|
|
9489
9569
|
case "end":
|
|
9490
|
-
return
|
|
9570
|
+
return _context55.stop();
|
|
9491
9571
|
}
|
|
9492
9572
|
}
|
|
9493
|
-
},
|
|
9573
|
+
}, _callee55, this);
|
|
9494
9574
|
}));
|
|
9495
9575
|
|
|
9496
|
-
function updateSegment(
|
|
9576
|
+
function updateSegment(_x74, _x75) {
|
|
9497
9577
|
return _updateSegment.apply(this, arguments);
|
|
9498
9578
|
}
|
|
9499
9579
|
|
|
@@ -9510,22 +9590,22 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9510
9590
|
}, {
|
|
9511
9591
|
key: "deleteSegment",
|
|
9512
9592
|
value: function () {
|
|
9513
|
-
var _deleteSegment = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9514
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9593
|
+
var _deleteSegment = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee56(id) {
|
|
9594
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee56$(_context56) {
|
|
9515
9595
|
while (1) {
|
|
9516
|
-
switch (
|
|
9596
|
+
switch (_context56.prev = _context56.next) {
|
|
9517
9597
|
case 0:
|
|
9518
|
-
return
|
|
9598
|
+
return _context56.abrupt("return", this.delete(this.baseURL + "/segments/".concat(id)));
|
|
9519
9599
|
|
|
9520
9600
|
case 1:
|
|
9521
9601
|
case "end":
|
|
9522
|
-
return
|
|
9602
|
+
return _context56.stop();
|
|
9523
9603
|
}
|
|
9524
9604
|
}
|
|
9525
|
-
},
|
|
9605
|
+
}, _callee56, this);
|
|
9526
9606
|
}));
|
|
9527
9607
|
|
|
9528
|
-
function deleteSegment(
|
|
9608
|
+
function deleteSegment(_x76) {
|
|
9529
9609
|
return _deleteSegment.apply(this, arguments);
|
|
9530
9610
|
}
|
|
9531
9611
|
|
|
@@ -9542,32 +9622,32 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9542
9622
|
}, {
|
|
9543
9623
|
key: "createCampaign",
|
|
9544
9624
|
value: function () {
|
|
9545
|
-
var _createCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9625
|
+
var _createCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee57(params) {
|
|
9546
9626
|
var _yield$this$post2, campaign;
|
|
9547
9627
|
|
|
9548
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9628
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee57$(_context57) {
|
|
9549
9629
|
while (1) {
|
|
9550
|
-
switch (
|
|
9630
|
+
switch (_context57.prev = _context57.next) {
|
|
9551
9631
|
case 0:
|
|
9552
|
-
|
|
9632
|
+
_context57.next = 2;
|
|
9553
9633
|
return this.post(this.baseURL + "/campaigns", {
|
|
9554
9634
|
campaign: params
|
|
9555
9635
|
});
|
|
9556
9636
|
|
|
9557
9637
|
case 2:
|
|
9558
|
-
_yield$this$post2 =
|
|
9638
|
+
_yield$this$post2 = _context57.sent;
|
|
9559
9639
|
campaign = _yield$this$post2.campaign;
|
|
9560
|
-
return
|
|
9640
|
+
return _context57.abrupt("return", campaign);
|
|
9561
9641
|
|
|
9562
9642
|
case 5:
|
|
9563
9643
|
case "end":
|
|
9564
|
-
return
|
|
9644
|
+
return _context57.stop();
|
|
9565
9645
|
}
|
|
9566
9646
|
}
|
|
9567
|
-
},
|
|
9647
|
+
}, _callee57, this);
|
|
9568
9648
|
}));
|
|
9569
9649
|
|
|
9570
|
-
function createCampaign(
|
|
9650
|
+
function createCampaign(_x77) {
|
|
9571
9651
|
return _createCampaign.apply(this, arguments);
|
|
9572
9652
|
}
|
|
9573
9653
|
|
|
@@ -9584,30 +9664,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9584
9664
|
}, {
|
|
9585
9665
|
key: "getCampaign",
|
|
9586
9666
|
value: function () {
|
|
9587
|
-
var _getCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9667
|
+
var _getCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee58(id) {
|
|
9588
9668
|
var _yield$this$get3, campaign;
|
|
9589
9669
|
|
|
9590
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9670
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee58$(_context58) {
|
|
9591
9671
|
while (1) {
|
|
9592
|
-
switch (
|
|
9672
|
+
switch (_context58.prev = _context58.next) {
|
|
9593
9673
|
case 0:
|
|
9594
|
-
|
|
9674
|
+
_context58.next = 2;
|
|
9595
9675
|
return this.get(this.baseURL + "/campaigns/".concat(id));
|
|
9596
9676
|
|
|
9597
9677
|
case 2:
|
|
9598
|
-
_yield$this$get3 =
|
|
9678
|
+
_yield$this$get3 = _context58.sent;
|
|
9599
9679
|
campaign = _yield$this$get3.campaign;
|
|
9600
|
-
return
|
|
9680
|
+
return _context58.abrupt("return", campaign);
|
|
9601
9681
|
|
|
9602
9682
|
case 5:
|
|
9603
9683
|
case "end":
|
|
9604
|
-
return
|
|
9684
|
+
return _context58.stop();
|
|
9605
9685
|
}
|
|
9606
9686
|
}
|
|
9607
|
-
},
|
|
9687
|
+
}, _callee58, this);
|
|
9608
9688
|
}));
|
|
9609
9689
|
|
|
9610
|
-
function getCampaign(
|
|
9690
|
+
function getCampaign(_x78) {
|
|
9611
9691
|
return _getCampaign.apply(this, arguments);
|
|
9612
9692
|
}
|
|
9613
9693
|
|
|
@@ -9623,30 +9703,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9623
9703
|
}, {
|
|
9624
9704
|
key: "listCampaigns",
|
|
9625
9705
|
value: function () {
|
|
9626
|
-
var _listCampaigns = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9706
|
+
var _listCampaigns = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee59(options) {
|
|
9627
9707
|
var _yield$this$get4, campaigns;
|
|
9628
9708
|
|
|
9629
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9709
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee59$(_context59) {
|
|
9630
9710
|
while (1) {
|
|
9631
|
-
switch (
|
|
9711
|
+
switch (_context59.prev = _context59.next) {
|
|
9632
9712
|
case 0:
|
|
9633
|
-
|
|
9713
|
+
_context59.next = 2;
|
|
9634
9714
|
return this.get(this.baseURL + "/campaigns", options);
|
|
9635
9715
|
|
|
9636
9716
|
case 2:
|
|
9637
|
-
_yield$this$get4 =
|
|
9717
|
+
_yield$this$get4 = _context59.sent;
|
|
9638
9718
|
campaigns = _yield$this$get4.campaigns;
|
|
9639
|
-
return
|
|
9719
|
+
return _context59.abrupt("return", campaigns);
|
|
9640
9720
|
|
|
9641
9721
|
case 5:
|
|
9642
9722
|
case "end":
|
|
9643
|
-
return
|
|
9723
|
+
return _context59.stop();
|
|
9644
9724
|
}
|
|
9645
9725
|
}
|
|
9646
|
-
},
|
|
9726
|
+
}, _callee59, this);
|
|
9647
9727
|
}));
|
|
9648
9728
|
|
|
9649
|
-
function listCampaigns(
|
|
9729
|
+
function listCampaigns(_x79) {
|
|
9650
9730
|
return _listCampaigns.apply(this, arguments);
|
|
9651
9731
|
}
|
|
9652
9732
|
|
|
@@ -9664,32 +9744,32 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9664
9744
|
}, {
|
|
9665
9745
|
key: "updateCampaign",
|
|
9666
9746
|
value: function () {
|
|
9667
|
-
var _updateCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9747
|
+
var _updateCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee60(id, params) {
|
|
9668
9748
|
var _yield$this$put2, campaign;
|
|
9669
9749
|
|
|
9670
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9750
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee60$(_context60) {
|
|
9671
9751
|
while (1) {
|
|
9672
|
-
switch (
|
|
9752
|
+
switch (_context60.prev = _context60.next) {
|
|
9673
9753
|
case 0:
|
|
9674
|
-
|
|
9754
|
+
_context60.next = 2;
|
|
9675
9755
|
return this.put(this.baseURL + "/campaigns/".concat(id), {
|
|
9676
9756
|
campaign: params
|
|
9677
9757
|
});
|
|
9678
9758
|
|
|
9679
9759
|
case 2:
|
|
9680
|
-
_yield$this$put2 =
|
|
9760
|
+
_yield$this$put2 = _context60.sent;
|
|
9681
9761
|
campaign = _yield$this$put2.campaign;
|
|
9682
|
-
return
|
|
9762
|
+
return _context60.abrupt("return", campaign);
|
|
9683
9763
|
|
|
9684
9764
|
case 5:
|
|
9685
9765
|
case "end":
|
|
9686
|
-
return
|
|
9766
|
+
return _context60.stop();
|
|
9687
9767
|
}
|
|
9688
9768
|
}
|
|
9689
|
-
},
|
|
9769
|
+
}, _callee60, this);
|
|
9690
9770
|
}));
|
|
9691
9771
|
|
|
9692
|
-
function updateCampaign(
|
|
9772
|
+
function updateCampaign(_x80, _x81) {
|
|
9693
9773
|
return _updateCampaign.apply(this, arguments);
|
|
9694
9774
|
}
|
|
9695
9775
|
|
|
@@ -9706,22 +9786,22 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9706
9786
|
}, {
|
|
9707
9787
|
key: "deleteCampaign",
|
|
9708
9788
|
value: function () {
|
|
9709
|
-
var _deleteCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9710
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9789
|
+
var _deleteCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee61(id) {
|
|
9790
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee61$(_context61) {
|
|
9711
9791
|
while (1) {
|
|
9712
|
-
switch (
|
|
9792
|
+
switch (_context61.prev = _context61.next) {
|
|
9713
9793
|
case 0:
|
|
9714
|
-
return
|
|
9794
|
+
return _context61.abrupt("return", this.delete(this.baseURL + "/campaigns/".concat(id)));
|
|
9715
9795
|
|
|
9716
9796
|
case 1:
|
|
9717
9797
|
case "end":
|
|
9718
|
-
return
|
|
9798
|
+
return _context61.stop();
|
|
9719
9799
|
}
|
|
9720
9800
|
}
|
|
9721
|
-
},
|
|
9801
|
+
}, _callee61, this);
|
|
9722
9802
|
}));
|
|
9723
9803
|
|
|
9724
|
-
function deleteCampaign(
|
|
9804
|
+
function deleteCampaign(_x82) {
|
|
9725
9805
|
return _deleteCampaign.apply(this, arguments);
|
|
9726
9806
|
}
|
|
9727
9807
|
|
|
@@ -9739,33 +9819,33 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9739
9819
|
}, {
|
|
9740
9820
|
key: "scheduleCampaign",
|
|
9741
9821
|
value: function () {
|
|
9742
|
-
var _scheduleCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9822
|
+
var _scheduleCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee62(id, params) {
|
|
9743
9823
|
var sendAt, _yield$this$patch, campaign;
|
|
9744
9824
|
|
|
9745
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9825
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee62$(_context62) {
|
|
9746
9826
|
while (1) {
|
|
9747
|
-
switch (
|
|
9827
|
+
switch (_context62.prev = _context62.next) {
|
|
9748
9828
|
case 0:
|
|
9749
9829
|
sendAt = params.sendAt;
|
|
9750
|
-
|
|
9830
|
+
_context62.next = 3;
|
|
9751
9831
|
return this.patch(this.baseURL + "/campaigns/".concat(id, "/schedule"), {
|
|
9752
9832
|
send_at: sendAt
|
|
9753
9833
|
});
|
|
9754
9834
|
|
|
9755
9835
|
case 3:
|
|
9756
|
-
_yield$this$patch =
|
|
9836
|
+
_yield$this$patch = _context62.sent;
|
|
9757
9837
|
campaign = _yield$this$patch.campaign;
|
|
9758
|
-
return
|
|
9838
|
+
return _context62.abrupt("return", campaign);
|
|
9759
9839
|
|
|
9760
9840
|
case 6:
|
|
9761
9841
|
case "end":
|
|
9762
|
-
return
|
|
9842
|
+
return _context62.stop();
|
|
9763
9843
|
}
|
|
9764
9844
|
}
|
|
9765
|
-
},
|
|
9845
|
+
}, _callee62, this);
|
|
9766
9846
|
}));
|
|
9767
9847
|
|
|
9768
|
-
function scheduleCampaign(
|
|
9848
|
+
function scheduleCampaign(_x83, _x84) {
|
|
9769
9849
|
return _scheduleCampaign.apply(this, arguments);
|
|
9770
9850
|
}
|
|
9771
9851
|
|
|
@@ -9782,30 +9862,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9782
9862
|
}, {
|
|
9783
9863
|
key: "stopCampaign",
|
|
9784
9864
|
value: function () {
|
|
9785
|
-
var _stopCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9865
|
+
var _stopCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee63(id) {
|
|
9786
9866
|
var _yield$this$patch2, campaign;
|
|
9787
9867
|
|
|
9788
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9868
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee63$(_context63) {
|
|
9789
9869
|
while (1) {
|
|
9790
|
-
switch (
|
|
9870
|
+
switch (_context63.prev = _context63.next) {
|
|
9791
9871
|
case 0:
|
|
9792
|
-
|
|
9872
|
+
_context63.next = 2;
|
|
9793
9873
|
return this.patch(this.baseURL + "/campaigns/".concat(id, "/stop"));
|
|
9794
9874
|
|
|
9795
9875
|
case 2:
|
|
9796
|
-
_yield$this$patch2 =
|
|
9876
|
+
_yield$this$patch2 = _context63.sent;
|
|
9797
9877
|
campaign = _yield$this$patch2.campaign;
|
|
9798
|
-
return
|
|
9878
|
+
return _context63.abrupt("return", campaign);
|
|
9799
9879
|
|
|
9800
9880
|
case 5:
|
|
9801
9881
|
case "end":
|
|
9802
|
-
return
|
|
9882
|
+
return _context63.stop();
|
|
9803
9883
|
}
|
|
9804
9884
|
}
|
|
9805
|
-
},
|
|
9885
|
+
}, _callee63, this);
|
|
9806
9886
|
}));
|
|
9807
9887
|
|
|
9808
|
-
function stopCampaign(
|
|
9888
|
+
function stopCampaign(_x85) {
|
|
9809
9889
|
return _stopCampaign.apply(this, arguments);
|
|
9810
9890
|
}
|
|
9811
9891
|
|
|
@@ -9822,30 +9902,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9822
9902
|
}, {
|
|
9823
9903
|
key: "resumeCampaign",
|
|
9824
9904
|
value: function () {
|
|
9825
|
-
var _resumeCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9905
|
+
var _resumeCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee64(id) {
|
|
9826
9906
|
var _yield$this$patch3, campaign;
|
|
9827
9907
|
|
|
9828
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9908
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee64$(_context64) {
|
|
9829
9909
|
while (1) {
|
|
9830
|
-
switch (
|
|
9910
|
+
switch (_context64.prev = _context64.next) {
|
|
9831
9911
|
case 0:
|
|
9832
|
-
|
|
9912
|
+
_context64.next = 2;
|
|
9833
9913
|
return this.patch(this.baseURL + "/campaigns/".concat(id, "/resume"));
|
|
9834
9914
|
|
|
9835
9915
|
case 2:
|
|
9836
|
-
_yield$this$patch3 =
|
|
9916
|
+
_yield$this$patch3 = _context64.sent;
|
|
9837
9917
|
campaign = _yield$this$patch3.campaign;
|
|
9838
|
-
return
|
|
9918
|
+
return _context64.abrupt("return", campaign);
|
|
9839
9919
|
|
|
9840
9920
|
case 5:
|
|
9841
9921
|
case "end":
|
|
9842
|
-
return
|
|
9922
|
+
return _context64.stop();
|
|
9843
9923
|
}
|
|
9844
9924
|
}
|
|
9845
|
-
},
|
|
9925
|
+
}, _callee64, this);
|
|
9846
9926
|
}));
|
|
9847
9927
|
|
|
9848
|
-
function resumeCampaign(
|
|
9928
|
+
function resumeCampaign(_x86) {
|
|
9849
9929
|
return _resumeCampaign.apply(this, arguments);
|
|
9850
9930
|
}
|
|
9851
9931
|
|
|
@@ -9862,33 +9942,33 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9862
9942
|
}, {
|
|
9863
9943
|
key: "testCampaign",
|
|
9864
9944
|
value: function () {
|
|
9865
|
-
var _testCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9945
|
+
var _testCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee65(id, params) {
|
|
9866
9946
|
var users, _yield$this$post3, campaign;
|
|
9867
9947
|
|
|
9868
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9948
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee65$(_context65) {
|
|
9869
9949
|
while (1) {
|
|
9870
|
-
switch (
|
|
9950
|
+
switch (_context65.prev = _context65.next) {
|
|
9871
9951
|
case 0:
|
|
9872
9952
|
users = params.users;
|
|
9873
|
-
|
|
9953
|
+
_context65.next = 3;
|
|
9874
9954
|
return this.post(this.baseURL + "/campaigns/".concat(id, "/test"), {
|
|
9875
9955
|
users: users
|
|
9876
9956
|
});
|
|
9877
9957
|
|
|
9878
9958
|
case 3:
|
|
9879
|
-
_yield$this$post3 =
|
|
9959
|
+
_yield$this$post3 = _context65.sent;
|
|
9880
9960
|
campaign = _yield$this$post3.campaign;
|
|
9881
|
-
return
|
|
9961
|
+
return _context65.abrupt("return", campaign);
|
|
9882
9962
|
|
|
9883
9963
|
case 6:
|
|
9884
9964
|
case "end":
|
|
9885
|
-
return
|
|
9965
|
+
return _context65.stop();
|
|
9886
9966
|
}
|
|
9887
9967
|
}
|
|
9888
|
-
},
|
|
9968
|
+
}, _callee65, this);
|
|
9889
9969
|
}));
|
|
9890
9970
|
|
|
9891
|
-
function testCampaign(
|
|
9971
|
+
function testCampaign(_x87, _x88) {
|
|
9892
9972
|
return _testCampaign.apply(this, arguments);
|
|
9893
9973
|
}
|
|
9894
9974
|
|
|
@@ -9904,24 +9984,24 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9904
9984
|
}, {
|
|
9905
9985
|
key: "enrichURL",
|
|
9906
9986
|
value: function () {
|
|
9907
|
-
var _enrichURL = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9908
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
9987
|
+
var _enrichURL = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee66(url) {
|
|
9988
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee66$(_context66) {
|
|
9909
9989
|
while (1) {
|
|
9910
|
-
switch (
|
|
9990
|
+
switch (_context66.prev = _context66.next) {
|
|
9911
9991
|
case 0:
|
|
9912
|
-
return
|
|
9992
|
+
return _context66.abrupt("return", this.get(this.baseURL + "/og", {
|
|
9913
9993
|
url: url
|
|
9914
9994
|
}));
|
|
9915
9995
|
|
|
9916
9996
|
case 1:
|
|
9917
9997
|
case "end":
|
|
9918
|
-
return
|
|
9998
|
+
return _context66.stop();
|
|
9919
9999
|
}
|
|
9920
10000
|
}
|
|
9921
|
-
},
|
|
10001
|
+
}, _callee66, this);
|
|
9922
10002
|
}));
|
|
9923
10003
|
|
|
9924
|
-
function enrichURL(
|
|
10004
|
+
function enrichURL(_x89) {
|
|
9925
10005
|
return _enrichURL.apply(this, arguments);
|
|
9926
10006
|
}
|
|
9927
10007
|
|
|
@@ -9938,22 +10018,22 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9938
10018
|
}, {
|
|
9939
10019
|
key: "getTask",
|
|
9940
10020
|
value: function () {
|
|
9941
|
-
var _getTask = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
9942
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
10021
|
+
var _getTask = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee67(id) {
|
|
10022
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee67$(_context67) {
|
|
9943
10023
|
while (1) {
|
|
9944
|
-
switch (
|
|
10024
|
+
switch (_context67.prev = _context67.next) {
|
|
9945
10025
|
case 0:
|
|
9946
|
-
return
|
|
10026
|
+
return _context67.abrupt("return", this.get("".concat(this.baseURL, "/tasks/").concat(id)));
|
|
9947
10027
|
|
|
9948
10028
|
case 1:
|
|
9949
10029
|
case "end":
|
|
9950
|
-
return
|
|
10030
|
+
return _context67.stop();
|
|
9951
10031
|
}
|
|
9952
10032
|
}
|
|
9953
|
-
},
|
|
10033
|
+
}, _callee67, this);
|
|
9954
10034
|
}));
|
|
9955
10035
|
|
|
9956
|
-
function getTask(
|
|
10036
|
+
function getTask(_x90) {
|
|
9957
10037
|
return _getTask.apply(this, arguments);
|
|
9958
10038
|
}
|
|
9959
10039
|
|
|
@@ -9971,31 +10051,31 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9971
10051
|
}, {
|
|
9972
10052
|
key: "deleteChannels",
|
|
9973
10053
|
value: function () {
|
|
9974
|
-
var _deleteChannels = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
10054
|
+
var _deleteChannels = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee68(cids) {
|
|
9975
10055
|
var options,
|
|
9976
|
-
|
|
9977
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
10056
|
+
_args68 = arguments;
|
|
10057
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee68$(_context68) {
|
|
9978
10058
|
while (1) {
|
|
9979
|
-
switch (
|
|
10059
|
+
switch (_context68.prev = _context68.next) {
|
|
9980
10060
|
case 0:
|
|
9981
|
-
options =
|
|
9982
|
-
|
|
10061
|
+
options = _args68.length > 1 && _args68[1] !== undefined ? _args68[1] : {};
|
|
10062
|
+
_context68.next = 3;
|
|
9983
10063
|
return this.post(this.baseURL + "/channels/delete", _objectSpread({
|
|
9984
10064
|
cids: cids
|
|
9985
10065
|
}, options));
|
|
9986
10066
|
|
|
9987
10067
|
case 3:
|
|
9988
|
-
return
|
|
10068
|
+
return _context68.abrupt("return", _context68.sent);
|
|
9989
10069
|
|
|
9990
10070
|
case 4:
|
|
9991
10071
|
case "end":
|
|
9992
|
-
return
|
|
10072
|
+
return _context68.stop();
|
|
9993
10073
|
}
|
|
9994
10074
|
}
|
|
9995
|
-
},
|
|
10075
|
+
}, _callee68, this);
|
|
9996
10076
|
}));
|
|
9997
10077
|
|
|
9998
|
-
function deleteChannels(
|
|
10078
|
+
function deleteChannels(_x91) {
|
|
9999
10079
|
return _deleteChannels.apply(this, arguments);
|
|
10000
10080
|
}
|
|
10001
10081
|
|
|
@@ -10013,13 +10093,13 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10013
10093
|
}, {
|
|
10014
10094
|
key: "deleteUsers",
|
|
10015
10095
|
value: function () {
|
|
10016
|
-
var _deleteUsers = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
10017
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
10096
|
+
var _deleteUsers = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee69(user_ids, options) {
|
|
10097
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee69$(_context69) {
|
|
10018
10098
|
while (1) {
|
|
10019
|
-
switch (
|
|
10099
|
+
switch (_context69.prev = _context69.next) {
|
|
10020
10100
|
case 0:
|
|
10021
10101
|
if (!((options === null || options === void 0 ? void 0 : options.user) !== 'soft' && (options === null || options === void 0 ? void 0 : options.user) !== 'hard')) {
|
|
10022
|
-
|
|
10102
|
+
_context69.next = 2;
|
|
10023
10103
|
break;
|
|
10024
10104
|
}
|
|
10025
10105
|
|
|
@@ -10027,7 +10107,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10027
10107
|
|
|
10028
10108
|
case 2:
|
|
10029
10109
|
if (!(options.messages !== undefined && options.messages !== 'soft' && options.messages !== 'hard')) {
|
|
10030
|
-
|
|
10110
|
+
_context69.next = 4;
|
|
10031
10111
|
break;
|
|
10032
10112
|
}
|
|
10033
10113
|
|
|
@@ -10035,35 +10115,160 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10035
10115
|
|
|
10036
10116
|
case 4:
|
|
10037
10117
|
if (!(options.conversations !== undefined && options.conversations !== 'soft' && options.conversations !== 'hard')) {
|
|
10038
|
-
|
|
10118
|
+
_context69.next = 6;
|
|
10039
10119
|
break;
|
|
10040
10120
|
}
|
|
10041
10121
|
|
|
10042
10122
|
throw new Error('Invalid delete user options. conversations must be one of [soft hard]');
|
|
10043
10123
|
|
|
10044
10124
|
case 6:
|
|
10045
|
-
|
|
10125
|
+
_context69.next = 8;
|
|
10046
10126
|
return this.post(this.baseURL + "/users/delete", _objectSpread({
|
|
10047
10127
|
user_ids: user_ids
|
|
10048
10128
|
}, options));
|
|
10049
10129
|
|
|
10050
10130
|
case 8:
|
|
10051
|
-
return
|
|
10131
|
+
return _context69.abrupt("return", _context69.sent);
|
|
10052
10132
|
|
|
10053
10133
|
case 9:
|
|
10054
10134
|
case "end":
|
|
10055
|
-
return
|
|
10135
|
+
return _context69.stop();
|
|
10056
10136
|
}
|
|
10057
10137
|
}
|
|
10058
|
-
},
|
|
10138
|
+
}, _callee69, this);
|
|
10059
10139
|
}));
|
|
10060
10140
|
|
|
10061
|
-
function deleteUsers(
|
|
10141
|
+
function deleteUsers(_x92, _x93) {
|
|
10062
10142
|
return _deleteUsers.apply(this, arguments);
|
|
10063
10143
|
}
|
|
10064
10144
|
|
|
10065
10145
|
return deleteUsers;
|
|
10066
10146
|
}()
|
|
10147
|
+
/**
|
|
10148
|
+
* _createImport - Create an Import Task.
|
|
10149
|
+
*
|
|
10150
|
+
* Note: Do not use this.
|
|
10151
|
+
* It is present for internal usage only.
|
|
10152
|
+
* This function can, and will, break and/or be removed at any point in time.
|
|
10153
|
+
*
|
|
10154
|
+
* @private
|
|
10155
|
+
* @param {string} filename filename of uploaded data
|
|
10156
|
+
*
|
|
10157
|
+
* @return {APIResponse & CreateImportResponse} An ImportTask
|
|
10158
|
+
*/
|
|
10159
|
+
|
|
10160
|
+
}, {
|
|
10161
|
+
key: "_createImport",
|
|
10162
|
+
value: function () {
|
|
10163
|
+
var _createImport2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee70(filename) {
|
|
10164
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee70$(_context70) {
|
|
10165
|
+
while (1) {
|
|
10166
|
+
switch (_context70.prev = _context70.next) {
|
|
10167
|
+
case 0:
|
|
10168
|
+
_context70.next = 2;
|
|
10169
|
+
return this.post(this.baseURL + "/imports", {
|
|
10170
|
+
filename: filename
|
|
10171
|
+
});
|
|
10172
|
+
|
|
10173
|
+
case 2:
|
|
10174
|
+
return _context70.abrupt("return", _context70.sent);
|
|
10175
|
+
|
|
10176
|
+
case 3:
|
|
10177
|
+
case "end":
|
|
10178
|
+
return _context70.stop();
|
|
10179
|
+
}
|
|
10180
|
+
}
|
|
10181
|
+
}, _callee70, this);
|
|
10182
|
+
}));
|
|
10183
|
+
|
|
10184
|
+
function _createImport(_x94) {
|
|
10185
|
+
return _createImport2.apply(this, arguments);
|
|
10186
|
+
}
|
|
10187
|
+
|
|
10188
|
+
return _createImport;
|
|
10189
|
+
}()
|
|
10190
|
+
/**
|
|
10191
|
+
* _getImport - Get an Import Task.
|
|
10192
|
+
*
|
|
10193
|
+
* Note: Do not use this.
|
|
10194
|
+
* It is present for internal usage only.
|
|
10195
|
+
* This function can, and will, break and/or be removed at any point in time.
|
|
10196
|
+
*
|
|
10197
|
+
* @private
|
|
10198
|
+
* @param {string} id id of Import Task
|
|
10199
|
+
*
|
|
10200
|
+
* @return {APIResponse & GetImportResponse} An ImportTask
|
|
10201
|
+
*/
|
|
10202
|
+
|
|
10203
|
+
}, {
|
|
10204
|
+
key: "_getImport",
|
|
10205
|
+
value: function () {
|
|
10206
|
+
var _getImport2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee71(id) {
|
|
10207
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee71$(_context71) {
|
|
10208
|
+
while (1) {
|
|
10209
|
+
switch (_context71.prev = _context71.next) {
|
|
10210
|
+
case 0:
|
|
10211
|
+
_context71.next = 2;
|
|
10212
|
+
return this.get(this.baseURL + "/imports/".concat(id));
|
|
10213
|
+
|
|
10214
|
+
case 2:
|
|
10215
|
+
return _context71.abrupt("return", _context71.sent);
|
|
10216
|
+
|
|
10217
|
+
case 3:
|
|
10218
|
+
case "end":
|
|
10219
|
+
return _context71.stop();
|
|
10220
|
+
}
|
|
10221
|
+
}
|
|
10222
|
+
}, _callee71, this);
|
|
10223
|
+
}));
|
|
10224
|
+
|
|
10225
|
+
function _getImport(_x95) {
|
|
10226
|
+
return _getImport2.apply(this, arguments);
|
|
10227
|
+
}
|
|
10228
|
+
|
|
10229
|
+
return _getImport;
|
|
10230
|
+
}()
|
|
10231
|
+
/**
|
|
10232
|
+
* _listImports - Lists Import Tasks.
|
|
10233
|
+
*
|
|
10234
|
+
* Note: Do not use this.
|
|
10235
|
+
* It is present for internal usage only.
|
|
10236
|
+
* This function can, and will, break and/or be removed at any point in time.
|
|
10237
|
+
*
|
|
10238
|
+
* @private
|
|
10239
|
+
* @param {ListImportsPaginationOptions} options pagination options
|
|
10240
|
+
*
|
|
10241
|
+
* @return {APIResponse & ListImportsResponse} An ImportTask
|
|
10242
|
+
*/
|
|
10243
|
+
|
|
10244
|
+
}, {
|
|
10245
|
+
key: "_listImports",
|
|
10246
|
+
value: function () {
|
|
10247
|
+
var _listImports2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee72(options) {
|
|
10248
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee72$(_context72) {
|
|
10249
|
+
while (1) {
|
|
10250
|
+
switch (_context72.prev = _context72.next) {
|
|
10251
|
+
case 0:
|
|
10252
|
+
_context72.next = 2;
|
|
10253
|
+
return this.get(this.baseURL + "/imports", options);
|
|
10254
|
+
|
|
10255
|
+
case 2:
|
|
10256
|
+
return _context72.abrupt("return", _context72.sent);
|
|
10257
|
+
|
|
10258
|
+
case 3:
|
|
10259
|
+
case "end":
|
|
10260
|
+
return _context72.stop();
|
|
10261
|
+
}
|
|
10262
|
+
}
|
|
10263
|
+
}, _callee72, this);
|
|
10264
|
+
}));
|
|
10265
|
+
|
|
10266
|
+
function _listImports(_x96) {
|
|
10267
|
+
return _listImports2.apply(this, arguments);
|
|
10268
|
+
}
|
|
10269
|
+
|
|
10270
|
+
return _listImports;
|
|
10271
|
+
}()
|
|
10067
10272
|
}], [{
|
|
10068
10273
|
key: "getInstance",
|
|
10069
10274
|
value: function getInstance(key, secretOrOptions, options) {
|