@oxyhq/services 16.0.0 → 18.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 (278) hide show
  1. package/README.md +77 -98
  2. package/lib/commonjs/index.js +40 -51
  3. package/lib/commonjs/index.js.map +1 -1
  4. package/lib/commonjs/ui/client.js +0 -14
  5. package/lib/commonjs/ui/client.js.map +1 -1
  6. package/lib/commonjs/ui/components/OxyAccountDialog.js +742 -0
  7. package/lib/commonjs/ui/components/OxyAccountDialog.js.map +1 -0
  8. package/lib/commonjs/ui/components/OxyConsentScreen.js +461 -0
  9. package/lib/commonjs/ui/components/OxyConsentScreen.js.map +1 -0
  10. package/lib/commonjs/ui/components/OxyProvider.js +13 -6
  11. package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
  12. package/lib/commonjs/ui/components/OxySignInButton.js +180 -22
  13. package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
  14. package/lib/commonjs/ui/components/ProfileButton.js +25 -112
  15. package/lib/commonjs/ui/components/ProfileButton.js.map +1 -1
  16. package/lib/commonjs/ui/components/RequireOxyAuth.js +299 -0
  17. package/lib/commonjs/ui/components/RequireOxyAuth.js.map +1 -0
  18. package/lib/commonjs/ui/components/oauthNavigation.js +73 -0
  19. package/lib/commonjs/ui/components/oauthNavigation.js.map +1 -0
  20. package/lib/commonjs/ui/context/OxyContext.js +122 -4
  21. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  22. package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js +1 -1
  23. package/lib/commonjs/ui/hooks/useAuth.js +19 -30
  24. package/lib/commonjs/ui/hooks/useAuth.js.map +1 -1
  25. package/lib/commonjs/ui/hooks/useSwitchableAccounts.js +37 -267
  26. package/lib/commonjs/ui/hooks/useSwitchableAccounts.js.map +1 -1
  27. package/lib/commonjs/ui/index.js +5 -40
  28. package/lib/commonjs/ui/index.js.map +1 -1
  29. package/lib/commonjs/ui/navigation/accountDialogManager.js +91 -0
  30. package/lib/commonjs/ui/navigation/accountDialogManager.js.map +1 -0
  31. package/lib/commonjs/ui/navigation/routes.js +0 -2
  32. package/lib/commonjs/ui/navigation/routes.js.map +1 -1
  33. package/lib/commonjs/ui/screens/ManageAccountScreen.js +4 -3
  34. package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
  35. package/lib/commonjs/ui/session/createSessionClient.js +10 -2
  36. package/lib/commonjs/ui/session/createSessionClient.js.map +1 -1
  37. package/lib/module/index.js +19 -16
  38. package/lib/module/index.js.map +1 -1
  39. package/lib/module/ui/client.js +1 -2
  40. package/lib/module/ui/client.js.map +1 -1
  41. package/lib/module/ui/components/OxyAccountDialog.js +739 -0
  42. package/lib/module/ui/components/OxyAccountDialog.js.map +1 -0
  43. package/lib/module/ui/components/OxyConsentScreen.js +454 -0
  44. package/lib/module/ui/components/OxyConsentScreen.js.map +1 -0
  45. package/lib/module/ui/components/OxyProvider.js +13 -6
  46. package/lib/module/ui/components/OxyProvider.js.map +1 -1
  47. package/lib/module/ui/components/OxySignInButton.js +181 -22
  48. package/lib/module/ui/components/OxySignInButton.js.map +1 -1
  49. package/lib/module/ui/components/ProfileButton.js +26 -112
  50. package/lib/module/ui/components/ProfileButton.js.map +1 -1
  51. package/lib/module/ui/components/RequireOxyAuth.js +294 -0
  52. package/lib/module/ui/components/RequireOxyAuth.js.map +1 -0
  53. package/lib/module/ui/components/oauthNavigation.js +70 -0
  54. package/lib/module/ui/components/oauthNavigation.js.map +1 -0
  55. package/lib/module/ui/context/OxyContext.js +123 -5
  56. package/lib/module/ui/context/OxyContext.js.map +1 -1
  57. package/lib/module/ui/hooks/mutations/useAccountMutations.js +1 -1
  58. package/lib/module/ui/hooks/useAuth.js +19 -30
  59. package/lib/module/ui/hooks/useAuth.js.map +1 -1
  60. package/lib/module/ui/hooks/useSwitchableAccounts.js +38 -267
  61. package/lib/module/ui/hooks/useSwitchableAccounts.js.map +1 -1
  62. package/lib/module/ui/index.js +1 -5
  63. package/lib/module/ui/index.js.map +1 -1
  64. package/lib/module/ui/navigation/accountDialogManager.js +81 -0
  65. package/lib/module/ui/navigation/accountDialogManager.js.map +1 -0
  66. package/lib/module/ui/navigation/routes.js +0 -2
  67. package/lib/module/ui/navigation/routes.js.map +1 -1
  68. package/lib/module/ui/screens/ManageAccountScreen.js +4 -3
  69. package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
  70. package/lib/module/ui/session/createSessionClient.js +10 -2
  71. package/lib/module/ui/session/createSessionClient.js.map +1 -1
  72. package/lib/typescript/commonjs/index.d.ts +8 -12
  73. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  74. package/lib/typescript/commonjs/ui/client.d.ts +0 -4
  75. package/lib/typescript/commonjs/ui/client.d.ts.map +1 -1
  76. package/lib/typescript/commonjs/ui/components/OxyAccountDialog.d.ts +51 -0
  77. package/lib/typescript/commonjs/ui/components/OxyAccountDialog.d.ts.map +1 -0
  78. package/lib/typescript/commonjs/ui/components/OxyConsentScreen.d.ts +45 -0
  79. package/lib/typescript/commonjs/ui/components/OxyConsentScreen.d.ts.map +1 -0
  80. package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts +2 -2
  81. package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
  82. package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts +56 -0
  83. package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts.map +1 -1
  84. package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts +11 -23
  85. package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts.map +1 -1
  86. package/lib/typescript/commonjs/ui/components/RequireOxyAuth.d.ts +55 -0
  87. package/lib/typescript/commonjs/ui/components/RequireOxyAuth.d.ts.map +1 -0
  88. package/lib/typescript/commonjs/ui/components/oauthNavigation.d.ts +36 -0
  89. package/lib/typescript/commonjs/ui/components/oauthNavigation.d.ts.map +1 -0
  90. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts +27 -1
  91. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
  92. package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  93. package/lib/typescript/commonjs/ui/hooks/queries/useServicesQueries.d.ts +1 -1
  94. package/lib/typescript/commonjs/ui/hooks/queries/useServicesQueries.d.ts.map +1 -1
  95. package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts.map +1 -1
  96. package/lib/typescript/commonjs/ui/hooks/useSwitchableAccounts.d.ts +13 -152
  97. package/lib/typescript/commonjs/ui/hooks/useSwitchableAccounts.d.ts.map +1 -1
  98. package/lib/typescript/commonjs/ui/index.d.ts +2 -5
  99. package/lib/typescript/commonjs/ui/index.d.ts.map +1 -1
  100. package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts +49 -0
  101. package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts.map +1 -0
  102. package/lib/typescript/commonjs/ui/navigation/routes.d.ts +1 -1
  103. package/lib/typescript/commonjs/ui/navigation/routes.d.ts.map +1 -1
  104. package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts +1 -1
  105. package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -1
  106. package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts +9 -2
  107. package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts.map +1 -1
  108. package/lib/typescript/commonjs/ui/types/navigation.d.ts +27 -0
  109. package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
  110. package/lib/typescript/module/index.d.ts +8 -12
  111. package/lib/typescript/module/index.d.ts.map +1 -1
  112. package/lib/typescript/module/ui/client.d.ts +0 -4
  113. package/lib/typescript/module/ui/client.d.ts.map +1 -1
  114. package/lib/typescript/module/ui/components/OxyAccountDialog.d.ts +51 -0
  115. package/lib/typescript/module/ui/components/OxyAccountDialog.d.ts.map +1 -0
  116. package/lib/typescript/module/ui/components/OxyConsentScreen.d.ts +45 -0
  117. package/lib/typescript/module/ui/components/OxyConsentScreen.d.ts.map +1 -0
  118. package/lib/typescript/module/ui/components/OxyProvider.d.ts +2 -2
  119. package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
  120. package/lib/typescript/module/ui/components/OxySignInButton.d.ts +56 -0
  121. package/lib/typescript/module/ui/components/OxySignInButton.d.ts.map +1 -1
  122. package/lib/typescript/module/ui/components/ProfileButton.d.ts +11 -23
  123. package/lib/typescript/module/ui/components/ProfileButton.d.ts.map +1 -1
  124. package/lib/typescript/module/ui/components/RequireOxyAuth.d.ts +55 -0
  125. package/lib/typescript/module/ui/components/RequireOxyAuth.d.ts.map +1 -0
  126. package/lib/typescript/module/ui/components/oauthNavigation.d.ts +36 -0
  127. package/lib/typescript/module/ui/components/oauthNavigation.d.ts.map +1 -0
  128. package/lib/typescript/module/ui/context/OxyContext.d.ts +27 -1
  129. package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
  130. package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  131. package/lib/typescript/module/ui/hooks/queries/useServicesQueries.d.ts +1 -1
  132. package/lib/typescript/module/ui/hooks/queries/useServicesQueries.d.ts.map +1 -1
  133. package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
  134. package/lib/typescript/module/ui/hooks/useSwitchableAccounts.d.ts +13 -152
  135. package/lib/typescript/module/ui/hooks/useSwitchableAccounts.d.ts.map +1 -1
  136. package/lib/typescript/module/ui/index.d.ts +2 -5
  137. package/lib/typescript/module/ui/index.d.ts.map +1 -1
  138. package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts +49 -0
  139. package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts.map +1 -0
  140. package/lib/typescript/module/ui/navigation/routes.d.ts +1 -1
  141. package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
  142. package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts +1 -1
  143. package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -1
  144. package/lib/typescript/module/ui/session/createSessionClient.d.ts +9 -2
  145. package/lib/typescript/module/ui/session/createSessionClient.d.ts.map +1 -1
  146. package/lib/typescript/module/ui/types/navigation.d.ts +27 -0
  147. package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
  148. package/package.json +4 -4
  149. package/src/index.ts +33 -27
  150. package/src/ui/client.ts +0 -4
  151. package/src/ui/components/OxyAccountDialog.tsx +735 -0
  152. package/src/ui/components/OxyConsentScreen.tsx +456 -0
  153. package/src/ui/components/OxyProvider.tsx +14 -6
  154. package/src/ui/components/OxySignInButton.tsx +227 -22
  155. package/src/ui/components/ProfileButton.tsx +23 -126
  156. package/src/ui/components/RequireOxyAuth.tsx +266 -0
  157. package/src/ui/components/__tests__/OxyConsentScreen.test.tsx +130 -0
  158. package/src/ui/components/oauthNavigation.ts +89 -0
  159. package/src/ui/context/OxyContext.tsx +176 -9
  160. package/src/ui/context/__tests__/OxyContext.coldBoot.test.tsx +165 -0
  161. package/src/ui/hooks/mutations/useAccountMutations.ts +1 -1
  162. package/src/ui/hooks/useAuth.ts +19 -31
  163. package/src/ui/hooks/useSwitchableAccounts.ts +42 -376
  164. package/src/ui/index.ts +2 -5
  165. package/src/ui/navigation/accountDialogManager.ts +84 -0
  166. package/src/ui/navigation/routes.ts +0 -4
  167. package/src/ui/screens/ManageAccountScreen.tsx +3 -2
  168. package/src/ui/session/createSessionClient.ts +9 -1
  169. package/src/ui/types/navigation.ts +27 -0
  170. package/lib/commonjs/ui/components/AccountMenu.js +0 -598
  171. package/lib/commonjs/ui/components/AccountMenu.js.map +0 -1
  172. package/lib/commonjs/ui/components/AccountMenuButton.js +0 -135
  173. package/lib/commonjs/ui/components/AccountMenuButton.js.map +0 -1
  174. package/lib/commonjs/ui/components/AccountSwitcher.js +0 -780
  175. package/lib/commonjs/ui/components/AccountSwitcher.js.map +0 -1
  176. package/lib/commonjs/ui/components/AnotherDeviceQR.js +0 -116
  177. package/lib/commonjs/ui/components/AnotherDeviceQR.js.map +0 -1
  178. package/lib/commonjs/ui/components/ProfileMenu.js +0 -518
  179. package/lib/commonjs/ui/components/ProfileMenu.js.map +0 -1
  180. package/lib/commonjs/ui/components/SignInAccountChooser.js +0 -189
  181. package/lib/commonjs/ui/components/SignInAccountChooser.js.map +0 -1
  182. package/lib/commonjs/ui/components/SignInModal.js +0 -600
  183. package/lib/commonjs/ui/components/SignInModal.js.map +0 -1
  184. package/lib/commonjs/ui/hooks/useOxyAuthSession.js +0 -501
  185. package/lib/commonjs/ui/hooks/useOxyAuthSession.js.map +0 -1
  186. package/lib/commonjs/ui/hooks/usePasswordSignIn.js +0 -170
  187. package/lib/commonjs/ui/hooks/usePasswordSignIn.js.map +0 -1
  188. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +0 -51
  189. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +0 -1
  190. package/lib/commonjs/ui/screens/OxyAuthScreen.js +0 -312
  191. package/lib/commonjs/ui/screens/OxyAuthScreen.js.map +0 -1
  192. package/lib/commonjs/utils/deviceFlowSignIn.js +0 -109
  193. package/lib/commonjs/utils/deviceFlowSignIn.js.map +0 -1
  194. package/lib/module/ui/components/AccountMenu.js +0 -593
  195. package/lib/module/ui/components/AccountMenu.js.map +0 -1
  196. package/lib/module/ui/components/AccountMenuButton.js +0 -130
  197. package/lib/module/ui/components/AccountMenuButton.js.map +0 -1
  198. package/lib/module/ui/components/AccountSwitcher.js +0 -774
  199. package/lib/module/ui/components/AccountSwitcher.js.map +0 -1
  200. package/lib/module/ui/components/AnotherDeviceQR.js +0 -110
  201. package/lib/module/ui/components/AnotherDeviceQR.js.map +0 -1
  202. package/lib/module/ui/components/ProfileMenu.js +0 -514
  203. package/lib/module/ui/components/ProfileMenu.js.map +0 -1
  204. package/lib/module/ui/components/SignInAccountChooser.js +0 -183
  205. package/lib/module/ui/components/SignInAccountChooser.js.map +0 -1
  206. package/lib/module/ui/components/SignInModal.js +0 -591
  207. package/lib/module/ui/components/SignInModal.js.map +0 -1
  208. package/lib/module/ui/hooks/useOxyAuthSession.js +0 -495
  209. package/lib/module/ui/hooks/useOxyAuthSession.js.map +0 -1
  210. package/lib/module/ui/hooks/usePasswordSignIn.js +0 -165
  211. package/lib/module/ui/hooks/usePasswordSignIn.js.map +0 -1
  212. package/lib/module/ui/screens/AccountSwitcherScreen.js +0 -48
  213. package/lib/module/ui/screens/AccountSwitcherScreen.js.map +0 -1
  214. package/lib/module/ui/screens/OxyAuthScreen.js +0 -306
  215. package/lib/module/ui/screens/OxyAuthScreen.js.map +0 -1
  216. package/lib/module/utils/deviceFlowSignIn.js +0 -106
  217. package/lib/module/utils/deviceFlowSignIn.js.map +0 -1
  218. package/lib/typescript/commonjs/ui/components/AccountMenu.d.ts +0 -47
  219. package/lib/typescript/commonjs/ui/components/AccountMenu.d.ts.map +0 -1
  220. package/lib/typescript/commonjs/ui/components/AccountMenuButton.d.ts +0 -26
  221. package/lib/typescript/commonjs/ui/components/AccountMenuButton.d.ts.map +0 -1
  222. package/lib/typescript/commonjs/ui/components/AccountSwitcher.d.ts +0 -46
  223. package/lib/typescript/commonjs/ui/components/AccountSwitcher.d.ts.map +0 -1
  224. package/lib/typescript/commonjs/ui/components/AnotherDeviceQR.d.ts +0 -34
  225. package/lib/typescript/commonjs/ui/components/AnotherDeviceQR.d.ts.map +0 -1
  226. package/lib/typescript/commonjs/ui/components/ProfileMenu.d.ts +0 -49
  227. package/lib/typescript/commonjs/ui/components/ProfileMenu.d.ts.map +0 -1
  228. package/lib/typescript/commonjs/ui/components/SignInAccountChooser.d.ts +0 -29
  229. package/lib/typescript/commonjs/ui/components/SignInAccountChooser.d.ts.map +0 -1
  230. package/lib/typescript/commonjs/ui/components/SignInModal.d.ts +0 -28
  231. package/lib/typescript/commonjs/ui/components/SignInModal.d.ts.map +0 -1
  232. package/lib/typescript/commonjs/ui/hooks/useOxyAuthSession.d.ts +0 -105
  233. package/lib/typescript/commonjs/ui/hooks/useOxyAuthSession.d.ts.map +0 -1
  234. package/lib/typescript/commonjs/ui/hooks/usePasswordSignIn.d.ts +0 -31
  235. package/lib/typescript/commonjs/ui/hooks/usePasswordSignIn.d.ts.map +0 -1
  236. package/lib/typescript/commonjs/ui/screens/AccountSwitcherScreen.d.ts +0 -11
  237. package/lib/typescript/commonjs/ui/screens/AccountSwitcherScreen.d.ts.map +0 -1
  238. package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts +0 -22
  239. package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts.map +0 -1
  240. package/lib/typescript/commonjs/utils/deviceFlowSignIn.d.ts +0 -97
  241. package/lib/typescript/commonjs/utils/deviceFlowSignIn.d.ts.map +0 -1
  242. package/lib/typescript/module/ui/components/AccountMenu.d.ts +0 -47
  243. package/lib/typescript/module/ui/components/AccountMenu.d.ts.map +0 -1
  244. package/lib/typescript/module/ui/components/AccountMenuButton.d.ts +0 -26
  245. package/lib/typescript/module/ui/components/AccountMenuButton.d.ts.map +0 -1
  246. package/lib/typescript/module/ui/components/AccountSwitcher.d.ts +0 -46
  247. package/lib/typescript/module/ui/components/AccountSwitcher.d.ts.map +0 -1
  248. package/lib/typescript/module/ui/components/AnotherDeviceQR.d.ts +0 -34
  249. package/lib/typescript/module/ui/components/AnotherDeviceQR.d.ts.map +0 -1
  250. package/lib/typescript/module/ui/components/ProfileMenu.d.ts +0 -49
  251. package/lib/typescript/module/ui/components/ProfileMenu.d.ts.map +0 -1
  252. package/lib/typescript/module/ui/components/SignInAccountChooser.d.ts +0 -29
  253. package/lib/typescript/module/ui/components/SignInAccountChooser.d.ts.map +0 -1
  254. package/lib/typescript/module/ui/components/SignInModal.d.ts +0 -28
  255. package/lib/typescript/module/ui/components/SignInModal.d.ts.map +0 -1
  256. package/lib/typescript/module/ui/hooks/useOxyAuthSession.d.ts +0 -105
  257. package/lib/typescript/module/ui/hooks/useOxyAuthSession.d.ts.map +0 -1
  258. package/lib/typescript/module/ui/hooks/usePasswordSignIn.d.ts +0 -31
  259. package/lib/typescript/module/ui/hooks/usePasswordSignIn.d.ts.map +0 -1
  260. package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts +0 -11
  261. package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts.map +0 -1
  262. package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts +0 -22
  263. package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts.map +0 -1
  264. package/lib/typescript/module/utils/deviceFlowSignIn.d.ts +0 -97
  265. package/lib/typescript/module/utils/deviceFlowSignIn.d.ts.map +0 -1
  266. package/src/ui/components/AccountMenu.tsx +0 -645
  267. package/src/ui/components/AccountMenuButton.tsx +0 -126
  268. package/src/ui/components/AccountSwitcher.tsx +0 -751
  269. package/src/ui/components/AnotherDeviceQR.tsx +0 -119
  270. package/src/ui/components/ProfileMenu.tsx +0 -564
  271. package/src/ui/components/SignInAccountChooser.tsx +0 -162
  272. package/src/ui/components/SignInModal.tsx +0 -530
  273. package/src/ui/hooks/useOxyAuthSession.ts +0 -635
  274. package/src/ui/hooks/usePasswordSignIn.ts +0 -207
  275. package/src/ui/screens/AccountSwitcherScreen.tsx +0 -43
  276. package/src/ui/screens/OxyAuthScreen.tsx +0 -324
  277. package/src/utils/__tests__/deviceFlowSignIn.test.ts +0 -231
  278. package/src/utils/deviceFlowSignIn.ts +0 -152
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Platform navigation for the third-party "Sign in with Oxy" OAuth flow.
3
+ *
4
+ * Kept out of `OxySignInButton` so the button's routing logic can be unit-tested
5
+ * without driving a real browser navigation (jsdom's `location.assign` is
6
+ * non-configurable and cannot be spied). Both entry points hand a fully-built
7
+ * `auth.oxy.so/authorize` URL to the platform — never FedCM, an SSO bounce, or
8
+ * an Oxy session cookie.
9
+ */
10
+ /** Outcome of opening the authorize URL on native. */
11
+ export interface OpenAuthorizeResult {
12
+ /**
13
+ * The deep-link URL the auth session returned to (carries `?code=…&state=…`)
14
+ * when `expo-web-browser` observed it, else `null`. `null` means the RP must
15
+ * complete the exchange from its own deep-link handler (e.g. after the
16
+ * `Linking.openURL` fallback, which cannot observe the return URL).
17
+ */
18
+ redirectUrl: string | null;
19
+ }
20
+ /**
21
+ * Web: hand the TOP-LEVEL document to the OAuth authorize URL (a full-page
22
+ * redirect, not a popup) so the RP returns to its registered `redirect_uri`.
23
+ * No-op where `location` is unavailable (SSR / non-browser hosts).
24
+ */
25
+ export declare function redirectToAuthorize(url: string): void;
26
+ /**
27
+ * Native: open the authorize URL in an in-app auth session via the optional
28
+ * `expo-web-browser` module (`openAuthSessionAsync` returns to `redirectUri`),
29
+ * degrading to `Linking.openURL` when the module is not installed — the same
30
+ * dynamic-import-with-fallback pattern services uses for haptics/netinfo.
31
+ *
32
+ * Returns the deep-link URL the session came back to when it can be observed, so
33
+ * the caller can hand `?code=…&state=…` back to the RP for the token exchange.
34
+ */
35
+ export declare function openAuthorizeUrlNative(url: string, redirectUri: string): Promise<OpenAuthorizeResult>;
36
+ //# sourceMappingURL=oauthNavigation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauthNavigation.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/oauthNavigation.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAgBH,sDAAsD;AACtD,MAAM,WAAW,mBAAmB;IAChC;;;;;OAKG;IACH,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAErD;AAED;;;;;;;;GAQG;AACH,wBAAsB,sBAAsB,CACxC,GAAG,EAAE,MAAM,EACX,WAAW,EAAE,MAAM,GACpB,OAAO,CAAC,mBAAmB,CAAC,CAgC9B"}
@@ -1,7 +1,7 @@
1
1
  import type React from 'react';
