@onairos/react-native 3.1.16 → 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/OnairosButton.js +290 -0
- package/lib/commonjs/components/OnairosButton.js.map +1 -0
- package/lib/commonjs/components/OnairosSignInButton.js +30 -8
- 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 +9 -10
- 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/OnairosButton.js +282 -0
- package/lib/module/components/OnairosButton.js.map +1 -0
- package/lib/module/components/OnairosSignInButton.js +30 -8
- 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 +8 -10
- 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/OnairosButton.d.ts +37 -0
- package/lib/typescript/components/OnairosButton.d.ts.map +1 -0
- package/lib/typescript/components/OnairosSignInButton.d.ts +2 -1
- package/lib/typescript/components/OnairosSignInButton.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +3 -4
- 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 -0
- package/src/components/OnairosSignInButton.tsx +30 -10
- 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 -0
- package/src/index.ts +94 -96
- 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
|
@@ -15,27 +15,27 @@ const API_BASE_URL = _api.API_CONFIG.BASE_URL;
|
|
|
15
15
|
|
|
16
16
|
// Interface for Apple authentication payload
|
|
17
17
|
|
|
18
|
-
/**
|
|
19
|
-
* Interface for the timer response from backend
|
|
18
|
+
/**
|
|
19
|
+
* Interface for the timer response from backend
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
/**
|
|
23
|
-
* Interface for the profile response from backend
|
|
22
|
+
/**
|
|
23
|
+
* Interface for the profile response from backend
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
-
/**
|
|
27
|
-
* Interface for creating/updating user profile
|
|
26
|
+
/**
|
|
27
|
+
* Interface for creating/updating user profile
|
|
28
28
|
*/
|
|
29
29
|
|
|
30
|
-
/**
|
|
31
|
-
* Authenticate with Apple
|
|
32
|
-
* @param appleAuthData Data from Apple authentication
|
|
33
|
-
* @returns Authentication response with token and user data
|
|
30
|
+
/**
|
|
31
|
+
* Authenticate with Apple
|
|
32
|
+
* @param appleAuthData Data from Apple authentication
|
|
33
|
+
* @returns Authentication response with token and user data
|
|
34
34
|
*/
|
|
35
|
-
/**
|
|
36
|
-
* Authenticate with Onairos (similar to Apple authentication)
|
|
37
|
-
* @param onairosAuthData Data from Onairos authentication
|
|
38
|
-
* @returns Authentication response with token and user data
|
|
35
|
+
/**
|
|
36
|
+
* Authenticate with Onairos (similar to Apple authentication)
|
|
37
|
+
* @param onairosAuthData Data from Onairos authentication
|
|
38
|
+
* @returns Authentication response with token and user data
|
|
39
39
|
*/
|
|
40
40
|
const authenticateWithOnairos = async onairosAuthData => {
|
|
41
41
|
try {
|
|
@@ -85,10 +85,10 @@ const authenticateWithOnairos = async onairosAuthData => {
|
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
87
|
|
|
88
|
-
/**
|
|
89
|
-
* Authenticate with Onairos using the standardized /login/signin endpoint
|
|
90
|
-
* @param credentials Email and password for Onairos sign-in
|
|
91
|
-
* @returns Authentication response with token and user data
|
|
88
|
+
/**
|
|
89
|
+
* Authenticate with Onairos using the standardized /login/signin endpoint
|
|
90
|
+
* @param credentials Email and password for Onairos sign-in
|
|
91
|
+
* @returns Authentication response with token and user data
|
|
92
92
|
*/
|
|
93
93
|
exports.authenticateWithOnairos = authenticateWithOnairos;
|
|
94
94
|
const authenticateWithOnairosSignIn = async credentials => {
|
|
@@ -271,9 +271,9 @@ const authenticateWithApple = async appleAuthData => {
|
|
|
271
271
|
}
|
|
272
272
|
};
|
|
273
273
|
|
|
274
|
-
/**
|
|
275
|
-
* Save authentication token
|
|
276
|
-
* @param token JWT token
|
|
274
|
+
/**
|
|
275
|
+
* Save authentication token
|
|
276
|
+
* @param token JWT token
|
|
277
277
|
*/
|
|
278
278
|
exports.authenticateWithApple = authenticateWithApple;
|
|
279
279
|
const saveAuthToken = async token => {
|
|
@@ -285,8 +285,8 @@ const saveAuthToken = async token => {
|
|
|
285
285
|
}
|
|
286
286
|
};
|
|
287
287
|
|
|
288
|
-
/**
|
|
289
|
-
* Debug function to check all auth-related storage
|
|
288
|
+
/**
|
|
289
|
+
* Debug function to check all auth-related storage
|
|
290
290
|
*/
|
|
291
291
|
exports.saveAuthToken = saveAuthToken;
|
|
292
292
|
const debugAuthStorage = async () => {
|
|
@@ -314,8 +314,8 @@ const debugAuthStorage = async () => {
|
|
|
314
314
|
});
|
|
315
315
|
};
|
|
316
316
|
|
|
317
|
-
/**
|
|
318
|
-
* Clear all auth tokens and start fresh
|
|
317
|
+
/**
|
|
318
|
+
* Clear all auth tokens and start fresh
|
|
319
319
|
*/
|
|
320
320
|
exports.debugAuthStorage = debugAuthStorage;
|
|
321
321
|
const clearAllAuthTokens = async () => {
|
|
@@ -332,9 +332,9 @@ const clearAllAuthTokens = async () => {
|
|
|
332
332
|
console.log('✅ [AUTH DEBUG] All auth tokens and data cleared');
|
|
333
333
|
};
|
|
334
334
|
|
|
335
|
-
/**
|
|
336
|
-
* Get saved authentication token - CRITICAL FIX: Try all token types
|
|
337
|
-
* @returns Saved JWT token or null if not found
|
|
335
|
+
/**
|
|
336
|
+
* Get saved authentication token - CRITICAL FIX: Try all token types
|
|
337
|
+
* @returns Saved JWT token or null if not found
|
|
338
338
|
*/
|
|
339
339
|
exports.clearAllAuthTokens = clearAllAuthTokens;
|
|
340
340
|
const getAuthToken = async () => {
|
|
@@ -375,8 +375,8 @@ const getAuthToken = async () => {
|
|
|
375
375
|
}
|
|
376
376
|
};
|
|
377
377
|
|
|
378
|
-
/**
|
|
379
|
-
* Remove authentication token (logout)
|
|
378
|
+
/**
|
|
379
|
+
* Remove authentication token (logout)
|
|
380
380
|
*/
|
|
381
381
|
exports.getAuthToken = getAuthToken;
|
|
382
382
|
const removeAuthToken = async () => {
|
|
@@ -387,9 +387,9 @@ const removeAuthToken = async () => {
|
|
|
387
387
|
}
|
|
388
388
|
};
|
|
389
389
|
|
|
390
|
-
/**
|
|
391
|
-
* Validate if user is properly authenticated
|
|
392
|
-
* @returns boolean indicating if user has valid authentication
|
|
390
|
+
/**
|
|
391
|
+
* Validate if user is properly authenticated
|
|
392
|
+
* @returns boolean indicating if user has valid authentication
|
|
393
393
|
*/
|
|
394
394
|
exports.removeAuthToken = removeAuthToken;
|
|
395
395
|
const isAuthenticated = async () => {
|
|
@@ -402,10 +402,10 @@ const isAuthenticated = async () => {
|
|
|
402
402
|
}
|
|
403
403
|
};
|
|
404
404
|
|
|
405
|
-
/**
|
|
406
|
-
* Ensure authentication is available before making API calls
|
|
407
|
-
* @param apiName - Name of the API being called (for logging)
|
|
408
|
-
* @returns boolean indicating if authentication is available
|
|
405
|
+
/**
|
|
406
|
+
* Ensure authentication is available before making API calls
|
|
407
|
+
* @param apiName - Name of the API being called (for logging)
|
|
408
|
+
* @returns boolean indicating if authentication is available
|
|
409
409
|
*/
|
|
410
410
|
exports.isAuthenticated = isAuthenticated;
|
|
411
411
|
const ensureAuthentication = async apiName => {
|
|
@@ -418,9 +418,9 @@ const ensureAuthentication = async apiName => {
|
|
|
418
418
|
return isAuth;
|
|
419
419
|
};
|
|
420
420
|
|
|
421
|
-
/**
|
|
422
|
-
* Get saved Enoch authentication token specifically
|
|
423
|
-
* @returns Saved Enoch JWT token or null if not found
|
|
421
|
+
/**
|
|
422
|
+
* Get saved Enoch authentication token specifically
|
|
423
|
+
* @returns Saved Enoch JWT token or null if not found
|
|
424
424
|
*/
|
|
425
425
|
exports.ensureAuthentication = ensureAuthentication;
|
|
426
426
|
const getEnochToken = async () => {
|
|
@@ -432,9 +432,9 @@ const getEnochToken = async () => {
|
|
|
432
432
|
}
|
|
433
433
|
};
|
|
434
434
|
|
|
435
|
-
/**
|
|
436
|
-
* Save Enoch authentication token specifically
|
|
437
|
-
* @param token Enoch JWT token
|
|
435
|
+
/**
|
|
436
|
+
* Save Enoch authentication token specifically
|
|
437
|
+
* @param token Enoch JWT token
|
|
438
438
|
*/
|
|
439
439
|
exports.getEnochToken = getEnochToken;
|
|
440
440
|
const saveEnochToken = async token => {
|
|
@@ -447,9 +447,9 @@ const saveEnochToken = async token => {
|
|
|
447
447
|
}
|
|
448
448
|
};
|
|
449
449
|
|
|
450
|
-
/**
|
|
451
|
-
* Verify token with backend
|
|
452
|
-
* @returns Boolean indicating if token is valid
|
|
450
|
+
/**
|
|
451
|
+
* Verify token with backend
|
|
452
|
+
* @returns Boolean indicating if token is valid
|
|
453
453
|
*/
|
|
454
454
|
exports.saveEnochToken = saveEnochToken;
|
|
455
455
|
const verifyToken = async () => {
|
|
@@ -480,10 +480,10 @@ const verifyToken = async () => {
|
|
|
480
480
|
}
|
|
481
481
|
};
|
|
482
482
|
|
|
483
|
-
/**
|
|
484
|
-
* Get user profile from backend using stored token
|
|
485
|
-
* Note: This endpoint doesn't exist as GET, so we'll try to fetch via other means
|
|
486
|
-
* @returns User profile data
|
|
483
|
+
/**
|
|
484
|
+
* Get user profile from backend using stored token
|
|
485
|
+
* Note: This endpoint doesn't exist as GET, so we'll try to fetch via other means
|
|
486
|
+
* @returns User profile data
|
|
487
487
|
*/
|
|
488
488
|
exports.verifyToken = verifyToken;
|
|
489
489
|
const getUserProfile = async () => {
|
|
@@ -595,10 +595,10 @@ const getUserProfile = async () => {
|
|
|
595
595
|
}
|
|
596
596
|
};
|
|
597
597
|
|
|
598
|
-
/**
|
|
599
|
-
* Create or update user profile
|
|
600
|
-
* @param profileData Profile data to create/update
|
|
601
|
-
* @returns Profile response from backend
|
|
598
|
+
/**
|
|
599
|
+
* Create or update user profile
|
|
600
|
+
* @param profileData Profile data to create/update
|
|
601
|
+
* @returns Profile response from backend
|
|
602
602
|
*/
|
|
603
603
|
exports.getUserProfile = getUserProfile;
|
|
604
604
|
const createOrUpdateProfile = async profileData => {
|
|
@@ -624,9 +624,9 @@ const createOrUpdateProfile = async profileData => {
|
|
|
624
624
|
}
|
|
625
625
|
};
|
|
626
626
|
|
|
627
|
-
/**
|
|
628
|
-
* Update user's onboarded status
|
|
629
|
-
* @returns Promise that resolves when update is successful
|
|
627
|
+
/**
|
|
628
|
+
* Update user's onboarded status
|
|
629
|
+
* @returns Promise that resolves when update is successful
|
|
630
630
|
*/
|
|
631
631
|
exports.createOrUpdateProfile = createOrUpdateProfile;
|
|
632
632
|
const updateUserOnboardedStatus = async () => {
|
|
@@ -651,9 +651,9 @@ const updateUserOnboardedStatus = async () => {
|
|
|
651
651
|
}
|
|
652
652
|
};
|
|
653
653
|
|
|
654
|
-
/**
|
|
655
|
-
* Fetch the current timer status from the backend
|
|
656
|
-
* @returns Timer information including expiry and duration
|
|
654
|
+
/**
|
|
655
|
+
* Fetch the current timer status from the backend
|
|
656
|
+
* @returns Timer information including expiry and duration
|
|
657
657
|
*/
|
|
658
658
|
exports.updateUserOnboardedStatus = updateUserOnboardedStatus;
|
|
659
659
|
const getEventTimer = async () => {
|
|
@@ -810,10 +810,10 @@ const getEventTimer = async () => {
|
|
|
810
810
|
}
|
|
811
811
|
};
|
|
812
812
|
|
|
813
|
-
/**
|
|
814
|
-
* Check if a user email has admin privileges
|
|
815
|
-
* @param email User email to check
|
|
816
|
-
* @returns True if user is an admin
|
|
813
|
+
/**
|
|
814
|
+
* Check if a user email has admin privileges
|
|
815
|
+
* @param email User email to check
|
|
816
|
+
* @returns True if user is an admin
|
|
817
817
|
*/
|
|
818
818
|
exports.getEventTimer = getEventTimer;
|
|
819
819
|
const isAdminEmail = email => {
|
|
@@ -831,9 +831,9 @@ const isAdminEmail = email => {
|
|
|
831
831
|
return isAdmin;
|
|
832
832
|
};
|
|
833
833
|
|
|
834
|
-
/**
|
|
835
|
-
* Get the current admin status from AsyncStorage
|
|
836
|
-
* This could be used for caching admin status between sessions
|
|
834
|
+
/**
|
|
835
|
+
* Get the current admin status from AsyncStorage
|
|
836
|
+
* This could be used for caching admin status between sessions
|
|
837
837
|
*/
|
|
838
838
|
exports.isAdminEmail = isAdminEmail;
|
|
839
839
|
const getAdminStatus = async () => {
|
|
@@ -846,9 +846,9 @@ const getAdminStatus = async () => {
|
|
|
846
846
|
}
|
|
847
847
|
};
|
|
848
848
|
|
|
849
|
-
/**
|
|
850
|
-
* Save admin status to AsyncStorage
|
|
851
|
-
* @param isAdmin Whether the user is an admin
|
|
849
|
+
/**
|
|
850
|
+
* Save admin status to AsyncStorage
|
|
851
|
+
* @param isAdmin Whether the user is an admin
|
|
852
852
|
*/
|
|
853
853
|
exports.getAdminStatus = getAdminStatus;
|
|
854
854
|
const saveAdminStatus = async isAdmin => {
|
|
@@ -859,10 +859,10 @@ const saveAdminStatus = async isAdmin => {
|
|
|
859
859
|
}
|
|
860
860
|
};
|
|
861
861
|
|
|
862
|
-
/**
|
|
863
|
-
* Get stored Onairos username for API calls
|
|
864
|
-
* This is used for data connector APIs (Reddit, etc.) that need the username
|
|
865
|
-
* @returns Stored username or null if not found
|
|
862
|
+
/**
|
|
863
|
+
* Get stored Onairos username for API calls
|
|
864
|
+
* This is used for data connector APIs (Reddit, etc.) that need the username
|
|
865
|
+
* @returns Stored username or null if not found
|
|
866
866
|
*/
|
|
867
867
|
exports.saveAdminStatus = saveAdminStatus;
|
|
868
868
|
const getOnairosUsername = async () => {
|
|
@@ -874,9 +874,9 @@ const getOnairosUsername = async () => {
|
|
|
874
874
|
}
|
|
875
875
|
};
|
|
876
876
|
|
|
877
|
-
/**
|
|
878
|
-
* Save Onairos username for API calls
|
|
879
|
-
* @param username Username to store
|
|
877
|
+
/**
|
|
878
|
+
* Save Onairos username for API calls
|
|
879
|
+
* @param username Username to store
|
|
880
880
|
*/
|
|
881
881
|
exports.getOnairosUsername = getOnairosUsername;
|
|
882
882
|
const saveOnairosUsername = async username => {
|
|
@@ -887,11 +887,11 @@ const saveOnairosUsername = async username => {
|
|
|
887
887
|
}
|
|
888
888
|
};
|
|
889
889
|
|
|
890
|
-
/**
|
|
891
|
-
* Check if user has connected Onairos to Enoch before
|
|
892
|
-
* This checks for actual usage/training data, not just account existence
|
|
893
|
-
* @param userIdentifier - Email, username, or user ID to check
|
|
894
|
-
* @returns Promise<boolean> - true if user has connected Onairos features to Enoch
|
|
890
|
+
/**
|
|
891
|
+
* Check if user has connected Onairos to Enoch before
|
|
892
|
+
* This checks for actual usage/training data, not just account existence
|
|
893
|
+
* @param userIdentifier - Email, username, or user ID to check
|
|
894
|
+
* @returns Promise<boolean> - true if user has connected Onairos features to Enoch
|
|
895
895
|
*/
|
|
896
896
|
exports.saveOnairosUsername = saveOnairosUsername;
|
|
897
897
|
const checkEnochOnairosConnection = async userIdentifier => {
|
|
@@ -10,8 +10,8 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
10
10
|
// Service key for PIN storage
|
|
11
11
|
const PIN_SERVICE_KEY = 'OnairosEventsPIN';
|
|
12
12
|
const PIN_USERNAME = 'user_pin';
|
|
13
|
-
/**
|
|
14
|
-
* Check if biometric authentication is available on the device
|
|
13
|
+
/**
|
|
14
|
+
* Check if biometric authentication is available on the device
|
|
15
15
|
*/
|
|
16
16
|
const isBiometricAvailable = async () => {
|
|
17
17
|
try {
|
|
@@ -26,8 +26,8 @@ const isBiometricAvailable = async () => {
|
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
/**
|
|
30
|
-
* Store PIN with biometric authentication
|
|
29
|
+
/**
|
|
30
|
+
* Store PIN with biometric authentication
|
|
31
31
|
*/
|
|
32
32
|
exports.isBiometricAvailable = isBiometricAvailable;
|
|
33
33
|
const storePinWithBiometric = async pin => {
|
|
@@ -96,8 +96,8 @@ const storePinWithBiometric = async pin => {
|
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
98
|
|
|
99
|
-
/**
|
|
100
|
-
* Retrieve PIN with biometric authentication
|
|
99
|
+
/**
|
|
100
|
+
* Retrieve PIN with biometric authentication
|
|
101
101
|
*/
|
|
102
102
|
exports.storePinWithBiometric = storePinWithBiometric;
|
|
103
103
|
const retrievePinWithBiometric = async () => {
|
|
@@ -129,8 +129,8 @@ const retrievePinWithBiometric = async () => {
|
|
|
129
129
|
}
|
|
130
130
|
};
|
|
131
131
|
|
|
132
|
-
/**
|
|
133
|
-
* Check if PIN is stored in secure storage
|
|
132
|
+
/**
|
|
133
|
+
* Check if PIN is stored in secure storage
|
|
134
134
|
*/
|
|
135
135
|
exports.retrievePinWithBiometric = retrievePinWithBiometric;
|
|
136
136
|
const isPinStored = async () => {
|
|
@@ -143,8 +143,8 @@ const isPinStored = async () => {
|
|
|
143
143
|
}
|
|
144
144
|
};
|
|
145
145
|
|
|
146
|
-
/**
|
|
147
|
-
* Remove PIN from secure storage
|
|
146
|
+
/**
|
|
147
|
+
* Remove PIN from secure storage
|
|
148
148
|
*/
|
|
149
149
|
exports.isPinStored = isPinStored;
|
|
150
150
|
const removePinFromStorage = async () => {
|
|
@@ -12,11 +12,11 @@ const API_BASE_URL = _api.API_CONFIG.BASE_URL;
|
|
|
12
12
|
|
|
13
13
|
// Interface for API response
|
|
14
14
|
|
|
15
|
-
/**
|
|
16
|
-
* NEW UNIFIED LOOKUP - Get connected accounts using the simplified lookup endpoint
|
|
17
|
-
* This is the preferred method that makes only ONE request to the backend
|
|
18
|
-
* @param userIdentifier - Can be email, username, userId, or any user identifier
|
|
19
|
-
* @returns Promise<ConnectedAccount[]>
|
|
15
|
+
/**
|
|
16
|
+
* NEW UNIFIED LOOKUP - Get connected accounts using the simplified lookup endpoint
|
|
17
|
+
* This is the preferred method that makes only ONE request to the backend
|
|
18
|
+
* @param userIdentifier - Can be email, username, userId, or any user identifier
|
|
19
|
+
* @returns Promise<ConnectedAccount[]>
|
|
20
20
|
*/
|
|
21
21
|
const getConnectedAccountsLookup = async userIdentifier => {
|
|
22
22
|
try {
|
|
@@ -48,13 +48,13 @@ const getConnectedAccountsLookup = async userIdentifier => {
|
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
/**
|
|
52
|
-
* SMART CONNECTED ACCOUNTS FETCHER - Uses new API with old API fallback
|
|
53
|
-
* This function tries the new unified lookup first, then falls back to old methods if needed
|
|
54
|
-
* @param userEmail - User's email (primary identifier)
|
|
55
|
-
* @param userId - User's ID (fallback)
|
|
56
|
-
* @param username - User's username (fallback)
|
|
57
|
-
* @returns Promise<ConnectedAccount[]>
|
|
51
|
+
/**
|
|
52
|
+
* SMART CONNECTED ACCOUNTS FETCHER - Uses new API with old API fallback
|
|
53
|
+
* This function tries the new unified lookup first, then falls back to old methods if needed
|
|
54
|
+
* @param userEmail - User's email (primary identifier)
|
|
55
|
+
* @param userId - User's ID (fallback)
|
|
56
|
+
* @param username - User's username (fallback)
|
|
57
|
+
* @returns Promise<ConnectedAccount[]>
|
|
58
58
|
*/
|
|
59
59
|
exports.getConnectedAccountsLookup = getConnectedAccountsLookup;
|
|
60
60
|
const getConnectedAccountsSmart = async (userEmail, userId, username) => {
|
|
@@ -108,10 +108,10 @@ const getConnectedAccountsSmart = async (userEmail, userId, username) => {
|
|
|
108
108
|
// These will be used as fallbacks if the new unified lookup fails
|
|
109
109
|
// =============================================================================
|
|
110
110
|
|
|
111
|
-
/**
|
|
112
|
-
* Get connected accounts by username
|
|
113
|
-
* @param username - Username to fetch connected accounts for
|
|
114
|
-
* @returns Promise<ConnectedAccount[]>
|
|
111
|
+
/**
|
|
112
|
+
* Get connected accounts by username
|
|
113
|
+
* @param username - Username to fetch connected accounts for
|
|
114
|
+
* @returns Promise<ConnectedAccount[]>
|
|
115
115
|
*/
|
|
116
116
|
exports.getConnectedAccountsSmart = getConnectedAccountsSmart;
|
|
117
117
|
const getConnectedAccountsByUsername = async username => {
|
|
@@ -137,10 +137,10 @@ const getConnectedAccountsByUsername = async username => {
|
|
|
137
137
|
}
|
|
138
138
|
};
|
|
139
139
|
|
|
140
|
-
/**
|
|
141
|
-
* Get connected accounts by email
|
|
142
|
-
* @param email - Email to fetch connected accounts for
|
|
143
|
-
* @returns Promise<ConnectedAccount[]>
|
|
140
|
+
/**
|
|
141
|
+
* Get connected accounts by email
|
|
142
|
+
* @param email - Email to fetch connected accounts for
|
|
143
|
+
* @returns Promise<ConnectedAccount[]>
|
|
144
144
|
*/
|
|
145
145
|
exports.getConnectedAccountsByUsername = getConnectedAccountsByUsername;
|
|
146
146
|
const getConnectedAccountsByEmail = async email => {
|
|
@@ -166,10 +166,10 @@ const getConnectedAccountsByEmail = async email => {
|
|
|
166
166
|
}
|
|
167
167
|
};
|
|
168
168
|
|
|
169
|
-
/**
|
|
170
|
-
* Get connected accounts by user ID
|
|
171
|
-
* @param userId - User ID to fetch connected accounts for
|
|
172
|
-
* @returns Promise<ConnectedAccount[]>
|
|
169
|
+
/**
|
|
170
|
+
* Get connected accounts by user ID
|
|
171
|
+
* @param userId - User ID to fetch connected accounts for
|
|
172
|
+
* @returns Promise<ConnectedAccount[]>
|
|
173
173
|
*/
|
|
174
174
|
exports.getConnectedAccountsByEmail = getConnectedAccountsByEmail;
|
|
175
175
|
const getConnectedAccountsByUserId = async userId => {
|
|
@@ -195,10 +195,10 @@ const getConnectedAccountsByUserId = async userId => {
|
|
|
195
195
|
}
|
|
196
196
|
};
|
|
197
197
|
|
|
198
|
-
/**
|
|
199
|
-
* Get platform icon based on platform name
|
|
200
|
-
* @param platform - Platform name (case insensitive)
|
|
201
|
-
* @returns Image source for the platform icon
|
|
198
|
+
/**
|
|
199
|
+
* Get platform icon based on platform name
|
|
200
|
+
* @param platform - Platform name (case insensitive)
|
|
201
|
+
* @returns Image source for the platform icon
|
|
202
202
|
*/
|
|
203
203
|
exports.getConnectedAccountsByUserId = getConnectedAccountsByUserId;
|
|
204
204
|
const getPlatformIcon = platform => {
|
|
@@ -230,10 +230,10 @@ const getPlatformIcon = platform => {
|
|
|
230
230
|
}
|
|
231
231
|
};
|
|
232
232
|
|
|
233
|
-
/**
|
|
234
|
-
* Get platform color based on platform name
|
|
235
|
-
* @param platform - Platform name (case insensitive)
|
|
236
|
-
* @returns Hex color code for the platform
|
|
233
|
+
/**
|
|
234
|
+
* Get platform color based on platform name
|
|
235
|
+
* @param platform - Platform name (case insensitive)
|
|
236
|
+
* @returns Hex color code for the platform
|
|
237
237
|
*/
|
|
238
238
|
exports.getPlatformIcon = getPlatformIcon;
|
|
239
239
|
const getPlatformColor = platform => {
|
|
@@ -7,17 +7,17 @@ exports.updateGoogleClientIds = exports.signOutFromGoogle = exports.signInWithGo
|
|
|
7
7
|
var _googleSignin = require("@react-native-google-signin/google-signin");
|
|
8
8
|
var _asyncStorage = _interopRequireDefault(require("@react-native-async-storage/async-storage"));
|
|
9
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
-
/**
|
|
11
|
-
* Google Authentication Service
|
|
12
|
-
* Handles Google Sign-In for user authentication and account creation
|
|
10
|
+
/**
|
|
11
|
+
* Google Authentication Service
|
|
12
|
+
* Handles Google Sign-In for user authentication and account creation
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
// 🔑 Using the same client ID configuration as platform auth
|
|
16
16
|
let WEB_CLIENT_ID = '1030678346906-lovkuds2ouqmoc8eu5qpo98spa6edv4o.apps.googleusercontent.com';
|
|
17
17
|
let IOS_CLIENT_ID = '1030678346906-lovkuds2ouqmoc8eu5qpo98spa6edv4o.apps.googleusercontent.com';
|
|
18
18
|
|
|
19
|
-
/**
|
|
20
|
-
* Update Google OAuth client IDs for custom configurations
|
|
19
|
+
/**
|
|
20
|
+
* Update Google OAuth client IDs for custom configurations
|
|
21
21
|
*/
|
|
22
22
|
const updateGoogleClientIds = config => {
|
|
23
23
|
if (config.webClientId) {
|
|
@@ -32,8 +32,8 @@ const updateGoogleClientIds = config => {
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
/**
|
|
36
|
-
* Initialize Google Sign-In for user authentication
|
|
35
|
+
/**
|
|
36
|
+
* Initialize Google Sign-In for user authentication
|
|
37
37
|
*/
|
|
38
38
|
exports.updateGoogleClientIds = updateGoogleClientIds;
|
|
39
39
|
const initializeGoogleAuth = () => {
|
|
@@ -51,8 +51,8 @@ const initializeGoogleAuth = () => {
|
|
|
51
51
|
});
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
-
/**
|
|
55
|
-
* Sign in with Google and create/authenticate user account
|
|
54
|
+
/**
|
|
55
|
+
* Sign in with Google and create/authenticate user account
|
|
56
56
|
*/
|
|
57
57
|
const signInWithGoogle = async () => {
|
|
58
58
|
try {
|
|
@@ -155,8 +155,8 @@ const signInWithGoogle = async () => {
|
|
|
155
155
|
}
|
|
156
156
|
};
|
|
157
157
|
|
|
158
|
-
/**
|
|
159
|
-
* Create or authenticate user account on backend
|
|
158
|
+
/**
|
|
159
|
+
* Create or authenticate user account on backend
|
|
160
160
|
*/
|
|
161
161
|
exports.signInWithGoogle = signInWithGoogle;
|
|
162
162
|
const createUserAccount = async userData => {
|
|
@@ -226,8 +226,8 @@ const createUserAccount = async userData => {
|
|
|
226
226
|
}
|
|
227
227
|
};
|
|
228
228
|
|
|
229
|
-
/**
|
|
230
|
-
* Check if user is already signed in with Google
|
|
229
|
+
/**
|
|
230
|
+
* Check if user is already signed in with Google
|
|
231
231
|
*/
|
|
232
232
|
const isGoogleSignedIn = async () => {
|
|
233
233
|
try {
|
|
@@ -250,8 +250,8 @@ const isGoogleSignedIn = async () => {
|
|
|
250
250
|
}
|
|
251
251
|
};
|
|
252
252
|
|
|
253
|
-
/**
|
|
254
|
-
* Sign out from Google
|
|
253
|
+
/**
|
|
254
|
+
* Sign out from Google
|
|
255
255
|
*/
|
|
256
256
|
exports.isGoogleSignedIn = isGoogleSignedIn;
|
|
257
257
|
const signOutFromGoogle = async () => {
|
|
@@ -6,13 +6,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.convertImageToOptimizedBase64 = exports.compressProfilePicture = exports.compressImageToTarget = exports.compressForUpload = void 0;
|
|
7
7
|
var _reactNativeImageResizer = _interopRequireDefault(require("@bam.tech/react-native-image-resizer"));
|
|
8
8
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
-
/**
|
|
10
|
-
* Comprehensive image compression service for React Native
|
|
11
|
-
* Supports iterative compression to meet specific size targets
|
|
9
|
+
/**
|
|
10
|
+
* Comprehensive image compression service for React Native
|
|
11
|
+
* Supports iterative compression to meet specific size targets
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
/**
|
|
15
|
-
* Get file size from URI (React Native compatible)
|
|
14
|
+
/**
|
|
15
|
+
* Get file size from URI (React Native compatible)
|
|
16
16
|
*/
|
|
17
17
|
const getFileSizeFromUri = async uri => {
|
|
18
18
|
try {
|
|
@@ -25,8 +25,8 @@ const getFileSizeFromUri = async uri => {
|
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
/**
|
|
29
|
-
* Convert image to base64 string
|
|
28
|
+
/**
|
|
29
|
+
* Convert image to base64 string
|
|
30
30
|
*/
|
|
31
31
|
const imageToBase64 = async uri => {
|
|
32
32
|
try {
|
|
@@ -53,8 +53,8 @@ const imageToBase64 = async uri => {
|
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
55
|
|
|
56
|
-
/**
|
|
57
|
-
* Compress image with iterative quality reduction to meet size target
|
|
56
|
+
/**
|
|
57
|
+
* Compress image with iterative quality reduction to meet size target
|
|
58
58
|
*/
|
|
59
59
|
const compressImageToTarget = async (imageUri, options = {}) => {
|
|
60
60
|
const {
|
|
@@ -216,8 +216,8 @@ const compressImageToTarget = async (imageUri, options = {}) => {
|
|
|
216
216
|
}
|
|
217
217
|
};
|
|
218
218
|
|
|
219
|
-
/**
|
|
220
|
-
* Quick compression for profile pictures (300KB target)
|
|
219
|
+
/**
|
|
220
|
+
* Quick compression for profile pictures (300KB target)
|
|
221
221
|
*/
|
|
222
222
|
exports.compressImageToTarget = compressImageToTarget;
|
|
223
223
|
const compressProfilePicture = async imageUri => {
|
|
@@ -230,8 +230,8 @@ const compressProfilePicture = async imageUri => {
|
|
|
230
230
|
});
|
|
231
231
|
};
|
|
232
232
|
|
|
233
|
-
/**
|
|
234
|
-
* Compress image for upload with custom settings
|
|
233
|
+
/**
|
|
234
|
+
* Compress image for upload with custom settings
|
|
235
235
|
*/
|
|
236
236
|
exports.compressProfilePicture = compressProfilePicture;
|
|
237
237
|
const compressForUpload = async (imageUri, maxSizeKB = 300) => {
|
|
@@ -244,8 +244,8 @@ const compressForUpload = async (imageUri, maxSizeKB = 300) => {
|
|
|
244
244
|
});
|
|
245
245
|
};
|
|
246
246
|
|
|
247
|
-
/**
|
|
248
|
-
* Legacy function for backward compatibility
|
|
247
|
+
/**
|
|
248
|
+
* Legacy function for backward compatibility
|
|
249
249
|
*/
|
|
250
250
|
exports.compressForUpload = compressForUpload;
|
|
251
251
|
const convertImageToOptimizedBase64 = async (imageUri, quality = 0.8) => {
|