stream-chat 8.47.1 → 8.49.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
@@ -8576,21 +8576,18 @@ var Moderation = /*#__PURE__*/function () {
8576
8576
  }, {
8577
8577
  key: "upsertConfig",
8578
8578
  value: function () {
8579
- var _upsertConfig = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee8() {
8580
- var config,
8581
- _args8 = arguments;
8579
+ var _upsertConfig = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee8(config) {
8582
8580
  return _regeneratorRuntime__default['default'].wrap(function _callee8$(_context8) {
8583
8581
  while (1) {
8584
8582
  switch (_context8.prev = _context8.next) {
8585
8583
  case 0:
8586
- config = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {};
8587
- _context8.next = 3;
8584
+ _context8.next = 2;
8588
8585
  return this.client.post(this.client.baseURL + '/api/v2/moderation/config', config);
8589
8586
 
8590
- case 3:
8587
+ case 2:
8591
8588
  return _context8.abrupt("return", _context8.sent);
8592
8589
 
8593
- case 4:
8590
+ case 3:
8594
8591
  case "end":
8595
8592
  return _context8.stop();
8596
8593
  }
@@ -8598,7 +8595,7 @@ var Moderation = /*#__PURE__*/function () {
8598
8595
  }, _callee8, this);
8599
8596
  }));
8600
8597
 
8601
- function upsertConfig() {
8598
+ function upsertConfig(_x13) {
8602
8599
  return _upsertConfig.apply(this, arguments);
8603
8600
  }
8604
8601
 
@@ -8612,13 +8609,13 @@ var Moderation = /*#__PURE__*/function () {
8612
8609
  }, {
8613
8610
  key: "getConfig",
8614
8611
  value: function () {
8615
- var _getConfig = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee9(key) {
8612
+ var _getConfig = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee9(key, data) {
8616
8613
  return _regeneratorRuntime__default['default'].wrap(function _callee9$(_context9) {
8617
8614
  while (1) {
8618
8615
  switch (_context9.prev = _context9.next) {
8619
8616
  case 0:
8620
8617
  _context9.next = 2;
8621
- return this.client.get(this.client.baseURL + '/api/v2/moderation/config/' + key);
8618
+ return this.client.get(this.client.baseURL + '/api/v2/moderation/config/' + key, data);
8622
8619
 
8623
8620
  case 2:
8624
8621
  return _context9.abrupt("return", _context9.sent);
@@ -8631,7 +8628,7 @@ var Moderation = /*#__PURE__*/function () {
8631
8628
  }, _callee9, this);
8632
8629
  }));
8633
8630
 
8634
- function getConfig(_x13) {
8631
+ function getConfig(_x14, _x15) {
8635
8632
  return _getConfig.apply(this, arguments);
8636
8633
  }
8637
8634
 
@@ -8640,13 +8637,13 @@ var Moderation = /*#__PURE__*/function () {
8640
8637
  }, {
8641
8638
  key: "deleteConfig",
8642
8639
  value: function () {
8643
- var _deleteConfig = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee10(key) {
8640
+ var _deleteConfig = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee10(key, data) {
8644
8641
  return _regeneratorRuntime__default['default'].wrap(function _callee10$(_context10) {
8645
8642
  while (1) {
8646
8643
  switch (_context10.prev = _context10.next) {
8647
8644
  case 0:
8648
8645
  _context10.next = 2;
8649
- return this.client.delete(this.client.baseURL + '/api/v2/moderation/config/' + key);
8646
+ return this.client.delete(this.client.baseURL + '/api/v2/moderation/config/' + key, data);
8650
8647
 
8651
8648
  case 2:
8652
8649
  return _context10.abrupt("return", _context10.sent);
@@ -8659,7 +8656,7 @@ var Moderation = /*#__PURE__*/function () {
8659
8656
  }, _callee10, this);
8660
8657
  }));
8661
8658
 
8662
- function deleteConfig(_x14) {
8659
+ function deleteConfig(_x16, _x17) {
8663
8660
  return _deleteConfig.apply(this, arguments);
8664
8661
  }
8665
8662
 
@@ -8700,7 +8697,7 @@ var Moderation = /*#__PURE__*/function () {
8700
8697
  }, _callee11, this);
8701
8698
  }));
8702
8699
 
8703
- function queryConfigs(_x15, _x16) {
8700
+ function queryConfigs(_x18, _x19) {
8704
8701
  return _queryConfigs.apply(this, arguments);
8705
8702
  }
8706
8703
 
@@ -8734,7 +8731,7 @@ var Moderation = /*#__PURE__*/function () {
8734
8731
  }, _callee12, this);
8735
8732
  }));
8736
8733
 
8737
- function submitAction(_x17, _x18) {
8734
+ function submitAction(_x20, _x21) {
8738
8735
  return _submitAction.apply(this, arguments);
8739
8736
  }
8740
8737
 
@@ -8783,12 +8780,94 @@ var Moderation = /*#__PURE__*/function () {
8783
8780
  }, _callee13, this);
8784
8781
  }));
8785
8782
 
8786
- function check(_x19, _x20, _x21, _x22, _x23, _x24) {
8783
+ function check(_x22, _x23, _x24, _x25, _x26, _x27) {
8787
8784
  return _check.apply(this, arguments);
8788
8785
  }
8789
8786
 
8790
8787
  return check;
8791
8788
  }()
8789
+ /**
8790
+ *
8791
+ * @param {string} entityType string Type of entity to be checked E.g., stream:user, stream:chat:v1:message, or any custom string
8792
+ * @param {string} entityID string ID of the entity to be checked. This is mainly for tracking purposes
8793
+ * @param {string} entityCreatorID string ID of the entity creator
8794
+ * @param {object} moderationPayload object Content to be checked for moderation. E.g., { texts: ['text1', 'text2'], images: ['image1', 'image2']}
8795
+ * @param {Array} moderationPayload.texts array Array of texts to be checked for moderation
8796
+ * @param {Array} moderationPayload.images array Array of images to be checked for moderation
8797
+ * @param {Array} moderationPayload.videos array Array of videos to be checked for moderation
8798
+ * @param {Array<CustomCheckFlag>} flags Array of CustomCheckFlag to be passed to flag the entity
8799
+ * @returns
8800
+ */
8801
+
8802
+ }, {
8803
+ key: "addCustomFlags",
8804
+ value: function () {
8805
+ var _addCustomFlags = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee14(entityType, entityID, entityCreatorID, moderationPayload, flags) {
8806
+ return _regeneratorRuntime__default['default'].wrap(function _callee14$(_context14) {
8807
+ while (1) {
8808
+ switch (_context14.prev = _context14.next) {
8809
+ case 0:
8810
+ _context14.next = 2;
8811
+ return this.client.post(this.client.baseURL + "/api/v2/moderation/custom_check", {
8812
+ entity_type: entityType,
8813
+ entity_id: entityID,
8814
+ entity_creator_id: entityCreatorID,
8815
+ moderation_payload: moderationPayload,
8816
+ flags: flags
8817
+ });
8818
+
8819
+ case 2:
8820
+ return _context14.abrupt("return", _context14.sent);
8821
+
8822
+ case 3:
8823
+ case "end":
8824
+ return _context14.stop();
8825
+ }
8826
+ }
8827
+ }, _callee14, this);
8828
+ }));
8829
+
8830
+ function addCustomFlags(_x28, _x29, _x30, _x31, _x32) {
8831
+ return _addCustomFlags.apply(this, arguments);
8832
+ }
8833
+
8834
+ return addCustomFlags;
8835
+ }()
8836
+ /**
8837
+ * Add custom flags to a message
8838
+ * @param {string} messageID Message ID to be flagged
8839
+ * @param {Array<CustomCheckFlag>} flags Array of CustomCheckFlag to be passed to flag the message
8840
+ * @returns
8841
+ */
8842
+
8843
+ }, {
8844
+ key: "addCustomMessageFlags",
8845
+ value: function () {
8846
+ var _addCustomMessageFlags = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee15(messageID, flags) {
8847
+ return _regeneratorRuntime__default['default'].wrap(function _callee15$(_context15) {
8848
+ while (1) {
8849
+ switch (_context15.prev = _context15.next) {
8850
+ case 0:
8851
+ _context15.next = 2;
8852
+ return this.addCustomFlags(MODERATION_ENTITY_TYPES.message, messageID, '', {}, flags);
8853
+
8854
+ case 2:
8855
+ return _context15.abrupt("return", _context15.sent);
8856
+
8857
+ case 3:
8858
+ case "end":
8859
+ return _context15.stop();
8860
+ }
8861
+ }
8862
+ }, _callee15, this);
8863
+ }));
8864
+
8865
+ function addCustomMessageFlags(_x33, _x34) {
8866
+ return _addCustomMessageFlags.apply(this, arguments);
8867
+ }
8868
+
8869
+ return addCustomMessageFlags;
8870
+ }()
8792
8871
  }]);
8793
8872
 
8794
8873
  return Moderation;
@@ -14776,7 +14855,7 @@ var StreamChat = /*#__PURE__*/function () {
14776
14855
  }, {
14777
14856
  key: "getUserAgent",
14778
14857
  value: function getUserAgent() {
14779
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.47.1");
14858
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.49.0");
14780
14859
  }
14781
14860
  }, {
14782
14861
  key: "setUserAgent",