qarpeo 0.0.0-alpha.10
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/LICENSE +21 -0
- package/README.md +102 -0
- package/dist/chunks/auth-schema.mjs +219 -0
- package/dist/chunks/wrangler.mjs +783 -0
- package/dist/cli/index.mjs +1085 -0
- package/dist/dev/env.d.ts +12 -0
- package/dist/dev/wrangler.d.ts +18 -0
- package/dist/module.d.ts +16 -0
- package/dist/module.mjs +4436 -0
- package/dist/runtime/ai.d.ts +25 -0
- package/dist/runtime/ai.mjs +106 -0
- package/dist/runtime/analytics.d.ts +24 -0
- package/dist/runtime/analytics.mjs +38 -0
- package/dist/runtime/app/components/BlobImage.vue +100 -0
- package/dist/runtime/app/components/CMSBlocks.vue +93 -0
- package/dist/runtime/app/components/CMSContent.vue +23 -0
- package/dist/runtime/app/components/CMSImage.vue +49 -0
- package/dist/runtime/app/components/CMSLocaleSwitcher.vue +110 -0
- package/dist/runtime/app/components/CMSPreviewBanner.vue +79 -0
- package/dist/runtime/app/components/CMSVersionBanner.vue +49 -0
- package/dist/runtime/app/components/CMSVersionSwitcher.vue +126 -0
- package/dist/runtime/app/components/ContentRenderer.vue +80 -0
- package/dist/runtime/app/components/FileUpload.vue +196 -0
- package/dist/runtime/app/components/ImpersonationBanner.vue +57 -0
- package/dist/runtime/app/components/SignedIn.vue +13 -0
- package/dist/runtime/app/components/SignedOut.vue +13 -0
- package/dist/runtime/app/components/shiki.css +34 -0
- package/dist/runtime/app/composables/analytics.d.ts +125 -0
- package/dist/runtime/app/composables/analytics.mjs +81 -0
- package/dist/runtime/app/composables/api-tokens.d.ts +49 -0
- package/dist/runtime/app/composables/api-tokens.mjs +61 -0
- package/dist/runtime/app/composables/auth.d.ts +50 -0
- package/dist/runtime/app/composables/auth.mjs +101 -0
- package/dist/runtime/app/composables/chat.d.ts +69 -0
- package/dist/runtime/app/composables/chat.mjs +159 -0
- package/dist/runtime/app/composables/cms-preview.d.ts +33 -0
- package/dist/runtime/app/composables/cms-preview.mjs +83 -0
- package/dist/runtime/app/composables/cms.d.ts +307 -0
- package/dist/runtime/app/composables/cms.mjs +355 -0
- package/dist/runtime/app/composables/docs-version.d.ts +35 -0
- package/dist/runtime/app/composables/docs-version.mjs +70 -0
- package/dist/runtime/app/composables/impersonation.d.ts +14 -0
- package/dist/runtime/app/composables/impersonation.mjs +44 -0
- package/dist/runtime/app/composables/notifications.d.ts +35 -0
- package/dist/runtime/app/composables/notifications.mjs +139 -0
- package/dist/runtime/app/composables/organization.d.ts +127 -0
- package/dist/runtime/app/composables/organization.mjs +138 -0
- package/dist/runtime/app/composables/passkey.d.ts +6 -0
- package/dist/runtime/app/composables/passkey.mjs +105 -0
- package/dist/runtime/app/composables/passwordless.d.ts +7 -0
- package/dist/runtime/app/composables/passwordless.mjs +67 -0
- package/dist/runtime/app/composables/payments.d.ts +43 -0
- package/dist/runtime/app/composables/payments.mjs +74 -0
- package/dist/runtime/app/composables/realtime.d.ts +96 -0
- package/dist/runtime/app/composables/realtime.mjs +432 -0
- package/dist/runtime/app/composables/site.d.ts +35 -0
- package/dist/runtime/app/composables/site.mjs +36 -0
- package/dist/runtime/app/composables/storage.d.ts +60 -0
- package/dist/runtime/app/composables/storage.mjs +294 -0
- package/dist/runtime/app/composables/tenant.d.ts +82 -0
- package/dist/runtime/app/composables/tenant.mjs +120 -0
- package/dist/runtime/app/composables/turnstile.d.ts +3 -0
- package/dist/runtime/app/composables/turnstile.mjs +10 -0
- package/dist/runtime/app/composables/two-factor.d.ts +12 -0
- package/dist/runtime/app/composables/two-factor.mjs +65 -0
- package/dist/runtime/app/middleware/auth.global.d.ts +2 -0
- package/dist/runtime/app/middleware/auth.global.mjs +44 -0
- package/dist/runtime/app/pages/cms.vue +2249 -0
- package/dist/runtime/app/pages/devtools/agents.vue +717 -0
- package/dist/runtime/app/pages/devtools/analytics.vue +618 -0
- package/dist/runtime/app/pages/devtools/auth.vue +351 -0
- package/dist/runtime/app/pages/devtools/blob.vue +745 -0
- package/dist/runtime/app/pages/devtools/db.vue +546 -0
- package/dist/runtime/app/pages/devtools/domains.vue +772 -0
- package/dist/runtime/app/pages/devtools/kv.vue +829 -0
- package/dist/runtime/app/pages/devtools/logs.vue +655 -0
- package/dist/runtime/app/pages/devtools/mail.vue +389 -0
- package/dist/runtime/app/pages/devtools/overview.vue +390 -0
- package/dist/runtime/app/pages/devtools/settings.vue +560 -0
- package/dist/runtime/app/pages/devtools.vue +165 -0
- package/dist/runtime/app/plugins/seo.d.ts +2 -0
- package/dist/runtime/app/plugins/seo.mjs +105 -0
- package/dist/runtime/app/plugins/shortcuts.client.d.ts +6 -0
- package/dist/runtime/app/plugins/shortcuts.client.mjs +19 -0
- package/dist/runtime/app/public/sw-notifications.mjs +52 -0
- package/dist/runtime/auth.d.ts +25 -0
- package/dist/runtime/auth.mjs +11 -0
- package/dist/runtime/bindings.d.ts +27 -0
- package/dist/runtime/bindings.mjs +38 -0
- package/dist/runtime/blob.d.ts +26 -0
- package/dist/runtime/blob.mjs +334 -0
- package/dist/runtime/bots.d.ts +1 -0
- package/dist/runtime/bots.mjs +1 -0
- package/dist/runtime/browser.d.ts +21 -0
- package/dist/runtime/browser.mjs +64 -0
- package/dist/runtime/cache.d.ts +19 -0
- package/dist/runtime/cache.mjs +12 -0
- package/dist/runtime/cms.d.ts +2 -0
- package/dist/runtime/cms.mjs +0 -0
- package/dist/runtime/db.d.ts +21 -0
- package/dist/runtime/db.mjs +36 -0
- package/dist/runtime/drizzle.d.ts +11 -0
- package/dist/runtime/drizzle.mjs +18 -0
- package/dist/runtime/email.d.ts +51 -0
- package/dist/runtime/email.mjs +245 -0
- package/dist/runtime/hyperdrive.d.ts +21 -0
- package/dist/runtime/hyperdrive.mjs +49 -0
- package/dist/runtime/index.d.ts +23 -0
- package/dist/runtime/index.mjs +23 -0
- package/dist/runtime/kv.d.ts +16 -0
- package/dist/runtime/kv.mjs +126 -0
- package/dist/runtime/payments.d.ts +2 -0
- package/dist/runtime/payments.mjs +0 -0
- package/dist/runtime/queue.d.ts +21 -0
- package/dist/runtime/queue.mjs +41 -0
- package/dist/runtime/rag.d.ts +1 -0
- package/dist/runtime/rag.mjs +1 -0
- package/dist/runtime/ratelimit.d.ts +21 -0
- package/dist/runtime/ratelimit.mjs +38 -0
- package/dist/runtime/realtime.d.ts +6 -0
- package/dist/runtime/realtime.mjs +13 -0
- package/dist/runtime/server/db/cms-schema.d.ts +651 -0
- package/dist/runtime/server/db/cms-schema.mjs +74 -0
- package/dist/runtime/server/durable-objects/agent.d.ts +14 -0
- package/dist/runtime/server/durable-objects/agent.mjs +571 -0
- package/dist/runtime/server/durable-objects/room.d.ts +34 -0
- package/dist/runtime/server/durable-objects/room.mjs +514 -0
- package/dist/runtime/server/middleware/auth.d.ts +2 -0
- package/dist/runtime/server/middleware/auth.mjs +108 -0
- package/dist/runtime/server/middleware/devtools.d.ts +2 -0
- package/dist/runtime/server/middleware/devtools.mjs +61 -0
- package/dist/runtime/server/middleware/ratelimit.d.ts +2 -0
- package/dist/runtime/server/middleware/ratelimit.mjs +49 -0
- package/dist/runtime/server/middleware/tenancy.d.ts +6 -0
- package/dist/runtime/server/middleware/tenancy.mjs +15 -0
- package/dist/runtime/server/middleware/tracker.d.ts +7 -0
- package/dist/runtime/server/middleware/tracker.mjs +9 -0
- package/dist/runtime/server/plugins/agents.d.ts +7 -0
- package/dist/runtime/server/plugins/agents.mjs +3 -0
- package/dist/runtime/server/plugins/cms.d.ts +7 -0
- package/dist/runtime/server/plugins/cms.mjs +16 -0
- package/dist/runtime/server/plugins/dev-logs.d.ts +1 -0
- package/dist/runtime/server/plugins/dev-logs.mjs +58 -0
- package/dist/runtime/server/plugins/dev-proxy.d.ts +3 -0
- package/dist/runtime/server/plugins/dev-proxy.mjs +21 -0
- package/dist/runtime/server/plugins/env.d.ts +6 -0
- package/dist/runtime/server/plugins/env.mjs +17 -0
- package/dist/runtime/server/plugins/queue.d.ts +6 -0
- package/dist/runtime/server/plugins/queue.mjs +8 -0
- package/dist/runtime/server/routes/__qarpeo/agents/chat.post.d.ts +20 -0
- package/dist/runtime/server/routes/__qarpeo/agents/chat.post.mjs +110 -0
- package/dist/runtime/server/routes/__qarpeo/agents/clear.post.d.ts +7 -0
- package/dist/runtime/server/routes/__qarpeo/agents/clear.post.mjs +15 -0
- package/dist/runtime/server/routes/__qarpeo/agents/create.post.d.ts +17 -0
- package/dist/runtime/server/routes/__qarpeo/agents/create.post.mjs +47 -0
- package/dist/runtime/server/routes/__qarpeo/agents/history.get.d.ts +15 -0
- package/dist/runtime/server/routes/__qarpeo/agents/history.get.mjs +24 -0
- package/dist/runtime/server/routes/__qarpeo/agents/list.get.d.ts +5 -0
- package/dist/runtime/server/routes/__qarpeo/agents/list.get.mjs +63 -0
- package/dist/runtime/server/routes/__qarpeo/analytics/events.get.d.ts +64 -0
- package/dist/runtime/server/routes/__qarpeo/analytics/events.get.mjs +55 -0
- package/dist/runtime/server/routes/__qarpeo/analytics/summary.get.d.ts +30 -0
- package/dist/runtime/server/routes/__qarpeo/analytics/summary.get.mjs +73 -0
- package/dist/runtime/server/routes/__qarpeo/auth/revoke-session.post.d.ts +6 -0
- package/dist/runtime/server/routes/__qarpeo/auth/revoke-session.post.mjs +26 -0
- package/dist/runtime/server/routes/__qarpeo/auth/sessions.get.d.ts +6 -0
- package/dist/runtime/server/routes/__qarpeo/auth/sessions.get.mjs +46 -0
- package/dist/runtime/server/routes/__qarpeo/auth/users.get.d.ts +7 -0
- package/dist/runtime/server/routes/__qarpeo/auth/users.get.mjs +65 -0
- package/dist/runtime/server/routes/__qarpeo/blob/files.get.d.ts +22 -0
- package/dist/runtime/server/routes/__qarpeo/blob/files.get.mjs +36 -0
- package/dist/runtime/server/routes/__qarpeo/db/query.post.d.ts +23 -0
- package/dist/runtime/server/routes/__qarpeo/db/query.post.mjs +34 -0
- package/dist/runtime/server/routes/__qarpeo/db/tables.get.d.ts +31 -0
- package/dist/runtime/server/routes/__qarpeo/db/tables.get.mjs +81 -0
- package/dist/runtime/server/routes/__qarpeo/kv/delete.post.d.ts +11 -0
- package/dist/runtime/server/routes/__qarpeo/kv/delete.post.mjs +18 -0
- package/dist/runtime/server/routes/__qarpeo/kv/get.get.d.ts +11 -0
- package/dist/runtime/server/routes/__qarpeo/kv/get.get.mjs +20 -0
- package/dist/runtime/server/routes/__qarpeo/kv/keys.get.d.ts +8 -0
- package/dist/runtime/server/routes/__qarpeo/kv/keys.get.mjs +27 -0
- package/dist/runtime/server/routes/__qarpeo/kv/set.post.d.ts +14 -0
- package/dist/runtime/server/routes/__qarpeo/kv/set.post.mjs +24 -0
- package/dist/runtime/server/routes/__qarpeo/logs.delete.d.ts +5 -0
- package/dist/runtime/server/routes/__qarpeo/logs.delete.mjs +6 -0
- package/dist/runtime/server/routes/__qarpeo/logs.get.d.ts +5 -0
- package/dist/runtime/server/routes/__qarpeo/logs.get.mjs +26 -0
- package/dist/runtime/server/routes/__qarpeo/logs.post.d.ts +6 -0
- package/dist/runtime/server/routes/__qarpeo/logs.post.mjs +17 -0
- package/dist/runtime/server/routes/__qarpeo/mail/bounce.post.d.ts +5 -0
- package/dist/runtime/server/routes/__qarpeo/mail/bounce.post.mjs +37 -0
- package/dist/runtime/server/routes/__qarpeo/mail/clear.post.d.ts +4 -0
- package/dist/runtime/server/routes/__qarpeo/mail/clear.post.mjs +6 -0
- package/dist/runtime/server/routes/__qarpeo/mail/inbox.get.d.ts +5 -0
- package/dist/runtime/server/routes/__qarpeo/mail/inbox.get.mjs +7 -0
- package/dist/runtime/server/routes/__qarpeo/mail/send-test.post.d.ts +4 -0
- package/dist/runtime/server/routes/__qarpeo/mail/send-test.post.mjs +29 -0
- package/dist/runtime/server/routes/__qarpeo/mail/track/click/[id].get.d.ts +2 -0
- package/dist/runtime/server/routes/__qarpeo/mail/track/click/[id].get.mjs +23 -0
- package/dist/runtime/server/routes/__qarpeo/mail/track/open/[id].get.d.ts +2 -0
- package/dist/runtime/server/routes/__qarpeo/mail/track/open/[id].get.mjs +31 -0
- package/dist/runtime/server/routes/__qarpeo/overview/health.get.d.ts +8 -0
- package/dist/runtime/server/routes/__qarpeo/overview/health.get.mjs +46 -0
- package/dist/runtime/server/routes/__qarpeo/overview.get.d.ts +32 -0
- package/dist/runtime/server/routes/__qarpeo/overview.get.mjs +38 -0
- package/dist/runtime/server/routes/__qarpeo/settings/reset-dev-data.post.d.ts +11 -0
- package/dist/runtime/server/routes/__qarpeo/settings/reset-dev-data.post.mjs +84 -0
- package/dist/runtime/server/routes/__qarpeo/settings.get.d.ts +124 -0
- package/dist/runtime/server/routes/__qarpeo/settings.get.mjs +145 -0
- package/dist/runtime/server/routes/__qarpeo/tenants/create.post.d.ts +7 -0
- package/dist/runtime/server/routes/__qarpeo/tenants/create.post.mjs +26 -0
- package/dist/runtime/server/routes/__qarpeo/tenants/domain-add.post.d.ts +6 -0
- package/dist/runtime/server/routes/__qarpeo/tenants/domain-add.post.mjs +29 -0
- package/dist/runtime/server/routes/__qarpeo/tenants/domain-delete.post.d.ts +7 -0
- package/dist/runtime/server/routes/__qarpeo/tenants/domain-delete.post.mjs +21 -0
- package/dist/runtime/server/routes/__qarpeo/tenants/domain-verify.post.d.ts +9 -0
- package/dist/runtime/server/routes/__qarpeo/tenants/domain-verify.post.mjs +21 -0
- package/dist/runtime/server/routes/__qarpeo/tenants/list.get.d.ts +15 -0
- package/dist/runtime/server/routes/__qarpeo/tenants/list.get.mjs +22 -0
- package/dist/runtime/server/routes/agents/[agent]/chat.post.d.ts +2 -0
- package/dist/runtime/server/routes/agents/[agent]/chat.post.mjs +35 -0
- package/dist/runtime/server/routes/agents/[agent]/clear.post.d.ts +4 -0
- package/dist/runtime/server/routes/agents/[agent]/clear.post.mjs +27 -0
- package/dist/runtime/server/routes/agents/[agent]/history.get.d.ts +4 -0
- package/dist/runtime/server/routes/agents/[agent]/history.get.mjs +27 -0
- package/dist/runtime/server/routes/analytics/events.get.d.ts +3 -0
- package/dist/runtime/server/routes/analytics/events.get.mjs +17 -0
- package/dist/runtime/server/routes/analytics/pageviews.get.d.ts +3 -0
- package/dist/runtime/server/routes/analytics/pageviews.get.mjs +15 -0
- package/dist/runtime/server/routes/analytics/summary.get.d.ts +6 -0
- package/dist/runtime/server/routes/analytics/summary.get.mjs +15 -0
- package/dist/runtime/server/routes/atom.xml.get.d.ts +2 -0
- package/dist/runtime/server/routes/atom.xml.get.mjs +76 -0
- package/dist/runtime/server/routes/auth/2fa/disable.post.d.ts +4 -0
- package/dist/runtime/server/routes/auth/2fa/disable.post.mjs +44 -0
- package/dist/runtime/server/routes/auth/2fa/setup.post.d.ts +6 -0
- package/dist/runtime/server/routes/auth/2fa/setup.post.mjs +32 -0
- package/dist/runtime/server/routes/auth/2fa/verify.post.d.ts +6 -0
- package/dist/runtime/server/routes/auth/2fa/verify.post.mjs +92 -0
- package/dist/runtime/server/routes/auth/[provider]/callback.d.ts +1 -0
- package/dist/runtime/server/routes/auth/[provider]/callback.mjs +1 -0
- package/dist/runtime/server/routes/auth/[provider].d.ts +3 -0
- package/dist/runtime/server/routes/auth/[provider].mjs +95 -0
- package/dist/runtime/server/routes/auth/account.delete.d.ts +5 -0
- package/dist/runtime/server/routes/auth/account.delete.mjs +52 -0
- package/dist/runtime/server/routes/auth/impersonate/start.post.d.ts +5 -0
- package/dist/runtime/server/routes/auth/impersonate/start.post.mjs +14 -0
- package/dist/runtime/server/routes/auth/impersonate/stop.post.d.ts +5 -0
- package/dist/runtime/server/routes/auth/impersonate/stop.post.mjs +5 -0
- package/dist/runtime/server/routes/auth/logout-all.post.d.ts +4 -0
- package/dist/runtime/server/routes/auth/logout-all.post.mjs +16 -0
- package/dist/runtime/server/routes/auth/logout-others.post.d.ts +4 -0
- package/dist/runtime/server/routes/auth/logout-others.post.mjs +11 -0
- package/dist/runtime/server/routes/auth/logout.post.d.ts +4 -0
- package/dist/runtime/server/routes/auth/logout.post.mjs +17 -0
- package/dist/runtime/server/routes/auth/magic-link/send.post.d.ts +10 -0
- package/dist/runtime/server/routes/auth/magic-link/send.post.mjs +29 -0
- package/dist/runtime/server/routes/auth/magic-link/verify.get.d.ts +2 -0
- package/dist/runtime/server/routes/auth/magic-link/verify.get.mjs +81 -0
- package/dist/runtime/server/routes/auth/organization/create.post.d.ts +5 -0
- package/dist/runtime/server/routes/auth/organization/create.post.mjs +10 -0
- package/dist/runtime/server/routes/auth/organization/invite.post.d.ts +9 -0
- package/dist/runtime/server/routes/auth/organization/invite.post.mjs +27 -0
- package/dist/runtime/server/routes/auth/organization/join.post.d.ts +6 -0
- package/dist/runtime/server/routes/auth/organization/join.post.mjs +15 -0
- package/dist/runtime/server/routes/auth/organization/list.get.d.ts +5 -0
- package/dist/runtime/server/routes/auth/organization/list.get.mjs +7 -0
- package/dist/runtime/server/routes/auth/organization/members/[id].delete.d.ts +4 -0
- package/dist/runtime/server/routes/auth/organization/members/[id].delete.mjs +33 -0
- package/dist/runtime/server/routes/auth/organization/members/index.get.d.ts +6 -0
- package/dist/runtime/server/routes/auth/organization/members/index.get.mjs +18 -0
- package/dist/runtime/server/routes/auth/organization/mfa.post.d.ts +6 -0
- package/dist/runtime/server/routes/auth/organization/mfa.post.mjs +33 -0
- package/dist/runtime/server/routes/auth/organization/sso/[id].delete.d.ts +4 -0
- package/dist/runtime/server/routes/auth/organization/sso/[id].delete.mjs +28 -0
- package/dist/runtime/server/routes/auth/organization/sso/index.get.d.ts +2 -0
- package/dist/runtime/server/routes/auth/organization/sso/index.get.mjs +23 -0
- package/dist/runtime/server/routes/auth/organization/sso/index.post.d.ts +5 -0
- package/dist/runtime/server/routes/auth/organization/sso/index.post.mjs +84 -0
- package/dist/runtime/server/routes/auth/organization/switch.post.d.ts +6 -0
- package/dist/runtime/server/routes/auth/organization/switch.post.mjs +14 -0
- package/dist/runtime/server/routes/auth/otp/send.post.d.ts +10 -0
- package/dist/runtime/server/routes/auth/otp/send.post.mjs +29 -0
- package/dist/runtime/server/routes/auth/otp/verify.post.d.ts +6 -0
- package/dist/runtime/server/routes/auth/otp/verify.post.mjs +95 -0
- package/dist/runtime/server/routes/auth/sessions/[id].delete.d.ts +5 -0
- package/dist/runtime/server/routes/auth/sessions/[id].delete.mjs +24 -0
- package/dist/runtime/server/routes/auth/sessions.get.d.ts +2 -0
- package/dist/runtime/server/routes/auth/sessions.get.mjs +11 -0
- package/dist/runtime/server/routes/auth/sso/login.get.d.ts +2 -0
- package/dist/runtime/server/routes/auth/sso/login.get.mjs +94 -0
- package/dist/runtime/server/routes/auth/sso/oidc/callback.get.d.ts +2 -0
- package/dist/runtime/server/routes/auth/sso/oidc/callback.get.mjs +113 -0
- package/dist/runtime/server/routes/auth/sso/saml/acs.post.d.ts +2 -0
- package/dist/runtime/server/routes/auth/sso/saml/acs.post.mjs +95 -0
- package/dist/runtime/server/routes/auth/tokens/[id].delete.d.ts +4 -0
- package/dist/runtime/server/routes/auth/tokens/[id].delete.mjs +13 -0
- package/dist/runtime/server/routes/auth/tokens/create.post.d.ts +9 -0
- package/dist/runtime/server/routes/auth/tokens/create.post.mjs +17 -0
- package/dist/runtime/server/routes/auth/tokens/index.get.d.ts +9 -0
- package/dist/runtime/server/routes/auth/tokens/index.get.mjs +5 -0
- package/dist/runtime/server/routes/auth/turnstile/verify.post.d.ts +2 -0
- package/dist/runtime/server/routes/auth/turnstile/verify.post.mjs +15 -0
- package/dist/runtime/server/routes/auth/user.get.d.ts +2 -0
- package/dist/runtime/server/routes/auth/user.get.mjs +6 -0
- package/dist/runtime/server/routes/auth/webauthn/login/options.post.d.ts +2 -0
- package/dist/runtime/server/routes/auth/webauthn/login/options.post.mjs +17 -0
- package/dist/runtime/server/routes/auth/webauthn/login/verify.post.d.ts +6 -0
- package/dist/runtime/server/routes/auth/webauthn/login/verify.post.mjs +127 -0
- package/dist/runtime/server/routes/auth/webauthn/register/options.post.d.ts +2 -0
- package/dist/runtime/server/routes/auth/webauthn/register/options.post.mjs +47 -0
- package/dist/runtime/server/routes/auth/webauthn/register/verify.post.d.ts +5 -0
- package/dist/runtime/server/routes/auth/webauthn/register/verify.post.mjs +88 -0
- package/dist/runtime/server/routes/cms/[collection]/[id]/preview-token.post.d.ts +8 -0
- package/dist/runtime/server/routes/cms/[collection]/[id]/preview-token.post.mjs +27 -0
- package/dist/runtime/server/routes/cms/[collection]/[id]/publish.post.d.ts +6 -0
- package/dist/runtime/server/routes/cms/[collection]/[id]/publish.post.mjs +19 -0
- package/dist/runtime/server/routes/cms/[collection]/[id]/review.post.d.ts +6 -0
- package/dist/runtime/server/routes/cms/[collection]/[id]/review.post.mjs +33 -0
- package/dist/runtime/server/routes/cms/[collection]/[id].delete.d.ts +4 -0
- package/dist/runtime/server/routes/cms/[collection]/[id].delete.mjs +17 -0
- package/dist/runtime/server/routes/cms/[collection]/[id].put.d.ts +4 -0
- package/dist/runtime/server/routes/cms/[collection]/[id].put.mjs +18 -0
- package/dist/runtime/server/routes/cms/[collection]/[slug].get.d.ts +4 -0
- package/dist/runtime/server/routes/cms/[collection]/[slug].get.mjs +19 -0
- package/dist/runtime/server/routes/cms/[collection]/atom.xml.get.d.ts +2 -0
- package/dist/runtime/server/routes/cms/[collection]/atom.xml.get.mjs +69 -0
- package/dist/runtime/server/routes/cms/[collection]/by-path.get.d.ts +8 -0
- package/dist/runtime/server/routes/cms/[collection]/by-path.get.mjs +23 -0
- package/dist/runtime/server/routes/cms/[collection]/feed.xml.get.d.ts +2 -0
- package/dist/runtime/server/routes/cms/[collection]/feed.xml.get.mjs +65 -0
- package/dist/runtime/server/routes/cms/[collection]/index.get.d.ts +7 -0
- package/dist/runtime/server/routes/cms/[collection]/index.get.mjs +15 -0
- package/dist/runtime/server/routes/cms/[collection]/index.post.d.ts +4 -0
- package/dist/runtime/server/routes/cms/[collection]/index.post.mjs +23 -0
- package/dist/runtime/server/routes/cms/[collection]/references.get.d.ts +19 -0
- package/dist/runtime/server/routes/cms/[collection]/references.get.mjs +47 -0
- package/dist/runtime/server/routes/cms/[collection]/surroundings.get.d.ts +10 -0
- package/dist/runtime/server/routes/cms/[collection]/surroundings.get.mjs +12 -0
- package/dist/runtime/server/routes/cms/collections/[id].delete.d.ts +4 -0
- package/dist/runtime/server/routes/cms/collections/[id].delete.mjs +10 -0
- package/dist/runtime/server/routes/cms/collections/[id].put.d.ts +4 -0
- package/dist/runtime/server/routes/cms/collections/[id].put.mjs +11 -0
- package/dist/runtime/server/routes/cms/collections/index.get.d.ts +4 -0
- package/dist/runtime/server/routes/cms/collections/index.get.mjs +6 -0
- package/dist/runtime/server/routes/cms/collections/index.post.d.ts +4 -0
- package/dist/runtime/server/routes/cms/collections/index.post.mjs +19 -0
- package/dist/runtime/server/routes/cms/components/index.get.d.ts +17 -0
- package/dist/runtime/server/routes/cms/components/index.get.mjs +16 -0
- package/dist/runtime/server/routes/cms/deploy.post.d.ts +4 -0
- package/dist/runtime/server/routes/cms/deploy.post.mjs +46 -0
- package/dist/runtime/server/routes/cms/export.post.d.ts +10 -0
- package/dist/runtime/server/routes/cms/export.post.mjs +55 -0
- package/dist/runtime/server/routes/cms/navigation.get.d.ts +8 -0
- package/dist/runtime/server/routes/cms/navigation.get.mjs +36 -0
- package/dist/runtime/server/routes/cms/preview/disable.get.d.ts +9 -0
- package/dist/runtime/server/routes/cms/preview/disable.get.mjs +9 -0
- package/dist/runtime/server/routes/cms/preview/enable.get.d.ts +14 -0
- package/dist/runtime/server/routes/cms/preview/enable.get.mjs +42 -0
- package/dist/runtime/server/routes/cms/publish-scheduled.post.d.ts +11 -0
- package/dist/runtime/server/routes/cms/publish-scheduled.post.mjs +35 -0
- package/dist/runtime/server/routes/cms/search.get.d.ts +13 -0
- package/dist/runtime/server/routes/cms/search.get.mjs +137 -0
- package/dist/runtime/server/routes/cms/sync.post.d.ts +7 -0
- package/dist/runtime/server/routes/cms/sync.post.mjs +18 -0
- package/dist/runtime/server/routes/cms/webhooks/[provider].post.d.ts +150 -0
- package/dist/runtime/server/routes/cms/webhooks/[provider].post.mjs +213 -0
- package/dist/runtime/server/routes/docs/search.get.d.ts +15 -0
- package/dist/runtime/server/routes/docs/search.get.mjs +20 -0
- package/dist/runtime/server/routes/feed.xml.get.d.ts +2 -0
- package/dist/runtime/server/routes/feed.xml.get.mjs +73 -0
- package/dist/runtime/server/routes/mail/bounce.post.d.ts +14 -0
- package/dist/runtime/server/routes/mail/bounce.post.mjs +56 -0
- package/dist/runtime/server/routes/mail/inbox/[id].get.d.ts +2 -0
- package/dist/runtime/server/routes/mail/inbox/[id].get.mjs +9 -0
- package/dist/runtime/server/routes/mail/inbox.get.d.ts +4 -0
- package/dist/runtime/server/routes/mail/inbox.get.mjs +7 -0
- package/dist/runtime/server/routes/mail/suppressions/[email].delete.d.ts +11 -0
- package/dist/runtime/server/routes/mail/suppressions/[email].delete.mjs +18 -0
- package/dist/runtime/server/routes/mail/suppressions/index.get.d.ts +12 -0
- package/dist/runtime/server/routes/mail/suppressions/index.get.mjs +23 -0
- package/dist/runtime/server/routes/mail/suppressions/index.post.d.ts +10 -0
- package/dist/runtime/server/routes/mail/suppressions/index.post.mjs +23 -0
- package/dist/runtime/server/routes/mail/unsubscribe.d.ts +13 -0
- package/dist/runtime/server/routes/mail/unsubscribe.mjs +91 -0
- package/dist/runtime/server/routes/mail/webhooks.post.d.ts +12 -0
- package/dist/runtime/server/routes/mail/webhooks.post.mjs +71 -0
- package/dist/runtime/server/routes/notifications/[id]/read.post.d.ts +4 -0
- package/dist/runtime/server/routes/notifications/[id]/read.post.mjs +13 -0
- package/dist/runtime/server/routes/notifications/[id].delete.d.ts +4 -0
- package/dist/runtime/server/routes/notifications/[id].delete.mjs +13 -0
- package/dist/runtime/server/routes/notifications/[id].get.d.ts +2 -0
- package/dist/runtime/server/routes/notifications/[id].get.mjs +15 -0
- package/dist/runtime/server/routes/notifications/index.get.d.ts +6 -0
- package/dist/runtime/server/routes/notifications/index.get.mjs +18 -0
- package/dist/runtime/server/routes/notifications/push/subscribe.post.d.ts +4 -0
- package/dist/runtime/server/routes/notifications/push/subscribe.post.mjs +20 -0
- package/dist/runtime/server/routes/notifications/push/unsubscribe.post.d.ts +4 -0
- package/dist/runtime/server/routes/notifications/push/unsubscribe.post.mjs +15 -0
- package/dist/runtime/server/routes/notifications/read-all.post.d.ts +4 -0
- package/dist/runtime/server/routes/notifications/read-all.post.mjs +11 -0
- package/dist/runtime/server/routes/payments/cancel.post.d.ts +7 -0
- package/dist/runtime/server/routes/payments/cancel.post.mjs +9 -0
- package/dist/runtime/server/routes/payments/change-plan.post.d.ts +7 -0
- package/dist/runtime/server/routes/payments/change-plan.post.mjs +12 -0
- package/dist/runtime/server/routes/payments/checkout.post.d.ts +9 -0
- package/dist/runtime/server/routes/payments/checkout.post.mjs +16 -0
- package/dist/runtime/server/routes/payments/pause.post.d.ts +7 -0
- package/dist/runtime/server/routes/payments/pause.post.mjs +9 -0
- package/dist/runtime/server/routes/payments/portal.post.d.ts +5 -0
- package/dist/runtime/server/routes/payments/portal.post.mjs +9 -0
- package/dist/runtime/server/routes/payments/subscription.get.d.ts +6 -0
- package/dist/runtime/server/routes/payments/subscription.get.mjs +9 -0
- package/dist/runtime/server/routes/payments/usage.get.d.ts +12 -0
- package/dist/runtime/server/routes/payments/usage.get.mjs +18 -0
- package/dist/runtime/server/routes/payments/usage.post.d.ts +6 -0
- package/dist/runtime/server/routes/payments/usage.post.mjs +24 -0
- package/dist/runtime/server/routes/payments/webhook.post.d.ts +14 -0
- package/dist/runtime/server/routes/payments/webhook.post.mjs +21 -0
- package/dist/runtime/server/routes/realtime/broadcast.post.d.ts +4 -0
- package/dist/runtime/server/routes/realtime/broadcast.post.mjs +26 -0
- package/dist/runtime/server/routes/realtime/history.delete.d.ts +13 -0
- package/dist/runtime/server/routes/realtime/history.delete.mjs +12 -0
- package/dist/runtime/server/routes/realtime/history.get.d.ts +16 -0
- package/dist/runtime/server/routes/realtime/history.get.mjs +15 -0
- package/dist/runtime/server/routes/realtime/presence.get.d.ts +6 -0
- package/dist/runtime/server/routes/realtime/presence.get.mjs +27 -0
- package/dist/runtime/server/routes/realtime/state.get.d.ts +5 -0
- package/dist/runtime/server/routes/realtime/state.get.mjs +26 -0
- package/dist/runtime/server/routes/realtime/state.post.d.ts +6 -0
- package/dist/runtime/server/routes/realtime/state.post.mjs +37 -0
- package/dist/runtime/server/routes/realtime/ws.get.d.ts +2 -0
- package/dist/runtime/server/routes/realtime/ws.get.mjs +73 -0
- package/dist/runtime/server/routes/robots.txt.get.d.ts +2 -0
- package/dist/runtime/server/routes/robots.txt.get.mjs +41 -0
- package/dist/runtime/server/routes/rss.xml.get.d.ts +2 -0
- package/dist/runtime/server/routes/rss.xml.get.mjs +2 -0
- package/dist/runtime/server/routes/sitemap.xml.get.d.ts +2 -0
- package/dist/runtime/server/routes/sitemap.xml.get.mjs +84 -0
- package/dist/runtime/server/routes/storage/file/[...key].delete.d.ts +4 -0
- package/dist/runtime/server/routes/storage/file/[...key].delete.mjs +23 -0
- package/dist/runtime/server/routes/storage/file/[...key].get.d.ts +2 -0
- package/dist/runtime/server/routes/storage/file/[...key].get.mjs +23 -0
- package/dist/runtime/server/routes/storage/files.get.d.ts +14 -0
- package/dist/runtime/server/routes/storage/files.get.mjs +11 -0
- package/dist/runtime/server/routes/storage/presigned.post.d.ts +8 -0
- package/dist/runtime/server/routes/storage/presigned.post.mjs +39 -0
- package/dist/runtime/server/routes/storage/sign.post.d.ts +6 -0
- package/dist/runtime/server/routes/storage/sign.post.mjs +24 -0
- package/dist/runtime/server/routes/storage/upload.post.d.ts +22 -0
- package/dist/runtime/server/routes/storage/upload.post.mjs +96 -0
- package/dist/runtime/server/routes/tenants/[tenant]/domains/[domain]/index.delete.d.ts +8 -0
- package/dist/runtime/server/routes/tenants/[tenant]/domains/[domain]/index.delete.mjs +39 -0
- package/dist/runtime/server/routes/tenants/[tenant]/domains/[domain]/verify.post.d.ts +8 -0
- package/dist/runtime/server/routes/tenants/[tenant]/domains/[domain]/verify.post.mjs +39 -0
- package/dist/runtime/server/routes/tenants/[tenant]/domains/index.get.d.ts +8 -0
- package/dist/runtime/server/routes/tenants/[tenant]/domains/index.get.mjs +20 -0
- package/dist/runtime/server/routes/tenants/[tenant]/domains/index.post.d.ts +8 -0
- package/dist/runtime/server/routes/tenants/[tenant]/domains/index.post.mjs +44 -0
- package/dist/runtime/server/routes/tenants/current.get.d.ts +8 -0
- package/dist/runtime/server/routes/tenants/current.get.mjs +6 -0
- package/dist/runtime/server/tasks/cms/publish.d.ts +4 -0
- package/dist/runtime/server/tasks/cms/publish.mjs +18 -0
- package/dist/runtime/server/utils/agent-store.d.ts +24 -0
- package/dist/runtime/server/utils/agent-store.mjs +53 -0
- package/dist/runtime/server/utils/agents-registry-fallback.d.ts +1 -0
- package/dist/runtime/server/utils/agents-registry-fallback.mjs +1 -0
- package/dist/runtime/server/utils/ai.d.ts +119 -0
- package/dist/runtime/server/utils/ai.mjs +607 -0
- package/dist/runtime/server/utils/analytics-query.d.ts +109 -0
- package/dist/runtime/server/utils/analytics-query.mjs +234 -0
- package/dist/runtime/server/utils/auth.d.ts +60 -0
- package/dist/runtime/server/utils/auth.mjs +361 -0
- package/dist/runtime/server/utils/blob-store.d.ts +13 -0
- package/dist/runtime/server/utils/blob-store.mjs +60 -0
- package/dist/runtime/server/utils/bots.d.ts +21 -0
- package/dist/runtime/server/utils/bots.mjs +491 -0
- package/dist/runtime/server/utils/cache.d.ts +33 -0
- package/dist/runtime/server/utils/cache.mjs +128 -0
- package/dist/runtime/server/utils/cms-events.d.ts +17 -0
- package/dist/runtime/server/utils/cms-events.mjs +80 -0
- package/dist/runtime/server/utils/cms-filter.d.ts +3 -0
- package/dist/runtime/server/utils/cms-filter.mjs +34 -0
- package/dist/runtime/server/utils/cms.d.ts +278 -0
- package/dist/runtime/server/utils/cms.mjs +3268 -0
- package/dist/runtime/server/utils/config.d.ts +27 -0
- package/dist/runtime/server/utils/config.mjs +38 -0
- package/dist/runtime/server/utils/context.d.ts +13 -0
- package/dist/runtime/server/utils/context.mjs +98 -0
- package/dist/runtime/server/utils/crypto.d.ts +16 -0
- package/dist/runtime/server/utils/crypto.mjs +56 -0
- package/dist/runtime/server/utils/dev-logs.d.ts +21 -0
- package/dist/runtime/server/utils/dev-logs.mjs +41 -0
- package/dist/runtime/server/utils/dev-proxy.d.ts +1 -0
- package/dist/runtime/server/utils/dev-proxy.mjs +69 -0
- package/dist/runtime/server/utils/domains.d.ts +46 -0
- package/dist/runtime/server/utils/domains.mjs +318 -0
- package/dist/runtime/server/utils/drizzle.d.ts +10 -0
- package/dist/runtime/server/utils/drizzle.mjs +36 -0
- package/dist/runtime/server/utils/email-templates.d.ts +44 -0
- package/dist/runtime/server/utils/email-templates.mjs +373 -0
- package/dist/runtime/server/utils/feed.d.ts +42 -0
- package/dist/runtime/server/utils/feed.mjs +161 -0
- package/dist/runtime/server/utils/impersonation.d.ts +67 -0
- package/dist/runtime/server/utils/impersonation.mjs +298 -0
- package/dist/runtime/server/utils/jobs.d.ts +70 -0
- package/dist/runtime/server/utils/jobs.mjs +125 -0
- package/dist/runtime/server/utils/kv-store.d.ts +9 -0
- package/dist/runtime/server/utils/kv-store.mjs +32 -0
- package/dist/runtime/server/utils/mail-suppression.d.ts +62 -0
- package/dist/runtime/server/utils/mail-suppression.mjs +328 -0
- package/dist/runtime/server/utils/mail.d.ts +90 -0
- package/dist/runtime/server/utils/mail.mjs +366 -0
- package/dist/runtime/server/utils/notifications.d.ts +51 -0
- package/dist/runtime/server/utils/notifications.mjs +215 -0
- package/dist/runtime/server/utils/organization.d.ts +54 -0
- package/dist/runtime/server/utils/organization.mjs +354 -0
- package/dist/runtime/server/utils/passwordless.d.ts +48 -0
- package/dist/runtime/server/utils/passwordless.mjs +179 -0
- package/dist/runtime/server/utils/payments.d.ts +121 -0
- package/dist/runtime/server/utils/payments.mjs +1067 -0
- package/dist/runtime/server/utils/queue-fallback.d.ts +2 -0
- package/dist/runtime/server/utils/queue-fallback.mjs +2 -0
- package/dist/runtime/server/utils/queue.d.ts +4 -0
- package/dist/runtime/server/utils/queue.mjs +3 -0
- package/dist/runtime/server/utils/rag.d.ts +25 -0
- package/dist/runtime/server/utils/rag.mjs +333 -0
- package/dist/runtime/server/utils/ratelimit.d.ts +45 -0
- package/dist/runtime/server/utils/ratelimit.mjs +182 -0
- package/dist/runtime/server/utils/realtime.d.ts +110 -0
- package/dist/runtime/server/utils/realtime.mjs +197 -0
- package/dist/runtime/server/utils/schema-fallback.d.ts +3 -0
- package/dist/runtime/server/utils/schema-fallback.mjs +2 -0
- package/dist/runtime/server/utils/session.d.ts +72 -0
- package/dist/runtime/server/utils/session.mjs +287 -0
- package/dist/runtime/server/utils/sso.d.ts +49 -0
- package/dist/runtime/server/utils/sso.mjs +131 -0
- package/dist/runtime/server/utils/storage.d.ts +111 -0
- package/dist/runtime/server/utils/storage.mjs +654 -0
- package/dist/runtime/server/utils/tenant.d.ts +44 -0
- package/dist/runtime/server/utils/tenant.mjs +285 -0
- package/dist/runtime/server/utils/totp.d.ts +33 -0
- package/dist/runtime/server/utils/totp.mjs +112 -0
- package/dist/runtime/server/utils/tracker.d.ts +72 -0
- package/dist/runtime/server/utils/tracker.mjs +139 -0
- package/dist/runtime/server/utils/turnstile.d.ts +17 -0
- package/dist/runtime/server/utils/turnstile.mjs +68 -0
- package/dist/runtime/server/utils/vapid.d.ts +35 -0
- package/dist/runtime/server/utils/vapid.mjs +211 -0
- package/dist/runtime/storage.d.ts +1 -0
- package/dist/runtime/storage.mjs +0 -0
- package/dist/runtime/types/ai.d.ts +68 -0
- package/dist/runtime/types/ai.mjs +0 -0
- package/dist/runtime/types/analytics.d.ts +30 -0
- package/dist/runtime/types/analytics.mjs +0 -0
- package/dist/runtime/types/auth-globals.d.ts +14 -0
- package/dist/runtime/types/auth.d.ts +153 -0
- package/dist/runtime/types/auth.mjs +0 -0
- package/dist/runtime/types/browser.d.ts +29 -0
- package/dist/runtime/types/browser.mjs +0 -0
- package/dist/runtime/types/d1.d.ts +44 -0
- package/dist/runtime/types/d1.mjs +0 -0
- package/dist/runtime/types/drizzle.d.ts +13 -0
- package/dist/runtime/types/drizzle.mjs +0 -0
- package/dist/runtime/types/durable-object.d.ts +51 -0
- package/dist/runtime/types/durable-object.mjs +0 -0
- package/dist/runtime/types/email.d.ts +66 -0
- package/dist/runtime/types/email.mjs +0 -0
- package/dist/runtime/types/hyperdrive.d.ts +18 -0
- package/dist/runtime/types/hyperdrive.mjs +0 -0
- package/dist/runtime/types/imports.d.ts +58 -0
- package/dist/runtime/types/index.d.ts +156 -0
- package/dist/runtime/types/index.mjs +13 -0
- package/dist/runtime/types/queue.d.ts +67 -0
- package/dist/runtime/types/queue.mjs +0 -0
- package/dist/runtime/types/r2.d.ts +108 -0
- package/dist/runtime/types/r2.mjs +0 -0
- package/dist/runtime/types/ratelimit.d.ts +21 -0
- package/dist/runtime/types/ratelimit.mjs +0 -0
- package/dist/runtime/types/vectorize.d.ts +74 -0
- package/dist/runtime/types/vectorize.mjs +0 -0
- package/dist/runtime/vectorize.d.ts +21 -0
- package/dist/runtime/vectorize.mjs +53 -0
- package/dist/types.d.ts +2750 -0
- package/dist/types.mjs +1 -0
- package/dist/utils/agents.d.ts +8 -0
- package/dist/utils/auth-schema.d.ts +11 -0
- package/dist/utils/bindings.d.ts +16 -0
- package/dist/utils/cms-schema.d.ts +1 -0
- package/dist/utils/cms-sources.d.ts +62 -0
- package/dist/utils/drizzle.d.ts +42 -0
- package/dist/utils/jobs.d.ts +8 -0
- package/dist/utils/local-db.d.ts +28 -0
- package/dist/utils/notifications-schema.d.ts +15 -0
- package/dist/utils/payments-schema.d.ts +11 -0
- package/dist/utils/pkg.d.ts +15 -0
- package/dist/utils/queue.d.ts +8 -0
- package/dist/utils/tenants-schema.d.ts +11 -0
- package/package.json +104 -0
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { getCloudflareEnv, resolveRuntimeBinding } from "./bindings.mjs";
|
|
2
|
+
export function parseSenderIdentity(key, raw) {
|
|
3
|
+
const trimmed = raw.trim();
|
|
4
|
+
const match = trimmed.match(/^(?:(?:"?([^"]*)"?\s)?<([^>]+)>|([^<>\s]+))$/);
|
|
5
|
+
if (match) {
|
|
6
|
+
const name = match[1]?.trim();
|
|
7
|
+
const address = (match[2] || match[3] || trimmed).trim();
|
|
8
|
+
return {
|
|
9
|
+
key,
|
|
10
|
+
address,
|
|
11
|
+
name: name || void 0,
|
|
12
|
+
label: trimmed
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
return {
|
|
16
|
+
key,
|
|
17
|
+
address: trimmed,
|
|
18
|
+
label: trimmed
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export function useEmailSenders() {
|
|
22
|
+
const procEnv = globalThis.process?.env || {};
|
|
23
|
+
const publicConfig = globalThis.__NUXT_RUNTIME_CONFIG__?.public?.qarpeo?.email?.senders || globalThis.__qarpeo_senders__;
|
|
24
|
+
if (Array.isArray(publicConfig) && publicConfig.length > 0) {
|
|
25
|
+
return {
|
|
26
|
+
senders: publicConfig,
|
|
27
|
+
defaultSender: publicConfig.find((s) => s.key === "default") || publicConfig[0] || null,
|
|
28
|
+
getSender: (target) => {
|
|
29
|
+
const lower = target.toLowerCase();
|
|
30
|
+
return publicConfig.find(
|
|
31
|
+
(s) => s.key.toLowerCase() === lower || s.address.toLowerCase() === lower
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
let rawSenders = {};
|
|
37
|
+
if (procEnv.QARPEO_EMAIL_SENDERS) {
|
|
38
|
+
try {
|
|
39
|
+
rawSenders = JSON.parse(procEnv.QARPEO_EMAIL_SENDERS);
|
|
40
|
+
} catch {
|
|
41
|
+
}
|
|
42
|
+
} else if (procEnv.QARPEO_EMAIL_FROM) {
|
|
43
|
+
rawSenders = { default: procEnv.QARPEO_EMAIL_FROM };
|
|
44
|
+
}
|
|
45
|
+
const senders = Object.entries(rawSenders).map(
|
|
46
|
+
([key, val]) => parseSenderIdentity(key, val)
|
|
47
|
+
);
|
|
48
|
+
const defaultSender = senders.find((s) => s.key === "default") || senders[0] || null;
|
|
49
|
+
const getSender = (target) => {
|
|
50
|
+
const lower = target.toLowerCase();
|
|
51
|
+
return senders.find((s) => s.key.toLowerCase() === lower || s.address.toLowerCase() === lower);
|
|
52
|
+
};
|
|
53
|
+
return {
|
|
54
|
+
senders,
|
|
55
|
+
defaultSender,
|
|
56
|
+
getSender
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export function getEmailBinding(bindingName, event) {
|
|
60
|
+
const resolvedBinding = resolveRuntimeBinding("email", bindingName, "EMAIL");
|
|
61
|
+
const env = getCloudflareEnv(event);
|
|
62
|
+
const binding = env[resolvedBinding];
|
|
63
|
+
if (!binding) {
|
|
64
|
+
throw new Error(
|
|
65
|
+
`[qarpeo] Cloudflare send_email binding "${resolvedBinding}" was not found. Ensure email: true is configured in your nuxt.config.ts.`
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
return binding;
|
|
69
|
+
}
|
|
70
|
+
export function buildMimeMessage(options) {
|
|
71
|
+
const toStr = Array.isArray(options.to) ? options.to.join(", ") : options.to;
|
|
72
|
+
const messageId = options.messageId || `<${Date.now()}.${Math.random().toString(36).slice(2)}@qarpeo>`;
|
|
73
|
+
const date = (/* @__PURE__ */ new Date()).toUTCString();
|
|
74
|
+
const headers = [
|
|
75
|
+
`From: ${options.from}`,
|
|
76
|
+
`To: ${toStr}`,
|
|
77
|
+
`Subject: ${options.subject}`,
|
|
78
|
+
`Date: ${date}`,
|
|
79
|
+
`Message-ID: ${messageId}`,
|
|
80
|
+
`MIME-Version: 1.0`
|
|
81
|
+
];
|
|
82
|
+
if (options.cc) {
|
|
83
|
+
headers.push(`Cc: ${Array.isArray(options.cc) ? options.cc.join(", ") : options.cc}`);
|
|
84
|
+
}
|
|
85
|
+
if (options.bcc) {
|
|
86
|
+
headers.push(`Bcc: ${Array.isArray(options.bcc) ? options.bcc.join(", ") : options.bcc}`);
|
|
87
|
+
}
|
|
88
|
+
if (options.replyTo) {
|
|
89
|
+
headers.push(`Reply-To: ${options.replyTo}`);
|
|
90
|
+
}
|
|
91
|
+
if (options.headers) {
|
|
92
|
+
for (const [k, v] of Object.entries(options.headers)) {
|
|
93
|
+
headers.push(`${k}: ${v}`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (options.html && options.text) {
|
|
97
|
+
const boundary = `_qarpeo_${Date.now()}_${Math.random().toString(36).slice(2)}`;
|
|
98
|
+
headers.push(`Content-Type: multipart/alternative; boundary="${boundary}"`);
|
|
99
|
+
const body = [
|
|
100
|
+
`--${boundary}`,
|
|
101
|
+
`Content-Type: text/plain; charset=UTF-8`,
|
|
102
|
+
`Content-Transfer-Encoding: 7bit`,
|
|
103
|
+
``,
|
|
104
|
+
options.text,
|
|
105
|
+
``,
|
|
106
|
+
`--${boundary}`,
|
|
107
|
+
`Content-Type: text/html; charset=UTF-8`,
|
|
108
|
+
`Content-Transfer-Encoding: 7bit`,
|
|
109
|
+
``,
|
|
110
|
+
options.html,
|
|
111
|
+
``,
|
|
112
|
+
`--${boundary}--`
|
|
113
|
+
].join("\r\n");
|
|
114
|
+
return `${headers.join("\r\n")}\r
|
|
115
|
+
\r
|
|
116
|
+
${body}`;
|
|
117
|
+
} else if (options.html) {
|
|
118
|
+
headers.push(`Content-Type: text/html; charset=UTF-8`);
|
|
119
|
+
headers.push(`Content-Transfer-Encoding: 7bit`);
|
|
120
|
+
return `${headers.join("\r\n")}\r
|
|
121
|
+
\r
|
|
122
|
+
${options.html}`;
|
|
123
|
+
} else {
|
|
124
|
+
headers.push(`Content-Type: text/plain; charset=UTF-8`);
|
|
125
|
+
headers.push(`Content-Transfer-Encoding: 7bit`);
|
|
126
|
+
return `${headers.join("\r\n")}\r
|
|
127
|
+
\r
|
|
128
|
+
${options.text || ""}`;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
function extractEmailAddress(raw) {
|
|
132
|
+
const match = raw.match(/<([^>]+)>/);
|
|
133
|
+
return match ? match[1].trim() : raw.trim();
|
|
134
|
+
}
|
|
135
|
+
function logDevMailbox(from, to, subject, text, html, messageId) {
|
|
136
|
+
const toDisplay = Array.isArray(to) ? to.join(", ") : to;
|
|
137
|
+
const bar = "\u2500".repeat(60);
|
|
138
|
+
console.log(`
|
|
139
|
+
\u250C\u2500 \u{1F4E7} [qarpeo:email] Local Mailbox Intercept ${bar.slice(38)}\u2510`);
|
|
140
|
+
console.log(`\u2502 ID: ${messageId || "n/a"}`);
|
|
141
|
+
console.log(`\u2502 From: ${from}`);
|
|
142
|
+
console.log(`\u2502 To: ${toDisplay}`);
|
|
143
|
+
console.log(`\u2502 Subject: ${subject}`);
|
|
144
|
+
console.log(`\u251C${bar}\u2524`);
|
|
145
|
+
const content = text || html?.replace(/<[^>]+>/g, " ").trim() || "(empty message)";
|
|
146
|
+
const lines = content.split("\n");
|
|
147
|
+
for (const line of lines.slice(0, 15)) {
|
|
148
|
+
console.log(`\u2502 ${line.slice(0, 58)}`);
|
|
149
|
+
}
|
|
150
|
+
if (lines.length > 15) {
|
|
151
|
+
console.log(`\u2502 ... (${lines.length - 15} more lines)`);
|
|
152
|
+
}
|
|
153
|
+
console.log(`\u2514${bar}\u2518
|
|
154
|
+
`);
|
|
155
|
+
}
|
|
156
|
+
export async function sendEmail(options, event) {
|
|
157
|
+
const resolvedBinding = resolveRuntimeBinding("email", options.binding, "EMAIL");
|
|
158
|
+
const procEnv = globalThis.process?.env || {};
|
|
159
|
+
let senderPresets = {};
|
|
160
|
+
if (procEnv.QARPEO_EMAIL_SENDERS) {
|
|
161
|
+
try {
|
|
162
|
+
senderPresets = JSON.parse(procEnv.QARPEO_EMAIL_SENDERS);
|
|
163
|
+
} catch {
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
let rawFrom = options.from;
|
|
167
|
+
if (rawFrom && senderPresets[rawFrom]) {
|
|
168
|
+
rawFrom = senderPresets[rawFrom];
|
|
169
|
+
}
|
|
170
|
+
const from = rawFrom || senderPresets.default || procEnv.QARPEO_EMAIL_FROM || procEnv.EMAIL_FROM || "noreply@qarpeo.local";
|
|
171
|
+
if (!options.to || Array.isArray(options.to) && options.to.length === 0) {
|
|
172
|
+
throw new Error("[qarpeo:email] Recipient address 'to' is required.");
|
|
173
|
+
}
|
|
174
|
+
if (!options.subject) {
|
|
175
|
+
throw new Error("[qarpeo:email] Email 'subject' is required.");
|
|
176
|
+
}
|
|
177
|
+
const messageId = `<${Date.now()}.${Math.random().toString(36).slice(2)}@qarpeo>`;
|
|
178
|
+
const env = getCloudflareEnv(event);
|
|
179
|
+
const binding = env[resolvedBinding];
|
|
180
|
+
const isDev = procEnv.NODE_ENV !== "production" && !globalThis.__qarpeo_prod__ && (!binding || typeof binding.send !== "function");
|
|
181
|
+
if (isDev) {
|
|
182
|
+
logDevMailbox(from, options.to, options.subject, options.text, options.html, messageId);
|
|
183
|
+
const devMailboxArr = globalThis.__qarpeo_dev_mailbox__ ||= [];
|
|
184
|
+
devMailboxArr.unshift({
|
|
185
|
+
id: messageId,
|
|
186
|
+
to: options.to,
|
|
187
|
+
from,
|
|
188
|
+
subject: options.subject,
|
|
189
|
+
html: options.html || "",
|
|
190
|
+
text: options.text || "",
|
|
191
|
+
timestamp: Date.now(),
|
|
192
|
+
headers: options.headers
|
|
193
|
+
});
|
|
194
|
+
if (devMailboxArr.length > 100) {
|
|
195
|
+
devMailboxArr.pop();
|
|
196
|
+
}
|
|
197
|
+
return {
|
|
198
|
+
success: true,
|
|
199
|
+
id: messageId,
|
|
200
|
+
message: "Intercepted by local development mailbox"
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
if (!binding || typeof binding.send !== "function") {
|
|
204
|
+
throw new Error(
|
|
205
|
+
`[qarpeo:email] Cloudflare send_email binding "${resolvedBinding}" is not available. Make sure email: true is enabled and deployed to Cloudflare Workers.`
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
const cleanFrom = extractEmailAddress(from);
|
|
209
|
+
const toArr = Array.isArray(options.to) ? options.to : [options.to];
|
|
210
|
+
const bccArr = options.bcc ? Array.isArray(options.bcc) ? options.bcc : [options.bcc] : [];
|
|
211
|
+
const cleanTo = [...toArr, ...bccArr].map((addr) => extractEmailAddress(String(addr))).filter(Boolean);
|
|
212
|
+
const rawMime = buildMimeMessage({
|
|
213
|
+
...options,
|
|
214
|
+
from,
|
|
215
|
+
messageId
|
|
216
|
+
});
|
|
217
|
+
try {
|
|
218
|
+
const EmailMessageClass = globalThis.EmailMessage;
|
|
219
|
+
if (typeof EmailMessageClass === "function") {
|
|
220
|
+
const msg = new EmailMessageClass(cleanFrom, cleanTo, rawMime);
|
|
221
|
+
await binding.send(msg);
|
|
222
|
+
} else {
|
|
223
|
+
await binding.send({
|
|
224
|
+
from: cleanFrom,
|
|
225
|
+
to: cleanTo,
|
|
226
|
+
raw: rawMime
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
return {
|
|
230
|
+
success: true,
|
|
231
|
+
id: messageId
|
|
232
|
+
};
|
|
233
|
+
} catch (err) {
|
|
234
|
+
throw new Error(`[qarpeo:email] Failed to send email via Cloudflare: ${err?.message || err}`);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
export function createEmail(bindingName, event) {
|
|
238
|
+
const resolvedBinding = resolveRuntimeBinding("email", bindingName, "EMAIL");
|
|
239
|
+
return {
|
|
240
|
+
send: (opts) => sendEmail({ ...opts, binding: opts.binding || resolvedBinding }, event),
|
|
241
|
+
raw: (bName) => getEmailBinding(bName || resolvedBinding, event)
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
export const useEmail = createEmail;
|
|
245
|
+
export const email = createEmail();
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { QarpeoHyperdrive, HyperdriveBinding } from "./types/hyperdrive";
|
|
2
|
+
import type { CFEvent } from "./types/index";
|
|
3
|
+
export type * from "./types/hyperdrive";
|
|
4
|
+
/**
|
|
5
|
+
* Returns the raw Cloudflare Hyperdrive binding from the active environment.
|
|
6
|
+
*
|
|
7
|
+
* @param bindingName Optional Cloudflare Hyperdrive binding name (defaults to 'HYPERDRIVE')
|
|
8
|
+
* @param event Optional event context
|
|
9
|
+
*/
|
|
10
|
+
export declare function getHyperdriveBinding(bindingName?: string, event?: CFEvent): HyperdriveBinding;
|
|
11
|
+
/** Creates a typed Hyperdrive client for a specific binding and optional event. */
|
|
12
|
+
export declare function createHyperdrive(bindingName?: string, event?: CFEvent): QarpeoHyperdrive;
|
|
13
|
+
/**
|
|
14
|
+
* Access a typed Cloudflare Hyperdrive client.
|
|
15
|
+
*
|
|
16
|
+
* @param bindingName Optional Hyperdrive binding name (defaults to 'HYPERDRIVE')
|
|
17
|
+
* @param event Optional event context
|
|
18
|
+
*/
|
|
19
|
+
export declare const useHyperdrive: (bindingName?: string, event?: CFEvent) => QarpeoHyperdrive;
|
|
20
|
+
/** Auto-imported `hyperdrive` instance for direct Cloudflare Hyperdrive connection properties. */
|
|
21
|
+
export declare const hyperdrive: QarpeoHyperdrive;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { getCloudflareEnv, resolveRuntimeBinding } from "./bindings.mjs";
|
|
2
|
+
export function getHyperdriveBinding(bindingName, event) {
|
|
3
|
+
const resolvedBinding = resolveRuntimeBinding("hyperdrive", bindingName, "HYPERDRIVE");
|
|
4
|
+
const env = getCloudflareEnv(event);
|
|
5
|
+
const binding = env[resolvedBinding];
|
|
6
|
+
if (!binding) {
|
|
7
|
+
throw new Error(
|
|
8
|
+
`[qarpeo] Cloudflare Hyperdrive binding "${resolvedBinding}" was not found. Check your wrangler.json or QARPEO_HYPERDRIVE_BINDING environment variable.`
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
return binding;
|
|
12
|
+
}
|
|
13
|
+
export function createHyperdrive(bindingName, event) {
|
|
14
|
+
const resolvedBinding = resolveRuntimeBinding("hyperdrive", bindingName, "HYPERDRIVE");
|
|
15
|
+
const getHd = () => getHyperdriveBinding(resolvedBinding, event);
|
|
16
|
+
return {
|
|
17
|
+
get connectionString() {
|
|
18
|
+
return getHd().connectionString;
|
|
19
|
+
},
|
|
20
|
+
get host() {
|
|
21
|
+
return getHd().host;
|
|
22
|
+
},
|
|
23
|
+
get port() {
|
|
24
|
+
return getHd().port;
|
|
25
|
+
},
|
|
26
|
+
get user() {
|
|
27
|
+
return getHd().user;
|
|
28
|
+
},
|
|
29
|
+
get password() {
|
|
30
|
+
return getHd().password;
|
|
31
|
+
},
|
|
32
|
+
get database() {
|
|
33
|
+
return getHd().database;
|
|
34
|
+
},
|
|
35
|
+
raw: (bName) => {
|
|
36
|
+
return getHyperdriveBinding(bName || resolvedBinding, event);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export const useHyperdrive = createHyperdrive;
|
|
41
|
+
export const hyperdrive = new Proxy({}, {
|
|
42
|
+
get(_target, prop) {
|
|
43
|
+
if (prop === "raw") {
|
|
44
|
+
return (bindingName) => getHyperdriveBinding(bindingName);
|
|
45
|
+
}
|
|
46
|
+
const instance = createHyperdrive();
|
|
47
|
+
return instance[prop];
|
|
48
|
+
}
|
|
49
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export * from "./types/index";
|
|
2
|
+
export * from "./bindings";
|
|
3
|
+
export * from "./kv";
|
|
4
|
+
export * from "./blob";
|
|
5
|
+
export * from "./db";
|
|
6
|
+
export * from "./drizzle";
|
|
7
|
+
export * from "./email";
|
|
8
|
+
export * from "./cache";
|
|
9
|
+
export * from "./ai";
|
|
10
|
+
export * from "./vectorize";
|
|
11
|
+
export * from "./queue";
|
|
12
|
+
export * from "./analytics";
|
|
13
|
+
export * from "./ratelimit";
|
|
14
|
+
export * from "./hyperdrive";
|
|
15
|
+
export * from "./browser";
|
|
16
|
+
export * from "./auth";
|
|
17
|
+
export * from "./realtime";
|
|
18
|
+
export * from "./cms";
|
|
19
|
+
export * from "./payments";
|
|
20
|
+
export * from "./storage";
|
|
21
|
+
export * from "./bots";
|
|
22
|
+
export * from "./rag";
|
|
23
|
+
export * from "./app/composables/site";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export * from "./types/index.mjs";
|
|
2
|
+
export * from "./bindings.mjs";
|
|
3
|
+
export * from "./kv.mjs";
|
|
4
|
+
export * from "./blob.mjs";
|
|
5
|
+
export * from "./db.mjs";
|
|
6
|
+
export * from "./drizzle.mjs";
|
|
7
|
+
export * from "./email.mjs";
|
|
8
|
+
export * from "./cache.mjs";
|
|
9
|
+
export * from "./ai.mjs";
|
|
10
|
+
export * from "./vectorize.mjs";
|
|
11
|
+
export * from "./queue.mjs";
|
|
12
|
+
export * from "./analytics.mjs";
|
|
13
|
+
export * from "./ratelimit.mjs";
|
|
14
|
+
export * from "./hyperdrive.mjs";
|
|
15
|
+
export * from "./browser.mjs";
|
|
16
|
+
export * from "./auth.mjs";
|
|
17
|
+
export * from "./realtime.mjs";
|
|
18
|
+
export * from "./cms.mjs";
|
|
19
|
+
export * from "./payments.mjs";
|
|
20
|
+
export * from "./storage.mjs";
|
|
21
|
+
export * from "./bots.mjs";
|
|
22
|
+
export * from "./rag.mjs";
|
|
23
|
+
export * from "./app/composables/site.mjs";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CFEvent, QarpeoKV, KVNamespace } from "./types";
|
|
2
|
+
/** Returns the raw Cloudflare KVNamespace binding from the active environment. */
|
|
3
|
+
export declare function getKVBinding(bindingName?: string, event?: CFEvent): KVNamespace;
|
|
4
|
+
/** Creates a typed KV interface for a specific binding and optional event. */
|
|
5
|
+
export declare function createKV(bindingName?: string, event?: CFEvent): QarpeoKV;
|
|
6
|
+
/**
|
|
7
|
+
* Access a typed Cloudflare KV instance.
|
|
8
|
+
*
|
|
9
|
+
* @param bindingName Optional KV binding name (defaults to configured binding or 'KV')
|
|
10
|
+
* @param event Optional event context
|
|
11
|
+
*/
|
|
12
|
+
export declare const useKV: (bindingName?: string, event?: CFEvent) => QarpeoKV;
|
|
13
|
+
/** Auto-imported `kv` instance for direct Cloudflare KV operations. */
|
|
14
|
+
export declare const kv: QarpeoKV;
|
|
15
|
+
/** Alias for getKVBinding for compatibility with nitro storage naming conventions. */
|
|
16
|
+
export declare const getKVStorage: (bindingName?: string, event?: CFEvent) => KVNamespace;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { getCloudflareEnv, resolveRuntimeBinding } from "./bindings.mjs";
|
|
2
|
+
export function getKVBinding(bindingName, event) {
|
|
3
|
+
const resolved = resolveRuntimeBinding("kv", bindingName, "KV");
|
|
4
|
+
const env = getCloudflareEnv(event);
|
|
5
|
+
const binding = env[resolved];
|
|
6
|
+
if (!binding) {
|
|
7
|
+
throw new Error(
|
|
8
|
+
`[qarpeo] Cloudflare KV binding "${resolved}" was not found. Check your wrangler.json or qarpeo.kv configuration.`
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
return binding;
|
|
12
|
+
}
|
|
13
|
+
function serialize(value) {
|
|
14
|
+
if (typeof value === "string") return value;
|
|
15
|
+
return JSON.stringify(value);
|
|
16
|
+
}
|
|
17
|
+
function deserialize(raw) {
|
|
18
|
+
if (raw === null) return null;
|
|
19
|
+
try {
|
|
20
|
+
return JSON.parse(raw);
|
|
21
|
+
} catch {
|
|
22
|
+
return raw;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
async function listAllKeys(kvBinding, prefix) {
|
|
26
|
+
const keys = [];
|
|
27
|
+
let cursor;
|
|
28
|
+
do {
|
|
29
|
+
const result = await kvBinding.list({
|
|
30
|
+
prefix,
|
|
31
|
+
cursor,
|
|
32
|
+
limit: 1e3
|
|
33
|
+
});
|
|
34
|
+
keys.push(...result.keys);
|
|
35
|
+
cursor = result.list_complete ? void 0 : result.cursor;
|
|
36
|
+
} while (cursor);
|
|
37
|
+
return keys;
|
|
38
|
+
}
|
|
39
|
+
export function createKV(bindingName, event) {
|
|
40
|
+
const resolvedBinding = resolveRuntimeBinding("kv", bindingName, "KV");
|
|
41
|
+
const getKV = () => getKVBinding(resolvedBinding, event);
|
|
42
|
+
return {
|
|
43
|
+
// -------------------------------------------------------------------------
|
|
44
|
+
// Core — auto JSON
|
|
45
|
+
// -------------------------------------------------------------------------
|
|
46
|
+
get: async (key, options) => {
|
|
47
|
+
const kv2 = getKV();
|
|
48
|
+
const type = options?.type ?? "json";
|
|
49
|
+
const cacheTtl = options?.cacheTtl;
|
|
50
|
+
if (type === "json") {
|
|
51
|
+
const raw = await kv2.get(key, { type: "text", cacheTtl });
|
|
52
|
+
return deserialize(raw);
|
|
53
|
+
}
|
|
54
|
+
const result = await kv2.get(key, { type, cacheTtl });
|
|
55
|
+
return result;
|
|
56
|
+
},
|
|
57
|
+
set: async (key, value, options) => {
|
|
58
|
+
const kv2 = getKV();
|
|
59
|
+
const raw = serialize(value);
|
|
60
|
+
await kv2.put(key, raw, {
|
|
61
|
+
expirationTtl: options?.ttl ?? options?.ex,
|
|
62
|
+
expiration: options?.expiration,
|
|
63
|
+
metadata: options?.metadata ?? null
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
has: async (key) => {
|
|
67
|
+
const kv2 = getKV();
|
|
68
|
+
const val = await kv2.get(key, { type: "text" });
|
|
69
|
+
return val !== null;
|
|
70
|
+
},
|
|
71
|
+
delete: async (key) => {
|
|
72
|
+
const kv2 = getKV();
|
|
73
|
+
await kv2.delete(key);
|
|
74
|
+
return true;
|
|
75
|
+
},
|
|
76
|
+
del: async (key) => {
|
|
77
|
+
const kv2 = getKV();
|
|
78
|
+
await kv2.delete(key);
|
|
79
|
+
return true;
|
|
80
|
+
},
|
|
81
|
+
// -------------------------------------------------------------------------
|
|
82
|
+
// Listing — transparent cursor pagination
|
|
83
|
+
// -------------------------------------------------------------------------
|
|
84
|
+
keys: async (prefix) => {
|
|
85
|
+
const kv2 = getKV();
|
|
86
|
+
const keys = await listAllKeys(kv2, prefix);
|
|
87
|
+
return keys.map((k) => k.name);
|
|
88
|
+
},
|
|
89
|
+
list: async (options) => {
|
|
90
|
+
const kv2 = getKV();
|
|
91
|
+
return await kv2.list({
|
|
92
|
+
prefix: options?.prefix,
|
|
93
|
+
limit: options?.limit ?? 1e3,
|
|
94
|
+
cursor: options?.cursor
|
|
95
|
+
});
|
|
96
|
+
},
|
|
97
|
+
clear: async (prefix) => {
|
|
98
|
+
const kv2 = getKV();
|
|
99
|
+
const keys = await listAllKeys(kv2, prefix);
|
|
100
|
+
await Promise.all(keys.map((k) => kv2.delete(k.name)));
|
|
101
|
+
},
|
|
102
|
+
// -------------------------------------------------------------------------
|
|
103
|
+
// CF-native: metadata (unstorage can't do this)
|
|
104
|
+
// -------------------------------------------------------------------------
|
|
105
|
+
getWithMetadata: async (key, options) => {
|
|
106
|
+
const kv2 = getKV();
|
|
107
|
+
const type = options?.type ?? "json";
|
|
108
|
+
const cacheTtl = options?.cacheTtl;
|
|
109
|
+
if (type === "json") {
|
|
110
|
+
const { value: raw, metadata: metadata2 } = await kv2.getWithMetadata(key, { type: "text", cacheTtl });
|
|
111
|
+
return { value: deserialize(raw), metadata: metadata2 };
|
|
112
|
+
}
|
|
113
|
+
const { value, metadata } = await kv2.getWithMetadata(key, { type, cacheTtl });
|
|
114
|
+
return { value, metadata };
|
|
115
|
+
},
|
|
116
|
+
// -------------------------------------------------------------------------
|
|
117
|
+
// Raw escape hatch
|
|
118
|
+
// -------------------------------------------------------------------------
|
|
119
|
+
raw: (bName) => {
|
|
120
|
+
return getKVBinding(bName || resolvedBinding, event);
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
export const useKV = createKV;
|
|
125
|
+
export const kv = createKV();
|
|
126
|
+
export const getKVStorage = getKVBinding;
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { CFEvent } from "./types/index";
|
|
2
|
+
import type { QarpeoQueue, Queue } from "./types/queue";
|
|
3
|
+
export type * from "./types/queue";
|
|
4
|
+
/**
|
|
5
|
+
* Returns the raw Cloudflare Queue binding from the active environment.
|
|
6
|
+
*
|
|
7
|
+
* @param bindingName Optional Cloudflare Queue binding name (defaults to 'QUEUE')
|
|
8
|
+
* @param event Optional event context
|
|
9
|
+
*/
|
|
10
|
+
export declare function getQueueBinding<T = any>(bindingName?: string, event?: CFEvent): Queue<T>;
|
|
11
|
+
/** Creates a typed Queue client for a specific binding and optional event. */
|
|
12
|
+
export declare function createQueue<T = any>(bindingName?: string, event?: CFEvent): QarpeoQueue<T>;
|
|
13
|
+
/**
|
|
14
|
+
* Access a typed Cloudflare Queue client.
|
|
15
|
+
*
|
|
16
|
+
* @param bindingName Optional Cloudflare Queue binding name (defaults to 'QUEUE')
|
|
17
|
+
* @param event Optional event context
|
|
18
|
+
*/
|
|
19
|
+
export declare const useQueue: <T = any>(bindingName?: string, event?: CFEvent) => QarpeoQueue<T>;
|
|
20
|
+
/** Auto-imported `queue` instance for direct Cloudflare Queue operations. */
|
|
21
|
+
export declare const queue: QarpeoQueue<any>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { getCloudflareEnv, resolveRuntimeBinding } from "./bindings.mjs";
|
|
2
|
+
export function getQueueBinding(bindingName, event) {
|
|
3
|
+
const resolvedBinding = resolveRuntimeBinding("queue", bindingName, "QUEUE");
|
|
4
|
+
const env = getCloudflareEnv(event);
|
|
5
|
+
const binding = env[resolvedBinding];
|
|
6
|
+
if (!binding) {
|
|
7
|
+
throw new Error(
|
|
8
|
+
`[qarpeo] Cloudflare Queue binding "${resolvedBinding}" was not found. Check your wrangler.json or QARPEO_QUEUE_BINDING environment variable.`
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
return binding;
|
|
12
|
+
}
|
|
13
|
+
export function createQueue(bindingName, event) {
|
|
14
|
+
const resolvedBinding = resolveRuntimeBinding("queue", bindingName, "QUEUE");
|
|
15
|
+
const getQ = () => getQueueBinding(resolvedBinding, event);
|
|
16
|
+
return {
|
|
17
|
+
send: (message, options) => {
|
|
18
|
+
return getQ().send(message, options);
|
|
19
|
+
},
|
|
20
|
+
sendBatch: (messages, options) => {
|
|
21
|
+
return getQ().sendBatch(messages, options);
|
|
22
|
+
},
|
|
23
|
+
raw: (bName) => {
|
|
24
|
+
return getQueueBinding(bName || resolvedBinding, event);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export const useQueue = createQueue;
|
|
29
|
+
export const queue = new Proxy({}, {
|
|
30
|
+
get(_target, prop) {
|
|
31
|
+
if (prop === "raw") {
|
|
32
|
+
return (bindingName) => getQueueBinding(bindingName);
|
|
33
|
+
}
|
|
34
|
+
const instance = createQueue();
|
|
35
|
+
const val = instance[prop];
|
|
36
|
+
if (typeof val === "function") {
|
|
37
|
+
return val.bind(instance);
|
|
38
|
+
}
|
|
39
|
+
return val;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./server/utils/rag";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./server/utils/rag.mjs";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { CFEvent } from "./types/index";
|
|
2
|
+
import type { QarpeoRateLimit, RateLimiterBinding } from "./types/ratelimit";
|
|
3
|
+
export type * from "./types/ratelimit";
|
|
4
|
+
/**
|
|
5
|
+
* Returns the raw Cloudflare RateLimiter binding from the active environment.
|
|
6
|
+
*
|
|
7
|
+
* @param bindingName Optional Cloudflare RateLimiter binding name (defaults to 'RATE_LIMITER')
|
|
8
|
+
* @param event Optional event context
|
|
9
|
+
*/
|
|
10
|
+
export declare function getRateLimitBinding(bindingName?: string, event?: CFEvent): RateLimiterBinding;
|
|
11
|
+
/** Creates a typed RateLimiter client for a specific binding and optional event. */
|
|
12
|
+
export declare function createRateLimit(bindingName?: string, event?: CFEvent): QarpeoRateLimit;
|
|
13
|
+
/**
|
|
14
|
+
* Access a typed Cloudflare RateLimiter client.
|
|
15
|
+
*
|
|
16
|
+
* @param bindingName Optional RateLimiter binding name (defaults to 'RATE_LIMITER')
|
|
17
|
+
* @param event Optional event context
|
|
18
|
+
*/
|
|
19
|
+
export declare const useRateLimit: (bindingName?: string, event?: CFEvent) => QarpeoRateLimit;
|
|
20
|
+
/** Auto-imported `rateLimit` instance for direct Cloudflare RateLimiter operations. */
|
|
21
|
+
export declare const rateLimit: QarpeoRateLimit;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { getCloudflareEnv, resolveRuntimeBinding } from "./bindings.mjs";
|
|
2
|
+
export function getRateLimitBinding(bindingName, event) {
|
|
3
|
+
const resolvedBinding = resolveRuntimeBinding("ratelimit", bindingName, "RATE_LIMITER");
|
|
4
|
+
const env = getCloudflareEnv(event);
|
|
5
|
+
const binding = env[resolvedBinding];
|
|
6
|
+
if (!binding) {
|
|
7
|
+
throw new Error(
|
|
8
|
+
`[qarpeo] Cloudflare RateLimiter binding "${resolvedBinding}" was not found. Check your wrangler.json or QARPEO_RATELIMIT_BINDING environment variable.`
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
return binding;
|
|
12
|
+
}
|
|
13
|
+
export function createRateLimit(bindingName, event) {
|
|
14
|
+
const resolvedBinding = resolveRuntimeBinding("ratelimit", bindingName, "RATE_LIMITER");
|
|
15
|
+
const getLimiter = () => getRateLimitBinding(resolvedBinding, event);
|
|
16
|
+
return {
|
|
17
|
+
limit: (options) => {
|
|
18
|
+
return getLimiter().limit(options);
|
|
19
|
+
},
|
|
20
|
+
raw: (bName) => {
|
|
21
|
+
return getRateLimitBinding(bName || resolvedBinding, event);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export const useRateLimit = createRateLimit;
|
|
26
|
+
export const rateLimit = new Proxy({}, {
|
|
27
|
+
get(_target, prop) {
|
|
28
|
+
if (prop === "raw") {
|
|
29
|
+
return (bindingName) => getRateLimitBinding(bindingName);
|
|
30
|
+
}
|
|
31
|
+
const instance = createRateLimit();
|
|
32
|
+
const val = instance[prop];
|
|
33
|
+
if (typeof val === "function") {
|
|
34
|
+
return val.bind(instance);
|
|
35
|
+
}
|
|
36
|
+
return val;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { QarpeoRoomDO } from "./server/durable-objects/room";
|
|
2
|
+
export { useRealtime, usePresence, useRoomState } from "./app/composables/realtime";
|
|
3
|
+
export { broadcastToRoom, getRoomPresence, getRoomHistory, getRoomState, setRoomState, patchRoomState, disconnectRoomUser, getRoomDurableObject, defineRealtimeHandler, } from "./server/utils/realtime";
|
|
4
|
+
export type { RealtimeOptions, RealtimeUser, RealtimeMessage, RealtimePeer, RealtimeHandlerOptions, RealtimeHandlerRegistration, UsePresenceOptions, UsePresenceReturn, UseRoomStateReturn, } from "../types";
|
|
5
|
+
export type { DurableObjectId, DurableObjectStub, DurableObjectNamespace, DurableObjectState, DurableObjectStorage, } from "./types";
|
|
6
|
+
export type { UseRealtimeOptions, UseRealtimeReturn } from "./app/composables/realtime";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { QarpeoRoomDO } from "./server/durable-objects/room.mjs";
|
|
2
|
+
export { useRealtime, usePresence, useRoomState } from "./app/composables/realtime.mjs";
|
|
3
|
+
export {
|
|
4
|
+
broadcastToRoom,
|
|
5
|
+
getRoomPresence,
|
|
6
|
+
getRoomHistory,
|
|
7
|
+
getRoomState,
|
|
8
|
+
setRoomState,
|
|
9
|
+
patchRoomState,
|
|
10
|
+
disconnectRoomUser,
|
|
11
|
+
getRoomDurableObject,
|
|
12
|
+
defineRealtimeHandler
|
|
13
|
+
} from "./server/utils/realtime.mjs";
|