@onairos/react-native 3.4.1 → 3.6.0

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 (574) hide show
  1. package/README.md +423 -374
  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/OnairosNewLogo.png +0 -0
  26. package/lib/commonjs/assets/images/Onairoslogo.png +0 -0
  27. package/lib/commonjs/assets/images/Personalityprofile.svg +3 -0
  28. package/lib/commonjs/assets/images/Personalitytraits.svg +3 -0
  29. package/lib/commonjs/assets/images/Redditicon.png +0 -0
  30. package/lib/commonjs/assets/images/Userpreferences.svg +3 -0
  31. package/lib/commonjs/assets/images/YouTubeicon3.png +0 -0
  32. package/lib/commonjs/assets/images/arrow.svg +20 -0
  33. package/lib/commonjs/assets/images/basicproficon.svg +43 -0
  34. package/lib/commonjs/assets/images/basicprofile.svg +3 -0
  35. package/lib/commonjs/assets/images/chatgpt.png +0 -0
  36. package/lib/commonjs/assets/images/checkmark.svg +4 -0
  37. package/lib/commonjs/assets/images/claude.png +0 -0
  38. package/lib/commonjs/assets/images/contentanalysis.svg +3 -0
  39. package/lib/commonjs/assets/images/contenticon.svg +23 -0
  40. package/lib/commonjs/assets/images/gemini.png +0 -0
  41. package/lib/commonjs/assets/images/grok.png +0 -0
  42. package/lib/commonjs/assets/images/persona1.png +0 -0
  43. package/lib/commonjs/assets/images/persona2.png +0 -0
  44. package/lib/commonjs/assets/images/persona3.png +0 -0
  45. package/lib/commonjs/assets/images/persona4.png +0 -0
  46. package/lib/commonjs/assets/images/persona5.png +0 -0
  47. package/lib/commonjs/assets/images/personalityicon.svg +18 -0
  48. package/lib/commonjs/assets/images/x-close.svg +3 -0
  49. package/lib/commonjs/components/BodyText.js +9 -0
  50. package/lib/commonjs/components/BrandMark.js +10 -0
  51. package/lib/commonjs/components/CodeInput.js +9 -0
  52. package/lib/commonjs/components/EmailInput.js +8 -0
  53. package/lib/commonjs/components/GoogleButton.js +9 -0
  54. package/lib/commonjs/components/HeadingGroup.js +9 -0
  55. package/lib/commonjs/components/LLMDataInputModal.js +14 -0
  56. package/lib/commonjs/components/ModalHeader.js +9 -0
  57. package/lib/commonjs/components/ModalSheet.js +9 -0
  58. package/lib/commonjs/components/Onairos.js +14 -374
  59. package/lib/commonjs/components/OnairosButton.js +13 -309
  60. package/lib/commonjs/components/OnairosSignInButton.js +12 -0
  61. package/lib/commonjs/components/Overlay.js +13 -483
  62. package/lib/commonjs/components/PersonaImage.js +10 -0
  63. package/lib/commonjs/components/PersonaLoadingScreen.js +12 -0
  64. package/lib/commonjs/components/PersonalizationConsentScreen.js +13 -0
  65. package/lib/commonjs/components/PinCreationScreen.js +12 -0
  66. package/lib/commonjs/components/PinInput.js +9 -302
  67. package/lib/commonjs/components/PlatformConnectorsStep.js +23 -0
  68. package/lib/commonjs/components/PlatformList.js +10 -137
  69. package/lib/commonjs/components/PlatformToggle.js +9 -0
  70. package/lib/commonjs/components/PrimaryButton.js +10 -0
  71. package/lib/commonjs/components/SignInMatchAnimation.js +9 -0
  72. package/lib/commonjs/components/SignInStep.js +12 -0
  73. package/lib/commonjs/components/UniversalOnboarding.js +30 -1702
  74. package/lib/commonjs/components/VerificationStep.js +11 -0
  75. package/lib/commonjs/components/WelcomeScreen.js +22 -0
  76. package/lib/commonjs/components/icons/Basicproficon.js +8 -0
  77. package/lib/commonjs/components/icons/Basicprofile.js +8 -0
  78. package/lib/commonjs/components/icons/Checkbox.js +8 -0
  79. package/lib/commonjs/components/icons/Checkmark.js +8 -0
  80. package/lib/commonjs/components/icons/Contentanalysis.js +8 -0
  81. package/lib/commonjs/components/icons/Contenticon.js +8 -0
  82. package/lib/commonjs/components/icons/EnochE.js +8 -0
  83. package/lib/commonjs/components/icons/Personalityicon.js +8 -0
  84. package/lib/commonjs/components/icons/Personalityprofile.js +8 -0
  85. package/lib/commonjs/components/icons/Personalitytraits.js +8 -0
  86. package/lib/commonjs/components/icons/Userpreferences.js +8 -0
  87. package/lib/commonjs/components/icons/index.js +17 -0
  88. package/lib/commonjs/components/onboarding/OAuthWebView.js +18 -827
  89. package/lib/commonjs/components/onboarding/OnboardingHeader.js +10 -74
  90. package/lib/commonjs/components/onboarding/PinInput.js +10 -283
  91. package/lib/commonjs/components/onboarding/PlatformConnector.js +11 -249
  92. package/lib/commonjs/config/api.js +7 -0
  93. package/lib/commonjs/constants/index.js +7 -83
  94. package/lib/commonjs/context/AuthContext.js +10 -0
  95. package/lib/commonjs/hooks/useConnectedAccounts.js +9 -0
  96. package/lib/commonjs/hooks/useConnections.js +8 -159
  97. package/lib/commonjs/hooks/useCredentials.js +10 -177
  98. package/lib/commonjs/hooks/useUserConnections.js +10 -0
  99. package/lib/commonjs/index.js +34 -106
  100. package/lib/commonjs/services/SDK_API_KEY_VALIDATION.md +421 -421
  101. package/lib/commonjs/services/apiClient.js +8 -0
  102. package/lib/commonjs/services/apiKeyService.js +9 -952
  103. package/lib/commonjs/services/authService.js +10 -0
  104. package/lib/commonjs/services/biometricPinService.js +8 -0
  105. package/lib/commonjs/services/chatGPTConversationExtractor.js +8 -0
  106. package/lib/commonjs/services/chatGPTConversationService.js +9 -0
  107. package/lib/commonjs/services/claudeConversationExtractor.js +8 -0
  108. package/lib/commonjs/services/claudeConversationService.js +9 -0
  109. package/lib/commonjs/services/connectedAccountsService.js +10 -0
  110. package/lib/commonjs/services/googleAuthService.js +11 -0
  111. package/lib/commonjs/services/hingeDataExtractor.js +8 -0
  112. package/lib/commonjs/services/hingeDataService.js +9 -0
  113. package/lib/commonjs/services/imageCompressionService.js +7 -0
  114. package/lib/commonjs/services/instagramDataExtractor.js +8 -0
  115. package/lib/commonjs/services/instagramDataService.js +9 -0
  116. package/lib/commonjs/services/jwtStorageService.js +7 -0
  117. package/lib/commonjs/services/linkedinDOMExtractor.js +7 -0
  118. package/lib/commonjs/services/linkedinProfileService.js +9 -0
  119. package/lib/commonjs/services/linkedinScrapingService.js +8 -0
  120. package/lib/commonjs/services/llmDataStorage.js +8 -0
  121. package/lib/commonjs/services/mobileTrainingService.js +8 -0
  122. package/lib/commonjs/services/oauthService.js +11 -390
  123. package/lib/commonjs/services/pinEncryptionService.js +8 -0
  124. package/lib/commonjs/services/pinStorageUtils.js +7 -0
  125. package/lib/commonjs/services/platformAuthService.js +12 -1067
  126. package/lib/commonjs/services/sephoraDataExtractor.js +8 -0
  127. package/lib/commonjs/services/sephoraDataService.js +9 -0
  128. package/lib/commonjs/services/storageService.js +8 -0
  129. package/lib/commonjs/services/telegramDataExtractor.js +8 -0
  130. package/lib/commonjs/services/telegramDataService.js +11 -0
  131. package/lib/commonjs/services/trainingApiHelpers.js +7 -0
  132. package/lib/commonjs/services/userConnectionsService.js +10 -0
  133. package/lib/commonjs/services/youtubeMigrationService.js +10 -0
  134. package/lib/commonjs/theme/index.js +7 -0
  135. package/lib/commonjs/types/ambient.d.js +1 -2
  136. package/lib/commonjs/types/declarations.d.js +1 -2
  137. package/lib/commonjs/types/index.js +1 -6
  138. package/lib/commonjs/types/node-fix.d.js +1 -2
  139. package/lib/commonjs/types/node-override.d.js +1 -2
  140. package/lib/commonjs/types/opacity.d.js +1 -2
  141. package/lib/commonjs/types.js +1 -14
  142. package/lib/commonjs/utils/Portal.js +8 -98
  143. package/lib/commonjs/utils/api.js +9 -129
  144. package/lib/commonjs/utils/assetRegistry.js +33 -0
  145. package/lib/commonjs/utils/auth.js +9 -111
  146. package/lib/commonjs/utils/connectorTests.js +29 -0
  147. package/lib/commonjs/utils/crypto.js +8 -62
  148. package/lib/commonjs/utils/debugHelper.js +1 -64
  149. package/lib/commonjs/utils/encryption.js +7 -76
  150. package/lib/commonjs/utils/eventUtils.js +1 -0
  151. package/lib/commonjs/utils/haptics.js +9 -0
  152. package/lib/commonjs/utils/imagePreloader.js +1 -0
  153. package/lib/commonjs/utils/networkDiagnostics.js +8 -0
  154. package/lib/commonjs/utils/onairosApi.js +9 -350
  155. package/lib/commonjs/utils/programmaticFlow.js +9 -117
  156. package/lib/commonjs/utils/retryHelper.js +1 -220
  157. package/lib/commonjs/utils/secureStorage.js +10 -349
  158. package/lib/commonjs/utils/webviewScripts/chatgpt.js +1 -0
  159. package/lib/commonjs/utils/webviewScripts/claude.js +1 -0
  160. package/lib/commonjs/utils/webviewScripts/hinge.js +1 -0
  161. package/lib/commonjs/utils/webviewScripts/index.js +13 -0
  162. package/lib/commonjs/utils/webviewScripts/instagram.js +1 -0
  163. package/lib/commonjs/utils/webviewScripts/linkedin.js +1 -0
  164. package/lib/commonjs/utils/webviewScripts/sephora.js +1 -0
  165. package/lib/commonjs/utils/webviewScripts/telegram.js +1 -0
  166. package/lib/module/api/index.js +1 -139
  167. package/lib/module/assets/animations/loaderani.json +1 -0
  168. package/lib/module/assets/animations/persona-animation.json +1 -0
  169. package/lib/module/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
  170. package/lib/module/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
  171. package/lib/module/assets/icons/Facebookicon.png +0 -0
  172. package/lib/module/assets/icons/Gmail.png +0 -0
  173. package/lib/module/assets/icons/Linkedinicon.png +0 -0
  174. package/lib/module/assets/icons/Redditicon.png +0 -0
  175. package/lib/module/assets/icons/YouTubeicon2.png +0 -0
  176. package/lib/module/assets/icons/YouTubeicon3.png +0 -0
  177. package/lib/module/assets/icons/chatgpt.png +0 -0
  178. package/lib/module/assets/icons/claude.png +0 -0
  179. package/lib/module/assets/icons/farcaster.png +0 -0
  180. package/lib/module/assets/icons/gemini.png +0 -0
  181. package/lib/module/assets/icons/grok.png +0 -0
  182. package/lib/module/assets/icons/instagram.png +0 -0
  183. package/lib/module/assets/icons/pinterest.png +0 -0
  184. package/lib/module/assets/icons/swerv_logo.png +0 -0
  185. package/lib/module/assets/icons/twitter.jpg +0 -0
  186. package/lib/module/assets/images/Checkbox.svg +3 -0
  187. package/lib/module/assets/images/EnochE.svg +19 -0
  188. package/lib/module/assets/images/Enochicon1.png +0 -0
  189. package/lib/module/assets/images/Face_ID_logo.png +0 -0
  190. package/lib/module/assets/images/Facebookicon.png +0 -0
  191. package/lib/module/assets/images/Gmail.png +0 -0
  192. package/lib/module/assets/images/Googlelogo.png +0 -0
  193. package/lib/module/assets/images/Linkedinicon.png +0 -0
  194. package/lib/module/assets/images/OnairosNewLogo.png +0 -0
  195. package/lib/module/assets/images/Onairoslogo.png +0 -0
  196. package/lib/module/assets/images/Personalityprofile.svg +3 -0
  197. package/lib/module/assets/images/Personalitytraits.svg +3 -0
  198. package/lib/module/assets/images/Redditicon.png +0 -0
  199. package/lib/module/assets/images/Userpreferences.svg +3 -0
  200. package/lib/module/assets/images/YouTubeicon3.png +0 -0
  201. package/lib/module/assets/images/arrow.svg +20 -0
  202. package/lib/module/assets/images/basicproficon.svg +43 -0
  203. package/lib/module/assets/images/basicprofile.svg +3 -0
  204. package/lib/module/assets/images/chatgpt.png +0 -0
  205. package/lib/module/assets/images/checkmark.svg +4 -0
  206. package/lib/module/assets/images/claude.png +0 -0
  207. package/lib/module/assets/images/contentanalysis.svg +3 -0
  208. package/lib/module/assets/images/contenticon.svg +23 -0
  209. package/lib/module/assets/images/gemini.png +0 -0
  210. package/lib/module/assets/images/grok.png +0 -0
  211. package/lib/module/assets/images/persona1.png +0 -0
  212. package/lib/module/assets/images/persona2.png +0 -0
  213. package/lib/module/assets/images/persona3.png +0 -0
  214. package/lib/module/assets/images/persona4.png +0 -0
  215. package/lib/module/assets/images/persona5.png +0 -0
  216. package/lib/module/assets/images/personalityicon.svg +18 -0
  217. package/lib/module/assets/images/x-close.svg +3 -0
  218. package/lib/module/components/BodyText.js +1 -0
  219. package/lib/module/components/BrandMark.js +1 -0
  220. package/lib/module/components/CodeInput.js +1 -0
  221. package/lib/module/components/EmailInput.js +1 -0
  222. package/lib/module/components/GoogleButton.js +1 -0
  223. package/lib/module/components/HeadingGroup.js +1 -0
  224. package/lib/module/components/LLMDataInputModal.js +8 -0
  225. package/lib/module/components/ModalHeader.js +1 -0
  226. package/lib/module/components/ModalSheet.js +1 -0
  227. package/lib/module/components/Onairos.js +1 -367
  228. package/lib/module/components/OnairosButton.js +1 -302
  229. package/lib/module/components/OnairosSignInButton.js +1 -0
  230. package/lib/module/components/Overlay.js +1 -474
  231. package/lib/module/components/PersonaImage.js +1 -0
  232. package/lib/module/components/PersonaLoadingScreen.js +1 -0
  233. package/lib/module/components/PersonalizationConsentScreen.js +1 -0
  234. package/lib/module/components/PinCreationScreen.js +1 -0
  235. package/lib/module/components/PinInput.js +1 -293
  236. package/lib/module/components/PlatformConnectorsStep.js +7 -0
  237. package/lib/module/components/PlatformList.js +1 -129
  238. package/lib/module/components/PlatformToggle.js +1 -0
  239. package/lib/module/components/PrimaryButton.js +1 -0
  240. package/lib/module/components/SignInMatchAnimation.js +1 -0
  241. package/lib/module/components/SignInStep.js +1 -0
  242. package/lib/module/components/UniversalOnboarding.js +1 -1693
  243. package/lib/module/components/VerificationStep.js +1 -0
  244. package/lib/module/components/WelcomeScreen.js +1 -0
  245. package/lib/module/components/icons/Basicproficon.js +1 -0
  246. package/lib/module/components/icons/Basicprofile.js +1 -0
  247. package/lib/module/components/icons/Checkbox.js +1 -0
  248. package/lib/module/components/icons/Checkmark.js +1 -0
  249. package/lib/module/components/icons/Contentanalysis.js +1 -0
  250. package/lib/module/components/icons/Contenticon.js +1 -0
  251. package/lib/module/components/icons/EnochE.js +1 -0
  252. package/lib/module/components/icons/Personalityicon.js +1 -0
  253. package/lib/module/components/icons/Personalityprofile.js +1 -0
  254. package/lib/module/components/icons/Personalitytraits.js +1 -0
  255. package/lib/module/components/icons/Userpreferences.js +1 -0
  256. package/lib/module/components/icons/index.js +1 -0
  257. package/lib/module/components/onboarding/OAuthWebView.js +1 -818
  258. package/lib/module/components/onboarding/OnboardingHeader.js +1 -66
  259. package/lib/module/components/onboarding/PinInput.js +1 -274
  260. package/lib/module/components/onboarding/PlatformConnector.js +1 -240
  261. package/lib/module/config/api.js +1 -0
  262. package/lib/module/constants/index.js +1 -77
  263. package/lib/module/context/AuthContext.js +1 -0
  264. package/lib/module/hooks/useConnectedAccounts.js +1 -0
  265. package/lib/module/hooks/useConnections.js +1 -152
  266. package/lib/module/hooks/useCredentials.js +6 -169
  267. package/lib/module/hooks/useUserConnections.js +1 -0
  268. package/lib/module/index.js +1 -32
  269. package/lib/module/services/SDK_API_KEY_VALIDATION.md +421 -421
  270. package/lib/module/services/apiClient.js +1 -0
  271. package/lib/module/services/apiKeyService.js +1 -925
  272. package/lib/module/services/authService.js +1 -0
  273. package/lib/module/services/biometricPinService.js +1 -0
  274. package/lib/module/services/chatGPTConversationExtractor.js +1 -0
  275. package/lib/module/services/chatGPTConversationService.js +1 -0
  276. package/lib/module/services/claudeConversationExtractor.js +1 -0
  277. package/lib/module/services/claudeConversationService.js +1 -0
  278. package/lib/module/services/connectedAccountsService.js +1 -0
  279. package/lib/module/services/googleAuthService.js +1 -0
  280. package/lib/module/services/hingeDataExtractor.js +1 -0
  281. package/lib/module/services/hingeDataService.js +1 -0
  282. package/lib/module/services/imageCompressionService.js +1 -0
  283. package/lib/module/services/instagramDataExtractor.js +1 -0
  284. package/lib/module/services/instagramDataService.js +1 -0
  285. package/lib/module/services/jwtStorageService.js +1 -0
  286. package/lib/module/services/linkedinDOMExtractor.js +1 -0
  287. package/lib/module/services/linkedinProfileService.js +1 -0
  288. package/lib/module/services/linkedinScrapingService.js +1 -0
  289. package/lib/module/services/llmDataStorage.js +1 -0
  290. package/lib/module/services/mobileTrainingService.js +1 -0
  291. package/lib/module/services/oauthService.js +1 -380
  292. package/lib/module/services/pinEncryptionService.js +7 -0
  293. package/lib/module/services/pinStorageUtils.js +1 -0
  294. package/lib/module/services/platformAuthService.js +1 -1041
  295. package/lib/module/services/sephoraDataExtractor.js +1 -0
  296. package/lib/module/services/sephoraDataService.js +1 -0
  297. package/lib/module/services/storageService.js +1 -0
  298. package/lib/module/services/telegramDataExtractor.js +1 -0
  299. package/lib/module/services/telegramDataService.js +8 -0
  300. package/lib/module/services/trainingApiHelpers.js +1 -0
  301. package/lib/module/services/userConnectionsService.js +1 -0
  302. package/lib/module/services/youtubeMigrationService.js +1 -0
  303. package/lib/module/theme/index.js +1 -0
  304. package/lib/module/types.js +1 -10
  305. package/lib/module/utils/Portal.js +1 -90
  306. package/lib/module/utils/api.js +1 -117
  307. package/lib/module/utils/assetRegistry.js +33 -0
  308. package/lib/module/utils/auth.js +1 -99
  309. package/lib/module/utils/connectorTests.js +28 -0
  310. package/lib/module/utils/crypto.js +1 -54
  311. package/lib/module/utils/debugHelper.js +1 -54
  312. package/lib/module/utils/encryption.js +1 -67
  313. package/lib/module/utils/eventUtils.js +1 -0
  314. package/lib/module/utils/haptics.js +8 -0
  315. package/lib/module/utils/imagePreloader.js +1 -0
  316. package/lib/module/utils/networkDiagnostics.js +1 -0
  317. package/lib/module/utils/onairosApi.js +1 -333
  318. package/lib/module/utils/programmaticFlow.js +1 -111
  319. package/lib/module/utils/retryHelper.js +1 -211
  320. package/lib/module/utils/secureStorage.js +6 -330
  321. package/lib/module/utils/webviewScripts/chatgpt.js +1 -0
  322. package/lib/module/utils/webviewScripts/claude.js +1 -0
  323. package/lib/module/utils/webviewScripts/hinge.js +1 -0
  324. package/lib/module/utils/webviewScripts/index.js +1 -0
  325. package/lib/module/utils/webviewScripts/instagram.js +1 -0
  326. package/lib/module/utils/webviewScripts/linkedin.js +1 -0
  327. package/lib/module/utils/webviewScripts/sephora.js +1 -0
  328. package/lib/module/utils/webviewScripts/telegram.js +1 -0
  329. package/package.json +62 -39
  330. package/lib/commonjs/api/index.js.map +0 -1
  331. package/lib/commonjs/assets/images/email.png +0 -0
  332. package/lib/commonjs/assets/images/linkedin.png +0 -0
  333. package/lib/commonjs/assets/images/reddit.png +0 -0
  334. package/lib/commonjs/assets/images/youtube.png +0 -0
  335. package/lib/commonjs/components/DataRequestModal.js +0 -228
  336. package/lib/commonjs/components/DataRequestModal.js.map +0 -1
  337. package/lib/commonjs/components/DataRequestScreen.js +0 -329
  338. package/lib/commonjs/components/DataRequestScreen.js.map +0 -1
  339. package/lib/commonjs/components/EmailVerificationModal.js +0 -320
  340. package/lib/commonjs/components/EmailVerificationModal.js.map +0 -1
  341. package/lib/commonjs/components/Onairos.js.map +0 -1
  342. package/lib/commonjs/components/OnairosButton.js.map +0 -1
  343. package/lib/commonjs/components/Overlay.js.map +0 -1
  344. package/lib/commonjs/components/PinInput.js.map +0 -1
  345. package/lib/commonjs/components/PlatformList.js.map +0 -1
  346. package/lib/commonjs/components/TrainingModal.js +0 -717
  347. package/lib/commonjs/components/TrainingModal.js.map +0 -1
  348. package/lib/commonjs/components/UniversalOnboarding.js.map +0 -1
  349. package/lib/commonjs/components/UniversalOnboarding.tsx.new +0 -455
  350. package/lib/commonjs/components/onboarding/OAuthWebView.js.map +0 -1
  351. package/lib/commonjs/components/onboarding/OnboardingHeader.js.map +0 -1
  352. package/lib/commonjs/components/onboarding/PinInput.js.map +0 -1
  353. package/lib/commonjs/components/onboarding/PlatformConnector.js.map +0 -1
  354. package/lib/commonjs/components/screens/ConnectorScreen.js +0 -146
  355. package/lib/commonjs/components/screens/ConnectorScreen.js.map +0 -1
  356. package/lib/commonjs/components/screens/LoadingScreen.js +0 -91
  357. package/lib/commonjs/components/screens/LoadingScreen.js.map +0 -1
  358. package/lib/commonjs/components/screens/PinCreationScreen.js +0 -61
  359. package/lib/commonjs/components/screens/PinCreationScreen.js.map +0 -1
  360. package/lib/commonjs/constants/index.js.map +0 -1
  361. package/lib/commonjs/hooks/useConnections.js.map +0 -1
  362. package/lib/commonjs/hooks/useCredentials.js.map +0 -1
  363. package/lib/commonjs/index.js.map +0 -1
  364. package/lib/commonjs/services/apiKeyService.js.map +0 -1
  365. package/lib/commonjs/services/oauthService.js.map +0 -1
  366. package/lib/commonjs/services/platformAuthService.js.map +0 -1
  367. package/lib/commonjs/types/ambient.d.js.map +0 -1
  368. package/lib/commonjs/types/declarations.d.js.map +0 -1
  369. package/lib/commonjs/types/index.d.js.map +0 -1
  370. package/lib/commonjs/types/index.js.map +0 -1
  371. package/lib/commonjs/types/node-fix.d.js.map +0 -1
  372. package/lib/commonjs/types/node-override.d.js.map +0 -1
  373. package/lib/commonjs/types/opacity.d.js.map +0 -1
  374. package/lib/commonjs/types/types.d.js.map +0 -1
  375. package/lib/commonjs/types.js.map +0 -1
  376. package/lib/commonjs/utils/Portal.js.map +0 -1
  377. package/lib/commonjs/utils/api.js.map +0 -1
  378. package/lib/commonjs/utils/auth.js.map +0 -1
  379. package/lib/commonjs/utils/crypto.js.map +0 -1
  380. package/lib/commonjs/utils/debugHelper.js.map +0 -1
  381. package/lib/commonjs/utils/encryption.js.map +0 -1
  382. package/lib/commonjs/utils/onairosApi.js.map +0 -1
  383. package/lib/commonjs/utils/programmaticFlow.js.map +0 -1
  384. package/lib/commonjs/utils/retryHelper.js.map +0 -1
  385. package/lib/commonjs/utils/secureStorage.js.map +0 -1
  386. package/lib/module/api/index.js.map +0 -1
  387. package/lib/module/assets/images/email.png +0 -0
  388. package/lib/module/assets/images/linkedin.png +0 -0
  389. package/lib/module/assets/images/reddit.png +0 -0
  390. package/lib/module/assets/images/youtube.png +0 -0
  391. package/lib/module/components/DataRequestModal.js +0 -220
  392. package/lib/module/components/DataRequestModal.js.map +0 -1
  393. package/lib/module/components/DataRequestScreen.js +0 -321
  394. package/lib/module/components/DataRequestScreen.js.map +0 -1
  395. package/lib/module/components/EmailVerificationModal.js +0 -311
  396. package/lib/module/components/EmailVerificationModal.js.map +0 -1
  397. package/lib/module/components/Onairos.js.map +0 -1
  398. package/lib/module/components/OnairosButton.js.map +0 -1
  399. package/lib/module/components/Overlay.js.map +0 -1
  400. package/lib/module/components/PinInput.js.map +0 -1
  401. package/lib/module/components/PlatformList.js.map +0 -1
  402. package/lib/module/components/TrainingModal.js +0 -708
  403. package/lib/module/components/TrainingModal.js.map +0 -1
  404. package/lib/module/components/UniversalOnboarding.js.map +0 -1
  405. package/lib/module/components/UniversalOnboarding.tsx.new +0 -455
  406. package/lib/module/components/onboarding/OAuthWebView.js.map +0 -1
  407. package/lib/module/components/onboarding/OnboardingHeader.js.map +0 -1
  408. package/lib/module/components/onboarding/PinInput.js.map +0 -1
  409. package/lib/module/components/onboarding/PlatformConnector.js.map +0 -1
  410. package/lib/module/components/screens/ConnectorScreen.js +0 -138
  411. package/lib/module/components/screens/ConnectorScreen.js.map +0 -1
  412. package/lib/module/components/screens/LoadingScreen.js +0 -83
  413. package/lib/module/components/screens/LoadingScreen.js.map +0 -1
  414. package/lib/module/components/screens/PinCreationScreen.js +0 -53
  415. package/lib/module/components/screens/PinCreationScreen.js.map +0 -1
  416. package/lib/module/constants/index.js.map +0 -1
  417. package/lib/module/hooks/useConnections.js.map +0 -1
  418. package/lib/module/hooks/useCredentials.js.map +0 -1
  419. package/lib/module/index.js.map +0 -1
  420. package/lib/module/services/apiKeyService.js.map +0 -1
  421. package/lib/module/services/oauthService.js.map +0 -1
  422. package/lib/module/services/platformAuthService.js.map +0 -1
  423. package/lib/module/types/ambient.d.js.map +0 -1
  424. package/lib/module/types/declarations.d.js.map +0 -1
  425. package/lib/module/types/index.d.js.map +0 -1
  426. package/lib/module/types/index.js.map +0 -1
  427. package/lib/module/types/node-fix.d.js.map +0 -1
  428. package/lib/module/types/node-override.d.js.map +0 -1
  429. package/lib/module/types/opacity.d.js.map +0 -1
  430. package/lib/module/types/types.d.js.map +0 -1
  431. package/lib/module/types.js.map +0 -1
  432. package/lib/module/utils/Portal.js.map +0 -1
  433. package/lib/module/utils/api.js.map +0 -1
  434. package/lib/module/utils/auth.js.map +0 -1
  435. package/lib/module/utils/crypto.js.map +0 -1
  436. package/lib/module/utils/debugHelper.js.map +0 -1
  437. package/lib/module/utils/encryption.js.map +0 -1
  438. package/lib/module/utils/onairosApi.js.map +0 -1
  439. package/lib/module/utils/programmaticFlow.js.map +0 -1
  440. package/lib/module/utils/retryHelper.js.map +0 -1
  441. package/lib/module/utils/secureStorage.js.map +0 -1
  442. package/lib/typescript/api/index.d.ts +0 -8
  443. package/lib/typescript/api/index.d.ts.map +0 -1
  444. package/lib/typescript/components/DataRequestModal.d.ts +0 -11
  445. package/lib/typescript/components/DataRequestModal.d.ts.map +0 -1
  446. package/lib/typescript/components/DataRequestScreen.d.ts +0 -11
  447. package/lib/typescript/components/DataRequestScreen.d.ts.map +0 -1
  448. package/lib/typescript/components/EmailVerificationModal.d.ts +0 -11
  449. package/lib/typescript/components/EmailVerificationModal.d.ts.map +0 -1
  450. package/lib/typescript/components/Onairos.d.ts +0 -4
  451. package/lib/typescript/components/Onairos.d.ts.map +0 -1
  452. package/lib/typescript/components/OnairosButton.d.ts +0 -12
  453. package/lib/typescript/components/OnairosButton.d.ts.map +0 -1
  454. package/lib/typescript/components/Overlay.d.ts +0 -4
  455. package/lib/typescript/components/Overlay.d.ts.map +0 -1
  456. package/lib/typescript/components/PinInput.d.ts +0 -4
  457. package/lib/typescript/components/PinInput.d.ts.map +0 -1
  458. package/lib/typescript/components/PlatformList.d.ts +0 -4
  459. package/lib/typescript/components/PlatformList.d.ts.map +0 -1
  460. package/lib/typescript/components/TrainingModal.d.ts +0 -4
  461. package/lib/typescript/components/TrainingModal.d.ts.map +0 -1
  462. package/lib/typescript/components/UniversalOnboarding.d.ts +0 -4
  463. package/lib/typescript/components/UniversalOnboarding.d.ts.map +0 -1
  464. package/lib/typescript/components/onboarding/OAuthWebView.d.ts +0 -10
  465. package/lib/typescript/components/onboarding/OAuthWebView.d.ts.map +0 -1
  466. package/lib/typescript/components/onboarding/OnboardingHeader.d.ts +0 -11
  467. package/lib/typescript/components/onboarding/OnboardingHeader.d.ts.map +0 -1
  468. package/lib/typescript/components/onboarding/PinInput.d.ts +0 -4
  469. package/lib/typescript/components/onboarding/PinInput.d.ts.map +0 -1
  470. package/lib/typescript/components/onboarding/PlatformConnector.d.ts +0 -13
  471. package/lib/typescript/components/onboarding/PlatformConnector.d.ts.map +0 -1
  472. package/lib/typescript/components/screens/ConnectorScreen.d.ts +0 -9
  473. package/lib/typescript/components/screens/ConnectorScreen.d.ts.map +0 -1
  474. package/lib/typescript/components/screens/LoadingScreen.d.ts +0 -9
  475. package/lib/typescript/components/screens/LoadingScreen.d.ts.map +0 -1
  476. package/lib/typescript/components/screens/PinCreationScreen.d.ts +0 -10
  477. package/lib/typescript/components/screens/PinCreationScreen.d.ts.map +0 -1
  478. package/lib/typescript/constants/index.d.ts +0 -53
  479. package/lib/typescript/constants/index.d.ts.map +0 -1
  480. package/lib/typescript/hooks/useConnections.d.ts +0 -9
  481. package/lib/typescript/hooks/useConnections.d.ts.map +0 -1
  482. package/lib/typescript/hooks/useCredentials.d.ts +0 -9
  483. package/lib/typescript/hooks/useCredentials.d.ts.map +0 -1
  484. package/lib/typescript/index.d.ts +0 -18
  485. package/lib/typescript/index.d.ts.map +0 -1
  486. package/lib/typescript/services/apiKeyService.d.ts +0 -132
  487. package/lib/typescript/services/apiKeyService.d.ts.map +0 -1
  488. package/lib/typescript/services/oauthService.d.ts +0 -50
  489. package/lib/typescript/services/oauthService.d.ts.map +0 -1
  490. package/lib/typescript/services/platformAuthService.d.ts +0 -144
  491. package/lib/typescript/services/platformAuthService.d.ts.map +0 -1
  492. package/lib/typescript/types/index.d.ts +0 -231
  493. package/lib/typescript/types/index.d.ts.map +0 -1
  494. package/lib/typescript/types.d.ts +0 -270
  495. package/lib/typescript/types.d.ts.map +0 -1
  496. package/lib/typescript/utils/Portal.d.ts +0 -14
  497. package/lib/typescript/utils/Portal.d.ts.map +0 -1
  498. package/lib/typescript/utils/api.d.ts +0 -6
  499. package/lib/typescript/utils/api.d.ts.map +0 -1
  500. package/lib/typescript/utils/auth.d.ts +0 -6
  501. package/lib/typescript/utils/auth.d.ts.map +0 -1
  502. package/lib/typescript/utils/crypto.d.ts +0 -4
  503. package/lib/typescript/utils/crypto.d.ts.map +0 -1
  504. package/lib/typescript/utils/debugHelper.d.ts +0 -29
  505. package/lib/typescript/utils/debugHelper.d.ts.map +0 -1
  506. package/lib/typescript/utils/encryption.d.ts +0 -19
  507. package/lib/typescript/utils/encryption.d.ts.map +0 -1
  508. package/lib/typescript/utils/onairosApi.d.ts +0 -87
  509. package/lib/typescript/utils/onairosApi.d.ts.map +0 -1
  510. package/lib/typescript/utils/programmaticFlow.d.ts +0 -23
  511. package/lib/typescript/utils/programmaticFlow.d.ts.map +0 -1
  512. package/lib/typescript/utils/retryHelper.d.ts +0 -69
  513. package/lib/typescript/utils/retryHelper.d.ts.map +0 -1
  514. package/lib/typescript/utils/secureStorage.d.ts +0 -94
  515. package/lib/typescript/utils/secureStorage.d.ts.map +0 -1
  516. package/src/api/index.ts +0 -111
  517. package/src/assets/images/email.png +0 -0
  518. package/src/assets/images/linkedin.png +0 -0
  519. package/src/assets/images/onairos_logo.png +0 -0
  520. package/src/assets/images/reddit.png +0 -0
  521. package/src/assets/images/youtube.png +0 -0
  522. package/src/components/DataRequestModal.tsx +0 -227
  523. package/src/components/DataRequestScreen.tsx +0 -356
  524. package/src/components/EmailVerificationModal.tsx +0 -364
  525. package/src/components/Onairos.tsx +0 -425
  526. package/src/components/OnairosButton.tsx +0 -359
  527. package/src/components/Overlay.tsx +0 -506
  528. package/src/components/PinInput.tsx +0 -343
  529. package/src/components/PlatformList.tsx +0 -145
  530. package/src/components/TrainingModal.tsx +0 -737
  531. package/src/components/UniversalOnboarding.tsx +0 -1839
  532. package/src/components/UniversalOnboarding.tsx.new +0 -455
  533. package/src/components/onboarding/OAuthWebView.tsx +0 -838
  534. package/src/components/onboarding/OnboardingHeader.tsx +0 -70
  535. package/src/components/onboarding/PinInput.tsx +0 -356
  536. package/src/components/onboarding/PlatformConnector.tsx +0 -302
  537. package/src/components/screens/ConnectorScreen.tsx +0 -153
  538. package/src/components/screens/LoadingScreen.tsx +0 -100
  539. package/src/components/screens/PinCreationScreen.tsx +0 -67
  540. package/src/constants/index.ts +0 -83
  541. package/src/hooks/useConnections.ts +0 -163
  542. package/src/hooks/useCredentials.ts +0 -175
  543. package/src/index.js +0 -14
  544. package/src/index.ts +0 -50
  545. package/src/services/SDK_API_KEY_VALIDATION.md +0 -421
  546. package/src/services/apiKeyService.ts +0 -984
  547. package/src/services/oauthService.ts +0 -412
  548. package/src/services/platformAuthService.ts +0 -1113
  549. package/src/types/ambient.d.ts +0 -29
  550. package/src/types/declarations.d.ts +0 -26
  551. package/src/types/index.d.ts +0 -274
  552. package/src/types/index.ts +0 -244
  553. package/src/types/node-fix.d.ts +0 -19
  554. package/src/types/node-override.d.ts +0 -24
  555. package/src/types/opacity.d.ts +0 -16
  556. package/src/types/types.d.ts +0 -18
  557. package/src/types.ts +0 -298
  558. package/src/utils/Portal.tsx +0 -83
  559. package/src/utils/api.js +0 -112
  560. package/src/utils/auth.js +0 -104
  561. package/src/utils/crypto.js +0 -60
  562. package/src/utils/debugHelper.ts +0 -53
  563. package/src/utils/encryption.ts +0 -69
  564. package/src/utils/onairosApi.ts +0 -391
  565. package/src/utils/programmaticFlow.ts +0 -113
  566. package/src/utils/retryHelper.ts +0 -275
  567. package/src/utils/secureStorage.ts +0 -361
  568. package/types/index.d.ts +0 -218
  569. package/types/node-env.d.ts +0 -15
  570. /package/{src/assets/images → lib/commonjs/assets/icons}/farcaster.png +0 -0
  571. /package/{src/assets/images → lib/commonjs/assets/icons}/instagram.png +0 -0
  572. /package/{src/assets/images → lib/commonjs/assets/icons}/pinterest.png +0 -0
  573. /package/{src/assets/images → lib/commonjs/assets/icons}/swerv_logo.png +0 -0
  574. /package/{src/assets/images → lib/commonjs/assets/icons}/twitter.jpg +0 -0
