@cranberry-money/shared-constants 5.1.0 → 5.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/auth.js +18 -21
- package/dist/api/config.js +4 -7
- package/dist/api/endpoints.js +28 -31
- package/dist/api/http.js +6 -9
- package/dist/api/index.js +4 -20
- package/dist/business/accounts.js +34 -37
- package/dist/business/bank-accounts.js +51 -55
- package/dist/business/banking.js +26 -29
- package/dist/business/countries.js +3 -6
- package/dist/business/documents.js +38 -41
- package/dist/business/index.js +12 -74
- package/dist/business/industries.js +2 -5
- package/dist/business/investments.js +53 -56
- package/dist/business/status/banks.js +11 -14
- package/dist/business/status/cash-accounts.js +33 -36
- package/dist/business/status/documents.js +19 -22
- package/dist/business/status/index.js +7 -23
- package/dist/business/status/instruments.js +21 -24
- package/dist/business/status/portfolios.js +5 -8
- package/dist/business/status/trades.js +65 -68
- package/dist/business/status/withdrawals.js +77 -80
- package/dist/business/trading.js +23 -26
- package/dist/financial/currency.js +42 -45
- package/dist/financial/formatting.js +9 -12
- package/dist/financial/index.js +3 -19
- package/dist/financial/instruments.js +25 -28
- package/dist/index.js +5 -21
- package/dist/ui/colors.js +37 -41
- package/dist/ui/display.js +20 -23
- package/dist/ui/index.js +3 -19
- package/dist/ui/labels/index.js +15 -49
- package/dist/utilities/common.js +20 -23
- package/dist/utilities/defaults.js +6 -9
- package/dist/utilities/index.js +5 -21
- package/dist/utilities/sorting.js +13 -16
- package/dist/utilities/time.js +9 -12
- package/dist/utilities/validation.js +3 -6
- package/package.json +1 -1
package/dist/api/auth.js
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Authentication-related constants
|
|
4
3
|
* These match the constants from Blueberry's src/services/auth/constants.ts
|
|
5
4
|
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.TOKEN_STORAGE_KEY_REFRESH = exports.TOKEN_STORAGE_KEY_ACCESS = exports.TOKEN_STORAGE_KEY = exports.TIME_LABEL_DAY_SHORT = exports.TIME_LABEL_MINUTE_SHORT = exports.TIME_LABEL_HOUR_SHORT = exports.TIME_LABEL_DAYS = exports.TIME_LABEL_DAY = exports.TIME_LABEL_HOURS = exports.TIME_LABEL_HOUR = exports.TIME_LABEL_MINUTES = exports.TIME_LABEL_MINUTE = exports.TIME_LABEL_EXPIRED = exports.TIME_LABEL = exports.HOURS_PER_DAY = exports.MINUTES_PER_HOUR = exports.MILLISECONDS_PER_MINUTE = exports.DEFAULT_TOKEN_REFRESH_BUFFER_MINUTES = void 0;
|
|
8
5
|
// Token management constants
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
export const DEFAULT_TOKEN_REFRESH_BUFFER_MINUTES = 5;
|
|
7
|
+
export const MILLISECONDS_PER_MINUTE = 60 * 1000;
|
|
8
|
+
export const MINUTES_PER_HOUR = 60;
|
|
9
|
+
export const HOURS_PER_DAY = 24;
|
|
13
10
|
// Time labels - consolidated object notation
|
|
14
|
-
|
|
11
|
+
export const TIME_LABEL = {
|
|
15
12
|
EXPIRED: 'Expired',
|
|
16
13
|
MINUTE: 'minute',
|
|
17
14
|
MINUTES: 'minutes',
|
|
@@ -24,21 +21,21 @@ exports.TIME_LABEL = {
|
|
|
24
21
|
DAY_SHORT: 'd',
|
|
25
22
|
};
|
|
26
23
|
// Backward compatibility: individual exports
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
24
|
+
export const TIME_LABEL_EXPIRED = TIME_LABEL.EXPIRED;
|
|
25
|
+
export const TIME_LABEL_MINUTE = TIME_LABEL.MINUTE;
|
|
26
|
+
export const TIME_LABEL_MINUTES = TIME_LABEL.MINUTES;
|
|
27
|
+
export const TIME_LABEL_HOUR = TIME_LABEL.HOUR;
|
|
28
|
+
export const TIME_LABEL_HOURS = TIME_LABEL.HOURS;
|
|
29
|
+
export const TIME_LABEL_DAY = TIME_LABEL.DAY;
|
|
30
|
+
export const TIME_LABEL_DAYS = TIME_LABEL.DAYS;
|
|
31
|
+
export const TIME_LABEL_HOUR_SHORT = TIME_LABEL.HOUR_SHORT;
|
|
32
|
+
export const TIME_LABEL_MINUTE_SHORT = TIME_LABEL.MINUTE_SHORT;
|
|
33
|
+
export const TIME_LABEL_DAY_SHORT = TIME_LABEL.DAY_SHORT;
|
|
37
34
|
// Storage keys - consolidated object notation
|
|
38
|
-
|
|
35
|
+
export const TOKEN_STORAGE_KEY = {
|
|
39
36
|
ACCESS: 'access_token',
|
|
40
37
|
REFRESH: 'refresh_token',
|
|
41
38
|
};
|
|
42
39
|
// Backward compatibility: individual exports
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
export const TOKEN_STORAGE_KEY_ACCESS = TOKEN_STORAGE_KEY.ACCESS;
|
|
41
|
+
export const TOKEN_STORAGE_KEY_REFRESH = TOKEN_STORAGE_KEY.REFRESH;
|
package/dist/api/config.js
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* API configuration constants
|
|
4
3
|
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.API_ERROR_CODES = exports.API_RESPONSE_CONFIG = exports.API_CONFIG = exports.API_VERSIONS = void 0;
|
|
7
4
|
// API Versions
|
|
8
|
-
|
|
5
|
+
export const API_VERSIONS = {
|
|
9
6
|
V1: 'v1',
|
|
10
7
|
V2: 'v2',
|
|
11
8
|
};
|
|
12
9
|
// API Configuration
|
|
13
|
-
|
|
10
|
+
export const API_CONFIG = {
|
|
14
11
|
DEFAULT_TIMEOUT: 30000, // 30 seconds
|
|
15
12
|
DEFAULT_RETRY_ATTEMPTS: 3,
|
|
16
13
|
DEFAULT_RETRY_DELAY: 1000, // 1 second
|
|
@@ -18,13 +15,13 @@ exports.API_CONFIG = {
|
|
|
18
15
|
REQUEST_DEBOUNCE_MS: 300,
|
|
19
16
|
};
|
|
20
17
|
// API Response Configuration
|
|
21
|
-
|
|
18
|
+
export const API_RESPONSE_CONFIG = {
|
|
22
19
|
DEFAULT_PAGE_SIZE: 20,
|
|
23
20
|
MAX_PAGE_SIZE: 100,
|
|
24
21
|
DEFAULT_SORT_ORDER: 'desc',
|
|
25
22
|
};
|
|
26
23
|
// API Error Codes (custom application codes)
|
|
27
|
-
|
|
24
|
+
export const API_ERROR_CODES = {
|
|
28
25
|
// Authentication errors
|
|
29
26
|
INVALID_CREDENTIALS: 'INVALID_CREDENTIALS',
|
|
30
27
|
TOKEN_EXPIRED: 'TOKEN_EXPIRED',
|
package/dist/api/endpoints.js
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* API endpoint definitions for all services
|
|
4
3
|
*/
|
|
5
|
-
|
|
6
|
-
exports.ASSET_HOLDING_SNAPSHOT_ENDPOINTS = exports.ASSET_HOLDING_ENDPOINTS = exports.ASSET_ALLOCATION_ENDPOINTS = exports.TRANSACTION_ENDPOINTS = exports.WITHDRAWAL_LIQUIDATION_ENDPOINTS = exports.WITHDRAWAL_REQUEST_ENDPOINTS = exports.WITHDRAWAL_ENDPOINTS = exports.USER_PROFILE_ENDPOINTS = exports.USER_ENDPOINTS = exports.TARGET_TRADE_SHEET_ENDPOINTS = exports.TRADE_SHEET_ENDPOINTS = exports.TARGET_TRADE_ENDPOINTS = exports.TRADE_ENDPOINTS = exports.TAX_RESIDENCY_ENDPOINTS = exports.STOCK_EXCHANGE_ENDPOINTS = exports.SECTOR_ENDPOINTS = exports.PORTFOLIO_TEMPLATE_ENDPOINTS = exports.PORTFOLIO_ENDPOINTS = exports.INSTRUMENT_ENDPOINTS = exports.INDUSTRY_ENDPOINTS = exports.DOCUMENT_ENDPOINTS = exports.COUNTRY_ENDPOINTS = exports.CASH_ACCOUNT_TRANSACTION_ENDPOINTS = exports.CASH_ACCOUNT_ENDPOINTS = exports.BANK_ENDPOINTS = exports.AUTH_ENDPOINTS = exports.ACCOUNT_ENDPOINTS = exports.API_BASE_PATHS = void 0;
|
|
7
|
-
exports.API_BASE_PATHS = {
|
|
4
|
+
export const API_BASE_PATHS = {
|
|
8
5
|
V1: '/api',
|
|
9
6
|
};
|
|
10
7
|
// Account endpoints
|
|
11
|
-
|
|
8
|
+
export const ACCOUNT_ENDPOINTS = {
|
|
12
9
|
BASE: '/api/accounts/',
|
|
13
10
|
DETAIL: (uuid) => `/api/accounts/${uuid}/`,
|
|
14
11
|
};
|
|
15
12
|
// Authentication endpoints
|
|
16
|
-
|
|
13
|
+
export const AUTH_ENDPOINTS = {
|
|
17
14
|
BASE: '/api/auth/',
|
|
18
15
|
LOGIN: '/api/auth/login/',
|
|
19
16
|
LOGOUT: '/api/auth/logout/',
|
|
@@ -27,30 +24,30 @@ exports.AUTH_ENDPOINTS = {
|
|
|
27
24
|
TOKEN_REFRESH: '/api/token/refresh/',
|
|
28
25
|
};
|
|
29
26
|
// Bank endpoints
|
|
30
|
-
|
|
27
|
+
export const BANK_ENDPOINTS = {
|
|
31
28
|
BASE: '/api/banks/',
|
|
32
29
|
DETAIL: (uuid) => `/api/banks/${uuid}/`,
|
|
33
30
|
ACCOUNTS: '/api/bank-accounts/',
|
|
34
31
|
ACCOUNT_DETAIL: (uuid) => `/api/bank-accounts/${uuid}/`,
|
|
35
32
|
};
|
|
36
33
|
// Cash account endpoints
|
|
37
|
-
|
|
34
|
+
export const CASH_ACCOUNT_ENDPOINTS = {
|
|
38
35
|
BASE: '/api/cash-accounts/',
|
|
39
36
|
DETAIL: (uuid) => `/api/cash-accounts/${uuid}/`,
|
|
40
37
|
TRANSACTIONS: (uuid) => `/api/cash-accounts/${uuid}/transactions/`,
|
|
41
38
|
};
|
|
42
39
|
// Cash account transaction endpoints
|
|
43
|
-
|
|
40
|
+
export const CASH_ACCOUNT_TRANSACTION_ENDPOINTS = {
|
|
44
41
|
BASE: '/api/cash-account-transactions/',
|
|
45
42
|
DETAIL: (uuid) => `/api/cash-account-transactions/${uuid}/`,
|
|
46
43
|
};
|
|
47
44
|
// Country endpoints
|
|
48
|
-
|
|
45
|
+
export const COUNTRY_ENDPOINTS = {
|
|
49
46
|
BASE: '/api/countries/',
|
|
50
47
|
DETAIL: (uuid) => `/api/countries/${uuid}/`,
|
|
51
48
|
};
|
|
52
49
|
// Document endpoints
|
|
53
|
-
|
|
50
|
+
export const DOCUMENT_ENDPOINTS = {
|
|
54
51
|
BASE: '/api/documents/',
|
|
55
52
|
DETAIL: (uuid) => `/api/documents/${uuid}/`,
|
|
56
53
|
DOWNLOAD: (uuid) => `/api/documents/${uuid}/download/`,
|
|
@@ -60,19 +57,19 @@ exports.DOCUMENT_ENDPOINTS = {
|
|
|
60
57
|
SOA: '/api/documents/soa/',
|
|
61
58
|
};
|
|
62
59
|
// Industry endpoints
|
|
63
|
-
|
|
60
|
+
export const INDUSTRY_ENDPOINTS = {
|
|
64
61
|
BASE: '/api/industries/',
|
|
65
62
|
DETAIL: (uuid) => `/api/industries/${uuid}/`,
|
|
66
63
|
};
|
|
67
64
|
// Instrument endpoints
|
|
68
|
-
|
|
65
|
+
export const INSTRUMENT_ENDPOINTS = {
|
|
69
66
|
BASE: '/api/instruments/',
|
|
70
67
|
DETAIL: (uuid) => `/api/instruments/${uuid}/`,
|
|
71
68
|
PRICES: (uuid) => `/api/instruments/${uuid}/prices/`,
|
|
72
69
|
QUOTE: (uuid) => `/api/instruments/${uuid}/quote/`,
|
|
73
70
|
};
|
|
74
71
|
// Portfolio endpoints
|
|
75
|
-
|
|
72
|
+
export const PORTFOLIO_ENDPOINTS = {
|
|
76
73
|
BASE: '/api/portfolios/',
|
|
77
74
|
DETAIL: (uuid) => `/api/portfolios/${uuid}/`,
|
|
78
75
|
ALLOCATIONS: (uuid) => `/api/portfolios/${uuid}/allocations/`,
|
|
@@ -81,53 +78,53 @@ exports.PORTFOLIO_ENDPOINTS = {
|
|
|
81
78
|
TRANSACTIONS: (uuid) => `/api/portfolios/${uuid}/transactions/`,
|
|
82
79
|
};
|
|
83
80
|
// Portfolio template endpoints
|
|
84
|
-
|
|
81
|
+
export const PORTFOLIO_TEMPLATE_ENDPOINTS = {
|
|
85
82
|
BASE: '/api/portfolio-templates/',
|
|
86
83
|
DETAIL: (uuid) => `/api/portfolio-templates/${uuid}/`,
|
|
87
84
|
ALLOCATIONS: (uuid) => `/api/portfolio-templates/${uuid}/allocations/`,
|
|
88
85
|
RECOMMENDED: '/api/portfolio-templates/recommended/',
|
|
89
86
|
};
|
|
90
87
|
// Sector endpoints
|
|
91
|
-
|
|
88
|
+
export const SECTOR_ENDPOINTS = {
|
|
92
89
|
BASE: '/api/sectors/',
|
|
93
90
|
DETAIL: (uuid) => `/api/sectors/${uuid}/`,
|
|
94
91
|
};
|
|
95
92
|
// Stock exchange endpoints
|
|
96
|
-
|
|
93
|
+
export const STOCK_EXCHANGE_ENDPOINTS = {
|
|
97
94
|
BASE: '/api/stock-exchanges/',
|
|
98
95
|
DETAIL: (uuid) => `/api/stock-exchanges/${uuid}/`,
|
|
99
96
|
};
|
|
100
97
|
// Tax residency endpoints
|
|
101
|
-
|
|
98
|
+
export const TAX_RESIDENCY_ENDPOINTS = {
|
|
102
99
|
BASE: '/api/tax-residencies/',
|
|
103
100
|
DETAIL: (uuid) => `/api/tax-residencies/${uuid}/`,
|
|
104
101
|
};
|
|
105
102
|
// Trade endpoints
|
|
106
|
-
|
|
103
|
+
export const TRADE_ENDPOINTS = {
|
|
107
104
|
BASE: '/api/trades/',
|
|
108
105
|
DETAIL: (uuid) => `/api/trades/${uuid}/`,
|
|
109
106
|
CANCEL: (uuid) => `/api/trades/${uuid}/cancel/`,
|
|
110
107
|
CONFIRM: (uuid) => `/api/trades/${uuid}/confirm/`,
|
|
111
108
|
};
|
|
112
109
|
// Target trade endpoints
|
|
113
|
-
|
|
110
|
+
export const TARGET_TRADE_ENDPOINTS = {
|
|
114
111
|
BASE: '/api/target-trades/',
|
|
115
112
|
DETAIL: (uuid) => `/api/target-trades/${uuid}/`,
|
|
116
113
|
APPROVE: (uuid) => `/api/target-trades/${uuid}/approve/`,
|
|
117
114
|
SUBMIT: (uuid) => `/api/target-trades/${uuid}/submit/`,
|
|
118
115
|
};
|
|
119
116
|
// Trade sheet endpoints
|
|
120
|
-
|
|
117
|
+
export const TRADE_SHEET_ENDPOINTS = {
|
|
121
118
|
BASE: '/api/trade-sheets/',
|
|
122
119
|
DETAIL: (uuid) => `/api/trade-sheets/${uuid}/`,
|
|
123
120
|
};
|
|
124
121
|
// Target trade sheet endpoints
|
|
125
|
-
|
|
122
|
+
export const TARGET_TRADE_SHEET_ENDPOINTS = {
|
|
126
123
|
BASE: '/api/target-trade-sheets/',
|
|
127
124
|
DETAIL: (uuid) => `/api/target-trade-sheets/${uuid}/`,
|
|
128
125
|
};
|
|
129
126
|
// User endpoints
|
|
130
|
-
|
|
127
|
+
export const USER_ENDPOINTS = {
|
|
131
128
|
BASE: '/api/users/',
|
|
132
129
|
DETAIL: (uuid) => `/api/users/${uuid}/`,
|
|
133
130
|
PROFILE: '/api/users/profile/',
|
|
@@ -135,12 +132,12 @@ exports.USER_ENDPOINTS = {
|
|
|
135
132
|
INVESTMENT_PREFERENCES: '/api/users/investment-preferences/',
|
|
136
133
|
};
|
|
137
134
|
// User profile endpoints (separate collection resource)
|
|
138
|
-
|
|
135
|
+
export const USER_PROFILE_ENDPOINTS = {
|
|
139
136
|
BASE: '/api/user-profiles/',
|
|
140
137
|
DETAIL: (uuid) => `/api/user-profiles/${uuid}/`,
|
|
141
138
|
};
|
|
142
139
|
// Withdrawal endpoints
|
|
143
|
-
|
|
140
|
+
export const WITHDRAWAL_ENDPOINTS = {
|
|
144
141
|
BASE: '/api/withdrawals/',
|
|
145
142
|
DETAIL: (uuid) => `/api/withdrawals/${uuid}/`,
|
|
146
143
|
CANCEL: (uuid) => `/api/withdrawals/${uuid}/cancel/`,
|
|
@@ -148,7 +145,7 @@ exports.WITHDRAWAL_ENDPOINTS = {
|
|
|
148
145
|
REJECT: (uuid) => `/api/withdrawals/${uuid}/reject/`,
|
|
149
146
|
};
|
|
150
147
|
// Withdrawal request endpoints
|
|
151
|
-
|
|
148
|
+
export const WITHDRAWAL_REQUEST_ENDPOINTS = {
|
|
152
149
|
BASE: '/api/withdrawal-requests/',
|
|
153
150
|
DETAIL: (uuid) => `/api/withdrawal-requests/${uuid}/`,
|
|
154
151
|
CANCEL: (uuid) => `/api/withdrawal-requests/${uuid}/cancel/`,
|
|
@@ -156,27 +153,27 @@ exports.WITHDRAWAL_REQUEST_ENDPOINTS = {
|
|
|
156
153
|
REJECT: (uuid) => `/api/withdrawal-requests/${uuid}/reject/`,
|
|
157
154
|
};
|
|
158
155
|
// Withdrawal liquidation endpoints
|
|
159
|
-
|
|
156
|
+
export const WITHDRAWAL_LIQUIDATION_ENDPOINTS = {
|
|
160
157
|
BASE: '/api/withdrawal-liquidations/',
|
|
161
158
|
DETAIL: (uuid) => `/api/withdrawal-liquidations/${uuid}/`,
|
|
162
159
|
};
|
|
163
160
|
// Transaction endpoints (cash account transactions)
|
|
164
|
-
|
|
161
|
+
export const TRANSACTION_ENDPOINTS = {
|
|
165
162
|
BASE: '/api/transactions/',
|
|
166
163
|
DETAIL: (uuid) => `/api/transactions/${uuid}/`,
|
|
167
164
|
};
|
|
168
165
|
// Asset allocation endpoints
|
|
169
|
-
|
|
166
|
+
export const ASSET_ALLOCATION_ENDPOINTS = {
|
|
170
167
|
BASE: '/api/asset-allocations/',
|
|
171
168
|
DETAIL: (uuid) => `/api/asset-allocations/${uuid}/`,
|
|
172
169
|
};
|
|
173
170
|
// Asset holding endpoints
|
|
174
|
-
|
|
171
|
+
export const ASSET_HOLDING_ENDPOINTS = {
|
|
175
172
|
BASE: '/api/asset-holdings/',
|
|
176
173
|
DETAIL: (uuid) => `/api/asset-holdings/${uuid}/`,
|
|
177
174
|
};
|
|
178
175
|
// Asset holding snapshot endpoints
|
|
179
|
-
|
|
176
|
+
export const ASSET_HOLDING_SNAPSHOT_ENDPOINTS = {
|
|
180
177
|
BASE: '/api/asset-holding-snapshots/',
|
|
181
178
|
DETAIL: (id) => `/api/asset-holding-snapshots/${id}/`,
|
|
182
179
|
};
|
package/dist/api/http.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* HTTP-related constants
|
|
4
3
|
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.CONTENT_TYPE_APPLICATION_JSON = exports.HTTP_HEADER_CONTENT_TYPE = exports.HTTP_METHODS = exports.CONTENT_TYPES = exports.HTTP_HEADERS = exports.HTTP_STATUS = void 0;
|
|
7
4
|
// HTTP Status Codes
|
|
8
|
-
|
|
5
|
+
export const HTTP_STATUS = {
|
|
9
6
|
// 2xx Success
|
|
10
7
|
OK: 200,
|
|
11
8
|
CREATED: 201,
|
|
@@ -31,7 +28,7 @@ exports.HTTP_STATUS = {
|
|
|
31
28
|
GATEWAY_TIMEOUT: 504,
|
|
32
29
|
};
|
|
33
30
|
// HTTP Headers
|
|
34
|
-
|
|
31
|
+
export const HTTP_HEADERS = {
|
|
35
32
|
ACCEPT: 'Accept',
|
|
36
33
|
AUTHORIZATION: 'Authorization',
|
|
37
34
|
CONTENT_TYPE: 'Content-Type',
|
|
@@ -41,7 +38,7 @@ exports.HTTP_HEADERS = {
|
|
|
41
38
|
X_CSRF_TOKEN: 'X-CSRFToken',
|
|
42
39
|
};
|
|
43
40
|
// Content Types
|
|
44
|
-
|
|
41
|
+
export const CONTENT_TYPES = {
|
|
45
42
|
JSON: 'application/json',
|
|
46
43
|
FORM_DATA: 'multipart/form-data',
|
|
47
44
|
URL_ENCODED: 'application/x-www-form-urlencoded',
|
|
@@ -51,7 +48,7 @@ exports.CONTENT_TYPES = {
|
|
|
51
48
|
PDF: 'application/pdf',
|
|
52
49
|
};
|
|
53
50
|
// HTTP Methods
|
|
54
|
-
|
|
51
|
+
export const HTTP_METHODS = {
|
|
55
52
|
GET: 'GET',
|
|
56
53
|
POST: 'POST',
|
|
57
54
|
PUT: 'PUT',
|
|
@@ -61,5 +58,5 @@ exports.HTTP_METHODS = {
|
|
|
61
58
|
OPTIONS: 'OPTIONS',
|
|
62
59
|
};
|
|
63
60
|
// Blueberry compatibility exports
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
export const HTTP_HEADER_CONTENT_TYPE = HTTP_HEADERS.CONTENT_TYPE;
|
|
62
|
+
export const CONTENT_TYPE_APPLICATION_JSON = CONTENT_TYPES.JSON;
|
package/dist/api/index.js
CHANGED
|
@@ -1,23 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* API-related constants
|
|
4
3
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
-
}
|
|
11
|
-
Object.defineProperty(o, k2, desc);
|
|
12
|
-
}) : (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
o[k2] = m[k];
|
|
15
|
-
}));
|
|
16
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
17
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
|
-
};
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
__exportStar(require("./endpoints"), exports);
|
|
21
|
-
__exportStar(require("./http"), exports);
|
|
22
|
-
__exportStar(require("./config"), exports);
|
|
23
|
-
__exportStar(require("./auth"), exports);
|
|
4
|
+
export * from './endpoints';
|
|
5
|
+
export * from './http';
|
|
6
|
+
export * from './config';
|
|
7
|
+
export * from './auth';
|
|
@@ -1,56 +1,53 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Account-related business constants
|
|
4
3
|
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.SOURCE_OF_FUNDS_OPTIONS = exports.ACCOUNT_TYPE_OPTIONS = exports.SOURCE_OF_FUNDS_LABELS = exports.SOURCE_OF_FUNDS_LABEL_OTHER = exports.SOURCE_OF_FUNDS_LABEL_GIFT = exports.SOURCE_OF_FUNDS_LABEL_INHERITANCE = exports.SOURCE_OF_FUNDS_LABEL_SAVINGS = exports.SOURCE_OF_FUNDS_LABEL_SALARY = exports.SOURCE_OF_FUNDS = exports.SOURCE_OF_FUNDS_OTHER = exports.SOURCE_OF_FUNDS_GIFT = exports.SOURCE_OF_FUNDS_INHERITANCE = exports.SOURCE_OF_FUNDS_SAVINGS = exports.SOURCE_OF_FUNDS_SALARY = exports.ACCOUNT_TYPE_LABELS = exports.ACCOUNT_TYPE = void 0;
|
|
7
4
|
// Account types
|
|
8
|
-
|
|
5
|
+
export const ACCOUNT_TYPE = {
|
|
9
6
|
TRANSACTION: 'TRANSACTION',
|
|
10
7
|
SAVINGS: 'SAVINGS',
|
|
11
8
|
OTHER: 'OTHER',
|
|
12
9
|
};
|
|
13
|
-
|
|
14
|
-
[
|
|
15
|
-
[
|
|
16
|
-
[
|
|
10
|
+
export const ACCOUNT_TYPE_LABELS = {
|
|
11
|
+
[ACCOUNT_TYPE.TRANSACTION]: 'Transaction Account',
|
|
12
|
+
[ACCOUNT_TYPE.SAVINGS]: 'Savings Account',
|
|
13
|
+
[ACCOUNT_TYPE.OTHER]: 'Other',
|
|
17
14
|
};
|
|
18
15
|
// Source of funds constants
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
SALARY:
|
|
26
|
-
SAVINGS:
|
|
27
|
-
INHERITANCE:
|
|
28
|
-
GIFT:
|
|
29
|
-
OTHER:
|
|
16
|
+
export const SOURCE_OF_FUNDS_SALARY = 'salary';
|
|
17
|
+
export const SOURCE_OF_FUNDS_SAVINGS = 'savings';
|
|
18
|
+
export const SOURCE_OF_FUNDS_INHERITANCE = 'inheritance';
|
|
19
|
+
export const SOURCE_OF_FUNDS_GIFT = 'gift';
|
|
20
|
+
export const SOURCE_OF_FUNDS_OTHER = 'other';
|
|
21
|
+
export const SOURCE_OF_FUNDS = {
|
|
22
|
+
SALARY: SOURCE_OF_FUNDS_SALARY,
|
|
23
|
+
SAVINGS: SOURCE_OF_FUNDS_SAVINGS,
|
|
24
|
+
INHERITANCE: SOURCE_OF_FUNDS_INHERITANCE,
|
|
25
|
+
GIFT: SOURCE_OF_FUNDS_GIFT,
|
|
26
|
+
OTHER: SOURCE_OF_FUNDS_OTHER,
|
|
30
27
|
};
|
|
31
28
|
// Source of funds label constants
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
[
|
|
39
|
-
[
|
|
40
|
-
[
|
|
41
|
-
[
|
|
42
|
-
[
|
|
29
|
+
export const SOURCE_OF_FUNDS_LABEL_SALARY = 'Salary';
|
|
30
|
+
export const SOURCE_OF_FUNDS_LABEL_SAVINGS = 'Savings';
|
|
31
|
+
export const SOURCE_OF_FUNDS_LABEL_INHERITANCE = 'Inheritance';
|
|
32
|
+
export const SOURCE_OF_FUNDS_LABEL_GIFT = 'Gift';
|
|
33
|
+
export const SOURCE_OF_FUNDS_LABEL_OTHER = 'Other';
|
|
34
|
+
export const SOURCE_OF_FUNDS_LABELS = {
|
|
35
|
+
[SOURCE_OF_FUNDS.SALARY]: SOURCE_OF_FUNDS_LABEL_SALARY,
|
|
36
|
+
[SOURCE_OF_FUNDS.SAVINGS]: SOURCE_OF_FUNDS_LABEL_SAVINGS,
|
|
37
|
+
[SOURCE_OF_FUNDS.INHERITANCE]: SOURCE_OF_FUNDS_LABEL_INHERITANCE,
|
|
38
|
+
[SOURCE_OF_FUNDS.GIFT]: SOURCE_OF_FUNDS_LABEL_GIFT,
|
|
39
|
+
[SOURCE_OF_FUNDS.OTHER]: SOURCE_OF_FUNDS_LABEL_OTHER,
|
|
43
40
|
};
|
|
44
41
|
// Account options for forms
|
|
45
|
-
|
|
42
|
+
export const ACCOUNT_TYPE_OPTIONS = Object.entries(ACCOUNT_TYPE_LABELS).map(([value, label]) => ({
|
|
46
43
|
value,
|
|
47
44
|
label,
|
|
48
45
|
}));
|
|
49
46
|
// Source of funds options
|
|
50
|
-
|
|
51
|
-
{ value:
|
|
52
|
-
{ value:
|
|
53
|
-
{ value:
|
|
54
|
-
{ value:
|
|
55
|
-
{ value:
|
|
47
|
+
export const SOURCE_OF_FUNDS_OPTIONS = [
|
|
48
|
+
{ value: SOURCE_OF_FUNDS_SALARY, label: SOURCE_OF_FUNDS_LABEL_SALARY },
|
|
49
|
+
{ value: SOURCE_OF_FUNDS_SAVINGS, label: SOURCE_OF_FUNDS_LABEL_SAVINGS },
|
|
50
|
+
{ value: SOURCE_OF_FUNDS_INHERITANCE, label: SOURCE_OF_FUNDS_LABEL_INHERITANCE },
|
|
51
|
+
{ value: SOURCE_OF_FUNDS_GIFT, label: SOURCE_OF_FUNDS_LABEL_GIFT },
|
|
52
|
+
{ value: SOURCE_OF_FUNDS_OTHER, label: SOURCE_OF_FUNDS_LABEL_OTHER },
|
|
56
53
|
];
|
|
@@ -1,81 +1,77 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Bank account type constants
|
|
4
3
|
* Note: Bank account status constants are in ./status/banks.ts
|
|
5
4
|
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.BANK_ACCOUNT_TYPE_DESC_OFFSET = exports.BANK_ACCOUNT_TYPE_DESC_TERM_DEPOSIT = exports.BANK_ACCOUNT_TYPE_DESC_TRANSACTION = exports.BANK_ACCOUNT_TYPE_DESC_CHECKING = exports.BANK_ACCOUNT_TYPE_DESC_SAVINGS = exports.BANK_ACCOUNT_TYPE_LABEL_OFFSET = exports.BANK_ACCOUNT_TYPE_LABEL_TERM_DEPOSIT = exports.BANK_ACCOUNT_TYPE_LABEL_TRANSACTION = exports.BANK_ACCOUNT_TYPE_LABEL_CHECKING = exports.BANK_ACCOUNT_TYPE_LABEL_SAVINGS = exports.BANK_ACCOUNT_TYPE_OPTIONS = exports.BANK_ACCOUNT_TYPE_LABELS = exports.BANK_ACCOUNT_TYPE_OFFSET = exports.BANK_ACCOUNT_TYPE_TERM_DEPOSIT = exports.BANK_ACCOUNT_TYPE_TRANSACTION = exports.BANK_ACCOUNT_TYPE_CHECKING = exports.BANK_ACCOUNT_TYPE_SAVINGS = exports.getAccountTypeInfo = exports.ACCOUNT_TYPES = exports.getBankAccountCategoryInfo = exports.BANK_ACCOUNT_CATEGORIES_INFO = exports.BANK_ACCOUNT_CATEGORY_OPTIONS = exports.BANK_ACCOUNT_CATEGORY_DESCRIPTIONS = exports.BANK_ACCOUNT_CATEGORY_OFFSET = exports.BANK_ACCOUNT_CATEGORY_TERM_DEPOSIT = exports.BANK_ACCOUNT_CATEGORY_TRANSACTION = exports.BANK_ACCOUNT_CATEGORY_CHECKING = exports.BANK_ACCOUNT_CATEGORY_SAVINGS = exports.BANK_ACCOUNT_CATEGORY_LABELS = exports.BANK_ACCOUNT_CATEGORIES = exports.BANK_ACCOUNT_CATEGORY = void 0;
|
|
8
5
|
// Bank Account Category constants - consolidated object notation
|
|
9
|
-
|
|
6
|
+
export const BANK_ACCOUNT_CATEGORY = {
|
|
10
7
|
SAVINGS: 'savings',
|
|
11
8
|
CHECKING: 'checking',
|
|
12
9
|
TRANSACTION: 'transaction',
|
|
13
10
|
TERM_DEPOSIT: 'term_deposit',
|
|
14
11
|
OFFSET: 'offset',
|
|
15
12
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
export const BANK_ACCOUNT_CATEGORIES = [
|
|
14
|
+
BANK_ACCOUNT_CATEGORY.SAVINGS,
|
|
15
|
+
BANK_ACCOUNT_CATEGORY.CHECKING,
|
|
16
|
+
BANK_ACCOUNT_CATEGORY.TRANSACTION,
|
|
17
|
+
BANK_ACCOUNT_CATEGORY.TERM_DEPOSIT,
|
|
18
|
+
BANK_ACCOUNT_CATEGORY.OFFSET,
|
|
22
19
|
];
|
|
23
20
|
// Bank Account Type labels
|
|
24
|
-
|
|
25
|
-
[
|
|
26
|
-
[
|
|
27
|
-
[
|
|
28
|
-
[
|
|
29
|
-
[
|
|
21
|
+
export const BANK_ACCOUNT_CATEGORY_LABELS = {
|
|
22
|
+
[BANK_ACCOUNT_CATEGORY.SAVINGS]: 'Savings Account',
|
|
23
|
+
[BANK_ACCOUNT_CATEGORY.CHECKING]: 'Checking Account',
|
|
24
|
+
[BANK_ACCOUNT_CATEGORY.TRANSACTION]: 'Transaction Account',
|
|
25
|
+
[BANK_ACCOUNT_CATEGORY.TERM_DEPOSIT]: 'Term Deposit',
|
|
26
|
+
[BANK_ACCOUNT_CATEGORY.OFFSET]: 'Offset Account',
|
|
30
27
|
};
|
|
31
28
|
// Backward compatibility: individual exports
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
export const BANK_ACCOUNT_CATEGORY_SAVINGS = BANK_ACCOUNT_CATEGORY.SAVINGS;
|
|
30
|
+
export const BANK_ACCOUNT_CATEGORY_CHECKING = BANK_ACCOUNT_CATEGORY.CHECKING;
|
|
31
|
+
export const BANK_ACCOUNT_CATEGORY_TRANSACTION = BANK_ACCOUNT_CATEGORY.TRANSACTION;
|
|
32
|
+
export const BANK_ACCOUNT_CATEGORY_TERM_DEPOSIT = BANK_ACCOUNT_CATEGORY.TERM_DEPOSIT;
|
|
33
|
+
export const BANK_ACCOUNT_CATEGORY_OFFSET = BANK_ACCOUNT_CATEGORY.OFFSET;
|
|
37
34
|
// Bank Account Type descriptions
|
|
38
|
-
|
|
39
|
-
[
|
|
40
|
-
[
|
|
41
|
-
[
|
|
42
|
-
[
|
|
43
|
-
[
|
|
35
|
+
export const BANK_ACCOUNT_CATEGORY_DESCRIPTIONS = {
|
|
36
|
+
[BANK_ACCOUNT_CATEGORY_SAVINGS]: 'Interest-bearing savings account',
|
|
37
|
+
[BANK_ACCOUNT_CATEGORY_CHECKING]: 'Everyday checking account',
|
|
38
|
+
[BANK_ACCOUNT_CATEGORY_TRANSACTION]: 'Daily transaction account',
|
|
39
|
+
[BANK_ACCOUNT_CATEGORY_TERM_DEPOSIT]: 'Fixed-term deposit account',
|
|
40
|
+
[BANK_ACCOUNT_CATEGORY_OFFSET]: 'Mortgage offset account',
|
|
44
41
|
};
|
|
45
42
|
// Bank Account Type options for forms with descriptions
|
|
46
|
-
|
|
43
|
+
export const BANK_ACCOUNT_CATEGORY_OPTIONS = BANK_ACCOUNT_CATEGORIES.map(type => ({
|
|
47
44
|
value: type,
|
|
48
|
-
label:
|
|
49
|
-
description:
|
|
45
|
+
label: BANK_ACCOUNT_CATEGORY_LABELS[type],
|
|
46
|
+
description: BANK_ACCOUNT_CATEGORY_DESCRIPTIONS[type],
|
|
50
47
|
}));
|
|
51
48
|
// Available account types with display information
|
|
52
|
-
|
|
49
|
+
export const BANK_ACCOUNT_CATEGORIES_INFO = BANK_ACCOUNT_CATEGORIES.map(type => ({
|
|
53
50
|
code: type,
|
|
54
|
-
name:
|
|
55
|
-
description:
|
|
51
|
+
name: BANK_ACCOUNT_CATEGORY_LABELS[type],
|
|
52
|
+
description: BANK_ACCOUNT_CATEGORY_DESCRIPTIONS[type],
|
|
56
53
|
}));
|
|
57
54
|
// Helper function to get account type info by code
|
|
58
|
-
const getBankAccountCategoryInfo = (code) => {
|
|
59
|
-
return
|
|
55
|
+
export const getBankAccountCategoryInfo = (code) => {
|
|
56
|
+
return BANK_ACCOUNT_CATEGORIES_INFO.find(type => type.code === code);
|
|
60
57
|
};
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
exports.getAccountTypeInfo = exports.getBankAccountCategoryInfo;
|
|
58
|
+
export const ACCOUNT_TYPES = BANK_ACCOUNT_CATEGORIES_INFO;
|
|
59
|
+
export const getAccountTypeInfo = getBankAccountCategoryInfo;
|
|
64
60
|
// Blueberry compatibility exports - individual constants
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
61
|
+
export const BANK_ACCOUNT_TYPE_SAVINGS = BANK_ACCOUNT_CATEGORY_SAVINGS;
|
|
62
|
+
export const BANK_ACCOUNT_TYPE_CHECKING = BANK_ACCOUNT_CATEGORY_CHECKING;
|
|
63
|
+
export const BANK_ACCOUNT_TYPE_TRANSACTION = BANK_ACCOUNT_CATEGORY_TRANSACTION;
|
|
64
|
+
export const BANK_ACCOUNT_TYPE_TERM_DEPOSIT = BANK_ACCOUNT_CATEGORY_TERM_DEPOSIT;
|
|
65
|
+
export const BANK_ACCOUNT_TYPE_OFFSET = BANK_ACCOUNT_CATEGORY_OFFSET;
|
|
66
|
+
export const BANK_ACCOUNT_TYPE_LABELS = BANK_ACCOUNT_CATEGORY_LABELS;
|
|
67
|
+
export const BANK_ACCOUNT_TYPE_OPTIONS = BANK_ACCOUNT_CATEGORY_OPTIONS;
|
|
68
|
+
export const BANK_ACCOUNT_TYPE_LABEL_SAVINGS = BANK_ACCOUNT_CATEGORY_LABELS[BANK_ACCOUNT_CATEGORY_SAVINGS];
|
|
69
|
+
export const BANK_ACCOUNT_TYPE_LABEL_CHECKING = BANK_ACCOUNT_CATEGORY_LABELS[BANK_ACCOUNT_CATEGORY_CHECKING];
|
|
70
|
+
export const BANK_ACCOUNT_TYPE_LABEL_TRANSACTION = BANK_ACCOUNT_CATEGORY_LABELS[BANK_ACCOUNT_CATEGORY_TRANSACTION];
|
|
71
|
+
export const BANK_ACCOUNT_TYPE_LABEL_TERM_DEPOSIT = BANK_ACCOUNT_CATEGORY_LABELS[BANK_ACCOUNT_CATEGORY_TERM_DEPOSIT];
|
|
72
|
+
export const BANK_ACCOUNT_TYPE_LABEL_OFFSET = BANK_ACCOUNT_CATEGORY_LABELS[BANK_ACCOUNT_CATEGORY_OFFSET];
|
|
73
|
+
export const BANK_ACCOUNT_TYPE_DESC_SAVINGS = BANK_ACCOUNT_CATEGORY_DESCRIPTIONS[BANK_ACCOUNT_CATEGORY_SAVINGS];
|
|
74
|
+
export const BANK_ACCOUNT_TYPE_DESC_CHECKING = BANK_ACCOUNT_CATEGORY_DESCRIPTIONS[BANK_ACCOUNT_CATEGORY_CHECKING];
|
|
75
|
+
export const BANK_ACCOUNT_TYPE_DESC_TRANSACTION = BANK_ACCOUNT_CATEGORY_DESCRIPTIONS[BANK_ACCOUNT_CATEGORY_TRANSACTION];
|
|
76
|
+
export const BANK_ACCOUNT_TYPE_DESC_TERM_DEPOSIT = BANK_ACCOUNT_CATEGORY_DESCRIPTIONS[BANK_ACCOUNT_CATEGORY_TERM_DEPOSIT];
|
|
77
|
+
export const BANK_ACCOUNT_TYPE_DESC_OFFSET = BANK_ACCOUNT_CATEGORY_DESCRIPTIONS[BANK_ACCOUNT_CATEGORY_OFFSET];
|