stream-chat 8.11.0 → 8.12.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
@@ -6868,6 +6868,8 @@ var StreamChat = /*#__PURE__*/function () {
6868
6868
 
6869
6869
  _defineProperty__default['default'](this, "updateUser", this.upsertUser);
6870
6870
 
6871
+ _defineProperty__default['default'](this, "_unblockMessage", this.unblockMessage);
6872
+
6871
6873
  _defineProperty__default['default'](this, "markAllRead", this.markChannelsRead);
6872
6874
 
6873
6875
  _defineProperty__default['default'](this, "_isUsingServerAuth", function () {
@@ -8484,6 +8486,8 @@ var StreamChat = /*#__PURE__*/function () {
8484
8486
  }, {
8485
8487
  key: "channel",
8486
8488
  value: function channel(channelType, channelIDOrCustom) {
8489
+ var _custom$members;
8490
+
8487
8491
  var custom = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
8488
8492
 
8489
8493
  if (!this.userID && !this._isUsingServerAuth()) {
@@ -8492,18 +8496,23 @@ var StreamChat = /*#__PURE__*/function () {
8492
8496
 
8493
8497
  if (~channelType.indexOf(':')) {
8494
8498
  throw Error("Invalid channel group ".concat(channelType, ", can't contain the : character"));
8499
+ } // support channel("messaging", {options})
8500
+
8501
+
8502
+ if (channelIDOrCustom && _typeof__default['default'](channelIDOrCustom) === 'object') {
8503
+ return this.getChannelByMembers(channelType, channelIDOrCustom);
8504
+ } // // support channel("messaging", undefined, {options})
8505
+
8506
+
8507
+ if (!channelIDOrCustom && _typeof__default['default'](custom) === 'object' && (_custom$members = custom.members) !== null && _custom$members !== void 0 && _custom$members.length) {
8508
+ return this.getChannelByMembers(channelType, custom);
8495
8509
  } // support channel("messaging", null, {options})
8496
8510
  // support channel("messaging", undefined, {options})
8497
8511
  // support channel("messaging", "", {options})
8498
8512
 
8499
8513
 
8500
- if (channelIDOrCustom == null || channelIDOrCustom === '') {
8514
+ if (!channelIDOrCustom) {
8501
8515
  return new Channel(this, channelType, undefined, custom);
8502
- } // support channel("messaging", {options})
8503
-
8504
-
8505
- if (_typeof__default['default'](channelIDOrCustom) === 'object') {
8506
- return this.getChannelByMembers(channelType, channelIDOrCustom);
8507
8516
  }
8508
8517
 
8509
8518
  return this.getChannelById(channelType, channelIDOrCustom, custom);
@@ -9602,22 +9611,18 @@ var StreamChat = /*#__PURE__*/function () {
9602
9611
  return _reviewFlagReport;
9603
9612
  }()
9604
9613
  /**
9605
- * _unblockMessage - unblocks message blocked by automod
9614
+ * unblockMessage - unblocks message blocked by automod
9606
9615
  *
9607
- * Note: Do not use this.
9608
- * It is present for internal usage only.
9609
- * This function can, and will, break and/or be removed at any point in time.
9610
9616
  *
9611
- * @private
9612
9617
  * @param {string} targetMessageID
9613
9618
  * @param {string} [options.user_id] currentUserID, only used with serverside auth
9614
9619
  * @returns {Promise<APIResponse>}
9615
9620
  */
9616
9621
 
9617
9622
  }, {
9618
- key: "_unblockMessage",
9623
+ key: "unblockMessage",
9619
9624
  value: function () {
9620
- var _unblockMessage2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee49(targetMessageID) {
9625
+ var _unblockMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee49(targetMessageID) {
9621
9626
  var options,
9622
9627
  _args49 = arguments;
9623
9628
  return _regeneratorRuntime__default['default'].wrap(function _callee49$(_context49) {
@@ -9641,20 +9646,12 @@ var StreamChat = /*#__PURE__*/function () {
9641
9646
  }, _callee49, this);
9642
9647
  }));
9643
9648
 
9644
- function _unblockMessage(_x63) {
9645
- return _unblockMessage2.apply(this, arguments);
9649
+ function unblockMessage(_x63) {
9650
+ return _unblockMessage.apply(this, arguments);
9646
9651
  }
9647
9652
 
9648
- return _unblockMessage;
9649
- }()
9650
- /**
9651
- * @deprecated use markChannelsRead instead
9652
- *
9653
- * markAllRead - marks all channels for this user as read
9654
- * @param {MarkAllReadOptions<StreamChatGenerics>} [data]
9655
- *
9656
- * @return {Promise<APIResponse>}
9657
- */
9653
+ return unblockMessage;
9654
+ }() // alias for backwards compatibility
9658
9655
 
9659
9656
  }, {
9660
9657
  key: "markChannelsRead",
@@ -10077,7 +10074,7 @@ var StreamChat = /*#__PURE__*/function () {
10077
10074
  }, {
10078
10075
  key: "getUserAgent",
10079
10076
  value: function getUserAgent() {
10080
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.11.0");
10077
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.12.0");
10081
10078
  }
10082
10079
  }, {
10083
10080
  key: "setUserAgent",