@onairos/react-native 3.7.1 → 3.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. package/lib/commonjs/api/index.js +219 -9
  2. package/lib/commonjs/assets/icons/spotify.png +0 -0
  3. package/lib/commonjs/assets/images/spotify.png +0 -0
  4. package/lib/commonjs/components/BodyText.js +27 -9
  5. package/lib/commonjs/components/BrandMark.js +111 -10
  6. package/lib/commonjs/components/CodeInput.js +116 -9
  7. package/lib/commonjs/components/EmailInput.js +30 -8
  8. package/lib/commonjs/components/GoogleButton.js +56 -9
  9. package/lib/commonjs/components/HeadingGroup.js +43 -9
  10. package/lib/commonjs/components/LLMDataInputModal.js +664 -14
  11. package/lib/commonjs/components/ModalHeader.js +99 -9
  12. package/lib/commonjs/components/ModalSheet.js +47 -9
  13. package/lib/commonjs/components/Onairos.js +380 -14
  14. package/lib/commonjs/components/OnairosButton.js +313 -13
  15. package/lib/commonjs/components/OnairosSignInButton.js +130 -12
  16. package/lib/commonjs/components/Overlay.js +465 -13
  17. package/lib/commonjs/components/PersonaImage.js +137 -10
  18. package/lib/commonjs/components/PersonaLoadingScreen.js +318 -12
  19. package/lib/commonjs/components/PersonalizationConsentScreen.js +467 -13
  20. package/lib/commonjs/components/PinCreationScreen.js +403 -12
  21. package/lib/commonjs/components/PinInput.js +464 -9
  22. package/lib/commonjs/components/PlatformConnectorsStep.js +1311 -23
  23. package/lib/commonjs/components/PlatformList.js +137 -10
  24. package/lib/commonjs/components/PlatformToggle.js +180 -9
  25. package/lib/commonjs/components/PrimaryButton.js +180 -10
  26. package/lib/commonjs/components/SignInMatchAnimation.js +197 -9
  27. package/lib/commonjs/components/SignInStep.js +345 -12
  28. package/lib/commonjs/components/UniversalOnboarding.js +2780 -30
  29. package/lib/commonjs/components/VerificationStep.js +176 -11
  30. package/lib/commonjs/components/WelcomeScreen.js +461 -22
  31. package/lib/commonjs/components/icons/Basicproficon.js +37 -8
  32. package/lib/commonjs/components/icons/Basicprofile.js +21 -8
  33. package/lib/commonjs/components/icons/Checkbox.js +21 -8
  34. package/lib/commonjs/components/icons/Checkmark.js +27 -8
  35. package/lib/commonjs/components/icons/Contentanalysis.js +21 -8
  36. package/lib/commonjs/components/icons/Contenticon.js +39 -8
  37. package/lib/commonjs/components/icons/EnochE.js +41 -8
  38. package/lib/commonjs/components/icons/Personalityicon.js +30 -8
  39. package/lib/commonjs/components/icons/Personalityprofile.js +21 -8
  40. package/lib/commonjs/components/icons/Personalitytraits.js +21 -8
  41. package/lib/commonjs/components/icons/Userpreferences.js +21 -8
  42. package/lib/commonjs/components/icons/index.js +84 -17
  43. package/lib/commonjs/components/onboarding/OAuthWebView.js +1754 -18
  44. package/lib/commonjs/components/onboarding/OnboardingHeader.js +74 -10
  45. package/lib/commonjs/components/onboarding/PinInput.js +283 -10
  46. package/lib/commonjs/components/onboarding/PlatformConnector.js +249 -11
  47. package/lib/commonjs/config/PLATFORM_APIS.md +849 -0
  48. package/lib/commonjs/config/api.js +56 -7
  49. package/lib/commonjs/constants/index.js +120 -7
  50. package/lib/commonjs/context/AuthContext.js +345 -10
  51. package/lib/commonjs/hooks/useConnectedAccounts.js +111 -9
  52. package/lib/commonjs/hooks/useConnections.js +102 -8
  53. package/lib/commonjs/hooks/useCredentials.js +178 -10
  54. package/lib/commonjs/hooks/useUserConnections.js +148 -10
  55. package/lib/commonjs/index.js +439 -34
  56. package/lib/commonjs/services/apiClient.js +298 -8
  57. package/lib/commonjs/services/biometricPinService.js +180 -8
  58. package/lib/commonjs/services/chatGPTConversationExtractor.js +155 -8
  59. package/lib/commonjs/services/chatGPTConversationService.js +275 -9
  60. package/lib/commonjs/services/claudeConversationExtractor.js +103 -8
  61. package/lib/commonjs/services/claudeConversationService.js +158 -9
  62. package/lib/commonjs/services/connectedAccountsService.js +310 -10
  63. package/lib/commonjs/services/googleAuthService.js +252 -11
  64. package/lib/commonjs/services/hingeDataExtractor.js +105 -8
  65. package/lib/commonjs/services/hingeDataService.js +150 -9
  66. package/lib/commonjs/services/imageCompressionService.js +260 -7
  67. package/lib/commonjs/services/instagramDataExtractor.js +126 -8
  68. package/lib/commonjs/services/instagramDataService.js +163 -9
  69. package/lib/commonjs/services/jwtStorageService.js +276 -7
  70. package/lib/commonjs/services/linkedinDOMExtractor.js +245 -7
  71. package/lib/commonjs/services/linkedinProfileService.js +222 -9
  72. package/lib/commonjs/services/linkedinScrapingService.js +230 -8
  73. package/lib/commonjs/services/llmDataStorage.js +294 -8
  74. package/lib/commonjs/services/mobileTrainingService.js +186 -8
  75. package/lib/commonjs/services/netflixDataExtractor.js +120 -8
  76. package/lib/commonjs/services/netflixDataService.js +198 -9
  77. package/lib/commonjs/services/pinEncryptionService.js +84 -8
  78. package/lib/commonjs/services/pinStorageUtils.js +105 -7
  79. package/lib/commonjs/services/platformAuthService.js +1484 -12
  80. package/lib/commonjs/services/sephoraDataExtractor.js +140 -8
  81. package/lib/commonjs/services/sephoraDataService.js +200 -9
  82. package/lib/commonjs/services/spotifyDataExtractor.js +148 -8
  83. package/lib/commonjs/services/spotifyDataService.js +241 -9
  84. package/lib/commonjs/services/storageService.js +404 -8
  85. package/lib/commonjs/services/telegramDataExtractor.js +115 -8
  86. package/lib/commonjs/services/telegramDataService.js +499 -9
  87. package/lib/commonjs/services/trainingApiHelpers.js +73 -7
  88. package/lib/commonjs/services/userConnectionsService.js +340 -10
  89. package/lib/commonjs/services/youtubeMigrationService.js +416 -10
  90. package/lib/commonjs/theme/index.js +250 -7
  91. package/lib/commonjs/types/ambient.d.js +2 -1
  92. package/lib/commonjs/types/declarations.d.js +2 -1
  93. package/lib/commonjs/types/index.js +6 -1
  94. package/lib/commonjs/types/node-fix.d.js +2 -1
  95. package/lib/commonjs/types/node-override.d.js +2 -1
  96. package/lib/commonjs/types/opacity.d.js +2 -1
  97. package/lib/commonjs/types.js +14 -1
  98. package/lib/commonjs/utils/Portal.js +98 -8
  99. package/lib/commonjs/utils/api.js +130 -9
  100. package/lib/commonjs/utils/assetRegistry.js +210 -35
  101. package/lib/commonjs/utils/auth.js +112 -9
  102. package/lib/commonjs/utils/connectorTests.js +613 -29
  103. package/lib/commonjs/utils/crypto.js +62 -8
  104. package/lib/commonjs/utils/debugHelper.js +64 -1
  105. package/lib/commonjs/utils/encryption.js +76 -7
  106. package/lib/commonjs/utils/eventUtils.js +288 -1
  107. package/lib/commonjs/utils/haptics.js +66 -9
  108. package/lib/commonjs/utils/imagePreloader.js +6 -1
  109. package/lib/commonjs/utils/networkDiagnostics.js +226 -8
  110. package/lib/commonjs/utils/onairosApi.js +350 -9
  111. package/lib/commonjs/utils/programmaticFlow.js +117 -9
  112. package/lib/commonjs/utils/retryHelper.js +220 -1
  113. package/lib/commonjs/utils/secureStorage.js +349 -10
  114. package/lib/commonjs/utils/webviewScripts/chatgpt.js +551 -1
  115. package/lib/commonjs/utils/webviewScripts/claude.js +376 -1
  116. package/lib/commonjs/utils/webviewScripts/hinge.js +411 -1
  117. package/lib/commonjs/utils/webviewScripts/index.js +698 -15
  118. package/lib/commonjs/utils/webviewScripts/instagram.js +454 -1
  119. package/lib/commonjs/utils/webviewScripts/linkedin.js +880 -1
  120. package/lib/commonjs/utils/webviewScripts/netflix.js +382 -1
  121. package/lib/commonjs/utils/webviewScripts/sephora.js +516 -1
  122. package/lib/commonjs/utils/webviewScripts/spotify.js +419 -1
  123. package/lib/commonjs/utils/webviewScripts/telegram.js +678 -1
  124. package/lib/module/api/index.js +211 -1
  125. package/lib/module/assets/icons/spotify.png +0 -0
  126. package/lib/module/assets/images/spotify.png +0 -0
  127. package/lib/module/components/BodyText.js +20 -1
  128. package/lib/module/components/BrandMark.js +104 -1
  129. package/lib/module/components/CodeInput.js +109 -1
  130. package/lib/module/components/EmailInput.js +23 -1
  131. package/lib/module/components/GoogleButton.js +49 -1
  132. package/lib/module/components/HeadingGroup.js +36 -1
  133. package/lib/module/components/LLMDataInputModal.js +656 -7
  134. package/lib/module/components/ModalHeader.js +92 -1
  135. package/lib/module/components/ModalSheet.js +39 -1
  136. package/lib/module/components/Onairos.js +373 -1
  137. package/lib/module/components/OnairosButton.js +305 -1
  138. package/lib/module/components/OnairosSignInButton.js +121 -1
  139. package/lib/module/components/Overlay.js +456 -1
  140. package/lib/module/components/PersonaImage.js +129 -1
  141. package/lib/module/components/PersonaLoadingScreen.js +310 -1
  142. package/lib/module/components/PersonalizationConsentScreen.js +460 -1
  143. package/lib/module/components/PinCreationScreen.js +396 -1
  144. package/lib/module/components/PinInput.js +456 -1
  145. package/lib/module/components/PlatformConnectorsStep.js +1302 -6
  146. package/lib/module/components/PlatformList.js +129 -1
  147. package/lib/module/components/PlatformToggle.js +173 -1
  148. package/lib/module/components/PrimaryButton.js +172 -1
  149. package/lib/module/components/SignInMatchAnimation.js +189 -1
  150. package/lib/module/components/SignInStep.js +338 -1
  151. package/lib/module/components/UniversalOnboarding.js +2770 -1
  152. package/lib/module/components/VerificationStep.js +168 -1
  153. package/lib/module/components/WelcomeScreen.js +453 -1
  154. package/lib/module/components/icons/Basicproficon.js +30 -1
  155. package/lib/module/components/icons/Basicprofile.js +14 -1
  156. package/lib/module/components/icons/Checkbox.js +14 -1
  157. package/lib/module/components/icons/Checkmark.js +20 -1
  158. package/lib/module/components/icons/Contentanalysis.js +14 -1
  159. package/lib/module/components/icons/Contenticon.js +32 -1
  160. package/lib/module/components/icons/EnochE.js +34 -1
  161. package/lib/module/components/icons/Personalityicon.js +23 -1
  162. package/lib/module/components/icons/Personalityprofile.js +14 -1
  163. package/lib/module/components/icons/Personalitytraits.js +14 -1
  164. package/lib/module/components/icons/Userpreferences.js +14 -1
  165. package/lib/module/components/icons/index.js +13 -1
  166. package/lib/module/components/onboarding/OAuthWebView.js +1746 -1
  167. package/lib/module/components/onboarding/OnboardingHeader.js +66 -1
  168. package/lib/module/components/onboarding/PinInput.js +274 -1
  169. package/lib/module/components/onboarding/PlatformConnector.js +240 -1
  170. package/lib/module/config/PLATFORM_APIS.md +849 -0
  171. package/lib/module/config/api.js +47 -1
  172. package/lib/module/constants/index.js +114 -1
  173. package/lib/module/context/AuthContext.js +335 -1
  174. package/lib/module/hooks/useConnectedAccounts.js +106 -1
  175. package/lib/module/hooks/useConnections.js +95 -1
  176. package/lib/module/hooks/useCredentials.js +171 -6
  177. package/lib/module/hooks/useUserConnections.js +140 -1
  178. package/lib/module/index.js +172 -1
  179. package/lib/module/services/apiClient.js +295 -1
  180. package/lib/module/services/biometricPinService.js +169 -1
  181. package/lib/module/services/chatGPTConversationExtractor.js +149 -1
  182. package/lib/module/services/chatGPTConversationService.js +268 -1
  183. package/lib/module/services/claudeConversationExtractor.js +97 -1
  184. package/lib/module/services/claudeConversationService.js +151 -1
  185. package/lib/module/services/connectedAccountsService.js +293 -1
  186. package/lib/module/services/googleAuthService.js +241 -1
  187. package/lib/module/services/hingeDataExtractor.js +99 -1
  188. package/lib/module/services/hingeDataService.js +143 -1
  189. package/lib/module/services/imageCompressionService.js +250 -1
  190. package/lib/module/services/instagramDataExtractor.js +120 -1
  191. package/lib/module/services/instagramDataService.js +156 -1
  192. package/lib/module/services/jwtStorageService.js +257 -1
  193. package/lib/module/services/linkedinDOMExtractor.js +234 -1
  194. package/lib/module/services/linkedinProfileService.js +210 -1
  195. package/lib/module/services/linkedinScrapingService.js +219 -1
  196. package/lib/module/services/llmDataStorage.js +277 -1
  197. package/lib/module/services/mobileTrainingService.js +173 -1
  198. package/lib/module/services/netflixDataExtractor.js +114 -1
  199. package/lib/module/services/netflixDataService.js +191 -1
  200. package/lib/module/services/pinEncryptionService.js +74 -6
  201. package/lib/module/services/pinStorageUtils.js +93 -1
  202. package/lib/module/services/platformAuthService.js +1461 -1
  203. package/lib/module/services/sephoraDataExtractor.js +134 -1
  204. package/lib/module/services/sephoraDataService.js +193 -1
  205. package/lib/module/services/spotifyDataExtractor.js +142 -1
  206. package/lib/module/services/spotifyDataService.js +234 -1
  207. package/lib/module/services/storageService.js +383 -1
  208. package/lib/module/services/telegramDataExtractor.js +109 -1
  209. package/lib/module/services/telegramDataService.js +493 -1
  210. package/lib/module/services/trainingApiHelpers.js +67 -1
  211. package/lib/module/services/userConnectionsService.js +329 -1
  212. package/lib/module/services/youtubeMigrationService.js +405 -1
  213. package/lib/module/theme/index.js +245 -1
  214. package/lib/module/types.js +10 -1
  215. package/lib/module/utils/Portal.js +90 -1
  216. package/lib/module/utils/api.js +118 -1
  217. package/lib/module/utils/assetRegistry.js +200 -34
  218. package/lib/module/utils/auth.js +100 -1
  219. package/lib/module/utils/connectorTests.js +600 -27
  220. package/lib/module/utils/crypto.js +54 -1
  221. package/lib/module/utils/debugHelper.js +54 -1
  222. package/lib/module/utils/encryption.js +67 -1
  223. package/lib/module/utils/eventUtils.js +270 -1
  224. package/lib/module/utils/haptics.js +59 -8
  225. package/lib/module/utils/imagePreloader.js +3 -1
  226. package/lib/module/utils/networkDiagnostics.js +217 -1
  227. package/lib/module/utils/onairosApi.js +333 -1
  228. package/lib/module/utils/programmaticFlow.js +111 -1
  229. package/lib/module/utils/retryHelper.js +211 -1
  230. package/lib/module/utils/secureStorage.js +330 -6
  231. package/lib/module/utils/webviewScripts/chatgpt.js +545 -1
  232. package/lib/module/utils/webviewScripts/claude.js +370 -1
  233. package/lib/module/utils/webviewScripts/hinge.js +405 -1
  234. package/lib/module/utils/webviewScripts/index.js +434 -1
  235. package/lib/module/utils/webviewScripts/instagram.js +448 -1
  236. package/lib/module/utils/webviewScripts/linkedin.js +874 -1
  237. package/lib/module/utils/webviewScripts/netflix.js +376 -1
  238. package/lib/module/utils/webviewScripts/sephora.js +510 -1
  239. package/lib/module/utils/webviewScripts/spotify.js +413 -1
  240. package/lib/module/utils/webviewScripts/telegram.js +672 -1
  241. package/package.json +2 -2
