vovk-hello-world 0.0.46 → 0.0.49
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 +23 -11
- package/index.cjs +384 -407
- package/index.d.cts +239 -44
- package/index.d.mts +239 -44
- package/index.mjs +382 -406
- package/package.json +2 -59
- package/openapi.cjs +0 -264
- package/openapi.d.cts +0 -2
- package/schema.cjs +0 -199
- package/schema.d.cts +0 -190
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
<!--
|
|
1
|
+
<!-- Generated by vovk-cli v0.0.1-draft.390 at 2025-11-02T07:26:33.646Z -->
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
# vovk-hello-world v0.0.
|
|
4
|
+
# vovk-hello-world v0.0.49 [](https://www.typescriptlang.org/) [](https://vovk.dev)
|
|
5
5
|
|
|
6
6
|
> A showcase for Next.js + Vovk.ts + Zod, demonstrating its capabilities with TypeScript, Rust, and Python RPC.
|
|
7
7
|
|
|
@@ -17,18 +17,21 @@ npm install vovk-hello-world
|
|
|
17
17
|
## UserRPC
|
|
18
18
|
|
|
19
19
|
### UserRPC.updateUser
|
|
20
|
+
> Update user
|
|
20
21
|
|
|
22
|
+
Update user by ID
|
|
21
23
|
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
`POST http://localhost:3000/api/users/{id}`
|
|
25
|
+
`POST https://hello-world.vovk.dev/api/users/{id}`
|
|
26
26
|
|
|
27
27
|
```ts
|
|
28
28
|
import { UserRPC } from 'vovk-hello-world';
|
|
29
29
|
|
|
30
30
|
const response = await UserRPC.updateUser({
|
|
31
31
|
body: {
|
|
32
|
+
// -----
|
|
33
|
+
// User data object
|
|
34
|
+
// -----
|
|
32
35
|
// User email
|
|
33
36
|
email: "john@example.com",
|
|
34
37
|
// User profile object
|
|
@@ -40,10 +43,16 @@ const response = await UserRPC.updateUser({
|
|
|
40
43
|
}
|
|
41
44
|
},
|
|
42
45
|
query: {
|
|
46
|
+
// -----
|
|
47
|
+
// Query parameters
|
|
48
|
+
// -----
|
|
43
49
|
// Notification type
|
|
44
50
|
notify: "email"
|
|
45
51
|
},
|
|
46
52
|
params: {
|
|
53
|
+
// -----
|
|
54
|
+
// Path parameters
|
|
55
|
+
// -----
|
|
47
56
|
// User ID
|
|
48
57
|
id: "123e4567-e89b-12d3-a456-426614174000"
|
|
49
58
|
},
|
|
@@ -66,12 +75,12 @@ console.log(response);
|
|
|
66
75
|
## StreamRPC
|
|
67
76
|
|
|
68
77
|
### StreamRPC.streamTokens
|
|
78
|
+
> Stream tokens
|
|
69
79
|
|
|
80
|
+
Stream tokens to the client
|
|
70
81
|
|
|
71
82
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
`GET http://localhost:3000/api/streams/tokens`
|
|
83
|
+
`GET https://hello-world.vovk.dev/api/streams/tokens`
|
|
75
84
|
|
|
76
85
|
```ts
|
|
77
86
|
import { StreamRPC } from 'vovk-hello-world';
|
|
@@ -82,6 +91,9 @@ for await (const item of response) {
|
|
|
82
91
|
console.log(item);
|
|
83
92
|
/*
|
|
84
93
|
{
|
|
94
|
+
// -----
|
|
95
|
+
// Streamed token object
|
|
96
|
+
// -----
|
|
85
97
|
// Message from the token
|
|
86
98
|
message: "string"
|
|
87
99
|
}
|
|
@@ -95,12 +107,12 @@ for await (const item of response) {
|
|
|
95
107
|
## OpenApiRPC
|
|
96
108
|
|
|
97
109
|
### OpenApiRPC.getSpec
|
|
110
|
+
> OpenAPI spec
|
|
98
111
|
|
|
112
|
+
Get the OpenAPI spec for the "Hello World" app API
|
|
99
113
|
|
|
100
114
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
`GET http://localhost:3000/api/static/openapi/spec.json`
|
|
115
|
+
`GET https://hello-world.vovk.dev/api/static/openapi.json`
|
|
104
116
|
|
|
105
117
|
```ts
|
|
106
118
|
import { OpenApiRPC } from 'vovk-hello-world';
|