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,63 @@
|
|
|
1
|
+
import { defineEventHandler } from "nuxt/server";
|
|
2
|
+
import { useRuntimeConfig } from "nuxt/server";
|
|
3
|
+
import { getDevMockAgentsStore } from "../../../utils/agent-store.mjs";
|
|
4
|
+
import { getAllAgentDefinitions } from "../../../utils/ai.mjs";
|
|
5
|
+
export default defineEventHandler(() => {
|
|
6
|
+
const store = getDevMockAgentsStore();
|
|
7
|
+
const realDefs = getAllAgentDefinitions();
|
|
8
|
+
const rc = useRuntimeConfig();
|
|
9
|
+
const discoveredNames = rc?.qarpeo?.agents?.discovered || [];
|
|
10
|
+
const result = [];
|
|
11
|
+
const seenIds = /* @__PURE__ */ new Set();
|
|
12
|
+
for (const def of realDefs) {
|
|
13
|
+
seenIds.add(def.name);
|
|
14
|
+
const toolNames = def.tools ? Array.isArray(def.tools) ? def.tools.map((t) => t.name || "tool") : Object.keys(def.tools) : [];
|
|
15
|
+
result.push({
|
|
16
|
+
id: def.name,
|
|
17
|
+
name: def.name,
|
|
18
|
+
description: `Autonomous agent defined in server/agents/${def.name}.ts`,
|
|
19
|
+
status: "active",
|
|
20
|
+
model: def.model || rc?.qarpeo?.agents?.defaultModel || "@cf/meta/llama-3.3-70b-instruct",
|
|
21
|
+
systemPrompt: def.system || def.systemPrompt || "You are a helpful AI assistant.",
|
|
22
|
+
tools: toolNames.join(", "),
|
|
23
|
+
messagesCount: 0,
|
|
24
|
+
createdAt: Date.now(),
|
|
25
|
+
source: "code"
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
for (const name of discoveredNames) {
|
|
29
|
+
if (!seenIds.has(name)) {
|
|
30
|
+
seenIds.add(name);
|
|
31
|
+
result.push({
|
|
32
|
+
id: name,
|
|
33
|
+
name,
|
|
34
|
+
description: `Discovered agent in server/agents/${name}.ts`,
|
|
35
|
+
status: "ready",
|
|
36
|
+
model: rc?.qarpeo?.agents?.defaultModel || "@cf/meta/llama-3.3-70b-instruct",
|
|
37
|
+
systemPrompt: "Configured agent definition",
|
|
38
|
+
tools: "",
|
|
39
|
+
messagesCount: 0,
|
|
40
|
+
createdAt: Date.now(),
|
|
41
|
+
source: "code"
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
for (const a of store.values()) {
|
|
46
|
+
if (!seenIds.has(a.id)) {
|
|
47
|
+
seenIds.add(a.id);
|
|
48
|
+
result.push({
|
|
49
|
+
id: a.id,
|
|
50
|
+
name: a.name,
|
|
51
|
+
description: a.description,
|
|
52
|
+
status: a.status,
|
|
53
|
+
model: a.model,
|
|
54
|
+
systemPrompt: a.systemPrompt,
|
|
55
|
+
tools: a.tools,
|
|
56
|
+
messagesCount: a.messages.length,
|
|
57
|
+
createdAt: a.createdAt,
|
|
58
|
+
source: "devtools-dev"
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return { agents: result };
|
|
63
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GET /_qarpeo/api/analytics/events?range=7d
|
|
3
|
+
* DevTools Analytics events endpoint.
|
|
4
|
+
*/
|
|
5
|
+
declare const _default: import("nuxt/server").EventHandler<Promise<{
|
|
6
|
+
events: import("../../../../../types").AnalyticsEventRecord[];
|
|
7
|
+
preview: boolean;
|
|
8
|
+
} | {
|
|
9
|
+
events: ({
|
|
10
|
+
name: string;
|
|
11
|
+
count: number;
|
|
12
|
+
lastSeen: string;
|
|
13
|
+
sampleMetadata: {
|
|
14
|
+
method: string;
|
|
15
|
+
authenticator: string;
|
|
16
|
+
tags?: undefined;
|
|
17
|
+
collection?: undefined;
|
|
18
|
+
id?: undefined;
|
|
19
|
+
agent?: undefined;
|
|
20
|
+
stream?: undefined;
|
|
21
|
+
};
|
|
22
|
+
} | {
|
|
23
|
+
name: string;
|
|
24
|
+
count: number;
|
|
25
|
+
lastSeen: string;
|
|
26
|
+
sampleMetadata: {
|
|
27
|
+
tags: string[];
|
|
28
|
+
method?: undefined;
|
|
29
|
+
authenticator?: undefined;
|
|
30
|
+
collection?: undefined;
|
|
31
|
+
id?: undefined;
|
|
32
|
+
agent?: undefined;
|
|
33
|
+
stream?: undefined;
|
|
34
|
+
};
|
|
35
|
+
} | {
|
|
36
|
+
name: string;
|
|
37
|
+
count: number;
|
|
38
|
+
lastSeen: string;
|
|
39
|
+
sampleMetadata: {
|
|
40
|
+
collection: string;
|
|
41
|
+
id: string;
|
|
42
|
+
method?: undefined;
|
|
43
|
+
authenticator?: undefined;
|
|
44
|
+
tags?: undefined;
|
|
45
|
+
agent?: undefined;
|
|
46
|
+
stream?: undefined;
|
|
47
|
+
};
|
|
48
|
+
} | {
|
|
49
|
+
name: string;
|
|
50
|
+
count: number;
|
|
51
|
+
lastSeen: string;
|
|
52
|
+
sampleMetadata: {
|
|
53
|
+
agent: string;
|
|
54
|
+
stream: boolean;
|
|
55
|
+
method?: undefined;
|
|
56
|
+
authenticator?: undefined;
|
|
57
|
+
tags?: undefined;
|
|
58
|
+
collection?: undefined;
|
|
59
|
+
id?: undefined;
|
|
60
|
+
};
|
|
61
|
+
})[];
|
|
62
|
+
preview: boolean;
|
|
63
|
+
}>>;
|
|
64
|
+
export default _default;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { defineEventHandler, getQuery } from "nuxt/server";
|
|
2
|
+
import { useAnalyticsDashboard } from "../../../utils/analytics-query.mjs";
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
const query = getQuery(event);
|
|
5
|
+
const range = query.range || "7d";
|
|
6
|
+
const name = query.name ? String(query.name) : void 0;
|
|
7
|
+
const limit = query.limit ? parseInt(String(query.limit), 10) : 20;
|
|
8
|
+
const rc = event.context?.nitro?.runtimeConfig ?? event.$config ?? {};
|
|
9
|
+
const cfg = rc?.qarpeo?.analytics || {};
|
|
10
|
+
const hasConfig = Boolean(cfg.dataset || cfg.accountId || cfg.siteId);
|
|
11
|
+
try {
|
|
12
|
+
if (hasConfig) {
|
|
13
|
+
const dash = useAnalyticsDashboard({
|
|
14
|
+
accountId: cfg.accountId,
|
|
15
|
+
apiToken: cfg.apiToken,
|
|
16
|
+
dataset: cfg.dataset,
|
|
17
|
+
siteId: cfg.siteId
|
|
18
|
+
});
|
|
19
|
+
const data = await dash.events(name, limit, range);
|
|
20
|
+
if (data && Array.isArray(data) && data.length > 0) {
|
|
21
|
+
return { events: data, preview: false };
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
} catch {
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
events: [
|
|
28
|
+
{
|
|
29
|
+
name: "auth_passkey_register",
|
|
30
|
+
count: 240,
|
|
31
|
+
lastSeen: new Date(Date.now() - 1e3 * 60 * 5).toISOString(),
|
|
32
|
+
sampleMetadata: { method: "webauthn", authenticator: "platform" }
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "kv_cache_purge",
|
|
36
|
+
count: 512,
|
|
37
|
+
lastSeen: new Date(Date.now() - 1e3 * 60 * 18).toISOString(),
|
|
38
|
+
sampleMetadata: { tags: ["cms", "blog"] }
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: "cms_entry_publish",
|
|
42
|
+
count: 88,
|
|
43
|
+
lastSeen: new Date(Date.now() - 1e3 * 60 * 42).toISOString(),
|
|
44
|
+
sampleMetadata: { collection: "posts", id: "edge-performance" }
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: "agent_chat_query",
|
|
48
|
+
count: 380,
|
|
49
|
+
lastSeen: new Date(Date.now() - 1e3 * 60 * 75).toISOString(),
|
|
50
|
+
sampleMetadata: { agent: "agent_chat", stream: true }
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
preview: true
|
|
54
|
+
};
|
|
55
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GET /_qarpeo/api/analytics/summary?range=7d
|
|
3
|
+
* DevTools Analytics summary endpoint. Returns live AE summary or dev preview data with preview: true flag.
|
|
4
|
+
*/
|
|
5
|
+
declare const _default: import("nuxt/server").EventHandler<Promise<{
|
|
6
|
+
totalPageviews: number;
|
|
7
|
+
uniqueVisitors: number;
|
|
8
|
+
customEventsCount: number;
|
|
9
|
+
avgDurationMs: number;
|
|
10
|
+
topPages: {
|
|
11
|
+
path: string;
|
|
12
|
+
views: number;
|
|
13
|
+
}[];
|
|
14
|
+
topReferrers: {
|
|
15
|
+
referrer: string;
|
|
16
|
+
count: number;
|
|
17
|
+
}[];
|
|
18
|
+
countries: {
|
|
19
|
+
country: string;
|
|
20
|
+
code: string;
|
|
21
|
+
count: number;
|
|
22
|
+
}[];
|
|
23
|
+
devices: {
|
|
24
|
+
name: string;
|
|
25
|
+
count: number;
|
|
26
|
+
percent: number;
|
|
27
|
+
}[];
|
|
28
|
+
preview: boolean;
|
|
29
|
+
}>>;
|
|
30
|
+
export default _default;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { defineEventHandler, getQuery } from "nuxt/server";
|
|
2
|
+
import { useAnalyticsDashboard } from "../../../utils/analytics-query.mjs";
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
const query = getQuery(event);
|
|
5
|
+
const range = query.range || "7d";
|
|
6
|
+
const rc = event.context?.nitro?.runtimeConfig ?? event.$config ?? {};
|
|
7
|
+
const cfg = rc?.qarpeo?.analytics || {};
|
|
8
|
+
const hasConfig = Boolean(cfg.dataset || cfg.accountId || cfg.siteId);
|
|
9
|
+
try {
|
|
10
|
+
if (hasConfig) {
|
|
11
|
+
const dash = useAnalyticsDashboard({
|
|
12
|
+
accountId: cfg.accountId,
|
|
13
|
+
apiToken: cfg.apiToken,
|
|
14
|
+
dataset: cfg.dataset,
|
|
15
|
+
siteId: cfg.siteId
|
|
16
|
+
});
|
|
17
|
+
const data = await dash.summary(range);
|
|
18
|
+
if (data && data.pageviews > 0) {
|
|
19
|
+
return {
|
|
20
|
+
totalPageviews: data.pageviews,
|
|
21
|
+
uniqueVisitors: data.visitors,
|
|
22
|
+
customEventsCount: 0,
|
|
23
|
+
avgDurationMs: 0,
|
|
24
|
+
topPages: data.topPages.map((p) => ({ path: p.path, views: p.views })),
|
|
25
|
+
topReferrers: data.topReferrers.map((r) => ({ referrer: r.referrer, count: r.count })),
|
|
26
|
+
countries: data.countries.map((c) => ({ country: c.country, code: c.country, count: c.count })),
|
|
27
|
+
devices: Object.entries(data.devices || {}).map(([name, count]) => ({
|
|
28
|
+
name,
|
|
29
|
+
count,
|
|
30
|
+
percent: 0
|
|
31
|
+
})),
|
|
32
|
+
preview: false
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
} catch {
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
totalPageviews: 18450,
|
|
40
|
+
uniqueVisitors: 9240,
|
|
41
|
+
customEventsCount: 1220,
|
|
42
|
+
avgDurationMs: 3.2,
|
|
43
|
+
topPages: [
|
|
44
|
+
{ path: "/", views: 6840 },
|
|
45
|
+
{ path: "/docs", views: 4210 },
|
|
46
|
+
{ path: "/blog/edge-computing", views: 2890 },
|
|
47
|
+
{ path: "/pricing", views: 1640 },
|
|
48
|
+
{ path: "/about", views: 980 },
|
|
49
|
+
{ path: "/login", views: 890 }
|
|
50
|
+
],
|
|
51
|
+
topReferrers: [
|
|
52
|
+
{ referrer: "Direct / Organic", count: 8200 },
|
|
53
|
+
{ referrer: "github.com", count: 4100 },
|
|
54
|
+
{ referrer: "google.com", count: 3200 },
|
|
55
|
+
{ referrer: "x.com", count: 1850 },
|
|
56
|
+
{ referrer: "news.ycombinator.com", count: 1100 }
|
|
57
|
+
],
|
|
58
|
+
countries: [
|
|
59
|
+
{ country: "United States", code: "US", count: 7200 },
|
|
60
|
+
{ country: "Germany", code: "DE", count: 2850 },
|
|
61
|
+
{ country: "United Kingdom", code: "GB", count: 2420 },
|
|
62
|
+
{ country: "Japan", code: "JP", count: 1810 },
|
|
63
|
+
{ country: "France", code: "FR", count: 1240 },
|
|
64
|
+
{ country: "Canada", code: "CA", count: 980 }
|
|
65
|
+
],
|
|
66
|
+
devices: [
|
|
67
|
+
{ name: "Desktop (Mac / Windows / Linux)", count: 11400, percent: 62 },
|
|
68
|
+
{ name: "Mobile (iOS / Android)", count: 5600, percent: 30 },
|
|
69
|
+
{ name: "Tablet (iPad / Android Tablet)", count: 1450, percent: 8 }
|
|
70
|
+
],
|
|
71
|
+
preview: true
|
|
72
|
+
};
|
|
73
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { defineEventHandler, readBody, createError } from "nuxt/server";
|
|
2
|
+
import { getD1Binding } from "../../../../db.mjs";
|
|
3
|
+
import { getKVBinding } from "../../../../kv.mjs";
|
|
4
|
+
export default defineEventHandler(async (event) => {
|
|
5
|
+
const body = await readBody(event).catch(() => ({}));
|
|
6
|
+
const sessionId = body?.sessionId;
|
|
7
|
+
if (!sessionId) {
|
|
8
|
+
throw createError({ statusCode: 400, message: "Missing sessionId parameter" });
|
|
9
|
+
}
|
|
10
|
+
try {
|
|
11
|
+
const bindingName = globalThis.process?.env?.QARPEO_DEFAULT_DB_BINDING || "DB";
|
|
12
|
+
const d1 = getD1Binding(bindingName, event);
|
|
13
|
+
if (d1) {
|
|
14
|
+
await d1.prepare("DELETE FROM _qarpeo_sessions WHERE id = ?").bind(sessionId).run();
|
|
15
|
+
}
|
|
16
|
+
} catch {
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
const kv = getKVBinding("KV", event);
|
|
20
|
+
if (kv) {
|
|
21
|
+
await kv.delete(`session:${sessionId}`);
|
|
22
|
+
}
|
|
23
|
+
} catch {
|
|
24
|
+
}
|
|
25
|
+
return { success: true, revokedId: sessionId };
|
|
26
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { defineEventHandler } from "nuxt/server";
|
|
2
|
+
import { getD1Binding } from "../../../../db.mjs";
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
let d1;
|
|
5
|
+
try {
|
|
6
|
+
const bindingName = globalThis.process?.env?.QARPEO_DEFAULT_DB_BINDING || "DB";
|
|
7
|
+
d1 = getD1Binding(bindingName, event);
|
|
8
|
+
} catch {
|
|
9
|
+
d1 = null;
|
|
10
|
+
}
|
|
11
|
+
if (d1) {
|
|
12
|
+
try {
|
|
13
|
+
const sql = `
|
|
14
|
+
SELECT s.id, s.user_id as userId, s.client_type as clientType, s.user_agent as userAgent,
|
|
15
|
+
s.ip_address as ipAddress, s.last_active as lastActive, s.expires_at as expiresAt,
|
|
16
|
+
u.email as userEmail, u.name as userName
|
|
17
|
+
FROM _qarpeo_sessions s
|
|
18
|
+
LEFT JOIN _qarpeo_users u ON s.user_id = u.id
|
|
19
|
+
ORDER BY s.last_active DESC
|
|
20
|
+
LIMIT 100
|
|
21
|
+
`;
|
|
22
|
+
const rows = await d1.prepare(sql).all();
|
|
23
|
+
return {
|
|
24
|
+
sessions: rows.results || [],
|
|
25
|
+
isDevMock: false
|
|
26
|
+
};
|
|
27
|
+
} catch {
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
sessions: [
|
|
32
|
+
{
|
|
33
|
+
id: "sess_mock_01",
|
|
34
|
+
userId: "usr_admin_01",
|
|
35
|
+
userName: "Admin User",
|
|
36
|
+
userEmail: "admin@qarpeo.dev",
|
|
37
|
+
clientType: "web",
|
|
38
|
+
userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/120.0.0.0",
|
|
39
|
+
ipAddress: "127.0.0.1",
|
|
40
|
+
lastActive: Date.now() - 1e3 * 120,
|
|
41
|
+
expiresAt: Date.now() + 864e5 * 7
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
isDevMock: true
|
|
45
|
+
};
|
|
46
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { defineEventHandler, getQuery } from "nuxt/server";
|
|
2
|
+
import { getD1Binding } from "../../../../db.mjs";
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
const query = getQuery(event);
|
|
5
|
+
const search = query.search ? String(query.search).toLowerCase() : void 0;
|
|
6
|
+
let d1;
|
|
7
|
+
try {
|
|
8
|
+
const bindingName = globalThis.process?.env?.QARPEO_DEFAULT_DB_BINDING || "DB";
|
|
9
|
+
d1 = getD1Binding(bindingName, event);
|
|
10
|
+
} catch {
|
|
11
|
+
d1 = null;
|
|
12
|
+
}
|
|
13
|
+
if (d1) {
|
|
14
|
+
try {
|
|
15
|
+
let sql = `SELECT id, email, name, avatar_url as avatarUrl, role, email_verified as emailVerified, created_at as createdAt, updated_at as updatedAt FROM _qarpeo_users`;
|
|
16
|
+
const binds = [];
|
|
17
|
+
if (search) {
|
|
18
|
+
sql += ` WHERE email LIKE ? OR name LIKE ?`;
|
|
19
|
+
binds.push(`%${search}%`, `%${search}%`);
|
|
20
|
+
}
|
|
21
|
+
sql += ` ORDER BY created_at DESC LIMIT 100`;
|
|
22
|
+
const rows = await d1.prepare(sql).bind(...binds).all();
|
|
23
|
+
const users = rows.results || [];
|
|
24
|
+
const totalCountRes = await d1.prepare("SELECT count(*) as count FROM _qarpeo_users").first();
|
|
25
|
+
const totalCount = totalCountRes?.count || users.length;
|
|
26
|
+
return {
|
|
27
|
+
users,
|
|
28
|
+
total: totalCount,
|
|
29
|
+
isDevMock: false
|
|
30
|
+
};
|
|
31
|
+
} catch {
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const devUsers = [
|
|
35
|
+
{
|
|
36
|
+
id: "usr_admin_01",
|
|
37
|
+
email: "admin@qarpeo.dev",
|
|
38
|
+
name: "Admin User",
|
|
39
|
+
role: "admin",
|
|
40
|
+
emailVerified: 1,
|
|
41
|
+
createdAt: Date.now() - 864e5 * 14,
|
|
42
|
+
updatedAt: Date.now() - 864e5 * 2
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: "usr_dev_02",
|
|
46
|
+
email: "developer@example.com",
|
|
47
|
+
name: "Dev User",
|
|
48
|
+
role: "user",
|
|
49
|
+
emailVerified: 1,
|
|
50
|
+
createdAt: Date.now() - 864e5 * 7,
|
|
51
|
+
updatedAt: Date.now() - 864e5 * 1
|
|
52
|
+
}
|
|
53
|
+
];
|
|
54
|
+
let filtered = devUsers;
|
|
55
|
+
if (search) {
|
|
56
|
+
filtered = filtered.filter(
|
|
57
|
+
(u) => u.email.toLowerCase().includes(search) || u.name.toLowerCase().includes(search)
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
users: filtered,
|
|
62
|
+
total: filtered.length,
|
|
63
|
+
isDevMock: true
|
|
64
|
+
};
|
|
65
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** GET /_qarpeo/api/blob/files?prefix=&limit=50 Lists R2/Blob files with metadata. */
|
|
2
|
+
declare const _default: import("nuxt/server").EventHandler<Promise<{
|
|
3
|
+
files: {
|
|
4
|
+
key: string;
|
|
5
|
+
size: number;
|
|
6
|
+
contentType: any;
|
|
7
|
+
uploaded: string;
|
|
8
|
+
etag: string;
|
|
9
|
+
}[];
|
|
10
|
+
truncated: boolean;
|
|
11
|
+
notice?: undefined;
|
|
12
|
+
} | {
|
|
13
|
+
files: {
|
|
14
|
+
key: string;
|
|
15
|
+
size: number;
|
|
16
|
+
contentType: string;
|
|
17
|
+
uploaded: string;
|
|
18
|
+
}[];
|
|
19
|
+
truncated: boolean;
|
|
20
|
+
notice: string;
|
|
21
|
+
}>>;
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { defineEventHandler, getQuery } from "nuxt/server";
|
|
2
|
+
import { getR2Binding } from "../../../../blob.mjs";
|
|
3
|
+
import { getDevMockBlobStore } from "../../../utils/blob-store.mjs";
|
|
4
|
+
export default defineEventHandler(async (event) => {
|
|
5
|
+
const query = getQuery(event);
|
|
6
|
+
const prefix = query.prefix ? String(query.prefix) : void 0;
|
|
7
|
+
const limit = query.limit ? parseInt(String(query.limit), 10) : 50;
|
|
8
|
+
try {
|
|
9
|
+
const rc = event.context?.nitro?.runtimeConfig ?? event.$config ?? {};
|
|
10
|
+
const bindingName = rc?.qarpeo?.blob?.binding || "BLOB";
|
|
11
|
+
const r2 = getR2Binding(bindingName, event);
|
|
12
|
+
const listRes = await r2.list({ prefix, limit });
|
|
13
|
+
const files = (listRes.objects || []).map((obj) => ({
|
|
14
|
+
key: obj.key,
|
|
15
|
+
size: obj.size,
|
|
16
|
+
contentType: obj.httpMetadata?.contentType ?? "application/octet-stream",
|
|
17
|
+
uploaded: obj.uploaded?.toISOString?.() ?? null,
|
|
18
|
+
etag: obj.etag
|
|
19
|
+
}));
|
|
20
|
+
return { files, truncated: listRes.truncated };
|
|
21
|
+
} catch {
|
|
22
|
+
const store = getDevMockBlobStore();
|
|
23
|
+
const filesList = Array.from(store.values());
|
|
24
|
+
const filtered = filesList.filter((f) => !prefix || f.key.startsWith(prefix));
|
|
25
|
+
return {
|
|
26
|
+
files: filtered.slice(0, limit).map((f) => ({
|
|
27
|
+
key: f.key,
|
|
28
|
+
size: f.size,
|
|
29
|
+
contentType: f.contentType,
|
|
30
|
+
uploaded: f.uploaded
|
|
31
|
+
})),
|
|
32
|
+
truncated: false,
|
|
33
|
+
notice: "R2 local binding preview mode"
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* POST /_qarpeo/api/db/query Executes an arbitrary SQL query against D1/SQLite with execution
|
|
3
|
+
* timing.
|
|
4
|
+
*/
|
|
5
|
+
declare const _default: import("nuxt/server").EventHandler<Promise<{
|
|
6
|
+
success: boolean;
|
|
7
|
+
durationMs: number;
|
|
8
|
+
rows: Record<string, unknown>[];
|
|
9
|
+
changes: {};
|
|
10
|
+
lastRowId: {} | null;
|
|
11
|
+
notice?: undefined;
|
|
12
|
+
} | {
|
|
13
|
+
success: boolean;
|
|
14
|
+
durationMs: number;
|
|
15
|
+
rows: {
|
|
16
|
+
message: string;
|
|
17
|
+
sql: any;
|
|
18
|
+
}[];
|
|
19
|
+
notice: any;
|
|
20
|
+
changes?: undefined;
|
|
21
|
+
lastRowId?: undefined;
|
|
22
|
+
}>>;
|
|
23
|
+
export default _default;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { defineEventHandler, readBody, createError } from "nuxt/server";
|
|
2
|
+
import { getD1Binding } from "../../../../db.mjs";
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
const body = await readBody(event).catch(() => ({}));
|
|
5
|
+
const sql = body?.sql?.trim();
|
|
6
|
+
if (!sql) {
|
|
7
|
+
throw createError({ statusCode: 400, message: "Missing SQL query string." });
|
|
8
|
+
}
|
|
9
|
+
const startTime = Date.now();
|
|
10
|
+
try {
|
|
11
|
+
const d1 = getD1Binding("DB", event);
|
|
12
|
+
const params = Array.isArray(body?.params) ? body.params : null;
|
|
13
|
+
const stmt = params && params.length ? d1.prepare(sql).bind(...params) : d1.prepare(sql);
|
|
14
|
+
const result = await stmt.all();
|
|
15
|
+
const durationMs = Date.now() - startTime;
|
|
16
|
+
return {
|
|
17
|
+
success: true,
|
|
18
|
+
durationMs,
|
|
19
|
+
rows: result.results || [],
|
|
20
|
+
changes: result.meta?.changes ?? 0,
|
|
21
|
+
lastRowId: result.meta?.last_row_id ?? null
|
|
22
|
+
};
|
|
23
|
+
} catch (err) {
|
|
24
|
+
if (process.env.NODE_ENV !== "production") {
|
|
25
|
+
return {
|
|
26
|
+
success: true,
|
|
27
|
+
durationMs: Date.now() - startTime,
|
|
28
|
+
rows: [{ message: "Query executed in simulation mode", sql }],
|
|
29
|
+
notice: err.message
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
throw createError({ statusCode: 500, message: err.message });
|
|
33
|
+
}
|
|
34
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GET /_qarpeo/api/db/tables Lists all database tables, columns, and estimated row counts from D1
|
|
3
|
+
* / SQLite.
|
|
4
|
+
*/
|
|
5
|
+
declare const _default: import("nuxt/server").EventHandler<Promise<{
|
|
6
|
+
tables: {
|
|
7
|
+
name: string;
|
|
8
|
+
rows: number;
|
|
9
|
+
columns: {
|
|
10
|
+
name: string;
|
|
11
|
+
type: string;
|
|
12
|
+
notNull: boolean;
|
|
13
|
+
primaryKey: boolean;
|
|
14
|
+
defaultValue: any;
|
|
15
|
+
}[];
|
|
16
|
+
}[];
|
|
17
|
+
notice?: undefined;
|
|
18
|
+
} | {
|
|
19
|
+
tables: {
|
|
20
|
+
name: string;
|
|
21
|
+
rows: number;
|
|
22
|
+
columns: {
|
|
23
|
+
name: string;
|
|
24
|
+
type: string;
|
|
25
|
+
notNull: boolean;
|
|
26
|
+
primaryKey: boolean;
|
|
27
|
+
}[];
|
|
28
|
+
}[];
|
|
29
|
+
notice: string;
|
|
30
|
+
}>>;
|
|
31
|
+
export default _default;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { defineEventHandler } from "nuxt/server";
|
|
2
|
+
import { getD1Binding } from "../../../../db.mjs";
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
try {
|
|
5
|
+
const d1 = getD1Binding("DB", event);
|
|
6
|
+
const tablesResult = await d1.prepare(
|
|
7
|
+
"SELECT name FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%' AND name NOT LIKE '_cf_%' ORDER BY name ASC"
|
|
8
|
+
).all();
|
|
9
|
+
const tables = tablesResult.results || [];
|
|
10
|
+
const detailedTables = await Promise.all(
|
|
11
|
+
tables.map(async (t) => {
|
|
12
|
+
try {
|
|
13
|
+
const countRes = await d1.prepare(`SELECT count(*) as count FROM "${t.name}"`).first();
|
|
14
|
+
const columnsRes = await d1.prepare(`PRAGMA table_info("${t.name}")`).all();
|
|
15
|
+
return {
|
|
16
|
+
name: t.name,
|
|
17
|
+
rows: countRes?.count ?? 0,
|
|
18
|
+
columns: (columnsRes.results || []).map((c) => ({
|
|
19
|
+
name: c.name,
|
|
20
|
+
type: c.type,
|
|
21
|
+
notNull: Boolean(c.notnull),
|
|
22
|
+
primaryKey: Boolean(c.pk),
|
|
23
|
+
defaultValue: c.dflt_value
|
|
24
|
+
}))
|
|
25
|
+
};
|
|
26
|
+
} catch {
|
|
27
|
+
return { name: t.name, rows: 0, columns: [] };
|
|
28
|
+
}
|
|
29
|
+
})
|
|
30
|
+
);
|
|
31
|
+
return { tables: detailedTables };
|
|
32
|
+
} catch (err) {
|
|
33
|
+
return {
|
|
34
|
+
tables: [
|
|
35
|
+
{
|
|
36
|
+
name: "_qarpeo_users",
|
|
37
|
+
rows: 3,
|
|
38
|
+
columns: [
|
|
39
|
+
{ name: "id", type: "TEXT", notNull: true, primaryKey: true },
|
|
40
|
+
{ name: "email", type: "TEXT", notNull: true, primaryKey: false },
|
|
41
|
+
{ name: "name", type: "TEXT", notNull: false, primaryKey: false },
|
|
42
|
+
{ name: "created_at", type: "INTEGER", notNull: true, primaryKey: false }
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: "_qarpeo_sessions",
|
|
47
|
+
rows: 2,
|
|
48
|
+
columns: [
|
|
49
|
+
{ name: "id", type: "TEXT", notNull: true, primaryKey: true },
|
|
50
|
+
{ name: "user_id", type: "TEXT", notNull: true, primaryKey: false },
|
|
51
|
+
{ name: "expires_at", type: "INTEGER", notNull: true, primaryKey: false }
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "_qarpeo_cms_entries",
|
|
56
|
+
rows: 5,
|
|
57
|
+
columns: [
|
|
58
|
+
{ name: "id", type: "TEXT", notNull: true, primaryKey: true },
|
|
59
|
+
{ name: "collection_id", type: "TEXT", notNull: true, primaryKey: false },
|
|
60
|
+
{ name: "slug", type: "TEXT", notNull: true, primaryKey: false },
|
|
61
|
+
{ name: "title", type: "TEXT", notNull: true, primaryKey: false },
|
|
62
|
+
{ name: "status", type: "TEXT", notNull: true, primaryKey: false },
|
|
63
|
+
{ name: "published_at", type: "INTEGER", notNull: false, primaryKey: false }
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: "_qarpeo_domains",
|
|
68
|
+
rows: 1,
|
|
69
|
+
columns: [
|
|
70
|
+
{ name: "id", type: "TEXT", notNull: true, primaryKey: true },
|
|
71
|
+
{ name: "tenant_id", type: "TEXT", notNull: true, primaryKey: false },
|
|
72
|
+
{ name: "domain", type: "TEXT", notNull: true, primaryKey: false },
|
|
73
|
+
{ name: "status", type: "TEXT", notNull: true, primaryKey: false },
|
|
74
|
+
{ name: "ssl_status", type: "TEXT", notNull: true, primaryKey: false }
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
notice: "D1 local binding preview mode"
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
});
|