@oxyhq/services 26.0.0 → 26.0.1

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 (583) hide show
  1. package/README.md +2 -2
  2. package/android/src/main/java/so/oxy/identity/OxyIdentityStore.kt +127 -21
  3. package/expo-module.config.json +1 -4
  4. package/lib/commonjs/index.js +49 -18
  5. package/lib/commonjs/index.js.map +1 -1
  6. package/lib/commonjs/notifications/deviceNotifications.js +0 -63
  7. package/lib/commonjs/notifications/deviceNotifications.js.map +1 -1
  8. package/lib/commonjs/ui/boot/runProviderColdBoot.js +64 -20
  9. package/lib/commonjs/ui/boot/runProviderColdBoot.js.map +1 -1
  10. package/lib/commonjs/ui/components/FollowButton.js +4 -4
  11. package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
  12. package/lib/commonjs/ui/components/OxyAccountDialogScreen.js +1 -13
  13. package/lib/commonjs/ui/components/OxyAccountDialogScreen.js.map +1 -1
  14. package/lib/commonjs/ui/components/OxyAuthChooser.js +8 -9
  15. package/lib/commonjs/ui/components/OxyAuthChooser.js.map +1 -1
  16. package/lib/commonjs/ui/components/OxyProvider.js +7 -8
  17. package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
  18. package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
  19. package/lib/commonjs/ui/components/ProfileButton.js +1 -1
  20. package/lib/commonjs/ui/components/ProfileButton.js.map +1 -1
  21. package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js +30 -25
  22. package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js.map +1 -1
  23. package/lib/commonjs/ui/components/authChooser/primitives.js +9 -9
  24. package/lib/commonjs/ui/components/authChooser/primitives.js.map +1 -1
  25. package/lib/commonjs/ui/components/authChooser/useUsernameAvailability.js +2 -2
  26. package/lib/commonjs/ui/components/authChooser/useUsernameAvailability.js.map +1 -1
  27. package/lib/commonjs/ui/components/fileManagement/UploadPreview.js +2 -2
  28. package/lib/commonjs/ui/components/fileManagement/UploadPreview.js.map +1 -1
  29. package/lib/commonjs/ui/components/internal/PinInput.js +1 -3
  30. package/lib/commonjs/ui/components/internal/PinInput.js.map +1 -1
  31. package/lib/commonjs/ui/components/logo/LogoText.js +4 -4
  32. package/lib/commonjs/ui/components/logo/LogoText.js.map +1 -1
  33. package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js +2 -2
  34. package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js.map +1 -1
  35. package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js +2 -2
  36. package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js.map +1 -1
  37. package/lib/commonjs/ui/components/styles/shadow.js.map +1 -1
  38. package/lib/commonjs/ui/context/OxyContext.js +46 -32
  39. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  40. package/lib/commonjs/ui/context/commitSessionFlow.js +43 -3
  41. package/lib/commonjs/ui/context/commitSessionFlow.js.map +1 -1
  42. package/lib/commonjs/ui/context/hooks/useAuthOperations.js +2 -15
  43. package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
  44. package/lib/commonjs/ui/context/useOxyAccountGraph.js +4 -3
  45. package/lib/commonjs/ui/context/useOxyAccountGraph.js.map +1 -1
  46. package/lib/commonjs/ui/hooks/mutations/mutationFactory.js +5 -5
  47. package/lib/commonjs/ui/hooks/mutations/mutationFactory.js.map +1 -1
  48. package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js +11 -11
  49. package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js.map +1 -1
  50. package/lib/commonjs/ui/hooks/mutations/useServicesMutations.js +9 -9
  51. package/lib/commonjs/ui/hooks/mutations/useServicesMutations.js.map +1 -1
  52. package/lib/commonjs/ui/hooks/queries/usePaymentQueries.js +2 -3
  53. package/lib/commonjs/ui/hooks/queries/usePaymentQueries.js.map +1 -1
  54. package/lib/commonjs/ui/hooks/queries/userCache.js +17 -17
  55. package/lib/commonjs/ui/hooks/queries/userCache.js.map +1 -1
  56. package/lib/commonjs/ui/hooks/useAssets.js.map +1 -1
  57. package/lib/commonjs/ui/hooks/useAsyncAction.js +7 -7
  58. package/lib/commonjs/ui/hooks/useAsyncAction.js.map +1 -1
  59. package/lib/commonjs/ui/hooks/useAuth.js +2 -4
  60. package/lib/commonjs/ui/hooks/useAuth.js.map +1 -1
  61. package/lib/commonjs/ui/hooks/useAvatarPicker.js +5 -5
  62. package/lib/commonjs/ui/hooks/useAvatarPicker.js.map +1 -1
  63. package/lib/commonjs/ui/hooks/useOnlineStatus.js +2 -3
  64. package/lib/commonjs/ui/hooks/useOnlineStatus.js.map +1 -1
  65. package/lib/commonjs/ui/hooks/useSessionManagement.js +2 -0
  66. package/lib/commonjs/ui/hooks/useSessionManagement.js.map +1 -1
  67. package/lib/commonjs/ui/hooks/useSettingToggle.js +4 -4
  68. package/lib/commonjs/ui/hooks/useSettingToggle.js.map +1 -1
  69. package/lib/commonjs/ui/hooks/useSurfaceHeader.js +11 -68
  70. package/lib/commonjs/ui/hooks/useSurfaceHeader.js.map +1 -1
  71. package/lib/commonjs/ui/oauth/browserAuthTransport.js +64 -66
  72. package/lib/commonjs/ui/oauth/browserAuthTransport.js.map +1 -1
  73. package/lib/commonjs/ui/oauth/legacyRedirectLanes.js +48 -0
  74. package/lib/commonjs/ui/oauth/legacyRedirectLanes.js.map +1 -0
  75. package/lib/commonjs/ui/oauth/oauthPopup.js +0 -47
  76. package/lib/commonjs/ui/oauth/oauthPopup.js.map +1 -1
  77. package/lib/commonjs/ui/screens/AccountMembersScreen.js +10 -10
  78. package/lib/commonjs/ui/screens/AccountMembersScreen.js.map +1 -1
  79. package/lib/commonjs/ui/screens/AccountSettingsScreen.js +19 -41
  80. package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
  81. package/lib/commonjs/ui/screens/AccountVerificationScreen.js +4 -4
  82. package/lib/commonjs/ui/screens/AccountVerificationScreen.js.map +1 -1
  83. package/lib/commonjs/ui/screens/AppInfoScreen.js +9 -9
  84. package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
  85. package/lib/commonjs/ui/screens/AvatarCropScreen.js +3 -3
  86. package/lib/commonjs/ui/screens/AvatarCropScreen.js.map +1 -1
  87. package/lib/commonjs/ui/screens/ChangeAvatarScreen.js +7 -6
  88. package/lib/commonjs/ui/screens/ChangeAvatarScreen.js.map +1 -1
  89. package/lib/commonjs/ui/screens/ConnectedAppsScreen.js +4 -4
  90. package/lib/commonjs/ui/screens/ConnectedAppsScreen.js.map +1 -1
  91. package/lib/commonjs/ui/screens/CreateAccountScreen.js +13 -35
  92. package/lib/commonjs/ui/screens/CreateAccountScreen.js.map +1 -1
  93. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +5 -5
  94. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
  95. package/lib/commonjs/ui/screens/EditProfileScreen.js +3 -2
  96. package/lib/commonjs/ui/screens/EditProfileScreen.js.map +1 -1
  97. package/lib/commonjs/ui/screens/FAQScreen.js +2 -2
  98. package/lib/commonjs/ui/screens/FAQScreen.js.map +1 -1
  99. package/lib/commonjs/ui/screens/FeedbackScreen.js +89 -90
  100. package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
  101. package/lib/commonjs/ui/screens/FileManagementScreen.js +20 -20
  102. package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
  103. package/lib/commonjs/ui/screens/FollowersListScreen.js.map +1 -1
  104. package/lib/commonjs/ui/screens/FollowingListScreen.js.map +1 -1
  105. package/lib/commonjs/ui/screens/HelpSupportScreen.js +7 -7
  106. package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -1
  107. package/lib/commonjs/ui/screens/HistoryViewScreen.js +34 -9
  108. package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
  109. package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +3 -3
  110. package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
  111. package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +3 -3
  112. package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -1
  113. package/lib/commonjs/ui/screens/ManageAccountScreen.js +15 -15
  114. package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
  115. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +19 -19
  116. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  117. package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +15 -15
  118. package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
  119. package/lib/commonjs/ui/screens/ProfileScreen.js +7 -17
  120. package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
  121. package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +2 -2
  122. package/lib/commonjs/ui/screens/SavesCollectionsScreen.js.map +1 -1
  123. package/lib/commonjs/ui/screens/UserListScreen.js +7 -13
  124. package/lib/commonjs/ui/screens/UserListScreen.js.map +1 -1
  125. package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +6 -5
  126. package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
  127. package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js +4 -1
  128. package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
  129. package/lib/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.js +24 -34
  130. package/lib/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.js.map +1 -1
  131. package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js +1 -1
  132. package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js.map +1 -1
  133. package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js +4 -3
  134. package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
  135. package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js +1 -1
  136. package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
  137. package/lib/commonjs/ui/session/index.js +0 -7
  138. package/lib/commonjs/ui/session/index.js.map +1 -1
  139. package/lib/commonjs/ui/utils/crossOriginRestore.js +140 -0
  140. package/lib/commonjs/ui/utils/crossOriginRestore.js.map +1 -0
  141. package/lib/commonjs/ui/utils/fileManagement.js +24 -24
  142. package/lib/commonjs/ui/utils/fileManagement.js.map +1 -1
  143. package/lib/commonjs/ui/utils/oauthReturn.js +30 -19
  144. package/lib/commonjs/ui/utils/oauthReturn.js.map +1 -1
  145. package/lib/commonjs/ui/utils/userUtils.js +28 -27
  146. package/lib/commonjs/ui/utils/userUtils.js.map +1 -1
  147. package/lib/module/index.js +8 -20
  148. package/lib/module/index.js.map +1 -1
  149. package/lib/module/notifications/deviceNotifications.js +0 -62
  150. package/lib/module/notifications/deviceNotifications.js.map +1 -1
  151. package/lib/module/ui/boot/runProviderColdBoot.js +65 -21
  152. package/lib/module/ui/boot/runProviderColdBoot.js.map +1 -1
  153. package/lib/module/ui/components/FollowButton.js +1 -1
  154. package/lib/module/ui/components/FollowButton.js.map +1 -1
  155. package/lib/module/ui/components/OxyAccountDialogScreen.js +1 -13
  156. package/lib/module/ui/components/OxyAccountDialogScreen.js.map +1 -1
  157. package/lib/module/ui/components/OxyAuthChooser.js +4 -5
  158. package/lib/module/ui/components/OxyAuthChooser.js.map +1 -1
  159. package/lib/module/ui/components/OxyProvider.js +6 -7
  160. package/lib/module/ui/components/OxyProvider.js.map +1 -1
  161. package/lib/module/ui/components/OxySignInButton.js.map +1 -1
  162. package/lib/module/ui/components/ProfileButton.js +2 -2
  163. package/lib/module/ui/components/ProfileButton.js.map +1 -1
  164. package/lib/module/ui/components/authChooser/AccountsMenuView.js +8 -3
  165. package/lib/module/ui/components/authChooser/AccountsMenuView.js.map +1 -1
  166. package/lib/module/ui/components/authChooser/primitives.js +1 -1
  167. package/lib/module/ui/components/authChooser/primitives.js.map +1 -1
  168. package/lib/module/ui/components/authChooser/useUsernameAvailability.js +1 -1
  169. package/lib/module/ui/components/authChooser/useUsernameAvailability.js.map +1 -1
  170. package/lib/module/ui/components/fileManagement/UploadPreview.js +1 -1
  171. package/lib/module/ui/components/fileManagement/UploadPreview.js.map +1 -1
  172. package/lib/module/ui/components/internal/PinInput.js +1 -3
  173. package/lib/module/ui/components/internal/PinInput.js.map +1 -1
  174. package/lib/module/ui/components/logo/LogoText.js +4 -4
  175. package/lib/module/ui/components/logo/LogoText.js.map +1 -1
  176. package/lib/module/ui/components/payment/PaymentDetailsStep.js +1 -1
  177. package/lib/module/ui/components/payment/PaymentDetailsStep.js.map +1 -1
  178. package/lib/module/ui/components/payment/PaymentSummaryStep.js +2 -2
  179. package/lib/module/ui/components/payment/PaymentSummaryStep.js.map +1 -1
  180. package/lib/module/ui/components/styles/shadow.js.map +1 -1
  181. package/lib/module/ui/context/OxyContext.js +49 -35
  182. package/lib/module/ui/context/OxyContext.js.map +1 -1
  183. package/lib/module/ui/context/commitSessionFlow.js +42 -3
  184. package/lib/module/ui/context/commitSessionFlow.js.map +1 -1
  185. package/lib/module/ui/context/hooks/useAuthOperations.js +2 -15
  186. package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
  187. package/lib/module/ui/context/useOxyAccountGraph.js +4 -3
  188. package/lib/module/ui/context/useOxyAccountGraph.js.map +1 -1
  189. package/lib/module/ui/hooks/mutations/mutationFactory.js +1 -1
  190. package/lib/module/ui/hooks/mutations/mutationFactory.js.map +1 -1
  191. package/lib/module/ui/hooks/mutations/useAccountMutations.js +1 -1
  192. package/lib/module/ui/hooks/mutations/useAccountMutations.js.map +1 -1
  193. package/lib/module/ui/hooks/mutations/useServicesMutations.js +1 -1
  194. package/lib/module/ui/hooks/mutations/useServicesMutations.js.map +1 -1
  195. package/lib/module/ui/hooks/queries/usePaymentQueries.js +2 -3
  196. package/lib/module/ui/hooks/queries/usePaymentQueries.js.map +1 -1
  197. package/lib/module/ui/hooks/queries/userCache.js +17 -17
  198. package/lib/module/ui/hooks/queries/userCache.js.map +1 -1
  199. package/lib/module/ui/hooks/useAssets.js.map +1 -1
  200. package/lib/module/ui/hooks/useAsyncAction.js +1 -1
  201. package/lib/module/ui/hooks/useAsyncAction.js.map +1 -1
  202. package/lib/module/ui/hooks/useAuth.js +2 -4
  203. package/lib/module/ui/hooks/useAuth.js.map +1 -1
  204. package/lib/module/ui/hooks/useAvatarPicker.js +1 -1
  205. package/lib/module/ui/hooks/useAvatarPicker.js.map +1 -1
  206. package/lib/module/ui/hooks/useOnlineStatus.js +2 -3
  207. package/lib/module/ui/hooks/useOnlineStatus.js.map +1 -1
  208. package/lib/module/ui/hooks/useSessionManagement.js +2 -0
  209. package/lib/module/ui/hooks/useSessionManagement.js.map +1 -1
  210. package/lib/module/ui/hooks/useSettingToggle.js +1 -1
  211. package/lib/module/ui/hooks/useSettingToggle.js.map +1 -1
  212. package/lib/module/ui/hooks/useSurfaceHeader.js +11 -68
  213. package/lib/module/ui/hooks/useSurfaceHeader.js.map +1 -1
  214. package/lib/module/ui/oauth/browserAuthTransport.js +64 -66
  215. package/lib/module/ui/oauth/browserAuthTransport.js.map +1 -1
  216. package/lib/module/ui/oauth/legacyRedirectLanes.js +44 -0
  217. package/lib/module/ui/oauth/legacyRedirectLanes.js.map +1 -0
  218. package/lib/module/ui/oauth/oauthPopup.js +1 -48
  219. package/lib/module/ui/oauth/oauthPopup.js.map +1 -1
  220. package/lib/module/ui/screens/AccountMembersScreen.js +1 -1
  221. package/lib/module/ui/screens/AccountMembersScreen.js.map +1 -1
  222. package/lib/module/ui/screens/AccountSettingsScreen.js +15 -37
  223. package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
  224. package/lib/module/ui/screens/AccountVerificationScreen.js +1 -1
  225. package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -1
  226. package/lib/module/ui/screens/AppInfoScreen.js +1 -1
  227. package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
  228. package/lib/module/ui/screens/AvatarCropScreen.js +1 -1
  229. package/lib/module/ui/screens/AvatarCropScreen.js.map +1 -1
  230. package/lib/module/ui/screens/ChangeAvatarScreen.js +5 -4
  231. package/lib/module/ui/screens/ChangeAvatarScreen.js.map +1 -1
  232. package/lib/module/ui/screens/ConnectedAppsScreen.js +2 -2
  233. package/lib/module/ui/screens/ConnectedAppsScreen.js.map +1 -1
  234. package/lib/module/ui/screens/CreateAccountScreen.js +12 -34
  235. package/lib/module/ui/screens/CreateAccountScreen.js.map +1 -1
  236. package/lib/module/ui/screens/EditProfileFieldScreen.js +4 -4
  237. package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
  238. package/lib/module/ui/screens/EditProfileScreen.js +4 -3
  239. package/lib/module/ui/screens/EditProfileScreen.js.map +1 -1
  240. package/lib/module/ui/screens/FAQScreen.js +1 -1
  241. package/lib/module/ui/screens/FAQScreen.js.map +1 -1
  242. package/lib/module/ui/screens/FeedbackScreen.js +91 -94
  243. package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
  244. package/lib/module/ui/screens/FileManagementScreen.js +1 -1
  245. package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
  246. package/lib/module/ui/screens/FollowersListScreen.js.map +1 -1
  247. package/lib/module/ui/screens/FollowingListScreen.js.map +1 -1
  248. package/lib/module/ui/screens/HelpSupportScreen.js +1 -1
  249. package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -1
  250. package/lib/module/ui/screens/HistoryViewScreen.js +30 -5
  251. package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
  252. package/lib/module/ui/screens/LanguageSelectorScreen.js +1 -1
  253. package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
  254. package/lib/module/ui/screens/LegalDocumentsScreen.js +1 -1
  255. package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -1
  256. package/lib/module/ui/screens/ManageAccountScreen.js +3 -3
  257. package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
  258. package/lib/module/ui/screens/PremiumSubscriptionScreen.js +4 -4
  259. package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  260. package/lib/module/ui/screens/PrivacySettingsScreen.js +11 -11
  261. package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
  262. package/lib/module/ui/screens/ProfileScreen.js +8 -18
  263. package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
  264. package/lib/module/ui/screens/SavesCollectionsScreen.js +1 -1
  265. package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -1
  266. package/lib/module/ui/screens/UserListScreen.js +8 -14
  267. package/lib/module/ui/screens/UserListScreen.js.map +1 -1
  268. package/lib/module/ui/screens/WelcomeNewUserScreen.js +6 -5
  269. package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
  270. package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js +4 -1
  271. package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
  272. package/lib/module/ui/screens/fileManagement/hooks/useFileUploadState.js +5 -15
  273. package/lib/module/ui/screens/fileManagement/hooks/useFileUploadState.js.map +1 -1
  274. package/lib/module/ui/screens/trust/TrustCenterScreen.js +1 -1
  275. package/lib/module/ui/screens/trust/TrustCenterScreen.js.map +1 -1
  276. package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js +5 -4
  277. package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
  278. package/lib/module/ui/screens/trust/TrustRewardsScreen.js +1 -1
  279. package/lib/module/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
  280. package/lib/module/ui/session/index.js +0 -1
  281. package/lib/module/ui/session/index.js.map +1 -1
  282. package/lib/module/ui/utils/crossOriginRestore.js +131 -0
  283. package/lib/module/ui/utils/crossOriginRestore.js.map +1 -0
  284. package/lib/module/ui/utils/fileManagement.js +25 -25
  285. package/lib/module/ui/utils/fileManagement.js.map +1 -1
  286. package/lib/module/ui/utils/oauthReturn.js +30 -20
  287. package/lib/module/ui/utils/oauthReturn.js.map +1 -1
  288. package/lib/module/ui/utils/userUtils.js +28 -27
  289. package/lib/module/ui/utils/userUtils.js.map +1 -1
  290. package/lib/typescript/commonjs/index.d.ts +2 -0
  291. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  292. package/lib/typescript/commonjs/notifications/deviceNotifications.d.ts +0 -51
  293. package/lib/typescript/commonjs/notifications/deviceNotifications.d.ts.map +1 -1
  294. package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts +30 -11
  295. package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts.map +1 -1
  296. package/lib/typescript/commonjs/ui/components/OxyAccountDialogScreen.d.ts.map +1 -1
  297. package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts +0 -7
  298. package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts.map +1 -1
  299. package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
  300. package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts +1 -2
  301. package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts.map +1 -1
  302. package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts.map +1 -1
  303. package/lib/typescript/commonjs/ui/components/authChooser/AccountsMenuView.d.ts.map +1 -1
  304. package/lib/typescript/commonjs/ui/components/authChooser/primitives.d.ts +1 -1
  305. package/lib/typescript/commonjs/ui/components/authChooser/primitives.d.ts.map +1 -1
  306. package/lib/typescript/commonjs/ui/components/fileManagement/UploadPreview.d.ts +1 -1
  307. package/lib/typescript/commonjs/ui/components/fileManagement/UploadPreview.d.ts.map +1 -1
  308. package/lib/typescript/commonjs/ui/components/internal/PinInput.d.ts.map +1 -1
  309. package/lib/typescript/commonjs/ui/components/payment/types.d.ts +6 -6
  310. package/lib/typescript/commonjs/ui/components/payment/types.d.ts.map +1 -1
  311. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
  312. package/lib/typescript/commonjs/ui/context/commitSessionFlow.d.ts +40 -0
  313. package/lib/typescript/commonjs/ui/context/commitSessionFlow.d.ts.map +1 -1
  314. package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts +2 -11
  315. package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
  316. package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts +7 -26
  317. package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts.map +1 -1
  318. package/lib/typescript/commonjs/ui/context/useOxyAccountGraph.d.ts +1 -0
  319. package/lib/typescript/commonjs/ui/context/useOxyAccountGraph.d.ts.map +1 -1
  320. package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  321. package/lib/typescript/commonjs/ui/hooks/queries/paymentTypes.d.ts +2 -3
  322. package/lib/typescript/commonjs/ui/hooks/queries/paymentTypes.d.ts.map +1 -1
  323. package/lib/typescript/commonjs/ui/hooks/queries/usePaymentQueries.d.ts +2 -3
  324. package/lib/typescript/commonjs/ui/hooks/queries/usePaymentQueries.d.ts.map +1 -1
  325. package/lib/typescript/commonjs/ui/hooks/queries/userCache.d.ts +2 -2
  326. package/lib/typescript/commonjs/ui/hooks/queries/userCache.d.ts.map +1 -1
  327. package/lib/typescript/commonjs/ui/hooks/useAssets.d.ts +1 -1
  328. package/lib/typescript/commonjs/ui/hooks/useAssets.d.ts.map +1 -1
  329. package/lib/typescript/commonjs/ui/hooks/useAsyncAction.d.ts +2 -2
  330. package/lib/typescript/commonjs/ui/hooks/useAsyncAction.d.ts.map +1 -1
  331. package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts +2 -4
  332. package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts.map +1 -1
  333. package/lib/typescript/commonjs/ui/hooks/useOnlineStatus.d.ts +2 -3
  334. package/lib/typescript/commonjs/ui/hooks/useOnlineStatus.d.ts.map +1 -1
  335. package/lib/typescript/commonjs/ui/hooks/useSessionManagement.d.ts.map +1 -1
  336. package/lib/typescript/commonjs/ui/hooks/useSurfaceHeader.d.ts +2 -7
  337. package/lib/typescript/commonjs/ui/hooks/useSurfaceHeader.d.ts.map +1 -1
  338. package/lib/typescript/commonjs/ui/oauth/browserAuthTransport.d.ts.map +1 -1
  339. package/lib/typescript/commonjs/ui/oauth/legacyRedirectLanes.d.ts +40 -0
  340. package/lib/typescript/commonjs/ui/oauth/legacyRedirectLanes.d.ts.map +1 -0
  341. package/lib/typescript/commonjs/ui/oauth/oauthPopup.d.ts +0 -6
  342. package/lib/typescript/commonjs/ui/oauth/oauthPopup.d.ts.map +1 -1
  343. package/lib/typescript/commonjs/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
  344. package/lib/typescript/commonjs/ui/screens/ChangeAvatarScreen.d.ts.map +1 -1
  345. package/lib/typescript/commonjs/ui/screens/CreateAccountScreen.d.ts.map +1 -1
  346. package/lib/typescript/commonjs/ui/screens/EditProfileScreen.d.ts.map +1 -1
  347. package/lib/typescript/commonjs/ui/screens/FeedbackScreen.d.ts +2 -2
  348. package/lib/typescript/commonjs/ui/screens/FeedbackScreen.d.ts.map +1 -1
  349. package/lib/typescript/commonjs/ui/screens/FollowersListScreen.d.ts +0 -3
  350. package/lib/typescript/commonjs/ui/screens/FollowersListScreen.d.ts.map +1 -1
  351. package/lib/typescript/commonjs/ui/screens/FollowingListScreen.d.ts +0 -3
  352. package/lib/typescript/commonjs/ui/screens/FollowingListScreen.d.ts.map +1 -1
  353. package/lib/typescript/commonjs/ui/screens/HistoryViewScreen.d.ts.map +1 -1
  354. package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -1
  355. package/lib/typescript/commonjs/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
  356. package/lib/typescript/commonjs/ui/screens/ProfileScreen.d.ts.map +1 -1
  357. package/lib/typescript/commonjs/ui/screens/UserListScreen.d.ts +0 -7
  358. package/lib/typescript/commonjs/ui/screens/UserListScreen.d.ts.map +1 -1
  359. package/lib/typescript/commonjs/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
  360. package/lib/typescript/commonjs/ui/screens/fileManagement/hooks/useFileUploadState.d.ts.map +1 -1
  361. package/lib/typescript/commonjs/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
  362. package/lib/typescript/commonjs/ui/screens/trust/trustTier.d.ts +1 -1
  363. package/lib/typescript/commonjs/ui/screens/trust/trustTier.d.ts.map +1 -1
  364. package/lib/typescript/commonjs/ui/session/index.d.ts +0 -1
  365. package/lib/typescript/commonjs/ui/session/index.d.ts.map +1 -1
  366. package/lib/typescript/commonjs/ui/types/navigation.d.ts +19 -27
  367. package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
  368. package/lib/typescript/commonjs/ui/utils/crossOriginRestore.d.ts +43 -0
  369. package/lib/typescript/commonjs/ui/utils/crossOriginRestore.d.ts.map +1 -0
  370. package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts +5 -5
  371. package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts.map +1 -1
  372. package/lib/typescript/commonjs/ui/utils/oauthReturn.d.ts +12 -15
  373. package/lib/typescript/commonjs/ui/utils/oauthReturn.d.ts.map +1 -1
  374. package/lib/typescript/commonjs/ui/utils/userUtils.d.ts +14 -7
  375. package/lib/typescript/commonjs/ui/utils/userUtils.d.ts.map +1 -1
  376. package/lib/typescript/module/index.d.ts +2 -0
  377. package/lib/typescript/module/index.d.ts.map +1 -1
  378. package/lib/typescript/module/notifications/deviceNotifications.d.ts +0 -51
  379. package/lib/typescript/module/notifications/deviceNotifications.d.ts.map +1 -1
  380. package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts +30 -11
  381. package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts.map +1 -1
  382. package/lib/typescript/module/ui/components/OxyAccountDialogScreen.d.ts.map +1 -1
  383. package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts +0 -7
  384. package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts.map +1 -1
  385. package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
  386. package/lib/typescript/module/ui/components/OxySignInButton.d.ts +1 -2
  387. package/lib/typescript/module/ui/components/OxySignInButton.d.ts.map +1 -1
  388. package/lib/typescript/module/ui/components/ProfileButton.d.ts.map +1 -1
  389. package/lib/typescript/module/ui/components/authChooser/AccountsMenuView.d.ts.map +1 -1
  390. package/lib/typescript/module/ui/components/authChooser/primitives.d.ts +1 -1
  391. package/lib/typescript/module/ui/components/authChooser/primitives.d.ts.map +1 -1
  392. package/lib/typescript/module/ui/components/fileManagement/UploadPreview.d.ts +1 -1
  393. package/lib/typescript/module/ui/components/fileManagement/UploadPreview.d.ts.map +1 -1
  394. package/lib/typescript/module/ui/components/internal/PinInput.d.ts.map +1 -1
  395. package/lib/typescript/module/ui/components/payment/types.d.ts +6 -6
  396. package/lib/typescript/module/ui/components/payment/types.d.ts.map +1 -1
  397. package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
  398. package/lib/typescript/module/ui/context/commitSessionFlow.d.ts +40 -0
  399. package/lib/typescript/module/ui/context/commitSessionFlow.d.ts.map +1 -1
  400. package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts +2 -11
  401. package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
  402. package/lib/typescript/module/ui/context/oxyContextTypes.d.ts +7 -26
  403. package/lib/typescript/module/ui/context/oxyContextTypes.d.ts.map +1 -1
  404. package/lib/typescript/module/ui/context/useOxyAccountGraph.d.ts +1 -0
  405. package/lib/typescript/module/ui/context/useOxyAccountGraph.d.ts.map +1 -1
  406. package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  407. package/lib/typescript/module/ui/hooks/queries/paymentTypes.d.ts +2 -3
  408. package/lib/typescript/module/ui/hooks/queries/paymentTypes.d.ts.map +1 -1
  409. package/lib/typescript/module/ui/hooks/queries/usePaymentQueries.d.ts +2 -3
  410. package/lib/typescript/module/ui/hooks/queries/usePaymentQueries.d.ts.map +1 -1
  411. package/lib/typescript/module/ui/hooks/queries/userCache.d.ts +2 -2
  412. package/lib/typescript/module/ui/hooks/queries/userCache.d.ts.map +1 -1
  413. package/lib/typescript/module/ui/hooks/useAssets.d.ts +1 -1
  414. package/lib/typescript/module/ui/hooks/useAssets.d.ts.map +1 -1
  415. package/lib/typescript/module/ui/hooks/useAsyncAction.d.ts +2 -2
  416. package/lib/typescript/module/ui/hooks/useAsyncAction.d.ts.map +1 -1
  417. package/lib/typescript/module/ui/hooks/useAuth.d.ts +2 -4
  418. package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
  419. package/lib/typescript/module/ui/hooks/useOnlineStatus.d.ts +2 -3
  420. package/lib/typescript/module/ui/hooks/useOnlineStatus.d.ts.map +1 -1
  421. package/lib/typescript/module/ui/hooks/useSessionManagement.d.ts.map +1 -1
  422. package/lib/typescript/module/ui/hooks/useSurfaceHeader.d.ts +2 -7
  423. package/lib/typescript/module/ui/hooks/useSurfaceHeader.d.ts.map +1 -1
  424. package/lib/typescript/module/ui/oauth/browserAuthTransport.d.ts.map +1 -1
  425. package/lib/typescript/module/ui/oauth/legacyRedirectLanes.d.ts +40 -0
  426. package/lib/typescript/module/ui/oauth/legacyRedirectLanes.d.ts.map +1 -0
  427. package/lib/typescript/module/ui/oauth/oauthPopup.d.ts +0 -6
  428. package/lib/typescript/module/ui/oauth/oauthPopup.d.ts.map +1 -1
  429. package/lib/typescript/module/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
  430. package/lib/typescript/module/ui/screens/ChangeAvatarScreen.d.ts.map +1 -1
  431. package/lib/typescript/module/ui/screens/CreateAccountScreen.d.ts.map +1 -1
  432. package/lib/typescript/module/ui/screens/EditProfileScreen.d.ts.map +1 -1
  433. package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts +2 -2
  434. package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts.map +1 -1
  435. package/lib/typescript/module/ui/screens/FollowersListScreen.d.ts +0 -3
  436. package/lib/typescript/module/ui/screens/FollowersListScreen.d.ts.map +1 -1
  437. package/lib/typescript/module/ui/screens/FollowingListScreen.d.ts +0 -3
  438. package/lib/typescript/module/ui/screens/FollowingListScreen.d.ts.map +1 -1
  439. package/lib/typescript/module/ui/screens/HistoryViewScreen.d.ts.map +1 -1
  440. package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -1
  441. package/lib/typescript/module/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
  442. package/lib/typescript/module/ui/screens/ProfileScreen.d.ts.map +1 -1
  443. package/lib/typescript/module/ui/screens/UserListScreen.d.ts +0 -7
  444. package/lib/typescript/module/ui/screens/UserListScreen.d.ts.map +1 -1
  445. package/lib/typescript/module/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
  446. package/lib/typescript/module/ui/screens/fileManagement/hooks/useFileUploadState.d.ts.map +1 -1
  447. package/lib/typescript/module/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
  448. package/lib/typescript/module/ui/screens/trust/trustTier.d.ts +1 -1
  449. package/lib/typescript/module/ui/screens/trust/trustTier.d.ts.map +1 -1
  450. package/lib/typescript/module/ui/session/index.d.ts +0 -1
  451. package/lib/typescript/module/ui/session/index.d.ts.map +1 -1
  452. package/lib/typescript/module/ui/types/navigation.d.ts +19 -27
  453. package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
  454. package/lib/typescript/module/ui/utils/crossOriginRestore.d.ts +43 -0
  455. package/lib/typescript/module/ui/utils/crossOriginRestore.d.ts.map +1 -0
  456. package/lib/typescript/module/ui/utils/fileManagement.d.ts +5 -5
  457. package/lib/typescript/module/ui/utils/fileManagement.d.ts.map +1 -1
  458. package/lib/typescript/module/ui/utils/oauthReturn.d.ts +12 -15
  459. package/lib/typescript/module/ui/utils/oauthReturn.d.ts.map +1 -1
  460. package/lib/typescript/module/ui/utils/userUtils.d.ts +14 -7
  461. package/lib/typescript/module/ui/utils/userUtils.d.ts.map +1 -1
  462. package/package.json +10 -22
  463. package/src/index.ts +16 -18
  464. package/src/notifications/deviceNotifications.ts +0 -82
  465. package/src/ui/boot/__tests__/coldBootWebAuthMode.test.ts +281 -0
  466. package/src/ui/boot/runProviderColdBoot.ts +101 -24
  467. package/src/ui/components/FollowButton.tsx +1 -1
  468. package/src/ui/components/OxyAccountDialogScreen.tsx +1 -13
  469. package/src/ui/components/OxyAuthChooser.tsx +4 -14
  470. package/src/ui/components/OxyProvider.tsx +7 -8
  471. package/src/ui/components/OxySignInButton.tsx +1 -2
  472. package/src/ui/components/ProfileButton.tsx +2 -5
  473. package/src/ui/components/authChooser/AccountsMenuView.tsx +10 -5
  474. package/src/ui/components/authChooser/primitives.tsx +1 -1
  475. package/src/ui/components/authChooser/useUsernameAvailability.ts +1 -1
  476. package/src/ui/components/fileManagement/UploadPreview.tsx +1 -1
  477. package/src/ui/components/internal/PinInput.tsx +0 -1
  478. package/src/ui/components/logo/LogoText.tsx +4 -4
  479. package/src/ui/components/payment/PaymentDetailsStep.tsx +1 -1
  480. package/src/ui/components/payment/PaymentSummaryStep.tsx +2 -2
  481. package/src/ui/components/payment/types.ts +24 -24
  482. package/src/ui/components/styles/shadow.tsx +2 -2
  483. package/src/ui/context/OxyContext.tsx +46 -35
  484. package/src/ui/context/__tests__/commitSessionFlow.test.ts +89 -13
  485. package/src/ui/context/commitSessionFlow.ts +61 -3
  486. package/src/ui/context/hooks/useAuthOperations.ts +1 -26
  487. package/src/ui/context/oxyContextTypes.ts +7 -26
  488. package/src/ui/context/useOxyAccountGraph.ts +4 -4
  489. package/src/ui/hooks/mutations/mutationFactory.ts +1 -1
  490. package/src/ui/hooks/mutations/useAccountMutations.ts +1 -1
  491. package/src/ui/hooks/mutations/useServicesMutations.ts +1 -1
  492. package/src/ui/hooks/queries/paymentTypes.ts +2 -3
  493. package/src/ui/hooks/queries/usePaymentQueries.ts +2 -3
  494. package/src/ui/hooks/queries/userCache.ts +148 -169
  495. package/src/ui/hooks/useAssets.ts +1 -1
  496. package/src/ui/hooks/useAsyncAction.ts +3 -3
  497. package/src/ui/hooks/useAuth.ts +2 -4
  498. package/src/ui/hooks/useAvatarPicker.ts +1 -1
  499. package/src/ui/hooks/useOnlineStatus.ts +2 -3
  500. package/src/ui/hooks/useSessionManagement.ts +2 -0
  501. package/src/ui/hooks/useSettingToggle.ts +1 -1
  502. package/src/ui/hooks/useSurfaceHeader.ts +15 -90
  503. package/src/ui/oauth/__tests__/oauthPopup.test.ts +0 -26
  504. package/src/ui/oauth/browserAuthTransport.ts +49 -55
  505. package/src/ui/oauth/legacyRedirectLanes.ts +43 -0
  506. package/src/ui/oauth/oauthPopup.ts +3 -61
  507. package/src/ui/screens/AccountMembersScreen.tsx +1 -1
  508. package/src/ui/screens/AccountSettingsScreen.tsx +17 -45
  509. package/src/ui/screens/AccountVerificationScreen.tsx +1 -1
  510. package/src/ui/screens/AppInfoScreen.tsx +1 -1
  511. package/src/ui/screens/AvatarCropScreen.tsx +1 -1
  512. package/src/ui/screens/ChangeAvatarScreen.tsx +4 -7
  513. package/src/ui/screens/ConnectedAppsScreen.tsx +2 -2
  514. package/src/ui/screens/CreateAccountScreen.tsx +13 -43
  515. package/src/ui/screens/EditProfileFieldScreen.tsx +4 -4
  516. package/src/ui/screens/EditProfileScreen.tsx +3 -6
  517. package/src/ui/screens/FAQScreen.tsx +1 -1
  518. package/src/ui/screens/FeedbackScreen.tsx +575 -741
  519. package/src/ui/screens/FileManagementScreen.tsx +1 -1
  520. package/src/ui/screens/FollowersListScreen.tsx +0 -3
  521. package/src/ui/screens/FollowingListScreen.tsx +0 -3
  522. package/src/ui/screens/HelpSupportScreen.tsx +1 -1
  523. package/src/ui/screens/HistoryViewScreen.tsx +20 -5
  524. package/src/ui/screens/LanguageSelectorScreen.tsx +1 -1
  525. package/src/ui/screens/LegalDocumentsScreen.tsx +1 -1
  526. package/src/ui/screens/ManageAccountScreen.tsx +2 -9
  527. package/src/ui/screens/PremiumSubscriptionScreen.tsx +4 -4
  528. package/src/ui/screens/PrivacySettingsScreen.tsx +12 -15
  529. package/src/ui/screens/ProfileScreen.tsx +6 -24
  530. package/src/ui/screens/SavesCollectionsScreen.tsx +1 -1
  531. package/src/ui/screens/UserListScreen.tsx +8 -18
  532. package/src/ui/screens/WelcomeNewUserScreen.tsx +6 -6
  533. package/src/ui/screens/fileManagement/PhotoPickerSection.tsx +1 -1
  534. package/src/ui/screens/fileManagement/hooks/useFileUploadState.ts +5 -14
  535. package/src/ui/screens/trust/TrustCenterScreen.tsx +2 -2
  536. package/src/ui/screens/trust/TrustLeaderboardScreen.tsx +5 -6
  537. package/src/ui/screens/trust/TrustRewardsScreen.tsx +1 -1
  538. package/src/ui/screens/trust/TrustRulesScreen.tsx +1 -1
  539. package/src/ui/screens/trust/trustTier.ts +1 -1
  540. package/src/ui/session/index.ts +0 -1
  541. package/src/ui/types/navigation.ts +19 -27
  542. package/src/ui/utils/__tests__/crossOriginRestore.test.ts +143 -0
  543. package/src/ui/utils/crossOriginRestore.ts +169 -0
  544. package/src/ui/utils/fileManagement.ts +92 -108
  545. package/src/ui/utils/oauthReturn.ts +33 -23
  546. package/src/ui/utils/userUtils.ts +32 -27
  547. package/android/src/main/java/so/oxy/session/OxyBackgroundSession.kt +0 -184
  548. package/android/src/main/java/so/oxy/session/OxyBackgroundSessionApi.kt +0 -162
  549. package/android/src/main/java/so/oxy/session/OxyBackgroundSessionModule.kt +0 -116
  550. package/android/src/main/java/so/oxy/session/OxyBackgroundSessionStore.kt +0 -179
  551. package/android/src/main/java/so/oxy/session/OxyBackgroundToken.kt +0 -61
  552. package/android/src/main/java/so/oxy/storage/OxyEncryptedPrefs.kt +0 -241
  553. package/lib/commonjs/ui/session/backgroundSession.js +0 -258
  554. package/lib/commonjs/ui/session/backgroundSession.js.map +0 -1
  555. package/lib/commonjs/ui/session/useBackgroundSessionSync.js +0 -81
  556. package/lib/commonjs/ui/session/useBackgroundSessionSync.js.map +0 -1
  557. package/lib/commonjs/ui/utils/netConnectivity.js +0 -28
  558. package/lib/commonjs/ui/utils/netConnectivity.js.map +0 -1
  559. package/lib/module/ui/session/backgroundSession.js +0 -252
  560. package/lib/module/ui/session/backgroundSession.js.map +0 -1
  561. package/lib/module/ui/session/useBackgroundSessionSync.js +0 -76
  562. package/lib/module/ui/session/useBackgroundSessionSync.js.map +0 -1
  563. package/lib/module/ui/utils/netConnectivity.js +0 -23
  564. package/lib/module/ui/utils/netConnectivity.js.map +0 -1
  565. package/lib/typescript/commonjs/ui/session/backgroundSession.d.ts +0 -42
  566. package/lib/typescript/commonjs/ui/session/backgroundSession.d.ts.map +0 -1
  567. package/lib/typescript/commonjs/ui/session/useBackgroundSessionSync.d.ts +0 -23
  568. package/lib/typescript/commonjs/ui/session/useBackgroundSessionSync.d.ts.map +0 -1
  569. package/lib/typescript/commonjs/ui/utils/netConnectivity.d.ts +0 -17
  570. package/lib/typescript/commonjs/ui/utils/netConnectivity.d.ts.map +0 -1
  571. package/lib/typescript/module/ui/session/backgroundSession.d.ts +0 -42
  572. package/lib/typescript/module/ui/session/backgroundSession.d.ts.map +0 -1
  573. package/lib/typescript/module/ui/session/useBackgroundSessionSync.d.ts +0 -23
  574. package/lib/typescript/module/ui/session/useBackgroundSessionSync.d.ts.map +0 -1
  575. package/lib/typescript/module/ui/utils/netConnectivity.d.ts +0 -17
  576. package/lib/typescript/module/ui/utils/netConnectivity.d.ts.map +0 -1
  577. package/lib/typescript/types/expo-image-picker.d.ts +0 -35
  578. package/src/types/expo-image-picker.d.ts +0 -35
  579. package/src/ui/boot/__tests__/coldBootNoIdpRedirect.test.ts +0 -215
  580. package/src/ui/session/__tests__/backgroundSession.test.ts +0 -392
  581. package/src/ui/session/backgroundSession.ts +0 -313
  582. package/src/ui/session/useBackgroundSessionSync.ts +0 -92
  583. package/src/ui/utils/netConnectivity.ts +0 -27
