From 7b4ca4e410fc7a6624417e94e527971132ea9015 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 27 Feb 2026 11:37:46 +0000 Subject: [PATCH 1/3] chore(internal): move stringifyQuery implementation to internal function --- src/client.ts | 10 +++++----- src/internal/utils.ts | 1 + src/internal/utils/query.ts | 7 +++++++ tests/stringifyQuery.test.ts | 6 ++---- 4 files changed, 15 insertions(+), 9 deletions(-) create mode 100644 src/internal/utils/query.ts diff --git a/src/client.ts b/src/client.ts index 62d6451..4845e3a 100644 --- a/src/client.ts +++ b/src/client.ts @@ -11,7 +11,7 @@ import type { APIResponseProps } from './internal/parse'; import { getPlatformHeaders } from './internal/detect-platform'; import * as Shims from './internal/shims'; import * as Opts from './internal/request-options'; -import * as qs from './internal/qs'; +import { stringifyQuery } from './internal/utils/query'; import { VERSION } from './version'; import * as Errors from './core/error'; import * as Uploads from './core/uploads'; @@ -264,8 +264,8 @@ export class ModerationAPI { return buildHeaders([{ Authorization: `Bearer ${this.secretKey}` }]); } - protected stringifyQuery(query: Record): string { - return qs.stringify(query, { arrayFormat: 'comma' }); + protected stringifyQuery(query: object | Record): string { + return stringifyQuery(query); } private getUserAgent(): string { @@ -302,7 +302,7 @@ export class ModerationAPI { } if (typeof query === 'object' && query && !Array.isArray(query)) { - url.search = this.stringifyQuery(query as Record); + url.search = this.stringifyQuery(query); } return url.toString(); @@ -741,7 +741,7 @@ export class ModerationAPI { ) { return { bodyHeaders: { 'content-type': 'application/x-www-form-urlencoded' }, - body: this.stringifyQuery(body as Record), + body: this.stringifyQuery(body), }; } else { return this.#encoder({ body, headers }); diff --git a/src/internal/utils.ts b/src/internal/utils.ts index 3cbfacc..c591353 100644 --- a/src/internal/utils.ts +++ b/src/internal/utils.ts @@ -6,3 +6,4 @@ export * from './utils/env'; export * from './utils/log'; export * from './utils/uuid'; export * from './utils/sleep'; +export * from './utils/query'; diff --git a/src/internal/utils/query.ts b/src/internal/utils/query.ts new file mode 100644 index 0000000..0139cac --- /dev/null +++ b/src/internal/utils/query.ts @@ -0,0 +1,7 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import * as qs from '../qs/stringify'; + +export function stringifyQuery(query: object | Record) { + return qs.stringify(query, { arrayFormat: 'comma' }); +} diff --git a/tests/stringifyQuery.test.ts b/tests/stringifyQuery.test.ts index 213f80b..5efb7bb 100644 --- a/tests/stringifyQuery.test.ts +++ b/tests/stringifyQuery.test.ts @@ -1,8 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { ModerationAPI } from '@moderation-api/sdk'; - -const { stringifyQuery } = ModerationAPI.prototype as any; +import { stringifyQuery } from '@moderation-api/sdk/internal/utils/query'; describe(stringifyQuery, () => { for (const [input, expected] of [ @@ -15,7 +13,7 @@ describe(stringifyQuery, () => { 'e=f', )}=${encodeURIComponent('g&h')}`, ], - ]) { + ] as const) { it(`${JSON.stringify(input)} -> ${expected}`, () => { expect(stringifyQuery(input)).toEqual(expected); }); From 1cca55994c701afe1832ed3fcf872beb12ff7c85 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Mar 2026 11:27:07 +0000 Subject: [PATCH 2/3] feat(api): api update --- .stats.yml | 4 ++-- src/resources/content.ts | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 688c1d0..23eb088 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%2Fmoderation-api-7270e2afd5e9c57ffcb1b83d5eb8b549a33c471b72ab494f903473a23b3f7115.yml -openapi_spec_hash: cfd11087252e28bc7e7d4f4dbefc51ee +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api%2Fmoderation-api-fb621278289bf54b9c00e8cadce0cc9fa89506ec908464fdb99d66620a953f0a.yml +openapi_spec_hash: c2a3e2de6f910fc28c7ccd88bf722e06 config_hash: 6b825a08e19dfb747c5dc1766502b789 diff --git a/src/resources/content.ts b/src/resources/content.ts index a837e45..6be8389 100644 --- a/src/resources/content.ts +++ b/src/resources/content.ts @@ -211,6 +211,12 @@ export namespace ContentSubmitResponse { */ severity_score: number; + /** + * Whether the content would have been flagged by analyze-only policies (flag: + * false). + */ + shadow_flagged?: boolean; + /** * Whether the content was flagged for Unicode spoofing. */ From 0e0d2960969e3434b0b72e82d0a6ceae29ccc8c7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Mar 2026 11:27:44 +0000 Subject: [PATCH 3/3] release: 3.10.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 13 +++++++++++++ package.json | 2 +- src/version.ts | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f9897f7..0b9e26a 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.9.1" + ".": "3.10.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 809e9c0..1776318 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 3.10.0 (2026-03-03) + +Full Changelog: [v3.9.1...v3.10.0](https://github.com/moderation-api/sdk-typescript/compare/v3.9.1...v3.10.0) + +### Features + +* **api:** api update ([1cca559](https://github.com/moderation-api/sdk-typescript/commit/1cca55994c701afe1832ed3fcf872beb12ff7c85)) + + +### Chores + +* **internal:** move stringifyQuery implementation to internal function ([7b4ca4e](https://github.com/moderation-api/sdk-typescript/commit/7b4ca4e410fc7a6624417e94e527971132ea9015)) + ## 3.9.1 (2026-02-24) Full Changelog: [v3.9.0...v3.9.1](https://github.com/moderation-api/sdk-typescript/compare/v3.9.0...v3.9.1) diff --git a/package.json b/package.json index 15cca41..00ad91a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@moderation-api/sdk", - "version": "3.9.1", + "version": "3.10.0", "description": "The official TypeScript library for the Moderation API API", "author": "Moderation API ", "types": "dist/index.d.ts", diff --git a/src/version.ts b/src/version.ts index 922919f..fa1001b 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '3.9.1'; // x-release-please-version +export const VERSION = '3.10.0'; // x-release-please-version