qarpeo 0.2.0 → 0.3.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/dist/chunks/tools.mjs +993 -31
- package/dist/cli/index.mjs +1102 -31
- package/dist/fate/index.d.ts +9 -1
- package/dist/fate/index.mjs +20 -3
- package/dist/module.mjs +296 -753
- package/dist/runtime/browser.mjs +2 -2
- package/dist/runtime/comments-server.d.ts +3 -0
- package/dist/runtime/comments-server.mjs +2 -0
- package/dist/runtime/comments.d.ts +0 -2
- package/dist/runtime/comments.mjs +0 -2
- package/dist/runtime/db.d.ts +10 -9
- package/dist/runtime/db.mjs +79 -8
- package/dist/runtime/drizzle.mjs +21 -6
- package/dist/runtime/index.d.ts +4 -0
- package/dist/runtime/realtime-server.d.ts +4 -0
- package/dist/runtime/realtime-server.mjs +13 -0
- package/dist/runtime/realtime.d.ts +1 -4
- package/dist/runtime/realtime.mjs +0 -13
- package/dist/runtime/replica.d.ts +27 -0
- package/dist/runtime/replica.mjs +229 -0
- package/dist/runtime/server/durable-objects/agent.mjs +14 -2
- package/dist/runtime/server/durable-objects/room.d.ts +10 -0
- package/dist/runtime/server/durable-objects/room.mjs +119 -28
- package/dist/runtime/server/middleware/devtools.mjs +1 -1
- package/dist/runtime/server/middleware/tenancy.mjs +7 -4
- package/dist/runtime/server/plugins/store.mjs +1 -1
- package/dist/runtime/server/routes/__qarpeo/mail/track/click/[id].get.mjs +57 -17
- package/dist/runtime/server/routes/agents/[agent]/chat.post.mjs +19 -12
- package/dist/runtime/server/routes/agents/[agent]/clear.post.mjs +8 -9
- package/dist/runtime/server/routes/agents/[agent]/history.get.mjs +8 -9
- package/dist/runtime/server/routes/analytics/events.get.mjs +12 -2
- package/dist/runtime/server/routes/analytics/pageviews.get.mjs +10 -1
- package/dist/runtime/server/routes/analytics/summary.get.mjs +10 -1
- package/dist/runtime/server/routes/auth/2fa/disable.post.mjs +11 -2
- package/dist/runtime/server/routes/auth/2fa/setup.post.mjs +7 -0
- package/dist/runtime/server/routes/auth/2fa/verify.post.mjs +11 -2
- package/dist/runtime/server/routes/auth/account.delete.mjs +7 -0
- package/dist/runtime/server/routes/auth/magic-link/verify.get.mjs +5 -3
- package/dist/runtime/server/routes/auth/organization/sso/index.post.mjs +10 -0
- package/dist/runtime/server/routes/auth/otp/verify.post.mjs +5 -3
- package/dist/runtime/server/routes/auth/sso/saml/acs.post.mjs +18 -0
- package/dist/runtime/server/routes/auth/webauthn/login/options.post.d.ts +1 -1
- package/dist/runtime/server/routes/auth/webauthn/login/options.post.mjs +11 -2
- package/dist/runtime/server/routes/auth/webauthn/login/verify.post.mjs +10 -1
- package/dist/runtime/server/routes/auth/webauthn/register/options.post.d.ts +1 -1
- package/dist/runtime/server/routes/auth/webauthn/register/options.post.mjs +10 -1
- package/dist/runtime/server/routes/auth/webauthn/register/verify.post.mjs +10 -1
- package/dist/runtime/server/routes/browser/crawl.post.mjs +13 -0
- package/dist/runtime/server/routes/browser/invoice.post.mjs +15 -1
- package/dist/runtime/server/routes/browser/og-image.post.mjs +13 -0
- package/dist/runtime/server/routes/browser/pdf.post.mjs +15 -1
- package/dist/runtime/server/routes/browser/screenshot.post.mjs +13 -0
- package/dist/runtime/server/routes/cms/[collection]/[id]/preview-token.post.mjs +23 -8
- package/dist/runtime/server/routes/cms/[collection]/[id]/publish.post.mjs +2 -1
- package/dist/runtime/server/routes/cms/[collection]/[id]/review.post.mjs +2 -1
- package/dist/runtime/server/routes/cms/[collection]/[id]/revisions/[revId]/restore.post.mjs +2 -1
- package/dist/runtime/server/routes/cms/[collection]/[id].delete.mjs +2 -1
- package/dist/runtime/server/routes/cms/[collection]/[id].put.mjs +2 -1
- package/dist/runtime/server/routes/cms/[collection]/index.post.mjs +2 -1
- package/dist/runtime/server/routes/cms/categories/[id].delete.mjs +2 -1
- package/dist/runtime/server/routes/cms/categories/[id].put.mjs +2 -1
- package/dist/runtime/server/routes/cms/categories.post.mjs +2 -1
- package/dist/runtime/server/routes/cms/collections/[id].delete.mjs +2 -1
- package/dist/runtime/server/routes/cms/collections/[id].put.mjs +2 -1
- package/dist/runtime/server/routes/cms/collections/index.post.mjs +2 -1
- package/dist/runtime/server/routes/cms/export.post.mjs +1 -1
- package/dist/runtime/server/routes/cms/subscribers/[id].delete.mjs +2 -1
- package/dist/runtime/server/routes/cms/subscribers/[id].patch.mjs +2 -1
- package/dist/runtime/server/routes/cms/tags/[id].delete.mjs +2 -1
- package/dist/runtime/server/routes/cms/tags.post.mjs +2 -1
- package/dist/runtime/server/routes/comments/[id]/react.post.mjs +7 -3
- package/dist/runtime/server/routes/comments/[id]/report.post.mjs +3 -0
- package/dist/runtime/server/routes/comments/[id].delete.mjs +1 -1
- package/dist/runtime/server/routes/comments/[id].get.mjs +13 -0
- package/dist/runtime/server/routes/comments/[id].patch.mjs +1 -1
- package/dist/runtime/server/routes/fate.d.ts +6 -0
- package/dist/runtime/server/routes/fate.mjs +32 -3
- package/dist/runtime/server/routes/mail/bounce.post.mjs +14 -2
- package/dist/runtime/server/routes/mail/unsubscribe.mjs +2 -1
- package/dist/runtime/server/routes/mail/webhooks.post.mjs +18 -4
- package/dist/runtime/server/routes/notifications/[id].get.mjs +3 -4
- package/dist/runtime/server/routes/notifications/index.get.mjs +4 -2
- package/dist/runtime/server/routes/notifications/push/subscribe.post.mjs +3 -1
- package/dist/runtime/server/routes/notifications/push/unsubscribe.post.mjs +5 -3
- package/dist/runtime/server/routes/notifications/read-all.post.mjs +6 -2
- package/dist/runtime/server/routes/notifications/send.post.mjs +13 -2
- package/dist/runtime/server/routes/payments/cancel.post.mjs +1 -1
- package/dist/runtime/server/routes/payments/change-plan.post.mjs +1 -1
- package/dist/runtime/server/routes/payments/checkout.post.mjs +1 -1
- package/dist/runtime/server/routes/payments/pause.post.mjs +1 -1
- package/dist/runtime/server/routes/payments/portal.post.mjs +1 -1
- package/dist/runtime/server/routes/payments/subscription.get.mjs +1 -1
- package/dist/runtime/server/routes/payments/usage.get.mjs +1 -1
- package/dist/runtime/server/routes/payments/usage.post.mjs +1 -1
- package/dist/runtime/server/routes/payments/webhook.post.mjs +8 -1
- package/dist/runtime/server/routes/realtime/broadcast.post.mjs +3 -2
- package/dist/runtime/server/routes/realtime/history.delete.mjs +2 -2
- package/dist/runtime/server/routes/realtime/history.get.mjs +2 -2
- package/dist/runtime/server/routes/realtime/presence.get.mjs +3 -3
- package/dist/runtime/server/routes/realtime/state.get.mjs +3 -3
- package/dist/runtime/server/routes/realtime/state.post.mjs +13 -4
- package/dist/runtime/server/routes/realtime/ws.get.mjs +2 -2
- package/dist/runtime/server/routes/storage/file/[...key].delete.mjs +1 -1
- package/dist/runtime/server/routes/storage/file/[...key].get.mjs +7 -0
- package/dist/runtime/server/routes/storage/files.get.d.ts +1 -1
- package/dist/runtime/server/routes/storage/files.get.mjs +24 -4
- package/dist/runtime/server/routes/storage/multipart/abort.post.mjs +16 -1
- package/dist/runtime/server/routes/storage/multipart/complete.post.d.ts +1 -1
- package/dist/runtime/server/routes/storage/multipart/complete.post.mjs +15 -1
- package/dist/runtime/server/routes/storage/multipart/create.post.mjs +7 -0
- package/dist/runtime/server/routes/storage/multipart/part.put.mjs +15 -1
- package/dist/runtime/server/routes/storage/presigned-r2.post.mjs +8 -1
- package/dist/runtime/server/routes/storage/presigned.post.d.ts +1 -1
- package/dist/runtime/server/routes/storage/presigned.post.mjs +8 -1
- package/dist/runtime/server/routes/storage/sign.post.mjs +7 -0
- package/dist/runtime/server/routes/storage/upload.post.d.ts +2 -2
- package/dist/runtime/server/routes/store/cart/index.delete.mjs +3 -4
- package/dist/runtime/server/routes/store/cart/index.get.mjs +3 -10
- package/dist/runtime/server/routes/store/cart/items/[id].delete.mjs +6 -4
- package/dist/runtime/server/routes/store/cart/items/[id].patch.mjs +12 -4
- package/dist/runtime/server/routes/store/cart/items.post.mjs +9 -10
- package/dist/runtime/server/routes/store/categories/index.get.mjs +4 -2
- package/dist/runtime/server/routes/store/checkout.post.mjs +13 -3
- package/dist/runtime/server/routes/store/coupons/apply.post.mjs +6 -5
- package/dist/runtime/server/routes/store/orders/[id].get.mjs +2 -2
- package/dist/runtime/server/routes/store/orders/download/[token].get.mjs +6 -3
- package/dist/runtime/server/routes/store/orders/index.get.mjs +1 -1
- package/dist/runtime/server/routes/store/products/[slug].get.mjs +2 -2
- package/dist/runtime/server/routes/store/products/index.get.mjs +1 -1
- package/dist/runtime/server/routes/store/tax/calculate.post.mjs +10 -0
- package/dist/runtime/server/routes/tenants/[tenant]/domains/[domain]/index.delete.mjs +26 -25
- package/dist/runtime/server/routes/tenants/[tenant]/domains/[domain]/verify.post.mjs +26 -25
- package/dist/runtime/server/utils/ai.d.ts +6 -0
- package/dist/runtime/server/utils/ai.mjs +12 -2
- package/dist/runtime/server/utils/analytics-query.mjs +8 -4
- package/dist/runtime/server/utils/browser-utils.d.ts +9 -0
- package/dist/runtime/server/utils/browser-utils.mjs +135 -0
- package/dist/runtime/server/utils/cms/cache.d.ts +13 -0
- package/dist/runtime/server/utils/cms/cache.mjs +95 -0
- package/dist/runtime/server/utils/cms/common.mjs +1 -1
- package/dist/runtime/server/utils/cms/markdown.mjs +38 -8
- package/dist/runtime/server/utils/cms/mutations.d.ts +26 -0
- package/dist/runtime/server/utils/cms/mutations.mjs +569 -0
- package/dist/runtime/server/utils/cms/path.d.ts +8 -0
- package/dist/runtime/server/utils/cms/path.mjs +23 -0
- package/dist/runtime/server/utils/cms/queries.d.ts +27 -0
- package/dist/runtime/server/utils/cms/queries.mjs +366 -0
- package/dist/runtime/server/utils/cms/references.d.ts +48 -0
- package/dist/runtime/server/utils/cms/references.mjs +309 -0
- package/dist/runtime/server/utils/cms/revisions.d.ts +7 -0
- package/dist/runtime/server/utils/cms/revisions.mjs +60 -0
- package/dist/runtime/server/utils/cms/sync.mjs +3 -3
- package/dist/runtime/server/utils/cms.d.ts +5 -82
- package/dist/runtime/server/utils/cms.mjs +28 -1367
- package/dist/runtime/server/utils/comments.d.ts +11 -0
- package/dist/runtime/server/utils/comments.mjs +65 -17
- package/dist/runtime/server/utils/crypto.mjs +1 -1
- package/dist/runtime/server/utils/domains.mjs +9 -0
- package/dist/runtime/server/utils/drizzle.d.ts +26 -1
- package/dist/runtime/server/utils/drizzle.mjs +78 -19
- package/dist/runtime/server/utils/email-inbound.mjs +9 -1
- package/dist/runtime/server/utils/impersonation.mjs +58 -1
- package/dist/runtime/server/utils/lock.d.ts +11 -0
- package/dist/runtime/server/utils/lock.mjs +4 -0
- package/dist/runtime/server/utils/mail-suppression.mjs +48 -13
- package/dist/runtime/server/utils/mail.d.ts +2 -1
- package/dist/runtime/server/utils/mail.mjs +17 -11
- package/dist/runtime/server/utils/notifications.d.ts +13 -4
- package/dist/runtime/server/utils/notifications.mjs +20 -4
- package/dist/runtime/server/utils/organization.mjs +36 -1
- package/dist/runtime/server/utils/passwordless.mjs +8 -0
- package/dist/runtime/server/utils/payments/checkout.d.ts +34 -0
- package/dist/runtime/server/utils/payments/checkout.mjs +158 -0
- package/dist/runtime/server/utils/payments/common.d.ts +45 -0
- package/dist/runtime/server/utils/payments/common.mjs +234 -0
- package/dist/runtime/server/utils/payments/index.d.ts +9 -0
- package/dist/runtime/server/utils/payments/index.mjs +21 -0
- package/dist/runtime/server/utils/payments/lemonsqueezy.d.ts +7 -0
- package/dist/runtime/server/utils/payments/lemonsqueezy.mjs +55 -0
- package/dist/runtime/server/utils/payments/paddle.d.ts +7 -0
- package/dist/runtime/server/utils/payments/paddle.mjs +92 -0
- package/dist/runtime/server/utils/payments/polar.d.ts +11 -0
- package/dist/runtime/server/utils/payments/polar.mjs +66 -0
- package/dist/runtime/server/utils/payments/stripe.d.ts +7 -0
- package/dist/runtime/server/utils/payments/stripe.mjs +159 -0
- package/dist/runtime/server/utils/payments/subscriptions.d.ts +89 -0
- package/dist/runtime/server/utils/payments/subscriptions.mjs +236 -0
- package/dist/runtime/server/utils/payments/usage.d.ts +12 -0
- package/dist/runtime/server/utils/payments/usage.mjs +143 -0
- package/dist/runtime/server/utils/payments/webhooks.d.ts +10 -0
- package/dist/runtime/server/utils/payments/webhooks.mjs +200 -0
- package/dist/runtime/server/utils/payments.d.ts +1 -158
- package/dist/runtime/server/utils/payments.mjs +1 -1289
- package/dist/runtime/server/utils/queue.d.ts +2 -0
- package/dist/runtime/server/utils/queue.mjs +34 -21
- package/dist/runtime/server/utils/rag.mjs +30 -17
- package/dist/runtime/server/utils/realtime.d.ts +5 -1
- package/dist/runtime/server/utils/realtime.mjs +43 -7
- package/dist/runtime/server/utils/session.mjs +16 -3
- package/dist/runtime/server/utils/sso.d.ts +3 -0
- package/dist/runtime/server/utils/sso.mjs +43 -0
- package/dist/runtime/server/utils/storage.mjs +12 -1
- package/dist/runtime/server/utils/store/cart.d.ts +63 -0
- package/dist/runtime/server/utils/store/cart.mjs +542 -0
- package/dist/runtime/server/utils/store/checkout.d.ts +14 -0
- package/dist/runtime/server/utils/store/checkout.mjs +118 -0
- package/dist/runtime/server/utils/store/common.d.ts +29 -0
- package/dist/runtime/server/utils/store/common.mjs +479 -0
- package/dist/runtime/server/utils/store/index.d.ts +7 -0
- package/dist/runtime/server/utils/store/index.mjs +30 -0
- package/dist/runtime/server/utils/store/inventory.d.ts +25 -0
- package/dist/runtime/server/utils/store/inventory.mjs +190 -0
- package/dist/runtime/server/utils/store/orders.d.ts +60 -0
- package/dist/runtime/server/utils/store/orders.mjs +590 -0
- package/dist/runtime/server/utils/store/products.d.ts +35 -0
- package/dist/runtime/server/utils/store/products.mjs +461 -0
- package/dist/runtime/server/utils/store/vendor.d.ts +18 -0
- package/dist/runtime/server/utils/store/vendor.mjs +68 -0
- package/dist/runtime/server/utils/store.d.ts +1 -207
- package/dist/runtime/server/utils/store.mjs +1 -2227
- package/dist/runtime/server/utils/string.d.ts +1 -1
- package/dist/runtime/server/utils/string.mjs +12 -4
- package/dist/runtime/server/utils/tenant.mjs +19 -5
- package/dist/runtime/server/utils/tracker.mjs +2 -0
- package/dist/runtime/server.d.ts +3 -3
- package/dist/runtime/server.mjs +4 -4
- package/dist/runtime/storage-server.d.ts +2 -0
- package/dist/runtime/storage-server.mjs +1 -0
- package/dist/runtime/storage.d.ts +1 -1
- package/dist/runtime/storage.mjs +0 -1
- package/dist/runtime/store.d.ts +0 -1
- package/dist/runtime/store.mjs +0 -1
- package/dist/runtime/test-utils.d.ts +4 -0
- package/dist/runtime/test-utils.mjs +54 -0
- package/dist/runtime/types/d1.d.ts +43 -0
- package/dist/runtime/types/drizzle.d.ts +6 -0
- package/dist/runtime/types/store.d.ts +1 -1
- package/dist/types/analytics.d.ts +80 -0
- package/dist/types/auth.d.ts +282 -0
- package/dist/types/cache.d.ts +55 -0
- package/dist/types/comments.d.ts +130 -0
- package/dist/types/db.d.ts +29 -0
- package/dist/types/email.d.ts +182 -0
- package/dist/types/index.d.ts +22 -0
- package/dist/types/jobs.d.ts +58 -0
- package/dist/types/notifications.d.ts +77 -0
- package/dist/types/options.d.ts +363 -0
- package/dist/types/payments.d.ts +145 -0
- package/dist/types/ratelimit.d.ts +71 -0
- package/dist/types/realtime.d.ts +136 -0
- package/dist/types/site.d.ts +121 -0
- package/dist/types/storage.d.ts +164 -0
- package/dist/types/store-options.d.ts +199 -0
- package/dist/types/tenant.d.ts +100 -0
- package/dist/types.d.ts +1 -2174
- package/dist/utils/migration-lock.d.ts +139 -0
- package/dist/utils/pkg.d.ts +14 -1
- package/dist/utils/schema-diff.d.ts +39 -0
- package/package.json +55 -17
- package/dist/chunks/auth-schema.mjs +0 -364
package/dist/types.d.ts
CHANGED
|
@@ -1,2174 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import type { DurableObjectsOptions } from "./runtime/types/durable-object";
|
|
3
|
-
export interface RateLimitConfig {
|
|
4
|
-
/**
|
|
5
|
-
* Max number of requests permitted within the time window.
|
|
6
|
-
*
|
|
7
|
-
* @default 100
|
|
8
|
-
*/
|
|
9
|
-
limit?: number;
|
|
10
|
-
/**
|
|
11
|
-
* Period window in seconds: must be 10 or 60.
|
|
12
|
-
*
|
|
13
|
-
* @default 60
|
|
14
|
-
*/
|
|
15
|
-
period?: 10 | 60;
|
|
16
|
-
/**
|
|
17
|
-
* Unique namespace ID grouping rate limit counters.
|
|
18
|
-
*
|
|
19
|
-
* @default 1001
|
|
20
|
-
*/
|
|
21
|
-
namespaceId?: number;
|
|
22
|
-
}
|
|
23
|
-
export interface EmailInboundOptions {
|
|
24
|
-
/**
|
|
25
|
-
* Whether Cloudflare Inbound Email handling is enabled.
|
|
26
|
-
* @default true
|
|
27
|
-
*/
|
|
28
|
-
enabled?: boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Custom directory or file path for email handlers (defaults to auto-discovering server/email.ts, server/email/*.ts).
|
|
31
|
-
*/
|
|
32
|
-
dir?: string;
|
|
33
|
-
}
|
|
34
|
-
export interface EmailOptions {
|
|
35
|
-
/**
|
|
36
|
-
* Default sender address or map of named sender presets.
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* // Single default address:
|
|
40
|
-
* from: "MyApp <noreply@myapp.com>"
|
|
41
|
-
*
|
|
42
|
-
* // Map of named presets:
|
|
43
|
-
* from: {
|
|
44
|
-
* default: "MyApp <noreply@myapp.com>",
|
|
45
|
-
* support: "Support Team <support@myapp.com>",
|
|
46
|
-
* billing: "Acme Invoicing <billing@myapp.com>",
|
|
47
|
-
* }
|
|
48
|
-
*/
|
|
49
|
-
from?: string | Record<string, string>;
|
|
50
|
-
/**
|
|
51
|
-
* Cloudflare send_email binding name override.
|
|
52
|
-
*
|
|
53
|
-
* @default "EMAIL"
|
|
54
|
-
*/
|
|
55
|
-
binding?: string;
|
|
56
|
-
/**
|
|
57
|
-
* Cloudflare Inbound Email configuration.
|
|
58
|
-
* When enabled, routes incoming emails to your server/email handler.
|
|
59
|
-
*/
|
|
60
|
-
inbound?: boolean | EmailInboundOptions;
|
|
61
|
-
}
|
|
62
|
-
export interface AuthRedirectConfig {
|
|
63
|
-
/**
|
|
64
|
-
* Route to redirect after successful login.
|
|
65
|
-
*
|
|
66
|
-
* @default "/dashboard"
|
|
67
|
-
*/
|
|
68
|
-
success?: string;
|
|
69
|
-
/**
|
|
70
|
-
* Route to redirect after logout.
|
|
71
|
-
*
|
|
72
|
-
* @default "/login"
|
|
73
|
-
*/
|
|
74
|
-
logout?: string;
|
|
75
|
-
/**
|
|
76
|
-
* Route to redirect when an unauthenticated user accesses a protected route.
|
|
77
|
-
*
|
|
78
|
-
* @default "/login"
|
|
79
|
-
*/
|
|
80
|
-
login?: string;
|
|
81
|
-
}
|
|
82
|
-
export interface AuthSessionConfig {
|
|
83
|
-
/**
|
|
84
|
-
* Session storage backend: sealed cookie or Cloudflare KV.
|
|
85
|
-
*
|
|
86
|
-
* @default "cookie"
|
|
87
|
-
*/
|
|
88
|
-
backend?: "cookie" | "kv";
|
|
89
|
-
/**
|
|
90
|
-
* Session expiration maxAge in seconds.
|
|
91
|
-
*
|
|
92
|
-
* @default 604800 (7 days)
|
|
93
|
-
*/
|
|
94
|
-
maxAge?: number;
|
|
95
|
-
/**
|
|
96
|
-
* Maximum concurrent sessions per user before LRU eviction.
|
|
97
|
-
*
|
|
98
|
-
* @default 5
|
|
99
|
-
*/
|
|
100
|
-
maxSessionsPerUser?: number;
|
|
101
|
-
/**
|
|
102
|
-
* Throttled device tracking in D1.
|
|
103
|
-
*
|
|
104
|
-
* @default false
|
|
105
|
-
*/
|
|
106
|
-
trackDevice?: boolean;
|
|
107
|
-
}
|
|
108
|
-
export interface AuthPasswordlessOtpConfig {
|
|
109
|
-
/** Enable 6-digit OTP codes */
|
|
110
|
-
enabled?: boolean;
|
|
111
|
-
/** Code TTL in seconds @default 300 */
|
|
112
|
-
ttl?: number;
|
|
113
|
-
/** Delivery channels @default ["email"] */
|
|
114
|
-
channels?: Array<"email" | "sms" | "whatsapp" | "telegram">;
|
|
115
|
-
}
|
|
116
|
-
export interface AuthPasswordlessMagicLinkConfig {
|
|
117
|
-
/** Enable email magic login links */
|
|
118
|
-
enabled?: boolean;
|
|
119
|
-
/** Link TTL in seconds @default 900 */
|
|
120
|
-
ttl?: number;
|
|
121
|
-
}
|
|
122
|
-
export interface AuthPasswordlessConfig {
|
|
123
|
-
otp?: boolean | AuthPasswordlessOtpConfig;
|
|
124
|
-
magicLink?: boolean | AuthPasswordlessMagicLinkConfig;
|
|
125
|
-
}
|
|
126
|
-
export interface AuthFieldDefinition {
|
|
127
|
-
type: "string" | "number" | "boolean" | "json";
|
|
128
|
-
default?: string | number | boolean;
|
|
129
|
-
enum?: readonly string[];
|
|
130
|
-
nullable?: boolean;
|
|
131
|
-
}
|
|
132
|
-
export interface AuthFieldsConfig {
|
|
133
|
-
extends?: Record<string, AuthFieldDefinition>;
|
|
134
|
-
}
|
|
135
|
-
export interface AuthOptions {
|
|
136
|
-
/** Route protection rules mapping path patterns to required role/permissions or boolean. */
|
|
137
|
-
rules?: Record<string, any>;
|
|
138
|
-
/**
|
|
139
|
-
* Base route prefix for auto-injected auth endpoints.
|
|
140
|
-
*
|
|
141
|
-
* @default "/api/auth"
|
|
142
|
-
*/
|
|
143
|
-
prefix?: string;
|
|
144
|
-
/**
|
|
145
|
-
* Enabled OAuth providers (e.g. ['github', 'google', 'discord']). Auto-uses
|
|
146
|
-
* `NUXT_OAUTH_<PROVIDER>_CLIENT_ID` and `_CLIENT_SECRET`.
|
|
147
|
-
*/
|
|
148
|
-
providers?: string[];
|
|
149
|
-
/**
|
|
150
|
-
* Automatic account linking for accounts sharing the same verified email address. Enforces
|
|
151
|
-
* dual-verified email check.
|
|
152
|
-
*
|
|
153
|
-
* @default true
|
|
154
|
-
*/
|
|
155
|
-
linkAccounts?: boolean;
|
|
156
|
-
/** Redirect paths for auth flows. */
|
|
157
|
-
redirect?: AuthRedirectConfig;
|
|
158
|
-
/** Session storage configuration. */
|
|
159
|
-
session?: AuthSessionConfig;
|
|
160
|
-
/** Passwordless authentication (OTP / Magic Links). */
|
|
161
|
-
passwordless?: AuthPasswordlessConfig;
|
|
162
|
-
/** Declarative custom user fields (Tier 2). */
|
|
163
|
-
fields?: AuthFieldsConfig;
|
|
164
|
-
/**
|
|
165
|
-
* Enable Two-Factor Authentication (TOTP Authenticator Apps).
|
|
166
|
-
*
|
|
167
|
-
* @default false
|
|
168
|
-
*/
|
|
169
|
-
twoFactor?: boolean;
|
|
170
|
-
/**
|
|
171
|
-
* Enable Multi-tenant Organizations & Teams.
|
|
172
|
-
*
|
|
173
|
-
* @default false
|
|
174
|
-
*/
|
|
175
|
-
organizations?: boolean;
|
|
176
|
-
/**
|
|
177
|
-
* Enable Admin Impersonation.
|
|
178
|
-
*
|
|
179
|
-
* @default false
|
|
180
|
-
*/
|
|
181
|
-
impersonation?: boolean;
|
|
182
|
-
/**
|
|
183
|
-
* Enable WebAuthn / Passkeys.
|
|
184
|
-
*
|
|
185
|
-
* @default false
|
|
186
|
-
*/
|
|
187
|
-
webauthn?: boolean;
|
|
188
|
-
/**
|
|
189
|
-
* Alias for `webauthn`. Enable WebAuthn / Passkeys.
|
|
190
|
-
*
|
|
191
|
-
* @default false
|
|
192
|
-
*/
|
|
193
|
-
webAuthn?: boolean;
|
|
194
|
-
/**
|
|
195
|
-
* Enable Personal Access Tokens (CLI keys).
|
|
196
|
-
*
|
|
197
|
-
* @default false
|
|
198
|
-
*/
|
|
199
|
-
apiTokens?: boolean;
|
|
200
|
-
/** Enterprise: Cloudflare Turnstile bot and abuse protection. */
|
|
201
|
-
turnstile?: boolean | AuthTurnstileConfig;
|
|
202
|
-
/** Enterprise: Mandatory Multi-Factor Authentication enforcement policies. */
|
|
203
|
-
mfa?: AuthMfaConfig;
|
|
204
|
-
/**
|
|
205
|
-
* Enterprise: SAML 2.0 & Enterprise OIDC Single Sign-On (SSO).
|
|
206
|
-
*
|
|
207
|
-
* @default false
|
|
208
|
-
*/
|
|
209
|
-
sso?: boolean | AuthSSOConfig;
|
|
210
|
-
/** Enterprise / GDPR: Self-serve account deletion settings. */
|
|
211
|
-
accountDeletion?: boolean | AuthAccountDeletionConfig;
|
|
212
|
-
}
|
|
213
|
-
export interface AuthTurnstileConfig {
|
|
214
|
-
/** Turnstile secret key (or set NUXT_TURNSTILE_SECRET_KEY). */
|
|
215
|
-
secretKey?: string;
|
|
216
|
-
/** Turnstile public site key. */
|
|
217
|
-
siteKey?: string;
|
|
218
|
-
/** Automatic protection toggles for auth operations. */
|
|
219
|
-
protect?: {
|
|
220
|
-
login?: boolean;
|
|
221
|
-
register?: boolean;
|
|
222
|
-
otp?: boolean;
|
|
223
|
-
magicLink?: boolean;
|
|
224
|
-
accountDelete?: boolean;
|
|
225
|
-
};
|
|
226
|
-
}
|
|
227
|
-
export interface AuthMfaConfig {
|
|
228
|
-
/**
|
|
229
|
-
* Policy for MFA enforcement:
|
|
230
|
-
*
|
|
231
|
-
* - False / undefined: Optional MFA
|
|
232
|
-
* - True: Enforced for all authenticated users
|
|
233
|
-
* - "org": Enforced if user's current organization has mfaRequired set
|
|
234
|
-
* - "role": Enforced if user's role is in roles
|
|
235
|
-
*/
|
|
236
|
-
enforce?: boolean | "org" | "role";
|
|
237
|
-
/** Roles that require MFA when enforce === "role" (default: ['admin', 'owner']) */
|
|
238
|
-
roles?: string[];
|
|
239
|
-
/** Redirect path when MFA is required but unverified (default: "/auth/2fa/verify") */
|
|
240
|
-
redirect?: string;
|
|
241
|
-
}
|
|
242
|
-
export interface AuthSSOConfig {
|
|
243
|
-
/** Enable Enterprise SSO endpoints & database tables. */
|
|
244
|
-
enabled?: boolean;
|
|
245
|
-
/** Default organization role for new users created via SSO (default: "member"). */
|
|
246
|
-
defaultRole?: string;
|
|
247
|
-
/** Allow automated self-registration for matching SSO domains (default: true). */
|
|
248
|
-
allowSelfRegistration?: boolean;
|
|
249
|
-
}
|
|
250
|
-
export interface AuthAccountDeletionConfig {
|
|
251
|
-
/** Allow users to delete their account self-serve (default: true). */
|
|
252
|
-
enabled?: boolean;
|
|
253
|
-
/** Require Cloudflare Turnstile verification token before deleting (default: false). */
|
|
254
|
-
requireTurnstile?: boolean;
|
|
255
|
-
/** Require explicit confirmation phrase (e.g. "DELETE") (default: false). */
|
|
256
|
-
requireConfirmationPhrase?: boolean;
|
|
257
|
-
/** Confirmation phrase string (default: "DELETE"). */
|
|
258
|
-
confirmationPhrase?: string;
|
|
259
|
-
/** Allow cascade deleting owned organizations if user is sole owner (default: false). */
|
|
260
|
-
allowOrgCascade?: boolean;
|
|
261
|
-
}
|
|
262
|
-
export interface QarpeoSSOConnection {
|
|
263
|
-
id: string;
|
|
264
|
-
organizationId?: string | null;
|
|
265
|
-
providerType: "saml" | "oidc";
|
|
266
|
-
name: string;
|
|
267
|
-
domain?: string | null;
|
|
268
|
-
clientId?: string | null;
|
|
269
|
-
clientSecret?: string | null;
|
|
270
|
-
issuer?: string | null;
|
|
271
|
-
ssoUrl: string;
|
|
272
|
-
tokenUrl?: string | null;
|
|
273
|
-
userinfoUrl?: string | null;
|
|
274
|
-
cert?: string | null;
|
|
275
|
-
enabled: boolean;
|
|
276
|
-
createdAt: number;
|
|
277
|
-
updatedAt: number;
|
|
278
|
-
}
|
|
279
|
-
export interface DeleteAccountOptions {
|
|
280
|
-
confirm?: boolean;
|
|
281
|
-
phrase?: string;
|
|
282
|
-
turnstileToken?: string;
|
|
283
|
-
cascadeOrg?: boolean;
|
|
284
|
-
}
|
|
285
|
-
export interface StorageImagePreset {
|
|
286
|
-
width?: number;
|
|
287
|
-
height?: number;
|
|
288
|
-
quality?: number;
|
|
289
|
-
format?: "webp" | "avif" | "jpeg" | "png";
|
|
290
|
-
fit?: "cover" | "contain" | "scale-down" | "crop" | "pad";
|
|
291
|
-
}
|
|
292
|
-
export interface JobsOptions {
|
|
293
|
-
/**
|
|
294
|
-
* Cloudflare Queue binding name override.
|
|
295
|
-
*
|
|
296
|
-
* @default "QUEUE"
|
|
297
|
-
*/
|
|
298
|
-
binding?: string;
|
|
299
|
-
/**
|
|
300
|
-
* Directory where background jobs are located.
|
|
301
|
-
*
|
|
302
|
-
* @default "server/jobs"
|
|
303
|
-
*/
|
|
304
|
-
dir?: string;
|
|
305
|
-
/**
|
|
306
|
-
* Maximum retry attempts for failed jobs.
|
|
307
|
-
*
|
|
308
|
-
* @default 3
|
|
309
|
-
*/
|
|
310
|
-
maxRetries?: number;
|
|
311
|
-
/**
|
|
312
|
-
* Maximum batch size delivered to consumer.
|
|
313
|
-
*
|
|
314
|
-
* @default 10
|
|
315
|
-
*/
|
|
316
|
-
maxBatchSize?: number;
|
|
317
|
-
/**
|
|
318
|
-
* Maximum batch timeout in seconds before delivering.
|
|
319
|
-
*
|
|
320
|
-
* @default 5
|
|
321
|
-
*/
|
|
322
|
-
maxBatchTimeout?: number;
|
|
323
|
-
}
|
|
324
|
-
export interface JobContext {
|
|
325
|
-
/** Unique message/job ID */
|
|
326
|
-
id: string;
|
|
327
|
-
/** Timestamp when the job was dispatched */
|
|
328
|
-
timestamp: Date;
|
|
329
|
-
/** Delivery attempt count (starts at 1) */
|
|
330
|
-
attempts: number;
|
|
331
|
-
/** Name of the job being executed */
|
|
332
|
-
jobName: string;
|
|
333
|
-
/** Manually request a retry for this message */
|
|
334
|
-
retry: () => void;
|
|
335
|
-
/** Manually acknowledge this message */
|
|
336
|
-
ack: () => void;
|
|
337
|
-
}
|
|
338
|
-
export type JobHandler<T = any> = (data: T, context: JobContext) => Promise<void> | void;
|
|
339
|
-
export interface JobDefinitionOptions {
|
|
340
|
-
/** Override queue binding */
|
|
341
|
-
binding?: string;
|
|
342
|
-
/** Max retries before dead-letter */
|
|
343
|
-
maxRetries?: number;
|
|
344
|
-
}
|
|
345
|
-
export interface JobDefinition<T = any> {
|
|
346
|
-
name: string;
|
|
347
|
-
handler: JobHandler<T>;
|
|
348
|
-
options?: JobDefinitionOptions;
|
|
349
|
-
}
|
|
350
|
-
export interface AppRateLimitRule {
|
|
351
|
-
/** Max requests permitted in the time window */
|
|
352
|
-
max?: number;
|
|
353
|
-
/** Time window (e.g. '1m', '10s', '1h', or seconds) */
|
|
354
|
-
window?: string | number;
|
|
355
|
-
/** Optional custom identifier/key or grouping */
|
|
356
|
-
key?: string;
|
|
357
|
-
}
|
|
358
|
-
export interface RateLimitCheckResult {
|
|
359
|
-
/** Whether the request is permitted */
|
|
360
|
-
success: boolean;
|
|
361
|
-
/** Number of remaining requests permitted in the current window */
|
|
362
|
-
remaining: number;
|
|
363
|
-
/** Max limit for this window */
|
|
364
|
-
limit: number;
|
|
365
|
-
/** Seconds until the rate limit window resets */
|
|
366
|
-
reset: number;
|
|
367
|
-
}
|
|
368
|
-
export interface CheckRateLimitOptions extends AppRateLimitRule {
|
|
369
|
-
/** Optional custom identifier/key to rate limit against (defaults to client IP + route path) */
|
|
370
|
-
key?: string;
|
|
371
|
-
/** Storage backend override ('auto' | 'kv' | 'memory') */
|
|
372
|
-
backend?: "auto" | "kv" | "memory";
|
|
373
|
-
/** Custom binding name override */
|
|
374
|
-
binding?: string;
|
|
375
|
-
/** Custom error message when rate limit is exceeded */
|
|
376
|
-
message?: string;
|
|
377
|
-
/** Explicit event context */
|
|
378
|
-
event?: any;
|
|
379
|
-
}
|
|
380
|
-
export interface AppRateLimitOptions extends RateLimitConfig {
|
|
381
|
-
/** Whether edge rate limiting is enabled. */
|
|
382
|
-
enabled?: boolean;
|
|
383
|
-
/** Whether rate limiting applies globally to all routes not matched by `rules`. */
|
|
384
|
-
global?: boolean;
|
|
385
|
-
/**
|
|
386
|
-
* Max requests permitted within default window.
|
|
387
|
-
*
|
|
388
|
-
* @default 100
|
|
389
|
-
*/
|
|
390
|
-
max?: number;
|
|
391
|
-
/**
|
|
392
|
-
* Default time window (e.g. '1m', '10s', '1h', or seconds).
|
|
393
|
-
*
|
|
394
|
-
* @default "1m"
|
|
395
|
-
*/
|
|
396
|
-
window?: string | number;
|
|
397
|
-
/** IP whitelist that bypasses rate limiting. */
|
|
398
|
-
ipWhitelist?: string[];
|
|
399
|
-
/**
|
|
400
|
-
* Per-route rate limiting rules mapping path patterns to rules.
|
|
401
|
-
*
|
|
402
|
-
* @example
|
|
403
|
-
* rules: {
|
|
404
|
-
* '/api/auth/**': { max: 5, window: '1m' },
|
|
405
|
-
* '/api/search': { max: 30, window: '1m' },
|
|
406
|
-
* }
|
|
407
|
-
*/
|
|
408
|
-
rules?: Record<string, AppRateLimitRule>;
|
|
409
|
-
/**
|
|
410
|
-
* Storage backend for rate limit counters.
|
|
411
|
-
*
|
|
412
|
-
* - 'auto': uses native Cloudflare RateLimiter binding if available, falls back to KV or memory
|
|
413
|
-
* - 'kv': Cloudflare KV
|
|
414
|
-
* - 'memory': in-memory sliding window
|
|
415
|
-
*
|
|
416
|
-
* @default "auto"
|
|
417
|
-
*/
|
|
418
|
-
backend?: "auto" | "kv" | "memory";
|
|
419
|
-
}
|
|
420
|
-
export * from "./types/ai";
|
|
421
|
-
import type { AgentsOptions, BotsOptions, McpOptions } from "./types/ai";
|
|
422
|
-
export interface AnalyticsOptions {
|
|
423
|
-
/**
|
|
424
|
-
* Cloudflare Analytics Engine binding name.
|
|
425
|
-
*
|
|
426
|
-
* @default "ANALYTICS"
|
|
427
|
-
*/
|
|
428
|
-
binding?: string;
|
|
429
|
-
/**
|
|
430
|
-
* Cloudflare Analytics Engine dataset name (used in wrangler.json). Defaults to
|
|
431
|
-
* `<binding-lowercase>-prod` in production, `<binding-lowercase>-local-dev` in dev.
|
|
432
|
-
*/
|
|
433
|
-
dataset?: string;
|
|
434
|
-
/**
|
|
435
|
-
* Cloudflare Account ID — required for the SQL API (read queries / dashboard). Falls back to
|
|
436
|
-
* `CLOUDFLARE_ACCOUNT_ID` environment variable.
|
|
437
|
-
*/
|
|
438
|
-
accountId?: string;
|
|
439
|
-
/**
|
|
440
|
-
* Cloudflare API token with Analytics Engine read permissions. Falls back to
|
|
441
|
-
* `CLOUDFLARE_API_TOKEN` environment variable.
|
|
442
|
-
*/
|
|
443
|
-
apiToken?: string;
|
|
444
|
-
/**
|
|
445
|
-
* Site identifier written to `indexes[0]` on every data point. Useful when a single AE dataset
|
|
446
|
-
* tracks multiple sites. Falls back to the request hostname.
|
|
447
|
-
*/
|
|
448
|
-
siteId?: string;
|
|
449
|
-
/**
|
|
450
|
-
* Automatically track a pageview on every non-API SSR request via a server middleware.
|
|
451
|
-
*
|
|
452
|
-
* @default true
|
|
453
|
-
*/
|
|
454
|
-
autoTrack?: boolean;
|
|
455
|
-
/**
|
|
456
|
-
* Base path for the analytics dashboard API routes.
|
|
457
|
-
*
|
|
458
|
-
* @default "/api/analytics"
|
|
459
|
-
*/
|
|
460
|
-
path?: string;
|
|
461
|
-
}
|
|
462
|
-
/** Time range shorthand for dashboard queries. */
|
|
463
|
-
export type AnalyticsRange = "1h" | "24h" | "7d" | "30d" | "90d";
|
|
464
|
-
/** A single time-series bucket returned by AE SQL queries. */
|
|
465
|
-
export interface AnalyticsTimeSeriesPoint {
|
|
466
|
-
date: string;
|
|
467
|
-
count: number;
|
|
468
|
-
}
|
|
469
|
-
/** Pageview summary returned by the dashboard API. */
|
|
470
|
-
export interface PageviewSummary {
|
|
471
|
-
total: number;
|
|
472
|
-
series: AnalyticsTimeSeriesPoint[];
|
|
473
|
-
}
|
|
474
|
-
/** KPI summary returned by `/api/analytics/summary`. */
|
|
475
|
-
export interface AnalyticsSummary {
|
|
476
|
-
pageviews: number;
|
|
477
|
-
visitors: number;
|
|
478
|
-
topPages: Array<{
|
|
479
|
-
path: string;
|
|
480
|
-
views: number;
|
|
481
|
-
}>;
|
|
482
|
-
topReferrers: Array<{
|
|
483
|
-
referrer: string;
|
|
484
|
-
count: number;
|
|
485
|
-
}>;
|
|
486
|
-
countries: Array<{
|
|
487
|
-
country: string;
|
|
488
|
-
count: number;
|
|
489
|
-
}>;
|
|
490
|
-
devices: {
|
|
491
|
-
mobile: number;
|
|
492
|
-
desktop: number;
|
|
493
|
-
bot: number;
|
|
494
|
-
};
|
|
495
|
-
}
|
|
496
|
-
/** Tracked event record returned by `/api/analytics/events`. */
|
|
497
|
-
export interface AnalyticsEventRecord {
|
|
498
|
-
name: string;
|
|
499
|
-
count: number;
|
|
500
|
-
lastSeen: string;
|
|
501
|
-
}
|
|
502
|
-
export type DomainStatus = "pending" | "active" | "error" | "deleting";
|
|
503
|
-
export type DomainSslStatus = "initializing" | "pending_validation" | "active" | "expired";
|
|
504
|
-
export type DomainProviderType = "cloudflare" | "custom";
|
|
505
|
-
export interface DomainVerificationRecord {
|
|
506
|
-
type: "cname" | "txt";
|
|
507
|
-
name: string;
|
|
508
|
-
value: string;
|
|
509
|
-
target?: string;
|
|
510
|
-
}
|
|
511
|
-
export interface CustomDomainRecord {
|
|
512
|
-
id: string;
|
|
513
|
-
tenantId: string;
|
|
514
|
-
domain: string;
|
|
515
|
-
status: DomainStatus;
|
|
516
|
-
sslStatus: DomainSslStatus;
|
|
517
|
-
verificationRecords?: DomainVerificationRecord[];
|
|
518
|
-
cnameTarget?: string;
|
|
519
|
-
cloudflareHostnameId?: string;
|
|
520
|
-
errorMessage?: string;
|
|
521
|
-
createdAt: number;
|
|
522
|
-
updatedAt: number;
|
|
523
|
-
}
|
|
524
|
-
export interface TenantRecord {
|
|
525
|
-
id: string;
|
|
526
|
-
slug: string;
|
|
527
|
-
name: string;
|
|
528
|
-
plan?: string;
|
|
529
|
-
organizationId?: string;
|
|
530
|
-
customDomain?: string;
|
|
531
|
-
logoUrl?: string;
|
|
532
|
-
metadata?: Record<string, any>;
|
|
533
|
-
createdAt: number;
|
|
534
|
-
updatedAt: number;
|
|
535
|
-
}
|
|
536
|
-
export interface MultitenantOptions {
|
|
537
|
-
/**
|
|
538
|
-
* Root / apex domain(s) for subdomain matching (e.g. "qarpeo.com" or ["qarpeo.com",
|
|
539
|
-
* "qarpeo.dev"]). Requests matching `<tenant>.<rootDomain>` will automatically resolve to that
|
|
540
|
-
* tenant slug.
|
|
541
|
-
*/
|
|
542
|
-
rootDomains?: string | string[];
|
|
543
|
-
/**
|
|
544
|
-
* Enable Custom Domains with automated SSL and DNS verification via Cloudflare for SaaS.
|
|
545
|
-
*
|
|
546
|
-
* @default true
|
|
547
|
-
*/
|
|
548
|
-
customDomains?: boolean;
|
|
549
|
-
/**
|
|
550
|
-
* Domain provider for custom hostnames and SSL certificate provisioning. Currently supports
|
|
551
|
-
* "cloudflare" (Cloudflare for SaaS Custom Hostnames API), with extensible architecture for other
|
|
552
|
-
* providers.
|
|
553
|
-
*
|
|
554
|
-
* @default "cloudflare"
|
|
555
|
-
*/
|
|
556
|
-
provider?: DomainProviderType;
|
|
557
|
-
/**
|
|
558
|
-
* Cloudflare Zone ID for Custom Hostnames API. Falls back to `CLOUDFLARE_ZONE_ID` environment
|
|
559
|
-
* variable.
|
|
560
|
-
*/
|
|
561
|
-
zoneId?: string;
|
|
562
|
-
/**
|
|
563
|
-
* Cloudflare API token with SSL and Custom Hostnames permissions. Falls back to
|
|
564
|
-
* `CLOUDFLARE_API_TOKEN` environment variable.
|
|
565
|
-
*/
|
|
566
|
-
apiToken?: string;
|
|
567
|
-
/** CNAME fallback target that custom domains must point to (e.g. "cname.myapp.com"). */
|
|
568
|
-
cnameTarget?: string;
|
|
569
|
-
/**
|
|
570
|
-
* Reserved tenant slugs that cannot be registered or resolved as subdomains.
|
|
571
|
-
*
|
|
572
|
-
* @default ["admin", "api", "app", "auth", "cms", "dashboard", "mail", "static", "studio", "www"]
|
|
573
|
-
*/
|
|
574
|
-
reservedSlugs?: string[];
|
|
575
|
-
/**
|
|
576
|
-
* Header name to check for tenant ID / slug override (useful for API and local dev testing).
|
|
577
|
-
*
|
|
578
|
-
* @default "x-tenant-id"
|
|
579
|
-
*/
|
|
580
|
-
headerName?: string;
|
|
581
|
-
/**
|
|
582
|
-
* Whether to allow header-based tenant override (`x-tenant-id`) in production. When `false`
|
|
583
|
-
* (default), header override is strictly disabled in production to prevent untrusted clients from
|
|
584
|
-
* spoofing tenant context.
|
|
585
|
-
*
|
|
586
|
-
* @default false
|
|
587
|
-
*/
|
|
588
|
-
allowHeaderOverrideInProduction?: boolean;
|
|
589
|
-
/**
|
|
590
|
-
* Base API path for tenant domain endpoints.
|
|
591
|
-
*
|
|
592
|
-
* @default "/api/tenants"
|
|
593
|
-
*/
|
|
594
|
-
path?: string;
|
|
595
|
-
/**
|
|
596
|
-
* KV binding name used for high-speed edge domain-to-tenant lookup cache.
|
|
597
|
-
*
|
|
598
|
-
* @default "KV"
|
|
599
|
-
*/
|
|
600
|
-
kvBinding?: string;
|
|
601
|
-
}
|
|
602
|
-
export type EmailTemplateName = "welcome" | "magic-link" | "otp" | "order-confirmation" | "invite" | "notification" | string;
|
|
603
|
-
export interface MailTemplateOptions {
|
|
604
|
-
brandColor?: string;
|
|
605
|
-
logoUrl?: string;
|
|
606
|
-
companyName?: string;
|
|
607
|
-
supportEmail?: string;
|
|
608
|
-
}
|
|
609
|
-
export interface EmailTemplateResult {
|
|
610
|
-
subject?: string;
|
|
611
|
-
html: string;
|
|
612
|
-
text?: string;
|
|
613
|
-
}
|
|
614
|
-
export type EmailTemplateHandler<T = any> = (data: T, branding?: MailTemplateOptions) => EmailTemplateResult | Promise<EmailTemplateResult>;
|
|
615
|
-
export interface MailTrackingOptions {
|
|
616
|
-
/**
|
|
617
|
-
* Track email open events via an invisible 1x1 tracking pixel.
|
|
618
|
-
*
|
|
619
|
-
* @default false
|
|
620
|
-
*/
|
|
621
|
-
opens?: boolean;
|
|
622
|
-
/**
|
|
623
|
-
* Track link clicks by rewriting outgoing HTML links.
|
|
624
|
-
*
|
|
625
|
-
* @default false
|
|
626
|
-
*/
|
|
627
|
-
clicks?: boolean;
|
|
628
|
-
/**
|
|
629
|
-
* Base URL used for tracking links and pixels (e.g. "https://myapp.com"). Defaults to request
|
|
630
|
-
* host or site URL.
|
|
631
|
-
*/
|
|
632
|
-
baseUrl?: string;
|
|
633
|
-
}
|
|
634
|
-
export type MailSuppressionReason = "bounce" | "complaint" | "unsubscribe" | "manual";
|
|
635
|
-
export type MailSuppressionType = "hard_bounce" | "soft_bounce" | "spam_complaint" | "unsubscribe" | "manual";
|
|
636
|
-
export interface MailSuppressionRecord {
|
|
637
|
-
id: string;
|
|
638
|
-
email: string;
|
|
639
|
-
reason: MailSuppressionReason;
|
|
640
|
-
type: MailSuppressionType;
|
|
641
|
-
source?: string;
|
|
642
|
-
metadata?: Record<string, any>;
|
|
643
|
-
createdAt: number;
|
|
644
|
-
updatedAt: number;
|
|
645
|
-
}
|
|
646
|
-
export interface MailSuppressionOptions {
|
|
647
|
-
/**
|
|
648
|
-
* Automatically add emails to the suppression list upon hard bounce, spam complaints, or
|
|
649
|
-
* unsubscribes.
|
|
650
|
-
*
|
|
651
|
-
* @default true
|
|
652
|
-
*/
|
|
653
|
-
autoSuppress?: boolean;
|
|
654
|
-
/**
|
|
655
|
-
* Enforce suppression checks prior to dispatching outgoing mail. Suppressed addresses are
|
|
656
|
-
* automatically filtered out to protect sender domain reputation.
|
|
657
|
-
*
|
|
658
|
-
* @default true
|
|
659
|
-
*/
|
|
660
|
-
enforce?: boolean;
|
|
661
|
-
/**
|
|
662
|
-
* Number of consecutive soft bounces before an address is permanently suppressed.
|
|
663
|
-
*
|
|
664
|
-
* @default 3
|
|
665
|
-
*/
|
|
666
|
-
softBounceThreshold?: number;
|
|
667
|
-
}
|
|
668
|
-
export interface MailUnsubscribeOptions {
|
|
669
|
-
/**
|
|
670
|
-
* Automatically generate and inject RFC 2369 & RFC 8058 compliant `List-Unsubscribe` and
|
|
671
|
-
* `List-Unsubscribe-Post: List-Unsubscribe=One-Click` headers.
|
|
672
|
-
*
|
|
673
|
-
* @default true
|
|
674
|
-
*/
|
|
675
|
-
enabled?: boolean;
|
|
676
|
-
/** Custom unsubscribe URL or base path (e.g. "https://myapp.com/api/mail/unsubscribe"). */
|
|
677
|
-
url?: string;
|
|
678
|
-
/** Mailto fallback address for List-Unsubscribe header (e.g. "unsubscribe@myapp.com"). */
|
|
679
|
-
email?: string;
|
|
680
|
-
/**
|
|
681
|
-
* Secret key used to sign HMAC tokens for unsubscribe links. Defaults to auth secret or session
|
|
682
|
-
* secret.
|
|
683
|
-
*/
|
|
684
|
-
secret?: string;
|
|
685
|
-
}
|
|
686
|
-
export interface SendMailRequest {
|
|
687
|
-
to: string | string[];
|
|
688
|
-
from?: string;
|
|
689
|
-
/** Email subject line. Optional when provided by a template. */
|
|
690
|
-
subject?: string;
|
|
691
|
-
template?: EmailTemplateName;
|
|
692
|
-
data?: Record<string, any>;
|
|
693
|
-
html?: string;
|
|
694
|
-
text?: string;
|
|
695
|
-
/** Markdown body content. Automatically parsed into responsive, email-client-safe HTML. */
|
|
696
|
-
markdown?: string;
|
|
697
|
-
replyTo?: string;
|
|
698
|
-
cc?: string | string[];
|
|
699
|
-
bcc?: string | string[];
|
|
700
|
-
headers?: Record<string, string>;
|
|
701
|
-
/** Queue this email for asynchronous background delivery via Cloudflare Queues. */
|
|
702
|
-
queue?: boolean;
|
|
703
|
-
/** Enable open/click tracking for this specific message. */
|
|
704
|
-
track?: boolean | {
|
|
705
|
-
opens?: boolean;
|
|
706
|
-
clicks?: boolean;
|
|
707
|
-
};
|
|
708
|
-
/** Arbitrary metadata associated with this message for tracking, analytics, and webhooks. */
|
|
709
|
-
metadata?: Record<string, any>;
|
|
710
|
-
/**
|
|
711
|
-
* Enable or customize RFC 2369 / RFC 8058 List-Unsubscribe headers for this message. Set alse to
|
|
712
|
-
* disable for transactional emails (e.g. OTP, password reset).
|
|
713
|
-
*/
|
|
714
|
-
unsubscribe?: boolean | {
|
|
715
|
-
url?: string;
|
|
716
|
-
email?: string;
|
|
717
|
-
};
|
|
718
|
-
/**
|
|
719
|
-
* Whether to check the suppression list before sending. Set alse to bypass suppression checks for
|
|
720
|
-
* critical security or transactional emails.
|
|
721
|
-
*
|
|
722
|
-
* @default true
|
|
723
|
-
*/
|
|
724
|
-
suppression?: boolean;
|
|
725
|
-
}
|
|
726
|
-
export interface MailResult {
|
|
727
|
-
success: boolean;
|
|
728
|
-
messageId: string;
|
|
729
|
-
timestamp: number;
|
|
730
|
-
previewUrl?: string;
|
|
731
|
-
queued?: boolean;
|
|
732
|
-
/** Whether the send was skipped because all recipients are suppressed */
|
|
733
|
-
suppressed?: boolean;
|
|
734
|
-
/** List of recipient addresses that were suppressed and excluded from delivery */
|
|
735
|
-
suppressedRecipients?: string[];
|
|
736
|
-
}
|
|
737
|
-
export interface MailOptions {
|
|
738
|
-
/** Default sender address (e.g. "My App [noreply@myapp.com](mailto:noreply@myapp.com)"). */
|
|
739
|
-
from?: string;
|
|
740
|
-
/**
|
|
741
|
-
* Delivery provider.
|
|
742
|
-
*
|
|
743
|
-
* - 'cloudflare': Cloudflare send_email binding (default)
|
|
744
|
-
* - 'resend': Resend API
|
|
745
|
-
* - 'postmark': Postmark API
|
|
746
|
-
* - 'dev': In-memory dev mailbox intercept only
|
|
747
|
-
*
|
|
748
|
-
* @default "cloudflare"
|
|
749
|
-
*/
|
|
750
|
-
provider?: "cloudflare" | "resend" | "postmark" | "dev";
|
|
751
|
-
/** API Key for external providers (Resend, Postmark). */
|
|
752
|
-
apiKey?: string;
|
|
753
|
-
/** Branding options applied to built-in email templates. */
|
|
754
|
-
branding?: MailTemplateOptions;
|
|
755
|
-
/**
|
|
756
|
-
* Enable in-browser Dev Mailbox preview during local development.
|
|
757
|
-
*
|
|
758
|
-
* @default true
|
|
759
|
-
*/
|
|
760
|
-
devMailbox?: boolean;
|
|
761
|
-
/**
|
|
762
|
-
* Enable queue-backed background email delivery using Cloudflare Queues. When true, messages sent
|
|
763
|
-
* with sendMail are enqueued and delivered asynchronously with automatic retries and exponential
|
|
764
|
-
* backoff.
|
|
765
|
-
*
|
|
766
|
-
* @default false
|
|
767
|
-
*/
|
|
768
|
-
queue?: boolean | string;
|
|
769
|
-
/** Configure open and click tracking. */
|
|
770
|
-
tracking?: MailTrackingOptions;
|
|
771
|
-
/**
|
|
772
|
-
* Email suppression list configuration for managing bounces, spam complaints, and unsubscribes.
|
|
773
|
-
*
|
|
774
|
-
* @default true
|
|
775
|
-
*/
|
|
776
|
-
suppression?: boolean | MailSuppressionOptions;
|
|
777
|
-
/**
|
|
778
|
-
* RFC 2369 & RFC 8058 compliant List-Unsubscribe and one-click unsubscribe configuration.
|
|
779
|
-
*
|
|
780
|
-
* @default true
|
|
781
|
-
*/
|
|
782
|
-
unsubscribe?: boolean | MailUnsubscribeOptions;
|
|
783
|
-
}
|
|
784
|
-
export interface CachedFunctionOptions<Args extends any[] = any[]> {
|
|
785
|
-
/**
|
|
786
|
-
* Unique cache key string or key generator function.
|
|
787
|
-
* If omitted, defaults to `name` or the function name.
|
|
788
|
-
*/
|
|
789
|
-
key?: string | ((...args: Args) => string);
|
|
790
|
-
/**
|
|
791
|
-
* Key prefix or function name. Matches Nitro defineCachedFunction convention.
|
|
792
|
-
*/
|
|
793
|
-
name?: string;
|
|
794
|
-
/**
|
|
795
|
-
* Custom key generator function based on arguments. Matches Nitro defineCachedFunction convention.
|
|
796
|
-
*/
|
|
797
|
-
getKey?: (...args: Args) => string;
|
|
798
|
-
/**
|
|
799
|
-
* Maximum age / TTL duration (e.g. 300, '5m', '1h', '7d'). Matches Nitro defineCachedFunction convention.
|
|
800
|
-
*
|
|
801
|
-
* @default 3600
|
|
802
|
-
*/
|
|
803
|
-
maxAge?: string | number;
|
|
804
|
-
/** Time-To-Live duration (alias for `maxAge`) */
|
|
805
|
-
ttl?: string | number;
|
|
806
|
-
/** Stale-While-Revalidate duration allowing serving stale data during background fetch */
|
|
807
|
-
swr?: string | number | boolean;
|
|
808
|
-
/** Semantic cache tags for group invalidation via purgeCacheTag() */
|
|
809
|
-
tags?: string[] | ((...args: Args) => string[]);
|
|
810
|
-
}
|
|
811
|
-
export type RememberCacheOptions<Args extends any[] = any[]> = CachedFunctionOptions<Args>;
|
|
812
|
-
export interface CacheOptions {
|
|
813
|
-
/**
|
|
814
|
-
* Cloudflare KV binding name override for cache storage.
|
|
815
|
-
*
|
|
816
|
-
* @default "CACHE"
|
|
817
|
-
*/
|
|
818
|
-
binding?: string;
|
|
819
|
-
/**
|
|
820
|
-
* Key prefix for cache entries in KV.
|
|
821
|
-
*
|
|
822
|
-
* @default "nitro:cache:"
|
|
823
|
-
*/
|
|
824
|
-
base?: string;
|
|
825
|
-
/**
|
|
826
|
-
* Default Time-To-Live for cached items when not explicitly specified. Accepts number (seconds)
|
|
827
|
-
* or human string (e.g. '1h', '30m', '1d').
|
|
828
|
-
*
|
|
829
|
-
* @default "1h"
|
|
830
|
-
*/
|
|
831
|
-
defaultTtl?: string | number;
|
|
832
|
-
/**
|
|
833
|
-
* Automatically configure Stale-While-Revalidate (SWR) headers for cached responses.
|
|
834
|
-
*
|
|
835
|
-
* @default true
|
|
836
|
-
*/
|
|
837
|
-
swr?: boolean;
|
|
838
|
-
}
|
|
839
|
-
export type BlobAccessTier = "public" | "unlisted" | "private";
|
|
840
|
-
export interface SignedDownloadUrlOptions {
|
|
841
|
-
/** Expiration duration (e.g. '1h', '15m', '7d', or seconds) */
|
|
842
|
-
expiresIn?: string | number;
|
|
843
|
-
/** Force browser download attachment */
|
|
844
|
-
download?: boolean;
|
|
845
|
-
/** Custom download filename override */
|
|
846
|
-
filename?: string;
|
|
847
|
-
}
|
|
848
|
-
export interface StorageOptions {
|
|
849
|
-
/**
|
|
850
|
-
* Custom Cloudflare R2 binding name.
|
|
851
|
-
*
|
|
852
|
-
* @default "BLOB"
|
|
853
|
-
*/
|
|
854
|
-
binding?: string;
|
|
855
|
-
/**
|
|
856
|
-
* Base route prefix for auto-injected storage endpoints.
|
|
857
|
-
*
|
|
858
|
-
* @default "/api/storage"
|
|
859
|
-
*/
|
|
860
|
-
prefix?: string;
|
|
861
|
-
/**
|
|
862
|
-
* Custom public CDN domain or URL prefix (e.g. 'https://cdn.example.com'). If omitted, files are
|
|
863
|
-
* served through Qarpeo's edge handler.
|
|
864
|
-
*/
|
|
865
|
-
cdnUrl?: string;
|
|
866
|
-
/**
|
|
867
|
-
* Maximum allowed file upload size. Accepts number (bytes) or human string (e.g. '10MB',
|
|
868
|
-
* '500KB').
|
|
869
|
-
*
|
|
870
|
-
* @default "20MB"
|
|
871
|
-
*/
|
|
872
|
-
maxSize?: string | number;
|
|
873
|
-
/**
|
|
874
|
-
* Allowed MIME types for uploaded files (e.g. ['image/*', 'application/pdf']).
|
|
875
|
-
*
|
|
876
|
-
* @default ["*"]
|
|
877
|
-
*/
|
|
878
|
-
allowedTypes?: string[];
|
|
879
|
-
/**
|
|
880
|
-
* Automatic directory scoping for multi-tenancy.
|
|
881
|
-
*
|
|
882
|
-
* - 'org': files stored under `org_${orgId}/`
|
|
883
|
-
* - 'user': files stored under `user_${userId}/`
|
|
884
|
-
* - 'public': files stored directly under root prefix
|
|
885
|
-
*
|
|
886
|
-
* @default "public"
|
|
887
|
-
*/
|
|
888
|
-
scope?: "org" | "user" | "public";
|
|
889
|
-
/**
|
|
890
|
-
* Default access tier for newly uploaded files.
|
|
891
|
-
*
|
|
892
|
-
* - 'public': accessible to anyone
|
|
893
|
-
* - 'unlisted': accessible via token-signed URL only
|
|
894
|
-
* - 'private': guarded by session & authentication
|
|
895
|
-
*
|
|
896
|
-
* @default "public"
|
|
897
|
-
*/
|
|
898
|
-
defaultAccess?: BlobAccessTier;
|
|
899
|
-
/**
|
|
900
|
-
* Whether unauthenticated callers are allowed to generate presigned upload tickets. Defaults to
|
|
901
|
-
* false (authentication required).
|
|
902
|
-
*
|
|
903
|
-
* @default false
|
|
904
|
-
*/
|
|
905
|
-
allowAnonymousUploads?: boolean;
|
|
906
|
-
/** Cloudflare Image Resizing / optimization presets and settings. */
|
|
907
|
-
images?: {
|
|
908
|
-
/**
|
|
909
|
-
* Enable Cloudflare Image Resizing (/cdn-cgi/image/...) on served URLs.
|
|
910
|
-
*
|
|
911
|
-
* @default true
|
|
912
|
-
*/
|
|
913
|
-
resizing?: boolean;
|
|
914
|
-
/**
|
|
915
|
-
* Named transformation presets.
|
|
916
|
-
*
|
|
917
|
-
* @example
|
|
918
|
-
* presets: {
|
|
919
|
-
* thumbnail: { width: 150, height: 150, format: "webp" },
|
|
920
|
-
* banner: { width: 1200, height: 400, quality: 85 }
|
|
921
|
-
* }
|
|
922
|
-
*/
|
|
923
|
-
presets?: Record<string, StorageImagePreset>;
|
|
924
|
-
};
|
|
925
|
-
/**
|
|
926
|
-
* Automatically integrate `<BlobImage>` with Nuxt UI components (`<UAvatar>`, `<UCard>`, etc.) so
|
|
927
|
-
* their `src` props resolve R2 storage keys without custom slots.
|
|
928
|
-
*
|
|
929
|
-
* - When `@nuxt/image` is installed, Qarpeo registers its built-in image provider and optionally
|
|
930
|
-
* sets it as the default provider.
|
|
931
|
-
* - When `@nuxt/image` is **not** installed, Qarpeo aliases Nuxt UI's internal image component to
|
|
932
|
-
* `<BlobImage>` via `#build/ui-image-component`.
|
|
933
|
-
*
|
|
934
|
-
* Set to `false` to opt out of all automatic Nuxt UI / image integration.
|
|
935
|
-
*
|
|
936
|
-
* @default true
|
|
937
|
-
*/
|
|
938
|
-
ui?: boolean;
|
|
939
|
-
/**
|
|
940
|
-
* When `@nuxt/image` is **also** installed, alias Nuxt UI's image slot to `<BlobImage>` anyway
|
|
941
|
-
* (via `components:extend`), so that the Qarpeo provider is always used even if another provider
|
|
942
|
-
* is the global default.
|
|
943
|
-
*
|
|
944
|
-
* Ignored when `ui` is `false`.
|
|
945
|
-
*
|
|
946
|
-
* @default false
|
|
947
|
-
*/
|
|
948
|
-
uiImage?: boolean;
|
|
949
|
-
}
|
|
950
|
-
export type BlobOptions = StorageOptions;
|
|
951
|
-
export interface UploadedFile {
|
|
952
|
-
key: string;
|
|
953
|
-
pathname: string;
|
|
954
|
-
url: string;
|
|
955
|
-
size: number;
|
|
956
|
-
type: string;
|
|
957
|
-
etag: string;
|
|
958
|
-
access?: BlobAccessTier;
|
|
959
|
-
customMetadata?: Record<string, string>;
|
|
960
|
-
}
|
|
961
|
-
export interface ResumableUploadSession {
|
|
962
|
-
uploadId: string;
|
|
963
|
-
key: string;
|
|
964
|
-
pathname: string;
|
|
965
|
-
chunkSize: number;
|
|
966
|
-
totalParts: number;
|
|
967
|
-
fileSize: number;
|
|
968
|
-
type: string;
|
|
969
|
-
access: BlobAccessTier;
|
|
970
|
-
expiresAt: number;
|
|
971
|
-
}
|
|
972
|
-
export interface ResumableUploadOptions {
|
|
973
|
-
filename?: string;
|
|
974
|
-
chunkSize?: number;
|
|
975
|
-
access?: BlobAccessTier;
|
|
976
|
-
customMetadata?: Record<string, string>;
|
|
977
|
-
onProgress?: (progress: number, uploadedBytes: number, totalBytes: number) => void;
|
|
978
|
-
onSuccess?: (result: any) => void;
|
|
979
|
-
onError?: (error: Error) => void;
|
|
980
|
-
}
|
|
981
|
-
export interface UseResumableUploadReturn {
|
|
982
|
-
upload: (file: File | Blob, options?: ResumableUploadOptions) => Promise<any>;
|
|
983
|
-
pause: () => void;
|
|
984
|
-
resume: () => Promise<any>;
|
|
985
|
-
abort: () => Promise<void>;
|
|
986
|
-
isUploading: any;
|
|
987
|
-
isPaused: any;
|
|
988
|
-
progress: any;
|
|
989
|
-
uploadedBytes: any;
|
|
990
|
-
totalBytes: any;
|
|
991
|
-
currentPart: any;
|
|
992
|
-
totalParts: any;
|
|
993
|
-
error: any;
|
|
994
|
-
reset: () => void;
|
|
995
|
-
}
|
|
996
|
-
export * from "./types/cms";
|
|
997
|
-
import type { CMSOptions } from "./types/cms";
|
|
998
|
-
export interface RealtimeOptions {
|
|
999
|
-
/**
|
|
1000
|
-
* Base route path for WebSocket connections.
|
|
1001
|
-
*
|
|
1002
|
-
* @default "/api/realtime/ws"
|
|
1003
|
-
*/
|
|
1004
|
-
path?: string;
|
|
1005
|
-
/**
|
|
1006
|
-
* Cloudflare Durable Object binding name.
|
|
1007
|
-
*
|
|
1008
|
-
* @default "QARPEO_ROOM_DO"
|
|
1009
|
-
*/
|
|
1010
|
-
binding?: string;
|
|
1011
|
-
/**
|
|
1012
|
-
* Enable presence tracking (automatic join/leave events and active roster sync).
|
|
1013
|
-
*
|
|
1014
|
-
* @default true
|
|
1015
|
-
*/
|
|
1016
|
-
presence?: boolean;
|
|
1017
|
-
/**
|
|
1018
|
-
* Require authenticated session to connect to rooms.
|
|
1019
|
-
*
|
|
1020
|
-
* @default false
|
|
1021
|
-
*/
|
|
1022
|
-
requireAuth?: boolean;
|
|
1023
|
-
/**
|
|
1024
|
-
* Alias for `requireAuth`. Require authenticated session to connect to rooms.
|
|
1025
|
-
*
|
|
1026
|
-
* @default false
|
|
1027
|
-
*/
|
|
1028
|
-
auth?: boolean;
|
|
1029
|
-
/**
|
|
1030
|
-
* Maximum concurrent WebSocket connections allowed per room.
|
|
1031
|
-
*
|
|
1032
|
-
* @default 100
|
|
1033
|
-
*/
|
|
1034
|
-
maxConnectionsPerRoom?: number;
|
|
1035
|
-
/**
|
|
1036
|
-
* Maximum recent messages retained in the room's replay buffer in Durable Object storage.
|
|
1037
|
-
*
|
|
1038
|
-
* @default 50
|
|
1039
|
-
*/
|
|
1040
|
-
historyLimit?: number;
|
|
1041
|
-
/**
|
|
1042
|
-
* Ping/heartbeat interval in milliseconds.
|
|
1043
|
-
*
|
|
1044
|
-
* @default 30000
|
|
1045
|
-
*/
|
|
1046
|
-
heartbeatInterval?: number;
|
|
1047
|
-
/** Alias for heartbeatInterval. */
|
|
1048
|
-
heartbeat?: number;
|
|
1049
|
-
/** Auto-reconnect enabled by default on client composable. */
|
|
1050
|
-
reconnect?: boolean;
|
|
1051
|
-
/** Replay unreceived messages automatically on reconnect using sequence numbers. @default true */
|
|
1052
|
-
replayOnReconnect?: boolean;
|
|
1053
|
-
}
|
|
1054
|
-
export interface RealtimePeer {
|
|
1055
|
-
id: string;
|
|
1056
|
-
roomId: string;
|
|
1057
|
-
ctx: {
|
|
1058
|
-
user: RealtimeUser | Record<string, any> | null;
|
|
1059
|
-
[key: string]: any;
|
|
1060
|
-
};
|
|
1061
|
-
}
|
|
1062
|
-
export interface RealtimeHandlerOptions {
|
|
1063
|
-
connect?(peer: RealtimePeer): void | Promise<void>;
|
|
1064
|
-
disconnect?(peer: RealtimePeer): void | Promise<void>;
|
|
1065
|
-
message?(peer: RealtimePeer, event: string, payload: any): void | Promise<void>;
|
|
1066
|
-
}
|
|
1067
|
-
export interface RealtimeHandlerRegistration {
|
|
1068
|
-
pattern: string;
|
|
1069
|
-
handlers: RealtimeHandlerOptions;
|
|
1070
|
-
}
|
|
1071
|
-
export interface RealtimeUser<TPresence = Record<string, any>> {
|
|
1072
|
-
id: string;
|
|
1073
|
-
name?: string | null;
|
|
1074
|
-
avatar?: string | null;
|
|
1075
|
-
metadata?: Record<string, unknown>;
|
|
1076
|
-
presence?: TPresence;
|
|
1077
|
-
joinedAt: number;
|
|
1078
|
-
isAnonymous?: boolean;
|
|
1079
|
-
}
|
|
1080
|
-
export interface RealtimeMessage<T = unknown> {
|
|
1081
|
-
type: "message" | "presence:sync" | "presence:join" | "presence:leave" | "presence:update" | "state:sync" | "state:set" | "state:patch" | "history:sync" | "ping" | "pong";
|
|
1082
|
-
event?: string;
|
|
1083
|
-
payload?: T;
|
|
1084
|
-
sender?: string;
|
|
1085
|
-
user?: RealtimeUser;
|
|
1086
|
-
presence?: RealtimeUser[];
|
|
1087
|
-
state?: Record<string, any>;
|
|
1088
|
-
history?: RealtimeMessage[];
|
|
1089
|
-
id?: string;
|
|
1090
|
-
seq?: number;
|
|
1091
|
-
replay?: boolean;
|
|
1092
|
-
lastSeq?: number;
|
|
1093
|
-
timestamp?: number;
|
|
1094
|
-
}
|
|
1095
|
-
/** Defines a type-safe schema definition for a room's synchronized state. */
|
|
1096
|
-
export interface RoomStateSchema<T extends Record<string, any> = Record<string, any>> {
|
|
1097
|
-
name?: string;
|
|
1098
|
-
initialState?: T;
|
|
1099
|
-
validator?: (state: unknown) => state is T;
|
|
1100
|
-
}
|
|
1101
|
-
export interface UsePresenceOptions<T extends Record<string, any> = Record<string, any>> {
|
|
1102
|
-
/** Initial presence state */
|
|
1103
|
-
initial?: T;
|
|
1104
|
-
/** Minimum interval in milliseconds between broadcast updates (throttling). @default 50 */
|
|
1105
|
-
throttle?: number;
|
|
1106
|
-
}
|
|
1107
|
-
export interface UsePresenceReturn<T extends Record<string, any> = Record<string, any>> {
|
|
1108
|
-
/** My own current presence state */
|
|
1109
|
-
myPresence: any;
|
|
1110
|
-
/** Update my presence state (throttled) */
|
|
1111
|
-
updatePresence: (partial: Partial<T>) => void;
|
|
1112
|
-
/** Connected peers in the room with their presence data (excluding self) */
|
|
1113
|
-
peers: any;
|
|
1114
|
-
/** Total number of online peers including self */
|
|
1115
|
-
onlineCount: any;
|
|
1116
|
-
/** All connected users including self */
|
|
1117
|
-
presence: any;
|
|
1118
|
-
/** Helper to track and broadcast mouse/cursor coordinates on an element or window */
|
|
1119
|
-
onCursorMove: (e: {
|
|
1120
|
-
clientX: number;
|
|
1121
|
-
clientY: number;
|
|
1122
|
-
}) => void;
|
|
1123
|
-
}
|
|
1124
|
-
export interface UseRoomStateReturn<T extends Record<string, any> = Record<string, any>> {
|
|
1125
|
-
/** Current synchronized room state */
|
|
1126
|
-
state: any;
|
|
1127
|
-
/** Replace entire room state */
|
|
1128
|
-
setState: (newState: T) => void;
|
|
1129
|
-
/** Merge partial update into room state */
|
|
1130
|
-
patchState: (partial: Partial<T>) => void;
|
|
1131
|
-
/** Whether initial state sync has completed */
|
|
1132
|
-
synced: any;
|
|
1133
|
-
}
|
|
1134
|
-
export type PaymentProvider = "stripe" | "lemonsqueezy" | "polar" | "paddle";
|
|
1135
|
-
export type SubscriptionStatus = "active" | "trialing" | "past_due" | "canceled" | "unpaid" | "incomplete" | "paused";
|
|
1136
|
-
export interface PaymentPlanConfig {
|
|
1137
|
-
name: string;
|
|
1138
|
-
priceId: string;
|
|
1139
|
-
features?: string[];
|
|
1140
|
-
limits?: Record<string, number>;
|
|
1141
|
-
}
|
|
1142
|
-
export interface PaymentsOptions {
|
|
1143
|
-
/**
|
|
1144
|
-
* Payment provider backend.
|
|
1145
|
-
*
|
|
1146
|
-
* @default "stripe"
|
|
1147
|
-
*/
|
|
1148
|
-
provider?: PaymentProvider;
|
|
1149
|
-
/**
|
|
1150
|
-
* Secret API key for provider. Defaults to process.env.STRIPE_SECRET_KEY, LEMONSQUEEZY_API_KEY,
|
|
1151
|
-
* POLAR_ACCESS_TOKEN.
|
|
1152
|
-
*/
|
|
1153
|
-
secretKey?: string;
|
|
1154
|
-
/** Webhook signing secret. Defaults to process.env.STRIPE_WEBHOOK_SECRET, etc. */
|
|
1155
|
-
webhookSecret?: string;
|
|
1156
|
-
/**
|
|
1157
|
-
* Base route prefix for payments endpoints.
|
|
1158
|
-
*
|
|
1159
|
-
* @default "/api/payments"
|
|
1160
|
-
*/
|
|
1161
|
-
prefix?: string;
|
|
1162
|
-
/** Default trial period in days for new subscriptions. */
|
|
1163
|
-
trialDays?: number;
|
|
1164
|
-
/** Default 3-letter currency code (e.g. 'usd', 'eur'). */
|
|
1165
|
-
currency?: string;
|
|
1166
|
-
/** Predefined plans mapping plan identifiers to price IDs and features. */
|
|
1167
|
-
plans?: Record<string, PaymentPlanConfig>;
|
|
1168
|
-
/**
|
|
1169
|
-
* Default return URL after customer billing portal session completes.
|
|
1170
|
-
*
|
|
1171
|
-
* @default "/"
|
|
1172
|
-
*/
|
|
1173
|
-
portalReturnUrl?: string;
|
|
1174
|
-
/** Default redirect URLs for checkout sessions. */
|
|
1175
|
-
checkoutUrls?: {
|
|
1176
|
-
success?: string;
|
|
1177
|
-
cancel?: string;
|
|
1178
|
-
};
|
|
1179
|
-
/** Paddle configuration options (environment, clientToken). */
|
|
1180
|
-
paddle?: {
|
|
1181
|
-
environment?: "sandbox" | "production";
|
|
1182
|
-
clientToken?: string;
|
|
1183
|
-
};
|
|
1184
|
-
}
|
|
1185
|
-
export interface QarpeoCustomer {
|
|
1186
|
-
id: string;
|
|
1187
|
-
userId: string;
|
|
1188
|
-
orgId?: string | null;
|
|
1189
|
-
provider: PaymentProvider;
|
|
1190
|
-
customerId: string;
|
|
1191
|
-
email: string;
|
|
1192
|
-
name?: string | null;
|
|
1193
|
-
metadataJson?: string | null;
|
|
1194
|
-
createdAt: number;
|
|
1195
|
-
updatedAt: number;
|
|
1196
|
-
}
|
|
1197
|
-
export interface QarpeoSubscription {
|
|
1198
|
-
id: string;
|
|
1199
|
-
customerId: string;
|
|
1200
|
-
userId: string;
|
|
1201
|
-
orgId?: string | null;
|
|
1202
|
-
provider: PaymentProvider;
|
|
1203
|
-
subscriptionId: string;
|
|
1204
|
-
planId: string;
|
|
1205
|
-
priceId: string;
|
|
1206
|
-
status: SubscriptionStatus;
|
|
1207
|
-
quantity: number;
|
|
1208
|
-
cancelAtPeriodEnd: boolean;
|
|
1209
|
-
currentPeriodStart: number;
|
|
1210
|
-
currentPeriodEnd: number;
|
|
1211
|
-
trialEnd?: number | null;
|
|
1212
|
-
canceledAt?: number | null;
|
|
1213
|
-
metadata?: Record<string, any>;
|
|
1214
|
-
metadataJson?: string | null;
|
|
1215
|
-
createdAt: number;
|
|
1216
|
-
updatedAt: number;
|
|
1217
|
-
}
|
|
1218
|
-
export interface CreateCheckoutOptions {
|
|
1219
|
-
planId?: string;
|
|
1220
|
-
priceId?: string;
|
|
1221
|
-
mode?: "subscription" | "payment" | "setup";
|
|
1222
|
-
trialDays?: number;
|
|
1223
|
-
currency?: string;
|
|
1224
|
-
successUrl?: string;
|
|
1225
|
-
cancelUrl?: string;
|
|
1226
|
-
customerEmail?: string;
|
|
1227
|
-
metadata?: Record<string, string>;
|
|
1228
|
-
}
|
|
1229
|
-
export interface QarpeoWebhookEvent {
|
|
1230
|
-
id: string;
|
|
1231
|
-
eventId: string;
|
|
1232
|
-
provider: PaymentProvider;
|
|
1233
|
-
eventType: string;
|
|
1234
|
-
createdAt: number;
|
|
1235
|
-
}
|
|
1236
|
-
export interface MeterRecordOptions {
|
|
1237
|
-
/** Optional user ID (defaults to current authenticated user) */
|
|
1238
|
-
userId?: string;
|
|
1239
|
-
/** Optional organization ID (defaults to current organization) */
|
|
1240
|
-
orgId?: string;
|
|
1241
|
-
/** Customer ID from payment provider */
|
|
1242
|
-
customerId?: string;
|
|
1243
|
-
/** Subscription ID from payment provider */
|
|
1244
|
-
subscriptionId?: string;
|
|
1245
|
-
/** Meter event or feature name (e.g. "api_requests", "tokens_generated", "storage_gb") */
|
|
1246
|
-
eventName: string;
|
|
1247
|
-
/** Quantity of units consumed (e.g. 100, 1) */
|
|
1248
|
-
quantity: number;
|
|
1249
|
-
/** Action: 'increment' (delta counter, default) or 'set' (absolute gauge) */
|
|
1250
|
-
action?: "increment" | "set";
|
|
1251
|
-
/** Timestamp of usage occurrence (defaults to now) */
|
|
1252
|
-
timestamp?: number;
|
|
1253
|
-
/** Custom metadata associated with this usage record */
|
|
1254
|
-
metadata?: Record<string, any>;
|
|
1255
|
-
}
|
|
1256
|
-
export interface MeterUsageResult {
|
|
1257
|
-
success: boolean;
|
|
1258
|
-
id: string;
|
|
1259
|
-
eventName: string;
|
|
1260
|
-
quantity: number;
|
|
1261
|
-
total?: number;
|
|
1262
|
-
timestamp: number;
|
|
1263
|
-
}
|
|
1264
|
-
export interface UsageSummary {
|
|
1265
|
-
eventName: string;
|
|
1266
|
-
total: number;
|
|
1267
|
-
count: number;
|
|
1268
|
-
limit?: number;
|
|
1269
|
-
remaining?: number;
|
|
1270
|
-
periodStart?: number;
|
|
1271
|
-
periodEnd?: number;
|
|
1272
|
-
records?: Array<{
|
|
1273
|
-
id: string;
|
|
1274
|
-
quantity: number;
|
|
1275
|
-
timestamp: number;
|
|
1276
|
-
metadata?: Record<string, any>;
|
|
1277
|
-
}>;
|
|
1278
|
-
}
|
|
1279
|
-
export interface DocsSearchSection {
|
|
1280
|
-
/** Unique ID for search result item (e.g. "/docs/features/payments#paddle") */
|
|
1281
|
-
id: string;
|
|
1282
|
-
/** Canonical entry path */
|
|
1283
|
-
path: string;
|
|
1284
|
-
/** Section heading title (or page title if lead section) */
|
|
1285
|
-
title: string;
|
|
1286
|
-
/** Overall document page title */
|
|
1287
|
-
pageTitle: string;
|
|
1288
|
-
/** Breadcrumb hierarchy of titles */
|
|
1289
|
-
titles: string[];
|
|
1290
|
-
/** Clean highlighted text excerpt */
|
|
1291
|
-
content: string;
|
|
1292
|
-
/** Hash anchor for heading (e.g. "#webhooks") */
|
|
1293
|
-
section?: string;
|
|
1294
|
-
/** Locale of the document (e.g. "en", "es") */
|
|
1295
|
-
locale?: string;
|
|
1296
|
-
/** Heading level (1 for h1/title, 2 for h2, 3 for h3) */
|
|
1297
|
-
level?: number;
|
|
1298
|
-
/** Relevance match score */
|
|
1299
|
-
score: number;
|
|
1300
|
-
}
|
|
1301
|
-
export interface DocsSearchResponse {
|
|
1302
|
-
results: DocsSearchSection[];
|
|
1303
|
-
total: number;
|
|
1304
|
-
query: string;
|
|
1305
|
-
/** Search execution engine used */
|
|
1306
|
-
mode?: "fts" | "like";
|
|
1307
|
-
}
|
|
1308
|
-
export interface DocsSearchOptions {
|
|
1309
|
-
q?: string;
|
|
1310
|
-
locale?: string;
|
|
1311
|
-
collection?: string;
|
|
1312
|
-
limit?: number;
|
|
1313
|
-
version?: string;
|
|
1314
|
-
/** Search mode: 'fts' (default), 'like', or 'semantic' */
|
|
1315
|
-
mode?: "fts" | "like" | "semantic";
|
|
1316
|
-
}
|
|
1317
|
-
export interface CMSLocaleConfig {
|
|
1318
|
-
code: string;
|
|
1319
|
-
name: string;
|
|
1320
|
-
flag?: string;
|
|
1321
|
-
dir?: "ltr" | "rtl";
|
|
1322
|
-
}
|
|
1323
|
-
export interface DocsVersionItem {
|
|
1324
|
-
/** Version identifier (e.g. 'latest', 'v1', 'v2', 'next') */
|
|
1325
|
-
id: string;
|
|
1326
|
-
/** Display label in the version switcher (e.g. 'v2 (latest)', 'v1.x') */
|
|
1327
|
-
label: string;
|
|
1328
|
-
/** URL path prefix (e.g. '/docs', '/docs/v1') */
|
|
1329
|
-
prefix: string;
|
|
1330
|
-
/** Whether this is the active latest version */
|
|
1331
|
-
isLatest?: boolean;
|
|
1332
|
-
/** Whether this version is archived / deprecated */
|
|
1333
|
-
isArchived?: boolean;
|
|
1334
|
-
}
|
|
1335
|
-
export interface SiteRobotsConfig {
|
|
1336
|
-
/**
|
|
1337
|
-
* Allow search engines to index the site. When false, generates Disallow: / on robots.txt and
|
|
1338
|
-
* noindex meta.
|
|
1339
|
-
*/
|
|
1340
|
-
index?: boolean;
|
|
1341
|
-
/** Paths to disallow in robots.txt. Defaults to ["/api/", "/devtools/", "/_qarpeo/"] */
|
|
1342
|
-
disallow?: string[];
|
|
1343
|
-
/** Paths to allow in robots.txt. Defaults to ["/"] */
|
|
1344
|
-
allow?: string[];
|
|
1345
|
-
}
|
|
1346
|
-
export interface SiteSitemapUrl {
|
|
1347
|
-
loc: string;
|
|
1348
|
-
lastmod?: string;
|
|
1349
|
-
changefreq?: "always" | "hourly" | "daily" | "weekly" | "monthly" | "yearly" | "never";
|
|
1350
|
-
priority?: number;
|
|
1351
|
-
}
|
|
1352
|
-
export interface SiteSitemapConfig {
|
|
1353
|
-
/** Automatically generate /sitemap.xml. Defaults to true when site.url is provided. */
|
|
1354
|
-
enabled?: boolean;
|
|
1355
|
-
/** Paths to exclude from /sitemap.xml (supports wildcards, e.g. ["/api/**", "/_qarpeo/**"]) */
|
|
1356
|
-
exclude?: string[];
|
|
1357
|
-
/** Include published CMS entries from D1 database. Defaults to true. */
|
|
1358
|
-
cms?: boolean;
|
|
1359
|
-
/** Additional custom URLs to include in sitemap */
|
|
1360
|
-
urls?: SiteSitemapUrl[];
|
|
1361
|
-
}
|
|
1362
|
-
export interface SiteFeedConfig {
|
|
1363
|
-
/** Enabled by default when site.url is set. Set false to disable. */
|
|
1364
|
-
enabled?: boolean;
|
|
1365
|
-
/** CMS collection IDs/slugs to include in the global feed. Default: all published. */
|
|
1366
|
-
collections?: string[];
|
|
1367
|
-
/** Maximum entries per feed. Default: 50. */
|
|
1368
|
-
maxItems?: number;
|
|
1369
|
-
/** RSS TTL in minutes. Default: 60. */
|
|
1370
|
-
ttl?: number;
|
|
1371
|
-
/** Cache-Control max-age in seconds. Default: 3600. */
|
|
1372
|
-
cacheMaxAge?: number;
|
|
1373
|
-
}
|
|
1374
|
-
export interface QarpeoSiteConfig {
|
|
1375
|
-
/** Project/site name (used for Cloudflare Worker name, SEO, emails, branding) */
|
|
1376
|
-
name?: string;
|
|
1377
|
-
/** Canonical site URL (e.g. 'https://qarpeo.com') */
|
|
1378
|
-
url?: string;
|
|
1379
|
-
/** Site description */
|
|
1380
|
-
description?: string;
|
|
1381
|
-
/** Primary locale */
|
|
1382
|
-
defaultLocale?: string;
|
|
1383
|
-
/** Title template, e.g. "%s — %siteName" or "%s | %siteName". Default: "%s — %siteName" */
|
|
1384
|
-
titleTemplate?: string;
|
|
1385
|
-
/** Default separator between page title and site name. Default: "—" */
|
|
1386
|
-
separator?: string;
|
|
1387
|
-
/** Default OpenGraph / social share image URL (absolute or relative to site.url) */
|
|
1388
|
-
image?: string;
|
|
1389
|
-
/** Twitter/X creator or site handle (e.g. "@qarpeo") */
|
|
1390
|
-
twitter?: string;
|
|
1391
|
-
/** Canonical robots.txt rules */
|
|
1392
|
-
robots?: boolean | SiteRobotsConfig;
|
|
1393
|
-
/** Sitemap configuration */
|
|
1394
|
-
sitemap?: boolean | SiteSitemapConfig;
|
|
1395
|
-
/** RSS 2.0 / Atom 1.0 feed configuration */
|
|
1396
|
-
feed?: boolean | SiteFeedConfig;
|
|
1397
|
-
/** Auto-inject WebSite JSON-LD schema on root page. Default: true */
|
|
1398
|
-
schemaOrg?: boolean;
|
|
1399
|
-
}
|
|
1400
|
-
/** Fate Relay-style data fetching options */
|
|
1401
|
-
export interface FateOptions {
|
|
1402
|
-
/**
|
|
1403
|
-
* The route to mount the Fate batch handler on.
|
|
1404
|
-
*
|
|
1405
|
-
* @default "/fate"
|
|
1406
|
-
*/
|
|
1407
|
-
endpoint?: string;
|
|
1408
|
-
/**
|
|
1409
|
-
* Directory (relative to project root) where `views.ts` is located.
|
|
1410
|
-
*
|
|
1411
|
-
* @default "server/fate"
|
|
1412
|
-
*/
|
|
1413
|
-
viewsDir?: string;
|
|
1414
|
-
}
|
|
1415
|
-
/**
|
|
1416
|
-
* Moderation configuration for the Qarpeo Comments system.
|
|
1417
|
-
* Controls adult content filtering, link limits, and keyword blocks.
|
|
1418
|
-
*/
|
|
1419
|
-
export interface CommentsModerationConfig {
|
|
1420
|
-
/**
|
|
1421
|
-
* Action to take when a comment violates moderation rules.
|
|
1422
|
-
* - `"reject"` (default): Immediately throws HTTP 400 Bad Request.
|
|
1423
|
-
* - `"quarantine"`: Accepts the submission but marks its status as `"spam"` and records
|
|
1424
|
-
* moderation violation details in metadata so moderators can review it.
|
|
1425
|
-
*
|
|
1426
|
-
* @default "reject"
|
|
1427
|
-
*/
|
|
1428
|
-
action?: "reject" | "quarantine";
|
|
1429
|
-
/**
|
|
1430
|
-
* Block links to adult websites and domains with adult TLDs.
|
|
1431
|
-
* Uses an O(1) hash-set lookup and adult TLD regex; zero performance cost.
|
|
1432
|
-
*
|
|
1433
|
-
* @default true
|
|
1434
|
-
*/
|
|
1435
|
-
blockAdultContent?: boolean;
|
|
1436
|
-
/**
|
|
1437
|
-
* Maximum number of URLs a single comment may contain.
|
|
1438
|
-
* Set to `0` to disallow all links.
|
|
1439
|
-
*
|
|
1440
|
-
* @default 2
|
|
1441
|
-
*/
|
|
1442
|
-
maxLinks?: number;
|
|
1443
|
-
/**
|
|
1444
|
-
* Additional apex domains to block (e.g. `["myspamsite.com"]`).
|
|
1445
|
-
* Each entry is matched against the extracted root domain of every link.
|
|
1446
|
-
*/
|
|
1447
|
-
blockedDomains?: string[];
|
|
1448
|
-
/**
|
|
1449
|
-
* Substrings that, if found in comment text, cause a moderation violation.
|
|
1450
|
-
* Case-insensitive. Applies after obfuscation normalization.
|
|
1451
|
-
*/
|
|
1452
|
-
blockedKeywords?: string[];
|
|
1453
|
-
/**
|
|
1454
|
-
* Time window in milliseconds to detect identical duplicate comments on the same target.
|
|
1455
|
-
* If a duplicate is detected within this window from the same author/IP:
|
|
1456
|
-
* - With action "reject": throws HTTP 400.
|
|
1457
|
-
* - With action "quarantine": stores comment with status "spam".
|
|
1458
|
-
* Set to 0 to disable duplicate detection.
|
|
1459
|
-
*
|
|
1460
|
-
* @default 300000 (5 minutes)
|
|
1461
|
-
*/
|
|
1462
|
-
duplicateWindowMs?: number;
|
|
1463
|
-
}
|
|
1464
|
-
/** Configuration options for the Qarpeo Comments system */
|
|
1465
|
-
export interface CommentsOptions {
|
|
1466
|
-
/**
|
|
1467
|
-
* Require authenticated session to submit comments.
|
|
1468
|
-
* When false (default), anonymous/public users can post comments.
|
|
1469
|
-
*
|
|
1470
|
-
* @default false
|
|
1471
|
-
*/
|
|
1472
|
-
requireAuth?: boolean;
|
|
1473
|
-
/**
|
|
1474
|
-
* Default moderation status for new comments.
|
|
1475
|
-
*
|
|
1476
|
-
* @default "pending"
|
|
1477
|
-
*/
|
|
1478
|
-
defaultStatus?: "pending" | "approved";
|
|
1479
|
-
/**
|
|
1480
|
-
* Automatically approve comments from authenticated users.
|
|
1481
|
-
*
|
|
1482
|
-
* @default false
|
|
1483
|
-
*/
|
|
1484
|
-
autoApproveAuth?: boolean;
|
|
1485
|
-
/**
|
|
1486
|
-
* Maximum reply nesting depth for threaded discussions.
|
|
1487
|
-
*
|
|
1488
|
-
* @default 3
|
|
1489
|
-
*/
|
|
1490
|
-
threadDepth?: number;
|
|
1491
|
-
/**
|
|
1492
|
-
* Maximum length in characters for a comment body.
|
|
1493
|
-
*
|
|
1494
|
-
* @default 5000
|
|
1495
|
-
*/
|
|
1496
|
-
maxLength?: number;
|
|
1497
|
-
/**
|
|
1498
|
-
* Rate limiting rules for submitting comments.
|
|
1499
|
-
*
|
|
1500
|
-
* @default { max: 5, window: "1m" }
|
|
1501
|
-
*/
|
|
1502
|
-
rateLimit?: {
|
|
1503
|
-
max?: number;
|
|
1504
|
-
window?: string;
|
|
1505
|
-
};
|
|
1506
|
-
/**
|
|
1507
|
-
* Enable Cloudflare Turnstile bot verification on comment submission.
|
|
1508
|
-
*
|
|
1509
|
-
* @default false
|
|
1510
|
-
*/
|
|
1511
|
-
turnstile?: boolean;
|
|
1512
|
-
/**
|
|
1513
|
-
* Allowed reaction identifiers on comments, or boolean to enable default reactions (like, heart, fire).
|
|
1514
|
-
*
|
|
1515
|
-
* @default true
|
|
1516
|
-
*/
|
|
1517
|
-
reactions?: boolean | string[];
|
|
1518
|
-
/**
|
|
1519
|
-
* Enable community reporting and configure automatic hide thresholds.
|
|
1520
|
-
*
|
|
1521
|
-
* @default true
|
|
1522
|
-
*/
|
|
1523
|
-
reporting?: boolean | {
|
|
1524
|
-
autoHideThreshold?: number;
|
|
1525
|
-
};
|
|
1526
|
-
/**
|
|
1527
|
-
* User roles permitted to moderate comments (change status, delete any comment).
|
|
1528
|
-
*
|
|
1529
|
-
* @default ["admin", "super", "moderator"]
|
|
1530
|
-
*/
|
|
1531
|
-
roles?: string[];
|
|
1532
|
-
/**
|
|
1533
|
-
* Content moderation: adult-site blocking, link count limits, and keyword filtering.
|
|
1534
|
-
* When omitted, adult content filtering is enabled with up to 2 links allowed.
|
|
1535
|
-
*/
|
|
1536
|
-
moderation?: CommentsModerationConfig;
|
|
1537
|
-
/**
|
|
1538
|
-
* Custom HTTP API route prefix for the comments endpoints.
|
|
1539
|
-
*
|
|
1540
|
-
* @default "/api/comments"
|
|
1541
|
-
*/
|
|
1542
|
-
prefix?: string;
|
|
1543
|
-
}
|
|
1544
|
-
/** Configuration options for the Qarpeo Store App */
|
|
1545
|
-
export interface StoreOptions {
|
|
1546
|
-
/**
|
|
1547
|
-
* Default 3-letter currency code (ISO 4217).
|
|
1548
|
-
*
|
|
1549
|
-
* @default "USD"
|
|
1550
|
-
*/
|
|
1551
|
-
currency?: string;
|
|
1552
|
-
/**
|
|
1553
|
-
* URL prefix for auto-mounted Store REST API routes.
|
|
1554
|
-
*
|
|
1555
|
-
* @default "/api/store"
|
|
1556
|
-
*/
|
|
1557
|
-
prefix?: string;
|
|
1558
|
-
/**
|
|
1559
|
-
* Cookie expiration in seconds for anonymous guest carts.
|
|
1560
|
-
*
|
|
1561
|
-
* @default 2592000 (30 days)
|
|
1562
|
-
*/
|
|
1563
|
-
cartCookieTtl?: number;
|
|
1564
|
-
/**
|
|
1565
|
-
* Cart configuration.
|
|
1566
|
-
*/
|
|
1567
|
-
cart?: {
|
|
1568
|
-
maxAgeDays?: number;
|
|
1569
|
-
};
|
|
1570
|
-
/**
|
|
1571
|
-
* Checkout configuration (tax, shipping).
|
|
1572
|
-
*/
|
|
1573
|
-
checkout?: {
|
|
1574
|
-
taxRate?: number;
|
|
1575
|
-
shippingRates?: Array<{
|
|
1576
|
-
id: string;
|
|
1577
|
-
name: string;
|
|
1578
|
-
amount: number;
|
|
1579
|
-
}>;
|
|
1580
|
-
};
|
|
1581
|
-
/**
|
|
1582
|
-
* Multi-currency, FX exchange rates, and rule-based edge tax/VAT settings.
|
|
1583
|
-
*/
|
|
1584
|
-
localization?: {
|
|
1585
|
-
/** Base store currency (ISO 4217). Default: "USD" */
|
|
1586
|
-
defaultCurrency?: string;
|
|
1587
|
-
/** List of supported currencies. Default: ["USD", "EUR", "GBP", "CAD", "AUD", "JPY"] */
|
|
1588
|
-
currencies?: string[];
|
|
1589
|
-
/** Custom exchange rates relative to defaultCurrency */
|
|
1590
|
-
rates?: Record<string, number>;
|
|
1591
|
-
/** Auto-detect currency from Cloudflare cf.country header. Default: true */
|
|
1592
|
-
autoDetect?: boolean;
|
|
1593
|
-
/** Price rounding strategy for converted amounts */
|
|
1594
|
-
rounding?: "none" | "round" | "charm-99" | "charm-95";
|
|
1595
|
-
/** Rule-based edge tax and VAT configuration */
|
|
1596
|
-
tax?: {
|
|
1597
|
-
merchantCountry?: string;
|
|
1598
|
-
defaultRate?: number;
|
|
1599
|
-
pricesIncludeTax?: boolean;
|
|
1600
|
-
euVat?: boolean;
|
|
1601
|
-
rates?: Record<string, number | Record<string, number>>;
|
|
1602
|
-
b2bReverseCharge?: boolean;
|
|
1603
|
-
};
|
|
1604
|
-
};
|
|
1605
|
-
/**
|
|
1606
|
-
* Discount coupon configuration.
|
|
1607
|
-
*/
|
|
1608
|
-
discounts?: {
|
|
1609
|
-
enabled?: boolean;
|
|
1610
|
-
};
|
|
1611
|
-
/**
|
|
1612
|
-
* Store operating mode: "single" (single merchant, default) or "multi-vendor" (marketplace).
|
|
1613
|
-
*
|
|
1614
|
-
* @default "single"
|
|
1615
|
-
*/
|
|
1616
|
-
mode?: "single" | "multi-vendor";
|
|
1617
|
-
/**
|
|
1618
|
-
* Multi-vendor marketplace configuration. Active when `mode === "multi-vendor"`.
|
|
1619
|
-
*/
|
|
1620
|
-
multiVendor?: {
|
|
1621
|
-
/** Default platform commission rate (e.g. 0.10 for 10% platform fee). @default 0 */
|
|
1622
|
-
commissionRate?: number;
|
|
1623
|
-
/** Whether customers can add items from multiple vendors into a single cart. @default true */
|
|
1624
|
-
allowCrossVendorCart?: boolean;
|
|
1625
|
-
/** Whether newly created products by vendors require approval before publishing. @default false */
|
|
1626
|
-
requireApproval?: boolean;
|
|
1627
|
-
};
|
|
1628
|
-
/**
|
|
1629
|
-
* Digital product download security settings.
|
|
1630
|
-
*/
|
|
1631
|
-
downloads?: {
|
|
1632
|
-
expiresInHours?: number;
|
|
1633
|
-
maxDownloads?: number;
|
|
1634
|
-
};
|
|
1635
|
-
/**
|
|
1636
|
-
* Inventory stock tracking configuration.
|
|
1637
|
-
*/
|
|
1638
|
-
inventory?: {
|
|
1639
|
-
/** Track inventory levels and prevent overselling. @default true */
|
|
1640
|
-
trackStock?: boolean;
|
|
1641
|
-
/** Allow purchasing items with zero stock. @default false */
|
|
1642
|
-
allowBackorders?: boolean;
|
|
1643
|
-
/** Quantity at or below which the product is marked low-stock. @default 5 */
|
|
1644
|
-
lowStockThreshold?: number;
|
|
1645
|
-
};
|
|
1646
|
-
/**
|
|
1647
|
-
* Digital product download security settings.
|
|
1648
|
-
*/
|
|
1649
|
-
digitalProducts?: {
|
|
1650
|
-
/** Expiration window for presigned download URLs in hours. @default 24 */
|
|
1651
|
-
downloadLinkTtlHours?: number;
|
|
1652
|
-
/** Maximum download attempts allowed per purchased item. @default 5 */
|
|
1653
|
-
maxDownloadsPerItem?: number;
|
|
1654
|
-
};
|
|
1655
|
-
/**
|
|
1656
|
-
* Granular table name overrides or global table prefix for all store tables.
|
|
1657
|
-
* Respects the same prefix/tables mechanics as `tablePrefix` on the root config.
|
|
1658
|
-
*/
|
|
1659
|
-
tablePrefix?: boolean | string;
|
|
1660
|
-
tables?: Record<string, string>;
|
|
1661
|
-
}
|
|
1662
|
-
/** Root configuration options for the Qarpeo Nuxt module (Strict Two-Tier Standard, Decision 22 & 23) */
|
|
1663
|
-
export interface QarpeoTablesConfig {
|
|
1664
|
-
/** User table name override (Better Auth / custom schema). @default "user" */
|
|
1665
|
-
user?: string;
|
|
1666
|
-
/** Session table name override. @default "session" */
|
|
1667
|
-
session?: string;
|
|
1668
|
-
/** Account table name override. @default "account" */
|
|
1669
|
-
account?: string;
|
|
1670
|
-
/** Verification token table name override. @default "verification" */
|
|
1671
|
-
verification?: string;
|
|
1672
|
-
/** Two-factor authentication table name override. @default "two_factor" */
|
|
1673
|
-
twoFactor?: string;
|
|
1674
|
-
/** Passkey / WebAuthn table name override. @default "passkey" */
|
|
1675
|
-
passkey?: string;
|
|
1676
|
-
/** Organization table name override. @default "organization" */
|
|
1677
|
-
organization?: string;
|
|
1678
|
-
/** Organization member table name override. @default "member" */
|
|
1679
|
-
member?: string;
|
|
1680
|
-
/** Organization invitation table name override. @default "invitation" */
|
|
1681
|
-
invitation?: string;
|
|
1682
|
-
/** Audit log table name override. @default "audit_log" */
|
|
1683
|
-
auditLog?: string;
|
|
1684
|
-
/** Comments table name override. @default "comment" */
|
|
1685
|
-
comment?: string;
|
|
1686
|
-
/** Comment reports table name override. @default "comment_report" */
|
|
1687
|
-
commentReport?: string;
|
|
1688
|
-
/** Comment reactions table name override. @default "comment_reaction" */
|
|
1689
|
-
commentReaction?: string;
|
|
1690
|
-
/** Customers table name override. @default "customer" */
|
|
1691
|
-
customer?: string;
|
|
1692
|
-
/** Subscriptions table name override. @default "subscription" */
|
|
1693
|
-
subscription?: string;
|
|
1694
|
-
/** Webhook events table name override. @default "webhook_event" */
|
|
1695
|
-
webhookEvent?: string;
|
|
1696
|
-
/** Usage records table name override. @default "usage_record" */
|
|
1697
|
-
usageRecord?: string;
|
|
1698
|
-
/** In-app notifications table name override. @default "notification" */
|
|
1699
|
-
notification?: string;
|
|
1700
|
-
/** Push subscriptions table name override. @default "push_subscription" */
|
|
1701
|
-
pushSubscription?: string;
|
|
1702
|
-
/** Tenant table name override. @default "tenant" */
|
|
1703
|
-
tenant?: string;
|
|
1704
|
-
/** Domain table name override. @default "domain" */
|
|
1705
|
-
domain?: string;
|
|
1706
|
-
/** CMS collection table name override. @default "cms_collection" */
|
|
1707
|
-
cmsCollection?: string;
|
|
1708
|
-
/** CMS entry table name override. @default "cms_entry" */
|
|
1709
|
-
cmsEntry?: string;
|
|
1710
|
-
/** CMS revision table name override. @default "cms_revision" */
|
|
1711
|
-
cmsRevision?: string;
|
|
1712
|
-
/** CMS category table name override. @default "cms_category" */
|
|
1713
|
-
cmsCategory?: string;
|
|
1714
|
-
/** CMS tag table name override. @default "cms_tag" */
|
|
1715
|
-
cmsTag?: string;
|
|
1716
|
-
/** CMS bookmark table name override. @default "cms_bookmark" */
|
|
1717
|
-
cmsBookmark?: string;
|
|
1718
|
-
/** CMS subscriber table name override. @default "cms_subscriber" */
|
|
1719
|
-
cmsSubscriber?: string;
|
|
1720
|
-
/** Email suppression table name override. @default "mail_suppression" */
|
|
1721
|
-
mailSuppression?: string;
|
|
1722
|
-
/** Store product table name override. @default "store_product" */
|
|
1723
|
-
storeProduct?: string;
|
|
1724
|
-
/** Store product variant table name override. @default "store_product_variant" */
|
|
1725
|
-
storeProductVariant?: string;
|
|
1726
|
-
/** Store inventory table name override. @default "store_inventory" */
|
|
1727
|
-
storeInventory?: string;
|
|
1728
|
-
/** Store category table name override. @default "store_category" */
|
|
1729
|
-
storeCategory?: string;
|
|
1730
|
-
/** Store cart table name override. @default "store_cart" */
|
|
1731
|
-
storeCart?: string;
|
|
1732
|
-
/** Store cart item table name override. @default "store_cart_item" */
|
|
1733
|
-
storeCartItem?: string;
|
|
1734
|
-
/** Store order table name override. @default "store_order" */
|
|
1735
|
-
storeOrder?: string;
|
|
1736
|
-
/** Store order item table name override. @default "store_order_item" */
|
|
1737
|
-
storeOrderItem?: string;
|
|
1738
|
-
/** Store discount table name override. @default "store_discount" */
|
|
1739
|
-
storeDiscount?: string;
|
|
1740
|
-
/** Store customer address table name override. @default "store_customer_address" */
|
|
1741
|
-
storeCustomerAddress?: string;
|
|
1742
|
-
[key: string]: string | undefined;
|
|
1743
|
-
}
|
|
1744
|
-
export interface SecondaryDatabaseConfig {
|
|
1745
|
-
binding?: string;
|
|
1746
|
-
databaseId?: string;
|
|
1747
|
-
databaseName?: string;
|
|
1748
|
-
migrationsDir?: string;
|
|
1749
|
-
hyperdrive?: boolean;
|
|
1750
|
-
id?: string;
|
|
1751
|
-
}
|
|
1752
|
-
export interface DbOptions {
|
|
1753
|
-
binding?: string;
|
|
1754
|
-
databaseId?: string;
|
|
1755
|
-
autoMigrate?: boolean;
|
|
1756
|
-
migrateOnBuild?: boolean | "local" | "remote";
|
|
1757
|
-
/**
|
|
1758
|
-
* Additional zero-config databases (D1 or Hyperdrive).
|
|
1759
|
-
*
|
|
1760
|
-
* Accepts an array of database names (e.g. `["analytics", "tenants"]`)
|
|
1761
|
-
* or a record with custom configuration.
|
|
1762
|
-
*
|
|
1763
|
-
* Automatically generates wrangler D1 / Hyperdrive bindings and provisions
|
|
1764
|
-
* isolated local dev SQLite databases without manual `wrangler.jsonc`.
|
|
1765
|
-
*
|
|
1766
|
-
* @example
|
|
1767
|
-
* ```ts
|
|
1768
|
-
* databases: ["analytics", "warehouse"]
|
|
1769
|
-
* ```
|
|
1770
|
-
*/
|
|
1771
|
-
databases?: string[] | Record<string, SecondaryDatabaseConfig>;
|
|
1772
|
-
}
|
|
1773
|
-
export interface QarpeoOptions {
|
|
1774
|
-
/**
|
|
1775
|
-
* Database table prefix for Qarpeo-managed tables (comments, payments, notifications, CMS, multi-tenancy, audit logs).
|
|
1776
|
-
* - `false` or `""` (default): clean singular table names (`comment`, `customer`, `subscription`, `cms_entry`, `audit_log`)
|
|
1777
|
-
* - `true`: standard `qarpeo_` prefix (`qarpeo_comment`, `qarpeo_customer`)
|
|
1778
|
-
* - `string`: custom prefix e.g. `"q_"` (`q_comment`, `q_customer`)
|
|
1779
|
-
*
|
|
1780
|
-
* @default false
|
|
1781
|
-
*/
|
|
1782
|
-
tablePrefix?: boolean | string;
|
|
1783
|
-
/**
|
|
1784
|
-
* Shorthand alias for `tablePrefix`.
|
|
1785
|
-
*
|
|
1786
|
-
* @default false
|
|
1787
|
-
*/
|
|
1788
|
-
prefix?: boolean | string;
|
|
1789
|
-
/**
|
|
1790
|
-
* Granular table name overrides. Takes precedence over `tablePrefix`.
|
|
1791
|
-
*
|
|
1792
|
-
* @example
|
|
1793
|
-
* ```ts
|
|
1794
|
-
* qarpeo: {
|
|
1795
|
-
* tablePrefix: "q_",
|
|
1796
|
-
* tables: {
|
|
1797
|
-
* user: "profiles", // overrides to "profiles" instead of "q_user"
|
|
1798
|
-
* }
|
|
1799
|
-
* }
|
|
1800
|
-
* ```
|
|
1801
|
-
*/
|
|
1802
|
-
tables?: QarpeoTablesConfig;
|
|
1803
|
-
/** Project & site metadata (name, url, SEO, branding) */
|
|
1804
|
-
site?: QarpeoSiteConfig;
|
|
1805
|
-
/** Native SEO engine configuration (alias for site config) */
|
|
1806
|
-
seo?: boolean | QarpeoSiteConfig;
|
|
1807
|
-
/**
|
|
1808
|
-
* Cloudflare Worker service name override.
|
|
1809
|
-
*
|
|
1810
|
-
* By default, Qarpeo infers the worker name from `package.json` -> `name` (sanitized for
|
|
1811
|
-
* Cloudflare).
|
|
1812
|
-
*
|
|
1813
|
-
* @example
|
|
1814
|
-
* ;```ts
|
|
1815
|
-
* qarpeo: {
|
|
1816
|
-
* workerName: "my-edge-app",
|
|
1817
|
-
* }
|
|
1818
|
-
* ```
|
|
1819
|
-
*/
|
|
1820
|
-
workerName?: string;
|
|
1821
|
-
/** Project / Cloudflare Worker name override (alias for workerName) */
|
|
1822
|
-
name?: string;
|
|
1823
|
-
/**
|
|
1824
|
-
* Use live Cloudflare remote bindings during `nuxt dev` instead of local Miniflare emulation.
|
|
1825
|
-
*
|
|
1826
|
-
* @default false
|
|
1827
|
-
*/
|
|
1828
|
-
remote?: boolean;
|
|
1829
|
-
/**
|
|
1830
|
-
* Enable Cloudflare Workers AI integration for serverless LLMs, embeddings, and generative AI.
|
|
1831
|
-
*
|
|
1832
|
-
* @default false
|
|
1833
|
-
*/
|
|
1834
|
-
ai?: boolean;
|
|
1835
|
-
/**
|
|
1836
|
-
* Enable Cloudflare Vectorize integration for vector embeddings and semantic search.
|
|
1837
|
-
*
|
|
1838
|
-
* @default false
|
|
1839
|
-
*/
|
|
1840
|
-
vectorize?: boolean;
|
|
1841
|
-
/**
|
|
1842
|
-
* Enable Cloudflare Queues integration for asynchronous message queues and background jobs.
|
|
1843
|
-
*
|
|
1844
|
-
* @default false
|
|
1845
|
-
*/
|
|
1846
|
-
queue?: boolean;
|
|
1847
|
-
/**
|
|
1848
|
-
* Enable Cloudflare Hyperdrive integration for pooled connections and query acceleration to
|
|
1849
|
-
* external PostgreSQL databases.
|
|
1850
|
-
*
|
|
1851
|
-
* @default false
|
|
1852
|
-
*/
|
|
1853
|
-
hyperdrive?: boolean;
|
|
1854
|
-
/**
|
|
1855
|
-
* Enable Cloudflare Browser Rendering integration for headless Chromium web scraping, PDF
|
|
1856
|
-
* generation, and automated screenshots.
|
|
1857
|
-
*
|
|
1858
|
-
* @default false
|
|
1859
|
-
*/
|
|
1860
|
-
browser?: boolean;
|
|
1861
|
-
/**
|
|
1862
|
-
* Enable Cloudflare Durable Objects binding for stateful, low-latency coordination, presence,
|
|
1863
|
-
* and modern RPC methods.
|
|
1864
|
-
*
|
|
1865
|
-
* @default false
|
|
1866
|
-
*/
|
|
1867
|
-
do?: boolean | DurableObjectsOptions;
|
|
1868
|
-
/**
|
|
1869
|
-
* Cloudflare Cron Triggers configuration.
|
|
1870
|
-
*
|
|
1871
|
-
* @default false
|
|
1872
|
-
*/
|
|
1873
|
-
cron?: boolean | Record<string, string[]>;
|
|
1874
|
-
/**
|
|
1875
|
-
* Enable Cloudflare Send Email integration for transactional emails.
|
|
1876
|
-
*
|
|
1877
|
-
* @default false
|
|
1878
|
-
*/
|
|
1879
|
-
email?: boolean | EmailOptions;
|
|
1880
|
-
/**
|
|
1881
|
-
* Direct Cloudflare D1 SQL database binding.
|
|
1882
|
-
*
|
|
1883
|
-
* @default false
|
|
1884
|
-
*/
|
|
1885
|
-
d1?: boolean;
|
|
1886
|
-
/**
|
|
1887
|
-
* Direct Cloudflare R2 Blob storage binding.
|
|
1888
|
-
*
|
|
1889
|
-
* @default false
|
|
1890
|
-
*/
|
|
1891
|
-
r2?: boolean;
|
|
1892
|
-
/**
|
|
1893
|
-
* Enable Edge Database powered by Drizzle ORM on Cloudflare D1 (Tier 2). Auto-imports `db`,
|
|
1894
|
-
* `useDrizzle()`, `schema`, and all Drizzle helpers.
|
|
1895
|
-
*
|
|
1896
|
-
* - `autoMigrate`: Automatically apply unapplied D1 migrations on `nuxt dev` startup (default:
|
|
1897
|
-
* true).
|
|
1898
|
-
* - `migrateOnBuild`: Apply D1 migrations during `nuxt build`. Can be `true` (auto-detects remote
|
|
1899
|
-
* in CI / local otherwise), `"local"`, or `"remote"`. Also controllable via
|
|
1900
|
-
* `QARPEO_MIGRATE_ON_BUILD` env var (default: false).
|
|
1901
|
-
*
|
|
1902
|
-
* @default false
|
|
1903
|
-
*/
|
|
1904
|
-
db?: boolean | DbOptions;
|
|
1905
|
-
/**
|
|
1906
|
-
* Enable Cloudflare Key-Value (KV) storage. Auto-imports `kv` across server routes and handlers.
|
|
1907
|
-
*
|
|
1908
|
-
* @default false
|
|
1909
|
-
*/
|
|
1910
|
-
kv?: boolean;
|
|
1911
|
-
/**
|
|
1912
|
-
* Enable Edge Cache Layer powered by Cloudflare KV (Tier 2). Mounts Nitro's `cache` storage
|
|
1913
|
-
* driver to Cloudflare KV in production. Enables SWR routeRules and `purgeCache()`.
|
|
1914
|
-
*
|
|
1915
|
-
* @default false
|
|
1916
|
-
*/
|
|
1917
|
-
cache?: boolean | CacheOptions;
|
|
1918
|
-
/**
|
|
1919
|
-
* Enable Cloudflare Edge Authentication powered by Better Auth + D1 (Tier 2).
|
|
1920
|
-
*
|
|
1921
|
-
* @default false
|
|
1922
|
-
*/
|
|
1923
|
-
auth?: boolean | AuthOptions;
|
|
1924
|
-
/**
|
|
1925
|
-
* Enable Edge Blob / File System Layer powered by Cloudflare R2 (Tier 2).
|
|
1926
|
-
*
|
|
1927
|
-
* @default false
|
|
1928
|
-
*/
|
|
1929
|
-
blob?: boolean | BlobOptions;
|
|
1930
|
-
/**
|
|
1931
|
-
* Enable Hybrid Edge Content Management System powered by D1 + R2 + Auth (Tier 2).
|
|
1932
|
-
*
|
|
1933
|
-
* @default false
|
|
1934
|
-
*/
|
|
1935
|
-
cms?: boolean | CMSOptions;
|
|
1936
|
-
/**
|
|
1937
|
-
* Enable Realtime Layer powered by Cloudflare Durable Objects + KV (Tier 2).
|
|
1938
|
-
*
|
|
1939
|
-
* @default false
|
|
1940
|
-
*/
|
|
1941
|
-
realtime?: boolean | RealtimeOptions;
|
|
1942
|
-
/**
|
|
1943
|
-
* Enable Edge Payments Layer powered by Stripe, Lemon Squeezy, or Polar (Tier 2).
|
|
1944
|
-
*
|
|
1945
|
-
* @default false
|
|
1946
|
-
*/
|
|
1947
|
-
payments?: boolean | PaymentsOptions;
|
|
1948
|
-
/**
|
|
1949
|
-
* Enable Background Jobs Layer powered by Cloudflare Queues (Tier 2). Auto-scans `server/jobs/`
|
|
1950
|
-
* and exposes `defineJob()` and `dispatchJob()`.
|
|
1951
|
-
*
|
|
1952
|
-
* @default false
|
|
1953
|
-
*/
|
|
1954
|
-
jobs?: boolean | JobsOptions;
|
|
1955
|
-
/**
|
|
1956
|
-
* Enable Cloudflare Workflows durable execution engine (Tier 2).
|
|
1957
|
-
* Auto-scans `server/workflows/` and exposes `defineWorkflow()` and `useWorkflow()`.
|
|
1958
|
-
*
|
|
1959
|
-
* @default false
|
|
1960
|
-
*/
|
|
1961
|
-
workflows?: boolean | WorkflowsOptions;
|
|
1962
|
-
/**
|
|
1963
|
-
* Enable Edge Rate Limiting powered by Cloudflare RateLimiter / KV (Tier 2). Exposes
|
|
1964
|
-
* `assertRateLimit()`, `checkRateLimit()`, and per-route rate limiting.
|
|
1965
|
-
*
|
|
1966
|
-
* @default false
|
|
1967
|
-
*/
|
|
1968
|
-
ratelimit?: boolean | AppRateLimitOptions;
|
|
1969
|
-
/**
|
|
1970
|
-
* Enable Stateful Edge Agents & AI Streaming Layer (Tier 2). Backed by Cloudflare Durable Objects
|
|
1971
|
-
* (`QarpeoAgentDO`), Workers AI, and Vectorize. Exposes `defineAgent()`, `defineTool()`,
|
|
1972
|
-
* `useChat()`, `streamText()`, and `useAgent()`.
|
|
1973
|
-
*
|
|
1974
|
-
* @default false
|
|
1975
|
-
*/
|
|
1976
|
-
agents?: boolean | AgentsOptions;
|
|
1977
|
-
/**
|
|
1978
|
-
* Enable Edge Bots & Webhooks Suite. Auto-discovers bot webhook handlers in `server/bots/` or `server/bot/`,
|
|
1979
|
-
* exposing them at `/api/bots/<name>`.
|
|
1980
|
-
*
|
|
1981
|
-
* @default false (auto-activates when files exist in `server/bots/` or `server/bot/`)
|
|
1982
|
-
*/
|
|
1983
|
-
bots?: boolean | BotsOptions;
|
|
1984
|
-
/**
|
|
1985
|
-
* Enable Model Context Protocol (MCP) Edge Servers & Client.
|
|
1986
|
-
* Auto-discovers MCP server definition files in `server/mcp/` or `server/mcp.ts`,
|
|
1987
|
-
* exposing them at `/mcp` or `/mcp/<name>`.
|
|
1988
|
-
*
|
|
1989
|
-
* @default false (auto-activates when files exist in `server/mcp/` or `server/mcp.ts`)
|
|
1990
|
-
*/
|
|
1991
|
-
mcp?: boolean | McpOptions;
|
|
1992
|
-
/**
|
|
1993
|
-
* Enable Transactional Email & Dev Mailbox Layer (Tier 2). Pre-built responsive HTML email
|
|
1994
|
-
* templates, multi-provider delivery (Cloudflare, Resend, Postmark), and in-browser Dev Mailbox
|
|
1995
|
-
* preview in development.
|
|
1996
|
-
*
|
|
1997
|
-
* @default false
|
|
1998
|
-
*/
|
|
1999
|
-
mail?: boolean | MailOptions;
|
|
2000
|
-
/**
|
|
2001
|
-
* Enable Edge Analytics Dashboard (Tier 2). Privacy-first structured pageview tracking, custom
|
|
2002
|
-
* business events, and a pre-built dashboard API backed by Cloudflare Analytics Engine.
|
|
2003
|
-
*
|
|
2004
|
-
* @default false
|
|
2005
|
-
*/
|
|
2006
|
-
analytics?: boolean | AnalyticsOptions;
|
|
2007
|
-
/**
|
|
2008
|
-
* Enable Multi-Tenancy & Custom Domains Layer (Tier 2). Subdomain routing, custom domains via
|
|
2009
|
-
* Cloudflare for SaaS, automated SSL, edge tenant resolution (`useTenant()`), and tenant data
|
|
2010
|
-
* isolation.
|
|
2011
|
-
*
|
|
2012
|
-
* @default false
|
|
2013
|
-
*/
|
|
2014
|
-
multitenant?: boolean | MultitenantOptions;
|
|
2015
|
-
/**
|
|
2016
|
-
* Enable Notifications Layer (Tier 2). Unified in-app feeds, realtime UI push via Durable
|
|
2017
|
-
* Objects, browser Web Push (VAPID via Web Crypto), and email alerts.
|
|
2018
|
-
*
|
|
2019
|
-
* @default false
|
|
2020
|
-
*/
|
|
2021
|
-
notifications?: boolean | NotificationsOptions;
|
|
2022
|
-
/** Shorthand alias for notifications */
|
|
2023
|
-
notify?: boolean | NotificationsOptions;
|
|
2024
|
-
/**
|
|
2025
|
-
* Enable Fate Relay-style normalized data fetching.
|
|
2026
|
-
*
|
|
2027
|
-
* When `true`, qarpeo will:
|
|
2028
|
-
*
|
|
2029
|
-
* - Auto-install `@nkzw/fate` and `vue-fate`
|
|
2030
|
-
* - Mount a `/fate` batch handler automatically
|
|
2031
|
-
* - Add the Fate Vue plugin (SSR hydration included)
|
|
2032
|
-
* - Auto-import `useRequest`, `useListView`, `useView`, `useFateClient`
|
|
2033
|
-
* - Auto-import everything in `app/fate/` (view selectors)
|
|
2034
|
-
*
|
|
2035
|
-
* Define your entities and resolvers in `server/fate/views.ts` using the `defineFateViews` helper
|
|
2036
|
-
* from `qarpeo/fate`.
|
|
2037
|
-
*
|
|
2038
|
-
* @default false
|
|
2039
|
-
*/
|
|
2040
|
-
fate?: boolean | FateOptions;
|
|
2041
|
-
/**
|
|
2042
|
-
* Threaded comments and discussion system with D1 persistence, moderation, and reactions.
|
|
2043
|
-
*
|
|
2044
|
-
* @default false
|
|
2045
|
-
*/
|
|
2046
|
-
comments?: boolean | CommentsOptions;
|
|
2047
|
-
/**
|
|
2048
|
-
* Turnkey E-Commerce & Store App with D1 persistence, variant matrix, cart, and payment checkout.
|
|
2049
|
-
*
|
|
2050
|
-
* @default false
|
|
2051
|
-
*/
|
|
2052
|
-
store?: boolean | StoreOptions;
|
|
2053
|
-
/**
|
|
2054
|
-
* Configuration for Qarpeo DevTools (Dev-Only Management Console & DevTools panel).
|
|
2055
|
-
*
|
|
2056
|
-
* @default false
|
|
2057
|
-
*/
|
|
2058
|
-
devtools?: boolean | DevtoolsOptions;
|
|
2059
|
-
}
|
|
2060
|
-
export type NotificationChannel = "in-app" | "push" | "email";
|
|
2061
|
-
export interface NotificationRecord {
|
|
2062
|
-
id: string;
|
|
2063
|
-
userId: string;
|
|
2064
|
-
tenantId?: string;
|
|
2065
|
-
title: string;
|
|
2066
|
-
body?: string;
|
|
2067
|
-
icon?: string;
|
|
2068
|
-
actionUrl?: string;
|
|
2069
|
-
channels: NotificationChannel[];
|
|
2070
|
-
read: boolean;
|
|
2071
|
-
readAt?: number;
|
|
2072
|
-
createdAt: number;
|
|
2073
|
-
metadata?: Record<string, any>;
|
|
2074
|
-
/**
|
|
2075
|
-
* Enable or customize RFC 2369 / RFC 8058 List-Unsubscribe headers for this message. Set alse to
|
|
2076
|
-
* disable for transactional emails (e.g. OTP, password reset).
|
|
2077
|
-
*/
|
|
2078
|
-
unsubscribe?: boolean | {
|
|
2079
|
-
url?: string;
|
|
2080
|
-
email?: string;
|
|
2081
|
-
};
|
|
2082
|
-
/**
|
|
2083
|
-
* Whether to check the suppression list before sending. Set alse to bypass suppression checks for
|
|
2084
|
-
* critical security or transactional emails.
|
|
2085
|
-
*
|
|
2086
|
-
* @default true
|
|
2087
|
-
*/
|
|
2088
|
-
suppression?: boolean;
|
|
2089
|
-
}
|
|
2090
|
-
export interface PushSubscriptionKeys {
|
|
2091
|
-
p256dh: string;
|
|
2092
|
-
auth: string;
|
|
2093
|
-
}
|
|
2094
|
-
export interface PushSubscriptionRecord {
|
|
2095
|
-
endpoint: string;
|
|
2096
|
-
keys: PushSubscriptionKeys;
|
|
2097
|
-
}
|
|
2098
|
-
export interface SendNotificationRequest {
|
|
2099
|
-
userId: string;
|
|
2100
|
-
title: string;
|
|
2101
|
-
body?: string;
|
|
2102
|
-
icon?: string;
|
|
2103
|
-
actionUrl?: string;
|
|
2104
|
-
channels?: NotificationChannel[];
|
|
2105
|
-
tenantId?: string;
|
|
2106
|
-
metadata?: Record<string, any>;
|
|
2107
|
-
emailOptions?: {
|
|
2108
|
-
subject?: string;
|
|
2109
|
-
from?: string;
|
|
2110
|
-
template?: string;
|
|
2111
|
-
};
|
|
2112
|
-
}
|
|
2113
|
-
export interface NotificationsVapidOptions {
|
|
2114
|
-
publicKey: string;
|
|
2115
|
-
privateKey: string;
|
|
2116
|
-
subject?: string;
|
|
2117
|
-
}
|
|
2118
|
-
export interface NotificationsOptions {
|
|
2119
|
-
/**
|
|
2120
|
-
* Cloudflare D1 table name for notifications.
|
|
2121
|
-
*
|
|
2122
|
-
* @default "notification"
|
|
2123
|
-
*/
|
|
2124
|
-
tableName?: string;
|
|
2125
|
-
/**
|
|
2126
|
-
* VAPID configuration for browser Web Push notifications. Can also be configured via
|
|
2127
|
-
* NUXT_VAPID_PUBLIC_KEY, NUXT_VAPID_PRIVATE_KEY, NUXT_VAPID_SUBJECT.
|
|
2128
|
-
*/
|
|
2129
|
-
vapid?: NotificationsVapidOptions;
|
|
2130
|
-
/**
|
|
2131
|
-
* Default notification channels when none specified.
|
|
2132
|
-
*
|
|
2133
|
-
* @default ["in-app"]
|
|
2134
|
-
*/
|
|
2135
|
-
channels?: NotificationChannel[];
|
|
2136
|
-
}
|
|
2137
|
-
export interface DevtoolsOptions {
|
|
2138
|
-
/**
|
|
2139
|
-
* Whether Qarpeo DevTools is enabled in development.
|
|
2140
|
-
*
|
|
2141
|
-
* @default false
|
|
2142
|
-
*/
|
|
2143
|
-
enabled?: boolean;
|
|
2144
|
-
/**
|
|
2145
|
-
* IP addresses allowed to access Qarpeo DevTools endpoints in development.
|
|
2146
|
-
*
|
|
2147
|
-
* @default ["127.0.0.1", "::1", "localhost", "::ffff:127.0.0.1"]
|
|
2148
|
-
*/
|
|
2149
|
-
allowedIps?: string[];
|
|
2150
|
-
/**
|
|
2151
|
-
* Allow access from any IP address (e.g. when binding to 0.0.0.0 for remote/mobile testing).
|
|
2152
|
-
*
|
|
2153
|
-
* @default false
|
|
2154
|
-
*/
|
|
2155
|
-
allowAnyIp?: boolean;
|
|
2156
|
-
/**
|
|
2157
|
-
* Require an authentication token to access Qarpeo DevTools. Can also be provided via
|
|
2158
|
-
* `QARPEO_DEVTOOLS_TOKEN` or `NUXT_DEVTOOLS_TOKEN` environment variables.
|
|
2159
|
-
*/
|
|
2160
|
-
token?: string;
|
|
2161
|
-
/**
|
|
2162
|
-
* Whether authentication token is strictly required.
|
|
2163
|
-
*
|
|
2164
|
-
* @default false
|
|
2165
|
-
*/
|
|
2166
|
-
requireAuth?: boolean;
|
|
2167
|
-
}
|
|
2168
|
-
import type { Nuxt } from "@nuxt/schema";
|
|
2169
|
-
export type ModuleOptions = QarpeoOptions;
|
|
2170
|
-
export * from "./runtime/types/durable-object";
|
|
2171
|
-
export * from "./runtime/types/store";
|
|
2172
|
-
export * from "./runtime/types/workflows";
|
|
2173
|
-
/** Type alias for the Nuxt instance, using official @nuxt/schema Nuxt interface. */
|
|
2174
|
-
export type NuxtInstance = Nuxt;
|
|
1
|
+
export * from "./types/index";
|