@oxyhq/services 26.0.1 → 26.0.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 (599) hide show
  1. package/README.md +2 -2
  2. package/android/src/main/java/so/oxy/identity/OxyIdentityStore.kt +21 -127
  3. package/android/src/main/java/so/oxy/session/OxyBackgroundSession.kt +184 -0
  4. package/android/src/main/java/so/oxy/session/OxyBackgroundSessionApi.kt +162 -0
  5. package/android/src/main/java/so/oxy/session/OxyBackgroundSessionModule.kt +116 -0
  6. package/android/src/main/java/so/oxy/session/OxyBackgroundSessionStore.kt +179 -0
  7. package/android/src/main/java/so/oxy/session/OxyBackgroundToken.kt +61 -0
  8. package/android/src/main/java/so/oxy/storage/OxyEncryptedPrefs.kt +241 -0
  9. package/expo-module.config.json +4 -1
  10. package/lib/commonjs/index.js +18 -49
  11. package/lib/commonjs/index.js.map +1 -1
  12. package/lib/commonjs/notifications/deviceNotifications.js +63 -0
  13. package/lib/commonjs/notifications/deviceNotifications.js.map +1 -1
  14. package/lib/commonjs/ui/boot/runProviderColdBoot.js +20 -64
  15. package/lib/commonjs/ui/boot/runProviderColdBoot.js.map +1 -1
  16. package/lib/commonjs/ui/components/AvatarCameraBadge.js +2 -2
  17. package/lib/commonjs/ui/components/AvatarCameraBadge.js.map +1 -1
  18. package/lib/commonjs/ui/components/FollowButton.js +4 -4
  19. package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
  20. package/lib/commonjs/ui/components/OxyAccountDialogScreen.js +13 -1
  21. package/lib/commonjs/ui/components/OxyAccountDialogScreen.js.map +1 -1
  22. package/lib/commonjs/ui/components/OxyAuthChooser.js +29 -24
  23. package/lib/commonjs/ui/components/OxyAuthChooser.js.map +1 -1
  24. package/lib/commonjs/ui/components/OxyProvider.js +8 -7
  25. package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
  26. package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
  27. package/lib/commonjs/ui/components/ProfileButton.js +20 -26
  28. package/lib/commonjs/ui/components/ProfileButton.js.map +1 -1
  29. package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js +68 -58
  30. package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js.map +1 -1
  31. package/lib/commonjs/ui/components/authChooser/types.js.map +1 -1
  32. package/lib/commonjs/ui/components/authChooser/useUsernameAvailability.js +2 -2
  33. package/lib/commonjs/ui/components/authChooser/useUsernameAvailability.js.map +1 -1
  34. package/lib/commonjs/ui/components/fileManagement/UploadPreview.js +2 -2
  35. package/lib/commonjs/ui/components/fileManagement/UploadPreview.js.map +1 -1
  36. package/lib/commonjs/ui/components/internal/PinInput.js +3 -1
  37. package/lib/commonjs/ui/components/internal/PinInput.js.map +1 -1
  38. package/lib/commonjs/ui/components/logo/LogoText.js +4 -4
  39. package/lib/commonjs/ui/components/logo/LogoText.js.map +1 -1
  40. package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js +2 -2
  41. package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js.map +1 -1
  42. package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js +2 -2
  43. package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js.map +1 -1
  44. package/lib/commonjs/ui/components/styles/shadow.js.map +1 -1
  45. package/lib/commonjs/ui/context/OxyContext.js +32 -46
  46. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  47. package/lib/commonjs/ui/context/commitSessionFlow.js +3 -43
  48. package/lib/commonjs/ui/context/commitSessionFlow.js.map +1 -1
  49. package/lib/commonjs/ui/context/hooks/useAuthOperations.js +15 -2
  50. package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
  51. package/lib/commonjs/ui/context/useOxyAccountGraph.js +3 -4
  52. package/lib/commonjs/ui/context/useOxyAccountGraph.js.map +1 -1
  53. package/lib/commonjs/ui/hooks/mutations/mutationFactory.js +5 -5
  54. package/lib/commonjs/ui/hooks/mutations/mutationFactory.js.map +1 -1
  55. package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js +11 -11
  56. package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js.map +1 -1
  57. package/lib/commonjs/ui/hooks/mutations/useServicesMutations.js +9 -9
  58. package/lib/commonjs/ui/hooks/mutations/useServicesMutations.js.map +1 -1
  59. package/lib/commonjs/ui/hooks/queries/usePaymentQueries.js +3 -2
  60. package/lib/commonjs/ui/hooks/queries/usePaymentQueries.js.map +1 -1
  61. package/lib/commonjs/ui/hooks/queries/userCache.js +17 -17
  62. package/lib/commonjs/ui/hooks/queries/userCache.js.map +1 -1
  63. package/lib/commonjs/ui/hooks/useAssets.js.map +1 -1
  64. package/lib/commonjs/ui/hooks/useAsyncAction.js +7 -7
  65. package/lib/commonjs/ui/hooks/useAsyncAction.js.map +1 -1
  66. package/lib/commonjs/ui/hooks/useAuth.js +8 -4
  67. package/lib/commonjs/ui/hooks/useAuth.js.map +1 -1
  68. package/lib/commonjs/ui/hooks/useAvatarPicker.js +5 -5
  69. package/lib/commonjs/ui/hooks/useAvatarPicker.js.map +1 -1
  70. package/lib/commonjs/ui/hooks/useOnlineStatus.js +3 -2
  71. package/lib/commonjs/ui/hooks/useOnlineStatus.js.map +1 -1
  72. package/lib/commonjs/ui/hooks/useSessionManagement.js +0 -2
  73. package/lib/commonjs/ui/hooks/useSessionManagement.js.map +1 -1
  74. package/lib/commonjs/ui/hooks/useSettingToggle.js +4 -4
  75. package/lib/commonjs/ui/hooks/useSettingToggle.js.map +1 -1
  76. package/lib/commonjs/ui/hooks/useSurfaceHeader.js +68 -11
  77. package/lib/commonjs/ui/hooks/useSurfaceHeader.js.map +1 -1
  78. package/lib/commonjs/ui/navigation/accountDialogManager.js +2 -0
  79. package/lib/commonjs/ui/navigation/accountDialogManager.js.map +1 -1
  80. package/lib/commonjs/ui/oauth/browserAuthTransport.js +66 -64
  81. package/lib/commonjs/ui/oauth/browserAuthTransport.js.map +1 -1
  82. package/lib/commonjs/ui/oauth/oauthPopup.js +47 -0
  83. package/lib/commonjs/ui/oauth/oauthPopup.js.map +1 -1
  84. package/lib/commonjs/ui/screens/AccountMembersScreen.js +10 -10
  85. package/lib/commonjs/ui/screens/AccountMembersScreen.js.map +1 -1
  86. package/lib/commonjs/ui/screens/AccountSettingsScreen.js +41 -19
  87. package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
  88. package/lib/commonjs/ui/screens/AccountVerificationScreen.js +4 -4
  89. package/lib/commonjs/ui/screens/AccountVerificationScreen.js.map +1 -1
  90. package/lib/commonjs/ui/screens/AppInfoScreen.js +9 -9
  91. package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
  92. package/lib/commonjs/ui/screens/AvatarCropScreen.js +3 -3
  93. package/lib/commonjs/ui/screens/AvatarCropScreen.js.map +1 -1
  94. package/lib/commonjs/ui/screens/ChangeAvatarScreen.js +6 -7
  95. package/lib/commonjs/ui/screens/ChangeAvatarScreen.js.map +1 -1
  96. package/lib/commonjs/ui/screens/ConnectedAppsScreen.js +4 -4
  97. package/lib/commonjs/ui/screens/ConnectedAppsScreen.js.map +1 -1
  98. package/lib/commonjs/ui/screens/CreateAccountScreen.js +46 -14
  99. package/lib/commonjs/ui/screens/CreateAccountScreen.js.map +1 -1
  100. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +5 -5
  101. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
  102. package/lib/commonjs/ui/screens/EditProfileScreen.js +2 -3
  103. package/lib/commonjs/ui/screens/EditProfileScreen.js.map +1 -1
  104. package/lib/commonjs/ui/screens/FAQScreen.js +2 -2
  105. package/lib/commonjs/ui/screens/FAQScreen.js.map +1 -1
  106. package/lib/commonjs/ui/screens/FeedbackScreen.js +90 -89
  107. package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
  108. package/lib/commonjs/ui/screens/FileManagementScreen.js +20 -20
  109. package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
  110. package/lib/commonjs/ui/screens/FollowersListScreen.js.map +1 -1
  111. package/lib/commonjs/ui/screens/FollowingListScreen.js.map +1 -1
  112. package/lib/commonjs/ui/screens/HelpSupportScreen.js +7 -7
  113. package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -1
  114. package/lib/commonjs/ui/screens/HistoryViewScreen.js +9 -34
  115. package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
  116. package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +3 -3
  117. package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
  118. package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +3 -3
  119. package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -1
  120. package/lib/commonjs/ui/screens/ManageAccountScreen.js +15 -15
  121. package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
  122. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +19 -19
  123. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  124. package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +15 -15
  125. package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
  126. package/lib/commonjs/ui/screens/ProfileScreen.js +17 -7
  127. package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
  128. package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +2 -2
  129. package/lib/commonjs/ui/screens/SavesCollectionsScreen.js.map +1 -1
  130. package/lib/commonjs/ui/screens/UserListScreen.js +13 -7
  131. package/lib/commonjs/ui/screens/UserListScreen.js.map +1 -1
  132. package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +5 -6
  133. package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
  134. package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js +1 -4
  135. package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
  136. package/lib/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.js +34 -24
  137. package/lib/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.js.map +1 -1
  138. package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js +1 -1
  139. package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js.map +1 -1
  140. package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js +3 -4
  141. package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
  142. package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js +1 -1
  143. package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
  144. package/lib/commonjs/ui/session/backgroundSession.js +258 -0
  145. package/lib/commonjs/ui/session/backgroundSession.js.map +1 -0
  146. package/lib/commonjs/ui/session/index.js +7 -0
  147. package/lib/commonjs/ui/session/index.js.map +1 -1
  148. package/lib/commonjs/ui/session/useBackgroundSessionSync.js +81 -0
  149. package/lib/commonjs/ui/session/useBackgroundSessionSync.js.map +1 -0
  150. package/lib/commonjs/ui/utils/fileManagement.js +24 -24
  151. package/lib/commonjs/ui/utils/fileManagement.js.map +1 -1
  152. package/lib/commonjs/ui/utils/netConnectivity.js +28 -0
  153. package/lib/commonjs/ui/utils/netConnectivity.js.map +1 -0
  154. package/lib/commonjs/ui/utils/oauthReturn.js +19 -30
  155. package/lib/commonjs/ui/utils/oauthReturn.js.map +1 -1
  156. package/lib/commonjs/ui/utils/userUtils.js +27 -28
  157. package/lib/commonjs/ui/utils/userUtils.js.map +1 -1
  158. package/lib/module/index.js +20 -8
  159. package/lib/module/index.js.map +1 -1
  160. package/lib/module/notifications/deviceNotifications.js +62 -0
  161. package/lib/module/notifications/deviceNotifications.js.map +1 -1
  162. package/lib/module/ui/boot/runProviderColdBoot.js +21 -65
  163. package/lib/module/ui/boot/runProviderColdBoot.js.map +1 -1
  164. package/lib/module/ui/components/AvatarCameraBadge.js +1 -1
  165. package/lib/module/ui/components/AvatarCameraBadge.js.map +1 -1
  166. package/lib/module/ui/components/FollowButton.js +1 -1
  167. package/lib/module/ui/components/FollowButton.js.map +1 -1
  168. package/lib/module/ui/components/OxyAccountDialogScreen.js +13 -1
  169. package/lib/module/ui/components/OxyAccountDialogScreen.js.map +1 -1
  170. package/lib/module/ui/components/OxyAuthChooser.js +25 -20
  171. package/lib/module/ui/components/OxyAuthChooser.js.map +1 -1
  172. package/lib/module/ui/components/OxyProvider.js +7 -6
  173. package/lib/module/ui/components/OxyProvider.js.map +1 -1
  174. package/lib/module/ui/components/OxySignInButton.js.map +1 -1
  175. package/lib/module/ui/components/ProfileButton.js +12 -18
  176. package/lib/module/ui/components/ProfileButton.js.map +1 -1
  177. package/lib/module/ui/components/authChooser/AccountsMenuView.js +68 -58
  178. package/lib/module/ui/components/authChooser/AccountsMenuView.js.map +1 -1
  179. package/lib/module/ui/components/authChooser/types.js.map +1 -1
  180. package/lib/module/ui/components/authChooser/useUsernameAvailability.js +1 -1
  181. package/lib/module/ui/components/authChooser/useUsernameAvailability.js.map +1 -1
  182. package/lib/module/ui/components/fileManagement/UploadPreview.js +1 -1
  183. package/lib/module/ui/components/fileManagement/UploadPreview.js.map +1 -1
  184. package/lib/module/ui/components/internal/PinInput.js +3 -1
  185. package/lib/module/ui/components/internal/PinInput.js.map +1 -1
  186. package/lib/module/ui/components/logo/LogoText.js +4 -4
  187. package/lib/module/ui/components/logo/LogoText.js.map +1 -1
  188. package/lib/module/ui/components/payment/PaymentDetailsStep.js +1 -1
  189. package/lib/module/ui/components/payment/PaymentDetailsStep.js.map +1 -1
  190. package/lib/module/ui/components/payment/PaymentSummaryStep.js +2 -2
  191. package/lib/module/ui/components/payment/PaymentSummaryStep.js.map +1 -1
  192. package/lib/module/ui/components/styles/shadow.js.map +1 -1
  193. package/lib/module/ui/context/OxyContext.js +35 -49
  194. package/lib/module/ui/context/OxyContext.js.map +1 -1
  195. package/lib/module/ui/context/commitSessionFlow.js +3 -42
  196. package/lib/module/ui/context/commitSessionFlow.js.map +1 -1
  197. package/lib/module/ui/context/hooks/useAuthOperations.js +15 -2
  198. package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
  199. package/lib/module/ui/context/useOxyAccountGraph.js +3 -4
  200. package/lib/module/ui/context/useOxyAccountGraph.js.map +1 -1
  201. package/lib/module/ui/hooks/mutations/mutationFactory.js +1 -1
  202. package/lib/module/ui/hooks/mutations/mutationFactory.js.map +1 -1
  203. package/lib/module/ui/hooks/mutations/useAccountMutations.js +1 -1
  204. package/lib/module/ui/hooks/mutations/useAccountMutations.js.map +1 -1
  205. package/lib/module/ui/hooks/mutations/useServicesMutations.js +1 -1
  206. package/lib/module/ui/hooks/mutations/useServicesMutations.js.map +1 -1
  207. package/lib/module/ui/hooks/queries/usePaymentQueries.js +3 -2
  208. package/lib/module/ui/hooks/queries/usePaymentQueries.js.map +1 -1
  209. package/lib/module/ui/hooks/queries/userCache.js +17 -17
  210. package/lib/module/ui/hooks/queries/userCache.js.map +1 -1
  211. package/lib/module/ui/hooks/useAssets.js.map +1 -1
  212. package/lib/module/ui/hooks/useAsyncAction.js +1 -1
  213. package/lib/module/ui/hooks/useAsyncAction.js.map +1 -1
  214. package/lib/module/ui/hooks/useAuth.js +8 -4
  215. package/lib/module/ui/hooks/useAuth.js.map +1 -1
  216. package/lib/module/ui/hooks/useAvatarPicker.js +1 -1
  217. package/lib/module/ui/hooks/useAvatarPicker.js.map +1 -1
  218. package/lib/module/ui/hooks/useOnlineStatus.js +3 -2
  219. package/lib/module/ui/hooks/useOnlineStatus.js.map +1 -1
  220. package/lib/module/ui/hooks/useSessionManagement.js +0 -2
  221. package/lib/module/ui/hooks/useSessionManagement.js.map +1 -1
  222. package/lib/module/ui/hooks/useSettingToggle.js +1 -1
  223. package/lib/module/ui/hooks/useSettingToggle.js.map +1 -1
  224. package/lib/module/ui/hooks/useSurfaceHeader.js +68 -11
  225. package/lib/module/ui/hooks/useSurfaceHeader.js.map +1 -1
  226. package/lib/module/ui/navigation/accountDialogManager.js +2 -0
  227. package/lib/module/ui/navigation/accountDialogManager.js.map +1 -1
  228. package/lib/module/ui/oauth/browserAuthTransport.js +66 -64
  229. package/lib/module/ui/oauth/browserAuthTransport.js.map +1 -1
  230. package/lib/module/ui/oauth/oauthPopup.js +48 -1
  231. package/lib/module/ui/oauth/oauthPopup.js.map +1 -1
  232. package/lib/module/ui/screens/AccountMembersScreen.js +1 -1
  233. package/lib/module/ui/screens/AccountMembersScreen.js.map +1 -1
  234. package/lib/module/ui/screens/AccountSettingsScreen.js +37 -15
  235. package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
  236. package/lib/module/ui/screens/AccountVerificationScreen.js +1 -1
  237. package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -1
  238. package/lib/module/ui/screens/AppInfoScreen.js +1 -1
  239. package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
  240. package/lib/module/ui/screens/AvatarCropScreen.js +1 -1
  241. package/lib/module/ui/screens/AvatarCropScreen.js.map +1 -1
  242. package/lib/module/ui/screens/ChangeAvatarScreen.js +4 -5
  243. package/lib/module/ui/screens/ChangeAvatarScreen.js.map +1 -1
  244. package/lib/module/ui/screens/ConnectedAppsScreen.js +2 -2
  245. package/lib/module/ui/screens/ConnectedAppsScreen.js.map +1 -1
  246. package/lib/module/ui/screens/CreateAccountScreen.js +45 -13
  247. package/lib/module/ui/screens/CreateAccountScreen.js.map +1 -1
  248. package/lib/module/ui/screens/EditProfileFieldScreen.js +4 -4
  249. package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
  250. package/lib/module/ui/screens/EditProfileScreen.js +3 -4
  251. package/lib/module/ui/screens/EditProfileScreen.js.map +1 -1
  252. package/lib/module/ui/screens/FAQScreen.js +1 -1
  253. package/lib/module/ui/screens/FAQScreen.js.map +1 -1
  254. package/lib/module/ui/screens/FeedbackScreen.js +94 -91
  255. package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
  256. package/lib/module/ui/screens/FileManagementScreen.js +1 -1
  257. package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
  258. package/lib/module/ui/screens/FollowersListScreen.js.map +1 -1
  259. package/lib/module/ui/screens/FollowingListScreen.js.map +1 -1
  260. package/lib/module/ui/screens/HelpSupportScreen.js +1 -1
  261. package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -1
  262. package/lib/module/ui/screens/HistoryViewScreen.js +5 -30
  263. package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
  264. package/lib/module/ui/screens/LanguageSelectorScreen.js +1 -1
  265. package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
  266. package/lib/module/ui/screens/LegalDocumentsScreen.js +1 -1
  267. package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -1
  268. package/lib/module/ui/screens/ManageAccountScreen.js +3 -3
  269. package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
  270. package/lib/module/ui/screens/PremiumSubscriptionScreen.js +4 -4
  271. package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  272. package/lib/module/ui/screens/PrivacySettingsScreen.js +11 -11
  273. package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
  274. package/lib/module/ui/screens/ProfileScreen.js +18 -8
  275. package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
  276. package/lib/module/ui/screens/SavesCollectionsScreen.js +1 -1
  277. package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -1
  278. package/lib/module/ui/screens/UserListScreen.js +14 -8
  279. package/lib/module/ui/screens/UserListScreen.js.map +1 -1
  280. package/lib/module/ui/screens/WelcomeNewUserScreen.js +5 -6
  281. package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
  282. package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js +1 -4
  283. package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
  284. package/lib/module/ui/screens/fileManagement/hooks/useFileUploadState.js +15 -5
  285. package/lib/module/ui/screens/fileManagement/hooks/useFileUploadState.js.map +1 -1
  286. package/lib/module/ui/screens/trust/TrustCenterScreen.js +1 -1
  287. package/lib/module/ui/screens/trust/TrustCenterScreen.js.map +1 -1
  288. package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js +4 -5
  289. package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
  290. package/lib/module/ui/screens/trust/TrustRewardsScreen.js +1 -1
  291. package/lib/module/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
  292. package/lib/module/ui/session/backgroundSession.js +252 -0
  293. package/lib/module/ui/session/backgroundSession.js.map +1 -0
  294. package/lib/module/ui/session/index.js +1 -0
  295. package/lib/module/ui/session/index.js.map +1 -1
  296. package/lib/module/ui/session/useBackgroundSessionSync.js +76 -0
  297. package/lib/module/ui/session/useBackgroundSessionSync.js.map +1 -0
  298. package/lib/module/ui/utils/fileManagement.js +25 -25
  299. package/lib/module/ui/utils/fileManagement.js.map +1 -1
  300. package/lib/module/ui/utils/netConnectivity.js +23 -0
  301. package/lib/module/ui/utils/netConnectivity.js.map +1 -0
  302. package/lib/module/ui/utils/oauthReturn.js +20 -30
  303. package/lib/module/ui/utils/oauthReturn.js.map +1 -1
  304. package/lib/module/ui/utils/userUtils.js +27 -28
  305. package/lib/module/ui/utils/userUtils.js.map +1 -1
  306. package/lib/typescript/commonjs/index.d.ts +1 -2
  307. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  308. package/lib/typescript/commonjs/notifications/deviceNotifications.d.ts +51 -0
  309. package/lib/typescript/commonjs/notifications/deviceNotifications.d.ts.map +1 -1
  310. package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts +11 -30
  311. package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts.map +1 -1
  312. package/lib/typescript/commonjs/ui/components/AvatarCameraBadge.d.ts.map +1 -1
  313. package/lib/typescript/commonjs/ui/components/OxyAccountDialogScreen.d.ts.map +1 -1
  314. package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts +7 -0
  315. package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts.map +1 -1
  316. package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
  317. package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts +2 -1
  318. package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts.map +1 -1
  319. package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts +3 -0
  320. package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts.map +1 -1
  321. package/lib/typescript/commonjs/ui/components/authChooser/AccountsMenuView.d.ts.map +1 -1
  322. package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts +6 -0
  323. package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts.map +1 -1
  324. package/lib/typescript/commonjs/ui/components/fileManagement/UploadPreview.d.ts +1 -1
  325. package/lib/typescript/commonjs/ui/components/fileManagement/UploadPreview.d.ts.map +1 -1
  326. package/lib/typescript/commonjs/ui/components/internal/PinInput.d.ts.map +1 -1
  327. package/lib/typescript/commonjs/ui/components/payment/types.d.ts +6 -6
  328. package/lib/typescript/commonjs/ui/components/payment/types.d.ts.map +1 -1
  329. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
  330. package/lib/typescript/commonjs/ui/context/commitSessionFlow.d.ts +0 -40
  331. package/lib/typescript/commonjs/ui/context/commitSessionFlow.d.ts.map +1 -1
  332. package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts +11 -2
  333. package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
  334. package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts +26 -7
  335. package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts.map +1 -1
  336. package/lib/typescript/commonjs/ui/context/useOxyAccountGraph.d.ts +0 -1
  337. package/lib/typescript/commonjs/ui/context/useOxyAccountGraph.d.ts.map +1 -1
  338. package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  339. package/lib/typescript/commonjs/ui/hooks/queries/paymentTypes.d.ts +3 -2
  340. package/lib/typescript/commonjs/ui/hooks/queries/paymentTypes.d.ts.map +1 -1
  341. package/lib/typescript/commonjs/ui/hooks/queries/usePaymentQueries.d.ts +3 -2
  342. package/lib/typescript/commonjs/ui/hooks/queries/usePaymentQueries.d.ts.map +1 -1
  343. package/lib/typescript/commonjs/ui/hooks/queries/userCache.d.ts +2 -2
  344. package/lib/typescript/commonjs/ui/hooks/queries/userCache.d.ts.map +1 -1
  345. package/lib/typescript/commonjs/ui/hooks/useAssets.d.ts +1 -1
  346. package/lib/typescript/commonjs/ui/hooks/useAssets.d.ts.map +1 -1
  347. package/lib/typescript/commonjs/ui/hooks/useAsyncAction.d.ts +2 -2
  348. package/lib/typescript/commonjs/ui/hooks/useAsyncAction.d.ts.map +1 -1
  349. package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts +10 -6
  350. package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts.map +1 -1
  351. package/lib/typescript/commonjs/ui/hooks/useOnlineStatus.d.ts +3 -2
  352. package/lib/typescript/commonjs/ui/hooks/useOnlineStatus.d.ts.map +1 -1
  353. package/lib/typescript/commonjs/ui/hooks/useSessionManagement.d.ts.map +1 -1
  354. package/lib/typescript/commonjs/ui/hooks/useSurfaceHeader.d.ts +7 -2
  355. package/lib/typescript/commonjs/ui/hooks/useSurfaceHeader.d.ts.map +1 -1
  356. package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts +8 -0
  357. package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts.map +1 -1
  358. package/lib/typescript/commonjs/ui/oauth/browserAuthTransport.d.ts.map +1 -1
  359. package/lib/typescript/commonjs/ui/oauth/oauthPopup.d.ts +6 -0
  360. package/lib/typescript/commonjs/ui/oauth/oauthPopup.d.ts.map +1 -1
  361. package/lib/typescript/commonjs/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
  362. package/lib/typescript/commonjs/ui/screens/ChangeAvatarScreen.d.ts.map +1 -1
  363. package/lib/typescript/commonjs/ui/screens/CreateAccountScreen.d.ts.map +1 -1
  364. package/lib/typescript/commonjs/ui/screens/EditProfileScreen.d.ts.map +1 -1
  365. package/lib/typescript/commonjs/ui/screens/FeedbackScreen.d.ts +2 -2
  366. package/lib/typescript/commonjs/ui/screens/FeedbackScreen.d.ts.map +1 -1
  367. package/lib/typescript/commonjs/ui/screens/FollowersListScreen.d.ts +3 -0
  368. package/lib/typescript/commonjs/ui/screens/FollowersListScreen.d.ts.map +1 -1
  369. package/lib/typescript/commonjs/ui/screens/FollowingListScreen.d.ts +3 -0
  370. package/lib/typescript/commonjs/ui/screens/FollowingListScreen.d.ts.map +1 -1
  371. package/lib/typescript/commonjs/ui/screens/HistoryViewScreen.d.ts.map +1 -1
  372. package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -1
  373. package/lib/typescript/commonjs/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
  374. package/lib/typescript/commonjs/ui/screens/ProfileScreen.d.ts.map +1 -1
  375. package/lib/typescript/commonjs/ui/screens/UserListScreen.d.ts +7 -0
  376. package/lib/typescript/commonjs/ui/screens/UserListScreen.d.ts.map +1 -1
  377. package/lib/typescript/commonjs/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
  378. package/lib/typescript/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.d.ts.map +1 -1
  379. package/lib/typescript/commonjs/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
  380. package/lib/typescript/commonjs/ui/screens/trust/trustTier.d.ts +1 -1
  381. package/lib/typescript/commonjs/ui/screens/trust/trustTier.d.ts.map +1 -1
  382. package/lib/typescript/commonjs/ui/session/backgroundSession.d.ts +42 -0
  383. package/lib/typescript/commonjs/ui/session/backgroundSession.d.ts.map +1 -0
  384. package/lib/typescript/commonjs/ui/session/index.d.ts +1 -0
  385. package/lib/typescript/commonjs/ui/session/index.d.ts.map +1 -1
  386. package/lib/typescript/commonjs/ui/session/useBackgroundSessionSync.d.ts +23 -0
  387. package/lib/typescript/commonjs/ui/session/useBackgroundSessionSync.d.ts.map +1 -0
  388. package/lib/typescript/commonjs/ui/types/navigation.d.ts +27 -19
  389. package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
  390. package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts +5 -5
  391. package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts.map +1 -1
  392. package/lib/typescript/commonjs/ui/utils/netConnectivity.d.ts +17 -0
  393. package/lib/typescript/commonjs/ui/utils/netConnectivity.d.ts.map +1 -0
  394. package/lib/typescript/commonjs/ui/utils/oauthReturn.d.ts +15 -12
  395. package/lib/typescript/commonjs/ui/utils/oauthReturn.d.ts.map +1 -1
  396. package/lib/typescript/commonjs/ui/utils/userUtils.d.ts +7 -14
  397. package/lib/typescript/commonjs/ui/utils/userUtils.d.ts.map +1 -1
  398. package/lib/typescript/module/index.d.ts +1 -2
  399. package/lib/typescript/module/index.d.ts.map +1 -1
  400. package/lib/typescript/module/notifications/deviceNotifications.d.ts +51 -0
  401. package/lib/typescript/module/notifications/deviceNotifications.d.ts.map +1 -1
  402. package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts +11 -30
  403. package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts.map +1 -1
  404. package/lib/typescript/module/ui/components/AvatarCameraBadge.d.ts.map +1 -1
  405. package/lib/typescript/module/ui/components/OxyAccountDialogScreen.d.ts.map +1 -1
  406. package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts +7 -0
  407. package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts.map +1 -1
  408. package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
  409. package/lib/typescript/module/ui/components/OxySignInButton.d.ts +2 -1
  410. package/lib/typescript/module/ui/components/OxySignInButton.d.ts.map +1 -1
  411. package/lib/typescript/module/ui/components/ProfileButton.d.ts +3 -0
  412. package/lib/typescript/module/ui/components/ProfileButton.d.ts.map +1 -1
  413. package/lib/typescript/module/ui/components/authChooser/AccountsMenuView.d.ts.map +1 -1
  414. package/lib/typescript/module/ui/components/authChooser/types.d.ts +6 -0
  415. package/lib/typescript/module/ui/components/authChooser/types.d.ts.map +1 -1
  416. package/lib/typescript/module/ui/components/fileManagement/UploadPreview.d.ts +1 -1
  417. package/lib/typescript/module/ui/components/fileManagement/UploadPreview.d.ts.map +1 -1
  418. package/lib/typescript/module/ui/components/internal/PinInput.d.ts.map +1 -1
  419. package/lib/typescript/module/ui/components/payment/types.d.ts +6 -6
  420. package/lib/typescript/module/ui/components/payment/types.d.ts.map +1 -1
  421. package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
  422. package/lib/typescript/module/ui/context/commitSessionFlow.d.ts +0 -40
  423. package/lib/typescript/module/ui/context/commitSessionFlow.d.ts.map +1 -1
  424. package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts +11 -2
  425. package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
  426. package/lib/typescript/module/ui/context/oxyContextTypes.d.ts +26 -7
  427. package/lib/typescript/module/ui/context/oxyContextTypes.d.ts.map +1 -1
  428. package/lib/typescript/module/ui/context/useOxyAccountGraph.d.ts +0 -1
  429. package/lib/typescript/module/ui/context/useOxyAccountGraph.d.ts.map +1 -1
  430. package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  431. package/lib/typescript/module/ui/hooks/queries/paymentTypes.d.ts +3 -2
  432. package/lib/typescript/module/ui/hooks/queries/paymentTypes.d.ts.map +1 -1
  433. package/lib/typescript/module/ui/hooks/queries/usePaymentQueries.d.ts +3 -2
  434. package/lib/typescript/module/ui/hooks/queries/usePaymentQueries.d.ts.map +1 -1
  435. package/lib/typescript/module/ui/hooks/queries/userCache.d.ts +2 -2
  436. package/lib/typescript/module/ui/hooks/queries/userCache.d.ts.map +1 -1
  437. package/lib/typescript/module/ui/hooks/useAssets.d.ts +1 -1
  438. package/lib/typescript/module/ui/hooks/useAssets.d.ts.map +1 -1
  439. package/lib/typescript/module/ui/hooks/useAsyncAction.d.ts +2 -2
  440. package/lib/typescript/module/ui/hooks/useAsyncAction.d.ts.map +1 -1
  441. package/lib/typescript/module/ui/hooks/useAuth.d.ts +10 -6
  442. package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
  443. package/lib/typescript/module/ui/hooks/useOnlineStatus.d.ts +3 -2
  444. package/lib/typescript/module/ui/hooks/useOnlineStatus.d.ts.map +1 -1
  445. package/lib/typescript/module/ui/hooks/useSessionManagement.d.ts.map +1 -1
  446. package/lib/typescript/module/ui/hooks/useSurfaceHeader.d.ts +7 -2
  447. package/lib/typescript/module/ui/hooks/useSurfaceHeader.d.ts.map +1 -1
  448. package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts +8 -0
  449. package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts.map +1 -1
  450. package/lib/typescript/module/ui/oauth/browserAuthTransport.d.ts.map +1 -1
  451. package/lib/typescript/module/ui/oauth/oauthPopup.d.ts +6 -0
  452. package/lib/typescript/module/ui/oauth/oauthPopup.d.ts.map +1 -1
  453. package/lib/typescript/module/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
  454. package/lib/typescript/module/ui/screens/ChangeAvatarScreen.d.ts.map +1 -1
  455. package/lib/typescript/module/ui/screens/CreateAccountScreen.d.ts.map +1 -1
  456. package/lib/typescript/module/ui/screens/EditProfileScreen.d.ts.map +1 -1
  457. package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts +2 -2
  458. package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts.map +1 -1
  459. package/lib/typescript/module/ui/screens/FollowersListScreen.d.ts +3 -0
  460. package/lib/typescript/module/ui/screens/FollowersListScreen.d.ts.map +1 -1
  461. package/lib/typescript/module/ui/screens/FollowingListScreen.d.ts +3 -0
  462. package/lib/typescript/module/ui/screens/FollowingListScreen.d.ts.map +1 -1
  463. package/lib/typescript/module/ui/screens/HistoryViewScreen.d.ts.map +1 -1
  464. package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -1
  465. package/lib/typescript/module/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
  466. package/lib/typescript/module/ui/screens/ProfileScreen.d.ts.map +1 -1
  467. package/lib/typescript/module/ui/screens/UserListScreen.d.ts +7 -0
  468. package/lib/typescript/module/ui/screens/UserListScreen.d.ts.map +1 -1
  469. package/lib/typescript/module/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
  470. package/lib/typescript/module/ui/screens/fileManagement/hooks/useFileUploadState.d.ts.map +1 -1
  471. package/lib/typescript/module/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
  472. package/lib/typescript/module/ui/screens/trust/trustTier.d.ts +1 -1
  473. package/lib/typescript/module/ui/screens/trust/trustTier.d.ts.map +1 -1
  474. package/lib/typescript/module/ui/session/backgroundSession.d.ts +42 -0
  475. package/lib/typescript/module/ui/session/backgroundSession.d.ts.map +1 -0
  476. package/lib/typescript/module/ui/session/index.d.ts +1 -0
  477. package/lib/typescript/module/ui/session/index.d.ts.map +1 -1
  478. package/lib/typescript/module/ui/session/useBackgroundSessionSync.d.ts +23 -0
  479. package/lib/typescript/module/ui/session/useBackgroundSessionSync.d.ts.map +1 -0
  480. package/lib/typescript/module/ui/types/navigation.d.ts +27 -19
  481. package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
  482. package/lib/typescript/module/ui/utils/fileManagement.d.ts +5 -5
  483. package/lib/typescript/module/ui/utils/fileManagement.d.ts.map +1 -1
  484. package/lib/typescript/module/ui/utils/netConnectivity.d.ts +17 -0
  485. package/lib/typescript/module/ui/utils/netConnectivity.d.ts.map +1 -0
  486. package/lib/typescript/module/ui/utils/oauthReturn.d.ts +15 -12
  487. package/lib/typescript/module/ui/utils/oauthReturn.d.ts.map +1 -1
  488. package/lib/typescript/module/ui/utils/userUtils.d.ts +7 -14
  489. package/lib/typescript/module/ui/utils/userUtils.d.ts.map +1 -1
  490. package/lib/typescript/types/expo-image-picker.d.ts +35 -0
  491. package/package.json +32 -12
  492. package/src/index.ts +19 -16
  493. package/src/notifications/deviceNotifications.ts +82 -0
  494. package/src/types/expo-image-picker.d.ts +35 -0
  495. package/src/ui/boot/__tests__/coldBootNoIdpRedirect.test.ts +215 -0
  496. package/src/ui/boot/runProviderColdBoot.ts +24 -101
  497. package/src/ui/components/AvatarCameraBadge.tsx +2 -1
  498. package/src/ui/components/FollowButton.tsx +1 -1
  499. package/src/ui/components/OxyAccountDialogScreen.tsx +13 -1
  500. package/src/ui/components/OxyAuthChooser.tsx +31 -20
  501. package/src/ui/components/OxyProvider.tsx +8 -7
  502. package/src/ui/components/OxySignInButton.tsx +2 -1
  503. package/src/ui/components/ProfileButton.tsx +15 -20
  504. package/src/ui/components/authChooser/AccountsMenuView.tsx +66 -57
  505. package/src/ui/components/authChooser/types.ts +6 -0
  506. package/src/ui/components/authChooser/useUsernameAvailability.ts +1 -1
  507. package/src/ui/components/fileManagement/UploadPreview.tsx +1 -1
  508. package/src/ui/components/internal/PinInput.tsx +1 -0
  509. package/src/ui/components/logo/LogoText.tsx +4 -4
  510. package/src/ui/components/payment/PaymentDetailsStep.tsx +1 -1
  511. package/src/ui/components/payment/PaymentSummaryStep.tsx +2 -2
  512. package/src/ui/components/payment/types.ts +24 -24
  513. package/src/ui/components/styles/shadow.tsx +2 -2
  514. package/src/ui/context/OxyContext.tsx +35 -46
  515. package/src/ui/context/__tests__/commitSessionFlow.test.ts +13 -89
  516. package/src/ui/context/commitSessionFlow.ts +3 -61
  517. package/src/ui/context/hooks/useAuthOperations.ts +26 -1
  518. package/src/ui/context/oxyContextTypes.ts +26 -7
  519. package/src/ui/context/useOxyAccountGraph.ts +4 -4
  520. package/src/ui/hooks/mutations/mutationFactory.ts +1 -1
  521. package/src/ui/hooks/mutations/useAccountMutations.ts +1 -1
  522. package/src/ui/hooks/mutations/useServicesMutations.ts +1 -1
  523. package/src/ui/hooks/queries/paymentTypes.ts +3 -2
  524. package/src/ui/hooks/queries/usePaymentQueries.ts +3 -2
  525. package/src/ui/hooks/queries/userCache.ts +169 -148
  526. package/src/ui/hooks/useAssets.ts +1 -1
  527. package/src/ui/hooks/useAsyncAction.ts +3 -3
  528. package/src/ui/hooks/useAuth.ts +12 -6
  529. package/src/ui/hooks/useAvatarPicker.ts +1 -1
  530. package/src/ui/hooks/useOnlineStatus.ts +3 -2
  531. package/src/ui/hooks/useSessionManagement.ts +0 -2
  532. package/src/ui/hooks/useSettingToggle.ts +1 -1
  533. package/src/ui/hooks/useSurfaceHeader.ts +90 -15
  534. package/src/ui/navigation/accountDialogManager.ts +9 -0
  535. package/src/ui/oauth/__tests__/oauthPopup.test.ts +26 -0
  536. package/src/ui/oauth/browserAuthTransport.ts +55 -49
  537. package/src/ui/oauth/oauthPopup.ts +61 -3
  538. package/src/ui/screens/AccountMembersScreen.tsx +1 -1
  539. package/src/ui/screens/AccountSettingsScreen.tsx +45 -17
  540. package/src/ui/screens/AccountVerificationScreen.tsx +1 -1
  541. package/src/ui/screens/AppInfoScreen.tsx +1 -1
  542. package/src/ui/screens/AvatarCropScreen.tsx +1 -1
  543. package/src/ui/screens/ChangeAvatarScreen.tsx +7 -4
  544. package/src/ui/screens/ConnectedAppsScreen.tsx +2 -2
  545. package/src/ui/screens/CreateAccountScreen.tsx +55 -15
  546. package/src/ui/screens/EditProfileFieldScreen.tsx +4 -4
  547. package/src/ui/screens/EditProfileScreen.tsx +6 -3
  548. package/src/ui/screens/FAQScreen.tsx +1 -1
  549. package/src/ui/screens/FeedbackScreen.tsx +741 -575
  550. package/src/ui/screens/FileManagementScreen.tsx +1 -1
  551. package/src/ui/screens/FollowersListScreen.tsx +3 -0
  552. package/src/ui/screens/FollowingListScreen.tsx +3 -0
  553. package/src/ui/screens/HelpSupportScreen.tsx +1 -1
  554. package/src/ui/screens/HistoryViewScreen.tsx +5 -20
  555. package/src/ui/screens/LanguageSelectorScreen.tsx +1 -1
  556. package/src/ui/screens/LegalDocumentsScreen.tsx +1 -1
  557. package/src/ui/screens/ManageAccountScreen.tsx +9 -2
  558. package/src/ui/screens/PremiumSubscriptionScreen.tsx +4 -4
  559. package/src/ui/screens/PrivacySettingsScreen.tsx +15 -12
  560. package/src/ui/screens/ProfileScreen.tsx +24 -6
  561. package/src/ui/screens/SavesCollectionsScreen.tsx +1 -1
  562. package/src/ui/screens/UserListScreen.tsx +18 -8
  563. package/src/ui/screens/WelcomeNewUserScreen.tsx +6 -6
  564. package/src/ui/screens/fileManagement/PhotoPickerSection.tsx +1 -1
  565. package/src/ui/screens/fileManagement/hooks/useFileUploadState.ts +14 -5
  566. package/src/ui/screens/trust/TrustCenterScreen.tsx +2 -2
  567. package/src/ui/screens/trust/TrustLeaderboardScreen.tsx +6 -5
  568. package/src/ui/screens/trust/TrustRewardsScreen.tsx +1 -1
  569. package/src/ui/screens/trust/TrustRulesScreen.tsx +1 -1
  570. package/src/ui/screens/trust/trustTier.ts +1 -1
  571. package/src/ui/session/__tests__/backgroundSession.test.ts +392 -0
  572. package/src/ui/session/backgroundSession.ts +313 -0
  573. package/src/ui/session/index.ts +1 -0
  574. package/src/ui/session/useBackgroundSessionSync.ts +92 -0
  575. package/src/ui/types/navigation.ts +27 -19
  576. package/src/ui/utils/fileManagement.ts +108 -92
  577. package/src/ui/utils/netConnectivity.ts +27 -0
  578. package/src/ui/utils/oauthReturn.ts +23 -33
  579. package/src/ui/utils/userUtils.ts +27 -32
  580. package/lib/commonjs/ui/oauth/legacyRedirectLanes.js +0 -48
  581. package/lib/commonjs/ui/oauth/legacyRedirectLanes.js.map +0 -1
  582. package/lib/commonjs/ui/utils/crossOriginRestore.js +0 -140
  583. package/lib/commonjs/ui/utils/crossOriginRestore.js.map +0 -1
  584. package/lib/module/ui/oauth/legacyRedirectLanes.js +0 -44
  585. package/lib/module/ui/oauth/legacyRedirectLanes.js.map +0 -1
  586. package/lib/module/ui/utils/crossOriginRestore.js +0 -131
  587. package/lib/module/ui/utils/crossOriginRestore.js.map +0 -1
  588. package/lib/typescript/commonjs/ui/oauth/legacyRedirectLanes.d.ts +0 -40
  589. package/lib/typescript/commonjs/ui/oauth/legacyRedirectLanes.d.ts.map +0 -1
  590. package/lib/typescript/commonjs/ui/utils/crossOriginRestore.d.ts +0 -43
  591. package/lib/typescript/commonjs/ui/utils/crossOriginRestore.d.ts.map +0 -1
  592. package/lib/typescript/module/ui/oauth/legacyRedirectLanes.d.ts +0 -40
  593. package/lib/typescript/module/ui/oauth/legacyRedirectLanes.d.ts.map +0 -1
  594. package/lib/typescript/module/ui/utils/crossOriginRestore.d.ts +0 -43
  595. package/lib/typescript/module/ui/utils/crossOriginRestore.d.ts.map +0 -1
  596. package/src/ui/boot/__tests__/coldBootWebAuthMode.test.ts +0 -281
  597. package/src/ui/oauth/legacyRedirectLanes.ts +0 -43
  598. package/src/ui/utils/__tests__/crossOriginRestore.test.ts +0 -143
  599. package/src/ui/utils/crossOriginRestore.ts +0 -169
