stream-chat 8.4.0 → 8.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1387,30 +1387,36 @@ var Channel = /*#__PURE__*/function () {
1387
1387
 
1388
1388
  _defineProperty(this, "disconnected", void 0);
1389
1389
 
1390
- _defineProperty(this, "create", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
1391
- var options;
1392
- return _regeneratorRuntime.wrap(function _callee$(_context) {
1393
- while (1) {
1394
- switch (_context.prev = _context.next) {
1395
- case 0:
1396
- options = {
1397
- watch: false,
1398
- state: false,
1399
- presence: false
1400
- };
1401
- _context.next = 3;
1402
- return _this.query(options, 'latest');
1390
+ _defineProperty(this, "create", /*#__PURE__*/function () {
1391
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(options) {
1392
+ var defaultOptions;
1393
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
1394
+ while (1) {
1395
+ switch (_context.prev = _context.next) {
1396
+ case 0:
1397
+ defaultOptions = _objectSpread$5(_objectSpread$5({}, options), {}, {
1398
+ watch: false,
1399
+ state: false,
1400
+ presence: false
1401
+ });
1402
+ _context.next = 3;
1403
+ return _this.query(defaultOptions, 'latest');
1403
1404
 
1404
- case 3:
1405
- return _context.abrupt("return", _context.sent);
1405
+ case 3:
1406
+ return _context.abrupt("return", _context.sent);
1406
1407
 
1407
- case 4:
1408
- case "end":
1409
- return _context.stop();
1408
+ case 4:
1409
+ case "end":
1410
+ return _context.stop();
1411
+ }
1410
1412
  }
1411
- }
1412
- }, _callee);
1413
- })));
1413
+ }, _callee);
1414
+ }));
1415
+
1416
+ return function (_x) {
1417
+ return _ref.apply(this, arguments);
1418
+ };
1419
+ }());
1414
1420
 
1415
1421
  _defineProperty(this, "_callChannelListeners", function (event) {
1416
1422
  var channel = _this; // gather and call the listeners
@@ -1540,7 +1546,7 @@ var Channel = /*#__PURE__*/function () {
1540
1546
  }, _callee2, this);
1541
1547
  }));
1542
1548
 
1543
- function sendMessage(_x, _x2) {
1549
+ function sendMessage(_x2, _x3) {
1544
1550
  return _sendMessage.apply(this, arguments);
1545
1551
  }
1546
1552
 
@@ -1604,7 +1610,7 @@ var Channel = /*#__PURE__*/function () {
1604
1610
  }, _callee3, this);
1605
1611
  }));
1606
1612
 
1607
- function sendEvent(_x3) {
1613
+ function sendEvent(_x4) {
1608
1614
  return _sendEvent.apply(this, arguments);
1609
1615
  }
1610
1616
 
@@ -1692,7 +1698,7 @@ var Channel = /*#__PURE__*/function () {
1692
1698
  }, _callee4, this);
1693
1699
  }));
1694
1700
 
1695
- function search(_x4) {
1701
+ function search(_x5) {
1696
1702
  return _search.apply(this, arguments);
1697
1703
  }
1698
1704
 
@@ -1758,7 +1764,7 @@ var Channel = /*#__PURE__*/function () {
1758
1764
  }, _callee5, this);
1759
1765
  }));
1760
1766
 
1761
- function queryMembers(_x5) {
1767
+ function queryMembers(_x6) {
1762
1768
  return _queryMembers.apply(this, arguments);
1763
1769
  }
1764
1770
 
@@ -1814,7 +1820,7 @@ var Channel = /*#__PURE__*/function () {
1814
1820
  }, _callee6, this);
1815
1821
  }));
1816
1822
 
1817
- function sendReaction(_x6, _x7, _x8) {
1823
+ function sendReaction(_x7, _x8, _x9) {
1818
1824
  return _sendReaction.apply(this, arguments);
1819
1825
  }
1820
1826
 
@@ -1935,7 +1941,7 @@ var Channel = /*#__PURE__*/function () {
1935
1941
  }, _callee8, this);
