diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 34a3350..83f9eb8 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.2.0" + ".": "4.3.0" } diff --git a/.stats.yml b/.stats.yml index b80b97b..6265db3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 27 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api/moderation-api-cbf656f40e43acf60d9596f78204f031dc8c7205626df8f05ce8e88bcf49b597.yml -openapi_spec_hash: 23be5a56248a1a575b34833eb7e7fe49 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api/moderation-api-9c5291067ec36cba0c9ef772c5c8eb10238fb332f1f25d0e31f3f2ad87c24e5e.yml +openapi_spec_hash: 790cc0a36d6ed693c06a285c441ab977 config_hash: 9d144cc6c49d3fd53e5b4472c1e22165 diff --git a/CHANGELOG.md b/CHANGELOG.md index 14e7b2b..c73298d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 4.3.0 (2026-06-02) + +Full Changelog: [v4.2.0...v4.3.0](https://github.com/moderation-api/sdk-typescript/compare/v4.2.0...v4.3.0) + +### Features + +* **api:** api update ([8c2f693](https://github.com/moderation-api/sdk-typescript/commit/8c2f6939e9db7f566f4dbf9b39b7050750750a15)) + ## 4.2.0 (2026-06-01) Full Changelog: [v4.1.1...v4.2.0](https://github.com/moderation-api/sdk-typescript/compare/v4.1.1...v4.2.0) diff --git a/package.json b/package.json index d01b7bc..7340deb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@moderation-api/sdk", - "version": "4.2.0", + "version": "4.3.0", "description": "The official TypeScript library for the Moderation API API", "author": "Moderation API ", "types": "dist/index.d.ts", diff --git a/src/resources/content.ts b/src/resources/content.ts index c39cdf7..ec27cb3 100644 --- a/src/resources/content.ts +++ b/src/resources/content.ts @@ -415,6 +415,7 @@ export namespace ContentSubmitResponse { | 'rule_match' | 'rule_default' | 'rule_fallback' + | 'client_override' >; /** @@ -460,6 +461,13 @@ export interface ContentSubmitParams { */ channel?: string; + /** + * A recommendation from your own client-side flagging (e.g. a banned-IP list or a + * third-party tool). Feeds the rules engine and can escalate or override the + * recommended action. Does not change whether our analysis flagged the content. + */ + clientAction?: ContentSubmitParams.ClientAction; + /** * The unique ID of the content in your database. */ @@ -650,6 +658,34 @@ export namespace ContentSubmitParams { } } + /** + * A recommendation from your own client-side flagging (e.g. a banned-IP list or a + * third-party tool). Feeds the rules engine and can escalate or override the + * recommended action. Does not change whether our analysis flagged the content. + */ + export interface ClientAction { + /** + * Your recommendation for the content: allow, review, or reject. + */ + action: 'review' | 'allow' | 'reject'; + + /** + * How your recommendation combines with ours. Defaults to 'escalate', which only + * applies it when stricter than ours; 'override' replaces ours outright. + */ + behavior?: 'override' | 'escalate'; + + /** + * A human-readable explanation for your recommendation. + */ + reason?: string; + + /** + * Where your recommendation came from, e.g. "banned-ip". + */ + source?: string; + } + export interface Toxicity { id: 'toxicity'; diff --git a/src/resources/queue/queue.ts b/src/resources/queue/queue.ts index 6b4f736..bac5e7e 100644 --- a/src/resources/queue/queue.ts +++ b/src/resources/queue/queue.ts @@ -1450,6 +1450,11 @@ export namespace WebhookEvent { */ channel_key: string | null; + /** + * A recommendation from your own client-side flagging. + */ + client_action: Item.ClientAction | null; + /** * The original content payload */ @@ -1503,6 +1508,32 @@ export namespace WebhookEvent { } export namespace Item { + /** + * A recommendation from your own client-side flagging. + */ + export interface ClientAction { + /** + * Your recommendation for the content: allow, review, or reject. + */ + action: 'review' | 'allow' | 'reject'; + + /** + * How your recommendation combines with ours. Defaults to 'escalate', which only + * applies it when stricter than ours; 'override' replaces ours outright. + */ + behavior?: 'override' | 'escalate'; + + /** + * A human-readable explanation for your recommendation. + */ + reason?: string; + + /** + * Where your recommendation came from, e.g. "banned-ip". + */ + source?: string; + } + /** * Text */ @@ -2131,6 +2162,11 @@ export namespace WebhookEvent { */ channel_key: string | null; + /** + * A recommendation from your own client-side flagging. + */ + client_action: Item.ClientAction | null; + /** * The original content payload */ @@ -2184,6 +2220,32 @@ export namespace WebhookEvent { } export namespace Item { + /** + * A recommendation from your own client-side flagging. + */ + export interface ClientAction { + /** + * Your recommendation for the content: allow, review, or reject. + */ + action: 'review' | 'allow' | 'reject'; + + /** + * How your recommendation combines with ours. Defaults to 'escalate', which only + * applies it when stricter than ours; 'override' replaces ours outright. + */ + behavior?: 'override' | 'escalate'; + + /** + * A human-readable explanation for your recommendation. + */ + reason?: string; + + /** + * Where your recommendation came from, e.g. "banned-ip". + */ + source?: string; + } + /** * Text */ @@ -2653,6 +2715,11 @@ export namespace WebhookEvent { */ channel_key: string | null; + /** + * A recommendation from your own client-side flagging. + */ + client_action: Item.ClientAction | null; + /** * The original content payload */ @@ -2706,6 +2773,32 @@ export namespace WebhookEvent { } export namespace Item { + /** + * A recommendation from your own client-side flagging. + */ + export interface ClientAction { + /** + * Your recommendation for the content: allow, review, or reject. + */ + action: 'review' | 'allow' | 'reject'; + + /** + * How your recommendation combines with ours. Defaults to 'escalate', which only + * applies it when stricter than ours; 'override' replaces ours outright. + */ + behavior?: 'override' | 'escalate'; + + /** + * A human-readable explanation for your recommendation. + */ + reason?: string; + + /** + * Where your recommendation came from, e.g. "banned-ip". + */ + source?: string; + } + /** * Text */ @@ -3175,6 +3268,11 @@ export namespace WebhookEvent { */ channel_key: string | null; + /** + * A recommendation from your own client-side flagging. + */ + client_action: Item.ClientAction | null; + /** * The original content payload */ @@ -3228,6 +3326,32 @@ export namespace WebhookEvent { } export namespace Item { + /** + * A recommendation from your own client-side flagging. + */ + export interface ClientAction { + /** + * Your recommendation for the content: allow, review, or reject. + */ + action: 'review' | 'allow' | 'reject'; + + /** + * How your recommendation combines with ours. Defaults to 'escalate', which only + * applies it when stricter than ours; 'override' replaces ours outright. + */ + behavior?: 'override' | 'escalate'; + + /** + * A human-readable explanation for your recommendation. + */ + reason?: string; + + /** + * Where your recommendation came from, e.g. "banned-ip". + */ + source?: string; + } + /** * Text */ diff --git a/src/version.ts b/src/version.ts index f9ec1c7..e743242 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '4.2.0'; // x-release-please-version +export const VERSION = '4.3.0'; // x-release-please-version diff --git a/tests/api-resources/content.test.ts b/tests/api-resources/content.test.ts index b44b3e7..69a9f4b 100644 --- a/tests/api-resources/content.test.ts +++ b/tests/api-resources/content.test.ts @@ -26,6 +26,12 @@ describe('resource content', () => { content: { text: 'text', type: 'text' }, authorId: 'authorId', channel: 'channel', + clientAction: { + action: 'review', + behavior: 'override', + reason: 'reason', + source: 'source', + }, contentId: 'contentId', conversationId: 'conversationId', doNotStore: true,