ggez-banking-sdk 0.0.2 → 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 +10 -2
  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,212 +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.useDevice = 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 useDevice = (token, userInfo, userId, baseUrl, lang, geoCoordinates) => {
20
- const { checkResponse, headerConfig } = (0, helper_1.default)(userInfo);
21
- const { checkGlobalResponse } = checkResponse();
22
- const { dataDevice } = (0, dataStructure_1.default)();
23
- const { dataCreateDevice, dataUpdateDevice, dataDeleteDevice, dataVerifyDevice, dataConfirmDevice, dataLogoutDevice, } = dataDevice();
24
- let endPointDevice = `v1/user/device/${userId}`;
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 CreateDevice = (values, access_token, user_id) => __awaiter(void 0, void 0, void 0, function* () {
36
- var _a, _b, _c;
37
- let data = dataCreateDevice(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
38
- let headersData = {
39
- header: true,
40
- isUrlEncoded: false,
41
- token: access_token ? access_token : token,
42
- lang: lang,
43
- };
44
- let headers = headerConfig(headersData);
45
- try {
46
- const response = yield restApi_1.default.restApi(baseUrl, "POST", `v1/user/device/${user_id ? user_id : userId}`, headers, data);
47
- let { newUserInfo } = checkGlobalResponse("device", response, "CreateDevice", "create");
48
- return {
49
- response: response === null || response === void 0 ? void 0 : response.data,
50
- newUser: newUserInfo,
51
- 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 Device Successfully",
52
- status: "success",
53
- };
54
- }
55
- catch (error) {
56
- return {
57
- response: error.response,
58
- newUser: null,
59
- message: error.message,
60
- status: "failed",
61
- };
62
- }
63
- });
64
- const UpdateDevice = (values, access_token, user_id) => __awaiter(void 0, void 0, void 0, function* () {
65
- var _d, _e, _f;
66
- let data = dataUpdateDevice(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
67
- let headersData = {
68
- header: true,
69
- isUrlEncoded: false,
70
- token: access_token ? access_token : token,
71
- lang: lang,
72
- };
73
- let headers = headerConfig(headersData);
74
- try {
75
- const response = yield restApi_1.default.restApi(baseUrl, "PUT", `v1/user/device/${user_id ? user_id : userId}`, headers, data);
76
- let { newUserInfo } = checkGlobalResponse("device", response, "UpdateDevice", "update");
77
- return {
78
- response: response === null || response === void 0 ? void 0 : response.data,
79
- newUser: newUserInfo,
80
- 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 Device Successfully",
81
- status: "success",
82
- };
83
- }
84
- catch (error) {
85
- return {
86
- response: error.response,
87
- newUser: null,
88
- message: error.message,
89
- status: "failed",
90
- };
91
- }
92
- });
93
- const DeleteDevice = (values) => __awaiter(void 0, void 0, void 0, function* () {
94
- var _g, _h, _j;
95
- let data = dataDeleteDevice(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
96
- try {
97
- const response = yield restApi_1.default.restApi(baseUrl, "DELETE", `${endPointDevice}`, headerConfigDevice(), data);
98
- let { newUserInfo } = checkGlobalResponse("device", response, "DeleteDevice", "delete");
99
- return {
100
- response: response === null || response === void 0 ? void 0 : response.data,
101
- newUser: newUserInfo,
102
- 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 Device Successfully",
103
- status: "success",
104
- };
105
- }
106
- catch (error) {
107
- return {
108
- response: error.response,
109
- newUser: null,
110
- message: error.message,
111
- status: "failed",
112
- };
113
- }
114
- });
115
- const VerifyDevice = (values) => __awaiter(void 0, void 0, void 0, function* () {
116
- var _k, _l, _m;
117
- let data = dataVerifyDevice(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
118
- try {
119
- const response = yield restApi_1.default.restApi(baseUrl, "POST", `v1/user/security/verify/${userId}`, headerConfigDevice(), data);
120
- let { newUserInfo } = checkGlobalResponse("device", response, "VerifyDevice", "verify");
121
- return {
122
- response: response === null || response === void 0 ? void 0 : response.data,
123
- newUser: newUserInfo,
124
- 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 : "Verify Device Successfully",
125
- status: "success",
126
- };
127
- }
128
- catch (error) {
129
- return {
130
- response: error.response,
131
- newUser: null,
132
- message: error.message,
133
- status: "failed",
134
- };
135
- }
136
- });
137
- const ConfirmDevice = (values) => __awaiter(void 0, void 0, void 0, function* () {
138
- var _o, _p, _q;
139
- let data = dataConfirmDevice(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
140
- try {
141
- const response = yield restApi_1.default.restApi(baseUrl, "POST", `v1/user/security/confirm/${userId}`, headerConfigDevice(), data);
142
- let { newUserInfo } = checkGlobalResponse("device", response, "ConfirmDevice", "confirm");
143
- return {
144
- response: response === null || response === void 0 ? void 0 : response.data,
145
- newUser: newUserInfo,
146
- message: (_q = (_p = (_o = response === null || response === void 0 ? void 0 : response.data) === null || _o === void 0 ? void 0 : _o.result) === null || _p === void 0 ? void 0 : _p.friendly_message) !== null && _q !== void 0 ? _q : "Confirm Device Successfully",
147
- status: "success",
148
- };
149
- }
150
- catch (error) {
151
- return {
152
- response: error.response,
153
- newUser: null,
154
- message: error.message,
155
- status: "failed",
156
- };
157
- }
158
- });
159
- const GetUserDeviceLoginHistory = () => __awaiter(void 0, void 0, void 0, function* () {
160
- var _r, _s, _t;
161
- try {
162
- const response = yield restApi_1.default.restApi(baseUrl, "GET", `v1/user/device/history/${userId}`, headerConfigDevice());
163
- let { newUserInfo } = checkGlobalResponse("device", response, "GetUserDeviceLoginHistory", "GetUserDeviceLoginHistory");
164
- return {
165
- response: response === null || response === void 0 ? void 0 : response.data,
166
- newUser: newUserInfo,
167
- message: (_t = (_s = (_r = response === null || response === void 0 ? void 0 : response.data) === null || _r === void 0 ? void 0 : _r.result) === null || _s === void 0 ? void 0 : _s.friendly_message) !== null && _t !== void 0 ? _t : "Get User Device Login History Successfully",
168
- status: "success",
169
- };
170
- }
171
- catch (error) {
172
- return {
173
- response: error.response,
174
- newUser: null,
175
- message: error.message,
176
- status: "failed",
177
- };
178
- }
179
- });
180
- const LogoutDevice = (values) => __awaiter(void 0, void 0, void 0, function* () {
181
- var _u, _v, _w;
182
- let data = dataLogoutDevice(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
183
- try {
184
- const response = yield restApi_1.default.restApi(baseUrl, "PUT", `v1/user/device/logout/${userId}`, headerConfigDevice(), data);
185
- let { newUserInfo } = checkGlobalResponse("device", response, "LogoutDevice", "update");
186
- return {
187
- response: response === null || response === void 0 ? void 0 : response.data,
188
- newUser: newUserInfo,
189
- message: (_w = (_v = (_u = response === null || response === void 0 ? void 0 : response.data) === null || _u === void 0 ? void 0 : _u.result) === null || _v === void 0 ? void 0 : _v.friendly_message) !== null && _w !== void 0 ? _w : "Logout Device Successfully",
190
- status: "success",
191
- };
192
- }
193
- catch (error) {
194
- return {
195
- response: error.response,
196
- newUser: null,
197
- message: error.message,
198
- status: "failed",
199
- };
200
- }
201
- });
202
- return {
203
- CreateDevice,
204
- UpdateDevice,
205
- DeleteDevice,
206
- VerifyDevice,
207
- ConfirmDevice,
208
- GetUserDeviceLoginHistory,
209
- LogoutDevice,
210
- };
211
- };
212
- exports.useDevice = useDevice;
@@ -1,15 +0,0 @@
1
- import { CreateDocumentInterface } from "../interfaces/bankingSystemInterface";
2
- import { IGeoCoordinates, UserInfo } from "../interfaces/interface";
3
- export declare const useDocument: (token: string, userInfo: UserInfo, userId: string, baseUrl: string, geoCoordinates: IGeoCoordinates, lang?: string) => {
4
- CreateDocument: (values: CreateDocumentInterface) => 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
- };
@@ -1,58 +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.useDocument = void 0;
16
- const dataStructure_1 = __importDefault(require("../helper/dataStructure"));
17
- const restApi_1 = __importDefault(require("../restApi"));
18
- const helper_1 = __importDefault(require("../helper"));
19
- const useDocument = (token, userInfo, userId, baseUrl, geoCoordinates, lang) => {
20
- const { dataDocument } = (0, dataStructure_1.default)();
21
- const { checkResponse, headerConfig } = (0, helper_1.default)(userInfo);
22
- const { checkGlobalResponse } = checkResponse();
23
- let endPointDocument = `v1/user/document/${userId}`;
24
- // Document
25
- const CreateDocument = (values) => __awaiter(void 0, void 0, void 0, function* () {
26
- var _a, _b, _c, _d;
27
- const data = dataDocument(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
28
- let headersData = {
29
- header: true,
30
- isUrlEncoded: false,
31
- token: token,
32
- lang: lang,
33
- };
34
- let headers = headerConfig(headersData);
35
- try {
36
- const response = yield restApi_1.default.restApi(baseUrl, "POST", endPointDocument, headers, data);
37
- let { newUserInfo } = checkGlobalResponse((_a = data === null || data === void 0 ? void 0 : data.info) === null || _a === void 0 ? void 0 : _a.subject, response, "CreateDocument", "createDocument");
38
- return {
39
- response: response,
40
- newUser: newUserInfo,
41
- message: (_d = (_c = (_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b.result) === null || _c === void 0 ? void 0 : _c.friendly_message) !== null && _d !== void 0 ? _d : "Document Created Successfully",
42
- status: "success",
43
- };
44
- }
45
- catch (error) {
46
- return {
47
- response: error.response,
48
- newUser: null,
49
- message: error.message,
50
- status: "failed",
51
- };
52
- }
53
- });
54
- return {
55
- CreateDocument,
56
- };
57
- };
58
- exports.useDocument = useDocument;
@@ -1,70 +0,0 @@
1
- import { CreateUserEmailInterface, DeleteUserEmailInterface, UpdateUserEmailInterface, ConfirmLimitedEmailInterface, MakePrimaryUserEmailInterface, VerifyLimitedEmailInterface } from "../interfaces/bankingSystemInterface";
2
- import { IGeoCoordinates, UserInfo } from "../interfaces/interface";
3
- export declare const useEmail: (token: string, userInfo: UserInfo, userId: string, baseUrl: string, geoCoordinates: IGeoCoordinates, lang?: string) => {
4
- CreateUserEmail: (values: CreateUserEmailInterface) => 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
- DeleteUserEmail: (values: DeleteUserEmailInterface) => 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
- VerifyUserEmail: (values: VerifyLimitedEmailInterface) => 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
- ConfirmUserEmail: (values: ConfirmLimitedEmailInterface) => 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
- UpdateUserEmail: (values: UpdateUserEmailInterface) => 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
- MakeUserEmailPrimary: (values: MakePrimaryUserEmailInterface) => 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
- };
@@ -1,175 +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.useEmail = 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 useEmail = (token, userInfo, userId, baseUrl, geoCoordinates, lang) => {
20
- let endPointEmail = `v1/user/email/${userId}`;
21
- const { checkResponse, headerConfig } = (0, helper_1.default)(userInfo);
22
- const { checkGlobalResponse } = checkResponse();
23
- const { dataEmail } = (0, dataStructure_1.default)();
24
- const { confirmDataEmail, createDataEmail, deleteDataEmail, primaryDataEmail, updateDataEmail, verifyDataEmail, } = dataEmail();
25
- const headerConfigEmail = () => {
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 CreateUserEmail = (values) => __awaiter(void 0, void 0, void 0, function* () {
36
- var _a, _b, _c;
37
- let data = createDataEmail(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
38
- try {
39
- const response = yield restApi_1.default.restApi(baseUrl, "POST", endPointEmail, headerConfigEmail(), data);
40
- let { newUserInfo } = checkGlobalResponse("email", response, "CreateUserEmail", "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 : "Email 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 DeleteUserEmail = (values) => __awaiter(void 0, void 0, void 0, function* () {
58
- var _d, _e, _f;
59
- let data = deleteDataEmail(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
60
- try {
61
- const response = yield restApi_1.default.restApi(baseUrl, "DELETE", endPointEmail, headerConfigEmail(), data);
62
- let { newUserInfo } = checkGlobalResponse("email", response, "DeleteUserEmail", "delete");
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 : "Email Deleted 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 VerifyUserEmail = (values) => __awaiter(void 0, void 0, void 0, function* () {
80
- let data = verifyDataEmail(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
81
- try {
82
- const response = yield restApi_1.default.restApi(baseUrl, "POST", `v1/user/security/verify/${userId}`, headerConfigEmail(), data);
83
- let { newUserInfo } = checkGlobalResponse("email", response, "VerifyUserEmail");
84
- return {
85
- response: response,
86
- newUser: newUserInfo,
87
- message: "Verification Code Message Sent 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 ConfirmUserEmail = (values) => __awaiter(void 0, void 0, void 0, function* () {
101
- var _g, _h, _j;
102
- let data = confirmDataEmail(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
103
- try {
104
- const response = yield restApi_1.default.restApi(baseUrl, "POST", `v1/user/security/confirm/${userId}`, headerConfigEmail(), data);
105
- let { newUserInfo } = checkGlobalResponse("email", response, "ConfirmUserEmail", "confirm");
106
- return {
107
- response: response,
108
- newUser: newUserInfo,
109
- 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 : "Email Confirmed 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
- const UpdateUserEmail = (values) => __awaiter(void 0, void 0, void 0, function* () {
123
- var _k, _l, _m;
124
- let data = updateDataEmail(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
125
- try {
126
- const response = yield restApi_1.default.restApi(baseUrl, "PUT", endPointEmail, headerConfigEmail(), data);
127
- let { newUserInfo } = checkGlobalResponse("email", response, "UpdateUserEmail", "update");
128
- return {
129
- response: response,
130
- newUser: newUserInfo,
131
- 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 : "Email Updated Successfully",
132
- status: "success",
133
- };
134
- }
135
- catch (error) {
136
- return {
137
- response: error.response,
138
- newUser: null,
139
- message: error.message,
140
- status: "failed",
141
- };
142
- }
143
- });
144
- const MakeUserEmailPrimary = (values) => __awaiter(void 0, void 0, void 0, function* () {
145
- var _o, _p, _q;
146
- let data = primaryDataEmail(Object.assign(Object.assign({}, values), { geoCoordinates: geoCoordinates }));
147
- try {
148
- const response = yield restApi_1.default.restApi(baseUrl, "PUT", endPointEmail, headerConfigEmail(), data);
149
- let { newUserInfo } = checkGlobalResponse("email", response, "MakeUserEmailPrimary", "updatePrimary");
150
- return {
151
- response: response,
152
- newUser: newUserInfo,
153
- message: (_q = (_p = (_o = response === null || response === void 0 ? void 0 : response.data) === null || _o === void 0 ? void 0 : _o.result) === null || _p === void 0 ? void 0 : _p.friendly_message) !== null && _q !== void 0 ? _q : `${values.address} Now Is Primary`,
154
- status: "success",
155
- };
156
- }
157
- catch (error) {
158
- return {
159
- response: error.response,
160
- newUser: null,
161
- message: error.message,
162
- status: "failed",
163
- };
164
- }
165
- });
166
- return {
167
- CreateUserEmail,
168
- DeleteUserEmail,
169
- VerifyUserEmail,
170
- ConfirmUserEmail,
171
- UpdateUserEmail,
172
- MakeUserEmailPrimary,
173
- };
174
- };
175
- exports.useEmail = useEmail;
@@ -1,14 +0,0 @@
1
- import { UserInfo } from "../interfaces/interface";
2
- export declare const useGetUserLatest: (token: string, userInfo: UserInfo, userId: string, baseUrl: string, lang?: string) => {
3
- GetLatestByUserId: () => Promise<{
4
- response: import("axios").AxiosResponse<any, any>;
5
- newUser: {};
6
- message: any;
7
- status: string;
8
- } | {
9
- response: any;
10
- newUser: any;
11
- message: any;
12
- status: string;
13
- }>;
14
- };
@@ -1,55 +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.useGetUserLatest = void 0;
16
- const restApi_1 = __importDefault(require("../restApi"));
17
- const helper_1 = __importDefault(require("../helper"));
18
- const useGetUserLatest = (token, userInfo, userId, baseUrl, lang) => {
19
- const { checkResponse, headerConfig } = (0, helper_1.default)(userInfo);
20
- const { checkGlobalResponse } = checkResponse();
21
- let endPointAccount = `V1/user/history/latest`;
22
- const GetLatestByUserId = () => __awaiter(void 0, void 0, void 0, function* () {
23
- var _a, _b, _c;
24
- try {
25
- let endPoint = `${endPointAccount}/${userId}`;
26
- let headersData = {
27
- header: true,
28
- isUrlEncoded: false,
29
- token: token,
30
- lang: lang,
31
- };
32
- let headers = headerConfig(headersData);
33
- const response = yield restApi_1.default.restApi(baseUrl, "GET", endPoint, headers);
34
- checkGlobalResponse("history", response, "GetLatestByUserId");
35
- return {
36
- response: response,
37
- newUser: {},
38
- message: (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.friendly_message) !== null && _c !== void 0 ? _c : "Get User latest Successfully",
39
- status: "success",
40
- };
41
- }
42
- catch (error) {
43
- return {
44
- response: error.response,
45
- newUser: null,
46
- message: error.message,
47
- status: "failed",
48
- };
49
- }
50
- });
51
- return {
52
- GetLatestByUserId,
53
- };
54
- };
55
- exports.useGetUserLatest = useGetUserLatest;
@@ -1,37 +0,0 @@
1
- import { CreateIdentificationInterface, DeleteIdentificationInterface, UpdateIdentificationInterface } from "../interfaces/bankingSystemInterface";
2
- import { IGeoCoordinates, UserInfo } from "../interfaces/interface";
3
- export declare const useIdentification: (token: string, userInfo: UserInfo, userId: string, baseUrl: string, geoCoordinates: IGeoCoordinates, lang?: string) => {
4
- CreateIdentification: (values: CreateIdentificationInterface) => 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
- UpdateIdentification: (values: UpdateIdentificationInterface) => 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
- DeleteIdentification: (values: DeleteIdentificationInterface) => Promise<{
27
- response: import("axios").AxiosResponse<any, any>;
28
- newUser: any;
29
- message: any;
30
- status: string;
31
- } | {
32
- response: any;
33
- newUser: any;
34
- message: any;
35
- status: string;
36
- }>;
37
- };