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.es.js
CHANGED
|
@@ -714,6 +714,7 @@ var EVENT_MAP = {
|
|
|
714
714
|
'channel.created': true,
|
|
715
715
|
'channel.deleted': true,
|
|
716
716
|
'channel.hidden': true,
|
|
717
|
+
'channel.kicked': true,
|
|
717
718
|
'channel.muted': true,
|
|
718
719
|
'channel.truncated': true,
|
|
719
720
|
'channel.unmuted': true,
|
|
@@ -752,7 +753,8 @@ var EVENT_MAP = {
|
|
|
752
753
|
'user.watching.stop': true,
|
|
753
754
|
// local events
|
|
754
755
|
'connection.changed': true,
|
|
755
|
-
'connection.recovered': true
|
|
756
|
+
'connection.recovered': true,
|
|
757
|
+
'transport.changed': true
|
|
756
758
|
};
|
|
757
759
|
|
|
758
760
|
var IS_VALID_EVENT_MAP_TYPE = _objectSpread$6(_objectSpread$6({}, EVENT_MAP), {}, {
|
|
@@ -1677,6 +1679,8 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1677
1679
|
/**
|
|
1678
1680
|
* delete - Delete the channel. Messages are permanently removed.
|
|
1679
1681
|
*
|
|
1682
|
+
* @param {boolean} [options.hard_delete] Defines if the channel is hard deleted or not
|
|
1683
|
+
*
|
|
1680
1684
|
* @return {Promise<DeleteChannelAPIResponse<ChannelType, CommandType, UserType>>} The server response
|
|
1681
1685
|
*/
|
|
1682
1686
|
|
|
@@ -1684,17 +1688,20 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1684
1688
|
key: "delete",
|
|
1685
1689
|
value: function () {
|
|
1686
1690
|
var _delete2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {
|
|
1691
|
+
var options,
|
|
1692
|
+
_args11 = arguments;
|
|
1687
1693
|
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
1688
1694
|
while (1) {
|
|
1689
1695
|
switch (_context11.prev = _context11.next) {
|
|
1690
1696
|
case 0:
|
|
1691
|
-
|
|
1692
|
-
|
|
1697
|
+
options = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : {};
|
|
1698
|
+
_context11.next = 3;
|
|
1699
|
+
return this.getClient().delete(this._channelURL(), _objectSpread$5({}, options));
|
|
1693
1700
|
|
|
1694
|
-
case
|
|
1701
|
+
case 3:
|
|
1695
1702
|
return _context11.abrupt("return", _context11.sent);
|
|
1696
1703
|
|
|
1697
|
-
case
|
|
1704
|
+
case 4:
|
|
1698
1705
|
case "end":
|
|
1699
1706
|
return _context11.stop();
|
|
1700
1707
|
}
|
|
@@ -3192,7 +3199,8 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3192
3199
|
channelState.read[event.user.id] = {
|
|
3193
3200
|
// because in client.ts the handleEvent call that flows to this sets this `event.received_at = new Date();`
|
|
3194
3201
|
last_read: event.received_at,
|
|
3195
|
-
user: event.user
|
|
3202
|
+
user: event.user,
|
|
3203
|
+
unread_messages: 0
|
|
3196
3204
|
};
|
|
3197
3205
|
|
|
3198
3206
|
if (((_event$user4 = event.user) === null || _event$user4 === void 0 ? void 0 : _event$user4.id) === ((_this$getClient$user = this.getClient().user) === null || _this$getClient$user === void 0 ? void 0 : _this$getClient$user.id)) {
|
|
@@ -3249,7 +3257,8 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3249
3257
|
channelState.unreadCount = 0;
|
|
3250
3258
|
channelState.read[event.user.id] = {
|
|
3251
3259
|
last_read: new Date(event.created_at),
|
|
3252
|
-
user: event.user
|
|
3260
|
+
user: event.user,
|
|
3261
|
+
unread_messages: 0
|
|
3253
3262
|
};
|
|
3254
3263
|
} else if (this._countMessageAsUnread(event.message)) {
|
|
3255
3264
|
channelState.unreadCount = channelState.unreadCount + 1;
|
|
@@ -3273,7 +3282,16 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3273
3282
|
|
|
3274
3283
|
case 'channel.truncated':
|
|
3275
3284
|
channelState.clearMessages();
|
|
3276
|
-
channelState.unreadCount = 0;
|
|
3285
|
+
channelState.unreadCount = 0; // system messages don't increment unread counts
|
|
3286
|
+
|
|
3287
|
+
if (event.message) {
|
|
3288
|
+
channelState.addMessageSorted(event.message);
|
|
3289
|
+
|
|
3290
|
+
if (event.message.pinned) {
|
|
3291
|
+
channelState.addPinnedMessage(event.message);
|
|
3292
|
+
}
|
|
3293
|
+
}
|
|
3294
|
+
|
|
3277
3295
|
break;
|
|
3278
3296
|
|
|
3279
3297
|
case 'member.added':
|
|
@@ -3419,7 +3437,8 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3419
3437
|
if (user) {
|
|
3420
3438
|
this.state.read[user.id] = {
|
|
3421
3439
|
user: user,
|
|
3422
|
-
last_read: last_read
|
|
3440
|
+
last_read: last_read,
|
|
3441
|
+
unread_messages: 0
|
|
3423
3442
|
};
|
|
3424
3443
|
}
|
|
3425
3444
|
} // apply read state if part of the state
|
|
@@ -3431,16 +3450,17 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3431
3450
|
|
|
3432
3451
|
try {
|
|
3433
3452
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
3434
|
-
var
|
|
3453
|
+
var _read$unread_messages;
|
|
3435
3454
|
|
|
3436
|
-
var
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3455
|
+
var read = _step3.value;
|
|
3456
|
+
this.state.read[read.user.id] = {
|
|
3457
|
+
last_read: new Date(read.last_read),
|
|
3458
|
+
unread_messages: (_read$unread_messages = read.unread_messages) !== null && _read$unread_messages !== void 0 ? _read$unread_messages : 0,
|
|
3459
|
+
user: read.user
|
|
3460
|
+
};
|
|
3441
3461
|
|
|
3442
|
-
if (read.user.id === (user === null || user === void 0 ? void 0 : user.id)
|
|
3443
|
-
this.state.unreadCount =
|
|
3462
|
+
if (read.user.id === (user === null || user === void 0 ? void 0 : user.id)) {
|
|
3463
|
+
this.state.unreadCount = this.state.read[read.user.id].unread_messages;
|
|
3444
3464
|
}
|
|
3445
3465
|
}
|
|
3446
3466
|
} catch (err) {
|
|
@@ -3792,6 +3812,12 @@ var StableWSConnection = /*#__PURE__*/function () {
|
|
|
3792
3812
|
|
|
3793
3813
|
_defineProperty(this, "onmessage", function (wsID, event) {
|
|
3794
3814
|
if (_this.wsID !== wsID) return;
|
|
3815
|
+
|
|
3816
|
+
_this._log('onmessage() - onmessage callback', {
|
|
3817
|
+
event: event,
|
|
3818
|
+
wsID: wsID
|
|
3819
|
+
});
|
|
3820
|
+
|
|
3795
3821
|
var data = typeof event.data === 'string' ? JSON.parse(event.data) : null; // we wait till the first message before we consider the connection open..
|
|
3796
3822
|
// the reason for this is that auth errors and similar errors trigger a ws.onopen and immediately
|
|
3797
3823
|
// after that a ws.onclose..
|
|
@@ -3816,11 +3842,6 @@ var StableWSConnection = /*#__PURE__*/function () {
|
|
|
3816
3842
|
|
|
3817
3843
|
_this.lastEvent = new Date();
|
|
3818
3844
|
|
|
3819
|
-
_this._log('onmessage() - onmessage callback', {
|
|
3820
|
-
event: event,
|
|
3821
|
-
wsID: wsID
|
|
3822
|
-
});
|
|
3823
|
-
|
|
3824
3845
|
if (data && data.type === 'health.check') {
|
|
3825
3846
|
_this.scheduleNextPing();
|
|
3826
3847
|
}
|
|
@@ -4350,27 +4371,36 @@ var StableWSConnection = /*#__PURE__*/function () {
|
|
|
4350
4371
|
this.requestID = randomId();
|
|
4351
4372
|
this.client.insightMetrics.connectionStartTimestamp = new Date().getTime();
|
|
4352
4373
|
_context5.prev = 5;
|
|
4353
|
-
|
|
4374
|
+
|
|
4375
|
+
this._log("_connect() - waiting for token");
|
|
4376
|
+
|
|
4377
|
+
_context5.next = 9;
|
|
4354
4378
|
return this.client.tokenManager.tokenReady();
|
|
4355
4379
|
|
|
4356
|
-
case
|
|
4380
|
+
case 9:
|
|
4357
4381
|
this._setupConnectionPromise();
|
|
4358
4382
|
|
|
4359
4383
|
wsURL = this._buildUrl();
|
|
4384
|
+
|
|
4385
|
+
this._log("_connect() - Connecting to ".concat(wsURL), {
|
|
4386
|
+
wsURL: wsURL,
|
|
4387
|
+
requestID: this.requestID
|
|
4388
|
+
});
|
|
4389
|
+
|
|
4360
4390
|
this.ws = new WebSocket(wsURL);
|
|
4361
4391
|
this.ws.onopen = this.onopen.bind(this, this.wsID);
|
|
4362
4392
|
this.ws.onclose = this.onclose.bind(this, this.wsID);
|
|
4363
4393
|
this.ws.onerror = this.onerror.bind(this, this.wsID);
|
|
4364
4394
|
this.ws.onmessage = this.onmessage.bind(this, this.wsID);
|
|
4365
|
-
_context5.next =
|
|
4395
|
+
_context5.next = 19;
|
|
4366
4396
|
return this.connectionOpen;
|
|
4367
4397
|
|
|
4368
|
-
case
|
|
4398
|
+
case 19:
|
|
4369
4399
|
response = _context5.sent;
|
|
4370
4400
|
this.isConnecting = false;
|
|
4371
4401
|
|
|
4372
4402
|
if (!response) {
|
|
4373
|
-
_context5.next =
|
|
4403
|
+
_context5.next = 25;
|
|
4374
4404
|
break;
|
|
4375
4405
|
}
|
|
4376
4406
|
|
|
@@ -4383,12 +4413,12 @@ var StableWSConnection = /*#__PURE__*/function () {
|
|
|
4383
4413
|
|
|
4384
4414
|
return _context5.abrupt("return", response);
|
|
4385
4415
|
|
|
4386
|
-
case
|
|
4387
|
-
_context5.next =
|
|
4416
|
+
case 25:
|
|
4417
|
+
_context5.next = 32;
|
|
4388
4418
|
break;
|
|
4389
4419
|
|
|
4390
|
-
case
|
|
4391
|
-
_context5.prev =
|
|
4420
|
+
case 27:
|
|
4421
|
+
_context5.prev = 27;
|
|
4392
4422
|
_context5.t0 = _context5["catch"](5);
|
|
4393
4423
|
this.isConnecting = false;
|
|
4394
4424
|
|
|
@@ -4401,12 +4431,12 @@ var StableWSConnection = /*#__PURE__*/function () {
|
|
|
4401
4431
|
|
|
4402
4432
|
throw _context5.t0;
|
|
4403
4433
|
|
|
4404
|
-
case
|
|
4434
|
+
case 32:
|
|
4405
4435
|
case "end":
|
|
4406
4436
|
return _context5.stop();
|
|
4407
4437
|
}
|
|
4408
4438
|
}
|
|
4409
|
-
}, _callee5, this, [[5,
|
|
4439
|
+
}, _callee5, this, [[5, 27]]);
|
|
4410
4440
|
}));
|
|
4411
4441
|
|
|
4412
4442
|
function _connect() {
|
|
@@ -6556,7 +6586,6 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6556
6586
|
apnTemplate: '{}', //if app doesn't have apn configured it will error
|
|
6557
6587
|
firebaseTemplate: '{}', //if app doesn't have firebase configured it will error
|
|
6558
6588
|
firebaseDataTemplate: '{}', //if app doesn't have firebase configured it will error
|
|
6559
|
-
huaweiDataTemplate: '{}' //if app doesn't have huawei configured it will error
|
|
6560
6589
|
skipDevices: true, // skip config/device checks and sending to real devices
|
|
6561
6590
|
}
|
|
6562
6591
|
*/
|
|
@@ -6573,7 +6602,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6573
6602
|
case 0:
|
|
6574
6603
|
data = _args12.length > 1 && _args12[1] !== undefined ? _args12[1] : {};
|
|
6575
6604
|
_context12.next = 3;
|
|
6576
|
-
return this.post(this.baseURL + '/check_push', _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(
|
|
6605
|
+
return this.post(this.baseURL + '/check_push', _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
6577
6606
|
user_id: userID
|
|
6578
6607
|
}, data.messageID ? {
|
|
6579
6608
|
message_id: data.messageID
|
|
@@ -6583,8 +6612,6 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6583
6612
|
firebase_template: data.firebaseTemplate
|
|
6584
6613
|
} : {}), data.firebaseDataTemplate ? {
|
|
6585
6614
|
firebase_data_template: data.firebaseDataTemplate
|
|
6586
|
-
} : {}), data.huaweiDataTemplate ? {
|
|
6587
|
-
huawei_data_template: data.huaweiDataTemplate
|
|
6588
6615
|
} : {}), data.skipDevices ? {
|
|
6589
6616
|
skip_devices: true
|
|
6590
6617
|
} : {}));
|
|
@@ -8529,6 +8556,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8529
8556
|
* It is present for internal usage only.
|
|
8530
8557
|
* This function can, and will, break and/or be removed at any point in time.
|
|
8531
8558
|
*
|
|
8559
|
+
* @private
|
|
8532
8560
|
* @param {FlagReportsFilters} filterConditions MongoDB style filter conditions
|
|
8533
8561
|
* @param {FlagReportsPaginationOptions} options Option object, {limit: 10, offset:0}
|
|
8534
8562
|
*
|
|
@@ -8577,6 +8605,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8577
8605
|
* It is present for internal usage only.
|
|
8578
8606
|
* This function can, and will, break and/or be removed at any point in time.
|
|
8579
8607
|
*
|
|
8608
|
+
* @private
|
|
8580
8609
|
* @param {string} [id] flag report to review
|
|
8581
8610
|
* @param {string} [reviewResult] flag report review result
|
|
8582
8611
|
* @param {string} [options.user_id] currentUserID, only used with serverside auth
|
|
@@ -8617,6 +8646,52 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8617
8646
|
|
|
8618
8647
|
return _reviewFlagReport;
|
|
8619
8648
|
}()
|
|
8649
|
+
/**
|
|
8650
|
+
* _unblockMessage - unblocks message blocked by automod
|
|
8651
|
+
*
|
|
8652
|
+
* Note: Do not use this.
|
|
8653
|
+
* It is present for internal usage only.
|
|
8654
|
+
* This function can, and will, break and/or be removed at any point in time.
|
|
8655
|
+
*
|
|
8656
|
+
* @private
|
|
8657
|
+
* @param {string} targetMessageID
|
|
8658
|
+
* @param {string} [options.user_id] currentUserID, only used with serverside auth
|
|
8659
|
+
* @returns {Promise<APIResponse>}
|
|
8660
|
+
*/
|
|
8661
|
+
|
|
8662
|
+
}, {
|
|
8663
|
+
key: "_unblockMessage",
|
|
8664
|
+
value: function () {
|
|
8665
|
+
var _unblockMessage2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44(targetMessageID) {
|
|
8666
|
+
var options,
|
|
8667
|
+
_args44 = arguments;
|
|
8668
|
+
return _regeneratorRuntime.wrap(function _callee44$(_context44) {
|
|
8669
|
+
while (1) {
|
|
8670
|
+
switch (_context44.prev = _context44.next) {
|
|
8671
|
+
case 0:
|
|
8672
|
+
options = _args44.length > 1 && _args44[1] !== undefined ? _args44[1] : {};
|
|
8673
|
+
_context44.next = 3;
|
|
8674
|
+
return this.post(this.baseURL + '/moderation/unblock_message', _objectSpread({
|
|
8675
|
+
target_message_id: targetMessageID
|
|
8676
|
+
}, options));
|
|
8677
|
+
|
|
8678
|
+
case 3:
|
|
8679
|
+
return _context44.abrupt("return", _context44.sent);
|
|
8680
|
+
|
|
8681
|
+
case 4:
|
|
8682
|
+
case "end":
|
|
8683
|
+
return _context44.stop();
|
|
8684
|
+
}
|
|
8685
|
+
}
|
|
8686
|
+
}, _callee44, this);
|
|
8687
|
+
}));
|
|
8688
|
+
|
|
8689
|
+
function _unblockMessage(_x56) {
|
|
8690
|
+
return _unblockMessage2.apply(this, arguments);
|
|
8691
|
+
}
|
|
8692
|
+
|
|
8693
|
+
return _unblockMessage;
|
|
8694
|
+
}()
|
|
8620
8695
|
/**
|
|
8621
8696
|
* @deprecated use markChannelsRead instead
|
|
8622
8697
|
*
|
|
@@ -8638,23 +8713,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8638
8713
|
* @return {Promise<APIResponse>}
|
|
8639
8714
|
*/
|
|
8640
8715
|
function () {
|
|
8641
|
-
var _markChannelsRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8716
|
+
var _markChannelsRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45() {
|
|
8642
8717
|
var data,
|
|
8643
|
-
|
|
8644
|
-
return _regeneratorRuntime.wrap(function
|
|
8718
|
+
_args45 = arguments;
|
|
8719
|
+
return _regeneratorRuntime.wrap(function _callee45$(_context45) {
|
|
8645
8720
|
while (1) {
|
|
8646
|
-
switch (
|
|
8721
|
+
switch (_context45.prev = _context45.next) {
|
|
8647
8722
|
case 0:
|
|
8648
|
-
data =
|
|
8649
|
-
|
|
8723
|
+
data = _args45.length > 0 && _args45[0] !== undefined ? _args45[0] : {};
|
|
8724
|
+
_context45.next = 3;
|
|
8650
8725
|
return this.post(this.baseURL + '/channels/read', _objectSpread({}, data));
|
|
8651
8726
|
|
|
8652
8727
|
case 3:
|
|
8653
8728
|
case "end":
|
|
8654
|
-
return
|
|
8729
|
+
return _context45.stop();
|
|
8655
8730
|
}
|
|
8656
8731
|
}
|
|
8657
|
-
},
|
|
8732
|
+
}, _callee45, this);
|
|
8658
8733
|
}));
|
|
8659
8734
|
|
|
8660
8735
|
function markChannelsRead() {
|
|
@@ -8729,28 +8804,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8729
8804
|
}, {
|
|
8730
8805
|
key: "translateMessage",
|
|
8731
8806
|
value: function () {
|
|
8732
|
-
var _translateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8733
|
-
return _regeneratorRuntime.wrap(function
|
|
8807
|
+
var _translateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46(messageId, language) {
|
|
8808
|
+
return _regeneratorRuntime.wrap(function _callee46$(_context46) {
|
|
8734
8809
|
while (1) {
|
|
8735
|
-
switch (
|
|
8810
|
+
switch (_context46.prev = _context46.next) {
|
|
8736
8811
|
case 0:
|
|
8737
|
-
|
|
8812
|
+
_context46.next = 2;
|
|
8738
8813
|
return this.post(this.baseURL + "/messages/".concat(messageId, "/translate"), {
|
|
8739
8814
|
language: language
|
|
8740
8815
|
});
|
|
8741
8816
|
|
|
8742
8817
|
case 2:
|
|
8743
|
-
return
|
|
8818
|
+
return _context46.abrupt("return", _context46.sent);
|
|
8744
8819
|
|
|
8745
8820
|
case 3:
|
|
8746
8821
|
case "end":
|
|
8747
|
-
return
|
|
8822
|
+
return _context46.stop();
|
|
8748
8823
|
}
|
|
8749
8824
|
}
|
|
8750
|
-
},
|
|
8825
|
+
}, _callee46, this);
|
|
8751
8826
|
}));
|
|
8752
8827
|
|
|
8753
|
-
function translateMessage(
|
|
8828
|
+
function translateMessage(_x57, _x58) {
|
|
8754
8829
|
return _translateMessage.apply(this, arguments);
|
|
8755
8830
|
}
|
|
8756
8831
|
|
|
@@ -8852,14 +8927,14 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8852
8927
|
}, {
|
|
8853
8928
|
key: "updateMessage",
|
|
8854
8929
|
value: function () {
|
|
8855
|
-
var _updateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8930
|
+
var _updateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee47(message, userId, options) {
|
|
8856
8931
|
var clonedMessage, reservedMessageFields;
|
|
8857
|
-
return _regeneratorRuntime.wrap(function
|
|
8932
|
+
return _regeneratorRuntime.wrap(function _callee47$(_context47) {
|
|
8858
8933
|
while (1) {
|
|
8859
|
-
switch (
|
|
8934
|
+
switch (_context47.prev = _context47.next) {
|
|
8860
8935
|
case 0:
|
|
8861
8936
|
if (message.id) {
|
|
8862
|
-
|
|
8937
|
+
_context47.next = 2;
|
|
8863
8938
|
break;
|
|
8864
8939
|
}
|
|
8865
8940
|
|
|
@@ -8896,23 +8971,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8896
8971
|
});
|
|
8897
8972
|
}
|
|
8898
8973
|
|
|
8899
|
-
|
|
8974
|
+
_context47.next = 10;
|
|
8900
8975
|
return this.post(this.baseURL + "/messages/".concat(message.id), _objectSpread({
|
|
8901
8976
|
message: clonedMessage
|
|
8902
8977
|
}, options));
|
|
8903
8978
|
|
|
8904
8979
|
case 10:
|
|
8905
|
-
return
|
|
8980
|
+
return _context47.abrupt("return", _context47.sent);
|
|
8906
8981
|
|
|
8907
8982
|
case 11:
|
|
8908
8983
|
case "end":
|
|
8909
|
-
return
|
|
8984
|
+
return _context47.stop();
|
|
8910
8985
|
}
|
|
8911
8986
|
}
|
|
8912
|
-
},
|
|
8987
|
+
}, _callee47, this);
|
|
8913
8988
|
}));
|
|
8914
8989
|
|
|
8915
|
-
function updateMessage(
|
|
8990
|
+
function updateMessage(_x59, _x60, _x61) {
|
|
8916
8991
|
return _updateMessage.apply(this, arguments);
|
|
8917
8992
|
}
|
|
8918
8993
|
|
|
@@ -8935,14 +9010,14 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8935
9010
|
}, {
|
|
8936
9011
|
key: "partialUpdateMessage",
|
|
8937
9012
|
value: function () {
|
|
8938
|
-
var _partialUpdateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9013
|
+
var _partialUpdateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee48(id, partialMessageObject, userId, options) {
|
|
8939
9014
|
var user;
|
|
8940
|
-
return _regeneratorRuntime.wrap(function
|
|
9015
|
+
return _regeneratorRuntime.wrap(function _callee48$(_context48) {
|
|
8941
9016
|
while (1) {
|
|
8942
|
-
switch (
|
|
9017
|
+
switch (_context48.prev = _context48.next) {
|
|
8943
9018
|
case 0:
|
|
8944
9019
|
if (id) {
|
|
8945
|
-
|
|
9020
|
+
_context48.next = 2;
|
|
8946
9021
|
break;
|
|
8947
9022
|
}
|
|
8948
9023
|
|
|
@@ -8957,23 +9032,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8957
9032
|
};
|
|
8958
9033
|
}
|
|
8959
9034
|
|
|
8960
|
-
|
|
9035
|
+
_context48.next = 6;
|
|
8961
9036
|
return this.put(this.baseURL + "/messages/".concat(id), _objectSpread(_objectSpread(_objectSpread({}, partialMessageObject), options), {}, {
|
|
8962
9037
|
user: user
|
|
8963
9038
|
}));
|
|
8964
9039
|
|
|
8965
9040
|
case 6:
|
|
8966
|
-
return
|
|
9041
|
+
return _context48.abrupt("return", _context48.sent);
|
|
8967
9042
|
|
|
8968
9043
|
case 7:
|
|
8969
9044
|
case "end":
|
|
8970
|
-
return
|
|
9045
|
+
return _context48.stop();
|
|
8971
9046
|
}
|
|
8972
9047
|
}
|
|
8973
|
-
},
|
|
9048
|
+
}, _callee48, this);
|
|
8974
9049
|
}));
|
|
8975
9050
|
|
|
8976
|
-
function partialUpdateMessage(
|
|
9051
|
+
function partialUpdateMessage(_x62, _x63, _x64, _x65) {
|
|
8977
9052
|
return _partialUpdateMessage.apply(this, arguments);
|
|
8978
9053
|
}
|
|
8979
9054
|
|
|
@@ -8982,11 +9057,11 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8982
9057
|
}, {
|
|
8983
9058
|
key: "deleteMessage",
|
|
8984
9059
|
value: function () {
|
|
8985
|
-
var _deleteMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9060
|
+
var _deleteMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49(messageID, hardDelete) {
|
|
8986
9061
|
var params;
|
|
8987
|
-
return _regeneratorRuntime.wrap(function
|
|
9062
|
+
return _regeneratorRuntime.wrap(function _callee49$(_context49) {
|
|
8988
9063
|
while (1) {
|
|
8989
|
-
switch (
|
|
9064
|
+
switch (_context49.prev = _context49.next) {
|
|
8990
9065
|
case 0:
|
|
8991
9066
|
params = {};
|
|
8992
9067
|
|
|
@@ -8996,21 +9071,21 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8996
9071
|
};
|
|
8997
9072
|
}
|
|
8998
9073
|
|
|
8999
|
-
|
|
9074
|
+
_context49.next = 4;
|
|
9000
9075
|
return this.delete(this.baseURL + "/messages/".concat(messageID), params);
|
|
9001
9076
|
|
|
9002
9077
|
case 4:
|
|
9003
|
-
return
|
|
9078
|
+
return _context49.abrupt("return", _context49.sent);
|
|
9004
9079
|
|
|
9005
9080
|
case 5:
|
|
9006
9081
|
case "end":
|
|
9007
|
-
return
|
|
9082
|
+
return _context49.stop();
|
|
9008
9083
|
}
|
|
9009
9084
|
}
|
|
9010
|
-
},
|
|
9085
|
+
}, _callee49, this);
|
|
9011
9086
|
}));
|
|
9012
9087
|
|
|
9013
|
-
function deleteMessage(
|
|
9088
|
+
function deleteMessage(_x66, _x67) {
|
|
9014
9089
|
return _deleteMessage.apply(this, arguments);
|
|
9015
9090
|
}
|
|
9016
9091
|
|
|
@@ -9019,26 +9094,26 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9019
9094
|
}, {
|
|
9020
9095
|
key: "getMessage",
|
|
9021
9096
|
value: function () {
|
|
9022
|
-
var _getMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9023
|
-
return _regeneratorRuntime.wrap(function
|
|
9097
|
+
var _getMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee50(messageID) {
|
|
9098
|
+
return _regeneratorRuntime.wrap(function _callee50$(_context50) {
|
|
9024
9099
|
while (1) {
|
|
9025
|
-
switch (
|
|
9100
|
+
switch (_context50.prev = _context50.next) {
|
|
9026
9101
|
case 0:
|
|
9027
|
-
|
|
9102
|
+
_context50.next = 2;
|
|
9028
9103
|
return this.get(this.baseURL + "/messages/".concat(messageID));
|
|
9029
9104
|
|
|
9030
9105
|
case 2:
|
|
9031
|
-
return
|
|
9106
|
+
return _context50.abrupt("return", _context50.sent);
|
|
9032
9107
|
|
|
9033
9108
|
case 3:
|
|
9034
9109
|
case "end":
|
|
9035
|
-
return
|
|
9110
|
+
return _context50.stop();
|
|
9036
9111
|
}
|
|
9037
9112
|
}
|
|
9038
|
-
},
|
|
9113
|
+
}, _callee50, this);
|
|
9039
9114
|
}));
|
|
9040
9115
|
|
|
9041
|
-
function getMessage(
|
|
9116
|
+
function getMessage(_x68) {
|
|
9042
9117
|
return _getMessage.apply(this, arguments);
|
|
9043
9118
|
}
|
|
9044
9119
|
|
|
@@ -9047,7 +9122,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9047
9122
|
}, {
|
|
9048
9123
|
key: "getUserAgent",
|
|
9049
9124
|
value: function getUserAgent() {
|
|
9050
|
-
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "5.
|
|
9125
|
+
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "5.5.0");
|
|
9051
9126
|
}
|
|
9052
9127
|
}, {
|
|
9053
9128
|
key: "setUserAgent",
|
|
@@ -9242,28 +9317,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9242
9317
|
}, {
|
|
9243
9318
|
key: "sendUserCustomEvent",
|
|
9244
9319
|
value: function () {
|
|
9245
|
-
var _sendUserCustomEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9246
|
-
return _regeneratorRuntime.wrap(function
|
|
9320
|
+
var _sendUserCustomEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee51(targetUserID, event) {
|
|
9321
|
+
return _regeneratorRuntime.wrap(function _callee51$(_context51) {
|
|
9247
9322
|
while (1) {
|
|
9248
|
-
switch (
|
|
9323
|
+
switch (_context51.prev = _context51.next) {
|
|
9249
9324
|
case 0:
|
|
9250
|
-
|
|
9325
|
+
_context51.next = 2;
|
|
9251
9326
|
return this.post("".concat(this.baseURL, "/users/").concat(targetUserID, "/event"), {
|
|
9252
9327
|
event: event
|
|
9253
9328
|
});
|
|
9254
9329
|
|
|
9255
9330
|
case 2:
|
|
9256
|
-
return
|
|
9331
|
+
return _context51.abrupt("return", _context51.sent);
|
|
9257
9332
|
|
|
9258
9333
|
case 3:
|
|
9259
9334
|
case "end":
|
|
9260
|
-
return
|
|
9335
|
+
return _context51.stop();
|
|
9261
9336
|
}
|
|
9262
9337
|
}
|
|
9263
|
-
},
|
|
9338
|
+
}, _callee51, this);
|
|
9264
9339
|
}));
|
|
9265
9340
|
|
|
9266
|
-
function sendUserCustomEvent(
|
|
9341
|
+
function sendUserCustomEvent(_x69, _x70) {
|
|
9267
9342
|
return _sendUserCustomEvent.apply(this, arguments);
|
|
9268
9343
|
}
|
|
9269
9344
|
|
|
@@ -9305,6 +9380,11 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9305
9380
|
|
|
9306
9381
|
return this.post("".concat(this.baseURL, "/export_channels"), payload);
|
|
9307
9382
|
}
|
|
9383
|
+
}, {
|
|
9384
|
+
key: "exportUsers",
|
|
9385
|
+
value: function exportUsers(request) {
|
|
9386
|
+
return this.post("".concat(this.baseURL, "/export/users"), request);
|
|
9387
|
+
}
|
|
9308
9388
|
}, {
|
|
9309
9389
|
key: "exportChannel",
|
|
9310
9390
|
value: function exportChannel(request, options) {
|
|
@@ -9326,32 +9406,32 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9326
9406
|
}, {
|
|
9327
9407
|
key: "createSegment",
|
|
9328
9408
|
value: function () {
|
|
9329
|
-
var _createSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9409
|
+
var _createSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee52(params) {
|
|
9330
9410
|
var _yield$this$post, segment;
|
|
9331
9411
|
|
|
9332
|
-
return _regeneratorRuntime.wrap(function
|
|
9412
|
+
return _regeneratorRuntime.wrap(function _callee52$(_context52) {
|
|
9333
9413
|
while (1) {
|
|
9334
|
-
switch (
|
|
9414
|
+
switch (_context52.prev = _context52.next) {
|
|
9335
9415
|
case 0:
|
|
9336
|
-
|
|
9416
|
+
_context52.next = 2;
|
|
9337
9417
|
return this.post(this.baseURL + "/segments", {
|
|
9338
9418
|
segment: params
|
|
9339
9419
|
});
|
|
9340
9420
|
|
|
9341
9421
|
case 2:
|
|
9342
|
-
_yield$this$post =
|
|
9422
|
+
_yield$this$post = _context52.sent;
|
|
9343
9423
|
segment = _yield$this$post.segment;
|
|
9344
|
-
return
|
|
9424
|
+
return _context52.abrupt("return", segment);
|
|
9345
9425
|
|
|
9346
9426
|
case 5:
|
|
9347
9427
|
case "end":
|
|
9348
|
-
return
|
|
9428
|
+
return _context52.stop();
|
|
9349
9429
|
}
|
|
9350
9430
|
}
|
|
9351
|
-
},
|
|
9431
|
+
}, _callee52, this);
|
|
9352
9432
|
}));
|
|
9353
9433
|
|
|
9354
|
-
function createSegment(
|
|
9434
|
+
function createSegment(_x71) {
|
|
9355
9435
|
return _createSegment.apply(this, arguments);
|
|
9356
9436
|
}
|
|
9357
9437
|
|
|
@@ -9368,30 +9448,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9368
9448
|
}, {
|
|
9369
9449
|
key: "getSegment",
|
|
9370
9450
|
value: function () {
|
|
9371
|
-
var _getSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9451
|
+
var _getSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee53(id) {
|
|
9372
9452
|
var _yield$this$get, segment;
|
|
9373
9453
|
|
|
9374
|
-
return _regeneratorRuntime.wrap(function
|
|
9454
|
+
return _regeneratorRuntime.wrap(function _callee53$(_context53) {
|
|
9375
9455
|
while (1) {
|
|
9376
|
-
switch (
|
|
9456
|
+
switch (_context53.prev = _context53.next) {
|
|
9377
9457
|
case 0:
|
|
9378
|
-
|
|
9458
|
+
_context53.next = 2;
|
|
9379
9459
|
return this.get(this.baseURL + "/segments/".concat(id));
|
|
9380
9460
|
|
|
9381
9461
|
case 2:
|
|
9382
|
-
_yield$this$get =
|
|
9462
|
+
_yield$this$get = _context53.sent;
|
|
9383
9463
|
segment = _yield$this$get.segment;
|
|
9384
|
-
return
|
|
9464
|
+
return _context53.abrupt("return", segment);
|
|
9385
9465
|
|
|
9386
9466
|
case 5:
|
|
9387
9467
|
case "end":
|
|
9388
|
-
return
|
|
9468
|
+
return _context53.stop();
|
|
9389
9469
|
}
|
|
9390
9470
|
}
|
|
9391
|
-
},
|
|
9471
|
+
}, _callee53, this);
|
|
9392
9472
|
}));
|
|
9393
9473
|
|
|
9394
|
-
function getSegment(
|
|
9474
|
+
function getSegment(_x72) {
|
|
9395
9475
|
return _getSegment.apply(this, arguments);
|
|
9396
9476
|
}
|
|
9397
9477
|
|
|
@@ -9407,30 +9487,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9407
9487
|
}, {
|
|
9408
9488
|
key: "listSegments",
|
|
9409
9489
|
value: function () {
|
|
9410
|
-
var _listSegments = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9490
|
+
var _listSegments = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee54(options) {
|
|
9411
9491
|
var _yield$this$get2, segments;
|
|
9412
9492
|
|
|
9413
|
-
return _regeneratorRuntime.wrap(function
|
|
9493
|
+
return _regeneratorRuntime.wrap(function _callee54$(_context54) {
|
|
9414
9494
|
while (1) {
|
|
9415
|
-
switch (
|
|
9495
|
+
switch (_context54.prev = _context54.next) {
|
|
9416
9496
|
case 0:
|
|
9417
|
-
|
|
9497
|
+
_context54.next = 2;
|
|
9418
9498
|
return this.get(this.baseURL + "/segments", options);
|
|
9419
9499
|
|
|
9420
9500
|
case 2:
|
|
9421
|
-
_yield$this$get2 =
|
|
9501
|
+
_yield$this$get2 = _context54.sent;
|
|
9422
9502
|
segments = _yield$this$get2.segments;
|
|
9423
|
-
return
|
|
9503
|
+
return _context54.abrupt("return", segments);
|
|
9424
9504
|
|
|
9425
9505
|
case 5:
|
|
9426
9506
|
case "end":
|
|
9427
|
-
return
|
|
9507
|
+
return _context54.stop();
|
|
9428
9508
|
}
|
|
9429
9509
|
}
|
|
9430
|
-
},
|
|
9510
|
+
}, _callee54, this);
|
|
9431
9511
|
}));
|
|
9432
9512
|
|
|
9433
|
-
function listSegments(
|
|
9513
|
+
function listSegments(_x73) {
|
|
9434
9514
|
return _listSegments.apply(this, arguments);
|
|
9435
9515
|
}
|
|
9436
9516
|
|
|
@@ -9448,32 +9528,32 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9448
9528
|
}, {
|
|
9449
9529
|
key: "updateSegment",
|
|
9450
9530
|
value: function () {
|
|
9451
|
-
var _updateSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9531
|
+
var _updateSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee55(id, params) {
|
|
9452
9532
|
var _yield$this$put, segment;
|
|
9453
9533
|
|
|
9454
|
-
return _regeneratorRuntime.wrap(function
|
|
9534
|
+
return _regeneratorRuntime.wrap(function _callee55$(_context55) {
|
|
9455
9535
|
while (1) {
|
|
9456
|
-
switch (
|
|
9536
|
+
switch (_context55.prev = _context55.next) {
|
|
9457
9537
|
case 0:
|
|
9458
|
-
|
|
9538
|
+
_context55.next = 2;
|
|
9459
9539
|
return this.put(this.baseURL + "/segments/".concat(id), {
|
|
9460
9540
|
segment: params
|
|
9461
9541
|
});
|
|
9462
9542
|
|
|
9463
9543
|
case 2:
|
|
9464
|
-
_yield$this$put =
|
|
9544
|
+
_yield$this$put = _context55.sent;
|
|
9465
9545
|
segment = _yield$this$put.segment;
|
|
9466
|
-
return
|
|
9546
|
+
return _context55.abrupt("return", segment);
|
|
9467
9547
|
|
|
9468
9548
|
case 5:
|
|
9469
9549
|
case "end":
|
|
9470
|
-
return
|
|
9550
|
+
return _context55.stop();
|
|
9471
9551
|
}
|
|
9472
9552
|
}
|
|
9473
|
-
},
|
|
9553
|
+
}, _callee55, this);
|
|
9474
9554
|
}));
|
|
9475
9555
|
|
|
9476
|
-
function updateSegment(
|
|
9556
|
+
function updateSegment(_x74, _x75) {
|
|
9477
9557
|
return _updateSegment.apply(this, arguments);
|
|
9478
9558
|
}
|
|
9479
9559
|
|
|
@@ -9490,22 +9570,22 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9490
9570
|
}, {
|
|
9491
9571
|
key: "deleteSegment",
|
|
9492
9572
|
value: function () {
|
|
9493
|
-
var _deleteSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9494
|
-
return _regeneratorRuntime.wrap(function
|
|
9573
|
+
var _deleteSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee56(id) {
|
|
9574
|
+
return _regeneratorRuntime.wrap(function _callee56$(_context56) {
|
|
9495
9575
|
while (1) {
|
|
9496
|
-
switch (
|
|
9576
|
+
switch (_context56.prev = _context56.next) {
|
|
9497
9577
|
case 0:
|
|
9498
|
-
return
|
|
9578
|
+
return _context56.abrupt("return", this.delete(this.baseURL + "/segments/".concat(id)));
|
|
9499
9579
|
|
|
9500
9580
|
case 1:
|
|
9501
9581
|
case "end":
|
|
9502
|
-
return
|
|
9582
|
+
return _context56.stop();
|
|
9503
9583
|
}
|
|
9504
9584
|
}
|
|
9505
|
-
},
|
|
9585
|
+
}, _callee56, this);
|
|
9506
9586
|
}));
|
|
9507
9587
|
|
|
9508
|
-
function deleteSegment(
|
|
9588
|
+
function deleteSegment(_x76) {
|
|
9509
9589
|
return _deleteSegment.apply(this, arguments);
|
|
9510
9590
|
}
|
|
9511
9591
|
|
|
@@ -9522,32 +9602,32 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9522
9602
|
}, {
|
|
9523
9603
|
key: "createCampaign",
|
|
9524
9604
|
value: function () {
|
|
9525
|
-
var _createCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9605
|
+
var _createCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee57(params) {
|
|
9526
9606
|
var _yield$this$post2, campaign;
|
|
9527
9607
|
|
|
9528
|
-
return _regeneratorRuntime.wrap(function
|
|
9608
|
+
return _regeneratorRuntime.wrap(function _callee57$(_context57) {
|
|
9529
9609
|
while (1) {
|
|
9530
|
-
switch (
|
|
9610
|
+
switch (_context57.prev = _context57.next) {
|
|
9531
9611
|
case 0:
|
|
9532
|
-
|
|
9612
|
+
_context57.next = 2;
|
|
9533
9613
|
return this.post(this.baseURL + "/campaigns", {
|
|
9534
9614
|
campaign: params
|
|
9535
9615
|
});
|
|
9536
9616
|
|
|
9537
9617
|
case 2:
|
|
9538
|
-
_yield$this$post2 =
|
|
9618
|
+
_yield$this$post2 = _context57.sent;
|
|
9539
9619
|
campaign = _yield$this$post2.campaign;
|
|
9540
|
-
return
|
|
9620
|
+
return _context57.abrupt("return", campaign);
|
|
9541
9621
|
|
|
9542
9622
|
case 5:
|
|
9543
9623
|
case "end":
|
|
9544
|
-
return
|
|
9624
|
+
return _context57.stop();
|
|
9545
9625
|
}
|
|
9546
9626
|
}
|
|
9547
|
-
},
|
|
9627
|
+
}, _callee57, this);
|
|
9548
9628
|
}));
|
|
9549
9629
|
|
|
9550
|
-
function createCampaign(
|
|
9630
|
+
function createCampaign(_x77) {
|
|
9551
9631
|
return _createCampaign.apply(this, arguments);
|
|
9552
9632
|
}
|
|
9553
9633
|
|
|
@@ -9564,30 +9644,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9564
9644
|
}, {
|
|
9565
9645
|
key: "getCampaign",
|
|
9566
9646
|
value: function () {
|
|
9567
|
-
var _getCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9647
|
+
var _getCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee58(id) {
|
|
9568
9648
|
var _yield$this$get3, campaign;
|
|
9569
9649
|
|
|
9570
|
-
return _regeneratorRuntime.wrap(function
|
|
9650
|
+
return _regeneratorRuntime.wrap(function _callee58$(_context58) {
|
|
9571
9651
|
while (1) {
|
|
9572
|
-
switch (
|
|
9652
|
+
switch (_context58.prev = _context58.next) {
|
|
9573
9653
|
case 0:
|
|
9574
|
-
|
|
9654
|
+
_context58.next = 2;
|
|
9575
9655
|
return this.get(this.baseURL + "/campaigns/".concat(id));
|
|
9576
9656
|
|
|
9577
9657
|
case 2:
|
|
9578
|
-
_yield$this$get3 =
|
|
9658
|
+
_yield$this$get3 = _context58.sent;
|
|
9579
9659
|
campaign = _yield$this$get3.campaign;
|
|
9580
|
-
return
|
|
9660
|
+
return _context58.abrupt("return", campaign);
|
|
9581
9661
|
|
|
9582
9662
|
case 5:
|
|
9583
9663
|
case "end":
|
|
9584
|
-
return
|
|
9664
|
+
return _context58.stop();
|
|
9585
9665
|
}
|
|
9586
9666
|
}
|
|
9587
|
-
},
|
|
9667
|
+
}, _callee58, this);
|
|
9588
9668
|
}));
|
|
9589
9669
|
|
|
9590
|
-
function getCampaign(
|
|
9670
|
+
function getCampaign(_x78) {
|
|
9591
9671
|
return _getCampaign.apply(this, arguments);
|
|
9592
9672
|
}
|
|
9593
9673
|
|
|
@@ -9603,30 +9683,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9603
9683
|
}, {
|
|
9604
9684
|
key: "listCampaigns",
|
|
9605
9685
|
value: function () {
|
|
9606
|
-
var _listCampaigns = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9686
|
+
var _listCampaigns = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee59(options) {
|
|
9607
9687
|
var _yield$this$get4, campaigns;
|
|
9608
9688
|
|
|
9609
|
-
return _regeneratorRuntime.wrap(function
|
|
9689
|
+
return _regeneratorRuntime.wrap(function _callee59$(_context59) {
|
|
9610
9690
|
while (1) {
|
|
9611
|
-
switch (
|
|
9691
|
+
switch (_context59.prev = _context59.next) {
|
|
9612
9692
|
case 0:
|
|
9613
|
-
|
|
9693
|
+
_context59.next = 2;
|
|
9614
9694
|
return this.get(this.baseURL + "/campaigns", options);
|
|
9615
9695
|
|
|
9616
9696
|
case 2:
|
|
9617
|
-
_yield$this$get4 =
|
|
9697
|
+
_yield$this$get4 = _context59.sent;
|
|
9618
9698
|
campaigns = _yield$this$get4.campaigns;
|
|
9619
|
-
return
|
|
9699
|
+
return _context59.abrupt("return", campaigns);
|
|
9620
9700
|
|
|
9621
9701
|
case 5:
|
|
9622
9702
|
case "end":
|
|
9623
|
-
return
|
|
9703
|
+
return _context59.stop();
|
|
9624
9704
|
}
|
|
9625
9705
|
}
|
|
9626
|
-
},
|
|
9706
|
+
}, _callee59, this);
|
|
9627
9707
|
}));
|
|
9628
9708
|
|
|
9629
|
-
function listCampaigns(
|
|
9709
|
+
function listCampaigns(_x79) {
|
|
9630
9710
|
return _listCampaigns.apply(this, arguments);
|
|
9631
9711
|
}
|
|
9632
9712
|
|
|
@@ -9644,32 +9724,32 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9644
9724
|
}, {
|
|
9645
9725
|
key: "updateCampaign",
|
|
9646
9726
|
value: function () {
|
|
9647
|
-
var _updateCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9727
|
+
var _updateCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee60(id, params) {
|
|
9648
9728
|
var _yield$this$put2, campaign;
|
|
9649
9729
|
|
|
9650
|
-
return _regeneratorRuntime.wrap(function
|
|
9730
|
+
return _regeneratorRuntime.wrap(function _callee60$(_context60) {
|
|
9651
9731
|
while (1) {
|
|
9652
|
-
switch (
|
|
9732
|
+
switch (_context60.prev = _context60.next) {
|
|
9653
9733
|
case 0:
|
|
9654
|
-
|
|
9734
|
+
_context60.next = 2;
|
|
9655
9735
|
return this.put(this.baseURL + "/campaigns/".concat(id), {
|
|
9656
9736
|
campaign: params
|
|
9657
9737
|
});
|
|
9658
9738
|
|
|
9659
9739
|
case 2:
|
|
9660
|
-
_yield$this$put2 =
|
|
9740
|
+
_yield$this$put2 = _context60.sent;
|
|
9661
9741
|
campaign = _yield$this$put2.campaign;
|
|
9662
|
-
return
|
|
9742
|
+
return _context60.abrupt("return", campaign);
|
|
9663
9743
|
|
|
9664
9744
|
case 5:
|
|
9665
9745
|
case "end":
|
|
9666
|
-
return
|
|
9746
|
+
return _context60.stop();
|
|
9667
9747
|
}
|
|
9668
9748
|
}
|
|
9669
|
-
},
|
|
9749
|
+
}, _callee60, this);
|
|
9670
9750
|
}));
|
|
9671
9751
|
|
|
9672
|
-
function updateCampaign(
|
|
9752
|
+
function updateCampaign(_x80, _x81) {
|
|
9673
9753
|
return _updateCampaign.apply(this, arguments);
|
|
9674
9754
|
}
|
|
9675
9755
|
|
|
@@ -9686,22 +9766,22 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9686
9766
|
}, {
|
|
9687
9767
|
key: "deleteCampaign",
|
|
9688
9768
|
value: function () {
|
|
9689
|
-
var _deleteCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9690
|
-
return _regeneratorRuntime.wrap(function
|
|
9769
|
+
var _deleteCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee61(id) {
|
|
9770
|
+
return _regeneratorRuntime.wrap(function _callee61$(_context61) {
|
|
9691
9771
|
while (1) {
|
|
9692
|
-
switch (
|
|
9772
|
+
switch (_context61.prev = _context61.next) {
|
|
9693
9773
|
case 0:
|
|
9694
|
-
return
|
|
9774
|
+
return _context61.abrupt("return", this.delete(this.baseURL + "/campaigns/".concat(id)));
|
|
9695
9775
|
|
|
9696
9776
|
case 1:
|
|
9697
9777
|
case "end":
|
|
9698
|
-
return
|
|
9778
|
+
return _context61.stop();
|
|
9699
9779
|
}
|
|
9700
9780
|
}
|
|
9701
|
-
},
|
|
9781
|
+
}, _callee61, this);
|
|
9702
9782
|
}));
|
|
9703
9783
|
|
|
9704
|
-
function deleteCampaign(
|
|
9784
|
+
function deleteCampaign(_x82) {
|
|
9705
9785
|
return _deleteCampaign.apply(this, arguments);
|
|
9706
9786
|
}
|
|
9707
9787
|
|
|
@@ -9719,33 +9799,33 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9719
9799
|
}, {
|
|
9720
9800
|
key: "scheduleCampaign",
|
|
9721
9801
|
value: function () {
|
|
9722
|
-
var _scheduleCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9802
|
+
var _scheduleCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee62(id, params) {
|
|
9723
9803
|
var sendAt, _yield$this$patch, campaign;
|
|
9724
9804
|
|
|
9725
|
-
return _regeneratorRuntime.wrap(function
|
|
9805
|
+
return _regeneratorRuntime.wrap(function _callee62$(_context62) {
|
|
9726
9806
|
while (1) {
|
|
9727
|
-
switch (
|
|
9807
|
+
switch (_context62.prev = _context62.next) {
|
|
9728
9808
|
case 0:
|
|
9729
9809
|
sendAt = params.sendAt;
|
|
9730
|
-
|
|
9810
|
+
_context62.next = 3;
|
|
9731
9811
|
return this.patch(this.baseURL + "/campaigns/".concat(id, "/schedule"), {
|
|
9732
9812
|
send_at: sendAt
|
|
9733
9813
|
});
|
|
9734
9814
|
|
|
9735
9815
|
case 3:
|
|
9736
|
-
_yield$this$patch =
|
|
9816
|
+
_yield$this$patch = _context62.sent;
|
|
9737
9817
|
campaign = _yield$this$patch.campaign;
|
|
9738
|
-
return
|
|
9818
|
+
return _context62.abrupt("return", campaign);
|
|
9739
9819
|
|
|
9740
9820
|
case 6:
|
|
9741
9821
|
case "end":
|
|
9742
|
-
return
|
|
9822
|
+
return _context62.stop();
|
|
9743
9823
|
}
|
|
9744
9824
|
}
|
|
9745
|
-
},
|
|
9825
|
+
}, _callee62, this);
|
|
9746
9826
|
}));
|
|
9747
9827
|
|
|
9748
|
-
function scheduleCampaign(
|
|
9828
|
+
function scheduleCampaign(_x83, _x84) {
|
|
9749
9829
|
return _scheduleCampaign.apply(this, arguments);
|
|
9750
9830
|
}
|
|
9751
9831
|
|
|
@@ -9762,30 +9842,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9762
9842
|
}, {
|
|
9763
9843
|
key: "stopCampaign",
|
|
9764
9844
|
value: function () {
|
|
9765
|
-
var _stopCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9845
|
+
var _stopCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee63(id) {
|
|
9766
9846
|
var _yield$this$patch2, campaign;
|
|
9767
9847
|
|
|
9768
|
-
return _regeneratorRuntime.wrap(function
|
|
9848
|
+
return _regeneratorRuntime.wrap(function _callee63$(_context63) {
|
|
9769
9849
|
while (1) {
|
|
9770
|
-
switch (
|
|
9850
|
+
switch (_context63.prev = _context63.next) {
|
|
9771
9851
|
case 0:
|
|
9772
|
-
|
|
9852
|
+
_context63.next = 2;
|
|
9773
9853
|
return this.patch(this.baseURL + "/campaigns/".concat(id, "/stop"));
|
|
9774
9854
|
|
|
9775
9855
|
case 2:
|
|
9776
|
-
_yield$this$patch2 =
|
|
9856
|
+
_yield$this$patch2 = _context63.sent;
|
|
9777
9857
|
campaign = _yield$this$patch2.campaign;
|
|
9778
|
-
return
|
|
9858
|
+
return _context63.abrupt("return", campaign);
|
|
9779
9859
|
|
|
9780
9860
|
case 5:
|
|
9781
9861
|
case "end":
|
|
9782
|
-
return
|
|
9862
|
+
return _context63.stop();
|
|
9783
9863
|
}
|
|
9784
9864
|
}
|
|
9785
|
-
},
|
|
9865
|
+
}, _callee63, this);
|
|
9786
9866
|
}));
|
|
9787
9867
|
|
|
9788
|
-
function stopCampaign(
|
|
9868
|
+
function stopCampaign(_x85) {
|
|
9789
9869
|
return _stopCampaign.apply(this, arguments);
|
|
9790
9870
|
}
|
|
9791
9871
|
|
|
@@ -9802,30 +9882,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9802
9882
|
}, {
|
|
9803
9883
|
key: "resumeCampaign",
|
|
9804
9884
|
value: function () {
|
|
9805
|
-
var _resumeCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9885
|
+
var _resumeCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee64(id) {
|
|
9806
9886
|
var _yield$this$patch3, campaign;
|
|
9807
9887
|
|
|
9808
|
-
return _regeneratorRuntime.wrap(function
|
|
9888
|
+
return _regeneratorRuntime.wrap(function _callee64$(_context64) {
|
|
9809
9889
|
while (1) {
|
|
9810
|
-
switch (
|
|
9890
|
+
switch (_context64.prev = _context64.next) {
|
|
9811
9891
|
case 0:
|
|
9812
|
-
|
|
9892
|
+
_context64.next = 2;
|
|
9813
9893
|
return this.patch(this.baseURL + "/campaigns/".concat(id, "/resume"));
|
|
9814
9894
|
|
|
9815
9895
|
case 2:
|
|
9816
|
-
_yield$this$patch3 =
|
|
9896
|
+
_yield$this$patch3 = _context64.sent;
|
|
9817
9897
|
campaign = _yield$this$patch3.campaign;
|
|
9818
|
-
return
|
|
9898
|
+
return _context64.abrupt("return", campaign);
|
|
9819
9899
|
|
|
9820
9900
|
case 5:
|
|
9821
9901
|
case "end":
|
|
9822
|
-
return
|
|
9902
|
+
return _context64.stop();
|
|
9823
9903
|
}
|
|
9824
9904
|
}
|
|
9825
|
-
},
|
|
9905
|
+
}, _callee64, this);
|
|
9826
9906
|
}));
|
|
9827
9907
|
|
|
9828
|
-
function resumeCampaign(
|
|
9908
|
+
function resumeCampaign(_x86) {
|
|
9829
9909
|
return _resumeCampaign.apply(this, arguments);
|
|
9830
9910
|
}
|
|
9831
9911
|
|
|
@@ -9842,33 +9922,33 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9842
9922
|
}, {
|
|
9843
9923
|
key: "testCampaign",
|
|
9844
9924
|
value: function () {
|
|
9845
|
-
var _testCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9925
|
+
var _testCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee65(id, params) {
|
|
9846
9926
|
var users, _yield$this$post3, campaign;
|
|
9847
9927
|
|
|
9848
|
-
return _regeneratorRuntime.wrap(function
|
|
9928
|
+
return _regeneratorRuntime.wrap(function _callee65$(_context65) {
|
|
9849
9929
|
while (1) {
|
|
9850
|
-
switch (
|
|
9930
|
+
switch (_context65.prev = _context65.next) {
|
|
9851
9931
|
case 0:
|
|
9852
9932
|
users = params.users;
|
|
9853
|
-
|
|
9933
|
+
_context65.next = 3;
|
|
9854
9934
|
return this.post(this.baseURL + "/campaigns/".concat(id, "/test"), {
|
|
9855
9935
|
users: users
|
|
9856
9936
|
});
|
|
9857
9937
|
|
|
9858
9938
|
case 3:
|
|
9859
|
-
_yield$this$post3 =
|
|
9939
|
+
_yield$this$post3 = _context65.sent;
|
|
9860
9940
|
campaign = _yield$this$post3.campaign;
|
|
9861
|
-
return
|
|
9941
|
+
return _context65.abrupt("return", campaign);
|
|
9862
9942
|
|
|
9863
9943
|
case 6:
|
|
9864
9944
|
case "end":
|
|
9865
|
-
return
|
|
9945
|
+
return _context65.stop();
|
|
9866
9946
|
}
|
|
9867
9947
|
}
|
|
9868
|
-
},
|
|
9948
|
+
}, _callee65, this);
|
|
9869
9949
|
}));
|
|
9870
9950
|
|
|
9871
|
-
function testCampaign(
|
|
9951
|
+
function testCampaign(_x87, _x88) {
|
|
9872
9952
|
return _testCampaign.apply(this, arguments);
|
|
9873
9953
|
}
|
|
9874
9954
|
|
|
@@ -9884,24 +9964,24 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9884
9964
|
}, {
|
|
9885
9965
|
key: "enrichURL",
|
|
9886
9966
|
value: function () {
|
|
9887
|
-
var _enrichURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9888
|
-
return _regeneratorRuntime.wrap(function
|
|
9967
|
+
var _enrichURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee66(url) {
|
|
9968
|
+
return _regeneratorRuntime.wrap(function _callee66$(_context66) {
|
|
9889
9969
|
while (1) {
|
|
9890
|
-
switch (
|
|
9970
|
+
switch (_context66.prev = _context66.next) {
|
|
9891
9971
|
case 0:
|
|
9892
|
-
return
|
|
9972
|
+
return _context66.abrupt("return", this.get(this.baseURL + "/og", {
|
|
9893
9973
|
url: url
|
|
9894
9974
|
}));
|
|
9895
9975
|
|
|
9896
9976
|
case 1:
|
|
9897
9977
|
case "end":
|
|
9898
|
-
return
|
|
9978
|
+
return _context66.stop();
|
|
9899
9979
|
}
|
|
9900
9980
|
}
|
|
9901
|
-
},
|
|
9981
|
+
}, _callee66, this);
|
|
9902
9982
|
}));
|
|
9903
9983
|
|
|
9904
|
-
function enrichURL(
|
|
9984
|
+
function enrichURL(_x89) {
|
|
9905
9985
|
return _enrichURL.apply(this, arguments);
|
|
9906
9986
|
}
|
|
9907
9987
|
|
|
@@ -9918,22 +9998,22 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9918
9998
|
}, {
|
|
9919
9999
|
key: "getTask",
|
|
9920
10000
|
value: function () {
|
|
9921
|
-
var _getTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9922
|
-
return _regeneratorRuntime.wrap(function
|
|
10001
|
+
var _getTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee67(id) {
|
|
10002
|
+
return _regeneratorRuntime.wrap(function _callee67$(_context67) {
|
|
9923
10003
|
while (1) {
|
|
9924
|
-
switch (
|
|
10004
|
+
switch (_context67.prev = _context67.next) {
|
|
9925
10005
|
case 0:
|
|
9926
|
-
return
|
|
10006
|
+
return _context67.abrupt("return", this.get("".concat(this.baseURL, "/tasks/").concat(id)));
|
|
9927
10007
|
|
|
9928
10008
|
case 1:
|
|
9929
10009
|
case "end":
|
|
9930
|
-
return
|
|
10010
|
+
return _context67.stop();
|
|
9931
10011
|
}
|
|
9932
10012
|
}
|
|
9933
|
-
},
|
|
10013
|
+
}, _callee67, this);
|
|
9934
10014
|
}));
|
|
9935
10015
|
|
|
9936
|
-
function getTask(
|
|
10016
|
+
function getTask(_x90) {
|
|
9937
10017
|
return _getTask.apply(this, arguments);
|
|
9938
10018
|
}
|
|
9939
10019
|
|
|
@@ -9951,31 +10031,31 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9951
10031
|
}, {
|
|
9952
10032
|
key: "deleteChannels",
|
|
9953
10033
|
value: function () {
|
|
9954
|
-
var _deleteChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
10034
|
+
var _deleteChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee68(cids) {
|
|
9955
10035
|
var options,
|
|
9956
|
-
|
|
9957
|
-
return _regeneratorRuntime.wrap(function
|
|
10036
|
+
_args68 = arguments;
|
|
10037
|
+
return _regeneratorRuntime.wrap(function _callee68$(_context68) {
|
|
9958
10038
|
while (1) {
|
|
9959
|
-
switch (
|
|
10039
|
+
switch (_context68.prev = _context68.next) {
|
|
9960
10040
|
case 0:
|
|
9961
|
-
options =
|
|
9962
|
-
|
|
10041
|
+
options = _args68.length > 1 && _args68[1] !== undefined ? _args68[1] : {};
|
|
10042
|
+
_context68.next = 3;
|
|
9963
10043
|
return this.post(this.baseURL + "/channels/delete", _objectSpread({
|
|
9964
10044
|
cids: cids
|
|
9965
10045
|
}, options));
|
|
9966
10046
|
|
|
9967
10047
|
case 3:
|
|
9968
|
-
return
|
|
10048
|
+
return _context68.abrupt("return", _context68.sent);
|
|
9969
10049
|
|
|
9970
10050
|
case 4:
|
|
9971
10051
|
case "end":
|
|
9972
|
-
return
|
|
10052
|
+
return _context68.stop();
|
|
9973
10053
|
}
|
|
9974
10054
|
}
|
|
9975
|
-
},
|
|
10055
|
+
}, _callee68, this);
|
|
9976
10056
|
}));
|
|
9977
10057
|
|
|
9978
|
-
function deleteChannels(
|
|
10058
|
+
function deleteChannels(_x91) {
|
|
9979
10059
|
return _deleteChannels.apply(this, arguments);
|
|
9980
10060
|
}
|
|
9981
10061
|
|
|
@@ -9993,13 +10073,13 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9993
10073
|
}, {
|
|
9994
10074
|
key: "deleteUsers",
|
|
9995
10075
|
value: function () {
|
|
9996
|
-
var _deleteUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9997
|
-
return _regeneratorRuntime.wrap(function
|
|
10076
|
+
var _deleteUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee69(user_ids, options) {
|
|
10077
|
+
return _regeneratorRuntime.wrap(function _callee69$(_context69) {
|
|
9998
10078
|
while (1) {
|
|
9999
|
-
switch (
|
|
10079
|
+
switch (_context69.prev = _context69.next) {
|
|
10000
10080
|
case 0:
|
|
10001
10081
|
if (!((options === null || options === void 0 ? void 0 : options.user) !== 'soft' && (options === null || options === void 0 ? void 0 : options.user) !== 'hard')) {
|
|
10002
|
-
|
|
10082
|
+
_context69.next = 2;
|
|
10003
10083
|
break;
|
|
10004
10084
|
}
|
|
10005
10085
|
|
|
@@ -10007,7 +10087,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10007
10087
|
|
|
10008
10088
|
case 2:
|
|
10009
10089
|
if (!(options.messages !== undefined && options.messages !== 'soft' && options.messages !== 'hard')) {
|
|
10010
|
-
|
|
10090
|
+
_context69.next = 4;
|
|
10011
10091
|
break;
|
|
10012
10092
|
}
|
|
10013
10093
|
|
|
@@ -10015,35 +10095,160 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10015
10095
|
|
|
10016
10096
|
case 4:
|
|
10017
10097
|
if (!(options.conversations !== undefined && options.conversations !== 'soft' && options.conversations !== 'hard')) {
|
|
10018
|
-
|
|
10098
|
+
_context69.next = 6;
|
|
10019
10099
|
break;
|
|
10020
10100
|
}
|
|
10021
10101
|
|
|
10022
10102
|
throw new Error('Invalid delete user options. conversations must be one of [soft hard]');
|
|
10023
10103
|
|
|
10024
10104
|
case 6:
|
|
10025
|
-
|
|
10105
|
+
_context69.next = 8;
|
|
10026
10106
|
return this.post(this.baseURL + "/users/delete", _objectSpread({
|
|
10027
10107
|
user_ids: user_ids
|
|
10028
10108
|
}, options));
|
|
10029
10109
|
|
|
10030
10110
|
case 8:
|
|
10031
|
-
return
|
|
10111
|
+
return _context69.abrupt("return", _context69.sent);
|
|
10032
10112
|
|
|
10033
10113
|
case 9:
|
|
10034
10114
|
case "end":
|
|
10035
|
-
return
|
|
10115
|
+
return _context69.stop();
|
|
10036
10116
|
}
|
|
10037
10117
|
}
|
|
10038
|
-
},
|
|
10118
|
+
}, _callee69, this);
|
|
10039
10119
|
}));
|
|
10040
10120
|
|
|
10041
|
-
function deleteUsers(
|
|
10121
|
+
function deleteUsers(_x92, _x93) {
|
|
10042
10122
|
return _deleteUsers.apply(this, arguments);
|
|
10043
10123
|
}
|
|
10044
10124
|
|
|
10045
10125
|
return deleteUsers;
|
|
10046
10126
|
}()
|
|
10127
|
+
/**
|
|
10128
|
+
* _createImport - Create an Import Task.
|
|
10129
|
+
*
|
|
10130
|
+
* Note: Do not use this.
|
|
10131
|
+
* It is present for internal usage only.
|
|
10132
|
+
* This function can, and will, break and/or be removed at any point in time.
|
|
10133
|
+
*
|
|
10134
|
+
* @private
|
|
10135
|
+
* @param {string} filename filename of uploaded data
|
|
10136
|
+
*
|
|
10137
|
+
* @return {APIResponse & CreateImportResponse} An ImportTask
|
|
10138
|
+
*/
|
|
10139
|
+
|
|
10140
|
+
}, {
|
|
10141
|
+
key: "_createImport",
|
|
10142
|
+
value: function () {
|
|
10143
|
+
var _createImport2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee70(filename) {
|
|
10144
|
+
return _regeneratorRuntime.wrap(function _callee70$(_context70) {
|
|
10145
|
+
while (1) {
|
|
10146
|
+
switch (_context70.prev = _context70.next) {
|
|
10147
|
+
case 0:
|
|
10148
|
+
_context70.next = 2;
|
|
10149
|
+
return this.post(this.baseURL + "/imports", {
|
|
10150
|
+
filename: filename
|
|
10151
|
+
});
|
|
10152
|
+
|
|
10153
|
+
case 2:
|
|
10154
|
+
return _context70.abrupt("return", _context70.sent);
|
|
10155
|
+
|
|
10156
|
+
case 3:
|
|
10157
|
+
case "end":
|
|
10158
|
+
return _context70.stop();
|
|
10159
|
+
}
|
|
10160
|
+
}
|
|
10161
|
+
}, _callee70, this);
|
|
10162
|
+
}));
|
|
10163
|
+
|
|
10164
|
+
function _createImport(_x94) {
|
|
10165
|
+
return _createImport2.apply(this, arguments);
|
|
10166
|
+
}
|
|
10167
|
+
|
|
10168
|
+
return _createImport;
|
|
10169
|
+
}()
|
|
10170
|
+
/**
|
|
10171
|
+
* _getImport - Get an Import Task.
|
|
10172
|
+
*
|
|
10173
|
+
* Note: Do not use this.
|
|
10174
|
+
* It is present for internal usage only.
|
|
10175
|
+
* This function can, and will, break and/or be removed at any point in time.
|
|
10176
|
+
*
|
|
10177
|
+
* @private
|
|
10178
|
+
* @param {string} id id of Import Task
|
|
10179
|
+
*
|
|
10180
|
+
* @return {APIResponse & GetImportResponse} An ImportTask
|
|
10181
|
+
*/
|
|
10182
|
+
|
|
10183
|
+
}, {
|
|
10184
|
+
key: "_getImport",
|
|
10185
|
+
value: function () {
|
|
10186
|
+
var _getImport2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee71(id) {
|
|
10187
|
+
return _regeneratorRuntime.wrap(function _callee71$(_context71) {
|
|
10188
|
+
while (1) {
|
|
10189
|
+
switch (_context71.prev = _context71.next) {
|
|
10190
|
+
case 0:
|
|
10191
|
+
_context71.next = 2;
|
|
10192
|
+
return this.get(this.baseURL + "/imports/".concat(id));
|
|
10193
|
+
|
|
10194
|
+
case 2:
|
|
10195
|
+
return _context71.abrupt("return", _context71.sent);
|
|
10196
|
+
|
|
10197
|
+
case 3:
|
|
10198
|
+
case "end":
|
|
10199
|
+
return _context71.stop();
|
|
10200
|
+
}
|
|
10201
|
+
}
|
|
10202
|
+
}, _callee71, this);
|
|
10203
|
+
}));
|
|
10204
|
+
|
|
10205
|
+
function _getImport(_x95) {
|
|
10206
|
+
return _getImport2.apply(this, arguments);
|
|
10207
|
+
}
|
|
10208
|
+
|
|
10209
|
+
return _getImport;
|
|
10210
|
+
}()
|
|
10211
|
+
/**
|
|
10212
|
+
* _listImports - Lists Import Tasks.
|
|
10213
|
+
*
|
|
10214
|
+
* Note: Do not use this.
|
|
10215
|
+
* It is present for internal usage only.
|
|
10216
|
+
* This function can, and will, break and/or be removed at any point in time.
|
|
10217
|
+
*
|
|
10218
|
+
* @private
|
|
10219
|
+
* @param {ListImportsPaginationOptions} options pagination options
|
|
10220
|
+
*
|
|
10221
|
+
* @return {APIResponse & ListImportsResponse} An ImportTask
|
|
10222
|
+
*/
|
|
10223
|
+
|
|
10224
|
+
}, {
|
|
10225
|
+
key: "_listImports",
|
|
10226
|
+
value: function () {
|
|
10227
|
+
var _listImports2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee72(options) {
|
|
10228
|
+
return _regeneratorRuntime.wrap(function _callee72$(_context72) {
|
|
10229
|
+
while (1) {
|
|
10230
|
+
switch (_context72.prev = _context72.next) {
|
|
10231
|
+
case 0:
|
|
10232
|
+
_context72.next = 2;
|
|
10233
|
+
return this.get(this.baseURL + "/imports", options);
|
|
10234
|
+
|
|
10235
|
+
case 2:
|
|
10236
|
+
return _context72.abrupt("return", _context72.sent);
|
|
10237
|
+
|
|
10238
|
+
case 3:
|
|
10239
|
+
case "end":
|
|
10240
|
+
return _context72.stop();
|
|
10241
|
+
}
|
|
10242
|
+
}
|
|
10243
|
+
}, _callee72, this);
|
|
10244
|
+
}));
|
|
10245
|
+
|
|
10246
|
+
function _listImports(_x96) {
|
|
10247
|
+
return _listImports2.apply(this, arguments);
|
|
10248
|
+
}
|
|
10249
|
+
|
|
10250
|
+
return _listImports;
|
|
10251
|
+
}()
|
|
10047
10252
|
}], [{
|
|
10048
10253
|
key: "getInstance",
|
|
10049
10254
|
value: function getInstance(key, secretOrOptions, options) {
|