ggez-banking-sdk 0.1.137 → 0.1.138

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.
@@ -92,7 +92,7 @@ const FillCreateUserData = (data) => {
92
92
  },
93
93
  ],
94
94
  authentication: [
95
- {
95
+ data.emailAuthenticationCode && {
96
96
  type: SecurityAuthenticationTypes.Email_Code,
97
97
  code: data.emailAuthenticationCode,
98
98
  },
@@ -1,22 +1,27 @@
1
1
  const pad = (number) => String(number).padStart(2, "0");
2
2
  const padMilliseconds = (number) => String(number).padStart(3, "0");
3
3
  const getBase64 = async (url) => {
4
- const response = await fetch(url);
5
- const blob = await response.blob();
6
- const base64 = new Promise((resolve, reject) => {
7
- const reader = new FileReader();
8
- reader.onload = () => {
9
- if (reader.result instanceof ArrayBuffer) {
10
- const binaryData = new Uint8Array(reader.result);
11
- const base64Data = btoa(String.fromCharCode(...binaryData));
12
- resolve(base64Data);
13
- }
14
- else {
15
- reject(new Error("Failed to read as ArrayBuffer"));
16
- }
17
- };
18
- reader.readAsArrayBuffer(blob);
19
- });
20
- return base64;
4
+ try {
5
+ const response = await fetch(url);
6
+ const blob = await response.blob();
7
+ const base64 = new Promise((resolve, reject) => {
8
+ const reader = new FileReader();
9
+ reader.onload = () => {
10
+ if (reader.result instanceof ArrayBuffer) {
11
+ const binaryData = new Uint8Array(reader.result);
12
+ const base64Data = btoa(String.fromCharCode(...binaryData));
13
+ resolve(base64Data);
14
+ }
15
+ else {
16
+ reject(new Error("Failed to read as ArrayBuffer"));
17
+ }
18
+ };
19
+ reader.readAsArrayBuffer(blob);
20
+ });
21
+ return await base64;
22
+ }
23
+ catch (error) {
24
+ return null;
25
+ }
21
26
  };
22
27
  export { pad, padMilliseconds, getBase64 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ggez-banking-sdk",
3
- "version": "0.1.137",
3
+ "version": "0.1.138",
4
4
  "description": "A Node.js package to handle GGEZ Banking API endpoints, Simplify the process of managing CRUD operations with this efficient and easy-to-use package.",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",