@onairos/react-native 3.7.2 â 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/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/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
|
-
Object[_0x5ba7(0x0)](exports,_0x5ba7(0x1),{'value':!![]}),exports[_0x5ba7(0x2)]=exports[_0x5ba7(0x3)]=exports[_0x5ba7(0x4)]=exports[_0x5ba7(0x5)]=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(_0x493a79){return _0x493a79&&_0x493a79[_0x5ba7(0x1)]?_0x493a79:{'default':_0x493a79};}const getUserIdWithFallbacks=async()=>{const _0x4cf4a9={'IqAkV':_0x5ba7(0x6),'aRoci':function(_0x2a1ae3,_0x1515bc){return _0x2a1ae3===_0x1515bc;},'uASoz':function(_0x381ee4,_0x5ea24c){return _0x381ee4===_0x5ea24c;},'oRqzY':function(_0xd80521,_0x2c4624){return _0xd80521(_0x2c4624);},'YJeKS':function(_0x516c2a,_0x578c34){return _0x516c2a*_0x578c34;},'Olsjq':'Unknown\x20User','IlcYb':'Hi!\x20Nice\x20to\x20meet\x20you.','xcezn':'â
\x20[USER\x20ID]\x20Got\x20username\x20from\x20AsyncStorage\x20(backend\x20supports\x20usernames):','WdULM':_0x5ba7(0x7),'ZgdjD':'đ\x20Transformed\x20connections\x20by\x20userId:','DADPh':'đ\x20[USER\x20ID]\x20Attempting\x20to\x20get\x20user\x20identifier\x20with\x20multiple\x20methods...','PNrbX':function(_0x5b5286,_0x56c544){return _0x5b5286!==_0x56c544;},'sJLEQ':function(_0x1d6a3e,_0x451642){return _0x1d6a3e!==_0x451642;},'SlknK':_0x5ba7(0x8),'KXtKa':'â
\x20[USER\x20ID]\x20Got\x20user\x20ID\x20from\x20getUserProfile:','ITeMH':_0x5ba7(0x9),'tfEhT':function(_0x47c29e,_0x521032){return _0x47c29e===_0x521032;},'IGWbt':function(_0x5069c3,_0x534833){return _0x5069c3===_0x534833;},'HbVPP':'aeXcY','FJVvg':'â ī¸\x20[USER\x20ID]\x20getUserProfile\x20failed:','nToYl':_0x5ba7(0xa),'RdQbL':function(_0x3ffb5b,_0x460134){return _0x3ffb5b>_0x460134;},'RBHuy':function(_0x32e247,_0x42d9d9){return _0x32e247!==_0x42d9d9;},'jSceB':_0x5ba7(0xb),'dqPUE':_0x5ba7(0xc),'rdPUY':_0x5ba7(0xd),'LkJeM':'â ī¸\x20[USER\x20ID]\x20Invalid\x20stored\x20user\x20ID\x20found:','Ypgsy':_0x5ba7(0xe),'VzJGG':function(_0x5820cf,_0x82ede){return _0x5820cf>_0x82ede;},'hgaIQ':function(_0xe31144,_0x3888cb){return _0xe31144!==_0x3888cb;},'TxDVb':_0x5ba7(0xf),'pUWyq':_0x5ba7(0x10),'NfvRN':_0x5ba7(0x11),'XSfUL':function(_0x5ec4b5,_0x4a6d6c){return _0x5ec4b5!==_0x4a6d6c;},'ZUaAZ':'blHIs','mCGjv':_0x5ba7(0x12),'dxTik':function(_0x3d6a51,_0x5bc917){return _0x3d6a51===_0x5bc917;},'xnfSJ':_0x5ba7(0x13),'afApN':'â ī¸\x20[USER\x20ID]\x20JWT\x20token\x20access\x20failed:','JjLjI':_0x5ba7(0x14),'aZvEk':function(_0x4bb64,_0x48bed1){return _0x4bb64===_0x48bed1;},'MaAZx':_0x5ba7(0x15),'TnIGc':_0x5ba7(0x16)};try{console[_0x5ba7(0x17)](_0x4cf4a9[_0x5ba7(0x18)]);try{const _0x2b7fbb=await(0x0,_authService['getUserProfile'])();if(_0x4cf4a9['PNrbX'](_0x2b7fbb,null)&&_0x4cf4a9[_0x5ba7(0x19)](_0x2b7fbb,void 0x0)&&_0x2b7fbb['id']&&_0x4cf4a9[_0x5ba7(0x19)](_0x2b7fbb['id'],_0x4cf4a9['SlknK']))return console[_0x5ba7(0x17)](_0x4cf4a9[_0x5ba7(0x1a)],_0x2b7fbb['id']),_0x2b7fbb['id'];else console[_0x5ba7(0x1b)](_0x4cf4a9[_0x5ba7(0x1c)],_0x4cf4a9[_0x5ba7(0x1d)](_0x2b7fbb,null)||_0x4cf4a9[_0x5ba7(0x1e)](_0x2b7fbb,void 0x0)?void 0x0:_0x2b7fbb['id']);}catch(_0x25ba2d){if(_0x4cf4a9[_0x5ba7(0x1f)](_0x4cf4a9['HbVPP'],'aeXcY'))return _0x45cce1['error'](_0x4cf4a9[_0x5ba7(0x20)],_0x21eb76),null;else console[_0x5ba7(0x1b)](_0x4cf4a9[_0x5ba7(0x21)],_0x25ba2d);}const _0x2ee7fc=await _asyncStorage[_0x5ba7(0x22)][_0x5ba7(0x23)](_0x5ba7(0x24));if(_0x2ee7fc&&_0x4cf4a9[_0x5ba7(0x19)](_0x2ee7fc,_0x4cf4a9[_0x5ba7(0x25)])&&_0x2ee7fc!==_0x4cf4a9[_0x5ba7(0x26)]&&_0x4cf4a9[_0x5ba7(0x27)](_0x2ee7fc[_0x5ba7(0x28)],0xa)){if(_0x4cf4a9[_0x5ba7(0x29)](_0x4cf4a9['jSceB'],_0x5ba7(0xb))){var _0x481ff7,_0x54af06;return _0x294db0[_0x5ba7(0x17)](_0x5ba7(0x2a),{'id':_0x36e54a['id'],'name':_0x5652b6[_0x5ba7(0x2b)],'description':_0x3bdb67[_0x5ba7(0x2c)],'hasPhoto':!!_0x397810[_0x5ba7(0x2d)],'photoLength':_0x4cf4a9[_0x5ba7(0x2e)](_0x481ff7=_0x105168[_0x5ba7(0x2d)],null)||_0x4cf4a9[_0x5ba7(0x2f)](_0x481ff7,void 0x0)?void 0x0:_0x481ff7[_0x5ba7(0x28)],'interests':_0x56a85a['interests'],'sharedPassions':_0x102b05[_0x5ba7(0x30)],'complementaryQualities':_0x5dc34e[_0x5ba7(0x31)],'compatibility':_0x5e37ca[_0x5ba7(0x32)]}),{'id':_0x4cf4a9[_0x5ba7(0x33)](_0x48741d,_0x58452c['id'])||_0x4cf4a9[_0x5ba7(0x33)](_0x2100e9,_0x5e8021[_0x5ba7(0x34)]||'')||_0x4cf4a9['YJeKS'](_0x46f305[_0x5ba7(0x35)](),0x3e8),'name':_0xfe5d1d['name']||_0x4cf4a9['Olsjq'],'description':_0x22e4d5[_0x5ba7(0x2c)]||'Looking\x20to\x20connect','photo':_0x471e85['photo']||'','bio':_0x3d6569[_0x5ba7(0x36)]||'','interests':_0x1da70c[_0x5ba7(0x37)]||[],'mutualConnections':_0xb703da[_0x5ba7(0x38)]||0x0,'compatibility':_0x172e9f[_0x5ba7(0x32)]||0x0,'conversationStarters':_0x2503e5[_0x5ba7(0x39)]||[_0x4cf4a9[_0x5ba7(0x3a)]],'sharedPassions':_0x15ecbb[_0x5ba7(0x30)]||[],'complementaryQualities':_0x4828f8['complementaryQualities']||[],'meaningfulCoincidences':_0x28c24e[_0x5ba7(0x3b)]||[],'mutualConnectionsList':((_0x54af06=_0x2daf5a[_0x5ba7(0x3c)])===null||_0x4cf4a9['uASoz'](_0x54af06,void 0x0)?void 0x0:_0x54af06[_0x5ba7(0x3d)](_0x4be6de=>({'name':_0x4be6de['name'],'photo':_0x4be6de[_0x5ba7(0x2d)],'context':_0x4be6de[_0x5ba7(0x3e)]})))||[]};}else return console[_0x5ba7(0x17)](_0x4cf4a9['dqPUE'],_0x2ee7fc),_0x2ee7fc;}else _0x2ee7fc&&(_0x4cf4a9['rdPUY']!=='MJOeO'?console[_0x5ba7(0x1b)](_0x4cf4a9[_0x5ba7(0x3f)],_0x2ee7fc):(_0x315579[_0x5ba7(0x17)](_0x5ba7(0x40),_0xbc6ace),_0x5a1541=_0x586129));const _0x17c07a=await _asyncStorage[_0x5ba7(0x22)]['getItem'](_0x4cf4a9[_0x5ba7(0x41)]);if(_0x17c07a&&_0x4cf4a9[_0x5ba7(0x42)](_0x17c07a['length'],0x2)&&_0x4cf4a9['hgaIQ'](_0x17c07a,_0x4cf4a9[_0x5ba7(0x25)]))return console[_0x5ba7(0x17)](_0x5ba7(0x43),_0x17c07a),_0x17c07a;else _0x17c07a&&console[_0x5ba7(0x1b)](_0x4cf4a9[_0x5ba7(0x44)],_0x17c07a);const _0x139990=await _asyncStorage[_0x5ba7(0x22)][_0x5ba7(0x23)](_0x5ba7(0x45));if(_0x139990&&_0x139990[_0x5ba7(0x46)]('@')&&_0x4cf4a9[_0x5ba7(0x27)](_0x139990[_0x5ba7(0x28)],0x5))return console[_0x5ba7(0x17)](_0x4cf4a9['pUWyq'],_0x139990),_0x139990;else _0x139990&&console['warn'](_0x4cf4a9[_0x5ba7(0x47)],_0x139990);try{const _0xc045ce=await(0x0,_authService[_0x5ba7(0x48)])();if(_0xc045ce&&_0x4cf4a9[_0x5ba7(0x2e)](_0xc045ce[_0x5ba7(0x49)]('.')[_0x5ba7(0x28)],0x3)){if(_0x4cf4a9['XSfUL'](_0x4cf4a9[_0x5ba7(0x4a)],_0x5ba7(0x4b)))console[_0x5ba7(0x17)](_0x4cf4a9[_0x5ba7(0x4c)]);else return _0x4688a3[_0x5ba7(0x17)](_0x4cf4a9['xcezn'],_0x36d442),_0x3ccc9f;}}catch(_0x31a652){if(_0x4cf4a9[_0x5ba7(0x4d)](_0x4cf4a9[_0x5ba7(0x4e)],_0x5ba7(0x13)))console[_0x5ba7(0x1b)](_0x4cf4a9[_0x5ba7(0x4f)],_0x31a652);else return _0x5d6b1b['warn'](_0x4cf4a9[_0x5ba7(0x50)]),[];}return console[_0x5ba7(0x51)](_0x4cf4a9[_0x5ba7(0x52)]),null;}catch(_0x1747b3){if(_0x4cf4a9[_0x5ba7(0x53)](_0x4cf4a9[_0x5ba7(0x54)],_0x4cf4a9['TnIGc'])){const _0x1f3d24=_0xcb60d9['connections'][_0x5ba7(0x3d)](_0xade27b);return _0x3e009c[_0x5ba7(0x17)](_0x4cf4a9['ZgdjD'],_0x1f3d24[_0x5ba7(0x28)]),_0x1f3d24;}else return console[_0x5ba7(0x51)](_0x4cf4a9['IqAkV'],_0x1747b3),null;}},samImage=_assetRegistry[_0x5ba7(0x55)][_0x5ba7(0x56)],anandImage=_assetRegistry[_0x5ba7(0x55)][_0x5ba7(0x57)],chrisImage=_assetRegistry[_0x5ba7(0x55)][_0x5ba7(0x58)],katieImage=_assetRegistry[_0x5ba7(0x55)][_0x5ba7(0x59)],yanniImage=_assetRegistry[_0x5ba7(0x55)][_0x5ba7(0x5a)],API_BASE_URL=_api[_0x5ba7(0x5b)][_0x5ba7(0x5c)],transformAPIConnection=_0x58e939=>{const _0x1537c3={'PsmUE':_0x5ba7(0x2a),'hrNWb':function(_0x2d20d1,_0x322b08){return _0x2d20d1===_0x322b08;},'ruhpN':function(_0x531ccf,_0x5f2302){return _0x531ccf(_0x5f2302);},'rhbIC':function(_0x1befef,_0x55131b){return _0x1befef*_0x55131b;},'aClDx':_0x5ba7(0x5d),'VVrrP':_0x5ba7(0x5e),'MtQvN':function(_0xf214e3,_0x3717d2){return _0xf214e3===_0x3717d2;},'QsINX':function(_0x31d227,_0x8ab1ba){return _0x31d227===_0x8ab1ba;}};var _0x52629d,_0x2faa15;return console['log'](_0x1537c3[_0x5ba7(0x5f)],{'id':_0x58e939['id'],'name':_0x58e939[_0x5ba7(0x2b)],'description':_0x58e939['description'],'hasPhoto':!!_0x58e939[_0x5ba7(0x2d)],'photoLength':(_0x52629d=_0x58e939[_0x5ba7(0x2d)])===null||_0x1537c3[_0x5ba7(0x60)](_0x52629d,void 0x0)?void 0x0:_0x52629d['length'],'interests':_0x58e939['interests'],'sharedPassions':_0x58e939[_0x5ba7(0x30)],'complementaryQualities':_0x58e939['complementaryQualities'],'compatibility':_0x58e939[_0x5ba7(0x32)]}),{'id':_0x1537c3[_0x5ba7(0x61)](parseInt,_0x58e939['id'])||_0x1537c3[_0x5ba7(0x61)](parseInt,_0x58e939[_0x5ba7(0x34)]||'')||_0x1537c3[_0x5ba7(0x62)](Math[_0x5ba7(0x35)](),0x3e8),'name':_0x58e939[_0x5ba7(0x2b)]||_0x1537c3[_0x5ba7(0x63)],'description':_0x58e939[_0x5ba7(0x2c)]||_0x5ba7(0x64),'photo':_0x58e939['photo']||'','bio':_0x58e939['bio']||'','interests':_0x58e939[_0x5ba7(0x37)]||[],'mutualConnections':_0x58e939[_0x5ba7(0x38)]||0x0,'compatibility':_0x58e939[_0x5ba7(0x32)]||0x0,'conversationStarters':_0x58e939[_0x5ba7(0x39)]||[_0x1537c3[_0x5ba7(0x65)]],'sharedPassions':_0x58e939['sharedPassions']||[],'complementaryQualities':_0x58e939['complementaryQualities']||[],'meaningfulCoincidences':_0x58e939[_0x5ba7(0x3b)]||[],'mutualConnectionsList':(_0x1537c3[_0x5ba7(0x66)](_0x2faa15=_0x58e939[_0x5ba7(0x3c)],null)||_0x1537c3['QsINX'](_0x2faa15,void 0x0)?void 0x0:_0x2faa15[_0x5ba7(0x3d)](_0x5867dd=>({'name':_0x5867dd[_0x5ba7(0x2b)],'photo':_0x5867dd[_0x5ba7(0x2d)],'context':_0x5867dd[_0x5ba7(0x3e)]})))||[]};},getUserConnectionsByUsername=async _0x48073e=>{const _0x59ba55={'HAIwG':_0x5ba7(0x67),'LQriw':_0x5ba7(0x68),'YvPAw':_0x5ba7(0x69),'CcDnE':_0x5ba7(0x6a),'jmgWv':function(_0x36e3d1,_0x238456){return _0x36e3d1!==_0x238456;},'SroJB':_0x5ba7(0x6b),'xiBWi':'â
\x20[CONNECTIONS\x20API]\x20Using\x20authenticated\x20request\x20with\x20token:','gTApP':'API\x20function\x20not\x20available','VKPCJ':_0x5ba7(0x6c),'RwVZB':_0x5ba7(0x6d),'HKqPY':function(_0x22d8ce,_0x215d48){return _0x22d8ce===_0x215d48;},'VIMPo':function(_0x295a52,_0x383b19){return _0x295a52>_0x383b19;},'wNhHW':_0x5ba7(0x6e),'kRiIT':function(_0x50b366,_0x2d1fa3){return _0x50b366===_0x2d1fa3;},'LFCPw':_0x5ba7(0x6f),'hihDX':_0x5ba7(0x70),'CUTbM':'â\x20Error\x20fetching\x20connections\x20by\x20username:','UiPTn':_0x5ba7(0x71)};try{var _0x24d470,_0x149f8e;console[_0x5ba7(0x17)](_0x59ba55[_0x5ba7(0x72)],_0x48073e);const _0x3c1b92=await(0x0,_authService['getAuthToken'])();if(!_0x3c1b92)return _0x59ba55[_0x5ba7(0x73)](_0x59ba55[_0x5ba7(0x74)],'iBqSk')?(_0x58ee1c[_0x5ba7(0x1b)](_0x59ba55[_0x5ba7(0x75)]),_0x4b1fe4[_0x5ba7(0x1b)](_0x59ba55[_0x5ba7(0x76)]),[]):(console['warn'](_0x59ba55[_0x5ba7(0x75)]),console[_0x5ba7(0x1b)](_0x59ba55['LQriw']),[]);console[_0x5ba7(0x17)](_0x59ba55[_0x5ba7(0x77)],_0x3c1b92['substring'](0x0,0x14)+_0x5ba7(0x78));const _0x4a2fda={'success':![],'message':_0x59ba55[_0x5ba7(0x79)],'connections':[],'source':_0x59ba55[_0x5ba7(0x7a)]};console[_0x5ba7(0x17)](_0x59ba55[_0x5ba7(0x7b)],{'success':_0x4a2fda[_0x5ba7(0x7c)],'connectionsCount':(_0x59ba55[_0x5ba7(0x7d)](_0x24d470=_0x4a2fda['connections'],null)||_0x24d470===void 0x0?void 0x0:_0x24d470[_0x5ba7(0x28)])||0x0,'source':_0x4a2fda[_0x5ba7(0x7e)],'firstConnection':_0x59ba55[_0x5ba7(0x73)](_0x149f8e=_0x4a2fda['connections'],null)&&_0x59ba55[_0x5ba7(0x73)](_0x149f8e,void 0x0)&&_0x149f8e[0x0]?{'id':_0x4a2fda['connections'][0x0]['id'],'name':_0x4a2fda[_0x5ba7(0x7f)][0x0][_0x5ba7(0x2b)],'description':_0x4a2fda[_0x5ba7(0x7f)][0x0][_0x5ba7(0x2c)]}:null});if(_0x4a2fda[_0x5ba7(0x7c)]&&_0x4a2fda['connections']&&_0x59ba55['VIMPo'](_0x4a2fda[_0x5ba7(0x7f)]['length'],0x0)){if(_0x59ba55[_0x5ba7(0x73)](_0x59ba55[_0x5ba7(0x80)],'dZzZM'))return _0x9e4ed5[_0x5ba7(0x17)](_0x5ba7(0x81),_0x33eeb7),_0x4e6a18[_0x5ba7(0x17)](_0x59ba55[_0x5ba7(0x82)],_0x2c32ef[_0x5ba7(0x83)](_0xa511ad,_0x1a9cb9[_0x5ba7(0x84)](_0x4b8960))),[];else{const _0x4820be=_0x4a2fda[_0x5ba7(0x7f)][_0x5ba7(0x3d)](transformAPIConnection);return console[_0x5ba7(0x17)]('đ\x20Transformed\x20connections\x20by\x20username:',_0x4820be[_0x5ba7(0x28)]),_0x4820be;}}return[];}catch(_0x1209b9){if(_0x59ba55['kRiIT'](_0x59ba55[_0x5ba7(0x85)],_0x59ba55['hihDX']))_0x2b1608[_0x5ba7(0x1b)](_0x5ba7(0x86),_0x549513);else return console[_0x5ba7(0x17)](_0x59ba55[_0x5ba7(0x87)],_0x1209b9),console[_0x5ba7(0x17)](_0x59ba55['UiPTn'],JSON[_0x5ba7(0x83)](_0x1209b9,Object[_0x5ba7(0x84)](_0x1209b9))),[];}};exports[_0x5ba7(0x3)]=getUserConnectionsByUsername;const getUserConnectionsByUserId=async _0x3edd6e=>{const _0x1a7291={'hezCD':_0x5ba7(0x88),'mazgJ':function(_0x2c78b4,_0x4e01b2){return _0x2c78b4!==_0x4e01b2;},'vGfVb':_0x5ba7(0x89),'RAVSX':_0x5ba7(0x8a),'kLsTn':'â ī¸\x20[CONNECTIONS\x20API]\x20No\x20authentication\x20token\x20available\x20for\x20user\x20ID\x20connections\x20request','XnEUO':_0x5ba7(0x8b),'zZyBe':_0x5ba7(0x8c),'TIrvM':_0x5ba7(0x6c),'EaJrh':'â
\x20API\x20connections\x20fetched\x20by\x20userId:','OmRVq':function(_0xd8d4eb,_0x4dd6f5){return _0xd8d4eb===_0x4dd6f5;},'yJBkL':function(_0x2d467e,_0x1b53de){return _0x2d467e>_0x1b53de;},'EVeOV':_0x5ba7(0x8d),'YsyHT':_0x5ba7(0x81)};try{var _0x3ad9ed,_0x35c473;console['log'](_0x1a7291[_0x5ba7(0x8e)],_0x3edd6e);const _0x1072aa=await(0x0,_authService[_0x5ba7(0x48)])();if(!_0x1072aa)return _0x1a7291[_0x5ba7(0x8f)](_0x1a7291['vGfVb'],_0x1a7291['RAVSX'])?(console[_0x5ba7(0x1b)](_0x1a7291[_0x5ba7(0x90)]),[]):(_0x22cdee[_0x5ba7(0x17)]('â
\x20Successfully\x20got\x20connections\x20by\x20email:',_0x9ed31d[_0x5ba7(0x28)]),_0x154e23);console[_0x5ba7(0x17)](_0x1a7291[_0x5ba7(0x91)],_0x1072aa[_0x5ba7(0x92)](0x0,0x14)+_0x5ba7(0x78));const _0x51b254={'success':![],'message':_0x1a7291[_0x5ba7(0x93)],'connections':[],'source':_0x1a7291['TIrvM']};console['log'](_0x1a7291[_0x5ba7(0x94)],{'success':_0x51b254['success'],'connectionsCount':(_0x1a7291[_0x5ba7(0x95)](_0x3ad9ed=_0x51b254['connections'],null)||_0x1a7291[_0x5ba7(0x95)](_0x3ad9ed,void 0x0)?void 0x0:_0x3ad9ed[_0x5ba7(0x28)])||0x0,'source':_0x51b254[_0x5ba7(0x7e)],'firstConnection':(_0x35c473=_0x51b254[_0x5ba7(0x7f)])!==null&&_0x1a7291[_0x5ba7(0x8f)](_0x35c473,void 0x0)&&_0x35c473[0x0]?{'id':_0x51b254[_0x5ba7(0x7f)][0x0]['id'],'name':_0x51b254['connections'][0x0][_0x5ba7(0x2b)],'description':_0x51b254[_0x5ba7(0x7f)][0x0][_0x5ba7(0x2c)]}:null});if(_0x51b254[_0x5ba7(0x7c)]&&_0x51b254[_0x5ba7(0x7f)]&&_0x1a7291[_0x5ba7(0x96)](_0x51b254[_0x5ba7(0x7f)]['length'],0x0)){const _0x3260dc=_0x51b254[_0x5ba7(0x7f)]['map'](transformAPIConnection);return console['log'](_0x1a7291[_0x5ba7(0x97)],_0x3260dc[_0x5ba7(0x28)]),_0x3260dc;}return[];}catch(_0x428c68){return console[_0x5ba7(0x17)](_0x1a7291['YsyHT'],_0x428c68),console[_0x5ba7(0x17)](_0x5ba7(0x69),JSON[_0x5ba7(0x83)](_0x428c68,Object[_0x5ba7(0x84)](_0x428c68))),[];}};exports['getUserConnectionsByUserId']=getUserConnectionsByUserId;function _0x5ba7(_0x2c6859,_0x5ba727){_0x2c6859=_0x2c6859-0x0;const _0x5b2f43=_0x2c68();let _0x543f8f=_0x5b2f43[_0x2c6859];return _0x543f8f;}function _0x2c68(){const _0x1cac08=['defineProperty','__esModule','uploadProfilePicture','getUserConnectionsByUsername','getUserConnectionsByUserId','getUserConnections','â\x20[USER\x20ID]\x20Error\x20getting\x20user\x20identifier:','â ī¸\x20[CONNECTIONS\x20API]\x20No\x20authentication\x20token\x20available\x20for\x20user\x20ID\x20connections\x20request','fallback_user','â ī¸\x20[USER\x20ID]\x20getUserProfile\x20returned\x20invalid/fallback\x20ID:','marker','hOELR','â
\x20[USER\x20ID]\x20Got\x20user\x20ID\x20from\x20AsyncStorage:','tCnpK','onairos_username','â ī¸\x20[USER\x20ID]\x20Invalid\x20stored\x20username\x20found:','â
\x20[USER\x20ID]\x20Got\x20email\x20from\x20AsyncStorage\x20(backend\x20supports\x20usernames):','â ī¸\x20[USER\x20ID]\x20Invalid\x20stored\x20email\x20found:','đ\x20[USER\x20ID]\x20JWT\x20token\x20found\x20but\x20no\x20local\x20user\x20identifier\x20-\x20backend\x20should\x20handle\x20via\x20token','MeNuC','â\x20[USER\x20ID]\x20No\x20valid\x20user\x20identifier\x20found','wJuzr','siymt','log','DADPh','sJLEQ','KXtKa','warn','ITeMH','tfEhT','IGWbt','PNrbX','IqAkV','FJVvg','default','getItem','user_id','nToYl','SlknK','RdQbL','length','RBHuy','đ\x20Transforming\x20API\x20connection:','name','description','photo','aRoci','uASoz','sharedPassions','complementaryQualities','compatibility','oRqzY','_id','random','bio','interests','mutualConnections','conversationStarters','IlcYb','meaningfulCoincidences','mutualConnectionsList','map','context','LkJeM','đ\x20[USER\x20DEBUG]\x20Using\x20stored\x20username\x20as\x20email\x20fallback:','Ypgsy','VzJGG','â
\x20[USER\x20ID]\x20Got\x20username\x20from\x20AsyncStorage\x20(backend\x20supports\x20usernames):','TxDVb','user_email','includes','NfvRN','getAuthToken','split','ZUaAZ','gNCkK','mCGjv','dxTik','xnfSJ','afApN','WdULM','error','JjLjI','aZvEk','MaAZx','PERSONA_IMAGES','level1','level2','level3','level4','level5','API_CONFIG','BASE_URL','Unknown\x20User','Hi!\x20Nice\x20to\x20meet\x20you.','PsmUE','hrNWb','ruhpN','rhbIC','aClDx','Looking\x20to\x20connect','VVrrP','MtQvN','â ī¸\x20[CONNECTIONS\x20API]\x20No\x20authentication\x20token\x20available\x20for\x20connections\x20request','â ī¸\x20[CONNECTIONS\x20API]\x20This\x20may\x20result\x20in\x20limited\x20or\x20cached\x20data\x20from\x20backend','â\x20[NETWORK\x20ERROR\x20FALLBACK]\x20Full\x20error\x20details:','đ\x20Fetching\x20connections\x20for\x20username:','iBqSk','mock','â
\x20API\x20connections\x20fetched\x20by\x20username:','dZzZM','QAXQh','oBBoY','â\x20[NETWORK\x20ERROR]\x20Full\x20error\x20details:','CcDnE','jmgWv','SroJB','HAIwG','LQriw','xiBWi','...','gTApP','VKPCJ','RwVZB','success','HKqPY','source','connections','wNhHW','â\x20Error\x20fetching\x20connections\x20by\x20userId:','YvPAw','stringify','getOwnPropertyNames','LFCPw','â ī¸\x20[USER\x20ID]\x20Invalid\x20stored\x20user\x20ID\x20found:','CUTbM','đ\x20Fetching\x20connections\x20for\x20userId:','zOchl','lRgVq','â
\x20[CONNECTIONS\x20API]\x20Using\x20authenticated\x20request\x20with\x20token:','API\x20function\x20not\x20available','đ\x20Transformed\x20connections\x20by\x20userId:','hezCD','mazgJ','kLsTn','XnEUO','substring','zZyBe','EaJrh','OmRVq','yJBkL','EVeOV','â\x20Error\x20fetching\x20connections\x20by\x20username:','USER_CONNECTIONS','auth_token','đ\x20[USER\x20DEBUG]\x20AsyncStorage\x20data:','none','Tnxne','đ\x20[USER\x20DEBUG]\x20Using\x20stored\x20email\x20as\x20fallback:','LomMb','đ\x20[USER\x20DEBUG]\x20Using\x20stored\x20user\x20ID\x20as\x20fallback:','đ¯\x20[USER\x20DEBUG]\x20Final\x20user\x20identifiers\x20to\x20use:','jFDSV','â
\x20Successfully\x20got\x20connections\x20by\x20email:','â ī¸\x20No\x20connections\x20found\x20by\x20email,\x20trying\x20user\x20ID...','đ¯\x20FALLBACK:\x20Attempting\x20to\x20fetch\x20connections\x20by\x20user\x20ID:','â
\x20Successfully\x20got\x20connections\x20by\x20user\x20ID:','â ī¸\x20No\x20user\x20identifier\x20available\x20or\x20no\x20connections\x20found','â\x20Error\x20in\x20getUserConnections:','ensureAuthentication','đ\x20[USER\x20DEBUG]\x20Checking\x20all\x20available\x20user\x20data\x20sources...','crGsd','fYawS','LMmBz','DQAhp','WwNUv','getUserProfile','iMzyF','email','bnZgB','JZtkt','CepAZ','SigWL','qCOOe','bunOb','keKwz','KhaCH','BYTkg','eqJQv','LGjQK','tClcR','cJPKI','SIWWO','keQaF','FtQyc','rDWNY','zeoKQ','ytqTi','mOkzW','LCEsU','rOavf','zyXcB','uploadProfilePicture\x20has\x20been\x20removed\x20from\x20SDK.\x20Consuming\x20apps\x20should\x20call\x20the\x20Enoch\x20API\x20directly.','arNZo'];_0x2c68=function(){return _0x1cac08;};return _0x2c68();}const getUserConnections=async()=>{const _0x449b73={'KhaCH':_0x5ba7(0xf),'FtQyc':_0x5ba7(0x98),'NXBJR':_0x5ba7(0x71),'NBjjP':_0x5ba7(0x99),'crGsd':_0x5ba7(0xe),'fYawS':_0x5ba7(0x45),'LMmBz':_0x5ba7(0x24),'DQAhp':_0x5ba7(0x9a),'ChaDL':_0x5ba7(0x9b),'WwNUv':_0x5ba7(0x9c),'iMzyF':function(_0x31c0ee,_0x4e1cc6){return _0x31c0ee!==_0x4e1cc6;},'bnZgB':function(_0x5a77a0,_0x1ee644){return _0x5a77a0===_0x1ee644;},'JZtkt':function(_0x53cccc,_0x1ea7e6){return _0x53cccc===_0x1ea7e6;},'CepAZ':function(_0x10796b,_0x32565b){return _0x10796b&&_0x32565b;},'EIRMu':_0x5ba7(0x40),'SigWL':_0x5ba7(0x9d),'qCOOe':_0x5ba7(0x9e),'bunOb':function(_0x409a81,_0x4f148d){return _0x409a81!==_0x4f148d;},'keKwz':_0x5ba7(0x9f),'BYTkg':_0x5ba7(0xa0),'eqJQv':_0x5ba7(0xa1),'LGjQK':function(_0xe5c0ac,_0x1e4f78){return _0xe5c0ac===_0x1e4f78;},'tClcR':_0x5ba7(0xa2),'cJPKI':'đ¯\x20PRIORITY:\x20Attempting\x20to\x20fetch\x20connections\x20by\x20email\x20(working\x20endpoint):','QBieZ':function(_0xe28875,_0x335881){return _0xe28875(_0x335881);},'SIWWO':_0x5ba7(0xa3),'keQaF':_0x5ba7(0xa4),'rDWNY':_0x5ba7(0xa5),'DrGZh':function(_0x302a28,_0x478a93){return _0x302a28(_0x478a93);},'zeoKQ':function(_0x432e1b,_0x1f1f27){return _0x432e1b>_0x1f1f27;},'ytqTi':_0x5ba7(0xa6),'mOkzW':'â ī¸\x20No\x20connections\x20found\x20by\x20user\x20ID','LCEsU':_0x5ba7(0xa7),'rOavf':'zyXcB','nCNxA':_0x5ba7(0xa8)};try{await(0x0,_authService[_0x5ba7(0xa9)])(_0x449b73['NBjjP']),console['log'](_0x5ba7(0xaa));const _0x401717=await _asyncStorage['default'][_0x5ba7(0x23)](_0x449b73[_0x5ba7(0xab)]),_0x340a2f=await _asyncStorage[_0x5ba7(0x22)]['getItem'](_0x449b73[_0x5ba7(0xac)]),_0x525f45=await _asyncStorage[_0x5ba7(0x22)][_0x5ba7(0x23)](_0x449b73[_0x5ba7(0xad)]),_0x3559f1=await _asyncStorage['default'][_0x5ba7(0x23)](_0x449b73[_0x5ba7(0xae)]);console[_0x5ba7(0x17)](_0x449b73['ChaDL'],{'storedUsername':_0x401717,'storedEmail':_0x340a2f,'storedUserId':_0x525f45,'hasAuthToken':!!_0x3559f1,'authTokenPreview':_0x3559f1?_0x3559f1['substring'](0x0,0x14)+_0x5ba7(0x78):_0x449b73[_0x5ba7(0xaf)]});const _0x59d799=await(0x0,_authService[_0x5ba7(0xb0)])();console['log']('đ¯\x20getUserConnections\x20-\x20User\x20profile:',{'hasId':!!(_0x449b73[_0x5ba7(0xb1)](_0x59d799,null)&&_0x59d799!==void 0x0&&_0x59d799['id']),'hasEmail':!!(_0x59d799!==null&&_0x449b73[_0x5ba7(0xb1)](_0x59d799,void 0x0)&&_0x59d799[_0x5ba7(0xb2)]),'email':_0x59d799===null||_0x59d799===void 0x0?void 0x0:_0x59d799[_0x5ba7(0xb2)],'id':_0x449b73[_0x5ba7(0xb3)](_0x59d799,null)||_0x449b73['JZtkt'](_0x59d799,void 0x0)?void 0x0:_0x59d799['id']});let _0x2f19e6=_0x59d799===null||_0x59d799===void 0x0?void 0x0:_0x59d799[_0x5ba7(0xb2)],_0x314248=_0x59d799===null||_0x449b73[_0x5ba7(0xb4)](_0x59d799,void 0x0)?void 0x0:_0x59d799['id'];_0x449b73[_0x5ba7(0xb5)](!_0x2f19e6,_0x401717)&&(console[_0x5ba7(0x17)](_0x449b73['EIRMu'],_0x401717),_0x2f19e6=_0x401717);_0x449b73[_0x5ba7(0xb5)](!_0x2f19e6,_0x340a2f)&&(_0x449b73[_0x5ba7(0xb4)](_0x5ba7(0x9d),_0x449b73[_0x5ba7(0xb6)])?(console[_0x5ba7(0x17)](_0x449b73[_0x5ba7(0xb7)],_0x340a2f),_0x2f19e6=_0x340a2f):_0x108c42[_0x5ba7(0x1b)](_0x5ba7(0x11),_0x42c147));_0x449b73[_0x5ba7(0xb5)](!_0x314248,_0x525f45)&&(_0x449b73[_0x5ba7(0xb8)](_0x449b73[_0x5ba7(0xb9)],_0x5ba7(0x9f))?_0x330f94[_0x5ba7(0x1b)](_0x449b73[_0x5ba7(0xba)],_0x39bc4a):(console[_0x5ba7(0x17)](_0x449b73[_0x5ba7(0xbb)],_0x525f45),_0x314248=_0x525f45));console[_0x5ba7(0x17)](_0x449b73[_0x5ba7(0xbc)],{'userEmail':_0x2f19e6,'userId':_0x314248,'willTryEmail':!!_0x2f19e6,'willTryUserId':!!_0x314248});if(_0x2f19e6){if(_0x449b73[_0x5ba7(0xbd)](_0x5ba7(0xa2),_0x449b73[_0x5ba7(0xbe)])){console[_0x5ba7(0x17)](_0x449b73[_0x5ba7(0xbf)],_0x2f19e6);const _0x1cfc84=await _0x449b73['QBieZ'](getUserConnectionsByUsername,_0x2f19e6);if(_0x1cfc84[_0x5ba7(0x28)]>0x0)return console[_0x5ba7(0x17)](_0x449b73[_0x5ba7(0xc0)],_0x1cfc84[_0x5ba7(0x28)]),_0x1cfc84;console['log'](_0x449b73[_0x5ba7(0xc1)]);}else return _0x1be66b[_0x5ba7(0x17)](_0x449b73[_0x5ba7(0xc2)],_0x4e3135),_0x46546d[_0x5ba7(0x17)](_0x449b73['NXBJR'],_0x10ae5f['stringify'](_0xc58ac8,_0x4a1ba6[_0x5ba7(0x84)](_0x5ce38e))),[];}if(_0x314248){console['log'](_0x449b73[_0x5ba7(0xc3)],_0x314248);const _0x3e2b01=await _0x449b73['DrGZh'](getUserConnectionsByUserId,_0x314248);if(_0x449b73[_0x5ba7(0xc4)](_0x3e2b01[_0x5ba7(0x28)],0x0))return console[_0x5ba7(0x17)](_0x449b73[_0x5ba7(0xc5)],_0x3e2b01[_0x5ba7(0x28)]),_0x3e2b01;console[_0x5ba7(0x17)](_0x449b73[_0x5ba7(0xc6)]);}return console['log'](_0x449b73[_0x5ba7(0xc7)]),[];}catch(_0x27bbba){if(_0x449b73[_0x5ba7(0xb1)](_0x449b73[_0x5ba7(0xc8)],_0x5ba7(0xc9)))_0x49f9e1['log'](_0x5ba7(0x12));else return console[_0x5ba7(0x17)](_0x449b73['nCNxA'],_0x27bbba),[];}};exports['getUserConnections']=getUserConnections;const uploadProfilePicture=async(_0x50a4f7,_0x407744)=>{const _0x275dd2={'arNZo':_0x5ba7(0xca)};return console[_0x5ba7(0x1b)]('â ī¸\x20[DEPRECATED]\x20uploadProfilePicture\x20has\x20been\x20removed\x20from\x20SDK'),console[_0x5ba7(0x1b)]('âšī¸\x20Consuming\x20apps\x20should\x20call\x20/enoch/users/{id}/profile-picture/base64\x20directly'),{'success':![],'error':_0x275dd2[_0x5ba7(0xcb)]};};exports[_0x5ba7(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
|