@unboundcx/sdk 4.10.0 → 4.10.2

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/services/chat.js +14 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unboundcx/sdk",
3
- "version": "4.10.0",
3
+ "version": "4.10.2",
4
4
  "description": "Official JavaScript SDK for the Unbound API - A comprehensive toolkit for integrating with Unbound's communication, AI, and data management services",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/services/chat.js CHANGED
@@ -825,7 +825,9 @@ export class ChatService {
825
825
 
826
826
  /**
827
827
  * Admin: get account-level chat settings.
828
- * @returns {Promise<Object>} `{allowReports, reportReasons}`
828
+ * @returns {Promise<Object>} `{allowReports, reportReasons, reportNotifications}`
829
+ * `reportNotifications[]` items are `{channelId, channelName, channelKind, reasons}` —
830
+ * `reasons` is `null` when the rule notifies for every reason.
829
831
  */
830
832
  async adminGetSettings() {
831
833
  return internalRequest(this.sdk, "/chat/admin/settings", "GET");
@@ -836,18 +838,26 @@ export class ChatService {
836
838
  * @param {Object} params
837
839
  * @param {boolean} params.allowReports
838
840
  * @param {string[]} [params.reportReasons]
839
- * @returns {Promise<Object>} `{allowReports, reportReasons}`
841
+ * @param {Object[]} [params.reportNotifications] - Channels to post a
842
+ * "message reported" card to. Each item: `{channelId: string, reasons:
843
+ * string[]|null}` — `reasons` null/empty means "notify for every
844
+ * reason"; channel must be a non-archived public/private channel.
845
+ * @returns {Promise<Object>} `{allowReports, reportReasons, reportNotifications}`
840
846
  */
841
- async adminPutSettings({ allowReports, reportReasons } = {}) {
847
+ async adminPutSettings({ allowReports, reportReasons, reportNotifications } = {}) {
842
848
  this.sdk.validateParams(
843
- { allowReports, reportReasons },
849
+ { allowReports, reportReasons, reportNotifications },
844
850
  {
845
851
  allowReports: { type: "boolean", required: true },
846
852
  reportReasons: { type: "array", required: false },
853
+ reportNotifications: { type: "array", required: false },
847
854
  },
848
855
  );
849
856
  const body = { allowReports };
850
857
  if (reportReasons !== undefined) body.reportReasons = reportReasons;
858
+ if (reportNotifications !== undefined) {
859
+ body.reportNotifications = reportNotifications;
860
+ }
851
861
  return internalRequest(this.sdk, "/chat/admin/settings", "PUT", {
852
862
  body,
853
863
  });