aeremmiddleware 1.0.12 → 1.0.13

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 (39) hide show
  1. package/README.md +28 -28
  2. package/dist/Finance/ingenicoHtml.js +114 -114
  3. package/dist/index.d.ts +0 -3
  4. package/dist/index.js +1 -4
  5. package/dist/index.js.map +1 -1
  6. package/package.json +21 -20
  7. package/src/Finance/Ingenico.types.ts +21 -21
  8. package/src/Finance/crimeCheck.ts +135 -135
  9. package/src/Finance/crimecheck.types.ts +31 -31
  10. package/src/Finance/encrypt.ts +18 -18
  11. package/src/Finance/idfy.ts +542 -542
  12. package/src/Finance/index.ts +13 -13
  13. package/src/Finance/ingenico.ts +110 -110
  14. package/src/Finance/ingenicoHtml.ts +119 -119
  15. package/src/Finance/novel.ts +226 -226
  16. package/src/Finance/novel.types.ts +24 -24
  17. package/src/Finance/qbrik.ts +822 -822
  18. package/src/Finance/qbrik.types.ts +81 -81
  19. package/src/Socials/Sms.types.ts +9 -9
  20. package/src/Socials/SmsSender.ts +78 -78
  21. package/src/Socials/Whatsapp.types.ts +95 -95
  22. package/src/Socials/index.ts +6 -6
  23. package/src/Socials/whatsApp.ts +188 -188
  24. package/src/index.ts +8 -9
  25. package/src/pushNotification/pushNotificationFCM.ts +35 -35
  26. package/tsconfig.json +111 -111
  27. package/dist/Finance/qbrik.d.ts +0 -100
  28. package/dist/Finance/qbrik.js +0 -506
  29. package/dist/Finance/qbrik.js.map +0 -1
  30. package/dist/Finance/qbrik.types.d.ts +0 -76
  31. package/dist/Finance/qbrik.types.js +0 -3
  32. package/dist/Finance/qbrik.types.js.map +0 -1
  33. package/dist/pushNotification/index.d.ts +0 -4
  34. package/dist/pushNotification/index.js +0 -8
  35. package/dist/pushNotification/index.js.map +0 -1
  36. package/dist/pushNotification/pushNotificationFCM.d.ts +0 -1
  37. package/dist/pushNotification/pushNotificationFCM.js +0 -42
  38. package/dist/pushNotification/pushNotificationFCM.js.map +0 -1
  39. package/src/pushNotification/index.ts +0 -5
@@ -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
+ }