Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "3.9.1"
".": "3.10.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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 <support@moderationapi.com>",
"types": "dist/index.d.ts",
Expand Down
10 changes: 5 additions & 5 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -264,8 +264,8 @@ export class ModerationAPI {
return buildHeaders([{ Authorization: `Bearer ${this.secretKey}` }]);
}

protected stringifyQuery(query: Record<string, unknown>): string {
return qs.stringify(query, { arrayFormat: 'comma' });
protected stringifyQuery(query: object | Record<string, unknown>): string {
return stringifyQuery(query);
}

private getUserAgent(): string {
Expand Down Expand Up @@ -302,7 +302,7 @@ export class ModerationAPI {
}

if (typeof query === 'object' && query && !Array.isArray(query)) {
url.search = this.stringifyQuery(query as Record<string, unknown>);
url.search = this.stringifyQuery(query);
}

return url.toString();
Expand Down Expand Up @@ -741,7 +741,7 @@ export class ModerationAPI {
) {
return {
bodyHeaders: { 'content-type': 'application/x-www-form-urlencoded' },
body: this.stringifyQuery(body as Record<string, unknown>),
body: this.stringifyQuery(body),
};
} else {
return this.#encoder({ body, headers });
Expand Down
1 change: 1 addition & 0 deletions src/internal/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ export * from './utils/env';
export * from './utils/log';
export * from './utils/uuid';
export * from './utils/sleep';
export * from './utils/query';
7 changes: 7 additions & 0 deletions src/internal/utils/query.ts
Original file line number Diff line number Diff line change
@@ -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<string, unknown>) {
return qs.stringify(query, { arrayFormat: 'comma' });
}
6 changes: 6 additions & 0 deletions src/resources/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '3.9.1'; // x-release-please-version
export const VERSION = '3.10.0'; // x-release-please-version
6 changes: 2 additions & 4 deletions tests/stringifyQuery.test.ts
Original file line number Diff line number Diff line change
@@ -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 [
Expand All @@ -15,7 +13,7 @@ describe(stringifyQuery, () => {
'e=f',
)}=${encodeURIComponent('g&h')}`,
],
]) {
] as const) {
it(`${JSON.stringify(input)} -> ${expected}`, () => {
expect(stringifyQuery(input)).toEqual(expected);
});
Expand Down