ggez-banking-sdk 0.0.3 → 0.0.4

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.
Files changed (116) hide show
  1. package/package.json +9 -1
  2. package/README.md +0 -0
  3. package/dist/bank-system/constants/enum.d.ts +0 -1057
  4. package/dist/bank-system/constants/enum.js +0 -1110
  5. package/dist/bank-system/constants/index.d.ts +0 -1
  6. package/dist/bank-system/constants/index.js +0 -17
  7. package/dist/bank-system/content/accountCurrencies.d.ts +0 -12
  8. package/dist/bank-system/content/accountCurrencies.js +0 -37
  9. package/dist/bank-system/content/countries.d.ts +0 -24
  10. package/dist/bank-system/content/countries.js +0 -6472
  11. package/dist/bank-system/content/currencies.d.ts +0 -32
  12. package/dist/bank-system/content/currencies.js +0 -5836
  13. package/dist/bank-system/content/index.d.ts +0 -4
  14. package/dist/bank-system/content/index.js +0 -12
  15. package/dist/bank-system/content/state.d.ts +0 -6
  16. package/dist/bank-system/content/state.js +0 -350
  17. package/dist/bank-system/helper/data.d.ts +0 -46
  18. package/dist/bank-system/helper/data.js +0 -57
  19. package/dist/bank-system/helper/dataStructure.d.ts +0 -3220
  20. package/dist/bank-system/helper/dataStructure.js +0 -1051
  21. package/dist/bank-system/helper/index.d.ts +0 -28
  22. package/dist/bank-system/helper/index.js +0 -394
  23. package/dist/bank-system/interfaces/accountInterface.d.ts +0 -26
  24. package/dist/bank-system/interfaces/accountInterface.js +0 -2
  25. package/dist/bank-system/interfaces/bankingSystemInterface.d.ts +0 -306
  26. package/dist/bank-system/interfaces/bankingSystemInterface.js +0 -2
  27. package/dist/bank-system/interfaces/deviceInterface.d.ts +0 -34
  28. package/dist/bank-system/interfaces/deviceInterface.js +0 -2
  29. package/dist/bank-system/interfaces/index.d.ts +0 -4
  30. package/dist/bank-system/interfaces/index.js +0 -20
  31. package/dist/bank-system/interfaces/interface.d.ts +0 -460
  32. package/dist/bank-system/interfaces/interface.js +0 -2
  33. package/dist/bank-system/interfaces/organizationInterface.d.ts +0 -118
  34. package/dist/bank-system/interfaces/organizationInterface.js +0 -2
  35. package/dist/bank-system/interfaces/signInterface.d.ts +0 -89
  36. package/dist/bank-system/interfaces/signInterface.js +0 -2
  37. package/dist/bank-system/interfaces/transactionInterface.d.ts +0 -17
  38. package/dist/bank-system/interfaces/transactionInterface.js +0 -2
  39. package/dist/bank-system/restApi/index.d.ts +0 -8
  40. package/dist/bank-system/restApi/index.js +0 -41
  41. package/dist/bank-system/services/account.d.ts +0 -33
  42. package/dist/bank-system/services/account.js +0 -129
  43. package/dist/bank-system/services/addresses.d.ts +0 -48
  44. package/dist/bank-system/services/addresses.js +0 -130
  45. package/dist/bank-system/services/auth.d.ts +0 -71
  46. package/dist/bank-system/services/auth.js +0 -250
  47. package/dist/bank-system/services/bankAccount.d.ts +0 -48
  48. package/dist/bank-system/services/bankAccount.js +0 -131
  49. package/dist/bank-system/services/device.d.ts +0 -46
  50. package/dist/bank-system/services/device.js +0 -212
  51. package/dist/bank-system/services/document.d.ts +0 -15
  52. package/dist/bank-system/services/document.js +0 -58
  53. package/dist/bank-system/services/email.d.ts +0 -70
  54. package/dist/bank-system/services/email.js +0 -175
  55. package/dist/bank-system/services/history.d.ts +0 -14
  56. package/dist/bank-system/services/history.js +0 -55
  57. package/dist/bank-system/services/identification.d.ts +0 -37
  58. package/dist/bank-system/services/identification.js +0 -107
  59. package/dist/bank-system/services/index.d.ts +0 -17
  60. package/dist/bank-system/services/index.js +0 -35
  61. package/dist/bank-system/services/organization.d.ts +0 -28
  62. package/dist/bank-system/services/organization.js +0 -129
  63. package/dist/bank-system/services/personalInfo.d.ts +0 -26
  64. package/dist/bank-system/services/personalInfo.js +0 -91
  65. package/dist/bank-system/services/phone.d.ts +0 -70
  66. package/dist/bank-system/services/phone.js +0 -175
  67. package/dist/bank-system/services/security.d.ts +0 -114
  68. package/dist/bank-system/services/security.js +0 -267
  69. package/dist/bank-system/services/token.d.ts +0 -11
  70. package/dist/bank-system/services/token.js +0 -83
  71. package/dist/bank-system/services/transaction.d.ts +0 -9
  72. package/dist/bank-system/services/transaction.js +0 -62
  73. package/dist/bank-system/services/verifyAndConfirm.d.ts +0 -116
  74. package/dist/bank-system/services/verifyAndConfirm.js +0 -308
  75. package/dist/bank-system/utils/chainAddressMasking.d.ts +0 -2
  76. package/dist/bank-system/utils/chainAddressMasking.js +0 -12
  77. package/dist/bank-system/utils/copyText.d.ts +0 -5
  78. package/dist/bank-system/utils/copyText.js +0 -22
  79. package/dist/bank-system/utils/countryAndCurrencyData.d.ts +0 -11
  80. package/dist/bank-system/utils/countryAndCurrencyData.js +0 -22
  81. package/dist/bank-system/utils/enumToOption.d.ts +0 -4
  82. package/dist/bank-system/utils/enumToOption.js +0 -18
  83. package/dist/bank-system/utils/fillDeviceDetails.d.ts +0 -23
  84. package/dist/bank-system/utils/fillDeviceDetails.js +0 -44
  85. package/dist/bank-system/utils/generateOneLiner.d.ts +0 -1
  86. package/dist/bank-system/utils/generateOneLiner.js +0 -17
  87. package/dist/bank-system/utils/generateSourceId.d.ts +0 -1
  88. package/dist/bank-system/utils/generateSourceId.js +0 -13
  89. package/dist/bank-system/utils/getCountryName.d.ts +0 -1
  90. package/dist/bank-system/utils/getCountryName.js +0 -16
  91. package/dist/bank-system/utils/getEnumName.d.ts +0 -1
  92. package/dist/bank-system/utils/getEnumName.js +0 -10
  93. package/dist/bank-system/utils/getStateByCountryCode.d.ts +0 -1
  94. package/dist/bank-system/utils/getStateByCountryCode.js +0 -15
  95. package/dist/bank-system/utils/handleEncryption/decryptData.d.ts +0 -15
  96. package/dist/bank-system/utils/handleEncryption/decryptData.js +0 -78
  97. package/dist/bank-system/utils/handleEncryption/encryptData.d.ts +0 -2
  98. package/dist/bank-system/utils/handleEncryption/encryptData.js +0 -37
  99. package/dist/bank-system/utils/handleEncryption/index.d.ts +0 -4
  100. package/dist/bank-system/utils/handleEncryption/index.js +0 -12
  101. package/dist/bank-system/utils/handleEncryption/key.d.ts +0 -13
  102. package/dist/bank-system/utils/handleEncryption/key.js +0 -40
  103. package/dist/bank-system/utils/index.d.ts +0 -15
  104. package/dist/bank-system/utils/index.js +0 -42
  105. package/dist/bank-system/utils/info.d.ts +0 -8
  106. package/dist/bank-system/utils/info.js +0 -79
  107. package/dist/bank-system/utils/maskingFunction.d.ts +0 -1
  108. package/dist/bank-system/utils/maskingFunction.js +0 -28
  109. package/dist/bank-system/utils/regex.d.ts +0 -106
  110. package/dist/bank-system/utils/regex.js +0 -110
  111. package/dist/bank-system/utils/sortUserInfo.d.ts +0 -1
  112. package/dist/bank-system/utils/sortUserInfo.js +0 -43
  113. package/dist/index.d.ts +0 -8
  114. package/dist/index.js +0 -54
  115. package/dist/keplr-config/chainInfo.d.ts +0 -8
  116. package/dist/keplr-config/chainInfo.js +0 -111
@@ -1,107 +0,0 @@
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;
@@ -1,17 +0,0 @@
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, };
@@ -1,35 +0,0 @@
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; } });
@@ -1,28 +0,0 @@
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
- };
@@ -1,129 +0,0 @@
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;
@@ -1,26 +0,0 @@
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
- };
@@ -1,91 +0,0 @@
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;
@@ -1,70 +0,0 @@
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
- };