@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
@@ -1,7 +1,7 @@
1
- import type Ionicons from '@expo/vector-icons/Ionicons';
2
- import type { AssetUploadInput, RNFileDescriptor } from '@oxyhq/core';
3
- import type { ComponentProps } from 'react';
4
- import { Platform } from 'react-native';
1
+ import type Ionicons from "@expo/vector-icons/Ionicons";
2
+ import type { AssetUploadInput, RNFileDescriptor } from "@oxyhq/core";
3
+ import type { ComponentProps } from "react";
4
+ import { Platform } from "react-native";
5
5
 
6
6
  /**
7
7
  * Extended File interface that includes a `uri` property for mobile preview support.
@@ -9,7 +9,7 @@ import { Platform } from 'react-native';
9
9
  * on the File object for preview rendering.
10
10
  */
11
11
  interface FileWithUri extends File {
12
- uri?: string;
12
+ uri?: string;
13
13
  }
14
14
 
15
15
  /**
@@ -18,11 +18,11 @@ interface FileWithUri extends File {
18
18
  * descriptor straight to FormData on React Native.
19
19
  */
20
20
  export interface PickerAsset {
21
- file?: File | Blob;
22
- uri?: string;
23
- name?: string | null;
24
- mimeType?: string | null;
25
- size?: number | null;
21
+ file?: File | Blob;
22
+ uri?: string;
23
+ name?: string | null;
24
+ mimeType?: string | null;
25
+ size?: number | null;
26
26
  }
27
27
 
28
28
  /**
@@ -30,37 +30,42 @@ export interface PickerAsset {
30
30
  * (carries a URI but is not a real DOM `File` / `Blob` instance).
31
31
  */
32
32
  export function isRNFileDescriptor(input: unknown): input is RNFileDescriptor {
33
- if (!input || typeof input !== 'object') return false;
34
- const obj = input as Record<string, unknown>;
35
- if (typeof obj.uri !== 'string') return false;
36
- if (typeof File !== 'undefined' && input instanceof File) return false;
37
- if (typeof Blob !== 'undefined' && input instanceof Blob) return false;
38
- return true;
33
+ if (!input || typeof input !== "object") return false;
34
+ const obj = input as Record<string, unknown>;
35
+ if (typeof obj.uri !== "string") return false;
36
+ if (typeof File !== "undefined" && input instanceof File) return false;
37
+ if (typeof Blob !== "undefined" && input instanceof Blob) return false;
38
+ return true;
39
39
  }
40
40
 
41
41
  /**
42
42
  * Format file size in bytes to human-readable string
43
43
  */
44
44
  export function formatFileSize(bytes: number): string {
45
- if (bytes === 0) return '0 Bytes';
46
- const k = 1024;
47
- const sizes = ['Bytes', 'KB', 'MB', 'GB'];
48
- const i = Math.floor(Math.log(bytes) / Math.log(k));
49
- return `${Number.parseFloat((bytes / k ** i).toFixed(2))} ${sizes[i]}`;
45
+ if (bytes === 0) return "0 Bytes";
46
+ const k = 1024;
47
+ const sizes = ["Bytes", "KB", "MB", "GB"];
48
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
49
+ return `${Number.parseFloat((bytes / k ** i).toFixed(2))} ${sizes[i]}`;
50
50
  }
51
51
 
52
52
  /**
53
53
  * Get icon name for file based on content type
54
54
  */
