@fatagnus/convex-feedback 0.2.7 → 0.2.8
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 +346 -4
- package/package.json +12 -5
- package/src/convex/_generated/api.ts +1 -0
- package/src/convex/agents/feedbackInterviewAgent.ts +6 -12
- package/src/convex/apiKeys.test.ts +79 -0
- package/src/convex/apiKeys.ts +223 -0
- package/src/convex/bugReports.ts +126 -1
- package/src/convex/feedback.ts +134 -1
- package/src/convex/http.test.ts +76 -0
- package/src/convex/http.ts +630 -0
- package/src/convex/index.ts +11 -0
- package/src/convex/prompts.test.ts +185 -0
- package/src/convex/prompts.ts +605 -0
- package/src/convex/schema.ts +52 -2
- package/src/convex/ticketNumbers.ts +4 -0
- package/src/convex/tsconfig.json +24 -0
- package/src/index.ts +33 -1
- package/src/types.ts +38 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
/* This TypeScript project config describes the environment that
|
|
3
|
+
* Convex functions run in and is used for typechecking.
|
|
4
|
+
* You can modify it, but some settings required to use Convex
|
|
5
|
+
* cannot be changed.
|
|
6
|
+
*/
|
|
7
|
+
"compilerOptions": {
|
|
8
|
+
/* Defaults from Convex */
|
|
9
|
+
"target": "ESNext",
|
|
10
|
+
"lib": ["ES2021", "dom"],
|
|
11
|
+
"skipLibCheck": true,
|
|
12
|
+
"allowSyntheticDefaultImports": true,
|
|
13
|
+
"strict": false,
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
"noErrorTruncation": true,
|
|
16
|
+
|
|
17
|
+
/* Required for bundler-style imports */
|
|
18
|
+
"moduleResolution": "Bundler",
|
|
19
|
+
"module": "ESNext",
|
|
20
|
+
"isolatedModules": true
|
|
21
|
+
},
|
|
22
|
+
"include": ["./**/*"],
|
|
23
|
+
"exclude": ["node_modules"]
|
|
24
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -22,7 +22,29 @@
|
|
|
22
22
|
* export default app;
|
|
23
23
|
* ```
|
|
24
24
|
*
|
|
25
|
-
* 2.
|
|
25
|
+
* 2. Register HTTP routes in your `convex/http.ts` (optional, for ticket API):
|
|
26
|
+
*
|
|
27
|
+
* ```typescript
|
|
28
|
+
* import { httpRouter } from "convex/server";
|
|
29
|
+
* import { registerFeedbackRoutes } from "@convex-dev/feedback";
|
|
30
|
+
*
|
|
31
|
+
* const http = httpRouter();
|
|
32
|
+
*
|
|
33
|
+
* // Register feedback API routes
|
|
34
|
+
* registerFeedbackRoutes(http, { pathPrefix: "/feedback" });
|
|
35
|
+
*
|
|
36
|
+
* // Your other routes...
|
|
37
|
+
* export default http;
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* This registers these endpoints:
|
|
41
|
+
* - GET /feedback/api/prompt/{ticketNumber} - Fetch AI prompt
|
|
42
|
+
* - GET /feedback/api/items - List items
|
|
43
|
+
* - GET /feedback/api/items/{ticketNumber} - Get single item
|
|
44
|
+
* - PATCH /feedback/api/items/{ticketNumber}/status - Update status
|
|
45
|
+
* - PATCH /feedback/api/items/{ticketNumber}/archive - Archive/unarchive
|
|
46
|
+
*
|
|
47
|
+
* 3. Pass API keys when creating bug reports/feedback:
|
|
26
48
|
*
|
|
27
49
|
* **Important:** Convex components don't inherit environment variables from the
|
|
28
50
|
* parent app. You must pass the API keys when calling the component's create
|
|
@@ -140,12 +162,22 @@ export type FeedbackPriority = 'nice_to_have' | 'important' | 'critical';
|
|
|
140
162
|
export type FeedbackStatus = 'open' | 'under_review' | 'planned' | 'in_progress' | 'completed' | 'declined';
|
|
141
163
|
export type ReporterType = 'staff' | 'customer';
|
|
142
164
|
export type Effort = 'low' | 'medium' | 'high';
|
|
165
|
+
export type CounterType = 'bug' | 'feedback';
|
|
166
|
+
export type PromptTemplate = 'fix' | 'implement' | 'analyze' | 'codebuff';
|
|
167
|
+
|
|
168
|
+
// Re-export HTTP registration helper
|
|
169
|
+
export { registerFeedbackRoutes } from './convex/http';
|
|
170
|
+
|
|
171
|
+
// Re-export HTTP options type from types
|
|
172
|
+
export type { RegisterFeedbackRoutesOptions } from './types';
|
|
143
173
|
|
|
144
174
|
// Export document types
|
|
145
175
|
export type {
|
|
146
176
|
BugReport,
|
|
147
177
|
Feedback,
|
|
148
178
|
SupportTeam,
|
|
179
|
+
ApiKey,
|
|
180
|
+
ApiKeyCreated,
|
|
149
181
|
// Interview types
|
|
150
182
|
InterviewContext,
|
|
151
183
|
FeatureArea,
|
package/src/types.ts
CHANGED
|
@@ -171,6 +171,7 @@ export interface InterviewState {
|
|
|
171
171
|
export interface BugReport {
|
|
172
172
|
_id: string;
|
|
173
173
|
_creationTime: number;
|
|
174
|
+
ticketNumber?: string;
|
|
174
175
|
title: string;
|
|
175
176
|
description: string;
|
|
176
177
|
severity: 'low' | 'medium' | 'high' | 'critical';
|
|
@@ -208,6 +209,7 @@ export interface BugReport {
|
|
|
208
209
|
export interface Feedback {
|
|
209
210
|
_id: string;
|
|
210
211
|
_creationTime: number;
|
|
212
|
+
ticketNumber?: string;
|
|
211
213
|
type: 'feature_request' | 'change_request' | 'general';
|
|
212
214
|
title: string;
|
|
213
215
|
description: string;
|
|
@@ -239,6 +241,31 @@ export interface Feedback {
|
|
|
239
241
|
updatedAt: number;
|
|
240
242
|
}
|
|
241
243
|
|
|
244
|
+
/**
|
|
245
|
+
* API Key document type (without the actual key)
|
|
246
|
+
*/
|
|
247
|
+
export interface ApiKey {
|
|
248
|
+
_id: string;
|
|
249
|
+
keyPrefix: string;
|
|
250
|
+
name: string;
|
|
251
|
+
expiresAt?: number;
|
|
252
|
+
isRevoked: boolean;
|
|
253
|
+
revokedAt?: number;
|
|
254
|
+
createdAt: number;
|
|
255
|
+
isExpired: boolean;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* API Key creation result (includes the full key)
|
|
260
|
+
*/
|
|
261
|
+
export interface ApiKeyCreated {
|
|
262
|
+
key: string;
|
|
263
|
+
keyPrefix: string;
|
|
264
|
+
name: string;
|
|
265
|
+
expiresAt: number | null;
|
|
266
|
+
createdAt: number;
|
|
267
|
+
}
|
|
268
|
+
|
|
242
269
|
/**
|
|
243
270
|
* Support team document type
|
|
244
271
|
*/
|
|
@@ -253,3 +280,14 @@ export interface SupportTeam {
|
|
|
253
280
|
createdAt: number;
|
|
254
281
|
updatedAt: number;
|
|
255
282
|
}
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Options for registering feedback HTTP routes
|
|
286
|
+
*/
|
|
287
|
+
export interface RegisterFeedbackRoutesOptions {
|
|
288
|
+
/**
|
|
289
|
+
* Optional path prefix for all routes (e.g., "/feedback" -> "/feedback/api/items")
|
|
290
|
+
* Default: "" (no prefix)
|
|
291
|
+
*/
|
|
292
|
+
pathPrefix?: string;
|
|
293
|
+
}
|