Skip to content

Commit ffacb36

Browse files
feat(api): api update
1 parent 369435d commit ffacb36

4 files changed

Lines changed: 38 additions & 16 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 20
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser/cas-parser-5c6cdb8b7a2c0ba449927687bc378823ac947b26b7c2e6c379ae14668b73979a.yml
3-
openapi_spec_hash: 6bc024b866f01da53e2cfd6e404157c7
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser/cas-parser-4d179917b01ea51a3325e7b37ecbbb60d0ba8f60381fe715ff3ec31284ca8042.yml
3+
openapi_spec_hash: d027d37bd7051aa8c05fe1820c05b316
44
config_hash: 5509bb7a961ae2e79114b24c381606d4

packages/mcp-server/src/local-docs-search.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -566,13 +566,14 @@ const EMBEDDED_METHODS: MethodEntry[] = [
566566
httpMethod: 'post',
567567
summary: 'Connect Email Provider (Initiate OAuth)',
568568
description:
569-
"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",
569+
"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",
570570
stainlessPath: '(resource) inbox > (method) connect_email',
571571
qualified: 'client.inbox.connectEmail',
572-
params: ['redirect_uri: string;', "provider?: 'gmail' | 'outlook';", 'state?: string;'],
573-
response: "{ expires_in?: number; oauth_url?: string; provider?: 'gmail' | 'outlook'; status?: string; }",
572+
params: ['redirect_uri: string;', "provider?: 'gmail' | 'outlook' | 'zoho';", 'state?: string;'],
573+
response:
574+
"{ expires_in?: number; oauth_url?: string; provider?: 'gmail' | 'outlook' | 'zoho'; status?: string; }",
574575
markdown:
575-
"## connect_email\n\n`client.inbox.connectEmail(redirect_uri: string, provider?: 'gmail' | 'outlook', state?: string): { expires_in?: number; oauth_url?: string; provider?: 'gmail' | 'outlook'; 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- `provider?: 'gmail' | 'outlook'`\n Mail provider to connect. Defaults to `gmail`.\n\n- `gmail` - Google accounts\n- `outlook` - Microsoft accounts\n\nAny value other than `outlook` is treated as `gmail`. The\nresolved provider 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'; status?: string; }`\n\n - `expires_in?: number`\n - `oauth_url?: string`\n - `provider?: 'gmail' | 'outlook'`\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```",
576+
"## 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```",
576577
perLanguage: {
577578
typescript: {
578579
method: 'client.inbox.connectEmail',

src/client.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,14 @@ export class CasParser {
822822
/**
823823
* Endpoints for importing CAS files directly from user email inboxes.
824824
*
825-
* **Supported Providers:** Gmail (more coming soon)
825+
* **Supported Providers:**
826+
*
827+
* - **Gmail** (`gmail`, default) — `@gmail.com` and Google Workspace domains
828+
* - **Microsoft** (`outlook`) — personal Microsoft accounts: `@outlook.com`,
829+
* `@hotmail.com`, `@live.com`, `@msn.com`, and localised variants such as
830+
* `@hotmail.co.uk`, `@live.in`, `@hotmail.fr`. Any other address registered
831+
* as a personal Microsoft account also works, including custom domains.
832+
* - **Zoho Mail** (`zoho`) — Zoho-hosted mailboxes, including custom domains
826833
*
827834
* **How it works:**
828835
* 1. Call `POST /v4/inbox/connect` to get an OAuth URL

src/resources/inbox.ts

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@ import { RequestOptions } from '../internal/request-options';
88
/**
99
* Endpoints for importing CAS files directly from user email inboxes.
1010
*
11-
* **Supported Providers:** Gmail (more coming soon)
11+
* **Supported Providers:**
12+
*
13+
* - **Gmail** (`gmail`, default) — `@gmail.com` and Google Workspace domains
14+
* - **Microsoft** (`outlook`) — personal Microsoft accounts: `@outlook.com`,
15+
* `@hotmail.com`, `@live.com`, `@msn.com`, and localised variants such as
16+
* `@hotmail.co.uk`, `@live.in`, `@hotmail.fr`. Any other address registered
17+
* as a personal Microsoft account also works, including custom domains.
18+
* - **Zoho Mail** (`zoho`) — Zoho-hosted mailboxes, including custom domains
1219
*
1320
* **How it works:**
1421
* 1. Call `POST /v4/inbox/connect` to get an OAuth URL
@@ -66,7 +73,10 @@ export class Inbox extends APIResource {
6673
* - `state` - Your original state parameter
6774
*
6875
* **Store the `inbox_token` client-side** and use it for all subsequent inbox API
69-
* calls.
76+
* calls. The token is long-lived (it stores an encrypted refresh token), so a
77+
* single OAuth connect gives ongoing access to both historical and future CAS
78+
* statements in the user's inbox. Reuse the same token until the user revokes
79+
* access via `/v4/inbox/disconnect` or their provider's account settings.
7080
*
7181
* @example
7282
* ```ts
@@ -169,7 +179,7 @@ export interface InboxConnectEmailResponse {
169179
/**
170180
* The provider this OAuth URL was generated for
171181
*/
172-
provider?: 'gmail' | 'outlook';
182+
provider?: 'gmail' | 'outlook' | 'zoho';
173183

174184
status?: string;
175185
}
@@ -204,7 +214,7 @@ export namespace InboxListCasFilesResponse {
204214
/**
205215
* URL expiration time in seconds. Defaults vary by source:
206216
*
207-
* - Gmail Inbox Import: 86400 (24h)
217+
* - Email Inbox Import (Gmail, Outlook, Zoho): 86400 (24h)
208218
* - Inbound Email with `callback_url` set: 172800 (48h)
209219
* - Inbound Email without `callback_url`: aligned with the session TTL (~30 min)
210220
*/
@@ -264,13 +274,17 @@ export interface InboxConnectEmailParams {
264274
/**
265275
* Mail provider to connect. Defaults to `gmail`.
266276
*
267-
* - `gmail` - Google accounts
268-
* - `outlook` - Microsoft accounts
277+
* - `gmail` - Google accounts: `@gmail.com` and Google Workspace domains.
278+
* - `outlook` - personal Microsoft accounts: `@outlook.com`, `@hotmail.com`,
279+
* `@live.com`, `@msn.com` and localised variants (`@hotmail.co.uk`, `@live.in`,
280+
* `@hotmail.fr`). Any other address registered as a personal Microsoft account
281+
* also works, including custom domains.
282+
* - `zoho` - Zoho Mail accounts, including custom domains hosted on Zoho.
269283
*
270-
* Any value other than `outlook` is treated as `gmail`. The resolved provider is
271-
* returned in the response.
284+
* Any unrecognised value is treated as `gmail`. The resolved provider is returned
285+
* in the response.
272286
*/
273-
provider?: 'gmail' | 'outlook';
287+
provider?: 'gmail' | 'outlook' | 'zoho';
274288

275289
/**
276290
* State parameter for CSRF protection (returned in redirect)

0 commit comments

Comments
 (0)