opacacms 0.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/bun.lock +34 -0
- package/dist/admin/api-client.d.ts +8 -0
- package/dist/admin/auth-client.d.ts +940 -0
- package/dist/admin/custom-field.d.ts +71 -0
- package/dist/admin/index.d.ts +11 -0
- package/dist/admin/react.d.ts +3 -0
- package/dist/admin/router.d.ts +7 -0
- package/dist/admin/stores/admin-queries.d.ts +32 -0
- package/dist/admin/stores/auth.d.ts +33 -0
- package/dist/admin/stores/column-visibility.d.ts +21 -0
- package/dist/admin/stores/config.d.ts +7 -0
- package/dist/admin/stores/media.d.ts +44 -0
- package/dist/admin/stores/query.d.ts +4 -0
- package/dist/admin/stores/ui.d.ts +11 -0
- package/dist/admin/ui/admin-client.d.ts +7 -0
- package/dist/admin/ui/admin-layout.d.ts +14 -0
- package/dist/admin/ui/components/ColumnVisibilityToggle.d.ts +10 -0
- package/dist/admin/ui/components/DataDetailSheet.d.ts +13 -0
- package/dist/admin/ui/components/DataDetailView.d.ts +9 -0
- package/dist/admin/ui/components/Table.d.ts +10 -0
- package/dist/admin/ui/components/fields/ArrayField.d.ts +13 -0
- package/dist/admin/ui/components/fields/BlocksField.d.ts +17 -0
- package/dist/admin/ui/components/fields/BooleanField.d.ts +13 -0
- package/dist/admin/ui/components/fields/CollapsibleField.d.ts +16 -0
- package/dist/admin/ui/components/fields/DateField.d.ts +13 -0
- package/dist/admin/ui/components/fields/FileField.d.ts +23 -0
- package/dist/admin/ui/components/fields/GroupField.d.ts +13 -0
- package/dist/admin/ui/components/fields/JoinField.d.ts +15 -0
- package/dist/admin/ui/components/fields/NumberField.d.ts +14 -0
- package/dist/admin/ui/components/fields/RadioField.d.ts +17 -0
- package/dist/admin/ui/components/fields/RelationshipField.d.ts +16 -0
- package/dist/admin/ui/components/fields/RowField.d.ts +12 -0
- package/dist/admin/ui/components/fields/SelectField.d.ts +18 -0
- package/dist/admin/ui/components/fields/TabsField.d.ts +15 -0
- package/dist/admin/ui/components/fields/TextAreaField.d.ts +14 -0
- package/dist/admin/ui/components/fields/TextField.d.ts +14 -0
- package/dist/admin/ui/components/fields/VirtualField.d.ts +8 -0
- package/dist/admin/ui/components/fields/index.d.ts +28 -0
- package/dist/admin/ui/components/fields/richtext-editor/index.d.ts +10 -0
- package/dist/admin/ui/components/fields/richtext-editor/nodes/ImageComponent.d.ts +7 -0
- package/dist/admin/ui/components/fields/richtext-editor/nodes/ImageNode.d.ts +27 -0
- package/dist/admin/ui/components/fields/richtext-editor/plugins/ComponentPickerPlugin.d.ts +1 -0
- package/dist/admin/ui/components/fields/richtext-editor/plugins/EditableSyncPlugin.d.ts +5 -0
- package/dist/admin/ui/components/fields/richtext-editor/plugins/NotionToolbarPlugin.d.ts +1 -0
- package/dist/admin/ui/components/fields/richtext-editor/plugins/SimpleToolbarPlugin.d.ts +1 -0
- package/dist/admin/ui/components/fields/richtext-editor/plugins/ValueSyncPlugin.d.ts +5 -0
- package/dist/admin/ui/components/fields/utils.d.ts +1 -0
- package/dist/admin/ui/components/link.d.ts +8 -0
- package/dist/admin/ui/components/media/AssetManagerModal.d.ts +17 -0
- package/dist/admin/ui/components/toast.d.ts +10 -0
- package/dist/admin/ui/components/ui/accordion.d.ts +11 -0
- package/dist/admin/ui/components/ui/alert-dialog.d.ts +12 -0
- package/dist/admin/ui/components/ui/blocks.d.ts +5 -0
- package/dist/admin/ui/components/ui/breadcrumbs.d.ts +7 -0
- package/dist/admin/ui/components/ui/button.d.ts +7 -0
- package/dist/admin/ui/components/ui/collapsible.d.ts +16 -0
- package/dist/admin/ui/components/ui/dialog.d.ts +27 -0
- package/dist/admin/ui/components/ui/group.d.ts +6 -0
- package/dist/admin/ui/components/ui/index.d.ts +17 -0
- package/dist/admin/ui/components/ui/input.d.ts +5 -0
- package/dist/admin/ui/components/ui/join.d.ts +7 -0
- package/dist/admin/ui/components/ui/label.d.ts +3 -0
- package/dist/admin/ui/components/ui/radio-group.d.ts +13 -0
- package/dist/admin/ui/components/ui/relationship-detail-sheet.d.ts +9 -0
- package/dist/admin/ui/components/ui/relationship.d.ts +8 -0
- package/dist/admin/ui/components/ui/scroll-area.d.ts +7 -0
- package/dist/admin/ui/components/ui/select.d.ts +37 -0
- package/dist/admin/ui/components/ui/separator.d.ts +8 -0
- package/dist/admin/ui/components/ui/sheet.d.ts +28 -0
- package/dist/admin/ui/components/ui/tabs.d.ts +17 -0
- package/dist/admin/ui/components/ui/utils.d.ts +1 -0
- package/dist/admin/ui/hooks/use-debounce.d.ts +1 -0
- package/dist/admin/ui/views/collection-list-view.d.ts +5 -0
- package/dist/admin/ui/views/dashboard-view.d.ts +10 -0
- package/dist/admin/ui/views/document-edit-view.d.ts +7 -0
- package/dist/admin/ui/views/global-edit-view.d.ts +19 -0
- package/dist/admin/ui/views/init-view.d.ts +4 -0
- package/dist/admin/ui/views/login-view.d.ts +4 -0
- package/dist/admin/ui/views/media-registry-view.d.ts +7 -0
- package/dist/admin/ui/views/settings-view.d.ts +7 -0
- package/dist/admin/webcomponent.d.ts +1 -0
- package/dist/api.d.ts +6 -0
- package/dist/auth/index.d.ts +2107 -0
- package/dist/auth/migrations.d.ts +5 -0
- package/dist/auth/premissions.d.ts +6 -0
- package/dist/chunk-16vgcf3k.js +88 -0
- package/dist/chunk-2zm8cy1w.js +9482 -0
- package/dist/chunk-5gvbp2qa.js +167 -0
- package/dist/chunk-62ev8gnc.js +41 -0
- package/dist/chunk-6dhs73zq.js +126 -0
- package/dist/chunk-6ew02s0c.js +472 -0
- package/dist/chunk-7a9kn0np.js +116 -0
- package/dist/chunk-8gkhn1d4.js +309 -0
- package/dist/chunk-8sqjbsgt.js +42 -0
- package/dist/chunk-9kxpbcb1.js +85 -0
- package/dist/chunk-cvdd4eqh.js +110 -0
- package/dist/chunk-d3ffeqp9.js +87 -0
- package/dist/chunk-dy5t83hr.js +261 -0
- package/dist/chunk-f3nvxn63.js +17 -0
- package/dist/chunk-hmhcense.js +1352 -0
- package/dist/chunk-j4d50hrx.js +20 -0
- package/dist/chunk-jwjk85ze.js +15 -0
- package/dist/chunk-kwp83w8b.js +250 -0
- package/dist/chunk-s8mqwnm1.js +14 -0
- package/dist/chunk-srsac177.js +85 -0
- package/dist/chunk-v521d72w.js +10 -0
- package/dist/chunk-xa7rjsn2.js +20 -0
- package/dist/chunk-xg35h5a3.js +15 -0
- package/dist/chunk-ybbbqj63.js +130 -0
- package/dist/chunk-zvwb67nd.js +332 -0
- package/dist/cli/commands/generate-types.d.ts +1 -0
- package/dist/cli/commands/init.d.ts +1 -0
- package/dist/cli/commands/migrate-commands.d.ts +5 -0
- package/dist/cli/commands/seed-command.d.ts +2 -0
- package/dist/cli/d1-mock.d.ts +30 -0
- package/dist/cli/index.d.ts +5 -0
- package/dist/cli/index.test.d.ts +1 -0
- package/dist/cli/r2-mock.d.ts +46 -0
- package/dist/cli/seeding.d.ts +17 -0
- package/dist/client.d.ts +51 -0
- package/dist/config-utils.d.ts +6 -0
- package/dist/config.d.ts +10 -0
- package/dist/db/adapter.d.ts +34 -0
- package/dist/db/better-sqlite.d.ts +40 -0
- package/dist/db/bun-sqlite.d.ts +40 -0
- package/dist/db/d1.d.ts +42 -0
- package/dist/db/kysely/data-mapper.d.ts +6 -0
- package/dist/db/kysely/field-mapper.d.ts +22 -0
- package/dist/db/kysely/migration-generator.d.ts +9 -0
- package/dist/db/kysely/query-builder.d.ts +9 -0
- package/dist/db/kysely/schema-builder.d.ts +15 -0
- package/dist/db/kysely/sql-utils.d.ts +1 -0
- package/dist/db/postgres.d.ts +51 -0
- package/dist/db/sqlite.d.ts +41 -0
- package/dist/db/system-schema.d.ts +2 -0
- package/dist/index.d.ts +6 -0
- package/dist/runtimes/bun.d.ts +17 -0
- package/dist/runtimes/cloudflare-workers.d.ts +10 -0
- package/dist/runtimes/next.d.ts +16 -0
- package/dist/runtimes/node.d.ts +18 -0
- package/dist/schema/collection.d.ts +100 -0
- package/dist/schema/fields/base.d.ts +83 -0
- package/dist/schema/fields/index.d.ts +135 -0
- package/dist/schema/global.d.ts +82 -0
- package/dist/schema/index.d.ts +4 -0
- package/dist/schema/infer.d.ts +55 -0
- package/dist/server/admin-router.d.ts +9 -0
- package/dist/server/admin.d.ts +18 -0
- package/dist/server/assets.d.ts +47 -0
- package/dist/server/collection-router.d.ts +14 -0
- package/dist/server/handlers.d.ts +76 -0
- package/dist/server/middlewares/admin.d.ts +6 -0
- package/dist/server/middlewares/auth.d.ts +16 -0
- package/dist/server/middlewares/context.d.ts +9 -0
- package/dist/server/middlewares/cors.d.ts +3 -0
- package/dist/server/middlewares/database-init.d.ts +11 -0
- package/dist/server/middlewares/rate-limit.d.ts +3 -0
- package/dist/server/router.d.ts +7 -0
- package/dist/server/setup-middlewares.d.ts +17 -0
- package/dist/server/system-router.d.ts +9 -0
- package/dist/server.d.ts +6 -0
- package/dist/src/admin/index.css +47 -0
- package/dist/src/admin/index.js +176 -0
- package/dist/src/admin/webcomponent.js +19 -0
- package/dist/src/api.js +27 -0
- package/dist/src/cli/index.js +157 -0
- package/dist/src/client.js +9 -0
- package/dist/src/db/bun-sqlite.js +523 -0
- package/dist/src/db/d1.js +568 -0
- package/dist/src/db/postgres.js +520 -0
- package/dist/src/db/sqlite.js +534 -0
- package/dist/src/index.js +20 -0
- package/dist/src/runtimes/bun.js +36 -0
- package/dist/src/runtimes/cloudflare-workers.js +29 -0
- package/dist/src/runtimes/next.js +26 -0
- package/dist/src/runtimes/node.js +38 -0
- package/dist/src/server.js +27 -0
- package/dist/src/storage/index.js +355 -0
- package/dist/storage/adapters/cloudflare-r2.d.ts +6 -0
- package/dist/storage/adapters/local.d.ts +6 -0
- package/dist/storage/adapters/s3.d.ts +13 -0
- package/dist/storage/errors.d.ts +12 -0
- package/dist/storage/index.d.ts +5 -0
- package/dist/storage/types.d.ts +31 -0
- package/dist/types.d.ts +484 -0
- package/dist/utils/lexical.d.ts +5 -0
- package/dist/utils/logger.d.ts +35 -0
- package/dist/validation.d.ts +300 -0
- package/dist/validator.d.ts +9 -0
- package/global.d.ts +11 -0
- package/package.json +151 -0
- package/src/admin/api-client.ts +63 -0
- package/src/admin/auth-client.ts +40 -0
- package/src/admin/custom-field.ts +179 -0
- package/src/admin/index.ts +15 -0
- package/src/admin/react.tsx +72 -0
- package/src/admin/router.ts +9 -0
- package/src/admin/stores/admin-queries.ts +121 -0
- package/src/admin/stores/auth.ts +61 -0
- package/src/admin/stores/column-visibility.ts +67 -0
- package/src/admin/stores/config.ts +15 -0
- package/src/admin/stores/media.ts +95 -0
- package/src/admin/stores/query.ts +13 -0
- package/src/admin/stores/ui.ts +29 -0
- package/src/admin/ui/admin-client.tsx +283 -0
- package/src/admin/ui/admin-layout.tsx +276 -0
- package/src/admin/ui/components/ColumnVisibilityToggle.tsx +141 -0
- package/src/admin/ui/components/DataDetailSheet.tsx +141 -0
- package/src/admin/ui/components/DataDetailView.tsx +175 -0
- package/src/admin/ui/components/Table.tsx +67 -0
- package/src/admin/ui/components/fields/ArrayField.tsx +166 -0
- package/src/admin/ui/components/fields/BlocksField.tsx +202 -0
- package/src/admin/ui/components/fields/BooleanField.tsx +50 -0
- package/src/admin/ui/components/fields/CollapsibleField.tsx +75 -0
- package/src/admin/ui/components/fields/DateField.tsx +45 -0
- package/src/admin/ui/components/fields/FileField.tsx +322 -0
- package/src/admin/ui/components/fields/GroupField.tsx +50 -0
- package/src/admin/ui/components/fields/JoinField.tsx +23 -0
- package/src/admin/ui/components/fields/NumberField.tsx +46 -0
- package/src/admin/ui/components/fields/RadioField.tsx +62 -0
- package/src/admin/ui/components/fields/RelationshipField.tsx +278 -0
- package/src/admin/ui/components/fields/RowField.tsx +40 -0
- package/src/admin/ui/components/fields/SelectField.tsx +59 -0
- package/src/admin/ui/components/fields/TabsField.tsx +101 -0
- package/src/admin/ui/components/fields/TextAreaField.tsx +54 -0
- package/src/admin/ui/components/fields/TextField.tsx +49 -0
- package/src/admin/ui/components/fields/VirtualField.tsx +53 -0
- package/src/admin/ui/components/fields/index.tsx +371 -0
- package/src/admin/ui/components/fields/richtext-editor/index.tsx +211 -0
- package/src/admin/ui/components/fields/richtext-editor/nodes/ImageComponent.tsx +142 -0
- package/src/admin/ui/components/fields/richtext-editor/nodes/ImageNode.tsx +95 -0
- package/src/admin/ui/components/fields/richtext-editor/plugins/ComponentPickerPlugin.tsx +226 -0
- package/src/admin/ui/components/fields/richtext-editor/plugins/EditableSyncPlugin.tsx +16 -0
- package/src/admin/ui/components/fields/richtext-editor/plugins/NotionToolbarPlugin.tsx +184 -0
- package/src/admin/ui/components/fields/richtext-editor/plugins/SimpleToolbarPlugin.tsx +240 -0
- package/src/admin/ui/components/fields/richtext-editor/plugins/ValueSyncPlugin.tsx +40 -0
- package/src/admin/ui/components/fields/utils.ts +1 -0
- package/src/admin/ui/components/link.tsx +41 -0
- package/src/admin/ui/components/media/AssetManagerModal.tsx +334 -0
- package/src/admin/ui/components/toast.tsx +72 -0
- package/src/admin/ui/components/ui/accordion.tsx +51 -0
- package/src/admin/ui/components/ui/alert-dialog.tsx +98 -0
- package/src/admin/ui/components/ui/blocks.tsx +32 -0
- package/src/admin/ui/components/ui/breadcrumbs.tsx +59 -0
- package/src/admin/ui/components/ui/button.tsx +26 -0
- package/src/admin/ui/components/ui/collapsible.tsx +124 -0
- package/src/admin/ui/components/ui/dialog.tsx +79 -0
- package/src/admin/ui/components/ui/group.tsx +20 -0
- package/src/admin/ui/components/ui/index.ts +17 -0
- package/src/admin/ui/components/ui/input.tsx +12 -0
- package/src/admin/ui/components/ui/join.tsx +53 -0
- package/src/admin/ui/components/ui/label.tsx +11 -0
- package/src/admin/ui/components/ui/radio-group.tsx +75 -0
- package/src/admin/ui/components/ui/relationship-detail-sheet.tsx +122 -0
- package/src/admin/ui/components/ui/relationship.tsx +58 -0
- package/src/admin/ui/components/ui/scroll-area.tsx +19 -0
- package/src/admin/ui/components/ui/select.tsx +187 -0
- package/src/admin/ui/components/ui/separator.tsx +21 -0
- package/src/admin/ui/components/ui/sheet.tsx +106 -0
- package/src/admin/ui/components/ui/tabs.tsx +116 -0
- package/src/admin/ui/components/ui/utils.ts +3 -0
- package/src/admin/ui/hooks/use-debounce.ts +15 -0
- package/src/admin/ui/styles/_locale-switcher.scss +33 -0
- package/src/admin/ui/styles/accordion.scss +60 -0
- package/src/admin/ui/styles/animations.scss +41 -0
- package/src/admin/ui/styles/asset-manager.scss +547 -0
- package/src/admin/ui/styles/badge.scss +13 -0
- package/src/admin/ui/styles/base.scss +22 -0
- package/src/admin/ui/styles/button.scss +161 -0
- package/src/admin/ui/styles/card.scss +13 -0
- package/src/admin/ui/styles/collapsible.scss +75 -0
- package/src/admin/ui/styles/data-detail.scss +92 -0
- package/src/admin/ui/styles/dialog.scss +102 -0
- package/src/admin/ui/styles/empty-state.scss +22 -0
- package/src/admin/ui/styles/group.scss +19 -0
- package/src/admin/ui/styles/index.scss +33 -0
- package/src/admin/ui/styles/input.scss +80 -0
- package/src/admin/ui/styles/label.scss +12 -0
- package/src/admin/ui/styles/layout.scss +56 -0
- package/src/admin/ui/styles/lexical.scss +469 -0
- package/src/admin/ui/styles/loading.scss +102 -0
- package/src/admin/ui/styles/media-registry.scss +597 -0
- package/src/admin/ui/styles/pagination.scss +20 -0
- package/src/admin/ui/styles/radio-group.scss +66 -0
- package/src/admin/ui/styles/row.scss +17 -0
- package/src/admin/ui/styles/scrollbar.scss +36 -0
- package/src/admin/ui/styles/select.scss +121 -0
- package/src/admin/ui/styles/separator.scss +14 -0
- package/src/admin/ui/styles/sheet.scss +152 -0
- package/src/admin/ui/styles/sidebar.scss +148 -0
- package/src/admin/ui/styles/switch.scss +59 -0
- package/src/admin/ui/styles/table.scss +207 -0
- package/src/admin/ui/styles/tabs.scss +62 -0
- package/src/admin/ui/styles/toast.scss +45 -0
- package/src/admin/ui/styles/variables.scss +24 -0
- package/src/admin/ui/views/collection-list-view.tsx +720 -0
- package/src/admin/ui/views/dashboard-view.tsx +263 -0
- package/src/admin/ui/views/document-edit-view.tsx +384 -0
- package/src/admin/ui/views/global-edit-view.tsx +226 -0
- package/src/admin/ui/views/init-view.tsx +182 -0
- package/src/admin/ui/views/login-view.tsx +123 -0
- package/src/admin/ui/views/media-registry-view.tsx +1104 -0
- package/src/admin/ui/views/settings-view.tsx +729 -0
- package/src/admin/webcomponent.tsx +15 -0
- package/src/api.ts +9 -0
- package/src/auth/index.ts +194 -0
- package/src/auth/migrations.ts +87 -0
- package/src/auth/premissions.ts +46 -0
- package/src/cli/commands/generate-types.ts +116 -0
- package/src/cli/commands/init.ts +95 -0
- package/src/cli/commands/migrate-commands.ts +160 -0
- package/src/cli/commands/seed-command.ts +11 -0
- package/src/cli/d1-mock.ts +101 -0
- package/src/cli/index.test.ts +84 -0
- package/src/cli/index.ts +183 -0
- package/src/cli/r2-mock.ts +217 -0
- package/src/cli/seeding.ts +405 -0
- package/src/client.ts +181 -0
- package/src/config-utils.ts +102 -0
- package/src/config.ts +49 -0
- package/src/db/adapter.ts +53 -0
- package/src/db/better-sqlite.ts +630 -0
- package/src/db/bun-sqlite.ts +646 -0
- package/src/db/d1.ts +711 -0
- package/src/db/kysely/data-mapper.ts +142 -0
- package/src/db/kysely/field-mapper.ts +148 -0
- package/src/db/kysely/migration-generator.ts +223 -0
- package/src/db/kysely/query-builder.ts +92 -0
- package/src/db/kysely/schema-builder.ts +439 -0
- package/src/db/kysely/sql-utils.ts +13 -0
- package/src/db/postgres.ts +621 -0
- package/src/db/sqlite.ts +658 -0
- package/src/db/system-schema.ts +121 -0
- package/src/index.ts +13 -0
- package/src/runtimes/README.md +59 -0
- package/src/runtimes/bun.ts +49 -0
- package/src/runtimes/cloudflare-workers.ts +38 -0
- package/src/runtimes/next.ts +26 -0
- package/src/runtimes/node.ts +52 -0
- package/src/schema/collection.ts +184 -0
- package/src/schema/fields/base.ts +164 -0
- package/src/schema/fields/index.ts +427 -0
- package/src/schema/global.ts +145 -0
- package/src/schema/index.ts +4 -0
- package/src/schema/infer.ts +72 -0
- package/src/server/admin-router.ts +20 -0
- package/src/server/admin.ts +142 -0
- package/src/server/assets.ts +306 -0
- package/src/server/collection-router.ts +55 -0
- package/src/server/handlers.ts +722 -0
- package/src/server/middlewares/admin.ts +27 -0
- package/src/server/middlewares/auth.ts +89 -0
- package/src/server/middlewares/context.ts +17 -0
- package/src/server/middlewares/cors.ts +24 -0
- package/src/server/middlewares/database-init.ts +74 -0
- package/src/server/middlewares/rate-limit.ts +71 -0
- package/src/server/router.ts +47 -0
- package/src/server/setup-middlewares.ts +58 -0
- package/src/server/system-router.ts +35 -0
- package/src/server.ts +9 -0
- package/src/storage/adapters/cloudflare-r2.ts +136 -0
- package/src/storage/adapters/local.ts +146 -0
- package/src/storage/adapters/s3.ts +186 -0
- package/src/storage/errors.ts +46 -0
- package/src/storage/index.ts +5 -0
- package/src/storage/types.ts +39 -0
- package/src/types.ts +577 -0
- package/src/utils/lexical.ts +37 -0
- package/src/utils/logger.ts +73 -0
- package/src/validation.ts +429 -0
- package/src/validator.ts +179 -0
- package/test/admin-custom-field.test.ts +162 -0
- package/test/admin-react-field.test.tsx +134 -0
- package/test/api-features.test.ts +78 -0
- package/test/api.test.ts +178 -0
- package/test/auth.test.ts +62 -0
- package/test/cli-integration.test.ts +146 -0
- package/test/cli.test.ts +25 -0
- package/test/db/postgres.test.ts +95 -0
- package/test/db/sqlite-filter.test.ts +53 -0
- package/test/db/sqlite.test.ts +82 -0
- package/test/engine-features.test.ts +79 -0
- package/test/globals.test.ts +74 -0
- package/test/integration-tmp/db-app/opacacms.config.ts +15 -0
- package/test/integration-tmp/my-sqlite-app/opacacms.config.ts +25 -0
- package/test/integration-tmp/my-test-app/index.ts +8 -0
- package/test/integration-tmp/my-test-app/opacacms.config.ts +16 -0
- package/test/integration-tmp/my-test-app/package.json +12 -0
- package/test/populate.test.ts +79 -0
- package/test/runtimes.test.ts +43 -0
- package/test/schema-builder.test.ts +107 -0
- package/test/schema-features.test.ts +63 -0
- package/test/seeding.test.ts +68 -0
- package/test/storage/local.test.ts +72 -0
- package/test/storage/s3.test.ts +60 -0
- package/test/structural-data.test.ts +100 -0
- package/test/test-setup.ts +11 -0
- package/test/validation.test.ts +162 -0
- package/tsconfig.json +42 -0
|
@@ -0,0 +1,2107 @@
|
|
|
1
|
+
import type { OpacaConfig } from "../types";
|
|
2
|
+
export declare function createAuth(config: OpacaConfig): Promise<import("better-auth").Auth<{
|
|
3
|
+
database: any;
|
|
4
|
+
baseURL: string;
|
|
5
|
+
basePath: string;
|
|
6
|
+
secret: any;
|
|
7
|
+
trustedOrigins: string[] | ((request?: Request) => string[] | Promise<string[]>) | undefined;
|
|
8
|
+
emailAndPassword: {
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
};
|
|
11
|
+
socialProviders: Record<string, any>;
|
|
12
|
+
user: {
|
|
13
|
+
modelName: "_users";
|
|
14
|
+
};
|
|
15
|
+
session: {
|
|
16
|
+
modelName: "_sessions";
|
|
17
|
+
expiresIn: number;
|
|
18
|
+
updateAge: number;
|
|
19
|
+
};
|
|
20
|
+
account: {
|
|
21
|
+
modelName: "_accounts";
|
|
22
|
+
};
|
|
23
|
+
verification: {
|
|
24
|
+
modelName: "_verifications";
|
|
25
|
+
};
|
|
26
|
+
advanced: {
|
|
27
|
+
useSecureCookies: boolean;
|
|
28
|
+
defaultCookieAttributes: {
|
|
29
|
+
sameSite: any;
|
|
30
|
+
secure: boolean;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
databaseHooks: {
|
|
34
|
+
user: {
|
|
35
|
+
create: {
|
|
36
|
+
before: (user: {
|
|
37
|
+
id: string;
|
|
38
|
+
createdAt: Date;
|
|
39
|
+
updatedAt: Date;
|
|
40
|
+
email: string;
|
|
41
|
+
emailVerified: boolean;
|
|
42
|
+
name: string;
|
|
43
|
+
image?: string | null | undefined;
|
|
44
|
+
} & Record<string, unknown>) => Promise<{
|
|
45
|
+
data: {
|
|
46
|
+
role: string;
|
|
47
|
+
id: string;
|
|
48
|
+
createdAt: Date;
|
|
49
|
+
updatedAt: Date;
|
|
50
|
+
email: string;
|
|
51
|
+
emailVerified: boolean;
|
|
52
|
+
name: string;
|
|
53
|
+
image?: string | null | undefined;
|
|
54
|
+
};
|
|
55
|
+
} | undefined>;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
plugins: ({
|
|
60
|
+
id: "admin";
|
|
61
|
+
init(): {
|
|
62
|
+
options: {
|
|
63
|
+
databaseHooks: {
|
|
64
|
+
user: {
|
|
65
|
+
create: {
|
|
66
|
+
before(user: {
|
|
67
|
+
id: string;
|
|
68
|
+
createdAt: Date;
|
|
69
|
+
updatedAt: Date;
|
|
70
|
+
email: string;
|
|
71
|
+
emailVerified: boolean;
|
|
72
|
+
name: string;
|
|
73
|
+
image?: string | null | undefined;
|
|
74
|
+
} & Record<string, unknown>): Promise<{
|
|
75
|
+
data: {
|
|
76
|
+
id: string;
|
|
77
|
+
createdAt: Date;
|
|
78
|
+
updatedAt: Date;
|
|
79
|
+
email: string;
|
|
80
|
+
emailVerified: boolean;
|
|
81
|
+
name: string;
|
|
82
|
+
image?: string | null | undefined;
|
|
83
|
+
role: string;
|
|
84
|
+
};
|
|
85
|
+
}>;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
session: {
|
|
89
|
+
create: {
|
|
90
|
+
before(session: {
|
|
91
|
+
id: string;
|
|
92
|
+
createdAt: Date;
|
|
93
|
+
updatedAt: Date;
|
|
94
|
+
userId: string;
|
|
95
|
+
expiresAt: Date;
|
|
96
|
+
token: string;
|
|
97
|
+
ipAddress?: string | null | undefined;
|
|
98
|
+
userAgent?: string | null | undefined;
|
|
99
|
+
} & Record<string, unknown>, ctx: import("better-auth").GenericEndpointContext | null): Promise<void>;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
hooks: {
|
|
106
|
+
after: {
|
|
107
|
+
matcher(context: import("better-auth").HookEndpointContext): boolean;
|
|
108
|
+
handler: (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<import("better-auth/plugins").SessionWithImpersonatedBy[] | undefined>;
|
|
109
|
+
}[];
|
|
110
|
+
};
|
|
111
|
+
endpoints: {
|
|
112
|
+
setRole: import("better-call").StrictEndpoint<"/admin/set-role", {
|
|
113
|
+
method: "POST";
|
|
114
|
+
body: import("zod").ZodObject<{
|
|
115
|
+
userId: import("zod").ZodCoercedString<unknown>;
|
|
116
|
+
role: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>]>;
|
|
117
|
+
}, import("better-auth").$strip>;
|
|
118
|
+
requireHeaders: true;
|
|
119
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
120
|
+
session: {
|
|
121
|
+
user: import("better-auth/plugins").UserWithRole;
|
|
122
|
+
session: {
|
|
123
|
+
id: string;
|
|
124
|
+
createdAt: Date;
|
|
125
|
+
updatedAt: Date;
|
|
126
|
+
userId: string;
|
|
127
|
+
expiresAt: Date;
|
|
128
|
+
token: string;
|
|
129
|
+
ipAddress?: string | null | undefined;
|
|
130
|
+
userAgent?: string | null | undefined;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
}>)[];
|
|
134
|
+
metadata: {
|
|
135
|
+
openapi: {
|
|
136
|
+
operationId: string;
|
|
137
|
+
summary: string;
|
|
138
|
+
description: string;
|
|
139
|
+
responses: {
|
|
140
|
+
200: {
|
|
141
|
+
description: string;
|
|
142
|
+
content: {
|
|
143
|
+
"application/json": {
|
|
144
|
+
schema: {
|
|
145
|
+
type: "object";
|
|
146
|
+
properties: {
|
|
147
|
+
user: {
|
|
148
|
+
$ref: string;
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
$Infer: {
|
|
158
|
+
body: {
|
|
159
|
+
userId: string;
|
|
160
|
+
role: string | string[];
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
}, {
|
|
165
|
+
user: import("better-auth/plugins").UserWithRole;
|
|
166
|
+
}>;
|
|
167
|
+
getUser: import("better-call").StrictEndpoint<"/admin/get-user", {
|
|
168
|
+
method: "GET";
|
|
169
|
+
query: import("zod").ZodObject<{
|
|
170
|
+
id: import("zod").ZodString;
|
|
171
|
+
}, import("better-auth").$strip>;
|
|
172
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
173
|
+
session: {
|
|
174
|
+
user: import("better-auth/plugins").UserWithRole;
|
|
175
|
+
session: {
|
|
176
|
+
id: string;
|
|
177
|
+
createdAt: Date;
|
|
178
|
+
updatedAt: Date;
|
|
179
|
+
userId: string;
|
|
180
|
+
expiresAt: Date;
|
|
181
|
+
token: string;
|
|
182
|
+
ipAddress?: string | null | undefined;
|
|
183
|
+
userAgent?: string | null | undefined;
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
}>)[];
|
|
187
|
+
metadata: {
|
|
188
|
+
openapi: {
|
|
189
|
+
operationId: string;
|
|
190
|
+
summary: string;
|
|
191
|
+
description: string;
|
|
192
|
+
responses: {
|
|
193
|
+
200: {
|
|
194
|
+
description: string;
|
|
195
|
+
content: {
|
|
196
|
+
"application/json": {
|
|
197
|
+
schema: {
|
|
198
|
+
type: "object";
|
|
199
|
+
properties: {
|
|
200
|
+
user: {
|
|
201
|
+
$ref: string;
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
}, import("better-auth/plugins").UserWithRole>;
|
|
212
|
+
createUser: import("better-call").StrictEndpoint<"/admin/create-user", {
|
|
213
|
+
method: "POST";
|
|
214
|
+
body: import("zod").ZodObject<{
|
|
215
|
+
email: import("zod").ZodString;
|
|
216
|
+
password: import("zod").ZodOptional<import("zod").ZodString>;
|
|
217
|
+
name: import("zod").ZodString;
|
|
218
|
+
role: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>]>>;
|
|
219
|
+
data: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
|
|
220
|
+
}, import("better-auth").$strip>;
|
|
221
|
+
metadata: {
|
|
222
|
+
openapi: {
|
|
223
|
+
operationId: string;
|
|
224
|
+
summary: string;
|
|
225
|
+
description: string;
|
|
226
|
+
responses: {
|
|
227
|
+
200: {
|
|
228
|
+
description: string;
|
|
229
|
+
content: {
|
|
230
|
+
"application/json": {
|
|
231
|
+
schema: {
|
|
232
|
+
type: "object";
|
|
233
|
+
properties: {
|
|
234
|
+
user: {
|
|
235
|
+
$ref: string;
|
|
236
|
+
};
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
$Infer: {
|
|
245
|
+
body: {
|
|
246
|
+
email: string;
|
|
247
|
+
password?: string | undefined;
|
|
248
|
+
name: string;
|
|
249
|
+
role?: string | string[] | undefined;
|
|
250
|
+
data?: Record<string, any> | undefined;
|
|
251
|
+
};
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
}, {
|
|
255
|
+
user: import("better-auth/plugins").UserWithRole;
|
|
256
|
+
}>;
|
|
257
|
+
adminUpdateUser: import("better-call").StrictEndpoint<"/admin/update-user", {
|
|
258
|
+
method: "POST";
|
|
259
|
+
body: import("zod").ZodObject<{
|
|
260
|
+
userId: import("zod").ZodCoercedString<unknown>;
|
|
261
|
+
data: import("zod").ZodRecord<import("zod").ZodAny, import("zod").ZodAny>;
|
|
262
|
+
}, import("better-auth").$strip>;
|
|
263
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
264
|
+
session: {
|
|
265
|
+
user: import("better-auth/plugins").UserWithRole;
|
|
266
|
+
session: {
|
|
267
|
+
id: string;
|
|
268
|
+
createdAt: Date;
|
|
269
|
+
updatedAt: Date;
|
|
270
|
+
userId: string;
|
|
271
|
+
expiresAt: Date;
|
|
272
|
+
token: string;
|
|
273
|
+
ipAddress?: string | null | undefined;
|
|
274
|
+
userAgent?: string | null | undefined;
|
|
275
|
+
};
|
|
276
|
+
};
|
|
277
|
+
}>)[];
|
|
278
|
+
metadata: {
|
|
279
|
+
openapi: {
|
|
280
|
+
operationId: string;
|
|
281
|
+
summary: string;
|
|
282
|
+
description: string;
|
|
283
|
+
responses: {
|
|
284
|
+
200: {
|
|
285
|
+
description: string;
|
|
286
|
+
content: {
|
|
287
|
+
"application/json": {
|
|
288
|
+
schema: {
|
|
289
|
+
type: "object";
|
|
290
|
+
properties: {
|
|
291
|
+
user: {
|
|
292
|
+
$ref: string;
|
|
293
|
+
};
|
|
294
|
+
};
|
|
295
|
+
};
|
|
296
|
+
};
|
|
297
|
+
};
|
|
298
|
+
};
|
|
299
|
+
};
|
|
300
|
+
};
|
|
301
|
+
};
|
|
302
|
+
}, import("better-auth/plugins").UserWithRole>;
|
|
303
|
+
listUsers: import("better-call").StrictEndpoint<"/admin/list-users", {
|
|
304
|
+
method: "GET";
|
|
305
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
306
|
+
session: {
|
|
307
|
+
user: import("better-auth/plugins").UserWithRole;
|
|
308
|
+
session: {
|
|
309
|
+
id: string;
|
|
310
|
+
createdAt: Date;
|
|
311
|
+
updatedAt: Date;
|
|
312
|
+
userId: string;
|
|
313
|
+
expiresAt: Date;
|
|
314
|
+
token: string;
|
|
315
|
+
ipAddress?: string | null | undefined;
|
|
316
|
+
userAgent?: string | null | undefined;
|
|
317
|
+
};
|
|
318
|
+
};
|
|
319
|
+
}>)[];
|
|
320
|
+
query: import("zod").ZodObject<{
|
|
321
|
+
searchValue: import("zod").ZodOptional<import("zod").ZodString>;
|
|
322
|
+
searchField: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
323
|
+
name: "name";
|
|
324
|
+
email: "email";
|
|
325
|
+
}>>;
|
|
326
|
+
searchOperator: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
327
|
+
contains: "contains";
|
|
328
|
+
starts_with: "starts_with";
|
|
329
|
+
ends_with: "ends_with";
|
|
330
|
+
}>>;
|
|
331
|
+
limit: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>>;
|
|
332
|
+
offset: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>>;
|
|
333
|
+
sortBy: import("zod").ZodOptional<import("zod").ZodString>;
|
|
334
|
+
sortDirection: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
335
|
+
asc: "asc";
|
|
336
|
+
desc: "desc";
|
|
337
|
+
}>>;
|
|
338
|
+
filterField: import("zod").ZodOptional<import("zod").ZodString>;
|
|
339
|
+
filterValue: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodUnion<[import("zod").ZodUnion<[import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, import("zod").ZodBoolean]>, import("zod").ZodArray<import("zod").ZodString>]>, import("zod").ZodArray<import("zod").ZodNumber>]>>;
|
|
340
|
+
filterOperator: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
341
|
+
eq: "eq";
|
|
342
|
+
ne: "ne";
|
|
343
|
+
gt: "gt";
|
|
344
|
+
gte: "gte";
|
|
345
|
+
lt: "lt";
|
|
346
|
+
lte: "lte";
|
|
347
|
+
in: "in";
|
|
348
|
+
not_in: "not_in";
|
|
349
|
+
contains: "contains";
|
|
350
|
+
starts_with: "starts_with";
|
|
351
|
+
ends_with: "ends_with";
|
|
352
|
+
}>>;
|
|
353
|
+
}, import("better-auth").$strip>;
|
|
354
|
+
metadata: {
|
|
355
|
+
openapi: {
|
|
356
|
+
operationId: string;
|
|
357
|
+
summary: string;
|
|
358
|
+
description: string;
|
|
359
|
+
responses: {
|
|
360
|
+
200: {
|
|
361
|
+
description: string;
|
|
362
|
+
content: {
|
|
363
|
+
"application/json": {
|
|
364
|
+
schema: {
|
|
365
|
+
type: "object";
|
|
366
|
+
properties: {
|
|
367
|
+
users: {
|
|
368
|
+
type: string;
|
|
369
|
+
items: {
|
|
370
|
+
$ref: string;
|
|
371
|
+
};
|
|
372
|
+
};
|
|
373
|
+
total: {
|
|
374
|
+
type: string;
|
|
375
|
+
};
|
|
376
|
+
limit: {
|
|
377
|
+
type: string;
|
|
378
|
+
};
|
|
379
|
+
offset: {
|
|
380
|
+
type: string;
|
|
381
|
+
};
|
|
382
|
+
};
|
|
383
|
+
required: string[];
|
|
384
|
+
};
|
|
385
|
+
};
|
|
386
|
+
};
|
|
387
|
+
};
|
|
388
|
+
};
|
|
389
|
+
};
|
|
390
|
+
};
|
|
391
|
+
}, {
|
|
392
|
+
users: import("better-auth/plugins").UserWithRole[];
|
|
393
|
+
total: number;
|
|
394
|
+
}>;
|
|
395
|
+
listUserSessions: import("better-call").StrictEndpoint<"/admin/list-user-sessions", {
|
|
396
|
+
method: "POST";
|
|
397
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
398
|
+
session: {
|
|
399
|
+
user: import("better-auth/plugins").UserWithRole;
|
|
400
|
+
session: {
|
|
401
|
+
id: string;
|
|
402
|
+
createdAt: Date;
|
|
403
|
+
updatedAt: Date;
|
|
404
|
+
userId: string;
|
|
405
|
+
expiresAt: Date;
|
|
406
|
+
token: string;
|
|
407
|
+
ipAddress?: string | null | undefined;
|
|
408
|
+
userAgent?: string | null | undefined;
|
|
409
|
+
};
|
|
410
|
+
};
|
|
411
|
+
}>)[];
|
|
412
|
+
body: import("zod").ZodObject<{
|
|
413
|
+
userId: import("zod").ZodCoercedString<unknown>;
|
|
414
|
+
}, import("better-auth").$strip>;
|
|
415
|
+
metadata: {
|
|
416
|
+
openapi: {
|
|
417
|
+
operationId: string;
|
|
418
|
+
summary: string;
|
|
419
|
+
description: string;
|
|
420
|
+
responses: {
|
|
421
|
+
200: {
|
|
422
|
+
description: string;
|
|
423
|
+
content: {
|
|
424
|
+
"application/json": {
|
|
425
|
+
schema: {
|
|
426
|
+
type: "object";
|
|
427
|
+
properties: {
|
|
428
|
+
sessions: {
|
|
429
|
+
type: string;
|
|
430
|
+
items: {
|
|
431
|
+
$ref: string;
|
|
432
|
+
};
|
|
433
|
+
};
|
|
434
|
+
};
|
|
435
|
+
};
|
|
436
|
+
};
|
|
437
|
+
};
|
|
438
|
+
};
|
|
439
|
+
};
|
|
440
|
+
};
|
|
441
|
+
};
|
|
442
|
+
}, {
|
|
443
|
+
sessions: import("better-auth/plugins").SessionWithImpersonatedBy[];
|
|
444
|
+
}>;
|
|
445
|
+
unbanUser: import("better-call").StrictEndpoint<"/admin/unban-user", {
|
|
446
|
+
method: "POST";
|
|
447
|
+
body: import("zod").ZodObject<{
|
|
448
|
+
userId: import("zod").ZodCoercedString<unknown>;
|
|
449
|
+
}, import("better-auth").$strip>;
|
|
450
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
451
|
+
session: {
|
|
452
|
+
user: import("better-auth/plugins").UserWithRole;
|
|
453
|
+
session: {
|
|
454
|
+
id: string;
|
|
455
|
+
createdAt: Date;
|
|
456
|
+
updatedAt: Date;
|
|
457
|
+
userId: string;
|
|
458
|
+
expiresAt: Date;
|
|
459
|
+
token: string;
|
|
460
|
+
ipAddress?: string | null | undefined;
|
|
461
|
+
userAgent?: string | null | undefined;
|
|
462
|
+
};
|
|
463
|
+
};
|
|
464
|
+
}>)[];
|
|
465
|
+
metadata: {
|
|
466
|
+
openapi: {
|
|
467
|
+
operationId: string;
|
|
468
|
+
summary: string;
|
|
469
|
+
description: string;
|
|
470
|
+
responses: {
|
|
471
|
+
200: {
|
|
472
|
+
description: string;
|
|
473
|
+
content: {
|
|
474
|
+
"application/json": {
|
|
475
|
+
schema: {
|
|
476
|
+
type: "object";
|
|
477
|
+
properties: {
|
|
478
|
+
user: {
|
|
479
|
+
$ref: string;
|
|
480
|
+
};
|
|
481
|
+
};
|
|
482
|
+
};
|
|
483
|
+
};
|
|
484
|
+
};
|
|
485
|
+
};
|
|
486
|
+
};
|
|
487
|
+
};
|
|
488
|
+
};
|
|
489
|
+
}, {
|
|
490
|
+
user: import("better-auth/plugins").UserWithRole;
|
|
491
|
+
}>;
|
|
492
|
+
banUser: import("better-call").StrictEndpoint<"/admin/ban-user", {
|
|
493
|
+
method: "POST";
|
|
494
|
+
body: import("zod").ZodObject<{
|
|
495
|
+
userId: import("zod").ZodCoercedString<unknown>;
|
|
496
|
+
banReason: import("zod").ZodOptional<import("zod").ZodString>;
|
|
497
|
+
banExpiresIn: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
498
|
+
}, import("better-auth").$strip>;
|
|
499
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
500
|
+
session: {
|
|
501
|
+
user: import("better-auth/plugins").UserWithRole;
|
|
502
|
+
session: {
|
|
503
|
+
id: string;
|
|
504
|
+
createdAt: Date;
|
|
505
|
+
updatedAt: Date;
|
|
506
|
+
userId: string;
|
|
507
|
+
expiresAt: Date;
|
|
508
|
+
token: string;
|
|
509
|
+
ipAddress?: string | null | undefined;
|
|
510
|
+
userAgent?: string | null | undefined;
|
|
511
|
+
};
|
|
512
|
+
};
|
|
513
|
+
}>)[];
|
|
514
|
+
metadata: {
|
|
515
|
+
openapi: {
|
|
516
|
+
operationId: string;
|
|
517
|
+
summary: string;
|
|
518
|
+
description: string;
|
|
519
|
+
responses: {
|
|
520
|
+
200: {
|
|
521
|
+
description: string;
|
|
522
|
+
content: {
|
|
523
|
+
"application/json": {
|
|
524
|
+
schema: {
|
|
525
|
+
type: "object";
|
|
526
|
+
properties: {
|
|
527
|
+
user: {
|
|
528
|
+
$ref: string;
|
|
529
|
+
};
|
|
530
|
+
};
|
|
531
|
+
};
|
|
532
|
+
};
|
|
533
|
+
};
|
|
534
|
+
};
|
|
535
|
+
};
|
|
536
|
+
};
|
|
537
|
+
};
|
|
538
|
+
}, {
|
|
539
|
+
user: import("better-auth/plugins").UserWithRole;
|
|
540
|
+
}>;
|
|
541
|
+
impersonateUser: import("better-call").StrictEndpoint<"/admin/impersonate-user", {
|
|
542
|
+
method: "POST";
|
|
543
|
+
body: import("zod").ZodObject<{
|
|
544
|
+
userId: import("zod").ZodCoercedString<unknown>;
|
|
545
|
+
}, import("better-auth").$strip>;
|
|
546
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
547
|
+
session: {
|
|
548
|
+
user: import("better-auth/plugins").UserWithRole;
|
|
549
|
+
session: {
|
|
550
|
+
id: string;
|
|
551
|
+
createdAt: Date;
|
|
552
|
+
updatedAt: Date;
|
|
553
|
+
userId: string;
|
|
554
|
+
expiresAt: Date;
|
|
555
|
+
token: string;
|
|
556
|
+
ipAddress?: string | null | undefined;
|
|
557
|
+
userAgent?: string | null | undefined;
|
|
558
|
+
};
|
|
559
|
+
};
|
|
560
|
+
}>)[];
|
|
561
|
+
metadata: {
|
|
562
|
+
openapi: {
|
|
563
|
+
operationId: string;
|
|
564
|
+
summary: string;
|
|
565
|
+
description: string;
|
|
566
|
+
responses: {
|
|
567
|
+
200: {
|
|
568
|
+
description: string;
|
|
569
|
+
content: {
|
|
570
|
+
"application/json": {
|
|
571
|
+
schema: {
|
|
572
|
+
type: "object";
|
|
573
|
+
properties: {
|
|
574
|
+
session: {
|
|
575
|
+
$ref: string;
|
|
576
|
+
};
|
|
577
|
+
user: {
|
|
578
|
+
$ref: string;
|
|
579
|
+
};
|
|
580
|
+
};
|
|
581
|
+
};
|
|
582
|
+
};
|
|
583
|
+
};
|
|
584
|
+
};
|
|
585
|
+
};
|
|
586
|
+
};
|
|
587
|
+
};
|
|
588
|
+
}, {
|
|
589
|
+
session: {
|
|
590
|
+
id: string;
|
|
591
|
+
createdAt: Date;
|
|
592
|
+
updatedAt: Date;
|
|
593
|
+
userId: string;
|
|
594
|
+
expiresAt: Date;
|
|
595
|
+
token: string;
|
|
596
|
+
ipAddress?: string | null | undefined;
|
|
597
|
+
userAgent?: string | null | undefined;
|
|
598
|
+
};
|
|
599
|
+
user: import("better-auth/plugins").UserWithRole;
|
|
600
|
+
}>;
|
|
601
|
+
stopImpersonating: import("better-call").StrictEndpoint<"/admin/stop-impersonating", {
|
|
602
|
+
method: "POST";
|
|
603
|
+
requireHeaders: true;
|
|
604
|
+
}, {
|
|
605
|
+
session: {
|
|
606
|
+
id: string;
|
|
607
|
+
createdAt: Date;
|
|
608
|
+
updatedAt: Date;
|
|
609
|
+
userId: string;
|
|
610
|
+
expiresAt: Date;
|
|
611
|
+
token: string;
|
|
612
|
+
ipAddress?: string | null | undefined;
|
|
613
|
+
userAgent?: string | null | undefined;
|
|
614
|
+
} & Record<string, any>;
|
|
615
|
+
user: {
|
|
616
|
+
id: string;
|
|
617
|
+
createdAt: Date;
|
|
618
|
+
updatedAt: Date;
|
|
619
|
+
email: string;
|
|
620
|
+
emailVerified: boolean;
|
|
621
|
+
name: string;
|
|
622
|
+
image?: string | null | undefined;
|
|
623
|
+
} & Record<string, any>;
|
|
624
|
+
}>;
|
|
625
|
+
revokeUserSession: import("better-call").StrictEndpoint<"/admin/revoke-user-session", {
|
|
626
|
+
method: "POST";
|
|
627
|
+
body: import("zod").ZodObject<{
|
|
628
|
+
sessionToken: import("zod").ZodString;
|
|
629
|
+
}, import("better-auth").$strip>;
|
|
630
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
631
|
+
session: {
|
|
632
|
+
user: import("better-auth/plugins").UserWithRole;
|
|
633
|
+
session: {
|
|
634
|
+
id: string;
|
|
635
|
+
createdAt: Date;
|
|
636
|
+
updatedAt: Date;
|
|
637
|
+
userId: string;
|
|
638
|
+
expiresAt: Date;
|
|
639
|
+
token: string;
|
|
640
|
+
ipAddress?: string | null | undefined;
|
|
641
|
+
userAgent?: string | null | undefined;
|
|
642
|
+
};
|
|
643
|
+
};
|
|
644
|
+
}>)[];
|
|
645
|
+
metadata: {
|
|
646
|
+
openapi: {
|
|
647
|
+
operationId: string;
|
|
648
|
+
summary: string;
|
|
649
|
+
description: string;
|
|
650
|
+
responses: {
|
|
651
|
+
200: {
|
|
652
|
+
description: string;
|
|
653
|
+
content: {
|
|
654
|
+
"application/json": {
|
|
655
|
+
schema: {
|
|
656
|
+
type: "object";
|
|
657
|
+
properties: {
|
|
658
|
+
success: {
|
|
659
|
+
type: string;
|
|
660
|
+
};
|
|
661
|
+
};
|
|
662
|
+
};
|
|
663
|
+
};
|
|
664
|
+
};
|
|
665
|
+
};
|
|
666
|
+
};
|
|
667
|
+
};
|
|
668
|
+
};
|
|
669
|
+
}, {
|
|
670
|
+
success: boolean;
|
|
671
|
+
}>;
|
|
672
|
+
revokeUserSessions: import("better-call").StrictEndpoint<"/admin/revoke-user-sessions", {
|
|
673
|
+
method: "POST";
|
|
674
|
+
body: import("zod").ZodObject<{
|
|
675
|
+
userId: import("zod").ZodCoercedString<unknown>;
|
|
676
|
+
}, import("better-auth").$strip>;
|
|
677
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
678
|
+
session: {
|
|
679
|
+
user: import("better-auth/plugins").UserWithRole;
|
|
680
|
+
session: {
|
|
681
|
+
id: string;
|
|
682
|
+
createdAt: Date;
|
|
683
|
+
updatedAt: Date;
|
|
684
|
+
userId: string;
|
|
685
|
+
expiresAt: Date;
|
|
686
|
+
token: string;
|
|
687
|
+
ipAddress?: string | null | undefined;
|
|
688
|
+
userAgent?: string | null | undefined;
|
|
689
|
+
};
|
|
690
|
+
};
|
|
691
|
+
}>)[];
|
|
692
|
+
metadata: {
|
|
693
|
+
openapi: {
|
|
694
|
+
operationId: string;
|
|
695
|
+
summary: string;
|
|
696
|
+
description: string;
|
|
697
|
+
responses: {
|
|
698
|
+
200: {
|
|
699
|
+
description: string;
|
|
700
|
+
content: {
|
|
701
|
+
"application/json": {
|
|
702
|
+
schema: {
|
|
703
|
+
type: "object";
|
|
704
|
+
properties: {
|
|
705
|
+
success: {
|
|
706
|
+
type: string;
|
|
707
|
+
};
|
|
708
|
+
};
|
|
709
|
+
};
|
|
710
|
+
};
|
|
711
|
+
};
|
|
712
|
+
};
|
|
713
|
+
};
|
|
714
|
+
};
|
|
715
|
+
};
|
|
716
|
+
}, {
|
|
717
|
+
success: boolean;
|
|
718
|
+
}>;
|
|
719
|
+
removeUser: import("better-call").StrictEndpoint<"/admin/remove-user", {
|
|
720
|
+
method: "POST";
|
|
721
|
+
body: import("zod").ZodObject<{
|
|
722
|
+
userId: import("zod").ZodCoercedString<unknown>;
|
|
723
|
+
}, import("better-auth").$strip>;
|
|
724
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
725
|
+
session: {
|
|
726
|
+
user: import("better-auth/plugins").UserWithRole;
|
|
727
|
+
session: {
|
|
728
|
+
id: string;
|
|
729
|
+
createdAt: Date;
|
|
730
|
+
updatedAt: Date;
|
|
731
|
+
userId: string;
|
|
732
|
+
expiresAt: Date;
|
|
733
|
+
token: string;
|
|
734
|
+
ipAddress?: string | null | undefined;
|
|
735
|
+
userAgent?: string | null | undefined;
|
|
736
|
+
};
|
|
737
|
+
};
|
|
738
|
+
}>)[];
|
|
739
|
+
metadata: {
|
|
740
|
+
openapi: {
|
|
741
|
+
operationId: string;
|
|
742
|
+
summary: string;
|
|
743
|
+
description: string;
|
|
744
|
+
responses: {
|
|
745
|
+
200: {
|
|
746
|
+
description: string;
|
|
747
|
+
content: {
|
|
748
|
+
"application/json": {
|
|
749
|
+
schema: {
|
|
750
|
+
type: "object";
|
|
751
|
+
properties: {
|
|
752
|
+
success: {
|
|
753
|
+
type: string;
|
|
754
|
+
};
|
|
755
|
+
};
|
|
756
|
+
};
|
|
757
|
+
};
|
|
758
|
+
};
|
|
759
|
+
};
|
|
760
|
+
};
|
|
761
|
+
};
|
|
762
|
+
};
|
|
763
|
+
}, {
|
|
764
|
+
success: boolean;
|
|
765
|
+
}>;
|
|
766
|
+
setUserPassword: import("better-call").StrictEndpoint<"/admin/set-user-password", {
|
|
767
|
+
method: "POST";
|
|
768
|
+
body: import("zod").ZodObject<{
|
|
769
|
+
newPassword: import("zod").ZodString;
|
|
770
|
+
userId: import("zod").ZodCoercedString<unknown>;
|
|
771
|
+
}, import("better-auth").$strip>;
|
|
772
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
773
|
+
session: {
|
|
774
|
+
user: import("better-auth/plugins").UserWithRole;
|
|
775
|
+
session: {
|
|
776
|
+
id: string;
|
|
777
|
+
createdAt: Date;
|
|
778
|
+
updatedAt: Date;
|
|
779
|
+
userId: string;
|
|
780
|
+
expiresAt: Date;
|
|
781
|
+
token: string;
|
|
782
|
+
ipAddress?: string | null | undefined;
|
|
783
|
+
userAgent?: string | null | undefined;
|
|
784
|
+
};
|
|
785
|
+
};
|
|
786
|
+
}>)[];
|
|
787
|
+
metadata: {
|
|
788
|
+
openapi: {
|
|
789
|
+
operationId: string;
|
|
790
|
+
summary: string;
|
|
791
|
+
description: string;
|
|
792
|
+
responses: {
|
|
793
|
+
200: {
|
|
794
|
+
description: string;
|
|
795
|
+
content: {
|
|
796
|
+
"application/json": {
|
|
797
|
+
schema: {
|
|
798
|
+
type: "object";
|
|
799
|
+
properties: {
|
|
800
|
+
status: {
|
|
801
|
+
type: string;
|
|
802
|
+
};
|
|
803
|
+
};
|
|
804
|
+
};
|
|
805
|
+
};
|
|
806
|
+
};
|
|
807
|
+
};
|
|
808
|
+
};
|
|
809
|
+
};
|
|
810
|
+
};
|
|
811
|
+
}, {
|
|
812
|
+
status: boolean;
|
|
813
|
+
}>;
|
|
814
|
+
userHasPermission: import("better-call").StrictEndpoint<"/admin/has-permission", {
|
|
815
|
+
method: "POST";
|
|
816
|
+
body: import("zod").ZodIntersection<import("zod").ZodObject<{
|
|
817
|
+
userId: import("zod").ZodOptional<import("zod").ZodCoercedString<unknown>>;
|
|
818
|
+
role: import("zod").ZodOptional<import("zod").ZodString>;
|
|
819
|
+
}, import("better-auth").$strip>, import("zod").ZodUnion<readonly [import("zod").ZodObject<{
|
|
820
|
+
permission: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>>;
|
|
821
|
+
permissions: import("zod").ZodUndefined;
|
|
822
|
+
}, import("better-auth").$strip>, import("zod").ZodObject<{
|
|
823
|
+
permission: import("zod").ZodUndefined;
|
|
824
|
+
permissions: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>>;
|
|
825
|
+
}, import("better-auth").$strip>]>>;
|
|
826
|
+
metadata: {
|
|
827
|
+
openapi: {
|
|
828
|
+
description: string;
|
|
829
|
+
requestBody: {
|
|
830
|
+
content: {
|
|
831
|
+
"application/json": {
|
|
832
|
+
schema: {
|
|
833
|
+
type: "object";
|
|
834
|
+
properties: {
|
|
835
|
+
permissions: {
|
|
836
|
+
type: string;
|
|
837
|
+
description: string;
|
|
838
|
+
};
|
|
839
|
+
};
|
|
840
|
+
required: string[];
|
|
841
|
+
};
|
|
842
|
+
};
|
|
843
|
+
};
|
|
844
|
+
};
|
|
845
|
+
responses: {
|
|
846
|
+
"200": {
|
|
847
|
+
description: string;
|
|
848
|
+
content: {
|
|
849
|
+
"application/json": {
|
|
850
|
+
schema: {
|
|
851
|
+
type: "object";
|
|
852
|
+
properties: {
|
|
853
|
+
error: {
|
|
854
|
+
type: string;
|
|
855
|
+
};
|
|
856
|
+
success: {
|
|
857
|
+
type: string;
|
|
858
|
+
};
|
|
859
|
+
};
|
|
860
|
+
required: string[];
|
|
861
|
+
};
|
|
862
|
+
};
|
|
863
|
+
};
|
|
864
|
+
};
|
|
865
|
+
};
|
|
866
|
+
};
|
|
867
|
+
$Infer: {
|
|
868
|
+
body: {
|
|
869
|
+
permissions: {
|
|
870
|
+
readonly [x: string]: import("better-auth").LiteralString[] | undefined;
|
|
871
|
+
};
|
|
872
|
+
} & {
|
|
873
|
+
userId?: string | undefined;
|
|
874
|
+
role?: string | undefined;
|
|
875
|
+
};
|
|
876
|
+
};
|
|
877
|
+
};
|
|
878
|
+
}, {
|
|
879
|
+
error: null;
|
|
880
|
+
success: boolean;
|
|
881
|
+
}>;
|
|
882
|
+
};
|
|
883
|
+
$ERROR_CODES: {
|
|
884
|
+
USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: import("better-auth").RawError<"USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL">;
|
|
885
|
+
FAILED_TO_CREATE_USER: import("better-auth").RawError<"FAILED_TO_CREATE_USER">;
|
|
886
|
+
USER_ALREADY_EXISTS: import("better-auth").RawError<"USER_ALREADY_EXISTS">;
|
|
887
|
+
YOU_CANNOT_BAN_YOURSELF: import("better-auth").RawError<"YOU_CANNOT_BAN_YOURSELF">;
|
|
888
|
+
YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE">;
|
|
889
|
+
YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS">;
|
|
890
|
+
YOU_ARE_NOT_ALLOWED_TO_LIST_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_USERS">;
|
|
891
|
+
YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS">;
|
|
892
|
+
YOU_ARE_NOT_ALLOWED_TO_BAN_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_BAN_USERS">;
|
|
893
|
+
YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS">;
|
|
894
|
+
YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS">;
|
|
895
|
+
YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS">;
|
|
896
|
+
YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD">;
|
|
897
|
+
BANNED_USER: import("better-auth").RawError<"BANNED_USER">;
|
|
898
|
+
YOU_ARE_NOT_ALLOWED_TO_GET_USER: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_GET_USER">;
|
|
899
|
+
NO_DATA_TO_UPDATE: import("better-auth").RawError<"NO_DATA_TO_UPDATE">;
|
|
900
|
+
YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS">;
|
|
901
|
+
YOU_CANNOT_REMOVE_YOURSELF: import("better-auth").RawError<"YOU_CANNOT_REMOVE_YOURSELF">;
|
|
902
|
+
YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE">;
|
|
903
|
+
YOU_CANNOT_IMPERSONATE_ADMINS: import("better-auth").RawError<"YOU_CANNOT_IMPERSONATE_ADMINS">;
|
|
904
|
+
INVALID_ROLE_TYPE: import("better-auth").RawError<"INVALID_ROLE_TYPE">;
|
|
905
|
+
};
|
|
906
|
+
schema: {
|
|
907
|
+
user: {
|
|
908
|
+
fields: {
|
|
909
|
+
role: {
|
|
910
|
+
type: "string";
|
|
911
|
+
required: false;
|
|
912
|
+
input: false;
|
|
913
|
+
};
|
|
914
|
+
banned: {
|
|
915
|
+
type: "boolean";
|
|
916
|
+
defaultValue: false;
|
|
917
|
+
required: false;
|
|
918
|
+
input: false;
|
|
919
|
+
};
|
|
920
|
+
banReason: {
|
|
921
|
+
type: "string";
|
|
922
|
+
required: false;
|
|
923
|
+
input: false;
|
|
924
|
+
};
|
|
925
|
+
banExpires: {
|
|
926
|
+
type: "date";
|
|
927
|
+
required: false;
|
|
928
|
+
input: false;
|
|
929
|
+
};
|
|
930
|
+
};
|
|
931
|
+
};
|
|
932
|
+
session: {
|
|
933
|
+
fields: {
|
|
934
|
+
impersonatedBy: {
|
|
935
|
+
type: "string";
|
|
936
|
+
required: false;
|
|
937
|
+
};
|
|
938
|
+
};
|
|
939
|
+
};
|
|
940
|
+
};
|
|
941
|
+
options: NoInfer<{
|
|
942
|
+
ac: {
|
|
943
|
+
newRole<K extends string | number>(statements: import("better-auth/plugins").Subset<K, import("better-auth/plugins").Statements>): {
|
|
944
|
+
authorize<K_1 extends K>(request: K_1 extends infer T extends K_2 ? { [key in T]?: import("better-auth/plugins").Subset<K, import("better-auth/plugins").Statements>[key] | {
|
|
945
|
+
actions: import("better-auth/plugins").Subset<K, import("better-auth/plugins").Statements>[key];
|
|
946
|
+
connector: "OR" | "AND";
|
|
947
|
+
} | undefined; } : never, connector?: "OR" | "AND"): import("better-auth/plugins").AuthorizeResponse;
|
|
948
|
+
statements: import("better-auth/plugins").Subset<K, import("better-auth/plugins").Statements>;
|
|
949
|
+
};
|
|
950
|
+
statements: import("better-auth/plugins").Statements;
|
|
951
|
+
};
|
|
952
|
+
roles: Record<string, any>;
|
|
953
|
+
}>;
|
|
954
|
+
} | {
|
|
955
|
+
id: "api-key";
|
|
956
|
+
$ERROR_CODES: {
|
|
957
|
+
INVALID_METADATA_TYPE: import("better-auth").RawError<"INVALID_METADATA_TYPE">;
|
|
958
|
+
REFILL_AMOUNT_AND_INTERVAL_REQUIRED: import("better-auth").RawError<"REFILL_AMOUNT_AND_INTERVAL_REQUIRED">;
|
|
959
|
+
REFILL_INTERVAL_AND_AMOUNT_REQUIRED: import("better-auth").RawError<"REFILL_INTERVAL_AND_AMOUNT_REQUIRED">;
|
|
960
|
+
USER_BANNED: import("better-auth").RawError<"USER_BANNED">;
|
|
961
|
+
UNAUTHORIZED_SESSION: import("better-auth").RawError<"UNAUTHORIZED_SESSION">;
|
|
962
|
+
KEY_NOT_FOUND: import("better-auth").RawError<"KEY_NOT_FOUND">;
|
|
963
|
+
KEY_DISABLED: import("better-auth").RawError<"KEY_DISABLED">;
|
|
964
|
+
KEY_EXPIRED: import("better-auth").RawError<"KEY_EXPIRED">;
|
|
965
|
+
USAGE_EXCEEDED: import("better-auth").RawError<"USAGE_EXCEEDED">;
|
|
966
|
+
KEY_NOT_RECOVERABLE: import("better-auth").RawError<"KEY_NOT_RECOVERABLE">;
|
|
967
|
+
EXPIRES_IN_IS_TOO_SMALL: import("better-auth").RawError<"EXPIRES_IN_IS_TOO_SMALL">;
|
|
968
|
+
EXPIRES_IN_IS_TOO_LARGE: import("better-auth").RawError<"EXPIRES_IN_IS_TOO_LARGE">;
|
|
969
|
+
INVALID_REMAINING: import("better-auth").RawError<"INVALID_REMAINING">;
|
|
970
|
+
INVALID_PREFIX_LENGTH: import("better-auth").RawError<"INVALID_PREFIX_LENGTH">;
|
|
971
|
+
INVALID_NAME_LENGTH: import("better-auth").RawError<"INVALID_NAME_LENGTH">;
|
|
972
|
+
METADATA_DISABLED: import("better-auth").RawError<"METADATA_DISABLED">;
|
|
973
|
+
RATE_LIMIT_EXCEEDED: import("better-auth").RawError<"RATE_LIMIT_EXCEEDED">;
|
|
974
|
+
NO_VALUES_TO_UPDATE: import("better-auth").RawError<"NO_VALUES_TO_UPDATE">;
|
|
975
|
+
KEY_DISABLED_EXPIRATION: import("better-auth").RawError<"KEY_DISABLED_EXPIRATION">;
|
|
976
|
+
INVALID_API_KEY: import("better-auth").RawError<"INVALID_API_KEY">;
|
|
977
|
+
INVALID_USER_ID_FROM_API_KEY: import("better-auth").RawError<"INVALID_USER_ID_FROM_API_KEY">;
|
|
978
|
+
INVALID_REFERENCE_ID_FROM_API_KEY: import("better-auth").RawError<"INVALID_REFERENCE_ID_FROM_API_KEY">;
|
|
979
|
+
INVALID_API_KEY_GETTER_RETURN_TYPE: import("better-auth").RawError<"INVALID_API_KEY_GETTER_RETURN_TYPE">;
|
|
980
|
+
SERVER_ONLY_PROPERTY: import("better-auth").RawError<"SERVER_ONLY_PROPERTY">;
|
|
981
|
+
FAILED_TO_UPDATE_API_KEY: import("better-auth").RawError<"FAILED_TO_UPDATE_API_KEY">;
|
|
982
|
+
NAME_REQUIRED: import("better-auth").RawError<"NAME_REQUIRED">;
|
|
983
|
+
ORGANIZATION_ID_REQUIRED: import("better-auth").RawError<"ORGANIZATION_ID_REQUIRED">;
|
|
984
|
+
USER_NOT_MEMBER_OF_ORGANIZATION: import("better-auth").RawError<"USER_NOT_MEMBER_OF_ORGANIZATION">;
|
|
985
|
+
INSUFFICIENT_API_KEY_PERMISSIONS: import("better-auth").RawError<"INSUFFICIENT_API_KEY_PERMISSIONS">;
|
|
986
|
+
NO_DEFAULT_API_KEY_CONFIGURATION_FOUND: import("better-auth").RawError<"NO_DEFAULT_API_KEY_CONFIGURATION_FOUND">;
|
|
987
|
+
ORGANIZATION_PLUGIN_REQUIRED: import("better-auth").RawError<"ORGANIZATION_PLUGIN_REQUIRED">;
|
|
988
|
+
};
|
|
989
|
+
hooks: {
|
|
990
|
+
before: {
|
|
991
|
+
matcher: (ctx: import("better-auth").HookEndpointContext) => boolean;
|
|
992
|
+
handler: (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
993
|
+
user: {
|
|
994
|
+
id: string;
|
|
995
|
+
createdAt: Date;
|
|
996
|
+
updatedAt: Date;
|
|
997
|
+
email: string;
|
|
998
|
+
emailVerified: boolean;
|
|
999
|
+
name: string;
|
|
1000
|
+
image?: string | null | undefined;
|
|
1001
|
+
};
|
|
1002
|
+
session: {
|
|
1003
|
+
id: string;
|
|
1004
|
+
token: string;
|
|
1005
|
+
userId: string;
|
|
1006
|
+
userAgent: string | null;
|
|
1007
|
+
ipAddress: string | null;
|
|
1008
|
+
createdAt: Date;
|
|
1009
|
+
updatedAt: Date;
|
|
1010
|
+
expiresAt: Date;
|
|
1011
|
+
};
|
|
1012
|
+
} | {
|
|
1013
|
+
context: import("better-call").MiddlewareContext<import("better-call").MiddlewareOptions, {
|
|
1014
|
+
returned?: unknown | undefined;
|
|
1015
|
+
responseHeaders?: Headers | undefined;
|
|
1016
|
+
} & import("better-auth").PluginContext<import("better-auth").BetterAuthOptions> & import("better-auth").InfoContext & {
|
|
1017
|
+
options: import("better-auth").BetterAuthOptions;
|
|
1018
|
+
trustedOrigins: string[];
|
|
1019
|
+
trustedProviders: string[];
|
|
1020
|
+
isTrustedOrigin: (url: string, settings?: {
|
|
1021
|
+
allowRelativePaths: boolean;
|
|
1022
|
+
}) => boolean;
|
|
1023
|
+
oauthConfig: {
|
|
1024
|
+
skipStateCookieCheck?: boolean | undefined;
|
|
1025
|
+
storeStateStrategy: "database" | "cookie";
|
|
1026
|
+
};
|
|
1027
|
+
newSession: {
|
|
1028
|
+
session: {
|
|
1029
|
+
id: string;
|
|
1030
|
+
createdAt: Date;
|
|
1031
|
+
updatedAt: Date;
|
|
1032
|
+
userId: string;
|
|
1033
|
+
expiresAt: Date;
|
|
1034
|
+
token: string;
|
|
1035
|
+
ipAddress?: string | null | undefined;
|
|
1036
|
+
userAgent?: string | null | undefined;
|
|
1037
|
+
} & Record<string, any>;
|
|
1038
|
+
user: {
|
|
1039
|
+
id: string;
|
|
1040
|
+
createdAt: Date;
|
|
1041
|
+
updatedAt: Date;
|
|
1042
|
+
email: string;
|
|
1043
|
+
emailVerified: boolean;
|
|
1044
|
+
name: string;
|
|
1045
|
+
image?: string | null | undefined;
|
|
1046
|
+
} & Record<string, any>;
|
|
1047
|
+
} | null;
|
|
1048
|
+
session: {
|
|
1049
|
+
session: {
|
|
1050
|
+
id: string;
|
|
1051
|
+
createdAt: Date;
|
|
1052
|
+
updatedAt: Date;
|
|
1053
|
+
userId: string;
|
|
1054
|
+
expiresAt: Date;
|
|
1055
|
+
token: string;
|
|
1056
|
+
ipAddress?: string | null | undefined;
|
|
1057
|
+
userAgent?: string | null | undefined;
|
|
1058
|
+
} & Record<string, any>;
|
|
1059
|
+
user: {
|
|
1060
|
+
id: string;
|
|
1061
|
+
createdAt: Date;
|
|
1062
|
+
updatedAt: Date;
|
|
1063
|
+
email: string;
|
|
1064
|
+
emailVerified: boolean;
|
|
1065
|
+
name: string;
|
|
1066
|
+
image?: string | null | undefined;
|
|
1067
|
+
} & Record<string, any>;
|
|
1068
|
+
} | null;
|
|
1069
|
+
setNewSession: (session: {
|
|
1070
|
+
session: {
|
|
1071
|
+
id: string;
|
|
1072
|
+
createdAt: Date;
|
|
1073
|
+
updatedAt: Date;
|
|
1074
|
+
userId: string;
|
|
1075
|
+
expiresAt: Date;
|
|
1076
|
+
token: string;
|
|
1077
|
+
ipAddress?: string | null | undefined;
|
|
1078
|
+
userAgent?: string | null | undefined;
|
|
1079
|
+
} & Record<string, any>;
|
|
1080
|
+
user: {
|
|
1081
|
+
id: string;
|
|
1082
|
+
createdAt: Date;
|
|
1083
|
+
updatedAt: Date;
|
|
1084
|
+
email: string;
|
|
1085
|
+
emailVerified: boolean;
|
|
1086
|
+
name: string;
|
|
1087
|
+
image?: string | null | undefined;
|
|
1088
|
+
} & Record<string, any>;
|
|
1089
|
+
} | null) => void;
|
|
1090
|
+
socialProviders: import("better-auth").OAuthProvider[];
|
|
1091
|
+
authCookies: import("better-auth").BetterAuthCookies;
|
|
1092
|
+
logger: ReturnType<(options?: import("better-auth").Logger | undefined) => import("better-auth").InternalLogger>;
|
|
1093
|
+
rateLimit: {
|
|
1094
|
+
enabled: boolean;
|
|
1095
|
+
window: number;
|
|
1096
|
+
max: number;
|
|
1097
|
+
storage: "memory" | "database" | "secondary-storage";
|
|
1098
|
+
} & Omit<import("better-auth").BetterAuthRateLimitOptions, "enabled" | "window" | "max" | "storage">;
|
|
1099
|
+
adapter: import("better-auth").DBAdapter<import("better-auth").BetterAuthOptions>;
|
|
1100
|
+
internalAdapter: import("better-auth").InternalAdapter<import("better-auth").BetterAuthOptions>;
|
|
1101
|
+
createAuthCookie: (cookieName: string, overrideAttributes?: Partial<import("better-call").CookieOptions> | undefined) => import("better-auth").BetterAuthCookie;
|
|
1102
|
+
secret: string;
|
|
1103
|
+
secretConfig: string | import("better-auth").SecretConfig;
|
|
1104
|
+
sessionConfig: {
|
|
1105
|
+
updateAge: number;
|
|
1106
|
+
expiresIn: number;
|
|
1107
|
+
freshAge: number;
|
|
1108
|
+
cookieRefreshCache: false | {
|
|
1109
|
+
enabled: true;
|
|
1110
|
+
updateAge: number;
|
|
1111
|
+
};
|
|
1112
|
+
};
|
|
1113
|
+
generateId: (options: {
|
|
1114
|
+
model: import("better-auth").ModelNames;
|
|
1115
|
+
size?: number | undefined;
|
|
1116
|
+
}) => string | false;
|
|
1117
|
+
secondaryStorage: import("better-auth").SecondaryStorage | undefined;
|
|
1118
|
+
password: {
|
|
1119
|
+
hash: (password: string) => Promise<string>;
|
|
1120
|
+
verify: (data: {
|
|
1121
|
+
password: string;
|
|
1122
|
+
hash: string;
|
|
1123
|
+
}) => Promise<boolean>;
|
|
1124
|
+
config: {
|
|
1125
|
+
minPasswordLength: number;
|
|
1126
|
+
maxPasswordLength: number;
|
|
1127
|
+
};
|
|
1128
|
+
checkPassword: (userId: string, ctx: import("better-auth").GenericEndpointContext<import("better-auth").BetterAuthOptions>) => Promise<boolean>;
|
|
1129
|
+
};
|
|
1130
|
+
tables: import("better-auth").BetterAuthDBSchema;
|
|
1131
|
+
runMigrations: () => Promise<void>;
|
|
1132
|
+
publishTelemetry: (event: {
|
|
1133
|
+
type: string;
|
|
1134
|
+
anonymousId?: string | undefined;
|
|
1135
|
+
payload: Record<string, any>;
|
|
1136
|
+
}) => Promise<void>;
|
|
1137
|
+
skipOriginCheck: boolean | string[];
|
|
1138
|
+
skipCSRFCheck: boolean;
|
|
1139
|
+
runInBackground: (promise: Promise<unknown>) => void;
|
|
1140
|
+
runInBackgroundOrAwait: (promise: Promise<unknown> | void) => import("better-auth").Awaitable<unknown>;
|
|
1141
|
+
}>;
|
|
1142
|
+
}>;
|
|
1143
|
+
}[];
|
|
1144
|
+
};
|
|
1145
|
+
endpoints: {
|
|
1146
|
+
createApiKey: import("better-call").StrictEndpoint<"/api-key/create", {
|
|
1147
|
+
method: "POST";
|
|
1148
|
+
body: import("zod").ZodObject<{
|
|
1149
|
+
configId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1150
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1151
|
+
expiresIn: import("zod").ZodDefault<import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodNumber>>>;
|
|
1152
|
+
prefix: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1153
|
+
remaining: import("zod").ZodDefault<import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodNumber>>>;
|
|
1154
|
+
metadata: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
1155
|
+
refillAmount: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
1156
|
+
refillInterval: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
1157
|
+
rateLimitTimeWindow: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
1158
|
+
rateLimitMax: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
1159
|
+
rateLimitEnabled: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
1160
|
+
permissions: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>>>;
|
|
1161
|
+
userId: import("zod").ZodOptional<import("zod").ZodCoercedString<unknown>>;
|
|
1162
|
+
organizationId: import("zod").ZodOptional<import("zod").ZodCoercedString<unknown>>;
|
|
1163
|
+
}, import("better-auth").$strip>;
|
|
1164
|
+
metadata: {
|
|
1165
|
+
openapi: {
|
|
1166
|
+
description: string;
|
|
1167
|
+
responses: {
|
|
1168
|
+
"200": {
|
|
1169
|
+
description: string;
|
|
1170
|
+
content: {
|
|
1171
|
+
"application/json": {
|
|
1172
|
+
schema: {
|
|
1173
|
+
type: "object";
|
|
1174
|
+
properties: {
|
|
1175
|
+
id: {
|
|
1176
|
+
type: string;
|
|
1177
|
+
description: string;
|
|
1178
|
+
};
|
|
1179
|
+
createdAt: {
|
|
1180
|
+
type: string;
|
|
1181
|
+
format: string;
|
|
1182
|
+
description: string;
|
|
1183
|
+
};
|
|
1184
|
+
updatedAt: {
|
|
1185
|
+
type: string;
|
|
1186
|
+
format: string;
|
|
1187
|
+
description: string;
|
|
1188
|
+
};
|
|
1189
|
+
name: {
|
|
1190
|
+
type: string;
|
|
1191
|
+
nullable: boolean;
|
|
1192
|
+
description: string;
|
|
1193
|
+
};
|
|
1194
|
+
prefix: {
|
|
1195
|
+
type: string;
|
|
1196
|
+
nullable: boolean;
|
|
1197
|
+
description: string;
|
|
1198
|
+
};
|
|
1199
|
+
start: {
|
|
1200
|
+
type: string;
|
|
1201
|
+
nullable: boolean;
|
|
1202
|
+
description: string;
|
|
1203
|
+
};
|
|
1204
|
+
key: {
|
|
1205
|
+
type: string;
|
|
1206
|
+
description: string;
|
|
1207
|
+
};
|
|
1208
|
+
enabled: {
|
|
1209
|
+
type: string;
|
|
1210
|
+
description: string;
|
|
1211
|
+
};
|
|
1212
|
+
expiresAt: {
|
|
1213
|
+
type: string;
|
|
1214
|
+
format: string;
|
|
1215
|
+
nullable: boolean;
|
|
1216
|
+
description: string;
|
|
1217
|
+
};
|
|
1218
|
+
referenceId: {
|
|
1219
|
+
type: string;
|
|
1220
|
+
description: string;
|
|
1221
|
+
};
|
|
1222
|
+
lastRefillAt: {
|
|
1223
|
+
type: string;
|
|
1224
|
+
format: string;
|
|
1225
|
+
nullable: boolean;
|
|
1226
|
+
description: string;
|
|
1227
|
+
};
|
|
1228
|
+
lastRequest: {
|
|
1229
|
+
type: string;
|
|
1230
|
+
format: string;
|
|
1231
|
+
nullable: boolean;
|
|
1232
|
+
description: string;
|
|
1233
|
+
};
|
|
1234
|
+
metadata: {
|
|
1235
|
+
type: string;
|
|
1236
|
+
nullable: boolean;
|
|
1237
|
+
additionalProperties: boolean;
|
|
1238
|
+
description: string;
|
|
1239
|
+
};
|
|
1240
|
+
rateLimitMax: {
|
|
1241
|
+
type: string;
|
|
1242
|
+
nullable: boolean;
|
|
1243
|
+
description: string;
|
|
1244
|
+
};
|
|
1245
|
+
rateLimitTimeWindow: {
|
|
1246
|
+
type: string;
|
|
1247
|
+
nullable: boolean;
|
|
1248
|
+
description: string;
|
|
1249
|
+
};
|
|
1250
|
+
remaining: {
|
|
1251
|
+
type: string;
|
|
1252
|
+
nullable: boolean;
|
|
1253
|
+
description: string;
|
|
1254
|
+
};
|
|
1255
|
+
refillAmount: {
|
|
1256
|
+
type: string;
|
|
1257
|
+
nullable: boolean;
|
|
1258
|
+
description: string;
|
|
1259
|
+
};
|
|
1260
|
+
refillInterval: {
|
|
1261
|
+
type: string;
|
|
1262
|
+
nullable: boolean;
|
|
1263
|
+
description: string;
|
|
1264
|
+
};
|
|
1265
|
+
rateLimitEnabled: {
|
|
1266
|
+
type: string;
|
|
1267
|
+
description: string;
|
|
1268
|
+
};
|
|
1269
|
+
requestCount: {
|
|
1270
|
+
type: string;
|
|
1271
|
+
description: string;
|
|
1272
|
+
};
|
|
1273
|
+
permissions: {
|
|
1274
|
+
type: string;
|
|
1275
|
+
nullable: boolean;
|
|
1276
|
+
additionalProperties: {
|
|
1277
|
+
type: string;
|
|
1278
|
+
items: {
|
|
1279
|
+
type: string;
|
|
1280
|
+
};
|
|
1281
|
+
};
|
|
1282
|
+
description: string;
|
|
1283
|
+
};
|
|
1284
|
+
};
|
|
1285
|
+
required: string[];
|
|
1286
|
+
};
|
|
1287
|
+
};
|
|
1288
|
+
};
|
|
1289
|
+
};
|
|
1290
|
+
};
|
|
1291
|
+
};
|
|
1292
|
+
};
|
|
1293
|
+
}, {
|
|
1294
|
+
key: string;
|
|
1295
|
+
metadata: any;
|
|
1296
|
+
permissions: any;
|
|
1297
|
+
id: string;
|
|
1298
|
+
configId: string;
|
|
1299
|
+
name: string | null;
|
|
1300
|
+
start: string | null;
|
|
1301
|
+
prefix: string | null;
|
|
1302
|
+
referenceId: string;
|
|
1303
|
+
refillInterval: number | null;
|
|
1304
|
+
refillAmount: number | null;
|
|
1305
|
+
lastRefillAt: Date | null;
|
|
1306
|
+
enabled: boolean;
|
|
1307
|
+
rateLimitEnabled: boolean;
|
|
1308
|
+
rateLimitTimeWindow: number | null;
|
|
1309
|
+
rateLimitMax: number | null;
|
|
1310
|
+
requestCount: number;
|
|
1311
|
+
remaining: number | null;
|
|
1312
|
+
lastRequest: Date | null;
|
|
1313
|
+
expiresAt: Date | null;
|
|
1314
|
+
createdAt: Date;
|
|
1315
|
+
updatedAt: Date;
|
|
1316
|
+
}>;
|
|
1317
|
+
verifyApiKey: import("better-call").StrictEndpoint<string, {
|
|
1318
|
+
method: "POST";
|
|
1319
|
+
body: import("zod").ZodObject<{
|
|
1320
|
+
configId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1321
|
+
key: import("zod").ZodString;
|
|
1322
|
+
permissions: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>>>;
|
|
1323
|
+
}, import("better-auth").$strip>;
|
|
1324
|
+
}, {
|
|
1325
|
+
valid: boolean;
|
|
1326
|
+
error: {
|
|
1327
|
+
message: import("better-auth").RawError<"INVALID_API_KEY">;
|
|
1328
|
+
code: "KEY_NOT_FOUND";
|
|
1329
|
+
};
|
|
1330
|
+
key: null;
|
|
1331
|
+
} | {
|
|
1332
|
+
valid: boolean;
|
|
1333
|
+
error: {
|
|
1334
|
+
message: string | undefined;
|
|
1335
|
+
code: string;
|
|
1336
|
+
cause?: unknown;
|
|
1337
|
+
};
|
|
1338
|
+
key: null;
|
|
1339
|
+
} | {
|
|
1340
|
+
valid: boolean;
|
|
1341
|
+
error: {
|
|
1342
|
+
message: import("better-auth").RawError<"INVALID_API_KEY">;
|
|
1343
|
+
code: "INVALID_API_KEY";
|
|
1344
|
+
};
|
|
1345
|
+
key: null;
|
|
1346
|
+
} | {
|
|
1347
|
+
valid: boolean;
|
|
1348
|
+
error: null;
|
|
1349
|
+
key: Omit<import("@better-auth/api-key").ApiKey, "key"> | null;
|
|
1350
|
+
}>;
|
|
1351
|
+
getApiKey: import("better-call").StrictEndpoint<"/api-key/get", {
|
|
1352
|
+
method: "GET";
|
|
1353
|
+
query: import("zod").ZodObject<{
|
|
1354
|
+
configId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1355
|
+
id: import("zod").ZodString;
|
|
1356
|
+
}, import("better-auth").$strip>;
|
|
1357
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
1358
|
+
session: {
|
|
1359
|
+
session: Record<string, any> & {
|
|
1360
|
+
id: string;
|
|
1361
|
+
createdAt: Date;
|
|
1362
|
+
updatedAt: Date;
|
|
1363
|
+
userId: string;
|
|
1364
|
+
expiresAt: Date;
|
|
1365
|
+
token: string;
|
|
1366
|
+
ipAddress?: string | null | undefined;
|
|
1367
|
+
userAgent?: string | null | undefined;
|
|
1368
|
+
};
|
|
1369
|
+
user: Record<string, any> & {
|
|
1370
|
+
id: string;
|
|
1371
|
+
createdAt: Date;
|
|
1372
|
+
updatedAt: Date;
|
|
1373
|
+
email: string;
|
|
1374
|
+
emailVerified: boolean;
|
|
1375
|
+
name: string;
|
|
1376
|
+
image?: string | null | undefined;
|
|
1377
|
+
};
|
|
1378
|
+
};
|
|
1379
|
+
}>)[];
|
|
1380
|
+
metadata: {
|
|
1381
|
+
openapi: {
|
|
1382
|
+
description: string;
|
|
1383
|
+
responses: {
|
|
1384
|
+
"200": {
|
|
1385
|
+
description: string;
|
|
1386
|
+
content: {
|
|
1387
|
+
"application/json": {
|
|
1388
|
+
schema: {
|
|
1389
|
+
type: "object";
|
|
1390
|
+
properties: {
|
|
1391
|
+
id: {
|
|
1392
|
+
type: string;
|
|
1393
|
+
description: string;
|
|
1394
|
+
};
|
|
1395
|
+
name: {
|
|
1396
|
+
type: string;
|
|
1397
|
+
nullable: boolean;
|
|
1398
|
+
description: string;
|
|
1399
|
+
};
|
|
1400
|
+
start: {
|
|
1401
|
+
type: string;
|
|
1402
|
+
nullable: boolean;
|
|
1403
|
+
description: string;
|
|
1404
|
+
};
|
|
1405
|
+
prefix: {
|
|
1406
|
+
type: string;
|
|
1407
|
+
nullable: boolean;
|
|
1408
|
+
description: string;
|
|
1409
|
+
};
|
|
1410
|
+
userId: {
|
|
1411
|
+
type: string;
|
|
1412
|
+
description: string;
|
|
1413
|
+
};
|
|
1414
|
+
refillInterval: {
|
|
1415
|
+
type: string;
|
|
1416
|
+
nullable: boolean;
|
|
1417
|
+
description: string;
|
|
1418
|
+
};
|
|
1419
|
+
refillAmount: {
|
|
1420
|
+
type: string;
|
|
1421
|
+
nullable: boolean;
|
|
1422
|
+
description: string;
|
|
1423
|
+
};
|
|
1424
|
+
lastRefillAt: {
|
|
1425
|
+
type: string;
|
|
1426
|
+
format: string;
|
|
1427
|
+
nullable: boolean;
|
|
1428
|
+
description: string;
|
|
1429
|
+
};
|
|
1430
|
+
enabled: {
|
|
1431
|
+
type: string;
|
|
1432
|
+
description: string;
|
|
1433
|
+
default: boolean;
|
|
1434
|
+
};
|
|
1435
|
+
rateLimitEnabled: {
|
|
1436
|
+
type: string;
|
|
1437
|
+
description: string;
|
|
1438
|
+
};
|
|
1439
|
+
rateLimitTimeWindow: {
|
|
1440
|
+
type: string;
|
|
1441
|
+
nullable: boolean;
|
|
1442
|
+
description: string;
|
|
1443
|
+
};
|
|
1444
|
+
rateLimitMax: {
|
|
1445
|
+
type: string;
|
|
1446
|
+
nullable: boolean;
|
|
1447
|
+
description: string;
|
|
1448
|
+
};
|
|
1449
|
+
requestCount: {
|
|
1450
|
+
type: string;
|
|
1451
|
+
description: string;
|
|
1452
|
+
};
|
|
1453
|
+
remaining: {
|
|
1454
|
+
type: string;
|
|
1455
|
+
nullable: boolean;
|
|
1456
|
+
description: string;
|
|
1457
|
+
};
|
|
1458
|
+
lastRequest: {
|
|
1459
|
+
type: string;
|
|
1460
|
+
format: string;
|
|
1461
|
+
nullable: boolean;
|
|
1462
|
+
description: string;
|
|
1463
|
+
};
|
|
1464
|
+
expiresAt: {
|
|
1465
|
+
type: string;
|
|
1466
|
+
format: string;
|
|
1467
|
+
nullable: boolean;
|
|
1468
|
+
description: string;
|
|
1469
|
+
};
|
|
1470
|
+
createdAt: {
|
|
1471
|
+
type: string;
|
|
1472
|
+
format: string;
|
|
1473
|
+
description: string;
|
|
1474
|
+
};
|
|
1475
|
+
updatedAt: {
|
|
1476
|
+
type: string;
|
|
1477
|
+
format: string;
|
|
1478
|
+
description: string;
|
|
1479
|
+
};
|
|
1480
|
+
metadata: {
|
|
1481
|
+
type: string;
|
|
1482
|
+
nullable: boolean;
|
|
1483
|
+
additionalProperties: boolean;
|
|
1484
|
+
description: string;
|
|
1485
|
+
};
|
|
1486
|
+
permissions: {
|
|
1487
|
+
type: string;
|
|
1488
|
+
nullable: boolean;
|
|
1489
|
+
description: string;
|
|
1490
|
+
};
|
|
1491
|
+
};
|
|
1492
|
+
required: string[];
|
|
1493
|
+
};
|
|
1494
|
+
};
|
|
1495
|
+
};
|
|
1496
|
+
};
|
|
1497
|
+
};
|
|
1498
|
+
};
|
|
1499
|
+
};
|
|
1500
|
+
}, {
|
|
1501
|
+
metadata: Record<string, any> | null;
|
|
1502
|
+
permissions: {
|
|
1503
|
+
[key: string]: string[];
|
|
1504
|
+
} | null;
|
|
1505
|
+
id: string;
|
|
1506
|
+
configId: string;
|
|
1507
|
+
name: string | null;
|
|
1508
|
+
start: string | null;
|
|
1509
|
+
prefix: string | null;
|
|
1510
|
+
referenceId: string;
|
|
1511
|
+
refillInterval: number | null;
|
|
1512
|
+
refillAmount: number | null;
|
|
1513
|
+
lastRefillAt: Date | null;
|
|
1514
|
+
enabled: boolean;
|
|
1515
|
+
rateLimitEnabled: boolean;
|
|
1516
|
+
rateLimitTimeWindow: number | null;
|
|
1517
|
+
rateLimitMax: number | null;
|
|
1518
|
+
requestCount: number;
|
|
1519
|
+
remaining: number | null;
|
|
1520
|
+
lastRequest: Date | null;
|
|
1521
|
+
expiresAt: Date | null;
|
|
1522
|
+
createdAt: Date;
|
|
1523
|
+
updatedAt: Date;
|
|
1524
|
+
}>;
|
|
1525
|
+
updateApiKey: import("better-call").StrictEndpoint<"/api-key/update", {
|
|
1526
|
+
method: "POST";
|
|
1527
|
+
body: import("zod").ZodObject<{
|
|
1528
|
+
configId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1529
|
+
keyId: import("zod").ZodString;
|
|
1530
|
+
userId: import("zod").ZodOptional<import("zod").ZodCoercedString<unknown>>;
|
|
1531
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1532
|
+
enabled: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
1533
|
+
remaining: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
1534
|
+
refillAmount: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
1535
|
+
refillInterval: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
1536
|
+
metadata: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
1537
|
+
expiresIn: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodNumber>>;
|
|
1538
|
+
rateLimitEnabled: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
1539
|
+
rateLimitTimeWindow: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
1540
|
+
rateLimitMax: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
1541
|
+
permissions: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>>>>;
|
|
1542
|
+
}, import("better-auth").$strip>;
|
|
1543
|
+
metadata: {
|
|
1544
|
+
openapi: {
|
|
1545
|
+
description: string;
|
|
1546
|
+
responses: {
|
|
1547
|
+
"200": {
|
|
1548
|
+
description: string;
|
|
1549
|
+
content: {
|
|
1550
|
+
"application/json": {
|
|
1551
|
+
schema: {
|
|
1552
|
+
type: "object";
|
|
1553
|
+
properties: {
|
|
1554
|
+
id: {
|
|
1555
|
+
type: string;
|
|
1556
|
+
description: string;
|
|
1557
|
+
};
|
|
1558
|
+
name: {
|
|
1559
|
+
type: string;
|
|
1560
|
+
nullable: boolean;
|
|
1561
|
+
description: string;
|
|
1562
|
+
};
|
|
1563
|
+
start: {
|
|
1564
|
+
type: string;
|
|
1565
|
+
nullable: boolean;
|
|
1566
|
+
description: string;
|
|
1567
|
+
};
|
|
1568
|
+
prefix: {
|
|
1569
|
+
type: string;
|
|
1570
|
+
nullable: boolean;
|
|
1571
|
+
description: string;
|
|
1572
|
+
};
|
|
1573
|
+
userId: {
|
|
1574
|
+
type: string;
|
|
1575
|
+
description: string;
|
|
1576
|
+
};
|
|
1577
|
+
refillInterval: {
|
|
1578
|
+
type: string;
|
|
1579
|
+
nullable: boolean;
|
|
1580
|
+
description: string;
|
|
1581
|
+
};
|
|
1582
|
+
refillAmount: {
|
|
1583
|
+
type: string;
|
|
1584
|
+
nullable: boolean;
|
|
1585
|
+
description: string;
|
|
1586
|
+
};
|
|
1587
|
+
lastRefillAt: {
|
|
1588
|
+
type: string;
|
|
1589
|
+
format: string;
|
|
1590
|
+
nullable: boolean;
|
|
1591
|
+
description: string;
|
|
1592
|
+
};
|
|
1593
|
+
enabled: {
|
|
1594
|
+
type: string;
|
|
1595
|
+
description: string;
|
|
1596
|
+
default: boolean;
|
|
1597
|
+
};
|
|
1598
|
+
rateLimitEnabled: {
|
|
1599
|
+
type: string;
|
|
1600
|
+
description: string;
|
|
1601
|
+
};
|
|
1602
|
+
rateLimitTimeWindow: {
|
|
1603
|
+
type: string;
|
|
1604
|
+
nullable: boolean;
|
|
1605
|
+
description: string;
|
|
1606
|
+
};
|
|
1607
|
+
rateLimitMax: {
|
|
1608
|
+
type: string;
|
|
1609
|
+
nullable: boolean;
|
|
1610
|
+
description: string;
|
|
1611
|
+
};
|
|
1612
|
+
requestCount: {
|
|
1613
|
+
type: string;
|
|
1614
|
+
description: string;
|
|
1615
|
+
};
|
|
1616
|
+
remaining: {
|
|
1617
|
+
type: string;
|
|
1618
|
+
nullable: boolean;
|
|
1619
|
+
description: string;
|
|
1620
|
+
};
|
|
1621
|
+
lastRequest: {
|
|
1622
|
+
type: string;
|
|
1623
|
+
format: string;
|
|
1624
|
+
nullable: boolean;
|
|
1625
|
+
description: string;
|
|
1626
|
+
};
|
|
1627
|
+
expiresAt: {
|
|
1628
|
+
type: string;
|
|
1629
|
+
format: string;
|
|
1630
|
+
nullable: boolean;
|
|
1631
|
+
description: string;
|
|
1632
|
+
};
|
|
1633
|
+
createdAt: {
|
|
1634
|
+
type: string;
|
|
1635
|
+
format: string;
|
|
1636
|
+
description: string;
|
|
1637
|
+
};
|
|
1638
|
+
updatedAt: {
|
|
1639
|
+
type: string;
|
|
1640
|
+
format: string;
|
|
1641
|
+
description: string;
|
|
1642
|
+
};
|
|
1643
|
+
metadata: {
|
|
1644
|
+
type: string;
|
|
1645
|
+
nullable: boolean;
|
|
1646
|
+
additionalProperties: boolean;
|
|
1647
|
+
description: string;
|
|
1648
|
+
};
|
|
1649
|
+
permissions: {
|
|
1650
|
+
type: string;
|
|
1651
|
+
nullable: boolean;
|
|
1652
|
+
description: string;
|
|
1653
|
+
};
|
|
1654
|
+
};
|
|
1655
|
+
required: string[];
|
|
1656
|
+
};
|
|
1657
|
+
};
|
|
1658
|
+
};
|
|
1659
|
+
};
|
|
1660
|
+
};
|
|
1661
|
+
};
|
|
1662
|
+
};
|
|
1663
|
+
}, {
|
|
1664
|
+
metadata: Record<string, any> | null;
|
|
1665
|
+
permissions: {
|
|
1666
|
+
[key: string]: string[];
|
|
1667
|
+
} | null;
|
|
1668
|
+
id: string;
|
|
1669
|
+
configId: string;
|
|
1670
|
+
name: string | null;
|
|
1671
|
+
start: string | null;
|
|
1672
|
+
prefix: string | null;
|
|
1673
|
+
referenceId: string;
|
|
1674
|
+
refillInterval: number | null;
|
|
1675
|
+
refillAmount: number | null;
|
|
1676
|
+
lastRefillAt: Date | null;
|
|
1677
|
+
enabled: boolean;
|
|
1678
|
+
rateLimitEnabled: boolean;
|
|
1679
|
+
rateLimitTimeWindow: number | null;
|
|
1680
|
+
rateLimitMax: number | null;
|
|
1681
|
+
requestCount: number;
|
|
1682
|
+
remaining: number | null;
|
|
1683
|
+
lastRequest: Date | null;
|
|
1684
|
+
expiresAt: Date | null;
|
|
1685
|
+
createdAt: Date;
|
|
1686
|
+
updatedAt: Date;
|
|
1687
|
+
}>;
|
|
1688
|
+
deleteApiKey: import("better-call").StrictEndpoint<"/api-key/delete", {
|
|
1689
|
+
method: "POST";
|
|
1690
|
+
body: import("zod").ZodObject<{
|
|
1691
|
+
configId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1692
|
+
keyId: import("zod").ZodString;
|
|
1693
|
+
}, import("better-auth").$strip>;
|
|
1694
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
1695
|
+
session: {
|
|
1696
|
+
session: Record<string, any> & {
|
|
1697
|
+
id: string;
|
|
1698
|
+
createdAt: Date;
|
|
1699
|
+
updatedAt: Date;
|
|
1700
|
+
userId: string;
|
|
1701
|
+
expiresAt: Date;
|
|
1702
|
+
token: string;
|
|
1703
|
+
ipAddress?: string | null | undefined;
|
|
1704
|
+
userAgent?: string | null | undefined;
|
|
1705
|
+
};
|
|
1706
|
+
user: Record<string, any> & {
|
|
1707
|
+
id: string;
|
|
1708
|
+
createdAt: Date;
|
|
1709
|
+
updatedAt: Date;
|
|
1710
|
+
email: string;
|
|
1711
|
+
emailVerified: boolean;
|
|
1712
|
+
name: string;
|
|
1713
|
+
image?: string | null | undefined;
|
|
1714
|
+
};
|
|
1715
|
+
};
|
|
1716
|
+
}>)[];
|
|
1717
|
+
metadata: {
|
|
1718
|
+
openapi: {
|
|
1719
|
+
description: string;
|
|
1720
|
+
requestBody: {
|
|
1721
|
+
content: {
|
|
1722
|
+
"application/json": {
|
|
1723
|
+
schema: {
|
|
1724
|
+
type: "object";
|
|
1725
|
+
properties: {
|
|
1726
|
+
keyId: {
|
|
1727
|
+
type: string;
|
|
1728
|
+
description: string;
|
|
1729
|
+
};
|
|
1730
|
+
};
|
|
1731
|
+
required: string[];
|
|
1732
|
+
};
|
|
1733
|
+
};
|
|
1734
|
+
};
|
|
1735
|
+
};
|
|
1736
|
+
responses: {
|
|
1737
|
+
"200": {
|
|
1738
|
+
description: string;
|
|
1739
|
+
content: {
|
|
1740
|
+
"application/json": {
|
|
1741
|
+
schema: {
|
|
1742
|
+
type: "object";
|
|
1743
|
+
properties: {
|
|
1744
|
+
success: {
|
|
1745
|
+
type: string;
|
|
1746
|
+
description: string;
|
|
1747
|
+
};
|
|
1748
|
+
};
|
|
1749
|
+
required: string[];
|
|
1750
|
+
};
|
|
1751
|
+
};
|
|
1752
|
+
};
|
|
1753
|
+
};
|
|
1754
|
+
};
|
|
1755
|
+
};
|
|
1756
|
+
};
|
|
1757
|
+
}, {
|
|
1758
|
+
success: boolean;
|
|
1759
|
+
}>;
|
|
1760
|
+
listApiKeys: import("better-call").StrictEndpoint<"/api-key/list", {
|
|
1761
|
+
method: "GET";
|
|
1762
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
1763
|
+
session: {
|
|
1764
|
+
session: Record<string, any> & {
|
|
1765
|
+
id: string;
|
|
1766
|
+
createdAt: Date;
|
|
1767
|
+
updatedAt: Date;
|
|
1768
|
+
userId: string;
|
|
1769
|
+
expiresAt: Date;
|
|
1770
|
+
token: string;
|
|
1771
|
+
ipAddress?: string | null | undefined;
|
|
1772
|
+
userAgent?: string | null | undefined;
|
|
1773
|
+
};
|
|
1774
|
+
user: Record<string, any> & {
|
|
1775
|
+
id: string;
|
|
1776
|
+
createdAt: Date;
|
|
1777
|
+
updatedAt: Date;
|
|
1778
|
+
email: string;
|
|
1779
|
+
emailVerified: boolean;
|
|
1780
|
+
name: string;
|
|
1781
|
+
image?: string | null | undefined;
|
|
1782
|
+
};
|
|
1783
|
+
};
|
|
1784
|
+
}>)[];
|
|
1785
|
+
query: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
1786
|
+
configId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1787
|
+
organizationId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1788
|
+
limit: import("zod").ZodOptional<import("zod").ZodCoercedNumber<unknown>>;
|
|
1789
|
+
offset: import("zod").ZodOptional<import("zod").ZodCoercedNumber<unknown>>;
|
|
1790
|
+
sortBy: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1791
|
+
sortDirection: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
1792
|
+
asc: "asc";
|
|
1793
|
+
desc: "desc";
|
|
1794
|
+
}>>;
|
|
1795
|
+
}, import("better-auth").$strip>>;
|
|
1796
|
+
metadata: {
|
|
1797
|
+
openapi: {
|
|
1798
|
+
description: string;
|
|
1799
|
+
responses: {
|
|
1800
|
+
"200": {
|
|
1801
|
+
description: string;
|
|
1802
|
+
content: {
|
|
1803
|
+
"application/json": {
|
|
1804
|
+
schema: {
|
|
1805
|
+
type: "object";
|
|
1806
|
+
properties: {
|
|
1807
|
+
apiKeys: {
|
|
1808
|
+
type: string;
|
|
1809
|
+
items: {
|
|
1810
|
+
type: string;
|
|
1811
|
+
properties: {
|
|
1812
|
+
id: {
|
|
1813
|
+
type: string;
|
|
1814
|
+
description: string;
|
|
1815
|
+
};
|
|
1816
|
+
name: {
|
|
1817
|
+
type: string;
|
|
1818
|
+
nullable: boolean;
|
|
1819
|
+
description: string;
|
|
1820
|
+
};
|
|
1821
|
+
start: {
|
|
1822
|
+
type: string;
|
|
1823
|
+
nullable: boolean;
|
|
1824
|
+
description: string;
|
|
1825
|
+
};
|
|
1826
|
+
prefix: {
|
|
1827
|
+
type: string;
|
|
1828
|
+
nullable: boolean;
|
|
1829
|
+
description: string;
|
|
1830
|
+
};
|
|
1831
|
+
userId: {
|
|
1832
|
+
type: string;
|
|
1833
|
+
description: string;
|
|
1834
|
+
};
|
|
1835
|
+
refillInterval: {
|
|
1836
|
+
type: string;
|
|
1837
|
+
nullable: boolean;
|
|
1838
|
+
description: string;
|
|
1839
|
+
};
|
|
1840
|
+
refillAmount: {
|
|
1841
|
+
type: string;
|
|
1842
|
+
nullable: boolean;
|
|
1843
|
+
description: string;
|
|
1844
|
+
};
|
|
1845
|
+
lastRefillAt: {
|
|
1846
|
+
type: string;
|
|
1847
|
+
format: string;
|
|
1848
|
+
nullable: boolean;
|
|
1849
|
+
description: string;
|
|
1850
|
+
};
|
|
1851
|
+
enabled: {
|
|
1852
|
+
type: string;
|
|
1853
|
+
description: string;
|
|
1854
|
+
default: boolean;
|
|
1855
|
+
};
|
|
1856
|
+
rateLimitEnabled: {
|
|
1857
|
+
type: string;
|
|
1858
|
+
description: string;
|
|
1859
|
+
};
|
|
1860
|
+
rateLimitTimeWindow: {
|
|
1861
|
+
type: string;
|
|
1862
|
+
nullable: boolean;
|
|
1863
|
+
description: string;
|
|
1864
|
+
};
|
|
1865
|
+
rateLimitMax: {
|
|
1866
|
+
type: string;
|
|
1867
|
+
nullable: boolean;
|
|
1868
|
+
description: string;
|
|
1869
|
+
};
|
|
1870
|
+
requestCount: {
|
|
1871
|
+
type: string;
|
|
1872
|
+
description: string;
|
|
1873
|
+
};
|
|
1874
|
+
remaining: {
|
|
1875
|
+
type: string;
|
|
1876
|
+
nullable: boolean;
|
|
1877
|
+
description: string;
|
|
1878
|
+
};
|
|
1879
|
+
lastRequest: {
|
|
1880
|
+
type: string;
|
|
1881
|
+
format: string;
|
|
1882
|
+
nullable: boolean;
|
|
1883
|
+
description: string;
|
|
1884
|
+
};
|
|
1885
|
+
expiresAt: {
|
|
1886
|
+
type: string;
|
|
1887
|
+
format: string;
|
|
1888
|
+
nullable: boolean;
|
|
1889
|
+
description: string;
|
|
1890
|
+
};
|
|
1891
|
+
createdAt: {
|
|
1892
|
+
type: string;
|
|
1893
|
+
format: string;
|
|
1894
|
+
description: string;
|
|
1895
|
+
};
|
|
1896
|
+
updatedAt: {
|
|
1897
|
+
type: string;
|
|
1898
|
+
format: string;
|
|
1899
|
+
description: string;
|
|
1900
|
+
};
|
|
1901
|
+
metadata: {
|
|
1902
|
+
type: string;
|
|
1903
|
+
nullable: boolean;
|
|
1904
|
+
additionalProperties: boolean;
|
|
1905
|
+
description: string;
|
|
1906
|
+
};
|
|
1907
|
+
permissions: {
|
|
1908
|
+
type: string;
|
|
1909
|
+
nullable: boolean;
|
|
1910
|
+
description: string;
|
|
1911
|
+
};
|
|
1912
|
+
};
|
|
1913
|
+
required: string[];
|
|
1914
|
+
};
|
|
1915
|
+
};
|
|
1916
|
+
total: {
|
|
1917
|
+
type: string;
|
|
1918
|
+
description: string;
|
|
1919
|
+
};
|
|
1920
|
+
limit: {
|
|
1921
|
+
type: string;
|
|
1922
|
+
nullable: boolean;
|
|
1923
|
+
description: string;
|
|
1924
|
+
};
|
|
1925
|
+
offset: {
|
|
1926
|
+
type: string;
|
|
1927
|
+
nullable: boolean;
|
|
1928
|
+
description: string;
|
|
1929
|
+
};
|
|
1930
|
+
};
|
|
1931
|
+
required: string[];
|
|
1932
|
+
};
|
|
1933
|
+
};
|
|
1934
|
+
};
|
|
1935
|
+
};
|
|
1936
|
+
};
|
|
1937
|
+
};
|
|
1938
|
+
};
|
|
1939
|
+
}, {
|
|
1940
|
+
apiKeys: {
|
|
1941
|
+
metadata: Record<string, any> | null;
|
|
1942
|
+
permissions: {
|
|
1943
|
+
[key: string]: string[];
|
|
1944
|
+
} | null;
|
|
1945
|
+
id: string;
|
|
1946
|
+
configId: string;
|
|
1947
|
+
name: string | null;
|
|
1948
|
+
start: string | null;
|
|
1949
|
+
prefix: string | null;
|
|
1950
|
+
referenceId: string;
|
|
1951
|
+
refillInterval: number | null;
|
|
1952
|
+
refillAmount: number | null;
|
|
1953
|
+
lastRefillAt: Date | null;
|
|
1954
|
+
enabled: boolean;
|
|
1955
|
+
rateLimitEnabled: boolean;
|
|
1956
|
+
rateLimitTimeWindow: number | null;
|
|
1957
|
+
rateLimitMax: number | null;
|
|
1958
|
+
requestCount: number;
|
|
1959
|
+
remaining: number | null;
|
|
1960
|
+
lastRequest: Date | null;
|
|
1961
|
+
expiresAt: Date | null;
|
|
1962
|
+
createdAt: Date;
|
|
1963
|
+
updatedAt: Date;
|
|
1964
|
+
}[];
|
|
1965
|
+
total: number;
|
|
1966
|
+
limit: number | undefined;
|
|
1967
|
+
offset: number | undefined;
|
|
1968
|
+
}>;
|
|
1969
|
+
deleteAllExpiredApiKeys: import("better-call").StrictEndpoint<string, {
|
|
1970
|
+
method: "POST";
|
|
1971
|
+
}, {
|
|
1972
|
+
success: boolean;
|
|
1973
|
+
error: unknown;
|
|
1974
|
+
}>;
|
|
1975
|
+
};
|
|
1976
|
+
schema: {
|
|
1977
|
+
apikey: {
|
|
1978
|
+
fields: {
|
|
1979
|
+
configId: {
|
|
1980
|
+
type: "string";
|
|
1981
|
+
required: true;
|
|
1982
|
+
defaultValue: string;
|
|
1983
|
+
input: false;
|
|
1984
|
+
index: true;
|
|
1985
|
+
};
|
|
1986
|
+
name: {
|
|
1987
|
+
type: "string";
|
|
1988
|
+
required: false;
|
|
1989
|
+
input: false;
|
|
1990
|
+
};
|
|
1991
|
+
start: {
|
|
1992
|
+
type: "string";
|
|
1993
|
+
required: false;
|
|
1994
|
+
input: false;
|
|
1995
|
+
};
|
|
1996
|
+
referenceId: {
|
|
1997
|
+
type: "string";
|
|
1998
|
+
required: true;
|
|
1999
|
+
input: false;
|
|
2000
|
+
index: true;
|
|
2001
|
+
};
|
|
2002
|
+
prefix: {
|
|
2003
|
+
type: "string";
|
|
2004
|
+
required: false;
|
|
2005
|
+
input: false;
|
|
2006
|
+
};
|
|
2007
|
+
key: {
|
|
2008
|
+
type: "string";
|
|
2009
|
+
required: true;
|
|
2010
|
+
input: false;
|
|
2011
|
+
index: true;
|
|
2012
|
+
};
|
|
2013
|
+
refillInterval: {
|
|
2014
|
+
type: "number";
|
|
2015
|
+
required: false;
|
|
2016
|
+
input: false;
|
|
2017
|
+
};
|
|
2018
|
+
refillAmount: {
|
|
2019
|
+
type: "number";
|
|
2020
|
+
required: false;
|
|
2021
|
+
input: false;
|
|
2022
|
+
};
|
|
2023
|
+
lastRefillAt: {
|
|
2024
|
+
type: "date";
|
|
2025
|
+
required: false;
|
|
2026
|
+
input: false;
|
|
2027
|
+
};
|
|
2028
|
+
enabled: {
|
|
2029
|
+
type: "boolean";
|
|
2030
|
+
required: false;
|
|
2031
|
+
input: false;
|
|
2032
|
+
defaultValue: true;
|
|
2033
|
+
};
|
|
2034
|
+
rateLimitEnabled: {
|
|
2035
|
+
type: "boolean";
|
|
2036
|
+
required: false;
|
|
2037
|
+
input: false;
|
|
2038
|
+
defaultValue: true;
|
|
2039
|
+
};
|
|
2040
|
+
rateLimitTimeWindow: {
|
|
2041
|
+
type: "number";
|
|
2042
|
+
required: false;
|
|
2043
|
+
input: false;
|
|
2044
|
+
defaultValue: number;
|
|
2045
|
+
};
|
|
2046
|
+
rateLimitMax: {
|
|
2047
|
+
type: "number";
|
|
2048
|
+
required: false;
|
|
2049
|
+
input: false;
|
|
2050
|
+
defaultValue: number;
|
|
2051
|
+
};
|
|
2052
|
+
requestCount: {
|
|
2053
|
+
type: "number";
|
|
2054
|
+
required: false;
|
|
2055
|
+
input: false;
|
|
2056
|
+
defaultValue: number;
|
|
2057
|
+
};
|
|
2058
|
+
remaining: {
|
|
2059
|
+
type: "number";
|
|
2060
|
+
required: false;
|
|
2061
|
+
input: false;
|
|
2062
|
+
};
|
|
2063
|
+
lastRequest: {
|
|
2064
|
+
type: "date";
|
|
2065
|
+
required: false;
|
|
2066
|
+
input: false;
|
|
2067
|
+
};
|
|
2068
|
+
expiresAt: {
|
|
2069
|
+
type: "date";
|
|
2070
|
+
required: false;
|
|
2071
|
+
input: false;
|
|
2072
|
+
};
|
|
2073
|
+
createdAt: {
|
|
2074
|
+
type: "date";
|
|
2075
|
+
required: true;
|
|
2076
|
+
input: false;
|
|
2077
|
+
};
|
|
2078
|
+
updatedAt: {
|
|
2079
|
+
type: "date";
|
|
2080
|
+
required: true;
|
|
2081
|
+
input: false;
|
|
2082
|
+
};
|
|
2083
|
+
permissions: {
|
|
2084
|
+
type: "string";
|
|
2085
|
+
required: false;
|
|
2086
|
+
input: false;
|
|
2087
|
+
};
|
|
2088
|
+
metadata: {
|
|
2089
|
+
type: "string";
|
|
2090
|
+
required: false;
|
|
2091
|
+
input: true;
|
|
2092
|
+
transform: {
|
|
2093
|
+
input(value: import("better-auth").DBPrimitive): string;
|
|
2094
|
+
output(value: import("better-auth").DBPrimitive): any;
|
|
2095
|
+
};
|
|
2096
|
+
};
|
|
2097
|
+
};
|
|
2098
|
+
};
|
|
2099
|
+
};
|
|
2100
|
+
configurations: (import("@better-auth/api-key").ApiKeyConfigurationOptions & Required<Pick<import("@better-auth/api-key").ApiKeyConfigurationOptions, "rateLimit" | "apiKeyHeaders" | "defaultKeyLength" | "keyExpiration" | "maximumPrefixLength" | "minimumPrefixLength" | "maximumNameLength" | "disableKeyHashing" | "minimumNameLength" | "requireName" | "enableMetadata" | "enableSessionForAPIKeys" | "startingCharactersConfig" | "storage" | "fallbackToDatabase" | "deferUpdates">> & {
|
|
2101
|
+
keyExpiration: Required<NonNullable<import("@better-auth/api-key").ApiKeyConfigurationOptions["keyExpiration"]>>;
|
|
2102
|
+
startingCharactersConfig: Required<NonNullable<import("@better-auth/api-key").ApiKeyConfigurationOptions["startingCharactersConfig"]>>;
|
|
2103
|
+
rateLimit: Required<NonNullable<import("@better-auth/api-key").ApiKeyConfigurationOptions["rateLimit"]>>;
|
|
2104
|
+
})[];
|
|
2105
|
+
})[];
|
|
2106
|
+
}>>;
|
|
2107
|
+
export type Auth = Awaited<ReturnType<typeof createAuth>>;
|