aeremmiddleware 1.0.25 → 1.0.27
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/README.md +28 -28
- package/dist/Finance/Ingenico.types.d.ts +1 -0
- 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/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/ingenicoHtml.js +114 -114
- package/dist/Finance/ingenicoHtml.js.map +1 -1
- package/dist/Finance/novel.d.ts +2 -1
- package/dist/Finance/novel.js +8 -8
- package/dist/Finance/novel.js.map +1 -1
- package/dist/Finance/novel.types.js +1 -1
- 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/Socials/Sms.types.js +1 -1
- package/dist/Socials/Sms.types.js.map +1 -1
- package/dist/Socials/Whatsapp.types.js +1 -1
- package/dist/Socials/Whatsapp.types.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/package.json +21 -21
- package/src/Finance/Ingenico.types.ts +22 -21
- package/src/Finance/auEncrypt.ts +32 -32
- package/src/Finance/auFinance.ts +115 -75
- package/src/Finance/crimeCheck.ts +212 -212
- package/src/Finance/crimecheck.types.ts +31 -31
- package/src/Finance/encrypt.ts +18 -18
- package/src/Finance/idfy.ts +542 -542
- package/src/Finance/index.ts +16 -15
- package/src/Finance/ingenico.ts +104 -110
- package/src/Finance/ingenicoHtml.ts +119 -119
- package/src/Finance/novel.ts +233 -231
- package/src/Finance/novel.types.ts +30 -30
- package/src/Finance/qbrik.ts +828 -828
- package/src/Finance/qbrik.types.ts +131 -131
- package/src/Finance/setu.ts +560 -0
- package/src/Finance/setu.types.ts +44 -0
- package/src/PushNotification/index.ts +5 -5
- package/src/PushNotification/pushNotificationFCM.ts +37 -37
- package/src/Socials/Sms.types.ts +9 -9
- package/src/Socials/SmsSender.ts +78 -78
- package/src/Socials/Whatsapp.types.ts +95 -95
- package/src/Socials/index.ts +6 -6
- package/src/Socials/whatsApp.ts +188 -188
- package/src/index.ts +9 -9
- package/tsconfig.json +111 -111
|
@@ -0,0 +1,560 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
import {
|
|
3
|
+
ConsentBodyType,
|
|
4
|
+
DigiData,
|
|
5
|
+
FiDataFetchBodyType,
|
|
6
|
+
MultiConsentBodyType,
|
|
7
|
+
PanVerificationBodyType,
|
|
8
|
+
TokenApiBodyType,
|
|
9
|
+
} from "./setu.types";
|
|
10
|
+
class SetuApiWrapper {
|
|
11
|
+
private baseUrl = "https://dg-sandbox.setu.co";
|
|
12
|
+
private aaBaseUrl = "https://fiu-sandbox.setu.co";
|
|
13
|
+
private aaTokenApiUrl = "https://orgservice-prod.setu.co/v1/users/login";
|
|
14
|
+
private panVerificationEndpoint = "/api/verify/pan";
|
|
15
|
+
private createOkycRequestEndpoint = "/api/okyc";
|
|
16
|
+
private createDigilockerRequestendpoint = "/api/digilocker";
|
|
17
|
+
private getListOfAllDocumentEndpoint = "/api/digilocker/documents";
|
|
18
|
+
private bavVerifyBanEndpoint = "/api/verify/ban";
|
|
19
|
+
private bavVerifyBanAsyncEndpoint = "/api/verify/ban/async";
|
|
20
|
+
private reverseBavCreateRpdEndpoint = "/api/verify/ban/reverse";
|
|
21
|
+
private pennylessBavEndpoint = "/api/verify/ban/pennyless";
|
|
22
|
+
private aaCreateConsentEndpoint = "/v2/consents";
|
|
23
|
+
private fiDataFetchEndpoint = "/v2/sessions";
|
|
24
|
+
private createMultiConsentEndpoint = "/v2/consents/consents/collection";
|
|
25
|
+
private getActiveFipEndpoint = "/v2/fips";
|
|
26
|
+
private kycClientId = "b62ace35-122c-4a18-9b5c-f60b2a6a2f9c";
|
|
27
|
+
private aaClientId = "56be0bb1-bd5b-4c4b-8d4f-95a74575eaf9";
|
|
28
|
+
private kycClientSecret = "UoZYWrl8NVc10XysYLPCY61sD6JQfGxg";
|
|
29
|
+
private aaClientSecret = "u51raAVQoB4mUEcCtdaZVunJu1uMDYiz";
|
|
30
|
+
private pennylessClientId = "3f2c2078-9d7e-45d2-bba5-3e5351f8208f";
|
|
31
|
+
private pennylessClientSecret = "LxDx1puj82rUZXJhzKj0vFVixTraNRVc";
|
|
32
|
+
private okycProductInstanceId = "03e72dac-2d3e-49fa-9f11-6e61146211ea";
|
|
33
|
+
private digiLockerProductInstanceId = "e733678e-ad25-4286-af23-0ef738b564d9";
|
|
34
|
+
private panVerificationProductInstanceId =
|
|
35
|
+
"b0b1114a-c48e-468f-bd6b-982b0e9a8c39";
|
|
36
|
+
private bavPennyDropProductInstanceId =
|
|
37
|
+
"48bb0235-db7b-4217-b802-451dd7c8a5fc";
|
|
38
|
+
private reversePennyDropProductInstanceId =
|
|
39
|
+
"239aa0bf-9652-4106-b4f8-f28a0f8f5ca6";
|
|
40
|
+
private pennylessBavProductInstanceId =
|
|
41
|
+
"a74baf19-de93-4564-8d89-6911fa805385";
|
|
42
|
+
private aaProductInstanceId = "eb20144b-5567-46c2-90f6-e900487e85e6";
|
|
43
|
+
|
|
44
|
+
async panVerification({
|
|
45
|
+
verificationData,
|
|
46
|
+
}: {
|
|
47
|
+
verificationData: PanVerificationBodyType;
|
|
48
|
+
}) {
|
|
49
|
+
try {
|
|
50
|
+
const headers = {
|
|
51
|
+
"x-client-id": this.kycClientId,
|
|
52
|
+
"x-client-secret": this.kycClientSecret,
|
|
53
|
+
"x-product-instance-id": this.panVerificationProductInstanceId,
|
|
54
|
+
"Content-Type": "application/json",
|
|
55
|
+
};
|
|
56
|
+
const verificationJson = {
|
|
57
|
+
pan: verificationData.pan,
|
|
58
|
+
consent: verificationData.consent,
|
|
59
|
+
reason: verificationData.reason,
|
|
60
|
+
};
|
|
61
|
+
const response = await axios.post(
|
|
62
|
+
`${this.baseUrl}${this.panVerificationEndpoint}`,
|
|
63
|
+
verificationJson,
|
|
64
|
+
{ headers }
|
|
65
|
+
);
|
|
66
|
+
return response.data;
|
|
67
|
+
} catch (error: any) {
|
|
68
|
+
return error;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
async createAadhaarKycRequest({ redirectUrl }: { redirectUrl: string }) {
|
|
73
|
+
try {
|
|
74
|
+
const headers = {
|
|
75
|
+
"x-client-id": this.kycClientId,
|
|
76
|
+
"x-client-secret": this.kycClientSecret,
|
|
77
|
+
"x-product-instance-id": this.okycProductInstanceId,
|
|
78
|
+
"Content-Type": "application/json",
|
|
79
|
+
};
|
|
80
|
+
const webhook = {
|
|
81
|
+
redirectURL: redirectUrl,
|
|
82
|
+
};
|
|
83
|
+
const response = await axios.post(
|
|
84
|
+
`${this.baseUrl}${this.createOkycRequestEndpoint}`,
|
|
85
|
+
webhook,
|
|
86
|
+
{ headers }
|
|
87
|
+
);
|
|
88
|
+
return response.data;
|
|
89
|
+
} catch (error: any) {
|
|
90
|
+
return error;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
async getAadhaarKycDetails({
|
|
95
|
+
reqId,
|
|
96
|
+
shareCode,
|
|
97
|
+
}: {
|
|
98
|
+
reqId: string;
|
|
99
|
+
shareCode: string;
|
|
100
|
+
}) {
|
|
101
|
+
try {
|
|
102
|
+
const headers = {
|
|
103
|
+
"x-client-id": this.kycClientId,
|
|
104
|
+
"x-client-secret": this.kycClientSecret,
|
|
105
|
+
"x-product-instance-id": this.okycProductInstanceId,
|
|
106
|
+
};
|
|
107
|
+
const response = await axios.get(
|
|
108
|
+
`${this.baseUrl}${this.createOkycRequestEndpoint}/${reqId}/${shareCode}`,
|
|
109
|
+
{ headers }
|
|
110
|
+
);
|
|
111
|
+
return response.data;
|
|
112
|
+
} catch (error: any) {
|
|
113
|
+
return error;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
async createDigilockerRequest({ redirectUrl }: { redirectUrl: string }) {
|
|
118
|
+
try {
|
|
119
|
+
const headers = {
|
|
120
|
+
"x-client-id": this.kycClientId,
|
|
121
|
+
"x-client-secret": this.kycClientSecret,
|
|
122
|
+
"x-product-instance-id": this.digiLockerProductInstanceId,
|
|
123
|
+
};
|
|
124
|
+
const webhook = {
|
|
125
|
+
redirectUrl: redirectUrl,
|
|
126
|
+
};
|
|
127
|
+
const response = await axios.post(
|
|
128
|
+
`${this.baseUrl}${this.createDigilockerRequestendpoint}`,
|
|
129
|
+
webhook,
|
|
130
|
+
{ headers }
|
|
131
|
+
);
|
|
132
|
+
return response.data;
|
|
133
|
+
} catch (error: any) {
|
|
134
|
+
return error;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
async fetchDigilockerDocument({
|
|
139
|
+
reqId,
|
|
140
|
+
digiData,
|
|
141
|
+
}: {
|
|
142
|
+
reqId: string;
|
|
143
|
+
digiData: DigiData;
|
|
144
|
+
}) {
|
|
145
|
+
try {
|
|
146
|
+
const headers = {
|
|
147
|
+
"x-client-id": this.kycClientId,
|
|
148
|
+
"x-client-secret": this.kycClientSecret,
|
|
149
|
+
"x-product-instance-id": this.digiLockerProductInstanceId,
|
|
150
|
+
"Content-Type": "application/json",
|
|
151
|
+
};
|
|
152
|
+
const jsonData = {
|
|
153
|
+
docType: digiData.docType,
|
|
154
|
+
format: digiData.format,
|
|
155
|
+
consent: digiData.consent,
|
|
156
|
+
};
|
|
157
|
+
const response = await axios.post(
|
|
158
|
+
`${this.baseUrl}/api/digilocker/${reqId}/document`,
|
|
159
|
+
jsonData,
|
|
160
|
+
{ headers }
|
|
161
|
+
);
|
|
162
|
+
return response.data;
|
|
163
|
+
} catch (error: any) {
|
|
164
|
+
return error;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
async getAadhaarXml({ reqId }: { reqId: String }) {
|
|
169
|
+
try {
|
|
170
|
+
const headers = {
|
|
171
|
+
"x-client-id": this.kycClientId,
|
|
172
|
+
"x-client-secret": this.kycClientSecret,
|
|
173
|
+
"x-product-instance-id": this.digiLockerProductInstanceId,
|
|
174
|
+
};
|
|
175
|
+
const response = await axios.get(
|
|
176
|
+
`${this.baseUrl}/api/digilocker/${reqId}/aadhaar`,
|
|
177
|
+
{ headers }
|
|
178
|
+
);
|
|
179
|
+
return response.data;
|
|
180
|
+
} catch (error: any) {
|
|
181
|
+
return error;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
async getListOfDocsAvailable() {
|
|
186
|
+
try {
|
|
187
|
+
const headers = {
|
|
188
|
+
"x-client-id": this.kycClientId,
|
|
189
|
+
"x-client-secret": this.kycClientSecret,
|
|
190
|
+
"x-product-instance-id": this.digiLockerProductInstanceId,
|
|
191
|
+
};
|
|
192
|
+
const response = await axios.get(
|
|
193
|
+
`${this.baseUrl}${this.getListOfAllDocumentEndpoint}`,
|
|
194
|
+
{ headers }
|
|
195
|
+
);
|
|
196
|
+
return response.data;
|
|
197
|
+
} catch (error: any) {
|
|
198
|
+
return error;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
async revokeAccessToken({ reqId }: { reqId: String }) {
|
|
203
|
+
try {
|
|
204
|
+
const headers = {
|
|
205
|
+
"x-client-id": this.kycClientId,
|
|
206
|
+
"x-client-secret": this.kycClientSecret,
|
|
207
|
+
"x-product-instance-id": this.digiLockerProductInstanceId,
|
|
208
|
+
};
|
|
209
|
+
const response = await axios.get(
|
|
210
|
+
`${this.baseUrl}/api/digilocker/${reqId}/revoke`,
|
|
211
|
+
{ headers }
|
|
212
|
+
);
|
|
213
|
+
return response.data;
|
|
214
|
+
} catch (error: any) {
|
|
215
|
+
return error;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
async getApiStatus({ reqId }: { reqId: String }) {
|
|
220
|
+
try {
|
|
221
|
+
const headers = {
|
|
222
|
+
"x-client-id": this.kycClientId,
|
|
223
|
+
"x-client-secret": this.kycClientSecret,
|
|
224
|
+
"x-product-instance-id": this.digiLockerProductInstanceId,
|
|
225
|
+
};
|
|
226
|
+
const response = await axios.get(
|
|
227
|
+
`${this.baseUrl}/api/digilocker/${reqId}/status`,
|
|
228
|
+
{ headers }
|
|
229
|
+
);
|
|
230
|
+
return response.data;
|
|
231
|
+
} catch (error: any) {
|
|
232
|
+
return error;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
async verifyBan({ ifsc, accNo }: { ifsc: string; accNo: DigiData }) {
|
|
237
|
+
try {
|
|
238
|
+
const headers = {
|
|
239
|
+
"x-client-id": this.kycClientId,
|
|
240
|
+
"x-client-secret": this.kycClientSecret,
|
|
241
|
+
"x-product-instance-id": this.bavPennyDropProductInstanceId,
|
|
242
|
+
"Content-Type": "application/json",
|
|
243
|
+
};
|
|
244
|
+
const jsonData = {
|
|
245
|
+
ifsc: ifsc,
|
|
246
|
+
accountNumber: accNo,
|
|
247
|
+
};
|
|
248
|
+
const response = await axios.post(
|
|
249
|
+
`${this.baseUrl}${this.bavVerifyBanEndpoint}`,
|
|
250
|
+
jsonData,
|
|
251
|
+
{ headers }
|
|
252
|
+
);
|
|
253
|
+
return response.data;
|
|
254
|
+
} catch (error: any) {
|
|
255
|
+
return error;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
async verifyBanAsync({
|
|
260
|
+
ifsc,
|
|
261
|
+
accNo,
|
|
262
|
+
narration,
|
|
263
|
+
}: {
|
|
264
|
+
ifsc: string;
|
|
265
|
+
accNo: DigiData;
|
|
266
|
+
narration: string;
|
|
267
|
+
}) {
|
|
268
|
+
try {
|
|
269
|
+
const headers = {
|
|
270
|
+
"x-client-id": this.kycClientId,
|
|
271
|
+
"x-client-secret": this.kycClientSecret,
|
|
272
|
+
"x-product-instance-id": this.bavPennyDropProductInstanceId,
|
|
273
|
+
"Content-Type": "application/json",
|
|
274
|
+
};
|
|
275
|
+
const jsonData = {
|
|
276
|
+
ifsc: ifsc,
|
|
277
|
+
accountNumber: accNo,
|
|
278
|
+
narration: narration,
|
|
279
|
+
};
|
|
280
|
+
const response = await axios.post(
|
|
281
|
+
`${this.baseUrl}${this.bavVerifyBanAsyncEndpoint}`,
|
|
282
|
+
jsonData,
|
|
283
|
+
{ headers }
|
|
284
|
+
);
|
|
285
|
+
return response.data;
|
|
286
|
+
} catch (error: any) {
|
|
287
|
+
return error;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
async getBavRequestDetails({ reqId }: { reqId: String }) {
|
|
292
|
+
try {
|
|
293
|
+
const headers = {
|
|
294
|
+
"x-client-id": this.kycClientId,
|
|
295
|
+
"x-client-secret": this.kycClientSecret,
|
|
296
|
+
"x-product-instance-id": this.digiLockerProductInstanceId,
|
|
297
|
+
};
|
|
298
|
+
const response = await axios.get(
|
|
299
|
+
`${this.baseUrl}/api/verify/ban/async/${reqId}`,
|
|
300
|
+
{ headers }
|
|
301
|
+
);
|
|
302
|
+
return response.data;
|
|
303
|
+
} catch (error: any) {
|
|
304
|
+
return error;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
async createPRD(
|
|
309
|
+
reqId: string,
|
|
310
|
+
{ value1, value2 }: { value1?: string; value2?: string } = {}
|
|
311
|
+
) {
|
|
312
|
+
try {
|
|
313
|
+
const headers = {
|
|
314
|
+
"x-client-id": this.kycClientId,
|
|
315
|
+
"x-client-secret": this.kycClientSecret,
|
|
316
|
+
"x-product-instance-id": this.reversePennyDropProductInstanceId,
|
|
317
|
+
"Content-Type": "application/json",
|
|
318
|
+
};
|
|
319
|
+
const jsonData = {
|
|
320
|
+
additionalData: {
|
|
321
|
+
key1: value1,
|
|
322
|
+
key2: value2,
|
|
323
|
+
},
|
|
324
|
+
};
|
|
325
|
+
const response = await axios.post(
|
|
326
|
+
`${this.baseUrl}${this.reverseBavCreateRpdEndpoint}/${reqId}`,
|
|
327
|
+
jsonData,
|
|
328
|
+
{ headers }
|
|
329
|
+
);
|
|
330
|
+
return response.data;
|
|
331
|
+
} catch (error: any) {
|
|
332
|
+
return error;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
async getReversePennyDetails({ reqId }: { reqId: String }) {
|
|
337
|
+
try {
|
|
338
|
+
const headers = {
|
|
339
|
+
"x-client-id": this.kycClientId,
|
|
340
|
+
"x-client-secret": this.kycClientSecret,
|
|
341
|
+
"x-product-instance-id": this.reversePennyDropProductInstanceId,
|
|
342
|
+
};
|
|
343
|
+
const response = await axios.get(
|
|
344
|
+
`${this.baseUrl}/api/verify/ban/reverse/${reqId}`,
|
|
345
|
+
{ headers }
|
|
346
|
+
);
|
|
347
|
+
return response.data;
|
|
348
|
+
} catch (error: any) {
|
|
349
|
+
return error;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
async pennylessBankAccVerification({
|
|
354
|
+
accountNumber,
|
|
355
|
+
ifsc,
|
|
356
|
+
}: {
|
|
357
|
+
accountNumber: string;
|
|
358
|
+
ifsc: string;
|
|
359
|
+
}) {
|
|
360
|
+
try {
|
|
361
|
+
const headers = {
|
|
362
|
+
"x-client-id": this.pennylessClientId,
|
|
363
|
+
"x-client-secret": this.pennylessClientSecret,
|
|
364
|
+
"x-product-instance-id": this.pennylessBavProductInstanceId,
|
|
365
|
+
"Content-Type": "application/json",
|
|
366
|
+
};
|
|
367
|
+
const jsonData = {
|
|
368
|
+
accountNumber: accountNumber,
|
|
369
|
+
ifsc: ifsc,
|
|
370
|
+
};
|
|
371
|
+
const response = await axios.post(
|
|
372
|
+
`${this.baseUrl}${this.pennylessBavEndpoint}`,
|
|
373
|
+
jsonData,
|
|
374
|
+
{
|
|
375
|
+
headers,
|
|
376
|
+
}
|
|
377
|
+
);
|
|
378
|
+
return response.data;
|
|
379
|
+
} catch (error: any) {
|
|
380
|
+
return error;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
async createNewConsent({ consentBody }: { consentBody: ConsentBodyType }) {
|
|
385
|
+
try {
|
|
386
|
+
const headers = {
|
|
387
|
+
"x-client-id": this.aaClientId,
|
|
388
|
+
"x-client-secret": this.aaClientSecret,
|
|
389
|
+
"x-product-instance-id": this.aaProductInstanceId,
|
|
390
|
+
"Content-Type": "application/json",
|
|
391
|
+
};
|
|
392
|
+
const response = await axios.post(
|
|
393
|
+
`${this.aaBaseUrl}${this.aaCreateConsentEndpoint}`,
|
|
394
|
+
consentBody,
|
|
395
|
+
{
|
|
396
|
+
headers,
|
|
397
|
+
}
|
|
398
|
+
);
|
|
399
|
+
return response.data;
|
|
400
|
+
} catch (error: any) {
|
|
401
|
+
return error;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
async getConsent({ id }: { id: String }) {
|
|
406
|
+
try {
|
|
407
|
+
const headers = {
|
|
408
|
+
"x-client-id": this.aaClientId,
|
|
409
|
+
"x-client-secret": this.aaClientSecret,
|
|
410
|
+
"x-product-instance-id": this.aaProductInstanceId,
|
|
411
|
+
};
|
|
412
|
+
const response = await axios.get(`${this.aaBaseUrl}/v2/consents/${id}`, {
|
|
413
|
+
headers,
|
|
414
|
+
});
|
|
415
|
+
return response.data;
|
|
416
|
+
} catch (error: any) {
|
|
417
|
+
return error;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
async getLastFetchStatus({ id }: { id: String }) {
|
|
422
|
+
try {
|
|
423
|
+
const headers = {
|
|
424
|
+
"x-client-id": this.aaClientId,
|
|
425
|
+
"x-client-secret": this.aaClientSecret,
|
|
426
|
+
"x-product-instance-id": this.aaProductInstanceId,
|
|
427
|
+
};
|
|
428
|
+
const response = await axios.get(
|
|
429
|
+
`${this.aaBaseUrl}/v2/consents/${id}/fetch/status`,
|
|
430
|
+
{
|
|
431
|
+
headers,
|
|
432
|
+
}
|
|
433
|
+
);
|
|
434
|
+
return response.data;
|
|
435
|
+
} catch (error: any) {
|
|
436
|
+
return error;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
async refreshDataPull({ id }: { id: String }) {
|
|
441
|
+
try {
|
|
442
|
+
const headers = {
|
|
443
|
+
"x-client-id": this.aaClientId,
|
|
444
|
+
"x-client-secret": this.aaClientSecret,
|
|
445
|
+
"x-product-instance-id": this.aaProductInstanceId,
|
|
446
|
+
};
|
|
447
|
+
const response = await axios.get(
|
|
448
|
+
`${this.aaBaseUrl}/v2/sessions/refresh/${id}`,
|
|
449
|
+
{
|
|
450
|
+
headers,
|
|
451
|
+
}
|
|
452
|
+
);
|
|
453
|
+
return response.data;
|
|
454
|
+
} catch (error: any) {
|
|
455
|
+
return error;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
async createFiDataFetch({ fiDataBody }: { fiDataBody: FiDataFetchBodyType }) {
|
|
460
|
+
try {
|
|
461
|
+
const headers = {
|
|
462
|
+
"x-client-id": this.aaClientId,
|
|
463
|
+
"x-client-secret": this.aaClientSecret,
|
|
464
|
+
"x-product-instance-id": this.aaProductInstanceId,
|
|
465
|
+
"Content-Type": "application/json",
|
|
466
|
+
};
|
|
467
|
+
const response = await axios.post(
|
|
468
|
+
`${this.aaBaseUrl}${this.fiDataFetchEndpoint}`,
|
|
469
|
+
fiDataBody,
|
|
470
|
+
{
|
|
471
|
+
headers,
|
|
472
|
+
}
|
|
473
|
+
);
|
|
474
|
+
return response.data;
|
|
475
|
+
} catch (error: any) {
|
|
476
|
+
return error;
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
async getFiData({ id }: { id: String }) {
|
|
481
|
+
try {
|
|
482
|
+
const headers = {
|
|
483
|
+
"x-client-id": this.aaClientId,
|
|
484
|
+
"x-client-secret": this.aaClientSecret,
|
|
485
|
+
"x-product-instance-id": this.aaProductInstanceId,
|
|
486
|
+
};
|
|
487
|
+
const response = await axios.get(
|
|
488
|
+
`${this.aaBaseUrl}${this.fiDataFetchEndpoint}/${id}`,
|
|
489
|
+
{
|
|
490
|
+
headers,
|
|
491
|
+
}
|
|
492
|
+
);
|
|
493
|
+
return response.data;
|
|
494
|
+
} catch (error: any) {
|
|
495
|
+
return error;
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
async createMultiConsent({
|
|
500
|
+
consentBody,
|
|
501
|
+
}: {
|
|
502
|
+
consentBody: MultiConsentBodyType;
|
|
503
|
+
}) {
|
|
504
|
+
try {
|
|
505
|
+
const headers = {
|
|
506
|
+
"x-client-id": this.aaClientId,
|
|
507
|
+
"x-client-secret": this.aaClientSecret,
|
|
508
|
+
"x-product-instance-id": this.aaProductInstanceId,
|
|
509
|
+
"Content-Type": "application/json",
|
|
510
|
+
};
|
|
511
|
+
const response = await axios.post(
|
|
512
|
+
`${this.aaBaseUrl}${this.createMultiConsentEndpoint}`,
|
|
513
|
+
consentBody,
|
|
514
|
+
{
|
|
515
|
+
headers,
|
|
516
|
+
}
|
|
517
|
+
);
|
|
518
|
+
return response.data;
|
|
519
|
+
} catch (error: any) {
|
|
520
|
+
return error;
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
async createTokenApi({ tokenBody }: { tokenBody: TokenApiBodyType }) {
|
|
525
|
+
try {
|
|
526
|
+
const headers = {
|
|
527
|
+
"x-client-id": this.aaClientId,
|
|
528
|
+
"x-client-secret": this.aaClientSecret,
|
|
529
|
+
"x-product-instance-id": this.aaProductInstanceId,
|
|
530
|
+
"Content-Type": "application/json",
|
|
531
|
+
};
|
|
532
|
+
const response = await axios.post(`${this.aaTokenApiUrl}`, tokenBody, {
|
|
533
|
+
headers,
|
|
534
|
+
});
|
|
535
|
+
return response.data;
|
|
536
|
+
} catch (error: any) {
|
|
537
|
+
return error;
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
async getActiveFipList() {
|
|
542
|
+
try {
|
|
543
|
+
const headers = {
|
|
544
|
+
"x-client-id": this.aaClientId,
|
|
545
|
+
"x-client-secret": this.aaClientSecret,
|
|
546
|
+
"x-product-instance-id": this.aaProductInstanceId,
|
|
547
|
+
};
|
|
548
|
+
const response = await axios.get(
|
|
549
|
+
`${this.aaBaseUrl}${this.getActiveFipEndpoint}`,
|
|
550
|
+
{
|
|
551
|
+
headers,
|
|
552
|
+
}
|
|
553
|
+
);
|
|
554
|
+
return response.data;
|
|
555
|
+
} catch (error: any) {
|
|
556
|
+
return error;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
export default SetuApiWrapper;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export interface DigiData {
|
|
2
|
+
docType: string;
|
|
3
|
+
format: string;
|
|
4
|
+
consent: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface ConsentBodyType {
|
|
8
|
+
consentDuration: {
|
|
9
|
+
unit: string;
|
|
10
|
+
value: string;
|
|
11
|
+
};
|
|
12
|
+
vua: string;
|
|
13
|
+
dataRange: {
|
|
14
|
+
from: string;
|
|
15
|
+
to: string;
|
|
16
|
+
};
|
|
17
|
+
context?: string[];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface FiDataFetchBodyType {
|
|
21
|
+
consentId: string;
|
|
22
|
+
dataRange: {
|
|
23
|
+
from: string;
|
|
24
|
+
to: string;
|
|
25
|
+
};
|
|
26
|
+
format: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface MultiConsentBodyType {
|
|
30
|
+
optionalConsents: string[];
|
|
31
|
+
mandatoryConsents: string[];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface TokenApiBodyType {
|
|
35
|
+
clientID: string;
|
|
36
|
+
grant_type: string;
|
|
37
|
+
secret: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface PanVerificationBodyType {
|
|
41
|
+
pan: string;
|
|
42
|
+
consent: string;
|
|
43
|
+
reason: string;
|
|
44
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import PushNotificationFCM from "./pushNotificationFCM";
|
|
2
|
-
|
|
3
|
-
export const pushNotification = {
|
|
4
|
-
pushNotificationFCM: PushNotificationFCM,
|
|
5
|
-
};
|
|
1
|
+
import PushNotificationFCM from "./pushNotificationFCM";
|
|
2
|
+
|
|
3
|
+
export const pushNotification = {
|
|
4
|
+
pushNotificationFCM: PushNotificationFCM,
|
|
5
|
+
};
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
const FCM = require("fcm-node");
|
|
2
|
-
|
|
3
|
-
export default class PushNotificationFCM{
|
|
4
|
-
public async sendPushNotification(
|
|
5
|
-
serverKey:string,
|
|
6
|
-
registrationIds: string[],
|
|
7
|
-
title: string,
|
|
8
|
-
body: string,
|
|
9
|
-
data: {},
|
|
10
|
-
icon?: string,
|
|
11
|
-
sound?: string,
|
|
12
|
-
): Promise<any> {
|
|
13
|
-
const fcm = new FCM(serverKey);
|
|
14
|
-
|
|
15
|
-
return new Promise((resolve, reject) => {
|
|
16
|
-
const pushMessage = {
|
|
17
|
-
registration_ids: registrationIds,
|
|
18
|
-
notification: {
|
|
19
|
-
body: body,
|
|
20
|
-
icon: icon || "myicon",
|
|
21
|
-
sound: sound || "mySound",
|
|
22
|
-
title: title,
|
|
23
|
-
},
|
|
24
|
-
data: data,
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
fcm.send(pushMessage, (err: any, response: any) => {
|
|
28
|
-
if (err) {
|
|
29
|
-
console.log("Something has gone wrong!", err);
|
|
30
|
-
reject(err);
|
|
31
|
-
} else {
|
|
32
|
-
console.log("Push notification sent.", response);
|
|
33
|
-
resolve(response);
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
}
|
|
1
|
+
const FCM = require("fcm-node");
|
|
2
|
+
|
|
3
|
+
export default class PushNotificationFCM{
|
|
4
|
+
public async sendPushNotification(
|
|
5
|
+
serverKey:string,
|
|
6
|
+
registrationIds: string[],
|
|
7
|
+
title: string,
|
|
8
|
+
body: string,
|
|
9
|
+
data: {},
|
|
10
|
+
icon?: string,
|
|
11
|
+
sound?: string,
|
|
12
|
+
): Promise<any> {
|
|
13
|
+
const fcm = new FCM(serverKey);
|
|
14
|
+
|
|
15
|
+
return new Promise((resolve, reject) => {
|
|
16
|
+
const pushMessage = {
|
|
17
|
+
registration_ids: registrationIds,
|
|
18
|
+
notification: {
|
|
19
|
+
body: body,
|
|
20
|
+
icon: icon || "myicon",
|
|
21
|
+
sound: sound || "mySound",
|
|
22
|
+
title: title,
|
|
23
|
+
},
|
|
24
|
+
data: data,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
fcm.send(pushMessage, (err: any, response: any) => {
|
|
28
|
+
if (err) {
|
|
29
|
+
console.log("Something has gone wrong!", err);
|
|
30
|
+
reject(err);
|
|
31
|
+
} else {
|
|
32
|
+
console.log("Push notification sent.", response);
|
|
33
|
+
resolve(response);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
38
|
}
|
package/src/Socials/Sms.types.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export enum Provider {
|
|
2
|
-
EXOTEL = "EXOTEL",
|
|
3
|
-
GUPSHUP = "GUPSHUP",
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export interface DemoBody{
|
|
7
|
-
To:string,
|
|
8
|
-
Body:string,
|
|
9
|
-
}
|
|
1
|
+
export enum Provider {
|
|
2
|
+
EXOTEL = "EXOTEL",
|
|
3
|
+
GUPSHUP = "GUPSHUP",
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface DemoBody{
|
|
7
|
+
To:string,
|
|
8
|
+
Body:string,
|
|
9
|
+
}
|