cas-parser-node 1.4.1 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/CHANGELOG.md +128 -0
  2. package/LICENSE +1 -1
  3. package/README.md +30 -32
  4. package/client.d.mts +51 -7
  5. package/client.d.mts.map +1 -1
  6. package/client.d.ts +51 -7
  7. package/client.d.ts.map +1 -1
  8. package/client.js +56 -12
  9. package/client.js.map +1 -1
  10. package/client.mjs +56 -12
  11. package/client.mjs.map +1 -1
  12. package/internal/parse.d.mts.map +1 -1
  13. package/internal/parse.d.ts.map +1 -1
  14. package/internal/parse.js +5 -0
  15. package/internal/parse.js.map +1 -1
  16. package/internal/parse.mjs +5 -0
  17. package/internal/parse.mjs.map +1 -1
  18. package/internal/to-file.d.mts +1 -1
  19. package/internal/to-file.d.ts +1 -1
  20. package/internal/to-file.js +1 -1
  21. package/internal/to-file.mjs +1 -1
  22. package/internal/tslib.js +17 -17
  23. package/package.json +9 -10
  24. package/resources/access-token.d.mts +48 -0
  25. package/resources/access-token.d.mts.map +1 -0
  26. package/resources/access-token.d.ts +48 -0
  27. package/resources/access-token.d.ts.map +1 -0
  28. package/resources/access-token.js +30 -0
  29. package/resources/access-token.js.map +1 -0
  30. package/resources/access-token.mjs +26 -0
  31. package/resources/access-token.mjs.map +1 -0
  32. package/resources/{cas-parser.d.mts → cams-kfintech.d.mts} +282 -105
  33. package/resources/cams-kfintech.d.mts.map +1 -0
  34. package/resources/{cas-parser.d.ts → cams-kfintech.d.ts} +282 -105
  35. package/resources/cams-kfintech.d.ts.map +1 -0
  36. package/resources/cams-kfintech.js +18 -0
  37. package/resources/cams-kfintech.js.map +1 -0
  38. package/resources/cams-kfintech.mjs +14 -0
  39. package/resources/cams-kfintech.mjs.map +1 -0
  40. package/resources/cdsl/cdsl.d.mts +39 -0
  41. package/resources/cdsl/cdsl.d.mts.map +1 -0
  42. package/resources/cdsl/cdsl.d.ts +39 -0
  43. package/resources/cdsl/cdsl.d.ts.map +1 -0
  44. package/resources/cdsl/cdsl.js +31 -0
  45. package/resources/cdsl/cdsl.js.map +1 -0
  46. package/resources/cdsl/cdsl.mjs +26 -0
  47. package/resources/cdsl/cdsl.mjs.map +1 -0
  48. package/resources/cdsl/fetch.d.mts +91 -0
  49. package/resources/cdsl/fetch.d.mts.map +1 -0
  50. package/resources/cdsl/fetch.d.ts +91 -0
  51. package/resources/cdsl/fetch.d.ts.map +1 -0
  52. package/resources/cdsl/fetch.js +50 -0
  53. package/resources/cdsl/fetch.js.map +1 -0
  54. package/resources/cdsl/fetch.mjs +46 -0
  55. package/resources/cdsl/fetch.mjs.map +1 -0
  56. package/resources/cdsl/index.d.mts +3 -0
  57. package/resources/cdsl/index.d.mts.map +1 -0
  58. package/resources/cdsl/index.d.ts +3 -0
  59. package/resources/cdsl/index.d.ts.map +1 -0
  60. package/resources/cdsl/index.js +9 -0
  61. package/resources/cdsl/index.js.map +1 -0
  62. package/resources/cdsl/index.mjs +4 -0
  63. package/resources/cdsl/index.mjs.map +1 -0
  64. package/resources/cdsl.d.mts +2 -0
  65. package/resources/cdsl.d.mts.map +1 -0
  66. package/resources/cdsl.d.ts +2 -0
  67. package/resources/cdsl.d.ts.map +1 -0
  68. package/resources/cdsl.js +6 -0
  69. package/resources/cdsl.js.map +1 -0
  70. package/resources/cdsl.mjs +3 -0
  71. package/resources/cdsl.mjs.map +1 -0
  72. package/resources/contract-note.d.mts +323 -0
  73. package/resources/contract-note.d.mts.map +1 -0
  74. package/resources/contract-note.d.ts +323 -0
  75. package/resources/contract-note.d.ts.map +1 -0
  76. package/resources/contract-note.js +49 -0
  77. package/resources/contract-note.js.map +1 -0
  78. package/resources/contract-note.mjs +45 -0
  79. package/resources/contract-note.mjs.map +1 -0
  80. package/resources/credits.d.mts +47 -0
  81. package/resources/credits.d.mts.map +1 -0
  82. package/resources/credits.d.ts +47 -0
  83. package/resources/credits.d.ts.map +1 -0
  84. package/resources/credits.js +23 -0
  85. package/resources/credits.js.map +1 -0
  86. package/resources/credits.mjs +19 -0
  87. package/resources/credits.mjs.map +1 -0
  88. package/resources/inbox.d.mts +206 -0
  89. package/resources/inbox.d.mts.map +1 -0
  90. package/resources/inbox.d.ts +206 -0
  91. package/resources/inbox.d.ts.map +1 -0
  92. package/resources/inbox.js +109 -0
  93. package/resources/inbox.js.map +1 -0
  94. package/resources/inbox.mjs +105 -0
  95. package/resources/inbox.mjs.map +1 -0
  96. package/resources/index.d.mts +11 -2
  97. package/resources/index.d.mts.map +1 -1
  98. package/resources/index.d.ts +11 -2
  99. package/resources/index.d.ts.map +1 -1
  100. package/resources/index.js +23 -5
  101. package/resources/index.js.map +1 -1
  102. package/resources/index.mjs +11 -2
  103. package/resources/index.mjs.map +1 -1
  104. package/resources/kfintech.d.mts +53 -0
  105. package/resources/kfintech.d.mts.map +1 -0
  106. package/resources/kfintech.d.ts +53 -0
  107. package/resources/kfintech.d.ts.map +1 -0
  108. package/resources/kfintech.js +29 -0
  109. package/resources/kfintech.js.map +1 -0
  110. package/resources/kfintech.mjs +25 -0
  111. package/resources/kfintech.mjs.map +1 -0
  112. package/resources/logs.d.mts +129 -0
  113. package/resources/logs.d.mts.map +1 -0
  114. package/resources/logs.d.ts +129 -0
  115. package/resources/logs.d.ts.map +1 -0
  116. package/resources/logs.js +37 -0
  117. package/resources/logs.js.map +1 -0
  118. package/resources/logs.mjs +33 -0
  119. package/resources/logs.mjs.map +1 -0
  120. package/resources/nsdl.d.mts +30 -0
  121. package/resources/nsdl.d.mts.map +1 -0
  122. package/resources/nsdl.d.ts +30 -0
  123. package/resources/nsdl.d.ts.map +1 -0
  124. package/resources/nsdl.js +18 -0
  125. package/resources/nsdl.js.map +1 -0
  126. package/resources/nsdl.mjs +14 -0
  127. package/resources/nsdl.mjs.map +1 -0
  128. package/resources/smart.d.mts +31 -0
  129. package/resources/smart.d.mts.map +1 -0
  130. package/resources/smart.d.ts +31 -0
  131. package/resources/smart.d.ts.map +1 -0
  132. package/resources/smart.js +19 -0
  133. package/resources/smart.js.map +1 -0
  134. package/resources/smart.mjs +15 -0
  135. package/resources/smart.mjs.map +1 -0
  136. package/resources/verify-token.d.mts +28 -0
  137. package/resources/verify-token.d.mts.map +1 -0
  138. package/resources/verify-token.d.ts +28 -0
  139. package/resources/verify-token.d.ts.map +1 -0
  140. package/resources/verify-token.js +16 -0
  141. package/resources/verify-token.js.map +1 -0
  142. package/resources/verify-token.mjs +12 -0
  143. package/resources/verify-token.mjs.map +1 -0
  144. package/src/client.ts +143 -31
  145. package/src/internal/parse.ts +6 -0
  146. package/src/internal/to-file.ts +1 -1
  147. package/src/resources/access-token.ts +63 -0
  148. package/src/resources/{cas-parser.ts → cams-kfintech.ts} +340 -130
  149. package/src/resources/cdsl/cdsl.ts +67 -0
  150. package/src/resources/cdsl/fetch.ts +122 -0
  151. package/src/resources/cdsl/index.ts +10 -0
  152. package/src/resources/cdsl.ts +3 -0
  153. package/src/resources/contract-note.ts +402 -0
  154. package/src/resources/credits.ts +58 -0
  155. package/src/resources/inbox.ts +283 -0
  156. package/src/resources/index.ts +31 -11
  157. package/src/resources/kfintech.ts +71 -0
  158. package/src/resources/logs.ts +170 -0
  159. package/src/resources/nsdl.ts +42 -0
  160. package/src/resources/smart.ts +46 -0
  161. package/src/resources/verify-token.ts +36 -0
  162. package/src/version.ts +1 -1
  163. package/version.d.mts +1 -1
  164. package/version.d.ts +1 -1
  165. package/version.js +1 -1
  166. package/version.mjs +1 -1
  167. package/resources/cas-generator.d.mts +0 -56
  168. package/resources/cas-generator.d.mts.map +0 -1
  169. package/resources/cas-generator.d.ts +0 -56
  170. package/resources/cas-generator.d.ts.map +0 -1
  171. package/resources/cas-generator.js +0 -27
  172. package/resources/cas-generator.js.map +0 -1
  173. package/resources/cas-generator.mjs +0 -23
  174. package/resources/cas-generator.mjs.map +0 -1
  175. package/resources/cas-parser.d.mts.map +0 -1
  176. package/resources/cas-parser.d.ts.map +0 -1
  177. package/resources/cas-parser.js +0 -43
  178. package/resources/cas-parser.js.map +0 -1
  179. package/resources/cas-parser.mjs +0 -39
  180. package/resources/cas-parser.mjs.map +0 -1
  181. package/src/resources/cas-generator.ts +0 -75