1936
1942
  }));
1937
1943
 
1938
- function updatePartial(_x9) {
1944
+ function updatePartial(_x10) {
1939
1945
  return _updatePartial.apply(this, arguments);
1940
1946
  }
1941
1947
 
@@ -1975,7 +1981,7 @@ var Channel = /*#__PURE__*/function () {
1975
1981
  }, _callee9, this);
1976
1982
  }));
1977
1983
 
1978
- function enableSlowMode(_x10) {
1984
+ function enableSlowMode(_x11) {
1979
1985
  return _enableSlowMode.apply(this, arguments);
1980
1986
  }
1981
1987
 
@@ -2215,7 +2221,7 @@ var Channel = /*#__PURE__*/function () {
2215
2221
  }, _callee15, this);
2216
2222
  }));
2217
2223
 
2218
- function addMembers(_x11, _x12) {
2224
+ function addMembers(_x12, _x13) {
2219
2225
  return _addMembers.apply(this, arguments);
2220
2226
  }
2221
2227
 
@@ -2258,7 +2264,7 @@ var Channel = /*#__PURE__*/function () {
2258
2264
  }, _callee16, this);
2259
2265
  }));
2260
2266
 
2261
- function addModerators(_x13, _x14) {
2267
+ function addModerators(_x14, _x15) {
2262
2268
  return _addModerators.apply(this, arguments);
2263
2269
  }
2264
2270
 
@@ -2301,7 +2307,7 @@ var Channel = /*#__PURE__*/function () {
2301
2307
  }, _callee17, this);
2302
2308
  }));
2303
2309
 
2304
- function assignRoles(_x15, _x16) {
2310
+ function assignRoles(_x16, _x17) {
2305
2311
  return _assignRoles.apply(this, arguments);
2306
2312
  }
2307
2313
 
@@ -2344,7 +2350,7 @@ var Channel = /*#__PURE__*/function () {
2344
2350
  }, _callee18, this);
2345
2351
  }));
2346
2352
 
2347
- function inviteMembers(_x17, _x18) {
2353
+ function inviteMembers(_x18, _x19) {
2348
2354
  return _inviteMembers.apply(this, arguments);
2349
2355
  }
2350
2356
 
@@ -2387,7 +2393,7 @@ var Channel = /*#__PURE__*/function () {
2387
2393
  }, _callee19, this);
2388
2394
  }));
2389
2395
 
2390
- function removeMembers(_x19, _x20) {
2396
+ function removeMembers(_x20, _x21) {
2391
2397
  return _removeMembers.apply(this, arguments);
2392
2398
  }
2393
2399
 
@@ -2430,7 +2436,7 @@ var Channel = /*#__PURE__*/function () {
2430
2436
  }, _callee20, this);
2431
2437
  }));
2432
2438
 
2433
- function demoteModerators(_x21, _x22) {
2439
+ function demoteModerators(_x22, _x23) {
2434
2440
  return _demoteModerators.apply(this, arguments);
2435
2441
  }
2436
2442
 
@@ -2468,7 +2474,7 @@ var Channel = /*#__PURE__*/function () {
2468
2474
  }, _callee21, this);
2469
2475
  }));
2470
2476
 
2471
- function _update(_x23) {
2477
+ function _update(_x24) {
2472
2478
  return _update3.apply(this, arguments);
2473
2479
  }
2474
2480
 
@@ -2641,7 +2647,7 @@ var Channel = /*#__PURE__*/function () {
2641
2647
  }, _callee24, this);
2642
2648
  }));
2643
2649
 
2644
- function keystroke(_x24) {
2650
+ function keystroke(_x25) {
2645
2651
  return _keystroke.apply(this, arguments);
2646
2652
  }
2647
2653
 
@@ -2687,7 +2693,7 @@ var Channel = /*#__PURE__*/function () {
2687
2693
  }, _callee25, this);
