stream-chat 4.3.0 → 4.4.2
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 +830 -635
- 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 +832 -634
- package/dist/browser.js.map +1 -1
- package/dist/index.es.js +830 -635
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +832 -634
- package/dist/index.js.map +1 -1
- package/dist/types/client.d.ts +11 -0
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/connection.d.ts +14 -2
- package/dist/types/connection.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/insights.d.ts +58 -0
- package/dist/types/insights.d.ts.map +1 -0
- package/dist/types/types.d.ts +5 -1
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils.d.ts +1 -0
- package/dist/types/utils.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +27 -0
- package/src/connection.ts +40 -7
- package/src/index.ts +1 -0
- package/src/insights.ts +72 -0
- package/src/types.ts +4 -1
- package/src/utils.ts +51 -6
package/dist/browser.es.js
CHANGED
|
@@ -88,9 +88,9 @@ var decodeBase64 = function decodeBase64(s) {
|
|
|
88
88
|
|
|
89
89
|
var https = null;
|
|
90
90
|
|
|
91
|
-
function ownKeys$
|
|
91
|
+
function ownKeys$5(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
92
92
|
|
|
93
|
-
function _objectSpread$
|
|
93
|
+
function _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$5(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$5(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
94
94
|
|
|
95
95
|
/**
|
|
96
96
|
* ChannelState - A container class for the channel state.
|
|
@@ -158,7 +158,7 @@ var ChannelState = /*#__PURE__*/function () {
|
|
|
158
158
|
var m = messages[i];
|
|
159
159
|
|
|
160
160
|
if (((_m$user = m.user) === null || _m$user === void 0 ? void 0 : _m$user.id) === user.id) {
|
|
161
|
-
messages[i] = _objectSpread$
|
|
161
|
+
messages[i] = _objectSpread$5(_objectSpread$5({}, m), {}, {
|
|
162
162
|
user: user
|
|
163
163
|
});
|
|
164
164
|
}
|
|
@@ -211,7 +211,7 @@ var ChannelState = /*#__PURE__*/function () {
|
|
|
211
211
|
user: m.user
|
|
212
212
|
};
|
|
213
213
|
} else {
|
|
214
|
-
messages[i] = _objectSpread$
|
|
214
|
+
messages[i] = _objectSpread$5(_objectSpread$5({}, m), {}, {
|
|
215
215
|
type: 'deleted',
|
|
216
216
|
deleted_at: user.deleted_at
|
|
217
217
|
});
|
|
@@ -279,7 +279,7 @@ var ChannelState = /*#__PURE__*/function () {
|
|
|
279
279
|
}, {
|
|
280
280
|
key: "formatMessage",
|
|
281
281
|
value: function formatMessage(message) {
|
|
282
|
-
return _objectSpread$
|
|
282
|
+
return _objectSpread$5(_objectSpread$5({}, message), {}, {
|
|
283
283
|
/**
|
|
284
284
|
* @deprecated please use `html`
|
|
285
285
|
*/
|
|
@@ -469,7 +469,7 @@ var ChannelState = /*#__PURE__*/function () {
|
|
|
469
469
|
var parseMessage = function parseMessage(m) {
|
|
470
470
|
var _m$pinned_at, _m$updated_at;
|
|
471
471
|
|
|
472
|
-
return _objectSpread$
|
|
472
|
+
return _objectSpread$5(_objectSpread$5({}, m), {}, {
|
|
473
473
|
created_at: m.created_at.toString(),
|
|
474
474
|
pinned_at: (_m$pinned_at = m.pinned_at) === null || _m$pinned_at === void 0 ? void 0 : _m$pinned_at.toString(),
|
|
475
475
|
updated_at: (_m$updated_at = m.updated_at) === null || _m$updated_at === void 0 ? void 0 : _m$updated_at.toString()
|
|
@@ -479,8 +479,8 @@ var ChannelState = /*#__PURE__*/function () {
|
|
|
479
479
|
var updatedMessages = this.messages.filter(function (msg) {
|
|
480
480
|
return msg.quoted_message_id === message.id;
|
|
481
481
|
}).map(parseMessage).map(function (msg) {
|
|
482
|
-
return _objectSpread$
|
|
483
|
-
quoted_message: _objectSpread$
|
|
482
|
+
return _objectSpread$5(_objectSpread$5({}, msg), {}, {
|
|
483
|
+
quoted_message: _objectSpread$5(_objectSpread$5({}, message), {}, {
|
|
484
484
|
attachments: []
|
|
485
485
|
})
|
|
486
486
|
});
|
|
@@ -700,9 +700,9 @@ var ChannelState = /*#__PURE__*/function () {
|
|
|
700
700
|
return ChannelState;
|
|
701
701
|
}();
|
|
702
702
|
|
|
703
|
-
function ownKeys$
|
|
703
|
+
function ownKeys$4(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
704
704
|
|
|
705
|
-
function _objectSpread$
|
|
705
|
+
function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$4(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$4(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
706
706
|
|
|
707
707
|
var EVENT_MAP = {
|
|
708
708
|
'channel.created': true,
|
|
@@ -749,7 +749,7 @@ var EVENT_MAP = {
|
|
|
749
749
|
'connection.recovered': true
|
|
750
750
|
};
|
|
751
751
|
|
|
752
|
-
var IS_VALID_EVENT_MAP_TYPE = _objectSpread$
|
|
752
|
+
var IS_VALID_EVENT_MAP_TYPE = _objectSpread$4(_objectSpread$4({}, EVENT_MAP), {}, {
|
|
753
753
|
all: true
|
|
754
754
|
});
|
|
755
755
|
|
|
@@ -882,17 +882,52 @@ function retryInterval(numberOfFailures) {
|
|
|
882
882
|
var min = Math.min(Math.max(250, (numberOfFailures - 1) * 2000), 25000);
|
|
883
883
|
return Math.floor(Math.random() * (max - min) + min);
|
|
884
884
|
}
|
|
885
|
-
/** adopted from https://github.com/ai/nanoid/blob/master/non-secure/index.js */
|
|
886
|
-
|
|
887
|
-
var alphabet = 'ModuleSymbhasOwnPr0123456789ABCDEFGHNRVfgctiUvzKqYTJkLxpZXIjQW';
|
|
888
885
|
function randomId() {
|
|
889
|
-
|
|
886
|
+
return generateUUIDv4();
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
function hex(bytes) {
|
|
890
|
+
var s = '';
|
|
891
|
+
|
|
892
|
+
for (var i = 0; i < bytes.length; i++) {
|
|
893
|
+
s += bytes[i].toString(16).padStart(2, '0');
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
return s;
|
|
897
|
+
} // https://tools.ietf.org/html/rfc4122
|
|
898
|
+
|
|
899
|
+
|
|
900
|
+
function generateUUIDv4() {
|
|
901
|
+
var bytes = getRandomBytes(16);
|
|
902
|
+
bytes[6] = bytes[6] & 0x0f | 0x40; // version
|
|
903
|
+
|
|
904
|
+
bytes[8] = bytes[8] & 0xbf | 0x80; // variant
|
|
905
|
+
|
|
906
|
+
return hex(bytes.subarray(0, 4)) + '-' + hex(bytes.subarray(4, 6)) + '-' + hex(bytes.subarray(6, 8)) + '-' + hex(bytes.subarray(8, 10)) + '-' + hex(bytes.subarray(10, 16));
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
function getRandomValuesWithMathRandom(bytes) {
|
|
910
|
+
var max = Math.pow(2, 8 * bytes.byteLength / bytes.length);
|
|
911
|
+
|
|
912
|
+
for (var i = 0; i < bytes.length; i++) {
|
|
913
|
+
bytes[i] = Math.random() * max;
|
|
914
|
+
}
|
|
915
|
+
}
|
|
890
916
|
|
|
891
|
-
|
|
892
|
-
|
|
917
|
+
var getRandomValues = function () {
|
|
918
|
+
if (typeof crypto !== 'undefined') {
|
|
919
|
+
return crypto.getRandomValues.bind(crypto);
|
|
920
|
+
} else if (typeof msCrypto !== 'undefined') {
|
|
921
|
+
return msCrypto.getRandomValues.bind(msCrypto);
|
|
922
|
+
} else {
|
|
923
|
+
return getRandomValuesWithMathRandom;
|
|
893
924
|
}
|
|
925
|
+
}();
|
|
894
926
|
|
|
895
|
-
|
|
927
|
+
function getRandomBytes(length) {
|
|
928
|
+
var bytes = new Uint8Array(length);
|
|
929
|
+
getRandomValues(bytes);
|
|
930
|
+
return bytes;
|
|
896
931
|
}
|
|
897
932
|
|
|
898
933
|
function _createForOfIteratorHelper$2(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$2(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
@@ -901,9 +936,9 @@ function _unsupportedIterableToArray$2(o, minLen) { if (!o) return; if (typeof o
|
|
|
901
936
|
|
|
902
937
|
function _arrayLikeToArray$2(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
903
938
|
|
|
904
|
-
function ownKeys$
|
|
939
|
+
function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
905
940
|
|
|
906
|
-
function _objectSpread$
|
|
941
|
+
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$3(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
907
942
|
|
|
908
943
|
/**
|
|
909
944
|
* Channel - The Channel class manages it's own state.
|
|
@@ -1023,7 +1058,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1023
1058
|
|
|
1024
1059
|
this.data = data; // this._data is used for the requests...
|
|
1025
1060
|
|
|
1026
|
-
this._data = _objectSpread$
|
|
1061
|
+
this._data = _objectSpread$3({}, data);
|
|
1027
1062
|
this.cid = "".concat(type, ":").concat(id);
|
|
1028
1063
|
this.listeners = {}; // perhaps the state variable should be private
|
|
1029
1064
|
|
|
@@ -1081,7 +1116,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1081
1116
|
switch (_context2.prev = _context2.next) {
|
|
1082
1117
|
case 0:
|
|
1083
1118
|
_context2.next = 2;
|
|
1084
|
-
return this.getClient().post(this._channelURL() + '/message', _objectSpread$
|
|
1119
|
+
return this.getClient().post(this._channelURL() + '/message', _objectSpread$3({
|
|
1085
1120
|
message: message
|
|
1086
1121
|
}, options));
|
|
1087
1122
|
|
|
@@ -1200,7 +1235,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1200
1235
|
|
|
1201
1236
|
case 3:
|
|
1202
1237
|
// Return a list of channels
|
|
1203
|
-
payload = _objectSpread$
|
|
1238
|
+
payload = _objectSpread$3(_objectSpread$3({
|
|
1204
1239
|
filter_conditions: {
|
|
1205
1240
|
cid: this.cid
|
|
1206
1241
|
}
|
|
@@ -1297,7 +1332,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1297
1332
|
|
|
1298
1333
|
_context5.next = 6;
|
|
1299
1334
|
return this.getClient().get(this.getClient().baseURL + '/members', {
|
|
1300
|
-
payload: _objectSpread$
|
|
1335
|
+
payload: _objectSpread$3({
|
|
1301
1336
|
type: type,
|
|
1302
1337
|
id: id,
|
|
1303
1338
|
members: members,
|
|
@@ -1358,7 +1393,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1358
1393
|
|
|
1359
1394
|
case 4:
|
|
1360
1395
|
_context6.next = 6;
|
|
1361
|
-
return this.getClient().post(this.getClient().baseURL + "/messages/".concat(messageID, "/reaction"), _objectSpread$
|
|
1396
|
+
return this.getClient().post(this.getClient().baseURL + "/messages/".concat(messageID, "/reaction"), _objectSpread$3({
|
|
1362
1397
|
reaction: reaction
|
|
1363
1398
|
}, options));
|
|
1364
1399
|
|
|
@@ -1439,7 +1474,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1439
1474
|
delete channelData[key];
|
|
1440
1475
|
});
|
|
1441
1476
|
_context7.next = 7;
|
|
1442
|
-
return this._update(_objectSpread$
|
|
1477
|
+
return this._update(_objectSpread$3({
|
|
1443
1478
|
message: updateMessage,
|
|
1444
1479
|
data: channelData
|
|
1445
1480
|
}, options));
|
|
@@ -1664,7 +1699,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1664
1699
|
case 0:
|
|
1665
1700
|
options = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : {};
|
|
1666
1701
|
_context13.next = 3;
|
|
1667
|
-
return this._update(_objectSpread$
|
|
1702
|
+
return this._update(_objectSpread$3({
|
|
1668
1703
|
accept_invite: true
|
|
1669
1704
|
}, options));
|
|
1670
1705
|
|
|
@@ -1705,7 +1740,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
1705
1740
|
case 0:
|
|
1706
1741
|
options = _args14.length > 0 && _args14[0] !== undefined ? _args14[0] : {};
|
|
1707
1742
|
_context14.next = 3;
|
|
1708
|
-
return this._update(_objectSpread$
|
|
1743
|
+
return this._update(_objectSpread$3({
|
|
1709
1744
|
reject_invite: true
|
|
1710
1745
|
}, options));
|
|
1711
1746
|
|
|
@@ -2023,7 +2058,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2023
2058
|
case 0:
|
|
2024
2059
|
opts = _args22.length > 0 && _args22[0] !== undefined ? _args22[0] : {};
|
|
2025
2060
|
_context22.next = 3;
|
|
2026
|
-
return this.getClient().post(this.getClient().baseURL + '/moderation/mute/channel', _objectSpread$
|
|
2061
|
+
return this.getClient().post(this.getClient().baseURL + '/moderation/mute/channel', _objectSpread$3({
|
|
2027
2062
|
channel_cid: this.cid
|
|
2028
2063
|
}, opts));
|
|
2029
2064
|
|
|
@@ -2065,7 +2100,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2065
2100
|
case 0:
|
|
2066
2101
|
opts = _args23.length > 0 && _args23[0] !== undefined ? _args23[0] : {};
|
|
2067
2102
|
_context23.next = 3;
|
|
2068
|
-
return this.getClient().post(this.getClient().baseURL + '/moderation/unmute/channel', _objectSpread$
|
|
2103
|
+
return this.getClient().post(this.getClient().baseURL + '/moderation/unmute/channel', _objectSpread$3({
|
|
2069
2104
|
channel_cid: this.cid
|
|
2070
2105
|
}, opts));
|
|
2071
2106
|
|
|
@@ -2274,7 +2309,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2274
2309
|
|
|
2275
2310
|
case 4:
|
|
2276
2311
|
_context26.next = 6;
|
|
2277
|
-
return this.getClient().post(this._channelURL() + '/read', _objectSpread$
|
|
2312
|
+
return this.getClient().post(this._channelURL() + '/read', _objectSpread$3({}, data));
|
|
2278
2313
|
|
|
2279
2314
|
case 6:
|
|
2280
2315
|
return _context26.abrupt("return", _context26.sent);
|
|
@@ -2342,7 +2377,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2342
2377
|
defaultOptions.watch = false;
|
|
2343
2378
|
}
|
|
2344
2379
|
|
|
2345
|
-
combined = _objectSpread$
|
|
2380
|
+
combined = _objectSpread$3(_objectSpread$3({}, defaultOptions), options);
|
|
2346
2381
|
_context27.next = 7;
|
|
2347
2382
|
return this.query(combined);
|
|
2348
2383
|
|
|
@@ -2433,7 +2468,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2433
2468
|
switch (_context29.prev = _context29.next) {
|
|
2434
2469
|
case 0:
|
|
2435
2470
|
_context29.next = 2;
|
|
2436
|
-
return this.getClient().get(this.getClient().baseURL + "/messages/".concat(parent_id, "/replies"), _objectSpread$
|
|
2471
|
+
return this.getClient().get(this.getClient().baseURL + "/messages/".concat(parent_id, "/replies"), _objectSpread$3({}, options));
|
|
2437
2472
|
|
|
2438
2473
|
case 2:
|
|
2439
2474
|
data = _context29.sent;
|
|
@@ -2471,7 +2506,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2471
2506
|
}, {
|
|
2472
2507
|
key: "getReactions",
|
|
2473
2508
|
value: function getReactions(message_id, options) {
|
|
2474
|
-
return this.getClient().get(this.getClient().baseURL + "/messages/".concat(message_id, "/reactions"), _objectSpread$
|
|
2509
|
+
return this.getClient().get(this.getClient().baseURL + "/messages/".concat(message_id, "/reactions"), _objectSpread$3({}, options));
|
|
2475
2510
|
}
|
|
2476
2511
|
/**
|
|
2477
2512
|
* getMessagesById - Retrieves a list of messages by ID
|
|
@@ -2603,7 +2638,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2603
2638
|
}
|
|
2604
2639
|
|
|
2605
2640
|
_context30.next = 6;
|
|
2606
|
-
return this.getClient().post(queryURL + '/query', _objectSpread$
|
|
2641
|
+
return this.getClient().post(queryURL + '/query', _objectSpread$3({
|
|
2607
2642
|
data: this._data,
|
|
2608
2643
|
state: true
|
|
2609
2644
|
}, options));
|
|
@@ -2674,7 +2709,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2674
2709
|
this._checkInitialized();
|
|
2675
2710
|
|
|
2676
2711
|
_context31.next = 3;
|
|
2677
|
-
return this.getClient().banUser(targetUserID, _objectSpread$
|
|
2712
|
+
return this.getClient().banUser(targetUserID, _objectSpread$3(_objectSpread$3({}, options), {}, {
|
|
2678
2713
|
type: this.type,
|
|
2679
2714
|
id: this.id
|
|
2680
2715
|
}));
|
|
@@ -2846,7 +2881,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2846
2881
|
this._checkInitialized();
|
|
2847
2882
|
|
|
2848
2883
|
_context35.next = 3;
|
|
2849
|
-
return this.getClient().shadowBan(targetUserID, _objectSpread$
|
|
2884
|
+
return this.getClient().shadowBan(targetUserID, _objectSpread$3(_objectSpread$3({}, options), {}, {
|
|
2850
2885
|
type: this.type,
|
|
2851
2886
|
id: this.id
|
|
2852
2887
|
}));
|
|
@@ -3259,7 +3294,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3259
3294
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
3260
3295
|
var read = _step3.value;
|
|
3261
3296
|
|
|
3262
|
-
var parsedRead = _objectSpread$
|
|
3297
|
+
var parsedRead = _objectSpread$3(_objectSpread$3({}, read), {}, {
|
|
3263
3298
|
last_read: new Date(read.last_read)
|
|
3264
3299
|
});
|
|
3265
3300
|
|
|
@@ -3386,6 +3421,64 @@ var ClientState = /*#__PURE__*/function () {
|
|
|
3386
3421
|
return ClientState;
|
|
3387
3422
|
}();
|
|
3388
3423
|
|
|
3424
|
+
function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
3425
|
+
|
|
3426
|
+
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$2(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
3427
|
+
var InsightMetrics = function InsightMetrics() {
|
|
3428
|
+
_classCallCheck(this, InsightMetrics);
|
|
3429
|
+
|
|
3430
|
+
_defineProperty(this, "connectionStartTimestamp", void 0);
|
|
3431
|
+
|
|
3432
|
+
_defineProperty(this, "wsConsecutiveFailures", void 0);
|
|
3433
|
+
|
|
3434
|
+
_defineProperty(this, "wsTotalFailures", void 0);
|
|
3435
|
+
|
|
3436
|
+
_defineProperty(this, "instanceClientId", void 0);
|
|
3437
|
+
|
|
3438
|
+
this.connectionStartTimestamp = null;
|
|
3439
|
+
this.wsTotalFailures = 0;
|
|
3440
|
+
this.wsConsecutiveFailures = 0;
|
|
3441
|
+
this.instanceClientId = randomId();
|
|
3442
|
+
};
|
|
3443
|
+
function buildWsFatalInsight(connection, event) {
|
|
3444
|
+
return _objectSpread$2({
|
|
3445
|
+
err: {
|
|
3446
|
+
wasClean: event.wasClean,
|
|
3447
|
+
code: event.code,
|
|
3448
|
+
reason: event.reason
|
|
3449
|
+
}
|
|
3450
|
+
}, buildWsBaseInsight(connection));
|
|
3451
|
+
}
|
|
3452
|
+
|
|
3453
|
+
function buildWsBaseInsight(connection) {
|
|
3454
|
+
var _connection$ws, _navigator, _navigator2;
|
|
3455
|
+
|
|
3456
|
+
return {
|
|
3457
|
+
ready_state: (_connection$ws = connection.ws) === null || _connection$ws === void 0 ? void 0 : _connection$ws.readyState,
|
|
3458
|
+
url: connection._buildUrl(connection.requestID),
|
|
3459
|
+
api_key: connection.apiKey,
|
|
3460
|
+
start_ts: connection.insightMetrics.connectionStartTimestamp,
|
|
3461
|
+
end_ts: new Date().getTime(),
|
|
3462
|
+
auth_type: connection.authType,
|
|
3463
|
+
token: connection.tokenManager.token,
|
|
3464
|
+
user_id: connection.userID,
|
|
3465
|
+
user_details: connection.user,
|
|
3466
|
+
device: connection.device,
|
|
3467
|
+
client_id: connection.connectionID,
|
|
3468
|
+
ws_details: connection.ws,
|
|
3469
|
+
ws_consecutive_failures: connection.insightMetrics.wsConsecutiveFailures,
|
|
3470
|
+
ws_total_failures: connection.insightMetrics.wsTotalFailures,
|
|
3471
|
+
request_id: connection.requestID,
|
|
3472
|
+
online: typeof navigator !== 'undefined' ? (_navigator = navigator) === null || _navigator === void 0 ? void 0 : _navigator.onLine : null,
|
|
3473
|
+
user_agent: typeof navigator !== 'undefined' ? (_navigator2 = navigator) === null || _navigator2 === void 0 ? void 0 : _navigator2.userAgent : null,
|
|
3474
|
+
instance_client_id: connection.insightMetrics.instanceClientId
|
|
3475
|
+
};
|
|
3476
|
+
}
|
|
3477
|
+
|
|
3478
|
+
function buildWsSuccessAfterFailureInsight(connection) {
|
|
3479
|
+
return buildWsBaseInsight(connection);
|
|
3480
|
+
}
|
|
3481
|
+
|
|
3389
3482
|
// Type guards to check WebSocket error type
|
|
3390
3483
|
var isCloseEvent = function isCloseEvent(res) {
|
|
3391
3484
|
return res.code !== undefined;
|
|
@@ -3428,7 +3521,9 @@ var StableWSConnection = /*#__PURE__*/function () {
|
|
|
3428
3521
|
userAgent = _ref.userAgent,
|
|
3429
3522
|
userID = _ref.userID,
|
|
3430
3523
|
wsBaseURL = _ref.wsBaseURL,
|
|
3431
|
-
device = _ref.device
|
|
3524
|
+
device = _ref.device,
|
|
3525
|
+
postInsights = _ref.postInsights,
|
|
3526
|
+
insightMetrics = _ref.insightMetrics;
|
|
3432
3527
|
|
|
3433
3528
|
_classCallCheck(this, StableWSConnection);
|
|
3434
3529
|
|
|
@@ -3482,6 +3577,10 @@ var StableWSConnection = /*#__PURE__*/function () {
|
|
|
3482
3577
|
|
|
3483
3578
|
_defineProperty(this, "rejectPromise", void 0);
|
|
3484
3579
|
|
|
3580
|
+
_defineProperty(this, "requestID", void 0);
|
|
3581
|
+
|
|
3582
|
+
_defineProperty(this, "connectionStartTimestamp", void 0);
|
|
3583
|
+
|
|
3485
3584
|
_defineProperty(this, "resolvePromise", void 0);
|
|
3486
3585
|
|
|
3487
3586
|
_defineProperty(this, "totalFailures", void 0);
|
|
@@ -3490,13 +3589,18 @@ var StableWSConnection = /*#__PURE__*/function () {
|
|
|
3490
3589
|
|
|
3491
3590
|
_defineProperty(this, "wsID", void 0);
|
|
3492
3591
|
|
|
3493
|
-
_defineProperty(this, "
|
|
3592
|
+
_defineProperty(this, "postInsights", void 0);
|
|
3593
|
+
|
|
3594
|
+
_defineProperty(this, "insightMetrics", void 0);
|
|
3595
|
+
|
|
3596
|
+
_defineProperty(this, "_buildUrl", function (reqID) {
|
|
3494
3597
|
var params = {
|
|
3495
3598
|
user_id: _this.user.id,
|
|
3496
3599
|
user_details: _this.user,
|
|
3497
3600
|
user_token: _this.tokenManager.getToken(),
|
|
3498
3601
|
server_determines_connection_id: true,
|
|
3499
|
-
device: _this.device
|
|
3602
|
+
device: _this.device,
|
|
3603
|
+
request_id: reqID
|
|
3500
3604
|
};
|
|
3501
3605
|
var qs = encodeURIComponent(JSON.stringify(params));
|
|
3502
3606
|
|
|
@@ -3581,6 +3685,14 @@ var StableWSConnection = /*#__PURE__*/function () {
|
|
|
3581
3685
|
});
|
|
3582
3686
|
|
|
3583
3687
|
_defineProperty(this, "onclose", function (wsID, event) {
|
|
3688
|
+
if (event.code !== chatCodes.WS_CLOSED_SUCCESS) {
|
|
3689
|
+
var _this$postInsights;
|
|
3690
|
+
|
|
3691
|
+
_this.insightMetrics.wsConsecutiveFailures++;
|
|
3692
|
+
_this.insightMetrics.wsTotalFailures++;
|
|
3693
|
+
(_this$postInsights = _this.postInsights) === null || _this$postInsights === void 0 ? void 0 : _this$postInsights.call(_this, 'ws_fatal', buildWsFatalInsight(_this, event));
|
|
3694
|
+
}
|
|
3695
|
+
|
|
3584
3696
|
_this.logger('info', 'connection:onclose() - onclose callback - ' + event.code, {
|
|
3585
3697
|
tags: ['connection'],
|
|
3586
3698
|
event: event,
|
|
@@ -3761,8 +3873,7 @@ var StableWSConnection = /*#__PURE__*/function () {
|
|
|
3761
3873
|
// send the healthcheck.., server replies with a health check event
|
|
3762
3874
|
var data = [{
|
|
3763
3875
|
type: 'health.check',
|
|
3764
|
-
client_id: _this.clientID
|
|
3765
|
-
user_id: _this.userID
|
|
3876
|
+
client_id: _this.clientID
|
|
3766
3877
|
}]; // try to send on the connection
|
|
3767
3878
|
|
|
3768
3879
|
try {
|
|
@@ -3836,6 +3947,9 @@ var StableWSConnection = /*#__PURE__*/function () {
|
|
|
3836
3947
|
this.connectionCheckTimeout = this.pingInterval + 10 * 1000;
|
|
3837
3948
|
|
|
3838
3949
|
this._listenForConnectionChanges();
|
|
3950
|
+
|
|
3951
|
+
this.postInsights = postInsights;
|
|
3952
|
+
this.insightMetrics = insightMetrics;
|
|
3839
3953
|
}
|
|
3840
3954
|
/**
|
|
3841
3955
|
* connect - Connect to the WS URL
|
|
@@ -4041,6 +4155,12 @@ var StableWSConnection = /*#__PURE__*/function () {
|
|
|
4041
4155
|
|
|
4042
4156
|
return _waitForHealthy;
|
|
4043
4157
|
}()
|
|
4158
|
+
/**
|
|
4159
|
+
* Builds and returns the url for websocket.
|
|
4160
|
+
* @param reqID Unique identifier generated on client side, to help tracking apis on backend.
|
|
4161
|
+
* @returns url string
|
|
4162
|
+
*/
|
|
4163
|
+
|
|
4044
4164
|
}, {
|
|
4045
4165
|
key: "disconnect",
|
|
4046
4166
|
value:
|
|
@@ -4118,7 +4238,8 @@ var StableWSConnection = /*#__PURE__*/function () {
|
|
|
4118
4238
|
key: "_connect",
|
|
4119
4239
|
value: function () {
|
|
4120
4240
|
var _connect3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
4121
|
-
var wsURL, response;
|
|
4241
|
+
var wsURL, response, _this$postInsights2;
|
|
4242
|
+
|
|
4122
4243
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
4123
4244
|
while (1) {
|
|
4124
4245
|
switch (_context5.prev = _context5.next) {
|
|
@@ -4133,50 +4254,58 @@ var StableWSConnection = /*#__PURE__*/function () {
|
|
|
4133
4254
|
case 2:
|
|
4134
4255
|
// simply ignore _connect if it's currently trying to connect
|
|
4135
4256
|
this.isConnecting = true;
|
|
4136
|
-
|
|
4137
|
-
|
|
4257
|
+
this.requestID = randomId();
|
|
4258
|
+
this.insightMetrics.connectionStartTimestamp = new Date().getTime();
|
|
4259
|
+
_context5.prev = 5;
|
|
4260
|
+
_context5.next = 8;
|
|
4138
4261
|
return this.tokenManager.tokenReady();
|
|
4139
4262
|
|
|
4140
|
-
case
|
|
4263
|
+
case 8:
|
|
4141
4264
|
this._setupConnectionPromise();
|
|
4142
4265
|
|
|
4143
|
-
wsURL = this._buildUrl();
|
|
4266
|
+
wsURL = this._buildUrl(this.requestID);
|
|
4144
4267
|
this.ws = new WebSocket(wsURL);
|
|
4145
4268
|
this.ws.onopen = this.onopen.bind(this, this.wsID);
|
|
4146
4269
|
this.ws.onclose = this.onclose.bind(this, this.wsID);
|
|
4147
4270
|
this.ws.onerror = this.onerror.bind(this, this.wsID);
|
|
4148
4271
|
this.ws.onmessage = this.onmessage.bind(this, this.wsID);
|
|
4149
|
-
_context5.next =
|
|
4272
|
+
_context5.next = 17;
|
|
4150
4273
|
return this.connectionOpen;
|
|
4151
4274
|
|
|
4152
|
-
case
|
|
4275
|
+
case 17:
|
|
4153
4276
|
response = _context5.sent;
|
|
4154
4277
|
this.isConnecting = false;
|
|
4155
4278
|
|
|
4156
4279
|
if (!response) {
|
|
4157
|
-
_context5.next =
|
|
4280
|
+
_context5.next = 23;
|
|
4158
4281
|
break;
|
|
4159
4282
|
}
|
|
4160
4283
|
|
|
4161
4284
|
this.connectionID = response.connection_id;
|
|
4285
|
+
|
|
4286
|
+
if (this.insightMetrics.wsConsecutiveFailures > 0) {
|
|
4287
|
+
(_this$postInsights2 = this.postInsights) === null || _this$postInsights2 === void 0 ? void 0 : _this$postInsights2.call(this, 'ws_success_after_failure', buildWsSuccessAfterFailureInsight(this));
|
|
4288
|
+
this.insightMetrics.wsConsecutiveFailures = 0;
|
|
4289
|
+
}
|
|
4290
|
+
|
|
4162
4291
|
return _context5.abrupt("return", response);
|
|
4163
4292
|
|
|
4164
|
-
case
|
|
4165
|
-
_context5.next =
|
|
4293
|
+
case 23:
|
|
4294
|
+
_context5.next = 29;
|
|
4166
4295
|
break;
|
|
4167
4296
|
|
|
4168
|
-
case
|
|
4169
|
-
_context5.prev =
|
|
4170
|
-
_context5.t0 = _context5["catch"](
|
|
4297
|
+
case 25:
|
|
4298
|
+
_context5.prev = 25;
|
|
4299
|
+
_context5.t0 = _context5["catch"](5);
|
|
4171
4300
|
this.isConnecting = false;
|
|
4172
4301
|
throw _context5.t0;
|
|
4173
4302
|
|
|
4174
|
-
case
|
|
4303
|
+
case 29:
|
|
4175
4304
|
case "end":
|
|
4176
4305
|
return _context5.stop();
|
|
4177
4306
|
}
|
|
4178
4307
|
}
|
|
4179
|
-
}, _callee5, this, [[
|
|
4308
|
+
}, _callee5, this, [[5, 25]]);
|
|
4180
4309
|
}));
|
|
4181
4310
|
|
|
4182
4311
|
function _connect() {
|
|
@@ -4379,7 +4508,7 @@ var StableWSConnection = /*#__PURE__*/function () {
|
|
|
4379
4508
|
|
|
4380
4509
|
var jwt = null;
|
|
4381
4510
|
|
|
4382
|
-
var crypto = null;
|
|
4511
|
+
var crypto$1 = null;
|
|
4383
4512
|
|
|
4384
4513
|
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
4385
4514
|
|
|
@@ -4466,7 +4595,7 @@ function DevToken(userId) {
|
|
|
4466
4595
|
|
|
4467
4596
|
function CheckSignature(body, secret, signature) {
|
|
4468
4597
|
var key = Buffer.from(secret, 'ascii');
|
|
4469
|
-
var hash = crypto.createHmac('sha256', key).update(body).digest('hex');
|
|
4598
|
+
var hash = crypto$1.createHmac('sha256', key).update(body).digest('hex');
|
|
4470
4599
|
return hash === signature;
|
|
4471
4600
|
}
|
|
4472
4601
|
|
|
@@ -4736,6 +4865,8 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
4736
4865
|
|
|
4737
4866
|
_defineProperty(this, "consecutiveFailures", void 0);
|
|
4738
4867
|
|
|
4868
|
+
_defineProperty(this, "insightMetrics", void 0);
|
|
4869
|
+
|
|
4739
4870
|
_defineProperty(this, "_hasConnectionID", function () {
|
|
4740
4871
|
var _this$wsConnection;
|
|
4741
4872
|
|
|
@@ -5388,6 +5519,67 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
5388
5519
|
return !!_this.secret;
|
|
5389
5520
|
});
|
|
5390
5521
|
|
|
5522
|
+
_defineProperty(this, "postInsights", /*#__PURE__*/function () {
|
|
5523
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(insightType, insights) {
|
|
5524
|
+
var maxAttempts, i;
|
|
5525
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
5526
|
+
while (1) {
|
|
5527
|
+
switch (_context6.prev = _context6.next) {
|
|
5528
|
+
case 0:
|
|
5529
|
+
maxAttempts = 3;
|
|
5530
|
+
i = 0;
|
|
5531
|
+
|
|
5532
|
+
case 2:
|
|
5533
|
+
if (!(i < maxAttempts)) {
|
|
5534
|
+
_context6.next = 18;
|
|
5535
|
+
break;
|
|
5536
|
+
}
|
|
5537
|
+
|
|
5538
|
+
_context6.prev = 3;
|
|
5539
|
+
_context6.next = 6;
|
|
5540
|
+
return _this.axiosInstance.post("https://insights.stream-io-api.com/insights/".concat(insightType), insights);
|
|
5541
|
+
|
|
5542
|
+
case 6:
|
|
5543
|
+
_context6.next = 14;
|
|
5544
|
+
break;
|
|
5545
|
+
|
|
5546
|
+
case 8:
|
|
5547
|
+
_context6.prev = 8;
|
|
5548
|
+
_context6.t0 = _context6["catch"](3);
|
|
5549
|
+
|
|
5550
|
+
_this.logger('warn', "failed to send insights event ".concat(insightType), {
|
|
5551
|
+
tags: ['insights', 'connection'],
|
|
5552
|
+
error: _context6.t0,
|
|
5553
|
+
insights: insights
|
|
5554
|
+
});
|
|
5555
|
+
|
|
5556
|
+
_context6.next = 13;
|
|
5557
|
+
return sleep((i + 1) * 3000);
|
|
5558
|
+
|
|
5559
|
+
case 13:
|
|
5560
|
+
return _context6.abrupt("continue", 15);
|
|
5561
|
+
|
|
5562
|
+
case 14:
|
|
5563
|
+
return _context6.abrupt("break", 18);
|
|
5564
|
+
|
|
5565
|
+
case 15:
|
|
5566
|
+
i++;
|
|
5567
|
+
_context6.next = 2;
|
|
5568
|
+
break;
|
|
5569
|
+
|
|
5570
|
+
case 18:
|
|
5571
|
+
case "end":
|
|
5572
|
+
return _context6.stop();
|
|
5573
|
+
}
|
|
5574
|
+
}
|
|
5575
|
+
}, _callee6, null, [[3, 8]]);
|
|
5576
|
+
}));
|
|
5577
|
+
|
|
5578
|
+
return function (_x7, _x8) {
|
|
5579
|
+
return _ref6.apply(this, arguments);
|
|
5580
|
+
};
|
|
5581
|
+
}());
|
|
5582
|
+
|
|
5391
5583
|
// set the key
|
|
5392
5584
|
this.key = _key;
|
|
5393
5585
|
this.listeners = {};
|
|
@@ -5443,6 +5635,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
5443
5635
|
|
|
5444
5636
|
this.tokenManager = new TokenManager(this.secret);
|
|
5445
5637
|
this.consecutiveFailures = 0;
|
|
5638
|
+
this.insightMetrics = new InsightMetrics();
|
|
5446
5639
|
/**
|
|
5447
5640
|
* logger function should accept 3 parameters:
|
|
5448
5641
|
* @param logLevel string
|
|
@@ -5591,32 +5784,32 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
5591
5784
|
}
|
|
5592
5785
|
*/
|
|
5593
5786
|
function () {
|
|
5594
|
-
var _updateAppSettings = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
5787
|
+
var _updateAppSettings = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(options) {
|
|
5595
5788
|
var _options$apn_config;
|
|
5596
5789
|
|
|
5597
|
-
return _regeneratorRuntime.wrap(function
|
|
5790
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
5598
5791
|
while (1) {
|
|
5599
|
-
switch (
|
|
5792
|
+
switch (_context7.prev = _context7.next) {
|
|
5600
5793
|
case 0:
|
|
5601
5794
|
if ((_options$apn_config = options.apn_config) !== null && _options$apn_config !== void 0 && _options$apn_config.p12_cert) {
|
|
5602
5795
|
options.apn_config.p12_cert = Buffer.from(options.apn_config.p12_cert).toString('base64');
|
|
5603
5796
|
}
|
|
5604
5797
|
|
|
5605
|
-
|
|
5798
|
+
_context7.next = 3;
|
|
5606
5799
|
return this.patch(this.baseURL + '/app', options);
|
|
5607
5800
|
|
|
5608
5801
|
case 3:
|
|
5609
|
-
return
|
|
5802
|
+
return _context7.abrupt("return", _context7.sent);
|
|
5610
5803
|
|
|
5611
5804
|
case 4:
|
|
5612
5805
|
case "end":
|
|
5613
|
-
return
|
|
5806
|
+
return _context7.stop();
|
|
5614
5807
|
}
|
|
5615
5808
|
}
|
|
5616
|
-
},
|
|
5809
|
+
}, _callee7, this);
|
|
5617
5810
|
}));
|
|
5618
5811
|
|
|
5619
|
-
function updateAppSettings(
|
|
5812
|
+
function updateAppSettings(_x9) {
|
|
5620
5813
|
return _updateAppSettings.apply(this, arguments);
|
|
5621
5814
|
}
|
|
5622
5815
|
|
|
@@ -5629,28 +5822,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
5629
5822
|
* Revokes all tokens on application level issued before given time
|
|
5630
5823
|
*/
|
|
5631
5824
|
function () {
|
|
5632
|
-
var _revokeTokens = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
5633
|
-
return _regeneratorRuntime.wrap(function
|
|
5825
|
+
var _revokeTokens = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(before) {
|
|
5826
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
5634
5827
|
while (1) {
|
|
5635
|
-
switch (
|
|
5828
|
+
switch (_context8.prev = _context8.next) {
|
|
5636
5829
|
case 0:
|
|
5637
|
-
|
|
5830
|
+
_context8.next = 2;
|
|
5638
5831
|
return this.updateAppSettings({
|
|
5639
5832
|
revoke_tokens_issued_before: this._normalizeDate(before)
|
|
5640
5833
|
});
|
|
5641
5834
|
|
|
5642
5835
|
case 2:
|
|
5643
|
-
return
|
|
5836
|
+
return _context8.abrupt("return", _context8.sent);
|
|
5644
5837
|
|
|
5645
5838
|
case 3:
|
|
5646
5839
|
case "end":
|
|
5647
|
-
return
|
|
5840
|
+
return _context8.stop();
|
|
5648
5841
|
}
|
|
5649
5842
|
}
|
|
5650
|
-
},
|
|
5843
|
+
}, _callee8, this);
|
|
5651
5844
|
}));
|
|
5652
5845
|
|
|
5653
|
-
function revokeTokens(
|
|
5846
|
+
function revokeTokens(_x10) {
|
|
5654
5847
|
return _revokeTokens.apply(this, arguments);
|
|
5655
5848
|
}
|
|
5656
5849
|
|
|
@@ -5663,26 +5856,26 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
5663
5856
|
}, {
|
|
5664
5857
|
key: "revokeUserToken",
|
|
5665
5858
|
value: function () {
|
|
5666
|
-
var _revokeUserToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
5667
|
-
return _regeneratorRuntime.wrap(function
|
|
5859
|
+
var _revokeUserToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(userID, before) {
|
|
5860
|
+
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
5668
5861
|
while (1) {
|
|
5669
|
-
switch (
|
|
5862
|
+
switch (_context9.prev = _context9.next) {
|
|
5670
5863
|
case 0:
|
|
5671
|
-
|
|
5864
|
+
_context9.next = 2;
|
|
5672
5865
|
return this.revokeUsersToken([userID], before);
|
|
5673
5866
|
|
|
5674
5867
|
case 2:
|
|
5675
|
-
return
|
|
5868
|
+
return _context9.abrupt("return", _context9.sent);
|
|
5676
5869
|
|
|
5677
5870
|
case 3:
|
|
5678
5871
|
case "end":
|
|
5679
|
-
return
|
|
5872
|
+
return _context9.stop();
|
|
5680
5873
|
}
|
|
5681
5874
|
}
|
|
5682
|
-
},
|
|
5875
|
+
}, _callee9, this);
|
|
5683
5876
|
}));
|
|
5684
5877
|
|
|
5685
|
-
function revokeUserToken(
|
|
5878
|
+
function revokeUserToken(_x11, _x12) {
|
|
5686
5879
|
return _revokeUserToken.apply(this, arguments);
|
|
5687
5880
|
}
|
|
5688
5881
|
|
|
@@ -5695,12 +5888,12 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
5695
5888
|
}, {
|
|
5696
5889
|
key: "revokeUsersToken",
|
|
5697
5890
|
value: function () {
|
|
5698
|
-
var _revokeUsersToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
5891
|
+
var _revokeUsersToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(userIDs, before) {
|
|
5699
5892
|
var users, _iterator, _step, userID;
|
|
5700
5893
|
|
|
5701
|
-
return _regeneratorRuntime.wrap(function
|
|
5894
|
+
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
5702
5895
|
while (1) {
|
|
5703
|
-
switch (
|
|
5896
|
+
switch (_context10.prev = _context10.next) {
|
|
5704
5897
|
case 0:
|
|
5705
5898
|
if (before === undefined) {
|
|
5706
5899
|
before = new Date().toISOString();
|
|
@@ -5727,21 +5920,21 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
5727
5920
|
_iterator.f();
|
|
5728
5921
|
}
|
|
5729
5922
|
|
|
5730
|
-
|
|
5923
|
+
_context10.next = 6;
|
|
5731
5924
|
return this.partialUpdateUsers(users);
|
|
5732
5925
|
|
|
5733
5926
|
case 6:
|
|
5734
|
-
return
|
|
5927
|
+
return _context10.abrupt("return", _context10.sent);
|
|
5735
5928
|
|
|
5736
5929
|
case 7:
|
|
5737
5930
|
case "end":
|
|
5738
|
-
return
|
|
5931
|
+
return _context10.stop();
|
|
5739
5932
|
}
|
|
5740
5933
|
}
|
|
5741
|
-
},
|
|
5934
|
+
}, _callee10, this);
|
|
5742
5935
|
}));
|
|
5743
5936
|
|
|
5744
|
-
function revokeUsersToken(
|
|
5937
|
+
function revokeUsersToken(_x13, _x14) {
|
|
5745
5938
|
return _revokeUsersToken.apply(this, arguments);
|
|
5746
5939
|
}
|
|
5747
5940
|
|
|
@@ -5754,23 +5947,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
5754
5947
|
}, {
|
|
5755
5948
|
key: "getAppSettings",
|
|
5756
5949
|
value: function () {
|
|
5757
|
-
var _getAppSettings = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
5758
|
-
return _regeneratorRuntime.wrap(function
|
|
5950
|
+
var _getAppSettings = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {
|
|
5951
|
+
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
5759
5952
|
while (1) {
|
|
5760
|
-
switch (
|
|
5953
|
+
switch (_context11.prev = _context11.next) {
|
|
5761
5954
|
case 0:
|
|
5762
|
-
|
|
5955
|
+
_context11.next = 2;
|
|
5763
5956
|
return this.get(this.baseURL + '/app');
|
|
5764
5957
|
|
|
5765
5958
|
case 2:
|
|
5766
|
-
return
|
|
5959
|
+
return _context11.abrupt("return", _context11.sent);
|
|
5767
5960
|
|
|
5768
5961
|
case 3:
|
|
5769
5962
|
case "end":
|
|
5770
|
-
return
|
|
5963
|
+
return _context11.stop();
|
|
5771
5964
|
}
|
|
5772
5965
|
}
|
|
5773
|
-
},
|
|
5966
|
+
}, _callee11, this);
|
|
5774
5967
|
}));
|
|
5775
5968
|
|
|
5776
5969
|
function getAppSettings() {
|
|
@@ -5797,15 +5990,15 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
5797
5990
|
}, {
|
|
5798
5991
|
key: "testPushSettings",
|
|
5799
5992
|
value: function () {
|
|
5800
|
-
var _testPushSettings = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
5993
|
+
var _testPushSettings = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(userID) {
|
|
5801
5994
|
var data,
|
|
5802
|
-
|
|
5803
|
-
return _regeneratorRuntime.wrap(function
|
|
5995
|
+
_args12 = arguments;
|
|
5996
|
+
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
5804
5997
|
while (1) {
|
|
5805
|
-
switch (
|
|
5998
|
+
switch (_context12.prev = _context12.next) {
|
|
5806
5999
|
case 0:
|
|
5807
|
-
data =
|
|
5808
|
-
|
|
6000
|
+
data = _args12.length > 1 && _args12[1] !== undefined ? _args12[1] : {};
|
|
6001
|
+
_context12.next = 3;
|
|
5809
6002
|
return this.post(this.baseURL + '/check_push', _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
5810
6003
|
user_id: userID
|
|
5811
6004
|
}, data.messageID ? {
|
|
@@ -5823,17 +6016,17 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
5823
6016
|
} : {}));
|
|
5824
6017
|
|
|
5825
6018
|
case 3:
|
|
5826
|
-
return
|
|
6019
|
+
return _context12.abrupt("return", _context12.sent);
|
|
5827
6020
|
|
|
5828
6021
|
case 4:
|
|
5829
6022
|
case "end":
|
|
5830
|
-
return
|
|
6023
|
+
return _context12.stop();
|
|
5831
6024
|
}
|
|
5832
6025
|
}
|
|
5833
|
-
},
|
|
6026
|
+
}, _callee12, this);
|
|
5834
6027
|
}));
|
|
5835
6028
|
|
|
5836
|
-
function testPushSettings(
|
|
6029
|
+
function testPushSettings(_x15) {
|
|
5837
6030
|
return _testPushSettings.apply(this, arguments);
|
|
5838
6031
|
}
|
|
5839
6032
|
|
|
@@ -5853,26 +6046,26 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
5853
6046
|
}, {
|
|
5854
6047
|
key: "testSQSSettings",
|
|
5855
6048
|
value: function () {
|
|
5856
|
-
var _testSQSSettings = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6049
|
+
var _testSQSSettings = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13() {
|
|
5857
6050
|
var data,
|
|
5858
|
-
|
|
5859
|
-
return _regeneratorRuntime.wrap(function
|
|
6051
|
+
_args13 = arguments;
|
|
6052
|
+
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
5860
6053
|
while (1) {
|
|
5861
|
-
switch (
|
|
6054
|
+
switch (_context13.prev = _context13.next) {
|
|
5862
6055
|
case 0:
|
|
5863
|
-
data =
|
|
5864
|
-
|
|
6056
|
+
data = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : {};
|
|
6057
|
+
_context13.next = 3;
|
|
5865
6058
|
return this.post(this.baseURL + '/check_sqs', data);
|
|
5866
6059
|
|
|
5867
6060
|
case 3:
|
|
5868
|
-
return
|
|
6061
|
+
return _context13.abrupt("return", _context13.sent);
|
|
5869
6062
|
|
|
5870
6063
|
case 4:
|
|
5871
6064
|
case "end":
|
|
5872
|
-
return
|
|
6065
|
+
return _context13.stop();
|
|
5873
6066
|
}
|
|
5874
6067
|
}
|
|
5875
|
-
},
|
|
6068
|
+
}, _callee13, this);
|
|
5876
6069
|
}));
|
|
5877
6070
|
|
|
5878
6071
|
function testSQSSettings() {
|
|
@@ -5899,50 +6092,50 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
5899
6092
|
* @return {ConnectAPIResponse<ChannelType, CommandType, UserType>} Returns a promise that resolves when the connection is setup
|
|
5900
6093
|
*/
|
|
5901
6094
|
function () {
|
|
5902
|
-
var _setGuestUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6095
|
+
var _setGuestUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(user) {
|
|
5903
6096
|
var response, _response$user, guestUser;
|
|
5904
6097
|
|
|
5905
|
-
return _regeneratorRuntime.wrap(function
|
|
6098
|
+
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
5906
6099
|
while (1) {
|
|
5907
|
-
switch (
|
|
6100
|
+
switch (_context14.prev = _context14.next) {
|
|
5908
6101
|
case 0:
|
|
5909
6102
|
this.anonymous = true;
|
|
5910
|
-
|
|
5911
|
-
|
|
6103
|
+
_context14.prev = 1;
|
|
6104
|
+
_context14.next = 4;
|
|
5912
6105
|
return this.post(this.baseURL + '/guest', {
|
|
5913
6106
|
user: user
|
|
5914
6107
|
});
|
|
5915
6108
|
|
|
5916
6109
|
case 4:
|
|
5917
|
-
response =
|
|
5918
|
-
|
|
6110
|
+
response = _context14.sent;
|
|
6111
|
+
_context14.next = 11;
|
|
5919
6112
|
break;
|
|
5920
6113
|
|
|
5921
6114
|
case 7:
|
|
5922
|
-
|
|
5923
|
-
|
|
6115
|
+
_context14.prev = 7;
|
|
6116
|
+
_context14.t0 = _context14["catch"](1);
|
|
5924
6117
|
this.anonymous = false;
|
|
5925
|
-
throw
|
|
6118
|
+
throw _context14.t0;
|
|
5926
6119
|
|
|
5927
6120
|
case 11:
|
|
5928
6121
|
this.anonymous = false; // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5929
6122
|
|
|
5930
6123
|
_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"]);
|
|
5931
|
-
|
|
6124
|
+
_context14.next = 15;
|
|
5932
6125
|
return this.connectUser(guestUser, response.access_token);
|
|
5933
6126
|
|
|
5934
6127
|
case 15:
|
|
5935
|
-
return
|
|
6128
|
+
return _context14.abrupt("return", _context14.sent);
|
|
5936
6129
|
|
|
5937
6130
|
case 16:
|
|
5938
6131
|
case "end":
|
|
5939
|
-
return
|
|
6132
|
+
return _context14.stop();
|
|
5940
6133
|
}
|
|
5941
6134
|
}
|
|
5942
|
-
},
|
|
6135
|
+
}, _callee14, this, [[1, 7]]);
|
|
5943
6136
|
}));
|
|
5944
6137
|
|
|
5945
|
-
function setGuestUser(
|
|
6138
|
+
function setGuestUser(_x16) {
|
|
5946
6139
|
return _setGuestUser.apply(this, arguments);
|
|
5947
6140
|
}
|
|
5948
6141
|
|
|
@@ -6252,17 +6445,17 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6252
6445
|
* @private
|
|
6253
6446
|
*/
|
|
6254
6447
|
function () {
|
|
6255
|
-
var _connect = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6448
|
+
var _connect = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15() {
|
|
6256
6449
|
var client, warmUpPromise, handshake;
|
|
6257
|
-
return _regeneratorRuntime.wrap(function
|
|
6450
|
+
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
|
6258
6451
|
while (1) {
|
|
6259
|
-
switch (
|
|
6452
|
+
switch (_context15.prev = _context15.next) {
|
|
6260
6453
|
case 0:
|
|
6261
6454
|
client = this;
|
|
6262
6455
|
this.failures = 0;
|
|
6263
6456
|
|
|
6264
6457
|
if (!(client.userID == null || this._user == null)) {
|
|
6265
|
-
|
|
6458
|
+
_context15.next = 4;
|
|
6266
6459
|
break;
|
|
6267
6460
|
}
|
|
6268
6461
|
|
|
@@ -6270,7 +6463,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6270
6463
|
|
|
6271
6464
|
case 4:
|
|
6272
6465
|
if (!(client.wsBaseURL == null)) {
|
|
6273
|
-
|
|
6466
|
+
_context15.next = 6;
|
|
6274
6467
|
break;
|
|
6275
6468
|
}
|
|
6276
6469
|
|
|
@@ -6278,7 +6471,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6278
6471
|
|
|
6279
6472
|
case 6:
|
|
6280
6473
|
if (!(client.clientID == null)) {
|
|
6281
|
-
|
|
6474
|
+
_context15.next = 8;
|
|
6282
6475
|
break;
|
|
6283
6476
|
}
|
|
6284
6477
|
|
|
@@ -6299,42 +6492,44 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6299
6492
|
messageCallback: this.handleEvent,
|
|
6300
6493
|
eventCallback: this.dispatchEvent,
|
|
6301
6494
|
logger: this.logger,
|
|
6302
|
-
device: this.options.device
|
|
6495
|
+
device: this.options.device,
|
|
6496
|
+
postInsights: this.options.enableInsights ? this.postInsights : undefined,
|
|
6497
|
+
insightMetrics: this.insightMetrics
|
|
6303
6498
|
});
|
|
6304
6499
|
|
|
6305
6500
|
if (this.options.warmUp) {
|
|
6306
6501
|
warmUpPromise = this.doAxiosRequest('options', this.baseURL + '/connect');
|
|
6307
6502
|
}
|
|
6308
6503
|
|
|
6309
|
-
|
|
6504
|
+
_context15.next = 12;
|
|
6310
6505
|
return this.wsConnection.connect();
|
|
6311
6506
|
|
|
6312
6507
|
case 12:
|
|
6313
|
-
handshake =
|
|
6314
|
-
|
|
6315
|
-
|
|
6508
|
+
handshake = _context15.sent;
|
|
6509
|
+
_context15.prev = 13;
|
|
6510
|
+
_context15.next = 16;
|
|
6316
6511
|
return warmUpPromise;
|
|
6317
6512
|
|
|
6318
6513
|
case 16:
|
|
6319
|
-
|
|
6514
|
+
_context15.next = 21;
|
|
6320
6515
|
break;
|
|
6321
6516
|
|
|
6322
6517
|
case 18:
|
|
6323
|
-
|
|
6324
|
-
|
|
6518
|
+
_context15.prev = 18;
|
|
6519
|
+
_context15.t0 = _context15["catch"](13);
|
|
6325
6520
|
this.logger('error', 'Warmup request failed', {
|
|
6326
|
-
error:
|
|
6521
|
+
error: _context15.t0
|
|
6327
6522
|
});
|
|
6328
6523
|
|
|
6329
6524
|
case 21:
|
|
6330
|
-
return
|
|
6525
|
+
return _context15.abrupt("return", handshake);
|
|
6331
6526
|
|
|
6332
6527
|
case 22:
|
|
6333
6528
|
case "end":
|
|
6334
|
-
return
|
|
6529
|
+
return _context15.stop();
|
|
6335
6530
|
}
|
|
6336
6531
|
}
|
|
6337
|
-
},
|
|
6532
|
+
}, _callee15, this, [[13, 18]]);
|
|
6338
6533
|
}));
|
|
6339
6534
|
|
|
6340
6535
|
function connect() {
|
|
@@ -6357,23 +6552,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6357
6552
|
}, {
|
|
6358
6553
|
key: "queryUsers",
|
|
6359
6554
|
value: function () {
|
|
6360
|
-
var _queryUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6555
|
+
var _queryUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(filterConditions) {
|
|
6361
6556
|
var sort,
|
|
6362
6557
|
options,
|
|
6363
6558
|
defaultOptions,
|
|
6364
6559
|
data,
|
|
6365
|
-
|
|
6366
|
-
return _regeneratorRuntime.wrap(function
|
|
6560
|
+
_args16 = arguments;
|
|
6561
|
+
return _regeneratorRuntime.wrap(function _callee16$(_context16) {
|
|
6367
6562
|
while (1) {
|
|
6368
|
-
switch (
|
|
6563
|
+
switch (_context16.prev = _context16.next) {
|
|
6369
6564
|
case 0:
|
|
6370
|
-
sort =
|
|
6371
|
-
options =
|
|
6565
|
+
sort = _args16.length > 1 && _args16[1] !== undefined ? _args16[1] : [];
|
|
6566
|
+
options = _args16.length > 2 && _args16[2] !== undefined ? _args16[2] : {};
|
|
6372
6567
|
defaultOptions = {
|
|
6373
6568
|
presence: false
|
|
6374
6569
|
}; // Make sure we wait for the connect promise if there is a pending one
|
|
6375
6570
|
|
|
6376
|
-
|
|
6571
|
+
_context16.next = 5;
|
|
6377
6572
|
return this.setUserPromise;
|
|
6378
6573
|
|
|
6379
6574
|
case 5:
|
|
@@ -6382,7 +6577,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6382
6577
|
} // Return a list of users
|
|
6383
6578
|
|
|
6384
6579
|
|
|
6385
|
-
|
|
6580
|
+
_context16.next = 8;
|
|
6386
6581
|
return this.get(this.baseURL + '/users', {
|
|
6387
6582
|
payload: _objectSpread(_objectSpread({
|
|
6388
6583
|
filter_conditions: filterConditions,
|
|
@@ -6391,19 +6586,19 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6391
6586
|
});
|
|
6392
6587
|
|
|
6393
6588
|
case 8:
|
|
6394
|
-
data =
|
|
6589
|
+
data = _context16.sent;
|
|
6395
6590
|
this.state.updateUsers(data.users);
|
|
6396
|
-
return
|
|
6591
|
+
return _context16.abrupt("return", data);
|
|
6397
6592
|
|
|
6398
6593
|
case 11:
|
|
6399
6594
|
case "end":
|
|
6400
|
-
return
|
|
6595
|
+
return _context16.stop();
|
|
6401
6596
|
}
|
|
6402
6597
|
}
|
|
6403
|
-
},
|
|
6598
|
+
}, _callee16, this);
|
|
6404
6599
|
}));
|
|
6405
6600
|
|
|
6406
|
-
function queryUsers(
|
|
6601
|
+
function queryUsers(_x17) {
|
|
6407
6602
|
return _queryUsers.apply(this, arguments);
|
|
6408
6603
|
}
|
|
6409
6604
|
|
|
@@ -6422,19 +6617,19 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6422
6617
|
}, {
|
|
6423
6618
|
key: "queryBannedUsers",
|
|
6424
6619
|
value: function () {
|
|
6425
|
-
var _queryBannedUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6620
|
+
var _queryBannedUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17() {
|
|
6426
6621
|
var filterConditions,
|
|
6427
6622
|
sort,
|
|
6428
6623
|
options,
|
|
6429
|
-
|
|
6430
|
-
return _regeneratorRuntime.wrap(function
|
|
6624
|
+
_args17 = arguments;
|
|
6625
|
+
return _regeneratorRuntime.wrap(function _callee17$(_context17) {
|
|
6431
6626
|
while (1) {
|
|
6432
|
-
switch (
|
|
6627
|
+
switch (_context17.prev = _context17.next) {
|
|
6433
6628
|
case 0:
|
|
6434
|
-
filterConditions =
|
|
6435
|
-
sort =
|
|
6436
|
-
options =
|
|
6437
|
-
|
|
6629
|
+
filterConditions = _args17.length > 0 && _args17[0] !== undefined ? _args17[0] : {};
|
|
6630
|
+
sort = _args17.length > 1 && _args17[1] !== undefined ? _args17[1] : [];
|
|
6631
|
+
options = _args17.length > 2 && _args17[2] !== undefined ? _args17[2] : {};
|
|
6632
|
+
_context17.next = 5;
|
|
6438
6633
|
return this.get(this.baseURL + '/query_banned_users', {
|
|
6439
6634
|
payload: _objectSpread({
|
|
6440
6635
|
filter_conditions: filterConditions,
|
|
@@ -6443,14 +6638,14 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6443
6638
|
});
|
|
6444
6639
|
|
|
6445
6640
|
case 5:
|
|
6446
|
-
return
|
|
6641
|
+
return _context17.abrupt("return", _context17.sent);
|
|
6447
6642
|
|
|
6448
6643
|
case 6:
|
|
6449
6644
|
case "end":
|
|
6450
|
-
return
|
|
6645
|
+
return _context17.stop();
|
|
6451
6646
|
}
|
|
6452
6647
|
}
|
|
6453
|
-
},
|
|
6648
|
+
}, _callee17, this);
|
|
6454
6649
|
}));
|
|
6455
6650
|
|
|
6456
6651
|
function queryBannedUsers() {
|
|
@@ -6471,17 +6666,17 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6471
6666
|
}, {
|
|
6472
6667
|
key: "queryMessageFlags",
|
|
6473
6668
|
value: function () {
|
|
6474
|
-
var _queryMessageFlags = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6669
|
+
var _queryMessageFlags = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18() {
|
|
6475
6670
|
var filterConditions,
|
|
6476
6671
|
options,
|
|
6477
|
-
|
|
6478
|
-
return _regeneratorRuntime.wrap(function
|
|
6672
|
+
_args18 = arguments;
|
|
6673
|
+
return _regeneratorRuntime.wrap(function _callee18$(_context18) {
|
|
6479
6674
|
while (1) {
|
|
6480
|
-
switch (
|
|
6675
|
+
switch (_context18.prev = _context18.next) {
|
|
6481
6676
|
case 0:
|
|
6482
|
-
filterConditions =
|
|
6483
|
-
options =
|
|
6484
|
-
|
|
6677
|
+
filterConditions = _args18.length > 0 && _args18[0] !== undefined ? _args18[0] : {};
|
|
6678
|
+
options = _args18.length > 1 && _args18[1] !== undefined ? _args18[1] : {};
|
|
6679
|
+
_context18.next = 4;
|
|
6485
6680
|
return this.get(this.baseURL + '/moderation/flags/message', {
|
|
6486
6681
|
payload: _objectSpread({
|
|
6487
6682
|
filter_conditions: filterConditions
|
|
@@ -6489,14 +6684,14 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6489
6684
|
});
|
|
6490
6685
|
|
|
6491
6686
|
case 4:
|
|
6492
|
-
return
|
|
6687
|
+
return _context18.abrupt("return", _context18.sent);
|
|
6493
6688
|
|
|
6494
6689
|
case 5:
|
|
6495
6690
|
case "end":
|
|
6496
|
-
return
|
|
6691
|
+
return _context18.stop();
|
|
6497
6692
|
}
|
|
6498
6693
|
}
|
|
6499
|
-
},
|
|
6694
|
+
}, _callee18, this);
|
|
6500
6695
|
}));
|
|
6501
6696
|
|
|
6502
6697
|
function queryMessageFlags() {
|
|
@@ -6521,7 +6716,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6521
6716
|
}, {
|
|
6522
6717
|
key: "queryChannels",
|
|
6523
6718
|
value: function () {
|
|
6524
|
-
var _queryChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6719
|
+
var _queryChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(filterConditions) {
|
|
6525
6720
|
var sort,
|
|
6526
6721
|
options,
|
|
6527
6722
|
stateOptions,
|
|
@@ -6537,15 +6732,15 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6537
6732
|
_step3,
|
|
6538
6733
|
_channelState,
|
|
6539
6734
|
c,
|
|
6540
|
-
|
|
6735
|
+
_args19 = arguments;
|
|
6541
6736
|
|
|
6542
|
-
return _regeneratorRuntime.wrap(function
|
|
6737
|
+
return _regeneratorRuntime.wrap(function _callee19$(_context19) {
|
|
6543
6738
|
while (1) {
|
|
6544
|
-
switch (
|
|
6739
|
+
switch (_context19.prev = _context19.next) {
|
|
6545
6740
|
case 0:
|
|
6546
|
-
sort =
|
|
6547
|
-
options =
|
|
6548
|
-
stateOptions =
|
|
6741
|
+
sort = _args19.length > 1 && _args19[1] !== undefined ? _args19[1] : [];
|
|
6742
|
+
options = _args19.length > 2 && _args19[2] !== undefined ? _args19[2] : {};
|
|
6743
|
+
stateOptions = _args19.length > 3 && _args19[3] !== undefined ? _args19[3] : {};
|
|
6549
6744
|
skipInitialization = stateOptions.skipInitialization;
|
|
6550
6745
|
defaultOptions = {
|
|
6551
6746
|
state: true,
|
|
@@ -6553,7 +6748,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6553
6748
|
presence: false
|
|
6554
6749
|
}; // Make sure we wait for the connect promise if there is a pending one
|
|
6555
6750
|
|
|
6556
|
-
|
|
6751
|
+
_context19.next = 7;
|
|
6557
6752
|
return this.setUserPromise;
|
|
6558
6753
|
|
|
6559
6754
|
case 7:
|
|
@@ -6566,11 +6761,11 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6566
6761
|
filter_conditions: filterConditions,
|
|
6567
6762
|
sort: normalizeQuerySort(sort)
|
|
6568
6763
|
}, defaultOptions), options);
|
|
6569
|
-
|
|
6764
|
+
_context19.next = 11;
|
|
6570
6765
|
return this.post(this.baseURL + '/channels', payload);
|
|
6571
6766
|
|
|
6572
6767
|
case 11:
|
|
6573
|
-
data =
|
|
6768
|
+
data = _context19.sent;
|
|
6574
6769
|
channels = []; // update our cache of the configs
|
|
6575
6770
|
|
|
6576
6771
|
_iterator2 = _createForOfIteratorHelper(data.channels);
|
|
@@ -6612,17 +6807,17 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6612
6807
|
_iterator3.f();
|
|
6613
6808
|
}
|
|
6614
6809
|
|
|
6615
|
-
return
|
|
6810
|
+
return _context19.abrupt("return", channels);
|
|
6616
6811
|
|
|
6617
6812
|
case 18:
|
|
6618
6813
|
case "end":
|
|
6619
|
-
return
|
|
6814
|
+
return _context19.stop();
|
|
6620
6815
|
}
|
|
6621
6816
|
}
|
|
6622
|
-
},
|
|
6817
|
+
}, _callee19, this);
|
|
6623
6818
|
}));
|
|
6624
6819
|
|
|
6625
|
-
function queryChannels(
|
|
6820
|
+
function queryChannels(_x18) {
|
|
6626
6821
|
return _queryChannels.apply(this, arguments);
|
|
6627
6822
|
}
|
|
6628
6823
|
|
|
@@ -6641,18 +6836,18 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6641
6836
|
}, {
|
|
6642
6837
|
key: "search",
|
|
6643
6838
|
value: function () {
|
|
6644
|
-
var _search = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6839
|
+
var _search = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20(filterConditions, query) {
|
|
6645
6840
|
var options,
|
|
6646
6841
|
payload,
|
|
6647
|
-
|
|
6648
|
-
return _regeneratorRuntime.wrap(function
|
|
6842
|
+
_args20 = arguments;
|
|
6843
|
+
return _regeneratorRuntime.wrap(function _callee20$(_context20) {
|
|
6649
6844
|
while (1) {
|
|
6650
|
-
switch (
|
|
6845
|
+
switch (_context20.prev = _context20.next) {
|
|
6651
6846
|
case 0:
|
|
6652
|
-
options =
|
|
6847
|
+
options = _args20.length > 2 && _args20[2] !== undefined ? _args20[2] : {};
|
|
6653
6848
|
|
|
6654
6849
|
if (!(options.offset && (options.sort || options.next))) {
|
|
6655
|
-
|
|
6850
|
+
_context20.next = 3;
|
|
6656
6851
|
break;
|
|
6657
6852
|
}
|
|
6658
6853
|
|
|
@@ -6666,49 +6861,49 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6666
6861
|
});
|
|
6667
6862
|
|
|
6668
6863
|
if (!(typeof query === 'string')) {
|
|
6669
|
-
|
|
6864
|
+
_context20.next = 8;
|
|
6670
6865
|
break;
|
|
6671
6866
|
}
|
|
6672
6867
|
|
|
6673
6868
|
payload.query = query;
|
|
6674
|
-
|
|
6869
|
+
_context20.next = 13;
|
|
6675
6870
|
break;
|
|
6676
6871
|
|
|
6677
6872
|
case 8:
|
|
6678
6873
|
if (!(_typeof(query) === 'object')) {
|
|
6679
|
-
|
|
6874
|
+
_context20.next = 12;
|
|
6680
6875
|
break;
|
|
6681
6876
|
}
|
|
6682
6877
|
|
|
6683
6878
|
payload.message_filter_conditions = query;
|
|
6684
|
-
|
|
6879
|
+
_context20.next = 13;
|
|
6685
6880
|
break;
|
|
6686
6881
|
|
|
6687
6882
|
case 12:
|
|
6688
6883
|
throw Error("Invalid type ".concat(_typeof(query), " for query parameter"));
|
|
6689
6884
|
|
|
6690
6885
|
case 13:
|
|
6691
|
-
|
|
6886
|
+
_context20.next = 15;
|
|
6692
6887
|
return this.setUserPromise;
|
|
6693
6888
|
|
|
6694
6889
|
case 15:
|
|
6695
|
-
|
|
6890
|
+
_context20.next = 17;
|
|
6696
6891
|
return this.get(this.baseURL + '/search', {
|
|
6697
6892
|
payload: payload
|
|
6698
6893
|
});
|
|
6699
6894
|
|
|
6700
6895
|
case 17:
|
|
6701
|
-
return
|
|
6896
|
+
return _context20.abrupt("return", _context20.sent);
|
|
6702
6897
|
|
|
6703
6898
|
case 18:
|
|
6704
6899
|
case "end":
|
|
6705
|
-
return
|
|
6900
|
+
return _context20.stop();
|
|
6706
6901
|
}
|
|
6707
6902
|
}
|
|
6708
|
-
},
|
|
6903
|
+
}, _callee20, this);
|
|
6709
6904
|
}));
|
|
6710
6905
|
|
|
6711
|
-
function search(
|
|
6906
|
+
function search(_x19, _x20) {
|
|
6712
6907
|
return _search.apply(this, arguments);
|
|
6713
6908
|
}
|
|
6714
6909
|
|
|
@@ -6744,12 +6939,12 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6744
6939
|
}, {
|
|
6745
6940
|
key: "addDevice",
|
|
6746
6941
|
value: function () {
|
|
6747
|
-
var _addDevice = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6748
|
-
return _regeneratorRuntime.wrap(function
|
|
6942
|
+
var _addDevice = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21(id, push_provider, userID) {
|
|
6943
|
+
return _regeneratorRuntime.wrap(function _callee21$(_context21) {
|
|
6749
6944
|
while (1) {
|
|
6750
|
-
switch (
|
|
6945
|
+
switch (_context21.prev = _context21.next) {
|
|
6751
6946
|
case 0:
|
|
6752
|
-
|
|
6947
|
+
_context21.next = 2;
|
|
6753
6948
|
return this.post(this.baseURL + '/devices', _objectSpread({
|
|
6754
6949
|
id: id,
|
|
6755
6950
|
push_provider: push_provider
|
|
@@ -6758,17 +6953,17 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6758
6953
|
} : {}));
|
|
6759
6954
|
|
|
6760
6955
|
case 2:
|
|
6761
|
-
return
|
|
6956
|
+
return _context21.abrupt("return", _context21.sent);
|
|
6762
6957
|
|
|
6763
6958
|
case 3:
|
|
6764
6959
|
case "end":
|
|
6765
|
-
return
|
|
6960
|
+
return _context21.stop();
|
|
6766
6961
|
}
|
|
6767
6962
|
}
|
|
6768
|
-
},
|
|
6963
|
+
}, _callee21, this);
|
|
6769
6964
|
}));
|
|
6770
6965
|
|
|
6771
|
-
function addDevice(
|
|
6966
|
+
function addDevice(_x21, _x22, _x23) {
|
|
6772
6967
|
return _addDevice.apply(this, arguments);
|
|
6773
6968
|
}
|
|
6774
6969
|
|
|
@@ -6785,28 +6980,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6785
6980
|
}, {
|
|
6786
6981
|
key: "getDevices",
|
|
6787
6982
|
value: function () {
|
|
6788
|
-
var _getDevices = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6789
|
-
return _regeneratorRuntime.wrap(function
|
|
6983
|
+
var _getDevices = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22(userID) {
|
|
6984
|
+
return _regeneratorRuntime.wrap(function _callee22$(_context22) {
|
|
6790
6985
|
while (1) {
|
|
6791
|
-
switch (
|
|
6986
|
+
switch (_context22.prev = _context22.next) {
|
|
6792
6987
|
case 0:
|
|
6793
|
-
|
|
6988
|
+
_context22.next = 2;
|
|
6794
6989
|
return this.get(this.baseURL + '/devices', userID ? {
|
|
6795
6990
|
user_id: userID
|
|
6796
6991
|
} : {});
|
|
6797
6992
|
|
|
6798
6993
|
case 2:
|
|
6799
|
-
return
|
|
6994
|
+
return _context22.abrupt("return", _context22.sent);
|
|
6800
6995
|
|
|
6801
6996
|
case 3:
|
|
6802
6997
|
case "end":
|
|
6803
|
-
return
|
|
6998
|
+
return _context22.stop();
|
|
6804
6999
|
}
|
|
6805
7000
|
}
|
|
6806
|
-
},
|
|
7001
|
+
}, _callee22, this);
|
|
6807
7002
|
}));
|
|
6808
7003
|
|
|
6809
|
-
function getDevices(
|
|
7004
|
+
function getDevices(_x24) {
|
|
6810
7005
|
return _getDevices.apply(this, arguments);
|
|
6811
7006
|
}
|
|
6812
7007
|
|
|
@@ -6823,12 +7018,12 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6823
7018
|
}, {
|
|
6824
7019
|
key: "removeDevice",
|
|
6825
7020
|
value: function () {
|
|
6826
|
-
var _removeDevice = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6827
|
-
return _regeneratorRuntime.wrap(function
|
|
7021
|
+
var _removeDevice = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23(id, userID) {
|
|
7022
|
+
return _regeneratorRuntime.wrap(function _callee23$(_context23) {
|
|
6828
7023
|
while (1) {
|
|
6829
|
-
switch (
|
|
7024
|
+
switch (_context23.prev = _context23.next) {
|
|
6830
7025
|
case 0:
|
|
6831
|
-
|
|
7026
|
+
_context23.next = 2;
|
|
6832
7027
|
return this.delete(this.baseURL + '/devices', _objectSpread({
|
|
6833
7028
|
id: id
|
|
6834
7029
|
}, userID ? {
|
|
@@ -6836,17 +7031,17 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6836
7031
|
} : {}));
|
|
6837
7032
|
|
|
6838
7033
|
case 2:
|
|
6839
|
-
return
|
|
7034
|
+
return _context23.abrupt("return", _context23.sent);
|
|
6840
7035
|
|
|
6841
7036
|
case 3:
|
|
6842
7037
|
case "end":
|
|
6843
|
-
return
|
|
7038
|
+
return _context23.stop();
|
|
6844
7039
|
}
|
|
6845
7040
|
}
|
|
6846
|
-
},
|
|
7041
|
+
}, _callee23, this);
|
|
6847
7042
|
}));
|
|
6848
7043
|
|
|
6849
|
-
function removeDevice(
|
|
7044
|
+
function removeDevice(_x25, _x26) {
|
|
6850
7045
|
return _removeDevice.apply(this, arguments);
|
|
6851
7046
|
}
|
|
6852
7047
|
|
|
@@ -6863,15 +7058,15 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6863
7058
|
}, {
|
|
6864
7059
|
key: "getRateLimits",
|
|
6865
7060
|
value: function () {
|
|
6866
|
-
var _getRateLimits = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6867
|
-
var
|
|
7061
|
+
var _getRateLimits = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24(params) {
|
|
7062
|
+
var _ref7, serverSide, web, android, ios, endpoints;
|
|
6868
7063
|
|
|
6869
|
-
return _regeneratorRuntime.wrap(function
|
|
7064
|
+
return _regeneratorRuntime.wrap(function _callee24$(_context24) {
|
|
6870
7065
|
while (1) {
|
|
6871
|
-
switch (
|
|
7066
|
+
switch (_context24.prev = _context24.next) {
|
|
6872
7067
|
case 0:
|
|
6873
|
-
|
|
6874
|
-
return
|
|
7068
|
+
_ref7 = params || {}, serverSide = _ref7.serverSide, web = _ref7.web, android = _ref7.android, ios = _ref7.ios, endpoints = _ref7.endpoints;
|
|
7069
|
+
return _context24.abrupt("return", this.get(this.baseURL + '/rate_limits', {
|
|
6875
7070
|
server_side: serverSide,
|
|
6876
7071
|
web: web,
|
|
6877
7072
|
android: android,
|
|
@@ -6881,13 +7076,13 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6881
7076
|
|
|
6882
7077
|
case 2:
|
|
6883
7078
|
case "end":
|
|
6884
|
-
return
|
|
7079
|
+
return _context24.stop();
|
|
6885
7080
|
}
|
|
6886
7081
|
}
|
|
6887
|
-
},
|
|
7082
|
+
}, _callee24, this);
|
|
6888
7083
|
}));
|
|
6889
7084
|
|
|
6890
|
-
function getRateLimits(
|
|
7085
|
+
function getRateLimits(_x27) {
|
|
6891
7086
|
return _getRateLimits.apply(this, arguments);
|
|
6892
7087
|
}
|
|
6893
7088
|
|
|
@@ -6969,26 +7164,26 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
6969
7164
|
* @return {Promise<APIResponse & { users: { [key: string]: UserResponse<UserType> } }>} list of updated users
|
|
6970
7165
|
*/
|
|
6971
7166
|
function () {
|
|
6972
|
-
var _partialUpdateUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
6973
|
-
return _regeneratorRuntime.wrap(function
|
|
7167
|
+
var _partialUpdateUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25(partialUserObject) {
|
|
7168
|
+
return _regeneratorRuntime.wrap(function _callee25$(_context25) {
|
|
6974
7169
|
while (1) {
|
|
6975
|
-
switch (
|
|
7170
|
+
switch (_context25.prev = _context25.next) {
|
|
6976
7171
|
case 0:
|
|
6977
|
-
|
|
7172
|
+
_context25.next = 2;
|
|
6978
7173
|
return this.partialUpdateUsers([partialUserObject]);
|
|
6979
7174
|
|
|
6980
7175
|
case 2:
|
|
6981
|
-
return
|
|
7176
|
+
return _context25.abrupt("return", _context25.sent);
|
|
6982
7177
|
|
|
6983
7178
|
case 3:
|
|
6984
7179
|
case "end":
|
|
6985
|
-
return
|
|
7180
|
+
return _context25.stop();
|
|
6986
7181
|
}
|
|
6987
7182
|
}
|
|
6988
|
-
},
|
|
7183
|
+
}, _callee25, this);
|
|
6989
7184
|
}));
|
|
6990
7185
|
|
|
6991
|
-
function partialUpdateUser(
|
|
7186
|
+
function partialUpdateUser(_x28) {
|
|
6992
7187
|
return _partialUpdateUser.apply(this, arguments);
|
|
6993
7188
|
}
|
|
6994
7189
|
|
|
@@ -7005,29 +7200,29 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7005
7200
|
}, {
|
|
7006
7201
|
key: "upsertUsers",
|
|
7007
7202
|
value: function () {
|
|
7008
|
-
var _upsertUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7203
|
+
var _upsertUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26(users) {
|
|
7009
7204
|
var userMap, _iterator4, _step4, userObject;
|
|
7010
7205
|
|
|
7011
|
-
return _regeneratorRuntime.wrap(function
|
|
7206
|
+
return _regeneratorRuntime.wrap(function _callee26$(_context26) {
|
|
7012
7207
|
while (1) {
|
|
7013
|
-
switch (
|
|
7208
|
+
switch (_context26.prev = _context26.next) {
|
|
7014
7209
|
case 0:
|
|
7015
7210
|
userMap = {};
|
|
7016
7211
|
_iterator4 = _createForOfIteratorHelper(users);
|
|
7017
|
-
|
|
7212
|
+
_context26.prev = 2;
|
|
7018
7213
|
|
|
7019
7214
|
_iterator4.s();
|
|
7020
7215
|
|
|
7021
7216
|
case 4:
|
|
7022
7217
|
if ((_step4 = _iterator4.n()).done) {
|
|
7023
|
-
|
|
7218
|
+
_context26.next = 11;
|
|
7024
7219
|
break;
|
|
7025
7220
|
}
|
|
7026
7221
|
|
|
7027
7222
|
userObject = _step4.value;
|
|
7028
7223
|
|
|
7029
7224
|
if (userObject.id) {
|
|
7030
|
-
|
|
7225
|
+
_context26.next = 8;
|
|
7031
7226
|
break;
|
|
7032
7227
|
}
|
|
7033
7228
|
|
|
@@ -7037,44 +7232,44 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7037
7232
|
userMap[userObject.id] = userObject;
|
|
7038
7233
|
|
|
7039
7234
|
case 9:
|
|
7040
|
-
|
|
7235
|
+
_context26.next = 4;
|
|
7041
7236
|
break;
|
|
7042
7237
|
|
|
7043
7238
|
case 11:
|
|
7044
|
-
|
|
7239
|
+
_context26.next = 16;
|
|
7045
7240
|
break;
|
|
7046
7241
|
|
|
7047
7242
|
case 13:
|
|
7048
|
-
|
|
7049
|
-
|
|
7243
|
+
_context26.prev = 13;
|
|
7244
|
+
_context26.t0 = _context26["catch"](2);
|
|
7050
7245
|
|
|
7051
|
-
_iterator4.e(
|
|
7246
|
+
_iterator4.e(_context26.t0);
|
|
7052
7247
|
|
|
7053
7248
|
case 16:
|
|
7054
|
-
|
|
7249
|
+
_context26.prev = 16;
|
|
7055
7250
|
|
|
7056
7251
|
_iterator4.f();
|
|
7057
7252
|
|
|
7058
|
-
return
|
|
7253
|
+
return _context26.finish(16);
|
|
7059
7254
|
|
|
7060
7255
|
case 19:
|
|
7061
|
-
|
|
7256
|
+
_context26.next = 21;
|
|
7062
7257
|
return this.post(this.baseURL + '/users', {
|
|
7063
7258
|
users: userMap
|
|
7064
7259
|
});
|
|
7065
7260
|
|
|
7066
7261
|
case 21:
|
|
7067
|
-
return
|
|
7262
|
+
return _context26.abrupt("return", _context26.sent);
|
|
7068
7263
|
|
|
7069
7264
|
case 22:
|
|
7070
7265
|
case "end":
|
|
7071
|
-
return
|
|
7266
|
+
return _context26.stop();
|
|
7072
7267
|
}
|
|
7073
7268
|
}
|
|
7074
|
-
},
|
|
7269
|
+
}, _callee26, this, [[2, 13, 16, 19]]);
|
|
7075
7270
|
}));
|
|
7076
7271
|
|
|
7077
|
-
function upsertUsers(
|
|
7272
|
+
function upsertUsers(_x29) {
|
|
7078
7273
|
return _upsertUsers.apply(this, arguments);
|
|
7079
7274
|
}
|
|
7080
7275
|
|
|
@@ -7122,72 +7317,72 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7122
7317
|
* @return {Promise<APIResponse & { users: { [key: string]: UserResponse<UserType> } }>}
|
|
7123
7318
|
*/
|
|
7124
7319
|
function () {
|
|
7125
|
-
var _partialUpdateUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7320
|
+
var _partialUpdateUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27(users) {
|
|
7126
7321
|
var _iterator5, _step5, userObject;
|
|
7127
7322
|
|
|
7128
|
-
return _regeneratorRuntime.wrap(function
|
|
7323
|
+
return _regeneratorRuntime.wrap(function _callee27$(_context27) {
|
|
7129
7324
|
while (1) {
|
|
7130
|
-
switch (
|
|
7325
|
+
switch (_context27.prev = _context27.next) {
|
|
7131
7326
|
case 0:
|
|
7132
7327
|
_iterator5 = _createForOfIteratorHelper(users);
|
|
7133
|
-
|
|
7328
|
+
_context27.prev = 1;
|
|
7134
7329
|
|
|
7135
7330
|
_iterator5.s();
|
|
7136
7331
|
|
|
7137
7332
|
case 3:
|
|
7138
7333
|
if ((_step5 = _iterator5.n()).done) {
|
|
7139
|
-
|
|
7334
|
+
_context27.next = 9;
|
|
7140
7335
|
break;
|
|
7141
7336
|
}
|
|
7142
7337
|
|
|
7143
7338
|
userObject = _step5.value;
|
|
7144
7339
|
|
|
7145
7340
|
if (userObject.id) {
|
|
7146
|
-
|
|
7341
|
+
_context27.next = 7;
|
|
7147
7342
|
break;
|
|
7148
7343
|
}
|
|
7149
7344
|
|
|
7150
7345
|
throw Error('User ID is required when updating a user');
|
|
7151
7346
|
|
|
7152
7347
|
case 7:
|
|
7153
|
-
|
|
7348
|
+
_context27.next = 3;
|
|
7154
7349
|
break;
|
|
7155
7350
|
|
|
7156
7351
|
case 9:
|
|
7157
|
-
|
|
7352
|
+
_context27.next = 14;
|
|
7158
7353
|
break;
|
|
7159
7354
|
|
|
7160
7355
|
case 11:
|
|
7161
|
-
|
|
7162
|
-
|
|
7356
|
+
_context27.prev = 11;
|
|
7357
|
+
_context27.t0 = _context27["catch"](1);
|
|
7163
7358
|
|
|
7164
|
-
_iterator5.e(
|
|
7359
|
+
_iterator5.e(_context27.t0);
|
|
7165
7360
|
|
|
7166
7361
|
case 14:
|
|
7167
|
-
|
|
7362
|
+
_context27.prev = 14;
|
|
7168
7363
|
|
|
7169
7364
|
_iterator5.f();
|
|
7170
7365
|
|
|
7171
|
-
return
|
|
7366
|
+
return _context27.finish(14);
|
|
7172
7367
|
|
|
7173
7368
|
case 17:
|
|
7174
|
-
|
|
7369
|
+
_context27.next = 19;
|
|
7175
7370
|
return this.patch(this.baseURL + '/users', {
|
|
7176
7371
|
users: users
|
|
7177
7372
|
});
|
|
7178
7373
|
|
|
7179
7374
|
case 19:
|
|
7180
|
-
return
|
|
7375
|
+
return _context27.abrupt("return", _context27.sent);
|
|
7181
7376
|
|
|
7182
7377
|
case 20:
|
|
7183
7378
|
case "end":
|
|
7184
|
-
return
|
|
7379
|
+
return _context27.stop();
|
|
7185
7380
|
}
|
|
7186
7381
|
}
|
|
7187
|
-
},
|
|
7382
|
+
}, _callee27, this, [[1, 11, 14, 17]]);
|
|
7188
7383
|
}));
|
|
7189
7384
|
|
|
7190
|
-
function partialUpdateUsers(
|
|
7385
|
+
function partialUpdateUsers(_x30) {
|
|
7191
7386
|
return _partialUpdateUsers.apply(this, arguments);
|
|
7192
7387
|
}
|
|
7193
7388
|
|
|
@@ -7196,26 +7391,26 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7196
7391
|
}, {
|
|
7197
7392
|
key: "deleteUser",
|
|
7198
7393
|
value: function () {
|
|
7199
|
-
var _deleteUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7200
|
-
return _regeneratorRuntime.wrap(function
|
|
7394
|
+
var _deleteUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee28(userID, params) {
|
|
7395
|
+
return _regeneratorRuntime.wrap(function _callee28$(_context28) {
|
|
7201
7396
|
while (1) {
|
|
7202
|
-
switch (
|
|
7397
|
+
switch (_context28.prev = _context28.next) {
|
|
7203
7398
|
case 0:
|
|
7204
|
-
|
|
7399
|
+
_context28.next = 2;
|
|
7205
7400
|
return this.delete(this.baseURL + "/users/".concat(userID), params);
|
|
7206
7401
|
|
|
7207
7402
|
case 2:
|
|
7208
|
-
return
|
|
7403
|
+
return _context28.abrupt("return", _context28.sent);
|
|
7209
7404
|
|
|
7210
7405
|
case 3:
|
|
7211
7406
|
case "end":
|
|
7212
|
-
return
|
|
7407
|
+
return _context28.stop();
|
|
7213
7408
|
}
|
|
7214
7409
|
}
|
|
7215
|
-
},
|
|
7410
|
+
}, _callee28, this);
|
|
7216
7411
|
}));
|
|
7217
7412
|
|
|
7218
|
-
function deleteUser(
|
|
7413
|
+
function deleteUser(_x31, _x32) {
|
|
7219
7414
|
return _deleteUser.apply(this, arguments);
|
|
7220
7415
|
}
|
|
7221
7416
|
|
|
@@ -7224,26 +7419,26 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7224
7419
|
}, {
|
|
7225
7420
|
key: "reactivateUser",
|
|
7226
7421
|
value: function () {
|
|
7227
|
-
var _reactivateUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7228
|
-
return _regeneratorRuntime.wrap(function
|
|
7422
|
+
var _reactivateUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee29(userID, options) {
|
|
7423
|
+
return _regeneratorRuntime.wrap(function _callee29$(_context29) {
|
|
7229
7424
|
while (1) {
|
|
7230
|
-
switch (
|
|
7425
|
+
switch (_context29.prev = _context29.next) {
|
|
7231
7426
|
case 0:
|
|
7232
|
-
|
|
7427
|
+
_context29.next = 2;
|
|
7233
7428
|
return this.post(this.baseURL + "/users/".concat(userID, "/reactivate"), _objectSpread({}, options));
|
|
7234
7429
|
|
|
7235
7430
|
case 2:
|
|
7236
|
-
return
|
|
7431
|
+
return _context29.abrupt("return", _context29.sent);
|
|
7237
7432
|
|
|
7238
7433
|
case 3:
|
|
7239
7434
|
case "end":
|
|
7240
|
-
return
|
|
7435
|
+
return _context29.stop();
|
|
7241
7436
|
}
|
|
7242
7437
|
}
|
|
7243
|
-
},
|
|
7438
|
+
}, _callee29, this);
|
|
7244
7439
|
}));
|
|
7245
7440
|
|
|
7246
|
-
function reactivateUser(
|
|
7441
|
+
function reactivateUser(_x33, _x34) {
|
|
7247
7442
|
return _reactivateUser.apply(this, arguments);
|
|
7248
7443
|
}
|
|
7249
7444
|
|
|
@@ -7252,26 +7447,26 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7252
7447
|
}, {
|
|
7253
7448
|
key: "deactivateUser",
|
|
7254
7449
|
value: function () {
|
|
7255
|
-
var _deactivateUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7256
|
-
return _regeneratorRuntime.wrap(function
|
|
7450
|
+
var _deactivateUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30(userID, options) {
|
|
7451
|
+
return _regeneratorRuntime.wrap(function _callee30$(_context30) {
|
|
7257
7452
|
while (1) {
|
|
7258
|
-
switch (
|
|
7453
|
+
switch (_context30.prev = _context30.next) {
|
|
7259
7454
|
case 0:
|
|
7260
|
-
|
|
7455
|
+
_context30.next = 2;
|
|
7261
7456
|
return this.post(this.baseURL + "/users/".concat(userID, "/deactivate"), _objectSpread({}, options));
|
|
7262
7457
|
|
|
7263
7458
|
case 2:
|
|
7264
|
-
return
|
|
7459
|
+
return _context30.abrupt("return", _context30.sent);
|
|
7265
7460
|
|
|
7266
7461
|
case 3:
|
|
7267
7462
|
case "end":
|
|
7268
|
-
return
|
|
7463
|
+
return _context30.stop();
|
|
7269
7464
|
}
|
|
7270
7465
|
}
|
|
7271
|
-
},
|
|
7466
|
+
}, _callee30, this);
|
|
7272
7467
|
}));
|
|
7273
7468
|
|
|
7274
|
-
function deactivateUser(
|
|
7469
|
+
function deactivateUser(_x35, _x36) {
|
|
7275
7470
|
return _deactivateUser.apply(this, arguments);
|
|
7276
7471
|
}
|
|
7277
7472
|
|
|
@@ -7280,26 +7475,26 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7280
7475
|
}, {
|
|
7281
7476
|
key: "exportUser",
|
|
7282
7477
|
value: function () {
|
|
7283
|
-
var _exportUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7284
|
-
return _regeneratorRuntime.wrap(function
|
|
7478
|
+
var _exportUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31(userID, options) {
|
|
7479
|
+
return _regeneratorRuntime.wrap(function _callee31$(_context31) {
|
|
7285
7480
|
while (1) {
|
|
7286
|
-
switch (
|
|
7481
|
+
switch (_context31.prev = _context31.next) {
|
|
7287
7482
|
case 0:
|
|
7288
|
-
|
|
7483
|
+
_context31.next = 2;
|
|
7289
7484
|
return this.get(this.baseURL + "/users/".concat(userID, "/export"), _objectSpread({}, options));
|
|
7290
7485
|
|
|
7291
7486
|
case 2:
|
|
7292
|
-
return
|
|
7487
|
+
return _context31.abrupt("return", _context31.sent);
|
|
7293
7488
|
|
|
7294
7489
|
case 3:
|
|
7295
7490
|
case "end":
|
|
7296
|
-
return
|
|
7491
|
+
return _context31.stop();
|
|
7297
7492
|
}
|
|
7298
7493
|
}
|
|
7299
|
-
},
|
|
7494
|
+
}, _callee31, this);
|
|
7300
7495
|
}));
|
|
7301
7496
|
|
|
7302
|
-
function exportUser(
|
|
7497
|
+
function exportUser(_x37, _x38) {
|
|
7303
7498
|
return _exportUser.apply(this, arguments);
|
|
7304
7499
|
}
|
|
7305
7500
|
|
|
@@ -7315,10 +7510,10 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7315
7510
|
}, {
|
|
7316
7511
|
key: "banUser",
|
|
7317
7512
|
value: function () {
|
|
7318
|
-
var _banUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7319
|
-
return _regeneratorRuntime.wrap(function
|
|
7513
|
+
var _banUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee32(targetUserID, options) {
|
|
7514
|
+
return _regeneratorRuntime.wrap(function _callee32$(_context32) {
|
|
7320
7515
|
while (1) {
|
|
7321
|
-
switch (
|
|
7516
|
+
switch (_context32.prev = _context32.next) {
|
|
7322
7517
|
case 0:
|
|
7323
7518
|
if ((options === null || options === void 0 ? void 0 : options.user_id) !== undefined) {
|
|
7324
7519
|
options.banned_by_id = options.user_id;
|
|
@@ -7332,23 +7527,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7332
7527
|
console.warn("banUser: 'user' is deprecated, please consider switching to 'banned_by'");
|
|
7333
7528
|
}
|
|
7334
7529
|
|
|
7335
|
-
|
|
7530
|
+
_context32.next = 4;
|
|
7336
7531
|
return this.post(this.baseURL + '/moderation/ban', _objectSpread({
|
|
7337
7532
|
target_user_id: targetUserID
|
|
7338
7533
|
}, options));
|
|
7339
7534
|
|
|
7340
7535
|
case 4:
|
|
7341
|
-
return
|
|
7536
|
+
return _context32.abrupt("return", _context32.sent);
|
|
7342
7537
|
|
|
7343
7538
|
case 5:
|
|
7344
7539
|
case "end":
|
|
7345
|
-
return
|
|
7540
|
+
return _context32.stop();
|
|
7346
7541
|
}
|
|
7347
7542
|
}
|
|
7348
|
-
},
|
|
7543
|
+
}, _callee32, this);
|
|
7349
7544
|
}));
|
|
7350
7545
|
|
|
7351
|
-
function banUser(
|
|
7546
|
+
function banUser(_x39, _x40) {
|
|
7352
7547
|
return _banUser.apply(this, arguments);
|
|
7353
7548
|
}
|
|
7354
7549
|
|
|
@@ -7364,28 +7559,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7364
7559
|
}, {
|
|
7365
7560
|
key: "unbanUser",
|
|
7366
7561
|
value: function () {
|
|
7367
|
-
var _unbanUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7368
|
-
return _regeneratorRuntime.wrap(function
|
|
7562
|
+
var _unbanUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee33(targetUserID, options) {
|
|
7563
|
+
return _regeneratorRuntime.wrap(function _callee33$(_context33) {
|
|
7369
7564
|
while (1) {
|
|
7370
|
-
switch (
|
|
7565
|
+
switch (_context33.prev = _context33.next) {
|
|
7371
7566
|
case 0:
|
|
7372
|
-
|
|
7567
|
+
_context33.next = 2;
|
|
7373
7568
|
return this.delete(this.baseURL + '/moderation/ban', _objectSpread({
|
|
7374
7569
|
target_user_id: targetUserID
|
|
7375
7570
|
}, options));
|
|
7376
7571
|
|
|
7377
7572
|
case 2:
|
|
7378
|
-
return
|
|
7573
|
+
return _context33.abrupt("return", _context33.sent);
|
|
7379
7574
|
|
|
7380
7575
|
case 3:
|
|
7381
7576
|
case "end":
|
|
7382
|
-
return
|
|
7577
|
+
return _context33.stop();
|
|
7383
7578
|
}
|
|
7384
7579
|
}
|
|
7385
|
-
},
|
|
7580
|
+
}, _callee33, this);
|
|
7386
7581
|
}));
|
|
7387
7582
|
|
|
7388
|
-
function unbanUser(
|
|
7583
|
+
function unbanUser(_x41, _x42) {
|
|
7389
7584
|
return _unbanUser.apply(this, arguments);
|
|
7390
7585
|
}
|
|
7391
7586
|
|
|
@@ -7401,28 +7596,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7401
7596
|
}, {
|
|
7402
7597
|
key: "shadowBan",
|
|
7403
7598
|
value: function () {
|
|
7404
|
-
var _shadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7405
|
-
return _regeneratorRuntime.wrap(function
|
|
7599
|
+
var _shadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee34(targetUserID, options) {
|
|
7600
|
+
return _regeneratorRuntime.wrap(function _callee34$(_context34) {
|
|
7406
7601
|
while (1) {
|
|
7407
|
-
switch (
|
|
7602
|
+
switch (_context34.prev = _context34.next) {
|
|
7408
7603
|
case 0:
|
|
7409
|
-
|
|
7604
|
+
_context34.next = 2;
|
|
7410
7605
|
return this.banUser(targetUserID, _objectSpread({
|
|
7411
7606
|
shadow: true
|
|
7412
7607
|
}, options));
|
|
7413
7608
|
|
|
7414
7609
|
case 2:
|
|
7415
|
-
return
|
|
7610
|
+
return _context34.abrupt("return", _context34.sent);
|
|
7416
7611
|
|
|
7417
7612
|
case 3:
|
|
7418
7613
|
case "end":
|
|
7419
|
-
return
|
|
7614
|
+
return _context34.stop();
|
|
7420
7615
|
}
|
|
7421
7616
|
}
|
|
7422
|
-
},
|
|
7617
|
+
}, _callee34, this);
|
|
7423
7618
|
}));
|
|
7424
7619
|
|
|
7425
|
-
function shadowBan(
|
|
7620
|
+
function shadowBan(_x43, _x44) {
|
|
7426
7621
|
return _shadowBan.apply(this, arguments);
|
|
7427
7622
|
}
|
|
7428
7623
|
|
|
@@ -7438,28 +7633,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7438
7633
|
}, {
|
|
7439
7634
|
key: "removeShadowBan",
|
|
7440
7635
|
value: function () {
|
|
7441
|
-
var _removeShadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7442
|
-
return _regeneratorRuntime.wrap(function
|
|
7636
|
+
var _removeShadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee35(targetUserID, options) {
|
|
7637
|
+
return _regeneratorRuntime.wrap(function _callee35$(_context35) {
|
|
7443
7638
|
while (1) {
|
|
7444
|
-
switch (
|
|
7639
|
+
switch (_context35.prev = _context35.next) {
|
|
7445
7640
|
case 0:
|
|
7446
|
-
|
|
7641
|
+
_context35.next = 2;
|
|
7447
7642
|
return this.unbanUser(targetUserID, _objectSpread({
|
|
7448
7643
|
shadow: true
|
|
7449
7644
|
}, options));
|
|
7450
7645
|
|
|
7451
7646
|
case 2:
|
|
7452
|
-
return
|
|
7647
|
+
return _context35.abrupt("return", _context35.sent);
|
|
7453
7648
|
|
|
7454
7649
|
case 3:
|
|
7455
7650
|
case "end":
|
|
7456
|
-
return
|
|
7651
|
+
return _context35.stop();
|
|
7457
7652
|
}
|
|
7458
7653
|
}
|
|
7459
|
-
},
|
|
7654
|
+
}, _callee35, this);
|
|
7460
7655
|
}));
|
|
7461
7656
|
|
|
7462
|
-
function removeShadowBan(
|
|
7657
|
+
function removeShadowBan(_x45, _x46) {
|
|
7463
7658
|
return _removeShadowBan.apply(this, arguments);
|
|
7464
7659
|
}
|
|
7465
7660
|
|
|
@@ -7476,15 +7671,15 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7476
7671
|
}, {
|
|
7477
7672
|
key: "muteUser",
|
|
7478
7673
|
value: function () {
|
|
7479
|
-
var _muteUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7674
|
+
var _muteUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee36(targetID, userID) {
|
|
7480
7675
|
var options,
|
|
7481
|
-
|
|
7482
|
-
return _regeneratorRuntime.wrap(function
|
|
7676
|
+
_args36 = arguments;
|
|
7677
|
+
return _regeneratorRuntime.wrap(function _callee36$(_context36) {
|
|
7483
7678
|
while (1) {
|
|
7484
|
-
switch (
|
|
7679
|
+
switch (_context36.prev = _context36.next) {
|
|
7485
7680
|
case 0:
|
|
7486
|
-
options =
|
|
7487
|
-
|
|
7681
|
+
options = _args36.length > 2 && _args36[2] !== undefined ? _args36[2] : {};
|
|
7682
|
+
_context36.next = 3;
|
|
7488
7683
|
return this.post(this.baseURL + '/moderation/mute', _objectSpread(_objectSpread({
|
|
7489
7684
|
target_id: targetID
|
|
7490
7685
|
}, userID ? {
|
|
@@ -7492,17 +7687,17 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7492
7687
|
} : {}), options));
|
|
7493
7688
|
|
|
7494
7689
|
case 3:
|
|
7495
|
-
return
|
|
7690
|
+
return _context36.abrupt("return", _context36.sent);
|
|
7496
7691
|
|
|
7497
7692
|
case 4:
|
|
7498
7693
|
case "end":
|
|
7499
|
-
return
|
|
7694
|
+
return _context36.stop();
|
|
7500
7695
|
}
|
|
7501
7696
|
}
|
|
7502
|
-
},
|
|
7697
|
+
}, _callee36, this);
|
|
7503
7698
|
}));
|
|
7504
7699
|
|
|
7505
|
-
function muteUser(
|
|
7700
|
+
function muteUser(_x47, _x48) {
|
|
7506
7701
|
return _muteUser.apply(this, arguments);
|
|
7507
7702
|
}
|
|
7508
7703
|
|
|
@@ -7518,12 +7713,12 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7518
7713
|
}, {
|
|
7519
7714
|
key: "unmuteUser",
|
|
7520
7715
|
value: function () {
|
|
7521
|
-
var _unmuteUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7522
|
-
return _regeneratorRuntime.wrap(function
|
|
7716
|
+
var _unmuteUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee37(targetID, currentUserID) {
|
|
7717
|
+
return _regeneratorRuntime.wrap(function _callee37$(_context37) {
|
|
7523
7718
|
while (1) {
|
|
7524
|
-
switch (
|
|
7719
|
+
switch (_context37.prev = _context37.next) {
|
|
7525
7720
|
case 0:
|
|
7526
|
-
|
|
7721
|
+
_context37.next = 2;
|
|
7527
7722
|
return this.post(this.baseURL + '/moderation/unmute', _objectSpread({
|
|
7528
7723
|
target_id: targetID
|
|
7529
7724
|
}, currentUserID ? {
|
|
@@ -7531,17 +7726,17 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7531
7726
|
} : {}));
|
|
7532
7727
|
|
|
7533
7728
|
case 2:
|
|
7534
|
-
return
|
|
7729
|
+
return _context37.abrupt("return", _context37.sent);
|
|
7535
7730
|
|
|
7536
7731
|
case 3:
|
|
7537
7732
|
case "end":
|
|
7538
|
-
return
|
|
7733
|
+
return _context37.stop();
|
|
7539
7734
|
}
|
|
7540
7735
|
}
|
|
7541
|
-
},
|
|
7736
|
+
}, _callee37, this);
|
|
7542
7737
|
}));
|
|
7543
7738
|
|
|
7544
|
-
function unmuteUser(
|
|
7739
|
+
function unmuteUser(_x49, _x50) {
|
|
7545
7740
|
return _unmuteUser.apply(this, arguments);
|
|
7546
7741
|
}
|
|
7547
7742
|
|
|
@@ -7576,31 +7771,31 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7576
7771
|
}, {
|
|
7577
7772
|
key: "flagMessage",
|
|
7578
7773
|
value: function () {
|
|
7579
|
-
var _flagMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7774
|
+
var _flagMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee38(targetMessageID) {
|
|
7580
7775
|
var options,
|
|
7581
|
-
|
|
7582
|
-
return _regeneratorRuntime.wrap(function
|
|
7776
|
+
_args38 = arguments;
|
|
7777
|
+
return _regeneratorRuntime.wrap(function _callee38$(_context38) {
|
|
7583
7778
|
while (1) {
|
|
7584
|
-
switch (
|
|
7779
|
+
switch (_context38.prev = _context38.next) {
|
|
7585
7780
|
case 0:
|
|
7586
|
-
options =
|
|
7587
|
-
|
|
7781
|
+
options = _args38.length > 1 && _args38[1] !== undefined ? _args38[1] : {};
|
|
7782
|
+
_context38.next = 3;
|
|
7588
7783
|
return this.post(this.baseURL + '/moderation/flag', _objectSpread({
|
|
7589
7784
|
target_message_id: targetMessageID
|
|
7590
7785
|
}, options));
|
|
7591
7786
|
|
|
7592
7787
|
case 3:
|
|
7593
|
-
return
|
|
7788
|
+
return _context38.abrupt("return", _context38.sent);
|
|
7594
7789
|
|
|
7595
7790
|
case 4:
|
|
7596
7791
|
case "end":
|
|
7597
|
-
return
|
|
7792
|
+
return _context38.stop();
|
|
7598
7793
|
}
|
|
7599
7794
|
}
|
|
7600
|
-
},
|
|
7795
|
+
}, _callee38, this);
|
|
7601
7796
|
}));
|
|
7602
7797
|
|
|
7603
|
-
function flagMessage(
|
|
7798
|
+
function flagMessage(_x51) {
|
|
7604
7799
|
return _flagMessage.apply(this, arguments);
|
|
7605
7800
|
}
|
|
7606
7801
|
|
|
@@ -7616,31 +7811,31 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7616
7811
|
}, {
|
|
7617
7812
|
key: "flagUser",
|
|
7618
7813
|
value: function () {
|
|
7619
|
-
var _flagUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7814
|
+
var _flagUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee39(targetID) {
|
|
7620
7815
|
var options,
|
|
7621
|
-
|
|
7622
|
-
return _regeneratorRuntime.wrap(function
|
|
7816
|
+
_args39 = arguments;
|
|
7817
|
+
return _regeneratorRuntime.wrap(function _callee39$(_context39) {
|
|
7623
7818
|
while (1) {
|
|
7624
|
-
switch (
|
|
7819
|
+
switch (_context39.prev = _context39.next) {
|
|
7625
7820
|
case 0:
|
|
7626
|
-
options =
|
|
7627
|
-
|
|
7821
|
+
options = _args39.length > 1 && _args39[1] !== undefined ? _args39[1] : {};
|
|
7822
|
+
_context39.next = 3;
|
|
7628
7823
|
return this.post(this.baseURL + '/moderation/flag', _objectSpread({
|
|
7629
7824
|
target_user_id: targetID
|
|
7630
7825
|
}, options));
|
|
7631
7826
|
|
|
7632
7827
|
case 3:
|
|
7633
|
-
return
|
|
7828
|
+
return _context39.abrupt("return", _context39.sent);
|
|
7634
7829
|
|
|
7635
7830
|
case 4:
|
|
7636
7831
|
case "end":
|
|
7637
|
-
return
|
|
7832
|
+
return _context39.stop();
|
|
7638
7833
|
}
|
|
7639
7834
|
}
|
|
7640
|
-
},
|
|
7835
|
+
}, _callee39, this);
|
|
7641
7836
|
}));
|
|
7642
7837
|
|
|
7643
|
-
function flagUser(
|
|
7838
|
+
function flagUser(_x52) {
|
|
7644
7839
|
return _flagUser.apply(this, arguments);
|
|
7645
7840
|
}
|
|
7646
7841
|
|
|
@@ -7656,31 +7851,31 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7656
7851
|
}, {
|
|
7657
7852
|
key: "unflagMessage",
|
|
7658
7853
|
value: function () {
|
|
7659
|
-
var _unflagMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7854
|
+
var _unflagMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee40(targetMessageID) {
|
|
7660
7855
|
var options,
|
|
7661
|
-
|
|
7662
|
-
return _regeneratorRuntime.wrap(function
|
|
7856
|
+
_args40 = arguments;
|
|
7857
|
+
return _regeneratorRuntime.wrap(function _callee40$(_context40) {
|
|
7663
7858
|
while (1) {
|
|
7664
|
-
switch (
|
|
7859
|
+
switch (_context40.prev = _context40.next) {
|
|
7665
7860
|
case 0:
|
|
7666
|
-
options =
|
|
7667
|
-
|
|
7861
|
+
options = _args40.length > 1 && _args40[1] !== undefined ? _args40[1] : {};
|
|
7862
|
+
_context40.next = 3;
|
|
7668
7863
|
return this.post(this.baseURL + '/moderation/unflag', _objectSpread({
|
|
7669
7864
|
target_message_id: targetMessageID
|
|
7670
7865
|
}, options));
|
|
7671
7866
|
|
|
7672
7867
|
case 3:
|
|
7673
|
-
return
|
|
7868
|
+
return _context40.abrupt("return", _context40.sent);
|
|
7674
7869
|
|
|
7675
7870
|
case 4:
|
|
7676
7871
|
case "end":
|
|
7677
|
-
return
|
|
7872
|
+
return _context40.stop();
|
|
7678
7873
|
}
|
|
7679
7874
|
}
|
|
7680
|
-
},
|
|
7875
|
+
}, _callee40, this);
|
|
7681
7876
|
}));
|
|
7682
7877
|
|
|
7683
|
-
function unflagMessage(
|
|
7878
|
+
function unflagMessage(_x53) {
|
|
7684
7879
|
return _unflagMessage.apply(this, arguments);
|
|
7685
7880
|
}
|
|
7686
7881
|
|
|
@@ -7696,31 +7891,31 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7696
7891
|
}, {
|
|
7697
7892
|
key: "unflagUser",
|
|
7698
7893
|
value: function () {
|
|
7699
|
-
var _unflagUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7894
|
+
var _unflagUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee41(targetID) {
|
|
7700
7895
|
var options,
|
|
7701
|
-
|
|
7702
|
-
return _regeneratorRuntime.wrap(function
|
|
7896
|
+
_args41 = arguments;
|
|
7897
|
+
return _regeneratorRuntime.wrap(function _callee41$(_context41) {
|
|
7703
7898
|
while (1) {
|
|
7704
|
-
switch (
|
|
7899
|
+
switch (_context41.prev = _context41.next) {
|
|
7705
7900
|
case 0:
|
|
7706
|
-
options =
|
|
7707
|
-
|
|
7901
|
+
options = _args41.length > 1 && _args41[1] !== undefined ? _args41[1] : {};
|
|
7902
|
+
_context41.next = 3;
|
|
7708
7903
|
return this.post(this.baseURL + '/moderation/unflag', _objectSpread({
|
|
7709
7904
|
target_user_id: targetID
|
|
7710
7905
|
}, options));
|
|
7711
7906
|
|
|
7712
7907
|
case 3:
|
|
7713
|
-
return
|
|
7908
|
+
return _context41.abrupt("return", _context41.sent);
|
|
7714
7909
|
|
|
7715
7910
|
case 4:
|
|
7716
7911
|
case "end":
|
|
7717
|
-
return
|
|
7912
|
+
return _context41.stop();
|
|
7718
7913
|
}
|
|
7719
7914
|
}
|
|
7720
|
-
},
|
|
7915
|
+
}, _callee41, this);
|
|
7721
7916
|
}));
|
|
7722
7917
|
|
|
7723
|
-
function unflagUser(
|
|
7918
|
+
function unflagUser(_x54) {
|
|
7724
7919
|
return _unflagUser.apply(this, arguments);
|
|
7725
7920
|
}
|
|
7726
7921
|
|
|
@@ -7747,23 +7942,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7747
7942
|
* @return {Promise<APIResponse>}
|
|
7748
7943
|
*/
|
|
7749
7944
|
function () {
|
|
7750
|
-
var _markChannelsRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7945
|
+
var _markChannelsRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42() {
|
|
7751
7946
|
var data,
|
|
7752
|
-
|
|
7753
|
-
return _regeneratorRuntime.wrap(function
|
|
7947
|
+
_args42 = arguments;
|
|
7948
|
+
return _regeneratorRuntime.wrap(function _callee42$(_context42) {
|
|
7754
7949
|
while (1) {
|
|
7755
|
-
switch (
|
|
7950
|
+
switch (_context42.prev = _context42.next) {
|
|
7756
7951
|
case 0:
|
|
7757
|
-
data =
|
|
7758
|
-
|
|
7952
|
+
data = _args42.length > 0 && _args42[0] !== undefined ? _args42[0] : {};
|
|
7953
|
+
_context42.next = 3;
|
|
7759
7954
|
return this.post(this.baseURL + '/channels/read', _objectSpread({}, data));
|
|
7760
7955
|
|
|
7761
7956
|
case 3:
|
|
7762
7957
|
case "end":
|
|
7763
|
-
return
|
|
7958
|
+
return _context42.stop();
|
|
7764
7959
|
}
|
|
7765
7960
|
}
|
|
7766
|
-
},
|
|
7961
|
+
}, _callee42, this);
|
|
7767
7962
|
}));
|
|
7768
7963
|
|
|
7769
7964
|
function markChannelsRead() {
|
|
@@ -7838,28 +8033,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7838
8033
|
}, {
|
|
7839
8034
|
key: "translateMessage",
|
|
7840
8035
|
value: function () {
|
|
7841
|
-
var _translateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
7842
|
-
return _regeneratorRuntime.wrap(function
|
|
8036
|
+
var _translateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee43(messageId, language) {
|
|
8037
|
+
return _regeneratorRuntime.wrap(function _callee43$(_context43) {
|
|
7843
8038
|
while (1) {
|
|
7844
|
-
switch (
|
|
8039
|
+
switch (_context43.prev = _context43.next) {
|
|
7845
8040
|
case 0:
|
|
7846
|
-
|
|
8041
|
+
_context43.next = 2;
|
|
7847
8042
|
return this.post(this.baseURL + "/messages/".concat(messageId, "/translate"), {
|
|
7848
8043
|
language: language
|
|
7849
8044
|
});
|
|
7850
8045
|
|
|
7851
8046
|
case 2:
|
|
7852
|
-
return
|
|
8047
|
+
return _context43.abrupt("return", _context43.sent);
|
|
7853
8048
|
|
|
7854
8049
|
case 3:
|
|
7855
8050
|
case "end":
|
|
7856
|
-
return
|
|
8051
|
+
return _context43.stop();
|
|
7857
8052
|
}
|
|
7858
8053
|
}
|
|
7859
|
-
},
|
|
8054
|
+
}, _callee43, this);
|
|
7860
8055
|
}));
|
|
7861
8056
|
|
|
7862
|
-
function translateMessage(
|
|
8057
|
+
function translateMessage(_x55, _x56) {
|
|
7863
8058
|
return _translateMessage.apply(this, arguments);
|
|
7864
8059
|
}
|
|
7865
8060
|
|
|
@@ -7959,14 +8154,14 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
7959
8154
|
}, {
|
|
7960
8155
|
key: "updateMessage",
|
|
7961
8156
|
value: function () {
|
|
7962
|
-
var _updateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8157
|
+
var _updateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44(message, userId, options) {
|
|
7963
8158
|
var clonedMessage, reservedMessageFields;
|
|
7964
|
-
return _regeneratorRuntime.wrap(function
|
|
8159
|
+
return _regeneratorRuntime.wrap(function _callee44$(_context44) {
|
|
7965
8160
|
while (1) {
|
|
7966
|
-
switch (
|
|
8161
|
+
switch (_context44.prev = _context44.next) {
|
|
7967
8162
|
case 0:
|
|
7968
8163
|
if (message.id) {
|
|
7969
|
-
|
|
8164
|
+
_context44.next = 2;
|
|
7970
8165
|
break;
|
|
7971
8166
|
}
|
|
7972
8167
|
|
|
@@ -8003,23 +8198,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8003
8198
|
});
|
|
8004
8199
|
}
|
|
8005
8200
|
|
|
8006
|
-
|
|
8201
|
+
_context44.next = 10;
|
|
8007
8202
|
return this.post(this.baseURL + "/messages/".concat(message.id), _objectSpread({
|
|
8008
8203
|
message: clonedMessage
|
|
8009
8204
|
}, options));
|
|
8010
8205
|
|
|
8011
8206
|
case 10:
|
|
8012
|
-
return
|
|
8207
|
+
return _context44.abrupt("return", _context44.sent);
|
|
8013
8208
|
|
|
8014
8209
|
case 11:
|
|
8015
8210
|
case "end":
|
|
8016
|
-
return
|
|
8211
|
+
return _context44.stop();
|
|
8017
8212
|
}
|
|
8018
8213
|
}
|
|
8019
|
-
},
|
|
8214
|
+
}, _callee44, this);
|
|
8020
8215
|
}));
|
|
8021
8216
|
|
|
8022
|
-
function updateMessage(
|
|
8217
|
+
function updateMessage(_x57, _x58, _x59) {
|
|
8023
8218
|
return _updateMessage.apply(this, arguments);
|
|
8024
8219
|
}
|
|
8025
8220
|
|
|
@@ -8042,14 +8237,14 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8042
8237
|
}, {
|
|
8043
8238
|
key: "partialUpdateMessage",
|
|
8044
8239
|
value: function () {
|
|
8045
|
-
var _partialUpdateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8240
|
+
var _partialUpdateMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45(id, partialMessageObject, userId, options) {
|
|
8046
8241
|
var user;
|
|
8047
|
-
return _regeneratorRuntime.wrap(function
|
|
8242
|
+
return _regeneratorRuntime.wrap(function _callee45$(_context45) {
|
|
8048
8243
|
while (1) {
|
|
8049
|
-
switch (
|
|
8244
|
+
switch (_context45.prev = _context45.next) {
|
|
8050
8245
|
case 0:
|
|
8051
8246
|
if (id) {
|
|
8052
|
-
|
|
8247
|
+
_context45.next = 2;
|
|
8053
8248
|
break;
|
|
8054
8249
|
}
|
|
8055
8250
|
|
|
@@ -8064,23 +8259,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8064
8259
|
};
|
|
8065
8260
|
}
|
|
8066
8261
|
|
|
8067
|
-
|
|
8262
|
+
_context45.next = 6;
|
|
8068
8263
|
return this.put(this.baseURL + "/messages/".concat(id), _objectSpread(_objectSpread(_objectSpread({}, partialMessageObject), options), {}, {
|
|
8069
8264
|
user: user
|
|
8070
8265
|
}));
|
|
8071
8266
|
|
|
8072
8267
|
case 6:
|
|
8073
|
-
return
|
|
8268
|
+
return _context45.abrupt("return", _context45.sent);
|
|
8074
8269
|
|
|
8075
8270
|
case 7:
|
|
8076
8271
|
case "end":
|
|
8077
|
-
return
|
|
8272
|
+
return _context45.stop();
|
|
8078
8273
|
}
|
|
8079
8274
|
}
|
|
8080
|
-
},
|
|
8275
|
+
}, _callee45, this);
|
|
8081
8276
|
}));
|
|
8082
8277
|
|
|
8083
|
-
function partialUpdateMessage(
|
|
8278
|
+
function partialUpdateMessage(_x60, _x61, _x62, _x63) {
|
|
8084
8279
|
return _partialUpdateMessage.apply(this, arguments);
|
|
8085
8280
|
}
|
|
8086
8281
|
|
|
@@ -8089,11 +8284,11 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8089
8284
|
}, {
|
|
8090
8285
|
key: "deleteMessage",
|
|
8091
8286
|
value: function () {
|
|
8092
|
-
var _deleteMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8287
|
+
var _deleteMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46(messageID, hardDelete) {
|
|
8093
8288
|
var params;
|
|
8094
|
-
return _regeneratorRuntime.wrap(function
|
|
8289
|
+
return _regeneratorRuntime.wrap(function _callee46$(_context46) {
|
|
8095
8290
|
while (1) {
|
|
8096
|
-
switch (
|
|
8291
|
+
switch (_context46.prev = _context46.next) {
|
|
8097
8292
|
case 0:
|
|
8098
8293
|
params = {};
|
|
8099
8294
|
|
|
@@ -8103,21 +8298,21 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8103
8298
|
};
|
|
8104
8299
|
}
|
|
8105
8300
|
|
|
8106
|
-
|
|
8301
|
+
_context46.next = 4;
|
|
8107
8302
|
return this.delete(this.baseURL + "/messages/".concat(messageID), params);
|
|
8108
8303
|
|
|
8109
8304
|
case 4:
|
|
8110
|
-
return
|
|
8305
|
+
return _context46.abrupt("return", _context46.sent);
|
|
8111
8306
|
|
|
8112
8307
|
case 5:
|
|
8113
8308
|
case "end":
|
|
8114
|
-
return
|
|
8309
|
+
return _context46.stop();
|
|
8115
8310
|
}
|
|
8116
8311
|
}
|
|
8117
|
-
},
|
|
8312
|
+
}, _callee46, this);
|
|
8118
8313
|
}));
|
|
8119
8314
|
|
|
8120
|
-
function deleteMessage(
|
|
8315
|
+
function deleteMessage(_x64, _x65) {
|
|
8121
8316
|
return _deleteMessage.apply(this, arguments);
|
|
8122
8317
|
}
|
|
8123
8318
|
|
|
@@ -8126,26 +8321,26 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8126
8321
|
}, {
|
|
8127
8322
|
key: "getMessage",
|
|
8128
8323
|
value: function () {
|
|
8129
|
-
var _getMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8130
|
-
return _regeneratorRuntime.wrap(function
|
|
8324
|
+
var _getMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee47(messageID) {
|
|
8325
|
+
return _regeneratorRuntime.wrap(function _callee47$(_context47) {
|
|
8131
8326
|
while (1) {
|
|
8132
|
-
switch (
|
|
8327
|
+
switch (_context47.prev = _context47.next) {
|
|
8133
8328
|
case 0:
|
|
8134
|
-
|
|
8329
|
+
_context47.next = 2;
|
|
8135
8330
|
return this.get(this.baseURL + "/messages/".concat(messageID));
|
|
8136
8331
|
|
|
8137
8332
|
case 2:
|
|
8138
|
-
return
|
|
8333
|
+
return _context47.abrupt("return", _context47.sent);
|
|
8139
8334
|
|
|
8140
8335
|
case 3:
|
|
8141
8336
|
case "end":
|
|
8142
|
-
return
|
|
8337
|
+
return _context47.stop();
|
|
8143
8338
|
}
|
|
8144
8339
|
}
|
|
8145
|
-
},
|
|
8340
|
+
}, _callee47, this);
|
|
8146
8341
|
}));
|
|
8147
8342
|
|
|
8148
|
-
function getMessage(
|
|
8343
|
+
function getMessage(_x66) {
|
|
8149
8344
|
return _getMessage.apply(this, arguments);
|
|
8150
8345
|
}
|
|
8151
8346
|
|
|
@@ -8154,7 +8349,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8154
8349
|
}, {
|
|
8155
8350
|
key: "getUserAgent",
|
|
8156
8351
|
value: function getUserAgent() {
|
|
8157
|
-
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "4.
|
|
8352
|
+
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "4.4.2");
|
|
8158
8353
|
}
|
|
8159
8354
|
}, {
|
|
8160
8355
|
key: "setUserAgent",
|
|
@@ -8335,28 +8530,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8335
8530
|
}, {
|
|
8336
8531
|
key: "sendUserCustomEvent",
|
|
8337
8532
|
value: function () {
|
|
8338
|
-
var _sendUserCustomEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8339
|
-
return _regeneratorRuntime.wrap(function
|
|
8533
|
+
var _sendUserCustomEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee48(targetUserID, event) {
|
|
8534
|
+
return _regeneratorRuntime.wrap(function _callee48$(_context48) {
|
|
8340
8535
|
while (1) {
|
|
8341
|
-
switch (
|
|
8536
|
+
switch (_context48.prev = _context48.next) {
|
|
8342
8537
|
case 0:
|
|
8343
|
-
|
|
8538
|
+
_context48.next = 2;
|
|
8344
8539
|
return this.post("".concat(this.baseURL, "/users/").concat(targetUserID, "/event"), {
|
|
8345
8540
|
event: event
|
|
8346
8541
|
});
|
|
8347
8542
|
|
|
8348
8543
|
case 2:
|
|
8349
|
-
return
|
|
8544
|
+
return _context48.abrupt("return", _context48.sent);
|
|
8350
8545
|
|
|
8351
8546
|
case 3:
|
|
8352
8547
|
case "end":
|
|
8353
|
-
return
|
|
8548
|
+
return _context48.stop();
|
|
8354
8549
|
}
|
|
8355
8550
|
}
|
|
8356
|
-
},
|
|
8551
|
+
}, _callee48, this);
|
|
8357
8552
|
}));
|
|
8358
8553
|
|
|
8359
|
-
function sendUserCustomEvent(
|
|
8554
|
+
function sendUserCustomEvent(_x67, _x68) {
|
|
8360
8555
|
return _sendUserCustomEvent.apply(this, arguments);
|
|
8361
8556
|
}
|
|
8362
8557
|
|
|
@@ -8419,32 +8614,32 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8419
8614
|
}, {
|
|
8420
8615
|
key: "createSegment",
|
|
8421
8616
|
value: function () {
|
|
8422
|
-
var _createSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8617
|
+
var _createSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49(params) {
|
|
8423
8618
|
var _yield$this$post, segment;
|
|
8424
8619
|
|
|
8425
|
-
return _regeneratorRuntime.wrap(function
|
|
8620
|
+
return _regeneratorRuntime.wrap(function _callee49$(_context49) {
|
|
8426
8621
|
while (1) {
|
|
8427
|
-
switch (
|
|
8622
|
+
switch (_context49.prev = _context49.next) {
|
|
8428
8623
|
case 0:
|
|
8429
|
-
|
|
8624
|
+
_context49.next = 2;
|
|
8430
8625
|
return this.post(this.baseURL + "/segments", {
|
|
8431
8626
|
segment: params
|
|
8432
8627
|
});
|
|
8433
8628
|
|
|
8434
8629
|
case 2:
|
|
8435
|
-
_yield$this$post =
|
|
8630
|
+
_yield$this$post = _context49.sent;
|
|
8436
8631
|
segment = _yield$this$post.segment;
|
|
8437
|
-
return
|
|
8632
|
+
return _context49.abrupt("return", segment);
|
|
8438
8633
|
|
|
8439
8634
|
case 5:
|
|
8440
8635
|
case "end":
|
|
8441
|
-
return
|
|
8636
|
+
return _context49.stop();
|
|
8442
8637
|
}
|
|
8443
8638
|
}
|
|
8444
|
-
},
|
|
8639
|
+
}, _callee49, this);
|
|
8445
8640
|
}));
|
|
8446
8641
|
|
|
8447
|
-
function createSegment(
|
|
8642
|
+
function createSegment(_x69) {
|
|
8448
8643
|
return _createSegment.apply(this, arguments);
|
|
8449
8644
|
}
|
|
8450
8645
|
|
|
@@ -8461,30 +8656,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8461
8656
|
}, {
|
|
8462
8657
|
key: "getSegment",
|
|
8463
8658
|
value: function () {
|
|
8464
|
-
var _getSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8659
|
+
var _getSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee50(id) {
|
|
8465
8660
|
var _yield$this$get, segment;
|
|
8466
8661
|
|
|
8467
|
-
return _regeneratorRuntime.wrap(function
|
|
8662
|
+
return _regeneratorRuntime.wrap(function _callee50$(_context50) {
|
|
8468
8663
|
while (1) {
|
|
8469
|
-
switch (
|
|
8664
|
+
switch (_context50.prev = _context50.next) {
|
|
8470
8665
|
case 0:
|
|
8471
|
-
|
|
8666
|
+
_context50.next = 2;
|
|
8472
8667
|
return this.get(this.baseURL + "/segments/".concat(id));
|
|
8473
8668
|
|
|
8474
8669
|
case 2:
|
|
8475
|
-
_yield$this$get =
|
|
8670
|
+
_yield$this$get = _context50.sent;
|
|
8476
8671
|
segment = _yield$this$get.segment;
|
|
8477
|
-
return
|
|
8672
|
+
return _context50.abrupt("return", segment);
|
|
8478
8673
|
|
|
8479
8674
|
case 5:
|
|
8480
8675
|
case "end":
|
|
8481
|
-
return
|
|
8676
|
+
return _context50.stop();
|
|
8482
8677
|
}
|
|
8483
8678
|
}
|
|
8484
|
-
},
|
|
8679
|
+
}, _callee50, this);
|
|
8485
8680
|
}));
|
|
8486
8681
|
|
|
8487
|
-
function getSegment(
|
|
8682
|
+
function getSegment(_x70) {
|
|
8488
8683
|
return _getSegment.apply(this, arguments);
|
|
8489
8684
|
}
|
|
8490
8685
|
|
|
@@ -8500,30 +8695,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8500
8695
|
}, {
|
|
8501
8696
|
key: "listSegments",
|
|
8502
8697
|
value: function () {
|
|
8503
|
-
var _listSegments = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8698
|
+
var _listSegments = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee51(options) {
|
|
8504
8699
|
var _yield$this$get2, segments;
|
|
8505
8700
|
|
|
8506
|
-
return _regeneratorRuntime.wrap(function
|
|
8701
|
+
return _regeneratorRuntime.wrap(function _callee51$(_context51) {
|
|
8507
8702
|
while (1) {
|
|
8508
|
-
switch (
|
|
8703
|
+
switch (_context51.prev = _context51.next) {
|
|
8509
8704
|
case 0:
|
|
8510
|
-
|
|
8705
|
+
_context51.next = 2;
|
|
8511
8706
|
return this.get(this.baseURL + "/segments", options);
|
|
8512
8707
|
|
|
8513
8708
|
case 2:
|
|
8514
|
-
_yield$this$get2 =
|
|
8709
|
+
_yield$this$get2 = _context51.sent;
|
|
8515
8710
|
segments = _yield$this$get2.segments;
|
|
8516
|
-
return
|
|
8711
|
+
return _context51.abrupt("return", segments);
|
|
8517
8712
|
|
|
8518
8713
|
case 5:
|
|
8519
8714
|
case "end":
|
|
8520
|
-
return
|
|
8715
|
+
return _context51.stop();
|
|
8521
8716
|
}
|
|
8522
8717
|
}
|
|
8523
|
-
},
|
|
8718
|
+
}, _callee51, this);
|
|
8524
8719
|
}));
|
|
8525
8720
|
|
|
8526
|
-
function listSegments(
|
|
8721
|
+
function listSegments(_x71) {
|
|
8527
8722
|
return _listSegments.apply(this, arguments);
|
|
8528
8723
|
}
|
|
8529
8724
|
|
|
@@ -8541,32 +8736,32 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8541
8736
|
}, {
|
|
8542
8737
|
key: "updateSegment",
|
|
8543
8738
|
value: function () {
|
|
8544
|
-
var _updateSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8739
|
+
var _updateSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee52(id, params) {
|
|
8545
8740
|
var _yield$this$put, segment;
|
|
8546
8741
|
|
|
8547
|
-
return _regeneratorRuntime.wrap(function
|
|
8742
|
+
return _regeneratorRuntime.wrap(function _callee52$(_context52) {
|
|
8548
8743
|
while (1) {
|
|
8549
|
-
switch (
|
|
8744
|
+
switch (_context52.prev = _context52.next) {
|
|
8550
8745
|
case 0:
|
|
8551
|
-
|
|
8746
|
+
_context52.next = 2;
|
|
8552
8747
|
return this.put(this.baseURL + "/segments/".concat(id), {
|
|
8553
8748
|
segment: params
|
|
8554
8749
|
});
|
|
8555
8750
|
|
|
8556
8751
|
case 2:
|
|
8557
|
-
_yield$this$put =
|
|
8752
|
+
_yield$this$put = _context52.sent;
|
|
8558
8753
|
segment = _yield$this$put.segment;
|
|
8559
|
-
return
|
|
8754
|
+
return _context52.abrupt("return", segment);
|
|
8560
8755
|
|
|
8561
8756
|
case 5:
|
|
8562
8757
|
case "end":
|
|
8563
|
-
return
|
|
8758
|
+
return _context52.stop();
|
|
8564
8759
|
}
|
|
8565
8760
|
}
|
|
8566
|
-
},
|
|
8761
|
+
}, _callee52, this);
|
|
8567
8762
|
}));
|
|
8568
8763
|
|
|
8569
|
-
function updateSegment(
|
|
8764
|
+
function updateSegment(_x72, _x73) {
|
|
8570
8765
|
return _updateSegment.apply(this, arguments);
|
|
8571
8766
|
}
|
|
8572
8767
|
|
|
@@ -8583,22 +8778,22 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8583
8778
|
}, {
|
|
8584
8779
|
key: "deleteSegment",
|
|
8585
8780
|
value: function () {
|
|
8586
|
-
var _deleteSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8587
|
-
return _regeneratorRuntime.wrap(function
|
|
8781
|
+
var _deleteSegment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee53(id) {
|
|
8782
|
+
return _regeneratorRuntime.wrap(function _callee53$(_context53) {
|
|
8588
8783
|
while (1) {
|
|
8589
|
-
switch (
|
|
8784
|
+
switch (_context53.prev = _context53.next) {
|
|
8590
8785
|
case 0:
|
|
8591
|
-
return
|
|
8786
|
+
return _context53.abrupt("return", this.delete(this.baseURL + "/segments/".concat(id)));
|
|
8592
8787
|
|
|
8593
8788
|
case 1:
|
|
8594
8789
|
case "end":
|
|
8595
|
-
return
|
|
8790
|
+
return _context53.stop();
|
|
8596
8791
|
}
|
|
8597
8792
|
}
|
|
8598
|
-
},
|
|
8793
|
+
}, _callee53, this);
|
|
8599
8794
|
}));
|
|
8600
8795
|
|
|
8601
|
-
function deleteSegment(
|
|
8796
|
+
function deleteSegment(_x74) {
|
|
8602
8797
|
return _deleteSegment.apply(this, arguments);
|
|
8603
8798
|
}
|
|
8604
8799
|
|
|
@@ -8615,32 +8810,32 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8615
8810
|
}, {
|
|
8616
8811
|
key: "createCampaign",
|
|
8617
8812
|
value: function () {
|
|
8618
|
-
var _createCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8813
|
+
var _createCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee54(params) {
|
|
8619
8814
|
var _yield$this$post2, campaign;
|
|
8620
8815
|
|
|
8621
|
-
return _regeneratorRuntime.wrap(function
|
|
8816
|
+
return _regeneratorRuntime.wrap(function _callee54$(_context54) {
|
|
8622
8817
|
while (1) {
|
|
8623
|
-
switch (
|
|
8818
|
+
switch (_context54.prev = _context54.next) {
|
|
8624
8819
|
case 0:
|
|
8625
|
-
|
|
8820
|
+
_context54.next = 2;
|
|
8626
8821
|
return this.post(this.baseURL + "/campaigns", {
|
|
8627
8822
|
campaign: params
|
|
8628
8823
|
});
|
|
8629
8824
|
|
|
8630
8825
|
case 2:
|
|
8631
|
-
_yield$this$post2 =
|
|
8826
|
+
_yield$this$post2 = _context54.sent;
|
|
8632
8827
|
campaign = _yield$this$post2.campaign;
|
|
8633
|
-
return
|
|
8828
|
+
return _context54.abrupt("return", campaign);
|
|
8634
8829
|
|
|
8635
8830
|
case 5:
|
|
8636
8831
|
case "end":
|
|
8637
|
-
return
|
|
8832
|
+
return _context54.stop();
|
|
8638
8833
|
}
|
|
8639
8834
|
}
|
|
8640
|
-
},
|
|
8835
|
+
}, _callee54, this);
|
|
8641
8836
|
}));
|
|
8642
8837
|
|
|
8643
|
-
function createCampaign(
|
|
8838
|
+
function createCampaign(_x75) {
|
|
8644
8839
|
return _createCampaign.apply(this, arguments);
|
|
8645
8840
|
}
|
|
8646
8841
|
|
|
@@ -8657,30 +8852,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8657
8852
|
}, {
|
|
8658
8853
|
key: "getCampaign",
|
|
8659
8854
|
value: function () {
|
|
8660
|
-
var _getCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8855
|
+
var _getCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee55(id) {
|
|
8661
8856
|
var _yield$this$get3, campaign;
|
|
8662
8857
|
|
|
8663
|
-
return _regeneratorRuntime.wrap(function
|
|
8858
|
+
return _regeneratorRuntime.wrap(function _callee55$(_context55) {
|
|
8664
8859
|
while (1) {
|
|
8665
|
-
switch (
|
|
8860
|
+
switch (_context55.prev = _context55.next) {
|
|
8666
8861
|
case 0:
|
|
8667
|
-
|
|
8862
|
+
_context55.next = 2;
|
|
8668
8863
|
return this.get(this.baseURL + "/campaigns/".concat(id));
|
|
8669
8864
|
|
|
8670
8865
|
case 2:
|
|
8671
|
-
_yield$this$get3 =
|
|
8866
|
+
_yield$this$get3 = _context55.sent;
|
|
8672
8867
|
campaign = _yield$this$get3.campaign;
|
|
8673
|
-
return
|
|
8868
|
+
return _context55.abrupt("return", campaign);
|
|
8674
8869
|
|
|
8675
8870
|
case 5:
|
|
8676
8871
|
case "end":
|
|
8677
|
-
return
|
|
8872
|
+
return _context55.stop();
|
|
8678
8873
|
}
|
|
8679
8874
|
}
|
|
8680
|
-
},
|
|
8875
|
+
}, _callee55, this);
|
|
8681
8876
|
}));
|
|
8682
8877
|
|
|
8683
|
-
function getCampaign(
|
|
8878
|
+
function getCampaign(_x76) {
|
|
8684
8879
|
return _getCampaign.apply(this, arguments);
|
|
8685
8880
|
}
|
|
8686
8881
|
|
|
@@ -8696,30 +8891,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8696
8891
|
}, {
|
|
8697
8892
|
key: "listCampaigns",
|
|
8698
8893
|
value: function () {
|
|
8699
|
-
var _listCampaigns = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8894
|
+
var _listCampaigns = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee56(options) {
|
|
8700
8895
|
var _yield$this$get4, campaigns;
|
|
8701
8896
|
|
|
8702
|
-
return _regeneratorRuntime.wrap(function
|
|
8897
|
+
return _regeneratorRuntime.wrap(function _callee56$(_context56) {
|
|
8703
8898
|
while (1) {
|
|
8704
|
-
switch (
|
|
8899
|
+
switch (_context56.prev = _context56.next) {
|
|
8705
8900
|
case 0:
|
|
8706
|
-
|
|
8901
|
+
_context56.next = 2;
|
|
8707
8902
|
return this.get(this.baseURL + "/campaigns", options);
|
|
8708
8903
|
|
|
8709
8904
|
case 2:
|
|
8710
|
-
_yield$this$get4 =
|
|
8905
|
+
_yield$this$get4 = _context56.sent;
|
|
8711
8906
|
campaigns = _yield$this$get4.campaigns;
|
|
8712
|
-
return
|
|
8907
|
+
return _context56.abrupt("return", campaigns);
|
|
8713
8908
|
|
|
8714
8909
|
case 5:
|
|
8715
8910
|
case "end":
|
|
8716
|
-
return
|
|
8911
|
+
return _context56.stop();
|
|
8717
8912
|
}
|
|
8718
8913
|
}
|
|
8719
|
-
},
|
|
8914
|
+
}, _callee56, this);
|
|
8720
8915
|
}));
|
|
8721
8916
|
|
|
8722
|
-
function listCampaigns(
|
|
8917
|
+
function listCampaigns(_x77) {
|
|
8723
8918
|
return _listCampaigns.apply(this, arguments);
|
|
8724
8919
|
}
|
|
8725
8920
|
|
|
@@ -8737,32 +8932,32 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8737
8932
|
}, {
|
|
8738
8933
|
key: "updateCampaign",
|
|
8739
8934
|
value: function () {
|
|
8740
|
-
var _updateCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8935
|
+
var _updateCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee57(id, params) {
|
|
8741
8936
|
var _yield$this$put2, campaign;
|
|
8742
8937
|
|
|
8743
|
-
return _regeneratorRuntime.wrap(function
|
|
8938
|
+
return _regeneratorRuntime.wrap(function _callee57$(_context57) {
|
|
8744
8939
|
while (1) {
|
|
8745
|
-
switch (
|
|
8940
|
+
switch (_context57.prev = _context57.next) {
|
|
8746
8941
|
case 0:
|
|
8747
|
-
|
|
8942
|
+
_context57.next = 2;
|
|
8748
8943
|
return this.put(this.baseURL + "/campaigns/".concat(id), {
|
|
8749
8944
|
campaign: params
|
|
8750
8945
|
});
|
|
8751
8946
|
|
|
8752
8947
|
case 2:
|
|
8753
|
-
_yield$this$put2 =
|
|
8948
|
+
_yield$this$put2 = _context57.sent;
|
|
8754
8949
|
campaign = _yield$this$put2.campaign;
|
|
8755
|
-
return
|
|
8950
|
+
return _context57.abrupt("return", campaign);
|
|
8756
8951
|
|
|
8757
8952
|
case 5:
|
|
8758
8953
|
case "end":
|
|
8759
|
-
return
|
|
8954
|
+
return _context57.stop();
|
|
8760
8955
|
}
|
|
8761
8956
|
}
|
|
8762
|
-
},
|
|
8957
|
+
}, _callee57, this);
|
|
8763
8958
|
}));
|
|
8764
8959
|
|
|
8765
|
-
function updateCampaign(
|
|
8960
|
+
function updateCampaign(_x78, _x79) {
|
|
8766
8961
|
return _updateCampaign.apply(this, arguments);
|
|
8767
8962
|
}
|
|
8768
8963
|
|
|
@@ -8779,22 +8974,22 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8779
8974
|
}, {
|
|
8780
8975
|
key: "deleteCampaign",
|
|
8781
8976
|
value: function () {
|
|
8782
|
-
var _deleteCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8783
|
-
return _regeneratorRuntime.wrap(function
|
|
8977
|
+
var _deleteCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee58(id) {
|
|
8978
|
+
return _regeneratorRuntime.wrap(function _callee58$(_context58) {
|
|
8784
8979
|
while (1) {
|
|
8785
|
-
switch (
|
|
8980
|
+
switch (_context58.prev = _context58.next) {
|
|
8786
8981
|
case 0:
|
|
8787
|
-
return
|
|
8982
|
+
return _context58.abrupt("return", this.delete(this.baseURL + "/campaigns/".concat(id)));
|
|
8788
8983
|
|
|
8789
8984
|
case 1:
|
|
8790
8985
|
case "end":
|
|
8791
|
-
return
|
|
8986
|
+
return _context58.stop();
|
|
8792
8987
|
}
|
|
8793
8988
|
}
|
|
8794
|
-
},
|
|
8989
|
+
}, _callee58, this);
|
|
8795
8990
|
}));
|
|
8796
8991
|
|
|
8797
|
-
function deleteCampaign(
|
|
8992
|
+
function deleteCampaign(_x80) {
|
|
8798
8993
|
return _deleteCampaign.apply(this, arguments);
|
|
8799
8994
|
}
|
|
8800
8995
|
|
|
@@ -8812,33 +9007,33 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8812
9007
|
}, {
|
|
8813
9008
|
key: "scheduleCampaign",
|
|
8814
9009
|
value: function () {
|
|
8815
|
-
var _scheduleCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9010
|
+
var _scheduleCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee59(id, params) {
|
|
8816
9011
|
var sendAt, _yield$this$patch, campaign;
|
|
8817
9012
|
|
|
8818
|
-
return _regeneratorRuntime.wrap(function
|
|
9013
|
+
return _regeneratorRuntime.wrap(function _callee59$(_context59) {
|
|
8819
9014
|
while (1) {
|
|
8820
|
-
switch (
|
|
9015
|
+
switch (_context59.prev = _context59.next) {
|
|
8821
9016
|
case 0:
|
|
8822
9017
|
sendAt = params.sendAt;
|
|
8823
|
-
|
|
9018
|
+
_context59.next = 3;
|
|
8824
9019
|
return this.patch(this.baseURL + "/campaigns/".concat(id, "/schedule"), {
|
|
8825
9020
|
send_at: sendAt
|
|
8826
9021
|
});
|
|
8827
9022
|
|
|
8828
9023
|
case 3:
|
|
8829
|
-
_yield$this$patch =
|
|
9024
|
+
_yield$this$patch = _context59.sent;
|
|
8830
9025
|
campaign = _yield$this$patch.campaign;
|
|
8831
|
-
return
|
|
9026
|
+
return _context59.abrupt("return", campaign);
|
|
8832
9027
|
|
|
8833
9028
|
case 6:
|
|
8834
9029
|
case "end":
|
|
8835
|
-
return
|
|
9030
|
+
return _context59.stop();
|
|
8836
9031
|
}
|
|
8837
9032
|
}
|
|
8838
|
-
},
|
|
9033
|
+
}, _callee59, this);
|
|
8839
9034
|
}));
|
|
8840
9035
|
|
|
8841
|
-
function scheduleCampaign(
|
|
9036
|
+
function scheduleCampaign(_x81, _x82) {
|
|
8842
9037
|
return _scheduleCampaign.apply(this, arguments);
|
|
8843
9038
|
}
|
|
8844
9039
|
|
|
@@ -8855,30 +9050,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8855
9050
|
}, {
|
|
8856
9051
|
key: "stopCampaign",
|
|
8857
9052
|
value: function () {
|
|
8858
|
-
var _stopCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9053
|
+
var _stopCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee60(id) {
|
|
8859
9054
|
var _yield$this$patch2, campaign;
|
|
8860
9055
|
|
|
8861
|
-
return _regeneratorRuntime.wrap(function
|
|
9056
|
+
return _regeneratorRuntime.wrap(function _callee60$(_context60) {
|
|
8862
9057
|
while (1) {
|
|
8863
|
-
switch (
|
|
9058
|
+
switch (_context60.prev = _context60.next) {
|
|
8864
9059
|
case 0:
|
|
8865
|
-
|
|
9060
|
+
_context60.next = 2;
|
|
8866
9061
|
return this.patch(this.baseURL + "/campaigns/".concat(id, "/stop"));
|
|
8867
9062
|
|
|
8868
9063
|
case 2:
|
|
8869
|
-
_yield$this$patch2 =
|
|
9064
|
+
_yield$this$patch2 = _context60.sent;
|
|
8870
9065
|
campaign = _yield$this$patch2.campaign;
|
|
8871
|
-
return
|
|
9066
|
+
return _context60.abrupt("return", campaign);
|
|
8872
9067
|
|
|
8873
9068
|
case 5:
|
|
8874
9069
|
case "end":
|
|
8875
|
-
return
|
|
9070
|
+
return _context60.stop();
|
|
8876
9071
|
}
|
|
8877
9072
|
}
|
|
8878
|
-
},
|
|
9073
|
+
}, _callee60, this);
|
|
8879
9074
|
}));
|
|
8880
9075
|
|
|
8881
|
-
function stopCampaign(
|
|
9076
|
+
function stopCampaign(_x83) {
|
|
8882
9077
|
return _stopCampaign.apply(this, arguments);
|
|
8883
9078
|
}
|
|
8884
9079
|
|
|
@@ -8895,30 +9090,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8895
9090
|
}, {
|
|
8896
9091
|
key: "resumeCampaign",
|
|
8897
9092
|
value: function () {
|
|
8898
|
-
var _resumeCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9093
|
+
var _resumeCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee61(id) {
|
|
8899
9094
|
var _yield$this$patch3, campaign;
|
|
8900
9095
|
|
|
8901
|
-
return _regeneratorRuntime.wrap(function
|
|
9096
|
+
return _regeneratorRuntime.wrap(function _callee61$(_context61) {
|
|
8902
9097
|
while (1) {
|
|
8903
|
-
switch (
|
|
9098
|
+
switch (_context61.prev = _context61.next) {
|
|
8904
9099
|
case 0:
|
|
8905
|
-
|
|
9100
|
+
_context61.next = 2;
|
|
8906
9101
|
return this.patch(this.baseURL + "/campaigns/".concat(id, "/resume"));
|
|
8907
9102
|
|
|
8908
9103
|
case 2:
|
|
8909
|
-
_yield$this$patch3 =
|
|
9104
|
+
_yield$this$patch3 = _context61.sent;
|
|
8910
9105
|
campaign = _yield$this$patch3.campaign;
|
|
8911
|
-
return
|
|
9106
|
+
return _context61.abrupt("return", campaign);
|
|
8912
9107
|
|
|
8913
9108
|
case 5:
|
|
8914
9109
|
case "end":
|
|
8915
|
-
return
|
|
9110
|
+
return _context61.stop();
|
|
8916
9111
|
}
|
|
8917
9112
|
}
|
|
8918
|
-
},
|
|
9113
|
+
}, _callee61, this);
|
|
8919
9114
|
}));
|
|
8920
9115
|
|
|
8921
|
-
function resumeCampaign(
|
|
9116
|
+
function resumeCampaign(_x84) {
|
|
8922
9117
|
return _resumeCampaign.apply(this, arguments);
|
|
8923
9118
|
}
|
|
8924
9119
|
|
|
@@ -8935,33 +9130,33 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8935
9130
|
}, {
|
|
8936
9131
|
key: "testCampaign",
|
|
8937
9132
|
value: function () {
|
|
8938
|
-
var _testCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9133
|
+
var _testCampaign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee62(id, params) {
|
|
8939
9134
|
var users, _yield$this$post3, campaign;
|
|
8940
9135
|
|
|
8941
|
-
return _regeneratorRuntime.wrap(function
|
|
9136
|
+
return _regeneratorRuntime.wrap(function _callee62$(_context62) {
|
|
8942
9137
|
while (1) {
|
|
8943
|
-
switch (
|
|
9138
|
+
switch (_context62.prev = _context62.next) {
|
|
8944
9139
|
case 0:
|
|
8945
9140
|
users = params.users;
|
|
8946
|
-
|
|
9141
|
+
_context62.next = 3;
|
|
8947
9142
|
return this.post(this.baseURL + "/campaigns/".concat(id, "/test"), {
|
|
8948
9143
|
users: users
|
|
8949
9144
|
});
|
|
8950
9145
|
|
|
8951
9146
|
case 3:
|
|
8952
|
-
_yield$this$post3 =
|
|
9147
|
+
_yield$this$post3 = _context62.sent;
|
|
8953
9148
|
campaign = _yield$this$post3.campaign;
|
|
8954
|
-
return
|
|
9149
|
+
return _context62.abrupt("return", campaign);
|
|
8955
9150
|
|
|
8956
9151
|
case 6:
|
|
8957
9152
|
case "end":
|
|
8958
|
-
return
|
|
9153
|
+
return _context62.stop();
|
|
8959
9154
|
}
|
|
8960
9155
|
}
|
|
8961
|
-
},
|
|
9156
|
+
}, _callee62, this);
|
|
8962
9157
|
}));
|
|
8963
9158
|
|
|
8964
|
-
function testCampaign(
|
|
9159
|
+
function testCampaign(_x85, _x86) {
|
|
8965
9160
|
return _testCampaign.apply(this, arguments);
|
|
8966
9161
|
}
|
|
8967
9162
|
|
|
@@ -8977,24 +9172,24 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
8977
9172
|
}, {
|
|
8978
9173
|
key: "enrichURL",
|
|
8979
9174
|
value: function () {
|
|
8980
|
-
var _enrichURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
8981
|
-
return _regeneratorRuntime.wrap(function
|
|
9175
|
+
var _enrichURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee63(url) {
|
|
9176
|
+
return _regeneratorRuntime.wrap(function _callee63$(_context63) {
|
|
8982
9177
|
while (1) {
|
|
8983
|
-
switch (
|
|
9178
|
+
switch (_context63.prev = _context63.next) {
|
|
8984
9179
|
case 0:
|
|
8985
|
-
return
|
|
9180
|
+
return _context63.abrupt("return", this.get(this.baseURL + "/og", {
|
|
8986
9181
|
url: url
|
|
8987
9182
|
}));
|
|
8988
9183
|
|
|
8989
9184
|
case 1:
|
|
8990
9185
|
case "end":
|
|
8991
|
-
return
|
|
9186
|
+
return _context63.stop();
|
|
8992
9187
|
}
|
|
8993
9188
|
}
|
|
8994
|
-
},
|
|
9189
|
+
}, _callee63, this);
|
|
8995
9190
|
}));
|
|
8996
9191
|
|
|
8997
|
-
function enrichURL(
|
|
9192
|
+
function enrichURL(_x87) {
|
|
8998
9193
|
return _enrichURL.apply(this, arguments);
|
|
8999
9194
|
}
|
|
9000
9195
|
|
|
@@ -9011,22 +9206,22 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9011
9206
|
}, {
|
|
9012
9207
|
key: "getTask",
|
|
9013
9208
|
value: function () {
|
|
9014
|
-
var _getTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9015
|
-
return _regeneratorRuntime.wrap(function
|
|
9209
|
+
var _getTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee64(id) {
|
|
9210
|
+
return _regeneratorRuntime.wrap(function _callee64$(_context64) {
|
|
9016
9211
|
while (1) {
|
|
9017
|
-
switch (
|
|
9212
|
+
switch (_context64.prev = _context64.next) {
|
|
9018
9213
|
case 0:
|
|
9019
|
-
return
|
|
9214
|
+
return _context64.abrupt("return", this.get("".concat(this.baseURL, "/tasks/").concat(id)));
|
|
9020
9215
|
|
|
9021
9216
|
case 1:
|
|
9022
9217
|
case "end":
|
|
9023
|
-
return
|
|
9218
|
+
return _context64.stop();
|
|
9024
9219
|
}
|
|
9025
9220
|
}
|
|
9026
|
-
},
|
|
9221
|
+
}, _callee64, this);
|
|
9027
9222
|
}));
|
|
9028
9223
|
|
|
9029
|
-
function getTask(
|
|
9224
|
+
function getTask(_x88) {
|
|
9030
9225
|
return _getTask.apply(this, arguments);
|
|
9031
9226
|
}
|
|
9032
9227
|
|
|
@@ -9044,36 +9239,39 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9044
9239
|
}, {
|
|
9045
9240
|
key: "deleteChannels",
|
|
9046
9241
|
value: function () {
|
|
9047
|
-
var _deleteChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
9242
|
+
var _deleteChannels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee65(cids) {
|
|
9048
9243
|
var options,
|
|
9049
|
-
|
|
9050
|
-
return _regeneratorRuntime.wrap(function
|
|
9244
|
+
_args65 = arguments;
|
|
9245
|
+
return _regeneratorRuntime.wrap(function _callee65$(_context65) {
|
|
9051
9246
|
while (1) {
|
|
9052
|
-
switch (
|
|
9247
|
+
switch (_context65.prev = _context65.next) {
|
|
9053
9248
|
case 0:
|
|
9054
|
-
options =
|
|
9055
|
-
|
|
9249
|
+
options = _args65.length > 1 && _args65[1] !== undefined ? _args65[1] : {};
|
|
9250
|
+
_context65.next = 3;
|
|
9056
9251
|
return this.post(this.baseURL + "/channels/delete", _objectSpread({
|
|
9057
9252
|
cids: cids
|
|
9058
9253
|
}, options));
|
|
9059
9254
|
|
|
9060
9255
|
case 3:
|
|
9061
|
-
return
|
|
9256
|
+
return _context65.abrupt("return", _context65.sent);
|
|
9062
9257
|
|
|
9063
9258
|
case 4:
|
|
9064
9259
|
case "end":
|
|
9065
|
-
return
|
|
9260
|
+
return _context65.stop();
|
|
9066
9261
|
}
|
|
9067
9262
|
}
|
|
9068
|
-
},
|
|
9263
|
+
}, _callee65, this);
|
|
9069
9264
|
}));
|
|
9070
9265
|
|
|
9071
|
-
function deleteChannels(
|
|
9266
|
+
function deleteChannels(_x89) {
|
|
9072
9267
|
return _deleteChannels.apply(this, arguments);
|
|
9073
9268
|
}
|
|
9074
9269
|
|
|
9075
9270
|
return deleteChannels;
|
|
9076
9271
|
}()
|
|
9272
|
+
}, {
|
|
9273
|
+
key: "deleteUsers",
|
|
9274
|
+
value:
|
|
9077
9275
|
/**
|
|
9078
9276
|
* deleteUsers - Batch Delete Users
|
|
9079
9277
|
*
|
|
@@ -9082,17 +9280,14 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9082
9280
|
*
|
|
9083
9281
|
* @return {APIResponse} A task ID
|
|
9084
9282
|
*/
|
|
9085
|
-
|
|
9086
|
-
|
|
9087
|
-
|
|
9088
|
-
value: function () {
|
|
9089
|
-
var _deleteUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee65(user_ids, options) {
|
|
9090
|
-
return _regeneratorRuntime.wrap(function _callee65$(_context65) {
|
|
9283
|
+
function () {
|
|
9284
|
+
var _deleteUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee66(user_ids, options) {
|
|
9285
|
+
return _regeneratorRuntime.wrap(function _callee66$(_context66) {
|
|
9091
9286
|
while (1) {
|
|
9092
|
-
switch (
|
|
9287
|
+
switch (_context66.prev = _context66.next) {
|
|
9093
9288
|
case 0:
|
|
9094
9289
|
if (!((options === null || options === void 0 ? void 0 : options.user) !== 'soft' && (options === null || options === void 0 ? void 0 : options.user) !== 'hard')) {
|
|
9095
|
-
|
|
9290
|
+
_context66.next = 2;
|
|
9096
9291
|
break;
|
|
9097
9292
|
}
|
|
9098
9293
|
|
|
@@ -9100,7 +9295,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9100
9295
|
|
|
9101
9296
|
case 2:
|
|
9102
9297
|
if (!(options.messages !== undefined && options.messages !== 'soft' && options.messages !== 'hard')) {
|
|
9103
|
-
|
|
9298
|
+
_context66.next = 4;
|
|
9104
9299
|
break;
|
|
9105
9300
|
}
|
|
9106
9301
|
|
|
@@ -9108,30 +9303,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
9108
9303
|
|
|
9109
9304
|
case 4:
|
|
9110
9305
|
if (!(options.conversations !== undefined && options.conversations !== 'soft' && options.conversations !== 'hard')) {
|
|
9111
|
-
|
|
9306
|
+
_context66.next = 6;
|
|
9112
9307
|
break;
|
|
9113
9308
|
}
|
|
9114
9309
|
|
|
9115
9310
|
throw new Error('Invalid delete user options. conversations must be one of [soft hard]');
|
|
9116
9311
|
|
|
9117
9312
|
case 6:
|
|
9118
|
-
|
|
9313
|
+
_context66.next = 8;
|
|
9119
9314
|
return this.post(this.baseURL + "/users/delete", _objectSpread({
|
|
9120
9315
|
user_ids: user_ids
|
|
9121
9316
|
}, options));
|
|
9122
9317
|
|
|
9123
9318
|
case 8:
|
|
9124
|
-
return
|
|
9319
|
+
return _context66.abrupt("return", _context66.sent);
|
|
9125
9320
|
|
|
9126
9321
|
case 9:
|
|
9127
9322
|
case "end":
|
|
9128
|
-
return
|
|
9323
|
+
return _context66.stop();
|
|
9129
9324
|
}
|
|
9130
9325
|
}
|
|
9131
|
-
},
|
|
9326
|
+
}, _callee66, this);
|
|
9132
9327
|
}));
|
|
9133
9328
|
|
|
9134
|
-
function deleteUsers(
|
|
9329
|
+
function deleteUsers(_x90, _x91) {
|
|
9135
9330
|
return _deleteUsers.apply(this, arguments);
|
|
9136
9331
|
}
|
|
9137
9332
|
|
|
@@ -9231,5 +9426,5 @@ var BuiltinPermissions = {
|
|
|
9231
9426
|
UseFrozenChannel: 'Send messages and reactions to frozen channels'
|
|
9232
9427
|
};
|
|
9233
9428
|
|
|
9234
|
-
export { Allow, AllowAll, AnyResource, AnyRole, BuiltinPermissions, BuiltinRoles, Channel, ChannelState, CheckSignature, ClientState, Deny, DenyAll, DevToken, EVENT_MAP, JWTServerToken, JWTUserToken, MaxPriority, MinPriority, Permission, StableWSConnection, StreamChat, TokenManager, UserFromToken, chatCodes, decodeBase64, encodeBase64, isOwnUser, isValidEventType, logChatPromiseExecution };
|
|
9429
|
+
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 };
|
|
9235
9430
|
//# sourceMappingURL=browser.es.js.map
|