qarpeo 0.1.32 → 0.1.34

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 (57) hide show
  1. package/README.md +5 -7
  2. package/dist/chunks/auth-schema.mjs +12 -10
  3. package/dist/chunks/wrangler.mjs +1 -1
  4. package/dist/module.d.ts +1 -0
  5. package/dist/module.mjs +284 -100
  6. package/dist/runtime/app/components/Comments.vue +411 -0
  7. package/dist/runtime/app/composables/cms.d.ts +11 -7
  8. package/dist/runtime/app/composables/cms.mjs +36 -68
  9. package/dist/runtime/app/composables/comments.d.ts +45 -0
  10. package/dist/runtime/app/composables/comments.mjs +150 -0
  11. package/dist/runtime/app/composables/organization.d.ts +3 -3
  12. package/dist/runtime/server/db/cms-schema.d.ts +1 -1
  13. package/dist/runtime/server/db/cms-schema.mjs +1 -2
  14. package/dist/runtime/server/routes/cms/[collection]/index.get.mjs +2 -0
  15. package/dist/runtime/server/routes/cms/publish-scheduled.post.mjs +7 -4
  16. package/dist/runtime/server/routes/cms/subscribers/[id].patch.mjs +9 -2
  17. package/dist/runtime/server/routes/cms/webhooks/[provider].post.mjs +41 -28
  18. package/dist/runtime/server/routes/comments/[id]/react.post.d.ts +6 -0
  19. package/dist/runtime/server/routes/comments/[id]/react.post.mjs +35 -0
  20. package/dist/runtime/server/routes/{cms/comments/[id].patch.d.ts → comments/[id]/report.post.d.ts} +1 -2
  21. package/dist/runtime/server/routes/comments/[id]/report.post.mjs +50 -0
  22. package/dist/runtime/server/routes/{cms/comments → comments}/[id].delete.d.ts +0 -1
  23. package/dist/runtime/server/routes/comments/[id].delete.mjs +27 -0
  24. package/dist/runtime/server/routes/{cms/comments → comments}/[id].get.d.ts +1 -1
  25. package/dist/runtime/server/routes/comments/[id].get.mjs +14 -0
  26. package/dist/runtime/server/routes/comments/[id].patch.d.ts +4 -0
  27. package/dist/runtime/server/routes/comments/[id].patch.mjs +37 -0
  28. package/dist/runtime/server/routes/{cms/comments.get.d.ts → comments/index.get.d.ts} +1 -1
  29. package/dist/runtime/server/routes/comments/index.get.mjs +34 -0
  30. package/dist/runtime/server/routes/comments/index.post.d.ts +4 -0
  31. package/dist/runtime/server/routes/comments/index.post.mjs +36 -0
  32. package/dist/runtime/server/utils/audit.d.ts +3 -3
  33. package/dist/runtime/server/utils/audit.mjs +43 -17
  34. package/dist/runtime/server/utils/auth.d.ts +55 -0
  35. package/dist/runtime/server/utils/auth.mjs +92 -10
  36. package/dist/runtime/server/utils/cms/git.mjs +2 -6
  37. package/dist/runtime/server/utils/cms.d.ts +17 -22
  38. package/dist/runtime/server/utils/cms.mjs +144 -309
  39. package/dist/runtime/server/utils/comments.d.ts +112 -0
  40. package/dist/runtime/server/utils/comments.mjs +450 -0
  41. package/dist/runtime/server/utils/config.d.ts +2 -1
  42. package/dist/runtime/server/utils/config.mjs +1 -0
  43. package/dist/runtime/server/utils/urn.d.ts +15 -0
  44. package/dist/runtime/server/utils/urn.mjs +20 -0
  45. package/dist/runtime/server.d.ts +4 -0
  46. package/dist/runtime/server.mjs +5 -0
  47. package/dist/runtime/types/auth.d.ts +12 -1
  48. package/dist/types.d.ts +67 -27
  49. package/dist/utils/comments-schema.d.ts +13 -0
  50. package/package.json +4 -4
  51. package/dist/runtime/app/components/CMSComments.vue +0 -202
  52. package/dist/runtime/server/routes/cms/comments/[id].delete.mjs +0 -12
  53. package/dist/runtime/server/routes/cms/comments/[id].get.mjs +0 -13
  54. package/dist/runtime/server/routes/cms/comments/[id].patch.mjs +0 -17
  55. package/dist/runtime/server/routes/cms/comments.get.mjs +0 -43
  56. package/dist/runtime/server/routes/cms/comments.post.d.ts +0 -17
  57. package/dist/runtime/server/routes/cms/comments.post.mjs +0 -46
