qarpeo 0.1.33 → 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.
- package/README.md +5 -7
- package/dist/chunks/auth-schema.mjs +12 -10
- package/dist/chunks/wrangler.mjs +1 -1
- package/dist/module.d.ts +1 -0
- package/dist/module.mjs +272 -100
- package/dist/runtime/app/components/Comments.vue +411 -0
- package/dist/runtime/app/composables/cms.d.ts +11 -7
- package/dist/runtime/app/composables/cms.mjs +36 -68
- package/dist/runtime/app/composables/comments.d.ts +45 -0
- package/dist/runtime/app/composables/comments.mjs +150 -0
- package/dist/runtime/server/db/cms-schema.d.ts +1 -1
- package/dist/runtime/server/db/cms-schema.mjs +1 -2
- package/dist/runtime/server/routes/cms/[collection]/index.get.mjs +2 -0
- package/dist/runtime/server/routes/cms/publish-scheduled.post.mjs +7 -4
- package/dist/runtime/server/routes/cms/subscribers/[id].patch.mjs +9 -2
- package/dist/runtime/server/routes/cms/webhooks/[provider].post.mjs +41 -28
- package/dist/runtime/server/routes/comments/[id]/react.post.d.ts +6 -0
- package/dist/runtime/server/routes/comments/[id]/react.post.mjs +35 -0
- package/dist/runtime/server/routes/{cms/comments/[id].patch.d.ts → comments/[id]/report.post.d.ts} +1 -2
- package/dist/runtime/server/routes/comments/[id]/report.post.mjs +50 -0
- package/dist/runtime/server/routes/{cms/comments → comments}/[id].delete.d.ts +0 -1
- package/dist/runtime/server/routes/comments/[id].delete.mjs +27 -0
- package/dist/runtime/server/routes/{cms/comments → comments}/[id].get.d.ts +1 -1
- package/dist/runtime/server/routes/comments/[id].get.mjs +14 -0
- package/dist/runtime/server/routes/comments/[id].patch.d.ts +4 -0
- package/dist/runtime/server/routes/comments/[id].patch.mjs +37 -0
- package/dist/runtime/server/routes/{cms/comments.get.d.ts → comments/index.get.d.ts} +1 -1
- package/dist/runtime/server/routes/comments/index.get.mjs +34 -0
- package/dist/runtime/server/routes/comments/index.post.d.ts +4 -0
- package/dist/runtime/server/routes/comments/index.post.mjs +36 -0
- package/dist/runtime/server/utils/audit.d.ts +3 -3
- package/dist/runtime/server/utils/audit.mjs +43 -17
- package/dist/runtime/server/utils/auth.mjs +14 -10
- package/dist/runtime/server/utils/cms/git.mjs +2 -6
- package/dist/runtime/server/utils/cms.d.ts +17 -22
- package/dist/runtime/server/utils/cms.mjs +144 -309
- package/dist/runtime/server/utils/comments.d.ts +112 -0
- package/dist/runtime/server/utils/comments.mjs +450 -0
- package/dist/runtime/server/utils/config.d.ts +2 -1
- package/dist/runtime/server/utils/config.mjs +1 -0
- package/dist/runtime/server/utils/urn.d.ts +15 -0
- package/dist/runtime/server/utils/urn.mjs +20 -0
- package/dist/runtime/server.d.ts +3 -0
- package/dist/types.d.ts +67 -27
- package/dist/utils/comments-schema.d.ts +13 -0
- package/package.json +4 -4
- package/dist/runtime/app/components/CMSComments.vue +0 -202
- package/dist/runtime/server/routes/cms/comments/[id].delete.mjs +0 -12
- package/dist/runtime/server/routes/cms/comments/[id].get.mjs +0 -13
- package/dist/runtime/server/routes/cms/comments/[id].patch.mjs +0 -17
- package/dist/runtime/server/routes/cms/comments.get.mjs +0 -43
- package/dist/runtime/server/routes/cms/comments.post.d.ts +0 -17
- 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
|
-
|
|
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: "
|
|
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)",
|
|
@@ -3642,35 +3737,35 @@ export default async function (batch: any, env?: any, ctx?: any) {
|
|
|
3642
3737
|
}
|
|
3643
3738
|
]);
|
|
3644
3739
|
addComponent({
|
|
3645
|
-
name: "
|
|
3740
|
+
name: "QAuthState",
|
|
3646
3741
|
filePath: resolver.resolve("./runtime/app/components/AuthState.vue")
|
|
3647
3742
|
});
|
|
3648
3743
|
addComponent({
|
|
3649
|
-
name: "
|
|
3744
|
+
name: "QSignedIn",
|
|
3650
3745
|
filePath: resolver.resolve("./runtime/app/components/SignedIn")
|
|
3651
3746
|
});
|
|
3652
3747
|
addComponent({
|
|
3653
|
-
name: "
|
|
3748
|
+
name: "QSignedOut",
|
|
3654
3749
|
filePath: resolver.resolve("./runtime/app/components/SignedOut")
|
|
3655
3750
|
});
|
|
3656
3751
|
addComponent({
|
|
3657
|
-
name: "
|
|
3752
|
+
name: "QImpersonationBanner",
|
|
3658
3753
|
filePath: resolver.resolve("./runtime/app/components/ImpersonationBanner")
|
|
3659
3754
|
});
|
|
3660
3755
|
addComponent({
|
|
3661
|
-
name: "
|
|
3756
|
+
name: "QAuthSignIn",
|
|
3662
3757
|
filePath: resolver.resolve("./runtime/app/components/AuthSignIn")
|
|
3663
3758
|
});
|
|
3664
3759
|
addComponent({
|
|
3665
|
-
name: "
|
|
3760
|
+
name: "QAuthRegister",
|
|
3666
3761
|
filePath: resolver.resolve("./runtime/app/components/AuthRegister")
|
|
3667
3762
|
});
|
|
3668
3763
|
addComponent({
|
|
3669
|
-
name: "
|
|
3764
|
+
name: "QUserProfile",
|
|
3670
3765
|
filePath: resolver.resolve("./runtime/app/components/UserProfile")
|
|
3671
3766
|
});
|
|
3672
3767
|
addComponent({
|
|
3673
|
-
name: "
|
|
3768
|
+
name: "QAuthSessionsList",
|
|
3674
3769
|
filePath: resolver.resolve("./runtime/app/components/AuthSessionsList")
|
|
3675
3770
|
});
|
|
3676
3771
|
}
|
|
@@ -3752,15 +3847,11 @@ export default async function (batch: any, env?: any, ctx?: any) {
|
|
|
3752
3847
|
}
|
|
3753
3848
|
]);
|
|
3754
3849
|
addComponent({
|
|
3755
|
-
name: "
|
|
3756
|
-
filePath: resolver.resolve("./runtime/app/components/BlobImage")
|
|
3757
|
-
});
|
|
3758
|
-
addComponent({
|
|
3759
|
-
name: "QarpeoImage",
|
|
3850
|
+
name: "QBlobImage",
|
|
3760
3851
|
filePath: resolver.resolve("./runtime/app/components/BlobImage")
|
|
3761
3852
|
});
|
|
3762
3853
|
addComponent({
|
|
3763
|
-
name: "
|
|
3854
|
+
name: "QFileUpload",
|
|
3764
3855
|
filePath: resolver.resolve("./runtime/app/components/FileUpload")
|
|
3765
3856
|
});
|
|
3766
3857
|
const blobUiEnabled = blobConfig.ui !== false;
|
|
@@ -4111,16 +4202,6 @@ export const manifestCollections = ${JSON.stringify(cmsConfig.collections || {})
|
|
|
4111
4202
|
method: "get",
|
|
4112
4203
|
handler: resolver.resolve("./runtime/server/routes/cms/tags.get")
|
|
4113
4204
|
});
|
|
4114
|
-
addServerHandler({
|
|
4115
|
-
route: `${cmsApiPath}/comments`,
|
|
4116
|
-
method: "get",
|
|
4117
|
-
handler: resolver.resolve("./runtime/server/routes/cms/comments.get")
|
|
4118
|
-
});
|
|
4119
|
-
addServerHandler({
|
|
4120
|
-
route: `${cmsApiPath}/comments/:id`,
|
|
4121
|
-
method: "get",
|
|
4122
|
-
handler: resolver.resolve("./runtime/server/routes/cms/comments/[id].get")
|
|
4123
|
-
});
|
|
4124
4205
|
if (cmsConfig.api !== false) {
|
|
4125
4206
|
addServerHandler({
|
|
4126
4207
|
route: `${cmsApiPath}/categories`,
|
|
@@ -4172,21 +4253,6 @@ export const manifestCollections = ${JSON.stringify(cmsConfig.collections || {})
|
|
|
4172
4253
|
method: "post",
|
|
4173
4254
|
handler: resolver.resolve("./runtime/server/routes/cms/[collection]/[id]/view.post")
|
|
4174
4255
|
});
|
|
4175
|
-
addServerHandler({
|
|
4176
|
-
route: `${cmsApiPath}/comments`,
|
|
4177
|
-
method: "post",
|
|
4178
|
-
handler: resolver.resolve("./runtime/server/routes/cms/comments.post")
|
|
4179
|
-
});
|
|
4180
|
-
addServerHandler({
|
|
4181
|
-
route: `${cmsApiPath}/comments/:id`,
|
|
4182
|
-
method: "patch",
|
|
4183
|
-
handler: resolver.resolve("./runtime/server/routes/cms/comments/[id].patch")
|
|
4184
|
-
});
|
|
4185
|
-
addServerHandler({
|
|
4186
|
-
route: `${cmsApiPath}/comments/:id`,
|
|
4187
|
-
method: "delete",
|
|
4188
|
-
handler: resolver.resolve("./runtime/server/routes/cms/comments/[id].delete")
|
|
4189
|
-
});
|
|
4190
4256
|
addServerHandler({
|
|
4191
4257
|
route: `${cmsApiPath}/newsletter`,
|
|
4192
4258
|
method: "post",
|
|
@@ -4327,74 +4393,69 @@ export const manifestCollections = ${JSON.stringify(cmsConfig.collections || {})
|
|
|
4327
4393
|
from: resolver.resolve("./runtime/app/composables/docs-version")
|
|
4328
4394
|
},
|
|
4329
4395
|
{ name: "useCMSPreview", from: resolver.resolve("./runtime/app/composables/cms-preview") },
|
|
4330
|
-
{ name: "useCMSComments", from: resolver.resolve("./runtime/app/composables/cms") },
|
|
4331
4396
|
{ name: "useCMSCategories", from: resolver.resolve("./runtime/app/composables/cms") },
|
|
4332
4397
|
{ name: "useCMSBookmarks", from: resolver.resolve("./runtime/app/composables/cms") },
|
|
4333
4398
|
{ name: "useCMSNewsletter", from: resolver.resolve("./runtime/app/composables/cms") },
|
|
4334
4399
|
{ name: "useCMSTags", from: resolver.resolve("./runtime/app/composables/cms") }
|
|
4335
4400
|
]);
|
|
4336
4401
|
addComponent({
|
|
4337
|
-
name: "
|
|
4402
|
+
name: "QCMSContent",
|
|
4338
4403
|
filePath: resolver.resolve("./runtime/app/components/CMSContent")
|
|
4339
4404
|
});
|
|
4340
4405
|
addComponent({
|
|
4341
|
-
name: "
|
|
4406
|
+
name: "QCMSImage",
|
|
4342
4407
|
filePath: resolver.resolve("./runtime/app/components/CMSImage")
|
|
4343
4408
|
});
|
|
4344
4409
|
addComponent({
|
|
4345
|
-
name: "
|
|
4346
|
-
filePath: resolver.resolve("./runtime/app/components/CMSComments")
|
|
4347
|
-
});
|
|
4348
|
-
addComponent({
|
|
4349
|
-
name: "CMSBookmarkButton",
|
|
4410
|
+
name: "QCMSBookmarkButton",
|
|
4350
4411
|
filePath: resolver.resolve("./runtime/app/components/CMSBookmarkButton")
|
|
4351
4412
|
});
|
|
4352
4413
|
addComponent({
|
|
4353
|
-
name: "
|
|
4414
|
+
name: "QCMSNewsletter",
|
|
4354
4415
|
filePath: resolver.resolve("./runtime/app/components/CMSNewsletter")
|
|
4355
4416
|
});
|
|
4356
4417
|
addComponent({
|
|
4357
|
-
name: "
|
|
4418
|
+
name: "QCMSTableOfContents",
|
|
4358
4419
|
filePath: resolver.resolve("./runtime/app/components/CMSTableOfContents")
|
|
4359
4420
|
});
|
|
4360
4421
|
addComponent({
|
|
4361
|
-
name: "
|
|
4422
|
+
name: "QContentRenderer",
|
|
4362
4423
|
filePath: resolver.resolve("./runtime/app/components/ContentRenderer")
|
|
4363
4424
|
});
|
|
4364
4425
|
addComponent({
|
|
4365
|
-
name: "
|
|
4426
|
+
name: "QCMSBlocks",
|
|
4366
4427
|
filePath: resolver.resolve("./runtime/app/components/CMSBlocks")
|
|
4367
4428
|
});
|
|
4368
4429
|
addComponent({
|
|
4369
|
-
name: "
|
|
4430
|
+
name: "QCMSPageBuilder",
|
|
4370
4431
|
filePath: resolver.resolve("./runtime/app/components/CMSBlocks")
|
|
4371
4432
|
});
|
|
4372
4433
|
addComponent({
|
|
4373
|
-
name: "
|
|
4434
|
+
name: "QCMSLocaleSwitcher",
|
|
4374
4435
|
filePath: resolver.resolve("./runtime/app/components/CMSLocaleSwitcher")
|
|
4375
4436
|
});
|
|
4376
4437
|
addComponent({
|
|
4377
|
-
name: "
|
|
4438
|
+
name: "QCMSVersionSwitcher",
|
|
4378
4439
|
filePath: resolver.resolve("./runtime/app/components/CMSVersionSwitcher")
|
|
4379
4440
|
});
|
|
4380
4441
|
addComponent({
|
|
4381
|
-
name: "
|
|
4442
|
+
name: "QDocsVersionSwitcher",
|
|
4382
4443
|
filePath: resolver.resolve("./runtime/app/components/CMSVersionSwitcher")
|
|
4383
4444
|
});
|
|
4384
4445
|
addComponent({
|
|
4385
|
-
name: "
|
|
4446
|
+
name: "QCMSVersionBanner",
|
|
4386
4447
|
filePath: resolver.resolve("./runtime/app/components/CMSVersionBanner")
|
|
4387
4448
|
});
|
|
4388
4449
|
addComponent({
|
|
4389
|
-
name: "
|
|
4450
|
+
name: "QDocsVersionBanner",
|
|
4390
4451
|
filePath: resolver.resolve("./runtime/app/components/CMSVersionBanner")
|
|
4391
4452
|
});
|
|
4392
4453
|
addComponent({
|
|
4393
|
-
name: "
|
|
4454
|
+
name: "QCMSPreviewBanner",
|
|
4394
4455
|
filePath: resolver.resolve("./runtime/app/components/CMSPreviewBanner")
|
|
4395
4456
|
});
|
|
4396
4457
|
addComponent({
|
|
4397
|
-
name: "
|
|
4458
|
+
name: "QDocsPreviewBanner",
|
|
4398
4459
|
filePath: resolver.resolve("./runtime/app/components/CMSPreviewBanner")
|
|
4399
4460
|
});
|
|
4400
4461
|
addServerImports([
|
|
@@ -4434,11 +4495,9 @@ export const manifestCollections = ${JSON.stringify(cmsConfig.collections || {})
|
|
|
4434
4495
|
{ name: "queryCMSCategories", from: resolver.resolve("./runtime/server/utils/cms") },
|
|
4435
4496
|
{ name: "createCMSCategory", from: resolver.resolve("./runtime/server/utils/cms") },
|
|
4436
4497
|
{ name: "queryCMSTags", from: resolver.resolve("./runtime/server/utils/cms") },
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
{ name: "updateCMSCommentStatus", from: resolver.resolve("./runtime/server/utils/cms") },
|
|
4441
|
-
{ 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.
|
|
4442
4501
|
{ name: "subscribeCMSNewsletter", from: resolver.resolve("./runtime/server/utils/cms") },
|
|
4443
4502
|
{ name: "queryCMSSubscribers", from: resolver.resolve("./runtime/server/utils/cms") },
|
|
4444
4503
|
{ name: "deleteCMSSubscriber", from: resolver.resolve("./runtime/server/utils/cms") },
|
|
@@ -4560,19 +4619,19 @@ export const manifestCollections = ${JSON.stringify(cmsConfig.collections || {})
|
|
|
4560
4619
|
}
|
|
4561
4620
|
]);
|
|
4562
4621
|
addComponent({
|
|
4563
|
-
name: "
|
|
4622
|
+
name: "QRealtimeStatus",
|
|
4564
4623
|
filePath: resolver.resolve("./runtime/app/components/RealtimeStatus")
|
|
4565
4624
|
});
|
|
4566
4625
|
addComponent({
|
|
4567
|
-
name: "
|
|
4626
|
+
name: "QRealtimePresence",
|
|
4568
4627
|
filePath: resolver.resolve("./runtime/app/components/RealtimePresence")
|
|
4569
4628
|
});
|
|
4570
4629
|
addComponent({
|
|
4571
|
-
name: "
|
|
4630
|
+
name: "QRealtimeCursors",
|
|
4572
4631
|
filePath: resolver.resolve("./runtime/app/components/RealtimeCursors")
|
|
4573
4632
|
});
|
|
4574
4633
|
addComponent({
|
|
4575
|
-
name: "
|
|
4634
|
+
name: "QRealtimeChat",
|
|
4576
4635
|
filePath: resolver.resolve("./runtime/app/components/RealtimeChat")
|
|
4577
4636
|
});
|
|
4578
4637
|
addServerImports([
|
|
@@ -4664,15 +4723,15 @@ export const manifestCollections = ${JSON.stringify(cmsConfig.collections || {})
|
|
|
4664
4723
|
{ name: "useCheckout", from: resolver.resolve("./runtime/app/composables/payments") }
|
|
4665
4724
|
]);
|
|
4666
4725
|
addComponent({
|
|
4667
|
-
name: "
|
|
4726
|
+
name: "QPricingTable",
|
|
4668
4727
|
filePath: resolver.resolve("./runtime/app/components/PricingTable")
|
|
4669
4728
|
});
|
|
4670
4729
|
addComponent({
|
|
4671
|
-
name: "
|
|
4730
|
+
name: "QSubscriptionCard",
|
|
4672
4731
|
filePath: resolver.resolve("./runtime/app/components/SubscriptionCard")
|
|
4673
4732
|
});
|
|
4674
4733
|
addComponent({
|
|
4675
|
-
name: "
|
|
4734
|
+
name: "QPricingGated",
|
|
4676
4735
|
filePath: resolver.resolve("./runtime/app/components/PricingGated")
|
|
4677
4736
|
});
|
|
4678
4737
|
addServerImports([
|
|
@@ -5186,15 +5245,15 @@ export const manifestCollections = ${JSON.stringify(cmsConfig.collections || {})
|
|
|
5186
5245
|
}
|
|
5187
5246
|
]);
|
|
5188
5247
|
addComponent({
|
|
5189
|
-
name: "
|
|
5248
|
+
name: "QNotificationBell",
|
|
5190
5249
|
filePath: resolver.resolve("./runtime/app/components/NotificationBell")
|
|
5191
5250
|
});
|
|
5192
5251
|
addComponent({
|
|
5193
|
-
name: "
|
|
5252
|
+
name: "QNotificationList",
|
|
5194
5253
|
filePath: resolver.resolve("./runtime/app/components/NotificationList")
|
|
5195
5254
|
});
|
|
5196
5255
|
addComponent({
|
|
5197
|
-
name: "
|
|
5256
|
+
name: "QNotificationPrompt",
|
|
5198
5257
|
filePath: resolver.resolve("./runtime/app/components/NotificationPrompt")
|
|
5199
5258
|
});
|
|
5200
5259
|
addServerImports([
|
|
@@ -5287,6 +5346,125 @@ export const manifestCollections = ${JSON.stringify(cmsConfig.collections || {})
|
|
|
5287
5346
|
});
|
|
5288
5347
|
});
|
|
5289
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
|
+
}
|
|
5290
5468
|
const devtoolsRaw = options.devtools;
|
|
5291
5469
|
const devtoolsOpts = typeof devtoolsRaw === "boolean" ? { enabled: devtoolsRaw } : devtoolsRaw || {};
|
|
5292
5470
|
const isDevtoolsEnabled = Boolean(nuxt.options.dev && devtoolsOpts.enabled !== false);
|
|
@@ -5311,12 +5489,6 @@ export const manifestCollections = ${JSON.stringify(cmsConfig.collections || {})
|
|
|
5311
5489
|
multitenant: options.multitenant ? { enabled: true } : { enabled: false },
|
|
5312
5490
|
ratelimit: options.ratelimit ? { enabled: true } : { enabled: false },
|
|
5313
5491
|
notifications: options.notifications || options.notify ? { enabled: true } : { enabled: false },
|
|
5314
|
-
kits: {
|
|
5315
|
-
auth: !!options.auth,
|
|
5316
|
-
cms: !!options.cms,
|
|
5317
|
-
payments: !!options.payments,
|
|
5318
|
-
notifications: !!(options.notifications || options.notify)
|
|
5319
|
-
},
|
|
5320
5492
|
fate: options.fate ? { enabled: true } : { enabled: false }
|
|
5321
5493
|
};
|
|
5322
5494
|
const devtoolsPublicConfig = (nuxt.options.runtimeConfig = nuxt.options.runtimeConfig || {}).public = nuxt.options.runtimeConfig.public || {};
|
|
@@ -5757,4 +5929,4 @@ export const manifestCollections = ${JSON.stringify(cmsConfig.collections || {})
|
|
|
5757
5929
|
}
|
|
5758
5930
|
});
|
|
5759
5931
|
|
|
5760
|
-
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 };
|