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