aeremmiddleware 1.0.24 → 1.0.26
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/auFinance.d.ts +33 -2
- package/dist/Finance/auFinance.js +8 -3
- package/dist/Finance/auFinance.js.map +1 -1
- package/dist/Finance/crimeCheck.js +88 -12
- package/dist/Finance/crimeCheck.js.map +1 -1
- package/dist/Finance/index.d.ts +2 -0
- package/dist/Finance/index.js +2 -0
- package/dist/Finance/index.js.map +1 -1
- package/dist/Finance/ingenico.js +3 -6
- package/dist/Finance/ingenico.js.map +1 -1
- package/dist/Finance/novel.d.ts +4 -3
- package/dist/Finance/novel.js +8 -8
- package/dist/Finance/novel.js.map +1 -1
- package/dist/Finance/novel.types.d.ts +6 -0
- package/dist/Finance/novel.types.js.map +1 -1
- package/dist/Finance/setu.d.ts +107 -0
- package/dist/Finance/setu.js +499 -0
- package/dist/Finance/setu.js.map +1 -0
- package/dist/Finance/setu.types.d.ts +39 -0
- package/dist/Finance/setu.types.js +3 -0
- package/dist/Finance/setu.types.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/Finance/auFinance.ts +44 -4
- package/src/Finance/crimeCheck.ts +89 -12
- package/src/Finance/index.ts +2 -1
- package/src/Finance/ingenico.ts +3 -9
- package/src/Finance/novel.ts +19 -12
- package/src/Finance/novel.types.ts +6 -0
- package/src/Finance/setu.ts +560 -0
- package/src/Finance/setu.types.ts +44 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import axios, { AxiosResponse } from "axios";
|
|
2
2
|
import { companyDetails, individualDetails } from "./crimecheck.types";
|
|
3
|
+
import { error } from "console";
|
|
3
4
|
|
|
4
5
|
class CrimeSearchAPIWrapper {
|
|
5
6
|
private apiKey: string;
|
|
@@ -24,7 +25,6 @@ class CrimeSearchAPIWrapper {
|
|
|
24
25
|
}
|
|
25
26
|
);
|
|
26
27
|
|
|
27
|
-
console.log(response.data);
|
|
28
28
|
return response.data;
|
|
29
29
|
} catch (error: any) {
|
|
30
30
|
console.error(error);
|
|
@@ -35,10 +35,47 @@ class CrimeSearchAPIWrapper {
|
|
|
35
35
|
const bodyFormData = new FormData();
|
|
36
36
|
if (companyDetails) {
|
|
37
37
|
bodyFormData.append("companyName", companyDetails.companyName);
|
|
38
|
+
companyDetails.companyType
|
|
39
|
+
? bodyFormData.append("companyType", companyDetails.companyType)
|
|
40
|
+
: null;
|
|
41
|
+
companyDetails.companyAddress
|
|
42
|
+
? bodyFormData.append("companyAddress", companyDetails.companyAddress)
|
|
43
|
+
: null;
|
|
44
|
+
companyDetails.directors
|
|
45
|
+
? bodyFormData.append("directors", companyDetails.directors)
|
|
46
|
+
: null;
|
|
47
|
+
companyDetails.clientRefNo
|
|
48
|
+
? bodyFormData.append("clientRefNo", companyDetails.clientRefNo)
|
|
49
|
+
: null;
|
|
50
|
+
companyDetails.reportMode
|
|
51
|
+
? bodyFormData.append("reportMode", companyDetails.reportMode)
|
|
52
|
+
: null;
|
|
53
|
+
companyDetails.priority
|
|
54
|
+
? bodyFormData.append("priority", companyDetails.priority)
|
|
55
|
+
: null;
|
|
56
|
+
companyDetails.callbackUrl
|
|
57
|
+
? bodyFormData.append("callbackUrl", companyDetails.callbackUrl)
|
|
58
|
+
: null;
|
|
59
|
+
companyDetails.cinNumber
|
|
60
|
+
? bodyFormData.append("cinNumber", companyDetails.cinNumber)
|
|
61
|
+
: null;
|
|
62
|
+
companyDetails.gstNumber
|
|
63
|
+
? bodyFormData.append("gstNumber", companyDetails.gstNumber)
|
|
64
|
+
: null;
|
|
65
|
+
companyDetails.reqTag
|
|
66
|
+
? bodyFormData.append("reqTag", companyDetails.reqTag)
|
|
67
|
+
: null;
|
|
68
|
+
companyDetails.ticketSize
|
|
69
|
+
? bodyFormData.append("ticketSize", companyDetails.ticketSize)
|
|
70
|
+
: null;
|
|
71
|
+
companyDetails.crimewatch
|
|
72
|
+
? bodyFormData.append("crimewatch", companyDetails.crimewatch)
|
|
73
|
+
: null;
|
|
74
|
+
|
|
38
75
|
try {
|
|
39
76
|
const response: AxiosResponse = await axios.post(
|
|
40
77
|
this.baseUrl + this.addReportEndpoint,
|
|
41
|
-
|
|
78
|
+
bodyFormData,
|
|
42
79
|
{
|
|
43
80
|
auth: {
|
|
44
81
|
username: this.apiKey,
|
|
@@ -50,12 +87,13 @@ class CrimeSearchAPIWrapper {
|
|
|
50
87
|
}
|
|
51
88
|
);
|
|
52
89
|
|
|
53
|
-
console.log(response.data);
|
|
54
90
|
return response.data;
|
|
55
91
|
} catch (error: any) {
|
|
56
92
|
console.error(error);
|
|
57
93
|
return error.message;
|
|
58
94
|
}
|
|
95
|
+
} else {
|
|
96
|
+
console.log("invalid details entered");
|
|
59
97
|
}
|
|
60
98
|
}
|
|
61
99
|
|
|
@@ -65,10 +103,46 @@ class CrimeSearchAPIWrapper {
|
|
|
65
103
|
const bodyFormData = new FormData();
|
|
66
104
|
if (individualDetails.name) {
|
|
67
105
|
bodyFormData.append("name", individualDetails.name);
|
|
106
|
+
individualDetails.fatherName
|
|
107
|
+
? bodyFormData.append("fatherName", individualDetails.fatherName)
|
|
108
|
+
: null;
|
|
109
|
+
individualDetails.address
|
|
110
|
+
? bodyFormData.append("address", individualDetails.address)
|
|
111
|
+
: null;
|
|
112
|
+
individualDetails.address2
|
|
113
|
+
? bodyFormData.append("address2", individualDetails.address2)
|
|
114
|
+
: null;
|
|
115
|
+
individualDetails.dob
|
|
116
|
+
? bodyFormData.append("dob", individualDetails.dob)
|
|
117
|
+
: null;
|
|
118
|
+
individualDetails.panNumber
|
|
119
|
+
? bodyFormData.append("panNumber", individualDetails.panNumber)
|
|
120
|
+
: null;
|
|
121
|
+
individualDetails.clientRefNo
|
|
122
|
+
? bodyFormData.append("clientRefNo", individualDetails.clientRefNo)
|
|
123
|
+
: null;
|
|
124
|
+
individualDetails.reportMode
|
|
125
|
+
? bodyFormData.append("reportMode", individualDetails.reportMode)
|
|
126
|
+
: null;
|
|
127
|
+
individualDetails.priority
|
|
128
|
+
? bodyFormData.append("priority", individualDetails.priority)
|
|
129
|
+
: null;
|
|
130
|
+
individualDetails.callbackUrl
|
|
131
|
+
? bodyFormData.append("callbackUrl", individualDetails.callbackUrl)
|
|
132
|
+
: null;
|
|
133
|
+
individualDetails.reqTag
|
|
134
|
+
? bodyFormData.append("reqTag", individualDetails.reqTag)
|
|
135
|
+
: null;
|
|
136
|
+
individualDetails.ticketSize
|
|
137
|
+
? bodyFormData.append("ticketSize", individualDetails.ticketSize)
|
|
138
|
+
: null;
|
|
139
|
+
individualDetails.crimewatch
|
|
140
|
+
? bodyFormData.append("crimewatch", individualDetails.crimewatch)
|
|
141
|
+
: null;
|
|
68
142
|
try {
|
|
69
143
|
const response: AxiosResponse = await axios.post(
|
|
70
144
|
this.baseUrl + this.addReportEndpoint,
|
|
71
|
-
|
|
145
|
+
bodyFormData,
|
|
72
146
|
{
|
|
73
147
|
auth: {
|
|
74
148
|
username: this.apiKey,
|
|
@@ -80,7 +154,6 @@ class CrimeSearchAPIWrapper {
|
|
|
80
154
|
}
|
|
81
155
|
);
|
|
82
156
|
|
|
83
|
-
console.log(response.data);
|
|
84
157
|
return response.data;
|
|
85
158
|
} catch (error: any) {
|
|
86
159
|
console.error(error);
|
|
@@ -99,35 +172,39 @@ class CrimeSearchAPIWrapper {
|
|
|
99
172
|
|
|
100
173
|
if (response.data) {
|
|
101
174
|
console.log("File downloaded successfully");
|
|
102
|
-
console.log(response.data);
|
|
103
175
|
return response.data;
|
|
104
176
|
} else {
|
|
105
177
|
console.error("Failed to download file");
|
|
106
|
-
return
|
|
178
|
+
return error;
|
|
107
179
|
}
|
|
108
180
|
} catch (error: any) {
|
|
109
181
|
console.error("Error:", error.message);
|
|
110
|
-
return
|
|
182
|
+
return error;
|
|
111
183
|
}
|
|
112
184
|
}
|
|
113
185
|
|
|
114
186
|
async downloadAsPDF(reqId: string): Promise<any> {
|
|
115
187
|
try {
|
|
116
188
|
const response: AxiosResponse = await axios.get(
|
|
117
|
-
this.baseUrl + this.downloadAsPdfEndpoint + `${reqId}/${this.apiKey}
|
|
189
|
+
this.baseUrl + this.downloadAsPdfEndpoint + `${reqId}/${this.apiKey}`,
|
|
190
|
+
{
|
|
191
|
+
responseType: "arraybuffer",
|
|
192
|
+
headers: {
|
|
193
|
+
"Content-Type": "application/pdf",
|
|
194
|
+
},
|
|
195
|
+
}
|
|
118
196
|
);
|
|
119
197
|
|
|
120
198
|
if (response.data) {
|
|
121
199
|
console.log("File downloaded successfully");
|
|
122
|
-
console.log(response.data);
|
|
123
200
|
return response.data;
|
|
124
201
|
} else {
|
|
125
202
|
console.error("Failed to download file");
|
|
126
|
-
return
|
|
203
|
+
return error;
|
|
127
204
|
}
|
|
128
205
|
} catch (error: any) {
|
|
129
206
|
console.error("Error:", error.message);
|
|
130
|
-
return
|
|
207
|
+
return error;
|
|
131
208
|
}
|
|
132
209
|
}
|
|
133
210
|
}
|
package/src/Finance/index.ts
CHANGED
|
@@ -4,7 +4,7 @@ import IngenicoApiWrapper from "./ingenico";
|
|
|
4
4
|
import CrimeSearchAPIWrapper from "./crimeCheck";
|
|
5
5
|
import QbrikApiWrapper from "./qbrik";
|
|
6
6
|
import AuFinanceApiWrapper from "./auFinance";
|
|
7
|
-
|
|
7
|
+
import SetuApiWrapper from "./setu";
|
|
8
8
|
export const finance = {
|
|
9
9
|
idFy: IdfyAPIWrapper,
|
|
10
10
|
novel: NovelApiWrapper,
|
|
@@ -12,4 +12,5 @@ export const finance = {
|
|
|
12
12
|
crimecheck: CrimeSearchAPIWrapper,
|
|
13
13
|
qbrik: QbrikApiWrapper,
|
|
14
14
|
auFinance: AuFinanceApiWrapper,
|
|
15
|
+
setu: SetuApiWrapper,
|
|
15
16
|
};
|
package/src/Finance/ingenico.ts
CHANGED
|
@@ -67,9 +67,7 @@ class IngenicoApiWrapper {
|
|
|
67
67
|
},
|
|
68
68
|
});
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
console.log(responseData);
|
|
70
|
+
return response.data;
|
|
73
71
|
} catch (error) {
|
|
74
72
|
console.error("Error:", error);
|
|
75
73
|
}
|
|
@@ -83,9 +81,7 @@ class IngenicoApiWrapper {
|
|
|
83
81
|
},
|
|
84
82
|
});
|
|
85
83
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
console.log(responseData);
|
|
84
|
+
return response.data;
|
|
89
85
|
} catch (error) {
|
|
90
86
|
console.error("Error:", error);
|
|
91
87
|
}
|
|
@@ -98,9 +94,7 @@ class IngenicoApiWrapper {
|
|
|
98
94
|
},
|
|
99
95
|
});
|
|
100
96
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
console.log(responseData);
|
|
97
|
+
return response.data;
|
|
104
98
|
} catch (error) {
|
|
105
99
|
console.error("Error:", error);
|
|
106
100
|
}
|
package/src/Finance/novel.ts
CHANGED
|
@@ -1,23 +1,35 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
2
|
import FormData from "form-data";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
CustomerDetails,
|
|
5
|
+
StatusType,
|
|
6
|
+
ContentType,
|
|
7
|
+
Metadata,
|
|
8
|
+
} from "./novel.types";
|
|
4
9
|
|
|
5
10
|
class NovelApiWrapper {
|
|
6
11
|
private authToken: string;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
this.authToken = "API://cJCwpFvaLS/qd7W8APrJt3tObcKQqZubh2/yoMHXsa4=";
|
|
10
|
-
}
|
|
11
|
-
private baseApiUrl = "https://cartbi.com/api/";
|
|
12
|
+
private isStaging: boolean;
|
|
13
|
+
private baseApiUrl: string;
|
|
12
14
|
private uploadEndpoint = "upload";
|
|
13
15
|
private downloadExcelEndpoint = "downloadFileAsExcel";
|
|
14
16
|
private downloadJsonEndpoint = "downloadFile";
|
|
15
17
|
private autoFetchEndpoint = "generateNetBankingRequest";
|
|
16
18
|
|
|
19
|
+
constructor(isStaging: boolean) {
|
|
20
|
+
this.isStaging = isStaging;
|
|
21
|
+
this.baseApiUrl = this.isStaging
|
|
22
|
+
? "https://cartuat.com/api/"
|
|
23
|
+
: "https://cartbi.com/api/";
|
|
24
|
+
this.authToken = this.isStaging
|
|
25
|
+
? "API://ET3S5WMo+L3d4lmRF6mOTOM1cPj/TKzuq3JCAyJO2BWPtoVJZ9trpECeSxrzEk05"
|
|
26
|
+
: "API://cJCwpFvaLS/qd7W8APrJt3tObcKQqZubh2/yoMHXsa4=";
|
|
27
|
+
}
|
|
28
|
+
|
|
17
29
|
async uploadDocument(
|
|
18
30
|
file: Buffer,
|
|
19
31
|
filename: string,
|
|
20
|
-
metadata:
|
|
32
|
+
metadata: Metadata,
|
|
21
33
|
documentDetails: any[]
|
|
22
34
|
) {
|
|
23
35
|
try {
|
|
@@ -43,15 +55,12 @@ class NovelApiWrapper {
|
|
|
43
55
|
);
|
|
44
56
|
if (response.status === 200) {
|
|
45
57
|
console.log(response.data.docId, "Document uploaded successfully");
|
|
46
|
-
console.log("Response:", response.data);
|
|
47
58
|
} else {
|
|
48
59
|
console.error("Failed to upload document");
|
|
49
|
-
console.error("Response:", response.data);
|
|
50
60
|
}
|
|
51
61
|
|
|
52
62
|
return response.data;
|
|
53
63
|
} catch (error: any) {
|
|
54
|
-
console.error("Error:", error.message);
|
|
55
64
|
return error.message;
|
|
56
65
|
}
|
|
57
66
|
}
|
|
@@ -96,7 +105,6 @@ class NovelApiWrapper {
|
|
|
96
105
|
|
|
97
106
|
if (response.data.error == false) {
|
|
98
107
|
console.log("File downloaded successfully");
|
|
99
|
-
console.log(response.data);
|
|
100
108
|
return response.data;
|
|
101
109
|
} else {
|
|
102
110
|
console.error("Failed to download file");
|
|
@@ -122,7 +130,6 @@ class NovelApiWrapper {
|
|
|
122
130
|
|
|
123
131
|
if (response.status == 200) {
|
|
124
132
|
console.log("File downloaded successfully");
|
|
125
|
-
console.log(response.data);
|
|
126
133
|
return response.data;
|
|
127
134
|
} else {
|
|
128
135
|
console.error("Failed to download file");
|