2
2
  import { type ReactNode } from 'react';
3
3
  import { OxyServices } from '@oxyhq/core';
4
- import type { User, ApiError, SessionLoginResponse, AccountNode, CreateAccountInput, ClientSession } from '@oxyhq/core';
4
+ import type { User, ApiError, SessionLoginResponse, AccountNode, CreateAccountInput, ClientSession, AccountDialogController, AccountDialogView } from '@oxyhq/core';
5
5
  import type { UseFollowHook } from '../hooks/useFollow.types.js';
6
6
  import { useLanguageManagement } from '../hooks/useLanguageManagement.js';
7
7
  import type { RouteName } from '../navigation/routes.js';
@@ -101,6 +101,18 @@ export interface OxyContextState {
101
101
  props?: Record<string, unknown>;
102
102
  }) => void;
103
103
  openAvatarPicker: () => void;
104
+ /** The headless controller driving {@link openAccountDialog}. `null` before mount. */
105
+ accountDialogController: AccountDialogController | null;
106
+ /** Whether the unified account dialog is currently presented. */
107
+ isAccountDialogOpen: boolean;
108
+ /**
109
+ * Open the unified account dialog. `accounts` (default) shows the switcher;
110
+ * `signin` / `add` open the sign-in entry. Replaces every prior device/account
111
+ * surface and the standalone sign-in modal.
112
+ */
113
+ openAccountDialog: (view?: AccountDialogView) => void;
114
+ /** Dismiss the unified account dialog and cancel any in-flight sign-in flow. */
115
+ closeAccountDialog: () => void;
104
116
  /** Every account the caller can access — own personal root, owned, and shared — from `listAccounts()`. */
