ggez-banking-sdk 0.1.49 → 0.1.51

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.
@@ -0,0 +1,16 @@
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
+ };
@@ -0,0 +1,113 @@
1
+ "use strict";
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: "chain", is_allowed: true },
28
+ { resource: "activity", name: "e-wallet", is_allowed: true },
29
+ { resource: "activity", name: "chain", is_allowed: true },
30
+ {
31
+ resource: "profile/account_activity",
32
+ name: "login_history",
33
+ is_allowed: true,
34
+ },
35
+ {
36
+ resource: "profile/account_activity",
37
+ name: "security_operations",
38
+ is_allowed: true,
39
+ },
40
+ ],
41
+ action: [
42
+ { resource: "account", name: "deposit", is_allowed: true },
43
+ { resource: "account", name: "withdraw", is_allowed: true },
44
+ { resource: "account", name: "send", is_allowed: false },
45
+ { resource: "account", name: "receive", is_allowed: true },
46
+ { resource: "account", name: "buy", is_allowed: true },
47
+ { resource: "account", name: "sell", is_allowed: true },
48
+ { resource: "account", name: "stake", is_allowed: false },
49
+ { resource: "account", name: "unstake", is_allowed: false },
50
+ { resource: "profile/organization", name: "create", is_allowed: true },
51
+ { resource: "profile/organization", name: "show", is_allowed: true },
52
+ { resource: "profile/organization", name: "edit", is_allowed: true },
53
+ { resource: "profile/organization", name: "delete", is_allowed: true },
54
+ { resource: "profile/organization", name: "verify", is_allowed: true },
55
+ {
56
+ resource: "profile/organization",
57
+ name: "make_primary",
58
+ is_allowed: true,
59
+ },
60
+ { resource: "profile/identification", name: "create", is_allowed: true },
61
+ { resource: "profile/identification", name: "show", is_allowed: true },
62
+ { resource: "profile/identification", name: "edit", is_allowed: true },
63
+ { resource: "profile/identification", name: "delete", is_allowed: true },
64
+ { resource: "profile/identification", name: "verify", is_allowed: true },
65
+ {
66
+ resource: "profile/identification",
67
+ name: "make_primary",
68
+ is_allowed: true,
69
+ },
70
+ { resource: "profile/email", name: "create", is_allowed: true },
71
+ { resource: "profile/email", name: "show", is_allowed: true },
72
+ { resource: "profile/email", name: "edit", is_allowed: true },
73
+ { resource: "profile/email", name: "delete", is_allowed: true },
74
+ { resource: "profile/email", name: "verify", is_allowed: true },
75
+ { resource: "profile/email", name: "make_primary", is_allowed: true },
76
+ { resource: "profile/phone", name: "create", is_allowed: true },
77
+ { resource: "profile/phone", name: "show", is_allowed: true },
78
+ { resource: "profile/phone", name: "edit", is_allowed: true },
79
+ { resource: "profile/phone", name: "delete", is_allowed: true },
80
+ { resource: "profile/phone", name: "verify", is_allowed: true },
81
+ { resource: "profile/phone", name: "make_primary", is_allowed: true },
82
+ { resource: "profile/address", name: "create", is_allowed: true },
83
+ { resource: "profile/address", name: "show", is_allowed: true },
84
+ { resource: "profile/address", name: "edit", is_allowed: true },
85
+ { resource: "profile/address", name: "delete", is_allowed: true },
86
+ { resource: "profile/address", name: "verify", is_allowed: true },
87
+ { resource: "profile/address", name: "make_primary", is_allowed: true },
88
+ { resource: "profile/bank", name: "create", is_allowed: true },
89
+ { resource: "profile/bank", name: "show", is_allowed: true },
90
+ { resource: "profile/bank", name: "edit", is_allowed: true },
91
+ { resource: "profile/bank", name: "delete", is_allowed: true },
92
+ { resource: "profile/bank", name: "verify", is_allowed: true },
93
+ { resource: "profile/bank", name: "make_primary", is_allowed: true },
94
+ { resource: "profile/preferences", name: "edit", is_allowed: true },
95
+ { resource: "profile/security", name: "password", is_allowed: true },
96
+ { resource: "profile/security", name: "security_code", is_allowed: true },
97
+ {
98
+ resource: "profile/security",
99
+ name: "security_questions",
100
+ is_allowed: true,
101
+ },
102
+ {
103
+ resource: "profile/security",
104
+ name: "authenticator_app",
105
+ is_allowed: true,
106
+ },
107
+ { resource: "profile/device", name: "trust", is_allowed: true },
108
+ { resource: "profile/device", name: "untrust", is_allowed: true },
109
+ { resource: "profile/device", name: "logout_all", is_allowed: true },
110
+ { resource: "profile/device", name: "logout", is_allowed: true },
111
+ { resource: "profile/device", name: "delete", is_allowed: true },
112
+ ],
113
+ };
@@ -12,6 +12,7 @@ const timezone_1 = __importDefault(require("dayjs/plugin/timezone"));
12
12
  const utils_1 = require("../utils");
