ggez-banking-sdk 0.0.1 → 0.0.2
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 +1057 -0
- package/dist/bank-system/constants/enum.js +1110 -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 +17 -0
- package/dist/bank-system/utils/generateSourceId.d.ts +1 -0
- package/dist/bank-system/utils/generateSourceId.js +13 -0
- package/dist/bank-system/utils/getCountryName.d.ts +1 -0
- package/dist/bank-system/utils/getCountryName.js +16 -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 +15 -0
- package/dist/bank-system/utils/handleEncryption/decryptData.d.ts +15 -0
- package/dist/bank-system/utils/handleEncryption/decryptData.js +78 -0
- package/dist/bank-system/utils/handleEncryption/encryptData.d.ts +2 -0
- package/dist/bank-system/utils/handleEncryption/encryptData.js +37 -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 +28 -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 +43 -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,107 @@
|
|
|
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.useIdentification = void 0;
|
|
16
|
+
const dataStructure_1 = __importDefault(require("../helper/dataStructure"));
|
|
17
|
+
const helper_1 = __importDefault(require("../helper"));
|
|
18
|
+
const restApi_1 = __importDefault(require("../restApi"));
|
|
19
|
+
const useIdentification = (token, userInfo, userId, baseUrl, geoCoordinates, lang) => {
|
|
20
|
+
const { checkResponse, headerConfig } = (0, helper_1.default)(userInfo);
|
|
21
|
+
const { checkGlobalResponse, errorHandler } = checkResponse();
|
|
22
|
+
const { dataIdentification } = (0, dataStructure_1.default)();
|
|
23
|
+
const { createDataIdentification, deleteDataIdentification, updateDataIdentification, } = dataIdentification();
|
|
24
|
+
let endPointIdentification = `v1/user/identification/${userId}`;
|
|
25
|
+
const headerConfigIdentification = () => {
|
|
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 CreateIdentification = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
36
|
+
var _a, _b, _c;
|
|
37
|
+
let data = createDataIdentification(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
38
|
+
try {
|
|
39
|
+
const response = yield restApi_1.default.restApi(baseUrl, "POST", endPointIdentification, headerConfigIdentification(), data);
|
|
40
|
+
let { newUserInfo } = checkGlobalResponse("identification", response, "CreateIdentification", "create");
|
|
41
|
+
return {
|
|
42
|
+
response: response,
|
|
43
|
+
newUser: newUserInfo,
|
|
44
|
+
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 Created Successfully",
|
|
45
|
+
status: "success",
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
return {
|
|
50
|
+
response: error.response,
|
|
51
|
+
newUser: null,
|
|
52
|
+
message: error.message,
|
|
53
|
+
status: "failed",
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
const UpdateIdentification = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
58
|
+
var _d, _e, _f;
|
|
59
|
+
let data = updateDataIdentification(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
60
|
+
try {
|
|
61
|
+
const response = yield restApi_1.default.restApi(baseUrl, "PUT", endPointIdentification, headerConfigIdentification(), data);
|
|
62
|
+
let { newUserInfo } = checkGlobalResponse("identification", response, "UpdateIdentification", "update");
|
|
63
|
+
return {
|
|
64
|
+
response: response,
|
|
65
|
+
newUser: newUserInfo,
|
|
66
|
+
message: (_f = (_e = (_d = response === null || response === void 0 ? void 0 : response.data) === null || _d === void 0 ? void 0 : _d.result) === null || _e === void 0 ? void 0 : _e.friendly_message) !== null && _f !== void 0 ? _f : "Identification Updated Successfully",
|
|
67
|
+
status: "success",
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
return {
|
|
72
|
+
response: error.response,
|
|
73
|
+
newUser: null,
|
|
74
|
+
message: error.message,
|
|
75
|
+
status: "failed",
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
const DeleteIdentification = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
80
|
+
var _g, _h, _j;
|
|
81
|
+
let data = deleteDataIdentification(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
82
|
+
try {
|
|
83
|
+
const response = yield restApi_1.default.restApi(baseUrl, "DELETE", endPointIdentification, headerConfigIdentification(), data);
|
|
84
|
+
let { newUserInfo } = checkGlobalResponse("identification", response, "DeleteIdentification", "delete");
|
|
85
|
+
return {
|
|
86
|
+
response: response,
|
|
87
|
+
newUser: newUserInfo,
|
|
88
|
+
message: (_j = (_h = (_g = response === null || response === void 0 ? void 0 : response.data) === null || _g === void 0 ? void 0 : _g.result) === null || _h === void 0 ? void 0 : _h.friendly_message) !== null && _j !== void 0 ? _j : "Identification Deleted Successfully",
|
|
89
|
+
status: "success",
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
return {
|
|
94
|
+
response: error.response,
|
|
95
|
+
newUser: null,
|
|
96
|
+
message: error.message,
|
|
97
|
+
status: "failed",
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
return {
|
|
102
|
+
CreateIdentification,
|
|
103
|
+
UpdateIdentification,
|
|
104
|
+
DeleteIdentification,
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
exports.useIdentification = useIdentification;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useAuth } from "./auth";
|
|
2
|
+
import { useAddresses } from "./addresses";
|
|
3
|
+
import { useBankAccount } from "./bankAccount";
|
|
4
|
+
import { useDocument } from "./document";
|
|
5
|
+
import { useEmail } from "./email";
|
|
6
|
+
import { useIdentification } from "./identification";
|
|
7
|
+
import { usePersonalInfo } from "./personalInfo";
|
|
8
|
+
import { usePhone } from "./phone";
|
|
9
|
+
import { useSecurity } from "./security";
|
|
10
|
+
import { useToken } from "./token";
|
|
11
|
+
import { useVerifyAndConfirm } from "./verifyAndConfirm";
|
|
12
|
+
import { useAccount } from "./account";
|
|
13
|
+
import { useGetUserLatest } from "./history";
|
|
14
|
+
import { useDevice } from "./device";
|
|
15
|
+
import { useTransaction } from "./transaction";
|
|
16
|
+
import { useOrganization } from "./organization";
|
|
17
|
+
export { useAuth, useAddresses, useBankAccount, useDocument, useEmail, useIdentification, usePersonalInfo, usePhone, useSecurity, useToken, useVerifyAndConfirm, useAccount, useGetUserLatest, useDevice, useTransaction, useOrganization, };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useOrganization = exports.useTransaction = exports.useDevice = exports.useGetUserLatest = exports.useAccount = exports.useVerifyAndConfirm = exports.useToken = exports.useSecurity = exports.usePhone = exports.usePersonalInfo = exports.useIdentification = exports.useEmail = exports.useDocument = exports.useBankAccount = exports.useAddresses = exports.useAuth = void 0;
|
|
4
|
+
const auth_1 = require("./auth");
|
|
5
|
+
Object.defineProperty(exports, "useAuth", { enumerable: true, get: function () { return auth_1.useAuth; } });
|
|
6
|
+
const addresses_1 = require("./addresses");
|
|
7
|
+
Object.defineProperty(exports, "useAddresses", { enumerable: true, get: function () { return addresses_1.useAddresses; } });
|
|
8
|
+
const bankAccount_1 = require("./bankAccount");
|
|
9
|
+
Object.defineProperty(exports, "useBankAccount", { enumerable: true, get: function () { return bankAccount_1.useBankAccount; } });
|
|
10
|
+
const document_1 = require("./document");
|
|
11
|
+
Object.defineProperty(exports, "useDocument", { enumerable: true, get: function () { return document_1.useDocument; } });
|
|
12
|
+
const email_1 = require("./email");
|
|
13
|
+
Object.defineProperty(exports, "useEmail", { enumerable: true, get: function () { return email_1.useEmail; } });
|
|
14
|
+
const identification_1 = require("./identification");
|
|
15
|
+
Object.defineProperty(exports, "useIdentification", { enumerable: true, get: function () { return identification_1.useIdentification; } });
|
|
16
|
+
const personalInfo_1 = require("./personalInfo");
|
|
17
|
+
Object.defineProperty(exports, "usePersonalInfo", { enumerable: true, get: function () { return personalInfo_1.usePersonalInfo; } });
|
|
18
|
+
const phone_1 = require("./phone");
|
|
19
|
+
Object.defineProperty(exports, "usePhone", { enumerable: true, get: function () { return phone_1.usePhone; } });
|
|
20
|
+
const security_1 = require("./security");
|
|
21
|
+
Object.defineProperty(exports, "useSecurity", { enumerable: true, get: function () { return security_1.useSecurity; } });
|
|
22
|
+
const token_1 = require("./token");
|
|
23
|
+
Object.defineProperty(exports, "useToken", { enumerable: true, get: function () { return token_1.useToken; } });
|
|
24
|
+
const verifyAndConfirm_1 = require("./verifyAndConfirm");
|
|
25
|
+
Object.defineProperty(exports, "useVerifyAndConfirm", { enumerable: true, get: function () { return verifyAndConfirm_1.useVerifyAndConfirm; } });
|
|
26
|
+
const account_1 = require("./account");
|
|
27
|
+
Object.defineProperty(exports, "useAccount", { enumerable: true, get: function () { return account_1.useAccount; } });
|
|
28
|
+
const history_1 = require("./history");
|
|
29
|
+
Object.defineProperty(exports, "useGetUserLatest", { enumerable: true, get: function () { return history_1.useGetUserLatest; } });
|
|
30
|
+
const device_1 = require("./device");
|
|
31
|
+
Object.defineProperty(exports, "useDevice", { enumerable: true, get: function () { return device_1.useDevice; } });
|
|
32
|
+
const transaction_1 = require("./transaction");
|
|
33
|
+
Object.defineProperty(exports, "useTransaction", { enumerable: true, get: function () { return transaction_1.useTransaction; } });
|
|
34
|
+
const organization_1 = require("./organization");
|
|
35
|
+
Object.defineProperty(exports, "useOrganization", { enumerable: true, get: function () { return organization_1.useOrganization; } });
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { CreateDocumentOrganizationInterface, CreateOrganizationInterface, UpdateOrganizationInterface } from "../interfaces/organizationInterface";
|
|
2
|
+
import { IGeoCoordinates, UserInfo } from "../interfaces/interface";
|
|
3
|
+
export declare const useOrganization: (token: string, userInfo: UserInfo, userId: string, baseUrl: string, geoCoordinates: IGeoCoordinates, lang?: string) => {
|
|
4
|
+
CreateOrganization: (values: CreateOrganizationInterface) => Promise<{
|
|
5
|
+
response: any;
|
|
6
|
+
newUser: any;
|
|
7
|
+
message: any;
|
|
8
|
+
status: string;
|
|
9
|
+
}>;
|
|
10
|
+
UpdateOrganization: (values: UpdateOrganizationInterface, organizationId: string) => Promise<{
|
|
11
|
+
response: any;
|
|
12
|
+
newUser: any;
|
|
13
|
+
message: any;
|
|
14
|
+
status: string;
|
|
15
|
+
}>;
|
|
16
|
+
DeleteOrganization: (organizationId: string) => Promise<{
|
|
17
|
+
response: any;
|
|
18
|
+
newUser: any;
|
|
19
|
+
message: any;
|
|
20
|
+
status: string;
|
|
21
|
+
}>;
|
|
22
|
+
CreateDocumentOrganization: (values: CreateDocumentOrganizationInterface, organizationId: string) => Promise<{
|
|
23
|
+
response: any;
|
|
24
|
+
newUser: any;
|
|
25
|
+
message: any;
|
|
26
|
+
status: string;
|
|
27
|
+
}>;
|
|
28
|
+
};
|
|
@@ -0,0 +1,129 @@
|
|
|
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.useOrganization = 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 useOrganization = (token, userInfo, userId, baseUrl, geoCoordinates, lang) => {
|
|
20
|
+
const { checkResponse, headerConfig } = (0, helper_1.default)(userInfo);
|
|
21
|
+
const { checkGlobalResponse } = checkResponse();
|
|
22
|
+
const { dataOrganization } = (0, dataStructure_1.default)();
|
|
23
|
+
const { dataCreateOrganization, dataUpdateOrganization, dataCreateDocumentOrganization, } = dataOrganization();
|
|
24
|
+
let endPoint = `v1/Organization`;
|
|
25
|
+
const headerConfigDevice = () => {
|
|
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 CreateOrganization = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
36
|
+
var _a, _b, _c;
|
|
37
|
+
let data = dataCreateOrganization(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }), userId);
|
|
38
|
+
try {
|
|
39
|
+
const response = yield restApi_1.default.restApi(baseUrl, "POST", endPoint, headerConfigDevice(), data);
|
|
40
|
+
let { newUserInfo } = checkGlobalResponse("organization", response, "CreateOrganization", "createOrganization");
|
|
41
|
+
return {
|
|
42
|
+
response: response === null || response === void 0 ? void 0 : response.data,
|
|
43
|
+
newUser: newUserInfo,
|
|
44
|
+
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 Organization Successfully",
|
|
45
|
+
status: "success",
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
return {
|
|
50
|
+
response: error.response,
|
|
51
|
+
newUser: null,
|
|
52
|
+
message: error.message,
|
|
53
|
+
status: "failed",
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
const UpdateOrganization = (values, organizationId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
58
|
+
var _d, _e, _f;
|
|
59
|
+
let data = dataUpdateOrganization(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }), userId);
|
|
60
|
+
try {
|
|
61
|
+
const response = yield restApi_1.default.restApi(baseUrl, "PUT", `${endPoint}/${organizationId}`, headerConfigDevice(), data);
|
|
62
|
+
let { newUserInfo } = checkGlobalResponse("organization", response, "UpdateOrganization", "updateOrganization");
|
|
63
|
+
return {
|
|
64
|
+
response: response === null || response === void 0 ? void 0 : response.data,
|
|
65
|
+
newUser: newUserInfo,
|
|
66
|
+
message: (_f = (_e = (_d = response === null || response === void 0 ? void 0 : response.data) === null || _d === void 0 ? void 0 : _d.result) === null || _e === void 0 ? void 0 : _e.friendly_message) !== null && _f !== void 0 ? _f : "Update Organization Successfully",
|
|
67
|
+
status: "success",
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
return {
|
|
72
|
+
response: error.response,
|
|
73
|
+
newUser: null,
|
|
74
|
+
message: error.message,
|
|
75
|
+
status: "failed",
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
const DeleteOrganization = (organizationId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
80
|
+
var _g, _h, _j;
|
|
81
|
+
try {
|
|
82
|
+
const response = yield restApi_1.default.restApi(baseUrl, "DELETE", `${endPoint}/${organizationId}`, headerConfigDevice());
|
|
83
|
+
let { newUserInfo } = checkGlobalResponse("organization", response, "DeleteOrganization", "deleteOrganization");
|
|
84
|
+
return {
|
|
85
|
+
response: response === null || response === void 0 ? void 0 : response.data,
|
|
86
|
+
newUser: newUserInfo,
|
|
87
|
+
message: (_j = (_h = (_g = response === null || response === void 0 ? void 0 : response.data) === null || _g === void 0 ? void 0 : _g.result) === null || _h === void 0 ? void 0 : _h.friendly_message) !== null && _j !== void 0 ? _j : "Delete Organization Successfully",
|
|
88
|
+
status: "success",
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
return {
|
|
93
|
+
response: error.response,
|
|
94
|
+
newUser: null,
|
|
95
|
+
message: error.message,
|
|
96
|
+
status: "failed",
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
const CreateDocumentOrganization = (values, organizationId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
101
|
+
var _k, _l, _m;
|
|
102
|
+
let data = dataCreateDocumentOrganization(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
103
|
+
try {
|
|
104
|
+
const response = yield restApi_1.default.restApi(baseUrl, "POST", `${endPoint}/document/${organizationId}`, headerConfigDevice(), data);
|
|
105
|
+
let { newUserInfo } = checkGlobalResponse("organization", response, "CreateDocumentOrganization", "createDocumentOrganization");
|
|
106
|
+
return {
|
|
107
|
+
response: response === null || response === void 0 ? void 0 : response.data,
|
|
108
|
+
newUser: newUserInfo,
|
|
109
|
+
message: (_m = (_l = (_k = response === null || response === void 0 ? void 0 : response.data) === null || _k === void 0 ? void 0 : _k.result) === null || _l === void 0 ? void 0 : _l.friendly_message) !== null && _m !== void 0 ? _m : "Create Document Organization Successfully",
|
|
110
|
+
status: "success",
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
return {
|
|
115
|
+
response: error.response,
|
|
116
|
+
newUser: null,
|
|
117
|
+
message: error.message,
|
|
118
|
+
status: "failed",
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
return {
|
|
123
|
+
CreateOrganization,
|
|
124
|
+
UpdateOrganization,
|
|
125
|
+
DeleteOrganization,
|
|
126
|
+
CreateDocumentOrganization,
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
exports.useOrganization = useOrganization;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { UpdatePersonalInfoInterface, UpdateProfilePictureInterface } from "../interfaces/bankingSystemInterface";
|
|
2
|
+
import { IGeoCoordinates, UserInfo } from "../interfaces/interface";
|
|
3
|
+
export declare const usePersonalInfo: (token: string, userInfo: UserInfo, userId: string, baseUrl: string, geoCoordinates: IGeoCoordinates, lang?: string) => {
|
|
4
|
+
UpdatePersonalInfo: (values: UpdatePersonalInfoInterface) => Promise<{
|
|
5
|
+
response: import("axios").AxiosResponse<any, any>;
|
|
6
|
+
newUser: any;
|
|
7
|
+
message: any;
|
|
8
|
+
status: string;
|
|
9
|
+
} | {
|
|
10
|
+
response: any;
|
|
11
|
+
newUser: any;
|
|
12
|
+
message: any;
|
|
13
|
+
status: string;
|
|
14
|
+
}>;
|
|
15
|
+
UpdateProfilePicture: (values: UpdateProfilePictureInterface) => Promise<{
|
|
16
|
+
response: import("axios").AxiosResponse<any, any>;
|
|
17
|
+
newUser: any;
|
|
18
|
+
message: any;
|
|
19
|
+
status: string;
|
|
20
|
+
} | {
|
|
21
|
+
response: any;
|
|
22
|
+
newUser: any;
|
|
23
|
+
message: any;
|
|
24
|
+
status: string;
|
|
25
|
+
}>;
|
|
26
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
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.usePersonalInfo = void 0;
|
|
16
|
+
const dataStructure_1 = __importDefault(require("../helper/dataStructure"));
|
|
17
|
+
const helper_1 = __importDefault(require("../helper"));
|
|
18
|
+
const restApi_1 = __importDefault(require("../restApi"));
|
|
19
|
+
const usePersonalInfo = (token, userInfo, userId, baseUrl, geoCoordinates, lang) => {
|
|
20
|
+
const { dataPersonalInfo } = (0, dataStructure_1.default)();
|
|
21
|
+
const { updateDataPersonalInfo, updateProfilePicture } = dataPersonalInfo();
|
|
22
|
+
const { checkResponse, headerConfig } = (0, helper_1.default)(userInfo);
|
|
23
|
+
const { checkGlobalResponse, errorHandler } = checkResponse();
|
|
24
|
+
let endPoint = `v1/user/personal_info/${userId}`;
|
|
25
|
+
const headerConfigPersonalInfo = () => {
|
|
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 UpdatePersonalInfo = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
36
|
+
var _a, _b, _c;
|
|
37
|
+
const data = updateDataPersonalInfo(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
38
|
+
try {
|
|
39
|
+
const response = yield restApi_1.default.restApi(baseUrl, "PUT", endPoint, headerConfigPersonalInfo(), data);
|
|
40
|
+
let { newUserInfo } = checkGlobalResponse("personal_info", response, "UpdatePersonalInfo", "updateObjectInfo");
|
|
41
|
+
return {
|
|
42
|
+
response: response,
|
|
43
|
+
newUser: newUserInfo,
|
|
44
|
+
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 Info updated Successfully",
|
|
45
|
+
status: "success",
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
return {
|
|
50
|
+
response: error.response,
|
|
51
|
+
newUser: null,
|
|
52
|
+
message: error.message,
|
|
53
|
+
status: "failed",
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
const UpdateProfilePicture = (values) => __awaiter(void 0, void 0, void 0, function* () {
|
|
58
|
+
var _d, _e, _f, _g, _h;
|
|
59
|
+
const data = updateProfilePicture(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
|
|
60
|
+
let headersData = {
|
|
61
|
+
header: true,
|
|
62
|
+
isUrlEncoded: false,
|
|
63
|
+
token: (_d = values.token) !== null && _d !== void 0 ? _d : token,
|
|
64
|
+
lang: lang,
|
|
65
|
+
};
|
|
66
|
+
let headers = headerConfig(headersData);
|
|
67
|
+
try {
|
|
68
|
+
const response = yield restApi_1.default.restApi(baseUrl, "POST", `V1/User/document/${(_e = values.userId) !== null && _e !== void 0 ? _e : userId}`, headers, data);
|
|
69
|
+
let { newUserInfo } = checkGlobalResponse("personal_info", response, "UpdateProfilePicture", "updateProfilePicture");
|
|
70
|
+
return {
|
|
71
|
+
response: response,
|
|
72
|
+
newUser: newUserInfo,
|
|
73
|
+
message: (_h = (_g = (_f = response === null || response === void 0 ? void 0 : response.data) === null || _f === void 0 ? void 0 : _f.result) === null || _g === void 0 ? void 0 : _g.friendly_message) !== null && _h !== void 0 ? _h : "Picture Updated Successfully",
|
|
74
|
+
status: "success",
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
return {
|
|
79
|
+
response: error.response,
|
|
80
|
+
newUser: null,
|
|
81
|
+
message: error.message,
|
|
82
|
+
status: "failed",
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
return {
|
|
87
|
+
UpdatePersonalInfo,
|
|
88
|
+
UpdateProfilePicture,
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
exports.usePersonalInfo = usePersonalInfo;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { IGeoCoordinates, UserInfo } from "../interfaces/interface";
|
|
2
|
+
import { ConfirmLimitedPhoneInterface, CreateUserPhoneInterface, DeleteUserPhoneInterface, MakeUserPhonePrimaryInterface, UpdateUserPhoneInterface, VerifyLimitedPhoneInterface } from "../interfaces/bankingSystemInterface";
|
|
3
|
+
export declare const usePhone: (token: string, userInfo: UserInfo, userId: string, baseUrl: string, geoCoordinates: IGeoCoordinates, lang?: string) => {
|
|
4
|
+
CreateUserPhone: (values: CreateUserPhoneInterface) => Promise<{
|
|
5
|
+
response: import("axios").AxiosResponse<any, any>;
|
|
6
|
+
newUser: any;
|
|
7
|
+
message: any;
|
|
8
|
+
status: string;
|
|
9
|
+
} | {
|
|
10
|
+
response: any;
|
|
11
|
+
newUser: any;
|
|
12
|
+
message: any;
|
|
13
|
+
status: string;
|
|
14
|
+
}>;
|
|
15
|
+
DeleteUserPhone: (values: DeleteUserPhoneInterface) => Promise<{
|
|
16
|
+
response: import("axios").AxiosResponse<any, any>;
|
|
17
|
+
newUser: any;
|
|
18
|
+
message: any;
|
|
19
|
+
status: string;
|
|
20
|
+
} | {
|
|
21
|
+
response: any;
|
|
22
|
+
newUser: any;
|
|
23
|
+
message: any;
|
|
24
|
+
status: string;
|
|
25
|
+
}>;
|
|
26
|
+
VerifyUserPhone: (values: VerifyLimitedPhoneInterface) => Promise<{
|
|
27
|
+
response: import("axios").AxiosResponse<any, any>;
|
|
28
|
+
newUser: any;
|
|
29
|
+
message: string;
|
|
30
|
+
status: string;
|
|
31
|
+
} | {
|
|
32
|
+
response: any;
|
|
33
|
+
newUser: any;
|
|
34
|
+
message: any;
|
|
35
|
+
status: string;
|
|
36
|
+
}>;
|
|
37
|
+
ConfirmUserPhone: (values: ConfirmLimitedPhoneInterface) => Promise<{
|
|
38
|
+
response: import("axios").AxiosResponse<any, any>;
|
|
39
|
+
newUser: any;
|
|
40
|
+
message: any;
|
|
41
|
+
status: string;
|
|
42
|
+
} | {
|
|
43
|
+
response: any;
|
|
44
|
+
newUser: any;
|
|
45
|
+
message: any;
|
|
46
|
+
status: string;
|
|
47
|
+
}>;
|
|
48
|
+
UpdateUserPhone: (values: UpdateUserPhoneInterface) => Promise<{
|
|
49
|
+
response: import("axios").AxiosResponse<any, any>;
|
|
50
|
+
newUser: any;
|
|
51
|
+
message: any;
|
|
52
|
+
status: string;
|
|
53
|
+
} | {
|
|
54
|
+
response: any;
|
|
55
|
+
newUser: any;
|
|
56
|
+
message: any;
|
|
57
|
+
status: string;
|
|
58
|
+
}>;
|
|
59
|
+
MakeUserPhonePrimary: (values: MakeUserPhonePrimaryInterface) => Promise<{
|
|
60
|
+
response: import("axios").AxiosResponse<any, any>;
|
|
61
|
+
newUser: any;
|
|
62
|
+
message: any;
|
|
63
|
+
status: string;
|
|
64
|
+
} | {
|
|
65
|
+
response: any;
|
|
66
|
+
newUser: any;
|
|
67
|
+
message: any;
|
|
68
|
+
status: string;
|
|
69
|
+
}>;
|
|
70
|
+
};
|