@veruna/api-contracts 1.0.0
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 +81 -0
- package/build/index.d.ts +3 -0
- package/build/index.js +20 -0
- package/build/v1/auth/auth.errors.d.ts +12 -0
- package/build/v1/auth/auth.errors.js +16 -0
- package/build/v1/auth/auth.paths.d.ts +17 -0
- package/build/v1/auth/auth.paths.js +20 -0
- package/build/v1/auth/auth.schemas.d.ts +87 -0
- package/build/v1/auth/auth.schemas.js +69 -0
- package/build/v1/auth/auth.types.d.ts +8 -0
- package/build/v1/auth/auth.types.js +3 -0
- package/build/v1/auth/index.d.ts +4 -0
- package/build/v1/auth/index.js +20 -0
- package/build/v1/index.d.ts +2 -0
- package/build/v1/index.js +18 -0
- package/build/v1/unregistered-users/index.d.ts +4 -0
- package/build/v1/unregistered-users/index.js +20 -0
- package/build/v1/unregistered-users/unregistered-users.errors.d.ts +15 -0
- package/build/v1/unregistered-users/unregistered-users.errors.js +19 -0
- package/build/v1/unregistered-users/unregistered-users.paths.d.ts +15 -0
- package/build/v1/unregistered-users/unregistered-users.paths.js +18 -0
- package/build/v1/unregistered-users/unregistered-users.schemas.d.ts +24 -0
- package/build/v1/unregistered-users/unregistered-users.schemas.js +28 -0
- package/build/v1/unregistered-users/unregistered-users.types.d.ts +7 -0
- package/build/v1/unregistered-users/unregistered-users.types.js +2 -0
- package/build/v1/users/index.d.ts +3 -0
- package/build/v1/users/index.js +19 -0
- package/build/v1/users/users.paths.d.ts +11 -0
- package/build/v1/users/users.paths.js +14 -0
- package/build/v1/users/users.schemas.d.ts +73 -0
- package/build/v1/users/users.schemas.js +58 -0
- package/build/v1/users/users.types.d.ts +13 -0
- package/build/v1/users/users.types.js +2 -0
- package/package.json +33 -0
package/README.md
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# @veruna/api-contracts
|
|
2
|
+
|
|
3
|
+
API contracts for Veruna project - type-safe Zod schemas, TypeScript types, and API paths.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @veruna/api-contracts
|
|
9
|
+
# or
|
|
10
|
+
pnpm add @veruna/api-contracts
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
### Import schemas and types
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import {
|
|
19
|
+
// Auth
|
|
20
|
+
SignUpRequestSchema,
|
|
21
|
+
LoginRequestSchema,
|
|
22
|
+
SignUpRequest,
|
|
23
|
+
LoginRequest,
|
|
24
|
+
AuthResponse,
|
|
25
|
+
|
|
26
|
+
// Users
|
|
27
|
+
UpdateProfileRequestSchema,
|
|
28
|
+
ChangePasswordRequestSchema,
|
|
29
|
+
UpdateProfileRequest,
|
|
30
|
+
ChangePasswordRequest,
|
|
31
|
+
UserResponse,
|
|
32
|
+
|
|
33
|
+
// Paths
|
|
34
|
+
AUTH_PATHS,
|
|
35
|
+
USERS_PATHS,
|
|
36
|
+
} from '@veruna/api-contracts';
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Frontend usage with Zod
|
|
40
|
+
|
|
41
|
+
```typescript
|
|
42
|
+
// Validate data
|
|
43
|
+
const data = UpdateProfileRequestSchema.parse({ name: 'John' });
|
|
44
|
+
|
|
45
|
+
// Type-safe API calls
|
|
46
|
+
async function updateProfile(data: UpdateProfileRequest): Promise<UpdateProfileResponse> {
|
|
47
|
+
const response = await fetch('/api/v1/users/me', {
|
|
48
|
+
method: 'PATCH',
|
|
49
|
+
body: JSON.stringify(data),
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
return response.json();
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Error handling
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
const response = await changePassword(data);
|
|
60
|
+
|
|
61
|
+
if ('code' in response) {
|
|
62
|
+
// Error response
|
|
63
|
+
console.error(response.code); // e.g., "UNAUTHORIZED"
|
|
64
|
+
if (response.details) {
|
|
65
|
+
console.error(response.details);
|
|
66
|
+
}
|
|
67
|
+
} else {
|
|
68
|
+
// Success response
|
|
69
|
+
console.log('Password changed!');
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Available Contracts
|
|
74
|
+
|
|
75
|
+
- **Auth** (`/v1/auth`): signup, login, logout, sessions
|
|
76
|
+
- **Users** (`/v1/users`): profile management, password change
|
|
77
|
+
- **Unregistered Users** (`/v1/unreg-users`): guest users
|
|
78
|
+
|
|
79
|
+
## License
|
|
80
|
+
|
|
81
|
+
ISC
|
package/build/index.d.ts
ADDED
package/build/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
// Export all contracts
|
|
18
|
+
__exportStar(require("./v1/auth"), exports);
|
|
19
|
+
__exportStar(require("./v1/users"), exports);
|
|
20
|
+
__exportStar(require("./v1/unregistered-users"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare enum AuthErrorCode {
|
|
2
|
+
EMAIL_ALREADY_EXISTS = "EMAIL_ALREADY_EXISTS",
|
|
3
|
+
INVALID_CREDENTIALS = "INVALID_CREDENTIALS",
|
|
4
|
+
USER_NOT_FOUND = "USER_NOT_FOUND",
|
|
5
|
+
USER_DELETED = "USER_DELETED",
|
|
6
|
+
SESSION_NOT_FOUND = "SESSION_NOT_FOUND",
|
|
7
|
+
SESSION_INACTIVE = "SESSION_INACTIVE",
|
|
8
|
+
INVALID_TOKEN = "INVALID_TOKEN",
|
|
9
|
+
PASSWORD_TOO_WEAK = "PASSWORD_TOO_WEAK",
|
|
10
|
+
UNREG_USER_ALREADY_MIGRATED = "UNREG_USER_ALREADY_MIGRATED",
|
|
11
|
+
SESSION_NOT_OWNED_BY_USER = "SESSION_NOT_OWNED_BY_USER"
|
|
12
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthErrorCode = void 0;
|
|
4
|
+
var AuthErrorCode;
|
|
5
|
+
(function (AuthErrorCode) {
|
|
6
|
+
AuthErrorCode["EMAIL_ALREADY_EXISTS"] = "EMAIL_ALREADY_EXISTS";
|
|
7
|
+
AuthErrorCode["INVALID_CREDENTIALS"] = "INVALID_CREDENTIALS";
|
|
8
|
+
AuthErrorCode["USER_NOT_FOUND"] = "USER_NOT_FOUND";
|
|
9
|
+
AuthErrorCode["USER_DELETED"] = "USER_DELETED";
|
|
10
|
+
AuthErrorCode["SESSION_NOT_FOUND"] = "SESSION_NOT_FOUND";
|
|
11
|
+
AuthErrorCode["SESSION_INACTIVE"] = "SESSION_INACTIVE";
|
|
12
|
+
AuthErrorCode["INVALID_TOKEN"] = "INVALID_TOKEN";
|
|
13
|
+
AuthErrorCode["PASSWORD_TOO_WEAK"] = "PASSWORD_TOO_WEAK";
|
|
14
|
+
AuthErrorCode["UNREG_USER_ALREADY_MIGRATED"] = "UNREG_USER_ALREADY_MIGRATED";
|
|
15
|
+
AuthErrorCode["SESSION_NOT_OWNED_BY_USER"] = "SESSION_NOT_OWNED_BY_USER";
|
|
16
|
+
})(AuthErrorCode || (exports.AuthErrorCode = AuthErrorCode = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const AUTH_PATHS: {
|
|
2
|
+
readonly BASE: "v1/auth";
|
|
3
|
+
readonly SIGNUP: "signup";
|
|
4
|
+
readonly LOGIN: "login";
|
|
5
|
+
readonly LOGOUT: "logout";
|
|
6
|
+
readonly LOGOUT_ALL: "logout-all";
|
|
7
|
+
readonly SESSIONS: "sessions";
|
|
8
|
+
readonly SESSION_BY_ID: "sessions/:id";
|
|
9
|
+
};
|
|
10
|
+
export declare const AUTH_API_PATHS: {
|
|
11
|
+
readonly SIGNUP: "/api/v1/auth/signup";
|
|
12
|
+
readonly LOGIN: "/api/v1/auth/login";
|
|
13
|
+
readonly LOGOUT: "/api/v1/auth/logout";
|
|
14
|
+
readonly LOGOUT_ALL: "/api/v1/auth/logout-all";
|
|
15
|
+
readonly SESSIONS: "/api/v1/auth/sessions";
|
|
16
|
+
readonly SESSION_BY_ID: (id: string) => string;
|
|
17
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AUTH_API_PATHS = exports.AUTH_PATHS = void 0;
|
|
4
|
+
exports.AUTH_PATHS = {
|
|
5
|
+
BASE: 'v1/auth',
|
|
6
|
+
SIGNUP: 'signup',
|
|
7
|
+
LOGIN: 'login',
|
|
8
|
+
LOGOUT: 'logout',
|
|
9
|
+
LOGOUT_ALL: 'logout-all',
|
|
10
|
+
SESSIONS: 'sessions',
|
|
11
|
+
SESSION_BY_ID: 'sessions/:id',
|
|
12
|
+
};
|
|
13
|
+
exports.AUTH_API_PATHS = {
|
|
14
|
+
SIGNUP: `/api/${exports.AUTH_PATHS.BASE}/${exports.AUTH_PATHS.SIGNUP}`,
|
|
15
|
+
LOGIN: `/api/${exports.AUTH_PATHS.BASE}/${exports.AUTH_PATHS.LOGIN}`,
|
|
16
|
+
LOGOUT: `/api/${exports.AUTH_PATHS.BASE}/${exports.AUTH_PATHS.LOGOUT}`,
|
|
17
|
+
LOGOUT_ALL: `/api/${exports.AUTH_PATHS.BASE}/${exports.AUTH_PATHS.LOGOUT_ALL}`,
|
|
18
|
+
SESSIONS: `/api/${exports.AUTH_PATHS.BASE}/${exports.AUTH_PATHS.SESSIONS}`,
|
|
19
|
+
SESSION_BY_ID: (id) => `/api/${exports.AUTH_PATHS.BASE}/sessions/${id}`,
|
|
20
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* User Role enum
|
|
4
|
+
*/
|
|
5
|
+
export declare enum UserRole {
|
|
6
|
+
USER = "user",
|
|
7
|
+
ADMIN = "admin"
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* UTM Schema
|
|
11
|
+
*/
|
|
12
|
+
export declare const UtmSchema: z.ZodObject<{
|
|
13
|
+
utmSource: z.ZodOptional<z.ZodString>;
|
|
14
|
+
utmMedium: z.ZodOptional<z.ZodString>;
|
|
15
|
+
utmCampaign: z.ZodOptional<z.ZodString>;
|
|
16
|
+
utmContent: z.ZodOptional<z.ZodString>;
|
|
17
|
+
utmTerm: z.ZodOptional<z.ZodString>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
/**
|
|
20
|
+
* Sign Up Request Schema
|
|
21
|
+
*/
|
|
22
|
+
export declare const SignUpRequestSchema: z.ZodObject<{
|
|
23
|
+
email: z.ZodString;
|
|
24
|
+
password: z.ZodString;
|
|
25
|
+
name: z.ZodString;
|
|
26
|
+
marketingConsent: z.ZodDefault<z.ZodBoolean>;
|
|
27
|
+
utm: z.ZodOptional<z.ZodObject<{
|
|
28
|
+
utmSource: z.ZodOptional<z.ZodString>;
|
|
29
|
+
utmMedium: z.ZodOptional<z.ZodString>;
|
|
30
|
+
utmCampaign: z.ZodOptional<z.ZodString>;
|
|
31
|
+
utmContent: z.ZodOptional<z.ZodString>;
|
|
32
|
+
utmTerm: z.ZodOptional<z.ZodString>;
|
|
33
|
+
}, z.core.$strip>>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
/**
|
|
36
|
+
* Login Request Schema
|
|
37
|
+
*/
|
|
38
|
+
export declare const LoginRequestSchema: z.ZodObject<{
|
|
39
|
+
email: z.ZodString;
|
|
40
|
+
password: z.ZodString;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
/**
|
|
43
|
+
* Session Response Schema
|
|
44
|
+
*/
|
|
45
|
+
export declare const SessionResponseSchema: z.ZodObject<{
|
|
46
|
+
uuid: z.ZodString;
|
|
47
|
+
deviceName: z.ZodString;
|
|
48
|
+
ip: z.ZodString;
|
|
49
|
+
isCurrent: z.ZodBoolean;
|
|
50
|
+
createdAt: z.ZodString;
|
|
51
|
+
lastUsedAt: z.ZodString;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
/**
|
|
54
|
+
* Auth Response Schema (signup/login)
|
|
55
|
+
*/
|
|
56
|
+
export declare const AuthResponseSchema: z.ZodObject<{
|
|
57
|
+
user: z.ZodObject<{
|
|
58
|
+
uuid: z.ZodString;
|
|
59
|
+
email: z.ZodString;
|
|
60
|
+
name: z.ZodString;
|
|
61
|
+
role: z.ZodString;
|
|
62
|
+
marketingConsent: z.ZodBoolean;
|
|
63
|
+
createdAt: z.ZodString;
|
|
64
|
+
}, z.core.$strip>;
|
|
65
|
+
accessToken: z.ZodString;
|
|
66
|
+
session: z.ZodObject<{
|
|
67
|
+
uuid: z.ZodString;
|
|
68
|
+
deviceName: z.ZodString;
|
|
69
|
+
ip: z.ZodString;
|
|
70
|
+
isCurrent: z.ZodBoolean;
|
|
71
|
+
createdAt: z.ZodString;
|
|
72
|
+
lastUsedAt: z.ZodString;
|
|
73
|
+
}, z.core.$strip>;
|
|
74
|
+
}, z.core.$strip>;
|
|
75
|
+
/**
|
|
76
|
+
* Sessions List Response Schema
|
|
77
|
+
*/
|
|
78
|
+
export declare const SessionsListResponseSchema: z.ZodObject<{
|
|
79
|
+
sessions: z.ZodArray<z.ZodObject<{
|
|
80
|
+
uuid: z.ZodString;
|
|
81
|
+
deviceName: z.ZodString;
|
|
82
|
+
ip: z.ZodString;
|
|
83
|
+
isCurrent: z.ZodBoolean;
|
|
84
|
+
createdAt: z.ZodString;
|
|
85
|
+
lastUsedAt: z.ZodString;
|
|
86
|
+
}, z.core.$strip>>;
|
|
87
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SessionsListResponseSchema = exports.AuthResponseSchema = exports.SessionResponseSchema = exports.LoginRequestSchema = exports.SignUpRequestSchema = exports.UtmSchema = exports.UserRole = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const users_schemas_1 = require("../users/users.schemas");
|
|
6
|
+
/**
|
|
7
|
+
* User Role enum
|
|
8
|
+
*/
|
|
9
|
+
var UserRole;
|
|
10
|
+
(function (UserRole) {
|
|
11
|
+
UserRole["USER"] = "user";
|
|
12
|
+
UserRole["ADMIN"] = "admin";
|
|
13
|
+
})(UserRole || (exports.UserRole = UserRole = {}));
|
|
14
|
+
/**
|
|
15
|
+
* UTM Schema
|
|
16
|
+
*/
|
|
17
|
+
exports.UtmSchema = zod_1.z.object({
|
|
18
|
+
utmSource: zod_1.z.string().optional(),
|
|
19
|
+
utmMedium: zod_1.z.string().optional(),
|
|
20
|
+
utmCampaign: zod_1.z.string().optional(),
|
|
21
|
+
utmContent: zod_1.z.string().optional(),
|
|
22
|
+
utmTerm: zod_1.z.string().optional(),
|
|
23
|
+
});
|
|
24
|
+
/**
|
|
25
|
+
* Sign Up Request Schema
|
|
26
|
+
*/
|
|
27
|
+
exports.SignUpRequestSchema = zod_1.z.object({
|
|
28
|
+
email: zod_1.z.string().email('Invalid email format'),
|
|
29
|
+
password: zod_1.z
|
|
30
|
+
.string()
|
|
31
|
+
.min(8, 'Password must be at least 8 characters')
|
|
32
|
+
.max(128, 'Password too long (maximum 128 characters)')
|
|
33
|
+
.regex(/[0-9!@#$%^&*(),.?":{}|<>]/, 'Password must contain at least one number or special character'),
|
|
34
|
+
name: zod_1.z.string().min(2, 'Name must be at least 2 characters'),
|
|
35
|
+
marketingConsent: zod_1.z.boolean().default(false),
|
|
36
|
+
utm: exports.UtmSchema.optional(),
|
|
37
|
+
});
|
|
38
|
+
/**
|
|
39
|
+
* Login Request Schema
|
|
40
|
+
*/
|
|
41
|
+
exports.LoginRequestSchema = zod_1.z.object({
|
|
42
|
+
email: zod_1.z.string().email('Invalid email format'),
|
|
43
|
+
password: zod_1.z.string().min(1, 'Password is required'),
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* Session Response Schema
|
|
47
|
+
*/
|
|
48
|
+
exports.SessionResponseSchema = zod_1.z.object({
|
|
49
|
+
uuid: zod_1.z.string().uuid(),
|
|
50
|
+
deviceName: zod_1.z.string(),
|
|
51
|
+
ip: zod_1.z.string(),
|
|
52
|
+
isCurrent: zod_1.z.boolean(),
|
|
53
|
+
createdAt: zod_1.z.string().datetime(),
|
|
54
|
+
lastUsedAt: zod_1.z.string().datetime(),
|
|
55
|
+
});
|
|
56
|
+
/**
|
|
57
|
+
* Auth Response Schema (signup/login)
|
|
58
|
+
*/
|
|
59
|
+
exports.AuthResponseSchema = zod_1.z.object({
|
|
60
|
+
user: users_schemas_1.UserResponseSchema,
|
|
61
|
+
accessToken: zod_1.z.string(),
|
|
62
|
+
session: exports.SessionResponseSchema,
|
|
63
|
+
});
|
|
64
|
+
/**
|
|
65
|
+
* Sessions List Response Schema
|
|
66
|
+
*/
|
|
67
|
+
exports.SessionsListResponseSchema = zod_1.z.object({
|
|
68
|
+
sessions: zod_1.z.array(exports.SessionResponseSchema),
|
|
69
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { SignUpRequestSchema, LoginRequestSchema, SessionResponseSchema, AuthResponseSchema, SessionsListResponseSchema, UtmSchema } from './auth.schemas';
|
|
3
|
+
export type SignUpRequest = z.infer<typeof SignUpRequestSchema>;
|
|
4
|
+
export type LoginRequest = z.infer<typeof LoginRequestSchema>;
|
|
5
|
+
export type SessionResponse = z.infer<typeof SessionResponseSchema>;
|
|
6
|
+
export type AuthResponse = z.infer<typeof AuthResponseSchema>;
|
|
7
|
+
export type SessionsListResponse = z.infer<typeof SessionsListResponseSchema>;
|
|
8
|
+
export type Utm = z.infer<typeof UtmSchema>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./auth.schemas"), exports);
|
|
18
|
+
__exportStar(require("./auth.types"), exports);
|
|
19
|
+
__exportStar(require("./auth.paths"), exports);
|
|
20
|
+
__exportStar(require("./auth.errors"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./auth"), exports);
|
|
18
|
+
__exportStar(require("./unregistered-users"), exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./unregistered-users.schemas"), exports);
|
|
18
|
+
__exportStar(require("./unregistered-users.types"), exports);
|
|
19
|
+
__exportStar(require("./unregistered-users.paths"), exports);
|
|
20
|
+
__exportStar(require("./unregistered-users.errors"), exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unregistered User error codes
|
|
3
|
+
*/
|
|
4
|
+
export declare enum UnregUserErrorCode {
|
|
5
|
+
/** Invalid JWT token */
|
|
6
|
+
INVALID_TOKEN = "INVALID_TOKEN",
|
|
7
|
+
/** Token expired or invalidated */
|
|
8
|
+
TOKEN_EXPIRED = "TOKEN_EXPIRED",
|
|
9
|
+
/** IP mismatch - token bound to different IP */
|
|
10
|
+
IP_MISMATCH = "IP_MISMATCH",
|
|
11
|
+
/** User marked as fraud */
|
|
12
|
+
FRAUD_DETECTED = "FRAUD_DETECTED",
|
|
13
|
+
/** Token version mismatch */
|
|
14
|
+
TOKEN_VERSION_MISMATCH = "TOKEN_VERSION_MISMATCH"
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UnregUserErrorCode = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Unregistered User error codes
|
|
6
|
+
*/
|
|
7
|
+
var UnregUserErrorCode;
|
|
8
|
+
(function (UnregUserErrorCode) {
|
|
9
|
+
/** Invalid JWT token */
|
|
10
|
+
UnregUserErrorCode["INVALID_TOKEN"] = "INVALID_TOKEN";
|
|
11
|
+
/** Token expired or invalidated */
|
|
12
|
+
UnregUserErrorCode["TOKEN_EXPIRED"] = "TOKEN_EXPIRED";
|
|
13
|
+
/** IP mismatch - token bound to different IP */
|
|
14
|
+
UnregUserErrorCode["IP_MISMATCH"] = "IP_MISMATCH";
|
|
15
|
+
/** User marked as fraud */
|
|
16
|
+
UnregUserErrorCode["FRAUD_DETECTED"] = "FRAUD_DETECTED";
|
|
17
|
+
/** Token version mismatch */
|
|
18
|
+
UnregUserErrorCode["TOKEN_VERSION_MISMATCH"] = "TOKEN_VERSION_MISMATCH";
|
|
19
|
+
})(UnregUserErrorCode || (exports.UnregUserErrorCode = UnregUserErrorCode = {}));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unregistered Users API paths
|
|
3
|
+
*/
|
|
4
|
+
export declare const UNREG_USERS_PATHS: {
|
|
5
|
+
/** Base path for unregistered users controller */
|
|
6
|
+
readonly BASE: "v1/unreg";
|
|
7
|
+
/** Authenticate unregistered user - PUT /api/v1/unreg */
|
|
8
|
+
readonly AUTHENTICATE: "";
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Full API paths (with /api prefix)
|
|
12
|
+
*/
|
|
13
|
+
export declare const UNREG_USERS_API_PATHS: {
|
|
14
|
+
readonly AUTHENTICATE: "/api/v1/unreg";
|
|
15
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UNREG_USERS_API_PATHS = exports.UNREG_USERS_PATHS = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Unregistered Users API paths
|
|
6
|
+
*/
|
|
7
|
+
exports.UNREG_USERS_PATHS = {
|
|
8
|
+
/** Base path for unregistered users controller */
|
|
9
|
+
BASE: 'v1/unreg',
|
|
10
|
+
/** Authenticate unregistered user - PUT /api/v1/unreg */
|
|
11
|
+
AUTHENTICATE: '',
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Full API paths (with /api prefix)
|
|
15
|
+
*/
|
|
16
|
+
exports.UNREG_USERS_API_PATHS = {
|
|
17
|
+
AUTHENTICATE: `/api/${exports.UNREG_USERS_PATHS.BASE}`,
|
|
18
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Unregistered User Status
|
|
4
|
+
*/
|
|
5
|
+
export declare enum UnregUserStatusContract {
|
|
6
|
+
ACTIVE = "active",
|
|
7
|
+
FRAUD = "fraud",
|
|
8
|
+
MIGRATED = "migrated"
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Authenticate Unregistered User Request Schema
|
|
12
|
+
*/
|
|
13
|
+
export declare const AuthenticateUnregUserRequestSchema: z.ZodObject<{
|
|
14
|
+
token: z.ZodOptional<z.ZodString>;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
/**
|
|
17
|
+
* Authenticate Unregistered User Response Schema
|
|
18
|
+
*/
|
|
19
|
+
export declare const AuthenticateUnregUserResponseSchema: z.ZodObject<{
|
|
20
|
+
token: z.ZodString;
|
|
21
|
+
requests: z.ZodNumber;
|
|
22
|
+
nextResetAt: z.ZodString;
|
|
23
|
+
status: z.ZodEnum<typeof UnregUserStatusContract>;
|
|
24
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthenticateUnregUserResponseSchema = exports.AuthenticateUnregUserRequestSchema = exports.UnregUserStatusContract = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Unregistered User Status
|
|
7
|
+
*/
|
|
8
|
+
var UnregUserStatusContract;
|
|
9
|
+
(function (UnregUserStatusContract) {
|
|
10
|
+
UnregUserStatusContract["ACTIVE"] = "active";
|
|
11
|
+
UnregUserStatusContract["FRAUD"] = "fraud";
|
|
12
|
+
UnregUserStatusContract["MIGRATED"] = "migrated";
|
|
13
|
+
})(UnregUserStatusContract || (exports.UnregUserStatusContract = UnregUserStatusContract = {}));
|
|
14
|
+
/**
|
|
15
|
+
* Authenticate Unregistered User Request Schema
|
|
16
|
+
*/
|
|
17
|
+
exports.AuthenticateUnregUserRequestSchema = zod_1.z.object({
|
|
18
|
+
token: zod_1.z.string().optional(),
|
|
19
|
+
});
|
|
20
|
+
/**
|
|
21
|
+
* Authenticate Unregistered User Response Schema
|
|
22
|
+
*/
|
|
23
|
+
exports.AuthenticateUnregUserResponseSchema = zod_1.z.object({
|
|
24
|
+
token: zod_1.z.string(),
|
|
25
|
+
requests: zod_1.z.number().int().nonnegative(),
|
|
26
|
+
nextResetAt: zod_1.z.string().datetime(),
|
|
27
|
+
status: zod_1.z.nativeEnum(UnregUserStatusContract),
|
|
28
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AuthenticateUnregUserRequestSchema, AuthenticateUnregUserResponseSchema } from './unregistered-users.schemas';
|
|
3
|
+
/**
|
|
4
|
+
* Request/Response Types
|
|
5
|
+
*/
|
|
6
|
+
export type AuthenticateUnregUserRequest = z.infer<typeof AuthenticateUnregUserRequestSchema>;
|
|
7
|
+
export type AuthenticateUnregUserResponse = z.infer<typeof AuthenticateUnregUserResponseSchema>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./users.schemas"), exports);
|
|
18
|
+
__exportStar(require("./users.types"), exports);
|
|
19
|
+
__exportStar(require("./users.paths"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const USERS_PATHS: {
|
|
2
|
+
readonly BASE: "v1/users";
|
|
3
|
+
readonly ME: "me";
|
|
4
|
+
readonly ME_MARKETING_CONSENT: "me/marketing-consent";
|
|
5
|
+
readonly ME_PASSWORD: "me/password";
|
|
6
|
+
};
|
|
7
|
+
export declare const USERS_API_PATHS: {
|
|
8
|
+
readonly ME: "/api/v1/users/me";
|
|
9
|
+
readonly ME_MARKETING_CONSENT: "/api/v1/users/me/marketing-consent";
|
|
10
|
+
readonly ME_PASSWORD: "/api/v1/users/me/password";
|
|
11
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.USERS_API_PATHS = exports.USERS_PATHS = void 0;
|
|
4
|
+
exports.USERS_PATHS = {
|
|
5
|
+
BASE: 'v1/users',
|
|
6
|
+
ME: 'me',
|
|
7
|
+
ME_MARKETING_CONSENT: 'me/marketing-consent',
|
|
8
|
+
ME_PASSWORD: 'me/password',
|
|
9
|
+
};
|
|
10
|
+
exports.USERS_API_PATHS = {
|
|
11
|
+
ME: `/api/${exports.USERS_PATHS.BASE}/${exports.USERS_PATHS.ME}`,
|
|
12
|
+
ME_MARKETING_CONSENT: `/api/${exports.USERS_PATHS.BASE}/${exports.USERS_PATHS.ME_MARKETING_CONSENT}`,
|
|
13
|
+
ME_PASSWORD: `/api/${exports.USERS_PATHS.BASE}/${exports.USERS_PATHS.ME_PASSWORD}`,
|
|
14
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Update Profile Request Schema
|
|
4
|
+
*/
|
|
5
|
+
export declare const UpdateProfileRequestSchema: z.ZodObject<{
|
|
6
|
+
name: z.ZodString;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
/**
|
|
9
|
+
* Toggle Marketing Consent Request Schema
|
|
10
|
+
*/
|
|
11
|
+
export declare const ToggleMarketingConsentRequestSchema: z.ZodObject<{
|
|
12
|
+
marketingConsent: z.ZodBoolean;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
/**
|
|
15
|
+
* Change Password Request Schema
|
|
16
|
+
*/
|
|
17
|
+
export declare const ChangePasswordRequestSchema: z.ZodObject<{
|
|
18
|
+
oldPassword: z.ZodString;
|
|
19
|
+
newPassword: z.ZodString;
|
|
20
|
+
logoutFromAllDevices: z.ZodDefault<z.ZodBoolean>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
/**
|
|
23
|
+
* User Response Schema
|
|
24
|
+
*/
|
|
25
|
+
export declare const UserResponseSchema: z.ZodObject<{
|
|
26
|
+
uuid: z.ZodString;
|
|
27
|
+
email: z.ZodString;
|
|
28
|
+
name: z.ZodString;
|
|
29
|
+
role: z.ZodString;
|
|
30
|
+
marketingConsent: z.ZodBoolean;
|
|
31
|
+
createdAt: z.ZodString;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
/**
|
|
34
|
+
* Empty Response (for void operations like update, delete)
|
|
35
|
+
*/
|
|
36
|
+
export declare const EmptyResponseSchema: z.ZodObject<{}, z.core.$strip>;
|
|
37
|
+
/**
|
|
38
|
+
* Error Response Schema
|
|
39
|
+
*/
|
|
40
|
+
export declare const ErrorResponseSchema: z.ZodObject<{
|
|
41
|
+
code: z.ZodString;
|
|
42
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
/**
|
|
45
|
+
* Endpoint Response Unions (for frontend type safety)
|
|
46
|
+
*/
|
|
47
|
+
export declare const UpdateProfileResponseSchema: z.ZodUnion<readonly [z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
48
|
+
code: z.ZodString;
|
|
49
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
50
|
+
}, z.core.$strip>]>;
|
|
51
|
+
export declare const DeleteAccountResponseSchema: z.ZodUnion<readonly [z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
52
|
+
code: z.ZodString;
|
|
53
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
54
|
+
}, z.core.$strip>]>;
|
|
55
|
+
export declare const ToggleMarketingConsentResponseSchema: z.ZodUnion<readonly [z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
56
|
+
code: z.ZodString;
|
|
57
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
58
|
+
}, z.core.$strip>]>;
|
|
59
|
+
export declare const ChangePasswordResponseSchema: z.ZodUnion<readonly [z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
60
|
+
code: z.ZodString;
|
|
61
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
62
|
+
}, z.core.$strip>]>;
|
|
63
|
+
export declare const GetCurrentUserResponseSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
64
|
+
uuid: z.ZodString;
|
|
65
|
+
email: z.ZodString;
|
|
66
|
+
name: z.ZodString;
|
|
67
|
+
role: z.ZodString;
|
|
68
|
+
marketingConsent: z.ZodBoolean;
|
|
69
|
+
createdAt: z.ZodString;
|
|
70
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
71
|
+
code: z.ZodString;
|
|
72
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
73
|
+
}, z.core.$strip>]>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetCurrentUserResponseSchema = exports.ChangePasswordResponseSchema = exports.ToggleMarketingConsentResponseSchema = exports.DeleteAccountResponseSchema = exports.UpdateProfileResponseSchema = exports.ErrorResponseSchema = exports.EmptyResponseSchema = exports.UserResponseSchema = exports.ChangePasswordRequestSchema = exports.ToggleMarketingConsentRequestSchema = exports.UpdateProfileRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Update Profile Request Schema
|
|
7
|
+
*/
|
|
8
|
+
exports.UpdateProfileRequestSchema = zod_1.z.object({
|
|
9
|
+
name: zod_1.z.string().min(2, 'Name must be at least 2 characters').max(100, 'Name too long'),
|
|
10
|
+
});
|
|
11
|
+
/**
|
|
12
|
+
* Toggle Marketing Consent Request Schema
|
|
13
|
+
*/
|
|
14
|
+
exports.ToggleMarketingConsentRequestSchema = zod_1.z.object({
|
|
15
|
+
marketingConsent: zod_1.z.boolean(),
|
|
16
|
+
});
|
|
17
|
+
/**
|
|
18
|
+
* Change Password Request Schema
|
|
19
|
+
*/
|
|
20
|
+
exports.ChangePasswordRequestSchema = zod_1.z.object({
|
|
21
|
+
oldPassword: zod_1.z.string().min(1, 'Current password is required'),
|
|
22
|
+
newPassword: zod_1.z
|
|
23
|
+
.string()
|
|
24
|
+
.min(8, 'Password must be at least 8 characters')
|
|
25
|
+
.max(128, 'Password too long (maximum 128 characters)')
|
|
26
|
+
.regex(/[0-9!@#$%^&*(),.?":{}|<>]/, 'Password must contain at least one number or special character'),
|
|
27
|
+
logoutFromAllDevices: zod_1.z.boolean().default(false),
|
|
28
|
+
});
|
|
29
|
+
/**
|
|
30
|
+
* User Response Schema
|
|
31
|
+
*/
|
|
32
|
+
exports.UserResponseSchema = zod_1.z.object({
|
|
33
|
+
uuid: zod_1.z.string().uuid(),
|
|
34
|
+
email: zod_1.z.string().email(),
|
|
35
|
+
name: zod_1.z.string(),
|
|
36
|
+
role: zod_1.z.string(),
|
|
37
|
+
marketingConsent: zod_1.z.boolean(),
|
|
38
|
+
createdAt: zod_1.z.string().datetime(),
|
|
39
|
+
});
|
|
40
|
+
/**
|
|
41
|
+
* Empty Response (for void operations like update, delete)
|
|
42
|
+
*/
|
|
43
|
+
exports.EmptyResponseSchema = zod_1.z.object({});
|
|
44
|
+
/**
|
|
45
|
+
* Error Response Schema
|
|
46
|
+
*/
|
|
47
|
+
exports.ErrorResponseSchema = zod_1.z.object({
|
|
48
|
+
code: zod_1.z.string(),
|
|
49
|
+
details: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional(),
|
|
50
|
+
});
|
|
51
|
+
/**
|
|
52
|
+
* Endpoint Response Unions (for frontend type safety)
|
|
53
|
+
*/
|
|
54
|
+
exports.UpdateProfileResponseSchema = zod_1.z.union([exports.EmptyResponseSchema, exports.ErrorResponseSchema]);
|
|
55
|
+
exports.DeleteAccountResponseSchema = zod_1.z.union([exports.EmptyResponseSchema, exports.ErrorResponseSchema]);
|
|
56
|
+
exports.ToggleMarketingConsentResponseSchema = zod_1.z.union([exports.EmptyResponseSchema, exports.ErrorResponseSchema]);
|
|
57
|
+
exports.ChangePasswordResponseSchema = zod_1.z.union([exports.EmptyResponseSchema, exports.ErrorResponseSchema]);
|
|
58
|
+
exports.GetCurrentUserResponseSchema = zod_1.z.union([exports.UserResponseSchema, exports.ErrorResponseSchema]);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { UpdateProfileRequestSchema, ToggleMarketingConsentRequestSchema, ChangePasswordRequestSchema, UserResponseSchema, EmptyResponseSchema, ErrorResponseSchema, UpdateProfileResponseSchema, DeleteAccountResponseSchema, ToggleMarketingConsentResponseSchema, ChangePasswordResponseSchema, GetCurrentUserResponseSchema } from './users.schemas';
|
|
3
|
+
export type UpdateProfileRequest = z.infer<typeof UpdateProfileRequestSchema>;
|
|
4
|
+
export type ToggleMarketingConsentRequest = z.infer<typeof ToggleMarketingConsentRequestSchema>;
|
|
5
|
+
export type ChangePasswordRequest = z.infer<typeof ChangePasswordRequestSchema>;
|
|
6
|
+
export type UserResponse = z.infer<typeof UserResponseSchema>;
|
|
7
|
+
export type EmptyResponse = z.infer<typeof EmptyResponseSchema>;
|
|
8
|
+
export type ErrorResponse = z.infer<typeof ErrorResponseSchema>;
|
|
9
|
+
export type UpdateProfileResponse = z.infer<typeof UpdateProfileResponseSchema>;
|
|
10
|
+
export type DeleteAccountResponse = z.infer<typeof DeleteAccountResponseSchema>;
|
|
11
|
+
export type ToggleMarketingConsentResponse = z.infer<typeof ToggleMarketingConsentResponseSchema>;
|
|
12
|
+
export type ChangePasswordResponse = z.infer<typeof ChangePasswordResponseSchema>;
|
|
13
|
+
export type GetCurrentUserResponse = z.infer<typeof GetCurrentUserResponseSchema>;
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@veruna/api-contracts",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "API contracts for Veruna project - Zod schemas, types, and paths",
|
|
5
|
+
"main": "./build/index.js",
|
|
6
|
+
"types": "./build/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"prepublish": "rm -rf build && tsc",
|
|
9
|
+
"build": "tsc",
|
|
10
|
+
"clean": "rm -rf build node_modules"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"api",
|
|
14
|
+
"contracts",
|
|
15
|
+
"zod",
|
|
16
|
+
"types",
|
|
17
|
+
"veruna"
|
|
18
|
+
],
|
|
19
|
+
"author": "Veruna",
|
|
20
|
+
"license": "ISC",
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"zod": "^4.1.12"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"typescript": "^5.3.3"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"build"
|
|
29
|
+
],
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public"
|
|
32
|
+
}
|
|
33
|
+
}
|