@onairos/react-native 3.7.2 → 3.7.4

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.
Files changed (237) hide show
  1. package/lib/commonjs/api/index.js +219 -9
  2. package/lib/commonjs/components/BodyText.js +27 -9
  3. package/lib/commonjs/components/BrandMark.js +111 -10
  4. package/lib/commonjs/components/CodeInput.js +120 -9
  5. package/lib/commonjs/components/EmailInput.js +30 -8
  6. package/lib/commonjs/components/GoogleButton.js +56 -9
  7. package/lib/commonjs/components/HeadingGroup.js +43 -9
  8. package/lib/commonjs/components/LLMDataInputModal.js +664 -14
  9. package/lib/commonjs/components/ModalHeader.js +99 -9
  10. package/lib/commonjs/components/ModalSheet.js +47 -9
  11. package/lib/commonjs/components/Onairos.js +380 -14
  12. package/lib/commonjs/components/OnairosButton.js +313 -13
  13. package/lib/commonjs/components/OnairosSignInButton.js +130 -12
  14. package/lib/commonjs/components/Overlay.js +465 -13
  15. package/lib/commonjs/components/PersonaImage.js +137 -10
  16. package/lib/commonjs/components/PersonaLoadingScreen.js +318 -12
  17. package/lib/commonjs/components/PersonalizationConsentScreen.js +467 -13
  18. package/lib/commonjs/components/PinCreationScreen.js +403 -12
  19. package/lib/commonjs/components/PinInput.js +464 -9
  20. package/lib/commonjs/components/PlatformConnectorsStep.js +1311 -23
  21. package/lib/commonjs/components/PlatformList.js +137 -10
  22. package/lib/commonjs/components/PlatformToggle.js +180 -9
  23. package/lib/commonjs/components/PrimaryButton.js +180 -10
  24. package/lib/commonjs/components/SignInMatchAnimation.js +197 -9
  25. package/lib/commonjs/components/SignInStep.js +345 -12
  26. package/lib/commonjs/components/UniversalOnboarding.js +2780 -30
  27. package/lib/commonjs/components/VerificationStep.js +176 -11
  28. package/lib/commonjs/components/WelcomeScreen.js +461 -22
  29. package/lib/commonjs/components/icons/Basicproficon.js +37 -8
  30. package/lib/commonjs/components/icons/Basicprofile.js +21 -8
  31. package/lib/commonjs/components/icons/Checkbox.js +21 -8
  32. package/lib/commonjs/components/icons/Checkmark.js +27 -8
  33. package/lib/commonjs/components/icons/Contentanalysis.js +21 -8
  34. package/lib/commonjs/components/icons/Contenticon.js +39 -8
  35. package/lib/commonjs/components/icons/EnochE.js +41 -8
  36. package/lib/commonjs/components/icons/Personalityicon.js +30 -8
  37. package/lib/commonjs/components/icons/Personalityprofile.js +21 -8
  38. package/lib/commonjs/components/icons/Personalitytraits.js +21 -8
  39. package/lib/commonjs/components/icons/Userpreferences.js +21 -8
  40. package/lib/commonjs/components/icons/index.js +84 -17
  41. package/lib/commonjs/components/onboarding/OAuthWebView.js +1754 -18
  42. package/lib/commonjs/components/onboarding/OnboardingHeader.js +74 -10
  43. package/lib/commonjs/components/onboarding/PinInput.js +283 -10
  44. package/lib/commonjs/components/onboarding/PlatformConnector.js +249 -11
  45. package/lib/commonjs/config/PLATFORM_APIS.md +849 -0
  46. package/lib/commonjs/config/api.js +56 -7
  47. package/lib/commonjs/constants/index.js +120 -7
  48. package/lib/commonjs/context/AuthContext.js +345 -10
  49. package/lib/commonjs/hooks/useConnectedAccounts.js +111 -9
  50. package/lib/commonjs/hooks/useConnections.js +102 -8
  51. package/lib/commonjs/hooks/useCredentials.js +178 -10
  52. package/lib/commonjs/hooks/useUserConnections.js +148 -10
  53. package/lib/commonjs/index.js +439 -34
  54. package/lib/commonjs/services/apiClient.js +298 -8
  55. package/lib/commonjs/services/biometricPinService.js +180 -8
  56. package/lib/commonjs/services/chatGPTConversationExtractor.js +155 -8
  57. package/lib/commonjs/services/chatGPTConversationService.js +275 -9
  58. package/lib/commonjs/services/claudeConversationExtractor.js +103 -8
  59. package/lib/commonjs/services/claudeConversationService.js +158 -9
  60. package/lib/commonjs/services/connectedAccountsService.js +310 -10
  61. package/lib/commonjs/services/googleAuthService.js +252 -11
  62. package/lib/commonjs/services/hingeDataExtractor.js +105 -8
  63. package/lib/commonjs/services/hingeDataService.js +150 -9
  64. package/lib/commonjs/services/imageCompressionService.js +260 -7
  65. package/lib/commonjs/services/instagramDataExtractor.js +126 -8
  66. package/lib/commonjs/services/instagramDataService.js +163 -9
  67. package/lib/commonjs/services/jwtStorageService.js +276 -7
  68. package/lib/commonjs/services/linkedinDOMExtractor.js +245 -7
  69. package/lib/commonjs/services/linkedinProfileService.js +222 -9
  70. package/lib/commonjs/services/linkedinScrapingService.js +230 -8
  71. package/lib/commonjs/services/llmDataStorage.js +294 -8
  72. package/lib/commonjs/services/mobileTrainingService.js +186 -8
  73. package/lib/commonjs/services/netflixDataExtractor.js +120 -8
  74. package/lib/commonjs/services/netflixDataService.js +198 -9
  75. package/lib/commonjs/services/pinEncryptionService.js +84 -8
  76. package/lib/commonjs/services/pinStorageUtils.js +105 -7
  77. package/lib/commonjs/services/platformAuthService.js +1484 -12
  78. package/lib/commonjs/services/sephoraDataExtractor.js +140 -8
  79. package/lib/commonjs/services/sephoraDataService.js +200 -9
  80. package/lib/commonjs/services/spotifyDataExtractor.js +148 -8
  81. package/lib/commonjs/services/spotifyDataService.js +241 -9
  82. package/lib/commonjs/services/storageService.js +404 -8
  83. package/lib/commonjs/services/telegramDataExtractor.js +115 -8
  84. package/lib/commonjs/services/telegramDataService.js +499 -9
  85. package/lib/commonjs/services/trainingApiHelpers.js +73 -7
  86. package/lib/commonjs/services/userConnectionsService.js +340 -10
  87. package/lib/commonjs/services/youtubeMigrationService.js +416 -10
  88. package/lib/commonjs/theme/index.js +250 -7
  89. package/lib/commonjs/types/ambient.d.js +2 -1
  90. package/lib/commonjs/types/declarations.d.js +2 -1
  91. package/lib/commonjs/types/index.js +6 -1
  92. package/lib/commonjs/types/node-fix.d.js +2 -1
  93. package/lib/commonjs/types/node-override.d.js +2 -1
  94. package/lib/commonjs/types/opacity.d.js +2 -1
  95. package/lib/commonjs/types.js +14 -1
  96. package/lib/commonjs/utils/Portal.js +98 -8
  97. package/lib/commonjs/utils/api.js +130 -9
  98. package/lib/commonjs/utils/assetRegistry.js +210 -35
  99. package/lib/commonjs/utils/auth.js +112 -9
  100. package/lib/commonjs/utils/connectorTests.js +613 -29
  101. package/lib/commonjs/utils/crypto.js +62 -8
  102. package/lib/commonjs/utils/debugHelper.js +64 -1
  103. package/lib/commonjs/utils/encryption.js +76 -7
  104. package/lib/commonjs/utils/eventUtils.js +288 -1
  105. package/lib/commonjs/utils/haptics.js +66 -9
  106. package/lib/commonjs/utils/imagePreloader.js +6 -1
  107. package/lib/commonjs/utils/networkDiagnostics.js +226 -8
  108. package/lib/commonjs/utils/onairosApi.js +350 -9
  109. package/lib/commonjs/utils/programmaticFlow.js +117 -9
  110. package/lib/commonjs/utils/retryHelper.js +220 -1
  111. package/lib/commonjs/utils/secureStorage.js +349 -10
  112. package/lib/commonjs/utils/webviewScripts/chatgpt.js +551 -1
  113. package/lib/commonjs/utils/webviewScripts/claude.js +376 -1
  114. package/lib/commonjs/utils/webviewScripts/hinge.js +411 -1
  115. package/lib/commonjs/utils/webviewScripts/index.js +698 -15
  116. package/lib/commonjs/utils/webviewScripts/instagram.js +454 -1
  117. package/lib/commonjs/utils/webviewScripts/linkedin.js +880 -1
  118. package/lib/commonjs/utils/webviewScripts/netflix.js +382 -1
  119. package/lib/commonjs/utils/webviewScripts/sephora.js +516 -1
  120. package/lib/commonjs/utils/webviewScripts/spotify.js +419 -1
  121. package/lib/commonjs/utils/webviewScripts/telegram.js +678 -1
  122. package/lib/module/api/index.js +211 -1
  123. package/lib/module/components/BodyText.js +20 -1
  124. package/lib/module/components/BrandMark.js +104 -1
  125. package/lib/module/components/CodeInput.js +113 -1
  126. package/lib/module/components/EmailInput.js +23 -1
  127. package/lib/module/components/GoogleButton.js +49 -1
  128. package/lib/module/components/HeadingGroup.js +36 -1
  129. package/lib/module/components/LLMDataInputModal.js +656 -7
  130. package/lib/module/components/ModalHeader.js +92 -1
  131. package/lib/module/components/ModalSheet.js +39 -1
  132. package/lib/module/components/Onairos.js +373 -1
  133. package/lib/module/components/OnairosButton.js +305 -1
  134. package/lib/module/components/OnairosSignInButton.js +121 -1
  135. package/lib/module/components/Overlay.js +456 -1
  136. package/lib/module/components/PersonaImage.js +129 -1
  137. package/lib/module/components/PersonaLoadingScreen.js +310 -1
  138. package/lib/module/components/PersonalizationConsentScreen.js +460 -1
  139. package/lib/module/components/PinCreationScreen.js +396 -1
  140. package/lib/module/components/PinInput.js +456 -1
  141. package/lib/module/components/PlatformConnectorsStep.js +1302 -6
  142. package/lib/module/components/PlatformList.js +129 -1
  143. package/lib/module/components/PlatformToggle.js +173 -1
  144. package/lib/module/components/PrimaryButton.js +172 -1
  145. package/lib/module/components/SignInMatchAnimation.js +189 -1
  146. package/lib/module/components/SignInStep.js +338 -1
  147. package/lib/module/components/UniversalOnboarding.js +2770 -1
  148. package/lib/module/components/VerificationStep.js +168 -1
  149. package/lib/module/components/WelcomeScreen.js +453 -1
  150. package/lib/module/components/icons/Basicproficon.js +30 -1
  151. package/lib/module/components/icons/Basicprofile.js +14 -1
  152. package/lib/module/components/icons/Checkbox.js +14 -1
  153. package/lib/module/components/icons/Checkmark.js +20 -1
  154. package/lib/module/components/icons/Contentanalysis.js +14 -1
  155. package/lib/module/components/icons/Contenticon.js +32 -1
  156. package/lib/module/components/icons/EnochE.js +34 -1
  157. package/lib/module/components/icons/Personalityicon.js +23 -1
  158. package/lib/module/components/icons/Personalityprofile.js +14 -1
  159. package/lib/module/components/icons/Personalitytraits.js +14 -1
  160. package/lib/module/components/icons/Userpreferences.js +14 -1
  161. package/lib/module/components/icons/index.js +13 -1
  162. package/lib/module/components/onboarding/OAuthWebView.js +1746 -1
  163. package/lib/module/components/onboarding/OnboardingHeader.js +66 -1
  164. package/lib/module/components/onboarding/PinInput.js +274 -1
  165. package/lib/module/components/onboarding/PlatformConnector.js +240 -1
  166. package/lib/module/config/PLATFORM_APIS.md +849 -0
  167. package/lib/module/config/api.js +47 -1
  168. package/lib/module/constants/index.js +114 -1
  169. package/lib/module/context/AuthContext.js +335 -1
  170. package/lib/module/hooks/useConnectedAccounts.js +106 -1
  171. package/lib/module/hooks/useConnections.js +95 -1
  172. package/lib/module/hooks/useCredentials.js +171 -6
  173. package/lib/module/hooks/useUserConnections.js +140 -1
  174. package/lib/module/index.js +172 -1
  175. package/lib/module/services/apiClient.js +295 -1
  176. package/lib/module/services/biometricPinService.js +169 -1
  177. package/lib/module/services/chatGPTConversationExtractor.js +149 -1
  178. package/lib/module/services/chatGPTConversationService.js +268 -1
  179. package/lib/module/services/claudeConversationExtractor.js +97 -1
  180. package/lib/module/services/claudeConversationService.js +151 -1
  181. package/lib/module/services/connectedAccountsService.js +293 -1
  182. package/lib/module/services/googleAuthService.js +241 -1
  183. package/lib/module/services/hingeDataExtractor.js +99 -1
  184. package/lib/module/services/hingeDataService.js +143 -1
  185. package/lib/module/services/imageCompressionService.js +250 -1
  186. package/lib/module/services/instagramDataExtractor.js +120 -1
  187. package/lib/module/services/instagramDataService.js +156 -1
  188. package/lib/module/services/jwtStorageService.js +257 -1
  189. package/lib/module/services/linkedinDOMExtractor.js +234 -1
  190. package/lib/module/services/linkedinProfileService.js +210 -1
  191. package/lib/module/services/linkedinScrapingService.js +219 -1
  192. package/lib/module/services/llmDataStorage.js +277 -1
  193. package/lib/module/services/mobileTrainingService.js +173 -1
  194. package/lib/module/services/netflixDataExtractor.js +114 -1
  195. package/lib/module/services/netflixDataService.js +191 -1
  196. package/lib/module/services/pinEncryptionService.js +74 -6
  197. package/lib/module/services/pinStorageUtils.js +93 -1
  198. package/lib/module/services/platformAuthService.js +1461 -1
  199. package/lib/module/services/sephoraDataExtractor.js +134 -1
  200. package/lib/module/services/sephoraDataService.js +193 -1
  201. package/lib/module/services/spotifyDataExtractor.js +142 -1
  202. package/lib/module/services/spotifyDataService.js +234 -1
  203. package/lib/module/services/storageService.js +383 -1
  204. package/lib/module/services/telegramDataExtractor.js +109 -1
  205. package/lib/module/services/telegramDataService.js +493 -1
  206. package/lib/module/services/trainingApiHelpers.js +67 -1
  207. package/lib/module/services/userConnectionsService.js +329 -1
  208. package/lib/module/services/youtubeMigrationService.js +405 -1
  209. package/lib/module/theme/index.js +245 -1
  210. package/lib/module/types.js +10 -1
  211. package/lib/module/utils/Portal.js +90 -1
  212. package/lib/module/utils/api.js +118 -1
  213. package/lib/module/utils/assetRegistry.js +200 -34
  214. package/lib/module/utils/auth.js +100 -1
  215. package/lib/module/utils/connectorTests.js +600 -27
  216. package/lib/module/utils/crypto.js +54 -1
  217. package/lib/module/utils/debugHelper.js +54 -1
  218. package/lib/module/utils/encryption.js +67 -1
  219. package/lib/module/utils/eventUtils.js +270 -1
  220. package/lib/module/utils/haptics.js +59 -8
  221. package/lib/module/utils/imagePreloader.js +3 -1
  222. package/lib/module/utils/networkDiagnostics.js +217 -1
  223. package/lib/module/utils/onairosApi.js +333 -1
  224. package/lib/module/utils/programmaticFlow.js +111 -1
  225. package/lib/module/utils/retryHelper.js +211 -1
  226. package/lib/module/utils/secureStorage.js +330 -6
  227. package/lib/module/utils/webviewScripts/chatgpt.js +545 -1
  228. package/lib/module/utils/webviewScripts/claude.js +370 -1
  229. package/lib/module/utils/webviewScripts/hinge.js +405 -1
  230. package/lib/module/utils/webviewScripts/index.js +434 -1
  231. package/lib/module/utils/webviewScripts/instagram.js +448 -1
  232. package/lib/module/utils/webviewScripts/linkedin.js +874 -1
  233. package/lib/module/utils/webviewScripts/netflix.js +376 -1
  234. package/lib/module/utils/webviewScripts/sephora.js +510 -1
  235. package/lib/module/utils/webviewScripts/spotify.js +413 -1
  236. package/lib/module/utils/webviewScripts/telegram.js +672 -1
  237. package/package.json +2 -2
