ggez-banking-sdk 0.0.3 → 0.0.5
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/constants/enum.d.ts +7 -3
- package/dist/bank-system/constants/enum.js +6 -1
- package/dist/bank-system/helper/dataStructure.js +3 -3
- package/dist/bank-system/services/account.js +7 -7
- package/dist/bank-system/services/addresses.js +6 -6
- package/dist/bank-system/services/auth.js +12 -12
- package/dist/bank-system/services/bankAccount.js +6 -6
- package/dist/bank-system/services/device.js +12 -12
- package/dist/bank-system/services/email.js +8 -8
- package/dist/bank-system/services/identification.js +4 -4
- package/dist/bank-system/services/organization.js +6 -6
- package/dist/bank-system/services/personalInfo.js +4 -4
- package/dist/bank-system/services/phone.js +8 -8
- package/dist/bank-system/services/security.js +18 -18
- package/dist/bank-system/services/token.js +2 -2
- package/dist/bank-system/services/verifyAndConfirm.js +8 -8
- package/dist/bank-system/utils/enumToOption.js +1 -1
- package/dist/bank-system/utils/generateOneLiner.js +1 -2
- package/dist/bank-system/utils/generateSourceId.js +1 -2
- package/dist/bank-system/utils/getCountryName.js +1 -2
- package/dist/bank-system/utils/getEnumName.js +1 -1
- package/dist/bank-system/utils/getStateByCountryCode.js +1 -2
- package/dist/bank-system/utils/handleEncryption/decryptData.js +2 -3
- package/dist/bank-system/utils/handleEncryption/encryptData.js +1 -2
- package/dist/bank-system/utils/handleEncryption/key.js +2 -2
- package/dist/bank-system/utils/maskingFunction.js +1 -2
- package/dist/bank-system/utils/sortUserInfo.js +5 -6
- package/package.json +9 -1
|
@@ -28,7 +28,7 @@ export declare enum Entity {
|
|
|
28
28
|
Undefined = -1,
|
|
29
29
|
System = 1,
|
|
30
30
|
Program = 2,
|
|
31
|
-
Program_User = 3
|
|
31
|
+
Program_User = 3,//by_entity
|
|
32
32
|
Program_Fulfilment = 4,
|
|
33
33
|
BIN = 5,
|
|
34
34
|
BIN_Settlement = 6,
|
|
@@ -927,8 +927,8 @@ export declare enum DocumentType {
|
|
|
927
927
|
Insurance_Document = 11,
|
|
928
928
|
Other = 12,
|
|
929
929
|
Signed_Agreement = 13,
|
|
930
|
-
Social_Security_Number = 14
|
|
931
|
-
Social_Insurance_Number = 15
|
|
930
|
+
Social_Security_Number = 14,// SSN
|
|
931
|
+
Social_Insurance_Number = 15,// SIN
|
|
932
932
|
Selfie = 16,
|
|
933
933
|
Profile_Background_Picture = 17,
|
|
934
934
|
Beneficiary_Card = 18,
|
|
@@ -1055,3 +1055,7 @@ export declare enum ProgramTypes {
|
|
|
1055
1055
|
Points = 2,
|
|
1056
1056
|
Blockchain = 3
|
|
1057
1057
|
}
|
|
1058
|
+
export declare enum WireTransferType {
|
|
1059
|
+
Domestic = 1,
|
|
1060
|
+
International = 2
|
|
1061
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProgramTypes = exports.UserTrustLevelRange = exports.SourceApp = exports.CommerceProductSourceType = exports.OrderType = exports.PaymentMethodType = exports.ForgetPasswordSecurityTypes = exports.ForgetUserSecurityTypes = exports.ResponseStatusCode = exports.CountryCode = exports.DocumentType = exports.AccountStatus = exports.UserType = exports.BusinessType = exports.OrganizationRequestTypes = exports.SecurityOperationMethod = exports.TransactionInquiryStatus = exports.DeviceType = exports.TransactionType = exports.SettlementTransactionType = exports.AuthorizationOperationRequestType = exports.TransactionRequestStatus = exports.EntityStatus = exports.OperationStatus = exports.BankBeneficiaryType = exports.BankAccountTypes = exports.SecurityQuestion2 = exports.SecurityQuestion1 = exports.TrustLimits = exports.EntityVerificationStatus = exports.DocumentStatus = exports.IdentificationTypes = exports.AddressType = exports.Gender = exports.ChainRequestType = exports.ServiceProvider = exports.SecurityAuthenticationTypes = exports.ActivityType = exports.EntityData = exports.Entity = exports.ErrorLevel = exports.requestStatus = void 0;
|
|
3
|
+
exports.WireTransferType = exports.ProgramTypes = exports.UserTrustLevelRange = exports.SourceApp = exports.CommerceProductSourceType = exports.OrderType = exports.PaymentMethodType = exports.ForgetPasswordSecurityTypes = exports.ForgetUserSecurityTypes = exports.ResponseStatusCode = exports.CountryCode = exports.DocumentType = exports.AccountStatus = exports.UserType = exports.BusinessType = exports.OrganizationRequestTypes = exports.SecurityOperationMethod = exports.TransactionInquiryStatus = exports.DeviceType = exports.TransactionType = exports.SettlementTransactionType = exports.AuthorizationOperationRequestType = exports.TransactionRequestStatus = exports.EntityStatus = exports.OperationStatus = exports.BankBeneficiaryType = exports.BankAccountTypes = exports.SecurityQuestion2 = exports.SecurityQuestion1 = exports.TrustLimits = exports.EntityVerificationStatus = exports.DocumentStatus = exports.IdentificationTypes = exports.AddressType = exports.Gender = exports.ChainRequestType = exports.ServiceProvider = exports.SecurityAuthenticationTypes = exports.ActivityType = exports.EntityData = exports.Entity = exports.ErrorLevel = exports.requestStatus = void 0;
|
|
4
4
|
var requestStatus;
|
|
5
5
|
(function (requestStatus) {
|
|
6
6
|
requestStatus[requestStatus["Undefined"] = 0] = "Undefined";
|
|
@@ -1108,3 +1108,8 @@ var ProgramTypes;
|
|
|
1108
1108
|
ProgramTypes[ProgramTypes["Points"] = 2] = "Points";
|
|
1109
1109
|
ProgramTypes[ProgramTypes["Blockchain"] = 3] = "Blockchain";
|
|
1110
1110
|
})(ProgramTypes || (exports.ProgramTypes = ProgramTypes = {}));
|
|
1111
|
+
var WireTransferType;
|
|
1112
|
+
(function (WireTransferType) {
|
|
1113
|
+
WireTransferType[WireTransferType["Domestic"] = 1] = "Domestic";
|
|
1114
|
+
WireTransferType[WireTransferType["International"] = 2] = "International";
|
|
1115
|
+
})(WireTransferType || (exports.WireTransferType = WireTransferType = {}));
|
|
@@ -257,8 +257,8 @@ const Data = () => {
|
|
|
257
257
|
{
|
|
258
258
|
id: values.deviceId,
|
|
259
259
|
type: enum_1.DeviceType.Browser,
|
|
260
|
-
status: values === null || values === void 0 ? void 0 : values.deviceStatus,
|
|
261
|
-
verification_status: values === null || values === void 0 ? void 0 : values.deviceVerificationStatus,
|
|
260
|
+
status: values === null || values === void 0 ? void 0 : values.deviceStatus, //12,1
|
|
261
|
+
verification_status: values === null || values === void 0 ? void 0 : values.deviceVerificationStatus, //1,0
|
|
262
262
|
is_online: values === null || values === void 0 ? void 0 : values.deviceIsOnline, // true 1, false 0
|
|
263
263
|
},
|
|
264
264
|
], geo_coordinates: values.geoCoordinates });
|
|
@@ -274,7 +274,7 @@ const Data = () => {
|
|
|
274
274
|
};
|
|
275
275
|
let dataVerifyDevice = (values) => {
|
|
276
276
|
let data = Object.assign(Object.assign({}, data_1.userData), { info: {
|
|
277
|
-
type: values.authenticationType,
|
|
277
|
+
type: values.authenticationType, // 9 email code 10 sms code
|
|
278
278
|
authorization_request_type: enum_1.AuthorizationOperationRequestType.Update_Device_Verification_Status,
|
|
279
279
|
}, verify_data: {
|
|
280
280
|
device: {
|
|
@@ -56,14 +56,14 @@ const useAccount = (token, userInfo, userId, baseUrl, geoCoordinates, lang) => {
|
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
58
|
const GetAccount = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
59
|
-
var
|
|
59
|
+
var _a, _b, _c, _d;
|
|
60
60
|
try {
|
|
61
61
|
const response = yield restApi_1.default.restApi(baseUrl, "GET", endPointAccount, headerConfigAccount());
|
|
62
62
|
let { newUserInfo } = checkGlobalResponse("account", response, "getAccount", "getAccount");
|
|
63
63
|
return {
|
|
64
|
-
response: (
|
|
64
|
+
response: (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.account,
|
|
65
65
|
newUser: newUserInfo,
|
|
66
|
-
message: (
|
|
66
|
+
message: (_d = (_c = (_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b.result) === null || _c === void 0 ? void 0 : _c.friendly_message) !== null && _d !== void 0 ? _d : "Get Account Successfully",
|
|
67
67
|
status: "success",
|
|
68
68
|
};
|
|
69
69
|
}
|
|
@@ -77,7 +77,7 @@ const useAccount = (token, userInfo, userId, baseUrl, geoCoordinates, lang) => {
|
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
79
|
const DoTransaction = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
80
|
-
var
|
|
80
|
+
var _a, _b, _c;
|
|
81
81
|
let data = dataDoTransaction(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
82
82
|
try {
|
|
83
83
|
const response = yield restApi_1.default.restApi(baseUrl, "POST", `${endPointTransaction}`, headerConfigAccount(), data);
|
|
@@ -85,7 +85,7 @@ const useAccount = (token, userInfo, userId, baseUrl, geoCoordinates, lang) => {
|
|
|
85
85
|
return {
|
|
86
86
|
response: response === null || response === void 0 ? void 0 : response.data,
|
|
87
87
|
newUser: newUserInfo,
|
|
88
|
-
message: (
|
|
88
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Transaction Successfully",
|
|
89
89
|
status: "success",
|
|
90
90
|
};
|
|
91
91
|
}
|
|
@@ -99,14 +99,14 @@ const useAccount = (token, userInfo, userId, baseUrl, geoCoordinates, lang) => {
|
|
|
99
99
|
}
|
|
100
100
|
});
|
|
101
101
|
const GetAccountLimit = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
102
|
-
var
|
|
102
|
+
var _a, _b, _c;
|
|
103
103
|
try {
|
|
104
104
|
const response = yield restApi_1.default.restApi(baseUrl, "GET", `v1/account/${values.account_id}`, headerConfigAccount());
|
|
105
105
|
let { newUserInfo } = checkGlobalResponse("account", response, "getAccountLimit", "getAccountLimit");
|
|
106
106
|
return {
|
|
107
107
|
response: response === null || response === void 0 ? void 0 : response.data,
|
|
108
108
|
newUser: newUserInfo,
|
|
109
|
-
message: (
|
|
109
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Get Account Limit Successfully",
|
|
110
110
|
status: "success",
|
|
111
111
|
};
|
|
112
112
|
}
|
|
@@ -55,7 +55,7 @@ const useAddresses = (token, userInfo, userId, baseUrl, geoCoordinates, lang) =>
|
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
57
|
const UpdateUserAddress = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
58
|
-
var
|
|
58
|
+
var _a, _b, _c;
|
|
59
59
|
let data = updateDataAddress(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
60
60
|
try {
|
|
61
61
|
const response = yield restApi_1.default.restApi(baseUrl, "PUT", endPointAddress, headerConfigAddresses(), data);
|
|
@@ -63,7 +63,7 @@ const useAddresses = (token, userInfo, userId, baseUrl, geoCoordinates, lang) =>
|
|
|
63
63
|
return {
|
|
64
64
|
response: response,
|
|
65
65
|
newUser: newUserInfo,
|
|
66
|
-
message: (
|
|
66
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Address Updated Successfully",
|
|
67
67
|
status: "success",
|
|
68
68
|
};
|
|
69
69
|
}
|
|
@@ -77,7 +77,7 @@ const useAddresses = (token, userInfo, userId, baseUrl, geoCoordinates, lang) =>
|
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
79
|
const DeleteUserAddress = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
80
|
-
var
|
|
80
|
+
var _a, _b, _c;
|
|
81
81
|
let data = deleteDataAddress(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
82
82
|
try {
|
|
83
83
|
const response = yield restApi_1.default.restApi(baseUrl, "DELETE", endPointAddress, headerConfigAddresses(), data);
|
|
@@ -85,7 +85,7 @@ const useAddresses = (token, userInfo, userId, baseUrl, geoCoordinates, lang) =>
|
|
|
85
85
|
return {
|
|
86
86
|
response: response,
|
|
87
87
|
newUser: newUserInfo,
|
|
88
|
-
message: (
|
|
88
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Address Deleted Successfully",
|
|
89
89
|
status: "success",
|
|
90
90
|
};
|
|
91
91
|
}
|
|
@@ -99,7 +99,7 @@ const useAddresses = (token, userInfo, userId, baseUrl, geoCoordinates, lang) =>
|
|
|
99
99
|
}
|
|
100
100
|
});
|
|
101
101
|
const MakeUserAddressPrimary = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
102
|
-
var
|
|
102
|
+
var _a, _b, _c;
|
|
103
103
|
let data = primaryDataAddress(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
104
104
|
try {
|
|
105
105
|
const response = yield restApi_1.default.restApi(baseUrl, "PUT", endPointAddress, headerConfigAddresses(), data);
|
|
@@ -107,7 +107,7 @@ const useAddresses = (token, userInfo, userId, baseUrl, geoCoordinates, lang) =>
|
|
|
107
107
|
return {
|
|
108
108
|
response: response,
|
|
109
109
|
newUser: newUserInfo,
|
|
110
|
-
message: (
|
|
110
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Primary Address Updated Successfully",
|
|
111
111
|
status: "success",
|
|
112
112
|
};
|
|
113
113
|
}
|
|
@@ -56,12 +56,12 @@ const useAuth = (baseUrl, nodeUrl, userInfo, tokenData, programId, geoCoordinate
|
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
58
|
const SignUpApi = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
59
|
-
var
|
|
59
|
+
var _a, _b, _c, _d;
|
|
60
60
|
let data = dataSignUpApi(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
61
61
|
let token;
|
|
62
62
|
let { message, response, status } = yield CreateLimitedToken(tokenData);
|
|
63
63
|
if (status == "success") {
|
|
64
|
-
token = (
|
|
64
|
+
token = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.access_token;
|
|
65
65
|
}
|
|
66
66
|
else {
|
|
67
67
|
errorHandler(message, "SignUpApi", response);
|
|
@@ -80,7 +80,7 @@ const useAuth = (baseUrl, nodeUrl, userInfo, tokenData, programId, geoCoordinate
|
|
|
80
80
|
return {
|
|
81
81
|
response: response,
|
|
82
82
|
newUser: {},
|
|
83
|
-
message: (
|
|
83
|
+
message: (_d = (_c = (_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b.result) === null || _c === void 0 ? void 0 : _c.friendly_message) !== null && _d !== void 0 ? _d : "SignUp Api Successfully",
|
|
84
84
|
status: "success",
|
|
85
85
|
};
|
|
86
86
|
}
|
|
@@ -94,7 +94,7 @@ const useAuth = (baseUrl, nodeUrl, userInfo, tokenData, programId, geoCoordinate
|
|
|
94
94
|
}
|
|
95
95
|
});
|
|
96
96
|
const LoginRequest = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
97
|
-
var
|
|
97
|
+
var _a, _b, _c;
|
|
98
98
|
let data = dataSignInUrlEncoded(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }), programId);
|
|
99
99
|
let headersData = {
|
|
100
100
|
header: true,
|
|
@@ -109,7 +109,7 @@ const useAuth = (baseUrl, nodeUrl, userInfo, tokenData, programId, geoCoordinate
|
|
|
109
109
|
return {
|
|
110
110
|
response: response,
|
|
111
111
|
newUser: {},
|
|
112
|
-
message: (
|
|
112
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Login Request Successfully",
|
|
113
113
|
status: "success",
|
|
114
114
|
};
|
|
115
115
|
}
|
|
@@ -130,7 +130,7 @@ const useAuth = (baseUrl, nodeUrl, userInfo, tokenData, programId, geoCoordinate
|
|
|
130
130
|
}
|
|
131
131
|
});
|
|
132
132
|
const LoginDeviceCredential = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
133
|
-
var
|
|
133
|
+
var _a, _b, _c;
|
|
134
134
|
let data = dataSignInDeviceEncoded(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }), programId);
|
|
135
135
|
let headersData = {
|
|
136
136
|
header: true,
|
|
@@ -145,7 +145,7 @@ const useAuth = (baseUrl, nodeUrl, userInfo, tokenData, programId, geoCoordinate
|
|
|
145
145
|
return {
|
|
146
146
|
response: response,
|
|
147
147
|
newUser: {},
|
|
148
|
-
message: (
|
|
148
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Login Device Credential Successfully",
|
|
149
149
|
status: "success",
|
|
150
150
|
};
|
|
151
151
|
}
|
|
@@ -166,12 +166,12 @@ const useAuth = (baseUrl, nodeUrl, userInfo, tokenData, programId, geoCoordinate
|
|
|
166
166
|
}
|
|
167
167
|
});
|
|
168
168
|
const SignUpWithGoogle = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
169
|
-
var
|
|
169
|
+
var _a, _b, _c, _d;
|
|
170
170
|
let data = dataSignUpWithGoogle(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
171
171
|
let token;
|
|
172
172
|
let { message, response, status } = yield CreateLimitedToken(tokenData);
|
|
173
173
|
if (status == "success") {
|
|
174
|
-
token = (
|
|
174
|
+
token = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.access_token;
|
|
175
175
|
}
|
|
176
176
|
else {
|
|
177
177
|
errorHandler(message, "SignUpApi", response);
|
|
@@ -189,7 +189,7 @@ const useAuth = (baseUrl, nodeUrl, userInfo, tokenData, programId, geoCoordinate
|
|
|
189
189
|
return {
|
|
190
190
|
response: response,
|
|
191
191
|
newUser: {},
|
|
192
|
-
message: (
|
|
192
|
+
message: (_d = (_c = (_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b.result) === null || _c === void 0 ? void 0 : _c.friendly_message) !== null && _d !== void 0 ? _d : "SignUp With Google Successfully",
|
|
193
193
|
status: "success",
|
|
194
194
|
};
|
|
195
195
|
}
|
|
@@ -203,7 +203,7 @@ const useAuth = (baseUrl, nodeUrl, userInfo, tokenData, programId, geoCoordinate
|
|
|
203
203
|
}
|
|
204
204
|
});
|
|
205
205
|
const LoginWithGoogle = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
206
|
-
var
|
|
206
|
+
var _a, _b, _c;
|
|
207
207
|
let data = dataSignInUrlEncodedWithGoogle(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }), programId);
|
|
208
208
|
let headersData = {
|
|
209
209
|
header: true,
|
|
@@ -218,7 +218,7 @@ const useAuth = (baseUrl, nodeUrl, userInfo, tokenData, programId, geoCoordinate
|
|
|
218
218
|
return {
|
|
219
219
|
response: response,
|
|
220
220
|
newUser: {},
|
|
221
|
-
message: (
|
|
221
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Login Request Successfully",
|
|
222
222
|
status: "success",
|
|
223
223
|
};
|
|
224
224
|
}
|
|
@@ -56,7 +56,7 @@ const useBankAccount = (token, userInfo, userId, baseUrl, geoCoordinates, lang)
|
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
58
|
const UpdateBankAccount = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
59
|
-
var
|
|
59
|
+
var _a, _b, _c;
|
|
60
60
|
let data = updateDataBank(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
61
61
|
try {
|
|
62
62
|
const response = yield restApi_1.default.restApi(baseUrl, "PUT", endPointBank, headerConfigBankAccount(), data);
|
|
@@ -64,7 +64,7 @@ const useBankAccount = (token, userInfo, userId, baseUrl, geoCoordinates, lang)
|
|
|
64
64
|
return {
|
|
65
65
|
response: response,
|
|
66
66
|
newUser: newUserInfo,
|
|
67
|
-
message: (
|
|
67
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Bank Account Updated Successfully",
|
|
68
68
|
status: "success",
|
|
69
69
|
};
|
|
70
70
|
}
|
|
@@ -78,7 +78,7 @@ const useBankAccount = (token, userInfo, userId, baseUrl, geoCoordinates, lang)
|
|
|
78
78
|
}
|
|
79
79
|
});
|
|
80
80
|
const MakeBankAccountPrimary = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
81
|
-
var
|
|
81
|
+
var _a, _b, _c;
|
|
82
82
|
let data = primaryDataBank(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
83
83
|
try {
|
|
84
84
|
const response = yield restApi_1.default.restApi(baseUrl, "PUT", endPointBank, headerConfigBankAccount(), data);
|
|
@@ -86,7 +86,7 @@ const useBankAccount = (token, userInfo, userId, baseUrl, geoCoordinates, lang)
|
|
|
86
86
|
return {
|
|
87
87
|
response: response,
|
|
88
88
|
newUser: newUserInfo,
|
|
89
|
-
message: (
|
|
89
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Primary Bank Account Updated Successfully",
|
|
90
90
|
status: "success",
|
|
91
91
|
};
|
|
92
92
|
}
|
|
@@ -100,7 +100,7 @@ const useBankAccount = (token, userInfo, userId, baseUrl, geoCoordinates, lang)
|
|
|
100
100
|
}
|
|
101
101
|
});
|
|
102
102
|
const DeleteBankAccount = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
103
|
-
var
|
|
103
|
+
var _a, _b, _c;
|
|
104
104
|
let data = deleteDataBank(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
105
105
|
try {
|
|
106
106
|
const response = yield restApi_1.default.restApi(baseUrl, "DELETE", endPointBank, headerConfigBankAccount(), data);
|
|
@@ -108,7 +108,7 @@ const useBankAccount = (token, userInfo, userId, baseUrl, geoCoordinates, lang)
|
|
|
108
108
|
return {
|
|
109
109
|
response: response,
|
|
110
110
|
newUser: newUserInfo,
|
|
111
|
-
message: (
|
|
111
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Bank Account Deleted Successfully",
|
|
112
112
|
status: "success",
|
|
113
113
|
};
|
|
114
114
|
}
|
|
@@ -62,7 +62,7 @@ const useDevice = (token, userInfo, userId, baseUrl, lang, geoCoordinates) => {
|
|
|
62
62
|
}
|
|
63
63
|
});
|
|
64
64
|
const UpdateDevice = (values, access_token, user_id) => __awaiter(void 0, void 0, void 0, function* () {
|
|
65
|
-
var
|
|
65
|
+
var _a, _b, _c;
|
|
66
66
|
let data = dataUpdateDevice(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
67
67
|
let headersData = {
|
|
68
68
|
header: true,
|
|
@@ -77,7 +77,7 @@ const useDevice = (token, userInfo, userId, baseUrl, lang, geoCoordinates) => {
|
|
|
77
77
|
return {
|
|
78
78
|
response: response === null || response === void 0 ? void 0 : response.data,
|
|
79
79
|
newUser: newUserInfo,
|
|
80
|
-
message: (
|
|
80
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Update Device Successfully",
|
|
81
81
|
status: "success",
|
|
82
82
|
};
|
|
83
83
|
}
|
|
@@ -91,7 +91,7 @@ const useDevice = (token, userInfo, userId, baseUrl, lang, geoCoordinates) => {
|
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
93
|
const DeleteDevice = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
94
|
-
var
|
|
94
|
+
var _a, _b, _c;
|
|
95
95
|
let data = dataDeleteDevice(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
96
96
|
try {
|
|
97
97
|
const response = yield restApi_1.default.restApi(baseUrl, "DELETE", `${endPointDevice}`, headerConfigDevice(), data);
|
|
@@ -99,7 +99,7 @@ const useDevice = (token, userInfo, userId, baseUrl, lang, geoCoordinates) => {
|
|
|
99
99
|
return {
|
|
100
100
|
response: response === null || response === void 0 ? void 0 : response.data,
|
|
101
101
|
newUser: newUserInfo,
|
|
102
|
-
message: (
|
|
102
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Delete Device Successfully",
|
|
103
103
|
status: "success",
|
|
104
104
|
};
|
|
105
105
|
}
|
|
@@ -113,7 +113,7 @@ const useDevice = (token, userInfo, userId, baseUrl, lang, geoCoordinates) => {
|
|
|
113
113
|
}
|
|
114
114
|
});
|
|
115
115
|
const VerifyDevice = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
116
|
-
var
|
|
116
|
+
var _a, _b, _c;
|
|
117
117
|
let data = dataVerifyDevice(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
118
118
|
try {
|
|
119
119
|
const response = yield restApi_1.default.restApi(baseUrl, "POST", `v1/user/security/verify/${userId}`, headerConfigDevice(), data);
|
|
@@ -121,7 +121,7 @@ const useDevice = (token, userInfo, userId, baseUrl, lang, geoCoordinates) => {
|
|
|
121
121
|
return {
|
|
122
122
|
response: response === null || response === void 0 ? void 0 : response.data,
|
|
123
123
|
newUser: newUserInfo,
|
|
124
|
-
message: (
|
|
124
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Verify Device Successfully",
|
|
125
125
|
status: "success",
|
|
126
126
|
};
|
|
127
127
|
}
|
|
@@ -135,7 +135,7 @@ const useDevice = (token, userInfo, userId, baseUrl, lang, geoCoordinates) => {
|
|
|
135
135
|
}
|
|
136
136
|
});
|
|
137
137
|
const ConfirmDevice = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
138
|
-
var
|
|
138
|
+
var _a, _b, _c;
|
|
139
139
|
let data = dataConfirmDevice(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
140
140
|
try {
|
|
141
141
|
const response = yield restApi_1.default.restApi(baseUrl, "POST", `v1/user/security/confirm/${userId}`, headerConfigDevice(), data);
|
|
@@ -143,7 +143,7 @@ const useDevice = (token, userInfo, userId, baseUrl, lang, geoCoordinates) => {
|
|
|
143
143
|
return {
|
|
144
144
|
response: response === null || response === void 0 ? void 0 : response.data,
|
|
145
145
|
newUser: newUserInfo,
|
|
146
|
-
message: (
|
|
146
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Confirm Device Successfully",
|
|
147
147
|
status: "success",
|
|
148
148
|
};
|
|
149
149
|
}
|
|
@@ -157,14 +157,14 @@ const useDevice = (token, userInfo, userId, baseUrl, lang, geoCoordinates) => {
|
|
|
157
157
|
}
|
|
158
158
|
});
|
|
159
159
|
const GetUserDeviceLoginHistory = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
160
|
-
var
|
|
160
|
+
var _a, _b, _c;
|
|
161
161
|
try {
|
|
162
162
|
const response = yield restApi_1.default.restApi(baseUrl, "GET", `v1/user/device/history/${userId}`, headerConfigDevice());
|
|
163
163
|
let { newUserInfo } = checkGlobalResponse("device", response, "GetUserDeviceLoginHistory", "GetUserDeviceLoginHistory");
|
|
164
164
|
return {
|
|
165
165
|
response: response === null || response === void 0 ? void 0 : response.data,
|
|
166
166
|
newUser: newUserInfo,
|
|
167
|
-
message: (
|
|
167
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Get User Device Login History Successfully",
|
|
168
168
|
status: "success",
|
|
169
169
|
};
|
|
170
170
|
}
|
|
@@ -178,7 +178,7 @@ const useDevice = (token, userInfo, userId, baseUrl, lang, geoCoordinates) => {
|
|
|
178
178
|
}
|
|
179
179
|
});
|
|
180
180
|
const LogoutDevice = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
181
|
-
var
|
|
181
|
+
var _a, _b, _c;
|
|
182
182
|
let data = dataLogoutDevice(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
183
183
|
try {
|
|
184
184
|
const response = yield restApi_1.default.restApi(baseUrl, "PUT", `v1/user/device/logout/${userId}`, headerConfigDevice(), data);
|
|
@@ -186,7 +186,7 @@ const useDevice = (token, userInfo, userId, baseUrl, lang, geoCoordinates) => {
|
|
|
186
186
|
return {
|
|
187
187
|
response: response === null || response === void 0 ? void 0 : response.data,
|
|
188
188
|
newUser: newUserInfo,
|
|
189
|
-
message: (
|
|
189
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Logout Device Successfully",
|
|
190
190
|
status: "success",
|
|
191
191
|
};
|
|
192
192
|
}
|
|
@@ -55,7 +55,7 @@ const useEmail = (token, userInfo, userId, baseUrl, geoCoordinates, lang) => {
|
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
57
|
const DeleteUserEmail = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
58
|
-
var
|
|
58
|
+
var _a, _b, _c;
|
|
59
59
|
let data = deleteDataEmail(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
60
60
|
try {
|
|
61
61
|
const response = yield restApi_1.default.restApi(baseUrl, "DELETE", endPointEmail, headerConfigEmail(), data);
|
|
@@ -63,7 +63,7 @@ const useEmail = (token, userInfo, userId, baseUrl, geoCoordinates, lang) => {
|
|
|
63
63
|
return {
|
|
64
64
|
response: response,
|
|
65
65
|
newUser: newUserInfo,
|
|
66
|
-
message: (
|
|
66
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Email Deleted Successfully",
|
|
67
67
|
status: "success",
|
|
68
68
|
};
|
|
69
69
|
}
|
|
@@ -98,7 +98,7 @@ const useEmail = (token, userInfo, userId, baseUrl, geoCoordinates, lang) => {
|
|
|
98
98
|
}
|
|
99
99
|
});
|
|
100
100
|
const ConfirmUserEmail = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
101
|
-
var
|
|
101
|
+
var _a, _b, _c;
|
|
102
102
|
let data = confirmDataEmail(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
103
103
|
try {
|
|
104
104
|
const response = yield restApi_1.default.restApi(baseUrl, "POST", `v1/user/security/confirm/${userId}`, headerConfigEmail(), data);
|
|
@@ -106,7 +106,7 @@ const useEmail = (token, userInfo, userId, baseUrl, geoCoordinates, lang) => {
|
|
|
106
106
|
return {
|
|
107
107
|
response: response,
|
|
108
108
|
newUser: newUserInfo,
|
|
109
|
-
message: (
|
|
109
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Email Confirmed Successfully",
|
|
110
110
|
status: "success",
|
|
111
111
|
};
|
|
112
112
|
}
|
|
@@ -120,7 +120,7 @@ const useEmail = (token, userInfo, userId, baseUrl, geoCoordinates, lang) => {
|
|
|
120
120
|
}
|
|
121
121
|
});
|
|
122
122
|
const UpdateUserEmail = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
123
|
-
var
|
|
123
|
+
var _a, _b, _c;
|
|
124
124
|
let data = updateDataEmail(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
125
125
|
try {
|
|
126
126
|
const response = yield restApi_1.default.restApi(baseUrl, "PUT", endPointEmail, headerConfigEmail(), data);
|
|
@@ -128,7 +128,7 @@ const useEmail = (token, userInfo, userId, baseUrl, geoCoordinates, lang) => {
|
|
|
128
128
|
return {
|
|
129
129
|
response: response,
|
|
130
130
|
newUser: newUserInfo,
|
|
131
|
-
message: (
|
|
131
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Email Updated Successfully",
|
|
132
132
|
status: "success",
|
|
133
133
|
};
|
|
134
134
|
}
|
|
@@ -142,7 +142,7 @@ const useEmail = (token, userInfo, userId, baseUrl, geoCoordinates, lang) => {
|
|
|
142
142
|
}
|
|
143
143
|
});
|
|
144
144
|
const MakeUserEmailPrimary = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
145
|
-
var
|
|
145
|
+
var _a, _b, _c;
|
|
146
146
|
let data = primaryDataEmail(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
147
147
|
try {
|
|
148
148
|
const response = yield restApi_1.default.restApi(baseUrl, "PUT", endPointEmail, headerConfigEmail(), data);
|
|
@@ -150,7 +150,7 @@ const useEmail = (token, userInfo, userId, baseUrl, geoCoordinates, lang) => {
|
|
|
150
150
|
return {
|
|
151
151
|
response: response,
|
|
152
152
|
newUser: newUserInfo,
|
|
153
|
-
message: (
|
|
153
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : `${values.address} Now Is Primary`,
|
|
154
154
|
status: "success",
|
|
155
155
|
};
|
|
156
156
|
}
|
|
@@ -55,7 +55,7 @@ const useIdentification = (token, userInfo, userId, baseUrl, geoCoordinates, lan
|
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
57
|
const UpdateIdentification = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
58
|
-
var
|
|
58
|
+
var _a, _b, _c;
|
|
59
59
|
let data = updateDataIdentification(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
60
60
|
try {
|
|
61
61
|
const response = yield restApi_1.default.restApi(baseUrl, "PUT", endPointIdentification, headerConfigIdentification(), data);
|
|
@@ -63,7 +63,7 @@ const useIdentification = (token, userInfo, userId, baseUrl, geoCoordinates, lan
|
|
|
63
63
|
return {
|
|
64
64
|
response: response,
|
|
65
65
|
newUser: newUserInfo,
|
|
66
|
-
message: (
|
|
66
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Identification Updated Successfully",
|
|
67
67
|
status: "success",
|
|
68
68
|
};
|
|
69
69
|
}
|
|
@@ -77,7 +77,7 @@ const useIdentification = (token, userInfo, userId, baseUrl, geoCoordinates, lan
|
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
79
|
const DeleteIdentification = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
80
|
-
var
|
|
80
|
+
var _a, _b, _c;
|
|
81
81
|
let data = deleteDataIdentification(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
82
82
|
try {
|
|
83
83
|
const response = yield restApi_1.default.restApi(baseUrl, "DELETE", endPointIdentification, headerConfigIdentification(), data);
|
|
@@ -85,7 +85,7 @@ const useIdentification = (token, userInfo, userId, baseUrl, geoCoordinates, lan
|
|
|
85
85
|
return {
|
|
86
86
|
response: response,
|
|
87
87
|
newUser: newUserInfo,
|
|
88
|
-
message: (
|
|
88
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Identification Deleted Successfully",
|
|
89
89
|
status: "success",
|
|
90
90
|
};
|
|
91
91
|
}
|
|
@@ -55,7 +55,7 @@ const useOrganization = (token, userInfo, userId, baseUrl, geoCoordinates, lang)
|
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
57
|
const UpdateOrganization = (values, organizationId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
58
|
-
var
|
|
58
|
+
var _a, _b, _c;
|
|
59
59
|
let data = dataUpdateOrganization(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }), userId);
|
|
60
60
|
try {
|
|
61
61
|
const response = yield restApi_1.default.restApi(baseUrl, "PUT", `${endPoint}/${organizationId}`, headerConfigDevice(), data);
|
|
@@ -63,7 +63,7 @@ const useOrganization = (token, userInfo, userId, baseUrl, geoCoordinates, lang)
|
|
|
63
63
|
return {
|
|
64
64
|
response: response === null || response === void 0 ? void 0 : response.data,
|
|
65
65
|
newUser: newUserInfo,
|
|
66
|
-
message: (
|
|
66
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Update Organization Successfully",
|
|
67
67
|
status: "success",
|
|
68
68
|
};
|
|
69
69
|
}
|
|
@@ -77,14 +77,14 @@ const useOrganization = (token, userInfo, userId, baseUrl, geoCoordinates, lang)
|
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
79
|
const DeleteOrganization = (organizationId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
80
|
-
var
|
|
80
|
+
var _a, _b, _c;
|
|
81
81
|
try {
|
|
82
82
|
const response = yield restApi_1.default.restApi(baseUrl, "DELETE", `${endPoint}/${organizationId}`, headerConfigDevice());
|
|
83
83
|
let { newUserInfo } = checkGlobalResponse("organization", response, "DeleteOrganization", "deleteOrganization");
|
|
84
84
|
return {
|
|
85
85
|
response: response === null || response === void 0 ? void 0 : response.data,
|
|
86
86
|
newUser: newUserInfo,
|
|
87
|
-
message: (
|
|
87
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Delete Organization Successfully",
|
|
88
88
|
status: "success",
|
|
89
89
|
};
|
|
90
90
|
}
|
|
@@ -98,7 +98,7 @@ const useOrganization = (token, userInfo, userId, baseUrl, geoCoordinates, lang)
|
|
|
98
98
|
}
|
|
99
99
|
});
|
|
100
100
|
const CreateDocumentOrganization = (values, organizationId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
101
|
-
var
|
|
101
|
+
var _a, _b, _c;
|
|
102
102
|
let data = dataCreateDocumentOrganization(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
103
103
|
try {
|
|
104
104
|
const response = yield restApi_1.default.restApi(baseUrl, "POST", `${endPoint}/document/${organizationId}`, headerConfigDevice(), data);
|
|
@@ -106,7 +106,7 @@ const useOrganization = (token, userInfo, userId, baseUrl, geoCoordinates, lang)
|
|
|
106
106
|
return {
|
|
107
107
|
response: response === null || response === void 0 ? void 0 : response.data,
|
|
108
108
|
newUser: newUserInfo,
|
|
109
|
-
message: (
|
|
109
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Create Document Organization Successfully",
|
|
110
110
|
status: "success",
|
|
111
111
|
};
|
|
112
112
|
}
|
|
@@ -55,22 +55,22 @@ const usePersonalInfo = (token, userInfo, userId, baseUrl, geoCoordinates, lang)
|
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
57
|
const UpdateProfilePicture = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
58
|
-
var
|
|
58
|
+
var _a, _b, _c, _d, _e;
|
|
59
59
|
const data = updateProfilePicture(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
60
60
|
let headersData = {
|
|
61
61
|
header: true,
|
|
62
62
|
isUrlEncoded: false,
|
|
63
|
-
token: (
|
|
63
|
+
token: (_a = values.token) !== null && _a !== void 0 ? _a : token,
|
|
64
64
|
lang: lang,
|
|
65
65
|
};
|
|
66
66
|
let headers = headerConfig(headersData);
|
|
67
67
|
try {
|
|
68
|
-
const response = yield restApi_1.default.restApi(baseUrl, "POST", `V1/User/document/${(
|
|
68
|
+
const response = yield restApi_1.default.restApi(baseUrl, "POST", `V1/User/document/${(_b = values.userId) !== null && _b !== void 0 ? _b : userId}`, headers, data);
|
|
69
69
|
let { newUserInfo } = checkGlobalResponse("personal_info", response, "UpdateProfilePicture", "updateProfilePicture");
|
|
70
70
|
return {
|
|
71
71
|
response: response,
|
|
72
72
|
newUser: newUserInfo,
|
|
73
|
-
message: (
|
|
73
|
+
message: (_e = (_d = (_c = response === null || response === void 0 ? void 0 : response.data) === null || _c === void 0 ? void 0 : _c.result) === null || _d === void 0 ? void 0 : _d.friendly_message) !== null && _e !== void 0 ? _e : "Picture Updated Successfully",
|
|
74
74
|
status: "success",
|
|
75
75
|
};
|
|
76
76
|
}
|
|
@@ -55,7 +55,7 @@ const usePhone = (token, userInfo, userId, baseUrl, geoCoordinates, lang) => {
|
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
57
|
const DeleteUserPhone = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
58
|
-
var
|
|
58
|
+
var _a, _b, _c;
|
|
59
59
|
let data = deleteDataPhone(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
60
60
|
try {
|
|
61
61
|
const response = yield restApi_1.default.restApi(baseUrl, "DELETE", endPointPhone, headerConfigPhone(), data);
|
|
@@ -63,7 +63,7 @@ const usePhone = (token, userInfo, userId, baseUrl, geoCoordinates, lang) => {
|
|
|
63
63
|
return {
|
|
64
64
|
response: response,
|
|
65
65
|
newUser: newUserInfo,
|
|
66
|
-
message: (
|
|
66
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Phone Deleted Successfully",
|
|
67
67
|
status: "success",
|
|
68
68
|
};
|
|
69
69
|
}
|
|
@@ -98,7 +98,7 @@ const usePhone = (token, userInfo, userId, baseUrl, geoCoordinates, lang) => {
|
|
|
98
98
|
}
|
|
99
99
|
});
|
|
100
100
|
const ConfirmUserPhone = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
101
|
-
var
|
|
101
|
+
var _a, _b, _c;
|
|
102
102
|
let data = confirmDataPhone(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
103
103
|
try {
|
|
104
104
|
const response = yield restApi_1.default.restApi(baseUrl, "POST", `v1/user/security/confirm/${userId}`, headerConfigPhone(), data);
|
|
@@ -106,7 +106,7 @@ const usePhone = (token, userInfo, userId, baseUrl, geoCoordinates, lang) => {
|
|
|
106
106
|
return {
|
|
107
107
|
response: response,
|
|
108
108
|
newUser: newUserInfo,
|
|
109
|
-
message: (
|
|
109
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Phone Confirmed Successfully",
|
|
110
110
|
status: "success",
|
|
111
111
|
};
|
|
112
112
|
}
|
|
@@ -120,7 +120,7 @@ const usePhone = (token, userInfo, userId, baseUrl, geoCoordinates, lang) => {
|
|
|
120
120
|
}
|
|
121
121
|
});
|
|
122
122
|
const UpdateUserPhone = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
123
|
-
var
|
|
123
|
+
var _a, _b, _c;
|
|
124
124
|
let data = updateDataPhone(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
125
125
|
try {
|
|
126
126
|
const response = yield restApi_1.default.restApi(baseUrl, "PUT", endPointPhone, headerConfigPhone(), data);
|
|
@@ -128,7 +128,7 @@ const usePhone = (token, userInfo, userId, baseUrl, geoCoordinates, lang) => {
|
|
|
128
128
|
return {
|
|
129
129
|
response: response,
|
|
130
130
|
newUser: newUserInfo,
|
|
131
|
-
message: (
|
|
131
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Phone Updated Successfully",
|
|
132
132
|
status: "success",
|
|
133
133
|
};
|
|
134
134
|
}
|
|
@@ -142,7 +142,7 @@ const usePhone = (token, userInfo, userId, baseUrl, geoCoordinates, lang) => {
|
|
|
142
142
|
}
|
|
143
143
|
});
|
|
144
144
|
const MakeUserPhonePrimary = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
145
|
-
var
|
|
145
|
+
var _a, _b, _c;
|
|
146
146
|
let data = makePrimaryDataPhone(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
147
147
|
try {
|
|
148
148
|
const response = yield restApi_1.default.restApi(baseUrl, "PUT", endPointPhone, headerConfigPhone(), data);
|
|
@@ -150,7 +150,7 @@ const usePhone = (token, userInfo, userId, baseUrl, geoCoordinates, lang) => {
|
|
|
150
150
|
return {
|
|
151
151
|
response: response,
|
|
152
152
|
newUser: newUserInfo,
|
|
153
|
-
message: (
|
|
153
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : `${values.number} Now Is Primary`,
|
|
154
154
|
status: "success",
|
|
155
155
|
};
|
|
156
156
|
}
|
|
@@ -54,7 +54,7 @@ const useSecurity = (token, userInfo, userId, baseUrl, geoCoordinates, lang) =>
|
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
56
|
const ResetSecurityQuestions = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
57
|
-
var
|
|
57
|
+
var _a, _b, _c;
|
|
58
58
|
let data = resetDataQuestion(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
59
59
|
try {
|
|
60
60
|
const response = yield restApi_1.default.restApi(baseUrl, "POST", `v1/user/security/reset/${userId}`, headerConfigSecurity(), data);
|
|
@@ -62,7 +62,7 @@ const useSecurity = (token, userInfo, userId, baseUrl, geoCoordinates, lang) =>
|
|
|
62
62
|
return {
|
|
63
63
|
response: response,
|
|
64
64
|
newUser: newUserInfo,
|
|
65
|
-
message: (
|
|
65
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Questions Changed Successfully",
|
|
66
66
|
status: "success",
|
|
67
67
|
};
|
|
68
68
|
}
|
|
@@ -76,7 +76,7 @@ const useSecurity = (token, userInfo, userId, baseUrl, geoCoordinates, lang) =>
|
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
78
|
const ChangeUserSecurityCode = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
79
|
-
var
|
|
79
|
+
var _a, _b, _c;
|
|
80
80
|
let data = changeDataSecurityCode(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
81
81
|
try {
|
|
82
82
|
const response = yield restApi_1.default.restApi(baseUrl, "POST", `v1/user/security/reset/${userId}`, headerConfigSecurity(), data);
|
|
@@ -84,7 +84,7 @@ const useSecurity = (token, userInfo, userId, baseUrl, geoCoordinates, lang) =>
|
|
|
84
84
|
return {
|
|
85
85
|
response: response,
|
|
86
86
|
newUser: newUserInfo,
|
|
87
|
-
message: (
|
|
87
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "User Security Code Changed Successfully",
|
|
88
88
|
status: "success",
|
|
89
89
|
};
|
|
90
90
|
}
|
|
@@ -98,7 +98,7 @@ const useSecurity = (token, userInfo, userId, baseUrl, geoCoordinates, lang) =>
|
|
|
98
98
|
}
|
|
99
99
|
});
|
|
100
100
|
const UpdateUserPreferences = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
101
|
-
var
|
|
101
|
+
var _a, _b, _c;
|
|
102
102
|
let data = updateDataUserPreferences(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
103
103
|
try {
|
|
104
104
|
const response = yield restApi_1.default.restApi(baseUrl, "PUT", `v1/user/preferences/${userId}`, Object.assign(Object.assign({}, headerConfigSecurity()), { language: values.preferredLanguageCode }), data);
|
|
@@ -106,7 +106,7 @@ const useSecurity = (token, userInfo, userId, baseUrl, geoCoordinates, lang) =>
|
|
|
106
106
|
return {
|
|
107
107
|
response: response,
|
|
108
108
|
newUser: newUserInfo,
|
|
109
|
-
message: (
|
|
109
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Preference Updated Successfully",
|
|
110
110
|
status: "success",
|
|
111
111
|
};
|
|
112
112
|
}
|
|
@@ -120,7 +120,7 @@ const useSecurity = (token, userInfo, userId, baseUrl, geoCoordinates, lang) =>
|
|
|
120
120
|
}
|
|
121
121
|
});
|
|
122
122
|
const ValidateSecurityCode = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
123
|
-
var
|
|
123
|
+
var _a, _b, _c;
|
|
124
124
|
let data = dataValidateSecurityCode(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
125
125
|
try {
|
|
126
126
|
const response = yield restApi_1.default.restApi(baseUrl, "POST", `v1/user/security/validate/${userId}`, headerConfigSecurity(), data);
|
|
@@ -128,7 +128,7 @@ const useSecurity = (token, userInfo, userId, baseUrl, geoCoordinates, lang) =>
|
|
|
128
128
|
return {
|
|
129
129
|
response: response,
|
|
130
130
|
newUser: newUserInfo,
|
|
131
|
-
message: (
|
|
131
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Message send successfully",
|
|
132
132
|
status: "success",
|
|
133
133
|
};
|
|
134
134
|
}
|
|
@@ -143,7 +143,7 @@ const useSecurity = (token, userInfo, userId, baseUrl, geoCoordinates, lang) =>
|
|
|
143
143
|
});
|
|
144
144
|
/** Authentication Google */
|
|
145
145
|
const EnrollGoogleAuth = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
146
|
-
var
|
|
146
|
+
var _a, _b, _c;
|
|
147
147
|
let data = dataEnrollGoogleAuth();
|
|
148
148
|
try {
|
|
149
149
|
const response = yield restApi_1.default.restApi(baseUrl, "POST", `v1/user/auth/enroll/${userId}`, headerConfigSecurity(), data);
|
|
@@ -151,7 +151,7 @@ const useSecurity = (token, userInfo, userId, baseUrl, geoCoordinates, lang) =>
|
|
|
151
151
|
return {
|
|
152
152
|
response: response,
|
|
153
153
|
newUser: newUserInfo,
|
|
154
|
-
message: (
|
|
154
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "User Enrolled successfully",
|
|
155
155
|
status: "success",
|
|
156
156
|
};
|
|
157
157
|
}
|
|
@@ -165,7 +165,7 @@ const useSecurity = (token, userInfo, userId, baseUrl, geoCoordinates, lang) =>
|
|
|
165
165
|
}
|
|
166
166
|
});
|
|
167
167
|
const ActivateGoogleAuth = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
168
|
-
var
|
|
168
|
+
var _a, _b, _c;
|
|
169
169
|
let data = dataActivateGoogleAuth(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
170
170
|
try {
|
|
171
171
|
const response = yield restApi_1.default.restApi(baseUrl, "POST", `v1/user/auth/activate/${userId}`, headerConfigSecurity(), data);
|
|
@@ -173,7 +173,7 @@ const useSecurity = (token, userInfo, userId, baseUrl, geoCoordinates, lang) =>
|
|
|
173
173
|
return {
|
|
174
174
|
response: response,
|
|
175
175
|
newUser: newUserInfo,
|
|
176
|
-
message: (
|
|
176
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Account Authentication Activated successfully",
|
|
177
177
|
status: "success",
|
|
178
178
|
};
|
|
179
179
|
}
|
|
@@ -187,7 +187,7 @@ const useSecurity = (token, userInfo, userId, baseUrl, geoCoordinates, lang) =>
|
|
|
187
187
|
}
|
|
188
188
|
});
|
|
189
189
|
const deActivateGoogleAuth = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
190
|
-
var
|
|
190
|
+
var _a, _b, _c;
|
|
191
191
|
let data = dataActivateGoogleAuth(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
192
192
|
try {
|
|
193
193
|
const response = yield restApi_1.default.restApi(baseUrl, "POST", `v1/user/auth/deactivate/${userId}`, headerConfigSecurity(), data);
|
|
@@ -195,7 +195,7 @@ const useSecurity = (token, userInfo, userId, baseUrl, geoCoordinates, lang) =>
|
|
|
195
195
|
return {
|
|
196
196
|
response: response,
|
|
197
197
|
newUser: newUserInfo,
|
|
198
|
-
message: (
|
|
198
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Account Authentication deactivated successfully",
|
|
199
199
|
status: "success",
|
|
200
200
|
};
|
|
201
201
|
}
|
|
@@ -209,7 +209,7 @@ const useSecurity = (token, userInfo, userId, baseUrl, geoCoordinates, lang) =>
|
|
|
209
209
|
}
|
|
210
210
|
});
|
|
211
211
|
const deleteGoogleAuth = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
212
|
-
var
|
|
212
|
+
var _a, _b, _c;
|
|
213
213
|
let data = dataDeleteGoogleAuth(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
214
214
|
try {
|
|
215
215
|
const response = yield restApi_1.default.restApi(baseUrl, "POST", `v1/user/auth/delete/${userId}`, headerConfigSecurity(), data);
|
|
@@ -217,7 +217,7 @@ const useSecurity = (token, userInfo, userId, baseUrl, geoCoordinates, lang) =>
|
|
|
217
217
|
return {
|
|
218
218
|
response: response,
|
|
219
219
|
newUser: newUserInfo,
|
|
220
|
-
message: (
|
|
220
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Account authentication deleted successfully",
|
|
221
221
|
status: "success",
|
|
222
222
|
};
|
|
223
223
|
}
|
|
@@ -231,14 +231,14 @@ const useSecurity = (token, userInfo, userId, baseUrl, geoCoordinates, lang) =>
|
|
|
231
231
|
}
|
|
232
232
|
});
|
|
233
233
|
const GetSecurityOperation = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
234
|
-
var
|
|
234
|
+
var _a, _b, _c;
|
|
235
235
|
try {
|
|
236
236
|
const response = yield restApi_1.default.restApi(baseUrl, "GET", `v1/user/activity/${userId}`, headerConfigSecurity());
|
|
237
237
|
let { newUserInfo } = checkGlobalResponse("activity", response, "GetSecurityOperation", "get");
|
|
238
238
|
return {
|
|
239
239
|
response: response,
|
|
240
240
|
newUser: newUserInfo,
|
|
241
|
-
message: (
|
|
241
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Get Security Operation Successfully",
|
|
242
242
|
status: "success",
|
|
243
243
|
};
|
|
244
244
|
}
|
|
@@ -59,12 +59,12 @@ const useToken = (userInfo, nodeUrl, programId, lang, geoCoordinates) => {
|
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
61
|
const CreateProgramToken = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
62
|
-
var
|
|
62
|
+
var _a;
|
|
63
63
|
let data = dataTokenUrlEncoded(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
64
64
|
try {
|
|
65
65
|
const response = yield restApi_1.default.restApi(nodeUrl, "POST", "oauth/token", headerConfigToken(), data);
|
|
66
66
|
checkGlobalResponse("token", response, "CreateProgramToken");
|
|
67
|
-
return (
|
|
67
|
+
return (_a = response.data) === null || _a === void 0 ? void 0 : _a.access_token;
|
|
68
68
|
}
|
|
69
69
|
catch (error) {
|
|
70
70
|
return {
|
|
@@ -158,7 +158,7 @@ const useVerifyAndConfirm = (userInfo, tokenData, baseUrl, nodeUrl, programId, g
|
|
|
158
158
|
}
|
|
159
159
|
});
|
|
160
160
|
const ConfirmLimitedEmail = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
161
|
-
var _b, _c
|
|
161
|
+
var _a, _b, _c;
|
|
162
162
|
let data = dataConfirmEmail(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
163
163
|
try {
|
|
164
164
|
const response = yield restApi_1.default.restApi(baseUrl, "POST", `v1/limited/security/confirm`, yield headerConfigVerify(), data);
|
|
@@ -166,7 +166,7 @@ const useVerifyAndConfirm = (userInfo, tokenData, baseUrl, nodeUrl, programId, g
|
|
|
166
166
|
return {
|
|
167
167
|
response: response,
|
|
168
168
|
newUser: {},
|
|
169
|
-
message: (
|
|
169
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Email Confirmed Successfully",
|
|
170
170
|
status: "success",
|
|
171
171
|
};
|
|
172
172
|
}
|
|
@@ -180,7 +180,7 @@ const useVerifyAndConfirm = (userInfo, tokenData, baseUrl, nodeUrl, programId, g
|
|
|
180
180
|
}
|
|
181
181
|
});
|
|
182
182
|
const ConfirmLimitedPhone = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
183
|
-
var
|
|
183
|
+
var _a, _b, _c;
|
|
184
184
|
let data = dataConfirmPhone(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
185
185
|
try {
|
|
186
186
|
const response = yield restApi_1.default.restApi(baseUrl, "POST", `v1/limited/security/confirm`, yield headerConfigVerify(), data);
|
|
@@ -188,7 +188,7 @@ const useVerifyAndConfirm = (userInfo, tokenData, baseUrl, nodeUrl, programId, g
|
|
|
188
188
|
return {
|
|
189
189
|
response: response,
|
|
190
190
|
newUser: {},
|
|
191
|
-
message: (
|
|
191
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Phone Confirmed Successfully",
|
|
192
192
|
status: "success",
|
|
193
193
|
};
|
|
194
194
|
}
|
|
@@ -246,7 +246,7 @@ const useVerifyAndConfirm = (userInfo, tokenData, baseUrl, nodeUrl, programId, g
|
|
|
246
246
|
}
|
|
247
247
|
});
|
|
248
248
|
const forgetPasswordValidate = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
249
|
-
var
|
|
249
|
+
var _a, _b, _c;
|
|
250
250
|
let data = dataValidateForgetPassword(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
251
251
|
try {
|
|
252
252
|
let headers = yield headerConfigVerify();
|
|
@@ -255,7 +255,7 @@ const useVerifyAndConfirm = (userInfo, tokenData, baseUrl, nodeUrl, programId, g
|
|
|
255
255
|
return {
|
|
256
256
|
response: response,
|
|
257
257
|
newUser: newUserInfo,
|
|
258
|
-
message: (
|
|
258
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Forget password validate successfully",
|
|
259
259
|
status: "success",
|
|
260
260
|
};
|
|
261
261
|
}
|
|
@@ -269,7 +269,7 @@ const useVerifyAndConfirm = (userInfo, tokenData, baseUrl, nodeUrl, programId, g
|
|
|
269
269
|
}
|
|
270
270
|
});
|
|
271
271
|
const forgetPasswordConfirm = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
272
|
-
var
|
|
272
|
+
var _a, _b, _c;
|
|
273
273
|
let data = dataConfirmForgetPassword(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
274
274
|
try {
|
|
275
275
|
let headers = yield headerConfigVerify();
|
|
@@ -278,7 +278,7 @@ const useVerifyAndConfirm = (userInfo, tokenData, baseUrl, nodeUrl, programId, g
|
|
|
278
278
|
return {
|
|
279
279
|
response: response,
|
|
280
280
|
newUser: newUserInfo,
|
|
281
|
-
message: (
|
|
281
|
+
message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Forget password confirm successfully",
|
|
282
282
|
status: "success",
|
|
283
283
|
};
|
|
284
284
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = enumsToOptions;
|
|
3
4
|
function enumsToOptions(enumObject, translateFile, t) {
|
|
4
5
|
let lst = [];
|
|
5
6
|
let keys = Object.keys(enumObject).sort();
|
|
@@ -15,4 +16,3 @@ function enumsToOptions(enumObject, translateFile, t) {
|
|
|
15
16
|
}
|
|
16
17
|
return lst;
|
|
17
18
|
}
|
|
18
|
-
exports.default = enumsToOptions;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.generateOneLiner =
|
|
3
|
+
exports.generateOneLiner = generateOneLiner;
|
|
4
4
|
function generateOneLiner(lst) {
|
|
5
5
|
const newLst = lst.map((value, index) => {
|
|
6
6
|
if (value != undefined && value != null && value != "") {
|
|
@@ -14,4 +14,3 @@ function generateOneLiner(lst) {
|
|
|
14
14
|
});
|
|
15
15
|
return newLst;
|
|
16
16
|
}
|
|
17
|
-
exports.generateOneLiner = generateOneLiner;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GenerateSourceID =
|
|
3
|
+
exports.GenerateSourceID = GenerateSourceID;
|
|
4
4
|
function GenerateSourceID() {
|
|
5
5
|
var _a;
|
|
6
6
|
const now = new Date();
|
|
@@ -10,4 +10,3 @@ function GenerateSourceID() {
|
|
|
10
10
|
const source_id = `INAPP.${userId}${timestamp}.${randomNumber}`;
|
|
11
11
|
return source_id;
|
|
12
12
|
}
|
|
13
|
-
exports.GenerateSourceID = GenerateSourceID;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getCountryName =
|
|
6
|
+
exports.getCountryName = getCountryName;
|
|
7
7
|
const countries_1 = __importDefault(require("../content/countries"));
|
|
8
8
|
function getCountryName(code) {
|
|
9
9
|
var _a;
|
|
@@ -13,4 +13,3 @@ function getCountryName(code) {
|
|
|
13
13
|
const country = countries_1.default.filter((country) => country.Code === code)[0];
|
|
14
14
|
return (_a = country === null || country === void 0 ? void 0 : country.Name) !== null && _a !== void 0 ? _a : "";
|
|
15
15
|
}
|
|
16
|
-
exports.getCountryName = getCountryName;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = getEnumName;
|
|
3
4
|
function getEnumName(enumObject, index, translateFile, t) {
|
|
4
5
|
var _a, _b;
|
|
5
6
|
if (translateFile && t) {
|
|
@@ -7,4 +8,3 @@ function getEnumName(enumObject, index, translateFile, t) {
|
|
|
7
8
|
}
|
|
8
9
|
return (_b = enumObject[index]) === null || _b === void 0 ? void 0 : _b.toString();
|
|
9
10
|
}
|
|
10
|
-
exports.default = getEnumName;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getStateByCountry =
|
|
6
|
+
exports.getStateByCountry = getStateByCountry;
|
|
7
7
|
const state_1 = __importDefault(require("../content/state"));
|
|
8
8
|
function getStateByCountry(code) {
|
|
9
9
|
if (typeof code == "string") {
|
|
@@ -12,4 +12,3 @@ function getStateByCountry(code) {
|
|
|
12
12
|
const stateObj = state_1.default.filter((state) => state.Country_Code === code);
|
|
13
13
|
return stateObj !== null && stateObj !== void 0 ? stateObj : "";
|
|
14
14
|
}
|
|
15
|
-
exports.getStateByCountry = getStateByCountry;
|
|
@@ -32,7 +32,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.
|
|
35
|
+
exports.decryptString = decryptString;
|
|
36
|
+
exports.errorHandler = errorHandler;
|
|
36
37
|
const crypto = __importStar(require("crypto"));
|
|
37
38
|
const info_1 = require("../info");
|
|
38
39
|
function decryptString(cipherText, key, iv) {
|
|
@@ -48,7 +49,6 @@ function decryptString(cipherText, key, iv) {
|
|
|
48
49
|
return JSON.stringify(error);
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
|
-
exports.decryptString = decryptString;
|
|
52
52
|
function errorHandler(baseUrl, error) {
|
|
53
53
|
return __awaiter(this, void 0, void 0, function* () {
|
|
54
54
|
let ipAddressAndLocation = yield (0, info_1.IPAddressAndLocation)(`${baseUrl}/v1/myipaddress`);
|
|
@@ -75,4 +75,3 @@ function errorHandler(baseUrl, error) {
|
|
|
75
75
|
};
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
|
-
exports.errorHandler = errorHandler;
|
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.encryptString =
|
|
26
|
+
exports.encryptString = encryptString;
|
|
27
27
|
const buffer_1 = require("buffer");
|
|
28
28
|
const crypto = __importStar(require("crypto"));
|
|
29
29
|
function encryptString(plainText, key, iv) {
|
|
@@ -34,4 +34,3 @@ function encryptString(plainText, key, iv) {
|
|
|
34
34
|
encrypted += cipher.final("base64");
|
|
35
35
|
return encrypted;
|
|
36
36
|
}
|
|
37
|
-
exports.encryptString = encryptString;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.generatekeyAndIvCode = exports.generatekeyAndIvUsingUserID = exports.generatekeyAndIv =
|
|
3
|
+
exports.generatekeyAndIvCode = exports.generatekeyAndIvUsingUserID = exports.generatekeyAndIv = void 0;
|
|
4
|
+
exports.paddingLeft = paddingLeft;
|
|
4
5
|
function paddingLeft(value, length, paddingChar) {
|
|
5
6
|
if (value.length >= length) {
|
|
6
7
|
return value;
|
|
@@ -10,7 +11,6 @@ function paddingLeft(value, length, paddingChar) {
|
|
|
10
11
|
const paddedValue = padding + value;
|
|
11
12
|
return paddedValue;
|
|
12
13
|
}
|
|
13
|
-
exports.paddingLeft = paddingLeft;
|
|
14
14
|
const generatekeyAndIv = (program_id, user_id, installation_id) => {
|
|
15
15
|
const paddedLeft10ProgramId = paddingLeft(program_id.toString(), 10, "0");
|
|
16
16
|
const paddedLeft10UserId = paddingLeft(user_id.toString(), 10, "0");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.maskMiddleOfString =
|
|
3
|
+
exports.maskMiddleOfString = maskMiddleOfString;
|
|
4
4
|
function maskMiddleOfString(inputString) {
|
|
5
5
|
try {
|
|
6
6
|
const stringValue = String(inputString);
|
|
@@ -24,5 +24,4 @@ function maskMiddleOfString(inputString) {
|
|
|
24
24
|
return inputString;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
exports.maskMiddleOfString = maskMiddleOfString;
|
|
28
27
|
//update error
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sortUserInfo =
|
|
3
|
+
exports.sortUserInfo = sortUserInfo;
|
|
4
4
|
function sortUserInfo(list) {
|
|
5
5
|
try {
|
|
6
6
|
const verificationStatusOrder = {
|
|
7
|
-
"1": 0,
|
|
8
|
-
"2": 1,
|
|
9
|
-
"3": 2,
|
|
10
|
-
"0": 3,
|
|
7
|
+
"1": 0, // Verified
|
|
8
|
+
"2": 1, // Pending
|
|
9
|
+
"3": 2, // Failed
|
|
10
|
+
"0": 3, // Not Verified
|
|
11
11
|
"-1": 4, // Undefined
|
|
12
12
|
};
|
|
13
13
|
return list
|
|
@@ -40,4 +40,3 @@ function sortUserInfo(list) {
|
|
|
40
40
|
return errorObj;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
exports.sortUserInfo = sortUserInfo;
|
package/package.json
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ggez-banking-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
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",
|
|
7
7
|
"files": [
|
|
8
8
|
"/dist"
|
|
9
9
|
],
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/GGEZLabs/ggez-banking-sdk"
|
|
13
|
+
},
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/GGEZLabs/ggez-banking-sdk/issues"
|
|
16
|
+
},
|
|
17
|
+
"homepage": "https://github.com/GGEZLabs/ggez-banking-sdk#readme",
|
|
10
18
|
"scripts": {
|
|
11
19
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
12
20
|
"build": "tsc --build",
|