v0-sdk 0.2.3 → 0.3.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/dist/index.cjs +56 -6
- package/dist/index.d.ts +172 -32
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +56 -6
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -61,12 +61,7 @@ function createClient(config = {}) {
|
|
|
61
61
|
});
|
|
62
62
|
},
|
|
63
63
|
async init (params) {
|
|
64
|
-
const body =
|
|
65
|
-
name: params.name,
|
|
66
|
-
files: params.files,
|
|
67
|
-
chatPrivacy: params.chatPrivacy,
|
|
68
|
-
projectId: params.projectId
|
|
69
|
-
};
|
|
64
|
+
const body = params;
|
|
70
65
|
return fetcher(`/chats/init`, 'POST', {
|
|
71
66
|
body
|
|
72
67
|
});
|
|
@@ -179,6 +174,14 @@ function createClient(config = {}) {
|
|
|
179
174
|
body
|
|
180
175
|
});
|
|
181
176
|
},
|
|
177
|
+
async getById (params) {
|
|
178
|
+
const pathParams = {
|
|
179
|
+
projectId: params.projectId
|
|
180
|
+
};
|
|
181
|
+
return fetcher(`/projects/${pathParams.projectId}`, 'GET', {
|
|
182
|
+
pathParams
|
|
183
|
+
});
|
|
184
|
+
},
|
|
182
185
|
async assign (params) {
|
|
183
186
|
const pathParams = {
|
|
184
187
|
projectId: params.projectId
|
|
@@ -217,6 +220,53 @@ function createClient(config = {}) {
|
|
|
217
220
|
});
|
|
218
221
|
}
|
|
219
222
|
},
|
|
223
|
+
hooks: {
|
|
224
|
+
async find () {
|
|
225
|
+
return fetcher(`/hooks`, 'GET', {});
|
|
226
|
+
},
|
|
227
|
+
async create (params) {
|
|
228
|
+
const body = {
|
|
229
|
+
name: params.name,
|
|
230
|
+
events: params.events,
|
|
231
|
+
chatId: params.chatId,
|
|
232
|
+
projectId: params.projectId,
|
|
233
|
+
url: params.url
|
|
234
|
+
};
|
|
235
|
+
return fetcher(`/hooks`, 'POST', {
|
|
236
|
+
body
|
|
237
|
+
});
|
|
238
|
+
},
|
|
239
|
+
async getById (params) {
|
|
240
|
+
const pathParams = {
|
|
241
|
+
hookId: params.hookId
|
|
242
|
+
};
|
|
243
|
+
return fetcher(`/hooks/${pathParams.hookId}`, 'GET', {
|
|
244
|
+
pathParams
|
|
245
|
+
});
|
|
246
|
+
},
|
|
247
|
+
async update (params) {
|
|
248
|
+
const pathParams = {
|
|
249
|
+
hookId: params.hookId
|
|
250
|
+
};
|
|
251
|
+
const body = {
|
|
252
|
+
name: params.name,
|
|
253
|
+
events: params.events,
|
|
254
|
+
url: params.url
|
|
255
|
+
};
|
|
256
|
+
return fetcher(`/hooks/${pathParams.hookId}`, 'PATCH', {
|
|
257
|
+
pathParams,
|
|
258
|
+
body
|
|
259
|
+
});
|
|
260
|
+
},
|
|
261
|
+
async delete (params) {
|
|
262
|
+
const pathParams = {
|
|
263
|
+
hookId: params.hookId
|
|
264
|
+
};
|
|
265
|
+
return fetcher(`/hooks/${pathParams.hookId}`, 'DELETE', {
|
|
266
|
+
pathParams
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
},
|
|
220
270
|
integrations: {
|
|
221
271
|
vercel: {
|
|
222
272
|
projects: {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,23 +1,15 @@
|
|
|
1
1
|
type ChatDetail = {
|
|
2
2
|
id: string;
|
|
3
3
|
object: 'chat';
|
|
4
|
-
url: string;
|
|
5
4
|
shareable: boolean;
|
|
6
|
-
privacy
|
|
5
|
+
privacy: 'public' | 'private' | 'team' | 'team-edit' | 'unlisted';
|
|
7
6
|
name?: string;
|
|
8
7
|
/** @deprecated */
|
|
9
8
|
title?: string;
|
|
10
9
|
updatedAt?: string;
|
|
11
10
|
favorite: boolean;
|
|
12
11
|
authorId: string;
|
|
13
|
-
|
|
14
|
-
id: string;
|
|
15
|
-
object: 'message';
|
|
16
|
-
content: string;
|
|
17
|
-
createdAt: string;
|
|
18
|
-
type: 'message' | 'forked-block' | 'forked-chat' | 'open-in-v0' | 'refinement' | 'added-environment-variables' | 'added-integration' | 'deleted-file' | 'moved-file' | 'renamed-file' | 'edited-file' | 'replace-src' | 'reverted-block' | 'fix-with-v0' | 'sync-git';
|
|
19
|
-
role: 'user' | 'assistant';
|
|
20
|
-
}>;
|
|
12
|
+
projectId?: string;
|
|
21
13
|
latestVersion?: {
|
|
22
14
|
id: string;
|
|
23
15
|
object: 'version';
|
|
@@ -28,6 +20,15 @@ type ChatDetail = {
|
|
|
28
20
|
content: string;
|
|
29
21
|
}[];
|
|
30
22
|
};
|
|
23
|
+
url: string;
|
|
24
|
+
messages: Array<{
|
|
25
|
+
id: string;
|
|
26
|
+
object: 'message';
|
|
27
|
+
content: string;
|
|
28
|
+
createdAt: string;
|
|
29
|
+
type: 'message' | 'forked-block' | 'forked-chat' | 'open-in-v0' | 'refinement' | 'added-environment-variables' | 'added-integration' | 'deleted-file' | 'moved-file' | 'renamed-file' | 'edited-file' | 'replace-src' | 'reverted-block' | 'fix-with-v0' | 'sync-git';
|
|
30
|
+
role: 'user' | 'assistant';
|
|
31
|
+
}>;
|
|
31
32
|
files?: {
|
|
32
33
|
lang: string;
|
|
33
34
|
meta: Record<string, any>;
|
|
@@ -49,15 +50,30 @@ type ChatSummary = {
|
|
|
49
50
|
name?: string;
|
|
50
51
|
/** @deprecated */
|
|
51
52
|
title?: string;
|
|
52
|
-
updatedAt
|
|
53
|
+
updatedAt?: string;
|
|
53
54
|
favorite: boolean;
|
|
54
55
|
authorId: string;
|
|
56
|
+
projectId?: string;
|
|
55
57
|
latestVersion?: {
|
|
56
58
|
id: string;
|
|
57
59
|
object: 'version';
|
|
58
60
|
status: 'pending' | 'completed' | 'failed';
|
|
59
61
|
};
|
|
60
62
|
};
|
|
63
|
+
type HookDetail = {
|
|
64
|
+
id: string;
|
|
65
|
+
object: 'hook';
|
|
66
|
+
name: string;
|
|
67
|
+
events: Array<'chat.created' | 'chat.updated' | 'chat.deleted' | 'message.created' | 'message.updated' | 'message.deleted' | 'project.created' | 'project.updated' | 'project.deleted'>;
|
|
68
|
+
chatId?: string;
|
|
69
|
+
projectId?: string;
|
|
70
|
+
url: string;
|
|
71
|
+
};
|
|
72
|
+
interface HookSummary {
|
|
73
|
+
id: string;
|
|
74
|
+
object: 'hook';
|
|
75
|
+
name: string;
|
|
76
|
+
}
|
|
61
77
|
type MessageDetail = {
|
|
62
78
|
id: string;
|
|
63
79
|
object: 'message';
|
|
@@ -83,11 +99,43 @@ type MessageSummary = {
|
|
|
83
99
|
type: 'message' | 'forked-block' | 'forked-chat' | 'open-in-v0' | 'refinement' | 'added-environment-variables' | 'added-integration' | 'deleted-file' | 'moved-file' | 'renamed-file' | 'edited-file' | 'replace-src' | 'reverted-block' | 'fix-with-v0' | 'sync-git';
|
|
84
100
|
role: 'user' | 'assistant';
|
|
85
101
|
};
|
|
86
|
-
|
|
102
|
+
type ProjectDetail = {
|
|
87
103
|
id: string;
|
|
88
104
|
object: 'project';
|
|
89
105
|
name: string;
|
|
90
106
|
vercelProjectId?: string;
|
|
107
|
+
createdAt: string;
|
|
108
|
+
updatedAt?: string;
|
|
109
|
+
apiUrl: string;
|
|
110
|
+
webUrl: string;
|
|
111
|
+
chats: Array<{
|
|
112
|
+
id: string;
|
|
113
|
+
object: 'chat';
|
|
114
|
+
shareable: boolean;
|
|
115
|
+
privacy: 'public' | 'private' | 'team' | 'team-edit' | 'unlisted';
|
|
116
|
+
name?: string;
|
|
117
|
+
/** @deprecated */
|
|
118
|
+
title?: string;
|
|
119
|
+
updatedAt?: string;
|
|
120
|
+
favorite: boolean;
|
|
121
|
+
authorId: string;
|
|
122
|
+
projectId?: string;
|
|
123
|
+
latestVersion?: {
|
|
124
|
+
id: string;
|
|
125
|
+
object: 'version';
|
|
126
|
+
status: 'pending' | 'completed' | 'failed';
|
|
127
|
+
};
|
|
128
|
+
}>;
|
|
129
|
+
};
|
|
130
|
+
interface ProjectSummary {
|
|
131
|
+
id: string;
|
|
132
|
+
object: 'project';
|
|
133
|
+
name: string;
|
|
134
|
+
vercelProjectId?: string;
|
|
135
|
+
createdAt: string;
|
|
136
|
+
updatedAt?: string;
|
|
137
|
+
apiUrl: string;
|
|
138
|
+
webUrl: string;
|
|
91
139
|
}
|
|
92
140
|
interface ScopeSummary {
|
|
93
141
|
id: string;
|
|
@@ -135,8 +183,12 @@ interface ChatsFindResponse {
|
|
|
135
183
|
object: 'list';
|
|
136
184
|
data: ChatSummary[];
|
|
137
185
|
}
|
|
138
|
-
|
|
186
|
+
type ChatsInitRequest = {
|
|
139
187
|
name?: string;
|
|
188
|
+
chatPrivacy?: 'public' | 'private' | 'team-edit' | 'team' | 'unlisted';
|
|
189
|
+
projectId?: string;
|
|
190
|
+
} & ({
|
|
191
|
+
type: 'files';
|
|
140
192
|
files: Array<{
|
|
141
193
|
name: string;
|
|
142
194
|
url: string;
|
|
@@ -146,23 +198,50 @@ interface ChatsInitRequest {
|
|
|
146
198
|
content: string;
|
|
147
199
|
url?: never;
|
|
148
200
|
}>;
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
201
|
+
repo?: never;
|
|
202
|
+
registry?: never;
|
|
203
|
+
zip?: never;
|
|
204
|
+
} | {
|
|
205
|
+
type: 'repo';
|
|
206
|
+
repo: {
|
|
207
|
+
url: string;
|
|
208
|
+
branch?: string;
|
|
209
|
+
};
|
|
210
|
+
files?: never;
|
|
211
|
+
registry?: never;
|
|
212
|
+
zip?: never;
|
|
213
|
+
} | {
|
|
214
|
+
type: 'registry';
|
|
215
|
+
registry: {
|
|
216
|
+
url: string;
|
|
217
|
+
};
|
|
218
|
+
files?: never;
|
|
219
|
+
repo?: never;
|
|
220
|
+
zip?: never;
|
|
221
|
+
} | {
|
|
222
|
+
type: 'zip';
|
|
223
|
+
zip: {
|
|
224
|
+
url: string;
|
|
225
|
+
};
|
|
226
|
+
files?: never;
|
|
227
|
+
repo?: never;
|
|
228
|
+
registry?: never;
|
|
229
|
+
});
|
|
152
230
|
type ChatsInitResponse = {
|
|
153
231
|
id: string;
|
|
154
232
|
object: 'chat';
|
|
155
|
-
url: string;
|
|
156
233
|
shareable: boolean;
|
|
157
|
-
privacy
|
|
234
|
+
privacy: 'public' | 'private' | 'team' | 'team-edit' | 'unlisted';
|
|
158
235
|
name?: string;
|
|
159
236
|
/** @deprecated */
|
|
160
237
|
title?: string;
|
|
161
238
|
updatedAt?: string;
|
|
162
239
|
favorite: boolean;
|
|
163
240
|
authorId: string;
|
|
164
|
-
|
|
241
|
+
projectId?: string;
|
|
165
242
|
latestVersion?: VersionDetail;
|
|
243
|
+
url: string;
|
|
244
|
+
messages: MessageSummary[];
|
|
166
245
|
files?: {
|
|
167
246
|
lang: string;
|
|
168
247
|
meta: Record<string, any>;
|
|
@@ -179,17 +258,18 @@ interface ChatsDeleteResponse {
|
|
|
179
258
|
type ChatsGetByIdResponse = {
|
|
180
259
|
id: string;
|
|
181
260
|
object: 'chat';
|
|
182
|
-
url: string;
|
|
183
261
|
shareable: boolean;
|
|
184
|
-
privacy
|
|
262
|
+
privacy: 'public' | 'private' | 'team' | 'team-edit' | 'unlisted';
|
|
185
263
|
name?: string;
|
|
186
264
|
/** @deprecated */
|
|
187
265
|
title?: string;
|
|
188
266
|
updatedAt?: string;
|
|
189
267
|
favorite: boolean;
|
|
190
268
|
authorId: string;
|
|
191
|
-
|
|
269
|
+
projectId?: string;
|
|
192
270
|
latestVersion?: VersionDetail;
|
|
271
|
+
url: string;
|
|
272
|
+
messages: MessageSummary[];
|
|
193
273
|
files?: {
|
|
194
274
|
lang: string;
|
|
195
275
|
meta: Record<string, any>;
|
|
@@ -204,17 +284,18 @@ interface ChatsUpdateRequest {
|
|
|
204
284
|
type ChatsUpdateResponse = {
|
|
205
285
|
id: string;
|
|
206
286
|
object: 'chat';
|
|
207
|
-
url: string;
|
|
208
287
|
shareable: boolean;
|
|
209
|
-
privacy
|
|
288
|
+
privacy: 'public' | 'private' | 'team' | 'team-edit' | 'unlisted';
|
|
210
289
|
name?: string;
|
|
211
290
|
/** @deprecated */
|
|
212
291
|
title?: string;
|
|
213
292
|
updatedAt?: string;
|
|
214
293
|
favorite: boolean;
|
|
215
294
|
authorId: string;
|
|
216
|
-
|
|
295
|
+
projectId?: string;
|
|
217
296
|
latestVersion?: VersionDetail;
|
|
297
|
+
url: string;
|
|
298
|
+
messages: MessageSummary[];
|
|
218
299
|
files?: {
|
|
219
300
|
lang: string;
|
|
220
301
|
meta: Record<string, any>;
|
|
@@ -237,17 +318,18 @@ interface ChatsForkRequest {
|
|
|
237
318
|
type ChatsForkResponse = {
|
|
238
319
|
id: string;
|
|
239
320
|
object: 'chat';
|
|
240
|
-
url: string;
|
|
241
321
|
shareable: boolean;
|
|
242
|
-
privacy
|
|
322
|
+
privacy: 'public' | 'private' | 'team' | 'team-edit' | 'unlisted';
|
|
243
323
|
name?: string;
|
|
244
324
|
/** @deprecated */
|
|
245
325
|
title?: string;
|
|
246
326
|
updatedAt?: string;
|
|
247
327
|
favorite: boolean;
|
|
248
328
|
authorId: string;
|
|
249
|
-
|
|
329
|
+
projectId?: string;
|
|
250
330
|
latestVersion?: VersionDetail;
|
|
331
|
+
url: string;
|
|
332
|
+
messages: MessageSummary[];
|
|
251
333
|
files?: {
|
|
252
334
|
lang: string;
|
|
253
335
|
meta: Record<string, any>;
|
|
@@ -271,17 +353,18 @@ interface ChatsSendMessageRequest {
|
|
|
271
353
|
type ChatsSendMessageResponse = {
|
|
272
354
|
id: string;
|
|
273
355
|
object: 'chat';
|
|
274
|
-
url: string;
|
|
275
356
|
shareable: boolean;
|
|
276
|
-
privacy
|
|
357
|
+
privacy: 'public' | 'private' | 'team' | 'team-edit' | 'unlisted';
|
|
277
358
|
name?: string;
|
|
278
359
|
/** @deprecated */
|
|
279
360
|
title?: string;
|
|
280
361
|
updatedAt?: string;
|
|
281
362
|
favorite: boolean;
|
|
282
363
|
authorId: string;
|
|
283
|
-
|
|
364
|
+
projectId?: string;
|
|
284
365
|
latestVersion?: VersionDetail;
|
|
366
|
+
url: string;
|
|
367
|
+
messages: MessageSummary[];
|
|
285
368
|
files?: {
|
|
286
369
|
lang: string;
|
|
287
370
|
meta: Record<string, any>;
|
|
@@ -322,6 +405,30 @@ interface DeploymentsFindErrorsResponse {
|
|
|
322
405
|
errorType?: string;
|
|
323
406
|
formattedError?: string;
|
|
324
407
|
}
|
|
408
|
+
interface HooksFindResponse {
|
|
409
|
+
object: 'list';
|
|
410
|
+
data: HookSummary[];
|
|
411
|
+
}
|
|
412
|
+
interface HooksCreateRequest {
|
|
413
|
+
name: string;
|
|
414
|
+
events: Array<'chat.created' | 'chat.updated' | 'chat.deleted' | 'message.created' | 'message.updated' | 'message.deleted' | 'project.created' | 'project.updated' | 'project.deleted'>;
|
|
415
|
+
chatId?: string;
|
|
416
|
+
projectId?: string;
|
|
417
|
+
url: string;
|
|
418
|
+
}
|
|
419
|
+
type HooksCreateResponse = HookDetail;
|
|
420
|
+
type HooksGetByIdResponse = HookDetail;
|
|
421
|
+
interface HooksUpdateRequest {
|
|
422
|
+
name?: string;
|
|
423
|
+
events?: Array<'chat.created' | 'chat.updated' | 'chat.deleted' | 'message.created' | 'message.updated' | 'message.deleted' | 'project.created' | 'project.updated' | 'project.deleted'>;
|
|
424
|
+
url?: string;
|
|
425
|
+
}
|
|
426
|
+
type HooksUpdateResponse = HookDetail;
|
|
427
|
+
interface HooksDeleteResponse {
|
|
428
|
+
id: string;
|
|
429
|
+
object: 'hook';
|
|
430
|
+
deleted: true;
|
|
431
|
+
}
|
|
325
432
|
interface IntegrationsVercelProjectsFindResponse {
|
|
326
433
|
object: 'list';
|
|
327
434
|
data: VercelProjectDetail[];
|
|
@@ -333,7 +440,7 @@ interface IntegrationsVercelProjectsCreateRequest {
|
|
|
333
440
|
type IntegrationsVercelProjectsCreateResponse = VercelProjectDetail;
|
|
334
441
|
interface ProjectsFindResponse {
|
|
335
442
|
object: 'list';
|
|
336
|
-
data:
|
|
443
|
+
data: ProjectSummary[];
|
|
337
444
|
}
|
|
338
445
|
interface ProjectsCreateRequest {
|
|
339
446
|
name: string;
|
|
@@ -346,6 +453,7 @@ interface ProjectsCreateRequest {
|
|
|
346
453
|
instructions?: string;
|
|
347
454
|
}
|
|
348
455
|
type ProjectsCreateResponse = ProjectDetail;
|
|
456
|
+
type ProjectsGetByIdResponse = ProjectDetail;
|
|
349
457
|
interface ProjectsAssignRequest {
|
|
350
458
|
chatId: string;
|
|
351
459
|
}
|
|
@@ -453,6 +561,9 @@ declare function createClient(config?: V0ClientConfig): {
|
|
|
453
561
|
}): Promise<ProjectsGetByChatIdResponse>;
|
|
454
562
|
find(): Promise<ProjectsFindResponse>;
|
|
455
563
|
create(params: ProjectsCreateRequest): Promise<ProjectsCreateResponse>;
|
|
564
|
+
getById(params: {
|
|
565
|
+
projectId: string;
|
|
566
|
+
}): Promise<ProjectsGetByIdResponse>;
|
|
456
567
|
assign(params: {
|
|
457
568
|
projectId: string;
|
|
458
569
|
} & ProjectsAssignRequest): Promise<ProjectsAssignResponse>;
|
|
@@ -466,6 +577,19 @@ declare function createClient(config?: V0ClientConfig): {
|
|
|
466
577
|
deploymentId: string;
|
|
467
578
|
}): Promise<DeploymentsFindErrorsResponse>;
|
|
468
579
|
};
|
|
580
|
+
hooks: {
|
|
581
|
+
find(): Promise<HooksFindResponse>;
|
|
582
|
+
create(params: HooksCreateRequest): Promise<HooksCreateResponse>;
|
|
583
|
+
getById(params: {
|
|
584
|
+
hookId: string;
|
|
585
|
+
}): Promise<HooksGetByIdResponse>;
|
|
586
|
+
update(params: {
|
|
587
|
+
hookId: string;
|
|
588
|
+
} & HooksUpdateRequest): Promise<HooksUpdateResponse>;
|
|
589
|
+
delete(params: {
|
|
590
|
+
hookId: string;
|
|
591
|
+
}): Promise<HooksDeleteResponse>;
|
|
592
|
+
};
|
|
469
593
|
integrations: {
|
|
470
594
|
vercel: {
|
|
471
595
|
projects: {
|
|
@@ -529,6 +653,9 @@ declare const v0: {
|
|
|
529
653
|
}): Promise<ProjectsGetByChatIdResponse>;
|
|
530
654
|
find(): Promise<ProjectsFindResponse>;
|
|
531
655
|
create(params: ProjectsCreateRequest): Promise<ProjectsCreateResponse>;
|
|
656
|
+
getById(params: {
|
|
657
|
+
projectId: string;
|
|
658
|
+
}): Promise<ProjectsGetByIdResponse>;
|
|
532
659
|
assign(params: {
|
|
533
660
|
projectId: string;
|
|
534
661
|
} & ProjectsAssignRequest): Promise<ProjectsAssignResponse>;
|
|
@@ -542,6 +669,19 @@ declare const v0: {
|
|
|
542
669
|
deploymentId: string;
|
|
543
670
|
}): Promise<DeploymentsFindErrorsResponse>;
|
|
544
671
|
};
|
|
672
|
+
hooks: {
|
|
673
|
+
find(): Promise<HooksFindResponse>;
|
|
674
|
+
create(params: HooksCreateRequest): Promise<HooksCreateResponse>;
|
|
675
|
+
getById(params: {
|
|
676
|
+
hookId: string;
|
|
677
|
+
}): Promise<HooksGetByIdResponse>;
|
|
678
|
+
update(params: {
|
|
679
|
+
hookId: string;
|
|
680
|
+
} & HooksUpdateRequest): Promise<HooksUpdateResponse>;
|
|
681
|
+
delete(params: {
|
|
682
|
+
hookId: string;
|
|
683
|
+
}): Promise<HooksDeleteResponse>;
|
|
684
|
+
};
|
|
545
685
|
integrations: {
|
|
546
686
|
vercel: {
|
|
547
687
|
projects: {
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sources":["../src/sdk/v0.ts"],"sourcesContent":["import { createFetcher } from './core'\n\nexport type ChatDetail = {\n id: string\n object: 'chat'\n url: string\n shareable: boolean\n privacy?: 'public' | 'private' | 'team' | 'team-edit' | 'unlisted'\n name?: string\n /** @deprecated */\n title?: string\n updatedAt?: string\n favorite: boolean\n authorId: string\n messages: Array<{\n id: string\n object: 'message'\n content: string\n createdAt: string\n type:\n | 'message'\n | 'forked-block'\n | 'forked-chat'\n | 'open-in-v0'\n | 'refinement'\n | 'added-environment-variables'\n | 'added-integration'\n | 'deleted-file'\n | 'moved-file'\n | 'renamed-file'\n | 'edited-file'\n | 'replace-src'\n | 'reverted-block'\n | 'fix-with-v0'\n | 'sync-git'\n role: 'user' | 'assistant'\n }>\n latestVersion?: {\n id: string\n object: 'version'\n status: 'pending' | 'completed' | 'failed'\n files: {\n object: 'file'\n name: string\n content: string\n }[]\n }\n files?: {\n lang: string\n meta: Record<string, any>\n source: string\n }[]\n demo?: string\n text: string\n modelConfiguration: {\n modelId: 'v0-1.5-sm' | 'v0-1.5-md' | 'v0-1.5-lg'\n imageGenerations?: boolean\n thinking?: boolean\n }\n}\n\nexport type ChatSummary = {\n id: string\n object: 'chat'\n shareable: boolean\n privacy: 'public' | 'private' | 'team' | 'team-edit' | 'unlisted'\n name?: string\n /** @deprecated */\n title?: string\n updatedAt: string\n favorite: boolean\n authorId: string\n latestVersion?: {\n id: string\n object: 'version'\n status: 'pending' | 'completed' | 'failed'\n }\n}\n\nexport interface FileDetail {\n object: 'file'\n name: string\n content: string\n}\n\nexport interface FileSummary {\n object: 'file'\n name: string\n}\n\nexport type MessageDetail = {\n id: string\n object: 'message'\n chatId: string\n url: string\n files: {\n object: 'file'\n name: string\n }[]\n demo?: string\n text: string\n modelConfiguration: {\n modelId: 'v0-1.5-sm' | 'v0-1.5-md' | 'v0-1.5-lg'\n imageGenerations?: boolean\n thinking?: boolean\n }\n}\n\nexport type MessageSummary = {\n id: string\n object: 'message'\n content: string\n createdAt: string\n type:\n | 'message'\n | 'forked-block'\n | 'forked-chat'\n | 'open-in-v0'\n | 'refinement'\n | 'added-environment-variables'\n | 'added-integration'\n | 'deleted-file'\n | 'moved-file'\n | 'renamed-file'\n | 'edited-file'\n | 'replace-src'\n | 'reverted-block'\n | 'fix-with-v0'\n | 'sync-git'\n role: 'user' | 'assistant'\n}\n\nexport interface ProjectDetail {\n id: string\n object: 'project'\n name: string\n vercelProjectId?: string\n}\n\nexport interface ProjectSummary {\n id: string\n object: 'project'\n name: string\n vercelProjectId?: string\n}\n\nexport interface ScopeSummary {\n id: string\n object: 'scope'\n name?: string\n}\n\nexport interface UserDetail {\n id: string\n object: 'user'\n name?: string\n email: string\n avatar: string\n}\n\nexport interface VercelProjectDetail {\n id: string\n object: 'vercel_project'\n name: string\n}\n\nexport type VersionDetail = {\n id: string\n object: 'version'\n status: 'pending' | 'completed' | 'failed'\n files: {\n object: 'file'\n name: string\n content: string\n }[]\n}\n\nexport type VersionSummary = {\n id: string\n object: 'version'\n status: 'pending' | 'completed' | 'failed'\n}\n\nexport interface ChatsCreateRequest {\n message: string\n attachments?: {\n url: string\n }[]\n system?: string\n chatPrivacy?: 'public' | 'private' | 'team-edit' | 'team' | 'unlisted'\n projectId?: string\n modelConfiguration?: {\n modelId: 'v0-1.5-sm' | 'v0-1.5-md' | 'v0-1.5-lg'\n imageGenerations?: boolean\n thinking?: boolean\n }\n}\n\nexport type ChatsCreateResponse = ChatDetail\n\nexport interface ChatsFindResponse {\n object: 'list'\n data: ChatSummary[]\n}\n\nexport interface ChatsInitRequest {\n name?: string\n files: Array<\n | {\n name: string\n url: string\n content?: never\n }\n | {\n name: string\n content: string\n url?: never\n }\n >\n chatPrivacy?: 'public' | 'private' | 'team-edit' | 'team' | 'unlisted'\n projectId?: string\n}\n\nexport type ChatsInitResponse = {\n id: string\n object: 'chat'\n url: string\n shareable: boolean\n privacy?: 'public' | 'private' | 'team' | 'team-edit' | 'unlisted'\n name?: string\n /** @deprecated */\n title?: string\n updatedAt?: string\n favorite: boolean\n authorId: string\n messages: MessageSummary[]\n latestVersion?: VersionDetail\n files?: {\n lang: string\n meta: Record<string, any>\n source: string\n }[]\n demo?: string\n text: string\n}\n\nexport interface ChatsDeleteResponse {\n id: string\n object: 'chat'\n deleted: true\n}\n\nexport type ChatsGetByIdResponse = {\n id: string\n object: 'chat'\n url: string\n shareable: boolean\n privacy?: 'public' | 'private' | 'team' | 'team-edit' | 'unlisted'\n name?: string\n /** @deprecated */\n title?: string\n updatedAt?: string\n favorite: boolean\n authorId: string\n messages: MessageSummary[]\n latestVersion?: VersionDetail\n files?: {\n lang: string\n meta: Record<string, any>\n source: string\n }[]\n demo?: string\n text: string\n}\n\nexport interface ChatsUpdateRequest {\n privacy?: 'public' | 'private' | 'team' | 'team-edit' | 'unlisted'\n}\n\nexport type ChatsUpdateResponse = {\n id: string\n object: 'chat'\n url: string\n shareable: boolean\n privacy?: 'public' | 'private' | 'team' | 'team-edit' | 'unlisted'\n name?: string\n /** @deprecated */\n title?: string\n updatedAt?: string\n favorite: boolean\n authorId: string\n messages: MessageSummary[]\n latestVersion?: VersionDetail\n files?: {\n lang: string\n meta: Record<string, any>\n source: string\n }[]\n demo?: string\n text: string\n}\n\nexport interface ChatsFavoriteRequest {\n isFavorite: boolean\n}\n\nexport interface ChatsFavoriteResponse {\n id: string\n object: 'chat'\n favorited: boolean\n}\n\nexport interface ChatsForkRequest {\n versionId?: string\n}\n\nexport type ChatsForkResponse = {\n id: string\n object: 'chat'\n url: string\n shareable: boolean\n privacy?: 'public' | 'private' | 'team' | 'team-edit' | 'unlisted'\n name?: string\n /** @deprecated */\n title?: string\n updatedAt?: string\n favorite: boolean\n authorId: string\n messages: MessageSummary[]\n latestVersion?: VersionDetail\n files?: {\n lang: string\n meta: Record<string, any>\n source: string\n }[]\n demo?: string\n text: string\n}\n\nexport type ProjectsGetByChatIdResponse = ProjectDetail\n\nexport interface ChatsSendMessageRequest {\n message: string\n attachments?: {\n url: string\n }[]\n modelConfiguration?: {\n modelId: 'v0-1.5-sm' | 'v0-1.5-md' | 'v0-1.5-lg'\n imageGenerations?: boolean\n thinking?: boolean\n }\n}\n\nexport type ChatsSendMessageResponse = {\n id: string\n object: 'chat'\n url: string\n shareable: boolean\n privacy?: 'public' | 'private' | 'team' | 'team-edit' | 'unlisted'\n name?: string\n /** @deprecated */\n title?: string\n updatedAt?: string\n favorite: boolean\n authorId: string\n messages: MessageSummary[]\n latestVersion?: VersionDetail\n files?: {\n lang: string\n meta: Record<string, any>\n source: string\n }[]\n demo?: string\n text: string\n modelConfiguration: {\n modelId: 'v0-1.5-sm' | 'v0-1.5-md' | 'v0-1.5-lg'\n imageGenerations?: boolean\n thinking?: boolean\n }\n chatId: string\n}\n\nexport interface ChatsGetMetadataResponse {\n git: {\n branch: string\n commit: string\n }\n deployment: {\n id: string\n }\n project: {\n id: string\n name: string\n url: string\n }\n}\n\nexport type ChatsResumeResponse = MessageDetail\n\nexport interface DeploymentsFindLogsResponse {\n error?: string\n logs: string[]\n nextSince?: number\n}\n\nexport interface DeploymentsFindErrorsResponse {\n error?: string\n fullErrorText?: string\n errorType?: string\n formattedError?: string\n}\n\nexport interface IntegrationsVercelProjectsFindResponse {\n object: 'list'\n data: VercelProjectDetail[]\n}\n\nexport interface IntegrationsVercelProjectsCreateRequest {\n projectId: string\n name: string\n}\n\nexport type IntegrationsVercelProjectsCreateResponse = VercelProjectDetail\n\nexport interface ProjectsFindResponse {\n object: 'list'\n data: ProjectDetail[]\n}\n\nexport interface ProjectsCreateRequest {\n name: string\n description?: string\n icon?: string\n environmentVariables?: {\n key: string\n value: string\n }[]\n instructions?: string\n}\n\nexport type ProjectsCreateResponse = ProjectDetail\n\nexport interface ProjectsAssignRequest {\n chatId: string\n}\n\nexport interface ProjectsAssignResponse {\n object: 'project'\n id: string\n assigned: true\n}\n\nexport interface RateLimitsFindResponse {\n remaining?: number\n reset?: number\n limit: number\n}\n\nexport type UserGetResponse = UserDetail\n\nexport type UserGetBillingResponse =\n | {\n billingType: 'token'\n data: {\n plan: string\n billingMode?: 'test'\n role: string\n billingCycle: {\n start: number\n end: number\n }\n balance: {\n remaining: number\n total: number\n }\n onDemand: {\n balance: number\n blocks?: {\n expirationDate?: number\n effectiveDate: number\n originalBalance: number\n currentBalance: number\n }[]\n }\n }\n }\n | {\n billingType: 'legacy'\n data: {\n remaining?: number\n reset?: number\n limit: number\n }\n }\n\nexport interface UserGetPlanResponse {\n object: 'plan'\n plan: string\n billingCycle: {\n start: number\n end: number\n }\n balance: {\n remaining: number\n total: number\n }\n}\n\nexport interface UserGetScopesResponse {\n object: 'list'\n data: ScopeSummary[]\n}\n\nexport interface V0ClientConfig {\n apiKey?: string\n baseUrl?: string\n}\n\nexport function createClient(config: V0ClientConfig = {}) {\n const fetcher = createFetcher(config)\n\n return {\n chats: {\n async create(params: ChatsCreateRequest): Promise<ChatsCreateResponse> {\n const body = {\n message: params.message,\n attachments: params.attachments,\n system: params.system,\n chatPrivacy: params.chatPrivacy,\n projectId: params.projectId,\n modelConfiguration: params.modelConfiguration,\n }\n return fetcher(`/chats`, 'POST', { body })\n },\n\n async find(params?: {\n limit?: string\n offset?: string\n isFavorite?: string\n }): Promise<ChatsFindResponse> {\n const query = params\n ? (Object.fromEntries(\n Object.entries({\n limit: params.limit,\n offset: params.offset,\n isFavorite: params.isFavorite,\n }).filter(([_, value]) => value !== undefined),\n ) as Record<string, string>)\n : {}\n const hasQuery = Object.keys(query).length > 0\n return fetcher(`/chats`, 'GET', { ...(hasQuery ? { query } : {}) })\n },\n\n async init(params: ChatsInitRequest): Promise<ChatsInitResponse> {\n const body = {\n name: params.name,\n files: params.files,\n chatPrivacy: params.chatPrivacy,\n projectId: params.projectId,\n }\n return fetcher(`/chats/init`, 'POST', { body })\n },\n\n async delete(params: { chatId: string }): Promise<ChatsDeleteResponse> {\n const pathParams = { chatId: params.chatId }\n return fetcher(`/chats/${pathParams.chatId}`, 'DELETE', { pathParams })\n },\n\n async getById(params: { chatId: string }): Promise<ChatsGetByIdResponse> {\n const pathParams = { chatId: params.chatId }\n return fetcher(`/chats/${pathParams.chatId}`, 'GET', { pathParams })\n },\n\n async update(\n params: { chatId: string } & ChatsUpdateRequest,\n ): Promise<ChatsUpdateResponse> {\n const pathParams = { chatId: params.chatId }\n const body = { privacy: params.privacy }\n return fetcher(`/chats/${pathParams.chatId}`, 'PATCH', {\n pathParams,\n body,\n })\n },\n\n async favorite(\n params: { chatId: string } & ChatsFavoriteRequest,\n ): Promise<ChatsFavoriteResponse> {\n const pathParams = { chatId: params.chatId }\n const body = { isFavorite: params.isFavorite }\n return fetcher(`/chats/${pathParams.chatId}/favorite`, 'PUT', {\n pathParams,\n body,\n })\n },\n\n async fork(\n params: { chatId: string } & ChatsForkRequest,\n ): Promise<ChatsForkResponse> {\n const pathParams = { chatId: params.chatId }\n const body = { versionId: params.versionId }\n return fetcher(`/chats/${pathParams.chatId}/fork`, 'POST', {\n pathParams,\n body,\n })\n },\n\n async sendMessage(\n params: { chatId: string } & ChatsSendMessageRequest,\n ): Promise<ChatsSendMessageResponse> {\n const pathParams = { chatId: params.chatId }\n const body = {\n message: params.message,\n attachments: params.attachments,\n modelConfiguration: params.modelConfiguration,\n }\n return fetcher(`/chats/${pathParams.chatId}/messages`, 'POST', {\n pathParams,\n body,\n })\n },\n\n async getMetadata(params: {\n chatId: string\n }): Promise<ChatsGetMetadataResponse> {\n const pathParams = { chatId: params.chatId }\n return fetcher(`/chats/${pathParams.chatId}/metadata`, 'GET', {\n pathParams,\n })\n },\n\n async resume(params: {\n chatId: string\n messageId: string\n }): Promise<ChatsResumeResponse> {\n const pathParams = {\n chatId: params.chatId,\n messageId: params.messageId,\n }\n return fetcher(\n `/chats/${pathParams.chatId}/messages/${pathParams.messageId}/resume`,\n 'POST',\n { pathParams },\n )\n },\n },\n\n projects: {\n async getByChatId(params: {\n chatId: string\n }): Promise<ProjectsGetByChatIdResponse> {\n const pathParams = { chatId: params.chatId }\n return fetcher(`/chats/${pathParams.chatId}/project`, 'GET', {\n pathParams,\n })\n },\n\n async find(): Promise<ProjectsFindResponse> {\n return fetcher(`/projects`, 'GET', {})\n },\n\n async create(\n params: ProjectsCreateRequest,\n ): Promise<ProjectsCreateResponse> {\n const body = {\n name: params.name,\n description: params.description,\n icon: params.icon,\n environmentVariables: params.environmentVariables,\n instructions: params.instructions,\n }\n return fetcher(`/projects`, 'POST', { body })\n },\n\n async assign(\n params: { projectId: string } & ProjectsAssignRequest,\n ): Promise<ProjectsAssignResponse> {\n const pathParams = { projectId: params.projectId }\n const body = { chatId: params.chatId }\n return fetcher(`/projects/${pathParams.projectId}/assign`, 'POST', {\n pathParams,\n body,\n })\n },\n },\n\n deployments: {\n async findLogs(params: {\n deploymentId: string\n since?: string\n }): Promise<DeploymentsFindLogsResponse> {\n const pathParams = { deploymentId: params.deploymentId }\n const query = Object.fromEntries(\n Object.entries({\n since: params.since,\n }).filter(([_, value]) => value !== undefined),\n ) as Record<string, string>\n const hasQuery = Object.keys(query).length > 0\n return fetcher(`/deployments/${pathParams.deploymentId}/logs`, 'GET', {\n pathParams,\n ...(hasQuery ? { query } : {}),\n })\n },\n\n async findErrors(params: {\n deploymentId: string\n }): Promise<DeploymentsFindErrorsResponse> {\n const pathParams = { deploymentId: params.deploymentId }\n return fetcher(\n `/deployments/${pathParams.deploymentId}/errors`,\n 'GET',\n { pathParams },\n )\n },\n },\n\n integrations: {\n vercel: {\n projects: {\n async find(): Promise<IntegrationsVercelProjectsFindResponse> {\n return fetcher(`/integrations/vercel/projects`, 'GET', {})\n },\n\n async create(\n params: IntegrationsVercelProjectsCreateRequest,\n ): Promise<IntegrationsVercelProjectsCreateResponse> {\n const body = { projectId: params.projectId, name: params.name }\n return fetcher(`/integrations/vercel/projects`, 'POST', { body })\n },\n },\n },\n },\n\n rateLimits: {\n async find(params?: { scope?: string }): Promise<RateLimitsFindResponse> {\n const query = params\n ? (Object.fromEntries(\n Object.entries({\n scope: params.scope,\n }).filter(([_, value]) => value !== undefined),\n ) as Record<string, string>)\n : {}\n const hasQuery = Object.keys(query).length > 0\n return fetcher(`/rate-limits`, 'GET', {\n ...(hasQuery ? { query } : {}),\n })\n },\n },\n\n user: {\n async get(): Promise<UserGetResponse> {\n return fetcher(`/user`, 'GET', {})\n },\n\n async getBilling(params?: {\n scope?: string\n }): Promise<UserGetBillingResponse> {\n const query = params\n ? (Object.fromEntries(\n Object.entries({\n scope: params.scope,\n }).filter(([_, value]) => value !== undefined),\n ) as Record<string, string>)\n : {}\n const hasQuery = Object.keys(query).length > 0\n return fetcher(`/user/billing`, 'GET', {\n ...(hasQuery ? { query } : {}),\n })\n },\n\n async getPlan(): Promise<UserGetPlanResponse> {\n return fetcher(`/user/plan`, 'GET', {})\n },\n\n async getScopes(): Promise<UserGetScopesResponse> {\n return fetcher(`/user/scopes`, 'GET', {})\n },\n },\n }\n}\n\n// Default client for backward compatibility\nexport const v0 = createClient()\n"],"names":[],"mappings":"AAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAUO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AAOO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACA;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACA;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACA;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACO;AACA;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACA;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACA;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":["../src/sdk/v0.ts"],"sourcesContent":["import { createFetcher } from './core'\n\nexport type ChatDetail = {\n id: string\n object: 'chat'\n shareable: boolean\n privacy: 'public' | 'private' | 'team' | 'team-edit' | 'unlisted'\n name?: string\n /** @deprecated */\n title?: string\n updatedAt?: string\n favorite: boolean\n authorId: string\n projectId?: string\n latestVersion?: {\n id: string\n object: 'version'\n status: 'pending' | 'completed' | 'failed'\n files: {\n object: 'file'\n name: string\n content: string\n }[]\n }\n url: string\n messages: Array<{\n id: string\n object: 'message'\n content: string\n createdAt: string\n type:\n | 'message'\n | 'forked-block'\n | 'forked-chat'\n | 'open-in-v0'\n | 'refinement'\n | 'added-environment-variables'\n | 'added-integration'\n | 'deleted-file'\n | 'moved-file'\n | 'renamed-file'\n | 'edited-file'\n | 'replace-src'\n | 'reverted-block'\n | 'fix-with-v0'\n | 'sync-git'\n role: 'user' | 'assistant'\n }>\n files?: {\n lang: string\n meta: Record<string, any>\n source: string\n }[]\n demo?: string\n text: string\n modelConfiguration: {\n modelId: 'v0-1.5-sm' | 'v0-1.5-md' | 'v0-1.5-lg'\n imageGenerations?: boolean\n thinking?: boolean\n }\n}\n\nexport type ChatSummary = {\n id: string\n object: 'chat'\n shareable: boolean\n privacy: 'public' | 'private' | 'team' | 'team-edit' | 'unlisted'\n name?: string\n /** @deprecated */\n title?: string\n updatedAt?: string\n favorite: boolean\n authorId: string\n projectId?: string\n latestVersion?: {\n id: string\n object: 'version'\n status: 'pending' | 'completed' | 'failed'\n }\n}\n\nexport interface FileDetail {\n object: 'file'\n name: string\n content: string\n}\n\nexport interface FileSummary {\n object: 'file'\n name: string\n}\n\nexport type HookDetail = {\n id: string\n object: 'hook'\n name: string\n events: Array<\n | 'chat.created'\n | 'chat.updated'\n | 'chat.deleted'\n | 'message.created'\n | 'message.updated'\n | 'message.deleted'\n | 'project.created'\n | 'project.updated'\n | 'project.deleted'\n >\n chatId?: string\n projectId?: string\n url: string\n}\n\nexport type HookEventDetail = {\n id: string\n object: 'hookEvent'\n event:\n | 'chat.created'\n | 'chat.updated'\n | 'chat.deleted'\n | 'message.created'\n | 'message.updated'\n | 'message.deleted'\n | 'project.created'\n | 'project.updated'\n | 'project.deleted'\n status?: 'pending' | 'success' | 'error'\n createdAt: string\n}\n\nexport interface HookSummary {\n id: string\n object: 'hook'\n name: string\n}\n\nexport type MessageDetail = {\n id: string\n object: 'message'\n chatId: string\n url: string\n files: {\n object: 'file'\n name: string\n }[]\n demo?: string\n text: string\n modelConfiguration: {\n modelId: 'v0-1.5-sm' | 'v0-1.5-md' | 'v0-1.5-lg'\n imageGenerations?: boolean\n thinking?: boolean\n }\n}\n\nexport type MessageSummary = {\n id: string\n object: 'message'\n content: string\n createdAt: string\n type:\n | 'message'\n | 'forked-block'\n | 'forked-chat'\n | 'open-in-v0'\n | 'refinement'\n | 'added-environment-variables'\n | 'added-integration'\n | 'deleted-file'\n | 'moved-file'\n | 'renamed-file'\n | 'edited-file'\n | 'replace-src'\n | 'reverted-block'\n | 'fix-with-v0'\n | 'sync-git'\n role: 'user' | 'assistant'\n}\n\nexport type ProjectDetail = {\n id: string\n object: 'project'\n name: string\n vercelProjectId?: string\n createdAt: string\n updatedAt?: string\n apiUrl: string\n webUrl: string\n chats: Array<{\n id: string\n object: 'chat'\n shareable: boolean\n privacy: 'public' | 'private' | 'team' | 'team-edit' | 'unlisted'\n name?: string\n /** @deprecated */\n title?: string\n updatedAt?: string\n favorite: boolean\n authorId: string\n projectId?: string\n latestVersion?: {\n id: string\n object: 'version'\n status: 'pending' | 'completed' | 'failed'\n }\n }>\n}\n\nexport interface ProjectSummary {\n id: string\n object: 'project'\n name: string\n vercelProjectId?: string\n createdAt: string\n updatedAt?: string\n apiUrl: string\n webUrl: string\n}\n\nexport interface ScopeSummary {\n id: string\n object: 'scope'\n name?: string\n}\n\nexport interface UserDetail {\n id: string\n object: 'user'\n name?: string\n email: string\n avatar: string\n}\n\nexport interface VercelProjectDetail {\n id: string\n object: 'vercel_project'\n name: string\n}\n\nexport type VersionDetail = {\n id: string\n object: 'version'\n status: 'pending' | 'completed' | 'failed'\n files: {\n object: 'file'\n name: string\n content: string\n }[]\n}\n\nexport type VersionSummary = {\n id: string\n object: 'version'\n status: 'pending' | 'completed' | 'failed'\n}\n\nexport interface ChatsCreateRequest {\n message: string\n attachments?: {\n url: string\n }[]\n system?: string\n chatPrivacy?: 'public' | 'private' | 'team-edit' | 'team' | 'unlisted'\n projectId?: string\n modelConfiguration?: {\n modelId: 'v0-1.5-sm' | 'v0-1.5-md' | 'v0-1.5-lg'\n imageGenerations?: boolean\n thinking?: boolean\n }\n}\n\nexport type ChatsCreateResponse = ChatDetail\n\nexport interface ChatsFindResponse {\n object: 'list'\n data: ChatSummary[]\n}\n\nexport type ChatsInitRequest = {\n name?: string\n chatPrivacy?: 'public' | 'private' | 'team-edit' | 'team' | 'unlisted'\n projectId?: string\n} & (\n | {\n type: 'files'\n files: Array<\n | {\n name: string\n url: string\n content?: never\n }\n | {\n name: string\n content: string\n url?: never\n }\n >\n repo?: never\n registry?: never\n zip?: never\n }\n | {\n type: 'repo'\n repo: {\n url: string\n branch?: string\n }\n files?: never\n registry?: never\n zip?: never\n }\n | {\n type: 'registry'\n registry: {\n url: string\n }\n files?: never\n repo?: never\n zip?: never\n }\n | {\n type: 'zip'\n zip: {\n url: string\n }\n files?: never\n repo?: never\n registry?: never\n }\n)\n\nexport type ChatsInitResponse = {\n id: string\n object: 'chat'\n shareable: boolean\n privacy: 'public' | 'private' | 'team' | 'team-edit' | 'unlisted'\n name?: string\n /** @deprecated */\n title?: string\n updatedAt?: string\n favorite: boolean\n authorId: string\n projectId?: string\n latestVersion?: VersionDetail\n url: string\n messages: MessageSummary[]\n files?: {\n lang: string\n meta: Record<string, any>\n source: string\n }[]\n demo?: string\n text: string\n}\n\nexport interface ChatsDeleteResponse {\n id: string\n object: 'chat'\n deleted: true\n}\n\nexport type ChatsGetByIdResponse = {\n id: string\n object: 'chat'\n shareable: boolean\n privacy: 'public' | 'private' | 'team' | 'team-edit' | 'unlisted'\n name?: string\n /** @deprecated */\n title?: string\n updatedAt?: string\n favorite: boolean\n authorId: string\n projectId?: string\n latestVersion?: VersionDetail\n url: string\n messages: MessageSummary[]\n files?: {\n lang: string\n meta: Record<string, any>\n source: string\n }[]\n demo?: string\n text: string\n}\n\nexport interface ChatsUpdateRequest {\n privacy?: 'public' | 'private' | 'team' | 'team-edit' | 'unlisted'\n}\n\nexport type ChatsUpdateResponse = {\n id: string\n object: 'chat'\n shareable: boolean\n privacy: 'public' | 'private' | 'team' | 'team-edit' | 'unlisted'\n name?: string\n /** @deprecated */\n title?: string\n updatedAt?: string\n favorite: boolean\n authorId: string\n projectId?: string\n latestVersion?: VersionDetail\n url: string\n messages: MessageSummary[]\n files?: {\n lang: string\n meta: Record<string, any>\n source: string\n }[]\n demo?: string\n text: string\n}\n\nexport interface ChatsFavoriteRequest {\n isFavorite: boolean\n}\n\nexport interface ChatsFavoriteResponse {\n id: string\n object: 'chat'\n favorited: boolean\n}\n\nexport interface ChatsForkRequest {\n versionId?: string\n}\n\nexport type ChatsForkResponse = {\n id: string\n object: 'chat'\n shareable: boolean\n privacy: 'public' | 'private' | 'team' | 'team-edit' | 'unlisted'\n name?: string\n /** @deprecated */\n title?: string\n updatedAt?: string\n favorite: boolean\n authorId: string\n projectId?: string\n latestVersion?: VersionDetail\n url: string\n messages: MessageSummary[]\n files?: {\n lang: string\n meta: Record<string, any>\n source: string\n }[]\n demo?: string\n text: string\n}\n\nexport type ProjectsGetByChatIdResponse = ProjectDetail\n\nexport interface ChatsSendMessageRequest {\n message: string\n attachments?: {\n url: string\n }[]\n modelConfiguration?: {\n modelId: 'v0-1.5-sm' | 'v0-1.5-md' | 'v0-1.5-lg'\n imageGenerations?: boolean\n thinking?: boolean\n }\n}\n\nexport type ChatsSendMessageResponse = {\n id: string\n object: 'chat'\n shareable: boolean\n privacy: 'public' | 'private' | 'team' | 'team-edit' | 'unlisted'\n name?: string\n /** @deprecated */\n title?: string\n updatedAt?: string\n favorite: boolean\n authorId: string\n projectId?: string\n latestVersion?: VersionDetail\n url: string\n messages: MessageSummary[]\n files?: {\n lang: string\n meta: Record<string, any>\n source: string\n }[]\n demo?: string\n text: string\n modelConfiguration: {\n modelId: 'v0-1.5-sm' | 'v0-1.5-md' | 'v0-1.5-lg'\n imageGenerations?: boolean\n thinking?: boolean\n }\n chatId: string\n}\n\nexport interface ChatsGetMetadataResponse {\n git: {\n branch: string\n commit: string\n }\n deployment: {\n id: string\n }\n project: {\n id: string\n name: string\n url: string\n }\n}\n\nexport type ChatsResumeResponse = MessageDetail\n\nexport interface DeploymentsFindLogsResponse {\n error?: string\n logs: string[]\n nextSince?: number\n}\n\nexport interface DeploymentsFindErrorsResponse {\n error?: string\n fullErrorText?: string\n errorType?: string\n formattedError?: string\n}\n\nexport interface HooksFindResponse {\n object: 'list'\n data: HookSummary[]\n}\n\nexport interface HooksCreateRequest {\n name: string\n events: Array<\n | 'chat.created'\n | 'chat.updated'\n | 'chat.deleted'\n | 'message.created'\n | 'message.updated'\n | 'message.deleted'\n | 'project.created'\n | 'project.updated'\n | 'project.deleted'\n >\n chatId?: string\n projectId?: string\n url: string\n}\n\nexport type HooksCreateResponse = HookDetail\n\nexport type HooksGetByIdResponse = HookDetail\n\nexport interface HooksUpdateRequest {\n name?: string\n events?: Array<\n | 'chat.created'\n | 'chat.updated'\n | 'chat.deleted'\n | 'message.created'\n | 'message.updated'\n | 'message.deleted'\n | 'project.created'\n | 'project.updated'\n | 'project.deleted'\n >\n url?: string\n}\n\nexport type HooksUpdateResponse = HookDetail\n\nexport interface HooksDeleteResponse {\n id: string\n object: 'hook'\n deleted: true\n}\n\nexport interface IntegrationsVercelProjectsFindResponse {\n object: 'list'\n data: VercelProjectDetail[]\n}\n\nexport interface IntegrationsVercelProjectsCreateRequest {\n projectId: string\n name: string\n}\n\nexport type IntegrationsVercelProjectsCreateResponse = VercelProjectDetail\n\nexport interface ProjectsFindResponse {\n object: 'list'\n data: ProjectSummary[]\n}\n\nexport interface ProjectsCreateRequest {\n name: string\n description?: string\n icon?: string\n environmentVariables?: {\n key: string\n value: string\n }[]\n instructions?: string\n}\n\nexport type ProjectsCreateResponse = ProjectDetail\n\nexport type ProjectsGetByIdResponse = ProjectDetail\n\nexport interface ProjectsAssignRequest {\n chatId: string\n}\n\nexport interface ProjectsAssignResponse {\n object: 'project'\n id: string\n assigned: true\n}\n\nexport interface RateLimitsFindResponse {\n remaining?: number\n reset?: number\n limit: number\n}\n\nexport type UserGetResponse = UserDetail\n\nexport type UserGetBillingResponse =\n | {\n billingType: 'token'\n data: {\n plan: string\n billingMode?: 'test'\n role: string\n billingCycle: {\n start: number\n end: number\n }\n balance: {\n remaining: number\n total: number\n }\n onDemand: {\n balance: number\n blocks?: {\n expirationDate?: number\n effectiveDate: number\n originalBalance: number\n currentBalance: number\n }[]\n }\n }\n }\n | {\n billingType: 'legacy'\n data: {\n remaining?: number\n reset?: number\n limit: number\n }\n }\n\nexport interface UserGetPlanResponse {\n object: 'plan'\n plan: string\n billingCycle: {\n start: number\n end: number\n }\n balance: {\n remaining: number\n total: number\n }\n}\n\nexport interface UserGetScopesResponse {\n object: 'list'\n data: ScopeSummary[]\n}\n\nexport interface V0ClientConfig {\n apiKey?: string\n baseUrl?: string\n}\n\nexport function createClient(config: V0ClientConfig = {}) {\n const fetcher = createFetcher(config)\n\n return {\n chats: {\n async create(params: ChatsCreateRequest): Promise<ChatsCreateResponse> {\n const body = {\n message: params.message,\n attachments: params.attachments,\n system: params.system,\n chatPrivacy: params.chatPrivacy,\n projectId: params.projectId,\n modelConfiguration: params.modelConfiguration,\n }\n return fetcher(`/chats`, 'POST', { body })\n },\n\n async find(params?: {\n limit?: string\n offset?: string\n isFavorite?: string\n }): Promise<ChatsFindResponse> {\n const query = params\n ? (Object.fromEntries(\n Object.entries({\n limit: params.limit,\n offset: params.offset,\n isFavorite: params.isFavorite,\n }).filter(([_, value]) => value !== undefined),\n ) as Record<string, string>)\n : {}\n const hasQuery = Object.keys(query).length > 0\n return fetcher(`/chats`, 'GET', { ...(hasQuery ? { query } : {}) })\n },\n\n async init(params: ChatsInitRequest): Promise<ChatsInitResponse> {\n const body = params\n return fetcher(`/chats/init`, 'POST', { body })\n },\n\n async delete(params: { chatId: string }): Promise<ChatsDeleteResponse> {\n const pathParams = { chatId: params.chatId }\n return fetcher(`/chats/${pathParams.chatId}`, 'DELETE', { pathParams })\n },\n\n async getById(params: { chatId: string }): Promise<ChatsGetByIdResponse> {\n const pathParams = { chatId: params.chatId }\n return fetcher(`/chats/${pathParams.chatId}`, 'GET', { pathParams })\n },\n\n async update(\n params: { chatId: string } & ChatsUpdateRequest,\n ): Promise<ChatsUpdateResponse> {\n const pathParams = { chatId: params.chatId }\n const body = { privacy: params.privacy }\n return fetcher(`/chats/${pathParams.chatId}`, 'PATCH', {\n pathParams,\n body,\n })\n },\n\n async favorite(\n params: { chatId: string } & ChatsFavoriteRequest,\n ): Promise<ChatsFavoriteResponse> {\n const pathParams = { chatId: params.chatId }\n const body = { isFavorite: params.isFavorite }\n return fetcher(`/chats/${pathParams.chatId}/favorite`, 'PUT', {\n pathParams,\n body,\n })\n },\n\n async fork(\n params: { chatId: string } & ChatsForkRequest,\n ): Promise<ChatsForkResponse> {\n const pathParams = { chatId: params.chatId }\n const body = { versionId: params.versionId }\n return fetcher(`/chats/${pathParams.chatId}/fork`, 'POST', {\n pathParams,\n body,\n })\n },\n\n async sendMessage(\n params: { chatId: string } & ChatsSendMessageRequest,\n ): Promise<ChatsSendMessageResponse> {\n const pathParams = { chatId: params.chatId }\n const body = {\n message: params.message,\n attachments: params.attachments,\n modelConfiguration: params.modelConfiguration,\n }\n return fetcher(`/chats/${pathParams.chatId}/messages`, 'POST', {\n pathParams,\n body,\n })\n },\n\n async getMetadata(params: {\n chatId: string\n }): Promise<ChatsGetMetadataResponse> {\n const pathParams = { chatId: params.chatId }\n return fetcher(`/chats/${pathParams.chatId}/metadata`, 'GET', {\n pathParams,\n })\n },\n\n async resume(params: {\n chatId: string\n messageId: string\n }): Promise<ChatsResumeResponse> {\n const pathParams = {\n chatId: params.chatId,\n messageId: params.messageId,\n }\n return fetcher(\n `/chats/${pathParams.chatId}/messages/${pathParams.messageId}/resume`,\n 'POST',\n { pathParams },\n )\n },\n },\n\n projects: {\n async getByChatId(params: {\n chatId: string\n }): Promise<ProjectsGetByChatIdResponse> {\n const pathParams = { chatId: params.chatId }\n return fetcher(`/chats/${pathParams.chatId}/project`, 'GET', {\n pathParams,\n })\n },\n\n async find(): Promise<ProjectsFindResponse> {\n return fetcher(`/projects`, 'GET', {})\n },\n\n async create(\n params: ProjectsCreateRequest,\n ): Promise<ProjectsCreateResponse> {\n const body = {\n name: params.name,\n description: params.description,\n icon: params.icon,\n environmentVariables: params.environmentVariables,\n instructions: params.instructions,\n }\n return fetcher(`/projects`, 'POST', { body })\n },\n\n async getById(params: {\n projectId: string\n }): Promise<ProjectsGetByIdResponse> {\n const pathParams = { projectId: params.projectId }\n return fetcher(`/projects/${pathParams.projectId}`, 'GET', {\n pathParams,\n })\n },\n\n async assign(\n params: { projectId: string } & ProjectsAssignRequest,\n ): Promise<ProjectsAssignResponse> {\n const pathParams = { projectId: params.projectId }\n const body = { chatId: params.chatId }\n return fetcher(`/projects/${pathParams.projectId}/assign`, 'POST', {\n pathParams,\n body,\n })\n },\n },\n\n deployments: {\n async findLogs(params: {\n deploymentId: string\n since?: string\n }): Promise<DeploymentsFindLogsResponse> {\n const pathParams = { deploymentId: params.deploymentId }\n const query = Object.fromEntries(\n Object.entries({\n since: params.since,\n }).filter(([_, value]) => value !== undefined),\n ) as Record<string, string>\n const hasQuery = Object.keys(query).length > 0\n return fetcher(`/deployments/${pathParams.deploymentId}/logs`, 'GET', {\n pathParams,\n ...(hasQuery ? { query } : {}),\n })\n },\n\n async findErrors(params: {\n deploymentId: string\n }): Promise<DeploymentsFindErrorsResponse> {\n const pathParams = { deploymentId: params.deploymentId }\n return fetcher(\n `/deployments/${pathParams.deploymentId}/errors`,\n 'GET',\n { pathParams },\n )\n },\n },\n\n hooks: {\n async find(): Promise<HooksFindResponse> {\n return fetcher(`/hooks`, 'GET', {})\n },\n\n async create(params: HooksCreateRequest): Promise<HooksCreateResponse> {\n const body = {\n name: params.name,\n events: params.events,\n chatId: params.chatId,\n projectId: params.projectId,\n url: params.url,\n }\n return fetcher(`/hooks`, 'POST', { body })\n },\n\n async getById(params: { hookId: string }): Promise<HooksGetByIdResponse> {\n const pathParams = { hookId: params.hookId }\n return fetcher(`/hooks/${pathParams.hookId}`, 'GET', { pathParams })\n },\n\n async update(\n params: { hookId: string } & HooksUpdateRequest,\n ): Promise<HooksUpdateResponse> {\n const pathParams = { hookId: params.hookId }\n const body = {\n name: params.name,\n events: params.events,\n url: params.url,\n }\n return fetcher(`/hooks/${pathParams.hookId}`, 'PATCH', {\n pathParams,\n body,\n })\n },\n\n async delete(params: { hookId: string }): Promise<HooksDeleteResponse> {\n const pathParams = { hookId: params.hookId }\n return fetcher(`/hooks/${pathParams.hookId}`, 'DELETE', { pathParams })\n },\n },\n\n integrations: {\n vercel: {\n projects: {\n async find(): Promise<IntegrationsVercelProjectsFindResponse> {\n return fetcher(`/integrations/vercel/projects`, 'GET', {})\n },\n\n async create(\n params: IntegrationsVercelProjectsCreateRequest,\n ): Promise<IntegrationsVercelProjectsCreateResponse> {\n const body = { projectId: params.projectId, name: params.name }\n return fetcher(`/integrations/vercel/projects`, 'POST', { body })\n },\n },\n },\n },\n\n rateLimits: {\n async find(params?: { scope?: string }): Promise<RateLimitsFindResponse> {\n const query = params\n ? (Object.fromEntries(\n Object.entries({\n scope: params.scope,\n }).filter(([_, value]) => value !== undefined),\n ) as Record<string, string>)\n : {}\n const hasQuery = Object.keys(query).length > 0\n return fetcher(`/rate-limits`, 'GET', {\n ...(hasQuery ? { query } : {}),\n })\n },\n },\n\n user: {\n async get(): Promise<UserGetResponse> {\n return fetcher(`/user`, 'GET', {})\n },\n\n async getBilling(params?: {\n scope?: string\n }): Promise<UserGetBillingResponse> {\n const query = params\n ? (Object.fromEntries(\n Object.entries({\n scope: params.scope,\n }).filter(([_, value]) => value !== undefined),\n ) as Record<string, string>)\n : {}\n const hasQuery = Object.keys(query).length > 0\n return fetcher(`/user/billing`, 'GET', {\n ...(hasQuery ? { query } : {}),\n })\n },\n\n async getPlan(): Promise<UserGetPlanResponse> {\n return fetcher(`/user/plan`, 'GET', {})\n },\n\n async getScopes(): Promise<UserGetScopesResponse> {\n return fetcher(`/user/scopes`, 'GET', {})\n },\n },\n }\n}\n\n// Default client for backward compatibility\nexport const v0 = createClient()\n"],"names":[],"mappings":"AAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAUO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAQO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACA;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACA;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACA;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACO;AACA;AACA;AACP;AACA;AACA;AACA;AACO;AACA;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACO;AACA;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACA;AACA;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACA;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;"}
|
package/dist/index.js
CHANGED
|
@@ -59,12 +59,7 @@ function createClient(config = {}) {
|
|
|
59
59
|
});
|
|
60
60
|
},
|
|
61
61
|
async init (params) {
|
|
62
|
-
const body =
|
|
63
|
-
name: params.name,
|
|
64
|
-
files: params.files,
|
|
65
|
-
chatPrivacy: params.chatPrivacy,
|
|
66
|
-
projectId: params.projectId
|
|
67
|
-
};
|
|
62
|
+
const body = params;
|
|
68
63
|
return fetcher(`/chats/init`, 'POST', {
|
|
69
64
|
body
|
|
70
65
|
});
|
|
@@ -177,6 +172,14 @@ function createClient(config = {}) {
|
|
|
177
172
|
body
|
|
178
173
|
});
|
|
179
174
|
},
|
|
175
|
+
async getById (params) {
|
|
176
|
+
const pathParams = {
|
|
177
|
+
projectId: params.projectId
|
|
178
|
+
};
|
|
179
|
+
return fetcher(`/projects/${pathParams.projectId}`, 'GET', {
|
|
180
|
+
pathParams
|
|
181
|
+
});
|
|
182
|
+
},
|
|
180
183
|
async assign (params) {
|
|
181
184
|
const pathParams = {
|
|
182
185
|
projectId: params.projectId
|
|
@@ -215,6 +218,53 @@ function createClient(config = {}) {
|
|
|
215
218
|
});
|
|
216
219
|
}
|
|
217
220
|
},
|
|
221
|
+
hooks: {
|
|
222
|
+
async find () {
|
|
223
|
+
return fetcher(`/hooks`, 'GET', {});
|
|
224
|
+
},
|
|
225
|
+
async create (params) {
|
|
226
|
+
const body = {
|
|
227
|
+
name: params.name,
|
|
228
|
+
events: params.events,
|
|
229
|
+
chatId: params.chatId,
|
|
230
|
+
projectId: params.projectId,
|
|
231
|
+
url: params.url
|
|
232
|
+
};
|
|
233
|
+
return fetcher(`/hooks`, 'POST', {
|
|
234
|
+
body
|
|
235
|
+
});
|
|
236
|
+
},
|
|
237
|
+
async getById (params) {
|
|
238
|
+
const pathParams = {
|
|
239
|
+
hookId: params.hookId
|
|
240
|
+
};
|
|
241
|
+
return fetcher(`/hooks/${pathParams.hookId}`, 'GET', {
|
|
242
|
+
pathParams
|
|
243
|
+
});
|
|
244
|
+
},
|
|
245
|
+
async update (params) {
|
|
246
|
+
const pathParams = {
|
|
247
|
+
hookId: params.hookId
|
|
248
|
+
};
|
|
249
|
+
const body = {
|
|
250
|
+
name: params.name,
|
|
251
|
+
events: params.events,
|
|
252
|
+
url: params.url
|
|
253
|
+
};
|
|
254
|
+
return fetcher(`/hooks/${pathParams.hookId}`, 'PATCH', {
|
|
255
|
+
pathParams,
|
|
256
|
+
body
|
|
257
|
+
});
|
|
258
|
+
},
|
|
259
|
+
async delete (params) {
|
|
260
|
+
const pathParams = {
|
|
261
|
+
hookId: params.hookId
|
|
262
|
+
};
|
|
263
|
+
return fetcher(`/hooks/${pathParams.hookId}`, 'DELETE', {
|
|
264
|
+
pathParams
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
},
|
|
218
268
|
integrations: {
|
|
219
269
|
vercel: {
|
|
220
270
|
projects: {
|