2688
2694
  }));
2689
2695
 
2690
- function stopTyping(_x25) {
2696
+ function stopTyping(_x26) {
2691
2697
  return _stopTyping.apply(this, arguments);
2692
2698
  }
2693
2699
 
@@ -2810,7 +2816,7 @@ var Channel = /*#__PURE__*/function () {
2810
2816
  }, _callee27, this);
2811
2817
  }));
2812
2818
 
2813
- function markUnread(_x26) {
2819
+ function markUnread(_x27) {
2814
2820
  return _markUnread.apply(this, arguments);
2815
2821
  }
2816
2822
 
@@ -2889,7 +2895,7 @@ var Channel = /*#__PURE__*/function () {
2889
2895
  }, _callee28, this);
2890
2896
  }));
2891
2897
 
2892
- function watch(_x27) {
2898
+ function watch(_x28) {
2893
2899
  return _watch.apply(this, arguments);
2894
2900
  }
2895
2901
 
@@ -2976,7 +2982,7 @@ var Channel = /*#__PURE__*/function () {
2976
2982
  }, _callee30, this);
2977
2983
  }));
2978
2984
 
2979
- function getReplies(_x28, _x29) {
2985
+ function getReplies(_x29, _x30) {
2980
2986
  return _getReplies.apply(this, arguments);
2981
2987
  }
2982
2988
 
@@ -3020,7 +3026,7 @@ var Channel = /*#__PURE__*/function () {
3020
3026
  }, _callee31, this);
3021
3027
  }));
3022
3028
 
3023
- function getPinnedMessages(_x30) {
3029
+ function getPinnedMessages(_x31) {
3024
3030
  return _getPinnedMessages.apply(this, arguments);
3025
3031
  }
3026
3032
 
@@ -3143,6 +3149,7 @@ var Channel = /*#__PURE__*/function () {
3143
3149
  * create - Creates a new channel
3144
3150
  *
3145
3151
  * @return {Promise<QueryChannelAPIResponse<StreamChatGenerics>>} The Server Response
3152
+ *
3146
3153
  */
3147
3154
 
3148
3155
  }, {
@@ -3236,7 +3243,7 @@ var Channel = /*#__PURE__*/function () {
3236
3243
  }, _callee32, this);
3237
3244
  }));
3238
3245
 
3239
- function query(_x31) {
3246
+ function query(_x32) {
3240
3247
  return _query.apply(this, arguments);
3241
3248
  }
3242
3249
 
@@ -3277,7 +3284,7 @@ var Channel = /*#__PURE__*/function () {
3277
3284
  }, _callee33, this);
3278
3285
  }));
3279
3286
 
3280
- function banUser(_x32, _x33) {
3287
+ function banUser(_x33, _x34) {
3281
3288
  return _banUser.apply(this, arguments);
3282
3289
  }
3283
3290
 
@@ -3408,7 +3415,7 @@ var Channel = /*#__PURE__*/function () {
3408
3415
  }, _callee36, this);
3409
3416
  }));
3410
3417
 
3411
- function unbanUser(_x34) {
3418
+ function unbanUser(_x35) {
3412
3419
  return _unbanUser.apply(this, arguments);
3413
3420
  }
3414
3421
 
@@ -3449,7 +3456,7 @@ var Channel = /*#__PURE__*/function () {
3449
3456
  }, _callee37, this);
3450
3457
  }));
3451
3458
 
3452
- function shadowBan(_x35, _x36) {
3459
+ function shadowBan(_x36, _x37) {
3453
3460
  return _shadowBan.apply(this, arguments);
3454
3461
  }
3455
3462
 
@@ -3489,7 +3496,7 @@ var Channel = /*#__PURE__*/function () {
3489
3496
  }, _callee38, this);
3490
3497
  }));
3491
3498
 
