@oxyhq/services 22.13.0 → 23.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (445) hide show
  1. package/README.md +1 -1
  2. package/lib/commonjs/index.js +74 -0
  3. package/lib/commonjs/index.js.map +1 -1
  4. package/lib/commonjs/notifications/deviceNotifications.js +424 -0
  5. package/lib/commonjs/notifications/deviceNotifications.js.map +1 -0
  6. package/lib/commonjs/ui/boot/runProviderColdBoot.js +20 -64
  7. package/lib/commonjs/ui/boot/runProviderColdBoot.js.map +1 -1
  8. package/lib/commonjs/ui/components/AvatarCameraBadge.js +3 -2
  9. package/lib/commonjs/ui/components/AvatarCameraBadge.js.map +1 -1
  10. package/lib/commonjs/ui/components/OxyAuthChooser.js +5 -4
  11. package/lib/commonjs/ui/components/OxyAuthChooser.js.map +1 -1
  12. package/lib/commonjs/ui/components/OxyProvider.js +5 -6
  13. package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
  14. package/lib/commonjs/ui/components/OxySignInRequestSurface.js +147 -0
  15. package/lib/commonjs/ui/components/OxySignInRequestSurface.js.map +1 -0
  16. package/lib/commonjs/ui/components/ProfileButton.js +4 -3
  17. package/lib/commonjs/ui/components/ProfileButton.js.map +1 -1
  18. package/lib/commonjs/ui/components/SettingsIcon.js +3 -2
  19. package/lib/commonjs/ui/components/SettingsIcon.js.map +1 -1
  20. package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js +7 -7
  21. package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js.map +1 -1
  22. package/lib/commonjs/ui/components/authChooser/SignInEntryView.js.map +1 -1
  23. package/lib/commonjs/ui/components/authChooser/SignInRequestView.js +65 -103
  24. package/lib/commonjs/ui/components/authChooser/SignInRequestView.js.map +1 -1
  25. package/lib/commonjs/ui/components/authChooser/TroubleDisclosure.js +0 -2
  26. package/lib/commonjs/ui/components/authChooser/TroubleDisclosure.js.map +1 -1
  27. package/lib/commonjs/ui/components/authChooser/primitives.js +5 -4
  28. package/lib/commonjs/ui/components/authChooser/primitives.js.map +1 -1
  29. package/lib/commonjs/ui/components/authChooser/requestSurfaces.js +14 -10
  30. package/lib/commonjs/ui/components/authChooser/requestSurfaces.js.map +1 -1
  31. package/lib/commonjs/ui/components/authChooser/types.js +11 -0
  32. package/lib/commonjs/ui/components/authChooser/types.js.map +1 -1
  33. package/lib/commonjs/ui/components/fileManagement/AnimatedButton.js +3 -2
  34. package/lib/commonjs/ui/components/fileManagement/AnimatedButton.js.map +1 -1
  35. package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js +3 -2
  36. package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
  37. package/lib/commonjs/ui/components/fileManagement/FileViewer.js +15 -14
  38. package/lib/commonjs/ui/components/fileManagement/FileViewer.js.map +1 -1
  39. package/lib/commonjs/ui/components/fileManagement/UploadPreview.js +6 -5
  40. package/lib/commonjs/ui/components/fileManagement/UploadPreview.js.map +1 -1
  41. package/lib/commonjs/ui/components/modals/DeleteAccountModal.js +3 -2
  42. package/lib/commonjs/ui/components/modals/DeleteAccountModal.js.map +1 -1
  43. package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js +6 -6
  44. package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js.map +1 -1
  45. package/lib/commonjs/ui/components/payment/PaymentMethodStep.js +5 -5
  46. package/lib/commonjs/ui/components/payment/PaymentMethodStep.js.map +1 -1
  47. package/lib/commonjs/ui/components/payment/PaymentReviewStep.js +10 -9
  48. package/lib/commonjs/ui/components/payment/PaymentReviewStep.js.map +1 -1
  49. package/lib/commonjs/ui/components/payment/PaymentSuccessStep.js +4 -3
  50. package/lib/commonjs/ui/components/payment/PaymentSuccessStep.js.map +1 -1
  51. package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js +6 -5
  52. package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js.map +1 -1
  53. package/lib/commonjs/ui/components/styles/shadow.js.map +1 -1
  54. package/lib/commonjs/ui/context/OxyContext.js +14 -45
  55. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  56. package/lib/commonjs/ui/context/commitSessionFlow.js +0 -43
  57. package/lib/commonjs/ui/context/commitSessionFlow.js.map +1 -1
  58. package/lib/commonjs/ui/context/useOxyAccountGraph.js +3 -4
  59. package/lib/commonjs/ui/context/useOxyAccountGraph.js.map +1 -1
  60. package/lib/commonjs/ui/hooks/queries/userCache.js +17 -17
  61. package/lib/commonjs/ui/hooks/queries/userCache.js.map +1 -1
  62. package/lib/commonjs/ui/hooks/useAssets.js.map +1 -1
  63. package/lib/commonjs/ui/hooks/useAuth.js +4 -2
  64. package/lib/commonjs/ui/hooks/useAuth.js.map +1 -1
  65. package/lib/commonjs/ui/hooks/useOnlineStatus.js +3 -2
  66. package/lib/commonjs/ui/hooks/useOnlineStatus.js.map +1 -1
  67. package/lib/commonjs/ui/hooks/useSessionManagement.js +0 -2
  68. package/lib/commonjs/ui/hooks/useSessionManagement.js.map +1 -1
  69. package/lib/commonjs/ui/screens/AccountMembersScreen.js +4 -3
  70. package/lib/commonjs/ui/screens/AccountMembersScreen.js.map +1 -1
  71. package/lib/commonjs/ui/screens/ConnectedAppsScreen.js +1 -1
  72. package/lib/commonjs/ui/screens/ConnectedAppsScreen.js.map +1 -1
  73. package/lib/commonjs/ui/screens/CreateAccountScreen.js +7 -6
  74. package/lib/commonjs/ui/screens/CreateAccountScreen.js.map +1 -1
  75. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +4 -3
  76. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
  77. package/lib/commonjs/ui/screens/FAQScreen.js +3 -2
  78. package/lib/commonjs/ui/screens/FAQScreen.js.map +1 -1
  79. package/lib/commonjs/ui/screens/FeedbackScreen.js +96 -96
  80. package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
  81. package/lib/commonjs/ui/screens/FileManagementScreen.js +19 -18
  82. package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
  83. package/lib/commonjs/ui/screens/HistoryViewScreen.js +4 -29
  84. package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
  85. package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +4 -3
  86. package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
  87. package/lib/commonjs/ui/screens/ManageAccountScreen.js +2 -2
  88. package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
  89. package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +3 -3
  90. package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
  91. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +10 -9
  92. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  93. package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +1 -0
  94. package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
  95. package/lib/commonjs/ui/screens/ProfileScreen.js +12 -13
  96. package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
  97. package/lib/commonjs/ui/screens/UserListScreen.js +4 -4
  98. package/lib/commonjs/ui/screens/UserListScreen.js.map +1 -1
  99. package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +6 -6
  100. package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
  101. package/lib/commonjs/ui/screens/fileManagement/FileLibraryError.js +4 -3
  102. package/lib/commonjs/ui/screens/fileManagement/FileLibraryError.js.map +1 -1
  103. package/lib/commonjs/ui/screens/fileManagement/FileListSection.js +4 -3
  104. package/lib/commonjs/ui/screens/fileManagement/FileListSection.js.map +1 -1
  105. package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js +5 -7
  106. package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
  107. package/lib/commonjs/ui/screens/fileManagement/UploadBar.js +3 -2
  108. package/lib/commonjs/ui/screens/fileManagement/UploadBar.js.map +1 -1
  109. package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js +3 -2
  110. package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js.map +1 -1
  111. package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js +5 -4
  112. package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
  113. package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js +4 -3
  114. package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
  115. package/lib/commonjs/ui/utils/fileManagement.js +24 -24
  116. package/lib/commonjs/ui/utils/fileManagement.js.map +1 -1
  117. package/lib/commonjs/ui/utils/netConnectivity.js +28 -0
  118. package/lib/commonjs/ui/utils/netConnectivity.js.map +1 -0
  119. package/lib/commonjs/ui/utils/oauthReturn.js +15 -28
  120. package/lib/commonjs/ui/utils/oauthReturn.js.map +1 -1
  121. package/lib/module/index.js +18 -0
  122. package/lib/module/index.js.map +1 -1
  123. package/lib/module/notifications/deviceNotifications.js +414 -0
  124. package/lib/module/notifications/deviceNotifications.js.map +1 -0
  125. package/lib/module/ui/boot/runProviderColdBoot.js +21 -65
  126. package/lib/module/ui/boot/runProviderColdBoot.js.map +1 -1
  127. package/lib/module/ui/components/AvatarCameraBadge.js +1 -1
  128. package/lib/module/ui/components/AvatarCameraBadge.js.map +1 -1
  129. package/lib/module/ui/components/OxyAuthChooser.js +5 -4
  130. package/lib/module/ui/components/OxyAuthChooser.js.map +1 -1
  131. package/lib/module/ui/components/OxyProvider.js +5 -6
  132. package/lib/module/ui/components/OxyProvider.js.map +1 -1
  133. package/lib/module/ui/components/OxySignInRequestSurface.js +141 -0
  134. package/lib/module/ui/components/OxySignInRequestSurface.js.map +1 -0
  135. package/lib/module/ui/components/ProfileButton.js +1 -1
  136. package/lib/module/ui/components/ProfileButton.js.map +1 -1
  137. package/lib/module/ui/components/SettingsIcon.js +1 -1
  138. package/lib/module/ui/components/SettingsIcon.js.map +1 -1
  139. package/lib/module/ui/components/authChooser/AccountsMenuView.js +1 -1
  140. package/lib/module/ui/components/authChooser/AccountsMenuView.js.map +1 -1
  141. package/lib/module/ui/components/authChooser/SignInEntryView.js.map +1 -1
  142. package/lib/module/ui/components/authChooser/SignInRequestView.js +66 -104
  143. package/lib/module/ui/components/authChooser/SignInRequestView.js.map +1 -1
  144. package/lib/module/ui/components/authChooser/TroubleDisclosure.js +0 -2
  145. package/lib/module/ui/components/authChooser/TroubleDisclosure.js.map +1 -1
  146. package/lib/module/ui/components/authChooser/primitives.js +1 -1
  147. package/lib/module/ui/components/authChooser/primitives.js.map +1 -1
  148. package/lib/module/ui/components/authChooser/requestSurfaces.js +13 -9
  149. package/lib/module/ui/components/authChooser/requestSurfaces.js.map +1 -1
  150. package/lib/module/ui/components/authChooser/types.js +11 -0
  151. package/lib/module/ui/components/authChooser/types.js.map +1 -1
  152. package/lib/module/ui/components/fileManagement/AnimatedButton.js +1 -1
  153. package/lib/module/ui/components/fileManagement/AnimatedButton.js.map +1 -1
  154. package/lib/module/ui/components/fileManagement/FileDetailsModal.js +1 -1
  155. package/lib/module/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
  156. package/lib/module/ui/components/fileManagement/FileViewer.js +1 -1
  157. package/lib/module/ui/components/fileManagement/FileViewer.js.map +1 -1
  158. package/lib/module/ui/components/fileManagement/UploadPreview.js +1 -1
  159. package/lib/module/ui/components/fileManagement/UploadPreview.js.map +1 -1
  160. package/lib/module/ui/components/modals/DeleteAccountModal.js +1 -1
  161. package/lib/module/ui/components/modals/DeleteAccountModal.js.map +1 -1
  162. package/lib/module/ui/components/payment/PaymentDetailsStep.js +1 -1
  163. package/lib/module/ui/components/payment/PaymentDetailsStep.js.map +1 -1
  164. package/lib/module/ui/components/payment/PaymentMethodStep.js +1 -1
  165. package/lib/module/ui/components/payment/PaymentMethodStep.js.map +1 -1
  166. package/lib/module/ui/components/payment/PaymentReviewStep.js +1 -1
  167. package/lib/module/ui/components/payment/PaymentReviewStep.js.map +1 -1
  168. package/lib/module/ui/components/payment/PaymentSuccessStep.js +1 -1
  169. package/lib/module/ui/components/payment/PaymentSuccessStep.js.map +1 -1
  170. package/lib/module/ui/components/payment/PaymentSummaryStep.js +1 -1
  171. package/lib/module/ui/components/payment/PaymentSummaryStep.js.map +1 -1
  172. package/lib/module/ui/components/styles/shadow.js.map +1 -1
  173. package/lib/module/ui/context/OxyContext.js +16 -47
  174. package/lib/module/ui/context/OxyContext.js.map +1 -1
  175. package/lib/module/ui/context/commitSessionFlow.js +0 -42
  176. package/lib/module/ui/context/commitSessionFlow.js.map +1 -1
  177. package/lib/module/ui/context/useOxyAccountGraph.js +3 -4
  178. package/lib/module/ui/context/useOxyAccountGraph.js.map +1 -1
  179. package/lib/module/ui/hooks/queries/userCache.js +17 -17
  180. package/lib/module/ui/hooks/queries/userCache.js.map +1 -1
  181. package/lib/module/ui/hooks/useAssets.js.map +1 -1
  182. package/lib/module/ui/hooks/useAuth.js +4 -2
  183. package/lib/module/ui/hooks/useAuth.js.map +1 -1
  184. package/lib/module/ui/hooks/useOnlineStatus.js +3 -2
  185. package/lib/module/ui/hooks/useOnlineStatus.js.map +1 -1
  186. package/lib/module/ui/hooks/useSessionManagement.js +0 -2
  187. package/lib/module/ui/hooks/useSessionManagement.js.map +1 -1
  188. package/lib/module/ui/screens/AccountMembersScreen.js +1 -1
  189. package/lib/module/ui/screens/AccountMembersScreen.js.map +1 -1
  190. package/lib/module/ui/screens/ConnectedAppsScreen.js +1 -1
  191. package/lib/module/ui/screens/ConnectedAppsScreen.js.map +1 -1
  192. package/lib/module/ui/screens/CreateAccountScreen.js +1 -1
  193. package/lib/module/ui/screens/CreateAccountScreen.js.map +1 -1
  194. package/lib/module/ui/screens/EditProfileFieldScreen.js +1 -1
  195. package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
  196. package/lib/module/ui/screens/FAQScreen.js +1 -1
  197. package/lib/module/ui/screens/FAQScreen.js.map +1 -1
  198. package/lib/module/ui/screens/FeedbackScreen.js +91 -90
  199. package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
  200. package/lib/module/ui/screens/FileManagementScreen.js +2 -1
  201. package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
  202. package/lib/module/ui/screens/HistoryViewScreen.js +4 -29
  203. package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
  204. package/lib/module/ui/screens/LanguageSelectorScreen.js +1 -1
  205. package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
  206. package/lib/module/ui/screens/ManageAccountScreen.js +1 -1
  207. package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
  208. package/lib/module/ui/screens/PaymentGatewayScreen.js +1 -1
  209. package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
  210. package/lib/module/ui/screens/PremiumSubscriptionScreen.js +2 -2
  211. package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  212. package/lib/module/ui/screens/PrivacySettingsScreen.js +1 -0
  213. package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
  214. package/lib/module/ui/screens/ProfileScreen.js +4 -5
  215. package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
  216. package/lib/module/ui/screens/UserListScreen.js +3 -3
  217. package/lib/module/ui/screens/UserListScreen.js.map +1 -1
  218. package/lib/module/ui/screens/WelcomeNewUserScreen.js +5 -6
  219. package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
  220. package/lib/module/ui/screens/fileManagement/FileLibraryError.js +1 -1
  221. package/lib/module/ui/screens/fileManagement/FileLibraryError.js.map +1 -1
  222. package/lib/module/ui/screens/fileManagement/FileListSection.js +1 -1
  223. package/lib/module/ui/screens/fileManagement/FileListSection.js.map +1 -1
  224. package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js +3 -5
  225. package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
  226. package/lib/module/ui/screens/fileManagement/UploadBar.js +1 -1
  227. package/lib/module/ui/screens/fileManagement/UploadBar.js.map +1 -1
  228. package/lib/module/ui/screens/trust/TrustCenterScreen.js +1 -1
  229. package/lib/module/ui/screens/trust/TrustCenterScreen.js.map +1 -1
  230. package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js +3 -3
  231. package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
  232. package/lib/module/ui/screens/trust/TrustRewardsScreen.js +1 -1
  233. package/lib/module/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
  234. package/lib/module/ui/utils/fileManagement.js +25 -25
  235. package/lib/module/ui/utils/fileManagement.js.map +1 -1
  236. package/lib/module/ui/utils/netConnectivity.js +23 -0
  237. package/lib/module/ui/utils/netConnectivity.js.map +1 -0
  238. package/lib/module/ui/utils/oauthReturn.js +15 -27
  239. package/lib/module/ui/utils/oauthReturn.js.map +1 -1
  240. package/lib/typescript/commonjs/index.d.ts +5 -0
  241. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  242. package/lib/typescript/commonjs/notifications/deviceNotifications.d.ts +173 -0
  243. package/lib/typescript/commonjs/notifications/deviceNotifications.d.ts.map +1 -0
  244. package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts +11 -30
  245. package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts.map +1 -1
  246. package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts +5 -3
  247. package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts.map +1 -1
  248. package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
  249. package/lib/typescript/commonjs/ui/components/OxySignInRequestSurface.d.ts +108 -0
  250. package/lib/typescript/commonjs/ui/components/OxySignInRequestSurface.d.ts.map +1 -0
  251. package/lib/typescript/commonjs/ui/components/SettingsIcon.d.ts +1 -1
  252. package/lib/typescript/commonjs/ui/components/SettingsIcon.d.ts.map +1 -1
  253. package/lib/typescript/commonjs/ui/components/authChooser/SignInEntryView.d.ts.map +1 -1
  254. package/lib/typescript/commonjs/ui/components/authChooser/SignInRequestView.d.ts +18 -18
  255. package/lib/typescript/commonjs/ui/components/authChooser/SignInRequestView.d.ts.map +1 -1
  256. package/lib/typescript/commonjs/ui/components/authChooser/TroubleDisclosure.d.ts +3 -10
  257. package/lib/typescript/commonjs/ui/components/authChooser/TroubleDisclosure.d.ts.map +1 -1
  258. package/lib/typescript/commonjs/ui/components/authChooser/requestSurfaces.d.ts +8 -4
  259. package/lib/typescript/commonjs/ui/components/authChooser/requestSurfaces.d.ts.map +1 -1
  260. package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts +18 -0
  261. package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts.map +1 -1
  262. package/lib/typescript/commonjs/ui/components/payment/types.d.ts +6 -6
  263. package/lib/typescript/commonjs/ui/components/payment/types.d.ts.map +1 -1
  264. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
  265. package/lib/typescript/commonjs/ui/context/commitSessionFlow.d.ts +0 -40
  266. package/lib/typescript/commonjs/ui/context/commitSessionFlow.d.ts.map +1 -1
  267. package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts +4 -7
  268. package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts.map +1 -1
  269. package/lib/typescript/commonjs/ui/context/useOxyAccountGraph.d.ts +0 -1
  270. package/lib/typescript/commonjs/ui/context/useOxyAccountGraph.d.ts.map +1 -1
  271. package/lib/typescript/commonjs/ui/hooks/queries/userCache.d.ts +2 -2
  272. package/lib/typescript/commonjs/ui/hooks/queries/userCache.d.ts.map +1 -1
  273. package/lib/typescript/commonjs/ui/hooks/useAssets.d.ts +1 -1
  274. package/lib/typescript/commonjs/ui/hooks/useAssets.d.ts.map +1 -1
  275. package/lib/typescript/commonjs/ui/hooks/useAsyncAction.d.ts +2 -2
  276. package/lib/typescript/commonjs/ui/hooks/useAsyncAction.d.ts.map +1 -1
  277. package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts +4 -2
  278. package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts.map +1 -1
  279. package/lib/typescript/commonjs/ui/hooks/useOnlineStatus.d.ts +3 -2
  280. package/lib/typescript/commonjs/ui/hooks/useOnlineStatus.d.ts.map +1 -1
  281. package/lib/typescript/commonjs/ui/hooks/useSessionManagement.d.ts.map +1 -1
  282. package/lib/typescript/commonjs/ui/screens/FeedbackScreen.d.ts +2 -2
  283. package/lib/typescript/commonjs/ui/screens/FeedbackScreen.d.ts.map +1 -1
  284. package/lib/typescript/commonjs/ui/screens/FileManagementScreen.d.ts.map +1 -1
  285. package/lib/typescript/commonjs/ui/screens/HistoryViewScreen.d.ts.map +1 -1
  286. package/lib/typescript/commonjs/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
  287. package/lib/typescript/commonjs/ui/screens/ProfileScreen.d.ts.map +1 -1
  288. package/lib/typescript/commonjs/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
  289. package/lib/typescript/commonjs/ui/screens/fileManagement/PhotoPickerSection.d.ts.map +1 -1
  290. package/lib/typescript/commonjs/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
  291. package/lib/typescript/commonjs/ui/types/navigation.d.ts +20 -19
  292. package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
  293. package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts +5 -5
  294. package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts.map +1 -1
  295. package/lib/typescript/commonjs/ui/utils/netConnectivity.d.ts +17 -0
  296. package/lib/typescript/commonjs/ui/utils/netConnectivity.d.ts.map +1 -0
  297. package/lib/typescript/commonjs/ui/utils/oauthReturn.d.ts +15 -12
  298. package/lib/typescript/commonjs/ui/utils/oauthReturn.d.ts.map +1 -1
  299. package/lib/typescript/module/index.d.ts +5 -0
  300. package/lib/typescript/module/index.d.ts.map +1 -1
  301. package/lib/typescript/module/notifications/deviceNotifications.d.ts +173 -0
  302. package/lib/typescript/module/notifications/deviceNotifications.d.ts.map +1 -0
  303. package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts +11 -30
  304. package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts.map +1 -1
  305. package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts +5 -3
  306. package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts.map +1 -1
  307. package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
  308. package/lib/typescript/module/ui/components/OxySignInRequestSurface.d.ts +108 -0
  309. package/lib/typescript/module/ui/components/OxySignInRequestSurface.d.ts.map +1 -0
  310. package/lib/typescript/module/ui/components/SettingsIcon.d.ts +1 -1
  311. package/lib/typescript/module/ui/components/SettingsIcon.d.ts.map +1 -1
  312. package/lib/typescript/module/ui/components/authChooser/SignInEntryView.d.ts.map +1 -1
  313. package/lib/typescript/module/ui/components/authChooser/SignInRequestView.d.ts +18 -18
  314. package/lib/typescript/module/ui/components/authChooser/SignInRequestView.d.ts.map +1 -1
  315. package/lib/typescript/module/ui/components/authChooser/TroubleDisclosure.d.ts +3 -10
  316. package/lib/typescript/module/ui/components/authChooser/TroubleDisclosure.d.ts.map +1 -1
  317. package/lib/typescript/module/ui/components/authChooser/requestSurfaces.d.ts +8 -4
  318. package/lib/typescript/module/ui/components/authChooser/requestSurfaces.d.ts.map +1 -1
  319. package/lib/typescript/module/ui/components/authChooser/types.d.ts +18 -0
  320. package/lib/typescript/module/ui/components/authChooser/types.d.ts.map +1 -1
  321. package/lib/typescript/module/ui/components/payment/types.d.ts +6 -6
  322. package/lib/typescript/module/ui/components/payment/types.d.ts.map +1 -1
  323. package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
  324. package/lib/typescript/module/ui/context/commitSessionFlow.d.ts +0 -40
  325. package/lib/typescript/module/ui/context/commitSessionFlow.d.ts.map +1 -1
  326. package/lib/typescript/module/ui/context/oxyContextTypes.d.ts +4 -7
  327. package/lib/typescript/module/ui/context/oxyContextTypes.d.ts.map +1 -1
  328. package/lib/typescript/module/ui/context/useOxyAccountGraph.d.ts +0 -1
  329. package/lib/typescript/module/ui/context/useOxyAccountGraph.d.ts.map +1 -1
  330. package/lib/typescript/module/ui/hooks/queries/userCache.d.ts +2 -2
  331. package/lib/typescript/module/ui/hooks/queries/userCache.d.ts.map +1 -1
  332. package/lib/typescript/module/ui/hooks/useAssets.d.ts +1 -1
  333. package/lib/typescript/module/ui/hooks/useAssets.d.ts.map +1 -1
  334. package/lib/typescript/module/ui/hooks/useAsyncAction.d.ts +2 -2
  335. package/lib/typescript/module/ui/hooks/useAsyncAction.d.ts.map +1 -1
  336. package/lib/typescript/module/ui/hooks/useAuth.d.ts +4 -2
  337. package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
  338. package/lib/typescript/module/ui/hooks/useOnlineStatus.d.ts +3 -2
  339. package/lib/typescript/module/ui/hooks/useOnlineStatus.d.ts.map +1 -1
  340. package/lib/typescript/module/ui/hooks/useSessionManagement.d.ts.map +1 -1
  341. package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts +2 -2
  342. package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts.map +1 -1
  343. package/lib/typescript/module/ui/screens/FileManagementScreen.d.ts.map +1 -1
  344. package/lib/typescript/module/ui/screens/HistoryViewScreen.d.ts.map +1 -1
  345. package/lib/typescript/module/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
  346. package/lib/typescript/module/ui/screens/ProfileScreen.d.ts.map +1 -1
  347. package/lib/typescript/module/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
  348. package/lib/typescript/module/ui/screens/fileManagement/PhotoPickerSection.d.ts.map +1 -1
  349. package/lib/typescript/module/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
  350. package/lib/typescript/module/ui/types/navigation.d.ts +20 -19
  351. package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
  352. package/lib/typescript/module/ui/utils/fileManagement.d.ts +5 -5
  353. package/lib/typescript/module/ui/utils/fileManagement.d.ts.map +1 -1
  354. package/lib/typescript/module/ui/utils/netConnectivity.d.ts +17 -0
  355. package/lib/typescript/module/ui/utils/netConnectivity.d.ts.map +1 -0
  356. package/lib/typescript/module/ui/utils/oauthReturn.d.ts +15 -12
  357. package/lib/typescript/module/ui/utils/oauthReturn.d.ts.map +1 -1
  358. package/package.json +18 -8
  359. package/src/index.ts +32 -0
  360. package/src/notifications/deviceNotifications.ts +458 -0
  361. package/src/ui/boot/__tests__/coldBootNoIdpRedirect.test.ts +215 -0
  362. package/src/ui/boot/runProviderColdBoot.ts +24 -101
  363. package/src/ui/components/AvatarCameraBadge.tsx +1 -1
  364. package/src/ui/components/OxyAuthChooser.tsx +5 -4
  365. package/src/ui/components/OxyProvider.tsx +5 -6
  366. package/src/ui/components/OxySignInRequestSurface.tsx +202 -0
  367. package/src/ui/components/ProfileButton.tsx +1 -1
  368. package/src/ui/components/SettingsIcon.tsx +1 -1
  369. package/src/ui/components/authChooser/AccountsMenuView.tsx +1 -1
  370. package/src/ui/components/authChooser/SignInEntryView.tsx +9 -3
  371. package/src/ui/components/authChooser/SignInRequestView.tsx +78 -111
  372. package/src/ui/components/authChooser/TroubleDisclosure.tsx +3 -11
  373. package/src/ui/components/authChooser/primitives.tsx +1 -1
  374. package/src/ui/components/authChooser/requestSurfaces.tsx +15 -11
  375. package/src/ui/components/authChooser/types.ts +19 -0
  376. package/src/ui/components/fileManagement/AnimatedButton.tsx +1 -1
  377. package/src/ui/components/fileManagement/FileDetailsModal.tsx +1 -1
  378. package/src/ui/components/fileManagement/FileViewer.tsx +1 -1
  379. package/src/ui/components/fileManagement/UploadPreview.tsx +1 -1
  380. package/src/ui/components/modals/DeleteAccountModal.tsx +1 -1
  381. package/src/ui/components/payment/PaymentDetailsStep.tsx +1 -1
  382. package/src/ui/components/payment/PaymentMethodStep.tsx +1 -1
  383. package/src/ui/components/payment/PaymentReviewStep.tsx +1 -1
  384. package/src/ui/components/payment/PaymentSuccessStep.tsx +1 -1
  385. package/src/ui/components/payment/PaymentSummaryStep.tsx +1 -1
  386. package/src/ui/components/payment/types.ts +24 -24
  387. package/src/ui/components/styles/shadow.tsx +2 -2
  388. package/src/ui/context/OxyContext.tsx +15 -46
  389. package/src/ui/context/__tests__/commitSessionFlow.test.ts +0 -89
  390. package/src/ui/context/commitSessionFlow.ts +0 -61
  391. package/src/ui/context/oxyContextTypes.ts +4 -7
  392. package/src/ui/context/useOxyAccountGraph.ts +4 -4
  393. package/src/ui/hooks/queries/userCache.ts +169 -148
  394. package/src/ui/hooks/useAssets.ts +1 -1
  395. package/src/ui/hooks/useAsyncAction.ts +2 -2
  396. package/src/ui/hooks/useAuth.ts +4 -2
  397. package/src/ui/hooks/useOnlineStatus.ts +3 -2
  398. package/src/ui/hooks/useSessionManagement.ts +0 -2
  399. package/src/ui/screens/AccountMembersScreen.tsx +1 -1
  400. package/src/ui/screens/ConnectedAppsScreen.tsx +1 -1
  401. package/src/ui/screens/CreateAccountScreen.tsx +1 -1
  402. package/src/ui/screens/EditProfileFieldScreen.tsx +1 -1
  403. package/src/ui/screens/FAQScreen.tsx +1 -1
  404. package/src/ui/screens/FeedbackScreen.tsx +740 -574
  405. package/src/ui/screens/FileManagementScreen.tsx +2 -1
  406. package/src/ui/screens/HistoryViewScreen.tsx +4 -19
  407. package/src/ui/screens/LanguageSelectorScreen.tsx +1 -1
  408. package/src/ui/screens/ManageAccountScreen.tsx +1 -1
  409. package/src/ui/screens/PaymentGatewayScreen.tsx +1 -1
  410. package/src/ui/screens/PremiumSubscriptionScreen.tsx +2 -2
  411. package/src/ui/screens/PrivacySettingsScreen.tsx +1 -0
  412. package/src/ui/screens/ProfileScreen.tsx +6 -4
  413. package/src/ui/screens/UserListScreen.tsx +3 -3
  414. package/src/ui/screens/WelcomeNewUserScreen.tsx +6 -6
  415. package/src/ui/screens/fileManagement/FileLibraryError.tsx +1 -1
  416. package/src/ui/screens/fileManagement/FileListSection.tsx +1 -1
  417. package/src/ui/screens/fileManagement/PhotoPickerSection.tsx +3 -2
  418. package/src/ui/screens/fileManagement/UploadBar.tsx +1 -1
  419. package/src/ui/screens/trust/TrustCenterScreen.tsx +1 -1
  420. package/src/ui/screens/trust/TrustLeaderboardScreen.tsx +4 -3
  421. package/src/ui/screens/trust/TrustRewardsScreen.tsx +1 -1
  422. package/src/ui/types/navigation.ts +20 -19
  423. package/src/ui/utils/fileManagement.ts +108 -92
  424. package/src/ui/utils/netConnectivity.ts +27 -0
  425. package/src/ui/utils/oauthReturn.ts +15 -30
  426. package/lib/commonjs/ui/oauth/legacyRedirectLanes.js +0 -48
  427. package/lib/commonjs/ui/oauth/legacyRedirectLanes.js.map +0 -1
  428. package/lib/commonjs/ui/utils/crossOriginRestore.js +0 -140
  429. package/lib/commonjs/ui/utils/crossOriginRestore.js.map +0 -1
  430. package/lib/module/ui/oauth/legacyRedirectLanes.js +0 -44
  431. package/lib/module/ui/oauth/legacyRedirectLanes.js.map +0 -1
  432. package/lib/module/ui/utils/crossOriginRestore.js +0 -131
  433. package/lib/module/ui/utils/crossOriginRestore.js.map +0 -1
  434. package/lib/typescript/commonjs/ui/oauth/legacyRedirectLanes.d.ts +0 -40
  435. package/lib/typescript/commonjs/ui/oauth/legacyRedirectLanes.d.ts.map +0 -1
  436. package/lib/typescript/commonjs/ui/utils/crossOriginRestore.d.ts +0 -43
  437. package/lib/typescript/commonjs/ui/utils/crossOriginRestore.d.ts.map +0 -1
  438. package/lib/typescript/module/ui/oauth/legacyRedirectLanes.d.ts +0 -40
  439. package/lib/typescript/module/ui/oauth/legacyRedirectLanes.d.ts.map +0 -1
  440. package/lib/typescript/module/ui/utils/crossOriginRestore.d.ts +0 -43
  441. package/lib/typescript/module/ui/utils/crossOriginRestore.d.ts.map +0 -1
  442. package/src/ui/boot/__tests__/coldBootWebAuthMode.test.ts +0 -281
  443. package/src/ui/oauth/legacyRedirectLanes.ts +0 -43
  444. package/src/ui/utils/__tests__/crossOriginRestore.test.ts +0 -160
  445. package/src/ui/utils/crossOriginRestore.ts +0 -168
