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.
@@ -6837,6 +6837,8 @@ var StreamChat = /*#__PURE__*/function () {
6837
6837
 
6838
6838
  _defineProperty(this, "updateUser", this.upsertUser);
6839
6839
 
6840
+ _defineProperty(this, "_unblockMessage", this.unblockMessage);
6841
+
6840
6842
  _defineProperty(this, "markAllRead", this.markChannelsRead);
6841
6843
 
6842
6844
  _defineProperty(this, "_isUsingServerAuth", function () {
@@ -8453,6 +8455,8 @@ var StreamChat = /*#__PURE__*/function () {
8453
8455
  }, {
8454
8456
  key: "channel",
8455
8457
  value: function channel(channelType, channelIDOrCustom) {
8458
+ var _custom$members;
8459
+
8456
8460
  var custom = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
8457
8461
 
8458
8462
  if (!this.userID && !this._isUsingServerAuth()) {
@@ -8461,18 +8465,23 @@ var StreamChat = /*#__PURE__*/function () {
8461
8465
 
8462
8466
  if (~channelType.indexOf(':')) {
8463
8467
  throw Error("Invalid channel group ".concat(channelType, ", can't contain the : character"));
8468
+ } // support channel("messaging", {options})
8469
+
8470
+
8471
+ if (channelIDOrCustom && _typeof(channelIDOrCustom) === 'object') {
8472
+ return this.getChannelByMembers(channelType, channelIDOrCustom);
8473
+ } // // support channel("messaging", undefined, {options})
8474
+
8475
+
8476
+ if (!channelIDOrCustom && _typeof(custom) === 'object' && (_custom$members = custom.members) !== null && _custom$members !== void 0 && _custom$members.length) {
8477
+ return this.getChannelByMembers(channelType, custom);
8464
8478
  } // support channel("messaging", null, {options})
8465
8479
  // support channel("messaging", undefined, {options})
8466
8480
  // support channel("messaging", "", {options})
8467
8481
 
8468
8482
 
8469
- if (channelIDOrCustom == null || channelIDOrCustom === '') {
8483
+ if (!channelIDOrCustom) {
8470
8484
  return new Channel(this, channelType, undefined, custom);
8471
- } // support channel("messaging", {options})
8472
-
8473
-
8474
- if (_typeof(channelIDOrCustom) === 'object') {
8475
- return this.getChannelByMembers(channelType, channelIDOrCustom);
8476
8485
  }
8477
8486
 
8478
8487
  return this.getChannelById(channelType, channelIDOrCustom, custom);
@@ -9571,22 +9580,18 @@ var StreamChat = /*#__PURE__*/function () {
9571
9580
  return _reviewFlagReport;
9572
9581
  }()
9573
9582
  /**
9574
- * _unblockMessage - unblocks message blocked by automod
9583
+ * unblockMessage - unblocks message blocked by automod
9575
9584
  *
9576
- * Note: Do not use this.
9577
- * It is present for internal usage only.
9578
- * This function can, and will, break and/or be removed at any point in time.
9579
9585
  *
9580
- * @private
9581
9586
  * @param {string} targetMessageID
9582
9587
  * @param {string} [options.user_id] currentUserID, only used with serverside auth
9583
9588
  * @returns {Promise<APIResponse>}
9584
9589
  */
9585
9590
 
9586
9591
  }, {
9587
- key: "_unblockMessage",
9592
+ key: "unblockMessage",
9588
9593
  value: function () {
9589
- var _unblockMessage2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49(targetMessageID) {
9594
+ var _unblockMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49(targetMessageID) {
9590
9595
  var options,
9591
9596
  _args49 = arguments;
9592
9597
  return _regeneratorRuntime.wrap(function _callee49$(_context49) {
@@ -9610,20 +9615,12 @@ var StreamChat = /*#__PURE__*/function () {
9610
9615
  }, _callee49, this);
9611
9616
  }));
9612
9617
 
9613
- function _unblockMessage(_x63) {
9614
- return _unblockMessage2.apply(this, arguments);
9618
+ function unblockMessage(_x63) {
9619
+ return _unblockMessage.apply(this, arguments);
9615
9620
  }
9616
9621
 
9617
- return _unblockMessage;
9618
- }()
9619
- /**
9620
- * @deprecated use markChannelsRead instead
9621
- *
9622
- * markAllRead - marks all channels for this user as read
9623
- * @param {MarkAllReadOptions<StreamChatGenerics>} [data]
9624
- *
9625
- * @return {Promise<APIResponse>}
9626
- */
9622
+ return unblockMessage;
9623
+ }() // alias for backwards compatibility
9627
9624
 
9628
9625
  }, {
9629
9626
  key: "markChannelsRead",
@@ -10046,7 +10043,7 @@ var StreamChat = /*#__PURE__*/function () {
10046
10043
  }, {
10047
10044
  key: "getUserAgent",
10048
10045
  value: function getUserAgent() {
10049
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.11.0");
10046
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.12.0");
10050
10047
  }
10051
10048
  }, {
10052
10049
  key: "setUserAgent",