qarpeo 0.1.35 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (363) hide show
  1. package/README.md +114 -26
  2. package/dist/apps/cms.d.ts +4 -0
  3. package/dist/apps/comments.d.ts +4 -0
  4. package/dist/apps/payments.d.ts +4 -0
  5. package/dist/apps/store.d.ts +4 -0
  6. package/dist/chunks/auth-schema.mjs +169 -30
  7. package/dist/chunks/tools.mjs +1680 -0
  8. package/dist/cli/index.mjs +1256 -221
  9. package/dist/core/aliases.d.ts +5 -0
  10. package/dist/core/context.d.ts +10 -0
  11. package/dist/core/cross-drive.d.ts +2 -0
  12. package/dist/core/d1-migrate.d.ts +4 -0
  13. package/dist/core/devtools.d.ts +4 -0
  14. package/dist/core/nitro.d.ts +4 -0
  15. package/dist/core/schema.d.ts +4 -0
  16. package/dist/core/server-utils.d.ts +4 -0
  17. package/dist/core/wrangler.d.ts +4 -0
  18. package/dist/dev/wrangler.d.ts +1 -0
  19. package/dist/fate/index.d.ts +8 -8
  20. package/dist/features/agents.d.ts +4 -0
  21. package/dist/features/auth.d.ts +4 -0
  22. package/dist/features/bots.d.ts +4 -0
  23. package/dist/features/fate.d.ts +4 -0
  24. package/dist/features/mail.d.ts +4 -0
  25. package/dist/features/mcp.d.ts +4 -0
  26. package/dist/features/multitenant.d.ts +4 -0
  27. package/dist/features/notifications.d.ts +4 -0
  28. package/dist/features/realtime.d.ts +4 -0
  29. package/dist/module.d.ts +10 -2
  30. package/dist/module.mjs +6313 -5118
  31. package/dist/primitives/ai.d.ts +4 -0
  32. package/dist/primitives/analytics.d.ts +4 -0
  33. package/dist/primitives/blob.d.ts +4 -0
  34. package/dist/primitives/browser.d.ts +4 -0
  35. package/dist/primitives/cache.d.ts +4 -0
  36. package/dist/primitives/d1.d.ts +4 -0
  37. package/dist/primitives/do.d.ts +4 -0
  38. package/dist/primitives/email.d.ts +4 -0
  39. package/dist/primitives/hyperdrive.d.ts +4 -0
  40. package/dist/primitives/kv.d.ts +4 -0
  41. package/dist/primitives/queue.d.ts +4 -0
  42. package/dist/primitives/ratelimit.d.ts +4 -0
  43. package/dist/primitives/vectorize.d.ts +4 -0
  44. package/dist/primitives/workflows.d.ts +4 -0
  45. package/dist/runtime/ai.d.ts +3 -3
  46. package/dist/runtime/ai.mjs +8 -1
  47. package/dist/runtime/app/components/RealtimeCursors.vue +2 -2
  48. package/dist/runtime/app/composables/ai.d.ts +56 -29
  49. package/dist/runtime/app/composables/analytics.d.ts +26 -106
  50. package/dist/runtime/app/composables/api-tokens.d.ts +31 -34
  51. package/dist/runtime/app/composables/auth.d.ts +147 -51
  52. package/dist/runtime/app/composables/auth.mjs +0 -7
  53. package/dist/runtime/app/composables/chat.d.ts +38 -35
  54. package/dist/runtime/app/composables/cms-preview.d.ts +30 -25
  55. package/dist/runtime/app/composables/cms.d.ts +57 -282
  56. package/dist/runtime/app/composables/cms.mjs +0 -35
  57. package/dist/runtime/app/composables/comments.d.ts +32 -5
  58. package/dist/runtime/app/composables/comments.mjs +29 -1
  59. package/dist/runtime/app/composables/docs-version.d.ts +25 -28
  60. package/dist/runtime/app/composables/impersonation.d.ts +22 -5
  61. package/dist/runtime/app/composables/organization.d.ts +38 -91
  62. package/dist/runtime/app/composables/passkey.d.ts +22 -6
  63. package/dist/runtime/app/composables/passwordless.d.ts +24 -7
  64. package/dist/runtime/app/composables/payments.d.ts +50 -34
  65. package/dist/runtime/app/composables/payments.mjs +1 -0
  66. package/dist/runtime/app/composables/sse.d.ts +76 -0
  67. package/dist/runtime/app/composables/sse.mjs +152 -0
  68. package/dist/runtime/app/composables/storage.d.ts +53 -65
  69. package/dist/runtime/app/composables/storage.mjs +17 -0
  70. package/dist/runtime/app/composables/store.d.ts +198 -0
  71. package/dist/runtime/app/composables/store.mjs +414 -0
  72. package/dist/runtime/app/composables/tenant.d.ts +31 -72
  73. package/dist/runtime/app/composables/turnstile.d.ts +16 -3
  74. package/dist/runtime/app/composables/two-factor.d.ts +23 -6
  75. package/dist/runtime/app/pages/devtools/notifications.vue +30 -27
  76. package/dist/runtime/app/pages/devtools/realtime.vue +19 -31
  77. package/dist/runtime/app/pages/devtools.vue +0 -7
  78. package/dist/runtime/auth.d.ts +9 -9
  79. package/dist/runtime/blob.d.ts +10 -1
  80. package/dist/runtime/blob.mjs +83 -0
  81. package/dist/runtime/cache.d.ts +48 -0
  82. package/dist/runtime/cache.mjs +92 -0
  83. package/dist/runtime/comments.d.ts +4 -0
  84. package/dist/runtime/comments.mjs +2 -0
  85. package/dist/runtime/db.d.ts +21 -1
  86. package/dist/runtime/db.mjs +54 -0
  87. package/dist/runtime/drizzle.d.ts +4 -2
  88. package/dist/runtime/drizzle.mjs +68 -1
  89. package/dist/runtime/durable-object.d.ts +2 -0
  90. package/dist/runtime/durable-object.mjs +2 -0
  91. package/dist/runtime/email.d.ts +1 -1
  92. package/dist/runtime/email.mjs +1 -1
  93. package/dist/runtime/kv.mjs +50 -1
  94. package/dist/runtime/mcp.d.ts +2 -0
  95. package/dist/runtime/mcp.mjs +2 -0
  96. package/dist/runtime/queue.d.ts +12 -2
  97. package/dist/runtime/queue.mjs +19 -1
  98. package/dist/runtime/ratelimit.d.ts +1 -0
  99. package/dist/runtime/ratelimit.mjs +7 -0
  100. package/dist/runtime/schema.d.ts +313 -0
  101. package/dist/runtime/schema.mjs +259 -0
  102. package/dist/runtime/server/db/cms-schema.d.ts +1225 -171
  103. package/dist/runtime/server/db/cms-schema.mjs +69 -70
  104. package/dist/runtime/server/db/store-schema.d.ts +4344 -0
  105. package/dist/runtime/server/db/store-schema.mjs +266 -0
  106. package/dist/runtime/server/durable-objects/agent.mjs +35 -0
  107. package/dist/runtime/server/durable-objects/room.mjs +0 -1
  108. package/dist/runtime/server/middleware/ratelimit.mjs +10 -8
  109. package/dist/runtime/server/plugins/comments.d.ts +7 -0
  110. package/dist/runtime/server/plugins/comments.mjs +7 -0
  111. package/dist/runtime/server/plugins/email-inbound.d.ts +5 -0
  112. package/dist/runtime/server/plugins/email-inbound.mjs +17 -0
  113. package/dist/runtime/server/plugins/store.d.ts +7 -0
  114. package/dist/runtime/server/plugins/store.mjs +7 -0
  115. package/dist/runtime/server/routes/__qarpeo/db/tables.get.mjs +2 -2
  116. package/dist/runtime/server/routes/atom.xml.get.mjs +3 -1
  117. package/dist/runtime/server/routes/auth/2fa/disable.post.mjs +13 -2
  118. package/dist/runtime/server/routes/auth/2fa/setup.post.mjs +9 -3
  119. package/dist/runtime/server/routes/auth/2fa/verify.post.mjs +11 -3
  120. package/dist/runtime/server/routes/auth/account.delete.mjs +2 -1
  121. package/dist/runtime/server/routes/auth/audit-logs.get.mjs +1 -1
  122. package/dist/runtime/server/routes/auth/magic-link/send.post.d.ts +1 -9
  123. package/dist/runtime/server/routes/auth/magic-link/send.post.mjs +8 -0
  124. package/dist/runtime/server/routes/auth/organization/sso/[id].delete.mjs +1 -1
  125. package/dist/runtime/server/routes/auth/organization/sso/index.get.mjs +1 -1
  126. package/dist/runtime/server/routes/auth/organization/sso/index.post.mjs +1 -1
  127. package/dist/runtime/server/routes/auth/otp/send.post.d.ts +1 -9
  128. package/dist/runtime/server/routes/auth/otp/send.post.mjs +8 -0
  129. package/dist/runtime/server/routes/auth/sso/login.get.mjs +3 -3
  130. package/dist/runtime/server/routes/auth/sso/oidc/callback.get.mjs +1 -1
  131. package/dist/runtime/server/routes/auth/sso/saml/acs.post.mjs +2 -2
  132. package/dist/runtime/server/routes/auth/webauthn/login/options.post.mjs +1 -1
  133. package/dist/runtime/server/routes/auth/webauthn/login/verify.post.mjs +1 -1
  134. package/dist/runtime/server/routes/auth/webauthn/register/options.post.mjs +2 -2
  135. package/dist/runtime/server/routes/auth/webauthn/register/verify.post.mjs +1 -1
  136. package/dist/runtime/server/routes/cms/[collection]/[id]/preview-token.post.mjs +1 -1
  137. package/dist/runtime/server/routes/cms/[collection]/atom.xml.get.mjs +3 -1
  138. package/dist/runtime/server/routes/cms/[collection]/feed.xml.get.mjs +3 -1
  139. package/dist/runtime/server/routes/cms/bookmarks/[id].delete.mjs +1 -1
  140. package/dist/runtime/server/routes/cms/bookmarks/check.post.mjs +1 -1
  141. package/dist/runtime/server/routes/cms/bookmarks/index.get.mjs +1 -1
  142. package/dist/runtime/server/routes/cms/bookmarks/index.post.mjs +1 -1
  143. package/dist/runtime/server/routes/cms/deploy.post.mjs +1 -1
  144. package/dist/runtime/server/routes/cms/export.post.mjs +4 -3
  145. package/dist/runtime/server/routes/cms/search.get.mjs +7 -5
  146. package/dist/runtime/server/routes/cms/sync.post.mjs +2 -1
  147. package/dist/runtime/server/routes/comments/[id]/react.post.mjs +1 -2
  148. package/dist/runtime/server/routes/comments/[id]/report.post.d.ts +1 -1
  149. package/dist/runtime/server/routes/comments/[id]/report.post.mjs +0 -2
  150. package/dist/runtime/server/routes/comments/[id].delete.mjs +8 -4
  151. package/dist/runtime/server/routes/comments/[id].get.d.ts +1 -1
  152. package/dist/runtime/server/routes/comments/[id].get.mjs +1 -2
  153. package/dist/runtime/server/routes/comments/[id].patch.d.ts +1 -1
  154. package/dist/runtime/server/routes/comments/[id].patch.mjs +6 -3
  155. package/dist/runtime/server/routes/comments/batch.post.d.ts +2 -0
  156. package/dist/runtime/server/routes/comments/batch.post.mjs +33 -0
  157. package/dist/runtime/server/routes/comments/index.get.d.ts +1 -1
  158. package/dist/runtime/server/routes/comments/index.get.mjs +6 -4
  159. package/dist/runtime/server/routes/comments/index.post.d.ts +1 -1
  160. package/dist/runtime/server/routes/comments/index.post.mjs +6 -2
  161. package/dist/runtime/server/routes/feed.xml.get.mjs +3 -1
  162. package/dist/runtime/server/routes/sitemap.xml.get.mjs +3 -1
  163. package/dist/runtime/server/routes/storage/presigned-r2.post.d.ts +17 -0
  164. package/dist/runtime/server/routes/storage/presigned-r2.post.mjs +29 -0
  165. package/dist/runtime/server/routes/store/cart/index.delete.d.ts +6 -0
  166. package/dist/runtime/server/routes/store/cart/index.delete.mjs +11 -0
  167. package/dist/runtime/server/routes/store/cart/index.get.d.ts +5 -0
  168. package/dist/runtime/server/routes/store/cart/index.get.mjs +14 -0
  169. package/dist/runtime/server/routes/store/cart/items/[id].delete.d.ts +6 -0
  170. package/dist/runtime/server/routes/store/cart/items/[id].delete.mjs +25 -0
  171. package/dist/runtime/server/routes/store/cart/items/[id].patch.d.ts +6 -0
  172. package/dist/runtime/server/routes/store/cart/items/[id].patch.mjs +29 -0
  173. package/dist/runtime/server/routes/store/cart/items.post.d.ts +6 -0
  174. package/dist/runtime/server/routes/store/cart/items.post.mjs +36 -0
  175. package/dist/runtime/server/routes/store/categories/index.get.d.ts +2 -0
  176. package/dist/runtime/server/routes/store/categories/index.get.mjs +8 -0
  177. package/dist/runtime/server/routes/store/checkout.post.d.ts +6 -0
  178. package/dist/runtime/server/routes/store/checkout.post.mjs +21 -0
  179. package/dist/runtime/server/routes/store/coupons/apply.post.d.ts +7 -0
  180. package/dist/runtime/server/routes/store/coupons/apply.post.mjs +18 -0
  181. package/dist/runtime/server/routes/store/currencies.get.d.ts +15 -0
  182. package/dist/runtime/server/routes/store/currencies.get.mjs +13 -0
  183. package/dist/runtime/server/routes/store/orders/[id].get.d.ts +2 -0
  184. package/dist/runtime/server/routes/store/orders/[id].get.mjs +26 -0
  185. package/dist/runtime/server/routes/store/orders/download/[token].get.d.ts +7 -0
  186. package/dist/runtime/server/routes/store/orders/download/[token].get.mjs +57 -0
  187. package/dist/runtime/server/routes/store/orders/index.get.d.ts +5 -0
  188. package/dist/runtime/server/routes/store/orders/index.get.mjs +30 -0
  189. package/dist/runtime/server/routes/store/products/[slug].get.d.ts +2 -0
  190. package/dist/runtime/server/routes/store/products/[slug].get.mjs +18 -0
  191. package/dist/runtime/server/routes/store/products/index.get.d.ts +5 -0
  192. package/dist/runtime/server/routes/store/products/index.get.mjs +33 -0
  193. package/dist/runtime/server/routes/store/tax/calculate.post.d.ts +9 -0
  194. package/dist/runtime/server/routes/store/tax/calculate.post.mjs +18 -0
  195. package/dist/runtime/server/routes/tenants/[tenant]/domains/[domain]/index.delete.mjs +14 -1
  196. package/dist/runtime/server/routes/tenants/[tenant]/domains/[domain]/verify.post.mjs +14 -1
  197. package/dist/runtime/server/routes/tenants/[tenant]/domains/index.get.mjs +24 -1
  198. package/dist/runtime/server/routes/tenants/[tenant]/domains/index.post.mjs +6 -0
  199. package/dist/runtime/server/utils/ai.d.ts +146 -21
  200. package/dist/runtime/server/utils/ai.mjs +406 -11
  201. package/dist/runtime/server/utils/analytics-query.d.ts +13 -58
  202. package/dist/runtime/server/utils/audit.d.ts +5 -4
  203. package/dist/runtime/server/utils/audit.mjs +25 -14
  204. package/dist/runtime/server/utils/auth.d.ts +29 -12
  205. package/dist/runtime/server/utils/auth.mjs +88 -70
  206. package/dist/runtime/server/utils/bots.d.ts +20 -4
  207. package/dist/runtime/server/utils/bots.mjs +7 -3
  208. package/dist/runtime/server/utils/browser-utils.d.ts +23 -23
  209. package/dist/runtime/server/utils/cache.d.ts +3 -3
  210. package/dist/runtime/server/utils/cms/collections.d.ts +23 -0
  211. package/dist/runtime/server/utils/cms/collections.mjs +143 -0
  212. package/dist/runtime/server/utils/cms/common.d.ts +9 -0
  213. package/dist/runtime/server/utils/cms/common.mjs +28 -0
  214. package/dist/runtime/server/utils/cms/git.mjs +2 -2
  215. package/dist/runtime/server/utils/cms/navigation.d.ts +46 -0
  216. package/dist/runtime/server/utils/cms/navigation.mjs +683 -0
  217. package/dist/runtime/server/utils/cms/preview.d.ts +11 -0
  218. package/dist/runtime/server/utils/cms/preview.mjs +50 -0
  219. package/dist/runtime/server/utils/cms/search.d.ts +1 -1
  220. package/dist/runtime/server/utils/cms/search.mjs +11 -7
  221. package/dist/runtime/server/utils/cms/sync.d.ts +34 -0
  222. package/dist/runtime/server/utils/cms/sync.mjs +1082 -0
  223. package/dist/runtime/server/utils/cms/taxonomy.d.ts +103 -0
  224. package/dist/runtime/server/utils/cms/taxonomy.mjs +348 -0
  225. package/dist/runtime/server/utils/cms.d.ts +13 -249
  226. package/dist/runtime/server/utils/cms.mjs +108 -2350
  227. package/dist/runtime/server/utils/comments-filter.d.ts +45 -0
  228. package/dist/runtime/server/utils/comments-filter.mjs +541 -0
  229. package/dist/runtime/server/utils/comments.d.ts +71 -0
  230. package/dist/runtime/server/utils/comments.mjs +137 -61
  231. package/dist/runtime/server/utils/config.d.ts +4 -3
  232. package/dist/runtime/server/utils/config.mjs +7 -6
  233. package/dist/runtime/server/utils/context.d.ts +14 -0
  234. package/dist/runtime/server/utils/context.mjs +2 -2
  235. package/dist/runtime/server/utils/crypto.d.ts +44 -5
  236. package/dist/runtime/server/utils/crypto.mjs +18 -0
  237. package/dist/runtime/server/utils/domains.mjs +9 -5
  238. package/dist/runtime/server/utils/drizzle.d.ts +35 -3
  239. package/dist/runtime/server/utils/drizzle.mjs +115 -6
  240. package/dist/runtime/server/utils/durable-object.d.ts +106 -0
  241. package/dist/runtime/server/utils/durable-object.mjs +628 -0
  242. package/dist/runtime/server/utils/email-inbound.d.ts +29 -0
  243. package/dist/runtime/server/utils/email-inbound.mjs +76 -0
  244. package/dist/runtime/server/utils/impersonation.d.ts +32 -2
  245. package/dist/runtime/server/utils/impersonation.mjs +16 -13
  246. package/dist/runtime/server/utils/lock.d.ts +71 -0
  247. package/dist/runtime/server/utils/lock.mjs +139 -0
  248. package/dist/runtime/server/utils/mail-suppression.mjs +7 -7
  249. package/dist/runtime/server/utils/mail.d.ts +30 -19
  250. package/dist/runtime/server/utils/mcp.d.ts +44 -0
  251. package/dist/runtime/server/utils/mcp.mjs +308 -0
  252. package/dist/runtime/server/utils/notifications.d.ts +72 -7
  253. package/dist/runtime/server/utils/notifications.mjs +67 -55
  254. package/dist/runtime/server/utils/oauth.d.ts +27 -4
  255. package/dist/runtime/server/utils/organization.d.ts +63 -7
  256. package/dist/runtime/server/utils/organization.mjs +26 -21
  257. package/dist/runtime/server/utils/passwordless.d.ts +62 -33
  258. package/dist/runtime/server/utils/payments.d.ts +51 -12
  259. package/dist/runtime/server/utils/payments.mjs +472 -282
  260. package/dist/runtime/server/utils/queue.d.ts +106 -13
  261. package/dist/runtime/server/utils/queue.mjs +313 -28
  262. package/dist/runtime/server/utils/rag.d.ts +42 -14
  263. package/dist/runtime/server/utils/rag.mjs +169 -4
  264. package/dist/runtime/server/utils/ratelimit.d.ts +34 -5
  265. package/dist/runtime/server/utils/ratelimit.mjs +95 -14
  266. package/dist/runtime/server/utils/realtime.d.ts +68 -52
  267. package/dist/runtime/server/utils/scheduled-task.d.ts +42 -1
  268. package/dist/runtime/server/utils/scheduled-task.mjs +29 -0
  269. package/dist/runtime/server/utils/schema-fallback.d.ts +1 -1
  270. package/dist/runtime/server/utils/schema-fallback.mjs +1 -1
  271. package/dist/runtime/server/utils/session.d.ts +84 -10
  272. package/dist/runtime/server/utils/session.mjs +12 -10
  273. package/dist/runtime/server/utils/sse.d.ts +75 -0
  274. package/dist/runtime/server/utils/sse.mjs +147 -0
  275. package/dist/runtime/server/utils/sso.d.ts +1 -1
  276. package/dist/runtime/server/utils/storage.d.ts +53 -4
  277. package/dist/runtime/server/utils/storage.mjs +15 -11
  278. package/dist/runtime/server/utils/store-localization.d.ts +51 -0
  279. package/dist/runtime/server/utils/store-localization.mjs +417 -0
  280. package/dist/runtime/server/utils/store.d.ts +207 -0
  281. package/dist/runtime/server/utils/store.mjs +2227 -0
  282. package/dist/runtime/server/utils/table-names.d.ts +51 -0
  283. package/dist/runtime/server/utils/table-names.mjs +69 -0
  284. package/dist/runtime/server/utils/tenant.d.ts +26 -2
  285. package/dist/runtime/server/utils/tenant.mjs +16 -12
  286. package/dist/runtime/server/utils/tools-registry-fallback.d.ts +1 -0
  287. package/dist/runtime/server/utils/tools-registry-fallback.mjs +1 -0
  288. package/dist/runtime/server/utils/totp.d.ts +45 -2
  289. package/dist/runtime/server/utils/tracker.d.ts +10 -11
  290. package/dist/runtime/server/utils/turnstile.d.ts +16 -1
  291. package/dist/runtime/server/utils/workflows.d.ts +92 -0
  292. package/dist/runtime/server/utils/workflows.mjs +299 -0
  293. package/dist/runtime/server.d.ts +8 -1
  294. package/dist/runtime/server.mjs +8 -5
  295. package/dist/runtime/service.d.ts +10 -10
  296. package/dist/runtime/storage.d.ts +1 -0
  297. package/dist/runtime/storage.mjs +1 -0
  298. package/dist/runtime/store.d.ts +4 -0
  299. package/dist/runtime/store.mjs +2 -0
  300. package/dist/runtime/test-utils.d.ts +11 -10
  301. package/dist/runtime/test-utils.mjs +64 -4
  302. package/dist/runtime/types/ai.d.ts +21 -2
  303. package/dist/runtime/types/d1.d.ts +17 -0
  304. package/dist/runtime/types/drizzle.d.ts +2 -2
  305. package/dist/runtime/types/durable-object.d.ts +62 -2
  306. package/dist/runtime/types/email.d.ts +46 -0
  307. package/dist/runtime/types/imports.d.ts +6 -1
  308. package/dist/runtime/types/index.d.ts +58 -0
  309. package/dist/runtime/types/index.mjs +3 -0
  310. package/dist/runtime/types/mcp.d.ts +83 -0
  311. package/dist/runtime/types/mcp.mjs +0 -0
  312. package/dist/runtime/types/queue.d.ts +36 -0
  313. package/dist/runtime/types/r2.d.ts +41 -0
  314. package/dist/runtime/types/store.d.ts +313 -0
  315. package/dist/runtime/types/store.mjs +0 -0
  316. package/dist/runtime/types/workflows.d.ts +98 -0
  317. package/dist/runtime/types/workflows.mjs +0 -0
  318. package/dist/runtime/workflows.d.ts +5 -0
  319. package/dist/runtime/workflows.mjs +2 -0
  320. package/dist/types/ai.d.ts +721 -0
  321. package/dist/types/cms.d.ts +710 -0
  322. package/dist/types.d.ts +406 -1288
  323. package/dist/utils/auth-schema.d.ts +3 -2
  324. package/dist/utils/bots.d.ts +20 -0
  325. package/dist/utils/comments-schema.d.ts +5 -4
  326. package/dist/utils/drizzle.d.ts +83 -3
  327. package/dist/utils/durable-objects.d.ts +10 -0
  328. package/dist/utils/email-inbound.d.ts +10 -0
  329. package/dist/utils/local-db.d.ts +1 -3
  330. package/dist/utils/mcp.d.ts +24 -0
  331. package/dist/utils/notifications-schema.d.ts +5 -4
  332. package/dist/utils/payments-schema.d.ts +4 -3
  333. package/dist/utils/store-schema.d.ts +14 -0
  334. package/dist/utils/table-names.d.ts +1 -0
  335. package/dist/utils/tenants-schema.d.ts +4 -3
  336. package/dist/utils/tools.d.ts +20 -0
  337. package/dist/utils/workflows.d.ts +8 -0
  338. package/package.json +34 -4
  339. package/dist/chunks/wrangler.mjs +0 -897
  340. package/dist/runtime/app/components/AuthRegister.vue +0 -306
  341. package/dist/runtime/app/components/AuthSessionsList.vue +0 -137
  342. package/dist/runtime/app/components/AuthSignIn.vue +0 -298
  343. package/dist/runtime/app/components/CMSBookmarkButton.vue +0 -59
  344. package/dist/runtime/app/components/CMSImage.vue +0 -47
  345. package/dist/runtime/app/components/CMSLocaleSwitcher.vue +0 -110
  346. package/dist/runtime/app/components/CMSNewsletter.vue +0 -81
  347. package/dist/runtime/app/components/CMSPreviewBanner.vue +0 -83
  348. package/dist/runtime/app/components/CMSTableOfContents.vue +0 -84
  349. package/dist/runtime/app/components/CMSVersionBanner.vue +0 -53
  350. package/dist/runtime/app/components/CMSVersionSwitcher.vue +0 -140
  351. package/dist/runtime/app/components/Comments.vue +0 -411
  352. package/dist/runtime/app/components/FileUpload.vue +0 -200
  353. package/dist/runtime/app/components/ImpersonationBanner.vue +0 -61
  354. package/dist/runtime/app/components/NotificationBell.vue +0 -263
  355. package/dist/runtime/app/components/NotificationList.vue +0 -205
  356. package/dist/runtime/app/components/NotificationPrompt.vue +0 -133
  357. package/dist/runtime/app/components/PricingGated.vue +0 -81
  358. package/dist/runtime/app/components/PricingTable.vue +0 -274
  359. package/dist/runtime/app/components/RealtimeChat.vue +0 -164
  360. package/dist/runtime/app/components/RealtimePresence.vue +0 -129
  361. package/dist/runtime/app/components/RealtimeStatus.vue +0 -79
  362. package/dist/runtime/app/components/SubscriptionCard.vue +0 -207
  363. package/dist/runtime/app/components/UserProfile.vue +0 -558
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Comment content filter — blocks adult website links and banned keywords.
3
+ *
4
+ * Design decisions:
5
+ * - O(1) Set<string> hash lookup for adult domain matching (no loop over list)
6
+ * - Adult TLD regex catches millions of sites not in the explicit set
7
+ * - Obfuscation normalization: handles [dot], (dot), [.], zero-width chars
8
+ * - Hard-rejects with HTTP 400 (no silent spam quarantine)
9
+ * - Works on Cloudflare Workers edge — zero I/O, no fetch, no fs
10
+ */
11
+ import type { CommentsModerationConfig } from "../../../types";
12
+ export interface ExtractedContent {
13
+ /** All raw URL matches found in the (normalized) text */
14
+ urls: string[];
15
+ /** Apex domains extracted from each URL */
16
+ domains: string[];
17
+ /** The normalized text (after obfuscation expansion) */
18
+ normalized: string;
19
+ }
20
+ export type ModerationRule = "adult_tld" | "adult_domain" | "max_links" | "blocked_domain" | "blocked_keyword";
21
+ export interface ModerationViolation {
22
+ rule: ModerationRule;
23
+ message: string;
24
+ match?: string;
25
+ }
26
+ export interface ModerationCheckResult {
27
+ valid: boolean;
28
+ violation?: ModerationViolation;
29
+ }
30
+ /**
31
+ * Normalizes obfuscation and extracts all URLs + apex domains from the comment.
32
+ */
33
+ export declare function extractUrlsAndDomains(content: string): ExtractedContent;
34
+ /**
35
+ * Pure checker: inspects comment text against moderation rules and returns
36
+ * a ModerationCheckResult without throwing.
37
+ */
38
+ export declare function checkCommentContent(content: string, cfg: CommentsModerationConfig): ModerationCheckResult;
39
+ /**
40
+ * Validates comment content against moderation rules.
41
+ * - If action is "reject" (default) and a violation is found, throws createError({ statusCode: 400 }).
42
+ * - If action is "quarantine" and a violation is found, returns { valid: false, violation } without throwing.
43
+ * - If valid, returns { valid: true }.
44
+ */
45
+ export declare function validateCommentContent(content: string, cfg: CommentsModerationConfig): ModerationCheckResult;
@@ -0,0 +1,541 @@
1
+ import { createError } from "nuxt/server";
2
+ const ADULT_TLDS_RE = /\.(xxx|porn|adult|sex|cam|cams|tube|fetish|dating|camgirl|camsite|sexchat|xxxvideo|freeporn|hentai|nudist|erotic|redlight|lust|milf|dick|cock|pussy|bdsm|bondage|swingers|escort|stripper|peep|perv|nasty|slutty|horny|naughty|kinky|orgy|cum|cumshot|anal|blowjob|deepthroat|gangbang|threesome|handjob)(\b|\/|$)/i;
3
+ const ADULT_DOMAINS = /* @__PURE__ */ new Set([
4
+ // ── Tube / video aggregators ────────────────────────────────────────────────
5
+ "pornhub.com",
6
+ "xvideos.com",
7
+ "xnxx.com",
8
+ "xhamster.com",
9
+ "redtube.com",
10
+ "youporn.com",
11
+ "tube8.com",
12
+ "spankbang.com",
13
+ "txxx.com",
14
+ "beeg.com",
15
+ "drtuber.com",
16
+ "tnaflix.com",
17
+ "vporn.com",
18
+ "nuvid.com",
19
+ "porndig.com",
20
+ "hclips.com",
21
+ "porntrex.com",
22
+ "porn.com",
23
+ "sex.com",
24
+ "fuq.com",
25
+ "heavy-r.com",
26
+ "daftsex.com",
27
+ "xcafe.com",
28
+ "tubegalore.com",
29
+ "pornktube.com",
30
+ "anysex.com",
31
+ "pornhat.com",
32
+ "porngo.com",
33
+ "porntube.com",
34
+ "pornbox.com",
35
+ "crazyshit.com",
36
+ "porno.com",
37
+ "xmovies8.tv",
38
+ "xozilla.com",
39
+ "pornone.com",
40
+ "eporner.com",
41
+ "fapdu.com",
42
+ "pornrabbit.com",
43
+ "hardsextube.com",
44
+ "slutload.com",
45
+ "pornoxo.com",
46
+ "pornhd.com",
47
+ "pornhd3x.com",
48
+ "helixstudios.com",
49
+ "porn300.com",
50
+ "4tube.com",
51
+ "extremetube.com",
52
+ "keezmovies.com",
53
+ "mofosex.com",
54
+ "pornerbros.com",
55
+ "pornsharing.com",
56
+ "videosection.com",
57
+ "yobt.tv",
58
+ "cliphunter.com",
59
+ "moviefap.com",
60
+ "naughtyamerica.com",
61
+ "worldsex.com",
62
+ "wetplace.com",
63
+ "jizzhut.com",
64
+ "gaytube.com",
65
+ "gaymaletube.com",
66
+ "xtube.com",
67
+ "men.com",
68
+ "seancody.com",
69
+ "cockyboys.com",
70
+ "bel-ami.com",
71
+ "fakings.com",
72
+ "fakehub.com",
73
+ "fakehospital.com",
74
+ "fakeagent.com",
75
+ "fakedriving.com",
76
+ "mofos.com",
77
+ "blacked.com",
78
+ "blackedraw.com",
79
+ "tushy.com",
80
+ "vixen.com",
81
+ "deeper.com",
82
+ "slayed.com",
83
+ "povd.com",
84
+ "mylf.com",
85
+ "evilangel.com",
86
+ "wicked.com",
87
+ "penthouse.com",
88
+ "hustler.com",
89
+ "playboyplus.com",
90
+ "playboy.com",
91
+ // ── Studios / networks ──────────────────────────────────────────────────────
92
+ "brazzers.com",
93
+ "bangbros.com",
94
+ "realitykings.com",
95
+ "digitalplayground.com",
96
+ "kink.com",
97
+ "wankz.com",
98
+ "privatecastings.com",
99
+ "private.com",
100
+ "21sextury.com",
101
+ "21naturals.com",
102
+ "21sextreme.com",
103
+ "devilsfilm.com",
104
+ "purexxxfilms.com",
105
+ "girlfriendsfilms.com",
106
+ "girlfriends.com",
107
+ "ddfnetwork.com",
108
+ "ddfbusty.com",
109
+ "wearehairy.com",
110
+ "scoreland.com",
111
+ "divinebreasts.com",
112
+ "xlgirls.com",
113
+ "boundhub.com",
114
+ "hogtied.com",
115
+ "device-bondage.com",
116
+ "publichomemovies.com",
117
+ "publicpickups.com",
118
+ "publicsexadventures.com",
119
+ "nubiles.net",
120
+ "nubiles-porn.com",
121
+ "girlsway.com",
122
+ "sweetsinner.com",
123
+ "sweetheartvideo.com",
124
+ "dorcelclub.com",
125
+ "lustandpassion.com",
126
+ "julesjordan.com",
127
+ "adulttimeoriginals.com",
128
+ "adulttime.com",
129
+ "aebn.net",
130
+ "hotmovies.com",
131
+ "gamelink.com",
132
+ "paxum.com",
133
+ // ── Cam / live sites ────────────────────────────────────────────────────────
134
+ "chaturbate.com",
135
+ "myfreecams.com",
136
+ "bongacams.com",
137
+ "stripchat.com",
138
+ "livejasmin.com",
139
+ "cam4.com",
140
+ "flirt4free.com",
141
+ "streamate.com",
142
+ "ifriends.com",
143
+ "imlive.com",
144
+ "sexier.com",
145
+ "cheapsexcams.com",
146
+ "xcams.com",
147
+ "camcontacts.com",
148
+ "camseek.tv",
149
+ "camwhores.tv",
150
+ "naked.com",
151
+ "camsoda.com",
152
+ "jasmin.com",
153
+ "homewebcamvideos.com",
154
+ "dirtyroulette.com",
155
+ "dirtychat.com",
156
+ "sexcamly.com",
157
+ "cambb.com",
158
+ "amateur.tv",
159
+ "mylivecam.com",
160
+ "stripcamfun.com",
161
+ // ── Creator / clip stores ───────────────────────────────────────────────────
162
+ "onlyfans.com",
163
+ "manyvids.com",
164
+ "clips4sale.com",
165
+ "iwantclips.com",
166
+ "niteflirt.com",
167
+ "fancentro.com",
168
+ "fansly.com",
169
+ "unfiltrd.com",
170
+ "4my.fans",
171
+ "loyalfans.com",
172
+ "frisk.chat",
173
+ "pocketsocial.com",
174
+ "justfor.fans",
175
+ "suicidegirls.com",
176
+ "modelcentro.com",
177
+ "benaughty.com",
178
+ "flirt.com",
179
+ "fabswingers.com",
180
+ "swinglifestyle.com",
181
+ "kasidie.com",
182
+ "adultfriendfinder.com",
183
+ "alt.com",
184
+ "fetlife.com",
185
+ "collarspace.com",
186
+ "bdsmlr.com",
187
+ "recon.com",
188
+ "scruff.com",
189
+ // ── Escort / dating ─────────────────────────────────────────────────────────
190
+ "eros.com",
191
+ "slixa.com",
192
+ "listcrawler.com",
193
+ "adultsearch.com",
194
+ "megapersonals.eu",
195
+ "skipthegames.com",
196
+ "tryst.link",
197
+ "erosads.com",
198
+ "ashley-madison.com",
199
+ "ashleymadison.com",
200
+ "victoria-milan.com",
201
+ "ilikeq.com",
202
+ "xcheaters.com",
203
+ "affairalert.com",
204
+ "instabang.com",
205
+ "fuckbook.com",
206
+ "arousr.com",
207
+ "erotixapp.com",
208
+ "cougarlife.com",
209
+ "milfplay.com",
210
+ "xmatch.com",
211
+ "passion.com",
212
+ // ── Hentai / anime / illustration ───────────────────────────────────────────
213
+ "hentai-foundry.com",
214
+ "nhentai.net",
215
+ "e-hentai.org",
216
+ "exhentai.org",
217
+ "fakku.net",
218
+ "gelbooru.com",
219
+ "rule34.xxx",
220
+ "rule34.paheal.net",
221
+ "danbooru.donmai.us",
222
+ "sankakucomplex.com",
223
+ "lolibooru.moe",
224
+ "tbib.org",
225
+ "xbooru.com",
226
+ "hypnohub.net",
227
+ "furaffinity.net",
228
+ "e621.net",
229
+ "inkbunny.net",
230
+ "sofurry.com",
231
+ "weasyl.com",
232
+ "literotica.com",
233
+ "lushstories.com",
234
+ "asstr.org",
235
+ "adult-fanfiction.org",
236
+ // ── Image boards ────────────────────────────────────────────────────────────
237
+ "4chan.org",
238
+ // /b/, /gif/, /hc/, etc.
239
+ "8chan.moe",
240
+ "8kun.top",
241
+ "motherless.com",
242
+ "imagefap.com",
243
+ "pornpics.com",
244
+ "babecock.com",
245
+ "babestube.com",
246
+ "bigboobsalert.com",
247
+ "bustybloom.com",
248
+ // ── Gay ─────────────────────────────────────────────────────────────────────
249
+ "manhunt.net",
250
+ "adam4adam.com",
251
+ "squirt.org",
252
+ "barebackrt.com",
253
+ "gayporn.com",
254
+ "boysfood.com",
255
+ "dudesnude.com",
256
+ "thisvid.com",
257
+ // ── Mature / BBW / niche ─────────────────────────────────────────────────────
258
+ "bbwsex.com",
259
+ "fatmomtube.com",
260
+ "maturetube.com",
261
+ "olderwomansex.com",
262
+ "grannysex.com",
263
+ "pornmature.com",
264
+ "bigtitsroundasses.com",
265
+ "bigboobsadventure.com",
266
+ "lingeriequeens.com",
267
+ // ── Defloration / virginity-loss networks & sites ────────────────────────────
268
+ "df1.org",
269
+ "df2.org",
270
+ "df3.org",
271
+ "df4.org",
272
+ "df5.org",
273
+ "df6.org",
274
+ "df7.org",
275
+ "df8.org",
276
+ "df9.org",
277
+ "df1.net",
278
+ "df2.net",
279
+ "df3.net",
280
+ "df4.net",
281
+ "df5.net",
282
+ "df6.net",
283
+ "df7.net",
284
+ "df8.net",
285
+ "df9.net",
286
+ "df1.com",
287
+ "df2.com",
288
+ "df3.com",
289
+ "df4.com",
290
+ "df5.com",
291
+ "df6.com",
292
+ "df7.com",
293
+ "df8.com",
294
+ "df9.com",
295
+ "df6.biz",
296
+ "df6.tv",
297
+ "defloration.biz",
298
+ "defloration.net",
299
+ "defloration.org",
300
+ "defloration.com",
301
+ "defloration.tv",
302
+ "defloration.xxx",
303
+ "defloration.info",
304
+ "defloration.me",
305
+ "defloration.cc",
306
+ "defloration.ws",
307
+ "defloration.to",
308
+ "defloration.club",
309
+ "defloration.online",
310
+ "defloration.video",
311
+ "defloration.vip",
312
+ "defloration.life",
313
+ "defloration.link",
314
+ "defloration.site",
315
+ "defloration.top",
316
+ "defloration.eu",
317
+ "defloration.pro",
318
+ "defloration-video.com",
319
+ "deflorationmovies.com",
320
+ "deflorationtube.com",
321
+ "deflorationraw.com",
322
+ "deflorationhub.com",
323
+ "deflowered.com",
324
+ "deflowered.net",
325
+ "deflowered.org",
326
+ "deflowered.biz",
327
+ "defloweredbabes.com",
328
+ "deflowering.net",
329
+ "deflower.net",
330
+ "deflowerher.com",
331
+ "realdefloration.com",
332
+ "firstanalquest.com",
333
+ "firsttimeanal.com",
334
+ "cherrypop.com",
335
+ "cherrypoppers.com",
336
+ "popcherry.com",
337
+ "firstsex.com",
338
+ "myfirstsex.com",
339
+ "firsttimeinternal.com",
340
+ "firsttimefuck.com",
341
+ "lostvirginity.com",
342
+ "loss-of-virginity.com",
343
+ "innocentvirgin.com",
344
+ "takehervirginity.com",
345
+ "virginityloss.com",
346
+ // ── Virgin / first-time adult platforms ──────────────────────────────────────
347
+ "virgins.com",
348
+ "virgins.xxx",
349
+ "virgins.biz",
350
+ "virgins.net",
351
+ "virgins.org",
352
+ "virgins.tv",
353
+ "sweetvirgins.com",
354
+ "innocentvirgins.com",
355
+ "truevirgins.com",
356
+ "teen-virgin.com",
357
+ "purevirgins.com",
358
+ "youngvirgins.com",
359
+ "virginfetish.com",
360
+ "virginpass.com",
361
+ "virginclub.com",
362
+ "virginsporn.com",
363
+ "virginvideo.com",
364
+ "virginteens.com",
365
+ "virginbabes.com",
366
+ "virginarchive.com",
367
+ "virginxxx.com",
368
+ "virginfirsttime.com",
369
+ "firsttimevirgins.com",
370
+ "firsttimegirls.com",
371
+ "firsttimeauditions.com",
372
+ "innocenthigh.com",
373
+ "myfirstsexteacher.com",
374
+ "virginity.xxx",
375
+ "virginity.biz",
376
+ "virginity.com",
377
+ "defloweredvirgins.com",
378
+ // ── Misc adult platforms ─────────────────────────────────────────────────────
379
+ "pornmd.com",
380
+ "smutty.com",
381
+ "redgifs.com",
382
+ "gifsauce.com",
383
+ "gifsgallery.com",
384
+ "nudevista.com",
385
+ "nudography.com",
386
+ "celebjihad.com",
387
+ "mrdeepfakes.com",
388
+ "deepfakes.com",
389
+ "celebsroulette.com",
390
+ "thefappening.so",
391
+ "thefappening.name",
392
+ "jerkmate.com",
393
+ "jerkmategay.com",
394
+ "joyourself.com",
395
+ "pornoreino.com",
396
+ "pelisporno.gratis",
397
+ "xpaja.com",
398
+ "nakedgirls.com",
399
+ "nudegirlspics.com",
400
+ "hotgaylist.com",
401
+ "gaydemon.com",
402
+ "gaypornvideos.xxx",
403
+ "dickflash.com",
404
+ "flashingjungle.com",
405
+ "voyeurweb.com",
406
+ "voyeur-house.tv",
407
+ "voyeur-house.com",
408
+ "reallifecam.com",
409
+ "camarads.com",
410
+ "vsco-girls.com",
411
+ "exhibitionismnude.com",
412
+ "exhibitionistx.com",
413
+ "nakedpublicvoyeur.com",
414
+ "periscoped.com",
415
+ "scrolller.com",
416
+ // ── Payment / billing processors used almost exclusively by adult sites ──────
417
+ "epoch.com",
418
+ "ccbill.com",
419
+ "zombaio.com",
420
+ "segpay.com",
421
+ "verotel.com",
422
+ "mobiusmsp.com",
423
+ // ── Piracy / leaked content ──────────────────────────────────────────────────
424
+ "pornleaks.com",
425
+ "celebleaks.com",
426
+ "anonib.al",
427
+ "anonib.com",
428
+ "leaked.cx",
429
+ "leakedzone.com"
430
+ ]);
431
+ function normalizeObfuscation(text) {
432
+ return text.replace(/\s*\[\s*dot\s*\]\s*/gi, ".").replace(/\s*\(\s*dot\s*\)\s*/gi, ".").replace(/\s*\[\s*\.\s*\]\s*/g, ".").replace(/\s*\(\s*\.\s*\)\s*/g, ".").replace(/\u200B|\u00AD|\u200C|\u200D|\uFEFF/g, "").replace(/\u2024|\uFF0E/g, ".").replace(/\s*\[\s*\/\s*\]\s*/g, "/").replace(/\s*\(\s*\/\s*\)\s*/g, "/");
433
+ }
434
+ const URL_RE = /(?:https?:\/\/|www\.)[^\s<>"'(){}\[\]]+|\b[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.(?:com|org|net|io|co|cc|tv|me|info|biz|site|xyz|online|top|club|vip|live|pro|dev|app|xxx|porn|adult|sex|cam|cams|tube|fetish|dating|hentai|[a-z]{2})\b(?:\/[^\s<>"'(){}\[\]]*)?/gi;
435
+ function extractApexDomain(raw) {
436
+ const withScheme = raw.startsWith("http") ? raw : `https://${raw}`;
437
+ let host;
438
+ try {
439
+ host = new URL(withScheme).hostname.toLowerCase();
440
+ } catch {
441
+ host = raw.replace(/^https?:\/\//, "").split("/")[0].toLowerCase();
442
+ }
443
+ host = host.split(":")[0];
444
+ host = host.replace(/^www\./, "");
445
+ const parts = host.split(".");
446
+ if (parts.length > 2) {
447
+ return parts.slice(-2).join(".");
448
+ }
449
+ return host;
450
+ }
451
+ export function extractUrlsAndDomains(content) {
452
+ const normalized = normalizeObfuscation(content);
453
+ const urls = [...normalized.matchAll(URL_RE) ?? []].map((m) => m[0]);
454
+ const domains = urls.map(extractApexDomain);
455
+ return { urls, domains, normalized };
456
+ }
457
+ export function checkCommentContent(content, cfg) {
458
+ if (cfg.blockAdultContent === false) {
459
+ return { valid: true };
460
+ }
461
+ const { urls, domains, normalized } = extractUrlsAndDomains(content);
462
+ const maxLinks = cfg.maxLinks ?? 2;
463
+ if (urls.length > maxLinks) {
464
+ return {
465
+ valid: false,
466
+ violation: {
467
+ rule: "max_links",
468
+ message: `Comments may contain at most ${maxLinks} link${maxLinks === 1 ? "" : "s"}.`,
469
+ match: `${urls.length} links found`
470
+ }
471
+ };
472
+ }
473
+ for (const url of urls) {
474
+ if (ADULT_TLDS_RE.test(url)) {
475
+ return {
476
+ valid: false,
477
+ violation: {
478
+ rule: "adult_tld",
479
+ message: "Links to adult content are not allowed.",
480
+ match: url
481
+ }
482
+ };
483
+ }
484
+ }
485
+ for (const domain of domains) {
486
+ if (ADULT_DOMAINS.has(domain)) {
487
+ return {
488
+ valid: false,
489
+ violation: {
490
+ rule: "adult_domain",
491
+ message: "Links to adult content are not allowed.",
492
+ match: domain
493
+ }
494
+ };
495
+ }
496
+ }
497
+ if (cfg.blockedDomains && cfg.blockedDomains.length > 0) {
498
+ const blockedSet = new Set(cfg.blockedDomains.map((d) => d.toLowerCase().replace(/^www\./, "")));
499
+ for (const domain of domains) {
500
+ if (blockedSet.has(domain)) {
501
+ return {
502
+ valid: false,
503
+ violation: {
504
+ rule: "blocked_domain",
505
+ message: "This link is not allowed in comments.",
506
+ match: domain
507
+ }
508
+ };
509
+ }
510
+ }
511
+ }
512
+ if (cfg.blockedKeywords && cfg.blockedKeywords.length > 0) {
513
+ const lowerNorm = normalized.toLowerCase();
514
+ for (const kw of cfg.blockedKeywords) {
515
+ if (lowerNorm.includes(kw.toLowerCase())) {
516
+ return {
517
+ valid: false,
518
+ violation: {
519
+ rule: "blocked_keyword",
520
+ message: "Your comment contains content that is not allowed.",
521
+ match: kw
522
+ }
523
+ };
524
+ }
525
+ }
526
+ }
527
+ return { valid: true };
528
+ }
529
+ export function validateCommentContent(content, cfg) {
530
+ const result = checkCommentContent(content, cfg);
531
+ if (!result.valid && result.violation) {
532
+ if (cfg.action === "quarantine") {
533
+ return result;
534
+ }
535
+ throw createError({
536
+ statusCode: 400,
537
+ statusMessage: result.violation.message
538
+ });
539
+ }
540
+ return result;
541
+ }
@@ -3,6 +3,14 @@ import type { CommentsOptions } from "../../../types";
3
3
  export { isValidTargetUrn, validateTargetUrn } from "./urn";
4
4
  export type CommentStatus = "pending" | "approved" | "spam" | "deleted";
5
5
  export type ReportReason = "spam" | "harassment" | "off-topic" | "misinformation" | "other";
6
+ export interface BatchModerateInput {
7
+ ids: string[];
8
+ action: "approve" | "spam" | "delete";
9
+ }
10
+ export interface BatchModerateResult {
11
+ success: boolean;
12
+ count: number;
13
+ }
6
14
  export interface Comment {
7
15
  id: string;
8
16
  targetUrn: string;
@@ -10,6 +18,7 @@ export interface Comment {
10
18
  parentId?: string;
11
19
  path: string;
12
20
  depth: number;
21
+ authorId?: string;
13
22
  authorName: string;
14
23
  authorEmail?: string;
15
24
  authorAvatar?: string;
@@ -43,6 +52,7 @@ export interface CommentReaction {
43
52
  export interface CreateCommentInput {
44
53
  targetUrn: string;
45
54
  parentId?: string;
55
+ authorId?: string;
46
56
  authorName: string;
47
57
  authorEmail?: string;
48
58
  content: string;
@@ -72,27 +82,83 @@ export declare function getCommentsConfig(event?: RequestEvent): CommentsOptions
72
82
  export declare function ensureCommentsTables(event?: RequestEvent): Promise<void>;
73
83
  /**
74
84
  * Fetches comments for a target URN. Supports flat or threaded (nested replies) output.
85
+ *
86
+ * @example
87
+ * ```ts
88
+ * const { comments, total } = await queryComments({
89
+ * targetUrn: "urn:qarpeo:blog:hello-world",
90
+ * threaded: true,
91
+ * }, event)
92
+ * ```
75
93
  */
76
94
  export declare function queryComments(opts: QueryCommentsOptions, event?: RequestEvent): Promise<{
77
95
  comments: Comment[];
78
96
  total: number;
79
97
  }>;
98
+ /**
99
+ * Fetches a single comment by ID.
100
+ *
101
+ * @example
102
+ * ```ts
103
+ * const comment = await getComment("cmt_123", event)
104
+ * ```
105
+ */
80
106
  export declare function getComment(id: string, event?: RequestEvent): Promise<Comment | null>;
81
107
  /**
82
108
  * Creates a new comment with rate limiting, auth checks, length validation,
83
109
  * materialized path threading, and avatar generation.
110
+ *
111
+ * @example
112
+ * ```ts
113
+ * const comment = await createComment({
114
+ * targetUrn: "urn:qarpeo:blog:hello-world",
115
+ * authorName: "Alice",
116
+ * content: "Great post!",
117
+ * }, event)
118
+ * ```
84
119
  */
85
120
  export declare function createComment(input: CreateCommentInput, event?: RequestEvent): Promise<Comment>;
121
+ /**
122
+ * Updates the moderation status of a comment (approved, spam, pending, deleted).
123
+ *
124
+ * @example
125
+ * ```ts
126
+ * const updated = await updateCommentStatus("cmt_123", "approved", event)
127
+ * ```
128
+ */
86
129
  export declare function updateCommentStatus(id: string, status: CommentStatus, event?: RequestEvent): Promise<Comment | null>;
87
130
  /**
88
131
  * Soft-deletes a comment, retaining tree structure.
89
132
  * Sets `deletedAt`, `status = "deleted"`, and clears PII fields.
90
133
  * Content is replaced with "[deleted]" at read time.
134
+ *
135
+ * @example
136
+ * ```ts
137
+ * await deleteComment("cmt_123", event)
138
+ * ```
91
139
  */
92
140
  export declare function deleteComment(id: string, event?: RequestEvent): Promise<void>;
141
+ /**
142
+ * Moderates multiple comments in a single operation.
143
+ * Supports "approve", "spam", and "delete" actions.
144
+ *
145
+ * @example
146
+ * ```ts
147
+ * await batchModerateComments({
148
+ * ids: ["cmt_1", "cmt_2"],
149
+ * action: "approve",
150
+ * }, event)
151
+ * ```
152
+ */
153
+ export declare function batchModerateComments(input: BatchModerateInput, event?: RequestEvent): Promise<BatchModerateResult>;
93
154
  /**
94
155
  * Submits a community report for a comment.
95
156
  * Auto-hides the comment when the report count exceeds the configured threshold.
157
+ *
158
+ * @example
159
+ * ```ts
160
+ * await reportComment("cmt_123", "spam", { note: "Repeated advertising" }, event)
161
+ * ```
96
162
  */
97
163
  export declare function reportComment(commentId: string, reason: ReportReason, opts?: {
98
164
  note?: string;
@@ -103,6 +169,11 @@ export declare function reportComment(commentId: string, reason: ReportReason, o
103
169
  * Updates the `reaction_counts` JSON denormalisation on the comment row.
104
170
  *
105
171
  * @returns The updated reaction counts map.
172
+ *
173
+ * @example
174
+ * ```ts
175
+ * const { added, reactionCounts } = await reactToComment("cmt_123", "👍", { userId: "u_1" }, event)
176
+ * ```
106
177
  */
107
178
  export declare function reactToComment(commentId: string, reaction: string, opts?: {
108
179
  userId?: string;