ggez-banking-sdk 0.1.69 → 0.1.70
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/dist/bank-system/helper/dataStructure.d.ts +52 -2
- package/dist/bank-system/helper/dataStructure.js +32 -2
- package/dist/bank-system/interfaces/bankingSystemInterface.d.ts +12 -1
- package/dist/bank-system/interfaces/interface.d.ts +4 -0
- package/dist/bank-system/services/phone.d.ts +13 -2
- package/dist/bank-system/services/phone.js +28 -3
- package/dist/bank-system/services/verifyAndConfirm.js +5 -2
- package/package.json +1 -1
@@ -904,7 +904,57 @@ declare const Data: () => {
|
|
904
904
|
time_zone: string;
|
905
905
|
time_zone_name: string;
|
906
906
|
};
|
907
|
-
verifyDataPhone: (values:
|
907
|
+
verifyDataPhone: (values: UpdateUserPhoneInterface) => {
|
908
|
+
phone: {
|
909
|
+
id: any;
|
910
|
+
number: any;
|
911
|
+
verification_status: number;
|
912
|
+
}[];
|
913
|
+
geo_coordinates: import("../interfaces").IGeoCoordinates;
|
914
|
+
result: any;
|
915
|
+
info: any;
|
916
|
+
personal_info: any;
|
917
|
+
address: any;
|
918
|
+
addresses: any;
|
919
|
+
email: any;
|
920
|
+
security: any;
|
921
|
+
preferences: any;
|
922
|
+
identification: any;
|
923
|
+
bank_account: any;
|
924
|
+
credit_card: any;
|
925
|
+
notification: any;
|
926
|
+
documents: any;
|
927
|
+
currency: any;
|
928
|
+
credit_limit: any;
|
929
|
+
account: any;
|
930
|
+
group: any;
|
931
|
+
terms_conditions: any;
|
932
|
+
device_info: any;
|
933
|
+
device: any;
|
934
|
+
device_history: any;
|
935
|
+
commerce: any;
|
936
|
+
external_auth: any;
|
937
|
+
validation_data: any;
|
938
|
+
relationship: any;
|
939
|
+
custom_field: any;
|
940
|
+
history: any;
|
941
|
+
access_rule: any;
|
942
|
+
ticket: any;
|
943
|
+
general_requirements: any;
|
944
|
+
organization: any;
|
945
|
+
authentication_data: any;
|
946
|
+
crypto_address: any;
|
947
|
+
activity: any;
|
948
|
+
notes: any;
|
949
|
+
last_activity: any;
|
950
|
+
authentication: any;
|
951
|
+
validate: any;
|
952
|
+
function_code: any;
|
953
|
+
response_time: any;
|
954
|
+
time_zone: string;
|
955
|
+
time_zone_name: string;
|
956
|
+
};
|
957
|
+
verifyLimitedDataPhone: (values: VerifyLimitedPhoneInterface) => {
|
908
958
|
verify_data: {
|
909
959
|
phone: {
|
910
960
|
number: string;
|
@@ -2149,7 +2199,7 @@ declare const Data: () => {
|
|
2149
2199
|
time_zone: string;
|
2150
2200
|
time_zone_name: string;
|
2151
2201
|
};
|
2152
|
-
|
2202
|
+
dataVerifyLimitedPhone: (values: VerifyLimitedPhoneInterface) => {
|
2153
2203
|
info: {
|
2154
2204
|
type: number;
|
2155
2205
|
};
|
@@ -829,7 +829,7 @@ const Data = () => {
|
|
829
829
|
};
|
830
830
|
return data;
|
831
831
|
};
|
832
|
-
const
|
832
|
+
const verifyLimitedDataPhone = (values) => {
|
833
833
|
let data = {
|
834
834
|
...data_1.userData,
|
835
835
|
verify_data: {
|
@@ -844,6 +844,20 @@ const Data = () => {
|
|
844
844
|
};
|
845
845
|
return data;
|
846
846
|
};
|
847
|
+
const verifyDataPhone = (values) => {
|
848
|
+
let data = {
|
849
|
+
...data_1.userData,
|
850
|
+
phone: [
|
851
|
+
{
|
852
|
+
id: values.id,
|
853
|
+
number: values.number,
|
854
|
+
verification_status: 0,
|
855
|
+
},
|
856
|
+
],
|
857
|
+
geo_coordinates: values.geoCoordinates,
|
858
|
+
};
|
859
|
+
return data;
|
860
|
+
};
|
847
861
|
const confirmDataPhone = (values) => {
|
848
862
|
let data = {
|
849
863
|
...data_1.userData,
|
@@ -894,6 +908,7 @@ const Data = () => {
|
|
894
908
|
createDataPhone,
|
895
909
|
deleteDataPhone,
|
896
910
|
verifyDataPhone,
|
911
|
+
verifyLimitedDataPhone,
|
897
912
|
confirmDataPhone,
|
898
913
|
updateDataPhone,
|
899
914
|
makePrimaryDataPhone,
|
@@ -1270,6 +1285,21 @@ const Data = () => {
|
|
1270
1285
|
};
|
1271
1286
|
return data;
|
1272
1287
|
};
|
1288
|
+
let dataVerifyLimitedPhone = (values) => {
|
1289
|
+
let data = {
|
1290
|
+
...data_1.userData,
|
1291
|
+
info: {
|
1292
|
+
type: 10,
|
1293
|
+
},
|
1294
|
+
verify_data: {
|
1295
|
+
phone: {
|
1296
|
+
number: values.number,
|
1297
|
+
},
|
1298
|
+
},
|
1299
|
+
geo_coordinates: values.geoCoordinates,
|
1300
|
+
};
|
1301
|
+
return data;
|
1302
|
+
};
|
1273
1303
|
let dataVerifyPhone = (values) => {
|
1274
1304
|
let data = {
|
1275
1305
|
...data_1.userData,
|
@@ -1422,7 +1452,7 @@ const Data = () => {
|
|
1422
1452
|
return {
|
1423
1453
|
dataValidatePhone,
|
1424
1454
|
dataVerifyEmail,
|
1425
|
-
|
1455
|
+
dataVerifyLimitedPhone,
|
1426
1456
|
dataConfirmEmail,
|
1427
1457
|
dataConfirmPhone,
|
1428
1458
|
dataISEmailUsed,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { IGeoCoordinates } from "./interface";
|
1
|
+
import { IAuthentication, IGeoCoordinates } from "./interface";
|
2
2
|
export interface ConfirmLimitedEmailInterface {
|
3
3
|
address: string;
|
4
4
|
verificationCode: string;
|
@@ -19,6 +19,12 @@ export interface UpdateUserPhoneInterface {
|
|
19
19
|
number: any;
|
20
20
|
geoCoordinates?: IGeoCoordinates | null;
|
21
21
|
}
|
22
|
+
export interface VerifyUserPhoneInterface {
|
23
|
+
id: any;
|
24
|
+
number: any;
|
25
|
+
authentication: IAuthentication[];
|
26
|
+
geoCoordinates?: IGeoCoordinates | null;
|
27
|
+
}
|
22
28
|
export interface MakeUserPhonePrimaryInterface {
|
23
29
|
id: any;
|
24
30
|
number: any;
|
@@ -177,6 +183,11 @@ export interface VerifyLimitedPhoneInterface {
|
|
177
183
|
number: string;
|
178
184
|
geoCoordinates?: IGeoCoordinates | null;
|
179
185
|
}
|
186
|
+
export interface VerifyPhoneInterface {
|
187
|
+
number: string;
|
188
|
+
authentication: IAuthentication[];
|
189
|
+
geoCoordinates?: IGeoCoordinates | null;
|
190
|
+
}
|
180
191
|
export interface IsEmailPresentAndValidInterface {
|
181
192
|
emailAddress: string;
|
182
193
|
geoCoordinates?: IGeoCoordinates | null;
|
@@ -130,6 +130,10 @@ export interface IGeoCoordinates {
|
|
130
130
|
longitude: string;
|
131
131
|
position_description: string;
|
132
132
|
}
|
133
|
+
export interface IAuthentication {
|
134
|
+
code: string;
|
135
|
+
type: number;
|
136
|
+
}
|
133
137
|
export interface InfoChain {
|
134
138
|
isKeplerConnect: boolean;
|
135
139
|
address: string;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { IGeoCoordinates, UserInfo } from "../interfaces/interface";
|
2
|
-
import { ConfirmLimitedPhoneInterface, CreateUserPhoneInterface, DeleteUserPhoneInterface, MakeUserPhonePrimaryInterface, UpdateUserPhoneInterface, VerifyLimitedPhoneInterface } from "../interfaces/bankingSystemInterface";
|
2
|
+
import { ConfirmLimitedPhoneInterface, CreateUserPhoneInterface, DeleteUserPhoneInterface, MakeUserPhonePrimaryInterface, UpdateUserPhoneInterface, VerifyLimitedPhoneInterface, VerifyUserPhoneInterface } from "../interfaces/bankingSystemInterface";
|
3
3
|
export declare const usePhone: (token: string, userInfo: UserInfo, userId: string, baseUrl: string, geoCoordinates?: IGeoCoordinates | null, lang?: string) => {
|
4
4
|
CreateUserPhone: (values: CreateUserPhoneInterface) => Promise<{
|
5
5
|
response: import("axios").AxiosResponse<any, any>;
|
@@ -23,7 +23,18 @@ export declare const usePhone: (token: string, userInfo: UserInfo, userId: strin
|
|
23
23
|
message: any;
|
24
24
|
status: string;
|
25
25
|
}>;
|
26
|
-
VerifyUserPhone: (values:
|
26
|
+
VerifyUserPhone: (values: VerifyUserPhoneInterface) => Promise<{
|
27
|
+
response: import("axios").AxiosResponse<any, any>;
|
28
|
+
newUser: any;
|
29
|
+
message: any;
|
30
|
+
status: string;
|
31
|
+
} | {
|
32
|
+
response: any;
|
33
|
+
newUser: any;
|
34
|
+
message: any;
|
35
|
+
status: string;
|
36
|
+
}>;
|
37
|
+
VerifyUserLimitedPhone: (values: VerifyLimitedPhoneInterface) => Promise<{
|
27
38
|
response: import("axios").AxiosResponse<any, any>;
|
28
39
|
newUser: any;
|
29
40
|
message: string;
|
@@ -11,7 +11,7 @@ const usePhone = (token, userInfo, userId, baseUrl, geoCoordinates, lang) => {
|
|
11
11
|
const { checkResponse, headerConfig } = (0, helper_1.default)(userInfo);
|
12
12
|
const { checkGlobalResponse, errorHandler } = checkResponse();
|
13
13
|
const { dataPhone } = (0, dataStructure_1.default)();
|
14
|
-
const { confirmDataPhone, createDataPhone, deleteDataPhone, makePrimaryDataPhone, updateDataPhone, verifyDataPhone, } = dataPhone();
|
14
|
+
const { confirmDataPhone, createDataPhone, deleteDataPhone, makePrimaryDataPhone, updateDataPhone, verifyLimitedDataPhone, verifyDataPhone, } = dataPhone();
|
15
15
|
let endPointPhone = `v1/user/phone/${userId}`;
|
16
16
|
const headerConfigPhone = () => {
|
17
17
|
let headersData = {
|
@@ -66,10 +66,34 @@ const usePhone = (token, userInfo, userId, baseUrl, geoCoordinates, lang) => {
|
|
66
66
|
}
|
67
67
|
};
|
68
68
|
const VerifyUserPhone = async (values) => {
|
69
|
-
let data =
|
69
|
+
let data = deleteDataPhone({ ...values, geoCoordinates: geoCoordinates });
|
70
|
+
try {
|
71
|
+
const response = await restApi_1.default.restApi(baseUrl, "PUT", endPointPhone, headerConfigPhone(), data);
|
72
|
+
let { newUserInfo } = checkGlobalResponse("phone", response, "VerifyUserPhone", "verify");
|
73
|
+
return {
|
74
|
+
response: response,
|
75
|
+
newUser: newUserInfo,
|
76
|
+
message: response?.data?.result?.message ?? "Phone Verified Successfully",
|
77
|
+
status: "success",
|
78
|
+
};
|
79
|
+
}
|
80
|
+
catch (error) {
|
81
|
+
return {
|
82
|
+
response: error.response,
|
83
|
+
newUser: null,
|
84
|
+
message: error.message,
|
85
|
+
status: "failed",
|
86
|
+
};
|
87
|
+
}
|
88
|
+
};
|
89
|
+
const VerifyUserLimitedPhone = async (values) => {
|
90
|
+
let data = verifyLimitedDataPhone({
|
91
|
+
...values,
|
92
|
+
geoCoordinates: geoCoordinates,
|
93
|
+
});
|
70
94
|
try {
|
71
95
|
const response = await restApi_1.default.restApi(baseUrl, "POST", `v1/user/security/verify/${userId}`, headerConfigPhone(), data);
|
72
|
-
let { newUserInfo } = checkGlobalResponse("phone", response, "
|
96
|
+
let { newUserInfo } = checkGlobalResponse("phone", response, "VerifyUserLimitedPhone");
|
73
97
|
return {
|
74
98
|
response: response,
|
75
99
|
newUser: newUserInfo,
|
@@ -156,6 +180,7 @@ const usePhone = (token, userInfo, userId, baseUrl, geoCoordinates, lang) => {
|
|
156
180
|
CreateUserPhone,
|
157
181
|
DeleteUserPhone,
|
158
182
|
VerifyUserPhone,
|
183
|
+
VerifyUserLimitedPhone,
|
159
184
|
ConfirmUserPhone,
|
160
185
|
UpdateUserPhone,
|
161
186
|
MakeUserPhonePrimary,
|
@@ -10,7 +10,7 @@ const restApi_1 = __importDefault(require("../restApi"));
|
|
10
10
|
const helper_1 = __importDefault(require("../helper"));
|
11
11
|
const useVerifyAndConfirm = (userInfo, tokenData, baseUrl, nodeUrl, programId, geoCoordinates, token, userId, lang) => {
|
12
12
|
const { dataValidate, dataSecurity } = (0, dataStructure_1.default)();
|
13
|
-
const { dataConfirmEmail, dataConfirmPhone, dataISEmailUsed, dataIsPhoneUsed, dataValidatePhone, dataVerifyEmail,
|
13
|
+
const { dataConfirmEmail, dataConfirmPhone, dataISEmailUsed, dataIsPhoneUsed, dataValidatePhone, dataVerifyEmail, dataVerifyLimitedPhone, dataSendOTPEmail, dataSendOTPPhone, dataValidateForgetPassword, dataConfirmForgetPassword, } = dataValidate();
|
14
14
|
const { CreateLimitedToken } = (0, token_1.useToken)(userInfo, nodeUrl, programId, "", geoCoordinates);
|
15
15
|
const { checkResponse, headerConfig } = (0, helper_1.default)(userInfo);
|
16
16
|
const { checkGlobalResponse, errorHandler } = checkResponse();
|
@@ -85,7 +85,10 @@ const useVerifyAndConfirm = (userInfo, tokenData, baseUrl, nodeUrl, programId, g
|
|
85
85
|
}
|
86
86
|
};
|
87
87
|
const VerifyLimitedPhone = async (values) => {
|
88
|
-
let data =
|
88
|
+
let data = dataVerifyLimitedPhone({
|
89
|
+
...values,
|
90
|
+
geoCoordinates: geoCoordinates,
|
91
|
+
});
|
89
92
|
try {
|
90
93
|
const response = await restApi_1.default.restApi(baseUrl, "POST", `v1/limited/security/verify`, await headerConfigVerify(), data);
|
91
94
|
checkGlobalResponse("verify", response, "VerifyLimitedPhone", "verify");
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "ggez-banking-sdk",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.70",
|
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
|
"main": "dist/index.js",
|
6
6
|
"types": "dist/index.d.ts",
|