@@ -74,11 +74,11 @@ export interface OxyProviderProps {
74
74
  authWebUrl?: string;
75
75
  authRedirectUri?: string;
76
76
  /**
77
- * Authorize endpoint override for web "Sign in with Oxy". Defaults to the
78
- * production Oxy IdP (`https://auth.oxy.so/authorize`) when unset. Set this
79
- * from an env var (e.g. Vite `VITE_OXY_AUTHORIZE_URL`, Expo
80
- * `EXPO_PUBLIC_OXY_AUTHORIZE_URL`) so a local/staging deployment targets its
81
- * own IdP instead of production.
77
+ * Authorize endpoint override for silent cross-origin session restore
78
+ * (web cross-app SSO on cold boot). Defaults to the production Oxy IdP
79
+ * (`https://auth.oxy.so/authorize`) when unset. Set this from an env var
80
+ * (e.g. Vite `VITE_OXY_AUTHORIZE_URL`, Expo `EXPO_PUBLIC_OXY_AUTHORIZE_URL`)
81
+ * so a local/staging deployment targets its own IdP instead of production.
82
82
  */
83
83
  authorizeBaseUrl?: string;
84
84
  /**
@@ -98,9 +98,9 @@ export interface OxyProviderProps {
98
98
  * rather than hidden in the UI: `accounts` stays empty and is never fetched,
99
99
  * `switchToAccount` / `switchSession` reject with `IdentityBoundSessionError`,
100
100
  * `accountDialogController` is `null` and `openAccountDialog()` does nothing,
101
- * and the web OAuth cold-boot lane (the authorization-code return leg) is
102
- * skipped it commits whichever account the IdP resolves, which is not
103
- * necessarily the local key's owner.
101
+ * and the two web OAuth cold-boot lanes (authorization-code return + silent
102
+ * cross-origin restore) are skipped all of them commit whichever account
103
+ * the IdP resolves, which is not necessarily the local key's owner.
104
104
  *
105
105
  * Read once at mount, like `baseURL` / `oxyServices`: changing it on a
106
106
  * mounted provider does not re-bind the session.
@@ -110,23 +110,22 @@ export interface OxyProviderProps {
110
110
  /**
111
111
  * How a WEB third-party "Sign in with Oxy" hands the user to the IdP.
112
112
  *
113
- * - `'popup'` (default) — a small `auth.oxy.so` window opened from the
114
- * user's click. The app stays MOUNTED and becomes authenticated without a
115
- * reload; the IdP delivers only the authorization code + `state` back to
116
- * the opener via `postMessage` (never a token, device secret, or PKCE
117
- * verifier). A blocked popup falls back to the redirect automatically.
118
- * - `'redirect'` a full-page navigation to `auth.oxy.so`, which returns to
119
- * the registered `redirect_uri` with `?code=`. The tab unmounts and
120
- * remounts, so route and unsaved state are lost.
121
- *
122
- * Either way the navigation only ever happens from a real user gesture: the
123
- * SDK never bounces the top-level window on its own (#691 phase 7b).
113
+ * - `'redirect'` (default) — a full-page navigation to `auth.oxy.so`, which
114
+ * returns to the registered `redirect_uri` with `?code=`. The tab unmounts
115
+ * and remounts, so route and unsaved state are lost.
116
+ * - `'popup'` a small `auth.oxy.so` window opened from the user's click.
117
+ * The app stays MOUNTED and becomes authenticated without a reload; the
118
+ * IdP delivers only the authorization code + `state` back to the opener
119
+ * via `postMessage` (never a token, device secret, or PKCE verifier). A
120
+ * blocked popup falls back to the redirect automatically.
124
121
  *
125
122
  * Native is unaffected — it always uses an in-app auth session.
126
- * @default 'popup'
123
+ * @default 'redirect'
127
124
  */
128
125
  webAuthMode?: WebAuthMode;
129
126
  queryClient?: QueryClient;
127
+ /** Sync device credentials to auth.oxy.so after interactive sign-in. @default true */
128
+ hubSync?: boolean;
130
129
  /**
131
130
  * Convenience: wrap the whole app subtree in `<RequireOxyAuth prompt=...>`.
132
131
  * `off` (default) renders children unconditionally; `soft` adds a dismissible
@@ -136,11 +135,4 @@ export interface OxyProviderProps {
136
135
  * @default 'off'
137
136
  */
138
137
  requireAuth?: 'off' | 'soft' | 'hard';
139
- /**
140
- * When true, provisions a non-rotating background credential for native code
141
- * (Android widgets) that runs without a JS runtime. Android-only today; inert
142
- * on web and iOS.
143
- * @default false
144
- */
145
- backgroundSession?: boolean;
146
138
  }
