vovk-hello-world 0.0.52 → 0.0.54
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 +7 -3
- package/index.cjs +55 -13
- package/index.d.cts +38 -0
- package/index.d.mts +38 -0
- package/index.mjs +55 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
<!-- Generated by vovk-cli v0.0.1-draft.392 at 2025-11-03T12:
|
|
1
|
+
<!-- Generated by vovk-cli v0.0.1-draft.392 at 2025-11-03T12:17:00.849Z -->
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
# vovk-hello-world v0.0.
|
|
4
|
+
# vovk-hello-world v0.0.54 [](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
|
|
|
@@ -65,7 +65,11 @@ console.log(response);
|
|
|
65
65
|
// Response object
|
|
66
66
|
// -----
|
|
67
67
|
// Success status
|
|
68
|
-
success: true
|
|
68
|
+
success: true,
|
|
69
|
+
// User ID
|
|
70
|
+
id: "00000000-0000-0000-0000-000000000000",
|
|
71
|
+
// Notification type
|
|
72
|
+
notify: "email"
|
|
69
73
|
}
|
|
70
74
|
*/
|
|
71
75
|
```
|
package/index.cjs
CHANGED
|
@@ -107,11 +107,32 @@ var root_default = {
|
|
|
107
107
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
108
108
|
"description": "Response object",
|
|
109
109
|
"type": "object",
|
|
110
|
-
"properties": {
|
|
111
|
-
"
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
110
|
+
"properties": {
|
|
111
|
+
"success": {
|
|
112
|
+
"description": "Success status",
|
|
113
|
+
"type": "boolean"
|
|
114
|
+
},
|
|
115
|
+
"id": {
|
|
116
|
+
"description": "User ID",
|
|
117
|
+
"type": "string",
|
|
118
|
+
"format": "uuid",
|
|
119
|
+
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
|
|
120
|
+
},
|
|
121
|
+
"notify": {
|
|
122
|
+
"description": "Notification type",
|
|
123
|
+
"type": "string",
|
|
124
|
+
"enum": [
|
|
125
|
+
"email",
|
|
126
|
+
"push",
|
|
127
|
+
"none"
|
|
128
|
+
]
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
"required": [
|
|
132
|
+
"success",
|
|
133
|
+
"id",
|
|
134
|
+
"notify"
|
|
135
|
+
],
|
|
115
136
|
"additionalProperties": false
|
|
116
137
|
}
|
|
117
138
|
},
|
|
@@ -294,17 +315,17 @@ var openapi_default = {
|
|
|
294
315
|
{
|
|
295
316
|
"label": "TypeScript RPC",
|
|
296
317
|
"lang": "typescript",
|
|
297
|
-
"source": "import { UserRPC } from 'vovk-hello-world';\n\nconst response = await UserRPC.updateUser({\n body: {\n // -----\n // User data object\n // -----\n // User email\n email: \"john@example.com\",\n // User profile object\n profile: {\n // User full name\n name: \"John Doe\",\n // User age\n age: 25\n }\n },\n query: {\n // -----\n // Query parameters\n // -----\n // Notification type\n notify: \"email\"\n },\n params: {\n // -----\n // Path parameters\n // -----\n // User ID\n id: \"123e4567-e89b-12d3-a456-426614174000\"\n },\n});\n\nconsole.log(response); \n/* \n{\n // -----\n // Response object\n // -----\n // Success status\n success: true\n}\n*/"
|
|
318
|
+
"source": "import { UserRPC } from 'vovk-hello-world';\n\nconst response = await UserRPC.updateUser({\n body: {\n // -----\n // User data object\n // -----\n // User email\n email: \"john@example.com\",\n // User profile object\n profile: {\n // User full name\n name: \"John Doe\",\n // User age\n age: 25\n }\n },\n query: {\n // -----\n // Query parameters\n // -----\n // Notification type\n notify: \"email\"\n },\n params: {\n // -----\n // Path parameters\n // -----\n // User ID\n id: \"123e4567-e89b-12d3-a456-426614174000\"\n },\n});\n\nconsole.log(response); \n/* \n{\n // -----\n // Response object\n // -----\n // Success status\n success: true,\n // User ID\n id: \"00000000-0000-0000-0000-000000000000\",\n // Notification type\n notify: \"email\"\n}\n*/"
|
|
298
319
|
},
|
|
299
320
|
{
|
|
300
321
|
"label": "Python RPC",
|
|
301
322
|
"lang": "python",
|
|
302
|
-
"source": "from vovk_hello_world import UserRPC\n\nresponse = UserRPC.update_user(\n body={\n # -----\n # User data object\n # -----\n # User email\n \"email\": \"john@example.com\",\n # User profile object\n \"profile\": {\n # User full name\n \"name\": \"John Doe\",\n # User age\n \"age\": 25\n }\n },\n query={\n # -----\n # Query parameters\n # -----\n # Notification type\n \"notify\": \"email\"\n },\n params={\n # -----\n # Path parameters\n # -----\n # User ID\n \"id\": \"123e4567-e89b-12d3-a456-426614174000\"\n },\n)\n\nprint(response)\n{\n # -----\n # Response object\n # -----\n # Success status\n \"success\": true\n}"
|
|
323
|
+
"source": "from vovk_hello_world import UserRPC\n\nresponse = UserRPC.update_user(\n body={\n # -----\n # User data object\n # -----\n # User email\n \"email\": \"john@example.com\",\n # User profile object\n \"profile\": {\n # User full name\n \"name\": \"John Doe\",\n # User age\n \"age\": 25\n }\n },\n query={\n # -----\n # Query parameters\n # -----\n # Notification type\n \"notify\": \"email\"\n },\n params={\n # -----\n # Path parameters\n # -----\n # User ID\n \"id\": \"123e4567-e89b-12d3-a456-426614174000\"\n },\n)\n\nprint(response)\n{\n # -----\n # Response object\n # -----\n # Success status\n \"success\": true,\n # User ID\n \"id\": \"00000000-0000-0000-0000-000000000000\",\n # Notification type\n \"notify\": \"email\"\n}"
|
|
303
324
|
},
|
|
304
325
|
{
|
|
305
326
|
"label": "Rust RPC",
|
|
306
327
|
"lang": "rust",
|
|
307
|
-
"source": "use vovk_hello_world::user_rpc;\nuse serde_json::{ \n from_value, \n json \n};\n\npub fn main() {\n let response = user_rpc::update_user(\n from_value(json!({\n // -----\n // User data object\n // -----\n // User email\n \"email\": \"john@example.com\",\n // User profile object\n \"profile\": {\n // User full name\n \"name\": \"John Doe\",\n // User age\n \"age\": 25\n }\n })).unwrap(), /* body */ \n from_value(json!({\n // -----\n // Query parameters\n // -----\n // Notification type\n \"notify\": \"email\"\n })).unwrap(), /* query */ \n from_value(json!({\n // -----\n // Path parameters\n // -----\n // User ID\n \"id\": \"123e4567-e89b-12d3-a456-426614174000\"\n })).unwrap(), /* params */ \n None, /* headers (HashMap) */ \n None, /* api_root */\n false, /* disable_client_validation */\n );\n\nmatch response {\n Ok(output) => println!(\"{:?}\", output),\n /* \n output {\n // -----\n // Response object\n // -----\n // Success status\n success: true\n } \n */\n Err(e) => println!(\"error: {:?}\", e),\n }\n}"
|
|
328
|
+
"source": "use vovk_hello_world::user_rpc;\nuse serde_json::{ \n from_value, \n json \n};\n\npub fn main() {\n let response = user_rpc::update_user(\n from_value(json!({\n // -----\n // User data object\n // -----\n // User email\n \"email\": \"john@example.com\",\n // User profile object\n \"profile\": {\n // User full name\n \"name\": \"John Doe\",\n // User age\n \"age\": 25\n }\n })).unwrap(), /* body */ \n from_value(json!({\n // -----\n // Query parameters\n // -----\n // Notification type\n \"notify\": \"email\"\n })).unwrap(), /* query */ \n from_value(json!({\n // -----\n // Path parameters\n // -----\n // User ID\n \"id\": \"123e4567-e89b-12d3-a456-426614174000\"\n })).unwrap(), /* params */ \n None, /* headers (HashMap) */ \n None, /* api_root */\n false, /* disable_client_validation */\n );\n\nmatch response {\n Ok(output) => println!(\"{:?}\", output),\n /* \n output {\n // -----\n // Response object\n // -----\n // Success status\n success: true,\n // User ID\n id: \"00000000-0000-0000-0000-000000000000\",\n // Notification type\n notify: \"email\"\n } \n */\n Err(e) => println!(\"error: {:?}\", e),\n }\n}"
|
|
308
329
|
}
|
|
309
330
|
],
|
|
310
331
|
"parameters": [{
|
|
@@ -338,11 +359,32 @@ var openapi_default = {
|
|
|
338
359
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
339
360
|
"description": "Response object",
|
|
340
361
|
"type": "object",
|
|
341
|
-
"properties": {
|
|
342
|
-
"
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
362
|
+
"properties": {
|
|
363
|
+
"success": {
|
|
364
|
+
"description": "Success status",
|
|
365
|
+
"type": "boolean"
|
|
366
|
+
},
|
|
367
|
+
"id": {
|
|
368
|
+
"description": "User ID",
|
|
369
|
+
"type": "string",
|
|
370
|
+
"format": "uuid",
|
|
371
|
+
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
|
|
372
|
+
},
|
|
373
|
+
"notify": {
|
|
374
|
+
"description": "Notification type",
|
|
375
|
+
"type": "string",
|
|
376
|
+
"enum": [
|
|
377
|
+
"email",
|
|
378
|
+
"push",
|
|
379
|
+
"none"
|
|
380
|
+
]
|
|
381
|
+
}
|
|
382
|
+
},
|
|
383
|
+
"required": [
|
|
384
|
+
"success",
|
|
385
|
+
"id",
|
|
386
|
+
"notify"
|
|
387
|
+
],
|
|
346
388
|
"additionalProperties": false
|
|
347
389
|
} } }
|
|
348
390
|
} },
|
package/index.d.cts
CHANGED
|
@@ -97,6 +97,17 @@ declare const schema: {
|
|
|
97
97
|
description: string;
|
|
98
98
|
type: string;
|
|
99
99
|
};
|
|
100
|
+
id: {
|
|
101
|
+
description: string;
|
|
102
|
+
type: string;
|
|
103
|
+
format: string;
|
|
104
|
+
pattern: string;
|
|
105
|
+
};
|
|
106
|
+
notify: {
|
|
107
|
+
description: string;
|
|
108
|
+
type: string;
|
|
109
|
+
enum: string[];
|
|
110
|
+
};
|
|
100
111
|
};
|
|
101
112
|
required: string[];
|
|
102
113
|
additionalProperties: boolean;
|
|
@@ -278,6 +289,17 @@ declare let paths: {
|
|
|
278
289
|
description: string;
|
|
279
290
|
type: string;
|
|
280
291
|
};
|
|
292
|
+
id: {
|
|
293
|
+
description: string;
|
|
294
|
+
type: string;
|
|
295
|
+
format: string;
|
|
296
|
+
pattern: string;
|
|
297
|
+
};
|
|
298
|
+
notify: {
|
|
299
|
+
description: string;
|
|
300
|
+
type: string;
|
|
301
|
+
enum: string[];
|
|
302
|
+
};
|
|
281
303
|
};
|
|
282
304
|
required: string[];
|
|
283
305
|
additionalProperties: boolean;
|
|
@@ -399,6 +421,8 @@ declare const UserRPC: {
|
|
|
399
421
|
}: {
|
|
400
422
|
id: string;
|
|
401
423
|
}) => Promise<{
|
|
424
|
+
id: string;
|
|
425
|
+
notify: "email" | "push" | "none";
|
|
402
426
|
success: true;
|
|
403
427
|
}>) & {
|
|
404
428
|
__types: {
|
|
@@ -417,6 +441,8 @@ declare const UserRPC: {
|
|
|
417
441
|
};
|
|
418
442
|
output: {
|
|
419
443
|
success: boolean;
|
|
444
|
+
id: string;
|
|
445
|
+
notify: "email" | "push" | "none";
|
|
420
446
|
};
|
|
421
447
|
iteration: unknown;
|
|
422
448
|
isForm: false;
|
|
@@ -427,11 +453,15 @@ declare const UserRPC: {
|
|
|
427
453
|
wrapper?: (req: vovk0.VovkRequest<any, any, any>, params: {
|
|
428
454
|
id: string;
|
|
429
455
|
}) => Promise<{
|
|
456
|
+
id: string;
|
|
457
|
+
notify: "email" | "push" | "none";
|
|
430
458
|
success: true;
|
|
431
459
|
}>;
|
|
432
460
|
} & {
|
|
433
461
|
fn: {
|
|
434
462
|
<TReturnType = Promise<{
|
|
463
|
+
id: string;
|
|
464
|
+
notify: "email" | "push" | "none";
|
|
435
465
|
success: true;
|
|
436
466
|
}>>(input?: {
|
|
437
467
|
disableClientValidation?: boolean;
|
|
@@ -458,6 +488,8 @@ declare const UserRPC: {
|
|
|
458
488
|
};
|
|
459
489
|
}): TReturnType;
|
|
460
490
|
<TReturnType = Promise<{
|
|
491
|
+
id: string;
|
|
492
|
+
notify: "email" | "push" | "none";
|
|
461
493
|
success: true;
|
|
462
494
|
}>>(input: {
|
|
463
495
|
disableClientValidation?: boolean;
|
|
@@ -488,6 +520,12 @@ declare const UserRPC: {
|
|
|
488
520
|
iteration?: _standard_schema_spec0.StandardSchemaV1<unknown, unknown>;
|
|
489
521
|
output?: zod0.ZodObject<{
|
|
490
522
|
success: zod0.ZodBoolean;
|
|
523
|
+
id: zod0.ZodUUID;
|
|
524
|
+
notify: zod0.ZodEnum<{
|
|
525
|
+
email: "email";
|
|
526
|
+
push: "push";
|
|
527
|
+
none: "none";
|
|
528
|
+
}>;
|
|
491
529
|
}, zod_v4_core0.$strip>;
|
|
492
530
|
params?: zod0.ZodObject<{
|
|
493
531
|
id: zod0.ZodUUID;
|
package/index.d.mts
CHANGED
|
@@ -97,6 +97,17 @@ declare const schema: {
|
|
|
97
97
|
description: string;
|
|
98
98
|
type: string;
|
|
99
99
|
};
|
|
100
|
+
id: {
|
|
101
|
+
description: string;
|
|
102
|
+
type: string;
|
|
103
|
+
format: string;
|
|
104
|
+
pattern: string;
|
|
105
|
+
};
|
|
106
|
+
notify: {
|
|
107
|
+
description: string;
|
|
108
|
+
type: string;
|
|
109
|
+
enum: string[];
|
|
110
|
+
};
|
|
100
111
|
};
|
|
101
112
|
required: string[];
|
|
102
113
|
additionalProperties: boolean;
|
|
@@ -278,6 +289,17 @@ declare let paths: {
|
|
|
278
289
|
description: string;
|
|
279
290
|
type: string;
|
|
280
291
|
};
|
|
292
|
+
id: {
|
|
293
|
+
description: string;
|
|
294
|
+
type: string;
|
|
295
|
+
format: string;
|
|
296
|
+
pattern: string;
|
|
297
|
+
};
|
|
298
|
+
notify: {
|
|
299
|
+
description: string;
|
|
300
|
+
type: string;
|
|
301
|
+
enum: string[];
|
|
302
|
+
};
|
|
281
303
|
};
|
|
282
304
|
required: string[];
|
|
283
305
|
additionalProperties: boolean;
|
|
@@ -399,6 +421,8 @@ declare const UserRPC: {
|
|
|
399
421
|
}: {
|
|
400
422
|
id: string;
|
|
401
423
|
}) => Promise<{
|
|
424
|
+
id: string;
|
|
425
|
+
notify: "email" | "push" | "none";
|
|
402
426
|
success: true;
|
|
403
427
|
}>) & {
|
|
404
428
|
__types: {
|
|
@@ -417,6 +441,8 @@ declare const UserRPC: {
|
|
|
417
441
|
};
|
|
418
442
|
output: {
|
|
419
443
|
success: boolean;
|
|
444
|
+
id: string;
|
|
445
|
+
notify: "email" | "push" | "none";
|
|
420
446
|
};
|
|
421
447
|
iteration: unknown;
|
|
422
448
|
isForm: false;
|
|
@@ -427,11 +453,15 @@ declare const UserRPC: {
|
|
|
427
453
|
wrapper?: (req: vovk0.VovkRequest<any, any, any>, params: {
|
|
428
454
|
id: string;
|
|
429
455
|
}) => Promise<{
|
|
456
|
+
id: string;
|
|
457
|
+
notify: "email" | "push" | "none";
|
|
430
458
|
success: true;
|
|
431
459
|
}>;
|
|
432
460
|
} & {
|
|
433
461
|
fn: {
|
|
434
462
|
<TReturnType = Promise<{
|
|
463
|
+
id: string;
|
|
464
|
+
notify: "email" | "push" | "none";
|
|
435
465
|
success: true;
|
|
436
466
|
}>>(input?: {
|
|
437
467
|
disableClientValidation?: boolean;
|
|
@@ -458,6 +488,8 @@ declare const UserRPC: {
|
|
|
458
488
|
};
|
|
459
489
|
}): TReturnType;
|
|
460
490
|
<TReturnType = Promise<{
|
|
491
|
+
id: string;
|
|
492
|
+
notify: "email" | "push" | "none";
|
|
461
493
|
success: true;
|
|
462
494
|
}>>(input: {
|
|
463
495
|
disableClientValidation?: boolean;
|
|
@@ -488,6 +520,12 @@ declare const UserRPC: {
|
|
|
488
520
|
iteration?: _standard_schema_spec0.StandardSchemaV1<unknown, unknown>;
|
|
489
521
|
output?: zod0.ZodObject<{
|
|
490
522
|
success: zod0.ZodBoolean;
|
|
523
|
+
id: zod0.ZodUUID;
|
|
524
|
+
notify: zod0.ZodEnum<{
|
|
525
|
+
email: "email";
|
|
526
|
+
push: "push";
|
|
527
|
+
none: "none";
|
|
528
|
+
}>;
|
|
491
529
|
}, zod_v4_core0.$strip>;
|
|
492
530
|
params?: zod0.ZodObject<{
|
|
493
531
|
id: zod0.ZodUUID;
|
package/index.mjs
CHANGED
|
@@ -83,11 +83,32 @@ var root_default = {
|
|
|
83
83
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
84
84
|
"description": "Response object",
|
|
85
85
|
"type": "object",
|
|
86
|
-
"properties": {
|
|
87
|
-
"
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
86
|
+
"properties": {
|
|
87
|
+
"success": {
|
|
88
|
+
"description": "Success status",
|
|
89
|
+
"type": "boolean"
|
|
90
|
+
},
|
|
91
|
+
"id": {
|
|
92
|
+
"description": "User ID",
|
|
93
|
+
"type": "string",
|
|
94
|
+
"format": "uuid",
|
|
95
|
+
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
|
|
96
|
+
},
|
|
97
|
+
"notify": {
|
|
98
|
+
"description": "Notification type",
|
|
99
|
+
"type": "string",
|
|
100
|
+
"enum": [
|
|
101
|
+
"email",
|
|
102
|
+
"push",
|
|
103
|
+
"none"
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"required": [
|
|
108
|
+
"success",
|
|
109
|
+
"id",
|
|
110
|
+
"notify"
|
|
111
|
+
],
|
|
91
112
|
"additionalProperties": false
|
|
92
113
|
}
|
|
93
114
|
},
|
|
@@ -270,17 +291,17 @@ var openapi_default = {
|
|
|
270
291
|
{
|
|
271
292
|
"label": "TypeScript RPC",
|
|
272
293
|
"lang": "typescript",
|
|
273
|
-
"source": "import { UserRPC } from 'vovk-hello-world';\n\nconst response = await UserRPC.updateUser({\n body: {\n // -----\n // User data object\n // -----\n // User email\n email: \"john@example.com\",\n // User profile object\n profile: {\n // User full name\n name: \"John Doe\",\n // User age\n age: 25\n }\n },\n query: {\n // -----\n // Query parameters\n // -----\n // Notification type\n notify: \"email\"\n },\n params: {\n // -----\n // Path parameters\n // -----\n // User ID\n id: \"123e4567-e89b-12d3-a456-426614174000\"\n },\n});\n\nconsole.log(response); \n/* \n{\n // -----\n // Response object\n // -----\n // Success status\n success: true\n}\n*/"
|
|
294
|
+
"source": "import { UserRPC } from 'vovk-hello-world';\n\nconst response = await UserRPC.updateUser({\n body: {\n // -----\n // User data object\n // -----\n // User email\n email: \"john@example.com\",\n // User profile object\n profile: {\n // User full name\n name: \"John Doe\",\n // User age\n age: 25\n }\n },\n query: {\n // -----\n // Query parameters\n // -----\n // Notification type\n notify: \"email\"\n },\n params: {\n // -----\n // Path parameters\n // -----\n // User ID\n id: \"123e4567-e89b-12d3-a456-426614174000\"\n },\n});\n\nconsole.log(response); \n/* \n{\n // -----\n // Response object\n // -----\n // Success status\n success: true,\n // User ID\n id: \"00000000-0000-0000-0000-000000000000\",\n // Notification type\n notify: \"email\"\n}\n*/"
|
|
274
295
|
},
|
|
275
296
|
{
|
|
276
297
|
"label": "Python RPC",
|
|
277
298
|
"lang": "python",
|
|
278
|
-
"source": "from vovk_hello_world import UserRPC\n\nresponse = UserRPC.update_user(\n body={\n # -----\n # User data object\n # -----\n # User email\n \"email\": \"john@example.com\",\n # User profile object\n \"profile\": {\n # User full name\n \"name\": \"John Doe\",\n # User age\n \"age\": 25\n }\n },\n query={\n # -----\n # Query parameters\n # -----\n # Notification type\n \"notify\": \"email\"\n },\n params={\n # -----\n # Path parameters\n # -----\n # User ID\n \"id\": \"123e4567-e89b-12d3-a456-426614174000\"\n },\n)\n\nprint(response)\n{\n # -----\n # Response object\n # -----\n # Success status\n \"success\": true\n}"
|
|
299
|
+
"source": "from vovk_hello_world import UserRPC\n\nresponse = UserRPC.update_user(\n body={\n # -----\n # User data object\n # -----\n # User email\n \"email\": \"john@example.com\",\n # User profile object\n \"profile\": {\n # User full name\n \"name\": \"John Doe\",\n # User age\n \"age\": 25\n }\n },\n query={\n # -----\n # Query parameters\n # -----\n # Notification type\n \"notify\": \"email\"\n },\n params={\n # -----\n # Path parameters\n # -----\n # User ID\n \"id\": \"123e4567-e89b-12d3-a456-426614174000\"\n },\n)\n\nprint(response)\n{\n # -----\n # Response object\n # -----\n # Success status\n \"success\": true,\n # User ID\n \"id\": \"00000000-0000-0000-0000-000000000000\",\n # Notification type\n \"notify\": \"email\"\n}"
|
|
279
300
|
},
|
|
280
301
|
{
|
|
281
302
|
"label": "Rust RPC",
|
|
282
303
|
"lang": "rust",
|
|
283
|
-
"source": "use vovk_hello_world::user_rpc;\nuse serde_json::{ \n from_value, \n json \n};\n\npub fn main() {\n let response = user_rpc::update_user(\n from_value(json!({\n // -----\n // User data object\n // -----\n // User email\n \"email\": \"john@example.com\",\n // User profile object\n \"profile\": {\n // User full name\n \"name\": \"John Doe\",\n // User age\n \"age\": 25\n }\n })).unwrap(), /* body */ \n from_value(json!({\n // -----\n // Query parameters\n // -----\n // Notification type\n \"notify\": \"email\"\n })).unwrap(), /* query */ \n from_value(json!({\n // -----\n // Path parameters\n // -----\n // User ID\n \"id\": \"123e4567-e89b-12d3-a456-426614174000\"\n })).unwrap(), /* params */ \n None, /* headers (HashMap) */ \n None, /* api_root */\n false, /* disable_client_validation */\n );\n\nmatch response {\n Ok(output) => println!(\"{:?}\", output),\n /* \n output {\n // -----\n // Response object\n // -----\n // Success status\n success: true\n } \n */\n Err(e) => println!(\"error: {:?}\", e),\n }\n}"
|
|
304
|
+
"source": "use vovk_hello_world::user_rpc;\nuse serde_json::{ \n from_value, \n json \n};\n\npub fn main() {\n let response = user_rpc::update_user(\n from_value(json!({\n // -----\n // User data object\n // -----\n // User email\n \"email\": \"john@example.com\",\n // User profile object\n \"profile\": {\n // User full name\n \"name\": \"John Doe\",\n // User age\n \"age\": 25\n }\n })).unwrap(), /* body */ \n from_value(json!({\n // -----\n // Query parameters\n // -----\n // Notification type\n \"notify\": \"email\"\n })).unwrap(), /* query */ \n from_value(json!({\n // -----\n // Path parameters\n // -----\n // User ID\n \"id\": \"123e4567-e89b-12d3-a456-426614174000\"\n })).unwrap(), /* params */ \n None, /* headers (HashMap) */ \n None, /* api_root */\n false, /* disable_client_validation */\n );\n\nmatch response {\n Ok(output) => println!(\"{:?}\", output),\n /* \n output {\n // -----\n // Response object\n // -----\n // Success status\n success: true,\n // User ID\n id: \"00000000-0000-0000-0000-000000000000\",\n // Notification type\n notify: \"email\"\n } \n */\n Err(e) => println!(\"error: {:?}\", e),\n }\n}"
|
|
284
305
|
}
|
|
285
306
|
],
|
|
286
307
|
"parameters": [{
|
|
@@ -314,11 +335,32 @@ var openapi_default = {
|
|
|
314
335
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
315
336
|
"description": "Response object",
|
|
316
337
|
"type": "object",
|
|
317
|
-
"properties": {
|
|
318
|
-
"
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
338
|
+
"properties": {
|
|
339
|
+
"success": {
|
|
340
|
+
"description": "Success status",
|
|
341
|
+
"type": "boolean"
|
|
342
|
+
},
|
|
343
|
+
"id": {
|
|
344
|
+
"description": "User ID",
|
|
345
|
+
"type": "string",
|
|
346
|
+
"format": "uuid",
|
|
347
|
+
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
|
|
348
|
+
},
|
|
349
|
+
"notify": {
|
|
350
|
+
"description": "Notification type",
|
|
351
|
+
"type": "string",
|
|
352
|
+
"enum": [
|
|
353
|
+
"email",
|
|
354
|
+
"push",
|
|
355
|
+
"none"
|
|
356
|
+
]
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
"required": [
|
|
360
|
+
"success",
|
|
361
|
+
"id",
|
|
362
|
+
"notify"
|
|
363
|
+
],
|
|
322
364
|
"additionalProperties": false
|
|
323
365
|
} } }
|
|
324
366
|
} },
|
package/package.json
CHANGED