@@ -0,0 +1,39 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import * as CamsKfintechAPI from "../cams-kfintech.js";
3
+ import * as FetchAPI from "./fetch.js";
4
+ import { Fetch, FetchRequestOtpParams, FetchRequestOtpResponse, FetchVerifyOtpParams, FetchVerifyOtpResponse } from "./fetch.js";
5
+ import { APIPromise } from "../../core/api-promise.js";
6
+ import { RequestOptions } from "../../internal/request-options.js";
7
+ export declare class Cdsl extends APIResource {
8
+ fetch: FetchAPI.Fetch;
9
+ /**
10
+ * This endpoint specifically parses CDSL CAS (Consolidated Account Statement) PDF
11
+ * files and returns data in a unified format. Use this endpoint when you know the
12
+ * PDF is from CDSL.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const unifiedResponse = await client.cdsl.parsePdf();
17
+ * ```
18
+ */
19
+ parsePdf(body: CdslParsePdfParams, options?: RequestOptions): APIPromise<CamsKfintechAPI.UnifiedResponse>;
20
+ }
21
+ export interface CdslParsePdfParams {
22
+ /**
23
+ * Password for the PDF file (if required)
24
+ */
25
+ password?: string;
26
+ /**
27
+ * Base64 encoded CAS PDF file (required if pdf_url not provided)
28
+ */
29
+ pdf_file?: string;
30
+ /**
31
+ * URL to the CAS PDF file (required if pdf_file not provided)
32
+ */
33
+ pdf_url?: string;
34
+ }
35
+ export declare namespace Cdsl {
36
+ export { type CdslParsePdfParams as CdslParsePdfParams };
37
+ export { Fetch as Fetch, type FetchRequestOtpResponse as FetchRequestOtpResponse, type FetchVerifyOtpResponse as FetchVerifyOtpResponse, type FetchRequestOtpParams as FetchRequestOtpParams, type FetchVerifyOtpParams as FetchVerifyOtpParams, };
38
+ }
39
+ //# sourceMappingURL=cdsl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cdsl.d.ts","sourceRoot":"","sources":["../../src/resources/cdsl/cdsl.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,eAAe;OACpB,KAAK,QAAQ;OACb,EACL,KAAK,EACL,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,sBAAsB,EACvB;OACM,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,IAAK,SAAQ,WAAW;IACnC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAoC;IAEzD;;;;;;;;;OASG;IACH,QAAQ,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,eAAe,CAAC,eAAe,CAAC;CAM1G;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAID,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EAAE,KAAK,kBAAkB,IAAI,kBAAkB,EAAE,CAAC;IAEzD,OAAO,EACL,KAAK,IAAI,KAAK,EACd,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Cdsl = void 0;
5
+ const tslib_1 = require("../../internal/tslib.js");
6
+ const resource_1 = require("../../core/resource.js");
7
+ const FetchAPI = tslib_1.__importStar(require("./fetch.js"));
8
+ const fetch_1 = require("./fetch.js");
9
+ const uploads_1 = require("../../internal/uploads.js");
10
+ class Cdsl extends resource_1.APIResource {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.fetch = new FetchAPI.Fetch(this._client);
14
+ }
15
+ /**
16
+ * This endpoint specifically parses CDSL CAS (Consolidated Account Statement) PDF
17
+ * files and returns data in a unified format. Use this endpoint when you know the
18
+ * PDF is from CDSL.
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * const unifiedResponse = await client.cdsl.parsePdf();
23
+ * ```
24
+ */
25
+ parsePdf(body, options) {
26
+ return this._client.post('/v4/cdsl/parse', (0, uploads_1.maybeMultipartFormRequestOptions)({ body, ...options }, this._client));
27
+ }
28
+ }
29
+ exports.Cdsl = Cdsl;
30
+ Cdsl.Fetch = fetch_1.Fetch;
31
+ //# sourceMappingURL=cdsl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cdsl.js","sourceRoot":"","sources":["../../src/resources/cdsl/cdsl.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAElD,6DAAoC;AACpC,sCAMiB;AAGjB,uDAA0E;AAE1E,MAAa,IAAK,SAAQ,sBAAW;IAArC;;QACE,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAkB3D,CAAC;IAhBC;;;;;;;;;OASG;IACH,QAAQ,CAAC,IAAwB,EAAE,OAAwB;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB,gBAAgB,EAChB,IAAA,0CAAgC,EAAC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CACrE,CAAC;IACJ,CAAC;CACF;AAnBD,oBAmBC;AAmBD,IAAI,CAAC,KAAK,GAAG,aAAK,CAAC"}
@@ -0,0 +1,26 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../core/resource.mjs";
3
+ import * as FetchAPI from "./fetch.mjs";
4
+ import { Fetch, } from "./fetch.mjs";
5
+ import { maybeMultipartFormRequestOptions } from "../../internal/uploads.mjs";
6
+ export class Cdsl extends APIResource {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.fetch = new FetchAPI.Fetch(this._client);
10
+ }
11
+ /**
12
+ * This endpoint specifically parses CDSL CAS (Consolidated Account Statement) PDF
13
+ * files and returns data in a unified format. Use this endpoint when you know the
14
+ * PDF is from CDSL.
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * const unifiedResponse = await client.cdsl.parsePdf();
19
+ * ```
20
+ */
21
+ parsePdf(body, options) {
22
+ return this._client.post('/v4/cdsl/parse', maybeMultipartFormRequestOptions({ body, ...options }, this._client));
23
+ }
24
+ }
25
+ Cdsl.Fetch = Fetch;
26
+ //# sourceMappingURL=cdsl.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cdsl.mjs","sourceRoot":"","sources":["../../src/resources/cdsl/cdsl.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,KAAK,QAAQ;OACb,EACL,KAAK,GAKN;OAGM,EAAE,gCAAgC,EAAE;AAE3C,MAAM,OAAO,IAAK,SAAQ,WAAW;IAArC;;QACE,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAkB3D,CAAC;IAhBC;;;;;;;;;OASG;IACH,QAAQ,CAAC,IAAwB,EAAE,OAAwB;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB,gBAAgB,EAChB,gCAAgC,CAAC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CACrE,CAAC;IACJ,CAAC;CACF;AAmBD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC"}
@@ -0,0 +1,91 @@
1
+ import { APIResource } from "../../core/resource.mjs";
2
+ import { APIPromise } from "../../core/api-promise.mjs";
3
+ import { RequestOptions } from "../../internal/request-options.mjs";
4
+ export declare class Fetch extends APIResource {
5
+ /**
6
+ * **Step 1 of 2**: Request OTP for CDSL CAS fetch.
7
+ *
8
+ * This endpoint:
9
+ *
10
+ * 1. Solves reCAPTCHA automatically (~15-20 seconds)
11
+ * 2. Submits login credentials to CDSL portal
12
+ * 3. Triggers OTP to user's registered mobile number
13
+ *
14
+ * After user receives OTP, call `/v4/cdsl/fetch/{session_id}/verify` to complete.
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * const response = await client.cdsl.fetch.requestOtp({
19
+ * bo_id: '1234567890123456',
20
+ * dob: '1990-01-15',
21
+ * pan: 'ABCDE1234F',
22
+ * });
23
+ * ```
24
+ */
25
+ requestOtp(body: FetchRequestOtpParams, options?: RequestOptions): APIPromise<FetchRequestOtpResponse>;
26
+ /**
27
+ * **Step 2 of 2**: Verify OTP and retrieve CDSL CAS files.
28
+ *
29
+ * After successful verification, CAS PDFs are fetched from CDSL portal, uploaded
30
+ * to cloud storage, and returned as direct download URLs.
31
+ *
32
+ * @example
33
+ * ```ts
34
+ * const response = await client.cdsl.fetch.verifyOtp(
35
+ * 'session_id',
36
+ * { otp: '123456' },
37
+ * );
38
+ * ```
39
+ */
40
+ verifyOtp(sessionID: string, body: FetchVerifyOtpParams, options?: RequestOptions): APIPromise<FetchVerifyOtpResponse>;
41
+ }
42
+ export interface FetchRequestOtpResponse {
43
+ msg?: string;
44
+ /**
45
+ * Session ID for verify step
46
+ */
47
+ session_id?: string;
48
+ status?: string;
49
+ }
50
+ export interface FetchVerifyOtpResponse {
51
+ files?: Array<FetchVerifyOtpResponse.File>;
52
+ msg?: string;
53
+ status?: string;
54
+ }
55
+ export declare namespace FetchVerifyOtpResponse {
56
+ interface File {
57
+ filename?: string;
58
+ /**
59
+ * Direct download URL (cloud storage)
60
+ */
61
+ url?: string;
62
+ }
63
+ }
64
+ export interface FetchRequestOtpParams {
65
+ /**
66
+ * CDSL BO ID (16 digits)
67
+ */
68
+ bo_id: string;
69
+ /**
70
+ * Date of birth (YYYY-MM-DD)
71
+ */
72
+ dob: string;
73
+ /**
74
+ * PAN number
75
+ */
76
+ pan: string;
77
+ }
78
+ export interface FetchVerifyOtpParams {
79
+ /**
80
+ * OTP received on mobile
81
+ */
82
+ otp: string;
83
+ /**
84
+ * Number of monthly statements to fetch (default 6)
85
+ */
86
+ num_periods?: number;
87
+ }
88
+ export declare namespace Fetch {
89
+ export { type FetchRequestOtpResponse as FetchRequestOtpResponse, type FetchVerifyOtpResponse as FetchVerifyOtpResponse, type FetchRequestOtpParams as FetchRequestOtpParams, type FetchVerifyOtpParams as FetchVerifyOtpParams, };
90
+ }
91
+ //# sourceMappingURL=fetch.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch.d.mts","sourceRoot":"","sources":["../../src/resources/cdsl/fetch.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,UAAU,CAAC,IAAI,EAAE,qBAAqB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;IAItG;;;;;;;;;;;;;OAaG;IACH,SAAS,CACP,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,oBAAoB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,sBAAsB,CAAC;CAGtC;AAED,MAAM,WAAW,uBAAuB;IACtC,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,EAAE,KAAK,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;IAE3C,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,yBAAiB,sBAAsB,CAAC;IACtC,UAAiB,IAAI;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAElB;;WAEG;QACH,GAAG,CAAC,EAAE,MAAM,CAAC;KACd;CACF;AAED,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
@@ -0,0 +1,91 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import { APIPromise } from "../../core/api-promise.js";
3
+ import { RequestOptions } from "../../internal/request-options.js";
4
+ export declare class Fetch extends APIResource {
5
+ /**
6
+ * **Step 1 of 2**: Request OTP for CDSL CAS fetch.
7
+ *
8
+ * This endpoint:
9
+ *
10
+ * 1. Solves reCAPTCHA automatically (~15-20 seconds)
11
+ * 2. Submits login credentials to CDSL portal
12
+ * 3. Triggers OTP to user's registered mobile number
13
+ *
14
+ * After user receives OTP, call `/v4/cdsl/fetch/{session_id}/verify` to complete.
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * const response = await client.cdsl.fetch.requestOtp({
19
+ * bo_id: '1234567890123456',
20
+ * dob: '1990-01-15',
21
+ * pan: 'ABCDE1234F',
22
+ * });
23
+ * ```
24
+ */
25
+ requestOtp(body: FetchRequestOtpParams, options?: RequestOptions): APIPromise<FetchRequestOtpResponse>;
26
+ /**
27
+ * **Step 2 of 2**: Verify OTP and retrieve CDSL CAS files.
28
+ *
29
+ * After successful verification, CAS PDFs are fetched from CDSL portal, uploaded
30
+ * to cloud storage, and returned as direct download URLs.
31
+ *
32
+ * @example
33
+ * ```ts
34
+ * const response = await client.cdsl.fetch.verifyOtp(
35
+ * 'session_id',
36
+ * { otp: '123456' },
37
+ * );
38
+ * ```
39
+ */
40
+ verifyOtp(sessionID: string, body: FetchVerifyOtpParams, options?: RequestOptions): APIPromise<FetchVerifyOtpResponse>;
41
+ }
42
+ export interface FetchRequestOtpResponse {
43
+ msg?: string;
44
+ /**
45
+ * Session ID for verify step
46
+ */
47
+ session_id?: string;
48
+ status?: string;
49
+ }
50
+ export interface FetchVerifyOtpResponse {
51
+ files?: Array<FetchVerifyOtpResponse.File>;
52
+ msg?: string;
53
+ status?: string;
54
+ }
55
+ export declare namespace FetchVerifyOtpResponse {
56
+ interface File {
57
+ filename?: string;
58
+ /**
59
+ * Direct download URL (cloud storage)
60
+ */
61
+ url?: string;
62
+ }
63
+ }
64
+ export interface FetchRequestOtpParams {
65
+ /**
66
+ * CDSL BO ID (16 digits)
67
+ */
68
+ bo_id: string;
69
+ /**
70
+ * Date of birth (YYYY-MM-DD)
71
+ */
72
+ dob: string;
73
+ /**
74
+ * PAN number
75
+ */
76
+ pan: string;
77
+ }
78
+ export interface FetchVerifyOtpParams {
79
+ /**
80
+ * OTP received on mobile
81
+ */
82
+ otp: string;
83
+ /**
84
+ * Number of monthly statements to fetch (default 6)
85
+ */
86
+ num_periods?: number;
87
+ }
88
+ export declare namespace Fetch {
89
+ export { type FetchRequestOtpResponse as FetchRequestOtpResponse, type FetchVerifyOtpResponse as FetchVerifyOtpResponse, type FetchRequestOtpParams as FetchRequestOtpParams, type FetchVerifyOtpParams as FetchVerifyOtpParams, };
90
+ }
91
+ //# sourceMappingURL=fetch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/resources/cdsl/fetch.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,UAAU,CAAC,IAAI,EAAE,qBAAqB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;IAItG;;;;;;;;;;;;;OAaG;IACH,SAAS,CACP,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,oBAAoB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,sBAAsB,CAAC;CAGtC;AAED,MAAM,WAAW,uBAAuB;IACtC,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,EAAE,KAAK,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;IAE3C,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,yBAAiB,sBAAsB,CAAC;IACtC,UAAiB,IAAI;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAElB;;WAEG;QACH,GAAG,CAAC,EAAE,MAAM,CAAC;KACd;CACF;AAED,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Fetch = void 0;
5
+ const resource_1 = require("../../core/resource.js");
6
+ const path_1 = require("../../internal/utils/path.js");
7
+ class Fetch extends resource_1.APIResource {
8
+ /**
9
+ * **Step 1 of 2**: Request OTP for CDSL CAS fetch.
10
+ *
11
+ * This endpoint:
12
+ *
13
+ * 1. Solves reCAPTCHA automatically (~15-20 seconds)
14
+ * 2. Submits login credentials to CDSL portal
15
+ * 3. Triggers OTP to user's registered mobile number
16
+ *
17
+ * After user receives OTP, call `/v4/cdsl/fetch/{session_id}/verify` to complete.
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * const response = await client.cdsl.fetch.requestOtp({
22
+ * bo_id: '1234567890123456',
23
+ * dob: '1990-01-15',
24
+ * pan: 'ABCDE1234F',
25
+ * });
26
+ * ```
27
+ */
28
+ requestOtp(body, options) {
29
+ return this._client.post('/v4/cdsl/fetch', { body, ...options });
30
+ }
31
+ /**
32
+ * **Step 2 of 2**: Verify OTP and retrieve CDSL CAS files.
33
+ *
34
+ * After successful verification, CAS PDFs are fetched from CDSL portal, uploaded
35
+ * to cloud storage, and returned as direct download URLs.
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * const response = await client.cdsl.fetch.verifyOtp(
40
+ * 'session_id',
41
+ * { otp: '123456' },
42
+ * );
43
+ * ```
44
+ */
45
+ verifyOtp(sessionID, body, options) {
46
+ return this._client.post((0, path_1.path) `/v4/cdsl/fetch/${sessionID}/verify`, { body, ...options });
47
+ }
48
+ }
49
+ exports.Fetch = Fetch;
50
+ //# sourceMappingURL=fetch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../src/resources/cdsl/fetch.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAGlD,uDAAiD;AAEjD,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,UAAU,CAAC,IAA2B,EAAE,OAAwB;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,SAAS,CACP,SAAiB,EACjB,IAA0B,EAC1B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,kBAAkB,SAAS,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3F,CAAC;CACF;AA9CD,sBA8CC"}
@@ -0,0 +1,46 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../core/resource.mjs";
3
+ import { path } from "../../internal/utils/path.mjs";
4
+ export class Fetch extends APIResource {
5
+ /**
6
+ * **Step 1 of 2**: Request OTP for CDSL CAS fetch.
7
+ *
8
+ * This endpoint:
9
+ *
10
+ * 1. Solves reCAPTCHA automatically (~15-20 seconds)
11
+ * 2. Submits login credentials to CDSL portal
12
+ * 3. Triggers OTP to user's registered mobile number
13
+ *
14
+ * After user receives OTP, call `/v4/cdsl/fetch/{session_id}/verify` to complete.
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * const response = await client.cdsl.fetch.requestOtp({
19
+ * bo_id: '1234567890123456',
20
+ * dob: '1990-01-15',
21
+ * pan: 'ABCDE1234F',
22
+ * });
23
+ * ```
24
+ */
25
+ requestOtp(body, options) {
26
+ return this._client.post('/v4/cdsl/fetch', { body, ...options });
27
+ }
28
+ /**
29
+ * **Step 2 of 2**: Verify OTP and retrieve CDSL CAS files.
30
+ *
31
+ * After successful verification, CAS PDFs are fetched from CDSL portal, uploaded
32
+ * to cloud storage, and returned as direct download URLs.
33
+ *
34
+ * @example
35
+ * ```ts
36
+ * const response = await client.cdsl.fetch.verifyOtp(
37
+ * 'session_id',
38
+ * { otp: '123456' },
39
+ * );
40
+ * ```
41
+ */
42
+ verifyOtp(sessionID, body, options) {
43
+ return this._client.post(path `/v4/cdsl/fetch/${sessionID}/verify`, { body, ...options });
44
+ }
45
+ }
46
+ //# sourceMappingURL=fetch.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch.mjs","sourceRoot":"","sources":["../../src/resources/cdsl/fetch.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,UAAU,CAAC,IAA2B,EAAE,OAAwB;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,SAAS,CACP,SAAiB,EACjB,IAA0B,EAC1B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,kBAAkB,SAAS,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3F,CAAC;CACF"}
@@ -0,0 +1,3 @@
1
+ export { Cdsl, type CdslParsePdfParams } from "./cdsl.mjs";
2
+ export { Fetch, type FetchRequestOtpResponse, type FetchVerifyOtpResponse, type FetchRequestOtpParams, type FetchVerifyOtpParams, } from "./fetch.mjs";
3
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/cdsl/index.ts"],"names":[],"mappings":"OAEO,EAAE,IAAI,EAAE,KAAK,kBAAkB,EAAE;OACjC,EACL,KAAK,EACL,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,GAC1B"}
@@ -0,0 +1,3 @@
1
+ export { Cdsl, type CdslParsePdfParams } from "./cdsl.js";
2
+ export { Fetch, type FetchRequestOtpResponse, type FetchVerifyOtpResponse, type FetchRequestOtpParams, type FetchVerifyOtpParams, } from "./fetch.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/cdsl/index.ts"],"names":[],"mappings":"OAEO,EAAE,IAAI,EAAE,KAAK,kBAAkB,EAAE;OACjC,EACL,KAAK,EACL,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,GAC1B"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Fetch = exports.Cdsl = void 0;
5
+ var cdsl_1 = require("./cdsl.js");
6
+ Object.defineProperty(exports, "Cdsl", { enumerable: true, get: function () { return cdsl_1.Cdsl; } });
7
+ var fetch_1 = require("./fetch.js");
8
+ Object.defineProperty(exports, "Fetch", { enumerable: true, get: function () { return fetch_1.Fetch; } });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/cdsl/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kCAAuD;AAA9C,4FAAA,IAAI,OAAA;AACb,oCAMiB;AALf,8FAAA,KAAK,OAAA"}
@@ -0,0 +1,4 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export { Cdsl } from "./cdsl.mjs";
3
+ export { Fetch, } from "./fetch.mjs";
4
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/cdsl/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,IAAI,EAA2B;OACjC,EACL,KAAK,GAKN"}
@@ -0,0 +1,2 @@
1
+ export * from "./cdsl/index.mjs";
2
+ //# sourceMappingURL=cdsl.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cdsl.d.mts","sourceRoot":"","sources":["../src/resources/cdsl.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from "./cdsl/index.js";
2
+ //# sourceMappingURL=cdsl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cdsl.d.ts","sourceRoot":"","sources":["../src/resources/cdsl.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const tslib_1 = require("../internal/tslib.js");
5
+ tslib_1.__exportStar(require("./cdsl/index.js"), exports);
6
+ //# sourceMappingURL=cdsl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cdsl.js","sourceRoot":"","sources":["../src/resources/cdsl.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,0DAA6B"}
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export * from "./cdsl/index.mjs";
3
+ //# sourceMappingURL=cdsl.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cdsl.mjs","sourceRoot":"","sources":["../src/resources/cdsl.ts"],"names":[],"mappings":"AAAA,sFAAsF"}