qarpeo 0.1.34 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +114 -26
- package/dist/apps/cms.d.ts +4 -0
- package/dist/apps/comments.d.ts +4 -0
- package/dist/apps/payments.d.ts +4 -0
- package/dist/apps/store.d.ts +4 -0
- package/dist/chunks/auth-schema.mjs +169 -30
- package/dist/chunks/tools.mjs +1680 -0
- package/dist/cli/index.mjs +1256 -221
- package/dist/core/aliases.d.ts +5 -0
- package/dist/core/context.d.ts +10 -0
- package/dist/core/cross-drive.d.ts +2 -0
- package/dist/core/d1-migrate.d.ts +4 -0
- package/dist/core/devtools.d.ts +4 -0
- package/dist/core/nitro.d.ts +4 -0
- package/dist/core/schema.d.ts +4 -0
- package/dist/core/server-utils.d.ts +4 -0
- package/dist/core/wrangler.d.ts +4 -0
- package/dist/dev/wrangler.d.ts +1 -0
- package/dist/fate/index.d.ts +8 -8
- package/dist/features/agents.d.ts +4 -0
- package/dist/features/auth.d.ts +4 -0
- package/dist/features/bots.d.ts +4 -0
- package/dist/features/fate.d.ts +4 -0
- package/dist/features/mail.d.ts +4 -0
- package/dist/features/mcp.d.ts +4 -0
- package/dist/features/multitenant.d.ts +4 -0
- package/dist/features/notifications.d.ts +4 -0
- package/dist/features/realtime.d.ts +4 -0
- package/dist/module.d.ts +10 -2
- package/dist/module.mjs +6313 -5114
- package/dist/primitives/ai.d.ts +4 -0
- package/dist/primitives/analytics.d.ts +4 -0
- package/dist/primitives/blob.d.ts +4 -0
- package/dist/primitives/browser.d.ts +4 -0
- package/dist/primitives/cache.d.ts +4 -0
- package/dist/primitives/d1.d.ts +4 -0
- package/dist/primitives/do.d.ts +4 -0
- package/dist/primitives/email.d.ts +4 -0
- package/dist/primitives/hyperdrive.d.ts +4 -0
- package/dist/primitives/kv.d.ts +4 -0
- package/dist/primitives/queue.d.ts +4 -0
- package/dist/primitives/ratelimit.d.ts +4 -0
- package/dist/primitives/vectorize.d.ts +4 -0
- package/dist/primitives/workflows.d.ts +4 -0
- package/dist/runtime/ai.d.ts +3 -3
- package/dist/runtime/ai.mjs +8 -1
- package/dist/runtime/app/components/RealtimeCursors.vue +2 -2
- package/dist/runtime/app/composables/ai.d.ts +56 -29
- package/dist/runtime/app/composables/analytics.d.ts +26 -106
- package/dist/runtime/app/composables/api-tokens.d.ts +31 -34
- package/dist/runtime/app/composables/auth.d.ts +147 -51
- package/dist/runtime/app/composables/auth.mjs +0 -7
- package/dist/runtime/app/composables/chat.d.ts +38 -35
- package/dist/runtime/app/composables/cms-preview.d.ts +30 -25
- package/dist/runtime/app/composables/cms.d.ts +57 -282
- package/dist/runtime/app/composables/cms.mjs +0 -35
- package/dist/runtime/app/composables/comments.d.ts +32 -5
- package/dist/runtime/app/composables/comments.mjs +29 -1
- package/dist/runtime/app/composables/docs-version.d.ts +25 -28
- package/dist/runtime/app/composables/impersonation.d.ts +22 -5
- package/dist/runtime/app/composables/organization.d.ts +38 -91
- package/dist/runtime/app/composables/passkey.d.ts +22 -6
- package/dist/runtime/app/composables/passwordless.d.ts +24 -7
- package/dist/runtime/app/composables/payments.d.ts +50 -34
- package/dist/runtime/app/composables/payments.mjs +1 -0
- package/dist/runtime/app/composables/sse.d.ts +76 -0
- package/dist/runtime/app/composables/sse.mjs +152 -0
- package/dist/runtime/app/composables/storage.d.ts +53 -65
- package/dist/runtime/app/composables/storage.mjs +17 -0
- package/dist/runtime/app/composables/store.d.ts +198 -0
- package/dist/runtime/app/composables/store.mjs +414 -0
- package/dist/runtime/app/composables/tenant.d.ts +31 -72
- package/dist/runtime/app/composables/turnstile.d.ts +16 -3
- package/dist/runtime/app/composables/two-factor.d.ts +23 -6
- package/dist/runtime/app/pages/devtools/notifications.vue +30 -27
- package/dist/runtime/app/pages/devtools/realtime.vue +19 -31
- package/dist/runtime/app/pages/devtools.vue +0 -7
- package/dist/runtime/auth.d.ts +9 -9
- package/dist/runtime/blob.d.ts +10 -1
- package/dist/runtime/blob.mjs +83 -0
- package/dist/runtime/cache.d.ts +48 -0
- package/dist/runtime/cache.mjs +92 -0
- package/dist/runtime/comments.d.ts +4 -0
- package/dist/runtime/comments.mjs +2 -0
- package/dist/runtime/db.d.ts +21 -1
- package/dist/runtime/db.mjs +54 -0
- package/dist/runtime/drizzle.d.ts +4 -2
- package/dist/runtime/drizzle.mjs +68 -1
- package/dist/runtime/durable-object.d.ts +2 -0
- package/dist/runtime/durable-object.mjs +2 -0
- package/dist/runtime/email.d.ts +1 -1
- package/dist/runtime/email.mjs +1 -1
- package/dist/runtime/kv.mjs +50 -1
- package/dist/runtime/mcp.d.ts +2 -0
- package/dist/runtime/mcp.mjs +2 -0
- package/dist/runtime/queue.d.ts +12 -2
- package/dist/runtime/queue.mjs +19 -1
- package/dist/runtime/ratelimit.d.ts +1 -0
- package/dist/runtime/ratelimit.mjs +7 -0
- package/dist/runtime/schema.d.ts +313 -0
- package/dist/runtime/schema.mjs +259 -0
- package/dist/runtime/server/db/cms-schema.d.ts +1225 -171
- package/dist/runtime/server/db/cms-schema.mjs +69 -70
- package/dist/runtime/server/db/store-schema.d.ts +4344 -0
- package/dist/runtime/server/db/store-schema.mjs +266 -0
- package/dist/runtime/server/durable-objects/agent.mjs +35 -0
- package/dist/runtime/server/durable-objects/room.mjs +0 -1
- package/dist/runtime/server/middleware/ratelimit.mjs +10 -8
- package/dist/runtime/server/plugins/comments.d.ts +7 -0
- package/dist/runtime/server/plugins/comments.mjs +7 -0
- package/dist/runtime/server/plugins/email-inbound.d.ts +5 -0
- package/dist/runtime/server/plugins/email-inbound.mjs +17 -0
- package/dist/runtime/server/plugins/store.d.ts +7 -0
- package/dist/runtime/server/plugins/store.mjs +7 -0
- package/dist/runtime/server/routes/__qarpeo/db/tables.get.mjs +2 -2
- package/dist/runtime/server/routes/atom.xml.get.mjs +3 -1
- package/dist/runtime/server/routes/auth/2fa/disable.post.mjs +13 -2
- package/dist/runtime/server/routes/auth/2fa/setup.post.mjs +9 -3
- package/dist/runtime/server/routes/auth/2fa/verify.post.mjs +11 -3
- package/dist/runtime/server/routes/auth/account.delete.mjs +2 -1
- package/dist/runtime/server/routes/auth/audit-logs.get.mjs +1 -1
- package/dist/runtime/server/routes/auth/magic-link/send.post.d.ts +1 -9
- package/dist/runtime/server/routes/auth/magic-link/send.post.mjs +8 -0
- package/dist/runtime/server/routes/auth/organization/sso/[id].delete.mjs +1 -1
- package/dist/runtime/server/routes/auth/organization/sso/index.get.mjs +1 -1
- package/dist/runtime/server/routes/auth/organization/sso/index.post.mjs +1 -1
- package/dist/runtime/server/routes/auth/otp/send.post.d.ts +1 -9
- package/dist/runtime/server/routes/auth/otp/send.post.mjs +8 -0
- package/dist/runtime/server/routes/auth/sso/login.get.mjs +3 -3
- package/dist/runtime/server/routes/auth/sso/oidc/callback.get.mjs +1 -1
- package/dist/runtime/server/routes/auth/sso/saml/acs.post.mjs +2 -2
- package/dist/runtime/server/routes/auth/webauthn/login/options.post.mjs +1 -1
- package/dist/runtime/server/routes/auth/webauthn/login/verify.post.mjs +1 -1
- package/dist/runtime/server/routes/auth/webauthn/register/options.post.mjs +2 -2
- package/dist/runtime/server/routes/auth/webauthn/register/verify.post.mjs +1 -1
- package/dist/runtime/server/routes/cms/[collection]/[id]/preview-token.post.mjs +1 -1
- package/dist/runtime/server/routes/cms/[collection]/atom.xml.get.mjs +3 -1
- package/dist/runtime/server/routes/cms/[collection]/feed.xml.get.mjs +3 -1
- package/dist/runtime/server/routes/cms/bookmarks/[id].delete.mjs +1 -1
- package/dist/runtime/server/routes/cms/bookmarks/check.post.mjs +1 -1
- package/dist/runtime/server/routes/cms/bookmarks/index.get.mjs +1 -1
- package/dist/runtime/server/routes/cms/bookmarks/index.post.mjs +1 -1
- package/dist/runtime/server/routes/cms/deploy.post.mjs +1 -1
- package/dist/runtime/server/routes/cms/export.post.mjs +4 -3
- package/dist/runtime/server/routes/cms/search.get.mjs +7 -5
- package/dist/runtime/server/routes/cms/sync.post.mjs +2 -1
- package/dist/runtime/server/routes/comments/[id]/react.post.mjs +1 -2
- package/dist/runtime/server/routes/comments/[id]/report.post.d.ts +1 -1
- package/dist/runtime/server/routes/comments/[id]/report.post.mjs +0 -2
- package/dist/runtime/server/routes/comments/[id].delete.mjs +8 -4
- package/dist/runtime/server/routes/comments/[id].get.d.ts +1 -1
- package/dist/runtime/server/routes/comments/[id].get.mjs +1 -2
- package/dist/runtime/server/routes/comments/[id].patch.d.ts +1 -1
- package/dist/runtime/server/routes/comments/[id].patch.mjs +6 -3
- package/dist/runtime/server/routes/comments/batch.post.d.ts +2 -0
- package/dist/runtime/server/routes/comments/batch.post.mjs +33 -0
- package/dist/runtime/server/routes/comments/index.get.d.ts +1 -1
- package/dist/runtime/server/routes/comments/index.get.mjs +6 -4
- package/dist/runtime/server/routes/comments/index.post.d.ts +1 -1
- package/dist/runtime/server/routes/comments/index.post.mjs +6 -2
- package/dist/runtime/server/routes/feed.xml.get.mjs +3 -1
- package/dist/runtime/server/routes/sitemap.xml.get.mjs +3 -1
- package/dist/runtime/server/routes/storage/presigned-r2.post.d.ts +17 -0
- package/dist/runtime/server/routes/storage/presigned-r2.post.mjs +29 -0
- package/dist/runtime/server/routes/store/cart/index.delete.d.ts +6 -0
- package/dist/runtime/server/routes/store/cart/index.delete.mjs +11 -0
- package/dist/runtime/server/routes/store/cart/index.get.d.ts +5 -0
- package/dist/runtime/server/routes/store/cart/index.get.mjs +14 -0
- package/dist/runtime/server/routes/store/cart/items/[id].delete.d.ts +6 -0
- package/dist/runtime/server/routes/store/cart/items/[id].delete.mjs +25 -0
- package/dist/runtime/server/routes/store/cart/items/[id].patch.d.ts +6 -0
- package/dist/runtime/server/routes/store/cart/items/[id].patch.mjs +29 -0
- package/dist/runtime/server/routes/store/cart/items.post.d.ts +6 -0
- package/dist/runtime/server/routes/store/cart/items.post.mjs +36 -0
- package/dist/runtime/server/routes/store/categories/index.get.d.ts +2 -0
- package/dist/runtime/server/routes/store/categories/index.get.mjs +8 -0
- package/dist/runtime/server/routes/store/checkout.post.d.ts +6 -0
- package/dist/runtime/server/routes/store/checkout.post.mjs +21 -0
- package/dist/runtime/server/routes/store/coupons/apply.post.d.ts +7 -0
- package/dist/runtime/server/routes/store/coupons/apply.post.mjs +18 -0
- package/dist/runtime/server/routes/store/currencies.get.d.ts +15 -0
- package/dist/runtime/server/routes/store/currencies.get.mjs +13 -0
- package/dist/runtime/server/routes/store/orders/[id].get.d.ts +2 -0
- package/dist/runtime/server/routes/store/orders/[id].get.mjs +26 -0
- package/dist/runtime/server/routes/store/orders/download/[token].get.d.ts +7 -0
- package/dist/runtime/server/routes/store/orders/download/[token].get.mjs +57 -0
- package/dist/runtime/server/routes/store/orders/index.get.d.ts +5 -0
- package/dist/runtime/server/routes/store/orders/index.get.mjs +30 -0
- package/dist/runtime/server/routes/store/products/[slug].get.d.ts +2 -0
- package/dist/runtime/server/routes/store/products/[slug].get.mjs +18 -0
- package/dist/runtime/server/routes/store/products/index.get.d.ts +5 -0
- package/dist/runtime/server/routes/store/products/index.get.mjs +33 -0
- package/dist/runtime/server/routes/store/tax/calculate.post.d.ts +9 -0
- package/dist/runtime/server/routes/store/tax/calculate.post.mjs +18 -0
- package/dist/runtime/server/routes/tenants/[tenant]/domains/[domain]/index.delete.mjs +14 -1
- package/dist/runtime/server/routes/tenants/[tenant]/domains/[domain]/verify.post.mjs +14 -1
- package/dist/runtime/server/routes/tenants/[tenant]/domains/index.get.mjs +24 -1
- package/dist/runtime/server/routes/tenants/[tenant]/domains/index.post.mjs +6 -0
- package/dist/runtime/server/utils/ai.d.ts +146 -21
- package/dist/runtime/server/utils/ai.mjs +406 -11
- package/dist/runtime/server/utils/analytics-query.d.ts +13 -58
- package/dist/runtime/server/utils/audit.d.ts +5 -4
- package/dist/runtime/server/utils/audit.mjs +25 -14
- package/dist/runtime/server/utils/auth.d.ts +29 -12
- package/dist/runtime/server/utils/auth.mjs +88 -70
- package/dist/runtime/server/utils/bots.d.ts +20 -4
- package/dist/runtime/server/utils/bots.mjs +7 -3
- package/dist/runtime/server/utils/browser-utils.d.ts +23 -23
- package/dist/runtime/server/utils/cache.d.ts +31 -10
- package/dist/runtime/server/utils/cache.mjs +130 -53
- package/dist/runtime/server/utils/cms/collections.d.ts +23 -0
- package/dist/runtime/server/utils/cms/collections.mjs +143 -0
- package/dist/runtime/server/utils/cms/common.d.ts +9 -0
- package/dist/runtime/server/utils/cms/common.mjs +28 -0
- package/dist/runtime/server/utils/cms/git.mjs +2 -2
- package/dist/runtime/server/utils/cms/navigation.d.ts +46 -0
- package/dist/runtime/server/utils/cms/navigation.mjs +683 -0
- package/dist/runtime/server/utils/cms/preview.d.ts +11 -0
- package/dist/runtime/server/utils/cms/preview.mjs +50 -0
- package/dist/runtime/server/utils/cms/search.d.ts +1 -1
- package/dist/runtime/server/utils/cms/search.mjs +11 -7
- package/dist/runtime/server/utils/cms/sync.d.ts +34 -0
- package/dist/runtime/server/utils/cms/sync.mjs +1082 -0
- package/dist/runtime/server/utils/cms/taxonomy.d.ts +103 -0
- package/dist/runtime/server/utils/cms/taxonomy.mjs +348 -0
- package/dist/runtime/server/utils/cms.d.ts +13 -249
- package/dist/runtime/server/utils/cms.mjs +108 -2350
- package/dist/runtime/server/utils/comments-filter.d.ts +45 -0
- package/dist/runtime/server/utils/comments-filter.mjs +541 -0
- package/dist/runtime/server/utils/comments.d.ts +71 -0
- package/dist/runtime/server/utils/comments.mjs +137 -61
- package/dist/runtime/server/utils/config.d.ts +4 -3
- package/dist/runtime/server/utils/config.mjs +7 -6
- package/dist/runtime/server/utils/context.d.ts +14 -0
- package/dist/runtime/server/utils/context.mjs +2 -2
- package/dist/runtime/server/utils/crypto.d.ts +44 -5
- package/dist/runtime/server/utils/crypto.mjs +18 -0
- package/dist/runtime/server/utils/domains.mjs +9 -5
- package/dist/runtime/server/utils/drizzle.d.ts +35 -3
- package/dist/runtime/server/utils/drizzle.mjs +115 -6
- package/dist/runtime/server/utils/durable-object.d.ts +106 -0
- package/dist/runtime/server/utils/durable-object.mjs +628 -0
- package/dist/runtime/server/utils/email-inbound.d.ts +29 -0
- package/dist/runtime/server/utils/email-inbound.mjs +76 -0
- package/dist/runtime/server/utils/impersonation.d.ts +32 -2
- package/dist/runtime/server/utils/impersonation.mjs +16 -13
- package/dist/runtime/server/utils/lock.d.ts +71 -0
- package/dist/runtime/server/utils/lock.mjs +139 -0
- package/dist/runtime/server/utils/mail-suppression.mjs +7 -7
- package/dist/runtime/server/utils/mail.d.ts +30 -19
- package/dist/runtime/server/utils/mcp.d.ts +44 -0
- package/dist/runtime/server/utils/mcp.mjs +308 -0
- package/dist/runtime/server/utils/notifications.d.ts +72 -7
- package/dist/runtime/server/utils/notifications.mjs +67 -55
- package/dist/runtime/server/utils/oauth.d.ts +27 -4
- package/dist/runtime/server/utils/organization.d.ts +63 -7
- package/dist/runtime/server/utils/organization.mjs +26 -21
- package/dist/runtime/server/utils/passwordless.d.ts +62 -33
- package/dist/runtime/server/utils/payments.d.ts +51 -12
- package/dist/runtime/server/utils/payments.mjs +472 -282
- package/dist/runtime/server/utils/queue.d.ts +106 -13
- package/dist/runtime/server/utils/queue.mjs +313 -28
- package/dist/runtime/server/utils/rag.d.ts +42 -14
- package/dist/runtime/server/utils/rag.mjs +169 -4
- package/dist/runtime/server/utils/ratelimit.d.ts +34 -5
- package/dist/runtime/server/utils/ratelimit.mjs +95 -14
- package/dist/runtime/server/utils/realtime.d.ts +68 -52
- package/dist/runtime/server/utils/scheduled-task.d.ts +42 -1
- package/dist/runtime/server/utils/scheduled-task.mjs +29 -0
- package/dist/runtime/server/utils/schema-fallback.d.ts +1 -1
- package/dist/runtime/server/utils/schema-fallback.mjs +1 -1
- package/dist/runtime/server/utils/session.d.ts +84 -10
- package/dist/runtime/server/utils/session.mjs +12 -10
- package/dist/runtime/server/utils/sse.d.ts +75 -0
- package/dist/runtime/server/utils/sse.mjs +147 -0
- package/dist/runtime/server/utils/sso.d.ts +1 -1
- package/dist/runtime/server/utils/storage.d.ts +53 -4
- package/dist/runtime/server/utils/storage.mjs +15 -11
- package/dist/runtime/server/utils/store-localization.d.ts +51 -0
- package/dist/runtime/server/utils/store-localization.mjs +417 -0
- package/dist/runtime/server/utils/store.d.ts +207 -0
- package/dist/runtime/server/utils/store.mjs +2227 -0
- package/dist/runtime/server/utils/table-names.d.ts +51 -0
- package/dist/runtime/server/utils/table-names.mjs +69 -0
- package/dist/runtime/server/utils/tenant.d.ts +26 -2
- package/dist/runtime/server/utils/tenant.mjs +16 -12
- package/dist/runtime/server/utils/tools-registry-fallback.d.ts +1 -0
- package/dist/runtime/server/utils/tools-registry-fallback.mjs +1 -0
- package/dist/runtime/server/utils/totp.d.ts +45 -2
- package/dist/runtime/server/utils/tracker.d.ts +10 -11
- package/dist/runtime/server/utils/turnstile.d.ts +16 -1
- package/dist/runtime/server/utils/workflows.d.ts +92 -0
- package/dist/runtime/server/utils/workflows.mjs +299 -0
- package/dist/runtime/server.d.ts +8 -1
- package/dist/runtime/server.mjs +8 -5
- package/dist/runtime/service.d.ts +10 -10
- package/dist/runtime/storage.d.ts +1 -0
- package/dist/runtime/storage.mjs +1 -0
- package/dist/runtime/store.d.ts +4 -0
- package/dist/runtime/store.mjs +2 -0
- package/dist/runtime/test-utils.d.ts +11 -10
- package/dist/runtime/test-utils.mjs +64 -4
- package/dist/runtime/types/ai.d.ts +21 -2
- package/dist/runtime/types/d1.d.ts +17 -0
- package/dist/runtime/types/drizzle.d.ts +2 -2
- package/dist/runtime/types/durable-object.d.ts +62 -2
- package/dist/runtime/types/email.d.ts +46 -0
- package/dist/runtime/types/imports.d.ts +6 -1
- package/dist/runtime/types/index.d.ts +58 -0
- package/dist/runtime/types/index.mjs +3 -0
- package/dist/runtime/types/mcp.d.ts +83 -0
- package/dist/runtime/types/mcp.mjs +0 -0
- package/dist/runtime/types/queue.d.ts +36 -0
- package/dist/runtime/types/r2.d.ts +41 -0
- package/dist/runtime/types/store.d.ts +313 -0
- package/dist/runtime/types/store.mjs +0 -0
- package/dist/runtime/types/workflows.d.ts +98 -0
- package/dist/runtime/types/workflows.mjs +0 -0
- package/dist/runtime/workflows.d.ts +5 -0
- package/dist/runtime/workflows.mjs +2 -0
- package/dist/types/ai.d.ts +721 -0
- package/dist/types/cms.d.ts +710 -0
- package/dist/types.d.ts +430 -1292
- package/dist/utils/auth-schema.d.ts +3 -2
- package/dist/utils/bots.d.ts +20 -0
- package/dist/utils/comments-schema.d.ts +5 -4
- package/dist/utils/drizzle.d.ts +83 -3
- package/dist/utils/durable-objects.d.ts +10 -0
- package/dist/utils/email-inbound.d.ts +10 -0
- package/dist/utils/local-db.d.ts +1 -3
- package/dist/utils/mcp.d.ts +24 -0
- package/dist/utils/notifications-schema.d.ts +5 -4
- package/dist/utils/payments-schema.d.ts +4 -3
- package/dist/utils/store-schema.d.ts +14 -0
- package/dist/utils/table-names.d.ts +1 -0
- package/dist/utils/tenants-schema.d.ts +4 -3
- package/dist/utils/tools.d.ts +20 -0
- package/dist/utils/workflows.d.ts +8 -0
- package/package.json +34 -4
- package/dist/chunks/wrangler.mjs +0 -897
- package/dist/runtime/app/components/AuthRegister.vue +0 -306
- package/dist/runtime/app/components/AuthSessionsList.vue +0 -137
- package/dist/runtime/app/components/AuthSignIn.vue +0 -298
- package/dist/runtime/app/components/CMSBookmarkButton.vue +0 -59
- package/dist/runtime/app/components/CMSImage.vue +0 -47
- package/dist/runtime/app/components/CMSLocaleSwitcher.vue +0 -110
- package/dist/runtime/app/components/CMSNewsletter.vue +0 -81
- package/dist/runtime/app/components/CMSPreviewBanner.vue +0 -83
- package/dist/runtime/app/components/CMSTableOfContents.vue +0 -84
- package/dist/runtime/app/components/CMSVersionBanner.vue +0 -53
- package/dist/runtime/app/components/CMSVersionSwitcher.vue +0 -140
- package/dist/runtime/app/components/Comments.vue +0 -411
- package/dist/runtime/app/components/FileUpload.vue +0 -200
- package/dist/runtime/app/components/ImpersonationBanner.vue +0 -61
- package/dist/runtime/app/components/NotificationBell.vue +0 -263
- package/dist/runtime/app/components/NotificationList.vue +0 -205
- package/dist/runtime/app/components/NotificationPrompt.vue +0 -133
- package/dist/runtime/app/components/PricingGated.vue +0 -81
- package/dist/runtime/app/components/PricingTable.vue +0 -274
- package/dist/runtime/app/components/RealtimeChat.vue +0 -164
- package/dist/runtime/app/components/RealtimePresence.vue +0 -129
- package/dist/runtime/app/components/RealtimeStatus.vue +0 -79
- package/dist/runtime/app/components/SubscriptionCard.vue +0 -207
- package/dist/runtime/app/components/UserProfile.vue +0 -558
package/README.md
CHANGED
|
@@ -5,22 +5,33 @@
|
|
|
5
5
|
[](https://www.npmjs.com/package/qarpeo)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
7
7
|
|
|
8
|
-
**Qarpeo** bridges Nuxt and Cloudflare Workers into a seamless, high-velocity developer experience. One package, zero manual wrangler configuration, type-safe auto-imports,
|
|
8
|
+
**Qarpeo** bridges Nuxt and Cloudflare Workers into a seamless, high-velocity developer experience. One package, zero manual `wrangler.json` configuration, type-safe auto-imports, global edge persistence across all 12 Cloudflare primitives, and full-stack composable Apps.
|
|
9
9
|
|
|
10
10
|
Documentation: [https://qarpeo.com](https://qarpeo.com)
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
##
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
14
|
+
## Capabilities & Apps
|
|
15
|
+
|
|
16
|
+
### ⚡ Edge Primitives
|
|
17
|
+
- **Database (D1)**: Native Cloudflare D1 with automatic Drizzle ORM schemas, migrations, and seed scripts.
|
|
18
|
+
- **Key-Value (KV)**: Ultra-fast edge key-value storage with typed `kv` auto-imports.
|
|
19
|
+
- **Blob Storage (R2)**: S3-compatible asset and file storage with multipart and resumable uploads.
|
|
20
|
+
- **Edge AI & Vector Search**: Workers AI LLM streaming (`ai`), Vectorize vector embeddings, and RAG pipelines.
|
|
21
|
+
- **Queues & Background Tasks**: Cloudflare Queues with typed producer and `defineQueueHandler` consumers.
|
|
22
|
+
- **Browser Rendering**: Headless Chromium automation, screenshots, and PDF generation via Cloudflare Browser Rendering.
|
|
23
|
+
- **Realtime**: WebSockets, room broadcast, and presence powered by Cloudflare Durable Objects.
|
|
24
|
+
- **Telemetry & Rate Limiting**: Privacy-first Analytics Engine and edge rate limiting with zero external Redis.
|
|
25
|
+
- **Hyperdrive**: Pooled connections and query acceleration to external PostgreSQL and MySQL databases.
|
|
26
|
+
|
|
27
|
+
### 🧩 Full-Stack Composable Apps & Layers
|
|
28
|
+
- **CMS App**: Flagship edge content management system featuring collections, entries, version revisions, categories, tags, bookmarks, newsletter subscribers, RSS/Atom feeds, dynamic sitemaps, and full-text search.
|
|
29
|
+
- **Comments System**: Threaded discussions with materialized path hierarchy, reactions, reporting, adult website/link blocker, duplicate flood detection, batch moderation API, and the turnkey `<QComments />` Vue component.
|
|
30
|
+
- **Auth**: Edge authentication powered by Better Auth and D1, featuring WebAuthn passkeys, enterprise SSO (SAML & OIDC), 2FA/TOTP, magic links, organizations, and user impersonation.
|
|
31
|
+
- **Payments**: Edge payment workflows with Stripe and Lemon Squeezy checkouts, customer portals, and verified webhooks.
|
|
32
|
+
- **Notifications**: Multi-channel alerts featuring in-app feeds, browser Web Push (VAPID via Web Crypto), and transactional emails.
|
|
33
|
+
- **Multi-Tenancy**: Automated tenant subdomains, custom domains via Cloudflare for SaaS, and automated SSL provisioning.
|
|
34
|
+
- **DevTools**: Integrated management console to monitor D1 tables, R2 blobs, realtime rooms, security bans, and AI agents.
|
|
24
35
|
|
|
25
36
|
---
|
|
26
37
|
|
|
@@ -31,12 +42,12 @@ Documentation: [https://qarpeo.com](https://qarpeo.com)
|
|
|
31
42
|
```bash
|
|
32
43
|
vp add qarpeo
|
|
33
44
|
# or
|
|
34
|
-
|
|
45
|
+
pnpm add qarpeo
|
|
35
46
|
```
|
|
36
47
|
|
|
37
48
|
### 2. Configure
|
|
38
49
|
|
|
39
|
-
Enable the
|
|
50
|
+
Enable the edge primitives and apps you need in `nuxt.config.ts`:
|
|
40
51
|
|
|
41
52
|
```ts [nuxt.config.ts]
|
|
42
53
|
export default defineNuxtConfig({
|
|
@@ -48,41 +59,117 @@ export default defineNuxtConfig({
|
|
|
48
59
|
blob: true,
|
|
49
60
|
kv: true,
|
|
50
61
|
ai: true,
|
|
51
|
-
|
|
62
|
+
realtime: true,
|
|
52
63
|
|
|
53
|
-
//
|
|
64
|
+
// Apps & Capability Layers
|
|
54
65
|
auth: true,
|
|
55
66
|
cms: true,
|
|
67
|
+
comments: {
|
|
68
|
+
moderation: {
|
|
69
|
+
blockAdultContent: true, // Blocks adult domains & TLDs with zero perf overhead
|
|
70
|
+
maxLinks: 2, // Max links allowed per comment
|
|
71
|
+
action: "reject", // "reject" (HTTP 400) or "quarantine" (flags as spam)
|
|
72
|
+
},
|
|
73
|
+
},
|
|
56
74
|
payments: true,
|
|
57
75
|
notifications: true,
|
|
76
|
+
|
|
77
|
+
// Database Customization (Strict Two-Tier Standard)
|
|
78
|
+
tablePrefix: "app_", // Or per-table overrides: tables: { user: "custom_users" }
|
|
58
79
|
},
|
|
59
80
|
})
|
|
60
81
|
```
|
|
61
82
|
|
|
62
|
-
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Usage Examples
|
|
86
|
+
|
|
87
|
+
### 1. Turnkey Threaded Comments (`<QComments />`)
|
|
63
88
|
|
|
64
|
-
|
|
89
|
+
Drop threaded comments with reactions, replies, and moderation into any Vue page:
|
|
90
|
+
|
|
91
|
+
```vue [pages/posts/[slug].vue]
|
|
92
|
+
<script setup>
|
|
93
|
+
const route = useRoute()
|
|
94
|
+
</script>
|
|
95
|
+
|
|
96
|
+
<template>
|
|
97
|
+
<article>
|
|
98
|
+
<h1>My Post</h1>
|
|
99
|
+
|
|
100
|
+
<!-- Drop-in turnkey comments -->
|
|
101
|
+
<QComments :target-urn="`urn:cms:blog:${route.params.slug}`" />
|
|
102
|
+
</article>
|
|
103
|
+
</template>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### 2. Server Event Handlers
|
|
107
|
+
|
|
108
|
+
All Cloudflare bindings and high-level clients are auto-imported and typed:
|
|
65
109
|
|
|
66
110
|
```ts [server/api/example.get.ts]
|
|
67
|
-
export default defineEventHandler(async () => {
|
|
111
|
+
export default defineEventHandler(async (event) => {
|
|
68
112
|
// Cloudflare KV
|
|
69
|
-
await kv.set("
|
|
113
|
+
await kv.set("greeting", "Hello from the edge!")
|
|
70
114
|
|
|
71
|
-
// Cloudflare D1
|
|
72
|
-
const
|
|
115
|
+
// Cloudflare D1 with dynamic table names
|
|
116
|
+
const users = await db.select().from(schema.users)
|
|
73
117
|
|
|
74
118
|
// Cloudflare Workers AI
|
|
75
|
-
const
|
|
119
|
+
const summary = await ai.run("@cf/meta/llama-3.1-8b-instruct", {
|
|
76
120
|
prompt: "Summarize edge computing in 5 words",
|
|
77
121
|
})
|
|
78
122
|
|
|
79
|
-
return {
|
|
123
|
+
return { greeting: await kv.get("greeting"), users, summary }
|
|
80
124
|
})
|
|
81
125
|
```
|
|
82
126
|
|
|
83
|
-
###
|
|
127
|
+
### 3. Server Comments API
|
|
128
|
+
|
|
129
|
+
Manage comments programmatically from server routes:
|
|
130
|
+
|
|
131
|
+
```ts [server/api/moderate.post.ts]
|
|
132
|
+
import { batchModerateComments, queryComments } from "qarpeo/comments"
|
|
133
|
+
|
|
134
|
+
export default defineEventHandler(async (event) => {
|
|
135
|
+
// Batch approve, mark as spam, or delete up to 100 comments
|
|
136
|
+
const result = await batchModerateComments({
|
|
137
|
+
ids: ["cm_1", "cm_2"],
|
|
138
|
+
action: "approve",
|
|
139
|
+
}, event)
|
|
140
|
+
|
|
141
|
+
return result
|
|
142
|
+
})
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## Database Customization Standard
|
|
148
|
+
|
|
149
|
+
Qarpeo follows a strict two-tier database naming architecture:
|
|
150
|
+
1. **Global Table Prefix**: Set `tablePrefix: "myprefix_"` to namespace all tables.
|
|
151
|
+
2. **Granular Overrides**: Override any individual table name via `tables`:
|
|
152
|
+
|
|
153
|
+
```ts [nuxt.config.ts]
|
|
154
|
+
export default defineNuxtConfig({
|
|
155
|
+
modules: ["qarpeo"],
|
|
156
|
+
qarpeo: {
|
|
157
|
+
db: true,
|
|
158
|
+
tablePrefix: "myco_",
|
|
159
|
+
tables: {
|
|
160
|
+
user: "accounts",
|
|
161
|
+
comment: "discussion_posts",
|
|
162
|
+
cmsEntry: "articles",
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
})
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## CLI Tools (`qp` / `qarpeo`)
|
|
84
171
|
|
|
85
|
-
Qarpeo includes an integrated CLI for health diagnostics, database migrations, and
|
|
172
|
+
Qarpeo includes an integrated CLI for health diagnostics, database migrations, secrets, and deployment:
|
|
86
173
|
|
|
87
174
|
```bash
|
|
88
175
|
# Validate Cloudflare bindings, migrations, and secrets
|
|
@@ -91,9 +178,10 @@ vpx qp doctor
|
|
|
91
178
|
# Validate against production/remote deployment criteria
|
|
92
179
|
vpx qp doctor --remote
|
|
93
180
|
|
|
94
|
-
#
|
|
181
|
+
# Database migrations and seed
|
|
95
182
|
vpx qp db list
|
|
96
183
|
vpx qp db push
|
|
184
|
+
vpx qp db seed
|
|
97
185
|
```
|
|
98
186
|
|
|
99
187
|
---
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Nuxt } from "@nuxt/schema";
|
|
2
|
+
import type { createResolver, useLogger } from "@nuxt/kit";
|
|
3
|
+
import type { QarpeoOptions } from "../types";
|
|
4
|
+
export declare function setupCMS(options: QarpeoOptions, nuxt: Nuxt, resolver: ReturnType<typeof createResolver>, logger: ReturnType<typeof useLogger>): Promise<void>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Nuxt } from "@nuxt/schema";
|
|
2
|
+
import type { createResolver, useLogger } from "@nuxt/kit";
|
|
3
|
+
import type { QarpeoOptions } from "../types";
|
|
4
|
+
export declare function setupComments(options: QarpeoOptions, nuxt: Nuxt, resolver: ReturnType<typeof createResolver>, logger: ReturnType<typeof useLogger>): Promise<void>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Nuxt } from "@nuxt/schema";
|
|
2
|
+
import type { createResolver, useLogger } from "@nuxt/kit";
|
|
3
|
+
import type { QarpeoOptions } from "../types";
|
|
4
|
+
export declare function setupPayments(options: QarpeoOptions, nuxt: Nuxt, resolver: ReturnType<typeof createResolver>, logger: ReturnType<typeof useLogger>): Promise<void>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Nuxt } from "@nuxt/schema";
|
|
2
|
+
import type { createResolver, useLogger } from "@nuxt/kit";
|
|
3
|
+
import type { QarpeoOptions } from "../types";
|
|
4
|
+
export declare function setupStore(options: QarpeoOptions, nuxt: Nuxt, resolver: ReturnType<typeof createResolver>, logger: ReturnType<typeof useLogger>): Promise<void>;
|
|
@@ -1,3 +1,104 @@
|
|
|
1
|
+
import { useRuntimeConfig } from 'nuxt/server';
|
|
2
|
+
|
|
3
|
+
function getQarpeoConfig(event) {
|
|
4
|
+
let rc;
|
|
5
|
+
try {
|
|
6
|
+
rc = useRuntimeConfig(event);
|
|
7
|
+
} catch {
|
|
8
|
+
rc = void 0;
|
|
9
|
+
}
|
|
10
|
+
if (!rc || !rc.qarpeo) {
|
|
11
|
+
rc = globalThis.__NUXT_RUNTIME_CONFIG__ || rc || {};
|
|
12
|
+
}
|
|
13
|
+
const q = event?.context?.qarpeo || rc?.qarpeo || {};
|
|
14
|
+
return {
|
|
15
|
+
auth: q.auth || {},
|
|
16
|
+
blob: q.blob || q.storage || {},
|
|
17
|
+
storage: q.storage || q.blob || {},
|
|
18
|
+
cms: q.cms || {},
|
|
19
|
+
comments: q.comments || {},
|
|
20
|
+
payments: q.payments || {},
|
|
21
|
+
ratelimit: q.ratelimit || {},
|
|
22
|
+
realtime: q.realtime || {},
|
|
23
|
+
mail: q.mail || {},
|
|
24
|
+
analytics: q.analytics || {},
|
|
25
|
+
multitenant: q.multitenant || {},
|
|
26
|
+
store: q.store || {},
|
|
27
|
+
agents: q.agents || {},
|
|
28
|
+
jobs: q.jobs || {},
|
|
29
|
+
...q
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function getTablePrefix(event, explicitPrefix) {
|
|
34
|
+
let prefix = explicitPrefix;
|
|
35
|
+
if (prefix === void 0) {
|
|
36
|
+
try {
|
|
37
|
+
const cfg = getQarpeoConfig(event);
|
|
38
|
+
if (cfg) {
|
|
39
|
+
prefix = cfg.tablePrefix ?? cfg.prefix;
|
|
40
|
+
}
|
|
41
|
+
} catch {
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (prefix === void 0 && typeof process !== "undefined" && process?.env) {
|
|
45
|
+
const envVal = process.env.QARPEO_TABLE_PREFIX;
|
|
46
|
+
if (envVal === "1" || envVal === "true") {
|
|
47
|
+
prefix = true;
|
|
48
|
+
} else if (envVal && envVal !== "0" && envVal !== "false") {
|
|
49
|
+
prefix = envVal;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (!prefix || prefix === false) return "";
|
|
53
|
+
if (prefix === true) return "qarpeo_";
|
|
54
|
+
return typeof prefix === "string" && prefix.endsWith("_") ? prefix : `${prefix}_`;
|
|
55
|
+
}
|
|
56
|
+
function getTableOverrides(event) {
|
|
57
|
+
try {
|
|
58
|
+
const cfg = getQarpeoConfig(event);
|
|
59
|
+
if (cfg?.tables && typeof cfg.tables === "object") {
|
|
60
|
+
return cfg.tables;
|
|
61
|
+
}
|
|
62
|
+
} catch {
|
|
63
|
+
}
|
|
64
|
+
if (typeof process !== "undefined" && process?.env?.QARPEO_TABLES) {
|
|
65
|
+
try {
|
|
66
|
+
return JSON.parse(process.env.QARPEO_TABLES);
|
|
67
|
+
} catch {
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return {};
|
|
71
|
+
}
|
|
72
|
+
function toCamelCase(str) {
|
|
73
|
+
return str.replace(/_([a-z0-9])/g, (_, letter) => letter.toUpperCase());
|
|
74
|
+
}
|
|
75
|
+
function resolveTableName(baseName, prefixOrEventOrOptions, event) {
|
|
76
|
+
let explicitPrefix;
|
|
77
|
+
let tablesMap;
|
|
78
|
+
let effectiveEvent = event;
|
|
79
|
+
if (typeof prefixOrEventOrOptions === "object" && prefixOrEventOrOptions !== null && !("req" in prefixOrEventOrOptions && "res" in prefixOrEventOrOptions)) {
|
|
80
|
+
const opts = prefixOrEventOrOptions;
|
|
81
|
+
explicitPrefix = opts.tablePrefix ?? opts.prefix;
|
|
82
|
+
tablesMap = opts.tables;
|
|
83
|
+
} else if (typeof prefixOrEventOrOptions === "boolean" || typeof prefixOrEventOrOptions === "string") {
|
|
84
|
+
explicitPrefix = prefixOrEventOrOptions;
|
|
85
|
+
} else if (prefixOrEventOrOptions) {
|
|
86
|
+
effectiveEvent = prefixOrEventOrOptions;
|
|
87
|
+
}
|
|
88
|
+
const runtimeOverrides = getTableOverrides(effectiveEvent);
|
|
89
|
+
const mergedTables = { ...runtimeOverrides, ...tablesMap || {} };
|
|
90
|
+
const camelKey = toCamelCase(baseName);
|
|
91
|
+
const override = mergedTables[baseName] || mergedTables[camelKey];
|
|
92
|
+
if (override) {
|
|
93
|
+
return override;
|
|
94
|
+
}
|
|
95
|
+
const p = getTablePrefix(effectiveEvent, explicitPrefix);
|
|
96
|
+
return `${p}${baseName}`;
|
|
97
|
+
}
|
|
98
|
+
function resolveIndexName(tableName, suffix) {
|
|
99
|
+
return `idx_${tableName}_${suffix}`;
|
|
100
|
+
}
|
|
101
|
+
|
|
1
102
|
const ALL_AUTH_TABLE_NAMES = [
|
|
2
103
|
"user",
|
|
3
104
|
"account",
|
|
@@ -10,13 +111,25 @@ const ALL_AUTH_TABLE_NAMES = [
|
|
|
10
111
|
"invitation",
|
|
11
112
|
"auditLogs"
|
|
12
113
|
];
|
|
13
|
-
function getActiveAuthTableNames(auth) {
|
|
114
|
+
function getActiveAuthTableNames(auth, prefixOrOptions) {
|
|
14
115
|
if (!auth) return [];
|
|
15
116
|
const opts = typeof auth === "object" ? auth : {};
|
|
16
|
-
const tables = [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
117
|
+
const tables = [
|
|
118
|
+
resolveTableName("user", prefixOrOptions),
|
|
119
|
+
resolveTableName("account", prefixOrOptions),
|
|
120
|
+
resolveTableName("session", prefixOrOptions),
|
|
121
|
+
resolveTableName("verification", prefixOrOptions),
|
|
122
|
+
resolveTableName("audit_log", prefixOrOptions)
|
|
123
|
+
];
|
|
124
|
+
if (opts.twoFactor) tables.push(resolveTableName("two_factor", prefixOrOptions));
|
|
125
|
+
if (opts.webauthn || opts.webAuthn) tables.push(resolveTableName("passkey", prefixOrOptions));
|
|
126
|
+
if (opts.organizations) {
|
|
127
|
+
tables.push(
|
|
128
|
+
resolveTableName("organization", prefixOrOptions),
|
|
129
|
+
resolveTableName("member", prefixOrOptions),
|
|
130
|
+
resolveTableName("invitation", prefixOrOptions)
|
|
131
|
+
);
|
|
132
|
+
}
|
|
20
133
|
return tables;
|
|
21
134
|
}
|
|
22
135
|
function compileExtendedField(key, def) {
|
|
@@ -30,6 +143,7 @@ function compileExtendedField(key, def) {
|
|
|
30
143
|
case "number": {
|
|
31
144
|
let chain = `integer("${key}")`;
|
|
32
145
|
if (def.default !== void 0) chain += `.default(${Number(def.default)})`;
|
|
146
|
+
if (def.nullable === false) chain += `.notNull()`;
|
|
33
147
|
return ` ${key}: ${chain},`;
|
|
34
148
|
}
|
|
35
149
|
case "boolean": {
|
|
@@ -44,16 +158,27 @@ function compileExtendedField(key, def) {
|
|
|
44
158
|
return ` ${key}: text("${key}"),`;
|
|
45
159
|
}
|
|
46
160
|
}
|
|
47
|
-
function generateAuthSchema(auth) {
|
|
161
|
+
function generateAuthSchema(auth, prefixOrOptions) {
|
|
48
162
|
const opts = typeof auth === "object" ? auth : {};
|
|
49
163
|
const extendsFields = opts.fields?.extends || {};
|
|
164
|
+
const userTbl = resolveTableName("user", prefixOrOptions);
|
|
165
|
+
const sessionTbl = resolveTableName("session", prefixOrOptions);
|
|
166
|
+
const accountTbl = resolveTableName("account", prefixOrOptions);
|
|
167
|
+
const verificationTbl = resolveTableName("verification", prefixOrOptions);
|
|
168
|
+
const auditLogTbl = resolveTableName("audit_log", prefixOrOptions);
|
|
169
|
+
const twoFactorTbl = resolveTableName("two_factor", prefixOrOptions);
|
|
170
|
+
const passkeyTbl = resolveTableName("passkey", prefixOrOptions);
|
|
171
|
+
const organizationTbl = resolveTableName("organization", prefixOrOptions);
|
|
172
|
+
const memberTbl = resolveTableName("member", prefixOrOptions);
|
|
173
|
+
const invitationTbl = resolveTableName("invitation", prefixOrOptions);
|
|
50
174
|
const lines = [
|
|
51
175
|
`// Auto-generated by Qarpeo for Better Auth on Cloudflare D1`,
|
|
176
|
+
`// snakeCase.table maps camelCase property names \u2192 snake_case column names automatically`,
|
|
52
177
|
`import { sql } from "drizzle-orm";
|
|
53
|
-
import {
|
|
178
|
+
import { snakeCase, text, integer, blob, index } from "drizzle-orm/sqlite-core";`,
|
|
54
179
|
``,
|
|
55
180
|
`// \u2500\u2500\u2500 1. User Table \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`,
|
|
56
|
-
`export const user =
|
|
181
|
+
`export const user = snakeCase.table("${userTbl}", {`,
|
|
57
182
|
` id: text("id").primaryKey(),`,
|
|
58
183
|
` name: text("name").notNull(),`,
|
|
59
184
|
` email: text("email").notNull().unique(),`,
|
|
@@ -70,9 +195,10 @@ import { sqliteTable, text, integer, blob, index } from "drizzle-orm/sqlite-core
|
|
|
70
195
|
` createdAt: integer("created_at", { mode: "timestamp_ms" }).notNull().default(sql\`(cast(unixepoch('subsecond') * 1000 as integer))\`),`,
|
|
71
196
|
` updatedAt: integer("updated_at", { mode: "timestamp_ms" }).notNull().default(sql\`(cast(unixepoch('subsecond') * 1000 as integer))\`).$onUpdate(() => new Date()),`,
|
|
72
197
|
`});`,
|
|
198
|
+
`export const users = user;`,
|
|
73
199
|
``,
|
|
74
200
|
`// \u2500\u2500\u2500 2. Session Table \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`,
|
|
75
|
-
`export const session =
|
|
201
|
+
`export const session = snakeCase.table("${sessionTbl}", {`,
|
|
76
202
|
` id: text("id").primaryKey(),`,
|
|
77
203
|
` expiresAt: integer("expires_at", { mode: "timestamp_ms" }).notNull(),`,
|
|
78
204
|
` token: text("token").notNull().unique(),`,
|
|
@@ -82,12 +208,13 @@ import { sqliteTable, text, integer, blob, index } from "drizzle-orm/sqlite-core
|
|
|
82
208
|
` userAgent: text("user_agent"),`,
|
|
83
209
|
` userId: text("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),`,
|
|
84
210
|
`}, (table) => [`,
|
|
85
|
-
` index("
|
|
86
|
-
` index("
|
|
211
|
+
` index("${resolveIndexName(sessionTbl, "user_id")}").on(table.userId),`,
|
|
212
|
+
` index("${resolveIndexName(sessionTbl, "token")}").on(table.token),`,
|
|
87
213
|
`]);`,
|
|
214
|
+
`export const sessions = session;`,
|
|
88
215
|
``,
|
|
89
216
|
`// \u2500\u2500\u2500 3. Account Table (OAuth & Passwords) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`,
|
|
90
|
-
`export const account =
|
|
217
|
+
`export const account = snakeCase.table("${accountTbl}", {`,
|
|
91
218
|
` id: text("id").primaryKey(),`,
|
|
92
219
|
` accountId: text("account_id").notNull(),`,
|
|
93
220
|
` providerId: text("provider_id").notNull(),`,
|
|
@@ -102,11 +229,12 @@ import { sqliteTable, text, integer, blob, index } from "drizzle-orm/sqlite-core
|
|
|
102
229
|
` createdAt: integer("created_at", { mode: "timestamp_ms" }).notNull().default(sql\`(cast(unixepoch('subsecond') * 1000 as integer))\`),`,
|
|
103
230
|
` updatedAt: integer("updated_at", { mode: "timestamp_ms" }).notNull().default(sql\`(cast(unixepoch('subsecond') * 1000 as integer))\`).$onUpdate(() => new Date()),`,
|
|
104
231
|
`}, (table) => [`,
|
|
105
|
-
` index("
|
|
232
|
+
` index("${resolveIndexName(accountTbl, "user_id")}").on(table.userId),`,
|
|
106
233
|
`]);`,
|
|
234
|
+
`export const accounts = account;`,
|
|
107
235
|
``,
|
|
108
236
|
`// \u2500\u2500\u2500 4. Verification Table (Tokens & OTP) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`,
|
|
109
|
-
`export const verification =
|
|
237
|
+
`export const verification = snakeCase.table("${verificationTbl}", {`,
|
|
110
238
|
` id: text("id").primaryKey(),`,
|
|
111
239
|
` identifier: text("identifier").notNull(),`,
|
|
112
240
|
` value: text("value").notNull(),`,
|
|
@@ -114,9 +242,10 @@ import { sqliteTable, text, integer, blob, index } from "drizzle-orm/sqlite-core
|
|
|
114
242
|
` createdAt: integer("created_at", { mode: "timestamp_ms" }),`,
|
|
115
243
|
` updatedAt: integer("updated_at", { mode: "timestamp_ms" }),`,
|
|
116
244
|
`});`,
|
|
245
|
+
`export const verifications = verification;`,
|
|
117
246
|
``,
|
|
118
247
|
`// \u2500\u2500\u2500 5. Audit Logs Table \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`,
|
|
119
|
-
`export const auditLogs =
|
|
248
|
+
`export const auditLogs = snakeCase.table("${auditLogTbl}", {`,
|
|
120
249
|
` id: text("id").primaryKey().$defaultFn(() => crypto.randomUUID()),`,
|
|
121
250
|
` userId: text("user_id"),`,
|
|
122
251
|
` action: text("action").notNull(),`,
|
|
@@ -132,19 +261,19 @@ import { sqliteTable, text, integer, blob, index } from "drizzle-orm/sqlite-core
|
|
|
132
261
|
` .notNull()`,
|
|
133
262
|
` .$defaultFn(() => new Date()),`,
|
|
134
263
|
`}, (table) => [`,
|
|
135
|
-
` index("
|
|
136
|
-
` index("
|
|
137
|
-
` index("
|
|
138
|
-
` index("
|
|
264
|
+
` index("${resolveIndexName(auditLogTbl, "user_id")}").on(table.userId),`,
|
|
265
|
+
` index("${resolveIndexName(auditLogTbl, "action")}").on(table.action),`,
|
|
266
|
+
` index("${resolveIndexName(auditLogTbl, "target")}").on(table.targetType, table.targetId),`,
|
|
267
|
+
` index("${resolveIndexName(auditLogTbl, "created_at")}").on(table.createdAt),`,
|
|
139
268
|
`]);`,
|
|
140
|
-
`export const
|
|
269
|
+
`export const auditLog = auditLogs;`,
|
|
141
270
|
`export { auditLogs as audit_logs };`
|
|
142
271
|
);
|
|
143
272
|
if (opts.twoFactor) {
|
|
144
273
|
lines.push(
|
|
145
274
|
``,
|
|
146
|
-
`// \u2500\u2500\u2500
|
|
147
|
-
`export const twoFactor =
|
|
275
|
+
`// \u2500\u2500\u2500 6. Two-Factor Authentication Table (TOTP) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`,
|
|
276
|
+
`export const twoFactor = snakeCase.table("${twoFactorTbl}", {`,
|
|
148
277
|
` id: text("id").primaryKey(),`,
|
|
149
278
|
` userId: text("user_id").notNull().unique().references(() => user.id, { onDelete: "cascade" }),`,
|
|
150
279
|
` secret: text("secret").notNull(),`,
|
|
@@ -156,8 +285,8 @@ import { sqliteTable, text, integer, blob, index } from "drizzle-orm/sqlite-core
|
|
|
156
285
|
if (opts.webauthn || opts.webAuthn) {
|
|
157
286
|
lines.push(
|
|
158
287
|
``,
|
|
159
|
-
`// \u2500\u2500\u2500
|
|
160
|
-
`export const passkey =
|
|
288
|
+
`// \u2500\u2500\u2500 7. Passkeys Table \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`,
|
|
289
|
+
`export const passkey = snakeCase.table("${passkeyTbl}", {`,
|
|
161
290
|
` id: text("id").primaryKey(),`,
|
|
162
291
|
` name: text("name"),`,
|
|
163
292
|
` publicKey: text("public_key").notNull(),`,
|
|
@@ -174,8 +303,8 @@ import { sqliteTable, text, integer, blob, index } from "drizzle-orm/sqlite-core
|
|
|
174
303
|
if (opts.organizations) {
|
|
175
304
|
lines.push(
|
|
176
305
|
``,
|
|
177
|
-
`// \u2500\u2500\u2500
|
|
178
|
-
`export const organization =
|
|
306
|
+
`// \u2500\u2500\u2500 8. Organizations & Members Tables \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`,
|
|
307
|
+
`export const organization = snakeCase.table("${organizationTbl}", {`,
|
|
179
308
|
` id: text("id").primaryKey(),`,
|
|
180
309
|
` name: text("name").notNull(),`,
|
|
181
310
|
` slug: text("slug").notNull().unique(),`,
|
|
@@ -183,16 +312,18 @@ import { sqliteTable, text, integer, blob, index } from "drizzle-orm/sqlite-core
|
|
|
183
312
|
` metadata: text("metadata"),`,
|
|
184
313
|
` createdAt: integer("created_at", { mode: "timestamp_ms" }).notNull().default(sql\`(cast(unixepoch('subsecond') * 1000 as integer))\`),`,
|
|
185
314
|
`});`,
|
|
315
|
+
`export const organizations = organization;`,
|
|
186
316
|
``,
|
|
187
|
-
`export const member =
|
|
317
|
+
`export const member = snakeCase.table("${memberTbl}", {`,
|
|
188
318
|
` id: text("id").primaryKey(),`,
|
|
189
319
|
` organizationId: text("organization_id").notNull().references(() => organization.id, { onDelete: "cascade" }),`,
|
|
190
320
|
` userId: text("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),`,
|
|
191
321
|
` role: text("role").notNull().default("member"),`,
|
|
192
322
|
` createdAt: integer("created_at", { mode: "timestamp_ms" }).notNull().default(sql\`(cast(unixepoch('subsecond') * 1000 as integer))\`),`,
|
|
193
323
|
`});`,
|
|
324
|
+
`export const members = member;`,
|
|
194
325
|
``,
|
|
195
|
-
`export const invitation =
|
|
326
|
+
`export const invitation = snakeCase.table("${invitationTbl}", {`,
|
|
196
327
|
` id: text("id").primaryKey(),`,
|
|
197
328
|
` organizationId: text("organization_id").notNull().references(() => organization.id, { onDelete: "cascade" }),`,
|
|
198
329
|
` email: text("email").notNull(),`,
|
|
@@ -200,7 +331,8 @@ import { sqliteTable, text, integer, blob, index } from "drizzle-orm/sqlite-core
|
|
|
200
331
|
` status: text("status").notNull().default("pending"),`,
|
|
201
332
|
` expiresAt: integer("expires_at", { mode: "timestamp_ms" }).notNull(),`,
|
|
202
333
|
` inviterId: text("inviter_id").notNull().references(() => user.id, { onDelete: "cascade" }),`,
|
|
203
|
-
`})
|
|
334
|
+
`});`,
|
|
335
|
+
`export const invitations = invitation;`
|
|
204
336
|
);
|
|
205
337
|
}
|
|
206
338
|
if (!opts.twoFactor) {
|
|
@@ -222,4 +354,11 @@ import { sqliteTable, text, integer, blob, index } from "drizzle-orm/sqlite-core
|
|
|
222
354
|
return lines.join("\n") + "\n";
|
|
223
355
|
}
|
|
224
356
|
|
|
225
|
-
|
|
357
|
+
const authSchema = {
|
|
358
|
+
__proto__: null,
|
|
359
|
+
ALL_AUTH_TABLE_NAMES: ALL_AUTH_TABLE_NAMES,
|
|
360
|
+
generateAuthSchema: generateAuthSchema,
|
|
361
|
+
getActiveAuthTableNames: getActiveAuthTableNames
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
export { resolveIndexName as a, getActiveAuthTableNames as b, authSchema as c, generateAuthSchema as g, resolveTableName as r };
|