ggez-banking-sdk 0.1.53 → 0.1.58

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.
@@ -1,16 +1,2 @@
1
- export declare const user_access_control_list: {
2
- resource: {
3
- name: string;
4
- is_allowed: boolean;
5
- }[];
6
- section: {
7
- resource: string;
8
- name: string;
9
- is_allowed: boolean;
10
- }[];
11
- action: {
12
- resource: string;
13
- name: string;
14
- is_allowed: boolean;
15
- }[];
16
- };
1
+ import { IUserAccessControl } from "../interfaces";
2
+ export declare const user_access_control: IUserAccessControl;
@@ -1,114 +1,247 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.user_access_control_list = void 0;
4
- exports.user_access_control_list = {
5
- resource: [
6
- { name: "home", is_allowed: true },
7
- { name: "profile", is_allowed: true },
8
- { name: "account", is_allowed: true },
9
- { name: "activity", is_allowed: true },
10
- { name: "referral", is_allowed: true },
11
- { name: "profile/home", is_allowed: true },
12
- { name: "profile/organization", is_allowed: true },
13
- { name: "profile/identification", is_allowed: true },
14
- { name: "profile/email", is_allowed: true },
15
- { name: "profile/phone", is_allowed: true },
16
- { name: "profile/address", is_allowed: true },
17
- { name: "profile/bank", is_allowed: true },
18
- { name: "profile/preferences", is_allowed: true },
19
- { name: "profile/security", is_allowed: true },
20
- { name: "profile/device", is_allowed: true },
21
- { name: "profile/account_activity", is_allowed: true },
22
- ],
23
- section: [
24
- { resource: "home", name: "accounts", is_allowed: true },
25
- { resource: "home", name: "next_step", is_allowed: true },
26
- { resource: "home", name: "increase_security", is_allowed: true },
27
- { resource: "account", name: "e-wallet", is_allowed: true },
28
- { resource: "account", name: "chain", is_allowed: true },
29
- { resource: "activity", name: "e-wallet", is_allowed: true },
30
- { resource: "activity", name: "chain", is_allowed: true },
3
+ exports.user_access_control = void 0;
4
+ exports.user_access_control = {
5
+ page: [
31
6
  {
32
- resource: "profile/account_activity",
33
- name: "login_history",
34
- is_allowed: true,
7
+ name: "home",
8
+ is_allowed: 1,
9
+ section: [
10
+ { name: "accounts", is_allowed: 1, action: [] },
11
+ { name: "next_step", is_allowed: 1, action: [] },
12
+ { name: "increase_security", is_allowed: 1, action: [] },
13
+ ],
35
14
  },
36
15
  {
37
- resource: "profile/account_activity",
38
- name: "security_operations",
39
- is_allowed: true,
16
+ name: "profile",
17
+ is_allowed: 1,
18
+ section: [],
19
+ },
20
+ {
21
+ name: "account",
22
+ is_allowed: 1,
23
+ section: [
24
+ {
25
+ name: "e-wallet",
26
+ is_allowed: 1,
27
+ action: [
28
+ { name: "deposit", is_allowed: 1 },
29
+ { name: "withdraw", is_allowed: 1 },
30
+ ],
31
+ },
32
+ {
33
+ name: "chain",
34
+ is_allowed: 1,
35
+ action: [
36
+ { name: "send", is_allowed: 0 },
37
+ { name: "receive", is_allowed: 1 },
38
+ { name: "buy", is_allowed: 1 },
39
+ { name: "sell", is_allowed: 1 },
40
+ { name: "stake", is_allowed: 0 },
41
+ { name: "unstake", is_allowed: 0 },
42
+ ],
43
+ },
44
+ ],
45
+ },
46
+ {
47
+ name: "activity",
48
+ is_allowed: 1,
49
+ section: [
50
+ {
51
+ name: "e-wallet",
52
+ is_allowed: 1,
53
+ action: [
54
+ { name: "submit", is_allowed: 1 },
55
+ { name: "reset", is_allowed: 1 },
56
+ ],
57
+ },
58
+ {
59
+ name: "chain",
60
+ is_allowed: 1,
61
+ action: [
62
+ { name: "submit", is_allowed: 1 },
63
+ { name: "reset", is_allowed: 1 },
64
+ ],
65
+ },
66
+ ],
67
+ },
68
+ {
69
+ name: "referral",
70
+ is_allowed: 1,
71
+ section: [],
72
+ },
73
+ {
74
+ name: "profile/home",
75
+ is_allowed: 1,
76
+ section: [],
77
+ },
78
+ {
79
+ name: "profile/organization",
80
+ is_allowed: 1,
81
+ section: [
82
+ {
83
+ name: "index",
84
+ is_allowed: 1,
85
+ action: [
86
+ { name: "create", is_allowed: 1 },
87
+ { name: "show", is_allowed: 1 },
88
+ { name: "edit", is_allowed: 1 },
89
+ { name: "delete", is_allowed: 1 },
90
+ { name: "verify", is_allowed: 1 },
91
+ { name: "make_primary", is_allowed: 1 },
92
+ ],
93
+ },
94
+ ],
95
+ },
96
+ {
97
+ name: "profile/identification",
98
+ is_allowed: 1,
99
+ section: [
100
+ {
101
+ name: "index",
102
+ is_allowed: 1,
103
+ action: [
104
+ { name: "create", is_allowed: 1 },
105
+ { name: "show", is_allowed: 1 },
106
+ { name: "edit", is_allowed: 1 },
107
+ { name: "delete", is_allowed: 1 },
108
+ { name: "verify", is_allowed: 1 },
109
+ { name: "make_primary", is_allowed: 1 },
110
+ ],
111
+ },
112
+ ],
113
+ },
114
+ {
115
+ name: "profile/email",
116
+ is_allowed: 1,
117
+ section: [
118
+ {
119
+ name: "index",
120
+ is_allowed: 1,
121
+ action: [
122
+ { name: "create", is_allowed: 1 },
123
+ { name: "show", is_allowed: 1 },
124
+ { name: "edit", is_allowed: 1 },
125
+ { name: "delete", is_allowed: 1 },
126
+ { name: "verify", is_allowed: 1 },
127
+ { name: "make_primary", is_allowed: 1 },
128
+ ],
129
+ },
130
+ ],
131
+ },
132
+ {
133
+ name: "profile/phone",
134
+ is_allowed: 1,
135
+ section: [
136
+ {
137
+ name: "index",
138
+ is_allowed: 1,
139
+ action: [
140
+ { name: "create", is_allowed: 1 },
141
+ { name: "show", is_allowed: 1 },
142
+ { name: "edit", is_allowed: 1 },
143
+ { name: "delete", is_allowed: 1 },
144
+ { name: "verify", is_allowed: 1 },
145
+ { name: "make_primary", is_allowed: 1 },
146
+ ],
147
+ },
148
+ ],
149
+ },
150
+ {
151
+ name: "profile/address",
152
+ is_allowed: 1,
153
+ section: [
154
+ {
155
+ name: "index",
156
+ is_allowed: 1,
157
+ action: [
158
+ { name: "create", is_allowed: 1 },
159
+ { name: "show", is_allowed: 1 },
160
+ { name: "edit", is_allowed: 1 },
161
+ { name: "delete", is_allowed: 1 },
162
+ { name: "verify", is_allowed: 1 },
163
+ { name: "make_primary", is_allowed: 1 },
164
+ ],
165
+ },
166
+ ],
167
+ },
168
+ {
169
+ name: "profile/bank",
170
+ is_allowed: 1,
171
+ section: [
172
+ {
173
+ name: "index",
174
+ is_allowed: 1,
175
+ action: [
176
+ { name: "create", is_allowed: 1 },
177
+ { name: "show", is_allowed: 1 },
178
+ { name: "edit", is_allowed: 1 },
179
+ { name: "delete", is_allowed: 1 },
180
+ { name: "verify", is_allowed: 1 },
181
+ { name: "make_primary", is_allowed: 1 },
182
+ ],
183
+ },
184
+ ],
185
+ },
186
+ {
187
+ name: "profile/preferences",
188
+ is_allowed: 1,
189
+ section: [
190
+ {
191
+ name: "index",
192
+ is_allowed: 1,
193
+ action: [{ name: "edit", is_allowed: 1 }],
194
+ },
195
+ ],
196
+ },
197
+ {
198
+ name: "profile/security",
199
+ is_allowed: 1,
200
+ section: [
201
+ {
202
+ name: "index",
203
+ is_allowed: 1,
204
+ action: [
205
+ { name: "password", is_allowed: 1 },
206
+ { name: "security_code", is_allowed: 1 },
207
+ { name: "security_questions", is_allowed: 1 },
208
+ { name: "authenticator_app", is_allowed: 1 },
209
+ ],
210
+ },
211
+ ],
212
+ },
213
+ {
214
+ name: "profile/device",
215
+ is_allowed: 1,
216
+ section: [
217
+ {
218
+ name: "index",
219
+ is_allowed: 1,
220
+ action: [
221
+ { name: "trust", is_allowed: 1 },
222
+ { name: "untrust", is_allowed: 1 },
223
+ { name: "logout_all", is_allowed: 1 },
224
+ { name: "logout", is_allowed: 1 },
225
+ { name: "delete", is_allowed: 1 },
226
+ ],
227
+ },
228
+ ],
229
+ },
230
+ {
231
+ name: "profile/account_activity",
232
+ is_allowed: 1,
233
+ section: [
234
+ {
235
+ name: "login_history",
236
+ is_allowed: 1,
237
+ action: [],
238
+ },
239
+ {
240
+ name: "security_operations",
241
+ is_allowed: 1,
242
+ action: [],
243
+ },
244
+ ],
40
245
  },
41
- ],
42
- action: [
43
- { resource: "account", name: "deposit", is_allowed: true },
44
- { resource: "account", name: "withdraw", is_allowed: true },
45
- { resource: "account", name: "send", is_allowed: false },
46
- { resource: "account", name: "receive", is_allowed: true },
47
- { resource: "account", name: "buy", is_allowed: true },
48
- { resource: "account", name: "sell", is_allowed: true },
49
- { resource: "account", name: "stake", is_allowed: false },
50
- { resource: "account", name: "unstake", is_allowed: false },
51
- { resource: "profile/organization", name: "create", is_allowed: true },
52
- { resource: "profile/organization", name: "show", is_allowed: true },
53
- { resource: "profile/organization", name: "edit", is_allowed: true },
54
- { resource: "profile/organization", name: "delete", is_allowed: true },
55
- { resource: "profile/organization", name: "verify", is_allowed: true },
56
- {
57
- resource: "profile/organization",
58
- name: "make_primary",
59
- is_allowed: true,
60
- },
61
- { resource: "profile/identification", name: "create", is_allowed: true },
62
- { resource: "profile/identification", name: "show", is_allowed: true },
63
- { resource: "profile/identification", name: "edit", is_allowed: true },
64
- { resource: "profile/identification", name: "delete", is_allowed: true },
65
- { resource: "profile/identification", name: "verify", is_allowed: true },
66
- {
67
- resource: "profile/identification",
68
- name: "make_primary",
69
- is_allowed: true,
70
- },
71
- { resource: "profile/email", name: "create", is_allowed: true },
72
- { resource: "profile/email", name: "show", is_allowed: true },
73
- { resource: "profile/email", name: "edit", is_allowed: true },
74
- { resource: "profile/email", name: "delete", is_allowed: true },
75
- { resource: "profile/email", name: "verify", is_allowed: true },
76
- { resource: "profile/email", name: "make_primary", is_allowed: true },
77
- { resource: "profile/phone", name: "create", is_allowed: true },
78
- { resource: "profile/phone", name: "show", is_allowed: true },
79
- { resource: "profile/phone", name: "edit", is_allowed: true },
80
- { resource: "profile/phone", name: "delete", is_allowed: true },
81
- { resource: "profile/phone", name: "verify", is_allowed: true },
82
- { resource: "profile/phone", name: "make_primary", is_allowed: true },
83
- { resource: "profile/address", name: "create", is_allowed: true },
84
- { resource: "profile/address", name: "show", is_allowed: true },
85
- { resource: "profile/address", name: "edit", is_allowed: true },
86
- { resource: "profile/address", name: "delete", is_allowed: true },
87
- { resource: "profile/address", name: "verify", is_allowed: true },
88
- { resource: "profile/address", name: "make_primary", is_allowed: true },
89
- { resource: "profile/bank", name: "create", is_allowed: true },
90
- { resource: "profile/bank", name: "show", is_allowed: true },
91
- { resource: "profile/bank", name: "edit", is_allowed: true },
92
- { resource: "profile/bank", name: "delete", is_allowed: true },
93
- { resource: "profile/bank", name: "verify", is_allowed: true },
94
- { resource: "profile/bank", name: "make_primary", is_allowed: true },
95
- { resource: "profile/preferences", name: "edit", is_allowed: true },
96
- { resource: "profile/security", name: "password", is_allowed: true },
97
- { resource: "profile/security", name: "security_code", is_allowed: true },
98
- {
99
- resource: "profile/security",
100
- name: "security_questions",
101
- is_allowed: true,
102
- },
103
- {
104
- resource: "profile/security",
105
- name: "authenticator_app",
106
- is_allowed: true,
107
- },
108
- { resource: "profile/device", name: "trust", is_allowed: true },
109
- { resource: "profile/device", name: "untrust", is_allowed: true },
110
- { resource: "profile/device", name: "logout_all", is_allowed: true },
111
- { resource: "profile/device", name: "logout", is_allowed: true },
112
- { resource: "profile/device", name: "delete", is_allowed: true },
113
246
  ],
114
247
  };
@@ -126,7 +126,7 @@ const Data = () => {
126
126
  const dataSignUpApi = (values) => {
127
127
  const client = new clientjs_1.ClientJS();
128
128
  const customField = {
129
- user_access_control: acl_1.user_access_control_list,
129
+ user_access_control: acl_1.user_access_control,
130
130
  };
131
131
  if (values.referralCode && values.referralCodeType) {
132
132
  if (!customField.promotion_data) {
@@ -144,10 +144,21 @@ const Data = () => {
144
144
  customField.promotion_data = {};
145
145
  }
146
146
  customField.promotion_data.gift_data = [values.giftData];
147
- customField.user_access_control.action =
148
- acl_1.user_access_control_list.action.map((e) => {
149
- if (e.name == "send") {
150
- e.is_allowed = true;
147
+ customField.user_access_control.page =
148
+ customField.user_access_control.page.map((e) => {
149
+ if (e.name == "account") {
150
+ const section = e.section.map((e) => {
151
+ if (e.name == "chain") {
152
+ e.action = e.action.map((e) => {
153
+ if (e.name == "send") {
154
+ e.is_allowed = 1;
155
+ }
156
+ return e;
157
+ });
158
+ }
159
+ return e;
160
+ });
161
+ return { ...e, section };
151
162
  }
152
163
  return e;
153
164
  });
@@ -264,7 +275,7 @@ const Data = () => {
264
275
  const dataSignUpWithGoogle = (values) => {
265
276
  const client = new clientjs_1.ClientJS();
266
277
  const customField = {
267
- user_access_control: acl_1.user_access_control_list,
278
+ user_access_control: acl_1.user_access_control,
268
279
  };
269
280
  if (values.referralCode && values.referralCodeType) {
270
281
  if (!customField.promotion_data) {
@@ -282,10 +293,21 @@ const Data = () => {
282
293
  customField.promotion_data = {};
283
294
  }
284
295
  customField.promotion_data.gift_data = [values.giftData];
285
- customField.user_access_control.action =
286
- acl_1.user_access_control_list.action.map((e) => {
287
- if (e.name == "send") {
288
- e.is_allowed = true;
296
+ customField.user_access_control.page =
297
+ customField.user_access_control.page.map((e) => {
298
+ if (e.name == "account") {
299
+ const section = e.section.map((e) => {
300
+ if (e.name == "chain") {
301
+ e.action = e.action.map((e) => {
302
+ if (e.name == "send") {
303
+ e.is_allowed = 1;
304
+ }
305
+ return e;
306
+ });
307
+ }
308
+ return e;
309
+ });
310
+ return { ...e, section };
289
311
  }
290
312
  return e;
291
313
  });
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const sortUserInfo_1 = require("../utils/sortUserInfo");
7
7
  const generateSourceId_1 = require("../utils/generateSourceId");
8
8
  const restApi_1 = __importDefault(require("../restApi"));
9
- //import { fingerPrintHandler } from "../utils/info";
10
9
  const qs_1 = __importDefault(require("qs"));
11
10
  const enum_1 = require("../constants/enum");
12
11
  const fillDeviceDetails_1 = require("../utils/fillDeviceDetails");
@@ -98,7 +98,7 @@ export interface LimitedTokenInterface {
98
98
  }
99
99
  export interface CustomField {
100
100
  promotion_data?: PromotionData;
101
- user_access_control: AccessControlPolicy;
101
+ user_access_control: IUserAccessControl;
102
102
  }
103
103
  export interface PromotionData {
104
104
  referral_data?: ReferralData;
@@ -108,19 +108,21 @@ export interface ReferralData {
108
108
  code: string;
109
109
  type: number;
110
110
  }
111
- export interface AccessControlPolicy {
112
- resource: {
113
- name: string;
114
- is_allowed: boolean;
115
- }[];
116
- section: {
117
- resource: string;
118
- name: string;
119
- is_allowed: boolean;
120
- }[];
121
- action: {
122
- resource: string;
123
- name: string;
124
- is_allowed: boolean;
125
- }[];
111
+ interface IPage {
112
+ name: string;
113
+ is_allowed: number;
114
+ section: ISection[];
126
115
  }
116
+ interface ISection {
117
+ name: string;
118
+ is_allowed: number;
119
+ action: IAction[];
120
+ }
121
+ interface IAction {
122
+ name: string;
123
+ is_allowed: number;
124
+ }
125
+ export interface IUserAccessControl {
126
+ page: IPage[];
127
+ }
128
+ export {};
@@ -1 +1 @@
1
- {"root":["../src/index.ts","../src/bank-system/constants/acl.ts","../src/bank-system/constants/constants.ts","../src/bank-system/constants/enum.ts","../src/bank-system/constants/index.ts","../src/bank-system/constants/structure.ts","../src/bank-system/content/accountCurrencies.ts","../src/bank-system/content/countries.ts","../src/bank-system/content/currencies.ts","../src/bank-system/content/index.ts","../src/bank-system/content/state.ts","../src/bank-system/helper/data.tsx","../src/bank-system/helper/dataStructure.tsx","../src/bank-system/helper/index.tsx","../src/bank-system/interfaces/accountInterface.ts","../src/bank-system/interfaces/bankingSystemInterface.ts","../src/bank-system/interfaces/blockchain.ts","../src/bank-system/interfaces/commonInterface.ts","../src/bank-system/interfaces/deviceInterface.ts","../src/bank-system/interfaces/index.ts","../src/bank-system/interfaces/interface.ts","../src/bank-system/interfaces/organizationInterface.ts","../src/bank-system/interfaces/promotion.ts","../src/bank-system/interfaces/signInterface.ts","../src/bank-system/interfaces/transactionInterface.ts","../src/bank-system/restApi/index.tsx","../src/bank-system/services/account.ts","../src/bank-system/services/addresses.ts","../src/bank-system/services/auth.ts","../src/bank-system/services/bankAccount.ts","../src/bank-system/services/blockchain.ts","../src/bank-system/services/device.ts","../src/bank-system/services/document.ts","../src/bank-system/services/email.ts","../src/bank-system/services/history.ts","../src/bank-system/services/identification.ts","../src/bank-system/services/index.ts","../src/bank-system/services/organization.ts","../src/bank-system/services/personalInfo.ts","../src/bank-system/services/phone.ts","../src/bank-system/services/security.ts","../src/bank-system/services/ticket.ts","../src/bank-system/services/token.ts","../src/bank-system/services/transaction.ts","../src/bank-system/services/verifyAndConfirm.ts","../src/bank-system/utils/blockchainHelper.ts","../src/bank-system/utils/chainAddressMasking.ts","../src/bank-system/utils/copyText.ts","../src/bank-system/utils/countryAndCurrencyData.ts","../src/bank-system/utils/enumToOption.ts","../src/bank-system/utils/fillDeviceDetails.ts","../src/bank-system/utils/generateOneLiner.ts","../src/bank-system/utils/generateSourceId.ts","../src/bank-system/utils/getCountryName.ts","../src/bank-system/utils/getEnumName.ts","../src/bank-system/utils/getStateByCountryCode.ts","../src/bank-system/utils/index.ts","../src/bank-system/utils/info.ts","../src/bank-system/utils/maskingFunction.ts","../src/bank-system/utils/regex.ts","../src/bank-system/utils/sortUserInfo.ts","../src/bank-system/utils/handleEncryption/decryptData.tsx","../src/bank-system/utils/handleEncryption/encryptData.tsx","../src/bank-system/utils/handleEncryption/index.ts","../src/bank-system/utils/handleEncryption/key.ts","../src/keplr-config/chainInfo.ts"],"version":"5.8.3"}
1
+ {"root":["../src/index.ts","../src/bank-system/constants/acl.ts","../src/bank-system/constants/constants.ts","../src/bank-system/constants/enum.ts","../src/bank-system/constants/index.ts","../src/bank-system/constants/structure.ts","../src/bank-system/content/accountCurrencies.ts","../src/bank-system/content/countries.ts","../src/bank-system/content/currencies.ts","../src/bank-system/content/index.ts","../src/bank-system/content/state.ts","../src/bank-system/helper/data.ts","../src/bank-system/helper/dataStructure.tsx","../src/bank-system/helper/index.tsx","../src/bank-system/interfaces/accountInterface.ts","../src/bank-system/interfaces/bankingSystemInterface.ts","../src/bank-system/interfaces/blockchain.ts","../src/bank-system/interfaces/commonInterface.ts","../src/bank-system/interfaces/deviceInterface.ts","../src/bank-system/interfaces/index.ts","../src/bank-system/interfaces/interface.ts","../src/bank-system/interfaces/organizationInterface.ts","../src/bank-system/interfaces/promotion.ts","../src/bank-system/interfaces/signInterface.ts","../src/bank-system/interfaces/transactionInterface.ts","../src/bank-system/restApi/index.tsx","../src/bank-system/services/account.ts","../src/bank-system/services/addresses.ts","../src/bank-system/services/auth.ts","../src/bank-system/services/bankAccount.ts","../src/bank-system/services/blockchain.ts","../src/bank-system/services/device.ts","../src/bank-system/services/document.ts","../src/bank-system/services/email.ts","../src/bank-system/services/history.ts","../src/bank-system/services/identification.ts","../src/bank-system/services/index.ts","../src/bank-system/services/organization.ts","../src/bank-system/services/personalInfo.ts","../src/bank-system/services/phone.ts","../src/bank-system/services/security.ts","../src/bank-system/services/ticket.ts","../src/bank-system/services/token.ts","../src/bank-system/services/transaction.ts","../src/bank-system/services/verifyAndConfirm.ts","../src/bank-system/utils/blockchainHelper.ts","../src/bank-system/utils/chainAddressMasking.ts","../src/bank-system/utils/copyText.ts","../src/bank-system/utils/countryAndCurrencyData.ts","../src/bank-system/utils/enumToOption.ts","../src/bank-system/utils/fillDeviceDetails.ts","../src/bank-system/utils/generateOneLiner.ts","../src/bank-system/utils/generateSourceId.ts","../src/bank-system/utils/getCountryName.ts","../src/bank-system/utils/getEnumName.ts","../src/bank-system/utils/getStateByCountryCode.ts","../src/bank-system/utils/index.ts","../src/bank-system/utils/info.ts","../src/bank-system/utils/maskingFunction.ts","../src/bank-system/utils/regex.ts","../src/bank-system/utils/sortUserInfo.ts","../src/bank-system/utils/handleEncryption/decryptData.tsx","../src/bank-system/utils/handleEncryption/encryptData.tsx","../src/bank-system/utils/handleEncryption/index.ts","../src/bank-system/utils/handleEncryption/key.ts","../src/keplr-config/chainInfo.ts"],"version":"5.8.3"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ggez-banking-sdk",
3
- "version": "0.1.53",
3
+ "version": "0.1.58",
4
4
  "description": "A Node.js package to handle GGEZ Banking API endpoints, Simplify the process of managing CRUD operations with this efficient and easy-to-use package.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",