aeremmiddleware 1.0.56 → 1.0.58

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 (36) hide show
  1. package/package.json +1 -1
  2. package/src/Finance/kycKart.ts +8 -5
  3. package/dist/Finance/auEncrypt.d.ts +0 -2
  4. package/dist/Finance/auEncrypt.js +0 -36
  5. package/dist/Finance/auEncrypt.js.map +0 -1
  6. package/dist/Finance/auFinance.d.ts +0 -50
  7. package/dist/Finance/auFinance.js +0 -74
  8. package/dist/Finance/auFinance.js.map +0 -1
  9. package/dist/Finance/kycKart.d.ts +0 -172
  10. package/dist/Finance/kycKart.js +0 -277
  11. package/dist/Finance/kycKart.js.map +0 -1
  12. package/dist/Finance/qbrik.d.ts +0 -101
  13. package/dist/Finance/qbrik.js +0 -507
  14. package/dist/Finance/qbrik.js.map +0 -1
  15. package/dist/Finance/qbrik.types.d.ts +0 -126
  16. package/dist/Finance/qbrik.types.js +0 -3
  17. package/dist/Finance/qbrik.types.js.map +0 -1
  18. package/dist/Finance/razorpay.d.ts +0 -28
  19. package/dist/Finance/razorpay.js +0 -68
  20. package/dist/Finance/razorpay.js.map +0 -1
  21. package/dist/Finance/response.json +0 -36
  22. package/dist/Finance/setu.d.ts +0 -107
  23. package/dist/Finance/setu.js +0 -499
  24. package/dist/Finance/setu.js.map +0 -1
  25. package/dist/Finance/setu.types.d.ts +0 -39
  26. package/dist/Finance/setu.types.js +0 -3
  27. package/dist/Finance/setu.types.js.map +0 -1
  28. package/dist/PushNotification/index.d.ts +0 -4
  29. package/dist/PushNotification/index.js +0 -11
  30. package/dist/PushNotification/index.js.map +0 -1
  31. package/dist/PushNotification/pushNotificationFCM.d.ts +0 -3
  32. package/dist/PushNotification/pushNotificationFCM.js +0 -43
  33. package/dist/PushNotification/pushNotificationFCM.js.map +0 -1
  34. package/dist/utils/convertToCamelcase.d.ts +0 -1
  35. package/dist/utils/convertToCamelcase.js +0 -42
  36. package/dist/utils/convertToCamelcase.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aeremmiddleware",
3
- "version": "1.0.56",
3
+ "version": "1.0.58",
4
4
  "description": "",
5
5
  "type": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
@@ -232,7 +232,7 @@ export default class KycCartAPIWrapper {
232
232
  }
233
233
  );
234
234
  const data = response?.data?.response;
