appos 0.6.0-0 → 0.6.1-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/dist/alert-BdX0Zt8k.js +103 -0
- package/dist/animated-check-CKu20goQ.js +68 -0
- package/dist/api/auth.d.mts +4 -0
- package/dist/api/auth.mjs +276 -0
- package/dist/api/cache.d.mts +3 -0
- package/dist/api/cache.mjs +28 -0
- package/dist/{exports/cli/index.d.mts → api/cli.d.mts} +8 -7
- package/dist/{exports/cli/index.mjs → api/cli.mjs} +47 -53
- package/dist/api/container.d.mts +6 -0
- package/dist/api/container.mjs +52 -0
- package/dist/api/database.d.mts +5 -0
- package/dist/api/database.mjs +8 -0
- package/dist/api/event.d.mts +6 -0
- package/dist/api/event.mjs +5 -0
- package/dist/api/instrumentation.d.mts +4 -0
- package/dist/api/instrumentation.mjs +11 -0
- package/dist/api/mailer.d.mts +6 -0
- package/dist/api/mailer.mjs +64 -0
- package/dist/api/observability.d.mts +4 -0
- package/dist/api/observability.mjs +79 -0
- package/dist/api/openapi.d.mts +6 -0
- package/dist/api/openapi.mjs +5 -0
- package/dist/api/server.d.mts +6 -0
- package/dist/api/server.mjs +8 -0
- package/dist/{exports/web/routes.d.mts → api/ssr.d.mts} +26 -11
- package/dist/{exports/web/routes.mjs → api/ssr.mjs} +24 -28
- package/dist/api/storage.d.mts +6 -0
- package/dist/{exports/api/index.mjs → api/storage.mjs} +77 -736
- package/dist/api/worker.d.mts +26 -0
- package/dist/api/worker.mjs +3 -0
- package/dist/api/workflow.d.mts +6 -0
- package/dist/api/workflow.mjs +7 -0
- package/dist/app-context-Cossa4Qc.mjs +3 -0
- package/dist/auth-BBivVOI9.mjs +26 -0
- package/dist/auth-BzQ2oAZ8.d.mts +5401 -0
- package/dist/{exports/web/index.d.ts → auth-D56zivoE.d.ts} +6622 -9467
- package/dist/auth-schema-OUnjUQlj.mjs +385 -0
- package/dist/badge-BFQXkO9d.js +49 -0
- package/dist/brand-CjbfdIEo.js +114 -0
- package/dist/brand-DhfRxUs9.d.ts +88 -0
- package/dist/button-CBH7xJ8q.js +81 -0
- package/dist/cache-B-TvutDL.d.mts +75 -0
- package/dist/card-X792kQrC.js +154 -0
- package/dist/checkbox-e3A3glfd.js +33 -0
- package/dist/{exports/constants-BicCnEiJ.mjs → constants-BLEvvEa7.mjs} +6 -5
- package/dist/container-C00pnItg.d.mts +2804 -0
- package/dist/context-9Yd81kh5.mjs +13 -0
- package/dist/context-La08hSVU.js +45 -0
- package/dist/database-A6tffVCD.mjs +220 -0
- package/dist/database-ltnXGvKZ.d.mts +102 -0
- package/dist/{exports/storybook/index.d.ts → devtools/storybook.d.ts} +1 -1
- package/dist/{exports/storybook/index.js → devtools/storybook.js} +1 -1
- package/dist/devtools/test-mock.mjs +3 -0
- package/dist/{exports/tests/setup.mjs → devtools/test-setup.mjs} +1 -1
- package/dist/{exports/tests/api.d.mts → devtools/test.d.mts} +16 -6
- package/dist/{exports/tests/api.mjs → devtools/test.mjs} +30 -15
- package/dist/{exports/vite/index.d.mts → devtools/vite.d.mts} +6 -2
- package/dist/{exports/vite/index.mjs → devtools/vite.mjs} +24 -4
- package/dist/empty-BonqCObb.js +61 -0
- package/dist/env-C-0yH_Q3.mjs +26 -0
- package/dist/event-DeqWH7f1.mjs +236 -0
- package/dist/field-7rMKJCeh.js +115 -0
- package/dist/input-D9PbuBOa.js +27 -0
- package/dist/input-otp-zHrdocki.js +48 -0
- package/dist/{exports/instrumentation-Dqv_rRlR.mjs → instrumentation-DCouyaIn.mjs} +1 -1
- package/dist/label-C0h_-ojZ.js +26 -0
- package/dist/logger-BJ2PCtBR.d.mts +20 -0
- package/dist/observability-DvkWyfwr.d.mts +43 -0
- package/dist/openapi-C2GOpT-O.mjs +467 -0
- package/dist/redis-a5sw5J3L.mjs +41 -0
- package/dist/separator-DDbWY6ol.js +28 -0
- package/dist/{exports/openapi-uisUTLq7.mjs → server-D_7v-BCM.mjs} +579 -712
- package/dist/spinner-CaEB5f1z.js +28 -0
- package/dist/textarea-CFblOAyj.js +25 -0
- package/dist/universal/auth.d.ts +139 -0
- package/dist/universal/auth.js +108 -0
- package/dist/universal/config.d.ts +47 -0
- package/dist/universal/config.js +128 -0
- package/dist/use-mobile-Dg2CI44J.js +19 -0
- package/dist/utils-4n921m5r.js +52 -0
- package/dist/utils-NKi1RiLK.d.ts +50 -0
- package/dist/web/auth.d.ts +4 -0
- package/dist/web/auth.js +88 -0
- package/dist/web/hooks.d.ts +4 -0
- package/dist/web/hooks.js +3 -0
- package/dist/web/i18n.d.ts +76 -0
- package/dist/web/i18n.js +57 -0
- package/dist/web/router.d.ts +3 -0
- package/dist/web/router.js +4 -0
- package/dist/web/ui/accordion.d.ts +79 -0
- package/dist/web/ui/accordion.js +112 -0
- package/dist/web/ui/alert-dialog.d.ts +200 -0
- package/dist/web/ui/alert-dialog.js +239 -0
- package/dist/web/ui/alert.d.ts +84 -0
- package/dist/web/ui/alert.js +4 -0
- package/dist/web/ui/animated-check.d.ts +38 -0
- package/dist/web/ui/animated-check.js +6 -0
- package/dist/web/ui/aspect-ratio.d.ts +26 -0
- package/dist/web/ui/aspect-ratio.js +28 -0
- package/dist/web/ui/auth.d.ts +4 -0
- package/dist/web/ui/auth.js +3432 -0
- package/dist/web/ui/avatar.d.ts +115 -0
- package/dist/web/ui/avatar.js +134 -0
- package/dist/web/ui/badge.d.ts +32 -0
- package/dist/web/ui/badge.js +4 -0
- package/dist/web/ui/brand.d.ts +3 -0
- package/dist/web/ui/brand.js +6 -0
- package/dist/web/ui/breadcrumb.d.ts +130 -0
- package/dist/web/ui/breadcrumb.js +166 -0
- package/dist/web/ui/button-group.d.ts +28 -0
- package/dist/web/ui/button-group.js +43 -0
- package/dist/web/ui/button.d.ts +83 -0
- package/dist/web/ui/button.js +6 -0
- package/dist/web/ui/calendar.d.ts +26 -0
- package/dist/web/ui/calendar.js +107 -0
- package/dist/web/ui/card.d.ts +134 -0
- package/dist/web/ui/card.js +4 -0
- package/dist/web/ui/carousel.d.ts +56 -0
- package/dist/web/ui/carousel.js +135 -0
- package/dist/web/ui/chart.d.ts +90 -0
- package/dist/web/ui/chart.js +142 -0
- package/dist/web/ui/checkbox.d.ts +22 -0
- package/dist/web/ui/checkbox.js +6 -0
- package/dist/web/ui/collapsible.d.ts +15 -0
- package/dist/web/ui/collapsible.js +27 -0
- package/dist/web/ui/command.d.ts +55 -0
- package/dist/web/ui/command.js +93 -0
- package/dist/web/ui/context-menu.d.ts +80 -0
- package/dist/web/ui/context-menu.js +133 -0
- package/dist/web/ui/dialog.d.ts +169 -0
- package/dist/web/ui/dialog.js +212 -0
- package/dist/web/ui/drawer.d.ts +44 -0
- package/dist/web/ui/drawer.js +80 -0
- package/dist/web/ui/dropdown-menu.d.ts +84 -0
- package/dist/web/ui/dropdown-menu.js +137 -0
- package/dist/web/ui/empty.d.ts +36 -0
- package/dist/web/ui/empty.js +4 -0
- package/dist/web/ui/error-page.d.ts +32 -0
- package/dist/web/ui/error-page.js +87 -0
- package/dist/web/ui/field.d.ts +67 -0
- package/dist/web/ui/field.js +8 -0
- package/dist/web/ui/hover-card.d.ts +20 -0
- package/dist/web/ui/hover-card.js +39 -0
- package/dist/web/ui/input-group.d.ts +45 -0
- package/dist/web/ui/input-group.js +81 -0
- package/dist/web/ui/input-otp.d.ts +28 -0
- package/dist/web/ui/input-otp.js +6 -0
- package/dist/web/ui/input.d.ts +22 -0
- package/dist/web/ui/input.js +4 -0
- package/dist/web/ui/item.d.ts +61 -0
- package/dist/web/ui/item.js +122 -0
- package/dist/web/ui/kbd.d.ts +14 -0
- package/dist/web/ui/kbd.js +21 -0
- package/dist/web/ui/label.d.ts +22 -0
- package/dist/web/ui/label.js +6 -0
- package/dist/web/ui/menubar.d.ts +80 -0
- package/dist/web/ui/menubar.js +136 -0
- package/dist/web/ui/navigation-menu.d.ts +46 -0
- package/dist/web/ui/navigation-menu.js +84 -0
- package/dist/web/ui/pagination.d.ts +131 -0
- package/dist/web/ui/pagination.js +171 -0
- package/dist/web/ui/popover.d.ts +33 -0
- package/dist/web/ui/popover.js +57 -0
- package/dist/web/ui/progress.d.ts +74 -0
- package/dist/web/ui/progress.js +93 -0
- package/dist/web/ui/radio-group.d.ts +15 -0
- package/dist/web/ui/radio-group.js +31 -0
- package/dist/web/ui/resizable.d.ts +20 -0
- package/dist/web/ui/resizable.js +31 -0
- package/dist/web/ui/scroll-area.d.ts +16 -0
- package/dist/web/ui/scroll-area.js +39 -0
- package/dist/web/ui/select.d.ts +167 -0
- package/dist/web/ui/select.js +211 -0
- package/dist/web/ui/separator.d.ts +23 -0
- package/dist/web/ui/separator.js +6 -0
- package/dist/web/ui/sheet.d.ts +42 -0
- package/dist/web/ui/sheet.js +91 -0
- package/dist/web/ui/sidebar.d.ts +160 -0
- package/dist/web/ui/sidebar.js +382 -0
- package/dist/web/ui/skeleton.d.ts +22 -0
- package/dist/web/ui/skeleton.js +26 -0
- package/dist/web/ui/slider.d.ts +26 -0
- package/dist/web/ui/slider.js +55 -0
- package/dist/web/ui/sonner.d.ts +9 -0
- package/dist/web/ui/sonner.js +33 -0
- package/dist/web/ui/spinner.d.ts +22 -0
- package/dist/web/ui/spinner.js +4 -0
- package/dist/web/ui/switch.d.ts +25 -0
- package/dist/web/ui/switch.js +34 -0
- package/dist/web/ui/table.d.ts +38 -0
- package/dist/web/ui/table.js +69 -0
- package/dist/web/ui/tabs.d.ts +84 -0
- package/dist/web/ui/tabs.js +103 -0
- package/dist/web/ui/textarea.d.ts +21 -0
- package/dist/web/ui/textarea.js +4 -0
- package/dist/web/ui/toggle-group.d.ts +28 -0
- package/dist/web/ui/toggle-group.js +55 -0
- package/dist/web/ui/toggle.d.ts +32 -0
- package/dist/web/ui/toggle.js +53 -0
- package/dist/web/ui/tooltip.d.ts +72 -0
- package/dist/web/ui/tooltip.js +91 -0
- package/dist/worker-D4L3BmuS.mjs +24 -0
- package/dist/{exports/send-email-CXxlkfFL.mjs → workflow-MLL2Z1Jv.mjs} +118 -765
- package/package.json +367 -86
- package/src/{storybook → devtools/storybook}/.storybook/main.ts +4 -4
- package/src/{storybook → devtools/storybook}/.storybook/preview.tsx +1 -1
- package/src/{storybook → devtools/storybook}/docs/Introduction.mdx +3 -1
- package/src/{web/client/auth-paths.ts → universal/auth.ts} +54 -6
- package/src/universal/config.test.ts +473 -0
- package/src/universal/config.ts +205 -0
- package/src/universal/date.ts +1 -0
- package/src/universal/locales/en/ui.json +232 -0
- package/src/universal/locales/zh-CN/ui.json +232 -0
- package/src/universal/locales/zh-TW/ui.json +232 -0
- package/src/universal/toolkit.ts +1 -0
- package/src/universal/zod.ts +1 -0
- package/src/web/auth.ts +6 -0
- package/src/web/client/auth.ts +6 -11
- package/src/web/font/index.ts +1 -3
- package/src/web/hooks.ts +4 -0
- package/src/web/i18n.ts +11 -0
- package/src/web/index.ts +0 -2
- package/src/web/router.ts +5 -0
- package/src/web/routes/auth/_layout.tsx +17 -15
- package/src/web/routes/auth/email-otp.tsx +2 -2
- package/src/web/routes/auth/forgot-password.tsx +1 -1
- package/src/web/routes/auth/login.tsx +3 -2
- package/src/web/routes/auth/phone-otp.tsx +2 -2
- package/src/web/routes/auth/reset-password.tsx +3 -7
- package/src/web/routes/auth/signup.tsx +2 -2
- package/src/web/routes/auth/utils.ts +21 -10
- package/src/web/routes/auth/verify-email.tsx +2 -2
- package/src/web/routes.ts +4 -9
- package/src/web/ui/alert-dialog.stories.tsx +2 -2
- package/src/web/ui/auth/auth-layout.stories.tsx +81 -72
- package/src/web/ui/auth/auth-layout.tsx +70 -138
- package/src/web/ui/auth/brand-content.stories.tsx +272 -0
- package/src/web/ui/auth/brand-content.tsx +431 -0
- package/src/web/ui/auth/context.tsx +2 -2
- package/src/web/ui/auth/hooks.ts +1 -1
- package/src/web/ui/auth/index.ts +24 -1
- package/src/web/ui/auth.ts +4 -0
- package/src/web/ui/checkbox.stories.tsx +2 -1
- package/src/web/ui/collapsible.stories.tsx +2 -2
- package/src/web/ui/command.stories.tsx +1 -1
- package/src/web/ui/context-menu.stories.tsx +1 -1
- package/src/web/ui/dialog.stories.tsx +4 -4
- package/src/web/ui/drawer.stories.tsx +4 -4
- package/src/web/ui/dropdown-menu.stories.tsx +2 -2
- package/src/web/ui/empty.stories.tsx +2 -2
- package/src/web/ui/error-page.stories.tsx +1 -1
- package/src/web/ui/error-page.tsx +1 -1
- package/src/web/ui/field.stories.tsx +5 -6
- package/src/web/ui/hover-card.stories.tsx +3 -5
- package/src/web/ui/input-group.stories.tsx +2 -2
- package/src/web/ui/input-otp.stories.tsx +1 -1
- package/src/web/ui/input.stories.tsx +2 -1
- package/src/web/ui/item.stories.tsx +3 -3
- package/src/web/ui/kbd.stories.tsx +1 -1
- package/src/web/ui/label.stories.tsx +4 -1
- package/src/web/ui/menubar.stories.tsx +1 -1
- package/src/web/ui/navigation-menu.stories.tsx +1 -1
- package/src/web/ui/navigation-menu.tsx +3 -3
- package/src/web/ui/pagination.stories.tsx +1 -1
- package/src/web/ui/popover.stories.tsx +4 -4
- package/src/web/ui/progress.stories.tsx +1 -1
- package/src/web/ui/radio-group.stories.tsx +3 -4
- package/src/web/ui/resizable.stories.tsx +1 -1
- package/src/web/ui/scroll-area.stories.tsx +2 -1
- package/src/web/ui/select.stories.tsx +1 -1
- package/src/web/ui/sheet.stories.tsx +4 -4
- package/src/web/ui/sidebar.stories.tsx +1 -1
- package/src/web/ui/skeleton.stories.tsx +1 -1
- package/src/web/ui/slider.stories.tsx +1 -1
- package/src/web/ui/sonner.stories.tsx +2 -1
- package/src/web/ui/spinner.stories.tsx +2 -1
- package/src/web/ui/switch.stories.tsx +2 -1
- package/src/web/ui/table.stories.tsx +3 -3
- package/src/web/ui/tabs.stories.tsx +5 -8
- package/src/web/ui/textarea.stories.tsx +3 -1
- package/src/web/ui/toggle.stories.tsx +1 -1
- package/src/web/ui/tooltip.stories.tsx +2 -2
- package/dist/exports/api/index.d.mts +0 -5
- package/dist/exports/api/orm-seed.d.mts +0 -1
- package/dist/exports/api/orm-seed.mjs +0 -3
- package/dist/exports/api/orm.d.mts +0 -3
- package/dist/exports/api/orm.mjs +0 -5
- package/dist/exports/api/workflows/index.d.mts +0 -74
- package/dist/exports/api/workflows/index.mjs +0 -4
- package/dist/exports/app-context-B1VJ9qnH.mjs +0 -3
- package/dist/exports/auth-BCOIpGDO.d.mts +0 -870
- package/dist/exports/index-Di4PdhuL.d.mts +0 -7174
- package/dist/exports/instrumentation.d.mts +0 -2
- package/dist/exports/instrumentation.mjs +0 -5
- package/dist/exports/mock-DLfalkIV.mjs +0 -9
- package/dist/exports/orm-D-7F2n1J.d.mts +0 -10
- package/dist/exports/orm-DbH3_5aw.mjs +0 -36
- package/dist/exports/server-cD8Pckgj.mjs +0 -509
- package/dist/exports/ssr-BsfNjYlJ.mjs +0 -16
- package/dist/exports/tests/mock.mjs +0 -5
- package/dist/exports/tests/react.d.mts +0 -2
- package/dist/exports/tests/react.mjs +0 -5
- package/dist/exports/web/index.js +0 -8178
- package/dist/exports/web/ssr.d.mts +0 -20
- package/dist/exports/web/ssr.mjs +0 -3
- /package/dist/{exports/app-context-LF4QmPUC.mjs → app-context-CaxDuPj-.mjs} +0 -0
- /package/dist/{exports/chunk-DCbLExaX.mjs → chunk-BkPCcwIn.mjs} +0 -0
- /package/dist/{exports/tests/mock.d.mts → devtools/test-mock.d.mts} +0 -0
- /package/dist/{exports/tests/setup.d.mts → devtools/test-setup.d.mts} +0 -0
- /package/dist/{exports/instrumentation-CFIspF8-.d.mts → instrumentation-B8fU6rcD.d.mts} +0 -0
- /package/dist/{exports/vendors → universal}/date.d.ts +0 -0
- /package/dist/{exports/vendors → universal}/date.js +0 -0
- /package/dist/{exports/vendors → universal}/toolkit.d.ts +0 -0
- /package/dist/{exports/vendors → universal}/toolkit.js +0 -0
- /package/dist/{exports/vendors → universal}/zod.d.ts +0 -0
- /package/dist/{exports/vendors → universal}/zod.js +0 -0
- /package/dist/{exports/vite-compat-CICObU9F.mjs → vite-compat-gu8Mi4cu.mjs} +0 -0
- /package/dist/{exports/youch-handler-CHwX0Fou.mjs → youch-handler-DeoaVZPR.mjs} +0 -0
- /package/src/{storybook → devtools/storybook}/.storybook/manager.ts +0 -0
- /package/src/{storybook → devtools/storybook}/components/ColorGrid.tsx +0 -0
- /package/src/{storybook → devtools/storybook}/components/IconGallery.tsx +0 -0
- /package/src/{storybook → devtools/storybook}/components/SpacingScale.tsx +0 -0
- /package/src/{storybook → devtools/storybook}/components/TypographyScale.tsx +0 -0
- /package/src/{storybook → devtools/storybook}/components/index.ts +0 -0
- /package/src/{storybook → devtools/storybook}/docs/foundations/Colors.mdx +0 -0
- /package/src/{storybook → devtools/storybook}/docs/foundations/Icons.mdx +0 -0
- /package/src/{storybook → devtools/storybook}/docs/foundations/Spacing.mdx +0 -0
- /package/src/{storybook → devtools/storybook}/docs/foundations/Typography.mdx +0 -0
- /package/src/{storybook → devtools/storybook}/index.ts +0 -0
- /package/src/{storybook → devtools/storybook}/shims/void-elements.js +0 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { t as cn } from "./utils-4n921m5r.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
|
|
5
|
+
//#region src/web/ui/alert.tsx
|
|
6
|
+
/** Alert variant styles for different semantic meanings. */
|
|
7
|
+
const alertVariants = cva("grid gap-0.5 rounded-lg border px-4 py-3 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4 w-full relative group/alert", {
|
|
8
|
+
variants: { variant: {
|
|
9
|
+
default: "bg-card text-card-foreground border-border",
|
|
10
|
+
info: "bg-blue-50 dark:bg-blue-950/20 text-blue-900 dark:text-blue-100 border-blue-200 dark:border-blue-800 *:data-[slot=alert-description]:text-blue-800 dark:*:data-[slot=alert-description]:text-blue-200 *:[svg]:text-blue-600 dark:*:[svg]:text-blue-400",
|
|
11
|
+
success: "bg-green-50 dark:bg-green-950/20 text-green-900 dark:text-green-100 border-green-200 dark:border-green-800 *:data-[slot=alert-description]:text-green-800 dark:*:data-[slot=alert-description]:text-green-200 *:[svg]:text-green-600 dark:*:[svg]:text-green-400",
|
|
12
|
+
warning: "bg-amber-50 dark:bg-amber-950/20 text-amber-900 dark:text-amber-100 border-amber-200 dark:border-amber-800 *:data-[slot=alert-description]:text-amber-800 dark:*:data-[slot=alert-description]:text-amber-200 *:[svg]:text-amber-600 dark:*:[svg]:text-amber-400",
|
|
13
|
+
destructive: "bg-destructive/10 text-destructive border-destructive/50 *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current"
|
|
14
|
+
} },
|
|
15
|
+
defaultVariants: { variant: "default" }
|
|
16
|
+
});
|
|
17
|
+
/**
|
|
18
|
+
* A contextual feedback message for user actions or system status.
|
|
19
|
+
*
|
|
20
|
+
* Supports semantic variants (info, success, warning, destructive) with
|
|
21
|
+
* appropriate color coding. Use with AlertTitle and AlertDescription for
|
|
22
|
+
* structured content, and AlertAction for dismissal or action buttons.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* <Alert variant="info">
|
|
27
|
+
* <InfoIcon />
|
|
28
|
+
* <AlertTitle>Heads up!</AlertTitle>
|
|
29
|
+
* <AlertDescription>This is an informational alert.</AlertDescription>
|
|
30
|
+
* </Alert>
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
function Alert({ className, variant, ...props }) {
|
|
34
|
+
return /* @__PURE__ */ jsx("div", {
|
|
35
|
+
"data-slot": "alert",
|
|
36
|
+
role: "alert",
|
|
37
|
+
className: cn(alertVariants({ variant }), className),
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The title heading for an Alert component.
|
|
43
|
+
*
|
|
44
|
+
* Displays prominently with medium font weight. Automatically positioned
|
|
45
|
+
* after any icon in the alert.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```tsx
|
|
49
|
+
* <AlertTitle>Success!</AlertTitle>
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
function AlertTitle({ className, ...props }) {
|
|
53
|
+
return /* @__PURE__ */ jsx("div", {
|
|
54
|
+
"data-slot": "alert-title",
|
|
55
|
+
className: cn("font-medium group-has-[>svg]/alert:col-start-2 [&_a]:hover:text-foreground [&_a]:underline [&_a]:underline-offset-3", className),
|
|
56
|
+
...props
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The descriptive text content for an Alert component.
|
|
61
|
+
*
|
|
62
|
+
* Displays in muted foreground color with proper text wrapping. Supports
|
|
63
|
+
* multiple paragraphs with automatic spacing.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```tsx
|
|
67
|
+
* <AlertDescription>
|
|
68
|
+
* Your changes have been saved successfully.
|
|
69
|
+
* </AlertDescription>
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
function AlertDescription({ className, ...props }) {
|
|
73
|
+
return /* @__PURE__ */ jsx("div", {
|
|
74
|
+
"data-slot": "alert-description",
|
|
75
|
+
className: cn("text-muted-foreground text-sm text-balance md:text-pretty [&_p:not(:last-child)]:mb-4 [&_a]:hover:text-foreground [&_a]:underline [&_a]:underline-offset-3", className),
|
|
76
|
+
...props
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* An action slot positioned in the top-right corner of an Alert.
|
|
81
|
+
*
|
|
82
|
+
* Use for dismiss buttons or quick actions. Absolutely positioned to not
|
|
83
|
+
* interfere with the alert content flow.
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```tsx
|
|
87
|
+
* <AlertAction>
|
|
88
|
+
* <Button variant="ghost" size="icon-sm" aria-label="Dismiss">
|
|
89
|
+
* <XIcon />
|
|
90
|
+
* </Button>
|
|
91
|
+
* </AlertAction>
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
function AlertAction({ className, ...props }) {
|
|
95
|
+
return /* @__PURE__ */ jsx("div", {
|
|
96
|
+
"data-slot": "alert-action",
|
|
97
|
+
className: cn("absolute top-2.5 right-3", className),
|
|
98
|
+
...props
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
//#endregion
|
|
103
|
+
export { AlertTitle as i, AlertAction as n, AlertDescription as r, Alert as t };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { t as cn } from "./utils-4n921m5r.js";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/web/ui/animated-check.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Animated checkmark with draw-in animation (Apple-style).
|
|
7
|
+
* Uses inline keyframes for self-contained animation without Tailwind config.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* // Success state in auth forms
|
|
12
|
+
* <AnimatedCheck size="lg" color="green" />
|
|
13
|
+
*
|
|
14
|
+
* // Primary color variant
|
|
15
|
+
* <AnimatedCheck size="default" color="primary" />
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
function AnimatedCheck({ className, size = "default", color = "green" }) {
|
|
19
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("style", { children: `
|
|
20
|
+
@keyframes ac-scale-in {
|
|
21
|
+
from { transform: scale(0); opacity: 0; }
|
|
22
|
+
to { transform: scale(1); opacity: 1; }
|
|
23
|
+
}
|
|
24
|
+
@keyframes ac-draw-check {
|
|
25
|
+
to { stroke-dashoffset: 0; }
|
|
26
|
+
}
|
|
27
|
+
` }), /* @__PURE__ */ jsxs("svg", {
|
|
28
|
+
className: cn({
|
|
29
|
+
xs: "size-6",
|
|
30
|
+
sm: "size-8",
|
|
31
|
+
default: "size-12",
|
|
32
|
+
lg: "size-16",
|
|
33
|
+
xl: "size-20"
|
|
34
|
+
}[size], {
|
|
35
|
+
green: "text-green-600 dark:text-green-400",
|
|
36
|
+
primary: "text-primary"
|
|
37
|
+
}[color], className),
|
|
38
|
+
viewBox: "0 0 52 52",
|
|
39
|
+
fill: "none",
|
|
40
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
41
|
+
role: "img",
|
|
42
|
+
"aria-label": "Success",
|
|
43
|
+
children: [/* @__PURE__ */ jsx("circle", {
|
|
44
|
+
cx: "26",
|
|
45
|
+
cy: "26",
|
|
46
|
+
r: "25",
|
|
47
|
+
fill: "currentColor",
|
|
48
|
+
fillOpacity: "0.1",
|
|
49
|
+
style: {
|
|
50
|
+
transformOrigin: "center",
|
|
51
|
+
animation: "ac-scale-in 0.3s ease-out forwards"
|
|
52
|
+
}
|
|
53
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
54
|
+
d: "M14 27l8 8 16-16",
|
|
55
|
+
stroke: "currentColor",
|
|
56
|
+
strokeWidth: "3",
|
|
57
|
+
strokeLinecap: "round",
|
|
58
|
+
strokeLinejoin: "round",
|
|
59
|
+
fill: "none",
|
|
60
|
+
strokeDasharray: "40",
|
|
61
|
+
strokeDashoffset: "40",
|
|
62
|
+
style: { animation: "ac-draw-check 0.3s ease-out 0.2s forwards" }
|
|
63
|
+
})]
|
|
64
|
+
})] });
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
//#endregion
|
|
68
|
+
export { AnimatedCheck as t };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import "../logger-BJ2PCtBR.mjs";
|
|
2
|
+
import "../database-ltnXGvKZ.mjs";
|
|
3
|
+
import { a as AuthCaptchaConfig, c as AuthSessionConfig, d as defineAuth, f as defineEndpointRateLimits, i as Auth, l as DefineAuthOptions, n as AccessController, o as AuthConfig, p as defineAuthSchema, r as AuditAction, s as AuthPasskeyConfig, t as AccessControlRoles, u as auditActionSchema } from "../auth-BzQ2oAZ8.mjs";
|
|
4
|
+
export { AccessControlRoles, AccessController, AuditAction, Auth, AuthCaptchaConfig, AuthConfig, AuthPasskeyConfig, AuthSessionConfig, DefineAuthOptions, auditActionSchema, defineAuth, defineAuthSchema, defineEndpointRateLimits };
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import { n as AUTH_BASE_URL, t as AUTH_BASE_PATH } from "../auth-BBivVOI9.mjs";
|
|
2
|
+
import { t as defineAuthSchema } from "../auth-schema-OUnjUQlj.mjs";
|
|
3
|
+
import { passkey } from "@better-auth/passkey";
|
|
4
|
+
import { sso } from "@better-auth/sso";
|
|
5
|
+
import { betterAuth } from "better-auth";
|
|
6
|
+
import { drizzleAdapter } from "better-auth/adapters/drizzle";
|
|
7
|
+
import { admin, anonymous, apiKey, captcha, emailOTP, lastLoginMethod, magicLink, multiSession, phoneNumber, twoFactor, username } from "better-auth/plugins";
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
|
|
10
|
+
//#region src/api/auth.ts
|
|
11
|
+
/**
|
|
12
|
+
* Standard audit log actions following OCSF/CADF standards. Zod enum provides
|
|
13
|
+
* both runtime validation and TypeScript type.
|
|
14
|
+
*
|
|
15
|
+
* Actions:
|
|
16
|
+
* - Data ops: INSERT, UPDATE, DELETE, TRUNCATE, SELECT
|
|
17
|
+
* - Auth ops: LOGIN, LOGOUT, LOGIN_FAILED, PASSWORD_CHANGE
|
|
18
|
+
* - Custom: CUSTOM (use customAction field for app-specific events)
|
|
19
|
+
*/
|
|
20
|
+
const auditActionSchema = z.enum([
|
|
21
|
+
"DELETE",
|
|
22
|
+
"LOGIN",
|
|
23
|
+
"LOGOUT",
|
|
24
|
+
"INSERT",
|
|
25
|
+
"PASSWORD_CHANGE",
|
|
26
|
+
"TRUNCATE",
|
|
27
|
+
"UPDATE"
|
|
28
|
+
]);
|
|
29
|
+
/**
|
|
30
|
+
* Default rate limits for endpoints that trigger costly 3rd party services.
|
|
31
|
+
* 3 requests per 60 seconds to prevent excessive email/SMS costs.
|
|
32
|
+
*/
|
|
33
|
+
const DEFAULT_COSTLY_RATE_LIMITS = {
|
|
34
|
+
"/send-verification-email": {
|
|
35
|
+
window: 60,
|
|
36
|
+
max: 3
|
|
37
|
+
},
|
|
38
|
+
"/request-password-reset": {
|
|
39
|
+
window: 60,
|
|
40
|
+
max: 3
|
|
41
|
+
},
|
|
42
|
+
"/sign-in/magic-link": {
|
|
43
|
+
window: 60,
|
|
44
|
+
max: 3
|
|
45
|
+
},
|
|
46
|
+
"/email-otp/send-verification-otp": {
|
|
47
|
+
window: 60,
|
|
48
|
+
max: 3
|
|
49
|
+
},
|
|
50
|
+
"/two-factor/send-otp": {
|
|
51
|
+
window: 60,
|
|
52
|
+
max: 3
|
|
53
|
+
},
|
|
54
|
+
"/phone-number/send-otp": {
|
|
55
|
+
window: 60,
|
|
56
|
+
max: 3
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Creates endpoint-specific rate limit rules by merging user overrides with defaults.
|
|
61
|
+
* User overrides take precedence over defaults.
|
|
62
|
+
*
|
|
63
|
+
* @param overrides - Custom rate limits to override defaults (type-safe for default endpoints).
|
|
64
|
+
* @returns Merged rate limit rules.
|
|
65
|
+
*
|
|
66
|
+
* @see https://www.better-auth.com/docs/concepts/rate-limit
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```typescript
|
|
70
|
+
* // Use defaults
|
|
71
|
+
* defineEndpointRateLimits()
|
|
72
|
+
*
|
|
73
|
+
* // Override specific endpoint (type-safe)
|
|
74
|
+
* defineEndpointRateLimits({
|
|
75
|
+
* "/send-verification-email": { window: 120, max: 5 },
|
|
76
|
+
* })
|
|
77
|
+
*
|
|
78
|
+
* // Add custom endpoint
|
|
79
|
+
* defineEndpointRateLimits({
|
|
80
|
+
* "/custom-endpoint": { window: 30, max: 10 },
|
|
81
|
+
* })
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
function defineEndpointRateLimits(overrides) {
|
|
85
|
+
if (!overrides) return { ...DEFAULT_COSTLY_RATE_LIMITS };
|
|
86
|
+
return {
|
|
87
|
+
...DEFAULT_COSTLY_RATE_LIMITS,
|
|
88
|
+
...overrides
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Defines Better Auth instance from neutral config + server dependencies.
|
|
93
|
+
*/
|
|
94
|
+
function defineAuth(opts) {
|
|
95
|
+
const { auditLog, config, appName, database, errorURL, hooks, oauth, passkey: passkeyConfig, secret, session } = opts;
|
|
96
|
+
const plugins = [];
|
|
97
|
+
if (config.plugins?.admin) plugins.push(admin({
|
|
98
|
+
defaultRole: config.plugins.admin.defaultRole,
|
|
99
|
+
adminRoles: config.plugins.admin.adminRoles
|
|
100
|
+
}));
|
|
101
|
+
if (config.plugins?.apiKey) plugins.push(apiKey({
|
|
102
|
+
defaultPrefix: config.plugins.apiKey.defaultPrefix,
|
|
103
|
+
defaultKeyLength: config.plugins.apiKey.defaultKeyLength,
|
|
104
|
+
rateLimit: config.plugins.apiKey.rateLimit ? {
|
|
105
|
+
enabled: true,
|
|
106
|
+
maxRequests: config.plugins.apiKey.rateLimit.maxRequests,
|
|
107
|
+
timeWindow: config.plugins.apiKey.rateLimit.timeWindow
|
|
108
|
+
} : void 0
|
|
109
|
+
}));
|
|
110
|
+
if (config.plugins?.twoFactor) plugins.push(twoFactor({
|
|
111
|
+
issuer: config.plugins.twoFactor.issuer ?? appName,
|
|
112
|
+
totpOptions: config.plugins.twoFactor.totp ? {
|
|
113
|
+
digits: config.plugins.twoFactor.totp.digits,
|
|
114
|
+
period: config.plugins.twoFactor.totp.period
|
|
115
|
+
} : void 0,
|
|
116
|
+
backupCodeOptions: config.plugins.twoFactor.backupCodes ? {
|
|
117
|
+
amount: config.plugins.twoFactor.backupCodes.amount,
|
|
118
|
+
length: config.plugins.twoFactor.backupCodes.length
|
|
119
|
+
} : void 0,
|
|
120
|
+
otpOptions: config.plugins.twoFactor.otp && hooks.send2FAOTP ? { sendOTP: async ({ user, otp }) => hooks.send2FAOTP({
|
|
121
|
+
email: user.email,
|
|
122
|
+
otp
|
|
123
|
+
}) } : void 0
|
|
124
|
+
}));
|
|
125
|
+
if (config.methods?.passkey && passkeyConfig) plugins.push(passkey({
|
|
126
|
+
rpName: appName,
|
|
127
|
+
rpID: passkeyConfig.rpID,
|
|
128
|
+
origin: passkeyConfig.origin
|
|
129
|
+
}));
|
|
130
|
+
if (config.methods?.magicLink && hooks.sendMagicLink) plugins.push(magicLink({
|
|
131
|
+
expiresIn: config.methods.magicLink.expiresIn,
|
|
132
|
+
sendMagicLink: async ({ email, url, token }) => {
|
|
133
|
+
await hooks.sendMagicLink({
|
|
134
|
+
email,
|
|
135
|
+
url,
|
|
136
|
+
token
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}));
|
|
140
|
+
if (config.methods?.phoneOtp && hooks.sendPhoneOTP) plugins.push(phoneNumber({
|
|
141
|
+
otpLength: config.methods.phoneOtp.otpLength,
|
|
142
|
+
expiresIn: config.methods.phoneOtp.expiresIn,
|
|
143
|
+
sendOTP: async ({ phoneNumber: phone, code }) => {
|
|
144
|
+
await hooks.sendPhoneOTP({
|
|
145
|
+
phoneNumber: phone,
|
|
146
|
+
otp: code
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}));
|
|
150
|
+
if (config.methods?.emailOtp && hooks.sendEmailOTP) plugins.push(emailOTP({
|
|
151
|
+
otpLength: config.methods.emailOtp.otpLength,
|
|
152
|
+
expiresIn: config.methods.emailOtp.expiresIn,
|
|
153
|
+
sendVerificationOTP: async ({ email, otp }) => {
|
|
154
|
+
await hooks.sendEmailOTP({
|
|
155
|
+
email,
|
|
156
|
+
otp
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
}));
|
|
160
|
+
if (config.plugins?.username) plugins.push(username({
|
|
161
|
+
minUsernameLength: config.plugins.username.minUsernameLength,
|
|
162
|
+
maxUsernameLength: config.plugins.username.maxUsernameLength
|
|
163
|
+
}));
|
|
164
|
+
if (config.plugins?.anonymous) plugins.push(anonymous({ emailDomainName: config.plugins.anonymous.emailDomainName }));
|
|
165
|
+
if (config.plugins?.multiSession) plugins.push(multiSession({ maximumSessions: config.plugins.multiSession.maximumSessions }));
|
|
166
|
+
if (config.plugins?.sso) plugins.push(sso({
|
|
167
|
+
providersLimit: config.plugins.sso.providersLimit,
|
|
168
|
+
trustEmailVerified: config.plugins.sso.trustEmailVerified,
|
|
169
|
+
domainVerification: config.plugins.sso.domainVerification ? { enabled: true } : void 0
|
|
170
|
+
}));
|
|
171
|
+
if (config.plugins?.lastUsedMethod) plugins.push(lastLoginMethod({ storeInDatabase: config.plugins.lastUsedMethod.storeInDatabase }));
|
|
172
|
+
if (config.plugins?.captcha) {
|
|
173
|
+
const captchaConfig = opts.captcha;
|
|
174
|
+
plugins.push(captcha({
|
|
175
|
+
provider: config.plugins.captcha.provider,
|
|
176
|
+
secretKey: captchaConfig?.secretKey ?? "",
|
|
177
|
+
endpoints: config.plugins.captcha.endpoints,
|
|
178
|
+
minScore: captchaConfig?.minScore
|
|
179
|
+
}));
|
|
180
|
+
}
|
|
181
|
+
const socialProviders = {};
|
|
182
|
+
if (config.methods?.oauth?.google) socialProviders.google = {
|
|
183
|
+
clientId: oauth?.google?.clientId ?? process.env.GOOGLE_CLIENT_ID ?? "",
|
|
184
|
+
clientSecret: oauth?.google?.clientSecret ?? process.env.GOOGLE_CLIENT_SECRET ?? ""
|
|
185
|
+
};
|
|
186
|
+
if (config.methods?.oauth?.github) socialProviders.github = {
|
|
187
|
+
clientId: oauth?.github?.clientId ?? process.env.GITHUB_CLIENT_ID ?? "",
|
|
188
|
+
clientSecret: oauth?.github?.clientSecret ?? process.env.GITHUB_CLIENT_SECRET ?? ""
|
|
189
|
+
};
|
|
190
|
+
if (config.methods?.oauth?.apple) socialProviders.apple = {
|
|
191
|
+
clientId: oauth?.apple?.clientId ?? process.env.APPLE_CLIENT_ID ?? "",
|
|
192
|
+
clientSecret: oauth?.apple?.clientSecret ?? process.env.APPLE_CLIENT_SECRET ?? ""
|
|
193
|
+
};
|
|
194
|
+
if (config.methods?.oauth?.facebook) socialProviders.facebook = {
|
|
195
|
+
clientId: oauth?.facebook?.clientId ?? process.env.FACEBOOK_CLIENT_ID ?? "",
|
|
196
|
+
clientSecret: oauth?.facebook?.clientSecret ?? process.env.FACEBOOK_CLIENT_SECRET ?? ""
|
|
197
|
+
};
|
|
198
|
+
const basePath = config.basePath ?? AUTH_BASE_PATH;
|
|
199
|
+
const baseURL = config.baseURL ?? AUTH_BASE_URL;
|
|
200
|
+
const auth = betterAuth({
|
|
201
|
+
onAPIError: { errorURL: errorURL ?? "/login" },
|
|
202
|
+
account: { accountLinking: {
|
|
203
|
+
enabled: true,
|
|
204
|
+
trustedProviders: ["email-password", "google"]
|
|
205
|
+
} },
|
|
206
|
+
advanced: {
|
|
207
|
+
cookiePrefix: appName.replace(/\s+/g, "_").toLowerCase(),
|
|
208
|
+
database: { generateId: false },
|
|
209
|
+
ipAddress: {
|
|
210
|
+
disableIpTracking: false,
|
|
211
|
+
ipAddressHeaders: [
|
|
212
|
+
"cf-connecting-ip",
|
|
213
|
+
"x-client-ip",
|
|
214
|
+
"x-forwarded-for",
|
|
215
|
+
"x-real-ip"
|
|
216
|
+
]
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
appName,
|
|
220
|
+
baseURL: baseURL || void 0,
|
|
221
|
+
basePath,
|
|
222
|
+
database: drizzleAdapter(database, {
|
|
223
|
+
provider: "pg",
|
|
224
|
+
usePlural: true
|
|
225
|
+
}),
|
|
226
|
+
emailAndPassword: config.methods?.emailPassword ? {
|
|
227
|
+
enabled: true,
|
|
228
|
+
requireEmailVerification: config.methods.emailPassword.requireEmailVerification,
|
|
229
|
+
minPasswordLength: config.methods.emailPassword.minPasswordLength,
|
|
230
|
+
maxPasswordLength: config.methods.emailPassword.maxPasswordLength,
|
|
231
|
+
sendVerificationEmail: hooks.sendVerificationEmail ? async ({ user, url, token }) => hooks.sendVerificationEmail({
|
|
232
|
+
email: user.email,
|
|
233
|
+
url,
|
|
234
|
+
token
|
|
235
|
+
}) : void 0,
|
|
236
|
+
sendResetPassword: hooks.sendResetPasswordEmail ? async ({ user, url, token }) => hooks.sendResetPasswordEmail({
|
|
237
|
+
email: user.email,
|
|
238
|
+
url,
|
|
239
|
+
token
|
|
240
|
+
}) : void 0
|
|
241
|
+
} : { enabled: false },
|
|
242
|
+
emailVerification: hooks.sendVerificationEmail ? {
|
|
243
|
+
sendVerificationEmail: async ({ user, url, token }) => hooks.sendVerificationEmail({
|
|
244
|
+
email: user.email,
|
|
245
|
+
url,
|
|
246
|
+
token
|
|
247
|
+
}),
|
|
248
|
+
sendOnSignUp: config.methods?.emailPassword?.requireEmailVerification ?? false
|
|
249
|
+
} : void 0,
|
|
250
|
+
plugins,
|
|
251
|
+
secret,
|
|
252
|
+
session: session ? {
|
|
253
|
+
expiresIn: session.expiresIn,
|
|
254
|
+
updateAge: session.updateAge,
|
|
255
|
+
freshAge: session.freshAge
|
|
256
|
+
} : void 0,
|
|
257
|
+
socialProviders: Object.keys(socialProviders).length > 0 ? socialProviders : void 0,
|
|
258
|
+
rateLimit: config.rateLimit === false ? { enabled: false } : {
|
|
259
|
+
enabled: config.rateLimit?.enabled ?? true,
|
|
260
|
+
window: config.rateLimit?.window ?? 60,
|
|
261
|
+
max: config.rateLimit?.max ?? 100,
|
|
262
|
+
storage: "database",
|
|
263
|
+
customRules: defineEndpointRateLimits(config.rateLimit?.customRules)
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
const excludeTablesSet = new Set(auditLog?.excludeTables ?? []);
|
|
267
|
+
return Object.assign(auth, {
|
|
268
|
+
auditLog,
|
|
269
|
+
shouldAudit(tableName) {
|
|
270
|
+
return !excludeTablesSet.has(tableName);
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
//#endregion
|
|
276
|
+
export { auditActionSchema, defineAuth, defineAuthSchema, defineEndpointRateLimits };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import "../logger-BJ2PCtBR.mjs";
|
|
2
|
+
import { a as RedisClient, i as DefineRedisClientOptions, n as DefineCacheOptions, o as defineRedisClient, r as defineCache, t as Cache } from "../cache-B-TvutDL.mjs";
|
|
3
|
+
export { Cache, DefineCacheOptions, DefineRedisClientOptions, RedisClient, defineCache, defineRedisClient };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { t as defineRedisClient } from "../redis-a5sw5J3L.mjs";
|
|
2
|
+
import { createKeyv } from "@keyv/redis";
|
|
3
|
+
|
|
4
|
+
//#region src/api/cache.ts
|
|
5
|
+
/**
|
|
6
|
+
* Define the cache instance using shared Redis client.
|
|
7
|
+
* Connection is lazy - only connects when first cache operation is performed.
|
|
8
|
+
*
|
|
9
|
+
* Algorithm:
|
|
10
|
+
* 1. Create Redis client using defineRedisClient() (lazy connection)
|
|
11
|
+
* 2. Pass client to createKeyv() - connection happens on first use
|
|
12
|
+
*
|
|
13
|
+
* @param opts - The options for defining the cache.
|
|
14
|
+
* @returns The cache instance.
|
|
15
|
+
*/
|
|
16
|
+
function defineCache({ url, logger, options }) {
|
|
17
|
+
const cache = createKeyv(defineRedisClient({
|
|
18
|
+
logger,
|
|
19
|
+
url
|
|
20
|
+
}), options);
|
|
21
|
+
cache.on("error", (err) => {
|
|
22
|
+
logger.error({ err }, "Cache Keyv error");
|
|
23
|
+
});
|
|
24
|
+
return cache;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
export { defineCache, defineRedisClient };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import
|
|
3
|
-
import "../
|
|
4
|
-
import "../
|
|
1
|
+
import "../logger-BJ2PCtBR.mjs";
|
|
2
|
+
import "../database-ltnXGvKZ.mjs";
|
|
3
|
+
import "../auth-BzQ2oAZ8.mjs";
|
|
4
|
+
import "../cache-B-TvutDL.mjs";
|
|
5
|
+
import { n as Container } from "../container-C00pnItg.mjs";
|
|
5
6
|
import { z } from "zod";
|
|
6
7
|
import { ChildProcess } from "node:child_process";
|
|
7
8
|
import * as p from "@clack/prompts";
|
|
8
9
|
|
|
9
|
-
//#region src/cli/context.d.ts
|
|
10
|
+
//#region src/api/cli/context.d.ts
|
|
10
11
|
/**
|
|
11
12
|
* Command context providing beautiful output, prompts, and utilities.
|
|
12
13
|
* Uses @clack/prompts for consistent, professional CLI formatting.
|
|
@@ -182,7 +183,7 @@ interface CommandContext<C extends Container = Container, A = readonly unknown[]
|
|
|
182
183
|
warn(message: string): void;
|
|
183
184
|
}
|
|
184
185
|
//#endregion
|
|
185
|
-
//#region src/cli/command.d.ts
|
|
186
|
+
//#region src/api/cli/command.d.ts
|
|
186
187
|
/**
|
|
187
188
|
* The command interface.
|
|
188
189
|
*/
|
|
@@ -232,7 +233,7 @@ declare function defineCommand<C extends Container = Container, ASchema extends
|
|
|
232
233
|
run: (ctx: CommandContext<C, ASchema extends z.ZodSchema<infer A> ? A : readonly unknown[], OSchema extends z.ZodSchema<infer O> ? O : Record<string, unknown>>) => Promise<void>;
|
|
233
234
|
}): Command<C, ASchema extends z.ZodSchema<infer A> ? A : readonly unknown[], OSchema extends z.ZodSchema<infer O> ? O : Record<string, unknown>>;
|
|
234
235
|
//#endregion
|
|
235
|
-
//#region src/cli/index.d.ts
|
|
236
|
+
//#region src/api/cli/index.d.ts
|
|
236
237
|
/**
|
|
237
238
|
* Bootstraps the application.
|
|
238
239
|
*
|