qarpeo 0.1.35 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +114 -26
- package/dist/apps/cms.d.ts +4 -0
- package/dist/apps/comments.d.ts +4 -0
- package/dist/apps/payments.d.ts +4 -0
- package/dist/apps/store.d.ts +4 -0
- package/dist/chunks/auth-schema.mjs +169 -30
- package/dist/chunks/tools.mjs +1680 -0
- package/dist/cli/index.mjs +1256 -221
- package/dist/core/aliases.d.ts +5 -0
- package/dist/core/context.d.ts +10 -0
- package/dist/core/cross-drive.d.ts +2 -0
- package/dist/core/d1-migrate.d.ts +4 -0
- package/dist/core/devtools.d.ts +4 -0
- package/dist/core/nitro.d.ts +4 -0
- package/dist/core/schema.d.ts +4 -0
- package/dist/core/server-utils.d.ts +4 -0
- package/dist/core/wrangler.d.ts +4 -0
- package/dist/dev/wrangler.d.ts +1 -0
- package/dist/fate/index.d.ts +8 -8
- package/dist/features/agents.d.ts +4 -0
- package/dist/features/auth.d.ts +4 -0
- package/dist/features/bots.d.ts +4 -0
- package/dist/features/fate.d.ts +4 -0
- package/dist/features/mail.d.ts +4 -0
- package/dist/features/mcp.d.ts +4 -0
- package/dist/features/multitenant.d.ts +4 -0
- package/dist/features/notifications.d.ts +4 -0
- package/dist/features/realtime.d.ts +4 -0
- package/dist/module.d.ts +10 -2
- package/dist/module.mjs +6313 -5118
- package/dist/primitives/ai.d.ts +4 -0
- package/dist/primitives/analytics.d.ts +4 -0
- package/dist/primitives/blob.d.ts +4 -0
- package/dist/primitives/browser.d.ts +4 -0
- package/dist/primitives/cache.d.ts +4 -0
- package/dist/primitives/d1.d.ts +4 -0
- package/dist/primitives/do.d.ts +4 -0
- package/dist/primitives/email.d.ts +4 -0
- package/dist/primitives/hyperdrive.d.ts +4 -0
- package/dist/primitives/kv.d.ts +4 -0
- package/dist/primitives/queue.d.ts +4 -0
- package/dist/primitives/ratelimit.d.ts +4 -0
- package/dist/primitives/vectorize.d.ts +4 -0
- package/dist/primitives/workflows.d.ts +4 -0
- package/dist/runtime/ai.d.ts +3 -3
- package/dist/runtime/ai.mjs +8 -1
- package/dist/runtime/app/components/RealtimeCursors.vue +2 -2
- package/dist/runtime/app/composables/ai.d.ts +56 -29
- package/dist/runtime/app/composables/analytics.d.ts +26 -106
- package/dist/runtime/app/composables/api-tokens.d.ts +31 -34
- package/dist/runtime/app/composables/auth.d.ts +147 -51
- package/dist/runtime/app/composables/auth.mjs +0 -7
- package/dist/runtime/app/composables/chat.d.ts +38 -35
- package/dist/runtime/app/composables/cms-preview.d.ts +30 -25
- package/dist/runtime/app/composables/cms.d.ts +57 -282
- package/dist/runtime/app/composables/cms.mjs +0 -35
- package/dist/runtime/app/composables/comments.d.ts +32 -5
- package/dist/runtime/app/composables/comments.mjs +29 -1
- package/dist/runtime/app/composables/docs-version.d.ts +25 -28
- package/dist/runtime/app/composables/impersonation.d.ts +22 -5
- package/dist/runtime/app/composables/organization.d.ts +38 -91
- package/dist/runtime/app/composables/passkey.d.ts +22 -6
- package/dist/runtime/app/composables/passwordless.d.ts +24 -7
- package/dist/runtime/app/composables/payments.d.ts +50 -34
- package/dist/runtime/app/composables/payments.mjs +1 -0
- package/dist/runtime/app/composables/sse.d.ts +76 -0
- package/dist/runtime/app/composables/sse.mjs +152 -0
- package/dist/runtime/app/composables/storage.d.ts +53 -65
- package/dist/runtime/app/composables/storage.mjs +17 -0
- package/dist/runtime/app/composables/store.d.ts +198 -0
- package/dist/runtime/app/composables/store.mjs +414 -0
- package/dist/runtime/app/composables/tenant.d.ts +31 -72
- package/dist/runtime/app/composables/turnstile.d.ts +16 -3
- package/dist/runtime/app/composables/two-factor.d.ts +23 -6
- package/dist/runtime/app/pages/devtools/notifications.vue +30 -27
- package/dist/runtime/app/pages/devtools/realtime.vue +19 -31
- package/dist/runtime/app/pages/devtools.vue +0 -7
- package/dist/runtime/auth.d.ts +9 -9
- package/dist/runtime/blob.d.ts +10 -1
- package/dist/runtime/blob.mjs +83 -0
- package/dist/runtime/cache.d.ts +48 -0
- package/dist/runtime/cache.mjs +92 -0
- package/dist/runtime/comments.d.ts +4 -0
- package/dist/runtime/comments.mjs +2 -0
- package/dist/runtime/db.d.ts +21 -1
- package/dist/runtime/db.mjs +54 -0
- package/dist/runtime/drizzle.d.ts +4 -2
- package/dist/runtime/drizzle.mjs +68 -1
- package/dist/runtime/durable-object.d.ts +2 -0
- package/dist/runtime/durable-object.mjs +2 -0
- package/dist/runtime/email.d.ts +1 -1
- package/dist/runtime/email.mjs +1 -1
- package/dist/runtime/kv.mjs +50 -1
- package/dist/runtime/mcp.d.ts +2 -0
- package/dist/runtime/mcp.mjs +2 -0
- package/dist/runtime/queue.d.ts +12 -2
- package/dist/runtime/queue.mjs +19 -1
- package/dist/runtime/ratelimit.d.ts +1 -0
- package/dist/runtime/ratelimit.mjs +7 -0
- package/dist/runtime/schema.d.ts +313 -0
- package/dist/runtime/schema.mjs +259 -0
- package/dist/runtime/server/db/cms-schema.d.ts +1225 -171
- package/dist/runtime/server/db/cms-schema.mjs +69 -70
- package/dist/runtime/server/db/store-schema.d.ts +4344 -0
- package/dist/runtime/server/db/store-schema.mjs +266 -0
- package/dist/runtime/server/durable-objects/agent.mjs +35 -0
- package/dist/runtime/server/durable-objects/room.mjs +0 -1
- package/dist/runtime/server/middleware/ratelimit.mjs +10 -8
- package/dist/runtime/server/plugins/comments.d.ts +7 -0
- package/dist/runtime/server/plugins/comments.mjs +7 -0
- package/dist/runtime/server/plugins/email-inbound.d.ts +5 -0
- package/dist/runtime/server/plugins/email-inbound.mjs +17 -0
- package/dist/runtime/server/plugins/store.d.ts +7 -0
- package/dist/runtime/server/plugins/store.mjs +7 -0
- package/dist/runtime/server/routes/__qarpeo/db/tables.get.mjs +2 -2
- package/dist/runtime/server/routes/atom.xml.get.mjs +3 -1
- package/dist/runtime/server/routes/auth/2fa/disable.post.mjs +13 -2
- package/dist/runtime/server/routes/auth/2fa/setup.post.mjs +9 -3
- package/dist/runtime/server/routes/auth/2fa/verify.post.mjs +11 -3
- package/dist/runtime/server/routes/auth/account.delete.mjs +2 -1
- package/dist/runtime/server/routes/auth/audit-logs.get.mjs +1 -1
- package/dist/runtime/server/routes/auth/magic-link/send.post.d.ts +1 -9
- package/dist/runtime/server/routes/auth/magic-link/send.post.mjs +8 -0
- package/dist/runtime/server/routes/auth/organization/sso/[id].delete.mjs +1 -1
- package/dist/runtime/server/routes/auth/organization/sso/index.get.mjs +1 -1
- package/dist/runtime/server/routes/auth/organization/sso/index.post.mjs +1 -1
- package/dist/runtime/server/routes/auth/otp/send.post.d.ts +1 -9
- package/dist/runtime/server/routes/auth/otp/send.post.mjs +8 -0
- package/dist/runtime/server/routes/auth/sso/login.get.mjs +3 -3
- package/dist/runtime/server/routes/auth/sso/oidc/callback.get.mjs +1 -1
- package/dist/runtime/server/routes/auth/sso/saml/acs.post.mjs +2 -2
- package/dist/runtime/server/routes/auth/webauthn/login/options.post.mjs +1 -1
- package/dist/runtime/server/routes/auth/webauthn/login/verify.post.mjs +1 -1
- package/dist/runtime/server/routes/auth/webauthn/register/options.post.mjs +2 -2
- package/dist/runtime/server/routes/auth/webauthn/register/verify.post.mjs +1 -1
- package/dist/runtime/server/routes/cms/[collection]/[id]/preview-token.post.mjs +1 -1
- package/dist/runtime/server/routes/cms/[collection]/atom.xml.get.mjs +3 -1
- package/dist/runtime/server/routes/cms/[collection]/feed.xml.get.mjs +3 -1
- package/dist/runtime/server/routes/cms/bookmarks/[id].delete.mjs +1 -1
- package/dist/runtime/server/routes/cms/bookmarks/check.post.mjs +1 -1
- package/dist/runtime/server/routes/cms/bookmarks/index.get.mjs +1 -1
- package/dist/runtime/server/routes/cms/bookmarks/index.post.mjs +1 -1
- package/dist/runtime/server/routes/cms/deploy.post.mjs +1 -1
- package/dist/runtime/server/routes/cms/export.post.mjs +4 -3
- package/dist/runtime/server/routes/cms/search.get.mjs +7 -5
- package/dist/runtime/server/routes/cms/sync.post.mjs +2 -1
- package/dist/runtime/server/routes/comments/[id]/react.post.mjs +1 -2
- package/dist/runtime/server/routes/comments/[id]/report.post.d.ts +1 -1
- package/dist/runtime/server/routes/comments/[id]/report.post.mjs +0 -2
- package/dist/runtime/server/routes/comments/[id].delete.mjs +8 -4
- package/dist/runtime/server/routes/comments/[id].get.d.ts +1 -1
- package/dist/runtime/server/routes/comments/[id].get.mjs +1 -2
- package/dist/runtime/server/routes/comments/[id].patch.d.ts +1 -1
- package/dist/runtime/server/routes/comments/[id].patch.mjs +6 -3
- package/dist/runtime/server/routes/comments/batch.post.d.ts +2 -0
- package/dist/runtime/server/routes/comments/batch.post.mjs +33 -0
- package/dist/runtime/server/routes/comments/index.get.d.ts +1 -1
- package/dist/runtime/server/routes/comments/index.get.mjs +6 -4
- package/dist/runtime/server/routes/comments/index.post.d.ts +1 -1
- package/dist/runtime/server/routes/comments/index.post.mjs +6 -2
- package/dist/runtime/server/routes/feed.xml.get.mjs +3 -1
- package/dist/runtime/server/routes/sitemap.xml.get.mjs +3 -1
- package/dist/runtime/server/routes/storage/presigned-r2.post.d.ts +17 -0
- package/dist/runtime/server/routes/storage/presigned-r2.post.mjs +29 -0
- package/dist/runtime/server/routes/store/cart/index.delete.d.ts +6 -0
- package/dist/runtime/server/routes/store/cart/index.delete.mjs +11 -0
- package/dist/runtime/server/routes/store/cart/index.get.d.ts +5 -0
- package/dist/runtime/server/routes/store/cart/index.get.mjs +14 -0
- package/dist/runtime/server/routes/store/cart/items/[id].delete.d.ts +6 -0
- package/dist/runtime/server/routes/store/cart/items/[id].delete.mjs +25 -0
- package/dist/runtime/server/routes/store/cart/items/[id].patch.d.ts +6 -0
- package/dist/runtime/server/routes/store/cart/items/[id].patch.mjs +29 -0
- package/dist/runtime/server/routes/store/cart/items.post.d.ts +6 -0
- package/dist/runtime/server/routes/store/cart/items.post.mjs +36 -0
- package/dist/runtime/server/routes/store/categories/index.get.d.ts +2 -0
- package/dist/runtime/server/routes/store/categories/index.get.mjs +8 -0
- package/dist/runtime/server/routes/store/checkout.post.d.ts +6 -0
- package/dist/runtime/server/routes/store/checkout.post.mjs +21 -0
- package/dist/runtime/server/routes/store/coupons/apply.post.d.ts +7 -0
- package/dist/runtime/server/routes/store/coupons/apply.post.mjs +18 -0
- package/dist/runtime/server/routes/store/currencies.get.d.ts +15 -0
- package/dist/runtime/server/routes/store/currencies.get.mjs +13 -0
- package/dist/runtime/server/routes/store/orders/[id].get.d.ts +2 -0
- package/dist/runtime/server/routes/store/orders/[id].get.mjs +26 -0
- package/dist/runtime/server/routes/store/orders/download/[token].get.d.ts +7 -0
- package/dist/runtime/server/routes/store/orders/download/[token].get.mjs +57 -0
- package/dist/runtime/server/routes/store/orders/index.get.d.ts +5 -0
- package/dist/runtime/server/routes/store/orders/index.get.mjs +30 -0
- package/dist/runtime/server/routes/store/products/[slug].get.d.ts +2 -0
- package/dist/runtime/server/routes/store/products/[slug].get.mjs +18 -0
- package/dist/runtime/server/routes/store/products/index.get.d.ts +5 -0
- package/dist/runtime/server/routes/store/products/index.get.mjs +33 -0
- package/dist/runtime/server/routes/store/tax/calculate.post.d.ts +9 -0
- package/dist/runtime/server/routes/store/tax/calculate.post.mjs +18 -0
- package/dist/runtime/server/routes/tenants/[tenant]/domains/[domain]/index.delete.mjs +14 -1
- package/dist/runtime/server/routes/tenants/[tenant]/domains/[domain]/verify.post.mjs +14 -1
- package/dist/runtime/server/routes/tenants/[tenant]/domains/index.get.mjs +24 -1
- package/dist/runtime/server/routes/tenants/[tenant]/domains/index.post.mjs +6 -0
- package/dist/runtime/server/utils/ai.d.ts +146 -21
- package/dist/runtime/server/utils/ai.mjs +406 -11
- package/dist/runtime/server/utils/analytics-query.d.ts +13 -58
- package/dist/runtime/server/utils/audit.d.ts +5 -4
- package/dist/runtime/server/utils/audit.mjs +25 -14
- package/dist/runtime/server/utils/auth.d.ts +29 -12
- package/dist/runtime/server/utils/auth.mjs +88 -70
- package/dist/runtime/server/utils/bots.d.ts +20 -4
- package/dist/runtime/server/utils/bots.mjs +7 -3
- package/dist/runtime/server/utils/browser-utils.d.ts +23 -23
- package/dist/runtime/server/utils/cache.d.ts +3 -3
- package/dist/runtime/server/utils/cms/collections.d.ts +23 -0
- package/dist/runtime/server/utils/cms/collections.mjs +143 -0
- package/dist/runtime/server/utils/cms/common.d.ts +9 -0
- package/dist/runtime/server/utils/cms/common.mjs +28 -0
- package/dist/runtime/server/utils/cms/git.mjs +2 -2
- package/dist/runtime/server/utils/cms/navigation.d.ts +46 -0
- package/dist/runtime/server/utils/cms/navigation.mjs +683 -0
- package/dist/runtime/server/utils/cms/preview.d.ts +11 -0
- package/dist/runtime/server/utils/cms/preview.mjs +50 -0
- package/dist/runtime/server/utils/cms/search.d.ts +1 -1
- package/dist/runtime/server/utils/cms/search.mjs +11 -7
- package/dist/runtime/server/utils/cms/sync.d.ts +34 -0
- package/dist/runtime/server/utils/cms/sync.mjs +1082 -0
- package/dist/runtime/server/utils/cms/taxonomy.d.ts +103 -0
- package/dist/runtime/server/utils/cms/taxonomy.mjs +348 -0
- package/dist/runtime/server/utils/cms.d.ts +13 -249
- package/dist/runtime/server/utils/cms.mjs +108 -2350
- package/dist/runtime/server/utils/comments-filter.d.ts +45 -0
- package/dist/runtime/server/utils/comments-filter.mjs +541 -0
- package/dist/runtime/server/utils/comments.d.ts +71 -0
- package/dist/runtime/server/utils/comments.mjs +137 -61
- package/dist/runtime/server/utils/config.d.ts +4 -3
- package/dist/runtime/server/utils/config.mjs +7 -6
- package/dist/runtime/server/utils/context.d.ts +14 -0
- package/dist/runtime/server/utils/context.mjs +2 -2
- package/dist/runtime/server/utils/crypto.d.ts +44 -5
- package/dist/runtime/server/utils/crypto.mjs +18 -0
- package/dist/runtime/server/utils/domains.mjs +9 -5
- package/dist/runtime/server/utils/drizzle.d.ts +35 -3
- package/dist/runtime/server/utils/drizzle.mjs +115 -6
- package/dist/runtime/server/utils/durable-object.d.ts +106 -0
- package/dist/runtime/server/utils/durable-object.mjs +628 -0
- package/dist/runtime/server/utils/email-inbound.d.ts +29 -0
- package/dist/runtime/server/utils/email-inbound.mjs +76 -0
- package/dist/runtime/server/utils/impersonation.d.ts +32 -2
- package/dist/runtime/server/utils/impersonation.mjs +16 -13
- package/dist/runtime/server/utils/lock.d.ts +71 -0
- package/dist/runtime/server/utils/lock.mjs +139 -0
- package/dist/runtime/server/utils/mail-suppression.mjs +7 -7
- package/dist/runtime/server/utils/mail.d.ts +30 -19
- package/dist/runtime/server/utils/mcp.d.ts +44 -0
- package/dist/runtime/server/utils/mcp.mjs +308 -0
- package/dist/runtime/server/utils/notifications.d.ts +72 -7
- package/dist/runtime/server/utils/notifications.mjs +67 -55
- package/dist/runtime/server/utils/oauth.d.ts +27 -4
- package/dist/runtime/server/utils/organization.d.ts +63 -7
- package/dist/runtime/server/utils/organization.mjs +26 -21
- package/dist/runtime/server/utils/passwordless.d.ts +62 -33
- package/dist/runtime/server/utils/payments.d.ts +51 -12
- package/dist/runtime/server/utils/payments.mjs +472 -282
- package/dist/runtime/server/utils/queue.d.ts +106 -13
- package/dist/runtime/server/utils/queue.mjs +313 -28
- package/dist/runtime/server/utils/rag.d.ts +42 -14
- package/dist/runtime/server/utils/rag.mjs +169 -4
- package/dist/runtime/server/utils/ratelimit.d.ts +34 -5
- package/dist/runtime/server/utils/ratelimit.mjs +95 -14
- package/dist/runtime/server/utils/realtime.d.ts +68 -52
- package/dist/runtime/server/utils/scheduled-task.d.ts +42 -1
- package/dist/runtime/server/utils/scheduled-task.mjs +29 -0
- package/dist/runtime/server/utils/schema-fallback.d.ts +1 -1
- package/dist/runtime/server/utils/schema-fallback.mjs +1 -1
- package/dist/runtime/server/utils/session.d.ts +84 -10
- package/dist/runtime/server/utils/session.mjs +12 -10
- package/dist/runtime/server/utils/sse.d.ts +75 -0
- package/dist/runtime/server/utils/sse.mjs +147 -0
- package/dist/runtime/server/utils/sso.d.ts +1 -1
- package/dist/runtime/server/utils/storage.d.ts +53 -4
- package/dist/runtime/server/utils/storage.mjs +15 -11
- package/dist/runtime/server/utils/store-localization.d.ts +51 -0
- package/dist/runtime/server/utils/store-localization.mjs +417 -0
- package/dist/runtime/server/utils/store.d.ts +207 -0
- package/dist/runtime/server/utils/store.mjs +2227 -0
- package/dist/runtime/server/utils/table-names.d.ts +51 -0
- package/dist/runtime/server/utils/table-names.mjs +69 -0
- package/dist/runtime/server/utils/tenant.d.ts +26 -2
- package/dist/runtime/server/utils/tenant.mjs +16 -12
- package/dist/runtime/server/utils/tools-registry-fallback.d.ts +1 -0
- package/dist/runtime/server/utils/tools-registry-fallback.mjs +1 -0
- package/dist/runtime/server/utils/totp.d.ts +45 -2
- package/dist/runtime/server/utils/tracker.d.ts +10 -11
- package/dist/runtime/server/utils/turnstile.d.ts +16 -1
- package/dist/runtime/server/utils/workflows.d.ts +92 -0
- package/dist/runtime/server/utils/workflows.mjs +299 -0
- package/dist/runtime/server.d.ts +8 -1
- package/dist/runtime/server.mjs +8 -5
- package/dist/runtime/service.d.ts +10 -10
- package/dist/runtime/storage.d.ts +1 -0
- package/dist/runtime/storage.mjs +1 -0
- package/dist/runtime/store.d.ts +4 -0
- package/dist/runtime/store.mjs +2 -0
- package/dist/runtime/test-utils.d.ts +11 -10
- package/dist/runtime/test-utils.mjs +64 -4
- package/dist/runtime/types/ai.d.ts +21 -2
- package/dist/runtime/types/d1.d.ts +17 -0
- package/dist/runtime/types/drizzle.d.ts +2 -2
- package/dist/runtime/types/durable-object.d.ts +62 -2
- package/dist/runtime/types/email.d.ts +46 -0
- package/dist/runtime/types/imports.d.ts +6 -1
- package/dist/runtime/types/index.d.ts +58 -0
- package/dist/runtime/types/index.mjs +3 -0
- package/dist/runtime/types/mcp.d.ts +83 -0
- package/dist/runtime/types/mcp.mjs +0 -0
- package/dist/runtime/types/queue.d.ts +36 -0
- package/dist/runtime/types/r2.d.ts +41 -0
- package/dist/runtime/types/store.d.ts +313 -0
- package/dist/runtime/types/store.mjs +0 -0
- package/dist/runtime/types/workflows.d.ts +98 -0
- package/dist/runtime/types/workflows.mjs +0 -0
- package/dist/runtime/workflows.d.ts +5 -0
- package/dist/runtime/workflows.mjs +2 -0
- package/dist/types/ai.d.ts +721 -0
- package/dist/types/cms.d.ts +710 -0
- package/dist/types.d.ts +406 -1288
- package/dist/utils/auth-schema.d.ts +3 -2
- package/dist/utils/bots.d.ts +20 -0
- package/dist/utils/comments-schema.d.ts +5 -4
- package/dist/utils/drizzle.d.ts +83 -3
- package/dist/utils/durable-objects.d.ts +10 -0
- package/dist/utils/email-inbound.d.ts +10 -0
- package/dist/utils/local-db.d.ts +1 -3
- package/dist/utils/mcp.d.ts +24 -0
- package/dist/utils/notifications-schema.d.ts +5 -4
- package/dist/utils/payments-schema.d.ts +4 -3
- package/dist/utils/store-schema.d.ts +14 -0
- package/dist/utils/table-names.d.ts +1 -0
- package/dist/utils/tenants-schema.d.ts +4 -3
- package/dist/utils/tools.d.ts +20 -0
- package/dist/utils/workflows.d.ts +8 -0
- package/package.json +34 -4
- package/dist/chunks/wrangler.mjs +0 -897
- package/dist/runtime/app/components/AuthRegister.vue +0 -306
- package/dist/runtime/app/components/AuthSessionsList.vue +0 -137
- package/dist/runtime/app/components/AuthSignIn.vue +0 -298
- package/dist/runtime/app/components/CMSBookmarkButton.vue +0 -59
- package/dist/runtime/app/components/CMSImage.vue +0 -47
- package/dist/runtime/app/components/CMSLocaleSwitcher.vue +0 -110
- package/dist/runtime/app/components/CMSNewsletter.vue +0 -81
- package/dist/runtime/app/components/CMSPreviewBanner.vue +0 -83
- package/dist/runtime/app/components/CMSTableOfContents.vue +0 -84
- package/dist/runtime/app/components/CMSVersionBanner.vue +0 -53
- package/dist/runtime/app/components/CMSVersionSwitcher.vue +0 -140
- package/dist/runtime/app/components/Comments.vue +0 -411
- package/dist/runtime/app/components/FileUpload.vue +0 -200
- package/dist/runtime/app/components/ImpersonationBanner.vue +0 -61
- package/dist/runtime/app/components/NotificationBell.vue +0 -263
- package/dist/runtime/app/components/NotificationList.vue +0 -205
- package/dist/runtime/app/components/NotificationPrompt.vue +0 -133
- package/dist/runtime/app/components/PricingGated.vue +0 -81
- package/dist/runtime/app/components/PricingTable.vue +0 -274
- package/dist/runtime/app/components/RealtimeChat.vue +0 -164
- package/dist/runtime/app/components/RealtimePresence.vue +0 -129
- package/dist/runtime/app/components/RealtimeStatus.vue +0 -79
- package/dist/runtime/app/components/SubscriptionCard.vue +0 -207
- package/dist/runtime/app/components/UserProfile.vue +0 -558
|
@@ -64,3 +64,49 @@ export interface QarpeoEmail {
|
|
|
64
64
|
/** Access the raw underlying Cloudflare `send_email` binding. */
|
|
65
65
|
raw(bindingName?: string): SendEmailBinding;
|
|
66
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* Inbound email message received by Cloudflare Email Workers.
|
|
69
|
+
*/
|
|
70
|
+
export interface InboundEmailMessage {
|
|
71
|
+
/** The envelope sender address. */
|
|
72
|
+
from: string;
|
|
73
|
+
/** The envelope recipient address. */
|
|
74
|
+
to: string;
|
|
75
|
+
/** Email RFC 2822 headers. */
|
|
76
|
+
headers: Headers;
|
|
77
|
+
/** Raw email body as a readable stream of bytes. */
|
|
78
|
+
raw: ReadableStream<Uint8Array>;
|
|
79
|
+
/** Size of the raw email message in bytes. */
|
|
80
|
+
rawSize: number;
|
|
81
|
+
/** Rejects the email message with a specified reason. */
|
|
82
|
+
setReject(reason: string): void;
|
|
83
|
+
/** Forwards the email message to another recipient. */
|
|
84
|
+
forward(rcptTo: string, headers?: Headers): Promise<void>;
|
|
85
|
+
/** Replies to the sender with a transactional email. */
|
|
86
|
+
reply(options: SendEmailOptions): Promise<SendEmailResult>;
|
|
87
|
+
/** Reads the raw stream and returns the message body as a UTF-8 text string. */
|
|
88
|
+
text(): Promise<string>;
|
|
89
|
+
/** Helper to parse a JSON body if the incoming email contains structured JSON. */
|
|
90
|
+
json<T = any>(): Promise<T>;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Context object passed to defineEmailHandler.
|
|
94
|
+
*/
|
|
95
|
+
export interface InboundEmailContext {
|
|
96
|
+
/** The inbound email message. */
|
|
97
|
+
message: InboundEmailMessage;
|
|
98
|
+
/** Forward the email message to another destination. */
|
|
99
|
+
forward(rcptTo: string, headers?: Headers): Promise<void>;
|
|
100
|
+
/** Reply directly to the sender. */
|
|
101
|
+
reply(options: SendEmailOptions): Promise<SendEmailResult>;
|
|
102
|
+
/** Reject the email with an error response to the sender's MTA. */
|
|
103
|
+
reject(reason: string): void;
|
|
104
|
+
/** Cloudflare worker environment bindings. */
|
|
105
|
+
env?: any;
|
|
106
|
+
/** Cloudflare worker execution context (e.g. waitUntil). */
|
|
107
|
+
context?: any;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Handler function for incoming Cloudflare emails.
|
|
111
|
+
*/
|
|
112
|
+
export type InboundEmailHandler = (event: InboundEmailContext) => Promise<void> | void;
|
|
@@ -35,9 +35,9 @@ declare module "#qarpeo/auth/schema" {
|
|
|
35
35
|
export const members: any
|
|
36
36
|
export const invitation: any
|
|
37
37
|
export const invitations: any
|
|
38
|
+
export const auditLog: any
|
|
38
39
|
export const auditLogs: any
|
|
39
40
|
export const audit_logs: any
|
|
40
|
-
export const _qarpeo_audit_logs: any
|
|
41
41
|
export type AuditLog = any
|
|
42
42
|
export type NewAuditLog = any
|
|
43
43
|
}
|
|
@@ -56,6 +56,11 @@ declare module "#qarpeo/queue-consumer" {
|
|
|
56
56
|
export default handler
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
declare module "#qarpeo/email-inbound-handler" {
|
|
60
|
+
const handler: any
|
|
61
|
+
export default handler
|
|
62
|
+
}
|
|
63
|
+
|
|
59
64
|
declare module "#app" {
|
|
60
65
|
export const useRuntimeConfig: any
|
|
61
66
|
export const useAsyncData: any
|
|
@@ -13,6 +13,9 @@ export * from "./browser";
|
|
|
13
13
|
export * from "./auth";
|
|
14
14
|
export * from "./durable-object";
|
|
15
15
|
export * from "./service";
|
|
16
|
+
export * from "./store";
|
|
17
|
+
export * from "./workflows";
|
|
18
|
+
export * from "./mcp";
|
|
16
19
|
/** Cloudflare Execution Context for waitUntil and passThroughOnException. */
|
|
17
20
|
export interface CFExecutionContext {
|
|
18
21
|
waitUntil(promise: Promise<any>): void;
|
|
@@ -120,6 +123,8 @@ export interface QarpeoKV {
|
|
|
120
123
|
get<T = unknown>(key: string, options?: KVGetOptions): Promise<T | null>;
|
|
121
124
|
/** Store a value in KV. Objects and arrays are auto-serialized to JSON. Strings are stored as-is. */
|
|
122
125
|
set(key: string, value: unknown, options?: KVSetOptions): Promise<void>;
|
|
126
|
+
/** Alias for set (Cloudflare / Void parity) */
|
|
127
|
+
put(key: string, value: unknown, options?: KVSetOptions): Promise<void>;
|
|
123
128
|
/** Check if a key exists in KV */
|
|
124
129
|
has(key: string): Promise<boolean>;
|
|
125
130
|
/** Delete a key from KV */
|
|
@@ -141,6 +146,19 @@ export interface QarpeoKV {
|
|
|
141
146
|
* concurrently.
|
|
142
147
|
*/
|
|
143
148
|
clear(prefix?: string): Promise<void>;
|
|
149
|
+
/**
|
|
150
|
+
* Create a scoped, typed KV map for managing collections sharing a common prefix (Void `kv.map` compatibility).
|
|
151
|
+
* Automatically prefixes keys on write/read and strips prefixes on listing.
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* ```ts
|
|
155
|
+
* const sessions = kv.map<Session>('sessions')
|
|
156
|
+
* await sessions.put('abc', { userId: 1 }, { ttl: 3600 })
|
|
157
|
+
* const session = await sessions.get('abc')
|
|
158
|
+
* await sessions.delete('abc')
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
161
|
+
map<T = unknown>(prefix: string): QarpeoKVMap<T>;
|
|
144
162
|
/** Alias for get (Unstorage / NuxtHub compatibility) */
|
|
145
163
|
getItem<T = unknown>(key: string, options?: KVGetOptions): Promise<T | null>;
|
|
146
164
|
/** Alias for set (Unstorage / NuxtHub compatibility) */
|
|
@@ -165,3 +183,43 @@ export interface QarpeoKV {
|
|
|
165
183
|
/** Access the raw underlying Cloudflare KVNamespace binding */
|
|
166
184
|
raw(bindingName?: string): KVNamespace;
|
|
167
185
|
}
|
|
186
|
+
/**
|
|
187
|
+
* Scoped, typed KV map for managing prefixed collections (Void `kv.map` compatibility).
|
|
188
|
+
* Keys are automatically prefixed upon write/read and stripped upon listing.
|
|
189
|
+
*/
|
|
190
|
+
export interface QarpeoKVMap<T = unknown> {
|
|
191
|
+
/** The normalized namespace prefix for this map */
|
|
192
|
+
readonly prefix: string;
|
|
193
|
+
/** Get a value from this map. Returns typed `T | null`. */
|
|
194
|
+
get(key: string, options?: KVGetOptions): Promise<T | null>;
|
|
195
|
+
/** Store a value in this map. Accepts `{ ttl, expiration, metadata }`. */
|
|
196
|
+
set(key: string, value: T, options?: KVSetOptions): Promise<void>;
|
|
197
|
+
/** Alias for `set` (Cloudflare / Void parity) */
|
|
198
|
+
put(key: string, value: T, options?: KVSetOptions): Promise<void>;
|
|
199
|
+
/** Check if a key exists in this map */
|
|
200
|
+
has(key: string): Promise<boolean>;
|
|
201
|
+
/** Delete a key from this map */
|
|
202
|
+
delete(key: string): Promise<boolean>;
|
|
203
|
+
/** Alias for `delete` */
|
|
204
|
+
del(key: string): Promise<boolean>;
|
|
205
|
+
/**
|
|
206
|
+
* List all keys within this map. Prefix is automatically stripped from returned keys.
|
|
207
|
+
* Pass `subPrefix` to filter further within this namespace.
|
|
208
|
+
*/
|
|
209
|
+
keys(subPrefix?: string): Promise<string[]>;
|
|
210
|
+
/**
|
|
211
|
+
* Paginated list within this map. Returned key names have the map prefix stripped.
|
|
212
|
+
*/
|
|
213
|
+
list(options?: KVListOptions): Promise<KVNamespaceListResult<unknown>>;
|
|
214
|
+
/**
|
|
215
|
+
* Clear all keys in this map namespace (or all keys matching an optional subPrefix).
|
|
216
|
+
*/
|
|
217
|
+
clear(subPrefix?: string): Promise<void>;
|
|
218
|
+
/**
|
|
219
|
+
* Get a value together with its metadata in a single round-trip.
|
|
220
|
+
*/
|
|
221
|
+
getWithMetadata<M = unknown>(key: string, options?: KVGetOptions): Promise<{
|
|
222
|
+
value: T | null;
|
|
223
|
+
metadata: M | null;
|
|
224
|
+
}>;
|
|
225
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { AgentTool } from "../../types";
|
|
2
|
+
export interface McpJsonRpcRequest {
|
|
3
|
+
jsonrpc: "2.0";
|
|
4
|
+
id?: string | number | null;
|
|
5
|
+
method: string;
|
|
6
|
+
params?: any;
|
|
7
|
+
}
|
|
8
|
+
export interface McpJsonRpcResponse {
|
|
9
|
+
jsonrpc: "2.0";
|
|
10
|
+
id?: string | number | null;
|
|
11
|
+
result?: any;
|
|
12
|
+
error?: McpJsonRpcError;
|
|
13
|
+
}
|
|
14
|
+
export interface McpJsonRpcError {
|
|
15
|
+
code: number;
|
|
16
|
+
message: string;
|
|
17
|
+
data?: any;
|
|
18
|
+
}
|
|
19
|
+
export interface McpTool {
|
|
20
|
+
name: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
inputSchema: Record<string, any>;
|
|
23
|
+
}
|
|
24
|
+
export interface McpResource {
|
|
25
|
+
uri: string;
|
|
26
|
+
name: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
mimeType?: string;
|
|
29
|
+
read?: (uri: string, context?: any) => Promise<string | Record<string, any>> | string | Record<string, any>;
|
|
30
|
+
}
|
|
31
|
+
export interface McpPromptArgument {
|
|
32
|
+
name: string;
|
|
33
|
+
description?: string;
|
|
34
|
+
required?: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface McpPrompt {
|
|
37
|
+
name: string;
|
|
38
|
+
description?: string;
|
|
39
|
+
arguments?: McpPromptArgument[];
|
|
40
|
+
get?: (args: Record<string, string>, context?: any) => Promise<{
|
|
41
|
+
role: string;
|
|
42
|
+
content: string;
|
|
43
|
+
}[]> | {
|
|
44
|
+
role: string;
|
|
45
|
+
content: string;
|
|
46
|
+
}[] | string;
|
|
47
|
+
}
|
|
48
|
+
export interface McpServerDefinition {
|
|
49
|
+
/** Name of the MCP server. */
|
|
50
|
+
name: string;
|
|
51
|
+
/** Version string, e.g. "1.0.0". */
|
|
52
|
+
version?: string;
|
|
53
|
+
/** Instructions or system prompt explaining what this MCP server provides. */
|
|
54
|
+
instructions?: string;
|
|
55
|
+
/** Available tools provided by this MCP server. */
|
|
56
|
+
tools?: Record<string, AgentTool> | AgentTool[];
|
|
57
|
+
/** Read-only contextual resources exposed by this MCP server (e.g. database schemas, docs). */
|
|
58
|
+
resources?: McpResource[];
|
|
59
|
+
/** Prompt templates exposed by this MCP server. */
|
|
60
|
+
prompts?: McpPrompt[];
|
|
61
|
+
/** Optional authorization hook to validate client requests. */
|
|
62
|
+
authorize?: (event: any) => Promise<boolean> | boolean;
|
|
63
|
+
}
|
|
64
|
+
export interface McpClientOptions {
|
|
65
|
+
/** Custom headers sent with MCP requests (e.g. Authorization token). */
|
|
66
|
+
headers?: Record<string, string>;
|
|
67
|
+
/** Timeout in milliseconds. */
|
|
68
|
+
timeoutMs?: number;
|
|
69
|
+
}
|
|
70
|
+
export interface McpClient {
|
|
71
|
+
/** Fetch all available tools from the remote MCP server as Qarpeo AgentTool objects. */
|
|
72
|
+
getTools(): Promise<Record<string, AgentTool>>;
|
|
73
|
+
/** List raw tool descriptors from the remote MCP server. */
|
|
74
|
+
listTools(): Promise<McpTool[]>;
|
|
75
|
+
/** Call a remote tool by name. */
|
|
76
|
+
callTool(name: string, args?: Record<string, any>): Promise<any>;
|
|
77
|
+
/** List resources from remote MCP server. */
|
|
78
|
+
listResources(): Promise<McpResource[]>;
|
|
79
|
+
/** Read a resource by URI from remote MCP server. */
|
|
80
|
+
readResource(uri: string): Promise<string>;
|
|
81
|
+
/** Ping the remote MCP server to check connectivity. */
|
|
82
|
+
ping(): Promise<boolean>;
|
|
83
|
+
}
|
|
File without changes
|
|
@@ -65,3 +65,39 @@ export interface QarpeoQueue<T = any> extends Queue<T> {
|
|
|
65
65
|
/** Access the raw underlying Cloudflare Queue binding */
|
|
66
66
|
raw(bindingName?: string): Queue<T>;
|
|
67
67
|
}
|
|
68
|
+
/** Standard dead-letter queue payload metadata. */
|
|
69
|
+
export interface DeadLetterPayload<T = any> {
|
|
70
|
+
originalId: string;
|
|
71
|
+
queue: string;
|
|
72
|
+
body: T;
|
|
73
|
+
attempts: number;
|
|
74
|
+
reason: string;
|
|
75
|
+
errorName?: string;
|
|
76
|
+
stack?: string;
|
|
77
|
+
failedAt: number;
|
|
78
|
+
metadata?: Record<string, any>;
|
|
79
|
+
}
|
|
80
|
+
export type QueueRetryBackoffStrategy = "fixed" | "linear" | "exponential" | ((attempt: number, error?: Error) => number);
|
|
81
|
+
export interface QueueRetryBackoffConfig {
|
|
82
|
+
strategy?: "fixed" | "linear" | "exponential";
|
|
83
|
+
initialDelay?: number;
|
|
84
|
+
maxDelay?: number;
|
|
85
|
+
factor?: number;
|
|
86
|
+
jitter?: boolean;
|
|
87
|
+
}
|
|
88
|
+
export interface QueueRoutingRule<T = any> {
|
|
89
|
+
/** Condition to match against message body or metadata */
|
|
90
|
+
match: ((message: QueueMessage<T>) => boolean) | Record<string, any>;
|
|
91
|
+
/** Destination queue handler or consumer */
|
|
92
|
+
handler: (message: QueueMessage<T>, context: any) => Promise<void> | void;
|
|
93
|
+
}
|
|
94
|
+
export interface QueueRouterOptions<T = any> {
|
|
95
|
+
/** Content-based or predicate routing rules */
|
|
96
|
+
routes?: QueueRoutingRule<T>[];
|
|
97
|
+
/** Default fallback consumer when no route matches */
|
|
98
|
+
default?: (batch: QueueMessageBatch<T>, env?: any, ctx?: any) => Promise<void> | void;
|
|
99
|
+
/** Global Dead Letter Queue for unrouted or fatal messages */
|
|
100
|
+
deadLetterQueue?: string;
|
|
101
|
+
/** Named queue pattern mapping (e.g. `{ "orders": ordersConsumer, "audit-*": auditConsumer }`) */
|
|
102
|
+
[queuePattern: string]: any;
|
|
103
|
+
}
|
|
@@ -71,6 +71,11 @@ export interface BlobPutOptions {
|
|
|
71
71
|
addRandomSuffix?: boolean;
|
|
72
72
|
prefix?: string;
|
|
73
73
|
}
|
|
74
|
+
export interface BlobCopyOptions {
|
|
75
|
+
contentType?: string;
|
|
76
|
+
customMetadata?: Record<string, string>;
|
|
77
|
+
httpMetadata?: R2HttpMetadata;
|
|
78
|
+
}
|
|
74
79
|
export interface BlobServeOptions {
|
|
75
80
|
cacheControl?: string;
|
|
76
81
|
contentDisposition?: string;
|
|
@@ -117,6 +122,18 @@ export interface QarpeoBlob {
|
|
|
117
122
|
head(pathname: string): Promise<R2Object | null>;
|
|
118
123
|
delete(pathname: string | string[]): Promise<void>;
|
|
119
124
|
list(options?: R2ListOptions): Promise<BlobListResult>;
|
|
125
|
+
/**
|
|
126
|
+
* Duplicates an object in R2 without downloading and re-uploading through the client.
|
|
127
|
+
* Preserves existing metadata unless overridden.
|
|
128
|
+
*/
|
|
129
|
+
copy(sourceKey: string, destinationKey: string, options?: BlobCopyOptions): Promise<R2Object & {
|
|
130
|
+
pathname: string;
|
|
131
|
+
contentType?: string;
|
|
132
|
+
}>;
|
|
133
|
+
/** Returns the public or API URL for accessing this blob item. */
|
|
134
|
+
url(pathname: string): string;
|
|
135
|
+
/** Switches to a different R2 bucket binding. */
|
|
136
|
+
bucket(bindingName: string): QarpeoBlob;
|
|
120
137
|
serve(event: CFEvent, pathname: string, options?: BlobServeOptions): Promise<Response>;
|
|
121
138
|
handleUpload(event: CFEvent, options?: BlobHandleUploadOptions): Promise<(R2Object & {
|
|
122
139
|
pathname: string;
|
|
@@ -127,5 +144,29 @@ export interface QarpeoBlob {
|
|
|
127
144
|
}>>;
|
|
128
145
|
createMultipartUpload(pathname: string, options?: R2PutOptions): Promise<R2MultipartUpload>;
|
|
129
146
|
resumeMultipartUpload(pathname: string, uploadId: string): R2MultipartUpload;
|
|
147
|
+
/**
|
|
148
|
+
* Generates a true R2 presigned URL for direct client-to-R2 uploads.
|
|
149
|
+
* The client PUTs directly to R2's CDN endpoint — no data passes through the Worker.
|
|
150
|
+
* Supports files up to 5 TB (vs the Worker 100 MB proxy limit).
|
|
151
|
+
*
|
|
152
|
+
* @param pathname Object key / path in R2
|
|
153
|
+
* @param options.expiresIn Duration string ("15 minutes", "1h") or seconds (default: 900)
|
|
154
|
+
* @param options.contentType MIME type to enforce on the presigned PUT
|
|
155
|
+
*/
|
|
156
|
+
createUploadUrl(pathname: string, options?: {
|
|
157
|
+
expiresIn?: string | number;
|
|
158
|
+
contentType?: string;
|
|
159
|
+
}): Promise<{
|
|
160
|
+
url: string;
|
|
161
|
+
key: string;
|
|
162
|
+
expiresAt: number;
|
|
163
|
+
}>;
|
|
130
164
|
raw(bindingName?: string): R2Bucket;
|
|
131
165
|
}
|
|
166
|
+
/** Alias type for QarpeoBlob matching Void Cloud (`void/storage`) nomenclature. */
|
|
167
|
+
export type QarpeoStorage = QarpeoBlob;
|
|
168
|
+
export type StorageObject = BlobObject;
|
|
169
|
+
export type StorageListResult = BlobListResult;
|
|
170
|
+
export type StoragePutOptions = BlobPutOptions;
|
|
171
|
+
export type StorageCopyOptions = BlobCopyOptions;
|
|
172
|
+
export type StorageServeOptions = BlobServeOptions;
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Qarpeo Store App — Core Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* Edge-native e-commerce types for Cloudflare D1, R2, and Nitro routes.
|
|
5
|
+
*/
|
|
6
|
+
export type StoreProductStatus = "draft" | "active" | "archived";
|
|
7
|
+
export type StoreProductType = "physical" | "digital";
|
|
8
|
+
export type StoreOrderStatus = "pending" | "paid" | "processing" | "shipped" | "delivered" | "cancelled" | "refunded";
|
|
9
|
+
export type StoreDiscountType = "percentage" | "fixed_amount" | "free_shipping";
|
|
10
|
+
export type StoreAddressType = "shipping" | "billing";
|
|
11
|
+
export interface StoreProduct {
|
|
12
|
+
id: string;
|
|
13
|
+
tenantId?: string | null;
|
|
14
|
+
vendorId?: string | null;
|
|
15
|
+
slug: string;
|
|
16
|
+
title: string;
|
|
17
|
+
description?: string | null;
|
|
18
|
+
status: StoreProductStatus;
|
|
19
|
+
type: StoreProductType;
|
|
20
|
+
/** Base price in smallest currency unit (e.g. 1999 for $19.99) */
|
|
21
|
+
basePrice: number;
|
|
22
|
+
currency: string;
|
|
23
|
+
categoryId?: string | null;
|
|
24
|
+
images: string[];
|
|
25
|
+
metadata: Record<string, any>;
|
|
26
|
+
createdAt: number;
|
|
27
|
+
updatedAt: number;
|
|
28
|
+
variants?: StoreProductVariant[];
|
|
29
|
+
}
|
|
30
|
+
export interface StoreProductVariant {
|
|
31
|
+
id: string;
|
|
32
|
+
productId: string;
|
|
33
|
+
sku: string;
|
|
34
|
+
title: string;
|
|
35
|
+
options: Record<string, string>;
|
|
36
|
+
priceOverride?: number | null;
|
|
37
|
+
weight?: number | null;
|
|
38
|
+
barcode?: string | null;
|
|
39
|
+
image?: string | null;
|
|
40
|
+
createdAt: number;
|
|
41
|
+
updatedAt: number;
|
|
42
|
+
inventory?: StoreInventory;
|
|
43
|
+
}
|
|
44
|
+
export interface StoreInventory {
|
|
45
|
+
id: string;
|
|
46
|
+
variantId: string;
|
|
47
|
+
productId: string;
|
|
48
|
+
stockQuantity: number;
|
|
49
|
+
reservedQuantity: number;
|
|
50
|
+
allowBackorder: boolean;
|
|
51
|
+
lowStockThreshold: number;
|
|
52
|
+
createdAt: number;
|
|
53
|
+
updatedAt: number;
|
|
54
|
+
}
|
|
55
|
+
export interface StoreCategory {
|
|
56
|
+
id: string;
|
|
57
|
+
tenantId?: string | null;
|
|
58
|
+
slug: string;
|
|
59
|
+
name: string;
|
|
60
|
+
description?: string | null;
|
|
61
|
+
image?: string | null;
|
|
62
|
+
parentId?: string | null;
|
|
63
|
+
order: number;
|
|
64
|
+
metadata: Record<string, any>;
|
|
65
|
+
createdAt: number;
|
|
66
|
+
updatedAt: number;
|
|
67
|
+
}
|
|
68
|
+
export interface StoreCartItem {
|
|
69
|
+
id: string;
|
|
70
|
+
cartId: string;
|
|
71
|
+
productId: string;
|
|
72
|
+
variantId: string;
|
|
73
|
+
quantity: number;
|
|
74
|
+
customAttributes: Record<string, any>;
|
|
75
|
+
product?: StoreProduct;
|
|
76
|
+
variant?: StoreProductVariant;
|
|
77
|
+
createdAt: number;
|
|
78
|
+
updatedAt: number;
|
|
79
|
+
}
|
|
80
|
+
export interface StoreCart {
|
|
81
|
+
id: string;
|
|
82
|
+
tenantId?: string | null;
|
|
83
|
+
userId?: string | null;
|
|
84
|
+
sessionToken: string;
|
|
85
|
+
currency: string;
|
|
86
|
+
couponCode?: string | null;
|
|
87
|
+
items: StoreCartItem[];
|
|
88
|
+
metadata: Record<string, any>;
|
|
89
|
+
expiresAt: number;
|
|
90
|
+
createdAt: number;
|
|
91
|
+
updatedAt: number;
|
|
92
|
+
}
|
|
93
|
+
export interface StoreCartTotals {
|
|
94
|
+
subtotal: number;
|
|
95
|
+
discountTotal: number;
|
|
96
|
+
taxTotal: number;
|
|
97
|
+
shippingTotal: number;
|
|
98
|
+
total: number;
|
|
99
|
+
itemCount: number;
|
|
100
|
+
currency: string;
|
|
101
|
+
}
|
|
102
|
+
export interface StoreCustomerAddress {
|
|
103
|
+
id: string;
|
|
104
|
+
userId: string;
|
|
105
|
+
type: StoreAddressType;
|
|
106
|
+
name: string;
|
|
107
|
+
company?: string | null;
|
|
108
|
+
line1: string;
|
|
109
|
+
line2?: string | null;
|
|
110
|
+
city: string;
|
|
111
|
+
state?: string | null;
|
|
112
|
+
postalCode: string;
|
|
113
|
+
country: string;
|
|
114
|
+
phone?: string | null;
|
|
115
|
+
isDefault: boolean;
|
|
116
|
+
createdAt: number;
|
|
117
|
+
updatedAt: number;
|
|
118
|
+
}
|
|
119
|
+
export interface StoreOrderItem {
|
|
120
|
+
id: string;
|
|
121
|
+
orderId: string;
|
|
122
|
+
productId: string;
|
|
123
|
+
variantId: string;
|
|
124
|
+
vendorId?: string | null;
|
|
125
|
+
sku: string;
|
|
126
|
+
title: string;
|
|
127
|
+
unitPrice: number;
|
|
128
|
+
quantity: number;
|
|
129
|
+
totalPrice: number;
|
|
130
|
+
isDigital: boolean;
|
|
131
|
+
downloadKey?: string | null;
|
|
132
|
+
metadata: Record<string, any>;
|
|
133
|
+
createdAt: number;
|
|
134
|
+
}
|
|
135
|
+
export interface StoreOrder {
|
|
136
|
+
id: string;
|
|
137
|
+
tenantId?: string | null;
|
|
138
|
+
orderNumber: string;
|
|
139
|
+
userId?: string | null;
|
|
140
|
+
customerEmail: string;
|
|
141
|
+
customerName?: string | null;
|
|
142
|
+
status: StoreOrderStatus;
|
|
143
|
+
currency: string;
|
|
144
|
+
subtotal: number;
|
|
145
|
+
taxTotal: number;
|
|
146
|
+
shippingTotal: number;
|
|
147
|
+
discountTotal: number;
|
|
148
|
+
total: number;
|
|
149
|
+
paymentProvider?: string | null;
|
|
150
|
+
paymentIntentId?: string | null;
|
|
151
|
+
shippingAddress?: Partial<StoreCustomerAddress> | null;
|
|
152
|
+
billingAddress?: Partial<StoreCustomerAddress> | null;
|
|
153
|
+
items: StoreOrderItem[];
|
|
154
|
+
metadata: Record<string, any>;
|
|
155
|
+
paidAt?: number | null;
|
|
156
|
+
shippedAt?: number | null;
|
|
157
|
+
deliveredAt?: number | null;
|
|
158
|
+
cancelledAt?: number | null;
|
|
159
|
+
refundedAt?: number | null;
|
|
160
|
+
createdAt: number;
|
|
161
|
+
updatedAt: number;
|
|
162
|
+
}
|
|
163
|
+
export interface StoreDiscount {
|
|
164
|
+
id: string;
|
|
165
|
+
tenantId?: string | null;
|
|
166
|
+
code: string;
|
|
167
|
+
type: StoreDiscountType;
|
|
168
|
+
/** Percentage (e.g. 20) or fixed amount in cents (e.g. 1000) */
|
|
169
|
+
value: number;
|
|
170
|
+
minOrderAmount: number;
|
|
171
|
+
maxUses?: number | null;
|
|
172
|
+
usedCount: number;
|
|
173
|
+
startsAt?: number | null;
|
|
174
|
+
expiresAt?: number | null;
|
|
175
|
+
isActive: boolean;
|
|
176
|
+
metadata: Record<string, any>;
|
|
177
|
+
createdAt: number;
|
|
178
|
+
updatedAt: number;
|
|
179
|
+
}
|
|
180
|
+
export interface StoreQueryProductsOptions {
|
|
181
|
+
tenantId?: string;
|
|
182
|
+
vendorId?: string;
|
|
183
|
+
categoryId?: string;
|
|
184
|
+
status?: StoreProductStatus;
|
|
185
|
+
type?: StoreProductType;
|
|
186
|
+
search?: string;
|
|
187
|
+
minPrice?: number;
|
|
188
|
+
maxPrice?: number;
|
|
189
|
+
inStockOnly?: boolean;
|
|
190
|
+
limit?: number;
|
|
191
|
+
offset?: number;
|
|
192
|
+
sortBy?: "price_asc" | "price_desc" | "newest" | "title";
|
|
193
|
+
}
|
|
194
|
+
export interface StoreQueryOrdersOptions {
|
|
195
|
+
userId?: string;
|
|
196
|
+
vendorId?: string;
|
|
197
|
+
customerEmail?: string;
|
|
198
|
+
status?: StoreOrderStatus;
|
|
199
|
+
tenantId?: string;
|
|
200
|
+
limit?: number;
|
|
201
|
+
offset?: number;
|
|
202
|
+
}
|
|
203
|
+
export interface StoreVendorMetrics {
|
|
204
|
+
vendorId: string;
|
|
205
|
+
totalRevenue: number;
|
|
206
|
+
netPayout: number;
|
|
207
|
+
commissionTotal: number;
|
|
208
|
+
orderCount: number;
|
|
209
|
+
itemsSoldCount: number;
|
|
210
|
+
totalProducts: number;
|
|
211
|
+
}
|
|
212
|
+
export interface StoreQueryDiscountsOptions {
|
|
213
|
+
tenantId?: string;
|
|
214
|
+
isActive?: boolean;
|
|
215
|
+
type?: StoreDiscountType;
|
|
216
|
+
search?: string;
|
|
217
|
+
limit?: number;
|
|
218
|
+
offset?: number;
|
|
219
|
+
}
|
|
220
|
+
export interface StoreLowStockItem extends StoreInventory {
|
|
221
|
+
productTitle?: string;
|
|
222
|
+
variantTitle?: string;
|
|
223
|
+
sku?: string;
|
|
224
|
+
}
|
|
225
|
+
export interface StoreMetrics {
|
|
226
|
+
totalRevenue: number;
|
|
227
|
+
orderCount: number;
|
|
228
|
+
paidOrderCount: number;
|
|
229
|
+
pendingOrderCount: number;
|
|
230
|
+
refundedOrderCount: number;
|
|
231
|
+
cancelledOrderCount: number;
|
|
232
|
+
averageOrderValue: number;
|
|
233
|
+
totalProducts: number;
|
|
234
|
+
lowStockCount: number;
|
|
235
|
+
}
|
|
236
|
+
export interface StoreCurrency {
|
|
237
|
+
/** ISO 4217 3-letter currency code (e.g. "USD", "EUR") */
|
|
238
|
+
code: string;
|
|
239
|
+
/** Currency symbol (e.g. "$", "€", "£", "¥") */
|
|
240
|
+
symbol: string;
|
|
241
|
+
/** Exchange rate relative to base store currency */
|
|
242
|
+
rate: number;
|
|
243
|
+
/** Number of decimal places (2 for USD/EUR, 0 for JPY/KRW) */
|
|
244
|
+
decimals: number;
|
|
245
|
+
/** Human-readable currency display name */
|
|
246
|
+
name: string;
|
|
247
|
+
}
|
|
248
|
+
export interface StoreTaxCalculationInput {
|
|
249
|
+
/** Taxable subtotal amount in cents */
|
|
250
|
+
subtotal: number;
|
|
251
|
+
/** Optional shipping amount in cents */
|
|
252
|
+
shippingTotal?: number;
|
|
253
|
+
/** Destination ISO 3166-1 alpha-2 country code (e.g. "DE", "FR", "US") */
|
|
254
|
+
country: string;
|
|
255
|
+
/** Optional state / province / region code (e.g. "CA", "NY", "ON") */
|
|
256
|
+
state?: string;
|
|
257
|
+
/** Optional postal / ZIP code */
|
|
258
|
+
postalCode?: string;
|
|
259
|
+
/** Whether line items are digital goods (relevant for EU VAT destination rules) */
|
|
260
|
+
isDigital?: boolean;
|
|
261
|
+
/** Customer company VAT registration number for B2B reverse charge */
|
|
262
|
+
vatNumber?: string;
|
|
263
|
+
/** Origin merchant country code */
|
|
264
|
+
merchantCountry?: string;
|
|
265
|
+
}
|
|
266
|
+
export interface StoreTaxBreakdownItem {
|
|
267
|
+
name: string;
|
|
268
|
+
rate: number;
|
|
269
|
+
amount: number;
|
|
270
|
+
}
|
|
271
|
+
export interface StoreTaxResult {
|
|
272
|
+
/** Effective combined tax rate (e.g. 0.19 for 19%) */
|
|
273
|
+
taxRate: number;
|
|
274
|
+
/** Calculated tax total in cents */
|
|
275
|
+
taxTotal: number;
|
|
276
|
+
/** Friendly tax name (e.g. "German VAT (19%)", "EU VAT Reverse Charge (0%)") */
|
|
277
|
+
taxName: string;
|
|
278
|
+
/** Whether B2B reverse charge VAT exemption applies */
|
|
279
|
+
isReverseCharge: boolean;
|
|
280
|
+
/** Whether the supplied EU VAT number matched syntax validation */
|
|
281
|
+
vatNumberValid?: boolean;
|
|
282
|
+
/** Individual itemized tax breakdown components */
|
|
283
|
+
breakdown: StoreTaxBreakdownItem[];
|
|
284
|
+
}
|
|
285
|
+
export interface StoreTaxOptions {
|
|
286
|
+
/** Merchant's origin country code (ISO 3166-1 alpha-2, e.g. "US" or "DE") */
|
|
287
|
+
merchantCountry?: string;
|
|
288
|
+
/** Fallback tax rate if destination country does not match rules. Default: 0 */
|
|
289
|
+
defaultRate?: number;
|
|
290
|
+
/** Whether product basePrice already includes VAT/tax (gross). Default: false */
|
|
291
|
+
pricesIncludeTax?: boolean;
|
|
292
|
+
/** Enable EU VAT destination-based OSS rules across all 27 EU member states. Default: true */
|
|
293
|
+
euVat?: boolean;
|
|
294
|
+
/** Country-specific tax rate overrides */
|
|
295
|
+
rates?: Record<string, number | Record<string, number>>;
|
|
296
|
+
/** Enable B2B reverse charge VAT exemption when valid EU VAT ID is supplied. Default: true */
|
|
297
|
+
b2bReverseCharge?: boolean;
|
|
298
|
+
}
|
|
299
|
+
export interface StoreLocalizationOptions {
|
|
300
|
+
/** Base store currency (ISO 4217). Default: "USD" */
|
|
301
|
+
defaultCurrency?: string;
|
|
302
|
+
/** List of supported currencies. Default: ["USD", "EUR", "GBP", "CAD", "AUD", "JPY"] */
|
|
303
|
+
currencies?: string[];
|
|
304
|
+
/** Custom exchange rates relative to defaultCurrency */
|
|
305
|
+
rates?: Record<string, number>;
|
|
306
|
+
/** Auto-detect currency from Cloudflare cf.country header. Default: true */
|
|
307
|
+
autoDetect?: boolean;
|
|
308
|
+
/** Price rounding strategy for converted amounts */
|
|
309
|
+
rounding?: "none" | "round" | "charm-99" | "charm-95";
|
|
310
|
+
/** Rule-based edge tax and VAT configuration */
|
|
311
|
+
tax?: StoreTaxOptions;
|
|
312
|
+
}
|
|
313
|
+
export type { StoreOptions } from "../../types";
|
|
File without changes
|