105
117
  accounts: AccountNode[];
106
118
  /**
@@ -146,6 +158,20 @@ export interface OxyContextProviderProps {
146
158
  * for the cross-app device sign-in flow. See {@link OxyContextState.clientId}.
147
159
  */
148
160
  clientId?: string;
161
+ /**
162
+ * Whether this provider is the device-first **session authority**. `true`
163
+ * (default) runs `runSessionColdBoot` on mount and opens the signed-out
164
+ * device-state socket — the correct behavior for every Relying Party app.
165
+ *
166
+ * `false` is the IdP host (`auth.oxy.so`) opt-out: the IdP is NOT a session
167
+ * authority (handoff "IdP vs RP"), so it must NOT restore or reproject an
168
+ * ambient device session. With `coldBoot={false}` the cold boot never runs
169
+ * and the signed-out device socket never opens; auth resolves immediately as
170
+ * signed out. Interactive sign-in still commits a normal session on this
171
+ * origin — only the automatic restore/reproject is suppressed.
172
+ * @default true
173
+ */
174
+ coldBoot?: boolean;
149
175
  onAuthStateChange?: (user: User | null) => void;
150
176
  onError?: (error: ApiError) => void;
151
177
  }
@@ -1 +1 @@
1
- {"version":3,"file":"OxyContext.d.ts","sourceRoot":"","sources":["../../../../../src/ui/context/OxyContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,WAAW,EAAa,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,EACV,IAAI,EACJ,QAAQ,EACR,oBAAoB,EACpB,WAAW,EACX,kBAAkB,EAClB,aAAa,EAGd,MAAM,aAAa,CAAC;AAUrB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA0B,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAgC,CAAC;AAKvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAsB,CAAC;AAgBtD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,eAAe,EAAE,OAAO,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,mBAAmB,EAAE,OAAO,CAAC;IAC7B;;;;;;;;;OASG;IACH,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,uBAAuB,EAAE,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC,UAAU,CAAC,CAAC;IAC9E,mBAAmB,EAAE,MAAM,CAAC;IAC5B,yBAAyB,EAAE,MAAM,CAAC;IAGlC,WAAW,EAAE,MAAM,OAAO,CA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Q,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;IAChD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;CACrC;AA4FD,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CA49BzD,CAAC;AAEF,eAAO,MAAM,kBAAkB,mCAAc,CAAC;AA8D9C,eAAO,MAAM,MAAM,QAAO,eAMzB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useAccountMutations.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/hooks/mutations/useAccountMutations.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,EACf,IAAI,EACJ,eAAe,EAChB,MAAM,aAAa,CAAC;AAerB;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;aA0PnB,CAAL;YACO,CAAC;;aACe,CAAC;YACX,CAAC;;;;;;;;;;;;;;;;;;;;;UAmB8C,CAAC;mBAC/C,CAAC;aAEN,CAAb;aAAmC,CAAC;;;UAEzB,CAAH;mBAIH,CAAF;aAAmC,CAAC;aAAmC,CAAC;;;;;;;;;EA3L3E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe;SAMQ,MAAM;WAAS,MAAM;WAAS,MAAM;WAAS,MAAM;;;EA4EtF,CAAC;AAEF;;;;;;;;;;GAUG;AACH,UAAU,8BAA8B;IACtC,yCAAyC;IACzC,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IAClC;;;;OAIG;IACH,WAAW,EAAE,IAAI,CAAC;CACnB;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,wBAAwB;sBAoFf,OAAO,CAAC,eAAe,CAAC,KAAG,IAAI;2BAQ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C;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC,CAAC;CACxI;AAED,4EAA4E;AAC5E,UAAU,YAAY;IACpB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,KAAK,CAAC,EAAE,YAAY,EAAE,CAAC;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED;;;;GAIG;AACH,eAAO,MAAM,gCAAgC;;EAmD5C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;;EA+CpC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,uFAoBjC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa;UAWd,gBAAgB;iBACT,SAAS,GAAG,QAAQ,GAAG,UAAU;eACnC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;iBACrB,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI;WAS5C,CAAC"}
1
+ {"version":3,"file":"useAccountMutations.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/hooks/mutations/useAccountMutations.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,EACf,IAAI,EACJ,eAAe,EAChB,MAAM,aAAa,CAAC;AAerB;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;aA0PnB,CAAR;YACQ,CAAA;;aACe,CAAC;YACX,CAAC;;;;;;;;;;;;;;;;;;;;;UAmB8C,CAAC;mBAC/C,CAAC;aACY,CAAA;aACI,CAAC;;;UAEtB,CAAN;mBAIA,CAAL;aAAmC,CAAC;aAAmC,CAAC;;;;;;;;;EA3LxE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe;SAMQ,MAAM;WAAS,MAAM;WAAS,MAAM;WAAS,MAAM;;;EA4EtF,CAAC;AAEF;;;;;;;;;;GAUG;AACH,UAAU,8BAA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,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,QAAQ,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC,CAAC;CACxI;AAED,4EAA4E;AAC5E,UAAU,YAAY;IACpB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,KAAK,CAAC,EAAE,YAAY,EAAE,CAAC;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED;;;;GAIG;AACH,eAAO,MAAM,gCAAgC;;EAmD5C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;;EA+CpC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,uFAoBjC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa;UAWd,gBAAgB;iBACT,SAAS,GAAG,QAAQ,GAAG,UAAU;eACnC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;iBACrB,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI;WAS5C,CAAC"}
@@ -16,7 +16,7 @@ export declare const useSession: (sessionId: string | null, options?: {
16
16
  */
17
17
  export declare const useDeviceSessions: (options?: {
18
18
  enabled?: boolean;
19
- }) => import("@tanstack/react-query").UseQueryResult<NoInfer<any[]>, Error>;
19
+ }) => import("@tanstack/react-query").UseQueryResult<NoInfer<import("@oxyhq/core").DeviceLinkedSession[]>, Error>;
20
20
  /**
21
21
  * Get user devices
22
22
  */
@@ -1 +1 @@
1
- {"version":3,"file":"useServicesQueries.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/hooks/queries/useServicesQueries.ts"],"names":[],"mappings":"AA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AAO,CAAC;IAExB,oCAAoC;IACpC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,WAAW;IAC1B;;;;;;OAMG;IACH,MAAM,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9C;;OAEG;IACH,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7B;;OAEG;IACH,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhC;;OAEG;IACH,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAED,MAAM,WAAW,aAAc,SAAQ,SAAS,EAAE,WAAW;IAC3D,6DAA6D;IAC7D,WAAW,EAAE,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC,aAAa,CAAC,CAAC;IACtD,0EAA0E;IAC1E,eAAe,EAAE,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC;IAC9D,0CAA0C;IAC1C,gBAAgB,EAAE,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC,kBAAkB,CAAC,CAAC;CACjE;AAED;;;;;;;;GAQG;AACH,wBAAgB,OAAO,IAAI,aAAa,CAmFvC"}
@@ -1,162 +1,23 @@
1
- import type { User, AccountNode, AccountRelationship, AccountKind, AccountMember } from '@oxyhq/core';
2
- /**
3
- * The per-account user shape carried by a {@link SwitchableAccount}. The SDK's
4
- * canonical {@link User} document — either the freshest `useOxy().user` (the
5
- * active row), a profile resolved via `oxyServices.getUsersByIds()` (every other
6
- * device row), or the `account` document embedded in an account-graph node.
7
- */
8
- export type SwitchableAccountUser = User;
9
- /**
10
- * One account the signed-in user can switch INTO, in the uniform switch model.
11
- *
12
- * A switchable account is either a device sign-in, an account-graph node (owned
13
- * org / shared-with-you), or BOTH (an account that has been switched into
14
- * becomes a device session while still being a graph node — the two are deduped
15
- * into a single row). Every row carries a canonical `accountId` (the uniform
16
- * switch key passed to `switchToAccount`); `sessionId` is present IFF the
17
- * account is currently signed in on THIS device.
18
- */
19
- export interface SwitchableAccount {
20
- /**
21
- * Canonical account id (the underlying `User._id`). The single key EVERY
22
- * switch uses — `switchToAccount(accountId)`. Always present.
23
- */
24
- accountId: string;
25
- /**
26
- * Device session id, present IFF this account is signed in on THIS device.
27
- * Absent for a graph account not yet switched into. Used only for
28
- * device-scoped actions (per-account sign-out via `removeSession`); switching
29
- * ALWAYS goes through `switchToAccount(accountId)`.
30
- */
31
- sessionId?: string;
32
- /**
33
- * Device-local refresh-cookie slot index (0..N-1), when the underlying
34
- * `ClientSession` carries one (web silent-switch). Absent on native and for
35
- * graph-only rows.
36
- */
37
- authuser?: number;
38
- /** Whether this account is the currently-active one. */
39
- isCurrent: boolean;
40
- /** Whether this account is signed in on THIS device (has a `sessionId`). */
41
- onDevice: boolean;
42
- /**
43
- * The caller's relationship to this account when it appears in the account
44
- * graph: `self` (the caller's own personal account), `owner` (an org/project/
45
- * bot the caller owns), or `member` (shared with the caller). Absent for an
46
- * independent device sign-in that is NOT in the active account's graph.
47
- */
48
- relationship?: AccountRelationship;
49
- /** Account classification (personal/organization/…). Cosmetic badge only. */
50
- kind?: AccountKind;
51
- /** Parent account id for 2-level tree grouping, or `null` for a root. */
52
- parentAccountId?: string | null;
53
- /**
54
- * The caller's effective membership (role + permissions) in this account when
55
- * it appears in the graph, or `null`/absent otherwise. Use `permissions` to
56
- * gate per-account settings UI.
57
- */
58
- callerMembership?: AccountMember | null;
59
- /** Friendly display name (never blank — falls back to a handle/sentinel). */
60
- displayName: string;
61
- /**
62
- * Real account email, or `null` when the account genuinely has none. NEVER a
63
- * synthesized `username@oxy.so` — a missing email falls back to the `@handle`
64
- * secondary line.
65
- */
66
- email: string | null;
67
- /** Resolved avatar thumbnail URL, or `undefined` when the account has no avatar. */
68
- avatarUrl?: string;
69
- /** Account's preferred Bloom color preset, or `null` when unset. */
70
- color: string | null;
71
- /** The underlying per-account user payload. */
72
- user: SwitchableAccountUser;
73
- }
1
+ import type { SwitchableAccount } from '@oxyhq/core';
74
2
  export interface UseSwitchableAccountsResult {
75
3
  /** Every switchable account (device sign-ins + linked graph accounts). */
76
4
  accounts: SwitchableAccount[];
77
- /** True until the per-device-account profile fetch settles. */
5
+ /** True until the initial account-list fetch settles with no data yet. */
78
6
  isLoading: boolean;
79
- /** The currently-active session id (mirrors `useOxy().activeSessionId`). */
7
+ /** The currently-active account's device session id, or `null`. */
80
8
  currentSessionId: string | null;
81
9
  }