@@ -0,0 +1,258 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.clearBackgroundSession = clearBackgroundSession;
7
+ exports.isBackgroundSessionSupported = isBackgroundSessionSupported;
8
+ exports.syncBackgroundSession = syncBackgroundSession;
9
+ var _expoModulesCore = require("expo-modules-core");
10
+ var _reactNative = require("react-native");
11
+ var _core = require("@oxyhq/core");
12
+ /**
13
+ * The JS half of the native background session credential.
14
+ *
15
+ * A home-screen widget or a sync job refreshes while the app process is dead:
16
+ * there is no JS runtime, so it cannot go through this SDK's normal session lane
17
+ * at all. Native code needs its own way to obtain a bearer, and this module is
18
+ * what gives it one — while the app runs, it provisions a purpose-built
19
+ * credential and hands it to the native store that `so.oxy.session.OxyBackgroundSession`
20
+ * reads.
21
+ *
22
+ * ## Why a separate credential rather than the device secret
23
+ *
24
+ * `POST /session/device/token` ROTATES the device secret on every mint, and the
25
+ * presented secret dies 60 seconds later. Native code minting with it would be a
26
+ * second writer to the value this SDK's whole session depends on — and since
27
+ * `createNativeAuthStateStore` serves JS from an in-process mirror that never
28
+ * re-reads storage, JS would be blind to that rotation. A worker killed between
29
+ * the server's rotation and its local write would sign the user out of the app.
30
+ * A credential that nobody rotates removes that failure mode instead of managing
31
+ * it.
32
+ *
33
+ * ## What this does NOT do
34
+ *
35
+ * It never reads or writes `oxy.auth.v1` / expo-secure-store. The two credentials
36
+ * live in different stores with one writer each, so there is nothing to keep in
37
+ * lockstep and no state that can disagree.
38
+ *
39
+ * ## Android only, and web is refused rather than merely unsupported
40
+ *
41
+ * Web is gated off by an explicit platform check, not by the native module being
42
+ * absent — provisioning in a browser origin would be a security downgrade, so it
43
+ * must not depend on an incidental fact. See {@link loadNativeModule}. iOS has no
44
+ * implementation yet and resolves to no module, so every function here degrades to
45
+ * a no-op: an app can enable this and lose nothing on other platforms.
46
+ */
47
+
48
+ /**
49
+ * The native module's surface. Deliberately write-mostly: there is no `get`,
50
+ * because JS has no use for the secret it just wrote and keeping native as the
51
+ * secret's only reader is one less place it can leak from.
52
+ */
53
+
54
+ /**
55
+ * Re-provision once the remaining lifetime drops below this.
56
+ *
57
+ * The server issues a 30-day credential; renewing with a week to spare means an
58
+ * app opened even occasionally always holds a live one, while an app left unopened
59
+ * for a month lets it lapse — which is the intended outcome, not a failure.
60
+ */
61
+ const RENEW_WHEN_REMAINING_MS = 7 * 24 * 60 * 60 * 1000;
62
+ let nativeModule;
63
+
64
+ /**
65
+ * Resolve the native module once — and refuse outright on web.
66
+ *
67
+ * ## Web is excluded on purpose, and not merely because the module is absent
68
+ *
69
+ * The credential is deliberately NON-ROTATING and long-lived, which is safe only
70
+ * because native background code is its sole consumer and nobody rotates it. A
71
+ * browser origin already holds the ROTATING `deviceSecret`, and it has no
72
+ * background worker to serve — so provisioning there would add a strictly weaker
73
+ * long-lived secret alongside a stronger short-lived one. That is a downgrade, not
74
+ * a harmless no-op, and the harm lands at the PROVISION CALL (which mints a live
75
+ * server-side credential) regardless of whether anything manages to store it.
76
+ *
77
+ * That property must not rest on `requireOptionalNativeModule` happening to return
78
+ * `null` on web. It does today — the module is registered for android only — but
79
+ * that is an incidental fact a future web shim or a web-build native-module mock
80
+ * would quietly reverse. So the platform is checked FIRST, before we even ask the
81
+ * registry, and every entry point in this module inherits the gate.
82
+ *
83
+ * (A pre-deploy server makes this visible too: oxy-api's `sessionDevice` router
84
+ * applies `requireSameSiteOrigin` path-agnostically, so an unmatched path answers
85
+ * `404` to a native caller but `403 BAD_ORIGIN` to a browser one. Core's degrade is
86
+ * deliberately narrow — `404 → null` only — because a real origin misconfiguration
87
+ * on a CURRENT server also returns 403, and swallowing that would hide a genuine
88
+ * bug. Platform gating belongs here, where the platform is actually known.)
89
+ *
90
+ * `requireOptionalNativeModule` (a static import Metro always resolves) rather
91
+ * than a dynamic `import(moduleName)`: the latter compiles to `require(variable)`
92
+ * in the CJS build, which Metro cannot resolve inside a consuming app — it
93
+ * silently returned `null` there, which is exactly how the cross-app SSO bridge
94
+ * broke once. Same reasoning as `loadSharedIdentityBridge` in `@oxyhq/protocol`.
95
+ */
96
+ function loadNativeModule() {
97
+ if (nativeModule === undefined) {
98
+ if (_reactNative.Platform.OS === 'web') {
99
+ nativeModule = null;
100
+ return nativeModule;
101
+ }
102
+ const native = (0, _expoModulesCore.requireOptionalNativeModule)('OxyBackgroundSession');
103
+ nativeModule = native && typeof native.put === 'function' && typeof native.clear === 'function' && typeof native.peek === 'function' ? {
104
+ put: native.put.bind(native),
105
+ clear: native.clear.bind(native),
106
+ peek: native.peek.bind(native)
107
+ } : null;
108
+ }
109
+ return nativeModule;
110
+ }
111
+
112
+ /** Whether this platform/app can hold a background credential at all. */
113
+ function isBackgroundSessionSupported() {
114
+ return loadNativeModule() !== null;
115
+ }
116
+
117
+ /**
118
+ * Drop the stored credential. No-op where unsupported, and never throws.
119
+ *
120
+ * Called on sign-out and BEFORE an account switch's network work, so the window
121
+ * in which background code could still serve the previous account is as short as
122
+ * one local write.
123
+ */
124
+ async function clearBackgroundSession() {
125
+ const native = loadNativeModule();
126
+ if (!native) {
127
+ return;
128
+ }
129
+ try {
130
+ await native.clear();
131
+ } catch (error) {
132
+ _core.logger.warn('[backgroundSession] could not clear the native background credential', {
133
+ component: 'backgroundSession',
134
+ error
135
+ });
136
+ }
137
+ }
138
+ /**
139
+ * Fail LOUDLY when the installed `@oxyhq/core` predates
140
+ * `provisionBackgroundCredential`.
141
+ *
142
+ * This is the one failure here that is a build/dependency mistake rather than a
143
+ * runtime condition, and it is the one that must never be quiet. Everything else
144
+ * in `syncBackgroundSession` is caught and logged at warn, which is right for a
145
+ * flaky network — but applying that to a version skew would leave background
146
+ * refreshes permanently non-functional behind a warning nobody reads. So this
147
+ * throws, and logs at ERROR first so it is still visible in a release build whose
148
+ * rejection handler is silent.
149
+ *
150
+ * Reachable only through a runtime skew: the declared `@oxyhq/core` range covers
151
+ * the method, so a correctly-resolved install cannot get here, and TypeScript
152
+ * rules it out at compile time.
153
+ */
154
+ function assertProvisioningAvailable(oxyServices) {
155
+ if (typeof oxyServices.provisionBackgroundCredential === 'function') {
156
+ return;
157
+ }
158
+ const message = '[backgroundSession] the installed @oxyhq/core has no provisionBackgroundCredential, ' + 'so no background credential can be provisioned and native background refreshes will ' + 'never authenticate. Install a @oxyhq/core that satisfies this package\'s declared range.';
159
+ _core.logger.error(message, undefined, {
160
+ component: 'backgroundSession'
161
+ });
162
+ throw new Error(message);
163
+ }
164
+
165
+ /**
166
+ * Bring the native credential in line with the session JS currently holds.
167
+ *
168
+ * Ordering is the load-bearing part: a credential belonging to a DIFFERENT
169
+ * account is cleared before any network call, so a crash mid-provision leaves
170
+ * background code signed out rather than serving the previous account's data
171
+ * under the new account's name. The server enforces the same rule independently
172
+ * (a mint is re-authorized against the live device session, and against its ACTIVE
173
+ * account), so this is the fast local half of a belt-and-braces pair, not the only
174
+ * guard.
175
+ *
176
+ * Throws for exactly one thing — a `@oxyhq/core` too old to provision (see
177
+ * {@link assertProvisioningAvailable}). Every other failure is caught and logged:
178
+ * a background credential is an enhancement, and failing to provision one must
179
+ * not disturb the session that is working.
180
+ */
181
+ async function syncBackgroundSession(input) {
182
+ const native = loadNativeModule();
183
+ if (!native) {
184
+ return;
185
+ }
186
+ const {
187
+ oxyServices,
188
+ userId,
189
+ canUsePrivateApi,
190
+ isCurrent
191
+ } = input;
192
+
193
+ // Before the try, so the catch below cannot turn a dependency skew into a
194
+ // warning. Signed-out is exempt: clearing needs no core method, and a sign-out
195
+ // must never be blocked by one.
196
+ if (userId) {
197
+ assertProvisioningAvailable(oxyServices);
198
+ }
199
+ try {
200
+ if (!userId) {
201
+ // Signed out. Local-only, so it works with no bearer and no network.
202
+ await native.clear();
203
+ return;
204
+ }
205
+ const stored = await native.peek();
206
+ if (stored && stored.accountId !== userId) {
207
+ // Identity changed under a live credential — clear FIRST, provision after.
208
+ await native.clear();
209
+ }
210
+ const isForCurrentAccount = stored?.accountId === userId;
211
+ const hasLifeLeft = isForCurrentAccount && stored.expiresAt - Date.now() > RENEW_WHEN_REMAINING_MS;
212
+ if (hasLifeLeft) {
213
+ return;
214
+ }
215
+
216
+ // Everything below needs a bearer. Without one yet (cold boot still
217
+ // resolving) there is nothing to do but wait for the next run — the token
218
+ // landing re-triggers this.
219
+ if (!canUsePrivateApi || !isCurrent()) {
220
+ return;
221
+ }
222
+ const provisioned = await oxyServices.provisionBackgroundCredential();
223
+ if (!provisioned) {
224
+ // `null` means the endpoint is not deployed yet. Expected during the
225
+ // rollout window (api leads the SDK) and deliberately quiet.
226
+ return;
227
+ }
228
+ if (!isCurrent()) {
229
+ return;
230
+ }
231
+ if (provisioned.accountId !== userId) {
232
+ // The active account moved while the request was in flight, so this
233
+ // credential is already for the wrong account. Drop it; the next run
234
+ // provisions for the account that is actually signed in.
235
+ await native.clear();
236
+ return;
237
+ }
238
+ const expiresAt = Date.parse(provisioned.expiresAt);
239
+ if (!Number.isFinite(expiresAt)) {
240
+ _core.logger.warn('[backgroundSession] server returned an unparseable credential expiry', {
241
+ component: 'backgroundSession'
242
+ });
243
+ return;
244
+ }
245
+ const persisted = await native.put(oxyServices.getBaseURL(), provisioned.deviceId, provisioned.secret, provisioned.accountId, expiresAt);
246
+ if (!persisted) {
247
+ _core.logger.warn('[backgroundSession] the native store did not retain the background credential; background refreshes stay signed out until the next attempt', {
248
+ component: 'backgroundSession'
249
+ });
250
+ }
251
+ } catch (error) {
252
+ _core.logger.warn('[backgroundSession] could not sync the native background credential', {
253
+ component: 'backgroundSession',
254
+ error
255
+ });
256
+ }
257
+ }
258
+ //# sourceMappingURL=backgroundSession.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_expoModulesCore","require","_reactNative","_core","RENEW_WHEN_REMAINING_MS","nativeModule","loadNativeModule","undefined","Platform","OS","native","requireOptionalNativeModule","put","clear","peek","bind","isBackgroundSessionSupported","clearBackgroundSession","error","logger","warn","component","assertProvisioningAvailable","oxyServices","provisionBackgroundCredential","message","Error","syncBackgroundSession","input","userId","canUsePrivateApi","isCurrent","stored","accountId","isForCurrentAccount","hasLifeLeft","expiresAt","Date","now","provisioned","parse","Number","isFinite","persisted","getBaseURL","deviceId","secret"],"sourceRoot":"../../../../src","sources":["ui/session/backgroundSession.ts"],"mappings":";;;;;;;;AAmCA,IAAAA,gBAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,KAAA,GAAAF,OAAA;AAtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;;AA+BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,uBAAuB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;AAEvD,IAAIC,YAAiE;;AAErE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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ACL,gBAAgB,IAAI,CAACC,SAAS,CAAC,CAAC,EAAE;MACrC;IACF;IAEA,MAAMQ,WAAW,GAAG,MAAMhB,WAAW,CAACC,6BAA6B,CAAC,CAAC;IACrE,IAAI,CAACe,WAAW,EAAE;MAChB;MACA;MACA;IACF;IACA,IAAI,CAACR,SAAS,CAAC,CAAC,EAAE;MAChB;IACF;IACA,IAAIQ,WAAW,CAACN,SAAS,KAAKJ,MAAM,EAAE;MACpC;MACA;MACA;MACA,MAAMnB,MAAM,CAACG,KAAK,CAAC,CAAC;MACpB;IACF;IAEA,MAAMuB,SAAS,GAAGC,IAAI,CAACG,KAAK,CAACD,WAAW,CAACH,SAAS,CAAC;IACnD,IAAI,CAACK,MAAM,CAACC,QAAQ,CAACN,SAAS,CAAC,EAAE;MAC/BjB,YAAM,CAACC,IAAI,CAAC,sEAAsE,EAAE;QAClFC,SAAS,EAAE;MACb,CAAC,CAAC;MACF;IACF;IAEA,MAAMsB,SAAS,GAAG,MAAMjC,MAAM,CAACE,GAAG,CAChCW,WAAW,CAACqB,UAAU,CAAC,CAAC,EACxBL,WAAW,CAACM,QAAQ,EACpBN,WAAW,CAACO,MAAM,EAClBP,WAAW,CAACN,SAAS,EACrBG,SACF,CAAC;IACD,IAAI,CAACO,SAAS,EAAE;MACdxB,YAAM,CAACC,IAAI,CACT,4IAA4I,EAC5I;QAAEC,SAAS,EAAE;MAAoB,CACnC,CAAC;IACH;EACF,CAAC,CAAC,OAAOH,KAAK,EAAE;IACdC,YAAM,CAACC,IAAI,CAAC,qEAAqE,EAAE;MACjFC,SAAS,EAAE,mBAAmB;MAC9BH;IACF,CAAC,CAAC;EACJ;AACF","ignoreList":[]}
@@ -63,9 +63,16 @@ Object.defineProperty(exports, "deviceStateToClientSessions", {
63
63
  return _core.deviceStateToClientSessions;
64
64
  }
65
65
  });
