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.0.0"
".": "3.1.0-rc.1"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 30
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/writerai/writer-275de8f7afa2d37404ebebc082dda35e70ab94437de270b5bc6e2fdc94c9fdae.yml
openapi_spec_hash: 4d4a9ba232d19a6180e6d4a7d5566103
config_hash: 8701b1a467238f1afdeceeb7feb1adc6
configured_endpoints: 29
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/writerai/writer-c998c7cab6c43a698deb813179849e0379db494eef2a34f751616486d6bb0e25.yml
openapi_spec_hash: aba09dae66d0e96b08ea2ac4e9113f09
config_hash: 85d9c08b6b71fad459240bc6f401eac7
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# Changelog

## 3.1.0-rc.1 (2026-07-13)

Full Changelog: [v3.0.0...v3.1.0-rc.1](https://github.com/writer/writer-node/compare/v3.0.0...v3.1.0-rc.1)

### Features

* **api:** remove translation endpoint ([b1d8bff](https://github.com/writer/writer-node/commit/b1d8bff85f424352ab8e7718d5bdd05b279b4c08))


### Bug Fixes

* **client:** send content-type header for requests with an omitted optional body ([2678ce2](https://github.com/writer/writer-node/commit/2678ce22ceb1aaf6fb7edf6032e1f29ce2466442))


### Documentation

* **api:** updates to API spec ([8498778](https://github.com/writer/writer-node/commit/849877848176d847e5620efb689b3331d99b2e45))


### Build System

* **deps:** Bump the npm_and_yarn group across 2 directories with 10 updates ([ccb86ee](https://github.com/writer/writer-node/commit/ccb86eeceb82098f0419f081d2f54b7ace86599c))
* **deps:** Bump the npm_and_yarn group across 2 directories with 2 updates ([0311758](https://github.com/writer/writer-node/commit/0311758d83930bacceaab702f4303533c4ffd384))

## 3.0.0 (2026-06-02)

Full Changelog: [v3.0.0...v3.0.0](https://github.com/writer/writer-node/compare/v3.0.0...v3.0.0)
Expand Down
11 changes: 0 additions & 11 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,17 +147,6 @@ Methods:
- <code title="post /v1/tools/pdf-parser/{file_id}">client.tools.<a href="./src/resources/tools.ts">parsePdf</a>(fileID, { ...params }) -> ToolParsePdfResponse</code>
- <code title="post /v1/tools/web-search">client.tools.<a href="./src/resources/tools.ts">webSearch</a>({ ...params }) -> ToolWebSearchResponse</code>

# Translation

Types:

- <code><a href="./src/resources/translation.ts">TranslationRequest</a></code>
- <code><a href="./src/resources/translation.ts">TranslationResponse</a></code>

Methods:

- <code title="post /v1/translation">client.translation.<a href="./src/resources/translation.ts">translate</a>({ ...params }) -> TranslationResponse</code>

# Vision

Types:
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": "writer-sdk",
"version": "3.0.0",
"version": "3.1.0-rc.1",
"description": "The official TypeScript library for the Writer API",
"author": "Writer <dev-feedback@writer.com>",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp-server/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"dxt_version": "0.2",
"name": "writer-sdk-mcp",
"version": "3.0.0",
"version": "3.1.0-rc.1",
"description": "The official MCP Server for the Writer API",
"author": {
"name": "Writer",
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "writer-sdk-mcp",
"version": "3.0.0",
"version": "3.1.0-rc.1",
"description": "The official MCP Server for the Writer API",
"author": "Writer <dev-feedback@writer.com>",
"types": "dist/index.d.ts",
Expand Down
1 change: 0 additions & 1 deletion packages/mcp-server/src/code-tool-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ const fuse = new Fuse(
'client.files.upload',
'client.tools.parsePdf',
'client.tools.webSearch',
'client.translation.translate',
'client.vision.analyze',
],
{ threshold: 1, shouldSort: true },
Expand Down
42 changes: 0 additions & 42 deletions packages/mcp-server/src/local-docs-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1091,48 +1091,6 @@ const EMBEDDED_METHODS: MethodEntry[] = [
},
},
},
{
name: 'translate',
endpoint: '/v1/translation',
httpMethod: 'post',
summary: 'Translate text',
description: 'Translate text from one language to another.',
stainlessPath: '(resource) translation > (method) translate',
qualified: 'client.translation.translate',
params: [
'formality: boolean;',
'length_control: boolean;',
'mask_profanity: boolean;',
"model: 'palmyra-translate';",
'source_language_code: string;',
'target_language_code: string;',
'text: string;',
],
response: '{ data: string; }',
markdown:
"## translate\n\n`client.translation.translate(formality: boolean, length_control: boolean, mask_profanity: boolean, model: 'palmyra-translate', source_language_code: string, target_language_code: string, text: string): { data: string; }`\n\n**post** `/v1/translation`\n\nTranslate text from one language to another.\n\n### Parameters\n\n- `formality: boolean`\n Whether to use formal or informal language in the translation. See the [list of languages that support formality](https://dev.writer.com/api-reference/translation-api/language-support#formality). If the language does not support formality, this parameter is ignored.\n\n- `length_control: boolean`\n Whether to control the length of the translated text. See the [list of languages that support length control](https://dev.writer.com/api-reference/translation-api/language-support#length-control). If the language does not support length control, this parameter is ignored.\n\n- `mask_profanity: boolean`\n Whether to mask profane words in the translated text. See the [list of languages that do not support profanity masking](https://dev.writer.com/api-reference/translation-api/language-support#profanity-masking). If the language does not support profanity masking, this parameter is ignored.\n\n- `model: 'palmyra-translate'`\n The model to use for translation.\n\n- `source_language_code: string`\n The [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) language code of the original text to translate. For example, `en` for English, `zh` for Chinese, `fr` for French, `es` for Spanish. If the language has a variant, the code appends the two-digit [ISO-3166 country code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes). For example, Mexican Spanish is `es-MX`. See the [list of supported languages and language codes](https://dev.writer.com/api-reference/translation-api/language-support).\n\n- `target_language_code: string`\n The [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) language code of the target language for the translation. For example, `en` for English, `zh` for Chinese, `fr` for French, `es` for Spanish. If the language has a variant, the code appends the two-digit [ISO-3166 country code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes). For example, Mexican Spanish is `es-MX`. See the [list of supported languages and language codes](https://dev.writer.com/api-reference/translation-api/language-support).\n\n- `text: string`\n The text to translate. Maximum of 100,000 words.\n\n### Returns\n\n- `{ data: string; }`\n\n - `data: string`\n\n### Example\n\n```typescript\nimport Writer from 'writer-sdk';\n\nconst client = new Writer();\n\nconst translationResponse = await client.translation.translate({\n formality: true,\n length_control: true,\n mask_profanity: true,\n model: 'palmyra-translate',\n source_language_code: 'en',\n target_language_code: 'es',\n text: 'Hello, world!',\n});\n\nconsole.log(translationResponse);\n```",
perLanguage: {
typescript: {
method: 'client.translation.translate',
example:
"import Writer from 'writer-sdk';\n\nconst client = new Writer({\n apiKey: process.env['WRITER_API_KEY'], // This is the default and can be omitted\n});\n\nconst translationResponse = await client.translation.translate({\n formality: true,\n length_control: true,\n mask_profanity: true,\n model: 'palmyra-translate',\n source_language_code: 'en',\n target_language_code: 'es',\n text: 'Hello, world!',\n});\n\nconsole.log(translationResponse.data);",
},
python: {
method: 'translation.translate',
example:
'import os\nfrom writerai import Writer\n\nclient = Writer(\n api_key=os.environ.get("WRITER_API_KEY"), # This is the default and can be omitted\n)\ntranslation_response = client.translation.translate(\n formality=True,\n length_control=True,\n mask_profanity=True,\n model="palmyra-translate",\n source_language_code="en",\n target_language_code="es",\n text="Hello, world!",\n)\nprint(translation_response.data)',
},
go: {
method: 'client.Translation.Translate',
example:
'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/stainless-sdks/writer-go"\n\t"github.com/stainless-sdks/writer-go/option"\n)\n\nfunc main() {\n\tclient := writersdk.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\ttranslationResponse, err := client.Translation.Translate(context.TODO(), writersdk.TranslationTranslateParams{\n\t\tTranslationRequest: writersdk.TranslationRequestParam{\n\t\t\tFormality: writersdk.F(true),\n\t\t\tLengthControl: writersdk.F(true),\n\t\t\tMaskProfanity: writersdk.F(true),\n\t\t\tModel: writersdk.F(writersdk.TranslationRequestModelPalmyraTranslate),\n\t\t\tSourceLanguageCode: writersdk.F("en"),\n\t\t\tTargetLanguageCode: writersdk.F("es"),\n\t\t\tText: writersdk.F("Hello, world!"),\n\t\t},\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", translationResponse.Data)\n}\n',
},
http: {
example:
'curl https://api.writer.com/v1/translation \\\n -H \'Content-Type: application/json\' \\\n -H "Authorization: Bearer $WRITER_API_KEY" \\\n -d \'{\n "formality": true,\n "length_control": true,\n "mask_profanity": true,\n "model": "palmyra-translate",\n "source_language_code": "en",\n "target_language_code": "es",\n "text": "Hello, world!"\n }\'',
},
},
},
{
name: 'analyze',
endpoint: '/v1/vision',
Expand Down
6 changes: 0 additions & 6 deletions packages/mcp-server/src/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,6 @@ export const sdkMethods: SdkMethod[] = [
httpMethod: 'post',
httpPath: '/v1/tools/web-search',
},
{
clientCallName: 'client.translation.translate',
fullyQualifiedName: 'translation.translate',
httpMethod: 'post',
httpPath: '/v1/translation',
},
{
clientCallName: 'client.vision.analyze',
fullyQualifiedName: 'vision.analyze',
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp-server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const newMcpServer = async ({
new McpServer(
{
name: 'writer_sdk_api',
version: '3.0.0',
version: '3.1.0-rc.1',
},
{
instructions: await getInstructions({ stainlessApiKey, customInstructionsPath }),
Expand Down
25 changes: 9 additions & 16 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,6 @@ import {
ToolWebSearchResponse,
Tools,
} from './resources/tools';
import {
Translation,
TranslationRequest,
TranslationResponse,
TranslationTranslateParams,
} from './resources/translation';
import { Vision, VisionAnalyzeParams, VisionRequest, VisionResponse } from './resources/vision';
import {
ApplicationGenerateContentChunk,
Expand Down Expand Up @@ -774,11 +768,19 @@ export class Writer {
return () => controller.abort();
}

private buildBody({ options: { body, headers: rawHeaders } }: { options: FinalRequestOptions }): {
private buildBody({ options }: { options: FinalRequestOptions }): {
bodyHeaders: HeadersLike;
body: BodyInit | undefined;
} {
const { body, headers: rawHeaders } = options;
if (!body) {
// A resource method always passes a `body` key when its operation defines a
// request body, even if the caller omitted an optional body param. Keep the
// content-type for those, and only elide it for operations with no body at
// all (e.g. GET/DELETE).
if (body == null && 'body' in options) {
return this.#encoder({ body, headers: buildHeaders([rawHeaders]) });
}
return { bodyHeaders: undefined, body: undefined };
}
const headers = buildHeaders([rawHeaders]);
Expand Down Expand Up @@ -845,7 +847,6 @@ export class Writer {
graphs: API.Graphs = new API.Graphs(this);
files: API.Files = new API.Files(this);
tools: API.Tools = new API.Tools(this);
translation: API.Translation = new API.Translation(this);
vision: API.Vision = new API.Vision(this);
}

Expand All @@ -856,7 +857,6 @@ Writer.Models = Models;
Writer.Graphs = Graphs;
Writer.Files = Files;
Writer.Tools = Tools;
Writer.Translation = Translation;
Writer.Vision = Vision;

export declare namespace Writer {
Expand Down Expand Up @@ -948,13 +948,6 @@ export declare namespace Writer {
type ToolWebSearchParams as ToolWebSearchParams,
};

export {
Translation as Translation,
type TranslationRequest as TranslationRequest,
type TranslationResponse as TranslationResponse,
type TranslationTranslateParams as TranslationTranslateParams,
};

export {
Vision as Vision,
type VisionRequest as VisionRequest,
Expand Down
6 changes: 0 additions & 6 deletions src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,4 @@ export {
type ToolParsePdfParams,
type ToolWebSearchParams,
} from './tools';
export {
Translation,
type TranslationRequest,
type TranslationResponse,
type TranslationTranslateParams,
} from './translation';
export { Vision, type VisionRequest, type VisionResponse, type VisionAnalyzeParams } from './vision';
141 changes: 0 additions & 141 deletions src/resources/translation.ts

This file was deleted.

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.0.0'; // x-release-please-version
export const VERSION = '3.1.0-rc.1'; // x-release-please-version
Loading
Loading