aeremmiddleware 1.0.4 → 1.0.6
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.
- package/dist/Finance/Ingenico.types.d.ts +21 -0
- package/dist/Finance/Ingenico.types.js +3 -0
- package/dist/Finance/Ingenico.types.js.map +1 -0
- package/dist/Finance/crimeCheck.d.ts +16 -0
- package/dist/Finance/crimeCheck.js +137 -0
- package/dist/Finance/crimeCheck.js.map +1 -0
- package/dist/Finance/crimecheck.types.d.ts +30 -0
- package/dist/Finance/crimecheck.types.js +3 -0
- package/dist/Finance/crimecheck.types.js.map +1 -0
- package/dist/Finance/encrypt.d.ts +1 -0
- package/dist/Finance/encrypt.js +20 -0
- package/dist/Finance/encrypt.js.map +1 -0
- package/dist/Finance/idfy.d.ts +63 -35
- package/dist/Finance/idfy.js +419 -201
- package/dist/Finance/idfy.js.map +1 -1
- package/dist/Finance/index.d.ts +12 -4
- package/dist/Finance/index.js +18 -10
- package/dist/Finance/index.js.map +1 -1
- package/dist/Finance/ingenico.d.ts +13 -0
- package/dist/Finance/ingenico.js +122 -0
- package/dist/Finance/ingenico.js.map +1 -0
- package/dist/Finance/ingenicoHtml.d.ts +2 -0
- package/dist/Finance/ingenicoHtml.js +122 -0
- package/dist/Finance/ingenicoHtml.js.map +1 -0
- package/dist/Finance/novel.d.ts +35 -0
- package/dist/Finance/novel.js +222 -0
- package/dist/Finance/novel.js.map +1 -0
- package/dist/Finance/novel.types.d.ts +23 -0
- package/dist/Finance/novel.types.js +10 -0
- package/dist/Finance/novel.types.js.map +1 -0
- package/dist/Finance/qbrik.d.ts +89 -0
- package/dist/Finance/qbrik.js +463 -0
- package/dist/Finance/qbrik.js.map +1 -0
- package/dist/Finance/qbrik.types.d.ts +76 -0
- package/dist/Finance/qbrik.types.js +3 -0
- package/dist/Finance/qbrik.types.js.map +1 -0
- package/dist/Maps/index.js +1 -1
- package/dist/Socials/Sms.types.d.ts +8 -0
- package/dist/Socials/Sms.types.js +9 -0
- package/dist/Socials/Sms.types.js.map +1 -0
- package/dist/Socials/SmsSender.d.ts +17 -0
- package/dist/Socials/SmsSender.js +74 -0
- package/dist/Socials/SmsSender.js.map +1 -0
- package/dist/Socials/Whatsapp.types.d.ts +93 -97
- package/dist/Socials/Whatsapp.types.js +8 -8
- package/dist/Socials/Whatsapp.types.js.map +1 -1
- package/dist/Socials/index.d.ts +6 -4
- package/dist/Socials/index.js +12 -10
- package/dist/Socials/index.js.map +1 -1
- package/dist/Socials/{message.d.ts → whatsApp.d.ts} +23 -26
- package/dist/Socials/{message.js → whatsApp.js} +169 -212
- package/dist/Socials/{message.js.map → whatsApp.js.map} +1 -1
- package/dist/index.d.ts +13 -8
- package/dist/index.js +8 -8
- package/package.json +1 -1
- package/src/Finance/Ingenico.types.ts +3 -0
- package/src/Finance/crimeCheck.ts +135 -0
- package/src/Finance/crimecheck.types.ts +31 -0
- package/src/Finance/idfy.ts +34 -20
- package/src/Finance/index.ts +6 -0
- package/src/Finance/ingenico.ts +36 -136
- package/src/Finance/ingenicoHtml.ts +119 -0
- package/src/Finance/qbrik.ts +760 -0
- package/src/Finance/qbrik.types.ts +81 -0
- package/src/Socials/SmsSender.ts +20 -21
package/dist/Finance/idfy.js
CHANGED
|
@@ -1,202 +1,420 @@
|
|
|
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
|
-
class IdfyAPIWrapper {
|
|
17
|
-
constructor() {
|
|
18
|
-
this.bodyTaskIdGroupId = {
|
|
19
|
-
task_id:
|
|
20
|
-
group_id:
|
|
21
|
-
};
|
|
22
|
-
this.defaultHeaderIdfyApi = {
|
|
23
|
-
"account-id": "
|
|
24
|
-
"api-key": "
|
|
25
|
-
};
|
|
26
|
-
this.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
this.
|
|
31
|
-
this.
|
|
32
|
-
this.
|
|
33
|
-
this.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
const response = yield this.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
return
|
|
193
|
-
}
|
|
194
|
-
catch (error) {
|
|
195
|
-
console.error("Error while fetching Idfy
|
|
196
|
-
throw error;
|
|
197
|
-
}
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
|
|
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
|
+
class IdfyAPIWrapper {
|
|
17
|
+
constructor({ IDFY_TASK_ID, IDFY_GROUP_ID, IDFY_ACCOUNT_ID, IDFY_API_KEY, IDFY_COMPANY_SEARCH_API_KEY, }) {
|
|
18
|
+
this.bodyTaskIdGroupId = {
|
|
19
|
+
task_id: "",
|
|
20
|
+
group_id: "",
|
|
21
|
+
};
|
|
22
|
+
this.defaultHeaderIdfyApi = {
|
|
23
|
+
"account-id": "",
|
|
24
|
+
"api-key": "",
|
|
25
|
+
};
|
|
26
|
+
this.standardErrorThrowFormat = {
|
|
27
|
+
statusCode: 400,
|
|
28
|
+
message: ["bad request"],
|
|
29
|
+
};
|
|
30
|
+
this.baseUrl = "https://eve.idfy.com/";
|
|
31
|
+
this.gstVerificationEndPoint = "v3/tasks/sync/verify_with_source/ind_gst_certificate";
|
|
32
|
+
this.panIndividualVerificationEndPoint = "v3/tasks/async/verify_with_source/ind_pan_plus";
|
|
33
|
+
this.cinCompanyVerificationEndPoint = "v3/tasks/async/verify_with_source/ind_mca";
|
|
34
|
+
this.taskUrl = "v3/tasks?request_id=";
|
|
35
|
+
this.asyncIndividualAadhaarLiteInfoEndPoint = "v3/tasks/async/verify_with_source/aadhaar_lite";
|
|
36
|
+
this.syncIndividualAadharScanInfoEndpoint = "v3/tasks/sync/extract/ind_aadhaar_plus";
|
|
37
|
+
this.syncIndividualPANScanInfoEndpoint = "v3/tasks/sync/extract/ind_pan";
|
|
38
|
+
this.syncIndividualGSTScanInfoEndpoint = "v3/tasks/sync/extract/ind_gst_certificate";
|
|
39
|
+
this.syncIndividualLiveFaceLivenessEndpoint = "v3/tasks/sync/check_photo_liveness/face";
|
|
40
|
+
this.idfyCompanySearch = {
|
|
41
|
+
defaultHeader: {
|
|
42
|
+
"api-key": "",
|
|
43
|
+
"Content-Type": "application/json",
|
|
44
|
+
},
|
|
45
|
+
version: "v1",
|
|
46
|
+
companySearchUrl: "https://riskai.idfystaging.com/api/v1/company/search",
|
|
47
|
+
taskBaseUrl: "https://riskai.idfystaging.com/api/v1/task/",
|
|
48
|
+
cinllpinUrl: "https://riskai.idfystaging.com/api/v1/company/basic",
|
|
49
|
+
};
|
|
50
|
+
this.idfyError = {
|
|
51
|
+
INVALID_IMAGE: {
|
|
52
|
+
idfyErrorCode: "IDFY_ERR_100",
|
|
53
|
+
message: "Please scan correct document",
|
|
54
|
+
},
|
|
55
|
+
INSUFFICIENT_CREDITS: {
|
|
56
|
+
idfyErrorCode: "IDFY_ERR_101",
|
|
57
|
+
message: "Please renew credit",
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
this.bodyTaskIdGroupId.task_id = IDFY_TASK_ID;
|
|
61
|
+
this.bodyTaskIdGroupId.group_id = IDFY_GROUP_ID;
|
|
62
|
+
this.defaultHeaderIdfyApi["account-id"] = IDFY_ACCOUNT_ID;
|
|
63
|
+
this.defaultHeaderIdfyApi["api-key"] = IDFY_API_KEY;
|
|
64
|
+
this.idfyCompanySearch.defaultHeader["api-key"] =
|
|
65
|
+
IDFY_COMPANY_SEARCH_API_KEY;
|
|
66
|
+
}
|
|
67
|
+
makeRequest(method, endpoint, data) {
|
|
68
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
const requestConfig = {
|
|
70
|
+
method,
|
|
71
|
+
url: this.baseUrl + endpoint,
|
|
72
|
+
headers: this.defaultHeaderIdfyApi,
|
|
73
|
+
data,
|
|
74
|
+
};
|
|
75
|
+
try {
|
|
76
|
+
const response = yield (0, axios_1.default)(requestConfig);
|
|
77
|
+
return response.data;
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
console.error("Error while making Idfy Axios API request:", error);
|
|
81
|
+
throw error;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
makeAxiosRequest({ method, url, data, headers, }) {
|
|
86
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
87
|
+
const requestConfig = {
|
|
88
|
+
method,
|
|
89
|
+
url,
|
|
90
|
+
headers,
|
|
91
|
+
data,
|
|
92
|
+
};
|
|
93
|
+
try {
|
|
94
|
+
const response = yield (0, axios_1.default)(requestConfig);
|
|
95
|
+
return response.data;
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
console.error("Error while making Idfy makeAxiosRequest API request:", error);
|
|
99
|
+
throw error;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
getTask(requestId) {
|
|
104
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
105
|
+
try {
|
|
106
|
+
const urlEndPoint = this.taskUrl + requestId;
|
|
107
|
+
const response = yield this.makeRequest("get", urlEndPoint);
|
|
108
|
+
return response;
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
console.error("Error while fetching Idfy getTask API data:", error);
|
|
112
|
+
throw error;
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
getCompanySearchTask({ requestId, }) {
|
|
117
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
118
|
+
try {
|
|
119
|
+
const taskBaseUrl = this.idfyCompanySearch.taskBaseUrl + requestId;
|
|
120
|
+
const response = yield this.makeAxiosRequest({
|
|
121
|
+
method: "get",
|
|
122
|
+
url: taskBaseUrl,
|
|
123
|
+
headers: this.idfyCompanySearch.defaultHeader,
|
|
124
|
+
});
|
|
125
|
+
return response;
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
console.error("Error while fetching Idfy getCompanySearchTask API data:", error);
|
|
129
|
+
throw error;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
pingTaskUntilSuccess(requestId) {
|
|
134
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
135
|
+
try {
|
|
136
|
+
let res = null;
|
|
137
|
+
const checkTaskAfter1sec = (requestId) => {
|
|
138
|
+
return new Promise((resolve, reject) => {
|
|
139
|
+
try {
|
|
140
|
+
setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
141
|
+
const data = yield this.getTask(requestId);
|
|
142
|
+
if ((res === null || res === void 0 ? void 0 : res[0].status) == "failed") {
|
|
143
|
+
reject(res);
|
|
144
|
+
}
|
|
145
|
+
resolve(data);
|
|
146
|
+
}), 1000);
|
|
147
|
+
}
|
|
148
|
+
catch (e) {
|
|
149
|
+
reject(e);
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
};
|
|
153
|
+
do {
|
|
154
|
+
res = yield checkTaskAfter1sec(requestId);
|
|
155
|
+
console.log("### res ", res);
|
|
156
|
+
} while ((res === null || res === void 0 ? void 0 : res[0].status) !== "completed");
|
|
157
|
+
return res;
|
|
158
|
+
}
|
|
159
|
+
catch (error) {
|
|
160
|
+
console.error("Error while fetching Idfy getTask API data:", error);
|
|
161
|
+
throw error;
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
pingCompanySearchTaskUntilSuccess(requestId) {
|
|
166
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
167
|
+
try {
|
|
168
|
+
console.log(" ## requestId ", requestId);
|
|
169
|
+
let res = null;
|
|
170
|
+
const checkTaskAfter1sec = (requestId) => {
|
|
171
|
+
return new Promise((resolve, reject) => {
|
|
172
|
+
try {
|
|
173
|
+
setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
174
|
+
const data = yield this.getCompanySearchTask({ requestId });
|
|
175
|
+
if (data.status != "failed") {
|
|
176
|
+
resolve(data);
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
reject(res);
|
|
180
|
+
}
|
|
181
|
+
}), 1000);
|
|
182
|
+
}
|
|
183
|
+
catch (e) {
|
|
184
|
+
reject(e);
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
};
|
|
188
|
+
do {
|
|
189
|
+
res = yield checkTaskAfter1sec(requestId);
|
|
190
|
+
console.log("### res ", res);
|
|
191
|
+
} while ((res === null || res === void 0 ? void 0 : res.status) !== "completed");
|
|
192
|
+
return res;
|
|
193
|
+
}
|
|
194
|
+
catch (error) {
|
|
195
|
+
console.error("Error while fetching Idfy getTask API data:", error);
|
|
196
|
+
throw error;
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
getCompanyGstInfo({ gstNo }) {
|
|
201
|
+
var _a, _b, _c, _d;
|
|
202
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
203
|
+
try {
|
|
204
|
+
const data = Object.assign(Object.assign({}, this.bodyTaskIdGroupId), { data: {
|
|
205
|
+
gstin: gstNo,
|
|
206
|
+
} });
|
|
207
|
+
const response = yield this.makeRequest("post", this.gstVerificationEndPoint, data);
|
|
208
|
+
return response;
|
|
209
|
+
}
|
|
210
|
+
catch (error) {
|
|
211
|
+
if ((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.error) {
|
|
212
|
+
let obj = this.idfyError;
|
|
213
|
+
const errorObj = obj[(_d = (_c = error === null || error === void 0 ? void 0 : error.response) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.error];
|
|
214
|
+
if (errorObj)
|
|
215
|
+
throw Object.assign(Object.assign({}, this.standardErrorThrowFormat), { message: [errorObj.message] });
|
|
216
|
+
}
|
|
217
|
+
throw error;
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
getCompanyCINInfo({ cinNo }) {
|
|
222
|
+
var _a, _b, _c, _d, _e, _f;
|
|
223
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
224
|
+
try {
|
|
225
|
+
const data = Object.assign(Object.assign({}, this.bodyTaskIdGroupId), { data: {
|
|
226
|
+
cin: cinNo,
|
|
227
|
+
} });
|
|
228
|
+
const response = yield this.makeRequest("post", this.cinCompanyVerificationEndPoint, data);
|
|
229
|
+
const successData = yield this.pingTaskUntilSuccess(response.request_id);
|
|
230
|
+
return (_b = (_a = successData === null || successData === void 0 ? void 0 : successData[0]) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.source_output;
|
|
231
|
+
}
|
|
232
|
+
catch (error) {
|
|
233
|
+
if ((_d = (_c = error === null || error === void 0 ? void 0 : error.response) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.error) {
|
|
234
|
+
let obj = this.idfyError;
|
|
235
|
+
const errorObj = obj[(_f = (_e = error === null || error === void 0 ? void 0 : error.response) === null || _e === void 0 ? void 0 : _e.data) === null || _f === void 0 ? void 0 : _f.error];
|
|
236
|
+
if (errorObj)
|
|
237
|
+
throw Object.assign(Object.assign({}, this.standardErrorThrowFormat), { message: [errorObj.message] });
|
|
238
|
+
}
|
|
239
|
+
throw error;
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
getIndividualPANInfo({ panNo }) {
|
|
244
|
+
var _a, _b, _c, _d;
|
|
245
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
246
|
+
try {
|
|
247
|
+
const data = Object.assign(Object.assign({}, this.bodyTaskIdGroupId), { data: {
|
|
248
|
+
id_number: panNo,
|
|
249
|
+
} });
|
|
250
|
+
const response = yield this.makeRequest("post", this.panIndividualVerificationEndPoint, data);
|
|
251
|
+
const successData = yield this.pingTaskUntilSuccess(response.request_id);
|
|
252
|
+
return successData;
|
|
253
|
+
}
|
|
254
|
+
catch (error) {
|
|
255
|
+
if ((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.error) {
|
|
256
|
+
let obj = this.idfyError;
|
|
257
|
+
const errorObj = obj[(_d = (_c = error === null || error === void 0 ? void 0 : error.response) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.error];
|
|
258
|
+
if (errorObj)
|
|
259
|
+
throw Object.assign(Object.assign({}, this.standardErrorThrowFormat), { message: [errorObj.message] });
|
|
260
|
+
}
|
|
261
|
+
throw error;
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
getSyncIndividualAadharScanInfo({ frontScanBase64, backScanBase64, }) {
|
|
266
|
+
var _a, _b, _c, _d;
|
|
267
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
268
|
+
try {
|
|
269
|
+
const data = Object.assign(Object.assign({}, this.bodyTaskIdGroupId), { data: {
|
|
270
|
+
document1: frontScanBase64,
|
|
271
|
+
document2: backScanBase64,
|
|
272
|
+
consent: "yes",
|
|
273
|
+
advanced_details: {
|
|
274
|
+
extract_qr_info: true,
|
|
275
|
+
extract_last_4_digit: false,
|
|
276
|
+
},
|
|
277
|
+
} });
|
|
278
|
+
const response = yield this.makeRequest("post", this.syncIndividualAadharScanInfoEndpoint, data);
|
|
279
|
+
return response === null || response === void 0 ? void 0 : response.result;
|
|
280
|
+
}
|
|
281
|
+
catch (error) {
|
|
282
|
+
if ((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.error) {
|
|
283
|
+
let obj = this.idfyError;
|
|
284
|
+
const errorObj = obj[(_d = (_c = error === null || error === void 0 ? void 0 : error.response) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.error];
|
|
285
|
+
if (errorObj)
|
|
286
|
+
throw Object.assign(Object.assign({}, this.standardErrorThrowFormat), { message: [errorObj.message] });
|
|
287
|
+
}
|
|
288
|
+
throw error;
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
getSyncIndividualPANScanInfo({ frontScanBase64, }) {
|
|
293
|
+
var _a, _b, _c, _d;
|
|
294
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
295
|
+
try {
|
|
296
|
+
const data = Object.assign(Object.assign({}, this.bodyTaskIdGroupId), { data: {
|
|
297
|
+
document1: frontScanBase64,
|
|
298
|
+
consent: "yes",
|
|
299
|
+
} });
|
|
300
|
+
const response = yield this.makeRequest("post", this.syncIndividualPANScanInfoEndpoint, data);
|
|
301
|
+
return response === null || response === void 0 ? void 0 : response.result;
|
|
302
|
+
}
|
|
303
|
+
catch (error) {
|
|
304
|
+
if ((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.error) {
|
|
305
|
+
let obj = this.idfyError;
|
|
306
|
+
const errorObj = obj[(_d = (_c = error === null || error === void 0 ? void 0 : error.response) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.error];
|
|
307
|
+
if (errorObj)
|
|
308
|
+
throw Object.assign(Object.assign({}, this.standardErrorThrowFormat), { message: [errorObj.message] });
|
|
309
|
+
}
|
|
310
|
+
throw error;
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
getSyncCompanyGSTScanInfo({ frontScanBase64, }) {
|
|
315
|
+
var _a, _b, _c, _d;
|
|
316
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
317
|
+
try {
|
|
318
|
+
const data = Object.assign(Object.assign({}, this.bodyTaskIdGroupId), { data: {
|
|
319
|
+
document1: frontScanBase64,
|
|
320
|
+
} });
|
|
321
|
+
const response = yield this.makeRequest("post", this.syncIndividualGSTScanInfoEndpoint, data);
|
|
322
|
+
return response === null || response === void 0 ? void 0 : response.result;
|
|
323
|
+
}
|
|
324
|
+
catch (error) {
|
|
325
|
+
if ((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.error) {
|
|
326
|
+
let obj = this.idfyError;
|
|
327
|
+
const errorObj = obj[(_d = (_c = error === null || error === void 0 ? void 0 : error.response) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.error];
|
|
328
|
+
if (errorObj)
|
|
329
|
+
throw Object.assign(Object.assign({}, this.standardErrorThrowFormat), { message: [errorObj.message] });
|
|
330
|
+
}
|
|
331
|
+
throw error;
|
|
332
|
+
}
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
getSyncIndividualLivenessSelfyScanInfo({ faceScanBase64, }) {
|
|
336
|
+
var _a, _b, _c, _d;
|
|
337
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
338
|
+
try {
|
|
339
|
+
const data = Object.assign(Object.assign({}, this.bodyTaskIdGroupId), { data: {
|
|
340
|
+
document1: faceScanBase64,
|
|
341
|
+
consent: "yes",
|
|
342
|
+
} });
|
|
343
|
+
const response = yield this.makeRequest("post", this.syncIndividualLiveFaceLivenessEndpoint, data);
|
|
344
|
+
return response === null || response === void 0 ? void 0 : response.result;
|
|
345
|
+
}
|
|
346
|
+
catch (error) {
|
|
347
|
+
if ((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.error) {
|
|
348
|
+
let obj = this.idfyError;
|
|
349
|
+
const errorObj = obj[(_d = (_c = error === null || error === void 0 ? void 0 : error.response) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.error];
|
|
350
|
+
if (errorObj)
|
|
351
|
+
throw Object.assign(Object.assign({}, this.standardErrorThrowFormat), { message: [errorObj.message] });
|
|
352
|
+
}
|
|
353
|
+
throw error;
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
getAsyncAadhaarLiteInfo({ aadhaarNo, }) {
|
|
358
|
+
var _a, _b, _c, _d;
|
|
359
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
360
|
+
try {
|
|
361
|
+
const data = Object.assign(Object.assign({}, this.bodyTaskIdGroupId), { data: {
|
|
362
|
+
aadhaar_number: aadhaarNo,
|
|
363
|
+
} });
|
|
364
|
+
const response = yield this.makeRequest("post", this.asyncIndividualAadhaarLiteInfoEndPoint, data);
|
|
365
|
+
const successData = yield this.pingTaskUntilSuccess(response.request_id);
|
|
366
|
+
return successData;
|
|
367
|
+
}
|
|
368
|
+
catch (error) {
|
|
369
|
+
if ((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.error) {
|
|
370
|
+
let obj = this.idfyError;
|
|
371
|
+
const errorObj = obj[(_d = (_c = error === null || error === void 0 ? void 0 : error.response) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.error];
|
|
372
|
+
if (errorObj)
|
|
373
|
+
throw Object.assign(Object.assign({}, this.standardErrorThrowFormat), { message: [errorObj.message] });
|
|
374
|
+
}
|
|
375
|
+
throw error;
|
|
376
|
+
}
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
getCompanyDetailsByName({ legalName, }) {
|
|
380
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
381
|
+
try {
|
|
382
|
+
const data = Object.assign(Object.assign({ version: this.idfyCompanySearch.version }, this.bodyTaskIdGroupId), { data: {
|
|
383
|
+
name: legalName,
|
|
384
|
+
} });
|
|
385
|
+
const response = yield this.makeAxiosRequest({
|
|
386
|
+
method: "post",
|
|
387
|
+
url: this.idfyCompanySearch.companySearchUrl,
|
|
388
|
+
data,
|
|
389
|
+
headers: this.idfyCompanySearch.defaultHeader,
|
|
390
|
+
});
|
|
391
|
+
const successData = yield this.pingCompanySearchTaskUntilSuccess(response.request_id);
|
|
392
|
+
return { request_id: response, successData: successData };
|
|
393
|
+
}
|
|
394
|
+
catch (error) {
|
|
395
|
+
throw error;
|
|
396
|
+
}
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
getCompanyDetailsByLlpinOrCin({ cinOrLlpin, }) {
|
|
400
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
401
|
+
try {
|
|
402
|
+
const data = Object.assign(Object.assign({ version: this.idfyCompanySearch.version }, this.bodyTaskIdGroupId), { data: {
|
|
403
|
+
cin_llpin: cinOrLlpin,
|
|
404
|
+
} });
|
|
405
|
+
const response = yield this.makeAxiosRequest({
|
|
406
|
+
method: "post",
|
|
407
|
+
url: this.idfyCompanySearch.cinllpinUrl,
|
|
408
|
+
data,
|
|
409
|
+
headers: this.idfyCompanySearch.defaultHeader,
|
|
410
|
+
});
|
|
411
|
+
return { response: response };
|
|
412
|
+
}
|
|
413
|
+
catch (error) {
|
|
414
|
+
throw error;
|
|
415
|
+
}
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
exports.default = IdfyAPIWrapper;
|
|
202
420
|
//# sourceMappingURL=idfy.js.map
|