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,186 @@
|
|
|
1
|
+
import { type Auth } from "convex/server";
|
|
2
|
+
import type { ComponentApi } from "../component/_generated/component.js";
|
|
3
|
+
import { type FeedbackActor } from "../component/model.js";
|
|
4
|
+
import { type FeedbackConfigOverrides } from "./config.js";
|
|
5
|
+
export type { CommentSort, EntryKind, EntrySort, EntryStatus, FeedbackActor, FeedbackComment, FeedbackEntry, SimilarEntriesResult, } from "../component/model.js";
|
|
6
|
+
export type { FeedbackPublicApi } from "./api.js";
|
|
7
|
+
export { createFeedbackConfig, defaultFeedbackConfig, type FeedbackConfig, type FeedbackConfigOverrides, } from "./config.js";
|
|
8
|
+
export interface FeedbackAuthContext {
|
|
9
|
+
auth: Auth;
|
|
10
|
+
}
|
|
11
|
+
export interface ExposeFeedbackOptions {
|
|
12
|
+
actor: (ctx: FeedbackAuthContext) => Promise<FeedbackActor | null>;
|
|
13
|
+
config?: FeedbackConfigOverrides;
|
|
14
|
+
}
|
|
15
|
+
export declare function exposeFeedbackApi<Name extends string | undefined>(component: ComponentApi<Name>, options: ExposeFeedbackOptions): {
|
|
16
|
+
listEntries: import("convex/server").RegisteredQuery<"public", {
|
|
17
|
+
kind?: "feedback" | "feature_request" | "bug_report" | undefined;
|
|
18
|
+
status?: "open" | "under_review" | "planned" | "in_progress" | "completed" | "closed" | undefined;
|
|
19
|
+
sort?: "top" | "newest" | undefined;
|
|
20
|
+
paginationOpts: {
|
|
21
|
+
id?: number;
|
|
22
|
+
endCursor?: string | null;
|
|
23
|
+
maximumRowsRead?: number;
|
|
24
|
+
maximumBytesRead?: number;
|
|
25
|
+
numItems: number;
|
|
26
|
+
cursor: string | null;
|
|
27
|
+
};
|
|
28
|
+
}, Promise<{
|
|
29
|
+
continueCursor: string;
|
|
30
|
+
isDone: boolean;
|
|
31
|
+
page: Array<{
|
|
32
|
+
actorId: string;
|
|
33
|
+
body: string;
|
|
34
|
+
commentCount: number;
|
|
35
|
+
creationTime: number;
|
|
36
|
+
id: string;
|
|
37
|
+
kind: "feedback" | "feature_request" | "bug_report";
|
|
38
|
+
status: "open" | "under_review" | "planned" | "in_progress" | "completed" | "closed";
|
|
39
|
+
title: string;
|
|
40
|
+
updatedAt?: number;
|
|
41
|
+
upvoteCount: number;
|
|
42
|
+
viewerHasUpvoted: boolean;
|
|
43
|
+
}>;
|
|
44
|
+
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
45
|
+
splitCursor?: string | null;
|
|
46
|
+
}>>;
|
|
47
|
+
getEntry: import("convex/server").RegisteredQuery<"public", {
|
|
48
|
+
entryId: string;
|
|
49
|
+
}, Promise<{
|
|
50
|
+
actorId: string;
|
|
51
|
+
body: string;
|
|
52
|
+
commentCount: number;
|
|
53
|
+
creationTime: number;
|
|
54
|
+
id: string;
|
|
55
|
+
kind: "feedback" | "feature_request" | "bug_report";
|
|
56
|
+
status: "open" | "under_review" | "planned" | "in_progress" | "completed" | "closed";
|
|
57
|
+
title: string;
|
|
58
|
+
updatedAt?: number;
|
|
59
|
+
upvoteCount: number;
|
|
60
|
+
viewerHasUpvoted: boolean;
|
|
61
|
+
} | null>>;
|
|
62
|
+
searchEntries: import("convex/server").RegisteredQuery<"public", {
|
|
63
|
+
kind?: "feedback" | "feature_request" | "bug_report" | undefined;
|
|
64
|
+
status?: "open" | "under_review" | "planned" | "in_progress" | "completed" | "closed" | undefined;
|
|
65
|
+
limit?: number | undefined;
|
|
66
|
+
searchQuery: string;
|
|
67
|
+
}, Promise<{
|
|
68
|
+
actorId: string;
|
|
69
|
+
body: string;
|
|
70
|
+
commentCount: number;
|
|
71
|
+
creationTime: number;
|
|
72
|
+
id: string;
|
|
73
|
+
kind: "feedback" | "feature_request" | "bug_report";
|
|
74
|
+
status: "open" | "under_review" | "planned" | "in_progress" | "completed" | "closed";
|
|
75
|
+
title: string;
|
|
76
|
+
updatedAt?: number;
|
|
77
|
+
upvoteCount: number;
|
|
78
|
+
viewerHasUpvoted: boolean;
|
|
79
|
+
}[]>>;
|
|
80
|
+
findSimilarEntries: import("convex/server").RegisteredQuery<"public", {
|
|
81
|
+
kind?: "feedback" | "feature_request" | "bug_report" | undefined;
|
|
82
|
+
limit?: number | undefined;
|
|
83
|
+
title: string;
|
|
84
|
+
body: string;
|
|
85
|
+
}, Promise<{
|
|
86
|
+
exact: Array<{
|
|
87
|
+
actorId: string;
|
|
88
|
+
body: string;
|
|
89
|
+
commentCount: number;
|
|
90
|
+
creationTime: number;
|
|
91
|
+
id: string;
|
|
92
|
+
kind: "feedback" | "feature_request" | "bug_report";
|
|
93
|
+
status: "open" | "under_review" | "planned" | "in_progress" | "completed" | "closed";
|
|
94
|
+
title: string;
|
|
95
|
+
updatedAt?: number;
|
|
96
|
+
upvoteCount: number;
|
|
97
|
+
viewerHasUpvoted: boolean;
|
|
98
|
+
}>;
|
|
99
|
+
similar: Array<{
|
|
100
|
+
actorId: string;
|
|
101
|
+
body: string;
|
|
102
|
+
commentCount: number;
|
|
103
|
+
creationTime: number;
|
|
104
|
+
id: string;
|
|
105
|
+
kind: "feedback" | "feature_request" | "bug_report";
|
|
106
|
+
status: "open" | "under_review" | "planned" | "in_progress" | "completed" | "closed";
|
|
107
|
+
title: string;
|
|
108
|
+
updatedAt?: number;
|
|
109
|
+
upvoteCount: number;
|
|
110
|
+
viewerHasUpvoted: boolean;
|
|
111
|
+
}>;
|
|
112
|
+
}>>;
|
|
113
|
+
createEntry: import("convex/server").RegisteredMutation<"public", {
|
|
114
|
+
kind: "feedback" | "feature_request" | "bug_report";
|
|
115
|
+
title: string;
|
|
116
|
+
body: string;
|
|
117
|
+
}, Promise<string>>;
|
|
118
|
+
updateEntry: import("convex/server").RegisteredMutation<"public", {
|
|
119
|
+
title: string;
|
|
120
|
+
body: string;
|
|
121
|
+
entryId: string;
|
|
122
|
+
}, Promise<null>>;
|
|
123
|
+
setEntryStatus: import("convex/server").RegisteredMutation<"public", {
|
|
124
|
+
status: "open" | "under_review" | "planned" | "in_progress" | "completed" | "closed";
|
|
125
|
+
entryId: string;
|
|
126
|
+
}, Promise<null>>;
|
|
127
|
+
setEntryUpvote: import("convex/server").RegisteredMutation<"public", {
|
|
128
|
+
entryId: string;
|
|
129
|
+
desiredState: boolean;
|
|
130
|
+
}, Promise<{
|
|
131
|
+
active: boolean;
|
|
132
|
+
upvoteCount: number;
|
|
133
|
+
}>>;
|
|
134
|
+
listComments: import("convex/server").RegisteredQuery<"public", {
|
|
135
|
+
sort?: "top" | "newest" | "oldest" | undefined;
|
|
136
|
+
parentCommentId?: string | undefined;
|
|
137
|
+
paginationOpts: {
|
|
138
|
+
id?: number;
|
|
139
|
+
endCursor?: string | null;
|
|
140
|
+
maximumRowsRead?: number;
|
|
141
|
+
maximumBytesRead?: number;
|
|
142
|
+
numItems: number;
|
|
143
|
+
cursor: string | null;
|
|
144
|
+
};
|
|
145
|
+
entryId: string;
|
|
146
|
+
}, Promise<{
|
|
147
|
+
continueCursor: string;
|
|
148
|
+
isDone: boolean;
|
|
149
|
+
page: Array<{
|
|
150
|
+
actorId: string;
|
|
151
|
+
body: string | null;
|
|
152
|
+
creationTime: number;
|
|
153
|
+
deletedAt?: number;
|
|
154
|
+
depth: number;
|
|
155
|
+
entryId: string;
|
|
156
|
+
id: string;
|
|
157
|
+
likeCount: number;
|
|
158
|
+
parentCommentId?: string;
|
|
159
|
+
replyCount: number;
|
|
160
|
+
updatedAt?: number;
|
|
161
|
+
viewerHasLiked: boolean;
|
|
162
|
+
}>;
|
|
163
|
+
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
164
|
+
splitCursor?: string | null;
|
|
165
|
+
}>>;
|
|
166
|
+
createComment: import("convex/server").RegisteredMutation<"public", {
|
|
167
|
+
parentCommentId?: string | undefined;
|
|
168
|
+
body: string;
|
|
169
|
+
entryId: string;
|
|
170
|
+
}, Promise<string>>;
|
|
171
|
+
updateComment: import("convex/server").RegisteredMutation<"public", {
|
|
172
|
+
body: string;
|
|
173
|
+
commentId: string;
|
|
174
|
+
}, Promise<null>>;
|
|
175
|
+
deleteComment: import("convex/server").RegisteredMutation<"public", {
|
|
176
|
+
commentId: string;
|
|
177
|
+
}, Promise<null>>;
|
|
178
|
+
setCommentLike: import("convex/server").RegisteredMutation<"public", {
|
|
179
|
+
desiredState: boolean;
|
|
180
|
+
commentId: string;
|
|
181
|
+
}, Promise<{
|
|
182
|
+
active: boolean;
|
|
183
|
+
likeCount: number;
|
|
184
|
+
}>>;
|
|
185
|
+
};
|
|
186
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;;qBACwC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;EAoQ9C"}
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import { mutationGeneric, paginationOptsValidator, paginationResultValidator, queryGeneric, } from "convex/server";
|
|
2
|
+
import { ConvexError, v } from "convex/values";
|
|
3
|
+
import { commentSortValidator, entryKindValidator, entrySortValidator, entryStatusValidator, publicCommentValidator, publicEntryValidator, similarEntriesValidator, } from "../component/model.js";
|
|
4
|
+
import { createFeedbackConfig, } from "./config.js";
|
|
5
|
+
export { createFeedbackConfig, defaultFeedbackConfig, } from "./config.js";
|
|
6
|
+
function requireActor(actor) {
|
|
7
|
+
if (actor === null) {
|
|
8
|
+
throw new ConvexError("Authentication is required.");
|
|
9
|
+
}
|
|
10
|
+
return actor;
|
|
11
|
+
}
|
|
12
|
+
function clampPositive(value, fallback, maximum) {
|
|
13
|
+
const candidate = value ?? fallback;
|
|
14
|
+
if (!Number.isFinite(candidate))
|
|
15
|
+
return fallback;
|
|
16
|
+
return Math.max(1, Math.min(Math.floor(candidate), maximum));
|
|
17
|
+
}
|
|
18
|
+
function clampPagination(paginationOpts, maximum) {
|
|
19
|
+
return {
|
|
20
|
+
...paginationOpts,
|
|
21
|
+
numItems: clampPositive(paginationOpts.numItems, maximum, maximum),
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function actorIdFields(actor) {
|
|
25
|
+
return actor === null ? {} : { viewerActorId: actor.id };
|
|
26
|
+
}
|
|
27
|
+
export function exposeFeedbackApi(component, options) {
|
|
28
|
+
const config = createFeedbackConfig(options.config);
|
|
29
|
+
return {
|
|
30
|
+
listEntries: queryGeneric({
|
|
31
|
+
args: {
|
|
32
|
+
paginationOpts: paginationOptsValidator,
|
|
33
|
+
kind: v.optional(entryKindValidator),
|
|
34
|
+
status: v.optional(entryStatusValidator),
|
|
35
|
+
sort: v.optional(entrySortValidator),
|
|
36
|
+
},
|
|
37
|
+
returns: paginationResultValidator(publicEntryValidator),
|
|
38
|
+
handler: async (ctx, args) => {
|
|
39
|
+
const actor = await options.actor(ctx);
|
|
40
|
+
return await ctx.runQuery(component.entries.list, {
|
|
41
|
+
paginationOpts: clampPagination(args.paginationOpts, config.entries.maxPageSize),
|
|
42
|
+
...(args.kind === undefined ? {} : { kind: args.kind }),
|
|
43
|
+
...(args.status === undefined ? {} : { status: args.status }),
|
|
44
|
+
sort: args.sort ?? config.entries.defaultSort,
|
|
45
|
+
...actorIdFields(actor),
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
}),
|
|
49
|
+
getEntry: queryGeneric({
|
|
50
|
+
args: { entryId: v.string() },
|
|
51
|
+
returns: v.union(publicEntryValidator, v.null()),
|
|
52
|
+
handler: async (ctx, args) => {
|
|
53
|
+
const actor = await options.actor(ctx);
|
|
54
|
+
return await ctx.runQuery(component.entries.get, {
|
|
55
|
+
entryId: args.entryId,
|
|
56
|
+
...actorIdFields(actor),
|
|
57
|
+
});
|
|
58
|
+
},
|
|
59
|
+
}),
|
|
60
|
+
searchEntries: queryGeneric({
|
|
61
|
+
args: {
|
|
62
|
+
searchQuery: v.string(),
|
|
63
|
+
kind: v.optional(entryKindValidator),
|
|
64
|
+
status: v.optional(entryStatusValidator),
|
|
65
|
+
limit: v.optional(v.number()),
|
|
66
|
+
},
|
|
67
|
+
returns: v.array(publicEntryValidator),
|
|
68
|
+
handler: async (ctx, args) => {
|
|
69
|
+
const actor = await options.actor(ctx);
|
|
70
|
+
return await ctx.runQuery(component.entries.search, {
|
|
71
|
+
searchQuery: args.searchQuery,
|
|
72
|
+
...(args.kind === undefined ? {} : { kind: args.kind }),
|
|
73
|
+
...(args.status === undefined ? {} : { status: args.status }),
|
|
74
|
+
limit: clampPositive(args.limit, config.search.defaultLimit, config.search.maxLimit),
|
|
75
|
+
...actorIdFields(actor),
|
|
76
|
+
});
|
|
77
|
+
},
|
|
78
|
+
}),
|
|
79
|
+
findSimilarEntries: queryGeneric({
|
|
80
|
+
args: {
|
|
81
|
+
title: v.string(),
|
|
82
|
+
body: v.string(),
|
|
83
|
+
kind: v.optional(entryKindValidator),
|
|
84
|
+
limit: v.optional(v.number()),
|
|
85
|
+
},
|
|
86
|
+
returns: similarEntriesValidator,
|
|
87
|
+
handler: async (ctx, args) => {
|
|
88
|
+
if (!config.search.duplicateSuggestions) {
|
|
89
|
+
return { exact: [], similar: [] };
|
|
90
|
+
}
|
|
91
|
+
const actor = await options.actor(ctx);
|
|
92
|
+
return await ctx.runQuery(component.entries.similar, {
|
|
93
|
+
title: args.title,
|
|
94
|
+
body: args.body,
|
|
95
|
+
...(args.kind === undefined ? {} : { kind: args.kind }),
|
|
96
|
+
limit: clampPositive(args.limit, config.search.duplicateSuggestionLimit, config.search.maxLimit),
|
|
97
|
+
...actorIdFields(actor),
|
|
98
|
+
});
|
|
99
|
+
},
|
|
100
|
+
}),
|
|
101
|
+
createEntry: mutationGeneric({
|
|
102
|
+
args: {
|
|
103
|
+
kind: entryKindValidator,
|
|
104
|
+
title: v.string(),
|
|
105
|
+
body: v.string(),
|
|
106
|
+
},
|
|
107
|
+
returns: v.string(),
|
|
108
|
+
handler: async (ctx, args) => {
|
|
109
|
+
const actor = requireActor(await options.actor(ctx));
|
|
110
|
+
return await ctx.runMutation(component.entries.create, {
|
|
111
|
+
actorId: actor.id,
|
|
112
|
+
kind: args.kind,
|
|
113
|
+
title: args.title,
|
|
114
|
+
body: args.body,
|
|
115
|
+
defaultStatus: config.entries.defaultStatus,
|
|
116
|
+
enabledKinds: [...config.entries.enabledKinds],
|
|
117
|
+
maxTitleLength: config.limits.titleLength,
|
|
118
|
+
maxBodyLength: config.limits.bodyLength,
|
|
119
|
+
});
|
|
120
|
+
},
|
|
121
|
+
}),
|
|
122
|
+
updateEntry: mutationGeneric({
|
|
123
|
+
args: {
|
|
124
|
+
entryId: v.string(),
|
|
125
|
+
title: v.string(),
|
|
126
|
+
body: v.string(),
|
|
127
|
+
},
|
|
128
|
+
returns: v.null(),
|
|
129
|
+
handler: async (ctx, args) => {
|
|
130
|
+
const actor = requireActor(await options.actor(ctx));
|
|
131
|
+
return await ctx.runMutation(component.entries.update, {
|
|
132
|
+
actor,
|
|
133
|
+
entryId: args.entryId,
|
|
134
|
+
title: args.title,
|
|
135
|
+
body: args.body,
|
|
136
|
+
editableByAuthor: config.entries.editableByAuthor,
|
|
137
|
+
maxTitleLength: config.limits.titleLength,
|
|
138
|
+
maxBodyLength: config.limits.bodyLength,
|
|
139
|
+
});
|
|
140
|
+
},
|
|
141
|
+
}),
|
|
142
|
+
setEntryStatus: mutationGeneric({
|
|
143
|
+
args: { entryId: v.string(), status: entryStatusValidator },
|
|
144
|
+
returns: v.null(),
|
|
145
|
+
handler: async (ctx, args) => {
|
|
146
|
+
const actor = requireActor(await options.actor(ctx));
|
|
147
|
+
return await ctx.runMutation(component.entries.setStatus, {
|
|
148
|
+
actor,
|
|
149
|
+
entryId: args.entryId,
|
|
150
|
+
status: args.status,
|
|
151
|
+
});
|
|
152
|
+
},
|
|
153
|
+
}),
|
|
154
|
+
setEntryUpvote: mutationGeneric({
|
|
155
|
+
args: { entryId: v.string(), desiredState: v.boolean() },
|
|
156
|
+
returns: v.object({ active: v.boolean(), upvoteCount: v.number() }),
|
|
157
|
+
handler: async (ctx, args) => {
|
|
158
|
+
const actor = requireActor(await options.actor(ctx));
|
|
159
|
+
return await ctx.runMutation(component.entries.setUpvote, {
|
|
160
|
+
actorId: actor.id,
|
|
161
|
+
entryId: args.entryId,
|
|
162
|
+
desiredState: args.desiredState,
|
|
163
|
+
});
|
|
164
|
+
},
|
|
165
|
+
}),
|
|
166
|
+
listComments: queryGeneric({
|
|
167
|
+
args: {
|
|
168
|
+
paginationOpts: paginationOptsValidator,
|
|
169
|
+
entryId: v.string(),
|
|
170
|
+
parentCommentId: v.optional(v.string()),
|
|
171
|
+
sort: v.optional(commentSortValidator),
|
|
172
|
+
},
|
|
173
|
+
returns: paginationResultValidator(publicCommentValidator),
|
|
174
|
+
handler: async (ctx, args) => {
|
|
175
|
+
const actor = await options.actor(ctx);
|
|
176
|
+
return await ctx.runQuery(component.comments.list, {
|
|
177
|
+
paginationOpts: clampPagination(args.paginationOpts, config.comments.maxPageSize),
|
|
178
|
+
entryId: args.entryId,
|
|
179
|
+
...(args.parentCommentId === undefined
|
|
180
|
+
? {}
|
|
181
|
+
: { parentCommentId: args.parentCommentId }),
|
|
182
|
+
sort: args.sort ?? config.comments.defaultSort,
|
|
183
|
+
...actorIdFields(actor),
|
|
184
|
+
});
|
|
185
|
+
},
|
|
186
|
+
}),
|
|
187
|
+
createComment: mutationGeneric({
|
|
188
|
+
args: {
|
|
189
|
+
entryId: v.string(),
|
|
190
|
+
parentCommentId: v.optional(v.string()),
|
|
191
|
+
body: v.string(),
|
|
192
|
+
},
|
|
193
|
+
returns: v.string(),
|
|
194
|
+
handler: async (ctx, args) => {
|
|
195
|
+
const actor = requireActor(await options.actor(ctx));
|
|
196
|
+
return await ctx.runMutation(component.comments.create, {
|
|
197
|
+
actorId: actor.id,
|
|
198
|
+
entryId: args.entryId,
|
|
199
|
+
...(args.parentCommentId === undefined
|
|
200
|
+
? {}
|
|
201
|
+
: { parentCommentId: args.parentCommentId }),
|
|
202
|
+
body: args.body,
|
|
203
|
+
maxDepth: config.comments.maxDepth,
|
|
204
|
+
maxCommentLength: config.limits.commentLength,
|
|
205
|
+
});
|
|
206
|
+
},
|
|
207
|
+
}),
|
|
208
|
+
updateComment: mutationGeneric({
|
|
209
|
+
args: { commentId: v.string(), body: v.string() },
|
|
210
|
+
returns: v.null(),
|
|
211
|
+
handler: async (ctx, args) => {
|
|
212
|
+
const actor = requireActor(await options.actor(ctx));
|
|
213
|
+
return await ctx.runMutation(component.comments.update, {
|
|
214
|
+
actor,
|
|
215
|
+
commentId: args.commentId,
|
|
216
|
+
body: args.body,
|
|
217
|
+
editableByAuthor: config.comments.editableByAuthor,
|
|
218
|
+
maxCommentLength: config.limits.commentLength,
|
|
219
|
+
});
|
|
220
|
+
},
|
|
221
|
+
}),
|
|
222
|
+
deleteComment: mutationGeneric({
|
|
223
|
+
args: { commentId: v.string() },
|
|
224
|
+
returns: v.null(),
|
|
225
|
+
handler: async (ctx, args) => {
|
|
226
|
+
const actor = requireActor(await options.actor(ctx));
|
|
227
|
+
return await ctx.runMutation(component.comments.remove, {
|
|
228
|
+
actor,
|
|
229
|
+
commentId: args.commentId,
|
|
230
|
+
deletableByAuthor: config.comments.deletableByAuthor,
|
|
231
|
+
});
|
|
232
|
+
},
|
|
233
|
+
}),
|
|
234
|
+
setCommentLike: mutationGeneric({
|
|
235
|
+
args: { commentId: v.string(), desiredState: v.boolean() },
|
|
236
|
+
returns: v.object({ active: v.boolean(), likeCount: v.number() }),
|
|
237
|
+
handler: async (ctx, args) => {
|
|
238
|
+
const actor = requireActor(await options.actor(ctx));
|
|
239
|
+
return await ctx.runMutation(component.comments.setLike, {
|
|
240
|
+
actorId: actor.id,
|
|
241
|
+
commentId: args.commentId,
|
|
242
|
+
desiredState: args.desiredState,
|
|
243
|
+
});
|
|
244
|
+
},
|
|
245
|
+
}),
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,yBAAyB,EACzB,YAAY,GAGb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAG/C,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,uBAAuB,GAExB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,oBAAoB,GAErB,MAAM,aAAa,CAAC;AAarB,OAAO,EACL,oBAAoB,EACpB,qBAAqB,GAGtB,MAAM,aAAa,CAAC;AAWrB,SAAS,YAAY,CAA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,EAAE,IAAI,CAAC,SAAS;oBACzB,YAAY,EAAE,IAAI,CAAC,YAAY;iBAChC,CAAC,CAAC;YACL,CAAC;SACF,CAAC;KACgD,CAAC;AACvD,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated `api` utility.
|
|
3
|
+
*
|
|
4
|
+
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
5
|
+
*
|
|
6
|
+
* To regenerate, run `npx convex dev`.
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import type * as comments from "../comments.js";
|
|
10
|
+
import type * as entries from "../entries.js";
|
|
11
|
+
import type * as helpers from "../helpers.js";
|
|
12
|
+
import type * as model from "../model.js";
|
|
13
|
+
import type * as types from "../types.js";
|
|
14
|
+
import type { ApiFromModules, FilterApi, FunctionReference } from "convex/server";
|
|
15
|
+
declare const fullApi: ApiFromModules<{
|
|
16
|
+
comments: typeof comments;
|
|
17
|
+
entries: typeof entries;
|
|
18
|
+
helpers: typeof helpers;
|
|
19
|
+
model: typeof model;
|
|
20
|
+
types: typeof types;
|
|
21
|
+
}>;
|
|
22
|
+
/**
|
|
23
|
+
* A utility for referencing Convex functions in your app's public API.
|
|
24
|
+
*
|
|
25
|
+
* Usage:
|
|
26
|
+
* ```js
|
|
27
|
+
* const myFunctionReference = api.myModule.myFunction;
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare const api: FilterApi<typeof fullApi, FunctionReference<any, "public">>;
|
|
31
|
+
/**
|
|
32
|
+
* A utility for referencing Convex functions in your app's internal API.
|
|
33
|
+
*
|
|
34
|
+
* Usage:
|
|
35
|
+
* ```js
|
|
36
|
+
* const myFunctionReference = internal.myModule.myFunction;
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare const internal: FilterApi<typeof fullApi, FunctionReference<any, "internal">>;
|
|
40
|
+
export declare const components: {};
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/component/_generated/api.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,KAAK,OAAO,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,KAAK,OAAO,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,KAAK,KAAK,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,KAAK,KAAK,MAAM,aAAa,CAAC;AAE1C,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EACT,iBAAiB,EAClB,MAAM,eAAe,CAAC;AAGvB,QAAA,MAAM,OAAO,EAAE,cAAc,CAAC;IAC5B,QAAQ,EAAE,OAAO,QAAQ,CAAC;IAC1B,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,KAAK,EAAE,OAAO,KAAK,CAAC;CACrB,CAAiB,CAAC;AAEnB;;;;;;;GAOG;AACH,eAAO,MAAM,GAAG,EAAE,SAAS,CACzB,OAAO,OAAO,EACd,iBAAiB,CAAC,GAAG,EAAE,QAAQ,CAAC,CACjB,CAAC;AAElB;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,EAAE,SAAS,CAC9B,OAAO,OAAO,EACd,iBAAiB,CAAC,GAAG,EAAE,UAAU,CAAC,CACnB,CAAC;AAElB,eAAO,MAAM,UAAU,EAAqC,EAAE,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/**
|
|
3
|
+
* Generated `api` utility.
|
|
4
|
+
*
|
|
5
|
+
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
6
|
+
*
|
|
7
|
+
* To regenerate, run `npx convex dev`.
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import { anyApi, componentsGeneric } from "convex/server";
|
|
11
|
+
const fullApi = anyApi;
|
|
12
|
+
/**
|
|
13
|
+
* A utility for referencing Convex functions in your app's public API.
|
|
14
|
+
*
|
|
15
|
+
* Usage:
|
|
16
|
+
* ```js
|
|
17
|
+
* const myFunctionReference = api.myModule.myFunction;
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export const api = anyApi;
|
|
21
|
+
/**
|
|
22
|
+
* A utility for referencing Convex functions in your app's internal API.
|
|
23
|
+
*
|
|
24
|
+
* Usage:
|
|
25
|
+
* ```js
|
|
26
|
+
* const myFunctionReference = internal.myModule.myFunction;
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export const internal = anyApi;
|
|
30
|
+
export const components = componentsGeneric();
|
|
31
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/component/_generated/api.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG;AAaH,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE1D,MAAM,OAAO,GAMR,MAAa,CAAC;AAEnB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,GAAG,GAGZ,MAAa,CAAC;AAElB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAGjB,MAAa,CAAC;AAElB,MAAM,CAAC,MAAM,UAAU,GAAG,iBAAiB,EAAmB,CAAC"}
|