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/browser.js CHANGED
@@ -6862,6 +6862,8 @@ var StreamChat = /*#__PURE__*/function () {
6862
6862
 
6863
6863
  _defineProperty__default['default'](this, "updateUser", this.upsertUser);
6864
6864
 
6865
+ _defineProperty__default['default'](this, "_unblockMessage", this.unblockMessage);
6866
+
6865
6867
  _defineProperty__default['default'](this, "markAllRead", this.markChannelsRead);
6866
6868
 
6867
6869
  _defineProperty__default['default'](this, "_isUsingServerAuth", function () {
@@ -8478,6 +8480,8 @@ var StreamChat = /*#__PURE__*/function () {
8478
8480
  }, {
8479
8481
  key: "channel",
8480
8482
  value: function channel(channelType, channelIDOrCustom) {
8483
+ var _custom$members;
8484
+
8481
8485
  var custom = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
8482
8486
 
8483
8487
  if (!this.userID && !this._isUsingServerAuth()) {
@@ -8486,18 +8490,23 @@ var StreamChat = /*#__PURE__*/function () {
8486
8490
 
8487
8491
  if (~channelType.indexOf(':')) {
8488
8492
  throw Error("Invalid channel group ".concat(channelType, ", can't contain the : character"));
8493
+ } // support channel("messaging", {options})
8494
+
8495
+
8496
+ if (channelIDOrCustom && _typeof__default['default'](channelIDOrCustom) === 'object') {
8497
+ return this.getChannelByMembers(channelType, channelIDOrCustom);
8498
+ } // // support channel("messaging", undefined, {options})
8499
+
8500
+
8501
+ if (!channelIDOrCustom && _typeof__default['default'](custom) === 'object' && (_custom$members = custom.members) !== null && _custom$members !== void 0 && _custom$members.length) {
8502
+ return this.getChannelByMembers(channelType, custom);
8489
8503
  } // support channel("messaging", null, {options})
8490
8504
  // support channel("messaging", undefined, {options})
8491
8505
  // support channel("messaging", "", {options})
8492
8506
 
8493
8507
 
8494
- if (channelIDOrCustom == null || channelIDOrCustom === '') {
8508
+ if (!channelIDOrCustom) {
8495
8509
  return new Channel(this, channelType, undefined, custom);
8496
- } // support channel("messaging", {options})
8497
-
8498
-
8499
- if (_typeof__default['default'](channelIDOrCustom) === 'object') {
8500
- return this.getChannelByMembers(channelType, channelIDOrCustom);
8501
8510
  }
8502
8511
 
8503
8512
  return this.getChannelById(channelType, channelIDOrCustom, custom);
@@ -9596,22 +9605,18 @@ var StreamChat = /*#__PURE__*/function () {
9596
9605
  return _reviewFlagReport;
9597
9606
  }()
9598
9607
  /**
9599
- * _unblockMessage - unblocks message blocked by automod
9608
+ * unblockMessage - unblocks message blocked by automod
9600
9609
  *
9601
- * Note: Do not use this.
9602
- * It is present for internal usage only.
9603
- * This function can, and will, break and/or be removed at any point in time.
9604
9610
  *
9605
- * @private
9606
9611
  * @param {string} targetMessageID
9607
9612
  * @param {string} [options.user_id] currentUserID, only used with serverside auth
9608
9613
  * @returns {Promise<APIResponse>}
9609
9614
  */
9610
9615
 
9611
9616
  }, {
9612
- key: "_unblockMessage",
9617
+ key: "unblockMessage",
9613
9618
  value: function () {
9614
- var _unblockMessage2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee49(targetMessageID) {
9619
+ var _unblockMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee49(targetMessageID) {
9615
9620
  var options,
9616
9621
  _args49 = arguments;
9617
9622
  return _regeneratorRuntime__default['default'].wrap(function _callee49$(_context49) {
@@ -9635,20 +9640,12 @@ var StreamChat = /*#__PURE__*/function () {
9635
9640
  }, _callee49, this);
9636
9641
  }));
9637
9642
 
9638
- function _unblockMessage(_x63) {
9639
- return _unblockMessage2.apply(this, arguments);
9643
+ function unblockMessage(_x63) {
9644
+ return _unblockMessage.apply(this, arguments);
9640
9645
  }
9641
9646
 
9642
- return _unblockMessage;
9643
- }()
9644
- /**
9645
- * @deprecated use markChannelsRead instead
9646
- *
9647
- * markAllRead - marks all channels for this user as read
9648
- * @param {MarkAllReadOptions<StreamChatGenerics>} [data]
9649
- *
9650
- * @return {Promise<APIResponse>}
9651
- */
9647
+ return unblockMessage;
9648
+ }() // alias for backwards compatibility
9652
9649
 
9653
9650
  }, {
9654
9651
  key: "markChannelsRead",
@@ -10071,7 +10068,7 @@ var StreamChat = /*#__PURE__*/function () {
10071
10068
  }, {
10072
10069
  key: "getUserAgent",
10073
10070
  value: function getUserAgent() {
10074
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.11.0");
10071
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.12.0");
10075
10072
  }
10076
10073
  }, {
10077
10074
  key: "setUserAgent",