@oxyhq/services 5.7.4 → 5.8.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/README.md +125 -268
- package/lib/commonjs/core/index.js +172 -0
- package/lib/commonjs/core/index.js.map +1 -1
- package/lib/commonjs/index.js +88 -29
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/node/createAuth.js +585 -7
- package/lib/commonjs/node/createAuth.js.map +1 -1
- package/lib/commonjs/node/index.js +31 -41
- package/lib/commonjs/node/index.js.map +1 -1
- package/lib/commonjs/ui/components/Avatar.js +15 -6
- package/lib/commonjs/ui/components/Avatar.js.map +1 -1
- package/lib/commonjs/ui/components/GroupedItem.js +58 -13
- package/lib/commonjs/ui/components/GroupedItem.js.map +1 -1
- package/lib/commonjs/ui/components/GroupedSection.js +7 -1
- package/lib/commonjs/ui/components/GroupedSection.js.map +1 -1
- package/lib/commonjs/ui/components/Header.js +322 -0
- package/lib/commonjs/ui/components/Header.js.map +1 -0
- package/lib/commonjs/ui/components/OxyProvider.js +23 -7
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/index.js +7 -0
- package/lib/commonjs/ui/components/index.js.map +1 -1
- package/lib/commonjs/ui/components/internal/GroupedPillButtons.js +1 -1
- package/lib/commonjs/ui/components/internal/GroupedPillButtons.js.map +1 -1
- package/lib/commonjs/ui/components/internal/TextField.js +606 -546
- package/lib/commonjs/ui/components/internal/TextField.js.map +1 -1
- package/lib/commonjs/ui/components/internal/TextField.md +436 -0
- package/lib/commonjs/ui/context/OxyContext.js +122 -78
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSessionSocket.js +5 -2
- package/lib/commonjs/ui/hooks/useSessionSocket.js.map +1 -1
- package/lib/commonjs/ui/index.js +1 -16
- package/lib/commonjs/ui/index.js.map +1 -1
- package/lib/commonjs/ui/navigation/OxyRouter.js +1 -1
- package/lib/commonjs/ui/navigation/OxyRouter.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountCenterScreen.js +6 -6
- package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountManagementDemo.js +3 -3
- package/lib/commonjs/ui/screens/AccountManagementDemo.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js +241 -598
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +1151 -406
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +135 -237
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AppInfoScreen.js +246 -463
- package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FeedbackScreen.js +3 -3
- package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +808 -650
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/RecoverAccountScreen.js +51 -72
- package/lib/commonjs/ui/screens/RecoverAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SessionManagementScreen.js +11 -29
- package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SignInScreen.js +30 -303
- package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SignUpScreen.js +4 -4
- package/lib/commonjs/ui/screens/SignUpScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js +19 -31
- package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js +7 -10
- package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignUpIdentityStep.js +11 -5
- package/lib/commonjs/ui/screens/internal/SignUpIdentityStep.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignUpSecurityStep.js +11 -4
- package/lib/commonjs/ui/screens/internal/SignUpSecurityStep.js.map +1 -1
- package/lib/commonjs/ui/stores/authStore.js +12 -0
- package/lib/commonjs/ui/stores/authStore.js.map +1 -1
- package/lib/commonjs/ui/styles/authStyles.js +337 -0
- package/lib/commonjs/ui/styles/authStyles.js.map +1 -0
- package/lib/commonjs/ui/styles/index.js +11 -0
- package/lib/commonjs/ui/styles/index.js.map +1 -1
- package/lib/module/core/index.js +172 -0
- package/lib/module/core/index.js.map +1 -1
- package/lib/module/index.js +26 -4
- package/lib/module/index.js.map +1 -1
- package/lib/module/node/createAuth.js +584 -7
- package/lib/module/node/createAuth.js.map +1 -1
- package/lib/module/node/index.js +8 -12
- package/lib/module/node/index.js.map +1 -1
- package/lib/module/ui/components/Avatar.js +15 -6
- package/lib/module/ui/components/Avatar.js.map +1 -1
- package/lib/module/ui/components/GroupedItem.js +59 -14
- package/lib/module/ui/components/GroupedItem.js.map +1 -1
- package/lib/module/ui/components/GroupedSection.js +7 -1
- package/lib/module/ui/components/GroupedSection.js.map +1 -1
- package/lib/module/ui/components/Header.js +317 -0
- package/lib/module/ui/components/Header.js.map +1 -0
- package/lib/module/ui/components/OxyProvider.js +25 -9
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/index.js +1 -0
- package/lib/module/ui/components/index.js.map +1 -1
- package/lib/module/ui/components/internal/GroupedPillButtons.js +1 -1
- package/lib/module/ui/components/internal/GroupedPillButtons.js.map +1 -1
- package/lib/module/ui/components/internal/TextField.js +607 -547
- package/lib/module/ui/components/internal/TextField.js.map +1 -1
- package/lib/module/ui/components/internal/TextField.md +436 -0
- package/lib/module/ui/context/OxyContext.js +121 -77
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/hooks/useSessionSocket.js +5 -2
- package/lib/module/ui/hooks/useSessionSocket.js.map +1 -1
- package/lib/module/ui/index.js +1 -16
- package/lib/module/ui/index.js.map +1 -1
- package/lib/module/ui/navigation/OxyRouter.js +1 -1
- package/lib/module/ui/navigation/OxyRouter.js.map +1 -1
- package/lib/module/ui/screens/AccountCenterScreen.js +6 -6
- package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountManagementDemo.js +3 -3
- package/lib/module/ui/screens/AccountManagementDemo.js.map +1 -1
- package/lib/module/ui/screens/AccountOverviewScreen.js +242 -597
- package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +1152 -407
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +135 -237
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js +248 -465
- package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/module/ui/screens/FeedbackScreen.js +3 -3
- package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentGatewayScreen.js +809 -651
- package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/module/ui/screens/RecoverAccountScreen.js +53 -74
- package/lib/module/ui/screens/RecoverAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/SessionManagementScreen.js +11 -29
- package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/SignInScreen.js +32 -305
- package/lib/module/ui/screens/SignInScreen.js.map +1 -1
- package/lib/module/ui/screens/SignUpScreen.js +5 -5
- package/lib/module/ui/screens/SignUpScreen.js.map +1 -1
- package/lib/module/ui/screens/internal/SignInPasswordStep.js +19 -31
- package/lib/module/ui/screens/internal/SignInPasswordStep.js.map +1 -1
- package/lib/module/ui/screens/internal/SignInUsernameStep.js +7 -10
- package/lib/module/ui/screens/internal/SignInUsernameStep.js.map +1 -1
- package/lib/module/ui/screens/internal/SignUpIdentityStep.js +11 -5
- package/lib/module/ui/screens/internal/SignUpIdentityStep.js.map +1 -1
- package/lib/module/ui/screens/internal/SignUpSecurityStep.js +11 -4
- package/lib/module/ui/screens/internal/SignUpSecurityStep.js.map +1 -1
- package/lib/module/ui/stores/authStore.js +12 -0
- package/lib/module/ui/stores/authStore.js.map +1 -1
- package/lib/module/ui/styles/authStyles.js +332 -0
- package/lib/module/ui/styles/authStyles.js.map +1 -0
- package/lib/module/ui/styles/index.js +1 -0
- package/lib/module/ui/styles/index.js.map +1 -1
- package/lib/typescript/core/index.d.ts +67 -0
- package/lib/typescript/core/index.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +13 -3
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/node/createAuth.d.ts +112 -0
- package/lib/typescript/node/createAuth.d.ts.map +1 -1
- package/lib/typescript/node/index.d.ts +3 -7
- package/lib/typescript/node/index.d.ts.map +1 -1
- package/lib/typescript/ui/components/Avatar.d.ts.map +1 -1
- package/lib/typescript/ui/components/GroupedItem.d.ts +6 -0
- package/lib/typescript/ui/components/GroupedItem.d.ts.map +1 -1
- package/lib/typescript/ui/components/GroupedSection.d.ts +6 -0
- package/lib/typescript/ui/components/GroupedSection.d.ts.map +1 -1
- package/lib/typescript/ui/components/Header.d.ts +22 -0
- package/lib/typescript/ui/components/Header.d.ts.map +1 -0
- package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/ui/components/index.d.ts +1 -0
- package/lib/typescript/ui/components/index.d.ts.map +1 -1
- package/lib/typescript/ui/components/internal/TextField.d.ts +31 -16
- package/lib/typescript/ui/components/internal/TextField.d.ts.map +1 -1
- package/lib/typescript/ui/context/OxyContext.d.ts +5 -2
- package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/useSessionSocket.d.ts.map +1 -1
- package/lib/typescript/ui/index.d.ts +1 -2
- package/lib/typescript/ui/index.d.ts.map +1 -1
- package/lib/typescript/ui/navigation/types.d.ts +9 -2
- package/lib/typescript/ui/navigation/types.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AppInfoScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts +5 -1
- package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SessionManagementScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SignInScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts +1 -1
- package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/internal/SignInUsernameStep.d.ts +0 -1
- package/lib/typescript/ui/screens/internal/SignInUsernameStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/internal/SignUpIdentityStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/internal/SignUpSecurityStep.d.ts.map +1 -1
- package/lib/typescript/ui/stores/authStore.d.ts.map +1 -1
- package/lib/typescript/ui/styles/authStyles.d.ts +326 -0
- package/lib/typescript/ui/styles/authStyles.d.ts.map +1 -0
- package/lib/typescript/ui/styles/index.d.ts +1 -0
- package/lib/typescript/ui/styles/index.d.ts.map +1 -1
- package/package.json +1 -6
- package/src/core/index.ts +189 -0
- package/src/index.ts +72 -4
- package/src/node/createAuth.ts +623 -7
- package/src/node/index.ts +20 -18
- package/src/ui/components/Avatar.tsx +11 -5
- package/src/ui/components/GroupedItem.tsx +57 -9
- package/src/ui/components/GroupedSection.tsx +12 -0
- package/src/ui/components/Header.tsx +364 -0
- package/src/ui/components/OxyProvider.tsx +31 -15
- package/src/ui/components/index.ts +1 -0
- package/src/ui/components/internal/GroupedPillButtons.tsx +1 -1
- package/src/ui/components/internal/TextField.md +436 -0
- package/src/ui/components/internal/TextField.tsx +720 -620
- package/src/ui/context/OxyContext.tsx +150 -63
- package/src/ui/hooks/useSessionSocket.ts +5 -2
- package/src/ui/index.ts +1 -19
- package/src/ui/navigation/OxyRouter.tsx +1 -1
- package/src/ui/navigation/types.ts +10 -2
- package/src/ui/screens/AccountCenterScreen.tsx +5 -5
- package/src/ui/screens/AccountManagementDemo.tsx +9 -9
- package/src/ui/screens/AccountOverviewScreen.tsx +265 -414
- package/src/ui/screens/AccountSettingsScreen.tsx +1165 -403
- package/src/ui/screens/AccountSwitcherScreen.tsx +158 -202
- package/src/ui/screens/AppInfoScreen.tsx +270 -497
- package/src/ui/screens/FeedbackScreen.tsx +3 -3
- package/src/ui/screens/PaymentGatewayScreen.tsx +668 -365
- package/src/ui/screens/ProfileScreen.tsx +5 -5
- package/src/ui/screens/RecoverAccountScreen.tsx +46 -74
- package/src/ui/screens/SessionManagementScreen.tsx +14 -22
- package/src/ui/screens/SignInScreen.tsx +27 -294
- package/src/ui/screens/SignUpScreen.tsx +5 -5
- package/src/ui/screens/internal/SignInPasswordStep.tsx +11 -22
- package/src/ui/screens/internal/SignInUsernameStep.tsx +3 -10
- package/src/ui/screens/internal/SignUpIdentityStep.tsx +2 -5
- package/src/ui/screens/internal/SignUpSecurityStep.tsx +3 -4
- package/src/ui/stores/authStore.ts +12 -0
- package/src/ui/styles/authStyles.ts +352 -0
- package/src/ui/styles/index.ts +1 -0
- package/lib/commonjs/node/middleware.js +0 -227
- package/lib/commonjs/node/middleware.js.map +0 -1
- package/lib/commonjs/ui/zero-config/index.js +0 -25
- package/lib/commonjs/ui/zero-config/index.js.map +0 -1
- package/lib/commonjs/ui/zero-config/provider.js +0 -278
- package/lib/commonjs/ui/zero-config/provider.js.map +0 -1
- package/lib/module/node/middleware.js +0 -199
- package/lib/module/node/middleware.js.map +0 -1
- package/lib/module/ui/zero-config/index.js +0 -8
- package/lib/module/ui/zero-config/index.js.map +0 -1
- package/lib/module/ui/zero-config/provider.js +0 -270
- package/lib/module/ui/zero-config/provider.js.map +0 -1
- package/lib/typescript/node/middleware.d.ts +0 -92
- package/lib/typescript/node/middleware.d.ts.map +0 -1
- package/lib/typescript/ui/zero-config/index.d.ts +0 -5
- package/lib/typescript/ui/zero-config/index.d.ts.map +0 -1
- package/lib/typescript/ui/zero-config/provider.d.ts +0 -84
- package/lib/typescript/ui/zero-config/provider.d.ts.map +0 -1
- package/src/__tests__/middleware.test.ts +0 -105
- package/src/__tests__/setup.ts +0 -10
- package/src/node/middleware.ts +0 -234
- package/src/ui/zero-config/index.ts +0 -11
- package/src/ui/zero-config/provider.tsx +0 -310
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useRef, useCallback, useEffect } from 'react';
|
|
2
2
|
import { View, Text, Animated, TextInput } from 'react-native';
|
|
3
|
+
import { Ionicons } from '@expo/vector-icons';
|
|
3
4
|
import GroupedPillButtons from '../../components/internal/GroupedPillButtons';
|
|
4
5
|
import TextField from '../../components/internal/TextField';
|
|
5
6
|
|
|
@@ -78,7 +79,7 @@ const SignUpSecurityStep: React.FC<SignUpSecurityStepProps> = ({
|
|
|
78
79
|
</View>
|
|
79
80
|
<TextField
|
|
80
81
|
ref={passwordRef}
|
|
81
|
-
|
|
82
|
+
leading={<Ionicons name="lock-closed-outline" size={24} color={colors.secondaryText} />}
|
|
82
83
|
label="Password"
|
|
83
84
|
value={formData.password}
|
|
84
85
|
onChangeText={text => updateField('password', text)}
|
|
@@ -86,7 +87,6 @@ const SignUpSecurityStep: React.FC<SignUpSecurityStepProps> = ({
|
|
|
86
87
|
autoCapitalize="none"
|
|
87
88
|
autoCorrect={false}
|
|
88
89
|
testID="password-input"
|
|
89
|
-
colors={colors}
|
|
90
90
|
variant="filled"
|
|
91
91
|
error={formData.password && typeof formData.password === 'string' && !validatePassword(formData.password) ? `Password must be at least ${PASSWORD_MIN_LENGTH} characters` : undefined}
|
|
92
92
|
onSubmitEditing={() => confirmPasswordRef.current?.focus()}
|
|
@@ -95,7 +95,7 @@ const SignUpSecurityStep: React.FC<SignUpSecurityStepProps> = ({
|
|
|
95
95
|
<Text style={[styles.passwordHint, { color: colors.secondaryText }]}>Password must be at least {PASSWORD_MIN_LENGTH} characters long</Text>
|
|
96
96
|
<TextField
|
|
97
97
|
ref={confirmPasswordRef}
|
|
98
|
-
|
|
98
|
+
leading={<Ionicons name="lock-closed-outline" size={24} color={colors.secondaryText} />}
|
|
99
99
|
label="Confirm Password"
|
|
100
100
|
value={formData.confirmPassword}
|
|
101
101
|
onChangeText={text => updateField('confirmPassword', text)}
|
|
@@ -103,7 +103,6 @@ const SignUpSecurityStep: React.FC<SignUpSecurityStepProps> = ({
|
|
|
103
103
|
autoCapitalize="none"
|
|
104
104
|
autoCorrect={false}
|
|
105
105
|
testID="confirm-password-input"
|
|
106
|
-
colors={colors}
|
|
107
106
|
variant="filled"
|
|
108
107
|
error={formData.confirmPassword && typeof formData.confirmPassword === 'string' && !validatePasswordsMatch(formData.password, formData.confirmPassword) ? 'Passwords do not match' : undefined}
|
|
109
108
|
onSubmitEditing={handleSecurityNext}
|
|
@@ -26,19 +26,31 @@ export const useAuthStore = create<AuthState>((set: (state: Partial<AuthState>)
|
|
|
26
26
|
fetchUser: async (oxyServices) => {
|
|
27
27
|
set({ isLoading: true, error: null });
|
|
28
28
|
try {
|
|
29
|
+
console.log('AuthStore: Fetching user data...');
|
|
29
30
|
const user = await oxyServices.getCurrentUser();
|
|
31
|
+
console.log('AuthStore: Received user data:', {
|
|
32
|
+
hasUser: !!user,
|
|
33
|
+
userLinksMetadata: user?.linksMetadata,
|
|
34
|
+
userLinks: user?.links,
|
|
35
|
+
userWebsite: user?.website
|
|
36
|
+
});
|
|
30
37
|
set({ user, isLoading: false, isAuthenticated: true });
|
|
31
38
|
} catch (error: any) {
|
|
39
|
+
console.error('AuthStore: Error fetching user:', error);
|
|
32
40
|
set({ error: error.message || 'Failed to fetch user', isLoading: false });
|
|
33
41
|
}
|
|
34
42
|
},
|
|
35
43
|
updateUser: async (updates, oxyServices) => {
|
|
36
44
|
set({ isLoading: true, error: null });
|
|
37
45
|
try {
|
|
46
|
+
console.log('AuthStore: Updating user with:', updates);
|
|
38
47
|
await oxyServices.updateProfile(updates);
|
|
48
|
+
console.log('AuthStore: Profile updated successfully');
|
|
39
49
|
// Immediately fetch the latest user data after update
|
|
40
50
|
await useAuthStore.getState().fetchUser(oxyServices);
|
|
51
|
+
console.log('AuthStore: User data refreshed');
|
|
41
52
|
} catch (error: any) {
|
|
53
|
+
console.error('AuthStore: Error updating user:', error);
|
|
42
54
|
set({ error: error.message || 'Failed to update user', isLoading: false });
|
|
43
55
|
}
|
|
44
56
|
},
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
import { Platform, StyleSheet, TextStyle } from 'react-native';
|
|
2
|
+
import { fontFamilies } from './fonts';
|
|
3
|
+
|
|
4
|
+
export interface AuthThemeColors {
|
|
5
|
+
text: string;
|
|
6
|
+
background: string;
|
|
7
|
+
inputBackground: string;
|
|
8
|
+
placeholder: string;
|
|
9
|
+
primary: string;
|
|
10
|
+
border: string;
|
|
11
|
+
error: string;
|
|
12
|
+
success: string;
|
|
13
|
+
warning: string;
|
|
14
|
+
secondaryText: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const createAuthStyles = (colors: AuthThemeColors, theme: string) => StyleSheet.create({
|
|
18
|
+
// Container styles
|
|
19
|
+
container: {
|
|
20
|
+
flex: 1,
|
|
21
|
+
},
|
|
22
|
+
scrollContent: {
|
|
23
|
+
flexGrow: 1,
|
|
24
|
+
paddingHorizontal: 24,
|
|
25
|
+
paddingTop: 4,
|
|
26
|
+
paddingBottom: 20,
|
|
27
|
+
},
|
|
28
|
+
stepContainer: {
|
|
29
|
+
flex: 1,
|
|
30
|
+
justifyContent: 'flex-start',
|
|
31
|
+
alignItems: 'flex-start',
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
// Header styles
|
|
35
|
+
modernHeader: {
|
|
36
|
+
alignItems: 'flex-start',
|
|
37
|
+
width: '100%',
|
|
38
|
+
marginBottom: 24,
|
|
39
|
+
},
|
|
40
|
+
modernTitle: {
|
|
41
|
+
fontFamily: Platform.OS === 'web' ? 'Phudu' : 'Phudu-Bold',
|
|
42
|
+
fontWeight: Platform.OS === 'web' ? 'bold' : undefined,
|
|
43
|
+
fontSize: 62,
|
|
44
|
+
lineHeight: 74.4, // 62 * 1.2
|
|
45
|
+
marginBottom: 18,
|
|
46
|
+
textAlign: 'left',
|
|
47
|
+
letterSpacing: -1,
|
|
48
|
+
},
|
|
49
|
+
modernSubtitle: {
|
|
50
|
+
fontSize: 18,
|
|
51
|
+
lineHeight: 24,
|
|
52
|
+
textAlign: 'left',
|
|
53
|
+
opacity: 0.8,
|
|
54
|
+
},
|
|
55
|
+
welcomeTitle: {
|
|
56
|
+
fontFamily: Platform.OS === 'web' ? 'Phudu' : 'Phudu-Bold',
|
|
57
|
+
fontWeight: Platform.OS === 'web' ? 'bold' : undefined,
|
|
58
|
+
fontSize: 42,
|
|
59
|
+
lineHeight: 50.4, // 42 * 1.2
|
|
60
|
+
marginBottom: 12,
|
|
61
|
+
textAlign: 'left',
|
|
62
|
+
letterSpacing: -1,
|
|
63
|
+
},
|
|
64
|
+
stepTitle: {
|
|
65
|
+
fontFamily: Platform.OS === 'web' ? 'Phudu' : 'Phudu-Bold',
|
|
66
|
+
fontWeight: Platform.OS === 'web' ? 'bold' : undefined,
|
|
67
|
+
fontSize: 42,
|
|
68
|
+
lineHeight: 50.4, // 42 * 1.2
|
|
69
|
+
marginBottom: 12,
|
|
70
|
+
textAlign: 'left',
|
|
71
|
+
letterSpacing: -1,
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
// Info and error cards
|
|
75
|
+
modernInfoCard: {
|
|
76
|
+
flexDirection: 'row',
|
|
77
|
+
alignItems: 'center',
|
|
78
|
+
padding: 16,
|
|
79
|
+
borderRadius: 16,
|
|
80
|
+
marginBottom: 24,
|
|
81
|
+
gap: 12,
|
|
82
|
+
width: '100%',
|
|
83
|
+
},
|
|
84
|
+
modernInfoText: {
|
|
85
|
+
fontSize: 14,
|
|
86
|
+
flex: 1,
|
|
87
|
+
},
|
|
88
|
+
modernErrorCard: {
|
|
89
|
+
flexDirection: 'row',
|
|
90
|
+
alignItems: 'center',
|
|
91
|
+
padding: 16,
|
|
92
|
+
borderRadius: 16,
|
|
93
|
+
marginBottom: 24,
|
|
94
|
+
gap: 12,
|
|
95
|
+
width: '100%',
|
|
96
|
+
},
|
|
97
|
+
errorText: {
|
|
98
|
+
fontSize: 14,
|
|
99
|
+
fontWeight: '500',
|
|
100
|
+
flex: 1,
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
// Input styles
|
|
104
|
+
modernInputContainer: {
|
|
105
|
+
width: '100%',
|
|
106
|
+
marginBottom: 24,
|
|
107
|
+
},
|
|
108
|
+
inputWrapper: {
|
|
109
|
+
flexDirection: 'row',
|
|
110
|
+
alignItems: 'center',
|
|
111
|
+
height: 56,
|
|
112
|
+
borderRadius: 16,
|
|
113
|
+
paddingHorizontal: 20,
|
|
114
|
+
borderWidth: 2,
|
|
115
|
+
backgroundColor: colors.inputBackground,
|
|
116
|
+
},
|
|
117
|
+
premiumInputWrapper: {
|
|
118
|
+
flexDirection: 'row',
|
|
119
|
+
alignItems: 'center',
|
|
120
|
+
height: 56,
|
|
121
|
+
borderRadius: 16,
|
|
122
|
+
paddingHorizontal: 20,
|
|
123
|
+
borderWidth: 2,
|
|
124
|
+
backgroundColor: colors.inputBackground,
|
|
125
|
+
},
|
|
126
|
+
inputIcon: {
|
|
127
|
+
marginRight: 12,
|
|
128
|
+
},
|
|
129
|
+
inputContent: {
|
|
130
|
+
flex: 1,
|
|
131
|
+
},
|
|
132
|
+
modernInput: {
|
|
133
|
+
flex: 1,
|
|
134
|
+
fontSize: 16,
|
|
135
|
+
height: '100%',
|
|
136
|
+
},
|
|
137
|
+
passwordToggle: {
|
|
138
|
+
padding: 4,
|
|
139
|
+
},
|
|
140
|
+
|
|
141
|
+
// Validation styles
|
|
142
|
+
validationIndicator: {
|
|
143
|
+
marginLeft: 8,
|
|
144
|
+
},
|
|
145
|
+
validationSuccessCard: {
|
|
146
|
+
flexDirection: 'row',
|
|
147
|
+
alignItems: 'center',
|
|
148
|
+
padding: 12,
|
|
149
|
+
borderRadius: 12,
|
|
150
|
+
marginTop: 8,
|
|
151
|
+
gap: 8,
|
|
152
|
+
},
|
|
153
|
+
validationErrorCard: {
|
|
154
|
+
flexDirection: 'row',
|
|
155
|
+
alignItems: 'center',
|
|
156
|
+
padding: 12,
|
|
157
|
+
borderRadius: 12,
|
|
158
|
+
marginTop: 8,
|
|
159
|
+
gap: 8,
|
|
160
|
+
},
|
|
161
|
+
validationCard: {
|
|
162
|
+
flexDirection: 'row',
|
|
163
|
+
alignItems: 'center',
|
|
164
|
+
padding: 12,
|
|
165
|
+
borderRadius: 12,
|
|
166
|
+
marginTop: 8,
|
|
167
|
+
gap: 8,
|
|
168
|
+
},
|
|
169
|
+
validationText: {
|
|
170
|
+
fontSize: 12,
|
|
171
|
+
fontWeight: '500',
|
|
172
|
+
},
|
|
173
|
+
belowInputMessage: {
|
|
174
|
+
flexDirection: 'row',
|
|
175
|
+
alignItems: 'center',
|
|
176
|
+
marginTop: 4,
|
|
177
|
+
marginBottom: 0,
|
|
178
|
+
gap: 6,
|
|
179
|
+
},
|
|
180
|
+
belowInputText: {
|
|
181
|
+
fontSize: 13,
|
|
182
|
+
fontWeight: '500',
|
|
183
|
+
},
|
|
184
|
+
|
|
185
|
+
// Button styles
|
|
186
|
+
modernButton: {
|
|
187
|
+
flexDirection: 'row',
|
|
188
|
+
alignItems: 'center',
|
|
189
|
+
justifyContent: 'center',
|
|
190
|
+
paddingVertical: 18,
|
|
191
|
+
paddingHorizontal: 32,
|
|
192
|
+
borderRadius: 16,
|
|
193
|
+
marginVertical: 8,
|
|
194
|
+
shadowOffset: {
|
|
195
|
+
width: 0,
|
|
196
|
+
height: 4,
|
|
197
|
+
},
|
|
198
|
+
shadowOpacity: 0.3,
|
|
199
|
+
shadowRadius: 8,
|
|
200
|
+
elevation: 6,
|
|
201
|
+
gap: 8,
|
|
202
|
+
width: '100%',
|
|
203
|
+
},
|
|
204
|
+
modernButtonText: {
|
|
205
|
+
color: '#FFFFFF',
|
|
206
|
+
fontSize: 16,
|
|
207
|
+
fontWeight: '600',
|
|
208
|
+
letterSpacing: 0.5,
|
|
209
|
+
},
|
|
210
|
+
buttonIcon: {
|
|
211
|
+
marginLeft: 4,
|
|
212
|
+
},
|
|
213
|
+
|
|
214
|
+
// Label and link styles
|
|
215
|
+
modernLabel: {
|
|
216
|
+
fontSize: 12,
|
|
217
|
+
fontWeight: '500',
|
|
218
|
+
marginBottom: 2,
|
|
219
|
+
},
|
|
220
|
+
modernLinkText: {
|
|
221
|
+
fontSize: 14,
|
|
222
|
+
lineHeight: 20,
|
|
223
|
+
fontWeight: '600',
|
|
224
|
+
textDecorationLine: 'underline',
|
|
225
|
+
},
|
|
226
|
+
footerTextContainer: {
|
|
227
|
+
flexDirection: 'row',
|
|
228
|
+
justifyContent: 'center',
|
|
229
|
+
marginTop: 16,
|
|
230
|
+
},
|
|
231
|
+
footerText: {
|
|
232
|
+
fontSize: 15,
|
|
233
|
+
},
|
|
234
|
+
|
|
235
|
+
// User profile styles
|
|
236
|
+
modernUserProfileContainer: {
|
|
237
|
+
alignItems: 'flex-start',
|
|
238
|
+
paddingVertical: 24,
|
|
239
|
+
},
|
|
240
|
+
avatarContainer: {
|
|
241
|
+
position: 'relative',
|
|
242
|
+
marginBottom: 20,
|
|
243
|
+
},
|
|
244
|
+
modernUserAvatar: {
|
|
245
|
+
borderWidth: 4,
|
|
246
|
+
borderColor: 'rgba(209, 105, 229, 0.2)',
|
|
247
|
+
},
|
|
248
|
+
statusIndicator: {
|
|
249
|
+
position: 'absolute',
|
|
250
|
+
bottom: 4,
|
|
251
|
+
right: 4,
|
|
252
|
+
width: 20,
|
|
253
|
+
height: 20,
|
|
254
|
+
borderRadius: 10,
|
|
255
|
+
borderWidth: 3,
|
|
256
|
+
borderColor: '#FFFFFF',
|
|
257
|
+
},
|
|
258
|
+
modernUserDisplayName: {
|
|
259
|
+
fontFamily: Platform.OS === 'web' ? 'Phudu' : 'Phudu-Bold',
|
|
260
|
+
fontWeight: Platform.OS === 'web' ? 'bold' : undefined,
|
|
261
|
+
fontSize: 42,
|
|
262
|
+
marginBottom: 4,
|
|
263
|
+
textAlign: 'center',
|
|
264
|
+
letterSpacing: -0.5,
|
|
265
|
+
},
|
|
266
|
+
modernUsernameSubtext: {
|
|
267
|
+
fontSize: 20,
|
|
268
|
+
textAlign: 'left',
|
|
269
|
+
marginBottom: 16,
|
|
270
|
+
opacity: 0.7,
|
|
271
|
+
},
|
|
272
|
+
welcomeBackBadge: {
|
|
273
|
+
flexDirection: 'row',
|
|
274
|
+
alignItems: 'center',
|
|
275
|
+
paddingHorizontal: 12,
|
|
276
|
+
paddingVertical: 6,
|
|
277
|
+
borderRadius: 20,
|
|
278
|
+
gap: 6,
|
|
279
|
+
},
|
|
280
|
+
welcomeBackText: {
|
|
281
|
+
fontSize: 12,
|
|
282
|
+
fontWeight: '600',
|
|
283
|
+
textTransform: 'uppercase',
|
|
284
|
+
letterSpacing: 0.5,
|
|
285
|
+
},
|
|
286
|
+
|
|
287
|
+
// Navigation styles
|
|
288
|
+
modernNavigationButtons: {
|
|
289
|
+
flexDirection: 'row',
|
|
290
|
+
justifyContent: 'center',
|
|
291
|
+
marginTop: 16,
|
|
292
|
+
marginBottom: 8,
|
|
293
|
+
width: '100%',
|
|
294
|
+
gap: 8,
|
|
295
|
+
},
|
|
296
|
+
modernBackButton: {
|
|
297
|
+
flexDirection: 'row',
|
|
298
|
+
alignItems: 'center',
|
|
299
|
+
paddingVertical: 12,
|
|
300
|
+
paddingHorizontal: 20,
|
|
301
|
+
borderRadius: 12,
|
|
302
|
+
borderWidth: 1,
|
|
303
|
+
gap: 8,
|
|
304
|
+
},
|
|
305
|
+
modernBackButtonText: {
|
|
306
|
+
fontSize: 16,
|
|
307
|
+
fontWeight: '500',
|
|
308
|
+
},
|
|
309
|
+
|
|
310
|
+
// Security notice
|
|
311
|
+
securityNotice: {
|
|
312
|
+
flexDirection: 'row',
|
|
313
|
+
alignItems: 'center',
|
|
314
|
+
justifyContent: 'center',
|
|
315
|
+
marginTop: 20,
|
|
316
|
+
gap: 6,
|
|
317
|
+
},
|
|
318
|
+
securityText: {
|
|
319
|
+
fontSize: 12,
|
|
320
|
+
fontWeight: '500',
|
|
321
|
+
},
|
|
322
|
+
|
|
323
|
+
// Welcome image container
|
|
324
|
+
welcomeImageContainer: {
|
|
325
|
+
alignItems: 'center',
|
|
326
|
+
justifyContent: 'center',
|
|
327
|
+
marginVertical: 20,
|
|
328
|
+
},
|
|
329
|
+
welcomeText: {
|
|
330
|
+
fontSize: 18,
|
|
331
|
+
lineHeight: 24,
|
|
332
|
+
textAlign: 'left',
|
|
333
|
+
opacity: 0.8,
|
|
334
|
+
marginBottom: 24,
|
|
335
|
+
},
|
|
336
|
+
|
|
337
|
+
// Success styles
|
|
338
|
+
successCard: {
|
|
339
|
+
flexDirection: 'row',
|
|
340
|
+
alignItems: 'center',
|
|
341
|
+
padding: 16,
|
|
342
|
+
borderRadius: 16,
|
|
343
|
+
marginBottom: 24,
|
|
344
|
+
gap: 12,
|
|
345
|
+
width: '100%',
|
|
346
|
+
},
|
|
347
|
+
successText: {
|
|
348
|
+
fontSize: 14,
|
|
349
|
+
fontWeight: '500',
|
|
350
|
+
flex: 1,
|
|
351
|
+
},
|
|
352
|
+
});
|
package/src/ui/styles/index.ts
CHANGED
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _exportNames = {
|
|
7
|
-
createOxyAuth: true,
|
|
8
|
-
createOptionalOxyAuth: true,
|
|
9
|
-
createOxyExpressApp: true,
|
|
10
|
-
OxyServices: true
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "OxyServices", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _core.OxyServices;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
exports.createOptionalOxyAuth = createOptionalOxyAuth;
|
|
19
|
-
exports.createOxyAuth = createOxyAuth;
|
|
20
|
-
exports.createOxyExpressApp = createOxyExpressApp;
|
|
21
|
-
var _core = require("../core");
|
|
22
|
-
var _interfaces = require("../models/interfaces");
|
|
23
|
-
Object.keys(_interfaces).forEach(function (key) {
|
|
24
|
-
if (key === "default" || key === "__esModule") return;
|
|
25
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
26
|
-
if (key in exports && exports[key] === _interfaces[key]) return;
|
|
27
|
-
Object.defineProperty(exports, key, {
|
|
28
|
-
enumerable: true,
|
|
29
|
-
get: function () {
|
|
30
|
-
return _interfaces[key];
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
/**
|
|
35
|
-
* Zero-config Express middleware for OxyHQ Services authentication
|
|
36
|
-
*
|
|
37
|
-
* This provides a simple, one-line solution for adding authentication to Express apps.
|
|
38
|
-
* Simply import and use: app.use('/api', createOxyAuth())
|
|
39
|
-
*/
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Creates zero-config authentication middleware for Express.js
|
|
43
|
-
*
|
|
44
|
-
* @example
|
|
45
|
-
* ```typescript
|
|
46
|
-
* import express from 'express';
|
|
47
|
-
* import { createOxyAuth } from '@oxyhq/services/node';
|
|
48
|
-
*
|
|
49
|
-
* const app = express();
|
|
50
|
-
*
|
|
51
|
-
* // Zero-config auth for all /api routes
|
|
52
|
-
* app.use('/api', createOxyAuth());
|
|
53
|
-
*
|
|
54
|
-
* // Now all routes under /api automatically have req.user available
|
|
55
|
-
* app.get('/api/profile', (req, res) => {
|
|
56
|
-
* res.json({ user: req.user }); // req.user is automatically available
|
|
57
|
-
* });
|
|
58
|
-
* ```
|
|
59
|
-
*/
|
|
60
|
-
function createOxyAuth(config = {}) {
|
|
61
|
-
const {
|
|
62
|
-
baseURL = process.env.OXY_API_URL || 'http://localhost:3001',
|
|
63
|
-
loadUser = true,
|
|
64
|
-
publicPaths = [],
|
|
65
|
-
onError
|
|
66
|
-
} = config;
|
|
67
|
-
const oxy = new _core.OxyServices({
|
|
68
|
-
baseURL
|
|
69
|
-
});
|
|
70
|
-
return async (req, res, next) => {
|
|
71
|
-
// Check if this is a public path
|
|
72
|
-
const isPublicPath = publicPaths.some(path => req.path === path || req.path.startsWith(path + '/'));
|
|
73
|
-
if (isPublicPath) {
|
|
74
|
-
return next();
|
|
75
|
-
}
|
|
76
|
-
try {
|
|
77
|
-
const authHeader = req.headers['authorization'];
|
|
78
|
-
const token = authHeader && authHeader.split(' ')[1]; // Bearer TOKEN
|
|
79
|
-
|
|
80
|
-
if (!token) {
|
|
81
|
-
const error = {
|
|
82
|
-
message: 'Access token required',
|
|
83
|
-
code: 'MISSING_TOKEN',
|
|
84
|
-
status: 401
|
|
85
|
-
};
|
|
86
|
-
if (onError) {
|
|
87
|
-
return onError(error, req, res);
|
|
88
|
-
}
|
|
89
|
-
return res.status(401).json({
|
|
90
|
-
error: 'Access token required',
|
|
91
|
-
code: 'MISSING_TOKEN'
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// Validate token using the OxyServices client
|
|
96
|
-
const authResult = await oxy.authenticateToken(token);
|
|
97
|
-
if (!authResult.valid) {
|
|
98
|
-
const error = {
|
|
99
|
-
message: authResult.error || 'Invalid token',
|
|
100
|
-
code: 'INVALID_TOKEN',
|
|
101
|
-
status: 403
|
|
102
|
-
};
|
|
103
|
-
if (onError) {
|
|
104
|
-
return onError(error, req, res);
|
|
105
|
-
}
|
|
106
|
-
return res.status(403).json({
|
|
107
|
-
error: authResult.error || 'Invalid token',
|
|
108
|
-
code: 'INVALID_TOKEN'
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// Attach user data to request
|
|
113
|
-
req.userId = authResult.userId;
|
|
114
|
-
req.accessToken = token;
|
|
115
|
-
if (loadUser && authResult.user) {
|
|
116
|
-
req.user = authResult.user;
|
|
117
|
-
} else {
|
|
118
|
-
req.user = {
|
|
119
|
-
id: authResult.userId
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
next();
|
|
123
|
-
} catch (error) {
|
|
124
|
-
const apiError = {
|
|
125
|
-
message: error.message || 'Authentication failed',
|
|
126
|
-
code: error.code || 'AUTH_ERROR',
|
|
127
|
-
status: error.status || 500
|
|
128
|
-
};
|
|
129
|
-
if (onError) {
|
|
130
|
-
return onError(apiError, req, res);
|
|
131
|
-
}
|
|
132
|
-
res.status(apiError.status).json({
|
|
133
|
-
error: apiError.message,
|
|
134
|
-
code: apiError.code
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Creates optional authentication middleware
|
|
142
|
-
* This middleware will attach user data if a valid token is present, but won't fail if missing
|
|
143
|
-
*
|
|
144
|
-
* @example
|
|
145
|
-
* ```typescript
|
|
146
|
-
* import { createOptionalOxyAuth } from '@oxyhq/services/node';
|
|
147
|
-
*
|
|
148
|
-
* app.use('/api', createOptionalOxyAuth());
|
|
149
|
-
*
|
|
150
|
-
* app.get('/api/content', (req, res) => {
|
|
151
|
-
* if (req.user) {
|
|
152
|
-
* // User is authenticated, show personalized content
|
|
153
|
-
* res.json({ content: 'personalized', user: req.user });
|
|
154
|
-
* } else {
|
|
155
|
-
* // Anonymous user, show public content
|
|
156
|
-
* res.json({ content: 'public' });
|
|
157
|
-
* }
|
|
158
|
-
* });
|
|
159
|
-
* ```
|
|
160
|
-
*/
|
|
161
|
-
function createOptionalOxyAuth(config = {}) {
|
|
162
|
-
const {
|
|
163
|
-
baseURL = process.env.OXY_API_URL || 'http://localhost:3001',
|
|
164
|
-
loadUser = true
|
|
165
|
-
} = config;
|
|
166
|
-
const oxy = new _core.OxyServices({
|
|
167
|
-
baseURL
|
|
168
|
-
});
|
|
169
|
-
return async (req, res, next) => {
|
|
170
|
-
try {
|
|
171
|
-
const authHeader = req.headers['authorization'];
|
|
172
|
-
const token = authHeader && authHeader.split(' ')[1]; // Bearer TOKEN
|
|
173
|
-
|
|
174
|
-
if (!token) {
|
|
175
|
-
// No token provided, continue without authentication
|
|
176
|
-
return next();
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
// Validate token using the OxyServices client
|
|
180
|
-
const authResult = await oxy.authenticateToken(token);
|
|
181
|
-
if (authResult.valid) {
|
|
182
|
-
// Attach user data to request if token is valid
|
|
183
|
-
req.userId = authResult.userId;
|
|
184
|
-
req.accessToken = token;
|
|
185
|
-
if (loadUser && authResult.user) {
|
|
186
|
-
req.user = authResult.user;
|
|
187
|
-
} else {
|
|
188
|
-
req.user = {
|
|
189
|
-
id: authResult.userId
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
next();
|
|
194
|
-
} catch (error) {
|
|
195
|
-
// If there's an error, continue without authentication
|
|
196
|
-
// This makes the middleware truly optional
|
|
197
|
-
next();
|
|
198
|
-
}
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* Utility function to quickly set up a complete Express app with authentication
|
|
204
|
-
*
|
|
205
|
-
* @example
|
|
206
|
-
* ```typescript
|
|
207
|
-
* import { createOxyExpressApp } from '@oxyhq/services/node';
|
|
208
|
-
*
|
|
209
|
-
* const app = createOxyExpressApp();
|
|
210
|
-
*
|
|
211
|
-
* // All routes automatically have authentication and req.user available
|
|
212
|
-
* app.get('/api/profile', (req, res) => {
|
|
213
|
-
* res.json({ user: req.user });
|
|
214
|
-
* });
|
|
215
|
-
*
|
|
216
|
-
* app.listen(3000);
|
|
217
|
-
* ```
|
|
218
|
-
*/
|
|
219
|
-
function createOxyExpressApp(config = {}) {
|
|
220
|
-
// This is a lightweight helper - users should import express themselves
|
|
221
|
-
// We'll provide the middleware setup instructions instead
|
|
222
|
-
|
|
223
|
-
throw new Error('createOxyExpressApp is not implemented yet. Please use createOxyAuth() middleware with your existing Express app.');
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
// Re-export for convenience
|
|
227
|
-
//# sourceMappingURL=middleware.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_core","require","_interfaces","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","createOxyAuth","config","baseURL","process","env","OXY_API_URL","loadUser","publicPaths","onError","oxy","OxyServices","req","res","next","isPublicPath","some","path","startsWith","authHeader","headers","token","split","error","message","code","status","json","authResult","authenticateToken","valid","userId","accessToken","user","id","apiError","createOptionalOxyAuth","createOxyExpressApp","Error"],"sourceRoot":"../../../src","sources":["node/middleware.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;AAOA,IAAAA,KAAA,GAAAC,OAAA;AAkOA,IAAAC,WAAA,GAAAD,OAAA;AAAAE,MAAA,CAAAC,IAAA,CAAAF,WAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,WAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,WAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAz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;UAAO,CAAC;QACtC;MACF;MAEAjB,IAAI,CAAC,CAAC;IACR,CAAC,CAAC,OAAOS,KAAK,EAAE;MACd;MACA;MACAT,IAAI,CAAC,CAAC;IACR;EACF,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASuB,mBAAmBA,CAACnC,MAOnC,GAAG,CAAC,CAAC,EAAE;EACN;EACA;;EAEA,MAAM,IAAIoC,KAAK,CAAC,mHAAmH,CAAC;AACtI;;AAEA","ignoreList":[]}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "OxyZeroConfigProvider", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _provider.OxyZeroConfigProvider;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "useOxyApi", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _provider.useOxyApi;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "useOxyZeroConfig", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _provider.useOxyZeroConfig;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
var _provider = require("./provider");
|
|
25
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_provider","require"],"sourceRoot":"../../../../src","sources":["ui/zero-config/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAAA,SAAA,GAAAC,OAAA","ignoreList":[]}
|