@elevasis/ui 1.3.3 → 1.3.5
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/dist/api/index.js +1 -1
- package/dist/auth/index.d.ts +174 -14
- package/dist/{chunk-XLV6LYN2.js → chunk-LBPALY25.js} +0 -1
- package/dist/{chunk-LTQAAIGE.js → chunk-Y2I5JJ3N.js} +1 -1
- package/dist/hooks/index.d.ts +4401 -11
- package/dist/hooks/published.d.ts +5013 -19
- package/dist/index.d.ts +6316 -15
- package/dist/index.js +18 -97
- package/dist/initialization/index.d.ts +2222 -22
- package/dist/organization/index.d.ts +266 -21
- package/dist/profile/index.d.ts +2158 -14
- package/dist/provider/index.d.ts +266 -7
- package/dist/provider/index.js +12 -3
- package/dist/provider/published.d.ts +263 -9
- package/dist/provider/published.js +2 -2
- package/package.json +47 -3
- package/dist/auth/guards/AdminGuard.d.ts +0 -32
- package/dist/auth/guards/AdminGuard.d.ts.map +0 -1
- package/dist/auth/guards/ProtectedRoute.d.ts +0 -60
- package/dist/auth/guards/ProtectedRoute.d.ts.map +0 -1
- package/dist/auth/guards/__tests__/AdminGuard.test.d.ts +0 -12
- package/dist/auth/guards/__tests__/AdminGuard.test.d.ts.map +0 -1
- package/dist/auth/guards/__tests__/ProtectedRoute.test.d.ts +0 -14
- package/dist/auth/guards/__tests__/ProtectedRoute.test.d.ts.map +0 -1
- package/dist/auth/index.d.ts.map +0 -1
- package/dist/hooks/command-queue/index.d.ts +0 -7
- package/dist/hooks/command-queue/index.d.ts.map +0 -1
- package/dist/hooks/command-queue/useCommandQueue.d.ts +0 -33
- package/dist/hooks/command-queue/useCommandQueue.d.ts.map +0 -1
- package/dist/hooks/command-queue/useCommandQueueTotals.d.ts +0 -17
- package/dist/hooks/command-queue/useCommandQueueTotals.d.ts.map +0 -1
- package/dist/hooks/command-queue/useDeleteTask.d.ts +0 -5
- package/dist/hooks/command-queue/useDeleteTask.d.ts.map +0 -1
- package/dist/hooks/command-queue/usePatchTask.d.ts +0 -6
- package/dist/hooks/command-queue/usePatchTask.d.ts.map +0 -1
- package/dist/hooks/command-queue/useSubmitAction.d.ts +0 -29
- package/dist/hooks/command-queue/useSubmitAction.d.ts.map +0 -1
- package/dist/hooks/executions/index.d.ts +0 -16
- package/dist/hooks/executions/index.d.ts.map +0 -1
- package/dist/hooks/executions/useBulkDeleteExecutions.d.ts +0 -15
- package/dist/hooks/executions/useBulkDeleteExecutions.d.ts.map +0 -1
- package/dist/hooks/executions/useCancelExecution.d.ts +0 -20
- package/dist/hooks/executions/useCancelExecution.d.ts.map +0 -1
- package/dist/hooks/executions/useDeleteExecution.d.ts +0 -13
- package/dist/hooks/executions/useDeleteExecution.d.ts.map +0 -1
- package/dist/hooks/executions/useExecuteAsync.d.ts +0 -21
- package/dist/hooks/executions/useExecuteAsync.d.ts.map +0 -1
- package/dist/hooks/executions/useExecution.d.ts +0 -10
- package/dist/hooks/executions/useExecution.d.ts.map +0 -1
- package/dist/hooks/executions/useExecutions.d.ts +0 -16
- package/dist/hooks/executions/useExecutions.d.ts.map +0 -1
- package/dist/hooks/executions/useResourceDefinition.d.ts +0 -9
- package/dist/hooks/executions/useResourceDefinition.d.ts.map +0 -1
- package/dist/hooks/executions/useResources.d.ts +0 -15
- package/dist/hooks/executions/useResources.d.ts.map +0 -1
- package/dist/hooks/executions/useRetryExecution.d.ts +0 -16
- package/dist/hooks/executions/useRetryExecution.d.ts.map +0 -1
- package/dist/hooks/feature-access/createUseFeatureAccess.d.ts +0 -44
- package/dist/hooks/feature-access/createUseFeatureAccess.d.ts.map +0 -1
- package/dist/hooks/feature-access/index.d.ts +0 -2
- package/dist/hooks/feature-access/index.d.ts.map +0 -1
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/hooks/monitoring/index.d.ts +0 -9
- package/dist/hooks/monitoring/index.d.ts.map +0 -1
- package/dist/hooks/monitoring/useActivities.d.ts +0 -52
- package/dist/hooks/monitoring/useActivities.d.ts.map +0 -1
- package/dist/hooks/monitoring/useCostSummary.d.ts +0 -7
- package/dist/hooks/monitoring/useCostSummary.d.ts.map +0 -1
- package/dist/hooks/monitoring/useExecutionHealth.d.ts +0 -10
- package/dist/hooks/monitoring/useExecutionHealth.d.ts.map +0 -1
- package/dist/hooks/monitoring/useExecutionLogs.d.ts +0 -56
- package/dist/hooks/monitoring/useExecutionLogs.d.ts.map +0 -1
- package/dist/hooks/monitoring/useNotifications.d.ts +0 -11
- package/dist/hooks/monitoring/useNotifications.d.ts.map +0 -1
- package/dist/hooks/notifications/index.d.ts +0 -8
- package/dist/hooks/notifications/index.d.ts.map +0 -1
- package/dist/hooks/notifications/useMarkAllAsRead.d.ts +0 -2
- package/dist/hooks/notifications/useMarkAllAsRead.d.ts.map +0 -1
- package/dist/hooks/notifications/useMarkAsRead.d.ts +0 -2
- package/dist/hooks/notifications/useMarkAsRead.d.ts.map +0 -1
- package/dist/hooks/notifications/useNotificationCount.d.ts +0 -8
- package/dist/hooks/notifications/useNotificationCount.d.ts.map +0 -1
- package/dist/hooks/observability/index.d.ts +0 -19
- package/dist/hooks/observability/index.d.ts.map +0 -1
- package/dist/hooks/observability/useBusinessImpact.d.ts +0 -9
- package/dist/hooks/observability/useBusinessImpact.d.ts.map +0 -1
- package/dist/hooks/observability/useCostBreakdown.d.ts +0 -10
- package/dist/hooks/observability/useCostBreakdown.d.ts.map +0 -1
- package/dist/hooks/observability/useCostByModel.d.ts +0 -3
- package/dist/hooks/observability/useCostByModel.d.ts.map +0 -1
- package/dist/hooks/observability/useCostTrends.d.ts +0 -3
- package/dist/hooks/observability/useCostTrends.d.ts.map +0 -1
- package/dist/hooks/observability/useDashboardMetrics.d.ts +0 -3
- package/dist/hooks/observability/useDashboardMetrics.d.ts.map +0 -1
- package/dist/hooks/observability/useErrorAnalysis.d.ts +0 -7
- package/dist/hooks/observability/useErrorAnalysis.d.ts.map +0 -1
- package/dist/hooks/observability/useErrorDetails.d.ts +0 -20
- package/dist/hooks/observability/useErrorDetails.d.ts.map +0 -1
- package/dist/hooks/observability/useErrorDistribution.d.ts +0 -12
- package/dist/hooks/observability/useErrorDistribution.d.ts.map +0 -1
- package/dist/hooks/observability/useErrorTrends.d.ts +0 -12
- package/dist/hooks/observability/useErrorTrends.d.ts.map +0 -1
- package/dist/hooks/observability/useResolveError.d.ts +0 -17
- package/dist/hooks/observability/useResolveError.d.ts.map +0 -1
- package/dist/hooks/observability/useTopFailingResources.d.ts +0 -13
- package/dist/hooks/observability/useTopFailingResources.d.ts.map +0 -1
- package/dist/hooks/published.d.ts.map +0 -1
- package/dist/hooks/scheduling/index.d.ts +0 -5
- package/dist/hooks/scheduling/index.d.ts.map +0 -1
- package/dist/hooks/scheduling/useSchedules.d.ts +0 -185
- package/dist/hooks/scheduling/useSchedules.d.ts.map +0 -1
- package/dist/hooks/sessions/index.d.ts +0 -8
- package/dist/hooks/sessions/index.d.ts.map +0 -1
- package/dist/hooks/sessions/useSessionExecutions.d.ts +0 -13
- package/dist/hooks/sessions/useSessionExecutions.d.ts.map +0 -1
- package/dist/hooks/sessions/useSessionMessages.d.ts +0 -7
- package/dist/hooks/sessions/useSessionMessages.d.ts.map +0 -1
- package/dist/hooks/sessions/useSessions.d.ts +0 -26
- package/dist/hooks/sessions/useSessions.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/initialization/InitializationProvider.d.ts +0 -48
- package/dist/initialization/InitializationProvider.d.ts.map +0 -1
- package/dist/initialization/hooks/useAppInitialization.d.ts +0 -32
- package/dist/initialization/hooks/useAppInitialization.d.ts.map +0 -1
- package/dist/initialization/index.d.ts.map +0 -1
- package/dist/organization/context/OrganizationProvider.d.ts +0 -20
- package/dist/organization/context/OrganizationProvider.d.ts.map +0 -1
- package/dist/organization/hooks/useOrgInitialization.d.ts +0 -56
- package/dist/organization/hooks/useOrgInitialization.d.ts.map +0 -1
- package/dist/organization/index.d.ts.map +0 -1
- package/dist/profile/context/ProfileProvider.d.ts +0 -27
- package/dist/profile/context/ProfileProvider.d.ts.map +0 -1
- package/dist/profile/hooks/useUserProfile.d.ts +0 -31
- package/dist/profile/hooks/useUserProfile.d.ts.map +0 -1
- package/dist/profile/index.d.ts.map +0 -1
- package/dist/provider/CoreAuthKitInner.d.ts +0 -12
- package/dist/provider/CoreAuthKitInner.d.ts.map +0 -1
- package/dist/provider/ElevasisCoreProvider.d.ts +0 -39
- package/dist/provider/ElevasisCoreProvider.d.ts.map +0 -1
- package/dist/provider/ElevasisServiceContext.d.ts +0 -31
- package/dist/provider/ElevasisServiceContext.d.ts.map +0 -1
- package/dist/provider/__tests__/CoreAuthKitInner.test.d.ts +0 -2
- package/dist/provider/__tests__/CoreAuthKitInner.test.d.ts.map +0 -1
- package/dist/provider/__tests__/ElevasisCoreProvider.test.d.ts +0 -2
- package/dist/provider/__tests__/ElevasisCoreProvider.test.d.ts.map +0 -1
- package/dist/provider/index.d.ts.map +0 -1
- package/dist/provider/published.d.ts.map +0 -1
- package/dist/provider/types.d.ts +0 -143
- package/dist/provider/types.d.ts.map +0 -1
- package/dist/provider/types.js +0 -1
- package/dist/sdk-barrel.d.ts +0 -20
- package/dist/sdk-barrel.d.ts.map +0 -1
- package/dist/theme/cssVariables.d.ts +0 -12
- package/dist/theme/cssVariables.d.ts.map +0 -1
- package/dist/theme/cssVariables.js +0 -93
- package/dist/theme/index.d.ts +0 -4
- package/dist/theme/index.d.ts.map +0 -1
- package/dist/theme/index.js +0 -1
- package/dist/theme/presets/__tests__/getPreset.test.d.ts +0 -2
- package/dist/theme/presets/__tests__/getPreset.test.d.ts.map +0 -1
- package/dist/theme/presets/abyss.d.ts +0 -3
- package/dist/theme/presets/abyss.d.ts.map +0 -1
- package/dist/theme/presets/abyss.js +0 -54
- package/dist/theme/presets/aurora.d.ts +0 -8
- package/dist/theme/presets/aurora.d.ts.map +0 -1
- package/dist/theme/presets/aurora.js +0 -59
- package/dist/theme/presets/canopy.d.ts +0 -3
- package/dist/theme/presets/canopy.d.ts.map +0 -1
- package/dist/theme/presets/canopy.js +0 -58
- package/dist/theme/presets/cyber-flux.d.ts +0 -8
- package/dist/theme/presets/cyber-flux.d.ts.map +0 -1
- package/dist/theme/presets/cyber-flux.js +0 -66
- package/dist/theme/presets/cyber-strike.d.ts +0 -9
- package/dist/theme/presets/cyber-strike.d.ts.map +0 -1
- package/dist/theme/presets/cyber-strike.js +0 -62
- package/dist/theme/presets/cyber-void.d.ts +0 -8
- package/dist/theme/presets/cyber-void.d.ts.map +0 -1
- package/dist/theme/presets/cyber-void.js +0 -62
- package/dist/theme/presets/cyber-volt.d.ts +0 -8
- package/dist/theme/presets/cyber-volt.d.ts.map +0 -1
- package/dist/theme/presets/cyber-volt.js +0 -66
- package/dist/theme/presets/default.d.ts +0 -4
- package/dist/theme/presets/default.d.ts.map +0 -1
- package/dist/theme/presets/ember.d.ts +0 -8
- package/dist/theme/presets/ember.d.ts.map +0 -1
- package/dist/theme/presets/ember.js +0 -63
- package/dist/theme/presets/honey.d.ts +0 -3
- package/dist/theme/presets/honey.d.ts.map +0 -1
- package/dist/theme/presets/honey.js +0 -62
- package/dist/theme/presets/index.d.ts +0 -6
- package/dist/theme/presets/index.d.ts.map +0 -1
- package/dist/theme/presets/index.js +0 -39
- package/dist/theme/presets/midnight.d.ts +0 -8
- package/dist/theme/presets/midnight.d.ts.map +0 -1
- package/dist/theme/presets/midnight.js +0 -68
- package/dist/theme/presets/obsidian.d.ts +0 -3
- package/dist/theme/presets/obsidian.d.ts.map +0 -1
- package/dist/theme/presets/obsidian.js +0 -56
- package/dist/theme/presets/regal.d.ts +0 -8
- package/dist/theme/presets/regal.d.ts.map +0 -1
- package/dist/theme/presets/regal.js +0 -63
- package/dist/theme/presets/rose-gold.d.ts +0 -8
- package/dist/theme/presets/rose-gold.d.ts.map +0 -1
- package/dist/theme/presets/rose-gold.js +0 -63
- package/dist/theme/presets/slate.d.ts +0 -3
- package/dist/theme/presets/slate.d.ts.map +0 -1
- package/dist/theme/presets/slate.js +0 -56
- package/dist/theme/presets/tactical.d.ts +0 -8
- package/dist/theme/presets/tactical.d.ts.map +0 -1
- package/dist/theme/presets/tactical.js +0 -57
- package/dist/theme/presets/types.d.ts +0 -26
- package/dist/theme/presets/types.d.ts.map +0 -1
- package/dist/theme/presets/types.js +0 -1
package/dist/api/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '../chunk-XCYKC6OZ.js';
|
|
2
|
-
export { ApiClientProvider, useApiClient, useApiClientContext } from '../chunk-
|
|
2
|
+
export { ApiClientProvider, useApiClient, useApiClientContext } from '../chunk-LBPALY25.js';
|
|
3
3
|
import '../chunk-LFYO3MDC.js';
|
|
4
4
|
import '../chunk-4VGWQ5AN.js';
|
|
5
5
|
import '../chunk-DD3CCMCZ.js';
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -1,16 +1,176 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
interface AuthContextValue {
|
|
6
|
+
user: {
|
|
7
|
+
id: string;
|
|
8
|
+
} | null;
|
|
9
|
+
isLoading: boolean;
|
|
10
|
+
getAccessToken: () => Promise<string>;
|
|
11
|
+
organizationId?: string | null;
|
|
12
|
+
/**
|
|
13
|
+
* Trigger WorkOS AuthKit's sign-in flow (redirect to WorkOS hosted auth page).
|
|
14
|
+
* Used by ProtectedRoute for auto-recovery when `canRecover()` returns true.
|
|
15
|
+
*/
|
|
16
|
+
signIn: (options?: {
|
|
17
|
+
state?: {
|
|
18
|
+
returnTo?: string;
|
|
19
|
+
};
|
|
20
|
+
}) => void;
|
|
21
|
+
/**
|
|
22
|
+
* Returns true when a previous session can be recovered (refresh token
|
|
23
|
+
* exists in storage). ProtectedRoute calls `signIn()` only when this returns
|
|
24
|
+
* true; otherwise it navigates to the login page.
|
|
25
|
+
*
|
|
26
|
+
* Explicit logout clears the stored token, so canRecover() returns false
|
|
27
|
+
* and the user sees the login page as expected.
|
|
28
|
+
*/
|
|
29
|
+
canRecover: () => boolean;
|
|
30
|
+
}
|
|
31
|
+
declare function useAuthContext(): AuthContextValue;
|
|
32
|
+
declare function AuthProvider({ value, children }: {
|
|
33
|
+
value: AuthContextValue;
|
|
34
|
+
children: ReactNode;
|
|
35
|
+
}): react.FunctionComponentElement<react.ProviderProps<AuthContextValue | null>>;
|
|
36
|
+
|
|
1
37
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
38
|
+
* Returns a stable reference to getAccessToken that won't change between renders
|
|
39
|
+
*
|
|
40
|
+
* This prevents SSE connections from reconnecting unnecessarily when the
|
|
41
|
+
* WorkOS useAuth hook returns a new getAccessToken function reference
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```tsx
|
|
45
|
+
* const getAccessToken = useStableAccessToken()
|
|
46
|
+
*
|
|
47
|
+
* useEffect(() => {
|
|
48
|
+
* fetchEventSourceWithTokenRefresh({
|
|
49
|
+
* getToken: getAccessToken,
|
|
50
|
+
* // ...
|
|
51
|
+
* })
|
|
52
|
+
* }, [getAccessToken]) // Won't re-run on every render
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
declare function useStableAccessToken(): () => Promise<string>;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Checks WorkOS session validity when window/tab regains focus
|
|
59
|
+
*
|
|
60
|
+
* When window or tab becomes visible after inactivity, validates session
|
|
61
|
+
* by attempting to get access token. If session expired (WorkOS inactivity
|
|
62
|
+
* timeout exceeded), signs out user and redirects to login.
|
|
63
|
+
*
|
|
64
|
+
* How it works:
|
|
65
|
+
* 1. Window/tab regains focus after inactivity
|
|
66
|
+
* 2. Cancel all pending queries to prevent 401 error cascade
|
|
67
|
+
* 3. Attempt to get access token from WorkOS
|
|
68
|
+
* 4. If successful: Resume queries with fresh token
|
|
69
|
+
* 5. If failed (session expired): Sign out and redirect to login
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* // In __root.tsx
|
|
73
|
+
* export function RootLayoutComponent() {
|
|
74
|
+
* useSessionCheck()
|
|
75
|
+
* return <YourApp />
|
|
76
|
+
* }
|
|
77
|
+
*/
|
|
78
|
+
declare function useSessionCheck(): void;
|
|
79
|
+
|
|
80
|
+
interface InitializationError {
|
|
81
|
+
layer: 'auth' | 'profile' | 'organization';
|
|
82
|
+
message: string;
|
|
83
|
+
originalError?: Error;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
interface ProtectedRouteProps {
|
|
87
|
+
children: ReactNode;
|
|
88
|
+
/**
|
|
89
|
+
* Path to redirect to when user is unauthenticated and the auth adapter
|
|
90
|
+
* does not provide a `signIn` function.
|
|
91
|
+
* @default '/login'
|
|
92
|
+
*/
|
|
93
|
+
redirectTo?: string;
|
|
94
|
+
/**
|
|
95
|
+
* Rendered while initialization is in progress.
|
|
96
|
+
* When not provided, nothing is rendered during initialization.
|
|
97
|
+
*/
|
|
98
|
+
fallback?: ReactNode;
|
|
99
|
+
/**
|
|
100
|
+
* Rendered when initialization fails with a non-organization error.
|
|
101
|
+
* Receives the error and a retry callback.
|
|
102
|
+
* When not provided, the error is silently swallowed (children not rendered).
|
|
103
|
+
*/
|
|
104
|
+
errorFallback?: (error: InitializationError, retry: () => void) => ReactNode;
|
|
105
|
+
/**
|
|
106
|
+
* When true (default), waits for both user AND organization to be ready
|
|
107
|
+
* before rendering children. When false, only waits for user readiness.
|
|
108
|
+
* @default true
|
|
109
|
+
*/
|
|
110
|
+
waitForOrganization?: boolean;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Headless route guard for authenticated pages.
|
|
114
|
+
*
|
|
115
|
+
* Reads initialization state from the nearest InitializationProvider.
|
|
116
|
+
*
|
|
117
|
+
* When `canRecover()` returns true (refresh token exists), unauthenticated users
|
|
118
|
+
* are sent directly to WorkOS AuthKit via `signIn()`. WorkOS checks its
|
|
119
|
+
* server-side session and either signs the user in immediately (page-reload case)
|
|
120
|
+
* or shows a login form (logged-out case). Explicit logout destroys the
|
|
121
|
+
* server-side session, so the next auto-signIn correctly presents a login form
|
|
122
|
+
* rather than looping.
|
|
123
|
+
*
|
|
124
|
+
* When `canRecover()` returns false, falls back to navigating to `redirectTo`
|
|
125
|
+
* (default: '/login') with a `returnTo` search param.
|
|
126
|
+
*
|
|
127
|
+
* Organization-layer errors are allowed through -- routes like /invitations
|
|
128
|
+
* must be accessible even when the user has no org membership.
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* // With custom fallback (your Mantine loader):
|
|
132
|
+
* <ProtectedRoute fallback={<AppShellLoader />}>
|
|
133
|
+
* <DashboardPage />
|
|
134
|
+
* </ProtectedRoute>
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* // Wait only for user, not org (e.g. /invitations route):
|
|
138
|
+
* <ProtectedRoute waitForOrganization={false}>
|
|
139
|
+
* <InvitationsPage />
|
|
140
|
+
* </ProtectedRoute>
|
|
141
|
+
*/
|
|
142
|
+
declare function ProtectedRoute({ children, redirectTo, fallback, errorFallback, waitForOrganization }: ProtectedRouteProps): react_jsx_runtime.JSX.Element | null;
|
|
143
|
+
|
|
144
|
+
interface AdminGuardProps {
|
|
145
|
+
children: ReactNode;
|
|
146
|
+
/**
|
|
147
|
+
* Path to redirect non-admin users to.
|
|
148
|
+
* @default '/'
|
|
149
|
+
*/
|
|
150
|
+
redirectTo?: string;
|
|
151
|
+
/**
|
|
152
|
+
* Rendered while user readiness is being determined.
|
|
153
|
+
* When not provided, nothing is rendered during initialization.
|
|
154
|
+
*/
|
|
155
|
+
fallback?: ReactNode;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Headless route guard for platform admin pages.
|
|
159
|
+
*
|
|
160
|
+
* Reads `profile.is_platform_admin` from the nearest InitializationProvider.
|
|
161
|
+
* Non-admin users are redirected to `redirectTo` (default: '/').
|
|
162
|
+
*
|
|
163
|
+
* Must be nested inside a ProtectedRoute (or equivalent) so that
|
|
164
|
+
* `userReady` is guaranteed to be true when this guard runs.
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* <ProtectedRoute>
|
|
168
|
+
* <AdminGuard fallback={<AppShellLoader />}>
|
|
169
|
+
* <AdminDashboard />
|
|
170
|
+
* </AdminGuard>
|
|
171
|
+
* </ProtectedRoute>
|
|
10
172
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export
|
|
14
|
-
export {
|
|
15
|
-
export { AdminGuard, type AdminGuardProps } from './guards/AdminGuard';
|
|
16
|
-
//# sourceMappingURL=index.d.ts.map
|
|
173
|
+
declare function AdminGuard({ children, redirectTo, fallback }: AdminGuardProps): react_jsx_runtime.JSX.Element | null;
|
|
174
|
+
|
|
175
|
+
export { AdminGuard, AuthProvider, ProtectedRoute, useAuthContext, useSessionCheck as useRefocusSessionCheck, useSessionCheck, useStableAccessToken };
|
|
176
|
+
export type { AdminGuardProps, AuthContextValue, ProtectedRouteProps };
|
|
@@ -21,7 +21,6 @@ function ApiClientProvider({
|
|
|
21
21
|
}) {
|
|
22
22
|
const getOrganizationId = useMemo(
|
|
23
23
|
() => getOrganizationIdProp ?? (() => organizationId ?? null),
|
|
24
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
25
24
|
[getOrganizationIdProp, organizationId]
|
|
26
25
|
);
|
|
27
26
|
const value = useMemo(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NotificationProvider } from './chunk-TIRMFDM4.js';
|
|
2
2
|
import { OrganizationProvider } from './chunk-SFF5MJEI.js';
|
|
3
|
-
import { ApiClientProvider, useApiClient } from './chunk-
|
|
3
|
+
import { ApiClientProvider, useApiClient } from './chunk-LBPALY25.js';
|
|
4
4
|
import { InitializationProvider } from './chunk-NEK6JKPW.js';
|
|
5
5
|
import { ProfileProvider } from './chunk-L2CM2CUA.js';
|
|
6
6
|
import { ElevasisServiceProvider, useElevasisServices } from './chunk-KA7LO7U5.js';
|