ggez-banking-sdk 0.0.43 → 0.0.54
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.js +465 -177
- package/dist/bank-system/helper/index.d.ts +1 -1
- package/dist/bank-system/helper/index.js +53 -45
- package/dist/bank-system/interfaces/accountInterface.d.ts +3 -3
- package/dist/bank-system/interfaces/bankingSystemInterface.d.ts +44 -44
- package/dist/bank-system/interfaces/deviceInterface.d.ts +6 -6
- package/dist/bank-system/interfaces/interface.d.ts +1 -1
- package/dist/bank-system/interfaces/organizationInterface.d.ts +4 -4
- package/dist/bank-system/interfaces/signInterface.d.ts +6 -6
- package/dist/bank-system/interfaces/transactionInterface.d.ts +1 -1
- package/dist/bank-system/restApi/index.js +3 -12
- package/dist/bank-system/services/account.d.ts +2 -2
- package/dist/bank-system/services/account.js +27 -35
- package/dist/bank-system/services/addresses.d.ts +1 -1
- package/dist/bank-system/services/addresses.js +27 -33
- package/dist/bank-system/services/auth.d.ts +1 -1
- package/dist/bank-system/services/auth.js +40 -48
- package/dist/bank-system/services/bankAccount.d.ts +1 -1
- package/dist/bank-system/services/bankAccount.js +24 -33
- package/dist/bank-system/services/device.d.ts +1 -1
- package/dist/bank-system/services/device.js +48 -57
- package/dist/bank-system/services/document.d.ts +1 -1
- package/dist/bank-system/services/document.js +7 -16
- package/dist/bank-system/services/email.d.ts +1 -1
- package/dist/bank-system/services/email.js +34 -43
- package/dist/bank-system/services/history.js +5 -14
- package/dist/bank-system/services/identification.d.ts +1 -1
- package/dist/bank-system/services/identification.js +27 -27
- package/dist/bank-system/services/organization.d.ts +1 -1
- package/dist/bank-system/services/organization.js +30 -36
- package/dist/bank-system/services/personalInfo.d.ts +1 -1
- package/dist/bank-system/services/personalInfo.js +19 -22
- package/dist/bank-system/services/phone.d.ts +1 -1
- package/dist/bank-system/services/phone.js +37 -43
- package/dist/bank-system/services/security.d.ts +1 -1
- package/dist/bank-system/services/security.js +76 -67
- package/dist/bank-system/services/token.d.ts +1 -1
- package/dist/bank-system/services/token.js +12 -22
- package/dist/bank-system/services/transaction.js +6 -15
- package/dist/bank-system/services/verifyAndConfirm.d.ts +1 -1
- package/dist/bank-system/services/verifyAndConfirm.js +68 -72
- package/dist/bank-system/utils/chainAddressMasking.js +1 -1
- package/dist/bank-system/utils/copyText.js +3 -12
- package/dist/bank-system/utils/generateSourceId.js +1 -2
- package/dist/bank-system/utils/getCountryName.js +2 -4
- package/dist/bank-system/utils/getEnumName.js +2 -3
- package/dist/bank-system/utils/getStateByCountryCode.js +1 -1
- package/dist/bank-system/utils/handleEncryption/decryptData.js +23 -34
- package/dist/bank-system/utils/info.js +18 -24
- package/dist/bank-system/utils/sortUserInfo.js +6 -6
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -2
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -32,16 +23,19 @@ const useIdentification = (token, userInfo, userId, baseUrl, geoCoordinates, lan
|
|
|
32
23
|
let headers = headerConfig(headersData);
|
|
33
24
|
return headers;
|
|
34
25
|
};
|
|
35
|
-
const CreateIdentification = (values) =>
|
|
36
|
-
|
|
37
|
-
|
|
26
|
+
const CreateIdentification = async (values) => {
|
|
27
|
+
let data = createDataIdentification({
|
|
28
|
+
...values,
|
|
29
|
+
geoCoordinates: geoCoordinates,
|
|
30
|
+
});
|
|
38
31
|
try {
|
|
39
|
-
const response =
|
|
32
|
+
const response = await restApi_1.default.restApi(baseUrl, "POST", endPointIdentification, headerConfigIdentification(), data);
|
|
40
33
|
let { newUserInfo } = checkGlobalResponse("identification", response, "CreateIdentification", "create");
|
|
41
34
|
return {
|
|
42
35
|
response: response,
|
|
43
36
|
newUser: newUserInfo,
|
|
44
|
-
message:
|
|
37
|
+
message: response?.data?.result?.friendly_message ??
|
|
38
|
+
"Identification Created Successfully",
|
|
45
39
|
status: "success",
|
|
46
40
|
};
|
|
47
41
|
}
|
|
@@ -53,17 +47,20 @@ const useIdentification = (token, userInfo, userId, baseUrl, geoCoordinates, lan
|
|
|
53
47
|
status: "failed",
|
|
54
48
|
};
|
|
55
49
|
}
|
|
56
|
-
}
|
|
57
|
-
const UpdateIdentification = (values) =>
|
|
58
|
-
|
|
59
|
-
|
|
50
|
+
};
|
|
51
|
+
const UpdateIdentification = async (values) => {
|
|
52
|
+
let data = updateDataIdentification({
|
|
53
|
+
...values,
|
|
54
|
+
geoCoordinates: geoCoordinates,
|
|
55
|
+
});
|
|
60
56
|
try {
|
|
61
|
-
const response =
|
|
57
|
+
const response = await restApi_1.default.restApi(baseUrl, "PUT", endPointIdentification, headerConfigIdentification(), data);
|
|
62
58
|
let { newUserInfo } = checkGlobalResponse("identification", response, "UpdateIdentification", "update");
|
|
63
59
|
return {
|
|
64
60
|
response: response,
|
|
65
61
|
newUser: newUserInfo,
|
|
66
|
-
message:
|
|
62
|
+
message: response?.data?.result?.friendly_message ??
|
|
63
|
+
"Identification Updated Successfully",
|
|
67
64
|
status: "success",
|
|
68
65
|
};
|
|
69
66
|
}
|
|
@@ -75,17 +72,20 @@ const useIdentification = (token, userInfo, userId, baseUrl, geoCoordinates, lan
|
|
|
75
72
|
status: "failed",
|
|
76
73
|
};
|
|
77
74
|
}
|
|
78
|
-
}
|
|
79
|
-
const DeleteIdentification = (values) =>
|
|
80
|
-
|
|
81
|
-
|
|
75
|
+
};
|
|
76
|
+
const DeleteIdentification = async (values) => {
|
|
77
|
+
let data = deleteDataIdentification({
|
|
78
|
+
...values,
|
|
79
|
+
geoCoordinates: geoCoordinates,
|
|
80
|
+
});
|
|
82
81
|
try {
|
|
83
|
-
const response =
|
|
82
|
+
const response = await restApi_1.default.restApi(baseUrl, "DELETE", endPointIdentification, headerConfigIdentification(), data);
|
|
84
83
|
let { newUserInfo } = checkGlobalResponse("identification", response, "DeleteIdentification", "delete");
|
|
85
84
|
return {
|
|
86
85
|
response: response,
|
|
87
86
|
newUser: newUserInfo,
|
|
88
|
-
message:
|
|
87
|
+
message: response?.data?.result?.friendly_message ??
|
|
88
|
+
"Identification Deleted Successfully",
|
|
89
89
|
status: "success",
|
|
90
90
|
};
|
|
91
91
|
}
|
|
@@ -97,7 +97,7 @@ const useIdentification = (token, userInfo, userId, baseUrl, geoCoordinates, lan
|
|
|
97
97
|
status: "failed",
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
|
-
}
|
|
100
|
+
};
|
|
101
101
|
return {
|
|
102
102
|
CreateIdentification,
|
|
103
103
|
UpdateIdentification,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CreateDocumentOrganizationInterface, CreateOrganizationInterface, UpdateOrganizationInterface } from "../interfaces/organizationInterface";
|
|
2
2
|
import { IGeoCoordinates, UserInfo } from "../interfaces/interface";
|
|
3
|
-
export declare const useOrganization: (token: string, userInfo: UserInfo, userId: string, baseUrl: string, geoCoordinates?: IGeoCoordinates, lang?: string) => {
|
|
3
|
+
export declare const useOrganization: (token: string, userInfo: UserInfo, userId: string, baseUrl: string, geoCoordinates?: IGeoCoordinates | null, lang?: string) => {
|
|
4
4
|
CreateOrganization: (values: CreateOrganizationInterface) => Promise<{
|
|
5
5
|
response: any;
|
|
6
6
|
newUser: any;
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -32,16 +23,16 @@ const useOrganization = (token, userInfo, userId, baseUrl, geoCoordinates, lang)
|
|
|
32
23
|
let headers = headerConfig(headersData);
|
|
33
24
|
return headers;
|
|
34
25
|
};
|
|
35
|
-
const CreateOrganization = (values) =>
|
|
36
|
-
|
|
37
|
-
let data = dataCreateOrganization(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }), userId);
|
|
26
|
+
const CreateOrganization = async (values) => {
|
|
27
|
+
let data = dataCreateOrganization({ ...values, geoCoordinates: geoCoordinates }, userId);
|
|
38
28
|
try {
|
|
39
|
-
const response =
|
|
29
|
+
const response = await restApi_1.default.restApi(baseUrl, "POST", endPoint, headerConfigDevice(), data);
|
|
40
30
|
let { newUserInfo } = checkGlobalResponse("organization", response, "CreateOrganization", "createOrganization");
|
|
41
31
|
return {
|
|
42
|
-
response: response
|
|
32
|
+
response: response?.data,
|
|
43
33
|
newUser: newUserInfo,
|
|
44
|
-
message:
|
|
34
|
+
message: response?.data?.result?.friendly_message ??
|
|
35
|
+
"Create Organization Successfully",
|
|
45
36
|
status: "success",
|
|
46
37
|
};
|
|
47
38
|
}
|
|
@@ -53,17 +44,17 @@ const useOrganization = (token, userInfo, userId, baseUrl, geoCoordinates, lang)
|
|
|
53
44
|
status: "failed",
|
|
54
45
|
};
|
|
55
46
|
}
|
|
56
|
-
}
|
|
57
|
-
const UpdateOrganization = (values, organizationId) =>
|
|
58
|
-
|
|
59
|
-
let data = dataUpdateOrganization(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }), userId);
|
|
47
|
+
};
|
|
48
|
+
const UpdateOrganization = async (values, organizationId) => {
|
|
49
|
+
let data = dataUpdateOrganization({ ...values, geoCoordinates: geoCoordinates }, userId);
|
|
60
50
|
try {
|
|
61
|
-
const response =
|
|
51
|
+
const response = await restApi_1.default.restApi(baseUrl, "PUT", `${endPoint}/${organizationId}`, headerConfigDevice(), data);
|
|
62
52
|
let { newUserInfo } = checkGlobalResponse("organization", response, "UpdateOrganization", "updateOrganization");
|
|
63
53
|
return {
|
|
64
|
-
response: response
|
|
54
|
+
response: response?.data,
|
|
65
55
|
newUser: newUserInfo,
|
|
66
|
-
message:
|
|
56
|
+
message: response?.data?.result?.friendly_message ??
|
|
57
|
+
"Update Organization Successfully",
|
|
67
58
|
status: "success",
|
|
68
59
|
};
|
|
69
60
|
}
|
|
@@ -75,16 +66,16 @@ const useOrganization = (token, userInfo, userId, baseUrl, geoCoordinates, lang)
|
|
|
75
66
|
status: "failed",
|
|
76
67
|
};
|
|
77
68
|
}
|
|
78
|
-
}
|
|
79
|
-
const DeleteOrganization = (organizationId) =>
|
|
80
|
-
var _a, _b, _c;
|
|
69
|
+
};
|
|
70
|
+
const DeleteOrganization = async (organizationId) => {
|
|
81
71
|
try {
|
|
82
|
-
const response =
|
|
72
|
+
const response = await restApi_1.default.restApi(baseUrl, "DELETE", `${endPoint}/${organizationId}`, headerConfigDevice());
|
|
83
73
|
let { newUserInfo } = checkGlobalResponse("organization", response, "DeleteOrganization", "deleteOrganization");
|
|
84
74
|
return {
|
|
85
|
-
response: response
|
|
75
|
+
response: response?.data,
|
|
86
76
|
newUser: newUserInfo,
|
|
87
|
-
message:
|
|
77
|
+
message: response?.data?.result?.friendly_message ??
|
|
78
|
+
"Delete Organization Successfully",
|
|
88
79
|
status: "success",
|
|
89
80
|
};
|
|
90
81
|
}
|
|
@@ -96,17 +87,20 @@ const useOrganization = (token, userInfo, userId, baseUrl, geoCoordinates, lang)
|
|
|
96
87
|
status: "failed",
|
|
97
88
|
};
|
|
98
89
|
}
|
|
99
|
-
}
|
|
100
|
-
const CreateDocumentOrganization = (values, organizationId) =>
|
|
101
|
-
|
|
102
|
-
|
|
90
|
+
};
|
|
91
|
+
const CreateDocumentOrganization = async (values, organizationId) => {
|
|
92
|
+
let data = dataCreateDocumentOrganization({
|
|
93
|
+
...values,
|
|
94
|
+
geoCoordinates: geoCoordinates,
|
|
95
|
+
});
|
|
103
96
|
try {
|
|
104
|
-
const response =
|
|
97
|
+
const response = await restApi_1.default.restApi(baseUrl, "POST", `${endPoint}/document/${organizationId}`, headerConfigDevice(), data);
|
|
105
98
|
let { newUserInfo } = checkGlobalResponse("organization", response, "CreateDocumentOrganization", "createDocumentOrganization");
|
|
106
99
|
return {
|
|
107
|
-
response: response
|
|
100
|
+
response: response?.data,
|
|
108
101
|
newUser: newUserInfo,
|
|
109
|
-
message:
|
|
102
|
+
message: response?.data?.result?.friendly_message ??
|
|
103
|
+
"Create Document Organization Successfully",
|
|
110
104
|
status: "success",
|
|
111
105
|
};
|
|
112
106
|
}
|
|
@@ -118,7 +112,7 @@ const useOrganization = (token, userInfo, userId, baseUrl, geoCoordinates, lang)
|
|
|
118
112
|
status: "failed",
|
|
119
113
|
};
|
|
120
114
|
}
|
|
121
|
-
}
|
|
115
|
+
};
|
|
122
116
|
return {
|
|
123
117
|
CreateOrganization,
|
|
124
118
|
UpdateOrganization,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UpdatePersonalInfoInterface, UpdateProfilePictureInterface } from "../interfaces/bankingSystemInterface";
|
|
2
2
|
import { IGeoCoordinates, UserInfo } from "../interfaces/interface";
|
|
3
|
-
export declare const usePersonalInfo: (token: string, userInfo: UserInfo, userId: string, baseUrl: string, geoCoordinates?: IGeoCoordinates, lang?: string) => {
|
|
3
|
+
export declare const usePersonalInfo: (token: string, userInfo: UserInfo, userId: string, baseUrl: string, geoCoordinates?: IGeoCoordinates | null, lang?: string) => {
|
|
4
4
|
UpdatePersonalInfo: (values: UpdatePersonalInfoInterface) => Promise<{
|
|
5
5
|
response: import("axios").AxiosResponse<any, any>;
|
|
6
6
|
newUser: any;
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -32,16 +23,19 @@ const usePersonalInfo = (token, userInfo, userId, baseUrl, geoCoordinates, lang)
|
|
|
32
23
|
let headers = headerConfig(headersData);
|
|
33
24
|
return headers;
|
|
34
25
|
};
|
|
35
|
-
const UpdatePersonalInfo = (values) =>
|
|
36
|
-
|
|
37
|
-
|
|
26
|
+
const UpdatePersonalInfo = async (values) => {
|
|
27
|
+
const data = updateDataPersonalInfo({
|
|
28
|
+
...values,
|
|
29
|
+
geoCoordinates: geoCoordinates,
|
|
30
|
+
});
|
|
38
31
|
try {
|
|
39
|
-
const response =
|
|
32
|
+
const response = await restApi_1.default.restApi(baseUrl, "PUT", endPoint, headerConfigPersonalInfo(), data);
|
|
40
33
|
let { newUserInfo } = checkGlobalResponse("personal_info", response, "UpdatePersonalInfo", "updateObjectInfo");
|
|
41
34
|
return {
|
|
42
35
|
response: response,
|
|
43
36
|
newUser: newUserInfo,
|
|
44
|
-
message:
|
|
37
|
+
message: response?.data?.result?.friendly_message ??
|
|
38
|
+
"User Info updated Successfully",
|
|
45
39
|
status: "success",
|
|
46
40
|
};
|
|
47
41
|
}
|
|
@@ -53,24 +47,27 @@ const usePersonalInfo = (token, userInfo, userId, baseUrl, geoCoordinates, lang)
|
|
|
53
47
|
status: "failed",
|
|
54
48
|
};
|
|
55
49
|
}
|
|
56
|
-
}
|
|
57
|
-
const UpdateProfilePicture = (values) =>
|
|
58
|
-
|
|
59
|
-
|
|
50
|
+
};
|
|
51
|
+
const UpdateProfilePicture = async (values) => {
|
|
52
|
+
const data = updateProfilePicture({
|
|
53
|
+
...values,
|
|
54
|
+
geoCoordinates: geoCoordinates,
|
|
55
|
+
});
|
|
60
56
|
let headersData = {
|
|
61
57
|
header: true,
|
|
62
58
|
isUrlEncoded: false,
|
|
63
|
-
token:
|
|
59
|
+
token: values.token ?? token,
|
|
64
60
|
lang: lang,
|
|
65
61
|
};
|
|
66
62
|
let headers = headerConfig(headersData);
|
|
67
63
|
try {
|
|
68
|
-
const response =
|
|
64
|
+
const response = await restApi_1.default.restApi(baseUrl, "POST", `V1/User/document/${values.userId ?? userId}`, headers, data);
|
|
69
65
|
let { newUserInfo } = checkGlobalResponse("personal_info", response, "UpdateProfilePicture", "updateProfilePicture");
|
|
70
66
|
return {
|
|
71
67
|
response: response,
|
|
72
68
|
newUser: newUserInfo,
|
|
73
|
-
message:
|
|
69
|
+
message: response?.data?.result?.friendly_message ??
|
|
70
|
+
"Picture Updated Successfully",
|
|
74
71
|
status: "success",
|
|
75
72
|
};
|
|
76
73
|
}
|
|
@@ -82,7 +79,7 @@ const usePersonalInfo = (token, userInfo, userId, baseUrl, geoCoordinates, lang)
|
|
|
82
79
|
status: "failed",
|
|
83
80
|
};
|
|
84
81
|
}
|
|
85
|
-
}
|
|
82
|
+
};
|
|
86
83
|
return {
|
|
87
84
|
UpdatePersonalInfo,
|
|
88
85
|
UpdateProfilePicture,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IGeoCoordinates, UserInfo } from "../interfaces/interface";
|
|
2
2
|
import { ConfirmLimitedPhoneInterface, CreateUserPhoneInterface, DeleteUserPhoneInterface, MakeUserPhonePrimaryInterface, UpdateUserPhoneInterface, VerifyLimitedPhoneInterface } from "../interfaces/bankingSystemInterface";
|
|
3
|
-
export declare const usePhone: (token: string, userInfo: UserInfo, userId: string, baseUrl: string, geoCoordinates?: IGeoCoordinates, lang?: string) => {
|
|
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>;
|
|
6
6
|
newUser: any;
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -32,16 +23,16 @@ const usePhone = (token, userInfo, userId, baseUrl, geoCoordinates, lang) => {
|
|
|
32
23
|
let headers = headerConfig(headersData);
|
|
33
24
|
return headers;
|
|
34
25
|
};
|
|
35
|
-
const CreateUserPhone = (values) =>
|
|
36
|
-
|
|
37
|
-
let data = createDataPhone(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
26
|
+
const CreateUserPhone = async (values) => {
|
|
27
|
+
let data = createDataPhone({ ...values, geoCoordinates: geoCoordinates });
|
|
38
28
|
try {
|
|
39
|
-
const response =
|
|
29
|
+
const response = await restApi_1.default.restApi(baseUrl, "POST", endPointPhone, headerConfigPhone(), data);
|
|
40
30
|
let { newUserInfo } = checkGlobalResponse("phone", response, "CreateUserPhone", "create");
|
|
41
31
|
return {
|
|
42
32
|
response: response,
|
|
43
33
|
newUser: newUserInfo,
|
|
44
|
-
message:
|
|
34
|
+
message: response?.data?.result?.friendly_message ??
|
|
35
|
+
"Phone Created Successfully",
|
|
45
36
|
status: "success",
|
|
46
37
|
};
|
|
47
38
|
}
|
|
@@ -53,17 +44,17 @@ const usePhone = (token, userInfo, userId, baseUrl, geoCoordinates, lang) => {
|
|
|
53
44
|
status: "failed",
|
|
54
45
|
};
|
|
55
46
|
}
|
|
56
|
-
}
|
|
57
|
-
const DeleteUserPhone = (values) =>
|
|
58
|
-
|
|
59
|
-
let data = deleteDataPhone(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
47
|
+
};
|
|
48
|
+
const DeleteUserPhone = async (values) => {
|
|
49
|
+
let data = deleteDataPhone({ ...values, geoCoordinates: geoCoordinates });
|
|
60
50
|
try {
|
|
61
|
-
const response =
|
|
51
|
+
const response = await restApi_1.default.restApi(baseUrl, "DELETE", endPointPhone, headerConfigPhone(), data);
|
|
62
52
|
let { newUserInfo } = checkGlobalResponse("phone", response, "DeleteUserPhone", "delete");
|
|
63
53
|
return {
|
|
64
54
|
response: response,
|
|
65
55
|
newUser: newUserInfo,
|
|
66
|
-
message:
|
|
56
|
+
message: response?.data?.result?.friendly_message ??
|
|
57
|
+
"Phone Deleted Successfully",
|
|
67
58
|
status: "success",
|
|
68
59
|
};
|
|
69
60
|
}
|
|
@@ -75,11 +66,11 @@ const usePhone = (token, userInfo, userId, baseUrl, geoCoordinates, lang) => {
|
|
|
75
66
|
status: "failed",
|
|
76
67
|
};
|
|
77
68
|
}
|
|
78
|
-
}
|
|
79
|
-
const VerifyUserPhone = (values) =>
|
|
80
|
-
let data = verifyDataPhone(
|
|
69
|
+
};
|
|
70
|
+
const VerifyUserPhone = async (values) => {
|
|
71
|
+
let data = verifyDataPhone({ ...values, geoCoordinates: geoCoordinates });
|
|
81
72
|
try {
|
|
82
|
-
const response =
|
|
73
|
+
const response = await restApi_1.default.restApi(baseUrl, "POST", `v1/user/security/verify/${userId}`, headerConfigPhone(), data);
|
|
83
74
|
let { newUserInfo } = checkGlobalResponse("phone", response, "VerifyUserPhone");
|
|
84
75
|
return {
|
|
85
76
|
response: response,
|
|
@@ -96,17 +87,17 @@ const usePhone = (token, userInfo, userId, baseUrl, geoCoordinates, lang) => {
|
|
|
96
87
|
status: "failed",
|
|
97
88
|
};
|
|
98
89
|
}
|
|
99
|
-
}
|
|
100
|
-
const ConfirmUserPhone = (values) =>
|
|
101
|
-
|
|
102
|
-
let data = confirmDataPhone(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
90
|
+
};
|
|
91
|
+
const ConfirmUserPhone = async (values) => {
|
|
92
|
+
let data = confirmDataPhone({ ...values, geoCoordinates: geoCoordinates });
|
|
103
93
|
try {
|
|
104
|
-
const response =
|
|
94
|
+
const response = await restApi_1.default.restApi(baseUrl, "POST", `v1/user/security/confirm/${userId}`, headerConfigPhone(), data);
|
|
105
95
|
let { newUserInfo } = checkGlobalResponse("phone", response, "ConfirmUserPhone", "confirm");
|
|
106
96
|
return {
|
|
107
97
|
response: response,
|
|
108
98
|
newUser: newUserInfo,
|
|
109
|
-
message:
|
|
99
|
+
message: response?.data?.result?.friendly_message ??
|
|
100
|
+
"Phone Confirmed Successfully",
|
|
110
101
|
status: "success",
|
|
111
102
|
};
|
|
112
103
|
}
|
|
@@ -118,17 +109,17 @@ const usePhone = (token, userInfo, userId, baseUrl, geoCoordinates, lang) => {
|
|
|
118
109
|
status: "failed",
|
|
119
110
|
};
|
|
120
111
|
}
|
|
121
|
-
}
|
|
122
|
-
const UpdateUserPhone = (values) =>
|
|
123
|
-
|
|
124
|
-
let data = updateDataPhone(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
112
|
+
};
|
|
113
|
+
const UpdateUserPhone = async (values) => {
|
|
114
|
+
let data = updateDataPhone({ ...values, geoCoordinates: geoCoordinates });
|
|
125
115
|
try {
|
|
126
|
-
const response =
|
|
116
|
+
const response = await restApi_1.default.restApi(baseUrl, "PUT", endPointPhone, headerConfigPhone(), data);
|
|
127
117
|
let { newUserInfo } = checkGlobalResponse("phone", response, "UpdateUserPhone", "update");
|
|
128
118
|
return {
|
|
129
119
|
response: response,
|
|
130
120
|
newUser: newUserInfo,
|
|
131
|
-
message:
|
|
121
|
+
message: response?.data?.result?.friendly_message ??
|
|
122
|
+
"Phone Updated Successfully",
|
|
132
123
|
status: "success",
|
|
133
124
|
};
|
|
134
125
|
}
|
|
@@ -140,17 +131,20 @@ const usePhone = (token, userInfo, userId, baseUrl, geoCoordinates, lang) => {
|
|
|
140
131
|
status: "failed",
|
|
141
132
|
};
|
|
142
133
|
}
|
|
143
|
-
}
|
|
144
|
-
const MakeUserPhonePrimary = (values) =>
|
|
145
|
-
|
|
146
|
-
|
|
134
|
+
};
|
|
135
|
+
const MakeUserPhonePrimary = async (values) => {
|
|
136
|
+
let data = makePrimaryDataPhone({
|
|
137
|
+
...values,
|
|
138
|
+
geoCoordinates: geoCoordinates,
|
|
139
|
+
});
|
|
147
140
|
try {
|
|
148
|
-
const response =
|
|
141
|
+
const response = await restApi_1.default.restApi(baseUrl, "PUT", endPointPhone, headerConfigPhone(), data);
|
|
149
142
|
let { newUserInfo } = checkGlobalResponse("phone", response, "MakeUserPhonePrimary", "updatePrimary");
|
|
150
143
|
return {
|
|
151
144
|
response: response,
|
|
152
145
|
newUser: newUserInfo,
|
|
153
|
-
message:
|
|
146
|
+
message: response?.data?.result?.friendly_message ??
|
|
147
|
+
`${values.number} Now Is Primary`,
|
|
154
148
|
status: "success",
|
|
155
149
|
};
|
|
156
150
|
}
|
|
@@ -162,7 +156,7 @@ const usePhone = (token, userInfo, userId, baseUrl, geoCoordinates, lang) => {
|
|
|
162
156
|
status: "failed",
|
|
163
157
|
};
|
|
164
158
|
}
|
|
165
|
-
}
|
|
159
|
+
};
|
|
166
160
|
return {
|
|
167
161
|
CreateUserPhone,
|
|
168
162
|
DeleteUserPhone,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChangeUserSecurityCodeInterface, ResetPasswordInterface, ResetSecurityQuestionsInterface, UpdateUserPreferencesInterface, ValidateSecurityCodeInterface, ActivateGoogleAuthInterface, DeleteGoogleAuthInterface } from "../interfaces/bankingSystemInterface";
|
|
2
2
|
import { IGeoCoordinates, UserInfo } from "../interfaces/interface";
|
|
3
|
-
export declare const useSecurity: (token: string, userInfo: UserInfo, userId: string, baseUrl: string, geoCoordinates?: IGeoCoordinates, lang?: string) => {
|
|
3
|
+
export declare const useSecurity: (token: string, userInfo: UserInfo, userId: string, baseUrl: string, geoCoordinates?: IGeoCoordinates | null, lang?: string) => {
|
|
4
4
|
ResetPassword: (values: ResetPasswordInterface) => Promise<{
|
|
5
5
|
response: import("axios").AxiosResponse<any, any>;
|
|
6
6
|
newUser: any;
|