82
- /** The minimal device-session shape {@link buildSwitchableAccounts} reads. */
83
- export interface SwitchableSessionInput {
84
- sessionId: string;
85
- userId?: string;
86
- authuser?: number;
87
- }
88
- export interface BuildSwitchableAccountsInput {
89
- /** Device sessions projected from the server-authoritative `SessionClient`. */
90
- sessions: SwitchableSessionInput[];
91
- /** The currently-active session id. */
92
- activeSessionId: string | null;
93
- /** The freshest copy of the active account's user (`useOxy().user`). */
94
- liveUser: User | null;
95
- isAuthenticated: boolean;
96
- /** The account graph under the active account (`useOxy().accounts`). */
97
- graph: AccountNode[];
98
- /** Per-device-account profiles resolved via `getUsersByIds()`, keyed by id. */
99
- profilesById: Map<string, User>;
100
- locale: string;
101
- /** Resolves a file id to a thumbnail URL (bound to `getFileDownloadUrl`). */
102
- resolveAvatarUrl: (avatar: string | null | undefined) => string | undefined;
103
- }
104
10
  /**
105
- * Resolve which entries are the current account, robustly.
106
- *
107
- * Primary signal: `entry.sessionId === activeSessionId` both are projected
108
- * from the same `SessionClient` state, so this normally matches exactly.
109
- * Fallbacks exist only to bridge the brief window between the two sequential
110
- * `updateSessions` / `setActiveSessionId` calls in `OxyContext.syncFromClient`,
111
- * applied only when the `sessionId` match found nothing AND the user is
112
- * authenticated:
113
- * 1. Match the live `user.id` against each entry's per-account user id.
114
- * 2. If still nothing and there is exactly one account, mark that one current.
115
- *
116
- * At most ONE entry is ever marked current. Runs over DEVICE rows only (graph
117
- * rows are never active — the active account is always a device session), so the
118
- * single-account fallback counts device rows.
119
- *
120
- * Pure & side-effect free so it is unit-testable without rendering React.
121
- */
122
- export declare function markCurrentAccount(accounts: SwitchableAccount[], activeSessionId: string | null | undefined, liveUserId: string | null | undefined, isAuthenticated: boolean): SwitchableAccount[];
123
- /**
124
- * Pure union of device sign-ins and account-graph nodes into the flat
125
- * {@link SwitchableAccount}[] the switchers render. Extracted so the merge /
126
- * dedup semantics are unit-testable without rendering React.
127
- *
128
- * Order: device rows first (in session order, current flagged), then graph-only
129
- * rows (in graph order). An account present as BOTH a device session and a graph
130
- * node is deduped into ONE device row enriched with the graph metadata
131
- * (relationship / kind / parent / membership).
132
- */
133
- export declare function buildSwitchableAccounts(input: BuildSwitchableAccountsInput): SwitchableAccount[];
134
- /**
135
- * Resolve every account the signed-in user can switch into — device sign-ins
136
- * AND linked graph accounts (owned orgs + shared-with-you) — as one flat list
137
- * with real per-account name / email / avatar / color, deduped by account id.
138
- *
139
- * ## Data sources
140
- *
141
- * - Device sign-ins: `useOxy().sessions` — a `ClientSession[]` projected by
142
- * `OxyContext.syncFromClient` from the server-authoritative `SessionClient`.
143
- * Each session carries only `sessionId` + `userId`, so this hook additionally
144
- * fetches every device account's profile via `oxyServices.getUsersByIds()`.
145
- * The ACTIVE row always uses `useOxy().user` directly (the freshest copy).
146
- * - Linked accounts: `useOxy().accounts` — the `AccountNode[]` graph the context
147
- * loads from `GET /accounts`. Each node already embeds its `account` `User`
148
- * document, so graph-only rows need no extra fetch.
149
- *
150
- * An account present as BOTH a device session and a graph node is deduped into
151
- * ONE row (see {@link buildSwitchableAccounts}). EVERY row switches the same
152
- * way — through `useOxy().switchToAccount(row.accountId)`.
153
- *
154
- * ## Error handling
155
- *
156
- * `getUsersByIds()` resolves to `[]` on a failed chunk (logged internally)
157
- * rather than throwing. Device accounts whose profile could not be resolved are
158
- * omitted until a subsequent fetch succeeds (except the active one, which never
159
- * depends on this fetch); graph accounts are unaffected.
11
+ * Every account the signed-in user can switch into — device sign-ins AND linked
12
+ * graph accounts (owned orgs + shared-with-you) — as one flat, deduped list with
13
+ * real per-account name / email / avatar / color.
14
+ *
15
+ * This is a thin binding over the shared `AccountDialogController` in
16
+ * `@oxyhq/core` (the SAME headless source the {@link OxyAccountDialog} renders),
17
+ * so there is ONE projection (`projectSwitchableAccounts`) and one switch path
18
+ * (`controller.switchTo`) across the whole SDK — the local duplicate projection
19
+ * this hook used to own has been removed. Every switch routes through
20
+ * `useOxy().switchToAccount(accountId)` (or the dialog's row press).
160
21
  */
