ggez-banking-sdk 0.0.4 → 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/README.md +0 -0
- package/dist/bank-system/constants/enum.d.ts +1061 -0
- package/dist/bank-system/constants/enum.js +1115 -0
- package/dist/bank-system/constants/index.d.ts +1 -0
- package/dist/bank-system/constants/index.js +17 -0
- package/dist/bank-system/content/accountCurrencies.d.ts +12 -0
- package/dist/bank-system/content/accountCurrencies.js +37 -0
- package/dist/bank-system/content/countries.d.ts +24 -0
- package/dist/bank-system/content/countries.js +6472 -0
- package/dist/bank-system/content/currencies.d.ts +32 -0
- package/dist/bank-system/content/currencies.js +5836 -0
- package/dist/bank-system/content/index.d.ts +4 -0
- package/dist/bank-system/content/index.js +12 -0
- package/dist/bank-system/content/state.d.ts +6 -0
- package/dist/bank-system/content/state.js +350 -0
- package/dist/bank-system/helper/data.d.ts +46 -0
- package/dist/bank-system/helper/data.js +57 -0
- package/dist/bank-system/helper/dataStructure.d.ts +3220 -0
- package/dist/bank-system/helper/dataStructure.js +1051 -0
- package/dist/bank-system/helper/index.d.ts +28 -0
- package/dist/bank-system/helper/index.js +394 -0
- package/dist/bank-system/interfaces/accountInterface.d.ts +26 -0
- package/dist/bank-system/interfaces/accountInterface.js +2 -0
- package/dist/bank-system/interfaces/bankingSystemInterface.d.ts +306 -0
- package/dist/bank-system/interfaces/bankingSystemInterface.js +2 -0
- package/dist/bank-system/interfaces/deviceInterface.d.ts +34 -0
- package/dist/bank-system/interfaces/deviceInterface.js +2 -0
- package/dist/bank-system/interfaces/index.d.ts +4 -0
- package/dist/bank-system/interfaces/index.js +20 -0
- package/dist/bank-system/interfaces/interface.d.ts +460 -0
- package/dist/bank-system/interfaces/interface.js +2 -0
- package/dist/bank-system/interfaces/organizationInterface.d.ts +118 -0
- package/dist/bank-system/interfaces/organizationInterface.js +2 -0
- package/dist/bank-system/interfaces/signInterface.d.ts +89 -0
- package/dist/bank-system/interfaces/signInterface.js +2 -0
- package/dist/bank-system/interfaces/transactionInterface.d.ts +17 -0
- package/dist/bank-system/interfaces/transactionInterface.js +2 -0
- package/dist/bank-system/restApi/index.d.ts +8 -0
- package/dist/bank-system/restApi/index.js +41 -0
- package/dist/bank-system/services/account.d.ts +33 -0
- package/dist/bank-system/services/account.js +129 -0
- package/dist/bank-system/services/addresses.d.ts +48 -0
- package/dist/bank-system/services/addresses.js +130 -0
- package/dist/bank-system/services/auth.d.ts +71 -0
- package/dist/bank-system/services/auth.js +250 -0
- package/dist/bank-system/services/bankAccount.d.ts +48 -0
- package/dist/bank-system/services/bankAccount.js +131 -0
- package/dist/bank-system/services/device.d.ts +46 -0
- package/dist/bank-system/services/device.js +212 -0
- package/dist/bank-system/services/document.d.ts +15 -0
- package/dist/bank-system/services/document.js +58 -0
- package/dist/bank-system/services/email.d.ts +70 -0
- package/dist/bank-system/services/email.js +175 -0
- package/dist/bank-system/services/history.d.ts +14 -0
- package/dist/bank-system/services/history.js +55 -0
- package/dist/bank-system/services/identification.d.ts +37 -0
- package/dist/bank-system/services/identification.js +107 -0
- package/dist/bank-system/services/index.d.ts +17 -0
- package/dist/bank-system/services/index.js +35 -0
- package/dist/bank-system/services/organization.d.ts +28 -0
- package/dist/bank-system/services/organization.js +129 -0
- package/dist/bank-system/services/personalInfo.d.ts +26 -0
- package/dist/bank-system/services/personalInfo.js +91 -0
- package/dist/bank-system/services/phone.d.ts +70 -0
- package/dist/bank-system/services/phone.js +175 -0
- package/dist/bank-system/services/security.d.ts +114 -0
- package/dist/bank-system/services/security.js +267 -0
- package/dist/bank-system/services/token.d.ts +11 -0
- package/dist/bank-system/services/token.js +83 -0
- package/dist/bank-system/services/transaction.d.ts +9 -0
- package/dist/bank-system/services/transaction.js +62 -0
- package/dist/bank-system/services/verifyAndConfirm.d.ts +116 -0
- package/dist/bank-system/services/verifyAndConfirm.js +308 -0
- package/dist/bank-system/utils/chainAddressMasking.d.ts +2 -0
- package/dist/bank-system/utils/chainAddressMasking.js +12 -0
- package/dist/bank-system/utils/copyText.d.ts +5 -0
- package/dist/bank-system/utils/copyText.js +22 -0
- package/dist/bank-system/utils/countryAndCurrencyData.d.ts +11 -0
- package/dist/bank-system/utils/countryAndCurrencyData.js +22 -0
- package/dist/bank-system/utils/enumToOption.d.ts +4 -0
- package/dist/bank-system/utils/enumToOption.js +18 -0
- package/dist/bank-system/utils/fillDeviceDetails.d.ts +23 -0
- package/dist/bank-system/utils/fillDeviceDetails.js +44 -0
- package/dist/bank-system/utils/generateOneLiner.d.ts +1 -0
- package/dist/bank-system/utils/generateOneLiner.js +16 -0
- package/dist/bank-system/utils/generateSourceId.d.ts +1 -0
- package/dist/bank-system/utils/generateSourceId.js +12 -0
- package/dist/bank-system/utils/getCountryName.d.ts +1 -0
- package/dist/bank-system/utils/getCountryName.js +15 -0
- package/dist/bank-system/utils/getEnumName.d.ts +1 -0
- package/dist/bank-system/utils/getEnumName.js +10 -0
- package/dist/bank-system/utils/getStateByCountryCode.d.ts +1 -0
- package/dist/bank-system/utils/getStateByCountryCode.js +14 -0
- package/dist/bank-system/utils/handleEncryption/decryptData.d.ts +15 -0
- package/dist/bank-system/utils/handleEncryption/decryptData.js +77 -0
- package/dist/bank-system/utils/handleEncryption/encryptData.d.ts +2 -0
- package/dist/bank-system/utils/handleEncryption/encryptData.js +36 -0
- package/dist/bank-system/utils/handleEncryption/index.d.ts +4 -0
- package/dist/bank-system/utils/handleEncryption/index.js +12 -0
- package/dist/bank-system/utils/handleEncryption/key.d.ts +13 -0
- package/dist/bank-system/utils/handleEncryption/key.js +40 -0
- package/dist/bank-system/utils/index.d.ts +15 -0
- package/dist/bank-system/utils/index.js +42 -0
- package/dist/bank-system/utils/info.d.ts +8 -0
- package/dist/bank-system/utils/info.js +79 -0
- package/dist/bank-system/utils/maskingFunction.d.ts +1 -0
- package/dist/bank-system/utils/maskingFunction.js +27 -0
- package/dist/bank-system/utils/regex.d.ts +106 -0
- package/dist/bank-system/utils/regex.js +110 -0
- package/dist/bank-system/utils/sortUserInfo.d.ts +1 -0
- package/dist/bank-system/utils/sortUserInfo.js +42 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +54 -0
- package/dist/keplr-config/chainInfo.d.ts +8 -0
- package/dist/keplr-config/chainInfo.js +111 -0
- package/package.json +1 -1
|
@@ -0,0 +1,62 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.useTransaction = void 0;
|
|
16
|
+
const restApi_1 = __importDefault(require("../restApi"));
|
|
17
|
+
const helper_1 = __importDefault(require("../helper"));
|
|
18
|
+
const dataStructure_1 = __importDefault(require("../helper/dataStructure"));
|
|
19
|
+
const useTransaction = (token, userInfo, userId, baseUrl, lang) => {
|
|
20
|
+
const { checkResponse, headerConfig } = (0, helper_1.default)(userInfo);
|
|
21
|
+
const { checkGlobalResponse } = checkResponse();
|
|
22
|
+
const { dataOrder } = (0, dataStructure_1.default)();
|
|
23
|
+
const { dataOrderRequest } = dataOrder();
|
|
24
|
+
let endPointOrder = `v1/order`;
|
|
25
|
+
const headerConfigAccount = () => {
|
|
26
|
+
let headersData = {
|
|
27
|
+
header: true,
|
|
28
|
+
isUrlEncoded: false,
|
|
29
|
+
token: token,
|
|
30
|
+
lang: lang,
|
|
31
|
+
};
|
|
32
|
+
let headers = headerConfig(headersData);
|
|
33
|
+
return headers;
|
|
34
|
+
};
|
|
35
|
+
const OrderRequest = (values //orderInterface
|
|
36
|
+
) => __awaiter(void 0, void 0, void 0, function* () {
|
|
37
|
+
var _a, _b, _c;
|
|
38
|
+
// let data = dataOrderRequest(values);
|
|
39
|
+
try {
|
|
40
|
+
const response = yield restApi_1.default.restApi(baseUrl, "POST", `${endPointOrder}`, headerConfigAccount(), values);
|
|
41
|
+
let { newUserInfo } = checkGlobalResponse("order", response, "OrderRequest", "OrderRequest");
|
|
42
|
+
return {
|
|
43
|
+
response: response === null || response === void 0 ? void 0 : response.data,
|
|
44
|
+
newUser: newUserInfo,
|
|
45
|
+
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",
|
|
46
|
+
status: "success",
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
return {
|
|
51
|
+
response: error.response,
|
|
52
|
+
newUser: null,
|
|
53
|
+
message: error.message,
|
|
54
|
+
status: "failed",
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
return {
|
|
59
|
+
OrderRequest,
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
exports.useTransaction = useTransaction;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { ValidateLimitedPhoneInterface, VerifyLimitedEmailInterface, VerifyLimitedPhoneInterface, ConfirmLimitedEmailInterface, ConfirmLimitedPhoneInterface, IsEmailPresentAndValidInterface, IsPhonePresentAndValidInterface, SendOTPPhoneInterface, SendOTPEmailInterface, ForgetPasswordValidateInterface, ForgetPasswordConfirmInterface } from "../interfaces/bankingSystemInterface";
|
|
2
|
+
import { LimitedTokenInterface } from "../interfaces/signInterface";
|
|
3
|
+
import { IGeoCoordinates, UserInfo } from "../interfaces/interface";
|
|
4
|
+
export declare const useVerifyAndConfirm: (userInfo: UserInfo, tokenData: LimitedTokenInterface, baseUrl: string, nodeUrl: string, programId: string, geoCoordinates: IGeoCoordinates, token?: string, userId?: string, lang?: string) => {
|
|
5
|
+
ValidateLimitedPhone: (values: ValidateLimitedPhoneInterface) => Promise<{
|
|
6
|
+
response: import("axios").AxiosResponse<any, any>;
|
|
7
|
+
newUser: {};
|
|
8
|
+
message: string;
|
|
9
|
+
status: string;
|
|
10
|
+
} | {
|
|
11
|
+
response: any;
|
|
12
|
+
newUser: any;
|
|
13
|
+
message: any;
|
|
14
|
+
status: string;
|
|
15
|
+
}>;
|
|
16
|
+
VerifyLimitedEmail: (values: VerifyLimitedEmailInterface) => Promise<{
|
|
17
|
+
response: import("axios").AxiosResponse<any, any>;
|
|
18
|
+
newUser: {};
|
|
19
|
+
message: string;
|
|
20
|
+
status: string;
|
|
21
|
+
} | {
|
|
22
|
+
response: any;
|
|
23
|
+
newUser: any;
|
|
24
|
+
message: any;
|
|
25
|
+
status: string;
|
|
26
|
+
}>;
|
|
27
|
+
VerifyLimitedPhone: (values: VerifyLimitedPhoneInterface) => Promise<{
|
|
28
|
+
response: import("axios").AxiosResponse<any, any>;
|
|
29
|
+
newUser: {};
|
|
30
|
+
message: string;
|
|
31
|
+
status: string;
|
|
32
|
+
} | {
|
|
33
|
+
response: any;
|
|
34
|
+
newUser: any;
|
|
35
|
+
message: any;
|
|
36
|
+
status: string;
|
|
37
|
+
}>;
|
|
38
|
+
ConfirmLimitedEmail: (values: ConfirmLimitedEmailInterface) => Promise<{
|
|
39
|
+
response: import("axios").AxiosResponse<any, any>;
|
|
40
|
+
newUser: {};
|
|
41
|
+
message: any;
|
|
42
|
+
status: string;
|
|
43
|
+
} | {
|
|
44
|
+
response: any;
|
|
45
|
+
newUser: any;
|
|
46
|
+
message: any;
|
|
47
|
+
status: string;
|
|
48
|
+
}>;
|
|
49
|
+
ConfirmLimitedPhone: (values: ConfirmLimitedPhoneInterface) => Promise<{
|
|
50
|
+
response: import("axios").AxiosResponse<any, any>;
|
|
51
|
+
newUser: {};
|
|
52
|
+
message: any;
|
|
53
|
+
status: string;
|
|
54
|
+
} | {
|
|
55
|
+
response: any;
|
|
56
|
+
newUser: any;
|
|
57
|
+
message: any;
|
|
58
|
+
status: string;
|
|
59
|
+
}>;
|
|
60
|
+
IsEmailUsed: (values: IsEmailPresentAndValidInterface) => Promise<{
|
|
61
|
+
response: import("axios").AxiosResponse<any, any>;
|
|
62
|
+
newUser: {};
|
|
63
|
+
message: string;
|
|
64
|
+
status: string;
|
|
65
|
+
} | {
|
|
66
|
+
response: any;
|
|
67
|
+
newUser: any;
|
|
68
|
+
message: any;
|
|
69
|
+
status: string;
|
|
70
|
+
}>;
|
|
71
|
+
IsPhoneUsed: (values: IsPhonePresentAndValidInterface) => Promise<{
|
|
72
|
+
response: import("axios").AxiosResponse<any, any>;
|
|
73
|
+
newUser: {};
|
|
74
|
+
message: string;
|
|
75
|
+
status: string;
|
|
76
|
+
} | {
|
|
77
|
+
response: any;
|
|
78
|
+
newUser: any;
|
|
79
|
+
message: any;
|
|
80
|
+
status: string;
|
|
81
|
+
}>;
|
|
82
|
+
SendOTPEmail: (values: SendOTPEmailInterface) => Promise<{
|
|
83
|
+
response: any;
|
|
84
|
+
newUser: any;
|
|
85
|
+
message: any;
|
|
86
|
+
status: string;
|
|
87
|
+
}>;
|
|
88
|
+
SendOTPPhone: (values: SendOTPPhoneInterface) => Promise<{
|
|
89
|
+
response: any;
|
|
90
|
+
newUser: any;
|
|
91
|
+
message: any;
|
|
92
|
+
status: string;
|
|
93
|
+
}>;
|
|
94
|
+
forgetPasswordValidate: (values: ForgetPasswordValidateInterface) => Promise<{
|
|
95
|
+
response: import("axios").AxiosResponse<any, any>;
|
|
96
|
+
newUser: any;
|
|
97
|
+
message: any;
|
|
98
|
+
status: string;
|
|
99
|
+
} | {
|
|
100
|
+
response: any;
|
|
101
|
+
newUser: any;
|
|
102
|
+
message: any;
|
|
103
|
+
status: string;
|
|
104
|
+
}>;
|
|
105
|
+
forgetPasswordConfirm: (values: ForgetPasswordConfirmInterface) => Promise<{
|
|
106
|
+
response: import("axios").AxiosResponse<any, any>;
|
|
107
|
+
newUser: any;
|
|
108
|
+
message: any;
|
|
109
|
+
status: string;
|
|
110
|
+
} | {
|
|
111
|
+
response: any;
|
|
112
|
+
newUser: any;
|
|
113
|
+
message: any;
|
|
114
|
+
status: string;
|
|
115
|
+
}>;
|
|
116
|
+
};
|
|
@@ -0,0 +1,308 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.useVerifyAndConfirm = void 0;
|
|
16
|
+
const token_1 = require("./token");
|
|
17
|
+
const dataStructure_1 = __importDefault(require("../helper/dataStructure"));
|
|
18
|
+
const restApi_1 = __importDefault(require("../restApi"));
|
|
19
|
+
const helper_1 = __importDefault(require("../helper"));
|
|
20
|
+
const useVerifyAndConfirm = (userInfo, tokenData, baseUrl, nodeUrl, programId, geoCoordinates, token, userId, lang) => {
|
|
21
|
+
const { dataValidate, dataSecurity } = (0, dataStructure_1.default)();
|
|
22
|
+
const { dataConfirmEmail, dataConfirmPhone, dataISEmailUsed, dataIsPhoneUsed, dataValidatePhone, dataVerifyEmail, dataVerifyPhone, dataSendOTPEmail, dataSendOTPPhone, dataValidateForgetPassword, dataConfirmForgetPassword, } = dataValidate();
|
|
23
|
+
const { CreateLimitedToken } = (0, token_1.useToken)(userInfo, nodeUrl, programId, "", geoCoordinates);
|
|
24
|
+
const { checkResponse, headerConfig } = (0, helper_1.default)(userInfo);
|
|
25
|
+
const { checkGlobalResponse, errorHandler } = checkResponse();
|
|
26
|
+
const headerConfigVerify = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
27
|
+
var _a;
|
|
28
|
+
let token;
|
|
29
|
+
let { message, response, status } = yield CreateLimitedToken(tokenData);
|
|
30
|
+
if (status == "success") {
|
|
31
|
+
token = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.access_token;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
errorHandler(message, "SignUpApi", response);
|
|
35
|
+
}
|
|
36
|
+
let headersData = {
|
|
37
|
+
header: true,
|
|
38
|
+
isUrlEncoded: false,
|
|
39
|
+
token: token,
|
|
40
|
+
lang: lang,
|
|
41
|
+
};
|
|
42
|
+
let headers = headerConfig(headersData);
|
|
43
|
+
return headers;
|
|
44
|
+
});
|
|
45
|
+
const headerConfigUser = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
46
|
+
let headersData = {
|
|
47
|
+
header: true,
|
|
48
|
+
isUrlEncoded: false,
|
|
49
|
+
token: token,
|
|
50
|
+
lang: lang,
|
|
51
|
+
};
|
|
52
|
+
let headers = headerConfig(headersData);
|
|
53
|
+
return headers;
|
|
54
|
+
});
|
|
55
|
+
const ValidateLimitedPhone = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
56
|
+
let data = dataValidatePhone(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
57
|
+
try {
|
|
58
|
+
const response = yield restApi_1.default.restApi(baseUrl, "POST", `v1/limited/security/validate`, yield headerConfigVerify(), data);
|
|
59
|
+
checkGlobalResponse("verify", response, "ValidateLimitedPhone", "verify");
|
|
60
|
+
return {
|
|
61
|
+
response: response,
|
|
62
|
+
newUser: {},
|
|
63
|
+
message: "",
|
|
64
|
+
status: "success",
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
return {
|
|
69
|
+
response: error.response,
|
|
70
|
+
newUser: null,
|
|
71
|
+
message: error.message,
|
|
72
|
+
status: "failed",
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
const VerifyLimitedEmail = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
77
|
+
let data = dataVerifyEmail(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
78
|
+
try {
|
|
79
|
+
const response = yield restApi_1.default.restApi(baseUrl, "POST", `v1/limited/security/verify`, yield headerConfigVerify(), data);
|
|
80
|
+
checkGlobalResponse("verify", response, "VerifyLimitedEmail", "verify");
|
|
81
|
+
return {
|
|
82
|
+
response: response,
|
|
83
|
+
newUser: {},
|
|
84
|
+
message: "Verification Code Message Sent Successfully",
|
|
85
|
+
status: "success",
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
return {
|
|
90
|
+
response: error.response,
|
|
91
|
+
newUser: null,
|
|
92
|
+
message: error.message,
|
|
93
|
+
status: "failed",
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
const VerifyLimitedPhone = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
98
|
+
let data = dataVerifyPhone(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
99
|
+
try {
|
|
100
|
+
const response = yield restApi_1.default.restApi(baseUrl, "POST", `v1/limited/security/verify`, yield headerConfigVerify(), data);
|
|
101
|
+
checkGlobalResponse("verify", response, "VerifyLimitedPhone", "verify");
|
|
102
|
+
return {
|
|
103
|
+
response: response,
|
|
104
|
+
newUser: {},
|
|
105
|
+
message: "Verification Code Message Sent Successfully",
|
|
106
|
+
status: "success",
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
return {
|
|
111
|
+
response: error.response,
|
|
112
|
+
newUser: null,
|
|
113
|
+
message: error.message,
|
|
114
|
+
status: "failed",
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
const SendOTPEmail = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
119
|
+
let data = dataSendOTPEmail(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
120
|
+
try {
|
|
121
|
+
const response = yield restApi_1.default.restApi(baseUrl, "POST", `v1/user/security/verify/${userId}`, yield headerConfigUser(), data);
|
|
122
|
+
checkGlobalResponse("verify", response, "SendOTPEmail", "verify");
|
|
123
|
+
return {
|
|
124
|
+
response: response,
|
|
125
|
+
newUser: null,
|
|
126
|
+
message: "The OTP Email code has been sent",
|
|
127
|
+
status: "success",
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
return {
|
|
132
|
+
response: error.response,
|
|
133
|
+
newUser: null,
|
|
134
|
+
message: error.message,
|
|
135
|
+
status: "failed",
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
const SendOTPPhone = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
140
|
+
let data = dataSendOTPPhone(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
141
|
+
try {
|
|
142
|
+
const response = yield restApi_1.default.restApi(baseUrl, "POST", `v1/user/security/verify/${userId}`, yield headerConfigUser(), data);
|
|
143
|
+
checkGlobalResponse("verify", response, "SendOTPPhone", "verify");
|
|
144
|
+
return {
|
|
145
|
+
response: response,
|
|
146
|
+
newUser: null,
|
|
147
|
+
message: "The OTP SMS code has been sent",
|
|
148
|
+
status: "success",
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
catch (error) {
|
|
152
|
+
return {
|
|
153
|
+
response: error.response,
|
|
154
|
+
newUser: null,
|
|
155
|
+
message: error.message,
|
|
156
|
+
status: "failed",
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
const ConfirmLimitedEmail = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
161
|
+
var _a, _b, _c;
|
|
162
|
+
let data = dataConfirmEmail(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
163
|
+
try {
|
|
164
|
+
const response = yield restApi_1.default.restApi(baseUrl, "POST", `v1/limited/security/confirm`, yield headerConfigVerify(), data);
|
|
165
|
+
checkGlobalResponse("confirm", response, "ConfirmLimitedEmail", undefined);
|
|
166
|
+
return {
|
|
167
|
+
response: response,
|
|
168
|
+
newUser: {},
|
|
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
|
+
status: "success",
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
catch (error) {
|
|
174
|
+
return {
|
|
175
|
+
response: error.response,
|
|
176
|
+
newUser: null,
|
|
177
|
+
message: error.message,
|
|
178
|
+
status: "failed",
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
const ConfirmLimitedPhone = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
183
|
+
var _a, _b, _c;
|
|
184
|
+
let data = dataConfirmPhone(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
185
|
+
try {
|
|
186
|
+
const response = yield restApi_1.default.restApi(baseUrl, "POST", `v1/limited/security/confirm`, yield headerConfigVerify(), data);
|
|
187
|
+
checkGlobalResponse("confirm", response, "ConfirmLimitedPhone", undefined);
|
|
188
|
+
return {
|
|
189
|
+
response: response,
|
|
190
|
+
newUser: {},
|
|
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
|
+
status: "success",
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
catch (error) {
|
|
196
|
+
return {
|
|
197
|
+
response: error.response,
|
|
198
|
+
newUser: null,
|
|
199
|
+
message: error.message,
|
|
200
|
+
status: "failed",
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
const IsEmailUsed = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
205
|
+
let data = dataISEmailUsed(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
206
|
+
try {
|
|
207
|
+
let headers = yield headerConfigVerify();
|
|
208
|
+
const response = yield restApi_1.default.restApi(baseUrl, "POST", `v1/limited/security/validate`, headers, data);
|
|
209
|
+
checkGlobalResponse("verify", response, "IsEmailUsed", "verify");
|
|
210
|
+
return {
|
|
211
|
+
response: response,
|
|
212
|
+
newUser: {},
|
|
213
|
+
message: "",
|
|
214
|
+
status: "success",
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
catch (error) {
|
|
218
|
+
return {
|
|
219
|
+
response: error.response,
|
|
220
|
+
newUser: null,
|
|
221
|
+
message: error.message,
|
|
222
|
+
status: "failed",
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
const IsPhoneUsed = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
227
|
+
let data = dataIsPhoneUsed(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
228
|
+
try {
|
|
229
|
+
let headers = yield headerConfigVerify();
|
|
230
|
+
const response = yield restApi_1.default.restApi(baseUrl, "POST", `v1/limited/security/validate`, headers, data);
|
|
231
|
+
checkGlobalResponse("verify", response, "IsPhoneUsed", "verify");
|
|
232
|
+
return {
|
|
233
|
+
response: response,
|
|
234
|
+
newUser: {},
|
|
235
|
+
message: "",
|
|
236
|
+
status: "success",
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
catch (error) {
|
|
240
|
+
return {
|
|
241
|
+
response: error.response,
|
|
242
|
+
newUser: null,
|
|
243
|
+
message: error.message,
|
|
244
|
+
status: "failed",
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
const forgetPasswordValidate = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
249
|
+
var _a, _b, _c;
|
|
250
|
+
let data = dataValidateForgetPassword(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
251
|
+
try {
|
|
252
|
+
let headers = yield headerConfigVerify();
|
|
253
|
+
const response = yield restApi_1.default.restApi(baseUrl, "POST", `v1/limited/security/forget/validate`, headers, data);
|
|
254
|
+
let { newUserInfo } = checkGlobalResponse("forget", response, "forgetPasswordValidate", "forgetValidate");
|
|
255
|
+
return {
|
|
256
|
+
response: response,
|
|
257
|
+
newUser: newUserInfo,
|
|
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
|
+
status: "success",
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
catch (error) {
|
|
263
|
+
return {
|
|
264
|
+
response: error.response,
|
|
265
|
+
newUser: null,
|
|
266
|
+
message: error.message,
|
|
267
|
+
status: "failed",
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
const forgetPasswordConfirm = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
272
|
+
var _a, _b, _c;
|
|
273
|
+
let data = dataConfirmForgetPassword(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
274
|
+
try {
|
|
275
|
+
let headers = yield headerConfigVerify();
|
|
276
|
+
const response = yield restApi_1.default.restApi(baseUrl, "POST", `v1/limited/security/forget/confirm`, headers, data);
|
|
277
|
+
let { newUserInfo } = checkGlobalResponse("forget", response, "forgetPasswordConfirm", "forgetConfirm");
|
|
278
|
+
return {
|
|
279
|
+
response: response,
|
|
280
|
+
newUser: newUserInfo,
|
|
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
|
+
status: "success",
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
catch (error) {
|
|
286
|
+
return {
|
|
287
|
+
response: error.response,
|
|
288
|
+
newUser: null,
|
|
289
|
+
message: error.message,
|
|
290
|
+
status: "failed",
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
return {
|
|
295
|
+
ValidateLimitedPhone,
|
|
296
|
+
VerifyLimitedEmail,
|
|
297
|
+
VerifyLimitedPhone,
|
|
298
|
+
ConfirmLimitedEmail,
|
|
299
|
+
ConfirmLimitedPhone,
|
|
300
|
+
IsEmailUsed,
|
|
301
|
+
IsPhoneUsed,
|
|
302
|
+
SendOTPEmail,
|
|
303
|
+
SendOTPPhone,
|
|
304
|
+
forgetPasswordValidate,
|
|
305
|
+
forgetPasswordConfirm,
|
|
306
|
+
};
|
|
307
|
+
};
|
|
308
|
+
exports.useVerifyAndConfirm = useVerifyAndConfirm;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
function chainAddressMasking(address) {
|
|
4
|
+
if (!address) {
|
|
5
|
+
return "loading";
|
|
6
|
+
}
|
|
7
|
+
if (typeof address === "string") {
|
|
8
|
+
return `${address.substring(0, 15)}...${address.substring((address === null || address === void 0 ? void 0 : address.length) - 5)}`;
|
|
9
|
+
}
|
|
10
|
+
return "loading";
|
|
11
|
+
}
|
|
12
|
+
exports.default = chainAddressMasking;
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.handleCopy = void 0;
|
|
13
|
+
const handleCopy = (text) => __awaiter(void 0, void 0, void 0, function* () {
|
|
14
|
+
try {
|
|
15
|
+
text && (yield navigator.clipboard.writeText(text));
|
|
16
|
+
return { text: text, status: "success", message: "Text copied to clipboard successfully." };
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
return { text: text, status: "failed", message: `Error copying text to clipboard: ${error}` };
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
exports.handleCopy = handleCopy;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const countries_1 = __importDefault(require("../content/countries"));
|
|
7
|
+
const accountCurrencies_1 = __importDefault(require("../content/accountCurrencies"));
|
|
8
|
+
const UseCountryAndCurrencyData = () => {
|
|
9
|
+
const country = countries_1.default.map((e) => {
|
|
10
|
+
const data = { label: e.Name, value: e.Code.toString() };
|
|
11
|
+
return data;
|
|
12
|
+
});
|
|
13
|
+
const currency = accountCurrencies_1.default.map((e) => {
|
|
14
|
+
const data = {
|
|
15
|
+
label: `${e.Code} - ${e.Location}`,
|
|
16
|
+
value: e.Code,
|
|
17
|
+
};
|
|
18
|
+
return data;
|
|
19
|
+
});
|
|
20
|
+
return { country, currency };
|
|
21
|
+
};
|
|
22
|
+
exports.default = UseCountryAndCurrencyData;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = enumsToOptions;
|
|
4
|
+
function enumsToOptions(enumObject, translateFile, t) {
|
|
5
|
+
let lst = [];
|
|
6
|
+
let keys = Object.keys(enumObject).sort();
|
|
7
|
+
const length = keys.length;
|
|
8
|
+
keys = keys.slice(0, length / 2);
|
|
9
|
+
for (const key of keys) {
|
|
10
|
+
if (key == "-1")
|
|
11
|
+
continue;
|
|
12
|
+
lst.push({
|
|
13
|
+
value: Number(key),
|
|
14
|
+
label: t(`${translateFile}${(enumObject[key]).toString()}`),
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
return lst;
|
|
18
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DeviceType, SecurityOperationMethod } from "../constants/enum";
|
|
2
|
+
export declare const fillDeviceDetails: () => {
|
|
3
|
+
type: DeviceType;
|
|
4
|
+
brand: string;
|
|
5
|
+
os: any;
|
|
6
|
+
extended_info: {
|
|
7
|
+
sim_info: any;
|
|
8
|
+
culture_info: any;
|
|
9
|
+
user_agent: any;
|
|
10
|
+
cpu: any;
|
|
11
|
+
system_language: any;
|
|
12
|
+
};
|
|
13
|
+
activity_type: SecurityOperationMethod;
|
|
14
|
+
application_version: any;
|
|
15
|
+
serial_number: any;
|
|
16
|
+
source_ip_address: string;
|
|
17
|
+
geo_coordinates: string;
|
|
18
|
+
client_time_zone: string;
|
|
19
|
+
server_date: string;
|
|
20
|
+
date_utc: string;
|
|
21
|
+
client_date: string;
|
|
22
|
+
update_date_utc: string;
|
|
23
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.fillDeviceDetails = void 0;
|
|
7
|
+
const clientjs_1 = require("clientjs");
|
|
8
|
+
const enum_1 = require("../constants/enum");
|
|
9
|
+
//import { fingerPrintHandler } from "./info";
|
|
10
|
+
const dayjs_1 = __importDefault(require("dayjs"));
|
|
11
|
+
const utc_1 = __importDefault(require("dayjs/plugin/utc"));
|
|
12
|
+
const timezone_1 = __importDefault(require("dayjs/plugin/timezone"));
|
|
13
|
+
dayjs_1.default.extend(utc_1.default);
|
|
14
|
+
dayjs_1.default.extend(timezone_1.default);
|
|
15
|
+
const client = new clientjs_1.ClientJS();
|
|
16
|
+
const fillDeviceDetails = () => {
|
|
17
|
+
// const { geo_coordinates, ip_address } = await getGeoCoordinatesAndIPAddress(
|
|
18
|
+
// baseUrl
|
|
19
|
+
// );
|
|
20
|
+
let device = {
|
|
21
|
+
type: enum_1.DeviceType.Browser,
|
|
22
|
+
brand: `${client.getBrowser()}-${client.getBrowserVersion()}`,
|
|
23
|
+
os: client.getOS(),
|
|
24
|
+
extended_info: {
|
|
25
|
+
sim_info: null,
|
|
26
|
+
culture_info: null,
|
|
27
|
+
user_agent: client.getUserAgent(),
|
|
28
|
+
cpu: client.getCPU(),
|
|
29
|
+
system_language: client.getSystemLanguage(),
|
|
30
|
+
},
|
|
31
|
+
activity_type: enum_1.SecurityOperationMethod.Login,
|
|
32
|
+
application_version: null,
|
|
33
|
+
serial_number: null,
|
|
34
|
+
source_ip_address: "",
|
|
35
|
+
geo_coordinates: "",
|
|
36
|
+
client_time_zone: `UTC ${dayjs_1.default.tz(new Date()).format("Z")}`,
|
|
37
|
+
server_date: "",
|
|
38
|
+
date_utc: "",
|
|
39
|
+
client_date: dayjs_1.default.tz(new Date()).format("YYYY-MM-DD HH:mm:ss.SSS"),
|
|
40
|
+
update_date_utc: "",
|
|
41
|
+
};
|
|
42
|
+
return device;
|
|
43
|
+
};
|
|
44
|
+
exports.fillDeviceDetails = fillDeviceDetails;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function generateOneLiner(lst: string[]): string[];
|