ggez-banking-sdk 0.1.136 → 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
|
},
|
|
@@ -163,7 +163,7 @@ const FillCreateUserWithGoogleData = async (data) => {
|
|
|
163
163
|
},
|
|
164
164
|
attachment: [
|
|
165
165
|
{
|
|
166
|
-
file_name:
|
|
166
|
+
file_name: data.loginId,
|
|
167
167
|
file_extension: ".jpg",
|
|
168
168
|
content: base64,
|
|
169
169
|
},
|
|
@@ -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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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.
|
|
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",
|