161
22
  export declare function useSwitchableAccounts(): UseSwitchableAccountsResult;
162
23
  //# sourceMappingURL=useSwitchableAccounts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSwitchableAccounts.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useSwitchableAccounts.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACR,IAAI,EACJ,WAAW,EACX,mBAAmB,EACnB,WAAW,EACX,aAAa,EAChB,MAAM,aAAa,CAAC;AAKrB;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAEzC;;;;;;;;;GASG;AACH,MAAM,WAAW,iBAAiB;IAC9B;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,SAAS,EAAE,OAAO,CAAC;IACnB,4EAA4E;IAC5E,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,mBAAmB,CAAC;IACnC,6EAA6E;IAC7E,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,yEAAyE;IACzE,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IACxC,6EAA6E;IAC7E,WAAW,EAAE,MAAM,C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,GAAG,IAAI,GAAG,SAAS,EACrC,eAAe,EAAE,OAAO,GACzB,iBAAiB,EAAE,CAiCrB;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,4BAA4B,GAAG,iBAAiB,EAAE,CAoHhG;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,qBAAqB,IAAI,2BAA2B,CA2DnE"}
1
+ {"version":3,"file":"useSwitchableAccounts.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useSwitchableAccounts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAyB,MAAM,aAAa,CAAC;AAG5E,MAAM,WAAW,2BAA2B;IACxC,0EAA0E;IAC1E,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,0EAA0E;IAC1E,SAAS,EAAE,OAAO,CAAC;IACnB,mEAAmE;IACnE,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAgBD;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,IAAI,2BAA2B,CAuBnE"}
@@ -16,16 +16,14 @@ export { default as OxySignInButton } from './components/OxySignInButton.js';
16
16
  export { default as OxyAuthPrompt } from './components/OxyAuthPrompt.js';
