v0-api 0.0.4 → 0.1.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.
Files changed (44) hide show
  1. package/README.md +67 -2
  2. package/dist/components.cjs +1498 -0
  3. package/dist/components.d.cts +1011 -0
  4. package/dist/components.d.cts.map +1 -0
  5. package/dist/components.d.mts +1011 -0
  6. package/dist/components.d.mts.map +1 -0
  7. package/dist/components.mjs +1435 -0
  8. package/dist/effect.cjs +1334 -0
  9. package/dist/effect.d.cts +970 -0
  10. package/dist/effect.d.cts.map +1 -0
  11. package/dist/effect.d.mts +970 -0
  12. package/dist/effect.d.mts.map +1 -0
  13. package/dist/effect.mjs +1312 -0
  14. package/dist/index.cjs +5111 -527
  15. package/dist/index.d.cts +10754 -3779
  16. package/dist/index.d.cts.map +1 -0
  17. package/dist/index.d.mts +10754 -3779
  18. package/dist/index.d.mts.map +1 -0
  19. package/dist/index.d.ts +10754 -3779
  20. package/dist/index.d.ts.map +1 -0
  21. package/dist/index.mjs +4292 -524
  22. package/dist/schemas.cjs +3229 -0
  23. package/dist/schemas.d.cts +1856 -0
  24. package/dist/schemas.d.cts.map +1 -0
  25. package/dist/schemas.d.mts +1856 -0
  26. package/dist/schemas.d.mts.map +1 -0
  27. package/dist/schemas.mjs +2488 -0
  28. package/dist/types.cjs +420 -0
  29. package/dist/types.d.cts +8413 -0
  30. package/dist/types.d.cts.map +1 -0
  31. package/dist/types.d.mts +8413 -0
  32. package/dist/types.d.mts.map +1 -0
  33. package/dist/types.mjs +343 -0
  34. package/package.json +70 -26
  35. package/dist/mcp.cjs +0 -519
  36. package/dist/mcp.d.cts +0 -5
  37. package/dist/mcp.d.mts +0 -5
  38. package/dist/mcp.d.ts +0 -5
  39. package/dist/mcp.mjs +0 -517
  40. package/dist/shared/v0-api.B8nEbJhM.d.cts +0 -36
  41. package/dist/shared/v0-api.B8nEbJhM.d.mts +0 -36
  42. package/dist/shared/v0-api.B8nEbJhM.d.ts +0 -36
  43. package/dist/shared/v0-api.D3CFh7k4.cjs +0 -833
  44. package/dist/shared/v0-api.mzMaOyDB.mjs +0 -814
