aeremmiddleware 1.0.49 → 1.0.51

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.
@@ -1,4 +1,50 @@
1
1
  import { AxiosResponse } from "axios";
2
+ export interface Address {
3
+ city: string | null;
4
+ country: any;
5
+ full: any;
6
+ line_1: string | null;
7
+ line_2: string | null;
8
+ state: string | null;
9
+ street_name: string | null;
10
+ zip: string | null;
11
+ }
12
+ export interface SourceOutput {
13
+ aadhaar_linked: any;
14
+ address: Address;
15
+ age: any;
16
+ category: any;
17
+ dob: any;
18
+ dob_check: string | null;
19
+ dob_verified: string | null;
20
+ email: any;
21
+ father_name: string | null;
22
+ full_name: any;
23
+ full_name_split: any;
24
+ gender: any;
25
+ input_dob: string | null;
26
+ is_minor: any;
27
+ less_info: string | null;
28
+ masked_aadhaar: any;
29
+ pan_alloted_date: string | null;
30
+ pan_number: any;
31
+ phone_number: any;
32
+ status: string;
33
+ }
34
+ export interface Result {
35
+ source_output: SourceOutput;
36
+ }
37
+ export interface PANInfo {
38
+ action: string;
39
+ completed_at: string;
40
+ created_at: string;
41
+ group_id: string;
42
+ request_id: string;
43
+ result: Result;
44
+ status: string;
45
+ task_id: string;
46
+ type: string;
47
+ }
2
48
  export default class KycCartAPIWrapper {
3
49
  private apiKey;
4
50
  private baseUrl;
@@ -9,4 +55,7 @@ export default class KycCartAPIWrapper {
9
55
  name: string;
10
56
  checkId: string;
11
57
  }): Promise<AxiosResponse>;
58
+ getIndividualPANInfo({ panNo, }: {
59
+ panNo: string;
60
+ }): Promise<PANInfo[]>;
12
61
  }
@@ -42,6 +42,162 @@ class KycCartAPIWrapper {
42
42
  }
43
43
  });
44
44
  }
