From 69ff5c6d4226f137b8d796c338600f353e9c34ed Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 7 Jan 2026 05:46:57 +0000 Subject: [PATCH 1/3] chore: break long lines in snippets into multiline --- README.md | 15 +++++++++++--- tests/index.test.ts | 48 +++++++++++++++++++++++++++++++++++++-------- 2 files changed, 52 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index fb785b7..5276d46 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,10 @@ const client = new ScanDocuments({ apiKey: process.env['SCAN_DOCUMENTS_API_KEY'], // This is the default and can be omitted }); -const file = await client.files.upload({ file: fs.createReadStream('path/to/file'), name: 'REPLACE_ME' }); +const file = await client.files.upload({ + file: fs.createReadStream('path/to/file'), + name: 'REPLACE_ME', +}); ``` ### Request & Response types @@ -84,8 +87,14 @@ await client.files.upload({ file: new File(['my bytes'], 'file'), name: 'File Na await client.files.upload({ file: await fetch('https://somesite/file'), name: 'File Name' }); // Finally, if none of the above are convenient, you can use our `toFile` helper: -await client.files.upload({ file: await toFile(Buffer.from('my bytes'), 'file'), name: 'File Name' }); -await client.files.upload({ file: await toFile(new Uint8Array([0, 1, 2]), 'file'), name: 'File Name' }); +await client.files.upload({ + file: await toFile(Buffer.from('my bytes'), 'file'), + name: 'File Name', +}); +await client.files.upload({ + file: await toFile(new Uint8Array([0, 1, 2]), 'file'), + name: 'File Name', +}); ``` ## Task operations diff --git a/tests/index.test.ts b/tests/index.test.ts index a75ea2b..1334078 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -87,7 +87,11 @@ describe('instantiate client', () => { error: jest.fn(), }; - const client = new ScanDocuments({ logger: logger, logLevel: 'debug', apiKey: 'My API Key' }); + const client = new ScanDocuments({ + logger: logger, + logLevel: 'debug', + apiKey: 'My API Key', + }); await forceAPIResponseForClient(client); expect(debugMock).toHaveBeenCalled(); @@ -107,7 +111,11 @@ describe('instantiate client', () => { error: jest.fn(), }; - const client = new ScanDocuments({ logger: logger, logLevel: 'info', apiKey: 'My API Key' }); + const client = new ScanDocuments({ + logger: logger, + logLevel: 'info', + apiKey: 'My API Key', + }); await forceAPIResponseForClient(client); expect(debugMock).not.toHaveBeenCalled(); @@ -157,7 +165,11 @@ describe('instantiate client', () => { }; process.env['SCAN_DOCUMENTS_LOG'] = 'debug'; - const client = new ScanDocuments({ logger: logger, logLevel: 'off', apiKey: 'My API Key' }); + const client = new ScanDocuments({ + logger: logger, + logLevel: 'off', + apiKey: 'My API Key', + }); await forceAPIResponseForClient(client); expect(debugMock).not.toHaveBeenCalled(); @@ -173,7 +185,11 @@ describe('instantiate client', () => { }; process.env['SCAN_DOCUMENTS_LOG'] = 'not a log level'; - const client = new ScanDocuments({ logger: logger, logLevel: 'debug', apiKey: 'My API Key' }); + const client = new ScanDocuments({ + logger: logger, + logLevel: 'debug', + apiKey: 'My API Key', + }); expect(client.logLevel).toBe('debug'); expect(warnMock).not.toHaveBeenCalled(); }); @@ -549,7 +565,11 @@ describe('retries', () => { return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } }); }; - const client = new ScanDocuments({ apiKey: 'My API Key', timeout: 10, fetch: testFetch }); + const client = new ScanDocuments({ + apiKey: 'My API Key', + timeout: 10, + fetch: testFetch, + }); expect(await client.request({ path: '/foo', method: 'get' })).toEqual({ a: 1 }); expect(count).toEqual(2); @@ -579,7 +599,11 @@ describe('retries', () => { return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } }); }; - const client = new ScanDocuments({ apiKey: 'My API Key', fetch: testFetch, maxRetries: 4 }); + const client = new ScanDocuments({ + apiKey: 'My API Key', + fetch: testFetch, + maxRetries: 4, + }); expect(await client.request({ path: '/foo', method: 'get' })).toEqual({ a: 1 }); @@ -603,7 +627,11 @@ describe('retries', () => { capturedRequest = init; return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } }); }; - const client = new ScanDocuments({ apiKey: 'My API Key', fetch: testFetch, maxRetries: 4 }); + const client = new ScanDocuments({ + apiKey: 'My API Key', + fetch: testFetch, + maxRetries: 4, + }); expect( await client.request({ @@ -665,7 +693,11 @@ describe('retries', () => { capturedRequest = init; return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } }); }; - const client = new ScanDocuments({ apiKey: 'My API Key', fetch: testFetch, maxRetries: 4 }); + const client = new ScanDocuments({ + apiKey: 'My API Key', + fetch: testFetch, + maxRetries: 4, + }); expect( await client.request({ From 950caddd288b4cf8f3d9b62248adfacb0a5ec86d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 7 Jan 2026 05:48:57 +0000 Subject: [PATCH 2/3] fix(mcp): fix options parsing --- packages/mcp-server/src/options.ts | 4 ++-- packages/mcp-server/tests/options.test.ts | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/mcp-server/src/options.ts b/packages/mcp-server/src/options.ts index 6c8bb8d..c66ad8c 100644 --- a/packages/mcp-server/src/options.ts +++ b/packages/mcp-server/src/options.ts @@ -55,7 +55,7 @@ export function parseCLIOptions(): CLIOptions { const transport = argv.transport as 'stdio' | 'http'; return { - includeDocsTools, + ...(includeDocsTools !== undefined && { includeDocsTools }), transport, port: argv.port, socket: argv.socket, @@ -87,6 +87,6 @@ export function parseQueryOptions(defaultOptions: McpOptions, query: unknown): M : defaultOptions.includeDocsTools; return { - includeDocsTools: docsTools, + ...(docsTools !== undefined && { includeDocsTools: docsTools }), }; } diff --git a/packages/mcp-server/tests/options.test.ts b/packages/mcp-server/tests/options.test.ts index 532666a..7a2d511 100644 --- a/packages/mcp-server/tests/options.test.ts +++ b/packages/mcp-server/tests/options.test.ts @@ -26,7 +26,7 @@ describe('parseCLIOptions', () => { const result = parseCLIOptions(); expect(result.transport).toBe('http'); - expect(result.port).toBe('2222'); + expect(result.port).toBe(2222); cleanup(); }); }); @@ -38,13 +38,13 @@ describe('parseQueryOptions', () => { const query = ''; const result = parseQueryOptions(defaultOptions, query); - expect(result).toBe({}); + expect(result).toEqual({}); }); it('should handle invalid query string gracefully', () => { - const query = 'invalid=value&operation=invalid-operation'; + const query = 'invalid=value&tools=invalid-operation'; - // Should throw due to Zod validation for invalid operation + // Should throw due to Zod validation for invalid tools expect(() => parseQueryOptions(defaultOptions, query)).toThrow(); }); }); From 48d83fc1aadcd4b2fecbb4ff43505f000ec387b2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 7 Jan 2026 05:49:12 +0000 Subject: [PATCH 3/3] release: 0.1.0-alpha.18 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 13 +++++++++++++ package.json | 2 +- packages/mcp-server/package.json | 2 +- packages/mcp-server/src/server.ts | 2 +- src/version.ts | 2 +- 6 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index a23d2b1..35d85d8 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.17" + ".": "0.1.0-alpha.18" } diff --git a/CHANGELOG.md b/CHANGELOG.md index da4dc09..a94aa17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 0.1.0-alpha.18 (2026-01-07) + +Full Changelog: [v0.1.0-alpha.17...v0.1.0-alpha.18](https://github.com/Scan-Documents/node-sdk/compare/v0.1.0-alpha.17...v0.1.0-alpha.18) + +### Bug Fixes + +* **mcp:** fix options parsing ([950cadd](https://github.com/Scan-Documents/node-sdk/commit/950caddd288b4cf8f3d9b62248adfacb0a5ec86d)) + + +### Chores + +* break long lines in snippets into multiline ([69ff5c6](https://github.com/Scan-Documents/node-sdk/commit/69ff5c6d4226f137b8d796c338600f353e9c34ed)) + ## 0.1.0-alpha.17 (2026-01-06) Full Changelog: [v0.1.0-alpha.16...v0.1.0-alpha.17](https://github.com/Scan-Documents/node-sdk/compare/v0.1.0-alpha.16...v0.1.0-alpha.17) diff --git a/package.json b/package.json index d6f8483..70a2153 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "scan-documents", - "version": "0.1.0-alpha.17", + "version": "0.1.0-alpha.18", "description": "The official TypeScript library for the Scan Documents API", "author": "Scan Documents ", "types": "dist/index.d.ts", diff --git a/packages/mcp-server/package.json b/packages/mcp-server/package.json index 335258f..d8d9ba7 100644 --- a/packages/mcp-server/package.json +++ b/packages/mcp-server/package.json @@ -1,6 +1,6 @@ { "name": "scan-documents-mcp", - "version": "0.1.0-alpha.17", + "version": "0.1.0-alpha.18", "description": "The official MCP Server for the Scan Documents API", "author": "Scan Documents ", "types": "dist/index.d.ts", diff --git a/packages/mcp-server/src/server.ts b/packages/mcp-server/src/server.ts index b307188..a10966a 100644 --- a/packages/mcp-server/src/server.ts +++ b/packages/mcp-server/src/server.ts @@ -21,7 +21,7 @@ export const newMcpServer = () => new McpServer( { name: 'scan_documents_api', - version: '0.1.0-alpha.17', + version: '0.1.0-alpha.18', }, { capabilities: { tools: {}, logging: {} } }, ); diff --git a/src/version.ts b/src/version.ts index 35b0d1b..3ff37fe 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.1.0-alpha.17'; // x-release-please-version +export const VERSION = '0.1.0-alpha.18'; // x-release-please-version