stream-chat 4.3.0 → 4.4.0-insights.0

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