@oxyhq/services 15.0.0 → 17.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 (280) hide show
  1. package/lib/commonjs/index.js +25 -55
  2. package/lib/commonjs/index.js.map +1 -1
  3. package/lib/commonjs/ui/client.js +0 -14
  4. package/lib/commonjs/ui/client.js.map +1 -1
  5. package/lib/commonjs/ui/components/OxyAccountDialog.js +764 -0
  6. package/lib/commonjs/ui/components/OxyAccountDialog.js.map +1 -0
  7. package/lib/commonjs/ui/components/OxyProvider.js +11 -6
  8. package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
  9. package/lib/commonjs/ui/components/OxySignInButton.js +10 -21
  10. package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
  11. package/lib/commonjs/ui/components/ProfileButton.js +25 -112
  12. package/lib/commonjs/ui/components/ProfileButton.js.map +1 -1
  13. package/lib/commonjs/ui/components/RequireOxyAuth.js +299 -0
  14. package/lib/commonjs/ui/components/RequireOxyAuth.js.map +1 -0
  15. package/lib/commonjs/ui/context/OxyContext.js +106 -2
  16. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  17. package/lib/commonjs/ui/hooks/mutations/mutationKeys.js +1 -1
  18. package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js +10 -10
  19. package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js.map +1 -1
  20. package/lib/commonjs/ui/hooks/queries/queryKeys.js +1 -1
  21. package/lib/commonjs/ui/hooks/queries/useAccountQueries.js +7 -8
  22. package/lib/commonjs/ui/hooks/queries/useAccountQueries.js.map +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/ConnectedAppsScreen.js +17 -18
  34. package/lib/commonjs/ui/screens/ConnectedAppsScreen.js.map +1 -1
  35. package/lib/commonjs/ui/screens/ManageAccountScreen.js +4 -3
  36. package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
  37. package/lib/commonjs/ui/session/createSessionClient.js +10 -2
  38. package/lib/commonjs/ui/session/createSessionClient.js.map +1 -1
  39. package/lib/module/index.js +20 -17
  40. package/lib/module/index.js.map +1 -1
  41. package/lib/module/ui/client.js +1 -2
  42. package/lib/module/ui/client.js.map +1 -1
  43. package/lib/module/ui/components/OxyAccountDialog.js +761 -0
  44. package/lib/module/ui/components/OxyAccountDialog.js.map +1 -0
  45. package/lib/module/ui/components/OxyProvider.js +11 -6
  46. package/lib/module/ui/components/OxyProvider.js.map +1 -1
  47. package/lib/module/ui/components/OxySignInButton.js +10 -21
  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/context/OxyContext.js +107 -3
  54. package/lib/module/ui/context/OxyContext.js.map +1 -1
  55. package/lib/module/ui/hooks/mutations/mutationKeys.js +1 -1
  56. package/lib/module/ui/hooks/mutations/useAccountMutations.js +8 -8
  57. package/lib/module/ui/hooks/mutations/useAccountMutations.js.map +1 -1
  58. package/lib/module/ui/hooks/queries/queryKeys.js +1 -1
  59. package/lib/module/ui/hooks/queries/useAccountQueries.js +5 -6
  60. package/lib/module/ui/hooks/queries/useAccountQueries.js.map +1 -1
  61. package/lib/module/ui/hooks/useAuth.js +19 -30
  62. package/lib/module/ui/hooks/useAuth.js.map +1 -1
  63. package/lib/module/ui/hooks/useSwitchableAccounts.js +38 -267
  64. package/lib/module/ui/hooks/useSwitchableAccounts.js.map +1 -1
  65. package/lib/module/ui/index.js +1 -5
  66. package/lib/module/ui/index.js.map +1 -1
  67. package/lib/module/ui/navigation/accountDialogManager.js +81 -0
  68. package/lib/module/ui/navigation/accountDialogManager.js.map +1 -0
  69. package/lib/module/ui/navigation/routes.js +0 -2
  70. package/lib/module/ui/navigation/routes.js.map +1 -1
  71. package/lib/module/ui/screens/ConnectedAppsScreen.js +19 -20
  72. package/lib/module/ui/screens/ConnectedAppsScreen.js.map +1 -1
  73. package/lib/module/ui/screens/ManageAccountScreen.js +4 -3
  74. package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
  75. package/lib/module/ui/session/createSessionClient.js +10 -2
  76. package/lib/module/ui/session/createSessionClient.js.map +1 -1
  77. package/lib/typescript/commonjs/index.d.ts +6 -13
  78. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  79. package/lib/typescript/commonjs/ui/client.d.ts +0 -4
  80. package/lib/typescript/commonjs/ui/client.d.ts.map +1 -1
  81. package/lib/typescript/commonjs/ui/components/OxyAccountDialog.d.ts +35 -0
  82. package/lib/typescript/commonjs/ui/components/OxyAccountDialog.d.ts.map +1 -0
  83. package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts +2 -2
  84. package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
  85. package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts.map +1 -1
  86. package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts +11 -23
  87. package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts.map +1 -1
  88. package/lib/typescript/commonjs/ui/components/RequireOxyAuth.d.ts +55 -0
  89. package/lib/typescript/commonjs/ui/components/RequireOxyAuth.d.ts.map +1 -0
  90. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts +13 -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 +4 -4
  93. package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  94. package/lib/typescript/commonjs/ui/hooks/queries/useAccountQueries.d.ts +6 -7
  95. package/lib/typescript/commonjs/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
  96. package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts.map +1 -1
  97. package/lib/typescript/commonjs/ui/hooks/useSwitchableAccounts.d.ts +13 -152
  98. package/lib/typescript/commonjs/ui/hooks/useSwitchableAccounts.d.ts.map +1 -1
  99. package/lib/typescript/commonjs/ui/index.d.ts +2 -5
  100. package/lib/typescript/commonjs/ui/index.d.ts.map +1 -1
  101. package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts +49 -0
  102. package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts.map +1 -0
  103. package/lib/typescript/commonjs/ui/navigation/routes.d.ts +1 -1
  104. package/lib/typescript/commonjs/ui/navigation/routes.d.ts.map +1 -1
  105. package/lib/typescript/commonjs/ui/screens/ConnectedAppsScreen.d.ts.map +1 -1
  106. package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts +1 -1
  107. package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -1
  108. package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts +9 -2
  109. package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts.map +1 -1
  110. package/lib/typescript/commonjs/ui/types/navigation.d.ts +9 -0
  111. package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
  112. package/lib/typescript/commonjs/ui/utils/storageHelpers.d.ts +7 -7
  113. package/lib/typescript/module/index.d.ts +6 -13
  114. package/lib/typescript/module/index.d.ts.map +1 -1
  115. package/lib/typescript/module/ui/client.d.ts +0 -4
  116. package/lib/typescript/module/ui/client.d.ts.map +1 -1
  117. package/lib/typescript/module/ui/components/OxyAccountDialog.d.ts +35 -0
  118. package/lib/typescript/module/ui/components/OxyAccountDialog.d.ts.map +1 -0
  119. package/lib/typescript/module/ui/components/OxyProvider.d.ts +2 -2
  120. package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
  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/context/OxyContext.d.ts +13 -1
  127. package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
  128. package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts +4 -4
  129. package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  130. package/lib/typescript/module/ui/hooks/queries/useAccountQueries.d.ts +6 -7
  131. package/lib/typescript/module/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
  132. package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
  133. package/lib/typescript/module/ui/hooks/useSwitchableAccounts.d.ts +13 -152
  134. package/lib/typescript/module/ui/hooks/useSwitchableAccounts.d.ts.map +1 -1
  135. package/lib/typescript/module/ui/index.d.ts +2 -5
  136. package/lib/typescript/module/ui/index.d.ts.map +1 -1
  137. package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts +49 -0
  138. package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts.map +1 -0
  139. package/lib/typescript/module/ui/navigation/routes.d.ts +1 -1
  140. package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
  141. package/lib/typescript/module/ui/screens/ConnectedAppsScreen.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 +9 -0
  147. package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
  148. package/lib/typescript/module/ui/utils/storageHelpers.d.ts +7 -7
  149. package/package.json +4 -4
  150. package/src/index.ts +23 -28
  151. package/src/ui/client.ts +0 -4
  152. package/src/ui/components/OxyAccountDialog.tsx +760 -0
  153. package/src/ui/components/OxyProvider.tsx +12 -6
  154. package/src/ui/components/OxySignInButton.tsx +10 -21
  155. package/src/ui/components/ProfileButton.tsx +23 -126
  156. package/src/ui/components/RequireOxyAuth.tsx +266 -0
  157. package/src/ui/context/OxyContext.tsx +146 -7
  158. package/src/ui/hooks/mutations/mutationKeys.ts +1 -1
  159. package/src/ui/hooks/mutations/useAccountMutations.ts +8 -8
  160. package/src/ui/hooks/queries/queryKeys.ts +1 -1
  161. package/src/ui/hooks/queries/useAccountQueries.ts +8 -9
  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 +1 -5
  167. package/src/ui/screens/ConnectedAppsScreen.tsx +23 -24
  168. package/src/ui/screens/ManageAccountScreen.tsx +3 -2
  169. package/src/ui/session/createSessionClient.ts +9 -1
  170. package/src/ui/types/navigation.ts +9 -0
  171. package/src/ui/utils/storageHelpers.ts +7 -7
  172. package/lib/commonjs/ui/components/AccountMenu.js +0 -598
  173. package/lib/commonjs/ui/components/AccountMenu.js.map +0 -1
  174. package/lib/commonjs/ui/components/AccountMenuButton.js +0 -135
  175. package/lib/commonjs/ui/components/AccountMenuButton.js.map +0 -1
  176. package/lib/commonjs/ui/components/AccountSwitcher.js +0 -780
  177. package/lib/commonjs/ui/components/AccountSwitcher.js.map +0 -1
  178. package/lib/commonjs/ui/components/AnotherDeviceQR.js +0 -116
  179. package/lib/commonjs/ui/components/AnotherDeviceQR.js.map +0 -1
  180. package/lib/commonjs/ui/components/ProfileMenu.js +0 -518
  181. package/lib/commonjs/ui/components/ProfileMenu.js.map +0 -1
  182. package/lib/commonjs/ui/components/SignInAccountChooser.js +0 -189
  183. package/lib/commonjs/ui/components/SignInAccountChooser.js.map +0 -1
  184. package/lib/commonjs/ui/components/SignInModal.js +0 -600
  185. package/lib/commonjs/ui/components/SignInModal.js.map +0 -1
  186. package/lib/commonjs/ui/hooks/useOxyAuthSession.js +0 -501
  187. package/lib/commonjs/ui/hooks/useOxyAuthSession.js.map +0 -1
  188. package/lib/commonjs/ui/hooks/usePasswordSignIn.js +0 -170
  189. package/lib/commonjs/ui/hooks/usePasswordSignIn.js.map +0 -1
  190. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +0 -51
  191. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +0 -1
  192. package/lib/commonjs/ui/screens/OxyAuthScreen.js +0 -312
  193. package/lib/commonjs/ui/screens/OxyAuthScreen.js.map +0 -1
  194. package/lib/commonjs/utils/deviceFlowSignIn.js +0 -109
  195. package/lib/commonjs/utils/deviceFlowSignIn.js.map +0 -1
  196. package/lib/module/ui/components/AccountMenu.js +0 -593
  197. package/lib/module/ui/components/AccountMenu.js.map +0 -1
  198. package/lib/module/ui/components/AccountMenuButton.js +0 -130
  199. package/lib/module/ui/components/AccountMenuButton.js.map +0 -1
  200. package/lib/module/ui/components/AccountSwitcher.js +0 -774
  201. package/lib/module/ui/components/AccountSwitcher.js.map +0 -1
  202. package/lib/module/ui/components/AnotherDeviceQR.js +0 -110
  203. package/lib/module/ui/components/AnotherDeviceQR.js.map +0 -1
  204. package/lib/module/ui/components/ProfileMenu.js +0 -514
  205. package/lib/module/ui/components/ProfileMenu.js.map +0 -1
  206. package/lib/module/ui/components/SignInAccountChooser.js +0 -183
  207. package/lib/module/ui/components/SignInAccountChooser.js.map +0 -1
  208. package/lib/module/ui/components/SignInModal.js +0 -591
  209. package/lib/module/ui/components/SignInModal.js.map +0 -1
  210. package/lib/module/ui/hooks/useOxyAuthSession.js +0 -495
  211. package/lib/module/ui/hooks/useOxyAuthSession.js.map +0 -1
  212. package/lib/module/ui/hooks/usePasswordSignIn.js +0 -165
  213. package/lib/module/ui/hooks/usePasswordSignIn.js.map +0 -1
  214. package/lib/module/ui/screens/AccountSwitcherScreen.js +0 -48
  215. package/lib/module/ui/screens/AccountSwitcherScreen.js.map +0 -1
  216. package/lib/module/ui/screens/OxyAuthScreen.js +0 -306
  217. package/lib/module/ui/screens/OxyAuthScreen.js.map +0 -1
  218. package/lib/module/utils/deviceFlowSignIn.js +0 -106
  219. package/lib/module/utils/deviceFlowSignIn.js.map +0 -1
  220. package/lib/typescript/commonjs/ui/components/AccountMenu.d.ts +0 -47
  221. package/lib/typescript/commonjs/ui/components/AccountMenu.d.ts.map +0 -1
  222. package/lib/typescript/commonjs/ui/components/AccountMenuButton.d.ts +0 -26
  223. package/lib/typescript/commonjs/ui/components/AccountMenuButton.d.ts.map +0 -1
  224. package/lib/typescript/commonjs/ui/components/AccountSwitcher.d.ts +0 -46
  225. package/lib/typescript/commonjs/ui/components/AccountSwitcher.d.ts.map +0 -1
  226. package/lib/typescript/commonjs/ui/components/AnotherDeviceQR.d.ts +0 -34
  227. package/lib/typescript/commonjs/ui/components/AnotherDeviceQR.d.ts.map +0 -1
  228. package/lib/typescript/commonjs/ui/components/ProfileMenu.d.ts +0 -49
  229. package/lib/typescript/commonjs/ui/components/ProfileMenu.d.ts.map +0 -1
  230. package/lib/typescript/commonjs/ui/components/SignInAccountChooser.d.ts +0 -29
  231. package/lib/typescript/commonjs/ui/components/SignInAccountChooser.d.ts.map +0 -1
  232. package/lib/typescript/commonjs/ui/components/SignInModal.d.ts +0 -28
  233. package/lib/typescript/commonjs/ui/components/SignInModal.d.ts.map +0 -1
  234. package/lib/typescript/commonjs/ui/hooks/useOxyAuthSession.d.ts +0 -105
  235. package/lib/typescript/commonjs/ui/hooks/useOxyAuthSession.d.ts.map +0 -1
  236. package/lib/typescript/commonjs/ui/hooks/usePasswordSignIn.d.ts +0 -31
  237. package/lib/typescript/commonjs/ui/hooks/usePasswordSignIn.d.ts.map +0 -1
  238. package/lib/typescript/commonjs/ui/screens/AccountSwitcherScreen.d.ts +0 -11
  239. package/lib/typescript/commonjs/ui/screens/AccountSwitcherScreen.d.ts.map +0 -1
  240. package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts +0 -22
  241. package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts.map +0 -1
  242. package/lib/typescript/commonjs/utils/deviceFlowSignIn.d.ts +0 -97
  243. package/lib/typescript/commonjs/utils/deviceFlowSignIn.d.ts.map +0 -1
  244. package/lib/typescript/module/ui/components/AccountMenu.d.ts +0 -47
  245. package/lib/typescript/module/ui/components/AccountMenu.d.ts.map +0 -1
  246. package/lib/typescript/module/ui/components/AccountMenuButton.d.ts +0 -26
  247. package/lib/typescript/module/ui/components/AccountMenuButton.d.ts.map +0 -1
  248. package/lib/typescript/module/ui/components/AccountSwitcher.d.ts +0 -46
  249. package/lib/typescript/module/ui/components/AccountSwitcher.d.ts.map +0 -1
  250. package/lib/typescript/module/ui/components/AnotherDeviceQR.d.ts +0 -34
  251. package/lib/typescript/module/ui/components/AnotherDeviceQR.d.ts.map +0 -1
  252. package/lib/typescript/module/ui/components/ProfileMenu.d.ts +0 -49
  253. package/lib/typescript/module/ui/components/ProfileMenu.d.ts.map +0 -1
  254. package/lib/typescript/module/ui/components/SignInAccountChooser.d.ts +0 -29
  255. package/lib/typescript/module/ui/components/SignInAccountChooser.d.ts.map +0 -1
  256. package/lib/typescript/module/ui/components/SignInModal.d.ts +0 -28
  257. package/lib/typescript/module/ui/components/SignInModal.d.ts.map +0 -1
  258. package/lib/typescript/module/ui/hooks/useOxyAuthSession.d.ts +0 -105
  259. package/lib/typescript/module/ui/hooks/useOxyAuthSession.d.ts.map +0 -1
  260. package/lib/typescript/module/ui/hooks/usePasswordSignIn.d.ts +0 -31
  261. package/lib/typescript/module/ui/hooks/usePasswordSignIn.d.ts.map +0 -1
  262. package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts +0 -11
  263. package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts.map +0 -1
  264. package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts +0 -22
  265. package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts.map +0 -1
  266. package/lib/typescript/module/utils/deviceFlowSignIn.d.ts +0 -97
  267. package/lib/typescript/module/utils/deviceFlowSignIn.d.ts.map +0 -1
  268. package/src/ui/components/AccountMenu.tsx +0 -645
  269. package/src/ui/components/AccountMenuButton.tsx +0 -126
  270. package/src/ui/components/AccountSwitcher.tsx +0 -751
  271. package/src/ui/components/AnotherDeviceQR.tsx +0 -119
  272. package/src/ui/components/ProfileMenu.tsx +0 -564
  273. package/src/ui/components/SignInAccountChooser.tsx +0 -162
  274. package/src/ui/components/SignInModal.tsx +0 -530
  275. package/src/ui/hooks/useOxyAuthSession.ts +0 -635
  276. package/src/ui/hooks/usePasswordSignIn.ts +0 -207
  277. package/src/ui/screens/AccountSwitcherScreen.tsx +0 -43
  278. package/src/ui/screens/OxyAuthScreen.tsx +0 -324
  279. package/src/utils/__tests__/deviceFlowSignIn.test.ts +0 -231
  280. package/src/utils/deviceFlowSignIn.ts +0 -152
