@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.
Files changed (115) hide show
  1. package/build/index.d.ts +4 -0
  2. package/build/locales/en.d.ts +31 -0
  3. package/build/locales/index.d.ts +66 -0
  4. package/build/locales/ru.d.ts +30 -0
  5. package/build/rest-api.d.ts +52 -0
  6. package/build/rest-api.js +15 -15
  7. package/build/shared/common-schemas.d.ts +12 -0
  8. package/build/shared/error-response.schema.d.ts +25 -0
  9. package/build/shared/http-method.d.ts +10 -0
  10. package/build/shared/index.d.ts +2 -0
  11. package/build/shared/pagination.schema.d.ts +35 -0
  12. package/build/shared/regex.d.ts +8 -0
  13. package/build/utils/index.d.ts +1 -0
  14. package/build/utils/path-builder.d.ts +20 -0
  15. package/build/v1/auth/auth.errors.d.ts +12 -0
  16. package/build/v1/auth/auth.paths.d.ts +17 -0
  17. package/build/v1/auth/auth.paths.js +2 -2
  18. package/build/v1/auth/auth.types.d.ts +8 -0
  19. package/build/v1/auth/commands/delete-session.command.d.ts +13 -0
  20. package/build/v1/auth/commands/index.d.ts +5 -0
  21. package/build/v1/auth/commands/index.js +1 -1
  22. package/build/v1/auth/commands/logout-all.command.d.ts +13 -0
  23. package/build/v1/auth/commands/logout.command.d.ts +13 -0
  24. package/build/v1/auth/commands/signin.command.d.ts +32 -0
  25. package/build/v1/auth/commands/signin.command.js +18 -0
  26. package/build/v1/auth/commands/signup.command.d.ts +34 -0
  27. package/build/v1/auth/controllers.d.ts +4 -0
  28. package/build/v1/auth/index.d.ts +8 -0
  29. package/build/v1/auth/queries/get-sessions.query.d.ts +20 -0
  30. package/build/v1/auth/queries/index.d.ts +1 -0
  31. package/build/v1/auth/routes/auth.routes.d.ts +12 -0
  32. package/build/v1/auth/routes/auth.routes.js +1 -1
  33. package/build/v1/auth/schemas/auth-response.schema.d.ts +36 -0
  34. package/build/v1/auth/schemas/index.d.ts +5 -0
  35. package/build/v1/auth/schemas/index.js +1 -1
  36. package/build/v1/auth/schemas/session-response.schema.d.ts +13 -0
  37. package/build/v1/auth/schemas/signin-request.schema.d.ts +9 -0
  38. package/build/v1/auth/schemas/{login-request.schema.js → signin-request.schema.js} +3 -3
  39. package/build/v1/auth/schemas/signup-request.schema.d.ts +11 -0
  40. package/build/v1/auth/schemas/signup-request.schema.js +1 -12
  41. package/build/v1/auth/schemas/user-role.enum.d.ts +7 -0
  42. package/build/v1/blog/admin/commands/create-category.command.d.ts +24 -0
  43. package/build/v1/blog/admin/commands/create-post.command.d.ts +43 -0
  44. package/build/v1/blog/admin/commands/delete-category.command.d.ts +11 -0
  45. package/build/v1/blog/admin/commands/delete-post.command.d.ts +11 -0
  46. package/build/v1/blog/admin/commands/index.d.ts +6 -0
  47. package/build/v1/blog/admin/commands/update-category.command.d.ts +24 -0
  48. package/build/v1/blog/admin/commands/update-post.command.d.ts +43 -0
  49. package/build/v1/blog/admin/queries/get-categories.query.d.ts +24 -0
  50. package/build/v1/blog/admin/queries/get-category.query.d.ts +19 -0
  51. package/build/v1/blog/admin/queries/get-post.query.d.ts +33 -0
  52. package/build/v1/blog/admin/queries/get-posts.query.d.ts +48 -0
  53. package/build/v1/blog/admin/queries/index.d.ts +4 -0
  54. package/build/v1/blog/blog.paths.d.ts +36 -0
  55. package/build/v1/blog/blog.types.d.ts +12 -0
  56. package/build/v1/blog/controllers.d.ts +7 -0
  57. package/build/v1/blog/index.d.ts +8 -0
  58. package/build/v1/blog/public/queries/get-categories.query.d.ts +21 -0
  59. package/build/v1/blog/public/queries/get-post-by-alias.query.d.ts +33 -0
  60. package/build/v1/blog/public/queries/get-posts.query.d.ts +47 -0
  61. package/build/v1/blog/public/queries/index.d.ts +3 -0
  62. package/build/v1/blog/routes/blog-admin-categories.routes.d.ts +11 -0
  63. package/build/v1/blog/routes/blog-admin-posts.routes.d.ts +10 -0
  64. package/build/v1/blog/routes/blog-public.routes.d.ts +10 -0
  65. package/build/v1/blog/routes/index.d.ts +3 -0
  66. package/build/v1/blog/schemas/blog-category-status.enum.d.ts +8 -0
  67. package/build/v1/blog/schemas/blog-post-status.enum.d.ts +8 -0
  68. package/build/v1/blog/schemas/category-response.schema.d.ts +14 -0
  69. package/build/v1/blog/schemas/create-category-request.schema.d.ts +8 -0
  70. package/build/v1/blog/schemas/create-post-request.schema.d.ts +13 -0
  71. package/build/v1/blog/schemas/get-posts-query.schema.d.ts +13 -0
  72. package/build/v1/blog/schemas/index.d.ts +9 -0
  73. package/build/v1/blog/schemas/post-response.schema.d.ts +28 -0
  74. package/build/v1/blog/schemas/update-category-request.schema.d.ts +8 -0
  75. package/build/v1/blog/schemas/update-post-request.schema.d.ts +13 -0
  76. package/build/v1/index.d.ts +2 -0
  77. package/build/v1/unregistered-users/commands/authenticate.command.d.ts +25 -0
  78. package/build/v1/unregistered-users/commands/index.d.ts +1 -0
  79. package/build/v1/unregistered-users/controllers.d.ts +4 -0
  80. package/build/v1/unregistered-users/index.d.ts +5 -0
  81. package/build/v1/unregistered-users/routes/unreg-users.routes.d.ts +6 -0
  82. package/build/v1/unregistered-users/schemas/authenticate-request.schema.d.ts +24 -0
  83. package/build/v1/unregistered-users/schemas/authenticate-request.schema.js +12 -1
  84. package/build/v1/unregistered-users/schemas/authenticate-response.schema.d.ts +11 -0
  85. package/build/v1/unregistered-users/schemas/index.d.ts +3 -0
  86. package/build/v1/unregistered-users/schemas/unreg-user-status.enum.d.ts +8 -0
  87. package/build/v1/unregistered-users/unregistered-users.errors.d.ts +15 -0
  88. package/build/v1/unregistered-users/unregistered-users.paths.d.ts +15 -0
  89. package/build/v1/unregistered-users/unregistered-users.types.d.ts +9 -0
  90. package/build/v1/users/commands/change-password.command.d.ts +17 -0
  91. package/build/v1/users/commands/change-password.command.js +7 -4
  92. package/build/v1/users/commands/delete-account.command.d.ts +13 -0
  93. package/build/v1/users/commands/delete-account.command.js +4 -2
  94. package/build/v1/users/commands/index.d.ts +4 -0
  95. package/build/v1/users/commands/toggle-marketing-consent.command.d.ts +20 -0
  96. package/build/v1/users/commands/toggle-marketing-consent.command.js +2 -2
  97. package/build/v1/users/commands/update-profile.command.d.ts +20 -0
  98. package/build/v1/users/commands/update-profile.command.js +2 -2
  99. package/build/v1/users/controllers.d.ts +4 -0
  100. package/build/v1/users/index.d.ts +7 -0
  101. package/build/v1/users/queries/get-current-user.query.d.ts +18 -0
  102. package/build/v1/users/queries/index.d.ts +1 -0
  103. package/build/v1/users/routes/users.routes.d.ts +9 -0
  104. package/build/v1/users/schemas/change-password-request.schema.d.ts +10 -0
  105. package/build/v1/users/schemas/delete-account-request.schema.d.ts +5 -0
  106. package/build/v1/users/schemas/index.d.ts +6 -0
  107. package/build/v1/users/schemas/response-unions.schema.d.ts +34 -0
  108. package/build/v1/users/schemas/response-unions.schema.js +6 -6
  109. package/build/v1/users/schemas/toggle-marketing-consent-request.schema.d.ts +7 -0
  110. package/build/v1/users/schemas/update-profile-request.schema.d.ts +8 -0
  111. package/build/v1/users/schemas/user-response.schema.d.ts +12 -0
  112. package/build/v1/users/users.paths.d.ts +11 -0
  113. package/build/v1/users/users.types.d.ts +11 -0
  114. package/package.json +1 -1
  115. package/build/v1/auth/commands/login.command.js +0 -18
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Blog Public Routes
3
+ */
4
+ export declare const BLOG_PUBLIC_CATEGORIES_ROUTES: {
5
+ readonly GET_ALL: "";
6
+ };
7
+ export declare const BLOG_PUBLIC_POSTS_ROUTES: {
8
+ readonly GET_ALL: "";
9
+ readonly GET_BY_ALIAS: ":alias";
10
+ };
@@ -0,0 +1,3 @@
1
+ export * from './blog-admin-categories.routes';
2
+ export * from './blog-admin-posts.routes';
3
+ export * from './blog-public.routes';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Blog Category Status
3
+ */
4
+ export declare enum BlogCategoryStatus {
5
+ DRAFT = "draft",
6
+ PUBLISHED = "published",
7
+ ARCHIVED = "archived"
8
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Blog Post Status
3
+ */
4
+ export declare enum BlogPostStatus {
5
+ DRAFT = "draft",
6
+ PUBLISHED = "published",
7
+ ARCHIVED = "archived"
8
+ }
@@ -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,2 @@
1
+ export * from './auth';
2
+ export * from './unregistered-users';
@@ -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,4 @@
1
+ /**
2
+ * Unregistered Users Controller path
3
+ */
4
+ export declare const UNREG_USERS_CONTROLLER: "v1/unreg";
@@ -0,0 +1,5 @@
1
+ export * from './schemas';
2
+ export * from './unregistered-users.types';
3
+ export * from './unregistered-users.paths';
4
+ export * from './unregistered-users.errors';
5
+ export * from './commands';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Unregistered Users Routes
3
+ */
4
+ export declare const UNREG_USERS_ROUTES: {
5
+ readonly AUTHENTICATE: "";
6
+ };
@@ -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,3 @@
1
+ export * from './unreg-user-status.enum';
2
+ export * from './authenticate-request.schema';
3
+ export * from './authenticate-response.schema';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Unregistered User Status
3
+ */
4
+ export declare enum UnregUserStatus {
5
+ ACTIVE = "active",
6
+ FRAUD = "fraud",
7
+ MIGRATED = "migrated"
8
+ }
@@ -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 change_password_request_schema_1 = require("../schemas/change-password-request.schema");
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 common_schemas_1 = require("../../../shared/common-schemas");
9
+ const regex_1 = require("../../../shared/regex");
9
10
  var UserChangePasswordCommand;
10
11
  (function (UserChangePasswordCommand) {
11
- UserChangePasswordCommand.Request = change_password_request_schema_1.ChangePasswordRequestSchema;
12
- UserChangePasswordCommand.Response = common_schemas_1.EmptyResponseSchema;
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 common_schemas_1 = require("../../../shared/common-schemas");
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 = common_schemas_1.EmptyResponseSchema;
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,4 @@
1
+ export * from './update-profile.command';
2
+ export * from './change-password.command';
3
+ export * from './toggle-marketing-consent.command';
4
+ export * from './delete-account.command';
@@ -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 = common_schemas_1.EmptyResponseSchema;
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 = common_schemas_1.EmptyResponseSchema;
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,4 @@
1
+ /**
2
+ * Users Controller paths for NestJS @Controller decorator
3
+ */
4
+ export declare const USERS_CONTROLLER: "v1/users";
@@ -0,0 +1,7 @@
1
+ export * from './schemas';
2
+ export * from './users.types';
3
+ export * from './users.paths';
4
+ export * from './controllers';
5
+ export * from './routes/users.routes';
6
+ export * from './commands';
7
+ export * from './queries';
@@ -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,9 @@
1
+ /**
2
+ * Users Routes
3
+ * For NestJS method decorators
4
+ */
5
+ export declare const USERS_ROUTES: {
6
+ readonly ME: "me";
7
+ readonly ME_MARKETING_CONSENT: "me/marketing-consent";
8
+ readonly ME_PASSWORD: "me/password";
9
+ };
@@ -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,5 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Delete Account Request Schema (empty - no body)
4
+ */
5
+ export declare const DeleteAccountRequestSchema: z.ZodObject<{}, 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 common_schemas_1 = require("../../../shared/common-schemas");
6
+ const regex_1 = require("../../../shared/regex");
7
7
  /**
8
8
  * Endpoint Response Unions (for frontend type safety)
9
9
  */
10
- exports.UpdateProfileResponseSchema = zod_1.z.union([common_schemas_1.EmptyResponseSchema, common_schemas_1.ErrorResponseSchema]);
11
- exports.DeleteAccountResponseSchema = zod_1.z.union([common_schemas_1.EmptyResponseSchema, common_schemas_1.ErrorResponseSchema]);
12
- exports.ToggleMarketingConsentResponseSchema = zod_1.z.union([common_schemas_1.EmptyResponseSchema, common_schemas_1.ErrorResponseSchema]);
13
- exports.ChangePasswordResponseSchema = zod_1.z.union([common_schemas_1.EmptyResponseSchema, common_schemas_1.ErrorResponseSchema]);
14
- exports.GetCurrentUserResponseSchema = zod_1.z.union([user_response_schema_1.UserResponseSchema, common_schemas_1.ErrorResponseSchema]);
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;
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Toggle Marketing Consent Request Schema
4
+ */
5
+ export declare const ToggleMarketingConsentRequestSchema: z.ZodObject<{
6
+ marketingConsent: z.ZodBoolean;
7
+ }, z.core.$strip>;