qarpeo 0.1.34 → 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 (364) 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 -5114
  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 +31 -10
  210. package/dist/runtime/server/utils/cache.mjs +130 -53
  211. package/dist/runtime/server/utils/cms/collections.d.ts +23 -0
  212. package/dist/runtime/server/utils/cms/collections.mjs +143 -0
  213. package/dist/runtime/server/utils/cms/common.d.ts +9 -0
  214. package/dist/runtime/server/utils/cms/common.mjs +28 -0
  215. package/dist/runtime/server/utils/cms/git.mjs +2 -2
  216. package/dist/runtime/server/utils/cms/navigation.d.ts +46 -0
  217. package/dist/runtime/server/utils/cms/navigation.mjs +683 -0
  218. package/dist/runtime/server/utils/cms/preview.d.ts +11 -0
  219. package/dist/runtime/server/utils/cms/preview.mjs +50 -0
  220. package/dist/runtime/server/utils/cms/search.d.ts +1 -1
  221. package/dist/runtime/server/utils/cms/search.mjs +11 -7
  222. package/dist/runtime/server/utils/cms/sync.d.ts +34 -0
  223. package/dist/runtime/server/utils/cms/sync.mjs +1082 -0
  224. package/dist/runtime/server/utils/cms/taxonomy.d.ts +103 -0
  225. package/dist/runtime/server/utils/cms/taxonomy.mjs +348 -0
  226. package/dist/runtime/server/utils/cms.d.ts +13 -249
  227. package/dist/runtime/server/utils/cms.mjs +108 -2350
  228. package/dist/runtime/server/utils/comments-filter.d.ts +45 -0
  229. package/dist/runtime/server/utils/comments-filter.mjs +541 -0
  230. package/dist/runtime/server/utils/comments.d.ts +71 -0
  231. package/dist/runtime/server/utils/comments.mjs +137 -61
  232. package/dist/runtime/server/utils/config.d.ts +4 -3
  233. package/dist/runtime/server/utils/config.mjs +7 -6
  234. package/dist/runtime/server/utils/context.d.ts +14 -0
  235. package/dist/runtime/server/utils/context.mjs +2 -2
  236. package/dist/runtime/server/utils/crypto.d.ts +44 -5
  237. package/dist/runtime/server/utils/crypto.mjs +18 -0
  238. package/dist/runtime/server/utils/domains.mjs +9 -5
  239. package/dist/runtime/server/utils/drizzle.d.ts +35 -3
  240. package/dist/runtime/server/utils/drizzle.mjs +115 -6
  241. package/dist/runtime/server/utils/durable-object.d.ts +106 -0
  242. package/dist/runtime/server/utils/durable-object.mjs +628 -0
  243. package/dist/runtime/server/utils/email-inbound.d.ts +29 -0
  244. package/dist/runtime/server/utils/email-inbound.mjs +76 -0
  245. package/dist/runtime/server/utils/impersonation.d.ts +32 -2
  246. package/dist/runtime/server/utils/impersonation.mjs +16 -13
  247. package/dist/runtime/server/utils/lock.d.ts +71 -0
  248. package/dist/runtime/server/utils/lock.mjs +139 -0
  249. package/dist/runtime/server/utils/mail-suppression.mjs +7 -7
  250. package/dist/runtime/server/utils/mail.d.ts +30 -19
  251. package/dist/runtime/server/utils/mcp.d.ts +44 -0
  252. package/dist/runtime/server/utils/mcp.mjs +308 -0
  253. package/dist/runtime/server/utils/notifications.d.ts +72 -7
  254. package/dist/runtime/server/utils/notifications.mjs +67 -55
  255. package/dist/runtime/server/utils/oauth.d.ts +27 -4
  256. package/dist/runtime/server/utils/organization.d.ts +63 -7
  257. package/dist/runtime/server/utils/organization.mjs +26 -21
  258. package/dist/runtime/server/utils/passwordless.d.ts +62 -33
  259. package/dist/runtime/server/utils/payments.d.ts +51 -12
  260. package/dist/runtime/server/utils/payments.mjs +472 -282
  261. package/dist/runtime/server/utils/queue.d.ts +106 -13
  262. package/dist/runtime/server/utils/queue.mjs +313 -28
  263. package/dist/runtime/server/utils/rag.d.ts +42 -14
  264. package/dist/runtime/server/utils/rag.mjs +169 -4
  265. package/dist/runtime/server/utils/ratelimit.d.ts +34 -5
  266. package/dist/runtime/server/utils/ratelimit.mjs +95 -14
  267. package/dist/runtime/server/utils/realtime.d.ts +68 -52
  268. package/dist/runtime/server/utils/scheduled-task.d.ts +42 -1
  269. package/dist/runtime/server/utils/scheduled-task.mjs +29 -0
  270. package/dist/runtime/server/utils/schema-fallback.d.ts +1 -1
  271. package/dist/runtime/server/utils/schema-fallback.mjs +1 -1
  272. package/dist/runtime/server/utils/session.d.ts +84 -10
  273. package/dist/runtime/server/utils/session.mjs +12 -10
  274. package/dist/runtime/server/utils/sse.d.ts +75 -0
  275. package/dist/runtime/server/utils/sse.mjs +147 -0
  276. package/dist/runtime/server/utils/sso.d.ts +1 -1
  277. package/dist/runtime/server/utils/storage.d.ts +53 -4
  278. package/dist/runtime/server/utils/storage.mjs +15 -11
  279. package/dist/runtime/server/utils/store-localization.d.ts +51 -0
  280. package/dist/runtime/server/utils/store-localization.mjs +417 -0
  281. package/dist/runtime/server/utils/store.d.ts +207 -0
  282. package/dist/runtime/server/utils/store.mjs +2227 -0
  283. package/dist/runtime/server/utils/table-names.d.ts +51 -0
  284. package/dist/runtime/server/utils/table-names.mjs +69 -0
  285. package/dist/runtime/server/utils/tenant.d.ts +26 -2
  286. package/dist/runtime/server/utils/tenant.mjs +16 -12
  287. package/dist/runtime/server/utils/tools-registry-fallback.d.ts +1 -0
  288. package/dist/runtime/server/utils/tools-registry-fallback.mjs +1 -0
  289. package/dist/runtime/server/utils/totp.d.ts +45 -2
  290. package/dist/runtime/server/utils/tracker.d.ts +10 -11
  291. package/dist/runtime/server/utils/turnstile.d.ts +16 -1
  292. package/dist/runtime/server/utils/workflows.d.ts +92 -0
  293. package/dist/runtime/server/utils/workflows.mjs +299 -0
  294. package/dist/runtime/server.d.ts +8 -1
  295. package/dist/runtime/server.mjs +8 -5
  296. package/dist/runtime/service.d.ts +10 -10
  297. package/dist/runtime/storage.d.ts +1 -0
  298. package/dist/runtime/storage.mjs +1 -0
  299. package/dist/runtime/store.d.ts +4 -0
  300. package/dist/runtime/store.mjs +2 -0
  301. package/dist/runtime/test-utils.d.ts +11 -10
  302. package/dist/runtime/test-utils.mjs +64 -4
  303. package/dist/runtime/types/ai.d.ts +21 -2
  304. package/dist/runtime/types/d1.d.ts +17 -0
  305. package/dist/runtime/types/drizzle.d.ts +2 -2
  306. package/dist/runtime/types/durable-object.d.ts +62 -2
  307. package/dist/runtime/types/email.d.ts +46 -0
  308. package/dist/runtime/types/imports.d.ts +6 -1
  309. package/dist/runtime/types/index.d.ts +58 -0
  310. package/dist/runtime/types/index.mjs +3 -0
  311. package/dist/runtime/types/mcp.d.ts +83 -0
  312. package/dist/runtime/types/mcp.mjs +0 -0
  313. package/dist/runtime/types/queue.d.ts +36 -0
  314. package/dist/runtime/types/r2.d.ts +41 -0
  315. package/dist/runtime/types/store.d.ts +313 -0
  316. package/dist/runtime/types/store.mjs +0 -0
  317. package/dist/runtime/types/workflows.d.ts +98 -0
  318. package/dist/runtime/types/workflows.mjs +0 -0
  319. package/dist/runtime/workflows.d.ts +5 -0
  320. package/dist/runtime/workflows.mjs +2 -0
  321. package/dist/types/ai.d.ts +721 -0
  322. package/dist/types/cms.d.ts +710 -0
  323. package/dist/types.d.ts +430 -1292
  324. package/dist/utils/auth-schema.d.ts +3 -2
  325. package/dist/utils/bots.d.ts +20 -0
  326. package/dist/utils/comments-schema.d.ts +5 -4
  327. package/dist/utils/drizzle.d.ts +83 -3
  328. package/dist/utils/durable-objects.d.ts +10 -0
  329. package/dist/utils/email-inbound.d.ts +10 -0
  330. package/dist/utils/local-db.d.ts +1 -3
  331. package/dist/utils/mcp.d.ts +24 -0
  332. package/dist/utils/notifications-schema.d.ts +5 -4
  333. package/dist/utils/payments-schema.d.ts +4 -3
  334. package/dist/utils/store-schema.d.ts +14 -0
  335. package/dist/utils/table-names.d.ts +1 -0
  336. package/dist/utils/tenants-schema.d.ts +4 -3
  337. package/dist/utils/tools.d.ts +20 -0
  338. package/dist/utils/workflows.d.ts +8 -0
  339. package/package.json +34 -4
  340. package/dist/chunks/wrangler.mjs +0 -897
  341. package/dist/runtime/app/components/AuthRegister.vue +0 -306
  342. package/dist/runtime/app/components/AuthSessionsList.vue +0 -137
  343. package/dist/runtime/app/components/AuthSignIn.vue +0 -298
  344. package/dist/runtime/app/components/CMSBookmarkButton.vue +0 -59
  345. package/dist/runtime/app/components/CMSImage.vue +0 -47
  346. package/dist/runtime/app/components/CMSLocaleSwitcher.vue +0 -110
  347. package/dist/runtime/app/components/CMSNewsletter.vue +0 -81
  348. package/dist/runtime/app/components/CMSPreviewBanner.vue +0 -83
  349. package/dist/runtime/app/components/CMSTableOfContents.vue +0 -84
  350. package/dist/runtime/app/components/CMSVersionBanner.vue +0 -53
  351. package/dist/runtime/app/components/CMSVersionSwitcher.vue +0 -140
  352. package/dist/runtime/app/components/Comments.vue +0 -411
  353. package/dist/runtime/app/components/FileUpload.vue +0 -200
  354. package/dist/runtime/app/components/ImpersonationBanner.vue +0 -61
  355. package/dist/runtime/app/components/NotificationBell.vue +0 -263
  356. package/dist/runtime/app/components/NotificationList.vue +0 -205
  357. package/dist/runtime/app/components/NotificationPrompt.vue +0 -133
  358. package/dist/runtime/app/components/PricingGated.vue +0 -81
  359. package/dist/runtime/app/components/PricingTable.vue +0 -274
  360. package/dist/runtime/app/components/RealtimeChat.vue +0 -164
  361. package/dist/runtime/app/components/RealtimePresence.vue +0 -129
  362. package/dist/runtime/app/components/RealtimeStatus.vue +0 -79
  363. package/dist/runtime/app/components/SubscriptionCard.vue +0 -207
  364. package/dist/runtime/app/components/UserProfile.vue +0 -558
