@codeguide/core 0.0.33 → 0.0.36
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/__tests__/services/usage/usage-service.test.ts +53 -29
- package/codeguide.ts +9 -0
- package/dist/codeguide.d.ts +4 -1
- package/dist/codeguide.js +3 -0
- package/dist/index.d.ts +2 -1
- package/dist/services/chat/chat-service.d.ts +44 -0
- package/dist/services/chat/chat-service.js +85 -0
- package/dist/services/chat/chat-types.d.ts +88 -0
- package/dist/services/chat/chat-types.js +5 -0
- package/dist/services/chat/index.d.ts +2 -0
- package/dist/services/chat/index.js +20 -0
- package/dist/services/data-management/data-management-service.d.ts +53 -0
- package/dist/services/data-management/data-management-service.js +66 -0
- package/dist/services/data-management/data-management-types.d.ts +149 -0
- package/dist/services/data-management/data-management-types.js +7 -0
- package/dist/services/data-management/index.d.ts +2 -0
- package/dist/services/data-management/index.js +20 -0
- package/dist/services/generation/generation-service.d.ts +7 -1
- package/dist/services/generation/generation-service.js +18 -0
- package/dist/services/generation/generation-types.d.ts +123 -0
- package/dist/services/index.d.ts +8 -0
- package/dist/services/index.js +13 -1
- package/dist/services/projects/project-service.d.ts +3 -1
- package/dist/services/projects/project-service.js +13 -1
- package/dist/services/projects/project-types.d.ts +85 -8
- package/dist/services/prompt-generations/index.d.ts +2 -0
- package/dist/services/prompt-generations/index.js +20 -0
- package/dist/services/prompt-generations/prompt-generations-service.d.ts +47 -0
- package/dist/services/prompt-generations/prompt-generations-service.js +58 -0
- package/dist/services/prompt-generations/prompt-generations-types.d.ts +94 -0
- package/dist/services/prompt-generations/prompt-generations-types.js +2 -0
- package/dist/services/streaming/index.d.ts +2 -0
- package/dist/services/streaming/index.js +20 -0
- package/dist/services/streaming/streaming-service.d.ts +30 -0
- package/dist/services/streaming/streaming-service.js +107 -0
- package/dist/services/streaming/streaming-types.d.ts +14 -0
- package/dist/services/streaming/streaming-types.js +2 -0
- package/dist/services/tasks/task-service.d.ts +3 -1
- package/dist/services/tasks/task-service.js +8 -0
- package/dist/services/tasks/task-types.d.ts +15 -0
- package/dist/services/usage/usage-service.d.ts +35 -1
- package/dist/services/usage/usage-service.js +68 -0
- package/dist/services/usage/usage-types.d.ts +109 -33
- package/dist/services/users/user-service.d.ts +9 -1
- package/dist/services/users/user-service.js +10 -0
- package/dist/services/users/user-types.d.ts +14 -0
- package/index.ts +10 -0
- package/package.json +1 -1
- package/services/chat/chat-service.ts +110 -0
- package/services/chat/chat-types.ts +145 -0
- package/services/chat/index.ts +2 -0
- package/services/data-management/data-management-service.ts +74 -0
- package/services/data-management/data-management-types.ts +163 -0
- package/services/data-management/index.ts +2 -0
- package/services/generation/generation-service.ts +40 -0
- package/services/generation/generation-types.ts +140 -0
- package/services/index.ts +8 -0
- package/services/projects/README.md +54 -0
- package/services/projects/project-service.ts +20 -1
- package/services/projects/project-types.ts +88 -8
- package/services/prompt-generations/index.ts +2 -0
- package/services/prompt-generations/prompt-generations-service.ts +75 -0
- package/services/prompt-generations/prompt-generations-types.ts +101 -0
- package/services/streaming/index.ts +2 -0
- package/services/streaming/streaming-service.ts +123 -0
- package/services/streaming/streaming-types.ts +15 -0
- package/services/tasks/task-service.ts +30 -2
- package/services/tasks/task-types.ts +19 -1
- package/services/usage/usage-service.ts +81 -0
- package/services/usage/usage-types.ts +117 -36
- package/services/users/user-service.ts +15 -1
- package/services/users/user-types.ts +16 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Data Management Service Types
|
|
3
|
+
*
|
|
4
|
+
* Provides interfaces for viewing data statistics and bulk deleting user data
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Response structure for GET /data/stats endpoint
|
|
9
|
+
* Contains aggregate counts of all user data across the platform
|
|
10
|
+
*/
|
|
11
|
+
export interface DataStatsResponse {
|
|
12
|
+
status: string
|
|
13
|
+
data: DataStats
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Aggregate statistics for all user data entities
|
|
18
|
+
*/
|
|
19
|
+
export interface DataStats {
|
|
20
|
+
projects: number
|
|
21
|
+
project_documents: number
|
|
22
|
+
project_repositories: number
|
|
23
|
+
project_tasks: number
|
|
24
|
+
task_groups: number
|
|
25
|
+
chat_conversations: number
|
|
26
|
+
chat_messages: number
|
|
27
|
+
codespace_tasks: number
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Request structure for DELETE /data/all endpoint
|
|
32
|
+
* Requires explicit confirmation to prevent accidental data loss
|
|
33
|
+
*/
|
|
34
|
+
export interface DeleteAllDataRequest {
|
|
35
|
+
confirm: boolean
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Response structure for DELETE /data/all endpoint
|
|
40
|
+
* Provides summary of deleted data counts
|
|
41
|
+
*/
|
|
42
|
+
export interface DeleteAllDataResponse {
|
|
43
|
+
status: string
|
|
44
|
+
message: string
|
|
45
|
+
deleted: DataStats
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Response structure for GET /data/export endpoint
|
|
50
|
+
* Contains complete export of all user data
|
|
51
|
+
*/
|
|
52
|
+
export interface DataExportResponse {
|
|
53
|
+
status: string
|
|
54
|
+
exported_at: string
|
|
55
|
+
user_id: string
|
|
56
|
+
data: ExportedData
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Complete exported data containing all user entities
|
|
61
|
+
*/
|
|
62
|
+
export interface ExportedData {
|
|
63
|
+
projects: ExportedProject[]
|
|
64
|
+
project_documents: ExportedProjectDocument[]
|
|
65
|
+
project_repositories: ExportedProjectRepository[]
|
|
66
|
+
project_tasks: ExportedProjectTask[]
|
|
67
|
+
task_groups: ExportedTaskGroup[]
|
|
68
|
+
chat_conversations: ExportedChatConversation[]
|
|
69
|
+
chat_messages: ExportedChatMessage[]
|
|
70
|
+
codespace_tasks: ExportedCodespaceTask[]
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Exported project entity
|
|
75
|
+
*/
|
|
76
|
+
export interface ExportedProject {
|
|
77
|
+
id: string
|
|
78
|
+
title: string
|
|
79
|
+
description: string
|
|
80
|
+
status: string
|
|
81
|
+
user_id: string
|
|
82
|
+
created_at: string
|
|
83
|
+
updated_at: string
|
|
84
|
+
project_outline?: Record<string, any>
|
|
85
|
+
ai_questionaire?: Record<string, any>
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Exported project document entity
|
|
90
|
+
*/
|
|
91
|
+
export interface ExportedProjectDocument {
|
|
92
|
+
id: string
|
|
93
|
+
project_id: string
|
|
94
|
+
content: string
|
|
95
|
+
custom_document_type: string
|
|
96
|
+
is_current_version: boolean
|
|
97
|
+
created_at: string
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Exported project repository entity
|
|
102
|
+
*/
|
|
103
|
+
export interface ExportedProjectRepository {
|
|
104
|
+
id: string
|
|
105
|
+
project_id: string
|
|
106
|
+
repo_url: string
|
|
107
|
+
created_at: string
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Exported project task entity
|
|
112
|
+
*/
|
|
113
|
+
export interface ExportedProjectTask {
|
|
114
|
+
id: string
|
|
115
|
+
project_id: string
|
|
116
|
+
title: string
|
|
117
|
+
status: string
|
|
118
|
+
priority: string
|
|
119
|
+
created_at: string
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Exported task group entity
|
|
124
|
+
*/
|
|
125
|
+
export interface ExportedTaskGroup {
|
|
126
|
+
id: string
|
|
127
|
+
project_id: string
|
|
128
|
+
name: string
|
|
129
|
+
created_at: string
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Exported chat conversation entity
|
|
134
|
+
*/
|
|
135
|
+
export interface ExportedChatConversation {
|
|
136
|
+
id: string
|
|
137
|
+
title: string
|
|
138
|
+
model: string
|
|
139
|
+
created_at: string
|
|
140
|
+
last_message_at: string
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Exported chat message entity
|
|
145
|
+
*/
|
|
146
|
+
export interface ExportedChatMessage {
|
|
147
|
+
id: string
|
|
148
|
+
conversation_id: string
|
|
149
|
+
role: 'user' | 'assistant'
|
|
150
|
+
content: string
|
|
151
|
+
token_count: number
|
|
152
|
+
created_at: string
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Exported codespace task entity
|
|
157
|
+
*/
|
|
158
|
+
export interface ExportedCodespaceTask {
|
|
159
|
+
id: string
|
|
160
|
+
project_id: string
|
|
161
|
+
status: string
|
|
162
|
+
created_at: string
|
|
163
|
+
}
|
|
@@ -18,9 +18,21 @@ import {
|
|
|
18
18
|
GenerateMultipleDocumentsResponse,
|
|
19
19
|
GenerateMissingDocumentsRequest,
|
|
20
20
|
GenerateMissingDocumentsResponse,
|
|
21
|
+
GenerateTechSpecRequest,
|
|
22
|
+
CustomDocumentResponse,
|
|
21
23
|
BackgroundGenerationRequest,
|
|
22
24
|
BackgroundGenerationResponse,
|
|
23
25
|
BackgroundGenerationStatusResponse,
|
|
26
|
+
GenerateAnswersRequest,
|
|
27
|
+
GenerateAnswersResponse,
|
|
28
|
+
GenerateProjectOutlineRequest,
|
|
29
|
+
GenerateProjectOutlineResponse,
|
|
30
|
+
GenerateCoreFeaturesRequest,
|
|
31
|
+
GenerateCoreFeaturesResponse,
|
|
32
|
+
GenerateTechStackRequest,
|
|
33
|
+
GenerateTechStackResponse,
|
|
34
|
+
GenerateAppFlowRequest,
|
|
35
|
+
GenerateAppFlowResponse,
|
|
24
36
|
} from './generation-types'
|
|
25
37
|
|
|
26
38
|
export class GenerationService extends BaseService {
|
|
@@ -78,4 +90,32 @@ export class GenerationService extends BaseService {
|
|
|
78
90
|
async getBackgroundGenerationStatus(jobId: string): Promise<BackgroundGenerationStatusResponse> {
|
|
79
91
|
return this.get<BackgroundGenerationStatusResponse>(`/generate/background/${jobId}/status`)
|
|
80
92
|
}
|
|
93
|
+
|
|
94
|
+
async generateTechSpec(request: GenerateTechSpecRequest): Promise<CustomDocumentResponse> {
|
|
95
|
+
return this.post<CustomDocumentResponse>('/generate/tech-spec', request)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
async generateAnswers(request: GenerateAnswersRequest): Promise<GenerateAnswersResponse> {
|
|
99
|
+
return this.post<GenerateAnswersResponse>('/generate/answers', request)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
async generateProjectOutline(
|
|
103
|
+
request: GenerateProjectOutlineRequest
|
|
104
|
+
): Promise<GenerateProjectOutlineResponse> {
|
|
105
|
+
return this.post<GenerateProjectOutlineResponse>('/generate/project-outline', request)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
async generateCoreFeatures(
|
|
109
|
+
request: GenerateCoreFeaturesRequest
|
|
110
|
+
): Promise<GenerateCoreFeaturesResponse> {
|
|
111
|
+
return this.post<GenerateCoreFeaturesResponse>('/generate/core-features', request)
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
async generateTechStack(request: GenerateTechStackRequest): Promise<GenerateTechStackResponse> {
|
|
115
|
+
return this.post<GenerateTechStackResponse>('/generate/tech-stack', request)
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
async generateAppFlow(request: GenerateAppFlowRequest): Promise<GenerateAppFlowResponse> {
|
|
119
|
+
return this.post<GenerateAppFlowResponse>('/generate/app-flow', request)
|
|
120
|
+
}
|
|
81
121
|
}
|
|
@@ -65,6 +65,7 @@ export interface GenerateOutlineResponse {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
export interface GenerateDocumentRequest {
|
|
68
|
+
project_id?: string
|
|
68
69
|
project_type?: string
|
|
69
70
|
description: string
|
|
70
71
|
selected_tools: string[]
|
|
@@ -129,3 +130,142 @@ export interface GenerateMissingDocumentsResponse {
|
|
|
129
130
|
error?: string
|
|
130
131
|
generated_documents?: string[]
|
|
131
132
|
}
|
|
133
|
+
|
|
134
|
+
export interface GenerateTechSpecRequest {
|
|
135
|
+
project_id: string
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export interface CustomDocumentResponse {
|
|
139
|
+
content: string
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export interface GenerateAnswersRequest {
|
|
143
|
+
title: string
|
|
144
|
+
description: string
|
|
145
|
+
questions: Array<{
|
|
146
|
+
question: string
|
|
147
|
+
answer: string
|
|
148
|
+
}>
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export interface GenerateAnswersResponse {
|
|
152
|
+
answers: Array<{
|
|
153
|
+
question: string
|
|
154
|
+
answer: string
|
|
155
|
+
}>
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export type ProjectMode = 'prd_only' | 'full_application' | 'prototype' | 'mvp'
|
|
159
|
+
|
|
160
|
+
export interface ProjectOutline {
|
|
161
|
+
core_features: Array<{
|
|
162
|
+
id: number
|
|
163
|
+
title: string
|
|
164
|
+
description: string
|
|
165
|
+
icon_key: string
|
|
166
|
+
}>
|
|
167
|
+
app_flow: Array<{
|
|
168
|
+
id: number
|
|
169
|
+
title: string
|
|
170
|
+
description: string
|
|
171
|
+
}>
|
|
172
|
+
tech_stack: Array<{
|
|
173
|
+
id: number
|
|
174
|
+
type: string
|
|
175
|
+
name: string
|
|
176
|
+
icon_key: string
|
|
177
|
+
}>
|
|
178
|
+
document_types: Array<{
|
|
179
|
+
id: number
|
|
180
|
+
name: string
|
|
181
|
+
description: string
|
|
182
|
+
}>
|
|
183
|
+
is_generated: boolean
|
|
184
|
+
project_mode: ProjectMode
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export interface GenerateProjectOutlineRequest {
|
|
188
|
+
description: string
|
|
189
|
+
project_type: string
|
|
190
|
+
project_mode?: ProjectMode
|
|
191
|
+
title?: string
|
|
192
|
+
selected_tools?: string[]
|
|
193
|
+
answers?: Record<string, any>
|
|
194
|
+
project_id?: string
|
|
195
|
+
category_id?: string
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export interface GenerateProjectOutlineResponse {
|
|
199
|
+
project_outline: ProjectOutline
|
|
200
|
+
project_id: string
|
|
201
|
+
project_created: boolean
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export interface CoreFeature {
|
|
205
|
+
id: number
|
|
206
|
+
title: string
|
|
207
|
+
description: string
|
|
208
|
+
icon_key: string
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export interface GenerateCoreFeaturesRequest {
|
|
212
|
+
context: string
|
|
213
|
+
project_id?: string
|
|
214
|
+
existing_features?: Array<{
|
|
215
|
+
id: number
|
|
216
|
+
title: string
|
|
217
|
+
description: string
|
|
218
|
+
}>
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export interface GenerateCoreFeaturesResponse {
|
|
222
|
+
core_features: CoreFeature[]
|
|
223
|
+
project_id: string | null
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export interface TechStackItem {
|
|
227
|
+
id: number
|
|
228
|
+
type: string
|
|
229
|
+
name: string
|
|
230
|
+
icon_key: string
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export interface GenerateTechStackRequest {
|
|
234
|
+
context: string
|
|
235
|
+
project_id?: string
|
|
236
|
+
existing_items?: Array<{
|
|
237
|
+
id: number
|
|
238
|
+
type: string
|
|
239
|
+
name: string
|
|
240
|
+
}>
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export interface GenerateTechStackResponse {
|
|
244
|
+
tech_stack: TechStackItem[]
|
|
245
|
+
project_id: string | null
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
export interface AppFlowItem {
|
|
249
|
+
id: number
|
|
250
|
+
title: string
|
|
251
|
+
page: string
|
|
252
|
+
description: string
|
|
253
|
+
index: number
|
|
254
|
+
icon_key: string
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export interface GenerateAppFlowRequest {
|
|
258
|
+
context: string
|
|
259
|
+
project_id?: string
|
|
260
|
+
existing_items?: Array<{
|
|
261
|
+
id: number
|
|
262
|
+
title: string
|
|
263
|
+
page: string
|
|
264
|
+
description: string
|
|
265
|
+
}>
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
export interface GenerateAppFlowResponse {
|
|
269
|
+
app_flow: AppFlowItem[]
|
|
270
|
+
project_id: string | null
|
|
271
|
+
}
|
package/services/index.ts
CHANGED
|
@@ -21,6 +21,10 @@ export { ExternalTokenService } from './external-tokens'
|
|
|
21
21
|
export { SecurityKeysService } from './security-keys'
|
|
22
22
|
export { UserService } from './users'
|
|
23
23
|
export { StarterKitsService } from './starter-kits'
|
|
24
|
+
export { StreamingService } from './streaming'
|
|
25
|
+
export { ChatService } from './chat'
|
|
26
|
+
export { DataManagementService } from './data-management'
|
|
27
|
+
export { PromptGenerationsService } from './prompt-generations'
|
|
24
28
|
|
|
25
29
|
// Re-export all types for convenience
|
|
26
30
|
export * from './generation'
|
|
@@ -36,3 +40,7 @@ export * from './external-tokens'
|
|
|
36
40
|
export * from './security-keys'
|
|
37
41
|
export * from './users'
|
|
38
42
|
export * from './starter-kits'
|
|
43
|
+
export * from './streaming'
|
|
44
|
+
export * from './chat'
|
|
45
|
+
export * from './data-management'
|
|
46
|
+
export * from './prompt-generations'
|
|
@@ -122,6 +122,60 @@ interface Project {
|
|
|
122
122
|
}
|
|
123
123
|
```
|
|
124
124
|
|
|
125
|
+
### Project Creation
|
|
126
|
+
|
|
127
|
+
#### `CreateProjectRequest`
|
|
128
|
+
|
|
129
|
+
```typescript
|
|
130
|
+
interface CreateProjectRequest {
|
|
131
|
+
title?: string // Optional - will be auto-generated if not provided
|
|
132
|
+
description: string
|
|
133
|
+
status?: 'prompt' | 'draft' | 'in_progress' | 'completed'
|
|
134
|
+
category_id?: string
|
|
135
|
+
starter_kit_id?: string
|
|
136
|
+
ai_questionaire?: {
|
|
137
|
+
experience_level?: string
|
|
138
|
+
timeline?: string
|
|
139
|
+
team_size?: number
|
|
140
|
+
}
|
|
141
|
+
tools_selected?: string[]
|
|
142
|
+
project_outline?: {
|
|
143
|
+
features?: string[]
|
|
144
|
+
architecture?: string
|
|
145
|
+
}
|
|
146
|
+
codie_tool_id?: string
|
|
147
|
+
existing_project_repo_url?: string
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
#### Automatic Title Generation
|
|
152
|
+
|
|
153
|
+
The API now supports automatic title generation when creating projects without a title. The system generates titles using this priority order:
|
|
154
|
+
|
|
155
|
+
1. **Project description** (highest priority)
|
|
156
|
+
2. **AI questionnaire** responses
|
|
157
|
+
3. **Project outline** information
|
|
158
|
+
4. **"Untitled Project"** (fallback when no context is available)
|
|
159
|
+
|
|
160
|
+
#### Usage Examples
|
|
161
|
+
|
|
162
|
+
```typescript
|
|
163
|
+
// Create project without title - API will auto-generate
|
|
164
|
+
const newProject = await codeGuide.project.createProject({
|
|
165
|
+
description: "A todo app built with React and Node.js",
|
|
166
|
+
tools_selected: ["React", "Node.js", "MongoDB"]
|
|
167
|
+
})
|
|
168
|
+
|
|
169
|
+
// The API will generate a title like "React Node.js Todo Application"
|
|
170
|
+
console.log(newProject.title) // Auto-generated title
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
#### Generated Title Examples
|
|
174
|
+
|
|
175
|
+
- Input: "A todo app built with React and Node.js" → "React Node.js Todo Application"
|
|
176
|
+
- Input: "Mobile banking app with biometric authentication" → "Mobile Banking App Biometric Authentication"
|
|
177
|
+
- Empty description with questionnaire → "Untitled Project" (fallback)
|
|
178
|
+
|
|
125
179
|
## Usage Examples
|
|
126
180
|
|
|
127
181
|
### Basic Filtering
|
|
@@ -12,6 +12,8 @@ import {
|
|
|
12
12
|
GetProjectDocumentsResponse,
|
|
13
13
|
ConnectRepositoryRequest,
|
|
14
14
|
ConnectRepositoryResponse,
|
|
15
|
+
GetAiToolsRequest,
|
|
16
|
+
GetAiToolsResponse,
|
|
15
17
|
} from './project-types'
|
|
16
18
|
|
|
17
19
|
export class ProjectService extends BaseService {
|
|
@@ -49,7 +51,7 @@ export class ProjectService extends BaseService {
|
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
async createProject(request: CreateProjectRequest): Promise<Project> {
|
|
52
|
-
const response = await this.post<ProjectResponse>('/projects', request)
|
|
54
|
+
const response = await this.post<ProjectResponse>('/projects/', request)
|
|
53
55
|
return response.data
|
|
54
56
|
}
|
|
55
57
|
|
|
@@ -76,6 +78,13 @@ export class ProjectService extends BaseService {
|
|
|
76
78
|
return this.get<GetProjectDocumentsResponse>(url)
|
|
77
79
|
}
|
|
78
80
|
|
|
81
|
+
async getDocumentsByType(
|
|
82
|
+
projectId: string,
|
|
83
|
+
documentType: string
|
|
84
|
+
): Promise<GetProjectDocumentsResponse> {
|
|
85
|
+
return this.get<GetProjectDocumentsResponse>(`/projects/${projectId}/documents/type/${documentType}`)
|
|
86
|
+
}
|
|
87
|
+
|
|
79
88
|
async connectRepository(
|
|
80
89
|
projectId: string,
|
|
81
90
|
request: ConnectRepositoryRequest
|
|
@@ -110,4 +119,14 @@ export class ProjectService extends BaseService {
|
|
|
110
119
|
throw new Error('GitHub token must be a valid personal access token')
|
|
111
120
|
}
|
|
112
121
|
}
|
|
122
|
+
|
|
123
|
+
async getAiTools(params?: GetAiToolsRequest): Promise<GetAiToolsResponse> {
|
|
124
|
+
const queryParams = new URLSearchParams()
|
|
125
|
+
|
|
126
|
+
if (params?.key) queryParams.append('key', params.key)
|
|
127
|
+
if (params?.category) queryParams.append('category', params.category)
|
|
128
|
+
|
|
129
|
+
const url = `/ai-tools${queryParams.toString() ? `?${queryParams.toString()}` : ''}`
|
|
130
|
+
return this.get<GetAiToolsResponse>(url)
|
|
131
|
+
}
|
|
113
132
|
}
|
|
@@ -32,8 +32,26 @@ export interface Project {
|
|
|
32
32
|
}
|
|
33
33
|
tools_selected?: string[]
|
|
34
34
|
project_outline?: {
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
core_features?: Array<{
|
|
36
|
+
id?: number
|
|
37
|
+
title?: string
|
|
38
|
+
description?: string
|
|
39
|
+
icon_key?: string
|
|
40
|
+
}>
|
|
41
|
+
app_flow?: Array<{
|
|
42
|
+
id?: number
|
|
43
|
+
title?: string
|
|
44
|
+
description?: string
|
|
45
|
+
}>
|
|
46
|
+
tech_stack?: Array<{
|
|
47
|
+
id?: number
|
|
48
|
+
type?: string
|
|
49
|
+
name?: string
|
|
50
|
+
icon_key?: string
|
|
51
|
+
}>
|
|
52
|
+
document_types?: string[]
|
|
53
|
+
is_generated?: boolean
|
|
54
|
+
project_mode?: 'prd_only' | 'full_application' | 'prototype' | 'mvp'
|
|
37
55
|
}
|
|
38
56
|
codie_tool_id?: string
|
|
39
57
|
existing_project_repo_url?: string | null
|
|
@@ -95,8 +113,9 @@ export interface StarterKitReference {
|
|
|
95
113
|
}
|
|
96
114
|
|
|
97
115
|
export interface CreateProjectRequest {
|
|
98
|
-
title
|
|
99
|
-
description
|
|
116
|
+
title?: string // Optional - will be auto-generated if not provided
|
|
117
|
+
description?: string
|
|
118
|
+
status?: 'prompt' | 'draft' | 'in_progress' | 'completed'
|
|
100
119
|
category_id?: string
|
|
101
120
|
starter_kit_id?: string
|
|
102
121
|
ai_questionaire?: {
|
|
@@ -106,8 +125,26 @@ export interface CreateProjectRequest {
|
|
|
106
125
|
}
|
|
107
126
|
tools_selected?: string[]
|
|
108
127
|
project_outline?: {
|
|
109
|
-
|
|
110
|
-
|
|
128
|
+
core_features?: Array<{
|
|
129
|
+
id?: number
|
|
130
|
+
title?: string
|
|
131
|
+
description?: string
|
|
132
|
+
icon_key?: string
|
|
133
|
+
}>
|
|
134
|
+
app_flow?: Array<{
|
|
135
|
+
id?: number
|
|
136
|
+
title?: string
|
|
137
|
+
description?: string
|
|
138
|
+
}>
|
|
139
|
+
tech_stack?: Array<{
|
|
140
|
+
id?: number
|
|
141
|
+
type?: string
|
|
142
|
+
name?: string
|
|
143
|
+
icon_key?: string
|
|
144
|
+
}>
|
|
145
|
+
document_types?: string[]
|
|
146
|
+
is_generated?: boolean
|
|
147
|
+
project_mode?: 'prd_only' | 'full_application' | 'prototype' | 'mvp'
|
|
111
148
|
}
|
|
112
149
|
codie_tool_id?: string
|
|
113
150
|
existing_project_repo_url?: string
|
|
@@ -126,8 +163,26 @@ export interface UpdateProjectRequest {
|
|
|
126
163
|
}
|
|
127
164
|
tools_selected?: string[]
|
|
128
165
|
project_outline?: {
|
|
129
|
-
|
|
130
|
-
|
|
166
|
+
core_features?: Array<{
|
|
167
|
+
id?: number
|
|
168
|
+
title?: string
|
|
169
|
+
description?: string
|
|
170
|
+
icon_key?: string
|
|
171
|
+
}>
|
|
172
|
+
app_flow?: Array<{
|
|
173
|
+
id?: number
|
|
174
|
+
title?: string
|
|
175
|
+
description?: string
|
|
176
|
+
}>
|
|
177
|
+
tech_stack?: Array<{
|
|
178
|
+
id?: number
|
|
179
|
+
type?: string
|
|
180
|
+
name?: string
|
|
181
|
+
icon_key?: string
|
|
182
|
+
}>
|
|
183
|
+
document_types?: string[]
|
|
184
|
+
is_generated?: boolean
|
|
185
|
+
project_mode?: 'prd_only' | 'full_application' | 'prototype' | 'mvp'
|
|
131
186
|
}
|
|
132
187
|
codie_tool_id?: string
|
|
133
188
|
existing_project_repo_url?: string
|
|
@@ -178,3 +233,28 @@ export interface ConnectRepositoryResponse {
|
|
|
178
233
|
data: ProjectRepository
|
|
179
234
|
}
|
|
180
235
|
|
|
236
|
+
export interface AITool {
|
|
237
|
+
id: string
|
|
238
|
+
created_at: string
|
|
239
|
+
name: string
|
|
240
|
+
description: string
|
|
241
|
+
logo_src: string | null
|
|
242
|
+
is_active: boolean
|
|
243
|
+
key: string
|
|
244
|
+
ordinal: number | null
|
|
245
|
+
metadata: Record<string, any> | null
|
|
246
|
+
detailed_description: string | null
|
|
247
|
+
category: string | null
|
|
248
|
+
doc_type: string
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export interface GetAiToolsRequest {
|
|
252
|
+
key?: string
|
|
253
|
+
category?: string
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export interface GetAiToolsResponse {
|
|
257
|
+
status: string
|
|
258
|
+
data: AITool[]
|
|
259
|
+
}
|
|
260
|
+
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { BaseService } from '../base/base-service'
|
|
2
|
+
import {
|
|
3
|
+
CreatePromptGenerationRequest,
|
|
4
|
+
CreatePromptGenerationResponse,
|
|
5
|
+
ListPromptGenerationsResponse,
|
|
6
|
+
GetPromptGenerationResponse,
|
|
7
|
+
DeletePromptGenerationResponse,
|
|
8
|
+
} from './prompt-generations-types'
|
|
9
|
+
|
|
10
|
+
export class PromptGenerationsService extends BaseService {
|
|
11
|
+
/**
|
|
12
|
+
* Create a new AI system prompt generation
|
|
13
|
+
*
|
|
14
|
+
* Generates a new AI system prompt based on user input using GPT-5.1.
|
|
15
|
+
*
|
|
16
|
+
* POST /prompt-generations/
|
|
17
|
+
*
|
|
18
|
+
* @param request - The prompt generation request parameters
|
|
19
|
+
* @returns Promise resolving to the created prompt generation data
|
|
20
|
+
*/
|
|
21
|
+
async createPromptGeneration(
|
|
22
|
+
request: CreatePromptGenerationRequest
|
|
23
|
+
): Promise<CreatePromptGenerationResponse> {
|
|
24
|
+
return this.post<CreatePromptGenerationResponse>('/prompt-generations/', request)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* List all prompt generations for the authenticated user
|
|
29
|
+
*
|
|
30
|
+
* Retrieves all prompt generations that belong to the current user.
|
|
31
|
+
*
|
|
32
|
+
* GET /prompt-generations/
|
|
33
|
+
*
|
|
34
|
+
* @returns Promise resolving to an array of prompt generations
|
|
35
|
+
*/
|
|
36
|
+
async listPromptGenerations(): Promise<ListPromptGenerationsResponse> {
|
|
37
|
+
return this.get<ListPromptGenerationsResponse>('/prompt-generations/')
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Get a specific prompt generation by ID
|
|
42
|
+
*
|
|
43
|
+
* Retrieves detailed information about a single prompt generation.
|
|
44
|
+
*
|
|
45
|
+
* GET /prompt-generations/{generation_id}
|
|
46
|
+
*
|
|
47
|
+
* @param generationId - The UUID of the prompt generation to retrieve
|
|
48
|
+
* @returns Promise resolving to the prompt generation data
|
|
49
|
+
*/
|
|
50
|
+
async getPromptGeneration(
|
|
51
|
+
generationId: string
|
|
52
|
+
): Promise<GetPromptGenerationResponse> {
|
|
53
|
+
return this.get<GetPromptGenerationResponse>(
|
|
54
|
+
`/prompt-generations/${generationId}`
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Delete a specific prompt generation by ID
|
|
60
|
+
*
|
|
61
|
+
* Permanently removes a prompt generation from the database.
|
|
62
|
+
*
|
|
63
|
+
* DELETE /prompt-generations/{generation_id}
|
|
64
|
+
*
|
|
65
|
+
* @param generationId - The UUID of the prompt generation to delete
|
|
66
|
+
* @returns Promise resolving to the deleted prompt generation data
|
|
67
|
+
*/
|
|
68
|
+
async deletePromptGeneration(
|
|
69
|
+
generationId: string
|
|
70
|
+
): Promise<DeletePromptGenerationResponse> {
|
|
71
|
+
return this.delete<DeletePromptGenerationResponse>(
|
|
72
|
+
`/prompt-generations/${generationId}`
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
}
|