@oxyhq/services 14.0.1 → 15.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 (262) hide show
  1. package/lib/commonjs/index.js +0 -17
  2. package/lib/commonjs/index.js.map +1 -1
  3. package/lib/commonjs/ui/components/SignInAccountChooser.js +189 -0
  4. package/lib/commonjs/ui/components/SignInAccountChooser.js.map +1 -0
  5. package/lib/commonjs/ui/components/SignInModal.js +350 -131
  6. package/lib/commonjs/ui/components/SignInModal.js.map +1 -1
  7. package/lib/commonjs/ui/context/OxyContext.js +340 -1547
  8. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  9. package/lib/commonjs/ui/context/hooks/useAuthOperations.js +61 -64
  10. package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
  11. package/lib/commonjs/ui/hooks/useAuth.js +14 -33
  12. package/lib/commonjs/ui/hooks/useAuth.js.map +1 -1
  13. package/lib/commonjs/ui/hooks/usePasswordSignIn.js +170 -0
  14. package/lib/commonjs/ui/hooks/usePasswordSignIn.js.map +1 -0
  15. package/lib/commonjs/ui/hooks/useProfileEditing.js +2 -5
  16. package/lib/commonjs/ui/hooks/useProfileEditing.js.map +1 -1
  17. package/lib/commonjs/ui/hooks/useSessionManagement.js +2 -2
  18. package/lib/commonjs/ui/hooks/useSessionManagement.js.map +1 -1
  19. package/lib/commonjs/ui/navigation/routes.js +1 -0
  20. package/lib/commonjs/ui/navigation/routes.js.map +1 -1
  21. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +93 -68
  22. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
  23. package/lib/commonjs/ui/screens/EditProfileScreen.js +187 -0
  24. package/lib/commonjs/ui/screens/EditProfileScreen.js.map +1 -0
  25. package/lib/commonjs/ui/screens/ManageAccountScreen.js +3 -7
  26. package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
  27. package/lib/commonjs/ui/screens/OxyAuthScreen.js +231 -95
  28. package/lib/commonjs/ui/screens/OxyAuthScreen.js.map +1 -1
  29. package/lib/commonjs/ui/screens/ProfileScreen.js +15 -2
  30. package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
  31. package/lib/commonjs/ui/screens/linkFormat.js +38 -0
  32. package/lib/commonjs/ui/screens/linkFormat.js.map +1 -0
  33. package/lib/commonjs/ui/session/authStore.js +146 -0
  34. package/lib/commonjs/ui/session/authStore.js.map +1 -0
  35. package/lib/commonjs/ui/session/createSessionClient.js +25 -10
  36. package/lib/commonjs/ui/session/createSessionClient.js.map +1 -1
  37. package/lib/commonjs/ui/session/index.js +13 -7
  38. package/lib/commonjs/ui/session/index.js.map +1 -1
  39. package/lib/commonjs/ui/session/tokenTransport.js +19 -31
  40. package/lib/commonjs/ui/session/tokenTransport.js.map +1 -1
  41. package/lib/commonjs/ui/utils/isWebBrowser.js +13 -0
  42. package/lib/commonjs/ui/utils/isWebBrowser.js.map +1 -0
  43. package/lib/commonjs/utils/deviceFlowSignIn.js +13 -16
  44. package/lib/commonjs/utils/deviceFlowSignIn.js.map +1 -1
  45. package/lib/module/index.js +0 -5
  46. package/lib/module/index.js.map +1 -1
  47. package/lib/module/ui/components/SignInAccountChooser.js +183 -0
  48. package/lib/module/ui/components/SignInAccountChooser.js.map +1 -0
  49. package/lib/module/ui/components/SignInModal.js +352 -134
  50. package/lib/module/ui/components/SignInModal.js.map +1 -1
  51. package/lib/module/ui/context/OxyContext.js +342 -1551
  52. package/lib/module/ui/context/OxyContext.js.map +1 -1
  53. package/lib/module/ui/context/hooks/useAuthOperations.js +60 -63
  54. package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
  55. package/lib/module/ui/hooks/useAuth.js +14 -33
  56. package/lib/module/ui/hooks/useAuth.js.map +1 -1
  57. package/lib/module/ui/hooks/usePasswordSignIn.js +165 -0
  58. package/lib/module/ui/hooks/usePasswordSignIn.js.map +1 -0
  59. package/lib/module/ui/hooks/useProfileEditing.js +2 -5
  60. package/lib/module/ui/hooks/useProfileEditing.js.map +1 -1
  61. package/lib/module/ui/hooks/useSessionManagement.js +1 -1
  62. package/lib/module/ui/hooks/useSessionManagement.js.map +1 -1
  63. package/lib/module/ui/navigation/routes.js +1 -0
  64. package/lib/module/ui/navigation/routes.js.map +1 -1
  65. package/lib/module/ui/screens/EditProfileFieldScreen.js +91 -66
  66. package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
  67. package/lib/module/ui/screens/EditProfileScreen.js +182 -0
  68. package/lib/module/ui/screens/EditProfileScreen.js.map +1 -0
  69. package/lib/module/ui/screens/ManageAccountScreen.js +3 -7
  70. package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
  71. package/lib/module/ui/screens/OxyAuthScreen.js +233 -97
  72. package/lib/module/ui/screens/OxyAuthScreen.js.map +1 -1
  73. package/lib/module/ui/screens/ProfileScreen.js +15 -2
  74. package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
  75. package/lib/module/ui/screens/linkFormat.js +31 -0
  76. package/lib/module/ui/screens/linkFormat.js.map +1 -0
  77. package/lib/module/ui/session/authStore.js +143 -0
  78. package/lib/module/ui/session/authStore.js.map +1 -0
  79. package/lib/module/ui/session/createSessionClient.js +25 -10
  80. package/lib/module/ui/session/createSessionClient.js.map +1 -1
  81. package/lib/module/ui/session/index.js +9 -9
  82. package/lib/module/ui/session/index.js.map +1 -1
  83. package/lib/module/ui/session/tokenTransport.js +20 -33
  84. package/lib/module/ui/session/tokenTransport.js.map +1 -1
  85. package/lib/module/ui/utils/isWebBrowser.js +11 -0
  86. package/lib/module/ui/utils/isWebBrowser.js.map +1 -0
  87. package/lib/module/utils/deviceFlowSignIn.js +14 -17
  88. package/lib/module/utils/deviceFlowSignIn.js.map +1 -1
  89. package/lib/typescript/commonjs/index.d.ts +0 -1
  90. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  91. package/lib/typescript/commonjs/ui/components/SignInAccountChooser.d.ts +29 -0
  92. package/lib/typescript/commonjs/ui/components/SignInAccountChooser.d.ts.map +1 -0
  93. package/lib/typescript/commonjs/ui/components/SignInModal.d.ts +15 -10
  94. package/lib/typescript/commonjs/ui/components/SignInModal.d.ts.map +1 -1
  95. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts +36 -42
  96. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
  97. package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts +18 -23
  98. package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
  99. package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts +0 -2
  100. package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  101. package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts.map +1 -1
  102. package/lib/typescript/commonjs/ui/hooks/usePasswordSignIn.d.ts +31 -0
  103. package/lib/typescript/commonjs/ui/hooks/usePasswordSignIn.d.ts.map +1 -0
  104. package/lib/typescript/commonjs/ui/hooks/useProfileEditing.d.ts +0 -1
  105. package/lib/typescript/commonjs/ui/hooks/useProfileEditing.d.ts.map +1 -1
  106. package/lib/typescript/commonjs/ui/navigation/routes.d.ts +1 -1
  107. package/lib/typescript/commonjs/ui/navigation/routes.d.ts.map +1 -1
  108. package/lib/typescript/commonjs/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
  109. package/lib/typescript/commonjs/ui/screens/EditProfileScreen.d.ts +14 -0
  110. package/lib/typescript/commonjs/ui/screens/EditProfileScreen.d.ts.map +1 -0
  111. package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts +1 -1
  112. package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -1
  113. package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts +13 -12
  114. package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts.map +1 -1
  115. package/lib/typescript/commonjs/ui/screens/ProfileScreen.d.ts.map +1 -1
  116. package/lib/typescript/commonjs/ui/screens/linkFormat.d.ts +23 -0
  117. package/lib/typescript/commonjs/ui/screens/linkFormat.d.ts.map +1 -0
  118. package/lib/typescript/commonjs/ui/session/authStore.d.ts +33 -0
  119. package/lib/typescript/commonjs/ui/session/authStore.d.ts.map +1 -0
  120. package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts +20 -9
  121. package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts.map +1 -1
  122. package/lib/typescript/commonjs/ui/session/index.d.ts +9 -9
  123. package/lib/typescript/commonjs/ui/session/index.d.ts.map +1 -1
  124. package/lib/typescript/commonjs/ui/session/tokenTransport.d.ts +13 -19
  125. package/lib/typescript/commonjs/ui/session/tokenTransport.d.ts.map +1 -1
  126. package/lib/typescript/commonjs/ui/utils/isWebBrowser.d.ts +9 -0
  127. package/lib/typescript/commonjs/ui/utils/isWebBrowser.d.ts.map +1 -0
  128. package/lib/typescript/commonjs/utils/deviceFlowSignIn.d.ts +15 -13
  129. package/lib/typescript/commonjs/utils/deviceFlowSignIn.d.ts.map +1 -1
  130. package/lib/typescript/module/index.d.ts +0 -1
  131. package/lib/typescript/module/index.d.ts.map +1 -1
  132. package/lib/typescript/module/ui/components/SignInAccountChooser.d.ts +29 -0
  133. package/lib/typescript/module/ui/components/SignInAccountChooser.d.ts.map +1 -0
  134. package/lib/typescript/module/ui/components/SignInModal.d.ts +15 -10
  135. package/lib/typescript/module/ui/components/SignInModal.d.ts.map +1 -1
  136. package/lib/typescript/module/ui/context/OxyContext.d.ts +36 -42
  137. package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
  138. package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts +18 -23
  139. package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
  140. package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts +0 -2
  141. package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  142. package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
  143. package/lib/typescript/module/ui/hooks/usePasswordSignIn.d.ts +31 -0
  144. package/lib/typescript/module/ui/hooks/usePasswordSignIn.d.ts.map +1 -0
  145. package/lib/typescript/module/ui/hooks/useProfileEditing.d.ts +0 -1
  146. package/lib/typescript/module/ui/hooks/useProfileEditing.d.ts.map +1 -1
  147. package/lib/typescript/module/ui/navigation/routes.d.ts +1 -1
  148. package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
  149. package/lib/typescript/module/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
  150. package/lib/typescript/module/ui/screens/EditProfileScreen.d.ts +14 -0
  151. package/lib/typescript/module/ui/screens/EditProfileScreen.d.ts.map +1 -0
  152. package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts +1 -1
  153. package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -1
  154. package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts +13 -12
  155. package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts.map +1 -1
  156. package/lib/typescript/module/ui/screens/ProfileScreen.d.ts.map +1 -1
  157. package/lib/typescript/module/ui/screens/linkFormat.d.ts +23 -0
  158. package/lib/typescript/module/ui/screens/linkFormat.d.ts.map +1 -0
  159. package/lib/typescript/module/ui/session/authStore.d.ts +33 -0
  160. package/lib/typescript/module/ui/session/authStore.d.ts.map +1 -0
  161. package/lib/typescript/module/ui/session/createSessionClient.d.ts +20 -9
  162. package/lib/typescript/module/ui/session/createSessionClient.d.ts.map +1 -1
  163. package/lib/typescript/module/ui/session/index.d.ts +9 -9
  164. package/lib/typescript/module/ui/session/index.d.ts.map +1 -1
  165. package/lib/typescript/module/ui/session/tokenTransport.d.ts +13 -19
  166. package/lib/typescript/module/ui/session/tokenTransport.d.ts.map +1 -1
  167. package/lib/typescript/module/ui/utils/isWebBrowser.d.ts +9 -0
  168. package/lib/typescript/module/ui/utils/isWebBrowser.d.ts.map +1 -0
  169. package/lib/typescript/module/utils/deviceFlowSignIn.d.ts +15 -13
  170. package/lib/typescript/module/utils/deviceFlowSignIn.d.ts.map +1 -1
  171. package/package.json +4 -4
  172. package/src/index.ts +0 -4
  173. package/src/ui/components/SignInAccountChooser.tsx +162 -0
  174. package/src/ui/components/SignInModal.tsx +309 -139
  175. package/src/ui/context/OxyContext.tsx +532 -1785
  176. package/src/ui/context/hooks/useAuthOperations.ts +65 -76
  177. package/src/ui/hooks/useAuth.ts +14 -35
  178. package/src/ui/hooks/usePasswordSignIn.ts +207 -0
  179. package/src/ui/hooks/useProfileEditing.ts +2 -8
  180. package/src/ui/hooks/useSessionManagement.ts +1 -1
  181. package/src/ui/navigation/routes.ts +2 -0
  182. package/src/ui/screens/EditProfileFieldScreen.tsx +102 -66
  183. package/src/ui/screens/EditProfileScreen.tsx +155 -0
  184. package/src/ui/screens/ManageAccountScreen.tsx +3 -7
  185. package/src/ui/screens/OxyAuthScreen.tsx +259 -112
  186. package/src/ui/screens/ProfileScreen.tsx +15 -2
  187. package/src/ui/screens/__tests__/linkFormat.test.ts +73 -0
  188. package/src/ui/screens/linkFormat.ts +37 -0
  189. package/src/ui/session/__tests__/createSessionClient.test.ts +49 -6
  190. package/src/ui/session/__tests__/tokenTransport.test.ts +37 -49
  191. package/src/ui/session/authStore.ts +164 -0
  192. package/src/ui/session/createSessionClient.ts +32 -11
  193. package/src/ui/session/index.ts +10 -9
  194. package/src/ui/session/tokenTransport.ts +26 -36
  195. package/src/ui/utils/isWebBrowser.ts +8 -0
  196. package/src/utils/__tests__/deviceFlowSignIn.test.ts +50 -131
  197. package/src/utils/deviceFlowSignIn.ts +19 -26
  198. package/lib/commonjs/ui/context/inSessionTokenRefresh.js +0 -243
  199. package/lib/commonjs/ui/context/inSessionTokenRefresh.js.map +0 -1
  200. package/lib/commonjs/ui/context/silentSessionRestore.js +0 -56
  201. package/lib/commonjs/ui/context/silentSessionRestore.js.map +0 -1
  202. package/lib/commonjs/ui/hooks/useWebSSO.js +0 -28
  203. package/lib/commonjs/ui/hooks/useWebSSO.js.map +0 -1
  204. package/lib/commonjs/ui/session/projectSessionState.js +0 -86
  205. package/lib/commonjs/ui/session/projectSessionState.js.map +0 -1
  206. package/lib/commonjs/ui/session/sessionClientHost.js +0 -30
  207. package/lib/commonjs/ui/session/sessionClientHost.js.map +0 -1
  208. package/lib/commonjs/ui/utils/activeAuthuser.js +0 -142
  209. package/lib/commonjs/ui/utils/activeAuthuser.js.map +0 -1
  210. package/lib/commonjs/utils/crossApex.js +0 -74
  211. package/lib/commonjs/utils/crossApex.js.map +0 -1
  212. package/lib/module/ui/context/inSessionTokenRefresh.js +0 -238
  213. package/lib/module/ui/context/inSessionTokenRefresh.js.map +0 -1
  214. package/lib/module/ui/context/silentSessionRestore.js +0 -53
  215. package/lib/module/ui/context/silentSessionRestore.js.map +0 -1
  216. package/lib/module/ui/hooks/useWebSSO.js +0 -24
  217. package/lib/module/ui/hooks/useWebSSO.js.map +0 -1
  218. package/lib/module/ui/session/projectSessionState.js +0 -79
  219. package/lib/module/ui/session/projectSessionState.js.map +0 -1
  220. package/lib/module/ui/session/sessionClientHost.js +0 -26
  221. package/lib/module/ui/session/sessionClientHost.js.map +0 -1
  222. package/lib/module/ui/utils/activeAuthuser.js +0 -134
  223. package/lib/module/ui/utils/activeAuthuser.js.map +0 -1
  224. package/lib/module/utils/crossApex.js +0 -69
  225. package/lib/module/utils/crossApex.js.map +0 -1
  226. package/lib/typescript/commonjs/ui/context/inSessionTokenRefresh.d.ts +0 -106
  227. package/lib/typescript/commonjs/ui/context/inSessionTokenRefresh.d.ts.map +0 -1
  228. package/lib/typescript/commonjs/ui/context/silentSessionRestore.d.ts +0 -36
  229. package/lib/typescript/commonjs/ui/context/silentSessionRestore.d.ts.map +0 -1
  230. package/lib/typescript/commonjs/ui/hooks/useWebSSO.d.ts +0 -19
  231. package/lib/typescript/commonjs/ui/hooks/useWebSSO.d.ts.map +0 -1
  232. package/lib/typescript/commonjs/ui/session/projectSessionState.d.ts +0 -45
  233. package/lib/typescript/commonjs/ui/session/projectSessionState.d.ts.map +0 -1
  234. package/lib/typescript/commonjs/ui/session/sessionClientHost.d.ts +0 -14
  235. package/lib/typescript/commonjs/ui/session/sessionClientHost.d.ts.map +0 -1
  236. package/lib/typescript/commonjs/ui/utils/activeAuthuser.d.ts +0 -67
  237. package/lib/typescript/commonjs/ui/utils/activeAuthuser.d.ts.map +0 -1
  238. package/lib/typescript/commonjs/utils/crossApex.d.ts +0 -55
  239. package/lib/typescript/commonjs/utils/crossApex.d.ts.map +0 -1
  240. package/lib/typescript/module/ui/context/inSessionTokenRefresh.d.ts +0 -106
  241. package/lib/typescript/module/ui/context/inSessionTokenRefresh.d.ts.map +0 -1
  242. package/lib/typescript/module/ui/context/silentSessionRestore.d.ts +0 -36
  243. package/lib/typescript/module/ui/context/silentSessionRestore.d.ts.map +0 -1
  244. package/lib/typescript/module/ui/hooks/useWebSSO.d.ts +0 -19
  245. package/lib/typescript/module/ui/hooks/useWebSSO.d.ts.map +0 -1
  246. package/lib/typescript/module/ui/session/projectSessionState.d.ts +0 -45
  247. package/lib/typescript/module/ui/session/projectSessionState.d.ts.map +0 -1
  248. package/lib/typescript/module/ui/session/sessionClientHost.d.ts +0 -14
  249. package/lib/typescript/module/ui/session/sessionClientHost.d.ts.map +0 -1
  250. package/lib/typescript/module/ui/utils/activeAuthuser.d.ts +0 -67
  251. package/lib/typescript/module/ui/utils/activeAuthuser.d.ts.map +0 -1
  252. package/lib/typescript/module/utils/crossApex.d.ts +0 -55
  253. package/lib/typescript/module/utils/crossApex.d.ts.map +0 -1
  254. package/src/ui/context/inSessionTokenRefresh.ts +0 -264
  255. package/src/ui/context/silentSessionRestore.ts +0 -53
  256. package/src/ui/hooks/useWebSSO.ts +0 -23
  257. package/src/ui/session/__tests__/projectSessionState.test.ts +0 -114
  258. package/src/ui/session/__tests__/sessionClientHost.test.ts +0 -43
  259. package/src/ui/session/projectSessionState.ts +0 -85
  260. package/src/ui/session/sessionClientHost.ts +0 -27
  261. package/src/ui/utils/activeAuthuser.ts +0 -142
  262. package/src/utils/crossApex.ts +0 -75