45
+ getIndividualPANInfo({ panNo, }) {
46
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7;
47
+ return __awaiter(this, void 0, void 0, function* () {
48
+ const form = new form_data_1.default();
49
+ form.append("panNumber", panNo);
50
+ try {
51
+ const response = yield axios_1.default.post(`${this.baseUrl}/panCard/panDetailedContactV4`, form, {
52
+ headers: Object.assign({ "x-api-key": this.apiKey }, form.getHeaders()),
53
+ });
54
+ const data = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.response;
55
+ const panInfo = {
56
+ action: "verify_with_source",
57
+ completed_at: (_c = (_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b.status) === null || _c === void 0 ? void 0 : _c.timestamp,
58
+ created_at: (_e = (_d = response === null || response === void 0 ? void 0 : response.data) === null || _d === void 0 ? void 0 : _d.status) === null || _e === void 0 ? void 0 : _e.timestamp,
59
+ group_id: (_g = (_f = response === null || response === void 0 ? void 0 : response.data) === null || _f === void 0 ? void 0 : _f.status) === null || _g === void 0 ? void 0 : _g.transactionId,
60
+ request_id: (_j = (_h = response === null || response === void 0 ? void 0 : response.data) === null || _h === void 0 ? void 0 : _h.status) === null || _j === void 0 ? void 0 : _j.transactionId,
61
+ result: {
62
+ source_output: {
63
+ aadhaar_linked: (_k = data.aadhaarSeedingStatus) !== null && _k !== void 0 ? _k : false,
64
+ address: {
65
+ city: (data === null || data === void 0 ? void 0 : data.city) || null,
66
+ country: (data === null || data === void 0 ? void 0 : data.country) || "India",
67
+ full: (data === null || data === void 0 ? void 0 : data.country) || "India",
68
+ line_1: (data === null || data === void 0 ? void 0 : data.address) || null,
69
+ line_2: (data === null || data === void 0 ? void 0 : data.address) || null,
70
+ state: (data === null || data === void 0 ? void 0 : data.state) || null,
71
+ street_name: null,
72
+ zip: (data === null || data === void 0 ? void 0 : data.pincode) || null,
73
+ },
74
+ age: 30,
75
+ category: (data === null || data === void 0 ? void 0 : data.typeOfHolder) || "person",
76
+ dob: (data === null || data === void 0 ? void 0 : data.dob) || "",
77
+ dob_check: null,
78
+ dob_verified: null,
79
+ email: (data === null || data === void 0 ? void 0 : data.email) || "",
80
+ father_name: (data === null || data === void 0 ? void 0 : data.middleName) || null,
81
+ full_name: (data === null || data === void 0 ? void 0 : data.name) || "",
82
+ full_name_split: [
83
+ data === null || data === void 0 ? void 0 : data.firstName,
84
+ data === null || data === void 0 ? void 0 : data.middleName,
85
+ data === null || data === void 0 ? void 0 : data.lastName,
86
+ ],
87
+ gender: (data === null || data === void 0 ? void 0 : data.gender) || "M",
88
+ input_dob: null,
89
+ is_minor: false,
90
+ less_info: null,
91
+ masked_aadhaar: (data === null || data === void 0 ? void 0 : data.maskedAadhaar) || "XXXXXXXXXXXX",
92
+ pan_alloted_date: null,
93
+ pan_number: panNo || "",
94
+ phone_number: "",
95
+ status: "id_found",
96
+ },
97
+ },
98
+ status: "completed",
99
+ task_id: (_m = (_l = response === null || response === void 0 ? void 0 : response.data) === null || _l === void 0 ? void 0 : _l.status) === null || _m === void 0 ? void 0 : _m.transactionId,
100
+ type: "ind_pan_plus",
101
+ };
102
+ const errorPAN = {
103
+ action: "verify_with_source",
104
+ completed_at: (_p = (_o = response === null || response === void 0 ? void 0 : response.data) === null || _o === void 0 ? void 0 : _o.status) === null || _p === void 0 ? void 0 : _p.timestamp,
105
+ created_at: (_r = (_q = response === null || response === void 0 ? void 0 : response.data) === null || _q === void 0 ? void 0 : _q.status) === null || _r === void 0 ? void 0 : _r.timestamp,
106
+ group_id: (_t = (_s = response === null || response === void 0 ? void 0 : response.data) === null || _s === void 0 ? void 0 : _s.status) === null || _t === void 0 ? void 0 : _t.transactionId,
107
+ request_id: (_v = (_u = response === null || response === void 0 ? void 0 : response.data) === null || _u === void 0 ? void 0 : _u.status) === null || _v === void 0 ? void 0 : _v.transactionId,
108
+ result: {
109
+ source_output: {
110
+ aadhaar_linked: null,
111
+ address: {
112
+ city: null,
113
+ country: null,
114
+ full: null,
115
+ line_1: null,
116
+ line_2: null,
117
+ state: null,
118
+ street_name: null,
119
+ zip: null,
120
+ },
121
+ age: null,
122
+ category: null,
123
+ dob: null,
124
+ dob_check: null,
125
+ dob_verified: null,
126
+ email: null,
127
+ father_name: null,
128
+ full_name: null,
129
+ full_name_split: null,
130
+ gender: null,
131
+ input_dob: null,
132
+ is_minor: null,
133
+ less_info: null,
134
+ masked_aadhaar: null,
135
+ pan_alloted_date: null,
136
+ pan_number: null,
137
+ phone_number: null,
138
+ status: "id_not_found",
139
+ },
140
+ },
141
+ status: "completed",
142
+ task_id: (_x = (_w = response === null || response === void 0 ? void 0 : response.data) === null || _w === void 0 ? void 0 : _w.status) === null || _x === void 0 ? void 0 : _x.transactionId,
143
+ type: "ind_pan_plus",
144
+ };
145
+ if (((_z = (_y = response === null || response === void 0 ? void 0 : response.data) === null || _y === void 0 ? void 0 : _y.response) === null || _z === void 0 ? void 0 : _z.code) == 200) {
146
+ return [panInfo];
147
+ }
148
+ else {
149
+ return [errorPAN];
150
+ }
151
+ }
152
+ catch (error) {
153
+ return [
154
+ {
155
+ action: "verify_with_source",
156
+ completed_at: (_1 = (_0 = error === null || error === void 0 ? void 0 : error.data) === null || _0 === void 0 ? void 0 : _0.status) === null || _1 === void 0 ? void 0 : _1.timestamp,
157
+ created_at: (_3 = (_2 = error === null || error === void 0 ? void 0 : error.data) === null || _2 === void 0 ? void 0 : _2.status) === null || _3 === void 0 ? void 0 : _3.timestamp,
158
+ group_id: (_5 = (_4 = error === null || error === void 0 ? void 0 : error.data) === null || _4 === void 0 ? void 0 : _4.status) === null || _5 === void 0 ? void 0 : _5.transactionId,
159
+ request_id: (_7 = (_6 = error === null || error === void 0 ? void 0 : error.data) === null || _6 === void 0 ? void 0 : _6.status) === null || _7 === void 0 ? void 0 : _7.transactionId,
160
+ result: {
161
+ source_output: {
162
+ aadhaar_linked: null,
163
+ address: {
164
+ city: null,
165
+ country: null,
166
+ full: null,
167
+ line_1: null,
168
+ line_2: null,
169
+ state: null,
170
+ street_name: null,
171
+ zip: null,
172
+ },
173
+ age: null,
174
+ category: null,
175
+ dob: null,
176
+ dob_check: null,
177
+ dob_verified: null,
178
+ email: null,
179
+ father_name: null,
180
+ full_name: null,
181
+ full_name_split: null,
182
+ gender: null,
183
+ input_dob: null,
184
+ is_minor: null,
185
+ less_info: null,
186
+ masked_aadhaar: null,
187
+ pan_alloted_date: null,
188
+ pan_number: null,
189
+ phone_number: null,
190
+ status: "id_not_found",
191
+ },
192
+ },
193
+ status: "failed",
194
+ task_id: "null",
195
+ type: "ind_pan_plus",
196
+ },
197
+ ];
198
+ }
199
+ });
200
+ }
45
201
  }
