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.
Files changed (260) hide show
  1. package/dist/chunks/tools.mjs +993 -31
  2. package/dist/cli/index.mjs +1071 -31
  3. package/dist/fate/index.d.ts +9 -1
  4. package/dist/fate/index.mjs +20 -3
  5. package/dist/module.mjs +296 -750
  6. package/dist/runtime/browser.mjs +2 -2
  7. package/dist/runtime/comments-server.d.ts +3 -0
  8. package/dist/runtime/comments-server.mjs +2 -0
  9. package/dist/runtime/comments.d.ts +0 -2
  10. package/dist/runtime/comments.mjs +0 -2
  11. package/dist/runtime/db.d.ts +10 -9
  12. package/dist/runtime/db.mjs +79 -8
  13. package/dist/runtime/drizzle.mjs +21 -6
  14. package/dist/runtime/index.d.ts +4 -0
  15. package/dist/runtime/realtime-server.d.ts +4 -0
  16. package/dist/runtime/realtime-server.mjs +13 -0
  17. package/dist/runtime/realtime.d.ts +1 -4
  18. package/dist/runtime/realtime.mjs +0 -13
  19. package/dist/runtime/replica.d.ts +27 -0
  20. package/dist/runtime/replica.mjs +229 -0
  21. package/dist/runtime/server/durable-objects/agent.mjs +14 -2
  22. package/dist/runtime/server/durable-objects/room.d.ts +10 -0
  23. package/dist/runtime/server/durable-objects/room.mjs +119 -28
  24. package/dist/runtime/server/middleware/devtools.mjs +1 -1
  25. package/dist/runtime/server/middleware/tenancy.mjs +7 -4
  26. package/dist/runtime/server/plugins/store.mjs +1 -1
  27. package/dist/runtime/server/routes/__qarpeo/mail/track/click/[id].get.mjs +57 -17
  28. package/dist/runtime/server/routes/agents/[agent]/chat.post.mjs +19 -12
  29. package/dist/runtime/server/routes/agents/[agent]/clear.post.mjs +8 -9
  30. package/dist/runtime/server/routes/agents/[agent]/history.get.mjs +8 -9
  31. package/dist/runtime/server/routes/analytics/events.get.mjs +12 -2
  32. package/dist/runtime/server/routes/analytics/pageviews.get.mjs +10 -1
  33. package/dist/runtime/server/routes/analytics/summary.get.mjs +10 -1
  34. package/dist/runtime/server/routes/auth/2fa/disable.post.mjs +11 -2
  35. package/dist/runtime/server/routes/auth/2fa/setup.post.mjs +7 -0
  36. package/dist/runtime/server/routes/auth/2fa/verify.post.mjs +11 -2
  37. package/dist/runtime/server/routes/auth/account.delete.mjs +7 -0
  38. package/dist/runtime/server/routes/auth/magic-link/verify.get.mjs +5 -3
  39. package/dist/runtime/server/routes/auth/organization/sso/index.post.mjs +10 -0
  40. package/dist/runtime/server/routes/auth/otp/verify.post.mjs +5 -3
  41. package/dist/runtime/server/routes/auth/sso/saml/acs.post.mjs +18 -0
  42. package/dist/runtime/server/routes/auth/webauthn/login/options.post.d.ts +1 -1
  43. package/dist/runtime/server/routes/auth/webauthn/login/options.post.mjs +11 -2
  44. package/dist/runtime/server/routes/auth/webauthn/login/verify.post.mjs +10 -1
  45. package/dist/runtime/server/routes/auth/webauthn/register/options.post.d.ts +1 -1
  46. package/dist/runtime/server/routes/auth/webauthn/register/options.post.mjs +10 -1
  47. package/dist/runtime/server/routes/auth/webauthn/register/verify.post.mjs +10 -1
  48. package/dist/runtime/server/routes/browser/crawl.post.mjs +13 -0
  49. package/dist/runtime/server/routes/browser/invoice.post.mjs +15 -1
  50. package/dist/runtime/server/routes/browser/og-image.post.mjs +13 -0
  51. package/dist/runtime/server/routes/browser/pdf.post.mjs +15 -1
  52. package/dist/runtime/server/routes/browser/screenshot.post.mjs +13 -0
  53. package/dist/runtime/server/routes/cms/[collection]/[id]/preview-token.post.mjs +23 -8
  54. package/dist/runtime/server/routes/cms/[collection]/[id]/publish.post.mjs +2 -1
  55. package/dist/runtime/server/routes/cms/[collection]/[id]/review.post.mjs +2 -1
  56. package/dist/runtime/server/routes/cms/[collection]/[id]/revisions/[revId]/restore.post.mjs +2 -1
  57. package/dist/runtime/server/routes/cms/[collection]/[id].delete.mjs +2 -1
  58. package/dist/runtime/server/routes/cms/[collection]/[id].put.mjs +2 -1
  59. package/dist/runtime/server/routes/cms/[collection]/index.post.mjs +2 -1
  60. package/dist/runtime/server/routes/cms/categories/[id].delete.mjs +2 -1
  61. package/dist/runtime/server/routes/cms/categories/[id].put.mjs +2 -1
  62. package/dist/runtime/server/routes/cms/categories.post.mjs +2 -1
  63. package/dist/runtime/server/routes/cms/collections/[id].delete.mjs +2 -1
  64. package/dist/runtime/server/routes/cms/collections/[id].put.mjs +2 -1
  65. package/dist/runtime/server/routes/cms/collections/index.post.mjs +2 -1
  66. package/dist/runtime/server/routes/cms/export.post.mjs +1 -1
  67. package/dist/runtime/server/routes/cms/subscribers/[id].delete.mjs +2 -1
  68. package/dist/runtime/server/routes/cms/subscribers/[id].patch.mjs +2 -1
  69. package/dist/runtime/server/routes/cms/tags/[id].delete.mjs +2 -1
  70. package/dist/runtime/server/routes/cms/tags.post.mjs +2 -1
  71. package/dist/runtime/server/routes/comments/[id]/react.post.mjs +7 -3
  72. package/dist/runtime/server/routes/comments/[id]/report.post.mjs +3 -0
  73. package/dist/runtime/server/routes/comments/[id].delete.mjs +1 -1
  74. package/dist/runtime/server/routes/comments/[id].get.mjs +13 -0
  75. package/dist/runtime/server/routes/comments/[id].patch.mjs +1 -1
  76. package/dist/runtime/server/routes/fate.d.ts +6 -0
  77. package/dist/runtime/server/routes/fate.mjs +32 -3
  78. package/dist/runtime/server/routes/mail/bounce.post.mjs +14 -2
  79. package/dist/runtime/server/routes/mail/unsubscribe.mjs +2 -1
  80. package/dist/runtime/server/routes/mail/webhooks.post.mjs +18 -4
  81. package/dist/runtime/server/routes/notifications/[id].get.mjs +3 -4
  82. package/dist/runtime/server/routes/notifications/index.get.mjs +4 -2
  83. package/dist/runtime/server/routes/notifications/push/subscribe.post.mjs +3 -1
  84. package/dist/runtime/server/routes/notifications/push/unsubscribe.post.mjs +5 -3
  85. package/dist/runtime/server/routes/notifications/read-all.post.mjs +6 -2
  86. package/dist/runtime/server/routes/notifications/send.post.mjs +13 -2
  87. package/dist/runtime/server/routes/payments/cancel.post.mjs +1 -1
  88. package/dist/runtime/server/routes/payments/change-plan.post.mjs +1 -1
  89. package/dist/runtime/server/routes/payments/checkout.post.mjs +1 -1
  90. package/dist/runtime/server/routes/payments/pause.post.mjs +1 -1
  91. package/dist/runtime/server/routes/payments/portal.post.mjs +1 -1
  92. package/dist/runtime/server/routes/payments/subscription.get.mjs +1 -1
  93. package/dist/runtime/server/routes/payments/usage.get.mjs +1 -1
  94. package/dist/runtime/server/routes/payments/usage.post.mjs +1 -1
  95. package/dist/runtime/server/routes/payments/webhook.post.mjs +8 -1
  96. package/dist/runtime/server/routes/realtime/broadcast.post.mjs +3 -2
  97. package/dist/runtime/server/routes/realtime/history.delete.mjs +2 -2
  98. package/dist/runtime/server/routes/realtime/history.get.mjs +2 -2
  99. package/dist/runtime/server/routes/realtime/presence.get.mjs +3 -3
  100. package/dist/runtime/server/routes/realtime/state.get.mjs +3 -3
  101. package/dist/runtime/server/routes/realtime/state.post.mjs +13 -4
  102. package/dist/runtime/server/routes/realtime/ws.get.mjs +2 -2
  103. package/dist/runtime/server/routes/storage/file/[...key].delete.mjs +1 -1
  104. package/dist/runtime/server/routes/storage/file/[...key].get.mjs +7 -0
  105. package/dist/runtime/server/routes/storage/files.get.d.ts +1 -1
  106. package/dist/runtime/server/routes/storage/files.get.mjs +24 -4
  107. package/dist/runtime/server/routes/storage/multipart/abort.post.mjs +16 -1
  108. package/dist/runtime/server/routes/storage/multipart/complete.post.d.ts +1 -1
  109. package/dist/runtime/server/routes/storage/multipart/complete.post.mjs +15 -1
  110. package/dist/runtime/server/routes/storage/multipart/create.post.mjs +7 -0
  111. package/dist/runtime/server/routes/storage/multipart/part.put.mjs +15 -1
  112. package/dist/runtime/server/routes/storage/presigned-r2.post.mjs +8 -1
  113. package/dist/runtime/server/routes/storage/presigned.post.d.ts +1 -1
  114. package/dist/runtime/server/routes/storage/presigned.post.mjs +8 -1
  115. package/dist/runtime/server/routes/storage/sign.post.mjs +7 -0
  116. package/dist/runtime/server/routes/storage/upload.post.d.ts +2 -2
  117. package/dist/runtime/server/routes/store/cart/index.delete.mjs +3 -4
  118. package/dist/runtime/server/routes/store/cart/index.get.mjs +3 -10
  119. package/dist/runtime/server/routes/store/cart/items/[id].delete.mjs +6 -4
  120. package/dist/runtime/server/routes/store/cart/items/[id].patch.mjs +12 -4
  121. package/dist/runtime/server/routes/store/cart/items.post.mjs +9 -10
  122. package/dist/runtime/server/routes/store/categories/index.get.mjs +4 -2
  123. package/dist/runtime/server/routes/store/checkout.post.mjs +13 -3
  124. package/dist/runtime/server/routes/store/coupons/apply.post.mjs +6 -5
  125. package/dist/runtime/server/routes/store/orders/[id].get.mjs +2 -2
  126. package/dist/runtime/server/routes/store/orders/download/[token].get.mjs +6 -3
  127. package/dist/runtime/server/routes/store/orders/index.get.mjs +1 -1
  128. package/dist/runtime/server/routes/store/products/[slug].get.mjs +2 -2
  129. package/dist/runtime/server/routes/store/products/index.get.mjs +1 -1
  130. package/dist/runtime/server/routes/store/tax/calculate.post.mjs +10 -0
  131. package/dist/runtime/server/routes/tenants/[tenant]/domains/[domain]/index.delete.mjs +26 -25
  132. package/dist/runtime/server/routes/tenants/[tenant]/domains/[domain]/verify.post.mjs +26 -25
  133. package/dist/runtime/server/utils/ai.d.ts +6 -0
  134. package/dist/runtime/server/utils/ai.mjs +12 -2
  135. package/dist/runtime/server/utils/analytics-query.mjs +8 -4
  136. package/dist/runtime/server/utils/browser-utils.d.ts +9 -0
  137. package/dist/runtime/server/utils/browser-utils.mjs +135 -0
  138. package/dist/runtime/server/utils/cms/cache.d.ts +13 -0
  139. package/dist/runtime/server/utils/cms/cache.mjs +95 -0
  140. package/dist/runtime/server/utils/cms/common.mjs +1 -1
  141. package/dist/runtime/server/utils/cms/markdown.mjs +38 -8
  142. package/dist/runtime/server/utils/cms/mutations.d.ts +26 -0
  143. package/dist/runtime/server/utils/cms/mutations.mjs +569 -0
  144. package/dist/runtime/server/utils/cms/path.d.ts +8 -0
  145. package/dist/runtime/server/utils/cms/path.mjs +23 -0
  146. package/dist/runtime/server/utils/cms/queries.d.ts +27 -0
  147. package/dist/runtime/server/utils/cms/queries.mjs +366 -0
  148. package/dist/runtime/server/utils/cms/references.d.ts +48 -0
  149. package/dist/runtime/server/utils/cms/references.mjs +309 -0
  150. package/dist/runtime/server/utils/cms/revisions.d.ts +7 -0
  151. package/dist/runtime/server/utils/cms/revisions.mjs +60 -0
  152. package/dist/runtime/server/utils/cms/sync.mjs +3 -3
  153. package/dist/runtime/server/utils/cms.d.ts +5 -82
  154. package/dist/runtime/server/utils/cms.mjs +28 -1367
  155. package/dist/runtime/server/utils/comments.d.ts +11 -0
  156. package/dist/runtime/server/utils/comments.mjs +65 -17
  157. package/dist/runtime/server/utils/crypto.mjs +1 -1
  158. package/dist/runtime/server/utils/domains.mjs +9 -0
  159. package/dist/runtime/server/utils/drizzle.d.ts +26 -1
  160. package/dist/runtime/server/utils/drizzle.mjs +78 -19
  161. package/dist/runtime/server/utils/email-inbound.mjs +9 -1
  162. package/dist/runtime/server/utils/impersonation.mjs +58 -1
  163. package/dist/runtime/server/utils/lock.d.ts +11 -0
  164. package/dist/runtime/server/utils/lock.mjs +4 -0
  165. package/dist/runtime/server/utils/mail-suppression.mjs +48 -13
  166. package/dist/runtime/server/utils/mail.d.ts +2 -1
  167. package/dist/runtime/server/utils/mail.mjs +17 -11
  168. package/dist/runtime/server/utils/notifications.d.ts +13 -4
  169. package/dist/runtime/server/utils/notifications.mjs +20 -4
  170. package/dist/runtime/server/utils/organization.mjs +36 -1
  171. package/dist/runtime/server/utils/passwordless.mjs +8 -0
  172. package/dist/runtime/server/utils/payments/checkout.d.ts +34 -0
  173. package/dist/runtime/server/utils/payments/checkout.mjs +158 -0
  174. package/dist/runtime/server/utils/payments/common.d.ts +45 -0
  175. package/dist/runtime/server/utils/payments/common.mjs +234 -0
  176. package/dist/runtime/server/utils/payments/index.d.ts +9 -0
  177. package/dist/runtime/server/utils/payments/index.mjs +21 -0
  178. package/dist/runtime/server/utils/payments/lemonsqueezy.d.ts +7 -0
  179. package/dist/runtime/server/utils/payments/lemonsqueezy.mjs +55 -0
  180. package/dist/runtime/server/utils/payments/paddle.d.ts +7 -0
  181. package/dist/runtime/server/utils/payments/paddle.mjs +92 -0
  182. package/dist/runtime/server/utils/payments/polar.d.ts +11 -0
  183. package/dist/runtime/server/utils/payments/polar.mjs +66 -0
  184. package/dist/runtime/server/utils/payments/stripe.d.ts +7 -0
  185. package/dist/runtime/server/utils/payments/stripe.mjs +159 -0
  186. package/dist/runtime/server/utils/payments/subscriptions.d.ts +89 -0
  187. package/dist/runtime/server/utils/payments/subscriptions.mjs +236 -0
  188. package/dist/runtime/server/utils/payments/usage.d.ts +12 -0
  189. package/dist/runtime/server/utils/payments/usage.mjs +143 -0
  190. package/dist/runtime/server/utils/payments/webhooks.d.ts +10 -0
  191. package/dist/runtime/server/utils/payments/webhooks.mjs +200 -0
  192. package/dist/runtime/server/utils/payments.d.ts +1 -158
  193. package/dist/runtime/server/utils/payments.mjs +1 -1289
  194. package/dist/runtime/server/utils/queue.d.ts +2 -0
  195. package/dist/runtime/server/utils/queue.mjs +34 -21
  196. package/dist/runtime/server/utils/rag.mjs +30 -17
  197. package/dist/runtime/server/utils/realtime.d.ts +5 -1
  198. package/dist/runtime/server/utils/realtime.mjs +43 -7
  199. package/dist/runtime/server/utils/session.mjs +16 -3
  200. package/dist/runtime/server/utils/sso.d.ts +3 -0
  201. package/dist/runtime/server/utils/sso.mjs +43 -0
  202. package/dist/runtime/server/utils/storage.mjs +12 -1
  203. package/dist/runtime/server/utils/store/cart.d.ts +63 -0
  204. package/dist/runtime/server/utils/store/cart.mjs +542 -0
  205. package/dist/runtime/server/utils/store/checkout.d.ts +14 -0
  206. package/dist/runtime/server/utils/store/checkout.mjs +118 -0
  207. package/dist/runtime/server/utils/store/common.d.ts +29 -0
  208. package/dist/runtime/server/utils/store/common.mjs +479 -0
  209. package/dist/runtime/server/utils/store/index.d.ts +7 -0
  210. package/dist/runtime/server/utils/store/index.mjs +30 -0
  211. package/dist/runtime/server/utils/store/inventory.d.ts +25 -0
  212. package/dist/runtime/server/utils/store/inventory.mjs +190 -0
  213. package/dist/runtime/server/utils/store/orders.d.ts +60 -0
  214. package/dist/runtime/server/utils/store/orders.mjs +590 -0
  215. package/dist/runtime/server/utils/store/products.d.ts +35 -0
  216. package/dist/runtime/server/utils/store/products.mjs +461 -0
  217. package/dist/runtime/server/utils/store/vendor.d.ts +18 -0
  218. package/dist/runtime/server/utils/store/vendor.mjs +68 -0
  219. package/dist/runtime/server/utils/store.d.ts +1 -207
  220. package/dist/runtime/server/utils/store.mjs +1 -2227
  221. package/dist/runtime/server/utils/string.d.ts +1 -1
  222. package/dist/runtime/server/utils/string.mjs +12 -4
  223. package/dist/runtime/server/utils/tenant.mjs +19 -5
  224. package/dist/runtime/server/utils/tracker.mjs +2 -0
  225. package/dist/runtime/server.d.ts +3 -3
  226. package/dist/runtime/server.mjs +4 -4
  227. package/dist/runtime/storage-server.d.ts +2 -0
  228. package/dist/runtime/storage-server.mjs +1 -0
  229. package/dist/runtime/storage.d.ts +1 -1
  230. package/dist/runtime/storage.mjs +0 -1
  231. package/dist/runtime/store.d.ts +0 -1
  232. package/dist/runtime/store.mjs +0 -1
  233. package/dist/runtime/test-utils.d.ts +4 -0
  234. package/dist/runtime/test-utils.mjs +54 -0
  235. package/dist/runtime/types/d1.d.ts +43 -0
  236. package/dist/runtime/types/drizzle.d.ts +6 -0
  237. package/dist/runtime/types/store.d.ts +1 -1
  238. package/dist/types/analytics.d.ts +80 -0
  239. package/dist/types/auth.d.ts +282 -0
  240. package/dist/types/cache.d.ts +55 -0
  241. package/dist/types/comments.d.ts +130 -0
  242. package/dist/types/db.d.ts +29 -0
  243. package/dist/types/email.d.ts +182 -0
  244. package/dist/types/index.d.ts +22 -0
  245. package/dist/types/jobs.d.ts +58 -0
  246. package/dist/types/notifications.d.ts +77 -0
  247. package/dist/types/options.d.ts +363 -0
  248. package/dist/types/payments.d.ts +145 -0
  249. package/dist/types/ratelimit.d.ts +71 -0
  250. package/dist/types/realtime.d.ts +136 -0
  251. package/dist/types/site.d.ts +121 -0
  252. package/dist/types/storage.d.ts +164 -0
  253. package/dist/types/store-options.d.ts +199 -0
  254. package/dist/types/tenant.d.ts +100 -0
  255. package/dist/types.d.ts +1 -2174
  256. package/dist/utils/migration-lock.d.ts +139 -0
  257. package/dist/utils/pkg.d.ts +14 -1
  258. package/dist/utils/schema-diff.d.ts +39 -0
  259. package/package.json +55 -17
  260. 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
+ }