v0-api 0.2.0 → 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.
@@ -0,0 +1,1497 @@
1
+ function notEmpty(value) {
2
+ return value !== null && value !== undefined;
3
+ }
4
+ function compactObject(obj) {
5
+ return Object.fromEntries(Object.entries(obj).filter(([, value])=>notEmpty(value)));
6
+ }
7
+
8
+ async function client({ url, method, body, headers, queryParams, signal, token = null, baseUrl = "", fetchImpl = fetch }) {
9
+ try {
10
+ const requestHeaders = compactObject({
11
+ "Content-Type": "application/json",
12
+ Authorization: token ? `Bearer ${token}` : undefined,
13
+ ...headers
14
+ });
15
+ /**
16
+ * As the fetch API is being used, when multipart/form-data is specified
17
+ * the Content-Type header must be deleted so that the browser can set
18
+ * the correct boundary.
19
+ * https://developer.mozilla.org/en-US/docs/Web/API/FormData/Using_FormData_Objects#sending_files_using_a_formdata_object
20
+ */ if (requestHeaders["Content-Type"]?.toLowerCase().includes("multipart/form-data")) {
21
+ delete requestHeaders["Content-Type"];
22
+ }
23
+ const payload = body instanceof FormData ? body : requestHeaders["Content-Type"] === "application/json" ? JSON.stringify(body) : body;
24
+ const fullUrl = `${baseUrl}${resolveUrl(url, queryParams)}`;
25
+ const response = await fetchImpl(fullUrl, {
26
+ signal,
27
+ method: method.toUpperCase(),
28
+ body: payload,
29
+ headers: requestHeaders
30
+ });
31
+ if (!response.ok) {
32
+ let error;
33
+ try {
34
+ error = await response.json();
35
+ } catch (e) {
36
+ error = {
37
+ status: "unknown",
38
+ payload: e instanceof Error ? `Unexpected error (${e.message})` : "Unexpected error"
39
+ };
40
+ }
41
+ throw error;
42
+ }
43
+ if (response.headers?.get("content-type")?.includes("json")) {
44
+ return await response.json();
45
+ } else {
46
+ // if it is not a json response, assume it is a blob and cast it to TData
47
+ return await response.text();
48
+ }
49
+ } catch (e) {
50
+ const errorObject = {
51
+ name: "unknown",
52
+ message: e?.message ? `${e?.message}` : "Network error"
53
+ };
54
+ throw errorObject;
55
+ }
56
+ }
57
+ const resolveUrl = (url, queryParams = {})=>{
58
+ let query = new URLSearchParams(queryParams).toString();
59
+ if (query) query = `?${query}`;
60
+ return url + query;
61
+ };
62
+
63
+ /**
64
+ * @summary Create Chat
65
+ * @description Creates a new chat using a user message, optional system context, and model configuration. Useful for prompting the model within the scope of a specific project.
66
+ * @link /chats
67
+ */ async function chatsCreate({ config } = {}) {
68
+ const { client: request = client, ...requestConfig } = config ?? {};
69
+ const data = await request({
70
+ method: "POST",
71
+ url: `/chats`,
72
+ ...requestConfig,
73
+ headers: {
74
+ ...requestConfig.headers
75
+ }
76
+ });
77
+ return data;
78
+ }
79
+ /**
80
+ * @summary Find Chats
81
+ * @description Retrieves a list of existing chats, with support for pagination and filtering by favorite status, Vercel project, or Git branch. Helps manage and navigate chat history.
82
+ * @link /chats
83
+ */ async function chatsFind({ queryParams, config } = {}) {
84
+ const { client: request = client, ...requestConfig } = config ?? {};
85
+ const data = await request({
86
+ method: "GET",
87
+ url: `/chats`,
88
+ queryParams,
89
+ ...requestConfig,
90
+ headers: {
91
+ ...requestConfig.headers
92
+ }
93
+ });
94
+ return data;
95
+ }
96
+ /**
97
+ * @summary Initialize Chat
98
+ * @description Initializes a new chat from source content such as files, repositories, registries, or zip archives. Enables context-rich conversations based on code or assets.
99
+ * @link /chats/init
100
+ */ async function chatsInit({ config } = {}) {
101
+ const { client: request = client, ...requestConfig } = config ?? {};
102
+ const data = await request({
103
+ method: "POST",
104
+ url: `/chats/init`,
105
+ ...requestConfig,
106
+ headers: {
107
+ ...requestConfig.headers
108
+ }
109
+ });
110
+ return data;
111
+ }
112
+ /**
113
+ * @summary Delete Chat
114
+ * @description Deletes a specific chat based on the provided chatId. The chat and its contents are moved to trash and stop being retrievable immediately, then retained for 30 days before being permanently removed.
115
+ * @link /chats/{chatId}
116
+ */ async function chatsDelete({ pathParams, config } = {}) {
117
+ const { client: request = client, ...requestConfig } = config ?? {};
118
+ if (!pathParams.chatId) {
119
+ throw new Error(`Missing required path parameter: chatId`);
120
+ }
121
+ const data = await request({
122
+ method: "DELETE",
123
+ url: `/chats/${pathParams.chatId}`,
124
+ ...requestConfig,
125
+ headers: {
126
+ ...requestConfig.headers
127
+ }
128
+ });
129
+ return data;
130
+ }
131
+ /**
132
+ * @summary Get Chat
133
+ * @description Retrieves the full details of a specific chat using its `chatId`. Includes messages, metadata, and associated configuration.
134
+ * @link /chats/{chatId}
135
+ */ async function chatsGetById({ pathParams, config } = {}) {
136
+ const { client: request = client, ...requestConfig } = config ?? {};
137
+ if (!pathParams.chatId) {
138
+ throw new Error(`Missing required path parameter: chatId`);
139
+ }
140
+ const data = await request({
141
+ method: "GET",
142
+ url: `/chats/${pathParams.chatId}`,
143
+ ...requestConfig,
144
+ headers: {
145
+ ...requestConfig.headers
146
+ }
147
+ });
148
+ return data;
149
+ }
150
+ /**
151
+ * @summary Update Chat
152
+ * @description Updates the metadata of an existing chat using its `chatId`. Supports changes to the chat name and privacy setting.
153
+ * @link /chats/{chatId}
154
+ */ async function chatsUpdate({ pathParams, config } = {}) {
155
+ const { client: request = client, ...requestConfig } = config ?? {};
156
+ if (!pathParams.chatId) {
157
+ throw new Error(`Missing required path parameter: chatId`);
158
+ }
159
+ const data = await request({
160
+ method: "PATCH",
161
+ url: `/chats/${pathParams.chatId}`,
162
+ ...requestConfig,
163
+ headers: {
164
+ ...requestConfig.headers
165
+ }
166
+ });
167
+ return data;
168
+ }
169
+ /**
170
+ * @summary Favorite Chat
171
+ * @description Marks or unmarks a chat as a favorite using its `chatId`. This helps with organizing and quickly accessing important chats.
172
+ * @link /chats/{chatId}/favorite
173
+ */ async function chatsFavorite({ pathParams, config } = {}) {
174
+ const { client: request = client, ...requestConfig } = config ?? {};
175
+ if (!pathParams.chatId) {
176
+ throw new Error(`Missing required path parameter: chatId`);
177
+ }
178
+ const data = await request({
179
+ method: "PUT",
180
+ url: `/chats/${pathParams.chatId}/favorite`,
181
+ ...requestConfig,
182
+ headers: {
183
+ ...requestConfig.headers
184
+ }
185
+ });
186
+ return data;
187
+ }
188
+ /**
189
+ * @summary Fork Chat
190
+ * @description Creates a new chat fork (duplicate) from a specific version within a chat created through Platform API v1. To duplicate chats created in v0 web or Platform API v2, use POST /v2/chats/{chatId}/duplicate.
191
+ * @link /chats/{chatId}/fork
192
+ */ async function chatsFork({ pathParams, config } = {}) {
193
+ const { client: request = client, ...requestConfig } = config ?? {};
194
+ if (!pathParams.chatId) {
195
+ throw new Error(`Missing required path parameter: chatId`);
196
+ }
197
+ const data = await request({
198
+ method: "POST",
199
+ url: `/chats/${pathParams.chatId}/fork`,
200
+ ...requestConfig,
201
+ headers: {
202
+ ...requestConfig.headers
203
+ }
204
+ });
205
+ return data;
206
+ }
207
+ /**
208
+ * @summary Get Project by Chat ID
209
+ * @description Retrieves the v0 project associated with a given chat. Useful for determining the context or scope of a chat session.
210
+ * @link /chats/{chatId}/project
211
+ */ async function projectsGetByChatId({ pathParams, config } = {}) {
212
+ const { client: request = client, ...requestConfig } = config ?? {};
213
+ if (!pathParams.chatId) {
214
+ throw new Error(`Missing required path parameter: chatId`);
215
+ }
216
+ const data = await request({
217
+ method: "GET",
218
+ url: `/chats/${pathParams.chatId}/project`,
219
+ ...requestConfig,
220
+ headers: {
221
+ ...requestConfig.headers
222
+ }
223
+ });
224
+ return data;
225
+ }
226
+ /**
227
+ * @summary Find Chat Messages
228
+ * @description Retrieves a list of all messages for a specific chat, ordered by creation date (newest first). Supports cursor-based pagination and includes message content, role, and type information.
229
+ * @link /chats/{chatId}/messages
230
+ */ async function chatsFindMessages({ pathParams, queryParams, config } = {}) {
231
+ const { client: request = client, ...requestConfig } = config ?? {};
232
+ if (!pathParams.chatId) {
233
+ throw new Error(`Missing required path parameter: chatId`);
234
+ }
235
+ const data = await request({
236
+ method: "GET",
237
+ url: `/chats/${pathParams.chatId}/messages`,
238
+ queryParams,
239
+ ...requestConfig,
240
+ headers: {
241
+ ...requestConfig.headers
242
+ }
243
+ });
244
+ return data;
245
+ }
246
+ /**
247
+ * @summary Send Message
248
+ * @description Creates a new message in an existing chat. Triggers a model response using the provided prompt, with optional attachments and configuration settings.
249
+ * @link /chats/{chatId}/messages
250
+ */ async function chatsSendMessage({ pathParams, config } = {}) {
251
+ const { client: request = client, ...requestConfig } = config ?? {};
252
+ if (!pathParams.chatId) {
253
+ throw new Error(`Missing required path parameter: chatId`);
254
+ }
255
+ const data = await request({
256
+ method: "POST",
257
+ url: `/chats/${pathParams.chatId}/messages`,
258
+ ...requestConfig,
259
+ headers: {
260
+ ...requestConfig.headers
261
+ }
262
+ });
263
+ return data;
264
+ }
265
+ /**
266
+ * @summary Get Chat Message
267
+ * @description Retrieves detailed information about a specific message within a chat, including content, files, model configuration, and demo URLs.
268
+ * @link /chats/{chatId}/messages/{messageId}
269
+ */ async function chatsGetMessage({ pathParams, config } = {}) {
270
+ const { client: request = client, ...requestConfig } = config ?? {};
271
+ if (!pathParams.chatId) {
272
+ throw new Error(`Missing required path parameter: chatId`);
273
+ }
274
+ if (!pathParams.messageId) {
275
+ throw new Error(`Missing required path parameter: messageId`);
276
+ }
277
+ const data = await request({
278
+ method: "GET",
279
+ url: `/chats/${pathParams.chatId}/messages/${pathParams.messageId}`,
280
+ ...requestConfig,
281
+ headers: {
282
+ ...requestConfig.headers
283
+ }
284
+ });
285
+ return data;
286
+ }
287
+ /**
288
+ * @summary Find Chat Versions
289
+ * @description Retrieves a list of all versions (iterations) for a specific chat, ordered by creation date (newest first). Supports cursor-based pagination and includes version status and demo URLs.
290
+ * @link /chats/{chatId}/versions
291
+ */ async function chatsFindVersions({ pathParams, queryParams, config } = {}) {
292
+ const { client: request = client, ...requestConfig } = config ?? {};
293
+ if (!pathParams.chatId) {
294
+ throw new Error(`Missing required path parameter: chatId`);
295
+ }
296
+ const data = await request({
297
+ method: "GET",
298
+ url: `/chats/${pathParams.chatId}/versions`,
299
+ queryParams,
300
+ ...requestConfig,
301
+ headers: {
302
+ ...requestConfig.headers
303
+ }
304
+ });
305
+ return data;
306
+ }
307
+ /**
308
+ * @summary Get Chat Version
309
+ * @description Retrieves detailed information about a specific version of a chat, including all files with their content and lock status.
310
+ * @link /chats/{chatId}/versions/{versionId}
311
+ */ async function chatsGetVersion({ pathParams, queryParams, config } = {}) {
312
+ const { client: request = client, ...requestConfig } = config ?? {};
313
+ if (!pathParams.chatId) {
314
+ throw new Error(`Missing required path parameter: chatId`);
315
+ }
316
+ if (!pathParams.versionId) {
317
+ throw new Error(`Missing required path parameter: versionId`);
318
+ }
319
+ const data = await request({
320
+ method: "GET",
321
+ url: `/chats/${pathParams.chatId}/versions/${pathParams.versionId}`,
322
+ queryParams,
323
+ ...requestConfig,
324
+ headers: {
325
+ ...requestConfig.headers
326
+ }
327
+ });
328
+ return data;
329
+ }
330
+ /**
331
+ * @summary Update Chat Version Files
332
+ * @description Updates the source files of a specific chat version (block) manually. This allows editing generated files directly through the API.
333
+ * @link /chats/{chatId}/versions/{versionId}
334
+ */ async function chatsUpdateVersion({ pathParams, config } = {}) {
335
+ const { client: request = client, ...requestConfig } = config ?? {};
336
+ if (!pathParams.chatId) {
337
+ throw new Error(`Missing required path parameter: chatId`);
338
+ }
339
+ if (!pathParams.versionId) {
340
+ throw new Error(`Missing required path parameter: versionId`);
341
+ }
342
+ const data = await request({
343
+ method: "PATCH",
344
+ url: `/chats/${pathParams.chatId}/versions/${pathParams.versionId}`,
345
+ ...requestConfig,
346
+ headers: {
347
+ ...requestConfig.headers
348
+ }
349
+ });
350
+ return data;
351
+ }
352
+ /**
353
+ * @summary Download version files
354
+ * @description Download all files for a specific chat version as a zip or tarball archive. Use includeDefaultFiles=true to include all deployment files (package.json, configuration files, etc.) or false/omitted to return only the generated source files.
355
+ * @link /chats/{chatId}/versions/{versionId}/download
356
+ */ async function chatsDownloadVersion({ pathParams, queryParams, config } = {}) {
357
+ const { client: request = client, ...requestConfig } = config ?? {};
358
+ if (!pathParams.chatId) {
359
+ throw new Error(`Missing required path parameter: chatId`);
360
+ }
361
+ if (!pathParams.versionId) {
362
+ throw new Error(`Missing required path parameter: versionId`);
363
+ }
364
+ const data = await request({
365
+ method: "GET",
366
+ url: `/chats/${pathParams.chatId}/versions/${pathParams.versionId}/download`,
367
+ queryParams,
368
+ ...requestConfig,
369
+ headers: {
370
+ ...requestConfig.headers
371
+ }
372
+ });
373
+ return data;
374
+ }
375
+ /**
376
+ * @summary Delete Chat Version Files
377
+ * @description Deletes source files from a specific chat version (block). Files are removed from the version and a new source version is created.
378
+ * @link /chats/{chatId}/versions/{versionId}/files/delete
379
+ */ async function chatsDeleteVersionFiles({ pathParams, config } = {}) {
380
+ const { client: request = client, ...requestConfig } = config ?? {};
381
+ if (!pathParams.chatId) {
382
+ throw new Error(`Missing required path parameter: chatId`);
383
+ }
384
+ if (!pathParams.versionId) {
385
+ throw new Error(`Missing required path parameter: versionId`);
386
+ }
387
+ const data = await request({
388
+ method: "POST",
389
+ url: `/chats/${pathParams.chatId}/versions/${pathParams.versionId}/files/delete`,
390
+ ...requestConfig,
391
+ headers: {
392
+ ...requestConfig.headers
393
+ }
394
+ });
395
+ return data;
396
+ }
397
+ /**
398
+ * @summary Resume Message
399
+ * @description Reconnects to an active assistant message stream and returns it as Server-Sent Events. This does not restart or continue a stopped generation.
400
+ * @link /chats/{chatId}/messages/{messageId}/resume
401
+ */ async function chatsResume({ pathParams, config } = {}) {
402
+ const { client: request = client, ...requestConfig } = config ?? {};
403
+ if (!pathParams.chatId) {
404
+ throw new Error(`Missing required path parameter: chatId`);
405
+ }
406
+ if (!pathParams.messageId) {
407
+ throw new Error(`Missing required path parameter: messageId`);
408
+ }
409
+ const data = await request({
410
+ method: "POST",
411
+ url: `/chats/${pathParams.chatId}/messages/${pathParams.messageId}/resume`,
412
+ ...requestConfig,
413
+ headers: {
414
+ ...requestConfig.headers
415
+ }
416
+ });
417
+ return data;
418
+ }
419
+ /**
420
+ * @summary Stop Message
421
+ * @description Stops an in-flight message generation in a chat. Useful for cancelling a streaming response that is still being generated.
422
+ * @link /chats/{chatId}/messages/{messageId}/stop
423
+ */ async function chatsStop({ pathParams, config } = {}) {
424
+ const { client: request = client, ...requestConfig } = config ?? {};
425
+ if (!pathParams.chatId) {
426
+ throw new Error(`Missing required path parameter: chatId`);
427
+ }
428
+ if (!pathParams.messageId) {
429
+ throw new Error(`Missing required path parameter: messageId`);
430
+ }
431
+ const data = await request({
432
+ method: "POST",
433
+ url: `/chats/${pathParams.chatId}/messages/${pathParams.messageId}/stop`,
434
+ ...requestConfig,
435
+ headers: {
436
+ ...requestConfig.headers
437
+ }
438
+ });
439
+ return data;
440
+ }
441
+ /**
442
+ * @summary Resolve Task
443
+ * @description Resolves a pending task in a chat, continuing the conversation. The latest message in the active chat fork must be an assistant message currently blocked on a matching task (integration setup, plan approval, question answers, or permission grants).
444
+ * @link /chats/{chatId}/tasks/resolve
445
+ */ async function chatsResolveTask({ pathParams, config } = {}) {
446
+ const { client: request = client, ...requestConfig } = config ?? {};
447
+ if (!pathParams.chatId) {
448
+ throw new Error(`Missing required path parameter: chatId`);
449
+ }
450
+ const data = await request({
451
+ method: "POST",
452
+ url: `/chats/${pathParams.chatId}/tasks/resolve`,
453
+ ...requestConfig,
454
+ headers: {
455
+ ...requestConfig.headers
456
+ }
457
+ });
458
+ return data;
459
+ }
460
+ /**
461
+ * @summary Find Deployments
462
+ * @description Find deployments by project and chat IDs. This will return a list of deployments for the given project and chat IDs.
463
+ * @link /deployments
464
+ */ async function deploymentsFind({ queryParams, config } = {}) {
465
+ const { client: request = client, ...requestConfig } = config ?? {};
466
+ const data = await request({
467
+ method: "GET",
468
+ url: `/deployments`,
469
+ queryParams,
470
+ ...requestConfig,
471
+ headers: {
472
+ ...requestConfig.headers
473
+ }
474
+ });
475
+ return data;
476
+ }
477
+ /**
478
+ * @summary Create Deployment
479
+ * @description Create a new deployment for a specific chat and version. This will trigger a deployment to Vercel.
480
+ * @link /deployments
481
+ */ async function deploymentsCreate({ config } = {}) {
482
+ const { client: request = client, ...requestConfig } = config ?? {};
483
+ const data = await request({
484
+ method: "POST",
485
+ url: `/deployments`,
486
+ ...requestConfig,
487
+ headers: {
488
+ ...requestConfig.headers
489
+ }
490
+ });
491
+ return data;
492
+ }
493
+ /**
494
+ * @summary Get Deployment
495
+ * @description Get a deployment by ID. This will return the details of the deployment, including the inspector URL, chat ID, project ID, version ID, API URL, and web URL.
496
+ * @link /deployments/{deploymentId}
497
+ */ async function deploymentsGetById({ pathParams, config } = {}) {
498
+ const { client: request = client, ...requestConfig } = config ?? {};
499
+ if (!pathParams.deploymentId) {
500
+ throw new Error(`Missing required path parameter: deploymentId`);
501
+ }
502
+ const data = await request({
503
+ method: "GET",
504
+ url: `/deployments/${pathParams.deploymentId}`,
505
+ ...requestConfig,
506
+ headers: {
507
+ ...requestConfig.headers
508
+ }
509
+ });
510
+ return data;
511
+ }
512
+ /**
513
+ * @summary Delete Deployment
514
+ * @description Delete a deployment by ID. This will delete the deployment from Vercel.
515
+ * @link /deployments/{deploymentId}
516
+ */ async function deploymentsDelete({ pathParams, config } = {}) {
517
+ const { client: request = client, ...requestConfig } = config ?? {};
518
+ if (!pathParams.deploymentId) {
519
+ throw new Error(`Missing required path parameter: deploymentId`);
520
+ }
521
+ const data = await request({
522
+ method: "DELETE",
523
+ url: `/deployments/${pathParams.deploymentId}`,
524
+ ...requestConfig,
525
+ headers: {
526
+ ...requestConfig.headers
527
+ }
528
+ });
529
+ return data;
530
+ }
531
+ /**
532
+ * @summary Find Deployment Logs
533
+ * @description Retrieves logs for a specific deployment. Supports filtering by timestamp to fetch only recent logs.
534
+ * @link /deployments/{deploymentId}/logs
535
+ */ async function deploymentsFindLogs({ pathParams, queryParams, config } = {}) {
536
+ const { client: request = client, ...requestConfig } = config ?? {};
537
+ if (!pathParams.deploymentId) {
538
+ throw new Error(`Missing required path parameter: deploymentId`);
539
+ }
540
+ const data = await request({
541
+ method: "GET",
542
+ url: `/deployments/${pathParams.deploymentId}/logs`,
543
+ queryParams,
544
+ ...requestConfig,
545
+ headers: {
546
+ ...requestConfig.headers
547
+ }
548
+ });
549
+ return data;
550
+ }
551
+ /**
552
+ * @summary Find Deployment Errors
553
+ * @description Retrieves a list of errors that occurred during a specific deployment. Useful for diagnosing and debugging deployment issues.
554
+ * @link /deployments/{deploymentId}/errors
555
+ */ async function deploymentsFindErrors({ pathParams, config } = {}) {
556
+ const { client: request = client, ...requestConfig } = config ?? {};
557
+ if (!pathParams.deploymentId) {
558
+ throw new Error(`Missing required path parameter: deploymentId`);
559
+ }
560
+ const data = await request({
561
+ method: "GET",
562
+ url: `/deployments/${pathParams.deploymentId}/errors`,
563
+ ...requestConfig,
564
+ headers: {
565
+ ...requestConfig.headers
566
+ }
567
+ });
568
+ return data;
569
+ }
570
+ /**
571
+ * @summary Find Hooks
572
+ * @description Retrieves a list of existing hooks in your workspace. Useful for managing active webhooks tied to chat events or deployments.
573
+ * @link /hooks
574
+ */ async function hooksFind({ config } = {}) {
575
+ const { client: request = client, ...requestConfig } = config ?? {};
576
+ const data = await request({
577
+ method: "GET",
578
+ url: `/hooks`,
579
+ ...requestConfig,
580
+ headers: {
581
+ ...requestConfig.headers
582
+ }
583
+ });
584
+ return data;
585
+ }
586
+ /**
587
+ * @summary Create Hook
588
+ * @description Creates a new webhook that listens for specific events. Supports optional association with a chat.
589
+ * @link /hooks
590
+ */ async function hooksCreate({ config } = {}) {
591
+ const { client: request = client, ...requestConfig } = config ?? {};
592
+ const data = await request({
593
+ method: "POST",
594
+ url: `/hooks`,
595
+ ...requestConfig,
596
+ headers: {
597
+ ...requestConfig.headers
598
+ }
599
+ });
600
+ return data;
601
+ }
602
+ /**
603
+ * @summary Get Hook
604
+ * @description Retrieves the details of a specific webhook using its ID.
605
+ * @link /hooks/{hookId}
606
+ */ async function hooksGetById({ pathParams, config } = {}) {
607
+ const { client: request = client, ...requestConfig } = config ?? {};
608
+ if (!pathParams.hookId) {
609
+ throw new Error(`Missing required path parameter: hookId`);
610
+ }
611
+ const data = await request({
612
+ method: "GET",
613
+ url: `/hooks/${pathParams.hookId}`,
614
+ ...requestConfig,
615
+ headers: {
616
+ ...requestConfig.headers
617
+ }
618
+ });
619
+ return data;
620
+ }
621
+ /**
622
+ * @summary Update Hook
623
+ * @description Updates the configuration of an existing webhook, including its name, event subscriptions, or target URL.
624
+ * @link /hooks/{hookId}
625
+ */ async function hooksUpdate({ pathParams, config } = {}) {
626
+ const { client: request = client, ...requestConfig } = config ?? {};
627
+ if (!pathParams.hookId) {
628
+ throw new Error(`Missing required path parameter: hookId`);
629
+ }
630
+ const data = await request({
631
+ method: "PATCH",
632
+ url: `/hooks/${pathParams.hookId}`,
633
+ ...requestConfig,
634
+ headers: {
635
+ ...requestConfig.headers
636
+ }
637
+ });
638
+ return data;
639
+ }
640
+ /**
641
+ * @summary Delete Hook
642
+ * @description Deletes a webhook based on its ID. This action is irreversible.
643
+ * @link /hooks/{hookId}
644
+ */ async function hooksDelete({ pathParams, config } = {}) {
645
+ const { client: request = client, ...requestConfig } = config ?? {};
646
+ if (!pathParams.hookId) {
647
+ throw new Error(`Missing required path parameter: hookId`);
648
+ }
649
+ const data = await request({
650
+ method: "DELETE",
651
+ url: `/hooks/${pathParams.hookId}`,
652
+ ...requestConfig,
653
+ headers: {
654
+ ...requestConfig.headers
655
+ }
656
+ });
657
+ return data;
658
+ }
659
+ /**
660
+ * @summary Find Vercel Projects
661
+ * @description Retrieves a list of Vercel projects linked to your integration. Useful for associating chats, deployments, or hooks with specific Vercel projects.
662
+ * @link /integrations/vercel/projects
663
+ */ async function integrationsVercelProjectsFind({ config } = {}) {
664
+ const { client: request = client, ...requestConfig } = config ?? {};
665
+ const data = await request({
666
+ method: "GET",
667
+ url: `/integrations/vercel/projects`,
668
+ ...requestConfig,
669
+ headers: {
670
+ ...requestConfig.headers
671
+ }
672
+ });
673
+ return data;
674
+ }
675
+ /**
676
+ * @summary Create Vercel Project
677
+ * @description Links a Vercel project to an existing v0 project. Enables Vercel-related features and deployment integration within the v0 workspace.
678
+ * @link /integrations/vercel/projects
679
+ */ async function integrationsVercelProjectsCreate({ config } = {}) {
680
+ const { client: request = client, ...requestConfig } = config ?? {};
681
+ const data = await request({
682
+ method: "POST",
683
+ url: `/integrations/vercel/projects`,
684
+ ...requestConfig,
685
+ headers: {
686
+ ...requestConfig.headers
687
+ }
688
+ });
689
+ return data;
690
+ }
691
+ /**
692
+ * @summary Find Projects
693
+ * @description Returns a list of all v0 projects in your workspace. Useful for browsing or managing projects across different chats or use cases.
694
+ * @link /projects
695
+ */ async function projectsFind({ config } = {}) {
696
+ const { client: request = client, ...requestConfig } = config ?? {};
697
+ const data = await request({
698
+ method: "GET",
699
+ url: `/projects`,
700
+ ...requestConfig,
701
+ headers: {
702
+ ...requestConfig.headers
703
+ }
704
+ });
705
+ return data;
706
+ }
707
+ /**
708
+ * @summary Create Project
709
+ * @description Creates a new v0 project with an optional description, icon, environment variables, and instructions. Projects help organize chats and manage context.
710
+ * @link /projects
711
+ */ async function projectsCreate({ config } = {}) {
712
+ const { client: request = client, ...requestConfig } = config ?? {};
713
+ const data = await request({
714
+ method: "POST",
715
+ url: `/projects`,
716
+ ...requestConfig,
717
+ headers: {
718
+ ...requestConfig.headers
719
+ }
720
+ });
721
+ return data;
722
+ }
723
+ /**
724
+ * @summary Get Project by ID
725
+ * @description Retrieves the details of a specific v0 project by its ID.
726
+ * @link /projects/{projectId}
727
+ */ async function projectsGetById({ pathParams, config } = {}) {
728
+ const { client: request = client, ...requestConfig } = config ?? {};
729
+ if (!pathParams.projectId) {
730
+ throw new Error(`Missing required path parameter: projectId`);
731
+ }
732
+ const data = await request({
733
+ method: "GET",
734
+ url: `/projects/${pathParams.projectId}`,
735
+ ...requestConfig,
736
+ headers: {
737
+ ...requestConfig.headers
738
+ }
739
+ });
740
+ return data;
741
+ }
742
+ /**
743
+ * @summary Update Project
744
+ * @description Updates the metadata of an existing project using its `projectId`. Supports changes to the project name and privacy setting.
745
+ * @link /projects/{projectId}
746
+ */ async function projectsUpdate({ pathParams, config } = {}) {
747
+ const { client: request = client, ...requestConfig } = config ?? {};
748
+ if (!pathParams.projectId) {
749
+ throw new Error(`Missing required path parameter: projectId`);
750
+ }
751
+ const data = await request({
752
+ method: "PATCH",
753
+ url: `/projects/${pathParams.projectId}`,
754
+ ...requestConfig,
755
+ headers: {
756
+ ...requestConfig.headers
757
+ }
758
+ });
759
+ return data;
760
+ }
761
+ /**
762
+ * @summary Delete Project
763
+ * @description Deletes a specific project based on the provided projectId. This operation marks the project as deleted and is irreversible.
764
+ * @link /projects/{projectId}
765
+ */ async function projectsDelete({ pathParams, queryParams, config } = {}) {
766
+ const { client: request = client, ...requestConfig } = config ?? {};
767
+ if (!pathParams.projectId) {
768
+ throw new Error(`Missing required path parameter: projectId`);
769
+ }
770
+ const data = await request({
771
+ method: "DELETE",
772
+ url: `/projects/${pathParams.projectId}`,
773
+ queryParams,
774
+ ...requestConfig,
775
+ headers: {
776
+ ...requestConfig.headers
777
+ }
778
+ });
779
+ return data;
780
+ }
781
+ /**
782
+ * @summary Assign Project to Chat
783
+ * @description Links an existing v0 project to a specific chat. Helps group conversations under a shared project context.
784
+ * @link /projects/{projectId}/assign
785
+ */ async function projectsAssign({ pathParams, config } = {}) {
786
+ const { client: request = client, ...requestConfig } = config ?? {};
787
+ if (!pathParams.projectId) {
788
+ throw new Error(`Missing required path parameter: projectId`);
789
+ }
790
+ const data = await request({
791
+ method: "POST",
792
+ url: `/projects/${pathParams.projectId}/assign`,
793
+ ...requestConfig,
794
+ headers: {
795
+ ...requestConfig.headers
796
+ }
797
+ });
798
+ return data;
799
+ }
800
+ /**
801
+ * @summary Find Environment Variables
802
+ * @description Retrieves all environment variables for a given project.
803
+ * @link /projects/{projectId}/env-vars
804
+ */ async function projectsFindEnvVars({ pathParams, queryParams, config } = {}) {
805
+ const { client: request = client, ...requestConfig } = config ?? {};
806
+ if (!pathParams.projectId) {
807
+ throw new Error(`Missing required path parameter: projectId`);
808
+ }
809
+ const data = await request({
810
+ method: "GET",
811
+ url: `/projects/${pathParams.projectId}/env-vars`,
812
+ queryParams,
813
+ ...requestConfig,
814
+ headers: {
815
+ ...requestConfig.headers
816
+ }
817
+ });
818
+ return data;
819
+ }
820
+ /**
821
+ * @summary Create Environment Variables
822
+ * @description Creates new environment variables for a given project. This endpoint will fail if any of the specified environment variable keys already exist, unless upsert is set to true.
823
+ * @link /projects/{projectId}/env-vars
824
+ */ async function projectsCreateEnvVars({ pathParams, queryParams, config } = {}) {
825
+ const { client: request = client, ...requestConfig } = config ?? {};
826
+ if (!pathParams.projectId) {
827
+ throw new Error(`Missing required path parameter: projectId`);
828
+ }
829
+ const data = await request({
830
+ method: "POST",
831
+ url: `/projects/${pathParams.projectId}/env-vars`,
832
+ queryParams,
833
+ ...requestConfig,
834
+ headers: {
835
+ ...requestConfig.headers
836
+ }
837
+ });
838
+ return data;
839
+ }
840
+ /**
841
+ * @summary Update Environment Variables
842
+ * @description Updates multiple environment variables for a given project. Only the value of each environment variable can be updated.
843
+ * @link /projects/{projectId}/env-vars
844
+ */ async function projectsUpdateEnvVars({ pathParams, queryParams, config } = {}) {
845
+ const { client: request = client, ...requestConfig } = config ?? {};
846
+ if (!pathParams.projectId) {
847
+ throw new Error(`Missing required path parameter: projectId`);
848
+ }
849
+ const data = await request({
850
+ method: "PATCH",
851
+ url: `/projects/${pathParams.projectId}/env-vars`,
852
+ queryParams,
853
+ ...requestConfig,
854
+ headers: {
855
+ ...requestConfig.headers
856
+ }
857
+ });
858
+ return data;
859
+ }
860
+ /**
861
+ * @summary Delete Environment Variables
862
+ * @description Deletes multiple environment variables for a given project by their IDs.
863
+ * @link /projects/{projectId}/env-vars/delete
864
+ */ async function projectsDeleteEnvVars({ pathParams, config } = {}) {
865
+ const { client: request = client, ...requestConfig } = config ?? {};
866
+ if (!pathParams.projectId) {
867
+ throw new Error(`Missing required path parameter: projectId`);
868
+ }
869
+ const data = await request({
870
+ method: "POST",
871
+ url: `/projects/${pathParams.projectId}/env-vars/delete`,
872
+ ...requestConfig,
873
+ headers: {
874
+ ...requestConfig.headers
875
+ }
876
+ });
877
+ return data;
878
+ }
879
+ /**
880
+ * @summary Get Environment Variable
881
+ * @description Retrieves a specific environment variable for a given project by its ID, including its value.
882
+ * @link /projects/{projectId}/env-vars/{environmentVariableId}
883
+ */ async function projectsGetEnvVar({ pathParams, queryParams, config } = {}) {
884
+ const { client: request = client, ...requestConfig } = config ?? {};
885
+ if (!pathParams.projectId) {
886
+ throw new Error(`Missing required path parameter: projectId`);
887
+ }
888
+ if (!pathParams.environmentVariableId) {
889
+ throw new Error(`Missing required path parameter: environmentVariableId`);
890
+ }
891
+ const data = await request({
892
+ method: "GET",
893
+ url: `/projects/${pathParams.projectId}/env-vars/${pathParams.environmentVariableId}`,
894
+ queryParams,
895
+ ...requestConfig,
896
+ headers: {
897
+ ...requestConfig.headers
898
+ }
899
+ });
900
+ return data;
901
+ }
902
+ /**
903
+ * @summary Find Rate Limit
904
+ * @description Retrieves rate limit information for a given scope. Useful for monitoring usage limits and avoiding throttling.
905
+ * @link /rate-limits
906
+ */ async function rateLimitsFind({ queryParams, config } = {}) {
907
+ const { client: request = client, ...requestConfig } = config ?? {};
908
+ const data = await request({
909
+ method: "GET",
910
+ url: `/rate-limits`,
911
+ queryParams,
912
+ ...requestConfig,
913
+ headers: {
914
+ ...requestConfig.headers
915
+ }
916
+ });
917
+ return data;
918
+ }
919
+ /**
920
+ * @summary Get User
921
+ * @description Retrieves information about the authenticated user, including their ID, name, email, and account metadata.
922
+ * @link /user
923
+ */ async function userGet({ config } = {}) {
924
+ const { client: request = client, ...requestConfig } = config ?? {};
925
+ const data = await request({
926
+ method: "GET",
927
+ url: `/user`,
928
+ ...requestConfig,
929
+ headers: {
930
+ ...requestConfig.headers
931
+ }
932
+ });
933
+ return data;
934
+ }
935
+ /**
936
+ * @summary Get Billing
937
+ * @description Fetches billing usage and quota information for the authenticated user. Can be scoped to a specific context (e.g. project or namespace).
938
+ * @link /user/billing
939
+ */ async function userGetBilling({ queryParams, config } = {}) {
940
+ const { client: request = client, ...requestConfig } = config ?? {};
941
+ const data = await request({
942
+ method: "GET",
943
+ url: `/user/billing`,
944
+ queryParams,
945
+ ...requestConfig,
946
+ headers: {
947
+ ...requestConfig.headers
948
+ }
949
+ });
950
+ return data;
951
+ }
952
+ /**
953
+ * @summary Get Plan
954
+ * @description Returns the current subscription plan for the authenticated user, including tier details and feature limits.
955
+ * @link /user/plan
956
+ */ async function userGetPlan({ config } = {}) {
957
+ const { client: request = client, ...requestConfig } = config ?? {};
958
+ const data = await request({
959
+ method: "GET",
960
+ url: `/user/plan`,
961
+ ...requestConfig,
962
+ headers: {
963
+ ...requestConfig.headers
964
+ }
965
+ });
966
+ return data;
967
+ }
968
+ /**
969
+ * @summary Get User Scopes
970
+ * @description Retrieves all accessible scopes for the authenticated user, such as personal workspaces or shared teams.
971
+ * @link /user/scopes
972
+ */ async function userGetScopes({ config } = {}) {
973
+ const { client: request = client, ...requestConfig } = config ?? {};
974
+ const data = await request({
975
+ method: "GET",
976
+ url: `/user/scopes`,
977
+ ...requestConfig,
978
+ headers: {
979
+ ...requestConfig.headers
980
+ }
981
+ });
982
+ return data;
983
+ }
984
+ /**
985
+ * @summary Restore Block
986
+ * @description Restores a block to a specific version.
987
+ * @link /chats/{chatId}/versions/{versionId}/restore
988
+ */ async function chatsRestore({ pathParams, config } = {}) {
989
+ const { client: request = client, ...requestConfig } = config ?? {};
990
+ if (!pathParams.chatId) {
991
+ throw new Error(`Missing required path parameter: chatId`);
992
+ }
993
+ if (!pathParams.versionId) {
994
+ throw new Error(`Missing required path parameter: versionId`);
995
+ }
996
+ const data = await request({
997
+ method: "POST",
998
+ url: `/chats/${pathParams.chatId}/versions/${pathParams.versionId}/restore`,
999
+ ...requestConfig,
1000
+ headers: {
1001
+ ...requestConfig.headers
1002
+ }
1003
+ });
1004
+ return data;
1005
+ }
1006
+ /**
1007
+ * @summary Get Usage Report
1008
+ * @description Retrieves detailed usage events for the authenticated user or team, including costs, event types, models used, and metadata. Shows the same data as displayed in the usage dashboard. Can be filtered by chatId to show usage for a specific chat, or by userId to show usage for a specific user.
1009
+ * @link /reports/usage
1010
+ */ async function reportsGetUsage({ queryParams, config } = {}) {
1011
+ const { client: request = client, ...requestConfig } = config ?? {};
1012
+ const data = await request({
1013
+ method: "GET",
1014
+ url: `/reports/usage`,
1015
+ queryParams,
1016
+ ...requestConfig,
1017
+ headers: {
1018
+ ...requestConfig.headers
1019
+ }
1020
+ });
1021
+ return data;
1022
+ }
1023
+ /**
1024
+ * @summary Get AI Usage Report
1025
+ * @description Retrieves v0 AI usage events for the authenticated user or active team scope.
1026
+ * @link /reports/usage/ai
1027
+ */ async function reportsGetAIUsage({ queryParams, config } = {}) {
1028
+ const { client: request = client, ...requestConfig } = config ?? {};
1029
+ const data = await request({
1030
+ method: "GET",
1031
+ url: `/reports/usage/ai`,
1032
+ queryParams,
1033
+ ...requestConfig,
1034
+ headers: {
1035
+ ...requestConfig.headers
1036
+ }
1037
+ });
1038
+ return data;
1039
+ }
1040
+ /**
1041
+ * @summary Get User Activity Report
1042
+ * @description Retrieves aggregated user activity data for team members, including chat counts, message counts, and activity timestamps. Only available for Enterprise teams with OWNER or BILLING role. Shows the same data as displayed in the Usage settings for Enterprise teams.
1043
+ * @link /reports/user-activity
1044
+ */ async function reportsGetUserActivity({ queryParams, config } = {}) {
1045
+ const { client: request = client, ...requestConfig } = config ?? {};
1046
+ const data = await request({
1047
+ method: "GET",
1048
+ url: `/reports/user-activity`,
1049
+ queryParams,
1050
+ ...requestConfig,
1051
+ headers: {
1052
+ ...requestConfig.headers
1053
+ }
1054
+ });
1055
+ return data;
1056
+ }
1057
+ /**
1058
+ * @summary List MCP Servers
1059
+ * @description Retrieves all MCP servers configured for the authenticated user.
1060
+ * @link /mcp-servers
1061
+ */ async function mcpServersFind({ config } = {}) {
1062
+ const { client: request = client, ...requestConfig } = config ?? {};
1063
+ const data = await request({
1064
+ method: "GET",
1065
+ url: `/mcp-servers`,
1066
+ ...requestConfig,
1067
+ headers: {
1068
+ ...requestConfig.headers
1069
+ }
1070
+ });
1071
+ return data;
1072
+ }
1073
+ /**
1074
+ * @summary Create MCP Server
1075
+ * @description Creates a new MCP server configuration for the authenticated user. Supports OAuth, bearer token, custom headers, and unauthenticated servers.
1076
+ * @link /mcp-servers
1077
+ */ async function mcpServersCreate({ config } = {}) {
1078
+ const { client: request = client, ...requestConfig } = config ?? {};
1079
+ const data = await request({
1080
+ method: "POST",
1081
+ url: `/mcp-servers`,
1082
+ ...requestConfig,
1083
+ headers: {
1084
+ ...requestConfig.headers
1085
+ }
1086
+ });
1087
+ return data;
1088
+ }
1089
+ /**
1090
+ * @summary Get MCP Server
1091
+ * @description Retrieves the details of a specific MCP server by its ID.
1092
+ * @link /mcp-servers/{mcpServerId}
1093
+ */ async function mcpServersGetById({ pathParams, config } = {}) {
1094
+ const { client: request = client, ...requestConfig } = config ?? {};
1095
+ if (!pathParams.mcpServerId) {
1096
+ throw new Error(`Missing required path parameter: mcpServerId`);
1097
+ }
1098
+ const data = await request({
1099
+ method: "GET",
1100
+ url: `/mcp-servers/${pathParams.mcpServerId}`,
1101
+ ...requestConfig,
1102
+ headers: {
1103
+ ...requestConfig.headers
1104
+ }
1105
+ });
1106
+ return data;
1107
+ }
1108
+ /**
1109
+ * @summary Update MCP Server
1110
+ * @description Updates the configuration of an existing MCP server, including its name, URL, description, enabled status, and authentication settings.
1111
+ * @link /mcp-servers/{mcpServerId}
1112
+ */ async function mcpServersUpdate({ pathParams, config } = {}) {
1113
+ const { client: request = client, ...requestConfig } = config ?? {};
1114
+ if (!pathParams.mcpServerId) {
1115
+ throw new Error(`Missing required path parameter: mcpServerId`);
1116
+ }
1117
+ const data = await request({
1118
+ method: "PATCH",
1119
+ url: `/mcp-servers/${pathParams.mcpServerId}`,
1120
+ ...requestConfig,
1121
+ headers: {
1122
+ ...requestConfig.headers
1123
+ }
1124
+ });
1125
+ return data;
1126
+ }
1127
+ /**
1128
+ * @summary Delete MCP Server
1129
+ * @description Deletes an MCP server based on its ID. This action is irreversible and will also remove any associated OAuth tokens.
1130
+ * @link /mcp-servers/{mcpServerId}
1131
+ */ async function mcpServersDelete({ pathParams, config } = {}) {
1132
+ const { client: request = client, ...requestConfig } = config ?? {};
1133
+ if (!pathParams.mcpServerId) {
1134
+ throw new Error(`Missing required path parameter: mcpServerId`);
1135
+ }
1136
+ const data = await request({
1137
+ method: "DELETE",
1138
+ url: `/mcp-servers/${pathParams.mcpServerId}`,
1139
+ ...requestConfig,
1140
+ headers: {
1141
+ ...requestConfig.headers
1142
+ }
1143
+ });
1144
+ return data;
1145
+ }
1146
+ /**
1147
+ * @summary Create MCP Server OAuth Authorization URL
1148
+ * @description Creates an OAuth authorization URL for an OAuth MCP server. Redirect the user to the returned URL, and the Platform API OAuth callback will store the resulting tokens before redirecting to your returnUrl.
1149
+ * @link /mcp-servers/{mcpServerId}/oauth/authorize
1150
+ */ async function mcpServersCreateOAuthAuthorizationUrl({ pathParams, config } = {}) {
1151
+ const { client: request = client, ...requestConfig } = config ?? {};
1152
+ if (!pathParams.mcpServerId) {
1153
+ throw new Error(`Missing required path parameter: mcpServerId`);
1154
+ }
1155
+ const data = await request({
1156
+ method: "POST",
1157
+ url: `/mcp-servers/${pathParams.mcpServerId}/oauth/authorize`,
1158
+ ...requestConfig,
1159
+ headers: {
1160
+ ...requestConfig.headers
1161
+ }
1162
+ });
1163
+ return data;
1164
+ }
1165
+ const operationsByPath = {
1166
+ "POST /chats": chatsCreate,
1167
+ "GET /chats": chatsFind,
1168
+ "POST /chats/init": chatsInit,
1169
+ "DELETE /chats/{chatId}": chatsDelete,
1170
+ "GET /chats/{chatId}": chatsGetById,
1171
+ "PATCH /chats/{chatId}": chatsUpdate,
1172
+ "PUT /chats/{chatId}/favorite": chatsFavorite,
1173
+ "POST /chats/{chatId}/fork": chatsFork,
1174
+ "GET /chats/{chatId}/project": projectsGetByChatId,
1175
+ "GET /chats/{chatId}/messages": chatsFindMessages,
1176
+ "POST /chats/{chatId}/messages": chatsSendMessage,
1177
+ "GET /chats/{chatId}/messages/{messageId}": chatsGetMessage,
1178
+ "GET /chats/{chatId}/versions": chatsFindVersions,
1179
+ "GET /chats/{chatId}/versions/{versionId}": chatsGetVersion,
1180
+ "PATCH /chats/{chatId}/versions/{versionId}": chatsUpdateVersion,
1181
+ "GET /chats/{chatId}/versions/{versionId}/download": chatsDownloadVersion,
1182
+ "POST /chats/{chatId}/versions/{versionId}/files/delete": chatsDeleteVersionFiles,
1183
+ "POST /chats/{chatId}/messages/{messageId}/resume": chatsResume,
1184
+ "POST /chats/{chatId}/messages/{messageId}/stop": chatsStop,
1185
+ "POST /chats/{chatId}/tasks/resolve": chatsResolveTask,
1186
+ "GET /deployments": deploymentsFind,
1187
+ "POST /deployments": deploymentsCreate,
1188
+ "GET /deployments/{deploymentId}": deploymentsGetById,
1189
+ "DELETE /deployments/{deploymentId}": deploymentsDelete,
1190
+ "GET /deployments/{deploymentId}/logs": deploymentsFindLogs,
1191
+ "GET /deployments/{deploymentId}/errors": deploymentsFindErrors,
1192
+ "GET /hooks": hooksFind,
1193
+ "POST /hooks": hooksCreate,
1194
+ "GET /hooks/{hookId}": hooksGetById,
1195
+ "PATCH /hooks/{hookId}": hooksUpdate,
1196
+ "DELETE /hooks/{hookId}": hooksDelete,
1197
+ "GET /integrations/vercel/projects": integrationsVercelProjectsFind,
1198
+ "POST /integrations/vercel/projects": integrationsVercelProjectsCreate,
1199
+ "GET /projects": projectsFind,
1200
+ "POST /projects": projectsCreate,
1201
+ "GET /projects/{projectId}": projectsGetById,
1202
+ "PATCH /projects/{projectId}": projectsUpdate,
1203
+ "DELETE /projects/{projectId}": projectsDelete,
1204
+ "POST /projects/{projectId}/assign": projectsAssign,
1205
+ "GET /projects/{projectId}/env-vars": projectsFindEnvVars,
1206
+ "POST /projects/{projectId}/env-vars": projectsCreateEnvVars,
1207
+ "PATCH /projects/{projectId}/env-vars": projectsUpdateEnvVars,
1208
+ "POST /projects/{projectId}/env-vars/delete": projectsDeleteEnvVars,
1209
+ "GET /projects/{projectId}/env-vars/{environmentVariableId}": projectsGetEnvVar,
1210
+ "GET /rate-limits": rateLimitsFind,
1211
+ "GET /user": userGet,
1212
+ "GET /user/billing": userGetBilling,
1213
+ "GET /user/plan": userGetPlan,
1214
+ "GET /user/scopes": userGetScopes,
1215
+ "POST /chats/{chatId}/versions/{versionId}/restore": chatsRestore,
1216
+ "GET /reports/usage": reportsGetUsage,
1217
+ "GET /reports/usage/ai": reportsGetAIUsage,
1218
+ "GET /reports/user-activity": reportsGetUserActivity,
1219
+ "GET /mcp-servers": mcpServersFind,
1220
+ "POST /mcp-servers": mcpServersCreate,
1221
+ "GET /mcp-servers/{mcpServerId}": mcpServersGetById,
1222
+ "PATCH /mcp-servers/{mcpServerId}": mcpServersUpdate,
1223
+ "DELETE /mcp-servers/{mcpServerId}": mcpServersDelete,
1224
+ "POST /mcp-servers/{mcpServerId}/oauth/authorize": mcpServersCreateOAuthAuthorizationUrl
1225
+ };
1226
+ const operationsByTag = {
1227
+ chats: {
1228
+ chatsCreate,
1229
+ chatsFind,
1230
+ chatsInit,
1231
+ chatsDelete,
1232
+ chatsGetById,
1233
+ chatsUpdate,
1234
+ chatsFavorite,
1235
+ chatsFork,
1236
+ chatsFindMessages,
1237
+ chatsSendMessage,
1238
+ chatsGetMessage,
1239
+ chatsFindVersions,
1240
+ chatsGetVersion,
1241
+ chatsUpdateVersion,
1242
+ chatsDownloadVersion,
1243
+ chatsDeleteVersionFiles,
1244
+ chatsResume,
1245
+ chatsStop,
1246
+ chatsResolveTask,
1247
+ chatsRestore
1248
+ },
1249
+ projects: {
1250
+ projectsGetByChatId,
1251
+ projectsFind,
1252
+ projectsCreate,
1253
+ projectsGetById,
1254
+ projectsUpdate,
1255
+ projectsDelete,
1256
+ projectsAssign,
1257
+ projectsFindEnvVars,
1258
+ projectsCreateEnvVars,
1259
+ projectsUpdateEnvVars,
1260
+ projectsDeleteEnvVars,
1261
+ projectsGetEnvVar
1262
+ },
1263
+ deployments: {
1264
+ deploymentsFind,
1265
+ deploymentsCreate,
1266
+ deploymentsGetById,
1267
+ deploymentsDelete,
1268
+ deploymentsFindLogs,
1269
+ deploymentsFindErrors
1270
+ },
1271
+ hooks: {
1272
+ hooksFind,
1273
+ hooksCreate,
1274
+ hooksGetById,
1275
+ hooksUpdate,
1276
+ hooksDelete
1277
+ },
1278
+ integrations: {
1279
+ integrationsVercelProjectsFind,
1280
+ integrationsVercelProjectsCreate
1281
+ },
1282
+ ratelimits: {
1283
+ rateLimitsFind
1284
+ },
1285
+ user: {
1286
+ userGet,
1287
+ userGetBilling,
1288
+ userGetPlan,
1289
+ userGetScopes
1290
+ },
1291
+ reports: {
1292
+ reportsGetUsage,
1293
+ reportsGetAIUsage,
1294
+ reportsGetUserActivity
1295
+ },
1296
+ mcpservers: {
1297
+ mcpServersFind,
1298
+ mcpServersCreate,
1299
+ mcpServersGetById,
1300
+ mcpServersUpdate,
1301
+ mcpServersDelete,
1302
+ mcpServersCreateOAuthAuthorizationUrl
1303
+ }
1304
+ };
1305
+ const tagDictionary = {
1306
+ chats: {
1307
+ POST: [
1308
+ "chatsCreate",
1309
+ "chatsInit",
1310
+ "chatsFork",
1311
+ "chatsSendMessage",
1312
+ "chatsDeleteVersionFiles",
1313
+ "chatsResume",
1314
+ "chatsStop",
1315
+ "chatsResolveTask",
1316
+ "chatsRestore"
1317
+ ],
1318
+ GET: [
1319
+ "chatsFind",
1320
+ "chatsGetById",
1321
+ "chatsFindMessages",
1322
+ "chatsGetMessage",
1323
+ "chatsFindVersions",
1324
+ "chatsGetVersion",
1325
+ "chatsDownloadVersion"
1326
+ ],
1327
+ DELETE: [
1328
+ "chatsDelete"
1329
+ ],
1330
+ PATCH: [
1331
+ "chatsUpdate",
1332
+ "chatsUpdateVersion"
1333
+ ],
1334
+ PUT: [
1335
+ "chatsFavorite"
1336
+ ]
1337
+ },
1338
+ projects: {
1339
+ GET: [
1340
+ "projectsGetByChatId",
1341
+ "projectsFind",
1342
+ "projectsGetById",
1343
+ "projectsFindEnvVars",
1344
+ "projectsGetEnvVar"
1345
+ ],
1346
+ POST: [
1347
+ "projectsCreate",
1348
+ "projectsAssign",
1349
+ "projectsCreateEnvVars",
1350
+ "projectsDeleteEnvVars"
1351
+ ],
1352
+ PATCH: [
1353
+ "projectsUpdate",
1354
+ "projectsUpdateEnvVars"
1355
+ ],
1356
+ DELETE: [
1357
+ "projectsDelete"
1358
+ ]
1359
+ },
1360
+ deployments: {
1361
+ GET: [
1362
+ "deploymentsFind",
1363
+ "deploymentsGetById",
1364
+ "deploymentsFindLogs",
1365
+ "deploymentsFindErrors"
1366
+ ],
1367
+ POST: [
1368
+ "deploymentsCreate"
1369
+ ],
1370
+ DELETE: [
1371
+ "deploymentsDelete"
1372
+ ]
1373
+ },
1374
+ hooks: {
1375
+ GET: [
1376
+ "hooksFind",
1377
+ "hooksGetById"
1378
+ ],
1379
+ POST: [
1380
+ "hooksCreate"
1381
+ ],
1382
+ PATCH: [
1383
+ "hooksUpdate"
1384
+ ],
1385
+ DELETE: [
1386
+ "hooksDelete"
1387
+ ]
1388
+ },
1389
+ integrations: {
1390
+ GET: [
1391
+ "integrationsVercelProjectsFind"
1392
+ ],
1393
+ POST: [
1394
+ "integrationsVercelProjectsCreate"
1395
+ ]
1396
+ },
1397
+ ratelimits: {
1398
+ GET: [
1399
+ "rateLimitsFind"
1400
+ ]
1401
+ },
1402
+ user: {
1403
+ GET: [
1404
+ "userGet",
1405
+ "userGetBilling",
1406
+ "userGetPlan",
1407
+ "userGetScopes"
1408
+ ]
1409
+ },
1410
+ reports: {
1411
+ GET: [
1412
+ "reportsGetUsage",
1413
+ "reportsGetAIUsage",
1414
+ "reportsGetUserActivity"
1415
+ ]
1416
+ },
1417
+ mcpservers: {
1418
+ GET: [
1419
+ "mcpServersFind",
1420
+ "mcpServersGetById"
1421
+ ],
1422
+ POST: [
1423
+ "mcpServersCreate",
1424
+ "mcpServersCreateOAuthAuthorizationUrl"
1425
+ ],
1426
+ PATCH: [
1427
+ "mcpServersUpdate"
1428
+ ],
1429
+ DELETE: [
1430
+ "mcpServersDelete"
1431
+ ]
1432
+ }
1433
+ };
1434
+
1435
+ exports.chatsCreate = chatsCreate;
1436
+ exports.chatsDelete = chatsDelete;
1437
+ exports.chatsDeleteVersionFiles = chatsDeleteVersionFiles;
1438
+ exports.chatsDownloadVersion = chatsDownloadVersion;
1439
+ exports.chatsFavorite = chatsFavorite;
1440
+ exports.chatsFind = chatsFind;
1441
+ exports.chatsFindMessages = chatsFindMessages;
1442
+ exports.chatsFindVersions = chatsFindVersions;
1443
+ exports.chatsFork = chatsFork;
1444
+ exports.chatsGetById = chatsGetById;
1445
+ exports.chatsGetMessage = chatsGetMessage;
1446
+ exports.chatsGetVersion = chatsGetVersion;
1447
+ exports.chatsInit = chatsInit;
1448
+ exports.chatsResolveTask = chatsResolveTask;
1449
+ exports.chatsRestore = chatsRestore;
1450
+ exports.chatsResume = chatsResume;
1451
+ exports.chatsSendMessage = chatsSendMessage;
1452
+ exports.chatsStop = chatsStop;
1453
+ exports.chatsUpdate = chatsUpdate;
1454
+ exports.chatsUpdateVersion = chatsUpdateVersion;
1455
+ exports.client = client;
1456
+ exports.deploymentsCreate = deploymentsCreate;
1457
+ exports.deploymentsDelete = deploymentsDelete;
1458
+ exports.deploymentsFind = deploymentsFind;
1459
+ exports.deploymentsFindErrors = deploymentsFindErrors;
1460
+ exports.deploymentsFindLogs = deploymentsFindLogs;
1461
+ exports.deploymentsGetById = deploymentsGetById;
1462
+ exports.hooksCreate = hooksCreate;
1463
+ exports.hooksDelete = hooksDelete;
1464
+ exports.hooksFind = hooksFind;
1465
+ exports.hooksGetById = hooksGetById;
1466
+ exports.hooksUpdate = hooksUpdate;
1467
+ exports.integrationsVercelProjectsCreate = integrationsVercelProjectsCreate;
1468
+ exports.integrationsVercelProjectsFind = integrationsVercelProjectsFind;
1469
+ exports.mcpServersCreate = mcpServersCreate;
1470
+ exports.mcpServersCreateOAuthAuthorizationUrl = mcpServersCreateOAuthAuthorizationUrl;
1471
+ exports.mcpServersDelete = mcpServersDelete;
1472
+ exports.mcpServersFind = mcpServersFind;
1473
+ exports.mcpServersGetById = mcpServersGetById;
1474
+ exports.mcpServersUpdate = mcpServersUpdate;
1475
+ exports.operationsByPath = operationsByPath;
1476
+ exports.operationsByTag = operationsByTag;
1477
+ exports.projectsAssign = projectsAssign;
1478
+ exports.projectsCreate = projectsCreate;
1479
+ exports.projectsCreateEnvVars = projectsCreateEnvVars;
1480
+ exports.projectsDelete = projectsDelete;
1481
+ exports.projectsDeleteEnvVars = projectsDeleteEnvVars;
1482
+ exports.projectsFind = projectsFind;
1483
+ exports.projectsFindEnvVars = projectsFindEnvVars;
1484
+ exports.projectsGetByChatId = projectsGetByChatId;
1485
+ exports.projectsGetById = projectsGetById;
1486
+ exports.projectsGetEnvVar = projectsGetEnvVar;
1487
+ exports.projectsUpdate = projectsUpdate;
1488
+ exports.projectsUpdateEnvVars = projectsUpdateEnvVars;
1489
+ exports.rateLimitsFind = rateLimitsFind;
1490
+ exports.reportsGetAIUsage = reportsGetAIUsage;
1491
+ exports.reportsGetUsage = reportsGetUsage;
1492
+ exports.reportsGetUserActivity = reportsGetUserActivity;
1493
+ exports.tagDictionary = tagDictionary;
1494
+ exports.userGet = userGet;
1495
+ exports.userGetBilling = userGetBilling;
1496
+ exports.userGetPlan = userGetPlan;
1497
+ exports.userGetScopes = userGetScopes;