@oxyhq/services 16.0.0 → 18.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +77 -98
- package/lib/commonjs/index.js +40 -51
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/client.js +0 -14
- package/lib/commonjs/ui/client.js.map +1 -1
- package/lib/commonjs/ui/components/OxyAccountDialog.js +742 -0
- package/lib/commonjs/ui/components/OxyAccountDialog.js.map +1 -0
- package/lib/commonjs/ui/components/OxyConsentScreen.js +461 -0
- package/lib/commonjs/ui/components/OxyConsentScreen.js.map +1 -0
- package/lib/commonjs/ui/components/OxyProvider.js +13 -6
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/OxySignInButton.js +180 -22
- package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
- package/lib/commonjs/ui/components/ProfileButton.js +25 -112
- package/lib/commonjs/ui/components/ProfileButton.js.map +1 -1
- package/lib/commonjs/ui/components/RequireOxyAuth.js +299 -0
- package/lib/commonjs/ui/components/RequireOxyAuth.js.map +1 -0
- package/lib/commonjs/ui/components/oauthNavigation.js +73 -0
- package/lib/commonjs/ui/components/oauthNavigation.js.map +1 -0
- package/lib/commonjs/ui/context/OxyContext.js +122 -4
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js +1 -1
- package/lib/commonjs/ui/hooks/useAuth.js +19 -30
- package/lib/commonjs/ui/hooks/useAuth.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSwitchableAccounts.js +37 -267
- package/lib/commonjs/ui/hooks/useSwitchableAccounts.js.map +1 -1
- package/lib/commonjs/ui/index.js +5 -40
- package/lib/commonjs/ui/index.js.map +1 -1
- package/lib/commonjs/ui/navigation/accountDialogManager.js +91 -0
- package/lib/commonjs/ui/navigation/accountDialogManager.js.map +1 -0
- package/lib/commonjs/ui/navigation/routes.js +0 -2
- package/lib/commonjs/ui/navigation/routes.js.map +1 -1
- package/lib/commonjs/ui/screens/ManageAccountScreen.js +4 -3
- package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/session/createSessionClient.js +10 -2
- package/lib/commonjs/ui/session/createSessionClient.js.map +1 -1
- package/lib/module/index.js +19 -16
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/client.js +1 -2
- package/lib/module/ui/client.js.map +1 -1
- package/lib/module/ui/components/OxyAccountDialog.js +739 -0
- package/lib/module/ui/components/OxyAccountDialog.js.map +1 -0
- package/lib/module/ui/components/OxyConsentScreen.js +454 -0
- package/lib/module/ui/components/OxyConsentScreen.js.map +1 -0
- package/lib/module/ui/components/OxyProvider.js +13 -6
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/OxySignInButton.js +181 -22
- package/lib/module/ui/components/OxySignInButton.js.map +1 -1
- package/lib/module/ui/components/ProfileButton.js +26 -112
- package/lib/module/ui/components/ProfileButton.js.map +1 -1
- package/lib/module/ui/components/RequireOxyAuth.js +294 -0
- package/lib/module/ui/components/RequireOxyAuth.js.map +1 -0
- package/lib/module/ui/components/oauthNavigation.js +70 -0
- package/lib/module/ui/components/oauthNavigation.js.map +1 -0
- package/lib/module/ui/context/OxyContext.js +123 -5
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/hooks/mutations/useAccountMutations.js +1 -1
- package/lib/module/ui/hooks/useAuth.js +19 -30
- package/lib/module/ui/hooks/useAuth.js.map +1 -1
- package/lib/module/ui/hooks/useSwitchableAccounts.js +38 -267
- package/lib/module/ui/hooks/useSwitchableAccounts.js.map +1 -1
- package/lib/module/ui/index.js +1 -5
- package/lib/module/ui/index.js.map +1 -1
- package/lib/module/ui/navigation/accountDialogManager.js +81 -0
- package/lib/module/ui/navigation/accountDialogManager.js.map +1 -0
- package/lib/module/ui/navigation/routes.js +0 -2
- package/lib/module/ui/navigation/routes.js.map +1 -1
- package/lib/module/ui/screens/ManageAccountScreen.js +4 -3
- package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/module/ui/session/createSessionClient.js +10 -2
- package/lib/module/ui/session/createSessionClient.js.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +8 -12
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/client.d.ts +0 -4
- package/lib/typescript/commonjs/ui/client.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyAccountDialog.d.ts +51 -0
- package/lib/typescript/commonjs/ui/components/OxyAccountDialog.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/OxyConsentScreen.d.ts +45 -0
- package/lib/typescript/commonjs/ui/components/OxyConsentScreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts +2 -2
- package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts +56 -0
- package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts +11 -23
- package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/RequireOxyAuth.d.ts +55 -0
- package/lib/typescript/commonjs/ui/components/RequireOxyAuth.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/oauthNavigation.d.ts +36 -0
- package/lib/typescript/commonjs/ui/components/oauthNavigation.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts +27 -1
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/useServicesQueries.d.ts +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/useServicesQueries.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useSwitchableAccounts.d.ts +13 -152
- package/lib/typescript/commonjs/ui/hooks/useSwitchableAccounts.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/index.d.ts +2 -5
- package/lib/typescript/commonjs/ui/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts +49 -0
- package/lib/typescript/commonjs/ui/navigation/accountDialogManager.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/navigation/routes.d.ts +1 -1
- package/lib/typescript/commonjs/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts +1 -1
- package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts +9 -2
- package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/types/navigation.d.ts +27 -0
- package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +8 -12
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/client.d.ts +0 -4
- package/lib/typescript/module/ui/client.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyAccountDialog.d.ts +51 -0
- package/lib/typescript/module/ui/components/OxyAccountDialog.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/OxyConsentScreen.d.ts +45 -0
- package/lib/typescript/module/ui/components/OxyConsentScreen.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/OxyProvider.d.ts +2 -2
- package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxySignInButton.d.ts +56 -0
- package/lib/typescript/module/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ProfileButton.d.ts +11 -23
- package/lib/typescript/module/ui/components/ProfileButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/RequireOxyAuth.d.ts +55 -0
- package/lib/typescript/module/ui/components/RequireOxyAuth.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/oauthNavigation.d.ts +36 -0
- package/lib/typescript/module/ui/components/oauthNavigation.d.ts.map +1 -0
- package/lib/typescript/module/ui/context/OxyContext.d.ts +27 -1
- package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/useServicesQueries.d.ts +1 -1
- package/lib/typescript/module/ui/hooks/queries/useServicesQueries.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useSwitchableAccounts.d.ts +13 -152
- package/lib/typescript/module/ui/hooks/useSwitchableAccounts.d.ts.map +1 -1
- package/lib/typescript/module/ui/index.d.ts +2 -5
- package/lib/typescript/module/ui/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts +49 -0
- package/lib/typescript/module/ui/navigation/accountDialogManager.d.ts.map +1 -0
- package/lib/typescript/module/ui/navigation/routes.d.ts +1 -1
- package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/session/createSessionClient.d.ts +9 -2
- package/lib/typescript/module/ui/session/createSessionClient.d.ts.map +1 -1
- package/lib/typescript/module/ui/types/navigation.d.ts +27 -0
- package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +33 -27
- package/src/ui/client.ts +0 -4
- package/src/ui/components/OxyAccountDialog.tsx +735 -0
- package/src/ui/components/OxyConsentScreen.tsx +456 -0
- package/src/ui/components/OxyProvider.tsx +14 -6
- package/src/ui/components/OxySignInButton.tsx +227 -22
- package/src/ui/components/ProfileButton.tsx +23 -126
- package/src/ui/components/RequireOxyAuth.tsx +266 -0
- package/src/ui/components/__tests__/OxyConsentScreen.test.tsx +130 -0
- package/src/ui/components/oauthNavigation.ts +89 -0
- package/src/ui/context/OxyContext.tsx +176 -9
- package/src/ui/context/__tests__/OxyContext.coldBoot.test.tsx +165 -0
- package/src/ui/hooks/mutations/useAccountMutations.ts +1 -1
- package/src/ui/hooks/useAuth.ts +19 -31
- package/src/ui/hooks/useSwitchableAccounts.ts +42 -376
- package/src/ui/index.ts +2 -5
- package/src/ui/navigation/accountDialogManager.ts +84 -0
- package/src/ui/navigation/routes.ts +0 -4
- package/src/ui/screens/ManageAccountScreen.tsx +3 -2
- package/src/ui/session/createSessionClient.ts +9 -1
- package/src/ui/types/navigation.ts +27 -0
- package/lib/commonjs/ui/components/AccountMenu.js +0 -598
- package/lib/commonjs/ui/components/AccountMenu.js.map +0 -1
- package/lib/commonjs/ui/components/AccountMenuButton.js +0 -135
- package/lib/commonjs/ui/components/AccountMenuButton.js.map +0 -1
- package/lib/commonjs/ui/components/AccountSwitcher.js +0 -780
- package/lib/commonjs/ui/components/AccountSwitcher.js.map +0 -1
- package/lib/commonjs/ui/components/AnotherDeviceQR.js +0 -116
- package/lib/commonjs/ui/components/AnotherDeviceQR.js.map +0 -1
- package/lib/commonjs/ui/components/ProfileMenu.js +0 -518
- package/lib/commonjs/ui/components/ProfileMenu.js.map +0 -1
- package/lib/commonjs/ui/components/SignInAccountChooser.js +0 -189
- package/lib/commonjs/ui/components/SignInAccountChooser.js.map +0 -1
- package/lib/commonjs/ui/components/SignInModal.js +0 -600
- package/lib/commonjs/ui/components/SignInModal.js.map +0 -1
- package/lib/commonjs/ui/hooks/useOxyAuthSession.js +0 -501
- package/lib/commonjs/ui/hooks/useOxyAuthSession.js.map +0 -1
- package/lib/commonjs/ui/hooks/usePasswordSignIn.js +0 -170
- package/lib/commonjs/ui/hooks/usePasswordSignIn.js.map +0 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +0 -51
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +0 -1
- package/lib/commonjs/ui/screens/OxyAuthScreen.js +0 -312
- package/lib/commonjs/ui/screens/OxyAuthScreen.js.map +0 -1
- package/lib/commonjs/utils/deviceFlowSignIn.js +0 -109
- package/lib/commonjs/utils/deviceFlowSignIn.js.map +0 -1
- package/lib/module/ui/components/AccountMenu.js +0 -593
- package/lib/module/ui/components/AccountMenu.js.map +0 -1
- package/lib/module/ui/components/AccountMenuButton.js +0 -130
- package/lib/module/ui/components/AccountMenuButton.js.map +0 -1
- package/lib/module/ui/components/AccountSwitcher.js +0 -774
- package/lib/module/ui/components/AccountSwitcher.js.map +0 -1
- package/lib/module/ui/components/AnotherDeviceQR.js +0 -110
- package/lib/module/ui/components/AnotherDeviceQR.js.map +0 -1
- package/lib/module/ui/components/ProfileMenu.js +0 -514
- package/lib/module/ui/components/ProfileMenu.js.map +0 -1
- package/lib/module/ui/components/SignInAccountChooser.js +0 -183
- package/lib/module/ui/components/SignInAccountChooser.js.map +0 -1
- package/lib/module/ui/components/SignInModal.js +0 -591
- package/lib/module/ui/components/SignInModal.js.map +0 -1
- package/lib/module/ui/hooks/useOxyAuthSession.js +0 -495
- package/lib/module/ui/hooks/useOxyAuthSession.js.map +0 -1
- package/lib/module/ui/hooks/usePasswordSignIn.js +0 -165
- package/lib/module/ui/hooks/usePasswordSignIn.js.map +0 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +0 -48
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +0 -1
- package/lib/module/ui/screens/OxyAuthScreen.js +0 -306
- package/lib/module/ui/screens/OxyAuthScreen.js.map +0 -1
- package/lib/module/utils/deviceFlowSignIn.js +0 -106
- package/lib/module/utils/deviceFlowSignIn.js.map +0 -1
- package/lib/typescript/commonjs/ui/components/AccountMenu.d.ts +0 -47
- package/lib/typescript/commonjs/ui/components/AccountMenu.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/AccountMenuButton.d.ts +0 -26
- package/lib/typescript/commonjs/ui/components/AccountMenuButton.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/AccountSwitcher.d.ts +0 -46
- package/lib/typescript/commonjs/ui/components/AccountSwitcher.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/AnotherDeviceQR.d.ts +0 -34
- package/lib/typescript/commonjs/ui/components/AnotherDeviceQR.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/ProfileMenu.d.ts +0 -49
- package/lib/typescript/commonjs/ui/components/ProfileMenu.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/SignInAccountChooser.d.ts +0 -29
- package/lib/typescript/commonjs/ui/components/SignInAccountChooser.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/SignInModal.d.ts +0 -28
- package/lib/typescript/commonjs/ui/components/SignInModal.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/hooks/useOxyAuthSession.d.ts +0 -105
- package/lib/typescript/commonjs/ui/hooks/useOxyAuthSession.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/hooks/usePasswordSignIn.d.ts +0 -31
- package/lib/typescript/commonjs/ui/hooks/usePasswordSignIn.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/screens/AccountSwitcherScreen.d.ts +0 -11
- package/lib/typescript/commonjs/ui/screens/AccountSwitcherScreen.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts +0 -22
- package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts.map +0 -1
- package/lib/typescript/commonjs/utils/deviceFlowSignIn.d.ts +0 -97
- package/lib/typescript/commonjs/utils/deviceFlowSignIn.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/AccountMenu.d.ts +0 -47
- package/lib/typescript/module/ui/components/AccountMenu.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/AccountMenuButton.d.ts +0 -26
- package/lib/typescript/module/ui/components/AccountMenuButton.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/AccountSwitcher.d.ts +0 -46
- package/lib/typescript/module/ui/components/AccountSwitcher.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/AnotherDeviceQR.d.ts +0 -34
- package/lib/typescript/module/ui/components/AnotherDeviceQR.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/ProfileMenu.d.ts +0 -49
- package/lib/typescript/module/ui/components/ProfileMenu.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/SignInAccountChooser.d.ts +0 -29
- package/lib/typescript/module/ui/components/SignInAccountChooser.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/SignInModal.d.ts +0 -28
- package/lib/typescript/module/ui/components/SignInModal.d.ts.map +0 -1
- package/lib/typescript/module/ui/hooks/useOxyAuthSession.d.ts +0 -105
- package/lib/typescript/module/ui/hooks/useOxyAuthSession.d.ts.map +0 -1
- package/lib/typescript/module/ui/hooks/usePasswordSignIn.d.ts +0 -31
- package/lib/typescript/module/ui/hooks/usePasswordSignIn.d.ts.map +0 -1
- package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts +0 -11
- package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts.map +0 -1
- package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts +0 -22
- package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts.map +0 -1
- package/lib/typescript/module/utils/deviceFlowSignIn.d.ts +0 -97
- package/lib/typescript/module/utils/deviceFlowSignIn.d.ts.map +0 -1
- package/src/ui/components/AccountMenu.tsx +0 -645
- package/src/ui/components/AccountMenuButton.tsx +0 -126
- package/src/ui/components/AccountSwitcher.tsx +0 -751
- package/src/ui/components/AnotherDeviceQR.tsx +0 -119
- package/src/ui/components/ProfileMenu.tsx +0 -564
- package/src/ui/components/SignInAccountChooser.tsx +0 -162
- package/src/ui/components/SignInModal.tsx +0 -530
- package/src/ui/hooks/useOxyAuthSession.ts +0 -635
- package/src/ui/hooks/usePasswordSignIn.ts +0 -207
- package/src/ui/screens/AccountSwitcherScreen.tsx +0 -43
- package/src/ui/screens/OxyAuthScreen.tsx +0 -324
- package/src/utils/__tests__/deviceFlowSignIn.test.ts +0 -231
- package/src/utils/deviceFlowSignIn.ts +0 -152
package/README.md
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
# @oxyhq/services
|
|
2
2
|
|
|
3
|
-
A comprehensive TypeScript UI library for the Oxy API providing authentication, user management, and UI components for React Native and
|
|
3
|
+
A comprehensive TypeScript UI library for the Oxy API providing authentication, user management, and UI components for React Native, Expo, and web (React Native Web) applications.
|
|
4
4
|
|
|
5
|
-
**
|
|
6
|
-
|
|
7
|
-
> **For web apps (Vite, Next.js, CRA):** Use [`@oxyhq/auth`](../auth) for authentication and [`@oxyhq/core`](../core) for types and services.
|
|
5
|
+
> **For web apps (Vite + React Native Web):** Use this same package — `OxyProvider` is universal. See the [Platform Guide](./PLATFORM_GUIDE.md).
|
|
8
6
|
>
|
|
9
|
-
> **For backend / Node.js:** Use [`@oxyhq/core`](../core) only.
|
|
7
|
+
> **For backend / Node.js:** Use [`@oxyhq/core`](../core) only (`@oxyhq/core/server` for auth middleware).
|
|
10
8
|
>
|
|
11
9
|
> **For the full platform guide:** See [PLATFORM_GUIDE.md](./PLATFORM_GUIDE.md).
|
|
12
10
|
|
|
@@ -28,8 +26,8 @@ A comprehensive TypeScript UI library for the Oxy API providing authentication,
|
|
|
28
26
|
## Features
|
|
29
27
|
|
|
30
28
|
- **Zero-Config Authentication**: Automatic token management and refresh
|
|
31
|
-
- **
|
|
32
|
-
- **Universal Provider**: Single `OxyProvider` works on iOS, Android, and
|
|
29
|
+
- **Device-First Sessions**: Sign in once per device; every Oxy app on the device restores silently and syncs account changes live over Socket.IO
|
|
30
|
+
- **Universal Provider**: Single `OxyProvider` works on iOS, Android, Expo Web, and React Native Web
|
|
33
31
|
- **UI Components**: Pre-built components for auth, profiles, and more
|
|
34
32
|
- **Inter Font Included**: Default Oxy ecosystem font with automatic loading
|
|
35
33
|
- **Cross-Platform**: Works in Expo and React Native (iOS, Android, Web)
|
|
@@ -44,11 +42,11 @@ The OxyHQ SDK is split into three packages:
|
|
|
44
42
|
|
|
45
43
|
| Package | Use Case | Dependencies |
|
|
46
44
|
|---------|----------|--------------|
|
|
47
|
-
| `@oxyhq/services` | Expo / React Native
|
|
48
|
-
| `@oxyhq/
|
|
49
|
-
| `@oxyhq/
|
|
45
|
+
| `@oxyhq/services` | Expo / React Native / Web (React Native Web) | Full (RN, Expo) |
|
|
46
|
+
| `@oxyhq/core` | All platforms (types, API client, crypto, server middleware) | None |
|
|
47
|
+
| `@oxyhq/contracts` | Shared API schemas (Zod) | zod only |
|
|
50
48
|
|
|
51
|
-
This package (`@oxyhq/services`) is
|
|
49
|
+
This package (`@oxyhq/services`) is the **single UI SDK** for every React surface. It provides `OxyProvider`, the unified account dialog, UI components, screens, bottom sheet routing, fonts, and hooks.
|
|
52
50
|
|
|
53
51
|
See [PLATFORM_GUIDE.md](./PLATFORM_GUIDE.md) for the complete architecture guide.
|
|
54
52
|
|
|
@@ -95,7 +93,10 @@ import { OxyProvider, useAuth } from '@oxyhq/services';
|
|
|
95
93
|
|
|
96
94
|
function App() {
|
|
97
95
|
return (
|
|
98
|
-
<OxyProvider
|
|
96
|
+
<OxyProvider
|
|
97
|
+
baseURL="https://api.oxy.so"
|
|
98
|
+
clientId={process.env.EXPO_PUBLIC_OXY_CLIENT_ID}
|
|
99
|
+
>
|
|
99
100
|
<YourApp />
|
|
100
101
|
</OxyProvider>
|
|
101
102
|
);
|
|
@@ -246,7 +247,7 @@ import { OxyProvider } from '@oxyhq/services';
|
|
|
246
247
|
|
|
247
248
|
function App() {
|
|
248
249
|
return (
|
|
249
|
-
<OxyProvider baseURL="https://
|
|
250
|
+
<OxyProvider baseURL="https://api.oxy.so">
|
|
250
251
|
<YourApp />
|
|
251
252
|
</OxyProvider>
|
|
252
253
|
);
|
|
@@ -384,22 +385,24 @@ const {
|
|
|
384
385
|
user,
|
|
385
386
|
isAuthenticated,
|
|
386
387
|
isLoading,
|
|
388
|
+
canUsePrivateApi, // Gate private API calls on this
|
|
389
|
+
isPrivateApiPending,
|
|
387
390
|
error,
|
|
388
391
|
|
|
389
|
-
// Identity
|
|
390
|
-
createIdentity, // Create new identity with recovery phrase
|
|
391
|
-
importIdentity, // Import identity from recovery phrase
|
|
392
|
+
// Identity (public-key auth; identities are created in Commons by Oxy)
|
|
392
393
|
signIn, // Sign in with stored identity
|
|
393
394
|
hasIdentity, // Check if identity exists on device
|
|
394
395
|
getPublicKey, // Get stored public key
|
|
395
396
|
|
|
396
|
-
//
|
|
397
|
-
|
|
397
|
+
// Account dialog (switcher + sign-in)
|
|
398
|
+
openAccountDialog,
|
|
399
|
+
closeAccountDialog,
|
|
398
400
|
|
|
399
401
|
// Session management
|
|
402
|
+
logout,
|
|
400
403
|
sessions,
|
|
401
404
|
activeSessionId,
|
|
402
|
-
|
|
405
|
+
switchToAccount, // Switch active account (device session + account graph)
|
|
403
406
|
removeSession
|
|
404
407
|
} = useOxy();
|
|
405
408
|
```
|
|
@@ -410,7 +413,8 @@ const {
|
|
|
410
413
|
|
|
411
414
|
```typescript
|
|
412
415
|
<OxyProvider
|
|
413
|
-
baseURL="https://api.oxy.so"
|
|
416
|
+
baseURL="https://api.oxy.so" // API base URL
|
|
417
|
+
clientId="oxy_dk_..." // Registered Application credential (Oxy Console)
|
|
414
418
|
storageKeyPrefix="oxy_session" // Storage key prefix
|
|
415
419
|
onAuthStateChange={(user) => {}} // Auth state callback
|
|
416
420
|
onError={(error) => {}} // Error callback
|
|
@@ -424,6 +428,7 @@ const {
|
|
|
424
428
|
```bash
|
|
425
429
|
# .env
|
|
426
430
|
EXPO_PUBLIC_API_URL=https://api.oxy.so
|
|
431
|
+
EXPO_PUBLIC_OXY_CLIENT_ID=oxy_dk_...
|
|
427
432
|
```
|
|
428
433
|
|
|
429
434
|
### Custom Configuration
|
|
@@ -432,46 +437,33 @@ EXPO_PUBLIC_API_URL=https://api.oxy.so
|
|
|
432
437
|
import { OxyServices } from '@oxyhq/core';
|
|
433
438
|
|
|
434
439
|
const oxy = new OxyServices({
|
|
435
|
-
baseURL: process.env.OXY_API_URL || 'https://
|
|
440
|
+
baseURL: process.env.OXY_API_URL || 'https://api.oxy.so'
|
|
436
441
|
});
|
|
437
442
|
```
|
|
438
443
|
|
|
439
444
|
## Authentication
|
|
440
445
|
|
|
441
|
-
Oxy supports **public/private key cryptography** (ECDSA secp256k1) as the primary identity system, with optional password-based accounts
|
|
442
|
-
|
|
443
|
-
### Public Key Authentication
|
|
444
|
-
|
|
445
|
-
```typescript
|
|
446
|
-
import { useOxy } from '@oxyhq/services';
|
|
446
|
+
Oxy supports **public/private key cryptography** (ECDSA secp256k1) as the primary identity system, with optional password-based accounts. Users create and manage their cryptographic identity in the **Commons by Oxy** app (the native identity vault); every app integrates the same **"Sign in with Oxy"** surface.
|
|
447
447
|
|
|
448
|
-
|
|
449
|
-
const { createIdentity, importIdentity, signIn, hasIdentity } = useOxy();
|
|
448
|
+
### How it works (device-first)
|
|
450
449
|
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
// Show recoveryPhrase to user - they must save it!
|
|
455
|
-
};
|
|
450
|
+
- **Cold boot is silent.** On mount, `OxyProvider` restores the ambient device session — the server-side `DeviceSession` records which accounts are signed in on this device and which one is active. No redirects, no browser identity APIs, no UI. See [device sessions](../../docs/auth/device-session.md).
|
|
451
|
+
- **Interactive sign-in is a dialog.** `useAuth().signIn()` or `useOxy().openAccountDialog('signin')` opens the unified account dialog (Bloom Dialog — bottom sheet on phones, centered on desktop): account switcher, Sign in with Oxy via the Oxy app (QR on web, deep link / shared keychain on native), and a collapsed password form.
|
|
452
|
+
- **Cross-app sync.** Adding, switching, or signing out an account bumps the device-session revision and is pushed over the `session_state` socket event to every Oxy app on the device.
|
|
456
453
|
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
const user = await importIdentity(phrase, 'username', 'email');
|
|
460
|
-
};
|
|
454
|
+
```tsx
|
|
455
|
+
import { useAuth } from '@oxyhq/services';
|
|
461
456
|
|
|
462
|
-
|
|
463
|
-
const
|
|
464
|
-
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
// Check if identity exists
|
|
468
|
-
const hasStoredIdentity = await hasIdentity();
|
|
457
|
+
function SignInCTA() {
|
|
458
|
+
const { isAuthenticated, signIn } = useAuth();
|
|
459
|
+
if (isAuthenticated) return null;
|
|
460
|
+
return <Button title="Sign in" onPress={() => signIn()} />; // opens the dialog
|
|
469
461
|
}
|
|
470
462
|
```
|
|
471
463
|
|
|
472
|
-
### Password Authentication
|
|
464
|
+
### Password Authentication
|
|
473
465
|
|
|
474
|
-
|
|
466
|
+
Oxy also supports password sign-in (email/username + password) — shown collapsed inside the account dialog, or callable directly:
|
|
475
467
|
|
|
476
468
|
```typescript
|
|
477
469
|
import { oxyClient } from '@oxyhq/core';
|
|
@@ -482,9 +474,9 @@ const session2 = await oxyClient.signIn('username-or-email', 'password');
|
|
|
482
474
|
|
|
483
475
|
### Cross-App Authentication (Sign in with Oxy)
|
|
484
476
|
|
|
485
|
-
|
|
477
|
+
`OxySignInButton` resolves your registered Application (`GET /auth/oauth/client/:clientId`) and picks the right flow:
|
|
486
478
|
|
|
487
|
-
```
|
|
479
|
+
```tsx
|
|
488
480
|
import { OxySignInButton } from '@oxyhq/services';
|
|
489
481
|
|
|
490
482
|
function LoginScreen() {
|
|
@@ -492,11 +484,10 @@ function LoginScreen() {
|
|
|
492
484
|
}
|
|
493
485
|
```
|
|
494
486
|
|
|
495
|
-
|
|
496
|
-
-
|
|
497
|
-
- A button to open Oxy Accounts directly via deep link
|
|
487
|
+
- **Official Oxy apps** (`isOfficial` / first-party types): opens the in-app account dialog.
|
|
488
|
+
- **Third-party apps** (`type: 'third_party'`): starts the standard OAuth 2.0 Authorization Code + PKCE redirect to `auth.oxy.so` (the SDK generates `state` + PKCE via `@oxyhq/core`). Pass `oauthRedirectUri`; on native handle `onOAuthResult` to complete the token exchange.
|
|
498
489
|
|
|
499
|
-
|
|
490
|
+
See the [integration guide](../../docs/auth/integration-guide.md) for Console registration, OAuth endpoints, and backend verification, and [AUTHENTICATION.md](../../docs/AUTHENTICATION.md) for the full model.
|
|
500
491
|
|
|
501
492
|
### Documentation
|
|
502
493
|
|
|
@@ -533,9 +524,30 @@ const styles = StyleSheet.create({
|
|
|
533
524
|
});
|
|
534
525
|
```
|
|
535
526
|
|
|
527
|
+
### Account Dialog (auth + switcher)
|
|
528
|
+
|
|
529
|
+
Sign-in and account switching do **not** use the bottom sheet — they live in the unified account dialog:
|
|
530
|
+
|
|
531
|
+
```typescript
|
|
532
|
+
import { useOxy } from '@oxyhq/services';
|
|
533
|
+
|
|
534
|
+
function MyComponent() {
|
|
535
|
+
const { openAccountDialog } = useOxy();
|
|
536
|
+
|
|
537
|
+
return (
|
|
538
|
+
<Button
|
|
539
|
+
onPress={() => openAccountDialog('signin')}
|
|
540
|
+
title="Sign in with Oxy"
|
|
541
|
+
/>
|
|
542
|
+
);
|
|
543
|
+
}
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
Views: `'accounts'` (switcher, default), `'signin'`, `'qr'`, `'add'`. The exported `ProfileButton` component opens it for you.
|
|
547
|
+
|
|
536
548
|
### Bottom Sheet Routing System
|
|
537
549
|
|
|
538
|
-
The bottom sheet routing system provides a clean, professional way to display
|
|
550
|
+
The bottom sheet routing system provides a clean, professional way to display account management and other non-auth UI flows within a modal bottom sheet.
|
|
539
551
|
|
|
540
552
|
**Quick Example:**
|
|
541
553
|
|
|
@@ -547,8 +559,8 @@ function MyComponent() {
|
|
|
547
559
|
|
|
548
560
|
return (
|
|
549
561
|
<Button
|
|
550
|
-
onPress={() => showBottomSheet('
|
|
551
|
-
title="
|
|
562
|
+
onPress={() => showBottomSheet('ManageAccount')}
|
|
563
|
+
title="Manage account"
|
|
552
564
|
/>
|
|
553
565
|
);
|
|
554
566
|
}
|
|
@@ -563,41 +575,10 @@ function MyComponent() {
|
|
|
563
575
|
- 25+ pre-built screens available
|
|
564
576
|
|
|
565
577
|
**Available Screens:**
|
|
566
|
-
- `
|
|
567
|
-
- `
|
|
568
|
-
- `
|
|
569
|
-
- And many more
|
|
570
|
-
|
|
571
|
-
**Documentation:**
|
|
572
|
-
For complete documentation, see [Bottom Sheet Routing Guide](./docs/BOTTOM_SHEET_ROUTING.md).
|
|
573
|
-
|
|
574
|
-
### Using OxyRouter Standalone
|
|
575
|
-
|
|
576
|
-
If you need to embed the router in your own modal or container instead of using `showBottomSheet()`:
|
|
577
|
-
|
|
578
|
-
```typescript
|
|
579
|
-
import { Modal } from 'react-native';
|
|
580
|
-
import { useOxy, OxyRouter } from '@oxyhq/services';
|
|
581
|
-
|
|
582
|
-
function AuthModal({ visible, onRequestClose }: { visible: boolean; onRequestClose: () => void }) {
|
|
583
|
-
const { oxyServices } = useOxy();
|
|
584
|
-
|
|
585
|
-
if (!visible || !oxyServices) return null;
|
|
586
|
-
|
|
587
|
-
return (
|
|
588
|
-
<Modal visible onRequestClose={onRequestClose} animationType="slide">
|
|
589
|
-
<OxyRouter
|
|
590
|
-
oxyServices={oxyServices}
|
|
591
|
-
initialScreen="OxyAuth"
|
|
592
|
-
onClose={onRequestClose}
|
|
593
|
-
onAuthenticated={onRequestClose}
|
|
594
|
-
theme="light"
|
|
595
|
-
containerWidth={360}
|
|
596
|
-
/>
|
|
597
|
-
</Modal>
|
|
598
|
-
);
|
|
599
|
-
}
|
|
600
|
-
```
|
|
578
|
+
- `ManageAccount`, `AccountSettings`, `AccountMembers`, `CreateAccount`
|
|
579
|
+
- `Profile`, `EditProfile`, `PaymentGateway`, `TrustCenter`, `ConnectedApps`
|
|
580
|
+
- `FileManagement`, `LanguageSelector`, `PrivacySettings`, `Preferences`
|
|
581
|
+
- And many more (see `RouteName` in `src/ui/navigation/routes.ts`)
|
|
601
582
|
|
|
602
583
|
## Internationalization (i18n)
|
|
603
584
|
|
|
@@ -676,7 +657,7 @@ import { OxyProvider } from '@oxyhq/services';
|
|
|
676
657
|
|
|
677
658
|
function App() {
|
|
678
659
|
return (
|
|
679
|
-
<OxyProvider baseURL="https://
|
|
660
|
+
<OxyProvider baseURL="https://api.oxy.so">
|
|
680
661
|
<YourApp />
|
|
681
662
|
</OxyProvider>
|
|
682
663
|
);
|
|
@@ -745,10 +726,6 @@ Typed returns are defined in `ui/hooks/queries/paymentTypes.ts` (`Subscription`,
|
|
|
745
726
|
|
|
746
727
|
`@oxyhq/core` `OxyServices.verifyChallenge()` plants `setTokens(accessToken, refreshToken ?? '')` internally before returning. `useAuthOperations.performSignIn` no longer needs to hand-plant the token or call a session-token fallback — just await `verifyChallenge` and proceed.
|
|
747
728
|
|
|
748
|
-
## Silent SSO Run-Once Guard
|
|
749
|
-
|
|
750
|
-
The cross-page-load deduplication guard lives in the consumer hooks, NOT in `@oxyhq/core`. A core module-level singleton was tried and reverted because it re-evaluates in the Metro web bundle and the guard did not hold. `useWebSSO` in this package owns a module-level `silentSSOAttempted` Set + `ssoSignature(origin|baseURL)` key for cross-mount deduplication, plus a per-instance `hasCheckedRef` fast-path. Do NOT move this guard into a core module-level singleton.
|
|
751
|
-
|
|
752
729
|
## Requirements
|
|
753
730
|
|
|
754
731
|
- **React Native**: 0.76+ (for mobile components)
|
|
@@ -775,7 +752,7 @@ import { OxyProvider } from '@oxyhq/services';
|
|
|
775
752
|
|
|
776
753
|
function App() {
|
|
777
754
|
return (
|
|
778
|
-
<OxyProvider baseURL="https://
|
|
755
|
+
<OxyProvider baseURL="https://api.oxy.so">
|
|
779
756
|
<UserDashboard />
|
|
780
757
|
</OxyProvider>
|
|
781
758
|
);
|
|
@@ -830,7 +807,9 @@ Comprehensive documentation is available in the `/docs` directory:
|
|
|
830
807
|
|
|
831
808
|
- **[Getting Started](./GET_STARTED.md)** - Quick start guide for new developers
|
|
832
809
|
- **[Platform Guide](./PLATFORM_GUIDE.md)** - Platform-specific setup guide
|
|
833
|
-
- **[
|
|
810
|
+
- **[AUTHENTICATION.md](../../docs/AUTHENTICATION.md)** - Authentication model (device-first sessions)
|
|
811
|
+
- **[Device sessions](../../docs/auth/device-session.md)** - DeviceSession API, socket events, multi-account
|
|
812
|
+
- **[Integration guide](../../docs/auth/integration-guide.md)** - Sign in with Oxy for third-party apps
|
|
834
813
|
|
|
835
814
|
---
|
|
836
815
|
|
package/lib/commonjs/index.js
CHANGED
|
@@ -9,42 +9,12 @@ Object.defineProperty(exports, "AccountMembersScreen", {
|
|
|
9
9
|
return _AccountMembersScreen.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
Object.defineProperty(exports, "AccountMenu", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _AccountMenu.default;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "AccountMenuButton", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _AccountMenuButton.default;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
12
|
Object.defineProperty(exports, "AccountSettingsScreen", {
|
|
25
13
|
enumerable: true,
|
|
26
14
|
get: function () {
|
|
27
15
|
return _AccountSettingsScreen.default;
|
|
28
16
|
}
|
|
29
17
|
});
|
|
30
|
-
Object.defineProperty(exports, "AccountSwitcher", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function () {
|
|
33
|
-
return _AccountSwitcher.default;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
Object.defineProperty(exports, "AccountSwitcherScreen", {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
get: function () {
|
|
39
|
-
return _AccountSwitcherScreen.default;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
Object.defineProperty(exports, "AccountSwitcherView", {
|
|
43
|
-
enumerable: true,
|
|
44
|
-
get: function () {
|
|
45
|
-
return _AccountSwitcher.AccountSwitcherView;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
18
|
Object.defineProperty(exports, "Avatar", {
|
|
49
19
|
enumerable: true,
|
|
50
20
|
get: function () {
|
|
@@ -99,12 +69,30 @@ Object.defineProperty(exports, "NotificationsScreen", {
|
|
|
99
69
|
return _NotificationsScreen.default;
|
|
100
70
|
}
|
|
101
71
|
});
|
|
72
|
+
Object.defineProperty(exports, "OXY_OAUTH_CODE_VERIFIER_STORAGE_KEY", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () {
|
|
75
|
+
return _OxySignInButton.OXY_OAUTH_CODE_VERIFIER_STORAGE_KEY;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(exports, "OXY_OAUTH_STATE_STORAGE_KEY", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function () {
|
|
81
|
+
return _OxySignInButton.OXY_OAUTH_STATE_STORAGE_KEY;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
102
84
|
Object.defineProperty(exports, "OxyAuthPrompt", {
|
|
103
85
|
enumerable: true,
|
|
104
86
|
get: function () {
|
|
105
87
|
return _OxyAuthPrompt.OxyAuthPrompt;
|
|
106
88
|
}
|
|
107
89
|
});
|
|
90
|
+
Object.defineProperty(exports, "OxyConsentScreen", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function () {
|
|
93
|
+
return _OxyConsentScreen.OxyConsentScreen;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
108
96
|
Object.defineProperty(exports, "OxyLogo", {
|
|
109
97
|
enumerable: true,
|
|
110
98
|
get: function () {
|
|
@@ -135,10 +123,10 @@ Object.defineProperty(exports, "ProfileButton", {
|
|
|
135
123
|
return _ProfileButton.default;
|
|
136
124
|
}
|
|
137
125
|
});
|
|
138
|
-
Object.defineProperty(exports, "
|
|
126
|
+
Object.defineProperty(exports, "RequireOxyAuth", {
|
|
139
127
|
enumerable: true,
|
|
140
128
|
get: function () {
|
|
141
|
-
return
|
|
129
|
+
return _RequireOxyAuth.RequireOxyAuth;
|
|
142
130
|
}
|
|
143
131
|
});
|
|
144
132
|
Object.defineProperty(exports, "closeBottomSheet", {
|
|
@@ -174,7 +162,7 @@ Object.defineProperty(exports, "handleAuthError", {
|
|
|
174
162
|
Object.defineProperty(exports, "hideSignInModal", {
|
|
175
163
|
enumerable: true,
|
|
176
164
|
get: function () {
|
|
177
|
-
return
|
|
165
|
+
return _accountDialogManager.hideSignInModal;
|
|
178
166
|
}
|
|
179
167
|
});
|
|
180
168
|
Object.defineProperty(exports, "invalidateAccountQueries", {
|
|
@@ -270,7 +258,7 @@ Object.defineProperty(exports, "showBottomSheet", {
|
|
|
270
258
|
Object.defineProperty(exports, "showSignInModal", {
|
|
271
259
|
enumerable: true,
|
|
272
260
|
get: function () {
|
|
273
|
-
return
|
|
261
|
+
return _accountDialogManager.showSignInModal;
|
|
274
262
|
}
|
|
275
263
|
});
|
|
276
264
|
Object.defineProperty(exports, "useAccountStorageUsage", {
|
|
@@ -631,26 +619,22 @@ var _Avatar = _interopRequireDefault(require("./ui/components/Avatar.js"));
|
|
|
631
619
|
var _OxySignInButton = require("./ui/components/OxySignInButton.js");
|
|
632
620
|
var _OxyAuthPrompt = require("./ui/components/OxyAuthPrompt.js");
|
|
633
621
|
var _OxyLogo = _interopRequireDefault(require("./ui/components/OxyLogo.js"));
|
|
622
|
+
var _OxyConsentScreen = require("./ui/components/OxyConsentScreen.js");
|
|
623
|
+
var _RequireOxyAuth = require("./ui/components/RequireOxyAuth.js");
|
|
634
624
|
var _FollowButton = _interopRequireDefault(require("./ui/components/FollowButton.js"));
|
|
635
625
|
var _LogoIcon = require("./ui/components/logo/LogoIcon.js");
|
|
636
626
|
var _LogoText = require("./ui/components/logo/LogoText.js");
|
|
637
|
-
var _AccountMenu = _interopRequireDefault(require("./ui/components/AccountMenu.js"));
|
|
638
|
-
var _AccountMenuButton = _interopRequireDefault(require("./ui/components/AccountMenuButton.js"));
|
|
639
627
|
var _ProfileButton = _interopRequireDefault(require("./ui/components/ProfileButton.js"));
|
|
640
|
-
var _ProfileMenu = _interopRequireDefault(require("./ui/components/ProfileMenu.js"));
|
|
641
|
-
var _AccountSwitcher = _interopRequireWildcard(require("./ui/components/AccountSwitcher.js"));
|
|
642
628
|
var _useSwitchableAccounts = require("./ui/hooks/useSwitchableAccounts.js");
|
|
643
629
|
var _ManageAccountScreen = _interopRequireDefault(require("./ui/screens/ManageAccountScreen.js"));
|
|
644
630
|
var _NotificationsScreen = _interopRequireDefault(require("./ui/screens/NotificationsScreen.js"));
|
|
645
631
|
var _PreferencesScreen = _interopRequireDefault(require("./ui/screens/PreferencesScreen.js"));
|
|
646
632
|
var _ConnectedAppsScreen = _interopRequireDefault(require("./ui/screens/ConnectedAppsScreen.js"));
|
|
647
|
-
var _AccountSwitcherScreen = _interopRequireDefault(require("./ui/screens/AccountSwitcherScreen.js"));
|
|
648
633
|
var _CreateAccountScreen = _interopRequireDefault(require("./ui/screens/CreateAccountScreen.js"));
|
|
649
634
|
var _AccountMembersScreen = _interopRequireDefault(require("./ui/screens/AccountMembersScreen.js"));
|
|
650
635
|
var _AccountSettingsScreen = _interopRequireDefault(require("./ui/screens/AccountSettingsScreen.js"));
|
|
651
636
|
var _bottomSheetManager = require("./ui/navigation/bottomSheetManager.js");
|
|
652
|
-
var
|
|
653
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
637
|
+
var _accountDialogManager = require("./ui/navigation/accountDialogManager.js");
|
|
654
638
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
655
639
|
/**
|
|
656
640
|
* @oxyhq/services — OxyHQ Expo/React Native SDK
|
|
@@ -729,20 +713,22 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
729
713
|
// UI components
|
|
730
714
|
// ---------------------------------------------------------------------------
|
|
731
715
|
|
|
732
|
-
//
|
|
733
|
-
|
|
734
|
-
//
|
|
735
|
-
//
|
|
736
|
-
//
|
|
716
|
+
// Optional signed-out gate primitive. Wrap any subtree (or the whole app via
|
|
717
|
+
// `OxyProvider`'s `requireAuth` prop) to opt into a shared, readiness-safe wall.
|
|
718
|
+
// `prompt`: `off` (render always) | `soft` (dismissible banner) | `hard` (block).
|
|
719
|
+
// Gates on `useOxy().canUsePrivateApi` / `isPrivateApiPending` — never flashes the
|
|
720
|
+
// wall before the device-first cold boot resolves. Opens the ONE account dialog.
|
|
737
721
|
|
|
738
|
-
//
|
|
739
|
-
//
|
|
740
|
-
//
|
|
722
|
+
// Sidebar account trigger. Pressing `ProfileButton` opens the unified
|
|
723
|
+
// `OxyAccountDialog` (the single account switcher + sign-in surface) via
|
|
724
|
+
// `useOxy().openAccountDialog`.
|
|
741
725
|
|
|
742
726
|
// Unified switchable-accounts hook — the single source of everything the user
|
|
743
727
|
// can switch into: device sign-ins AND linked graph accounts (owned orgs +
|
|
744
728
|
// shared-with-you), deduped by account id and hydrated with real
|
|
745
|
-
// name/email/avatar/color.
|
|
729
|
+
// name/email/avatar/color. Backed by the shared `AccountDialogController` in
|
|
730
|
+
// `@oxyhq/core`. Every switch routes through `useOxy().switchToAccount`.
|
|
731
|
+
// The `SwitchableAccount` type lives in `@oxyhq/core` — import it from there.
|
|
746
732
|
|
|
747
733
|
// Unified "Manage your Oxy Account" screen (the caller's own personal account)
|
|
748
734
|
|
|
@@ -753,6 +739,9 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
753
739
|
// ---------------------------------------------------------------------------
|
|
754
740
|
|
|
755
741
|
// ---------------------------------------------------------------------------
|
|
756
|
-
//
|
|
742
|
+
// Unified account dialog — imperative entry points
|
|
757
743
|
// ---------------------------------------------------------------------------
|
|
744
|
+
// `showSignInModal` / `hideSignInModal` open / close the unified account dialog
|
|
745
|
+
// on its sign-in view; retained under their historical names so existing
|
|
746
|
+
// consumers keep working. Prefer `useOxy().openAccountDialog(view?)` inside React.
|
|
758
747
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_core","require","_reactNative","_OxyProvider","_interopRequireDefault","_OxyContext","_useAuth","_FontLoader","_authStore","_assetStore","_useAssets","_useFileDownloadUrl","_useFollow","_useAccountQueries","_useServicesQueries","_useSecurityQueries","_usePaymentQueries","_useAccountMutations","_useServicesMutations","_mutationFactory","_mutationKeys","_queryKeys","_useMutationStatus","_useOnlineStatus","_errorHandlers","_useFileFiltering","_Avatar","_OxySignInButton","_OxyAuthPrompt","_OxyLogo","
|
|
1
|
+
{"version":3,"names":["_core","require","_reactNative","_OxyProvider","_interopRequireDefault","_OxyContext","_useAuth","_FontLoader","_authStore","_assetStore","_useAssets","_useFileDownloadUrl","_useFollow","_useAccountQueries","_useServicesQueries","_useSecurityQueries","_usePaymentQueries","_useAccountMutations","_useServicesMutations","_mutationFactory","_mutationKeys","_queryKeys","_useMutationStatus","_useOnlineStatus","_errorHandlers","_useFileFiltering","_Avatar","_OxySignInButton","_OxyAuthPrompt","_OxyLogo","_OxyConsentScreen","_RequireOxyAuth","_FollowButton","_LogoIcon","_LogoText","_ProfileButton","_useSwitchableAccounts","_ManageAccountScreen","_NotificationsScreen","_PreferencesScreen","_ConnectedAppsScreen","_CreateAccountScreen","_AccountMembersScreen","_AccountSettingsScreen","_bottomSheetManager","_accountDialogManager","e","__esModule","default","setPlatformOS","Platform","OS"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"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","ignoreList":[]}
|
|
@@ -3,18 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
Object.defineProperty(exports, "AccountMenu", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _AccountMenu.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "AccountMenuButton", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _AccountMenuButton.default;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
6
|
Object.defineProperty(exports, "Avatar", {
|
|
19
7
|
enumerable: true,
|
|
20
8
|
get: function () {
|
|
@@ -156,8 +144,6 @@ var _FollowButton = _interopRequireDefault(require("./components/FollowButton.js
|
|
|
156
144
|
var _OxyPayButton = _interopRequireDefault(require("./components/OxyPayButton.js"));
|
|
157
145
|
var _FontLoader = require("./components/FontLoader.js");
|
|
158
146
|
var _OxyIcon = _interopRequireDefault(require("./components/icon/OxyIcon.js"));
|
|
159
|
-
var _AccountMenu = _interopRequireDefault(require("./components/AccountMenu.js"));
|
|
160
|
-
var _AccountMenuButton = _interopRequireDefault(require("./components/AccountMenuButton.js"));
|
|
161
147
|
var _OxyContext = require("./context/OxyContext.js");
|
|
162
148
|
var _useAuth = require("./hooks/useAuth.js");
|
|
163
149
|
var _useFollow = require("./hooks/useFollow.js");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_OxyProvider","_interopRequireDefault","require","_OxySignInButton","_OxyAuthPrompt","_OxyLogo","_Avatar","_FollowButton","_OxyPayButton","_FontLoader","_OxyIcon","
|
|
1
|
+
{"version":3,"names":["_OxyProvider","_interopRequireDefault","require","_OxySignInButton","_OxyAuthPrompt","_OxyLogo","_Avatar","_FollowButton","_OxyPayButton","_FontLoader","_OxyIcon","_OxyContext","_useAuth","_useFollow","_useStorage","_ProfileScreen","_ManageAccountScreen","_authStore","_accountStore","_errorHandlers","e","__esModule","default"],"sourceRoot":"../../../src","sources":["ui/client.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,cAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAAG,QAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,OAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,aAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,aAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAT,sBAAA,CAAAC,OAAA;AAGA,IAAAS,WAAA,GAAAT,OAAA;AAGA,IAAAU,QAAA,GAAAV,OAAA;AAEA,IAAAW,UAAA,GAAAX,OAAA;AACA,IAAAY,WAAA,GAAAZ,OAAA;AAIA,IAAAa,cAAA,GAAAd,sBAAA,CAAAC,OAAA;AACA,IAAAc,oBAAA,GAAAf,sBAAA,CAAAC,OAAA;AAGA,IAAAe,UAAA,GAAAf,OAAA;AACA,IAAAgB,aAAA,GAAAhB,OAAA;AAGA,IAAAiB,cAAA,GAAAjB,OAAA;AAK+B,SAAAD,uBAAAmB,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA","ignoreList":[]}
|