v0-api 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +548 -0
- package/dist/index.d.cts +4394 -0
- package/dist/index.d.mts +4295 -129
- package/dist/index.d.ts +4295 -129
- package/dist/index.mjs +541 -5
- package/dist/mcp.cjs +519 -0
- package/dist/mcp.d.cts +5 -0
- package/dist/mcp.d.mts +5 -0
- package/dist/mcp.d.ts +5 -0
- package/dist/mcp.mjs +517 -0
- package/dist/shared/v0-api.B8nEbJhM.d.cts +36 -0
- package/dist/shared/v0-api.B8nEbJhM.d.mts +36 -0
- package/dist/shared/v0-api.B8nEbJhM.d.ts +36 -0
- package/dist/shared/v0-api.D3CFh7k4.cjs +833 -0
- package/dist/shared/v0-api.mzMaOyDB.mjs +814 -0
- package/package.json +31 -12
- package/dist/client.d.mts +0 -57
- package/dist/client.d.ts +0 -57
- package/dist/client.js +0 -53
- package/dist/client.mjs +0 -46
- package/dist/generated/components.d.mts +0 -341
- package/dist/generated/components.d.ts +0 -341
- package/dist/generated/components.js +0 -391
- package/dist/generated/components.mjs +0 -362
- package/dist/generated/schemas.d.mts +0 -1115
- package/dist/generated/schemas.d.ts +0 -1115
- package/dist/generated/schemas.js +0 -1096
- package/dist/generated/schemas.mjs +0 -1088
- package/dist/generated/types.d.mts +0 -1628
- package/dist/generated/types.d.ts +0 -1628
- package/dist/generated/types.js +0 -93
- package/dist/generated/types.mjs +0 -90
- package/dist/index.js +0 -49
- package/dist/utils/fetch.d.mts +0 -18
- package/dist/utils/fetch.d.ts +0 -18
- package/dist/utils/fetch.js +0 -8
- package/dist/utils/fetch.mjs +0 -5
- package/dist/utils/fetcher.d.mts +0 -22
- package/dist/utils/fetcher.d.ts +0 -22
- package/dist/utils/fetcher.js +0 -68
- package/dist/utils/fetcher.mjs +0 -65
- package/dist/utils/lang.d.mts +0 -1
- package/dist/utils/lang.d.ts +0 -1
- package/dist/utils/lang.js +0 -9
- package/dist/utils/lang.mjs +0 -6
- package/dist/utils/types.d.mts +0 -3
- package/dist/utils/types.d.ts +0 -3
- package/dist/utils/types.js +0 -2
- package/dist/utils/types.mjs +0 -1
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,548 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const schemas = require('./shared/v0-api.D3CFh7k4.cjs');
|
|
4
|
+
require('zod');
|
|
5
|
+
|
|
6
|
+
async function chatsCreate({ config = {} }) {
|
|
7
|
+
const { client: request = schemas.client, ...requestConfig } = config;
|
|
8
|
+
const data = await request({
|
|
9
|
+
method: "POST",
|
|
10
|
+
url: `/chats`,
|
|
11
|
+
...requestConfig,
|
|
12
|
+
headers: { "Content-Type": "applicationJson", ...requestConfig.headers }
|
|
13
|
+
});
|
|
14
|
+
return data;
|
|
15
|
+
}
|
|
16
|
+
async function chatsFind({
|
|
17
|
+
queryParams,
|
|
18
|
+
config = {}
|
|
19
|
+
}) {
|
|
20
|
+
const { client: request = schemas.client, ...requestConfig } = config;
|
|
21
|
+
const data = await request({ method: "GET", url: `/chats`, queryParams, ...requestConfig });
|
|
22
|
+
return data;
|
|
23
|
+
}
|
|
24
|
+
async function chatsInitCreate({
|
|
25
|
+
config = {}
|
|
26
|
+
}) {
|
|
27
|
+
const { client: request = schemas.client, ...requestConfig } = config;
|
|
28
|
+
const data = await request({
|
|
29
|
+
method: "POST",
|
|
30
|
+
url: `/chats/init`,
|
|
31
|
+
...requestConfig,
|
|
32
|
+
headers: { "Content-Type": "applicationJson", ...requestConfig.headers }
|
|
33
|
+
});
|
|
34
|
+
return data;
|
|
35
|
+
}
|
|
36
|
+
async function chatsDelete({
|
|
37
|
+
pathParams: { chatId },
|
|
38
|
+
config = {}
|
|
39
|
+
}) {
|
|
40
|
+
const { client: request = schemas.client, ...requestConfig } = config;
|
|
41
|
+
if (!chatId) {
|
|
42
|
+
throw new Error(`Missing required path parameter: chatId`);
|
|
43
|
+
}
|
|
44
|
+
const data = await request({ method: "DELETE", url: `/chats/${chatId}`, ...requestConfig });
|
|
45
|
+
return data;
|
|
46
|
+
}
|
|
47
|
+
async function chatsGetById({
|
|
48
|
+
pathParams: { chatId },
|
|
49
|
+
config = {}
|
|
50
|
+
}) {
|
|
51
|
+
const { client: request = schemas.client, ...requestConfig } = config;
|
|
52
|
+
if (!chatId) {
|
|
53
|
+
throw new Error(`Missing required path parameter: chatId`);
|
|
54
|
+
}
|
|
55
|
+
const data = await request({ method: "GET", url: `/chats/${chatId}`, ...requestConfig });
|
|
56
|
+
return data;
|
|
57
|
+
}
|
|
58
|
+
async function chatsUpdate({
|
|
59
|
+
pathParams: { chatId },
|
|
60
|
+
config = {}
|
|
61
|
+
}) {
|
|
62
|
+
const { client: request = schemas.client, ...requestConfig } = config;
|
|
63
|
+
if (!chatId) {
|
|
64
|
+
throw new Error(`Missing required path parameter: chatId`);
|
|
65
|
+
}
|
|
66
|
+
const data = await request({
|
|
67
|
+
method: "PATCH",
|
|
68
|
+
url: `/chats/${chatId}`,
|
|
69
|
+
...requestConfig,
|
|
70
|
+
headers: { "Content-Type": "applicationJson", ...requestConfig.headers }
|
|
71
|
+
});
|
|
72
|
+
return data;
|
|
73
|
+
}
|
|
74
|
+
async function chatsFavorite({
|
|
75
|
+
pathParams: { chatId },
|
|
76
|
+
config = {}
|
|
77
|
+
}) {
|
|
78
|
+
const { client: request = schemas.client, ...requestConfig } = config;
|
|
79
|
+
if (!chatId) {
|
|
80
|
+
throw new Error(`Missing required path parameter: chatId`);
|
|
81
|
+
}
|
|
82
|
+
const data = await request({
|
|
83
|
+
method: "PUT",
|
|
84
|
+
url: `/chats/${chatId}/favorite`,
|
|
85
|
+
...requestConfig,
|
|
86
|
+
headers: { "Content-Type": "applicationJson", ...requestConfig.headers }
|
|
87
|
+
});
|
|
88
|
+
return data;
|
|
89
|
+
}
|
|
90
|
+
async function chatsFork({
|
|
91
|
+
pathParams: { chatId },
|
|
92
|
+
config = {}
|
|
93
|
+
}) {
|
|
94
|
+
const { client: request = schemas.client, ...requestConfig } = config;
|
|
95
|
+
if (!chatId) {
|
|
96
|
+
throw new Error(`Missing required path parameter: chatId`);
|
|
97
|
+
}
|
|
98
|
+
const data = await request({
|
|
99
|
+
method: "POST",
|
|
100
|
+
url: `/chats/${chatId}/fork`,
|
|
101
|
+
...requestConfig,
|
|
102
|
+
headers: { "Content-Type": "applicationJson", ...requestConfig.headers }
|
|
103
|
+
});
|
|
104
|
+
return data;
|
|
105
|
+
}
|
|
106
|
+
async function projectsGetByChatId({
|
|
107
|
+
pathParams: { chatId },
|
|
108
|
+
config = {}
|
|
109
|
+
}) {
|
|
110
|
+
const { client: request = schemas.client, ...requestConfig } = config;
|
|
111
|
+
if (!chatId) {
|
|
112
|
+
throw new Error(`Missing required path parameter: chatId`);
|
|
113
|
+
}
|
|
114
|
+
const data = await request({ method: "GET", url: `/chats/${chatId}/project`, ...requestConfig });
|
|
115
|
+
return data;
|
|
116
|
+
}
|
|
117
|
+
async function chatsSendMessage({
|
|
118
|
+
pathParams: { chatId },
|
|
119
|
+
config = {}
|
|
120
|
+
}) {
|
|
121
|
+
const { client: request = schemas.client, ...requestConfig } = config;
|
|
122
|
+
if (!chatId) {
|
|
123
|
+
throw new Error(`Missing required path parameter: chatId`);
|
|
124
|
+
}
|
|
125
|
+
const data = await request({
|
|
126
|
+
method: "POST",
|
|
127
|
+
url: `/chats/${chatId}/messages`,
|
|
128
|
+
...requestConfig,
|
|
129
|
+
headers: { "Content-Type": "applicationJson", ...requestConfig.headers }
|
|
130
|
+
});
|
|
131
|
+
return data;
|
|
132
|
+
}
|
|
133
|
+
async function chatsGetMetadata({
|
|
134
|
+
pathParams: { chatId },
|
|
135
|
+
config = {}
|
|
136
|
+
}) {
|
|
137
|
+
const { client: request = schemas.client, ...requestConfig } = config;
|
|
138
|
+
if (!chatId) {
|
|
139
|
+
throw new Error(`Missing required path parameter: chatId`);
|
|
140
|
+
}
|
|
141
|
+
const data = await request({ method: "GET", url: `/chats/${chatId}/metadata`, ...requestConfig });
|
|
142
|
+
return data;
|
|
143
|
+
}
|
|
144
|
+
async function chatsResume({
|
|
145
|
+
pathParams: { chatId, messageId },
|
|
146
|
+
config = {}
|
|
147
|
+
}) {
|
|
148
|
+
const { client: request = schemas.client, ...requestConfig } = config;
|
|
149
|
+
if (!chatId) {
|
|
150
|
+
throw new Error(`Missing required path parameter: chatId`);
|
|
151
|
+
}
|
|
152
|
+
if (!messageId) {
|
|
153
|
+
throw new Error(`Missing required path parameter: messageId`);
|
|
154
|
+
}
|
|
155
|
+
const data = await request({ method: "POST", url: `/chats/${chatId}/messages/${messageId}/resume`, ...requestConfig });
|
|
156
|
+
return data;
|
|
157
|
+
}
|
|
158
|
+
async function deploymentsFindLogs({
|
|
159
|
+
pathParams: { deploymentId },
|
|
160
|
+
queryParams,
|
|
161
|
+
config = {}
|
|
162
|
+
}) {
|
|
163
|
+
const { client: request = schemas.client, ...requestConfig } = config;
|
|
164
|
+
if (!deploymentId) {
|
|
165
|
+
throw new Error(`Missing required path parameter: deploymentId`);
|
|
166
|
+
}
|
|
167
|
+
const data = await request({ method: "GET", url: `/deployments/${deploymentId}/logs`, queryParams, ...requestConfig });
|
|
168
|
+
return data;
|
|
169
|
+
}
|
|
170
|
+
async function deploymentsFindErrors({
|
|
171
|
+
pathParams: { deploymentId },
|
|
172
|
+
config = {}
|
|
173
|
+
}) {
|
|
174
|
+
const { client: request = schemas.client, ...requestConfig } = config;
|
|
175
|
+
if (!deploymentId) {
|
|
176
|
+
throw new Error(`Missing required path parameter: deploymentId`);
|
|
177
|
+
}
|
|
178
|
+
const data = await request({ method: "GET", url: `/deployments/${deploymentId}/errors`, ...requestConfig });
|
|
179
|
+
return data;
|
|
180
|
+
}
|
|
181
|
+
async function integrationsVercelProjectsFind({
|
|
182
|
+
config = {}
|
|
183
|
+
}) {
|
|
184
|
+
const { client: request = schemas.client, ...requestConfig } = config;
|
|
185
|
+
const data = await request({ method: "GET", url: `/integrations/vercel/projects`, ...requestConfig });
|
|
186
|
+
return data;
|
|
187
|
+
}
|
|
188
|
+
async function integrationsVercelProjectsCreate({
|
|
189
|
+
config = {}
|
|
190
|
+
}) {
|
|
191
|
+
const { client: request = schemas.client, ...requestConfig } = config;
|
|
192
|
+
const data = await request({
|
|
193
|
+
method: "POST",
|
|
194
|
+
url: `/integrations/vercel/projects`,
|
|
195
|
+
...requestConfig,
|
|
196
|
+
headers: { "Content-Type": "applicationJson", ...requestConfig.headers }
|
|
197
|
+
});
|
|
198
|
+
return data;
|
|
199
|
+
}
|
|
200
|
+
async function projectsFind({ config = {} }) {
|
|
201
|
+
const { client: request = schemas.client, ...requestConfig } = config;
|
|
202
|
+
const data = await request({ method: "GET", url: `/projects`, ...requestConfig });
|
|
203
|
+
return data;
|
|
204
|
+
}
|
|
205
|
+
async function projectsCreate({
|
|
206
|
+
config = {}
|
|
207
|
+
}) {
|
|
208
|
+
const { client: request = schemas.client, ...requestConfig } = config;
|
|
209
|
+
const data = await request({
|
|
210
|
+
method: "POST",
|
|
211
|
+
url: `/projects`,
|
|
212
|
+
...requestConfig,
|
|
213
|
+
headers: { "Content-Type": "applicationJson", ...requestConfig.headers }
|
|
214
|
+
});
|
|
215
|
+
return data;
|
|
216
|
+
}
|
|
217
|
+
async function projectsAssign({
|
|
218
|
+
pathParams: { projectId },
|
|
219
|
+
config = {}
|
|
220
|
+
}) {
|
|
221
|
+
const { client: request = schemas.client, ...requestConfig } = config;
|
|
222
|
+
if (!projectId) {
|
|
223
|
+
throw new Error(`Missing required path parameter: projectId`);
|
|
224
|
+
}
|
|
225
|
+
const data = await request({
|
|
226
|
+
method: "POST",
|
|
227
|
+
url: `/projects/${projectId}/assign`,
|
|
228
|
+
...requestConfig,
|
|
229
|
+
headers: { "Content-Type": "applicationJson", ...requestConfig.headers }
|
|
230
|
+
});
|
|
231
|
+
return data;
|
|
232
|
+
}
|
|
233
|
+
async function rateLimitsFind({
|
|
234
|
+
queryParams,
|
|
235
|
+
config = {}
|
|
236
|
+
}) {
|
|
237
|
+
const { client: request = schemas.client, ...requestConfig } = config;
|
|
238
|
+
const data = await request({ method: "GET", url: `/rate-limits`, queryParams, ...requestConfig });
|
|
239
|
+
return data;
|
|
240
|
+
}
|
|
241
|
+
async function userGet({ config = {} }) {
|
|
242
|
+
const { client: request = schemas.client, ...requestConfig } = config;
|
|
243
|
+
const data = await request({ method: "GET", url: `/user`, ...requestConfig });
|
|
244
|
+
return data;
|
|
245
|
+
}
|
|
246
|
+
async function userGetBilling({
|
|
247
|
+
queryParams,
|
|
248
|
+
config = {}
|
|
249
|
+
}) {
|
|
250
|
+
const { client: request = schemas.client, ...requestConfig } = config;
|
|
251
|
+
const data = await request({ method: "GET", url: `/user/billing`, queryParams, ...requestConfig });
|
|
252
|
+
return data;
|
|
253
|
+
}
|
|
254
|
+
async function userGetPlan({ config = {} }) {
|
|
255
|
+
const { client: request = schemas.client, ...requestConfig } = config;
|
|
256
|
+
const data = await request({ method: "GET", url: `/user/plan`, ...requestConfig });
|
|
257
|
+
return data;
|
|
258
|
+
}
|
|
259
|
+
async function userGetScopes({ config = {} }) {
|
|
260
|
+
const { client: request = schemas.client, ...requestConfig } = config;
|
|
261
|
+
const data = await request({ method: "GET", url: `/user/scopes`, ...requestConfig });
|
|
262
|
+
return data;
|
|
263
|
+
}
|
|
264
|
+
const operationsByPath$1 = {
|
|
265
|
+
"POST /chats": chatsCreate,
|
|
266
|
+
"GET /chats": chatsFind,
|
|
267
|
+
"POST /chats/init": chatsInitCreate,
|
|
268
|
+
"DELETE /chats/{chatId}": chatsDelete,
|
|
269
|
+
"GET /chats/{chatId}": chatsGetById,
|
|
270
|
+
"PATCH /chats/{chatId}": chatsUpdate,
|
|
271
|
+
"PUT /chats/{chatId}/favorite": chatsFavorite,
|
|
272
|
+
"POST /chats/{chatId}/fork": chatsFork,
|
|
273
|
+
"GET /chats/{chatId}/project": projectsGetByChatId,
|
|
274
|
+
"POST /chats/{chatId}/messages": chatsSendMessage,
|
|
275
|
+
"GET /chats/{chatId}/metadata": chatsGetMetadata,
|
|
276
|
+
"POST /chats/{chatId}/messages/{messageId}/resume": chatsResume,
|
|
277
|
+
"GET /deployments/{deploymentId}/logs": deploymentsFindLogs,
|
|
278
|
+
"GET /deployments/{deploymentId}/errors": deploymentsFindErrors,
|
|
279
|
+
"GET /integrations/vercel/projects": integrationsVercelProjectsFind,
|
|
280
|
+
"POST /integrations/vercel/projects": integrationsVercelProjectsCreate,
|
|
281
|
+
"GET /projects": projectsFind,
|
|
282
|
+
"POST /projects": projectsCreate,
|
|
283
|
+
"POST /projects/{projectId}/assign": projectsAssign,
|
|
284
|
+
"GET /rate-limits": rateLimitsFind,
|
|
285
|
+
"GET /user": userGet,
|
|
286
|
+
"GET /user/billing": userGetBilling,
|
|
287
|
+
"GET /user/plan": userGetPlan,
|
|
288
|
+
"GET /user/scopes": userGetScopes
|
|
289
|
+
};
|
|
290
|
+
const operationsByTag$1 = {
|
|
291
|
+
chats: {
|
|
292
|
+
chatsCreate,
|
|
293
|
+
chatsFind,
|
|
294
|
+
chatsInitCreate,
|
|
295
|
+
chatsDelete,
|
|
296
|
+
chatsGetById,
|
|
297
|
+
chatsUpdate,
|
|
298
|
+
chatsFavorite,
|
|
299
|
+
chatsFork,
|
|
300
|
+
chatsSendMessage,
|
|
301
|
+
chatsGetMetadata,
|
|
302
|
+
chatsResume
|
|
303
|
+
},
|
|
304
|
+
projects: {
|
|
305
|
+
projectsGetByChatId,
|
|
306
|
+
projectsFind,
|
|
307
|
+
projectsCreate,
|
|
308
|
+
projectsAssign
|
|
309
|
+
},
|
|
310
|
+
deployments: {
|
|
311
|
+
deploymentsFindLogs,
|
|
312
|
+
deploymentsFindErrors
|
|
313
|
+
},
|
|
314
|
+
integrations: {
|
|
315
|
+
integrationsVercelProjectsFind,
|
|
316
|
+
integrationsVercelProjectsCreate
|
|
317
|
+
},
|
|
318
|
+
ratelimits: {
|
|
319
|
+
rateLimitsFind
|
|
320
|
+
},
|
|
321
|
+
user: {
|
|
322
|
+
userGet,
|
|
323
|
+
userGetBilling,
|
|
324
|
+
userGetPlan,
|
|
325
|
+
userGetScopes
|
|
326
|
+
}
|
|
327
|
+
};
|
|
328
|
+
const tagDictionary$1 = {
|
|
329
|
+
chats: {
|
|
330
|
+
POST: ["chatsCreate", "chatsInitCreate", "chatsFork", "chatsSendMessage", "chatsResume"],
|
|
331
|
+
GET: ["chatsFind", "chatsGetById", "chatsGetMetadata"],
|
|
332
|
+
DELETE: ["chatsDelete"],
|
|
333
|
+
PATCH: ["chatsUpdate"],
|
|
334
|
+
PUT: ["chatsFavorite"]
|
|
335
|
+
},
|
|
336
|
+
projects: {
|
|
337
|
+
GET: ["projectsGetByChatId", "projectsFind"],
|
|
338
|
+
POST: ["projectsCreate", "projectsAssign"]
|
|
339
|
+
},
|
|
340
|
+
deployments: {
|
|
341
|
+
GET: ["deploymentsFindLogs", "deploymentsFindErrors"]
|
|
342
|
+
},
|
|
343
|
+
integrations: {
|
|
344
|
+
GET: ["integrationsVercelProjectsFind"],
|
|
345
|
+
POST: ["integrationsVercelProjectsCreate"]
|
|
346
|
+
},
|
|
347
|
+
ratelimits: {
|
|
348
|
+
GET: ["rateLimitsFind"]
|
|
349
|
+
},
|
|
350
|
+
user: {
|
|
351
|
+
GET: ["userGet", "userGetBilling", "userGetPlan", "userGetScopes"]
|
|
352
|
+
}
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
const Components = {
|
|
356
|
+
__proto__: null,
|
|
357
|
+
chatsCreate: chatsCreate,
|
|
358
|
+
chatsDelete: chatsDelete,
|
|
359
|
+
chatsFavorite: chatsFavorite,
|
|
360
|
+
chatsFind: chatsFind,
|
|
361
|
+
chatsFork: chatsFork,
|
|
362
|
+
chatsGetById: chatsGetById,
|
|
363
|
+
chatsGetMetadata: chatsGetMetadata,
|
|
364
|
+
chatsInitCreate: chatsInitCreate,
|
|
365
|
+
chatsResume: chatsResume,
|
|
366
|
+
chatsSendMessage: chatsSendMessage,
|
|
367
|
+
chatsUpdate: chatsUpdate,
|
|
368
|
+
deploymentsFindErrors: deploymentsFindErrors,
|
|
369
|
+
deploymentsFindLogs: deploymentsFindLogs,
|
|
370
|
+
integrationsVercelProjectsCreate: integrationsVercelProjectsCreate,
|
|
371
|
+
integrationsVercelProjectsFind: integrationsVercelProjectsFind,
|
|
372
|
+
operationsByPath: operationsByPath$1,
|
|
373
|
+
operationsByTag: operationsByTag$1,
|
|
374
|
+
projectsAssign: projectsAssign,
|
|
375
|
+
projectsCreate: projectsCreate,
|
|
376
|
+
projectsFind: projectsFind,
|
|
377
|
+
projectsGetByChatId: projectsGetByChatId,
|
|
378
|
+
rateLimitsFind: rateLimitsFind,
|
|
379
|
+
tagDictionary: tagDictionary$1,
|
|
380
|
+
userGet: userGet,
|
|
381
|
+
userGetBilling: userGetBilling,
|
|
382
|
+
userGetPlan: userGetPlan,
|
|
383
|
+
userGetScopes: userGetScopes
|
|
384
|
+
};
|
|
385
|
+
|
|
386
|
+
const chatDetailPrivacyEnum = {
|
|
387
|
+
private: "private",
|
|
388
|
+
public: "public",
|
|
389
|
+
team: "team",
|
|
390
|
+
"team-edit": "team-edit",
|
|
391
|
+
unlisted: "unlisted"
|
|
392
|
+
};
|
|
393
|
+
const messagesTypeEnum = {
|
|
394
|
+
"added-environment-variables": "added-environment-variables",
|
|
395
|
+
"added-integration": "added-integration",
|
|
396
|
+
"deleted-file": "deleted-file",
|
|
397
|
+
"edited-file": "edited-file",
|
|
398
|
+
"fix-with-v0": "fix-with-v0",
|
|
399
|
+
"forked-block": "forked-block",
|
|
400
|
+
"forked-chat": "forked-chat",
|
|
401
|
+
message: "message",
|
|
402
|
+
"moved-file": "moved-file",
|
|
403
|
+
"open-in-v0": "open-in-v0",
|
|
404
|
+
refinement: "refinement",
|
|
405
|
+
"renamed-file": "renamed-file",
|
|
406
|
+
"replace-src": "replace-src",
|
|
407
|
+
"reverted-block": "reverted-block",
|
|
408
|
+
"sync-git": "sync-git"
|
|
409
|
+
};
|
|
410
|
+
const messagesRoleEnum = {
|
|
411
|
+
assistant: "assistant",
|
|
412
|
+
user: "user"
|
|
413
|
+
};
|
|
414
|
+
const latestVersionStatusEnum = {
|
|
415
|
+
completed: "completed",
|
|
416
|
+
failed: "failed",
|
|
417
|
+
pending: "pending"
|
|
418
|
+
};
|
|
419
|
+
const modelConfigurationModelIdEnum = {
|
|
420
|
+
"v0-1.5-lg": "v0-1.5-lg",
|
|
421
|
+
"v0-1.5-md": "v0-1.5-md",
|
|
422
|
+
"v0-1.5-sm": "v0-1.5-sm"
|
|
423
|
+
};
|
|
424
|
+
const chatSummaryPrivacyEnum = {
|
|
425
|
+
private: "private",
|
|
426
|
+
public: "public",
|
|
427
|
+
team: "team",
|
|
428
|
+
"team-edit": "team-edit",
|
|
429
|
+
unlisted: "unlisted"
|
|
430
|
+
};
|
|
431
|
+
const latestVersionStatusEnum2 = {
|
|
432
|
+
completed: "completed",
|
|
433
|
+
failed: "failed",
|
|
434
|
+
pending: "pending"
|
|
435
|
+
};
|
|
436
|
+
const modelConfigurationModelIdEnum2 = {
|
|
437
|
+
"v0-1.5-lg": "v0-1.5-lg",
|
|
438
|
+
"v0-1.5-md": "v0-1.5-md",
|
|
439
|
+
"v0-1.5-sm": "v0-1.5-sm"
|
|
440
|
+
};
|
|
441
|
+
const messageSummaryTypeEnum = {
|
|
442
|
+
"added-environment-variables": "added-environment-variables",
|
|
443
|
+
"added-integration": "added-integration",
|
|
444
|
+
"deleted-file": "deleted-file",
|
|
445
|
+
"edited-file": "edited-file",
|
|
446
|
+
"fix-with-v0": "fix-with-v0",
|
|
447
|
+
"forked-block": "forked-block",
|
|
448
|
+
"forked-chat": "forked-chat",
|
|
449
|
+
message: "message",
|
|
450
|
+
"moved-file": "moved-file",
|
|
451
|
+
"open-in-v0": "open-in-v0",
|
|
452
|
+
refinement: "refinement",
|
|
453
|
+
"renamed-file": "renamed-file",
|
|
454
|
+
"replace-src": "replace-src",
|
|
455
|
+
"reverted-block": "reverted-block",
|
|
456
|
+
"sync-git": "sync-git"
|
|
457
|
+
};
|
|
458
|
+
const messageSummaryRoleEnum = {
|
|
459
|
+
assistant: "assistant",
|
|
460
|
+
user: "user"
|
|
461
|
+
};
|
|
462
|
+
const versionDetailStatusEnum = {
|
|
463
|
+
completed: "completed",
|
|
464
|
+
failed: "failed",
|
|
465
|
+
pending: "pending"
|
|
466
|
+
};
|
|
467
|
+
const versionSummaryStatusEnum = {
|
|
468
|
+
completed: "completed",
|
|
469
|
+
failed: "failed",
|
|
470
|
+
pending: "pending"
|
|
471
|
+
};
|
|
472
|
+
|
|
473
|
+
const types = {
|
|
474
|
+
__proto__: null,
|
|
475
|
+
chatDetailPrivacyEnum: chatDetailPrivacyEnum,
|
|
476
|
+
chatSummaryPrivacyEnum: chatSummaryPrivacyEnum,
|
|
477
|
+
latestVersionStatusEnum: latestVersionStatusEnum,
|
|
478
|
+
latestVersionStatusEnum2: latestVersionStatusEnum2,
|
|
479
|
+
messageSummaryRoleEnum: messageSummaryRoleEnum,
|
|
480
|
+
messageSummaryTypeEnum: messageSummaryTypeEnum,
|
|
481
|
+
messagesRoleEnum: messagesRoleEnum,
|
|
482
|
+
messagesTypeEnum: messagesTypeEnum,
|
|
483
|
+
modelConfigurationModelIdEnum: modelConfigurationModelIdEnum,
|
|
484
|
+
modelConfigurationModelIdEnum2: modelConfigurationModelIdEnum2,
|
|
485
|
+
versionDetailStatusEnum: versionDetailStatusEnum,
|
|
486
|
+
versionSummaryStatusEnum: versionSummaryStatusEnum
|
|
487
|
+
};
|
|
488
|
+
|
|
489
|
+
class V0Api {
|
|
490
|
+
token;
|
|
491
|
+
fetch;
|
|
492
|
+
constructor(options) {
|
|
493
|
+
this.token = options.token;
|
|
494
|
+
this.fetch = options.fetch || fetch;
|
|
495
|
+
if (!this.fetch) throw new Error("Fetch is required");
|
|
496
|
+
}
|
|
497
|
+
get api() {
|
|
498
|
+
const getConfig = async () => ({
|
|
499
|
+
token: this.token,
|
|
500
|
+
fetchImpl: this.fetch
|
|
501
|
+
});
|
|
502
|
+
return new Proxy(
|
|
503
|
+
{},
|
|
504
|
+
{
|
|
505
|
+
get: (_target, namespace) => {
|
|
506
|
+
if (operationsByTag$1[namespace] === void 0) {
|
|
507
|
+
return void 0;
|
|
508
|
+
}
|
|
509
|
+
return new Proxy(
|
|
510
|
+
{},
|
|
511
|
+
{
|
|
512
|
+
get: (_target2, operation) => {
|
|
513
|
+
if (operationsByTag$1[namespace][operation] === void 0) {
|
|
514
|
+
return void 0;
|
|
515
|
+
}
|
|
516
|
+
const method = operationsByTag$1[namespace][operation];
|
|
517
|
+
return async (params) => {
|
|
518
|
+
return await method({ ...params, config: await getConfig() });
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
);
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
);
|
|
526
|
+
}
|
|
527
|
+
async request(endpoint, params) {
|
|
528
|
+
const [method = "", url = ""] = endpoint.split(" ");
|
|
529
|
+
const extraParams = params || {};
|
|
530
|
+
const result = await schemas.client({
|
|
531
|
+
...extraParams,
|
|
532
|
+
method,
|
|
533
|
+
url,
|
|
534
|
+
token: this.token,
|
|
535
|
+
fetchImpl: this.fetch
|
|
536
|
+
});
|
|
537
|
+
return result;
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
const { operationsByPath, operationsByTag, tagDictionary, ...Fetchers } = Components;
|
|
542
|
+
const Helpers = { operationsByPath, operationsByTag, tagDictionary };
|
|
543
|
+
|
|
544
|
+
exports.Schemas = schemas.schemas;
|
|
545
|
+
exports.Fetchers = Fetchers;
|
|
546
|
+
exports.Helpers = Helpers;
|
|
547
|
+
exports.Types = types;
|
|
548
|
+
exports.V0Api = V0Api;
|