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 @@
{
".": "0.12.0"
".": "0.13.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-26d0931f3488af784c16303683cbf24225c727615fd32ee071144974e7c59670.yml
openapi_spec_hash: 242a5f4d982645a25e0d66ef088940a5
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser/cas-parser-4d179917b01ea51a3325e7b37ecbbb60d0ba8f60381fe715ff3ec31284ca8042.yml
openapi_spec_hash: d027d37bd7051aa8c05fe1820c05b316
config_hash: 5509bb7a961ae2e79114b24c381606d4
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## 0.13.0 (2026-08-09)

Full Changelog: [v0.12.0...v0.13.0](https://github.com/CASParser/cas-parser-go/compare/v0.12.0...v0.13.0)

### Features

* **api:** api update ([59b6f93](https://github.com/CASParser/cas-parser-go/commit/59b6f93aa684c8b6eeda3f569d35eceeff8d0629))
* **api:** api update ([2d10ba6](https://github.com/CASParser/cas-parser-go/commit/2d10ba6ed8dc08ed843fb0ed010b394387620567))
* **api:** api update ([d5497ca](https://github.com/CASParser/cas-parser-go/commit/d5497ca0f858ec9b9a6c9dbd342e8dd6c049f0b7))

## 0.12.0 (2026-07-26)

Full Changelog: [v0.11.0...v0.12.0](https://github.com/CASParser/cas-parser-go/compare/v0.11.0...v0.12.0)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Or to pin the version:
<!-- x-release-please-start-version -->

```sh
go get -u 'github.com/CASParser/cas-parser-go@v0.12.0'
go get -u 'github.com/CASParser/cas-parser-go@v0.13.0'
```

<!-- x-release-please-end -->
Expand Down
4 changes: 4 additions & 0 deletions camskfintech.go
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,9 @@ type UnifiedResponseMutualFundSchemeAdditionalInfo struct {
Amfi string `json:"amfi"`
// Closing balance units for the statement period
CloseUnits float64 `json:"close_units" api:"nullable"`
// Whether the scheme is held in demat form (CAMS/KFintech). true = Demat, false =
// Non-Demat, null = not specified.
IsDemat bool `json:"is_demat" api:"nullable"`
// Opening balance units for the statement period
OpenUnits float64 `json:"open_units" api:"nullable"`
// RTA code for the scheme (CAMS/KFintech)
Expand All @@ -841,6 +844,7 @@ type UnifiedResponseMutualFundSchemeAdditionalInfo struct {
Advisor respjson.Field
Amfi respjson.Field
CloseUnits respjson.Field
IsDemat respjson.Field
OpenUnits respjson.Field
RtaCode respjson.Field
ExtraFields map[string]respjson.Field
Expand Down
9 changes: 8 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,14 @@ type Client struct {
ContractNote ContractNoteService
// 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:**
//
Expand Down
65 changes: 61 additions & 4 deletions inbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ import (

// 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:**
//
Expand Down Expand Up @@ -86,7 +93,10 @@ func (r *InboxService) CheckConnectionStatus(ctx context.Context, body InboxChec
// - `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.
func (r *InboxService) ConnectEmail(ctx context.Context, body InboxConnectEmailParams, opts ...option.RequestOption) (res *InboxConnectEmailResponse, err error) {
opts = slices.Concat(r.Options, opts)
path := "v4/inbox/connect"
Expand Down Expand Up @@ -158,11 +168,16 @@ type InboxConnectEmailResponse struct {
ExpiresIn int64 `json:"expires_in"`
// Redirect user to this URL to start OAuth flow
OAuthURL string `json:"oauth_url" format:"uri"`
Status string `json:"status"`
// The provider this OAuth URL was generated for
//
// Any of "gmail", "outlook", "zoho".
Provider InboxConnectEmailResponseProvider `json:"provider"`
Status string `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ExpiresIn respjson.Field
OAuthURL respjson.Field
Provider respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
raw string
Expand All @@ -175,6 +190,15 @@ func (r *InboxConnectEmailResponse) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}

// The provider this OAuth URL was generated for
type InboxConnectEmailResponseProvider string

const (
InboxConnectEmailResponseProviderGmail InboxConnectEmailResponseProvider = "gmail"
InboxConnectEmailResponseProviderOutlook InboxConnectEmailResponseProvider = "outlook"
InboxConnectEmailResponseProviderZoho InboxConnectEmailResponseProvider = "zoho"
)

type InboxDisconnectEmailResponse struct {
Msg string `json:"msg"`
Status string `json:"status"`
Expand Down Expand Up @@ -222,7 +246,7 @@ type InboxListCasFilesResponseFile struct {
CasType string `json:"cas_type"`
// 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)
ExpiresIn int64 `json:"expires_in"`
Expand Down Expand Up @@ -273,6 +297,20 @@ type InboxConnectEmailParams struct {
RedirectUri string `json:"redirect_uri" api:"required" format:"uri"`
// State parameter for CSRF protection (returned in redirect)
State param.Opt[string] `json:"state,omitzero"`
// 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.
//
// Any of "gmail", "outlook", "zoho".
Provider InboxConnectEmailParamsProvider `json:"provider,omitzero"`
paramObj
}

Expand All @@ -284,6 +322,25 @@ func (r *InboxConnectEmailParams) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}

// 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.
type InboxConnectEmailParamsProvider string

const (
InboxConnectEmailParamsProviderGmail InboxConnectEmailParamsProvider = "gmail"
InboxConnectEmailParamsProviderOutlook InboxConnectEmailParamsProvider = "outlook"
InboxConnectEmailParamsProviderZoho InboxConnectEmailParamsProvider = "zoho"
)

type InboxDisconnectEmailParams struct {
XInboxToken string `header:"x-inbox-token" api:"required" json:"-"`
paramObj
Expand Down
1 change: 1 addition & 0 deletions inbox_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func TestInboxConnectEmailWithOptionalParams(t *testing.T) {
)
_, err := client.Inbox.ConnectEmail(context.TODO(), casparser.InboxConnectEmailParams{
RedirectUri: "https://yourapp.com/oauth-callback",
Provider: casparser.InboxConnectEmailParamsProviderOutlook,
State: casparser.String("abc123"),
})
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

package internal

const PackageVersion = "0.12.0" // x-release-please-version
const PackageVersion = "0.13.0" // x-release-please-version
Loading