@veruna/api-contracts 1.0.8 → 1.0.9
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/build/index.d.ts +4 -0
- package/build/locales/en.d.ts +31 -0
- package/build/locales/index.d.ts +66 -0
- package/build/locales/ru.d.ts +30 -0
- package/build/rest-api.d.ts +52 -0
- package/build/rest-api.js +15 -15
- package/build/shared/common-schemas.d.ts +12 -0
- package/build/shared/error-response.schema.d.ts +25 -0
- package/build/shared/http-method.d.ts +10 -0
- package/build/shared/index.d.ts +2 -0
- package/build/shared/pagination.schema.d.ts +35 -0
- package/build/shared/regex.d.ts +8 -0
- package/build/utils/index.d.ts +1 -0
- package/build/utils/path-builder.d.ts +20 -0
- package/build/v1/auth/auth.errors.d.ts +12 -0
- package/build/v1/auth/auth.paths.d.ts +17 -0
- package/build/v1/auth/auth.paths.js +2 -2
- package/build/v1/auth/auth.types.d.ts +8 -0
- package/build/v1/auth/commands/delete-session.command.d.ts +13 -0
- package/build/v1/auth/commands/index.d.ts +5 -0
- package/build/v1/auth/commands/index.js +1 -1
- package/build/v1/auth/commands/logout-all.command.d.ts +13 -0
- package/build/v1/auth/commands/logout.command.d.ts +13 -0
- package/build/v1/auth/commands/signin.command.d.ts +32 -0
- package/build/v1/auth/commands/signin.command.js +18 -0
- package/build/v1/auth/commands/signup.command.d.ts +34 -0
- package/build/v1/auth/controllers.d.ts +4 -0
- package/build/v1/auth/index.d.ts +8 -0
- package/build/v1/auth/queries/get-sessions.query.d.ts +20 -0
- package/build/v1/auth/queries/index.d.ts +1 -0
- package/build/v1/auth/routes/auth.routes.d.ts +12 -0
- package/build/v1/auth/routes/auth.routes.js +1 -1
- package/build/v1/auth/schemas/auth-response.schema.d.ts +36 -0
- package/build/v1/auth/schemas/index.d.ts +5 -0
- package/build/v1/auth/schemas/index.js +1 -1
- package/build/v1/auth/schemas/session-response.schema.d.ts +13 -0
- package/build/v1/auth/schemas/signin-request.schema.d.ts +9 -0
- package/build/v1/auth/schemas/{login-request.schema.js → signin-request.schema.js} +3 -3
- package/build/v1/auth/schemas/signup-request.schema.d.ts +11 -0
- package/build/v1/auth/schemas/signup-request.schema.js +1 -12
- package/build/v1/auth/schemas/user-role.enum.d.ts +7 -0
- package/build/v1/blog/admin/commands/create-category.command.d.ts +24 -0
- package/build/v1/blog/admin/commands/create-post.command.d.ts +43 -0
- package/build/v1/blog/admin/commands/delete-category.command.d.ts +11 -0
- package/build/v1/blog/admin/commands/delete-post.command.d.ts +11 -0
- package/build/v1/blog/admin/commands/index.d.ts +6 -0
- package/build/v1/blog/admin/commands/update-category.command.d.ts +24 -0
- package/build/v1/blog/admin/commands/update-post.command.d.ts +43 -0
- package/build/v1/blog/admin/queries/get-categories.query.d.ts +24 -0
- package/build/v1/blog/admin/queries/get-category.query.d.ts +19 -0
- package/build/v1/blog/admin/queries/get-post.query.d.ts +33 -0
- package/build/v1/blog/admin/queries/get-posts.query.d.ts +48 -0
- package/build/v1/blog/admin/queries/index.d.ts +4 -0
- package/build/v1/blog/blog.paths.d.ts +36 -0
- package/build/v1/blog/blog.types.d.ts +12 -0
- package/build/v1/blog/controllers.d.ts +7 -0
- package/build/v1/blog/index.d.ts +8 -0
- package/build/v1/blog/public/queries/get-categories.query.d.ts +21 -0
- package/build/v1/blog/public/queries/get-post-by-alias.query.d.ts +33 -0
- package/build/v1/blog/public/queries/get-posts.query.d.ts +47 -0
- package/build/v1/blog/public/queries/index.d.ts +3 -0
- package/build/v1/blog/routes/blog-admin-categories.routes.d.ts +11 -0
- package/build/v1/blog/routes/blog-admin-posts.routes.d.ts +10 -0
- package/build/v1/blog/routes/blog-public.routes.d.ts +10 -0
- package/build/v1/blog/routes/index.d.ts +3 -0
- package/build/v1/blog/schemas/blog-category-status.enum.d.ts +8 -0
- package/build/v1/blog/schemas/blog-post-status.enum.d.ts +8 -0
- package/build/v1/blog/schemas/category-response.schema.d.ts +14 -0
- package/build/v1/blog/schemas/create-category-request.schema.d.ts +8 -0
- package/build/v1/blog/schemas/create-post-request.schema.d.ts +13 -0
- package/build/v1/blog/schemas/get-posts-query.schema.d.ts +13 -0
- package/build/v1/blog/schemas/index.d.ts +9 -0
- package/build/v1/blog/schemas/post-response.schema.d.ts +28 -0
- package/build/v1/blog/schemas/update-category-request.schema.d.ts +8 -0
- package/build/v1/blog/schemas/update-post-request.schema.d.ts +13 -0
- package/build/v1/index.d.ts +2 -0
- package/build/v1/unregistered-users/commands/authenticate.command.d.ts +25 -0
- package/build/v1/unregistered-users/commands/index.d.ts +1 -0
- package/build/v1/unregistered-users/controllers.d.ts +4 -0
- package/build/v1/unregistered-users/index.d.ts +5 -0
- package/build/v1/unregistered-users/routes/unreg-users.routes.d.ts +6 -0
- package/build/v1/unregistered-users/schemas/authenticate-request.schema.d.ts +24 -0
- package/build/v1/unregistered-users/schemas/authenticate-request.schema.js +12 -1
- package/build/v1/unregistered-users/schemas/authenticate-response.schema.d.ts +11 -0
- package/build/v1/unregistered-users/schemas/index.d.ts +3 -0
- package/build/v1/unregistered-users/schemas/unreg-user-status.enum.d.ts +8 -0
- package/build/v1/unregistered-users/unregistered-users.errors.d.ts +15 -0
- package/build/v1/unregistered-users/unregistered-users.paths.d.ts +15 -0
- package/build/v1/unregistered-users/unregistered-users.types.d.ts +9 -0
- package/build/v1/users/commands/change-password.command.d.ts +17 -0
- package/build/v1/users/commands/change-password.command.js +7 -4
- package/build/v1/users/commands/delete-account.command.d.ts +13 -0
- package/build/v1/users/commands/delete-account.command.js +4 -2
- package/build/v1/users/commands/index.d.ts +4 -0
- package/build/v1/users/commands/toggle-marketing-consent.command.d.ts +20 -0
- package/build/v1/users/commands/toggle-marketing-consent.command.js +2 -2
- package/build/v1/users/commands/update-profile.command.d.ts +20 -0
- package/build/v1/users/commands/update-profile.command.js +2 -2
- package/build/v1/users/controllers.d.ts +4 -0
- package/build/v1/users/index.d.ts +7 -0
- package/build/v1/users/queries/get-current-user.query.d.ts +18 -0
- package/build/v1/users/queries/index.d.ts +1 -0
- package/build/v1/users/routes/users.routes.d.ts +9 -0
- package/build/v1/users/schemas/change-password-request.schema.d.ts +10 -0
- package/build/v1/users/schemas/delete-account-request.schema.d.ts +5 -0
- package/build/v1/users/schemas/index.d.ts +6 -0
- package/build/v1/users/schemas/response-unions.schema.d.ts +34 -0
- package/build/v1/users/schemas/response-unions.schema.js +6 -6
- package/build/v1/users/schemas/toggle-marketing-consent-request.schema.d.ts +7 -0
- package/build/v1/users/schemas/update-profile-request.schema.d.ts +8 -0
- package/build/v1/users/schemas/user-response.schema.d.ts +12 -0
- package/build/v1/users/users.paths.d.ts +11 -0
- package/build/v1/users/users.types.d.ts +11 -0
- package/package.json +1 -1
- package/build/v1/auth/commands/login.command.js +0 -18
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BlogCategoryStatus } from './blog-category-status.enum';
|
|
3
|
+
/**
|
|
4
|
+
* Category Response Schema
|
|
5
|
+
*/
|
|
6
|
+
export declare const CategoryResponseSchema: z.ZodObject<{
|
|
7
|
+
uuid: z.ZodString;
|
|
8
|
+
alias: z.ZodString;
|
|
9
|
+
title: z.ZodString;
|
|
10
|
+
order: z.ZodNumber;
|
|
11
|
+
status: z.ZodEnum<typeof BlogCategoryStatus>;
|
|
12
|
+
createdAt: z.ZodString;
|
|
13
|
+
updatedAt: z.ZodString;
|
|
14
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BlogCategoryStatus } from './blog-category-status.enum';
|
|
3
|
+
export declare const CreateCategoryRequestSchema: z.ZodObject<{
|
|
4
|
+
alias: z.ZodString;
|
|
5
|
+
title: z.ZodString;
|
|
6
|
+
order: z.ZodDefault<z.ZodNumber>;
|
|
7
|
+
status: z.ZodDefault<z.ZodEnum<typeof BlogCategoryStatus>>;
|
|
8
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BlogPostStatus } from './blog-post-status.enum';
|
|
3
|
+
export declare const CreatePostRequestSchema: z.ZodObject<{
|
|
4
|
+
alias: z.ZodString;
|
|
5
|
+
title: z.ZodString;
|
|
6
|
+
metaTitle: z.ZodString;
|
|
7
|
+
metaDescription: z.ZodString;
|
|
8
|
+
content: z.ZodString;
|
|
9
|
+
image: z.ZodString;
|
|
10
|
+
author: z.ZodString;
|
|
11
|
+
categoryIds: z.ZodArray<z.ZodString>;
|
|
12
|
+
status: z.ZodDefault<z.ZodEnum<typeof BlogPostStatus>>;
|
|
13
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BlogPostStatus } from './blog-post-status.enum';
|
|
3
|
+
export declare const GetPostsQueryAdminSchema: z.ZodObject<{
|
|
4
|
+
page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
5
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
6
|
+
status: z.ZodOptional<z.ZodEnum<typeof BlogPostStatus>>;
|
|
7
|
+
categoryAliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export declare const GetPostsQueryPublicSchema: z.ZodObject<{
|
|
10
|
+
page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
11
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
12
|
+
categoryAliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
13
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './blog-category-status.enum';
|
|
2
|
+
export * from './blog-post-status.enum';
|
|
3
|
+
export * from './category-response.schema';
|
|
4
|
+
export * from './create-category-request.schema';
|
|
5
|
+
export * from './update-category-request.schema';
|
|
6
|
+
export * from './post-response.schema';
|
|
7
|
+
export * from './create-post-request.schema';
|
|
8
|
+
export * from './update-post-request.schema';
|
|
9
|
+
export * from './get-posts-query.schema';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BlogPostStatus } from './blog-post-status.enum';
|
|
3
|
+
/**
|
|
4
|
+
* Post Response Schema
|
|
5
|
+
*/
|
|
6
|
+
export declare const PostResponseSchema: z.ZodObject<{
|
|
7
|
+
uuid: z.ZodString;
|
|
8
|
+
alias: z.ZodString;
|
|
9
|
+
title: z.ZodString;
|
|
10
|
+
metaTitle: z.ZodString;
|
|
11
|
+
metaDescription: z.ZodString;
|
|
12
|
+
content: z.ZodString;
|
|
13
|
+
image: z.ZodString;
|
|
14
|
+
author: z.ZodString;
|
|
15
|
+
categories: z.ZodArray<z.ZodObject<{
|
|
16
|
+
uuid: z.ZodString;
|
|
17
|
+
alias: z.ZodString;
|
|
18
|
+
title: z.ZodString;
|
|
19
|
+
order: z.ZodNumber;
|
|
20
|
+
status: z.ZodEnum<typeof import("./blog-category-status.enum").BlogCategoryStatus>;
|
|
21
|
+
createdAt: z.ZodString;
|
|
22
|
+
updatedAt: z.ZodString;
|
|
23
|
+
}, z.core.$strip>>;
|
|
24
|
+
viewsCount: z.ZodNumber;
|
|
25
|
+
status: z.ZodEnum<typeof BlogPostStatus>;
|
|
26
|
+
createdAt: z.ZodString;
|
|
27
|
+
updatedAt: z.ZodString;
|
|
28
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BlogCategoryStatus } from './blog-category-status.enum';
|
|
3
|
+
export declare const UpdateCategoryRequestSchema: z.ZodObject<{
|
|
4
|
+
alias: z.ZodOptional<z.ZodString>;
|
|
5
|
+
title: z.ZodOptional<z.ZodString>;
|
|
6
|
+
order: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
status: z.ZodOptional<z.ZodEnum<typeof BlogCategoryStatus>>;
|
|
8
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BlogPostStatus } from './blog-post-status.enum';
|
|
3
|
+
export declare const UpdatePostRequestSchema: z.ZodObject<{
|
|
4
|
+
alias: z.ZodOptional<z.ZodString>;
|
|
5
|
+
title: z.ZodOptional<z.ZodString>;
|
|
6
|
+
metaTitle: z.ZodOptional<z.ZodString>;
|
|
7
|
+
metaDescription: z.ZodOptional<z.ZodString>;
|
|
8
|
+
content: z.ZodOptional<z.ZodString>;
|
|
9
|
+
image: z.ZodOptional<z.ZodString>;
|
|
10
|
+
author: z.ZodOptional<z.ZodString>;
|
|
11
|
+
categoryIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
12
|
+
status: z.ZodOptional<z.ZodEnum<typeof BlogPostStatus>>;
|
|
13
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { HttpMethod } from '../../../shared/http-method';
|
|
3
|
+
export declare namespace UnregAuthenticateCommand {
|
|
4
|
+
const Request: z.ZodObject<{
|
|
5
|
+
token: z.ZodOptional<z.ZodString>;
|
|
6
|
+
utm: z.ZodOptional<z.ZodObject<{
|
|
7
|
+
utmSource: z.ZodOptional<z.ZodString>;
|
|
8
|
+
utmMedium: z.ZodOptional<z.ZodString>;
|
|
9
|
+
utmCampaign: z.ZodOptional<z.ZodString>;
|
|
10
|
+
utmContent: z.ZodOptional<z.ZodString>;
|
|
11
|
+
utmTerm: z.ZodOptional<z.ZodString>;
|
|
12
|
+
}, z.core.$strip>>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
const Response: z.ZodObject<{
|
|
15
|
+
token: z.ZodString;
|
|
16
|
+
requests: z.ZodNumber;
|
|
17
|
+
nextResetAt: z.ZodString;
|
|
18
|
+
status: z.ZodEnum<typeof import("../schemas").UnregUserStatus>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
const PATH: "";
|
|
21
|
+
const URL: "/api/v1/unreg/";
|
|
22
|
+
const METHOD = HttpMethod.PUT;
|
|
23
|
+
type RequestType = z.infer<typeof Request>;
|
|
24
|
+
type ResponseType = z.infer<typeof Response>;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './authenticate.command';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* UTM Schema
|
|
4
|
+
*/
|
|
5
|
+
export declare const UtmSchema: z.ZodObject<{
|
|
6
|
+
utmSource: z.ZodOptional<z.ZodString>;
|
|
7
|
+
utmMedium: z.ZodOptional<z.ZodString>;
|
|
8
|
+
utmCampaign: z.ZodOptional<z.ZodString>;
|
|
9
|
+
utmContent: z.ZodOptional<z.ZodString>;
|
|
10
|
+
utmTerm: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
/**
|
|
13
|
+
* Authenticate Unregistered User Request Schema
|
|
14
|
+
*/
|
|
15
|
+
export declare const AuthenticateUnregUserRequestSchema: z.ZodObject<{
|
|
16
|
+
token: z.ZodOptional<z.ZodString>;
|
|
17
|
+
utm: z.ZodOptional<z.ZodObject<{
|
|
18
|
+
utmSource: z.ZodOptional<z.ZodString>;
|
|
19
|
+
utmMedium: z.ZodOptional<z.ZodString>;
|
|
20
|
+
utmCampaign: z.ZodOptional<z.ZodString>;
|
|
21
|
+
utmContent: z.ZodOptional<z.ZodString>;
|
|
22
|
+
utmTerm: z.ZodOptional<z.ZodString>;
|
|
23
|
+
}, z.core.$strip>>;
|
|
24
|
+
}, z.core.$strip>;
|
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AuthenticateUnregUserRequestSchema = void 0;
|
|
3
|
+
exports.AuthenticateUnregUserRequestSchema = exports.UtmSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* UTM Schema
|
|
7
|
+
*/
|
|
8
|
+
exports.UtmSchema = zod_1.z.object({
|
|
9
|
+
utmSource: zod_1.z.string().optional(),
|
|
10
|
+
utmMedium: zod_1.z.string().optional(),
|
|
11
|
+
utmCampaign: zod_1.z.string().optional(),
|
|
12
|
+
utmContent: zod_1.z.string().optional(),
|
|
13
|
+
utmTerm: zod_1.z.string().optional(),
|
|
14
|
+
});
|
|
5
15
|
/**
|
|
6
16
|
* Authenticate Unregistered User Request Schema
|
|
7
17
|
*/
|
|
8
18
|
exports.AuthenticateUnregUserRequestSchema = zod_1.z.object({
|
|
9
19
|
token: zod_1.z.string().optional(),
|
|
20
|
+
utm: exports.UtmSchema.optional(),
|
|
10
21
|
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { UnregUserStatus } from './unreg-user-status.enum';
|
|
3
|
+
/**
|
|
4
|
+
* Authenticate Unregistered User Response Schema
|
|
5
|
+
*/
|
|
6
|
+
export declare const AuthenticateUnregUserResponseSchema: z.ZodObject<{
|
|
7
|
+
token: z.ZodString;
|
|
8
|
+
requests: z.ZodNumber;
|
|
9
|
+
nextResetAt: z.ZodString;
|
|
10
|
+
status: z.ZodEnum<typeof UnregUserStatus>;
|
|
11
|
+
}, z.core.$strip>;
|
|
@@ -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,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,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AuthenticateUnregUserRequestSchema, AuthenticateUnregUserResponseSchema } from './schemas';
|
|
3
|
+
export { UnregUserStatus } from './schemas/unreg-user-status.enum';
|
|
4
|
+
export { UnregUserStatus as UnregUserStatusContract } from './schemas/unreg-user-status.enum';
|
|
5
|
+
/**
|
|
6
|
+
* Request/Response Types
|
|
7
|
+
*/
|
|
8
|
+
export type AuthenticateUnregUserRequest = z.infer<typeof AuthenticateUnregUserRequestSchema>;
|
|
9
|
+
export type AuthenticateUnregUserResponse = z.infer<typeof AuthenticateUnregUserResponseSchema>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { HttpMethod } from '../../../shared/http-method';
|
|
3
|
+
export declare namespace UserChangePasswordCommand {
|
|
4
|
+
const Request: z.ZodObject<{
|
|
5
|
+
oldPassword: z.ZodString;
|
|
6
|
+
newPassword: z.ZodString;
|
|
7
|
+
logoutFromAllDevices: z.ZodDefault<z.ZodBoolean>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
const Response: z.ZodObject<{
|
|
10
|
+
userId: z.ZodString;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
const PATH: "me/password";
|
|
13
|
+
const URL: "/api/v1/users/me/password";
|
|
14
|
+
const METHOD = HttpMethod.PUT;
|
|
15
|
+
type RequestType = z.infer<typeof Request>;
|
|
16
|
+
type ResponseType = z.infer<typeof Response>;
|
|
17
|
+
}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UserChangePasswordCommand = void 0;
|
|
4
|
-
const
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const schemas_1 = require("../schemas");
|
|
5
6
|
const users_routes_1 = require("../routes/users.routes");
|
|
6
7
|
const rest_api_1 = require("../../../rest-api");
|
|
7
8
|
const http_method_1 = require("../../../shared/http-method");
|
|
8
|
-
const
|
|
9
|
+
const regex_1 = require("../../../shared/regex");
|
|
9
10
|
var UserChangePasswordCommand;
|
|
10
11
|
(function (UserChangePasswordCommand) {
|
|
11
|
-
UserChangePasswordCommand.Request =
|
|
12
|
-
UserChangePasswordCommand.Response =
|
|
12
|
+
UserChangePasswordCommand.Request = schemas_1.ChangePasswordRequestSchema;
|
|
13
|
+
UserChangePasswordCommand.Response = zod_1.z.object({
|
|
14
|
+
userId: zod_1.z.string().regex(regex_1.UUID_REGEX),
|
|
15
|
+
});
|
|
13
16
|
UserChangePasswordCommand.PATH = users_routes_1.USERS_ROUTES.ME_PASSWORD;
|
|
14
17
|
UserChangePasswordCommand.URL = rest_api_1.REST_API.V1.USERS.ME_PASSWORD;
|
|
15
18
|
UserChangePasswordCommand.METHOD = http_method_1.HttpMethod.PUT;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { HttpMethod } from '../../../shared/http-method';
|
|
3
|
+
export declare namespace UserDeleteAccountCommand {
|
|
4
|
+
const Request: z.ZodObject<{}, z.core.$strip>;
|
|
5
|
+
const Response: z.ZodObject<{
|
|
6
|
+
userId: z.ZodString;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
const PATH: "me";
|
|
9
|
+
const URL: "/api/v1/users/me";
|
|
10
|
+
const METHOD = HttpMethod.DELETE;
|
|
11
|
+
type RequestType = z.infer<typeof Request>;
|
|
12
|
+
type ResponseType = z.infer<typeof Response>;
|
|
13
|
+
}
|
|
@@ -5,11 +5,13 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const users_routes_1 = require("../routes/users.routes");
|
|
6
6
|
const rest_api_1 = require("../../../rest-api");
|
|
7
7
|
const http_method_1 = require("../../../shared/http-method");
|
|
8
|
-
const
|
|
8
|
+
const regex_1 = require("../../../shared/regex");
|
|
9
9
|
var UserDeleteAccountCommand;
|
|
10
10
|
(function (UserDeleteAccountCommand) {
|
|
11
11
|
UserDeleteAccountCommand.Request = zod_1.z.object({});
|
|
12
|
-
UserDeleteAccountCommand.Response =
|
|
12
|
+
UserDeleteAccountCommand.Response = zod_1.z.object({
|
|
13
|
+
userId: zod_1.z.string().regex(regex_1.UUID_REGEX),
|
|
14
|
+
});
|
|
13
15
|
UserDeleteAccountCommand.PATH = users_routes_1.USERS_ROUTES.ME;
|
|
14
16
|
UserDeleteAccountCommand.URL = rest_api_1.REST_API.V1.USERS.ME;
|
|
15
17
|
UserDeleteAccountCommand.METHOD = http_method_1.HttpMethod.DELETE;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { HttpMethod } from '../../../shared/http-method';
|
|
3
|
+
export declare namespace UserToggleMarketingConsentCommand {
|
|
4
|
+
const Request: z.ZodObject<{
|
|
5
|
+
marketingConsent: z.ZodBoolean;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
const Response: z.ZodObject<{
|
|
8
|
+
uuid: z.ZodString;
|
|
9
|
+
email: z.ZodString;
|
|
10
|
+
name: z.ZodString;
|
|
11
|
+
role: z.ZodString;
|
|
12
|
+
marketingConsent: z.ZodBoolean;
|
|
13
|
+
createdAt: z.ZodString;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
const PATH: "me/marketing-consent";
|
|
16
|
+
const URL: "/api/v1/users/me/marketing-consent";
|
|
17
|
+
const METHOD = HttpMethod.PUT;
|
|
18
|
+
type RequestType = z.infer<typeof Request>;
|
|
19
|
+
type ResponseType = z.infer<typeof Response>;
|
|
20
|
+
}
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UserToggleMarketingConsentCommand = void 0;
|
|
4
4
|
const toggle_marketing_consent_request_schema_1 = require("../schemas/toggle-marketing-consent-request.schema");
|
|
5
|
+
const user_response_schema_1 = require("../schemas/user-response.schema");
|
|
5
6
|
const users_routes_1 = require("../routes/users.routes");
|
|
6
7
|
const rest_api_1 = require("../../../rest-api");
|
|
7
8
|
const http_method_1 = require("../../../shared/http-method");
|
|
8
|
-
const common_schemas_1 = require("../../../shared/common-schemas");
|
|
9
9
|
var UserToggleMarketingConsentCommand;
|
|
10
10
|
(function (UserToggleMarketingConsentCommand) {
|
|
11
11
|
UserToggleMarketingConsentCommand.Request = toggle_marketing_consent_request_schema_1.ToggleMarketingConsentRequestSchema;
|
|
12
|
-
UserToggleMarketingConsentCommand.Response =
|
|
12
|
+
UserToggleMarketingConsentCommand.Response = user_response_schema_1.UserResponseSchema;
|
|
13
13
|
UserToggleMarketingConsentCommand.PATH = users_routes_1.USERS_ROUTES.ME_MARKETING_CONSENT;
|
|
14
14
|
UserToggleMarketingConsentCommand.URL = rest_api_1.REST_API.V1.USERS.ME_MARKETING_CONSENT;
|
|
15
15
|
UserToggleMarketingConsentCommand.METHOD = http_method_1.HttpMethod.PUT;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { HttpMethod } from '../../../shared/http-method';
|
|
3
|
+
export declare namespace UserUpdateProfileCommand {
|
|
4
|
+
const Request: z.ZodObject<{
|
|
5
|
+
name: z.ZodString;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
const Response: z.ZodObject<{
|
|
8
|
+
uuid: z.ZodString;
|
|
9
|
+
email: z.ZodString;
|
|
10
|
+
name: z.ZodString;
|
|
11
|
+
role: z.ZodString;
|
|
12
|
+
marketingConsent: z.ZodBoolean;
|
|
13
|
+
createdAt: z.ZodString;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
const PATH: "me";
|
|
16
|
+
const URL: "/api/v1/users/me";
|
|
17
|
+
const METHOD = HttpMethod.PATCH;
|
|
18
|
+
type RequestType = z.infer<typeof Request>;
|
|
19
|
+
type ResponseType = z.infer<typeof Response>;
|
|
20
|
+
}
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UserUpdateProfileCommand = void 0;
|
|
4
4
|
const update_profile_request_schema_1 = require("../schemas/update-profile-request.schema");
|
|
5
|
+
const user_response_schema_1 = require("../schemas/user-response.schema");
|
|
5
6
|
const users_routes_1 = require("../routes/users.routes");
|
|
6
7
|
const rest_api_1 = require("../../../rest-api");
|
|
7
8
|
const http_method_1 = require("../../../shared/http-method");
|
|
8
|
-
const common_schemas_1 = require("../../../shared/common-schemas");
|
|
9
9
|
var UserUpdateProfileCommand;
|
|
10
10
|
(function (UserUpdateProfileCommand) {
|
|
11
11
|
UserUpdateProfileCommand.Request = update_profile_request_schema_1.UpdateProfileRequestSchema;
|
|
12
|
-
UserUpdateProfileCommand.Response =
|
|
12
|
+
UserUpdateProfileCommand.Response = user_response_schema_1.UserResponseSchema;
|
|
13
13
|
UserUpdateProfileCommand.PATH = users_routes_1.USERS_ROUTES.ME;
|
|
14
14
|
UserUpdateProfileCommand.URL = rest_api_1.REST_API.V1.USERS.ME;
|
|
15
15
|
UserUpdateProfileCommand.METHOD = http_method_1.HttpMethod.PATCH;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { HttpMethod } from '../../../shared/http-method';
|
|
3
|
+
export declare namespace UserGetCurrentUserQuery {
|
|
4
|
+
const Request: z.ZodObject<{}, z.core.$strip>;
|
|
5
|
+
const Response: z.ZodObject<{
|
|
6
|
+
uuid: z.ZodString;
|
|
7
|
+
email: z.ZodString;
|
|
8
|
+
name: z.ZodString;
|
|
9
|
+
role: z.ZodString;
|
|
10
|
+
marketingConsent: z.ZodBoolean;
|
|
11
|
+
createdAt: z.ZodString;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
const PATH: "me";
|
|
14
|
+
const URL: "/api/v1/users/me";
|
|
15
|
+
const METHOD = HttpMethod.GET;
|
|
16
|
+
type RequestType = z.infer<typeof Request>;
|
|
17
|
+
type ResponseType = z.infer<typeof Response>;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './get-current-user.query';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Change Password Request Schema
|
|
4
|
+
* Error messages are in locales (en.ts, ru.ts)
|
|
5
|
+
*/
|
|
6
|
+
export declare const ChangePasswordRequestSchema: z.ZodObject<{
|
|
7
|
+
oldPassword: z.ZodString;
|
|
8
|
+
newPassword: z.ZodString;
|
|
9
|
+
logoutFromAllDevices: z.ZodDefault<z.ZodBoolean>;
|
|
10
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './user-response.schema';
|
|
2
|
+
export * from './update-profile-request.schema';
|
|
3
|
+
export * from './change-password-request.schema';
|
|
4
|
+
export * from './toggle-marketing-consent-request.schema';
|
|
5
|
+
export * from './delete-account-request.schema';
|
|
6
|
+
export * from './response-unions.schema';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Endpoint Response Unions (for frontend type safety)
|
|
4
|
+
*/
|
|
5
|
+
export declare const UpdateProfileResponseSchema: z.ZodObject<{
|
|
6
|
+
uuid: z.ZodString;
|
|
7
|
+
email: z.ZodString;
|
|
8
|
+
name: z.ZodString;
|
|
9
|
+
role: z.ZodString;
|
|
10
|
+
marketingConsent: z.ZodBoolean;
|
|
11
|
+
createdAt: z.ZodString;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
export declare const DeleteAccountResponseSchema: z.ZodObject<{
|
|
14
|
+
userId: z.ZodString;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
export declare const ToggleMarketingConsentResponseSchema: z.ZodObject<{
|
|
17
|
+
uuid: z.ZodString;
|
|
18
|
+
email: z.ZodString;
|
|
19
|
+
name: z.ZodString;
|
|
20
|
+
role: z.ZodString;
|
|
21
|
+
marketingConsent: z.ZodBoolean;
|
|
22
|
+
createdAt: z.ZodString;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
export declare const ChangePasswordResponseSchema: z.ZodObject<{
|
|
25
|
+
userId: z.ZodString;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export declare const GetCurrentUserResponseSchema: z.ZodObject<{
|
|
28
|
+
uuid: z.ZodString;
|
|
29
|
+
email: z.ZodString;
|
|
30
|
+
name: z.ZodString;
|
|
31
|
+
role: z.ZodString;
|
|
32
|
+
marketingConsent: z.ZodBoolean;
|
|
33
|
+
createdAt: z.ZodString;
|
|
34
|
+
}, z.core.$strip>;
|
|
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.GetCurrentUserResponseSchema = exports.ChangePasswordResponseSchema = exports.ToggleMarketingConsentResponseSchema = exports.DeleteAccountResponseSchema = exports.UpdateProfileResponseSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const user_response_schema_1 = require("./user-response.schema");
|
|
6
|
-
const
|
|
6
|
+
const regex_1 = require("../../../shared/regex");
|
|
7
7
|
/**
|
|
8
8
|
* Endpoint Response Unions (for frontend type safety)
|
|
9
9
|
*/
|
|
10
|
-
exports.UpdateProfileResponseSchema =
|
|
11
|
-
exports.DeleteAccountResponseSchema = zod_1.z.
|
|
12
|
-
exports.ToggleMarketingConsentResponseSchema =
|
|
13
|
-
exports.ChangePasswordResponseSchema = zod_1.z.
|
|
14
|
-
exports.GetCurrentUserResponseSchema =
|
|
10
|
+
exports.UpdateProfileResponseSchema = user_response_schema_1.UserResponseSchema;
|
|
11
|
+
exports.DeleteAccountResponseSchema = zod_1.z.object({ userId: zod_1.z.string().regex(regex_1.UUID_REGEX) });
|
|
12
|
+
exports.ToggleMarketingConsentResponseSchema = user_response_schema_1.UserResponseSchema;
|
|
13
|
+
exports.ChangePasswordResponseSchema = zod_1.z.object({ userId: zod_1.z.string().regex(regex_1.UUID_REGEX) });
|
|
14
|
+
exports.GetCurrentUserResponseSchema = user_response_schema_1.UserResponseSchema;
|