@cranberry-money/shared-constants 5.1.0 → 5.2.0

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 (46) hide show
  1. package/dist/api/auth.js +18 -21
  2. package/dist/api/config.js +4 -7
  3. package/dist/api/endpoints.js +28 -31
  4. package/dist/api/http.js +6 -9
  5. package/dist/api/index.js +4 -20
  6. package/dist/business/accounts.d.ts +20 -13
  7. package/dist/business/accounts.d.ts.map +1 -1
  8. package/dist/business/accounts.js +30 -38
  9. package/dist/business/bank-accounts.js +51 -55
  10. package/dist/business/banking.d.ts +0 -9
  11. package/dist/business/banking.d.ts.map +1 -1
  12. package/dist/business/banking.js +21 -37
  13. package/dist/business/countries.js +3 -6
  14. package/dist/business/documents.js +38 -41
  15. package/dist/business/index.js +12 -74
  16. package/dist/business/industries.js +2 -5
  17. package/dist/business/investments.d.ts +0 -9
  18. package/dist/business/investments.d.ts.map +1 -1
  19. package/dist/business/investments.js +47 -59
  20. package/dist/business/status/banks.js +11 -14
  21. package/dist/business/status/cash-accounts.js +33 -36
  22. package/dist/business/status/documents.js +19 -22
  23. package/dist/business/status/index.js +7 -23
  24. package/dist/business/status/instruments.js +21 -24
  25. package/dist/business/status/portfolios.js +5 -8
  26. package/dist/business/status/trades.js +65 -68
  27. package/dist/business/status/withdrawals.js +77 -80
  28. package/dist/business/trading.js +23 -26
  29. package/dist/financial/currency.js +42 -45
  30. package/dist/financial/formatting.js +9 -12
  31. package/dist/financial/index.js +3 -19
  32. package/dist/financial/instruments.js +25 -28
  33. package/dist/index.js +5 -21
  34. package/dist/ui/colors.js +37 -41
  35. package/dist/ui/display.js +20 -23
  36. package/dist/ui/index.js +3 -19
  37. package/dist/ui/labels/index.d.ts +2 -1
  38. package/dist/ui/labels/index.d.ts.map +1 -1
  39. package/dist/ui/labels/index.js +16 -49
  40. package/dist/utilities/common.js +20 -23
  41. package/dist/utilities/defaults.js +6 -9
  42. package/dist/utilities/index.js +5 -21
  43. package/dist/utilities/sorting.js +13 -16
  44. package/dist/utilities/time.js +9 -12
  45. package/dist/utilities/validation.js +3 -6
  46. 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