46
202
  exports.default = KycCartAPIWrapper;
47
203
  //# sourceMappingURL=kycKart.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"kycKart.js","sourceRoot":"","sources":["../../src/Finance/kycKart.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,kDAA6C;AAC7C,0DAAiC;AAEjC,MAAqB,iBAAiB;IAIlC,YAAY,MAAc;QACtB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,6BAA6B,CAAC;IACjD,CAAC;IAEY,eAAe,CAAC,EACzB,aAAa,EACb,IAAI,EACJ,IAAI,EACJ,OAAO,GAMV;;YACG,MAAM,IAAI,GAAG,IAAI,mBAAQ,EAAE,CAAC;YAC5B,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC;YAC5C,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YAC1B,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YAC1B,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;YAEhC,IAAI;gBACA,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,IAAI,CAC7B,GAAG,IAAI,CAAC,OAAO,wBAAwB,EACvC,IAAI,EACJ;oBACI,OAAO,kBACH,WAAW,EAAE,IAAI,CAAC,MAAM,IACrB,IAAI,CAAC,UAAU,EAAE,CACvB;iBACJ,CACJ,CAAC;gBACF,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Y,EAAE,IAAI;gCAClB,MAAM,EAAE,cAAc;6BACzB;yBACJ;wBACD,MAAM,EAAE,QAAQ;wBAChB,OAAO,EAAE,MAAM;wBACf,IAAI,EAAE,cAAc;qBACvB;iBACJ,CAAC;aACL;;KACJ;CACJ;AArND,oCAqNC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aeremmiddleware",
3
- "version": "1.0.49",
3
+ "version": "1.0.51",
4
4
  "description": "",
5
5
  "type": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,55 @@
1
1
  import axios, { AxiosResponse } from "axios";
2
2
  import FormData from "form-data";
3
3
 
4
+ export interface Address {
5
+ city: string | null;
6
+ country: any;
7
+ full: any;
8
+ line_1: string | null;
9
+ line_2: string | null;
10
+ state: string | null;
11
+ street_name: string | null;
12
+ zip: string | null;
13
+ }
14
+
15
+ export interface SourceOutput {
16
+ aadhaar_linked: any;
17
+ address: Address;
18
+ age: any;
19
+ category: any;
20
+ dob: any;
21
+ dob_check: string | null;
22
+ dob_verified: string | null;
23
+ email: any;
24
+ father_name: string | null;
25
+ full_name: any;
26
+ full_name_split: any;
27
+ gender: any;
28
+ input_dob: string | null;
29
+ is_minor: any;
30
+ less_info: string | null;
31
+ masked_aadhaar: any;
32
+ pan_alloted_date: string | null;
33
+ pan_number: any;
34
+ phone_number: any;
35
+ status: string;
36
+ }
37
+
38
+ export interface Result {
39
+ source_output: SourceOutput;
40
+ }
41
+
42
+ export interface PANInfo {
43
+ action: string;
44
+ completed_at: string;
45
+ created_at: string;
46
+ group_id: string;
47
+ request_id: string;
48
+ result: Result;
49
+ status: string;
50
+ task_id: string;
51
+ type: string;
52
+ }
4
53
  export default class KycCartAPIWrapper {
5
54
  private apiKey: string;
6
55
  private baseUrl: string;
@@ -48,4 +97,170 @@ export default class KycCartAPIWrapper {
48
97
  };
49
98
  }
50
99
  }
