Skip to content

Commit aaebadc

Browse files
feat(api): api update
1 parent 2b43dbc commit aaebadc

8 files changed

Lines changed: 92 additions & 27 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

‎src/Inbox/InboxConnectEmailParams.php‎

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
* - `state` - Your original state parameter
2828
*
2929
* **Store the `inbox_token` client-side** and use it for all subsequent inbox API calls.
30+
* The token is long-lived (it stores an encrypted refresh token), so a single OAuth
31+
* connect gives ongoing access to both historical and future CAS statements in the
32+
* user's inbox. Reuse the same token until the user revokes access via
33+
* `/v4/inbox/disconnect` or their provider's account settings.
3034
*
3135
* @see CasParser\Services\InboxService::connectEmail()
3236
*
@@ -51,11 +55,18 @@ final class InboxConnectEmailParams implements BaseModel
5155
/**
5256
* Mail provider to connect. Defaults to `gmail`.
5357
*
54-
* - `gmail` - Google accounts
55-
* - `outlook` - Microsoft accounts
58+
* - `gmail` - Google accounts: `@gmail.com` and Google
59+
* Workspace domains.
60+
* - `outlook` - personal Microsoft accounts: `@outlook.com`,
61+
* `@hotmail.com`, `@live.com`, `@msn.com` and localised
62+
* variants (`@hotmail.co.uk`, `@live.in`, `@hotmail.fr`).
63+
* Any other address registered as a personal Microsoft
64+
* account also works, including custom domains.
65+
* - `zoho` - Zoho Mail accounts, including custom domains
66+
* hosted on Zoho.
5667
*
57-
* Any value other than `outlook` is treated as `gmail`. The
58-
* resolved provider is returned in the response.
68+
* Any unrecognised value is treated as `gmail`. The resolved
69+
* provider is returned in the response.
5970
*
6071
* @var value-of<Provider>|null $provider
6172
*/
@@ -123,11 +134,18 @@ public function withRedirectUri(string $redirectUri): self
123134
/**
124135
* Mail provider to connect. Defaults to `gmail`.
125136
*
126-
* - `gmail` - Google accounts
127-
* - `outlook` - Microsoft accounts
137+
* - `gmail` - Google accounts: `@gmail.com` and Google
138+
* Workspace domains.
139+
* - `outlook` - personal Microsoft accounts: `@outlook.com`,
140+
* `@hotmail.com`, `@live.com`, `@msn.com` and localised
141+
* variants (`@hotmail.co.uk`, `@live.in`, `@hotmail.fr`).
142+
* Any other address registered as a personal Microsoft
143+
* account also works, including custom domains.
144+
* - `zoho` - Zoho Mail accounts, including custom domains
145+
* hosted on Zoho.
128146
*
129-
* Any value other than `outlook` is treated as `gmail`. The
130-
* resolved provider is returned in the response.
147+
* Any unrecognised value is treated as `gmail`. The resolved
148+
* provider is returned in the response.
131149
*
132150
* @param Provider|value-of<Provider> $provider
133151
*/

‎src/Inbox/InboxConnectEmailParams/Provider.php‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,24 @@
77
/**
88
* Mail provider to connect. Defaults to `gmail`.
99
*
10-
* - `gmail` - Google accounts
11-
* - `outlook` - Microsoft accounts
10+
* - `gmail` - Google accounts: `@gmail.com` and Google
11+
* Workspace domains.
12+
* - `outlook` - personal Microsoft accounts: `@outlook.com`,
13+
* `@hotmail.com`, `@live.com`, `@msn.com` and localised
14+
* variants (`@hotmail.co.uk`, `@live.in`, `@hotmail.fr`).
15+
* Any other address registered as a personal Microsoft
16+
* account also works, including custom domains.
17+
* - `zoho` - Zoho Mail accounts, including custom domains
18+
* hosted on Zoho.
1219
*
13-
* Any value other than `outlook` is treated as `gmail`. The
14-
* resolved provider is returned in the response.
20+
* Any unrecognised value is treated as `gmail`. The resolved
21+
* provider is returned in the response.
1522
*/
1623
enum Provider: string
1724
{
1825
case GMAIL = 'gmail';
1926

2027
case OUTLOOK = 'outlook';
28+
29+
case ZOHO = 'zoho';
2130
}

‎src/Inbox/InboxConnectEmailResponse/Provider.php‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ enum Provider: string
1212
case GMAIL = 'gmail';
1313

1414
case OUTLOOK = 'outlook';
15+
16+
case ZOHO = 'zoho';
1517
}

‎src/Inbox/InboxListCasFilesResponse/File.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ final class File implements BaseModel
3939

4040
/**
4141
* URL expiration time in seconds. Defaults vary by source:
42-
* - Gmail Inbox Import: 86400 (24h)
42+
* - Email Inbox Import (Gmail, Outlook, Zoho): 86400 (24h)
4343
* - Inbound Email with `callback_url` set: 172800 (48h)
4444
* - Inbound Email without `callback_url`: aligned with the session TTL (~30 min)
4545
*/
@@ -141,7 +141,7 @@ public function withCasType(CasType|string $casType): self
141141

142142
/**
143143
* URL expiration time in seconds. Defaults vary by source:
144-
* - Gmail Inbox Import: 86400 (24h)
144+
* - Email Inbox Import (Gmail, Outlook, Zoho): 86400 (24h)
145145
* - Inbound Email with `callback_url` set: 172800 (48h)
146146
* - Inbound Email without `callback_url`: aligned with the session TTL (~30 min)
147147
*/