@@ -1 +1 @@
1
- {"version":3,"file":"EditProfileFieldScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/EditProfileFieldScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAYzE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAqB,CAAC;AAa3D;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACtB,aAAa,GACb,UAAU,GACV,OAAO,GACP,KAAK,GACL,OAAO,GACP,SAAS,GACT,UAAU,GACV,UAAU,GACV,WAAW,GACX,OAAO,CAAC;AAmBd,UAAU,2BAA4B,SAAQ,eAAe;IACzD,6BAA6B;IAC7B,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAChC;;AAihBD,wBAAkD"}
1
+ {"version":3,"file":"EditProfileFieldScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/EditProfileFieldScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAY9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAqB,CAAC;AAe3D;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACtB,aAAa,GACb,UAAU,GACV,OAAO,GACP,KAAK,GACL,OAAO,GACP,SAAS,GACT,UAAU,GACV,UAAU,GACV,WAAW,GACX,OAAO,CAAC;AAmBd,UAAU,2BAA4B,SAAQ,eAAe;IACzD,6BAA6B;IAC7B,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAChC;;AAmjBD,wBAAkD"}
@@ -0,0 +1,14 @@
1
+ import type React from 'react';
2
+ import type { BaseScreenProps } from '../types/navigation.js';
3
+ /**
4
+ * EditProfileScreen — the profile-editing HUB.
5
+ *
6
+ * Lists every editable profile field as its own row; each row deep-links into
7
+ * {@link EditProfileFieldScreen} with the matching `fieldType`. The avatar row
8
+ * reuses the exact same `openAvatarPicker` entry point that
9
+ * {@link ManageAccountScreen} uses. This is the single entry into per-field
10
+ * editing — reached from ManageAccount's "Edit profile" row.
11
+ */
12
+ declare const EditProfileScreen: React.FC<BaseScreenProps>;
13
+ export default EditProfileScreen;
14
+ //# sourceMappingURL=EditProfileScreen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditProfileScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/EditProfileScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAqB,CAAC;AAQ3D;;;;;;;;GAQG;AACH,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAgIhD,CAAC;AAEF,eAAe,iBAAiB,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 AccountMenu} — keep these concerns separate.
9
+ * surface lives in {@link AccountSwitcher} — 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,CA+5BlD,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,CA25BlD,CAAC;AA+BF,eAAe,mBAAmB,CAAC"}
@@ -1,18 +1,19 @@
1
1
  /**
2
- * OxyAuthScreen - Sign in with Oxy (native bottom-sheet container)
2
+ * OxyAuthScreen Sign in with Oxy (native bottom-sheet container).
3
3
  *
4
- * Used by OTHER apps in the Oxy ecosystem to authenticate users. The primary
5
- * action is the one-tap "Continue with Oxy" approval flow (opens the Oxy Auth
6
- * web flow with a deep-link `redirect_uri` so the app→app return path can
7
- * complete the sign-in). The QR code is demoted to a collapsed "Sign in on
8
- * another device" disclosure you can't scan your own screen.
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.
9
13
  *
10
- * ALL of the auth-session machinery (session-token creation, QR data, socket +
11
- * polling, the native deep-link return path, waiting/error/retry state, the
12
- * open-auth handler, and cleanup) lives in the shared `useOxyAuthSession` hook,
13
- * which the web `SignInModal` also consumes — neither container re-implements
14
- * the transport. The Oxy Accounts app is where users manage their cryptographic
15
- * identity; this screen should NOT be used within the Accounts app itself.
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.
16
17
  */