@@ -1,390 +1,11 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.storePlatformConnection = exports.initializeOAuthService = exports.disconnectPlatform = exports.connectPlatform = exports.cleanupOAuthService = exports.OAuthService = void 0;
7
- var _reactNative = require("react-native");
8
- var _secureStorage = require("../utils/secureStorage");
9
- var _crypto = require("../utils/crypto");
10
- var _api = require("../api");
11
- // Define OAuth configuration types
12
-
13
- // Platform-specific OAuth configurations
14
- const OAUTH_CONFIGS = {
15
- instagram: {
16
- clientId: 'YOUR_INSTAGRAM_CLIENT_ID',
17
- // Replace with actual client ID
18
- redirectUri: 'onairosanime://auth/instagram',
19
- scope: 'user_profile,user_media',
20
- authorizationEndpoint: 'https://api.instagram.com/oauth/authorize',
21
- tokenEndpoint: 'https://api.instagram.com/oauth/access_token',
22
- responseType: 'code'
23
- },
24
- youtube: {
25
- clientId: 'YOUR_YOUTUBE_CLIENT_ID',
26
- // Replace with actual client ID
27
- redirectUri: 'onairosanime://auth/youtube',
28
- scope: 'https://www.googleapis.com/auth/youtube.readonly',
29
- authorizationEndpoint: 'https://accounts.google.com/o/oauth2/auth',
30
- tokenEndpoint: 'https://oauth2.googleapis.com/token',
31
- responseType: 'code'
32
- },
33
- pinterest: {
34
- clientId: 'YOUR_PINTEREST_CLIENT_ID',
35
- // Replace with actual client ID
36
- redirectUri: 'onairosanime://auth/pinterest',
37
- scope: 'boards:read,pins:read',
38
- authorizationEndpoint: 'https://www.pinterest.com/oauth/',
39
- tokenEndpoint: 'https://api.pinterest.com/v5/oauth/token',
40
- responseType: 'code'
41
- },
42
- reddit: {
43
- clientId: 'YOUR_REDDIT_CLIENT_ID',
44
- // Replace with actual client ID
45
- redirectUri: 'onairosanime://auth/reddit',
46
- scope: 'identity,read',
47
- authorizationEndpoint: 'https://www.reddit.com/api/v1/authorize',
48
- tokenEndpoint: 'https://www.reddit.com/api/v1/access_token',
49
- responseType: 'code'
50
- }
51
- };
52
-
53
- /**
54
- * Generate a state value for OAuth to prevent CSRF attacks
55
- */
56
- const generateState = () => {
57
- const randomValue = Math.random().toString(36).substring(2, 15);
58
- return (0, _crypto.sha256)(randomValue).substring(0, 10);
59
- };
60
-
61
- /**
62
- * Initialize OAuth service handlers and listeners
63
- */
64
- const initializeOAuthService = () => {
65
- // Set up deep linking handlers for OAuth redirects
66
- _reactNative.Linking.addEventListener('url', handleDeepLink);
67
- };
68
-
69
- /**
70
- * Clean up OAuth service handlers and listeners
71
- */
72
- exports.initializeOAuthService = initializeOAuthService;
73
- const cleanupOAuthService = () => {
74
- // Use the modern React Native Linking API
75
- if (typeof _reactNative.Linking.removeAllListeners === 'function') {
76
- _reactNative.Linking.removeAllListeners('url');
77
- }
78
- };
79
-
80
- // Keep track of current OAuth state and callbacks
81
- exports.cleanupOAuthService = cleanupOAuthService;
82
- let currentOAuthState = null;
83
- let currentOAuthPlatform = null;
84
- let currentOAuthResolve = null;
85
- let currentOAuthReject = null;
86
-
87
- /**
88
- * Handle deep link callbacks from OAuth providers
89
- */
90
- const handleDeepLink = async event => {
91
- try {
92
- const {
93
- url
94
- } = event;
95
-
96
- // Check if this is an OAuth callback URL
97
- if (!url.startsWith('onairosanime://auth/')) {
98
- return;
99
- }
100
-
101
- // Extract platform from URL path
102
- const platform = url.split('onairosanime://auth/')[1].split('?')[0];
103
-
104
- // Only handle if it matches current OAuth flow
105
- if (platform !== currentOAuthPlatform) {
106
- return;
107
- }
108
-
109
- // Parse URL parameters
110
- const params = new URL(url).searchParams;
111
- const code = params.get('code');
112
- const state = params.get('state');
113
- const error = params.get('error');
114
-
115
- // Validate state to prevent CSRF attacks
116
- if (state !== currentOAuthState) {
117
- if (currentOAuthReject) {
118
- currentOAuthReject(new Error('OAuth state mismatch - possible CSRF attack'));
119
- }
120
- return;
121
- }
122
-
123
- // Handle errors
124
- if (error) {
125
- if (currentOAuthReject) {
126
- currentOAuthReject(new Error(`OAuth error: ${error}`));
127
- }
128
- return;
129
- }
130
-
131
- // Proceed with token exchange if code is present
132
- if (code) {
133
- const tokenResult = await exchangeCodeForToken(platform, code);
134
- if (currentOAuthResolve) {
135
- currentOAuthResolve(tokenResult);
136
- }
137
- } else {
138
- if (currentOAuthReject) {
139
- currentOAuthReject(new Error('No authorization code received'));
140
- }
141
- }
142
- } catch (error) {
143
- console.error('Error handling OAuth deep link:', error);
144
- if (currentOAuthReject) {
145
- currentOAuthReject(error);
146
- }
147
- } finally {
148
- // Reset state
149
- currentOAuthState = null;
150
- currentOAuthPlatform = null;
151
- currentOAuthResolve = null;
152
- currentOAuthReject = null;
153
- }
154
- };
155
-
156
- /**
157
- * Exchange OAuth authorization code for access token
158
- */
159
- const exchangeCodeForToken = async (platform, code) => {
160
- try {
161
- const config = OAUTH_CONFIGS[platform];
162
- if (!config) {
163
- throw new Error(`Unsupported platform: ${platform}`);
164
- }
165
-
166
- // Prepare token request parameters
167
- const params = new URLSearchParams({
168
- grant_type: 'authorization_code',
169
- code,
170
- redirect_uri: config.redirectUri,
171
- client_id: config.clientId
172
- });
173
-
174
- // Exchange code for token
175
- const response = await fetch(config.tokenEndpoint, {
176
- method: 'POST',
177
- headers: {
178
- 'Content-Type': 'application/x-www-form-urlencoded'
179
- },
180
- body: params.toString()
181
- });
182
- const data = await response.json();
183
- if (!response.ok) {
184
- throw new Error(data.error || 'Failed to exchange code for token');
185
- }
186
-
187
- // Fetch user information based on the platform
188
- const userInfo = await fetchUserInfo(platform, data.access_token);
189
- return {
190
- token: data.access_token,
191
- refreshToken: data.refresh_token,
192
- expiresIn: data.expires_in,
193
- username: userInfo.username,
194
- userId: userInfo.id
195
- };
196
- } catch (error) {
197
- console.error(`Error exchanging code for token (${platform}):`, error);
198
- throw error;
199
- }
200
- };
201
-
202
- /**
203
- * Fetch user information from the connected platform
204
- */
205
- const fetchUserInfo = async (platform, accessToken) => {
206
- try {
207
- let endpoint;
208
- let headers = {
209
- Authorization: `Bearer ${accessToken}`
210
- };
211
-
212
- // Platform-specific API endpoints for user info
213
- switch (platform) {
214
- case 'instagram':
215
- endpoint = 'https://graph.instagram.com/me?fields=id,username';
216
- break;
217
- case 'youtube':
218
- endpoint = 'https://www.googleapis.com/youtube/v3/channels?part=snippet&mine=true';
219
- break;
220
- case 'pinterest':
221
- endpoint = 'https://api.pinterest.com/v5/user_account';
222
- break;
223
- case 'reddit':
224
- endpoint = 'https://oauth.reddit.com/api/v1/me';
225
- break;
226
- default:
227
- throw new Error(`Unsupported platform: ${platform}`);
228
- }
229
- const response = await fetch(endpoint, {
230
- headers
231
- });
232
- const data = await response.json();
233
- if (!response.ok) {
234
- throw new Error(data.error || 'Failed to fetch user info');
235
- }
236
-
237
- // Extract user information based on platform-specific response format
238
- switch (platform) {
239
- case 'instagram':
240
- return {
241
- id: data.id,
242
- username: data.username
243
- };
244
- case 'youtube':
245
- return {
246
- id: data.items[0].id,
247
- username: data.items[0].snippet.title
248
- };
249
- case 'pinterest':
250
- return {
251
- id: data.id,
252
- username: data.username || data.full_name
253
- };
254
- case 'reddit':
255
- return {
256
- id: data.id,
257
- username: data.name
258
- };
259
- default:
260
- throw new Error(`Unsupported platform: ${platform}`);
261
- }
262
- } catch (error) {
263
- console.error(`Error fetching user info (${platform}):`, error);
264
- throw error;
265
- }
266
- };
267
-
268
- /**
269
- * Connect to a platform using OAuth
270
- */
271
- const connectPlatform = platform => {
272
- return new Promise((resolve, reject) => {
273
- try {
274
- const config = OAUTH_CONFIGS[platform];
275
- if (!config) {
276
- throw new Error(`Unsupported platform: ${platform}`);
277
- }
278
-
279
- // Generate state for CSRF protection
280
- const state = generateState();
281
-
282
- // Build authorization URL
283
- const authUrl = new URL(config.authorizationEndpoint);
284
- authUrl.searchParams.append('client_id', config.clientId);
285
- authUrl.searchParams.append('redirect_uri', config.redirectUri);
286
- authUrl.searchParams.append('response_type', config.responseType);
287
- authUrl.searchParams.append('scope', config.scope);
288
- authUrl.searchParams.append('state', state);
289
-
290
- // Set up current OAuth state for callback handling
291
- currentOAuthState = state;
292
- currentOAuthPlatform = platform;
293
- currentOAuthResolve = resolve;
294
- currentOAuthReject = reject;
295
-
296
- // Open browser or WebView to the authorization URL
297
- _reactNative.Linking.openURL(authUrl.toString());
298
- } catch (error) {
299
- reject(error);
300
- }
301
- });
302
- };
303
-
304
- /**
305
- * Disconnect from a platform
306
- */
307
- exports.connectPlatform = connectPlatform;
308
- const disconnectPlatform = async (platform, credentials) => {
309
- try {
310
- // Call Onairos API to disconnect platform
311
- await _api.onairosApi.post('/users/disconnect-platform', {
312
- platform,
313
- username: credentials.username
314
- });
315
-
316
- // Update local credentials to remove platform
317
- const updatedPlatforms = {
318
- ...credentials.platforms
319
- };
320
-
321
- // Type-safe platform removal using keyof operator
322
- if (updatedPlatforms && platform in updatedPlatforms) {
323
- delete updatedPlatforms[platform];
324
- }
325
- await (0, _secureStorage.updateCredentials)({
326
- ...credentials,
327
- platforms: updatedPlatforms
328
- });
329
- return true;
330
- } catch (error) {
331
- console.error(`Error disconnecting platform (${platform}):`, error);
332
- return false;
333
- }
334
- };
335
-
336
- /**
337
- * Store platform connection data in user credentials
338
- */
339
- exports.disconnectPlatform = disconnectPlatform;
340
- const storePlatformConnection = async (platform, connectionData, credentials) => {
341
- try {
342
- // Only accept valid platform types
343
- const validPlatform = platform === 'instagram' || platform === 'youtube' || platform === 'pinterest' || platform === 'reddit';
344
- if (!validPlatform) {
345
- throw new Error(`Unsupported platform: ${platform}`);
346
- }
347
-
348
- // Update platforms in credentials with type safety
349
- const updatedPlatforms = {
350
- ...credentials.platforms
351
- };
352
-
353
- // Type-safe assignment
354
- const platformData = {
355
- username: connectionData.username,
356
- userId: connectionData.userId,
357
- token: connectionData.token,
358
- refreshToken: connectionData.refreshToken,
359
- expiresAt: connectionData.expiresIn ? Date.now() + connectionData.expiresIn * 1000 : null,
360
- connectedAt: Date.now()
361
- };
362
-
363
- // Assign platform data based on platform type
364
- 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;
365
-
366
- // Update stored credentials
367
- await (0, _secureStorage.updateCredentials)({
368
- ...credentials,
369
- platforms: updatedPlatforms
370
- });
371
- return true;
372
- } catch (error) {
373
- console.error(`Error storing platform connection (${platform}):`, error);
374
- return false;
375
- }
376
- };
377
- exports.storePlatformConnection = storePlatformConnection;
378
- /**
379
- * Service for handling OAuth connections to various platforms
380
- */
381
- const OAuthService = exports.OAuthService = {
382
- initializeOAuthService,
383
- cleanupOAuthService,
384
- connectPlatform,
385
- disconnectPlatform,
386
- storePlatformConnection,
387
- // Base API URL
388
- _apiBaseUrl: 'https://api2.onairos.uk'
389
- };
390
- //# sourceMappingURL=oauthService.js.map
1
+ 'use strict';
2
+ // Onairos SDK - Asset Registry (auto-generated)
3
+ var __ONAIROS_REQ_REGISTRY__ = [
4
+ require("react-native"),
5
+ require("../utils/secureStorage"),
6
+ require("../utils/crypto"),
7
+ require("../api"),
8
+ require("../config/api")
9
+ ];
10
+ function __ONAIROS_REQ_FUNC__(i) { return __ONAIROS_REQ_REGISTRY__[i]; }
11
+ Object[_0x4e5c(0x0)](exports,'__esModule',{'value':!![]}),exports[_0x4e5c(0x1)]=exports[_0x4e5c(0x2)]=exports[_0x4e5c(0x3)]=exports['connectPlatform']=exports['cleanupOAuthService']=exports[_0x4e5c(0x4)]=void 0x0;var _reactNative=__ONAIROS_REQ_FUNC__(0x0),_secureStorage=__ONAIROS_REQ_FUNC__(0x1),_crypto=__ONAIROS_REQ_FUNC__(0x2),_api=__ONAIROS_REQ_FUNC__(0x3),_api2=__ONAIROS_REQ_FUNC__(0x4);function _0x4e5c(_0x5cdf70,_0x4e5cde){_0x5cdf70=_0x5cdf70-0x0;const _0x5dd139=_0x5cdf();let _0x258ae7=_0x5dd139[_0x5cdf70];return _0x258ae7;}const OAUTH_CONFIGS={'instagram':{'clientId':'YOUR_INSTAGRAM_CLIENT_ID','redirectUri':_0x4e5c(0x5),'scope':_0x4e5c(0x6),'authorizationEndpoint':'https://api.instagram.com/oauth/authorize','tokenEndpoint':'https://api.instagram.com/oauth/access_token','responseType':_0x4e5c(0x7)},'youtube':{'clientId':_0x4e5c(0x8),'redirectUri':_0x4e5c(0x9),'scope':_0x4e5c(0xa),'authorizationEndpoint':_0x4e5c(0xb),'tokenEndpoint':_0x4e5c(0xc),'responseType':_0x4e5c(0x7)},'pinterest':{'clientId':_0x4e5c(0xd),'redirectUri':_0x4e5c(0xe),'scope':_0x4e5c(0xf),'authorizationEndpoint':_0x4e5c(0x10),'tokenEndpoint':_0x4e5c(0x11),'responseType':_0x4e5c(0x7)},'reddit':{'clientId':_0x4e5c(0x12),'redirectUri':_0x4e5c(0x13),'scope':_0x4e5c(0x14),'authorizationEndpoint':_0x4e5c(0x15),'tokenEndpoint':_0x4e5c(0x16),'responseType':_0x4e5c(0x7)}},generateState=()=>{const _0x2d1e5c=Math[_0x4e5c(0x17)]()['toString'](0x24)['substring'](0x2,0xf);return(0x0,_crypto[_0x4e5c(0x18)])(_0x2d1e5c)['substring'](0x0,0xa);},initializeOAuthService=()=>{_reactNative[_0x4e5c(0x19)][_0x4e5c(0x1a)](_0x4e5c(0x1b),handleDeepLink);};exports[_0x4e5c(0x2)]=initializeOAuthService;const cleanupOAuthService=()=>{const _0x19596a={'OKTbE':function(_0x5f061e,_0x37ae72){return _0x5f061e(_0x37ae72);},'QJUsh':function(_0x48f404,_0x46cedd){return _0x48f404===_0x46cedd;},'RanqH':_0x4e5c(0x1c),'VDGyf':_0x4e5c(0x1d),'TNFfQ':_0x4e5c(0x1e)};_0x19596a[_0x4e5c(0x1f)](typeof _reactNative[_0x4e5c(0x19)]['removeAllListeners'],_0x19596a[_0x4e5c(0x20)])&&(_0x19596a[_0x4e5c(0x1f)](_0x19596a[_0x4e5c(0x21)],_0x19596a[_0x4e5c(0x22)])?(_0x279581['error'](_0x4e5c(0x23),_0x4201a8),_0x126e55&&_0x19596a[_0x4e5c(0x24)](_0x3eec20,_0x441115)):_reactNative[_0x4e5c(0x19)][_0x4e5c(0x25)](_0x4e5c(0x1b)));};exports[_0x4e5c(0x26)]=cleanupOAuthService;let currentOAuthState=null,currentOAuthPlatform=null,currentOAuthResolve=null,currentOAuthReject=null;const handleDeepLink=async _0x197ea1=>{const _0x3fb549={'EpUco':function(_0x4e1e56,_0x254472){return _0x4e1e56(_0x254472);},'jQegg':_0x4e5c(0x27),'KfTsK':_0x4e5c(0x28),'rMgIq':function(_0x2c3953,_0x5c3aa2){return _0x2c3953!==_0x5c3aa2;},'WiBfS':_0x4e5c(0x7),'fBREZ':'state','mNykb':_0x4e5c(0x29),'iEEWS':_0x4e5c(0x2a),'iplDV':function(_0x2335c3,_0x531072){return _0x2335c3!==_0x531072;},'jvPdP':_0x4e5c(0x2b),'iqeLJ':'pTGNJ','iwGhp':function(_0x2223d0,_0x22d1f9){return _0x2223d0!==_0x22d1f9;},'MxiWF':_0x4e5c(0x2c),'IDPjT':function(_0x21192d,_0x4d3f6b){return _0x21192d===_0x4d3f6b;},'WvWTi':_0x4e5c(0x2d),'VjvLI':'eHEra','XOHxp':_0x4e5c(0x2e),'upiiO':_0x4e5c(0x23)};try{const {url:_0x25f8e6}=_0x197ea1;if(!_0x25f8e6[_0x4e5c(0x2f)](_0x3fb549[_0x4e5c(0x30)]))return;const _0x31a798=_0x25f8e6[_0x4e5c(0x31)](_0x3fb549['KfTsK'])[0x1][_0x4e5c(0x31)]('?')[0x0];if(_0x3fb549[_0x4e5c(0x32)](_0x31a798,currentOAuthPlatform))return;const _0x5c9f93=new URL(_0x25f8e6)[_0x4e5c(0x33)],_0x491749=_0x5c9f93[_0x4e5c(0x34)](_0x3fb549[_0x4e5c(0x35)]),_0x2415e3=_0x5c9f93[_0x4e5c(0x34)](_0x3fb549['fBREZ']),_0x3b6923=_0x5c9f93['get'](_0x4e5c(0x36));if(_0x3fb549[_0x4e5c(0x32)](_0x2415e3,currentOAuthState)){if(currentOAuthReject){if(_0x3fb549['rMgIq'](_0x3fb549[_0x4e5c(0x37)],_0x3fb549[_0x4e5c(0x38)]))_0x3fb549['EpUco'](currentOAuthReject,new Error(_0x3fb549[_0x4e5c(0x39)]));else{_0x3c2a97[_0x4e5c(0x36)](_0x4e5c(0x3a)+_0x3d94c6+'):',_0x173332);throw _0x4cdd5f;}}return;}if(_0x3b6923){currentOAuthReject&&(_0x3fb549[_0x4e5c(0x3b)](_0x3fb549['jvPdP'],_0x3fb549[_0x4e5c(0x3c)])?_0x3fb549[_0x4e5c(0x3d)](currentOAuthReject,new Error(_0x4e5c(0x3e)+_0x3b6923)):_0x3fb549[_0x4e5c(0x3d)](_0x3783f1,new _0x4b1d67(_0x4e5c(0x3e)+_0x4e7b67)));return;}if(_0x491749){if(_0x3fb549[_0x4e5c(0x3f)](_0x3fb549[_0x4e5c(0x40)],_0x4e5c(0x2c)))_0x3b2a88[_0x4e5c(0x19)][_0x4e5c(0x1a)](_0x4e5c(0x1b),_0x5dd01d);else{const _0x12bcca=await exchangeCodeForToken(_0x31a798,_0x491749);currentOAuthResolve&&(_0x3fb549[_0x4e5c(0x41)](_0x3fb549[_0x4e5c(0x42)],_0x3fb549[_0x4e5c(0x43)])?_0x22b0c9(new _0x1b41a9(_0x3fb549[_0x4e5c(0x39)])):currentOAuthResolve(_0x12bcca));}}else currentOAuthReject&&currentOAuthReject(new Error(_0x3fb549[_0x4e5c(0x44)]));}catch(_0xaf283a){console[_0x4e5c(0x36)](_0x3fb549[_0x4e5c(0x45)],_0xaf283a),currentOAuthReject&&_0x3fb549[_0x4e5c(0x3d)](currentOAuthReject,_0xaf283a);}finally{currentOAuthState=null,currentOAuthPlatform=null,currentOAuthResolve=null,currentOAuthReject=null;}},exchangeCodeForToken=async(_0x98fb18,_0x28fe40)=>{const _0x3ab8cc={'UeqLg':function(_0x310aa6,_0x157144){return _0x310aa6(_0x157144);},'MRUtm':_0x4e5c(0x2e),'jhuVD':function(_0x62b1cf,_0x3cdeeb,_0x56fa){return _0x62b1cf(_0x3cdeeb,_0x56fa);},'yzKWj':_0x4e5c(0x46),'WjUCm':function(_0x42e0d5,_0x4687a4){return _0x42e0d5===_0x4687a4;},'VbYxJ':_0x4e5c(0x47),'kFKwu':'Failed\x20to\x20exchange\x20code\x20for\x20token','tkXSF':function(_0x2a4244,_0x229f30,_0x4ffa15){return _0x2a4244(_0x229f30,_0x4ffa15);},'enSEw':function(_0xf7c4fe,_0x457e02){return _0xf7c4fe===_0x457e02;},'aeiuD':'sOCEP'};try{const _0x70cdeb=OAUTH_CONFIGS[_0x98fb18];if(!_0x70cdeb)throw new Error(_0x4e5c(0x48)+_0x98fb18);const _0x5ef5f7=new URLSearchParams({'grant_type':_0x4e5c(0x49),'code':_0x28fe40,'redirect_uri':_0x70cdeb[_0x4e5c(0x4a)],'client_id':_0x70cdeb['clientId']}),_0x2a7c46=await _0x3ab8cc['jhuVD'](fetch,_0x70cdeb['tokenEndpoint'],{'method':'POST','headers':{'Content-Type':_0x3ab8cc[_0x4e5c(0x4b)]},'body':_0x5ef5f7[_0x4e5c(0x4c)]()}),_0x44b4fb=await _0x2a7c46['json']();if(!_0x2a7c46['ok']){if(_0x3ab8cc[_0x4e5c(0x4d)](_0x3ab8cc[_0x4e5c(0x4e)],_0x4e5c(0x47)))throw new Error(_0x44b4fb[_0x4e5c(0x36)]||_0x3ab8cc[_0x4e5c(0x4f)]);else _0x383be2&&_0x3ab8cc[_0x4e5c(0x50)](_0x517de6,new _0x2b681c(_0x3ab8cc[_0x4e5c(0x51)]));}const _0x4a44ea=await _0x3ab8cc[_0x4e5c(0x52)](fetchUserInfo,_0x98fb18,_0x44b4fb[_0x4e5c(0x53)]);return{'token':_0x44b4fb[_0x4e5c(0x53)],'refreshToken':_0x44b4fb[_0x4e5c(0x54)],'expiresIn':_0x44b4fb['expires_in'],'username':_0x4a44ea[_0x4e5c(0x55)],'userId':_0x4a44ea['id']};}catch(_0x1f9b32){if(_0x3ab8cc[_0x4e5c(0x56)](_0x3ab8cc[_0x4e5c(0x57)],_0x3ab8cc['aeiuD'])){console[_0x4e5c(0x36)](_0x4e5c(0x3a)+_0x98fb18+'):',_0x1f9b32);throw _0x1f9b32;}else{_0x1d7763[_0x4e5c(0x36)](_0x4e5c(0x58)+_0x7672a7+'):',_0x5e579f);throw _0x2f992e;}}},fetchUserInfo=async(_0x427d45,_0x555c12)=>{const _0x455103={'XylCR':_0x4e5c(0x59),'PBblB':_0x4e5c(0x5a),'LhOdm':_0x4e5c(0x5b),'wbJkI':'https://www.googleapis.com/youtube/v3/channels?part=snippet&mine=true','wMicZ':'pinterest','mhcuY':'https://api.pinterest.com/v5/user_account','dkjpD':_0x4e5c(0x5c),'mIKSz':function(_0x417061,_0x5d1291,_0x218a31){return _0x417061(_0x5d1291,_0x218a31);},'NqpkP':_0x4e5c(0x5d)};try{let _0x49c157,_0x17458d={'Authorization':_0x4e5c(0x5e)+_0x555c12};switch(_0x427d45){case _0x455103[_0x4e5c(0x5f)]:_0x49c157=_0x455103[_0x4e5c(0x60)];break;case _0x455103[_0x4e5c(0x61)]:_0x49c157=_0x455103[_0x4e5c(0x62)];break;case _0x455103[_0x4e5c(0x63)]:_0x49c157=_0x455103[_0x4e5c(0x64)];break;case'reddit':_0x49c157=_0x455103['dkjpD'];break;default:throw new Error('Unsupported\x20platform:\x20'+_0x427d45);}const _0x78d7da=await _0x455103['mIKSz'](fetch,_0x49c157,{'headers':_0x17458d}),_0x2b282d=await _0x78d7da['json']();if(!_0x78d7da['ok'])throw new Error(_0x2b282d[_0x4e5c(0x36)]||_0x455103['NqpkP']);switch(_0x427d45){case _0x455103[_0x4e5c(0x5f)]:return{'id':_0x2b282d['id'],'username':_0x2b282d['username']};case _0x455103[_0x4e5c(0x61)]:return{'id':_0x2b282d['items'][0x0]['id'],'username':_0x2b282d[_0x4e5c(0x65)][0x0]['snippet']['title']};case _0x455103['wMicZ']:return{'id':_0x2b282d['id'],'username':_0x2b282d[_0x4e5c(0x55)]||_0x2b282d[_0x4e5c(0x66)]};case _0x4e5c(0x67):return{'id':_0x2b282d['id'],'username':_0x2b282d[_0x4e5c(0x68)]};default:throw new Error(_0x4e5c(0x48)+_0x427d45);}}catch(_0x435838){console['error']('Error\x20fetching\x20user\x20info\x20('+_0x427d45+'):',_0x435838);throw _0x435838;}},connectPlatform=_0x34b8bb=>{const _0x454dd5={'cyGbB':'Failed\x20to\x20exchange\x20code\x20for\x20token','mppLI':_0x4e5c(0x69),'wWgUX':_0x4e5c(0x6a),'IgOkV':_0x4e5c(0x6b),'yybHh':_0x4e5c(0x6c),'aSFDC':_0x4e5c(0x6d),'wMkxk':_0x4e5c(0x6e),'OJCTW':_0x4e5c(0x6f),'sdoEr':_0x4e5c(0x70),'gAABX':'eyfpr','vxotP':function(_0x230332,_0x4fa60b){return _0x230332(_0x4fa60b);}};return new Promise((_0x571754,_0x200bc0)=>{if(_0x454dd5[_0x4e5c(0x71)]!==_0x454dd5[_0x4e5c(0x72)])try{const _0x1b69ec=OAUTH_CONFIGS[_0x34b8bb];if(!_0x1b69ec){if(_0x454dd5[_0x4e5c(0x73)]===_0x454dd5[_0x4e5c(0x73)])throw new Error(_0x4e5c(0x48)+_0x34b8bb);else return;}const _0x43162a=generateState(),_0x209541=new URL(_0x1b69ec[_0x4e5c(0x74)]);_0x209541[_0x4e5c(0x33)][_0x4e5c(0x75)](_0x454dd5[_0x4e5c(0x76)],_0x1b69ec[_0x4e5c(0x77)]),_0x209541[_0x4e5c(0x33)]['append'](_0x4e5c(0x78),_0x1b69ec['redirectUri']),_0x209541[_0x4e5c(0x33)][_0x4e5c(0x75)](_0x454dd5[_0x4e5c(0x79)],_0x1b69ec[_0x4e5c(0x7a)]),_0x209541[_0x4e5c(0x33)]['append'](_0x454dd5[_0x4e5c(0x7b)],_0x1b69ec[_0x4e5c(0x6e)]),_0x209541[_0x4e5c(0x33)][_0x4e5c(0x75)](_0x454dd5['OJCTW'],_0x43162a),currentOAuthState=_0x43162a,currentOAuthPlatform=_0x34b8bb,currentOAuthResolve=_0x571754,currentOAuthReject=_0x200bc0,_reactNative[_0x4e5c(0x19)][_0x4e5c(0x7c)](_0x209541[_0x4e5c(0x4c)]());}catch(_0x58808d){if(_0x454dd5[_0x4e5c(0x7d)]!==_0x454dd5['gAABX'])_0x454dd5[_0x4e5c(0x7e)](_0x200bc0,_0x58808d);else throw new _0x145111(_0x25e11e[_0x4e5c(0x36)]||_0x454dd5[_0x4e5c(0x7f)]);}else _0x142a78(_0x1e72cd);});};exports[_0x4e5c(0x80)]=connectPlatform;const disconnectPlatform=async(_0x31231d,_0x17f1d3)=>{const _0x7d7e54={'tSCJz':_0x4e5c(0x81),'lyKlC':function(_0x199471,_0x45041a){return _0x199471 in _0x45041a;},'rmUdl':_0x4e5c(0x82),'SBDjt':'aHCqr'};try{await _api[_0x4e5c(0x83)][_0x4e5c(0x84)](_0x7d7e54[_0x4e5c(0x85)],{'platform':_0x31231d,'username':_0x17f1d3[_0x4e5c(0x55)]});const _0x5c7f4b={..._0x17f1d3['platforms']};if(_0x5c7f4b&&_0x7d7e54[_0x4e5c(0x86)](_0x31231d,_0x5c7f4b)){if(_0x7d7e54['rmUdl']===_0x7d7e54[_0x4e5c(0x87)])delete _0x5c7f4b[_0x31231d];else throw new _0x4293d4(_0x4e5c(0x48)+_0x46857d);}return await(0x0,_secureStorage[_0x4e5c(0x88)])({..._0x17f1d3,'platforms':_0x5c7f4b}),!![];}catch(_0x4dcfef){if(_0x7d7e54[_0x4e5c(0x89)]!==_0x7d7e54[_0x4e5c(0x89)])_0x4e5b95=null,_0x59a737=null,_0x32e357=null,_0x428653=null;else return console[_0x4e5c(0x36)](_0x4e5c(0x8a)+_0x31231d+'):',_0x4dcfef),![];}};exports[_0x4e5c(0x3)]=disconnectPlatform;const storePlatformConnection=async(_0x50d1bb,_0x44af17,_0x41d428)=>{const _0x335fb9={'xSviE':function(_0x43bedc,_0x4b906c){return _0x43bedc(_0x4b906c);},'ldpcQ':_0x4e5c(0x2e),'sadmm':function(_0x50b208,_0x1cc383){return _0x50b208!==_0x1cc383;},'OHSYR':_0x4e5c(0x8b),'zcaSj':function(_0x15723d,_0x5d82cb){return _0x15723d===_0x5d82cb;},'QtkZt':'instagram','Ghyou':function(_0x37b2f5,_0x4e138b){return _0x37b2f5===_0x4e138b;},'gwFcD':_0x4e5c(0x5b),'mbgNw':_0x4e5c(0x8c),'vMGyA':function(_0x59ef1e,_0x2e4883){return _0x59ef1e===_0x2e4883;},'McPYd':function(_0x357307,_0x51f322){return _0x357307===_0x51f322;},'YVYRG':_0x4e5c(0x8d),'PHMuS':_0x4e5c(0x8e),'pRHmD':function(_0x5a5e65,_0x2b8f2d){return _0x5a5e65+_0x2b8f2d;},'bcYYp':function(_0x5bb2d3,_0x237c44){return _0x5bb2d3*_0x237c44;},'QJgKK':function(_0x18d55f,_0x57c41a){return _0x18d55f===_0x57c41a;},'Yqzlw':'reddit'};try{if(_0x335fb9[_0x4e5c(0x8f)](_0x4e5c(0x90),_0x335fb9[_0x4e5c(0x91)])){const _0x26551c=_0x335fb9[_0x4e5c(0x92)](_0x50d1bb,_0x335fb9[_0x4e5c(0x93)])||_0x335fb9[_0x4e5c(0x94)](_0x50d1bb,_0x335fb9['gwFcD'])||_0x335fb9['zcaSj'](_0x50d1bb,_0x335fb9[_0x4e5c(0x95)])||_0x335fb9[_0x4e5c(0x96)](_0x50d1bb,_0x4e5c(0x67));if(!_0x26551c){if(_0x335fb9[_0x4e5c(0x97)](_0x335fb9[_0x4e5c(0x98)],_0x335fb9['PHMuS']))_0x335fb9[_0x4e5c(0x99)](_0x321ac7,new _0x1b3cd(_0x335fb9[_0x4e5c(0x9a)]));else throw new Error(_0x4e5c(0x48)+_0x50d1bb);}const _0xca8006={..._0x41d428[_0x4e5c(0x9b)]},_0x1216ed={'username':_0x44af17[_0x4e5c(0x55)],'userId':_0x44af17['userId'],'token':_0x44af17[_0x4e5c(0x9c)],'refreshToken':_0x44af17[_0x4e5c(0x9d)],'expiresAt':_0x44af17[_0x4e5c(0x9e)]?_0x335fb9[_0x4e5c(0x9f)](Date[_0x4e5c(0xa0)](),_0x335fb9[_0x4e5c(0xa1)](_0x44af17['expiresIn'],0x3e8)):null,'connectedAt':Date[_0x4e5c(0xa0)]()};if(_0x335fb9[_0x4e5c(0x94)](_0x50d1bb,_0x335fb9['QtkZt']))_0xca8006[_0x4e5c(0x59)]=_0x1216ed;else{if(_0x335fb9[_0x4e5c(0xa2)](_0x50d1bb,_0x4e5c(0x5b)))_0xca8006['youtube']=_0x1216ed;else{if(_0x335fb9[_0x4e5c(0x92)](_0x50d1bb,_0x335fb9['mbgNw']))_0xca8006[_0x4e5c(0x8c)]=_0x1216ed;else{if(_0x335fb9[_0x4e5c(0x97)](_0x50d1bb,_0x335fb9[_0x4e5c(0xa3)]))_0xca8006[_0x4e5c(0x67)]=_0x1216ed;}}}return await(0x0,_secureStorage['updateCredentials'])({..._0x41d428,'platforms':_0xca8006}),!![];}else delete _0x3b3cc4[_0x46dd71];}catch(_0x37c4d1){return console[_0x4e5c(0x36)](_0x4e5c(0xa4)+_0x50d1bb+'):',_0x37c4d1),![];}};function _0x5cdf(){const _0x256a6e=['defineProperty','storePlatformConnection','initializeOAuthService','disconnectPlatform','OAuthService','onairosanime://auth/instagram','user_profile,user_media','code','YOUR_YOUTUBE_CLIENT_ID','onairosanime://auth/youtube','https://www.googleapis.com/auth/youtube.readonly','https://accounts.google.com/o/oauth2/auth','https://oauth2.googleapis.com/token','YOUR_PINTEREST_CLIENT_ID','onairosanime://auth/pinterest','boards:read,pins:read','https://www.pinterest.com/oauth/','https://api.pinterest.com/v5/oauth/token','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','sha256','Linking','addEventListener','url','function','aViUQ','eWzMC','QJUsh','RanqH','VDGyf','TNFfQ','Error\x20handling\x20OAuth\x20deep\x20link:','OKTbE','removeAllListeners','cleanupOAuthService','OAuth\x20state\x20mismatch\x20-\x20possible\x20CSRF\x20attack','onairosanime://auth/','rLvPg','pKNPE','eGhKS','HwUFo','hjsDc','No\x20authorization\x20code\x20received','startsWith','KfTsK','split','rMgIq','searchParams','get','WiBfS','error','mNykb','iEEWS','jQegg','Error\x20exchanging\x20code\x20for\x20token\x20(','iplDV','iqeLJ','EpUco','OAuth\x20error:\x20','iwGhp','MxiWF','IDPjT','WvWTi','VjvLI','XOHxp','upiiO','application/x-www-form-urlencoded','jedcP','Unsupported\x20platform:\x20','authorization_code','redirectUri','yzKWj','toString','WjUCm','VbYxJ','kFKwu','UeqLg','MRUtm','tkXSF','access_token','refresh_token','username','enSEw','aeiuD','Error\x20fetching\x20user\x20info\x20(','instagram','https://graph.instagram.com/me?fields=id,username','youtube','https://oauth.reddit.com/api/v1/me','Failed\x20to\x20fetch\x20user\x20info','Bearer\x20','XylCR','PBblB','LhOdm','wbJkI','wMicZ','mhcuY','items','full_name','reddit','name','DyLjK','ohJlV','GcItO','client_id','response_type','scope','state','pGWQa','mppLI','wWgUX','IgOkV','authorizationEndpoint','append','yybHh','clientId','redirect_uri','aSFDC','responseType','wMkxk','openURL','sdoEr','vxotP','cyGbB','connectPlatform','/users/disconnect-platform','AzpnZ','onairosApi','post','tSCJz','lyKlC','rmUdl','updateCredentials','SBDjt','Error\x20disconnecting\x20platform\x20(','opASt','pinterest','nPnvT','RRpmL','sadmm','gDWqn','OHSYR','zcaSj','QtkZt','Ghyou','mbgNw','vMGyA','McPYd','YVYRG','xSviE','ldpcQ','platforms','token','refreshToken','expiresIn','pRHmD','now','bcYYp','QJgKK','Yqzlw','Error\x20storing\x20platform\x20connection\x20(','API_CONFIG'];_0x5cdf=function(){return _0x256a6e;};return _0x5cdf();}exports[_0x4e5c(0x1)]=storePlatformConnection;const OAuthService=exports[_0x4e5c(0x4)]={'initializeOAuthService':initializeOAuthService,'cleanupOAuthService':cleanupOAuthService,'connectPlatform':connectPlatform,'disconnectPlatform':disconnectPlatform,'storePlatformConnection':storePlatformConnection,'_apiBaseUrl':''+_api2[_0x4e5c(0xa5)]['BASE_URL']};
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+ // Onairos SDK - Asset Registry (auto-generated)
3
+ var __ONAIROS_REQ_REGISTRY__ = [
4
+ require("./pinStorageUtils"),
5
+ require('react-native-crypto-js')
6
+ ];
7
+ function __ONAIROS_REQ_FUNC__(i) { return __ONAIROS_REQ_REGISTRY__[i]; }
8
+ Object['defineProperty'](exports,_0x4569(0x0),{'value':!![]}),exports[_0x4569(0x1)]=exports[_0x4569(0x2)]=exports[_0x4569(0x3)]=exports[_0x4569(0x4)]=void 0x0;var _pinStorageUtils=__ONAIROS_REQ_FUNC__(0x0);function _0x2a37(){const _0x16c878=['__esModule','hashPin','getEncryptedPinForAPI','encryptPin','decryptPin','onairos-pin-encryption-key-2024','❌\x20Error\x20encrypting\x20PIN:','AES','encrypt','toString','log','VJzRi','error','❌\x20Error\x20hashing\x20PIN:','wfIMh','🔓\x20PIN\x20decrypted\x20successfully','❌\x20Error\x20decrypting\x20PIN:','keLaT','kSdhe','decrypt','Utf8','vORxE','fsLkv','gGmdK','❌\x20Error\x20getting\x20encrypted\x20PIN\x20for\x20API:','dYHGB','ZJFqg','CiihO','🔒\x20PIN\x20hashed\x20successfully','ADLOF','SHA256','HAxlQ','zFBaF','Mbqnx','Hvczo','enc','RQDlS','IlycO'];_0x2a37=function(){return _0x16c878;};return _0x2a37();}const CryptoJS=__ONAIROS_REQ_FUNC__(0x1),ENCRYPTION_KEY=_0x4569(0x5),encryptPin=_0xf50575=>{const _0x21461e={'VJzRi':'🔐\x20PIN\x20encrypted\x20successfully','pzuuD':_0x4569(0x6)};try{const _0x3ad00d=CryptoJS[_0x4569(0x7)][_0x4569(0x8)](_0xf50575,ENCRYPTION_KEY)[_0x4569(0x9)]();return console[_0x4569(0xa)](_0x21461e[_0x4569(0xb)]),_0x3ad00d;}catch(_0x485693){console[_0x4569(0xc)](_0x21461e['pzuuD'],_0x485693);throw _0x485693;}};exports[_0x4569(0x3)]=encryptPin;const decryptPin=_0x330861=>{const _0x122a73={'KPWhV':_0x4569(0xd),'CWLWl':function(_0xc87ae3,_0x4fb907){return _0xc87ae3===_0x4fb907;},'keLaT':_0x4569(0xe),'vORxE':_0x4569(0xf),'fsLkv':_0x4569(0x10)};try{if(_0x122a73['CWLWl'](_0x122a73[_0x4569(0x11)],_0x4569(0x12))){_0x40982a['error'](_0x122a73['KPWhV'],_0x50c80f);throw _0x225242;}else{const _0x3c79f4=CryptoJS['AES'][_0x4569(0x13)](_0x330861,ENCRYPTION_KEY),_0x28989a=_0x3c79f4[_0x4569(0x9)](CryptoJS['enc'][_0x4569(0x14)]);return console[_0x4569(0xa)](_0x122a73[_0x4569(0x15)]),_0x28989a;}}catch(_0x30ba86){console[_0x4569(0xc)](_0x122a73[_0x4569(0x16)],_0x30ba86);throw _0x30ba86;}};function _0x4569(_0x2a37c2,_0x456938){_0x2a37c2=_0x2a37c2-0x0;const _0x31af0e=_0x2a37();let _0x4404d3=_0x31af0e[_0x2a37c2];return _0x4404d3;}exports[_0x4569(0x4)]=decryptPin;const getEncryptedPinForAPI=async()=>{const _0x35a2c8={'ZJFqg':'❌\x20Error\x20encrypting\x20PIN:','dYHGB':_0x4569(0x17),'ugMWf':function(_0x424c94,_0x3851a7){return _0x424c94(_0x3851a7);},'mgKUC':'✅\x20PIN\x20encrypted\x20for\x20API\x20transmission','CiihO':_0x4569(0x18)};try{const _0x58be4e=(0x0,_pinStorageUtils['getTemporaryPin'])();if(!_0x58be4e){if(_0x35a2c8['dYHGB']===_0x35a2c8[_0x4569(0x19)])return console[_0x4569(0xa)]('⚠️\x20No\x20temporary\x20PIN\x20available\x20for\x20encryption'),null;else{_0x9fc69c[_0x4569(0xc)](_0x35a2c8[_0x4569(0x1a)],_0x256283);throw _0x3c9de6;}}const _0x10b6e2=_0x35a2c8['ugMWf'](encryptPin,_0x58be4e);return console[_0x4569(0xa)](_0x35a2c8['mgKUC']),_0x10b6e2;}catch(_0x4ecb12){return console[_0x4569(0xc)](_0x35a2c8[_0x4569(0x1b)],_0x4ecb12),null;}};exports[_0x4569(0x2)]=getEncryptedPinForAPI;const hashPin=_0x176f50=>{const _0x373f24={'GLyxg':'🔓\x20PIN\x20decrypted\x20successfully','RQDlS':_0x4569(0x10),'HAxlQ':function(_0x7241f8,_0x372625){return _0x7241f8+_0x372625;},'zFBaF':_0x4569(0x1c),'Mbqnx':function(_0x279394,_0x3cae92){return _0x279394!==_0x3cae92;},'Hvczo':_0x4569(0x1d),'IlycO':_0x4569(0xd)};try{const _0x416495=CryptoJS[_0x4569(0x1e)](_0x373f24[_0x4569(0x1f)](_0x176f50,ENCRYPTION_KEY))[_0x4569(0x9)]();return console[_0x4569(0xa)](_0x373f24[_0x4569(0x20)]),_0x416495;}catch(_0x3c5297){if(_0x373f24[_0x4569(0x21)](_0x373f24[_0x4569(0x22)],_0x373f24[_0x4569(0x22)]))try{const _0x1099af=_0x596dca[_0x4569(0x7)][_0x4569(0x13)](_0x52f0ac,_0x14d93b),_0x44157c=_0x1099af[_0x4569(0x9)](_0x4013b2[_0x4569(0x23)][_0x4569(0x14)]);return _0x56928c[_0x4569(0xa)](_0x373f24['GLyxg']),_0x44157c;}catch(_0x3d446d){_0x191af9[_0x4569(0xc)](_0x373f24[_0x4569(0x24)],_0x3d446d);throw _0x3d446d;}else{console[_0x4569(0xc)](_0x373f24[_0x4569(0x25)],_0x3c5297);throw _0x3c5297;}}};exports['hashPin']=hashPin;
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+ // Onairos SDK - Asset Registry (auto-generated)
3
+ var __ONAIROS_REQ_REGISTRY__ = [
4
+ require("./biometricPinService")
5
+ ];
6
+ function __ONAIROS_REQ_FUNC__(i) { return __ONAIROS_REQ_REGISTRY__[i]; }
7
+ Object[_0x4795(0x0)](exports,'__esModule',{'value':!![]}),exports['setTemporaryPin']=exports[_0x4795(0x1)]=exports[_0x4795(0x2)]=exports['getStoredPinForTraining']=exports[_0x4795(0x3)]=exports[_0x4795(0x4)]=exports['clearStoredPin']=void 0x0;var _biometricPinService=__ONAIROS_REQ_FUNC__(0x0);const getStoredPinForTraining=async()=>{const _0x163548={'DqgxQ':_0x4795(0x5),'yJriN':_0x4795(0x6),'cgEyO':function(_0x399df9,_0x24d41d){return _0x399df9!==_0x24d41d;},'mUbXH':_0x4795(0x7),'LBthb':_0x4795(0x8),'QnsfY':'✅\x20PIN\x20retrieved\x20successfully\x20for\x20training','yQJot':_0x4795(0x9)};try{console['log'](_0x163548['yJriN']);const _0x47f5dc=await _biometricPinService[_0x4795(0xa)]['isPinStored']();if(!_0x47f5dc)return _0x163548['cgEyO'](_0x4795(0x7),_0x163548[_0x4795(0xb)])?(_0x41fdca[_0x4795(0xc)](_0x163548[_0x4795(0xd)],_0x31f42e),null):(console[_0x4795(0xe)](_0x163548[_0x4795(0xf)]),null);const _0x208401=await _biometricPinService[_0x4795(0xa)][_0x4795(0x10)]();return _0x208401?(console['log'](_0x163548[_0x4795(0x11)]),_0x208401):(console['log'](_0x163548['yQJot']),null);}catch(_0x3c0af3){return console[_0x4795(0xc)](_0x163548[_0x4795(0xd)],_0x3c0af3),null;}};exports[_0x4795(0x12)]=getStoredPinForTraining;function _0x3398(){const _0x59453a=['defineProperty','hasStoredPin','getTemporaryPin','getPinForTraining','clearTemporaryPin','❌\x20Error\x20retrieving\x20stored\x20PIN:','🔓\x20Retrieving\x20stored\x20PIN\x20for\x20training...','iLORy','⚠️\x20No\x20PIN\x20stored\x20in\x20secure\x20storage','❌\x20Failed\x20to\x20retrieve\x20PIN\x20or\x20user\x20cancelled\x20authentication','biometricPinService','mUbXH','error','DqgxQ','log','LBthb','retrievePinWithBiometric','QnsfY','getStoredPinForTraining','❌\x20Error\x20checking\x20PIN\x20storage:','isPinStored','❌\x20Error\x20clearing\x20stored\x20PIN:','MrdHD','removePinFromStorage','ymxal','WQyfZ','OeqIz','NtxuV','clearStoredPin','fhlwS','📝\x20Using\x20temporary\x20PIN\x20for\x20training','QyYoH','IzEIf','LWEUW','📝\x20Temporary\x20PIN\x20set\x20for\x20training','ipjap','setTemporaryPin','🗑️\x20Temporary\x20PIN\x20cleared','VUuNv'];_0x3398=function(){return _0x59453a;};return _0x3398();}const hasStoredPin=async()=>{const _0x10ff4b={'WuJfa':_0x4795(0x13)};try{return await _biometricPinService['biometricPinService'][_0x4795(0x14)]();}catch(_0x202747){return console[_0x4795(0xc)](_0x10ff4b['WuJfa'],_0x202747),![];}};exports[_0x4795(0x1)]=hasStoredPin;const clearStoredPin=async()=>{const _0x43fcdd={'NtxuV':_0x4795(0x15),'MrdHD':'🗑️\x20Clearing\x20stored\x20PIN...','ymxal':function(_0x3b6fd3,_0x3aea2d){return _0x3b6fd3!==_0x3aea2d;},'WQyfZ':'DcTVC','OeqIz':'fTuOZ'};try{return console[_0x4795(0xe)](_0x43fcdd[_0x4795(0x16)]),await _biometricPinService['biometricPinService'][_0x4795(0x17)]();}catch(_0x551018){return _0x43fcdd[_0x4795(0x18)](_0x43fcdd[_0x4795(0x19)],_0x43fcdd[_0x4795(0x1a)])?(console[_0x4795(0xc)](_0x43fcdd[_0x4795(0x1b)],_0x551018),![]):(_0x14237a[_0x4795(0xc)](_0x43fcdd[_0x4795(0x1b)],_0x64234e),![]);}};exports[_0x4795(0x1c)]=clearStoredPin;const getPinForTraining=async _0x36fe6b=>{const _0x28283e={'HCTAm':function(_0x2ab80b,_0x174f9c){return _0x2ab80b===_0x174f9c;},'QyYoH':_0x4795(0x1d),'IzEIf':_0x4795(0x1e),'LWEUW':function(_0x1324c7){return _0x1324c7();}};if(_0x36fe6b){if(_0x28283e['HCTAm'](_0x28283e[_0x4795(0x1f)],_0x28283e[_0x4795(0x1f)]))return console[_0x4795(0xe)](_0x28283e[_0x4795(0x20)]),_0x36fe6b;else _0x24200d=_0x72703b,_0x1b1402[_0x4795(0xe)]('📝\x20Temporary\x20PIN\x20set\x20for\x20training');}return await _0x28283e[_0x4795(0x21)](getStoredPinForTraining);};exports['getPinForTraining']=getPinForTraining;let temporaryPin=null;function _0x4795(_0x3398a6,_0x47950f){_0x3398a6=_0x3398a6-0x0;const _0x470796=_0x3398();let _0x59e7e8=_0x470796[_0x3398a6];return _0x59e7e8;}const setTemporaryPin=_0x2d81de=>{const _0x3bded5={'ipjap':_0x4795(0x22)};temporaryPin=_0x2d81de,console[_0x4795(0xe)](_0x3bded5[_0x4795(0x23)]);};exports[_0x4795(0x24)]=setTemporaryPin;const getTemporaryPin=()=>{return temporaryPin;};exports['getTemporaryPin']=getTemporaryPin;const clearTemporaryPin=()=>{const _0x29844a={'VUuNv':_0x4795(0x25)};temporaryPin=null,console[_0x4795(0xe)](_0x29844a[_0x4795(0x26)]);};exports['clearTemporaryPin']=clearTemporaryPin;