@onairos/react-native 3.4.0 → 3.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (546) hide show
  1. package/README.md +62 -13
  2. package/lib/commonjs/api/index.js +9 -145
  3. package/lib/commonjs/assets/animations/loaderani.json +1 -0
  4. package/lib/commonjs/assets/animations/persona-animation.json +1 -0
  5. package/lib/commonjs/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
  6. package/lib/commonjs/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
  7. package/lib/commonjs/assets/icons/Facebookicon.png +0 -0
  8. package/lib/commonjs/assets/icons/Gmail.png +0 -0
  9. package/lib/commonjs/assets/icons/Linkedinicon.png +0 -0
  10. package/lib/commonjs/assets/icons/Redditicon.png +0 -0
  11. package/lib/commonjs/assets/icons/YouTubeicon2.png +0 -0
  12. package/lib/commonjs/assets/icons/YouTubeicon3.png +0 -0
  13. package/lib/commonjs/assets/icons/chatgpt.png +0 -0
  14. package/lib/commonjs/assets/icons/claude.png +0 -0
  15. package/lib/commonjs/assets/icons/gemini.png +0 -0
  16. package/lib/commonjs/assets/icons/grok.png +0 -0
  17. package/lib/commonjs/assets/images/Checkbox.svg +3 -0
  18. package/lib/commonjs/assets/images/EnochE.svg +19 -0
  19. package/lib/commonjs/assets/images/Enochicon1.png +0 -0
  20. package/lib/commonjs/assets/images/Face_ID_logo.png +0 -0
  21. package/lib/commonjs/assets/images/Facebookicon.png +0 -0
  22. package/lib/commonjs/assets/images/Gmail.png +0 -0
  23. package/lib/commonjs/assets/images/Googlelogo.png +0 -0
  24. package/lib/commonjs/assets/images/Linkedinicon.png +0 -0
  25. package/lib/commonjs/assets/images/Onairoslogo.png +0 -0
  26. package/lib/commonjs/assets/images/Personalityprofile.svg +3 -0
  27. package/lib/commonjs/assets/images/Personalitytraits.svg +3 -0
  28. package/lib/commonjs/assets/images/Redditicon.png +0 -0
  29. package/lib/commonjs/assets/images/Userpreferences.svg +3 -0
  30. package/lib/commonjs/assets/images/YouTubeicon3.png +0 -0
  31. package/lib/commonjs/assets/images/arrow.svg +20 -0
  32. package/lib/commonjs/assets/images/basicproficon.svg +43 -0
  33. package/lib/commonjs/assets/images/basicprofile.svg +3 -0
  34. package/lib/commonjs/assets/images/chatgpt.png +0 -0
  35. package/lib/commonjs/assets/images/checkmark.svg +4 -0
  36. package/lib/commonjs/assets/images/claude.png +0 -0
  37. package/lib/commonjs/assets/images/contentanalysis.svg +3 -0
  38. package/lib/commonjs/assets/images/contenticon.svg +23 -0
  39. package/lib/commonjs/assets/images/gemini.png +0 -0
  40. package/lib/commonjs/assets/images/grok.png +0 -0
  41. package/lib/commonjs/assets/images/persona1.png +0 -0
  42. package/lib/commonjs/assets/images/persona2.png +0 -0
  43. package/lib/commonjs/assets/images/persona3.png +0 -0
  44. package/lib/commonjs/assets/images/persona4.png +0 -0
  45. package/lib/commonjs/assets/images/persona5.png +0 -0
  46. package/lib/commonjs/assets/images/personalityicon.svg +18 -0
  47. package/lib/commonjs/assets/images/x-close.svg +3 -0
  48. package/lib/commonjs/components/BodyText.js +9 -0
  49. package/lib/commonjs/components/BrandMark.js +10 -0
  50. package/lib/commonjs/components/CodeInput.js +9 -0
  51. package/lib/commonjs/components/EmailInput.js +8 -0
  52. package/lib/commonjs/components/GoogleButton.js +9 -0
  53. package/lib/commonjs/components/HeadingGroup.js +9 -0
  54. package/lib/commonjs/components/LLMDataInputModal.js +14 -0
  55. package/lib/commonjs/components/ModalHeader.js +9 -0
  56. package/lib/commonjs/components/ModalSheet.js +9 -0
  57. package/lib/commonjs/components/Onairos.js +14 -374
  58. package/lib/commonjs/components/OnairosButton.js +13 -309
  59. package/lib/commonjs/components/OnairosSignInButton.js +12 -0
  60. package/lib/commonjs/components/Overlay.js +13 -483
  61. package/lib/commonjs/components/PersonaImage.js +10 -0
  62. package/lib/commonjs/components/PersonaLoadingScreen.js +12 -0
  63. package/lib/commonjs/components/PersonalizationConsentScreen.js +13 -0
  64. package/lib/commonjs/components/PinCreationScreen.js +12 -0
  65. package/lib/commonjs/components/PinInput.js +9 -302
  66. package/lib/commonjs/components/PlatformConnectorsStep.js +22 -0
  67. package/lib/commonjs/components/PlatformList.js +10 -137
  68. package/lib/commonjs/components/PlatformToggle.js +9 -0
  69. package/lib/commonjs/components/PrimaryButton.js +10 -0
  70. package/lib/commonjs/components/SignInMatchAnimation.js +9 -0
  71. package/lib/commonjs/components/SignInStep.js +12 -0
  72. package/lib/commonjs/components/UniversalOnboarding.js +29 -1702
  73. package/lib/commonjs/components/VerificationStep.js +11 -0
  74. package/lib/commonjs/components/WelcomeScreen.js +21 -0
  75. package/lib/commonjs/components/icons/Basicproficon.js +8 -0
  76. package/lib/commonjs/components/icons/Basicprofile.js +8 -0
  77. package/lib/commonjs/components/icons/Checkbox.js +8 -0
  78. package/lib/commonjs/components/icons/Checkmark.js +8 -0
  79. package/lib/commonjs/components/icons/Contentanalysis.js +8 -0
  80. package/lib/commonjs/components/icons/Contenticon.js +8 -0
  81. package/lib/commonjs/components/icons/EnochE.js +8 -0
  82. package/lib/commonjs/components/icons/Personalityicon.js +8 -0
  83. package/lib/commonjs/components/icons/Personalityprofile.js +8 -0
  84. package/lib/commonjs/components/icons/Personalitytraits.js +8 -0
  85. package/lib/commonjs/components/icons/Userpreferences.js +8 -0
  86. package/lib/commonjs/components/icons/index.js +17 -0
  87. package/lib/commonjs/components/onboarding/OAuthWebView.js +14 -827
  88. package/lib/commonjs/components/onboarding/OnboardingHeader.js +10 -74
  89. package/lib/commonjs/components/onboarding/PinInput.js +10 -283
  90. package/lib/commonjs/components/onboarding/PlatformConnector.js +11 -249
  91. package/lib/commonjs/config/api.js +7 -0
  92. package/lib/commonjs/constants/index.js +7 -83
  93. package/lib/commonjs/context/AuthContext.js +10 -0
  94. package/lib/commonjs/hooks/useConnectedAccounts.js +9 -0
  95. package/lib/commonjs/hooks/useConnections.js +8 -159
  96. package/lib/commonjs/hooks/useCredentials.js +10 -177
  97. package/lib/commonjs/hooks/useUserConnections.js +10 -0
  98. package/lib/commonjs/index.js +35 -106
  99. package/lib/commonjs/services/SDK_API_KEY_VALIDATION.md +31 -38
  100. package/lib/commonjs/services/apiClient.js +8 -0
  101. package/lib/commonjs/services/apiKeyService.js +9 -946
  102. package/lib/commonjs/services/authService.js +10 -0
  103. package/lib/commonjs/services/biometricPinService.js +8 -0
  104. package/lib/commonjs/services/chatGPTConversationExtractor.js +8 -0
  105. package/lib/commonjs/services/chatGPTConversationService.js +9 -0
  106. package/lib/commonjs/services/claudeConversationExtractor.js +8 -0
  107. package/lib/commonjs/services/claudeConversationService.js +9 -0
  108. package/lib/commonjs/services/connectedAccountsService.js +10 -0
  109. package/lib/commonjs/services/googleAuthService.js +11 -0
  110. package/lib/commonjs/services/imageCompressionService.js +7 -0
  111. package/lib/commonjs/services/jwtStorageService.js +7 -0
  112. package/lib/commonjs/services/linkedinDOMExtractor.js +7 -0
  113. package/lib/commonjs/services/linkedinProfileService.js +9 -0
  114. package/lib/commonjs/services/linkedinScrapingService.js +8 -0
  115. package/lib/commonjs/services/llmDataStorage.js +8 -0
  116. package/lib/commonjs/services/mobileTrainingService.js +8 -0
  117. package/lib/commonjs/services/oauthService.js +11 -390
  118. package/lib/commonjs/services/pinEncryptionService.js +8 -0
  119. package/lib/commonjs/services/pinStorageUtils.js +7 -0
  120. package/lib/commonjs/services/platformAuthService.js +12 -1067
  121. package/lib/commonjs/services/storageService.js +8 -0
  122. package/lib/commonjs/services/trainingApiHelpers.js +7 -0
  123. package/lib/commonjs/services/userConnectionsService.js +10 -0
  124. package/lib/commonjs/services/youtubeMigrationService.js +10 -0
  125. package/lib/commonjs/theme/index.js +7 -0
  126. package/lib/commonjs/types/ambient.d.js +1 -2
  127. package/lib/commonjs/types/declarations.d.js +1 -2
  128. package/lib/commonjs/types/index.js +1 -6
  129. package/lib/commonjs/types/node-fix.d.js +1 -2
  130. package/lib/commonjs/types/node-override.d.js +1 -2
  131. package/lib/commonjs/types/opacity.d.js +1 -2
  132. package/lib/commonjs/types.js +1 -14
  133. package/lib/commonjs/utils/Portal.js +8 -98
  134. package/lib/commonjs/utils/api.js +9 -129
  135. package/lib/commonjs/utils/assetRegistry.js +33 -0
  136. package/lib/commonjs/utils/auth.js +9 -111
  137. package/lib/commonjs/utils/crypto.js +8 -62
  138. package/lib/commonjs/utils/debugHelper.js +1 -64
  139. package/lib/commonjs/utils/encryption.js +7 -76
  140. package/lib/commonjs/utils/eventUtils.js +1 -0
  141. package/lib/commonjs/utils/haptics.js +9 -0
  142. package/lib/commonjs/utils/imagePreloader.js +1 -0
  143. package/lib/commonjs/utils/networkDiagnostics.js +8 -0
  144. package/lib/commonjs/utils/onairosApi.js +9 -350
  145. package/lib/commonjs/utils/programmaticFlow.js +9 -117
  146. package/lib/commonjs/utils/retryHelper.js +1 -220
  147. package/lib/commonjs/utils/secureStorage.js +10 -349
  148. package/lib/commonjs/utils/webviewScripts/chatgpt.js +1 -0
  149. package/lib/commonjs/utils/webviewScripts/claude.js +1 -0
  150. package/lib/commonjs/utils/webviewScripts/index.js +9 -0
  151. package/lib/commonjs/utils/webviewScripts/linkedin.js +1 -0
  152. package/lib/module/api/index.js +1 -139
  153. package/lib/module/assets/animations/loaderani.json +1 -0
  154. package/lib/module/assets/animations/persona-animation.json +1 -0
  155. package/lib/module/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
  156. package/lib/module/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
  157. package/lib/module/assets/icons/Facebookicon.png +0 -0
  158. package/lib/module/assets/icons/Gmail.png +0 -0
  159. package/lib/module/assets/icons/Linkedinicon.png +0 -0
  160. package/lib/module/assets/icons/Redditicon.png +0 -0
  161. package/lib/module/assets/icons/YouTubeicon2.png +0 -0
  162. package/lib/module/assets/icons/YouTubeicon3.png +0 -0
  163. package/lib/module/assets/icons/chatgpt.png +0 -0
  164. package/lib/module/assets/icons/claude.png +0 -0
  165. package/lib/module/assets/icons/farcaster.png +0 -0
  166. package/lib/module/assets/icons/gemini.png +0 -0
  167. package/lib/module/assets/icons/grok.png +0 -0
  168. package/lib/module/assets/icons/instagram.png +0 -0
  169. package/lib/module/assets/icons/pinterest.png +0 -0
  170. package/lib/module/assets/icons/swerv_logo.png +0 -0
  171. package/lib/module/assets/icons/twitter.jpg +0 -0
  172. package/lib/module/assets/images/Checkbox.svg +3 -0
  173. package/lib/module/assets/images/EnochE.svg +19 -0
  174. package/lib/module/assets/images/Enochicon1.png +0 -0
  175. package/lib/module/assets/images/Face_ID_logo.png +0 -0
  176. package/lib/module/assets/images/Facebookicon.png +0 -0
  177. package/lib/module/assets/images/Gmail.png +0 -0
  178. package/lib/module/assets/images/Googlelogo.png +0 -0
  179. package/lib/module/assets/images/Linkedinicon.png +0 -0
  180. package/lib/module/assets/images/Onairoslogo.png +0 -0
  181. package/lib/module/assets/images/Personalityprofile.svg +3 -0
  182. package/lib/module/assets/images/Personalitytraits.svg +3 -0
  183. package/lib/module/assets/images/Redditicon.png +0 -0
  184. package/lib/module/assets/images/Userpreferences.svg +3 -0
  185. package/lib/module/assets/images/YouTubeicon3.png +0 -0
  186. package/lib/module/assets/images/arrow.svg +20 -0
  187. package/lib/module/assets/images/basicproficon.svg +43 -0
  188. package/lib/module/assets/images/basicprofile.svg +3 -0
  189. package/lib/module/assets/images/chatgpt.png +0 -0
  190. package/lib/module/assets/images/checkmark.svg +4 -0
  191. package/lib/module/assets/images/claude.png +0 -0
  192. package/lib/module/assets/images/contentanalysis.svg +3 -0
  193. package/lib/module/assets/images/contenticon.svg +23 -0
  194. package/lib/module/assets/images/gemini.png +0 -0
  195. package/lib/module/assets/images/grok.png +0 -0
  196. package/lib/module/assets/images/persona1.png +0 -0
  197. package/lib/module/assets/images/persona2.png +0 -0
  198. package/lib/module/assets/images/persona3.png +0 -0
  199. package/lib/module/assets/images/persona4.png +0 -0
  200. package/lib/module/assets/images/persona5.png +0 -0
  201. package/lib/module/assets/images/personalityicon.svg +18 -0
  202. package/lib/module/assets/images/x-close.svg +3 -0
  203. package/lib/module/components/BodyText.js +1 -0
  204. package/lib/module/components/BrandMark.js +1 -0
  205. package/lib/module/components/CodeInput.js +1 -0
  206. package/lib/module/components/EmailInput.js +1 -0
  207. package/lib/module/components/GoogleButton.js +1 -0
  208. package/lib/module/components/HeadingGroup.js +1 -0
  209. package/lib/module/components/LLMDataInputModal.js +8 -0
  210. package/lib/module/components/ModalHeader.js +1 -0
  211. package/lib/module/components/ModalSheet.js +1 -0
  212. package/lib/module/components/Onairos.js +1 -367
  213. package/lib/module/components/OnairosButton.js +1 -302
  214. package/lib/module/components/OnairosSignInButton.js +1 -0
  215. package/lib/module/components/Overlay.js +1 -474
  216. package/lib/module/components/PersonaImage.js +1 -0
  217. package/lib/module/components/PersonaLoadingScreen.js +1 -0
  218. package/lib/module/components/PersonalizationConsentScreen.js +1 -0
  219. package/lib/module/components/PinCreationScreen.js +1 -0
  220. package/lib/module/components/PinInput.js +1 -293
  221. package/lib/module/components/PlatformConnectorsStep.js +1 -0
  222. package/lib/module/components/PlatformList.js +1 -129
  223. package/lib/module/components/PlatformToggle.js +1 -0
  224. package/lib/module/components/PrimaryButton.js +1 -0
  225. package/lib/module/components/SignInMatchAnimation.js +1 -0
  226. package/lib/module/components/SignInStep.js +1 -0
  227. package/lib/module/components/UniversalOnboarding.js +1 -1693
  228. package/lib/module/components/VerificationStep.js +1 -0
  229. package/lib/module/components/WelcomeScreen.js +1 -0
  230. package/lib/module/components/icons/Basicproficon.js +1 -0
  231. package/lib/module/components/icons/Basicprofile.js +1 -0
  232. package/lib/module/components/icons/Checkbox.js +1 -0
  233. package/lib/module/components/icons/Checkmark.js +1 -0
  234. package/lib/module/components/icons/Contentanalysis.js +1 -0
  235. package/lib/module/components/icons/Contenticon.js +1 -0
  236. package/lib/module/components/icons/EnochE.js +1 -0
  237. package/lib/module/components/icons/Personalityicon.js +1 -0
  238. package/lib/module/components/icons/Personalityprofile.js +1 -0
  239. package/lib/module/components/icons/Personalitytraits.js +1 -0
  240. package/lib/module/components/icons/Userpreferences.js +1 -0
  241. package/lib/module/components/icons/index.js +1 -0
  242. package/lib/module/components/onboarding/OAuthWebView.js +1 -818
  243. package/lib/module/components/onboarding/OnboardingHeader.js +1 -66
  244. package/lib/module/components/onboarding/PinInput.js +1 -274
  245. package/lib/module/components/onboarding/PlatformConnector.js +1 -240
  246. package/lib/module/config/api.js +1 -0
  247. package/lib/module/constants/index.js +1 -77
  248. package/lib/module/context/AuthContext.js +1 -0
  249. package/lib/module/hooks/useConnectedAccounts.js +1 -0
  250. package/lib/module/hooks/useConnections.js +1 -152
  251. package/lib/module/hooks/useCredentials.js +6 -169
  252. package/lib/module/hooks/useUserConnections.js +1 -0
  253. package/lib/module/index.js +1 -32
  254. package/lib/module/services/SDK_API_KEY_VALIDATION.md +31 -38
  255. package/lib/module/services/apiClient.js +1 -0
  256. package/lib/module/services/apiKeyService.js +1 -919
  257. package/lib/module/services/authService.js +1 -0
  258. package/lib/module/services/biometricPinService.js +1 -0
  259. package/lib/module/services/chatGPTConversationExtractor.js +1 -0
  260. package/lib/module/services/chatGPTConversationService.js +1 -0
  261. package/lib/module/services/claudeConversationExtractor.js +1 -0
  262. package/lib/module/services/claudeConversationService.js +1 -0
  263. package/lib/module/services/connectedAccountsService.js +1 -0
  264. package/lib/module/services/googleAuthService.js +1 -0
  265. package/lib/module/services/imageCompressionService.js +1 -0
  266. package/lib/module/services/jwtStorageService.js +1 -0
  267. package/lib/module/services/linkedinDOMExtractor.js +1 -0
  268. package/lib/module/services/linkedinProfileService.js +1 -0
  269. package/lib/module/services/linkedinScrapingService.js +1 -0
  270. package/lib/module/services/llmDataStorage.js +1 -0
  271. package/lib/module/services/mobileTrainingService.js +1 -0
  272. package/lib/module/services/oauthService.js +1 -380
  273. package/lib/module/services/pinEncryptionService.js +7 -0
  274. package/lib/module/services/pinStorageUtils.js +1 -0
  275. package/lib/module/services/platformAuthService.js +1 -1041
  276. package/lib/module/services/storageService.js +1 -0
  277. package/lib/module/services/trainingApiHelpers.js +1 -0
  278. package/lib/module/services/userConnectionsService.js +1 -0
  279. package/lib/module/services/youtubeMigrationService.js +1 -0
  280. package/lib/module/theme/index.js +1 -0
  281. package/lib/module/types.js +1 -10
  282. package/lib/module/utils/Portal.js +1 -90
  283. package/lib/module/utils/api.js +1 -117
  284. package/lib/module/utils/assetRegistry.js +33 -0
  285. package/lib/module/utils/auth.js +1 -99
  286. package/lib/module/utils/crypto.js +1 -54
  287. package/lib/module/utils/debugHelper.js +1 -54
  288. package/lib/module/utils/encryption.js +1 -67
  289. package/lib/module/utils/eventUtils.js +1 -0
  290. package/lib/module/utils/haptics.js +8 -0
  291. package/lib/module/utils/imagePreloader.js +1 -0
  292. package/lib/module/utils/networkDiagnostics.js +1 -0
  293. package/lib/module/utils/onairosApi.js +1 -333
  294. package/lib/module/utils/programmaticFlow.js +1 -111
  295. package/lib/module/utils/retryHelper.js +1 -211
  296. package/lib/module/utils/secureStorage.js +6 -330
  297. package/lib/module/utils/webviewScripts/chatgpt.js +1 -0
  298. package/lib/module/utils/webviewScripts/claude.js +1 -0
  299. package/lib/module/utils/webviewScripts/index.js +1 -0
  300. package/lib/module/utils/webviewScripts/linkedin.js +1 -0
  301. package/package.json +62 -39
  302. package/lib/commonjs/api/index.js.map +0 -1
  303. package/lib/commonjs/assets/images/email.png +0 -0
  304. package/lib/commonjs/assets/images/linkedin.png +0 -0
  305. package/lib/commonjs/assets/images/reddit.png +0 -0
  306. package/lib/commonjs/assets/images/youtube.png +0 -0
  307. package/lib/commonjs/components/DataRequestModal.js +0 -228
  308. package/lib/commonjs/components/DataRequestModal.js.map +0 -1
  309. package/lib/commonjs/components/DataRequestScreen.js +0 -329
  310. package/lib/commonjs/components/DataRequestScreen.js.map +0 -1
  311. package/lib/commonjs/components/EmailVerificationModal.js +0 -320
  312. package/lib/commonjs/components/EmailVerificationModal.js.map +0 -1
  313. package/lib/commonjs/components/Onairos.js.map +0 -1
  314. package/lib/commonjs/components/OnairosButton.js.map +0 -1
  315. package/lib/commonjs/components/Overlay.js.map +0 -1
  316. package/lib/commonjs/components/PinInput.js.map +0 -1
  317. package/lib/commonjs/components/PlatformList.js.map +0 -1
  318. package/lib/commonjs/components/TrainingModal.js +0 -717
  319. package/lib/commonjs/components/TrainingModal.js.map +0 -1
  320. package/lib/commonjs/components/UniversalOnboarding.js.map +0 -1
  321. package/lib/commonjs/components/UniversalOnboarding.tsx.new +0 -455
  322. package/lib/commonjs/components/onboarding/OAuthWebView.js.map +0 -1
  323. package/lib/commonjs/components/onboarding/OnboardingHeader.js.map +0 -1
  324. package/lib/commonjs/components/onboarding/PinInput.js.map +0 -1
  325. package/lib/commonjs/components/onboarding/PlatformConnector.js.map +0 -1
  326. package/lib/commonjs/components/screens/ConnectorScreen.js +0 -146
  327. package/lib/commonjs/components/screens/ConnectorScreen.js.map +0 -1
  328. package/lib/commonjs/components/screens/LoadingScreen.js +0 -91
  329. package/lib/commonjs/components/screens/LoadingScreen.js.map +0 -1
  330. package/lib/commonjs/components/screens/PinCreationScreen.js +0 -61
  331. package/lib/commonjs/components/screens/PinCreationScreen.js.map +0 -1
  332. package/lib/commonjs/constants/index.js.map +0 -1
  333. package/lib/commonjs/hooks/useConnections.js.map +0 -1
  334. package/lib/commonjs/hooks/useCredentials.js.map +0 -1
  335. package/lib/commonjs/index.js.map +0 -1
  336. package/lib/commonjs/services/apiKeyService.js.map +0 -1
  337. package/lib/commonjs/services/oauthService.js.map +0 -1
  338. package/lib/commonjs/services/platformAuthService.js.map +0 -1
  339. package/lib/commonjs/types/ambient.d.js.map +0 -1
  340. package/lib/commonjs/types/declarations.d.js.map +0 -1
  341. package/lib/commonjs/types/index.d.js.map +0 -1
  342. package/lib/commonjs/types/index.js.map +0 -1
  343. package/lib/commonjs/types/node-fix.d.js.map +0 -1
  344. package/lib/commonjs/types/node-override.d.js.map +0 -1
  345. package/lib/commonjs/types/opacity.d.js.map +0 -1
  346. package/lib/commonjs/types/types.d.js.map +0 -1
  347. package/lib/commonjs/types.js.map +0 -1
  348. package/lib/commonjs/utils/Portal.js.map +0 -1
  349. package/lib/commonjs/utils/api.js.map +0 -1
  350. package/lib/commonjs/utils/auth.js.map +0 -1
  351. package/lib/commonjs/utils/crypto.js.map +0 -1
  352. package/lib/commonjs/utils/debugHelper.js.map +0 -1
  353. package/lib/commonjs/utils/encryption.js.map +0 -1
  354. package/lib/commonjs/utils/onairosApi.js.map +0 -1
  355. package/lib/commonjs/utils/programmaticFlow.js.map +0 -1
  356. package/lib/commonjs/utils/retryHelper.js.map +0 -1
  357. package/lib/commonjs/utils/secureStorage.js.map +0 -1
  358. package/lib/module/api/index.js.map +0 -1
  359. package/lib/module/assets/images/email.png +0 -0
  360. package/lib/module/assets/images/linkedin.png +0 -0
  361. package/lib/module/assets/images/reddit.png +0 -0
  362. package/lib/module/assets/images/youtube.png +0 -0
  363. package/lib/module/components/DataRequestModal.js +0 -220
  364. package/lib/module/components/DataRequestModal.js.map +0 -1
  365. package/lib/module/components/DataRequestScreen.js +0 -321
  366. package/lib/module/components/DataRequestScreen.js.map +0 -1
  367. package/lib/module/components/EmailVerificationModal.js +0 -311
  368. package/lib/module/components/EmailVerificationModal.js.map +0 -1
  369. package/lib/module/components/Onairos.js.map +0 -1
  370. package/lib/module/components/OnairosButton.js.map +0 -1
  371. package/lib/module/components/Overlay.js.map +0 -1
  372. package/lib/module/components/PinInput.js.map +0 -1
  373. package/lib/module/components/PlatformList.js.map +0 -1
  374. package/lib/module/components/TrainingModal.js +0 -708
  375. package/lib/module/components/TrainingModal.js.map +0 -1
  376. package/lib/module/components/UniversalOnboarding.js.map +0 -1
  377. package/lib/module/components/UniversalOnboarding.tsx.new +0 -455
  378. package/lib/module/components/onboarding/OAuthWebView.js.map +0 -1
  379. package/lib/module/components/onboarding/OnboardingHeader.js.map +0 -1
  380. package/lib/module/components/onboarding/PinInput.js.map +0 -1
  381. package/lib/module/components/onboarding/PlatformConnector.js.map +0 -1
  382. package/lib/module/components/screens/ConnectorScreen.js +0 -138
  383. package/lib/module/components/screens/ConnectorScreen.js.map +0 -1
  384. package/lib/module/components/screens/LoadingScreen.js +0 -83
  385. package/lib/module/components/screens/LoadingScreen.js.map +0 -1
  386. package/lib/module/components/screens/PinCreationScreen.js +0 -53
  387. package/lib/module/components/screens/PinCreationScreen.js.map +0 -1
  388. package/lib/module/constants/index.js.map +0 -1
  389. package/lib/module/hooks/useConnections.js.map +0 -1
  390. package/lib/module/hooks/useCredentials.js.map +0 -1
  391. package/lib/module/index.js.map +0 -1
  392. package/lib/module/services/apiKeyService.js.map +0 -1
  393. package/lib/module/services/oauthService.js.map +0 -1
  394. package/lib/module/services/platformAuthService.js.map +0 -1
  395. package/lib/module/types/ambient.d.js.map +0 -1
  396. package/lib/module/types/declarations.d.js.map +0 -1
  397. package/lib/module/types/index.d.js.map +0 -1
  398. package/lib/module/types/index.js.map +0 -1
  399. package/lib/module/types/node-fix.d.js.map +0 -1
  400. package/lib/module/types/node-override.d.js.map +0 -1
  401. package/lib/module/types/opacity.d.js.map +0 -1
  402. package/lib/module/types/types.d.js.map +0 -1
  403. package/lib/module/types.js.map +0 -1
  404. package/lib/module/utils/Portal.js.map +0 -1
  405. package/lib/module/utils/api.js.map +0 -1
  406. package/lib/module/utils/auth.js.map +0 -1
  407. package/lib/module/utils/crypto.js.map +0 -1
  408. package/lib/module/utils/debugHelper.js.map +0 -1
  409. package/lib/module/utils/encryption.js.map +0 -1
  410. package/lib/module/utils/onairosApi.js.map +0 -1
  411. package/lib/module/utils/programmaticFlow.js.map +0 -1
  412. package/lib/module/utils/retryHelper.js.map +0 -1
  413. package/lib/module/utils/secureStorage.js.map +0 -1
  414. package/lib/typescript/api/index.d.ts +0 -8
  415. package/lib/typescript/api/index.d.ts.map +0 -1
  416. package/lib/typescript/components/DataRequestModal.d.ts +0 -11
  417. package/lib/typescript/components/DataRequestModal.d.ts.map +0 -1
  418. package/lib/typescript/components/DataRequestScreen.d.ts +0 -11
  419. package/lib/typescript/components/DataRequestScreen.d.ts.map +0 -1
  420. package/lib/typescript/components/EmailVerificationModal.d.ts +0 -11
  421. package/lib/typescript/components/EmailVerificationModal.d.ts.map +0 -1
  422. package/lib/typescript/components/Onairos.d.ts +0 -4
  423. package/lib/typescript/components/Onairos.d.ts.map +0 -1
  424. package/lib/typescript/components/OnairosButton.d.ts +0 -12
  425. package/lib/typescript/components/OnairosButton.d.ts.map +0 -1
  426. package/lib/typescript/components/Overlay.d.ts +0 -4
  427. package/lib/typescript/components/Overlay.d.ts.map +0 -1
  428. package/lib/typescript/components/PinInput.d.ts +0 -4
  429. package/lib/typescript/components/PinInput.d.ts.map +0 -1
  430. package/lib/typescript/components/PlatformList.d.ts +0 -4
  431. package/lib/typescript/components/PlatformList.d.ts.map +0 -1
  432. package/lib/typescript/components/TrainingModal.d.ts +0 -4
  433. package/lib/typescript/components/TrainingModal.d.ts.map +0 -1
  434. package/lib/typescript/components/UniversalOnboarding.d.ts +0 -4
  435. package/lib/typescript/components/UniversalOnboarding.d.ts.map +0 -1
  436. package/lib/typescript/components/onboarding/OAuthWebView.d.ts +0 -10
  437. package/lib/typescript/components/onboarding/OAuthWebView.d.ts.map +0 -1
  438. package/lib/typescript/components/onboarding/OnboardingHeader.d.ts +0 -11
  439. package/lib/typescript/components/onboarding/OnboardingHeader.d.ts.map +0 -1
  440. package/lib/typescript/components/onboarding/PinInput.d.ts +0 -4
  441. package/lib/typescript/components/onboarding/PinInput.d.ts.map +0 -1
  442. package/lib/typescript/components/onboarding/PlatformConnector.d.ts +0 -13
  443. package/lib/typescript/components/onboarding/PlatformConnector.d.ts.map +0 -1
  444. package/lib/typescript/components/screens/ConnectorScreen.d.ts +0 -9
  445. package/lib/typescript/components/screens/ConnectorScreen.d.ts.map +0 -1
  446. package/lib/typescript/components/screens/LoadingScreen.d.ts +0 -9
  447. package/lib/typescript/components/screens/LoadingScreen.d.ts.map +0 -1
  448. package/lib/typescript/components/screens/PinCreationScreen.d.ts +0 -10
  449. package/lib/typescript/components/screens/PinCreationScreen.d.ts.map +0 -1
  450. package/lib/typescript/constants/index.d.ts +0 -53
  451. package/lib/typescript/constants/index.d.ts.map +0 -1
  452. package/lib/typescript/hooks/useConnections.d.ts +0 -9
  453. package/lib/typescript/hooks/useConnections.d.ts.map +0 -1
  454. package/lib/typescript/hooks/useCredentials.d.ts +0 -9
  455. package/lib/typescript/hooks/useCredentials.d.ts.map +0 -1
  456. package/lib/typescript/index.d.ts +0 -18
  457. package/lib/typescript/index.d.ts.map +0 -1
  458. package/lib/typescript/services/apiKeyService.d.ts +0 -132
  459. package/lib/typescript/services/apiKeyService.d.ts.map +0 -1
  460. package/lib/typescript/services/oauthService.d.ts +0 -50
  461. package/lib/typescript/services/oauthService.d.ts.map +0 -1
  462. package/lib/typescript/services/platformAuthService.d.ts +0 -144
  463. package/lib/typescript/services/platformAuthService.d.ts.map +0 -1
  464. package/lib/typescript/types/index.d.ts +0 -231
  465. package/lib/typescript/types/index.d.ts.map +0 -1
  466. package/lib/typescript/types.d.ts +0 -270
  467. package/lib/typescript/types.d.ts.map +0 -1
  468. package/lib/typescript/utils/Portal.d.ts +0 -14
  469. package/lib/typescript/utils/Portal.d.ts.map +0 -1
  470. package/lib/typescript/utils/api.d.ts +0 -6
  471. package/lib/typescript/utils/api.d.ts.map +0 -1
  472. package/lib/typescript/utils/auth.d.ts +0 -6
  473. package/lib/typescript/utils/auth.d.ts.map +0 -1
  474. package/lib/typescript/utils/crypto.d.ts +0 -4
  475. package/lib/typescript/utils/crypto.d.ts.map +0 -1
  476. package/lib/typescript/utils/debugHelper.d.ts +0 -29
  477. package/lib/typescript/utils/debugHelper.d.ts.map +0 -1
  478. package/lib/typescript/utils/encryption.d.ts +0 -19
  479. package/lib/typescript/utils/encryption.d.ts.map +0 -1
  480. package/lib/typescript/utils/onairosApi.d.ts +0 -87
  481. package/lib/typescript/utils/onairosApi.d.ts.map +0 -1
  482. package/lib/typescript/utils/programmaticFlow.d.ts +0 -23
  483. package/lib/typescript/utils/programmaticFlow.d.ts.map +0 -1
  484. package/lib/typescript/utils/retryHelper.d.ts +0 -69
  485. package/lib/typescript/utils/retryHelper.d.ts.map +0 -1
  486. package/lib/typescript/utils/secureStorage.d.ts +0 -94
  487. package/lib/typescript/utils/secureStorage.d.ts.map +0 -1
  488. package/src/api/index.ts +0 -111
  489. package/src/assets/images/email.png +0 -0
  490. package/src/assets/images/linkedin.png +0 -0
  491. package/src/assets/images/onairos_logo.png +0 -0
  492. package/src/assets/images/reddit.png +0 -0
  493. package/src/assets/images/youtube.png +0 -0
  494. package/src/components/DataRequestModal.tsx +0 -227
  495. package/src/components/DataRequestScreen.tsx +0 -356
  496. package/src/components/EmailVerificationModal.tsx +0 -364
  497. package/src/components/Onairos.tsx +0 -425
  498. package/src/components/OnairosButton.tsx +0 -359
  499. package/src/components/Overlay.tsx +0 -506
  500. package/src/components/PinInput.tsx +0 -343
  501. package/src/components/PlatformList.tsx +0 -145
  502. package/src/components/TrainingModal.tsx +0 -737
  503. package/src/components/UniversalOnboarding.tsx +0 -1839
  504. package/src/components/UniversalOnboarding.tsx.new +0 -455
  505. package/src/components/onboarding/OAuthWebView.tsx +0 -838
  506. package/src/components/onboarding/OnboardingHeader.tsx +0 -70
  507. package/src/components/onboarding/PinInput.tsx +0 -356
  508. package/src/components/onboarding/PlatformConnector.tsx +0 -302
  509. package/src/components/screens/ConnectorScreen.tsx +0 -153
  510. package/src/components/screens/LoadingScreen.tsx +0 -100
  511. package/src/components/screens/PinCreationScreen.tsx +0 -67
  512. package/src/constants/index.ts +0 -83
  513. package/src/hooks/useConnections.ts +0 -163
  514. package/src/hooks/useCredentials.ts +0 -175
  515. package/src/index.js +0 -14
  516. package/src/index.ts +0 -50
  517. package/src/services/SDK_API_KEY_VALIDATION.md +0 -428
  518. package/src/services/apiKeyService.ts +0 -979
  519. package/src/services/oauthService.ts +0 -412
  520. package/src/services/platformAuthService.ts +0 -1113
  521. package/src/types/ambient.d.ts +0 -29
  522. package/src/types/declarations.d.ts +0 -26
  523. package/src/types/index.d.ts +0 -274
  524. package/src/types/index.ts +0 -244
  525. package/src/types/node-fix.d.ts +0 -19
  526. package/src/types/node-override.d.ts +0 -24
  527. package/src/types/opacity.d.ts +0 -16
  528. package/src/types/types.d.ts +0 -18
  529. package/src/types.ts +0 -298
  530. package/src/utils/Portal.tsx +0 -83
  531. package/src/utils/api.js +0 -112
  532. package/src/utils/auth.js +0 -104
  533. package/src/utils/crypto.js +0 -60
  534. package/src/utils/debugHelper.ts +0 -53
  535. package/src/utils/encryption.ts +0 -69
  536. package/src/utils/onairosApi.ts +0 -391
  537. package/src/utils/programmaticFlow.ts +0 -113
  538. package/src/utils/retryHelper.ts +0 -275
  539. package/src/utils/secureStorage.ts +0 -361
  540. package/types/index.d.ts +0 -218
  541. package/types/node-env.d.ts +0 -15
  542. /package/{src/assets/images → lib/commonjs/assets/icons}/farcaster.png +0 -0
  543. /package/{src/assets/images → lib/commonjs/assets/icons}/instagram.png +0 -0
  544. /package/{src/assets/images → lib/commonjs/assets/icons}/pinterest.png +0 -0
  545. /package/{src/assets/images → lib/commonjs/assets/icons}/swerv_logo.png +0 -0
  546. /package/{src/assets/images → lib/commonjs/assets/icons}/twitter.jpg +0 -0