@@ -0,0 +1,143 @@
1
+ import type { OxyServices } from '@oxyhq/core';
2
+
3
+ // Spy on the platform redirect so no real navigation happens and we can assert
4
+ // the authorize URL the silent-restore flow hands to the browser.
5
+ jest.mock('../../components/oauthNavigation', () => ({
6
+ redirectToAuthorize: jest.fn(),
7
+ }));
8
+
9
+ // jsdom's `location` is non-configurable, so the origin the code reads cannot be
10
+ // reassigned per-test. Instead, drive the ORIGIN-CLASSIFICATION predicates
11
+ // (whose real behaviour is covered by core's officialOrigins.test.ts) and keep
12
+ // every other core helper real (PKCE, authorize-URL builder, handshake store).
13
+ jest.mock('@oxyhq/core', () => {
14
+ const actual = jest.requireActual('@oxyhq/core');
15
+ return {
16
+ __esModule: true,
17
+ ...actual,
18
+ isLoopbackOrigin: jest.fn(),
19
+ isOfficialWebOrigin: jest.fn(),
20
+ isIdpHubOrigin: jest.fn(),
21
+ };
22
+ });
23
+
24
+ import {
25
+ isLoopbackOrigin,
26
+ isOfficialWebOrigin,
27
+ isIdpHubOrigin,
28
+ } from '@oxyhq/core';
29
+ import { redirectToAuthorize } from '../../components/oauthNavigation';
30
+ import {
31
+ isSilentRestoreEligibleOrigin,
32
+ maybeStartSilentOAuthRestore,
33
+ clearCrossOriginRestoreGuards,
34
+ } from '../crossOriginRestore';
35
+
36
+ const mockRedirect = redirectToAuthorize as jest.Mock;
37
+ const mockIsLoopback = isLoopbackOrigin as jest.Mock;
38
+ const mockIsOfficial = isOfficialWebOrigin as jest.Mock;
39
+ const mockIsIdpHub = isIdpHubOrigin as jest.Mock;
40
+
41
+ const OXY_SERVICES_STUB = {} as OxyServices;
42
+
43
+ /** Default to an eligible official origin; individual tests narrow this. */
44
+ function makeOriginEligible(): void {
45
+ mockIsLoopback.mockReturnValue(false);
46
+ mockIsIdpHub.mockReturnValue(false);
47
+ mockIsOfficial.mockReturnValue(true);
48
+ }
49
+
50
+ describe('crossOriginRestore', () => {
51
+ beforeEach(() => {
52
+ mockRedirect.mockClear();
53
+ mockIsLoopback.mockReset();
54
+ mockIsOfficial.mockReset();
55
+ mockIsIdpHub.mockReset();
56
+ globalThis.sessionStorage?.clear();
57
+ clearCrossOriginRestoreGuards();
58
+ });
59
+
60
+ describe('isSilentRestoreEligibleOrigin', () => {
61
+ it('rejects loopback / local-dev origins', () => {
62
+ mockIsLoopback.mockReturnValue(true);
63
+ mockIsIdpHub.mockReturnValue(false);
64
+ mockIsOfficial.mockReturnValue(true);
65
+ expect(isSilentRestoreEligibleOrigin('http://localhost:3000')).toBe(false);
66
+ });
67
+
68
+ it('rejects the central IdP hub origin (no self-hop)', () => {
69
+ mockIsLoopback.mockReturnValue(false);
70
+ mockIsIdpHub.mockReturnValue(true);
71
+ mockIsOfficial.mockReturnValue(true);
72
+ expect(isSilentRestoreEligibleOrigin('https://auth.oxy.so')).toBe(false);
73
+ });
74
+
75
+ it('rejects non-official origins', () => {
76
+ mockIsLoopback.mockReturnValue(false);
77
+ mockIsIdpHub.mockReturnValue(false);
78
+ mockIsOfficial.mockReturnValue(false);
79
+ expect(isSilentRestoreEligibleOrigin('https://evil.example')).toBe(false);
80
+ });
81
+
82
+ it('accepts official, non-loopback, non-IdP origins', () => {
83
+ makeOriginEligible();
84
+ expect(isSilentRestoreEligibleOrigin('https://accounts.oxy.so')).toBe(true);
85
+ });
86
+ });
87
+
88
+ describe('maybeStartSilentOAuthRestore', () => {
89
+ it('is SKIPPED on a loopback origin (no redirect)', async () => {
90
+ mockIsLoopback.mockReturnValue(true);
91
+ mockIsIdpHub.mockReturnValue(false);
92
+ mockIsOfficial.mockReturnValue(true);
93
+ const redirected = await maybeStartSilentOAuthRestore({
94
+ oxyServices: OXY_SERVICES_STUB,
95
+ clientId: 'oxy_dk_test',
96
+ });
97
+ expect(redirected).toBe(false);
98
+ expect(mockRedirect).not.toHaveBeenCalled();
99
+ });
100
+
101
+ it('is SKIPPED on a non-official origin (no redirect)', async () => {
102
+ mockIsLoopback.mockReturnValue(false);
103
+ mockIsIdpHub.mockReturnValue(false);
104
+ mockIsOfficial.mockReturnValue(false);
105
+ const redirected = await maybeStartSilentOAuthRestore({
106
+ oxyServices: OXY_SERVICES_STUB,
107
+ clientId: 'oxy_dk_test',
108
+ });
109
+ expect(redirected).toBe(false);
110
+ expect(mockRedirect).not.toHaveBeenCalled();
111
+ });
112
+
113
+ it('redirects to the PROD IdP by default on an eligible origin', async () => {
114
+ makeOriginEligible();
115
+ const redirected = await maybeStartSilentOAuthRestore({
116
+ oxyServices: OXY_SERVICES_STUB,
117
+ clientId: 'oxy_dk_test',
118
+ });
119
+ expect(redirected).toBe(true);
120
+ expect(mockRedirect).toHaveBeenCalledTimes(1);
121
+ const url = mockRedirect.mock.calls[0][0] as string;
122
+ expect(url.startsWith('https://auth.oxy.so/authorize?')).toBe(true);
123
+ const params = new URL(url).searchParams;
124
+ expect(params.get('client_id')).toBe('oxy_dk_test');
125
+ expect(params.get('prompt')).toBe('none');
126
+ });
127
+
128
+ it('honors an authorizeBaseUrl override (self-hosted / staging IdP)', async () => {
129
+ makeOriginEligible();
130
+ const redirected = await maybeStartSilentOAuthRestore({
131
+ oxyServices: OXY_SERVICES_STUB,
132
+ clientId: 'oxy_dk_test',
133
+ authorizeBaseUrl: 'https://auth.staging.oxy.so/authorize',
134
+ });
135
+ expect(redirected).toBe(true);
136
+ const url = mockRedirect.mock.calls[0][0] as string;
137
+ expect(url.startsWith('https://auth.staging.oxy.so/authorize?')).toBe(true);
138
+ const params = new URL(url).searchParams;
139
+ expect(params.get('client_id')).toBe('oxy_dk_test');
140
+ expect(params.get('prompt')).toBe('none');
141
+ });
142
+ });
143
+ });
@@ -0,0 +1,169 @@
1
+ import type { OxyServices } from '@oxyhq/core';
2
+ import {
3
+ buildOAuthAuthorizeUrl,
4
+ generateOAuthState,
5
+ generatePkcePair,
6
+ isIdpHubOrigin,
7
+ isLoopbackOrigin,
8
+ isOfficialWebOrigin,
9
+ OXY_CROSS_ORIGIN_RESTORE_ATTEMPTED_KEY,
10
+ OXY_SILENT_OAUTH_ATTEMPTED_KEY,
11
+ clearOAuthHandshake,
12
+ persistOAuthHandshake,
13
+ normalizeOAuthRedirectUri,
14
+ logger,
15
+ } from '@oxyhq/core';
16
+ import { isWebBrowser } from './isWebBrowser';
17
+ import { replaceUrlAfterOAuthReturn } from './oauthReturn';
18
+ import { redirectToAuthorize } from '../components/oauthNavigation';
19
+
20
+ function sessionStore(): Storage | undefined {
21
+ return (globalThis as { sessionStorage?: Storage }).sessionStorage;
22
+ }
23
+
24
+ /** True when this tab already attempted cross-origin silent OAuth restore. */
25
+ export function isCrossOriginRestoreBlocked(): boolean {
26
+ const store = sessionStore();
27
+ if (!store) return false;
28
+ return Boolean(
29
+ store.getItem(OXY_CROSS_ORIGIN_RESTORE_ATTEMPTED_KEY) ||
30
+ store.getItem(OXY_SILENT_OAUTH_ATTEMPTED_KEY),
31
+ );
32
+ }
33
+
34
+ /** Mark restore as attempted — never auto-retry until sign-out clears guards. */
35
+ export function markCrossOriginRestoreAttempted(): void {
36
+ const store = sessionStore();
37
+ if (!store) return;
38
+ store.setItem(OXY_CROSS_ORIGIN_RESTORE_ATTEMPTED_KEY, '1');
39
+ store.setItem(OXY_SILENT_OAUTH_ATTEMPTED_KEY, '1');
40
+ }
41
+
42
+ /** Clear all cross-origin restore loop guards (call on sign-out). */
43
+ export function clearCrossOriginRestoreGuards(): void {
44
+ const store = sessionStore();
45
+ if (!store) return;
46
+ for (const key of [OXY_CROSS_ORIGIN_RESTORE_ATTEMPTED_KEY, OXY_SILENT_OAUTH_ATTEMPTED_KEY]) {
47
+ store.removeItem(key);
48
+ }
49
+ }
50
+
51
+ /**
52
+ * Whether cold boot should attempt silent cross-origin OAuth restore for the
53
+ * given web origin.
54
+ *
55
+ * Mirrors the hub-sync WRITE gate (`syncHubAfterSignIn`): only OFFICIAL Oxy web
56
+ * origins participate in cross-app SSO — a random third-party / preview origin
57
+ * must never have its tab bounced to the IdP. Additionally, loopback / local-dev
58
+ * origins are EXCLUDED here even though {@link isOfficialWebOrigin} treats them
59
+ * as official: a developer's local app must never be redirected to a hosted IdP
60
+ * on cold boot (it signs in through the in-app dialog instead). The central IdP
61
+ * hub's own origin is excluded to avoid a wasteful self-hop.
62
+ */
63
+ export function isSilentRestoreEligibleOrigin(origin: string): boolean {
64
+ if (isLoopbackOrigin(origin)) return false;
65
+ if (isIdpHubOrigin()) return false;
66
+ return isOfficialWebOrigin(origin);
67
+ }
68
+
69
+ export interface SilentOAuthRestoreOptions {
70
+ oxyServices: OxyServices;
71
+ clientId: string;
72
+ redirectUri?: string;
73
+ scope?: string;
74
+ /**
75
+ * Authorize endpoint override (env-configurable per deployment). Defaults to
76
+ * the production Oxy IdP when unset, so a local/staging app points silent
77
+ * restore at its OWN IdP instead of production `auth.oxy.so`.
78
+ */
79
+ authorizeBaseUrl?: string;
80
+ }
81
+
82
+ /**
83
+ * Top-level redirect to auth.oxy.so/authorize with `prompt=none` for silent
84
+ * cross-origin session restore on all web apps (official + third-party).
85
+ */
86
+ export async function maybeStartSilentOAuthRestore(
87
+ opts: SilentOAuthRestoreOptions,
88
+ ): Promise<boolean> {
89
+ if (!isWebBrowser()) return false;
90
+
91
+ const location = (globalThis as { location?: Location }).location;
92
+ if (!location) return false;
93
+
94
+ // Defense-in-depth: never bounce a loopback / non-official / IdP-hub origin to
95
+ // a hosted authorize endpoint (the caller gates on this too).
96
+ if (!isSilentRestoreEligibleOrigin(location.origin)) {
97
+ return false;
98
+ }
99
+
100
+ if (isCrossOriginRestoreBlocked()) {
101
+ return false;
102
+ }
103
+
104
+ const params = new URLSearchParams(location.search);
105
+ if (params.has('code') || params.has('error')) {
106
+ return false;
107
+ }
108
+
109
+ try {
110
+ const { codeVerifier, codeChallenge } = await generatePkcePair();
111
+ const state = await generateOAuthState();
112
+ if (!persistOAuthHandshake(state, codeVerifier)) {
113
+ return false;
114
+ }
115
+
116
+ const redirectUri = normalizeOAuthRedirectUri(
117
+ opts.redirectUri ?? location.origin,
118
+ );
119
+
120
+ const authorizeUrl = buildOAuthAuthorizeUrl({
121
+ authorizeBaseUrl: opts.authorizeBaseUrl,
122
+ clientId: opts.clientId,
123
+ redirectUri,
124
+ state,
125
+ codeChallenge,
126
+ scope: opts.scope,
127
+ prompt: 'none',
128
+ });
129
+
130
+ markCrossOriginRestoreAttempted();
131
+ redirectToAuthorize(authorizeUrl);
132
+ return true;
133
+ } catch (error) {
134
+ logger.warn('Silent OAuth restore skipped', { component: 'crossOriginRestore' }, error);
135
+ return false;
136
+ }
137
+ }
138
+
139
+ /**
140
+ * When the RP lands with OAuth error params from a silent authorize attempt,
141
+ * strip them and return whether the error was terminal for silent restore.
142
+ */
143
+ export function consumeSilentOAuthError(): 'login_required' | 'consent_required' | null {
144
+ if (!isWebBrowser()) return null;
145
+ const location = (globalThis as { location?: Location; history?: History }).location;
146
+ const history = (globalThis as { history?: History }).history;
147
+ if (!location) return null;
148
+
149
+ const params = new URLSearchParams(location.search);
150
+ const error = params.get('error');
151
+ if (error !== 'login_required' && error !== 'consent_required') {
152
+ return null;
153
+ }
154
+
155
+ markCrossOriginRestoreAttempted();
156
+
157
+ if (history?.replaceState) {
158
+ const url = new URL(location.href);
159
+ url.searchParams.delete('error');
160
+ url.searchParams.delete('error_description');
161
+ url.searchParams.delete('state');
162
+ // Silent restore failed, but the visitor still asked for a specific page.
163
+ // Put them back on it rather than leaving them on the bare origin the IdP
164
+ // redirected to.
165
+ replaceUrlAfterOAuthReturn(`${url.pathname}${url.search}${url.hash}`);
166
+ }
167
+ clearOAuthHandshake();
168
+ return error;
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,42 +30,37 @@ 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(
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";
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';
69
64
  }
70
65
 
71
66
  /**
@@ -81,90 +76,79 @@ export function getFileIcon(
81
76
  * 'ArrayBuffer' and 'ArrayBufferView' are not supported").
82
77
  */
83
78
  export async function convertDocumentPickerAssetToFile(
84
- doc: PickerAsset,
85
- index: number,
79
+ doc: PickerAsset,
80
+ index: number
86
81
  ): Promise<FileWithUri | RNFileDescriptor | null> {
87
- const fileName = doc.name || `file-${index + 1}`;
88
- const fileType = doc.mimeType || "application/octet-stream";
82
+ const fileName = doc.name || `file-${index + 1}`;
83
+ const fileType = doc.mimeType || 'application/octet-stream';
89
84
 
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
- }
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
+ }
102
97
 
103
- try {
104
- let file: FileWithUri | null = null;
98
+ try {
99
+ let file: FileWithUri | null = null;
105
100
 
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
- }
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
+ }
127
116
 
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
- }
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
+ }
150
134
 
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
- }
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
+ }
157
141
  }
158
142
 
159
143
  /**
160
144
  * Upload file raw - helper function for file uploads
161
145
  */
162
146
  export async function uploadFileRaw(
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",
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'
168
152
  ) {
169
- return await oxyServices.uploadRawFile(file, visibility);
153
+ return await oxyServices.uploadRawFile(file, visibility);
170
154
  }