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,41 @@
|
|
|
1
|
+
import { v } from "convex/values";
|
|
2
|
+
export const entryKindValidator = v.union(v.literal("feedback"), v.literal("feature_request"), v.literal("bug_report"));
|
|
3
|
+
export const entryStatusValidator = v.union(v.literal("open"), v.literal("under_review"), v.literal("planned"), v.literal("in_progress"), v.literal("completed"), v.literal("closed"));
|
|
4
|
+
export const entrySortValidator = v.union(v.literal("top"), v.literal("newest"));
|
|
5
|
+
export const commentSortValidator = v.union(v.literal("top"), v.literal("newest"), v.literal("oldest"));
|
|
6
|
+
export const actorValidator = v.object({
|
|
7
|
+
id: v.string(),
|
|
8
|
+
isModerator: v.boolean(),
|
|
9
|
+
});
|
|
10
|
+
export const publicEntryValidator = v.object({
|
|
11
|
+
id: v.string(),
|
|
12
|
+
creationTime: v.number(),
|
|
13
|
+
actorId: v.string(),
|
|
14
|
+
kind: entryKindValidator,
|
|
15
|
+
status: entryStatusValidator,
|
|
16
|
+
title: v.string(),
|
|
17
|
+
body: v.string(),
|
|
18
|
+
upvoteCount: v.number(),
|
|
19
|
+
commentCount: v.number(),
|
|
20
|
+
updatedAt: v.optional(v.number()),
|
|
21
|
+
viewerHasUpvoted: v.boolean(),
|
|
22
|
+
});
|
|
23
|
+
export const publicCommentValidator = v.object({
|
|
24
|
+
id: v.string(),
|
|
25
|
+
creationTime: v.number(),
|
|
26
|
+
entryId: v.string(),
|
|
27
|
+
parentCommentId: v.optional(v.string()),
|
|
28
|
+
actorId: v.string(),
|
|
29
|
+
depth: v.number(),
|
|
30
|
+
body: v.union(v.string(), v.null()),
|
|
31
|
+
likeCount: v.number(),
|
|
32
|
+
replyCount: v.number(),
|
|
33
|
+
updatedAt: v.optional(v.number()),
|
|
34
|
+
deletedAt: v.optional(v.number()),
|
|
35
|
+
viewerHasLiked: v.boolean(),
|
|
36
|
+
});
|
|
37
|
+
export const similarEntriesValidator = v.object({
|
|
38
|
+
exact: v.array(publicEntryValidator),
|
|
39
|
+
similar: v.array(publicEntryValidator),
|
|
40
|
+
});
|
|
41
|
+
//# sourceMappingURL=model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/component/model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAElC,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CACvC,CAAC,CAAC,OAAO,CAAC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|
1
|
+
declare const schema: import("convex/server").SchemaDefinition<{
|
|
2
|
+
entries: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
3
|
+
updatedAt?: number | undefined;
|
|
4
|
+
actorId: string;
|
|
5
|
+
kind: "feedback" | "feature_request" | "bug_report";
|
|
6
|
+
status: "open" | "under_review" | "planned" | "in_progress" | "completed" | "closed";
|
|
7
|
+
title: string;
|
|
8
|
+
body: string;
|
|
9
|
+
upvoteCount: number;
|
|
10
|
+
commentCount: number;
|
|
11
|
+
normalizedTitle: string;
|
|
12
|
+
searchText: string;
|
|
13
|
+
}, {
|
|
14
|
+
actorId: import("convex/values").VString<string, "required">;
|
|
15
|
+
kind: import("convex/values").VUnion<"feedback" | "feature_request" | "bug_report", [import("convex/values").VLiteral<"feedback", "required">, import("convex/values").VLiteral<"feature_request", "required">, import("convex/values").VLiteral<"bug_report", "required">], "required", never>;
|
|
16
|
+
status: import("convex/values").VUnion<"open" | "under_review" | "planned" | "in_progress" | "completed" | "closed", [import("convex/values").VLiteral<"open", "required">, import("convex/values").VLiteral<"under_review", "required">, import("convex/values").VLiteral<"planned", "required">, import("convex/values").VLiteral<"in_progress", "required">, import("convex/values").VLiteral<"completed", "required">, import("convex/values").VLiteral<"closed", "required">], "required", never>;
|
|
17
|
+
title: import("convex/values").VString<string, "required">;
|
|
18
|
+
body: import("convex/values").VString<string, "required">;
|
|
19
|
+
normalizedTitle: import("convex/values").VString<string, "required">;
|
|
20
|
+
searchText: import("convex/values").VString<string, "required">;
|
|
21
|
+
upvoteCount: import("convex/values").VFloat64<number, "required">;
|
|
22
|
+
commentCount: import("convex/values").VFloat64<number, "required">;
|
|
23
|
+
updatedAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
24
|
+
}, "required", "actorId" | "kind" | "status" | "title" | "body" | "upvoteCount" | "commentCount" | "updatedAt" | "normalizedTitle" | "searchText">, {
|
|
25
|
+
by_kind: ["kind", "_creationTime"];
|
|
26
|
+
by_status: ["status", "_creationTime"];
|
|
27
|
+
by_kind_status: ["kind", "status", "_creationTime"];
|
|
28
|
+
by_upvotes: ["upvoteCount", "_creationTime"];
|
|
29
|
+
by_kind_upvotes: ["kind", "upvoteCount", "_creationTime"];
|
|
30
|
+
by_status_upvotes: ["status", "upvoteCount", "_creationTime"];
|
|
31
|
+
by_kind_status_upvotes: ["kind", "status", "upvoteCount", "_creationTime"];
|
|
32
|
+
by_normalized_title: ["normalizedTitle", "_creationTime"];
|
|
33
|
+
by_kind_normalized_title: ["kind", "normalizedTitle", "_creationTime"];
|
|
34
|
+
}, {
|
|
35
|
+
search: {
|
|
36
|
+
searchField: "searchText";
|
|
37
|
+
filterFields: "kind" | "status";
|
|
38
|
+
};
|
|
39
|
+
}, {}>;
|
|
40
|
+
comments: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
41
|
+
updatedAt?: number | undefined;
|
|
42
|
+
parentCommentId?: import("convex/values").GenericId<"comments"> | undefined;
|
|
43
|
+
deletedAt?: number | undefined;
|
|
44
|
+
actorId: string;
|
|
45
|
+
body: string;
|
|
46
|
+
entryId: import("convex/values").GenericId<"entries">;
|
|
47
|
+
depth: number;
|
|
48
|
+
likeCount: number;
|
|
49
|
+
replyCount: number;
|
|
50
|
+
}, {
|
|
51
|
+
entryId: import("convex/values").VId<import("convex/values").GenericId<"entries">, "required">;
|
|
52
|
+
parentCommentId: import("convex/values").VId<import("convex/values").GenericId<"comments"> | undefined, "optional">;
|
|
53
|
+
actorId: import("convex/values").VString<string, "required">;
|
|
54
|
+
depth: import("convex/values").VFloat64<number, "required">;
|
|
55
|
+
body: import("convex/values").VString<string, "required">;
|
|
56
|
+
likeCount: import("convex/values").VFloat64<number, "required">;
|
|
57
|
+
replyCount: import("convex/values").VFloat64<number, "required">;
|
|
58
|
+
updatedAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
59
|
+
deletedAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
60
|
+
}, "required", "actorId" | "body" | "updatedAt" | "entryId" | "parentCommentId" | "depth" | "likeCount" | "replyCount" | "deletedAt">, {
|
|
61
|
+
by_entry_parent: ["entryId", "parentCommentId", "_creationTime"];
|
|
62
|
+
by_entry_parent_likes: ["entryId", "parentCommentId", "likeCount", "_creationTime"];
|
|
63
|
+
}, {}, {}>;
|
|
64
|
+
reactions: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
65
|
+
entryId?: import("convex/values").GenericId<"entries"> | undefined;
|
|
66
|
+
commentId?: import("convex/values").GenericId<"comments"> | undefined;
|
|
67
|
+
actorId: string;
|
|
68
|
+
}, {
|
|
69
|
+
actorId: import("convex/values").VString<string, "required">;
|
|
70
|
+
entryId: import("convex/values").VId<import("convex/values").GenericId<"entries"> | undefined, "optional">;
|
|
71
|
+
commentId: import("convex/values").VId<import("convex/values").GenericId<"comments"> | undefined, "optional">;
|
|
72
|
+
}, "required", "actorId" | "entryId" | "commentId">, {
|
|
73
|
+
by_entry_actor: ["entryId", "actorId", "_creationTime"];
|
|
74
|
+
by_comment_actor: ["commentId", "actorId", "_creationTime"];
|
|
75
|
+
}, {}, {}>;
|
|
76
|
+
}, true>;
|
|
77
|
+
export default schema;
|
|
78
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/component/schema.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAoDV,CAAC;AAEH,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { defineSchema, defineTable } from "convex/server";
|
|
2
|
+
import { v } from "convex/values";
|
|
3
|
+
import { entryKindValidator, entryStatusValidator } from "./model.js";
|
|
4
|
+
const schema = defineSchema({
|
|
5
|
+
entries: defineTable({
|
|
6
|
+
actorId: v.string(),
|
|
7
|
+
kind: entryKindValidator,
|
|
8
|
+
status: entryStatusValidator,
|
|
9
|
+
title: v.string(),
|
|
10
|
+
body: v.string(),
|
|
11
|
+
normalizedTitle: v.string(),
|
|
12
|
+
searchText: v.string(),
|
|
13
|
+
upvoteCount: v.number(),
|
|
14
|
+
commentCount: v.number(),
|
|
15
|
+
updatedAt: v.optional(v.number()),
|
|
16
|
+
})
|
|
17
|
+
.index("by_kind", ["kind"])
|
|
18
|
+
.index("by_status", ["status"])
|
|
19
|
+
.index("by_kind_status", ["kind", "status"])
|
|
20
|
+
.index("by_upvotes", ["upvoteCount"])
|
|
21
|
+
.index("by_kind_upvotes", ["kind", "upvoteCount"])
|
|
22
|
+
.index("by_status_upvotes", ["status", "upvoteCount"])
|
|
23
|
+
.index("by_kind_status_upvotes", ["kind", "status", "upvoteCount"])
|
|
24
|
+
.index("by_normalized_title", ["normalizedTitle"])
|
|
25
|
+
.index("by_kind_normalized_title", ["kind", "normalizedTitle"])
|
|
26
|
+
.searchIndex("search", {
|
|
27
|
+
searchField: "searchText",
|
|
28
|
+
filterFields: ["kind", "status"],
|
|
29
|
+
}),
|
|
30
|
+
comments: defineTable({
|
|
31
|
+
entryId: v.id("entries"),
|
|
32
|
+
parentCommentId: v.optional(v.id("comments")),
|
|
33
|
+
actorId: v.string(),
|
|
34
|
+
depth: v.number(),
|
|
35
|
+
body: v.string(),
|
|
36
|
+
likeCount: v.number(),
|
|
37
|
+
replyCount: v.number(),
|
|
38
|
+
updatedAt: v.optional(v.number()),
|
|
39
|
+
deletedAt: v.optional(v.number()),
|
|
40
|
+
})
|
|
41
|
+
.index("by_entry_parent", ["entryId", "parentCommentId"])
|
|
42
|
+
.index("by_entry_parent_likes", [
|
|
43
|
+
"entryId",
|
|
44
|
+
"parentCommentId",
|
|
45
|
+
"likeCount",
|
|
46
|
+
]),
|
|
47
|
+
reactions: defineTable({
|
|
48
|
+
actorId: v.string(),
|
|
49
|
+
entryId: v.optional(v.id("entries")),
|
|
50
|
+
commentId: v.optional(v.id("comments")),
|
|
51
|
+
})
|
|
52
|
+
.index("by_entry_actor", ["entryId", "actorId"])
|
|
53
|
+
.index("by_comment_actor", ["commentId", "actorId"]),
|
|
54
|
+
});
|
|
55
|
+
export default schema;
|
|
56
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/component/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAElC,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEtE,MAAM,MAAM,GAAG,YAAY,CAAC;IAC1B,OAAO,EAAE,WAAW,CAAC;QACnB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;QACnB,IAAI,EAAE,kBAAkB;QACxB,MAAM,EAAE,oBAAoB;QAC5B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;QACjB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE;QAC3B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;QACtB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;QACvB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;QACxB,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;KAClC,CAAC;SACC,KAAK,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC,CAAC;SAC1B,KAAK,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC;SAC9B,KAAK,CAAC,gBAAgB,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;SAC3C,KAAK,CAAC,YAAY,EAAE,CAAC,aAAa,CAAC,CAAC;SACpC,KAAK,CAAC,iBAAiB,EAAE,CAAC,MAA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CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;QACpC,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC;KACxC,CAAC;SACC,KAAK,CAAC,gBAAgB,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;SAC/C,KAAK,CAAC,kBAAkB,EAAE,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;CACvD,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { GenericMutationCtx, GenericQueryCtx } from "convex/server";
|
|
2
|
+
import type { DataModel } from "./_generated/dataModel.js";
|
|
3
|
+
export type QueryCtx = GenericQueryCtx<DataModel>;
|
|
4
|
+
export type MutationCtx = GenericMutationCtx<DataModel>;
|
|
5
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/component/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAE3D,MAAM,MAAM,QAAQ,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC;AAClD,MAAM,MAAM,WAAW,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/component/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import type { FeedbackPublicApi } from "../client/api.js";
|
|
2
|
+
import type { CommentSort, EntryKind, EntrySort, EntryStatus } from "../component/model.js";
|
|
3
|
+
export interface FeedbackHooksOptions {
|
|
4
|
+
entryPageSize?: number;
|
|
5
|
+
commentPageSize?: number;
|
|
6
|
+
replyPageSize?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface UseEntriesArgs {
|
|
9
|
+
kind?: EntryKind;
|
|
10
|
+
status?: EntryStatus;
|
|
11
|
+
sort?: EntrySort;
|
|
12
|
+
}
|
|
13
|
+
export interface UseCommentsArgs {
|
|
14
|
+
entryId: string;
|
|
15
|
+
parentCommentId?: string;
|
|
16
|
+
sort?: CommentSort;
|
|
17
|
+
}
|
|
18
|
+
export interface SearchEntriesArgs {
|
|
19
|
+
searchQuery: string;
|
|
20
|
+
kind?: EntryKind;
|
|
21
|
+
status?: EntryStatus;
|
|
22
|
+
limit?: number;
|
|
23
|
+
}
|
|
24
|
+
export interface SimilarEntriesArgs {
|
|
25
|
+
title: string;
|
|
26
|
+
body: string;
|
|
27
|
+
kind?: EntryKind;
|
|
28
|
+
limit?: number;
|
|
29
|
+
}
|
|
30
|
+
export declare function createFeedbackHooks(api: FeedbackPublicApi, options?: FeedbackHooksOptions): {
|
|
31
|
+
pageSizes: {
|
|
32
|
+
readonly entries: number;
|
|
33
|
+
readonly comments: number;
|
|
34
|
+
readonly replies: number;
|
|
35
|
+
};
|
|
36
|
+
useEntries(args?: UseEntriesArgs): import("convex/react").UsePaginatedQueryReturnType<import("convex/server").FunctionReference<"query", "public", {
|
|
37
|
+
paginationOpts: import("convex/server").PaginationOptions;
|
|
38
|
+
kind?: EntryKind;
|
|
39
|
+
status?: EntryStatus;
|
|
40
|
+
sort?: EntrySort;
|
|
41
|
+
}, import("convex/server").PaginationResult<{
|
|
42
|
+
updatedAt?: number | undefined;
|
|
43
|
+
id: string;
|
|
44
|
+
creationTime: number;
|
|
45
|
+
actorId: string;
|
|
46
|
+
kind: "feedback" | "feature_request" | "bug_report";
|
|
47
|
+
status: "open" | "under_review" | "planned" | "in_progress" | "completed" | "closed";
|
|
48
|
+
title: string;
|
|
49
|
+
body: string;
|
|
50
|
+
upvoteCount: number;
|
|
51
|
+
commentCount: number;
|
|
52
|
+
viewerHasUpvoted: boolean;
|
|
53
|
+
}>, string | undefined>>;
|
|
54
|
+
useEntry(entryId: string | null | undefined): {
|
|
55
|
+
updatedAt?: number | undefined;
|
|
56
|
+
id: string;
|
|
57
|
+
creationTime: number;
|
|
58
|
+
actorId: string;
|
|
59
|
+
kind: "feedback" | "feature_request" | "bug_report";
|
|
60
|
+
status: "open" | "under_review" | "planned" | "in_progress" | "completed" | "closed";
|
|
61
|
+
title: string;
|
|
62
|
+
body: string;
|
|
63
|
+
upvoteCount: number;
|
|
64
|
+
commentCount: number;
|
|
65
|
+
viewerHasUpvoted: boolean;
|
|
66
|
+
} | null | undefined;
|
|
67
|
+
useSearchEntries(args: SearchEntriesArgs): {
|
|
68
|
+
updatedAt?: number | undefined;
|
|
69
|
+
id: string;
|
|
70
|
+
creationTime: number;
|
|
71
|
+
actorId: string;
|
|
72
|
+
kind: "feedback" | "feature_request" | "bug_report";
|
|
73
|
+
status: "open" | "under_review" | "planned" | "in_progress" | "completed" | "closed";
|
|
74
|
+
title: string;
|
|
75
|
+
body: string;
|
|
76
|
+
upvoteCount: number;
|
|
77
|
+
commentCount: number;
|
|
78
|
+
viewerHasUpvoted: boolean;
|
|
79
|
+
}[] | undefined;
|
|
80
|
+
useSimilarEntries(args: SimilarEntriesArgs): {
|
|
81
|
+
exact: {
|
|
82
|
+
updatedAt?: number | undefined;
|
|
83
|
+
id: string;
|
|
84
|
+
creationTime: number;
|
|
85
|
+
actorId: string;
|
|
86
|
+
kind: "feedback" | "feature_request" | "bug_report";
|
|
87
|
+
status: "open" | "under_review" | "planned" | "in_progress" | "completed" | "closed";
|
|
88
|
+
title: string;
|
|
89
|
+
body: string;
|
|
90
|
+
upvoteCount: number;
|
|
91
|
+
commentCount: number;
|
|
92
|
+
viewerHasUpvoted: boolean;
|
|
93
|
+
}[];
|
|
94
|
+
similar: {
|
|
95
|
+
updatedAt?: number | undefined;
|
|
96
|
+
id: string;
|
|
97
|
+
creationTime: number;
|
|
98
|
+
actorId: string;
|
|
99
|
+
kind: "feedback" | "feature_request" | "bug_report";
|
|
100
|
+
status: "open" | "under_review" | "planned" | "in_progress" | "completed" | "closed";
|
|
101
|
+
title: string;
|
|
102
|
+
body: string;
|
|
103
|
+
upvoteCount: number;
|
|
104
|
+
commentCount: number;
|
|
105
|
+
viewerHasUpvoted: boolean;
|
|
106
|
+
}[];
|
|
107
|
+
} | undefined;
|
|
108
|
+
useComments(args: UseCommentsArgs): import("convex/react").UsePaginatedQueryReturnType<import("convex/server").FunctionReference<"query", "public", {
|
|
109
|
+
paginationOpts: import("convex/server").PaginationOptions;
|
|
110
|
+
entryId: string;
|
|
111
|
+
parentCommentId?: string;
|
|
112
|
+
sort?: CommentSort;
|
|
113
|
+
}, import("convex/server").PaginationResult<{
|
|
114
|
+
updatedAt?: number | undefined;
|
|
115
|
+
parentCommentId?: string | undefined;
|
|
116
|
+
deletedAt?: number | undefined;
|
|
117
|
+
id: string;
|
|
118
|
+
creationTime: number;
|
|
119
|
+
actorId: string;
|
|
120
|
+
body: string | null;
|
|
121
|
+
entryId: string;
|
|
122
|
+
depth: number;
|
|
123
|
+
likeCount: number;
|
|
124
|
+
replyCount: number;
|
|
125
|
+
viewerHasLiked: boolean;
|
|
126
|
+
}>, string | undefined>>;
|
|
127
|
+
useCreateEntry(): import("convex/react").ReactMutation<import("convex/server").FunctionReference<"mutation", "public", {
|
|
128
|
+
kind: EntryKind;
|
|
129
|
+
title: string;
|
|
130
|
+
body: string;
|
|
131
|
+
}, string, string | undefined>>;
|
|
132
|
+
useUpdateEntry(): import("convex/react").ReactMutation<import("convex/server").FunctionReference<"mutation", "public", {
|
|
133
|
+
entryId: string;
|
|
134
|
+
title: string;
|
|
135
|
+
body: string;
|
|
136
|
+
}, null, string | undefined>>;
|
|
137
|
+
useSetEntryStatus(): import("convex/react").ReactMutation<import("convex/server").FunctionReference<"mutation", "public", {
|
|
138
|
+
entryId: string;
|
|
139
|
+
status: EntryStatus;
|
|
140
|
+
}, null, string | undefined>>;
|
|
141
|
+
useSetEntryUpvote(): import("convex/react").ReactMutation<import("convex/server").FunctionReference<"mutation", "public", {
|
|
142
|
+
entryId: string;
|
|
143
|
+
desiredState: boolean;
|
|
144
|
+
}, {
|
|
145
|
+
active: boolean;
|
|
146
|
+
upvoteCount: number;
|
|
147
|
+
}, string | undefined>>;
|
|
148
|
+
useCreateComment(): import("convex/react").ReactMutation<import("convex/server").FunctionReference<"mutation", "public", {
|
|
149
|
+
entryId: string;
|
|
150
|
+
parentCommentId?: string;
|
|
151
|
+
body: string;
|
|
152
|
+
}, string, string | undefined>>;
|
|
153
|
+
useUpdateComment(): import("convex/react").ReactMutation<import("convex/server").FunctionReference<"mutation", "public", {
|
|
154
|
+
commentId: string;
|
|
155
|
+
body: string;
|
|
156
|
+
}, null, string | undefined>>;
|
|
157
|
+
useDeleteComment(): import("convex/react").ReactMutation<import("convex/server").FunctionReference<"mutation", "public", {
|
|
158
|
+
commentId: string;
|
|
159
|
+
}, null, string | undefined>>;
|
|
160
|
+
useSetCommentLike(): import("convex/react").ReactMutation<import("convex/server").FunctionReference<"mutation", "public", {
|
|
161
|
+
commentId: string;
|
|
162
|
+
desiredState: boolean;
|
|
163
|
+
}, {
|
|
164
|
+
active: boolean;
|
|
165
|
+
likeCount: number;
|
|
166
|
+
}, string | undefined>>;
|
|
167
|
+
};
|
|
168
|
+
export type FeedbackHooks = ReturnType<typeof createFeedbackHooks>;
|
|
169
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EACV,WAAW,EACX,SAAS,EACT,SAAS,EACT,WAAW,EACZ,MAAM,uBAAuB,CAAC;AAE/B,MAAM,WAAW,oBAAoB;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAQD,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,iBAAiB,EACtB,OAAO,GAAE,oBAAyB;;;;;;sBAaf,cAAc;;;;;;;;;;;;;;;;;;sBAMb,MAAM,GAAG,IAAI,GAAG,SAAS;;;;;;;;;;;;;2BAOpB,iBAAiB;;;;;;;;;;;;;4BAShB,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAUxB,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuCpC;AAED,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { usePaginatedQuery } from "convex-helpers/react";
|
|
3
|
+
import { useMutation, useQuery } from "convex/react";
|
|
4
|
+
function positivePageSize(value, fallback) {
|
|
5
|
+
return value !== undefined && Number.isInteger(value) && value > 0
|
|
6
|
+
? value
|
|
7
|
+
: fallback;
|
|
8
|
+
}
|
|
9
|
+
export function createFeedbackHooks(api, options = {}) {
|
|
10
|
+
const entryPageSize = positivePageSize(options.entryPageSize, 20);
|
|
11
|
+
const commentPageSize = positivePageSize(options.commentPageSize, 20);
|
|
12
|
+
const replyPageSize = positivePageSize(options.replyPageSize, 10);
|
|
13
|
+
return {
|
|
14
|
+
pageSizes: {
|
|
15
|
+
entries: entryPageSize,
|
|
16
|
+
comments: commentPageSize,
|
|
17
|
+
replies: replyPageSize,
|
|
18
|
+
},
|
|
19
|
+
useEntries(args = {}) {
|
|
20
|
+
return usePaginatedQuery(api.listEntries, args, {
|
|
21
|
+
initialNumItems: entryPageSize,
|
|
22
|
+
});
|
|
23
|
+
},
|
|
24
|
+
useEntry(entryId) {
|
|
25
|
+
return useQuery(api.getEntry, entryId === null || entryId === undefined ? "skip" : { entryId });
|
|
26
|
+
},
|
|
27
|
+
useSearchEntries(args) {
|
|
28
|
+
const searchQuery = args.searchQuery.trim();
|
|
29
|
+
const result = useQuery(api.searchEntries, searchQuery.length === 0 ? "skip" : { ...args, searchQuery });
|
|
30
|
+
return searchQuery.length === 0 ? [] : result;
|
|
31
|
+
},
|
|
32
|
+
useSimilarEntries(args) {
|
|
33
|
+
const shouldSkip = args.title.trim().length === 0 && args.body.trim().length === 0;
|
|
34
|
+
const result = useQuery(api.findSimilarEntries, shouldSkip ? "skip" : args);
|
|
35
|
+
return shouldSkip ? { exact: [], similar: [] } : result;
|
|
36
|
+
},
|
|
37
|
+
useComments(args) {
|
|
38
|
+
return usePaginatedQuery(api.listComments, args, {
|
|
39
|
+
initialNumItems: args.parentCommentId === undefined ? commentPageSize : replyPageSize,
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
useCreateEntry() {
|
|
43
|
+
return useMutation(api.createEntry);
|
|
44
|
+
},
|
|
45
|
+
useUpdateEntry() {
|
|
46
|
+
return useMutation(api.updateEntry);
|
|
47
|
+
},
|
|
48
|
+
useSetEntryStatus() {
|
|
49
|
+
return useMutation(api.setEntryStatus);
|
|
50
|
+
},
|
|
51
|
+
useSetEntryUpvote() {
|
|
52
|
+
return useMutation(api.setEntryUpvote);
|
|
53
|
+
},
|
|
54
|
+
useCreateComment() {
|
|
55
|
+
return useMutation(api.createComment);
|
|
56
|
+
},
|
|
57
|
+
useUpdateComment() {
|
|
58
|
+
return useMutation(api.updateComment);
|
|
59
|
+
},
|
|
60
|
+
useDeleteComment() {
|
|
61
|
+
return useMutation(api.deleteComment);
|
|
62
|
+
},
|
|
63
|
+
useSetCommentLike() {
|
|
64
|
+
return useMutation(api.setCommentLike);
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AA0CrD,SAAS,gBAAgB,CAAC,KAAyB,EAAE,QAAgB;IACnE,OAAO,KAAK,KAAK,SAAS,IAAI,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC;QAChE,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,QAAQ,CAAC;AACf,CAAC;AAED,MAAM,UAAU,mBAAmB,CACjC,GAAsB,EACtB,UAAgC,EAAE;IAElC,MAAM,aAAa,GAAG,gBAAgB,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;IAClE,MAAM,eAAe,GAAG,gBAAgB,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;IACtE,MAAM,aAAa,GAAG,gBAAgB,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAA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,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;QAC1D,CAAC;QAED,WAAW,CAAC,IAAqB;YAC/B,OAAO,iBAAiB,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,EAAE;gBAC/C,eAAe,EACb,IAAI,CAAC,eAAe,KAAK,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,aAAa;aACvE,CAAC,CAAC;QACL,CAAC;QAED,cAAc;YACZ,OAAO,WAAW,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACtC,CAAC;QAED,cAAc;YACZ,OAAO,WAAW,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACtC,CAAC;QAED,iBAAiB;YACf,OAAO,WAAW,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QACzC,CAAC;QAED,iBAAiB;YACf,OAAO,WAAW,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QACzC,CAAC;QAED,gBAAgB;YACd,OAAO,WAAW,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QACxC,CAAC;QAED,gBAAgB;YACd,OAAO,WAAW,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QACxC,CAAC;QAED,gBAAgB;YACd,OAAO,WAAW,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QACxC,CAAC;QAED,iBAAiB;YACf,OAAO,WAAW,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QACzC,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/test.d.ts
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { TestConvex } from "convex-test";
|
|
2
|
+
import type { GenericSchema, SchemaDefinition } from "convex/server";
|
|
3
|
+
import schema from "./component/schema.js";
|
|
4
|
+
declare const modules: Record<string, () => Promise<unknown>>;
|
|
5
|
+
export declare function register(test: TestConvex<SchemaDefinition<GenericSchema, boolean>>, name?: string): void;
|
|
6
|
+
export { schema, modules };
|
|
7
|
+
declare const _default: {
|
|
8
|
+
register: typeof register;
|
|
9
|
+
schema: SchemaDefinition<{
|
|
10
|
+
entries: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
11
|
+
updatedAt?: number | undefined;
|
|
12
|
+
actorId: string;
|
|
13
|
+
kind: "feedback" | "feature_request" | "bug_report";
|
|
14
|
+
status: "open" | "under_review" | "planned" | "in_progress" | "completed" | "closed";
|
|
15
|
+
title: string;
|
|
16
|
+
body: string;
|
|
17
|
+
upvoteCount: number;
|
|
18
|
+
commentCount: number;
|
|
19
|
+
normalizedTitle: string;
|
|
20
|
+
searchText: string;
|
|
21
|
+
}, {
|
|
22
|
+
actorId: import("convex/values").VString<string, "required">;
|
|
23
|
+
kind: import("convex/values").VUnion<"feedback" | "feature_request" | "bug_report", [import("convex/values").VLiteral<"feedback", "required">, import("convex/values").VLiteral<"feature_request", "required">, import("convex/values").VLiteral<"bug_report", "required">], "required", never>;
|
|
24
|
+
status: import("convex/values").VUnion<"open" | "under_review" | "planned" | "in_progress" | "completed" | "closed", [import("convex/values").VLiteral<"open", "required">, import("convex/values").VLiteral<"under_review", "required">, import("convex/values").VLiteral<"planned", "required">, import("convex/values").VLiteral<"in_progress", "required">, import("convex/values").VLiteral<"completed", "required">, import("convex/values").VLiteral<"closed", "required">], "required", never>;
|
|
25
|
+
title: import("convex/values").VString<string, "required">;
|
|
26
|
+
body: import("convex/values").VString<string, "required">;
|
|
27
|
+
normalizedTitle: import("convex/values").VString<string, "required">;
|
|
28
|
+
searchText: import("convex/values").VString<string, "required">;
|
|
29
|
+
upvoteCount: import("convex/values").VFloat64<number, "required">;
|
|
30
|
+
commentCount: import("convex/values").VFloat64<number, "required">;
|
|
31
|
+
updatedAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
32
|
+
}, "required", "actorId" | "kind" | "status" | "title" | "body" | "upvoteCount" | "commentCount" | "updatedAt" | "normalizedTitle" | "searchText">, {
|
|
33
|
+
by_kind: ["kind", "_creationTime"];
|
|
34
|
+
by_status: ["status", "_creationTime"];
|
|
35
|
+
by_kind_status: ["kind", "status", "_creationTime"];
|
|
36
|
+
by_upvotes: ["upvoteCount", "_creationTime"];
|
|
37
|
+
by_kind_upvotes: ["kind", "upvoteCount", "_creationTime"];
|
|
38
|
+
by_status_upvotes: ["status", "upvoteCount", "_creationTime"];
|
|
39
|
+
by_kind_status_upvotes: ["kind", "status", "upvoteCount", "_creationTime"];
|
|
40
|
+
by_normalized_title: ["normalizedTitle", "_creationTime"];
|
|
41
|
+
by_kind_normalized_title: ["kind", "normalizedTitle", "_creationTime"];
|
|
42
|
+
}, {
|
|
43
|
+
search: {
|
|
44
|
+
searchField: "searchText";
|
|
45
|
+
filterFields: "kind" | "status";
|
|
46
|
+
};
|
|
47
|
+
}, {}>;
|
|
48
|
+
comments: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
49
|
+
updatedAt?: number | undefined;
|
|
50
|
+
parentCommentId?: import("convex/values").GenericId<"comments"> | undefined;
|
|
51
|
+
deletedAt?: number | undefined;
|
|
52
|
+
actorId: string;
|
|
53
|
+
body: string;
|
|
54
|
+
entryId: import("convex/values").GenericId<"entries">;
|
|
55
|
+
depth: number;
|
|
56
|
+
likeCount: number;
|
|
57
|
+
replyCount: number;
|
|
58
|
+
}, {
|
|
59
|
+
entryId: import("convex/values").VId<import("convex/values").GenericId<"entries">, "required">;
|
|
60
|
+
parentCommentId: import("convex/values").VId<import("convex/values").GenericId<"comments"> | undefined, "optional">;
|
|
61
|
+
actorId: import("convex/values").VString<string, "required">;
|
|
62
|
+
depth: import("convex/values").VFloat64<number, "required">;
|
|
63
|
+
body: import("convex/values").VString<string, "required">;
|
|
64
|
+
likeCount: import("convex/values").VFloat64<number, "required">;
|
|
65
|
+
replyCount: import("convex/values").VFloat64<number, "required">;
|
|
66
|
+
updatedAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
67
|
+
deletedAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
68
|
+
}, "required", "actorId" | "body" | "updatedAt" | "entryId" | "parentCommentId" | "depth" | "likeCount" | "replyCount" | "deletedAt">, {
|
|
69
|
+
by_entry_parent: ["entryId", "parentCommentId", "_creationTime"];
|
|
70
|
+
by_entry_parent_likes: ["entryId", "parentCommentId", "likeCount", "_creationTime"];
|
|
71
|
+
}, {}, {}>;
|
|
72
|
+
reactions: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
73
|
+
entryId?: import("convex/values").GenericId<"entries"> | undefined;
|
|
74
|
+
commentId?: import("convex/values").GenericId<"comments"> | undefined;
|
|
75
|
+
actorId: string;
|
|
76
|
+
}, {
|
|
77
|
+
actorId: import("convex/values").VString<string, "required">;
|
|
78
|
+
entryId: import("convex/values").VId<import("convex/values").GenericId<"entries"> | undefined, "optional">;
|
|
79
|
+
commentId: import("convex/values").VId<import("convex/values").GenericId<"comments"> | undefined, "optional">;
|
|
80
|
+
}, "required", "actorId" | "entryId" | "commentId">, {
|
|
81
|
+
by_entry_actor: ["entryId", "actorId", "_creationTime"];
|
|
82
|
+
by_comment_actor: ["commentId", "actorId", "_creationTime"];
|
|
83
|
+
}, {}, {}>;
|
|
84
|
+
}, true>;
|
|
85
|
+
modules: Record<string, () => Promise<unknown>>;
|
|
86
|
+
};
|
|
87
|
+
export default _default;
|
|
88
|
+
//# sourceMappingURL=test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAErE,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAE3C,QAAA,MAAM,OAAO,wCAA0C,CAAC;AAExD,wBAAgB,QAAQ,CACtB,IAAI,EAAE,UAAU,CAAC,gBAAgB,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,EAC1D,IAAI,SAAa,GAChB,IAAI,CAEN;AAED,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAC3B,wBAA6C"}
|
package/dist/test.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
2
|
+
import schema from "./component/schema.js";
|
|
3
|
+
const modules = import.meta.glob("./component/**/*.ts");
|
|
4
|
+
export function register(test, name = "feedback") {
|
|
5
|
+
test.registerComponent(name, schema, modules);
|
|
6
|
+
}
|
|
7
|
+
export { schema, modules };
|
|
8
|
+
export default { register, schema, modules };
|
|
9
|
+
//# sourceMappingURL=test.js.map
|
package/dist/test.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test.js","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":"AAAA,qCAAqC;AAKrC,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAE3C,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;AAExD,MAAM,UAAU,QAAQ,CACtB,IAA0D,EAC1D,IAAI,GAAG,UAAU;IAEjB,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAC3B,eAAe,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "convex-feedback",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Type-safe Convex component for feedback, feature requests, bug reports, voting, comments, and duplicate search.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"src"
|
|
11
|
+
],
|
|
12
|
+
"exports": {
|
|
13
|
+
"./package.json": "./package.json",
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/client/index.d.ts",
|
|
16
|
+
"default": "./dist/client/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./react": {
|
|
19
|
+
"types": "./dist/react/index.d.ts",
|
|
20
|
+
"default": "./dist/react/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./_generated/component": {
|
|
23
|
+
"types": "./dist/component/_generated/component.d.ts"
|
|
24
|
+
},
|
|
25
|
+
"./_generated/component.js": {
|
|
26
|
+
"types": "./dist/component/_generated/component.d.ts"
|
|
27
|
+
},
|
|
28
|
+
"./test": "./src/test.ts",
|
|
29
|
+
"./convex.config": {
|
|
30
|
+
"types": "./dist/component/convex.config.d.ts",
|
|
31
|
+
"default": "./dist/component/convex.config.js"
|
|
32
|
+
},
|
|
33
|
+
"./convex.config.js": {
|
|
34
|
+
"types": "./dist/component/convex.config.d.ts",
|
|
35
|
+
"default": "./dist/component/convex.config.js"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"codegen": "npx convex codegen --component-dir ./src/component",
|
|
40
|
+
"build": "tsc -p tsconfig.build.json",
|
|
41
|
+
"build:codegen": "npm run codegen && npm run build",
|
|
42
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
43
|
+
"lint": "eslint src test",
|
|
44
|
+
"test": "vitest run",
|
|
45
|
+
"test:all": "npm run typecheck && npm run lint && npm run test",
|
|
46
|
+
"prepack": "npm run build:codegen"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"convex": "^1.43.0",
|
|
50
|
+
"convex-helpers": "^0.1.120",
|
|
51
|
+
"react": "^18.3.1 || ^19.0.0"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"convex": "^1.44.0",
|
|
55
|
+
"convex-helpers": "^0.1.120",
|
|
56
|
+
"convex-test": "^0.0.55",
|
|
57
|
+
"react": "^19.2.8",
|
|
58
|
+
"@types/react": "^19.2.18",
|
|
59
|
+
"@edge-runtime/vm": "^5.0.0"
|
|
60
|
+
},
|
|
61
|
+
"types": "./dist/client/index.d.ts",
|
|
62
|
+
"module": "./dist/client/index.js"
|
|
63
|
+
}
|