55
- export function getFileIcon(contentType: string): ComponentProps<typeof Ionicons>['name'] {
56
- if (contentType.startsWith('image/')) return 'image';
57
- if (contentType.startsWith('video/')) return 'videocam';
58
- if (contentType.startsWith('audio/')) return 'musical-notes';
59
- if (contentType.includes('pdf')) return 'document-text';
60
- if (contentType.includes('word') || contentType.includes('doc')) return 'document';
61
- if (contentType.includes('excel') || contentType.includes('sheet')) return 'grid';
62
- if (contentType.includes('zip') || contentType.includes('archive')) return 'archive';
63
- return 'document-outline';
55
+ export function getFileIcon(
56
+ contentType: string,
57
+ ): ComponentProps<typeof Ionicons>["name"] {
58
+ if (contentType.startsWith("image/")) return "image";
59
+ if (contentType.startsWith("video/")) return "videocam";
60
+ if (contentType.startsWith("audio/")) return "musical-notes";
61
+ if (contentType.includes("pdf")) return "document-text";
62
+ if (contentType.includes("word") || contentType.includes("doc"))
63
+ return "document";
64
+ if (contentType.includes("excel") || contentType.includes("sheet"))
65
+ return "grid";
66
+ if (contentType.includes("zip") || contentType.includes("archive"))
67
+ return "archive";
68
+ return "document-outline";
64
69
  }
65
70
 
66
71
  /**
@@ -76,79 +81,90 @@ export function getFileIcon(contentType: string): ComponentProps<typeof Ionicons
76
81
  * 'ArrayBuffer' and 'ArrayBufferView' are not supported").
77
82
  */
78
83
  export async function convertDocumentPickerAssetToFile(
79
- doc: PickerAsset,
80
- index: number
84
+ doc: PickerAsset,
85
+ index: number,
81
86
  ): Promise<FileWithUri | RNFileDescriptor | null> {
82
- const fileName = doc.name || `file-${index + 1}`;
83
- const fileType = doc.mimeType || 'application/octet-stream';
87
+ const fileName = doc.name || `file-${index + 1}`;
88
+ const fileType = doc.mimeType || "application/octet-stream";
84
89
 
85
- // React Native path — return the descriptor as-is. FormData handles it.
86
- if (Platform.OS !== 'web') {
87
- if (!doc.uri) {
88
- throw new Error('Missing file data (no uri property)');
89
- }
90
- return {
91
- uri: doc.uri,
92
- type: fileType,
93
- name: fileName,
94
- size: typeof doc.size === 'number' ? doc.size : undefined,
95
- };
96
- }
90
+ // React Native path — return the descriptor as-is. FormData handles it.
91
+ if (Platform.OS !== "web") {
92
+ if (!doc.uri) {
93
+ throw new Error("Missing file data (no uri property)");
94
+ }
95
+ return {
96
+ uri: doc.uri,
97
+ type: fileType,
98
+ name: fileName,
99
+ size: typeof doc.size === "number" ? doc.size : undefined,
100
+ };
101
+ }
97
102
 
98
- try {
99
- let file: FileWithUri | null = null;
103
+ try {
104
+ let file: FileWithUri | null = null;
100
105
 
101
- // Priority 1: Use doc.file if available (web native File API).
102
- // This is the most efficient path as it doesn't require fetching.
103
- if (doc.file && typeof globalThis.File !== 'undefined' && doc.file instanceof globalThis.File) {
104
- file = doc.file as FileWithUri;
105
- // Ensure file has required properties
106
- if (!file.name && doc.name) {
107
- // Create new File with proper name if missing
108
- file = new globalThis.File([file], doc.name, { type: file.type || fileType });
109
- }
110
- // Preserve URI for preview if available
111
- if (doc.uri) {
112
- file.uri = doc.uri;
113
- }
114
- return file;
115
- }
106
+ // Priority 1: Use doc.file if available (web native File API).
107
+ // This is the most efficient path as it doesn't require fetching.
108
+ if (
109
+ doc.file &&
110
+ typeof globalThis.File !== "undefined" &&
111
+ doc.file instanceof globalThis.File
112
+ ) {
113
+ file = doc.file as FileWithUri;
114
+ // Ensure file has required properties
115
+ if (!file.name && doc.name) {
116
+ // Create new File with proper name if missing
117
+ file = new globalThis.File([file], doc.name, {
118
+ type: file.type || fileType,
119
+ });
120
+ }
121
+ // Preserve URI for preview if available
122
+ if (doc.uri) {
123
+ file.uri = doc.uri;
124
+ }
125
+ return file;
126
+ }
116
127
 
117
- // Priority 2: Build File from URI (web blob URLs or http(s) URLs).
118
- if (doc.uri) {
119
- try {
120
- const response = await fetch(doc.uri);
121
- if (!response.ok) {
122
- throw new Error(`Failed to fetch file: ${response.statusText}`);
123
- }
124
- const blob = await response.blob();
125
- const resolvedType = doc.mimeType || blob.type || 'application/octet-stream';
126
- file = new globalThis.File([blob], fileName, { type: resolvedType }) as FileWithUri;
127
- file.uri = doc.uri;
128
- return file;
129
- } catch (error: unknown) {
130
- console.error('Failed to read file from URI:', error);
131
- throw new Error(`Failed to load file: ${(error instanceof Error ? error.message : null) || 'Unknown error'}`);
132
- }
133
- }
128
+ // Priority 2: Build File from URI (web blob URLs or http(s) URLs).
129
+ if (doc.uri) {
130
+ try {
131
+ const response = await fetch(doc.uri);
132
+ if (!response.ok) {
133
+ throw new Error(`Failed to fetch file: ${response.statusText}`);
134
+ }
135
+ const blob = await response.blob();
136
+ const resolvedType =
137
+ doc.mimeType || blob.type || "application/octet-stream";
138
+ file = new globalThis.File([blob], fileName, {
139
+ type: resolvedType,
140
+ }) as FileWithUri;
141
+ file.uri = doc.uri;
142
+ return file;
143
+ } catch (error: unknown) {
144
+ console.error("Failed to read file from URI:", error);
145
+ throw new Error(
146
+ `Failed to load file: ${(error instanceof Error ? error.message : null) || "Unknown error"}`,
147
+ );
148
+ }
149
+ }
134
150
 
135
- // No file or URI available - this shouldn't happen with Expo 54
136
- throw new Error('Missing file data (no file or uri property)');
137
- } catch (error: unknown) {
138
- console.error('Error converting document to file:', error);
139
- throw error;
140
- }
151
+ // No file or URI available - this shouldn't happen with Expo 54
152
+ throw new Error("Missing file data (no file or uri property)");
153
+ } catch (error: unknown) {
154
+ console.error("Error converting document to file:", error);
155
+ throw error;
156
+ }
141
157
  }
142
158
 
143
159
  /**
144
160
  * Upload file raw - helper function for file uploads
145
161
  */
146
162
  export async function uploadFileRaw(
147
- file: AssetUploadInput,
148
- userId: string,
149
- // biome-ignore lint/suspicious/noExplicitAny: OxyServices type cannot be fully resolved due to mixin composition pattern
150
- oxyServices: any,
151
- visibility?: 'private' | 'public' | 'unlisted'
163
+ file: AssetUploadInput,
164
+ userId: string,
165
+ // biome-ignore lint/suspicious/noExplicitAny: OxyServices type cannot be fully resolved due to mixin composition pattern
166
+ oxyServices: any,
167
+ visibility?: "private" | "public" | "unlisted",
152
168
  ) {
153
- return await oxyServices.uploadRawFile(file, visibility);
169
+ return await oxyServices.uploadRawFile(file, visibility);
154
170
  }
@@ -0,0 +1,27 @@
1
+ export interface NetInfoLikeState {
2
+ isConnected: boolean | null;
3
+ isInternetReachable?: boolean | null;
4
+ }
5
+
6
+ /**
7
+ * Mirrors Bloom `ConnectionStatusToasts` reachability semantics: a link that
8
+ * reports connected but explicitly unreachable (captive portal, no route) counts
9
+ * as offline.
10
+ */
11
+ export function isNetConnectivityOnline(state: NetInfoLikeState): boolean {
12
+ return Boolean(state.isConnected && state.isInternetReachable !== false);
13
+ }
14
+
15
+ /**
16
+ * Conservative offline verdict for boot-path probes. Unknown / probing states
17
+ * (`null`, timed-out fetch) resolve to "not offline" so a flaky probe never
18
+ * skips a real sign-in.
19
+ */
20
+ export function isNetConnectivityExplicitlyOffline(
21
+ state: NetInfoLikeState | null | undefined,
22
+ ): boolean {
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
+ }
@@ -3,7 +3,7 @@ import {
3
3
  clearOAuthHandshake,
4
4
  consumeOAuthReturnPath,
5
5
  logger,
6
- normalizeOAuthRedirectUri,
6
+ canonicalizeOAuthRedirectUri,
7
7
  readOAuthHandshake,
8
8
  } from '@oxyhq/core';
9
9
  import { completeOAuthCode } from '../oauth/completeOAuthCode';
@@ -14,12 +14,21 @@ import { isWebBrowser } from './isWebBrowser';
14
14
  * When the RP lands with `?code=` after signing in at auth.oxy.so, exchange the
15
15
  * code for a device-first session before cold boot runs.
16
16
  *
17
- * This is the REDIRECT transport's return leg. It owns only what is specific to
18
- * a full-page round trip reading the code off the URL, recovering the
19
- * handshake `sessionStorage` carried across the navigation, and cleaning both up
20
- * afterwards and delegates state validation, the PKCE exchange, and the
21
- * session commit to `completeOAuthCode`, the same function the popup transport
22
- * runs.
17
+ * This is the REDIRECT transport's return leg. The SDK never starts a full-page
18
+ * authorize navigation on its own any more (#691 phase 7b), but this lane is
19
+ * still load-bearing: a browser-BLOCKED sign-in popup falls back to a full-page
20
+ * redirect (`startWebOAuthSignIn`), and that redirect comes back here.
21
+ *
22
+ * It owns only what is specific to a full-page round trip — reading the code off
23
+ * the URL, recovering the handshake `sessionStorage` carried across the
24
+ * navigation, and cleaning both up afterwards — and delegates state validation,
25
+ * the PKCE exchange, and the session commit to `completeOAuthCode`, the same
26
+ * function the popup transport runs.
27
+ *
28
+ * It is also the SINGLE cleanup path for an OAuth `error` landing on the URL:
29
+ * any `?error=…` (including an `error=login_required` left over from the
30
+ * now-deleted silent restore) is stripped along with `state` /
31
+ * `error_description`, and the stale PKCE handshake is cleared.
23
32
  */
24
33
  export async function tryCompleteOAuthReturn(opts: {
25
34
  oxyServices: OxyServices;
@@ -49,13 +58,18 @@ export async function tryCompleteOAuthReturn(opts: {
49
58
  return false;
50
59
  }
51
60
 
61
+ const handshake = readOAuthHandshake();
62
+ const redirectUri = canonicalizeOAuthRedirectUri(
63
+ handshake?.redirectUri ?? opts.authRedirectUri ?? location.origin,
64
+ );
65
+
52
66
  const result = await completeOAuthCode({
53
67
  oxyServices: opts.oxyServices,
54
68
  clientId,
55
69
  code,
56
70
  returnedState: params.get('state'),
57
- handshake: readOAuthHandshake(),
58
- redirectUri: normalizeOAuthRedirectUri(opts.authRedirectUri ?? location.origin),
71
+ handshake,
72
+ redirectUri,
59
73
  commitSession: opts.commitSession,
60
74
  // Strip the params before the commit so a stale `?code=` cannot re-enter the
61
75
  // exchange loop, and read the return path FIRST — clearOAuthHandshake drops
@@ -120,29 +134,5 @@ function stripOAuthParamsFromUrl(): void {
120
134
  url.searchParams.delete('state');
121
135
  url.searchParams.delete('error');
122
136
  url.searchParams.delete('error_description');
123
- url.searchParams.delete('hub_sync');
124
- replaceUrlAfterOAuthReturn(`${url.pathname}${url.search}${url.hash}`);
125
- }
126
-
127
- /**
128
- * When auth.oxy.so hub-sync redeem fails, the IdP redirects back with
129
- * `?hub_sync=failed`. Strip the param and log so cold boot can continue
130
- * without leaving a stale query string.
131
- */
132
- export function consumeHubSyncFailure(): boolean {
133
- if (!isWebBrowser()) return false;
134
- const location = (globalThis as { location?: Location }).location;
135
- if (!location) return false;
136
-
137
- const params = new URLSearchParams(location.search);
138
- if (params.get('hub_sync') !== 'failed') return false;
139
-
140
- logger.warn('Hub sync failed — IdP device session may be out of sync', {
141
- component: 'hubSync',
142
- });
143
-
144
- const url = new URL(location.href);
145
- url.searchParams.delete('hub_sync');
146
137
  replaceUrlAfterOAuthReturn(`${url.pathname}${url.search}${url.hash}`);
147
- return true;
148
138
  }
@@ -1,15 +1,12 @@
1
1
  /**
2
2
  * User display name and date formatting utilities.
3
3
  *
4
- * The display-name helpers are thin wrappers around the canonical
5
- * `getAccountDisplayName` in `@oxyhq/core`, which handles all the edge cases
6
- * (missing username, missing name, fallback to truncated `publicKey`, i18n).
4
+ * Display-name helpers follow the API contract: prefer `name.displayName` when
5
+ * present, otherwise fall back to the normalized handle via
6
+ * `getNormalizedUserHandle`.
7
7
  */
8
8
 
9
- import {
10
- getAccountDisplayName as coreGetAccountDisplayName,
11
- type DisplayNameUserShape,
12
- } from '@oxyhq/core';
9
+ import { getNormalizedUserHandle, type DisplayNameUserShape } from '@oxyhq/core';
13
10
 
14
11
  /**
15
12
  * Formats a date string to a readable format (e.g., "Feb 21, 2025")
@@ -31,44 +28,42 @@ export const formatDate = (dateString: string | undefined | null | Date): string
31
28
  }
32
29
  };
33
30
 
31
+ function readDisplayName(user: DisplayNameUserShape | null | undefined): string {
32
+ const name = user?.name;
33
+ if (!name || typeof name !== 'object') return '';
34
+ return typeof name.displayName === 'string' ? name.displayName.trim() : '';
35
+ }
36
+
34
37
  /**
35
38
  * Gets a display name from user data.
36
39
  *
37
- * Prefers full name composed first+last → username → `Account 0x12345678…`
38
- * (derived from publicKey) → translated "Unnamed".
39
- *
40
- * @param user - User-like object with optional name/username/publicKey
41
- * @param locale - Optional locale for the final fallback label
40
+ * Prefers API `name.displayName`, then the normalized handle.
42
41
  */
43
42
  export const getDisplayName = (
44
43
  user: DisplayNameUserShape | null | undefined,
45
- locale?: string,
46
- ): string => coreGetAccountDisplayName(user, locale);
44
+ ): string => {
45
+ const displayName = readDisplayName(user);
46
+ if (displayName) return displayName;
47
+ return getNormalizedUserHandle(user) ?? '';
48
+ };
47
49
 
48
50
  /**
49
- * Gets a short display name (first name or username).
50
- *
51
- * Used for compact UI (e.g. greetings). Falls back to the full display name
52
- * helper, which also handles publicKey-only accounts.
51
+ * Gets a short display name (first token) for compact UI.
53
52
  */
54
53
  export const getShortDisplayName = (
55
54
  user: DisplayNameUserShape | null | undefined,
56
- locale?: string,
57
55
  ): string => {
58
- if (!user) return coreGetAccountDisplayName(user, locale);
59
-
60
- const name = user.name;
61
- if (name && typeof name === 'object') {
62
- const first = typeof name.first === 'string' ? name.first.trim() : '';
63
- if (first) return first;
64
- const full = typeof name.full === 'string' ? name.full.trim() : '';
65
- if (full) return full.split(' ')[0];
66
- } else if (typeof name === 'string' && name.trim()) {
67
- return name.trim().split(' ')[0];
56
+ const displayName = readDisplayName(user);
57
+ if (displayName) {
58
+ const firstToken = displayName.split(/\s+/).find(Boolean);
59
+ if (firstToken) return firstToken;
68
60
  }
69
61
 
70
- if (typeof user.username === 'string' && user.username.trim()) return user.username.trim();
62
+ const handle = getNormalizedUserHandle(user);
63
+ if (handle) {
64
+ const firstToken = handle.split(/\s+/).find(Boolean);
65
+ return firstToken ?? handle;
66
+ }
71
67
 
72
- // Defer to the canonical helper for publicKey/unnamed fallbacks.
73
- return coreGetAccountDisplayName(user, locale);
68
+ return '';
74
69
  };
@@ -1,48 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.allowsAutomaticIdpRedirect = allowsAutomaticIdpRedirect;
7
- /**
8
- * The legacy, redirect-mode-only lanes that navigate the RP's TOP-LEVEL window
9
- * to the IdP without a user gesture.
10
- *
11
- * `webAuthMode: 'popup'` exists to guarantee exactly one thing: the relying
12
- * party never leaves its route. Two mechanics in this SDK break that guarantee,
13
- * because each replaces the whole document on its own initiative:
14
- *
15
- * 1. **Cold-boot silent restore** — a full-page `prompt=none` authorize bounce
16
- * to `auth.oxy.so` when the device-secret mint finds no local session
17
- * (`maybeStartSilentOAuthRestore`, called from `runProviderColdBoot`).
18
- * 2. **Post-sign-in hub sync** — a full-page hop to `auth.oxy.so/sync` that
19
- * plants this device's credential on the IdP hub so OTHER origins can later
20
- * run lane 1 (`syncHubAfterSignIn`, called from the `commitSession` funnel).
21
- *
22
- * Both belong to the redirect transport and are kept only for the migration
23
- * window (issue #691, "Cold boot and cross-domain behavior"). In popup mode a
24
- * domain with no local credential simply resolves SIGNED OUT, and the user's
25
- * next explicit "Continue with Oxy" opens the popup — from a real user gesture,
26
- * never automatically.
27
- *
28
- * NOT covered here, and correctly enabled in BOTH modes: navigations the user
29
- * asked for. When the browser blocks the popup, `startWebOAuthSignIn` still
30
- * falls back to a full-page redirect rather than dead-ending the sign-in, and
31
- * `tryCompleteOAuthReturn` still consumes a `?code=` that is already on the URL.
32
- *
33
- * PHASE 7b: once the pilot flips the default transport to `'popup'`, this
34
- * predicate and BOTH lanes above are deleted outright. Grepping this symbol
35
- * finds every site that has to go.
36
- */
37
-
38
- /**
39
- * Whether a provider running `webAuthMode` may perform an SDK-initiated,
40
- * non-gesture, full-page navigation to the IdP.
41
- *
42
- * `true` only for `'redirect'` — still the default and the compatibility path,
43
- * whose behaviour must stay byte-for-byte unchanged.
44
- */
45
- function allowsAutomaticIdpRedirect(webAuthMode) {
46
- return webAuthMode === 'redirect';
47
- }
48
- //# sourceMappingURL=legacyRedirectLanes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["allowsAutomaticIdpRedirect","webAuthMode"],"sourceRoot":"../../../../src","sources":["ui/oauth/legacyRedirectLanes.ts"],"mappings":";;;;;;AAAA;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;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,0BAA0BA,CAACC,WAAwB,EAAW;EAC5E,OAAOA,WAAW,KAAK,UAAU;AACnC","ignoreList":[]}
@@ -1,140 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.clearCrossOriginRestoreGuards = clearCrossOriginRestoreGuards;
7
- exports.consumeSilentOAuthError = consumeSilentOAuthError;
8
- exports.isCrossOriginRestoreBlocked = isCrossOriginRestoreBlocked;
9
- exports.isSilentRestoreEligibleOrigin = isSilentRestoreEligibleOrigin;
10
- exports.markCrossOriginRestoreAttempted = markCrossOriginRestoreAttempted;
11
- exports.maybeStartSilentOAuthRestore = maybeStartSilentOAuthRestore;
12
- var _core = require("@oxyhq/core");
13
- var _isWebBrowser = require("./isWebBrowser.js");
14
- var _oauthReturn = require("./oauthReturn.js");
15
- var _oauthNavigation = require("../components/oauthNavigation.js");
16
- function sessionStore() {
17
- return globalThis.sessionStorage;
18
- }
19
-
20
- /** True when this tab already attempted cross-origin silent OAuth restore. */
21
- function isCrossOriginRestoreBlocked() {
22
- const store = sessionStore();
23
- if (!store) return false;
24
- return Boolean(store.getItem(_core.OXY_CROSS_ORIGIN_RESTORE_ATTEMPTED_KEY) || store.getItem(_core.OXY_SILENT_OAUTH_ATTEMPTED_KEY));
25
- }
26
-
27
- /** Mark restore as attempted — never auto-retry until sign-out clears guards. */
28
- function markCrossOriginRestoreAttempted() {
29
- const store = sessionStore();
30
- if (!store) return;
31
- store.setItem(_core.OXY_CROSS_ORIGIN_RESTORE_ATTEMPTED_KEY, '1');
32
- store.setItem(_core.OXY_SILENT_OAUTH_ATTEMPTED_KEY, '1');
33
- }
34
-
35
- /** Clear all cross-origin restore loop guards (call on sign-out). */
36
- function clearCrossOriginRestoreGuards() {
37
- const store = sessionStore();
38
- if (!store) return;
39
- for (const key of [_core.OXY_CROSS_ORIGIN_RESTORE_ATTEMPTED_KEY, _core.OXY_SILENT_OAUTH_ATTEMPTED_KEY]) {
40
- store.removeItem(key);
41
- }
42
- }
43
-
44
- /**
45
- * Whether cold boot should attempt silent cross-origin OAuth restore for the
46
- * given web origin.
47
- *
48
- * Mirrors the hub-sync WRITE gate (`syncHubAfterSignIn`): only OFFICIAL Oxy web
49
- * origins participate in cross-app SSO — a random third-party / preview origin
50
- * must never have its tab bounced to the IdP. Additionally, loopback / local-dev
51
- * origins are EXCLUDED here even though {@link isOfficialWebOrigin} treats them
52
- * as official: a developer's local app must never be redirected to a hosted IdP
53
- * on cold boot (it signs in through the in-app dialog instead). The central IdP
54
- * hub's own origin is excluded to avoid a wasteful self-hop.
55
- */
56
- function isSilentRestoreEligibleOrigin(origin) {
57
- if ((0, _core.isLoopbackOrigin)(origin)) return false;
58
- if ((0, _core.isIdpHubOrigin)()) return false;
59
- return (0, _core.isOfficialWebOrigin)(origin);
60
- }
61
- /**
62
- * Top-level redirect to auth.oxy.so/authorize with `prompt=none` for silent
63
- * cross-origin session restore on all web apps (official + third-party).
64
- */
65
- async function maybeStartSilentOAuthRestore(opts) {
66
- if (!(0, _isWebBrowser.isWebBrowser)()) return false;
67
- const location = globalThis.location;
68
- if (!location) return false;
69
-
70
- // Defense-in-depth: never bounce a loopback / non-official / IdP-hub origin to
71
- // a hosted authorize endpoint (the caller gates on this too).
72
- if (!isSilentRestoreEligibleOrigin(location.origin)) {
73
- return false;
74
- }
75
- if (isCrossOriginRestoreBlocked()) {
76
- return false;
77
- }
78
- const params = new URLSearchParams(location.search);
79
- if (params.has('code') || params.has('error')) {
80
- return false;
81
- }
82
- try {
83
- const {
84
- codeVerifier,
85
- codeChallenge
86
- } = await (0, _core.generatePkcePair)();
87
- const state = await (0, _core.generateOAuthState)();
88
- if (!(0, _core.persistOAuthHandshake)(state, codeVerifier)) {
89
- return false;
90
- }
91
- const redirectUri = (0, _core.normalizeOAuthRedirectUri)(opts.redirectUri ?? location.origin);
92
- const authorizeUrl = (0, _core.buildOAuthAuthorizeUrl)({
93
- authorizeBaseUrl: opts.authorizeBaseUrl,
94
- clientId: opts.clientId,
95
- redirectUri,
96
- state,
97
- codeChallenge,
98
- scope: opts.scope,
99
- prompt: 'none'
100
- });
101
- markCrossOriginRestoreAttempted();
102
- (0, _oauthNavigation.redirectToAuthorize)(authorizeUrl);
103
- return true;
104
- } catch (error) {
105
- _core.logger.warn('Silent OAuth restore skipped', {
106
- component: 'crossOriginRestore'
107
- }, error);
108
- return false;
109
- }
110
- }
111
-
112
- /**
113
- * When the RP lands with OAuth error params from a silent authorize attempt,
114
- * strip them and return whether the error was terminal for silent restore.
115
- */
116
- function consumeSilentOAuthError() {
117
- if (!(0, _isWebBrowser.isWebBrowser)()) return null;
118
- const location = globalThis.location;
119
- const history = globalThis.history;
120
- if (!location) return null;
121
- const params = new URLSearchParams(location.search);
122
- const error = params.get('error');
123
- if (error !== 'login_required' && error !== 'consent_required') {
124
- return null;
125
- }
126
- markCrossOriginRestoreAttempted();
127
- if (history?.replaceState) {
128
- const url = new URL(location.href);
129
- url.searchParams.delete('error');
130
- url.searchParams.delete('error_description');
131
- url.searchParams.delete('state');
132
- // Silent restore failed, but the visitor still asked for a specific page.
133
- // Put them back on it rather than leaving them on the bare origin the IdP
134
- // redirected to.
135
- (0, _oauthReturn.replaceUrlAfterOAuthReturn)(`${url.pathname}${url.search}${url.hash}`);
136
- }
137
- (0, _core.clearOAuthHandshake)();
138
- return error;
139
- }
140
- //# sourceMappingURL=crossOriginRestore.js.map