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