qarpeo 0.1.35 → 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 -5118
- 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 +3 -3
- 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 +406 -1288
- 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
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { getKVBinding } from "../../kv.mjs";
|
|
2
2
|
import { getQarpeoConfig } from "./config.mjs";
|
|
3
|
+
import { resolveTableName } from "./table-names.mjs";
|
|
4
|
+
function domainTbl(event) {
|
|
5
|
+
return resolveTableName("domain", event);
|
|
6
|
+
}
|
|
3
7
|
const devDomainsStore = /* @__PURE__ */ new Map();
|
|
4
8
|
const devCache = /* @__PURE__ */ new Map();
|
|
5
9
|
export function normalizeDomain(input) {
|
|
@@ -168,7 +172,7 @@ export async function registerCustomDomain(tenantId, rawDomain, options = {}, ev
|
|
|
168
172
|
const db = event?.context?.db;
|
|
169
173
|
if (db) {
|
|
170
174
|
await db.run(
|
|
171
|
-
`INSERT OR REPLACE INTO
|
|
175
|
+
`INSERT OR REPLACE INTO ${domainTbl(event)}
|
|
172
176
|
(id, tenant_id, domain, status, ssl_status, verification_type, verification_target, cloudflare_hostname_id, created_at, updated_at)
|
|
173
177
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
|
174
178
|
[
|
|
@@ -226,7 +230,7 @@ export async function verifyCustomDomain(rawDomain, event) {
|
|
|
226
230
|
const db = event?.context?.db;
|
|
227
231
|
if (db) {
|
|
228
232
|
await db.run(
|
|
229
|
-
`UPDATE
|
|
233
|
+
`UPDATE ${domainTbl(event)} SET status = ?, ssl_status = ?, updated_at = ? WHERE domain = ?`,
|
|
230
234
|
[record.status, record.sslStatus, now, domain]
|
|
231
235
|
);
|
|
232
236
|
}
|
|
@@ -242,7 +246,7 @@ export async function getCustomDomain(rawDomain, event) {
|
|
|
242
246
|
try {
|
|
243
247
|
const db = event?.context?.db;
|
|
244
248
|
if (db) {
|
|
245
|
-
const rows = await db.all(`SELECT * FROM
|
|
249
|
+
const rows = await db.all(`SELECT * FROM ${domainTbl(event)} WHERE domain = ? LIMIT 1`, [domain]);
|
|
246
250
|
if (rows?.[0]) {
|
|
247
251
|
const row = rows[0];
|
|
248
252
|
const rec = {
|
|
@@ -275,7 +279,7 @@ export async function listTenantDomains(tenantId, event) {
|
|
|
275
279
|
const db = event?.context?.db;
|
|
276
280
|
if (db) {
|
|
277
281
|
const rows = await db.all(
|
|
278
|
-
`SELECT * FROM
|
|
282
|
+
`SELECT * FROM ${domainTbl(event)} WHERE tenant_id = ? ORDER BY created_at DESC`,
|
|
279
283
|
[tenantId]
|
|
280
284
|
);
|
|
281
285
|
for (const row of rows || []) {
|
|
@@ -318,7 +322,7 @@ export async function deleteCustomDomain(rawDomain, event) {
|
|
|
318
322
|
try {
|
|
319
323
|
const db = event?.context?.db;
|
|
320
324
|
if (db) {
|
|
321
|
-
await db.run(`DELETE FROM
|
|
325
|
+
await db.run(`DELETE FROM ${domainTbl(event)} WHERE domain = ?`, [domain]);
|
|
322
326
|
}
|
|
323
327
|
} catch {
|
|
324
328
|
}
|
|
@@ -2,9 +2,41 @@ import * as _schema from "#qarpeo/schema";
|
|
|
2
2
|
import type { CFEvent, QarpeoDrizzleDB, InferDrizzleRelations } from "../../index";
|
|
3
3
|
export type { QarpeoDrizzleDB, InferDrizzleRelations } from "../../index";
|
|
4
4
|
type SchemaRelations = InferDrizzleRelations<typeof _schema>;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
export interface UseDrizzleOptions<S extends Record<string, unknown> = typeof _schema> {
|
|
6
|
+
schema?: S;
|
|
7
|
+
event?: CFEvent;
|
|
8
|
+
}
|
|
9
|
+
/** Access a typed Drizzle ORM client connected to Cloudflare D1 or PostgreSQL. */
|
|
10
|
+
export declare function useDrizzle<S extends Record<string, unknown> = typeof _schema>(bindingName?: string, eventOrOptions?: CFEvent | UseDrizzleOptions<S>): QarpeoDrizzleDB<InferDrizzleRelations<S>>;
|
|
11
|
+
/**
|
|
12
|
+
* Primary typed database accessor for Cloudflare D1 or PostgreSQL.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* // Default primary D1 database
|
|
17
|
+
* const db = useDb()
|
|
18
|
+
* const users = await db.query.users.findMany()
|
|
19
|
+
*
|
|
20
|
+
* // Secondary D1 database (e.g. db/d1-analytics/ or ANALYTICS_DB)
|
|
21
|
+
* const analytics = useDb("analytics")
|
|
22
|
+
*
|
|
23
|
+
* // PostgreSQL via Hyperdrive
|
|
24
|
+
* const warehouse = useDb("postgres")
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare function useDb<S extends Record<string, unknown> = typeof _schema>(bindingName?: string, eventOrOptions?: CFEvent | UseDrizzleOptions<S>): QarpeoDrizzleDB<InferDrizzleRelations<S>>;
|
|
7
28
|
/** Auto-imported `db` client wrapping Cloudflare D1 with Drizzle ORM. */
|
|
8
29
|
export declare const db: QarpeoDrizzleDB<SchemaRelations>;
|
|
9
|
-
/**
|
|
30
|
+
/** Auto-imported `d1Db` alias for the primary D1 database. */
|
|
31
|
+
export declare const d1Db: QarpeoDrizzleDB<import("drizzle-orm").ExtractTablesWithRelations<{}, import("drizzle-orm").ExtractTablesFromSchema<import("drizzle-orm").ExtractTablesFromSchema<typeof _schema>>>>;
|
|
32
|
+
/**
|
|
33
|
+
* Creates a lazily-evaluated Proxy around a named database binding.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* export const d1AnalyticsDb = createDbProxy("analytics")
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare function createDbProxy(name?: string): QarpeoDrizzleDB<SchemaRelations>;
|
|
41
|
+
/** All exported tables, views, and relations from your schema (e.g. `db/d1/schema/` or `db/schema.ts`). */
|
|
10
42
|
export declare const schema: typeof _schema;
|
|
@@ -1,22 +1,112 @@
|
|
|
1
1
|
import { defineRelations } from "drizzle-orm";
|
|
2
2
|
import { drizzle as drizzleD1 } from "drizzle-orm/d1";
|
|
3
|
+
import { drizzle as drizzlePostgres } from "drizzle-orm/postgres-js";
|
|
4
|
+
import postgres from "postgres";
|
|
3
5
|
import * as _schema from "#qarpeo/schema";
|
|
4
|
-
import { getD1Binding } from "../../index.mjs";
|
|
6
|
+
import { getD1Binding, getDatabaseInfo } from "../../index.mjs";
|
|
5
7
|
const drizzleCache = /* @__PURE__ */ new WeakMap();
|
|
6
|
-
|
|
8
|
+
const pgDrizzleCache = /* @__PURE__ */ new Map();
|
|
9
|
+
export function useDrizzle(bindingName, eventOrOptions) {
|
|
10
|
+
let event;
|
|
11
|
+
let activeSchema = _schema;
|
|
12
|
+
if (eventOrOptions) {
|
|
13
|
+
if ("node" in eventOrOptions || "context" in eventOrOptions || "req" in eventOrOptions) {
|
|
14
|
+
event = eventOrOptions;
|
|
15
|
+
} else if ("schema" in eventOrOptions || "event" in eventOrOptions) {
|
|
16
|
+
const opts = eventOrOptions;
|
|
17
|
+
if (opts.schema) activeSchema = opts.schema;
|
|
18
|
+
if (opts.event) event = opts.event;
|
|
19
|
+
} else {
|
|
20
|
+
event = eventOrOptions;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
const dbInfo = getDatabaseInfo(bindingName, event);
|
|
24
|
+
if (dbInfo.isPostgres && dbInfo.url) {
|
|
25
|
+
const isDefaultSchema2 = activeSchema === _schema;
|
|
26
|
+
const cacheKey = `${dbInfo.url}:${isDefaultSchema2 ? "default" : "custom"}`;
|
|
27
|
+
let pgInstance = pgDrizzleCache.get(cacheKey);
|
|
28
|
+
if (!pgInstance) {
|
|
29
|
+
const client = postgres(dbInfo.url, {
|
|
30
|
+
prepare: false,
|
|
31
|
+
max: 1
|
|
32
|
+
});
|
|
33
|
+
const relations = defineRelations(activeSchema);
|
|
34
|
+
const rawDrizzle = drizzlePostgres({
|
|
35
|
+
client,
|
|
36
|
+
relations,
|
|
37
|
+
schema: activeSchema
|
|
38
|
+
});
|
|
39
|
+
pgInstance = Object.assign(rawDrizzle, {
|
|
40
|
+
raw: () => client
|
|
41
|
+
});
|
|
42
|
+
if (isDefaultSchema2) {
|
|
43
|
+
pgDrizzleCache.set(cacheKey, pgInstance);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return pgInstance;
|
|
47
|
+
}
|
|
48
|
+
if (dbInfo.isMysql) {
|
|
49
|
+
if (!dbInfo.url) {
|
|
50
|
+
throw new Error(
|
|
51
|
+
`[qarpeo] MySQL database detected but no connection URL found.
|
|
52
|
+
Ensure your Hyperdrive binding exposes a connectionString (or set DATABASE_URL).`
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
let mysqlLib;
|
|
56
|
+
let drizzleMysql;
|
|
57
|
+
try {
|
|
58
|
+
const req = globalThis.require || (typeof globalThis.process !== "undefined" && typeof require !== "undefined" ? require : void 0);
|
|
59
|
+
if (req) {
|
|
60
|
+
mysqlLib = req("mysql2/promise");
|
|
61
|
+
drizzleMysql = req("drizzle-orm/mysql2").drizzle;
|
|
62
|
+
}
|
|
63
|
+
} catch {
|
|
64
|
+
}
|
|
65
|
+
if (!mysqlLib || !drizzleMysql) {
|
|
66
|
+
throw new Error(
|
|
67
|
+
`[qarpeo] MySQL runtime client requires the \`mysql2\` package.
|
|
68
|
+
Install it with: pnpm add mysql2`
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
const isDefaultSchema2 = activeSchema === _schema;
|
|
72
|
+
const cacheKey = `mysql:${dbInfo.url}:${isDefaultSchema2 ? "default" : "custom"}`;
|
|
73
|
+
let mysqlInstance = pgDrizzleCache.get(cacheKey);
|
|
74
|
+
if (!mysqlInstance) {
|
|
75
|
+
const pool = mysqlLib.createPool(dbInfo.url);
|
|
76
|
+
const relations = defineRelations(activeSchema);
|
|
77
|
+
const rawDrizzle = drizzleMysql(pool, {
|
|
78
|
+
relations,
|
|
79
|
+
schema: activeSchema,
|
|
80
|
+
mode: "default"
|
|
81
|
+
});
|
|
82
|
+
mysqlInstance = Object.assign(rawDrizzle, {
|
|
83
|
+
raw: () => pool
|
|
84
|
+
});
|
|
85
|
+
if (isDefaultSchema2) {
|
|
86
|
+
pgDrizzleCache.set(cacheKey, mysqlInstance);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return mysqlInstance;
|
|
90
|
+
}
|
|
7
91
|
const resolvedBinding = bindingName || globalThis.process?.env?.QARPEO_DEFAULT_DB_BINDING || "DB";
|
|
8
92
|
const d1 = getD1Binding(resolvedBinding, event);
|
|
9
|
-
|
|
93
|
+
const isDefaultSchema = activeSchema === _schema;
|
|
94
|
+
let instance = isDefaultSchema ? drizzleCache.get(d1) : void 0;
|
|
10
95
|
if (!instance) {
|
|
11
|
-
const relations = defineRelations(
|
|
12
|
-
const rawDrizzle = drizzleD1(d1, { relations });
|
|
96
|
+
const relations = defineRelations(activeSchema);
|
|
97
|
+
const rawDrizzle = drizzleD1(d1, { relations, schema: activeSchema });
|
|
13
98
|
instance = Object.assign(rawDrizzle, {
|
|
14
99
|
raw: (bName) => getD1Binding(bName || resolvedBinding, event)
|
|
15
100
|
});
|
|
16
|
-
|
|
101
|
+
if (isDefaultSchema) {
|
|
102
|
+
drizzleCache.set(d1, instance);
|
|
103
|
+
}
|
|
17
104
|
}
|
|
18
105
|
return instance;
|
|
19
106
|
}
|
|
107
|
+
export function useDb(bindingName, eventOrOptions) {
|
|
108
|
+
return useDrizzle(bindingName, eventOrOptions);
|
|
109
|
+
}
|
|
20
110
|
export const db = new Proxy(
|
|
21
111
|
{},
|
|
22
112
|
{
|
|
@@ -33,4 +123,23 @@ export const db = new Proxy(
|
|
|
33
123
|
}
|
|
34
124
|
}
|
|
35
125
|
);
|
|
126
|
+
export const d1Db = db;
|
|
127
|
+
export function createDbProxy(name) {
|
|
128
|
+
return new Proxy(
|
|
129
|
+
{},
|
|
130
|
+
{
|
|
131
|
+
get(_target, prop) {
|
|
132
|
+
if (prop === "raw") {
|
|
133
|
+
return (bindingName) => getD1Binding(bindingName || name);
|
|
134
|
+
}
|
|
135
|
+
const instance = useDrizzle(name);
|
|
136
|
+
const val = instance[prop];
|
|
137
|
+
if (typeof val === "function") {
|
|
138
|
+
return val.bind(instance);
|
|
139
|
+
}
|
|
140
|
+
return val;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
}
|
|
36
145
|
export const schema = _schema;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { CFEvent } from "../../types/index";
|
|
2
|
+
import type { DurableObjectId, DurableObjectNamespace, DurableObjectStorage, DurableObjectState, DurableObjectRPCStub, DurableObjectDefinition, DurableObjectClass, SqlStorage, SqlStorageCursor } from "../../types/durable-object";
|
|
3
|
+
export type { DurableObjectId, DurableObjectStub, DurableObjectNamespace, DurableObjectStorage, DurableObjectState, DurableObjectContext, DurableObjectRPCStub, DurableObjectDefinition, DurableObjectClass, DurableObjectsOptions, SqlStorage, SqlStorageCursor, } from "../../types/durable-object";
|
|
4
|
+
export declare class InMemorySqlStorageCursor<T = Record<string, any>> implements SqlStorageCursor<T> {
|
|
5
|
+
private readonly rows;
|
|
6
|
+
readonly columnNames: string[];
|
|
7
|
+
readonly rowsRead: number;
|
|
8
|
+
readonly rowsWritten: number;
|
|
9
|
+
constructor(rows: T[], columnNames?: string[], rowsRead?: number, rowsWritten?: number);
|
|
10
|
+
toArray(): T[];
|
|
11
|
+
one(): T | null;
|
|
12
|
+
[Symbol.iterator](): Iterator<T>;
|
|
13
|
+
}
|
|
14
|
+
export declare class InMemorySqlStorage implements SqlStorage {
|
|
15
|
+
private tables;
|
|
16
|
+
get databaseSize(): number;
|
|
17
|
+
exec<T = Record<string, any>>(query: string, ...bindings: any[]): SqlStorageCursor<T>;
|
|
18
|
+
private evalCondition;
|
|
19
|
+
}
|
|
20
|
+
export declare class InMemoryDurableObjectStorage implements DurableObjectStorage {
|
|
21
|
+
private store;
|
|
22
|
+
private alarmTime;
|
|
23
|
+
readonly sql: SqlStorage;
|
|
24
|
+
get<T = unknown>(keyOrKeys: string | string[]): Promise<any>;
|
|
25
|
+
put<T = unknown>(keyOrEntries: string | Record<string, T>, value?: T): Promise<void>;
|
|
26
|
+
delete(keyOrKeys: string | string[]): Promise<any>;
|
|
27
|
+
deleteAll(): Promise<void>;
|
|
28
|
+
list<T = unknown>(options?: {
|
|
29
|
+
start?: string;
|
|
30
|
+
startAfter?: string;
|
|
31
|
+
end?: string;
|
|
32
|
+
prefix?: string;
|
|
33
|
+
reverse?: boolean;
|
|
34
|
+
limit?: number;
|
|
35
|
+
}): Promise<Map<string, T>>;
|
|
36
|
+
transaction<T>(closure: (txn: DurableObjectStorage) => Promise<T>): Promise<T>;
|
|
37
|
+
setAlarm(scheduledTime: number | Date): Promise<void>;
|
|
38
|
+
getAlarm(): Promise<number | null>;
|
|
39
|
+
deleteAlarm(): Promise<void>;
|
|
40
|
+
private clone;
|
|
41
|
+
}
|
|
42
|
+
export declare class InMemoryDurableObjectState implements DurableObjectState {
|
|
43
|
+
id: DurableObjectId;
|
|
44
|
+
storage: DurableObjectStorage;
|
|
45
|
+
private webSockets;
|
|
46
|
+
constructor(name: string);
|
|
47
|
+
waitUntil(_promise: Promise<unknown>): void;
|
|
48
|
+
blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
|
|
49
|
+
acceptWebSocket(ws: WebSocket): void;
|
|
50
|
+
getWebSockets(): WebSocket[];
|
|
51
|
+
}
|
|
52
|
+
/** Register a Durable Object class in the local simulation registry. */
|
|
53
|
+
export declare function registerDurableObject(name: string, doClass: DurableObjectClass): void;
|
|
54
|
+
/** Clear all in-memory Durable Object instances and registered classes (useful in tests). */
|
|
55
|
+
export declare function clearDurableObjectStore(): void;
|
|
56
|
+
/**
|
|
57
|
+
* Defines a modern Cloudflare Durable Object with Remote Procedure Call (RPC) support.
|
|
58
|
+
*
|
|
59
|
+
* Supports both object-literal syntax (with `this.storage`, `this.state`, and `this.env`)
|
|
60
|
+
* and class syntax.
|
|
61
|
+
*
|
|
62
|
+
* @example Object-literal syntax with RPC methods:
|
|
63
|
+
* ```ts
|
|
64
|
+
* export default defineDurableObject({
|
|
65
|
+
* async increment(by: number = 1) {
|
|
66
|
+
* const current = (await this.storage.get<number>("count")) || 0
|
|
67
|
+
* const next = current + by
|
|
68
|
+
* await this.storage.put("count", next)
|
|
69
|
+
* return next
|
|
70
|
+
* },
|
|
71
|
+
* async getCount() {
|
|
72
|
+
* return (await this.storage.get<number>("count")) || 0
|
|
73
|
+
* }
|
|
74
|
+
* })
|
|
75
|
+
* ```
|
|
76
|
+
*
|
|
77
|
+
* @example Class syntax:
|
|
78
|
+
* ```ts
|
|
79
|
+
* export default defineDurableObject(class CounterDO {
|
|
80
|
+
* constructor(public state: DurableObjectState, public env: Record<string, any>) {}
|
|
81
|
+
* async increment(by: number = 1) {
|
|
82
|
+
* const current = (await this.state.storage.get<number>("count")) || 0
|
|
83
|
+
* await this.state.storage.put("count", current + by)
|
|
84
|
+
* return current + by
|
|
85
|
+
* }
|
|
86
|
+
* })
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
export declare function defineDurableObject<T extends Record<string, any>>(definitionOrClass: DurableObjectDefinition<T>): DurableObjectClass<T>;
|
|
90
|
+
/**
|
|
91
|
+
* Access a typed Cloudflare Durable Object Namespace.
|
|
92
|
+
*
|
|
93
|
+
* @param bindingName Binding name (e.g. "COUNTER", "QARPEO_ROOM_DO") or Durable Object class
|
|
94
|
+
* @param event Optional event context
|
|
95
|
+
*/
|
|
96
|
+
export declare function getDurableObjectNamespace<T = Record<string, any>>(bindingName: string | DurableObjectClass<T>, event?: CFEvent): DurableObjectNamespace<T>;
|
|
97
|
+
/**
|
|
98
|
+
* Access a modern typed Durable Object RPC stub by binding name and ID or name.
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```ts
|
|
102
|
+
* const counter = useDurableObject<CounterDO>("COUNTER", "user_42", event)
|
|
103
|
+
* const count = await counter.increment(5) // Direct RPC call!
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
export declare function useDurableObject<T = Record<string, any>>(bindingName: string | DurableObjectClass<T>, idOrName: string | DurableObjectId, event?: CFEvent): DurableObjectRPCStub<T>;
|