@alneas/appkit-react 0.1.0 → 0.2.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/CHANGELOG.md +53 -0
- package/README.md +85 -15
- package/consumer-ai/SKILL.md +12 -0
- package/consumer-ai/api-index.json +103754 -0
- package/consumer-ai/package-context.json +409 -0
- package/dist/ai/action/ExecutionHistory.cjs.map +1 -1
- package/dist/ai/action/ExecutionHistory.d.cts +32 -2
- package/dist/ai/action/ExecutionHistory.d.ts +32 -2
- package/dist/ai/action/ExecutionHistory.js.map +1 -1
- package/dist/ai/action/ScreenActionContext.cjs.map +1 -1
- package/dist/ai/action/ScreenActionContext.d.cts +15 -2
- package/dist/ai/action/ScreenActionContext.d.ts +15 -2
- package/dist/ai/action/ScreenActionContext.js.map +1 -1
- package/dist/ai/action/context.cjs.map +1 -1
- package/dist/ai/action/context.d.cts +19 -3
- package/dist/ai/action/context.d.ts +19 -3
- package/dist/ai/action/context.js.map +1 -1
- package/dist/ai/action/types.d.cts +35 -3
- package/dist/ai/action/types.d.ts +35 -3
- package/dist/ai/action/use-execution-session.cjs.map +1 -1
- package/dist/ai/action/use-execution-session.d.cts +17 -1
- package/dist/ai/action/use-execution-session.d.ts +17 -1
- package/dist/ai/action/use-execution-session.js.map +1 -1
- package/dist/ai/action/use-screen-action-registry.cjs.map +1 -1
- package/dist/ai/action/use-screen-action-registry.d.cts +77 -8
- package/dist/ai/action/use-screen-action-registry.d.ts +77 -8
- package/dist/ai/action/use-screen-action-registry.js.map +1 -1
- package/dist/ai/action/use-screen-action.cjs.map +1 -1
- package/dist/ai/action/use-screen-action.d.cts +23 -6
- package/dist/ai/action/use-screen-action.d.ts +23 -6
- package/dist/ai/action/use-screen-action.js.map +1 -1
- package/dist/ai/action/use-screen-context.cjs.map +1 -1
- package/dist/ai/action/use-screen-context.d.cts +42 -5
- package/dist/ai/action/use-screen-context.d.ts +42 -5
- package/dist/ai/action/use-screen-context.js.map +1 -1
- package/dist/ai/ai-chat/transport.cjs.map +1 -1
- package/dist/ai/ai-chat/transport.d.cts +35 -8
- package/dist/ai/ai-chat/transport.d.ts +35 -8
- package/dist/ai/ai-chat/transport.js.map +1 -1
- package/dist/ai/generative-ui/GenerativeUIRenderer.cjs.map +1 -1
- package/dist/ai/generative-ui/GenerativeUIRenderer.d.cts +21 -3
- package/dist/ai/generative-ui/GenerativeUIRenderer.d.ts +21 -3
- package/dist/ai/generative-ui/GenerativeUIRenderer.js.map +1 -1
- package/dist/ai/generative-ui/error-boundary.cjs.map +1 -1
- package/dist/ai/generative-ui/error-boundary.d.cts +98 -2
- package/dist/ai/generative-ui/error-boundary.d.ts +98 -2
- package/dist/ai/generative-ui/error-boundary.js.map +1 -1
- package/dist/ai/generative-ui/registry.cjs.map +1 -1
- package/dist/ai/generative-ui/registry.d.cts +96 -7
- package/dist/ai/generative-ui/registry.d.ts +96 -7
- package/dist/ai/generative-ui/registry.js.map +1 -1
- package/dist/ai/proposal/ProposalFieldReview.cjs.map +1 -1
- package/dist/ai/proposal/ProposalFieldReview.d.cts +170 -8
- package/dist/ai/proposal/ProposalFieldReview.d.ts +170 -8
- package/dist/ai/proposal/ProposalFieldReview.js.map +1 -1
- package/dist/ai/proposal/types.d.cts +97 -26
- package/dist/ai/proposal/types.d.ts +97 -26
- package/dist/ai/proposal/use-proposal-batch-review.cjs.map +1 -1
- package/dist/ai/proposal/use-proposal-batch-review.d.cts +133 -7
- package/dist/ai/proposal/use-proposal-batch-review.d.ts +133 -7
- package/dist/ai/proposal/use-proposal-batch-review.js.map +1 -1
- package/dist/ai/proposal/use-proposal-review.cjs.map +1 -1
- package/dist/ai/proposal/use-proposal-review.d.cts +47 -5
- package/dist/ai/proposal/use-proposal-review.d.ts +47 -5
- package/dist/ai/proposal/use-proposal-review.js.map +1 -1
- package/dist/avatar.svg +1 -0
- package/dist/consumer-ai/SKILL.md +6 -0
- package/dist/consumer-ai/api-index.json +103754 -0
- package/dist/consumer-ai/package-context.json +5 -3
- package/dist/mockServiceWorker.js +361 -0
- package/dist/styles.css +1 -1
- package/dist/tools/components/auth/AuthForms.cjs.map +1 -1
- package/dist/tools/components/auth/AuthForms.d.cts +131 -81
- package/dist/tools/components/auth/AuthForms.d.ts +131 -81
- package/dist/tools/components/auth/AuthForms.js.map +1 -1
- package/dist/tools/components/auth/AuthGuard.cjs.map +1 -1
- package/dist/tools/components/auth/AuthGuard.d.cts +31 -4
- package/dist/tools/components/auth/AuthGuard.d.ts +31 -4
- package/dist/tools/components/auth/AuthGuard.js.map +1 -1
- package/dist/tools/components/auth/AuthProvider.cjs.map +1 -1
- package/dist/tools/components/auth/AuthProvider.d.cts +39 -42
- package/dist/tools/components/auth/AuthProvider.d.ts +39 -42
- package/dist/tools/components/auth/AuthProvider.js.map +1 -1
- package/dist/tools/components/auth/ProtectedRoute.cjs.map +1 -1
- package/dist/tools/components/auth/ProtectedRoute.d.cts +75 -60
- package/dist/tools/components/auth/ProtectedRoute.d.ts +75 -60
- package/dist/tools/components/auth/ProtectedRoute.js.map +1 -1
- package/dist/tools/components/auth/SignInButton.cjs.map +1 -1
- package/dist/tools/components/auth/SignInButton.d.cts +26 -18
- package/dist/tools/components/auth/SignInButton.d.ts +26 -18
- package/dist/tools/components/auth/SignInButton.js.map +1 -1
- package/dist/tools/components/auth/UserProfileProvider.cjs.map +1 -1
- package/dist/tools/components/auth/UserProfileProvider.d.cts +48 -20
- package/dist/tools/components/auth/UserProfileProvider.d.ts +48 -20
- package/dist/tools/components/auth/UserProfileProvider.js.map +1 -1
- package/dist/tools/components/auth/adapters/better-auth-adapter.cjs.map +1 -1
- package/dist/tools/components/auth/adapters/better-auth-adapter.d.cts +371 -51
- package/dist/tools/components/auth/adapters/better-auth-adapter.d.ts +371 -51
- package/dist/tools/components/auth/adapters/better-auth-adapter.js.map +1 -1
- package/dist/tools/components/auth/adapters/mock-adapter.cjs.map +1 -1
- package/dist/tools/components/auth/adapters/mock-adapter.d.cts +149 -28
- package/dist/tools/components/auth/adapters/mock-adapter.d.ts +149 -28
- package/dist/tools/components/auth/adapters/mock-adapter.js.map +1 -1
- package/dist/tools/components/auth/auth-session.cjs.map +1 -1
- package/dist/tools/components/auth/auth-session.d.cts +147 -1
- package/dist/tools/components/auth/auth-session.d.ts +147 -1
- package/dist/tools/components/auth/auth-session.js.map +1 -1
- package/dist/tools/components/auth/session-cache.cjs.map +1 -1
- package/dist/tools/components/auth/session-cache.d.cts +88 -24
- package/dist/tools/components/auth/session-cache.d.ts +88 -24
- package/dist/tools/components/auth/session-cache.js.map +1 -1
- package/dist/tools/components/auth/types.cjs.map +1 -1
- package/dist/tools/components/auth/types.d.cts +329 -106
- package/dist/tools/components/auth/types.d.ts +329 -106
- package/dist/tools/components/auth/types.js.map +1 -1
- package/dist/tools/components/auth/useAuth.cjs.map +1 -1
- package/dist/tools/components/auth/useAuth.d.cts +110 -17
- package/dist/tools/components/auth/useAuth.d.ts +110 -17
- package/dist/tools/components/auth/useAuth.js.map +1 -1
- package/dist/tools/components/auth/useAuthGuard.cjs.map +1 -1
- package/dist/tools/components/auth/useAuthGuard.d.cts +49 -38
- package/dist/tools/components/auth/useAuthGuard.d.ts +49 -38
- package/dist/tools/components/auth/useAuthGuard.js.map +1 -1
- package/dist/tools/components/auth/useRoleCheck.cjs.map +1 -1
- package/dist/tools/components/auth/useRoleCheck.d.cts +48 -1
- package/dist/tools/components/auth/useRoleCheck.d.ts +48 -1
- package/dist/tools/components/auth/useRoleCheck.js.map +1 -1
- package/dist/tools/components/auth/useUserProfile.cjs.map +1 -1
- package/dist/tools/components/auth/useUserProfile.d.cts +66 -1
- package/dist/tools/components/auth/useUserProfile.d.ts +66 -1
- package/dist/tools/components/auth/useUserProfile.js.map +1 -1
- package/dist/tools/components/barcode/BarcodeGenerator.cjs.map +1 -1
- package/dist/tools/components/barcode/BarcodeGenerator.d.cts +32 -18
- package/dist/tools/components/barcode/BarcodeGenerator.d.ts +32 -18
- package/dist/tools/components/barcode/BarcodeGenerator.js.map +1 -1
- package/dist/tools/components/barcode/QRCodeGenerator.cjs +1 -1
- package/dist/tools/components/barcode/QRCodeGenerator.cjs.map +1 -1
- package/dist/tools/components/barcode/QRCodeGenerator.d.cts +20 -13
- package/dist/tools/components/barcode/QRCodeGenerator.d.ts +20 -13
- package/dist/tools/components/barcode/QRCodeGenerator.js +1 -1
- package/dist/tools/components/barcode/QRCodeGenerator.js.map +1 -1
- package/dist/tools/components/barcode/QRCodeScanner.cjs.map +1 -1
- package/dist/tools/components/barcode/QRCodeScanner.d.cts +32 -1
- package/dist/tools/components/barcode/QRCodeScanner.d.ts +32 -1
- package/dist/tools/components/barcode/QRCodeScanner.js.map +1 -1
- package/dist/tools/components/calendar/ResourceCalendar.cjs.map +1 -1
- package/dist/tools/components/calendar/ResourceCalendar.d.cts +17 -42
- package/dist/tools/components/calendar/ResourceCalendar.d.ts +17 -42
- package/dist/tools/components/calendar/ResourceCalendar.js.map +1 -1
- package/dist/tools/components/calendar/views/ResourceView.cjs +1 -1
- package/dist/tools/components/calendar/views/ResourceView.cjs.map +1 -1
- package/dist/tools/components/calendar/views/ResourceView.js +2 -2
- package/dist/tools/components/calendar/views/ResourceView.js.map +1 -1
- package/dist/tools/components/chart/ComposedChart.cjs.map +1 -1
- package/dist/tools/components/chart/ComposedChart.d.cts +54 -1
- package/dist/tools/components/chart/ComposedChart.d.ts +54 -1
- package/dist/tools/components/chart/ComposedChart.js.map +1 -1
- package/dist/tools/components/chart/SimpleAreaChart.cjs.map +1 -1
- package/dist/tools/components/chart/SimpleAreaChart.d.cts +41 -1
- package/dist/tools/components/chart/SimpleAreaChart.d.ts +41 -1
- package/dist/tools/components/chart/SimpleAreaChart.js.map +1 -1
- package/dist/tools/components/chart/SimpleBarChart.cjs.map +1 -1
- package/dist/tools/components/chart/SimpleBarChart.d.cts +34 -24
- package/dist/tools/components/chart/SimpleBarChart.d.ts +34 -24
- package/dist/tools/components/chart/SimpleBarChart.js.map +1 -1
- package/dist/tools/components/chart/SimpleLineChart.cjs.map +1 -1
- package/dist/tools/components/chart/SimpleLineChart.d.cts +31 -28
- package/dist/tools/components/chart/SimpleLineChart.d.ts +31 -28
- package/dist/tools/components/chart/SimpleLineChart.js.map +1 -1
- package/dist/tools/components/chart/SimplePieChart.cjs.map +1 -1
- package/dist/tools/components/chart/SimplePieChart.d.cts +28 -22
- package/dist/tools/components/chart/SimplePieChart.d.ts +28 -22
- package/dist/tools/components/chart/SimplePieChart.js.map +1 -1
- package/dist/tools/components/chart/SimpleRadarChart.cjs.map +1 -1
- package/dist/tools/components/chart/SimpleRadarChart.d.cts +38 -1
- package/dist/tools/components/chart/SimpleRadarChart.d.ts +38 -1
- package/dist/tools/components/chart/SimpleRadarChart.js.map +1 -1
- package/dist/tools/components/chart/SimpleScatterChart.cjs.map +1 -1
- package/dist/tools/components/chart/SimpleScatterChart.d.cts +44 -1
- package/dist/tools/components/chart/SimpleScatterChart.d.ts +44 -1
- package/dist/tools/components/chart/SimpleScatterChart.js.map +1 -1
- package/dist/tools/components/chart/StackedBarChart.cjs.map +1 -1
- package/dist/tools/components/chart/StackedBarChart.d.cts +38 -1
- package/dist/tools/components/chart/StackedBarChart.d.ts +38 -1
- package/dist/tools/components/chart/StackedBarChart.js.map +1 -1
- package/dist/tools/components/data-table/data-table.cjs +1 -1
- package/dist/tools/components/data-table/data-table.cjs.map +1 -1
- package/dist/tools/components/data-table/data-table.js +286 -263
- package/dist/tools/components/data-table/data-table.js.map +1 -1
- package/dist/tools/components/data-table/table-utils.cjs.map +1 -1
- package/dist/tools/components/data-table/table-utils.d.cts +45 -35
- package/dist/tools/components/data-table/table-utils.d.ts +45 -35
- package/dist/tools/components/data-table/table-utils.js.map +1 -1
- package/dist/tools/components/editable-table/editable-table.cjs +1 -1
- package/dist/tools/components/editable-table/editable-table.cjs.map +1 -1
- package/dist/tools/components/editable-table/editable-table.js +15 -2
- package/dist/tools/components/editable-table/editable-table.js.map +1 -1
- package/dist/tools/components/error/ErrorDialog.cjs +1 -1
- package/dist/tools/components/error/ErrorDialog.cjs.map +1 -1
- package/dist/tools/components/error/ErrorDialog.js +1 -1
- package/dist/tools/components/error/ErrorDialog.js.map +1 -1
- package/dist/tools/components/error/ErrorInline.cjs +1 -1
- package/dist/tools/components/error/ErrorInline.cjs.map +1 -1
- package/dist/tools/components/error/ErrorInline.js +1 -1
- package/dist/tools/components/error/ErrorInline.js.map +1 -1
- package/dist/tools/components/error/ErrorNotification.cjs +1 -1
- package/dist/tools/components/error/ErrorNotification.cjs.map +1 -1
- package/dist/tools/components/error/ErrorNotification.js +10 -10
- package/dist/tools/components/error/ErrorNotification.js.map +1 -1
- package/dist/tools/components/file-browser/FilePreview.cjs +1 -1
- package/dist/tools/components/file-browser/FilePreview.cjs.map +1 -1
- package/dist/tools/components/file-browser/FilePreview.js +28 -26
- package/dist/tools/components/file-browser/FilePreview.js.map +1 -1
- package/dist/tools/components/filter/filter.cjs.map +1 -1
- package/dist/tools/components/filter/filter.d.cts +23 -34
- package/dist/tools/components/filter/filter.d.ts +23 -34
- package/dist/tools/components/filter/filter.js.map +1 -1
- package/dist/tools/components/form/EnhancedDetailPage.cjs.map +1 -1
- package/dist/tools/components/form/EnhancedDetailPage.d.cts +47 -42
- package/dist/tools/components/form/EnhancedDetailPage.d.ts +47 -42
- package/dist/tools/components/form/EnhancedDetailPage.js.map +1 -1
- package/dist/tools/components/form/form-grid.cjs.map +1 -1
- package/dist/tools/components/form/form-grid.d.cts +44 -22
- package/dist/tools/components/form/form-grid.d.ts +44 -22
- package/dist/tools/components/form/form-grid.js.map +1 -1
- package/dist/tools/components/gantt/GanttChart.cjs +1 -1
- package/dist/tools/components/gantt/GanttChart.cjs.map +1 -1
- package/dist/tools/components/gantt/GanttChart.d.cts +20 -1
- package/dist/tools/components/gantt/GanttChart.d.ts +20 -1
- package/dist/tools/components/gantt/GanttChart.js +3 -0
- package/dist/tools/components/gantt/GanttChart.js.map +1 -1
- package/dist/tools/components/gantt/components/GanttTaskBar.cjs +1 -1
- package/dist/tools/components/gantt/components/GanttTaskBar.cjs.map +1 -1
- package/dist/tools/components/gantt/components/GanttTaskBar.js +2 -1
- package/dist/tools/components/gantt/components/GanttTaskBar.js.map +1 -1
- package/dist/tools/components/header/header.cjs +1 -1
- package/dist/tools/components/header/header.cjs.map +1 -1
- package/dist/tools/components/header/header.d.cts +103 -40
- package/dist/tools/components/header/header.d.ts +103 -40
- package/dist/tools/components/header/header.js +1 -1
- package/dist/tools/components/header/header.js.map +1 -1
- package/dist/tools/components/i18n/LanguageSwitcher.cjs.map +1 -1
- package/dist/tools/components/i18n/LanguageSwitcher.d.cts +18 -14
- package/dist/tools/components/i18n/LanguageSwitcher.d.ts +18 -14
- package/dist/tools/components/i18n/LanguageSwitcher.js.map +1 -1
- package/dist/tools/components/kanban/KanbanBoard.cjs +1 -1
- package/dist/tools/components/kanban/KanbanBoard.cjs.map +1 -1
- package/dist/tools/components/kanban/KanbanBoard.d.cts +16 -34
- package/dist/tools/components/kanban/KanbanBoard.d.ts +16 -34
- package/dist/tools/components/kanban/KanbanBoard.js +3 -0
- package/dist/tools/components/kanban/KanbanBoard.js.map +1 -1
- package/dist/tools/components/kanban/KanbanColumn.cjs +1 -1
- package/dist/tools/components/kanban/KanbanColumn.cjs.map +1 -1
- package/dist/tools/components/kanban/KanbanColumn.js +1 -1
- package/dist/tools/components/kanban/KanbanColumn.js.map +1 -1
- package/dist/tools/components/kanban/kanban-compound.cjs +1 -1
- package/dist/tools/components/kanban/kanban-compound.cjs.map +1 -1
- package/dist/tools/components/kanban/kanban-compound.js +4 -1
- package/dist/tools/components/kanban/kanban-compound.js.map +1 -1
- package/dist/tools/components/kanban/kanban-primitives.cjs +1 -1
- package/dist/tools/components/kanban/kanban-primitives.cjs.map +1 -1
- package/dist/tools/components/kanban/kanban-primitives.js +0 -1
- package/dist/tools/components/kanban/kanban-primitives.js.map +1 -1
- package/dist/tools/components/priority-queue/PriorityCard.cjs +1 -1
- package/dist/tools/components/priority-queue/PriorityCard.cjs.map +1 -1
- package/dist/tools/components/priority-queue/PriorityCard.js +3 -1
- package/dist/tools/components/priority-queue/PriorityCard.js.map +1 -1
- package/dist/tools/components/sidebar/SmartSidebar.cjs.map +1 -1
- package/dist/tools/components/sidebar/SmartSidebar.d.cts +41 -43
- package/dist/tools/components/sidebar/SmartSidebar.d.ts +41 -43
- package/dist/tools/components/sidebar/SmartSidebar.js.map +1 -1
- package/dist/tools/components/splash/SplashScreen.cjs.map +1 -1
- package/dist/tools/components/splash/SplashScreen.d.cts +43 -68
- package/dist/tools/components/splash/SplashScreen.d.ts +43 -68
- package/dist/tools/components/splash/SplashScreen.js.map +1 -1
- package/dist/tools/components/workflow/WorkflowStatusPanel.cjs +1 -1
- package/dist/tools/components/workflow/WorkflowStatusPanel.cjs.map +1 -1
- package/dist/tools/components/workflow/WorkflowStatusPanel.js +2 -2
- package/dist/tools/components/workflow/WorkflowStatusPanel.js.map +1 -1
- package/dist/tools/lib/data-access/data-access-context.cjs.map +1 -1
- package/dist/tools/lib/data-access/data-access-context.d.cts +15 -6
- package/dist/tools/lib/data-access/data-access-context.d.ts +15 -6
- package/dist/tools/lib/data-access/data-access-context.js.map +1 -1
- package/dist/tools/lib/data-access/react-query-provider.cjs.map +1 -1
- package/dist/tools/lib/data-access/react-query-provider.d.cts +19 -2
- package/dist/tools/lib/data-access/react-query-provider.d.ts +19 -2
- package/dist/tools/lib/data-access/react-query-provider.js.map +1 -1
- package/dist/tools/lib/data-access/react-query.cjs.map +1 -1
- package/dist/tools/lib/data-access/react-query.d.cts +365 -90
- package/dist/tools/lib/data-access/react-query.d.ts +365 -90
- package/dist/tools/lib/data-access/react-query.js.map +1 -1
- package/dist/tools/lib/error/AppError.cjs.map +1 -1
- package/dist/tools/lib/error/AppError.d.cts +157 -63
- package/dist/tools/lib/error/AppError.d.ts +157 -63
- package/dist/tools/lib/error/AppError.js.map +1 -1
- package/dist/tools/lib/hooks/useAsyncWithTimeout.cjs.map +1 -1
- package/dist/tools/lib/hooks/useAsyncWithTimeout.d.cts +79 -26
- package/dist/tools/lib/hooks/useAsyncWithTimeout.d.ts +79 -26
- package/dist/tools/lib/hooks/useAsyncWithTimeout.js.map +1 -1
- package/dist/tools/lib/hooks/useError.cjs.map +1 -1
- package/dist/tools/lib/hooks/useError.d.cts +51 -16
- package/dist/tools/lib/hooks/useError.d.ts +51 -16
- package/dist/tools/lib/hooks/useError.js.map +1 -1
- package/dist/tools/lib/schema/ajv.cjs +1 -1
- package/dist/tools/lib/schema/ajv.cjs.map +1 -1
- package/dist/tools/lib/schema/ajv.d.cts +19 -8
- package/dist/tools/lib/schema/ajv.d.ts +19 -8
- package/dist/tools/lib/schema/ajv.js +2 -1
- package/dist/tools/lib/schema/ajv.js.map +1 -1
- package/dist/tools/lib/state/error-store.cjs.map +1 -1
- package/dist/tools/lib/state/error-store.d.cts +61 -10
- package/dist/tools/lib/state/error-store.d.ts +61 -10
- package/dist/tools/lib/state/error-store.js.map +1 -1
- package/dist/tools/lib/state/store-factory.cjs.map +1 -1
- package/dist/tools/lib/state/store-factory.d.cts +25 -4
- package/dist/tools/lib/state/store-factory.d.ts +25 -4
- package/dist/tools/lib/state/store-factory.js.map +1 -1
- package/dist/tools/lib/state/ui-store.cjs.map +1 -1
- package/dist/tools/lib/state/ui-store.d.cts +39 -0
- package/dist/tools/lib/state/ui-store.d.ts +39 -0
- package/dist/tools/lib/state/ui-store.js.map +1 -1
- package/dist/ui/components/theme/theme-context.cjs.map +1 -1
- package/dist/ui/components/theme/theme-context.d.cts +171 -1
- package/dist/ui/components/theme/theme-context.d.ts +171 -1
- package/dist/ui/components/theme/theme-context.js.map +1 -1
- package/dist/ui/components/theme/theme-provider.cjs.map +1 -1
- package/dist/ui/components/theme/theme-provider.d.cts +31 -19
- package/dist/ui/components/theme/theme-provider.d.ts +31 -19
- package/dist/ui/components/theme/theme-provider.js.map +1 -1
- package/dist/ui/components/theme/theme-script.cjs.map +1 -1
- package/dist/ui/components/theme/theme-script.d.cts +16 -1
- package/dist/ui/components/theme/theme-script.d.ts +16 -1
- package/dist/ui/components/theme/theme-script.js.map +1 -1
- package/dist/ui/components/theme/theme-switcher.cjs +1 -1
- package/dist/ui/components/theme/theme-switcher.cjs.map +1 -1
- package/dist/ui/components/theme/theme-switcher.d.cts +82 -13
- package/dist/ui/components/theme/theme-switcher.d.ts +82 -13
- package/dist/ui/components/theme/theme-switcher.js +8 -0
- package/dist/ui/components/theme/theme-switcher.js.map +1 -1
- package/dist/ui/components/ui/accordion.cjs.map +1 -1
- package/dist/ui/components/ui/accordion.d.cts +60 -0
- package/dist/ui/components/ui/accordion.d.ts +60 -0
- package/dist/ui/components/ui/accordion.js.map +1 -1
- package/dist/ui/components/ui/adjustable-pane.cjs.map +1 -1
- package/dist/ui/components/ui/adjustable-pane.d.cts +44 -26
- package/dist/ui/components/ui/adjustable-pane.d.ts +44 -26
- package/dist/ui/components/ui/adjustable-pane.js.map +1 -1
- package/dist/ui/components/ui/alert-dialog.cjs.map +1 -1
- package/dist/ui/components/ui/alert-dialog.d.cts +179 -2
- package/dist/ui/components/ui/alert-dialog.d.ts +179 -2
- package/dist/ui/components/ui/alert-dialog.js.map +1 -1
- package/dist/ui/components/ui/alert.cjs.map +1 -1
- package/dist/ui/components/ui/alert.d.cts +52 -4
- package/dist/ui/components/ui/alert.d.ts +52 -4
- package/dist/ui/components/ui/alert.js.map +1 -1
- package/dist/ui/components/ui/aspect-ratio.cjs.map +1 -1
- package/dist/ui/components/ui/aspect-ratio.d.cts +16 -1
- package/dist/ui/components/ui/aspect-ratio.d.ts +16 -1
- package/dist/ui/components/ui/aspect-ratio.js.map +1 -1
- package/dist/ui/components/ui/avatar.cjs.map +1 -1
- package/dist/ui/components/ui/avatar.d.cts +87 -3
- package/dist/ui/components/ui/avatar.d.ts +87 -3
- package/dist/ui/components/ui/avatar.js.map +1 -1
- package/dist/ui/components/ui/badge-components.cjs.map +1 -1
- package/dist/ui/components/ui/badge-components.d.cts +13 -1
- package/dist/ui/components/ui/badge-components.d.ts +13 -1
- package/dist/ui/components/ui/badge-components.js.map +1 -1
- package/dist/ui/components/ui/badge-variants.cjs.map +1 -1
- package/dist/ui/components/ui/badge-variants.d.cts +15 -0
- package/dist/ui/components/ui/badge-variants.d.ts +15 -0
- package/dist/ui/components/ui/badge-variants.js.map +1 -1
- package/dist/ui/components/ui/breadcrumb.cjs.map +1 -1
- package/dist/ui/components/ui/breadcrumb.d.cts +91 -7
- package/dist/ui/components/ui/breadcrumb.d.ts +91 -7
- package/dist/ui/components/ui/breadcrumb.js.map +1 -1
- package/dist/ui/components/ui/button-components.cjs.map +1 -1
- package/dist/ui/components/ui/button-components.d.cts +18 -6
- package/dist/ui/components/ui/button-components.d.ts +18 -6
- package/dist/ui/components/ui/button-components.js.map +1 -1
- package/dist/ui/components/ui/button-group-components.cjs.map +1 -1
- package/dist/ui/components/ui/button-group-components.d.cts +39 -3
- package/dist/ui/components/ui/button-group-components.d.ts +39 -3
- package/dist/ui/components/ui/button-group-components.js.map +1 -1
- package/dist/ui/components/ui/button-group-variants.cjs.map +1 -1
- package/dist/ui/components/ui/button-group-variants.d.cts +15 -0
- package/dist/ui/components/ui/button-group-variants.d.ts +15 -0
- package/dist/ui/components/ui/button-group-variants.js.map +1 -1
- package/dist/ui/components/ui/button-variants.cjs.map +1 -1
- package/dist/ui/components/ui/button-variants.d.cts +13 -2
- package/dist/ui/components/ui/button-variants.d.ts +13 -2
- package/dist/ui/components/ui/button-variants.js.map +1 -1
- package/dist/ui/components/ui/card.cjs.map +1 -1
- package/dist/ui/components/ui/card.d.cts +106 -2
- package/dist/ui/components/ui/card.d.ts +106 -2
- package/dist/ui/components/ui/card.js.map +1 -1
- package/dist/ui/components/ui/checkbox-group.cjs.map +1 -1
- package/dist/ui/components/ui/checkbox-group.d.cts +13 -1
- package/dist/ui/components/ui/checkbox-group.d.ts +13 -1
- package/dist/ui/components/ui/checkbox-group.js.map +1 -1
- package/dist/ui/components/ui/checkbox.cjs.map +1 -1
- package/dist/ui/components/ui/checkbox.d.cts +17 -6
- package/dist/ui/components/ui/checkbox.d.ts +17 -6
- package/dist/ui/components/ui/checkbox.js.map +1 -1
- package/dist/ui/components/ui/collapsible.cjs.map +1 -1
- package/dist/ui/components/ui/collapsible.d.cts +39 -3
- package/dist/ui/components/ui/collapsible.d.ts +39 -3
- package/dist/ui/components/ui/collapsible.js.map +1 -1
- package/dist/ui/components/ui/combobox-components.cjs.map +1 -1
- package/dist/ui/components/ui/combobox-components.d.cts +209 -14
- package/dist/ui/components/ui/combobox-components.d.ts +209 -14
- package/dist/ui/components/ui/combobox-components.js.map +1 -1
- package/dist/ui/components/ui/combobox-hooks.cjs.map +1 -1
- package/dist/ui/components/ui/combobox-hooks.d.cts +13 -1
- package/dist/ui/components/ui/combobox-hooks.d.ts +13 -1
- package/dist/ui/components/ui/combobox-hooks.js.map +1 -1
- package/dist/ui/components/ui/command.cjs.map +1 -1
- package/dist/ui/components/ui/command.d.cts +132 -9
- package/dist/ui/components/ui/command.d.ts +132 -9
- package/dist/ui/components/ui/command.js.map +1 -1
- package/dist/ui/components/ui/context-menu.cjs.map +1 -1
- package/dist/ui/components/ui/context-menu.d.cts +233 -2
- package/dist/ui/components/ui/context-menu.d.ts +233 -2
- package/dist/ui/components/ui/context-menu.js.map +1 -1
- package/dist/ui/components/ui/dialog.cjs.map +1 -1
- package/dist/ui/components/ui/dialog.d.cts +157 -5
- package/dist/ui/components/ui/dialog.d.ts +157 -5
- package/dist/ui/components/ui/dialog.js.map +1 -1
- package/dist/ui/components/ui/drawer.cjs.map +1 -1
- package/dist/ui/components/ui/drawer.d.cts +130 -10
- package/dist/ui/components/ui/drawer.d.ts +130 -10
- package/dist/ui/components/ui/drawer.js.map +1 -1
- package/dist/ui/components/ui/dropdown-menu.cjs.map +1 -1
- package/dist/ui/components/ui/dropdown-menu.d.cts +225 -6
- package/dist/ui/components/ui/dropdown-menu.d.ts +225 -6
- package/dist/ui/components/ui/dropdown-menu.js.map +1 -1
- package/dist/ui/components/ui/empty.cjs.map +1 -1
- package/dist/ui/components/ui/empty.d.cts +78 -6
- package/dist/ui/components/ui/empty.d.ts +78 -6
- package/dist/ui/components/ui/empty.js.map +1 -1
- package/dist/ui/components/ui/field.cjs.map +1 -1
- package/dist/ui/components/ui/field.d.cts +180 -6
- package/dist/ui/components/ui/field.d.ts +180 -6
- package/dist/ui/components/ui/field.js.map +1 -1
- package/dist/ui/components/ui/file-icon.cjs.map +1 -1
- package/dist/ui/components/ui/file-icon.d.cts +32 -4
- package/dist/ui/components/ui/file-icon.d.ts +32 -4
- package/dist/ui/components/ui/file-icon.js.map +1 -1
- package/dist/ui/components/ui/hover-card.cjs.map +1 -1
- package/dist/ui/components/ui/hover-card.d.cts +39 -3
- package/dist/ui/components/ui/hover-card.d.ts +39 -3
- package/dist/ui/components/ui/hover-card.js.map +1 -1
- package/dist/ui/components/ui/input-group.cjs.map +1 -1
- package/dist/ui/components/ui/input-group.d.cts +84 -6
- package/dist/ui/components/ui/input-group.d.ts +84 -6
- package/dist/ui/components/ui/input-group.js.map +1 -1
- package/dist/ui/components/ui/input-otp.cjs.map +1 -1
- package/dist/ui/components/ui/input-otp.d.cts +58 -4
- package/dist/ui/components/ui/input-otp.d.ts +58 -4
- package/dist/ui/components/ui/input-otp.js.map +1 -1
- package/dist/ui/components/ui/input.cjs.map +1 -1
- package/dist/ui/components/ui/input.d.cts +18 -10
- package/dist/ui/components/ui/input.d.ts +18 -10
- package/dist/ui/components/ui/input.js.map +1 -1
- package/dist/ui/components/ui/item.cjs.map +1 -1
- package/dist/ui/components/ui/item.d.cts +130 -10
- package/dist/ui/components/ui/item.d.ts +130 -10
- package/dist/ui/components/ui/item.js.map +1 -1
- package/dist/ui/components/ui/kbd.cjs.map +1 -1
- package/dist/ui/components/ui/kbd.d.cts +26 -2
- package/dist/ui/components/ui/kbd.d.ts +26 -2
- package/dist/ui/components/ui/kbd.js.map +1 -1
- package/dist/ui/components/ui/label.cjs.map +1 -1
- package/dist/ui/components/ui/label.d.cts +15 -0
- package/dist/ui/components/ui/label.d.ts +15 -0
- package/dist/ui/components/ui/label.js.map +1 -1
- package/dist/ui/components/ui/layout.cjs +1 -1
- package/dist/ui/components/ui/layout.cjs.map +1 -1
- package/dist/ui/components/ui/layout.d.cts +45 -11
- package/dist/ui/components/ui/layout.d.ts +45 -11
- package/dist/ui/components/ui/layout.js +22 -20
- package/dist/ui/components/ui/layout.js.map +1 -1
- package/dist/ui/components/ui/menubar.cjs.map +1 -1
- package/dist/ui/components/ui/menubar.d.cts +220 -16
- package/dist/ui/components/ui/menubar.d.ts +220 -16
- package/dist/ui/components/ui/menubar.js.map +1 -1
- package/dist/ui/components/ui/meter.cjs.map +1 -1
- package/dist/ui/components/ui/meter.d.cts +52 -4
- package/dist/ui/components/ui/meter.d.ts +52 -4
- package/dist/ui/components/ui/meter.js.map +1 -1
- package/dist/ui/components/ui/mobile-form-variants.cjs.map +1 -1
- package/dist/ui/components/ui/mobile-form-variants.d.cts +30 -0
- package/dist/ui/components/ui/mobile-form-variants.d.ts +30 -0
- package/dist/ui/components/ui/mobile-form-variants.js.map +1 -1
- package/dist/ui/components/ui/mobile-form.cjs.map +1 -1
- package/dist/ui/components/ui/mobile-form.d.cts +186 -9
- package/dist/ui/components/ui/mobile-form.d.ts +186 -9
- package/dist/ui/components/ui/mobile-form.js.map +1 -1
- package/dist/ui/components/ui/navigation-menu-components.cjs.map +1 -1
- package/dist/ui/components/ui/navigation-menu-components.d.cts +104 -8
- package/dist/ui/components/ui/navigation-menu-components.d.ts +104 -8
- package/dist/ui/components/ui/navigation-menu-components.js.map +1 -1
- package/dist/ui/components/ui/navigation-menu-variants.cjs.map +1 -1
- package/dist/ui/components/ui/navigation-menu-variants.d.cts +15 -0
- package/dist/ui/components/ui/navigation-menu-variants.d.ts +15 -0
- package/dist/ui/components/ui/navigation-menu-variants.js.map +1 -1
- package/dist/ui/components/ui/number-field.cjs.map +1 -1
- package/dist/ui/components/ui/number-field.d.cts +78 -6
- package/dist/ui/components/ui/number-field.d.ts +78 -6
- package/dist/ui/components/ui/number-field.js.map +1 -1
- package/dist/ui/components/ui/pagination.cjs.map +1 -1
- package/dist/ui/components/ui/pagination.d.cts +99 -7
- package/dist/ui/components/ui/pagination.d.ts +99 -7
- package/dist/ui/components/ui/pagination.js.map +1 -1
- package/dist/ui/components/ui/password-input.cjs.map +1 -1
- package/dist/ui/components/ui/password-input.d.cts +10 -7
- package/dist/ui/components/ui/password-input.d.ts +10 -7
- package/dist/ui/components/ui/password-input.js.map +1 -1
- package/dist/ui/components/ui/popover.cjs.map +1 -1
- package/dist/ui/components/ui/popover.d.cts +86 -2
- package/dist/ui/components/ui/popover.d.ts +86 -2
- package/dist/ui/components/ui/popover.js.map +1 -1
- package/dist/ui/components/ui/progress.cjs.map +1 -1
- package/dist/ui/components/ui/progress.d.cts +72 -2
- package/dist/ui/components/ui/progress.d.ts +72 -2
- package/dist/ui/components/ui/progress.js.map +1 -1
- package/dist/ui/components/ui/radio-card.cjs.map +1 -1
- package/dist/ui/components/ui/radio-card.d.cts +32 -4
- package/dist/ui/components/ui/radio-card.d.ts +32 -4
- package/dist/ui/components/ui/radio-card.js.map +1 -1
- package/dist/ui/components/ui/radio-group.cjs.map +1 -1
- package/dist/ui/components/ui/radio-group.d.cts +28 -2
- package/dist/ui/components/ui/radio-group.d.ts +28 -2
- package/dist/ui/components/ui/radio-group.js.map +1 -1
- package/dist/ui/components/ui/resizable.cjs.map +1 -1
- package/dist/ui/components/ui/resizable.d.cts +42 -3
- package/dist/ui/components/ui/resizable.d.ts +42 -3
- package/dist/ui/components/ui/resizable.js.map +1 -1
- package/dist/ui/components/ui/responsive-list.cjs.map +1 -1
- package/dist/ui/components/ui/responsive-list.d.cts +176 -13
- package/dist/ui/components/ui/responsive-list.d.ts +176 -13
- package/dist/ui/components/ui/responsive-list.js.map +1 -1
- package/dist/ui/components/ui/scroll-area.cjs.map +1 -1
- package/dist/ui/components/ui/scroll-area.d.cts +28 -1
- package/dist/ui/components/ui/scroll-area.d.ts +28 -1
- package/dist/ui/components/ui/scroll-area.js.map +1 -1
- package/dist/ui/components/ui/searchable-select-input.cjs.map +1 -1
- package/dist/ui/components/ui/searchable-select-input.d.cts +199 -49
- package/dist/ui/components/ui/searchable-select-input.d.ts +199 -49
- package/dist/ui/components/ui/searchable-select-input.js.map +1 -1
- package/dist/ui/components/ui/select.cjs.map +1 -1
- package/dist/ui/components/ui/select.d.cts +205 -40
- package/dist/ui/components/ui/select.d.ts +205 -40
- package/dist/ui/components/ui/select.js.map +1 -1
- package/dist/ui/components/ui/separator.cjs.map +1 -1
- package/dist/ui/components/ui/separator.d.cts +13 -2
- package/dist/ui/components/ui/separator.d.ts +13 -2
- package/dist/ui/components/ui/separator.js.map +1 -1
- package/dist/ui/components/ui/sheet.cjs.map +1 -1
- package/dist/ui/components/ui/sheet.d.cts +128 -3
- package/dist/ui/components/ui/sheet.d.ts +128 -3
- package/dist/ui/components/ui/sheet.js.map +1 -1
- package/dist/ui/components/ui/skeleton.cjs.map +1 -1
- package/dist/ui/components/ui/skeleton.d.cts +13 -1
- package/dist/ui/components/ui/skeleton.d.ts +13 -1
- package/dist/ui/components/ui/skeleton.js.map +1 -1
- package/dist/ui/components/ui/slider.cjs.map +1 -1
- package/dist/ui/components/ui/slider.d.cts +13 -7
- package/dist/ui/components/ui/slider.d.ts +13 -7
- package/dist/ui/components/ui/slider.js.map +1 -1
- package/dist/ui/components/ui/spinner.cjs.map +1 -1
- package/dist/ui/components/ui/spinner.d.cts +13 -1
- package/dist/ui/components/ui/spinner.d.ts +13 -1
- package/dist/ui/components/ui/spinner.js.map +1 -1
- package/dist/ui/components/ui/switch.cjs.map +1 -1
- package/dist/ui/components/ui/switch.d.cts +26 -0
- package/dist/ui/components/ui/switch.d.ts +26 -0
- package/dist/ui/components/ui/switch.js.map +1 -1
- package/dist/ui/components/ui/table.cjs.map +1 -1
- package/dist/ui/components/ui/table.d.cts +118 -2
- package/dist/ui/components/ui/table.d.ts +118 -2
- package/dist/ui/components/ui/table.js.map +1 -1
- package/dist/ui/components/ui/tabs-components.cjs.map +1 -1
- package/dist/ui/components/ui/tabs-components.d.cts +52 -5
- package/dist/ui/components/ui/tabs-components.d.ts +52 -5
- package/dist/ui/components/ui/tabs-components.js.map +1 -1
- package/dist/ui/components/ui/tabs-variants.cjs.map +1 -1
- package/dist/ui/components/ui/tabs-variants.d.cts +15 -0
- package/dist/ui/components/ui/tabs-variants.d.ts +15 -0
- package/dist/ui/components/ui/tabs-variants.js.map +1 -1
- package/dist/ui/components/ui/textarea.cjs.map +1 -1
- package/dist/ui/components/ui/textarea.d.cts +23 -0
- package/dist/ui/components/ui/textarea.d.ts +23 -0
- package/dist/ui/components/ui/textarea.js.map +1 -1
- package/dist/ui/components/ui/toast.cjs.map +1 -1
- package/dist/ui/components/ui/toast.d.cts +136 -0
- package/dist/ui/components/ui/toast.d.ts +136 -0
- package/dist/ui/components/ui/toast.js.map +1 -1
- package/dist/ui/components/ui/toaster.cjs.map +1 -1
- package/dist/ui/components/ui/toaster.d.cts +12 -3
- package/dist/ui/components/ui/toaster.d.ts +12 -3
- package/dist/ui/components/ui/toaster.js.map +1 -1
- package/dist/ui/components/ui/toggle-components.cjs.map +1 -1
- package/dist/ui/components/ui/toggle-components.d.cts +15 -0
- package/dist/ui/components/ui/toggle-components.d.ts +15 -0
- package/dist/ui/components/ui/toggle-components.js.map +1 -1
- package/dist/ui/components/ui/toggle-group.cjs.map +1 -1
- package/dist/ui/components/ui/toggle-group.d.cts +33 -0
- package/dist/ui/components/ui/toggle-group.d.ts +33 -0
- package/dist/ui/components/ui/toggle-group.js.map +1 -1
- package/dist/ui/components/ui/toggle-variants.cjs.map +1 -1
- package/dist/ui/components/ui/toggle-variants.d.cts +15 -0
- package/dist/ui/components/ui/toggle-variants.d.ts +15 -0
- package/dist/ui/components/ui/toggle-variants.js.map +1 -1
- package/dist/ui/components/ui/toolbar.cjs.map +1 -1
- package/dist/ui/components/ui/toolbar.d.cts +94 -7
- package/dist/ui/components/ui/toolbar.d.ts +94 -7
- package/dist/ui/components/ui/toolbar.js.map +1 -1
- package/dist/ui/components/ui/tooltip.cjs.map +1 -1
- package/dist/ui/components/ui/tooltip.d.cts +54 -3
- package/dist/ui/components/ui/tooltip.d.ts +54 -3
- package/dist/ui/components/ui/tooltip.js.map +1 -1
- package/dist/ui/lib/hooks/use-gps.cjs.map +1 -1
- package/dist/ui/lib/hooks/use-gps.d.cts +29 -4
- package/dist/ui/lib/hooks/use-gps.d.ts +29 -4
- package/dist/ui/lib/hooks/use-gps.js.map +1 -1
- package/dist/ui/lib/hooks/use-is-client.cjs.map +1 -1
- package/dist/ui/lib/hooks/use-is-client.d.cts +11 -2
- package/dist/ui/lib/hooks/use-is-client.d.ts +11 -2
- package/dist/ui/lib/hooks/use-is-client.js.map +1 -1
- package/dist/ui/lib/hooks/use-keyboard-shortcut.cjs.map +1 -1
- package/dist/ui/lib/hooks/use-keyboard-shortcut.d.cts +48 -18
- package/dist/ui/lib/hooks/use-keyboard-shortcut.d.ts +48 -18
- package/dist/ui/lib/hooks/use-keyboard-shortcut.js.map +1 -1
- package/dist/ui/lib/hooks/use-mobile.cjs.map +1 -1
- package/dist/ui/lib/hooks/use-mobile.d.cts +11 -3
- package/dist/ui/lib/hooks/use-mobile.d.ts +11 -3
- package/dist/ui/lib/hooks/use-mobile.js.map +1 -1
- package/dist/ui/lib/hooks/use-toast.cjs.map +1 -1
- package/dist/ui/lib/hooks/use-toast.d.cts +184 -15
- package/dist/ui/lib/hooks/use-toast.d.ts +184 -15
- package/dist/ui/lib/hooks/use-toast.js.map +1 -1
- package/dist/ui/lib/ime-utils.cjs.map +1 -1
- package/dist/ui/lib/ime-utils.d.cts +40 -13
- package/dist/ui/lib/ime-utils.d.ts +40 -13
- package/dist/ui/lib/ime-utils.js.map +1 -1
- package/dist/ui/lib/utils.cjs.map +1 -1
- package/dist/ui/lib/utils.d.cts +9 -6
- package/dist/ui/lib/utils.d.ts +9 -6
- package/dist/ui/lib/utils.js.map +1 -1
- package/docs/ai.md +34 -1
- package/docs/exports.md +5 -1
- package/docs/index.md +89 -16
- package/docs/migration.md +268 -0
- package/docs/request-form.md +4 -1
- package/docs/tools.md +4 -1
- package/docs/ui.md +4 -1
- package/llms-full.txt +499 -36
- package/llms.txt +4 -0
- package/package.json +35 -5
|
@@ -1,51 +1,115 @@
|
|
|
1
1
|
import { User } from './types.js';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* A stored display snapshot, not proof of a valid authenticated session.
|
|
4
|
+
* See createSessionCache for writes, expiration checks and host verification.
|
|
4
5
|
*
|
|
5
|
-
*
|
|
6
|
-
* そのままだとリロードのたびにサーバー検証(whoami 等)が終わるまで画面がブロックされます。
|
|
7
|
-
*
|
|
8
|
-
* このモジュールは「最後に確定したセッション状態」を localStorage に保持し、
|
|
9
|
-
* 次回ロード時に即座に描画(楽観表示)しつつ、裏で検証させるためのヘルパーです。
|
|
10
|
-
*
|
|
11
|
-
* 保存するのは表示用プロフィール(`User`)のみ。トークン等の機密は含めません。
|
|
12
|
-
* クッキーが無効なら検証時に即座にログイン画面へフォールバックします。
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```ts
|
|
16
|
-
* const cache = createSessionCache({ ttl: 7 * 24 * 60 * 60 * 1000 });
|
|
17
|
-
* cache.write(user); // ログイン成功 / 検証成功時
|
|
18
|
-
* cache.writeLoggedOut(); // 明示的な未ログイン確定時
|
|
19
|
-
* const hit = cache.read(); // { user: User|null, exp: number } | null
|
|
20
|
-
* ```
|
|
6
|
+
* @see createSessionCache for the canonical usage example.
|
|
21
7
|
*/
|
|
22
8
|
export interface SessionCacheEntry {
|
|
23
|
-
/**
|
|
9
|
+
/** Last confirmed display user; null records an explicitly logged-out state. */
|
|
24
10
|
user: User | null;
|
|
25
|
-
/**
|
|
11
|
+
/** Expiration timestamp in milliseconds since the Unix epoch. */
|
|
26
12
|
exp: number;
|
|
27
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Storage settings for createSessionCache; no providers or CSS are required.
|
|
16
|
+
* @see createSessionCache for the canonical usage example.
|
|
17
|
+
*/
|
|
28
18
|
export interface SessionCacheOptions {
|
|
29
|
-
/** localStorage
|
|
19
|
+
/** localStorage key; defaults to dataarthub.auth.last-session. */
|
|
30
20
|
key?: string;
|
|
31
|
-
/**
|
|
21
|
+
/** Snapshot lifetime in milliseconds; defaults to seven days. */
|
|
32
22
|
ttl?: number;
|
|
33
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Best-effort browser snapshot storage; see createSessionCache for usage.
|
|
26
|
+
* @see createSessionCache for the canonical usage example.
|
|
27
|
+
*/
|
|
34
28
|
export interface SessionCache {
|
|
29
|
+
/** Resolved storage key shared with storage-event subscribers. */
|
|
35
30
|
readonly key: string;
|
|
31
|
+
/**
|
|
32
|
+
* Read the stored snapshot without enforcing expiration.
|
|
33
|
+
*
|
|
34
|
+
* @returns Parsed entry (possibly expired), or null on server, missing data or parse/storage failure.
|
|
35
|
+
*
|
|
36
|
+
* @remarks See createSessionCache for the write/read usage pattern.
|
|
37
|
+
*/
|
|
36
38
|
read(): SessionCacheEntry | null;
|
|
39
|
+
/**
|
|
40
|
+
* Store display state with a fresh expiration.
|
|
41
|
+
*
|
|
42
|
+
* @param user - Display user or null for confirmed logout; exclude secrets.
|
|
43
|
+
*
|
|
44
|
+
* @returns No value; storage failures and server writes are ignored.
|
|
45
|
+
*
|
|
46
|
+
* @remarks See createSessionCache for the write/read usage pattern.
|
|
47
|
+
*/
|
|
37
48
|
write(user: User | null): void;
|
|
49
|
+
/**
|
|
50
|
+
* Remove the snapshot for this key.
|
|
51
|
+
*
|
|
52
|
+
* @returns No value; server calls and storage failures are ignored.
|
|
53
|
+
*
|
|
54
|
+
* @remarks Obtain this helper from createSessionCache, then call cache.clear().
|
|
55
|
+
*/
|
|
38
56
|
clear(): void;
|
|
39
|
-
/**
|
|
57
|
+
/**
|
|
58
|
+
* Check whether the stored expiration is still in the future.
|
|
59
|
+
*
|
|
60
|
+
* @returns True for a readable snapshot with exp greater than Date.now(), including a logged-out snapshot.
|
|
61
|
+
*
|
|
62
|
+
* @remarks See createSessionCache for a guarded read example.
|
|
63
|
+
*/
|
|
40
64
|
hasValid(): boolean;
|
|
41
65
|
}
|
|
42
66
|
/**
|
|
67
|
+
* Creates best-effort localStorage helpers for optimistic session display.
|
|
68
|
+
*
|
|
69
|
+
* @param options - Optional storage key and lifetime; defaults to the shared key and seven days.
|
|
70
|
+
*
|
|
71
|
+
* @returns Helpers that read, write, clear and check expiration without authenticating a user.
|
|
43
72
|
*
|
|
73
|
+
* @remarks read() validates only the numeric exp field and does not reject expired data;
|
|
74
|
+
* hasValid() checks expiration. Server reads return null and writes/clears do nothing.
|
|
75
|
+
* Browser storage/JSON failures are swallowed. Store display fields only, never tokens
|
|
76
|
+
* or secrets; verify the actual session with the backend before allowing protected work.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```ts
|
|
80
|
+
* import { createSessionCache, type User } from '@alneas/appkit-react/tools/auth';
|
|
81
|
+
* export function rememberSession(user: User | null) {
|
|
82
|
+
* const cache = createSessionCache({ ttl: 24 * 60 * 60 * 1000 });
|
|
83
|
+
* cache.write(user); // null records confirmed logout.
|
|
84
|
+
* const snapshot = cache.hasValid() ? cache.read() : null;
|
|
85
|
+
* return snapshot;
|
|
86
|
+
* }
|
|
87
|
+
* ```
|
|
44
88
|
*/
|
|
45
89
|
export declare function createSessionCache(options?: SessionCacheOptions): SessionCache;
|
|
46
90
|
/**
|
|
47
|
-
*
|
|
91
|
+
* Subscribes to browser storage events for one session-cache key.
|
|
92
|
+
*
|
|
93
|
+
* @param key - Exact localStorage key to observe.
|
|
94
|
+
*
|
|
95
|
+
* @param onChanged - Synchronous callback invoked when a storage event has this exact key.
|
|
48
96
|
*
|
|
49
|
-
* @returns
|
|
97
|
+
* @returns Cleanup that removes the listener; a no-op function on the server.
|
|
98
|
+
*
|
|
99
|
+
* @remarks Browser storage events generally come from other documents, not the writing
|
|
100
|
+
* window. Events with key null (including storage.clear()) do not match. The callback
|
|
101
|
+
* should reverify the session; its errors are not caught by this listener.
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```ts
|
|
105
|
+
* import {
|
|
106
|
+
* createSessionCache, subscribeSessionCacheStorageEvent,
|
|
107
|
+
* } from '@alneas/appkit-react/tools/auth';
|
|
108
|
+
* export function watchSession(reverify: () => void) {
|
|
109
|
+
* const cache = createSessionCache();
|
|
110
|
+
* return subscribeSessionCacheStorageEvent(cache.key, reverify);
|
|
111
|
+
* }
|
|
112
|
+
* // Call the returned cleanup when the host subscription is disposed.
|
|
113
|
+
* ```
|
|
50
114
|
*/
|
|
51
115
|
export declare function subscribeSessionCacheStorageEvent(key: string, onChanged: () => void): () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-cache.js","names":["createSessionCache","key","options","ttl","read","raw","parsed","entry","hit","subscribeSessionCacheStorageEvent","handler","e","onChanged"],"sources":["../../../../src/tools/components/auth/session-cache.ts"],"sourcesContent":["import type { User } from './types';\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"session-cache.js","names":["createSessionCache","key","options","ttl","read","raw","parsed","entry","hit","subscribeSessionCacheStorageEvent","handler","e","onChanged"],"sources":["../../../../src/tools/components/auth/session-cache.ts"],"sourcesContent":["import type { User } from './types';\n\n/**\n * A stored display snapshot, not proof of a valid authenticated session.\n * See createSessionCache for writes, expiration checks and host verification.\n *\n * @see createSessionCache for the canonical usage example.\n */\nexport interface SessionCacheEntry {\n /** Last confirmed display user; null records an explicitly logged-out state. */\n user: User | null;\n /** Expiration timestamp in milliseconds since the Unix epoch. */\n exp: number;\n}\n\n/**\n * Storage settings for createSessionCache; no providers or CSS are required.\n * @see createSessionCache for the canonical usage example.\n */\nexport interface SessionCacheOptions {\n /** localStorage key; defaults to dataarthub.auth.last-session. */\n key?: string;\n /** Snapshot lifetime in milliseconds; defaults to seven days. */\n ttl?: number;\n}\n\nconst DEFAULT_KEY = 'dataarthub.auth.last-session';\nconst DEFAULT_TTL = 7 * 24 * 60 * 60 * 1000;\n\n/**\n * Best-effort browser snapshot storage; see createSessionCache for usage.\n * @see createSessionCache for the canonical usage example.\n */\nexport interface SessionCache {\n /** Resolved storage key shared with storage-event subscribers. */\n readonly key: string;\n /**\n * Read the stored snapshot without enforcing expiration.\n *\n * @returns Parsed entry (possibly expired), or null on server, missing data or parse/storage failure.\n *\n * @remarks See createSessionCache for the write/read usage pattern.\n */\n read(): SessionCacheEntry | null;\n /**\n * Store display state with a fresh expiration.\n *\n * @param user - Display user or null for confirmed logout; exclude secrets.\n *\n * @returns No value; storage failures and server writes are ignored.\n *\n * @remarks See createSessionCache for the write/read usage pattern.\n */\n write(user: User | null): void;\n /**\n * Remove the snapshot for this key.\n *\n * @returns No value; server calls and storage failures are ignored.\n *\n * @remarks Obtain this helper from createSessionCache, then call cache.clear().\n */\n clear(): void;\n /**\n * Check whether the stored expiration is still in the future.\n *\n * @returns True for a readable snapshot with exp greater than Date.now(), including a logged-out snapshot.\n *\n * @remarks See createSessionCache for a guarded read example.\n */\n hasValid(): boolean;\n}\n\n/**\n * Creates best-effort localStorage helpers for optimistic session display.\n *\n * @param options - Optional storage key and lifetime; defaults to the shared key and seven days.\n *\n * @returns Helpers that read, write, clear and check expiration without authenticating a user.\n *\n * @remarks read() validates only the numeric exp field and does not reject expired data;\n * hasValid() checks expiration. Server reads return null and writes/clears do nothing.\n * Browser storage/JSON failures are swallowed. Store display fields only, never tokens\n * or secrets; verify the actual session with the backend before allowing protected work.\n *\n * @example\n * ```ts\n * import { createSessionCache, type User } from '@alneas/appkit-react/tools/auth';\n * export function rememberSession(user: User | null) {\n * const cache = createSessionCache({ ttl: 24 * 60 * 60 * 1000 });\n * cache.write(user); // null records confirmed logout.\n * const snapshot = cache.hasValid() ? cache.read() : null;\n * return snapshot;\n * }\n * ```\n */\nexport function createSessionCache(options: SessionCacheOptions = {}): SessionCache {\n const key = options.key ?? DEFAULT_KEY;\n const ttl = options.ttl ?? DEFAULT_TTL;\n\n const read = (): SessionCacheEntry | null => {\n if (typeof window === 'undefined') return null;\n try {\n const raw = window.localStorage.getItem(key);\n if (!raw) return null;\n const parsed = JSON.parse(raw) as SessionCacheEntry;\n if (typeof parsed?.exp !== 'number') return null;\n return parsed;\n } catch {\n return null;\n }\n };\n\n const write = (user: User | null): void => {\n if (typeof window === 'undefined') return;\n try {\n const entry: SessionCacheEntry = { user, exp: Date.now() + ttl };\n window.localStorage.setItem(key, JSON.stringify(entry));\n } catch {\n /* storage が無効 (private mode 等) でも致命的ではない */\n }\n };\n\n const clear = (): void => {\n if (typeof window === 'undefined') return;\n try {\n window.localStorage.removeItem(key);\n } catch {\n /* noop */\n }\n };\n\n return {\n key,\n read,\n write,\n clear,\n hasValid: () => {\n const hit = read();\n return hit != null && hit.exp > Date.now();\n },\n };\n}\n\n/**\n * Subscribes to browser storage events for one session-cache key.\n *\n * @param key - Exact localStorage key to observe.\n *\n * @param onChanged - Synchronous callback invoked when a storage event has this exact key.\n *\n * @returns Cleanup that removes the listener; a no-op function on the server.\n *\n * @remarks Browser storage events generally come from other documents, not the writing\n * window. Events with key null (including storage.clear()) do not match. The callback\n * should reverify the session; its errors are not caught by this listener.\n *\n * @example\n * ```ts\n * import {\n * createSessionCache, subscribeSessionCacheStorageEvent,\n * } from '@alneas/appkit-react/tools/auth';\n * export function watchSession(reverify: () => void) {\n * const cache = createSessionCache();\n * return subscribeSessionCacheStorageEvent(cache.key, reverify);\n * }\n * // Call the returned cleanup when the host subscription is disposed.\n * ```\n */\nexport function subscribeSessionCacheStorageEvent(\n key: string,\n onChanged: () => void,\n): () => void {\n if (typeof window === 'undefined') return () => {};\n const handler = (e: StorageEvent) => {\n if (e.key === key) onChanged();\n };\n window.addEventListener('storage', handler);\n return () => window.removeEventListener('storage', handler);\n}\n"],"mappings":";AA+FA,SAAgBA,EAAmB,IAA+B,CAAC,GAAiB;CAClF,IAAMC,IAAMC,EAAQ,OAAO,gCACrBC,IAAMD,EAAQ,OAAO,QAErBE,UAAuC;EAC3C,IAAI,OAAO,SAAW,KAAa,OAAO;EAC1C,IAAI;GACF,IAAMC,IAAM,OAAO,aAAa,QAAQJ,CAAG;GAC3C,IAAI,CAACI,GAAK,OAAO;GACjB,IAAMC,IAAS,KAAK,MAAMD,CAAG;GAE7B,OADI,OAAOC,GAAQ,OAAQ,WACpBA,IADqC;EAE9C,QAAQ;GACN,OAAO;EACT;CACF;CAqBA,OAAO;EACL;EACA;EACA,QAtBa,MAA4B;GACzC,IAAI,OAAO,SAAW,KACtB,IAAI;IACF,IAAMC,IAA2B;KAAE;KAAM,KAAK,KAAK,IAAI,IAAIJ;IAAI;IAC/D,OAAO,aAAa,QAAQF,GAAK,KAAK,UAAUM,CAAK,CAAC;GACxD,QAAQ,CAER;EACF;EAeE,aAbwB;GACxB,IAAI,OAAO,SAAW,KACtB,IAAI;IACF,OAAO,aAAa,WAAWN,CAAG;GACpC,QAAQ,CAER;EACF;EAOE,gBAAgB;GACd,IAAMO,IAAMJ,EAAK;GACjB,OAAOI,KAAO,QAAQA,EAAI,MAAM,KAAK,IAAI;EAC3C;CACF;AACF;AA2BA,SAAgBC,EACd,GACA,GACY;CACZ,IAAI,OAAO,SAAW,KAAa,aAAa,CAAC;CACjD,IAAMC,KAAW,MAAoB;EACnC,AAAIC,EAAE,QAAQV,KAAKW,EAAU;CAC/B;CAEA,OADA,OAAO,iBAAiB,WAAWF,CAAO,SAC7B,OAAO,oBAAoB,WAAWA,CAAO;AAC5D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs","names":["z","zod","UserSchema"],"sources":["../../../../src/tools/components/auth/types.ts"],"sourcesContent":["import { z } from 'zod';\n\nexport const UserSchema = z.object({\n /** ユーザーの一意識別子 */\n id: z.string(),\n /** メールアドレス */\n email: z.string().email(),\n /** 表示名 */\n name: z.string().optional(),\n /** アバター画像URL */\n avatarUrl: z.string().optional(),\n /** ユーザーロール (例: \"admin\", \"user\") */\n role: z.string().optional(),\n /** メールアドレスが認証済みかどうか(Firebase 等で利用) */\n emailVerified: z.boolean().optional(),\n /** 認証プロバイダー固有のメタデータ */\n metadata: z.record(z.string(), z.any()).optional(),\n});\n\n/** ユーザー情報の定義 */\nexport type User = z.infer<typeof UserSchema>;\n\n/** 組み込み OAuth プロバイダー */\nexport type BuiltInOAuthProvider = 'google' | 'line' | 'apple' | 'github';\n\n/**\n * OAuth プロバイダー\n *\n * 組み込みプロバイダー (`google`, `line`, `apple`, `github`) に加え、\n * Supabase Dashboard で設定したカスタム OIDC プロバイダー名も指定可能です。\n *\n * @example\n * ```tsx\n * // 組み込みプロバイダー\n * await loginWithProvider('google');\n *\n * // カスタム OIDC プロバイダー(Supabase Dashboard で設定した名前)\n * await loginWithProvider('line-oidc');\n * ```\n */\nexport type OAuthProvider = BuiltInOAuthProvider | (string & {});\n\nexport interface OAuthLoginOptions {\n redirectTo?: string;\n scopes?: string[];\n queryParams?: Record<string, string>;\n}\n\n/**\n * 認証アダプターのインターフェース\n * Firebase, Supabase, Mock などの認証プロバイダーを抽象化します。\n */\nexport interface AuthAdapter {\n /**\n * Optional non-secret namespace for this backend/tenant's optimistic session storage.\n * Defaults to runtime adapter identity (no cross-reload reuse). Never infer it from cached\n * profiles or credentials. Provider instances always have separate session query keys.\n */\n readonly cacheScope?: string;\n /** ログイン */\n login: (email: string, password: string) => Promise<User>;\n /** 新規登録 */\n register: (email: string, password: string, data?: { name?: string }) => Promise<User>;\n /** ログアウト */\n logout: () => Promise<void>;\n /** パスワードリセットメール送信 */\n resetPassword: (email: string) => Promise<void>;\n /** メールアドレス変更 */\n updateEmail: (email: string) => Promise<void>;\n /** パスワード変更 */\n updatePassword: (password: string) => Promise<void>;\n /**\n * 再認証(パスワード変更・メール変更前に必要)\n *\n * Firebase などのプロバイダーではセキュリティ上、メールアドレスや\n * パスワードの変更前に現在のパスワードで再認証する必要があります。\n * アダプターが対応していない場合は undefined になります。\n *\n * @param password - 現在のパスワード\n */\n reauthenticate?: (password: string) => Promise<void>;\n /**\n * メールアドレス確認メールを送信\n *\n * 新規登録後やメールアドレス変更後に、確認用メールを送信します。\n * アダプターが対応していない場合は undefined になります。\n */\n sendVerificationEmail?: () => Promise<void>;\n /**\n * 認証トークンを取得\n *\n * API 呼び出し時の Authorization ヘッダーに使用するトークンを返します。\n * Firebase の場合は ID Token、Supabase の場合は access_token を返します。\n * アダプターが対応していない場合は undefined になります。\n *\n * @returns トークン文字列、または未認証の場合は null\n */\n getToken?: () => Promise<string | null>;\n /** 現在のユーザーを取得 */\n getCurrentUser: () => Promise<User | null>;\n\n /**\n * 認証状態の変更を監視\n */\n onAuthStateChanged: (callback: (user: User | null) => void) => () => void;\n /** OAuth サインイン (Google/LINE など) */\n loginWithProvider?: (\n provider: OAuthProvider,\n options?: OAuthLoginOptions,\n ) => Promise<User | null>;\n}\n\n/**\n * ユーザープロファイルの基本型\n * id は認証ユーザーの uid と同一\n */\nexport interface BaseProfile {\n id: string;\n email: string;\n created_at?: Date | string;\n updated_at?: Date | string;\n}\n\n/**\n * プロファイルアダプターのインターフェース\n * データベースとの同期を抽象化します。\n *\n * @template T プロファイルの型 (BaseProfile を継承)\n */\nexport interface ProfileAdapter<T extends BaseProfile = BaseProfile> {\n /** テーブル/コレクション名 */\n tableName: string;\n\n /**\n * 新規ユーザー作成時にプロファイルを作成\n * @param uid 認証ユーザーID\n * @param authUser 認証ユーザー情報\n * @param additionalData 追加データ\n */\n create: (uid: string, authUser: User, additionalData?: Partial<T>) => Promise<T>;\n\n /**\n * ログイン時にプロファイルを取得\n * @param uid 認証ユーザーID\n */\n get: (uid: string) => Promise<T | null>;\n\n /**\n * プロファイルを更新\n * @param uid 認証ユーザーID\n * @param updates 更新データ\n */\n update: (uid: string, updates: Partial<T>) => Promise<T>;\n\n /**\n * プロファイルを削除\n * @param uid 認証ユーザーID\n */\n delete: (uid: string) => Promise<void>;\n\n /**\n * プロファイルの存在確認\n * @param uid 認証ユーザーID\n */\n exists?: (uid: string) => Promise<boolean>;\n}\n\n// =====================================================\n// Invitation System\n// =====================================================\n\n/** 招待種別 */\nexport type InvitationType = 'organization' | 'project' | 'team';\n\n/** 招待ステータス */\nexport type InvitationState = 'pending' | 'accepted' | 'declined' | 'expired' | 'cancelled';\n\n/**\n * 招待情報の定義\n */\nexport interface Invitation {\n id: string;\n /** 招待種別 */\n type: InvitationType;\n /** 対象ID (organization_id, project_id, team_id) */\n targetId: string;\n /** 対象名 (表示用) */\n targetName?: string;\n /** 招待先メールアドレス */\n inviteeEmail: string;\n /** 招待先ユーザーID (既存ユーザーの場合) */\n inviteeUserId?: string;\n /** 付与する役割 */\n role: string;\n /** ステータス */\n state: InvitationState;\n /** 招待トークン (リンク用) */\n token: string;\n /** 有効期限 */\n expiresAt: Date | string;\n /** 招待者ID */\n invitedBy: string;\n /** 招待者名 (表示用) */\n invitedByName?: string;\n /** 作成日時 */\n createdAt: Date | string;\n /** 応答日時 */\n respondedAt?: Date | string;\n}\n\n/**\n * 招待作成パラメータ\n */\nexport interface CreateInvitationParams {\n type: InvitationType;\n targetId: string;\n inviteeEmail: string;\n role: string;\n /** 有効期限 (時間, デフォルト: 168 = 7日) */\n expirationHours?: number;\n /** メッセージ */\n message?: string;\n}\n\n/**\n * 招待承諾時のコールバック\n * organization_members, project_members, team_members への追加処理を実装\n */\nexport type OnInvitationAcceptedCallback = (\n invitation: Invitation,\n userId: string,\n) => Promise<void>;\n\n/**\n * 招待アダプターのインターフェース\n * 組織/プロジェクト/チームへの招待・承認フローを抽象化します。\n */\nexport interface InvitationAdapter {\n /** テーブル/コレクション名 */\n tableName: string;\n\n /**\n * 招待を作成\n * @param params 招待パラメータ\n * @param invitedBy 招待者のユーザーID\n */\n create: (params: CreateInvitationParams, invitedBy: string) => Promise<Invitation>;\n\n /**\n * トークンで招待を取得\n * @param token 招待トークン\n */\n getByToken: (token: string) => Promise<Invitation | null>;\n\n /**\n * 招待を承諾\n * @param token 招待トークン\n * @param userId 承諾するユーザーID\n * @param onAccepted メンバー追加処理のコールバック\n */\n accept: (\n token: string,\n userId: string,\n onAccepted?: OnInvitationAcceptedCallback,\n ) => Promise<void>;\n\n /**\n * 招待を拒否\n * @param token 招待トークン\n */\n decline: (token: string) => Promise<void>;\n\n /**\n * ユーザーの保留中の招待を取得\n * @param email ユーザーのメールアドレス\n */\n listPendingForUser: (email: string) => Promise<Invitation[]>;\n\n /**\n * 対象の保留中の招待を取得\n * @param type 招待種別\n * @param targetId 対象ID\n */\n listPendingForTarget: (type: InvitationType, targetId: string) => Promise<Invitation[]>;\n\n /**\n * 招待をキャンセル\n * @param invitationId 招待ID\n */\n cancel: (invitationId: string) => Promise<void>;\n\n /**\n * 招待を再送信 (トークン再生成 + 期限延長)\n * @param invitationId 招待ID\n */\n resend: (invitationId: string) => Promise<Invitation>;\n\n /**\n * 期限切れ招待をクリーンアップ\n */\n cleanupExpired?: () => Promise<number>;\n}\n"],"mappings":"A,qGAEA,IAAaE,EAAaF,EAAAA,EAAE,OAAO,CAEjC,GAAIA,EAAAA,EAAE,OAAO,EAEb,MAAOA,EAAAA,EAAE,OAAO,CAAC,CAAC,MAAM,EAExB,KAAMA,EAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,EAE1B,UAAWA,EAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,EAE/B,KAAMA,EAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,EAE1B,cAAeA,EAAAA,EAAE,QAAQ,CAAC,CAAC,SAAS,EAEpC,SAAUA,EAAAA,EAAE,OAAOA,EAAAA,EAAE,OAAO,EAAGA,EAAAA,EAAE,IAAI,CAAC,CAAC,CAAC,SAAS,CACnD,CAAC,E"}
|
|
1
|
+
{"version":3,"file":"types.cjs","names":["z","zod","UserSchema"],"sources":["../../../../src/tools/components/auth/types.ts"],"sourcesContent":["import { z } from 'zod';\n\n/**\n * Zod schema for Appkit display-user records with a required ID and valid email.\n *\n * @remarks Optional metadata accepts arbitrary values; this schema does not establish\n * session validity or authorization. See AuthProvider for session verification.\n *\n * @example\n * ```ts\n * import { UserSchema } from '@alneas/appkit-react/tools/auth';\n * const user = UserSchema.parse({ id: 'display-1', email: 'reader@example.com' });\n * ```\n */\nexport const UserSchema = z.object({\n /**\n * Stable display user identifier.\n */\n id: z.string(),\n /**\n * Required valid email address.\n */\n email: z.string().email(),\n /**\n * Optional display name.\n */\n name: z.string().optional(),\n /**\n * Optional avatar URL; not validated as a URL by this schema.\n */\n avatarUrl: z.string().optional(),\n /**\n * Optional host role string used for display.\n */\n role: z.string().optional(),\n /**\n * Optional host assertion of email verification.\n */\n emailVerified: z.boolean().optional(),\n /**\n * Optional string-keyed metadata; arbitrary values are accepted.\n */\n metadata: z.record(z.string(), z.any()).optional(),\n});\n\n/**\n * Display-user shape inferred from UserSchema; exclude credentials from optimistic storage.\n *\n * @see AuthProvider for consumption.\n */\nexport type User = z.infer<typeof UserSchema>;\n\n/**\n * Common OAuth identifiers; actual support depends on the host adapter/backend.\n *\n * @see AuthAdapter.loginWithProvider.\n */\nexport type BuiltInOAuthProvider = 'google' | 'line' | 'apple' | 'github';\n\n/**\n * OAuth identifier supporting both common names and host-defined custom provider names.\n *\n * @see AuthAdapter.loginWithProvider.\n */\nexport type OAuthProvider = BuiltInOAuthProvider | (string & {});\n\n/**\n * Optional OAuth redirect, scopes and provider query parameters interpreted by the host adapter.\n *\n * @see AuthAdapter.loginWithProvider.\n */\nexport interface OAuthLoginOptions {\n /**\n * Post-authentication destination interpreted by the adapter.\n */\n redirectTo?: string;\n /**\n * Optional requested provider scopes; adapter support varies.\n */\n scopes?: string[];\n /**\n * Additional provider query parameters; host validation is required.\n */\n queryParams?: Record<string, string>;\n}\n\n/**\n * Host authentication contract consumed by AuthProvider.\n *\n * @remarks Implementations own network access, credentials, session validation and backend\n * authorization. Optional methods are exposed only when supplied. Methods may reject with\n * backend/transport errors; AuthProvider tracks login/register/logout/OAuth errors.\n *\n * @see AuthProvider for a complete host-adapter example.\n */\nexport interface AuthAdapter {\n /**\n * Optional non-secret backend/tenant namespace for optimistic display cache reuse; omission uses runtime adapter identity.\n */\n readonly cacheScope?: string;\n /**\n * Sign in with email/password.\n *\n * @param email - Account email.\n *\n * @param password - Account password.\n *\n * @returns Signed-in user after adapter completion.\n */\n login: (email: string, password: string) => Promise<User>;\n /**\n * Create an account through the host backend.\n *\n * @param email - New account email.\n *\n * @param password - New account password.\n *\n * @param data - Optional name passed by the bundled registration form.\n *\n * @returns Registered user.\n */\n register: (email: string, password: string, data?: {\n /** Optional display name. */\n name?: string;\n }) => Promise<User>;\n /**\n * End the host session.\n *\n * @returns No value after sign-out completion.\n */\n logout: () => Promise<void>;\n /**\n * Request a password reset.\n *\n * @param email - Account email.\n *\n * @returns No value after the host accepts the request; email delivery is host-owned.\n */\n resetPassword: (email: string) => Promise<void>;\n /**\n * Request an account email change.\n *\n * @param email - New account email.\n *\n * @returns No value after host completion.\n */\n updateEmail: (email: string) => Promise<void>;\n /**\n * Request an account password change.\n *\n * @param password - New password.\n *\n * @returns No value after host completion.\n */\n updatePassword: (password: string) => Promise<void>;\n /**\n * Optional confirmation of current credentials.\n *\n * @param password - Current account password.\n *\n * @returns No value after host confirmation.\n */\n reauthenticate?: (password: string) => Promise<void>;\n /**\n * Optional verification-email request.\n *\n * @returns No value after request completion; delivery is host-owned.\n */\n sendVerificationEmail?: () => Promise<void>;\n /**\n * Optional host token lookup.\n *\n * @returns Token string or null when unavailable; token type is adapter-specific.\n */\n getToken?: () => Promise<string | null>;\n /**\n * Read the current host session user.\n *\n * @returns User or null for no session; adapter-specific error handling may reject.\n */\n getCurrentUser: () => Promise<User | null>;\n /**\n * Subscribe to host user-state changes.\n *\n * @param callback - Receives each observed user or null; timing and initial invocation are adapter-specific.\n *\n * @returns Cleanup that stops future observation subject to in-flight adapter work.\n */\n\n onAuthStateChanged: (callback: (user: User | null) => void) => () => void;\n /**\n * Optional OAuth sign-in operation.\n *\n * @param provider - Host-configured provider identifier.\n *\n * @param options - Optional redirect, scopes and query parameters.\n *\n * @returns User when available, or null for a redirect-only/incomplete sign-in.\n */\n loginWithProvider?: (\n provider: OAuthProvider,\n options?: OAuthLoginOptions,\n ) => Promise<User | null>;\n}\n\n/**\n * Persisted profile keyed by the authentication user ID.\n *\n * @see UserProfileProvider for adapter usage.\n */\nexport interface BaseProfile {\n /**\n * Authentication user ID used as the profile key.\n */\n id: string;\n /**\n * Profile email stored by the host.\n */\n email: string;\n /**\n * Optional host creation timestamp; no format validation is performed.\n */\n created_at?: Date | string;\n /**\n * Optional update timestamp; UserProfileProvider updates use an ISO string.\n */\n updated_at?: Date | string;\n}\n\n/**\n * Host persistence contract for authenticated profile records.\n *\n * @typeParam T - Persisted record extending BaseProfile; defaults to BaseProfile.\n *\n * @remarks No concrete profile backend is bundled. The host must enforce authorization\n * and decide persistence/transaction behavior; operations may reject with backend errors.\n *\n * @see UserProfileProvider for setup.\n */\nexport interface ProfileAdapter<T extends BaseProfile = BaseProfile> {\n /**\n * Collection name used in detail/list query keys.\n */\n tableName: string;\n /**\n * Create a profile for an authenticated user.\n *\n * @param uid - Authentication user ID.\n *\n * @param authUser - Authenticated display user.\n *\n * @param additionalData - Optional default profile fields supplied by UserProfileProvider.\n *\n * @returns Created persisted profile.\n */\n\n create: (uid: string, authUser: User, additionalData?: Partial<T>) => Promise<T>;\n /**\n * Read a profile by authentication user ID.\n *\n * @param uid - Profile/user identifier.\n *\n * @returns Profile or null when absent.\n */\n\n get: (uid: string) => Promise<T | null>;\n /**\n * Persist partial profile updates.\n *\n * @param uid - Profile identifier.\n *\n * @param updates - Partial fields to persist.\n *\n * @returns Updated persisted record.\n */\n\n update: (uid: string, updates: Partial<T>) => Promise<T>;\n /**\n * Delete a persisted profile.\n *\n * @param uid - Profile identifier.\n *\n * @returns No value after deletion completes.\n */\n\n delete: (uid: string) => Promise<void>;\n /**\n * Optional existence check.\n *\n * @param uid - Profile/user identifier.\n *\n * @returns Whether the host record exists.\n */\n\n exists?: (uid: string) => Promise<boolean>;\n}\n\n// =====================================================\n// Invitation System\n// =====================================================\n\n/**\n * Target category for a host-managed invitation.\n *\n * @see InvitationAdapter.create.\n */\nexport type InvitationType = 'organization' | 'project' | 'team';\n\n/**\n * Host invitation lifecycle state; the type does not perform transitions or expiry checks.\n *\n * @see InvitationAdapter.\n */\nexport type InvitationState = 'pending' | 'accepted' | 'declined' | 'expired' | 'cancelled';\n\n/**\n * Host-managed invitation record with target, recipient and response metadata.\n *\n * @see InvitationAdapter.getByToken.\n */\nexport interface Invitation {\n /**\n * Host invitation identifier.\n */\n id: string;\n /**\n * Invited resource category.\n */\n type: InvitationType;\n /**\n * Host resource identifier.\n */\n targetId: string;\n /**\n * Optional target display name.\n */\n targetName?: string;\n /**\n * Recipient email address.\n */\n inviteeEmail: string;\n /**\n * Recipient user identifier when already known.\n */\n inviteeUserId?: string;\n /**\n * Role to grant after host acceptance.\n */\n role: string;\n /**\n * Current host-managed lifecycle state.\n */\n state: InvitationState;\n /**\n * Invitation-link token; validate and protect it in host code.\n */\n token: string;\n /**\n * Host expiration timestamp as Date or string.\n */\n expiresAt: Date | string;\n /**\n * Inviting user identifier.\n */\n invitedBy: string;\n /**\n * Optional inviting user display name.\n */\n invitedByName?: string;\n /**\n * Host creation timestamp.\n */\n createdAt: Date | string;\n /**\n * Optional host acceptance/decline timestamp.\n */\n respondedAt?: Date | string;\n}\n\n/**\n * Inputs for host invitation creation; no bundled implementation imposes defaults.\n *\n * @see InvitationAdapter.create.\n */\nexport interface CreateInvitationParams {\n /**\n * Invited resource category.\n */\n type: InvitationType;\n /**\n * Target resource identifier.\n */\n targetId: string;\n /**\n * Recipient email address.\n */\n inviteeEmail: string;\n /**\n * Role requested for the recipient.\n */\n role: string;\n /**\n * Optional lifetime in hours; this interface does not enforce a seven-day or other default.\n */\n expirationHours?: number;\n /**\n * Optional host-delivered message.\n */\n message?: string;\n}\n\n/**\n * Host callback for adding an accepted user to the invited resource.\n *\n * @param invitation - Invitation being accepted.\n *\n * @param userId - Accepting user identifier.\n *\n * @returns No value after host membership work completes.\n *\n * @remarks Invocation order and rollback on rejection depend on the host adapter.\n *\n * @see InvitationAdapter.accept.\n */\nexport type OnInvitationAcceptedCallback = (\n invitation: Invitation,\n userId: string,\n) => Promise<void>;\n\n/**\n * Host contract for invitation persistence and lifecycle operations.\n *\n * @remarks No implementation is bundled here. Host code owns expiry, token validation,\n * permissions, delivery and transaction semantics. Any operation may reject on backend\n * failure; optional cleanup is undefined when unsupported.\n *\n * @example\n * ```ts\n * import type { InvitationAdapter } from '@alneas/appkit-react/tools/auth';\n * export async function inspectInvitation(adapter: InvitationAdapter, token: string) {\n * return adapter.getByToken(token);\n * }\n * ```\n */\nexport interface InvitationAdapter {\n /**\n * Host collection name for invitations.\n */\n tableName: string;\n /**\n * Create and optionally deliver an invitation through the host.\n *\n * @param params - Recipient, target, role and optional lifetime/message.\n *\n * @param invitedBy - Inviting user identifier.\n *\n * @returns Created invitation.\n */\n\n create: (params: CreateInvitationParams, invitedBy: string) => Promise<Invitation>;\n /**\n * Find an invitation by host token.\n *\n * @param token - Invitation-link token.\n *\n * @returns Matching invitation or null.\n */\n\n getByToken: (token: string) => Promise<Invitation | null>;\n /**\n * Accept an invitation and optionally perform membership work.\n *\n * @param token - Invitation-link token.\n *\n * @param userId - Accepting user identifier.\n *\n * @param onAccepted - Optional async host membership callback; host implementation defines ordering and rollback.\n *\n * @returns No value after host acceptance completes.\n */\n\n accept: (\n token: string,\n userId: string,\n onAccepted?: OnInvitationAcceptedCallback,\n ) => Promise<void>;\n /**\n * Decline a host invitation.\n *\n * @param token - Invitation-link token.\n *\n * @returns No value after host completion.\n */\n\n decline: (token: string) => Promise<void>;\n /**\n * List pending invitations for a recipient.\n *\n * @param email - Recipient email.\n *\n * @returns Invitation array, possibly empty.\n */\n\n listPendingForUser: (email: string) => Promise<Invitation[]>;\n /**\n * List pending invitations for a resource.\n *\n * @param type - Resource category.\n *\n * @param targetId - Resource identifier.\n *\n * @returns Invitation array, possibly empty.\n */\n\n listPendingForTarget: (type: InvitationType, targetId: string) => Promise<Invitation[]>;\n /**\n * Cancel a host invitation.\n *\n * @param invitationId - Invitation identifier.\n *\n * @returns No value after cancellation completes.\n */\n\n cancel: (invitationId: string) => Promise<void>;\n /**\n * Request host invitation reissue/delivery.\n *\n * @param invitationId - Invitation identifier.\n *\n * @returns Updated invitation; token/expiry policy is host-owned.\n */\n\n resend: (invitationId: string) => Promise<Invitation>;\n /**\n * Optional host expiry cleanup.\n *\n * @returns Count of invitations affected by the host cleanup policy.\n */\n\n cleanupExpired?: () => Promise<number>;\n}\n"],"mappings":"A,qGAcA,IAAaE,EAAaF,EAAAA,EAAE,OAAO,CAIjC,GAAIA,EAAAA,EAAE,OAAO,EAIb,MAAOA,EAAAA,EAAE,OAAO,CAAC,CAAC,MAAM,EAIxB,KAAMA,EAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,EAI1B,UAAWA,EAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,EAI/B,KAAMA,EAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,EAI1B,cAAeA,EAAAA,EAAE,QAAQ,CAAC,CAAC,SAAS,EAIpC,SAAUA,EAAAA,EAAE,OAAOA,EAAAA,EAAE,OAAO,EAAGA,EAAAA,EAAE,IAAI,CAAC,CAAC,CAAC,SAAS,CACnD,CAAC,E"}
|