@veruna/api-contracts 1.0.0 → 1.0.2

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 (2) hide show
  1. package/README.md +10 -2
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -39,13 +39,21 @@ import {
39
39
  ### Frontend usage with Zod
40
40
 
41
41
  ```typescript
42
+ import {
43
+ UpdateProfileRequest,
44
+ UpdateProfileRequestSchema,
45
+ UpdateProfileResponse,
46
+ USERS_API_PATHS,
47
+ } from '@veruna/api-contracts';
48
+
42
49
  // Validate data
43
50
  const data = UpdateProfileRequestSchema.parse({ name: 'John' });
44
51
 
45
- // Type-safe API calls
52
+ // Type-safe API calls with constants
46
53
  async function updateProfile(data: UpdateProfileRequest): Promise<UpdateProfileResponse> {
47
- const response = await fetch('/api/v1/users/me', {
54
+ const response = await fetch(USERS_API_PATHS.ME, { // ✅ Из констант!
48
55
  method: 'PATCH',
56
+ headers: { 'Content-Type': 'application/json' },
49
57
  body: JSON.stringify(data),
50
58
  });
51
59
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veruna/api-contracts",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "API contracts for Veruna project - Zod schemas, types, and paths",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",