@@ -1,200 +0,0 @@
1
- <script lang="ts" setup>
2
- import { ref, computed } from "vue"
3
-
4
- import { useBlob, type UploadedFile } from "../composables/storage"
5
-
6
- /**
7
- * `<FileUpload>` — Drag-and-drop file upload dropzone with progress and v-model support. Supports
8
- * custom slot for full UI control or uses a built-in dropzone UI.
9
- */
10
- const props = withDefaults(
11
- defineProps<{
12
- /** File types accepted (e.g. "image/*", ".pdf,.docx"). */
13
- accept?: string
14
- /** Allow multiple file selection. */
15
- multiple?: boolean
16
- /** Maximum file size allowed in bytes. */
17
- maxSize?: number
18
- /** Whether the dropzone is disabled. */
19
- disabled?: boolean
20
- /** Automatically trigger upload immediately on file selection. */
21
- autoUpload?: boolean
22
- /** Target upload endpoint URL (e.g. '/api/avatars'). Defaults to '/api/upload'. */
23
- url?: string
24
- /** Uploaded file(s) v-model. */
25
- modelValue?: UploadedFile | UploadedFile[] | null
26
- /** Additional CSS class for the wrapper container. */
27
- dropzoneClass?: string
28
- }>(),
29
- {
30
- url: "/api/upload",
31
- multiple: false,
32
- disabled: false,
33
- autoUpload: true,
34
- modelValue: null,
35
- dropzoneClass: "",
36
- },
37
- )
38
-
39
- const emit = defineEmits<{
40
- "update:modelValue": [value: UploadedFile | UploadedFile[] | null]
41
- change: [files: File | File[]]
42
- upload: [files: File[]]
43
- success: [result: UploadedFile | UploadedFile[]]
44
- error: [err: Error]
45
- progress: [percent: number]
46
- }>()
47
-
48
- const inputRef = ref<HTMLInputElement | null>(null)
49
- const isDragging = ref(false)
50
- const clientError = ref<string | null>(null)
51
-
52
- const { isUploading, progress, error, upload, uploadMultiple, reset } = useBlob(() => props.url)
53
-
54
- function open() {
55
- if (props.disabled || isUploading.value) return
56
- inputRef.value?.click()
57
- }
58
-
59
- function clear() {
60
- reset()
61
- clientError.value = null
62
- if (inputRef.value) inputRef.value.value = ""
63
- emit("update:modelValue", props.multiple ? [] : null)
64
- }
65
-
66
- async function processFiles(files: FileList | File[]) {
67
- clientError.value = null
68
- const fileList = Array.from(files)
69
- if (fileList.length === 0) return
70
-
71
- if (props.maxSize) {
72
- const oversized = fileList.find((f) => f.size > props.maxSize!)
73
- if (oversized) {
74
- const maxMb = (props.maxSize / (1024 * 1024)).toFixed(1)
75
- const msg = `File "${oversized.name}" exceeds maximum size of ${maxMb}MB`
76
- clientError.value = msg
77
- emit("error", new Error(msg))
78
- return
79
- }
80
- }
81
-
82
- emit("change", props.multiple ? fileList : fileList[0]!)
83
- if (!props.autoUpload) return
84
- emit("upload", fileList)
85
-
86
- try {
87
- if (props.multiple) {
88
- const results = await uploadMultiple(fileList)
89
- emit("update:modelValue", results)
90
- emit("success", results)
91
- } else {
92
- const result = await upload(fileList[0]!)
93
- emit("update:modelValue", result)
94
- emit("success", result)
95
- }
96
- } catch (err: any) {
97
- clientError.value = err?.message || "Upload failed"
98
- emit("error", err)
99
- }
100
- }
101
-
102
- function onDrop(event: DragEvent) {
103
- event.preventDefault()
104
- isDragging.value = false
105
- if (props.disabled || isUploading.value) return
106
- if (event.dataTransfer?.files) processFiles(event.dataTransfer.files)
107
- }
108
-
109
- function onDragOver(event: DragEvent) {
110
- event.preventDefault()
111
- if (!props.disabled && !isUploading.value) isDragging.value = true
112
- }
113
-
114
- function onDragLeave(event: DragEvent) {
115
- event.preventDefault()
116
- isDragging.value = false
117
- }
118
-
119
- function onInputChange(event: Event) {
120
- const target = event.target as HTMLInputElement
121
- if (target.files) processFiles(target.files)
122
- }
123
-
124
- const displayError = computed(() => clientError.value || error.value?.message || null)
125
- </script>
126
-
127
- <template>
128
- <!-- Custom slot: users take full UI control -->
129
- <div
130
- v-if="$slots.default"
131
- :class="['qarpeo-file-upload', dropzoneClass]"
132
- @drop="onDrop"
133
- @dragover="onDragOver"
134
- @dragleave="onDragLeave"
135
- >
136
- <input
137
- ref="inputRef"
138
- type="file"
139
- :accept="accept"
140
- :multiple="multiple"
141
- class="hidden"
142
- @change="onInputChange"
143
- />
144
- <slot
145
- :is-dragging="isDragging"
146
- :is-uploading="isUploading"
147
- :progress="progress"
148
- :error="displayError"
149
- :open="open"
150
- :clear="clear"
151
- />
152
- </div>
153
-
154
- <!-- Built-in dropzone UI -->
155
- <div
156
- v-else
157
- class="qarpeo-file-upload-wrapper"
158
- @drop="onDrop"
159
- @dragover="onDragOver"
160
- @dragleave="onDragLeave"
161
- >
162
- <input
163
- ref="inputRef"
164
- type="file"
165
- :accept="accept"
166
- :multiple="multiple"
167
- class="hidden"
168
- @change="onInputChange"
169
- />
170
- <div
171
- :class="[
172
- 'rounded-lg border-2 border-dashed p-6 text-center transition-colors duration-200',
173
- isDragging
174
- ? 'border-primary-500 bg-primary-50/50 dark:bg-primary-950/20'
175
- : 'border-gray-300 dark:border-gray-700',
176
- disabled ? 'cursor-not-allowed opacity-60' : 'cursor-pointer',
177
- dropzoneClass,
178
- ]"
179
- @click="open"
180
- >
181
- <!-- Uploading state -->
182
- <div v-if="isUploading" class="space-y-2">
183
- <p class="text-sm text-gray-500">Uploading... {{ progress }}%</p>
184
- <UProgress :value="progress" size="xs" />
185
- </div>
186
-
187
- <!-- Idle / drag state -->
188
- <div v-else class="space-y-1">
189
- <UIcon name="i-lucide-upload-cloud" class="size-8 mx-auto text-gray-400" />
190
- <p class="text-sm font-medium text-gray-700 dark:text-gray-300">
191
- {{ isDragging ? "Drop files to upload" : "Click or drag files here to upload" }}
192
- </p>
193
- <p v-if="accept" class="text-xs text-gray-400">Accepted: {{ accept }}</p>
194
- </div>
195
-
196
- <!-- Error -->
197
- <p v-if="displayError" class="mt-2 text-xs text-red-500">{{ displayError }}</p>
198
- </div>
199
- </div>
200
- </template>
@@ -1,61 +0,0 @@
1
- <script lang="ts" setup>
2
- import { computed } from "vue"
3
-
4
- import type { QarpeoUser, QarpeoSession } from "../../types/auth"
5
- import { useUserSession } from "../composables/auth"
6
-
7
- /**
8
- * `<ImpersonationBanner>` Renders a dismissible banner when an admin is actively impersonating a
9
- * user. Shows who is being impersonated and provides a "Stop Impersonating" button. Auto-hides when
10
- * not in an impersonation session.
11
- *
12
- * @fires stopped — when impersonation is stopped successfully
13
- */
14
- const emit = defineEmits<{ stopped: [] }>()
15
-
16
- const { session, fetch: refreshSession } = useUserSession()
17
-
18
- const isImpersonating = computed(() =>
19
- Boolean((session.value as QarpeoSession | null)?.impersonator),
20
- )
21
- const impersonator = computed<QarpeoUser | null>(
22
- () => ((session.value as QarpeoSession | null)?.impersonator as QarpeoUser) || null,
23
- )
24
- const impersonated = computed<QarpeoUser | null>(() => {
25
- if (!isImpersonating.value) return null
26
- return ((session.value as QarpeoSession | null)?.user as QarpeoUser) || null
27
- })
28
-
29
- async function stopImpersonating() {
30
- try {
31
- await $fetch("/api/auth/impersonate/stop", { method: "POST", credentials: "include" })
32
- await refreshSession()
33
- emit("stopped")
34
- } catch {}
35
- }
36
- </script>
37
-
38
- <template>
39
- <Teleport to="body">
40
- <div
41
- v-if="isImpersonating"
42
- class="fixed top-0 left-0 right-0 z-[9999] flex items-center justify-between gap-4 bg-amber-700 text-white px-4 py-2 text-sm font-sans"
43
- >
44
- <span>
45
- ⚠ Admin
46
- <strong>{{ impersonator?.email || impersonator?.name || "Unknown" }}</strong>
47
- is impersonating
48
- <strong>{{ impersonated?.email || impersonated?.name || "Unknown" }}</strong>
49
- </span>
50
- <UButton
51
- color="neutral"
52
- variant="outline"
53
- size="xs"
54
- class="border-white/50 text-white hover:bg-white/20"
55
- @click="stopImpersonating"
56
- >
57
- Stop Impersonating
58
- </UButton>
59
- </div>
60
- </Teleport>
61
- </template>
@@ -1,263 +0,0 @@
1
- <script lang="ts" setup>
2
- import { computed, onMounted, onScopeDispose, ref } from "vue"
3
-
4
- import type { NotificationRecord } from "../../../types"
5
- import { useNotifications } from "../composables/notifications"
6
-
7
- interface Props {
8
- align?: "left" | "right"
9
- maxItems?: number
10
- allNotificationsUrl?: string
11
- }
12
-
13
- const props = withDefaults(defineProps<Props>(), {
14
- align: "right",
15
- maxItems: 6,
16
- allNotificationsUrl: undefined,
17
- })
18
-
19
- const { notifications, unreadCount, pending, markAsRead, markAllAsRead, remove, refresh } =
20
- useNotifications()
21
-
22
- const isOpen = ref(false)
23
- const filter = ref<"all" | "unread">("all")
24
- const bellRef = ref<HTMLElement | null>(null)
25
-
26
- const displayedNotifications = computed(() => {
27
- const list =
28
- filter.value === "unread" ? notifications.value.filter((n) => !n.read) : notifications.value
29
- return list.slice(0, props.maxItems)
30
- })
31
-
32
- function toggleOpen() {
33
- isOpen.value = !isOpen.value
34
- if (isOpen.value) {
35
- refresh()
36
- }
37
- }
38
-
39
- function handleNotificationClick(item: NotificationRecord) {
40
- if (!item.read) {
41
- markAsRead(item.id)
42
- }
43
- if (item.actionUrl && typeof window !== "undefined") {
44
- window.location.href = item.actionUrl
45
- }
46
- }
47
-
48
- function formatRelativeTime(ts: number) {
49
- const diff = Date.now() - ts
50
- const mins = Math.floor(diff / 60000)
51
- if (mins < 1) return "Just now"
52
- if (mins < 60) return `${mins}m ago`
53
- const hours = Math.floor(mins / 60)
54
- if (hours < 24) return `${hours}h ago`
55
- const days = Math.floor(hours / 24)
56
- return `${days}d ago`
57
- }
58
-
59
- function handleClickOutside(event: MouseEvent) {
60
- if (bellRef.value && !bellRef.value.contains(event.target as Node)) {
61
- isOpen.value = false
62
- }
63
- }
64
-
65
- function handleKeydown(event: KeyboardEvent) {
66
- if (event.key === "Escape" && isOpen.value) {
67
- isOpen.value = false
68
- }
69
- }
70
-
71
- onMounted(() => {
72
- if (typeof window !== "undefined") {
73
- window.addEventListener("click", handleClickOutside)
74
- window.addEventListener("keydown", handleKeydown)
75
- }
76
- })
77
-
78
- onScopeDispose(() => {
79
- if (typeof window !== "undefined") {
80
- window.removeEventListener("click", handleClickOutside)
81
- window.removeEventListener("keydown", handleKeydown)
82
- }
83
- })
84
- </script>
85
-
86
- <template>
87
- <div ref="bellRef" class="relative inline-block text-left">
88
- <!-- Bell Button -->
89
- <button
90
- type="button"
91
- class="relative flex h-9 w-9 items-center justify-center rounded-full text-neutral-600 transition hover:bg-neutral-100 hover:text-neutral-900 focus:outline-none dark:text-neutral-400 dark:hover:bg-neutral-800 dark:hover:text-neutral-100"
92
- aria-label="Notifications"
93
- @click="toggleOpen"
94
- >
95
- <!-- Bell Icon -->
96
- <svg
97
- class="h-5 w-5"
98
- fill="none"
99
- viewBox="0 0 24 24"
100
- stroke="currentColor"
101
- stroke-width="1.75"
102
- >
103
- <path
104
- stroke-linecap="round"
105
- stroke-linejoin="round"
106
- d="M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0"
107
- />
108
- </svg>
109
-
110
- <!-- Unread Badge -->
111
- <span
112
- v-if="unreadCount > 0"
113
- class="absolute -right-0.5 -top-0.5 flex h-4 min-w-[16px] items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-bold text-white shadow-sm"
114
- >
115
- {{ unreadCount > 99 ? "99+" : unreadCount }}
116
- </span>
117
- </button>
118
-
119
- <!-- Dropdown Popover -->
120
- <div
121
- v-if="isOpen"
122
- class="absolute z-50 mt-2 w-80 rounded-2xl border border-neutral-200 bg-white shadow-xl dark:border-neutral-800 dark:bg-neutral-900 sm:w-96"
123
- :class="align === 'right' ? 'right-0' : 'left-0'"
124
- >
125
- <!-- Header -->
126
- <div
127
- class="flex items-center justify-between border-b border-neutral-100 p-3.5 dark:border-neutral-800"
128
- >
129
- <div class="flex items-center gap-2">
130
- <span class="text-sm font-semibold text-neutral-900 dark:text-neutral-50"
131
- >Notifications</span
132
- >
133
- <span
134
- v-if="unreadCount > 0"
135
- class="rounded-full bg-neutral-100 px-2 py-0.5 text-[11px] font-semibold text-neutral-600 dark:bg-neutral-800 dark:text-neutral-300"
136
- >
137
- {{ unreadCount }} new
138
- </span>
139
- </div>
140
-
141
- <div class="flex items-center gap-2">
142
- <button
143
- v-if="unreadCount > 0"
144
- type="button"
145
- class="text-xs text-neutral-500 hover:text-neutral-900 dark:hover:text-neutral-200"
146
- @click="markAllAsRead"
147
- >
148
- Mark all read
149
- </button>
150
- </div>
151
- </div>
152
-
153
- <!-- Filter tabs -->
154
- <div
155
- class="flex border-b border-neutral-100 bg-neutral-50/50 px-3 py-1.5 text-xs dark:border-neutral-800 dark:bg-neutral-850/40"
156
- >
157
- <button
158
- type="button"
159
- class="rounded-md px-2.5 py-1 font-medium transition"
160
- :class="
161
- filter === 'all'
162
- ? 'bg-white text-neutral-900 shadow-sm dark:bg-neutral-800 dark:text-white'
163
- : 'text-neutral-500 hover:text-neutral-800 dark:text-neutral-400'
164
- "
165
- @click="filter = 'all'"
166
- >
167
- All
168
- </button>
169
- <button
170
- type="button"
171
- class="rounded-md px-2.5 py-1 font-medium transition"
172
- :class="
173
- filter === 'unread'
174
- ? 'bg-white text-neutral-900 shadow-sm dark:bg-neutral-800 dark:text-white'
175
- : 'text-neutral-500 hover:text-neutral-800 dark:text-neutral-400'
176
- "
177
- @click="filter = 'unread'"
178
- >
179
- Unread
180
- </button>
181
- </div>
182
-
183
- <!-- Notifications List -->
184
- <div class="max-h-80 overflow-y-auto divide-y divide-neutral-100 dark:divide-neutral-800">
185
- <div
186
- v-if="pending && notifications.length === 0"
187
- class="py-8 text-center text-xs text-neutral-400"
188
- >
189
- Loading notifications...
190
- </div>
191
-
192
- <div
193
- v-else-if="displayedNotifications.length === 0"
194
- class="py-8 text-center text-xs text-neutral-400"
195
- >
196
- {{ filter === "unread" ? "No unread notifications" : "No notifications yet" }}
197
- </div>
198
-
199
- <div
200
- v-for="item in displayedNotifications"
201
- v-else
202
- :key="item.id"
203
- class="group relative flex cursor-pointer items-start gap-3 p-3 text-xs transition hover:bg-neutral-50 dark:hover:bg-neutral-850"
204
- :class="!item.read ? 'bg-blue-50/30 dark:bg-blue-950/20' : ''"
205
- @click="handleNotificationClick(item)"
206
- >
207
- <!-- Unread Dot Indicator -->
208
- <span
209
- v-if="!item.read"
210
- class="mt-1 h-2 w-2 shrink-0 rounded-full bg-blue-600 dark:bg-blue-400"
211
- />
212
- <span v-else class="mt-1 h-2 w-2 shrink-0 rounded-full bg-transparent" />
213
-
214
- <!-- Body -->
215
- <div class="min-w-0 flex-1">
216
- <p
217
- class="font-medium text-neutral-900 dark:text-neutral-100"
218
- :class="!item.read ? 'font-semibold' : ''"
219
- >
220
- {{ item.title }}
221
- </p>
222
- <p v-if="item.body" class="mt-0.5 line-clamp-2 text-neutral-500 dark:text-neutral-400">
223
- {{ item.body }}
224
- </p>
225
- <p class="mt-1 text-[10px] text-neutral-400 dark:text-neutral-500">
226
- {{ formatRelativeTime(item.createdAt) }}
227
- </p>
228
- </div>
229
-
230
- <!-- Delete Action -->
231
- <button
232
- type="button"
233
- class="shrink-0 opacity-0 group-hover:opacity-100 text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-200"
234
- title="Delete notification"
235
- @click.stop="remove(item.id)"
236
- >
237
- <svg class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
238
- <path
239
- stroke-linecap="round"
240
- stroke-linejoin="round"
241
- stroke-width="2"
242
- d="M6 18L18 6M6 6l12 12"
243
- />
244
- </svg>
245
- </button>
246
- </div>
247
- </div>
248
-
249
- <!-- Footer -->
250
- <div
251
- v-if="allNotificationsUrl"
252
- class="border-t border-neutral-100 p-2.5 text-center dark:border-neutral-800"
253
- >
254
- <a
255
- :href="allNotificationsUrl"
256
- class="text-xs font-medium text-neutral-600 hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-neutral-200"
257
- >
258
- View all notifications →
259
- </a>
260
- </div>
261
- </div>
262
- </div>
263
- </template>