convex-feedback 0.1.3 → 0.1.4

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.
Files changed (39) hide show
  1. package/README.md +16 -0
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/client/api.d.ts +3 -1
  4. package/dist/client/api.d.ts.map +1 -1
  5. package/dist/client/index.d.ts +1 -1
  6. package/dist/client/index.d.ts.map +1 -1
  7. package/dist/client/index.js +4 -1
  8. package/dist/client/index.js.map +1 -1
  9. package/dist/component/_generated/component.d.ts +25 -0
  10. package/dist/component/_generated/component.d.ts.map +1 -1
  11. package/dist/component/comments.d.ts +10 -10
  12. package/dist/component/entries.d.ts +53 -28
  13. package/dist/component/entries.d.ts.map +1 -1
  14. package/dist/component/entries.js +7 -3
  15. package/dist/component/entries.js.map +1 -1
  16. package/dist/component/helpers.d.ts +2 -1
  17. package/dist/component/helpers.d.ts.map +1 -1
  18. package/dist/component/helpers.js +46 -1
  19. package/dist/component/helpers.js.map +1 -1
  20. package/dist/component/model.d.ts +70 -3
  21. package/dist/component/model.d.ts.map +1 -1
  22. package/dist/component/model.js +7 -0
  23. package/dist/component/model.js.map +1 -1
  24. package/dist/component/schema.d.ts +12 -1
  25. package/dist/component/schema.d.ts.map +1 -1
  26. package/dist/component/schema.js +2 -1
  27. package/dist/component/schema.js.map +1 -1
  28. package/dist/react/index.d.ts +22 -2
  29. package/dist/react/index.d.ts.map +1 -1
  30. package/dist/test.d.ts +12 -1
  31. package/dist/test.d.ts.map +1 -1
  32. package/package.json +1 -1
  33. package/src/client/api.ts +4 -0
  34. package/src/client/index.ts +6 -0
  35. package/src/component/_generated/component.ts +29 -1
  36. package/src/component/entries.ts +12 -1
  37. package/src/component/helpers.ts +70 -0
  38. package/src/component/model.ts +30 -0
  39. package/src/component/schema.ts +6 -1
@@ -10,8 +10,21 @@ export declare const actorValidator: import("convex/values").VObject<{
10
10
  id: import("convex/values").VString<string, "required">;
11
11
  isModerator: import("convex/values").VBoolean<boolean, "required">;
12
12
  }, "required", "id" | "isModerator">;