17
18
  import type React from 'react';
18
19
  import type { BaseScreenProps } from '../types/navigation.js';
@@ -1 +1 @@
1
- {"version":3,"file":"OxyAuthScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/OxyAuthScreen.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAqB,CAAC;AAc3D,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA6I5C,CAAC;AAEF,eAAe,aAAa,CAAC"}
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,wBAAqB,CAAC;AAmB3D,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAyR5C,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ProfileScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/ProfileScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAqB,CAAC;AAe3D,UAAU,kBAAmB,SAAQ,eAAe;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAOD,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAkS/C,CAAC;AA0CF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"ProfileScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/ProfileScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAqB,CAAC;AAe3D,UAAU,kBAAmB,SAAQ,eAAe;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAOD,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA+S/C,CAAC;AA0CF,eAAe,aAAa,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Pure link-display helpers for the profile "links" editor. Kept out of the
3
+ * screen component so the string-coercion guard can be unit-tested without
4
+ * rendering the whole React Native screen.
5
+ */
6
+ /** Strip the protocol and any trailing slash from a link URL for display. */
7
+ export declare const getLinkTitle: (url: string) => string;
8
+ /** Human-readable description for a link URL. */
9
+ export declare const getLinkDescription: (url: string) => string;
10
+ export interface LinkListItem {
11
+ id: string;
12
+ url: string;
13
+ title: string;
14
+ description: string;
15
+ }
16
+ /**
17
+ * Build editable list items from a raw links array. The array can come from
18
+ * legacy or untrusted profile data whose elements are not guaranteed to be
19
+ * strings, so each entry is coerced with `String(item ?? '')` before formatting
20
+ * — a non-string element must never crash the editor.
21
+ */
22
+ export declare function linksToListItems(links: readonly unknown[]): LinkListItem[];
23
+ //# sourceMappingURL=linkFormat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"linkFormat.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/linkFormat.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,6EAA6E;AAC7E,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,KAAG,MACW,CAAC;AAEvD,iDAAiD;AACjD,eAAO,MAAM,kBAAkB,GAAI,KAAK,MAAM,KAAG,MAA0B,CAAC;AAE5E,MAAM,WAAW,YAAY;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACvB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,OAAO,EAAE,GAAG,YAAY,EAAE,CAU1E"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Platform `AuthStateStore` for `@oxyhq/services`.
3
+ *
4
+ * The device-first session model persists the rotating refresh-token family
5
+ * head per origin (web) / per device (native). `@oxyhq/core` owns the store
6
+ * shape + logic (`createWebAuthStateStore` / `createNativeAuthStateStore`); this
7
+ * module only supplies the platform storage seam and wires the native device
8
+ * token to the SHARED keychain so every native Oxy app joins one DeviceSession:
9
+ *
10
+ * - web → `createWebAuthStateStore()` (localStorage, in-memory fallback).
11
+ * - native → `createNativeAuthStateStore(secureKV)` for the SESSION blob
12
+ * (refresh token) over `expo-secure-store` (AsyncStorage fallback), with the
13
+ * long-lived DEVICE token delegated to `KeyManager`'s shared keychain
14
+ * (`group.so.oxy.shared`) instead of per-app storage — so an in-app login on
15
+ * any native Oxy app attributes to the SAME server-side DeviceSession.
16
+ *
17
+ * `expo-secure-store` is loaded via a runtime-computed dynamic import (the same
18
+ * optional-native-module pattern `OxyProvider` uses for netinfo / keyboard
19
+ * controller), so the web bundle never pulls it and a device without it falls
20
+ * back to AsyncStorage rather than crashing.
21
+ */
22
+ import { type AuthStateStore } from '@oxyhq/core';
23
+ /**
24
+ * Build the platform {@link AuthStateStore} for this runtime.
25
+ *
26
+ * Native additionally routes the device token through the shared keychain so
27
+ * every native Oxy app shares one server-side DeviceSession; the session blob
28
+ * (refresh token) stays per-app in SecureStore. Best-effort keychain access —
29
+ * a locked/failed shared-keychain read degrades to "no device token" rather
30
+ * than throwing out of cold boot / refresh.
31
+ */
32
+ export declare function createPlatformAuthStateStore(): AuthStateStore;
33
+ //# sourceMappingURL=authStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authStore.d.ts","sourceRoot":"","sources":["../../../../../src/ui/session/authStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAIL,KAAK,cAAc,EAGpB,MAAM,aAAa,CAAC;AAmFrB;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,IAAI,cAAc,CA2C7D"}
@@ -1,14 +1,25 @@
1
- import type { OxyServices } from '@oxyhq/core';
2
- import { SessionClient } from '@oxyhq/core';
3
- import { createSessionClientHost } from './sessionClientHost.js';
1
+ import { SessionClient, createSessionClientHost, type AuthStateStore, type OxyServices } from '@oxyhq/core';
4
2
  /**
5
- * Wires a `SessionClient` for `@oxyhq/services`: builds the `SessionClientHost`
6
- * adapter (Task 1) and the platform `TokenTransport` (Task 3) over the given
7
- * `OxyServices` instance, and returns both the client and the host — the host
8
- * is returned (not just the client) so `OxyContext` (Fase 3-B) can call
9
- * `host.setCurrentAccountId(...)` as the active account changes.
3
+ * Wire a `SessionClient` for `@oxyhq/services`.
4
+ *
5
+ * The platform-agnostic parts (host adapter, client, projection helpers) live
6
+ * ONCE in `@oxyhq/core`; this thin factory only injects the pieces specific to
7
+ * the RN/Expo SDK:
8
+ *
9
+ * - `socket.io-client`'s `io`, STATICALLY imported (socket.io-client is a real
10
+ * dependency of `@oxyhq/services`) so realtime session sync never relies on
11
+ * core's lazy dynamic import of a bare specifier — bundler-fragile in
12
+ * Metro/Expo-web against the published core dist.
13
+ * - the device-first {@link createTokenTransport}, which mints a fallback token
14
+ * by rotating the persisted refresh family (`store`).
15
+ *
16
+ * `onUnauthenticated` fires when an applied device state has zero accounts (a
17
+ * device signout-all): the provider clears the persisted store + local state so
18
+ * a reload does not try to restore a dead session. The host is returned
19
+ * alongside the client so the caller can call `host.setCurrentAccountId(...)`
20
+ * as the active account changes.
10
21
  */
