@onairos/react-native 3.1.15 → 3.1.17
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 +404 -0
- package/lib/commonjs/assets/images/Checkbox.svg +3 -3
- package/lib/commonjs/assets/images/EnochE.svg +19 -19
- package/lib/commonjs/assets/images/Personalityprofile.svg +3 -3
- package/lib/commonjs/assets/images/Personalitytraits.svg +3 -3
- package/lib/commonjs/assets/images/Userpreferences.svg +3 -3
- package/lib/commonjs/assets/images/arrow.svg +20 -20
- package/lib/commonjs/assets/images/basicproficon.svg +43 -43
- package/lib/commonjs/assets/images/basicprofile.svg +3 -3
- package/lib/commonjs/assets/images/checkmark.svg +4 -4
- package/lib/commonjs/assets/images/contentanalysis.svg +3 -3
- package/lib/commonjs/assets/images/contenticon.svg +23 -23
- package/lib/commonjs/assets/images/personalityicon.svg +18 -18
- package/lib/commonjs/assets/images/x-close.svg +3 -3
- package/lib/commonjs/components/OnairosSignInButton.js +32 -74
- package/lib/commonjs/components/OnairosSignInButton.js.map +1 -1
- package/lib/commonjs/components/UniversalOnboarding.js +4 -4
- package/lib/commonjs/config/api.js +2 -2
- package/lib/commonjs/hooks/useConnections.js +6 -6
- package/lib/commonjs/hooks/useUserConnections.js +10 -10
- package/lib/commonjs/index.js +5 -12
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/services/apiClient.js +35 -35
- package/lib/commonjs/services/apiKeyService.js +99 -99
- package/lib/commonjs/services/authService.js +82 -82
- package/lib/commonjs/services/biometricPinService.js +10 -10
- package/lib/commonjs/services/connectedAccountsService.js +32 -32
- package/lib/commonjs/services/googleAuthService.js +15 -15
- package/lib/commonjs/services/imageCompressionService.js +15 -15
- package/lib/commonjs/services/jwtStorageService.js +59 -59
- package/lib/commonjs/services/mobileTrainingService.js +14 -14
- package/lib/commonjs/services/pinEncryptionService.js +10 -10
- package/lib/commonjs/services/pinStorageUtils.js +15 -15
- package/lib/commonjs/services/platformAuthService.js +47 -47
- package/lib/commonjs/services/storageService.js +31 -31
- package/lib/commonjs/services/trainingApiHelpers.js +33 -33
- package/lib/commonjs/services/userConnectionsService.js +24 -24
- package/lib/commonjs/utils/Portal.js +4 -4
- package/lib/commonjs/utils/api.js +24 -24
- package/lib/commonjs/utils/auth.js +18 -18
- package/lib/commonjs/utils/crypto.js +13 -13
- package/lib/commonjs/utils/encryption.js +12 -12
- package/lib/commonjs/utils/eventUtils.js +52 -52
- package/lib/commonjs/utils/programmaticFlow.js +16 -16
- package/lib/commonjs/utils/retryHelper.js +27 -27
- package/lib/module/assets/images/Checkbox.svg +3 -3
- package/lib/module/assets/images/EnochE.svg +19 -19
- package/lib/module/assets/images/Personalityprofile.svg +3 -3
- package/lib/module/assets/images/Personalitytraits.svg +3 -3
- package/lib/module/assets/images/Userpreferences.svg +3 -3
- package/lib/module/assets/images/arrow.svg +20 -20
- package/lib/module/assets/images/basicproficon.svg +43 -43
- package/lib/module/assets/images/basicprofile.svg +3 -3
- package/lib/module/assets/images/checkmark.svg +4 -4
- package/lib/module/assets/images/contentanalysis.svg +3 -3
- package/lib/module/assets/images/contenticon.svg +23 -23
- package/lib/module/assets/images/personalityicon.svg +18 -18
- package/lib/module/assets/images/x-close.svg +3 -3
- package/lib/module/components/OnairosSignInButton.js +32 -74
- package/lib/module/components/OnairosSignInButton.js.map +1 -1
- package/lib/module/components/UniversalOnboarding.js +4 -4
- package/lib/module/config/api.js +2 -2
- package/lib/module/hooks/useConnections.js +6 -6
- package/lib/module/hooks/useUserConnections.js +10 -10
- package/lib/module/index.js +5 -6
- package/lib/module/index.js.map +1 -1
- package/lib/module/services/apiClient.js +35 -35
- package/lib/module/services/apiKeyService.js +99 -99
- package/lib/module/services/authService.js +82 -82
- package/lib/module/services/biometricPinService.js +10 -10
- package/lib/module/services/connectedAccountsService.js +32 -32
- package/lib/module/services/googleAuthService.js +15 -15
- package/lib/module/services/imageCompressionService.js +15 -15
- package/lib/module/services/jwtStorageService.js +59 -59
- package/lib/module/services/mobileTrainingService.js +14 -14
- package/lib/module/services/pinEncryptionService.js +10 -10
- package/lib/module/services/pinStorageUtils.js +15 -15
- package/lib/module/services/platformAuthService.js +47 -47
- package/lib/module/services/storageService.js +31 -31
- package/lib/module/services/trainingApiHelpers.js +33 -33
- package/lib/module/services/userConnectionsService.js +24 -24
- package/lib/module/utils/Portal.js +4 -4
- package/lib/module/utils/api.js +24 -24
- package/lib/module/utils/auth.js +18 -18
- package/lib/module/utils/crypto.js +13 -13
- package/lib/module/utils/encryption.js +12 -12
- package/lib/module/utils/eventUtils.js +52 -52
- package/lib/module/utils/programmaticFlow.js +16 -16
- package/lib/module/utils/retryHelper.js +27 -27
- package/lib/typescript/components/OnairosSignInButton.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +0 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/package.json +163 -163
- package/src/api/index.ts +151 -151
- package/src/assets/images/Checkbox.svg +3 -3
- package/src/assets/images/EnochE.svg +19 -19
- package/src/assets/images/Personalityprofile.svg +3 -3
- package/src/assets/images/Personalitytraits.svg +3 -3
- package/src/assets/images/Userpreferences.svg +3 -3
- package/src/assets/images/arrow.svg +20 -20
- package/src/assets/images/basicproficon.svg +43 -43
- package/src/assets/images/basicprofile.svg +3 -3
- package/src/assets/images/checkmark.svg +4 -4
- package/src/assets/images/contentanalysis.svg +3 -3
- package/src/assets/images/contenticon.svg +23 -23
- package/src/assets/images/personalityicon.svg +18 -18
- package/src/assets/images/x-close.svg +3 -3
- package/src/components/BodyText.tsx +33 -33
- package/src/components/BrandMark.tsx +62 -62
- package/src/components/CodeInput.tsx +32 -32
- package/src/components/DataRequestScreen.tsx +355 -355
- package/src/components/EmailInput.tsx +31 -31
- package/src/components/EmailVerificationModal.tsx +363 -363
- package/src/components/ExistingUserDataConfirmation.tsx +506 -506
- package/src/components/GoogleButton.tsx +55 -55
- package/src/components/HeadingGroup.tsx +49 -49
- package/src/components/ModalHeader.tsx +125 -125
- package/src/components/ModalSheet.tsx +57 -57
- package/src/components/Onairos.tsx +422 -422
- package/src/components/OnairosButton.tsx +339 -339
- package/src/components/OnairosSignInButton.tsx +130 -166
- package/src/components/Overlay.tsx +506 -506
- package/src/components/PersonaImage.tsx +79 -79
- package/src/components/PersonaLoadingScreen.tsx +201 -201
- package/src/components/PersonalizationConsentScreen.tsx +410 -410
- package/src/components/PinCreationScreen.tsx +492 -492
- package/src/components/PinInput.tsx +555 -555
- package/src/components/PlatformConnectorsStep.tsx +891 -891
- package/src/components/PlatformList.tsx +144 -144
- package/src/components/PlatformToggle.tsx +226 -226
- package/src/components/PrimaryButton.tsx +213 -213
- package/src/components/SignInMatchAnimation.tsx +225 -225
- package/src/components/SignInStep.tsx +217 -217
- package/src/components/TrainingModal.tsx +1047 -1047
- package/src/components/UniversalOnboarding.tsx +2887 -2887
- package/src/components/VerificationStep.tsx +198 -198
- package/src/components/WelcomeScreen.tsx +473 -473
- package/src/components/icons/Basicproficon.tsx +30 -30
- package/src/components/icons/Basicprofile.tsx +17 -17
- package/src/components/icons/Checkbox.tsx +17 -17
- package/src/components/icons/Checkmark.tsx +24 -24
- package/src/components/icons/Contentanalysis.tsx +17 -17
- package/src/components/icons/Contenticon.tsx +30 -30
- package/src/components/icons/EnochE.tsx +39 -39
- package/src/components/icons/Personalityicon.tsx +22 -22
- package/src/components/icons/Personalityprofile.tsx +17 -17
- package/src/components/icons/Personalitytraits.tsx +17 -17
- package/src/components/icons/Userpreferences.tsx +17 -17
- package/src/components/icons/index.ts +12 -12
- package/src/components/onboarding/OAuthWebView.tsx +232 -232
- package/src/config/api.ts +25 -25
- package/src/context/AuthContext.tsx +393 -393
- package/src/hooks/useConnectedAccounts.ts +138 -138
- package/src/hooks/useConnections.ts +161 -161
- package/src/hooks/useCredentials.ts +174 -174
- package/src/hooks/useUserConnections.ts +165 -165
- package/src/index.js +14 -14
- package/src/index.ts +94 -95
- package/src/services/apiClient.ts +336 -336
- package/src/services/apiKeyService.ts +919 -919
- package/src/services/authService.ts +1008 -1008
- package/src/services/biometricPinService.ts +192 -192
- package/src/services/connectedAccountsService.ts +289 -289
- package/src/services/googleAuthService.ts +279 -279
- package/src/services/imageCompressionService.ts +302 -302
- package/src/services/jwtStorageService.ts +256 -256
- package/src/services/mobileTrainingService.ts +203 -203
- package/src/services/pinEncryptionService.ts +75 -75
- package/src/services/pinStorageUtils.ts +96 -96
- package/src/services/platformAuthService.ts +1346 -1346
- package/src/services/storageService.ts +451 -451
- package/src/services/trainingApiHelpers.ts +66 -66
- package/src/services/userConnectionsService.ts +556 -556
- package/src/services/youtubeMigrationService.ts +453 -453
- package/src/theme/index.ts +239 -239
- package/src/types/ambient.d.ts +28 -28
- package/src/types/index.ts +265 -265
- package/src/types/node-fix.d.ts +18 -18
- package/src/types/node-override.d.ts +23 -23
- package/src/types/opacity.d.ts +15 -15
- package/src/types/types.d.ts +17 -17
- package/src/utils/Portal.tsx +82 -82
- package/src/utils/api.js +111 -111
- package/src/utils/auth.js +103 -103
- package/src/utils/crypto.js +59 -59
- package/src/utils/encryption.ts +68 -68
- package/src/utils/eventUtils.ts +302 -302
- package/src/utils/haptics.ts +58 -58
- package/src/utils/imagePreloader.ts +2 -2
- package/src/utils/programmaticFlow.ts +112 -112
- package/src/utils/retryHelper.ts +274 -274
|
@@ -5,13 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.setTemporaryPin = exports.hasStoredPin = exports.getTemporaryPin = exports.getStoredPinForTraining = exports.getPinForTraining = exports.clearTemporaryPin = exports.clearStoredPin = void 0;
|
|
7
7
|
var _biometricPinService = require("./biometricPinService");
|
|
8
|
-
/**
|
|
9
|
-
* Utility functions for PIN storage management
|
|
8
|
+
/**
|
|
9
|
+
* Utility functions for PIN storage management
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
/**
|
|
13
|
-
* Get the stored PIN for training/authentication purposes
|
|
14
|
-
* This will prompt for biometric authentication
|
|
12
|
+
/**
|
|
13
|
+
* Get the stored PIN for training/authentication purposes
|
|
14
|
+
* This will prompt for biometric authentication
|
|
15
15
|
*/
|
|
16
16
|
const getStoredPinForTraining = async () => {
|
|
17
17
|
try {
|
|
@@ -39,8 +39,8 @@ const getStoredPinForTraining = async () => {
|
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
/**
|
|
43
|
-
* Check if user has a PIN stored securely
|
|
42
|
+
/**
|
|
43
|
+
* Check if user has a PIN stored securely
|
|
44
44
|
*/
|
|
45
45
|
exports.getStoredPinForTraining = getStoredPinForTraining;
|
|
46
46
|
const hasStoredPin = async () => {
|
|
@@ -52,8 +52,8 @@ const hasStoredPin = async () => {
|
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
/**
|
|
56
|
-
* Remove stored PIN (for logout/reset purposes)
|
|
55
|
+
/**
|
|
56
|
+
* Remove stored PIN (for logout/reset purposes)
|
|
57
57
|
*/
|
|
58
58
|
exports.hasStoredPin = hasStoredPin;
|
|
59
59
|
const clearStoredPin = async () => {
|
|
@@ -66,9 +66,9 @@ const clearStoredPin = async () => {
|
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
68
|
|
|
69
|
-
/**
|
|
70
|
-
* Get PIN for passing to training component
|
|
71
|
-
* This function can be called from the onboarding flow
|
|
69
|
+
/**
|
|
70
|
+
* Get PIN for passing to training component
|
|
71
|
+
* This function can be called from the onboarding flow
|
|
72
72
|
*/
|
|
73
73
|
exports.clearStoredPin = clearStoredPin;
|
|
74
74
|
const getPinForTraining = async tempPin => {
|
|
@@ -82,9 +82,9 @@ const getPinForTraining = async tempPin => {
|
|
|
82
82
|
return await getStoredPinForTraining();
|
|
83
83
|
};
|
|
84
84
|
|
|
85
|
-
/**
|
|
86
|
-
* Store PIN temporarily in memory for training component
|
|
87
|
-
* This is used when PIN is entered but not yet stored biometrically
|
|
85
|
+
/**
|
|
86
|
+
* Store PIN temporarily in memory for training component
|
|
87
|
+
* This is used when PIN is entered but not yet stored biometrically
|
|
88
88
|
*/
|
|
89
89
|
exports.getPinForTraining = getPinForTraining;
|
|
90
90
|
let temporaryPin = null;
|
|
@@ -8,9 +8,9 @@ var _googleSignin = require("@react-native-google-signin/google-signin");
|
|
|
8
8
|
var _asyncStorage = _interopRequireDefault(require("@react-native-async-storage/async-storage"));
|
|
9
9
|
var _api = require("../config/api");
|
|
10
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
/**
|
|
12
|
-
* Platform Authentication Service
|
|
13
|
-
* Handles OAuth flows for different platforms
|
|
11
|
+
/**
|
|
12
|
+
* Platform Authentication Service
|
|
13
|
+
* Handles OAuth flows for different platforms
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
// 🔑 CRITICAL: Using the same client ID for both web and iOS to avoid audience errors
|
|
@@ -92,16 +92,16 @@ const OAUTH_CONFIG = {
|
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
94
|
|
|
95
|
-
/**
|
|
96
|
-
* Check if the platform has a native SDK
|
|
95
|
+
/**
|
|
96
|
+
* Check if the platform has a native SDK
|
|
97
97
|
*/
|
|
98
98
|
const hasNativeSDK = platform => {
|
|
99
99
|
var _OAUTH_CONFIG$platfor;
|
|
100
100
|
return ((_OAUTH_CONFIG$platfor = OAUTH_CONFIG[platform]) === null || _OAUTH_CONFIG$platfor === void 0 ? void 0 : _OAUTH_CONFIG$platfor.hasNativeSDK) || false;
|
|
101
101
|
};
|
|
102
102
|
|
|
103
|
-
/**
|
|
104
|
-
* Initiate OAuth flow for a platform
|
|
103
|
+
/**
|
|
104
|
+
* Initiate OAuth flow for a platform
|
|
105
105
|
*/
|
|
106
106
|
exports.hasNativeSDK = hasNativeSDK;
|
|
107
107
|
const initiateOAuth = async (platform, username) => {
|
|
@@ -160,9 +160,9 @@ const initiateOAuth = async (platform, username) => {
|
|
|
160
160
|
}
|
|
161
161
|
};
|
|
162
162
|
|
|
163
|
-
/**
|
|
164
|
-
* Initialize Google Sign-In configuration with enhanced refresh token support
|
|
165
|
-
* Updated with CRITICAL parameters for refresh token generation
|
|
163
|
+
/**
|
|
164
|
+
* Initialize Google Sign-In configuration with enhanced refresh token support
|
|
165
|
+
* Updated with CRITICAL parameters for refresh token generation
|
|
166
166
|
*/
|
|
167
167
|
exports.initiateOAuth = initiateOAuth;
|
|
168
168
|
const initializeGoogleSignIn = () => {
|
|
@@ -186,9 +186,9 @@ const initializeGoogleSignIn = () => {
|
|
|
186
186
|
});
|
|
187
187
|
};
|
|
188
188
|
|
|
189
|
-
/**
|
|
190
|
-
* Force YouTube reconnection with consent screen to get refresh tokens
|
|
191
|
-
* This is the key function to fix YouTube token expiry issues
|
|
189
|
+
/**
|
|
190
|
+
* Force YouTube reconnection with consent screen to get refresh tokens
|
|
191
|
+
* This is the key function to fix YouTube token expiry issues
|
|
192
192
|
*/
|
|
193
193
|
const forceYouTubeReconnectionWithConsent = async username => {
|
|
194
194
|
try {
|
|
@@ -473,8 +473,8 @@ const forceYouTubeReconnectionWithConsent = async username => {
|
|
|
473
473
|
}
|
|
474
474
|
};
|
|
475
475
|
|
|
476
|
-
/**
|
|
477
|
-
* Alternative method: Force consent by revoking existing permissions
|
|
476
|
+
/**
|
|
477
|
+
* Alternative method: Force consent by revoking existing permissions
|
|
478
478
|
*/
|
|
479
479
|
exports.forceYouTubeReconnectionWithConsent = forceYouTubeReconnectionWithConsent;
|
|
480
480
|
const forceYouTubeReconnectionWithRevoke = async username => {
|
|
@@ -525,8 +525,8 @@ const forceYouTubeReconnectionWithRevoke = async username => {
|
|
|
525
525
|
}
|
|
526
526
|
};
|
|
527
527
|
|
|
528
|
-
/**
|
|
529
|
-
* Fix YouTube connection for a specific user (like nicholase50)
|
|
528
|
+
/**
|
|
529
|
+
* Fix YouTube connection for a specific user (like nicholase50)
|
|
530
530
|
*/
|
|
531
531
|
exports.forceYouTubeReconnectionWithRevoke = forceYouTubeReconnectionWithRevoke;
|
|
532
532
|
const fixUserYouTubeConnection = async username => {
|
|
@@ -551,8 +551,8 @@ const fixUserYouTubeConnection = async username => {
|
|
|
551
551
|
return false;
|
|
552
552
|
};
|
|
553
553
|
|
|
554
|
-
/**
|
|
555
|
-
* Get fresh tokens using refresh token
|
|
554
|
+
/**
|
|
555
|
+
* Get fresh tokens using refresh token
|
|
556
556
|
*/
|
|
557
557
|
exports.fixUserYouTubeConnection = fixUserYouTubeConnection;
|
|
558
558
|
const refreshGoogleTokens = async () => {
|
|
@@ -593,8 +593,8 @@ const refreshGoogleTokens = async () => {
|
|
|
593
593
|
}
|
|
594
594
|
};
|
|
595
595
|
|
|
596
|
-
/**
|
|
597
|
-
* Debug YouTube tokens to verify refresh token availability
|
|
596
|
+
/**
|
|
597
|
+
* Debug YouTube tokens to verify refresh token availability
|
|
598
598
|
*/
|
|
599
599
|
const debugYouTubeTokens = async () => {
|
|
600
600
|
try {
|
|
@@ -620,8 +620,8 @@ const debugYouTubeTokens = async () => {
|
|
|
620
620
|
}
|
|
621
621
|
};
|
|
622
622
|
|
|
623
|
-
/**
|
|
624
|
-
* Force fresh YouTube reconnection with proper refresh token
|
|
623
|
+
/**
|
|
624
|
+
* Force fresh YouTube reconnection with proper refresh token
|
|
625
625
|
*/
|
|
626
626
|
const reconnectYouTube = async username => {
|
|
627
627
|
try {
|
|
@@ -669,8 +669,8 @@ const reconnectYouTube = async username => {
|
|
|
669
669
|
}
|
|
670
670
|
};
|
|
671
671
|
|
|
672
|
-
/**
|
|
673
|
-
* Initiate native authentication for platforms with SDKs
|
|
672
|
+
/**
|
|
673
|
+
* Initiate native authentication for platforms with SDKs
|
|
674
674
|
*/
|
|
675
675
|
exports.reconnectYouTube = reconnectYouTube;
|
|
676
676
|
const initiateNativeAuth = async (platform, username) => {
|
|
@@ -1003,17 +1003,17 @@ const initiateNativeAuth = async (platform, username) => {
|
|
|
1003
1003
|
return false;
|
|
1004
1004
|
};
|
|
1005
1005
|
|
|
1006
|
-
/**
|
|
1007
|
-
* Check if a URL is an OAuth callback
|
|
1006
|
+
/**
|
|
1007
|
+
* Check if a URL is an OAuth callback
|
|
1008
1008
|
*/
|
|
1009
1009
|
exports.initiateNativeAuth = initiateNativeAuth;
|
|
1010
1010
|
const isOAuthCallback = url => {
|
|
1011
1011
|
return url.includes('auth/callback') || url.includes('code=');
|
|
1012
1012
|
};
|
|
1013
1013
|
|
|
1014
|
-
/**
|
|
1015
|
-
* Exchange authorization code for access token
|
|
1016
|
-
* This would typically be done on a server, but we're simulating it here
|
|
1014
|
+
/**
|
|
1015
|
+
* Exchange authorization code for access token
|
|
1016
|
+
* This would typically be done on a server, but we're simulating it here
|
|
1017
1017
|
*/
|
|
1018
1018
|
exports.isOAuthCallback = isOAuthCallback;
|
|
1019
1019
|
const exchangeCodeForToken = async (code, platform) => {
|
|
@@ -1053,9 +1053,9 @@ const exchangeCodeForToken = async (code, platform) => {
|
|
|
1053
1053
|
}
|
|
1054
1054
|
};
|
|
1055
1055
|
|
|
1056
|
-
/**
|
|
1057
|
-
* Refresh YouTube tokens when they expire
|
|
1058
|
-
* This should be called when the backend reports token expiry
|
|
1056
|
+
/**
|
|
1057
|
+
* Refresh YouTube tokens when they expire
|
|
1058
|
+
* This should be called when the backend reports token expiry
|
|
1059
1059
|
*/
|
|
1060
1060
|
exports.exchangeCodeForToken = exchangeCodeForToken;
|
|
1061
1061
|
const refreshYouTubeTokens = async () => {
|
|
@@ -1116,9 +1116,9 @@ const refreshYouTubeTokens = async () => {
|
|
|
1116
1116
|
}
|
|
1117
1117
|
};
|
|
1118
1118
|
|
|
1119
|
-
/**
|
|
1120
|
-
* Trigger training restart after YouTube re-authentication
|
|
1121
|
-
* This signals the backend to restart training with the new refresh token
|
|
1119
|
+
/**
|
|
1120
|
+
* Trigger training restart after YouTube re-authentication
|
|
1121
|
+
* This signals the backend to restart training with the new refresh token
|
|
1122
1122
|
*/
|
|
1123
1123
|
exports.refreshYouTubeTokens = refreshYouTubeTokens;
|
|
1124
1124
|
const triggerTrainingRestart = async (username, authToken) => {
|
|
@@ -1152,9 +1152,9 @@ const triggerTrainingRestart = async (username, authToken) => {
|
|
|
1152
1152
|
}
|
|
1153
1153
|
};
|
|
1154
1154
|
|
|
1155
|
-
/**
|
|
1156
|
-
* Test function to verify YouTube refresh token functionality
|
|
1157
|
-
* Call this in your app to test the YouTube connection
|
|
1155
|
+
/**
|
|
1156
|
+
* Test function to verify YouTube refresh token functionality
|
|
1157
|
+
* Call this in your app to test the YouTube connection
|
|
1158
1158
|
*/
|
|
1159
1159
|
const testYouTubeRefreshToken = async username => {
|
|
1160
1160
|
console.log('🧪 Testing YouTube refresh token functionality...');
|
|
@@ -1181,8 +1181,8 @@ const testYouTubeRefreshToken = async username => {
|
|
|
1181
1181
|
}
|
|
1182
1182
|
};
|
|
1183
1183
|
|
|
1184
|
-
/**
|
|
1185
|
-
* Request email verification code
|
|
1184
|
+
/**
|
|
1185
|
+
* Request email verification code
|
|
1186
1186
|
*/
|
|
1187
1187
|
exports.testYouTubeRefreshToken = testYouTubeRefreshToken;
|
|
1188
1188
|
const requestEmailVerification = async (email, testMode = false) => {
|
|
@@ -1218,8 +1218,8 @@ const requestEmailVerification = async (email, testMode = false) => {
|
|
|
1218
1218
|
}
|
|
1219
1219
|
};
|
|
1220
1220
|
|
|
1221
|
-
/**
|
|
1222
|
-
* Verify email code
|
|
1221
|
+
/**
|
|
1222
|
+
* Verify email code
|
|
1223
1223
|
*/
|
|
1224
1224
|
exports.requestEmailVerification = requestEmailVerification;
|
|
1225
1225
|
const verifyEmailCode = async (email, code, testMode = false) => {
|
|
@@ -1258,8 +1258,8 @@ const verifyEmailCode = async (email, code, testMode = false) => {
|
|
|
1258
1258
|
}
|
|
1259
1259
|
};
|
|
1260
1260
|
|
|
1261
|
-
/**
|
|
1262
|
-
* Check email verification status
|
|
1261
|
+
/**
|
|
1262
|
+
* Check email verification status
|
|
1263
1263
|
*/
|
|
1264
1264
|
exports.verifyEmailCode = verifyEmailCode;
|
|
1265
1265
|
const checkEmailVerificationStatus = async (email, testMode = false) => {
|
|
@@ -1288,8 +1288,8 @@ const checkEmailVerificationStatus = async (email, testMode = false) => {
|
|
|
1288
1288
|
}
|
|
1289
1289
|
};
|
|
1290
1290
|
|
|
1291
|
-
/**
|
|
1292
|
-
* Initialize platform auth service
|
|
1291
|
+
/**
|
|
1292
|
+
* Initialize platform auth service
|
|
1293
1293
|
*/
|
|
1294
1294
|
exports.checkEmailVerificationStatus = checkEmailVerificationStatus;
|
|
1295
1295
|
const initializePlatformAuthService = () => {
|
|
@@ -41,8 +41,8 @@ const STORAGE_KEYS = exports.STORAGE_KEYS = {
|
|
|
41
41
|
|
|
42
42
|
// Authentication state
|
|
43
43
|
|
|
44
|
-
/**
|
|
45
|
-
* Save user progress to track where they left off
|
|
44
|
+
/**
|
|
45
|
+
* Save user progress to track where they left off
|
|
46
46
|
*/
|
|
47
47
|
const saveUserProgress = async progress => {
|
|
48
48
|
try {
|
|
@@ -59,8 +59,8 @@ const saveUserProgress = async progress => {
|
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
-
/**
|
|
63
|
-
* Get user progress to determine where to resume
|
|
62
|
+
/**
|
|
63
|
+
* Get user progress to determine where to resume
|
|
64
64
|
*/
|
|
65
65
|
exports.saveUserProgress = saveUserProgress;
|
|
66
66
|
const getUserProgress = async () => {
|
|
@@ -89,8 +89,8 @@ const getUserProgress = async () => {
|
|
|
89
89
|
};
|
|
90
90
|
};
|
|
91
91
|
|
|
92
|
-
/**
|
|
93
|
-
* Save authentication state
|
|
92
|
+
/**
|
|
93
|
+
* Save authentication state
|
|
94
94
|
*/
|
|
95
95
|
exports.getUserProgress = getUserProgress;
|
|
96
96
|
const saveAuthState = async authState => {
|
|
@@ -111,8 +111,8 @@ const saveAuthState = async authState => {
|
|
|
111
111
|
}
|
|
112
112
|
};
|
|
113
113
|
|
|
114
|
-
/**
|
|
115
|
-
* Get authentication state
|
|
114
|
+
/**
|
|
115
|
+
* Get authentication state
|
|
116
116
|
*/
|
|
117
117
|
exports.saveAuthState = saveAuthState;
|
|
118
118
|
const getAuthState = async () => {
|
|
@@ -134,8 +134,8 @@ const getAuthState = async () => {
|
|
|
134
134
|
}
|
|
135
135
|
};
|
|
136
136
|
|
|
137
|
-
/**
|
|
138
|
-
* Clear all user data (for logout)
|
|
137
|
+
/**
|
|
138
|
+
* Clear all user data (for logout)
|
|
139
139
|
*/
|
|
140
140
|
exports.getAuthState = getAuthState;
|
|
141
141
|
const clearUserData = async () => {
|
|
@@ -158,8 +158,8 @@ const clearUserData = async () => {
|
|
|
158
158
|
}
|
|
159
159
|
};
|
|
160
160
|
|
|
161
|
-
/**
|
|
162
|
-
* Get resume navigation target based on user progress
|
|
161
|
+
/**
|
|
162
|
+
* Get resume navigation target based on user progress
|
|
163
163
|
*/
|
|
164
164
|
exports.clearUserData = clearUserData;
|
|
165
165
|
const getResumeTarget = async () => {
|
|
@@ -244,8 +244,8 @@ const getResumeTarget = async () => {
|
|
|
244
244
|
}
|
|
245
245
|
};
|
|
246
246
|
|
|
247
|
-
/**
|
|
248
|
-
* Check if user has completed onboarding flow
|
|
247
|
+
/**
|
|
248
|
+
* Check if user has completed onboarding flow
|
|
249
249
|
*/
|
|
250
250
|
exports.getResumeTarget = getResumeTarget;
|
|
251
251
|
const hasCompletedOnboarding = async () => {
|
|
@@ -258,9 +258,9 @@ const hasCompletedOnboarding = async () => {
|
|
|
258
258
|
}
|
|
259
259
|
};
|
|
260
260
|
|
|
261
|
-
/**
|
|
262
|
-
* Mark user as having reached the event page (completed full onboarding)
|
|
263
|
-
* This creates the token that ensures they always return to Results
|
|
261
|
+
/**
|
|
262
|
+
* Mark user as having reached the event page (completed full onboarding)
|
|
263
|
+
* This creates the token that ensures they always return to Results
|
|
264
264
|
*/
|
|
265
265
|
exports.hasCompletedOnboarding = hasCompletedOnboarding;
|
|
266
266
|
const markEventPageReached = async eventData => {
|
|
@@ -290,8 +290,8 @@ const markEventPageReached = async eventData => {
|
|
|
290
290
|
}
|
|
291
291
|
};
|
|
292
292
|
|
|
293
|
-
/**
|
|
294
|
-
* Check if user has the event access token (completed onboarding)
|
|
293
|
+
/**
|
|
294
|
+
* Check if user has the event access token (completed onboarding)
|
|
295
295
|
*/
|
|
296
296
|
exports.markEventPageReached = markEventPageReached;
|
|
297
297
|
const hasEventAccessToken = async () => {
|
|
@@ -305,8 +305,8 @@ const hasEventAccessToken = async () => {
|
|
|
305
305
|
}
|
|
306
306
|
};
|
|
307
307
|
|
|
308
|
-
/**
|
|
309
|
-
* Mark a step as completed
|
|
308
|
+
/**
|
|
309
|
+
* Mark a step as completed
|
|
310
310
|
*/
|
|
311
311
|
exports.hasEventAccessToken = hasEventAccessToken;
|
|
312
312
|
const markStepCompleted = async step => {
|
|
@@ -321,8 +321,8 @@ const markStepCompleted = async step => {
|
|
|
321
321
|
}
|
|
322
322
|
};
|
|
323
323
|
|
|
324
|
-
/**
|
|
325
|
-
* Update user's last screen
|
|
324
|
+
/**
|
|
325
|
+
* Update user's last screen
|
|
326
326
|
*/
|
|
327
327
|
exports.markStepCompleted = markStepCompleted;
|
|
328
328
|
const updateLastScreen = async (screen, params) => {
|
|
@@ -336,8 +336,8 @@ const updateLastScreen = async (screen, params) => {
|
|
|
336
336
|
}
|
|
337
337
|
};
|
|
338
338
|
|
|
339
|
-
/**
|
|
340
|
-
* Check if this is a returning user with existing progress
|
|
339
|
+
/**
|
|
340
|
+
* Check if this is a returning user with existing progress
|
|
341
341
|
*/
|
|
342
342
|
exports.updateLastScreen = updateLastScreen;
|
|
343
343
|
const isReturningUser = async () => {
|
|
@@ -351,8 +351,8 @@ const isReturningUser = async () => {
|
|
|
351
351
|
}
|
|
352
352
|
};
|
|
353
353
|
|
|
354
|
-
/**
|
|
355
|
-
* Mark app as active (call this when app becomes active)
|
|
354
|
+
/**
|
|
355
|
+
* Mark app as active (call this when app becomes active)
|
|
356
356
|
*/
|
|
357
357
|
exports.isReturningUser = isReturningUser;
|
|
358
358
|
const markAppActive = async () => {
|
|
@@ -366,8 +366,8 @@ const markAppActive = async () => {
|
|
|
366
366
|
}
|
|
367
367
|
};
|
|
368
368
|
|
|
369
|
-
/**
|
|
370
|
-
* Development utility: Get all stored progress data for debugging
|
|
369
|
+
/**
|
|
370
|
+
* Development utility: Get all stored progress data for debugging
|
|
371
371
|
*/
|
|
372
372
|
exports.markAppActive = markAppActive;
|
|
373
373
|
const getDebugStorageInfo = async () => {
|
|
@@ -388,8 +388,8 @@ const getDebugStorageInfo = async () => {
|
|
|
388
388
|
}
|
|
389
389
|
};
|
|
390
390
|
|
|
391
|
-
/**
|
|
392
|
-
* Development utility: Clear all progress (for testing)
|
|
391
|
+
/**
|
|
392
|
+
* Development utility: Clear all progress (for testing)
|
|
393
393
|
*/
|
|
394
394
|
exports.getDebugStorageInfo = getDebugStorageInfo;
|
|
395
395
|
const clearAllProgress = async () => {
|
|
@@ -5,12 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.addEncryptedPinToTrainingData = void 0;
|
|
7
7
|
var _pinEncryptionService = require("./pinEncryptionService");
|
|
8
|
-
/**
|
|
9
|
-
* Helper functions for training API modifications
|
|
8
|
+
/**
|
|
9
|
+
* Helper functions for training API modifications
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
/**
|
|
13
|
-
* Add encrypted PIN to training data if available
|
|
12
|
+
/**
|
|
13
|
+
* Add encrypted PIN to training data if available
|
|
14
14
|
*/
|
|
15
15
|
const addEncryptedPinToTrainingData = async trainingData => {
|
|
16
16
|
try {
|
|
@@ -39,35 +39,35 @@ const addEncryptedPinToTrainingData = async trainingData => {
|
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
/**
|
|
43
|
-
* Example of how to modify the training API call to include PIN
|
|
44
|
-
*
|
|
45
|
-
* Usage in UniversalOnboarding.tsx:
|
|
46
|
-
*
|
|
47
|
-
* ```typescript
|
|
48
|
-
* // Before sending to API
|
|
49
|
-
* const trainingData = {
|
|
50
|
-
* socketId,
|
|
51
|
-
* username: finalUsername,
|
|
52
|
-
* email: userInfo?.email || null,
|
|
53
|
-
* modelKey: null,
|
|
54
|
-
* connectedPlatforms: platformsList,
|
|
55
|
-
* platformConnections: connections
|
|
56
|
-
* };
|
|
57
|
-
*
|
|
58
|
-
* // Add encrypted PIN if needed
|
|
59
|
-
* const trainingDataWithPin = await addEncryptedPinToTrainingData(trainingData);
|
|
60
|
-
*
|
|
61
|
-
* // Send to API
|
|
62
|
-
* const response = await fetch('https://api2.onairos.uk/mobile-training/enoch', {
|
|
63
|
-
* method: 'POST',
|
|
64
|
-
* headers: {
|
|
65
|
-
* 'Content-Type': 'application/json',
|
|
66
|
-
* 'Authorization': `Bearer ${token}`
|
|
67
|
-
* },
|
|
68
|
-
* body: JSON.stringify(trainingDataWithPin)
|
|
69
|
-
* });
|
|
70
|
-
* ```
|
|
42
|
+
/**
|
|
43
|
+
* Example of how to modify the training API call to include PIN
|
|
44
|
+
*
|
|
45
|
+
* Usage in UniversalOnboarding.tsx:
|
|
46
|
+
*
|
|
47
|
+
* ```typescript
|
|
48
|
+
* // Before sending to API
|
|
49
|
+
* const trainingData = {
|
|
50
|
+
* socketId,
|
|
51
|
+
* username: finalUsername,
|
|
52
|
+
* email: userInfo?.email || null,
|
|
53
|
+
* modelKey: null,
|
|
54
|
+
* connectedPlatforms: platformsList,
|
|
55
|
+
* platformConnections: connections
|
|
56
|
+
* };
|
|
57
|
+
*
|
|
58
|
+
* // Add encrypted PIN if needed
|
|
59
|
+
* const trainingDataWithPin = await addEncryptedPinToTrainingData(trainingData);
|
|
60
|
+
*
|
|
61
|
+
* // Send to API
|
|
62
|
+
* const response = await fetch('https://api2.onairos.uk/mobile-training/enoch', {
|
|
63
|
+
* method: 'POST',
|
|
64
|
+
* headers: {
|
|
65
|
+
* 'Content-Type': 'application/json',
|
|
66
|
+
* 'Authorization': `Bearer ${token}`
|
|
67
|
+
* },
|
|
68
|
+
* body: JSON.stringify(trainingDataWithPin)
|
|
69
|
+
* });
|
|
70
|
+
* ```
|
|
71
71
|
*/
|
|
72
72
|
exports.addEncryptedPinToTrainingData = addEncryptedPinToTrainingData;
|
|
73
73
|
//# sourceMappingURL=trainingApiHelpers.js.map
|
|
@@ -9,10 +9,10 @@ var _asyncStorage = _interopRequireDefault(require("@react-native-async-storage/
|
|
|
9
9
|
var _imageCompressionService = require("./imageCompressionService");
|
|
10
10
|
var _api = require("../config/api");
|
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
/**
|
|
13
|
-
* Get user identifier (ID or username) using multiple fallback methods
|
|
14
|
-
* Backend now supports both user IDs and usernames for profile picture uploads
|
|
15
|
-
* @returns Promise<string | null>
|
|
12
|
+
/**
|
|
13
|
+
* Get user identifier (ID or username) using multiple fallback methods
|
|
14
|
+
* Backend now supports both user IDs and usernames for profile picture uploads
|
|
15
|
+
* @returns Promise<string | null>
|
|
16
16
|
*/
|
|
17
17
|
const getUserIdWithFallbacks = async () => {
|
|
18
18
|
try {
|
|
@@ -90,8 +90,8 @@ const API_BASE_URL = _api.API_CONFIG.BASE_URL;
|
|
|
90
90
|
|
|
91
91
|
// Interface for the transformed connection used by UI
|
|
92
92
|
|
|
93
|
-
/**
|
|
94
|
-
* Transform API connection to UI connection format
|
|
93
|
+
/**
|
|
94
|
+
* Transform API connection to UI connection format
|
|
95
95
|
*/
|
|
96
96
|
const transformAPIConnection = apiConnection => {
|
|
97
97
|
var _apiConnection$photo, _apiConnection$mutual;
|
|
@@ -132,10 +132,10 @@ const transformAPIConnection = apiConnection => {
|
|
|
132
132
|
};
|
|
133
133
|
};
|
|
134
134
|
|
|
135
|
-
/**
|
|
136
|
-
* Get user connections by username
|
|
137
|
-
* @param username - Username to fetch connections for
|
|
138
|
-
* @returns Promise<Connection[]>
|
|
135
|
+
/**
|
|
136
|
+
* Get user connections by username
|
|
137
|
+
* @param username - Username to fetch connections for
|
|
138
|
+
* @returns Promise<Connection[]>
|
|
139
139
|
*/
|
|
140
140
|
const getUserConnectionsByUsername = async username => {
|
|
141
141
|
try {
|
|
@@ -182,10 +182,10 @@ const getUserConnectionsByUsername = async username => {
|
|
|
182
182
|
}
|
|
183
183
|
};
|
|
184
184
|
|
|
185
|
-
/**
|
|
186
|
-
* Get user connections by user ID
|
|
187
|
-
* @param userId - User ID to fetch connections for
|
|
188
|
-
* @returns Promise<Connection[]>
|
|
185
|
+
/**
|
|
186
|
+
* Get user connections by user ID
|
|
187
|
+
* @param userId - User ID to fetch connections for
|
|
188
|
+
* @returns Promise<Connection[]>
|
|
189
189
|
*/
|
|
190
190
|
exports.getUserConnectionsByUsername = getUserConnectionsByUsername;
|
|
191
191
|
const getUserConnectionsByUserId = async userId => {
|
|
@@ -230,10 +230,10 @@ const getUserConnectionsByUserId = async userId => {
|
|
|
230
230
|
}
|
|
231
231
|
};
|
|
232
232
|
|
|
233
|
-
/**
|
|
234
|
-
* Get user connections with automatic detection of user info
|
|
235
|
-
* PRIORITIZES the working email/username endpoint over the failing user ID endpoint
|
|
236
|
-
* @returns Promise<Connection[]>
|
|
233
|
+
/**
|
|
234
|
+
* Get user connections with automatic detection of user info
|
|
235
|
+
* PRIORITIZES the working email/username endpoint over the failing user ID endpoint
|
|
236
|
+
* @returns Promise<Connection[]>
|
|
237
237
|
*/
|
|
238
238
|
exports.getUserConnectionsByUserId = getUserConnectionsByUserId;
|
|
239
239
|
const getUserConnections = async () => {
|
|
@@ -317,12 +317,12 @@ const getUserConnections = async () => {
|
|
|
317
317
|
}
|
|
318
318
|
};
|
|
319
319
|
|
|
320
|
-
/**
|
|
321
|
-
* Upload profile picture using base64 data with compression
|
|
322
|
-
* The backend identifies the user from the JWT token, no need for user ID in URL
|
|
323
|
-
* @param imageUri - Image URI (file:// or base64)
|
|
324
|
-
* @param fileType - File type (jpg, png) - optional, will be extracted from imageUri if not provided
|
|
325
|
-
* @returns Promise<{ success: boolean; photoUrl?: string; error?: string }>
|
|
320
|
+
/**
|
|
321
|
+
* Upload profile picture using base64 data with compression
|
|
322
|
+
* The backend identifies the user from the JWT token, no need for user ID in URL
|
|
323
|
+
* @param imageUri - Image URI (file:// or base64)
|
|
324
|
+
* @param fileType - File type (jpg, png) - optional, will be extracted from imageUri if not provided
|
|
325
|
+
* @returns Promise<{ success: boolean; photoUrl?: string; error?: string }>
|
|
326
326
|
*/
|
|
327
327
|
exports.getUserConnections = getUserConnections;
|
|
328
328
|
const uploadProfilePicture = async (imageUri, fileType) => {
|
|
@@ -18,8 +18,8 @@ const PortalContext = /*#__PURE__*/_react.default.createContext({
|
|
|
18
18
|
unmount: () => {}
|
|
19
19
|
});
|
|
20
20
|
|
|
21
|
-
/**
|
|
22
|
-
* Portal Host component - place this at the root of your app
|
|
21
|
+
/**
|
|
22
|
+
* Portal Host component - place this at the root of your app
|
|
23
23
|
*/
|
|
24
24
|
const PortalHost = ({
|
|
25
25
|
children
|
|
@@ -67,8 +67,8 @@ const PortalHost = ({
|
|
|
67
67
|
}, portals[Number(key)])));
|
|
68
68
|
};
|
|
69
69
|
|
|
70
|
-
/**
|
|
71
|
-
* Portal component - renders children into the PortalHost
|
|
70
|
+
/**
|
|
71
|
+
* Portal component - renders children into the PortalHost
|
|
72
72
|
*/
|
|
73
73
|
exports.PortalHost = PortalHost;
|
|
74
74
|
const Portal = ({
|