convex-feedback 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +183 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/client/api.d.ts +72 -0
- package/dist/client/api.d.ts.map +1 -0
- package/dist/client/api.js +2 -0
- package/dist/client/api.js.map +1 -0
- package/dist/client/config.d.ts +37 -0
- package/dist/client/config.d.ts.map +1 -0
- package/dist/client/config.js +36 -0
- package/dist/client/config.js.map +1 -0
- package/dist/client/index.d.ts +186 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +248 -0
- package/dist/client/index.js.map +1 -0
- package/dist/component/_generated/api.d.ts +42 -0
- package/dist/component/_generated/api.d.ts.map +1 -0
- package/dist/component/_generated/api.js +31 -0
- package/dist/component/_generated/api.js.map +1 -0
- package/dist/component/_generated/component.d.ts +233 -0
- package/dist/component/_generated/component.d.ts.map +1 -0
- package/dist/component/_generated/component.js +11 -0
- package/dist/component/_generated/component.js.map +1 -0
- package/dist/component/_generated/dataModel.d.ts +46 -0
- package/dist/component/_generated/dataModel.d.ts.map +1 -0
- package/dist/component/_generated/dataModel.js +11 -0
- package/dist/component/_generated/dataModel.js.map +1 -0
- package/dist/component/_generated/server.d.ts +133 -0
- package/dist/component/_generated/server.d.ts.map +1 -0
- package/dist/component/_generated/server.js +80 -0
- package/dist/component/_generated/server.js.map +1 -0
- package/dist/component/comments.d.ts +68 -0
- package/dist/component/comments.d.ts.map +1 -0
- package/dist/component/comments.js +206 -0
- package/dist/component/comments.js.map +1 -0
- package/dist/component/convex.config.d.ts +3 -0
- package/dist/component/convex.config.d.ts.map +1 -0
- package/dist/component/convex.config.js +3 -0
- package/dist/component/convex.config.js.map +1 -0
- package/dist/component/entries.d.ts +140 -0
- package/dist/component/entries.d.ts.map +1 -0
- package/dist/component/entries.js +302 -0
- package/dist/component/entries.js.map +1 -0
- package/dist/component/helpers.d.ts +10 -0
- package/dist/component/helpers.d.ts.map +1 -0
- package/dist/component/helpers.js +74 -0
- package/dist/component/helpers.js.map +1 -0
- package/dist/component/model.d.ts +176 -0
- package/dist/component/model.d.ts.map +1 -0
- package/dist/component/model.js +41 -0
- package/dist/component/model.js.map +1 -0
- package/dist/component/schema.d.ts +78 -0
- package/dist/component/schema.d.ts.map +1 -0
- package/dist/component/schema.js +56 -0
- package/dist/component/schema.js.map +1 -0
- package/dist/component/types.d.ts +5 -0
- package/dist/component/types.d.ts.map +1 -0
- package/dist/component/types.js +2 -0
- package/dist/component/types.js.map +1 -0
- package/dist/react/index.d.ts +169 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +68 -0
- package/dist/react/index.js.map +1 -0
- package/dist/test.d.ts +88 -0
- package/dist/test.d.ts.map +1 -0
- package/dist/test.js +9 -0
- package/dist/test.js.map +1 -0
- package/package.json +63 -0
- package/src/client/README.md +11 -0
- package/src/client/api.ts +126 -0
- package/src/client/config.ts +80 -0
- package/src/client/index.ts +338 -0
- package/src/component/README.md +13 -0
- package/src/component/_generated/api.ts +58 -0
- package/src/component/_generated/component.ts +339 -0
- package/src/component/_generated/dataModel.ts +60 -0
- package/src/component/_generated/server.ts +169 -0
- package/src/component/comments.ts +258 -0
- package/src/component/convex.config.ts +3 -0
- package/src/component/entries.ts +385 -0
- package/src/component/helpers.ts +105 -0
- package/src/component/model.ts +76 -0
- package/src/component/schema.ts +60 -0
- package/src/component/types.ts +6 -0
- package/src/react/README.md +7 -0
- package/src/react/index.ts +140 -0
- package/src/test.ts +18 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { paginator } from "convex-helpers/server/pagination";
|
|
2
|
+
import { paginationOptsValidator, paginationResultValidator, } from "convex/server";
|
|
3
|
+
import { ConvexError, v } from "convex/values";
|
|
4
|
+
import { mutation, query } from "./_generated/server.js";
|
|
5
|
+
import { assertActorId, assertPositiveInteger, normalizeRequiredText, serializeComment, } from "./helpers.js";
|
|
6
|
+
import { actorValidator, commentSortValidator, publicCommentValidator, } from "./model.js";
|
|
7
|
+
import schema from "./schema.js";
|
|
8
|
+
export const list = query({
|
|
9
|
+
args: {
|
|
10
|
+
paginationOpts: paginationOptsValidator,
|
|
11
|
+
entryId: v.string(),
|
|
12
|
+
parentCommentId: v.optional(v.string()),
|
|
13
|
+
sort: commentSortValidator,
|
|
14
|
+
viewerActorId: v.optional(v.string()),
|
|
15
|
+
},
|
|
16
|
+
returns: paginationResultValidator(publicCommentValidator),
|
|
17
|
+
handler: async (ctx, args) => {
|
|
18
|
+
const entryId = ctx.db.normalizeId("entries", args.entryId);
|
|
19
|
+
if (entryId === null)
|
|
20
|
+
throw new ConvexError("Entry not found.");
|
|
21
|
+
const parentCommentId = args.parentCommentId === undefined
|
|
22
|
+
? undefined
|
|
23
|
+
: ctx.db.normalizeId("comments", args.parentCommentId);
|
|
24
|
+
if (parentCommentId === null) {
|
|
25
|
+
throw new ConvexError("Parent comment not found.");
|
|
26
|
+
}
|
|
27
|
+
if (parentCommentId !== undefined && parentCommentId !== null) {
|
|
28
|
+
const parent = await ctx.db.get("comments", parentCommentId);
|
|
29
|
+
if (parent === null || parent.entryId !== entryId) {
|
|
30
|
+
throw new ConvexError("Parent comment not found on this entry.");
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const db = paginator(ctx.db, schema);
|
|
34
|
+
const result = args.sort === "top"
|
|
35
|
+
? await db
|
|
36
|
+
.query("comments")
|
|
37
|
+
.withIndex("by_entry_parent_likes", (q) => q.eq("entryId", entryId).eq("parentCommentId", parentCommentId))
|
|
38
|
+
.order("desc")
|
|
39
|
+
.paginate(args.paginationOpts)
|
|
40
|
+
: await db
|
|
41
|
+
.query("comments")
|
|
42
|
+
.withIndex("by_entry_parent", (q) => q.eq("entryId", entryId).eq("parentCommentId", parentCommentId))
|
|
43
|
+
.order(args.sort === "newest" ? "desc" : "asc")
|
|
44
|
+
.paginate(args.paginationOpts);
|
|
45
|
+
return {
|
|
46
|
+
...result,
|
|
47
|
+
page: await Promise.all(result.page.map((comment) => serializeComment(ctx, comment, args.viewerActorId))),
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
export const create = mutation({
|
|
52
|
+
args: {
|
|
53
|
+
actorId: v.string(),
|
|
54
|
+
entryId: v.string(),
|
|
55
|
+
parentCommentId: v.optional(v.string()),
|
|
56
|
+
body: v.string(),
|
|
57
|
+
maxDepth: v.number(),
|
|
58
|
+
maxCommentLength: v.number(),
|
|
59
|
+
},
|
|
60
|
+
returns: v.string(),
|
|
61
|
+
handler: async (ctx, args) => {
|
|
62
|
+
assertActorId(args.actorId);
|
|
63
|
+
assertPositiveInteger(args.maxDepth, "Maximum comment depth");
|
|
64
|
+
assertPositiveInteger(args.maxCommentLength, "Maximum comment length");
|
|
65
|
+
const entryId = ctx.db.normalizeId("entries", args.entryId);
|
|
66
|
+
if (entryId === null)
|
|
67
|
+
throw new ConvexError("Entry not found.");
|
|
68
|
+
const entry = await ctx.db.get("entries", entryId);
|
|
69
|
+
if (entry === null)
|
|
70
|
+
throw new ConvexError("Entry not found.");
|
|
71
|
+
const body = normalizeRequiredText(args.body, "Comment", args.maxCommentLength);
|
|
72
|
+
const parentCommentId = args.parentCommentId === undefined
|
|
73
|
+
? undefined
|
|
74
|
+
: ctx.db.normalizeId("comments", args.parentCommentId);
|
|
75
|
+
if (args.parentCommentId !== undefined && parentCommentId === null) {
|
|
76
|
+
throw new ConvexError("Parent comment not found.");
|
|
77
|
+
}
|
|
78
|
+
let depth = 0;
|
|
79
|
+
if (parentCommentId !== undefined && parentCommentId !== null) {
|
|
80
|
+
const parent = await ctx.db.get("comments", parentCommentId);
|
|
81
|
+
if (parent === null || parent.entryId !== entryId) {
|
|
82
|
+
throw new ConvexError("Parent comment not found on this entry.");
|
|
83
|
+
}
|
|
84
|
+
depth = parent.depth + 1;
|
|
85
|
+
if (depth > args.maxDepth) {
|
|
86
|
+
throw new ConvexError(`Comments may not exceed depth ${args.maxDepth}.`);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
const commentId = await ctx.db.insert("comments", {
|
|
90
|
+
entryId,
|
|
91
|
+
...(parentCommentId === undefined || parentCommentId === null
|
|
92
|
+
? {}
|
|
93
|
+
: { parentCommentId }),
|
|
94
|
+
actorId: args.actorId,
|
|
95
|
+
depth,
|
|
96
|
+
body,
|
|
97
|
+
likeCount: 0,
|
|
98
|
+
replyCount: 0,
|
|
99
|
+
});
|
|
100
|
+
await ctx.db.patch("entries", entryId, {
|
|
101
|
+
commentCount: entry.commentCount + 1,
|
|
102
|
+
});
|
|
103
|
+
if (parentCommentId !== undefined && parentCommentId !== null) {
|
|
104
|
+
const parent = await ctx.db.get("comments", parentCommentId);
|
|
105
|
+
if (parent !== null) {
|
|
106
|
+
await ctx.db.patch("comments", parentCommentId, {
|
|
107
|
+
replyCount: parent.replyCount + 1,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return commentId;
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
export const update = mutation({
|
|
115
|
+
args: {
|
|
116
|
+
actor: actorValidator,
|
|
117
|
+
commentId: v.string(),
|
|
118
|
+
body: v.string(),
|
|
119
|
+
editableByAuthor: v.boolean(),
|
|
120
|
+
maxCommentLength: v.number(),
|
|
121
|
+
},
|
|
122
|
+
returns: v.null(),
|
|
123
|
+
handler: async (ctx, args) => {
|
|
124
|
+
assertActorId(args.actor.id);
|
|
125
|
+
const commentId = ctx.db.normalizeId("comments", args.commentId);
|
|
126
|
+
if (commentId === null)
|
|
127
|
+
throw new ConvexError("Comment not found.");
|
|
128
|
+
const comment = await ctx.db.get("comments", commentId);
|
|
129
|
+
if (comment === null)
|
|
130
|
+
throw new ConvexError("Comment not found.");
|
|
131
|
+
if (comment.deletedAt !== undefined) {
|
|
132
|
+
throw new ConvexError("Deleted comments cannot be edited.");
|
|
133
|
+
}
|
|
134
|
+
const canEdit = args.actor.isModerator ||
|
|
135
|
+
(args.editableByAuthor && comment.actorId === args.actor.id);
|
|
136
|
+
if (!canEdit)
|
|
137
|
+
throw new ConvexError("Not authorized to edit this comment.");
|
|
138
|
+
const body = normalizeRequiredText(args.body, "Comment", args.maxCommentLength);
|
|
139
|
+
await ctx.db.patch("comments", commentId, { body, updatedAt: Date.now() });
|
|
140
|
+
return null;
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
export const remove = mutation({
|
|
144
|
+
args: {
|
|
145
|
+
actor: actorValidator,
|
|
146
|
+
commentId: v.string(),
|
|
147
|
+
deletableByAuthor: v.boolean(),
|
|
148
|
+
},
|
|
149
|
+
returns: v.null(),
|
|
150
|
+
handler: async (ctx, args) => {
|
|
151
|
+
assertActorId(args.actor.id);
|
|
152
|
+
const commentId = ctx.db.normalizeId("comments", args.commentId);
|
|
153
|
+
if (commentId === null)
|
|
154
|
+
throw new ConvexError("Comment not found.");
|
|
155
|
+
const comment = await ctx.db.get("comments", commentId);
|
|
156
|
+
if (comment === null)
|
|
157
|
+
throw new ConvexError("Comment not found.");
|
|
158
|
+
if (comment.deletedAt !== undefined)
|
|
159
|
+
return null;
|
|
160
|
+
const canDelete = args.actor.isModerator ||
|
|
161
|
+
(args.deletableByAuthor && comment.actorId === args.actor.id);
|
|
162
|
+
if (!canDelete) {
|
|
163
|
+
throw new ConvexError("Not authorized to delete this comment.");
|
|
164
|
+
}
|
|
165
|
+
await ctx.db.patch("comments", commentId, { deletedAt: Date.now() });
|
|
166
|
+
return null;
|
|
167
|
+
},
|
|
168
|
+
});
|
|
169
|
+
export const setLike = mutation({
|
|
170
|
+
args: {
|
|
171
|
+
actorId: v.string(),
|
|
172
|
+
commentId: v.string(),
|
|
173
|
+
desiredState: v.boolean(),
|
|
174
|
+
},
|
|
175
|
+
returns: v.object({ active: v.boolean(), likeCount: v.number() }),
|
|
176
|
+
handler: async (ctx, args) => {
|
|
177
|
+
assertActorId(args.actorId);
|
|
178
|
+
const commentId = ctx.db.normalizeId("comments", args.commentId);
|
|
179
|
+
if (commentId === null)
|
|
180
|
+
throw new ConvexError("Comment not found.");
|
|
181
|
+
const comment = await ctx.db.get("comments", commentId);
|
|
182
|
+
if (comment === null)
|
|
183
|
+
throw new ConvexError("Comment not found.");
|
|
184
|
+
if (comment.deletedAt !== undefined) {
|
|
185
|
+
throw new ConvexError("Deleted comments cannot receive likes.");
|
|
186
|
+
}
|
|
187
|
+
const existing = await ctx.db
|
|
188
|
+
.query("reactions")
|
|
189
|
+
.withIndex("by_comment_actor", (q) => q.eq("commentId", commentId).eq("actorId", args.actorId))
|
|
190
|
+
.unique();
|
|
191
|
+
if (args.desiredState && existing === null) {
|
|
192
|
+
await ctx.db.insert("reactions", { actorId: args.actorId, commentId });
|
|
193
|
+
const likeCount = comment.likeCount + 1;
|
|
194
|
+
await ctx.db.patch("comments", commentId, { likeCount });
|
|
195
|
+
return { active: true, likeCount };
|
|
196
|
+
}
|
|
197
|
+
if (!args.desiredState && existing !== null) {
|
|
198
|
+
await ctx.db.delete("reactions", existing._id);
|
|
199
|
+
const likeCount = Math.max(0, comment.likeCount - 1);
|
|
200
|
+
await ctx.db.patch("comments", commentId, { likeCount });
|
|
201
|
+
return { active: false, likeCount };
|
|
202
|
+
}
|
|
203
|
+
return { active: args.desiredState, likeCount: comment.likeCount };
|
|
204
|
+
},
|
|
205
|
+
});
|
|
206
|
+
//# sourceMappingURL=comments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comments.js","sourceRoot":"","sources":["../../src/component/comments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EACL,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,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,CAAC,CAAC,CAAC;YACrD,MAAM,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;YACzD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;QACtC,CAAC;QAED,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC;IACrE,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convex.config.d.ts","sourceRoot":"","sources":["../../src/component/convex.config.ts"],"names":[],"mappings":";AAEA,wBAA2C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convex.config.js","sourceRoot":"","sources":["../../src/component/convex.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,eAAe,eAAe,CAAC,UAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
export declare const list: import("convex/server").RegisteredQuery<"public", {
|
|
2
|
+
kind?: "feedback" | "feature_request" | "bug_report" | undefined;
|
|
3
|
+
status?: "open" | "under_review" | "planned" | "in_progress" | "completed" | "closed" | undefined;
|
|
4
|
+
viewerActorId?: string | undefined;
|
|
5
|
+
sort: "top" | "newest";
|
|
6
|
+
paginationOpts: {
|
|
7
|
+
id?: number;
|
|
8
|
+
endCursor?: string | null;
|
|
9
|
+
maximumRowsRead?: number;
|
|
10
|
+
maximumBytesRead?: number;
|
|
11
|
+
numItems: number;
|
|
12
|
+
cursor: string | null;
|
|
13
|
+
};
|
|
14
|
+
}, Promise<{
|
|
15
|
+
page: {
|
|
16
|
+
updatedAt?: number | undefined;
|
|
17
|
+
id: string;
|
|
18
|
+
creationTime: number;
|
|
19
|
+
actorId: string;
|
|
20
|
+
kind: "feedback" | "feature_request" | "bug_report";
|
|
21
|
+
status: "open" | "under_review" | "planned" | "in_progress" | "completed" | "closed";
|
|
22
|
+
title: string;
|
|
23
|
+
body: string;
|
|
24
|
+
upvoteCount: number;
|
|
25
|
+
commentCount: number;
|
|
26
|
+
viewerHasUpvoted: boolean;
|
|
27
|
+
}[];
|
|
28
|
+
isDone: boolean;
|
|
29
|
+
continueCursor: import("convex/server").Cursor;
|
|
30
|
+
splitCursor?: import("convex/server").Cursor | null;
|
|
31
|
+
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
32
|
+
}>>;
|
|
33
|
+
export declare const get: import("convex/server").RegisteredQuery<"public", {
|
|
34
|
+
viewerActorId?: string | undefined;
|
|
35
|
+
entryId: string;
|
|
36
|
+
}, Promise<{
|
|
37
|
+
updatedAt?: number | undefined;
|
|
38
|
+
id: string;
|
|
39
|
+
creationTime: number;
|
|
40
|
+
actorId: string;
|
|
41
|
+
kind: "feedback" | "feature_request" | "bug_report";
|
|
42
|
+
status: "open" | "under_review" | "planned" | "in_progress" | "completed" | "closed";
|
|
43
|
+
title: string;
|
|
44
|
+
body: string;
|
|
45
|
+
upvoteCount: number;
|
|
46
|
+
commentCount: number;
|
|
47
|
+
viewerHasUpvoted: boolean;
|
|
48
|
+
} | null>>;
|
|
49
|
+
export declare const search: import("convex/server").RegisteredQuery<"public", {
|
|
50
|
+
kind?: "feedback" | "feature_request" | "bug_report" | undefined;
|
|
51
|
+
status?: "open" | "under_review" | "planned" | "in_progress" | "completed" | "closed" | undefined;
|
|
52
|
+
viewerActorId?: string | undefined;
|
|
53
|
+
searchQuery: string;
|
|
54
|
+
limit: number;
|
|
55
|
+
}, Promise<{
|
|
56
|
+
updatedAt?: number | undefined;
|
|
57
|
+
id: string;
|
|
58
|
+
creationTime: number;
|
|
59
|
+
actorId: string;
|
|
60
|
+
kind: "feedback" | "feature_request" | "bug_report";
|
|
61
|
+
status: "open" | "under_review" | "planned" | "in_progress" | "completed" | "closed";
|
|
62
|
+
title: string;
|
|
63
|
+
body: string;
|
|
64
|
+
upvoteCount: number;
|
|
65
|
+
commentCount: number;
|
|
66
|
+
viewerHasUpvoted: boolean;
|
|
67
|
+
}[]>>;
|
|
68
|
+
export declare const similar: import("convex/server").RegisteredQuery<"public", {
|
|
69
|
+
kind?: "feedback" | "feature_request" | "bug_report" | undefined;
|
|
70
|
+
viewerActorId?: string | undefined;
|
|
71
|
+
title: string;
|
|
72
|
+
body: string;
|
|
73
|
+
limit: number;
|
|
74
|
+
}, Promise<{
|
|
75
|
+
exact: {
|
|
76
|
+
updatedAt?: number | undefined;
|
|
77
|
+
id: string;
|
|
78
|
+
creationTime: number;
|
|
79
|
+
actorId: string;
|
|
80
|
+
kind: "feedback" | "feature_request" | "bug_report";
|
|
81
|
+
status: "open" | "under_review" | "planned" | "in_progress" | "completed" | "closed";
|
|
82
|
+
title: string;
|
|
83
|
+
body: string;
|
|
84
|
+
upvoteCount: number;
|
|
85
|
+
commentCount: number;
|
|
86
|
+
viewerHasUpvoted: boolean;
|
|
87
|
+
}[];
|
|
88
|
+
similar: {
|
|
89
|
+
updatedAt?: number | undefined;
|
|
90
|
+
id: string;
|
|
91
|
+
creationTime: number;
|
|
92
|
+
actorId: string;
|
|
93
|
+
kind: "feedback" | "feature_request" | "bug_report";
|
|
94
|
+
status: "open" | "under_review" | "planned" | "in_progress" | "completed" | "closed";
|
|
95
|
+
title: string;
|
|
96
|
+
body: string;
|
|
97
|
+
upvoteCount: number;
|
|
98
|
+
commentCount: number;
|
|
99
|
+
viewerHasUpvoted: boolean;
|
|
100
|
+
}[];
|
|
101
|
+
}>>;
|
|
102
|
+
export declare const create: import("convex/server").RegisteredMutation<"public", {
|
|
103
|
+
actorId: string;
|
|
104
|
+
kind: "feedback" | "feature_request" | "bug_report";
|
|
105
|
+
title: string;
|
|
106
|
+
body: string;
|
|
107
|
+
defaultStatus: "open" | "under_review" | "planned" | "in_progress" | "completed" | "closed";
|
|
108
|
+
enabledKinds: ("feedback" | "feature_request" | "bug_report")[];
|
|
109
|
+
maxBodyLength: number;
|
|
110
|
+
maxTitleLength: number;
|
|
111
|
+
}, Promise<import("convex/values").GenericId<"entries">>>;
|
|
112
|
+
export declare const update: import("convex/server").RegisteredMutation<"public", {
|
|
113
|
+
title: string;
|
|
114
|
+
body: string;
|
|
115
|
+
entryId: string;
|
|
116
|
+
actor: {
|
|
117
|
+
id: string;
|
|
118
|
+
isModerator: boolean;
|
|
119
|
+
};
|
|
120
|
+
editableByAuthor: boolean;
|
|
121
|
+
maxBodyLength: number;
|
|
122
|
+
maxTitleLength: number;
|
|
123
|
+
}, Promise<null>>;
|
|
124
|
+
export declare const setStatus: import("convex/server").RegisteredMutation<"public", {
|
|
125
|
+
status: "open" | "under_review" | "planned" | "in_progress" | "completed" | "closed";
|
|
126
|
+
entryId: string;
|
|
127
|
+
actor: {
|
|
128
|
+
id: string;
|
|
129
|
+
isModerator: boolean;
|
|
130
|
+
};
|
|
131
|
+
}, Promise<null>>;
|
|
132
|
+
export declare const setUpvote: import("convex/server").RegisteredMutation<"public", {
|
|
133
|
+
actorId: string;
|
|
134
|
+
entryId: string;
|
|
135
|
+
desiredState: boolean;
|
|
136
|
+
}, Promise<{
|
|
137
|
+
active: boolean;
|
|
138
|
+
upvoteCount: number;
|
|
139
|
+
}>>;
|
|
140
|
+
//# sourceMappingURL=entries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entries.d.ts","sourceRoot":"","sources":["../../src/component/entries.ts"],"names":[],"mappings":"AAwBA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0Ef,CAAC;AAEH,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;UAcd,CAAC;AAEH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;KAkDjB,CAAC;AAEH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0ElB,CAAC;AAEH,eAAO,MAAM,MAAM;;;;;;;;;yDAqCjB,CAAC;AAEH,eAAO,MAAM,MAAM;;;;;;;;;;;iBAuCjB,CAAC;AAEH,eAAO,MAAM,SAAS;;;;;;;iBAqBpB,CAAC;AAEH,eAAO,MAAM,SAAS;;;;;;;GAqCpB,CAAC"}
|