diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 5677a32..46e7a46 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.16.0" + ".": "1.17.0" } diff --git a/.stats.yml b/.stats.yml index e7b8198..c12f542 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 20 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser/cas-parser-cd8e042a9746bbe9bd180614fccc7597b85f4e8f6a29da6cd2f4cbf831fb2fbe.yml -openapi_spec_hash: e27c0d9cd8cdeb348c88e6c4e8777e39 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser/cas-parser-4d179917b01ea51a3325e7b37ecbbb60d0ba8f60381fe715ff3ec31284ca8042.yml +openapi_spec_hash: d027d37bd7051aa8c05fe1820c05b316 config_hash: 5509bb7a961ae2e79114b24c381606d4 diff --git a/CHANGELOG.md b/CHANGELOG.md index f74863c..2affcf5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 1.17.0 (2026-08-09) + +Full Changelog: [v1.16.0...v1.17.0](https://github.com/CASParser/cas-parser-node/compare/v1.16.0...v1.17.0) + +### Features + +* **api:** api update ([ffacb36](https://github.com/CASParser/cas-parser-node/commit/ffacb36d09eb78282047b9e895d565a771c18010)) +* **api:** api update ([369435d](https://github.com/CASParser/cas-parser-node/commit/369435dd43b66a0e9ad47bb7a1c64c859fe5d58c)) + ## 1.16.0 (2026-08-02) Full Changelog: [v1.15.0...v1.16.0](https://github.com/CASParser/cas-parser-node/compare/v1.15.0...v1.16.0) diff --git a/package.json b/package.json index 044f0f7..52f9934 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cas-parser-node", - "version": "1.16.0", + "version": "1.17.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 ac156c0..a9873fb 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.16.0", + "version": "1.17.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 744958c..33e3065 100644 --- a/packages/mcp-server/package.json +++ b/packages/mcp-server/package.json @@ -1,6 +1,6 @@ { "name": "cas-parser-node-mcp", - "version": "1.16.0", + "version": "1.17.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/local-docs-search.ts b/packages/mcp-server/src/local-docs-search.ts index 485dfef..859438f 100644 --- a/packages/mcp-server/src/local-docs-search.ts +++ b/packages/mcp-server/src/local-docs-search.ts @@ -566,23 +566,24 @@ const EMBEDDED_METHODS: MethodEntry[] = [ httpMethod: 'post', summary: 'Connect Email Provider (Initiate OAuth)', description: - "Initiate OAuth flow to connect user's email inbox.\n\nReturns an `oauth_url` that you should redirect the user to. After authorization,\nthey are redirected back to your `redirect_uri` with the following query parameters:\n\n**On success:**\n- `inbox_token` - Encrypted token to store client-side\n- `email` - Email address of the connected account\n- `state` - Your original state parameter (for CSRF verification)\n\n**On error:**\n- `error` - Error code (e.g., `access_denied`, `token_exchange_failed`)\n- `state` - Your original state parameter\n\n**Store the `inbox_token` client-side** and use it for all subsequent inbox API calls.\n", + "Initiate OAuth flow to connect user's email inbox.\n\nReturns an `oauth_url` that you should redirect the user to. After authorization,\nthey are redirected back to your `redirect_uri` with the following query parameters:\n\n**On success:**\n- `inbox_token` - Encrypted token to store client-side\n- `email` - Email address of the connected account\n- `state` - Your original state parameter (for CSRF verification)\n\n**On error:**\n- `error` - Error code (e.g., `access_denied`, `token_exchange_failed`)\n- `state` - Your original state parameter\n\n**Store the `inbox_token` client-side** and use it for all subsequent inbox API calls.\nThe token is long-lived (it stores an encrypted refresh token), so a single OAuth\nconnect gives ongoing access to both historical and future CAS statements in the\nuser's inbox. Reuse the same token until the user revokes access via\n`/v4/inbox/disconnect` or their provider's account settings.\n", stainlessPath: '(resource) inbox > (method) connect_email', qualified: 'client.inbox.connectEmail', - params: ['redirect_uri: string;', 'state?: string;'], - response: '{ expires_in?: number; oauth_url?: string; status?: string; }', + params: ['redirect_uri: string;', "provider?: 'gmail' | 'outlook' | 'zoho';", 'state?: string;'], + response: + "{ expires_in?: number; oauth_url?: string; provider?: 'gmail' | 'outlook' | 'zoho'; status?: string; }", markdown: - "## connect_email\n\n`client.inbox.connectEmail(redirect_uri: string, state?: string): { expires_in?: number; oauth_url?: string; status?: string; }`\n\n**post** `/v4/inbox/connect`\n\nInitiate OAuth flow to connect user's email inbox.\n\nReturns an `oauth_url` that you should redirect the user to. After authorization,\nthey are redirected back to your `redirect_uri` with the following query parameters:\n\n**On success:**\n- `inbox_token` - Encrypted token to store client-side\n- `email` - Email address of the connected account\n- `state` - Your original state parameter (for CSRF verification)\n\n**On error:**\n- `error` - Error code (e.g., `access_denied`, `token_exchange_failed`)\n- `state` - Your original state parameter\n\n**Store the `inbox_token` client-side** and use it for all subsequent inbox API calls.\n\n\n### Parameters\n\n- `redirect_uri: string`\n Your callback URL to receive the inbox_token (must be http or https)\n\n- `state?: string`\n State parameter for CSRF protection (returned in redirect)\n\n### Returns\n\n- `{ expires_in?: number; oauth_url?: string; status?: string; }`\n\n - `expires_in?: number`\n - `oauth_url?: string`\n - `status?: string`\n\n### Example\n\n```typescript\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser();\n\nconst response = await client.inbox.connectEmail({ redirect_uri: 'https://yourapp.com/oauth-callback' });\n\nconsole.log(response);\n```", + "## connect_email\n\n`client.inbox.connectEmail(redirect_uri: string, provider?: 'gmail' | 'outlook' | 'zoho', state?: string): { expires_in?: number; oauth_url?: string; provider?: 'gmail' | 'outlook' | 'zoho'; status?: string; }`\n\n**post** `/v4/inbox/connect`\n\nInitiate OAuth flow to connect user's email inbox.\n\nReturns an `oauth_url` that you should redirect the user to. After authorization,\nthey are redirected back to your `redirect_uri` with the following query parameters:\n\n**On success:**\n- `inbox_token` - Encrypted token to store client-side\n- `email` - Email address of the connected account\n- `state` - Your original state parameter (for CSRF verification)\n\n**On error:**\n- `error` - Error code (e.g., `access_denied`, `token_exchange_failed`)\n- `state` - Your original state parameter\n\n**Store the `inbox_token` client-side** and use it for all subsequent inbox API calls.\nThe token is long-lived (it stores an encrypted refresh token), so a single OAuth\nconnect gives ongoing access to both historical and future CAS statements in the\nuser's inbox. Reuse the same token until the user revokes access via\n`/v4/inbox/disconnect` or their provider's account settings.\n\n\n### Parameters\n\n- `redirect_uri: string`\n Your callback URL to receive the inbox_token (must be http or https)\n\n- `provider?: 'gmail' | 'outlook' | 'zoho'`\n Mail provider to connect. Defaults to `gmail`.\n\n- `gmail` - Google accounts: `@gmail.com` and Google\n Workspace domains.\n- `outlook` - personal Microsoft accounts: `@outlook.com`,\n `@hotmail.com`, `@live.com`, `@msn.com` and localised\n variants (`@hotmail.co.uk`, `@live.in`, `@hotmail.fr`).\n Any other address registered as a personal Microsoft\n account also works, including custom domains.\n- `zoho` - Zoho Mail accounts, including custom domains\n hosted on Zoho.\n\nAny unrecognised value is treated as `gmail`. The resolved\nprovider is returned in the response.\n\n- `state?: string`\n State parameter for CSRF protection (returned in redirect)\n\n### Returns\n\n- `{ expires_in?: number; oauth_url?: string; provider?: 'gmail' | 'outlook' | 'zoho'; status?: string; }`\n\n - `expires_in?: number`\n - `oauth_url?: string`\n - `provider?: 'gmail' | 'outlook' | 'zoho'`\n - `status?: string`\n\n### Example\n\n```typescript\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser();\n\nconst response = await client.inbox.connectEmail({ redirect_uri: 'https://yourapp.com/oauth-callback' });\n\nconsole.log(response);\n```", perLanguage: { typescript: { method: 'client.inbox.connectEmail', example: - "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.inbox.connectEmail({\n redirect_uri: 'https://yourapp.com/oauth-callback',\n});\n\nconsole.log(response.expires_in);", + "import CasParser from 'cas-parser-node';\n\nconst client = new CasParser({\n apiKey: process.env['CAS_PARSER_API_KEY'], // This is the default and can be omitted\n});\n\nconst response = await client.inbox.connectEmail({\n redirect_uri: 'https://yourapp.com/oauth-callback',\n});\n\nconsole.log(response.provider);", }, python: { method: 'inbox.connect_email', example: - 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.inbox.connect_email(\n redirect_uri="https://yourapp.com/oauth-callback",\n)\nprint(response.expires_in)', + 'import os\nfrom cas_parser import CasParser\n\nclient = CasParser(\n api_key=os.environ.get("CAS_PARSER_API_KEY"), # This is the default and can be omitted\n)\nresponse = client.inbox.connect_email(\n redirect_uri="https://yourapp.com/oauth-callback",\n)\nprint(response.provider)', }, java: { method: 'inbox().connectEmail', @@ -592,16 +593,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ go: { method: 'client.Inbox.ConnectEmail', example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/CASParser/cas-parser-go"\n\t"github.com/CASParser/cas-parser-go/option"\n)\n\nfunc main() {\n\tclient := casparser.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Inbox.ConnectEmail(context.TODO(), casparser.InboxConnectEmailParams{\n\t\tRedirectUri: "https://yourapp.com/oauth-callback",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.ExpiresIn)\n}\n', + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/CASParser/cas-parser-go"\n\t"github.com/CASParser/cas-parser-go/option"\n)\n\nfunc main() {\n\tclient := casparser.NewClient(\n\t\toption.WithAPIKey("My API Key"),\n\t)\n\tresponse, err := client.Inbox.ConnectEmail(context.TODO(), casparser.InboxConnectEmailParams{\n\t\tRedirectUri: "https://yourapp.com/oauth-callback",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Provider)\n}\n', }, php: { method: 'inbox->connectEmail', example: - "inbox->connectEmail(\n redirectUri: 'https://yourapp.com/oauth-callback', state: 'abc123'\n);\n\nvar_dump($response);", + "inbox->connectEmail(\n redirectUri: 'https://yourapp.com/oauth-callback',\n provider: 'outlook',\n state: 'abc123',\n);\n\nvar_dump($response);", }, http: { example: - 'curl https://api.casparser.in/v4/inbox/connect \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $CAS_PARSER_API_KEY" \\\n -d \'{\n "redirect_uri": "https://yourapp.com/oauth-callback",\n "state": "abc123"\n }\'', + 'curl https://api.casparser.in/v4/inbox/connect \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $CAS_PARSER_API_KEY" \\\n -d \'{\n "redirect_uri": "https://yourapp.com/oauth-callback",\n "provider": "outlook",\n "state": "abc123"\n }\'', }, }, }, diff --git a/packages/mcp-server/src/server.ts b/packages/mcp-server/src/server.ts index c0ae94c..8153cf3 100644 --- a/packages/mcp-server/src/server.ts +++ b/packages/mcp-server/src/server.ts @@ -28,7 +28,7 @@ export const newMcpServer = async ({ new McpServer( { name: 'cas_parser_node_api', - version: '1.16.0', + version: '1.17.0', }, { instructions: await getInstructions({ stainlessApiKey, customInstructionsPath }), diff --git a/src/client.ts b/src/client.ts index 1a8386a..bde4c7a 100644 --- a/src/client.ts +++ b/src/client.ts @@ -822,7 +822,14 @@ export class CasParser { /** * Endpoints for importing CAS files directly from user email inboxes. * - * **Supported Providers:** Gmail (more coming soon) + * **Supported Providers:** + * + * - **Gmail** (`gmail`, default) — `@gmail.com` and Google Workspace domains + * - **Microsoft** (`outlook`) — personal Microsoft accounts: `@outlook.com`, + * `@hotmail.com`, `@live.com`, `@msn.com`, and localised variants such as + * `@hotmail.co.uk`, `@live.in`, `@hotmail.fr`. Any other address registered + * as a personal Microsoft account also works, including custom domains. + * - **Zoho Mail** (`zoho`) — Zoho-hosted mailboxes, including custom domains * * **How it works:** * 1. Call `POST /v4/inbox/connect` to get an OAuth URL diff --git a/src/resources/inbox.ts b/src/resources/inbox.ts index ba844e6..377bc53 100644 --- a/src/resources/inbox.ts +++ b/src/resources/inbox.ts @@ -8,7 +8,14 @@ import { RequestOptions } from '../internal/request-options'; /** * Endpoints for importing CAS files directly from user email inboxes. * - * **Supported Providers:** Gmail (more coming soon) + * **Supported Providers:** + * + * - **Gmail** (`gmail`, default) — `@gmail.com` and Google Workspace domains + * - **Microsoft** (`outlook`) — personal Microsoft accounts: `@outlook.com`, + * `@hotmail.com`, `@live.com`, `@msn.com`, and localised variants such as + * `@hotmail.co.uk`, `@live.in`, `@hotmail.fr`. Any other address registered + * as a personal Microsoft account also works, including custom domains. + * - **Zoho Mail** (`zoho`) — Zoho-hosted mailboxes, including custom domains * * **How it works:** * 1. Call `POST /v4/inbox/connect` to get an OAuth URL @@ -66,7 +73,10 @@ export class Inbox extends APIResource { * - `state` - Your original state parameter * * **Store the `inbox_token` client-side** and use it for all subsequent inbox API - * calls. + * calls. The token is long-lived (it stores an encrypted refresh token), so a + * single OAuth connect gives ongoing access to both historical and future CAS + * statements in the user's inbox. Reuse the same token until the user revokes + * access via `/v4/inbox/disconnect` or their provider's account settings. * * @example * ```ts @@ -166,6 +176,11 @@ export interface InboxConnectEmailResponse { */ oauth_url?: string; + /** + * The provider this OAuth URL was generated for + */ + provider?: 'gmail' | 'outlook' | 'zoho'; + status?: string; } @@ -199,7 +214,7 @@ export namespace InboxListCasFilesResponse { /** * URL expiration time in seconds. Defaults vary by source: * - * - Gmail Inbox Import: 86400 (24h) + * - Email Inbox Import (Gmail, Outlook, Zoho): 86400 (24h) * - Inbound Email with `callback_url` set: 172800 (48h) * - Inbound Email without `callback_url`: aligned with the session TTL (~30 min) */ @@ -256,6 +271,21 @@ export interface InboxConnectEmailParams { */ redirect_uri: string; + /** + * Mail provider to connect. Defaults to `gmail`. + * + * - `gmail` - Google accounts: `@gmail.com` and Google Workspace domains. + * - `outlook` - personal Microsoft accounts: `@outlook.com`, `@hotmail.com`, + * `@live.com`, `@msn.com` and localised variants (`@hotmail.co.uk`, `@live.in`, + * `@hotmail.fr`). Any other address registered as a personal Microsoft account + * also works, including custom domains. + * - `zoho` - Zoho Mail accounts, including custom domains hosted on Zoho. + * + * Any unrecognised value is treated as `gmail`. The resolved provider is returned + * in the response. + */ + provider?: 'gmail' | 'outlook' | 'zoho'; + /** * State parameter for CSRF protection (returned in redirect) */ diff --git a/src/version.ts b/src/version.ts index b94d5b1..8735576 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '1.16.0'; // x-release-please-version +export const VERSION = '1.17.0'; // x-release-please-version diff --git a/tests/api-resources/inbox.test.ts b/tests/api-resources/inbox.test.ts index bd494a2..0204971 100644 --- a/tests/api-resources/inbox.test.ts +++ b/tests/api-resources/inbox.test.ts @@ -41,6 +41,7 @@ describe('resource inbox', () => { test.skip('connectEmail: required and optional params', async () => { const response = await client.inbox.connectEmail({ redirect_uri: 'https://yourapp.com/oauth-callback', + provider: 'outlook', state: 'abc123', }); });