@onairos/react-native 3.7.2 → 3.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +116 -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 +109 -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,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
- function _0x5a44(_0x403d84,_0x5a44e3){_0x403d84=_0x403d84-0x0;const _0x5128cd=_0x403d();let _0xb80215=_0x5128cd[_0x403d84];return _0xb80215;}Object[_0x5a44(0x0)](exports,_0x5a44(0x1),{'value':!![]}),exports['updateLLMStatus']=exports['storeLLMData']=exports[_0x5a44(0x2)]=exports[_0x5a44(0x3)]=exports[_0x5a44(0x4)]=exports[_0x5a44(0x5)]=exports[_0x5a44(0x6)]=exports[_0x5a44(0x7)]=exports[_0x5a44(0x8)]=exports[_0x5a44(0x9)]=void 0x0;var _asyncStorage=_interopRequireDefault(__ONAIROS_REQ_FUNC__(0x0)),_api=__ONAIROS_REQ_FUNC__(0x1);function _interopRequireDefault(_0x10b503){return _0x10b503&&_0x10b503['__esModule']?_0x10b503:{'default':_0x10b503};}const LLM_DATA_STORAGE_KEY='@onairos:llm_data',LLM_METADATA_STORAGE_KEY='@onairos:llm_metadata',storeLLMData=async _0x1db9c9=>{const _0x34b1ba={'oHzGo':_0x5a44(0xa),'vFsrl':'connected','CoYbT':_0x5a44(0xb),'ZVQeW':_0x5a44(0xc)};try{console[_0x5a44(0xd)](_0x34b1ba[_0x5a44(0xe)]),await _asyncStorage[_0x5a44(0xf)][_0x5a44(0x10)](LLM_DATA_STORAGE_KEY+':'+_0x1db9c9[_0x5a44(0x11)],JSON[_0x5a44(0x12)](_0x1db9c9));const _0x571336={'userId':_0x1db9c9['userId'],'email':_0x1db9c9[_0x5a44(0x13)],'appName':_0x1db9c9['appName'],'timestamp':_0x1db9c9['timestamp'],'hasData':!![],'dataSize':JSON[_0x5a44(0x12)](_0x1db9c9[_0x5a44(0x14)])[_0x5a44(0x15)],'connectionStatus':_0x34b1ba[_0x5a44(0x16)]};return await _asyncStorage[_0x5a44(0xf)][_0x5a44(0x10)](LLM_METADATA_STORAGE_KEY+':'+_0x1db9c9[_0x5a44(0x11)],JSON[_0x5a44(0x12)](_0x571336)),console[_0x5a44(0xd)](_0x34b1ba[_0x5a44(0x17)]),console[_0x5a44(0xd)](_0x5a44(0x18)+_0x571336[_0x5a44(0x19)]+_0x5a44(0x1a)),!![];}catch(_0x4044f7){return console[_0x5a44(0x1b)](_0x34b1ba[_0x5a44(0x1c)],_0x4044f7),![];}};exports[_0x5a44(0x1d)]=storeLLMData;const getLLMData=async _0x1c8a5d=>{const _0x2d80fb={'fikld':_0x5a44(0x1e),'qPtgM':_0x5a44(0x1f),'zaDRc':'❌\x20Failed\x20to\x20retrieve\x20LLM\x20data:'};try{const _0x1d5b1a=await _asyncStorage['default'][_0x5a44(0x20)](LLM_DATA_STORAGE_KEY+':'+_0x1c8a5d);if(!_0x1d5b1a)return console[_0x5a44(0xd)](_0x2d80fb[_0x5a44(0x21)],_0x1c8a5d),null;const _0x36c6c6=JSON['parse'](_0x1d5b1a);return console[_0x5a44(0xd)](_0x2d80fb[_0x5a44(0x22)],_0x1c8a5d),_0x36c6c6;}catch(_0x26167e){return console[_0x5a44(0x1b)](_0x2d80fb['zaDRc'],_0x26167e),null;}};exports['getLLMData']=getLLMData;const getLLMMetadata=async _0x41223c=>{const _0x32dc3f={'PQfIz':function(_0x517a3c,_0x43abf5){return _0x517a3c===_0x43abf5;},'GTuYL':_0x5a44(0x23),'ptUpX':function(_0x37f7ec,_0x259140){return _0x37f7ec!==_0x259140;},'YBqbd':'wqEdC','BfPwg':_0x5a44(0x24),'keYgw':'❌\x20Failed\x20to\x20retrieve\x20LLM\x20metadata:'};try{if(_0x32dc3f['PQfIz'](_0x32dc3f[_0x5a44(0x25)],_0x32dc3f[_0x5a44(0x25)])){const _0x46f623=await _asyncStorage[_0x5a44(0xf)][_0x5a44(0x20)](LLM_METADATA_STORAGE_KEY+':'+_0x41223c);if(!_0x46f623)return _0x32dc3f['ptUpX'](_0x32dc3f[_0x5a44(0x26)],_0x32dc3f[_0x5a44(0x26)])?null:null;return JSON[_0x5a44(0x27)](_0x46f623);}else return _0xcc6a08['error'](_0x5a44(0x28),_0x36950f),[];}catch(_0x21b2f1){return _0x32dc3f[_0x5a44(0x29)]!==_0x32dc3f[_0x5a44(0x29)]?(_0x4fdd31[_0x5a44(0x1b)](_0x5a44(0x2a),_0x34760c),null):(console['error'](_0x32dc3f[_0x5a44(0x2b)],_0x21b2f1),null);}};exports[_0x5a44(0x5)]=getLLMMetadata;const updateLLMStatus=async(_0x1f76e0,_0x65cb93)=>{const _0x20a006={'fFpeD':function(_0x270ce5,_0x2c04ae){return _0x270ce5(_0x2c04ae);},'iAKfQ':'⚠️\x20No\x20LLM\x20metadata\x20found\x20for\x20user:'};try{const _0x4bd1be=await _0x20a006[_0x5a44(0x2c)](getLLMMetadata,_0x1f76e0);if(!_0x4bd1be)return console[_0x5a44(0x2d)](_0x20a006[_0x5a44(0x2e)],_0x1f76e0),![];return _0x4bd1be[_0x5a44(0x2f)]=_0x65cb93,await _asyncStorage[_0x5a44(0xf)][_0x5a44(0x10)](LLM_METADATA_STORAGE_KEY+':'+_0x1f76e0,JSON[_0x5a44(0x12)](_0x4bd1be)),console[_0x5a44(0xd)](_0x5a44(0x30)+_0x65cb93),!![];}catch(_0x394c12){return console[_0x5a44(0x1b)]('❌\x20Failed\x20to\x20update\x20LLM\x20status:',_0x394c12),![];}};exports[_0x5a44(0x31)]=updateLLMStatus;const clearLLMData=async _0x253e34=>{const _0x23d4d7={'Ezjht':_0x5a44(0x32)};try{return await _asyncStorage[_0x5a44(0xf)][_0x5a44(0x33)](LLM_DATA_STORAGE_KEY+':'+_0x253e34),await _asyncStorage[_0x5a44(0xf)][_0x5a44(0x33)](LLM_METADATA_STORAGE_KEY+':'+_0x253e34),console[_0x5a44(0xd)](_0x23d4d7[_0x5a44(0x34)],_0x253e34),!![];}catch(_0x49adb4){return console[_0x5a44(0x1b)](_0x5a44(0x35),_0x49adb4),![];}};exports[_0x5a44(0x9)]=clearLLMData;const hasOnlyLLMConnection=_0x21174e=>{const _0x25292e={'wpUMO':'llm','aLdcY':_0x5a44(0x36),'MvohX':function(_0x5ec6e9,_0x264109){return _0x5ec6e9===_0x264109;},'lslNd':'🔍\x20Platform\x20connection\x20check:'},_0x3495ee=Object[_0x5a44(0x37)](_0x21174e)[_0x5a44(0x38)](([_0xb0f8d0,_0x15189e])=>_0x15189e)['map'](([_0x3ebf09,_0x1fca08])=>_0x3ebf09),_0x1675fc=_0x3495ee[_0x5a44(0x39)](_0x25292e[_0x5a44(0x3a)])||_0x3495ee[_0x5a44(0x39)](_0x25292e[_0x5a44(0x3b)]),_0x1bfcd1=_0x25292e['MvohX'](_0x3495ee['length'],0x1)&&_0x1675fc;return console['log'](_0x25292e[_0x5a44(0x3c)],{'connectedPlatforms':_0x3495ee,'hasLLM':_0x1675fc,'onlyLLM':_0x1bfcd1}),_0x1bfcd1;};exports[_0x5a44(0x4)]=hasOnlyLLMConnection;const formatLLMDataForDeveloper=_0x2c7658=>{const _0x39b71f={'ZoWfF':'llm','hbeeL':_0x5a44(0x36)};return{'platform':_0x39b71f[_0x5a44(0x3d)],'userId':_0x2c7658[_0x5a44(0x11)],'email':_0x2c7658[_0x5a44(0x13)],'timestamp':_0x2c7658[_0x5a44(0x3e)],'data':{'type':_0x39b71f[_0x5a44(0x3f)],'conversations':_0x2c7658['data'][_0x5a44(0x40)]||[],'chatHistory':_0x2c7658['data'][_0x5a44(0x41)]||[],'preferences':_0x2c7658[_0x5a44(0x14)]['preferences']||{},'customData':_0x2c7658[_0x5a44(0x14)][_0x5a44(0x42)]||{}},'metadata':{'appName':_0x2c7658[_0x5a44(0x43)],'collectedAt':new Date(_0x2c7658[_0x5a44(0x3e)])[_0x5a44(0x44)](),'dataVersion':_0x5a44(0x45)}};};function _0x403d(){const _0x2ab728=['defineProperty','__esModule','sendLLMDataToBackend','requestLLMDataForDeveloper','hasOnlyLLMConnection','getLLMMetadata','getLLMData','getAllLLMDataKeys','formatLLMDataForDeveloper','clearLLMData','💾\x20Storing\x20LLM\x20data\x20locally\x20(temporary)...','✅\x20LLM\x20data\x20stored\x20locally\x20successfully','❌\x20Failed\x20to\x20store\x20LLM\x20data:','log','oHzGo','default','setItem','userId','stringify','email','data','length','vFsrl','CoYbT','📊\x20Data\x20size:\x20','dataSize','\x20bytes','error','ZVQeW','storeLLMData','ℹ️\x20No\x20LLM\x20data\x20found\x20for\x20user:','✅\x20Retrieved\x20LLM\x20data\x20for\x20user:','getItem','fikld','qPtgM','Bglzi','sgJFc','GTuYL','YBqbd','parse','❌\x20Failed\x20to\x20get\x20LLM\x20data\x20keys:','BfPwg','❌\x20Failed\x20to\x20retrieve\x20LLM\x20metadata:','keYgw','fFpeD','warn','iAKfQ','connectionStatus','✅\x20Updated\x20LLM\x20status\x20to:\x20','updateLLMStatus','✅\x20LLM\x20data\x20cleared\x20for\x20user:','removeItem','Ezjht','❌\x20Failed\x20to\x20clear\x20LLM\x20data:','chatgpt','entries','filter','includes','wpUMO','aLdcY','lslNd','ZoWfF','timestamp','hbeeL','conversations','chatHistory','customData','appName','toISOString','1.0','📡\x20Sending\x20LLM\x20data\x20to\x20backend\x20for\x20processing...','llm','xtSCy','Unknown\x20error','cMiqG','API_CONFIG','BASE_URL','/llmdata','QNzei','Bearer\x20','fIcGW','VejVl','refreshToken','tokenExpiry','fDRZc','json','connectionId','text','hGQkO','Backend\x20error:\x20','status','BgBaO','message','JtkUk','ESCVM','GGEMF','hJWCF','📤\x20Requesting\x20backend\x20to\x20send\x20LLM\x20data\x20to\x20developer...','LVquC','✅\x20Backend\x20processing\x20LLM\x20data\x20request:','❌\x20Failed\x20to\x20request\x20LLM\x20data:','fWAMR','pxiwF','maIAe','dgDaO','/llmdata/request','nYmxl','VNtEj','token','WSvKC','❌\x20Failed\x20to\x20request\x20LLM\x20data\x20from\x20backend:','ArYvm','Qppjc','❌\x20Failed\x20to\x20send\x20data\x20to\x20backend:','getAllKeys','startsWith','NPkSk','tLsUG','gCYLq','ACaHo'];_0x403d=function(){return _0x2ab728;};return _0x403d();}exports[_0x5a44(0x8)]=formatLLMDataForDeveloper;const sendLLMDataToBackend=async(_0x312909,_0x23120e)=>{const _0x53e140={'ESCVM':_0x5a44(0xc),'cMiqG':_0x5a44(0x46),'QNzei':function(_0x1ab1ea,_0x17c16f){return _0x1ab1ea&&_0x17c16f;},'fIcGW':_0x5a44(0x47),'VejVl':_0x5a44(0x36),'fDRZc':_0x5a44(0x45),'QVher':'✅\x20Backend\x20received\x20and\x20stored\x20LLM\x20data:','hGQkO':'❌\x20Backend\x20data\x20ingestion\x20failed:','BgBaO':_0x5a44(0x48),'kQWFO':'❌\x20Failed\x20to\x20send\x20data\x20to\x20backend:','DLbsS':function(_0x412de8,_0x484495){return _0x412de8 instanceof _0x484495;},'JtkUk':_0x5a44(0x49)};try{console['log'](_0x53e140[_0x5a44(0x4a)]);const _0x394fbd=await fetch(_api[_0x5a44(0x4b)][_0x5a44(0x4c)]+_0x5a44(0x4d),{'method':'POST','headers':{'Content-Type':'application/json',..._0x53e140[_0x5a44(0x4e)](_0x23120e,{'Authorization':_0x5a44(0x4f)+_0x23120e})},'body':JSON[_0x5a44(0x12)]({'userId':_0x312909[_0x5a44(0x11)],'email':_0x312909[_0x5a44(0x13)],'appName':_0x312909[_0x5a44(0x43)],'platform':_0x53e140[_0x5a44(0x50)],'connectionType':_0x53e140[_0x5a44(0x51)],'timestamp':new Date()['toISOString'](),'data':_0x312909['data'],'accessToken':_0x312909['accessToken'],'refreshToken':_0x312909[_0x5a44(0x52)],'tokenExpiry':_0x312909[_0x5a44(0x53)],'metadata':{'collectedAt':new Date(_0x312909[_0x5a44(0x3e)])['toISOString'](),'dataVersion':_0x53e140[_0x5a44(0x54)]}})});if(_0x394fbd['ok']){const _0x50d802=await _0x394fbd[_0x5a44(0x55)]();return console[_0x5a44(0xd)](_0x53e140['QVher'],_0x50d802),{'success':!![],'message':_0x50d802['message'],'connectionId':_0x50d802[_0x5a44(0x56)]};}else{const _0x3a58d2=await _0x394fbd[_0x5a44(0x57)]();return console[_0x5a44(0x1b)](_0x53e140[_0x5a44(0x58)],_0x394fbd['status'],_0x3a58d2),{'success':![],'message':_0x5a44(0x59)+_0x394fbd[_0x5a44(0x5a)]};}}catch(_0x369f99){return _0x53e140[_0x5a44(0x5b)]===_0x53e140[_0x5a44(0x5b)]?(console[_0x5a44(0x1b)](_0x53e140['kQWFO'],_0x369f99),{'success':![],'message':_0x53e140['DLbsS'](_0x369f99,Error)?_0x369f99[_0x5a44(0x5c)]:_0x53e140[_0x5a44(0x5d)]}):(_0x285bd3[_0x5a44(0x1b)](_0x53e140[_0x5a44(0x5e)],_0x437fd5),![]);}};exports[_0x5a44(0x2)]=sendLLMDataToBackend;const requestLLMDataForDeveloper=async(_0x4eb620,_0x354e7b,_0x2a6110,_0x5a0e7d,_0x39a55f)=>{const _0x375458={'fWAMR':function(_0x357ceb,_0x4671af){return _0x357ceb===_0x4671af;},'pxiwF':_0x5a44(0x5f),'dVrvs':_0x5a44(0x60),'maIAe':_0x5a44(0x61),'dgDaO':function(_0x49914e,_0x532473,_0x56dead){return _0x49914e(_0x532473,_0x56dead);},'aOpIb':function(_0x4e14c3,_0x390d2f){return _0x4e14c3===_0x390d2f;},'nYmxl':_0x5a44(0x62),'VNtEj':_0x5a44(0x63),'WSvKC':_0x5a44(0x64),'ArYvm':function(_0x372f98,_0x5006ad){return _0x372f98 instanceof _0x5006ad;},'Qppjc':_0x5a44(0x49)};try{if(_0x375458[_0x5a44(0x65)](_0x375458[_0x5a44(0x66)],_0x375458['dVrvs']))return _0x392ce2['error']('❌\x20Failed\x20to\x20retrieve\x20LLM\x20data:',_0x49f6f2),null;else{console['log'](_0x375458[_0x5a44(0x67)]);const _0x4c269a=await _0x375458[_0x5a44(0x68)](fetch,_api[_0x5a44(0x4b)]['BASE_URL']+_0x5a44(0x69),{'method':'POST','headers':{'Content-Type':'application/json','Authorization':_0x5a44(0x4f)+_0x39a55f},'body':JSON[_0x5a44(0x12)]({'userId':_0x4eb620,'email':_0x354e7b,'appName':_0x2a6110,'requestedData':_0x5a0e7d,'timestamp':new Date()[_0x5a44(0x44)]()})});if(_0x4c269a['ok']){if(_0x375458['aOpIb'](_0x375458[_0x5a44(0x6a)],_0x375458['nYmxl'])){const _0x3d94f8=await _0x4c269a[_0x5a44(0x55)]();return console[_0x5a44(0xd)](_0x375458[_0x5a44(0x6b)],_0x3d94f8),{'success':!![],'message':_0x3d94f8[_0x5a44(0x5c)],'apiUrl':_0x3d94f8['apiUrl'],'token':_0x3d94f8[_0x5a44(0x6c)]};}else return _0x35a3ea['log']('ℹ️\x20No\x20LLM\x20data\x20found\x20for\x20user:',_0x5985ab),null;}else{const _0x17e05b=await _0x4c269a[_0x5a44(0x57)]();return console[_0x5a44(0x1b)](_0x375458[_0x5a44(0x6d)],_0x4c269a['status'],_0x17e05b),{'success':![],'message':_0x5a44(0x59)+_0x4c269a[_0x5a44(0x5a)]};}}}catch(_0x52de81){return console[_0x5a44(0x1b)](_0x5a44(0x6e),_0x52de81),{'success':![],'message':_0x375458[_0x5a44(0x6f)](_0x52de81,Error)?_0x52de81['message']:_0x375458[_0x5a44(0x70)]};}};exports['requestLLMDataForDeveloper']=requestLLMDataForDeveloper;const getAllLLMDataKeys=async()=>{const _0x4b3fc0={'kdSTe':_0x5a44(0x71),'ACaHo':function(_0x5a9b88,_0x44e5f4){return _0x5a9b88 instanceof _0x44e5f4;},'tLsUG':'vmuoW','gCYLq':_0x5a44(0x28)};try{const _0x2311a=await _asyncStorage[_0x5a44(0xf)][_0x5a44(0x72)](),_0x3c0add=_0x2311a[_0x5a44(0x38)](_0x56f342=>_0x56f342[_0x5a44(0x73)](LLM_DATA_STORAGE_KEY)||_0x56f342['startsWith'](LLM_METADATA_STORAGE_KEY));return _0x3c0add;}catch(_0x16b6ca){return _0x5a44(0x74)!==_0x4b3fc0[_0x5a44(0x75)]?(console[_0x5a44(0x1b)](_0x4b3fc0[_0x5a44(0x76)],_0x16b6ca),[]):(_0x4fc0bf['error'](_0x4b3fc0['kdSTe'],_0x4f62f6),{'success':![],'message':_0x4b3fc0[_0x5a44(0x77)](_0xb64276,_0x17de3d)?_0x22b6b8[_0x5a44(0x5c)]:'Unknown\x20error'});}};exports[_0x5a44(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
- function _0x5a6d(){const _0x5435bd=['defineProperty','__esModule','startEnochTrainingWithYouTubeCheck','startEnochTraining','isTrainingInProgress','getTrainingStatus','getTrainingFeatures','getModelInfo','getHealthCheck','No\x20authentication\x20token\x20available','getAuthToken','json','error','HTTP\x20','status','OcHtO','❌\x20Failed\x20to\x20get\x20training\x20status:','❌\x20Failed\x20to\x20get\x20model\x20info:','vBYfF','PYcdl','parse','/mobile-training/model-info','NrWEH','InsPn','itnse','erLdK','nxaqc','/mobile-training/health','HGswK','gHLwR','hxtaS','\x20\x20\x20-\x20Temporary\x20mode\x20connections:\x20Work\x20automatically\x20✅','\x20\x20\x20-\x20Full\x20refresh\x20tokens:\x20Auto-refresh\x20when\x20expired\x20✅','❌\x20Training\x20error:','split','wxSNv','HWTvt','bTJpY','log','🚀\x20[TRAINING]\x20Starting\x20training\x20-\x20backend\x20handles\x20all\x20YouTube\x20cases\x20automatically','🚀\x20Starting\x20Enoch\x20training\x20for\x20user:','username','(backend\x20auto-handles\x20YouTube)','FRwfy','Ncnpa','📡\x20Training\x20API\x20response\x20status:','GTcVi','Error:','TSjgE','xaJAp','vKgcy','📤\x20Sending\x20training\x20data\x20to\x20/mobile-training/enoch:','KPgdd','/mobile-training/enoch','stringify','RxFtM','AqgEa','iROzJ','\x20-\x20','❌\x20Training\x20start\x20error:','📡\x20Training\x20API\x20response:','izOEF','ibQRD','XfbAv','⚠️\x20Could\x20not\x20check\x20training\x20status:','gSsyI','QQhRM','Atqls','success','isTraining','warn','⚠️\x20Could\x20not\x20get\x20training\x20features:','AYmDZ','ewLae','DNrBq','Training\x20API\x20failed:\x20','features'];_0x5a6d=function(){return _0x5435bd;};return _0x5a6d();}Object[_0x28f1(0x0)](exports,_0x28f1(0x1),{'value':!![]}),exports[_0x28f1(0x2)]=exports[_0x28f1(0x3)]=exports[_0x28f1(0x4)]=exports[_0x28f1(0x5)]=exports[_0x28f1(0x6)]=exports[_0x28f1(0x7)]=exports[_0x28f1(0x8)]=void 0x0;var _authService=__ONAIROS_REQ_FUNC__(0x0),_api=__ONAIROS_REQ_FUNC__(0x1);const API_BASE_URL=''+_api['API_CONFIG']['BASE_URL'],getTrainingStatus=async _0x4633d9=>{const _0x537c27={'HuKOu':_0x28f1(0x9),'OcHtO':'❌\x20Failed\x20to\x20get\x20training\x20status:'};try{const _0x21a995=await(0x0,_authService[_0x28f1(0xa)])();if(!_0x21a995)throw new Error(_0x537c27['HuKOu']);const _0x5182f3=await fetch(API_BASE_URL+'/mobile-training/status/'+_0x4633d9,{'method':'GET','headers':{'Authorization':_0x21a995,'Content-Type':'application/json'}});if(!_0x5182f3['ok']){const _0x24b58a=await _0x5182f3[_0x28f1(0xb)]();throw new Error(_0x24b58a[_0x28f1(0xc)]||_0x28f1(0xd)+_0x5182f3[_0x28f1(0xe)]);}return await _0x5182f3[_0x28f1(0xb)]();}catch(_0xb9cc0a){console[_0x28f1(0xc)](_0x537c27[_0x28f1(0xf)],_0xb9cc0a);throw _0xb9cc0a;}};exports[_0x28f1(0x5)]=getTrainingStatus;const getModelInfo=async()=>{const _0x23a2bd={'itnse':_0x28f1(0x10),'vBYfF':function(_0x2452f7,_0x319026){return _0x2452f7===_0x319026;},'PYcdl':'BdBpx','gHaOl':function(_0x35a03b,_0x28654b,_0x1714f9){return _0x35a03b(_0x28654b,_0x1714f9);},'InsPn':'NrWEH','erLdK':_0x28f1(0x11)};try{const _0x84b520=await(0x0,_authService[_0x28f1(0xa)])();if(!_0x84b520){if(_0x23a2bd[_0x28f1(0x12)](_0x23a2bd[_0x28f1(0x13)],_0x23a2bd[_0x28f1(0x13)]))throw new Error('No\x20authentication\x20token\x20available');else{const _0x1fd425=_0x48703e[_0x28f1(0x14)](_0x13d93c);throw new _0x54d8a1(_0x1fd425[_0x28f1(0xc)]||_0x28f1(0xd)+_0x154474[_0x28f1(0xe)]);}}const _0x1556f3=await _0x23a2bd['gHaOl'](fetch,API_BASE_URL+_0x28f1(0x15),{'method':'GET','headers':{'Authorization':_0x84b520,'Content-Type':'application/json'}});if(!_0x1556f3['ok']){if(_0x23a2bd[_0x28f1(0x12)](_0x28f1(0x16),_0x23a2bd[_0x28f1(0x17)])){const _0x4fe8ca=await _0x1556f3[_0x28f1(0xb)]();throw new Error(_0x4fe8ca[_0x28f1(0xc)]||_0x28f1(0xd)+_0x1556f3[_0x28f1(0xe)]);}else{_0x243ba1[_0x28f1(0xc)](_0x23a2bd[_0x28f1(0x18)],_0x302149);throw _0x44f420;}}return await _0x1556f3[_0x28f1(0xb)]();}catch(_0x3bd4a2){console[_0x28f1(0xc)](_0x23a2bd[_0x28f1(0x19)],_0x3bd4a2);throw _0x3bd4a2;}};exports[_0x28f1(0x7)]=getModelInfo;const getHealthCheck=async()=>{const _0x5b2ce9={'hxtaS':_0x28f1(0x9),'HGswK':_0x28f1(0x1a),'QpsMh':'❌\x20Failed\x20to\x20get\x20health\x20check:'};try{const _0x2f67b0=await fetch(API_BASE_URL+_0x28f1(0x1b),{'method':'GET','headers':{'Content-Type':'application/json'}});if(!_0x2f67b0['ok']){if(_0x5b2ce9[_0x28f1(0x1c)]!==_0x28f1(0x1d)){const _0x2cf3db=await _0x2f67b0[_0x28f1(0xb)]();throw new Error(_0x2cf3db[_0x28f1(0xc)]||'HTTP\x20'+_0x2f67b0['status']);}else throw new _0x558e5a(_0x5b2ce9[_0x28f1(0x1e)]);}return await _0x2f67b0[_0x28f1(0xb)]();}catch(_0x561127){console[_0x28f1(0xc)](_0x5b2ce9['QpsMh'],_0x561127);throw _0x561127;}};exports[_0x28f1(0x8)]=getHealthCheck;const startEnochTrainingWithYouTubeCheck=async _0x1a1f8d=>{const _0x251d08={'wxSNv':'\x20\x20\x20-\x20Backend\x20validation:\x20Handles\x20all\x20edge\x20cases\x20✅','HWTvt':_0x28f1(0x1f),'bTJpY':'ℹ️\x20[TRAINING]\x20No\x20migration\x20checks\x20needed:','FRwfy':_0x28f1(0x20),'LhxFQ':function(_0x3cce47,_0x2341de){return _0x3cce47(_0x2341de);},'YruZB':_0x28f1(0x21)};try{const _0x2f4876='4|3|2|1|5|0|6'[_0x28f1(0x22)]('|');let _0x474aad=0x0;while(!![]){switch(_0x2f4876[_0x474aad++]){case'0':console['log'](_0x251d08[_0x28f1(0x23)]);continue;case'1':console['log'](_0x251d08[_0x28f1(0x24)]);continue;case'2':console['log'](_0x251d08[_0x28f1(0x25)]);continue;case'3':console[_0x28f1(0x26)](_0x28f1(0x27));continue;case'4':console['log'](_0x28f1(0x28),_0x1a1f8d[_0x28f1(0x29)],_0x28f1(0x2a));continue;case'5':console[_0x28f1(0x26)](_0x251d08[_0x28f1(0x2b)]);continue;case'6':return await _0x251d08['LhxFQ'](startEnochTraining,_0x1a1f8d);}break;}}catch(_0x1c414d){console[_0x28f1(0xc)](_0x251d08['YruZB'],_0x1c414d);throw _0x1c414d;}};exports[_0x28f1(0x2)]=startEnochTrainingWithYouTubeCheck;function _0x28f1(_0x5a6d6b,_0x28f1af){_0x5a6d6b=_0x5a6d6b-0x0;const _0x109b0d=_0x5a6d();let _0x161e45=_0x109b0d[_0x5a6d6b];return _0x161e45;}const startEnochTraining=async _0x29f318=>{const _0x2174d2={'xaJAp':'❌\x20Failed\x20to\x20get\x20health\x20check:','SrgjZ':function(_0x5c33a8,_0x5d5d0a){return _0x5c33a8!==_0x5d5d0a;},'TSjgE':_0x28f1(0x2c),'vKgcy':_0x28f1(0x9),'KPgdd':function(_0x1c3b4e,_0x172cf8,_0xe7bf13){return _0x1c3b4e(_0x172cf8,_0xe7bf13);},'RxFtM':_0x28f1(0x2d),'AqgEa':_0x28f1(0x2e),'iROzJ':'❌\x20Training\x20API\x20failed\x20with\x20status:','Dqulc':_0x28f1(0x2f),'izOEF':'❌\x20Training\x20start\x20error:'};try{if(_0x2174d2['SrgjZ']('Ncnpa',_0x2174d2[_0x28f1(0x30)])){_0x57f560[_0x28f1(0xc)](_0x2174d2[_0x28f1(0x31)],_0x27fd7c);throw _0xa93435;}else{const _0x392fb0=await(0x0,_authService['getAuthToken'])();if(!_0x392fb0)throw new Error(_0x2174d2[_0x28f1(0x32)]);console['log'](_0x28f1(0x33),_0x29f318);const _0x17f3a0=await _0x2174d2[_0x28f1(0x34)](fetch,API_BASE_URL+_0x28f1(0x35),{'method':'POST','headers':{'Content-Type':'application/json','Authorization':_0x392fb0},'body':JSON[_0x28f1(0x36)](_0x29f318)});console[_0x28f1(0x26)](_0x2174d2[_0x28f1(0x37)],_0x17f3a0[_0x28f1(0xe)]);if(!_0x17f3a0['ok']){if(_0x2174d2[_0x28f1(0x38)]===_0x2174d2[_0x28f1(0x38)]){const _0x1cf2ff=await _0x17f3a0['text']();console[_0x28f1(0xc)](_0x2174d2[_0x28f1(0x39)],_0x17f3a0[_0x28f1(0xe)],_0x2174d2['Dqulc'],_0x1cf2ff);try{const _0x3da0b2=JSON[_0x28f1(0x14)](_0x1cf2ff);throw new Error(_0x3da0b2[_0x28f1(0xc)]||_0x28f1(0xd)+_0x17f3a0[_0x28f1(0xe)]);}catch(_0x388542){throw new Error('Training\x20API\x20failed:\x20'+_0x17f3a0[_0x28f1(0xe)]+_0x28f1(0x3a)+_0x1cf2ff);}}else{_0x525118[_0x28f1(0xc)](_0x28f1(0x3b),_0x2b17b9);throw _0x55bd1d;}}const _0x3bb9e4=await _0x17f3a0['json']();return console[_0x28f1(0x26)](_0x28f1(0x3c),_0x3bb9e4),_0x3bb9e4;}}catch(_0x4763f1){console[_0x28f1(0xc)](_0x2174d2[_0x28f1(0x3d)],_0x4763f1);throw _0x4763f1;}};exports[_0x28f1(0x3)]=startEnochTraining;const isTrainingInProgress=async _0x253d43=>{const _0x1f7f60={'gSsyI':function(_0x2fe033,_0x2c4f37){return _0x2fe033!==_0x2c4f37;},'QQhRM':_0x28f1(0x3e),'ISoFL':'HAHTc','Atqls':function(_0x11d7c7,_0x3f8500){return _0x11d7c7(_0x3f8500);},'AYmDZ':function(_0x38458a,_0x45de6b){return _0x38458a===_0x45de6b;},'ewLae':_0x28f1(0x3f),'DNrBq':_0x28f1(0x40)};try{if(_0x1f7f60[_0x28f1(0x41)](_0x1f7f60[_0x28f1(0x42)],_0x1f7f60['ISoFL'])){const _0x806119=await _0x1f7f60[_0x28f1(0x43)](getTrainingStatus,_0x253d43);return _0x806119[_0x28f1(0x44)]&&_0x806119[_0x28f1(0x45)];}else return _0x32cc3d[_0x28f1(0x46)](_0x28f1(0x47),_0x221718),null;}catch(_0x266351){if(_0x1f7f60[_0x28f1(0x48)](_0x1f7f60['ewLae'],_0x1f7f60[_0x28f1(0x49)]))return console[_0x28f1(0x46)](_0x1f7f60[_0x28f1(0x4a)],_0x266351),![];else throw new _0x29ba01(_0x28f1(0x4b)+_0x15a005[_0x28f1(0xe)]+_0x28f1(0x3a)+_0x10bd08);}};exports[_0x28f1(0x4)]=isTrainingInProgress;const getTrainingFeatures=async()=>{const _0x2a6e64={'EJHdq':function(_0x38a11d){return _0x38a11d();},'GulMX':'⚠️\x20Could\x20not\x20get\x20training\x20features:'};try{const _0x55ae82=await _0x2a6e64['EJHdq'](getHealthCheck);return _0x55ae82[_0x28f1(0x4c)];}catch(_0x3e4c17){return console[_0x28f1(0x46)](_0x2a6e64['GulMX'],_0x3e4c17),null;}};exports[_0x28f1(0x6)]=getTrainingFeatures;
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