13
+ export declare const feedbackMetadataValueValidator: import("convex/values").VUnion<string | number | boolean, [import("convex/values").VString<string, "required">, import("convex/values").VFloat64<number, "required">, import("convex/values").VBoolean<boolean, "required">], "required", never>;
14
+ export declare const feedbackMetadataRecordValidator: import("convex/values").VRecord<Record<string, string | number | boolean>, import("convex/values").VString<string, "required">, import("convex/values").VUnion<string | number | boolean, [import("convex/values").VString<string, "required">, import("convex/values").VFloat64<number, "required">, import("convex/values").VBoolean<boolean, "required">], "required", never>, "required", string>;
15
+ export declare const feedbackMetadataValidator: import("convex/values").VObject<{
16
+ standard?: Record<string, string | number | boolean> | undefined;
17
+ additional?: Record<string, string | number | boolean> | undefined;
18
+ }, {
19
+ standard: import("convex/values").VRecord<Record<string, string | number | boolean> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VUnion<string | number | boolean, [import("convex/values").VString<string, "required">, import("convex/values").VFloat64<number, "required">, import("convex/values").VBoolean<boolean, "required">], "required", never>, "optional", string>;
20
+ additional: import("convex/values").VRecord<Record<string, string | number | boolean> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VUnion<string | number | boolean, [import("convex/values").VString<string, "required">, import("convex/values").VFloat64<number, "required">, import("convex/values").VBoolean<boolean, "required">], "required", never>, "optional", string>;
21
+ }, "required", "standard" | "additional" | `standard.${string}` | `additional.${string}`>;
13
22
  export declare const publicEntryValidator: import("convex/values").VObject<{
14
23
  updatedAt?: number | undefined;
24
+ metadata?: {
25
+ standard?: Record<string, string | number | boolean> | undefined;
26
+ additional?: Record<string, string | number | boolean> | undefined;
27
+ } | undefined;
15
28
  id: string;
16
29
  creationTime: number;
17
30
  actorId: string;
@@ -34,7 +47,14 @@ export declare const publicEntryValidator: import("convex/values").VObject<{
34
47
  commentCount: import("convex/values").VFloat64<number, "required">;
35
48
  updatedAt: import("convex/values").VFloat64<number | undefined, "optional">;
36
49
  viewerHasUpvoted: import("convex/values").VBoolean<boolean, "required">;
37
- }, "required", "id" | "creationTime" | "actorId" | "kind" | "status" | "title" | "body" | "upvoteCount" | "commentCount" | "updatedAt" | "viewerHasUpvoted">;
50
+ metadata: import("convex/values").VObject<{
51
+ standard?: Record<string, string | number | boolean> | undefined;
52
+ additional?: Record<string, string | number | boolean> | undefined;
53
+ } | undefined, {
54
+ standard: import("convex/values").VRecord<Record<string, string | number | boolean> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VUnion<string | number | boolean, [import("convex/values").VString<string, "required">, import("convex/values").VFloat64<number, "required">, import("convex/values").VBoolean<boolean, "required">], "required", never>, "optional", string>;
55
+ additional: import("convex/values").VRecord<Record<string, string | number | boolean> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VUnion<string | number | boolean, [import("convex/values").VString<string, "required">, import("convex/values").VFloat64<number, "required">, import("convex/values").VBoolean<boolean, "required">], "required", never>, "optional", string>;
56
+ }, "optional", "standard" | "additional" | `standard.${string}` | `additional.${string}`>;
57
+ }, "required", "id" | "creationTime" | "actorId" | "kind" | "status" | "title" | "body" | "upvoteCount" | "commentCount" | "updatedAt" | "viewerHasUpvoted" | "metadata" | "metadata.standard" | "metadata.additional" | `metadata.standard.${string}` | `metadata.additional.${string}`>;
38
58
  export declare const publicCommentValidator: import("convex/values").VObject<{
39
59
  updatedAt?: number | undefined;
40
60
  parentCommentId?: string | undefined;
@@ -65,6 +85,10 @@ export declare const publicCommentValidator: import("convex/values").VObject<{
65
85
  export declare const similarEntriesValidator: import("convex/values").VObject<{
66
86
  exact: {
67
87
  updatedAt?: number | undefined;
88
+ metadata?: {
89
+ standard?: Record<string, string | number | boolean> | undefined;
90
+ additional?: Record<string, string | number | boolean> | undefined;
91
+ } | undefined;
68
92
  id: string;
69
93
  creationTime: number;
70
94
  actorId: string;
@@ -78,6 +102,10 @@ export declare const similarEntriesValidator: import("convex/values").VObject<{
78
102
  }[];
79
103
  similar: {
80
104
  updatedAt?: number | undefined;
105
+ metadata?: {
106
+ standard?: Record<string, string | number | boolean> | undefined;
107
+ additional?: Record<string, string | number | boolean> | undefined;
108
+ } | undefined;
81
109
  id: string;
82
110
  creationTime: number;
83
111
  actorId: string;
@@ -92,6 +120,10 @@ export declare const similarEntriesValidator: import("convex/values").VObject<{
92
120
  }, {
93
121
  exact: import("convex/values").VArray<{
94
122
  updatedAt?: number | undefined;
123
+ metadata?: {
124
+ standard?: Record<string, string | number | boolean> | undefined;
125
+ additional?: Record<string, string | number | boolean> | undefined;
126
+ } | undefined;
95
127
  id: string;
96
128
  creationTime: number;
97
129
  actorId: string;
@@ -104,6 +136,10 @@ export declare const similarEntriesValidator: import("convex/values").VObject<{
104
136
  viewerHasUpvoted: boolean;
105
137
  }[], import("convex/values").VObject<{
106
138
  updatedAt?: number | undefined;
139
+ metadata?: {
140
+ standard?: Record<string, string | number | boolean> | undefined;
141
+ additional?: Record<string, string | number | boolean> | undefined;
142
+ } | undefined;
107
143
  id: string;
108
144
  creationTime: number;
109
145
  actorId: string;
@@ -126,9 +162,20 @@ export declare const similarEntriesValidator: import("convex/values").VObject<{
126
162
  commentCount: import("convex/values").VFloat64<number, "required">;
127
163
  updatedAt: import("convex/values").VFloat64<number | undefined, "optional">;
128
164
  viewerHasUpvoted: import("convex/values").VBoolean<boolean, "required">;
129
- }, "required", "id" | "creationTime" | "actorId" | "kind" | "status" | "title" | "body" | "upvoteCount" | "commentCount" | "updatedAt" | "viewerHasUpvoted">, "required">;
165
+ metadata: import("convex/values").VObject<{
166
+ standard?: Record<string, string | number | boolean> | undefined;
167
+ additional?: Record<string, string | number | boolean> | undefined;
168
+ } | undefined, {
169
+ standard: import("convex/values").VRecord<Record<string, string | number | boolean> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VUnion<string | number | boolean, [import("convex/values").VString<string, "required">, import("convex/values").VFloat64<number, "required">, import("convex/values").VBoolean<boolean, "required">], "required", never>, "optional", string>;
170
+ additional: import("convex/values").VRecord<Record<string, string | number | boolean> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VUnion<string | number | boolean, [import("convex/values").VString<string, "required">, import("convex/values").VFloat64<number, "required">, import("convex/values").VBoolean<boolean, "required">], "required", never>, "optional", string>;
171
+ }, "optional", "standard" | "additional" | `standard.${string}` | `additional.${string}`>;
172
+ }, "required", "id" | "creationTime" | "actorId" | "kind" | "status" | "title" | "body" | "upvoteCount" | "commentCount" | "updatedAt" | "viewerHasUpvoted" | "metadata" | "metadata.standard" | "metadata.additional" | `metadata.standard.${string}` | `metadata.additional.${string}`>, "required">;
130
173
  similar: import("convex/values").VArray<{
131
174
  updatedAt?: number | undefined;
175
+ metadata?: {
176
+ standard?: Record<string, string | number | boolean> | undefined;
177
+ additional?: Record<string, string | number | boolean> | undefined;
178
+ } | undefined;
132
179
  id: string;
133
180
  creationTime: number;
134
181
  actorId: string;
@@ -141,6 +188,10 @@ export declare const similarEntriesValidator: import("convex/values").VObject<{
141
188
  viewerHasUpvoted: boolean;
142
189
  }[], import("convex/values").VObject<{
143
190
  updatedAt?: number | undefined;
191
+ metadata?: {
192
+ standard?: Record<string, string | number | boolean> | undefined;
193
+ additional?: Record<string, string | number | boolean> | undefined;
194
+ } | undefined;
144
195
  id: string;
145
196
  creationTime: number;
146
197
  actorId: string;
@@ -163,7 +214,14 @@ export declare const similarEntriesValidator: import("convex/values").VObject<{
163
214
  commentCount: import("convex/values").VFloat64<number, "required">;
164
215
  updatedAt: import("convex/values").VFloat64<number | undefined, "optional">;
165
216
  viewerHasUpvoted: import("convex/values").VBoolean<boolean, "required">;
166
- }, "required", "id" | "creationTime" | "actorId" | "kind" | "status" | "title" | "body" | "upvoteCount" | "commentCount" | "updatedAt" | "viewerHasUpvoted">, "required">;
217
+ metadata: import("convex/values").VObject<{
218
+ standard?: Record<string, string | number | boolean> | undefined;
219
+ additional?: Record<string, string | number | boolean> | undefined;
220
+ } | undefined, {
221
+ standard: import("convex/values").VRecord<Record<string, string | number | boolean> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VUnion<string | number | boolean, [import("convex/values").VString<string, "required">, import("convex/values").VFloat64<number, "required">, import("convex/values").VBoolean<boolean, "required">], "required", never>, "optional", string>;
222
+ additional: import("convex/values").VRecord<Record<string, string | number | boolean> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VUnion<string | number | boolean, [import("convex/values").VString<string, "required">, import("convex/values").VFloat64<number, "required">, import("convex/values").VBoolean<boolean, "required">], "required", never>, "optional", string>;
223
+ }, "optional", "standard" | "additional" | `standard.${string}` | `additional.${string}`>;
224
+ }, "required", "id" | "creationTime" | "actorId" | "kind" | "status" | "title" | "body" | "upvoteCount" | "commentCount" | "updatedAt" | "viewerHasUpvoted" | "metadata" | "metadata.standard" | "metadata.additional" | `metadata.standard.${string}` | `metadata.additional.${string}`>, "required">;
167
225
  }, "required", "exact" | "similar">;
168
226
  /**
169
227
  * Category of feedback represented by an entry.
@@ -213,6 +271,10 @@ export type CommentSort = Infer<typeof commentSortValidator>;
213
271
  * status or modifying content they do not own.
214
272
  */
215
273
  export type FeedbackActor = Infer<typeof actorValidator>;
274
+ /** Scalar value accepted in entry diagnostic metadata. */
275
+ export type FeedbackMetadataValue = Infer<typeof feedbackMetadataValueValidator>;
276
+ /** Flat metadata values grouped by their source. */
277
+ export type FeedbackMetadata = Infer<typeof feedbackMetadataValidator>;
216
278
  /**
217
279
  * Public representation of a feedback, feature-request, or bug-report entry.
218
280
  *
@@ -251,6 +313,11 @@ export type FeedbackActor = Infer<typeof actorValidator>;
251
313
  * @property viewerHasUpvoted
252
314
  * Whether the actor associated with the current query has upvoted the entry.
253
315
  * `false` when no viewer actor is available.
316
+ *
317
+ * @property metadata
318
+ * Creation-time diagnostic metadata. Present only when `getEntry` is queried
319
+ * by a moderator. Ordinary entry lists, searches, and non-moderator reads omit
320
+ * this property.
254
321
  */
255
322
  export type FeedbackEntry = Infer<typeof publicEntryValidator>;
256
323
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/component/model.ts"],"names":[],"mappings":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;;;GAOG;AACH,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAE7D;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEzD,0DAA0D;AAC1D,MAAM,MAAM,qBAAqB,GAAG,KAAK,CACvC,OAAO,8BAA8B,CACtC,CAAC;AAEF,oDAAoD;AACpD,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAEvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,oBAAoB,GAAG,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
@@ -7,6 +7,12 @@ export const actorValidator = v.object({
7
7
  id: v.string(),
8
8
  isModerator: v.boolean(),
9
9
  });
10
+ export const feedbackMetadataValueValidator = v.union(v.string(), v.number(), v.boolean());
11
+ export const feedbackMetadataRecordValidator = v.record(v.string(), feedbackMetadataValueValidator);
12
+ export const feedbackMetadataValidator = v.object({
13
+ standard: v.optional(feedbackMetadataRecordValidator),
14
+ additional: v.optional(feedbackMetadataRecordValidator),
15
+ });
10
16
  export const publicEntryValidator = v.object({
11
17
  id: v.string(),
12
18
  creationTime: v.number(),
@@ -19,6 +25,7 @@ export const publicEntryValidator = v.object({
19
25
  commentCount: v.number(),
20
26
  updatedAt: v.optional(v.number()),
21
27
  viewerHasUpvoted: v.boolean(),
28
+ metadata: v.optional(feedbackMetadataValidator),
22
29
  });
23
30
  export const publicCommentValidator = v.object({
24
31
  id: v.string(),
@@ -1 +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,UAAU,CAAC,EACrB,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAC5B,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,CACxB,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CACzC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EACjB,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,EACzB,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EACpB,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,EACxB,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,EACtB,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CACpB,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CACvC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAChB,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CACpB,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CACzC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAChB,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EACnB,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CACpB,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,WAAW,EAAE,CAAC,CAAC,OAAO,EAAE;CACzB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAA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,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,eAAe,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACvC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACnC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACjC,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACjC,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE;CAC5B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC;IACpC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC;CACvC,CAAC,CAAC"}
@@ -1,6 +1,10 @@
1
1
  declare const schema: import("convex/server").SchemaDefinition<{
2
2
  entries: import("convex/server").TableDefinition<import("convex/values").VObject<{
3
3
  updatedAt?: number | undefined;
4
+ metadata?: {
5
+ standard?: Record<string, string | number | boolean> | undefined;
6
+ additional?: Record<string, string | number | boolean> | undefined;
7
+ } | undefined;
4
8
  actorId: string;
5
9
  kind: "feedback" | "feature_request" | "bug_report";
6
10
  status: "open" | "under_review" | "planned" | "in_progress" | "completed" | "closed";
@@ -21,7 +25,14 @@ declare const schema: import("convex/server").SchemaDefinition<{
21
25
  upvoteCount: import("convex/values").VFloat64<number, "required">;
22
26
  commentCount: import("convex/values").VFloat64<number, "required">;
23
27
  updatedAt: import("convex/values").VFloat64<number | undefined, "optional">;
24
- }, "required", "actorId" | "kind" | "status" | "title" | "body" | "upvoteCount" | "commentCount" | "updatedAt" | "normalizedTitle" | "searchText">, {
28
+ metadata: import("convex/values").VObject<{
29
+ standard?: Record<string, string | number | boolean> | undefined;
30
+ additional?: Record<string, string | number | boolean> | undefined;
31
+ } | undefined, {
32
+ standard: import("convex/values").VRecord<Record<string, string | number | boolean> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VUnion<string | number | boolean, [import("convex/values").VString<string, "required">, import("convex/values").VFloat64<number, "required">, import("convex/values").VBoolean<boolean, "required">], "required", never>, "optional", string>;
33
+ additional: import("convex/values").VRecord<Record<string, string | number | boolean> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VUnion<string | number | boolean, [import("convex/values").VString<string, "required">, import("convex/values").VFloat64<number, "required">, import("convex/values").VBoolean<boolean, "required">], "required", never>, "optional", string>;
34
+ }, "optional", "standard" | "additional" | `standard.${string}` | `additional.${string}`>;
35
+ }, "required", "actorId" | "kind" | "status" | "title" | "body" | "upvoteCount" | "commentCount" | "updatedAt" | "metadata" | "metadata.standard" | "metadata.additional" | `metadata.standard.${string}` | `metadata.additional.${string}` | "normalizedTitle" | "searchText">, {
25
36
  by_kind: ["kind", "_creationTime"];
26
37
  by_status: ["status", "_creationTime"];
27
38
  by_kind_status: ["kind", "status", "_creationTime"];
@@ -1 +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"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/component/schema.ts"],"names":[],"mappings":"AASA,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAqDV,CAAC;AAEH,eAAe,MAAM,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { defineSchema, defineTable } from "convex/server";
2
2
  import { v } from "convex/values";
3
- import { entryKindValidator, entryStatusValidator } from "./model.js";
3
+ import { entryKindValidator, entryStatusValidator, feedbackMetadataValidator, } from "./model.js";
4
4
  const schema = defineSchema({
5
5
  entries: defineTable({
6
6
  actorId: v.string(),
@@ -13,6 +13,7 @@ const schema = defineSchema({
13
13
  upvoteCount: v.number(),
14
14
  commentCount: v.number(),
15
15
  updatedAt: v.optional(v.number()),
16
+ metadata: v.optional(feedbackMetadataValidator),
16
17
  })
17
18
  .index("by_kind", ["kind"])
18
19
  .index("by_status", ["status"])
@@ -1 +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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C,CAAC,MAAM,EAAE;QACnB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;QACjB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;QACrB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;QACtB,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;QACjC,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;KAClC,CAAC;SACC,KAAK,CAAC,iBAAiB,EAAE,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC;SACxD,KAAK,CAAC,uBAAuB,EAAE;QAC9B,SAAS;QACT,iBAAiB;QACjB,WAAW;KACZ,CAAC;IAEJ,SAAS,EAAE,WAAW,CAAC;QACrB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;QACnB,OAAO,EAAE,CAAC,CAAC,QAAQ,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"}
@@ -161,6 +161,10 @@ declare function createFeedbackHooksImplementation<RateLimitResult>(api: Feedbac
161
161
  */
162
162
  useEntries(args?: UseEntriesArgs): import("convex/react").UsePaginatedQueryReturnType<import("convex/server").FunctionReference<"query", "public", import("../client/api.js").ListEntriesArgs, import("convex/server").PaginationResult<{
163
163
  updatedAt?: number | undefined;
164
+ metadata?: {
165
+ standard?: Record<string, string | number | boolean> | undefined;
166
+ additional?: Record<string, string | number | boolean> | undefined;
167
+ } | undefined;
164
168
  id: string;
165
169
  creationTime: number;
166
170
  actorId: string;
@@ -179,6 +183,10 @@ declare function createFeedbackHooksImplementation<RateLimitResult>(api: Feedbac
179
183
  */
180
184
  useEntry(entryId: string | null | undefined): {
181
185
  updatedAt?: number | undefined;
186
+ metadata?: {
187
+ standard?: Record<string, string | number | boolean> | undefined;
188
+ additional?: Record<string, string | number | boolean> | undefined;
189
+ } | undefined;
182
190
  id: string;
183
191
  creationTime: number;
184
192
  actorId: string;
@@ -197,6 +205,10 @@ declare function createFeedbackHooksImplementation<RateLimitResult>(api: Feedbac
197
205
  */
198
206
  useSearchEntries(args: SearchEntriesArgs): {
199
207
  updatedAt?: number | undefined;
208
+ metadata?: {
209
+ standard?: Record<string, string | number | boolean> | undefined;
210
+ additional?: Record<string, string | number | boolean> | undefined;
211
+ } | undefined;
200
212
  id: string;
201
213
  creationTime: number;
202
214
  actorId: string;
@@ -219,6 +231,10 @@ declare function createFeedbackHooksImplementation<RateLimitResult>(api: Feedbac
219
231
  useSimilarEntries(args: SimilarEntriesArgs): {
220
232
  exact: {
221
233
  updatedAt?: number | undefined;
234
+ metadata?: {
235
+ standard?: Record<string, string | number | boolean> | undefined;
236
+ additional?: Record<string, string | number | boolean> | undefined;
237
+ } | undefined;
222
238
  id: string;
223
239
  creationTime: number;
224
240
  actorId: string;
@@ -232,6 +248,10 @@ declare function createFeedbackHooksImplementation<RateLimitResult>(api: Feedbac
232
248
  }[];
233
249
  similar: {
234
250
  updatedAt?: number | undefined;
251
+ metadata?: {
252
+ standard?: Record<string, string | number | boolean> | undefined;
253
+ additional?: Record<string, string | number | boolean> | undefined;
254
+ } | undefined;
235
255
  id: string;
236
256
  creationTime: number;
237
257
  actorId: string;
@@ -268,7 +288,7 @@ declare function createFeedbackHooksImplementation<RateLimitResult>(api: Feedbac
268
288
  /** Returns the bound status mutation. */
269
289
  useSetEntryStatus(): import("convex/react").ReactMutation<import("convex/server").FunctionReference<"mutation", "public", import("../client/api.js").SetEntryStatusArgs, RateLimitResult | null, string | undefined>>;
270
290
  /** Returns the idempotent entry-upvote state mutation. */
271
- useSetEntryUpvote(): import("convex/react").ReactMutation<import("convex/server").FunctionReference<"mutation", "public", import("../client/api.js").SetEntryUpvoteArgs, RateLimitResult | import("../client/api.js").SetEntryUpvoteResult, string | undefined>>;
291
+ useSetEntryUpvote(): import("convex/react").ReactMutation<import("convex/server").FunctionReference<"mutation", "public", import("../client/api.js").SetEntryUpvoteArgs, import("../client/api.js").SetEntryUpvoteResult | RateLimitResult, string | undefined>>;
272
292
  /** Returns the create-comment/reply mutation. */
273
293
  useCreateComment(): import("convex/react").ReactMutation<import("convex/server").FunctionReference<"mutation", "public", import("../client/api.js").CreateCommentArgs, string | RateLimitResult, string | undefined>>;
274
294
  /** Returns the update-comment mutation. */
@@ -276,7 +296,7 @@ declare function createFeedbackHooksImplementation<RateLimitResult>(api: Feedbac
276
296
  /** Returns the soft-delete-comment mutation. */
277
297
  useDeleteComment(): import("convex/react").ReactMutation<import("convex/server").FunctionReference<"mutation", "public", import("../client/api.js").DeleteCommentArgs, RateLimitResult | null, string | undefined>>;
278
298
  /** Returns the idempotent comment-like state mutation. */
279
- useSetCommentLike(): import("convex/react").ReactMutation<import("convex/server").FunctionReference<"mutation", "public", import("../client/api.js").SetCommentLikeArgs, RateLimitResult | import("../client/api.js").SetCommentLikeResult, string | undefined>>;
299
+ useSetCommentLike(): import("convex/react").ReactMutation<import("convex/server").FunctionReference<"mutation", "public", import("../client/api.js").SetCommentLikeArgs, import("../client/api.js").SetCommentLikeResult | RateLimitResult, string | undefined>>;
280
300
  };
281
301
  type CreatedFeedbackHooks<RateLimitResult> = ReturnType<typeof createFeedbackHooksImplementation<RateLimitResult>>;
282
302
  /** Creates hooks for a feedback API whose rate limiters reject by throwing. */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MA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default: {
9
9
  schema: SchemaDefinition<{
10
10
  entries: import("convex/server").TableDefinition<import("convex/values").VObject<{
11
11
  updatedAt?: number | undefined;
12
+ metadata?: {
13
+ standard?: Record<string, string | number | boolean> | undefined;
14
+ additional?: Record<string, string | number | boolean> | undefined;
15
+ } | undefined;
12
16
  actorId: string;
13
17
  kind: "feedback" | "feature_request" | "bug_report";
14
18
  status: "open" | "under_review" | "planned" | "in_progress" | "completed" | "closed";
@@ -29,7 +33,14 @@ declare const _default: {
29
33
  upvoteCount: import("convex/values").VFloat64<number, "required">;
30
34
  commentCount: import("convex/values").VFloat64<number, "required">;
31
35
  updatedAt: import("convex/values").VFloat64<number | undefined, "optional">;
32
- }, "required", "actorId" | "kind" | "status" | "title" | "body" | "upvoteCount" | "commentCount" | "updatedAt" | "normalizedTitle" | "searchText">, {
36
+ metadata: import("convex/values").VObject<{
37
+ standard?: Record<string, string | number | boolean> | undefined;
38
+ additional?: Record<string, string | number | boolean> | undefined;
39
+ } | undefined, {
40
+ standard: import("convex/values").VRecord<Record<string, string | number | boolean> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VUnion<string | number | boolean, [import("convex/values").VString<string, "required">, import("convex/values").VFloat64<number, "required">, import("convex/values").VBoolean<boolean, "required">], "required", never>, "optional", string>;
41
+ additional: import("convex/values").VRecord<Record<string, string | number | boolean> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VUnion<string | number | boolean, [import("convex/values").VString<string, "required">, import("convex/values").VFloat64<number, "required">, import("convex/values").VBoolean<boolean, "required">], "required", never>, "optional", string>;
42
+ }, "optional", "standard" | "additional" | `standard.${string}` | `additional.${string}`>;
43
+ }, "required", "actorId" | "kind" | "status" | "title" | "body" | "upvoteCount" | "commentCount" | "updatedAt" | "metadata" | "metadata.standard" | "metadata.additional" | `metadata.standard.${string}` | `metadata.additional.${string}` | "normalizedTitle" | "searchText">, {
33
44
  by_kind: ["kind", "_creationTime"];
34
45
  by_status: ["status", "_creationTime"];
35
46
  by_kind_status: ["kind", "status", "_creationTime"];
@@ -1 +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"}
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "convex-feedback",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Type-safe Convex component for feedback, feature requests, bug reports, voting, comments, and duplicate search.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
package/src/client/api.ts CHANGED
@@ -11,6 +11,7 @@ import type {
11
11
  EntryStatus,
12
12
  FeedbackComment,
13
13
  FeedbackEntry,
14
+ FeedbackMetadata,
14
15
  SimilarEntriesResult,
15
16
  } from "../component/model.js";
16
17
 
@@ -134,6 +135,9 @@ export type CreateEntryArgs = {
134
135
 
135
136
  /** Entry description/body. */
136
137
  body: string;
138
+
139
+ /** Optional creation-time diagnostic metadata. */
140
+ metadata?: FeedbackMetadata;
137
141
  };
138
142
 
139
143
  /**
@@ -27,6 +27,7 @@ import {
27
27
  entryKindValidator,
28
28
  entrySortValidator,
29
29
  entryStatusValidator,
30
+ feedbackMetadataValidator,
30
31
  publicCommentValidator,
31
32
  publicEntryValidator,
32
33
  similarEntriesValidator,
@@ -46,6 +47,8 @@ export type {
46
47
  FeedbackActor,
47
48
  FeedbackComment,
48
49
  FeedbackEntry,
50
+ FeedbackMetadata,
51
+ FeedbackMetadataValue,
49
52
  SimilarEntriesResult,
50
53
  } from "../component/model.js";
51
54
  export type { FeedbackPublicApi } from "./api.js";
@@ -452,6 +455,7 @@ function buildFeedbackApi<
452
455
  return await ctx.runQuery(component.entries.get, {
453
456
  entryId: args.entryId,
454
457
  ...actorIdFields(actor),
458
+ ...(actor?.isModerator === true ? { viewerIsModerator: true } : {}),
455
459
  });
456
460
  },
457
461
  }),
@@ -515,6 +519,7 @@ function buildFeedbackApi<
515
519
  kind: entryKindValidator,
516
520
  title: v.string(),
517
521
  body: v.string(),
522
+ metadata: v.optional(feedbackMetadataValidator),
518
523
  },
519
524
  returns: idReturns,
520
525
  handler: async (ctx, args) => {
@@ -535,6 +540,7 @@ function buildFeedbackApi<
535
540
  enabledKinds: [...config.entries.enabledKinds],
536
541
  maxTitleLength: config.limits.titleLength,
537
542
  maxBodyLength: config.limits.bodyLength,
543
+ ...(args.metadata === undefined ? {} : { metadata: args.metadata }),
538
544
  });
539
545
  },
540
546
  }),
@@ -127,6 +127,10 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
127
127
  kind: "feedback" | "feature_request" | "bug_report";
128
128
  maxBodyLength: number;
129
129
  maxTitleLength: number;
130
+ metadata?: {
131
+ additional?: Record<string, string | number | boolean>;
132
+ standard?: Record<string, string | number | boolean>;
133
+ };
130
134
  title: string;
131
135
  },
132
136
  string,
@@ -135,7 +139,11 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
135
139
  get: FunctionReference<
136
140
  "query",
137
141
  "internal",
138
- { entryId: string; viewerActorId?: string },
142
+ {
143
+ entryId: string;
144
+ viewerActorId?: string;
145
+ viewerIsModerator?: boolean;
146
+ },
139
147
  {
140
148
  actorId: string;
141
149
  body: string;
@@ -143,6 +151,10 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
143
151
  creationTime: number;
144
152
  id: string;
145
153
  kind: "feedback" | "feature_request" | "bug_report";
154
+ metadata?: {
155
+ additional?: Record<string, string | number | boolean>;
156
+ standard?: Record<string, string | number | boolean>;
157
+ };
146
158
  status:
147
159
  | "open"
148
160
  | "under_review"
@@ -190,6 +202,10 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
190
202
  creationTime: number;
191
203
  id: string;
192
204
  kind: "feedback" | "feature_request" | "bug_report";
205
+ metadata?: {
206
+ additional?: Record<string, string | number | boolean>;
207
+ standard?: Record<string, string | number | boolean>;
208
+ };
193
209
  status:
194
210
  | "open"
195
211
  | "under_review"
@@ -230,6 +246,10 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
230
246
  creationTime: number;
231
247
  id: string;
232
248
  kind: "feedback" | "feature_request" | "bug_report";
249
+ metadata?: {
250
+ additional?: Record<string, string | number | boolean>;
251
+ standard?: Record<string, string | number | boolean>;
252
+ };
233
253
  status:
234
254
  | "open"
235
255
  | "under_review"
@@ -286,6 +306,10 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
286
306
  creationTime: number;
287
307
  id: string;
288
308
  kind: "feedback" | "feature_request" | "bug_report";
309
+ metadata?: {
310
+ additional?: Record<string, string | number | boolean>;
311
+ standard?: Record<string, string | number | boolean>;
312
+ };
289
313
  status:
290
314
  | "open"
291
315
  | "under_review"
@@ -305,6 +329,10 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
305
329
  creationTime: number;
306
330
  id: string;
307
331
  kind: "feedback" | "feature_request" | "bug_report";
332
+ metadata?: {
333
+ additional?: Record<string, string | number | boolean>;
334
+ standard?: Record<string, string | number | boolean>;
335
+ };
308
336
  status:
309
337
  | "open"
310
338
  | "under_review"
@@ -14,12 +14,14 @@ import {
14
14
  normalizeRequiredText,
15
15
  normalizeTitle,
16
16
  serializeEntry,
17
+ validateFeedbackMetadata,
17
18
  } from "./helpers.js";
18
19
  import {
19
20
  actorValidator,
20
21
  entryKindValidator,
21
22
  entrySortValidator,
22
23
  entryStatusValidator,
24
+ feedbackMetadataValidator,
23
25
  publicEntryValidator,
24
26
  similarEntriesValidator,
25
27
  type EntryKind,
@@ -200,13 +202,19 @@ export const get = query({
200
202
  args: {
201
203
  entryId: v.id("entries"),
202
204
  viewerActorId: v.optional(v.string()),
205
+ viewerIsModerator: v.optional(v.boolean()),
203
206
  },
204
207
  returns: v.union(publicEntryValidator, v.null()),
205
208
  handler: async (ctx, args) => {
206
209
  const entry = await ctx.db.get("entries", args.entryId);
207
210
  return entry === null
208
211
  ? null
209
- : serializeEntry(ctx, entry, args.viewerActorId);
212
+ : serializeEntry(
213
+ ctx,
214
+ entry,
215
+ args.viewerActorId,
216
+ args.viewerIsModerator === true,
217
+ );
210
218
  },
211
219
  });
212
220
 
@@ -424,6 +432,7 @@ export const create = mutation({
424
432
  enabledKinds: v.array(entryKindValidator),
425
433
  maxTitleLength: v.number(),
426
434
  maxBodyLength: v.number(),
435
+ metadata: v.optional(feedbackMetadataValidator),
427
436
  },
428
437
  returns: v.id("entries"),
429
438
  handler: async (ctx, args) => {
@@ -438,6 +447,7 @@ export const create = mutation({
438
447
  args.maxTitleLength,
439
448
  );
440
449
  const body = normalizeRequiredText(args.body, "Body", args.maxBodyLength);
450
+ validateFeedbackMetadata(args.metadata);
441
451
 
442
452
  const entry = await ctx.db.insert("entries", {
443
453
  actorId: args.actorId,
@@ -449,6 +459,7 @@ export const create = mutation({
449
459
  searchText: `${title}\n${body}`,
450
460
  upvoteCount: 1,
451
461
  commentCount: 0,
462
+ ...(args.metadata === undefined ? {} : { metadata: args.metadata }),
452
463
  });
453
464
 
454
465
  await ctx.db.insert("reactions", {