@cranberry-money/shared-services 3.0.1 → 4.1.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.
- package/dist/index.d.ts +0 -27
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -115
- package/package.json +4 -3
- package/dist/api/functional-client.d.ts +0 -66
- package/dist/api/functional-client.d.ts.map +0 -1
- package/dist/api/functional-client.js +0 -165
- package/dist/auth/functional/auth-operations.d.ts +0 -116
- package/dist/auth/functional/auth-operations.d.ts.map +0 -1
- package/dist/auth/functional/auth-operations.js +0 -246
- package/dist/auth/functional/auth-state.d.ts +0 -38
- package/dist/auth/functional/auth-state.d.ts.map +0 -1
- package/dist/auth/functional/auth-state.js +0 -87
- package/dist/auth/functional/token-storage.d.ts +0 -44
- package/dist/auth/functional/token-storage.d.ts.map +0 -1
- package/dist/auth/functional/token-storage.js +0 -178
- package/dist/auth/react/AuthProvider.d.ts +0 -92
- package/dist/auth/react/AuthProvider.d.ts.map +0 -1
- package/dist/auth/react/AuthProvider.js +0 -207
- package/dist/integration/blueberry-integration.d.ts +0 -21
- package/dist/integration/blueberry-integration.d.ts.map +0 -1
- package/dist/integration/blueberry-integration.js +0 -109
- package/dist/integration/index.d.ts +0 -8
- package/dist/integration/index.d.ts.map +0 -1
- package/dist/integration/index.js +0 -18
- package/dist/services/accounts.d.ts +0 -220
- package/dist/services/accounts.d.ts.map +0 -1
- package/dist/services/accounts.js +0 -175
- package/dist/services/banks.d.ts +0 -123
- package/dist/services/banks.d.ts.map +0 -1
- package/dist/services/banks.js +0 -151
- package/dist/services/cash-accounts.d.ts +0 -112
- package/dist/services/cash-accounts.d.ts.map +0 -1
- package/dist/services/cash-accounts.js +0 -222
- package/dist/services/documents.d.ts +0 -143
- package/dist/services/documents.d.ts.map +0 -1
- package/dist/services/documents.js +0 -253
- package/dist/services/factories/account-factory.d.ts +0 -16
- package/dist/services/factories/account-factory.d.ts.map +0 -1
- package/dist/services/factories/account-factory.js +0 -79
- package/dist/services/factories/auth-factory.d.ts +0 -23
- package/dist/services/factories/auth-factory.d.ts.map +0 -1
- package/dist/services/factories/auth-factory.js +0 -75
- package/dist/services/factories/bank-factory.d.ts +0 -16
- package/dist/services/factories/bank-factory.d.ts.map +0 -1
- package/dist/services/factories/bank-factory.js +0 -72
- package/dist/services/factories/cash-account-factory.d.ts +0 -16
- package/dist/services/factories/cash-account-factory.d.ts.map +0 -1
- package/dist/services/factories/cash-account-factory.js +0 -74
- package/dist/services/factories/document-factory.d.ts +0 -16
- package/dist/services/factories/document-factory.d.ts.map +0 -1
- package/dist/services/factories/document-factory.js +0 -85
- package/dist/services/factories/index.d.ts +0 -21
- package/dist/services/factories/index.d.ts.map +0 -1
- package/dist/services/factories/index.js +0 -40
- package/dist/services/factories/instrument-factory.d.ts +0 -16
- package/dist/services/factories/instrument-factory.d.ts.map +0 -1
- package/dist/services/factories/instrument-factory.js +0 -68
- package/dist/services/factories/master-factory.d.ts +0 -74
- package/dist/services/factories/master-factory.d.ts.map +0 -1
- package/dist/services/factories/master-factory.js +0 -183
- package/dist/services/factories/portfolio-factory.d.ts +0 -16
- package/dist/services/factories/portfolio-factory.d.ts.map +0 -1
- package/dist/services/factories/portfolio-factory.js +0 -74
- package/dist/services/factories/portfolio-template-factory.d.ts +0 -16
- package/dist/services/factories/portfolio-template-factory.d.ts.map +0 -1
- package/dist/services/factories/portfolio-template-factory.js +0 -76
- package/dist/services/factories/reference-data-factory.d.ts +0 -16
- package/dist/services/factories/reference-data-factory.d.ts.map +0 -1
- package/dist/services/factories/reference-data-factory.js +0 -86
- package/dist/services/factories/tax-residency-factory.d.ts +0 -16
- package/dist/services/factories/tax-residency-factory.d.ts.map +0 -1
- package/dist/services/factories/tax-residency-factory.js +0 -73
- package/dist/services/factories/trade-factory.d.ts +0 -16
- package/dist/services/factories/trade-factory.d.ts.map +0 -1
- package/dist/services/factories/trade-factory.js +0 -79
- package/dist/services/factories/types.d.ts +0 -250
- package/dist/services/factories/types.d.ts.map +0 -1
- package/dist/services/factories/types.js +0 -32
- package/dist/services/factories/withdrawal-factory.d.ts +0 -16
- package/dist/services/factories/withdrawal-factory.d.ts.map +0 -1
- package/dist/services/factories/withdrawal-factory.js +0 -78
- package/dist/services/instruments.d.ts +0 -138
- package/dist/services/instruments.d.ts.map +0 -1
- package/dist/services/instruments.js +0 -178
- package/dist/services/portfolio-templates.d.ts +0 -142
- package/dist/services/portfolio-templates.d.ts.map +0 -1
- package/dist/services/portfolio-templates.js +0 -201
- package/dist/services/portfolios.d.ts +0 -157
- package/dist/services/portfolios.d.ts.map +0 -1
- package/dist/services/portfolios.js +0 -144
- package/dist/services/reference-data.d.ts +0 -185
- package/dist/services/reference-data.d.ts.map +0 -1
- package/dist/services/reference-data.js +0 -245
- package/dist/services/tax-residencies.d.ts +0 -83
- package/dist/services/tax-residencies.d.ts.map +0 -1
- package/dist/services/tax-residencies.js +0 -179
- package/dist/services/trades.d.ts +0 -190
- package/dist/services/trades.d.ts.map +0 -1
- package/dist/services/trades.js +0 -207
- package/dist/services/withdrawals.d.ts +0 -236
- package/dist/services/withdrawals.d.ts.map +0 -1
- package/dist/services/withdrawals.js +0 -345
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AuthProvider.d.ts","sourceRoot":"","sources":["../../../src/auth/react/AuthProvider.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAsE,MAAM,OAAO,CAAC;AAC3F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAuBpG,UAAU,gBAAgB;IAExB,KAAK,EAAE,SAAS,CAAC;IAGjB,MAAM,EAAE,CAAC,WAAW,EAAE,aAAa,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,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C/D,OAAO,CAAC,IAAI,CAAC;yBACb,MAAM,KAAK,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;kCACjD,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;sBAG3D,IAAI;6CACmB,aAAa,KAAK,MAAM,EAAE;mCACpC,aAAa,KAAK,MAAM,EAAE;CAgN1D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS,MAAM,EACvC,WAAW,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,KAChC,KAAK,CAAC,aAAa,CAAC,CAAC,CAcvB,CAAC;AAEF;;GAEG;AACH,UAAU,cAAc;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAiB9C,CAAC"}
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AuthGuard = exports.withAuth = exports.useAuthActions = exports.useAuthState = exports.useAuth = exports.AuthProvider = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
/**
|
|
6
|
-
* React Authentication Provider
|
|
7
|
-
*
|
|
8
|
-
* Pure functional authentication with React state management.
|
|
9
|
-
* Uses the pure auth functions with React context for state management.
|
|
10
|
-
*/
|
|
11
|
-
const react_1 = require("react");
|
|
12
|
-
const auth_state_1 = require("../functional/auth-state");
|
|
13
|
-
const auth_operations_1 = require("../functional/auth-operations");
|
|
14
|
-
// Create context with null default (will throw if used outside provider)
|
|
15
|
-
const AuthContext = (0, react_1.createContext)(null);
|
|
16
|
-
/**
|
|
17
|
-
* Authentication Provider Component
|
|
18
|
-
*
|
|
19
|
-
* Manages authentication state using pure functions and React state.
|
|
20
|
-
* Provides a clean, predictable interface for authentication operations.
|
|
21
|
-
*/
|
|
22
|
-
const AuthProvider = ({ children, dependencies, autoInitialize = true, }) => {
|
|
23
|
-
const [state, setState] = (0, react_1.useState)(auth_state_1.createInitialAuthState);
|
|
24
|
-
// Initialize authentication state from storage
|
|
25
|
-
(0, react_1.useEffect)(() => {
|
|
26
|
-
if (!autoInitialize)
|
|
27
|
-
return;
|
|
28
|
-
const initialize = async () => {
|
|
29
|
-
setState(auth_state_1.createLoadingAuthState);
|
|
30
|
-
try {
|
|
31
|
-
const result = await (0, auth_operations_1.initializeFromStorage)(dependencies);
|
|
32
|
-
if (result) {
|
|
33
|
-
setState((0, auth_state_1.createAuthenticatedState)(result.user, result.tokens));
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
setState((0, auth_state_1.createUnauthenticatedState)());
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
catch (error) {
|
|
40
|
-
setState((0, auth_state_1.createErrorState)((0, auth_state_1.createInitialAuthState)(), 'Failed to initialize authentication'));
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
initialize();
|
|
44
|
-
}, [dependencies, autoInitialize]);
|
|
45
|
-
// Authentication actions
|
|
46
|
-
const handleSignin = (0, react_1.useCallback)(async (credentials) => {
|
|
47
|
-
setState(prevState => (0, auth_state_1.createLoadingAuthState)(prevState));
|
|
48
|
-
try {
|
|
49
|
-
const result = await (0, auth_operations_1.signin)(credentials, dependencies);
|
|
50
|
-
setState((0, auth_state_1.createAuthenticatedState)(result.user, result.tokens));
|
|
51
|
-
}
|
|
52
|
-
catch (error) {
|
|
53
|
-
const errorMessage = error instanceof Error ? error.message : 'Sign in failed';
|
|
54
|
-
setState(prevState => (0, auth_state_1.createErrorState)(prevState, errorMessage));
|
|
55
|
-
throw error;
|
|
56
|
-
}
|
|
57
|
-
}, [dependencies]);
|
|
58
|
-
const handleSignout = (0, react_1.useCallback)(async () => {
|
|
59
|
-
setState(prevState => (0, auth_state_1.createLoadingAuthState)(prevState));
|
|
60
|
-
try {
|
|
61
|
-
await (0, auth_operations_1.signout)(dependencies);
|
|
62
|
-
setState((0, auth_state_1.createUnauthenticatedState)());
|
|
63
|
-
}
|
|
64
|
-
catch (error) {
|
|
65
|
-
// Even if signout fails, clear local state
|
|
66
|
-
setState((0, auth_state_1.createUnauthenticatedState)());
|
|
67
|
-
throw error;
|
|
68
|
-
}
|
|
69
|
-
}, [dependencies]);
|
|
70
|
-
const handleSignup = (0, react_1.useCallback)(async (userData) => {
|
|
71
|
-
setState(prevState => (0, auth_state_1.createLoadingAuthState)(prevState));
|
|
72
|
-
try {
|
|
73
|
-
const result = await (0, auth_operations_1.signup)(userData, dependencies);
|
|
74
|
-
setState(prevState => ({ ...prevState, isLoading: false }));
|
|
75
|
-
return result;
|
|
76
|
-
}
|
|
77
|
-
catch (error) {
|
|
78
|
-
const errorMessage = error instanceof Error ? error.message : 'Signup failed';
|
|
79
|
-
setState(prevState => (0, auth_state_1.createErrorState)(prevState, errorMessage));
|
|
80
|
-
return { success: false, message: errorMessage };
|
|
81
|
-
}
|
|
82
|
-
}, [dependencies]);
|
|
83
|
-
const handleRefreshTokens = (0, react_1.useCallback)(async () => {
|
|
84
|
-
if (!state.tokens) {
|
|
85
|
-
throw new Error('No tokens to refresh');
|
|
86
|
-
}
|
|
87
|
-
try {
|
|
88
|
-
const newTokens = await (0, auth_operations_1.refreshTokens)(state.tokens, dependencies);
|
|
89
|
-
setState(prevState => (0, auth_state_1.updateTokens)(prevState, newTokens));
|
|
90
|
-
}
|
|
91
|
-
catch (error) {
|
|
92
|
-
// If refresh fails, sign out user
|
|
93
|
-
setState((0, auth_state_1.createUnauthenticatedState)());
|
|
94
|
-
throw error;
|
|
95
|
-
}
|
|
96
|
-
}, [state.tokens, dependencies]);
|
|
97
|
-
const handleVerifyEmail = (0, react_1.useCallback)(async (token) => {
|
|
98
|
-
setState(prevState => (0, auth_state_1.createLoadingAuthState)(prevState));
|
|
99
|
-
try {
|
|
100
|
-
const result = await (0, auth_operations_1.verifyEmail)({ token }, dependencies);
|
|
101
|
-
setState(prevState => ({ ...prevState, isLoading: false }));
|
|
102
|
-
return result;
|
|
103
|
-
}
|
|
104
|
-
catch (error) {
|
|
105
|
-
const errorMessage = error instanceof Error ? error.message : 'Email verification failed';
|
|
106
|
-
setState(prevState => (0, auth_state_1.createErrorState)(prevState, errorMessage));
|
|
107
|
-
return { success: false, message: errorMessage };
|
|
108
|
-
}
|
|
109
|
-
}, [dependencies]);
|
|
110
|
-
const handleResendVerificationCode = (0, react_1.useCallback)(async () => {
|
|
111
|
-
setState(prevState => (0, auth_state_1.createLoadingAuthState)(prevState));
|
|
112
|
-
try {
|
|
113
|
-
const result = await (0, auth_operations_1.resendVerificationCode)(dependencies);
|
|
114
|
-
setState(prevState => ({ ...prevState, isLoading: false }));
|
|
115
|
-
return result;
|
|
116
|
-
}
|
|
117
|
-
catch (error) {
|
|
118
|
-
const errorMessage = error instanceof Error ? error.message : 'Failed to resend verification code';
|
|
119
|
-
setState(prevState => (0, auth_state_1.createErrorState)(prevState, errorMessage));
|
|
120
|
-
return { success: false, message: errorMessage };
|
|
121
|
-
}
|
|
122
|
-
}, [dependencies]);
|
|
123
|
-
const handleClearError = (0, react_1.useCallback)(() => {
|
|
124
|
-
setState(prevState => (0, auth_state_1.clearError)(prevState));
|
|
125
|
-
}, []);
|
|
126
|
-
// Context value
|
|
127
|
-
const contextValue = {
|
|
128
|
-
state,
|
|
129
|
-
signin: handleSignin,
|
|
130
|
-
signout: handleSignout,
|
|
131
|
-
signup: handleSignup,
|
|
132
|
-
refreshTokens: handleRefreshTokens,
|
|
133
|
-
verifyEmail: handleVerifyEmail,
|
|
134
|
-
resendVerificationCode: handleResendVerificationCode,
|
|
135
|
-
clearError: handleClearError,
|
|
136
|
-
validateSigninCredentials: auth_operations_1.validateSigninCredentials,
|
|
137
|
-
validateSignupData: auth_operations_1.validateSignupData,
|
|
138
|
-
};
|
|
139
|
-
return ((0, jsx_runtime_1.jsx)(AuthContext.Provider, { value: contextValue, children: children }));
|
|
140
|
-
};
|
|
141
|
-
exports.AuthProvider = AuthProvider;
|
|
142
|
-
/**
|
|
143
|
-
* Hook to use authentication context
|
|
144
|
-
*
|
|
145
|
-
* @returns Authentication context value
|
|
146
|
-
* @throws Error if used outside AuthProvider
|
|
147
|
-
*/
|
|
148
|
-
const useAuth = () => {
|
|
149
|
-
const context = (0, react_1.useContext)(AuthContext);
|
|
150
|
-
if (!context) {
|
|
151
|
-
throw new Error('useAuth must be used within an AuthProvider');
|
|
152
|
-
}
|
|
153
|
-
return context;
|
|
154
|
-
};
|
|
155
|
-
exports.useAuth = useAuth;
|
|
156
|
-
/**
|
|
157
|
-
* Hook to get authentication state only (for components that only need to read state)
|
|
158
|
-
*/
|
|
159
|
-
const useAuthState = () => {
|
|
160
|
-
const { state } = (0, exports.useAuth)();
|
|
161
|
-
return state;
|
|
162
|
-
};
|
|
163
|
-
exports.useAuthState = useAuthState;
|
|
164
|
-
/**
|
|
165
|
-
* Hook for authentication actions only (for components that only need actions)
|
|
166
|
-
*/
|
|
167
|
-
const useAuthActions = () => {
|
|
168
|
-
const { signin, signout, signup, refreshTokens, verifyEmail, resendVerificationCode, clearError, validateSigninCredentials, validateSignupData, } = (0, exports.useAuth)();
|
|
169
|
-
return {
|
|
170
|
-
signin,
|
|
171
|
-
signout,
|
|
172
|
-
signup,
|
|
173
|
-
refreshTokens,
|
|
174
|
-
verifyEmail,
|
|
175
|
-
resendVerificationCode,
|
|
176
|
-
clearError,
|
|
177
|
-
validateSigninCredentials,
|
|
178
|
-
validateSignupData,
|
|
179
|
-
};
|
|
180
|
-
};
|
|
181
|
-
exports.useAuthActions = useAuthActions;
|
|
182
|
-
/**
|
|
183
|
-
* Higher-order component for components that require authentication
|
|
184
|
-
*/
|
|
185
|
-
const withAuth = (Component) => {
|
|
186
|
-
const AuthenticatedComponent = (props) => {
|
|
187
|
-
const { state } = (0, exports.useAuth)();
|
|
188
|
-
if (!state.isAuthenticated) {
|
|
189
|
-
return (0, jsx_runtime_1.jsx)("div", { children: "Please sign in to continue." });
|
|
190
|
-
}
|
|
191
|
-
return (0, jsx_runtime_1.jsx)(Component, { ...props });
|
|
192
|
-
};
|
|
193
|
-
AuthenticatedComponent.displayName = `withAuth(${Component.displayName || Component.name})`;
|
|
194
|
-
return AuthenticatedComponent;
|
|
195
|
-
};
|
|
196
|
-
exports.withAuth = withAuth;
|
|
197
|
-
const AuthGuard = ({ children, fallback = (0, jsx_runtime_1.jsx)("div", { children: "Access denied" }), requireAuth = true, requireVerification = false, }) => {
|
|
198
|
-
const { state } = (0, exports.useAuth)();
|
|
199
|
-
if (requireAuth && !state.isAuthenticated) {
|
|
200
|
-
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: fallback });
|
|
201
|
-
}
|
|
202
|
-
if (requireVerification && state.user && !state.user.isVerified) {
|
|
203
|
-
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: fallback });
|
|
204
|
-
}
|
|
205
|
-
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
|
|
206
|
-
};
|
|
207
|
-
exports.AuthGuard = AuthGuard;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Blueberry Dashboard Integration Example
|
|
3
|
-
*
|
|
4
|
-
* Demonstrates how to integrate the functional architecture with the Blueberry React dashboard.
|
|
5
|
-
* Clean, simple setup with pure functional services.
|
|
6
|
-
*/
|
|
7
|
-
import React from 'react';
|
|
8
|
-
export declare const setupBlueberryServices: () => {
|
|
9
|
-
services: import("../index").ServiceFactory;
|
|
10
|
-
};
|
|
11
|
-
export declare const BlueberryAuthProvider: React.FC<{
|
|
12
|
-
children: React.ReactNode;
|
|
13
|
-
}>;
|
|
14
|
-
export declare const BlueberryDashboard: React.FC;
|
|
15
|
-
export declare const BlueberryApp: React.FC;
|
|
16
|
-
export declare const enableFunctionalPortfolios: () => void;
|
|
17
|
-
export declare const getMigrationProgress: () => {
|
|
18
|
-
progress: number;
|
|
19
|
-
status: string;
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=blueberry-integration.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"blueberry-integration.d.ts","sourceRoot":"","sources":["../../src/integration/blueberry-integration.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,eAAO,MAAM,sBAAsB;;CAUlC,CAAC;AAGF,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAoBzE,CAAC;AAGF,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAkHtC,CAAC;AAGF,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAWhC,CAAC;AAGF,eAAO,MAAM,0BAA0B,YAEtC,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;CAEhC,CAAC"}
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getMigrationProgress = exports.enableFunctionalPortfolios = exports.BlueberryApp = exports.BlueberryDashboard = exports.BlueberryAuthProvider = exports.setupBlueberryServices = void 0;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
/**
|
|
9
|
-
* Blueberry Dashboard Integration Example
|
|
10
|
-
*
|
|
11
|
-
* Demonstrates how to integrate the functional architecture with the Blueberry React dashboard.
|
|
12
|
-
* Clean, simple setup with pure functional services.
|
|
13
|
-
*/
|
|
14
|
-
const react_1 = __importDefault(require("react"));
|
|
15
|
-
const index_1 = require("../index");
|
|
16
|
-
// Example of how to set up services in a real application
|
|
17
|
-
const setupBlueberryServices = () => {
|
|
18
|
-
// Create functional services with explicit configuration
|
|
19
|
-
const services = (0, index_1.createWebServiceFactory)('https://api.cranberry.com', {
|
|
20
|
-
apiTimeout: 10000,
|
|
21
|
-
enableCredentials: true,
|
|
22
|
-
});
|
|
23
|
-
return {
|
|
24
|
-
services,
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
exports.setupBlueberryServices = setupBlueberryServices;
|
|
28
|
-
// Example React component using the new architecture
|
|
29
|
-
const BlueberryAuthProvider = ({ children }) => {
|
|
30
|
-
const authState = (0, index_1.useAuthState)();
|
|
31
|
-
const authActions = (0, index_1.useAuthActions)();
|
|
32
|
-
return ((0, jsx_runtime_1.jsx)("div", { children: authState.isAuthenticated ? ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("p", { children: ["Welcome, ", authState.user?.firstName, "!"] }), (0, jsx_runtime_1.jsx)("button", { onClick: authActions.signout, children: "Sign Out" }), children] })) : ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("p", { children: "Please sign in to continue" }) })) }));
|
|
33
|
-
};
|
|
34
|
-
exports.BlueberryAuthProvider = BlueberryAuthProvider;
|
|
35
|
-
// Example dashboard component showing comprehensive service usage
|
|
36
|
-
const BlueberryDashboard = () => {
|
|
37
|
-
const authState = (0, index_1.useAuthState)();
|
|
38
|
-
const [portfolios, setPortfolios] = react_1.default.useState([]);
|
|
39
|
-
const [countries, setCountries] = react_1.default.useState([]);
|
|
40
|
-
const [instruments, setInstruments] = react_1.default.useState([]);
|
|
41
|
-
const [cashAccounts, setCashAccounts] = react_1.default.useState([]);
|
|
42
|
-
const [trades, setTrades] = react_1.default.useState([]);
|
|
43
|
-
react_1.default.useEffect(() => {
|
|
44
|
-
if (authState.isAuthenticated) {
|
|
45
|
-
// Example of how Blueberry would use the comprehensive services
|
|
46
|
-
const services = (0, exports.setupBlueberryServices)();
|
|
47
|
-
// Load portfolios with advanced features
|
|
48
|
-
services.services.portfolio.getPortfolios({
|
|
49
|
-
isActive: true,
|
|
50
|
-
sortBy: 'totalValue',
|
|
51
|
-
sortOrder: 'desc'
|
|
52
|
-
}).then(result => {
|
|
53
|
-
setPortfolios(result.results);
|
|
54
|
-
}).catch(error => {
|
|
55
|
-
console.error('Failed to load portfolios:', error);
|
|
56
|
-
});
|
|
57
|
-
// Load reference data
|
|
58
|
-
services.services.referenceData.getAvailableCountries().then((result) => {
|
|
59
|
-
setCountries(result.results || []);
|
|
60
|
-
}).catch((error) => {
|
|
61
|
-
console.error('Failed to load countries:', error);
|
|
62
|
-
});
|
|
63
|
-
// Search for popular ETFs
|
|
64
|
-
services.services.instrument.getETFs({
|
|
65
|
-
page_size: 10,
|
|
66
|
-
ordering: '-current_price'
|
|
67
|
-
}).then((result) => {
|
|
68
|
-
setInstruments(result.results);
|
|
69
|
-
}).catch((error) => {
|
|
70
|
-
console.error('Failed to load ETFs:', error);
|
|
71
|
-
});
|
|
72
|
-
// Load cash accounts
|
|
73
|
-
services.services.cashAccount.getCashAccounts().then((result) => {
|
|
74
|
-
setCashAccounts(result.results);
|
|
75
|
-
}).catch((error) => {
|
|
76
|
-
console.error('Failed to load cash accounts:', error);
|
|
77
|
-
});
|
|
78
|
-
// Load recent trades
|
|
79
|
-
services.services.trade.getTrades({
|
|
80
|
-
status: 'EXECUTED'
|
|
81
|
-
}).then((result) => {
|
|
82
|
-
setTrades(result.results);
|
|
83
|
-
}).catch((error) => {
|
|
84
|
-
console.error('Failed to load trades:', error);
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
}, [authState.isAuthenticated]);
|
|
88
|
-
if (!authState.isAuthenticated) {
|
|
89
|
-
return (0, jsx_runtime_1.jsx)("div", { children: "Access denied. Please sign in." });
|
|
90
|
-
}
|
|
91
|
-
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h1", { children: "Portfolio Dashboard" }), (0, jsx_runtime_1.jsxs)("p", { children: ["Welcome to your portfolio, ", authState.user?.firstName, "!"] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("h2", { children: ["Your Portfolios (", portfolios.length, ")"] }), portfolios.map(portfolio => ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h3", { children: portfolio.name }), (0, jsx_runtime_1.jsxs)("p", { children: ["Value: $", portfolio.totalValue || portfolio.marketValue] })] }, portfolio.id || portfolio.uuid)))] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("h2", { children: ["Cash Accounts (", cashAccounts.length, ")"] }), cashAccounts.slice(0, 3).map(account => ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("p", { children: [account.currency, ": $", account.balance] }) }, account.uuid)))] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("h2", { children: ["Popular ETFs (", instruments.length, ")"] }), instruments.slice(0, 5).map(instrument => ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("p", { children: [instrument.symbol, " - ", instrument.name] }), (0, jsx_runtime_1.jsxs)("p", { children: ["Price: $", instrument.currentPrice] })] }, instrument.uuid)))] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("h2", { children: ["Recent Trades (", trades.length, ")"] }), trades.map(trade => ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)("p", { children: [trade.type, ": ", trade.quantity, " shares @ $", trade.price] }) }, trade.id)))] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("h2", { children: ["Available Countries (", countries.length, ")"] }), countries.slice(0, 5).map(country => ((0, jsx_runtime_1.jsxs)("div", { children: [country.name, " (", country.code, ")"] }, country.id)))] })] }));
|
|
92
|
-
};
|
|
93
|
-
exports.BlueberryDashboard = BlueberryDashboard;
|
|
94
|
-
// Main app component showing complete integration
|
|
95
|
-
const BlueberryApp = () => {
|
|
96
|
-
const services = (0, exports.setupBlueberryServices)();
|
|
97
|
-
const AuthProvider = services.services.auth.createAuthProvider();
|
|
98
|
-
return ((0, jsx_runtime_1.jsx)(AuthProvider, { children: (0, jsx_runtime_1.jsx)(exports.BlueberryAuthProvider, { children: (0, jsx_runtime_1.jsx)(exports.BlueberryDashboard, {}) }) }));
|
|
99
|
-
};
|
|
100
|
-
exports.BlueberryApp = BlueberryApp;
|
|
101
|
-
// Simple functions for demonstration
|
|
102
|
-
const enableFunctionalPortfolios = () => {
|
|
103
|
-
console.log('Functional portfolios enabled');
|
|
104
|
-
};
|
|
105
|
-
exports.enableFunctionalPortfolios = enableFunctionalPortfolios;
|
|
106
|
-
const getMigrationProgress = () => {
|
|
107
|
-
return { progress: 100, status: 'Complete - pure functional architecture' };
|
|
108
|
-
};
|
|
109
|
-
exports.getMigrationProgress = getMigrationProgress;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Integration Utilities Export
|
|
3
|
-
*
|
|
4
|
-
* Provides integration examples and tools for connecting the functional architecture
|
|
5
|
-
* with existing applications like Blueberry dashboard.
|
|
6
|
-
*/
|
|
7
|
-
export { BlueberryApp, BlueberryAuthProvider, BlueberryDashboard, setupBlueberryServices, enableFunctionalPortfolios, getMigrationProgress, } from './blueberry-integration';
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/integration/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,EACtB,0BAA0B,EAC1B,oBAAoB,GACrB,MAAM,yBAAyB,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Integration Utilities Export
|
|
4
|
-
*
|
|
5
|
-
* Provides integration examples and tools for connecting the functional architecture
|
|
6
|
-
* with existing applications like Blueberry dashboard.
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.getMigrationProgress = exports.enableFunctionalPortfolios = exports.setupBlueberryServices = exports.BlueberryDashboard = exports.BlueberryAuthProvider = exports.BlueberryApp = void 0;
|
|
10
|
-
// Blueberry integration
|
|
11
|
-
var blueberry_integration_1 = require("./blueberry-integration");
|
|
12
|
-
Object.defineProperty(exports, "BlueberryApp", { enumerable: true, get: function () { return blueberry_integration_1.BlueberryApp; } });
|
|
13
|
-
Object.defineProperty(exports, "BlueberryAuthProvider", { enumerable: true, get: function () { return blueberry_integration_1.BlueberryAuthProvider; } });
|
|
14
|
-
Object.defineProperty(exports, "BlueberryDashboard", { enumerable: true, get: function () { return blueberry_integration_1.BlueberryDashboard; } });
|
|
15
|
-
Object.defineProperty(exports, "setupBlueberryServices", { enumerable: true, get: function () { return blueberry_integration_1.setupBlueberryServices; } });
|
|
16
|
-
Object.defineProperty(exports, "enableFunctionalPortfolios", { enumerable: true, get: function () { return blueberry_integration_1.enableFunctionalPortfolios; } });
|
|
17
|
-
Object.defineProperty(exports, "getMigrationProgress", { enumerable: true, get: function () { return blueberry_integration_1.getMigrationProgress; } });
|
|
18
|
-
// Performance benchmarking removed for simplicity
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Account Services - Pure Functional Implementation
|
|
3
|
-
*
|
|
4
|
-
* User account, profile, and investment preferences operations as pure functions.
|
|
5
|
-
* No global state, no side effects - everything is explicit and testable.
|
|
6
|
-
*/
|
|
7
|
-
import type { ApiClient } from '../api/functional-client';
|
|
8
|
-
export interface User {
|
|
9
|
-
readonly id: string;
|
|
10
|
-
readonly email: string;
|
|
11
|
-
readonly firstName: string;
|
|
12
|
-
readonly lastName: string;
|
|
13
|
-
readonly isVerified: boolean;
|
|
14
|
-
readonly isSignupCompleted: boolean;
|
|
15
|
-
readonly createdAt: string;
|
|
16
|
-
readonly updatedAt: string;
|
|
17
|
-
}
|
|
18
|
-
export interface UserProfile {
|
|
19
|
-
readonly uuid: string;
|
|
20
|
-
readonly user: string;
|
|
21
|
-
readonly firstName: string;
|
|
22
|
-
readonly lastName: string;
|
|
23
|
-
readonly dateOfBirth?: string;
|
|
24
|
-
readonly phoneNumber?: string;
|
|
25
|
-
readonly address?: string;
|
|
26
|
-
readonly city?: string;
|
|
27
|
-
readonly state?: string;
|
|
28
|
-
readonly postalCode?: string;
|
|
29
|
-
readonly country?: string;
|
|
30
|
-
readonly isProfileComplete: boolean;
|
|
31
|
-
readonly createdAt: string;
|
|
32
|
-
readonly updatedAt: string;
|
|
33
|
-
}
|
|
34
|
-
export interface UpdateProfilePayload {
|
|
35
|
-
readonly firstName?: string;
|
|
36
|
-
readonly lastName?: string;
|
|
37
|
-
readonly email?: string;
|
|
38
|
-
readonly dateOfBirth?: string;
|
|
39
|
-
readonly phoneNumber?: string;
|
|
40
|
-
readonly address?: string;
|
|
41
|
-
readonly city?: string;
|
|
42
|
-
readonly state?: string;
|
|
43
|
-
readonly postalCode?: string;
|
|
44
|
-
readonly country?: string;
|
|
45
|
-
}
|
|
46
|
-
export interface UserProfileCompletionPayload {
|
|
47
|
-
readonly dateOfBirth: string;
|
|
48
|
-
readonly phoneNumber: string;
|
|
49
|
-
readonly address: string;
|
|
50
|
-
readonly city: string;
|
|
51
|
-
readonly state: string;
|
|
52
|
-
readonly postalCode: string;
|
|
53
|
-
readonly country: string;
|
|
54
|
-
}
|
|
55
|
-
export interface Account {
|
|
56
|
-
readonly uuid: string;
|
|
57
|
-
readonly accountNumber?: string;
|
|
58
|
-
readonly accountType: string;
|
|
59
|
-
readonly activationDate?: string;
|
|
60
|
-
readonly name?: string;
|
|
61
|
-
readonly userProfile?: string;
|
|
62
|
-
readonly isActive: boolean;
|
|
63
|
-
readonly createdAt: string;
|
|
64
|
-
readonly updatedAt: string;
|
|
65
|
-
}
|
|
66
|
-
export interface CreateAccountPayload {
|
|
67
|
-
readonly accountType: string;
|
|
68
|
-
readonly name: string;
|
|
69
|
-
readonly userProfile: string;
|
|
70
|
-
}
|
|
71
|
-
export interface UpdateAccountPayload {
|
|
72
|
-
readonly accountType?: string;
|
|
73
|
-
readonly name?: string;
|
|
74
|
-
readonly isActive?: boolean;
|
|
75
|
-
}
|
|
76
|
-
export type InvestmentHorizon = 'SHORT_TERM' | 'MEDIUM_TERM' | 'LONG_TERM';
|
|
77
|
-
export type RiskTolerance = 'CONSERVATIVE' | 'MODERATE' | 'AGGRESSIVE';
|
|
78
|
-
export type InvestmentExperience = 'NONE' | 'LIMITED' | 'GOOD' | 'EXTENSIVE';
|
|
79
|
-
export interface InvestmentPreference {
|
|
80
|
-
readonly uuid: string;
|
|
81
|
-
readonly userProfile: string;
|
|
82
|
-
readonly investmentHorizon: InvestmentHorizon;
|
|
83
|
-
readonly riskTolerance: RiskTolerance;
|
|
84
|
-
readonly investmentExperience: InvestmentExperience;
|
|
85
|
-
readonly investmentAmount: string;
|
|
86
|
-
readonly sourceOfFunds: string[];
|
|
87
|
-
readonly createdAt: string;
|
|
88
|
-
readonly updatedAt: string;
|
|
89
|
-
}
|
|
90
|
-
export interface CreateInvestmentPreferencePayload {
|
|
91
|
-
readonly userProfile: string;
|
|
92
|
-
readonly investmentHorizon: InvestmentHorizon;
|
|
93
|
-
readonly riskTolerance: RiskTolerance;
|
|
94
|
-
readonly investmentExperience: InvestmentExperience;
|
|
95
|
-
readonly investmentAmount: number | string;
|
|
96
|
-
readonly sourceOfFunds: string[];
|
|
97
|
-
}
|
|
98
|
-
export interface UpdateInvestmentPreferencePayload {
|
|
99
|
-
readonly investmentHorizon?: InvestmentHorizon;
|
|
100
|
-
readonly riskTolerance?: RiskTolerance;
|
|
101
|
-
readonly investmentExperience?: InvestmentExperience;
|
|
102
|
-
readonly investmentAmount?: number | string;
|
|
103
|
-
readonly sourceOfFunds?: string[];
|
|
104
|
-
}
|
|
105
|
-
export interface PaginatedUserProfiles {
|
|
106
|
-
readonly results: UserProfile[];
|
|
107
|
-
readonly count: number;
|
|
108
|
-
readonly next: string | null;
|
|
109
|
-
readonly previous: string | null;
|
|
110
|
-
}
|
|
111
|
-
export interface PaginatedAccounts {
|
|
112
|
-
readonly results: Account[];
|
|
113
|
-
readonly count: number;
|
|
114
|
-
readonly next: string | null;
|
|
115
|
-
readonly previous: string | null;
|
|
116
|
-
}
|
|
117
|
-
export interface PaginatedInvestmentPreferences {
|
|
118
|
-
readonly results: InvestmentPreference[];
|
|
119
|
-
readonly count: number;
|
|
120
|
-
readonly next: string | null;
|
|
121
|
-
readonly previous: string | null;
|
|
122
|
-
}
|
|
123
|
-
export declare const getUserProfile: ({ apiClient }: {
|
|
124
|
-
apiClient: ApiClient;
|
|
125
|
-
}) => Promise<User>;
|
|
126
|
-
export declare const updateUserProfile: ({ apiClient }: {
|
|
127
|
-
apiClient: ApiClient;
|
|
128
|
-
}, data: UpdateProfilePayload) => Promise<User>;
|
|
129
|
-
export declare const deleteUserAccount: ({ apiClient }: {
|
|
130
|
-
apiClient: ApiClient;
|
|
131
|
-
}) => Promise<void>;
|
|
132
|
-
export declare const getUserProfiles: ({ apiClient }: {
|
|
133
|
-
apiClient: ApiClient;
|
|
134
|
-
}) => Promise<PaginatedUserProfiles>;
|
|
135
|
-
export declare const createUserProfile: ({ apiClient }: {
|
|
136
|
-
apiClient: ApiClient;
|
|
137
|
-
}, data: UpdateProfilePayload) => Promise<UserProfile>;
|
|
138
|
-
export declare const updateUserProfileById: ({ apiClient }: {
|
|
139
|
-
apiClient: ApiClient;
|
|
140
|
-
}, uuid: string, data: UpdateProfilePayload) => Promise<UserProfile>;
|
|
141
|
-
export declare const updateUserProfileCompletion: ({ apiClient }: {
|
|
142
|
-
apiClient: ApiClient;
|
|
143
|
-
}, uuid: string, data: UserProfileCompletionPayload) => Promise<UserProfile>;
|
|
144
|
-
export declare const getAccounts: ({ apiClient }: {
|
|
145
|
-
apiClient: ApiClient;
|
|
146
|
-
}) => Promise<PaginatedAccounts>;
|
|
147
|
-
export declare const getUserAccounts: ({ apiClient }: {
|
|
148
|
-
apiClient: ApiClient;
|
|
149
|
-
}) => Promise<Account[]>;
|
|
150
|
-
export declare const getAccount: ({ apiClient }: {
|
|
151
|
-
apiClient: ApiClient;
|
|
152
|
-
}, uuid: string) => Promise<Account>;
|
|
153
|
-
export declare const createAccount: ({ apiClient }: {
|
|
154
|
-
apiClient: ApiClient;
|
|
155
|
-
}, data: CreateAccountPayload) => Promise<Account>;
|
|
156
|
-
export declare const updateAccount: ({ apiClient }: {
|
|
157
|
-
apiClient: ApiClient;
|
|
158
|
-
}, uuid: string, data: UpdateAccountPayload) => Promise<Account>;
|
|
159
|
-
export declare const getInvestmentPreferences: ({ apiClient }: {
|
|
160
|
-
apiClient: ApiClient;
|
|
161
|
-
}) => Promise<PaginatedInvestmentPreferences>;
|
|
162
|
-
export declare const getInvestmentPreference: ({ apiClient }: {
|
|
163
|
-
apiClient: ApiClient;
|
|
164
|
-
}, uuid: string) => Promise<InvestmentPreference>;
|
|
165
|
-
export declare const createInvestmentPreference: ({ apiClient }: {
|
|
166
|
-
apiClient: ApiClient;
|
|
167
|
-
}, data: CreateInvestmentPreferencePayload) => Promise<InvestmentPreference>;
|
|
168
|
-
export declare const updateInvestmentPreference: ({ apiClient }: {
|
|
169
|
-
apiClient: ApiClient;
|
|
170
|
-
}, uuid: string, data: UpdateInvestmentPreferencePayload) => Promise<InvestmentPreference>;
|
|
171
|
-
export declare const deleteInvestmentPreference: ({ apiClient }: {
|
|
172
|
-
apiClient: ApiClient;
|
|
173
|
-
}, uuid: string) => Promise<void>;
|
|
174
|
-
export declare const SOURCE_OF_FUNDS: {
|
|
175
|
-
readonly SALARY: "salary";
|
|
176
|
-
readonly SAVINGS: "savings";
|
|
177
|
-
readonly INHERITANCE: "inheritance";
|
|
178
|
-
readonly GIFT: "gift";
|
|
179
|
-
readonly OTHER: "other";
|
|
180
|
-
};
|
|
181
|
-
export declare const SOURCE_OF_FUNDS_LABELS: {
|
|
182
|
-
readonly salary: "Salary";
|
|
183
|
-
readonly savings: "Savings";
|
|
184
|
-
readonly inheritance: "Inheritance";
|
|
185
|
-
readonly gift: "Gift";
|
|
186
|
-
readonly other: "Other";
|
|
187
|
-
};
|
|
188
|
-
export declare const SOURCE_OF_FUNDS_OPTIONS: ({
|
|
189
|
-
value: "salary";
|
|
190
|
-
label: "Salary";
|
|
191
|
-
} | {
|
|
192
|
-
value: "savings";
|
|
193
|
-
label: "Savings";
|
|
194
|
-
} | {
|
|
195
|
-
value: "inheritance";
|
|
196
|
-
label: "Inheritance";
|
|
197
|
-
} | {
|
|
198
|
-
value: "gift";
|
|
199
|
-
label: "Gift";
|
|
200
|
-
} | {
|
|
201
|
-
value: "other";
|
|
202
|
-
label: "Other";
|
|
203
|
-
})[];
|
|
204
|
-
export declare const INVESTMENT_HORIZON_LABELS: {
|
|
205
|
-
readonly SHORT_TERM: "Short Term (0-2 years)";
|
|
206
|
-
readonly MEDIUM_TERM: "Medium Term (3-5 years)";
|
|
207
|
-
readonly LONG_TERM: "Long Term (5+ years)";
|
|
208
|
-
};
|
|
209
|
-
export declare const RISK_TOLERANCE_LABELS: {
|
|
210
|
-
readonly CONSERVATIVE: "Conservative";
|
|
211
|
-
readonly MODERATE: "Moderate";
|
|
212
|
-
readonly AGGRESSIVE: "Aggressive";
|
|
213
|
-
};
|
|
214
|
-
export declare const INVESTMENT_EXPERIENCE_LABELS: {
|
|
215
|
-
readonly NONE: "No Experience";
|
|
216
|
-
readonly LIMITED: "Limited Experience";
|
|
217
|
-
readonly GOOD: "Good Experience";
|
|
218
|
-
readonly EXTENSIVE: "Extensive Experience";
|
|
219
|
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