11
- export declare function createSessionClient(oxyServices: OxyServices): {
22
+ export declare function createSessionClient(oxyServices: OxyServices, store: AuthStateStore, onUnauthenticated?: () => void): {
12
23
  client: SessionClient;
13
24
  host: ReturnType<typeof createSessionClientHost>;
14
25
  };
@@ -1 +1 @@
1
- {"version":3,"file":"createSessionClient.d.ts","sourceRoot":"","sources":["../../../../../src/ui/session/createSessionClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAqB,CAAC;AAG9D;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,WAAW,GAAG;IAC7D,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,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,15 +1,15 @@
1
1
  /**
2
- * Session-sync integration layer (Fase 3-A) — intra-package use only.
2
+ * Session-sync integration layer — intra-package use only.
3
3
  *
4
- * These modules let `@oxyhq/services` drive the platform-agnostic
5
- * `SessionClient` (in `@oxyhq/core`): a thin host adapter over `OxyServices`,
6
- * pure `DeviceSessionState services` projection helpers, a platform token
7
- * transport, and the factory that wires them together. Nothing here is
8
- * re-exported from the package root — `OxyContext` consumes it directly in
9
- * Fase 3-B.
4
+ * `@oxyhq/core` owns the platform-agnostic `SessionClient`, its host adapter,
5
+ * and the pure `DeviceSessionState services` projection helpers; those are
6
+ * re-exported straight from core here so `OxyContext` has one import site.
7
+ * `@oxyhq/services` supplies only the two platform pieces: the thin
8
+ * `createSessionClient` factory (injects socket.io-client `io` + the
9
+ * device-first token transport) and the `AuthStateStore` factory.
10
10
  */
11
11
  export { createSessionClient } from './createSessionClient.js';
12
- export { createSessionClientHost } from './sessionClientHost.js';
13
12
  export { createTokenTransport } from './tokenTransport.js';
14
- export { accountIdsOf, activeSessionIdOf, activeUserOf, deviceStateToClientSessions, } from './projectSessionState.js';
13
+ export { createPlatformAuthStateStore } from './authStore.js';
14
+ export { createSessionClientHost, accountIdsOf, activeSessionIdOf, activeUserOf, deviceStateToClientSessions, } from '@oxyhq/core';
15
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ui/session/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAAuB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAqB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAkB,CAAC;AACxD,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,2BAA2B,GAC5B,MAAM,0BAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ui/session/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAAuB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAkB,CAAC;AACxD,OAAO,EAAE,4BAA4B,EAAE,MAAM,gBAAa,CAAC;AAC3D,OAAO,EACL,uBAAuB,EACvB,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,2BAA2B,GAC5B,MAAM,aAAa,CAAC"}
@@ -1,24 +1,18 @@
1
- import type { OxyServices, TokenTransport } from '@oxyhq/core';
1
+ import { type AuthStateStore, type OxyServices, type TokenTransport } from '@oxyhq/core';
2
2
  /**
3
- * Platform `TokenTransport` for `SessionClient`: mints an access token when
4
- * none is currently held, reusing the SAME primitives `OxyContext`'s cold
5
- * boot already relies on (never re-implemented here):
3
+ * Platform `TokenTransport` for `SessionClient` (device-first model).
6
4
  *
7
- * - web: `oxyServices.silentSignIn()` (per-apex `/auth/silent` iframe).
8
- * - native: `oxyServices.signInWithSharedIdentity()` (app-group keychain).
5
+ * `ensureActiveToken` is the fallback the client uses when a `session_state`
6
+ * push arrived WITHOUT an embedded `activeToken` and the app currently holds no
7
+ * bearer. It mints one through the ONE unified refresh path
8
+ * (`refreshPersistedSession`): rotate the persisted refresh-token family
9
+ * (`POST /auth/refresh-token`) and, on native, fall back to the shared-keychain
10
+ * re-mint. There is no FedCM/silent-iframe arm anymore — the per-origin
11
+ * persisted refresh token is the durable web credential.
9
12
  *
10
- * Both primitives plant the token internally on success (the "Sign-In Token
11
- * Planting" rule) `ensureActiveToken` never calls `setTokens` itself.
12
- *
13
- * `ensureActiveToken` treats a PRESENT token as sufficient in this phase; it
14
- * does not decode/match the token's subject against `state.activeAccountId`
15
- * (that refinement is Fase 3-B). Account switching itself is server-driven
16
- * via the `activeToken` carried in the sync envelope — this transport is
17
- * only the fallback used when the envelope carried no token.
18
- *
19
- * A failed mint is logged and swallowed: it must never throw out of
20
- * `ensureActiveToken`, since that would crash the caller (the SessionClient
21
- * socket handler in Fase 3-B).
13
+ * Concurrent pushes coalesce onto one in-flight mint. A failure is logged and
14
+ * swallowed: this method must never throw out (it runs inside the socket state
15
+ * handler).
22
16
  */
23
- export declare function createTokenTransport(oxyServices: OxyServices): TokenTransport;
17
+ export declare function createTokenTransport(oxyServices: OxyServices, store: AuthStateStore): TokenTransport;
24
18
  //# sourceMappingURL=tokenTransport.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tokenTransport.d.ts","sourceRoot":"","sources":["../../../../../src/ui/session/tokenTransport.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAI/D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,WAAW,GAAG,cAAc,CAiD7E"}
1
+ {"version":3,"file":"tokenTransport.d.ts","sourceRoot":"","sources":["../../../../../src/ui/session/tokenTransport.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,cAAc,EACpB,MAAM,aAAa,CAAC;AAGrB;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,cAAc,GACpB,cAAc,CAsChB"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Web-browser detection for `@oxyhq/services`.
3
+ *
4
+ * The predicate now lives ONCE in `@oxyhq/core` (`isWebBrowser`) so services and
5
+ * auth-sdk share the exact same DOM probe. This module re-exposes it under the
6
+ * existing internal import path so consumers stay unchanged.
7
+ */
8
+ export { isWebBrowser } from '@oxyhq/core';
9
+ //# sourceMappingURL=isWebBrowser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isWebBrowser.d.ts","sourceRoot":"","sources":["../../../../../src/ui/utils/isWebBrowser.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
@@ -30,9 +30,14 @@
30
30
  * claim->commit sequence here keeps native and web identical and
31
31
  * unit-testable.
32
32
  */
33
- import { type EstablishAfterClaimDeps, type SessionLoginResponse, type SsoEstablishClient, type User } from '@oxyhq/core';
33
+ import { type SessionLoginResponse, type User } from '@oxyhq/core';
34
34
  interface DeviceFlowClaimResult {
35
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;
36
41
  sessionId?: string;
37
42
  deviceId?: string;
38
43
  expiresAt?: string;
@@ -44,10 +49,8 @@ interface DeviceFlowClaimResult {
44
49
  * trivially unit-testable with a stub and never pulls the RN/Expo runtime into
45
50
  * a test bundle.
46
51
  *
47
- * Extends {@link SsoEstablishClient} (`requestSsoEstablishUrl`) so the WEB
48
- * post-claim durable-session hop can be driven off the same client.
49
52
  */
50
- export interface DeviceFlowClient extends SsoEstablishClient {
53
+ export interface DeviceFlowClient {
51
54
  /**
52
55
  * Exchange the device-flow `sessionToken` for the first access + refresh
53
56
  * token, planting them on the client. Single-use; replay is rejected by the
@@ -71,15 +74,14 @@ export interface CompleteDeviceFlowSignInOptions {
71
74
  * registers the account into the device's server-authoritative session set,
72
75
  * persists it durably, and hydrates the full user profile. Runs AFTER the
73
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.
74
81
  */
75
- commitSession: (session: SessionLoginResponse) => Promise<void>;
76
- /**
77
- * Injectable web seams for the post-claim durable-session establish hop
78
- * ({@link establishIdpSessionAfterClaim}). Omit in production — the defaults
79
- * resolve to `window.*` (and no-op off-web / on native). Tests inject fakes to
80
- * drive the web path deterministically.
81
- */
82
- establishDeps?: EstablishAfterClaimDeps;
82
+ commitSession: (session: SessionLoginResponse & {
83
+ refreshToken?: string;
84
+ }) => Promise<void>;
83
85
  }
84
86
  /**
85
87
  * Complete a device-flow sign-in: claim the first access token with the secret
@@ -90,6 +92,6 @@ export interface CompleteDeviceFlowSignInOptions {
90
92
  * Throws if the claim did not return a usable session, or if either the claim
91
93
  * or the commit fails; callers surface a retry UI.
92
94
  */
93
- export declare function completeDeviceFlowSignIn({ oxyServices, sessionId, sessionToken, commitSession, establishDeps, }: CompleteDeviceFlowSignInOptions): Promise<User>;
95
+ export declare function completeDeviceFlowSignIn({ oxyServices, sessionId, sessionToken, commitSession, }: CompleteDeviceFlowSignInOptions): Promise<User>;
94
96
  export {};
95
97
  //# sourceMappingURL=deviceFlowSignIn.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deviceFlowSignIn.d.ts","sourceRoot":"","sources":["../../../../src/utils/deviceFlowSignIn.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAGL,KAAK,uBAAuB,EAE5B,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,IAAI,EACV,MAAM,aAAa,CAAC;AAErB,UAAU,qBAAqB;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,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;;;;;;;;GAQG;AACH,MAAM,WAAW,gBAAiB,SAAQ,kBAAkB;IAC1D;;;;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;;;;;;OAMG;IACH,aAAa,EAAE,CAAC,OAAO,EAAE,oBAAoB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE;;;;;OAKG;IACH,aAAa,CAAC,EAAE,uBAAuB,CAAC;CACzC;AAED;;;;;;;;GAQG;AACH,wBAAsB,wBAAwB,CAAC,EAC7C,WAAW,EACX,SAAS,EACT,YAAY,EACZ,aAAa,EACb,aAAa,GACd,EAAE,+BAA+B,GAAG,OAAO,CAAC,IAAI,CAAC,CA+CjD"}
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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxyhq/services",
3
- "version": "14.0.1",
3
+ "version": "15.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.8.0"
109
+ "@oxyhq/contracts": "0.9.1"
110
110
  },
111
111
  "devDependencies": {
112
- "@oxyhq/core": "^5.4.2",
112
+ "@oxyhq/core": "^6.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": "^5.4.2",
156
+ "@oxyhq/core": "^6.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",
package/src/index.ts CHANGED
@@ -180,10 +180,6 @@ export {
180
180
  extractErrorMessage,
181
181
  } from './ui/utils/errorHandlers';
182
182
  export type { HandleAuthErrorOptions } from './ui/utils/errorHandlers';
183
- // Thrown by `signInWithPassword` / `signIn` on a cross-apex web RP, where a
184
- // direct (non-IdP) sign-in would not survive a page reload — apps catch it to
185
- // route the user to the durable "Continue with Oxy" IdP flow.
186
- export { CrossApexDirectSignInError, isCrossApexWeb } from './utils/crossApex';
187
183
 
188
184
  // ---------------------------------------------------------------------------
189
185
  // File filtering
@@ -0,0 +1,162 @@
1
+ import type React from 'react';
2
+ import { View, Text, TouchableOpacity, StyleSheet, ActivityIndicator } from 'react-native';
3
+ import { Ionicons } from '@expo/vector-icons';
4
+ import { useTheme } from '@oxyhq/bloom/theme';
5
+ import Avatar from './Avatar';
6
+ import { useI18n } from '../hooks/useI18n';
7
+ import type { SwitchableAccount } from '../hooks/useSwitchableAccounts';
8
+
9
+ export interface SignInAccountChooserProps {
10
+ /** Accounts available on this device / in the caller's graph, current first. */
11
+ accounts: SwitchableAccount[];
12
+ /** Selecting a row — the active account continues, others switch into. */
13
+ onSelectAccount: (account: SwitchableAccount) => void;
14
+ /** "Use another account" → reveal the sign-in options (password / QR / add). */
15
+ onUseAnother: () => void;
16
+ /** The account id currently being switched into (shows a per-row spinner). */
17
+ pendingAccountId?: string | null;
18
+ /** Disables every row while a selection is in flight. */
19
+ disabled?: boolean;
20
+ }
21
+
22
+ /**
23
+ * Google-style account chooser (React Native). Lists every account the user can
24
+ * continue as — device sign-ins + linked graph accounts, from
25
+ * {@link SwitchableAccount} — plus a "Use another account" affordance. Rendered
26
+ * as the FRONT screen of the sign-in surfaces (`SignInModal` web,
27
+ * `OxyAuthScreen` native) whenever accounts exist; selecting a row funnels into
28
+ * the SAME `switchToAccount` path the account switcher uses. When no accounts
29
+ * exist the surfaces skip this and show the sign-in options directly.
30
+ *
31
+ * Presentational + chrome-agnostic (no modal/sheet wrapper, no data fetching) so
32
+ * both containers reuse it and it is unit-testable in isolation.
33
+ */
34
+ export const SignInAccountChooser: React.FC<SignInAccountChooserProps> = ({
35
+ accounts,
36
+ onSelectAccount,
37
+ onUseAnother,
38
+ pendingAccountId,
39
+ disabled,
40
+ }) => {
41
+ const { colors } = useTheme();
42
+ const { t } = useI18n();
43
+
44
+ return (
45
+ <View style={styles.container}>
46
+ {accounts.map((account) => {
47
+ const isPending = pendingAccountId === account.accountId;
48
+ const secondary = account.email;
49
+ return (
50
+ <TouchableOpacity
51
+ key={account.accountId}
52
+ accessibilityRole="button"
53
+ accessibilityLabel={t('signin.chooser.continueAs', { name: account.displayName })}
54
+ accessibilityState={{ selected: account.isCurrent, disabled: Boolean(disabled) }}
55
+ onPress={() => onSelectAccount(account)}
56
+ disabled={disabled}
57
+ activeOpacity={0.7}
58
+ style={[
59
+ styles.row,
60
+ { borderColor: colors.border },
61
+ account.isCurrent && { backgroundColor: colors.primarySubtle, borderColor: colors.primarySubtle },
62
+ disabled && !isPending && styles.rowDisabled,
63
+ ]}
64
+ >
65
+ <Avatar uri={account.avatarUrl} name={account.displayName} size={44} />
66
+ <View style={styles.info}>
67
+ <Text style={[styles.name, { color: colors.text }]} numberOfLines={1}>
68
+ {account.displayName}
69
+ </Text>
70
+ {secondary ? (
71
+ <Text style={[styles.secondary, { color: colors.textSecondary }]} numberOfLines={1}>
72
+ {secondary}
73
+ </Text>
74
+ ) : null}
75
+ </View>
76
+ {isPending ? (
77
+ <ActivityIndicator size="small" color={colors.primary} />
78
+ ) : account.isCurrent ? (
79
+ <View style={[styles.currentPill, { backgroundColor: colors.card }]}>
80
+ <Ionicons name="checkmark" size={14} color={colors.primary} />
81
+ <Text style={[styles.currentPillText, { color: colors.primary }]}>
82
+ {t('signin.chooser.signedIn')}
83
+ </Text>
84
+ </View>
85
+ ) : (
86
+ <Ionicons name="chevron-forward" size={20} color={colors.textSecondary} />
87
+ )}
88
+ </TouchableOpacity>
89
+ );
90
+ })}
91
+
92
+ <TouchableOpacity
93
+ accessibilityRole="button"
94
+ accessibilityLabel={t('signin.chooser.useAnother')}
95
+ onPress={onUseAnother}
96
+ disabled={disabled}
97
+ activeOpacity={0.7}
98
+ style={[styles.row, { borderColor: colors.border }, disabled && styles.rowDisabled]}
99
+ >
100
+ <View style={[styles.addIcon, { backgroundColor: colors.backgroundSecondary }]}>
101
+ <Ionicons name="person-add-outline" size={20} color={colors.textSecondary} />
102
+ </View>
103
+ <View style={styles.info}>
104
+ <Text style={[styles.name, { color: colors.text }]}>{t('signin.chooser.useAnother')}</Text>
105
+ </View>
106
+ <Ionicons name="chevron-forward" size={20} color={colors.textSecondary} />
107
+ </TouchableOpacity>
108
+ </View>
109
+ );
110
+ };
111
+
112
+ const styles = StyleSheet.create({
113
+ container: {
114
+ width: '100%',
115
+ gap: 8,
116
+ },
117
+ row: {
118
+ flexDirection: 'row',
119
+ alignItems: 'center',
120
+ gap: 12,
121
+ borderWidth: 1,
122
+ borderRadius: 14,
123
+ paddingHorizontal: 14,
124
+ paddingVertical: 12,
125
+ },
126
+ rowDisabled: {
127
+ opacity: 0.5,
128
+ },
129
+ info: {
130
+ flex: 1,
131
+ minWidth: 0,
132
+ },
133
+ name: {
134
+ fontSize: 15,
135
+ fontWeight: '600',
136
+ },
137
+ secondary: {
138
+ fontSize: 13,
139
+ marginTop: 2,
140
+ },
141
+ currentPill: {
142
+ flexDirection: 'row',
143
+ alignItems: 'center',
144
+ gap: 3,
145
+ paddingHorizontal: 8,
146
+ paddingVertical: 3,
147
+ borderRadius: 999,
148
+ },
149
+ currentPillText: {
150
+ fontSize: 12,
151
+ fontWeight: '600',
152
+ },
153
+ addIcon: {
154
+ width: 44,
155
+ height: 44,
156
+ borderRadius: 22,
157
+ alignItems: 'center',
158
+ justifyContent: 'center',
159
+ },
160
+ });
161
+
162
+ export default SignInAccountChooser;