From 2361eff0fb2b2cad4781d0bcf3cbe04524446732 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 14 Feb 2026 00:57:13 +0000 Subject: [PATCH 1/5] chore: update SDK settings --- .github/workflows/publish-npm.yml | 53 +++++++++++++++++++ .github/workflows/release-doctor.yml | 2 + .stats.yml | 2 +- CONTRIBUTING.md | 18 ++++++- README.md | 25 ++++----- bin/check-release-environment | 4 ++ eslint.config.mjs | 2 +- jest.config.ts | 4 +- package.json | 2 +- packages/mcp-server/Dockerfile | 4 +- packages/mcp-server/README.md | 52 ++++++++++-------- packages/mcp-server/build | 8 +-- packages/mcp-server/package.json | 2 +- .../mcp-server/scripts/copy-bundle-files.cjs | 2 +- .../scripts/postprocess-dist-package-json.cjs | 2 +- packages/mcp-server/src/auth.ts | 2 +- packages/mcp-server/src/code-tool-types.ts | 2 +- packages/mcp-server/src/code-tool.ts | 2 +- packages/mcp-server/src/http.ts | 2 +- packages/mcp-server/src/server.ts | 6 +-- packages/mcp-server/src/types.ts | 2 +- pnpm-lock.yaml | 2 +- pnpm-workspace.yaml | 2 +- scripts/build | 6 +-- tests/api-resources/access-token.test.ts | 2 +- tests/api-resources/cams-kfintech.test.ts | 2 +- tests/api-resources/cdsl/cdsl.test.ts | 2 +- tests/api-resources/cdsl/fetch.test.ts | 2 +- tests/api-resources/contract-note.test.ts | 2 +- tests/api-resources/credits.test.ts | 2 +- tests/api-resources/inbox.test.ts | 2 +- tests/api-resources/kfintech.test.ts | 2 +- tests/api-resources/logs.test.ts | 2 +- tests/api-resources/nsdl.test.ts | 2 +- tests/api-resources/smart.test.ts | 2 +- tests/api-resources/verify-token.test.ts | 2 +- tests/base64.test.ts | 2 +- tests/buildHeaders.test.ts | 2 +- tests/form.test.ts | 4 +- tests/index.test.ts | 6 +-- tests/path.test.ts | 2 +- tests/stringifyQuery.test.ts | 2 +- tests/uploads.test.ts | 6 +-- tsconfig.build.json | 4 +- tsconfig.json | 4 +- 45 files changed, 171 insertions(+), 93 deletions(-) create mode 100644 .github/workflows/publish-npm.yml diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml new file mode 100644 index 0000000..e4587ec --- /dev/null +++ b/.github/workflows/publish-npm.yml @@ -0,0 +1,53 @@ +# This workflow is triggered when a GitHub release is created. +# It can also be run manually to re-publish to NPM in case it failed for some reason. +# You can run this workflow by navigating to https://www.github.com/CASParser/cas-parser-node/actions/workflows/publish-npm.yml +name: Publish NPM +on: + workflow_dispatch: + inputs: + path: + description: The path to run the release in, e.g. '.' or 'packages/mcp-server' + required: true + + release: + types: [published] + +jobs: + publish: + name: publish + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - uses: actions/checkout@v6 + + - name: Set up Node + uses: actions/setup-node@v3 + with: + node-version: '20' + + - name: Set up pnpm + uses: pnpm/action-setup@v4 + + - name: Install dependencies + run: | + pnpm install + + - name: Publish to NPM + run: | + if [ -n "${{ github.event.inputs.path }}" ]; then + PATHS_RELEASED='[\"${{ github.event.inputs.path }}\"]' + else + PATHS_RELEASED='[\".\", \"packages/mcp-server\"]' + fi + pnpm tsn scripts/publish-packages.ts "{ \"paths_released\": \"$PATHS_RELEASED\" }" + env: + NPM_TOKEN: ${{ secrets.CAS_PARSER_NPM_TOKEN || secrets.NPM_TOKEN }} + + - name: Upload MCP Server DXT GitHub release asset + run: | + gh release upload ${{ github.event.release.tag_name }} \ + packages/mcp-server/cas_parser_node_api.mcpb + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 2e65d84..51427fc 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -17,4 +17,6 @@ jobs: - name: Check release environment run: | bash ./bin/check-release-environment + env: + NPM_TOKEN: ${{ secrets.CAS_PARSER_NPM_TOKEN || secrets.NPM_TOKEN }} diff --git a/.stats.yml b/.stats.yml index 8759db3..8281628 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 17 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser%2Fcas-parser-56b0f699c5437d9e5326626d35dfc972c17d01f12cb416c7f4854c8ea6d0e95e.yml openapi_spec_hash: 158f405c1880706266d83e6ff16b9d2f -config_hash: 7d8b6bdc6c935a3e6dd7092667c00a5e +config_hash: bb1b61e2661a7ef2d197a0d4012e9e8a diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 26c2031..ce6f8cc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -55,12 +55,12 @@ $ cd cas-parser-node # With yarn $ yarn link $ cd ../my-package -$ yarn link cas-parser +$ yarn link cas-parser-node # With pnpm $ pnpm link --global $ cd ../my-package -$ pnpm link -—global cas-parser +$ pnpm link -—global cas-parser-node ``` ## Running tests @@ -91,3 +91,17 @@ To format and fix all lint issues automatically: ```sh $ pnpm fix ``` + +## Publishing and releases + +Changes made to this repository via the automated release PR pipeline should publish to npm automatically. If +the changes aren't made through the automated pipeline, you may want to make releases manually. + +### Publish with a GitHub workflow + +You can release to package managers by using [the `Publish NPM` GitHub action](https://www.github.com/CASParser/cas-parser-node/actions/workflows/publish-npm.yml). This requires a setup organization or repository secret to be set up. + +### Publish manually + +If you need to manually release a package, you can run the `bin/publish-npm` script with an `NPM_TOKEN` set on +the environment. diff --git a/README.md b/README.md index 644fefb..7dd5aae 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Cas Parser TypeScript API Library -[![NPM version]()](https://npmjs.org/package/cas-parser) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/cas-parser) +[![NPM version]()](https://npmjs.org/package/cas-parser-node) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/cas-parser-node) This library provides convenient access to the Cas Parser REST API from server-side TypeScript or JavaScript. @@ -20,19 +20,16 @@ Use the Cas Parser MCP Server to enable AI assistants to interact with this API, ## Installation ```sh -npm install git+ssh://git@github.com:CASParser/cas-parser-node.git +npm install cas-parser-node ``` -> [!NOTE] -> Once this package is [published to npm](https://www.stainless.com/docs/guides/publish), this will become: `npm install cas-parser` - ## Usage The full API of this library can be found in [api.md](api.md). ```js -import CasParser from 'cas-parser'; +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 @@ -50,7 +47,7 @@ This library includes TypeScript definitions for all request params and response ```ts -import CasParser from 'cas-parser'; +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 @@ -173,7 +170,7 @@ The log level can be configured in two ways: 2. Using the `logLevel` client option (overrides the environment variable if set) ```ts -import CasParser from 'cas-parser'; +import CasParser from 'cas-parser-node'; const client = new CasParser({ logLevel: 'debug', // Show all log messages @@ -201,7 +198,7 @@ When providing a custom logger, the `logLevel` option still controls which messa below the configured level will not be sent to your logger. ```ts -import CasParser from 'cas-parser'; +import CasParser from 'cas-parser-node'; import pino from 'pino'; const logger = pino(); @@ -270,7 +267,7 @@ globalThis.fetch = fetch; Or pass it to the client: ```ts -import CasParser from 'cas-parser'; +import CasParser from 'cas-parser-node'; import fetch from 'my-fetch'; const client = new CasParser({ fetch }); @@ -281,7 +278,7 @@ const client = new CasParser({ fetch }); If you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.) ```ts -import CasParser from 'cas-parser'; +import CasParser from 'cas-parser-node'; const client = new CasParser({ fetchOptions: { @@ -298,7 +295,7 @@ options to requests: **Node** [[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)] ```ts -import CasParser from 'cas-parser'; +import CasParser from 'cas-parser-node'; import * as undici from 'undici'; const proxyAgent = new undici.ProxyAgent('http://localhost:8888'); @@ -312,7 +309,7 @@ const client = new CasParser({ **Bun** [[docs](https://bun.sh/guides/http/proxy)] ```ts -import CasParser from 'cas-parser'; +import CasParser from 'cas-parser-node'; const client = new CasParser({ fetchOptions: { @@ -324,7 +321,7 @@ const client = new CasParser({ **Deno** [[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)] ```ts -import CasParser from 'npm:cas-parser'; +import CasParser from 'npm:cas-parser-node'; const httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } }); const client = new CasParser({ diff --git a/bin/check-release-environment b/bin/check-release-environment index 6b43775..e4b6d58 100644 --- a/bin/check-release-environment +++ b/bin/check-release-environment @@ -2,6 +2,10 @@ errors=() +if [ -z "${NPM_TOKEN}" ]; then + errors+=("The NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets") +fi + lenErrors=${#errors[@]} if [[ lenErrors -gt 0 ]]; then diff --git a/eslint.config.mjs b/eslint.config.mjs index e400c96..4ca093b 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -25,7 +25,7 @@ export default tseslint.config( { patterns: [ { - regex: '^cas-parser(/.*)?', + regex: '^cas-parser-node(/.*)?', message: 'Use a relative import, not a package import.', }, ], diff --git a/jest.config.ts b/jest.config.ts index 3db32c3..326a9b5 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -7,8 +7,8 @@ const config: JestConfigWithTsJest = { '^.+\\.(t|j)sx?$': ['@swc/jest', { sourceMaps: 'inline' }], }, moduleNameMapper: { - '^cas-parser$': '/src/index.ts', - '^cas-parser/(.*)$': '/src/$1', + '^cas-parser-node$': '/src/index.ts', + '^cas-parser-node/(.*)$': '/src/$1', }, modulePathIgnorePatterns: [ '/ecosystem-tests/', diff --git a/package.json b/package.json index 6a73a29..b8d324f 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "cas-parser", + "name": "cas-parser-node", "version": "1.6.1", "description": "The official TypeScript library for the Cas Parser API", "author": "Cas Parser ", diff --git a/packages/mcp-server/Dockerfile b/packages/mcp-server/Dockerfile index e7c7d7c..dd64eab 100644 --- a/packages/mcp-server/Dockerfile +++ b/packages/mcp-server/Dockerfile @@ -55,8 +55,8 @@ WORKDIR /app # Copy the build results, preserving directory structure COPY --from=builder /build . -# Copy the built cas-parser into node_modules -COPY --from=builder /build/dist ./node_modules/cas-parser +# Copy the built cas-parser-node into node_modules +COPY --from=builder /build/dist ./node_modules/cas-parser-node # Change ownership to nodejs user RUN chown -R nodejs:nodejs /app diff --git a/packages/mcp-server/README.md b/packages/mcp-server/README.md index c45daee..816bfdd 100644 --- a/packages/mcp-server/README.md +++ b/packages/mcp-server/README.md @@ -4,33 +4,18 @@ It is generated with [Stainless](https://www.stainless.com/). ## Installation -### Building +### Direct invocation -Because it's not published yet, clone the repo and build it: +You can run the MCP Server directly via `npx`: ```sh -git clone git@github.com:CASParser/cas-parser-node.git -cd cas-parser-node -./scripts/bootstrap -./scripts/build -``` - -### Running - -```sh -# set env vars as needed export CAS_PARSER_API_KEY="My API Key" export CAS_PARSER_ENVIRONMENT="production" -node ./packages/mcp-server/dist/index.js +npx -y cas-parser-mcp@latest ``` -> [!NOTE] -> Once this package is [published to npm](https://www.stainless.com/docs/guides/publish), this will become: `npx -y cas-parser-mcp` - ### Via MCP Client -[Build the project](#building) as mentioned above. - There is a partial list of existing clients at [modelcontextprotocol.io](https://modelcontextprotocol.io/clients). If you already have a client, consult their documentation to install the MCP server. @@ -39,9 +24,9 @@ For clients with a configuration JSON, it might look something like this: ```json { "mcpServers": { - "cas_parser_api": { - "command": "node", - "args": ["/path/to/local/cas-parser-node/packages/mcp-server"], + "cas_parser_node_api": { + "command": "npx", + "args": ["-y", "cas-parser-mcp"], "env": { "CAS_PARSER_API_KEY": "My API Key", "CAS_PARSER_ENVIRONMENT": "production" @@ -51,6 +36,29 @@ For clients with a configuration JSON, it might look something like this: } ``` +### Cursor + +If you use Cursor, you can install the MCP server by using the button below. You will need to set your environment variables +in Cursor's `mcp.json`, which can be found in Cursor Settings > Tools & MCP > New MCP Server. + +[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=cas-parser-mcp&config=eyJuYW1lIjoiY2FzLXBhcnNlci1tY3AiLCJ0cmFuc3BvcnQiOiJodHRwIiwidXJsIjoiaHR0cHM6Ly9jYXMtcGFyc2VyLnN0bG1jcC5jb20iLCJoZWFkZXJzIjp7IngtYXBpLWtleSI6Ik15IEFQSSBLZXkifX0) + +### VS Code + +If you use MCP, you can install the MCP server by clicking the link below. You will need to set your environment variables +in VS Code's `mcp.json`, which can be found via Command Palette > MCP: Open User Configuration. + +[Open VS Code](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22cas-parser-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fcas-parser.stlmcp.com%22%2C%22headers%22%3A%7B%22x-api-key%22%3A%22My%20API%20Key%22%7D%7D) + +### Claude Code + +If you use Claude Code, you can install the MCP server by running the command below in your terminal. You will need to set your +environment variables in Claude Code's `.claude.json`, which can be found in your home directory. + +``` +claude mcp add cas_parser_mcp_api --header "x-api-key: My API Key" --transport http https://cas-parser.stlmcp.com +``` + ## Code Mode This MCP server is built on the "Code Mode" tool scheme. In this MCP Server, @@ -82,7 +90,7 @@ A configuration JSON for this server might look like this, assuming the server i ```json { "mcpServers": { - "cas_parser_api": { + "cas_parser_node_api": { "url": "http://localhost:3000", "headers": { "x-api-key": "My API Key" diff --git a/packages/mcp-server/build b/packages/mcp-server/build index fbef329..c71e083 100644 --- a/packages/mcp-server/build +++ b/packages/mcp-server/build @@ -19,7 +19,7 @@ done # and does a few other minor things PKG_JSON_PATH=../../packages/mcp-server/package.json node ../../scripts/utils/make-dist-package-json.cjs > dist/package.json -# updates the `cas-parser` dependency to point to NPM +# updates the `cas-parser-node` dependency to point to NPM node scripts/postprocess-dist-package-json.cjs # build to .js/.mjs/.d.ts files @@ -32,7 +32,7 @@ chmod +x dist/index.js DIST_PATH=./dist PKG_IMPORT_PATH=cas-parser-mcp/ node ../../scripts/utils/postprocess-files.cjs # mcp bundle -rm -rf dist-bundle cas_parser_api.mcpb; mkdir dist-bundle +rm -rf dist-bundle cas_parser_node_api.mcpb; mkdir dist-bundle # copy package.json PKG_JSON_PATH=../../packages/mcp-server/package.json node ../../scripts/utils/make-dist-package-json.cjs > dist-bundle/package.json @@ -48,9 +48,9 @@ cd .. # pack bundle cp manifest.json dist-bundle -npx mcpb pack dist-bundle cas_parser_api.mcpb +npx mcpb pack dist-bundle cas_parser_node_api.mcpb -npx mcpb sign cas_parser_api.mcpb --self-signed +npx mcpb sign cas_parser_node_api.mcpb --self-signed # clean up rm -rf dist-bundle diff --git a/packages/mcp-server/package.json b/packages/mcp-server/package.json index dd4c840..f46b233 100644 --- a/packages/mcp-server/package.json +++ b/packages/mcp-server/package.json @@ -29,7 +29,7 @@ "fix": "eslint --fix --ext ts,js ." }, "dependencies": { - "cas-parser": "workspace:*", + "cas-parser-node": "workspace:*", "@cloudflare/cabidela": "^0.2.4", "@modelcontextprotocol/sdk": "^1.25.2", "@valtown/deno-http-worker": "^0.0.21", diff --git a/packages/mcp-server/scripts/copy-bundle-files.cjs b/packages/mcp-server/scripts/copy-bundle-files.cjs index a089e44..6e832f8 100644 --- a/packages/mcp-server/scripts/copy-bundle-files.cjs +++ b/packages/mcp-server/scripts/copy-bundle-files.cjs @@ -25,7 +25,7 @@ async function copyFiles() { // replace package.json reference with local reference for (const dep in pkgJson.dependencies) { - if (dep === 'cas-parser') { + if (dep === 'cas-parser-node') { pkgJson.dependencies[dep] = 'file:../../../dist/'; } } diff --git a/packages/mcp-server/scripts/postprocess-dist-package-json.cjs b/packages/mcp-server/scripts/postprocess-dist-package-json.cjs index c0d39cb..39b8210 100644 --- a/packages/mcp-server/scripts/postprocess-dist-package-json.cjs +++ b/packages/mcp-server/scripts/postprocess-dist-package-json.cjs @@ -4,7 +4,7 @@ const parentPkgJson = require('../../../package.json'); for (const dep in pkgJson.dependencies) { // ensure we point to NPM instead of a local directory - if (dep === 'cas-parser') { + if (dep === 'cas-parser-node') { pkgJson.dependencies[dep] = '^' + parentPkgJson.version; } } diff --git a/packages/mcp-server/src/auth.ts b/packages/mcp-server/src/auth.ts index 1ad05f2..a867c58 100644 --- a/packages/mcp-server/src/auth.ts +++ b/packages/mcp-server/src/auth.ts @@ -1,7 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { IncomingMessage } from 'node:http'; -import { ClientOptions } from 'cas-parser'; +import { ClientOptions } from 'cas-parser-node'; export const parseAuthHeaders = (req: IncomingMessage, required?: boolean): Partial => { const apiKey = diff --git a/packages/mcp-server/src/code-tool-types.ts b/packages/mcp-server/src/code-tool-types.ts index a298e88..3d0838f 100644 --- a/packages/mcp-server/src/code-tool-types.ts +++ b/packages/mcp-server/src/code-tool-types.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { ClientOptions } from 'cas-parser'; +import { ClientOptions } from 'cas-parser-node'; export type WorkerInput = { project_name: string; diff --git a/packages/mcp-server/src/code-tool.ts b/packages/mcp-server/src/code-tool.ts index bc8815c..0cec16d 100644 --- a/packages/mcp-server/src/code-tool.ts +++ b/packages/mcp-server/src/code-tool.ts @@ -5,7 +5,7 @@ import { Tool } from '@modelcontextprotocol/sdk/types.js'; import { readEnv, requireValue } from './util'; import { WorkerInput, WorkerOutput } from './code-tool-types'; import { SdkMethod } from './methods'; -import { CasParser } from 'cas-parser'; +import { CasParser } from 'cas-parser-node'; const prompt = `Runs JavaScript code to interact with the Cas Parser API. diff --git a/packages/mcp-server/src/http.ts b/packages/mcp-server/src/http.ts index 32ba68f..d808262 100644 --- a/packages/mcp-server/src/http.ts +++ b/packages/mcp-server/src/http.ts @@ -2,7 +2,7 @@ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp'; import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js'; -import { ClientOptions } from 'cas-parser'; +import { ClientOptions } from 'cas-parser-node'; import express from 'express'; import morgan from 'morgan'; import morganBody from 'morgan-body'; diff --git a/packages/mcp-server/src/server.ts b/packages/mcp-server/src/server.ts index 8a04c15..5f1ab4e 100644 --- a/packages/mcp-server/src/server.ts +++ b/packages/mcp-server/src/server.ts @@ -7,8 +7,8 @@ import { ListToolsRequestSchema, SetLevelRequestSchema, } from '@modelcontextprotocol/sdk/types.js'; -import { ClientOptions } from 'cas-parser'; -import CasParser from 'cas-parser'; +import { ClientOptions } from 'cas-parser-node'; +import CasParser from 'cas-parser-node'; import { codeTool } from './code-tool'; import docsSearchTool from './docs-search-tool'; import { McpOptions } from './options'; @@ -55,7 +55,7 @@ async function getInstructions() { export const newMcpServer = async () => new McpServer( { - name: 'cas_parser_api', + name: 'cas_parser_node_api', version: '1.6.1', }, { diff --git a/packages/mcp-server/src/types.ts b/packages/mcp-server/src/types.ts index a48e446..36dd727 100644 --- a/packages/mcp-server/src/types.ts +++ b/packages/mcp-server/src/types.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import CasParser from 'cas-parser'; +import CasParser from 'cas-parser-node'; import { Tool } from '@modelcontextprotocol/sdk/types.js'; type TextContentBlock = { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9bf10c8..419dedb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -83,7 +83,7 @@ importers: '@valtown/deno-http-worker': specifier: ^0.0.21 version: 0.0.21 - cas-parser: + cas-parser-node: specifier: workspace:* version: link:../.. cookie-parser: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index aad23ee..a3ff7f0 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -4,4 +4,4 @@ onlyBuiltDependencies: - '@swc/core' minimumReleaseAge: 1440 minimumReleaseAgeExclude: - - cas-parser + - cas-parser-node diff --git a/scripts/build b/scripts/build index 9e7d67f..f26eca1 100755 --- a/scripts/build +++ b/scripts/build @@ -8,7 +8,7 @@ node scripts/utils/check-version.cjs # Build into dist and will publish the package from there, # so that src/resources/foo.ts becomes /resources/foo.js -# This way importing from `"cas-parser/resources/foo"` works +# This way importing from `"cas-parser-node/resources/foo"` works # even with `"moduleResolution": "node"` rm -rf dist; mkdir dist @@ -42,8 +42,8 @@ node scripts/utils/postprocess-files.cjs # make sure that nothing crashes when we require the output CJS or # import the output ESM -(cd dist && node -e 'require("cas-parser")') -(cd dist && node -e 'import("cas-parser")' --input-type=module) +(cd dist && node -e 'require("cas-parser-node")') +(cd dist && node -e 'import("cas-parser-node")' --input-type=module) if [ -e ./scripts/build-deno ] then diff --git a/tests/api-resources/access-token.test.ts b/tests/api-resources/access-token.test.ts index e3fc4b4..55ca752 100644 --- a/tests/api-resources/access-token.test.ts +++ b/tests/api-resources/access-token.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import CasParser from 'cas-parser'; +import CasParser from 'cas-parser-node'; const client = new CasParser({ apiKey: 'My API Key', diff --git a/tests/api-resources/cams-kfintech.test.ts b/tests/api-resources/cams-kfintech.test.ts index 424b2dd..71a0d43 100644 --- a/tests/api-resources/cams-kfintech.test.ts +++ b/tests/api-resources/cams-kfintech.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import CasParser from 'cas-parser'; +import CasParser from 'cas-parser-node'; const client = new CasParser({ apiKey: 'My API Key', diff --git a/tests/api-resources/cdsl/cdsl.test.ts b/tests/api-resources/cdsl/cdsl.test.ts index e0bd12d..47e8f17 100644 --- a/tests/api-resources/cdsl/cdsl.test.ts +++ b/tests/api-resources/cdsl/cdsl.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import CasParser from 'cas-parser'; +import CasParser from 'cas-parser-node'; const client = new CasParser({ apiKey: 'My API Key', diff --git a/tests/api-resources/cdsl/fetch.test.ts b/tests/api-resources/cdsl/fetch.test.ts index 7646037..a41c723 100644 --- a/tests/api-resources/cdsl/fetch.test.ts +++ b/tests/api-resources/cdsl/fetch.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import CasParser from 'cas-parser'; +import CasParser from 'cas-parser-node'; const client = new CasParser({ apiKey: 'My API Key', diff --git a/tests/api-resources/contract-note.test.ts b/tests/api-resources/contract-note.test.ts index a2b20a5..3327a12 100644 --- a/tests/api-resources/contract-note.test.ts +++ b/tests/api-resources/contract-note.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import CasParser from 'cas-parser'; +import CasParser from 'cas-parser-node'; const client = new CasParser({ apiKey: 'My API Key', diff --git a/tests/api-resources/credits.test.ts b/tests/api-resources/credits.test.ts index 2ba76c2..1090755 100644 --- a/tests/api-resources/credits.test.ts +++ b/tests/api-resources/credits.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import CasParser from 'cas-parser'; +import CasParser from 'cas-parser-node'; const client = new CasParser({ apiKey: 'My API Key', diff --git a/tests/api-resources/inbox.test.ts b/tests/api-resources/inbox.test.ts index c91b528..605455c 100644 --- a/tests/api-resources/inbox.test.ts +++ b/tests/api-resources/inbox.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import CasParser from 'cas-parser'; +import CasParser from 'cas-parser-node'; const client = new CasParser({ apiKey: 'My API Key', diff --git a/tests/api-resources/kfintech.test.ts b/tests/api-resources/kfintech.test.ts index 9b5dbe9..3b7e247 100644 --- a/tests/api-resources/kfintech.test.ts +++ b/tests/api-resources/kfintech.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import CasParser from 'cas-parser'; +import CasParser from 'cas-parser-node'; const client = new CasParser({ apiKey: 'My API Key', diff --git a/tests/api-resources/logs.test.ts b/tests/api-resources/logs.test.ts index d1f1406..0e8c0fc 100644 --- a/tests/api-resources/logs.test.ts +++ b/tests/api-resources/logs.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import CasParser from 'cas-parser'; +import CasParser from 'cas-parser-node'; const client = new CasParser({ apiKey: 'My API Key', diff --git a/tests/api-resources/nsdl.test.ts b/tests/api-resources/nsdl.test.ts index bf29a26..2016e03 100644 --- a/tests/api-resources/nsdl.test.ts +++ b/tests/api-resources/nsdl.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import CasParser from 'cas-parser'; +import CasParser from 'cas-parser-node'; const client = new CasParser({ apiKey: 'My API Key', diff --git a/tests/api-resources/smart.test.ts b/tests/api-resources/smart.test.ts index 3d31eb3..3abfd73 100644 --- a/tests/api-resources/smart.test.ts +++ b/tests/api-resources/smart.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import CasParser from 'cas-parser'; +import CasParser from 'cas-parser-node'; const client = new CasParser({ apiKey: 'My API Key', diff --git a/tests/api-resources/verify-token.test.ts b/tests/api-resources/verify-token.test.ts index d9e5b26..5c8bef4 100644 --- a/tests/api-resources/verify-token.test.ts +++ b/tests/api-resources/verify-token.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import CasParser from 'cas-parser'; +import CasParser from 'cas-parser-node'; const client = new CasParser({ apiKey: 'My API Key', diff --git a/tests/base64.test.ts b/tests/base64.test.ts index 8e1be56..45d4db7 100644 --- a/tests/base64.test.ts +++ b/tests/base64.test.ts @@ -1,4 +1,4 @@ -import { fromBase64, toBase64 } from 'cas-parser/internal/utils/base64'; +import { fromBase64, toBase64 } from 'cas-parser-node/internal/utils/base64'; describe.each(['Buffer', 'atob'])('with %s', (mode) => { let originalBuffer: BufferConstructor; diff --git a/tests/buildHeaders.test.ts b/tests/buildHeaders.test.ts index c98d1fe..276b732 100644 --- a/tests/buildHeaders.test.ts +++ b/tests/buildHeaders.test.ts @@ -1,5 +1,5 @@ import { inspect } from 'node:util'; -import { buildHeaders, type HeadersLike, type NullableHeaders } from 'cas-parser/internal/headers'; +import { buildHeaders, type HeadersLike, type NullableHeaders } from 'cas-parser-node/internal/headers'; function inspectNullableHeaders(headers: NullableHeaders) { return `NullableHeaders {${[ diff --git a/tests/form.test.ts b/tests/form.test.ts index ff9dc66..5fd6578 100644 --- a/tests/form.test.ts +++ b/tests/form.test.ts @@ -1,5 +1,5 @@ -import { multipartFormRequestOptions, createForm } from 'cas-parser/internal/uploads'; -import { toFile } from 'cas-parser/core/uploads'; +import { multipartFormRequestOptions, createForm } from 'cas-parser-node/internal/uploads'; +import { toFile } from 'cas-parser-node/core/uploads'; describe('form data validation', () => { test('valid values do not error', async () => { diff --git a/tests/index.test.ts b/tests/index.test.ts index 094b172..05dea86 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIPromise } from 'cas-parser/core/api-promise'; +import { APIPromise } from 'cas-parser-node/core/api-promise'; import util from 'node:util'; -import CasParser from 'cas-parser'; -import { APIUserAbortError } from 'cas-parser'; +import CasParser from 'cas-parser-node'; +import { APIUserAbortError } from 'cas-parser-node'; const defaultFetch = fetch; describe('instantiate client', () => { diff --git a/tests/path.test.ts b/tests/path.test.ts index 9f70a94..129e95f 100644 --- a/tests/path.test.ts +++ b/tests/path.test.ts @@ -1,4 +1,4 @@ -import { createPathTagFunction, encodeURIPath } from 'cas-parser/internal/utils/path'; +import { createPathTagFunction, encodeURIPath } from 'cas-parser-node/internal/utils/path'; import { inspect } from 'node:util'; import { runInNewContext } from 'node:vm'; diff --git a/tests/stringifyQuery.test.ts b/tests/stringifyQuery.test.ts index 91b8d25..ec0e56d 100644 --- a/tests/stringifyQuery.test.ts +++ b/tests/stringifyQuery.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { CasParser } from 'cas-parser'; +import { CasParser } from 'cas-parser-node'; const { stringifyQuery } = CasParser.prototype as any; diff --git a/tests/uploads.test.ts b/tests/uploads.test.ts index 7c2540f..f833a5f 100644 --- a/tests/uploads.test.ts +++ b/tests/uploads.test.ts @@ -1,6 +1,6 @@ import fs from 'fs'; -import type { ResponseLike } from 'cas-parser/internal/to-file'; -import { toFile } from 'cas-parser/core/uploads'; +import type { ResponseLike } from 'cas-parser-node/internal/to-file'; +import { toFile } from 'cas-parser-node/core/uploads'; import { File } from 'node:buffer'; class MyClass { @@ -97,7 +97,7 @@ describe('missing File error message', () => { }); test('is thrown', async () => { - const uploads = await import('cas-parser/core/uploads'); + const uploads = await import('cas-parser-node/core/uploads'); await expect( uploads.toFile(mockResponse({ url: 'https://example.com/my/audio.mp3' })), ).rejects.toMatchInlineSnapshot( diff --git a/tsconfig.build.json b/tsconfig.build.json index 9ca35ee..bc46a37 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -5,8 +5,8 @@ "compilerOptions": { "rootDir": "./dist/src", "paths": { - "cas-parser/*": ["./dist/src/*"], - "cas-parser": ["./dist/src/index.ts"] + "cas-parser-node/*": ["./dist/src/*"], + "cas-parser-node": ["./dist/src/index.ts"] }, "noEmit": false, "declaration": true, diff --git a/tsconfig.json b/tsconfig.json index 4055854..dbd3476 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,8 +8,8 @@ "moduleResolution": "node", "esModuleInterop": true, "paths": { - "cas-parser/*": ["./src/*"], - "cas-parser": ["./src/index.ts"] + "cas-parser-node/*": ["./src/*"], + "cas-parser-node": ["./src/index.ts"] }, "noEmit": true, From 05b29e9d60bfd19087cb14cabc32f2c8221e8e8a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 14 Feb 2026 00:57:29 +0000 Subject: [PATCH 2/5] chore: update SDK settings --- .github/workflows/publish-npm.yml | 3 +-- .github/workflows/release-doctor.yml | 2 -- .stats.yml | 2 +- bin/check-release-environment | 4 ---- bin/publish-npm | 12 ++++++++++-- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index e4587ec..99b7abe 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -18,6 +18,7 @@ jobs: runs-on: ubuntu-latest permissions: contents: write + id-token: write steps: - uses: actions/checkout@v6 @@ -42,8 +43,6 @@ jobs: PATHS_RELEASED='[\".\", \"packages/mcp-server\"]' fi pnpm tsn scripts/publish-packages.ts "{ \"paths_released\": \"$PATHS_RELEASED\" }" - env: - NPM_TOKEN: ${{ secrets.CAS_PARSER_NPM_TOKEN || secrets.NPM_TOKEN }} - name: Upload MCP Server DXT GitHub release asset run: | diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 51427fc..2e65d84 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -17,6 +17,4 @@ jobs: - name: Check release environment run: | bash ./bin/check-release-environment - env: - NPM_TOKEN: ${{ secrets.CAS_PARSER_NPM_TOKEN || secrets.NPM_TOKEN }} diff --git a/.stats.yml b/.stats.yml index 8281628..415d8d1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 17 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser%2Fcas-parser-56b0f699c5437d9e5326626d35dfc972c17d01f12cb416c7f4854c8ea6d0e95e.yml openapi_spec_hash: 158f405c1880706266d83e6ff16b9d2f -config_hash: bb1b61e2661a7ef2d197a0d4012e9e8a +config_hash: 97b6c66e88343f85b8b173ee4457919f diff --git a/bin/check-release-environment b/bin/check-release-environment index e4b6d58..6b43775 100644 --- a/bin/check-release-environment +++ b/bin/check-release-environment @@ -2,10 +2,6 @@ errors=() -if [ -z "${NPM_TOKEN}" ]; then - errors+=("The NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets") -fi - lenErrors=${#errors[@]} if [[ lenErrors -gt 0 ]]; then diff --git a/bin/publish-npm b/bin/publish-npm index a609989..4e094d7 100644 --- a/bin/publish-npm +++ b/bin/publish-npm @@ -2,7 +2,12 @@ set -eux -npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN" +if [[ ${NPM_TOKEN:-} ]]; then + npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN" +elif [[ ! ${ACTIONS_ID_TOKEN_REQUEST_TOKEN:-} ]]; then + echo "ERROR: NPM_TOKEN must be set if not running in a Github Action with id-token permission" + exit 1 +fi pnpm build cd dist @@ -57,5 +62,8 @@ else TAG="latest" fi +# Install OIDC compatible npm version +npm install --prefix ../oidc/ npm@11.6.2 + # Publish with the appropriate tag -pnpm publish --no-git-checks --tag "$TAG" +pnpm publish --npm-path "$(cd ../ && pwd)/oidc/node_modules/.bin/npm" --no-git-checks --tag "$TAG" From b80451a92e721149579c3b5ea238da1d962473ee Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 14 Feb 2026 00:58:41 +0000 Subject: [PATCH 3/5] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 415d8d1..a41a618 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 17 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser%2Fcas-parser-56b0f699c5437d9e5326626d35dfc972c17d01f12cb416c7f4854c8ea6d0e95e.yml openapi_spec_hash: 158f405c1880706266d83e6ff16b9d2f -config_hash: 97b6c66e88343f85b8b173ee4457919f +config_hash: 11ccfc363acca397f243709a8a097bb7 From 8aadcb32da8964c0646e5a5490f87a7c15f2577f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 14 Feb 2026 00:58:59 +0000 Subject: [PATCH 4/5] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index a41a618..e7c969a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 17 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser%2Fcas-parser-56b0f699c5437d9e5326626d35dfc972c17d01f12cb416c7f4854c8ea6d0e95e.yml openapi_spec_hash: 158f405c1880706266d83e6ff16b9d2f -config_hash: 11ccfc363acca397f243709a8a097bb7 +config_hash: e78bb30ba7c06b2a6d20092a5872aec2 From 924657693e358d6f2fb66cce6151bf871b4487ce Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 14 Feb 2026 00:59:13 +0000 Subject: [PATCH 5/5] release: 1.6.2 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 9 +++++++++ package.json | 2 +- packages/mcp-server/package.json | 2 +- packages/mcp-server/src/server.ts | 2 +- src/version.ts | 2 +- 6 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 093be7e..9464c4e 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.6.1" + ".": "1.6.2" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 3853bc4..77cde51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 1.6.2 (2026-02-14) + +Full Changelog: [v1.6.1...v1.6.2](https://github.com/CASParser/cas-parser-node/compare/v1.6.1...v1.6.2) + +### Chores + +* update SDK settings ([05b29e9](https://github.com/CASParser/cas-parser-node/commit/05b29e9d60bfd19087cb14cabc32f2c8221e8e8a)) +* update SDK settings ([2361eff](https://github.com/CASParser/cas-parser-node/commit/2361eff0fb2b2cad4781d0bcf3cbe04524446732)) + ## 1.6.1 (2026-02-14) Full Changelog: [v1.6.0...v1.6.1](https://github.com/CASParser/cas-parser-node/compare/v1.6.0...v1.6.1) diff --git a/package.json b/package.json index b8d324f..1d40f66 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cas-parser-node", - "version": "1.6.1", + "version": "1.6.2", "description": "The official TypeScript library for the Cas Parser API", "author": "Cas Parser ", "types": "dist/index.d.ts", diff --git a/packages/mcp-server/package.json b/packages/mcp-server/package.json index f46b233..12e618f 100644 --- a/packages/mcp-server/package.json +++ b/packages/mcp-server/package.json @@ -1,6 +1,6 @@ { "name": "cas-parser-mcp", - "version": "1.6.1", + "version": "1.6.2", "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 5f1ab4e..b50ce6f 100644 --- a/packages/mcp-server/src/server.ts +++ b/packages/mcp-server/src/server.ts @@ -56,7 +56,7 @@ export const newMcpServer = async () => new McpServer( { name: 'cas_parser_node_api', - version: '1.6.1', + version: '1.6.2', }, { instructions: await getInstructions(), diff --git a/src/version.ts b/src/version.ts index e52c280..706f69e 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '1.6.1'; // x-release-please-version +export const VERSION = '1.6.2'; // x-release-please-version