@@ -1,380 +1 @@
1
- import { Linking } from 'react-native';
2
- import { updateCredentials } from '../utils/secureStorage';
3
- import { sha256 } from '../utils/crypto';
4
- import { onairosApi } from '../api';
5
-
6
- // Define OAuth configuration types
7
-
8
- // Platform-specific OAuth configurations
9
- const OAUTH_CONFIGS = {
10
- instagram: {
11
- clientId: 'YOUR_INSTAGRAM_CLIENT_ID',
12
- // Replace with actual client ID
13
- redirectUri: 'onairosanime://auth/instagram',
14
- scope: 'user_profile,user_media',
15
- authorizationEndpoint: 'https://api.instagram.com/oauth/authorize',
16
- tokenEndpoint: 'https://api.instagram.com/oauth/access_token',
17
- responseType: 'code'
18
- },
19
- youtube: {
20
- clientId: 'YOUR_YOUTUBE_CLIENT_ID',
21
- // Replace with actual client ID
22
- redirectUri: 'onairosanime://auth/youtube',
23
- scope: 'https://www.googleapis.com/auth/youtube.readonly',
24
- authorizationEndpoint: 'https://accounts.google.com/o/oauth2/auth',
25
- tokenEndpoint: 'https://oauth2.googleapis.com/token',
26
- responseType: 'code'
27
- },
28
- pinterest: {
29
- clientId: 'YOUR_PINTEREST_CLIENT_ID',
30
- // Replace with actual client ID
31
- redirectUri: 'onairosanime://auth/pinterest',
32
- scope: 'boards:read,pins:read',
33
- authorizationEndpoint: 'https://www.pinterest.com/oauth/',
34
- tokenEndpoint: 'https://api.pinterest.com/v5/oauth/token',
35
- responseType: 'code'
36
- },
37
- reddit: {
38
- clientId: 'YOUR_REDDIT_CLIENT_ID',
39
- // Replace with actual client ID
40
- redirectUri: 'onairosanime://auth/reddit',
41
- scope: 'identity,read',
42
- authorizationEndpoint: 'https://www.reddit.com/api/v1/authorize',
43
- tokenEndpoint: 'https://www.reddit.com/api/v1/access_token',
44
- responseType: 'code'
45
- }
46
- };
47
-
48
- /**
49
- * Generate a state value for OAuth to prevent CSRF attacks
50
- */
51
- const generateState = () => {
52
- const randomValue = Math.random().toString(36).substring(2, 15);
53
- return sha256(randomValue).substring(0, 10);
54
- };
55
-
56
- /**
57
- * Initialize OAuth service handlers and listeners
58
- */
59
- export const initializeOAuthService = () => {
60
- // Set up deep linking handlers for OAuth redirects
61
- Linking.addEventListener('url', handleDeepLink);
62
- };
63
-
64
- /**
65
- * Clean up OAuth service handlers and listeners
66
- */
67
- export const cleanupOAuthService = () => {
68
- // Use the modern React Native Linking API
69
- if (typeof Linking.removeAllListeners === 'function') {
70
- Linking.removeAllListeners('url');
71
- }
72
- };
73
-
74
- // Keep track of current OAuth state and callbacks
75
- let currentOAuthState = null;
76
- let currentOAuthPlatform = null;
77
- let currentOAuthResolve = null;
78
- let currentOAuthReject = null;
79
-
80
- /**
81
- * Handle deep link callbacks from OAuth providers
82
- */
83
- const handleDeepLink = async event => {
84
- try {
85
- const {
86
- url
87
- } = event;
88
-
89
- // Check if this is an OAuth callback URL
90
- if (!url.startsWith('onairosanime://auth/')) {
91
- return;
92
- }
93
-
94
- // Extract platform from URL path
95
- const platform = url.split('onairosanime://auth/')[1].split('?')[0];
96
-
97
- // Only handle if it matches current OAuth flow
98
- if (platform !== currentOAuthPlatform) {
99
- return;
100
- }
101
-
102
- // Parse URL parameters
103
- const params = new URL(url).searchParams;
104
- const code = params.get('code');
105
- const state = params.get('state');
106
- const error = params.get('error');
107
-
108
- // Validate state to prevent CSRF attacks
109
- if (state !== currentOAuthState) {
110
- if (currentOAuthReject) {
111
- currentOAuthReject(new Error('OAuth state mismatch - possible CSRF attack'));
112
- }
113
- return;
114
- }
115
-
116
- // Handle errors
117
- if (error) {
118
- if (currentOAuthReject) {
119
- currentOAuthReject(new Error(`OAuth error: ${error}`));
120
- }
121
- return;
122
- }
123
-
124
- // Proceed with token exchange if code is present
125
- if (code) {
126
- const tokenResult = await exchangeCodeForToken(platform, code);
127
- if (currentOAuthResolve) {
128
- currentOAuthResolve(tokenResult);
129
- }
130
- } else {
131
- if (currentOAuthReject) {
132
- currentOAuthReject(new Error('No authorization code received'));
133
- }
134
- }
135
- } catch (error) {
136
- console.error('Error handling OAuth deep link:', error);
137
- if (currentOAuthReject) {
138
- currentOAuthReject(error);
139
- }
140
- } finally {
141
- // Reset state
142
- currentOAuthState = null;
143
- currentOAuthPlatform = null;
144
- currentOAuthResolve = null;
145
- currentOAuthReject = null;
146
- }
147
- };
148
-
149
- /**
150
- * Exchange OAuth authorization code for access token
151
- */
152
- const exchangeCodeForToken = async (platform, code) => {
153
- try {
154
- const config = OAUTH_CONFIGS[platform];
155
- if (!config) {
156
- throw new Error(`Unsupported platform: ${platform}`);
157
- }
158
-
159
- // Prepare token request parameters
160
- const params = new URLSearchParams({
161
- grant_type: 'authorization_code',
162
- code,
163
- redirect_uri: config.redirectUri,
164
- client_id: config.clientId
165
- });
166
-
167
- // Exchange code for token
168
- const response = await fetch(config.tokenEndpoint, {
169
- method: 'POST',
170
- headers: {
171
- 'Content-Type': 'application/x-www-form-urlencoded'
172
- },
173
- body: params.toString()
174
- });
175
- const data = await response.json();
176
- if (!response.ok) {
177
- throw new Error(data.error || 'Failed to exchange code for token');
178
- }
179
-
180
- // Fetch user information based on the platform
181
- const userInfo = await fetchUserInfo(platform, data.access_token);
182
- return {
183
- token: data.access_token,
184
- refreshToken: data.refresh_token,
185
- expiresIn: data.expires_in,
186
- username: userInfo.username,
187
- userId: userInfo.id
188
- };
189
- } catch (error) {
190
- console.error(`Error exchanging code for token (${platform}):`, error);
191
- throw error;
192
- }
193
- };
194
-
195
- /**
196
- * Fetch user information from the connected platform
197
- */
198
- const fetchUserInfo = async (platform, accessToken) => {
199
- try {
200
- let endpoint;
201
- let headers = {
202
- Authorization: `Bearer ${accessToken}`
203
- };
204
-
205
- // Platform-specific API endpoints for user info
206
- switch (platform) {
207
- case 'instagram':
208
- endpoint = 'https://graph.instagram.com/me?fields=id,username';
209
- break;
210
- case 'youtube':
211
- endpoint = 'https://www.googleapis.com/youtube/v3/channels?part=snippet&mine=true';
212
- break;
213
- case 'pinterest':
214
- endpoint = 'https://api.pinterest.com/v5/user_account';
215
- break;
216
- case 'reddit':
217
- endpoint = 'https://oauth.reddit.com/api/v1/me';
218
- break;
219
- default:
220
- throw new Error(`Unsupported platform: ${platform}`);
221
- }
222
- const response = await fetch(endpoint, {
223
- headers
224
- });
225
- const data = await response.json();
226
- if (!response.ok) {
227
- throw new Error(data.error || 'Failed to fetch user info');
228
- }
229
-
230
- // Extract user information based on platform-specific response format
231
- switch (platform) {
232
- case 'instagram':
233
- return {
234
- id: data.id,
235
- username: data.username
236
- };
237
- case 'youtube':
238
- return {
239
- id: data.items[0].id,
240
- username: data.items[0].snippet.title
241
- };
242
- case 'pinterest':
243
- return {
244
- id: data.id,
245
- username: data.username || data.full_name
246
- };
247
- case 'reddit':
248
- return {
249
- id: data.id,
250
- username: data.name
251
- };
252
- default:
253
- throw new Error(`Unsupported platform: ${platform}`);
254
- }
255
- } catch (error) {
256
- console.error(`Error fetching user info (${platform}):`, error);
257
- throw error;
258
- }
259
- };
260
-
261
- /**
262
- * Connect to a platform using OAuth
263
- */
264
- export const connectPlatform = platform => {
265
- return new Promise((resolve, reject) => {
266
- try {
267
- const config = OAUTH_CONFIGS[platform];
268
- if (!config) {
269
- throw new Error(`Unsupported platform: ${platform}`);
270
- }
271
-
272
- // Generate state for CSRF protection
273
- const state = generateState();
274
-
275
- // Build authorization URL
276
- const authUrl = new URL(config.authorizationEndpoint);
277
- authUrl.searchParams.append('client_id', config.clientId);
278
- authUrl.searchParams.append('redirect_uri', config.redirectUri);
279
- authUrl.searchParams.append('response_type', config.responseType);
280
- authUrl.searchParams.append('scope', config.scope);
281
- authUrl.searchParams.append('state', state);
282
-
283
- // Set up current OAuth state for callback handling
284
- currentOAuthState = state;
285
- currentOAuthPlatform = platform;
286
- currentOAuthResolve = resolve;
287
- currentOAuthReject = reject;
288
-
289
- // Open browser or WebView to the authorization URL
290
- Linking.openURL(authUrl.toString());
291
- } catch (error) {
292
- reject(error);
293
- }
294
- });
295
- };
296
-
297
- /**
298
- * Disconnect from a platform
299
- */
300
- export const disconnectPlatform = async (platform, credentials) => {
301
- try {
302
- // Call Onairos API to disconnect platform
303
- await onairosApi.post('/users/disconnect-platform', {
304
- platform,
305
- username: credentials.username
306
- });
307
-
308
- // Update local credentials to remove platform
309
- const updatedPlatforms = {
310
- ...credentials.platforms
311
- };
312
-
313
- // Type-safe platform removal using keyof operator
314
- if (updatedPlatforms && platform in updatedPlatforms) {
315
- delete updatedPlatforms[platform];
316
- }
317
- await updateCredentials({
318
- ...credentials,
319
- platforms: updatedPlatforms
320
- });
321
- return true;
322
- } catch (error) {
323
- console.error(`Error disconnecting platform (${platform}):`, error);
324
- return false;
325
- }
326
- };
327
-
328
- /**
329
- * Store platform connection data in user credentials
330
- */
331
- export const storePlatformConnection = async (platform, connectionData, credentials) => {
332
- try {
333
- // Only accept valid platform types
334
- const validPlatform = platform === 'instagram' || platform === 'youtube' || platform === 'pinterest' || platform === 'reddit';
335
- if (!validPlatform) {
336
- throw new Error(`Unsupported platform: ${platform}`);
337
- }
338
-
339
- // Update platforms in credentials with type safety
340
- const updatedPlatforms = {
341
- ...credentials.platforms
342
- };
343
-
344
- // Type-safe assignment
345
- const platformData = {
346
- username: connectionData.username,
347
- userId: connectionData.userId,
348
- token: connectionData.token,
349
- refreshToken: connectionData.refreshToken,
350
- expiresAt: connectionData.expiresIn ? Date.now() + connectionData.expiresIn * 1000 : null,
351
- connectedAt: Date.now()
352
- };
353
-
354
- // Assign platform data based on platform type
355
- if (platform === 'instagram') updatedPlatforms.instagram = platformData;else if (platform === 'youtube') updatedPlatforms.youtube = platformData;else if (platform === 'pinterest') updatedPlatforms.pinterest = platformData;else if (platform === 'reddit') updatedPlatforms.reddit = platformData;
356
-
357
- // Update stored credentials
358
- await updateCredentials({
359
- ...credentials,
360
- platforms: updatedPlatforms
361
- });
362
- return true;
363
- } catch (error) {
364
- console.error(`Error storing platform connection (${platform}):`, error);
365
- return false;
366
- }
367
- };
368
- /**
369
- * Service for handling OAuth connections to various platforms
370
- */
371
- export const OAuthService = {
372
- initializeOAuthService,
373
- cleanupOAuthService,
374
- connectPlatform,
375
- disconnectPlatform,
376
- storePlatformConnection,
377
- // Base API URL
378
- _apiBaseUrl: 'https://api2.onairos.uk'
379
- };
380
- //# sourceMappingURL=oauthService.js.map
1
+ import{Linking}from'react-native';import{updateCredentials}from'../utils/secureStorage';import{sha256}from'../utils/crypto';import{onairosApi}from'../api';import{API_CONFIG}from'../config/api';const OAUTH_CONFIGS={'instagram':{'clientId':_0x4b8d(0x0),'redirectUri':_0x4b8d(0x1),'scope':_0x4b8d(0x2),'authorizationEndpoint':_0x4b8d(0x3),'tokenEndpoint':_0x4b8d(0x4),'responseType':'code'},'youtube':{'clientId':_0x4b8d(0x5),'redirectUri':_0x4b8d(0x6),'scope':_0x4b8d(0x7),'authorizationEndpoint':'https://accounts.google.com/o/oauth2/auth','tokenEndpoint':_0x4b8d(0x8),'responseType':'code'},'pinterest':{'clientId':_0x4b8d(0x9),'redirectUri':_0x4b8d(0xa),'scope':_0x4b8d(0xb),'authorizationEndpoint':_0x4b8d(0xc),'tokenEndpoint':'https://api.pinterest.com/v5/oauth/token','responseType':_0x4b8d(0xd)},'reddit':{'clientId':_0x4b8d(0xe),'redirectUri':_0x4b8d(0xf),'scope':_0x4b8d(0x10),'authorizationEndpoint':_0x4b8d(0x11),'tokenEndpoint':_0x4b8d(0x12),'responseType':_0x4b8d(0xd)}},generateState=()=>{const _0x88e551={'JFAOD':function(_0x18032c,_0x5f3a62){return _0x18032c(_0x5f3a62);}},_0x10e8d0=Math[_0x4b8d(0x13)]()[_0x4b8d(0x14)](0x24)[_0x4b8d(0x15)](0x2,0xf);return _0x88e551[_0x4b8d(0x16)](sha256,_0x10e8d0)[_0x4b8d(0x15)](0x0,0xa);};export const initializeOAuthService=()=>{Linking['addEventListener'](_0x4b8d(0x17),handleDeepLink);};export const cleanupOAuthService=()=>{const _0x60a3ae={'qWvEj':function(_0x5e3a19,_0x293bb5){return _0x5e3a19(_0x293bb5);},'YtyDU':_0x4b8d(0x18),'dfYmV':function(_0x209030,_0x974f01){return _0x209030===_0x974f01;},'aVPPs':_0x4b8d(0x19),'IOhXR':function(_0x545dcd,_0x5338ab){return _0x545dcd!==_0x5338ab;},'AWHYY':_0x4b8d(0x1a),'QEYEf':_0x4b8d(0x1b)};_0x60a3ae[_0x4b8d(0x1c)](typeof Linking[_0x4b8d(0x1d)],_0x60a3ae[_0x4b8d(0x1e)])&&(_0x60a3ae[_0x4b8d(0x1f)](_0x60a3ae['AWHYY'],_0x60a3ae['QEYEf'])?Linking[_0x4b8d(0x1d)](_0x4b8d(0x17)):_0x60a3ae[_0x4b8d(0x20)](_0x7bc941,new _0x2acf49(_0x60a3ae[_0x4b8d(0x21)])));};function _0x4b8d(_0x357840,_0x4b8dee){_0x357840=_0x357840-0x0;const _0x4b9091=_0x3578();let _0x225b59=_0x4b9091[_0x357840];return _0x225b59;}let currentOAuthState=null,currentOAuthPlatform=null,currentOAuthResolve=null,currentOAuthReject=null;const handleDeepLink=async _0x397404=>{const _0x2095eb={'RaBjE':'OAuth\x20state\x20mismatch\x20-\x20possible\x20CSRF\x20attack','sjbyS':'onairosanime://auth/','EXOBo':_0x4b8d(0x22),'QMcxb':_0x4b8d(0xd),'QpgVC':_0x4b8d(0x23),'yilig':'error','YASwA':function(_0x2a66a6,_0x40ea8b){return _0x2a66a6!==_0x40ea8b;},'hrpUt':_0x4b8d(0x24),'HuaHX':function(_0x5539fd,_0x31ab18){return _0x5539fd(_0x31ab18);},'LKxFm':function(_0x3cb933,_0x175829){return _0x3cb933!==_0x175829;},'LCuEd':_0x4b8d(0x25),'MoBOY':function(_0x51e685,_0x1e32f9,_0x341e57){return _0x51e685(_0x1e32f9,_0x341e57);},'nopgJ':function(_0x4b4090,_0x5c2c94){return _0x4b4090(_0x5c2c94);},'bJSGp':_0x4b8d(0x26),'BQXlb':_0x4b8d(0x27),'BMJIg':function(_0x128574,_0x599ad9){return _0x128574(_0x599ad9);}};try{const {url:_0x53bb8a}=_0x397404;if(!_0x53bb8a[_0x4b8d(0x28)](_0x2095eb['sjbyS']))return;const _0x170bf1=_0x53bb8a[_0x4b8d(0x29)](_0x2095eb['sjbyS'])[0x1][_0x4b8d(0x29)]('?')[0x0];if(_0x170bf1!==currentOAuthPlatform){if(_0x2095eb['EXOBo']!==_0x2095eb['EXOBo'])throw new _0x407aad('Unsupported\x20platform:\x20'+_0x30de61);else return;}const _0x29c7c3=new URL(_0x53bb8a)[_0x4b8d(0x2a)],_0x22eb1c=_0x29c7c3[_0x4b8d(0x2b)](_0x2095eb[_0x4b8d(0x2c)]),_0x4a324e=_0x29c7c3[_0x4b8d(0x2b)](_0x2095eb[_0x4b8d(0x2d)]),_0x1a5afa=_0x29c7c3[_0x4b8d(0x2b)](_0x2095eb[_0x4b8d(0x2e)]);if(_0x2095eb[_0x4b8d(0x2f)](_0x4a324e,currentOAuthState)){if(_0x2095eb[_0x4b8d(0x2f)](_0x2095eb[_0x4b8d(0x30)],_0x4b8d(0x24)))return _0x71d314[_0x4b8d(0x31)](_0x4b8d(0x32)+_0x397d42+'):',_0x407be6),![];else{currentOAuthReject&&_0x2095eb[_0x4b8d(0x33)](currentOAuthReject,new Error(_0x2095eb[_0x4b8d(0x34)]));return;}}if(_0x1a5afa){if(_0x2095eb[_0x4b8d(0x35)](_0x2095eb[_0x4b8d(0x36)],_0x2095eb[_0x4b8d(0x36)])){_0x365278&&_0xf6607c(new _0x258d03(_0x2095eb[_0x4b8d(0x34)]));return;}else{currentOAuthReject&&_0x2095eb[_0x4b8d(0x33)](currentOAuthReject,new Error(_0x4b8d(0x37)+_0x1a5afa));return;}}if(_0x22eb1c){const _0xe8a7ab=await _0x2095eb[_0x4b8d(0x38)](exchangeCodeForToken,_0x170bf1,_0x22eb1c);currentOAuthResolve&&_0x2095eb['HuaHX'](currentOAuthResolve,_0xe8a7ab);}else currentOAuthReject&&_0x2095eb[_0x4b8d(0x39)](currentOAuthReject,new Error(_0x2095eb[_0x4b8d(0x3a)]));}catch(_0x54b1a6){console[_0x4b8d(0x31)](_0x2095eb[_0x4b8d(0x3b)],_0x54b1a6),currentOAuthReject&&_0x2095eb[_0x4b8d(0x3c)](currentOAuthReject,_0x54b1a6);}finally{currentOAuthState=null,currentOAuthPlatform=null,currentOAuthResolve=null,currentOAuthReject=null;}},exchangeCodeForToken=async(_0x405aa6,_0x37c9fe)=>{const _0xaf66fc={'NXdSH':function(_0x28d995,_0x29422b){return _0x28d995===_0x29422b;},'szBNA':'elOWa','TBhro':function(_0x178d0c,_0x5288fe){return _0x178d0c!==_0x5288fe;},'ALlan':_0x4b8d(0x3d),'awRJj':_0x4b8d(0x3e),'Jhmqj':function(_0xf7059,_0x33fa96,_0x53c41f){return _0xf7059(_0x33fa96,_0x53c41f);},'vFIwd':'application/x-www-form-urlencoded','RTMLB':function(_0x3111d6,_0x1b545f,_0x1c9ada){return _0x3111d6(_0x1b545f,_0x1c9ada);}};try{if(_0xaf66fc[_0x4b8d(0x3f)]===_0x4b8d(0x40)){const _0x3b22f5=OAUTH_CONFIGS[_0x405aa6];if(!_0x3b22f5){if(_0xaf66fc[_0x4b8d(0x41)](_0x4b8d(0x42),_0xaf66fc[_0x4b8d(0x43)]))throw new Error(_0x4b8d(0x44)+_0x405aa6);else _0xaf66fc[_0x4b8d(0x45)](typeof Linking[_0x4b8d(0x1d)],_0x4b8d(0x19))&&Linking['removeAllListeners'](_0x4b8d(0x17));}const _0x356ca4=new URLSearchParams({'grant_type':_0xaf66fc[_0x4b8d(0x46)],'code':_0x37c9fe,'redirect_uri':_0x3b22f5[_0x4b8d(0x47)],'client_id':_0x3b22f5[_0x4b8d(0x48)]}),_0x17ab9e=await _0xaf66fc['Jhmqj'](fetch,_0x3b22f5['tokenEndpoint'],{'method':'POST','headers':{'Content-Type':_0xaf66fc[_0x4b8d(0x49)]},'body':_0x356ca4['toString']()}),_0x7eb9b8=await _0x17ab9e[_0x4b8d(0x4a)]();if(!_0x17ab9e['ok'])throw new Error(_0x7eb9b8['error']||'Failed\x20to\x20exchange\x20code\x20for\x20token');const _0x4d5acf=await _0xaf66fc['RTMLB'](fetchUserInfo,_0x405aa6,_0x7eb9b8['access_token']);return{'token':_0x7eb9b8[_0x4b8d(0x4b)],'refreshToken':_0x7eb9b8[_0x4b8d(0x4c)],'expiresIn':_0x7eb9b8[_0x4b8d(0x4d)],'username':_0x4d5acf[_0x4b8d(0x4e)],'userId':_0x4d5acf['id']};}else _0x141c79=null,_0x9aa4e4=null,_0x55ad34=null,_0x47f447=null;}catch(_0x51bc1f){console[_0x4b8d(0x31)]('Error\x20exchanging\x20code\x20for\x20token\x20('+_0x405aa6+'):',_0x51bc1f);throw _0x51bc1f;}},fetchUserInfo=async(_0x4d5f2d,_0x471a14)=>{const _0x43e146={'kOCIn':'url','xyBTE':function(_0x14cd83,_0x4cf823){return _0x14cd83!==_0x4cf823;},'OcKBB':_0x4b8d(0x4f),'bdmzG':'instagram','uEXSW':'https://graph.instagram.com/me?fields=id,username','GTads':_0x4b8d(0x50),'mdELt':'https://www.googleapis.com/youtube/v3/channels?part=snippet&mine=true','sNNiD':'pinterest','BxFqe':_0x4b8d(0x51),'BYCxb':_0x4b8d(0x52),'RcXKd':_0x4b8d(0x53),'NMeuB':function(_0xc99104,_0xc8e140){return _0xc99104===_0xc8e140;},'lnSnw':'iiJAd','FWlKZ':_0x4b8d(0x54)};try{if(_0x43e146[_0x4b8d(0x55)](_0x4b8d(0x56),_0x43e146[_0x4b8d(0x57)])){let _0x33bbe9,_0x22924c={'Authorization':_0x4b8d(0x58)+_0x471a14};switch(_0x4d5f2d){case _0x43e146[_0x4b8d(0x59)]:_0x33bbe9=_0x43e146[_0x4b8d(0x5a)];break;case _0x43e146['GTads']:_0x33bbe9=_0x43e146['mdELt'];break;case _0x43e146[_0x4b8d(0x5b)]:_0x33bbe9=_0x43e146[_0x4b8d(0x5c)];break;case _0x43e146[_0x4b8d(0x5d)]:_0x33bbe9=_0x43e146[_0x4b8d(0x5e)];break;default:throw new Error('Unsupported\x20platform:\x20'+_0x4d5f2d);}const _0x13fb3b=await fetch(_0x33bbe9,{'headers':_0x22924c}),_0x8601b5=await _0x13fb3b[_0x4b8d(0x4a)]();if(!_0x13fb3b['ok']){if(_0x43e146[_0x4b8d(0x5f)](_0x43e146['lnSnw'],_0x43e146['lnSnw']))throw new Error(_0x8601b5[_0x4b8d(0x31)]||_0x43e146[_0x4b8d(0x60)]);else Linking[_0x4b8d(0x1d)](_0x43e146['kOCIn']);}switch(_0x4d5f2d){case _0x43e146['bdmzG']:return{'id':_0x8601b5['id'],'username':_0x8601b5[_0x4b8d(0x4e)]};case _0x43e146[_0x4b8d(0x61)]:return{'id':_0x8601b5[_0x4b8d(0x62)][0x0]['id'],'username':_0x8601b5[_0x4b8d(0x62)][0x0][_0x4b8d(0x63)][_0x4b8d(0x64)]};case _0x4b8d(0x65):return{'id':_0x8601b5['id'],'username':_0x8601b5[_0x4b8d(0x4e)]||_0x8601b5[_0x4b8d(0x66)]};case _0x43e146[_0x4b8d(0x5d)]:return{'id':_0x8601b5['id'],'username':_0x8601b5['name']};default:throw new Error('Unsupported\x20platform:\x20'+_0x4d5f2d);}}else return;}catch(_0x59e11d){console['error'](_0x4b8d(0x67)+_0x4d5f2d+'):',_0x59e11d);throw _0x59e11d;}};function _0x3578(){const _0x3c3782=['YOUR_INSTAGRAM_CLIENT_ID','onairosanime://auth/instagram','user_profile,user_media','https://api.instagram.com/oauth/authorize','https://api.instagram.com/oauth/access_token','YOUR_YOUTUBE_CLIENT_ID','onairosanime://auth/youtube','https://www.googleapis.com/auth/youtube.readonly','https://oauth2.googleapis.com/token','YOUR_PINTEREST_CLIENT_ID','onairosanime://auth/pinterest','boards:read,pins:read','https://www.pinterest.com/oauth/','code','YOUR_REDDIT_CLIENT_ID','onairosanime://auth/reddit','identity,read','https://www.reddit.com/api/v1/authorize','https://www.reddit.com/api/v1/access_token','random','toString','substring','JFAOD','url','OAuth\x20state\x20mismatch\x20-\x20possible\x20CSRF\x20attack','function','RLpLS','AJauX','dfYmV','removeAllListeners','aVPPs','IOhXR','qWvEj','YtyDU','oeGyi','state','qMwBV','jHvLe','No\x20authorization\x20code\x20received','Error\x20handling\x20OAuth\x20deep\x20link:','startsWith','split','searchParams','get','QMcxb','QpgVC','yilig','YASwA','hrpUt','error','Error\x20storing\x20platform\x20connection\x20(','HuaHX','RaBjE','LKxFm','LCuEd','OAuth\x20error:\x20','MoBOY','nopgJ','bJSGp','BQXlb','BMJIg','hccVH','authorization_code','szBNA','elOWa','TBhro','jCBXh','ALlan','Unsupported\x20platform:\x20','NXdSH','awRJj','redirectUri','clientId','vFIwd','json','access_token','refresh_token','expires_in','username','cYaOr','youtube','https://api.pinterest.com/v5/user_account','reddit','https://oauth.reddit.com/api/v1/me','Failed\x20to\x20fetch\x20user\x20info','xyBTE','Ufrud','OcKBB','Bearer\x20','bdmzG','uEXSW','sNNiD','BxFqe','BYCxb','RcXKd','NMeuB','FWlKZ','GTads','items','snippet','title','pinterest','full_name','Error\x20fetching\x20user\x20info\x20(','client_id','response_type','scope','yBKmb','BsiNQ','Error\x20disconnecting\x20platform\x20(','authorizationEndpoint','qcAWg','append','responseType','sErGt','krlEi','openURL','xVYVG','GSITx','redirect_uri','aWFTv','IvZXS','post','wYSlR','KdbVU','Error\x20exchanging\x20code\x20for\x20token\x20(','eCBlT','hKmSs','Kkyef','fKJBT','neMiZ','miGYT','instagram','FbRtw','xJrAs','jCYyA','QrIeR','userId','token','refreshToken','expiresIn','now','PwjYf','OwTMA','RQJFr','dPSdx','FfUCm','XlHOo','BASE_URL'];_0x3578=function(){return _0x3c3782;};return _0x3578();}export const connectPlatform=_0x8cb16d=>{const _0xa83f55={'WJwCJ':function(_0x5903aa,_0x56dae5){return _0x5903aa!==_0x56dae5;},'BsiNQ':'UgTYV','qcAWg':_0x4b8d(0x68),'lMJuq':'redirect_uri','IHFCs':_0x4b8d(0x69),'sErGt':_0x4b8d(0x6a),'krlEi':_0x4b8d(0x23),'xVYVG':function(_0x5710e5,_0x17fb8a){return _0x5710e5===_0x17fb8a;},'GSITx':_0x4b8d(0x6b)};return new Promise((_0x3b055b,_0x2fbe05)=>{if(_0xa83f55['WJwCJ'](_0xa83f55[_0x4b8d(0x6c)],_0xa83f55['BsiNQ']))return _0x7229b5[_0x4b8d(0x31)](_0x4b8d(0x6d)+_0x20d459+'):',_0x39a191),![];else try{const _0x296c80=OAUTH_CONFIGS[_0x8cb16d];if(!_0x296c80)throw new Error(_0x4b8d(0x44)+_0x8cb16d);const _0x421103=generateState(),_0x5d37f5=new URL(_0x296c80[_0x4b8d(0x6e)]);_0x5d37f5[_0x4b8d(0x2a)]['append'](_0xa83f55[_0x4b8d(0x6f)],_0x296c80['clientId']),_0x5d37f5[_0x4b8d(0x2a)][_0x4b8d(0x70)](_0xa83f55['lMJuq'],_0x296c80[_0x4b8d(0x47)]),_0x5d37f5[_0x4b8d(0x2a)]['append'](_0xa83f55['IHFCs'],_0x296c80[_0x4b8d(0x71)]),_0x5d37f5[_0x4b8d(0x2a)]['append'](_0xa83f55[_0x4b8d(0x72)],_0x296c80[_0x4b8d(0x6a)]),_0x5d37f5[_0x4b8d(0x2a)][_0x4b8d(0x70)](_0xa83f55[_0x4b8d(0x73)],_0x421103),currentOAuthState=_0x421103,currentOAuthPlatform=_0x8cb16d,currentOAuthResolve=_0x3b055b,currentOAuthReject=_0x2fbe05,Linking[_0x4b8d(0x74)](_0x5d37f5[_0x4b8d(0x14)]());}catch(_0x4444cc){_0xa83f55[_0x4b8d(0x75)](_0x4b8d(0x6b),_0xa83f55[_0x4b8d(0x76)])?_0x2fbe05(_0x4444cc):(_0x2b993a[_0x4b8d(0x31)](_0x4b8d(0x27),_0x48bce5),_0x277ecf&&_0x32eb7f(_0x47412c));}});};export const disconnectPlatform=async(_0x2b4c5e,_0x223380)=>{const _0x5ef1a6={'fKJBT':function(_0x2dba25){return _0x2dba25();},'neMiZ':_0x4b8d(0x68),'MkFev':_0x4b8d(0x77),'miGYT':'response_type','ATYHX':_0x4b8d(0x6a),'QlFDB':_0x4b8d(0x23),'zJdrM':'/users/disconnect-platform','wYSlR':function(_0x26e161,_0x15422c){return _0x26e161 in _0x15422c;},'RRkHJ':function(_0x353cca,_0x56f368){return _0x353cca===_0x56f368;},'KdbVU':_0x4b8d(0x78),'eCBlT':function(_0x1f8b30,_0x9c6031){return _0x1f8b30(_0x9c6031);},'hKmSs':function(_0x564c11,_0x5a2651){return _0x564c11!==_0x5a2651;},'Kkyef':_0x4b8d(0x79)};try{await onairosApi[_0x4b8d(0x7a)](_0x5ef1a6['zJdrM'],{'platform':_0x2b4c5e,'username':_0x223380[_0x4b8d(0x4e)]});const _0x3b82ad={..._0x223380['platforms']};if(_0x3b82ad&&_0x5ef1a6[_0x4b8d(0x7b)](_0x2b4c5e,_0x3b82ad)){if(_0x5ef1a6['RRkHJ'](_0x5ef1a6[_0x4b8d(0x7c)],_0x5ef1a6[_0x4b8d(0x7c)]))delete _0x3b82ad[_0x2b4c5e];else{_0x4db315[_0x4b8d(0x31)](_0x4b8d(0x7d)+_0x32dfaa+'):',_0x226344);throw _0x225520;}}return await _0x5ef1a6[_0x4b8d(0x7e)](updateCredentials,{..._0x223380,'platforms':_0x3b82ad}),!![];}catch(_0x52f7d3){if(_0x5ef1a6[_0x4b8d(0x7f)](_0x4b8d(0x79),_0x5ef1a6[_0x4b8d(0x80)])){const _0x417fb4=_0x1d05be[_0x133d4e];if(!_0x417fb4)throw new _0x482575('Unsupported\x20platform:\x20'+_0x23f7b6);const _0x17570c=_0x5ef1a6[_0x4b8d(0x81)](_0x8c9268),_0x229093=new _0x308924(_0x417fb4[_0x4b8d(0x6e)]);_0x229093[_0x4b8d(0x2a)][_0x4b8d(0x70)](_0x5ef1a6[_0x4b8d(0x82)],_0x417fb4[_0x4b8d(0x48)]),_0x229093[_0x4b8d(0x2a)][_0x4b8d(0x70)](_0x5ef1a6['MkFev'],_0x417fb4[_0x4b8d(0x47)]),_0x229093[_0x4b8d(0x2a)][_0x4b8d(0x70)](_0x5ef1a6[_0x4b8d(0x83)],_0x417fb4[_0x4b8d(0x71)]),_0x229093[_0x4b8d(0x2a)][_0x4b8d(0x70)](_0x5ef1a6['ATYHX'],_0x417fb4[_0x4b8d(0x6a)]),_0x229093[_0x4b8d(0x2a)][_0x4b8d(0x70)](_0x5ef1a6['QlFDB'],_0x17570c),_0x3f006d=_0x17570c,_0x4ef9b0=_0x874d1f,_0x51522c=_0x4ffe73,_0x2ae820=_0x1954fe,Linking['openURL'](_0x229093[_0x4b8d(0x14)]());}else return console[_0x4b8d(0x31)](_0x4b8d(0x6d)+_0x2b4c5e+'):',_0x52f7d3),![];}};export const storePlatformConnection=async(_0x209c4e,_0x2d220a,_0x4dd79a)=>{const _0x325f9a={'FbRtw':function(_0x276f78,_0x90b63){return _0x276f78===_0x90b63;},'xJrAs':_0x4b8d(0x84),'jCYyA':function(_0x205d41,_0x34df39){return _0x205d41===_0x34df39;},'QrIeR':_0x4b8d(0x65),'OtJtc':function(_0x104d75,_0x37a764){return _0x104d75===_0x37a764;},'Rkzug':function(_0x2715f8,_0x5e2b73){return _0x2715f8+_0x5e2b73;},'PwjYf':function(_0x442349,_0x124a69){return _0x442349===_0x124a69;},'OwTMA':function(_0xdb2e15,_0x29640e){return _0xdb2e15===_0x29640e;},'RQJFr':function(_0x278339,_0x110c1d){return _0x278339===_0x110c1d;},'dPSdx':function(_0x2d2767,_0x297ff7){return _0x2d2767===_0x297ff7;},'FfUCm':_0x4b8d(0x52),'XlHOo':function(_0x59606a,_0x939ea0){return _0x59606a(_0x939ea0);}};try{const _0x46324d=_0x325f9a[_0x4b8d(0x85)](_0x209c4e,_0x325f9a[_0x4b8d(0x86)])||_0x325f9a[_0x4b8d(0x87)](_0x209c4e,_0x4b8d(0x50))||_0x325f9a[_0x4b8d(0x87)](_0x209c4e,_0x325f9a[_0x4b8d(0x88)])||_0x325f9a['OtJtc'](_0x209c4e,_0x4b8d(0x52));if(!_0x46324d)throw new Error('Unsupported\x20platform:\x20'+_0x209c4e);const _0x9a3106={..._0x4dd79a['platforms']},_0x44aa5a={'username':_0x2d220a[_0x4b8d(0x4e)],'userId':_0x2d220a[_0x4b8d(0x89)],'token':_0x2d220a[_0x4b8d(0x8a)],'refreshToken':_0x2d220a[_0x4b8d(0x8b)],'expiresAt':_0x2d220a[_0x4b8d(0x8c)]?_0x325f9a['Rkzug'](Date[_0x4b8d(0x8d)](),_0x2d220a[_0x4b8d(0x8c)]*0x3e8):null,'connectedAt':Date['now']()};if(_0x325f9a[_0x4b8d(0x8e)](_0x209c4e,_0x325f9a['xJrAs']))_0x9a3106[_0x4b8d(0x84)]=_0x44aa5a;else{if(_0x325f9a[_0x4b8d(0x8f)](_0x209c4e,'youtube'))_0x9a3106[_0x4b8d(0x50)]=_0x44aa5a;else{if(_0x325f9a[_0x4b8d(0x90)](_0x209c4e,_0x325f9a[_0x4b8d(0x88)]))_0x9a3106[_0x4b8d(0x65)]=_0x44aa5a;else{if(_0x325f9a[_0x4b8d(0x91)](_0x209c4e,_0x325f9a[_0x4b8d(0x92)]))_0x9a3106[_0x4b8d(0x52)]=_0x44aa5a;}}}return await _0x325f9a[_0x4b8d(0x93)](updateCredentials,{..._0x4dd79a,'platforms':_0x9a3106}),!![];}catch(_0x1f5737){return console[_0x4b8d(0x31)](_0x4b8d(0x32)+_0x209c4e+'):',_0x1f5737),![];}};export const OAuthService={'initializeOAuthService':initializeOAuthService,'cleanupOAuthService':cleanupOAuthService,'connectPlatform':connectPlatform,'disconnectPlatform':disconnectPlatform,'storePlatformConnection':storePlatformConnection,'_apiBaseUrl':''+API_CONFIG[_0x4b8d(0x94)]};
@@ -0,0 +1,7 @@
1
+
2
+ // Onairos SDK - Asset Registry (auto-generated)
3
+ var __ONAIROS_REQ_REGISTRY__ = [
4
+ require('react-native-crypto-js')
5
+ ];
6
+ function __ONAIROS_REQ_FUNC__(i) { return __ONAIROS_REQ_REGISTRY__[i]; }
7
+ const CryptoJS=__ONAIROS_REQ_FUNC__(0x0);import{getTemporaryPin}from'./pinStorageUtils';function _0x12f0(_0x2b1eec,_0x12f043){_0x2b1eec=_0x2b1eec-0x0;const _0x2f76ce=_0x2b1e();let _0x207b46=_0x2f76ce[_0x2b1eec];return _0x207b46;}const ENCRYPTION_KEY=_0x12f0(0x0);export const encryptPin=_0x5107fd=>{const _0x544023={'fInrg':_0x12f0(0x1),'PxvTS':_0x12f0(0x2),'vRbRR':_0x12f0(0x3)};try{if(_0x544023[_0x12f0(0x4)]!==_0x544023[_0x12f0(0x5)]){const _0x2f7942=CryptoJS[_0x12f0(0x6)]['encrypt'](_0x5107fd,ENCRYPTION_KEY)[_0x12f0(0x7)]();return console[_0x12f0(0x8)](_0x12f0(0x9)),_0x2f7942;}else{const _0x5454ab=_0x1312d6[_0x12f0(0x6)][_0x12f0(0xa)](_0x106231,_0x5296a8),_0x4e3d53=_0x5454ab[_0x12f0(0x7)](_0x3f7165[_0x12f0(0xb)][_0x12f0(0xc)]);return _0x30baa0[_0x12f0(0x8)](_0x12f0(0xd)),_0x4e3d53;}}catch(_0x28f21){console['error'](_0x544023[_0x12f0(0xe)],_0x28f21);throw _0x28f21;}};export const decryptPin=_0x36b56e=>{const _0x1f6e7f={'VZkLv':'🔐\x20PIN\x20encrypted\x20successfully','YwFSI':function(_0x16432e,_0x52dba5){return _0x16432e!==_0x52dba5;},'CANWD':'sBZoW','cxvep':_0x12f0(0xd),'XkBcW':function(_0x4c0d06,_0x58e0a7){return _0x4c0d06!==_0x58e0a7;},'bqmNF':_0x12f0(0xf)};try{if(_0x1f6e7f[_0x12f0(0x10)](_0x1f6e7f['CANWD'],_0x12f0(0x11))){const _0x228743=CryptoJS[_0x12f0(0x6)]['decrypt'](_0x36b56e,ENCRYPTION_KEY),_0x5ae7f5=_0x228743['toString'](CryptoJS[_0x12f0(0xb)]['Utf8']);return console[_0x12f0(0x8)](_0x1f6e7f[_0x12f0(0x12)]),_0x5ae7f5;}else{const _0x1c1323=_0x711f21[_0x12f0(0x13)](_0x3ed8bd+_0x1e98f6)[_0x12f0(0x7)]();return _0x2b5615[_0x12f0(0x8)](_0x12f0(0x14)),_0x1c1323;}}catch(_0x36e4e2){if(_0x1f6e7f[_0x12f0(0x15)](_0x1f6e7f[_0x12f0(0x16)],_0x1f6e7f[_0x12f0(0x16)])){const _0x5942a1=_0x16359c[_0x12f0(0x6)][_0x12f0(0x17)](_0x50d5d2,_0x1ac0ba)[_0x12f0(0x7)]();return _0x115a4f[_0x12f0(0x8)](_0x1f6e7f[_0x12f0(0x18)]),_0x5942a1;}else{console['error'](_0x12f0(0x19),_0x36e4e2);throw _0x36e4e2;}}};function _0x2b1e(){const _0x1890e6=['onairos-pin-encryption-key-2024','ofBcS','MaBay','❌\x20Error\x20encrypting\x20PIN:','fInrg','PxvTS','AES','toString','log','🔐\x20PIN\x20encrypted\x20successfully','decrypt','enc','Utf8','🔓\x20PIN\x20decrypted\x20successfully','vRbRR','YKwFh','YwFSI','EKjAA','cxvep','SHA256','🔒\x20PIN\x20hashed\x20successfully','XkBcW','bqmNF','encrypt','VZkLv','❌\x20Error\x20decrypting\x20PIN:','Kiunb','xIbba','OgCMC','❌\x20Error\x20getting\x20encrypted\x20PIN\x20for\x20API:','MpkfV','RAmBw','haEIL','tdMja','LlrAy','rQars','✅\x20PIN\x20encrypted\x20for\x20API\x20transmission','UEvbl','error','❌\x20Error\x20hashing\x20PIN:','XMbOL'];_0x2b1e=function(){return _0x1890e6;};return _0x2b1e();}export const getEncryptedPinForAPI=async()=>{const _0x20d8a4={'LlrAy':'⚠️\x20No\x20temporary\x20PIN\x20available\x20for\x20encryption','MpkfV':function(_0x48b73f){return _0x48b73f();},'RAmBw':function(_0x527c21,_0x261ec0){return _0x527c21===_0x261ec0;},'haEIL':_0x12f0(0x1a),'rQars':function(_0x302e6f,_0x640d39){return _0x302e6f(_0x640d39);},'MHhId':_0x12f0(0x1b),'UEvbl':_0x12f0(0x1c),'jXVxH':_0x12f0(0x1d)};try{const _0x540e9b=_0x20d8a4[_0x12f0(0x1e)](getTemporaryPin);if(!_0x540e9b)return _0x20d8a4[_0x12f0(0x1f)](_0x20d8a4[_0x12f0(0x20)],_0x12f0(0x21))?(_0x7a53fe['log'](_0x20d8a4[_0x12f0(0x22)]),null):(console[_0x12f0(0x8)](_0x20d8a4[_0x12f0(0x22)]),null);const _0x4c7ada=_0x20d8a4[_0x12f0(0x23)](encryptPin,_0x540e9b);return console[_0x12f0(0x8)](_0x12f0(0x24)),_0x4c7ada;}catch(_0x3bd2f8){if(_0x20d8a4['RAmBw'](_0x20d8a4['MHhId'],_0x20d8a4[_0x12f0(0x25)])){_0x32850f['error'](_0x12f0(0x3),_0x1cd660);throw _0x2bc696;}else return console[_0x12f0(0x26)](_0x20d8a4['jXVxH'],_0x3bd2f8),null;}};export const hashPin=_0x246f4a=>{const _0x5e91f1={'XMbOL':_0x12f0(0x27)};try{const _0x270dde=CryptoJS[_0x12f0(0x13)](_0x246f4a+ENCRYPTION_KEY)['toString']();return console[_0x12f0(0x8)]('🔒\x20PIN\x20hashed\x20successfully'),_0x270dde;}catch(_0x581570){console[_0x12f0(0x26)](_0x5e91f1[_0x12f0(0x28)],_0x581570);throw _0x581570;}};
@@ -0,0 +1 @@
1
+ import{biometricPinService}from'./biometricPinService';export const getStoredPinForTraining=async()=>{const _0x3ade71={'PyUqX':'⚠️\x20No\x20PIN\x20stored\x20in\x20secure\x20storage','eTQMX':_0x21b8(0x0),'XHsQd':_0x21b8(0x1),'wfCUy':_0x21b8(0x2),'kLjSV':_0x21b8(0x3),'YUiPZ':_0x21b8(0x4),'ICUtS':function(_0x55bf04,_0x5c07e0){return _0x55bf04!==_0x5c07e0;},'iegMs':'opFMh'};try{if(_0x3ade71[_0x21b8(0x5)]!==_0x3ade71[_0x21b8(0x5)])return _0x277195[_0x21b8(0x6)](_0x3ade71['PyUqX']),null;else{console[_0x21b8(0x6)](_0x3ade71[_0x21b8(0x7)]);const _0x33699c=await biometricPinService['isPinStored']();if(!_0x33699c)return console[_0x21b8(0x6)](_0x3ade71['PyUqX']),null;const _0x4f8dc3=await biometricPinService[_0x21b8(0x8)]();return _0x4f8dc3?(console[_0x21b8(0x6)](_0x3ade71[_0x21b8(0x9)]),_0x4f8dc3):(console[_0x21b8(0x6)](_0x3ade71[_0x21b8(0xa)]),null);}}catch(_0x52b6ce){return _0x3ade71['ICUtS'](_0x3ade71[_0x21b8(0xb)],_0x3ade71[_0x21b8(0xb)])?(_0x382298[_0x21b8(0xc)](_0x3ade71[_0x21b8(0xd)],_0x123b54),null):(console[_0x21b8(0xc)](_0x3ade71[_0x21b8(0xd)],_0x52b6ce),null);}};export const hasStoredPin=async()=>{const _0x4170c9={'QWzHT':function(_0x34caed,_0x22cd94){return _0x34caed===_0x22cd94;},'EEiZI':_0x21b8(0xe),'fbvPY':_0x21b8(0xf),'dZLEO':'❌\x20Error\x20checking\x20PIN\x20storage:'};try{return _0x4170c9[_0x21b8(0x10)](_0x4170c9[_0x21b8(0x11)],_0x4170c9[_0x21b8(0x12)])?_0x4b190d:await biometricPinService[_0x21b8(0x13)]();}catch(_0x227d18){return console['error'](_0x4170c9[_0x21b8(0x14)],_0x227d18),![];}};export const clearStoredPin=async()=>{const _0x560df9={'JYQGi':_0x21b8(0x15),'qzQth':_0x21b8(0x16)};try{return console['log'](_0x560df9['JYQGi']),await biometricPinService[_0x21b8(0x17)]();}catch(_0x409355){return console[_0x21b8(0xc)](_0x560df9['qzQth'],_0x409355),![];}};function _0x21b8(_0xbfba57,_0x21b8ef){_0xbfba57=_0xbfba57-0x0;const _0x464ee6=_0xbfba();let _0x21e235=_0x464ee6[_0xbfba57];return _0x21e235;}export const getPinForTraining=async _0x436a10=>{const _0x22ecf4={'OGdjR':'🗑️\x20Temporary\x20PIN\x20cleared','tnGri':function(_0x232b4b,_0x41badc){return _0x232b4b!==_0x41badc;},'FElFX':_0x21b8(0x18),'UXGvt':_0x21b8(0x19),'zGTCS':function(_0x2c1184){return _0x2c1184();}};if(_0x436a10){if(_0x22ecf4[_0x21b8(0x1a)](_0x22ecf4[_0x21b8(0x1b)],_0x22ecf4[_0x21b8(0x1b)]))_0x3bddbd=null,_0x9ac229['log'](_0x22ecf4[_0x21b8(0x1c)]);else return console[_0x21b8(0x6)](_0x22ecf4['UXGvt']),_0x436a10;}return await _0x22ecf4[_0x21b8(0x1d)](getStoredPinForTraining);};let temporaryPin=null;export const setTemporaryPin=_0x2921e1=>{const _0x13e13b={'EVdfM':'📝\x20Temporary\x20PIN\x20set\x20for\x20training'};temporaryPin=_0x2921e1,console[_0x21b8(0x6)](_0x13e13b[_0x21b8(0x1e)]);};export const getTemporaryPin=()=>{return temporaryPin;};function _0xbfba(){const _0x216c83=['❌\x20Error\x20retrieving\x20stored\x20PIN:','hyaZq','🔓\x20Retrieving\x20stored\x20PIN\x20for\x20training...','✅\x20PIN\x20retrieved\x20successfully\x20for\x20training','❌\x20Failed\x20to\x20retrieve\x20PIN\x20or\x20user\x20cancelled\x20authentication','XHsQd','log','wfCUy','retrievePinWithBiometric','kLjSV','YUiPZ','iegMs','error','eTQMX','LNpxJ','wOPXB','QWzHT','EEiZI','fbvPY','isPinStored','dZLEO','🗑️\x20Clearing\x20stored\x20PIN...','❌\x20Error\x20clearing\x20stored\x20PIN:','removePinFromStorage','WdadN','📝\x20Using\x20temporary\x20PIN\x20for\x20training','tnGri','FElFX','OGdjR','zGTCS','EVdfM','🗑️\x20Temporary\x20PIN\x20cleared','LouDm'];_0xbfba=function(){return _0x216c83;};return _0xbfba();}export const clearTemporaryPin=()=>{const _0xdd169d={'LouDm':_0x21b8(0x1f)};temporaryPin=null,console[_0x21b8(0x6)](_0xdd169d[_0x21b8(0x20)]);};