@oxyhq/services 15.0.0 → 17.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/index.js +25 -55
- 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 +764 -0
- package/lib/commonjs/ui/components/OxyAccountDialog.js.map +1 -0
- package/lib/commonjs/ui/components/OxyProvider.js +11 -6
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/OxySignInButton.js +10 -21
- 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/context/OxyContext.js +106 -2
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/hooks/mutations/mutationKeys.js +1 -1
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js +10 -10
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/queryKeys.js +1 -1
- package/lib/commonjs/ui/hooks/queries/useAccountQueries.js +7 -8
- package/lib/commonjs/ui/hooks/queries/useAccountQueries.js.map +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/ConnectedAppsScreen.js +17 -18
- package/lib/commonjs/ui/screens/ConnectedAppsScreen.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 +20 -17
- 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 +761 -0
- package/lib/module/ui/components/OxyAccountDialog.js.map +1 -0
- package/lib/module/ui/components/OxyProvider.js +11 -6
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/OxySignInButton.js +10 -21
- 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/context/OxyContext.js +107 -3
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/hooks/mutations/mutationKeys.js +1 -1
- package/lib/module/ui/hooks/mutations/useAccountMutations.js +8 -8
- package/lib/module/ui/hooks/mutations/useAccountMutations.js.map +1 -1
- package/lib/module/ui/hooks/queries/queryKeys.js +1 -1
- package/lib/module/ui/hooks/queries/useAccountQueries.js +5 -6
- package/lib/module/ui/hooks/queries/useAccountQueries.js.map +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/ConnectedAppsScreen.js +19 -20
- package/lib/module/ui/screens/ConnectedAppsScreen.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 +6 -13
- 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 +35 -0
- package/lib/typescript/commonjs/ui/components/OxyAccountDialog.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.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/context/OxyContext.d.ts +13 -1
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts +4 -4
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/useAccountQueries.d.ts +6 -7
- package/lib/typescript/commonjs/ui/hooks/queries/useAccountQueries.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/ConnectedAppsScreen.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 +9 -0
- package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/storageHelpers.d.ts +7 -7
- package/lib/typescript/module/index.d.ts +6 -13
- 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 +35 -0
- package/lib/typescript/module/ui/components/OxyAccountDialog.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.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/context/OxyContext.d.ts +13 -1
- package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts +4 -4
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/useAccountQueries.d.ts +6 -7
- package/lib/typescript/module/ui/hooks/queries/useAccountQueries.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/ConnectedAppsScreen.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 +9 -0
- package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/storageHelpers.d.ts +7 -7
- package/package.json +4 -4
- package/src/index.ts +23 -28
- package/src/ui/client.ts +0 -4
- package/src/ui/components/OxyAccountDialog.tsx +760 -0
- package/src/ui/components/OxyProvider.tsx +12 -6
- package/src/ui/components/OxySignInButton.tsx +10 -21
- package/src/ui/components/ProfileButton.tsx +23 -126
- package/src/ui/components/RequireOxyAuth.tsx +266 -0
- package/src/ui/context/OxyContext.tsx +146 -7
- package/src/ui/hooks/mutations/mutationKeys.ts +1 -1
- package/src/ui/hooks/mutations/useAccountMutations.ts +8 -8
- package/src/ui/hooks/queries/queryKeys.ts +1 -1
- package/src/ui/hooks/queries/useAccountQueries.ts +8 -9
- 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 +1 -5
- package/src/ui/screens/ConnectedAppsScreen.tsx +23 -24
- package/src/ui/screens/ManageAccountScreen.tsx +3 -2
- package/src/ui/session/createSessionClient.ts +9 -1
- package/src/ui/types/navigation.ts +9 -0
- package/src/ui/utils/storageHelpers.ts +7 -7
- 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
|
@@ -31,12 +31,12 @@ export { useAssetStore, useAssets as useAssetsStore, useAsset, useUploadProgress
|
|
|
31
31
|
export { useAssets, setOxyAssetInstance } from './ui/hooks/useAssets';
|
|
32
32
|
export { useFileDownloadUrl } from './ui/hooks/useFileDownloadUrl';
|
|
33
33
|
export { useFollow, useFollowerCounts } from './ui/hooks/useFollow';
|
|
34
|
-
export { useUserProfile, useUserProfiles, useCurrentUser, useUserById, useUserByUsername, useUsersBySessions, usePrivacySettings,
|
|
34
|
+
export { useUserProfile, useUserProfiles, useCurrentUser, useUserById, useUserByUsername, useUsersBySessions, usePrivacySettings, useConnectedApps, } from './ui/hooks/queries/useAccountQueries';
|
|
35
35
|
export { useSessions, useSession, useDeviceSessions, useUserDevices, useSecurityInfo, useAccountStorageUsage, } from './ui/hooks/queries/useServicesQueries';
|
|
36
36
|
export { useSecurityActivity, useRecentSecurityActivity, useInfiniteSecurityActivity, } from './ui/hooks/queries/useSecurityQueries';
|
|
37
37
|
export { useUserSubscription, useUserPayments, useUserWallet, useUserWalletTransactions, } from './ui/hooks/queries/usePaymentQueries';
|
|
38
38
|
export type { Subscription, SubscriptionPlan, SubscriptionStatus, SubscriptionFeatures, Payment, Wallet, WalletTransaction, WalletTransactionType, WalletTransactionStatus, WalletPagination, WalletTransactionsResponse, } from './ui/hooks/queries/paymentTypes';
|
|
39
|
-
export { useUpdateProfile, useUploadAvatar, useUpdateAccountSettings, useUpdatePrivacySettings, useUpdateNotificationPreferences, useUpdateUserPreferences,
|
|
39
|
+
export { useUpdateProfile, useUploadAvatar, useUpdateAccountSettings, useUpdatePrivacySettings, useUpdateNotificationPreferences, useUpdateUserPreferences, useRevokeConnectedApp, useUploadFile, } from './ui/hooks/mutations/useAccountMutations';
|
|
40
40
|
export { useSwitchSession, useLogoutSession, useLogoutAll, useUpdateDeviceName, useRemoveDevice, } from './ui/hooks/mutations/useServicesMutations';
|
|
41
41
|
export { createProfileMutation, createGenericMutation, } from './ui/hooks/mutations/mutationFactory';
|
|
42
42
|
export type { ProfileMutationConfig, GenericMutationConfig, } from './ui/hooks/mutations/mutationFactory';
|
|
@@ -55,31 +55,24 @@ export { OxySignInButton } from './ui/components/OxySignInButton';
|
|
|
55
55
|
export { OxyAuthPrompt } from './ui/components/OxyAuthPrompt';
|
|
56
56
|
export type { OxyAuthPromptProps } from './ui/components/OxyAuthPrompt';
|
|
57
57
|
export { default as OxyLogo } from './ui/components/OxyLogo';
|
|
58
|
+
export { RequireOxyAuth } from './ui/components/RequireOxyAuth';
|
|
59
|
+
export type { RequireOxyAuthProps, RequireOxyAuthPrompt } from './ui/components/RequireOxyAuth';
|
|
58
60
|
export { default as FollowButton } from './ui/components/FollowButton';
|
|
59
61
|
export type { FollowButtonProps, SingleFollowButtonProps, MultiFollowButtonProps } from './ui/components/FollowButton';
|
|
60
62
|
export { LogoIcon } from './ui/components/logo/LogoIcon';
|
|
61
63
|
export { LogoText } from './ui/components/logo/LogoText';
|
|
62
|
-
export { default as AccountMenu } from './ui/components/AccountMenu';
|
|
63
|
-
export type { AccountMenuProps, AccountMenuAnchor } from './ui/components/AccountMenu';
|
|
64
|
-
export { default as AccountMenuButton } from './ui/components/AccountMenuButton';
|
|
65
|
-
export type { AccountMenuButtonProps } from './ui/components/AccountMenuButton';
|
|
66
64
|
export { default as ProfileButton } from './ui/components/ProfileButton';
|
|
67
65
|
export type { ProfileButtonProps } from './ui/components/ProfileButton';
|
|
68
|
-
export { default as ProfileMenu } from './ui/components/ProfileMenu';
|
|
69
|
-
export type { ProfileMenuProps, ProfileMenuAnchor } from './ui/components/ProfileMenu';
|
|
70
|
-
export { default as AccountSwitcher, AccountSwitcherView } from './ui/components/AccountSwitcher';
|
|
71
|
-
export type { AccountSwitcherProps, AccountSwitcherActions } from './ui/components/AccountSwitcher';
|
|
72
66
|
export { useSwitchableAccounts } from './ui/hooks/useSwitchableAccounts';
|
|
73
|
-
export type {
|
|
67
|
+
export type { UseSwitchableAccountsResult } from './ui/hooks/useSwitchableAccounts';
|
|
74
68
|
export { default as ManageAccountScreen } from './ui/screens/ManageAccountScreen';
|
|
75
69
|
export { default as NotificationsScreen } from './ui/screens/NotificationsScreen';
|
|
76
70
|
export { default as PreferencesScreen } from './ui/screens/PreferencesScreen';
|
|
77
71
|
export { default as ConnectedAppsScreen } from './ui/screens/ConnectedAppsScreen';
|
|
78
|
-
export { default as AccountSwitcherScreen } from './ui/screens/AccountSwitcherScreen';
|
|
79
72
|
export { default as CreateAccountScreen } from './ui/screens/CreateAccountScreen';
|
|
80
73
|
export { default as AccountMembersScreen } from './ui/screens/AccountMembersScreen';
|
|
81
74
|
export { default as AccountSettingsScreen } from './ui/screens/AccountSettingsScreen';
|
|
82
75
|
export { showBottomSheet, closeBottomSheet } from './ui/navigation/bottomSheetManager';
|
|
83
76
|
export type { RouteName } from './ui/navigation/routes';
|
|
84
|
-
export { showSignInModal, hideSignInModal } from './ui/
|
|
77
|
+
export { showSignInModal, hideSignInModal } from './ui/navigation/accountDialogManager';
|
|
85
78
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAYH,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,yBAAy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C;AAEhG,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACvE,YAAY,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACvH,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAKzD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACzE,YAAY,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAQxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,YAAY,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAGpF,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAGlF,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAKtF,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACvF,YAAY,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAQxD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC"}
|
|
@@ -17,10 +17,6 @@ export { default as FollowButton } from './components/FollowButton';
|
|
|
17
17
|
export { default as OxyPayButton } from './components/OxyPayButton';
|
|
18
18
|
export { FontLoader, setupFonts } from './components/FontLoader';
|
|
19
19
|
export { default as OxyIcon } from './components/icon/OxyIcon';
|
|
20
|
-
export { default as AccountMenu } from './components/AccountMenu';
|
|
21
|
-
export type { AccountMenuProps } from './components/AccountMenu';
|
|
22
|
-
export { default as AccountMenuButton } from './components/AccountMenuButton';
|
|
23
|
-
export type { AccountMenuButtonProps } from './components/AccountMenuButton';
|
|
24
20
|
export { useOxy } from './context/OxyContext';
|
|
25
21
|
export { useAuth } from './hooks/useAuth';
|
|
26
22
|
export type { AuthState, AuthActions, UseAuthReturn } from './hooks/useAuth';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/ui/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACtE,YAAY,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/ui/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,OAAO,IAAI,WA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,GACtB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OxyAccountDialog — the ONE unified account dialog for `@oxyhq/services`.
|
|
3
|
+
*
|
|
4
|
+
* A thin React Native binding over the headless `AccountDialogController` in
|
|
5
|
+
* `@oxyhq/core` (bound via `useSyncExternalStore`), presented as a bottom-sheet
|
|
6
|
+
* modal. It REPLACES the five drifting device/account surfaces the SDK shipped
|
|
7
|
+
* before (`ProfileMenu`, `AccountMenu`, `AccountSwitcher`, `SignInAccountChooser`,
|
|
8
|
+
* and `SignInModal`) with a single implementation whose data + state machine live
|
|
9
|
+
* in core, so the RN and web (auth-sdk) bindings render the SAME list from the
|
|
10
|
+
* SAME logic and cannot diverge.
|
|
11
|
+
*
|
|
12
|
+
* Views (from `snapshot.view`):
|
|
13
|
+
* - `accounts` — the unified `SwitchableAccount[]` list (device sign-ins ∪ graph
|
|
14
|
+
* accounts). Tapping a row switches through `controller.switchTo(accountId)`
|
|
15
|
+
* (the uniform switch), the active row is flagged, and a "+ Add account" row
|
|
16
|
+
* opens the sign-in entry. This is what `ProfileButton` opens.
|
|
17
|
+
* - `add` / `signin` — the sign-in entry: primary "Sign in with Oxy" (device
|
|
18
|
+
* flow), "Scan a QR", and a secondary "Use a password" hand-off that opens
|
|
19
|
+
* auth.oxy.so (password + 2FA are NOT in the SDK).
|
|
20
|
+
* - `qr` — the cross-device QR handoff + its waiting state.
|
|
21
|
+
*
|
|
22
|
+
* Per-account color re-theming uses Bloom's `APP_COLOR_PRESETS` + `BloomColorScope`
|
|
23
|
+
* (same visual language auth.oxy.so uses). Base theming is `useTheme()` + a
|
|
24
|
+
* `StyleSheet`, so the dialog renders correctly in EVERY consumer — including apps
|
|
25
|
+
* that do not use NativeWind (e.g. the accounts app). Modal contents are wrapped
|
|
26
|
+
* in `<GestureHandlerRootView>` because RN's `Modal` renders into its own window.
|
|
27
|
+
*/
|
|
28
|
+
import type React from 'react';
|
|
29
|
+
/**
|
|
30
|
+
* The unified account dialog. Mounted once by `OxyProvider`; opened imperatively
|
|
31
|
+
* via `useOxy().openAccountDialog(view?)` (or the back-compat `showSignInModal`).
|
|
32
|
+
*/
|
|
33
|
+
declare const OxyAccountDialog: React.FC;
|
|
34
|
+
export default OxyAccountDialog;
|
|
35
|
+
//# sourceMappingURL=OxyAccountDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OxyAccountDialog.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/OxyAccountDialog.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAkE/B;;;GAGG;AACH,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAgJ7B,CAAC;AAqgBF,eAAe,gBAAgB,CAAC"}
|
|
@@ -5,8 +5,8 @@ import type { OxyProviderProps } from '../types/navigation';
|
|
|
5
5
|
*
|
|
6
6
|
* Provides authentication, session management, query client, and UI overlays.
|
|
7
7
|
* Wraps its own overlay stack in SafeAreaProvider and GestureHandlerRootView so
|
|
8
|
-
* BottomSheetRouter and
|
|
9
|
-
* has not mounted those providers yet.
|
|
8
|
+
* BottomSheetRouter and OxyAccountDialog can safely render even when a consuming
|
|
9
|
+
* app has not mounted those providers yet.
|
|
10
10
|
*
|
|
11
11
|
* Usage:
|
|
12
12
|
* ```tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OxyProvider.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/OxyProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmE,KAAK,EAAE,EAAkB,MAAM,OAAO,CAAC;AAIjH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"OxyProvider.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/OxyProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmE,KAAK,EAAE,EAAkB,MAAM,OAAO,CAAC;AAIjH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAqE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,QAAA,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAuOrC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OxySignInButton.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/OxySignInButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAA4C,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAY,MAAM,cAAc,CAAC;AAQlI,MAAM,WAAW,oBAAoB;IACjC;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,WAAW,CAAC;IAE9C;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAE7B;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAEjC;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,
|
|
1
|
+
{"version":3,"file":"OxySignInButton.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/OxySignInButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAA4C,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAY,MAAM,cAAc,CAAC;AAQlI,MAAM,WAAW,oBAAoB;IACjC;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,WAAW,CAAC;IAE9C;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAE7B;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAEjC;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA8I1D,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -11,23 +11,15 @@ export interface ProfileButtonProps {
|
|
|
11
11
|
*/
|
|
12
12
|
avatarSize?: number;
|
|
13
13
|
/** Navigate to the "Manage account" surface (settings). */
|
|
14
|
-
onNavigateManage
|
|
14
|
+
onNavigateManage?: () => void;
|
|
15
15
|
/** Start the add-account / sign-in flow for an additional account. */
|
|
16
|
-
onAddAccount
|
|
16
|
+
onAddAccount?: () => void;
|
|
17
17
|
/** Optional: navigate to the signed-in user's own profile. */
|
|
18
18
|
onNavigateProfile?: () => void;
|
|
19
|
-
/** Called before the active identity changes so apps can clear scoped state. */
|
|
20
|
-
onBeforeSessionChange?: () => void | Promise<void>;
|
|
21
19
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* behavior.
|
|
26
|
-
* - `'down'`: the menu opens DOWNWARD, for a trigger placed at the TOP of a
|
|
27
|
-
* sidebar (the accounts app pattern).
|
|
28
|
-
* - `'auto'`: opens downward when there is more room below the trigger than
|
|
29
|
-
* above, otherwise upward.
|
|
30
|
-
* Native (bottom-sheet) is unaffected — this only influences the web popover.
|
|
20
|
+
* Retained for source compatibility. The trigger now opens the unified
|
|
21
|
+
* `OxyAccountDialog` (a centered / bottom-sheet modal) rather than an
|
|
22
|
+
* anchored popover, so popover placement no longer applies.
|
|
31
23
|
*/
|
|
32
24
|
placement?: 'up' | 'down' | 'auto';
|
|
33
25
|
/**
|
|
@@ -41,27 +33,23 @@ export interface ProfileButtonProps {
|
|
|
41
33
|
}
|
|
42
34
|
/**
|
|
43
35
|
* Self-contained sidebar account trigger, modeled on Bluesky's ProfileCard and
|
|
44
|
-
* the Oxy inbox's `MailboxDrawer` footer.
|
|
45
|
-
*
|
|
36
|
+
* the Oxy inbox's `MailboxDrawer` footer. Pressing it opens the unified
|
|
37
|
+
* {@link OxyAccountDialog} — the single account switcher + sign-in surface — via
|
|
38
|
+
* `useOxy().openAccountDialog`.
|
|
46
39
|
*
|
|
47
40
|
* Three auth states from {@link useAuth}:
|
|
48
41
|
* - **Undetermined** (`!isAuthResolved || isPrivateApiPending`): a neutral
|
|
49
42
|
* avatar-sized skeleton circle, no press.
|
|
50
43
|
* - **Signed in**: a pressable row — Bloom `Avatar` + display name + `@handle`
|
|
51
|
-
* +
|
|
52
|
-
*
|
|
53
|
-
*
|
|
44
|
+
* + a chevron. Press opens the dialog on its `accounts` view.
|
|
45
|
+
* - **Signed out**: a "Sign in" row that calls `useAuth().signIn()` (which opens
|
|
46
|
+
* the dialog on its `signin` view).
|
|
54
47
|
*
|
|
55
48
|
* Styling uses react-native `StyleSheet` + the Bloom theme (via `useTheme`) so
|
|
56
49
|
* the layout renders identically in EVERY consumer — including apps that do not
|
|
57
50
|
* use NativeWind (e.g. the accounts app). Only the web hover animation keeps
|
|
58
51
|
* dynamic inline `style` (the CSS transition/transform values), which is what
|
|
59
52
|
* the `react-native-web-style.d.ts` augmentation exists for.
|
|
60
|
-
*
|
|
61
|
-
* All display strings resolve through `@oxyhq/core`'s
|
|
62
|
-
* `getAccountDisplayName` / `getAccountFallbackHandle` — no hand-rolled name
|
|
63
|
-
* fallbacks. Avatars pass the bare file id as `source` + `variant="thumb"`, so
|
|
64
|
-
* the app's registered `ImageResolver` builds the thumbnail URL.
|
|
65
53
|
*/
|
|
66
54
|
declare const ProfileButton: React.FC<ProfileButtonProps>;
|
|
67
55
|
export default ProfileButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileButton.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/ProfileButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAKH,KAAK,SAAS,EACd,KAAK,SAAS,EACjB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"ProfileButton.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/ProfileButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAKH,KAAK,SAAS,EACd,KAAK,SAAS,EACjB,MAAM,cAAc,CAAC;AAuCtB,MAAM,WAAW,kBAAkB;IAC/B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,sEAAsE;IACtE,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,8DAA8D;IAC9D,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B;;;;OAIG;IACH,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;IACnC;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAoP/C,CAAC;AAqDF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RequireOxyAuth — the optional signed-out gate primitive (React Native).
|
|
3
|
+
*
|
|
4
|
+
* ONE shared way for any Oxy app to opt into a signed-out gate. It is entirely
|
|
5
|
+
* OPTIONAL: a public app renders its children untouched (`prompt="off"`); an
|
|
6
|
+
* auth-required app blocks them behind a signed-out state (`prompt="hard"`); an
|
|
7
|
+
* app that mostly works signed-out but wants a nudge shows a dismissible banner
|
|
8
|
+
* (`prompt="soft"`). Every mode reuses the ONE account dialog the provider
|
|
9
|
+
* already mounts — opening the sign-in surface is always
|
|
10
|
+
* `useOxy().openAccountDialog('signin')`; there is NO second dialog.
|
|
11
|
+
*
|
|
12
|
+
* Readiness gating (CRITICAL): the gate keys on the SDK's own readiness state
|
|
13
|
+
* (`useOxy().canUsePrivateApi` / `isPrivateApiPending`), NEVER on app-local
|
|
14
|
+
* hooks. While auth is still resolving (`isPrivateApiPending`) it renders a
|
|
15
|
+
* neutral loading state so the signed-out wall never flashes before the
|
|
16
|
+
* device-first cold boot concludes (the documented cold-boot race).
|
|
17
|
+
*
|
|
18
|
+
* Styling follows the sibling `OxyAccountDialog`/`OxySignInButton` pattern —
|
|
19
|
+
* `useTheme()` + `StyleSheet` (NOT NativeWind), so the gate renders correctly in
|
|
20
|
+
* EVERY consumer, including apps that do not run NativeWind (e.g. the accounts
|
|
21
|
+
* app).
|
|
22
|
+
*/
|
|
23
|
+
import type React from 'react';
|
|
24
|
+
import { type ReactNode } from 'react';
|
|
25
|
+
/**
|
|
26
|
+
* How `RequireOxyAuth` treats a signed-out (or still-resolving) session.
|
|
27
|
+
* - `off` — always render children (public app; a no-op provided for symmetry).
|
|
28
|
+
* - `soft` — render children, plus a dismissible sign-in banner when signed out.
|
|
29
|
+
* - `hard` — block children behind a centered signed-out state until signed in.
|
|
30
|
+
*/
|
|
31
|
+
export type RequireOxyAuthPrompt = 'off' | 'soft' | 'hard';
|
|
32
|
+
export interface RequireOxyAuthProps {
|
|
33
|
+
children: ReactNode;
|
|
34
|
+
/** Gate behavior. @default 'hard' */
|
|
35
|
+
prompt?: RequireOxyAuthPrompt;
|
|
36
|
+
/** Replaces the neutral loading UI shown while auth is still resolving. */
|
|
37
|
+
loadingFallback?: ReactNode;
|
|
38
|
+
/** Replaces the entire default signed-out wall (`prompt="hard"`). */
|
|
39
|
+
signedOutFallback?: ReactNode;
|
|
40
|
+
/** Title for the default `prompt="hard"` wall. */
|
|
41
|
+
title?: string;
|
|
42
|
+
/** Subtitle for the default `prompt="hard"` wall. */
|
|
43
|
+
subtitle?: string;
|
|
44
|
+
/** Message for the `prompt="soft"` banner. */
|
|
45
|
+
bannerMessage?: string;
|
|
46
|
+
/** CTA label for the `prompt="soft"` banner. */
|
|
47
|
+
bannerActionLabel?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Optional signed-out gate. Wrap any subtree (or the whole app via the
|
|
51
|
+
* provider's `requireAuth` prop) to opt into a shared, readiness-safe wall.
|
|
52
|
+
*/
|
|
53
|
+
export declare const RequireOxyAuth: React.FC<RequireOxyAuthProps>;
|
|
54
|
+
export default RequireOxyAuth;
|
|
55
|
+
//# sourceMappingURL=RequireOxyAuth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RequireOxyAuth.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/RequireOxyAuth.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAQjD;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAE3D,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,SAAS,CAAC;IACpB,qCAAqC;IACrC,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,2EAA2E;IAC3E,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B,qEAAqE;IACrE,iBAAiB,CAAC,EAAE,SAAS,CAAC;IAC9B,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gDAAgD;IAChD,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAOD;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA4CxD,CAAC;AA0JF,eAAe,cAAc,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import { type ReactNode } from 'react';
|
|
3
3
|
import { OxyServices } from '@oxyhq/core';
|
|
4
|
-
import type { User, ApiError, SessionLoginResponse, AccountNode, CreateAccountInput, ClientSession } from '@oxyhq/core';
|
|
4
|
+
import type { User, ApiError, SessionLoginResponse, AccountNode, CreateAccountInput, ClientSession, AccountDialogController, AccountDialogView } from '@oxyhq/core';
|
|
5
5
|
import type { UseFollowHook } from '../hooks/useFollow.types';
|
|
6
6
|
import { useLanguageManagement } from '../hooks/useLanguageManagement';
|
|
7
7
|
import type { RouteName } from '../navigation/routes';
|
|
@@ -101,6 +101,18 @@ export interface OxyContextState {
|
|
|
101
101
|
props?: Record<string, unknown>;
|
|
102
102
|
}) => void;
|
|
103
103
|
openAvatarPicker: () => void;
|
|
104
|
+
/** The headless controller driving {@link openAccountDialog}. `null` before mount. */
|
|
105
|
+
accountDialogController: AccountDialogController | null;
|
|
106
|
+
/** Whether the unified account dialog is currently presented. */
|
|
107
|
+
isAccountDialogOpen: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Open the unified account dialog. `accounts` (default) shows the switcher;
|
|
110
|
+
* `signin` / `add` open the sign-in entry. Replaces every prior device/account
|
|
111
|
+
* surface and the standalone sign-in modal.
|
|
112
|
+
*/
|
|
113
|
+
openAccountDialog: (view?: AccountDialogView) => void;
|
|
114
|
+
/** Dismiss the unified account dialog and cancel any in-flight sign-in flow. */
|
|
115
|
+
closeAccountDialog: () => void;
|
|
104
116
|
/** Every account the caller can access — own personal root, owned, and shared — from `listAccounts()`. */
|
|
105
117
|
accounts: AccountNode[];
|
|
106
118
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OxyContext.d.ts","sourceRoot":"","sources":["../../../../../src/ui/context/OxyContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"OxyContext.d.ts","sourceRoot":"","sources":["../../../../../src/ui/context/OxyContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,WAAW,EAAa,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,EACV,IAAI,EACJ,QAAQ,EACR,oBAAoB,EACpB,WAAW,EACX,kBAAkB,EAClB,aAAa,EAGb,uBAAuB,EACvB,iBAAiB,EAClB,MAAM,aAAa,CAAC;AAerB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAKvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAgBtD,MA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AQ,CAAC,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;IAChD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;CACrC;AA4FD,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CA88BzD,CAAC;AAEF,eAAO,MAAM,kBAAkB,mCAAc,CAAC;AA8D9C,eAAO,MAAM,MAAM,QAAO,eAMzB,CAAC"}
|
|
@@ -272,12 +272,12 @@ export declare const useUpdateUserPreferences: () => import("@tanstack/react-que
|
|
|
272
272
|
previousUser: User | undefined;
|
|
273
273
|
}>;
|
|
274
274
|
/**
|
|
275
|
-
* Revoke the
|
|
276
|
-
* Removes the
|
|
277
|
-
* "Connected apps" list — next sign-in
|
|
275
|
+
* Revoke the current user's grant for a connected application (by its
|
|
276
|
+
* `applicationId`). Removes the grant so the app no longer appears in the user's
|
|
277
|
+
* "Connected apps" list — next sign-in for that app will require explicit
|
|
278
278
|
* re-consent.
|
|
279
279
|
*/
|
|
280
|
-
export declare const
|
|
280
|
+
export declare const useRevokeConnectedApp: () => import("@tanstack/react-query").UseMutationResult<void, Error, string, unknown>;
|
|
281
281
|
/**
|
|
282
282
|
* Upload file with authentication handling and progress tracking
|
|
283
283
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAccountMutations.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/hooks/mutations/useAccountMutations.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,EACf,IAAI,EACJ,eAAe,EAChB,MAAM,aAAa,CAAC;AAerB;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;
|
|
1
|
+
{"version":3,"file":"useAccountMutations.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/hooks/mutations/useAccountMutations.ts"],"names":[],"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G,QAAQ,GAAG,UAAU;eACnC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;iBACrB,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI;WAS5C,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ConnectedApp, User } from '@oxyhq/core';
|
|
2
2
|
/**
|
|
3
3
|
* Get user profile by session ID
|
|
4
4
|
*/
|
|
@@ -49,14 +49,13 @@ export declare const useUsersBySessions: (sessionIds: string[], options?: {
|
|
|
49
49
|
user: User | null;
|
|
50
50
|
}[]>, Error>;
|
|
51
51
|
/**
|
|
52
|
-
* List the
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* RP catalog. Drives the "Connected apps" management screen.
|
|
52
|
+
* List the third-party OAuth applications the current user has connected via
|
|
53
|
+
* the consent flow (`GET /auth/grants`). Drives the "Connected apps" management
|
|
54
|
+
* screen.
|
|
56
55
|
*/
|
|
57
|
-
export declare const
|
|
56
|
+
export declare const useConnectedApps: (options?: {
|
|
58
57
|
enabled?: boolean;
|
|
59
|
-
}) => import("@tanstack/react-query").UseQueryResult<NoInfer<
|
|
58
|
+
}) => import("@tanstack/react-query").UseQueryResult<NoInfer<ConnectedApp[]>, Error>;
|
|
60
59
|
/**
|
|
61
60
|
* Get privacy settings for a user
|
|
62
61
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAccountQueries.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/hooks/queries/useAccountQueries.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"useAccountQueries.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/hooks/queries/useAccountQueries.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAMtD;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,WAAW,MAAM,GAAG,IAAI,EAA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C,iBAAiB,CAAC,CAAC;IAC9D,0CAA0C;IAC1C,gBAAgB,EAAE,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC,kBAAkB,CAAC,CAAC;CACjE;AAED;;;;;;;;GAQG;AACH,wBAAgB,OAAO,IAAI,aAAa,CAmFvC"}
|
|
@@ -1,162 +1,23 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
/**
|
|
3
|
-
* The per-account user shape carried by a {@link SwitchableAccount}. The SDK's
|
|
4
|
-
* canonical {@link User} document — either the freshest `useOxy().user` (the
|
|
5
|
-
* active row), a profile resolved via `oxyServices.getUsersByIds()` (every other
|
|
6
|
-
* device row), or the `account` document embedded in an account-graph node.
|
|
7
|
-
*/
|
|
8
|
-
export type SwitchableAccountUser = User;
|
|
9
|
-
/**
|
|
10
|
-
* One account the signed-in user can switch INTO, in the uniform switch model.
|
|
11
|
-
*
|
|
12
|
-
* A switchable account is either a device sign-in, an account-graph node (owned
|
|
13
|
-
* org / shared-with-you), or BOTH (an account that has been switched into
|
|
14
|
-
* becomes a device session while still being a graph node — the two are deduped
|
|
15
|
-
* into a single row). Every row carries a canonical `accountId` (the uniform
|
|
16
|
-
* switch key passed to `switchToAccount`); `sessionId` is present IFF the
|
|
17
|
-
* account is currently signed in on THIS device.
|
|
18
|
-
*/
|
|
19
|
-
export interface SwitchableAccount {
|
|
20
|
-
/**
|
|
21
|
-
* Canonical account id (the underlying `User._id`). The single key EVERY
|
|
22
|
-
* switch uses — `switchToAccount(accountId)`. Always present.
|
|
23
|
-
*/
|
|
24
|
-
accountId: string;
|
|
25
|
-
/**
|
|
26
|
-
* Device session id, present IFF this account is signed in on THIS device.
|
|
27
|
-
* Absent for a graph account not yet switched into. Used only for
|
|
28
|
-
* device-scoped actions (per-account sign-out via `removeSession`); switching
|
|
29
|
-
* ALWAYS goes through `switchToAccount(accountId)`.
|
|
30
|
-
*/
|
|
31
|
-
sessionId?: string;
|
|
32
|
-
/**
|
|
33
|
-
* Device-local refresh-cookie slot index (0..N-1), when the underlying
|
|
34
|
-
* `ClientSession` carries one (web silent-switch). Absent on native and for
|
|
35
|
-
* graph-only rows.
|
|
36
|
-
*/
|
|
37
|
-
authuser?: number;
|
|
38
|
-
/** Whether this account is the currently-active one. */
|
|
39
|
-
isCurrent: boolean;
|
|
40
|
-
/** Whether this account is signed in on THIS device (has a `sessionId`). */
|
|
41
|
-
onDevice: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* The caller's relationship to this account when it appears in the account
|
|
44
|
-
* graph: `self` (the caller's own personal account), `owner` (an org/project/
|
|
45
|
-
* bot the caller owns), or `member` (shared with the caller). Absent for an
|
|
46
|
-
* independent device sign-in that is NOT in the active account's graph.
|
|
47
|
-
*/
|
|
48
|
-
relationship?: AccountRelationship;
|
|
49
|
-
/** Account classification (personal/organization/…). Cosmetic badge only. */
|
|
50
|
-
kind?: AccountKind;
|
|
51
|
-
/** Parent account id for 2-level tree grouping, or `null` for a root. */
|
|
52
|
-
parentAccountId?: string | null;
|
|
53
|
-
/**
|
|
54
|
-
* The caller's effective membership (role + permissions) in this account when
|
|
55
|
-
* it appears in the graph, or `null`/absent otherwise. Use `permissions` to
|
|
56
|
-
* gate per-account settings UI.
|
|
57
|
-
*/
|
|
58
|
-
callerMembership?: AccountMember | null;
|
|
59
|
-
/** Friendly display name (never blank — falls back to a handle/sentinel). */
|
|
60
|
-
displayName: string;
|
|
61
|
-
/**
|
|
62
|
-
* Real account email, or `null` when the account genuinely has none. NEVER a
|
|
63
|
-
* synthesized `username@oxy.so` — a missing email falls back to the `@handle`
|
|
64
|
-
* secondary line.
|
|
65
|
-
*/
|
|
66
|
-
email: string | null;
|
|
67
|
-
/** Resolved avatar thumbnail URL, or `undefined` when the account has no avatar. */
|
|
68
|
-
avatarUrl?: string;
|
|
69
|
-
/** Account's preferred Bloom color preset, or `null` when unset. */
|
|
70
|
-
color: string | null;
|
|
71
|
-
/** The underlying per-account user payload. */
|
|
72
|
-
user: SwitchableAccountUser;
|
|
73
|
-
}
|
|
1
|
+
import type { SwitchableAccount } from '@oxyhq/core';
|
|
74
2
|
export interface UseSwitchableAccountsResult {
|
|
75
3
|
/** Every switchable account (device sign-ins + linked graph accounts). */
|
|
76
4
|
accounts: SwitchableAccount[];
|
|
77
|
-
/** True until the
|
|
5
|
+
/** True until the initial account-list fetch settles with no data yet. */
|
|
78
6
|
isLoading: boolean;
|
|
79
|
-
/** The currently-active session id
|
|
7
|
+
/** The currently-active account's device session id, or `null`. */
|
|
80
8
|
currentSessionId: string | null;
|
|
81
9
|
}
|
|
82
|
-
/** The minimal device-session shape {@link buildSwitchableAccounts} reads. */
|
|
83
|
-
export interface SwitchableSessionInput {
|
|
84
|
-
sessionId: string;
|
|
85
|
-
userId?: string;
|
|
86
|
-
authuser?: number;
|
|
87
|
-
}
|
|
88
|
-
export interface BuildSwitchableAccountsInput {
|
|
89
|
-
/** Device sessions projected from the server-authoritative `SessionClient`. */
|
|
90
|
-
sessions: SwitchableSessionInput[];
|
|
91
|
-
/** The currently-active session id. */
|
|
92
|
-
activeSessionId: string | null;
|
|
93
|
-
/** The freshest copy of the active account's user (`useOxy().user`). */
|
|
94
|
-
liveUser: User | null;
|
|
95
|
-
isAuthenticated: boolean;
|
|
96
|
-
/** The account graph under the active account (`useOxy().accounts`). */
|
|
97
|
-
graph: AccountNode[];
|
|
98
|
-
/** Per-device-account profiles resolved via `getUsersByIds()`, keyed by id. */
|
|
99
|
-
profilesById: Map<string, User>;
|
|
100
|
-
locale: string;
|
|
101
|
-
/** Resolves a file id to a thumbnail URL (bound to `getFileDownloadUrl`). */
|
|
102
|
-
resolveAvatarUrl: (avatar: string | null | undefined) => string | undefined;
|
|
103
|
-
}
|
|
104
10
|
/**
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
* `
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* At most ONE entry is ever marked current. Runs over DEVICE rows only (graph
|
|
117
|
-
* rows are never active — the active account is always a device session), so the
|
|
118
|
-
* single-account fallback counts device rows.
|
|
119
|
-
*
|
|
120
|
-
* Pure & side-effect free so it is unit-testable without rendering React.
|
|
121
|
-
*/
|
|
122
|
-
export declare function markCurrentAccount(accounts: SwitchableAccount[], activeSessionId: string | null | undefined, liveUserId: string | null | undefined, isAuthenticated: boolean): SwitchableAccount[];
|
|
123
|
-
/**
|
|
124
|
-
* Pure union of device sign-ins and account-graph nodes into the flat
|
|
125
|
-
* {@link SwitchableAccount}[] the switchers render. Extracted so the merge /
|
|
126
|
-
* dedup semantics are unit-testable without rendering React.
|
|
127
|
-
*
|
|
128
|
-
* Order: device rows first (in session order, current flagged), then graph-only
|
|
129
|
-
* rows (in graph order). An account present as BOTH a device session and a graph
|
|
130
|
-
* node is deduped into ONE device row enriched with the graph metadata
|
|
131
|
-
* (relationship / kind / parent / membership).
|
|
132
|
-
*/
|
|
133
|
-
export declare function buildSwitchableAccounts(input: BuildSwitchableAccountsInput): SwitchableAccount[];
|
|
134
|
-
/**
|
|
135
|
-
* Resolve every account the signed-in user can switch into — device sign-ins
|
|
136
|
-
* AND linked graph accounts (owned orgs + shared-with-you) — as one flat list
|
|
137
|
-
* with real per-account name / email / avatar / color, deduped by account id.
|
|
138
|
-
*
|
|
139
|
-
* ## Data sources
|
|
140
|
-
*
|
|
141
|
-
* - Device sign-ins: `useOxy().sessions` — a `ClientSession[]` projected by
|
|
142
|
-
* `OxyContext.syncFromClient` from the server-authoritative `SessionClient`.
|
|
143
|
-
* Each session carries only `sessionId` + `userId`, so this hook additionally
|
|
144
|
-
* fetches every device account's profile via `oxyServices.getUsersByIds()`.
|
|
145
|
-
* The ACTIVE row always uses `useOxy().user` directly (the freshest copy).
|
|
146
|
-
* - Linked accounts: `useOxy().accounts` — the `AccountNode[]` graph the context
|
|
147
|
-
* loads from `GET /accounts`. Each node already embeds its `account` `User`
|
|
148
|
-
* document, so graph-only rows need no extra fetch.
|
|
149
|
-
*
|
|
150
|
-
* An account present as BOTH a device session and a graph node is deduped into
|
|
151
|
-
* ONE row (see {@link buildSwitchableAccounts}). EVERY row switches the same
|
|
152
|
-
* way — through `useOxy().switchToAccount(row.accountId)`.
|
|
153
|
-
*
|
|
154
|
-
* ## Error handling
|
|
155
|
-
*
|
|
156
|
-
* `getUsersByIds()` resolves to `[]` on a failed chunk (logged internally)
|
|
157
|
-
* rather than throwing. Device accounts whose profile could not be resolved are
|
|
158
|
-
* omitted until a subsequent fetch succeeds (except the active one, which never
|
|
159
|
-
* depends on this fetch); graph accounts are unaffected.
|
|
11
|
+
* Every account the signed-in user can switch into — device sign-ins AND linked
|
|
12
|
+
* graph accounts (owned orgs + shared-with-you) — as one flat, deduped list with
|
|
13
|
+
* real per-account name / email / avatar / color.
|
|
14
|
+
*
|
|
15
|
+
* This is a thin binding over the shared `AccountDialogController` in
|
|
16
|
+
* `@oxyhq/core` (the SAME headless source the {@link OxyAccountDialog} renders),
|
|
17
|
+
* so there is ONE projection (`projectSwitchableAccounts`) and one switch path
|
|
18
|
+
* (`controller.switchTo`) across the whole SDK — the local duplicate projection
|
|
19
|
+
* this hook used to own has been removed. Every switch routes through
|
|
20
|
+
* `useOxy().switchToAccount(accountId)` (or the dialog's row press).
|
|
160
21
|
*/
|
|
161
22
|
export declare function useSwitchableAccounts(): UseSwitchableAccountsResult;
|
|
162
23
|
//# sourceMappingURL=useSwitchableAccounts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSwitchableAccounts.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useSwitchableAccounts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSwitchableAccounts.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useSwitchableAccounts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAyB,MAAM,aAAa,CAAC;AAG5E,MAAM,WAAW,2BAA2B;IACxC,0EAA0E;IAC1E,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,0EAA0E;IAC1E,SAAS,EAAE,OAAO,CAAC;IACnB,mEAAmE;IACnE,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAgBD;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,IAAI,2BAA2B,CAuBnE"}
|