66
+ Object.defineProperty(exports, "useBackgroundSessionSync", {
67
+ enumerable: true,
68
+ get: function () {
69
+ return _useBackgroundSessionSync.useBackgroundSessionSync;
70
+ }
71
+ });
66
72
  var _createSessionClient = require("./createSessionClient.js");
67
73
  var _tokenTransport = require("./tokenTransport.js");
68
74
  var _authStore = require("./authStore.js");
75
+ var _useBackgroundSessionSync = require("./useBackgroundSessionSync.js");
69
76
  var _identityBinding = require("./identityBinding.js");
70
77
  var _core = require("@oxyhq/core");
71
78
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_createSessionClient","require","_tokenTransport","_authStore","_identityBinding","_core"],"sourceRoot":"../../../../src","sources":["ui/session/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,IAAAA,oBAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AAEA,IAAAI,KAAA,GAAAJ,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["_createSessionClient","require","_tokenTransport","_authStore","_useBackgroundSessionSync","_identityBinding","_core"],"sourceRoot":"../../../../src","sources":["ui/session/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,IAAAA,oBAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,yBAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AAEA,IAAAK,KAAA,GAAAL,OAAA","ignoreList":[]}
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useBackgroundSessionSync = useBackgroundSessionSync;
7
+ var _react = require("react");
8
+ var _reactNative = require("react-native");
9
+ var _backgroundSession = require("./backgroundSession.js");
10
+ /**
11
+ * Keeps the native background credential in step with the session, so an app
12
+ * enables background authentication with one prop and writes no session code of
13
+ * its own.
14
+ *
15
+ * See `./backgroundSession` for what the credential is and why it is separate
16
+ * from the rotating device secret.
17
+ */
18
+
19
+ /**
20
+ * An effect is the right shape here, unusually for this codebase: the work is a
21
+ * side effect on native storage, and it has to react both to an identity change
22
+ * (a value) and to the app being foregrounded (a subscription). There is no
23
+ * derived-state or React Query formulation of "write a credential to the
24
+ * keystore when the user changes or the app comes back".
25
+ *
26
+ * Re-runs on identity change, which is what makes sign-out and account switching
27
+ * work: `syncBackgroundSession` clears a credential belonging to anyone other
28
+ * than `userId` before it does any network work.
29
+ */
30
+ function useBackgroundSessionSync({
31
+ enabled,
32
+ oxyServices,
33
+ userId,
34
+ canUsePrivateApi
35
+ }) {
36
+ (0, _react.useEffect)(() => {
37
+ if (!(0, _backgroundSession.isBackgroundSessionSupported)()) {
38
+ return;
39
+ }
40
+ if (!enabled) {
41
+ // An app that leaves the feature off must not keep a credential THIS app
42
+ // provisioned earlier. The store is package-scoped (see
43
+ // OxyBackgroundSessionStore), so this cannot revoke a sibling Oxy app's
44
+ // credential under the shared UID.
45
+ void (0, _backgroundSession.clearBackgroundSession)();
46
+ return;
47
+ }
48
+
49
+ // A run that is superseded (unmount, or another identity change) must not
50
+ // write the credential it was about to write.
51
+ let current = true;
52
+ // Deliberately NOT caught. `syncBackgroundSession` already handles every
53
+ // runtime failure internally and throws for exactly one thing: an installed
54
+ // `@oxyhq/core` too old to provision. That is a dependency mistake which must
55
+ // surface, so it is allowed to reject — adding a `.catch()` here would put it
56
+ // back behind the silence it was moved out of.
57
+ const run = () => {
58
+ void (0, _backgroundSession.syncBackgroundSession)({
59
+ oxyServices,
60
+ userId,
61
+ canUsePrivateApi,
62
+ isCurrent: () => current
63
+ });
64
+ };
65
+ run();
66
+ const subscription = _reactNative.AppState.addEventListener('change', state => {
67
+ if (state === 'active') {
68
+ run();
69
+ }
70
+ });
71
+ return () => {
72
+ current = false;
73
+ subscription.remove();
74
+ // Deliberately NOT clearing here. Unmount is the app closing, which is
75
+ // precisely when the credential has to survive — clearing on teardown
76
+ // would defeat the entire feature. Revocation happens on sign-out (via a
77
+ // `userId` of null), on the server, or when the credential expires.
78
+ };
79
+ }, [enabled, oxyServices, userId, canUsePrivateApi]);
80
+ }
81
+ //# sourceMappingURL=useBackgroundSessionSync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNative","_backgroundSession","useBackgroundSessionSync","enabled","oxyServices","userId","canUsePrivateApi","useEffect","isBackgroundSessionSupported","clearBackgroundSession","current","run","syncBackgroundSession","isCurrent","subscription","AppState","addEventListener","state","remove"],"sourceRoot":"../../../../src","sources":["ui/session/useBackgroundSessionSync.ts"],"mappings":";;;;;;AAQA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,kBAAA,GAAAF,OAAA;AAXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAoBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,wBAAwBA,CAAC;EACvCC,OAAO;EACPC,WAAW;EACXC,MAAM;EACNC;AAC6B,CAAC,EAAQ;EACtC,IAAAC,gBAAS,EAAC,MAAM;IACd,IAAI,CAAC,IAAAC,+CAA4B,EAAC,CAAC,EAAE;MACnC;IACF;IAEA,IAAI,CAACL,OAAO,EAAE;MACZ;MACA;MACA;MACA;MACA,KAAK,IAAAM,yCAAsB,EAAC,CAAC;MAC7B;IACF;;IAEA;IACA;IACA,IAAIC,OAAO,GAAG,IAAI;IAClB;IACA;IACA;IACA;IACA;IACA,MAAMC,GAAG,GAAGA,CAAA,KAAM;MAChB,KAAK,IAAAC,wCAAqB,EAAC;QACzBR,WAAW;QACXC,MAAM;QACNC,gBAAgB;QAChBO,SAAS,EAAEA,CAAA,KAAMH;MACnB,CAAC,CAAC;IACJ,CAAC;IAEDC,GAAG,CAAC,CAAC;IACL,MAAMG,YAAY,GAAGC,qBAAQ,CAACC,gBAAgB,CAAC,QAAQ,EAAGC,KAAK,IAAK;MAClE,IAAIA,KAAK,KAAK,QAAQ,EAAE;QACtBN,GAAG,CAAC,CAAC;MACP;IACF,CAAC,CAAC;IAEF,OAAO,MAAM;MACXD,OAAO,GAAG,KAAK;MACfI,YAAY,CAACI,MAAM,CAAC,CAAC;MACrB;MACA;MACA;MACA;IACF,CAAC;EACH,CAAC,EAAE,CAACf,OAAO,EAAEC,WAAW,EAAEC,MAAM,EAAEC,gBAAgB,CAAC,CAAC;AACtD","ignoreList":[]}
@@ -26,11 +26,11 @@ var _reactNative = require("react-native");
26
26
  * (carries a URI but is not a real DOM `File` / `Blob` instance).
