Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.16.0"
".": "1.17.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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 <sameer@casparser.in>",
"types": "dist/index.d.ts",
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": "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",
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp-server/package.json
Original file line number Diff line number Diff line change
@@ -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 <sameer@casparser.in>",
"types": "dist/index.d.ts",
Expand Down
19 changes: 10 additions & 9 deletions packages/mcp-server/src/local-docs-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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:
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$response = $client->inbox->connectEmail(\n redirectUri: 'https://yourapp.com/oauth-callback', state: 'abc123'\n);\n\nvar_dump($response);",
"<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(apiKey: 'My API Key');\n\n$response = $client->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 }\'',
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp-server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }),
Expand Down
9 changes: 8 additions & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
36 changes: 33 additions & 3 deletions src/resources/inbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -166,6 +176,11 @@ export interface InboxConnectEmailResponse {
*/
oauth_url?: string;

/**
* The provider this OAuth URL was generated for
*/
provider?: 'gmail' | 'outlook' | 'zoho';

status?: string;
}

Expand Down Expand Up @@ -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)
*/
Expand Down Expand Up @@ -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)
*/
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '1.16.0'; // x-release-please-version
export const VERSION = '1.17.0'; // x-release-please-version
1 change: 1 addition & 0 deletions tests/api-resources/inbox.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
});
});
Expand Down
Loading