@@ -1 +1,219 @@
1
- import{getUserAuthHeaders,getApiHeaders}from'../config/api';import{API_CONFIG}from'../config/api';import{getUserIdFromToken}from'./jwtStorageService';export const scrapeLinkedInProfile=async(_0xf7bc0a,_0xd5f8db)=>{const _0x542280={'grcnM':_0x28f8(0x0),'dhRZd':'🔍\x20[LINKEDIN\x20SCRAPE]\x20Passed\x20User\x20ID:','DigjM':_0x28f8(0x1),'HmPme':function(_0x34f8fb,_0x7971c1){return _0x34f8fb||_0x7971c1;},'mdDxT':'🔍\x20[LINKEDIN\x20SCRAPE]\x20JWT\x20userId:','llSNo':_0x28f8(0x2),'jQcyH':function(_0x47eb8b,_0x2b930a){return _0x47eb8b(_0x2b930a);},'OCMjO':_0x28f8(0x3),'VifeL':_0x28f8(0x4),'bEtVA':function(_0x13158d,_0xcadf5e){return _0x13158d===_0xcadf5e;},'zfgaE':_0x28f8(0x5),'nmujB':_0x28f8(0x6),'NJHhR':_0x28f8(0x7),'tDJKb':function(_0x3643f1){return _0x3643f1();},'bZRhy':function(_0x20bce1,_0xd2849b,_0x4c9ffe){return _0x20bce1(_0xd2849b,_0x4c9ffe);},'CQhyt':function(_0x4da561,_0x59f5f3){return _0x4da561!==_0x59f5f3;},'UjeHi':_0x28f8(0x8),'Kjslt':'❌\x20[LINKEDIN\x20SCRAPE]\x20Failed:','ZwTEb':_0x28f8(0x9),'LbHIK':function(_0x23414e,_0x18bbcc){return _0x23414e===_0x18bbcc;},'IYrEi':function(_0x2a9378,_0x184675){return _0x2a9378===_0x184675;},'wfpuq':function(_0x21e856,_0x5b3aed){return _0x21e856===_0x5b3aed;},'fHIeJ':function(_0x29da4b,_0x2440c6){return _0x29da4b===_0x2440c6;},'GYfIU':function(_0x4458b3,_0x2c3349){return _0x4458b3===_0x2c3349;},'RWhIK':function(_0x32035f,_0x4d3e91){return _0x32035f===_0x4d3e91;},'jMksp':function(_0x4e628b,_0x39e627){return _0x4e628b===_0x39e627;},'YQBoh':_0x28f8(0xa),'KCpNG':function(_0x15cc9a,_0x12491d){return _0x15cc9a instanceof _0x12491d;},'hJGkd':_0x28f8(0xb)};try{var _0xa5171e,_0x259f6a,_0x3ed782,_0x242319,_0x575d7c;console[_0x28f8(0xc)](_0x28f8(0xd)),console[_0x28f8(0xc)](_0x542280[_0x28f8(0xe)],_0xf7bc0a),console[_0x28f8(0xc)](_0x542280[_0x28f8(0xf)],_0xd5f8db);const _0x459bb8=await getUserIdFromToken(),_0x22a81a=_0x542280[_0x28f8(0x10)](_0x459bb8,_0xf7bc0a);console[_0x28f8(0xc)](_0x542280['mdDxT'],_0x459bb8),console['log'](_0x542280[_0x28f8(0x11)],_0x22a81a);if(!_0x542280[_0x28f8(0x12)](isValidLinkedInUrl,_0xd5f8db))return console[_0x28f8(0x13)](_0x542280[_0x28f8(0x14)]),{'success':![],'error':_0x542280['VifeL']};let _0x1e6333;try{if(_0x542280[_0x28f8(0x15)](_0x542280[_0x28f8(0x16)],_0x28f8(0x5)))_0x1e6333=await getUserAuthHeaders(),console[_0x28f8(0xc)](_0x542280[_0x28f8(0x17)]);else return _0x3fc507;}catch(_0x33e847){console['warn'](_0x542280[_0x28f8(0x18)],_0x33e847),_0x1e6333=_0x542280['tDJKb'](getApiHeaders);}const _0x11bf2f=await _0x542280[_0x28f8(0x19)](fetch,API_CONFIG[_0x28f8(0x1a)]+_0x28f8(0x1b),{'method':'POST','headers':_0x1e6333,'body':JSON[_0x28f8(0x1c)]({'userId':_0x22a81a,'profileUrl':_0xd5f8db})});if(!_0x11bf2f['ok']){if(_0x542280[_0x28f8(0x1d)](_0x542280['UjeHi'],_0x542280['UjeHi']))return _0x5a990a[_0x28f8(0x13)](_0x542280[_0x28f8(0x1e)],_0x189a7a),![];else{const _0x3581ad=await _0x11bf2f[_0x28f8(0x1f)]();console[_0x28f8(0x13)](_0x542280['Kjslt'],_0x11bf2f['status'],_0x3581ad);let _0x2860b8='Scraping\x20failed:\x20'+_0x11bf2f['status'];try{const _0x5e5741=JSON[_0x28f8(0x20)](_0x3581ad);_0x2860b8=_0x5e5741[_0x28f8(0x13)]||_0x5e5741[_0x28f8(0x21)]||_0x2860b8;}catch{}return{'success':![],'error':_0x2860b8};}}const _0x473159=await _0x11bf2f[_0x28f8(0x22)]();return console[_0x28f8(0xc)](_0x28f8(0x23)),console[_0x28f8(0xc)](_0x542280[_0x28f8(0x24)],{'name':(_0xa5171e=_0x473159[_0x28f8(0x25)])===null||_0x542280[_0x28f8(0x15)](_0xa5171e,void 0x0)?void 0x0:_0xa5171e[_0x28f8(0x26)],'headline':_0x542280[_0x28f8(0x15)](_0x259f6a=_0x473159['profileData'],null)||_0x542280[_0x28f8(0x27)](_0x259f6a,void 0x0)?void 0x0:_0x259f6a['headline'],'experienceCount':((_0x3ed782=_0x473159['profileData'])===null||_0x542280[_0x28f8(0x28)](_0x3ed782,void 0x0)||_0x542280[_0x28f8(0x29)](_0x3ed782=_0x3ed782[_0x28f8(0x2a)],null)||_0x542280[_0x28f8(0x29)](_0x3ed782,void 0x0)?void 0x0:_0x3ed782[_0x28f8(0x2b)])||0x0,'educationCount':(_0x542280['wfpuq'](_0x242319=_0x473159[_0x28f8(0x25)],null)||_0x542280['fHIeJ'](_0x242319,void 0x0)||_0x542280['fHIeJ'](_0x242319=_0x242319[_0x28f8(0x2c)],null)||_0x542280['GYfIU'](_0x242319,void 0x0)?void 0x0:_0x242319[_0x28f8(0x2b)])||0x0,'skillsCount':(_0x542280[_0x28f8(0x2d)](_0x575d7c=_0x473159[_0x28f8(0x25)],null)||_0x542280['bEtVA'](_0x575d7c,void 0x0)||(_0x575d7c=_0x575d7c[_0x28f8(0x2e)])===null||_0x542280[_0x28f8(0x2f)](_0x575d7c,void 0x0)?void 0x0:_0x575d7c['length'])||0x0}),{'success':!![],'data':_0x473159[_0x28f8(0x25)],'message':_0x28f8(0x30)};}catch(_0x397b99){return console['error'](_0x542280[_0x28f8(0x31)],_0x397b99),{'success':![],'error':_0x542280[_0x28f8(0x32)](_0x397b99,Error)?_0x397b99[_0x28f8(0x21)]:_0x542280[_0x28f8(0x33)]};}};export const extractLinkedInUsername=_0x18b622=>{const _0x476135={'Lmhko':_0x28f8(0x7),'NXpvL':function(_0x386ae6){return _0x386ae6();},'yFlQe':function(_0x17c7ec,_0x26ca31){return _0x17c7ec!==_0x26ca31;},'jxPiY':function(_0x23fc2e,_0x54dcb5){return _0x23fc2e===_0x54dcb5;},'YcKXc':_0x28f8(0x34),'kakSF':_0x28f8(0x35),'TnQOS':'❌\x20[LINKEDIN]\x20Error\x20extracting\x20username:'};try{if(_0x476135[_0x28f8(0x36)](_0x28f8(0x37),_0x28f8(0x38))){const _0x255792=_0x18b622[_0x28f8(0x39)](/linkedin\.com\/in\/([^\/\?#]+)/);return _0x255792?_0x255792[0x1]:null;}else _0x4a1bc1[_0x28f8(0x3a)](_0x476135[_0x28f8(0x3b)],_0x1482f0),_0x28caa5=_0x476135[_0x28f8(0x3c)](_0x1dc472);}catch(_0x4f23f6){return _0x476135['jxPiY'](_0x476135['YcKXc'],_0x476135[_0x28f8(0x3d)])?_0x28f8(0x3e)+_0x21a995:(console[_0x28f8(0x13)](_0x476135[_0x28f8(0x3f)],_0x4f23f6),null);}};export const isValidLinkedInUrl=_0x573252=>{const _0x1090aa={'SKeZZ':_0x28f8(0x40),'OpMFa':_0x28f8(0x41),'PJYZo':function(_0x1fd9b7,_0x45e1cf){return _0x1fd9b7===_0x45e1cf;},'fvNOd':_0x28f8(0x42),'SyDcU':function(_0x2b0b6a,_0x107c29){return _0x2b0b6a(_0x107c29);},'exDDD':function(_0x91dabc,_0x374f5e){return _0x91dabc!==_0x374f5e;}};if(!_0x573252||typeof _0x573252!==_0x1090aa[_0x28f8(0x43)])return![];const _0x56b25f=/linkedin\.com\/in\/[^\/\?#]+/['test'](_0x573252);if(!_0x56b25f){if(_0x1090aa[_0x28f8(0x44)](_0x28f8(0x42),_0x1090aa[_0x28f8(0x45)]))return![];else try{const _0xe22536=_0x65d196['match'](/linkedin\.com\/in\/([^\/\?#]+)/);return _0xe22536?_0xe22536[0x1]:null;}catch(_0x10e0f7){return _0x572b54[_0x28f8(0x13)](_0x1090aa[_0x28f8(0x46)],_0x10e0f7),null;}}const _0x592a81=_0x1090aa[_0x28f8(0x47)](extractLinkedInUsername,_0x573252);return _0x1090aa[_0x28f8(0x48)](_0x592a81,null)&&_0x592a81[_0x28f8(0x2b)]>0x0;};function _0x28f8(_0x4fda7b,_0x28f8cb){_0x4fda7b=_0x4fda7b-0x0;const _0x41a052=_0x4fda();let _0x5a7a3d=_0x41a052[_0x4fda7b];return _0x5a7a3d;}export const formatLinkedInUrl=_0x3a77f9=>{const _0x420d54={'OqJMi':_0x28f8(0xa),'WZOvd':'http://','OxeZK':_0x28f8(0x49),'QrjuL':'/in/','wjVTa':function(_0x212d23,_0x59b401){return _0x212d23===_0x59b401;},'aCyDN':_0x28f8(0x4a)};if(_0x3a77f9[_0x28f8(0x4b)](_0x420d54[_0x28f8(0x4c)])||_0x3a77f9[_0x28f8(0x4b)](_0x28f8(0x4d)))return _0x3a77f9;if(!_0x3a77f9[_0x28f8(0x4e)]('/'))return _0x28f8(0x4f)+_0x3a77f9;if(_0x3a77f9[_0x28f8(0x4b)](_0x420d54[_0x28f8(0x50)]))return _0x28f8(0x4d)+_0x3a77f9;if(_0x3a77f9['startsWith'](_0x420d54['QrjuL']))return _0x420d54[_0x28f8(0x51)](_0x420d54['aCyDN'],_0x420d54[_0x28f8(0x52)])?'https://linkedin.com'+_0x3a77f9:(_0x41183a['error'](_0x420d54['OqJMi'],_0x273a47),{'success':![],'error':_0x8e630 instanceof _0x19e12e?_0x5dde3f[_0x28f8(0x21)]:_0x28f8(0xb)});return _0x28f8(0x4f)+_0x3a77f9;};function _0x4fda(){const _0x38b3ca=['❌\x20[LINKEDIN]\x20Error\x20checking\x20scrape\x20availability:','🔍\x20[LINKEDIN\x20SCRAPE]\x20Profile\x20URL:','🔍\x20[LINKEDIN\x20SCRAPE]\x20Effective\x20userId\x20(will\x20use):','❌\x20[LINKEDIN\x20SCRAPE]\x20Invalid\x20LinkedIn\x20URL','Invalid\x20LinkedIn\x20profile\x20URL.\x20Please\x20use\x20format:\x20https://linkedin.com/in/username','gctmF','🔑\x20[LINKEDIN\x20SCRAPE]\x20Using\x20authenticated\x20user\x20headers','⚠️\x20[LINKEDIN\x20SCRAPE]\x20No\x20user\x20auth\x20available,\x20using\x20basic\x20headers:','WcJxM','📊\x20[LINKEDIN\x20SCRAPE]\x20Data\x20preview:','❌\x20[LINKEDIN\x20SCRAPE]\x20Error:','Unknown\x20error\x20occurred\x20during\x20scraping','log','🔍\x20[LINKEDIN\x20SCRAPE]\x20Starting\x20profile\x20scrape...','dhRZd','DigjM','HmPme','llSNo','jQcyH','error','OCMjO','bEtVA','zfgaE','nmujB','NJHhR','bZRhy','BASE_URL','/enoch/linkedin-scrape/scrape-profile','stringify','CQhyt','grcnM','text','parse','message','json','✅\x20[LINKEDIN\x20SCRAPE]\x20Profile\x20scraped\x20successfully','ZwTEb','profileData','fullName','LbHIK','IYrEi','wfpuq','experience','length','education','RWhIK','skills','jMksp','Profile\x20scraped\x20successfully','YQBoh','KCpNG','hJGkd','PNdna','oubFe','yFlQe','yIQHQ','lYUHu','match','warn','Lmhko','NXpvL','kakSF','https://linkedin.com','TnQOS','❌\x20[LINKEDIN]\x20Error\x20extracting\x20username:','string','liquq','OpMFa','PJYZo','fvNOd','SKeZZ','SyDcU','exDDD','linkedin.com/in/','jItlK','startsWith','WZOvd','https://','includes','https://linkedin.com/in/','OxeZK','wjVTa','aCyDN','jtBfm','HfamJ','CVxbo','lNiyR','jxLGj','leuMP','fforM','/user/','/connections','kZDeQ','MmPUS','Lwfkt','LinkedIn','DnJxe','wkTIt','aRxhE','CODpl','BeVVL','RHjdb','liFFK','dBiby','XNJHm','gaCwO','UsSFn','ayuhH','/enoch/linkedin-scrape/scrape-profile/','rSOjJ','❌\x20[LINKEDIN]\x20Error\x20getting\x20connection\x20status:'];_0x4fda=function(){return _0x38b3ca;};return _0x4fda();}export const canScrapeProfile=async _0x17aff3=>{const _0xcdd2c9={'CVxbo':function(_0x4d4855,_0x2f4b50){return _0x4d4855===_0x2f4b50;},'lNiyR':_0x28f8(0x53),'jxLGj':function(_0x36d966){return _0x36d966();},'leuMP':function(_0x14e2bc){return _0x14e2bc();},'fforM':function(_0x398190,_0x6f098,_0x52b010){return _0x398190(_0x6f098,_0x52b010);},'kZDeQ':function(_0x73bb75,_0x165a4){return _0x73bb75===_0x165a4;},'MmPUS':_0x28f8(0x54),'Lwfkt':function(_0x17163a,_0x4a48af){return _0x17163a!==_0x4a48af;},'DnJxe':_0x28f8(0x0)};try{if(_0xcdd2c9[_0x28f8(0x55)]('uCHzA',_0xcdd2c9[_0x28f8(0x56)]))return _0x28f8(0x4f)+_0x5d7165;else{let _0x4f785f;try{_0x4f785f=await _0xcdd2c9[_0x28f8(0x57)](getUserAuthHeaders);}catch{_0x4f785f=_0xcdd2c9[_0x28f8(0x58)](getApiHeaders);}const _0x4b3437=await _0xcdd2c9[_0x28f8(0x59)](fetch,API_CONFIG[_0x28f8(0x1a)]+_0x28f8(0x5a)+_0x17aff3+_0x28f8(0x5b),{'headers':_0x4f785f});if(_0x4b3437['ok']){if(_0xcdd2c9[_0x28f8(0x5c)](_0xcdd2c9['MmPUS'],_0xcdd2c9[_0x28f8(0x5d)])){var _0x21bf05;const _0x528639=await _0x4b3437[_0x28f8(0x22)]();return _0xcdd2c9[_0x28f8(0x5e)](_0xcdd2c9[_0x28f8(0x5c)](_0x21bf05=_0x528639['connections'],null)||_0x21bf05===void 0x0?void 0x0:_0x21bf05[_0x28f8(0x5f)],undefined);}else return![];}return![];}}catch(_0x5eceac){return console[_0x28f8(0x13)](_0xcdd2c9[_0x28f8(0x60)],_0x5eceac),![];}};export const getLinkedInConnectionStatus=async _0x24ebcd=>{const _0x181061={'UsSFn':_0x28f8(0x40),'liFFK':_0x28f8(0x61),'dBiby':function(_0x5dcac3,_0x3bd695){return _0x5dcac3!==_0x3bd695;},'gaCwO':_0x28f8(0x62),'ayuhH':_0x28f8(0x63),'oDpua':function(_0x46882a){return _0x46882a();},'tycmv':function(_0x243540,_0x3e81ce){return _0x243540!==_0x3e81ce;},'CWNyf':_0x28f8(0x64),'rSOjJ':_0x28f8(0x65)};try{if(_0x181061['liFFK']===_0x181061[_0x28f8(0x66)]){let _0x3e0e22;try{if(_0x181061[_0x28f8(0x67)](_0x28f8(0x68),_0x181061[_0x28f8(0x69)]))_0x3e0e22=await getUserAuthHeaders();else return _0x44b4fc[_0x28f8(0x13)](_0x181061[_0x28f8(0x6a)],_0x55ab34),null;}catch{if(_0x181061[_0x28f8(0x67)](_0x181061[_0x28f8(0x6b)],_0x181061[_0x28f8(0x6b)]))return![];else _0x3e0e22=_0x181061['oDpua'](getApiHeaders);}const _0x1f522d=await fetch(API_CONFIG['BASE_URL']+_0x28f8(0x6c)+_0x24ebcd,{'headers':_0x3e0e22});if(_0x1f522d['ok']){const _0x1b5198=await _0x1f522d['json']();return _0x1b5198;}return{'connected':![]};}else{const _0x151f20=_0x53a96b[_0x28f8(0x20)](_0x388b27);_0x242a77=_0x151f20[_0x28f8(0x13)]||_0x151f20[_0x28f8(0x21)]||_0x30b555;}}catch(_0x15b3fa){return _0x181061['tycmv'](_0x181061['CWNyf'],_0x181061[_0x28f8(0x6d)])?(console[_0x28f8(0x13)](_0x28f8(0x6e),_0x15b3fa),{'connected':![]}):_0x28f8(0x4d)+_0x40f97;}};
1
+ /**
2
+ * LinkedIn Profile Scraping Service
3
+ * Handles profile scraping after OAuth connection using Apify
4
+ */
5
+
6
+ import { getUserAuthHeaders, getApiHeaders } from '../config/api';
7
+ import { API_CONFIG } from '../config/api';
8
+ import { getUserIdFromToken } from './jwtStorageService';
9
+ /**
10
+ * Scrape LinkedIn profile after OAuth connection
11
+ * @param userId - User ID (username or email) - will be overridden by JWT userId if available
12
+ * @param profileUrl - LinkedIn profile URL (e.g., https://linkedin.com/in/username)
13
+ */
14
+ export const scrapeLinkedInProfile = async (userId, profileUrl) => {
15
+ try {
16
+ var _data$profileData, _data$profileData2, _data$profileData3, _data$profileData4, _data$profileData5;
17
+ console.log('🔍 [LINKEDIN SCRAPE] Starting profile scrape...');
18
+ console.log('🔍 [LINKEDIN SCRAPE] Passed User ID:', userId);
19
+ console.log('🔍 [LINKEDIN SCRAPE] Profile URL:', profileUrl);
20
+
21
+ // Get the actual userId (UUID) from JWT token - this is critical for correct user lookup
22
+ const jwtUserId = await getUserIdFromToken();
23
+ const effectiveUserId = jwtUserId || userId;
24
+ console.log('🔍 [LINKEDIN SCRAPE] JWT userId:', jwtUserId);
25
+ console.log('🔍 [LINKEDIN SCRAPE] Effective userId (will use):', effectiveUserId);
26
+
27
+ // Validate profile URL
28
+ if (!isValidLinkedInUrl(profileUrl)) {
29
+ console.error('❌ [LINKEDIN SCRAPE] Invalid LinkedIn URL');
30
+ return {
31
+ success: false,
32
+ error: 'Invalid LinkedIn profile URL. Please use format: https://linkedin.com/in/username'
33
+ };
34
+ }
35
+
36
+ // Get user-authenticated headers (includes JWT token)
37
+ let headers;
38
+ try {
39
+ headers = await getUserAuthHeaders();
40
+ console.log('🔑 [LINKEDIN SCRAPE] Using authenticated user headers');
41
+ } catch (authError) {
42
+ console.warn('⚠️ [LINKEDIN SCRAPE] No user auth available, using basic headers:', authError);
43
+ headers = getApiHeaders();
44
+ }
45
+ const response = await fetch(`${API_CONFIG.BASE_URL}/enoch/linkedin-scrape/scrape-profile`, {
46
+ method: 'POST',
47
+ headers,
48
+ body: JSON.stringify({
49
+ userId: effectiveUserId,
50
+ profileUrl: profileUrl
51
+ })
52
+ });
53
+ if (!response.ok) {
54
+ const errorText = await response.text();
55
+ console.error('❌ [LINKEDIN SCRAPE] Failed:', response.status, errorText);
56
+
57
+ // Parse error message if available
58
+ let errorMessage = `Scraping failed: ${response.status}`;
59
+ try {
60
+ const errorData = JSON.parse(errorText);
61
+ errorMessage = errorData.error || errorData.message || errorMessage;
62
+ } catch {
63
+ // Use default error message
64
+ }
65
+ return {
66
+ success: false,
67
+ error: errorMessage
68
+ };
69
+ }
70
+ const data = await response.json();
71
+ console.log('✅ [LINKEDIN SCRAPE] Profile scraped successfully');
72
+ console.log('📊 [LINKEDIN SCRAPE] Data preview:', {
73
+ name: (_data$profileData = data.profileData) === null || _data$profileData === void 0 ? void 0 : _data$profileData.fullName,
74
+ headline: (_data$profileData2 = data.profileData) === null || _data$profileData2 === void 0 ? void 0 : _data$profileData2.headline,
75
+ experienceCount: ((_data$profileData3 = data.profileData) === null || _data$profileData3 === void 0 || (_data$profileData3 = _data$profileData3.experience) === null || _data$profileData3 === void 0 ? void 0 : _data$profileData3.length) || 0,
76
+ educationCount: ((_data$profileData4 = data.profileData) === null || _data$profileData4 === void 0 || (_data$profileData4 = _data$profileData4.education) === null || _data$profileData4 === void 0 ? void 0 : _data$profileData4.length) || 0,
77
+ skillsCount: ((_data$profileData5 = data.profileData) === null || _data$profileData5 === void 0 || (_data$profileData5 = _data$profileData5.skills) === null || _data$profileData5 === void 0 ? void 0 : _data$profileData5.length) || 0
78
+ });
79
+ return {
80
+ success: true,
81
+ data: data.profileData,
82
+ message: 'Profile scraped successfully'
83
+ };
84
+ } catch (error) {
85
+ console.error('❌ [LINKEDIN SCRAPE] Error:', error);
86
+ return {
87
+ success: false,
88
+ error: error instanceof Error ? error.message : 'Unknown error occurred during scraping'
89
+ };
90
+ }
91
+ };
92
+
93
+ /**
94
+ * Extract LinkedIn username from profile URL
95
+ * @param url - LinkedIn profile URL
96
+ * @returns username or null if invalid
97
+ */
98
+ export const extractLinkedInUsername = url => {
99
+ try {
100
+ // Match various LinkedIn URL formats:
101
+ // - https://linkedin.com/in/username
102
+ // - https://www.linkedin.com/in/username/
103
+ // - linkedin.com/in/username
104
+ const match = url.match(/linkedin\.com\/in\/([^\/\?#]+)/);
105
+ return match ? match[1] : null;
106
+ } catch (error) {
107
+ console.error('❌ [LINKEDIN] Error extracting username:', error);
108
+ return null;
109
+ }
110
+ };
111
+
112
+ /**
113
+ * Validate LinkedIn profile URL
114
+ * @param url - URL to validate
115
+ * @returns true if valid LinkedIn profile URL
116
+ */
117
+ export const isValidLinkedInUrl = url => {
118
+ if (!url || typeof url !== 'string') {
119
+ return false;
120
+ }
121
+
122
+ // Check if URL contains linkedin.com/in/
123
+ const hasLinkedInPattern = /linkedin\.com\/in\/[^\/\?#]+/.test(url);
124
+ if (!hasLinkedInPattern) {
125
+ return false;
126
+ }
127
+
128
+ // Try to extract username
129
+ const username = extractLinkedInUsername(url);
130
+ return username !== null && username.length > 0;
131
+ };
132
+
133
+ /**
134
+ * Format LinkedIn URL (ensure proper format)
135
+ * @param url - URL or username
136
+ * @returns properly formatted LinkedIn URL
137
+ */
138
+ export const formatLinkedInUrl = url => {
139
+ // If it's already a full URL, return as is
140
+ if (url.startsWith('http://') || url.startsWith('https://')) {
141
+ return url;
142
+ }
143
+
144
+ // If it's just a username, construct URL
145
+ if (!url.includes('/')) {
146
+ return `https://linkedin.com/in/${url}`;
147
+ }
148
+
149
+ // If it's a partial path
150
+ if (url.startsWith('linkedin.com/in/')) {
151
+ return `https://${url}`;
152
+ }
153
+ if (url.startsWith('/in/')) {
154
+ return `https://linkedin.com${url}`;
155
+ }
156
+
157
+ // Default: assume it's a username
158
+ return `https://linkedin.com/in/${url}`;
159
+ };
160
+
161
+ /**
162
+ * Check if profile scraping is available for a user
163
+ * @param userId - User ID
164
+ */
165
+ export const canScrapeProfile = async userId => {
166
+ try {
167
+ // Check if user has LinkedIn connected
168
+ // This would typically query your backend
169
+ let headers;
170
+ try {
171
+ headers = await getUserAuthHeaders();
172
+ } catch {
173
+ headers = getApiHeaders();
174
+ }
175
+ const response = await fetch(`${API_CONFIG.BASE_URL}/user/${userId}/connections`, {
176
+ headers
177
+ });
178
+ if (response.ok) {
179
+ var _data$connections;
180
+ const data = await response.json();
181
+ return ((_data$connections = data.connections) === null || _data$connections === void 0 ? void 0 : _data$connections.LinkedIn) !== undefined;
182
+ }
183
+ return false;
184
+ } catch (error) {
185
+ console.error('❌ [LINKEDIN] Error checking scrape availability:', error);
186
+ return false;
187
+ }
188
+ };
189
+
190
+ /**
191
+ * Get LinkedIn connection status for a user
192
+ * @param userId - User ID
193
+ */
194
+ export const getLinkedInConnectionStatus = async userId => {
195
+ try {
196
+ let headers;
197
+ try {
198
+ headers = await getUserAuthHeaders();
199
+ } catch {
200
+ headers = getApiHeaders();
201
+ }
202
+ const response = await fetch(`${API_CONFIG.BASE_URL}/enoch/linkedin-scrape/scrape-profile/${userId}`, {
203
+ headers
204
+ });
205
+ if (response.ok) {
206
+ const data = await response.json();
207
+ return data;
208
+ }
209
+ return {
210
+ connected: false
211
+ };
212
+ } catch (error) {
213
+ console.error('❌ [LINKEDIN] Error getting connection status:', error);
214
+ return {
215
+ connected: false
216
+ };
217
+ }
218
+ };
219
+ //# sourceMappingURL=linkedinScrapingService.js.map
@@ -1 +1,277 @@
1
- import AsyncStorage from'@react-native-async-storage/async-storage';function _0x2284(_0x395ced,_0x22843e){_0x395ced=_0x395ced-0x0;const _0x27b72e=_0x395c();let _0x3b3824=_0x27b72e[_0x395ced];return _0x3b3824;}import{API_CONFIG}from'../config/api';const LLM_DATA_STORAGE_KEY=_0x2284(0x0),LLM_METADATA_STORAGE_KEY=_0x2284(0x1);export const storeLLMData=async _0x581777=>{const _0x562651={'WVvwF':_0x2284(0x2),'OOAIa':_0x2284(0x3)};try{console['log'](_0x2284(0x4)),await AsyncStorage[_0x2284(0x5)](LLM_DATA_STORAGE_KEY+':'+_0x581777[_0x2284(0x6)],JSON[_0x2284(0x7)](_0x581777));const _0xc112ee={'userId':_0x581777[_0x2284(0x6)],'email':_0x581777[_0x2284(0x8)],'appName':_0x581777[_0x2284(0x9)],'timestamp':_0x581777[_0x2284(0xa)],'hasData':!![],'dataSize':JSON['stringify'](_0x581777[_0x2284(0xb)])[_0x2284(0xc)],'connectionStatus':_0x562651[_0x2284(0xd)]};return await AsyncStorage['setItem'](LLM_METADATA_STORAGE_KEY+':'+_0x581777[_0x2284(0x6)],JSON['stringify'](_0xc112ee)),console[_0x2284(0xe)](_0x562651[_0x2284(0xf)]),console[_0x2284(0xe)](_0x2284(0x10)+_0xc112ee[_0x2284(0x11)]+_0x2284(0x12)),!![];}catch(_0x1ebea9){return console[_0x2284(0x13)](_0x2284(0x14),_0x1ebea9),![];}};export const getLLMData=async _0x4a0c23=>{const _0x35d7b1={'PvVGk':'❌\x20Failed\x20to\x20store\x20LLM\x20data:','ijJWY':function(_0x26d16a,_0x24e14d){return _0x26d16a===_0x24e14d;},'AygGq':'QqWpw','iqIlg':_0x2284(0x15),'tAxik':_0x2284(0x16)};try{const _0x53134d=await AsyncStorage[_0x2284(0x17)](LLM_DATA_STORAGE_KEY+':'+_0x4a0c23);if(!_0x53134d)return _0x35d7b1[_0x2284(0x18)](_0x35d7b1[_0x2284(0x19)],_0x35d7b1[_0x2284(0x19)])?(console[_0x2284(0xe)](_0x35d7b1['iqIlg'],_0x4a0c23),null):(_0x2f1ef1[_0x2284(0x13)](_0x35d7b1[_0x2284(0x1a)],_0x9f2ef4),![]);const _0x42a6e2=JSON[_0x2284(0x1b)](_0x53134d);return console[_0x2284(0xe)]('✅\x20Retrieved\x20LLM\x20data\x20for\x20user:',_0x4a0c23),_0x42a6e2;}catch(_0x48c0c4){return console[_0x2284(0x13)](_0x35d7b1[_0x2284(0x1c)],_0x48c0c4),null;}};export const getLLMMetadata=async _0x8e6919=>{const _0x477418={'AUiAV':_0x2284(0x1d),'DLuEH':_0x2284(0x1e),'DgNcm':function(_0xc9017b,_0x407a1d){return _0xc9017b!==_0x407a1d;},'svdlv':'SeECA','Sqvdo':_0x2284(0x1f),'LxnpR':_0x2284(0x20)};try{const _0x5a6364=await AsyncStorage[_0x2284(0x17)](LLM_METADATA_STORAGE_KEY+':'+_0x8e6919);if(!_0x5a6364)return _0x477418[_0x2284(0x21)](_0x477418[_0x2284(0x22)],_0x477418[_0x2284(0x22)])?(_0x2e98ca[_0x2284(0x13)](_0x477418['AUiAV'],_0x490bff),![]):null;return JSON[_0x2284(0x1b)](_0x5a6364);}catch(_0xac1b5c){return _0x477418[_0x2284(0x21)](_0x477418[_0x2284(0x23)],_0x477418[_0x2284(0x24)])?(console[_0x2284(0x13)](_0x2284(0x25),_0xac1b5c),null):(_0x11a2d0[_0x2284(0x26)](_0x477418[_0x2284(0x27)],_0xc8ecca),![]);}};export const updateLLMStatus=async(_0x537eab,_0x58a59b)=>{const _0x248330={'FbOtu':_0x2284(0x1e),'SxNmP':_0x2284(0x28)};try{const _0x4e3eb1=await getLLMMetadata(_0x537eab);if(!_0x4e3eb1)return console[_0x2284(0x26)](_0x248330[_0x2284(0x29)],_0x537eab),![];return _0x4e3eb1[_0x2284(0x2a)]=_0x58a59b,await AsyncStorage[_0x2284(0x5)](LLM_METADATA_STORAGE_KEY+':'+_0x537eab,JSON[_0x2284(0x7)](_0x4e3eb1)),console[_0x2284(0xe)]('✅\x20Updated\x20LLM\x20status\x20to:\x20'+_0x58a59b),!![];}catch(_0x1be425){return console[_0x2284(0x13)](_0x248330[_0x2284(0x2b)],_0x1be425),![];}};export const clearLLMData=async _0x35659f=>{const _0x338c34={'ZLRNl':_0x2284(0x2c),'LViQz':function(_0x5c4779,_0x37bc29){return _0x5c4779===_0x37bc29;},'TtQMN':'🔍\x20Platform\x20connection\x20check:','jekGV':'✅\x20LLM\x20data\x20cleared\x20for\x20user:','WDqhc':'AjWCW','yDuLj':'❌\x20Failed\x20to\x20clear\x20LLM\x20data:'};try{return await AsyncStorage[_0x2284(0x2d)](LLM_DATA_STORAGE_KEY+':'+_0x35659f),await AsyncStorage['removeItem'](LLM_METADATA_STORAGE_KEY+':'+_0x35659f),console['log'](_0x338c34[_0x2284(0x2e)],_0x35659f),!![];}catch(_0x38bf74){if(_0x338c34[_0x2284(0x2f)](_0x338c34[_0x2284(0x30)],_0x338c34[_0x2284(0x30)]))return console[_0x2284(0x13)](_0x338c34[_0x2284(0x31)],_0x38bf74),![];else{const _0x38c47f=_0x1758e3[_0x2284(0x32)](_0x1fcfb1)['filter'](([_0x4f26b7,_0x4f3057])=>_0x4f3057)[_0x2284(0x33)](([_0x192abc,_0x551c6e])=>_0x192abc),_0x31a434=_0x38c47f['includes'](_0x338c34[_0x2284(0x34)])||_0x38c47f[_0x2284(0x35)](_0x2284(0x36)),_0x2088e0=_0x338c34[_0x2284(0x2f)](_0x38c47f[_0x2284(0xc)],0x1)&&_0x31a434;return _0x4dc3ba[_0x2284(0xe)](_0x338c34[_0x2284(0x37)],{'connectedPlatforms':_0x38c47f,'hasLLM':_0x31a434,'onlyLLM':_0x2088e0}),_0x2088e0;}}};export const hasOnlyLLMConnection=_0x41c864=>{const _0x56717a={'MTeoq':_0x2284(0x2c),'uvcRr':_0x2284(0x36),'IlENZ':function(_0x4bf30d,_0x32f556){return _0x4bf30d===_0x32f556;},'PwtyV':'🔍\x20Platform\x20connection\x20check:'},_0x28d642=Object[_0x2284(0x32)](_0x41c864)['filter'](([_0x278b67,_0x3779e1])=>_0x3779e1)['map'](([_0x17a5aa,_0xa38e2b])=>_0x17a5aa),_0x1b2e12=_0x28d642[_0x2284(0x35)](_0x56717a['MTeoq'])||_0x28d642[_0x2284(0x35)](_0x56717a[_0x2284(0x38)]),_0x3b3f6f=_0x56717a[_0x2284(0x39)](_0x28d642[_0x2284(0xc)],0x1)&&_0x1b2e12;return console[_0x2284(0xe)](_0x56717a[_0x2284(0x3a)],{'connectedPlatforms':_0x28d642,'hasLLM':_0x1b2e12,'onlyLLM':_0x3b3f6f}),_0x3b3f6f;};export const formatLLMDataForDeveloper=_0x25107d=>{const _0x3387cb={'divdD':'llm','AulPW':_0x2284(0x36),'rBrFP':_0x2284(0x3b)};return{'platform':_0x3387cb['divdD'],'userId':_0x25107d[_0x2284(0x6)],'email':_0x25107d[_0x2284(0x8)],'timestamp':_0x25107d['timestamp'],'data':{'type':_0x3387cb[_0x2284(0x3c)],'conversations':_0x25107d['data'][_0x2284(0x3d)]||[],'chatHistory':_0x25107d[_0x2284(0xb)][_0x2284(0x3e)]||[],'preferences':_0x25107d[_0x2284(0xb)][_0x2284(0x3f)]||{},'customData':_0x25107d[_0x2284(0xb)][_0x2284(0x40)]||{}},'metadata':{'appName':_0x25107d['appName'],'collectedAt':new Date(_0x25107d[_0x2284(0xa)])['toISOString'](),'dataVersion':_0x3387cb['rBrFP']}};};export const sendLLMDataToBackend=async(_0xa1dfd6,_0x5d5d90)=>{const _0x157b02={'YvvOR':function(_0x4164a0,_0x49d763){return _0x4164a0 instanceof _0x49d763;},'vJSrE':_0x2284(0x25),'FoRmq':_0x2284(0x41),'vRFNV':function(_0x304252,_0x21d810){return _0x304252&&_0x21d810;},'tWriU':_0x2284(0x2c),'xxwvP':'chatgpt','KZzty':_0x2284(0x3b),'YpuOA':function(_0x30f3e4,_0x77f3fa){return _0x30f3e4!==_0x77f3fa;},'gfroi':_0x2284(0x42),'LMPqe':'❌\x20Backend\x20data\x20ingestion\x20failed:','kdMEr':function(_0x118855,_0x356bd4){return _0x118855===_0x356bd4;},'KcYAI':_0x2284(0x43),'WEcRP':_0x2284(0x44),'DSpee':function(_0x2eea74,_0x4d11b9){return _0x2eea74 instanceof _0x4d11b9;},'PchQi':'Unknown\x20error'};try{console[_0x2284(0xe)](_0x157b02[_0x2284(0x45)]);const _0x48d8f8=await fetch(API_CONFIG['BASE_URL']+'/llmdata',{'method':'POST','headers':{'Content-Type':'application/json',..._0x157b02[_0x2284(0x46)](_0x5d5d90,{'Authorization':_0x2284(0x47)+_0x5d5d90})},'body':JSON[_0x2284(0x7)]({'userId':_0xa1dfd6[_0x2284(0x6)],'email':_0xa1dfd6[_0x2284(0x8)],'appName':_0xa1dfd6['appName'],'platform':_0x157b02[_0x2284(0x48)],'connectionType':_0x157b02[_0x2284(0x49)],'timestamp':new Date()[_0x2284(0x4a)](),'data':_0xa1dfd6[_0x2284(0xb)],'accessToken':_0xa1dfd6[_0x2284(0x4b)],'refreshToken':_0xa1dfd6['refreshToken'],'tokenExpiry':_0xa1dfd6['tokenExpiry'],'metadata':{'collectedAt':new Date(_0xa1dfd6[_0x2284(0xa)])[_0x2284(0x4a)](),'dataVersion':_0x157b02[_0x2284(0x4c)]}})});if(_0x48d8f8['ok']){if(_0x157b02[_0x2284(0x4d)](_0x157b02[_0x2284(0x4e)],_0x157b02[_0x2284(0x4e)]))return _0x4d0d06[_0x2284(0x13)](_0x2284(0x44),_0x2d8509),{'success':![],'message':_0x157b02[_0x2284(0x4f)](_0x1dffdf,_0x212c25)?_0x3f3516[_0x2284(0x50)]:_0x2284(0x51)};else{const _0x4e7766=await _0x48d8f8['json']();return console[_0x2284(0xe)](_0x2284(0x52),_0x4e7766),{'success':!![],'message':_0x4e7766[_0x2284(0x50)],'connectionId':_0x4e7766[_0x2284(0x53)]};}}else{const _0x59b8d6=await _0x48d8f8[_0x2284(0x54)]();return console[_0x2284(0x13)](_0x157b02[_0x2284(0x55)],_0x48d8f8[_0x2284(0x56)],_0x59b8d6),{'success':![],'message':_0x2284(0x57)+_0x48d8f8[_0x2284(0x56)]};}}catch(_0x472efd){return _0x157b02[_0x2284(0x58)](_0x157b02['KcYAI'],'CCkmL')?(_0x2fcbe2[_0x2284(0x13)](_0x157b02[_0x2284(0x59)],_0x28ac5a),null):(console[_0x2284(0x13)](_0x157b02[_0x2284(0x5a)],_0x472efd),{'success':![],'message':_0x157b02[_0x2284(0x5b)](_0x472efd,Error)?_0x472efd[_0x2284(0x50)]:_0x157b02[_0x2284(0x5c)]});}};function _0x395c(){const _0x2e6d09=['@onairos:llm_data','@onairos:llm_metadata','connected','✅\x20LLM\x20data\x20stored\x20locally\x20successfully','💾\x20Storing\x20LLM\x20data\x20locally\x20(temporary)...','setItem','userId','stringify','email','appName','timestamp','data','length','WVvwF','log','OOAIa','📊\x20Data\x20size:\x20','dataSize','\x20bytes','error','❌\x20Failed\x20to\x20store\x20LLM\x20data:','ℹ️\x20No\x20LLM\x20data\x20found\x20for\x20user:','❌\x20Failed\x20to\x20retrieve\x20LLM\x20data:','getItem','ijJWY','AygGq','PvVGk','parse','tAxik','❌\x20Failed\x20to\x20clear\x20LLM\x20data:','⚠️\x20No\x20LLM\x20metadata\x20found\x20for\x20user:','oZDOT','ICGKh','DgNcm','svdlv','Sqvdo','LxnpR','❌\x20Failed\x20to\x20retrieve\x20LLM\x20metadata:','warn','DLuEH','❌\x20Failed\x20to\x20update\x20LLM\x20status:','FbOtu','connectionStatus','SxNmP','llm','removeItem','jekGV','LViQz','WDqhc','yDuLj','entries','map','ZLRNl','includes','chatgpt','TtQMN','uvcRr','IlENZ','PwtyV','1.0','AulPW','conversations','chatHistory','preferences','customData','📡\x20Sending\x20LLM\x20data\x20to\x20backend\x20for\x20processing...','bFWuw','WqdXu','❌\x20Failed\x20to\x20send\x20data\x20to\x20backend:','FoRmq','vRFNV','Bearer\x20','tWriU','xxwvP','toISOString','accessToken','KZzty','YpuOA','gfroi','YvvOR','message','Unknown\x20error','✅\x20Backend\x20received\x20and\x20stored\x20LLM\x20data:','connectionId','text','LMPqe','status','Backend\x20error:\x20','kdMEr','vJSrE','WEcRP','DSpee','PchQi','📤\x20Requesting\x20backend\x20to\x20send\x20LLM\x20data\x20to\x20developer...','ytoIU','zBLji','BASE_URL','/llmdata/request','hVXqX','token','❌\x20Failed\x20to\x20request\x20LLM\x20data:','aOWxd','ErTgT','LosVo','bTEbF','❌\x20Failed\x20to\x20get\x20LLM\x20data\x20keys:','ftPKl','oJDXY','xiJyZ','YMczO','getAllKeys','startsWith','LcTtN'];_0x395c=function(){return _0x2e6d09;};return _0x395c();}export const requestLLMDataForDeveloper=async(_0x23ac4f,_0x4be41d,_0x48999d,_0x5bbad4,_0x2e3499)=>{const _0x4c5348={'ytoIU':_0x2284(0x5d),'zBLji':function(_0x3452ec,_0x41386c,_0x28ada4){return _0x3452ec(_0x41386c,_0x28ada4);},'hVXqX':'✅\x20Backend\x20processing\x20LLM\x20data\x20request:','aOWxd':'❌\x20Failed\x20to\x20request\x20LLM\x20data\x20from\x20backend:','ErTgT':_0x2284(0x51)};try{console[_0x2284(0xe)](_0x4c5348[_0x2284(0x5e)]);const _0x87ef6e=await _0x4c5348[_0x2284(0x5f)](fetch,API_CONFIG[_0x2284(0x60)]+_0x2284(0x61),{'method':'POST','headers':{'Content-Type':'application/json','Authorization':_0x2284(0x47)+_0x2e3499},'body':JSON['stringify']({'userId':_0x23ac4f,'email':_0x4be41d,'appName':_0x48999d,'requestedData':_0x5bbad4,'timestamp':new Date()[_0x2284(0x4a)]()})});if(_0x87ef6e['ok']){const _0x54484d=await _0x87ef6e['json']();return console[_0x2284(0xe)](_0x4c5348[_0x2284(0x62)],_0x54484d),{'success':!![],'message':_0x54484d[_0x2284(0x50)],'apiUrl':_0x54484d['apiUrl'],'token':_0x54484d[_0x2284(0x63)]};}else{const _0x23c414=await _0x87ef6e[_0x2284(0x54)]();return console[_0x2284(0x13)](_0x2284(0x64),_0x87ef6e[_0x2284(0x56)],_0x23c414),{'success':![],'message':_0x2284(0x57)+_0x87ef6e[_0x2284(0x56)]};}}catch(_0x5a3ff9){return console[_0x2284(0x13)](_0x4c5348[_0x2284(0x65)],_0x5a3ff9),{'success':![],'message':_0x5a3ff9 instanceof Error?_0x5a3ff9[_0x2284(0x50)]:_0x4c5348[_0x2284(0x66)]};}};export const getAllLLMDataKeys=async()=>{const _0x224b0d={'xiJyZ':_0x2284(0x2c),'YMczO':_0x2284(0x36),'QAnOI':_0x2284(0x3b),'ftPKl':function(_0x1634b5,_0x153613){return _0x1634b5===_0x153613;},'oJDXY':'CMXGU','MueBa':_0x2284(0x67),'jOdrx':_0x2284(0x68),'LcTtN':_0x2284(0x69)};try{if(_0x224b0d[_0x2284(0x6a)](_0x224b0d[_0x2284(0x6b)],_0x224b0d['MueBa']))return{'platform':_0x224b0d[_0x2284(0x6c)],'userId':_0x37758f[_0x2284(0x6)],'email':_0x580a01[_0x2284(0x8)],'timestamp':_0x5e43f4[_0x2284(0xa)],'data':{'type':_0x224b0d[_0x2284(0x6d)],'conversations':_0x2bdbf9[_0x2284(0xb)]['conversations']||[],'chatHistory':_0x6b7b[_0x2284(0xb)][_0x2284(0x3e)]||[],'preferences':_0x567c06['data'][_0x2284(0x3f)]||{},'customData':_0x1de730[_0x2284(0xb)][_0x2284(0x40)]||{}},'metadata':{'appName':_0x5cc01e['appName'],'collectedAt':new _0x521eab(_0x23ebc7[_0x2284(0xa)])[_0x2284(0x4a)](),'dataVersion':_0x224b0d['QAnOI']}};else{const _0x188c35=await AsyncStorage[_0x2284(0x6e)](),_0x3d1a15=_0x188c35['filter'](_0x2fc855=>_0x2fc855[_0x2284(0x6f)](LLM_DATA_STORAGE_KEY)||_0x2fc855[_0x2284(0x6f)](LLM_METADATA_STORAGE_KEY));return _0x3d1a15;}}catch(_0x579be1){return _0x224b0d['jOdrx']===_0x2284(0x68)?(console[_0x2284(0x13)](_0x224b0d[_0x2284(0x70)],_0x579be1),[]):null;}};
1
+ /**
2
+ * LLM Data Storage Service
3
+ *
4
+ * Temporary storage solution for LLM (ChatGPT) data until full backend processing is implemented.
5
+ *
6
+ * Flow:
7
+ * 1. When user connects ONLY LLM data → Store data locally, send metadata to backend
8
+ * 2. When user accepts data request → Send stored LLM data directly to developer
9
+ *
10
+ * This is a TEMPORARY feature until full LLM data processing is available.
11
+ */
12
+
13
+ import AsyncStorage from '@react-native-async-storage/async-storage';
14
+ import { API_CONFIG } from '../config/api';
15
+ const LLM_DATA_STORAGE_KEY = '@onairos:llm_data';
16
+ const LLM_METADATA_STORAGE_KEY = '@onairos:llm_metadata';
17
+ /**
18
+ * Store LLM data locally (temporary storage)
19
+ */
20
+ export const storeLLMData = async payload => {
21
+ try {
22
+ console.log('💾 Storing LLM data locally (temporary)...');
23
+
24
+ // Store the full data payload
25
+ await AsyncStorage.setItem(`${LLM_DATA_STORAGE_KEY}:${payload.userId}`, JSON.stringify(payload));
26
+
27
+ // Store metadata separately for quick access
28
+ const metadata = {
29
+ userId: payload.userId,
30
+ email: payload.email,
31
+ appName: payload.appName,
32
+ timestamp: payload.timestamp,
33
+ hasData: true,
34
+ dataSize: JSON.stringify(payload.data).length,
35
+ connectionStatus: 'connected'
36
+ };
37
+ await AsyncStorage.setItem(`${LLM_METADATA_STORAGE_KEY}:${payload.userId}`, JSON.stringify(metadata));
38
+ console.log('✅ LLM data stored locally successfully');
39
+ console.log(`📊 Data size: ${metadata.dataSize} bytes`);
40
+ return true;
41
+ } catch (error) {
42
+ console.error('❌ Failed to store LLM data:', error);
43
+ return false;
44
+ }
45
+ };
46
+
47
+ /**
48
+ * Retrieve stored LLM data
49
+ */
50
+ export const getLLMData = async userId => {
51
+ try {
52
+ const storedData = await AsyncStorage.getItem(`${LLM_DATA_STORAGE_KEY}:${userId}`);
53
+ if (!storedData) {
54
+ console.log('ℹ️ No LLM data found for user:', userId);
55
+ return null;
56
+ }
57
+ const payload = JSON.parse(storedData);
58
+ console.log('✅ Retrieved LLM data for user:', userId);
59
+ return payload;
60
+ } catch (error) {
61
+ console.error('❌ Failed to retrieve LLM data:', error);
62
+ return null;
63
+ }
64
+ };
65
+
66
+ /**
67
+ * Get LLM metadata (quick check without loading full data)
68
+ */
69
+ export const getLLMMetadata = async userId => {
70
+ try {
71
+ const storedMetadata = await AsyncStorage.getItem(`${LLM_METADATA_STORAGE_KEY}:${userId}`);
72
+ if (!storedMetadata) {
73
+ return null;
74
+ }
75
+ return JSON.parse(storedMetadata);
76
+ } catch (error) {
77
+ console.error('❌ Failed to retrieve LLM metadata:', error);
78
+ return null;
79
+ }
80
+ };
81
+
82
+ /**
83
+ * Update LLM connection status
84
+ */
85
+ export const updateLLMStatus = async (userId, status) => {
86
+ try {
87
+ const metadata = await getLLMMetadata(userId);
88
+ if (!metadata) {
89
+ console.warn('⚠️ No LLM metadata found for user:', userId);
90
+ return false;
91
+ }
92
+ metadata.connectionStatus = status;
93
+ await AsyncStorage.setItem(`${LLM_METADATA_STORAGE_KEY}:${userId}`, JSON.stringify(metadata));
94
+ console.log(`✅ Updated LLM status to: ${status}`);
95
+ return true;
96
+ } catch (error) {
97
+ console.error('❌ Failed to update LLM status:', error);
98
+ return false;
99
+ }
100
+ };
101
+
102
+ /**
103
+ * Clear stored LLM data after successful transmission
104
+ */
105
+ export const clearLLMData = async userId => {
106
+ try {
107
+ await AsyncStorage.removeItem(`${LLM_DATA_STORAGE_KEY}:${userId}`);
108
+ await AsyncStorage.removeItem(`${LLM_METADATA_STORAGE_KEY}:${userId}`);
109
+ console.log('✅ LLM data cleared for user:', userId);
110
+ return true;
111
+ } catch (error) {
112
+ console.error('❌ Failed to clear LLM data:', error);
113
+ return false;
114
+ }
115
+ };
116
+
117
+ /**
118
+ * Check if user has ONLY LLM data connected (no other platforms)
119
+ */
120
+ export const hasOnlyLLMConnection = platformToggles => {
121
+ const connectedPlatforms = Object.entries(platformToggles).filter(([_, connected]) => connected).map(([platform, _]) => platform);
122
+
123
+ // Check if ONLY 'llm' or 'chatgpt' is connected
124
+ const hasLLM = connectedPlatforms.includes('llm') || connectedPlatforms.includes('chatgpt');
125
+ const onlyLLM = connectedPlatforms.length === 1 && hasLLM;
126
+ console.log('🔍 Platform connection check:', {
127
+ connectedPlatforms,
128
+ hasLLM,
129
+ onlyLLM
130
+ });
131
+ return onlyLLM;
132
+ };
133
+
134
+ /**
135
+ * Format LLM data for developer API
136
+ */
137
+ export const formatLLMDataForDeveloper = payload => {
138
+ return {
139
+ platform: 'llm',
140
+ userId: payload.userId,
141
+ email: payload.email,
142
+ timestamp: payload.timestamp,
143
+ data: {
144
+ type: 'chatgpt',
145
+ conversations: payload.data.conversations || [],
146
+ chatHistory: payload.data.chatHistory || [],
147
+ preferences: payload.data.preferences || {},
148
+ customData: payload.data.customData || {}
149
+ },
150
+ metadata: {
151
+ appName: payload.appName,
152
+ collectedAt: new Date(payload.timestamp).toISOString(),
153
+ dataVersion: '1.0'
154
+ }
155
+ };
156
+ };
157
+
158
+ /**
159
+ * Send LLM data directly to backend for processing and storage
160
+ * FULL BACKEND IMPLEMENTATION - Backend handles all data processing
161
+ */
162
+ export const sendLLMDataToBackend = async (payload, authToken) => {
163
+ try {
164
+ console.log('📡 Sending LLM data to backend for processing...');
165
+ const response = await fetch(`${API_CONFIG.BASE_URL}/llmdata`, {
166
+ method: 'POST',
167
+ headers: {
168
+ 'Content-Type': 'application/json',
169
+ ...(authToken && {
170
+ 'Authorization': `Bearer ${authToken}`
171
+ })
172
+ },
173
+ body: JSON.stringify({
174
+ userId: payload.userId,
175
+ email: payload.email,
176
+ appName: payload.appName,
177
+ platform: 'llm',
178
+ connectionType: 'chatgpt',
179
+ timestamp: new Date().toISOString(),
180
+ data: payload.data,
181
+ accessToken: payload.accessToken,
182
+ refreshToken: payload.refreshToken,
183
+ tokenExpiry: payload.tokenExpiry,
184
+ metadata: {
185
+ collectedAt: new Date(payload.timestamp).toISOString(),
186
+ dataVersion: '1.0'
187
+ }
188
+ })
189
+ });
190
+ if (response.ok) {
191
+ const result = await response.json();
192
+ console.log('✅ Backend received and stored LLM data:', result);
193
+ return {
194
+ success: true,
195
+ message: result.message,
196
+ connectionId: result.connectionId
197
+ };
198
+ } else {
199
+ const errorText = await response.text();
200
+ console.error('❌ Backend data ingestion failed:', response.status, errorText);
201
+ return {
202
+ success: false,
203
+ message: `Backend error: ${response.status}`
204
+ };
205
+ }
206
+ } catch (error) {
207
+ console.error('❌ Failed to send data to backend:', error);
208
+ return {
209
+ success: false,
210
+ message: error instanceof Error ? error.message : 'Unknown error'
211
+ };
212
+ }
213
+ };
214
+
215
+ /**
216
+ * Request LLM data from backend to be sent to developer
217
+ * FULL BACKEND IMPLEMENTATION - Backend retrieves stored data and forwards to developer
218
+ */
219
+ export const requestLLMDataForDeveloper = async (userId, email, appName, requestedData, authToken) => {
220
+ try {
221
+ console.log('📤 Requesting backend to send LLM data to developer...');
222
+
223
+ // Request backend to process and forward LLM data to developer
224
+ const response = await fetch(`${API_CONFIG.BASE_URL}/llmdata/request`, {
225
+ method: 'POST',
226
+ headers: {
227
+ 'Content-Type': 'application/json',
228
+ 'Authorization': `Bearer ${authToken}`
229
+ },
230
+ body: JSON.stringify({
231
+ userId,
232
+ email,
233
+ appName,
234
+ requestedData,
235
+ timestamp: new Date().toISOString()
236
+ })
237
+ });
238
+ if (response.ok) {
239
+ const result = await response.json();
240
+ console.log('✅ Backend processing LLM data request:', result);
241
+ return {
242
+ success: true,
243
+ message: result.message,
244
+ apiUrl: result.apiUrl,
245
+ token: result.token
246
+ };
247
+ } else {
248
+ const errorText = await response.text();
249
+ console.error('❌ Failed to request LLM data:', response.status, errorText);
250
+ return {
251
+ success: false,
252
+ message: `Backend error: ${response.status}`
253
+ };
254
+ }
255
+ } catch (error) {
256
+ console.error('❌ Failed to request LLM data from backend:', error);
257
+ return {
258
+ success: false,
259
+ message: error instanceof Error ? error.message : 'Unknown error'
260
+ };
261
+ }
262
+ };
263
+
264
+ /**
265
+ * Get all stored LLM data keys (for debugging/admin purposes)
266
+ */
267
+ export const getAllLLMDataKeys = async () => {
268
+ try {
269
+ const allKeys = await AsyncStorage.getAllKeys();
270
+ const llmKeys = allKeys.filter(key => key.startsWith(LLM_DATA_STORAGE_KEY) || key.startsWith(LLM_METADATA_STORAGE_KEY));
271
+ return llmKeys;
272
+ } catch (error) {
273
+ console.error('❌ Failed to get LLM data keys:', error);
274
+ return [];
275
+ }
276
+ };
277
+ //# sourceMappingURL=llmDataStorage.js.map