17
17
  export type { OxyAuthPromptProps } from './components/OxyAuthPrompt.js';
18
18
  export { default as OxyLogo } from './components/OxyLogo.js';
19
+ export { RequireOxyAuth } from './components/RequireOxyAuth.js';
20
+ export type { RequireOxyAuthProps, RequireOxyAuthPrompt } from './components/RequireOxyAuth.js';
19
21
  export { default as Avatar } from './components/Avatar.js';
20
22
  export { default as FollowButton } from './components/FollowButton.js';
21
23
  export { default as OxyPayButton } from './components/OxyPayButton.js';
22
24
  export { FontLoader, setupFonts } from './components/FontLoader.js';
23
25
  export { default as OxyIcon } from './components/icon/OxyIcon.js';
24
- export { default as AccountMenu } from './components/AccountMenu.js';
25
- export { default as AccountMenuButton } from './components/AccountMenuButton.js';
26
26
  export { default as ProfileButton } from './components/ProfileButton.js';
27
- export { default as ProfileMenu } from './components/ProfileMenu.js';
28
- export { default as AccountSwitcher, AccountSwitcherView } from './components/AccountSwitcher.js';
29
27
  export { useOxy } from './context/OxyContext.js';
30
28
  export { useAuth } from './hooks/useAuth.js';
31
29
  export { useFollow } from './hooks/useFollow.js';
@@ -33,7 +31,6 @@ export { useStorage } from './hooks/useStorage.js';
33
31
  export type { UseStorageOptions, UseStorageResult } from './hooks/useStorage.js';
34
32
  export { default as ProfileScreen } from './screens/ProfileScreen.js';
35
33
  export { default as ManageAccountScreen } from './screens/ManageAccountScreen.js';
36
- export { default as AccountSwitcherScreen } from './screens/AccountSwitcherScreen.js';
37
34
  export { default as CreateAccountScreen } from './screens/CreateAccountScreen.js';
38
35
  export { default as AccountMembersScreen } from './screens/AccountMembersScreen.js';
39
36
  export { default as AccountSettingsScreen } from './screens/AccountSettingsScreen.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,6BAA0B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,iCAA8B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,+BAA4B,CAAC;AACtE,YAAY,EAAE,kBAAkB,EAAE,MAAM,+BAA4B,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,yBAAsB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,wBAAqB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,8BAA2B,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,8BAA2B,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,4BAAyB,CAAC;AACj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AM,uBAAoB,CAAC;AAG9E,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,4BAAyB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,kCAA+B,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,kCAA+B,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,mCAAgC,CAAC;AACjF,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,oCAAiC,CAAC;AAGnF,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAAuB,CAAC;AAGxD,OAAO,EACH,eAAe,EACf,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,GACtB,MAAM,0BAAuB,CAAC;AAC/B,YAAY,EAAE,sBAAsB,EAAE,MAAM,0BAAuB,CAAC"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Imperative bridge for the unified {@link OxyAccountDialog}.