package/dist/module.mjs CHANGED
@@ -571,7 +571,6 @@ async function scanContentEntries(options) {
571
571
  navigation: fm.navigation,
572
572
  hidden: fm.hidden,
573
573
  draft: isDraft,
574
- _ast: ast,
575
574
  _toc: { links: toc },
576
575
  _nav: navMeta,
577
576
  _section: effectiveSection,
@@ -679,6 +678,95 @@ async function scanContentEntries(options) {
679
678
  return entries;
680
679
  }
681
680
 
681
+ const ALL_COMMENTS_TABLE_NAMES = [
682
+ "_qarpeo_comments",
683
+ "_qarpeo_comment_reports",
684
+ "_qarpeo_comment_reactions"
685
+ ];
686
+ function getActiveCommentsTableNames(comments) {
687
+ if (!comments) return [];
688
+ return [
689
+ "_qarpeo_comments",
690
+ "_qarpeo_comment_reports",
691
+ "_qarpeo_comment_reactions"
692
+ ];
693
+ }
694
+ function generateCommentsSchema(comments) {
695
+ if (!comments) {
696
+ return "// Qarpeo Comments is disabled\nexport default {};\n";
697
+ }
698
+ const lines = [
699
+ `// Auto-generated by qarpeo \u2014 Threaded Comments System`,
700
+ `// snakeCase.table maps camelCase property names \u2192 snake_case column names automatically`,
701
+ `import { integer, text, index, uniqueIndex, snakeCase } from "drizzle-orm/sqlite-core";`,
702
+ ``,
703
+ `// \u2500\u2500\u2500 1. Comments \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`,
704
+ `export const qarpeoComments = snakeCase.table("_qarpeo_comments", {`,
705
+ ` id: text().primaryKey(),`,
706
+ ` /** Universal Resource Name of the target entity, e.g. "urn:cms:blog:abc123" */`,
707
+ ` targetUrn: text().notNull(),`,
708
+ ` tenantId: text(),`,
709
+ ` /** Parent comment ID; null for root-level comments */`,
710
+ ` parentId: text(),`,
711
+ ` /** Materialized path for fast subtree queries, e.g. "/0001/0002/" */`,
712
+ ` path: text().notNull().default("/"),`,
713
+ ` depth: integer().notNull().default(0),`,
714
+ ` authorName: text().notNull(),`,
715
+ ` authorEmail: text(),`,
716
+ ` /** Deterministic inline SVG data-URI avatar \u2014 no external CDN calls */`,
717
+ ` authorAvatar: text(),`,
718
+ ` /** Anonymous author IP; never exposed in public API responses */`,
719
+ ` authorIp: text(),`,
720
+ ` content: text().notNull(),`,
721
+ ` /** pending | approved | spam | deleted */`,
722
+ ` status: text().notNull().default("pending"),`,
723
+ ` /** Unix ms timestamp; non-null means the comment is tombstoned */`,
724
+ ` deletedAt: integer(),`,
725
+ ` reportCount: integer().notNull().default(0),`,
726
+ ` /** JSON map of reaction type \u2192 count, e.g. {"like":3,"heart":1} */`,
727
+ ` reactionCounts: text().notNull().default("{}"),`,
728
+ ` metadataJson: text().notNull().default("{}"),`,
729
+ ` createdAt: integer().notNull(),`,
730
+ ` updatedAt: integer().notNull(),`,
731
+ `}, (t) => [`,
732
+ ` index("idx_qarpeo_comments_target").on(t.targetUrn, t.status, t.createdAt),`,
733
+ ` index("idx_qarpeo_comments_parent").on(t.parentId),`,
734
+ ` index("idx_qarpeo_comments_path").on(t.path),`,
735
+ ` index("idx_qarpeo_comments_tenant").on(t.tenantId),`,
736
+ `]);`,
737
+ ``,
738
+ `// \u2500\u2500\u2500 2. Community Reports \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`,
739
+ `export const qarpeoCommentReports = snakeCase.table("_qarpeo_comment_reports", {`,
740
+ ` id: text().primaryKey(),`,
741
+ ` commentId: text().notNull(),`,
742
+ ` reporterIp: text(),`,
743
+ ` reporterUserId: text(),`,
744
+ ` /** spam | harassment | off-topic | misinformation | other */`,
745
+ ` reason: text().notNull(),`,
746
+ ` note: text(),`,
747
+ ` createdAt: integer().notNull(),`,
748
+ `}, (t) => [`,
749
+ ` index("idx_qarpeo_reports_comment").on(t.commentId),`,
750
+ `]);`,
751
+ ``,
752
+ `// \u2500\u2500\u2500 3. Comment Reactions \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`,
753
+ `export const qarpeoCommentReactions = snakeCase.table("_qarpeo_comment_reactions", {`,
754
+ ` id: text().primaryKey(),`,
755
+ ` commentId: text().notNull(),`,
756
+ ` /** Authenticated user ID; null for anonymous reactions (keyed by IP) */`,
757
+ ` userId: text(),`,
758
+ ` ip: text(),`,
759
+ ` /** like | heart | fire | unicorn \u2014 or any string from CommentsOptions.reactions */`,
760
+ ` reaction: text().notNull(),`,
761
+ ` createdAt: integer().notNull(),`,
762
+ `}, (t) => [`,
763
+ ` index("idx_qarpeo_reactions_comment").on(t.commentId),`,
764
+ ` uniqueIndex("idx_qarpeo_reactions_unique_user").on(t.commentId, t.userId, t.reaction),`,
765
+ `]);`
766
+ ];
767
+ return lines.join("\n") + "\n";
768
+ }
769
+
682
770
  function getActiveNotificationsTableNames(notifications) {
683
771
  if (!notifications) return [];
684
772
  const notifTable = (typeof notifications === "object" ? notifications.tableName : void 0) || "_qarpeo_notifications";
@@ -903,7 +991,6 @@ const ALL_CMS_TABLE_NAMES = [
903
991
  "_qarpeo_cms_revisions",
904
992
  "_qarpeo_cms_categories",
905
993
  "_qarpeo_cms_tags",
906
- "_qarpeo_cms_comments",
907
994
  "_qarpeo_cms_bookmarks",
908
995
  "_qarpeo_cms_subscribers"
909
996
  ];
@@ -1057,7 +1144,7 @@ const cmsBookmarks = snakeCase.table(
1057
1144
  (t) => [
1058
1145
  index("_qarpeo_cms_bookmarks_user_idx").on(t.userId),
1059
1146
  index("_qarpeo_cms_bookmarks_entry_idx").on(t.entryId),
1060
- index("_qarpeo_cms_bookmarks_unique_idx").on(t.userId, t.entryId)
1147
+ uniqueIndex("_qarpeo_cms_bookmarks_unique_idx").on(t.tenantId, t.userId, t.entryId)
1061
1148
  ]
1062
1149
  );
1063
1150
  const cmsSubscribers = snakeCase.table(
@@ -1105,7 +1192,6 @@ const module$1 = defineNuxtModule({
1105
1192
  do: false,
1106
1193
  cron: false,
1107
1194
  email: false,
1108
- kits: void 0,
1109
1195
  auth: false,
1110
1196
  cms: false,
1111
1197
  realtime: false,
@@ -1116,6 +1202,7 @@ const module$1 = defineNuxtModule({
1116
1202
  multitenant: false,
1117
1203
  notifications: false,
1118
1204
  notify: false,
1205
+ comments: false,
1119
1206
  fate: false
1120
1207
  },
1121
1208
  async setup(_options, nuxt) {
@@ -1219,20 +1306,6 @@ const module$1 = defineNuxtModule({
1219
1306
  }
1220
1307
  const qarpeoConfig = nuxt.options.qarpeo || {};
1221
1308
  const options = defu(qarpeoConfig, _options);
1222
- if (options.kits && typeof options.kits === "object") {
1223
- if (options.kits.auth !== void 0 && (options.auth === false || options.auth === void 0)) {
1224
- options.auth = options.kits.auth;
1225
- }
1226
- if (options.kits.cms !== void 0 && (options.cms === false || options.cms === void 0)) {
1227
- options.cms = options.kits.cms;
1228
- }
1229
- if (options.kits.payments !== void 0 && (options.payments === false || options.payments === void 0)) {
1230
- options.payments = options.kits.payments;
1231
- }
1232
- if (options.kits.notifications !== void 0 && (options.notifications === false || options.notifications === void 0)) {
1233
- options.notifications = options.kits.notifications;
1234
- }
1235
- }
1236
1309
  const contentDirs = [];
1237
1310
  const defaultContentDir = resolve(
1238
1311
  nuxt.options.rootDir,
@@ -1338,6 +1411,9 @@ ${extraSources}
1338
1411
  options.db = true;
1339
1412
  options.notifications = options.notifications || options.notify;
1340
1413
  }
1414
+ if (options.comments) {
1415
+ options.db = true;
1416
+ }
1341
1417
  nuxt.options.alias["qarpeo/server"] = resolver.resolve("./runtime/server");
1342
1418
  nuxt.options.alias["#qarpeo/server"] = resolver.resolve("./runtime/server");
1343
1419
  nuxt.options.alias["qarpeo/runtime"] = resolver.resolve("./runtime");
@@ -1360,6 +1436,8 @@ ${extraSources}
1360
1436
  );
1361
1437
  nuxt.options.alias["qarpeo/vapid"] = resolver.resolve("./runtime/server/utils/vapid");
1362
1438
  nuxt.options.alias["#qarpeo/vapid"] = resolver.resolve("./runtime/server/utils/vapid");
1439
+ nuxt.options.alias["qarpeo/comments"] = resolver.resolve("./runtime/server/utils/comments");
1440
+ nuxt.options.alias["#qarpeo/comments"] = resolver.resolve("./runtime/server/utils/comments");
1363
1441
  nuxt.options.alias["@nuxthub/blob"] = resolver.resolve("./runtime/blob");
1364
1442
  nuxt.options.alias["@nuxthub/core/blob"] = resolver.resolve("./runtime/blob");
1365
1443
  const emptyAgentsTemplate = addTemplate({
@@ -1542,7 +1620,7 @@ ${extraSources}
1542
1620
  });
1543
1621
  nuxt.options.css.push("#build/qarpeo-shiki.css");
1544
1622
  addComponent({
1545
- name: "QarpeoWelcome",
1623
+ name: "QWelcome",
1546
1624
  filePath: resolver.resolve("./runtime/app/components/QarpeoWelcome.vue")
1547
1625
  });
1548
1626
  const hasAnyService = Boolean(
@@ -1963,6 +2041,20 @@ export default async function (batch: any, env?: any, ctx?: any) {
1963
2041
  "./runtime/server/utils/schema-fallback"
1964
2042
  );
1965
2043
  }
2044
+ if (options.comments) {
2045
+ const commentsSchemaTemplate = addTemplate({
2046
+ filename: "qarpeo/comments-schema.ts",
2047
+ write: true,
2048
+ getContents: () => {
2049
+ return generateCommentsSchema(options.comments);
2050
+ }
2051
+ });
2052
+ nuxt.options.alias["#qarpeo/comments/schema"] = commentsSchemaTemplate.dst;
2053
+ } else {
2054
+ nuxt.options.alias["#qarpeo/comments/schema"] = resolver.resolve(
2055
+ "./runtime/server/utils/schema-fallback"
2056
+ );
2057
+ }
1966
2058
  const getSchemaFiles = () => findSchemaFiles(
1967
2059
  nuxt.options._layers || [{ cwd: nuxt.options.rootDir, config: nuxt.options }]
1968
2060
  );
@@ -1991,6 +2083,9 @@ export default async function (batch: any, env?: any, ctx?: any) {
1991
2083
  if (options.notifications || options.notify) {
1992
2084
  lines.push(`export * from "#qarpeo/notifications/schema";`);
1993
2085
  }
2086
+ if (options.comments) {
2087
+ lines.push(`export * from "#qarpeo/comments/schema";`);
2088
+ }
1994
2089
  if (lines.length === 1) {
1995
2090
  return [
1996
2091
  "// Auto-generated by qarpeo (empty fallback)",
@@ -3399,6 +3494,18 @@ export default async function (batch: any, env?: any, ctx?: any) {
3399
3494
  name: "ensureAuthTables",
3400
3495
  from: resolver.resolve("./runtime/server/utils/auth")
3401
3496
  },
3497
+ {
3498
+ name: "resolveUserRole",
3499
+ from: resolver.resolve("./runtime/server/utils/auth")
3500
+ },
3501
+ {
3502
+ name: "checkIfExistsBeforeCreate",
3503
+ from: resolver.resolve("./runtime/server/utils/auth")
3504
+ },
3505
+ {
3506
+ name: "getRoleFromEnv",
3507
+ from: resolver.resolve("./runtime/server/utils/auth")
3508
+ },
3402
3509
  // Audit log utilities
3403
3510
  {
3404
3511
  name: "ensureAuditTables",
@@ -3630,35 +3737,35 @@ export default async function (batch: any, env?: any, ctx?: any) {
3630
3737
  }
3631
3738
  ]);
3632
3739
  addComponent({
3633
- name: "AuthState",
3740
+ name: "QAuthState",
3634
3741
  filePath: resolver.resolve("./runtime/app/components/AuthState.vue")
3635
3742
  });
3636
3743
  addComponent({
3637
- name: "SignedIn",
3744
+ name: "QSignedIn",
3638
3745
  filePath: resolver.resolve("./runtime/app/components/SignedIn")
3639
3746
  });
3640
3747
  addComponent({
3641
- name: "SignedOut",
3748
+ name: "QSignedOut",
3642
3749
  filePath: resolver.resolve("./runtime/app/components/SignedOut")
3643
3750
  });
3644
3751
  addComponent({
3645
- name: "ImpersonationBanner",
3752
+ name: "QImpersonationBanner",
3646
3753
  filePath: resolver.resolve("./runtime/app/components/ImpersonationBanner")
3647
3754
  });
3648
3755
  addComponent({
3649
- name: "AuthSignIn",
3756
+ name: "QAuthSignIn",
3650
3757
  filePath: resolver.resolve("./runtime/app/components/AuthSignIn")
3651
3758
  });
3652
3759
  addComponent({
3653
- name: "AuthRegister",
3760
+ name: "QAuthRegister",
3654
3761
  filePath: resolver.resolve("./runtime/app/components/AuthRegister")
3655
3762
  });
3656
3763
  addComponent({
3657
- name: "UserProfile",
3764
+ name: "QUserProfile",
3658
3765
  filePath: resolver.resolve("./runtime/app/components/UserProfile")
3659
3766
  });
3660
3767
  addComponent({
3661
- name: "AuthSessionsList",
3768
+ name: "QAuthSessionsList",
3662
3769
  filePath: resolver.resolve("./runtime/app/components/AuthSessionsList")
3663
3770
  });
3664
3771
  }
@@ -3740,15 +3847,11 @@ export default async function (batch: any, env?: any, ctx?: any) {
3740
3847
  }
3741
3848
  ]);
3742
3849
  addComponent({
3743
- name: "BlobImage",
3744
- filePath: resolver.resolve("./runtime/app/components/BlobImage")
3745
- });
3746
- addComponent({
3747
- name: "QarpeoImage",
3850
+ name: "QBlobImage",
3748
3851
  filePath: resolver.resolve("./runtime/app/components/BlobImage")
3749
3852
  });
3750
3853
  addComponent({
3751
- name: "FileUpload",
3854
+ name: "QFileUpload",
3752
3855
  filePath: resolver.resolve("./runtime/app/components/FileUpload")
3753
3856
  });
3754
3857
  const blobUiEnabled = blobConfig.ui !== false;
@@ -4099,16 +4202,6 @@ export const manifestCollections = ${JSON.stringify(cmsConfig.collections || {})
4099
4202
  method: "get",
4100
4203
  handler: resolver.resolve("./runtime/server/routes/cms/tags.get")
4101
4204
  });
4102
- addServerHandler({
4103
- route: `${cmsApiPath}/comments`,
4104
- method: "get",
4105
- handler: resolver.resolve("./runtime/server/routes/cms/comments.get")
4106
- });
4107
- addServerHandler({
4108
- route: `${cmsApiPath}/comments/:id`,
4109
- method: "get",
4110
- handler: resolver.resolve("./runtime/server/routes/cms/comments/[id].get")
4111
- });
4112
4205
  if (cmsConfig.api !== false) {
4113
4206
  addServerHandler({
4114
4207
  route: `${cmsApiPath}/categories`,
@@ -4160,21 +4253,6 @@ export const manifestCollections = ${JSON.stringify(cmsConfig.collections || {})
4160
4253
  method: "post",
4161
4254
  handler: resolver.resolve("./runtime/server/routes/cms/[collection]/[id]/view.post")
4162
4255
  });
4163
- addServerHandler({
4164
- route: `${cmsApiPath}/comments`,
4165
- method: "post",
4166
- handler: resolver.resolve("./runtime/server/routes/cms/comments.post")
4167
- });
4168
- addServerHandler({
4169
- route: `${cmsApiPath}/comments/:id`,
4170
- method: "patch",
4171
- handler: resolver.resolve("./runtime/server/routes/cms/comments/[id].patch")
4172
- });
4173
- addServerHandler({
4174
- route: `${cmsApiPath}/comments/:id`,
4175
- method: "delete",
4176
- handler: resolver.resolve("./runtime/server/routes/cms/comments/[id].delete")
4177
- });
4178
4256
  addServerHandler({
4179
4257
  route: `${cmsApiPath}/newsletter`,
4180
4258
  method: "post",
@@ -4315,74 +4393,69 @@ export const manifestCollections = ${JSON.stringify(cmsConfig.collections || {})
4315
4393
  from: resolver.resolve("./runtime/app/composables/docs-version")
4316
4394
  },
4317
4395
  { name: "useCMSPreview", from: resolver.resolve("./runtime/app/composables/cms-preview") },
4318
- { name: "useCMSComments", from: resolver.resolve("./runtime/app/composables/cms") },
4319
4396
  { name: "useCMSCategories", from: resolver.resolve("./runtime/app/composables/cms") },
4320
4397
  { name: "useCMSBookmarks", from: resolver.resolve("./runtime/app/composables/cms") },
4321
4398
  { name: "useCMSNewsletter", from: resolver.resolve("./runtime/app/composables/cms") },
4322
4399
  { name: "useCMSTags", from: resolver.resolve("./runtime/app/composables/cms") }
4323
4400
  ]);
4324
4401
  addComponent({
4325
- name: "CMSContent",
4402
+ name: "QCMSContent",
4326
4403
  filePath: resolver.resolve("./runtime/app/components/CMSContent")
4327
4404
  });
4328
4405
  addComponent({
4329
- name: "CMSImage",
4406
+ name: "QCMSImage",
4330
4407
  filePath: resolver.resolve("./runtime/app/components/CMSImage")
4331
4408
  });
4332
4409
  addComponent({
4333
- name: "CMSComments",
4334
- filePath: resolver.resolve("./runtime/app/components/CMSComments")
4335
- });
4336
- addComponent({
4337
- name: "CMSBookmarkButton",
4410
+ name: "QCMSBookmarkButton",
4338
4411
  filePath: resolver.resolve("./runtime/app/components/CMSBookmarkButton")
4339
4412
  });
4340
4413
  addComponent({
4341
- name: "CMSNewsletter",
4414
+ name: "QCMSNewsletter",
4342
4415
  filePath: resolver.resolve("./runtime/app/components/CMSNewsletter")
4343
4416
  });
4344
4417
  addComponent({
4345
- name: "CMSTableOfContents",
4418
+ name: "QCMSTableOfContents",
4346
4419
  filePath: resolver.resolve("./runtime/app/components/CMSTableOfContents")
4347
4420
  });
4348
4421
  addComponent({
4349
- name: "ContentRenderer",
4422
+ name: "QContentRenderer",
4350
4423
  filePath: resolver.resolve("./runtime/app/components/ContentRenderer")
4351
4424
  });
4352
4425
  addComponent({
4353
- name: "CMSBlocks",
4426
+ name: "QCMSBlocks",
4354
4427
  filePath: resolver.resolve("./runtime/app/components/CMSBlocks")
4355
4428
  });
4356
4429
  addComponent({
4357
- name: "CMSPageBuilder",
4430
+ name: "QCMSPageBuilder",
4358
4431
  filePath: resolver.resolve("./runtime/app/components/CMSBlocks")
4359
4432
  });
4360
4433
  addComponent({
4361
- name: "CMSLocaleSwitcher",
4434
+ name: "QCMSLocaleSwitcher",
4362
4435
  filePath: resolver.resolve("./runtime/app/components/CMSLocaleSwitcher")
4363
4436
  });
4364
4437
  addComponent({
4365
- name: "CMSVersionSwitcher",
4438
+ name: "QCMSVersionSwitcher",
4366
4439
  filePath: resolver.resolve("./runtime/app/components/CMSVersionSwitcher")
4367
4440
  });
4368
4441
  addComponent({
4369
- name: "DocsVersionSwitcher",
4442
+ name: "QDocsVersionSwitcher",
4370
4443
  filePath: resolver.resolve("./runtime/app/components/CMSVersionSwitcher")
4371
4444
  });
4372
4445
  addComponent({
4373
- name: "CMSVersionBanner",
4446
+ name: "QCMSVersionBanner",
4374
4447
  filePath: resolver.resolve("./runtime/app/components/CMSVersionBanner")
4375
4448
  });
4376
4449
  addComponent({
4377
- name: "DocsVersionBanner",
4450
+ name: "QDocsVersionBanner",
4378
4451
  filePath: resolver.resolve("./runtime/app/components/CMSVersionBanner")
4379
4452
  });
4380
4453
  addComponent({
4381
- name: "CMSPreviewBanner",
4454
+ name: "QCMSPreviewBanner",
4382
4455
  filePath: resolver.resolve("./runtime/app/components/CMSPreviewBanner")
4383
4456
  });
4384
4457
  addComponent({
4385
- name: "DocsPreviewBanner",
4458
+ name: "QDocsPreviewBanner",
4386
4459
  filePath: resolver.resolve("./runtime/app/components/CMSPreviewBanner")
4387
4460
  });
4388
4461
  addServerImports([
@@ -4422,11 +4495,9 @@ export const manifestCollections = ${JSON.stringify(cmsConfig.collections || {})
4422
4495
  { name: "queryCMSCategories", from: resolver.resolve("./runtime/server/utils/cms") },
4423
4496
  { name: "createCMSCategory", from: resolver.resolve("./runtime/server/utils/cms") },
4424
4497
  { name: "queryCMSTags", from: resolver.resolve("./runtime/server/utils/cms") },
4425
- { name: "getCMSComment", from: resolver.resolve("./runtime/server/utils/cms") },
4426
- { name: "queryCMSComments", from: resolver.resolve("./runtime/server/utils/cms") },
4427
- { name: "createCMSComment", from: resolver.resolve("./runtime/server/utils/cms") },
4428
- { name: "updateCMSCommentStatus", from: resolver.resolve("./runtime/server/utils/cms") },
4429
- { name: "deleteCMSComment", from: resolver.resolve("./runtime/server/utils/cms") },
4498
+ // NOTE: getCMSComment, queryCMSComments, createCMSComment, updateCMSCommentStatus,
4499
+ // deleteCMSComment are intentionally NOT auto-imported here. Use the generic
4500
+ // Comments system (comments: true) with a CMS URN (e.g. urn:cms:entry:<id>) instead.
4430
4501
  { name: "subscribeCMSNewsletter", from: resolver.resolve("./runtime/server/utils/cms") },
4431
4502
  { name: "queryCMSSubscribers", from: resolver.resolve("./runtime/server/utils/cms") },
4432
4503
  { name: "deleteCMSSubscriber", from: resolver.resolve("./runtime/server/utils/cms") },
@@ -4548,19 +4619,19 @@ export const manifestCollections = ${JSON.stringify(cmsConfig.collections || {})
4548
4619
  }
4549
4620
  ]);
4550
4621
  addComponent({
4551
- name: "RealtimeStatus",
4622
+ name: "QRealtimeStatus",
4552
4623
  filePath: resolver.resolve("./runtime/app/components/RealtimeStatus")
4553
4624
  });
4554
4625
  addComponent({
4555
- name: "RealtimePresence",
4626
+ name: "QRealtimePresence",
4556
4627
  filePath: resolver.resolve("./runtime/app/components/RealtimePresence")
4557
4628
  });
4558
4629
  addComponent({
4559
- name: "RealtimeCursors",
4630
+ name: "QRealtimeCursors",
4560
4631
  filePath: resolver.resolve("./runtime/app/components/RealtimeCursors")
4561
4632
  });
4562
4633
  addComponent({
4563
- name: "RealtimeChat",
4634
+ name: "QRealtimeChat",
4564
4635
  filePath: resolver.resolve("./runtime/app/components/RealtimeChat")
4565
4636
  });
4566
4637
  addServerImports([
@@ -4652,15 +4723,15 @@ export const manifestCollections = ${JSON.stringify(cmsConfig.collections || {})
4652
4723
  { name: "useCheckout", from: resolver.resolve("./runtime/app/composables/payments") }
4653
4724
  ]);
4654
4725
  addComponent({
4655
- name: "PricingTable",
4726
+ name: "QPricingTable",
4656
4727
  filePath: resolver.resolve("./runtime/app/components/PricingTable")
4657
4728
  });
4658
4729
  addComponent({
4659
- name: "SubscriptionCard",
4730
+ name: "QSubscriptionCard",
4660
4731
  filePath: resolver.resolve("./runtime/app/components/SubscriptionCard")
4661
4732
  });
4662
4733
  addComponent({
4663
- name: "PricingGated",
4734
+ name: "QPricingGated",
4664
4735
  filePath: resolver.resolve("./runtime/app/components/PricingGated")
4665
4736
  });
4666
4737
  addServerImports([
@@ -5174,15 +5245,15 @@ export const manifestCollections = ${JSON.stringify(cmsConfig.collections || {})
5174
5245
  }
5175
5246
  ]);
5176
5247
  addComponent({
5177
- name: "NotificationBell",
5248
+ name: "QNotificationBell",
5178
5249
  filePath: resolver.resolve("./runtime/app/components/NotificationBell")
5179
5250
  });
5180
5251
  addComponent({
5181
- name: "NotificationList",
5252
+ name: "QNotificationList",
5182
5253
  filePath: resolver.resolve("./runtime/app/components/NotificationList")
5183
5254
  });
5184
5255
  addComponent({
5185
- name: "NotificationPrompt",
5256
+ name: "QNotificationPrompt",
5186
5257
  filePath: resolver.resolve("./runtime/app/components/NotificationPrompt")
5187
5258
  });
5188
5259
  addServerImports([
@@ -5275,6 +5346,125 @@ export const manifestCollections = ${JSON.stringify(cmsConfig.collections || {})
5275
5346
  });
5276
5347
  });
5277
5348
  }
5349
+ if (options.comments) {
5350
+ const commentsConfig = typeof options.comments === "object" ? options.comments : {};
5351
+ const commentsPrefix = commentsConfig.prefix || "/api/comments";
5352
+ const commentsRc = nuxt.options.runtimeConfig = nuxt.options.runtimeConfig || {};
5353
+ commentsRc.qarpeo = commentsRc.qarpeo || {};
5354
+ commentsRc.qarpeo.comments = {
5355
+ ...commentsConfig,
5356
+ requireAuth: Boolean(commentsConfig.requireAuth),
5357
+ defaultStatus: commentsConfig.defaultStatus || "pending",
5358
+ autoApproveAuth: Boolean(commentsConfig.autoApproveAuth),
5359
+ threadDepth: commentsConfig.threadDepth || 3,
5360
+ maxLength: commentsConfig.maxLength || 5e3,
5361
+ prefix: commentsPrefix
5362
+ };
5363
+ commentsRc.public = commentsRc.public || {};
5364
+ commentsRc.public.qarpeo = commentsRc.public.qarpeo || {};
5365
+ commentsRc.public.qarpeo.comments = {
5366
+ requireAuth: Boolean(commentsConfig.requireAuth),
5367
+ threadDepth: commentsConfig.threadDepth || 3,
5368
+ reactions: commentsConfig.reactions !== false,
5369
+ prefix: commentsPrefix
5370
+ };
5371
+ process.env.QARPEO_COMMENTS_DEFAULT_STATUS = commentsConfig.defaultStatus || "pending";
5372
+ process.env.QARPEO_COMMENTS_REQUIRE_AUTH = commentsConfig.requireAuth ? "1" : "0";
5373
+ process.env.QARPEO_COMMENTS_AUTO_APPROVE_AUTH = commentsConfig.autoApproveAuth ? "1" : "0";
5374
+ process.env.QARPEO_COMMENTS_THREAD_DEPTH = String(commentsConfig.threadDepth || 3);
5375
+ process.env.QARPEO_COMMENTS_MAX_LENGTH = String(commentsConfig.maxLength || 5e3);
5376
+ if (commentsConfig.rateLimit?.max) {
5377
+ process.env.QARPEO_COMMENTS_RATE_LIMIT_MAX = String(commentsConfig.rateLimit.max);
5378
+ }
5379
+ if (typeof commentsConfig.reporting === "object" && commentsConfig.reporting.autoHideThreshold) {
5380
+ process.env.QARPEO_COMMENTS_AUTO_HIDE_THRESHOLD = String(
5381
+ commentsConfig.reporting.autoHideThreshold
5382
+ );
5383
+ }
5384
+ if (Array.isArray(commentsConfig.reactions)) {
5385
+ process.env.QARPEO_COMMENTS_REACTIONS = JSON.stringify(commentsConfig.reactions);
5386
+ }
5387
+ addImports([
5388
+ {
5389
+ name: "useComments",
5390
+ from: resolver.resolve("./runtime/app/composables/comments")
5391
+ }
5392
+ ]);
5393
+ addComponent({
5394
+ // Primary name: <QComments> — consistent Q* component naming
5395
+ name: "QComments",
5396
+ filePath: resolver.resolve("./runtime/app/components/Comments")
5397
+ });
5398
+ addServerImports([
5399
+ {
5400
+ name: "createComment",
5401
+ from: resolver.resolve("./runtime/server/utils/comments")
5402
+ },
5403
+ {
5404
+ name: "queryComments",
5405
+ from: resolver.resolve("./runtime/server/utils/comments")
5406
+ },
5407
+ {
5408
+ name: "getComment",
5409
+ from: resolver.resolve("./runtime/server/utils/comments")
5410
+ },
5411
+ {
5412
+ name: "updateCommentStatus",
5413
+ from: resolver.resolve("./runtime/server/utils/comments")
5414
+ },
5415
+ {
5416
+ name: "deleteComment",
5417
+ from: resolver.resolve("./runtime/server/utils/comments")
5418
+ },
5419
+ {
5420
+ name: "reportComment",
5421
+ from: resolver.resolve("./runtime/server/utils/comments")
5422
+ },
5423
+ {
5424
+ name: "reactToComment",
5425
+ from: resolver.resolve("./runtime/server/utils/comments")
5426
+ },
5427
+ {
5428
+ name: "ensureCommentsTables",
5429
+ from: resolver.resolve("./runtime/server/utils/comments")
5430
+ }
5431
+ ]);
5432
+ addServerHandler({
5433
+ route: `${commentsPrefix}`,
5434
+ method: "get",
5435
+ handler: resolver.resolve("./runtime/server/routes/comments/index.get")
5436
+ });
5437
+ addServerHandler({
5438
+ route: `${commentsPrefix}`,
5439
+ method: "post",
5440
+ handler: resolver.resolve("./runtime/server/routes/comments/index.post")
5441
+ });
5442
+ addServerHandler({
5443
+ route: `${commentsPrefix}/:id`,
5444
+ method: "get",
5445
+ handler: resolver.resolve("./runtime/server/routes/comments/[id].get")
5446
+ });
5447
+ addServerHandler({
5448
+ route: `${commentsPrefix}/:id`,
5449
+ method: "patch",
5450
+ handler: resolver.resolve("./runtime/server/routes/comments/[id].patch")
5451
+ });
5452
+ addServerHandler({
5453
+ route: `${commentsPrefix}/:id`,
5454
+ method: "delete",
5455
+ handler: resolver.resolve("./runtime/server/routes/comments/[id].delete")
5456
+ });
5457
+ addServerHandler({
5458
+ route: `${commentsPrefix}/:id/report`,
5459
+ method: "post",
5460
+ handler: resolver.resolve("./runtime/server/routes/comments/[id]/report.post")
5461
+ });
5462
+ addServerHandler({
5463
+ route: `${commentsPrefix}/:id/react`,
5464
+ method: "post",
5465
+ handler: resolver.resolve("./runtime/server/routes/comments/[id]/react.post")
5466
+ });
5467
+ }
5278
5468
  const devtoolsRaw = options.devtools;
5279
5469
  const devtoolsOpts = typeof devtoolsRaw === "boolean" ? { enabled: devtoolsRaw } : devtoolsRaw || {};
5280
5470
  const isDevtoolsEnabled = Boolean(nuxt.options.dev && devtoolsOpts.enabled !== false);
@@ -5299,12 +5489,6 @@ export const manifestCollections = ${JSON.stringify(cmsConfig.collections || {})
5299
5489
  multitenant: options.multitenant ? { enabled: true } : { enabled: false },
5300
5490
  ratelimit: options.ratelimit ? { enabled: true } : { enabled: false },
5301
5491
  notifications: options.notifications || options.notify ? { enabled: true } : { enabled: false },
5302
- kits: {
5303
- auth: !!options.auth,
5304
- cms: !!options.cms,
5305
- payments: !!options.payments,
5306
- notifications: !!(options.notifications || options.notify)
5307
- },
5308
5492
  fate: options.fate ? { enabled: true } : { enabled: false }
5309
5493
  };
5310
5494
  const devtoolsPublicConfig = (nuxt.options.runtimeConfig = nuxt.options.runtimeConfig || {}).public = nuxt.options.runtimeConfig.public || {};
@@ -5745,4 +5929,4 @@ export const manifestCollections = ${JSON.stringify(cmsConfig.collections || {})
5745
5929
  }
5746
5930
  });
5747
5931
 
5748
- export { ALL_CMS_TABLE_NAMES, checkDrizzleVersion, cmsBookmarks, cmsCategories, cmsCollections, cmsComments, cmsEntries, cmsRevisions, cmsSubscribers, cmsTags, createWranglerConfig, module$1 as default, discoverSources, extractGroupTitle, extractOrderPrefix, findAgentFiles, findJobFiles, findQueueFiles, findSchemaFiles, generateAuthSchema, generateDevWranglerConfig, generateNotificationsSchema, generatePaymentsSchema, generateTenantsSchema, getActiveCmsTableNames, getActiveNotificationsTableNames, getActivePaymentsTableNames, getActiveTenantsTableNames, isGroupSegment, isRemoteSource, matchPathPatterns, matchesGlobFilter, matchesSourceFilters, resolveAllCmsSources, resolveCollectionForPath, resolveProjectName, resolveSourcePrefix, scanContentEntries, scanSchemaExports, stripOrderPrefix };
5932
+ export { ALL_CMS_TABLE_NAMES, ALL_COMMENTS_TABLE_NAMES, checkDrizzleVersion, cmsBookmarks, cmsCategories, cmsCollections, cmsComments, cmsEntries, cmsRevisions, cmsSubscribers, cmsTags, createWranglerConfig, module$1 as default, discoverSources, extractGroupTitle, extractOrderPrefix, findAgentFiles, findJobFiles, findQueueFiles, findSchemaFiles, generateAuthSchema, generateCommentsSchema, generateDevWranglerConfig, generateNotificationsSchema, generatePaymentsSchema, generateTenantsSchema, getActiveCmsTableNames, getActiveCommentsTableNames, getActiveNotificationsTableNames, getActivePaymentsTableNames, getActiveTenantsTableNames, isGroupSegment, isRemoteSource, matchPathPatterns, matchesGlobFilter, matchesSourceFilters, resolveAllCmsSources, resolveCollectionForPath, resolveProjectName, resolveSourcePrefix, scanContentEntries, scanSchemaExports, stripOrderPrefix };