aeremmiddleware 1.0.19 → 1.0.22

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 (59) hide show
  1. package/README.md +28 -28
  2. package/dist/AU finance/auEncrypt.d.ts +2 -0
  3. package/dist/AU finance/auEncrypt.js +63 -0
  4. package/dist/AU finance/auEncrypt.js.map +1 -0
  5. package/dist/AU finance/auFinance.d.ts +7 -0
  6. package/dist/AU finance/auFinance.js +43 -0
  7. package/dist/AU finance/auFinance.js.map +1 -0
  8. package/dist/Finance/auEncrypt.d.ts +2 -0
  9. package/dist/Finance/auEncrypt.js +36 -0
  10. package/dist/Finance/auEncrypt.js.map +1 -0
  11. package/dist/Finance/auFinance.d.ts +19 -0
  12. package/dist/Finance/auFinance.js +73 -0
  13. package/dist/Finance/auFinance.js.map +1 -0
  14. package/dist/Finance/index.d.ts +2 -0
  15. package/dist/Finance/index.js +2 -0
  16. package/dist/Finance/index.js.map +1 -1
  17. package/dist/Finance/ingenicoHtml.js +114 -114
  18. package/dist/Finance/novel.js +1 -1
  19. package/dist/Finance/novel.types.js +1 -1
  20. package/dist/Finance/novel.types.js.map +1 -1
  21. package/dist/Finance/qbrik.d.ts +34 -33
  22. package/dist/Finance/qbrik.js +7 -6
  23. package/dist/Finance/qbrik.js.map +1 -1
  24. package/dist/Finance/qbrik.types.d.ts +50 -0
  25. package/dist/Socials/Sms.types.js +1 -1
  26. package/dist/Socials/Sms.types.js.map +1 -1
  27. package/dist/Socials/Whatsapp.types.js +1 -1
  28. package/dist/Socials/Whatsapp.types.js.map +1 -1
  29. package/dist/index.d.ts +1 -0
  30. package/dist/{PushNotification → pushNotification}/index.js +1 -1
  31. package/package.json +21 -21
  32. package/src/Finance/Ingenico.types.ts +21 -21
  33. package/src/Finance/auEncrypt.ts +32 -0
  34. package/src/Finance/auFinance.ts +78 -0
  35. package/src/Finance/crimeCheck.ts +135 -135
  36. package/src/Finance/crimecheck.types.ts +31 -31
  37. package/src/Finance/encrypt.ts +18 -18
  38. package/src/Finance/idfy.ts +542 -542
  39. package/src/Finance/index.ts +15 -13
  40. package/src/Finance/ingenico.ts +110 -110
  41. package/src/Finance/ingenicoHtml.ts +119 -119
  42. package/src/Finance/novel.ts +226 -226
  43. package/src/Finance/novel.types.ts +24 -24
  44. package/src/Finance/qbrik.ts +828 -822
  45. package/src/Finance/qbrik.types.ts +131 -81
  46. package/src/PushNotification/index.ts +5 -5
  47. package/src/PushNotification/pushNotificationFCM.ts +37 -37
  48. package/src/Socials/Sms.types.ts +9 -9
  49. package/src/Socials/SmsSender.ts +78 -78
  50. package/src/Socials/Whatsapp.types.ts +95 -95
  51. package/src/Socials/index.ts +6 -6
  52. package/src/Socials/whatsApp.ts +188 -188
  53. package/src/index.ts +9 -9
  54. package/tsconfig.json +111 -111
  55. /package/dist/{PushNotification → pushNotification}/index.d.ts +0 -0
  56. /package/dist/{PushNotification → pushNotification}/index.js.map +0 -0
  57. /package/dist/{PushNotification → pushNotification}/pushNotificationFCM.d.ts +0 -0
  58. /package/dist/{PushNotification → pushNotification}/pushNotificationFCM.js +0 -0
  59. /package/dist/{PushNotification → pushNotification}/pushNotificationFCM.js.map +0 -0