@@ -1,8 +1,294 @@
1
- 'use strict';
2
- // Onairos SDK - Asset Registry (auto-generated)
3
- var __ONAIROS_REQ_REGISTRY__ = [
4
- require("@react-native-async-storage/async-storage"),
5
- require("../config/api")
6
- ];
7
- function __ONAIROS_REQ_FUNC__(i) { return __ONAIROS_REQ_REGISTRY__[i]; }
8
- Object[_0x54d0(0x0)](exports,_0x54d0(0x1),{'value':!![]}),exports[_0x54d0(0x2)]=exports['storeLLMData']=exports[_0x54d0(0x3)]=exports[_0x54d0(0x4)]=exports[_0x54d0(0x5)]=exports['getLLMMetadata']=exports[_0x54d0(0x6)]=exports[_0x54d0(0x7)]=exports['formatLLMDataForDeveloper']=exports[_0x54d0(0x8)]=void 0x0;var _asyncStorage=_interopRequireDefault(__ONAIROS_REQ_FUNC__(0x0)),_api=__ONAIROS_REQ_FUNC__(0x1);function _interopRequireDefault(_0x1425f5){return _0x1425f5&&_0x1425f5[_0x54d0(0x1)]?_0x1425f5:{'default':_0x1425f5};}const LLM_DATA_STORAGE_KEY=_0x54d0(0x9),LLM_METADATA_STORAGE_KEY=_0x54d0(0xa),storeLLMData=async _0x32c34b=>{const _0x549055={'muCOf':'❌\x20Failed\x20to\x20request\x20LLM\x20data\x20from\x20backend:','PiScV':function(_0x23a5df,_0x6c6b71){return _0x23a5df instanceof _0x6c6b71;},'qxuiW':_0x54d0(0xb),'RuOdj':_0x54d0(0xc),'emLOH':_0x54d0(0xd),'ilgWN':'❌\x20Failed\x20to\x20store\x20LLM\x20data:'};try{console[_0x54d0(0xe)](_0x54d0(0xf)),await _asyncStorage[_0x54d0(0x10)][_0x54d0(0x11)](LLM_DATA_STORAGE_KEY+':'+_0x32c34b[_0x54d0(0x12)],JSON[_0x54d0(0x13)](_0x32c34b));const _0x14178f={'userId':_0x32c34b[_0x54d0(0x12)],'email':_0x32c34b['email'],'appName':_0x32c34b[_0x54d0(0x14)],'timestamp':_0x32c34b[_0x54d0(0x15)],'hasData':!![],'dataSize':JSON[_0x54d0(0x13)](_0x32c34b['data'])[_0x54d0(0x16)],'connectionStatus':_0x54d0(0x17)};return await _asyncStorage[_0x54d0(0x10)][_0x54d0(0x11)](LLM_METADATA_STORAGE_KEY+':'+_0x32c34b['userId'],JSON[_0x54d0(0x13)](_0x14178f)),console[_0x54d0(0xe)](_0x549055[_0x54d0(0x18)]),console['log'](_0x54d0(0x19)+_0x14178f[_0x54d0(0x1a)]+'\x20bytes'),!![];}catch(_0x3770dd){return'CkGZC'===_0x549055['emLOH']?(console['error'](_0x549055[_0x54d0(0x1b)],_0x3770dd),![]):(_0x5f222e['error'](_0x549055['muCOf'],_0x3e1d18),{'success':![],'message':_0x549055[_0x54d0(0x1c)](_0x2e57bb,_0x5e9bc3)?_0xb47868[_0x54d0(0x1d)]:_0x549055[_0x54d0(0x1e)]});}};exports[_0x54d0(0x1f)]=storeLLMData;const getLLMData=async _0x58b3b0=>{const _0x3f33b3={'iPUmB':function(_0x4992d0,_0x3d82a1){return _0x4992d0!==_0x3d82a1;},'KYDGR':_0x54d0(0x20),'aGxmM':_0x54d0(0x21),'Hcxdc':'✅\x20Retrieved\x20LLM\x20data\x20for\x20user:','EvcLm':'❌\x20Failed\x20to\x20retrieve\x20LLM\x20data:'};try{const _0x47d442=await _asyncStorage[_0x54d0(0x10)][_0x54d0(0x22)](LLM_DATA_STORAGE_KEY+':'+_0x58b3b0);if(!_0x47d442)return _0x3f33b3[_0x54d0(0x23)](_0x3f33b3['KYDGR'],_0x54d0(0x24))?(console['log'](_0x3f33b3['aGxmM'],_0x58b3b0),null):_0x120e7d&&_0x3ea39b[_0x54d0(0x1)]?_0x35b3e:{'default':_0x3e2776};const _0x5a25b0=JSON[_0x54d0(0x25)](_0x47d442);return console['log'](_0x3f33b3[_0x54d0(0x26)],_0x58b3b0),_0x5a25b0;}catch(_0x2b43ec){return console[_0x54d0(0x27)](_0x3f33b3['EvcLm'],_0x2b43ec),null;}};exports['getLLMData']=getLLMData;function _0x4b8e(){const _0x55a5df=['defineProperty','__esModule','updateLLMStatus','sendLLMDataToBackend','requestLLMDataForDeveloper','hasOnlyLLMConnection','getLLMData','getAllLLMDataKeys','clearLLMData','@onairos:llm_data','@onairos:llm_metadata','Unknown\x20error','✅\x20LLM\x20data\x20stored\x20locally\x20successfully','CkGZC','log','💾\x20Storing\x20LLM\x20data\x20locally\x20(temporary)...','default','setItem','userId','stringify','appName','timestamp','length','connected','RuOdj','📊\x20Data\x20size:\x20','dataSize','ilgWN','PiScV','message','qxuiW','storeLLMData','BwfsV','ℹ️\x20No\x20LLM\x20data\x20found\x20for\x20user:','getItem','iPUmB','bFqJe','parse','Hcxdc','error','❌\x20Failed\x20to\x20retrieve\x20LLM\x20metadata:','MIPcQ','uSwaq','❌\x20Failed\x20to\x20clear\x20LLM\x20data:','getLLMMetadata','❌\x20Failed\x20to\x20get\x20LLM\x20data\x20keys:','kzODz','icMUt','⚠️\x20No\x20LLM\x20metadata\x20found\x20for\x20user:','❌\x20Failed\x20to\x20update\x20LLM\x20status:','dHvNT','email','qrMdB','data','preferences','toISOString','FNKHq','warn','nzgOX','✅\x20Updated\x20LLM\x20status\x20to:\x20','YNrNf','pQNWu','BUzrZ','❌\x20Failed\x20to\x20send\x20data\x20to\x20backend:','✅\x20LLM\x20data\x20cleared\x20for\x20user:','WMHqO','VwNuE','StaqZ','removeItem','Xphcn','🔍\x20Platform\x20connection\x20check:','entries','map','includes','chatgpt','chatHistory','1.0','formatLLMDataForDeveloper','WWpUv','✅\x20Backend\x20received\x20and\x20stored\x20LLM\x20data:','❌\x20Backend\x20data\x20ingestion\x20failed:','yQCGP','wjDyn','uAJMg','GFKDl','vgkIl','API_CONFIG','BASE_URL','/llmdata','Bearer\x20','oKkCL','vslED','refreshToken','json','connectionId','text','irsod','Backend\x20error:\x20','status','jPBPE','UUOsp','bIEEo','✅\x20Backend\x20processing\x20LLM\x20data\x20request:','❌\x20Failed\x20to\x20request\x20LLM\x20data:','sVIZV','apiUrl','token','Ycold','OukjT','nCKhH','NnOvP','BIZhv','IDyQM','rdpQD','ksuBV','getAllKeys','filter','startsWith','uNOpu'];_0x4b8e=function(){return _0x55a5df;};return _0x4b8e();}const getLLMMetadata=async _0x51d361=>{const _0x3b3d37={'MIPcQ':'uSwaq','UwkQk':_0x54d0(0x28)};try{const _0x160860=await _asyncStorage[_0x54d0(0x10)][_0x54d0(0x22)](LLM_METADATA_STORAGE_KEY+':'+_0x51d361);if(!_0x160860)return null;return JSON[_0x54d0(0x25)](_0x160860);}catch(_0x35c33c){return _0x3b3d37[_0x54d0(0x29)]===_0x54d0(0x2a)?(console['error'](_0x3b3d37['UwkQk'],_0x35c33c),null):(_0x23d35e[_0x54d0(0x27)](_0x54d0(0x2b),_0x568917),![]);}};exports[_0x54d0(0x2c)]=getLLMMetadata;const updateLLMStatus=async(_0x4e697a,_0x10ce42)=>{const _0x5b9c2e={'qrMdB':'chatgpt','pQNWu':_0x54d0(0x2d),'dHvNT':function(_0x14dc3f,_0x5ec061){return _0x14dc3f===_0x5ec061;},'SXqLh':_0x54d0(0x2e),'nVDeh':function(_0xb8b726,_0x37885c){return _0xb8b726(_0x37885c);},'FNKHq':_0x54d0(0x2f),'nzgOX':_0x54d0(0x30),'rvxxg':'ngOvs','BUzrZ':_0x54d0(0x31)};try{if(_0x5b9c2e[_0x54d0(0x32)](_0x5b9c2e['SXqLh'],'lJzTm'))return{'platform':'llm','userId':_0x4e4a06[_0x54d0(0x12)],'email':_0x42fa5c[_0x54d0(0x33)],'timestamp':_0x2c5ef8[_0x54d0(0x15)],'data':{'type':_0x5b9c2e[_0x54d0(0x34)],'conversations':_0x35daad[_0x54d0(0x35)]['conversations']||[],'chatHistory':_0x5d090a['data']['chatHistory']||[],'preferences':_0x469628[_0x54d0(0x35)][_0x54d0(0x36)]||{},'customData':_0x9af8f9['data']['customData']||{}},'metadata':{'appName':_0x3b4455[_0x54d0(0x14)],'collectedAt':new _0x4abef2(_0x2d3c62['timestamp'])[_0x54d0(0x37)](),'dataVersion':'1.0'}};else{const _0x43b1c3=await _0x5b9c2e['nVDeh'](getLLMMetadata,_0x4e697a);if(!_0x43b1c3)return _0x5b9c2e[_0x54d0(0x32)](_0x54d0(0x2f),_0x5b9c2e[_0x54d0(0x38)])?(console[_0x54d0(0x39)](_0x5b9c2e[_0x54d0(0x3a)],_0x4e697a),![]):(_0x298c4a[_0x54d0(0x39)](_0x54d0(0x30),_0x6368ca),![]);return _0x43b1c3['connectionStatus']=_0x10ce42,await _asyncStorage[_0x54d0(0x10)][_0x54d0(0x11)](LLM_METADATA_STORAGE_KEY+':'+_0x4e697a,JSON[_0x54d0(0x13)](_0x43b1c3)),console['log'](_0x54d0(0x3b)+_0x10ce42),!![];}}catch(_0x32c5dc){return _0x5b9c2e['rvxxg']===_0x54d0(0x3c)?(_0x1f31fd[_0x54d0(0x27)](_0x5b9c2e[_0x54d0(0x3d)],_0xe3b0ed),[]):(console['error'](_0x5b9c2e[_0x54d0(0x3e)],_0x32c5dc),![]);}};exports[_0x54d0(0x2)]=updateLLMStatus;const clearLLMData=async _0x53beb0=>{const _0xe417ec={'StaqZ':_0x54d0(0x3f),'kCols':function(_0x2c7698,_0x4b19fb){return _0x2c7698 instanceof _0x4b19fb;},'SHugN':function(_0x1390a2,_0x4660f8){return _0x1390a2===_0x4660f8;},'zpazA':_0x54d0(0x40),'Xphcn':'❌\x20Failed\x20to\x20clear\x20LLM\x20data:'};try{return _0xe417ec['SHugN'](_0x54d0(0x41),_0x54d0(0x42))?(_0xf93c3b[_0x54d0(0x27)](_0xe417ec[_0x54d0(0x43)],_0x5ced17),{'success':![],'message':_0xe417ec['kCols'](_0x40f9aa,_0x75d539)?_0x1d5600[_0x54d0(0x1d)]:_0x54d0(0xb)}):(await _asyncStorage[_0x54d0(0x10)]['removeItem'](LLM_DATA_STORAGE_KEY+':'+_0x53beb0),await _asyncStorage[_0x54d0(0x10)][_0x54d0(0x44)](LLM_METADATA_STORAGE_KEY+':'+_0x53beb0),console[_0x54d0(0xe)](_0xe417ec['zpazA'],_0x53beb0),!![]);}catch(_0x2ef2b5){return console[_0x54d0(0x27)](_0xe417ec[_0x54d0(0x45)],_0x2ef2b5),![];}};exports[_0x54d0(0x8)]=clearLLMData;const hasOnlyLLMConnection=_0x2ae419=>{const _0x1af687={'VlTsL':_0x54d0(0x46)},_0x3e918c=Object[_0x54d0(0x47)](_0x2ae419)['filter'](([_0x3a167d,_0x569c35])=>_0x569c35)[_0x54d0(0x48)](([_0x498f96,_0x581314])=>_0x498f96),_0x2be1e5=_0x3e918c[_0x54d0(0x49)]('llm')||_0x3e918c[_0x54d0(0x49)](_0x54d0(0x4a)),_0x43d4b0=_0x3e918c[_0x54d0(0x16)]===0x1&&_0x2be1e5;return console['log'](_0x1af687['VlTsL'],{'connectedPlatforms':_0x3e918c,'hasLLM':_0x2be1e5,'onlyLLM':_0x43d4b0}),_0x43d4b0;};function _0x54d0(_0x4b8eaf,_0x54d094){_0x4b8eaf=_0x4b8eaf-0x0;const _0x45eb0d=_0x4b8e();let _0xa990ab=_0x45eb0d[_0x4b8eaf];return _0xa990ab;}exports[_0x54d0(0x5)]=hasOnlyLLMConnection;const formatLLMDataForDeveloper=_0x31ed6a=>{const _0x2fe279={'NwvYh':_0x54d0(0x4a)};return{'platform':'llm','userId':_0x31ed6a[_0x54d0(0x12)],'email':_0x31ed6a[_0x54d0(0x33)],'timestamp':_0x31ed6a[_0x54d0(0x15)],'data':{'type':_0x2fe279['NwvYh'],'conversations':_0x31ed6a[_0x54d0(0x35)]['conversations']||[],'chatHistory':_0x31ed6a[_0x54d0(0x35)][_0x54d0(0x4b)]||[],'preferences':_0x31ed6a[_0x54d0(0x35)][_0x54d0(0x36)]||{},'customData':_0x31ed6a['data']['customData']||{}},'metadata':{'appName':_0x31ed6a[_0x54d0(0x14)],'collectedAt':new Date(_0x31ed6a['timestamp'])['toISOString'](),'dataVersion':_0x54d0(0x4c)}};};exports[_0x54d0(0x4d)]=formatLLMDataForDeveloper;const sendLLMDataToBackend=async(_0x7aed21,_0x48c7ce)=>{const _0x2cb827={'GFKDl':_0x54d0(0x31),'bIEEo':_0x54d0(0x21),'wjDyn':function(_0x37f8e8,_0x21c9f1){return _0x37f8e8!==_0x21c9f1;},'uAJMg':_0x54d0(0x4e),'vgkIl':'📡\x20Sending\x20LLM\x20data\x20to\x20backend\x20for\x20processing...','CTjKB':function(_0x2507f4,_0xfe953a){return _0x2507f4&&_0xfe953a;},'oKkCL':'llm','vslED':_0x54d0(0x4a),'Ytyhx':_0x54d0(0x4f),'irsod':_0x54d0(0x50),'tTxIr':_0x54d0(0x51),'nJaBz':_0x54d0(0x3f),'jPBPE':function(_0x2db1e1,_0x27ed13){return _0x2db1e1 instanceof _0x27ed13;},'UUOsp':_0x54d0(0xb)};try{if(_0x2cb827[_0x54d0(0x52)](_0x2cb827[_0x54d0(0x53)],_0x2cb827[_0x54d0(0x53)]))return _0x3981a9[_0x54d0(0x27)](_0x2cb827[_0x54d0(0x54)],_0x3c3fe1),![];else{console[_0x54d0(0xe)](_0x2cb827[_0x54d0(0x55)]);const _0x468f6f=await fetch(_api[_0x54d0(0x56)][_0x54d0(0x57)]+_0x54d0(0x58),{'method':'POST','headers':{'Content-Type':'application/json',..._0x2cb827['CTjKB'](_0x48c7ce,{'Authorization':_0x54d0(0x59)+_0x48c7ce})},'body':JSON[_0x54d0(0x13)]({'userId':_0x7aed21[_0x54d0(0x12)],'email':_0x7aed21['email'],'appName':_0x7aed21[_0x54d0(0x14)],'platform':_0x2cb827[_0x54d0(0x5a)],'connectionType':_0x2cb827[_0x54d0(0x5b)],'timestamp':new Date()[_0x54d0(0x37)](),'data':_0x7aed21[_0x54d0(0x35)],'accessToken':_0x7aed21['accessToken'],'refreshToken':_0x7aed21[_0x54d0(0x5c)],'tokenExpiry':_0x7aed21['tokenExpiry'],'metadata':{'collectedAt':new Date(_0x7aed21['timestamp'])[_0x54d0(0x37)](),'dataVersion':_0x54d0(0x4c)}})});if(_0x468f6f['ok']){const _0x10f9ef=await _0x468f6f[_0x54d0(0x5d)]();return console['log'](_0x2cb827['Ytyhx'],_0x10f9ef),{'success':!![],'message':_0x10f9ef[_0x54d0(0x1d)],'connectionId':_0x10f9ef[_0x54d0(0x5e)]};}else{const _0xfa0232=await _0x468f6f[_0x54d0(0x5f)]();return console[_0x54d0(0x27)](_0x2cb827[_0x54d0(0x60)],_0x468f6f['status'],_0xfa0232),{'success':![],'message':_0x54d0(0x61)+_0x468f6f[_0x54d0(0x62)]};}}}catch(_0x51cd24){return _0x54d0(0x51)===_0x2cb827['tTxIr']?(console[_0x54d0(0x27)](_0x2cb827['nJaBz'],_0x51cd24),{'success':![],'message':_0x2cb827[_0x54d0(0x63)](_0x51cd24,Error)?_0x51cd24[_0x54d0(0x1d)]:_0x2cb827[_0x54d0(0x64)]}):(_0x17c651[_0x54d0(0xe)](_0x2cb827[_0x54d0(0x65)],_0x33a3aa),null);}};exports[_0x54d0(0x3)]=sendLLMDataToBackend;const requestLLMDataForDeveloper=async(_0x3413c3,_0x4b9f4d,_0x40df54,_0x39cb03,_0x1f8162)=>{const _0x1cb70c={'ZhOQU':_0x54d0(0x66),'Ycold':_0x54d0(0x67),'mkQSJ':function(_0x4879ea,_0x32edb7){return _0x4879ea!==_0x32edb7;},'OukjT':_0x54d0(0x68),'nCKhH':function(_0x421c4d,_0xc28f13){return _0x421c4d instanceof _0xc28f13;},'NnOvP':_0x54d0(0xb)};try{console['log']('📤\x20Requesting\x20backend\x20to\x20send\x20LLM\x20data\x20to\x20developer...');const _0x3ed0fa=await fetch(_api[_0x54d0(0x56)]['BASE_URL']+'/llmdata/request',{'method':'POST','headers':{'Content-Type':'application/json','Authorization':_0x54d0(0x59)+_0x1f8162},'body':JSON[_0x54d0(0x13)]({'userId':_0x3413c3,'email':_0x4b9f4d,'appName':_0x40df54,'requestedData':_0x39cb03,'timestamp':new Date()[_0x54d0(0x37)]()})});if(_0x3ed0fa['ok']){const _0x22b396=await _0x3ed0fa['json']();return console[_0x54d0(0xe)](_0x1cb70c['ZhOQU'],_0x22b396),{'success':!![],'message':_0x22b396[_0x54d0(0x1d)],'apiUrl':_0x22b396[_0x54d0(0x69)],'token':_0x22b396[_0x54d0(0x6a)]};}else{const _0xb36a14=await _0x3ed0fa[_0x54d0(0x5f)]();return console[_0x54d0(0x27)](_0x1cb70c[_0x54d0(0x6b)],_0x3ed0fa[_0x54d0(0x62)],_0xb36a14),{'success':![],'message':_0x54d0(0x61)+_0x3ed0fa[_0x54d0(0x62)]};}}catch(_0x574e51){return _0x1cb70c['mkQSJ'](_0x1cb70c['OukjT'],_0x1cb70c[_0x54d0(0x6c)])?null:(console[_0x54d0(0x27)]('❌\x20Failed\x20to\x20request\x20LLM\x20data\x20from\x20backend:',_0x574e51),{'success':![],'message':_0x1cb70c[_0x54d0(0x6d)](_0x574e51,Error)?_0x574e51[_0x54d0(0x1d)]:_0x1cb70c[_0x54d0(0x6e)]});}};exports['requestLLMDataForDeveloper']=requestLLMDataForDeveloper;const getAllLLMDataKeys=async()=>{const _0x42dbe8={'aAEXu':_0x54d0(0x28),'rdpQD':_0x54d0(0x6f),'ksuBV':_0x54d0(0x70),'uNOpu':_0x54d0(0x2d)};try{if(_0x42dbe8[_0x54d0(0x71)]===_0x42dbe8[_0x54d0(0x72)])return _0x1d07e5[_0x54d0(0x27)](_0x42dbe8['aAEXu'],_0x24ac96),null;else{const _0x2d8f4f=await _asyncStorage[_0x54d0(0x10)][_0x54d0(0x73)](),_0x47ca32=_0x2d8f4f[_0x54d0(0x74)](_0x5d190b=>_0x5d190b[_0x54d0(0x75)](LLM_DATA_STORAGE_KEY)||_0x5d190b[_0x54d0(0x75)](LLM_METADATA_STORAGE_KEY));return _0x47ca32;}}catch(_0x5e6534){return console[_0x54d0(0x27)](_0x42dbe8[_0x54d0(0x76)],_0x5e6534),[];}};exports[_0x54d0(0x7)]=getAllLLMDataKeys;
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.updateLLMStatus = exports.storeLLMData = exports.sendLLMDataToBackend = exports.requestLLMDataForDeveloper = exports.hasOnlyLLMConnection = exports.getLLMMetadata = exports.getLLMData = exports.getAllLLMDataKeys = exports.formatLLMDataForDeveloper = exports.clearLLMData = void 0;
7
+ var _asyncStorage = _interopRequireDefault(require("@react-native-async-storage/async-storage"));
8
+ var _api = require("../config/api");
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ /**
11
+ * LLM Data Storage Service
12
+ *
13
+ * Temporary storage solution for LLM (ChatGPT) data until full backend processing is implemented.
14
+ *
15
+ * Flow:
16
+ * 1. When user connects ONLY LLM data → Store data locally, send metadata to backend
17
+ * 2. When user accepts data request → Send stored LLM data directly to developer
18
+ *
19
+ * This is a TEMPORARY feature until full LLM data processing is available.
20
+ */
21
+
22
+ const LLM_DATA_STORAGE_KEY = '@onairos:llm_data';
23
+ const LLM_METADATA_STORAGE_KEY = '@onairos:llm_metadata';
24
+ /**
25
+ * Store LLM data locally (temporary storage)
26
+ */
27
+ const storeLLMData = async payload => {
28
+ try {
29
+ console.log('💾 Storing LLM data locally (temporary)...');
30
+
31
+ // Store the full data payload
32
+ await _asyncStorage.default.setItem(`${LLM_DATA_STORAGE_KEY}:${payload.userId}`, JSON.stringify(payload));
33
+
34
+ // Store metadata separately for quick access
35
+ const metadata = {
36
+ userId: payload.userId,
37
+ email: payload.email,
38
+ appName: payload.appName,
39
+ timestamp: payload.timestamp,
40
+ hasData: true,
41
+ dataSize: JSON.stringify(payload.data).length,
42
+ connectionStatus: 'connected'
43
+ };
44
+ await _asyncStorage.default.setItem(`${LLM_METADATA_STORAGE_KEY}:${payload.userId}`, JSON.stringify(metadata));
45
+ console.log('✅ LLM data stored locally successfully');
46
+ console.log(`📊 Data size: ${metadata.dataSize} bytes`);
47
+ return true;
48
+ } catch (error) {
49
+ console.error('❌ Failed to store LLM data:', error);
50
+ return false;
51
+ }
52
+ };
53
+
54
+ /**
55
+ * Retrieve stored LLM data
56
+ */
57
+ exports.storeLLMData = storeLLMData;
58
+ const getLLMData = async userId => {
59
+ try {
60
+ const storedData = await _asyncStorage.default.getItem(`${LLM_DATA_STORAGE_KEY}:${userId}`);
61
+ if (!storedData) {
62
+ console.log('ℹ️ No LLM data found for user:', userId);
63
+ return null;
64
+ }
65
+ const payload = JSON.parse(storedData);
66
+ console.log('✅ Retrieved LLM data for user:', userId);
67
+ return payload;
68
+ } catch (error) {
69
+ console.error('❌ Failed to retrieve LLM data:', error);
70
+ return null;
71
+ }
72
+ };
73
+
74
+ /**
75
+ * Get LLM metadata (quick check without loading full data)
76
+ */
77
+ exports.getLLMData = getLLMData;
78
+ const getLLMMetadata = async userId => {
79
+ try {
80
+ const storedMetadata = await _asyncStorage.default.getItem(`${LLM_METADATA_STORAGE_KEY}:${userId}`);
81
+ if (!storedMetadata) {
82
+ return null;
83
+ }
84
+ return JSON.parse(storedMetadata);
85
+ } catch (error) {
86
+ console.error('❌ Failed to retrieve LLM metadata:', error);
87
+ return null;
88
+ }
89
+ };
90
+
91
+ /**
92
+ * Update LLM connection status
93
+ */
94
+ exports.getLLMMetadata = getLLMMetadata;
95
+ const updateLLMStatus = async (userId, status) => {
96
+ try {
97
+ const metadata = await getLLMMetadata(userId);
98
+ if (!metadata) {
99
+ console.warn('⚠️ No LLM metadata found for user:', userId);
100
+ return false;
101
+ }
102
+ metadata.connectionStatus = status;
103
+ await _asyncStorage.default.setItem(`${LLM_METADATA_STORAGE_KEY}:${userId}`, JSON.stringify(metadata));
104
+ console.log(`✅ Updated LLM status to: ${status}`);
105
+ return true;
106
+ } catch (error) {
107
+ console.error('❌ Failed to update LLM status:', error);
108
+ return false;
109
+ }
110
+ };
111
+
112
+ /**
113
+ * Clear stored LLM data after successful transmission
114
+ */
115
+ exports.updateLLMStatus = updateLLMStatus;
116
+ const clearLLMData = async userId => {
117
+ try {
118
+ await _asyncStorage.default.removeItem(`${LLM_DATA_STORAGE_KEY}:${userId}`);
119
+ await _asyncStorage.default.removeItem(`${LLM_METADATA_STORAGE_KEY}:${userId}`);
120
+ console.log('✅ LLM data cleared for user:', userId);
121
+ return true;
122
+ } catch (error) {
123
+ console.error('❌ Failed to clear LLM data:', error);
124
+ return false;
125
+ }
126
+ };
127
+
128
+ /**
129
+ * Check if user has ONLY LLM data connected (no other platforms)
130
+ */
131
+ exports.clearLLMData = clearLLMData;
132
+ const hasOnlyLLMConnection = platformToggles => {
133
+ const connectedPlatforms = Object.entries(platformToggles).filter(([_, connected]) => connected).map(([platform, _]) => platform);
134
+
135
+ // Check if ONLY 'llm' or 'chatgpt' is connected
136
+ const hasLLM = connectedPlatforms.includes('llm') || connectedPlatforms.includes('chatgpt');
137
+ const onlyLLM = connectedPlatforms.length === 1 && hasLLM;
138
+ console.log('🔍 Platform connection check:', {
139
+ connectedPlatforms,
140
+ hasLLM,
141
+ onlyLLM
142
+ });
143
+ return onlyLLM;
144
+ };
145
+
146
+ /**
147
+ * Format LLM data for developer API
148
+ */
149
+ exports.hasOnlyLLMConnection = hasOnlyLLMConnection;
150
+ const formatLLMDataForDeveloper = payload => {
151
+ return {
152
+ platform: 'llm',
153
+ userId: payload.userId,
154
+ email: payload.email,
155
+ timestamp: payload.timestamp,
156
+ data: {
157
+ type: 'chatgpt',
158
+ conversations: payload.data.conversations || [],
159
+ chatHistory: payload.data.chatHistory || [],
160
+ preferences: payload.data.preferences || {},
161
+ customData: payload.data.customData || {}
162
+ },
163
+ metadata: {
164
+ appName: payload.appName,
165
+ collectedAt: new Date(payload.timestamp).toISOString(),
166
+ dataVersion: '1.0'
167
+ }
168
+ };
169
+ };
170
+
171
+ /**
172
+ * Send LLM data directly to backend for processing and storage
173
+ * FULL BACKEND IMPLEMENTATION - Backend handles all data processing
174
+ */
175
+ exports.formatLLMDataForDeveloper = formatLLMDataForDeveloper;
176
+ const sendLLMDataToBackend = async (payload, authToken) => {
177
+ try {
178
+ console.log('📡 Sending LLM data to backend for processing...');
179
+ const response = await fetch(`${_api.API_CONFIG.BASE_URL}/llmdata`, {
180
+ method: 'POST',
181
+ headers: {
182
+ 'Content-Type': 'application/json',
183
+ ...(authToken && {
184
+ 'Authorization': `Bearer ${authToken}`
185
+ })
186
+ },
187
+ body: JSON.stringify({
188
+ userId: payload.userId,
189
+ email: payload.email,
190
+ appName: payload.appName,
191
+ platform: 'llm',
192
+ connectionType: 'chatgpt',
193
+ timestamp: new Date().toISOString(),
194
+ data: payload.data,
195
+ accessToken: payload.accessToken,
196
+ refreshToken: payload.refreshToken,
197
+ tokenExpiry: payload.tokenExpiry,
198
+ metadata: {
199
+ collectedAt: new Date(payload.timestamp).toISOString(),
200
+ dataVersion: '1.0'
201
+ }
202
+ })
203
+ });
204
+ if (response.ok) {
205
+ const result = await response.json();
206
+ console.log('✅ Backend received and stored LLM data:', result);
207
+ return {
208
+ success: true,
209
+ message: result.message,
210
+ connectionId: result.connectionId
211
+ };
212
+ } else {
213
+ const errorText = await response.text();
214
+ console.error('❌ Backend data ingestion failed:', response.status, errorText);
215
+ return {
216
+ success: false,
217
+ message: `Backend error: ${response.status}`
218
+ };
219
+ }
220
+ } catch (error) {
221
+ console.error('❌ Failed to send data to backend:', error);
222
+ return {
223
+ success: false,
224
+ message: error instanceof Error ? error.message : 'Unknown error'
225
+ };
226
+ }
227
+ };
228
+
229
+ /**
230
+ * Request LLM data from backend to be sent to developer
231
+ * FULL BACKEND IMPLEMENTATION - Backend retrieves stored data and forwards to developer
232
+ */
233
+ exports.sendLLMDataToBackend = sendLLMDataToBackend;
234
+ const requestLLMDataForDeveloper = async (userId, email, appName, requestedData, authToken) => {
235
+ try {
236
+ console.log('📤 Requesting backend to send LLM data to developer...');
237
+
238
+ // Request backend to process and forward LLM data to developer
239
+ const response = await fetch(`${_api.API_CONFIG.BASE_URL}/llmdata/request`, {
240
+ method: 'POST',
241
+ headers: {
242
+ 'Content-Type': 'application/json',
243
+ 'Authorization': `Bearer ${authToken}`
244
+ },
245
+ body: JSON.stringify({
246
+ userId,
247
+ email,
248
+ appName,
249
+ requestedData,
250
+ timestamp: new Date().toISOString()
251
+ })
252
+ });
253
+ if (response.ok) {
254
+ const result = await response.json();
255
+ console.log('✅ Backend processing LLM data request:', result);
256
+ return {
257
+ success: true,
258
+ message: result.message,
259
+ apiUrl: result.apiUrl,
260
+ token: result.token
261
+ };
262
+ } else {
263
+ const errorText = await response.text();
264
+ console.error('❌ Failed to request LLM data:', response.status, errorText);
265
+ return {
266
+ success: false,
267
+ message: `Backend error: ${response.status}`
268
+ };
269
+ }
270
+ } catch (error) {
271
+ console.error('❌ Failed to request LLM data from backend:', error);
272
+ return {
273
+ success: false,
274
+ message: error instanceof Error ? error.message : 'Unknown error'
275
+ };
276
+ }
277
+ };
278
+
279
+ /**
280
+ * Get all stored LLM data keys (for debugging/admin purposes)
281
+ */
282
+ exports.requestLLMDataForDeveloper = requestLLMDataForDeveloper;
283
+ const getAllLLMDataKeys = async () => {
284
+ try {
285
+ const allKeys = await _asyncStorage.default.getAllKeys();
286
+ const llmKeys = allKeys.filter(key => key.startsWith(LLM_DATA_STORAGE_KEY) || key.startsWith(LLM_METADATA_STORAGE_KEY));
287
+ return llmKeys;
288
+ } catch (error) {
289
+ console.error('❌ Failed to get LLM data keys:', error);
290
+ return [];
291
+ }
292
+ };
293
+ exports.getAllLLMDataKeys = getAllLLMDataKeys;
294
+ //# sourceMappingURL=llmDataStorage.js.map
@@ -1,8 +1,186 @@
1
- 'use strict';
2
- // Onairos SDK - Asset Registry (auto-generated)
3
- var __ONAIROS_REQ_REGISTRY__ = [
4
- require("./authService"),
5
- require("../config/api")
6
- ];
7
- function __ONAIROS_REQ_FUNC__(i) { return __ONAIROS_REQ_REGISTRY__[i]; }
8
- Object[_0x23b4(0x0)](exports,_0x23b4(0x1),{'value':!![]}),exports[_0x23b4(0x2)]=exports[_0x23b4(0x3)]=exports['isTrainingInProgress']=exports[_0x23b4(0x4)]=exports[_0x23b4(0x5)]=exports[_0x23b4(0x6)]=exports['getHealthCheck']=void 0x0;var _authService=__ONAIROS_REQ_FUNC__(0x0),_api=__ONAIROS_REQ_FUNC__(0x1);const API_BASE_URL=''+_api[_0x23b4(0x7)][_0x23b4(0x8)],getTrainingStatus=async _0x14bec3=>{const _0x1b833f={'mXBnw':_0x23b4(0x9),'ALVzd':_0x23b4(0xa),'vzrtD':function(_0x17ef46,_0x4ef598){return _0x17ef46===_0x4ef598;},'qlbEj':_0x23b4(0xb),'KnAoB':_0x23b4(0xc),'eyXzC':_0x23b4(0xd),'eNiKa':function(_0xdf29c4,_0x353b40,_0x107a13){return _0xdf29c4(_0x353b40,_0x107a13);},'jltAY':_0x23b4(0xe)};try{if(_0x1b833f[_0x23b4(0xf)](_0x1b833f['qlbEj'],_0x1b833f['KnAoB'])){const _0xf1b0c7=_0x3c891d[_0x23b4(0x10)](_0x34ac6f);throw new _0x447d1e(_0xf1b0c7['error']||'HTTP\x20'+_0x21a269[_0x23b4(0x11)]);}else{const _0x4040b6=await(0x0,_authService[_0x23b4(0x12)])();if(!_0x4040b6){if(_0x1b833f['vzrtD']('sYQLD',_0x1b833f['eyXzC']))throw new Error('No\x20authentication\x20token\x20available');else return _0x2d4692[_0x23b4(0x13)](_0x1b833f['mXBnw'],_0x26db57),null;}const _0x286b1c=await _0x1b833f[_0x23b4(0x14)](fetch,API_BASE_URL+'/mobile-training/status/'+_0x14bec3,{'method':'GET','headers':{'Authorization':_0x4040b6,'Content-Type':'application/json'}});if(!_0x286b1c['ok']){if(_0x23b4(0xe)===_0x1b833f[_0x23b4(0x15)]){const _0x10aeb3=await _0x286b1c['json']();throw new Error(_0x10aeb3['error']||'HTTP\x20'+_0x286b1c[_0x23b4(0x11)]);}else{_0x377537[_0x23b4(0x16)](_0x1b833f['ALVzd'],_0x4ddf90);throw _0x3250c9;}}return await _0x286b1c[_0x23b4(0x17)]();}}catch(_0xfe3efd){console['error']('❌\x20Failed\x20to\x20get\x20training\x20status:',_0xfe3efd);throw _0xfe3efd;}};exports['getTrainingStatus']=getTrainingStatus;function _0x23b4(_0x52a2f5,_0x23b44e){_0x52a2f5=_0x52a2f5-0x0;const _0x401465=_0x52a2();let _0x5731df=_0x401465[_0x52a2f5];return _0x5731df;}const getModelInfo=async()=>{const _0xcf063e={'BhIdC':_0x23b4(0x18),'BpqFX':function(_0x1dba6d,_0x490ae6,_0x3c386f){return _0x1dba6d(_0x490ae6,_0x3c386f);},'ffRPi':_0x23b4(0x19)};try{const _0x28b885=await(0x0,_authService[_0x23b4(0x12)])();if(!_0x28b885)throw new Error(_0xcf063e[_0x23b4(0x1a)]);const _0x20b4e5=await _0xcf063e[_0x23b4(0x1b)](fetch,API_BASE_URL+_0x23b4(0x1c),{'method':'GET','headers':{'Authorization':_0x28b885,'Content-Type':'application/json'}});if(!_0x20b4e5['ok']){const _0xd7e4e6=await _0x20b4e5[_0x23b4(0x17)]();throw new Error(_0xd7e4e6['error']||'HTTP\x20'+_0x20b4e5['status']);}return await _0x20b4e5['json']();}catch(_0x51c551){console['error'](_0xcf063e['ffRPi'],_0x51c551);throw _0x51c551;}};exports[_0x23b4(0x6)]=getModelInfo;const getHealthCheck=async()=>{const _0x3b5334={'vDpOg':_0x23b4(0x1d),'sgQzH':_0x23b4(0x18),'AxiYl':function(_0x5077fe,_0x5aa38f){return _0x5077fe===_0x5aa38f;},'STQOB':_0x23b4(0x1e),'WdqbF':'vFkvH','KamGG':_0x23b4(0x1f),'LQrTz':_0x23b4(0x20),'eWnPF':function(_0x59ce8d,_0x4364d1){return _0x59ce8d!==_0x4364d1;},'SSFek':_0x23b4(0x21),'tcAGe':_0x23b4(0xa)};try{if(_0x3b5334[_0x23b4(0x22)](_0x3b5334['STQOB'],_0x3b5334[_0x23b4(0x23)])){_0xb2d7df[_0x23b4(0x16)](_0x3b5334[_0x23b4(0x24)],_0x12c0b2);throw _0x275169;}else{const _0x59f352=await fetch(API_BASE_URL+_0x23b4(0x25),{'method':'GET','headers':{'Content-Type':'application/json'}});if(!_0x59f352['ok']){if(_0x3b5334['AxiYl'](_0x3b5334[_0x23b4(0x26)],_0x3b5334[_0x23b4(0x27)]))throw new _0x31ce50(_0x3b5334[_0x23b4(0x28)]);else{const _0x5c1820=await _0x59f352[_0x23b4(0x17)]();throw new Error(_0x5c1820[_0x23b4(0x16)]||_0x23b4(0x29)+_0x59f352[_0x23b4(0x11)]);}}return await _0x59f352[_0x23b4(0x17)]();}}catch(_0x43ba1f){if(_0x3b5334['eWnPF'](_0x23b4(0x21),_0x3b5334[_0x23b4(0x2a)]))throw new _0x8015f8(_0x23b4(0x2b)+_0x474c27[_0x23b4(0x11)]+'\x20-\x20'+_0x58fee4);else{console[_0x23b4(0x16)](_0x3b5334[_0x23b4(0x2c)],_0x43ba1f);throw _0x43ba1f;}}};exports['getHealthCheck']=getHealthCheck;const startEnochTrainingWithYouTubeCheck=async _0x44dfe9=>{const _0x3fc0e6={'Jwxzu':'4|2|5|6|1|3|0','lzORY':function(_0x3c657c,_0x186c13){return _0x3c657c(_0x186c13);},'eqHjN':_0x23b4(0x2d),'AdqRC':'\x20\x20\x20-\x20Backend\x20validation:\x20Handles\x20all\x20edge\x20cases\x20✅','BNeTU':_0x23b4(0x2e),'zIIpM':_0x23b4(0x2f),'SeVYO':_0x23b4(0x30)};try{const _0x2e4e4c=_0x3fc0e6['Jwxzu'][_0x23b4(0x31)]('|');let _0x3bf565=0x0;while(!![]){switch(_0x2e4e4c[_0x3bf565++]){case'0':return await _0x3fc0e6[_0x23b4(0x32)](startEnochTraining,_0x44dfe9);case'1':console[_0x23b4(0x33)](_0x23b4(0x34));continue;case'2':console['log'](_0x3fc0e6[_0x23b4(0x35)]);continue;case'3':console['log'](_0x3fc0e6[_0x23b4(0x36)]);continue;case'4':console[_0x23b4(0x33)](_0x3fc0e6['BNeTU'],_0x44dfe9[_0x23b4(0x37)],'(backend\x20auto-handles\x20YouTube)');continue;case'5':console[_0x23b4(0x33)](_0x3fc0e6[_0x23b4(0x38)]);continue;case'6':console[_0x23b4(0x33)](_0x3fc0e6[_0x23b4(0x39)]);continue;}break;}}catch(_0x2bc2ab){console[_0x23b4(0x16)]('❌\x20Training\x20error:',_0x2bc2ab);throw _0x2bc2ab;}};exports[_0x23b4(0x2)]=startEnochTrainingWithYouTubeCheck;const startEnochTraining=async _0x513184=>{const _0x27867d={'qoLab':_0x23b4(0x19),'twKAE':_0x23b4(0x18),'zCkIO':_0x23b4(0x3a),'fggkA':function(_0x4e4824,_0x3e7699){return _0x4e4824!==_0x3e7699;},'rqcSb':_0x23b4(0x3b),'HuYsa':_0x23b4(0x3c),'hoBPe':_0x23b4(0x3d),'lviTv':function(_0x2d76e2,_0x17643d,_0x2345fa){return _0x2d76e2(_0x17643d,_0x2345fa);},'dBFXJ':_0x23b4(0x3e),'kQTNb':_0x23b4(0x3f),'XVHYi':_0x23b4(0x40),'OUbpX':_0x23b4(0x41),'wHEtu':_0x23b4(0x42),'qlOTv':_0x23b4(0x43)};try{if(_0x27867d['fggkA'](_0x27867d['rqcSb'],_0x27867d['rqcSb'])){_0x5ef055[_0x23b4(0x16)](_0x27867d[_0x23b4(0x44)],_0x28f7ff);throw _0x59535c;}else{const _0x1aa677=await(0x0,_authService[_0x23b4(0x12)])();if(!_0x1aa677){if(_0x27867d[_0x23b4(0x45)]===_0x27867d['HuYsa'])throw new Error(_0x23b4(0x18));else throw new _0x263267(_0x27867d['twKAE']);}console['log'](_0x27867d[_0x23b4(0x46)],_0x513184);const _0xd2fcc4=await _0x27867d['lviTv'](fetch,API_BASE_URL+'/mobile-training/enoch',{'method':'POST','headers':{'Content-Type':'application/json','Authorization':_0x1aa677},'body':JSON[_0x23b4(0x47)](_0x513184)});console[_0x23b4(0x33)](_0x27867d['dBFXJ'],_0xd2fcc4[_0x23b4(0x11)]);if(!_0xd2fcc4['ok']){const _0x5e6320=await _0xd2fcc4['text']();console[_0x23b4(0x16)](_0x27867d[_0x23b4(0x48)],_0xd2fcc4[_0x23b4(0x11)],_0x27867d[_0x23b4(0x49)],_0x5e6320);try{const _0x402049=JSON[_0x23b4(0x10)](_0x5e6320);throw new Error(_0x402049[_0x23b4(0x16)]||_0x23b4(0x29)+_0xd2fcc4[_0x23b4(0x11)]);}catch(_0x3b20e0){throw new Error(_0x23b4(0x2b)+_0xd2fcc4[_0x23b4(0x11)]+_0x23b4(0x4a)+_0x5e6320);}}const _0x3830cf=await _0xd2fcc4[_0x23b4(0x17)]();return console[_0x23b4(0x33)](_0x27867d[_0x23b4(0x4b)],_0x3830cf),_0x3830cf;}}catch(_0x2bde5a){if(_0x27867d[_0x23b4(0x4c)]!==_0x27867d[_0x23b4(0x4d)]){console['error'](_0x23b4(0x1d),_0x2bde5a);throw _0x2bde5a;}else return _0x38bc3d[_0x23b4(0x13)](_0x27867d[_0x23b4(0x4e)],_0x5e64f6),![];}};exports[_0x23b4(0x3)]=startEnochTraining;const isTrainingInProgress=async _0x24429f=>{const _0x25c4fb={'ztTZV':function(_0x9518ba,_0x2b9efa){return _0x9518ba(_0x2b9efa);},'DkfbM':_0x23b4(0x3a)};try{const _0x31dabd=await _0x25c4fb['ztTZV'](getTrainingStatus,_0x24429f);return _0x31dabd[_0x23b4(0x4f)]&&_0x31dabd[_0x23b4(0x50)];}catch(_0x1aee15){return console[_0x23b4(0x13)](_0x25c4fb[_0x23b4(0x51)],_0x1aee15),![];}};exports[_0x23b4(0x52)]=isTrainingInProgress;const getTrainingFeatures=async()=>{const _0x3b0a3c={'tFAPU':function(_0x34c521){return _0x34c521();},'SdpmC':'⚠️\x20Could\x20not\x20get\x20training\x20features:'};try{const _0x2763c3=await _0x3b0a3c[_0x23b4(0x53)](getHealthCheck);return _0x2763c3[_0x23b4(0x54)];}catch(_0x3f4ed7){return console[_0x23b4(0x13)](_0x3b0a3c['SdpmC'],_0x3f4ed7),null;}};exports['getTrainingFeatures']=getTrainingFeatures;function _0x52a2(){const _0x5d3506=['defineProperty','__esModule','startEnochTrainingWithYouTubeCheck','startEnochTraining','getTrainingStatus','getTrainingFeatures','getModelInfo','API_CONFIG','BASE_URL','⚠️\x20Could\x20not\x20get\x20training\x20features:','❌\x20Failed\x20to\x20get\x20health\x20check:','CeAtq','DlKHE','sYQLD','NRPpl','vzrtD','parse','status','getAuthToken','warn','eNiKa','jltAY','error','json','No\x20authentication\x20token\x20available','❌\x20Failed\x20to\x20get\x20model\x20info:','BhIdC','BpqFX','/mobile-training/model-info','❌\x20Training\x20start\x20error:','qCrLe','iURGX','KwRnH','lQoLf','AxiYl','WdqbF','vDpOg','/mobile-training/health','KamGG','LQrTz','sgQzH','HTTP\x20','SSFek','Training\x20API\x20failed:\x20','tcAGe','🚀\x20[TRAINING]\x20Starting\x20training\x20-\x20backend\x20handles\x20all\x20YouTube\x20cases\x20automatically','🚀\x20Starting\x20Enoch\x20training\x20for\x20user:','ℹ️\x20[TRAINING]\x20No\x20migration\x20checks\x20needed:','\x20\x20\x20-\x20Temporary\x20mode\x20connections:\x20Work\x20automatically\x20✅','split','lzORY','log','\x20\x20\x20-\x20Full\x20refresh\x20tokens:\x20Auto-refresh\x20when\x20expired\x20✅','eqHjN','AdqRC','username','zIIpM','SeVYO','⚠️\x20Could\x20not\x20check\x20training\x20status:','CHXKq','ddVFw','📤\x20Sending\x20training\x20data\x20to\x20/mobile-training/enoch:','📡\x20Training\x20API\x20response\x20status:','❌\x20Training\x20API\x20failed\x20with\x20status:','Error:','📡\x20Training\x20API\x20response:','FXvmt','pUxcx','qoLab','HuYsa','hoBPe','stringify','kQTNb','XVHYi','\x20-\x20','OUbpX','wHEtu','qlOTv','zCkIO','success','isTraining','DkfbM','isTrainingInProgress','tFAPU','features'];_0x52a2=function(){return _0x5d3506;};return _0x52a2();}
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.startEnochTrainingWithYouTubeCheck = exports.startEnochTraining = exports.isTrainingInProgress = exports.getTrainingStatus = exports.getTrainingFeatures = exports.getModelInfo = exports.getHealthCheck = void 0;
7
+ var _authService = require("./authService");
8
+ var _api = require("../config/api");
9
+ // Migration functions no longer needed - backend handles all YouTube cases automatically
10
+ // import { checkAndFixYouTubeConnection, getYouTubeConnectionStatus, shouldShowYouTubeMigrationWarning } from './youtubeMigrationService';
11
+
12
+ const API_BASE_URL = `${_api.API_CONFIG.BASE_URL}`;
13
+
14
+ /**
15
+ * Mobile Training API Service
16
+ * Implements the updated training spec routes
17
+ */
18
+
19
+ // Training Status Route
20
+ const getTrainingStatus = async username => {
21
+ try {
22
+ const authToken = await (0, _authService.getAuthToken)();
23
+ if (!authToken) {
24
+ throw new Error('No authentication token available');
25
+ }
26
+ const response = await fetch(`${API_BASE_URL}/mobile-training/status/${username}`, {
27
+ method: 'GET',
28
+ headers: {
29
+ 'Authorization': authToken,
30
+ 'Content-Type': 'application/json'
31
+ }
32
+ });
33
+ if (!response.ok) {
34
+ const errorData = await response.json();
35
+ throw new Error(errorData.error || `HTTP ${response.status}`);
36
+ }
37
+ return await response.json();
38
+ } catch (error) {
39
+ console.error('❌ Failed to get training status:', error);
40
+ throw error;
41
+ }
42
+ };
43
+
44
+ // Model Info Route
45
+ exports.getTrainingStatus = getTrainingStatus;
46
+ const getModelInfo = async () => {
47
+ try {
48
+ const authToken = await (0, _authService.getAuthToken)();
49
+ if (!authToken) {
50
+ throw new Error('No authentication token available');
51
+ }
52
+ const response = await fetch(`${API_BASE_URL}/mobile-training/model-info`, {
53
+ method: 'GET',
54
+ headers: {
55
+ 'Authorization': authToken,
56
+ 'Content-Type': 'application/json'
57
+ }
58
+ });
59
+ if (!response.ok) {
60
+ const errorData = await response.json();
61
+ throw new Error(errorData.error || `HTTP ${response.status}`);
62
+ }
63
+ return await response.json();
64
+ } catch (error) {
65
+ console.error('❌ Failed to get model info:', error);
66
+ throw error;
67
+ }
68
+ };
69
+
70
+ // Health Check Route
71
+ exports.getModelInfo = getModelInfo;
72
+ const getHealthCheck = async () => {
73
+ try {
74
+ const response = await fetch(`${API_BASE_URL}/mobile-training/health`, {
75
+ method: 'GET',
76
+ headers: {
77
+ 'Content-Type': 'application/json'
78
+ }
79
+ });
80
+ if (!response.ok) {
81
+ const errorData = await response.json();
82
+ throw new Error(errorData.error || `HTTP ${response.status}`);
83
+ }
84
+ return await response.json();
85
+ } catch (error) {
86
+ console.error('❌ Failed to get health check:', error);
87
+ throw error;
88
+ }
89
+ };
90
+
91
+ /**
92
+ * Start Enoch Training - Simplified Version
93
+ * Backend now handles all YouTube connection cases automatically (temporary mode, refresh tokens, etc.)
94
+ * No frontend migration checks needed anymore
95
+ */
96
+ exports.getHealthCheck = getHealthCheck;
97
+ const startEnochTrainingWithYouTubeCheck = async trainingData => {
98
+ try {
99
+ console.log('🚀 Starting Enoch training for user:', trainingData.username, '(backend auto-handles YouTube)');
100
+
101
+ // ✅ SIMPLIFIED: Backend handles all YouTube connection cases automatically
102
+ console.log('🚀 [TRAINING] Starting training - backend handles all YouTube cases automatically');
103
+ console.log('ℹ️ [TRAINING] No migration checks needed:');
104
+ console.log(' - Temporary mode connections: Work automatically ✅');
105
+ console.log(' - Full refresh tokens: Auto-refresh when expired ✅');
106
+ console.log(' - Backend validation: Handles all edge cases ✅');
107
+
108
+ // ✅ Proceed with training - backend handles YouTube automatically
109
+ return await startEnochTraining(trainingData);
110
+ } catch (error) {
111
+ console.error('❌ Training error:', error);
112
+ throw error;
113
+ }
114
+ };
115
+
116
+ /**
117
+ * Start Enoch Training
118
+ * Updated to use the new /mobile-training/enoch endpoint with proper error handling
119
+ */
120
+ exports.startEnochTrainingWithYouTubeCheck = startEnochTrainingWithYouTubeCheck;
121
+ const startEnochTraining = async trainingData => {
122
+ try {
123
+ const authToken = await (0, _authService.getAuthToken)();
124
+ if (!authToken) {
125
+ throw new Error('No authentication token available');
126
+ }
127
+ console.log('📤 Sending training data to /mobile-training/enoch:', trainingData);
128
+ const response = await fetch(`${API_BASE_URL}/mobile-training/enoch`, {
129
+ method: 'POST',
130
+ headers: {
131
+ 'Content-Type': 'application/json',
132
+ 'Authorization': authToken
133
+ },
134
+ body: JSON.stringify(trainingData)
135
+ });
136
+ console.log('📡 Training API response status:', response.status);
137
+ if (!response.ok) {
138
+ const errorText = await response.text();
139
+ console.error('❌ Training API failed with status:', response.status, 'Error:', errorText);
140
+
141
+ // Try to parse error response
142
+ try {
143
+ const errorData = JSON.parse(errorText);
144
+ throw new Error(errorData.error || `HTTP ${response.status}`);
145
+ } catch (parseError) {
146
+ throw new Error(`Training API failed: ${response.status} - ${errorText}`);
147
+ }
148
+ }
149
+ const result = await response.json();
150
+ console.log('📡 Training API response:', result);
151
+ return result;
152
+ } catch (error) {
153
+ console.error('❌ Training start error:', error);
154
+ throw error;
155
+ }
156
+ };
157
+
158
+ /**
159
+ * Helper function to check if training is in progress
160
+ */
161
+ exports.startEnochTraining = startEnochTraining;
162
+ const isTrainingInProgress = async username => {
163
+ try {
164
+ const status = await getTrainingStatus(username);
165
+ return status.success && status.isTraining;
166
+ } catch (error) {
167
+ console.warn('⚠️ Could not check training status:', error);
168
+ return false;
169
+ }
170
+ };
171
+
172
+ /**
173
+ * Helper function to get training features info
174
+ */
175
+ exports.isTrainingInProgress = isTrainingInProgress;
176
+ const getTrainingFeatures = async () => {
177
+ try {
178
+ const health = await getHealthCheck();
179
+ return health.features;
180
+ } catch (error) {
181
+ console.warn('⚠️ Could not get training features:', error);
182
+ return null;
183
+ }
184
+ };
185
+ exports.getTrainingFeatures = getTrainingFeatures;
186
+ //# sourceMappingURL=mobileTrainingService.js.map