@@ -1,34 +0,0 @@
1
- /**
2
- * AnotherDeviceQR — the collapsed "Sign in on another device" disclosure shared
3
- * by both sign-in containers (`SignInModal` on web, `OxyAuthScreen` on native).
4
- *
5
- * The QR code is always DEMOTED below the platform-primary "Continue with Oxy"
6
- * action: you cannot scan your own screen, so the QR is only useful for handing
7
- * sign-in to a SECOND device (scan with the Oxy Accounts app there). It lives
8
- * inside a tap-to-expand disclosure so it never competes with the primary CTA.
9
- *
10
- * The QR plate stays white intentionally — high contrast is required for
11
- * reliable scanning regardless of the app theme. That single plate (and its
12
- * fixed dimensions) is the only StyleSheet/hardcoded-color in this component;
13
- * everything else is composed from Bloom typography + centralized token classes.
14
- */
15
- import type React from 'react';
16
- export interface AnotherDeviceQRProps {
17
- /** The legacy QR payload (`oxyauth://<token>`). Empty string renders nothing. */
18
- qrData: string;
19
- /**
20
- * The secure "Sign in with Oxy" handoff payload (`oxycommons://approve?...`).
21
- * Preferred over `qrData` when present — it carries the PUBLIC authorize code
22
- * (never the secret session token), so the Oxy identity app on another device
23
- * can scan it to approve. Falls back to `qrData` when the handoff backend has
24
- * not returned a payload.
25
- */
26
- qrPayload?: string | null;
27
- }
28
- /**
29
- * Collapsed disclosure that reveals a high-contrast QR for signing in on a
30
- * second device with the Oxy Accounts app.
31
- */
32
- declare const AnotherDeviceQR: React.FC<AnotherDeviceQRProps>;
33
- export default AnotherDeviceQR;
34
- //# sourceMappingURL=AnotherDeviceQR.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AnotherDeviceQR.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/AnotherDeviceQR.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,MAAM,WAAW,oBAAoB;IACnC,iFAAiF;IACjF,MAAM,EAAE,MAAM,CAAC;IACf;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AASD;;;GAGG;AACH,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA0DnD,CAAC;AAaF,eAAe,eAAe,CAAC"}
@@ -1,49 +0,0 @@
1
- import type React from 'react';
2
- /**
3
- * Web-only anchor. `ProfileButton` measures its trigger and anchors the panel to
4
- * one corner so the menu opens either UPWARD (footer trigger) or DOWNWARD (a
5
- * trigger at the top of a sidebar). Exactly ONE vertical edge is pinned:
6
- * - `bottom` set → the panel's BOTTOM edge is anchored, so it opens UPWARD.
7
- * - `top` set → the panel's TOP edge is anchored, so it opens DOWNWARD.
8
- * Native ignores the anchor and docks the panel to the bottom as a sheet.
9
- */
10
- export interface ProfileMenuAnchor {
11
- /** Distance from the viewport left, for the panel's LEFT edge. */
12
- left: number;
13
- /** Distance from the viewport bottom, for the panel's BOTTOM edge (opens upward). */
14
- bottom?: number;
15
- /** Distance from the viewport top, for the panel's TOP edge (opens downward). */
16
- top?: number;
17
- }
18
- export interface ProfileMenuProps {
19
- open: boolean;
20
- onClose: () => void;
21
- /** Web-only trigger anchor. Native ignores this (bottom-sheet style). */
22
- anchor?: ProfileMenuAnchor | null;
23
- /** Navigate to the "Manage account" surface (settings). */
24
- onNavigateManage: () => void;
25
- /** Start the add-account / sign-in flow for an additional account. */
26
- onAddAccount: () => void;
27
- /** Optional: navigate to the signed-in user's own profile. */
28
- onNavigateProfile?: () => void;
29
- /** Called before the active identity changes so apps can clear scoped state. */
30
- onBeforeSessionChange?: () => void | Promise<void>;
31
- }
32
- /**
33
- * Clean account switcher, written with react-native `StyleSheet` + Bloom
34
- * theme colors (the package convention — no NativeWind, which is only an
35
- * optional peer and absent in the primary `accounts` consumer). Lists EVERY
36
- * switchable account from {@link useSwitchableAccounts}
37
- * — device sign-ins AND linked graph accounts (owned orgs + shared-with-you) —
38
- * and routes EVERY switch through the context's single
39
- * `switchToAccount(accountId)` dispatcher (there is no separate device-only
40
- * path). Each on-device inactive row carries a per-account sign-out icon;
41
- * graph-only rows carry a role badge and indent under their parent. Below the
42
- * list: Add account, Manage account, optional View profile, and Sign out of all.
43
- *
44
- * Renders as an upward-opening popover anchored to the trigger on web, and a
45
- * bottom-sheet style modal on native.
46
- */
47
- declare const ProfileMenu: React.FC<ProfileMenuProps>;
48
- export default ProfileMenu;
49
- //# sourceMappingURL=ProfileMenu.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ProfileMenu.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/ProfileMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA4B/B;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IAC9B,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,qFAAqF;IACrF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iFAAiF;IACjF,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,yEAAyE;IACzE,MAAM,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAClC,2DAA2D;IAC3D,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,sEAAsE;IACtE,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,8DAA8D;IAC9D,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,gFAAgF;IAChF,qBAAqB,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtD;AAED;;;;;;;;;;;;;;GAcG;AACH,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA8V3C,CAAC;AA0IF,eAAe,WAAW,CAAC"}
@@ -1,29 +0,0 @@
1
- import type React from 'react';
2
- import type { SwitchableAccount } from '../hooks/useSwitchableAccounts';
3
- export interface SignInAccountChooserProps {
4
- /** Accounts available on this device / in the caller's graph, current first. */
5
- accounts: SwitchableAccount[];
6
- /** Selecting a row — the active account continues, others switch into. */
7
- onSelectAccount: (account: SwitchableAccount) => void;
8
- /** "Use another account" → reveal the sign-in options (password / QR / add). */
9
- onUseAnother: () => void;
10
- /** The account id currently being switched into (shows a per-row spinner). */
11
- pendingAccountId?: string | null;
12
- /** Disables every row while a selection is in flight. */
13
- disabled?: boolean;
14
- }
15
- /**
16
- * Google-style account chooser (React Native). Lists every account the user can
17
- * continue as — device sign-ins + linked graph accounts, from
18
- * {@link SwitchableAccount} — plus a "Use another account" affordance. Rendered
19
- * as the FRONT screen of the sign-in surfaces (`SignInModal` web,
20
- * `OxyAuthScreen` native) whenever accounts exist; selecting a row funnels into
21
- * the SAME `switchToAccount` path the account switcher uses. When no accounts
22
- * exist the surfaces skip this and show the sign-in options directly.
23
- *
24
- * Presentational + chrome-agnostic (no modal/sheet wrapper, no data fetching) so
25
- * both containers reuse it and it is unit-testable in isolation.
26
- */
27
- export declare const SignInAccountChooser: React.FC<SignInAccountChooserProps>;
28
- export default SignInAccountChooser;
29
- //# sourceMappingURL=SignInAccountChooser.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SignInAccountChooser.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/SignInAccountChooser.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAExE,MAAM,WAAW,yBAAyB;IACtC,gFAAgF;IAChF,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,0EAA0E;IAC1E,eAAe,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACtD,gFAAgF;IAChF,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,8EAA8E;IAC9E,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,yDAAyD;IACzD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CA4EpE,CAAC;AAoDF,eAAe,oBAAoB,CAAC"}
@@ -1,28 +0,0 @@
1
- /**
2
- * SignInModal — web-first centered sign-in modal.
3
- *
4
- * Two phases, Google-style:
5
- * 1. Account chooser (FRONT screen, shown when the device/user already has
6
- * accounts): pick an account to continue as — one tap switches through the
7
- * SAME `switchToAccount` path the account switcher uses — or "Use another
8
- * account" to reveal the sign-in options.
9
- * 2. Sign-in options: the first-party password flow (identifier → password →
10
- * optional 2FA, `usePasswordSignIn`) as the PRIMARY action, with the
11
- * cross-app device flow (same-device deep-link + "sign in on another device"
12
- * QR) as a SECONDARY option below an "or" divider.
13
- *
14
- * When there are no accounts the modal opens straight on the sign-in options.
15
- * The device-flow machinery lives in the shared `useOxyAuthSession` hook (the
16
- * native `OxyAuthScreen` consumes it too — neither container re-implements the
17
- * transport). Animates with a fade + scale; per-phase content cross-fades and
18
- * respects reduced motion.
19
- */
20
- import type React from 'react';
21
- export declare const showSignInModal: () => void;
22
- export declare const hideSignInModal: () => void;
23
- export declare const isSignInModalVisible: () => boolean;
24
- /** Subscribe to modal visibility changes */
25
- export declare const subscribeToSignInModal: (listener: (visible: boolean) => void) => (() => void);
26
- declare const SignInModal: React.FC;
27
- export default SignInModal;
28
- //# sourceMappingURL=SignInModal.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SignInModal.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/SignInModal.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA8B/B,eAAO,MAAM,eAAe,YAI3B,CAAC;AAEF,eAAO,MAAM,eAAe,YAI3B,CAAC;AAEF,eAAO,MAAM,oBAAoB,eAAqB,CAAC;AAEvD,4CAA4C;AAC5C,eAAO,MAAM,sBAAsB,GAAI,UAAU,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,KAAG,CAAC,MAAM,IAAI,CAGxF,CAAC;AAEF,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAkBxB,CAAC;AAybF,eAAe,WAAW,CAAC"}
@@ -1,105 +0,0 @@
1
- /**
2
- * useOxyAuthSession — the single shared engine for the cross-app device-flow
3
- * sign-in ("Sign in with Oxy") used by BOTH containers:
4
- *
5
- * - `SignInModal` (web centered modal)
6
- * - `OxyAuthScreen` (native bottom sheet)
7
- *
8
- * Before this hook existed, those two files each re-implemented ~90% of the
9
- * same auth-session machinery (session-token creation, QR data, socket.io
10
- * `/auth-session` subscription, the HTTP polling fallback, waiting/error/retry
11
- * state, the open-auth handler, and cleanup) — and they had drifted (notably a
12
- * weaker `Math.random()` session token on native vs the crypto-secure one on
13
- * web). This hook owns ALL of it ONCE, with a clean typed surface, so the
14
- * containers only own their layout. The transport is functionally identical to
15
- * the previous implementations — this is a structural de-duplication, not a
16
- * behavior change.
17
- *
18
- * The native-only deep-link return path (`Linking` redirect handling) lives
19
- * HERE, gated to native via `Platform.OS`, so the web container never carries
20
- * native-only code while the two paths still cannot drift.
21
- */
22
- import type { OxyServices, SessionLoginResponse, User } from '@oxyhq/core';
23
- /**
24
- * Default destination for the "Create an Oxy account" / "Get Oxy Accounts"
25
- * link, shared by both containers. Reused as-is from the original native
26
- * `OxyAuthScreen` so no new route is invented.
27
- */
28
- export declare const OXY_ACCOUNTS_WEB_URL = "https://accounts.oxy.so";
29
- /** Default central Oxy auth web origin used when no override can be resolved. */
30
- export declare const OXY_AUTH_WEB_URL = "https://auth.oxy.so";
31
- /** Auth session expiration (5 minutes). */
32
- export declare const AUTH_SESSION_EXPIRY_MS: number;
33
- /** Polling interval (fallback if the socket fails) in milliseconds. */
34
- export declare const POLLING_INTERVAL_MS = 3000;
35
- /** The active device-flow session this client created and is waiting on. */
36
- export interface AuthSession {
37
- /** The secret high-entropy token that IS the device-flow credential. */
38
- sessionToken: string;
39
- /** Epoch ms after which the server rejects this session. */
40
- expiresAt: number;
41
- }
42
- export interface UseOxyAuthSessionOptions {
43
- /**
44
- * Called after a fully completed sign-in (bearer claimed, session hydrated).
45
- * The web modal closes itself here; the native screen forwards the user to
46
- * its `onAuthenticated` prop. The hook itself stays presentation-agnostic.
47
- */
48
- onSignedIn?: (user: User) => void;
49
- }
50
- export interface UseOxyAuthSessionResult {
51
- /** The active device-flow session, or `null` before/while it is created. */
52
- authSession: AuthSession | null;
53
- /** The QR payload string (`oxyauth://<token>`), or `''` when no session. */
54
- qrData: string;
55
- /**
56
- * The PUBLIC, single-use authorize code for the "Sign in with Oxy" handoff,
57
- * or `null` when the handoff backend did not return one. The approver (the
58
- * Oxy identity app) resolves the requesting app's identity from this code —
59
- * it is safe to display; it is NOT the secret `sessionToken`.
60
- */
61
- authorizeCode: string | null;
62
- /**
63
- * The structured "Sign in with Oxy" deep-link payload
64
- * (`oxycommons://approve?...`) to render in the cross-device QR and to open on
65
- * the same device, or `null` when the handoff backend did not return one.
66
- * Render this (preferred over `qrData`) in the QR and pass it to
67
- * `Linking.openURL` for same-device approval.
68
- */
69
- qrPayload: string | null;
70
- /** `true` while the session is being created (initial spinner). */
71
- isLoading: boolean;
72
- /** A user-facing error message, or `null`. Drives the retry UI. */
73
- error: string | null;
74
- /** `true` once a session exists and we are awaiting authorization. */
75
- isWaiting: boolean;
76
- /**
77
- * Open the central Oxy auth approval surface for THIS device-flow session.
78
- * On web this opens a centered approval popup; on native it opens the system
79
- * browser (carrying a `redirect_uri` so the deep-link return path can fire).
80
- * This is the action behind the platform-primary "Continue with Oxy" button.
81
- */
82
- openAuthApproval: () => Promise<void>;
83
- /**
84
- * Same-device "Sign in with Oxy" handoff: deep-link to `qrPayload`
85
- * (`oxycommons://approve?...`) so the native Oxy identity app opens directly
86
- * to approve. No-op when no `qrPayload` was returned. The socket / poll still
87
- * completes the sign-in once the approval lands.
88
- */
89
- openSameDeviceApproval: () => Promise<void>;
90
- /** Tear down the current session and create a fresh one (the retry action). */
91
- retry: () => void;
92
- /** Disconnect the socket and stop polling. Idempotent. */
93
- cleanup: () => void;
94
- }
95
- /**
96
- * Owns the full device-flow auth-session lifecycle for one mounted sign-in
97
- * surface. Both `SignInModal` and `OxyAuthScreen` consume this; neither
98
- * re-implements the socket / polling / deep-link transport.
99
- *
100
- * Subscriptions (socket connect/disconnect, the poll interval, the native
101
- * deep-link listener, and unmount cleanup) are the legitimate `useEffect` use
102
- * WITH cleanup. No effect here computes derived UI state.
103
- */
104
- export declare function useOxyAuthSession(oxyServices: OxyServices, clientId: string | null, commitSession: ((session: SessionLoginResponse) => Promise<void>) | undefined, options?: UseOxyAuthSessionOptions): UseOxyAuthSessionResult;
105
- //# sourceMappingURL=useOxyAuthSession.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useOxyAuthSession.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useOxyAuthSession.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAE,oBAAoB,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAM3E;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,4BAA4B,CAAC;AAE9D,iFAAiF;AACjF,eAAO,MAAM,gBAAgB,wBAAwB,CAAC;AAEtD,2CAA2C;AAC3C,eAAO,MAAM,sBAAsB,QAAgB,CAAC;AAEpD,uEAAuE;AACvE,eAAO,MAAM,mBAAmB,OAAO,CAAC;AAExC,4EAA4E;AAC5E,MAAM,WAAW,WAAW;IAC1B,wEAAwE;IACxE,YAAY,EAAE,MAAM,CAAC;IACrB,4DAA4D;IAC5D,SAAS,EAAE,MAAM,CAAC;CACnB;AAgCD,MAAM,WAAW,wBAAwB;IACvC;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;CACnC;AAED,MAAM,WAAW,uBAAuB;IACtC,4EAA4E;IAC5E,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IAChC,4EAA4E;IAC5E,MAAM,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B;;;;;;OAMG;IACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,mEAAmE;IACnE,SAAS,EAAE,OAAO,CAAC;IACnB,mEAAmE;IACnE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,sEAAsE;IACtE,SAAS,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,gBAAgB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC;;;;;OAKG;IACH,sBAAsB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,+EAA+E;IAC/E,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,0DAA0D;IAC1D,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAoFD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvB,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,oBAAoB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,EAC7E,OAAO,GAAE,wBAA6B,GACrC,uBAAuB,CA8YzB"}
@@ -1,31 +0,0 @@
1
- export type PasswordSignInStep = 'identifier' | 'password' | 'twoFactor';
2
- export interface UsePasswordSignInOptions {
3
- /** Fired once a session has been committed (the surface should close). */
4
- onSignedIn?: () => void;
5
- }
6
- export interface UsePasswordSignInResult {
7
- step: PasswordSignInStep;
8
- identifier: string;
9
- setIdentifier: (value: string) => void;
10
- password: string;
11
- setPassword: (value: string) => void;
12
- /** The current 2FA input — a TOTP code or a backup code, per `useBackupCode`. */
13
- code: string;
14
- setCode: (value: string) => void;
15
- useBackupCode: boolean;
16
- setUseBackupCode: (value: boolean) => void;
17
- error: string | null;
18
- isSubmitting: boolean;
19
- /** Advance identifier → password (validates a non-empty identifier). */
20
- submitIdentifier: () => void;
21
- /** Submit the password: commits a one-step session, or advances to 2FA. */
22
- submitPassword: () => Promise<void>;
23
- /** Submit the 2FA code / backup code and commit the session. */
24
- submitTwoFactor: () => Promise<void>;
25
- /** Step back one screen (2FA → password → identifier), clearing the error. */
26
- back: () => void;
27
- /** Reset every field back to the identifier step. */
28
- reset: () => void;
29
- }
30
- export declare function usePasswordSignIn(options?: UsePasswordSignInOptions): UsePasswordSignInResult;
31
- //# sourceMappingURL=usePasswordSignIn.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"usePasswordSignIn.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/usePasswordSignIn.ts"],"names":[],"mappings":"AAkBA,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG,UAAU,GAAG,WAAW,CAAC;AAEzE,MAAM,WAAW,wBAAwB;IACvC,0EAA0E;IAC1E,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,kBAAkB,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,iFAAiF;IACjF,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,aAAa,EAAE,OAAO,CAAC;IACvB,gBAAgB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,wEAAwE;IACxE,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,2EAA2E;IAC3E,cAAc,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,gEAAgE;IAChE,eAAe,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,8EAA8E;IAC9E,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,qDAAqD;IACrD,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,wBAA6B,GAAG,uBAAuB,CA4JjG"}
@@ -1,11 +0,0 @@
1
- import type React from 'react';
2
- import type { BaseScreenProps } from '../types/navigation';
3
- /**
4
- * Bottom-sheet route wrapper around {@link AccountSwitcherView}. Used when the
5
- * switcher is opened as a sheet (e.g. from the "Your accounts" entry in
6
- * ManageAccount) rather than as the header-chip popover (which uses the
7
- * `AccountSwitcher` modal directly).
8
- */
9
- declare const AccountSwitcherScreen: React.FC<BaseScreenProps>;
10
- export default AccountSwitcherScreen;
11
- //# sourceMappingURL=AccountSwitcherScreen.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AccountSwitcherScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/AccountSwitcherScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAK3D;;;;;GAKG;AACH,QAAA,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA0BpD,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -1,22 +0,0 @@
1
- /**
2
- * OxyAuthScreen — Sign in with Oxy (native bottom-sheet container).
3
- *
4
- * Two phases, Google-style:
5
- * 1. Account chooser (FRONT screen, shown when the device/user already has
6
- * accounts): pick an account to continue as — one tap switches through the
7
- * SAME `switchToAccount` path the account switcher uses — or "Use another
8
- * account" to reveal the sign-in options.
9
- * 2. Sign-in options: the first-party password flow (identifier → password →
10
- * optional 2FA, `usePasswordSignIn`) as the PRIMARY action, with the
11
- * cross-app device flow (same-device deep-link + "sign in on another device"
12
- * QR) as a SECONDARY option below an "or" divider.
13
- *
14
- * The device-flow machinery lives in the shared `useOxyAuthSession` hook (the
15
- * web `SignInModal` consumes it too). This screen should NOT be used within the
16
- * Oxy Accounts app itself.
17
- */
18
- import type React from 'react';
19
- import type { BaseScreenProps } from '../types/navigation';
20
- declare const OxyAuthScreen: React.FC<BaseScreenProps>;
21
- export default OxyAuthScreen;
22
- //# sourceMappingURL=OxyAuthScreen.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"OxyAuthScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/OxyAuthScreen.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAmB3D,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAyR5C,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -1,97 +0,0 @@
1
- /**
2
- * Shared, pure orchestration for completing the cross-app device-flow sign-in
3
- * (the QR-code / "Open Oxy Auth" path used on native and web).
4
- *
5
- * THE FIRST BUG THIS FIXES (native): once another authenticated device
6
- * approves the pending AuthSession, the originating client is notified
7
- * (socket / poll / deep-link) with the authorized `sessionId`. Before any
8
- * session-management code can use it, the client MUST exchange the secret
9
- * 128-bit `sessionToken` (held only by this client, generated for THIS flow)
10
- * for the first access token via `claimSessionByToken` — the device-flow
11
- * equivalent of OAuth's code-for-token exchange (RFC 8628 §3.4).
12
- *
13
- * THE SECOND BUG THIS FIXES (session-sync cutover regression): the
14
- * freshly-claimed session is NOT yet registered in the device's
15
- * server-authoritative session set — nothing has run
16
- * `sessionClient.addCurrentAccount()` for it — so it must NOT be committed
17
- * through `switchSession`. That path is now an account-SWITCH between
18
- * accounts already registered on this device (`OxyContext`'s
19
- * `switchSessionForContext`), and throws `No device account found for
20
- * session "..."` for anything else, surfacing as "Authorization successful
21
- * but failed to complete sign in." Instead the claimed session must be
22
- * committed through the SAME path a fresh password sign-in uses —
23
- * `useOxy().handleWebSession` (`OxyContext`'s `handleWebSSOSession`) — which
24
- * registers the account into the device set, persists it durably, and
25
- * hydrates the full user profile.
26
- *
27
- * Skipping the claim leaves the SDK with NO bearer token: the session is
28
- * authorized server-side but the app never becomes authenticated and the UI
29
- * sits "Waiting for authorization..." forever. Consolidating the
30
- * claim->commit sequence here keeps native and web identical and
31
- * unit-testable.
32
- */
33
- import { type SessionLoginResponse, type User } from '@oxyhq/core';
34
- interface DeviceFlowClaimResult {
35
- accessToken?: string;
36
- /** Rotating refresh-token family head minted by `/auth/session/claim` on the
37
- * trusted lane. Not on the core method's typed return, so read defensively;
38
- * threaded into `commitSession` so the QR sign-in persists a durable session
39
- * that survives a reload without a redirect. */
40
- refreshToken?: string;
41
- sessionId?: string;
42
- deviceId?: string;
43
- expiresAt?: string;
44
- user?: User;
45
- }
46
- /**
47
- * The minimal `OxyServices` surface this orchestration needs. Kept as a
48
- * structural type (rather than importing the full client) so the helper is
49
- * trivially unit-testable with a stub and never pulls the RN/Expo runtime into
50
- * a test bundle.
51
- *
52
- */
53
- export interface DeviceFlowClient {
54
- /**
55
- * Exchange the device-flow `sessionToken` for the first access + refresh
56
- * token, planting them on the client. Single-use; replay is rejected by the
57
- * API. No bearer required — the high-entropy `sessionToken` IS the credential.
58
- */
59
- claimSessionByToken: (sessionToken: string) => Promise<DeviceFlowClaimResult | undefined>;
60
- }
61
- export interface CompleteDeviceFlowSignInOptions {
62
- /** The OxyServices client (or any object exposing `claimSessionByToken`). */
63
- oxyServices: DeviceFlowClient;
64
- /** The authorized device session id, delivered by the socket / poll / link. */
65
- sessionId: string;
66
- /**
67
- * The secret `sessionToken` generated for THIS flow and registered via
68
- * `POST /auth/session/create`. Required to claim the first access token.
69
- */
70
- sessionToken: string;
71
- /**
72
- * `useOxy().handleWebSession` — commits the freshly-claimed session into
73
- * context state through the SAME path a password sign-in uses:
74
- * registers the account into the device's server-authoritative session set,
75
- * persists it durably, and hydrates the full user profile. Runs AFTER the
76
- * bearer is planted so its bearer-protected calls succeed.
77
- *
78
- * The `refreshToken` extra (optional; not on the public `SessionLoginResponse`
79
- * type) carries the rotating refresh family so the commit funnel persists a
80
- * durable session.
81
- */
82
- commitSession: (session: SessionLoginResponse & {
83
- refreshToken?: string;
84
- }) => Promise<void>;
85
- }
86
- /**
87
- * Complete a device-flow sign-in: claim the first access token with the secret
88
- * `sessionToken` (planting the bearer), then commit the resulting session via
89
- * `commitSession` (registers it into the device's server-authoritative session
90
- * set and hydrates the full user). Returns the authenticated user.
91
- *
92
- * Throws if the claim did not return a usable session, or if either the claim
93
- * or the commit fails; callers surface a retry UI.
94
- */
95
- export declare function completeDeviceFlowSignIn({ oxyServices, sessionId, sessionToken, commitSession, }: CompleteDeviceFlowSignInOptions): Promise<User>;
96
- export {};
97
- //# sourceMappingURL=deviceFlowSignIn.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deviceFlowSignIn.d.ts","sourceRoot":"","sources":["../../../../src/utils/deviceFlowSignIn.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,IAAI,EACV,MAAM,aAAa,CAAC;AAErB,UAAU,qBAAqB;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;oDAGgD;IAChD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,IAAI,CAAC;CACb;AAED;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,mBAAmB,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAAC;CAC3F;AAED,MAAM,WAAW,+BAA+B;IAC9C,6EAA6E;IAC7E,WAAW,EAAE,gBAAgB,CAAC;IAC9B,+EAA+E;IAC/E,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;;;;;;;;OAUG;IACH,aAAa,EAAE,CAAC,OAAO,EAAE,oBAAoB,GAAG;QAAE,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7F;AAED;;;;;;;;GAQG;AACH,wBAAsB,wBAAwB,CAAC,EAC7C,WAAW,EACX,SAAS,EACT,YAAY,EACZ,aAAa,GACd,EAAE,+BAA+B,GAAG,OAAO,CAAC,IAAI,CAAC,CA4CjD"}
@@ -1,47 +0,0 @@
1
- import type React from 'react';
2
- /**
3
- * Web-only anchor for the popover panel. Each field anchors the panel against
4
- * one viewport edge, so the popover can be placed against ANY corner: a
5
- * top-right avatar chip opens downward/right-aligned (`{ top, right }`), while a
6
- * bottom-left account button opens upward/left-aligned (`{ bottom, left }`).
7
- *
8
- * Callers MUST supply at most one vertical edge (`top` XOR `bottom`) and at most
9
- * one horizontal edge (`left` XOR `right`). The panel has a fixed width and
10
- * `maxHeight`, so a single vertical + single horizontal edge fully positions it.
11
- * Supplying both opposite edges (e.g. `top` AND `bottom`) would stretch the
12
- * panel on RN-Web and is unsupported.
13
- */
14
- export interface AccountMenuAnchor {
15
- /** Distance from the viewport top, when anchoring the panel's TOP edge. */
16
- top?: number;
17
- /** Distance from the viewport bottom, when anchoring the panel's BOTTOM edge (opens upward). */
18
- bottom?: number;
19
- /** Distance from the viewport left, when anchoring the panel's LEFT edge. */
20
- left?: number;
21
- /** Distance from the viewport right, when anchoring the panel's RIGHT edge. */
22
- right?: number;
23
- }
24
- export interface AccountMenuProps {
25
- open: boolean;
26
- onClose: () => void;
27
- onNavigateManage: () => void;
28
- onAddAccount: () => void;
29
- /** Optional anchor (web only). Native ignores this and uses bottom-sheet style. */
30
- anchor?: AccountMenuAnchor | null;
31
- /** Called before the active identity changes so apps can clear tenant-scoped state. */
32
- onBeforeSessionChange?: () => void | Promise<void>;
33
- }
34
- /**
35
- * Unified, canonical account switcher for the Oxy ecosystem. Gmail-style: the
36
- * accounts list sits at the top (current account first, with a checkmark), then
37
- * "Add another account", "Manage account", and the sign-out actions. Lists EVERY
38
- * switchable account (device sign-ins AND linked graph accounts) and routes every
39
- * switch through the single `switchToAccount(accountId)` path.
40
- *
41
- * Reads everything it needs from `useOxy()` / `useSwitchableAccounts()` — never
42
- * receives a session via props. Renders as a popover anchored to the trigger on
43
- * web, and as a full-width bottom-sheet style modal on native.
44
- */
45
- declare const AccountMenu: React.FC<AccountMenuProps>;
46
- export default AccountMenu;
47
- //# sourceMappingURL=AccountMenu.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AccountMenu.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/AccountMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAwB/B;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,iBAAiB;IAC9B,2EAA2E;IAC3E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gGAAgG;IAChG,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6EAA6E;IAC7E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,mFAAmF;IACnF,MAAM,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAClC,uFAAuF;IACvF,qBAAqB,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtD;AAQD;;;;;;;;;;GAUG;AACH,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA8b3C,CAAC;AA2HF,eAAe,WAAW,CAAC"}
@@ -1,26 +0,0 @@
1
- import type React from 'react';
2
- export interface AccountMenuButtonProps {
3
- /** Avatar size (px). Defaults to 36 (Google account chip size). */
4
- size?: number;
5
- /** Called when the user picks "Manage your Oxy Account". */
6
- onNavigateManage: () => void;
7
- /** Called when the user picks "Add another account". */
8
- onAddAccount: () => void;
9
- }
10
- /**
11
- * Avatar entry-point that opens the unified {@link AccountSwitcher}. Reads the
12
- * active account from `useOxy().user` — never receives user data via props.
13
- *
14
- * The chip reflects the current account: in the real-session switch model,
15
- * switching into an org / project / bot / shared account makes the whole app —
16
- * including this header avatar — become that account, so `user` IS the current
17
- * account and the chip always shows it.
18
- *
19
- * Renders a small avatar chip (top-right friendly). Click → opens the switcher
20
- * (device sign-ins + account graph). Pure component: owns only the open-state
21
- * and the trigger's measured anchor. Create-account and per-account settings
22
- * route through the global bottom-sheet manager.
23
- */
24
- declare const AccountMenuButton: React.FC<AccountMenuButtonProps>;
25
- export default AccountMenuButton;
26
- //# sourceMappingURL=AccountMenuButton.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AccountMenuButton.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/AccountMenuButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,MAAM,WAAW,sBAAsB;IACnC,mEAAmE;IACnE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,wDAAwD;IACxD,YAAY,EAAE,MAAM,IAAI,CAAC;CAC5B;AAID;;;;;;;;;;;;;GAaG;AACH,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CA+EvD,CAAC;AAUF,eAAe,iBAAiB,CAAC"}
@@ -1,46 +0,0 @@
1
- import type React from 'react';
2
- import type { AccountMenuAnchor } from './AccountMenu.js';
3
- /**
4
- * The set of action callbacks the switcher body needs. Supplied by whichever
5
- * chrome wraps it — the {@link AccountSwitcher} modal/popover (web header chip,
6
- * native sheet) or the {@link AccountSwitcherScreen} bottom-sheet route.
7
- */
8
- export interface AccountSwitcherActions {
9
- /** Close the surface (dismiss the modal, or pop the bottom sheet). */
10
- onClose: () => void;
11
- /** Start adding another device sign-in. */
12
- onAddAccount: () => void;
13
- /** Open "Manage your Oxy Account" (the caller's own personal account). */
14
- onNavigateManage: () => void;
15
- /** Open the create-account flow. */
16
- onCreateAccount: () => void;
17
- /** Open the per-account settings surface for a non-personal account. */
18
- onOpenAccountSettings?: (accountId: string) => void;
19
- /** Called before the active device session changes so apps can clear tenant state. */
20
- onBeforeSessionChange?: () => void | Promise<void>;
21
- }
22
- /**
23
- * The presentational, chrome-agnostic body of the unified account switcher.
24
- *
25
- * Two levels, relationship-aware, both sourced from the single
26
- * {@link useSwitchableAccounts} hook and switched through the SINGLE
27
- * `switchToAccount(accountId)` path:
28
- * - Section A — accounts signed in on THIS device (`onDevice` rows). Tap to
29
- * switch; per-row sign-out; "Add another account".
30
- * - Section B — the account GRAPH not yet signed in here: "Your accounts"
31
- * (self / owned) and "Shared with you" (member). 2-level tree (org →
32
- * children), role badge, search, one-tap to switch.
33
- */
34
- export declare const AccountSwitcherView: React.FC<AccountSwitcherActions>;
35
- export interface AccountSwitcherProps extends AccountSwitcherActions {
36
- open: boolean;
37
- /** Optional anchor (web only). Native ignores this and docks as a bottom sheet. */
38
- anchor?: AccountMenuAnchor | null;
39
- }
40
- /**
41
- * Unified account switcher presented as a popover (web) / bottom-sheet style
42
- * modal (native). The canonical entry point opened by {@link AccountMenuButton}.
43
- */
44
- declare const AccountSwitcher: React.FC<AccountSwitcherProps>;
45
- export default AccountSwitcher;
46
- //# sourceMappingURL=AccountSwitcher.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AccountSwitcher.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/AccountSwitcher.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAwB/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAe,CAAC;AAKvD;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACnC,sEAAsE;IACtE,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,2CAA2C;IAC3C,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,0EAA0E;IAC1E,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,oCAAoC;IACpC,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,wEAAwE;IACxE,qBAAqB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACpD,sFAAsF;IACtF,qBAAqB,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtD;AAyCD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAwbhE,CAAC;AAEF,MAAM,WAAW,oBAAqB,SAAQ,sBAAsB;IAChE,IAAI,EAAE,OAAO,CAAC;IACd,mFAAmF;IACnF,MAAM,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;CACrC;AAED;;;GAGG;AACH,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAyDnD,CAAC;AA6IF,eAAe,eAAe,CAAC"}
@@ -1,34 +0,0 @@
1
- /**
2
- * AnotherDeviceQR — the collapsed "Sign in on another device" disclosure shared
3
- * by both sign-in containers (`SignInModal` on web, `OxyAuthScreen` on native).
4
- *
5
- * The QR code is always DEMOTED below the platform-primary "Continue with Oxy"
6
- * action: you cannot scan your own screen, so the QR is only useful for handing
7
- * sign-in to a SECOND device (scan with the Oxy Accounts app there). It lives
8
- * inside a tap-to-expand disclosure so it never competes with the primary CTA.
9
- *
10
- * The QR plate stays white intentionally — high contrast is required for
11
- * reliable scanning regardless of the app theme. That single plate (and its
12
- * fixed dimensions) is the only StyleSheet/hardcoded-color in this component;
13
- * everything else is composed from Bloom typography + centralized token classes.
14
- */
15
- import type React from 'react';
16
- export interface AnotherDeviceQRProps {
17
- /** The legacy QR payload (`oxyauth://<token>`). Empty string renders nothing. */
18
- qrData: string;
19
- /**
20
- * The secure "Sign in with Oxy" handoff payload (`oxycommons://approve?...`).
21
- * Preferred over `qrData` when present — it carries the PUBLIC authorize code
22
- * (never the secret session token), so the Oxy identity app on another device
23
- * can scan it to approve. Falls back to `qrData` when the handoff backend has
24
- * not returned a payload.
25
- */
26
- qrPayload?: string | null;
27
- }
28
- /**
29
- * Collapsed disclosure that reveals a high-contrast QR for signing in on a
30
- * second device with the Oxy Accounts app.
31
- */
32
- declare const AnotherDeviceQR: React.FC<AnotherDeviceQRProps>;
33
- export default AnotherDeviceQR;
34
- //# sourceMappingURL=AnotherDeviceQR.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AnotherDeviceQR.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/AnotherDeviceQR.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,MAAM,WAAW,oBAAoB;IACnC,iFAAiF;IACjF,MAAM,EAAE,MAAM,CAAC;IACf;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AASD;;;GAGG;AACH,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA0DnD,CAAC;AAaF,eAAe,eAAe,CAAC"}