Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
3a42ea2
chore(tests): bump steady to v0.22.1
stainless-app[bot] Apr 17, 2026
dec3f3d
chore(internal): update docs ordering
stainless-app[bot] Apr 22, 2026
af77915
chore(internal): more robust bootstrap script
stainless-app[bot] Apr 22, 2026
6eeaf25
chore: restructure docs search code
stainless-app[bot] Apr 24, 2026
b671b3d
chore(formatter): run prettier and eslint separately
stainless-app[bot] Apr 24, 2026
7f46854
chore(internal): codegen related update
stainless-app[bot] Apr 27, 2026
775860c
feat: support setting headers via env
stainless-app[bot] Apr 27, 2026
be7d4a0
chore(format): run eslint and prettier separately
stainless-app[bot] Jun 2, 2026
6a45720
chore: avoid formatting file that gets changed during releases
stainless-app[bot] Apr 29, 2026
5d5ce86
codegen metadata
stainless-app[bot] Apr 29, 2026
e834858
codegen metadata
stainless-app[bot] Apr 30, 2026
34a1c2e
docs: update http mcp docs
stainless-app[bot] May 6, 2026
7b2b3a9
chore: redact api-key headers in debug logs
stainless-app[bot] May 7, 2026
cbc04e6
ci: pin GitHub Actions to commit SHAs
stainless-app[bot] May 12, 2026
c4c7f9e
chore(tests): remove redundant File import
stainless-app[bot] May 18, 2026
c4f21ed
fix(typescript): upgrade tsc-multi so that it works with Node 26
stainless-app[bot] May 18, 2026
5f3799d
fix: treat text/plan with format: binary as raw upload
stainless-app[bot] May 22, 2026
88197ba
chore(internal): codegen related update
stainless-app[bot] May 28, 2026
1e77ebc
fix(mcp): use `pure-lockfile` when building mcp server
stainless-app[bot] May 28, 2026
98dbaa3
release: 3.0.0
stainless-app[bot] Jun 2, 2026
adf5ccb
fix: Fix linting errors.
adeweaver Jun 2, 2026
dea914e
fix: Fix linting errors. (#246)
adeweaver Jun 2, 2026
3473544
release: 3.0.0
stainless-app[bot] Jun 2, 2026
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
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
runs-on: ${{ github.repository == 'stainless-sdks/writer-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up Node
uses: actions/setup-node@v4
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '22'

Expand All @@ -43,10 +43,10 @@ jobs:
contents: read
id-token: write
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up Node
uses: actions/setup-node@v4
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '22'

Expand All @@ -61,7 +61,7 @@ jobs:
github.repository == 'stainless-sdks/writer-typescript' &&
!startsWith(github.ref, 'refs/heads/stl/')
id: github-oidc
uses: actions/github-script@v8
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
script: core.setOutput('github_token', await core.getIDToken());

Expand Down Expand Up @@ -91,10 +91,10 @@ jobs:
runs-on: ${{ github.repository == 'stainless-sdks/writer-typescript' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up Node
uses: actions/setup-node@v4
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '22'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
contents: write

steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up Node
uses: actions/setup-node@v3
uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3.9.1
with:
node-version: '20'

Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ jobs:
if: github.repository == 'writer/writer-node' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')

steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Check release environment
run: |
bash ./bin/check-release-environment
env:
NPM_TOKEN: ${{ secrets.WRITER_NPM_TOKEN || secrets.NPM_TOKEN }}

1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ CHANGELOG.md
/ecosystem-tests/*/**
/node_modules
/deno
/packages/mcp-server/manifest.json

# don't format tsc output, will break source maps
dist
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-rc.1"
".": "3.0.0"
}
2 changes: 1 addition & 1 deletion .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%2Fwriter-ea6b4de3976794a02ea8fc01669d901cd7b159ba0d598cc9653e01c987a2f806.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/writerai/writer-275de8f7afa2d37404ebebc082dda35e70ab94437de270b5bc6e2fdc94c9fdae.yml
openapi_spec_hash: 4d4a9ba232d19a6180e6d4a7d5566103
config_hash: 8701b1a467238f1afdeceeb7feb1adc6
306 changes: 306 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const client = new Writer({
```

> Never hard-code your API keys in source code or commit them to version control systems like GitHub.
> We recommend adding `WRITER_API_KEY="My API Key"` to your `.env` file so that your API Key is not stored in source control.
> We recommend adding `WRITER_API_KEY="My API Key"` to your `.env` file so that your API Key is not stored in source control.

## Usage

Expand Down Expand Up @@ -125,13 +125,13 @@ const stream = await client.chat.chat({
model: 'palmyra-x5',
stream: true,
});
let outputText = "";
let outputText = '';
for await (const chunk of stream) {
if (chunk.choices[0]?.delta?.content) {
outputText += chunk.choices[0].delta.content;
} else {
continue;
}
if (chunk.choices[0]?.delta?.content) {
outputText += chunk.choices[0].delta.content;
} else {
continue;
}
}
console.log(outputText);
```
Expand Down
2 changes: 1 addition & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ Methods:
- <code title="delete /v1/files/{file_id}">client.files.<a href="./src/resources/files.ts">delete</a>(fileID) -> FileDeleteResponse</code>
- <code title="get /v1/files/{file_id}/download">client.files.<a href="./src/resources/files.ts">download</a>(fileID) -> Response</code>
- <code title="post /v1/files/retry">client.files.<a href="./src/resources/files.ts">retry</a>({ ...params }) -> FileRetryResponse</code>
- <code title="post /v1/files">client.files.<a href="./src/resources/files.ts">upload</a>({ ...params }) -> File</code>
- <code title="post /v1/files">client.files.<a href="./src/resources/files.ts">upload</a>(content, { ...params }) -> File</code>

# Tools

Expand Down
14 changes: 10 additions & 4 deletions bin/cli
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,21 @@ const commands = {
fn: () => {
const result = spawnSync(
'npx',
['-y', 'https://github.com/stainless-api/migrate-ts/releases/download/0.0.2/stainless-api-migrate-0.0.2-6.tgz', '--migrationConfig', require.resolve('./migration-config.json'), ...process.argv.slice(3)],
[
'-y',
'https://github.com/stainless-api/migrate-ts/releases/download/0.0.2/stainless-api-migrate-0.0.2-6.tgz',
'--migrationConfig',
require.resolve('./migration-config.json'),
...process.argv.slice(3),
],
{ stdio: 'inherit' },
);
if (result.status !== 0) {
process.exit(result.status);
}
}
}
}
},
},
};

function exitWithHelp() {
console.log(`Usage: writer-sdk <subcommand>`);
Expand Down
3 changes: 0 additions & 3 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// @ts-check
import tseslint from 'typescript-eslint';
import unusedImports from 'eslint-plugin-unused-imports';
import prettier from 'eslint-plugin-prettier';

export default tseslint.config(
{
Expand All @@ -14,11 +13,9 @@ export default tseslint.config(
plugins: {
'@typescript-eslint': tseslint.plugin,
'unused-imports': unusedImports,
prettier,
},
rules: {
'no-unused-vars': 'off',
'prettier/prettier': 'error',
'unused-imports/no-unused-imports': 'error',
'no-restricted-imports': [
'error',
Expand Down
3 changes: 1 addition & 2 deletions examples/upload-and-attach-file-to-graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ async function main() {
description: 'This is a graph created from the SDK',
});

let file = await client.files.upload({
let file = await client.files.upload(fs.createReadStream('examples/example.txt'), {
'Content-Type': 'text/plain',
'Content-Disposition': 'attachment; filename="example.txt"',
content: fs.createReadStream('examples/example.txt'),
});

console.log(file.id);
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "writer-sdk",
"version": "3.0.0-rc.1",
"version": "3.0.0",
"description": "The official TypeScript library for the Writer API",
"author": "Writer <dev-feedback@writer.com>",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -35,7 +35,6 @@
"@typescript-eslint/eslint-plugin": "8.31.1",
"@typescript-eslint/parser": "8.31.1",
"eslint": "^9.39.1",
"eslint-plugin-prettier": "^5.4.1",
"eslint-plugin-unused-imports": "^4.1.4",
"fast-check": "^3.23.1",
"iconv-lite": "^0.6.3",
Expand All @@ -44,7 +43,7 @@
"publint": "^0.2.12",
"ts-jest": "^29.1.0",
"ts-node": "^10.5.0",
"tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.9/tsc-multi.tgz",
"tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.11/tsc-multi.tgz",
"tsconfig-paths": "^4.0.0",
"tslib": "^2.8.1",
"typescript": "5.8.3",
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-rc.1",
"version": "3.0.0",
"description": "The official MCP Server for the Writer API",
"author": {
"name": "Writer",
Expand Down
4 changes: 2 additions & 2 deletions 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-rc.1",
"version": "3.0.0",
"description": "The official MCP Server for the Writer API",
"author": "Writer <dev-feedback@writer.com>",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -74,7 +74,7 @@
"ts-jest": "^29.1.0",
"ts-morph": "^19.0.0",
"ts-node": "^10.5.0",
"tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.9/tsc-multi.tgz",
"tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.11/tsc-multi.tgz",
"tsconfig-paths": "^4.0.0"
},
"imports": {
Expand Down
Loading
Loading