From 75ec0c8875f5ac06ef72fff853114efd020e20e0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 23 Feb 2026 03:22:22 +0000 Subject: [PATCH 1/2] feat(api): manual updates --- .stats.yml | 2 +- README.md | 4 +--- packages/mcp-server/README.md | 4 +--- packages/mcp-server/manifest.json | 2 +- packages/mcp-server/src/code-tool.ts | 7 ++---- packages/mcp-server/src/server.ts | 2 -- src/client.ts | 36 ++++------------------------ tests/index.test.ts | 21 ++-------------- 8 files changed, 13 insertions(+), 65 deletions(-) diff --git a/.stats.yml b/.stats.yml index 49508b3..603f57a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 21 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser%2Fcas-parser-d9763d006969b49a1473851069fdfa429eb13133b64103a62963bb70ddb22305.yml openapi_spec_hash: 6aee689b7a759b12c85c088c15e29bc0 -config_hash: 4ab3e1ee76a463e0ed214541260ee12e +config_hash: 5509bb7a961ae2e79114b24c381606d4 diff --git a/README.md b/README.md index 5bca122..81d2cce 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This library provides convenient access to the Cas Parser REST API from server-side TypeScript or JavaScript. -The REST API documentation can be found on [docs.casparser.in](https://docs.casparser.in). The full API of this library can be found in [api.md](api.md). +The REST API documentation can be found on [casparser.in](https://casparser.in/docs). The full API of this library can be found in [api.md](api.md). It is generated with [Stainless](https://www.stainless.com/). @@ -33,7 +33,6 @@ import CasParser from 'cas-parser-node'; const client = new CasParser({ apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted - environment: 'environment_1', // or 'production' | 'environment_2'; defaults to 'production' }); const response = await client.credits.check(); @@ -51,7 +50,6 @@ import CasParser from 'cas-parser-node'; const client = new CasParser({ apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted - environment: 'environment_1', // or 'production' | 'environment_2'; defaults to 'production' }); const response: CasParser.CreditCheckResponse = await client.credits.check(); diff --git a/packages/mcp-server/README.md b/packages/mcp-server/README.md index 2c1abef..eba4481 100644 --- a/packages/mcp-server/README.md +++ b/packages/mcp-server/README.md @@ -10,7 +10,6 @@ You can run the MCP Server directly via `npx`: ```sh export CAS_PARSER_API_KEY="My API Key" -export CAS_PARSER_ENVIRONMENT="production" npx -y cas-parser-node-mcp@latest ``` @@ -28,8 +27,7 @@ For clients with a configuration JSON, it might look something like this: "command": "npx", "args": ["-y", "cas-parser-node-mcp"], "env": { - "CAS_PARSER_API_KEY": "My API Key", - "CAS_PARSER_ENVIRONMENT": "production" + "CAS_PARSER_API_KEY": "My API Key" } } } diff --git a/packages/mcp-server/manifest.json b/packages/mcp-server/manifest.json index d6d4673..92f1077 100644 --- a/packages/mcp-server/manifest.json +++ b/packages/mcp-server/manifest.json @@ -12,7 +12,7 @@ "url": "git+https://github.com/CASParser/cas-parser-node.git" }, "homepage": "https://github.com/CASParser/cas-parser-node/tree/main/packages/mcp-server#readme", - "documentation": "https://docs.casparser.in", + "documentation": "https://casparser.in/docs", "server": { "type": "node", "entry_point": "index.js", diff --git a/packages/mcp-server/src/code-tool.ts b/packages/mcp-server/src/code-tool.ts index 0fdea1a..496459f 100644 --- a/packages/mcp-server/src/code-tool.ts +++ b/packages/mcp-server/src/code-tool.ts @@ -103,17 +103,14 @@ export function codeTool({ blockedMethods }: { blockedMethods: SdkMethod[] | und readEnv('CAS_PARSER_API_KEY') ?? client.apiKey, 'set CAS_PARSER_API_KEY environment variable or provide apiKey client option', ), - CAS_PARSER_BASE_URL: - readEnv('CAS_PARSER_BASE_URL') ?? readEnv('CAS_PARSER_ENVIRONMENT') ? - undefined - : client.baseURL ?? undefined, + CAS_PARSER_BASE_URL: readEnv('CAS_PARSER_BASE_URL') ?? client.baseURL ?? undefined, }), }, body: JSON.stringify({ project_name: 'cas-parser', code, intent, - client_opts: { environment: (readEnv('CAS_PARSER_ENVIRONMENT') || undefined) as any }, + client_opts: {}, } satisfies WorkerInput), }); diff --git a/packages/mcp-server/src/server.ts b/packages/mcp-server/src/server.ts index aa20a3e..023ad5d 100644 --- a/packages/mcp-server/src/server.ts +++ b/packages/mcp-server/src/server.ts @@ -15,7 +15,6 @@ import { getInstructions } from './instructions'; import { McpOptions } from './options'; import { blockedMethodsForCodeTool } from './methods'; import { HandlerFunction, McpRequestContext, ToolCallResult, McpTool } from './types'; -import { readEnv } from './util'; export const newMcpServer = async (stainlessApiKey: string | undefined) => new McpServer( @@ -65,7 +64,6 @@ export async function initMcpServer(params: { if (!_client) { try { _client = new CasParser({ - ...{ environment: (readEnv('CAS_PARSER_ENVIRONMENT') || undefined) as any }, logger, ...params.clientOptions, defaultHeaders: { diff --git a/src/client.ts b/src/client.ts index 7a361c3..f9b1b81 100644 --- a/src/client.ts +++ b/src/client.ts @@ -71,13 +71,6 @@ import { } from './internal/utils/log'; import { isEmptyObj } from './internal/utils/values'; -const environments = { - production: 'https://portfolio-parser.api.casparser.in', - environment_1: 'https://client-apis.casparser.in', - environment_2: 'http://localhost:5000', -}; -type Environment = keyof typeof environments; - export interface ClientOptions { /** * Your API key for authentication. @@ -86,16 +79,6 @@ export interface ClientOptions { */ apiKey?: string | undefined; - /** - * Specifies the environment to use for the API. - * - * Each environment maps to a different base URL: - * - `production` corresponds to `https://portfolio-parser.api.casparser.in` - * - `environment_1` corresponds to `https://client-apis.casparser.in` - * - `environment_2` corresponds to `http://localhost:5000` - */ - environment?: Environment | undefined; - /** * Override the default base URL for the API, e.g., "https://api.example.com/v2/" * @@ -187,8 +170,7 @@ export class CasParser { * API Client for interfacing with the Cas Parser API. * * @param {string | undefined} [opts.apiKey=process.env['CAS_PARSER_API_KEY'] ?? undefined] - * @param {Environment} [opts.environment=production] - Specifies the environment URL to use for the API. - * @param {string} [opts.baseURL=process.env['CAS_PARSER_BASE_URL'] ?? https://portfolio-parser.api.casparser.in] - Override the default base URL for the API. + * @param {string} [opts.baseURL=process.env['CAS_PARSER_BASE_URL'] ?? https://api.casparser.in] - Override the default base URL for the API. * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out. * @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls. * @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation. @@ -210,17 +192,10 @@ export class CasParser { const options: ClientOptions = { apiKey, ...opts, - baseURL, - environment: opts.environment ?? 'production', + baseURL: baseURL || `https://api.casparser.in`, }; - if (baseURL && opts.environment) { - throw new Errors.CasParserError( - 'Ambiguous URL; The `baseURL` option (or CAS_PARSER_BASE_URL env var) and the `environment` option are given. If you want to use the environment you must pass baseURL: null', - ); - } - - this.baseURL = options.baseURL || environments[options.environment || 'production']; + this.baseURL = options.baseURL!; this.timeout = options.timeout ?? CasParser.DEFAULT_TIMEOUT /* 1 minute */; this.logger = options.logger ?? console; const defaultLogLevel = 'warn'; @@ -246,8 +221,7 @@ export class CasParser { withOptions(options: Partial): this { const client = new (this.constructor as any as new (props: ClientOptions) => typeof this)({ ...this._options, - environment: options.environment ? options.environment : undefined, - baseURL: options.environment ? undefined : this.baseURL, + baseURL: this.baseURL, maxRetries: this.maxRetries, timeout: this.timeout, logger: this.logger, @@ -264,7 +238,7 @@ export class CasParser { * Check whether the base URL is set to its default. */ #baseURLOverridden(): boolean { - return this.baseURL !== environments[this._options.environment || 'production']; + return this.baseURL !== 'https://api.casparser.in'; } protected defaultQuery(): Record | undefined { diff --git a/tests/index.test.ts b/tests/index.test.ts index 05dea86..55de457 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -322,30 +322,13 @@ describe('instantiate client', () => { test('empty env variable', () => { process.env['CAS_PARSER_BASE_URL'] = ''; // empty const client = new CasParser({ apiKey: 'My API Key' }); - expect(client.baseURL).toEqual('https://portfolio-parser.api.casparser.in'); + expect(client.baseURL).toEqual('https://api.casparser.in'); }); test('blank env variable', () => { process.env['CAS_PARSER_BASE_URL'] = ' '; // blank const client = new CasParser({ apiKey: 'My API Key' }); - expect(client.baseURL).toEqual('https://portfolio-parser.api.casparser.in'); - }); - - test('env variable with environment', () => { - process.env['CAS_PARSER_BASE_URL'] = 'https://example.com/from_env'; - - expect( - () => new CasParser({ apiKey: 'My API Key', environment: 'production' }), - ).toThrowErrorMatchingInlineSnapshot( - `"Ambiguous URL; The \`baseURL\` option (or CAS_PARSER_BASE_URL env var) and the \`environment\` option are given. If you want to use the environment you must pass baseURL: null"`, - ); - - const client = new CasParser({ - apiKey: 'My API Key', - baseURL: null, - environment: 'production', - }); - expect(client.baseURL).toEqual('https://portfolio-parser.api.casparser.in'); + expect(client.baseURL).toEqual('https://api.casparser.in'); }); test('in request options', () => { From 2826ef64368365d4294e493ce03ffa7423c7ff4a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 23 Feb 2026 03:22:36 +0000 Subject: [PATCH 2/2] release: 1.9.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ package.json | 2 +- packages/mcp-server/manifest.json | 2 +- packages/mcp-server/package.json | 2 +- packages/mcp-server/src/server.ts | 2 +- src/version.ts | 2 +- 7 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 099626f..4fcfdf7 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.8.0" + ".": "1.9.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 02e2bc3..eec4bb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 1.9.0 (2026-02-23) + +Full Changelog: [v1.8.0...v1.9.0](https://github.com/CASParser/cas-parser-node/compare/v1.8.0...v1.9.0) + +### Features + +* **api:** manual updates ([75ec0c8](https://github.com/CASParser/cas-parser-node/commit/75ec0c8875f5ac06ef72fff853114efd020e20e0)) + ## 1.8.0 (2026-02-23) Full Changelog: [v1.7.2...v1.8.0](https://github.com/CASParser/cas-parser-node/compare/v1.7.2...v1.8.0) diff --git a/package.json b/package.json index 9ee2bf9..66df182 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cas-parser-node", - "version": "1.8.0", + "version": "1.9.0", "description": "The official TypeScript library for the Cas Parser API", "author": "Cas Parser ", "types": "dist/index.d.ts", diff --git a/packages/mcp-server/manifest.json b/packages/mcp-server/manifest.json index 92f1077..d0fc12f 100644 --- a/packages/mcp-server/manifest.json +++ b/packages/mcp-server/manifest.json @@ -1,7 +1,7 @@ { "dxt_version": "0.2", "name": "cas-parser-node-mcp", - "version": "1.8.0", + "version": "1.9.0", "description": "The official MCP Server for the Cas Parser API", "author": { "name": "Cas Parser", diff --git a/packages/mcp-server/package.json b/packages/mcp-server/package.json index 2ef90ea..3b26ec9 100644 --- a/packages/mcp-server/package.json +++ b/packages/mcp-server/package.json @@ -1,6 +1,6 @@ { "name": "cas-parser-node-mcp", - "version": "1.8.0", + "version": "1.9.0", "description": "The official MCP Server for the Cas Parser API", "author": "Cas Parser ", "types": "dist/index.d.ts", diff --git a/packages/mcp-server/src/server.ts b/packages/mcp-server/src/server.ts index 023ad5d..88bdceb 100644 --- a/packages/mcp-server/src/server.ts +++ b/packages/mcp-server/src/server.ts @@ -20,7 +20,7 @@ export const newMcpServer = async (stainlessApiKey: string | undefined) => new McpServer( { name: 'cas_parser_node_api', - version: '1.8.0', + version: '1.9.0', }, { instructions: await getInstructions(stainlessApiKey), diff --git a/src/version.ts b/src/version.ts index 29d3ce7..d6d803f 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '1.8.0'; // x-release-please-version +export const VERSION = '1.9.0'; // x-release-please-version