@@ -0,0 +1,414 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * The ONE place `@oxyhq/services` touches `expo-notifications`.
5
+ *
6
+ * Every Oxy app that receives push needs the identical adapter — native-only,
7
+ * dynamically imported, reading the OS permission and minting an EXPO push
8
+ * token — so it lives here instead of being copied into each app. The
9
+ * bearer-authenticated transport (`registerPushToken` / `unregisterPushToken`)
10
+ * already lives in `@oxyhq/core`; core may never import an `expo-*` module, and
11
+ * this adapter is the Expo-side half that closes that gap.
12
+ *
13
+ * ## Native-only by construction
14
+ *
15
+ * Every entry point resolves its null/no-op result from `Platform.OS` BEFORE the
16
+ * dynamic `import()`, so a web bundle never requests `expo-notifications` at all.
17
+ * `expo-notifications` and `expo-constants` are OPTIONAL peer dependencies: an
18
+ * app that does not use push never installs them, and a build without them
19
+ * degrades to "notifications unavailable" rather than throwing at
20
+ * module-evaluation time.
21
+ *
22
+ * ## The token is an EXPO push token — never a raw device token
23
+ *
24
+ * {@link getExpoPushToken} calls `getExpoPushTokenAsync()`, which returns the
25
+ * `ExponentPushToken[…]` handle Expo's push service delivers through — the only
26
+ * form it accepts. `getDevicePushTokenAsync()` — the raw APNs/FCM token — is
27
+ * deliberately NOT used anywhere: registering one of those looks entirely
28
+ * successful (the row is stored, the endpoint returns 200) and then every push
29
+ * silently fails at delivery time. `@oxyhq/core`'s `registerPushToken` rejects a
30
+ * raw device token before sending, and this module is the reason it never has to.
31
+ *
32
+ * ## The payload is untrusted
33
+ *
34
+ * Nothing here surfaces a notification's `title` / `body` / `subtitle`. The only
35
+ * payload that leaves this module is the raw `content.data` — the routing keys —
36
+ * typed `unknown`, so a caller has to validate it before acting on it and there
37
+ * is no exported shape that invites rendering push-delivered text. The
38
+ * foreground handler likewise answers with a visibility verdict and nothing else.
39
+ */
40
+
41
+ import { createLogger } from '@oxyhq/core';
42
+ import { Platform } from 'react-native';
43
+ const log = createLogger('deviceNotifications');
44
+ function isRecord(value) {
45
+ return typeof value === 'object' && value !== null;
46
+ }
47
+
48
+ /**
49
+ * Load `expo-notifications`, or `null` when it cannot serve this platform/build.
50
+ *
51
+ * The web guard runs before the `import()`, so a web bundle never reaches for the
52
+ * native module. The dynamic import is intentional: the module registry caches
53
+ * it, so repeated calls are cheap and no module-level mutable cache is
54
+ * introduced here.
55
+ */
56
+ async function loadNotifications() {
57
+ if (Platform.OS === 'web') {
58
+ return null;
59
+ }
60
+ try {
61
+ return await import('expo-notifications');
62
+ } catch (error) {
63
+ log.warn('expo-notifications is unavailable in this build — push is disabled', {
64
+ method: 'loadNotifications'
65
+ }, error);
66
+ return null;
67
+ }
68
+ }
69
+
70
+ /**
71
+ * The EAS project id an Expo push token is minted against, or `null` when the
72
+ * app config carries none.
73
+ *
74
+ * Resolved exactly the way `expo-notifications` resolves it internally
75
+ * (`easConfig.projectId`, then `expoConfig.extra.eas.projectId`) and then handed
76
+ * BACK to `getExpoPushTokenAsync` explicitly, so the two can never disagree.
77
+ * Reading it here is what turns "no project id" from an opaque
78
+ * `ERR_NOTIFICATIONS_NO_EXPERIENCE_ID` rejection into a named, actionable state
79
+ * instead of one more entry in the indistinguishable "permission denied /
80
+ * offline" bucket.
81
+ *
82
+ * A missing `expo-constants` lands on the same `null` outcome — the single
83
+ * actionable warning is emitted once by the caller, so this path only records
84
+ * the extra detail at debug level rather than warning twice for one condition.
85
+ */
86
+ async function easProjectId() {
87
+ let constants;
88
+ try {
89
+ constants = (await import('expo-constants')).default;
90
+ } catch (error) {
91
+ log.debug('expo-constants is unavailable in this build — no EAS project id can be resolved', {
92
+ method: 'easProjectId'
93
+ }, error);
94
+ return null;
95
+ }
96
+ const fromEasConfig = constants.easConfig?.projectId;
97
+ if (typeof fromEasConfig === 'string' && fromEasConfig.length > 0) {
98
+ return fromEasConfig;
99
+ }
100
+ const extra = constants.expoConfig?.extra;
101
+ const eas = isRecord(extra) ? extra.eas : undefined;
102
+ const projectId = isRecord(eas) ? eas.projectId : undefined;
103
+ return typeof projectId === 'string' && projectId.length > 0 ? projectId : null;
104
+ }
105
+
106
+ /**
107
+ * The platform tag the push-token registry stores this installation under, or
108
+ * `null` on a platform Oxy does not deliver push to.
109
+ *
110
+ * Synchronous and import-free — the answer is a property of the bundle, not of
111
+ * any native module.
112
+ *
113
+ * Web is `null` on purpose: the registry accepts a `web` platform, but browser
114
+ * push needs a VAPID key + service-worker subscription no Oxy app has wired, so
115
+ * there is no token to register and claiming otherwise would store a row nothing
116
+ * can ever deliver to.
117
+ */
118
+ export function pushTokenPlatform() {
119
+ return Platform.OS === 'ios' || Platform.OS === 'android' ? Platform.OS : null;
120
+ }
121
+
122
+ /**
123
+ * Whether the OS notification permission is ALREADY granted.
124
+ *
125
+ * Never prompts, so an app can re-check on every cold boot without ever asking
126
+ * the user twice. Use {@link requestNotificationPermission} for the one place
127
+ * that is allowed to show the system dialog.
128
+ */
129
+ export async function hasNotificationPermission() {
130
+ const notifications = await loadNotifications();
131
+ if (!notifications) {
132
+ return false;
133
+ }
134
+ try {
135
+ const permissions = await notifications.getPermissionsAsync();
136
+ return permissions.granted === true;
137
+ } catch (error) {
138
+ log.warn('could not read the notification permission', {
139
+ method: 'hasNotificationPermission'
140
+ }, error);
141
+ return false;
142
+ }
143
+ }
144
+
145
+ /**
146
+ * Ensure the OS notification permission, prompting at most once.
147
+ *
148
+ * An installation that already answered the system dialog is never asked again:
149
+ * an already-granted permission resolves `true` without a second dialog, and a
150
+ * denial with `canAskAgain: false` resolves `false` without issuing a request
151
+ * the OS would silently ignore.
152
+ *
153
+ * @returns Whether notifications are granted once this call is done.
154
+ */
155
+ export async function requestNotificationPermission() {
156
+ const notifications = await loadNotifications();
157
+ if (!notifications) {
158
+ return false;
159
+ }
160
+ try {
161
+ const existing = await notifications.getPermissionsAsync();
162
+ if (existing.granted === true) {
163
+ return true;
164
+ }
165
+ if (existing.canAskAgain === false) {
166
+ return false;
167
+ }
168
+ const requested = await notifications.requestPermissionsAsync();
169
+ return requested.granted === true;
170
+ } catch (error) {
171
+ log.warn('the notification permission could not be resolved', {
172
+ method: 'requestNotificationPermission'
173
+ }, error);
174
+ return false;
175
+ }
176
+ }
177
+
178
+ /**
179
+ * This installation's Expo push token (`ExponentPushToken[…]`), or `null` when
180
+ * one cannot be minted.
181
+ *
182
+ * Deliberately `getExpoPushTokenAsync` — see the module header for why the raw
183
+ * device-token variant is never used.
184
+ *
185
+ * Every `null` is logged with the reason it happened. A missing EAS project id
186
+ * in particular is a BUILD MISCONFIGURATION, not a user state: no token can ever
187
+ * be minted, so push is off for every install of that build until the config is
188
+ * fixed. It is reported as such rather than blending into the
189
+ * indistinguishable "permission denied / offline" bucket.
190
+ */
191
+ export async function getExpoPushToken() {
192
+ const notifications = await loadNotifications();
193
+ if (!notifications) {
194
+ return null;
195
+ }
196
+ const projectId = await easProjectId();
197
+ if (!projectId) {
198
+ log.warn('no EAS project id in the app config (expo.extra.eas.projectId) — an Expo push token cannot be minted, so push is disabled for this build', {
199
+ method: 'getExpoPushToken'
200
+ });
201
+ return null;
202
+ }
203
+ try {
204
+ const token = await notifications.getExpoPushTokenAsync({
205
+ projectId
206
+ });
207
+ if (token.data.length === 0) {
208
+ log.warn('the Expo push service returned an empty token', {
209
+ method: 'getExpoPushToken'
210
+ });
211
+ return null;
212
+ }
213
+ return token.data;
214
+ } catch (error) {
215
+ log.warn('could not mint an Expo push token', {
216
+ method: 'getExpoPushToken'
217
+ }, error);
218
+ return null;
219
+ }
220
+ }
221
+
222
+ /**
223
+ * Take the payload of the notification that COLD-LAUNCHED the app, if any.
224
+ *
225
+ * "Take" is literal: the response is cleared from `expo-notifications` once
226
+ * read, so a listener attached later in the same launch is not handed the same
227
+ * tap again. Clearing is best-effort across OS/module versions, so a caller that
228
+ * must not act twice still needs its own idempotency ledger.
229
+ *
230
+ * @returns The raw, untrusted `content.data` of the launching notification, or
231
+ * `null`. Parsing/validation is the caller's job.
232
+ */
233
+ export async function takeLaunchNotificationData() {
234
+ const notifications = await loadNotifications();
235
+ if (!notifications) {
236
+ return null;
237
+ }
238
+ try {
239
+ const response = notifications.getLastNotificationResponse();
240
+ if (!response) {
241
+ return null;
242
+ }
243
+ const data = response.notification.request.content.data;
244
+ try {
245
+ notifications.clearLastNotificationResponse();
246
+ } catch (clearError) {
247
+ log.warn('could not clear the launching notification response', {
248
+ method: 'takeLaunchNotificationData'
249
+ }, clearError);
250
+ }
251
+ return data;
252
+ } catch (error) {
253
+ log.warn('could not read the launching notification', {
254
+ method: 'takeLaunchNotificationData'
255
+ }, error);
256
+ return null;
257
+ }
258
+ }
259
+
260
+ /**
261
+ * What the OS should do with a notification that arrives while the app is
262
+ * FOREGROUNDED.
263
+ *
264
+ * `'suppress'` is `expo-notifications`' own default for a foregrounded app, so a
265
+ * decision function that only ever returns `'show'` for the payloads it
266
+ * recognises leaves every other notification exactly as it behaves today.
267
+ */
268
+
269
+ /**
270
+ * Whether the process-wide foreground handler has already been ATTEMPTED.
271
+ *
272
+ * `setNotificationHandler` is global, last-writer-wins process state, so this is
273
+ * a one-shot install rather than something a mount/unmount cycle owns. A failed
274
+ * attempt is deliberately not retried: the only failure modes are permanent for
275
+ * the life of the process (web, a build without the native module, a native
276
+ * module that threw on registration).
277
+ *
278
+ * Module-scoped and only ever touched from an async install call — never read
279
+ * during render, so the React Compiler has no memoizable position to freeze it
280
+ * into.
281
+ */
282
+ let foregroundHandlerAttempted = false;
283
+
284
+ /** How prominently Android surfaces a channel's notifications. */
285
+
286
+ /** An Android notification channel this app delivers on. */
287
+
288
+ /**
289
+ * Create (or update) an Android notification channel.
290
+ *
291
+ * A no-op everywhere but Android: iOS has no channels, and web never loads the
292
+ * native module. Call it BEFORE registering a push token, so the very first
293
+ * notification the server sends already has a channel to land on.
294
+ *
295
+ * Failure is non-fatal and logged: a missing channel costs visibility, and
296
+ * refusing to register a token over it would cost the feature entirely.
297
+ *
298
+ * @returns Whether the channel was actually created (`false` off Android, or
299
+ * when the native module is unavailable, or when creation failed).
300
+ */
301
+ export async function ensureNotificationChannel(spec) {
302
+ if (Platform.OS !== 'android') {
303
+ return false;
304
+ }
305
+ const notifications = await loadNotifications();
306
+ if (!notifications) {
307
+ return false;
308
+ }
309
+ try {
310
+ await notifications.setNotificationChannelAsync(spec.id, {
311
+ name: spec.name,
312
+ importance: spec.importance === 'high' ? notifications.AndroidImportance.HIGH : notifications.AndroidImportance.DEFAULT,
313
+ ...(spec.description ? {
314
+ description: spec.description
315
+ } : {})
316
+ });
317
+ return true;
318
+ } catch (error) {
319
+ log.warn('could not create the notification channel', {
320
+ method: 'ensureNotificationChannel',
321
+ channelId: spec.id
322
+ }, error);
323
+ return false;
324
+ }
325
+ }
326
+
327
+ /**
328
+ * Install the ONE process-wide handler that decides whether an incoming
329
+ * notification is shown while the app is in the FOREGROUND.
330
+ *
331
+ * Without a handler, `expo-notifications` shows nothing at all while the app is
332
+ * open — which is exactly when a time-critical notification (a "Sign in with
333
+ * Oxy" approval request, say) matters most, because the user is already holding
334
+ * the phone.
335
+ *
336
+ * The handler ONLY decides visibility. It never navigates, never acts on the
337
+ * notification, and never reads the payload for display — `decide` is handed the
338
+ * raw, untrusted `content.data` and may answer nothing but `'show'` /
339
+ * `'suppress'`. Acting on a notification stays with a TAP, routed by
340
+ * {@link subscribeToNotificationResponses}. No notification actions/categories
341
+ * are registered here, so the banner cannot carry an action button.
342
+ *
343
+ * The one-shot latch is set BEFORE the first `await`, so concurrent callers
344
+ * cannot both reach `setNotificationHandler`.
345
+ *
346
+ * @param decide - Maps the raw, untrusted payload to a presentation verdict.
347
+ * Must not throw; a throw is reported by the OS as a handling error and the
348
+ * notification is dropped.
349
+ * @returns Whether a handler was installed by THIS call (`false` on a repeat
350
+ * call, on web, or when the native module is unavailable).
351
+ */
352
+ export async function installForegroundNotificationHandler(decide) {
353
+ if (foregroundHandlerAttempted) {
354
+ return false;
355
+ }
356
+ foregroundHandlerAttempted = true;
357
+ const notifications = await loadNotifications();
358
+ if (!notifications) {
359
+ return false;
360
+ }
361
+ try {
362
+ notifications.setNotificationHandler({
363
+ handleNotification: async notification => {
364
+ const data = notification.request.content.data;
365
+ const show = decide(data) === 'show';
366
+ return {
367
+ // Banner: the whole point — make the notification visible on screen.
368
+ shouldShowBanner: show,
369
+ // Notification centre: so the user can still review it after
370
+ // dismissing the banner.
371
+ shouldShowList: show,
372
+ // No sound: the app is foregrounded, so the user is already looking at
373
+ // the screen the banner appears on.
374
+ shouldPlaySound: false,
375
+ // Badging is an app-level unread concept this adapter has no view of.
376
+ shouldSetBadge: false
377
+ };
378
+ }
379
+ });
380
+ return true;
381
+ } catch (error) {
382
+ log.warn('could not install the foreground notification handler', {
383
+ method: 'installForegroundNotificationHandler'
384
+ }, error);
385
+ return false;
386
+ }
387
+ }
388
+
389
+ /**
390
+ * Subscribe to notification TAPS (responses) while the app is running.
391
+ *
392
+ * @param listener - Receives the raw, untrusted `content.data` of the tapped
393
+ * notification. Parsing/validation is the caller's job.
394
+ * @returns An unsubscribe function. Safe to call even if the subscription could
395
+ * not be established.
396
+ */
397
+ export async function subscribeToNotificationResponses(listener) {
398
+ const notifications = await loadNotifications();
399
+ if (!notifications) {
400
+ return () => undefined;
401
+ }
402
+ try {
403
+ const subscription = notifications.addNotificationResponseReceivedListener(response => {
404
+ listener(response.notification.request.content.data);
405
+ });
406
+ return () => subscription.remove();
407
+ } catch (error) {
408
+ log.warn('could not subscribe to notification taps', {
409
+ method: 'subscribeToNotificationResponses'
410
+ }, error);
411
+ return () => undefined;
412
+ }
413
+ }
414
+ //# sourceMappingURL=deviceNotifications.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createLogger","Platform","log","isRecord","value","loadNotifications","OS","error","warn","method","easProjectId","constants","default","debug","fromEasConfig","easConfig","projectId","length","extra","expoConfig","eas","undefined","pushTokenPlatform","hasNotificationPermission","notifications","permissions","getPermissionsAsync","granted","requestNotificationPermission","existing","canAskAgain","requested","requestPermissionsAsync","getExpoPushToken","token","getExpoPushTokenAsync","data","takeLaunchNotificationData","response","getLastNotificationResponse","notification","request","content","clearLastNotificationResponse","clearError","foregroundHandlerAttempted","ensureNotificationChannel","spec","setNotificationChannelAsync","id","name","importance","AndroidImportance","HIGH","DEFAULT","description","channelId","installForegroundNotificationHandler","decide","setNotificationHandler","handleNotification","show","shouldShowBanner","shouldShowList","shouldPlaySound","shouldSetBadge","subscribeToNotificationResponses","listener","subscription","addNotificationResponseReceivedListener","remove"],"sourceRoot":"../../../src","sources":["notifications/deviceNotifications.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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,YAAY,QAAQ,aAAa;AAE1C,SAASC,QAAQ,QAAQ,cAAc;AAEvC,MAAMC,GAAG,GAAGF,YAAY,CAAC,qBAAqB,CAAC;AAK/C,SAASG,QAAQA,CAACC,KAAc,EAAoC;EAClE,OAAO,OAAOA,KAAK,KAAK,QAAQ,IAAIA,KAAK,KAAK,IAAI;AACpD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeC,iBAAiBA,CAAA,EAAwC;EACtE,IAAIJ,QAAQ,CAACK,EAAE,KAAK,KAAK,EAAE;IACzB,OAAO,IAAI;EACb;EACA,IAAI;IACF,OAAO,MAAM,MAAM,CAAC,oBAAoB,CAAC;EAC3C,CAAC,CAAC,OAAOC,KAAK,EAAE;IACdL,GAAG,CAACM,IAAI,CACN,oEAAoE,EACpE;MAAEC,MAAM,EAAE;IAAoB,CAAC,EAC/BF,KACF,CAAC;IACD,OAAO,IAAI;EACb;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeG,YAAYA,CAAA,EAA2B;EACpD,IAAIC,SAAqC;EACzC,IAAI;IACFA,SAAS,GAAG,CAAC,MAAM,MAAM,CAAC,gBAAgB,CAAC,EAAEC,OAAO;EACtD,CAAC,CAAC,OAAOL,KAAK,E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,CACN,0CAA0C,EAC1C;MAAEC,MAAM,EAAE;IAAmC,CAAC,EAC9CF,KACF,CAAC;IACD,OAAO,MAAMc,SAAS;EACxB;AACF","ignoreList":[]}
@@ -2,10 +2,9 @@
2
2
 