- exports.DEFAULT_TOKEN_REFRESH_BUFFER_MINUTES = 5;
10
- exports.MILLISECONDS_PER_MINUTE = 60 * 1000;
11
- exports.MINUTES_PER_HOUR = 60;
12
- exports.HOURS_PER_DAY = 24;
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
- exports.TIME_LABEL = {
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
- exports.TIME_LABEL_EXPIRED = exports.TIME_LABEL.EXPIRED;
28
- exports.TIME_LABEL_MINUTE = exports.TIME_LABEL.MINUTE;
29
- exports.TIME_LABEL_MINUTES = exports.TIME_LABEL.MINUTES;
30
- exports.TIME_LABEL_HOUR = exports.TIME_LABEL.HOUR;
31
- exports.TIME_LABEL_HOURS = exports.TIME_LABEL.HOURS;
32
- exports.TIME_LABEL_DAY = exports.TIME_LABEL.DAY;
33
- exports.TIME_LABEL_DAYS = exports.TIME_LABEL.DAYS;
34
- exports.TIME_LABEL_HOUR_SHORT = exports.TIME_LABEL.HOUR_SHORT;
35
- exports.TIME_LABEL_MINUTE_SHORT = exports.TIME_LABEL.MINUTE_SHORT;
36
- exports.TIME_LABEL_DAY_SHORT = exports.TIME_LABEL.DAY_SHORT;
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
- exports.TOKEN_STORAGE_KEY = {
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
- exports.TOKEN_STORAGE_KEY_ACCESS = exports.TOKEN_STORAGE_KEY.ACCESS;
44
- exports.TOKEN_STORAGE_KEY_REFRESH = exports.TOKEN_STORAGE_KEY.REFRESH;
40
+ export const TOKEN_STORAGE_KEY_ACCESS = TOKEN_STORAGE_KEY.ACCESS;
41
+ export const TOKEN_STORAGE_KEY_REFRESH = TOKEN_STORAGE_KEY.REFRESH;
@@ -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
- exports.API_VERSIONS = {
5
+ export const API_VERSIONS = {
9
6
  V1: 'v1',
10
7
  V2: 'v2',
11
8
  };
12
9
  // API Configuration
13
- exports.API_CONFIG = {
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
- exports.API_RESPONSE_CONFIG = {
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
- exports.API_ERROR_CODES = {
24
+ export const API_ERROR_CODES = {
28
25
  // Authentication errors
29
26
  INVALID_CREDENTIALS: 'INVALID_CREDENTIALS',
30
27
  TOKEN_EXPIRED: 'TOKEN_EXPIRED',
@@ -1,19 +1,16 @@
1
- "use strict";
2
1
  /**
3
2
  * API endpoint definitions for all services
4
3
  */
5
- Object.defineProperty(exports, "__esModule", { value: true });
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
- exports.ACCOUNT_ENDPOINTS = {
8
+ export const ACCOUNT_ENDPOINTS = {
12
9
  BASE: '/api/accounts/',
13
10
  DETAIL: (uuid) => `/api/accounts/${uuid}/`,
14
11
  };
15
12
  // Authentication endpoints
16
- exports.AUTH_ENDPOINTS = {
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
- exports.BANK_ENDPOINTS = {
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
- exports.CASH_ACCOUNT_ENDPOINTS = {
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
- exports.CASH_ACCOUNT_TRANSACTION_ENDPOINTS = {
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
- exports.COUNTRY_ENDPOINTS = {
45
+ export const COUNTRY_ENDPOINTS = {
49
46
  BASE: '/api/countries/',
50
47
  DETAIL: (uuid) => `/api/countries/${uuid}/`,
51
48
  };
52
49
  // Document endpoints
53
- exports.DOCUMENT_ENDPOINTS = {
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
- exports.INDUSTRY_ENDPOINTS = {
60
+ export const INDUSTRY_ENDPOINTS = {
64
61
  BASE: '/api/industries/',
65
62
  DETAIL: (uuid) => `/api/industries/${uuid}/`,
66
63
  };
67
64
  // Instrument endpoints
68
- exports.INSTRUMENT_ENDPOINTS = {
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
- exports.PORTFOLIO_ENDPOINTS = {
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
- exports.PORTFOLIO_TEMPLATE_ENDPOINTS = {
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
- exports.SECTOR_ENDPOINTS = {
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
- exports.STOCK_EXCHANGE_ENDPOINTS = {
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
- exports.TAX_RESIDENCY_ENDPOINTS = {
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
- exports.TRADE_ENDPOINTS = {
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
- exports.TARGET_TRADE_ENDPOINTS = {
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
- exports.TRADE_SHEET_ENDPOINTS = {
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
- exports.TARGET_TRADE_SHEET_ENDPOINTS = {
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
- exports.USER_ENDPOINTS = {
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
- exports.USER_PROFILE_ENDPOINTS = {
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
- exports.WITHDRAWAL_ENDPOINTS = {
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
- exports.WITHDRAWAL_REQUEST_ENDPOINTS = {
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
- exports.WITHDRAWAL_LIQUIDATION_ENDPOINTS = {
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
- exports.TRANSACTION_ENDPOINTS = {
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
- exports.ASSET_ALLOCATION_ENDPOINTS = {
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
- exports.ASSET_HOLDING_ENDPOINTS = {
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
- exports.ASSET_HOLDING_SNAPSHOT_ENDPOINTS = {
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
- exports.HTTP_STATUS = {
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
- exports.HTTP_HEADERS = {
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
- exports.CONTENT_TYPES = {
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
- exports.HTTP_METHODS = {
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
- exports.HTTP_HEADER_CONTENT_TYPE = exports.HTTP_HEADERS.CONTENT_TYPE;
65
- exports.CONTENT_TYPE_APPLICATION_JSON = exports.CONTENT_TYPES.JSON;
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
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- var desc = Object.getOwnPropertyDescriptor(m, k);
8
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
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';
@@ -8,11 +8,6 @@ export declare const ACCOUNT_TYPE: {
8
8
  };
9
9
  export type AccountType = (typeof ACCOUNT_TYPE)[keyof typeof ACCOUNT_TYPE];
10
10
  export declare const ACCOUNT_TYPE_LABELS: Record<AccountType, string>;
11
- export declare const SOURCE_OF_FUNDS_SALARY = "salary";
12
- export declare const SOURCE_OF_FUNDS_SAVINGS = "savings";
13
- export declare const SOURCE_OF_FUNDS_INHERITANCE = "inheritance";
14
- export declare const SOURCE_OF_FUNDS_GIFT = "gift";
15
- export declare const SOURCE_OF_FUNDS_OTHER = "other";
16
11
  export declare const SOURCE_OF_FUNDS: {
17
12
  readonly SALARY: "salary";
18
13
  readonly SAVINGS: "savings";
@@ -21,18 +16,30 @@ export declare const SOURCE_OF_FUNDS: {
21
16
  readonly OTHER: "other";
22
17
  };
23
18
  export type SourceOfFunds = (typeof SOURCE_OF_FUNDS)[keyof typeof SOURCE_OF_FUNDS];
24
- export declare const SOURCE_OF_FUNDS_LABEL_SALARY = "Salary";
25
- export declare const SOURCE_OF_FUNDS_LABEL_SAVINGS = "Savings";
26
- export declare const SOURCE_OF_FUNDS_LABEL_INHERITANCE = "Inheritance";
27
- export declare const SOURCE_OF_FUNDS_LABEL_GIFT = "Gift";
28
- export declare const SOURCE_OF_FUNDS_LABEL_OTHER = "Other";
29
19
  export declare const SOURCE_OF_FUNDS_LABELS: Record<SourceOfFunds, string>;
30
20
  export declare const ACCOUNT_TYPE_OPTIONS: {
31
21
  value: string;
32
22
  label: string;
33
23
  }[];
34
- export declare const SOURCE_OF_FUNDS_OPTIONS: {
35
- value: string;
24
+ export declare const SOURCE_OF_FUNDS_OPTIONS: ({
25
+ value: "salary";
36
26
  label: string;
37
- }[];
27
+ } | {
28
+ value: "savings";
29
+ label: string;
30
+ } | {
31
+ value: "inheritance";
32
+ label: string;
33
+ } | {
34
+ value: "gift";
35
+ label: string;
36
+ } | {
37
+ value: "other";
38
+ label: string;
39
+ })[];
40
+ export declare const SOURCE_OF_FUNDS_SALARY: "salary";
41
+ export declare const SOURCE_OF_FUNDS_SAVINGS: "savings";
42
+ export declare const SOURCE_OF_FUNDS_INHERITANCE: "inheritance";
43
+ export declare const SOURCE_OF_FUNDS_GIFT: "gift";
44
+ export declare const SOURCE_OF_FUNDS_OTHER: "other";
38
45
  //# sourceMappingURL=accounts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../src/business/accounts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE3E,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAIlD,CAAC;AAGX,eAAO,MAAM,sBAAsB,WAAW,CAAC;AAC/C,eAAO,MAAM,uBAAuB,YAAY,CAAC;AACjD,eAAO,MAAM,2BAA2B,gBAAgB,CAAC;AACzD,eAAO,MAAM,oBAAoB,SAAS,CAAC;AAC3C,eAAO,MAAM,qBAAqB,UAAU,CAAC;AAE7C,eAAO,MAAM,eAAe;;;;;;CAMlB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAGnF,eAAO,MAAM,4BAA4B,WAAW,CAAC;AACrD,eAAO,MAAM,6BAA6B,YAAY,CAAC;AACvD,eAAO,MAAM,iCAAiC,gBAAgB,CAAC;AAC/D,eAAO,MAAM,0BAA0B,SAAS,CAAC;AACjD,eAAO,MAAM,2BAA2B,UAAU,CAAC;AAEnD,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAMvD,CAAC;AAGX,eAAO,MAAM,oBAAoB;;;GAG9B,CAAC;AAGJ,eAAO,MAAM,uBAAuB;;;GAMnC,CAAC"}
1
+ {"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../src/business/accounts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE3E,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAIlD,CAAC;AAGX,eAAO,MAAM,eAAe;;;;;;CAMlB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAEnF,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAMvD,CAAC;AAGX,eAAO,MAAM,oBAAoB;;;GAG9B,CAAC;AAGJ,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;IAMnC,CAAC;AAGF,eAAO,MAAM,sBAAsB,UAAyB,CAAC;AAC7D,eAAO,MAAM,uBAAuB,WAA0B,CAAC;AAC/D,eAAO,MAAM,2BAA2B,eAA8B,CAAC;AACvE,eAAO,MAAM,oBAAoB,QAAuB,CAAC;AACzD,eAAO,MAAM,qBAAqB,SAAwB,CAAC"}
@@ -1,56 +1,48 @@
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
- exports.ACCOUNT_TYPE = {
5
+ export const ACCOUNT_TYPE = {
9
6
  TRANSACTION: 'TRANSACTION',
10
7
  SAVINGS: 'SAVINGS',
11
8
  OTHER: 'OTHER',
12
9
  };
13
- exports.ACCOUNT_TYPE_LABELS = {
14
- [exports.ACCOUNT_TYPE.TRANSACTION]: 'Transaction Account',
15
- [exports.ACCOUNT_TYPE.SAVINGS]: 'Savings Account',
16
- [exports.ACCOUNT_TYPE.OTHER]: 'Other',
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
- exports.SOURCE_OF_FUNDS_SALARY = 'salary';
20
- exports.SOURCE_OF_FUNDS_SAVINGS = 'savings';
21
- exports.SOURCE_OF_FUNDS_INHERITANCE = 'inheritance';
22
- exports.SOURCE_OF_FUNDS_GIFT = 'gift';
23
- exports.SOURCE_OF_FUNDS_OTHER = 'other';
24
- exports.SOURCE_OF_FUNDS = {
25
- SALARY: exports.SOURCE_OF_FUNDS_SALARY,
26
- SAVINGS: exports.SOURCE_OF_FUNDS_SAVINGS,
27
- INHERITANCE: exports.SOURCE_OF_FUNDS_INHERITANCE,
28
- GIFT: exports.SOURCE_OF_FUNDS_GIFT,
29
- OTHER: exports.SOURCE_OF_FUNDS_OTHER,
16
+ export const SOURCE_OF_FUNDS = {
17
+ SALARY: 'salary',
18
+ SAVINGS: 'savings',
19
+ INHERITANCE: 'inheritance',
20
+ GIFT: 'gift',
21
+ OTHER: 'other',
30
22
  };
31
- // Source of funds label constants
32
- exports.SOURCE_OF_FUNDS_LABEL_SALARY = 'Salary';
33
- exports.SOURCE_OF_FUNDS_LABEL_SAVINGS = 'Savings';
34
- exports.SOURCE_OF_FUNDS_LABEL_INHERITANCE = 'Inheritance';
35
- exports.SOURCE_OF_FUNDS_LABEL_GIFT = 'Gift';
36
- exports.SOURCE_OF_FUNDS_LABEL_OTHER = 'Other';
37
- exports.SOURCE_OF_FUNDS_LABELS = {
38
- [exports.SOURCE_OF_FUNDS.SALARY]: exports.SOURCE_OF_FUNDS_LABEL_SALARY,
39
- [exports.SOURCE_OF_FUNDS.SAVINGS]: exports.SOURCE_OF_FUNDS_LABEL_SAVINGS,
40
- [exports.SOURCE_OF_FUNDS.INHERITANCE]: exports.SOURCE_OF_FUNDS_LABEL_INHERITANCE,
41
- [exports.SOURCE_OF_FUNDS.GIFT]: exports.SOURCE_OF_FUNDS_LABEL_GIFT,
42
- [exports.SOURCE_OF_FUNDS.OTHER]: exports.SOURCE_OF_FUNDS_LABEL_OTHER,
23
+ export const SOURCE_OF_FUNDS_LABELS = {
24
+ [SOURCE_OF_FUNDS.SALARY]: 'Salary',
25
+ [SOURCE_OF_FUNDS.SAVINGS]: 'Savings',
26
+ [SOURCE_OF_FUNDS.INHERITANCE]: 'Inheritance',
27
+ [SOURCE_OF_FUNDS.GIFT]: 'Gift',
28
+ [SOURCE_OF_FUNDS.OTHER]: 'Other',
43
29
  };
44
30
  // Account options for forms
45
- exports.ACCOUNT_TYPE_OPTIONS = Object.entries(exports.ACCOUNT_TYPE_LABELS).map(([value, label]) => ({
31
+ export const ACCOUNT_TYPE_OPTIONS = Object.entries(ACCOUNT_TYPE_LABELS).map(([value, label]) => ({
46
32
  value,
47
33
  label,
48
34
  }));
49
35
  // Source of funds options
50
- exports.SOURCE_OF_FUNDS_OPTIONS = [
51
- { value: exports.SOURCE_OF_FUNDS_SALARY, label: exports.SOURCE_OF_FUNDS_LABEL_SALARY },
52
- { value: exports.SOURCE_OF_FUNDS_SAVINGS, label: exports.SOURCE_OF_FUNDS_LABEL_SAVINGS },
53
- { value: exports.SOURCE_OF_FUNDS_INHERITANCE, label: exports.SOURCE_OF_FUNDS_LABEL_INHERITANCE },
54
- { value: exports.SOURCE_OF_FUNDS_GIFT, label: exports.SOURCE_OF_FUNDS_LABEL_GIFT },
55
- { value: exports.SOURCE_OF_FUNDS_OTHER, label: exports.SOURCE_OF_FUNDS_LABEL_OTHER },
36
+ export const SOURCE_OF_FUNDS_OPTIONS = [
37
+ { value: SOURCE_OF_FUNDS.SALARY, label: SOURCE_OF_FUNDS_LABELS[SOURCE_OF_FUNDS.SALARY] },
38
+ { value: SOURCE_OF_FUNDS.SAVINGS, label: SOURCE_OF_FUNDS_LABELS[SOURCE_OF_FUNDS.SAVINGS] },
39
+ { value: SOURCE_OF_FUNDS.INHERITANCE, label: SOURCE_OF_FUNDS_LABELS[SOURCE_OF_FUNDS.INHERITANCE] },
40
+ { value: SOURCE_OF_FUNDS.GIFT, label: SOURCE_OF_FUNDS_LABELS[SOURCE_OF_FUNDS.GIFT] },
41
+ { value: SOURCE_OF_FUNDS.OTHER, label: SOURCE_OF_FUNDS_LABELS[SOURCE_OF_FUNDS.OTHER] },
56
42
  ];
43
+ // Legacy individual exports for backward compatibility
44
+ export const SOURCE_OF_FUNDS_SALARY = SOURCE_OF_FUNDS.SALARY;
45
+ export const SOURCE_OF_FUNDS_SAVINGS = SOURCE_OF_FUNDS.SAVINGS;
46
+ export const SOURCE_OF_FUNDS_INHERITANCE = SOURCE_OF_FUNDS.INHERITANCE;
47
+ export const SOURCE_OF_FUNDS_GIFT = SOURCE_OF_FUNDS.GIFT;
48
+ export const SOURCE_OF_FUNDS_OTHER = SOURCE_OF_FUNDS.OTHER;