100
+
101
+ public async getIndividualPANInfo({
102
+ panNo,
103
+ }: {
104
+ panNo: string;
105
+ }): Promise<PANInfo[]> {
106
+ const form = new FormData();
107
+ form.append("panNumber", panNo);
108
+
109
+ try {
110
+ const response = await axios.post(
111
+ `${this.baseUrl}/panCard/panDetailedContactV4`,
112
+ form,
113
+ {
114
+ headers: {
115
+ "x-api-key": this.apiKey,
116
+ ...form.getHeaders(),
117
+ },
118
+ }
119
+ );
120
+ const data = response?.data?.response;
121
+ const panInfo: PANInfo = {
122
+ action: "verify_with_source",
123
+ completed_at: response?.data?.status?.timestamp,
124
+ created_at: response?.data?.status?.timestamp,
125
+ group_id: response?.data?.status?.transactionId,
126
+ request_id: response?.data?.status?.transactionId,
127
+ result: {
128
+ source_output: {
129
+ aadhaar_linked: data.aadhaarSeedingStatus ?? false,
130
+ address: {
131
+ city: data?.city || null,
132
+ country: data?.country || "India",
133
+ full: data?.country || "India",
134
+ line_1: data?.address || null,
135
+ line_2: data?.address || null,
136
+ state: data?.state || null,
137
+ street_name: null,
138
+ zip: data?.pincode || null,
139
+ },
140
+ age: 30,
141
+ category: data?.typeOfHolder || "person",
142
+ dob: data?.dob || "",
143
+ dob_check: null,
144
+ dob_verified: null,
145
+ email: data?.email || "",
146
+ father_name: data?.middleName || null,
147
+ full_name: data?.name || "",
148
+ full_name_split: [
149
+ data?.firstName,
150
+ data?.middleName,
151
+ data?.lastName,
152
+ ],
153
+ gender: data?.gender || "M",
154
+ input_dob: null,
155
+ is_minor: false,
156
+ less_info: null,
157
+ masked_aadhaar: data?.maskedAadhaar || "XXXXXXXXXXXX",
158
+ pan_alloted_date: null,
159
+ pan_number: panNo || "",
160
+ phone_number: "",
161
+ status: "id_found",
162
+ },
163
+ },
164
+ status: "completed",
165
+ task_id: response?.data?.status?.transactionId,
166
+ type: "ind_pan_plus",
167
+ };
168
+
169
+ const errorPAN = {
170
+ action: "verify_with_source",
171
+ completed_at: response?.data?.status?.timestamp,
172
+ created_at: response?.data?.status?.timestamp,
173
+ group_id: response?.data?.status?.transactionId,
174
+ request_id: response?.data?.status?.transactionId,
175
+ result: {
176
+ source_output: {
177
+ aadhaar_linked: null,
178
+ address: {
179
+ city: null,
180
+ country: null,
181
+ full: null,
182
+ line_1: null,
183
+ line_2: null,
184
+ state: null,
185
+ street_name: null,
186
+ zip: null,
187
+ },
188
+ age: null,
189
+ category: null,
190
+ dob: null,
191
+ dob_check: null,
192
+ dob_verified: null,
193
+ email: null,
194
+ father_name: null,
195
+ full_name: null,
196
+ full_name_split: null,
197
+ gender: null,
198
+ input_dob: null,
199
+ is_minor: null,
200
+ less_info: null,
201
+ masked_aadhaar: null,
202
+ pan_alloted_date: null,
203
+ pan_number: null,
204
+ phone_number: null,
205
+ status: "id_not_found",
206
+ },
207
+ },
208
+ status: "completed",
209
+ task_id: response?.data?.status?.transactionId,
210
+ type: "ind_pan_plus",
211
+ };
212
+
213
+ if (response?.data?.response?.code == 200) {
214
+ return [panInfo];
215
+ } else {
216
+ return [errorPAN];
217
+ }
218
+ } catch (error: any) {
219
+ return [
220
+ {
221
+ action: "verify_with_source",
222
+ completed_at: error?.data?.status?.timestamp,
223
+ created_at: error?.data?.status?.timestamp,
224
+ group_id: error?.data?.status?.transactionId,
225
+ request_id: error?.data?.status?.transactionId,
226
+ result: {
227
+ source_output: {
228
+ aadhaar_linked: null,
229
+ address: {
230
+ city: null,
231
+ country: null,
232
+ full: null,
233
+ line_1: null,
234
+ line_2: null,
235
+ state: null,
236
+ street_name: null,
237
+ zip: null,
238
+ },
239
+ age: null,
240
+ category: null,
241
+ dob: null,
242
+ dob_check: null,
243
+ dob_verified: null,
244
+ email: null,
245
+ father_name: null,
246
+ full_name: null,
247
+ full_name_split: null,
248
+ gender: null,
249
+ input_dob: null,
250
+ is_minor: null,
251
+ less_info: null,
252
+ masked_aadhaar: null,
253
+ pan_alloted_date: null,
254
+ pan_number: null,
255
+ phone_number: null,
256
+ status: "id_not_found",
257
+ },
258
+ },
259
+ status: "failed",
260
+ task_id: "null",
261
+ type: "ind_pan_plus",
262
+ },
263
+ ];
264
+ }
265
+ }
51
266
  }