3492
- function removeShadowBan(_x37) {
3499
+ function removeShadowBan(_x38) {
3493
3500
  return _removeShadowBan.apply(this, arguments);
3494
3501
  }
3495
3502
 
@@ -3524,7 +3531,7 @@ var Channel = /*#__PURE__*/function () {
3524
3531
  }, _callee39, this);
3525
3532
  }));
3526
3533
 
3527
- function createCall(_x38) {
3534
+ function createCall(_x39) {
3528
3535
  return _createCall.apply(this, arguments);
3529
3536
  }
3530
3537
 
@@ -6018,7 +6025,8 @@ var ErrorFromResponse = /*#__PURE__*/function (_Error) {
6018
6025
  return ErrorFromResponse;
6019
6026
  }( /*#__PURE__*/_wrapNativeSuper(Error));
6020
6027
 
6021
- var _excluded = ["created_at", "updated_at", "last_active", "online"];
6028
+ var _excluded = ["created_at", "updated_at", "last_active", "online"],
6029
+ _excluded2 = ["params", "headers"];
6022
6030
 
6023
6031
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(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 = it.call(o); }, 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; } } }; }
6024
6032
 
@@ -10016,7 +10024,7 @@ var StreamChat = /*#__PURE__*/function () {
10016
10024
  }, {
10017
10025
  key: "getUserAgent",
10018
10026
  value: function getUserAgent() {
10019
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.4.0");
10027
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.5.0");
10020
10028
  }
10021
10029
  }, {
10022
10030
  key: "setUserAgent",
@@ -10056,19 +10064,24 @@ var StreamChat = /*#__PURE__*/function () {
10056
10064
  });
10057
10065
  }
10058
10066
 
10067
+ var _ref9 = this.options.axiosRequestConfig || {},
10068
+ axiosRequestConfigParams = _ref9.params,
10069
+ axiosRequestConfigHeaders = _ref9.headers,
10070
+ axiosRequestConfigRest = _objectWithoutProperties(_ref9, _excluded2);
10071
+
10059
10072
  return _objectSpread(_objectSpread(_objectSpread({
10060
- params: _objectSpread({
10073
+ params: _objectSpread(_objectSpread({
10061
10074
  user_id: this.userID,
10062
10075
  connection_id: this._getConnectionID(),
10063
10076
  api_key: this.key
10064
- }, options.params),
10065
- headers: _objectSpread(_objectSpread({}, authorization), {}, {
10077
+ }, options.params), axiosRequestConfigParams || {}),
10078
+ headers: _objectSpread(_objectSpread(_objectSpread({}, authorization), {}, {
10066
10079
  'stream-auth-type': this.getAuthType(),
10067
10080
  'X-Stream-Client': this.getUserAgent()
10068
- }, options.headers)
10081
+ }, options.headers), axiosRequestConfigHeaders || {})
10069
10082
  }, signal ? {
10070
10083
  signal: signal
10071
- } : {}), options.config), this.options.axiosRequestConfig);
10084
+ } : {}), options.config), axiosRequestConfigRest || {});
10072
10085
  }
10073
10086
  }, {
10074
10087
  key: "_getToken",
@@ -11224,13 +11237,13 @@ var StreamChat = /*#__PURE__*/function () {
11224
11237
  }, {
11225
11238
  key: "deletePushProvider",
11226
11239
  value: function () {
11227
- var _deletePushProvider = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee79(_ref9) {
11240
+ var _deletePushProvider = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee79(_ref10) {
11228
11241
  var type, name;
11229
11242
  return _regeneratorRuntime.wrap(function _callee79$(_context79) {
11230
11243
  while (1) {
11231
11244
  switch (_context79.prev = _context79.next) {
11232
11245
  case 0:
11233
- type = _ref9.type, name = _ref9.name;
11246
+ type = _ref10.type, name = _ref10.name;
11234
11247
  _context79.next = 3;
11235
11248
  return this.delete(this.baseURL + "/push_providers/".concat(type, "/").concat(name));
11236
11249