stream-chat 4.4.3-dev.3 → 4.4.3
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/dist/browser.es.js +667 -654
- 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 +667 -653
- package/dist/browser.js.map +1 -1
- package/dist/index.es.js +667 -654
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +667 -653
- package/dist/index.js.map +1 -1
- package/dist/types/client.d.ts +7 -3
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/connection.d.ts +4 -4
- package/dist/types/connection.d.ts.map +1 -1
- package/dist/types/insights.d.ts +12 -5
- package/dist/types/insights.d.ts.map +1 -1
- package/dist/types/utils.d.ts +1 -1
- package/dist/types/utils.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/client.ts +18 -30
- package/src/connection.ts +14 -12
- package/src/insights.ts +32 -18
- package/src/utils.ts +10 -5
package/dist/index.es.js
CHANGED
|
@@ -934,10 +934,17 @@ function getRandomBytes(length) {
|
|
|
934
934
|
function convertErrorToJson(err) {
|
|
935
935
|
var jsonObj = {};
|
|
936
936
|
if (!err) return jsonObj;
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
937
|
+
|
|
938
|
+
try {
|
|
939
|
+
Object.getOwnPropertyNames(err).forEach(function (key) {
|
|
940
|
+
jsonObj[key] = Object.getOwnPropertyDescriptor(err, key);
|
|
941
|
+
});
|
|
942
|
+
} catch (_) {
|
|
943
|
+
return {
|
|
944
|
+
error: 'failed to serialize the error'
|
|
945
|
+
};
|
|
946
|
+
}
|
|
947
|
+
|
|
941
948
|
return jsonObj;
|
|
942
949
|
}
|
|
943
950
|
|
|
@@ -3451,6 +3458,67 @@ var InsightMetrics = function InsightMetrics() {
|
|
|
3451
3458
|
this.wsConsecutiveFailures = 0;
|
|
3452
3459
|
this.instanceClientId = randomId();
|
|
3453
3460
|
};
|
|
3461
|
+
/**
|
|
3462
|
+
* postInsights is not supposed to be used by end users directly within chat application, and thus is kept isolated
|
|
3463
|
+
* from all the client/connection code/logic.
|
|
3464
|
+
*
|
|
3465
|
+
* @param insightType
|
|
3466
|
+
* @param insights
|
|
3467
|
+
*/
|
|
3468
|
+
|
|
3469
|
+
var postInsights = /*#__PURE__*/function () {
|
|
3470
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(insightType, insights) {
|
|
3471
|
+
var maxAttempts, i;
|
|
3472
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
3473
|
+
while (1) {
|
|
3474
|
+
switch (_context.prev = _context.next) {
|
|
3475
|
+
case 0:
|
|
3476
|
+
maxAttempts = 3;
|
|
3477
|
+
i = 0;
|
|
3478
|
+
|
|
3479
|
+
case 2:
|
|
3480
|
+
if (!(i < maxAttempts)) {
|
|
3481
|
+
_context.next = 17;
|
|
3482
|
+
break;
|
|
3483
|
+
}
|
|
3484
|
+
|
|
3485
|
+
_context.prev = 3;
|
|
3486
|
+
_context.next = 6;
|
|
3487
|
+
return axios.post("https://chat-insights.getstream.io/insights/".concat(insightType), insights);
|
|
3488
|
+
|
|
3489
|
+
case 6:
|
|
3490
|
+
_context.next = 13;
|
|
3491
|
+
break;
|
|
3492
|
+
|
|
3493
|
+
case 8:
|
|
3494
|
+
_context.prev = 8;
|
|
3495
|
+
_context.t0 = _context["catch"](3);
|
|
3496
|
+
_context.next = 12;
|
|
3497
|
+
return sleep((i + 1) * 3000);
|
|
3498
|
+
|
|
3499
|
+
case 12:
|
|
3500
|
+
return _context.abrupt("continue", 14);
|
|
3501
|
+
|
|
3502
|
+
case 13:
|
|
3503
|
+
return _context.abrupt("break", 17);
|
|
3504
|
+
|
|
3505
|
+
case 14:
|
|
3506
|
+
i++;
|
|
3507
|
+
_context.next = 2;
|
|
3508
|
+
break;
|
|
3509
|
+
|
|
3510
|
+
case 17:
|
|
3511
|
+
case "end":
|
|
3512
|
+
return _context.stop();
|
|
3513
|
+
}
|
|
3514
|
+
}
|
|
3515
|
+
}, _callee, null, [[3, 8]]);
|
|
3516
|
+
}));
|
|
3517
|
+
|
|
3518
|
+
return function postInsights(_x, _x2) {
|
|
3519
|
+
return _ref.apply(this, arguments);
|
|
3520
|
+
};
|
|
3521
|
+
}();
|
|
3454
3522
|
function buildWsFatalInsight(connection, event) {
|
|
3455
3523
|
return _objectSpread$2(_objectSpread$2({}, event), buildWsBaseInsight(connection));
|
|
3456
3524
|
}
|
|
@@ -3527,7 +3595,7 @@ var StableWSConnection = /*#__PURE__*/function () {
|
|
|
3527
3595
|
userID = _ref.userID,
|
|
3528
3596
|
wsBaseURL = _ref.wsBaseURL,
|
|
3529
3597
|
device = _ref.device,
|
|
3530
|
-
|
|
3598
|
+
enableInsights = _ref.enableInsights,
|
|
3531
3599
|
insightMetrics = _ref.insightMetrics;
|
|
3532
3600
|
|
|
3533
3601
|
_classCallCheck(this, StableWSConnection);
|
|
@@ -3594,7 +3662,7 @@ var StableWSConnection = /*#__PURE__*/function () {
|
|
|
3594
3662
|
|
|
3595
3663
|
_defineProperty(this, "wsID", void 0);
|
|
3596
3664
|
|
|
3597
|
-
_defineProperty(this, "
|
|
3665
|
+
_defineProperty(this, "enableInsights", void 0);
|
|
3598
3666
|
|
|
3599
3667
|
_defineProperty(this, "insightMetrics", void 0);
|
|
3600
3668
|
|
|
@@ -3948,7 +4016,7 @@ var StableWSConnection = /*#__PURE__*/function () {
|
|
|
3948
4016
|
|
|
3949
4017
|
this._listenForConnectionChanges();
|
|
3950
4018
|
|
|
3951
|
-
this.
|
|
4019
|
+
this.enableInsights = enableInsights;
|
|
3952
4020
|
this.insightMetrics = insightMetrics;
|
|
3953
4021
|
}
|
|
3954
4022
|
/**
|
|
@@ -4238,8 +4306,7 @@ var StableWSConnection = /*#__PURE__*/function () {
|
|
|
4238
4306
|
key: "_connect",
|
|
4239
4307
|
value: function () {
|
|
4240
4308
|
var _connect3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
4241
|
-
var wsURL, response,
|
|
4242
|
-
|
|
4309
|
+
var wsURL, response, insights;
|
|
4243
4310
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
4244
4311
|
while (1) {
|
|
4245
4312
|
switch (_context5.prev = _context5.next) {
|
|
@@ -4283,8 +4350,8 @@ var StableWSConnection = /*#__PURE__*/function () {
|
|
|
4283
4350
|
|
|
4284
4351
|
this.connectionID = response.connection_id;
|
|
4285
4352
|
|
|
4286
|
-
if (this.insightMetrics.wsConsecutiveFailures > 0 && this.
|
|
4287
|
-
|
|
4353
|
+
if (this.insightMetrics.wsConsecutiveFailures > 0 && this.enableInsights) {
|
|
4354
|
+
postInsights('ws_success_after_failure', buildWsSuccessAfterFailureInsight(this));
|
|
4288
4355
|
this.insightMetrics.wsConsecutiveFailures = 0;
|
|
4289
4356
|
}
|
|
4290
4357
|
|
|
@@ -4299,12 +4366,11 @@ var StableWSConnection = /*#__PURE__*/function () {
|
|
|
4299
4366
|
_context5.t0 = _context5["catch"](5);
|
|
4300
4367
|
this.isConnecting = false;
|
|
4301
4368
|
|
|
4302
|
-
if (this.
|
|
4369
|
+
if (this.enableInsights) {
|
|
4303
4370
|
this.insightMetrics.wsConsecutiveFailures++;
|
|
4304
|
-
this.insightMetrics.wsTotalFailures++;
|
|
4305
|
-
|
|
4371
|
+
this.insightMetrics.wsTotalFailures++;
|
|
4306
4372
|
insights = buildWsFatalInsight(this, convertErrorToJson(_context5.t0));
|
|
4307
|
-
|
|
4373
|
+
postInsights === null || postInsights === void 0 ? void 0 : postInsights('ws_fatal', insights);
|
|
4308
4374
|
}
|
|
4309
4375
|
|
|
4310
4376
|
throw _context5.t0;
|
|
@@ -5533,67 +5599,6 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
5533
5599
|
return !!_this.secret;
|
|
5534
5600
|
});
|
|
5535
5601
|
|
|
5536
|
-
_defineProperty(this, "postInsights", /*#__PURE__*/function () {
|
|
5537
|
-
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(insightType, insights) {
|
|
5538
|
-
var maxAttempts, i;
|
|
5539
|
-
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
5540
|
-
while (1) {
|
|
5541
|
-
switch (_context6.prev = _context6.next) {
|
|
5542
|
-
case 0:
|
|
5543
|
-
maxAttempts = 3;
|
|
5544
|
-
i = 0;
|
|
5545
|
-
|
|
5546
|
-
case 2:
|
|
5547
|
-
if (!(i < maxAttempts)) {
|
|
5548
|
-
_context6.next = 18;
|
|
5549
|
-
break;
|
|
5550
|
-
}
|
|
5551
|
-
|
|
5552
|
-
_context6.prev = 3;
|
|
5553
|
-
_context6.next = 6;
|
|
5554
|
-
return _this.axiosInstance.post("https://chat-insights.getstream.io/insights/".concat(insightType), insights);
|
|
5555
|
-
|
|
5556
|
-
case 6:
|
|
5557
|
-
_context6.next = 14;
|
|
5558
|
-
break;
|
|
5559
|
-
|
|
5560
|
-
case 8:
|
|
5561
|
-
_context6.prev = 8;
|
|
5562
|
-
_context6.t0 = _context6["catch"](3);
|
|
5563
|
-
|
|
5564
|
-
_this.logger('warn', "failed to send insights event ".concat(insightType), {
|
|
5565
|
-
tags: ['insights', 'connection'],
|
|
5566
|
-
error: _context6.t0,
|
|
5567
|
-
insights: insights
|
|
5568
|
-
});
|
|
5569
|
-
|
|
5570
|
-
_context6.next = 13;
|
|
5571
|
-
return sleep((i + 1) * 3000);
|
|
5572
|
-
|
|
5573
|
-
case 13:
|
|
5574
|
-
return _context6.abrupt("continue", 15);
|
|
5575
|
-
|
|
5576
|
-
case 14:
|
|
5577
|
-
return _context6.abrupt("break", 18);
|
|
5578
|
-
|
|
5579
|
-
case 15:
|
|
5580
|
-
i++;
|
|
5581
|
-
_context6.next = 2;
|
|
5582
|
-
break;
|
|
5583
|
-
|
|
5584
|
-
case 18:
|
|
5585
|
-
case "end":
|
|
5586
|
-
return _context6.stop();
|
|
5587
|
-
}
|
|
5588
|
-
}
|
|
5589
|
-
}, _callee6, null, [[3, 8]]);
|
|
5590
|
-
}));
|
|
5591
|
-
|
|
5592
|
-
return function (_x7, _x8) {
|
|
5593
|
-
return _ref6.apply(this, arguments);
|
|
5594
|
-
};
|
|
5595
|
-
}());
|
|
5596
|
-
|
|
5597
5602
|
// set the key
|
|
5598
5603
|
this.key = _key;
|
|
5599
5604
|
this.listeners = {};
|
|
@@ -5798,32 +5803,32 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
5798
5803
|
}
|
|
5799
5804
|
*/
|
|
5800
5805
|
function () {
|
|
5801
|
-
var _updateAppSettings = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
5806
|
+
var _updateAppSettings = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(options) {
|
|
5802
5807
|
var _options$apn_config;
|
|
5803
5808
|
|
|
5804
|
-
return _regeneratorRuntime.wrap(function
|
|
5809
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
5805
5810
|
while (1) {
|
|
5806
|
-
switch (
|
|
5811
|
+
switch (_context6.prev = _context6.next) {
|
|
5807
5812
|
case 0:
|
|
5808
5813
|
if ((_options$apn_config = options.apn_config) !== null && _options$apn_config !== void 0 && _options$apn_config.p12_cert) {
|
|
5809
5814
|
options.apn_config.p12_cert = Buffer.from(options.apn_config.p12_cert).toString('base64');
|
|
5810
5815
|
}
|
|
5811
5816
|
|
|
5812
|
-
|
|
5817
|
+
_context6.next = 3;
|
|
5813
5818
|
return this.patch(this.baseURL + '/app', options);
|
|
5814
5819
|
|
|
5815
5820
|
case 3:
|
|
5816
|
-
return
|
|
5821
|
+
return _context6.abrupt("return", _context6.sent);
|
|
5817
5822
|
|
|
5818
5823
|
case 4:
|
|
5819
5824
|
case "end":
|
|
5820
|
-
return
|
|
5825
|
+
return _context6.stop();
|
|
5821
5826
|
}
|
|
5822
5827
|
}
|
|
5823
|
-
},
|
|
5828
|
+
}, _callee6, this);
|
|
5824
5829
|
}));
|
|
5825
5830
|
|
|
5826
|
-
function updateAppSettings(
|
|
5831
|
+
function updateAppSettings(_x7) {
|
|
5827
5832
|
return _updateAppSettings.apply(this, arguments);
|
|
5828
5833
|
}
|
|
5829
5834
|
|
|
@@ -5836,28 +5841,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
5836
5841
|
* Revokes all tokens on application level issued before given time
|
|
5837
5842
|
*/
|
|
5838
5843
|
function () {
|
|
5839
|
-
var _revokeTokens = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
5840
|
-
return _regeneratorRuntime.wrap(function
|
|
5844
|
+
var _revokeTokens = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(before) {
|
|
5845
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
5841
5846
|
while (1) {
|
|
5842
|
-
switch (
|
|
5847
|
+
switch (_context7.prev = _context7.next) {
|
|
5843
5848
|
case 0:
|
|
5844
|
-
|
|
5849
|
+
_context7.next = 2;
|
|
5845
5850
|
return this.updateAppSettings({
|
|
5846
5851
|
revoke_tokens_issued_before: this._normalizeDate(before)
|
|
5847
5852
|
});
|
|
5848
5853
|
|
|
5849
5854
|
case 2:
|
|
5850
|
-
return
|
|
5855
|
+
return _context7.abrupt("return", _context7.sent);
|
|
5851
5856
|
|
|
5852
5857
|
case 3:
|
|
5853
5858
|
case "end":
|
|
5854
|
-
return
|
|
5859
|
+
return _context7.stop();
|
|
5855
5860
|
}
|
|
5856
5861
|
}
|
|
5857
|
-
},
|
|
5862
|
+
}, _callee7, this);
|
|
5858
5863
|
}));
|
|
5859
5864
|
|
|
5860
|
-
function revokeTokens(
|
|
5865
|
+
function revokeTokens(_x8) {
|
|
5861
5866
|
return _revokeTokens.apply(this, arguments);
|
|
5862
5867
|
}
|
|
5863
5868
|
|
|
@@ -5870,26 +5875,26 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
5870
5875
|
}, {
|
|
5871
5876
|
key: "revokeUserToken",
|
|
5872
5877
|
value: function () {
|
|
5873
|
-
var _revokeUserToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
5874
|
-
return _regeneratorRuntime.wrap(function
|
|
5878
|
+
var _revokeUserToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(userID, before) {
|
|
5879
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
5875
5880
|
while (1) {
|
|
5876
|
-
switch (
|
|
5881
|
+
switch (_context8.prev = _context8.next) {
|
|
5877
5882
|
case 0:
|
|
5878
|
-
|
|
5883
|
+
_context8.next = 2;
|
|
5879
5884
|
return this.revokeUsersToken([userID], before);
|
|
5880
5885
|
|
|
5881
5886
|
case 2:
|
|
5882
|
-
return
|
|
5887
|
+
return _context8.abrupt("return", _context8.sent);
|
|
5883
5888
|
|
|
5884
5889
|
case 3:
|
|
5885
5890
|
case "end":
|
|
5886
|
-
return
|
|
5891
|
+
return _context8.stop();
|
|
5887
5892
|
}
|
|
5888
5893
|
}
|
|
5889
|
-
},
|
|
5894
|
+
}, _callee8, this);
|
|
5890
5895
|
}));
|
|
5891
5896
|
|
|
5892
|
-
function revokeUserToken(
|
|
5897
|
+
function revokeUserToken(_x9, _x10) {
|
|
5893
5898
|
return _revokeUserToken.apply(this, arguments);
|
|
5894
5899
|
}
|
|
5895
5900
|
|
|
@@ -5902,12 +5907,12 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
5902
5907
|
}, {
|
|
5903
5908
|
key: "revokeUsersToken",
|
|
5904
5909
|
value: function () {
|
|
5905
|
-
var _revokeUsersToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
5910
|
+
var _revokeUsersToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(userIDs, before) {
|
|
5906
5911
|
var users, _iterator, _step, userID;
|
|
5907
5912
|
|
|
5908
|
-
return _regeneratorRuntime.wrap(function
|
|
5913
|
+
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
5909
5914
|
while (1) {
|
|
5910
|
-
switch (
|
|
5915
|
+
switch (_context9.prev = _context9.next) {
|
|
5911
5916
|
case 0:
|
|
5912
5917
|
if (before === undefined) {
|
|
5913
5918
|
before = new Date().toISOString();
|
|
@@ -5934,21 +5939,21 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
5934
5939
|
_iterator.f();
|
|
5935
5940
|
}
|
|
5936
5941
|
|
|
5937
|
-
|
|
5942
|
+
_context9.next = 6;
|
|
5938
5943
|
return this.partialUpdateUsers(users);
|
|
5939
5944
|
|
|
5940
5945
|
case 6:
|
|
5941
|
-
return
|
|
5946
|
+
return _context9.abrupt("return", _context9.sent);
|
|
5942
5947
|
|
|
5943
5948
|
case 7:
|
|
5944
5949
|
case "end":
|
|
5945
|
-
return
|
|
5950
|
+
return _context9.stop();
|
|
5946
5951
|
}
|
|
5947
5952
|
}
|
|
5948
|
-
},
|
|
5953
|
+
}, _callee9, this);
|
|
5949
5954
|
}));
|
|
5950
5955
|
|
|
5951
|
-
function revokeUsersToken(
|
|
5956
|
+
function revokeUsersToken(_x11, _x12) {
|
|
5952
5957
|
return _revokeUsersToken.apply(this, arguments);
|
|
5953
5958
|
}
|
|
5954
5959
|
|
|
@@ -5961,23 +5966,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
5961
5966
|
}, {
|
|
5962
5967
|
key: "getAppSettings",
|
|
5963
5968
|
value: function () {
|
|
5964
|
-
var _getAppSettings = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
5965
|
-
return _regeneratorRuntime.wrap(function
|
|
5969
|
+
var _getAppSettings = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
|
|
5970
|
+
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
5966
5971
|
while (1) {
|
|
5967
|
-
switch (
|
|
5972
|
+
switch (_context10.prev = _context10.next) {
|
|
5968
5973
|
case 0:
|
|
5969
|
-
|
|
5974
|
+
_context10.next = 2;
|
|
5970
5975
|
return this.get(this.baseURL + '/app');
|
|
5971
5976
|
|
|
5972
5977
|
case 2:
|
|
5973
|
-
return
|
|
5978
|
+
return _context10.abrupt("return", _context10.sent);
|
|
5974
5979
|
|
|
5975
5980
|
case 3:
|
|
5976
5981
|
case "end":
|
|
5977
|
-
return
|
|
5982
|
+
return _context10.stop();
|
|
5978
5983
|
}
|
|
5979
5984
|
}
|
|
5980
|
-
},
|
|
5985
|
+
}, _callee10, this);
|
|
5981
5986
|
}));
|
|
5982
5987
|
|
|
5983
5988
|
function getAppSettings() {
|
|
@@ -6004,15 +6009,15 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6004
6009
|
}, {
|
|
6005
6010
|
key: "testPushSettings",
|
|
6006
6011
|
value: function () {
|
|
6007
|
-
var _testPushSettings = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6012
|
+
var _testPushSettings = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(userID) {
|
|
6008
6013
|
var data,
|
|
6009
|
-
|
|
6010
|
-
return _regeneratorRuntime.wrap(function
|
|
6014
|
+
_args11 = arguments;
|
|
6015
|
+
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
6011
6016
|
while (1) {
|
|
6012
|
-
switch (
|
|
6017
|
+
switch (_context11.prev = _context11.next) {
|
|
6013
6018
|
case 0:
|
|
6014
|
-
data =
|
|
6015
|
-
|
|
6019
|
+
data = _args11.length > 1 && _args11[1] !== undefined ? _args11[1] : {};
|
|
6020
|
+
_context11.next = 3;
|
|
6016
6021
|
return this.post(this.baseURL + '/check_push', _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
6017
6022
|
user_id: userID
|
|
6018
6023
|
}, data.messageID ? {
|
|
@@ -6030,17 +6035,17 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6030
6035
|
} : {}));
|
|
6031
6036
|
|
|
6032
6037
|
case 3:
|
|
6033
|
-
return
|
|
6038
|
+
return _context11.abrupt("return", _context11.sent);
|
|
6034
6039
|
|
|
6035
6040
|
case 4:
|
|
6036
6041
|
case "end":
|
|
6037
|
-
return
|
|
6042
|
+
return _context11.stop();
|
|
6038
6043
|
}
|
|
6039
6044
|
}
|
|
6040
|
-
},
|
|
6045
|
+
}, _callee11, this);
|
|
6041
6046
|
}));
|
|
6042
6047
|
|
|
6043
|
-
function testPushSettings(
|
|
6048
|
+
function testPushSettings(_x13) {
|
|
6044
6049
|
return _testPushSettings.apply(this, arguments);
|
|
6045
6050
|
}
|
|
6046
6051
|
|
|
@@ -6060,26 +6065,26 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6060
6065
|
}, {
|
|
6061
6066
|
key: "testSQSSettings",
|
|
6062
6067
|
value: function () {
|
|
6063
|
-
var _testSQSSettings = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6068
|
+
var _testSQSSettings = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
|
|
6064
6069
|
var data,
|
|
6065
|
-
|
|
6066
|
-
return _regeneratorRuntime.wrap(function
|
|
6070
|
+
_args12 = arguments;
|
|
6071
|
+
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
6067
6072
|
while (1) {
|
|
6068
|
-
switch (
|
|
6073
|
+
switch (_context12.prev = _context12.next) {
|
|
6069
6074
|
case 0:
|
|
6070
|
-
data =
|
|
6071
|
-
|
|
6075
|
+
data = _args12.length > 0 && _args12[0] !== undefined ? _args12[0] : {};
|
|
6076
|
+
_context12.next = 3;
|
|
6072
6077
|
return this.post(this.baseURL + '/check_sqs', data);
|
|
6073
6078
|
|
|
6074
6079
|
case 3:
|
|
6075
|
-
return
|
|
6080
|
+
return _context12.abrupt("return", _context12.sent);
|
|
6076
6081
|
|
|
6077
6082
|
case 4:
|
|
6078
6083
|
case "end":
|
|
6079
|
-
return
|
|
6084
|
+
return _context12.stop();
|
|
6080
6085
|
}
|
|
6081
6086
|
}
|
|
6082
|
-
},
|
|
6087
|
+
}, _callee12, this);
|
|
6083
6088
|
}));
|
|
6084
6089
|
|
|
6085
6090
|
function testSQSSettings() {
|
|
@@ -6106,50 +6111,50 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6106
6111
|
* @return {ConnectAPIResponse<ChannelType, CommandType, UserType>} Returns a promise that resolves when the connection is setup
|
|
6107
6112
|
*/
|
|
6108
6113
|
function () {
|
|
6109
|
-
var _setGuestUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6114
|
+
var _setGuestUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(user) {
|
|
6110
6115
|
var response, _response$user, guestUser;
|
|
6111
6116
|
|
|
6112
|
-
return _regeneratorRuntime.wrap(function
|
|
6117
|
+
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
6113
6118
|
while (1) {
|
|
6114
|
-
switch (
|
|
6119
|
+
switch (_context13.prev = _context13.next) {
|
|
6115
6120
|
case 0:
|
|
6116
6121
|
this.anonymous = true;
|
|
6117
|
-
|
|
6118
|
-
|
|
6122
|
+
_context13.prev = 1;
|
|
6123
|
+
_context13.next = 4;
|
|
6119
6124
|
return this.post(this.baseURL + '/guest', {
|
|
6120
6125
|
user: user
|
|
6121
6126
|
});
|
|
6122
6127
|
|
|
6123
6128
|
case 4:
|
|
6124
|
-
response =
|
|
6125
|
-
|
|
6129
|
+
response = _context13.sent;
|
|
6130
|
+
_context13.next = 11;
|
|
6126
6131
|
break;
|
|
6127
6132
|
|
|
6128
6133
|
case 7:
|
|
6129
|
-
|
|
6130
|
-
|
|
6134
|
+
_context13.prev = 7;
|
|
6135
|
+
_context13.t0 = _context13["catch"](1);
|
|
6131
6136
|
this.anonymous = false;
|
|
6132
|
-
throw
|
|
6137
|
+
throw _context13.t0;
|
|
6133
6138
|
|
|
6134
6139
|
case 11:
|
|
6135
6140
|
this.anonymous = false; // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6136
6141
|
|
|
6137
6142
|
_response$user = response.user, _response$user.created_at, _response$user.updated_at, _response$user.last_active, _response$user.online, guestUser = _objectWithoutProperties(_response$user, ["created_at", "updated_at", "last_active", "online"]);
|
|
6138
|
-
|
|
6143
|
+
_context13.next = 15;
|
|
6139
6144
|
return this.connectUser(guestUser, response.access_token);
|
|
6140
6145
|
|
|
6141
6146
|
case 15:
|
|
6142
|
-
return
|
|
6147
|
+
return _context13.abrupt("return", _context13.sent);
|
|
6143
6148
|
|
|
6144
6149
|
case 16:
|
|
6145
6150
|
case "end":
|
|
6146
|
-
return
|
|
6151
|
+
return _context13.stop();
|
|
6147
6152
|
}
|
|
6148
6153
|
}
|
|
6149
|
-
},
|
|
6154
|
+
}, _callee13, this, [[1, 7]]);
|
|
6150
6155
|
}));
|
|
6151
6156
|
|
|
6152
|
-
function setGuestUser(
|
|
6157
|
+
function setGuestUser(_x14) {
|
|
6153
6158
|
return _setGuestUser.apply(this, arguments);
|
|
6154
6159
|
}
|
|
6155
6160
|
|
|
@@ -6459,17 +6464,17 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6459
6464
|
* @private
|
|
6460
6465
|
*/
|
|
6461
6466
|
function () {
|
|
6462
|
-
var _connect = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6467
|
+
var _connect = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
|
|
6463
6468
|
var client;
|
|
6464
|
-
return _regeneratorRuntime.wrap(function
|
|
6469
|
+
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
6465
6470
|
while (1) {
|
|
6466
|
-
switch (
|
|
6471
|
+
switch (_context14.prev = _context14.next) {
|
|
6467
6472
|
case 0:
|
|
6468
6473
|
client = this;
|
|
6469
6474
|
this.failures = 0;
|
|
6470
6475
|
|
|
6471
6476
|
if (!(client.userID == null || this._user == null)) {
|
|
6472
|
-
|
|
6477
|
+
_context14.next = 4;
|
|
6473
6478
|
break;
|
|
6474
6479
|
}
|
|
6475
6480
|
|
|
@@ -6477,7 +6482,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6477
6482
|
|
|
6478
6483
|
case 4:
|
|
6479
6484
|
if (!(client.wsBaseURL == null)) {
|
|
6480
|
-
|
|
6485
|
+
_context14.next = 6;
|
|
6481
6486
|
break;
|
|
6482
6487
|
}
|
|
6483
6488
|
|
|
@@ -6485,7 +6490,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6485
6490
|
|
|
6486
6491
|
case 6:
|
|
6487
6492
|
if (!(client.clientID == null)) {
|
|
6488
|
-
|
|
6493
|
+
_context14.next = 8;
|
|
6489
6494
|
break;
|
|
6490
6495
|
}
|
|
6491
6496
|
|
|
@@ -6493,12 +6498,13 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6493
6498
|
|
|
6494
6499
|
case 8:
|
|
6495
6500
|
if (!this.wsConnection && (this.options.warmUp || this.options.enableInsights)) {
|
|
6496
|
-
this.
|
|
6501
|
+
this._sayHi();
|
|
6497
6502
|
} // The StableWSConnection handles all the reconnection logic.
|
|
6498
6503
|
|
|
6499
6504
|
|
|
6500
6505
|
this.wsConnection = new StableWSConnection({
|
|
6501
6506
|
wsBaseURL: client.wsBaseURL,
|
|
6507
|
+
enableInsights: this.options.enableInsights,
|
|
6502
6508
|
clientID: client.clientID,
|
|
6503
6509
|
userID: client.userID,
|
|
6504
6510
|
tokenManager: client.tokenManager,
|
|
@@ -6511,21 +6517,20 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6511
6517
|
eventCallback: this.dispatchEvent,
|
|
6512
6518
|
logger: this.logger,
|
|
6513
6519
|
device: this.options.device,
|
|
6514
|
-
postInsights: this.options.enableInsights ? this.postInsights : undefined,
|
|
6515
6520
|
insightMetrics: this.insightMetrics
|
|
6516
6521
|
});
|
|
6517
|
-
|
|
6522
|
+
_context14.next = 12;
|
|
6518
6523
|
return this.wsConnection.connect();
|
|
6519
6524
|
|
|
6520
6525
|
case 12:
|
|
6521
|
-
return
|
|
6526
|
+
return _context14.abrupt("return", _context14.sent);
|
|
6522
6527
|
|
|
6523
6528
|
case 13:
|
|
6524
6529
|
case "end":
|
|
6525
|
-
return
|
|
6530
|
+
return _context14.stop();
|
|
6526
6531
|
}
|
|
6527
6532
|
}
|
|
6528
|
-
},
|
|
6533
|
+
}, _callee14, this);
|
|
6529
6534
|
}));
|
|
6530
6535
|
|
|
6531
6536
|
function connect() {
|
|
@@ -6534,9 +6539,15 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6534
6539
|
|
|
6535
6540
|
return connect;
|
|
6536
6541
|
}()
|
|
6542
|
+
/**
|
|
6543
|
+
* Check the connectivity with server for warmup purpose.
|
|
6544
|
+
*
|
|
6545
|
+
* @private
|
|
6546
|
+
*/
|
|
6547
|
+
|
|
6537
6548
|
}, {
|
|
6538
|
-
key: "
|
|
6539
|
-
value: function
|
|
6549
|
+
key: "_sayHi",
|
|
6550
|
+
value: function _sayHi() {
|
|
6540
6551
|
var _this4 = this;
|
|
6541
6552
|
|
|
6542
6553
|
var client_request_id = randomId();
|
|
@@ -6546,11 +6557,13 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6546
6557
|
}
|
|
6547
6558
|
};
|
|
6548
6559
|
this.doAxiosRequest('get', this.baseURL + '/hi', null, opts).catch(function (e) {
|
|
6549
|
-
_this4.
|
|
6550
|
-
|
|
6551
|
-
|
|
6552
|
-
|
|
6553
|
-
|
|
6560
|
+
if (_this4.options.enableInsights) {
|
|
6561
|
+
postInsights('http_hi_failed', {
|
|
6562
|
+
api_key: _this4.key,
|
|
6563
|
+
err: e,
|
|
6564
|
+
client_request_id: client_request_id
|
|
6565
|
+
});
|
|
6566
|
+
}
|
|
6554
6567
|
});
|
|
6555
6568
|
}
|
|
6556
6569
|
/**
|
|
@@ -6567,23 +6580,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6567
6580
|
}, {
|
|
6568
6581
|
key: "queryUsers",
|
|
6569
6582
|
value: function () {
|
|
6570
|
-
var _queryUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6583
|
+
var _queryUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(filterConditions) {
|
|
6571
6584
|
var sort,
|
|
6572
6585
|
options,
|
|
6573
6586
|
defaultOptions,
|
|
6574
6587
|
data,
|
|
6575
|
-
|
|
6576
|
-
return _regeneratorRuntime.wrap(function
|
|
6588
|
+
_args15 = arguments;
|
|
6589
|
+
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
|
6577
6590
|
while (1) {
|
|
6578
|
-
switch (
|
|
6591
|
+
switch (_context15.prev = _context15.next) {
|
|
6579
6592
|
case 0:
|
|
6580
|
-
sort =
|
|
6581
|
-
options =
|
|
6593
|
+
sort = _args15.length > 1 && _args15[1] !== undefined ? _args15[1] : [];
|
|
6594
|
+
options = _args15.length > 2 && _args15[2] !== undefined ? _args15[2] : {};
|
|
6582
6595
|
defaultOptions = {
|
|
6583
6596
|
presence: false
|
|
6584
6597
|
}; // Make sure we wait for the connect promise if there is a pending one
|
|
6585
6598
|
|
|
6586
|
-
|
|
6599
|
+
_context15.next = 5;
|
|
6587
6600
|
return this.setUserPromise;
|
|
6588
6601
|
|
|
6589
6602
|
case 5:
|
|
@@ -6592,7 +6605,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6592
6605
|
} // Return a list of users
|
|
6593
6606
|
|
|
6594
6607
|
|
|
6595
|
-
|
|
6608
|
+
_context15.next = 8;
|
|
6596
6609
|
return this.get(this.baseURL + '/users', {
|
|
6597
6610
|
payload: _objectSpread(_objectSpread({
|
|
6598
6611
|
filter_conditions: filterConditions,
|
|
@@ -6601,19 +6614,19 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6601
6614
|
});
|
|
6602
6615
|
|
|
6603
6616
|
case 8:
|
|
6604
|
-
data =
|
|
6617
|
+
data = _context15.sent;
|
|
6605
6618
|
this.state.updateUsers(data.users);
|
|
6606
|
-
return
|
|
6619
|
+
return _context15.abrupt("return", data);
|
|
6607
6620
|
|
|
6608
6621
|
case 11:
|
|
6609
6622
|
case "end":
|
|
6610
|
-
return
|
|
6623
|
+
return _context15.stop();
|
|
6611
6624
|
}
|
|
6612
6625
|
}
|
|
6613
|
-
},
|
|
6626
|
+
}, _callee15, this);
|
|
6614
6627
|
}));
|
|
6615
6628
|
|
|
6616
|
-
function queryUsers(
|
|
6629
|
+
function queryUsers(_x15) {
|
|
6617
6630
|
return _queryUsers.apply(this, arguments);
|
|
6618
6631
|
}
|
|
6619
6632
|
|
|
@@ -6632,19 +6645,19 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6632
6645
|
}, {
|
|
6633
6646
|
key: "queryBannedUsers",
|
|
6634
6647
|
value: function () {
|
|
6635
|
-
var _queryBannedUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6648
|
+
var _queryBannedUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16() {
|
|
6636
6649
|
var filterConditions,
|
|
6637
6650
|
sort,
|
|
6638
6651
|
options,
|
|
6639
|
-
|
|
6640
|
-
return _regeneratorRuntime.wrap(function
|
|
6652
|
+
_args16 = arguments;
|
|
6653
|
+
return _regeneratorRuntime.wrap(function _callee16$(_context16) {
|
|
6641
6654
|
while (1) {
|
|
6642
|
-
switch (
|
|
6655
|
+
switch (_context16.prev = _context16.next) {
|
|
6643
6656
|
case 0:
|
|
6644
|
-
filterConditions =
|
|
6645
|
-
sort =
|
|
6646
|
-
options =
|
|
6647
|
-
|
|
6657
|
+
filterConditions = _args16.length > 0 && _args16[0] !== undefined ? _args16[0] : {};
|
|
6658
|
+
sort = _args16.length > 1 && _args16[1] !== undefined ? _args16[1] : [];
|
|
6659
|
+
options = _args16.length > 2 && _args16[2] !== undefined ? _args16[2] : {};
|
|
6660
|
+
_context16.next = 5;
|
|
6648
6661
|
return this.get(this.baseURL + '/query_banned_users', {
|
|
6649
6662
|
payload: _objectSpread({
|
|
6650
6663
|
filter_conditions: filterConditions,
|
|
@@ -6653,14 +6666,14 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6653
6666
|
});
|
|
6654
6667
|
|
|
6655
6668
|
case 5:
|
|
6656
|
-
return
|
|
6669
|
+
return _context16.abrupt("return", _context16.sent);
|
|
6657
6670
|
|
|
6658
6671
|
case 6:
|
|
6659
6672
|
case "end":
|
|
6660
|
-
return
|
|
6673
|
+
return _context16.stop();
|
|
6661
6674
|
}
|
|
6662
6675
|
}
|
|
6663
|
-
},
|
|
6676
|
+
}, _callee16, this);
|
|
6664
6677
|
}));
|
|
6665
6678
|
|
|
6666
6679
|
function queryBannedUsers() {
|
|
@@ -6681,17 +6694,17 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6681
6694
|
}, {
|
|
6682
6695
|
key: "queryMessageFlags",
|
|
6683
6696
|
value: function () {
|
|
6684
|
-
var _queryMessageFlags = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6697
|
+
var _queryMessageFlags = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17() {
|
|
6685
6698
|
var filterConditions,
|
|
6686
6699
|
options,
|
|
6687
|
-
|
|
6688
|
-
return _regeneratorRuntime.wrap(function
|
|
6700
|
+
_args17 = arguments;
|
|
6701
|
+
return _regeneratorRuntime.wrap(function _callee17$(_context17) {
|
|
6689
6702
|
while (1) {
|
|
6690
|
-
switch (
|
|
6703
|
+
switch (_context17.prev = _context17.next) {
|
|
6691
6704
|
case 0:
|
|
6692
|
-
filterConditions =
|
|
6693
|
-
options =
|
|
6694
|
-
|
|
6705
|
+
filterConditions = _args17.length > 0 && _args17[0] !== undefined ? _args17[0] : {};
|
|
6706
|
+
options = _args17.length > 1 && _args17[1] !== undefined ? _args17[1] : {};
|
|
6707
|
+
_context17.next = 4;
|
|
6695
6708
|
return this.get(this.baseURL + '/moderation/flags/message', {
|
|
6696
6709
|
payload: _objectSpread({
|
|
6697
6710
|
filter_conditions: filterConditions
|
|
@@ -6699,14 +6712,14 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6699
6712
|
});
|
|
6700
6713
|
|
|
6701
6714
|
case 4:
|
|
6702
|
-
return
|
|
6715
|
+
return _context17.abrupt("return", _context17.sent);
|
|
6703
6716
|
|
|
6704
6717
|
case 5:
|
|
6705
6718
|
case "end":
|
|
6706
|
-
return
|
|
6719
|
+
return _context17.stop();
|
|
6707
6720
|
}
|
|
6708
6721
|
}
|
|
6709
|
-
},
|
|
6722
|
+
}, _callee17, this);
|
|
6710
6723
|
}));
|
|
6711
6724
|
|
|
6712
6725
|
function queryMessageFlags() {
|
|
@@ -6731,7 +6744,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6731
6744
|
}, {
|
|
6732
6745
|
key: "queryChannels",
|
|
6733
6746
|
value: function () {
|
|
6734
|
-
var _queryChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6747
|
+
var _queryChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18(filterConditions) {
|
|
6735
6748
|
var sort,
|
|
6736
6749
|
options,
|
|
6737
6750
|
stateOptions,
|
|
@@ -6747,15 +6760,15 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6747
6760
|
_step3,
|
|
6748
6761
|
_channelState,
|
|
6749
6762
|
c,
|
|
6750
|
-
|
|
6763
|
+
_args18 = arguments;
|
|
6751
6764
|
|
|
6752
|
-
return _regeneratorRuntime.wrap(function
|
|
6765
|
+
return _regeneratorRuntime.wrap(function _callee18$(_context18) {
|
|
6753
6766
|
while (1) {
|
|
6754
|
-
switch (
|
|
6767
|
+
switch (_context18.prev = _context18.next) {
|
|
6755
6768
|
case 0:
|
|
6756
|
-
sort =
|
|
6757
|
-
options =
|
|
6758
|
-
stateOptions =
|
|
6769
|
+
sort = _args18.length > 1 && _args18[1] !== undefined ? _args18[1] : [];
|
|
6770
|
+
options = _args18.length > 2 && _args18[2] !== undefined ? _args18[2] : {};
|
|
6771
|
+
stateOptions = _args18.length > 3 && _args18[3] !== undefined ? _args18[3] : {};
|
|
6759
6772
|
skipInitialization = stateOptions.skipInitialization;
|
|
6760
6773
|
defaultOptions = {
|
|
6761
6774
|
state: true,
|
|
@@ -6763,7 +6776,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6763
6776
|
presence: false
|
|
6764
6777
|
}; // Make sure we wait for the connect promise if there is a pending one
|
|
6765
6778
|
|
|
6766
|
-
|
|
6779
|
+
_context18.next = 7;
|
|
6767
6780
|
return this.setUserPromise;
|
|
6768
6781
|
|
|
6769
6782
|
case 7:
|
|
@@ -6776,11 +6789,11 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6776
6789
|
filter_conditions: filterConditions,
|
|
6777
6790
|
sort: normalizeQuerySort(sort)
|
|
6778
6791
|
}, defaultOptions), options);
|
|
6779
|
-
|
|
6792
|
+
_context18.next = 11;
|
|
6780
6793
|
return this.post(this.baseURL + '/channels', payload);
|
|
6781
6794
|
|
|
6782
6795
|
case 11:
|
|
6783
|
-
data =
|
|
6796
|
+
data = _context18.sent;
|
|
6784
6797
|
channels = []; // update our cache of the configs
|
|
6785
6798
|
|
|
6786
6799
|
_iterator2 = _createForOfIteratorHelper(data.channels);
|
|
@@ -6822,17 +6835,17 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6822
6835
|
_iterator3.f();
|
|
6823
6836
|
}
|
|
6824
6837
|
|
|
6825
|
-
return
|
|
6838
|
+
return _context18.abrupt("return", channels);
|
|
6826
6839
|
|
|
6827
6840
|
case 18:
|
|
6828
6841
|
case "end":
|
|
6829
|
-
return
|
|
6842
|
+
return _context18.stop();
|
|
6830
6843
|
}
|
|
6831
6844
|
}
|
|
6832
|
-
},
|
|
6845
|
+
}, _callee18, this);
|
|
6833
6846
|
}));
|
|
6834
6847
|
|
|
6835
|
-
function queryChannels(
|
|
6848
|
+
function queryChannels(_x16) {
|
|
6836
6849
|
return _queryChannels.apply(this, arguments);
|
|
6837
6850
|
}
|
|
6838
6851
|
|
|
@@ -6851,18 +6864,18 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6851
6864
|
}, {
|
|
6852
6865
|
key: "search",
|
|
6853
6866
|
value: function () {
|
|
6854
|
-
var _search = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6867
|
+
var _search = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(filterConditions, query) {
|
|
6855
6868
|
var options,
|
|
6856
6869
|
payload,
|
|
6857
|
-
|
|
6858
|
-
return _regeneratorRuntime.wrap(function
|
|
6870
|
+
_args19 = arguments;
|
|
6871
|
+
return _regeneratorRuntime.wrap(function _callee19$(_context19) {
|
|
6859
6872
|
while (1) {
|
|
6860
|
-
switch (
|
|
6873
|
+
switch (_context19.prev = _context19.next) {
|
|
6861
6874
|
case 0:
|
|
6862
|
-
options =
|
|
6875
|
+
options = _args19.length > 2 && _args19[2] !== undefined ? _args19[2] : {};
|
|
6863
6876
|
|
|
6864
6877
|
if (!(options.offset && (options.sort || options.next))) {
|
|
6865
|
-
|
|
6878
|
+
_context19.next = 3;
|
|
6866
6879
|
break;
|
|
6867
6880
|
}
|
|
6868
6881
|
|
|
@@ -6876,49 +6889,49 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6876
6889
|
});
|
|
6877
6890
|
|
|
6878
6891
|
if (!(typeof query === 'string')) {
|
|
6879
|
-
|
|
6892
|
+
_context19.next = 8;
|
|
6880
6893
|
break;
|
|
6881
6894
|
}
|
|
6882
6895
|
|
|
6883
6896
|
payload.query = query;
|
|
6884
|
-
|
|
6897
|
+
_context19.next = 13;
|
|
6885
6898
|
break;
|
|
6886
6899
|
|
|
6887
6900
|
case 8:
|
|
6888
6901
|
if (!(_typeof(query) === 'object')) {
|
|
6889
|
-
|
|
6902
|
+
_context19.next = 12;
|
|
6890
6903
|
break;
|
|
6891
6904
|
}
|
|
6892
6905
|
|
|
6893
6906
|
payload.message_filter_conditions = query;
|
|
6894
|
-
|
|
6907
|
+
_context19.next = 13;
|
|
6895
6908
|
break;
|
|
6896
6909
|
|
|
6897
6910
|
case 12:
|
|
6898
6911
|
throw Error("Invalid type ".concat(_typeof(query), " for query parameter"));
|
|
6899
6912
|
|
|
6900
6913
|
case 13:
|
|
6901
|
-
|
|
6914
|
+
_context19.next = 15;
|
|
6902
6915
|
return this.setUserPromise;
|
|
6903
6916
|
|
|
6904
6917
|
case 15:
|
|
6905
|
-
|
|
6918
|
+
_context19.next = 17;
|
|
6906
6919
|
return this.get(this.baseURL + '/search', {
|
|
6907
6920
|
payload: payload
|
|
6908
6921
|
});
|
|
6909
6922
|
|
|
6910
6923
|
case 17:
|
|
6911
|
-
return
|
|
6924
|
+
return _context19.abrupt("return", _context19.sent);
|
|
6912
6925
|
|
|
6913
6926
|
case 18:
|
|
6914
6927
|
case "end":
|
|
6915
|
-
return
|
|
6928
|
+
return _context19.stop();
|
|
6916
6929
|
}
|
|
6917
6930
|
}
|
|
6918
|
-
},
|
|
6931
|
+
}, _callee19, this);
|
|
6919
6932
|
}));
|
|
6920
6933
|
|
|
6921
|
-
function search(
|
|
6934
|
+
function search(_x17, _x18) {
|
|
6922
6935
|
return _search.apply(this, arguments);
|
|
6923
6936
|
}
|
|
6924
6937
|
|
|
@@ -6954,12 +6967,12 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6954
6967
|
}, {
|
|
6955
6968
|
key: "addDevice",
|
|
6956
6969
|
value: function () {
|
|
6957
|
-
var _addDevice = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6958
|
-
return _regeneratorRuntime.wrap(function
|
|
6970
|
+
var _addDevice = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20(id, push_provider, userID) {
|
|
6971
|
+
return _regeneratorRuntime.wrap(function _callee20$(_context20) {
|
|
6959
6972
|
while (1) {
|
|
6960
|
-
switch (
|
|
6973
|
+
switch (_context20.prev = _context20.next) {
|
|
6961
6974
|
case 0:
|
|
6962
|
-
|
|
6975
|
+
_context20.next = 2;
|
|
6963
6976
|
return this.post(this.baseURL + '/devices', _objectSpread({
|
|
6964
6977
|
id: id,
|
|
6965
6978
|
push_provider: push_provider
|
|
@@ -6968,17 +6981,17 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6968
6981
|
} : {}));
|
|
6969
6982
|
|
|
6970
6983
|
case 2:
|
|
6971
|
-
return
|
|
6984
|
+
return _context20.abrupt("return", _context20.sent);
|
|
6972
6985
|
|
|
6973
6986
|
case 3:
|
|
6974
6987
|
case "end":
|
|
6975
|
-
return
|
|
6988
|
+
return _context20.stop();
|
|
6976
6989
|
}
|
|
6977
6990
|
}
|
|
6978
|
-
},
|
|
6991
|
+
}, _callee20, this);
|
|
6979
6992
|
}));
|
|
6980
6993
|
|
|
6981
|
-
function addDevice(
|
|
6994
|
+
function addDevice(_x19, _x20, _x21) {
|
|
6982
6995
|
return _addDevice.apply(this, arguments);
|
|
6983
6996
|
}
|
|
6984
6997
|
|
|
@@ -6995,28 +7008,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6995
7008
|
}, {
|
|
6996
7009
|
key: "getDevices",
|
|
6997
7010
|
value: function () {
|
|
6998
|
-
var _getDevices = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6999
|
-
return _regeneratorRuntime.wrap(function
|
|
7011
|
+
var _getDevices = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21(userID) {
|
|
7012
|
+
return _regeneratorRuntime.wrap(function _callee21$(_context21) {
|
|
7000
7013
|
while (1) {
|
|
7001
|
-
switch (
|
|
7014
|
+
switch (_context21.prev = _context21.next) {
|
|
7002
7015
|
case 0:
|
|
7003
|
-
|
|
7016
|
+
_context21.next = 2;
|
|
7004
7017
|
return this.get(this.baseURL + '/devices', userID ? {
|
|
7005
7018
|
user_id: userID
|
|
7006
7019
|
} : {});
|
|
7007
7020
|
|
|
7008
7021
|
case 2:
|
|
7009
|
-
return
|
|
7022
|
+
return _context21.abrupt("return", _context21.sent);
|
|
7010
7023
|
|
|
7011
7024
|
case 3:
|
|
7012
7025
|
case "end":
|
|
7013
|
-
return
|
|
7026
|
+
return _context21.stop();
|
|
7014
7027
|
}
|
|
7015
7028
|
}
|
|
7016
|
-
},
|
|
7029
|
+
}, _callee21, this);
|
|
7017
7030
|
}));
|
|
7018
7031
|
|
|
7019
|
-
function getDevices(
|
|
7032
|
+
function getDevices(_x22) {
|
|
7020
7033
|
return _getDevices.apply(this, arguments);
|
|
7021
7034
|
}
|
|
7022
7035
|
|
|
@@ -7033,12 +7046,12 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7033
7046
|
}, {
|
|
7034
7047
|
key: "removeDevice",
|
|
7035
7048
|
value: function () {
|
|
7036
|
-
var _removeDevice = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7037
|
-
return _regeneratorRuntime.wrap(function
|
|
7049
|
+
var _removeDevice = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22(id, userID) {
|
|
7050
|
+
return _regeneratorRuntime.wrap(function _callee22$(_context22) {
|
|
7038
7051
|
while (1) {
|
|
7039
|
-
switch (
|
|
7052
|
+
switch (_context22.prev = _context22.next) {
|
|
7040
7053
|
case 0:
|
|
7041
|
-
|
|
7054
|
+
_context22.next = 2;
|
|
7042
7055
|
return this.delete(this.baseURL + '/devices', _objectSpread({
|
|
7043
7056
|
id: id
|
|
7044
7057
|
}, userID ? {
|
|
@@ -7046,17 +7059,17 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7046
7059
|
} : {}));
|
|
7047
7060
|
|
|
7048
7061
|
case 2:
|
|
7049
|
-
return
|
|
7062
|
+
return _context22.abrupt("return", _context22.sent);
|
|
7050
7063
|
|
|
7051
7064
|
case 3:
|
|
7052
7065
|
case "end":
|
|
7053
|
-
return
|
|
7066
|
+
return _context22.stop();
|
|
7054
7067
|
}
|
|
7055
7068
|
}
|
|
7056
|
-
},
|
|
7069
|
+
}, _callee22, this);
|
|
7057
7070
|
}));
|
|
7058
7071
|
|
|
7059
|
-
function removeDevice(
|
|
7072
|
+
function removeDevice(_x23, _x24) {
|
|
7060
7073
|
return _removeDevice.apply(this, arguments);
|
|
7061
7074
|
}
|
|
7062
7075
|
|
|
@@ -7073,15 +7086,15 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7073
7086
|
}, {
|
|
7074
7087
|
key: "getRateLimits",
|
|
7075
7088
|
value: function () {
|
|
7076
|
-
var _getRateLimits = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7077
|
-
var
|
|
7089
|
+
var _getRateLimits = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23(params) {
|
|
7090
|
+
var _ref6, serverSide, web, android, ios, endpoints;
|
|
7078
7091
|
|
|
7079
|
-
return _regeneratorRuntime.wrap(function
|
|
7092
|
+
return _regeneratorRuntime.wrap(function _callee23$(_context23) {
|
|
7080
7093
|
while (1) {
|
|
7081
|
-
switch (
|
|
7094
|
+
switch (_context23.prev = _context23.next) {
|
|
7082
7095
|
case 0:
|
|
7083
|
-
|
|
7084
|
-
return
|
|
7096
|
+
_ref6 = params || {}, serverSide = _ref6.serverSide, web = _ref6.web, android = _ref6.android, ios = _ref6.ios, endpoints = _ref6.endpoints;
|
|
7097
|
+
return _context23.abrupt("return", this.get(this.baseURL + '/rate_limits', {
|
|
7085
7098
|
server_side: serverSide,
|
|
7086
7099
|
web: web,
|
|
7087
7100
|
android: android,
|
|
@@ -7091,13 +7104,13 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7091
7104
|
|
|
7092
7105
|
case 2:
|
|
7093
7106
|
case "end":
|
|
7094
|
-
return
|
|
7107
|
+
return _context23.stop();
|
|
7095
7108
|
}
|
|
7096
7109
|
}
|
|
7097
|
-
},
|
|
7110
|
+
}, _callee23, this);
|
|
7098
7111
|
}));
|
|
7099
7112
|
|
|
7100
|
-
function getRateLimits(
|
|
7113
|
+
function getRateLimits(_x25) {
|
|
7101
7114
|
return _getRateLimits.apply(this, arguments);
|
|
7102
7115
|
}
|
|
7103
7116
|
|
|
@@ -7179,26 +7192,26 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7179
7192
|
* @return {Promise<APIResponse & { users: { [key: string]: UserResponse<UserType> } }>} list of updated users
|
|
7180
7193
|
*/
|
|
7181
7194
|
function () {
|
|
7182
|
-
var _partialUpdateUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7183
|
-
return _regeneratorRuntime.wrap(function
|
|
7195
|
+
var _partialUpdateUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24(partialUserObject) {
|
|
7196
|
+
return _regeneratorRuntime.wrap(function _callee24$(_context24) {
|
|
7184
7197
|
while (1) {
|
|
7185
|
-
switch (
|
|
7198
|
+
switch (_context24.prev = _context24.next) {
|
|
7186
7199
|
case 0:
|
|
7187
|
-
|
|
7200
|
+
_context24.next = 2;
|
|
7188
7201
|
return this.partialUpdateUsers([partialUserObject]);
|
|
7189
7202
|
|
|
7190
7203
|
case 2:
|
|
7191
|
-
return
|
|
7204
|
+
return _context24.abrupt("return", _context24.sent);
|
|
7192
7205
|
|
|
7193
7206
|
case 3:
|
|
7194
7207
|
case "end":
|
|
7195
|
-
return
|
|
7208
|
+
return _context24.stop();
|
|
7196
7209
|
}
|
|
7197
7210
|
}
|
|
7198
|
-
},
|
|
7211
|
+
}, _callee24, this);
|
|
7199
7212
|
}));
|
|
7200
7213
|
|
|
7201
|
-
function partialUpdateUser(
|
|
7214
|
+
function partialUpdateUser(_x26) {
|
|
7202
7215
|
return _partialUpdateUser.apply(this, arguments);
|
|
7203
7216
|
}
|
|
7204
7217
|
|
|
@@ -7215,29 +7228,29 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7215
7228
|
}, {
|
|
7216
7229
|
key: "upsertUsers",
|
|
7217
7230
|
value: function () {
|
|
7218
|
-
var _upsertUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7231
|
+
var _upsertUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25(users) {
|
|
7219
7232
|
var userMap, _iterator4, _step4, userObject;
|
|
7220
7233
|
|
|
7221
|
-
return _regeneratorRuntime.wrap(function
|
|
7234
|
+
return _regeneratorRuntime.wrap(function _callee25$(_context25) {
|
|
7222
7235
|
while (1) {
|
|
7223
|
-
switch (
|
|
7236
|
+
switch (_context25.prev = _context25.next) {
|
|
7224
7237
|
case 0:
|
|
7225
7238
|
userMap = {};
|
|
7226
7239
|
_iterator4 = _createForOfIteratorHelper(users);
|
|
7227
|
-
|
|
7240
|
+
_context25.prev = 2;
|
|
7228
7241
|
|
|
7229
7242
|
_iterator4.s();
|
|
7230
7243
|
|
|
7231
7244
|
case 4:
|
|
7232
7245
|
if ((_step4 = _iterator4.n()).done) {
|
|
7233
|
-
|
|
7246
|
+
_context25.next = 11;
|
|
7234
7247
|
break;
|
|
7235
7248
|
}
|
|
7236
7249
|
|
|
7237
7250
|
userObject = _step4.value;
|
|
7238
7251
|
|
|
7239
7252
|
if (userObject.id) {
|
|
7240
|
-
|
|
7253
|
+
_context25.next = 8;
|
|
7241
7254
|
break;
|
|
7242
7255
|
}
|
|
7243
7256
|
|
|
@@ -7247,44 +7260,44 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7247
7260
|
userMap[userObject.id] = userObject;
|
|
7248
7261
|
|
|
7249
7262
|
case 9:
|
|
7250
|
-
|
|
7263
|
+
_context25.next = 4;
|
|
7251
7264
|
break;
|
|
7252
7265
|
|
|
7253
7266
|
case 11:
|
|
7254
|
-
|
|
7267
|
+
_context25.next = 16;
|
|
7255
7268
|
break;
|
|
7256
7269
|
|
|
7257
7270
|
case 13:
|
|
7258
|
-
|
|
7259
|
-
|
|
7271
|
+
_context25.prev = 13;
|
|
7272
|
+
_context25.t0 = _context25["catch"](2);
|
|
7260
7273
|
|
|
7261
|
-
_iterator4.e(
|
|
7274
|
+
_iterator4.e(_context25.t0);
|
|
7262
7275
|
|
|
7263
7276
|
case 16:
|
|
7264
|
-
|
|
7277
|
+
_context25.prev = 16;
|
|
7265
7278
|
|
|
7266
7279
|
_iterator4.f();
|
|
7267
7280
|
|
|
7268
|
-
return
|
|
7281
|
+
return _context25.finish(16);
|
|
7269
7282
|
|
|
7270
7283
|
case 19:
|
|
7271
|
-
|
|
7284
|
+
_context25.next = 21;
|
|
7272
7285
|
return this.post(this.baseURL + '/users', {
|
|
7273
7286
|
users: userMap
|
|
7274
7287
|
});
|
|
7275
7288
|
|
|
7276
7289
|
case 21:
|
|
7277
|
-
return
|
|
7290
|
+
return _context25.abrupt("return", _context25.sent);
|
|
7278
7291
|
|
|
7279
7292
|
case 22:
|
|
7280
7293
|
case "end":
|
|
7281
|
-
return
|
|
7294
|
+
return _context25.stop();
|
|
7282
7295
|
}
|
|
7283
7296
|
}
|
|
7284
|
-
},
|
|
7297
|
+
}, _callee25, this, [[2, 13, 16, 19]]);
|
|
7285
7298
|
}));
|
|
7286
7299
|
|
|
7287
|
-
function upsertUsers(
|
|
7300
|
+
function upsertUsers(_x27) {
|
|
7288
7301
|
return _upsertUsers.apply(this, arguments);
|
|
7289
7302
|
}
|
|
7290
7303
|
|
|
@@ -7332,72 +7345,72 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7332
7345
|
* @return {Promise<APIResponse & { users: { [key: string]: UserResponse<UserType> } }>}
|
|
7333
7346
|
*/
|
|
7334
7347
|
function () {
|
|
7335
|
-
var _partialUpdateUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7348
|
+
var _partialUpdateUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26(users) {
|
|
7336
7349
|
var _iterator5, _step5, userObject;
|
|
7337
7350
|
|
|
7338
|
-
return _regeneratorRuntime.wrap(function
|
|
7351
|
+
return _regeneratorRuntime.wrap(function _callee26$(_context26) {
|
|
7339
7352
|
while (1) {
|
|
7340
|
-
switch (
|
|
7353
|
+
switch (_context26.prev = _context26.next) {
|
|
7341
7354
|
case 0:
|
|
7342
7355
|
_iterator5 = _createForOfIteratorHelper(users);
|
|
7343
|
-
|
|
7356
|
+
_context26.prev = 1;
|
|
7344
7357
|
|
|
7345
7358
|
_iterator5.s();
|
|
7346
7359
|
|
|
7347
7360
|
case 3:
|
|
7348
7361
|
if ((_step5 = _iterator5.n()).done) {
|
|
7349
|
-
|
|
7362
|
+
_context26.next = 9;
|
|
7350
7363
|
break;
|
|
7351
7364
|
}
|
|
7352
7365
|
|
|
7353
7366
|
userObject = _step5.value;
|
|
7354
7367
|
|
|
7355
7368
|
if (userObject.id) {
|
|
7356
|
-
|
|
7369
|
+
_context26.next = 7;
|
|
7357
7370
|
break;
|
|
7358
7371
|
}
|
|
7359
7372
|
|
|
7360
7373
|
throw Error('User ID is required when updating a user');
|
|
7361
7374
|
|
|
7362
7375
|
case 7:
|
|
7363
|
-
|
|
7376
|
+
_context26.next = 3;
|
|
7364
7377
|
break;
|
|
7365
7378
|
|
|
7366
7379
|
case 9:
|
|
7367
|
-
|
|
7380
|
+
_context26.next = 14;
|
|
7368
7381
|
break;
|
|
7369
7382
|
|
|
7370
7383
|
case 11:
|
|
7371
|
-
|
|
7372
|
-
|
|
7384
|
+
_context26.prev = 11;
|
|
7385
|
+
_context26.t0 = _context26["catch"](1);
|
|
7373
7386
|
|
|
7374
|
-
_iterator5.e(
|
|
7387
|
+
_iterator5.e(_context26.t0);
|
|
7375
7388
|
|
|
7376
7389
|
case 14:
|
|
7377
|
-
|
|
7390
|
+
_context26.prev = 14;
|
|
7378
7391
|
|
|
7379
7392
|
_iterator5.f();
|
|
7380
7393
|
|
|
7381
|
-
return
|
|
7394
|
+
return _context26.finish(14);
|
|
7382
7395
|
|
|
7383
7396
|
case 17:
|
|
7384
|
-
|
|
7397
|
+
_context26.next = 19;
|
|
7385
7398
|
return this.patch(this.baseURL + '/users', {
|
|
7386
7399
|
users: users
|
|
7387
7400
|
});
|
|
7388
7401
|
|
|
7389
7402
|
case 19:
|
|
7390
|
-
return
|
|
7403
|
+
return _context26.abrupt("return", _context26.sent);
|
|
7391
7404
|
|
|
7392
7405
|
case 20:
|
|
7393
7406
|
case "end":
|
|
7394
|
-
return
|
|
7407
|
+
return _context26.stop();
|
|
7395
7408
|
}
|
|
7396
7409
|
}
|
|
7397
|
-
},
|
|
7410
|
+
}, _callee26, this, [[1, 11, 14, 17]]);
|
|
7398
7411
|
}));
|
|
7399
7412
|
|
|
7400
|
-
function partialUpdateUsers(
|
|
7413
|
+
function partialUpdateUsers(_x28) {
|
|
7401
7414
|
return _partialUpdateUsers.apply(this, arguments);
|
|
7402
7415
|
}
|
|
7403
7416
|
|
|
@@ -7406,26 +7419,26 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7406
7419
|
}, {
|
|
7407
7420
|
key: "deleteUser",
|
|
7408
7421
|
value: function () {
|
|
7409
|
-
var _deleteUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7410
|
-
return _regeneratorRuntime.wrap(function
|
|
7422
|
+
var _deleteUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27(userID, params) {
|
|
7423
|
+
return _regeneratorRuntime.wrap(function _callee27$(_context27) {
|
|
7411
7424
|
while (1) {
|
|
7412
|
-
switch (
|
|
7425
|
+
switch (_context27.prev = _context27.next) {
|
|
7413
7426
|
case 0:
|
|
7414
|
-
|
|
7427
|
+
_context27.next = 2;
|
|
7415
7428
|
return this.delete(this.baseURL + "/users/".concat(userID), params);
|
|
7416
7429
|
|
|
7417
7430
|
case 2:
|
|
7418
|
-
return
|
|
7431
|
+
return _context27.abrupt("return", _context27.sent);
|
|
7419
7432
|
|
|
7420
7433
|
case 3:
|
|
7421
7434
|
case "end":
|
|
7422
|
-
return
|
|
7435
|
+
return _context27.stop();
|
|
7423
7436
|
}
|
|
7424
7437
|
}
|
|
7425
|
-
},
|
|
7438
|
+
}, _callee27, this);
|
|
7426
7439
|
}));
|
|
7427
7440
|
|
|
7428
|
-
function deleteUser(
|
|
7441
|
+
function deleteUser(_x29, _x30) {
|
|
7429
7442
|
return _deleteUser.apply(this, arguments);
|
|
7430
7443
|
}
|
|
7431
7444
|
|
|
@@ -7434,26 +7447,26 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7434
7447
|
}, {
|
|
7435
7448
|
key: "reactivateUser",
|
|
7436
7449
|
value: function () {
|
|
7437
|
-
var _reactivateUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7438
|
-
return _regeneratorRuntime.wrap(function
|
|
7450
|
+
var _reactivateUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee28(userID, options) {
|
|
7451
|
+
return _regeneratorRuntime.wrap(function _callee28$(_context28) {
|
|
7439
7452
|
while (1) {
|
|
7440
|
-
switch (
|
|
7453
|
+
switch (_context28.prev = _context28.next) {
|
|
7441
7454
|
case 0:
|
|
7442
|
-
|
|
7455
|
+
_context28.next = 2;
|
|
7443
7456
|
return this.post(this.baseURL + "/users/".concat(userID, "/reactivate"), _objectSpread({}, options));
|
|
7444
7457
|
|
|
7445
7458
|
case 2:
|
|
7446
|
-
return
|
|
7459
|
+
return _context28.abrupt("return", _context28.sent);
|
|
7447
7460
|
|
|
7448
7461
|
case 3:
|
|
7449
7462
|
case "end":
|
|
7450
|
-
return
|
|
7463
|
+
return _context28.stop();
|
|
7451
7464
|
}
|
|
7452
7465
|
}
|
|
7453
|
-
},
|
|
7466
|
+
}, _callee28, this);
|
|
7454
7467
|
}));
|
|
7455
7468
|
|
|
7456
|
-
function reactivateUser(
|
|
7469
|
+
function reactivateUser(_x31, _x32) {
|
|
7457
7470
|
return _reactivateUser.apply(this, arguments);
|
|
7458
7471
|
}
|
|
7459
7472
|
|
|
@@ -7462,26 +7475,26 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7462
7475
|
}, {
|
|
7463
7476
|
key: "deactivateUser",
|
|
7464
7477
|
value: function () {
|
|
7465
|
-
var _deactivateUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7466
|
-
return _regeneratorRuntime.wrap(function
|
|
7478
|
+
var _deactivateUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee29(userID, options) {
|
|
7479
|
+
return _regeneratorRuntime.wrap(function _callee29$(_context29) {
|
|
7467
7480
|
while (1) {
|
|
7468
|
-
switch (
|
|
7481
|
+
switch (_context29.prev = _context29.next) {
|
|
7469
7482
|
case 0:
|
|
7470
|
-
|
|
7483
|
+
_context29.next = 2;
|
|
7471
7484
|
return this.post(this.baseURL + "/users/".concat(userID, "/deactivate"), _objectSpread({}, options));
|
|
7472
7485
|
|
|
7473
7486
|
case 2:
|
|
7474
|
-
return
|
|
7487
|
+
return _context29.abrupt("return", _context29.sent);
|
|
7475
7488
|
|
|
7476
7489
|
case 3:
|
|
7477
7490
|
case "end":
|
|
7478
|
-
return
|
|
7491
|
+
return _context29.stop();
|
|
7479
7492
|
}
|
|
7480
7493
|
}
|
|
7481
|
-
},
|
|
7494
|
+
}, _callee29, this);
|
|
7482
7495
|
}));
|
|
7483
7496
|
|
|
7484
|
-
function deactivateUser(
|
|
7497
|
+
function deactivateUser(_x33, _x34) {
|
|
7485
7498
|
return _deactivateUser.apply(this, arguments);
|
|
7486
7499
|
}
|
|
7487
7500
|
|
|
@@ -7490,26 +7503,26 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7490
7503
|
}, {
|
|
7491
7504
|
key: "exportUser",
|
|
7492
7505
|
value: function () {
|
|
7493
|
-
var _exportUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7494
|
-
return _regeneratorRuntime.wrap(function
|
|
7506
|
+
var _exportUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30(userID, options) {
|
|
7507
|
+
return _regeneratorRuntime.wrap(function _callee30$(_context30) {
|
|
7495
7508
|
while (1) {
|
|
7496
|
-
switch (
|
|
7509
|
+
switch (_context30.prev = _context30.next) {
|
|
7497
7510
|
case 0:
|
|
7498
|
-
|
|
7511
|
+
_context30.next = 2;
|
|
7499
7512
|
return this.get(this.baseURL + "/users/".concat(userID, "/export"), _objectSpread({}, options));
|
|
7500
7513
|
|
|
7501
7514
|
case 2:
|
|
7502
|
-
return
|
|
7515
|
+
return _context30.abrupt("return", _context30.sent);
|
|
7503
7516
|
|
|
7504
7517
|
case 3:
|
|
7505
7518
|
case "end":
|
|
7506
|
-
return
|
|
7519
|
+
return _context30.stop();
|
|
7507
7520
|
}
|
|
7508
7521
|
}
|
|
7509
|
-
},
|
|
7522
|
+
}, _callee30, this);
|
|
7510
7523
|
}));
|
|
7511
7524
|
|
|
7512
|
-
function exportUser(
|
|
7525
|
+
function exportUser(_x35, _x36) {
|
|
7513
7526
|
return _exportUser.apply(this, arguments);
|
|
7514
7527
|
}
|
|
7515
7528
|
|
|
@@ -7525,10 +7538,10 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7525
7538
|
}, {
|
|
7526
7539
|
key: "banUser",
|
|
7527
7540
|
value: function () {
|
|
7528
|
-
var _banUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7529
|
-
return _regeneratorRuntime.wrap(function
|
|
7541
|
+
var _banUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31(targetUserID, options) {
|
|
7542
|
+
return _regeneratorRuntime.wrap(function _callee31$(_context31) {
|
|
7530
7543
|
while (1) {
|
|
7531
|
-
switch (
|
|
7544
|
+
switch (_context31.prev = _context31.next) {
|
|
7532
7545
|
case 0:
|
|
7533
7546
|
if ((options === null || options === void 0 ? void 0 : options.user_id) !== undefined) {
|
|
7534
7547
|
options.banned_by_id = options.user_id;
|
|
@@ -7542,23 +7555,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7542
7555
|
console.warn("banUser: 'user' is deprecated, please consider switching to 'banned_by'");
|
|
7543
7556
|
}
|
|
7544
7557
|
|
|
7545
|
-
|
|
7558
|
+
_context31.next = 4;
|
|
7546
7559
|
return this.post(this.baseURL + '/moderation/ban', _objectSpread({
|
|
7547
7560
|
target_user_id: targetUserID
|
|
7548
7561
|
}, options));
|
|
7549
7562
|
|
|
7550
7563
|
case 4:
|
|
7551
|
-
return
|
|
7564
|
+
return _context31.abrupt("return", _context31.sent);
|
|
7552
7565
|
|
|
7553
7566
|
case 5:
|
|
7554
7567
|
case "end":
|
|
7555
|
-
return
|
|
7568
|
+
return _context31.stop();
|
|
7556
7569
|
}
|
|
7557
7570
|
}
|
|
7558
|
-
},
|
|
7571
|
+
}, _callee31, this);
|
|
7559
7572
|
}));
|
|
7560
7573
|
|
|
7561
|
-
function banUser(
|
|
7574
|
+
function banUser(_x37, _x38) {
|
|
7562
7575
|
return _banUser.apply(this, arguments);
|
|
7563
7576
|
}
|
|
7564
7577
|
|
|
@@ -7574,28 +7587,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7574
7587
|
}, {
|
|
7575
7588
|
key: "unbanUser",
|
|
7576
7589
|
value: function () {
|
|
7577
|
-
var _unbanUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7578
|
-
return _regeneratorRuntime.wrap(function
|
|
7590
|
+
var _unbanUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee32(targetUserID, options) {
|
|
7591
|
+
return _regeneratorRuntime.wrap(function _callee32$(_context32) {
|
|
7579
7592
|
while (1) {
|
|
7580
|
-
switch (
|
|
7593
|
+
switch (_context32.prev = _context32.next) {
|
|
7581
7594
|
case 0:
|
|
7582
|
-
|
|
7595
|
+
_context32.next = 2;
|
|
7583
7596
|
return this.delete(this.baseURL + '/moderation/ban', _objectSpread({
|
|
7584
7597
|
target_user_id: targetUserID
|
|
7585
7598
|
}, options));
|
|
7586
7599
|
|
|
7587
7600
|
case 2:
|
|
7588
|
-
return
|
|
7601
|
+
return _context32.abrupt("return", _context32.sent);
|
|
7589
7602
|
|
|
7590
7603
|
case 3:
|
|
7591
7604
|
case "end":
|
|
7592
|
-
return
|
|
7605
|
+
return _context32.stop();
|
|
7593
7606
|
}
|
|
7594
7607
|
}
|
|
7595
|
-
},
|
|
7608
|
+
}, _callee32, this);
|
|
7596
7609
|
}));
|
|
7597
7610
|
|
|
7598
|
-
function unbanUser(
|
|
7611
|
+
function unbanUser(_x39, _x40) {
|
|
7599
7612
|
return _unbanUser.apply(this, arguments);
|
|
7600
7613
|
}
|
|
7601
7614
|
|
|
@@ -7611,28 +7624,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7611
7624
|
}, {
|
|
7612
7625
|
key: "shadowBan",
|
|
7613
7626
|
value: function () {
|
|
7614
|
-
var _shadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7615
|
-
return _regeneratorRuntime.wrap(function
|
|
7627
|
+
var _shadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee33(targetUserID, options) {
|
|
7628
|
+
return _regeneratorRuntime.wrap(function _callee33$(_context33) {
|
|
7616
7629
|
while (1) {
|
|
7617
|
-
switch (
|
|
7630
|
+
switch (_context33.prev = _context33.next) {
|
|
7618
7631
|
case 0:
|
|
7619
|
-
|
|
7632
|
+
_context33.next = 2;
|
|
7620
7633
|
return this.banUser(targetUserID, _objectSpread({
|
|
7621
7634
|
shadow: true
|
|
7622
7635
|
}, options));
|
|
7623
7636
|
|
|
7624
7637
|
case 2:
|
|
7625
|
-
return
|
|
7638
|
+
return _context33.abrupt("return", _context33.sent);
|
|
7626
7639
|
|
|
7627
7640
|
case 3:
|
|
7628
7641
|
case "end":
|
|
7629
|
-
return
|
|
7642
|
+
return _context33.stop();
|
|
7630
7643
|
}
|
|
7631
7644
|
}
|
|
7632
|
-
},
|
|
7645
|
+
}, _callee33, this);
|
|
7633
7646
|
}));
|
|
7634
7647
|
|
|
7635
|
-
function shadowBan(
|
|
7648
|
+
function shadowBan(_x41, _x42) {
|
|
7636
7649
|
return _shadowBan.apply(this, arguments);
|
|
7637
7650
|
}
|
|
7638
7651
|
|
|
@@ -7648,28 +7661,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7648
7661
|
}, {
|
|
7649
7662
|
key: "removeShadowBan",
|
|
7650
7663
|
value: function () {
|
|
7651
|
-
var _removeShadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7652
|
-
return _regeneratorRuntime.wrap(function
|
|
7664
|
+
var _removeShadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee34(targetUserID, options) {
|
|
7665
|
+
return _regeneratorRuntime.wrap(function _callee34$(_context34) {
|
|
7653
7666
|
while (1) {
|
|
7654
|
-
switch (
|
|
7667
|
+
switch (_context34.prev = _context34.next) {
|
|
7655
7668
|
case 0:
|
|
7656
|
-
|
|
7669
|
+
_context34.next = 2;
|
|
7657
7670
|
return this.unbanUser(targetUserID, _objectSpread({
|
|
7658
7671
|
shadow: true
|
|
7659
7672
|
}, options));
|
|
7660
7673
|
|
|
7661
7674
|
case 2:
|
|
7662
|
-
return
|
|
7675
|
+
return _context34.abrupt("return", _context34.sent);
|
|
7663
7676
|
|
|
7664
7677
|
case 3:
|
|
7665
7678
|
case "end":
|
|
7666
|
-
return
|
|
7679
|
+
return _context34.stop();
|
|
7667
7680
|
}
|
|
7668
7681
|
}
|
|
7669
|
-
},
|
|
7682
|
+
}, _callee34, this);
|
|
7670
7683
|
}));
|
|
7671
7684
|
|
|
7672
|
-
function removeShadowBan(
|
|
7685
|
+
function removeShadowBan(_x43, _x44) {
|
|
7673
7686
|
return _removeShadowBan.apply(this, arguments);
|
|
7674
7687
|
}
|
|
7675
7688
|
|
|
@@ -7686,15 +7699,15 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7686
7699
|
}, {
|
|
7687
7700
|
key: "muteUser",
|
|
7688
7701
|
value: function () {
|
|
7689
|
-
var _muteUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7702
|
+
var _muteUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee35(targetID, userID) {
|
|
7690
7703
|
var options,
|
|
7691
|
-
|
|
7692
|
-
return _regeneratorRuntime.wrap(function
|
|
7704
|
+
_args35 = arguments;
|
|
7705
|
+
return _regeneratorRuntime.wrap(function _callee35$(_context35) {
|
|
7693
7706
|
while (1) {
|
|
7694
|
-
switch (
|
|
7707
|
+
switch (_context35.prev = _context35.next) {
|
|
7695
7708
|
case 0:
|
|
7696
|
-
options =
|
|
7697
|
-
|
|
7709
|
+
options = _args35.length > 2 && _args35[2] !== undefined ? _args35[2] : {};
|
|
7710
|
+
_context35.next = 3;
|
|
7698
7711
|
return this.post(this.baseURL + '/moderation/mute', _objectSpread(_objectSpread({
|
|
7699
7712
|
target_id: targetID
|
|
7700
7713
|
}, userID ? {
|
|
@@ -7702,17 +7715,17 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7702
7715
|
} : {}), options));
|
|
7703
7716
|
|
|
7704
7717
|
case 3:
|
|
7705
|
-
return
|
|
7718
|
+
return _context35.abrupt("return", _context35.sent);
|
|
7706
7719
|
|
|
7707
7720
|
case 4:
|
|
7708
7721
|
case "end":
|
|
7709
|
-
return
|
|
7722
|
+
return _context35.stop();
|
|
7710
7723
|
}
|
|
7711
7724
|
}
|
|
7712
|
-
},
|
|
7725
|
+
}, _callee35, this);
|
|
7713
7726
|
}));
|
|
7714
7727
|
|
|
7715
|
-
function muteUser(
|
|
7728
|
+
function muteUser(_x45, _x46) {
|
|
7716
7729
|
return _muteUser.apply(this, arguments);
|
|
7717
7730
|
}
|
|
7718
7731
|
|
|
@@ -7728,12 +7741,12 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7728
7741
|
}, {
|
|
7729
7742
|
key: "unmuteUser",
|
|
7730
7743
|
value: function () {
|
|
7731
|
-
var _unmuteUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7732
|
-
return _regeneratorRuntime.wrap(function
|
|
7744
|
+
var _unmuteUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee36(targetID, currentUserID) {
|
|
7745
|
+
return _regeneratorRuntime.wrap(function _callee36$(_context36) {
|
|
7733
7746
|
while (1) {
|
|
7734
|
-
switch (
|
|
7747
|
+
switch (_context36.prev = _context36.next) {
|
|
7735
7748
|
case 0:
|
|
7736
|
-
|
|
7749
|
+
_context36.next = 2;
|
|
7737
7750
|
return this.post(this.baseURL + '/moderation/unmute', _objectSpread({
|
|
7738
7751
|
target_id: targetID
|
|
7739
7752
|
}, currentUserID ? {
|
|
@@ -7741,17 +7754,17 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7741
7754
|
} : {}));
|
|
7742
7755
|
|
|
7743
7756
|
case 2:
|
|
7744
|
-
return
|
|
7757
|
+
return _context36.abrupt("return", _context36.sent);
|
|
7745
7758
|
|
|
7746
7759
|
case 3:
|
|
7747
7760
|
case "end":
|
|
7748
|
-
return
|
|
7761
|
+
return _context36.stop();
|
|
7749
7762
|
}
|
|
7750
7763
|
}
|
|
7751
|
-
},
|
|
7764
|
+
}, _callee36, this);
|
|
7752
7765
|
}));
|
|
7753
7766
|
|
|
7754
|
-
function unmuteUser(
|
|
7767
|
+
function unmuteUser(_x47, _x48) {
|
|
7755
7768
|
return _unmuteUser.apply(this, arguments);
|
|
7756
7769
|
}
|
|
7757
7770
|
|
|
@@ -7786,31 +7799,31 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7786
7799
|
}, {
|
|
7787
7800
|
key: "flagMessage",
|
|
7788
7801
|
value: function () {
|
|
7789
|
-
var _flagMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7802
|
+
var _flagMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee37(targetMessageID) {
|
|
7790
7803
|
var options,
|
|
7791
|
-
|
|
7792
|
-
return _regeneratorRuntime.wrap(function
|
|
7804
|
+
_args37 = arguments;
|
|
7805
|
+
return _regeneratorRuntime.wrap(function _callee37$(_context37) {
|
|
7793
7806
|
while (1) {
|
|
7794
|
-
switch (
|
|
7807
|
+
switch (_context37.prev = _context37.next) {
|
|
7795
7808
|
case 0:
|
|
7796
|
-
options =
|
|
7797
|
-
|
|
7809
|
+
options = _args37.length > 1 && _args37[1] !== undefined ? _args37[1] : {};
|
|
7810
|
+
_context37.next = 3;
|
|
7798
7811
|
return this.post(this.baseURL + '/moderation/flag', _objectSpread({
|
|
7799
7812
|
target_message_id: targetMessageID
|
|
7800
7813
|
}, options));
|
|
7801
7814
|
|
|
7802
7815
|
case 3:
|
|
7803
|
-
return
|
|
7816
|
+
return _context37.abrupt("return", _context37.sent);
|
|
7804
7817
|
|
|
7805
7818
|
case 4:
|
|
7806
7819
|
case "end":
|
|
7807
|
-
return
|
|
7820
|
+
return _context37.stop();
|
|
7808
7821
|
}
|
|
7809
7822
|
}
|
|
7810
|
-
},
|
|
7823
|
+
}, _callee37, this);
|
|
7811
7824
|
}));
|
|
7812
7825
|
|
|
7813
|
-
function flagMessage(
|
|
7826
|
+
function flagMessage(_x49) {
|
|
7814
7827
|
return _flagMessage.apply(this, arguments);
|
|
7815
7828
|
}
|
|
7816
7829
|
|
|
@@ -7826,31 +7839,31 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7826
7839
|
}, {
|
|
7827
7840
|
key: "flagUser",
|
|
7828
7841
|
value: function () {
|
|
7829
|
-
var _flagUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7842
|
+
var _flagUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee38(targetID) {
|
|
7830
7843
|
var options,
|
|
7831
|
-
|
|
7832
|
-
return _regeneratorRuntime.wrap(function
|
|
7844
|
+
_args38 = arguments;
|
|
7845
|
+
return _regeneratorRuntime.wrap(function _callee38$(_context38) {
|
|
7833
7846
|
while (1) {
|
|
7834
|
-
switch (
|
|
7847
|
+
switch (_context38.prev = _context38.next) {
|
|
7835
7848
|
case 0:
|
|
7836
|
-
options =
|
|
7837
|
-
|
|
7849
|
+
options = _args38.length > 1 && _args38[1] !== undefined ? _args38[1] : {};
|
|
7850
|
+
_context38.next = 3;
|
|
7838
7851
|
return this.post(this.baseURL + '/moderation/flag', _objectSpread({
|
|
7839
7852
|
target_user_id: targetID
|
|
7840
7853
|
}, options));
|
|
7841
7854
|
|
|
7842
7855
|
case 3:
|
|
7843
|
-
return
|
|
7856
|
+
return _context38.abrupt("return", _context38.sent);
|
|
7844
7857
|
|
|
7845
7858
|
case 4:
|
|
7846
7859
|
case "end":
|
|
7847
|
-
return
|
|
7860
|
+
return _context38.stop();
|
|
7848
7861
|
}
|
|
7849
7862
|
}
|
|
7850
|
-
},
|
|
7863
|
+
}, _callee38, this);
|
|
7851
7864
|
}));
|
|
7852
7865
|
|
|
7853
|
-
function flagUser(
|
|
7866
|
+
function flagUser(_x50) {
|
|
7854
7867
|
return _flagUser.apply(this, arguments);
|
|
7855
7868
|
}
|
|
7856
7869
|
|
|
@@ -7866,31 +7879,31 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7866
7879
|
}, {
|
|
7867
7880
|
key: "unflagMessage",
|
|
7868
7881
|
value: function () {
|
|
7869
|
-
var _unflagMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7882
|
+
var _unflagMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee39(targetMessageID) {
|
|
7870
7883
|
var options,
|
|
7871
|
-
|
|
7872
|
-
return _regeneratorRuntime.wrap(function
|
|
7884
|
+
_args39 = arguments;
|
|
7885
|
+
return _regeneratorRuntime.wrap(function _callee39$(_context39) {
|
|
7873
7886
|
while (1) {
|
|
7874
|
-
switch (
|
|
7887
|
+
switch (_context39.prev = _context39.next) {
|
|
7875
7888
|
case 0:
|
|
7876
|
-
options =
|
|
7877
|
-
|
|
7889
|
+
options = _args39.length > 1 && _args39[1] !== undefined ? _args39[1] : {};
|
|
7890
|
+
_context39.next = 3;
|
|
7878
7891
|
return this.post(this.baseURL + '/moderation/unflag', _objectSpread({
|
|
7879
7892
|
target_message_id: targetMessageID
|
|
7880
7893
|
}, options));
|
|
7881
7894
|
|
|
7882
7895
|
case 3:
|
|
7883
|
-
return
|
|
7896
|
+
return _context39.abrupt("return", _context39.sent);
|
|
7884
7897
|
|
|
7885
7898
|
case 4:
|
|
7886
7899
|
case "end":
|
|
7887
|
-
return
|
|
7900
|
+
return _context39.stop();
|
|
7888
7901
|
}
|
|
7889
7902
|
}
|
|
7890
|
-
},
|
|
7903
|
+
}, _callee39, this);
|
|
7891
7904
|
}));
|
|
7892
7905
|
|
|
7893
|
-
function unflagMessage(
|
|
7906
|
+
function unflagMessage(_x51) {
|
|
7894
7907
|
return _unflagMessage.apply(this, arguments);
|
|
7895
7908
|
}
|
|
7896
7909
|
|
|
@@ -7906,31 +7919,31 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7906
7919
|
}, {
|
|
7907
7920
|
key: "unflagUser",
|
|
7908
7921
|
value: function () {
|
|
7909
|
-
var _unflagUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7922
|
+
var _unflagUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee40(targetID) {
|
|
7910
7923
|
var options,
|
|
7911
|
-
|
|
7912
|
-
return _regeneratorRuntime.wrap(function
|
|
7924
|
+
_args40 = arguments;
|
|
7925
|
+
return _regeneratorRuntime.wrap(function _callee40$(_context40) {
|
|
7913
7926
|
while (1) {
|
|
7914
|
-
switch (
|
|
7927
|
+
switch (_context40.prev = _context40.next) {
|
|
7915
7928
|
case 0:
|
|
7916
|
-
options =
|
|
7917
|
-
|
|
7929
|
+
options = _args40.length > 1 && _args40[1] !== undefined ? _args40[1] : {};
|
|
7930
|
+
_context40.next = 3;
|
|
7918
7931
|
return this.post(this.baseURL + '/moderation/unflag', _objectSpread({
|
|
7919
7932
|
target_user_id: targetID
|
|
7920
7933
|
}, options));
|
|
7921
7934
|
|
|
7922
7935
|
case 3:
|
|
7923
|
-
return
|
|
7936
|
+
return _context40.abrupt("return", _context40.sent);
|
|
7924
7937
|
|
|
7925
7938
|
case 4:
|
|
7926
7939
|
case "end":
|
|
7927
|
-
return
|
|
7940
|
+
return _context40.stop();
|
|
7928
7941
|
}
|
|
7929
7942
|
}
|
|
7930
|
-
},
|
|
7943
|
+
}, _callee40, this);
|
|
7931
7944
|
}));
|
|
7932
7945
|
|
|
7933
|
-
function unflagUser(
|
|
7946
|
+
function unflagUser(_x52) {
|
|
7934
7947
|
return _unflagUser.apply(this, arguments);
|
|
7935
7948
|
}
|
|
7936
7949
|
|
|
@@ -7957,23 +7970,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7957
7970
|
* @return {Promise<APIResponse>}
|
|
7958
7971
|
*/
|
|
7959
7972
|
function () {
|
|
7960
|
-
var _markChannelsRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7973
|
+
var _markChannelsRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee41() {
|
|
7961
7974
|
var data,
|
|
7962
|
-
|
|
7963
|
-
return _regeneratorRuntime.wrap(function
|
|
7975
|
+
_args41 = arguments;
|
|
7976
|
+
return _regeneratorRuntime.wrap(function _callee41$(_context41) {
|
|
7964
7977
|
while (1) {
|
|
7965
|
-
switch (
|
|
7978
|
+
switch (_context41.prev = _context41.next) {
|
|
7966
7979
|
case 0:
|
|
7967
|
-
data =
|
|
7968
|
-
|
|
7980
|
+
data = _args41.length > 0 && _args41[0] !== undefined ? _args41[0] : {};
|
|
7981
|
+
_context41.next = 3;
|
|
7969
7982
|
return this.post(this.baseURL + '/channels/read', _objectSpread({}, data));
|
|
7970
7983
|
|
|
7971
7984
|
case 3:
|
|
7972
7985
|
case "end":
|
|
7973
|
-
return
|
|
7986
|
+
return _context41.stop();
|
|
7974
7987
|
}
|
|
7975
7988
|
}
|
|
7976
|
-
},
|
|
7989
|
+
}, _callee41, this);
|
|
7977
7990
|
}));
|
|
7978
7991
|
|
|
7979
7992
|
function markChannelsRead() {
|
|
@@ -8048,28 +8061,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8048
8061
|
}, {
|
|
8049
8062
|
key: "translateMessage",
|
|
8050
8063
|
value: function () {
|
|
8051
|
-
var _translateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8052
|
-
return _regeneratorRuntime.wrap(function
|
|
8064
|
+
var _translateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42(messageId, language) {
|
|
8065
|
+
return _regeneratorRuntime.wrap(function _callee42$(_context42) {
|
|
8053
8066
|
while (1) {
|
|
8054
|
-
switch (
|
|
8067
|
+
switch (_context42.prev = _context42.next) {
|
|
8055
8068
|
case 0:
|
|
8056
|
-
|
|
8069
|
+
_context42.next = 2;
|
|
8057
8070
|
return this.post(this.baseURL + "/messages/".concat(messageId, "/translate"), {
|
|
8058
8071
|
language: language
|
|
8059
8072
|
});
|
|
8060
8073
|
|
|
8061
8074
|
case 2:
|
|
8062
|
-
return
|
|
8075
|
+
return _context42.abrupt("return", _context42.sent);
|
|
8063
8076
|
|
|
8064
8077
|
case 3:
|
|
8065
8078
|
case "end":
|
|
8066
|
-
return
|
|
8079
|
+
return _context42.stop();
|
|
8067
8080
|
}
|
|
8068
8081
|
}
|
|
8069
|
-
},
|
|
8082
|
+
}, _callee42, this);
|
|
8070
8083
|
}));
|
|
8071
8084
|
|
|
8072
|
-
function translateMessage(
|
|
8085
|
+
function translateMessage(_x53, _x54) {
|
|
8073
8086
|
return _translateMessage.apply(this, arguments);
|
|
8074
8087
|
}
|
|
8075
8088
|
|
|
@@ -8169,14 +8182,14 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8169
8182
|
}, {
|
|
8170
8183
|
key: "updateMessage",
|
|
8171
8184
|
value: function () {
|
|
8172
|
-
var _updateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8185
|
+
var _updateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee43(message, userId, options) {
|
|
8173
8186
|
var clonedMessage, reservedMessageFields;
|
|
8174
|
-
return _regeneratorRuntime.wrap(function
|
|
8187
|
+
return _regeneratorRuntime.wrap(function _callee43$(_context43) {
|
|
8175
8188
|
while (1) {
|
|
8176
|
-
switch (
|
|
8189
|
+
switch (_context43.prev = _context43.next) {
|
|
8177
8190
|
case 0:
|
|
8178
8191
|
if (message.id) {
|
|
8179
|
-
|
|
8192
|
+
_context43.next = 2;
|
|
8180
8193
|
break;
|
|
8181
8194
|
}
|
|
8182
8195
|
|
|
@@ -8213,23 +8226,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8213
8226
|
});
|
|
8214
8227
|
}
|
|
8215
8228
|
|
|
8216
|
-
|
|
8229
|
+
_context43.next = 10;
|
|
8217
8230
|
return this.post(this.baseURL + "/messages/".concat(message.id), _objectSpread({
|
|
8218
8231
|
message: clonedMessage
|
|
8219
8232
|
}, options));
|
|
8220
8233
|
|
|
8221
8234
|
case 10:
|
|
8222
|
-
return
|
|
8235
|
+
return _context43.abrupt("return", _context43.sent);
|
|
8223
8236
|
|
|
8224
8237
|
case 11:
|
|
8225
8238
|
case "end":
|
|
8226
|
-
return
|
|
8239
|
+
return _context43.stop();
|
|
8227
8240
|
}
|
|
8228
8241
|
}
|
|
8229
|
-
},
|
|
8242
|
+
}, _callee43, this);
|
|
8230
8243
|
}));
|
|
8231
8244
|
|
|
8232
|
-
function updateMessage(
|
|
8245
|
+
function updateMessage(_x55, _x56, _x57) {
|
|
8233
8246
|
return _updateMessage.apply(this, arguments);
|
|
8234
8247
|
}
|
|
8235
8248
|
|
|
@@ -8252,14 +8265,14 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8252
8265
|
}, {
|
|
8253
8266
|
key: "partialUpdateMessage",
|
|
8254
8267
|
value: function () {
|
|
8255
|
-
var _partialUpdateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8268
|
+
var _partialUpdateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44(id, partialMessageObject, userId, options) {
|
|
8256
8269
|
var user;
|
|
8257
|
-
return _regeneratorRuntime.wrap(function
|
|
8270
|
+
return _regeneratorRuntime.wrap(function _callee44$(_context44) {
|
|
8258
8271
|
while (1) {
|
|
8259
|
-
switch (
|
|
8272
|
+
switch (_context44.prev = _context44.next) {
|
|
8260
8273
|
case 0:
|
|
8261
8274
|
if (id) {
|
|
8262
|
-
|
|
8275
|
+
_context44.next = 2;
|
|
8263
8276
|
break;
|
|
8264
8277
|
}
|
|
8265
8278
|
|
|
@@ -8274,23 +8287,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8274
8287
|
};
|
|
8275
8288
|
}
|
|
8276
8289
|
|
|
8277
|
-
|
|
8290
|
+
_context44.next = 6;
|
|
8278
8291
|
return this.put(this.baseURL + "/messages/".concat(id), _objectSpread(_objectSpread(_objectSpread({}, partialMessageObject), options), {}, {
|
|
8279
8292
|
user: user
|
|
8280
8293
|
}));
|
|
8281
8294
|
|
|
8282
8295
|
case 6:
|
|
8283
|
-
return
|
|
8296
|
+
return _context44.abrupt("return", _context44.sent);
|
|
8284
8297
|
|
|
8285
8298
|
case 7:
|
|
8286
8299
|
case "end":
|
|
8287
|
-
return
|
|
8300
|
+
return _context44.stop();
|
|
8288
8301
|
}
|
|
8289
8302
|
}
|
|
8290
|
-
},
|
|
8303
|
+
}, _callee44, this);
|
|
8291
8304
|
}));
|
|
8292
8305
|
|
|
8293
|
-
function partialUpdateMessage(
|
|
8306
|
+
function partialUpdateMessage(_x58, _x59, _x60, _x61) {
|
|
8294
8307
|
return _partialUpdateMessage.apply(this, arguments);
|
|
8295
8308
|
}
|
|
8296
8309
|
|
|
@@ -8299,11 +8312,11 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8299
8312
|
}, {
|
|
8300
8313
|
key: "deleteMessage",
|
|
8301
8314
|
value: function () {
|
|
8302
|
-
var _deleteMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8315
|
+
var _deleteMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45(messageID, hardDelete) {
|
|
8303
8316
|
var params;
|
|
8304
|
-
return _regeneratorRuntime.wrap(function
|
|
8317
|
+
return _regeneratorRuntime.wrap(function _callee45$(_context45) {
|
|
8305
8318
|
while (1) {
|
|
8306
|
-
switch (
|
|
8319
|
+
switch (_context45.prev = _context45.next) {
|
|
8307
8320
|
case 0:
|
|
8308
8321
|
params = {};
|
|
8309
8322
|
|
|
@@ -8313,21 +8326,21 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8313
8326
|
};
|
|
8314
8327
|
}
|
|
8315
8328
|
|
|
8316
|
-
|
|
8329
|
+
_context45.next = 4;
|
|
8317
8330
|
return this.delete(this.baseURL + "/messages/".concat(messageID), params);
|
|
8318
8331
|
|
|
8319
8332
|
case 4:
|
|
8320
|
-
return
|
|
8333
|
+
return _context45.abrupt("return", _context45.sent);
|
|
8321
8334
|
|
|
8322
8335
|
case 5:
|
|
8323
8336
|
case "end":
|
|
8324
|
-
return
|
|
8337
|
+
return _context45.stop();
|
|
8325
8338
|
}
|
|
8326
8339
|
}
|
|
8327
|
-
},
|
|
8340
|
+
}, _callee45, this);
|
|
8328
8341
|
}));
|
|
8329
8342
|
|
|
8330
|
-
function deleteMessage(
|
|
8343
|
+
function deleteMessage(_x62, _x63) {
|
|
8331
8344
|
return _deleteMessage.apply(this, arguments);
|
|
8332
8345
|
}
|
|
8333
8346
|
|
|
@@ -8336,26 +8349,26 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8336
8349
|
}, {
|
|
8337
8350
|
key: "getMessage",
|
|
8338
8351
|
value: function () {
|
|
8339
|
-
var _getMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8340
|
-
return _regeneratorRuntime.wrap(function
|
|
8352
|
+
var _getMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46(messageID) {
|
|
8353
|
+
return _regeneratorRuntime.wrap(function _callee46$(_context46) {
|
|
8341
8354
|
while (1) {
|
|
8342
|
-
switch (
|
|
8355
|
+
switch (_context46.prev = _context46.next) {
|
|
8343
8356
|
case 0:
|
|
8344
|
-
|
|
8357
|
+
_context46.next = 2;
|
|
8345
8358
|
return this.get(this.baseURL + "/messages/".concat(messageID));
|
|
8346
8359
|
|
|
8347
8360
|
case 2:
|
|
8348
|
-
return
|
|
8361
|
+
return _context46.abrupt("return", _context46.sent);
|
|
8349
8362
|
|
|
8350
8363
|
case 3:
|
|
8351
8364
|
case "end":
|
|
8352
|
-
return
|
|
8365
|
+
return _context46.stop();
|
|
8353
8366
|
}
|
|
8354
8367
|
}
|
|
8355
|
-
},
|
|
8368
|
+
}, _callee46, this);
|
|
8356
8369
|
}));
|
|
8357
8370
|
|
|
8358
|
-
function getMessage(
|
|
8371
|
+
function getMessage(_x64) {
|
|
8359
8372
|
return _getMessage.apply(this, arguments);
|
|
8360
8373
|
}
|
|
8361
8374
|
|
|
@@ -8364,7 +8377,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8364
8377
|
}, {
|
|
8365
8378
|
key: "getUserAgent",
|
|
8366
8379
|
value: function getUserAgent() {
|
|
8367
|
-
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "4.4.3
|
|
8380
|
+
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "4.4.3");
|
|
8368
8381
|
}
|
|
8369
8382
|
}, {
|
|
8370
8383
|
key: "setUserAgent",
|
|
@@ -8389,9 +8402,9 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8389
8402
|
var token = this._getToken();
|
|
8390
8403
|
|
|
8391
8404
|
if (!((_options$headers = options.headers) !== null && _options$headers !== void 0 && _options$headers['x-client-request-id'])) {
|
|
8392
|
-
options.headers = {
|
|
8405
|
+
options.headers = _objectSpread(_objectSpread({}, options.headers), {}, {
|
|
8393
8406
|
'x-client-request-id': randomId()
|
|
8394
|
-
};
|
|
8407
|
+
});
|
|
8395
8408
|
}
|
|
8396
8409
|
|
|
8397
8410
|
return _objectSpread({
|
|
@@ -8551,28 +8564,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8551
8564
|
}, {
|
|
8552
8565
|
key: "sendUserCustomEvent",
|
|
8553
8566
|
value: function () {
|
|
8554
|
-
var _sendUserCustomEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8555
|
-
return _regeneratorRuntime.wrap(function
|
|
8567
|
+
var _sendUserCustomEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee47(targetUserID, event) {
|
|
8568
|
+
return _regeneratorRuntime.wrap(function _callee47$(_context47) {
|
|
8556
8569
|
while (1) {
|
|
8557
|
-
switch (
|
|
8570
|
+
switch (_context47.prev = _context47.next) {
|
|
8558
8571
|
case 0:
|
|
8559
|
-
|
|
8572
|
+
_context47.next = 2;
|
|
8560
8573
|
return this.post("".concat(this.baseURL, "/users/").concat(targetUserID, "/event"), {
|
|
8561
8574
|
event: event
|
|
8562
8575
|
});
|
|
8563
8576
|
|
|
8564
8577
|
case 2:
|
|
8565
|
-
return
|
|
8578
|
+
return _context47.abrupt("return", _context47.sent);
|
|
8566
8579
|
|
|
8567
8580
|
case 3:
|
|
8568
8581
|
case "end":
|
|
8569
|
-
return
|
|
8582
|
+
return _context47.stop();
|
|
8570
8583
|
}
|
|
8571
8584
|
}
|
|
8572
|
-
},
|
|
8585
|
+
}, _callee47, this);
|
|
8573
8586
|
}));
|
|
8574
8587
|
|
|
8575
|
-
function sendUserCustomEvent(
|
|
8588
|
+
function sendUserCustomEvent(_x65, _x66) {
|
|
8576
8589
|
return _sendUserCustomEvent.apply(this, arguments);
|
|
8577
8590
|
}
|
|
8578
8591
|
|
|
@@ -8635,32 +8648,32 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8635
8648
|
}, {
|
|
8636
8649
|
key: "createSegment",
|
|
8637
8650
|
value: function () {
|
|
8638
|
-
var _createSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8651
|
+
var _createSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee48(params) {
|
|
8639
8652
|
var _yield$this$post, segment;
|
|
8640
8653
|
|
|
8641
|
-
return _regeneratorRuntime.wrap(function
|
|
8654
|
+
return _regeneratorRuntime.wrap(function _callee48$(_context48) {
|
|
8642
8655
|
while (1) {
|
|
8643
|
-
switch (
|
|
8656
|
+
switch (_context48.prev = _context48.next) {
|
|
8644
8657
|
case 0:
|
|
8645
|
-
|
|
8658
|
+
_context48.next = 2;
|
|
8646
8659
|
return this.post(this.baseURL + "/segments", {
|
|
8647
8660
|
segment: params
|
|
8648
8661
|
});
|
|
8649
8662
|
|
|
8650
8663
|
case 2:
|
|
8651
|
-
_yield$this$post =
|
|
8664
|
+
_yield$this$post = _context48.sent;
|
|
8652
8665
|
segment = _yield$this$post.segment;
|
|
8653
|
-
return
|
|
8666
|
+
return _context48.abrupt("return", segment);
|
|
8654
8667
|
|
|
8655
8668
|
case 5:
|
|
8656
8669
|
case "end":
|
|
8657
|
-
return
|
|
8670
|
+
return _context48.stop();
|
|
8658
8671
|
}
|
|
8659
8672
|
}
|
|
8660
|
-
},
|
|
8673
|
+
}, _callee48, this);
|
|
8661
8674
|
}));
|
|
8662
8675
|
|
|
8663
|
-
function createSegment(
|
|
8676
|
+
function createSegment(_x67) {
|
|
8664
8677
|
return _createSegment.apply(this, arguments);
|
|
8665
8678
|
}
|
|
8666
8679
|
|
|
@@ -8677,30 +8690,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8677
8690
|
}, {
|
|
8678
8691
|
key: "getSegment",
|
|
8679
8692
|
value: function () {
|
|
8680
|
-
var _getSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8693
|
+
var _getSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49(id) {
|
|
8681
8694
|
var _yield$this$get, segment;
|
|
8682
8695
|
|
|
8683
|
-
return _regeneratorRuntime.wrap(function
|
|
8696
|
+
return _regeneratorRuntime.wrap(function _callee49$(_context49) {
|
|
8684
8697
|
while (1) {
|
|
8685
|
-
switch (
|
|
8698
|
+
switch (_context49.prev = _context49.next) {
|
|
8686
8699
|
case 0:
|
|
8687
|
-
|
|
8700
|
+
_context49.next = 2;
|
|
8688
8701
|
return this.get(this.baseURL + "/segments/".concat(id));
|
|
8689
8702
|
|
|
8690
8703
|
case 2:
|
|
8691
|
-
_yield$this$get =
|
|
8704
|
+
_yield$this$get = _context49.sent;
|
|
8692
8705
|
segment = _yield$this$get.segment;
|
|
8693
|
-
return
|
|
8706
|
+
return _context49.abrupt("return", segment);
|
|
8694
8707
|
|
|
8695
8708
|
case 5:
|
|
8696
8709
|
case "end":
|
|
8697
|
-
return
|
|
8710
|
+
return _context49.stop();
|
|
8698
8711
|
}
|
|
8699
8712
|
}
|
|
8700
|
-
},
|
|
8713
|
+
}, _callee49, this);
|
|
8701
8714
|
}));
|
|
8702
8715
|
|
|
8703
|
-
function getSegment(
|
|
8716
|
+
function getSegment(_x68) {
|
|
8704
8717
|
return _getSegment.apply(this, arguments);
|
|
8705
8718
|
}
|
|
8706
8719
|
|
|
@@ -8716,30 +8729,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8716
8729
|
}, {
|
|
8717
8730
|
key: "listSegments",
|
|
8718
8731
|
value: function () {
|
|
8719
|
-
var _listSegments = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8732
|
+
var _listSegments = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee50(options) {
|
|
8720
8733
|
var _yield$this$get2, segments;
|
|
8721
8734
|
|
|
8722
|
-
return _regeneratorRuntime.wrap(function
|
|
8735
|
+
return _regeneratorRuntime.wrap(function _callee50$(_context50) {
|
|
8723
8736
|
while (1) {
|
|
8724
|
-
switch (
|
|
8737
|
+
switch (_context50.prev = _context50.next) {
|
|
8725
8738
|
case 0:
|
|
8726
|
-
|
|
8739
|
+
_context50.next = 2;
|
|
8727
8740
|
return this.get(this.baseURL + "/segments", options);
|
|
8728
8741
|
|
|
8729
8742
|
case 2:
|
|
8730
|
-
_yield$this$get2 =
|
|
8743
|
+
_yield$this$get2 = _context50.sent;
|
|
8731
8744
|
segments = _yield$this$get2.segments;
|
|
8732
|
-
return
|
|
8745
|
+
return _context50.abrupt("return", segments);
|
|
8733
8746
|
|
|
8734
8747
|
case 5:
|
|
8735
8748
|
case "end":
|
|
8736
|
-
return
|
|
8749
|
+
return _context50.stop();
|
|
8737
8750
|
}
|
|
8738
8751
|
}
|
|
8739
|
-
},
|
|
8752
|
+
}, _callee50, this);
|
|
8740
8753
|
}));
|
|
8741
8754
|
|
|
8742
|
-
function listSegments(
|
|
8755
|
+
function listSegments(_x69) {
|
|
8743
8756
|
return _listSegments.apply(this, arguments);
|
|
8744
8757
|
}
|
|
8745
8758
|
|
|
@@ -8757,32 +8770,32 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8757
8770
|
}, {
|
|
8758
8771
|
key: "updateSegment",
|
|
8759
8772
|
value: function () {
|
|
8760
|
-
var _updateSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8773
|
+
var _updateSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee51(id, params) {
|
|
8761
8774
|
var _yield$this$put, segment;
|
|
8762
8775
|
|
|
8763
|
-
return _regeneratorRuntime.wrap(function
|
|
8776
|
+
return _regeneratorRuntime.wrap(function _callee51$(_context51) {
|
|
8764
8777
|
while (1) {
|
|
8765
|
-
switch (
|
|
8778
|
+
switch (_context51.prev = _context51.next) {
|
|
8766
8779
|
case 0:
|
|
8767
|
-
|
|
8780
|
+
_context51.next = 2;
|
|
8768
8781
|
return this.put(this.baseURL + "/segments/".concat(id), {
|
|
8769
8782
|
segment: params
|
|
8770
8783
|
});
|
|
8771
8784
|
|
|
8772
8785
|
case 2:
|
|
8773
|
-
_yield$this$put =
|
|
8786
|
+
_yield$this$put = _context51.sent;
|
|
8774
8787
|
segment = _yield$this$put.segment;
|
|
8775
|
-
return
|
|
8788
|
+
return _context51.abrupt("return", segment);
|
|
8776
8789
|
|
|
8777
8790
|
case 5:
|
|
8778
8791
|
case "end":
|
|
8779
|
-
return
|
|
8792
|
+
return _context51.stop();
|
|
8780
8793
|
}
|
|
8781
8794
|
}
|
|
8782
|
-
},
|
|
8795
|
+
}, _callee51, this);
|
|
8783
8796
|
}));
|
|
8784
8797
|
|
|
8785
|
-
function updateSegment(
|
|
8798
|
+
function updateSegment(_x70, _x71) {
|
|
8786
8799
|
return _updateSegment.apply(this, arguments);
|
|
8787
8800
|
}
|
|
8788
8801
|
|
|
@@ -8799,22 +8812,22 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8799
8812
|
}, {
|
|
8800
8813
|
key: "deleteSegment",
|
|
8801
8814
|
value: function () {
|
|
8802
|
-
var _deleteSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8803
|
-
return _regeneratorRuntime.wrap(function
|
|
8815
|
+
var _deleteSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee52(id) {
|
|
8816
|
+
return _regeneratorRuntime.wrap(function _callee52$(_context52) {
|
|
8804
8817
|
while (1) {
|
|
8805
|
-
switch (
|
|
8818
|
+
switch (_context52.prev = _context52.next) {
|
|
8806
8819
|
case 0:
|
|
8807
|
-
return
|
|
8820
|
+
return _context52.abrupt("return", this.delete(this.baseURL + "/segments/".concat(id)));
|
|
8808
8821
|
|
|
8809
8822
|
case 1:
|
|
8810
8823
|
case "end":
|
|
8811
|
-
return
|
|
8824
|
+
return _context52.stop();
|
|
8812
8825
|
}
|
|
8813
8826
|
}
|
|
8814
|
-
},
|
|
8827
|
+
}, _callee52, this);
|
|
8815
8828
|
}));
|
|
8816
8829
|
|
|
8817
|
-
function deleteSegment(
|
|
8830
|
+
function deleteSegment(_x72) {
|
|
8818
8831
|
return _deleteSegment.apply(this, arguments);
|
|
8819
8832
|
}
|
|
8820
8833
|
|
|
@@ -8831,32 +8844,32 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8831
8844
|
}, {
|
|
8832
8845
|
key: "createCampaign",
|
|
8833
8846
|
value: function () {
|
|
8834
|
-
var _createCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8847
|
+
var _createCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee53(params) {
|
|
8835
8848
|
var _yield$this$post2, campaign;
|
|
8836
8849
|
|
|
8837
|
-
return _regeneratorRuntime.wrap(function
|
|
8850
|
+
return _regeneratorRuntime.wrap(function _callee53$(_context53) {
|
|
8838
8851
|
while (1) {
|
|
8839
|
-
switch (
|
|
8852
|
+
switch (_context53.prev = _context53.next) {
|
|
8840
8853
|
case 0:
|
|
8841
|
-
|
|
8854
|
+
_context53.next = 2;
|
|
8842
8855
|
return this.post(this.baseURL + "/campaigns", {
|
|
8843
8856
|
campaign: params
|
|
8844
8857
|
});
|
|
8845
8858
|
|
|
8846
8859
|
case 2:
|
|
8847
|
-
_yield$this$post2 =
|
|
8860
|
+
_yield$this$post2 = _context53.sent;
|
|
8848
8861
|
campaign = _yield$this$post2.campaign;
|
|
8849
|
-
return
|
|
8862
|
+
return _context53.abrupt("return", campaign);
|
|
8850
8863
|
|
|
8851
8864
|
case 5:
|
|
8852
8865
|
case "end":
|
|
8853
|
-
return
|
|
8866
|
+
return _context53.stop();
|
|
8854
8867
|
}
|
|
8855
8868
|
}
|
|
8856
|
-
},
|
|
8869
|
+
}, _callee53, this);
|
|
8857
8870
|
}));
|
|
8858
8871
|
|
|
8859
|
-
function createCampaign(
|
|
8872
|
+
function createCampaign(_x73) {
|
|
8860
8873
|
return _createCampaign.apply(this, arguments);
|
|
8861
8874
|
}
|
|
8862
8875
|
|
|
@@ -8873,30 +8886,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8873
8886
|
}, {
|
|
8874
8887
|
key: "getCampaign",
|
|
8875
8888
|
value: function () {
|
|
8876
|
-
var _getCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8889
|
+
var _getCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee54(id) {
|
|
8877
8890
|
var _yield$this$get3, campaign;
|
|
8878
8891
|
|
|
8879
|
-
return _regeneratorRuntime.wrap(function
|
|
8892
|
+
return _regeneratorRuntime.wrap(function _callee54$(_context54) {
|
|
8880
8893
|
while (1) {
|
|
8881
|
-
switch (
|
|
8894
|
+
switch (_context54.prev = _context54.next) {
|
|
8882
8895
|
case 0:
|
|
8883
|
-
|
|
8896
|
+
_context54.next = 2;
|
|
8884
8897
|
return this.get(this.baseURL + "/campaigns/".concat(id));
|
|
8885
8898
|
|
|
8886
8899
|
case 2:
|
|
8887
|
-
_yield$this$get3 =
|
|
8900
|
+
_yield$this$get3 = _context54.sent;
|
|
8888
8901
|
campaign = _yield$this$get3.campaign;
|
|
8889
|
-
return
|
|
8902
|
+
return _context54.abrupt("return", campaign);
|
|
8890
8903
|
|
|
8891
8904
|
case 5:
|
|
8892
8905
|
case "end":
|
|
8893
|
-
return
|
|
8906
|
+
return _context54.stop();
|
|
8894
8907
|
}
|
|
8895
8908
|
}
|
|
8896
|
-
},
|
|
8909
|
+
}, _callee54, this);
|
|
8897
8910
|
}));
|
|
8898
8911
|
|
|
8899
|
-
function getCampaign(
|
|
8912
|
+
function getCampaign(_x74) {
|
|
8900
8913
|
return _getCampaign.apply(this, arguments);
|
|
8901
8914
|
}
|
|
8902
8915
|
|
|
@@ -8912,30 +8925,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8912
8925
|
}, {
|
|
8913
8926
|
key: "listCampaigns",
|
|
8914
8927
|
value: function () {
|
|
8915
|
-
var _listCampaigns = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8928
|
+
var _listCampaigns = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee55(options) {
|
|
8916
8929
|
var _yield$this$get4, campaigns;
|
|
8917
8930
|
|
|
8918
|
-
return _regeneratorRuntime.wrap(function
|
|
8931
|
+
return _regeneratorRuntime.wrap(function _callee55$(_context55) {
|
|
8919
8932
|
while (1) {
|
|
8920
|
-
switch (
|
|
8933
|
+
switch (_context55.prev = _context55.next) {
|
|
8921
8934
|
case 0:
|
|
8922
|
-
|
|
8935
|
+
_context55.next = 2;
|
|
8923
8936
|
return this.get(this.baseURL + "/campaigns", options);
|
|
8924
8937
|
|
|
8925
8938
|
case 2:
|
|
8926
|
-
_yield$this$get4 =
|
|
8939
|
+
_yield$this$get4 = _context55.sent;
|
|
8927
8940
|
campaigns = _yield$this$get4.campaigns;
|
|
8928
|
-
return
|
|
8941
|
+
return _context55.abrupt("return", campaigns);
|
|
8929
8942
|
|
|
8930
8943
|
case 5:
|
|
8931
8944
|
case "end":
|
|
8932
|
-
return
|
|
8945
|
+
return _context55.stop();
|
|
8933
8946
|
}
|
|
8934
8947
|
}
|
|
8935
|
-
},
|
|
8948
|
+
}, _callee55, this);
|
|
8936
8949
|
}));
|
|
8937
8950
|
|
|
8938
|
-
function listCampaigns(
|
|
8951
|
+
function listCampaigns(_x75) {
|
|
8939
8952
|
return _listCampaigns.apply(this, arguments);
|
|
8940
8953
|
}
|
|
8941
8954
|
|
|
@@ -8953,32 +8966,32 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8953
8966
|
}, {
|
|
8954
8967
|
key: "updateCampaign",
|
|
8955
8968
|
value: function () {
|
|
8956
|
-
var _updateCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8969
|
+
var _updateCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee56(id, params) {
|
|
8957
8970
|
var _yield$this$put2, campaign;
|
|
8958
8971
|
|
|
8959
|
-
return _regeneratorRuntime.wrap(function
|
|
8972
|
+
return _regeneratorRuntime.wrap(function _callee56$(_context56) {
|
|
8960
8973
|
while (1) {
|
|
8961
|
-
switch (
|
|
8974
|
+
switch (_context56.prev = _context56.next) {
|
|
8962
8975
|
case 0:
|
|
8963
|
-
|
|
8976
|
+
_context56.next = 2;
|
|
8964
8977
|
return this.put(this.baseURL + "/campaigns/".concat(id), {
|
|
8965
8978
|
campaign: params
|
|
8966
8979
|
});
|
|
8967
8980
|
|
|
8968
8981
|
case 2:
|
|
8969
|
-
_yield$this$put2 =
|
|
8982
|
+
_yield$this$put2 = _context56.sent;
|
|
8970
8983
|
campaign = _yield$this$put2.campaign;
|
|
8971
|
-
return
|
|
8984
|
+
return _context56.abrupt("return", campaign);
|
|
8972
8985
|
|
|
8973
8986
|
case 5:
|
|
8974
8987
|
case "end":
|
|
8975
|
-
return
|
|
8988
|
+
return _context56.stop();
|
|
8976
8989
|
}
|
|
8977
8990
|
}
|
|
8978
|
-
},
|
|
8991
|
+
}, _callee56, this);
|
|
8979
8992
|
}));
|
|
8980
8993
|
|
|
8981
|
-
function updateCampaign(
|
|
8994
|
+
function updateCampaign(_x76, _x77) {
|
|
8982
8995
|
return _updateCampaign.apply(this, arguments);
|
|
8983
8996
|
}
|
|
8984
8997
|
|
|
@@ -8995,22 +9008,22 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8995
9008
|
}, {
|
|
8996
9009
|
key: "deleteCampaign",
|
|
8997
9010
|
value: function () {
|
|
8998
|
-
var _deleteCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8999
|
-
return _regeneratorRuntime.wrap(function
|
|
9011
|
+
var _deleteCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee57(id) {
|
|
9012
|
+
return _regeneratorRuntime.wrap(function _callee57$(_context57) {
|
|
9000
9013
|
while (1) {
|
|
9001
|
-
switch (
|
|
9014
|
+
switch (_context57.prev = _context57.next) {
|
|
9002
9015
|
case 0:
|
|
9003
|
-
return
|
|
9016
|
+
return _context57.abrupt("return", this.delete(this.baseURL + "/campaigns/".concat(id)));
|
|
9004
9017
|
|
|
9005
9018
|
case 1:
|
|
9006
9019
|
case "end":
|
|
9007
|
-
return
|
|
9020
|
+
return _context57.stop();
|
|
9008
9021
|
}
|
|
9009
9022
|
}
|
|
9010
|
-
},
|
|
9023
|
+
}, _callee57, this);
|
|
9011
9024
|
}));
|
|
9012
9025
|
|
|
9013
|
-
function deleteCampaign(
|
|
9026
|
+
function deleteCampaign(_x78) {
|
|
9014
9027
|
return _deleteCampaign.apply(this, arguments);
|
|
9015
9028
|
}
|
|
9016
9029
|
|
|
@@ -9028,33 +9041,33 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9028
9041
|
}, {
|
|
9029
9042
|
key: "scheduleCampaign",
|
|
9030
9043
|
value: function () {
|
|
9031
|
-
var _scheduleCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9044
|
+
var _scheduleCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee58(id, params) {
|
|
9032
9045
|
var sendAt, _yield$this$patch, campaign;
|
|
9033
9046
|
|
|
9034
|
-
return _regeneratorRuntime.wrap(function
|
|
9047
|
+
return _regeneratorRuntime.wrap(function _callee58$(_context58) {
|
|
9035
9048
|
while (1) {
|
|
9036
|
-
switch (
|
|
9049
|
+
switch (_context58.prev = _context58.next) {
|
|
9037
9050
|
case 0:
|
|
9038
9051
|
sendAt = params.sendAt;
|
|
9039
|
-
|
|
9052
|
+
_context58.next = 3;
|
|
9040
9053
|
return this.patch(this.baseURL + "/campaigns/".concat(id, "/schedule"), {
|
|
9041
9054
|
send_at: sendAt
|
|
9042
9055
|
});
|
|
9043
9056
|
|
|
9044
9057
|
case 3:
|
|
9045
|
-
_yield$this$patch =
|
|
9058
|
+
_yield$this$patch = _context58.sent;
|
|
9046
9059
|
campaign = _yield$this$patch.campaign;
|
|
9047
|
-
return
|
|
9060
|
+
return _context58.abrupt("return", campaign);
|
|
9048
9061
|
|
|
9049
9062
|
case 6:
|
|
9050
9063
|
case "end":
|
|
9051
|
-
return
|
|
9064
|
+
return _context58.stop();
|
|
9052
9065
|
}
|
|
9053
9066
|
}
|
|
9054
|
-
},
|
|
9067
|
+
}, _callee58, this);
|
|
9055
9068
|
}));
|
|
9056
9069
|
|
|
9057
|
-
function scheduleCampaign(
|
|
9070
|
+
function scheduleCampaign(_x79, _x80) {
|
|
9058
9071
|
return _scheduleCampaign.apply(this, arguments);
|
|
9059
9072
|
}
|
|
9060
9073
|
|
|
@@ -9071,30 +9084,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9071
9084
|
}, {
|
|
9072
9085
|
key: "stopCampaign",
|
|
9073
9086
|
value: function () {
|
|
9074
|
-
var _stopCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9087
|
+
var _stopCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee59(id) {
|
|
9075
9088
|
var _yield$this$patch2, campaign;
|
|
9076
9089
|
|
|
9077
|
-
return _regeneratorRuntime.wrap(function
|
|
9090
|
+
return _regeneratorRuntime.wrap(function _callee59$(_context59) {
|
|
9078
9091
|
while (1) {
|
|
9079
|
-
switch (
|
|
9092
|
+
switch (_context59.prev = _context59.next) {
|
|
9080
9093
|
case 0:
|
|
9081
|
-
|
|
9094
|
+
_context59.next = 2;
|
|
9082
9095
|
return this.patch(this.baseURL + "/campaigns/".concat(id, "/stop"));
|
|
9083
9096
|
|
|
9084
9097
|
case 2:
|
|
9085
|
-
_yield$this$patch2 =
|
|
9098
|
+
_yield$this$patch2 = _context59.sent;
|
|
9086
9099
|
campaign = _yield$this$patch2.campaign;
|
|
9087
|
-
return
|
|
9100
|
+
return _context59.abrupt("return", campaign);
|
|
9088
9101
|
|
|
9089
9102
|
case 5:
|
|
9090
9103
|
case "end":
|
|
9091
|
-
return
|
|
9104
|
+
return _context59.stop();
|
|
9092
9105
|
}
|
|
9093
9106
|
}
|
|
9094
|
-
},
|
|
9107
|
+
}, _callee59, this);
|
|
9095
9108
|
}));
|
|
9096
9109
|
|
|
9097
|
-
function stopCampaign(
|
|
9110
|
+
function stopCampaign(_x81) {
|
|
9098
9111
|
return _stopCampaign.apply(this, arguments);
|
|
9099
9112
|
}
|
|
9100
9113
|
|
|
@@ -9111,30 +9124,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9111
9124
|
}, {
|
|
9112
9125
|
key: "resumeCampaign",
|
|
9113
9126
|
value: function () {
|
|
9114
|
-
var _resumeCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9127
|
+
var _resumeCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee60(id) {
|
|
9115
9128
|
var _yield$this$patch3, campaign;
|
|
9116
9129
|
|
|
9117
|
-
return _regeneratorRuntime.wrap(function
|
|
9130
|
+
return _regeneratorRuntime.wrap(function _callee60$(_context60) {
|
|
9118
9131
|
while (1) {
|
|
9119
|
-
switch (
|
|
9132
|
+
switch (_context60.prev = _context60.next) {
|
|
9120
9133
|
case 0:
|
|
9121
|
-
|
|
9134
|
+
_context60.next = 2;
|
|
9122
9135
|
return this.patch(this.baseURL + "/campaigns/".concat(id, "/resume"));
|
|
9123
9136
|
|
|
9124
9137
|
case 2:
|
|
9125
|
-
_yield$this$patch3 =
|
|
9138
|
+
_yield$this$patch3 = _context60.sent;
|
|
9126
9139
|
campaign = _yield$this$patch3.campaign;
|
|
9127
|
-
return
|
|
9140
|
+
return _context60.abrupt("return", campaign);
|
|
9128
9141
|
|
|
9129
9142
|
case 5:
|
|
9130
9143
|
case "end":
|
|
9131
|
-
return
|
|
9144
|
+
return _context60.stop();
|
|
9132
9145
|
}
|
|
9133
9146
|
}
|
|
9134
|
-
},
|
|
9147
|
+
}, _callee60, this);
|
|
9135
9148
|
}));
|
|
9136
9149
|
|
|
9137
|
-
function resumeCampaign(
|
|
9150
|
+
function resumeCampaign(_x82) {
|
|
9138
9151
|
return _resumeCampaign.apply(this, arguments);
|
|
9139
9152
|
}
|
|
9140
9153
|
|
|
@@ -9151,33 +9164,33 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9151
9164
|
}, {
|
|
9152
9165
|
key: "testCampaign",
|
|
9153
9166
|
value: function () {
|
|
9154
|
-
var _testCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9167
|
+
var _testCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee61(id, params) {
|
|
9155
9168
|
var users, _yield$this$post3, campaign;
|
|
9156
9169
|
|
|
9157
|
-
return _regeneratorRuntime.wrap(function
|
|
9170
|
+
return _regeneratorRuntime.wrap(function _callee61$(_context61) {
|
|
9158
9171
|
while (1) {
|
|
9159
|
-
switch (
|
|
9172
|
+
switch (_context61.prev = _context61.next) {
|
|
9160
9173
|
case 0:
|
|
9161
9174
|
users = params.users;
|
|
9162
|
-
|
|
9175
|
+
_context61.next = 3;
|
|
9163
9176
|
return this.post(this.baseURL + "/campaigns/".concat(id, "/test"), {
|
|
9164
9177
|
users: users
|
|
9165
9178
|
});
|
|
9166
9179
|
|
|
9167
9180
|
case 3:
|
|
9168
|
-
_yield$this$post3 =
|
|
9181
|
+
_yield$this$post3 = _context61.sent;
|
|
9169
9182
|
campaign = _yield$this$post3.campaign;
|
|
9170
|
-
return
|
|
9183
|
+
return _context61.abrupt("return", campaign);
|
|
9171
9184
|
|
|
9172
9185
|
case 6:
|
|
9173
9186
|
case "end":
|
|
9174
|
-
return
|
|
9187
|
+
return _context61.stop();
|
|
9175
9188
|
}
|
|
9176
9189
|
}
|
|
9177
|
-
},
|
|
9190
|
+
}, _callee61, this);
|
|
9178
9191
|
}));
|
|
9179
9192
|
|
|
9180
|
-
function testCampaign(
|
|
9193
|
+
function testCampaign(_x83, _x84) {
|
|
9181
9194
|
return _testCampaign.apply(this, arguments);
|
|
9182
9195
|
}
|
|
9183
9196
|
|
|
@@ -9193,24 +9206,24 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9193
9206
|
}, {
|
|
9194
9207
|
key: "enrichURL",
|
|
9195
9208
|
value: function () {
|
|
9196
|
-
var _enrichURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9197
|
-
return _regeneratorRuntime.wrap(function
|
|
9209
|
+
var _enrichURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee62(url) {
|
|
9210
|
+
return _regeneratorRuntime.wrap(function _callee62$(_context62) {
|
|
9198
9211
|
while (1) {
|
|
9199
|
-
switch (
|
|
9212
|
+
switch (_context62.prev = _context62.next) {
|
|
9200
9213
|
case 0:
|
|
9201
|
-
return
|
|
9214
|
+
return _context62.abrupt("return", this.get(this.baseURL + "/og", {
|
|
9202
9215
|
url: url
|
|
9203
9216
|
}));
|
|
9204
9217
|
|
|
9205
9218
|
case 1:
|
|
9206
9219
|
case "end":
|
|
9207
|
-
return
|
|
9220
|
+
return _context62.stop();
|
|
9208
9221
|
}
|
|
9209
9222
|
}
|
|
9210
|
-
},
|
|
9223
|
+
}, _callee62, this);
|
|
9211
9224
|
}));
|
|
9212
9225
|
|
|
9213
|
-
function enrichURL(
|
|
9226
|
+
function enrichURL(_x85) {
|
|
9214
9227
|
return _enrichURL.apply(this, arguments);
|
|
9215
9228
|
}
|
|
9216
9229
|
|
|
@@ -9227,22 +9240,22 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9227
9240
|
}, {
|
|
9228
9241
|
key: "getTask",
|
|
9229
9242
|
value: function () {
|
|
9230
|
-
var _getTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9231
|
-
return _regeneratorRuntime.wrap(function
|
|
9243
|
+
var _getTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee63(id) {
|
|
9244
|
+
return _regeneratorRuntime.wrap(function _callee63$(_context63) {
|
|
9232
9245
|
while (1) {
|
|
9233
|
-
switch (
|
|
9246
|
+
switch (_context63.prev = _context63.next) {
|
|
9234
9247
|
case 0:
|
|
9235
|
-
return
|
|
9248
|
+
return _context63.abrupt("return", this.get("".concat(this.baseURL, "/tasks/").concat(id)));
|
|
9236
9249
|
|
|
9237
9250
|
case 1:
|
|
9238
9251
|
case "end":
|
|
9239
|
-
return
|
|
9252
|
+
return _context63.stop();
|
|
9240
9253
|
}
|
|
9241
9254
|
}
|
|
9242
|
-
},
|
|
9255
|
+
}, _callee63, this);
|
|
9243
9256
|
}));
|
|
9244
9257
|
|
|
9245
|
-
function getTask(
|
|
9258
|
+
function getTask(_x86) {
|
|
9246
9259
|
return _getTask.apply(this, arguments);
|
|
9247
9260
|
}
|
|
9248
9261
|
|
|
@@ -9260,39 +9273,36 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9260
9273
|
}, {
|
|
9261
9274
|
key: "deleteChannels",
|
|
9262
9275
|
value: function () {
|
|
9263
|
-
var _deleteChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9276
|
+
var _deleteChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee64(cids) {
|
|
9264
9277
|
var options,
|
|
9265
|
-
|
|
9266
|
-
return _regeneratorRuntime.wrap(function
|
|
9278
|
+
_args64 = arguments;
|
|
9279
|
+
return _regeneratorRuntime.wrap(function _callee64$(_context64) {
|
|
9267
9280
|
while (1) {
|
|
9268
|
-
switch (
|
|
9281
|
+
switch (_context64.prev = _context64.next) {
|
|
9269
9282
|
case 0:
|
|
9270
|
-
options =
|
|
9271
|
-
|
|
9283
|
+
options = _args64.length > 1 && _args64[1] !== undefined ? _args64[1] : {};
|
|
9284
|
+
_context64.next = 3;
|
|
9272
9285
|
return this.post(this.baseURL + "/channels/delete", _objectSpread({
|
|
9273
9286
|
cids: cids
|
|
9274
9287
|
}, options));
|
|
9275
9288
|
|
|
9276
9289
|
case 3:
|
|
9277
|
-
return
|
|
9290
|
+
return _context64.abrupt("return", _context64.sent);
|
|
9278
9291
|
|
|
9279
9292
|
case 4:
|
|
9280
9293
|
case "end":
|
|
9281
|
-
return
|
|
9294
|
+
return _context64.stop();
|
|
9282
9295
|
}
|
|
9283
9296
|
}
|
|
9284
|
-
},
|
|
9297
|
+
}, _callee64, this);
|
|
9285
9298
|
}));
|
|
9286
9299
|
|
|
9287
|
-
function deleteChannels(
|
|
9300
|
+
function deleteChannels(_x87) {
|
|
9288
9301
|
return _deleteChannels.apply(this, arguments);
|
|
9289
9302
|
}
|
|
9290
9303
|
|
|
9291
9304
|
return deleteChannels;
|
|
9292
9305
|
}()
|
|
9293
|
-
}, {
|
|
9294
|
-
key: "deleteUsers",
|
|
9295
|
-
value:
|
|
9296
9306
|
/**
|
|
9297
9307
|
* deleteUsers - Batch Delete Users
|
|
9298
9308
|
*
|
|
@@ -9301,14 +9311,17 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9301
9311
|
*
|
|
9302
9312
|
* @return {APIResponse} A task ID
|
|
9303
9313
|
*/
|
|
9304
|
-
|
|
9305
|
-
|
|
9306
|
-
|
|
9314
|
+
|
|
9315
|
+
}, {
|
|
9316
|
+
key: "deleteUsers",
|
|
9317
|
+
value: function () {
|
|
9318
|
+
var _deleteUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee65(user_ids, options) {
|
|
9319
|
+
return _regeneratorRuntime.wrap(function _callee65$(_context65) {
|
|
9307
9320
|
while (1) {
|
|
9308
|
-
switch (
|
|
9321
|
+
switch (_context65.prev = _context65.next) {
|
|
9309
9322
|
case 0:
|
|
9310
9323
|
if (!((options === null || options === void 0 ? void 0 : options.user) !== 'soft' && (options === null || options === void 0 ? void 0 : options.user) !== 'hard')) {
|
|
9311
|
-
|
|
9324
|
+
_context65.next = 2;
|
|
9312
9325
|
break;
|
|
9313
9326
|
}
|
|
9314
9327
|
|
|
@@ -9316,7 +9329,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9316
9329
|
|
|
9317
9330
|
case 2:
|
|
9318
9331
|
if (!(options.messages !== undefined && options.messages !== 'soft' && options.messages !== 'hard')) {
|
|
9319
|
-
|
|
9332
|
+
_context65.next = 4;
|
|
9320
9333
|
break;
|
|
9321
9334
|
}
|
|
9322
9335
|
|
|
@@ -9324,30 +9337,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9324
9337
|
|
|
9325
9338
|
case 4:
|
|
9326
9339
|
if (!(options.conversations !== undefined && options.conversations !== 'soft' && options.conversations !== 'hard')) {
|
|
9327
|
-
|
|
9340
|
+
_context65.next = 6;
|
|
9328
9341
|
break;
|
|
9329
9342
|
}
|
|
9330
9343
|
|
|
9331
9344
|
throw new Error('Invalid delete user options. conversations must be one of [soft hard]');
|
|
9332
9345
|
|
|
9333
9346
|
case 6:
|
|
9334
|
-
|
|
9347
|
+
_context65.next = 8;
|
|
9335
9348
|
return this.post(this.baseURL + "/users/delete", _objectSpread({
|
|
9336
9349
|
user_ids: user_ids
|
|
9337
9350
|
}, options));
|
|
9338
9351
|
|
|
9339
9352
|
case 8:
|
|
9340
|
-
return
|
|
9353
|
+
return _context65.abrupt("return", _context65.sent);
|
|
9341
9354
|
|
|
9342
9355
|
case 9:
|
|
9343
9356
|
case "end":
|
|
9344
|
-
return
|
|
9357
|
+
return _context65.stop();
|
|
9345
9358
|
}
|
|
9346
9359
|
}
|
|
9347
|
-
},
|
|
9360
|
+
}, _callee65, this);
|
|
9348
9361
|
}));
|
|
9349
9362
|
|
|
9350
|
-
function deleteUsers(
|
|
9363
|
+
function deleteUsers(_x88, _x89) {
|
|
9351
9364
|
return _deleteUsers.apply(this, arguments);
|
|
9352
9365
|
}
|
|
9353
9366
|
|
|
@@ -9447,5 +9460,5 @@ var BuiltinPermissions = {
|
|
|
9447
9460
|
UseFrozenChannel: 'Send messages and reactions to frozen channels'
|
|
9448
9461
|
};
|
|
9449
9462
|
|
|
9450
|
-
export { Allow, AllowAll, AnyResource, AnyRole, BuiltinPermissions, BuiltinRoles, Channel, ChannelState, CheckSignature, ClientState, Deny, DenyAll, DevToken, EVENT_MAP, InsightMetrics, JWTServerToken, JWTUserToken, MaxPriority, MinPriority, Permission, StableWSConnection, StreamChat, TokenManager, UserFromToken, buildWsFatalInsight, buildWsSuccessAfterFailureInsight, chatCodes, decodeBase64, encodeBase64, isOwnUser, isValidEventType, logChatPromiseExecution };
|
|
9463
|
+
export { Allow, AllowAll, AnyResource, AnyRole, BuiltinPermissions, BuiltinRoles, Channel, ChannelState, CheckSignature, ClientState, Deny, DenyAll, DevToken, EVENT_MAP, InsightMetrics, JWTServerToken, JWTUserToken, MaxPriority, MinPriority, Permission, StableWSConnection, StreamChat, TokenManager, UserFromToken, buildWsFatalInsight, buildWsSuccessAfterFailureInsight, chatCodes, decodeBase64, encodeBase64, isOwnUser, isValidEventType, logChatPromiseExecution, postInsights };
|
|
9451
9464
|
//# sourceMappingURL=index.es.js.map
|