@@ -1,135 +1,135 @@
1
- import axios, { AxiosResponse } from "axios";
2
- import { companyDetails, individualDetails } from "./crimecheck.types";
3
-
4
- class CrimeSearchAPIWrapper {
5
- private apiKey: string;
6
- private baseUrl: string = "https://crime.getupforchange.com/api/";
7
- private statusCheckEndpoint = "v3/status";
8
- private addReportEndpoint = "v3/addReport";
9
- private downloadAsJsonEndpoint = "v3/downloadJsonReport/";
10
- private downloadAsPdfEndpoint = "v3/downloadReport/";
11
-
12
- constructor(apiKey: string) {
13
- this.apiKey = apiKey;
14
- }
15
-
16
- async checkApiStatus(): Promise<void> {
17
- try {
18
- const response: AxiosResponse = await axios.get(
19
- this.baseUrl + this.statusCheckEndpoint,
20
- {
21
- headers: {
22
- Authorization: this.apiKey,
23
- },
24
- }
25
- );
26
-
27
- console.log(response.data);
28
- return response.data;
29
- } catch (error: any) {
30
- console.error(error);
31
- return error.message;
32
- }
33
- }
34
- async addCompanyReport(companyDetails: companyDetails): Promise<void> {
35
- const bodyFormData = new FormData();
36
- if (companyDetails) {
37
- bodyFormData.append("companyName", companyDetails.companyName);
38
- try {
39
- const response: AxiosResponse = await axios.post(
40
- this.baseUrl + this.addReportEndpoint,
41
- companyDetails,
42
- {
43
- auth: {
44
- username: this.apiKey,
45
- password: "",
46
- },
47
- headers: {
48
- "Content-Type": "application/x-www-form-urlencoded",
49
- },
50
- }
51
- );
52
-
53
- console.log(response.data);
54
- return response.data;
55
- } catch (error: any) {
56
- console.error(error);
57
- return error.message;
58
- }
59
- }
60
- }
61
-
62
- async addIndividualReport(
63
- individualDetails: individualDetails
64
- ): Promise<void> {
65
- const bodyFormData = new FormData();
66
- if (individualDetails.name) {
67
- bodyFormData.append("name", individualDetails.name);
68
- try {
69
- const response: AxiosResponse = await axios.post(
70
- this.baseUrl + this.addReportEndpoint,
71
- individualDetails,
72
- {
73
- auth: {
74
- username: this.apiKey,
75
- password: "",
76
- },
77
- headers: {
78
- "Content-Type": "application/x-www-form-urlencoded",
79
- },
80
- }
81
- );
82
-
83
- console.log(response.data);
84
- return response.data;
85
- } catch (error: any) {
86
- console.error(error);
87
- return error.message;
88
- }
89
- } else {
90
- console.log("invalid input");
91
- }
92
- }
93
-
94
- async downloadAsJSON(reqId: string): Promise<any> {
95
- try {
96
- const response: AxiosResponse = await axios.get(
97
- this.baseUrl + this.downloadAsJsonEndpoint + `${reqId}/${this.apiKey}`
98
- );
99
-
100
- if (response.data) {
101
- console.log("File downloaded successfully");
102
- console.log(response.data);
103
- return response.data;
104
- } else {
105
- console.error("Failed to download file");
106
- return null;
107
- }
108
- } catch (error: any) {
109
- console.error("Error:", error.message);
110
- return null;
111
- }
112
- }
113
-
114
- async downloadAsPDF(reqId: string): Promise<any> {
115
- try {
116
- const response: AxiosResponse = await axios.get(
117
- this.baseUrl + this.downloadAsPdfEndpoint + `${reqId}/${this.apiKey}`
118
- );
119
-
120
- if (response.data) {
121
- console.log("File downloaded successfully");
122
- console.log(response.data);
123
- return response.data;
124
- } else {
125
- console.error("Failed to download file");
126
- return null;
127
- }
128
- } catch (error: any) {
129
- console.error("Error:", error.message);
130
- return null;
131
- }
132
- }
133
- }
134
-
135
- export default CrimeSearchAPIWrapper;
1
+ import axios, { AxiosResponse } from "axios";
2
+ import { companyDetails, individualDetails } from "./crimecheck.types";
3
+
4
+ class CrimeSearchAPIWrapper {
5
+ private apiKey: string;
6
+ private baseUrl: string = "https://crime.getupforchange.com/api/";
7
+ private statusCheckEndpoint = "v3/status";
8
+ private addReportEndpoint = "v3/addReport";
9
+ private downloadAsJsonEndpoint = "v3/downloadJsonReport/";
10
+ private downloadAsPdfEndpoint = "v3/downloadReport/";
11
+
12
+ constructor(apiKey: string) {
13
+ this.apiKey = apiKey;
14
+ }
15
+
16
+ async checkApiStatus(): Promise<void> {
17
+ try {
18
+ const response: AxiosResponse = await axios.get(
19
+ this.baseUrl + this.statusCheckEndpoint,
20
+ {
21
+ headers: {
22
+ Authorization: this.apiKey,
23
+ },
24
+ }
25
+ );
26
+
27
+ console.log(response.data);
28
+ return response.data;
29
+ } catch (error: any) {
30
+ console.error(error);
31
+ return error.message;
32
+ }
33
+ }
34
+ async addCompanyReport(companyDetails: companyDetails): Promise<void> {
35
+ const bodyFormData = new FormData();
36
+ if (companyDetails) {
37
+ bodyFormData.append("companyName", companyDetails.companyName);
38
+ try {
39
+ const response: AxiosResponse = await axios.post(
40
+ this.baseUrl + this.addReportEndpoint,
41
+ companyDetails,
42
+ {
43
+ auth: {
44
+ username: this.apiKey,
45
+ password: "",
46
+ },
47
+ headers: {
48
+ "Content-Type": "application/x-www-form-urlencoded",
49
+ },
50
+ }
51
+ );
52
+
53
+ console.log(response.data);
54
+ return response.data;
55
+ } catch (error: any) {
56
+ console.error(error);
57
+ return error.message;
58
+ }
59
+ }
60
+ }
61
+
62
+ async addIndividualReport(
63
+ individualDetails: individualDetails
64
+ ): Promise<void> {
65
+ const bodyFormData = new FormData();
66
+ if (individualDetails.name) {
67
+ bodyFormData.append("name", individualDetails.name);
68
+ try {
69
+ const response: AxiosResponse = await axios.post(
70
+ this.baseUrl + this.addReportEndpoint,
71
+ individualDetails,
72
+ {
73
+ auth: {
74
+ username: this.apiKey,
75
+ password: "",
76
+ },
77
+ headers: {
78
+ "Content-Type": "application/x-www-form-urlencoded",
79
+ },
80
+ }
81
+ );
82
+
83
+ console.log(response.data);
84
+ return response.data;
85
+ } catch (error: any) {
86
+ console.error(error);
87
+ return error.message;
88
+ }
89
+ } else {
90
+ console.log("invalid input");
91
+ }
92
+ }
93
+
94
+ async downloadAsJSON(reqId: string): Promise<any> {
95
+ try {
96
+ const response: AxiosResponse = await axios.get(
97
+ this.baseUrl + this.downloadAsJsonEndpoint + `${reqId}/${this.apiKey}`
98
+ );
99
+
100
+ if (response.data) {
101
+ console.log("File downloaded successfully");
102
+ console.log(response.data);
103
+ return response.data;
104
+ } else {
105
+ console.error("Failed to download file");
106
+ return null;
107
+ }
108
+ } catch (error: any) {
109
+ console.error("Error:", error.message);
110
+ return null;
111
+ }
112
+ }
113
+
114
+ async downloadAsPDF(reqId: string): Promise<any> {
115
+ try {
116
+ const response: AxiosResponse = await axios.get(
117
+ this.baseUrl + this.downloadAsPdfEndpoint + `${reqId}/${this.apiKey}`
118
+ );
119
+
120
+ if (response.data) {
121
+ console.log("File downloaded successfully");
122
+ console.log(response.data);
123
+ return response.data;
124
+ } else {
125
+ console.error("Failed to download file");
126
+ return null;
127
+ }
128
+ } catch (error: any) {
129
+ console.error("Error:", error.message);
130
+ return null;
131
+ }
132
+ }
133
+ }
134
+
135
+ export default CrimeSearchAPIWrapper;
@@ -1,31 +1,31 @@
1
- export interface companyDetails {
2
- companyName: string;
3
- companyType?: string;
4
- companyAddress?: string;
5
- directors?: string;
6
- clientRefNo?: string;
7
- reportMode?: string;
8
- priority?: string;
9
- callbackUrl?: string;
10
- cinNumber?: string;
11
- gstNumber?: string;
12
- reqTag?: string;
13
- ticketSize?: string;
14
- crimewatch?: string;
15
- }
16
-
17
- export interface individualDetails {
18
- name: string;
19
- fatherName?: string;
20
- address?: string;
21
- address2?: string;
22
- dob?: string;
23
- panNumber?: string;
24
- clientRefNo?: string;
25
- reportMode?: string;
26
- priority?: string;
27
- callbackUrl?: string;
28
- reqTag?: string;
29
- ticketSize?: string;
30
- crimewatch?: string;
31
- }
1
+ export interface companyDetails {
2
+ companyName: string;
3
+ companyType?: string;
4
+ companyAddress?: string;
5
+ directors?: string;
6
+ clientRefNo?: string;
7
+ reportMode?: string;
8
+ priority?: string;
9
+ callbackUrl?: string;
10
+ cinNumber?: string;
11
+ gstNumber?: string;
12
+ reqTag?: string;
13
+ ticketSize?: string;
14
+ crimewatch?: string;
15
+ }
16
+
17
+ export interface individualDetails {
18
+ name: string;
19
+ fatherName?: string;
20
+ address?: string;
21
+ address2?: string;
22
+ dob?: string;
23
+ panNumber?: string;
24
+ clientRefNo?: string;
25
+ reportMode?: string;
26
+ priority?: string;
27
+ callbackUrl?: string;
28
+ reqTag?: string;
29
+ ticketSize?: string;
30
+ crimewatch?: string;
31
+ }
@@ -1,18 +1,18 @@
1
- import crypto from "crypto";
2
-
3
- export function createSHA512Hash(dataObject: any, salt: string) {
4
- const sortedData = Object.keys(dataObject)
5
- .map((key) => dataObject[key])
6
- .join("|");
7
-
8
- const pipeSeparatedData = `${sortedData}|${salt}`;
9
- console.log(pipeSeparatedData);
10
-
11
- const hash = crypto.createHash("sha512");
12
-
13
- hash.update(pipeSeparatedData, "utf-8");
14
-
15
- const hashedString = hash.digest("hex");
16
-
17
- return hashedString;
18
- }
1
+ import crypto from "crypto";
2
+
3
+ export function createSHA512Hash(dataObject: any, salt: string) {
4
+ const sortedData = Object.keys(dataObject)
5
+ .map((key) => dataObject[key])
6
+ .join("|");
7
+
8
+ const pipeSeparatedData = `${sortedData}|${salt}`;
9
+ console.log(pipeSeparatedData);
10
+
11
+ const hash = crypto.createHash("sha512");
12
+
13
+ hash.update(pipeSeparatedData, "utf-8");
14
+
15
+ const hashedString = hash.digest("hex");
16
+
17
+ return hashedString;
18
+ }