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.es.js +97 -18
- package/dist/browser.es.js.map +1 -1
- package/dist/browser.full-bundle.min.js +1 -1
- package/dist/browser.full-bundle.min.js.map +1 -1
- package/dist/browser.js +97 -18
- package/dist/browser.js.map +1 -1
- package/dist/index.es.js +97 -18
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +97 -18
- package/dist/index.js.map +1 -1
- package/dist/types/moderation.d.ts +41 -5
- package/dist/types/moderation.d.ts.map +1 -1
- package/dist/types/types.d.ts +122 -3
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/moderation.ts +54 -6
- package/src/types.ts +143 -3
package/dist/browser.es.js
CHANGED
|
@@ -8551,21 +8551,18 @@ var Moderation = /*#__PURE__*/function () {
|
|
|
8551
8551
|
}, {
|
|
8552
8552
|
key: "upsertConfig",
|
|
8553
8553
|
value: function () {
|
|
8554
|
-
var _upsertConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
|
|
8555
|
-
var config,
|
|
8556
|
-
_args8 = arguments;
|
|
8554
|
+
var _upsertConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(config) {
|
|
8557
8555
|
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
8558
8556
|
while (1) {
|
|
8559
8557
|
switch (_context8.prev = _context8.next) {
|
|
8560
8558
|
case 0:
|
|
8561
|
-
|
|
8562
|
-
_context8.next = 3;
|
|
8559
|
+
_context8.next = 2;
|
|
8563
8560
|
return this.client.post(this.client.baseURL + '/api/v2/moderation/config', config);
|
|
8564
8561
|
|
|
8565
|
-
case
|
|
8562
|
+
case 2:
|
|
8566
8563
|
return _context8.abrupt("return", _context8.sent);
|
|
8567
8564
|
|
|
8568
|
-
case
|
|
8565
|
+
case 3:
|
|
8569
8566
|
case "end":
|
|
8570
8567
|
return _context8.stop();
|
|
8571
8568
|
}
|
|
@@ -8573,7 +8570,7 @@ var Moderation = /*#__PURE__*/function () {
|
|
|
8573
8570
|
}, _callee8, this);
|
|
8574
8571
|
}));
|
|
8575
8572
|
|
|
8576
|
-
function upsertConfig() {
|
|
8573
|
+
function upsertConfig(_x13) {
|
|
8577
8574
|
return _upsertConfig.apply(this, arguments);
|
|
8578
8575
|
}
|
|
8579
8576
|
|
|
@@ -8587,13 +8584,13 @@ var Moderation = /*#__PURE__*/function () {
|
|
|
8587
8584
|
}, {
|
|
8588
8585
|
key: "getConfig",
|
|
8589
8586
|
value: function () {
|
|
8590
|
-
var _getConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(key) {
|
|
8587
|
+
var _getConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(key, data) {
|
|
8591
8588
|
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
8592
8589
|
while (1) {
|
|
8593
8590
|
switch (_context9.prev = _context9.next) {
|
|
8594
8591
|
case 0:
|
|
8595
8592
|
_context9.next = 2;
|
|
8596
|
-
return this.client.get(this.client.baseURL + '/api/v2/moderation/config/' + key);
|
|
8593
|
+
return this.client.get(this.client.baseURL + '/api/v2/moderation/config/' + key, data);
|
|
8597
8594
|
|
|
8598
8595
|
case 2:
|
|
8599
8596
|
return _context9.abrupt("return", _context9.sent);
|
|
@@ -8606,7 +8603,7 @@ var Moderation = /*#__PURE__*/function () {
|
|
|
8606
8603
|
}, _callee9, this);
|
|
8607
8604
|
}));
|
|
8608
8605
|
|
|
8609
|
-
function getConfig(
|
|
8606
|
+
function getConfig(_x14, _x15) {
|
|
8610
8607
|
return _getConfig.apply(this, arguments);
|
|
8611
8608
|
}
|
|
8612
8609
|
|
|
@@ -8615,13 +8612,13 @@ var Moderation = /*#__PURE__*/function () {
|
|
|
8615
8612
|
}, {
|
|
8616
8613
|
key: "deleteConfig",
|
|
8617
8614
|
value: function () {
|
|
8618
|
-
var _deleteConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(key) {
|
|
8615
|
+
var _deleteConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(key, data) {
|
|
8619
8616
|
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
8620
8617
|
while (1) {
|
|
8621
8618
|
switch (_context10.prev = _context10.next) {
|
|
8622
8619
|
case 0:
|
|
8623
8620
|
_context10.next = 2;
|
|
8624
|
-
return this.client.delete(this.client.baseURL + '/api/v2/moderation/config/' + key);
|
|
8621
|
+
return this.client.delete(this.client.baseURL + '/api/v2/moderation/config/' + key, data);
|
|
8625
8622
|
|
|
8626
8623
|
case 2:
|
|
8627
8624
|
return _context10.abrupt("return", _context10.sent);
|
|
@@ -8634,7 +8631,7 @@ var Moderation = /*#__PURE__*/function () {
|
|
|
8634
8631
|
}, _callee10, this);
|
|
8635
8632
|
}));
|
|
8636
8633
|
|
|
8637
|
-
function deleteConfig(
|
|
8634
|
+
function deleteConfig(_x16, _x17) {
|
|
8638
8635
|
return _deleteConfig.apply(this, arguments);
|
|
8639
8636
|
}
|
|
8640
8637
|
|
|
@@ -8675,7 +8672,7 @@ var Moderation = /*#__PURE__*/function () {
|
|
|
8675
8672
|
}, _callee11, this);
|
|
8676
8673
|
}));
|
|
8677
8674
|
|
|
8678
|
-
function queryConfigs(
|
|
8675
|
+
function queryConfigs(_x18, _x19) {
|
|
8679
8676
|
return _queryConfigs.apply(this, arguments);
|
|
8680
8677
|
}
|
|
8681
8678
|
|
|
@@ -8709,7 +8706,7 @@ var Moderation = /*#__PURE__*/function () {
|
|
|
8709
8706
|
}, _callee12, this);
|
|
8710
8707
|
}));
|
|
8711
8708
|
|
|
8712
|
-
function submitAction(
|
|
8709
|
+
function submitAction(_x20, _x21) {
|
|
8713
8710
|
return _submitAction.apply(this, arguments);
|
|
8714
8711
|
}
|
|
8715
8712
|
|
|
@@ -8758,12 +8755,94 @@ var Moderation = /*#__PURE__*/function () {
|
|
|
8758
8755
|
}, _callee13, this);
|
|
8759
8756
|
}));
|
|
8760
8757
|
|
|
8761
|
-
function check(
|
|
8758
|
+
function check(_x22, _x23, _x24, _x25, _x26, _x27) {
|
|
8762
8759
|
return _check.apply(this, arguments);
|
|
8763
8760
|
}
|
|
8764
8761
|
|
|
8765
8762
|
return check;
|
|
8766
8763
|
}()
|
|
8764
|
+
/**
|
|
8765
|
+
*
|
|
8766
|
+
* @param {string} entityType string Type of entity to be checked E.g., stream:user, stream:chat:v1:message, or any custom string
|
|
8767
|
+
* @param {string} entityID string ID of the entity to be checked. This is mainly for tracking purposes
|
|
8768
|
+
* @param {string} entityCreatorID string ID of the entity creator
|
|
8769
|
+
* @param {object} moderationPayload object Content to be checked for moderation. E.g., { texts: ['text1', 'text2'], images: ['image1', 'image2']}
|
|
8770
|
+
* @param {Array} moderationPayload.texts array Array of texts to be checked for moderation
|
|
8771
|
+
* @param {Array} moderationPayload.images array Array of images to be checked for moderation
|
|
8772
|
+
* @param {Array} moderationPayload.videos array Array of videos to be checked for moderation
|
|
8773
|
+
* @param {Array<CustomCheckFlag>} flags Array of CustomCheckFlag to be passed to flag the entity
|
|
8774
|
+
* @returns
|
|
8775
|
+
*/
|
|
8776
|
+
|
|
8777
|
+
}, {
|
|
8778
|
+
key: "addCustomFlags",
|
|
8779
|
+
value: function () {
|
|
8780
|
+
var _addCustomFlags = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(entityType, entityID, entityCreatorID, moderationPayload, flags) {
|
|
8781
|
+
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
8782
|
+
while (1) {
|
|
8783
|
+
switch (_context14.prev = _context14.next) {
|
|
8784
|
+
case 0:
|
|
8785
|
+
_context14.next = 2;
|
|
8786
|
+
return this.client.post(this.client.baseURL + "/api/v2/moderation/custom_check", {
|
|
8787
|
+
entity_type: entityType,
|
|
8788
|
+
entity_id: entityID,
|
|
8789
|
+
entity_creator_id: entityCreatorID,
|
|
8790
|
+
moderation_payload: moderationPayload,
|
|
8791
|
+
flags: flags
|
|
8792
|
+
});
|
|
8793
|
+
|
|
8794
|
+
case 2:
|
|
8795
|
+
return _context14.abrupt("return", _context14.sent);
|
|
8796
|
+
|
|
8797
|
+
case 3:
|
|
8798
|
+
case "end":
|
|
8799
|
+
return _context14.stop();
|
|
8800
|
+
}
|
|
8801
|
+
}
|
|
8802
|
+
}, _callee14, this);
|
|
8803
|
+
}));
|
|
8804
|
+
|
|
8805
|
+
function addCustomFlags(_x28, _x29, _x30, _x31, _x32) {
|
|
8806
|
+
return _addCustomFlags.apply(this, arguments);
|
|
8807
|
+
}
|
|
8808
|
+
|
|
8809
|
+
return addCustomFlags;
|
|
8810
|
+
}()
|
|
8811
|
+
/**
|
|
8812
|
+
* Add custom flags to a message
|
|
8813
|
+
* @param {string} messageID Message ID to be flagged
|
|
8814
|
+
* @param {Array<CustomCheckFlag>} flags Array of CustomCheckFlag to be passed to flag the message
|
|
8815
|
+
* @returns
|
|
8816
|
+
*/
|
|
8817
|
+
|
|
8818
|
+
}, {
|
|
8819
|
+
key: "addCustomMessageFlags",
|
|
8820
|
+
value: function () {
|
|
8821
|
+
var _addCustomMessageFlags = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(messageID, flags) {
|
|
8822
|
+
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
|
8823
|
+
while (1) {
|
|
8824
|
+
switch (_context15.prev = _context15.next) {
|
|
8825
|
+
case 0:
|
|
8826
|
+
_context15.next = 2;
|
|
8827
|
+
return this.addCustomFlags(MODERATION_ENTITY_TYPES.message, messageID, '', {}, flags);
|
|
8828
|
+
|
|
8829
|
+
case 2:
|
|
8830
|
+
return _context15.abrupt("return", _context15.sent);
|
|
8831
|
+
|
|
8832
|
+
case 3:
|
|
8833
|
+
case "end":
|
|
8834
|
+
return _context15.stop();
|
|
8835
|
+
}
|
|
8836
|
+
}
|
|
8837
|
+
}, _callee15, this);
|
|
8838
|
+
}));
|
|
8839
|
+
|
|
8840
|
+
function addCustomMessageFlags(_x33, _x34) {
|
|
8841
|
+
return _addCustomMessageFlags.apply(this, arguments);
|
|
8842
|
+
}
|
|
8843
|
+
|
|
8844
|
+
return addCustomMessageFlags;
|
|
8845
|
+
}()
|
|
8767
8846
|
}]);
|
|
8768
8847
|
|
|
8769
8848
|
return Moderation;
|
|
@@ -14751,7 +14830,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
14751
14830
|
}, {
|
|
14752
14831
|
key: "getUserAgent",
|
|
14753
14832
|
value: function getUserAgent() {
|
|
14754
|
-
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.
|
|
14833
|
+
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.49.0");
|
|
14755
14834
|
}
|
|
14756
14835
|
}, {
|
|
14757
14836
|
key: "setUserAgent",
|