Skip to content
Merged
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.10.5"
".": "1.11.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: 21
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser%2Fcas-parser-d868ff00b7b07f6b6802b00f22fad531a91a76bb219a634f3f90fe488bd499ba.yml
openapi_spec_hash: 20e9f2fc31feee78878cdf56e46dab60
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser%2Fcas-parser-e5c0c65637cdf3a6c4360b8193973b73a3d35ad1056ef607c3319ef03e591a55.yml
openapi_spec_hash: 7515d1e5fe3130b9f5411f7aacbc8a64
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.11.0 (2026-04-19)

Full Changelog: [v1.10.5...v1.11.0](https://github.com/CASParser/cas-parser-node/compare/v1.10.5...v1.11.0)

### Features

* **api:** api update ([4c2f4ff](https://github.com/CASParser/cas-parser-node/commit/4c2f4ffbfb0553f148d5b2d637a3875ead77712c))
* **api:** api update ([71f95f3](https://github.com/CASParser/cas-parser-node/commit/71f95f310f7170a60b4d79791797d842776f1599))

## 1.10.5 (2026-04-10)

Full Changelog: [v1.10.4...v1.10.5](https://github.com/CASParser/cas-parser-node/compare/v1.10.4...v1.10.5)
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.10.5",
"version": "1.11.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.10.5",
"version": "1.11.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.10.5",
"version": "1.11.0",
"description": "The official MCP Server for the Cas Parser API",
"author": "Cas Parser <sameer@casparser.in>",
"types": "dist/index.d.ts",
Expand Down
30 changes: 15 additions & 15 deletions packages/mcp-server/src/local-docs-search.ts

Large diffs are not rendered by default.

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.10.5',
version: '1.11.0',
},
{
instructions: await getInstructions({ stainlessApiKey, customInstructionsPath }),
Expand Down
69 changes: 27 additions & 42 deletions src/resources/inbound-email.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,33 +30,18 @@ import { path } from '../internal/utils/path';
export class InboundEmail extends APIResource {
/**
* Create a dedicated inbound email address for collecting CAS statements via email
* forwarding.
* forwarding. When an investor forwards a CAS email to this address, we verify the
* sender and make the file available to you.
*
* **How it works:**
* `callback_url` is **optional**:
*
* 1. Create an inbound email with your webhook URL
* 2. Display the email address to your user (e.g., "Forward your CAS to
* ie_xxx@import.casparser.in")
* 3. When an investor forwards a CAS email, we verify the sender and deliver to
* your webhook
*
* **Webhook Delivery:**
*
* - We POST to your `callback_url` with JSON body containing files (matching
* EmailCASFile schema)
* - Failed deliveries are retried automatically with exponential backoff
*
* **Inactivity:**
*
* - Inbound emails with no activity in 30 days are marked inactive
* - Active inbound emails remain operational indefinitely
* - **Set it** — we POST each parsed email to your webhook as it arrives.
* - **Omit it** — retrieve files via `GET /v4/inbound-email/{id}/files` without
* building a webhook consumer.
*
* @example
* ```ts
* const inboundEmail = await client.inboundEmail.create({
* callback_url:
* 'https://api.yourapp.com/webhooks/cas-email',
* });
* const inboundEmail = await client.inboundEmail.create();
* ```
*/
create(body: InboundEmailCreateParams, options?: RequestOptions): APIPromise<InboundEmailCreateResponse> {
Expand All @@ -69,7 +54,7 @@ export class InboundEmail extends APIResource {
* @example
* ```ts
* const inboundEmail = await client.inboundEmail.retrieve(
* 'ie_a1b2c3d4e5f6',
* 'inbound_email_id',
* );
* ```
*/
Expand Down Expand Up @@ -121,9 +106,10 @@ export interface InboundEmailCreateResponse {
allowed_sources?: Array<'cdsl' | 'nsdl' | 'cams' | 'kfintech'>;

/**
* Webhook URL for email notifications
* Webhook URL for email notifications. `null` means files are only retrievable via
* `GET /v4/inbound-email/{id}/files` (pull delivery).
*/
callback_url?: string;
callback_url?: string | null;

/**
* When the mailbox was created
Expand Down Expand Up @@ -171,9 +157,10 @@ export interface InboundEmailRetrieveResponse {
allowed_sources?: Array<'cdsl' | 'nsdl' | 'cams' | 'kfintech'>;

/**
* Webhook URL for email notifications
* Webhook URL for email notifications. `null` means files are only retrievable via
* `GET /v4/inbound-email/{id}/files` (pull delivery).
*/
callback_url?: string;
callback_url?: string | null;

/**
* When the mailbox was created
Expand Down Expand Up @@ -237,9 +224,10 @@ export namespace InboundEmailListResponse {
allowed_sources?: Array<'cdsl' | 'nsdl' | 'cams' | 'kfintech'>;

/**
* Webhook URL for email notifications
* Webhook URL for email notifications. `null` means files are only retrievable via
* `GET /v4/inbound-email/{id}/files` (pull delivery).
*/
callback_url?: string;
callback_url?: string | null;

/**
* When the mailbox was created
Expand Down Expand Up @@ -286,19 +274,9 @@ export interface InboundEmailDeleteResponse {

export interface InboundEmailCreateParams {
/**
* Webhook URL where we POST email notifications. Must be HTTPS in production (HTTP
* allowed for localhost during development).
*/
callback_url: string;

/**
* Optional custom email prefix for user-friendly addresses.
*
* - Must be 3-32 characters
* - Alphanumeric + hyphens only
* - Must start and end with letter/number
* - Example: `john-portfolio@import.casparser.in`
* - If omitted, generates random ID like `ie_abc123xyz@import.casparser.in`
* Optional custom email prefix (e.g. `john-portfolio@import.casparser.in`). 3-32
* chars, alphanumeric + hyphens, must start/end with a letter or number. If
* omitted, a random ID is generated.
*/
alias?: string;

Expand All @@ -312,6 +290,13 @@ export interface InboundEmailCreateParams {
*/
allowed_sources?: Array<'cdsl' | 'nsdl' | 'cams' | 'kfintech'>;

/**
* Optional webhook URL where we POST parsed emails. Must be HTTPS in production
* (HTTP allowed for localhost). If omitted, retrieve files via
* `GET /v4/inbound-email/{id}/files`.
*/
callback_url?: string | null;

/**
* Optional key-value pairs (max 10) to include in webhook payload. Useful for
* passing context like plan_type, campaign_id, etc.
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.10.5'; // x-release-please-version
export const VERSION = '1.11.0'; // x-release-please-version
19 changes: 3 additions & 16 deletions tests/api-resources/inbound-email.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ const client = new CasParser({

describe('resource inboundEmail', () => {
// Mock server tests are disabled
test.skip('create: only required params', async () => {
const responsePromise = client.inboundEmail.create({
callback_url: 'https://api.yourapp.com/webhooks/cas-email',
});
test.skip('create', async () => {
const responsePromise = client.inboundEmail.create({});
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
Expand All @@ -22,20 +20,9 @@ describe('resource inboundEmail', () => {
expect(dataAndResponse.response).toBe(rawResponse);
});

// Mock server tests are disabled
test.skip('create: required and optional params', async () => {
const response = await client.inboundEmail.create({
callback_url: 'https://api.yourapp.com/webhooks/cas-email',
alias: 'john-portfolio',
allowed_sources: ['cdsl', 'nsdl'],
metadata: { plan: 'premium', source: 'onboarding' },
reference: 'user_12345',
});
});

// Mock server tests are disabled
test.skip('retrieve', async () => {
const responsePromise = client.inboundEmail.retrieve('ie_a1b2c3d4e5f6');
const responsePromise = client.inboundEmail.retrieve('inbound_email_id');
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
Expand Down
Loading