stream-chat 5.3.0 → 5.4.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/browser.js CHANGED
@@ -1698,6 +1698,8 @@ var Channel = /*#__PURE__*/function () {
1698
1698
  /**
1699
1699
  * delete - Delete the channel. Messages are permanently removed.
1700
1700
  *
1701
+ * @param {boolean} [options.hard_delete] Defines if the channel is hard deleted or not
1702
+ *
1701
1703
  * @return {Promise<DeleteChannelAPIResponse<ChannelType, CommandType, UserType>>} The server response
1702
1704
  */
1703
1705
 
@@ -1705,17 +1707,20 @@ var Channel = /*#__PURE__*/function () {
1705
1707
  key: "delete",
1706
1708
  value: function () {
1707
1709
  var _delete2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee11() {
1710
+ var options,
1711
+ _args11 = arguments;
1708
1712
  return _regeneratorRuntime__default['default'].wrap(function _callee11$(_context11) {
1709
1713
  while (1) {
1710
1714
  switch (_context11.prev = _context11.next) {
1711
1715
  case 0:
1712
- _context11.next = 2;
1713
- return this.getClient().delete(this._channelURL(), {});
1716
+ options = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : {};
1717
+ _context11.next = 3;
1718
+ return this.getClient().delete(this._channelURL(), _objectSpread$5({}, options));
1714
1719
 
1715
- case 2:
1720
+ case 3:
1716
1721
  return _context11.abrupt("return", _context11.sent);
1717
1722
 
1718
- case 3:
1723
+ case 4:
1719
1724
  case "end":
1720
1725
  return _context11.stop();
1721
1726
  }
@@ -3826,6 +3831,12 @@ var StableWSConnection = /*#__PURE__*/function () {
3826
3831
 
3827
3832
  _defineProperty__default['default'](this, "onmessage", function (wsID, event) {
3828
3833
  if (_this.wsID !== wsID) return;
3834
+
3835
+ _this._log('onmessage() - onmessage callback', {
3836
+ event: event,
3837
+ wsID: wsID
3838
+ });
3839
+
3829
3840
  var data = typeof event.data === 'string' ? JSON.parse(event.data) : null; // we wait till the first message before we consider the connection open..
3830
3841
  // the reason for this is that auth errors and similar errors trigger a ws.onopen and immediately
3831
3842
  // after that a ws.onclose..
@@ -3850,11 +3861,6 @@ var StableWSConnection = /*#__PURE__*/function () {
3850
3861
 
3851
3862
  _this.lastEvent = new Date();
3852
3863
 
3853
- _this._log('onmessage() - onmessage callback', {
3854
- event: event,
3855
- wsID: wsID
3856
- });
3857
-
3858
3864
  if (data && data.type === 'health.check') {
3859
3865
  _this.scheduleNextPing();
3860
3866
  }
@@ -4384,27 +4390,36 @@ var StableWSConnection = /*#__PURE__*/function () {
4384
4390
  this.requestID = randomId();
4385
4391
  this.client.insightMetrics.connectionStartTimestamp = new Date().getTime();
4386
4392
  _context5.prev = 5;
4387
- _context5.next = 8;
4393
+
4394
+ this._log("_connect() - waiting for token");
4395
+
4396
+ _context5.next = 9;
4388
4397
  return this.client.tokenManager.tokenReady();
4389
4398
 
4390
- case 8:
4399
+ case 9:
4391
4400
  this._setupConnectionPromise();
4392
4401
 
4393
4402
  wsURL = this._buildUrl();
4403
+
4404
+ this._log("_connect() - Connecting to ".concat(wsURL), {
4405
+ wsURL: wsURL,
4406
+ requestID: this.requestID
4407
+ });
4408
+
4394
4409
  this.ws = new WebSocket__default['default'](wsURL);
4395
4410
  this.ws.onopen = this.onopen.bind(this, this.wsID);
4396
4411
  this.ws.onclose = this.onclose.bind(this, this.wsID);
4397
4412
  this.ws.onerror = this.onerror.bind(this, this.wsID);
4398
4413
  this.ws.onmessage = this.onmessage.bind(this, this.wsID);
4399
- _context5.next = 17;
4414
+ _context5.next = 19;
4400
4415
  return this.connectionOpen;
4401
4416
 
4402
- case 17:
4417
+ case 19:
4403
4418
  response = _context5.sent;
4404
4419
  this.isConnecting = false;
4405
4420
 
4406
4421
  if (!response) {
4407
- _context5.next = 23;
4422
+ _context5.next = 25;
4408
4423
  break;
4409
4424
  }
4410
4425
 
@@ -4417,12 +4432,12 @@ var StableWSConnection = /*#__PURE__*/function () {
4417
4432
 
4418
4433
  return _context5.abrupt("return", response);
4419
4434
 
4420
- case 23:
4421
- _context5.next = 30;
4435
+ case 25:
4436
+ _context5.next = 32;
4422
4437
  break;
4423
4438
 
4424
- case 25:
4425
- _context5.prev = 25;
4439
+ case 27:
4440
+ _context5.prev = 27;
4426
4441
  _context5.t0 = _context5["catch"](5);
4427
4442
  this.isConnecting = false;
4428
4443
 
@@ -4435,12 +4450,12 @@ var StableWSConnection = /*#__PURE__*/function () {
4435
4450
 
4436
4451
  throw _context5.t0;
4437
4452
 
4438
- case 30:
4453
+ case 32:
4439
4454
  case "end":
4440
4455
  return _context5.stop();
4441
4456
  }
4442
4457
  }
4443
- }, _callee5, this, [[5, 25]]);
4458
+ }, _callee5, this, [[5, 27]]);
4444
4459
  }));
4445
4460
 
4446
4461
  function _connect() {
@@ -9126,7 +9141,7 @@ var StreamChat = /*#__PURE__*/function () {
9126
9141
  }, {
9127
9142
  key: "getUserAgent",
9128
9143
  value: function getUserAgent() {
9129
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "5.3.0");
9144
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "5.4.0");
9130
9145
  }
9131
9146
  }, {
9132
9147
  key: "setUserAgent",