diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 8db4f32..cf198b9 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.10.5" + ".": "1.11.0" } diff --git a/.stats.yml b/.stats.yml index 25ece8f..e26d438 100644 --- a/.stats.yml +++ b/.stats.yml @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a111b8..414e718 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/package.json b/package.json index 5443772..9172ebe 100644 --- a/package.json +++ b/package.json @@ -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 ", "types": "dist/index.d.ts", diff --git a/packages/mcp-server/manifest.json b/packages/mcp-server/manifest.json index 6acf9f4..b0d00b4 100644 --- a/packages/mcp-server/manifest.json +++ b/packages/mcp-server/manifest.json @@ -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", diff --git a/packages/mcp-server/package.json b/packages/mcp-server/package.json index 72a9e98..6c858ee 100644 --- a/packages/mcp-server/package.json +++ b/packages/mcp-server/package.json @@ -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 ", "types": "dist/index.d.ts", diff --git a/packages/mcp-server/src/local-docs-search.ts b/packages/mcp-server/src/local-docs-search.ts index a78595e..be55808 100644 --- a/packages/mcp-server/src/local-docs-search.ts +++ b/packages/mcp-server/src/local-docs-search.ts @@ -889,49 +889,49 @@ const EMBEDDED_METHODS: MethodEntry[] = [ httpMethod: 'post', summary: 'Create Inbound Email', description: - 'Create a dedicated inbound email address for collecting CAS statements via email forwarding.\n\n**How it works:**\n1. Create an inbound email with your webhook URL\n2. Display the email address to your user (e.g., "Forward your CAS to ie_xxx@import.casparser.in")\n3. When an investor forwards a CAS email, we verify the sender and deliver to your webhook\n\n**Webhook Delivery:**\n- We POST to your `callback_url` with JSON body containing files (matching EmailCASFile schema)\n- Failed deliveries are retried automatically with exponential backoff\n\n**Inactivity:**\n- Inbound emails with no activity in 30 days are marked inactive\n- Active inbound emails remain operational indefinitely\n', + 'Create a dedicated inbound email address for collecting CAS statements\nvia email forwarding. When an investor forwards a CAS email to this\naddress, we verify the sender and make the file available to you.\n\n`callback_url` is **optional**:\n- **Set it** — we POST each parsed email to your webhook as it arrives.\n- **Omit it** — retrieve files via `GET /v4/inbound-email/{id}/files`\n without building a webhook consumer.\n', stainlessPath: '(resource) inbound_email > (method) create', qualified: 'client.inboundEmail.create', params: [ - 'callback_url: string;', 'alias?: string;', "allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[];", + 'callback_url?: string;', 'metadata?: object;', 'reference?: string;', ], response: "{ allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[]; callback_url?: string; created_at?: string; email?: string; inbound_email_id?: string; metadata?: object; reference?: string; status?: 'active' | 'paused'; updated_at?: string; }", markdown: - "## create\n\n`client.inboundEmail.create(callback_url: string, alias?: string, allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[], metadata?: object, reference?: string): { allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[]; callback_url?: string; created_at?: string; email?: string; inbound_email_id?: string; metadata?: object; reference?: string; status?: 'active' | 'paused'; updated_at?: string; }`\n\n**post** `/v4/inbound-email`\n\nCreate a dedicated inbound email address for collecting CAS statements via email forwarding.\n\n**How it works:**\n1. Create an inbound email with your webhook URL\n2. Display the email address to your user (e.g., \"Forward your CAS to ie_xxx@import.casparser.in\")\n3. When an investor forwards a CAS email, we verify the sender and deliver to your webhook\n\n**Webhook Delivery:**\n- We POST to your `callback_url` with JSON body containing files (matching EmailCASFile schema)\n- Failed deliveries are retried automatically with exponential backoff\n\n**Inactivity:**\n- Inbound emails with no activity in 30 days are marked inactive\n- Active inbound emails remain operational indefinitely\n\n\n### Parameters\n\n- `callback_url: string`\n Webhook URL where we POST email notifications.\nMust be HTTPS in production (HTTP allowed for localhost during development).\n\n\n- `alias?: string`\n Optional custom email prefix for user-friendly addresses.\n- Must be 3-32 characters\n- Alphanumeric + hyphens only\n- Must start and end with letter/number\n- Example: `john-portfolio@import.casparser.in`\n- If omitted, generates random ID like `ie_abc123xyz@import.casparser.in`\n\n\n- `allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[]`\n Filter emails by CAS provider. If omitted, accepts all providers.\n- `cdsl` → eCAS@cdslstatement.com\n- `nsdl` → NSDL-CAS@nsdl.co.in\n- `cams` → donotreply@camsonline.com\n- `kfintech` → samfS@kfintech.com\n\n\n- `metadata?: object`\n Optional key-value pairs (max 10) to include in webhook payload.\nUseful for passing context like plan_type, campaign_id, etc.\n\n\n- `reference?: string`\n Your internal identifier (e.g., user_id, account_id).\nReturned in webhook payload for correlation.\n\n\n### Returns\n\n- `{ allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[]; callback_url?: string; created_at?: string; email?: string; inbound_email_id?: string; metadata?: object; reference?: string; status?: 'active' | 'paused'; updated_at?: string; }`\n An inbound email address for receiving forwarded CAS emails\n\n - `allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[]`\n - `callback_url?: string`\n - `created_at?: string`\n - `email?: string`\n - `inbound_email_id?: string`\n - `metadata?: object`\n - `reference?: string`\n - `status?: 'active' | 'paused'`\n - `updated_at?: string`\n\n### Example\n\n```typescript\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser();\n\nconst inboundEmail = await client.inboundEmail.create({ callback_url: 'https://api.yourapp.com/webhooks/cas-email' });\n\nconsole.log(inboundEmail);\n```", + "## create\n\n`client.inboundEmail.create(alias?: string, allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[], callback_url?: string, metadata?: object, reference?: string): { allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[]; callback_url?: string; created_at?: string; email?: string; inbound_email_id?: string; metadata?: object; reference?: string; status?: 'active' | 'paused'; updated_at?: string; }`\n\n**post** `/v4/inbound-email`\n\nCreate a dedicated inbound email address for collecting CAS statements\nvia email forwarding. When an investor forwards a CAS email to this\naddress, we verify the sender and make the file available to you.\n\n`callback_url` is **optional**:\n- **Set it** — we POST each parsed email to your webhook as it arrives.\n- **Omit it** — retrieve files via `GET /v4/inbound-email/{id}/files`\n without building a webhook consumer.\n\n\n### Parameters\n\n- `alias?: string`\n Optional custom email prefix (e.g.\n`john-portfolio@import.casparser.in`). 3-32 chars,\nalphanumeric + hyphens, must start/end with a letter or\nnumber. If omitted, a random ID is generated.\n\n\n- `allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[]`\n Filter emails by CAS provider. If omitted, accepts all providers.\n- `cdsl` → eCAS@cdslstatement.com\n- `nsdl` → NSDL-CAS@nsdl.co.in\n- `cams` → donotreply@camsonline.com\n- `kfintech` → samfS@kfintech.com\n\n\n- `callback_url?: string`\n Optional webhook URL where we POST parsed emails. Must be\nHTTPS in production (HTTP allowed for localhost). If omitted,\nretrieve files via `GET /v4/inbound-email/{id}/files`.\n\n\n- `metadata?: object`\n Optional key-value pairs (max 10) to include in webhook payload.\nUseful for passing context like plan_type, campaign_id, etc.\n\n\n- `reference?: string`\n Your internal identifier (e.g., user_id, account_id).\nReturned in webhook payload for correlation.\n\n\n### Returns\n\n- `{ allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[]; callback_url?: string; created_at?: string; email?: string; inbound_email_id?: string; metadata?: object; reference?: string; status?: 'active' | 'paused'; updated_at?: string; }`\n An inbound email address for receiving forwarded CAS emails\n\n - `allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[]`\n - `callback_url?: string`\n - `created_at?: string`\n - `email?: string`\n - `inbound_email_id?: string`\n - `metadata?: object`\n - `reference?: string`\n - `status?: 'active' | 'paused'`\n - `updated_at?: string`\n\n### Example\n\n```typescript\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser();\n\nconst inboundEmail = await client.inboundEmail.create();\n\nconsole.log(inboundEmail);\n```", perLanguage: { go: { method: 'client.InboundEmail.New', 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\tinboundEmail, err := client.InboundEmail.New(context.TODO(), casparser.InboundEmailNewParams{\n\t\tCallbackURL: "https://api.yourapp.com/webhooks/cas-email",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", inboundEmail.InboundEmailID)\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\tinboundEmail, err := client.InboundEmail.New(context.TODO(), casparser.InboundEmailNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", inboundEmail.InboundEmailID)\n}\n', }, http: { example: - 'curl https://api.casparser.in/v4/inbound-email \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $CAS_PARSER_API_KEY" \\\n -d \'{\n "callback_url": "https://api.yourapp.com/webhooks/cas-email",\n "alias": "john-portfolio",\n "allowed_sources": [\n "cdsl",\n "nsdl"\n ],\n "metadata": {\n "plan": "premium",\n "source": "onboarding"\n },\n "reference": "user_12345"\n }\'', + 'curl https://api.casparser.in/v4/inbound-email \\\n -H \'Content-Type: application/json\' \\\n -H "x-api-key: $CAS_PARSER_API_KEY" \\\n -d \'{\n "alias": "john-portfolio",\n "allowed_sources": [\n "cdsl",\n "nsdl"\n ],\n "callback_url": "https://api.yourapp.com/webhooks/cas-email",\n "metadata": {\n "plan": "premium",\n "source": "onboarding"\n },\n "reference": "user_12345"\n }\'', }, java: { method: 'inboundEmail().create', example: - 'package com.cas_parser.api.example;\n\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\nimport com.cas_parser.api.models.inboundemail.InboundEmailCreateParams;\nimport com.cas_parser.api.models.inboundemail.InboundEmailCreateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n CasParserClient client = CasParserOkHttpClient.fromEnv();\n\n InboundEmailCreateParams params = InboundEmailCreateParams.builder()\n .callbackUrl("https://api.yourapp.com/webhooks/cas-email")\n .build();\n InboundEmailCreateResponse inboundEmail = client.inboundEmail().create(params);\n }\n}', + 'package com.cas_parser.api.example;\n\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\nimport com.cas_parser.api.models.inboundemail.InboundEmailCreateParams;\nimport com.cas_parser.api.models.inboundemail.InboundEmailCreateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n CasParserClient client = CasParserOkHttpClient.fromEnv();\n\n InboundEmailCreateResponse inboundEmail = client.inboundEmail().create();\n }\n}', }, php: { method: 'inboundEmail->create', example: - "inboundEmail->create(\n callbackURL: 'https://api.yourapp.com/webhooks/cas-email',\n alias: 'john-portfolio',\n allowedSources: ['cdsl', 'nsdl'],\n metadata: ['plan' => 'premium', 'source' => 'onboarding'],\n reference: 'user_12345',\n);\n\nvar_dump($inboundEmail);", + "inboundEmail->create(\n alias: 'john-portfolio',\n allowedSources: ['cdsl', 'nsdl'],\n callbackURL: 'https://api.yourapp.com/webhooks/cas-email',\n metadata: ['plan' => 'premium', 'source' => 'onboarding'],\n reference: 'user_12345',\n);\n\nvar_dump($inboundEmail);", }, python: { method: 'inbound_email.create', 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)\ninbound_email = client.inbound_email.create(\n callback_url="https://api.yourapp.com/webhooks/cas-email",\n)\nprint(inbound_email.inbound_email_id)', + '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)\ninbound_email = client.inbound_email.create()\nprint(inbound_email.inbound_email_id)', }, typescript: { method: 'client.inboundEmail.create', 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 inboundEmail = await client.inboundEmail.create({\n callback_url: 'https://api.yourapp.com/webhooks/cas-email',\n});\n\nconsole.log(inboundEmail.inbound_email_id);", + "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 inboundEmail = await client.inboundEmail.create();\n\nconsole.log(inboundEmail.inbound_email_id);", }, }, }, @@ -992,12 +992,12 @@ const EMBEDDED_METHODS: MethodEntry[] = [ response: "{ allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[]; callback_url?: string; created_at?: string; email?: string; inbound_email_id?: string; metadata?: object; reference?: string; status?: 'active' | 'paused'; updated_at?: string; }", markdown: - "## retrieve\n\n`client.inboundEmail.retrieve(inbound_email_id: string): { allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[]; callback_url?: string; created_at?: string; email?: string; inbound_email_id?: string; metadata?: object; reference?: string; status?: 'active' | 'paused'; updated_at?: string; }`\n\n**get** `/v4/inbound-email/{inbound_email_id}`\n\nRetrieve details of a specific mailbox including statistics.\n\n\n### Parameters\n\n- `inbound_email_id: string`\n\n### Returns\n\n- `{ allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[]; callback_url?: string; created_at?: string; email?: string; inbound_email_id?: string; metadata?: object; reference?: string; status?: 'active' | 'paused'; updated_at?: string; }`\n An inbound email address for receiving forwarded CAS emails\n\n - `allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[]`\n - `callback_url?: string`\n - `created_at?: string`\n - `email?: string`\n - `inbound_email_id?: string`\n - `metadata?: object`\n - `reference?: string`\n - `status?: 'active' | 'paused'`\n - `updated_at?: string`\n\n### Example\n\n```typescript\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser();\n\nconst inboundEmail = await client.inboundEmail.retrieve('ie_a1b2c3d4e5f6');\n\nconsole.log(inboundEmail);\n```", + "## retrieve\n\n`client.inboundEmail.retrieve(inbound_email_id: string): { allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[]; callback_url?: string; created_at?: string; email?: string; inbound_email_id?: string; metadata?: object; reference?: string; status?: 'active' | 'paused'; updated_at?: string; }`\n\n**get** `/v4/inbound-email/{inbound_email_id}`\n\nRetrieve details of a specific mailbox including statistics.\n\n\n### Parameters\n\n- `inbound_email_id: string`\n\n### Returns\n\n- `{ allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[]; callback_url?: string; created_at?: string; email?: string; inbound_email_id?: string; metadata?: object; reference?: string; status?: 'active' | 'paused'; updated_at?: string; }`\n An inbound email address for receiving forwarded CAS emails\n\n - `allowed_sources?: 'cdsl' | 'nsdl' | 'cams' | 'kfintech'[]`\n - `callback_url?: string`\n - `created_at?: string`\n - `email?: string`\n - `inbound_email_id?: string`\n - `metadata?: object`\n - `reference?: string`\n - `status?: 'active' | 'paused'`\n - `updated_at?: string`\n\n### Example\n\n```typescript\nimport CasParser from 'cas-parser-node';\n\nconst client = new CasParser();\n\nconst inboundEmail = await client.inboundEmail.retrieve('inbound_email_id');\n\nconsole.log(inboundEmail);\n```", perLanguage: { go: { method: 'client.InboundEmail.Get', 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\tinboundEmail, err := client.InboundEmail.Get(context.TODO(), "ie_a1b2c3d4e5f6")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", inboundEmail.InboundEmailID)\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\tinboundEmail, err := client.InboundEmail.Get(context.TODO(), "inbound_email_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", inboundEmail.InboundEmailID)\n}\n', }, http: { example: @@ -1006,22 +1006,22 @@ const EMBEDDED_METHODS: MethodEntry[] = [ java: { method: 'inboundEmail().retrieve', example: - 'package com.cas_parser.api.example;\n\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\nimport com.cas_parser.api.models.inboundemail.InboundEmailRetrieveParams;\nimport com.cas_parser.api.models.inboundemail.InboundEmailRetrieveResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n CasParserClient client = CasParserOkHttpClient.fromEnv();\n\n InboundEmailRetrieveResponse inboundEmail = client.inboundEmail().retrieve("ie_a1b2c3d4e5f6");\n }\n}', + 'package com.cas_parser.api.example;\n\nimport com.cas_parser.api.client.CasParserClient;\nimport com.cas_parser.api.client.okhttp.CasParserOkHttpClient;\nimport com.cas_parser.api.models.inboundemail.InboundEmailRetrieveParams;\nimport com.cas_parser.api.models.inboundemail.InboundEmailRetrieveResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n CasParserClient client = CasParserOkHttpClient.fromEnv();\n\n InboundEmailRetrieveResponse inboundEmail = client.inboundEmail().retrieve("inbound_email_id");\n }\n}', }, php: { method: 'inboundEmail->retrieve', example: - "inboundEmail->retrieve('ie_a1b2c3d4e5f6');\n\nvar_dump($inboundEmail);", + "inboundEmail->retrieve('inbound_email_id');\n\nvar_dump($inboundEmail);", }, python: { method: 'inbound_email.retrieve', 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)\ninbound_email = client.inbound_email.retrieve(\n "ie_a1b2c3d4e5f6",\n)\nprint(inbound_email.inbound_email_id)', + '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)\ninbound_email = client.inbound_email.retrieve(\n "inbound_email_id",\n)\nprint(inbound_email.inbound_email_id)', }, typescript: { method: 'client.inboundEmail.retrieve', 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 inboundEmail = await client.inboundEmail.retrieve('ie_a1b2c3d4e5f6');\n\nconsole.log(inboundEmail.inbound_email_id);", + "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 inboundEmail = await client.inboundEmail.retrieve('inbound_email_id');\n\nconsole.log(inboundEmail.inbound_email_id);", }, }, }, diff --git a/packages/mcp-server/src/server.ts b/packages/mcp-server/src/server.ts index c538b4b..99ad055 100644 --- a/packages/mcp-server/src/server.ts +++ b/packages/mcp-server/src/server.ts @@ -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 }), diff --git a/src/resources/inbound-email.ts b/src/resources/inbound-email.ts index 41d172d..fdb76b9 100644 --- a/src/resources/inbound-email.ts +++ b/src/resources/inbound-email.ts @@ -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 { @@ -69,7 +54,7 @@ export class InboundEmail extends APIResource { * @example * ```ts * const inboundEmail = await client.inboundEmail.retrieve( - * 'ie_a1b2c3d4e5f6', + * 'inbound_email_id', * ); * ``` */ @@ -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 @@ -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 @@ -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 @@ -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; @@ -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. diff --git a/src/version.ts b/src/version.ts index e859c0a..c5ad6f9 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '1.10.5'; // x-release-please-version +export const VERSION = '1.11.0'; // x-release-please-version diff --git a/tests/api-resources/inbound-email.test.ts b/tests/api-resources/inbound-email.test.ts index 6a69ced..3448fb4 100644 --- a/tests/api-resources/inbound-email.test.ts +++ b/tests/api-resources/inbound-email.test.ts @@ -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; @@ -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;