qarpeo 0.1.33 → 0.1.35
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 +276 -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/cache.d.ts +28 -7
- package/dist/runtime/server/utils/cache.mjs +130 -53
- 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 +90 -30
- 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)",
|
|
@@ -2819,6 +2914,10 @@ export default async function (batch: any, env?: any, ctx?: any) {
|
|
|
2819
2914
|
name: "purgeCacheTag",
|
|
2820
2915
|
from: resolver.resolve("./runtime/server/utils/cache")
|
|
2821
2916
|
},
|
|
2917
|
+
{
|
|
2918
|
+
name: "defineCachedFunction",
|
|
2919
|
+
from: resolver.resolve("./runtime/server/utils/cache")
|
|
2920
|
+
},
|
|
2822
2921
|
{
|
|
2823
2922
|
name: "rememberCache",
|
|
2824
2923
|
from: resolver.resolve("./runtime/server/utils/cache")
|
|
@@ -3642,35 +3741,35 @@ export default async function (batch: any, env?: any, ctx?: any) {
|
|
|
3642
3741
|
}
|
|
3643
3742
|
]);
|
|
3644
3743
|
addComponent({
|
|
3645
|
-
name: "
|
|
3744
|
+
name: "QAuthState",
|
|
3646
3745
|
filePath: resolver.resolve("./runtime/app/components/AuthState.vue")
|
|
3647
3746
|
});
|
|
3648
3747
|
addComponent({
|
|
3649
|
-
name: "
|
|
3748
|
+
name: "QSignedIn",
|
|
3650
3749
|
filePath: resolver.resolve("./runtime/app/components/SignedIn")
|
|
3651
3750
|
});
|
|
3652
3751
|
addComponent({
|
|
3653
|
-
name: "
|
|
3752
|
+
name: "QSignedOut",
|
|
3654
3753
|
filePath: resolver.resolve("./runtime/app/components/SignedOut")
|
|
3655
3754
|
});
|
|
3656
3755
|
addComponent({
|
|
3657
|
-
name: "
|
|
3756
|
+
name: "QImpersonationBanner",
|
|
3658
3757
|
filePath: resolver.resolve("./runtime/app/components/ImpersonationBanner")
|
|
3659
3758
|
});
|
|
3660
3759
|
addComponent({
|
|
3661
|
-
name: "
|
|
3760
|
+
name: "QAuthSignIn",
|
|
3662
3761
|
filePath: resolver.resolve("./runtime/app/components/AuthSignIn")
|
|
3663
3762
|
});
|
|
3664
3763
|
addComponent({
|
|
3665
|
-
name: "
|
|
3764
|
+
name: "QAuthRegister",
|
|
3666
3765
|
filePath: resolver.resolve("./runtime/app/components/AuthRegister")
|
|
3667
3766
|
});
|
|
3668
3767
|
addComponent({
|
|
3669
|
-
name: "
|
|
3768
|
+
name: "QUserProfile",
|
|
3670
3769
|
filePath: resolver.resolve("./runtime/app/components/UserProfile")
|
|
3671
3770
|
});
|
|
3672
3771
|
addComponent({
|
|
3673
|
-
name: "
|
|
3772
|
+
name: "QAuthSessionsList",
|
|
3674
3773
|
filePath: resolver.resolve("./runtime/app/components/AuthSessionsList")
|
|
3675
3774
|
});
|
|
3676
3775
|
}
|
|
@@ -3752,15 +3851,11 @@ export default async function (batch: any, env?: any, ctx?: any) {
|
|
|
3752
3851
|
}
|
|
3753
3852
|
]);
|
|
3754
3853
|
addComponent({
|
|
3755
|
-
name: "
|
|
3756
|
-
filePath: resolver.resolve("./runtime/app/components/BlobImage")
|
|
3757
|
-
});
|
|
3758
|
-
addComponent({
|
|
3759
|
-
name: "QarpeoImage",
|
|
3854
|
+
name: "QBlobImage",
|
|
3760
3855
|
filePath: resolver.resolve("./runtime/app/components/BlobImage")
|
|
3761
3856
|
});
|
|
3762
3857
|
addComponent({
|
|
3763
|
-
name: "
|
|
3858
|
+
name: "QFileUpload",
|
|
3764
3859
|
filePath: resolver.resolve("./runtime/app/components/FileUpload")
|
|
3765
3860
|
});
|
|
3766
3861
|
const blobUiEnabled = blobConfig.ui !== false;
|
|
@@ -4111,16 +4206,6 @@ export const manifestCollections = ${JSON.stringify(cmsConfig.collections || {})
|
|
|
4111
4206
|
method: "get",
|
|
4112
4207
|
handler: resolver.resolve("./runtime/server/routes/cms/tags.get")
|
|
4113
4208
|
});
|
|
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
4209
|
if (cmsConfig.api !== false) {
|
|
4125
4210
|
addServerHandler({
|
|
4126
4211
|
route: `${cmsApiPath}/categories`,
|
|
@@ -4172,21 +4257,6 @@ export const manifestCollections = ${JSON.stringify(cmsConfig.collections || {})
|
|
|
4172
4257
|
method: "post",
|
|
4173
4258
|
handler: resolver.resolve("./runtime/server/routes/cms/[collection]/[id]/view.post")
|
|
4174
4259
|
});
|
|
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
4260
|
addServerHandler({
|
|
4191
4261
|
route: `${cmsApiPath}/newsletter`,
|
|
4192
4262
|
method: "post",
|
|
@@ -4327,74 +4397,69 @@ export const manifestCollections = ${JSON.stringify(cmsConfig.collections || {})
|
|
|
4327
4397
|
from: resolver.resolve("./runtime/app/composables/docs-version")
|
|
4328
4398
|
},
|
|
4329
4399
|
{ name: "useCMSPreview", from: resolver.resolve("./runtime/app/composables/cms-preview") },
|
|
4330
|
-
{ name: "useCMSComments", from: resolver.resolve("./runtime/app/composables/cms") },
|
|
4331
4400
|
{ name: "useCMSCategories", from: resolver.resolve("./runtime/app/composables/cms") },
|
|
4332
4401
|
{ name: "useCMSBookmarks", from: resolver.resolve("./runtime/app/composables/cms") },
|
|
4333
4402
|
{ name: "useCMSNewsletter", from: resolver.resolve("./runtime/app/composables/cms") },
|
|
4334
4403
|
{ name: "useCMSTags", from: resolver.resolve("./runtime/app/composables/cms") }
|
|
4335
4404
|
]);
|
|
4336
4405
|
addComponent({
|
|
4337
|
-
name: "
|
|
4406
|
+
name: "QCMSContent",
|
|
4338
4407
|
filePath: resolver.resolve("./runtime/app/components/CMSContent")
|
|
4339
4408
|
});
|
|
4340
4409
|
addComponent({
|
|
4341
|
-
name: "
|
|
4410
|
+
name: "QCMSImage",
|
|
4342
4411
|
filePath: resolver.resolve("./runtime/app/components/CMSImage")
|
|
4343
4412
|
});
|
|
4344
4413
|
addComponent({
|
|
4345
|
-
name: "
|
|
4346
|
-
filePath: resolver.resolve("./runtime/app/components/CMSComments")
|
|
4347
|
-
});
|
|
4348
|
-
addComponent({
|
|
4349
|
-
name: "CMSBookmarkButton",
|
|
4414
|
+
name: "QCMSBookmarkButton",
|
|
4350
4415
|
filePath: resolver.resolve("./runtime/app/components/CMSBookmarkButton")
|
|
4351
4416
|
});
|
|
4352
4417
|
addComponent({
|
|
4353
|
-
name: "
|
|
4418
|
+
name: "QCMSNewsletter",
|
|
4354
4419
|
filePath: resolver.resolve("./runtime/app/components/CMSNewsletter")
|
|
4355
4420
|
});
|
|
4356
4421
|
addComponent({
|
|
4357
|
-
name: "
|
|
4422
|
+
name: "QCMSTableOfContents",
|
|
4358
4423
|
filePath: resolver.resolve("./runtime/app/components/CMSTableOfContents")
|
|
4359
4424
|
});
|
|
4360
4425
|
addComponent({
|
|
4361
|
-
name: "
|
|
4426
|
+
name: "QContentRenderer",
|
|
4362
4427
|
filePath: resolver.resolve("./runtime/app/components/ContentRenderer")
|
|
4363
4428
|
});
|
|
4364
4429
|
addComponent({
|
|
4365
|
-
name: "
|
|
4430
|
+
name: "QCMSBlocks",
|
|
4366
4431
|
filePath: resolver.resolve("./runtime/app/components/CMSBlocks")
|
|
4367
4432
|
});
|
|
4368
4433
|
addComponent({
|
|
4369
|
-
name: "
|
|
4434
|
+
name: "QCMSPageBuilder",
|
|
4370
4435
|
filePath: resolver.resolve("./runtime/app/components/CMSBlocks")
|
|
4371
4436
|
});
|
|
4372
4437
|
addComponent({
|
|
4373
|
-
name: "
|
|
4438
|
+
name: "QCMSLocaleSwitcher",
|
|
4374
4439
|
filePath: resolver.resolve("./runtime/app/components/CMSLocaleSwitcher")
|
|
4375
4440
|
});
|
|
4376
4441
|
addComponent({
|
|
4377
|
-
name: "
|
|
4442
|
+
name: "QCMSVersionSwitcher",
|
|
4378
4443
|
filePath: resolver.resolve("./runtime/app/components/CMSVersionSwitcher")
|
|
4379
4444
|
});
|
|
4380
4445
|
addComponent({
|
|
4381
|
-
name: "
|
|
4446
|
+
name: "QDocsVersionSwitcher",
|
|
4382
4447
|
filePath: resolver.resolve("./runtime/app/components/CMSVersionSwitcher")
|
|
4383
4448
|
});
|
|
4384
4449
|
addComponent({
|
|
4385
|
-
name: "
|
|
4450
|
+
name: "QCMSVersionBanner",
|
|
4386
4451
|
filePath: resolver.resolve("./runtime/app/components/CMSVersionBanner")
|
|
4387
4452
|
});
|
|
4388
4453
|
addComponent({
|
|
4389
|
-
name: "
|
|
4454
|
+
name: "QDocsVersionBanner",
|
|
4390
4455
|
filePath: resolver.resolve("./runtime/app/components/CMSVersionBanner")
|
|
4391
4456
|
});
|
|
4392
4457
|
addComponent({
|
|
4393
|
-
name: "
|
|
4458
|
+
name: "QCMSPreviewBanner",
|
|
4394
4459
|
filePath: resolver.resolve("./runtime/app/components/CMSPreviewBanner")
|
|
4395
4460
|
});
|
|
4396
4461
|
addComponent({
|
|
4397
|
-
name: "
|
|
4462
|
+
name: "QDocsPreviewBanner",
|
|
4398
4463
|
filePath: resolver.resolve("./runtime/app/components/CMSPreviewBanner")
|
|
4399
4464
|
});
|
|
4400
4465
|
addServerImports([
|
|
@@ -4434,11 +4499,9 @@ export const manifestCollections = ${JSON.stringify(cmsConfig.collections || {})
|
|
|
4434
4499
|
{ name: "queryCMSCategories", from: resolver.resolve("./runtime/server/utils/cms") },
|
|
4435
4500
|
{ name: "createCMSCategory", from: resolver.resolve("./runtime/server/utils/cms") },
|
|
4436
4501
|
{ 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") },
|
|
4502
|
+
// NOTE: getCMSComment, queryCMSComments, createCMSComment, updateCMSCommentStatus,
|
|
4503
|
+
// deleteCMSComment are intentionally NOT auto-imported here. Use the generic
|
|
4504
|
+
// Comments system (comments: true) with a CMS URN (e.g. urn:cms:entry:<id>) instead.
|
|
4442
4505
|
{ name: "subscribeCMSNewsletter", from: resolver.resolve("./runtime/server/utils/cms") },
|
|
4443
4506
|
{ name: "queryCMSSubscribers", from: resolver.resolve("./runtime/server/utils/cms") },
|
|
4444
4507
|
{ name: "deleteCMSSubscriber", from: resolver.resolve("./runtime/server/utils/cms") },
|
|
@@ -4560,19 +4623,19 @@ export const manifestCollections = ${JSON.stringify(cmsConfig.collections || {})
|
|
|
4560
4623
|
}
|
|
4561
4624
|
]);
|
|
4562
4625
|
addComponent({
|
|
4563
|
-
name: "
|
|
4626
|
+
name: "QRealtimeStatus",
|
|
4564
4627
|
filePath: resolver.resolve("./runtime/app/components/RealtimeStatus")
|
|
4565
4628
|
});
|
|
4566
4629
|
addComponent({
|
|
4567
|
-
name: "
|
|
4630
|
+
name: "QRealtimePresence",
|
|
4568
4631
|
filePath: resolver.resolve("./runtime/app/components/RealtimePresence")
|
|
4569
4632
|
});
|
|
4570
4633
|
addComponent({
|
|
4571
|
-
name: "
|
|
4634
|
+
name: "QRealtimeCursors",
|
|
4572
4635
|
filePath: resolver.resolve("./runtime/app/components/RealtimeCursors")
|
|
4573
4636
|
});
|
|
4574
4637
|
addComponent({
|
|
4575
|
-
name: "
|
|
4638
|
+
name: "QRealtimeChat",
|
|
4576
4639
|
filePath: resolver.resolve("./runtime/app/components/RealtimeChat")
|
|
4577
4640
|
});
|
|
4578
4641
|
addServerImports([
|
|
@@ -4664,15 +4727,15 @@ export const manifestCollections = ${JSON.stringify(cmsConfig.collections || {})
|
|
|
4664
4727
|
{ name: "useCheckout", from: resolver.resolve("./runtime/app/composables/payments") }
|
|
4665
4728
|
]);
|
|
4666
4729
|
addComponent({
|
|
4667
|
-
name: "
|
|
4730
|
+
name: "QPricingTable",
|
|
4668
4731
|
filePath: resolver.resolve("./runtime/app/components/PricingTable")
|
|
4669
4732
|
});
|
|
4670
4733
|
addComponent({
|
|
4671
|
-
name: "
|
|
4734
|
+
name: "QSubscriptionCard",
|
|
4672
4735
|
filePath: resolver.resolve("./runtime/app/components/SubscriptionCard")
|
|
4673
4736
|
});
|
|
4674
4737
|
addComponent({
|
|
4675
|
-
name: "
|
|
4738
|
+
name: "QPricingGated",
|
|
4676
4739
|
filePath: resolver.resolve("./runtime/app/components/PricingGated")
|
|
4677
4740
|
});
|
|
4678
4741
|
addServerImports([
|
|
@@ -5186,15 +5249,15 @@ export const manifestCollections = ${JSON.stringify(cmsConfig.collections || {})
|
|
|
5186
5249
|
}
|
|
5187
5250
|
]);
|
|
5188
5251
|
addComponent({
|
|
5189
|
-
name: "
|
|
5252
|
+
name: "QNotificationBell",
|
|
5190
5253
|
filePath: resolver.resolve("./runtime/app/components/NotificationBell")
|
|
5191
5254
|
});
|
|
5192
5255
|
addComponent({
|
|
5193
|
-
name: "
|
|
5256
|
+
name: "QNotificationList",
|
|
5194
5257
|
filePath: resolver.resolve("./runtime/app/components/NotificationList")
|
|
5195
5258
|
});
|
|
5196
5259
|
addComponent({
|
|
5197
|
-
name: "
|
|
5260
|
+
name: "QNotificationPrompt",
|
|
5198
5261
|
filePath: resolver.resolve("./runtime/app/components/NotificationPrompt")
|
|
5199
5262
|
});
|
|
5200
5263
|
addServerImports([
|
|
@@ -5287,6 +5350,125 @@ export const manifestCollections = ${JSON.stringify(cmsConfig.collections || {})
|
|
|
5287
5350
|
});
|
|
5288
5351
|
});
|
|
5289
5352
|
}
|
|
5353
|
+
if (options.comments) {
|
|
5354
|
+
const commentsConfig = typeof options.comments === "object" ? options.comments : {};
|
|
5355
|
+
const commentsPrefix = commentsConfig.prefix || "/api/comments";
|
|
5356
|
+
const commentsRc = nuxt.options.runtimeConfig = nuxt.options.runtimeConfig || {};
|
|
5357
|
+
commentsRc.qarpeo = commentsRc.qarpeo || {};
|
|
5358
|
+
commentsRc.qarpeo.comments = {
|
|
5359
|
+
...commentsConfig,
|
|
5360
|
+
requireAuth: Boolean(commentsConfig.requireAuth),
|
|
5361
|
+
defaultStatus: commentsConfig.defaultStatus || "pending",
|
|
5362
|
+
autoApproveAuth: Boolean(commentsConfig.autoApproveAuth),
|
|
5363
|
+
threadDepth: commentsConfig.threadDepth || 3,
|
|
5364
|
+
maxLength: commentsConfig.maxLength || 5e3,
|
|
5365
|
+
prefix: commentsPrefix
|
|
5366
|
+
};
|
|
5367
|
+
commentsRc.public = commentsRc.public || {};
|
|
5368
|
+
commentsRc.public.qarpeo = commentsRc.public.qarpeo || {};
|
|
5369
|
+
commentsRc.public.qarpeo.comments = {
|
|
5370
|
+
requireAuth: Boolean(commentsConfig.requireAuth),
|
|
5371
|
+
threadDepth: commentsConfig.threadDepth || 3,
|
|
5372
|
+
reactions: commentsConfig.reactions !== false,
|
|
5373
|
+
prefix: commentsPrefix
|
|
5374
|
+
};
|
|
5375
|
+
process.env.QARPEO_COMMENTS_DEFAULT_STATUS = commentsConfig.defaultStatus || "pending";
|
|
5376
|
+
process.env.QARPEO_COMMENTS_REQUIRE_AUTH = commentsConfig.requireAuth ? "1" : "0";
|
|
5377
|
+
process.env.QARPEO_COMMENTS_AUTO_APPROVE_AUTH = commentsConfig.autoApproveAuth ? "1" : "0";
|
|
5378
|
+
process.env.QARPEO_COMMENTS_THREAD_DEPTH = String(commentsConfig.threadDepth || 3);
|
|
5379
|
+
process.env.QARPEO_COMMENTS_MAX_LENGTH = String(commentsConfig.maxLength || 5e3);
|
|
5380
|
+
if (commentsConfig.rateLimit?.max) {
|
|
5381
|
+
process.env.QARPEO_COMMENTS_RATE_LIMIT_MAX = String(commentsConfig.rateLimit.max);
|
|
5382
|
+
}
|
|
5383
|
+
if (typeof commentsConfig.reporting === "object" && commentsConfig.reporting.autoHideThreshold) {
|
|
5384
|
+
process.env.QARPEO_COMMENTS_AUTO_HIDE_THRESHOLD = String(
|
|
5385
|
+
commentsConfig.reporting.autoHideThreshold
|
|
5386
|
+
);
|
|
5387
|
+
}
|
|
5388
|
+
if (Array.isArray(commentsConfig.reactions)) {
|
|
5389
|
+
process.env.QARPEO_COMMENTS_REACTIONS = JSON.stringify(commentsConfig.reactions);
|
|
5390
|
+
}
|
|
5391
|
+
addImports([
|
|
5392
|
+
{
|
|
5393
|
+
name: "useComments",
|
|
5394
|
+
from: resolver.resolve("./runtime/app/composables/comments")
|
|
5395
|
+
}
|
|
5396
|
+
]);
|
|
5397
|
+
addComponent({
|
|
5398
|
+
// Primary name: <QComments> — consistent Q* component naming
|
|
5399
|
+
name: "QComments",
|
|
5400
|
+
filePath: resolver.resolve("./runtime/app/components/Comments")
|
|
5401
|
+
});
|
|
5402
|
+
addServerImports([
|
|
5403
|
+
{
|
|
5404
|
+
name: "createComment",
|
|
5405
|
+
from: resolver.resolve("./runtime/server/utils/comments")
|
|
5406
|
+
},
|
|
5407
|
+
{
|
|
5408
|
+
name: "queryComments",
|
|
5409
|
+
from: resolver.resolve("./runtime/server/utils/comments")
|
|
5410
|
+
},
|
|
5411
|
+
{
|
|
5412
|
+
name: "getComment",
|
|
5413
|
+
from: resolver.resolve("./runtime/server/utils/comments")
|
|
5414
|
+
},
|
|
5415
|
+
{
|
|
5416
|
+
name: "updateCommentStatus",
|
|
5417
|
+
from: resolver.resolve("./runtime/server/utils/comments")
|
|
5418
|
+
},
|
|
5419
|
+
{
|
|
5420
|
+
name: "deleteComment",
|
|
5421
|
+
from: resolver.resolve("./runtime/server/utils/comments")
|
|
5422
|
+
},
|
|
5423
|
+
{
|
|
5424
|
+
name: "reportComment",
|
|
5425
|
+
from: resolver.resolve("./runtime/server/utils/comments")
|
|
5426
|
+
},
|
|
5427
|
+
{
|
|
5428
|
+
name: "reactToComment",
|
|
5429
|
+
from: resolver.resolve("./runtime/server/utils/comments")
|
|
5430
|
+
},
|
|
5431
|
+
{
|
|
5432
|
+
name: "ensureCommentsTables",
|
|
5433
|
+
from: resolver.resolve("./runtime/server/utils/comments")
|
|
5434
|
+
}
|
|
5435
|
+
]);
|
|
5436
|
+
addServerHandler({
|
|
5437
|
+
route: `${commentsPrefix}`,
|
|
5438
|
+
method: "get",
|
|
5439
|
+
handler: resolver.resolve("./runtime/server/routes/comments/index.get")
|
|
5440
|
+
});
|
|
5441
|
+
addServerHandler({
|
|
5442
|
+
route: `${commentsPrefix}`,
|
|
5443
|
+
method: "post",
|
|
5444
|
+
handler: resolver.resolve("./runtime/server/routes/comments/index.post")
|
|
5445
|
+
});
|
|
5446
|
+
addServerHandler({
|
|
5447
|
+
route: `${commentsPrefix}/:id`,
|
|
5448
|
+
method: "get",
|
|
5449
|
+
handler: resolver.resolve("./runtime/server/routes/comments/[id].get")
|
|
5450
|
+
});
|
|
5451
|
+
addServerHandler({
|
|
5452
|
+
route: `${commentsPrefix}/:id`,
|
|
5453
|
+
method: "patch",
|
|
5454
|
+
handler: resolver.resolve("./runtime/server/routes/comments/[id].patch")
|
|
5455
|
+
});
|
|
5456
|
+
addServerHandler({
|
|
5457
|
+
route: `${commentsPrefix}/:id`,
|
|
5458
|
+
method: "delete",
|
|
5459
|
+
handler: resolver.resolve("./runtime/server/routes/comments/[id].delete")
|
|
5460
|
+
});
|
|
5461
|
+
addServerHandler({
|
|
5462
|
+
route: `${commentsPrefix}/:id/report`,
|
|
5463
|
+
method: "post",
|
|
5464
|
+
handler: resolver.resolve("./runtime/server/routes/comments/[id]/report.post")
|
|
5465
|
+
});
|
|
5466
|
+
addServerHandler({
|
|
5467
|
+
route: `${commentsPrefix}/:id/react`,
|
|
5468
|
+
method: "post",
|
|
5469
|
+
handler: resolver.resolve("./runtime/server/routes/comments/[id]/react.post")
|
|
5470
|
+
});
|
|
5471
|
+
}
|
|
5290
5472
|
const devtoolsRaw = options.devtools;
|
|
5291
5473
|
const devtoolsOpts = typeof devtoolsRaw === "boolean" ? { enabled: devtoolsRaw } : devtoolsRaw || {};
|
|
5292
5474
|
const isDevtoolsEnabled = Boolean(nuxt.options.dev && devtoolsOpts.enabled !== false);
|
|
@@ -5311,12 +5493,6 @@ export const manifestCollections = ${JSON.stringify(cmsConfig.collections || {})
|
|
|
5311
5493
|
multitenant: options.multitenant ? { enabled: true } : { enabled: false },
|
|
5312
5494
|
ratelimit: options.ratelimit ? { enabled: true } : { enabled: false },
|
|
5313
5495
|
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
5496
|
fate: options.fate ? { enabled: true } : { enabled: false }
|
|
5321
5497
|
};
|
|
5322
5498
|
const devtoolsPublicConfig = (nuxt.options.runtimeConfig = nuxt.options.runtimeConfig || {}).public = nuxt.options.runtimeConfig.public || {};
|
|
@@ -5757,4 +5933,4 @@ export const manifestCollections = ${JSON.stringify(cmsConfig.collections || {})
|
|
|
5757
5933
|
}
|
|
5758
5934
|
});
|
|
5759
5935
|
|
|
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 };
|
|
5936
|
+
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 };
|