235
- const panInfo: PANInfo = {
235
+ const panInfo : PANInfo = {
236
236
  action: "verify_with_source",
237
237
  completed_at: response?.data?.status?.timestamp,
238
238
  created_at: response?.data?.status?.timestamp,
@@ -280,7 +280,7 @@ export default class KycCartAPIWrapper {
280
280
  type: "ind_pan_plus",
281
281
  };
282
282
 
283
- const errorPAN = {
283
+ const errorPAN : PANInfo = {
284
284
  action: "verify_with_source",
285
285
  completed_at: response?.data?.status?.timestamp,
286
286
  created_at: response?.data?.status?.timestamp,
@@ -323,10 +323,13 @@ export default class KycCartAPIWrapper {
323
323
  task_id: response?.data?.status?.transactionId,
324
324
  type: "ind_pan_plus",
325
325
  };
326
-
326
+
327
327
  if (response?.data?.response?.code == 200) {
328
328
  return [panInfo];
329
- } else {
329
+ } else if(response?.data?.status?.statusCode === 400) {
330
+ errorPAN.result.source_output.status = "source_down";
331
+ return [errorPAN];
332
+ }else{
330
333
  return [errorPAN];
331
334
  }
332
335
  } catch (error: any) {
@@ -462,7 +465,7 @@ export default class KycCartAPIWrapper {
462
465
  public async nameMatch(payload: INameMatchRequest) {
463
466
  try {
464
467
  const response = await axios.get(
465
- `${this.baseUrl}/match?name1=${payload.name1}&name2=${payload.name2}`,
468
+ `${this.baseUrl}/match/name?name1=${payload.name1}&name2=${payload.name2}`,
466
469
  {
467
470
  headers: {
468
471
  "x-api-key": this.apiKey,
@@ -1,2 +0,0 @@
1
- export declare function encrypt(keyString: string, plaintext: string): string;
2
- export declare function decrypt(keyString: string, encryptedData: string): string;
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.decrypt = exports.encrypt = void 0;
4
- const crypto_1 = require("crypto");
5
- function encrypt(keyString, plaintext) {
6
- const salt = Buffer.from([
7
- 73, 118, 97, 110, 32, 77, 101, 100, 118, 101, 100, 101, 118,
8
- ]);
9
- const key = (0, crypto_1.pbkdf2Sync)(keyString, salt, 1000, 384, "sha1");
10
- const iv = Buffer.alloc(16);
11
- key.copy(iv, 0, 32, 48);
12
- const cipher = (0, crypto_1.createCipheriv)("aes-256-cbc", key.slice(0, 32), iv);
13
- const encrypted = Buffer.concat([
14
- cipher.update(plaintext, "utf16le"),
15
- cipher.final(),
16
- ]);
17
- return encrypted.toString("base64");
18
- }
19
- exports.encrypt = encrypt;
20
- function decrypt(keyString, encryptedData) {
21
- const salt = Buffer.from([
22
- 73, 118, 97, 110, 32, 77, 101, 100, 118, 101, 100, 101, 118,
23
- ]);
24
- const key = (0, crypto_1.pbkdf2Sync)(keyString, salt, 1000, 384, "sha1");
25
- const iv = Buffer.alloc(16);
26
- key.copy(iv, 0, 32, 48);
27
- const encryptedText = Buffer.from(encryptedData, "base64");
28
- const decipher = (0, crypto_1.createDecipheriv)("aes-256-cbc", key.slice(0, 32), iv);
29
- const decrypted = Buffer.concat([
30
- decipher.update(encryptedText),
31
- decipher.final(),
32
- ]);
33
- return decrypted.toString("utf16le");
34
- }
35
- exports.decrypt = decrypt;
36
- //# sourceMappingURL=auEncrypt.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auEncrypt.js","sourceRoot":"","sources":["../../src/Finance/auEncrypt.ts"],"names":[],"mappings":";;;AAAA,mCAAsE;AAEtE,SAAgB,OAAO,CAAC,SAAiB,EAAE,SAAiB;IAC1D,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACvB,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,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AC,aAAa,EAAE,QAAQ,CAAC,CAAC;IAC3D,MAAM,QAAQ,GAAG,IAAA,yBAAgB,EAAC,aAAa,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACvE,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC;QAC9B,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC;QAC9B,QAAQ,CAAC,KAAK,EAAE;KACjB,CAAC,CAAC;IACH,OAAO,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AACvC,CAAC;AAdD,0BAcC"}
@@ -1,50 +0,0 @@
1
- import { AxiosResponse } from "axios";
2
- interface PayloadType {
3
- mbSvcProviderName: string;
4
- channel: string;
5
- mbDateFrom: string;
6
- mbCustMailId: string;
7
- mbCustFonCellNum: string;
8
- mbSvcProviderCode: string;
9
- mbSponserBankCode: string;
10
- mbFrequencyType: string;
11
- requestId: string;
12
- mbCustName: string;
13
- mbRefNumber: string;
14
- mbMandateCategory: string;
15
- mbDRAccountNumber: string;
16
- mbMandateType: string;
17
- mbDateTo: string;
18
- mbRelRefNumber: string;
19
- mbCustFonLandNum: string;
20
- mbDRBankCode: string;
21
- mbAmount: string;
22
- mbPaymentType: string;
23
- responseURL: string;
24
- mbDRAccountType: string;
25
- mbFrequencyCode: string;
26
- mbFixedAmount: string;
27
- referenceCode: string;
28
- mbCustPAN: string;
29
- username: string;
30
- }
31
- declare class AuFinanceApiWrapper {
32
- private isUAT;
33
- private enachEndpoint;
34
- private baseUrl;
35
- private encryptionKey;
36
- private authEndpoint;
37
- private emandateWithUserConfirmationEndpoint;
38
- private emandateWithoutUserConfirmationEndpoint;
39
- constructor(isUAT: boolean);
40
- getAccessToken({ clientId, clientSecret, }: {
41
- clientId: string;
42
- clientSecret: string;
43
- }): Promise<AxiosResponse>;
44
- auEmandate({ requireUserConsent, accessToken, jsonData, }: {
45
- requireUserConsent: boolean;
46
- accessToken: string;
47
- jsonData: PayloadType;
48
- }): Promise<any>;
49
- }
50
- export default AuFinanceApiWrapper;
@@ -1,74 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- const axios_1 = __importDefault(require("axios"));
16
- const auEncrypt_1 = require("./auEncrypt");
17
- class AuFinanceApiWrapper {
18
- constructor(isUAT) {
19
- this.authEndpoint = "/oauth/accesstoken?grant_type=client_credentials";
20
- this.emandateWithUserConfirmationEndpoint = "/EmandateUserRegistrationRestService/userconfirmation";
21
- this.emandateWithoutUserConfirmationEndpoint = "/EmandateUserRegistrationRestService/withoutUserConfirmation";
22
- this.isUAT = isUAT;
23
- this.baseUrl = this.isUAT
24
- ? "https://api.aubankuat.in"
25
- : "https://api.aubank.in";
26
- this.encryptionKey = this.isUAT
27
- ? "545932040048E8B4FAF59DCC6B20B042AE7B3DD9C282C53B6A0E66599CC01693"
28
- : "4F773AF556F047DE1D379A122321BF363579FCEB04EAF5E1A47C043754DCAA9C";
29
- }
30
- getAccessToken({ clientId, clientSecret, }) {
31
- return __awaiter(this, void 0, void 0, function* () {
32
- try {
33
- const authString = `${clientId}:${clientSecret}`;
34
- const base64Auth = Buffer.from(authString).toString("base64");
35
- const response = yield axios_1.default.get(`${this.baseUrl}${this.authEndpoint}`, {
36
- headers: {
37
- Authorization: `Basic ${base64Auth}`,
38
- },
39
- });
40
- return response;
41
- }
42
- catch (error) {
43
- throw error;
44
- }
45
- });
46
- }
47
- auEmandate({ requireUserConsent, accessToken, jsonData, }) {
48
- return __awaiter(this, void 0, void 0, function* () {
49
- requireUserConsent
50
- ? (this.enachEndpoint = this.emandateWithUserConfirmationEndpoint)
51
- : (this.enachEndpoint = this.emandateWithoutUserConfirmationEndpoint);
52
- let jsonString = JSON.stringify(jsonData);
53
- const encryptedData = (0, auEncrypt_1.encrypt)(this.encryptionKey, jsonString);
54
- const headers = {
55
- Authorization: `Bearer ${accessToken}`,
56
- "Content-Type": "application/json",
57
- };
58
- const body = {
59
- encvalue: encryptedData,
60
- };
61
- try {
62
- const response = yield axios_1.default.post(`${this.baseUrl}${this.enachEndpoint}`, body, { headers: headers });
63
- const res = response.data;
64
- const decryptedData = (0, auEncrypt_1.decrypt)(this.encryptionKey, res);
65
- return decryptedData;
66
- }
67
- catch (error) {
68
- throw error;
69
- }
70
- });
71
- }
72
- }
73
- exports.default = AuFinanceApiWrapper;
74
- //# sourceMappingURL=auFinance.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auFinance.js","sourceRoot":"","sources":["../../src/Finance/auFinance.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,kDAA6C;AAC7C,2CAA+C;AAgC/C,MAAM,mBAAmB;IAWvB,YAAY,KAAc;QANlB,iBAAY,GAAG,kDAAkD,CAAC;QAClE,yCAAoC,GAC1C,uDAAuD,CAAC;QAClD,4CAAuC,GAC7C,8DAA8D,CAAC;QAG/D,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK;YACvB,CAAC,CAAC,0BAA0B;YAC5B,CAAC,CAAC,uBAAuB,CAAC;QAC5B,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,KAAK;YAC7B,CAAC,CAAC,kEAAkE;YACpE,CAAC,CAAC,kEAAkE,CAAC;IACzE,CAAC;IAEK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AE,CACrB,CAAC;gBACF,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC;gBAC1B,MAAM,aAAa,GAAG,IAAA,mBAAO,EAAC,IAAI,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC;gBACvD,OAAO,aAAa,CAAC;aACtB;YAAC,OAAO,KAAU,EAAE;gBACnB,MAAM,KAAK,CAAC;aACb;QACH,CAAC;KAAA;CACF;AACD,kBAAe,mBAAmB,CAAC"}
@@ -1,172 +0,0 @@
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
- }
48
- export interface IAadhaarVerificationPayload {
49
- status: {
50
- statusCode: number;
51
- statusMessage: string;
52
- transactionId: string;
53
- checkId: string;
54
- groupId: string;
55
- input: {
56
- aadhaarNo: string;
57
- };
58
- timestamp: string;
59
- };
60
- response: {
61
- code: number;
62
- pan: string;
63
- };
64
- }
65
- export interface IAadhaarOfflineGetOTPResponse {
66
- status: {
67
- statusCode: number;
68
- statusMessage: string;
69
- transactionId: string;
70
- checkId: string;
71
- groupId: string;
72
- input: {
73
- aadhaarNo: string;
74
- task: string;
75
- };
76
- timestamp: string;
77
- };
78
- response: {
79
- requestId: string;
80
- result: {
81
- message: string;
82
- };
83
- statusCode: number;
84
- };
85
- }
86
- export interface IAadhaarOfflineGetFileResponse {
87
- status: {
88
- statusCode: number;
89
- statusMessage: string;
90
- transactionId: string;
91
- input: {
92
- aadhaarNo: string;
93
- task: string;
94
- };
95
- timestamp: string;
96
- };
97
- response: {
98
- maskedAadhaarNumber: string;
99
- name: string;
100
- dob: string;
101
- gender: "M" | "F" | "Other";
102
- fatherName: string;
103
- careOf: string;
104
- address: string;
105
- splitAddress: {
106
- country: string;
107
- dist: string;
108
- state: string;
109
- po: string;
110
- loc: string;
111
- vtc: string;
112
- subdist: string;
113
- street: string;
114
- house: string;
115
- landmark: string;
116
- };
117
- pincode: string;
118
- shareCode: string;
119
- generatedDateTime: string;
120
- image: string;
121
- };
122
- }
123
- export interface INameMatchResponse {
124
- status: {
125
- statusCode: number;
126
- statusMessage: string;
127
- transactionId: string;
128
- checkId: string;
129
- groupId: string;
130
- timestamp: string;
131
- };
132
- response: {
133
- name1: string;
134
- name2: string;
135
- similarity: number;
136
- similarityPercentage: string;
137
- };
138
- }
139
- export interface INameMatchRequest {
140
- name1: string;
141
- name2: string;
142
- }
143
- export default class KycCartAPIWrapper {
144
- private apiKey;
145
- private baseUrl;
146
- static AADHAAR_TASKS: {
147
- GET_OTP: string;
148
- GET_FILE: string;
149
- };
150
- constructor(apiKey: string);
151
- accountTransfer({ accountNumber, ifsc, name, checkId, }: {
152
- accountNumber: string;
153
- ifsc: string;
154
- name: string;
155
- checkId: string;
156
- }): Promise<AxiosResponse>;
157
- getIndividualPANInfo({ panNo, }: {
158
- panNo: string;
159
- }): Promise<PANInfo[]>;
160
- getMaskedPanByAadhaar({ aadhaarNo }: {
161
- aadhaarNo: string;
162
- }): Promise<IAadhaarVerificationPayload>;
163
- getAadhaarOtp({ aadhaarNo }: {
164
- aadhaarNo: string;
165
- }): Promise<IAadhaarOfflineGetOTPResponse>;
166
- verifyAadhaarOtp({ aadhaarNo, otp, requestId, }: {
167
- requestId: string;
168
- aadhaarNo: string;
169
- otp: string;
170
- }): Promise<IAadhaarOfflineGetFileResponse>;
171
- nameMatch(payload: INameMatchRequest): Promise<INameMatchResponse>;
172
- }
@@ -1,277 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- const axios_1 = __importDefault(require("axios"));
16
- const form_data_1 = __importDefault(require("form-data"));
17
- class KycCartAPIWrapper {
18
- constructor(apiKey) {
19
- this.apiKey = apiKey;
20
- this.baseUrl = "https://api.kyckart.com/api";
21
- }
22
- accountTransfer({ accountNumber, ifsc, name, checkId, }) {
23
- return __awaiter(this, void 0, void 0, function* () {
24
- const form = new form_data_1.default();
25
- form.append("accountNumber", accountNumber);
26
- form.append("ifsc", ifsc);
27
- form.append("name", name);
28
- form.append("checkId", checkId);
29
- try {
30
- const response = yield axios_1.default.post(`${this.baseUrl}/bank/account-transfer`, form, {
31
- headers: Object.assign({ "x-api-key": this.apiKey }, form.getHeaders()),
32
- });
33
- return response.data;
34
- }
35
- catch (error) {
36
- throw {
37
- statusCode: error.response.data.status.statusCode,
38
- statusMessage: error.response.data.status.statusMessage,
39
- errorTitle: error.response.data.error.title,
40
- errorMessage: error.response.data.error.message,
41
- };
42
- }
43
- });
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
- }
201
- getMaskedPanByAadhaar({ aadhaarNo }) {
202
- return __awaiter(this, void 0, void 0, function* () {
203
- try {
204
- const form = new form_data_1.default();
205
- form.append("aadhaarNo", aadhaarNo);
206
- const response = yield axios_1.default.post(`${this.baseUrl}/aadhaar/aadhaarToPan`, form, {
207
- headers: Object.assign({ "x-api-key": this.apiKey }, form.getHeaders()),
208
- });
209
- const data = response === null || response === void 0 ? void 0 : response.data;
210
- console.log(data);
211
- return data;
212
- }
213
- catch (error) {
214
- throw error;
215
- }
216
- });
217
- }
218
- getAadhaarOtp({ aadhaarNo }) {
219
- return __awaiter(this, void 0, void 0, function* () {
220
- try {
221
- const form = new form_data_1.default();
222
- form.append("aadhaarNo", aadhaarNo);
223
- form.append("task", KycCartAPIWrapper.AADHAAR_TASKS.GET_OTP);
224
- const response = yield axios_1.default.post(`${this.baseUrl}/aadhaar/aadhaarOfflineOtpV5`, form, {
225
- headers: Object.assign({ "x-api-key": this.apiKey }, form.getHeaders()),
226
- });
227
- const data = response === null || response === void 0 ? void 0 : response.data;
228
- console.log(data);
229
- return data;
230
- }
231
- catch (error) {
232
- throw error;
233
- }
234
- });
235
- }
236
- verifyAadhaarOtp({ aadhaarNo, otp, requestId, }) {
237
- return __awaiter(this, void 0, void 0, function* () {
238
- try {
239
- const form = new form_data_1.default();
240
- form.append("aadhaarNo", aadhaarNo);
241
- form.append("otp", otp);
242
- form.append("requestId", requestId);
243
- form.append("task", KycCartAPIWrapper.AADHAAR_TASKS.GET_FILE);
244
- const response = yield axios_1.default.post(`${this.baseUrl}/aadhaar/aadhaarOfflineOtpV5`, form, {
245
- headers: Object.assign({ "x-api-key": this.apiKey }, form.getHeaders()),
246
- });
247
- const data = response === null || response === void 0 ? void 0 : response.data;
248
- return data;
249
- }
250
- catch (error) {
251
- throw error;
252
- }
253
- });
254
- }
255
- nameMatch(payload) {
256
- return __awaiter(this, void 0, void 0, function* () {
257
- try {
258
- const response = yield axios_1.default.get(`${this.baseUrl}/match?name1=${payload.name1}&name2=${payload.name2}`, {
259
- headers: {
260
- "x-api-key": this.apiKey,
261
- },
262
- });
263
- const data = response === null || response === void 0 ? void 0 : response.data;
264
- return data;
265
- }
266
- catch (error) {
267
- throw error;
268
- }
269
- });
270
- }
271
- }
272
- exports.default = KycCartAPIWrapper;
273
- KycCartAPIWrapper.AADHAAR_TASKS = {
274
- GET_OTP: "getOtp",
275
- GET_FILE: "getFile",
276
- };
277
- //# sourceMappingURL=kycKart.js.map