3
3
  import { logger as loggerUtil, runSessionColdBoot } from '@oxyhq/core';
4
4
  import { loadPersistedDeviceCredential } from "../utils/deviceCredential.js";
5
- import { consumeSilentOAuthError, isSilentRestoreEligibleOrigin, maybeStartSilentOAuthRestore } from "../utils/crossOriginRestore.js";
6
- import { tryCompleteOAuthReturn, consumeHubSyncFailure } from "../utils/oauthReturn.js";
5
+ import { tryCompleteOAuthReturn } from "../utils/oauthReturn.js";
7
6
  import { isWebBrowser } from "../utils/isWebBrowser.js";
8
- import { allowsAutomaticIdpRedirect } from "../oauth/legacyRedirectLanes.js";
7
+ import { isNetConnectivityExplicitlyOffline } from "../utils/netConnectivity.js";
9
8
  /** How long the cold boot waits for the post-boot SessionClient handoff (ms). */
10
9
  export const SESSION_HANDOFF_DEADLINE_MS = 6000;
11
10
 
@@ -51,8 +50,8 @@ async function detectOfflineHint() {
51
50
  setTimeout(() => resolve(null), OFFLINE_PROBE_TIMEOUT_MS);
52
51
  })]);
53
52
  // `null` ⇒ the probe timed out (unknown → assume online). Only an explicit
