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.
- package/README.md +67 -2
- package/dist/components.cjs +1498 -0
- package/dist/components.d.cts +1011 -0
- package/dist/components.d.cts.map +1 -0
- package/dist/components.d.mts +1011 -0
- package/dist/components.d.mts.map +1 -0
- package/dist/components.mjs +1435 -0
- package/dist/effect.cjs +1334 -0
- package/dist/effect.d.cts +970 -0
- package/dist/effect.d.cts.map +1 -0
- package/dist/effect.d.mts +970 -0
- package/dist/effect.d.mts.map +1 -0
- package/dist/effect.mjs +1312 -0
- package/dist/index.cjs +5111 -527
- package/dist/index.d.cts +10754 -3779
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +10754 -3779
- package/dist/index.d.mts.map +1 -0
- package/dist/index.d.ts +10754 -3779
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +4292 -524
- package/dist/schemas.cjs +3229 -0
- package/dist/schemas.d.cts +1856 -0
- package/dist/schemas.d.cts.map +1 -0
- package/dist/schemas.d.mts +1856 -0
- package/dist/schemas.d.mts.map +1 -0
- package/dist/schemas.mjs +2488 -0
- package/dist/types.cjs +420 -0
- package/dist/types.d.cts +8413 -0
- package/dist/types.d.cts.map +1 -0
- package/dist/types.d.mts +8413 -0
- package/dist/types.d.mts.map +1 -0
- package/dist/types.mjs +343 -0
- package/package.json +70 -26
- package/dist/mcp.cjs +0 -519
- package/dist/mcp.d.cts +0 -5
- package/dist/mcp.d.mts +0 -5
- package/dist/mcp.d.ts +0 -5
- package/dist/mcp.mjs +0 -517
- package/dist/shared/v0-api.B8nEbJhM.d.cts +0 -36
- package/dist/shared/v0-api.B8nEbJhM.d.mts +0 -36
- package/dist/shared/v0-api.B8nEbJhM.d.ts +0 -36
- package/dist/shared/v0-api.D3CFh7k4.cjs +0 -833
- package/dist/shared/v0-api.mzMaOyDB.mjs +0 -814
package/README.md
CHANGED
|
@@ -1,3 +1,68 @@
|
|
|
1
|
-
# v0
|
|
1
|
+
# v0-api
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Auto-generated, fully typed client for the [Vercel v0 API](https://v0.dev/docs/api).
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Fully typed** - every operation, parameter and response is generated from the official OpenAPI spec
|
|
8
|
+
- **Tree-shakable** - only the operations you import end up in your bundle
|
|
9
|
+
- **Runtime agnostic** - uses the global `fetch`, or bring your own implementation
|
|
10
|
+
- **Effect support** - optional [Effect](https://effect.website) bindings via `v0-api/effect`
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install v0-api
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Quick Start
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import { V0Api } from "v0-api";
|
|
22
|
+
|
|
23
|
+
const client = new V0Api({ token: process.env.V0_API_KEY ?? null });
|
|
24
|
+
|
|
25
|
+
const chats = await client.api.chats.chatsFind();
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Operations are grouped by tag: `client.api.<tag>.<operation>(params)`.
|
|
29
|
+
|
|
30
|
+
### Custom fetch
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
const client = new V0Api({
|
|
34
|
+
token: process.env.V0_API_KEY ?? null,
|
|
35
|
+
fetch: myFetchImplementation,
|
|
36
|
+
});
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Effect
|
|
40
|
+
|
|
41
|
+
The `effect` entrypoint exposes every operation as an `Effect`. It requires `effect` as a peer dependency.
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
import { Effect } from "effect";
|
|
45
|
+
import { ApiService, makeApiLayer } from "v0-api/effect";
|
|
46
|
+
|
|
47
|
+
const program = ApiService.chats.chatsFind({});
|
|
48
|
+
|
|
49
|
+
await Effect.runPromise(
|
|
50
|
+
program.pipe(Effect.provide(makeApiLayer({ token: process.env.V0_API_KEY })))
|
|
51
|
+
);
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Errors are typed as `ApiError`, `NetworkError` and `ValidationError`.
|
|
55
|
+
|
|
56
|
+
## Entrypoints
|
|
57
|
+
|
|
58
|
+
| Import | Contents |
|
|
59
|
+
| --- | --- |
|
|
60
|
+
| `v0-api` | client class, operations, schemas and types |
|
|
61
|
+
| `v0-api/components` | operations grouped by tag and by path |
|
|
62
|
+
| `v0-api/schemas` | Zod schemas for every operation |
|
|
63
|
+
| `v0-api/types` | TypeScript types for every operation |
|
|
64
|
+
| `v0-api/effect` | Effect bindings |
|
|
65
|
+
|
|
66
|
+
## License
|
|
67
|
+
|
|
68
|
+
ISC
|