package/dist/mcp.mjs DELETED
@@ -1,517 +0,0 @@
1
- import { a as chatsFindQueryParamsSchema, b as chatsDeletePathParamsSchema, d as chatsGetByIdPathParamsSchema, e as chatsUpdatePathParamsSchema, f as chatsFavoritePathParamsSchema, g as chatsForkPathParamsSchema, p as projectsGetByChatIdPathParamsSchema, h as chatsSendMessagePathParamsSchema, i as chatsGetMetadataPathParamsSchema, j as chatsResumePathParamsSchema, k as deploymentsFindLogsQueryParamsSchema, l as deploymentsFindLogsPathParamsSchema, m as deploymentsFindErrorsPathParamsSchema, n as projectsAssignPathParamsSchema, r as rateLimitsFindQueryParamsSchema, u as userGetBillingQueryParamsSchema, c as client } from './shared/v0-api.mzMaOyDB.mjs';
2
- import 'zod';
3
-
4
- async function chatsCreate({
5
- config = {}
6
- }) {
7
- const { client: request = 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 { content: [{ type: "text", text: JSON.stringify(data) }] };
15
- }
16
- async function chatsFind({
17
- queryParams,
18
- config = {}
19
- }) {
20
- const { client: request = client, ...requestConfig } = config;
21
- const data = await request({ method: "GET", url: `/chats`, queryParams, ...requestConfig });
22
- return { content: [{ type: "text", text: JSON.stringify(data) }] };
23
- }
24
- async function chatsInitCreate({
25
- config = {}
26
- }) {
27
- const { client: request = 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 { content: [{ type: "text", text: JSON.stringify(data) }] };
35
- }
36
- async function chatsDelete({
37
- pathParams: { chatId },
38
- config = {}
39
- }) {
40
- const { client: request = 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 { content: [{ type: "text", text: JSON.stringify(data) }] };
46
- }
47
- async function chatsGetById({
48
- pathParams: { chatId },
49
- config = {}
50
- }) {
51
- const { client: request = 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 { content: [{ type: "text", text: JSON.stringify(data) }] };
57
- }
58
- async function chatsUpdate({
59
- pathParams: { chatId },
60
- config = {}
61
- }) {
62
- const { client: request = 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 { content: [{ type: "text", text: JSON.stringify(data) }] };
73
- }
74
- async function chatsFavorite({
75
- pathParams: { chatId },
76
- config = {}
77
- }) {
78
- const { client: request = 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 { content: [{ type: "text", text: JSON.stringify(data) }] };
89
- }
90
- async function chatsFork({
91
- pathParams: { chatId },
92
- config = {}
93
- }) {
94
- const { client: request = 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 { content: [{ type: "text", text: JSON.stringify(data) }] };
105
- }
106
- async function projectsGetByChatId({
107
- pathParams: { chatId },
108
- config = {}
109
- }) {
110
- const { client: request = 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 { content: [{ type: "text", text: JSON.stringify(data) }] };
116
- }
117
- async function chatsSendMessage({
118
- pathParams: { chatId },
119
- config = {}
120
- }) {
121
- const { client: request = 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 { content: [{ type: "text", text: JSON.stringify(data) }] };
132
- }
133
- async function chatsGetMetadata({
134
- pathParams: { chatId },
135
- config = {}
136
- }) {
137
- const { client: request = 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 { content: [{ type: "text", text: JSON.stringify(data) }] };
143
- }
144
- async function chatsResume({
145
- pathParams: { chatId, messageId },
146
- config = {}
147
- }) {
148
- const { client: request = 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 { content: [{ type: "text", text: JSON.stringify(data) }] };
157
- }
158
- async function deploymentsFindLogs({
159
- pathParams: { deploymentId },
160
- queryParams,
161
- config = {}
162
- }) {
163
- const { client: request = 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 { content: [{ type: "text", text: JSON.stringify(data) }] };
169
- }
170
- async function deploymentsFindErrors({
171
- pathParams: { deploymentId },
172
- config = {}
173
- }) {
174
- const { client: request = 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 { content: [{ type: "text", text: JSON.stringify(data) }] };
180
- }
181
- async function integrationsVercelProjectsFind({
182
- config = {}
183
- }) {
184
- const { client: request = client, ...requestConfig } = config;
185
- const data = await request({ method: "GET", url: `/integrations/vercel/projects`, ...requestConfig });
186
- return { content: [{ type: "text", text: JSON.stringify(data) }] };
187
- }
188
- async function integrationsVercelProjectsCreate({
189
- config = {}
190
- }) {
191
- const { client: request = 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 { content: [{ type: "text", text: JSON.stringify(data) }] };
199
- }
200
- async function projectsFind({
201
- config = {}
202
- }) {
203
- const { client: request = client, ...requestConfig } = config;
204
- const data = await request({ method: "GET", url: `/projects`, ...requestConfig });
205
- return { content: [{ type: "text", text: JSON.stringify(data) }] };
206
- }
207
- async function projectsCreate({
208
- config = {}
209
- }) {
210
- const { client: request = client, ...requestConfig } = config;
211
- const data = await request({
212
- method: "POST",
213
- url: `/projects`,
214
- ...requestConfig,
215
- headers: { "Content-Type": "applicationJson", ...requestConfig.headers }
216
- });
217
- return { content: [{ type: "text", text: JSON.stringify(data) }] };
218
- }
219
- async function projectsAssign({
220
- pathParams: { projectId },
221
- config = {}
222
- }) {
223
- const { client: request = client, ...requestConfig } = config;
224
- if (!projectId) {
225
- throw new Error(`Missing required path parameter: projectId`);
226
- }
227
- const data = await request({
228
- method: "POST",
229
- url: `/projects/${projectId}/assign`,
230
- ...requestConfig,
231
- headers: { "Content-Type": "applicationJson", ...requestConfig.headers }
232
- });
233
- return { content: [{ type: "text", text: JSON.stringify(data) }] };
234
- }
235
- async function rateLimitsFind({
236
- queryParams,
237
- config = {}
238
- }) {
239
- const { client: request = client, ...requestConfig } = config;
240
- const data = await request({ method: "GET", url: `/rate-limits`, queryParams, ...requestConfig });
241
- return { content: [{ type: "text", text: JSON.stringify(data) }] };
242
- }
243
- async function userGet({
244
- config = {}
245
- }) {
246
- const { client: request = client, ...requestConfig } = config;
247
- const data = await request({ method: "GET", url: `/user`, ...requestConfig });
248
- return { content: [{ type: "text", text: JSON.stringify(data) }] };
249
- }
250
- async function userGetBilling({
251
- queryParams,
252
- config = {}
253
- }) {
254
- const { client: request = client, ...requestConfig } = config;
255
- const data = await request({ method: "GET", url: `/user/billing`, queryParams, ...requestConfig });
256
- return { content: [{ type: "text", text: JSON.stringify(data) }] };
257
- }
258
- async function userGetPlan({
259
- config = {}
260
- }) {
261
- const { client: request = client, ...requestConfig } = config;
262
- const data = await request({ method: "GET", url: `/user/plan`, ...requestConfig });
263
- return { content: [{ type: "text", text: JSON.stringify(data) }] };
264
- }
265
- async function userGetScopes({
266
- config = {}
267
- }) {
268
- const { client: request = client, ...requestConfig } = config;
269
- const data = await request({ method: "GET", url: `/user/scopes`, ...requestConfig });
270
- return { content: [{ type: "text", text: JSON.stringify(data) }] };
271
- }
272
- function initMcpTools(serverLike, config) {
273
- const server = serverLike;
274
- server.tool("chatsCreate", "Create a new chat", async () => {
275
- try {
276
- return await chatsCreate({ config });
277
- } catch (error) {
278
- return { isError: true, content: [{ type: "text", text: JSON.stringify(error) }] };
279
- }
280
- });
281
- server.tool("chatsFind", "Find all chats", { queryParams: chatsFindQueryParamsSchema }, async ({ queryParams }) => {
282
- try {
283
- return await chatsFind({ queryParams, config });
284
- } catch (error) {
285
- return { isError: true, content: [{ type: "text", text: JSON.stringify(error) }] };
286
- }
287
- });
288
- server.tool("chatsInitCreate", "Initialize a new chat from files", async () => {
289
- try {
290
- return await chatsInitCreate({ config });
291
- } catch (error) {
292
- return { isError: true, content: [{ type: "text", text: JSON.stringify(error) }] };
293
- }
294
- });
295
- server.tool(
296
- "chatsDelete",
297
- "Delete a chat",
298
- { chatId: chatsDeletePathParamsSchema.shape.chatId },
299
- async ({ chatId }) => {
300
- try {
301
- return await chatsDelete({ pathParams: { chatId }, config });
302
- } catch (error) {
303
- return { isError: true, content: [{ type: "text", text: JSON.stringify(error) }] };
304
- }
305
- }
306
- );
307
- server.tool(
308
- "chatsGetById",
309
- "Get a chat",
310
- { chatId: chatsGetByIdPathParamsSchema.shape.chatId },
311
- async ({ chatId }) => {
312
- try {
313
- return await chatsGetById({ pathParams: { chatId }, config });
314
- } catch (error) {
315
- return { isError: true, content: [{ type: "text", text: JSON.stringify(error) }] };
316
- }
317
- }
318
- );
319
- server.tool(
320
- "chatsUpdate",
321
- "Update a chat",
322
- { chatId: chatsUpdatePathParamsSchema.shape.chatId },
323
- async ({ chatId }) => {
324
- try {
325
- return await chatsUpdate({ pathParams: { chatId }, config });
326
- } catch (error) {
327
- return { isError: true, content: [{ type: "text", text: JSON.stringify(error) }] };
328
- }
329
- }
330
- );
331
- server.tool(
332
- "chatsFavorite",
333
- "Favorite a chat",
334
- { chatId: chatsFavoritePathParamsSchema.shape.chatId },
335
- async ({ chatId }) => {
336
- try {
337
- return await chatsFavorite({ pathParams: { chatId }, config });
338
- } catch (error) {
339
- return { isError: true, content: [{ type: "text", text: JSON.stringify(error) }] };
340
- }
341
- }
342
- );
343
- server.tool(
344
- "chatsFork",
345
- "Fork a version in a chat",
346
- { chatId: chatsForkPathParamsSchema.shape.chatId },
347
- async ({ chatId }) => {
348
- try {
349
- return await chatsFork({ pathParams: { chatId }, config });
350
- } catch (error) {
351
- return { isError: true, content: [{ type: "text", text: JSON.stringify(error) }] };
352
- }
353
- }
354
- );
355
- server.tool(
356
- "projectsGetByChatId",
357
- "Get the project for a chat",
358
- { chatId: projectsGetByChatIdPathParamsSchema.shape.chatId },
359
- async ({ chatId }) => {
360
- try {
361
- return await projectsGetByChatId({ pathParams: { chatId }, config });
362
- } catch (error) {
363
- return { isError: true, content: [{ type: "text", text: JSON.stringify(error) }] };
364
- }
365
- }
366
- );
367
- server.tool(
368
- "chatsSendMessage",
369
- "Create a new message in a chat",
370
- { chatId: chatsSendMessagePathParamsSchema.shape.chatId },
371
- async ({ chatId }) => {
372
- try {
373
- return await chatsSendMessage({ pathParams: { chatId }, config });
374
- } catch (error) {
375
- return { isError: true, content: [{ type: "text", text: JSON.stringify(error) }] };
376
- }
377
- }
378
- );
379
- server.tool(
380
- "chatsGetMetadata",
381
- "Get the metadata for a chat",
382
- { chatId: chatsGetMetadataPathParamsSchema.shape.chatId },
383
- async ({ chatId }) => {
384
- try {
385
- return await chatsGetMetadata({ pathParams: { chatId }, config });
386
- } catch (error) {
387
- return { isError: true, content: [{ type: "text", text: JSON.stringify(error) }] };
388
- }
389
- }
390
- );
391
- server.tool(
392
- "chatsResume",
393
- "Resume a chat message",
394
- { chatId: chatsResumePathParamsSchema.shape.chatId, messageId: chatsResumePathParamsSchema.shape.messageId },
395
- async ({ chatId, messageId }) => {
396
- try {
397
- return await chatsResume({ pathParams: { chatId, messageId }, config });
398
- } catch (error) {
399
- return { isError: true, content: [{ type: "text", text: JSON.stringify(error) }] };
400
- }
401
- }
402
- );
403
- server.tool(
404
- "deploymentsFindLogs",
405
- "Find logs for a deployment",
406
- {
407
- deploymentId: deploymentsFindLogsPathParamsSchema.shape.deploymentId,
408
- queryParams: deploymentsFindLogsQueryParamsSchema
409
- },
410
- async ({ deploymentId, queryParams }) => {
411
- try {
412
- return await deploymentsFindLogs({ pathParams: { deploymentId }, queryParams, config });
413
- } catch (error) {
414
- return { isError: true, content: [{ type: "text", text: JSON.stringify(error) }] };
415
- }
416
- }
417
- );
418
- server.tool(
419
- "deploymentsFindErrors",
420
- "Find errors for a deployment",
421
- { deploymentId: deploymentsFindErrorsPathParamsSchema.shape.deploymentId },
422
- async ({ deploymentId }) => {
423
- try {
424
- return await deploymentsFindErrors({ pathParams: { deploymentId }, config });
425
- } catch (error) {
426
- return { isError: true, content: [{ type: "text", text: JSON.stringify(error) }] };
427
- }
428
- }
429
- );
430
- server.tool("integrationsVercelProjectsFind", "Find all Vercel projects", async () => {
431
- try {
432
- return await integrationsVercelProjectsFind({ config });
433
- } catch (error) {
434
- return { isError: true, content: [{ type: "text", text: JSON.stringify(error) }] };
435
- }
436
- });
437
- server.tool("integrationsVercelProjectsCreate", "Create a new Vercel project", async () => {
438
- try {
439
- return await integrationsVercelProjectsCreate({ config });
440
- } catch (error) {
441
- return { isError: true, content: [{ type: "text", text: JSON.stringify(error) }] };
442
- }
443
- });
444
- server.tool("projectsFind", "Find all projects", async () => {
445
- try {
446
- return await projectsFind({ config });
447
- } catch (error) {
448
- return { isError: true, content: [{ type: "text", text: JSON.stringify(error) }] };
449
- }
450
- });
451
- server.tool("projectsCreate", "Create a new project", async () => {
452
- try {
453
- return await projectsCreate({ config });
454
- } catch (error) {
455
- return { isError: true, content: [{ type: "text", text: JSON.stringify(error) }] };
456
- }
457
- });
458
- server.tool(
459
- "projectsAssign",
460
- "Assign a project to a chat",
461
- { projectId: projectsAssignPathParamsSchema.shape.projectId },
462
- async ({ projectId }) => {
463
- try {
464
- return await projectsAssign({ pathParams: { projectId }, config });
465
- } catch (error) {
466
- return { isError: true, content: [{ type: "text", text: JSON.stringify(error) }] };
467
- }
468
- }
469
- );
470
- server.tool(
471
- "rateLimitsFind",
472
- "Find the rate limit for a scope",
473
- { queryParams: rateLimitsFindQueryParamsSchema },
474
- async ({ queryParams }) => {
475
- try {
476
- return await rateLimitsFind({ queryParams, config });
477
- } catch (error) {
478
- return { isError: true, content: [{ type: "text", text: JSON.stringify(error) }] };
479
- }
480
- }
481
- );
482
- server.tool("userGet", "Get the user", async () => {
483
- try {
484
- return await userGet({ config });
485
- } catch (error) {
486
- return { isError: true, content: [{ type: "text", text: JSON.stringify(error) }] };
487
- }
488
- });
489
- server.tool(
490
- "userGetBilling",
491
- "Get the billing for the user",
492
- { queryParams: userGetBillingQueryParamsSchema },
493
- async ({ queryParams }) => {
494
- try {
495
- return await userGetBilling({ queryParams, config });
496
- } catch (error) {
497
- return { isError: true, content: [{ type: "text", text: JSON.stringify(error) }] };
498
- }
499
- }
500
- );
501
- server.tool("userGetPlan", "Get the plan for the user", async () => {
502
- try {
503
- return await userGetPlan({ config });
504
- } catch (error) {
505
- return { isError: true, content: [{ type: "text", text: JSON.stringify(error) }] };
506
- }
507
- });
508
- server.tool("userGetScopes", "Get all scopes for the user", async () => {
509
- try {
510
- return await userGetScopes({ config });
511
- } catch (error) {
512
- return { isError: true, content: [{ type: "text", text: JSON.stringify(error) }] };
513
- }
514
- });
515
- }
516
-
517
- export { initMcpTools };
@@ -1,36 +0,0 @@
1
- type RequestInit = {
2
- body?: string | FormData | undefined;
3
- headers?: Record<string, string> | undefined;
4
- method?: string | undefined;
5
- signal?: any | undefined;
6
- };
7
- type Response = {
8
- ok: boolean;
9
- status: number;
10
- url: string;
11
- json(): Promise<any>;
12
- text(): Promise<string>;
13
- headers?: {
14
- get(name: string): string | null;
15
- } | undefined;
16
- };
17
- type FetchImpl = (url: string, init?: RequestInit) => Promise<Response>;
18
-
19
- type FetcherConfig = {
20
- baseUrl?: string;
21
- token?: string | null;
22
- fetchImpl?: FetchImpl;
23
- headers?: Record<string, any>;
24
- };
25
- type FetcherOptions<TBody, THeaders, TQueryParams, TPathParams> = {
26
- url: string;
27
- method: string;
28
- body?: TBody | undefined;
29
- headers?: THeaders | undefined;
30
- queryParams?: TQueryParams | undefined;
31
- pathParams?: TPathParams | undefined;
32
- signal?: AbortSignal | undefined;
33
- } & FetcherConfig;
34
- declare function client<TData, TError, TBody, THeaders, TQueryParams, TPathParams>({ url, method, body, headers, queryParams, signal, token, baseUrl, fetchImpl }: FetcherOptions<TBody, THeaders, TQueryParams, TPathParams>): Promise<TData>;
35
-
36
- export { type FetcherConfig as F, type FetchImpl as a, client as c };
@@ -1,36 +0,0 @@
1
- type RequestInit = {
2
- body?: string | FormData | undefined;
3
- headers?: Record<string, string> | undefined;
4
- method?: string | undefined;
5
- signal?: any | undefined;
6
- };
7
- type Response = {
8
- ok: boolean;
9
- status: number;
10
- url: string;
11
- json(): Promise<any>;
12
- text(): Promise<string>;
13
- headers?: {
14
- get(name: string): string | null;
15
- } | undefined;
16
- };
17
- type FetchImpl = (url: string, init?: RequestInit) => Promise<Response>;
18
-
19
- type FetcherConfig = {
20
- baseUrl?: string;
21
- token?: string | null;
22
- fetchImpl?: FetchImpl;
23
- headers?: Record<string, any>;
24
- };
25
- type FetcherOptions<TBody, THeaders, TQueryParams, TPathParams> = {
26
- url: string;
27
- method: string;
28
- body?: TBody | undefined;
29
- headers?: THeaders | undefined;
30
- queryParams?: TQueryParams | undefined;
31
- pathParams?: TPathParams | undefined;
32
- signal?: AbortSignal | undefined;
33
- } & FetcherConfig;
34
- declare function client<TData, TError, TBody, THeaders, TQueryParams, TPathParams>({ url, method, body, headers, queryParams, signal, token, baseUrl, fetchImpl }: FetcherOptions<TBody, THeaders, TQueryParams, TPathParams>): Promise<TData>;
35
-
36
- export { type FetcherConfig as F, type FetchImpl as a, client as c };
@@ -1,36 +0,0 @@
1
- type RequestInit = {
2
- body?: string | FormData | undefined;
3
- headers?: Record<string, string> | undefined;
4
- method?: string | undefined;
5
- signal?: any | undefined;
6
- };
7
- type Response = {
8
- ok: boolean;
9
- status: number;
10
- url: string;
11
- json(): Promise<any>;
12
- text(): Promise<string>;
13
- headers?: {
14
- get(name: string): string | null;
15
- } | undefined;
16
- };
17
- type FetchImpl = (url: string, init?: RequestInit) => Promise<Response>;
18
-
19
- type FetcherConfig = {
20
- baseUrl?: string;
21
- token?: string | null;
22
- fetchImpl?: FetchImpl;
23
- headers?: Record<string, any>;
24
- };
25
- type FetcherOptions<TBody, THeaders, TQueryParams, TPathParams> = {
26
- url: string;
27
- method: string;
28
- body?: TBody | undefined;
29
- headers?: THeaders | undefined;
30
- queryParams?: TQueryParams | undefined;
31
- pathParams?: TPathParams | undefined;
32
- signal?: AbortSignal | undefined;
33
- } & FetcherConfig;
34
- declare function client<TData, TError, TBody, THeaders, TQueryParams, TPathParams>({ url, method, body, headers, queryParams, signal, token, baseUrl, fetchImpl }: FetcherOptions<TBody, THeaders, TQueryParams, TPathParams>): Promise<TData>;
35
-
36
- export { type FetcherConfig as F, type FetchImpl as a, client as c };