qarpeo 0.2.1 → 0.3.1
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 +1071 -31
- package/dist/fate/index.d.ts +9 -1
- package/dist/fate/index.mjs +20 -3
- package/dist/module.mjs +296 -750
- 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
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export interface CachedFunctionOptions<Args extends any[] = any[]> {
|
|
2
|
+
/**
|
|
3
|
+
* Unique cache key string or key generator function.
|
|
4
|
+
* If omitted, defaults to `name` or the function name.
|
|
5
|
+
*/
|
|
6
|
+
key?: string | ((...args: Args) => string);
|
|
7
|
+
/**
|
|
8
|
+
* Key prefix or function name. Matches Nitro defineCachedFunction convention.
|
|
9
|
+
*/
|
|
10
|
+
name?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Custom key generator function based on arguments. Matches Nitro defineCachedFunction convention.
|
|
13
|
+
*/
|
|
14
|
+
getKey?: (...args: Args) => string;
|
|
15
|
+
/**
|
|
16
|
+
* Maximum age / TTL duration (e.g. 300, '5m', '1h', '7d'). Matches Nitro defineCachedFunction convention.
|
|
17
|
+
*
|
|
18
|
+
* @default 3600
|
|
19
|
+
*/
|
|
20
|
+
maxAge?: string | number;
|
|
21
|
+
/** Time-To-Live duration (alias for `maxAge`) */
|
|
22
|
+
ttl?: string | number;
|
|
23
|
+
/** Stale-While-Revalidate duration allowing serving stale data during background fetch */
|
|
24
|
+
swr?: string | number | boolean;
|
|
25
|
+
/** Semantic cache tags for group invalidation via purgeCacheTag() */
|
|
26
|
+
tags?: string[] | ((...args: Args) => string[]);
|
|
27
|
+
}
|
|
28
|
+
export type RememberCacheOptions<Args extends any[] = any[]> = CachedFunctionOptions<Args>;
|
|
29
|
+
export interface CacheOptions {
|
|
30
|
+
/**
|
|
31
|
+
* Cloudflare KV binding name override for cache storage.
|
|
32
|
+
*
|
|
33
|
+
* @default "CACHE"
|
|
34
|
+
*/
|
|
35
|
+
binding?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Key prefix for cache entries in KV.
|
|
38
|
+
*
|
|
39
|
+
* @default "nitro:cache:"
|
|
40
|
+
*/
|
|
41
|
+
base?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Default Time-To-Live for cached items when not explicitly specified. Accepts number (seconds)
|
|
44
|
+
* or human string (e.g. '1h', '30m', '1d').
|
|
45
|
+
*
|
|
46
|
+
* @default "1h"
|
|
47
|
+
*/
|
|
48
|
+
defaultTtl?: string | number;
|
|
49
|
+
/**
|
|
50
|
+
* Automatically configure Stale-While-Revalidate (SWR) headers for cached responses.
|
|
51
|
+
*
|
|
52
|
+
* @default true
|
|
53
|
+
*/
|
|
54
|
+
swr?: boolean;
|
|
55
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Moderation configuration for the Qarpeo Comments system.
|
|
3
|
+
* Controls adult content filtering, link limits, and keyword blocks.
|
|
4
|
+
*/
|
|
5
|
+
export interface CommentsModerationConfig {
|
|
6
|
+
/**
|
|
7
|
+
* Action to take when a comment violates moderation rules.
|
|
8
|
+
* - `"reject"` (default): Immediately throws HTTP 400 Bad Request.
|
|
9
|
+
* - `"quarantine"`: Accepts the submission but marks its status as `"spam"` and records
|
|
10
|
+
* moderation violation details in metadata so moderators can review it.
|
|
11
|
+
*
|
|
12
|
+
* @default "reject"
|
|
13
|
+
*/
|
|
14
|
+
action?: "reject" | "quarantine";
|
|
15
|
+
/**
|
|
16
|
+
* Block links to adult websites and domains with adult TLDs.
|
|
17
|
+
* Uses an O(1) hash-set lookup and adult TLD regex; zero performance cost.
|
|
18
|
+
*
|
|
19
|
+
* @default true
|
|
20
|
+
*/
|
|
21
|
+
blockAdultContent?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Maximum number of URLs a single comment may contain.
|
|
24
|
+
* Set to `0` to disallow all links.
|
|
25
|
+
*
|
|
26
|
+
* @default 2
|
|
27
|
+
*/
|
|
28
|
+
maxLinks?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Additional apex domains to block (e.g. `["myspamsite.com"]`).
|
|
31
|
+
* Each entry is matched against the extracted root domain of every link.
|
|
32
|
+
*/
|
|
33
|
+
blockedDomains?: string[];
|
|
34
|
+
/**
|
|
35
|
+
* Substrings that, if found in comment text, cause a moderation violation.
|
|
36
|
+
* Case-insensitive. Applies after obfuscation normalization.
|
|
37
|
+
*/
|
|
38
|
+
blockedKeywords?: string[];
|
|
39
|
+
/**
|
|
40
|
+
* Time window in milliseconds to detect identical duplicate comments on the same target.
|
|
41
|
+
* If a duplicate is detected within this window from the same author/IP:
|
|
42
|
+
* - With action "reject": throws HTTP 400.
|
|
43
|
+
* - With action "quarantine": stores comment with status "spam".
|
|
44
|
+
* Set to 0 to disable duplicate detection.
|
|
45
|
+
*
|
|
46
|
+
* @default 300000 (5 minutes)
|
|
47
|
+
*/
|
|
48
|
+
duplicateWindowMs?: number;
|
|
49
|
+
}
|
|
50
|
+
/** Configuration options for the Qarpeo Comments system */
|
|
51
|
+
export interface CommentsOptions {
|
|
52
|
+
/**
|
|
53
|
+
* Require authenticated session to submit comments.
|
|
54
|
+
* When false (default), anonymous/public users can post comments.
|
|
55
|
+
*
|
|
56
|
+
* @default false
|
|
57
|
+
*/
|
|
58
|
+
requireAuth?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Default moderation status for new comments.
|
|
61
|
+
*
|
|
62
|
+
* @default "pending"
|
|
63
|
+
*/
|
|
64
|
+
defaultStatus?: "pending" | "approved";
|
|
65
|
+
/**
|
|
66
|
+
* Automatically approve comments from authenticated users.
|
|
67
|
+
*
|
|
68
|
+
* @default false
|
|
69
|
+
*/
|
|
70
|
+
autoApproveAuth?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Maximum reply nesting depth for threaded discussions.
|
|
73
|
+
*
|
|
74
|
+
* @default 3
|
|
75
|
+
*/
|
|
76
|
+
threadDepth?: number;
|
|
77
|
+
/**
|
|
78
|
+
* Maximum length in characters for a comment body.
|
|
79
|
+
*
|
|
80
|
+
* @default 5000
|
|
81
|
+
*/
|
|
82
|
+
maxLength?: number;
|
|
83
|
+
/**
|
|
84
|
+
* Rate limiting rules for submitting comments.
|
|
85
|
+
*
|
|
86
|
+
* @default { max: 5, window: "1m" }
|
|
87
|
+
*/
|
|
88
|
+
rateLimit?: {
|
|
89
|
+
max?: number;
|
|
90
|
+
window?: string;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Enable Cloudflare Turnstile bot verification on comment submission.
|
|
94
|
+
*
|
|
95
|
+
* @default false
|
|
96
|
+
*/
|
|
97
|
+
turnstile?: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Allowed reaction identifiers on comments, or boolean to enable default reactions (like, heart, fire).
|
|
100
|
+
*
|
|
101
|
+
* @default true
|
|
102
|
+
*/
|
|
103
|
+
reactions?: boolean | string[];
|
|
104
|
+
/**
|
|
105
|
+
* Enable community reporting and configure automatic hide thresholds.
|
|
106
|
+
*
|
|
107
|
+
* @default true
|
|
108
|
+
*/
|
|
109
|
+
reporting?: boolean | {
|
|
110
|
+
autoHideThreshold?: number;
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* User roles permitted to moderate comments (change status, delete any comment).
|
|
114
|
+
*
|
|
115
|
+
* @default ["admin", "super", "moderator"]
|
|
116
|
+
*/
|
|
117
|
+
roles?: string[];
|
|
118
|
+
/**
|
|
119
|
+
* Content moderation: adult-site blocking, link count limits, and keyword filtering.
|
|
120
|
+
* When omitted, adult content filtering is enabled with up to 2 links allowed.
|
|
121
|
+
*/
|
|
122
|
+
moderation?: CommentsModerationConfig;
|
|
123
|
+
/**
|
|
124
|
+
* Custom HTTP API route prefix for the comments endpoints.
|
|
125
|
+
*
|
|
126
|
+
* @default "/api/comments"
|
|
127
|
+
*/
|
|
128
|
+
prefix?: string;
|
|
129
|
+
}
|
|
130
|
+
/** Configuration options for the Qarpeo Store App */
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface SecondaryDatabaseConfig {
|
|
2
|
+
binding?: string;
|
|
3
|
+
databaseId?: string;
|
|
4
|
+
databaseName?: string;
|
|
5
|
+
migrationsDir?: string;
|
|
6
|
+
hyperdrive?: boolean;
|
|
7
|
+
id?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface DbOptions {
|
|
10
|
+
binding?: string;
|
|
11
|
+
databaseId?: string;
|
|
12
|
+
autoMigrate?: boolean;
|
|
13
|
+
migrateOnBuild?: boolean | "local" | "remote";
|
|
14
|
+
/**
|
|
15
|
+
* Additional zero-config databases (D1 or Hyperdrive).
|
|
16
|
+
*
|
|
17
|
+
* Accepts an array of database names (e.g. `["analytics", "tenants"]`)
|
|
18
|
+
* or a record with custom configuration.
|
|
19
|
+
*
|
|
20
|
+
* Automatically generates wrangler D1 / Hyperdrive bindings and provisions
|
|
21
|
+
* isolated local dev SQLite databases without manual `wrangler.jsonc`.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* databases: ["analytics", "warehouse"]
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
databases?: string[] | Record<string, SecondaryDatabaseConfig>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
export type EmailTemplateName = "welcome" | "magic-link" | "otp" | "order-confirmation" | "invite" | "notification" | string;
|
|
2
|
+
export interface MailTemplateOptions {
|
|
3
|
+
brandColor?: string;
|
|
4
|
+
logoUrl?: string;
|
|
5
|
+
companyName?: string;
|
|
6
|
+
supportEmail?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface EmailTemplateResult {
|
|
9
|
+
subject?: string;
|
|
10
|
+
html: string;
|
|
11
|
+
text?: string;
|
|
12
|
+
}
|
|
13
|
+
export type EmailTemplateHandler<T = any> = (data: T, branding?: MailTemplateOptions) => EmailTemplateResult | Promise<EmailTemplateResult>;
|
|
14
|
+
export interface MailTrackingOptions {
|
|
15
|
+
/**
|
|
16
|
+
* Track email open events via an invisible 1x1 tracking pixel.
|
|
17
|
+
*
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
opens?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Track link clicks by rewriting outgoing HTML links.
|
|
23
|
+
*
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
clicks?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Base URL used for tracking links and pixels (e.g. "https://myapp.com"). Defaults to request
|
|
29
|
+
* host or site URL.
|
|
30
|
+
*/
|
|
31
|
+
baseUrl?: string;
|
|
32
|
+
}
|
|
33
|
+
export type MailSuppressionReason = "bounce" | "complaint" | "unsubscribe" | "manual";
|
|
34
|
+
export type MailSuppressionType = "hard_bounce" | "soft_bounce" | "spam_complaint" | "unsubscribe" | "manual";
|
|
35
|
+
export interface MailSuppressionRecord {
|
|
36
|
+
id: string;
|
|
37
|
+
email: string;
|
|
38
|
+
reason: MailSuppressionReason;
|
|
39
|
+
type: MailSuppressionType;
|
|
40
|
+
source?: string;
|
|
41
|
+
metadata?: Record<string, any>;
|
|
42
|
+
createdAt: number;
|
|
43
|
+
updatedAt: number;
|
|
44
|
+
}
|
|
45
|
+
export interface MailSuppressionOptions {
|
|
46
|
+
/**
|
|
47
|
+
* Automatically add emails to the suppression list upon hard bounce, spam complaints, or
|
|
48
|
+
* unsubscribes.
|
|
49
|
+
*
|
|
50
|
+
* @default true
|
|
51
|
+
*/
|
|
52
|
+
autoSuppress?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Enforce suppression checks prior to dispatching outgoing mail. Suppressed addresses are
|
|
55
|
+
* automatically filtered out to protect sender domain reputation.
|
|
56
|
+
*
|
|
57
|
+
* @default true
|
|
58
|
+
*/
|
|
59
|
+
enforce?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Number of consecutive soft bounces before an address is permanently suppressed.
|
|
62
|
+
*
|
|
63
|
+
* @default 3
|
|
64
|
+
*/
|
|
65
|
+
softBounceThreshold?: number;
|
|
66
|
+
}
|
|
67
|
+
export interface MailUnsubscribeOptions {
|
|
68
|
+
/**
|
|
69
|
+
* Automatically generate and inject RFC 2369 & RFC 8058 compliant `List-Unsubscribe` and
|
|
70
|
+
* `List-Unsubscribe-Post: List-Unsubscribe=One-Click` headers.
|
|
71
|
+
*
|
|
72
|
+
* @default true
|
|
73
|
+
*/
|
|
74
|
+
enabled?: boolean;
|
|
75
|
+
/** Custom unsubscribe URL or base path (e.g. "https://myapp.com/api/mail/unsubscribe"). */
|
|
76
|
+
url?: string;
|
|
77
|
+
/** Mailto fallback address for List-Unsubscribe header (e.g. "unsubscribe@myapp.com"). */
|
|
78
|
+
email?: string;
|
|
79
|
+
/**
|
|
80
|
+
* Secret key used to sign HMAC tokens for unsubscribe links. Defaults to auth secret or session
|
|
81
|
+
* secret.
|
|
82
|
+
*/
|
|
83
|
+
secret?: string;
|
|
84
|
+
}
|
|
85
|
+
export interface SendMailRequest {
|
|
86
|
+
to: string | string[];
|
|
87
|
+
from?: string;
|
|
88
|
+
/** Email subject line. Optional when provided by a template. */
|
|
89
|
+
subject?: string;
|
|
90
|
+
template?: EmailTemplateName;
|
|
91
|
+
data?: Record<string, any>;
|
|
92
|
+
html?: string;
|
|
93
|
+
text?: string;
|
|
94
|
+
/** Markdown body content. Automatically parsed into responsive, email-client-safe HTML. */
|
|
95
|
+
markdown?: string;
|
|
96
|
+
replyTo?: string;
|
|
97
|
+
cc?: string | string[];
|
|
98
|
+
bcc?: string | string[];
|
|
99
|
+
headers?: Record<string, string>;
|
|
100
|
+
/** Queue this email for asynchronous background delivery via Cloudflare Queues. */
|
|
101
|
+
queue?: boolean;
|
|
102
|
+
/** Enable open/click tracking for this specific message. */
|
|
103
|
+
track?: boolean | {
|
|
104
|
+
opens?: boolean;
|
|
105
|
+
clicks?: boolean;
|
|
106
|
+
};
|
|
107
|
+
/** Arbitrary metadata associated with this message for tracking, analytics, and webhooks. */
|
|
108
|
+
metadata?: Record<string, any>;
|
|
109
|
+
/**
|
|
110
|
+
* Enable or customize RFC 2369 / RFC 8058 List-Unsubscribe headers for this message. Set alse to
|
|
111
|
+
* disable for transactional emails (e.g. OTP, password reset).
|
|
112
|
+
*/
|
|
113
|
+
unsubscribe?: boolean | {
|
|
114
|
+
url?: string;
|
|
115
|
+
email?: string;
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* Whether to check the suppression list before sending. Set alse to bypass suppression checks for
|
|
119
|
+
* critical security or transactional emails.
|
|
120
|
+
*
|
|
121
|
+
* @default true
|
|
122
|
+
*/
|
|
123
|
+
suppression?: boolean;
|
|
124
|
+
}
|
|
125
|
+
export interface MailResult {
|
|
126
|
+
success: boolean;
|
|
127
|
+
messageId: string;
|
|
128
|
+
timestamp: number;
|
|
129
|
+
previewUrl?: string;
|
|
130
|
+
queued?: boolean;
|
|
131
|
+
/** Whether the send was skipped because all recipients are suppressed */
|
|
132
|
+
suppressed?: boolean;
|
|
133
|
+
/** List of recipient addresses that were suppressed and excluded from delivery */
|
|
134
|
+
suppressedRecipients?: string[];
|
|
135
|
+
}
|
|
136
|
+
export interface MailOptions {
|
|
137
|
+
/** Default sender address (e.g. "My App [noreply@myapp.com](mailto:noreply@myapp.com)"). */
|
|
138
|
+
from?: string;
|
|
139
|
+
/**
|
|
140
|
+
* Delivery provider.
|
|
141
|
+
*
|
|
142
|
+
* - 'cloudflare': Cloudflare send_email binding (default)
|
|
143
|
+
* - 'resend': Resend API
|
|
144
|
+
* - 'postmark': Postmark API
|
|
145
|
+
* - 'dev': In-memory dev mailbox intercept only
|
|
146
|
+
*
|
|
147
|
+
* @default "cloudflare"
|
|
148
|
+
*/
|
|
149
|
+
provider?: "cloudflare" | "resend" | "postmark" | "dev";
|
|
150
|
+
/** API Key for external providers (Resend, Postmark). */
|
|
151
|
+
apiKey?: string;
|
|
152
|
+
/** Branding options applied to built-in email templates. */
|
|
153
|
+
branding?: MailTemplateOptions;
|
|
154
|
+
/**
|
|
155
|
+
* Enable in-browser Dev Mailbox preview during local development.
|
|
156
|
+
*
|
|
157
|
+
* @default true
|
|
158
|
+
*/
|
|
159
|
+
devMailbox?: boolean;
|
|
160
|
+
/**
|
|
161
|
+
* Enable queue-backed background email delivery using Cloudflare Queues. When true, messages sent
|
|
162
|
+
* with sendMail are enqueued and delivered asynchronously with automatic retries and exponential
|
|
163
|
+
* backoff.
|
|
164
|
+
*
|
|
165
|
+
* @default false
|
|
166
|
+
*/
|
|
167
|
+
queue?: boolean | string;
|
|
168
|
+
/** Configure open and click tracking. */
|
|
169
|
+
tracking?: MailTrackingOptions;
|
|
170
|
+
/**
|
|
171
|
+
* Email suppression list configuration for managing bounces, spam complaints, and unsubscribes.
|
|
172
|
+
*
|
|
173
|
+
* @default true
|
|
174
|
+
*/
|
|
175
|
+
suppression?: boolean | MailSuppressionOptions;
|
|
176
|
+
/**
|
|
177
|
+
* RFC 2369 & RFC 8058 compliant List-Unsubscribe and one-click unsubscribe configuration.
|
|
178
|
+
*
|
|
179
|
+
* @default true
|
|
180
|
+
*/
|
|
181
|
+
unsubscribe?: boolean | MailUnsubscribeOptions;
|
|
182
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export * from "./auth";
|
|
2
|
+
export * from "./storage";
|
|
3
|
+
export * from "./jobs";
|
|
4
|
+
export * from "./ratelimit";
|
|
5
|
+
export * from "./analytics";
|
|
6
|
+
export * from "./tenant";
|
|
7
|
+
export * from "./email";
|
|
8
|
+
export * from "./cache";
|
|
9
|
+
export * from "./ai";
|
|
10
|
+
export * from "./cms";
|
|
11
|
+
export * from "./realtime";
|
|
12
|
+
export * from "./payments";
|
|
13
|
+
export * from "./site";
|
|
14
|
+
export * from "./comments";
|
|
15
|
+
export * from "./store-options";
|
|
16
|
+
export type { StoreOptions } from "./store-options";
|
|
17
|
+
export * from "./db";
|
|
18
|
+
export * from "./notifications";
|
|
19
|
+
export * from "./options";
|
|
20
|
+
export * from "../runtime/types/durable-object";
|
|
21
|
+
export * from "../runtime/types/store";
|
|
22
|
+
export * from "../runtime/types/workflows";
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export interface JobsOptions {
|
|
2
|
+
/**
|
|
3
|
+
* Cloudflare Queue binding name override.
|
|
4
|
+
*
|
|
5
|
+
* @default "QUEUE"
|
|
6
|
+
*/
|
|
7
|
+
binding?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Directory where background jobs are located.
|
|
10
|
+
*
|
|
11
|
+
* @default "server/jobs"
|
|
12
|
+
*/
|
|
13
|
+
dir?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Maximum retry attempts for failed jobs.
|
|
16
|
+
*
|
|
17
|
+
* @default 3
|
|
18
|
+
*/
|
|
19
|
+
maxRetries?: number;
|
|
20
|
+
/**
|
|
21
|
+
* Maximum batch size delivered to consumer.
|
|
22
|
+
*
|
|
23
|
+
* @default 10
|
|
24
|
+
*/
|
|
25
|
+
maxBatchSize?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Maximum batch timeout in seconds before delivering.
|
|
28
|
+
*
|
|
29
|
+
* @default 5
|
|
30
|
+
*/
|
|
31
|
+
maxBatchTimeout?: number;
|
|
32
|
+
}
|
|
33
|
+
export interface JobContext {
|
|
34
|
+
/** Unique message/job ID */
|
|
35
|
+
id: string;
|
|
36
|
+
/** Timestamp when the job was dispatched */
|
|
37
|
+
timestamp: Date;
|
|
38
|
+
/** Delivery attempt count (starts at 1) */
|
|
39
|
+
attempts: number;
|
|
40
|
+
/** Name of the job being executed */
|
|
41
|
+
jobName: string;
|
|
42
|
+
/** Manually request a retry for this message */
|
|
43
|
+
retry: () => void;
|
|
44
|
+
/** Manually acknowledge this message */
|
|
45
|
+
ack: () => void;
|
|
46
|
+
}
|
|
47
|
+
export type JobHandler<T = any> = (data: T, context: JobContext) => Promise<void> | void;
|
|
48
|
+
export interface JobDefinitionOptions {
|
|
49
|
+
/** Override queue binding */
|
|
50
|
+
binding?: string;
|
|
51
|
+
/** Max retries before dead-letter */
|
|
52
|
+
maxRetries?: number;
|
|
53
|
+
}
|
|
54
|
+
export interface JobDefinition<T = any> {
|
|
55
|
+
name: string;
|
|
56
|
+
handler: JobHandler<T>;
|
|
57
|
+
options?: JobDefinitionOptions;
|
|
58
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export type NotificationChannel = "in-app" | "push" | "email";
|
|
2
|
+
export interface NotificationRecord {
|
|
3
|
+
id: string;
|
|
4
|
+
userId: string;
|
|
5
|
+
tenantId?: string;
|
|
6
|
+
title: string;
|
|
7
|
+
body?: string;
|
|
8
|
+
icon?: string;
|
|
9
|
+
actionUrl?: string;
|
|
10
|
+
channels: NotificationChannel[];
|
|
11
|
+
read: boolean;
|
|
12
|
+
readAt?: number;
|
|
13
|
+
createdAt: number;
|
|
14
|
+
metadata?: Record<string, any>;
|
|
15
|
+
/**
|
|
16
|
+
* Enable or customize RFC 2369 / RFC 8058 List-Unsubscribe headers for this message. Set alse to
|
|
17
|
+
* disable for transactional emails (e.g. OTP, password reset).
|
|
18
|
+
*/
|
|
19
|
+
unsubscribe?: boolean | {
|
|
20
|
+
url?: string;
|
|
21
|
+
email?: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Whether to check the suppression list before sending. Set alse to bypass suppression checks for
|
|
25
|
+
* critical security or transactional emails.
|
|
26
|
+
*
|
|
27
|
+
* @default true
|
|
28
|
+
*/
|
|
29
|
+
suppression?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface PushSubscriptionKeys {
|
|
32
|
+
p256dh: string;
|
|
33
|
+
auth: string;
|
|
34
|
+
}
|
|
35
|
+
export interface PushSubscriptionRecord {
|
|
36
|
+
endpoint: string;
|
|
37
|
+
keys: PushSubscriptionKeys;
|
|
38
|
+
}
|
|
39
|
+
export interface SendNotificationRequest {
|
|
40
|
+
userId: string;
|
|
41
|
+
title: string;
|
|
42
|
+
body?: string;
|
|
43
|
+
icon?: string;
|
|
44
|
+
actionUrl?: string;
|
|
45
|
+
channels?: NotificationChannel[];
|
|
46
|
+
tenantId?: string;
|
|
47
|
+
metadata?: Record<string, any>;
|
|
48
|
+
emailOptions?: {
|
|
49
|
+
subject?: string;
|
|
50
|
+
from?: string;
|
|
51
|
+
template?: string;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export interface NotificationsVapidOptions {
|
|
55
|
+
publicKey: string;
|
|
56
|
+
privateKey: string;
|
|
57
|
+
subject?: string;
|
|
58
|
+
}
|
|
59
|
+
export interface NotificationsOptions {
|
|
60
|
+
/**
|
|
61
|
+
* Cloudflare D1 table name for notifications.
|
|
62
|
+
*
|
|
63
|
+
* @default "notification"
|
|
64
|
+
*/
|
|
65
|
+
tableName?: string;
|
|
66
|
+
/**
|
|
67
|
+
* VAPID configuration for browser Web Push notifications. Can also be configured via
|
|
68
|
+
* NUXT_VAPID_PUBLIC_KEY, NUXT_VAPID_PRIVATE_KEY, NUXT_VAPID_SUBJECT.
|
|
69
|
+
*/
|
|
70
|
+
vapid?: NotificationsVapidOptions;
|
|
71
|
+
/**
|
|
72
|
+
* Default notification channels when none specified.
|
|
73
|
+
*
|
|
74
|
+
* @default ["in-app"]
|
|
75
|
+
*/
|
|
76
|
+
channels?: NotificationChannel[];
|
|
77
|
+
}
|