13
13
  const structure_1 = require("../constants/structure");
14
14
  const constants_1 = require("../constants");
15
+ const acl_1 = require("../constants/acl");
15
16
  dayjs_1.default.extend(utc_1.default);
16
17
  dayjs_1.default.extend(timezone_1.default);
17
18
  const Data = () => {
@@ -124,21 +125,32 @@ const Data = () => {
124
125
  };
125
126
  const dataSignUpApi = (values) => {
126
127
  const client = new clientjs_1.ClientJS();
127
- let customField = null;
128
+ const customField = {
129
+ user_access_control: acl_1.user_access_control_list,
130
+ };
128
131
  if (values.referralCode && values.referralCodeType) {
129
- if (!customField) {
130
- customField = { promotion_data: {} };
132
+ if (!customField.promotion_data) {
133
+ customField.promotion_data = {};
131
134
  }
132
- customField.promotion_data.referral_data = {
133
- code: values.referralCode,
134
- type: +values.referralCodeType,
135
+ customField.promotion_data = {
136
+ referral_data: {
137
+ code: values.referralCode,
138
+ type: +values.referralCodeType,
139
+ },
135
140
  };
136
141
  }
137
142
  if (values.giftData) {
138
- if (!customField) {
139
- customField = { promotion_data: {} };
143
+ if (!customField.promotion_data) {
144
+ customField.promotion_data = {};
140
145
  }
141
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;
151
+ }
152
+ return e;
153
+ });
142
154
  }
143
155
  let authentication = [];
144
156
  if (values.mobileAuthenticationCode &&
@@ -97,7 +97,7 @@ export interface LimitedTokenInterface {
97
97
  geoCoordinates?: IGeoCoordinates | null;
98
98
  }
99
99
  export interface CustomField {
100
- promotion_data: PromotionData;
100
+ promotion_data?: PromotionData;
101
101
  user_access_control: AccessControlPolicy;
102
102
  }
103
103
  export interface PromotionData {
@@ -111,17 +111,16 @@ export interface ReferralData {
111
111
  export interface AccessControlPolicy {
112
112
  resource: {
113
113
  name: string;
114
- can: boolean;
114
+ is_allowed: boolean;
115
115
  }[];
116
116
  section: {
117
117
  resource: string;
118
118
  name: string;
119
- can: boolean;
119
+ is_allowed: boolean;
120
120
  }[];
121
121
  action: {
122
122
  resource: string;
123
- section?: string;
124
123
  name: string;
125
- can: boolean;
124
+ is_allowed: boolean;
126
125
  }[];
127
126
  }
@@ -1 +1 @@
1
- {"root":["../src/index.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.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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ggez-banking-sdk",
3
- "version": "0.1.49",
3
+ "version": "0.1.51",
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",