@onairos/react-native 3.7.1 â 3.7.3
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/lib/commonjs/api/index.js +219 -9
- package/lib/commonjs/assets/icons/spotify.png +0 -0
- package/lib/commonjs/assets/images/spotify.png +0 -0
- package/lib/commonjs/components/BodyText.js +27 -9
- package/lib/commonjs/components/BrandMark.js +111 -10
- package/lib/commonjs/components/CodeInput.js +116 -9
- package/lib/commonjs/components/EmailInput.js +30 -8
- package/lib/commonjs/components/GoogleButton.js +56 -9
- package/lib/commonjs/components/HeadingGroup.js +43 -9
- package/lib/commonjs/components/LLMDataInputModal.js +664 -14
- package/lib/commonjs/components/ModalHeader.js +99 -9
- package/lib/commonjs/components/ModalSheet.js +47 -9
- package/lib/commonjs/components/Onairos.js +380 -14
- package/lib/commonjs/components/OnairosButton.js +313 -13
- package/lib/commonjs/components/OnairosSignInButton.js +130 -12
- package/lib/commonjs/components/Overlay.js +465 -13
- package/lib/commonjs/components/PersonaImage.js +137 -10
- package/lib/commonjs/components/PersonaLoadingScreen.js +318 -12
- package/lib/commonjs/components/PersonalizationConsentScreen.js +467 -13
- package/lib/commonjs/components/PinCreationScreen.js +403 -12
- package/lib/commonjs/components/PinInput.js +464 -9
- package/lib/commonjs/components/PlatformConnectorsStep.js +1311 -23
- package/lib/commonjs/components/PlatformList.js +137 -10
- package/lib/commonjs/components/PlatformToggle.js +180 -9
- package/lib/commonjs/components/PrimaryButton.js +180 -10
- package/lib/commonjs/components/SignInMatchAnimation.js +197 -9
- package/lib/commonjs/components/SignInStep.js +345 -12
- package/lib/commonjs/components/UniversalOnboarding.js +2780 -30
- package/lib/commonjs/components/VerificationStep.js +176 -11
- package/lib/commonjs/components/WelcomeScreen.js +461 -22
- package/lib/commonjs/components/icons/Basicproficon.js +37 -8
- package/lib/commonjs/components/icons/Basicprofile.js +21 -8
- package/lib/commonjs/components/icons/Checkbox.js +21 -8
- package/lib/commonjs/components/icons/Checkmark.js +27 -8
- package/lib/commonjs/components/icons/Contentanalysis.js +21 -8
- package/lib/commonjs/components/icons/Contenticon.js +39 -8
- package/lib/commonjs/components/icons/EnochE.js +41 -8
- package/lib/commonjs/components/icons/Personalityicon.js +30 -8
- package/lib/commonjs/components/icons/Personalityprofile.js +21 -8
- package/lib/commonjs/components/icons/Personalitytraits.js +21 -8
- package/lib/commonjs/components/icons/Userpreferences.js +21 -8
- package/lib/commonjs/components/icons/index.js +84 -17
- package/lib/commonjs/components/onboarding/OAuthWebView.js +1754 -18
- package/lib/commonjs/components/onboarding/OnboardingHeader.js +74 -10
- package/lib/commonjs/components/onboarding/PinInput.js +283 -10
- package/lib/commonjs/components/onboarding/PlatformConnector.js +249 -11
- package/lib/commonjs/config/PLATFORM_APIS.md +849 -0
- package/lib/commonjs/config/api.js +56 -7
- package/lib/commonjs/constants/index.js +120 -7
- package/lib/commonjs/context/AuthContext.js +345 -10
- package/lib/commonjs/hooks/useConnectedAccounts.js +111 -9
- package/lib/commonjs/hooks/useConnections.js +102 -8
- package/lib/commonjs/hooks/useCredentials.js +178 -10
- package/lib/commonjs/hooks/useUserConnections.js +148 -10
- package/lib/commonjs/index.js +439 -34
- package/lib/commonjs/services/apiClient.js +298 -8
- package/lib/commonjs/services/biometricPinService.js +180 -8
- package/lib/commonjs/services/chatGPTConversationExtractor.js +155 -8
- package/lib/commonjs/services/chatGPTConversationService.js +275 -9
- package/lib/commonjs/services/claudeConversationExtractor.js +103 -8
- package/lib/commonjs/services/claudeConversationService.js +158 -9
- package/lib/commonjs/services/connectedAccountsService.js +310 -10
- package/lib/commonjs/services/googleAuthService.js +252 -11
- package/lib/commonjs/services/hingeDataExtractor.js +105 -8
- package/lib/commonjs/services/hingeDataService.js +150 -9
- package/lib/commonjs/services/imageCompressionService.js +260 -7
- package/lib/commonjs/services/instagramDataExtractor.js +126 -8
- package/lib/commonjs/services/instagramDataService.js +163 -9
- package/lib/commonjs/services/jwtStorageService.js +276 -7
- package/lib/commonjs/services/linkedinDOMExtractor.js +245 -7
- package/lib/commonjs/services/linkedinProfileService.js +222 -9
- package/lib/commonjs/services/linkedinScrapingService.js +230 -8
- package/lib/commonjs/services/llmDataStorage.js +294 -8
- package/lib/commonjs/services/mobileTrainingService.js +186 -8
- package/lib/commonjs/services/netflixDataExtractor.js +120 -8
- package/lib/commonjs/services/netflixDataService.js +198 -9
- package/lib/commonjs/services/pinEncryptionService.js +84 -8
- package/lib/commonjs/services/pinStorageUtils.js +105 -7
- package/lib/commonjs/services/platformAuthService.js +1484 -12
- package/lib/commonjs/services/sephoraDataExtractor.js +140 -8
- package/lib/commonjs/services/sephoraDataService.js +200 -9
- package/lib/commonjs/services/spotifyDataExtractor.js +148 -8
- package/lib/commonjs/services/spotifyDataService.js +241 -9
- package/lib/commonjs/services/storageService.js +404 -8
- package/lib/commonjs/services/telegramDataExtractor.js +115 -8
- package/lib/commonjs/services/telegramDataService.js +499 -9
- package/lib/commonjs/services/trainingApiHelpers.js +73 -7
- package/lib/commonjs/services/userConnectionsService.js +340 -10
- package/lib/commonjs/services/youtubeMigrationService.js +416 -10
- package/lib/commonjs/theme/index.js +250 -7
- package/lib/commonjs/types/ambient.d.js +2 -1
- package/lib/commonjs/types/declarations.d.js +2 -1
- package/lib/commonjs/types/index.js +6 -1
- package/lib/commonjs/types/node-fix.d.js +2 -1
- package/lib/commonjs/types/node-override.d.js +2 -1
- package/lib/commonjs/types/opacity.d.js +2 -1
- package/lib/commonjs/types.js +14 -1
- package/lib/commonjs/utils/Portal.js +98 -8
- package/lib/commonjs/utils/api.js +130 -9
- package/lib/commonjs/utils/assetRegistry.js +210 -35
- package/lib/commonjs/utils/auth.js +112 -9
- package/lib/commonjs/utils/connectorTests.js +613 -29
- package/lib/commonjs/utils/crypto.js +62 -8
- package/lib/commonjs/utils/debugHelper.js +64 -1
- package/lib/commonjs/utils/encryption.js +76 -7
- package/lib/commonjs/utils/eventUtils.js +288 -1
- package/lib/commonjs/utils/haptics.js +66 -9
- package/lib/commonjs/utils/imagePreloader.js +6 -1
- package/lib/commonjs/utils/networkDiagnostics.js +226 -8
- package/lib/commonjs/utils/onairosApi.js +350 -9
- package/lib/commonjs/utils/programmaticFlow.js +117 -9
- package/lib/commonjs/utils/retryHelper.js +220 -1
- package/lib/commonjs/utils/secureStorage.js +349 -10
- package/lib/commonjs/utils/webviewScripts/chatgpt.js +551 -1
- package/lib/commonjs/utils/webviewScripts/claude.js +376 -1
- package/lib/commonjs/utils/webviewScripts/hinge.js +411 -1
- package/lib/commonjs/utils/webviewScripts/index.js +698 -15
- package/lib/commonjs/utils/webviewScripts/instagram.js +454 -1
- package/lib/commonjs/utils/webviewScripts/linkedin.js +880 -1
- package/lib/commonjs/utils/webviewScripts/netflix.js +382 -1
- package/lib/commonjs/utils/webviewScripts/sephora.js +516 -1
- package/lib/commonjs/utils/webviewScripts/spotify.js +419 -1
- package/lib/commonjs/utils/webviewScripts/telegram.js +678 -1
- package/lib/module/api/index.js +211 -1
- package/lib/module/assets/icons/spotify.png +0 -0
- package/lib/module/assets/images/spotify.png +0 -0
- package/lib/module/components/BodyText.js +20 -1
- package/lib/module/components/BrandMark.js +104 -1
- package/lib/module/components/CodeInput.js +109 -1
- package/lib/module/components/EmailInput.js +23 -1
- package/lib/module/components/GoogleButton.js +49 -1
- package/lib/module/components/HeadingGroup.js +36 -1
- package/lib/module/components/LLMDataInputModal.js +656 -7
- package/lib/module/components/ModalHeader.js +92 -1
- package/lib/module/components/ModalSheet.js +39 -1
- package/lib/module/components/Onairos.js +373 -1
- package/lib/module/components/OnairosButton.js +305 -1
- package/lib/module/components/OnairosSignInButton.js +121 -1
- package/lib/module/components/Overlay.js +456 -1
- package/lib/module/components/PersonaImage.js +129 -1
- package/lib/module/components/PersonaLoadingScreen.js +310 -1
- package/lib/module/components/PersonalizationConsentScreen.js +460 -1
- package/lib/module/components/PinCreationScreen.js +396 -1
- package/lib/module/components/PinInput.js +456 -1
- package/lib/module/components/PlatformConnectorsStep.js +1302 -6
- package/lib/module/components/PlatformList.js +129 -1
- package/lib/module/components/PlatformToggle.js +173 -1
- package/lib/module/components/PrimaryButton.js +172 -1
- package/lib/module/components/SignInMatchAnimation.js +189 -1
- package/lib/module/components/SignInStep.js +338 -1
- package/lib/module/components/UniversalOnboarding.js +2770 -1
- package/lib/module/components/VerificationStep.js +168 -1
- package/lib/module/components/WelcomeScreen.js +453 -1
- package/lib/module/components/icons/Basicproficon.js +30 -1
- package/lib/module/components/icons/Basicprofile.js +14 -1
- package/lib/module/components/icons/Checkbox.js +14 -1
- package/lib/module/components/icons/Checkmark.js +20 -1
- package/lib/module/components/icons/Contentanalysis.js +14 -1
- package/lib/module/components/icons/Contenticon.js +32 -1
- package/lib/module/components/icons/EnochE.js +34 -1
- package/lib/module/components/icons/Personalityicon.js +23 -1
- package/lib/module/components/icons/Personalityprofile.js +14 -1
- package/lib/module/components/icons/Personalitytraits.js +14 -1
- package/lib/module/components/icons/Userpreferences.js +14 -1
- package/lib/module/components/icons/index.js +13 -1
- package/lib/module/components/onboarding/OAuthWebView.js +1746 -1
- package/lib/module/components/onboarding/OnboardingHeader.js +66 -1
- package/lib/module/components/onboarding/PinInput.js +274 -1
- package/lib/module/components/onboarding/PlatformConnector.js +240 -1
- package/lib/module/config/PLATFORM_APIS.md +849 -0
- package/lib/module/config/api.js +47 -1
- package/lib/module/constants/index.js +114 -1
- package/lib/module/context/AuthContext.js +335 -1
- package/lib/module/hooks/useConnectedAccounts.js +106 -1
- package/lib/module/hooks/useConnections.js +95 -1
- package/lib/module/hooks/useCredentials.js +171 -6
- package/lib/module/hooks/useUserConnections.js +140 -1
- package/lib/module/index.js +172 -1
- package/lib/module/services/apiClient.js +295 -1
- package/lib/module/services/biometricPinService.js +169 -1
- package/lib/module/services/chatGPTConversationExtractor.js +149 -1
- package/lib/module/services/chatGPTConversationService.js +268 -1
- package/lib/module/services/claudeConversationExtractor.js +97 -1
- package/lib/module/services/claudeConversationService.js +151 -1
- package/lib/module/services/connectedAccountsService.js +293 -1
- package/lib/module/services/googleAuthService.js +241 -1
- package/lib/module/services/hingeDataExtractor.js +99 -1
- package/lib/module/services/hingeDataService.js +143 -1
- package/lib/module/services/imageCompressionService.js +250 -1
- package/lib/module/services/instagramDataExtractor.js +120 -1
- package/lib/module/services/instagramDataService.js +156 -1
- package/lib/module/services/jwtStorageService.js +257 -1
- package/lib/module/services/linkedinDOMExtractor.js +234 -1
- package/lib/module/services/linkedinProfileService.js +210 -1
- package/lib/module/services/linkedinScrapingService.js +219 -1
- package/lib/module/services/llmDataStorage.js +277 -1
- package/lib/module/services/mobileTrainingService.js +173 -1
- package/lib/module/services/netflixDataExtractor.js +114 -1
- package/lib/module/services/netflixDataService.js +191 -1
- package/lib/module/services/pinEncryptionService.js +74 -6
- package/lib/module/services/pinStorageUtils.js +93 -1
- package/lib/module/services/platformAuthService.js +1461 -1
- package/lib/module/services/sephoraDataExtractor.js +134 -1
- package/lib/module/services/sephoraDataService.js +193 -1
- package/lib/module/services/spotifyDataExtractor.js +142 -1
- package/lib/module/services/spotifyDataService.js +234 -1
- package/lib/module/services/storageService.js +383 -1
- package/lib/module/services/telegramDataExtractor.js +109 -1
- package/lib/module/services/telegramDataService.js +493 -1
- package/lib/module/services/trainingApiHelpers.js +67 -1
- package/lib/module/services/userConnectionsService.js +329 -1
- package/lib/module/services/youtubeMigrationService.js +405 -1
- package/lib/module/theme/index.js +245 -1
- package/lib/module/types.js +10 -1
- package/lib/module/utils/Portal.js +90 -1
- package/lib/module/utils/api.js +118 -1
- package/lib/module/utils/assetRegistry.js +200 -34
- package/lib/module/utils/auth.js +100 -1
- package/lib/module/utils/connectorTests.js +600 -27
- package/lib/module/utils/crypto.js +54 -1
- package/lib/module/utils/debugHelper.js +54 -1
- package/lib/module/utils/encryption.js +67 -1
- package/lib/module/utils/eventUtils.js +270 -1
- package/lib/module/utils/haptics.js +59 -8
- package/lib/module/utils/imagePreloader.js +3 -1
- package/lib/module/utils/networkDiagnostics.js +217 -1
- package/lib/module/utils/onairosApi.js +333 -1
- package/lib/module/utils/programmaticFlow.js +111 -1
- package/lib/module/utils/retryHelper.js +211 -1
- package/lib/module/utils/secureStorage.js +330 -6
- package/lib/module/utils/webviewScripts/chatgpt.js +545 -1
- package/lib/module/utils/webviewScripts/claude.js +370 -1
- package/lib/module/utils/webviewScripts/hinge.js +405 -1
- package/lib/module/utils/webviewScripts/index.js +434 -1
- package/lib/module/utils/webviewScripts/instagram.js +448 -1
- package/lib/module/utils/webviewScripts/linkedin.js +874 -1
- package/lib/module/utils/webviewScripts/netflix.js +376 -1
- package/lib/module/utils/webviewScripts/sephora.js +510 -1
- package/lib/module/utils/webviewScripts/spotify.js +413 -1
- package/lib/module/utils/webviewScripts/telegram.js +672 -1
- package/package.json +2 -2
|
@@ -1,10 +1,340 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
function _0x4124(_0x59a470,_0x4124b3){_0x59a470=_0x59a470-0x0;const _0x1c7aff=_0x59a4();let _0x5ac7a=_0x1c7aff[_0x59a470];return _0x5ac7a;}Object[_0x4124(0x0)](exports,_0x4124(0x1),{'value':!![]}),exports[_0x4124(0x2)]=exports[_0x4124(0x3)]=exports['getUserConnectionsByUserId']=exports[_0x4124(0x4)]=void 0x0;var _authService=__ONAIROS_REQ_FUNC__(0x0),_asyncStorage=_interopRequireDefault(__ONAIROS_REQ_FUNC__(0x1)),_api=__ONAIROS_REQ_FUNC__(0x2),_assetRegistry=__ONAIROS_REQ_FUNC__(0x3);function _interopRequireDefault(_0x17d846){return _0x17d846&&_0x17d846[_0x4124(0x1)]?_0x17d846:{'default':_0x17d846};}const getUserIdWithFallbacks=async()=>{const _0x51a42d={'ARlaD':'â ī¸\x20[USER\x20ID]\x20getUserProfile\x20returned\x20invalid/fallback\x20ID:','jqUEA':function(_0x569f16,_0x3f697d){return _0x569f16===_0x3f697d;},'VnKzf':'â\x20Error\x20in\x20getUserConnections:','DBTZq':_0x4124(0x5),'eazIO':_0x4124(0x6),'UXTbD':_0x4124(0x7),'cGIxV':'â
\x20[USER\x20ID]\x20Got\x20email\x20from\x20AsyncStorage\x20(backend\x20supports\x20usernames):','kmvkL':_0x4124(0x8),'KXhex':function(_0x512d83,_0x886b81){return _0x512d83!==_0x886b81;},'yyHPB':_0x4124(0x9),'DRQll':function(_0x55b3d7,_0x2a0c9b){return _0x55b3d7!==_0x2a0c9b;},'WZOmo':function(_0x65fbf5,_0x5362ef){return _0x65fbf5===_0x5362ef;},'jAGGe':_0x4124(0xa),'fGbNh':function(_0x2840c4,_0x4fcd60){return _0x2840c4===_0x4fcd60;},'RnyYz':'QDokx','qPzTr':_0x4124(0xb),'dyooO':_0x4124(0xc),'hGrQf':function(_0x3aa57a,_0x6a43e2){return _0x3aa57a!==_0x6a43e2;},'JoKGK':_0x4124(0xd),'qpRlO':function(_0xf7f7d9,_0x2f9fca){return _0xf7f7d9!==_0x2f9fca;},'hGsUw':function(_0x5d1d9f,_0x3af0fd){return _0x5d1d9f>_0x3af0fd;},'crEdV':_0x4124(0xe),'QUxzT':'faTLp','iJotV':_0x4124(0xf),'NgEnT':_0x4124(0x10),'vbMnc':function(_0x47d64f,_0x7b49fe){return _0x47d64f!==_0x7b49fe;},'oozNI':_0x4124(0x11),'gKkdS':_0x4124(0x12),'xToPQ':_0x4124(0x13),'DcdYi':_0x4124(0x14),'WXRYc':function(_0x285ebc,_0x228b05){return _0x285ebc===_0x228b05;},'iMMrd':'mWunH','hNwYR':_0x4124(0x15),'XBVJb':function(_0x39b69e,_0x5a5aac){return _0x39b69e===_0x5a5aac;},'WHGHM':_0x4124(0x16),'nCaaJ':_0x4124(0x17),'xDPYk':'WxLzy','AwPMW':_0x4124(0x18)};try{console[_0x4124(0x19)](_0x51a42d[_0x4124(0x1a)]);try{const _0xd9e397=await(0x0,_authService[_0x4124(0x1b)])();if(_0x51a42d[_0x4124(0x1c)](_0xd9e397,null)&&_0xd9e397!==void 0x0&&_0xd9e397['id']&&_0xd9e397['id']!==_0x51a42d[_0x4124(0x1d)]){if(_0x51a42d[_0x4124(0x1e)]('kVrDd','kGgaa'))return console['log'](_0x4124(0x1f),_0xd9e397['id']),_0xd9e397['id'];else _0x12815c['warn'](_0x51a42d[_0x4124(0x20)],_0x51a42d['jqUEA'](_0xb22450,null)||_0x398802===void 0x0?void 0x0:_0x4ebf96['id']);}else{if(_0x51a42d[_0x4124(0x21)](_0x4124(0x22),_0x51a42d[_0x4124(0x23)]))return _0xcfb7cd[_0x4124(0x24)]('â ī¸\x20[CONNECTIONS\x20API]\x20No\x20authentication\x20token\x20available\x20for\x20user\x20ID\x20connections\x20request'),[];else console['warn'](_0x4124(0x25),_0xd9e397===null||_0x51a42d[_0x4124(0x26)](_0xd9e397,void 0x0)?void 0x0:_0xd9e397['id']);}}catch(_0x375778){if(_0x51a42d[_0x4124(0x27)]===_0x51a42d[_0x4124(0x27)])console['warn'](_0x51a42d['qPzTr'],_0x375778);else return _0x410a91['log'](_0x4124(0x28),_0x15699d),_0x3921bb;}const _0x26b7bb=await _asyncStorage['default']['getItem'](_0x51a42d[_0x4124(0x29)]);if(_0x26b7bb&&_0x51a42d[_0x4124(0x2a)](_0x26b7bb,_0x51a42d[_0x4124(0x2b)])&&_0x51a42d[_0x4124(0x2c)](_0x26b7bb,_0x51a42d[_0x4124(0x1d)])&&_0x51a42d[_0x4124(0x2d)](_0x26b7bb[_0x4124(0x2e)],0xa))return console[_0x4124(0x19)](_0x51a42d[_0x4124(0x2f)],_0x26b7bb),_0x26b7bb;else{if(_0x26b7bb){if(_0x51a42d[_0x4124(0x21)](_0x51a42d[_0x4124(0x30)],_0x51a42d[_0x4124(0x31)]))return _0x371d61[_0x4124(0x19)](_0x51a42d[_0x4124(0x32)],_0x3be8c8),[];else console[_0x4124(0x24)](_0x51a42d[_0x4124(0x33)],_0x26b7bb);}}const _0x1e1d08=await _asyncStorage['default'][_0x4124(0x34)](_0x51a42d[_0x4124(0x35)]);if(_0x1e1d08&&_0x51a42d[_0x4124(0x2d)](_0x1e1d08['length'],0x2)&&_0x51a42d[_0x4124(0x36)](_0x1e1d08,_0x51a42d['JoKGK'])){if(_0x51a42d['fGbNh'](_0x51a42d[_0x4124(0x37)],_0x51a42d[_0x4124(0x38)]))_0x228264[_0x4124(0x24)](_0x4124(0x15),_0xedde62);else return console[_0x4124(0x19)](_0x4124(0x28),_0x1e1d08),_0x1e1d08;}else _0x1e1d08&&console[_0x4124(0x24)](_0x4124(0x39),_0x1e1d08);const _0x1fe094=await _asyncStorage['default'][_0x4124(0x34)]('user_email');if(_0x1fe094&&_0x1fe094[_0x4124(0x3a)]('@')&&_0x51a42d[_0x4124(0x2d)](_0x1fe094['length'],0x5)){if(_0x51a42d[_0x4124(0x3b)]===_0x51a42d[_0x4124(0x3c)]){const _0x4012d9=_0x2c85ef[_0x4124(0x3d)][_0x4124(0x3e)](_0x4fcd0);return _0x1d1238[_0x4124(0x19)](_0x51a42d[_0x4124(0x3f)],_0x4012d9[_0x4124(0x2e)]),_0x4012d9;}else return console[_0x4124(0x19)](_0x51a42d[_0x4124(0x40)],_0x1fe094),_0x1fe094;}else _0x1fe094&&(_0x51a42d[_0x4124(0x41)](_0x51a42d[_0x4124(0x42)],_0x51a42d[_0x4124(0x42)])?console[_0x4124(0x24)](_0x51a42d[_0x4124(0x43)],_0x1fe094):_0x2f8caa[_0x4124(0x24)](_0x51a42d[_0x4124(0x44)],_0x23821b));try{if(_0x51a42d[_0x4124(0x45)](_0x51a42d[_0x4124(0x46)],_0x51a42d[_0x4124(0x47)]))_0x20a643[_0x4124(0x24)](_0x51a42d['UXTbD'],_0x4ba51f);else{const _0x372697=await(0x0,_authService['getAuthToken'])();_0x372697&&_0x372697[_0x4124(0x48)]('.')[_0x4124(0x2e)]===0x3&&console['log'](_0x4124(0x49));}}catch(_0x3d53ba){if(_0x51a42d[_0x4124(0x4a)]!==_0x4124(0x4b))console[_0x4124(0x24)](_0x4124(0x6),_0x3d53ba);else return _0x1c69f0['log'](_0x51a42d['cGIxV'],_0x49735f),_0x4090ed;}return console[_0x4124(0x4c)](_0x51a42d[_0x4124(0x4d)]),null;}catch(_0x32fc43){return console['error'](_0x4124(0x4e),_0x32fc43),null;}},samImage=_assetRegistry[_0x4124(0x4f)][_0x4124(0x50)],anandImage=_assetRegistry[_0x4124(0x4f)][_0x4124(0x51)],chrisImage=_assetRegistry['PERSONA_IMAGES'][_0x4124(0x52)],katieImage=_assetRegistry[_0x4124(0x4f)]['level4'],yanniImage=_assetRegistry[_0x4124(0x4f)][_0x4124(0x53)],API_BASE_URL=_api[_0x4124(0x54)][_0x4124(0x55)],transformAPIConnection=_0x373629=>{const _0xc8afa2={'eitbz':function(_0x531856,_0x30b668){return _0x531856===_0x30b668;},'JZccA':function(_0x3224ac,_0x3051f0){return _0x3224ac*_0x3051f0;},'khlWb':_0x4124(0x56),'SDjkM':_0x4124(0x57),'htAsp':_0x4124(0x58)};var _0x29b1d4,_0x51a8eb;return console[_0x4124(0x19)](_0x4124(0x59),{'id':_0x373629['id'],'name':_0x373629[_0x4124(0x5a)],'description':_0x373629[_0x4124(0x5b)],'hasPhoto':!!_0x373629['photo'],'photoLength':_0xc8afa2[_0x4124(0x5c)](_0x29b1d4=_0x373629[_0x4124(0x5d)],null)||_0x29b1d4===void 0x0?void 0x0:_0x29b1d4[_0x4124(0x2e)],'interests':_0x373629[_0x4124(0x5e)],'sharedPassions':_0x373629[_0x4124(0x5f)],'complementaryQualities':_0x373629[_0x4124(0x60)],'compatibility':_0x373629[_0x4124(0x61)]}),{'id':parseInt(_0x373629['id'])||parseInt(_0x373629[_0x4124(0x62)]||'')||_0xc8afa2[_0x4124(0x63)](Math[_0x4124(0x64)](),0x3e8),'name':_0x373629['name']||_0xc8afa2[_0x4124(0x65)],'description':_0x373629[_0x4124(0x5b)]||_0xc8afa2[_0x4124(0x66)],'photo':_0x373629[_0x4124(0x5d)]||'','bio':_0x373629['bio']||'','interests':_0x373629['interests']||[],'mutualConnections':_0x373629[_0x4124(0x67)]||0x0,'compatibility':_0x373629['compatibility']||0x0,'conversationStarters':_0x373629['conversationStarters']||[_0xc8afa2['htAsp']],'sharedPassions':_0x373629[_0x4124(0x5f)]||[],'complementaryQualities':_0x373629[_0x4124(0x60)]||[],'meaningfulCoincidences':_0x373629['meaningfulCoincidences']||[],'mutualConnectionsList':(_0xc8afa2[_0x4124(0x5c)](_0x51a8eb=_0x373629[_0x4124(0x68)],null)||_0x51a8eb===void 0x0?void 0x0:_0x51a8eb[_0x4124(0x3e)](_0x167563=>({'name':_0x167563['name'],'photo':_0x167563[_0x4124(0x5d)],'context':_0x167563['context']})))||[]};},getUserConnectionsByUsername=async _0x34e0f8=>{const _0x443677={'QXQCv':'â ī¸\x20[USER\x20ID]\x20getUserProfile\x20failed:','zPnGx':_0x4124(0x69),'PTDVj':function(_0x46cb88,_0x16f8c0){return _0x46cb88!==_0x16f8c0;},'pDMnU':'kgIEm','IniQj':'â ī¸\x20[CONNECTIONS\x20API]\x20This\x20may\x20result\x20in\x20limited\x20or\x20cached\x20data\x20from\x20backend','qQSDa':'â
\x20[CONNECTIONS\x20API]\x20Using\x20authenticated\x20request\x20with\x20token:','fSUfI':_0x4124(0x6a),'DQnRk':function(_0x2c9f93,_0x357fe9){return _0x2c9f93===_0x357fe9;},'Dioml':function(_0x897452,_0x4ce27b){return _0x897452!==_0x4ce27b;},'ISLTY':function(_0x5af4f1,_0x20065c){return _0x5af4f1>_0x20065c;},'MnNyh':_0x4124(0x5),'rrvcV':function(_0x4d362a,_0x3d4a1c){return _0x4d362a===_0x3d4a1c;},'EQKfu':'DTlpj','czjQd':_0x4124(0x6b),'qzhdV':'â\x20[NETWORK\x20ERROR]\x20Full\x20error\x20details:'};try{if(_0x443677['PTDVj'](_0x4124(0x6c),_0x443677[_0x4124(0x6d)]))_0x318630['warn'](_0x443677[_0x4124(0x6e)],_0x32688b);else{var _0x3550d9,_0x47a7a2;console[_0x4124(0x19)]('đ\x20Fetching\x20connections\x20for\x20username:',_0x34e0f8);const _0x1a3de8=await(0x0,_authService[_0x4124(0x6f)])();if(!_0x1a3de8)return console[_0x4124(0x24)]('â ī¸\x20[CONNECTIONS\x20API]\x20No\x20authentication\x20token\x20available\x20for\x20connections\x20request'),console[_0x4124(0x24)](_0x443677['IniQj']),[];console['log'](_0x443677[_0x4124(0x70)],_0x1a3de8[_0x4124(0x71)](0x0,0x14)+_0x4124(0x72));const _0x5465ca={'success':![],'message':_0x443677[_0x4124(0x73)],'connections':[],'source':_0x4124(0x74)};console[_0x4124(0x19)]('â
\x20API\x20connections\x20fetched\x20by\x20username:',{'success':_0x5465ca['success'],'connectionsCount':(_0x443677[_0x4124(0x75)](_0x3550d9=_0x5465ca[_0x4124(0x3d)],null)||_0x3550d9===void 0x0?void 0x0:_0x3550d9[_0x4124(0x2e)])||0x0,'source':_0x5465ca[_0x4124(0x76)],'firstConnection':_0x443677[_0x4124(0x77)](_0x47a7a2=_0x5465ca['connections'],null)&&_0x443677[_0x4124(0x78)](_0x47a7a2,void 0x0)&&_0x47a7a2[0x0]?{'id':_0x5465ca[_0x4124(0x3d)][0x0]['id'],'name':_0x5465ca[_0x4124(0x3d)][0x0][_0x4124(0x5a)],'description':_0x5465ca[_0x4124(0x3d)][0x0][_0x4124(0x5b)]}:null});if(_0x5465ca[_0x4124(0x79)]&&_0x5465ca['connections']&&_0x443677[_0x4124(0x7a)](_0x5465ca[_0x4124(0x3d)]['length'],0x0)){const _0x1aad92=_0x5465ca['connections'][_0x4124(0x3e)](transformAPIConnection);return console[_0x4124(0x19)](_0x443677[_0x4124(0x7b)],_0x1aad92['length']),_0x1aad92;}return[];}}catch(_0x7c28a2){if(_0x443677[_0x4124(0x7c)](_0x443677['EQKfu'],_0x4124(0x7d)))return console[_0x4124(0x19)](_0x443677[_0x4124(0x7e)],_0x7c28a2),console[_0x4124(0x19)](_0x443677[_0x4124(0x7f)],JSON[_0x4124(0x80)](_0x7c28a2,Object['getOwnPropertyNames'](_0x7c28a2))),[];else{const _0x21af98=_0xbfcca8[_0x4124(0x3d)][_0x4124(0x3e)](_0x1c9ec4);return _0x18c802[_0x4124(0x19)](_0x443677[_0x4124(0x81)],_0x21af98['length']),_0x21af98;}}};exports[_0x4124(0x3)]=getUserConnectionsByUsername;const getUserConnectionsByUserId=async _0x3e2c9c=>{const _0x286cd1={'krbCj':_0x4124(0x82),'YIGoy':'uploadProfilePicture\x20has\x20been\x20removed\x20from\x20SDK.\x20Consuming\x20apps\x20should\x20call\x20the\x20Enoch\x20API\x20directly.','yscuu':_0x4124(0x39),'nESon':'đ\x20Fetching\x20connections\x20for\x20userId:','hkaaf':function(_0x47ee33,_0x2d9a5a){return _0x47ee33!==_0x2d9a5a;},'aOaoG':'â ī¸\x20[CONNECTIONS\x20API]\x20No\x20authentication\x20token\x20available\x20for\x20user\x20ID\x20connections\x20request','dCRly':_0x4124(0x83),'kxkuY':_0x4124(0x6a),'tiYWf':_0x4124(0x74),'DLnIe':_0x4124(0x84),'RaHmB':function(_0x2fd215,_0x4000f9){return _0x2fd215===_0x4000f9;},'ShDIA':function(_0x29f366,_0xe9e764){return _0x29f366>_0xe9e764;},'RZrKC':_0x4124(0x69),'ffaXz':_0x4124(0x85),'hUash':_0x4124(0x86)};try{var _0x5c09f1,_0x421434;console[_0x4124(0x19)](_0x286cd1[_0x4124(0x87)],_0x3e2c9c);const _0x215692=await(0x0,_authService[_0x4124(0x6f)])();if(!_0x215692)return _0x286cd1[_0x4124(0x88)](_0x4124(0x89),'XCgeq')?(_0x37965d[_0x4124(0x24)](_0x4124(0x8a)),_0x165357[_0x4124(0x24)](_0x286cd1[_0x4124(0x8b)]),{'success':![],'error':_0x286cd1[_0x4124(0x8c)]}):(console[_0x4124(0x24)](_0x286cd1[_0x4124(0x8d)]),[]);console[_0x4124(0x19)](_0x286cd1[_0x4124(0x8e)],_0x215692[_0x4124(0x71)](0x0,0x14)+_0x4124(0x72));const _0x4ea92b={'success':![],'message':_0x286cd1[_0x4124(0x8f)],'connections':[],'source':_0x286cd1[_0x4124(0x90)]};console[_0x4124(0x19)](_0x286cd1[_0x4124(0x91)],{'success':_0x4ea92b['success'],'connectionsCount':(_0x286cd1[_0x4124(0x92)](_0x5c09f1=_0x4ea92b['connections'],null)||_0x286cd1['RaHmB'](_0x5c09f1,void 0x0)?void 0x0:_0x5c09f1[_0x4124(0x2e)])||0x0,'source':_0x4ea92b[_0x4124(0x76)],'firstConnection':_0x286cd1['hkaaf'](_0x421434=_0x4ea92b[_0x4124(0x3d)],null)&&_0x286cd1[_0x4124(0x88)](_0x421434,void 0x0)&&_0x421434[0x0]?{'id':_0x4ea92b[_0x4124(0x3d)][0x0]['id'],'name':_0x4ea92b[_0x4124(0x3d)][0x0][_0x4124(0x5a)],'description':_0x4ea92b[_0x4124(0x3d)][0x0][_0x4124(0x5b)]}:null});if(_0x4ea92b[_0x4124(0x79)]&&_0x4ea92b[_0x4124(0x3d)]&&_0x286cd1[_0x4124(0x93)](_0x4ea92b['connections']['length'],0x0)){const _0x2230e5=_0x4ea92b[_0x4124(0x3d)][_0x4124(0x3e)](transformAPIConnection);return console[_0x4124(0x19)](_0x286cd1[_0x4124(0x94)],_0x2230e5[_0x4124(0x2e)]),_0x2230e5;}return[];}catch(_0xcb8dac){if(_0x286cd1[_0x4124(0x95)]!==_0x286cd1[_0x4124(0x95)])_0x3f5116[_0x4124(0x24)](_0x286cd1['yscuu'],_0x2a67ca);else return console[_0x4124(0x19)](_0x4124(0x96),_0xcb8dac),console[_0x4124(0x19)](_0x286cd1[_0x4124(0x97)],JSON['stringify'](_0xcb8dac,Object[_0x4124(0x98)](_0xcb8dac))),[];}};function _0x59a4(){const _0x54540c=['defineProperty','__esModule','uploadProfilePicture','getUserConnectionsByUsername','getUserConnections','đ\x20Transformed\x20connections\x20by\x20username:','â ī¸\x20[USER\x20ID]\x20JWT\x20token\x20access\x20failed:','â ī¸\x20[USER\x20ID]\x20Invalid\x20stored\x20user\x20ID\x20found:','đ\x20[USER\x20ID]\x20Attempting\x20to\x20get\x20user\x20identifier\x20with\x20multiple\x20methods...','fallback_user','bGDeZ','â ī¸\x20[USER\x20ID]\x20getUserProfile\x20failed:','user_id','marker','â
\x20[USER\x20ID]\x20Got\x20user\x20ID\x20from\x20AsyncStorage:','ETUCi','onairos_username','dWmKl','zupyv','SNKuN','HWyvU','â ī¸\x20[USER\x20ID]\x20Invalid\x20stored\x20email\x20found:','QXLGz','KoAQB','â\x20[USER\x20ID]\x20No\x20valid\x20user\x20identifier\x20found','log','kmvkL','getUserProfile','KXhex','yyHPB','DRQll','â
\x20[USER\x20ID]\x20Got\x20user\x20ID\x20from\x20getUserProfile:','ARlaD','WZOmo','UBude','jAGGe','warn','â ī¸\x20[USER\x20ID]\x20getUserProfile\x20returned\x20invalid/fallback\x20ID:','fGbNh','RnyYz','â
\x20[USER\x20ID]\x20Got\x20username\x20from\x20AsyncStorage\x20(backend\x20supports\x20usernames):','dyooO','hGrQf','JoKGK','qpRlO','hGsUw','length','crEdV','QUxzT','iJotV','VnKzf','UXTbD','getItem','NgEnT','vbMnc','oozNI','gKkdS','â ī¸\x20[USER\x20ID]\x20Invalid\x20stored\x20username\x20found:','includes','xToPQ','DcdYi','connections','map','DBTZq','cGIxV','WXRYc','iMMrd','hNwYR','eazIO','XBVJb','WHGHM','nCaaJ','split','đ\x20[USER\x20ID]\x20JWT\x20token\x20found\x20but\x20no\x20local\x20user\x20identifier\x20-\x20backend\x20should\x20handle\x20via\x20token','xDPYk','KQDwP','error','AwPMW','â\x20[USER\x20ID]\x20Error\x20getting\x20user\x20identifier:','PERSONA_IMAGES','level1','level2','level3','level5','API_CONFIG','BASE_URL','Unknown\x20User','Looking\x20to\x20connect','Hi!\x20Nice\x20to\x20meet\x20you.','đ\x20Transforming\x20API\x20connection:','name','description','eitbz','photo','interests','sharedPassions','complementaryQualities','compatibility','_id','JZccA','random','khlWb','SDjkM','mutualConnections','mutualConnectionsList','đ\x20Transformed\x20connections\x20by\x20userId:','API\x20function\x20not\x20available','â\x20Error\x20fetching\x20connections\x20by\x20username:','kgIEm','pDMnU','QXQCv','getAuthToken','qQSDa','substring','...','fSUfI','mock','DQnRk','source','PTDVj','Dioml','success','ISLTY','MnNyh','rrvcV','DTlpj','czjQd','qzhdV','stringify','zPnGx','âšī¸\x20Consuming\x20apps\x20should\x20call\x20/enoch/users/{id}/profile-picture/base64\x20directly','â
\x20[CONNECTIONS\x20API]\x20Using\x20authenticated\x20request\x20with\x20token:','â
\x20API\x20connections\x20fetched\x20by\x20userId:','tKJjx','â\x20[NETWORK\x20ERROR\x20FALLBACK]\x20Full\x20error\x20details:','nESon','hkaaf','XCgeq','â ī¸\x20[DEPRECATED]\x20uploadProfilePicture\x20has\x20been\x20removed\x20from\x20SDK','krbCj','YIGoy','aOaoG','dCRly','kxkuY','tiYWf','DLnIe','RaHmB','ShDIA','RZrKC','ffaXz','â\x20Error\x20fetching\x20connections\x20by\x20userId:','hUash','getOwnPropertyNames','USER_CONNECTIONS','đ\x20[USER\x20DEBUG]\x20Checking\x20all\x20available\x20user\x20data\x20sources...','đ\x20[USER\x20DEBUG]\x20AsyncStorage\x20data:','none','đ¯\x20getUserConnections\x20-\x20User\x20profile:','vZqBG','đ\x20[USER\x20DEBUG]\x20Using\x20stored\x20username\x20as\x20email\x20fallback:','OJrqQ','đ\x20[USER\x20DEBUG]\x20Using\x20stored\x20user\x20ID\x20as\x20fallback:','đ¯\x20[USER\x20DEBUG]\x20Final\x20user\x20identifiers\x20to\x20use:','â
\x20Successfully\x20got\x20connections\x20by\x20email:','â ī¸\x20No\x20connections\x20found\x20by\x20email,\x20trying\x20user\x20ID...','đ¯\x20FALLBACK:\x20Attempting\x20to\x20fetch\x20connections\x20by\x20user\x20ID:','edFHZ','â ī¸\x20No\x20connections\x20found\x20by\x20user\x20ID','GTYKW','OUJmB','â
\x20Successfully\x20got\x20connections\x20by\x20user\x20ID:','ensureAuthentication','jBdph','default','user_email','lYBmr','gZppH','UgCMB','email','ghhng','tHCly','eCVcS','MlpjT','yXpgW','YqALE','hEPHB','aPcgN','Ibuij','vfAxk','ChQbD','EEYrE','fcZuV','bgxEd','UjISe','đ\x20[USER\x20DEBUG]\x20Using\x20stored\x20email\x20as\x20fallback:','szEPR','hZhaD','VDpyx','â\x20Error\x20in\x20getUserConnections:','nqUMh','UqLcw','RcCCi'];_0x59a4=function(){return _0x54540c;};return _0x59a4();}exports['getUserConnectionsByUserId']=getUserConnectionsByUserId;const getUserConnections=async()=>{const _0x234e9b={'SgCCI':_0x4124(0x49),'GTYKW':function(_0x356fc2,_0x55a927){return _0x356fc2!==_0x55a927;},'OUJmB':'eAPrc','jKFLY':_0x4124(0x99),'jBdph':_0x4124(0x9a),'QEmCH':_0x4124(0x10),'oWIhJ':_0x4124(0xc),'DgPUC':'auth_token','lYBmr':_0x4124(0x9b),'gZppH':_0x4124(0x9c),'bgUHi':_0x4124(0x9d),'UgCMB':function(_0x47e732,_0x295a98){return _0x47e732!==_0x295a98;},'ProTh':function(_0x4ed5b8,_0x1860aa){return _0x4ed5b8!==_0x1860aa;},'eoeDs':function(_0x135f83,_0x2fce1f){return _0x135f83!==_0x2fce1f;},'ghhng':function(_0x25169a,_0x2f7132){return _0x25169a===_0x2f7132;},'tHCly':function(_0x3287a8,_0x460ab7){return _0x3287a8===_0x460ab7;},'eCVcS':function(_0xadc9f1,_0x468fce){return _0xadc9f1===_0x468fce;},'YeGMe':function(_0x4e7c36,_0x3db957){return _0x4e7c36===_0x3db957;},'MlpjT':function(_0x15b1af,_0x378565){return _0x15b1af&&_0x378565;},'yXpgW':_0x4124(0x9e),'YqALE':_0x4124(0x9f),'hEPHB':function(_0x45889d,_0x8ed6b6){return _0x45889d===_0x8ed6b6;},'VumeE':_0x4124(0xa0),'aPcgN':'đ\x20[USER\x20DEBUG]\x20Using\x20stored\x20email\x20as\x20fallback:','Vufwa':_0x4124(0xa1),'Ibuij':_0x4124(0xa2),'vfAxk':function(_0xdad5f,_0x422d07){return _0xdad5f(_0x422d07);},'ChQbD':function(_0x39a415,_0xcc739c){return _0x39a415>_0xcc739c;},'EEYrE':_0x4124(0xa3),'fcZuV':_0x4124(0xa4),'bgxEd':_0x4124(0xa5),'UYdvN':function(_0x27b768,_0x4e64eb){return _0x27b768!==_0x4e64eb;},'UjISe':_0x4124(0xa6),'szEPR':'â
\x20Successfully\x20got\x20connections\x20by\x20user\x20ID:','hZhaD':_0x4124(0xa7),'VDpyx':'â ī¸\x20No\x20user\x20identifier\x20available\x20or\x20no\x20connections\x20found'};try{if(_0x234e9b[_0x4124(0xa8)](_0x234e9b[_0x4124(0xa9)],_0x234e9b['OUJmB']))return _0x9197d1['log'](_0x4124(0xaa),_0x2e9505[_0x4124(0x2e)]),_0x5214e1;else{await(0x0,_authService[_0x4124(0xab)])(_0x234e9b['jKFLY']),console['log'](_0x234e9b[_0x4124(0xac)]);const _0x131ef3=await _asyncStorage['default'][_0x4124(0x34)](_0x234e9b['QEmCH']),_0xf719e1=await _asyncStorage[_0x4124(0xad)][_0x4124(0x34)](_0x4124(0xae)),_0x239969=await _asyncStorage[_0x4124(0xad)][_0x4124(0x34)](_0x234e9b['oWIhJ']),_0x202e97=await _asyncStorage[_0x4124(0xad)][_0x4124(0x34)](_0x234e9b['DgPUC']);console[_0x4124(0x19)](_0x234e9b[_0x4124(0xaf)],{'storedUsername':_0x131ef3,'storedEmail':_0xf719e1,'storedUserId':_0x239969,'hasAuthToken':!!_0x202e97,'authTokenPreview':_0x202e97?_0x202e97['substring'](0x0,0x14)+_0x4124(0x72):_0x234e9b[_0x4124(0xb0)]});const _0x54c12b=await(0x0,_authService['getUserProfile'])();console['log'](_0x234e9b['bgUHi'],{'hasId':!!(_0x234e9b[_0x4124(0xb1)](_0x54c12b,null)&&_0x234e9b['ProTh'](_0x54c12b,void 0x0)&&_0x54c12b['id']),'hasEmail':!!(_0x234e9b['UgCMB'](_0x54c12b,null)&&_0x234e9b['eoeDs'](_0x54c12b,void 0x0)&&_0x54c12b[_0x4124(0xb2)]),'email':_0x234e9b[_0x4124(0xb3)](_0x54c12b,null)||_0x234e9b[_0x4124(0xb4)](_0x54c12b,void 0x0)?void 0x0:_0x54c12b[_0x4124(0xb2)],'id':_0x234e9b[_0x4124(0xb3)](_0x54c12b,null)||_0x54c12b===void 0x0?void 0x0:_0x54c12b['id']});let _0x1e03c8=_0x234e9b[_0x4124(0xb5)](_0x54c12b,null)||_0x234e9b['YeGMe'](_0x54c12b,void 0x0)?void 0x0:_0x54c12b[_0x4124(0xb2)],_0x5749f5=_0x234e9b['YeGMe'](_0x54c12b,null)||_0x234e9b[_0x4124(0xb4)](_0x54c12b,void 0x0)?void 0x0:_0x54c12b['id'];_0x234e9b[_0x4124(0xb6)](!_0x1e03c8,_0x131ef3)&&(_0x234e9b[_0x4124(0xb7)]!==_0x234e9b[_0x4124(0xb7)]?(_0x1849c0[_0x4124(0x19)](_0x4124(0xa1),_0x41632d),_0x7c091=_0x52944e):(console['log'](_0x234e9b[_0x4124(0xb8)],_0x131ef3),_0x1e03c8=_0x131ef3));!_0x1e03c8&&_0xf719e1&&(_0x234e9b[_0x4124(0xb9)](_0x4124(0xa0),_0x234e9b['VumeE'])?(console[_0x4124(0x19)](_0x234e9b[_0x4124(0xba)],_0xf719e1),_0x1e03c8=_0xf719e1):_0x997ba1['log'](_0x234e9b['SgCCI']));_0x234e9b[_0x4124(0xb6)](!_0x5749f5,_0x239969)&&(console['log'](_0x234e9b['Vufwa'],_0x239969),_0x5749f5=_0x239969);console['log'](_0x234e9b[_0x4124(0xbb)],{'userEmail':_0x1e03c8,'userId':_0x5749f5,'willTryEmail':!!_0x1e03c8,'willTryUserId':!!_0x5749f5});if(_0x1e03c8){console[_0x4124(0x19)]('đ¯\x20PRIORITY:\x20Attempting\x20to\x20fetch\x20connections\x20by\x20email\x20(working\x20endpoint):',_0x1e03c8);const _0x29a2cb=await _0x234e9b[_0x4124(0xbc)](getUserConnectionsByUsername,_0x1e03c8);if(_0x234e9b[_0x4124(0xbd)](_0x29a2cb['length'],0x0))return console[_0x4124(0x19)](_0x234e9b[_0x4124(0xbe)],_0x29a2cb[_0x4124(0x2e)]),_0x29a2cb;console[_0x4124(0x19)](_0x234e9b[_0x4124(0xbf)]);}if(_0x5749f5){console[_0x4124(0x19)](_0x234e9b[_0x4124(0xc0)],_0x5749f5);const _0x243b3e=await _0x234e9b[_0x4124(0xbc)](getUserConnectionsByUserId,_0x5749f5);if(_0x234e9b[_0x4124(0xbd)](_0x243b3e[_0x4124(0x2e)],0x0)){if(_0x234e9b['UYdvN'](_0x234e9b[_0x4124(0xc1)],_0x4124(0xa6)))_0xdc373d[_0x4124(0x19)](_0x4124(0xc2),_0x5a391e),_0x1c5aca=_0x25574d;else return console[_0x4124(0x19)](_0x234e9b[_0x4124(0xc3)],_0x243b3e[_0x4124(0x2e)]),_0x243b3e;}console[_0x4124(0x19)](_0x234e9b[_0x4124(0xc4)]);}return console[_0x4124(0x19)](_0x234e9b[_0x4124(0xc5)]),[];}}catch(_0x517ee6){return console[_0x4124(0x19)](_0x4124(0xc6),_0x517ee6),[];}};exports[_0x4124(0x4)]=getUserConnections;const uploadProfilePicture=async(_0x5be1fa,_0xe60ebd)=>{const _0x3f5711={'nqUMh':_0x4124(0x8a),'UqLcw':_0x4124(0x82),'RcCCi':'uploadProfilePicture\x20has\x20been\x20removed\x20from\x20SDK.\x20Consuming\x20apps\x20should\x20call\x20the\x20Enoch\x20API\x20directly.'};return console[_0x4124(0x24)](_0x3f5711[_0x4124(0xc7)]),console['warn'](_0x3f5711[_0x4124(0xc8)]),{'success':![],'error':_0x3f5711[_0x4124(0xc9)]};};exports[_0x4124(0x2)]=uploadProfilePicture;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.uploadProfilePicture = exports.getUserConnectionsByUsername = exports.getUserConnectionsByUserId = exports.getUserConnections = void 0;
|
|
7
|
+
var _authService = require("./authService");
|
|
8
|
+
var _asyncStorage = _interopRequireDefault(require("@react-native-async-storage/async-storage"));
|
|
9
|
+
var _api = require("../config/api");
|
|
10
|
+
var _assetRegistry = require("../utils/assetRegistry");
|
|
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>
|
|
16
|
+
*/
|
|
17
|
+
const getUserIdWithFallbacks = async () => {
|
|
18
|
+
try {
|
|
19
|
+
console.log('đ [USER ID] Attempting to get user identifier with multiple methods...');
|
|
20
|
+
|
|
21
|
+
// Method 1: Try getUserProfile first
|
|
22
|
+
try {
|
|
23
|
+
const userProfile = await (0, _authService.getUserProfile)();
|
|
24
|
+
if (userProfile !== null && userProfile !== void 0 && userProfile.id && userProfile.id !== 'fallback_user') {
|
|
25
|
+
console.log('â
[USER ID] Got user ID from getUserProfile:', userProfile.id);
|
|
26
|
+
return userProfile.id;
|
|
27
|
+
} else {
|
|
28
|
+
console.warn('â ī¸ [USER ID] getUserProfile returned invalid/fallback ID:', userProfile === null || userProfile === void 0 ? void 0 : userProfile.id);
|
|
29
|
+
}
|
|
30
|
+
} catch (error) {
|
|
31
|
+
console.warn('â ī¸ [USER ID] getUserProfile failed:', error);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Method 2: Check AsyncStorage for stored user ID (but validate it)
|
|
35
|
+
const storedUserId = await _asyncStorage.default.getItem('user_id');
|
|
36
|
+
if (storedUserId && storedUserId !== 'marker' && storedUserId !== 'fallback_user' && storedUserId.length > 10) {
|
|
37
|
+
console.log('â
[USER ID] Got user ID from AsyncStorage:', storedUserId);
|
|
38
|
+
return storedUserId;
|
|
39
|
+
} else if (storedUserId) {
|
|
40
|
+
console.warn('â ī¸ [USER ID] Invalid stored user ID found:', storedUserId);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Method 3: Try stored username (backend now supports usernames!)
|
|
44
|
+
const storedUsername = await _asyncStorage.default.getItem('onairos_username');
|
|
45
|
+
if (storedUsername && storedUsername.length > 2 && storedUsername !== 'marker') {
|
|
46
|
+
console.log('â
[USER ID] Got username from AsyncStorage (backend supports usernames):', storedUsername);
|
|
47
|
+
return storedUsername;
|
|
48
|
+
} else if (storedUsername) {
|
|
49
|
+
console.warn('â ī¸ [USER ID] Invalid stored username found:', storedUsername);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Method 4: Try stored email as username fallback
|
|
53
|
+
const storedEmail = await _asyncStorage.default.getItem('user_email');
|
|
54
|
+
if (storedEmail && storedEmail.includes('@') && storedEmail.length > 5) {
|
|
55
|
+
console.log('â
[USER ID] Got email from AsyncStorage (backend supports usernames):', storedEmail);
|
|
56
|
+
return storedEmail;
|
|
57
|
+
} else if (storedEmail) {
|
|
58
|
+
console.warn('â ī¸ [USER ID] Invalid stored email found:', storedEmail);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Method 5: Check JWT token for user info (but don't decode, just log)
|
|
62
|
+
try {
|
|
63
|
+
const token = await (0, _authService.getAuthToken)();
|
|
64
|
+
if (token && token.split('.').length === 3) {
|
|
65
|
+
console.log('đ [USER ID] JWT token found but no local user identifier - backend should handle via token');
|
|
66
|
+
// Don't try to decode JWT here - let the backend handle it
|
|
67
|
+
}
|
|
68
|
+
} catch (error) {
|
|
69
|
+
console.warn('â ī¸ [USER ID] JWT token access failed:', error);
|
|
70
|
+
}
|
|
71
|
+
console.error('â [USER ID] No valid user identifier found');
|
|
72
|
+
return null;
|
|
73
|
+
} catch (error) {
|
|
74
|
+
console.error('â [USER ID] Error getting user identifier:', error);
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
// Import images for fallback connections from centralized registry
|
|
80
|
+
|
|
81
|
+
const samImage = _assetRegistry.PERSONA_IMAGES.level1;
|
|
82
|
+
const anandImage = _assetRegistry.PERSONA_IMAGES.level2;
|
|
83
|
+
const chrisImage = _assetRegistry.PERSONA_IMAGES.level3;
|
|
84
|
+
const katieImage = _assetRegistry.PERSONA_IMAGES.level4;
|
|
85
|
+
const yanniImage = _assetRegistry.PERSONA_IMAGES.level5;
|
|
86
|
+
const API_BASE_URL = _api.API_CONFIG.BASE_URL;
|
|
87
|
+
|
|
88
|
+
// Interface for API connection response - updated to match actual backend format
|
|
89
|
+
|
|
90
|
+
// Interface for API response
|
|
91
|
+
|
|
92
|
+
// Interface for the transformed connection used by UI
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Transform API connection to UI connection format
|
|
96
|
+
*/
|
|
97
|
+
const transformAPIConnection = apiConnection => {
|
|
98
|
+
var _apiConnection$photo, _apiConnection$mutual;
|
|
99
|
+
console.log('đ Transforming API connection:', {
|
|
100
|
+
id: apiConnection.id,
|
|
101
|
+
name: apiConnection.name,
|
|
102
|
+
description: apiConnection.description,
|
|
103
|
+
hasPhoto: !!apiConnection.photo,
|
|
104
|
+
photoLength: (_apiConnection$photo = apiConnection.photo) === null || _apiConnection$photo === void 0 ? void 0 : _apiConnection$photo.length,
|
|
105
|
+
interests: apiConnection.interests,
|
|
106
|
+
sharedPassions: apiConnection.sharedPassions,
|
|
107
|
+
complementaryQualities: apiConnection.complementaryQualities,
|
|
108
|
+
compatibility: apiConnection.compatibility
|
|
109
|
+
});
|
|
110
|
+
return {
|
|
111
|
+
id: parseInt(apiConnection.id) || parseInt(apiConnection._id || '') || Math.random() * 1000,
|
|
112
|
+
// Try id first, then _id, then random
|
|
113
|
+
name: apiConnection.name || 'Unknown User',
|
|
114
|
+
description: apiConnection.description || 'Looking to connect',
|
|
115
|
+
photo: apiConnection.photo || '',
|
|
116
|
+
// This will be a URL string from API, or empty string
|
|
117
|
+
bio: apiConnection.bio || '',
|
|
118
|
+
interests: apiConnection.interests || [],
|
|
119
|
+
mutualConnections: apiConnection.mutualConnections || 0,
|
|
120
|
+
compatibility: apiConnection.compatibility || 0,
|
|
121
|
+
conversationStarters: apiConnection.conversationStarters || ['Hi! Nice to meet you.'],
|
|
122
|
+
// UI REQUIRED FIELDS - These are actually rendered in ProfileDetailScreen
|
|
123
|
+
sharedPassions: apiConnection.sharedPassions || [],
|
|
124
|
+
// Don't fallback to interests since we now have separate Interests section
|
|
125
|
+
complementaryQualities: apiConnection.complementaryQualities || [],
|
|
126
|
+
meaningfulCoincidences: apiConnection.meaningfulCoincidences || [],
|
|
127
|
+
mutualConnectionsList: ((_apiConnection$mutual = apiConnection.mutualConnectionsList) === null || _apiConnection$mutual === void 0 ? void 0 : _apiConnection$mutual.map(mutual => ({
|
|
128
|
+
name: mutual.name,
|
|
129
|
+
photo: mutual.photo,
|
|
130
|
+
// URL string from API
|
|
131
|
+
context: mutual.context
|
|
132
|
+
}))) || []
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Get user connections by username
|
|
138
|
+
* @param username - Username to fetch connections for
|
|
139
|
+
* @returns Promise<Connection[]>
|
|
140
|
+
*/
|
|
141
|
+
const getUserConnectionsByUsername = async username => {
|
|
142
|
+
try {
|
|
143
|
+
var _response$connections, _response$connections2;
|
|
144
|
+
console.log('đ Fetching connections for username:', username);
|
|
145
|
+
const token = await (0, _authService.getAuthToken)();
|
|
146
|
+
|
|
147
|
+
// Enhanced token validation and warning
|
|
148
|
+
if (!token) {
|
|
149
|
+
console.warn('â ī¸ [CONNECTIONS API] No authentication token available for connections request');
|
|
150
|
+
console.warn('â ī¸ [CONNECTIONS API] This may result in limited or cached data from backend');
|
|
151
|
+
return []; // Return empty array instead of making unauthenticated request
|
|
152
|
+
}
|
|
153
|
+
console.log('â
[CONNECTIONS API] Using authenticated request with token:', `${token.substring(0, 20)}...`);
|
|
154
|
+
|
|
155
|
+
// Use the same pattern as other working APIs - import and call with token
|
|
156
|
+
// const { getUserConnectionsByUsername: apiCall } = await import('../../services/api'); // Commented out - path issue
|
|
157
|
+
const response = {
|
|
158
|
+
success: false,
|
|
159
|
+
message: 'API function not available',
|
|
160
|
+
connections: [],
|
|
161
|
+
source: 'mock'
|
|
162
|
+
};
|
|
163
|
+
console.log('â
API connections fetched by username:', {
|
|
164
|
+
success: response.success,
|
|
165
|
+
connectionsCount: ((_response$connections = response.connections) === null || _response$connections === void 0 ? void 0 : _response$connections.length) || 0,
|
|
166
|
+
source: response.source,
|
|
167
|
+
firstConnection: (_response$connections2 = response.connections) !== null && _response$connections2 !== void 0 && _response$connections2[0] ? {
|
|
168
|
+
id: response.connections[0].id,
|
|
169
|
+
name: response.connections[0].name,
|
|
170
|
+
description: response.connections[0].description
|
|
171
|
+
} : null
|
|
172
|
+
});
|
|
173
|
+
if (response.success && response.connections && response.connections.length > 0) {
|
|
174
|
+
const transformedConnections = response.connections.map(transformAPIConnection);
|
|
175
|
+
console.log('đ Transformed connections by username:', transformedConnections.length);
|
|
176
|
+
return transformedConnections;
|
|
177
|
+
}
|
|
178
|
+
return [];
|
|
179
|
+
} catch (error) {
|
|
180
|
+
console.log('â Error fetching connections by username:', error);
|
|
181
|
+
console.log('â [NETWORK ERROR] Full error details:', JSON.stringify(error, Object.getOwnPropertyNames(error)));
|
|
182
|
+
return [];
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Get user connections by user ID
|
|
188
|
+
* @param userId - User ID to fetch connections for
|
|
189
|
+
* @returns Promise<Connection[]>
|
|
190
|
+
*/
|
|
191
|
+
exports.getUserConnectionsByUsername = getUserConnectionsByUsername;
|
|
192
|
+
const getUserConnectionsByUserId = async userId => {
|
|
193
|
+
try {
|
|
194
|
+
var _response$connections3, _response$connections4;
|
|
195
|
+
console.log('đ Fetching connections for userId:', userId);
|
|
196
|
+
const token = await (0, _authService.getAuthToken)();
|
|
197
|
+
if (!token) {
|
|
198
|
+
console.warn('â ī¸ [CONNECTIONS API] No authentication token available for user ID connections request');
|
|
199
|
+
return []; // Return empty array instead of making unauthenticated request
|
|
200
|
+
}
|
|
201
|
+
console.log('â
[CONNECTIONS API] Using authenticated request with token:', `${token.substring(0, 20)}...`);
|
|
202
|
+
|
|
203
|
+
// Use the same pattern as other working APIs - import and call with token
|
|
204
|
+
// const { getUserConnections: apiCall } = await import('../../services/api'); // Commented out - path issue
|
|
205
|
+
const response = {
|
|
206
|
+
success: false,
|
|
207
|
+
message: 'API function not available',
|
|
208
|
+
connections: [],
|
|
209
|
+
source: 'mock'
|
|
210
|
+
};
|
|
211
|
+
console.log('â
API connections fetched by userId:', {
|
|
212
|
+
success: response.success,
|
|
213
|
+
connectionsCount: ((_response$connections3 = response.connections) === null || _response$connections3 === void 0 ? void 0 : _response$connections3.length) || 0,
|
|
214
|
+
source: response.source,
|
|
215
|
+
firstConnection: (_response$connections4 = response.connections) !== null && _response$connections4 !== void 0 && _response$connections4[0] ? {
|
|
216
|
+
id: response.connections[0].id,
|
|
217
|
+
name: response.connections[0].name,
|
|
218
|
+
description: response.connections[0].description
|
|
219
|
+
} : null
|
|
220
|
+
});
|
|
221
|
+
if (response.success && response.connections && response.connections.length > 0) {
|
|
222
|
+
const transformedConnections = response.connections.map(transformAPIConnection);
|
|
223
|
+
console.log('đ Transformed connections by userId:', transformedConnections.length);
|
|
224
|
+
return transformedConnections;
|
|
225
|
+
}
|
|
226
|
+
return [];
|
|
227
|
+
} catch (error) {
|
|
228
|
+
console.log('â Error fetching connections by userId:', error);
|
|
229
|
+
console.log('â [NETWORK ERROR FALLBACK] Full error details:', JSON.stringify(error, Object.getOwnPropertyNames(error)));
|
|
230
|
+
return [];
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Get user connections with automatic detection of user info
|
|
236
|
+
* PRIORITIZES the working email/username endpoint over the failing user ID endpoint
|
|
237
|
+
* @returns Promise<Connection[]>
|
|
238
|
+
*/
|
|
239
|
+
exports.getUserConnectionsByUserId = getUserConnectionsByUserId;
|
|
240
|
+
const getUserConnections = async () => {
|
|
241
|
+
try {
|
|
242
|
+
// ENHANCED DEBUG: Check authentication status first
|
|
243
|
+
await (0, _authService.ensureAuthentication)('USER_CONNECTIONS');
|
|
244
|
+
|
|
245
|
+
// ENHANCED DEBUG: Check what user data we actually have available
|
|
246
|
+
console.log('đ [USER DEBUG] Checking all available user data sources...');
|
|
247
|
+
|
|
248
|
+
// Check AsyncStorage for user data
|
|
249
|
+
const storedUsername = await _asyncStorage.default.getItem('onairos_username');
|
|
250
|
+
const storedEmail = await _asyncStorage.default.getItem('user_email');
|
|
251
|
+
const storedUserId = await _asyncStorage.default.getItem('user_id');
|
|
252
|
+
const authToken = await _asyncStorage.default.getItem('auth_token');
|
|
253
|
+
console.log('đ [USER DEBUG] AsyncStorage data:', {
|
|
254
|
+
storedUsername,
|
|
255
|
+
storedEmail,
|
|
256
|
+
storedUserId,
|
|
257
|
+
hasAuthToken: !!authToken,
|
|
258
|
+
authTokenPreview: authToken ? `${authToken.substring(0, 20)}...` : 'none'
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
// First try to get user profile to determine username/userId
|
|
262
|
+
const userProfile = await (0, _authService.getUserProfile)();
|
|
263
|
+
console.log('đ¯ getUserConnections - User profile:', {
|
|
264
|
+
hasId: !!(userProfile !== null && userProfile !== void 0 && userProfile.id),
|
|
265
|
+
hasEmail: !!(userProfile !== null && userProfile !== void 0 && userProfile.email),
|
|
266
|
+
email: userProfile === null || userProfile === void 0 ? void 0 : userProfile.email,
|
|
267
|
+
id: userProfile === null || userProfile === void 0 ? void 0 : userProfile.id
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
// FALLBACK: If getUserProfile fails, try to use stored data directly
|
|
271
|
+
let userEmail = userProfile === null || userProfile === void 0 ? void 0 : userProfile.email;
|
|
272
|
+
let userId = userProfile === null || userProfile === void 0 ? void 0 : userProfile.id;
|
|
273
|
+
if (!userEmail && storedUsername) {
|
|
274
|
+
console.log('đ [USER DEBUG] Using stored username as email fallback:', storedUsername);
|
|
275
|
+
userEmail = storedUsername;
|
|
276
|
+
}
|
|
277
|
+
if (!userEmail && storedEmail) {
|
|
278
|
+
console.log('đ [USER DEBUG] Using stored email as fallback:', storedEmail);
|
|
279
|
+
userEmail = storedEmail;
|
|
280
|
+
}
|
|
281
|
+
if (!userId && storedUserId) {
|
|
282
|
+
console.log('đ [USER DEBUG] Using stored user ID as fallback:', storedUserId);
|
|
283
|
+
userId = storedUserId;
|
|
284
|
+
}
|
|
285
|
+
console.log('đ¯ [USER DEBUG] Final user identifiers to use:', {
|
|
286
|
+
userEmail,
|
|
287
|
+
userId,
|
|
288
|
+
willTryEmail: !!userEmail,
|
|
289
|
+
willTryUserId: !!userId
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
// PRIORITY 1: Try by email/username first (this endpoint is working!)
|
|
293
|
+
if (userEmail) {
|
|
294
|
+
console.log('đ¯ PRIORITY: Attempting to fetch connections by email (working endpoint):', userEmail);
|
|
295
|
+
const connections = await getUserConnectionsByUsername(userEmail);
|
|
296
|
+
if (connections.length > 0) {
|
|
297
|
+
console.log('â
Successfully got connections by email:', connections.length);
|
|
298
|
+
return connections;
|
|
299
|
+
}
|
|
300
|
+
console.log('â ī¸ No connections found by email, trying user ID...');
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
// PRIORITY 2: Try by user ID only if email fails (this endpoint has ObjectId issues)
|
|
304
|
+
if (userId) {
|
|
305
|
+
console.log('đ¯ FALLBACK: Attempting to fetch connections by user ID:', userId);
|
|
306
|
+
const connections = await getUserConnectionsByUserId(userId);
|
|
307
|
+
if (connections.length > 0) {
|
|
308
|
+
console.log('â
Successfully got connections by user ID:', connections.length);
|
|
309
|
+
return connections;
|
|
310
|
+
}
|
|
311
|
+
console.log('â ī¸ No connections found by user ID');
|
|
312
|
+
}
|
|
313
|
+
console.log('â ī¸ No user identifier available or no connections found');
|
|
314
|
+
return [];
|
|
315
|
+
} catch (error) {
|
|
316
|
+
console.log('â Error in getUserConnections:', error);
|
|
317
|
+
return [];
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* @deprecated This function uses Enoch-specific endpoints and has been removed from the SDK.
|
|
323
|
+
* Consuming apps (like OnairosEvents) should call the profile picture API directly:
|
|
324
|
+
* POST /enoch/users/{userIdentifier}/profile-picture/base64
|
|
325
|
+
*
|
|
326
|
+
* @param _imageUri - Image URI (file:// or base64)
|
|
327
|
+
* @param _fileType - File type (jpg, png)
|
|
328
|
+
* @returns Promise with error indicating deprecation
|
|
329
|
+
*/
|
|
330
|
+
exports.getUserConnections = getUserConnections;
|
|
331
|
+
const uploadProfilePicture = async (_imageUri, _fileType) => {
|
|
332
|
+
console.warn('â ī¸ [DEPRECATED] uploadProfilePicture has been removed from SDK');
|
|
333
|
+
console.warn('âšī¸ Consuming apps should call /enoch/users/{id}/profile-picture/base64 directly');
|
|
334
|
+
return {
|
|
335
|
+
success: false,
|
|
336
|
+
error: 'uploadProfilePicture has been removed from SDK. Consuming apps should call the Enoch API directly.'
|
|
337
|
+
};
|
|
338
|
+
};
|
|
339
|
+
exports.uploadProfilePicture = uploadProfilePicture;
|
|
340
|
+
//# sourceMappingURL=userConnectionsService.js.map
|