3
+ *
4
+ * Mirrors `bottomSheetManager` — a tiny module-level indirection so any caller
5
+ * (even outside React, e.g. an app's imperative "sign in" handler) can open the
6
+ * single account dialog without a ref. `OxyContext` registers the live open/close
7
+ * controls on mount via {@link registerAccountDialogControls} and reports the
8
+ * dialog's visibility here via {@link notifyAccountDialogVisibility}; the exported
9
+ * `openAccountDialog` / `closeAccountDialog` drive those controls.
10
+ *
11
+ * `showSignInModal` / `hideSignInModal` / `subscribeToSignInModal` are the stable
12
+ * public surface the previous `SignInModal` module owned — kept so existing
13
+ * consumers (inbox, accounts) keep working while the sign-in surface is now the
14
+ * unified dialog opened on its `signin` view.
15
+ */
16
+ import type { AccountDialogView } from '@oxyhq/core';
17
+ /** Live open/close handles registered by the mounted provider. */
18
+ export interface AccountDialogControls {
19
+ open: (view?: AccountDialogView) => void;
20
+ close: () => void;
21
+ }
22
+ /**
23
+ * Register the provider's live open/close controls. Returns an unregister
24
+ * function that only clears the slot if it still owns it (guards against a late
25
+ * unmount clobbering a newer provider).
26
+ */
27
+ export declare function registerAccountDialogControls(next: AccountDialogControls): () => void;
28
+ /** Open the account dialog on `view` (default `accounts`). No-op before mount. */
29
+ export declare function openAccountDialog(view?: AccountDialogView): void;
30
+ /** Close the account dialog. No-op before mount. */
31
+ export declare function closeAccountDialog(): void;
32
+ /**
33
+ * Report the dialog's current visibility so subscribers (e.g. `OxySignInButton`)
34
+ * can reflect an in-flight "Signing in…" state. Called by the provider whenever
35
+ * the open flag changes, so listeners stay accurate regardless of what triggered
36
+ * the change (imperative open, backdrop dismiss, completed sign-in).
37
+ */
38
+ export declare function notifyAccountDialogVisibility(visible: boolean): void;
39
+ /**
40
+ * Subscribe to dialog visibility changes. Returns an unsubscribe function.
41
+ * Retains the name the old `SignInModal` exposed so `OxySignInButton` keeps its
42
+ * "Signing in…" affordance.
43
+ */
44
+ export declare function subscribeToSignInModal(listener: (visible: boolean) => void): () => void;
45
+ /** Open the unified dialog on its sign-in view. Public back-compat entry point. */
46
+ export declare function showSignInModal(): void;
47
+ /** Close the unified dialog. Public back-compat entry point. */
48
+ export declare function hideSignInModal(): void;
49
+ //# sourceMappingURL=accountDialogManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accountDialogManager.d.ts","sourceRoot":"","sources":["../../../../../src/ui/navigation/accountDialogManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,kEAAkE;AAClE,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACzC,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAKD;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,qBAAqB,GAAG,MAAM,IAAI,CAOrF;AAED,kFAAkF;AAClF,wBAAgB,iBAAiB,CAAC,IAAI,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAEhE;AAED,oDAAoD;AACpD,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAIpE;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAAG,MAAM,IAAI,CAKvF;AAED,mFAAmF;AACnF,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED,gEAAgE;AAChE,wBAAgB,eAAe,IAAI,IAAI,CAEtC"}
@@ -1,6 +1,6 @@
1
1
  import type { ComponentType, ReactNode } from 'react';
2
2
  import type { BaseScreenProps } from '../types/navigation.js';
3
- export type RouteName = 'OxyAuth' | 'ManageAccount' | 'AccountVerification' | 'PaymentGateway' | 'Profile' | 'LanguageSelector' | 'PrivacySettings' | 'SearchSettings' | 'FileManagement' | 'HelpSupport' | 'FAQ' | 'Feedback' | 'LegalDocuments' | 'AppInfo' | 'PremiumSubscription' | 'WelcomeNewUser' | 'UserLinks' | 'HistoryView' | 'SavesCollections' | 'EditProfile' | 'EditProfileField' | 'LearnMoreUsernames' | 'TrustCenter' | 'TrustLeaderboard' | 'TrustRewards' | 'TrustRules' | 'AboutTrust' | 'TrustFAQ' | 'FollowersList' | 'FollowingList' | 'AccountSwitcher' | 'CreateAccount' | 'AccountMembers' | 'AccountSettings' | 'AvatarCrop' | 'Notifications' | 'ConnectedApps' | 'Preferences';
3
+ export type RouteName = 'ManageAccount' | 'AccountVerification' | 'PaymentGateway' | 'Profile' | 'LanguageSelector' | 'PrivacySettings' | 'SearchSettings' | 'FileManagement' | 'HelpSupport' | 'FAQ' | 'Feedback' | 'LegalDocuments' | 'AppInfo' | 'PremiumSubscription' | 'WelcomeNewUser' | 'UserLinks' | 'HistoryView' | 'SavesCollections' | 'EditProfile' | 'EditProfileField' | 'LearnMoreUsernames' | 'TrustCenter' | 'TrustLeaderboard' | 'TrustRewards' | 'TrustRules' | 'AboutTrust' | 'TrustFAQ' | 'FollowersList' | 'FollowingList' | 'CreateAccount' | 'AccountMembers' | 'AccountSettings' | 'AvatarCrop' | 'Notifications' | 'ConnectedApps' | 'Preferences';
4
4
  export declare const getScreenComponent: (routeName: RouteName) => ComponentType<BaseScreenProps> | undefined;
5
5
  export declare const isValidRoute: (routeName: string) => routeName is RouteName;
6
6
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../../../src/ui/navigation/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAqB,CAAC;AAO3D,MAAM,MAAM,SAAS,GACf,SAAS,GACT,eAAe,GACf,qBAAqB,GACrB,gBAAgB,GAChB,SAAS,GACT,kBAAkB,GAClB,iBAAiB,GACjB,gBAAgB,GAChB,gBAAgB,GAChB,aAAa,GACb,KAAK,GACL,UAAU,GACV,gBAAgB,GAChB,SAAS,GACT,qBAAqB,GACrB,gBAAgB,GAChB,WAAW,GACX,aAAa,GACb,kBAAkB,GAClB,aAAa,GACb,kBAAkB,GAClB,oBAAoB,GACpB,aAAa,GACb,kBAAkB,GAClB,cAAc,GACd,YAAY,GACZ,YAAY,GACZ,UAAU,GACV,eAAe,GACf,eAAe,GACf,iBAAiB,GACjB,eAAe,GACf,gBAAgB,GAChB,iBAAiB,GACjB,YAAY,GACZ,eAAe,GACf,eAAe,GACf,aAAa,CAAC;AAoDpB,eAAO,MAAM,kBAAkB,GAAI,WAAW,SAAS,KAAG,aAAa,CAAC,eAAe,CAAC,GAAG,SAsB1F,CAAC;AAIF,eAAO,MAAM,YAAY,GAAI,WAAW,MAAM,KAAG,SAAS,IAAI,SAE7D,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC7B;;;;;OAKG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB;;;;;;;;;;OAUG;IACH,gBAAgB,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,eAAe,EAAE,OAAO,CAAC;IACzB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,SAAS,CAAC;CACrC;AA+BD;;;;GAIG;AACH,eAAO,MAAM,cAAc,GACvB,WAAW,SAAS,GAAG,IAAI,EAC3B,aAAa,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KACrC,gBASF,CAAC"}
1
+ {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../../../src/ui/navigation/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAqB,CAAC;AAO3D,MAAM,MAAM,SAAS,GACf,eAAe,GACf,qBAAqB,GACrB,gBAAgB,GAChB,SAAS,GACT,kBAAkB,GAClB,iBAAiB,GACjB,gBAAgB,GAChB,gBAAgB,GAChB,aAAa,GACb,KAAK,GACL,UAAU,GACV,gBAAgB,GAChB,SAAS,GACT,qBAAqB,GACrB,gBAAgB,GAChB,WAAW,GACX,aAAa,GACb,kBAAkB,GAClB,aAAa,GACb,kBAAkB,GAClB,oBAAoB,GACpB,aAAa,GACb,kBAAkB,GAClB,cAAc,GACd,YAAY,GACZ,YAAY,GACZ,UAAU,GACV,eAAe,GACf,eAAe,GACf,eAAe,GACf,gBAAgB,GAChB,iBAAiB,GACjB,YAAY,GACZ,eAAe,GACf,eAAe,GACf,aAAa,CAAC;AAkDpB,eAAO,MAAM,kBAAkB,GAAI,WAAW,SAAS,KAAG,aAAa,CAAC,eAAe,CAAC,GAAG,SAsB1F,CAAC;AAIF,eAAO,MAAM,YAAY,GAAI,WAAW,MAAM,KAAG,SAAS,IAAI,SAE7D,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC7B;;;;;OAKG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB;;;;;;;;;;OAUG;IACH,gBAAgB,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,eAAe,EAAE,OAAO,CAAC;IACzB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,SAAS,CAAC;CACrC;AA+BD;;;;GAIG;AACH,eAAO,MAAM,cAAc,GACvB,WAAW,SAAS,GAAG,IAAI,EAC3B,aAAa,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KACrC,gBASF,CAAC"}
@@ -6,7 +6,7 @@ import type { BaseScreenProps } from '../types/navigation.js';
6
6
  * Replaces AccountOverview + AccountSettings + the per-account half of
7
7
  * SessionManagement. Lists ONLY the active user's profile, sessions on this
8
8
  * device, and security/destructive actions for THIS account. Multi-account
9
- * surface lives in {@link AccountSwitcher} — keep these concerns separate.
9
+ * surface lives in the unified `OxyAccountDialog` — keep these concerns separate.
10
10
  */
11
11
  declare const ManageAccountScreen: React.FC<BaseScreenProps>;
12
12
  export default ManageAccountScreen;
@@ -1 +1 @@
1
- {"version":3,"file":"ManageAccountScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/ManageAccountScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAsB/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAqB,CAAC;AAoD3D;;;;;;;GAOG;AACH,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA25BlD,CAAC;AA+BF,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"ManageAccountScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/ManageAccountScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAsB/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAqB,CAAC;AAoD3D;;;;;;;GAOG;AACH,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA45BlD,CAAC;AA+BF,eAAe,mBAAmB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { SessionClient, createSessionClientHost, type AuthStateStore, type OxyServices } from '@oxyhq/core';
1
+ import { SessionClient, createSessionClientHost, type AuthStateStore, type OxyServices, type SessionClientOptions } from '@oxyhq/core';
2
2
  /**
3
3
  * Wire a `SessionClient` for `@oxyhq/services`.
4
4
  *
@@ -19,7 +19,14 @@ import { SessionClient, createSessionClientHost, type AuthStateStore, type OxySe
19
19
  * alongside the client so the caller can call `host.setCurrentAccountId(...)`
20
20
  * as the active account changes.
21
21
  */
22
- export declare function createSessionClient(oxyServices: OxyServices, store: AuthStateStore, onUnauthenticated?: () => void): {
22
+ export declare function createSessionClient(oxyServices: OxyServices, store: AuthStateStore, onUnauthenticated?: () => void,
23
+ /**
24
+ * Optional signed-out realtime wiring: `signedOutSocketAuth` (open the socket
25
+ * while signed out — web returns `true` to ride the `oxy_device` cookie,
26
+ * native returns the shared device token) and `onSessionAppeared` (self-acquire
27
+ * when a sibling signs in on this device).
28
+ */
29
+ extra?: Pick<SessionClientOptions, 'signedOutSocketAuth' | 'onSessionAppeared'>): {
23
30
  client: SessionClient;
24
31
  host: ReturnType<typeof createSessionClientHost>;
25
32
  };
@@ -1 +1 @@
1
- {"version":3,"file":"createSessionClient.d.ts","sourceRoot":"","sources":["../../../../../src/ui/session/createSessionClient.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,KAAK,cAAc,EACnB,KAAK,WAAW,EACjB,MAAM,aAAa,CAAC;AAGrB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,cAAc,EACrB,iBAAiB,CAAC,EAAE,MAAM,IAAI,GAC7B;IACD,MAAM,EAAE,aAAa,CAAC;IACtB,IAAI,EAAE,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC;CAClD,CAKA"}
1
+ {"version":3,"file":"createSessionClient.d.ts","sourceRoot":"","sources":["../../../../../src/ui/session/createSessionClient.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,oBAAoB,EAC1B,MAAM,aAAa,CAAC;AAGrB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,cAAc,EACrB,iBAAiB,CAAC,EAAE,MAAM,IAAI;AAC9B;;;;;GAKG;AACH,KAAK,CAAC,EAAE,IAAI,CAAC,oBAAoB,EAAE,qBAAqB,GAAG,mBAAmB,CAAC,GAC9E;IACD,MAAM,EAAE,aAAa,CAAC;IACtB,IAAI,EAAE,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC;CAClD,CAKA"}
@@ -42,5 +42,32 @@ export interface OxyProviderProps {
42
42
  authWebUrl?: string;
43
43
  authRedirectUri?: string;
44
44
  queryClient?: QueryClient;
45
+ /**
46
+ * Convenience: wrap the whole app subtree in `<RequireOxyAuth prompt=...>`.
47
+ * `off` (default) renders children unconditionally; `soft` adds a dismissible
48
+ * sign-in banner while signed out; `hard` blocks the app behind the signed-out
49
+ * wall until the user signs in. For finer control, mount `RequireOxyAuth`
50
+ * yourself around a specific subtree instead.
51
+ * @default 'off'
52
+ */
53
+ requireAuth?: 'off' | 'soft' | 'hard';
54
+ /**
55
+ * Whether this provider acts as the ecosystem's device-first **session
56
+ * authority**. `true` (default) runs the full device-first cold boot on
57
+ * mount (bootstrap-return → stored tokens → shared key / bootstrap hop) and
58
+ * opens the signed-out device-state socket so an idle tab self-acquires when
59
+ * a sibling signs in — the correct behavior for every Relying Party app.
60
+ *
61
+ * Set `false` for the **IdP host** (`auth.oxy.so`): the IdP is NOT a session
62
+ * authority (see the handoff "IdP vs RP" section). With `coldBoot={false}`
63
+ * the provider skips `runSessionColdBoot` entirely and never opens the
64
+ * signed-out device socket — auth resolves immediately as signed out (no
65
+ * boot spinner). Interactive sign-in is unaffected: a user who signs in
66
+ * through this provider (password, 2FA, or the "Sign in with Oxy" QR device
67
+ * flow) still commits a normal session scoped to this origin, which is all
68
+ * the IdP needs to drive its OAuth authorize/consent flow.
69
+ * @default true
70
+ */
71
+ coldBoot?: boolean;
45
72
  }
46
73
  //# sourceMappingURL=navigation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../../../src/ui/types/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAsB,CAAC;AAItD,MAAM,WAAW,cAAc;IAC3B,SAAS,EAAE,MAAM,OAAO,CAAC;IACzB,MAAM,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAE5B,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACxE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,eAAe,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAG9C,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IAGlC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IACrD,YAAY,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,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eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;IACtC;;;;;;;;;;;;;;;;OAgBG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxyhq/services",
3
- "version": "16.0.0",
3
+ "version": "18.0.0",
4
4
  "description": "OxyHQ Expo/React Native SDK — UI components, screens, and native features",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -106,10 +106,10 @@
106
106
  }
107
107
  },
108
108
  "dependencies": {
109
- "@oxyhq/contracts": "0.10.0"
109
+ "@oxyhq/contracts": "0.11.0"
110
110
  },
111
111
  "devDependencies": {
112
- "@oxyhq/core": "^7.0.0",
112
+ "@oxyhq/core": "8.0.0",
113
113
  "nativewind": "5.0.0-preview.3",
114
114
  "react-native-css": "^3.0.0",
115
115
  "@react-native-async-storage/async-storage": "^2.0.0",
@@ -153,7 +153,7 @@
153
153
  "peerDependencies": {
154
154
  "@expo/vector-icons": "^15.0.3",
155
155
  "@oxyhq/bloom": ">=0.16.0",
156
- "@oxyhq/core": "^7.0.0",
156
+ "@oxyhq/core": "^8.0.0",
157
157
  "@react-native-async-storage/async-storage": "^2.0.0",
158
158
  "@react-native-community/netinfo": "^11.4.1",
159
159
  "@tanstack/query-async-storage-persister": "^5.101",