54
- // `isConnected === false` disables the network steps.
55
- return state?.isConnected === false;
53
+ // disconnected / unreachable verdict disables the network steps.
54
+ return isNetConnectivityExplicitlyOffline(state);
56
55
  } catch {
57
56
  // NetInfo missing / probe threw — never block sign-in on a probe failure.
58
57
  return false;
@@ -62,19 +61,19 @@ async function detectOfflineHint() {
62
61
  * Device-first cold boot for `@oxyhq/services` providers.
63
62
  *
64
63
  * Ordered pipeline:
65
- * 1. Complete OAuth authorization-code return (web)
64
+ * 1. Complete an OAuth authorization-code return already on the URL (web)
66
65
  * 2. `runSessionColdBoot` — device-secret mint (+ native shared-key, or the
67
66
  * primary-identity-key lane in `sessionMode: 'identity'`)
68
- * 3. Silent OAuth for all web apps when mint finds no session
69
67
  *
70
- * Steps 1 and 3 are ACCOUNT-MODE ONLY: both commit whichever account the IdP
71
- * resolves, which for an identity-bound client is somebody else's account by
72
- * construction. In `'identity'` mode the boot is exactly step 2.
68
+ * Step 1 is ACCOUNT-MODE ONLY: it commits whichever account the IdP resolves,
69
+ * which for an identity-bound client is somebody else's account by construction.
70
+ * In `'identity'` mode the boot is exactly step 2.
73
71
  *
74
- * Step 3 is additionally REDIRECT-MODE ONLY: it navigates the top-level window
75
- * with no user gesture behind it, which `webAuthMode: 'popup'` exists to
76
- * eliminate. In popup mode the boot is steps 1 and 2, and a domain with no local
77
- * credential simply resolves signed out. See `allowsAutomaticIdpRedirect`.
72
+ * The boot NEVER navigates the top-level window. There is no automatic
73
+ * `prompt=none` bounce to the IdP: a web origin with no local device credential
74
+ * resolves SIGNED OUT and waits for the user's next explicit "Continue with
75
+ * Oxy", which opens a popup from a real gesture (#691 phase 7b). Step 1 is not a
76
+ * navigation — it only consumes a code that is already in the address bar.
78
77
  */
79
78
  export async function runProviderColdBoot(opts) {
80
79
  const {
@@ -82,10 +81,8 @@ export async function runProviderColdBoot(opts) {
82
81
  authStore,
83
82
  clientId,
84
83
  authRedirectUri,
85
- authorizeBaseUrl,
86
84
  sessionMode = 'account',
87
85
  identity,
88
- webAuthMode = 'redirect',
89
86
  sessionClient,
90
87
  syncDeviceCredentialToHost,
91
88
  commitSession,
@@ -95,28 +92,18 @@ export async function runProviderColdBoot(opts) {
95
92
  const identityBound = sessionMode === 'identity';
96
93
  setTokenReady(false);
97
94
  try {
98
- // MODE-INDEPENDENT URL cleanup, deliberately so: both consume query params a
99
- // PREVIOUS redirect-mode session left in the address bar (`?error=login_required`
100
- // from a silent authorize, `?hub_sync=failed` from the hub) and restore the
101
- // page the visit started on. Flipping an app to popup mode must not strand
102
- // those params, so neither is gated on `webAuthMode`. Neither starts a
103
- // navigation they only rewrite the URL via `history.replaceState`.
104
- consumeSilentOAuthError();
105
- consumeHubSyncFailure();
106
-
107
- // The redirect transport's RETURN leg — also NOT gated on `webAuthMode`. A
108
- // popup-mode app legitimately lands here with `?code=` whenever the browser
109
- // blocked the popup and `startWebOAuthSignIn` fell back to a full-page
110
- // redirect (`popup-blocked` / `popup-navigation-failed`), and an app that
111
- // switched modes mid-flight must not be stranded with a dead `?code=`
112
- // either. It consumes a code already on the URL; it never starts one.
95
+ // The redirect transport's RETURN leg. An app reaches it whenever the browser
96
+ // BLOCKED the sign-in popup and `startWebOAuthSignIn` fell back to a
97
+ // full-page redirect (`popup-blocked` / `popup-navigation-failed`), so it is
98
+ // load-bearing even though nothing here ever starts a redirect. It consumes a
99
+ // code (or a stale OAuth `error`) already in the address bar and rewrites the
100
+ // URL via `history.replaceState`; it never begins a navigation.
113
101
  const oauthCompleted = identityBound ? false : await tryCompleteOAuthReturn({
114
102
  oxyServices,
115
103
  clientId,
116
104
  authRedirectUri,
117
105
  commitSession: input => commitSession(input, {
118
- activate: true,
119
- hubSync: false
106
+ activate: true
120
107
  })
121
108
  });
122
109
  if (oauthCompleted) {
@@ -130,7 +117,7 @@ export async function runProviderColdBoot(opts) {
130
117
  // burning the overall deadline on a mint that cannot succeed. Any ambiguity
131
118
  // resolves to "online" — the network steps still run.
132
119
  const offline = await detectOfflineHint();
133
- const outcome = await runSessionColdBoot({
120
+ await runSessionColdBoot({
134
121
  oxy: oxyServices,
135
122
  store: authStore,
136
123
  platform: {
@@ -192,37 +179,6 @@ export async function runProviderColdBoot(opts) {
192
179
  }
193
180
  }
194
181
  });
195
-
196
- // Silent cross-origin OAuth restore (web cross-app SSO): a full-page
197
- // `prompt=none` bounce to the IdP when the mint found no local session.
198
- //
199
- // TRANSPORT gate (`allowsAutomaticIdpRedirect`): `webAuthMode: 'popup'`
200
- // FORBIDS this lane. It navigates the top-level window with no user gesture
201
- // behind it, which is precisely what popup mode exists to eliminate — a
202
- // popup-mode domain without a local credential resolves signed out right
203
- // here and waits for the user's next explicit "Continue with Oxy" (issue
204
- // #691, "Cold boot and cross-domain behavior"). `'redirect'` — still the
205
- // default and the compatibility path — reaches this lane unchanged, and this
206
- // whole block disappears with the transport in phase 7b.
207
- //
208
- // ORIGIN gate: same as the hub-sync WRITE side (`syncHubAfterSignIn`) —
209
- // official web origins only, never the IdP hub itself, and — unlike the
210
- // write side — never a loopback / local-dev origin (which must not be
211
- // bounced to a hosted IdP on cold boot). The authorize endpoint is
212
- // env-configurable so a local/staging app targets its own IdP instead of
213
- // production.
214
- const webOrigin = isWebBrowser() ? globalThis.location?.origin : undefined;
215
- if (!identityBound && allowsAutomaticIdpRedirect(webAuthMode) && clientId && outcome.kind !== 'session' && webOrigin && isSilentRestoreEligibleOrigin(webOrigin)) {
216
- const redirected = await maybeStartSilentOAuthRestore({
217
- oxyServices,
218
- clientId,
219
- redirectUri: authRedirectUri,
220
- authorizeBaseUrl
221
- });
222
- if (redirected) {
223
- return;
224
- }
225
- }
226
182
  } catch (error) {
227
183
  if (__DEV__) {
228
184
  loggerUtil.error('Cold boot error', error instanceof Error ? error : new Error(String(error)), {
@@ -1 +1 @@
1
- {"version":3,"names":["logger","loggerUtil","runSessionColdBoot","loadPersistedDeviceCredential","consumeSilentOAuthError","isSilentRestoreEligibleOrigin","maybeStartSilentOAuthRestore","tryCompleteOAuthReturn","consumeHubSyncFailure","isWebBrowser","allowsAutomaticIdpRedirect","SESSION_HANDOFF_DEADLINE_MS","COLD_BOOT_OVERALL_DEADLINE_MS","OFFLINE_PROBE_TIMEOUT_MS","detectOfflineHint","online","globalThis","navigator","onLine","NetInfo","state","Promise","race","default","fetch","resolve","setTimeout","isConnected","runProviderColdBoot","opts","oxyServices","authStore","clientId","authRedirectUri","authorizeBaseUrl","sessionMode","identity","webAuthMode","sessionClient","syncDeviceCredentialToHost","commitSession","markAuthResolved","setTokenReady","identityBound","oauthCompleted","input","activate","hubSync","offline","outcome","oxy","store","platform","isWeb","isNative","overallDeadlineMs","isOffline","onStepDeadline","stepId","warn","component","method","onSession","session","handoff","sessionId","accessToken","userId","handoffDeadlineId","finally","undefined","clearTimeout","onSignedOut","cred","start","socketError","__DEV__","debug","onStepError","id","error","webOrigin","location","origin","kind","redirected","redirectUri","Error","String"],"sourceRoot":"../../../../src","sources":["ui/boot/runProviderColdBoot.ts"],"mappings":";;AAAA,SACEA,MAAM,IAAIC,UAAU,EACpBC,kBAAkB,QAKb,aAAa;AAEpB,SAASC,6BAA6B,QAAQ,8BAA2B;AACzE,SACEC,uBAAuB,EACvBC,6BAA6B,EAC7BC,4BAA4B,QACvB,gCAA6B;AACpC,SAASC,sBAAsB,EAAEC,qBAAqB,QAAQ,yBAAsB;AACpF,SAASC,YAAY,QAAQ,0BAAuB;AACpD,SAASC,0BAA0B,QAAQ,iCAA8B;AAIzE;AACA,OAAO,MAAMC,2BAA2B,GAAG,IAAI;;AAE/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,6BAA6B,GAAG,MAAM;;AAEnD;AACA;AACA;AACA;AACA;AACA,MAAMC,wBAAwB,GAAG,GAAG;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeC,iBAAiBA,CAAA,EAAqB;EACnD,IAAI;IACF,IAAIL,YAAY,CAAC,CAAC,EAAE;MAClB,MAAMM,MAAM,GAAIC,UAAU,CAA0CC,SAAS,EAAEC,MAAM;MACrF;MACA,OAAOH,MAAM,KAAK,KAAK;IACzB;IACA,MAAMI,OAAO,GAAG,MAAM,MAAM,CAAC,iCAAiC,CAAC;IAC/D,MAAMC,KAAK,GAAG,MAAMC,OAAO,CAACC,IAAI,CAAC,CAC/BH,OAAO,CAACI,OAAO,CAACC,KAAK,CAAC,CAAC,EACvB,IAAIH,OAAO,CAAQI,OAAO,IAAK;MAC7BC,UAAU,CAAC,MAAMD,OAAO,CAAC,IAAI,CAAC,EAAEZ,wBAAwB,CAAC;IAC3D,CAAC,CAAC,CACH,CAAC;IACF;IACA;IACA,OAAOO,KAAK,EAAEO,WAAW,KAAK,KA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AC,CAAC;EACpB;AACF","ignoreList":[]}
1
+ {"version":3,"names":["logger","loggerUtil","runSessionColdBoot","loadPersistedDeviceCredential","tryCompleteOAuthReturn","isWebBrowser","isNetConnectivityExplicitlyOffline","SESSION_HANDOFF_DEADLINE_MS","COLD_BOOT_OVERALL_DEADLINE_MS","OFFLINE_PROBE_TIMEOUT_MS","detectOfflineHint","online","globalThis","navigator","onLine","NetInfo","state","Promise","race","default","fetch","resolve","setTimeout","runProviderColdBoot","opts","oxyServices","authStore","clientId","authRedirectUri","sessionMode","identity","sessionClient","syncDeviceCredentialToHost","commitSession","markAuthResolved","setTokenReady","identityBound","oauthCompleted","input","activate","offline","oxy","store","platform","isWeb","isNative","overallDeadlineMs","isOffline","onStepDeadline","stepId","warn","component","method","onSession","session","handoff","sessionId","accessToken","userId","handoffDeadlineId","finally","undefined","clearTimeout","onSignedOut","cred","start","socketError","__DEV__","debug","onStepError","id","error","Error","String"],"sourceRoot":"../../../../src","sources":["ui/boot/runProviderColdBoot.ts"],"mappings":";;AAAA,SACEA,MAAM,IAAIC,UAAU,EACpBC,kBAAkB,QAKb,aAAa;AAEpB,SAASC,6BAA6B,QAAQ,8BAA2B;AACzE,SAASC,sBAAsB,QAAQ,yBAAsB;AAC7D,SAASC,YAAY,QAAQ,0BAAuB;AACpD,SAASC,kCAAkC,QAAQ,6BAA0B;AAG7E;AACA,OAAO,MAAMC,2BAA2B,GAAG,IAAI;;AAE/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,6BAA6B,GAAG,MAAM;;AAEnD;AACA;AACA;AACA;AACA;AACA,MAAMC,wBAAwB,GAAG,GAAG;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeC,iBAAiBA,CAAA,EAAqB;EACnD,IAAI;IACF,IAAIL,YAAY,CAAC,CAAC,EAAE;MAClB,MAAMM,MAAM,GAAIC,UAAU,CAA0CC,SAAS,EAAEC,MA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MAAAA,CAAA,KAAY;QACvB,MAAM/B,0BAA0B,CAAC,CAAC;QAClC,MAAMgC,IAAI,GAAG,MAAM7D,6BAA6B,CAACuB,SAAS,CAAC;QAC3D,IAAIsC,IAAI,EAAE;UACR,IAAI;YACF,MAAMjC,aAAa,CAACkC,KAAK,CAAC,CAAC;UAC7B,CAAC,CAAC,OAAOC,WAAW,EAAE;YACpB,IAAIC,OAAO,EAAE;cACXlE,UAAU,CAACmE,KAAK,CACd,wCAAwC,EACxC;gBAAEjB,SAAS,EAAE;cAAsB,CAAC,EACpCe,WACF,CAAC;YACH;UACF;QACF;QACAhC,gBAAgB,CAAC,CAAC;MACpB,CAAC;MACDmC,WAAW,EAAEA,CAACC,EAAE,EAAEC,KAAK,KAAK;QAC1B,IAAIJ,OAAO,EAAE;UACXlE,UAAU,CAACmE,KAAK,CACd,mBAAmBE,EAAE,wCAAwC,EAC7D;YAAEnB,SAAS,EAAE;UAAsB,CAAC,EACpCoB,KACF,CAAC;QACH;MACF;IACF,CAAC,CAAC;EACJ,CAAC,CAAC,OAAOA,KAAK,EAAE;IACd,IAAIJ,OAAO,EAAE;MACXlE,UAAU,CAACsE,KAAK,CACd,iBAAiB,EACjBA,KAAK,YAAYC,KAAK,GAAGD,KAAK,GAAG,IAAIC,KAAK,CAACC,MAAM,CAACF,KAAK,CAAC,CAAC,EACzD;QAAEpB,SAAS,EAAE;MAAsB,CACrC,CAAC;IACH;EACF,CAAC,SAAS;IACRjB,gBAAgB,CAAC,CAAC;EACpB;AACF","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  import { View } from 'react-native';
4
- import { Ionicons } from '@expo/vector-icons';
4
+ import Ionicons from '@expo/vector-icons/Ionicons';
5
5
  import { useTheme } from '@oxyhq/bloom/theme';
6
6
 
7
7
  /**
@@ -1 +1 @@
1
- {"version":3,"names":["View","Ionicons","useTheme","jsx","_jsx","badgeStyle","position","right","bottom","width","height","borderRadius","alignItems","justifyContent","borderWidth","AvatarCameraBadge","theme","style","className","children","name","size","color","colors","primaryForeground"],"sourceRoot":"../../../../src","sources":["ui/components/AvatarCameraBadge.tsx"],"mappings":";;AACA,SAASA,IAAI,QAAwB,cAAc;AACnD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,QAAQ,QAAQ,oBAAoB;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,SAAAC,GAAA,IAAAC,IAAA;AAQA,MAAMC,UAAqB,GAAG;EAC5BC,QAAQ,EAAE,UAAU;EACpBC,KAAK,EAAE,CAAC;EACRC,MAAM,EAAE,CAAC;EACTC,KAAK,EAAE,EAAE;EACTC,MAAM,EAAE,EAAE;EACVC,YAAY,EAAE,EAAE;EAChBC,UAAU,EAAE,QAAQ;EACpBC,cAAc,EAAE,QAAQ;EACxBC,WAAW,EAAE;AACf,CAAC;AAED,MAAMC,iBAA2B,GAAGA,CAAA,KAAM;EACxC,MAAMC,KAAK,GAAGd,QAAQ,CAAC,CAAC;EACxB,oBACEE,IAAA,CAACJ,IAAI;IAACiB,KAAK,EAAEZ,UAAW;IAACa,SAAS,EAAC,mCAAmC;IAAAC,QAAA,eACpEf,IAAA,CAACH,QAAQ;MAACmB,IAAI,EAAC,QAAQ;MAACC,IAAI,EAAE,EAAG;MAACC,KAAK,EAAEN,KAAK,CAACO,MAAM,CAACC;IAAkB,CAAE;EAAC,CACvE,CAAC;AAEX,CAAC;AAED,eAAeT,iBAAiB","ignoreList":[]}
1
+ {"version":3,"names":["View","Ionicons","useTheme","jsx","_jsx","badgeStyle","position","right","bottom","width","height","borderRadius","alignItems","justifyContent","borderWidth","AvatarCameraBadge","theme","style","className","children","name","size","color","colors","primaryForeground"],"sourceRoot":"../../../../src","sources":["ui/components/AvatarCameraBadge.tsx"],"mappings":";;AACA,SAASA,IAAI,QAAwB,cAAc;AACnD,OAAOC,QAAQ,MAAM,6BAA6B;AAClD,SAASC,QAAQ,QAAQ,oBAAoB;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,SAAAC,GAAA,IAAAC,IAAA;AAQA,MAAMC,UAAqB,GAAG;EAC5BC,QAAQ,EAAE,UAAU;EACpBC,KAAK,EAAE,CAAC;EACRC,MAAM,EAAE,CAAC;EACTC,KAAK,EAAE,EAAE;EACTC,MAAM,EAAE,EAAE;EACVC,YAAY,EAAE,EAAE;EAChBC,UAAU,EAAE,QAAQ;EACpBC,cAAc,EAAE,QAAQ;EACxBC,WAAW,EAAE;AACf,CAAC;AAED,MAAMC,iBAA2B,GAAGA,CAAA,KAAM;EACxC,MAAMC,KAAK,GAAGd,QAAQ,CAAC,CAAC;EACxB,oBACEE,IAAA,CAACJ,IAAI;IAACiB,KAAK,EAAEZ,UAAW;IAACa,SAAS,EAAC,mCAAmC;IAAAC,QAAA,eACpEf,IAAA,CAACH,QAAQ;MAACmB,IAAI,EAAC,QAAQ;MAACC,IAAI,EAAE,EAAG;MAACC,KAAK,EAAEN,KAAK,CAACO,MAAM,CAACC;IAAkB,CAAE;EAAC,CACvE,CAAC;AAEX,CAAC;AAED,eAAeT,iBAAiB","ignoreList":[]}
@@ -22,9 +22,11 @@
22
22
  * auto-starts the instant the view is reached, because the request surface
23
23
  * (a QR on an unknown desktop, "Check Commons on your phone" where Oxy could
24
24
  * deliver) IS the primary route there, never something behind a second tap.
25
- * - `qr` → `SignInRequestView` — the ACTIVE REQUEST: the route Oxy chose plus
26
- * honest progress derived only from `snapshot.signIn`. Alternatives stay
27
- * behind "Having trouble?" until the chosen route reports `routeFailed`.
25
+ * - `qr` → `SignInRequestView` — the ACTIVE REQUEST: the controller-bound
26
+ * wiring over the shared, presentational `OxySignInRequestSurface` (the same
27
+ * component the auth.oxy.so IdP mounts from its OAuth-bound request). It maps
28
+ * `snapshot.signIn` onto that surface's props; alternatives stay behind
29
+ * "Having trouble?" until the chosen route reports `routeFailed`.
28
30
  * - `signup` → `SignUpView` — account creation, Commons-first.
29
31
  *
30
32
  * Per-account color re-theming uses Bloom's `APP_COLOR_PRESETS` + `BloomColorScope`
@@ -332,7 +334,6 @@ const OxyAuthChooser = ({
332
334
  if (view === 'qr') {
333
335
  return /*#__PURE__*/_jsx(SignInRequestView, {
334
336
  snapshot: snapshot,
335
- theme: theme,
336
337
  t: t,
337
338
  onRetry: () => void controller.showQr(),
338
339
  alternatives: alternatives