27
27
  */
28
28
  function isRNFileDescriptor(input) {
29
- if (!input || typeof input !== 'object') return false;
29
+ if (!input || typeof input !== "object") return false;
30
30
  const obj = input;
31
- if (typeof obj.uri !== 'string') return false;
32
- if (typeof File !== 'undefined' && input instanceof File) return false;
33
- if (typeof Blob !== 'undefined' && input instanceof Blob) return false;
31
+ if (typeof obj.uri !== "string") return false;
32
+ if (typeof File !== "undefined" && input instanceof File) return false;
33
+ if (typeof Blob !== "undefined" && input instanceof Blob) return false;
34
34
  return true;
35
35
  }
36
36
 
@@ -38,9 +38,9 @@ function isRNFileDescriptor(input) {
38
38
  * Format file size in bytes to human-readable string
39
39
  */
40
40
  function formatFileSize(bytes) {
41
- if (bytes === 0) return '0 Bytes';
41
+ if (bytes === 0) return "0 Bytes";
42
42
  const k = 1024;
43
- const sizes = ['Bytes', 'KB', 'MB', 'GB'];
43
+ const sizes = ["Bytes", "KB", "MB", "GB"];
44
44
  const i = Math.floor(Math.log(bytes) / Math.log(k));
45
45
  return `${Number.parseFloat((bytes / k ** i).toFixed(2))} ${sizes[i]}`;
46
46
  }
@@ -49,14 +49,14 @@ function formatFileSize(bytes) {
49
49
  * Get icon name for file based on content type
50
50
  */
51
51
  function getFileIcon(contentType) {
52
- if (contentType.startsWith('image/')) return 'image';
53
- if (contentType.startsWith('video/')) return 'videocam';
54
- if (contentType.startsWith('audio/')) return 'musical-notes';
55
- if (contentType.includes('pdf')) return 'document-text';
56
- if (contentType.includes('word') || contentType.includes('doc')) return 'document';
57
- if (contentType.includes('excel') || contentType.includes('sheet')) return 'grid';
58
- if (contentType.includes('zip') || contentType.includes('archive')) return 'archive';
59
- return 'document-outline';
52
+ if (contentType.startsWith("image/")) return "image";
53
+ if (contentType.startsWith("video/")) return "videocam";
54
+ if (contentType.startsWith("audio/")) return "musical-notes";
55
+ if (contentType.includes("pdf")) return "document-text";
56
+ if (contentType.includes("word") || contentType.includes("doc")) return "document";
57
+ if (contentType.includes("excel") || contentType.includes("sheet")) return "grid";
58
+ if (contentType.includes("zip") || contentType.includes("archive")) return "archive";
59
+ return "document-outline";
60
60
  }
61
61
 
62
62
  /**
@@ -73,18 +73,18 @@ function getFileIcon(contentType) {
73
73
  */
74
74
  async function convertDocumentPickerAssetToFile(doc, index) {
75
75
  const fileName = doc.name || `file-${index + 1}`;
76
- const fileType = doc.mimeType || 'application/octet-stream';
76
+ const fileType = doc.mimeType || "application/octet-stream";
77
77
 
78
78
  // React Native path — return the descriptor as-is. FormData handles it.
79
- if (_reactNative.Platform.OS !== 'web') {
79
+ if (_reactNative.Platform.OS !== "web") {
80
80
  if (!doc.uri) {
81
- throw new Error('Missing file data (no uri property)');
81
+ throw new Error("Missing file data (no uri property)");
82
82
  }
83
83
  return {
84
84
  uri: doc.uri,
85
85
  type: fileType,
86
86
  name: fileName,
87
- size: typeof doc.size === 'number' ? doc.size : undefined
87
+ size: typeof doc.size === "number" ? doc.size : undefined
88
88
  };
89
89
  }
90
90
  try {
@@ -92,7 +92,7 @@ async function convertDocumentPickerAssetToFile(doc, index) {
92
92
 
93
93
  // Priority 1: Use doc.file if available (web native File API).
94
94
  // This is the most efficient path as it doesn't require fetching.
95
- if (doc.file && typeof globalThis.File !== 'undefined' && doc.file instanceof globalThis.File) {
95
+ if (doc.file && typeof globalThis.File !== "undefined" && doc.file instanceof globalThis.File) {
96
96
  file = doc.file;
97
97
  // Ensure file has required properties
98
98
  if (!file.name && doc.name) {
@@ -116,22 +116,22 @@ async function convertDocumentPickerAssetToFile(doc, index) {
116
116
  throw new Error(`Failed to fetch file: ${response.statusText}`);
117
117
  }
118
118
  const blob = await response.blob();
119
- const resolvedType = doc.mimeType || blob.type || 'application/octet-stream';
119
+ const resolvedType = doc.mimeType || blob.type || "application/octet-stream";
120
120
  file = new globalThis.File([blob], fileName, {
121
121
  type: resolvedType
122
122
  });
123
123
  file.uri = doc.uri;
124
124
  return file;
125
125
  } catch (error) {
126
- console.error('Failed to read file from URI:', error);
127
- throw new Error(`Failed to load file: ${(error instanceof Error ? error.message : null) || 'Unknown error'}`);
126
+ console.error("Failed to read file from URI:", error);
127
+ throw new Error(`Failed to load file: ${(error instanceof Error ? error.message : null) || "Unknown error"}`);
128
128
  }
129
129
  }
130
130
 
131
131
  // No file or URI available - this shouldn't happen with Expo 54
132
- throw new Error('Missing file data (no file or uri property)');
132
+ throw new Error("Missing file data (no file or uri property)");
133
133
  } catch (error) {
134
- console.error('Error converting document to file:', error);
134
+ console.error("Error converting document to file:", error);
135
135
  throw error;
136
136
  }
137
137
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","isRNFileDescriptor","input","obj","uri","File","Blob","formatFileSize","bytes","k","sizes","i","Math","floor","log","Number","parseFloat","toFixed","getFileIcon","contentType","startsWith","includes","convertDocumentPickerAssetToFile","doc","index","fileName","name","fileType","mimeType","Platform","OS","Error","type","size","undefined","file","globalThis","response","fetch","ok","statusText","blob","resolvedType","error","console","message","uploadFileRaw","userId","oxyServices","visibility","uploadRawFile"],"sourceRoot":"../../../../src","sources":["ui/utils/fileManagement.ts"],"mappings":";;;;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;AACO,SAASC,kBAAkBA,CAACC,KAAc,EAA6B;EAC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,CAAC,6CAA6C,CAAC;EAClE,CAAC,CAAC,OAAOY,KAAc,EAAE;IACrBC,OAAO,CAACD,KAAK,CAAC,oCAAoC,EAAEA,KAAK,CAAC;IAC1D,MAAMA,KAAK;EACf;AACJ;;AAEA;AACA;AACA;AACO,eAAeG,aAAaA,CAC/BX,IAAsB,EACtBY,MAAc;AACd;AACAC,WAAgB,EAChBC,UAA8C,EAChD;EACE,OAAO,MAAMD,WAAW,CAACE,aAAa,CAACf,IAAI,EAAEc,UAAU,CAAC;AAC5D","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","isRNFileDescriptor","input","obj","uri","File","Blob","formatFileSize","bytes","k","sizes","i","Math","floor","log","Number","parseFloat","toFixed","getFileIcon","contentType","startsWith","includes","convertDocumentPickerAssetToFile","doc","index","fileName","name","fileType","mimeType","Platform","OS","Error","type","size","undefined","file","globalThis","response","fetch","ok","statusText","blob","resolvedType","error","console","message","uploadFileRaw","userId","oxyServices","visibility","uploadRawFile"],"sourceRoot":"../../../../src","sources":["ui/utils/fileManagement.ts"],"mappings":";;;;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;AACO,SAASC,kBAAkBA,CAACC,KAAc,EAA6B;EAC7E,IAAI,CAACA,KAAK,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE,OAAO,KAAK;EACrD,MAAMC,GAAG,GAAGD,KAAgC;EAC5C,IAAI,OAAOC,GAAG,CAACC,GAAG,KAAK,QAAQ,EAAE,OAAO,KAAK;EAC7C,IAAI,OAAOC,IAAI,KAAK,WAAW,IAAIH,KAAK,YAAYG,IAAI,EAAE,OAAO,KAAK;EACtE,IAAI,OAAOC,IAAI,KAAK,WAAW,IAAIJ,KAAK,YAAYI,IAAI,EAAE,OAAO,KAAK;EACtE,OAAO,IAAI;AACZ;;AAEA;AACA;AACA;AACO,SAASC,cAAcA,CAACC,KAAa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true
5
+ });
6
+ exports.isNetConnectivityExplicitlyOffline = isNetConnectivityExplicitlyOffline;
7
+ exports.isNetConnectivityOnline = isNetConnectivityOnline;
8
+ /**
9
+ * Mirrors Bloom `ConnectionStatusToasts` reachability semantics: a link that
10
+ * reports connected but explicitly unreachable (captive portal, no route) counts
11
+ * as offline.
12
+ */
13
+ function isNetConnectivityOnline(state) {
14
+ return Boolean(state.isConnected && state.isInternetReachable !== false);
15
+ }
16
+
17
+ /**
18
+ * Conservative offline verdict for boot-path probes. Unknown / probing states
19
+ * (`null`, timed-out fetch) resolve to "not offline" so a flaky probe never
20
+ * skips a real sign-in.
21
+ */
22
+ function isNetConnectivityExplicitlyOffline(state) {
23
+ if (!state) return false;
24
+ if (state.isConnected === false) return true;
25
+ if (state.isConnected === true && state.isInternetReachable === false) return true;
26
+ return false;
27
+ }
28
+ //# sourceMappingURL=netConnectivity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["isNetConnectivityOnline","state","Boolean","isConnected","isInternetReachable","isNetConnectivityExplicitlyOffline"],"sourceRoot":"../../../../src","sources":["ui/utils/netConnectivity.ts"],"mappings":";;;;;;;AAKA;AACA;AACA;AACA;AACA;AACO,SAASA,uBAAuBA,CAACC,KAAuB,EAAW;EACxE,OAAOC,OAAO,CAACD,KAAK,CAACE,WAAW,IAAIF,KAAK,CAACG,mBAAmB,KAAK,KAAK,CAAC;AAC1E;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASC,kCAAkCA,CAChDJ,KAA0C,EACjC;EACT,IAAI,CAACA,KAAK,EAAE,OAAO,KAAK;EACxB,IAAIA,KAAK,CAACE,WAAW,KAAK,KAAK,EAAE,OAAO,IAAI;EAC5C,IAAIF,KAAK,CAACE,WAAW,KAAK,IAAI,IAAIF,KAAK,CAACG,mBAAmB,KAAK,KAAK,EAAE,OAAO,IAAI;EAClF,OAAO,KAAK;AACd","ignoreList":[]}
@@ -3,7 +3,6 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.consumeHubSyncFailure = consumeHubSyncFailure;
7
6
  exports.replaceUrlAfterOAuthReturn = replaceUrlAfterOAuthReturn;
8
7
  exports.tryCompleteOAuthReturn = tryCompleteOAuthReturn;
9
8
  var _core = require("@oxyhq/core");
@@ -13,12 +12,21 @@ var _isWebBrowser = require("./isWebBrowser.js");
13
12
  * When the RP lands with `?code=` after signing in at auth.oxy.so, exchange the
14
13
  * code for a device-first session before cold boot runs.
15
14
  *
16
- * This is the REDIRECT transport's return leg. It owns only what is specific to
17
- * a full-page round trip reading the code off the URL, recovering the
18
- * handshake `sessionStorage` carried across the navigation, and cleaning both up
19
- * afterwards and delegates state validation, the PKCE exchange, and the
20
- * session commit to `completeOAuthCode`, the same function the popup transport
21
- * runs.
15
+ * This is the REDIRECT transport's return leg. The SDK never starts a full-page
16
+ * authorize navigation on its own any more (#691 phase 7b), but this lane is
17
+ * still load-bearing: a browser-BLOCKED sign-in popup falls back to a full-page
18
+ * redirect (`startWebOAuthSignIn`), and that redirect comes back here.
19
+ *
20
+ * It owns only what is specific to a full-page round trip — reading the code off
21
+ * the URL, recovering the handshake `sessionStorage` carried across the
22
+ * navigation, and cleaning both up afterwards — and delegates state validation,
23
+ * the PKCE exchange, and the session commit to `completeOAuthCode`, the same
24
+ * function the popup transport runs.
25
+ *
26
+ * It is also the SINGLE cleanup path for an OAuth `error` landing on the URL:
27
+ * any `?error=…` (including an `error=login_required` left over from the
28
+ * now-deleted silent restore) is stripped along with `state` /
29
+ * `error_description`, and the stale PKCE handshake is cleared.
22
30
  */
23
31
  async function tryCompleteOAuthReturn(opts) {
24
32
  if (!(0, _isWebBrowser.isWebBrowser)()) return false;
@@ -42,13 +50,15 @@ async function tryCompleteOAuthReturn(opts) {
42
50
  (0, _core.clearOAuthHandshake)();
43
51
  return false;
44
52
  }
53
+ const handshake = (0, _core.readOAuthHandshake)();
54
+ const redirectUri = (0, _core.canonicalizeOAuthRedirectUri)(handshake?.redirectUri ?? opts.authRedirectUri ?? location.origin);
45
55
  const result = await (0, _completeOAuthCode.completeOAuthCode)({
46
56
  oxyServices: opts.oxyServices,
47
57
  clientId,
48
58
  code,
49
59
  returnedState: params.get('state'),
50
- handshake: (0, _core.readOAuthHandshake)(),
51
- redirectUri: (0, _core.normalizeOAuthRedirectUri)(opts.authRedirectUri ?? location.origin),
60
+ handshake,
61
+ redirectUri,
52
62
  commitSession: opts.commitSession,
53
63
  // Strip the params before the commit so a stale `?code=` cannot re-enter the
54
64
  // exchange loop, and read the return path FIRST — clearOAuthHandshake drops
@@ -111,27 +121,6 @@ function stripOAuthParamsFromUrl() {
111
121
  url.searchParams.delete('state');
112
122
  url.searchParams.delete('error');
113
123
  url.searchParams.delete('error_description');
114
- url.searchParams.delete('hub_sync');
115
- replaceUrlAfterOAuthReturn(`${url.pathname}${url.search}${url.hash}`);
116
- }
117
-
118
- /**
119
- * When auth.oxy.so hub-sync redeem fails, the IdP redirects back with
120
- * `?hub_sync=failed`. Strip the param and log so cold boot can continue
121
- * without leaving a stale query string.
122
- */
123
- function consumeHubSyncFailure() {
124
- if (!(0, _isWebBrowser.isWebBrowser)()) return false;
125
- const location = globalThis.location;
126
- if (!location) return false;
127
- const params = new URLSearchParams(location.search);
128
- if (params.get('hub_sync') !== 'failed') return false;
129
- _core.logger.warn('Hub sync failed — IdP device session may be out of sync', {
130
- component: 'hubSync'
131
- });
132
- const url = new URL(location.href);
133
- url.searchParams.delete('hub_sync');
134
124
  replaceUrlAfterOAuthReturn(`${url.pathname}${url.search}${url.hash}`);
135
- return true;
136
125
  }
137
126
  //# sourceMappingURL=oauthReturn.js.map