‎src/ServiceContracts/InboxContract.php‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,18 @@ public function checkConnectionStatus(
3737
* @param string $redirectUri Your callback URL to receive the inbox_token (must be http or https)
3838
* @param Provider|value-of<Provider> $provider Mail provider to connect. Defaults to `gmail`.
3939
*
40-
* - `gmail` - Google accounts
41-
* - `outlook` - Microsoft accounts
40+
* - `gmail` - Google accounts: `@gmail.com` and Google
41+
* Workspace domains.
42+
* - `outlook` - personal Microsoft accounts: `@outlook.com`,
43+
* `@hotmail.com`, `@live.com`, `@msn.com` and localised
44+
* variants (`@hotmail.co.uk`, `@live.in`, `@hotmail.fr`).
45+
* Any other address registered as a personal Microsoft
46+
* account also works, including custom domains.
47+
* - `zoho` - Zoho Mail accounts, including custom domains
48+
* hosted on Zoho.
4249
*
43-
* Any value other than `outlook` is treated as `gmail`. The
44-
* resolved provider is returned in the response.
50+
* Any unrecognised value is treated as `gmail`. The resolved
51+
* provider is returned in the response.
4552
* @param string $state State parameter for CSRF protection (returned in redirect)
4653
* @param RequestOpts|null $requestOptions
4754
*

‎src/Services/InboxRawService.php‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,14 @@
2424
/**
2525
* Endpoints for importing CAS files directly from user email inboxes.
2626
*
27-
* **Supported Providers:** Gmail (more coming soon)
27+
* **Supported Providers:**
28+
*
29+
* - **Gmail** (`gmail`, default) — `@gmail.com` and Google Workspace domains
30+
* - **Microsoft** (`outlook`) — personal Microsoft accounts: `@outlook.com`,
31+
* `@hotmail.com`, `@live.com`, `@msn.com`, and localised variants such as
32+
* `@hotmail.co.uk`, `@live.in`, `@hotmail.fr`. Any other address registered
33+
* as a personal Microsoft account also works, including custom domains.
34+
* - **Zoho Mail** (`zoho`) — Zoho-hosted mailboxes, including custom domains
2835
*
2936
* **How it works:**
3037
* 1. Call `POST /v4/inbox/connect` to get an OAuth URL
@@ -103,6 +110,10 @@ public function checkConnectionStatus(
103110
* - `state` - Your original state parameter
104111
*
105112
* **Store the `inbox_token` client-side** and use it for all subsequent inbox API calls.
113+
* The token is long-lived (it stores an encrypted refresh token), so a single OAuth
114+
* connect gives ongoing access to both historical and future CAS statements in the
115+
* user's inbox. Reuse the same token until the user revokes access via
116+
* `/v4/inbox/disconnect` or their provider's account settings.
106117
*
107118
* @param array{
108119
* redirectUri: string, provider?: Provider|value-of<Provider>, state?: string

‎src/Services/InboxService.php‎

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,14 @@
1919
/**
2020
* Endpoints for importing CAS files directly from user email inboxes.
2121
*
22-
* **Supported Providers:** Gmail (more coming soon)
22+
* **Supported Providers:**
23+
*
24+
* - **Gmail** (`gmail`, default) — `@gmail.com` and Google Workspace domains
25+
* - **Microsoft** (`outlook`) — personal Microsoft accounts: `@outlook.com`,
26+
* `@hotmail.com`, `@live.com`, `@msn.com`, and localised variants such as
27+
* `@hotmail.co.uk`, `@live.in`, `@hotmail.fr`. Any other address registered
28+
* as a personal Microsoft account also works, including custom domains.
29+
* - **Zoho Mail** (`zoho`) — Zoho-hosted mailboxes, including custom domains
2330
*
2431
* **How it works:**
2532
* 1. Call `POST /v4/inbox/connect` to get an OAuth URL
@@ -93,15 +100,26 @@ public function checkConnectionStatus(
93100
* - `state` - Your original state parameter
94101
*
95102
* **Store the `inbox_token` client-side** and use it for all subsequent inbox API calls.
103+
* The token is long-lived (it stores an encrypted refresh token), so a single OAuth
104+
* connect gives ongoing access to both historical and future CAS statements in the
105+
* user's inbox. Reuse the same token until the user revokes access via
106+
* `/v4/inbox/disconnect` or their provider's account settings.
96107
*
97108
* @param string $redirectUri Your callback URL to receive the inbox_token (must be http or https)
98109
* @param Provider|value-of<Provider> $provider Mail provider to connect. Defaults to `gmail`.
99110
*
100-
* - `gmail` - Google accounts
101-
* - `outlook` - Microsoft accounts
102-
*
103-
* Any value other than `outlook` is treated as `gmail`. The
104-
* resolved provider is returned in the response.
111+
* - `gmail` - Google accounts: `@gmail.com` and Google
112+
* Workspace domains.
113+
* - `outlook` - personal Microsoft accounts: `@outlook.com`,
114+
* `@hotmail.com`, `@live.com`, `@msn.com` and localised
115+
* variants (`@hotmail.co.uk`, `@live.in`, `@hotmail.fr`).
116+
* Any other address registered as a personal Microsoft
117+
* account also works, including custom domains.
118+
* - `zoho` - Zoho Mail accounts, including custom domains
119+
* hosted on Zoho.
120+
*
121+
* Any unrecognised value is treated as `gmail`. The resolved
122+
* provider is returned in the response.
105123
* @param string $state State parameter for CSRF protection (returned in redirect)
106124
* @param RequestOpts|null $requestOptions
107125
*

0 commit comments

Comments
 (0)