@veruna/api-contracts 1.0.3 → 1.0.4

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 (169) hide show
  1. package/build/index.d.ts +3 -0
  2. package/build/index.js +3 -0
  3. package/build/locales/en.d.ts +31 -0
  4. package/build/locales/en.js +38 -0
  5. package/build/locales/index.d.ts +66 -0
  6. package/build/locales/index.js +22 -0
  7. package/build/locales/ru.d.ts +30 -0
  8. package/build/locales/ru.js +38 -0
  9. package/build/rest-api.d.ts +49 -0
  10. package/build/rest-api.js +61 -0
  11. package/build/shared/common-schemas.d.ts +12 -0
  12. package/build/shared/common-schemas.js +15 -0
  13. package/build/shared/pagination.schema.d.ts +35 -0
  14. package/build/shared/pagination.schema.js +30 -0
  15. package/build/shared/regex.d.ts +8 -0
  16. package/build/shared/regex.js +16 -0
  17. package/build/v1/auth/auth.types.d.ts +2 -1
  18. package/build/v1/auth/auth.types.js +4 -1
  19. package/build/v1/auth/commands/delete-session.command.d.ts +13 -0
  20. package/build/v1/auth/commands/delete-session.command.js +14 -0
  21. package/build/v1/auth/commands/index.d.ts +2 -0
  22. package/build/v1/auth/commands/index.js +2 -0
  23. package/build/v1/auth/commands/login.command.js +5 -4
  24. package/build/v1/auth/commands/logout-all.command.d.ts +13 -0
  25. package/build/v1/auth/commands/logout-all.command.js +14 -0
  26. package/build/v1/auth/commands/logout.command.js +2 -2
  27. package/build/v1/auth/commands/signup.command.js +5 -4
  28. package/build/v1/auth/controllers.d.ts +4 -0
  29. package/build/v1/auth/controllers.js +7 -0
  30. package/build/v1/auth/index.d.ts +2 -1
  31. package/build/v1/auth/index.js +2 -1
  32. package/build/v1/auth/queries/get-sessions.query.d.ts +22 -0
  33. package/build/v1/auth/queries/get-sessions.query.js +15 -0
  34. package/build/v1/auth/queries/index.d.ts +1 -0
  35. package/build/v1/auth/queries/index.js +17 -0
  36. package/build/v1/auth/routes/auth.routes.d.ts +12 -0
  37. package/build/v1/auth/routes/auth.routes.js +15 -0
  38. package/build/v1/auth/schemas/auth-response.schema.d.ts +36 -0
  39. package/build/v1/auth/schemas/auth-response.schema.js +20 -0
  40. package/build/v1/auth/schemas/index.d.ts +5 -0
  41. package/build/v1/auth/schemas/index.js +21 -0
  42. package/build/v1/auth/schemas/login-request.schema.d.ts +9 -0
  43. package/build/v1/auth/schemas/login-request.schema.js +13 -0
  44. package/build/v1/auth/schemas/session-response.schema.d.ts +13 -0
  45. package/build/v1/auth/schemas/session-response.schema.js +17 -0
  46. package/build/v1/auth/schemas/signup-request.schema.d.ts +28 -0
  47. package/build/v1/auth/schemas/signup-request.schema.js +26 -0
  48. package/build/v1/auth/schemas/user-role.enum.d.ts +7 -0
  49. package/build/v1/auth/schemas/user-role.enum.js +11 -0
  50. package/build/v1/blog/admin/commands/create-category.command.d.ts +27 -0
  51. package/build/v1/blog/admin/commands/create-category.command.js +19 -0
  52. package/build/v1/blog/admin/commands/create-post.command.d.ts +46 -0
  53. package/build/v1/blog/admin/commands/create-post.command.js +19 -0
  54. package/build/v1/blog/admin/commands/delete-category.command.d.ts +14 -0
  55. package/build/v1/blog/admin/commands/delete-category.command.js +18 -0
  56. package/build/v1/blog/admin/commands/delete-post.command.d.ts +14 -0
  57. package/build/v1/blog/admin/commands/delete-post.command.js +18 -0
  58. package/build/v1/blog/admin/commands/index.d.ts +6 -0
  59. package/build/v1/blog/admin/commands/index.js +22 -0
  60. package/build/v1/blog/admin/commands/update-category.command.d.ts +27 -0
  61. package/build/v1/blog/admin/commands/update-category.command.js +19 -0
  62. package/build/v1/blog/admin/commands/update-post.command.d.ts +46 -0
  63. package/build/v1/blog/admin/commands/update-post.command.js +19 -0
  64. package/build/v1/blog/admin/queries/get-categories.query.d.ts +27 -0
  65. package/build/v1/blog/admin/queries/get-categories.query.js +25 -0
  66. package/build/v1/blog/admin/queries/get-category.query.d.ts +22 -0
  67. package/build/v1/blog/admin/queries/get-category.query.js +19 -0
  68. package/build/v1/blog/admin/queries/get-post.query.d.ts +36 -0
  69. package/build/v1/blog/admin/queries/get-post.query.js +19 -0
  70. package/build/v1/blog/admin/queries/get-posts.query.d.ts +84 -0
  71. package/build/v1/blog/admin/queries/get-posts.query.js +24 -0
  72. package/build/v1/blog/admin/queries/index.d.ts +4 -0
  73. package/build/v1/blog/admin/queries/index.js +20 -0
  74. package/build/v1/blog/blog.paths.d.ts +36 -0
  75. package/build/v1/blog/blog.paths.js +47 -0
  76. package/build/v1/blog/blog.types.d.ts +12 -0
  77. package/build/v1/blog/blog.types.js +7 -0
  78. package/build/v1/blog/controllers.d.ts +7 -0
  79. package/build/v1/blog/controllers.js +10 -0
  80. package/build/v1/blog/index.d.ts +6 -0
  81. package/build/v1/blog/index.js +22 -0
  82. package/build/v1/blog/public/queries/get-categories.query.d.ts +24 -0
  83. package/build/v1/blog/public/queries/get-categories.query.js +22 -0
  84. package/build/v1/blog/public/queries/get-post-by-alias.query.d.ts +36 -0
  85. package/build/v1/blog/public/queries/get-post-by-alias.query.js +19 -0
  86. package/build/v1/blog/public/queries/get-posts.query.d.ts +83 -0
  87. package/build/v1/blog/public/queries/get-posts.query.js +24 -0
  88. package/build/v1/blog/public/queries/index.d.ts +3 -0
  89. package/build/v1/blog/public/queries/index.js +19 -0
  90. package/build/v1/blog/routes/blog-admin-categories.routes.d.ts +11 -0
  91. package/build/v1/blog/routes/blog-admin-categories.routes.js +14 -0
  92. package/build/v1/blog/routes/blog-admin-posts.routes.d.ts +10 -0
  93. package/build/v1/blog/routes/blog-admin-posts.routes.js +13 -0
  94. package/build/v1/blog/routes/blog-public.routes.d.ts +10 -0
  95. package/build/v1/blog/routes/blog-public.routes.js +13 -0
  96. package/build/v1/blog/routes/index.d.ts +3 -0
  97. package/build/v1/blog/routes/index.js +19 -0
  98. package/build/v1/blog/schemas/blog-category-status.enum.d.ts +8 -0
  99. package/build/v1/blog/schemas/blog-category-status.enum.js +12 -0
  100. package/build/v1/blog/schemas/blog-post-status.enum.d.ts +8 -0
  101. package/build/v1/blog/schemas/blog-post-status.enum.js +12 -0
  102. package/build/v1/blog/schemas/category-response.schema.d.ts +14 -0
  103. package/build/v1/blog/schemas/category-response.schema.js +18 -0
  104. package/build/v1/blog/schemas/create-category-request.schema.d.ts +8 -0
  105. package/build/v1/blog/schemas/create-category-request.schema.js +12 -0
  106. package/build/v1/blog/schemas/create-post-request.schema.d.ts +13 -0
  107. package/build/v1/blog/schemas/create-post-request.schema.js +17 -0
  108. package/build/v1/blog/schemas/get-posts-query.schema.d.ts +13 -0
  109. package/build/v1/blog/schemas/get-posts-query.schema.js +13 -0
  110. package/build/v1/blog/schemas/index.d.ts +9 -0
  111. package/build/v1/blog/schemas/index.js +25 -0
  112. package/build/v1/blog/schemas/post-response.schema.d.ts +28 -0
  113. package/build/v1/blog/schemas/post-response.schema.js +25 -0
  114. package/build/v1/blog/schemas/update-category-request.schema.d.ts +8 -0
  115. package/build/v1/blog/schemas/update-category-request.schema.js +12 -0
  116. package/build/v1/blog/schemas/update-post-request.schema.d.ts +13 -0
  117. package/build/v1/blog/schemas/update-post-request.schema.js +17 -0
  118. package/build/v1/unregistered-users/commands/authenticate.command.d.ts +20 -0
  119. package/build/v1/unregistered-users/commands/authenticate.command.js +15 -0
  120. package/build/v1/unregistered-users/commands/index.d.ts +1 -0
  121. package/build/v1/unregistered-users/commands/index.js +17 -0
  122. package/build/v1/unregistered-users/index.d.ts +2 -1
  123. package/build/v1/unregistered-users/index.js +2 -1
  124. package/build/v1/unregistered-users/schemas/authenticate-request.schema.d.ts +7 -0
  125. package/build/v1/unregistered-users/schemas/authenticate-request.schema.js +10 -0
  126. package/build/v1/unregistered-users/schemas/authenticate-response.schema.d.ts +11 -0
  127. package/build/v1/unregistered-users/schemas/authenticate-response.schema.js +15 -0
  128. package/build/v1/unregistered-users/schemas/index.d.ts +3 -0
  129. package/build/v1/unregistered-users/schemas/index.js +19 -0
  130. package/build/v1/unregistered-users/schemas/unreg-user-status.enum.d.ts +8 -0
  131. package/build/v1/unregistered-users/schemas/unreg-user-status.enum.js +12 -0
  132. package/build/v1/unregistered-users/unregistered-users.types.d.ts +3 -1
  133. package/build/v1/unregistered-users/unregistered-users.types.js +6 -0
  134. package/build/v1/users/commands/change-password.command.js +3 -3
  135. package/build/v1/users/commands/delete-account.command.d.ts +13 -0
  136. package/build/v1/users/commands/delete-account.command.js +13 -0
  137. package/build/v1/users/commands/index.d.ts +2 -0
  138. package/build/v1/users/commands/index.js +2 -0
  139. package/build/v1/users/commands/toggle-marketing-consent.command.d.ts +15 -0
  140. package/build/v1/users/commands/toggle-marketing-consent.command.js +13 -0
  141. package/build/v1/users/commands/update-profile.command.js +3 -3
  142. package/build/v1/users/controllers.d.ts +4 -0
  143. package/build/v1/users/controllers.js +7 -0
  144. package/build/v1/users/index.d.ts +1 -1
  145. package/build/v1/users/index.js +1 -1
  146. package/build/v1/users/queries/get-current-user.query.js +2 -2
  147. package/build/v1/users/routes/users.routes.d.ts +9 -0
  148. package/build/v1/users/routes/users.routes.js +12 -0
  149. package/build/v1/users/schemas/change-password-request.schema.d.ts +10 -0
  150. package/build/v1/users/schemas/change-password-request.schema.js +14 -0
  151. package/build/v1/users/schemas/delete-account-request.schema.d.ts +5 -0
  152. package/build/v1/users/schemas/delete-account-request.schema.js +8 -0
  153. package/build/v1/users/schemas/index.d.ts +6 -0
  154. package/build/v1/users/schemas/index.js +22 -0
  155. package/build/v1/users/{users.schemas.d.ts → schemas/response-unions.schema.d.ts} +0 -42
  156. package/build/v1/users/schemas/response-unions.schema.js +14 -0
  157. package/build/v1/users/schemas/toggle-marketing-consent-request.schema.d.ts +7 -0
  158. package/build/v1/users/schemas/toggle-marketing-consent-request.schema.js +10 -0
  159. package/build/v1/users/schemas/update-profile-request.schema.d.ts +8 -0
  160. package/build/v1/users/schemas/update-profile-request.schema.js +11 -0
  161. package/build/v1/users/schemas/user-response.schema.d.ts +12 -0
  162. package/build/v1/users/schemas/user-response.schema.js +16 -0
  163. package/build/v1/users/users.types.d.ts +2 -4
  164. package/package.json +1 -1
  165. package/build/v1/auth/auth.schemas.d.ts +0 -87
  166. package/build/v1/auth/auth.schemas.js +0 -69
  167. package/build/v1/unregistered-users/unregistered-users.schemas.d.ts +0 -24
  168. package/build/v1/unregistered-users/unregistered-users.schemas.js +0 -28
  169. package/build/v1/users/users.schemas.js +0 -58
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Auth Controller paths for NestJS @Controller decorator
3
+ */
4
+ export declare const AUTH_CONTROLLER: "v1/auth";
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AUTH_CONTROLLER = void 0;
4
+ /**
5
+ * Auth Controller paths for NestJS @Controller decorator
6
+ */
7
+ exports.AUTH_CONTROLLER = 'v1/auth';
@@ -1,5 +1,6 @@
1
- export * from './auth.schemas';
1
+ export * from './schemas';
2
2
  export * from './auth.types';
3
3
  export * from './auth.paths';
4
4
  export * from './auth.errors';
5
5
  export * from './commands';
6
+ export * from './queries';
@@ -14,8 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./auth.schemas"), exports);
17
+ __exportStar(require("./schemas"), exports);
18
18
  __exportStar(require("./auth.types"), exports);
19
19
  __exportStar(require("./auth.paths"), exports);
20
20
  __exportStar(require("./auth.errors"), exports);
21
21
  __exportStar(require("./commands"), exports);
22
+ __exportStar(require("./queries"), exports);
@@ -0,0 +1,22 @@
1
+ import { z } from 'zod';
2
+ import { HttpMethod } from '../../../shared/http-method';
3
+ export declare namespace AuthGetSessionsQuery {
4
+ const Request: z.ZodObject<{}, z.core.$strip>;
5
+ const Response: z.ZodUnion<readonly [z.ZodObject<{
6
+ sessions: z.ZodArray<z.ZodObject<{
7
+ uuid: z.ZodString;
8
+ deviceName: z.ZodString;
9
+ ip: z.ZodString;
10
+ isCurrent: z.ZodBoolean;
11
+ createdAt: z.ZodString;
12
+ lastUsedAt: z.ZodString;
13
+ }, z.core.$strip>>;
14
+ }, z.core.$strip>, z.ZodObject<{
15
+ code: z.ZodString;
16
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
17
+ }, z.core.$strip>]>;
18
+ const URL: "/api/v1/auth/sessions";
19
+ const METHOD = HttpMethod.GET;
20
+ type RequestType = z.infer<typeof Request>;
21
+ type ResponseType = z.infer<typeof Response>;
22
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AuthGetSessionsQuery = void 0;
4
+ const zod_1 = require("zod");
5
+ const auth_response_schema_1 = require("../schemas/auth-response.schema");
6
+ const auth_paths_1 = require("../auth.paths");
7
+ const http_method_1 = require("../../../shared/http-method");
8
+ const common_schemas_1 = require("../../../shared/common-schemas");
9
+ var AuthGetSessionsQuery;
10
+ (function (AuthGetSessionsQuery) {
11
+ AuthGetSessionsQuery.Request = zod_1.z.object({}); // No request body for GET
12
+ AuthGetSessionsQuery.Response = zod_1.z.union([auth_response_schema_1.SessionsListResponseSchema, common_schemas_1.ErrorResponseSchema]);
13
+ AuthGetSessionsQuery.URL = auth_paths_1.AUTH_API_PATHS.SESSIONS;
14
+ AuthGetSessionsQuery.METHOD = http_method_1.HttpMethod.GET;
15
+ })(AuthGetSessionsQuery || (exports.AuthGetSessionsQuery = AuthGetSessionsQuery = {}));
@@ -0,0 +1 @@
1
+ export * from './get-sessions.query';
@@ -0,0 +1,17 @@
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("./get-sessions.query"), exports);
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Auth Routes
3
+ * For NestJS method decorators (@Get, @Post, etc.)
4
+ */
5
+ export declare const AUTH_ROUTES: {
6
+ readonly SIGNUP: "signup";
7
+ readonly LOGIN: "login";
8
+ readonly LOGOUT: "logout";
9
+ readonly LOGOUT_ALL: "logout-all";
10
+ readonly SESSIONS: "sessions";
11
+ readonly SESSION_BY_ID: "sessions/:id";
12
+ };
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AUTH_ROUTES = void 0;
4
+ /**
5
+ * Auth Routes
6
+ * For NestJS method decorators (@Get, @Post, etc.)
7
+ */
8
+ exports.AUTH_ROUTES = {
9
+ SIGNUP: 'signup',
10
+ LOGIN: 'login',
11
+ LOGOUT: 'logout',
12
+ LOGOUT_ALL: 'logout-all',
13
+ SESSIONS: 'sessions',
14
+ SESSION_BY_ID: 'sessions/:id',
15
+ };
@@ -0,0 +1,36 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Auth Response Schema (signup/login)
4
+ */
5
+ export declare const AuthResponseSchema: z.ZodObject<{
6
+ user: z.ZodObject<{
7
+ uuid: z.ZodString;
8
+ email: z.ZodString;
9
+ name: z.ZodString;
10
+ role: z.ZodString;
11
+ marketingConsent: z.ZodBoolean;
12
+ createdAt: z.ZodString;
13
+ }, z.core.$strip>;
14
+ accessToken: z.ZodString;
15
+ session: z.ZodObject<{
16
+ uuid: z.ZodString;
17
+ deviceName: z.ZodString;
18
+ ip: z.ZodString;
19
+ isCurrent: z.ZodBoolean;
20
+ createdAt: z.ZodString;
21
+ lastUsedAt: z.ZodString;
22
+ }, z.core.$strip>;
23
+ }, z.core.$strip>;
24
+ /**
25
+ * Sessions List Response Schema
26
+ */
27
+ export declare const SessionsListResponseSchema: z.ZodObject<{
28
+ sessions: z.ZodArray<z.ZodObject<{
29
+ uuid: z.ZodString;
30
+ deviceName: z.ZodString;
31
+ ip: z.ZodString;
32
+ isCurrent: z.ZodBoolean;
33
+ createdAt: z.ZodString;
34
+ lastUsedAt: z.ZodString;
35
+ }, z.core.$strip>>;
36
+ }, z.core.$strip>;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SessionsListResponseSchema = exports.AuthResponseSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const user_response_schema_1 = require("../../users/schemas/user-response.schema");
6
+ const session_response_schema_1 = require("./session-response.schema");
7
+ /**
8
+ * Auth Response Schema (signup/login)
9
+ */
10
+ exports.AuthResponseSchema = zod_1.z.object({
11
+ user: user_response_schema_1.UserResponseSchema,
12
+ accessToken: zod_1.z.string(),
13
+ session: session_response_schema_1.SessionResponseSchema,
14
+ });
15
+ /**
16
+ * Sessions List Response Schema
17
+ */
18
+ exports.SessionsListResponseSchema = zod_1.z.object({
19
+ sessions: zod_1.z.array(session_response_schema_1.SessionResponseSchema),
20
+ });
@@ -0,0 +1,5 @@
1
+ export * from './user-role.enum';
2
+ export * from './signup-request.schema';
3
+ export * from './login-request.schema';
4
+ export * from './session-response.schema';
5
+ export * from './auth-response.schema';
@@ -0,0 +1,21 @@
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("./user-role.enum"), exports);
18
+ __exportStar(require("./signup-request.schema"), exports);
19
+ __exportStar(require("./login-request.schema"), exports);
20
+ __exportStar(require("./session-response.schema"), exports);
21
+ __exportStar(require("./auth-response.schema"), exports);
@@ -0,0 +1,9 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Login Request Schema
4
+ * Error messages are in locales (en.ts, ru.ts)
5
+ */
6
+ export declare const LoginRequestSchema: z.ZodObject<{
7
+ email: z.ZodString;
8
+ password: z.ZodString;
9
+ }, z.core.$strip>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LoginRequestSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const regex_1 = require("../../../shared/regex");
6
+ /**
7
+ * Login Request Schema
8
+ * Error messages are in locales (en.ts, ru.ts)
9
+ */
10
+ exports.LoginRequestSchema = zod_1.z.object({
11
+ email: zod_1.z.string().regex(regex_1.EMAIL_REGEX),
12
+ password: zod_1.z.string().min(1),
13
+ });
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Session Response Schema
4
+ * Error messages are in locales (en.ts, ru.ts)
5
+ */
6
+ export declare const SessionResponseSchema: z.ZodObject<{
7
+ uuid: z.ZodString;
8
+ deviceName: z.ZodString;
9
+ ip: z.ZodString;
10
+ isCurrent: z.ZodBoolean;
11
+ createdAt: z.ZodString;
12
+ lastUsedAt: z.ZodString;
13
+ }, z.core.$strip>;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SessionResponseSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const regex_1 = require("../../../shared/regex");
6
+ /**
7
+ * Session Response Schema
8
+ * Error messages are in locales (en.ts, ru.ts)
9
+ */
10
+ exports.SessionResponseSchema = zod_1.z.object({
11
+ uuid: zod_1.z.string().regex(regex_1.UUID_REGEX),
12
+ deviceName: zod_1.z.string(),
13
+ ip: zod_1.z.string(),
14
+ isCurrent: zod_1.z.boolean(),
15
+ createdAt: zod_1.z.string().regex(regex_1.DATETIME_REGEX),
16
+ lastUsedAt: zod_1.z.string().regex(regex_1.DATETIME_REGEX),
17
+ });
@@ -0,0 +1,28 @@
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
+ * Sign Up Request Schema
14
+ * Error messages are in locales (en.ts, ru.ts)
15
+ */
16
+ export declare const SignUpRequestSchema: z.ZodObject<{
17
+ email: z.ZodString;
18
+ password: z.ZodString;
19
+ name: z.ZodString;
20
+ marketingConsent: z.ZodDefault<z.ZodBoolean>;
21
+ utm: z.ZodOptional<z.ZodObject<{
22
+ utmSource: z.ZodOptional<z.ZodString>;
23
+ utmMedium: z.ZodOptional<z.ZodString>;
24
+ utmCampaign: z.ZodOptional<z.ZodString>;
25
+ utmContent: z.ZodOptional<z.ZodString>;
26
+ utmTerm: z.ZodOptional<z.ZodString>;
27
+ }, z.core.$strip>>;
28
+ }, z.core.$strip>;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SignUpRequestSchema = exports.UtmSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const regex_1 = require("../../../shared/regex");
6
+ /**
7
+ * UTM Schema
8
+ */
9
+ exports.UtmSchema = zod_1.z.object({
10
+ utmSource: zod_1.z.string().optional(),
11
+ utmMedium: zod_1.z.string().optional(),
12
+ utmCampaign: zod_1.z.string().optional(),
13
+ utmContent: zod_1.z.string().optional(),
14
+ utmTerm: zod_1.z.string().optional(),
15
+ });
16
+ /**
17
+ * Sign Up Request Schema
18
+ * Error messages are in locales (en.ts, ru.ts)
19
+ */
20
+ exports.SignUpRequestSchema = zod_1.z.object({
21
+ email: zod_1.z.string().regex(regex_1.EMAIL_REGEX),
22
+ password: zod_1.z.string().min(8).max(128).regex(regex_1.PASSWORD_STRENGTH_REGEX),
23
+ name: zod_1.z.string().min(2),
24
+ marketingConsent: zod_1.z.boolean().default(false),
25
+ utm: exports.UtmSchema.optional(),
26
+ });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * User Role enum
3
+ */
4
+ export declare enum UserRole {
5
+ USER = "user",
6
+ ADMIN = "admin"
7
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UserRole = void 0;
4
+ /**
5
+ * User Role enum
6
+ */
7
+ var UserRole;
8
+ (function (UserRole) {
9
+ UserRole["USER"] = "user";
10
+ UserRole["ADMIN"] = "admin";
11
+ })(UserRole || (exports.UserRole = UserRole = {}));
@@ -0,0 +1,27 @@
1
+ import { z } from 'zod';
2
+ import { HttpMethod } from '../../../../shared/http-method';
3
+ export declare namespace AdminBlogCreateCategoryCommand {
4
+ const Request: z.ZodObject<{
5
+ alias: z.ZodString;
6
+ title: z.ZodString;
7
+ order: z.ZodDefault<z.ZodNumber>;
8
+ status: z.ZodDefault<z.ZodEnum<typeof import("../../schemas").BlogCategoryStatus>>;
9
+ }, z.core.$strip>;
10
+ const Response: z.ZodUnion<readonly [z.ZodObject<{
11
+ uuid: z.ZodString;
12
+ alias: z.ZodString;
13
+ title: z.ZodString;
14
+ order: z.ZodNumber;
15
+ status: z.ZodEnum<typeof import("../../schemas").BlogCategoryStatus>;
16
+ createdAt: z.ZodString;
17
+ updatedAt: z.ZodString;
18
+ }, z.core.$strip>, z.ZodObject<{
19
+ code: z.ZodString;
20
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
21
+ }, z.core.$strip>]>;
22
+ const PATH: "";
23
+ const URL: "/api/v1/admin/blog/categories/";
24
+ const METHOD = HttpMethod.POST;
25
+ type RequestType = z.infer<typeof Request>;
26
+ type ResponseType = z.infer<typeof Response>;
27
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AdminBlogCreateCategoryCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const schemas_1 = require("../../schemas");
6
+ const blog_admin_categories_routes_1 = require("../../routes/blog-admin-categories.routes");
7
+ const rest_api_1 = require("../../../../rest-api");
8
+ const http_method_1 = require("../../../../shared/http-method");
9
+ const common_schemas_1 = require("../../../../shared/common-schemas");
10
+ var AdminBlogCreateCategoryCommand;
11
+ (function (AdminBlogCreateCategoryCommand) {
12
+ // Request/Response
13
+ AdminBlogCreateCategoryCommand.Request = schemas_1.CreateCategoryRequestSchema;
14
+ AdminBlogCreateCategoryCommand.Response = zod_1.z.union([schemas_1.CategoryResponseSchema, common_schemas_1.ErrorResponseSchema]);
15
+ // Path/URL/Method
16
+ AdminBlogCreateCategoryCommand.PATH = blog_admin_categories_routes_1.BLOG_ADMIN_CATEGORIES_ROUTES.CREATE;
17
+ AdminBlogCreateCategoryCommand.URL = rest_api_1.REST_API.V1.BLOG.ADMIN.CATEGORIES.CREATE;
18
+ AdminBlogCreateCategoryCommand.METHOD = http_method_1.HttpMethod.POST;
19
+ })(AdminBlogCreateCategoryCommand || (exports.AdminBlogCreateCategoryCommand = AdminBlogCreateCategoryCommand = {}));
@@ -0,0 +1,46 @@
1
+ import { z } from 'zod';
2
+ import { HttpMethod } from '../../../../shared/http-method';
3
+ export declare namespace AdminBlogCreatePostCommand {
4
+ const Request: z.ZodObject<{
5
+ alias: z.ZodString;
6
+ title: z.ZodString;
7
+ metaTitle: z.ZodString;
8
+ metaDescription: z.ZodString;
9
+ content: z.ZodString;
10
+ image: z.ZodString;
11
+ author: z.ZodString;
12
+ categoryIds: z.ZodArray<z.ZodString>;
13
+ status: z.ZodDefault<z.ZodEnum<typeof import("../../schemas").BlogPostStatus>>;
14
+ }, z.core.$strip>;
15
+ const Response: z.ZodUnion<readonly [z.ZodObject<{
16
+ uuid: z.ZodString;
17
+ alias: z.ZodString;
18
+ title: z.ZodString;
19
+ metaTitle: z.ZodString;
20
+ metaDescription: z.ZodString;
21
+ content: z.ZodString;
22
+ image: z.ZodString;
23
+ author: z.ZodString;
24
+ categories: z.ZodArray<z.ZodObject<{
25
+ uuid: z.ZodString;
26
+ alias: z.ZodString;
27
+ title: z.ZodString;
28
+ order: z.ZodNumber;
29
+ status: z.ZodEnum<typeof import("../../schemas").BlogCategoryStatus>;
30
+ createdAt: z.ZodString;
31
+ updatedAt: z.ZodString;
32
+ }, z.core.$strip>>;
33
+ viewsCount: z.ZodNumber;
34
+ status: z.ZodEnum<typeof import("../../schemas").BlogPostStatus>;
35
+ createdAt: z.ZodString;
36
+ updatedAt: z.ZodString;
37
+ }, z.core.$strip>, z.ZodObject<{
38
+ code: z.ZodString;
39
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
40
+ }, z.core.$strip>]>;
41
+ const PATH: "";
42
+ const URL: "/api/v1/admin/blog/posts/";
43
+ const METHOD = HttpMethod.POST;
44
+ type RequestType = z.infer<typeof Request>;
45
+ type ResponseType = z.infer<typeof Response>;
46
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AdminBlogCreatePostCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const schemas_1 = require("../../schemas");
6
+ const blog_admin_posts_routes_1 = require("../../routes/blog-admin-posts.routes");
7
+ const rest_api_1 = require("../../../../rest-api");
8
+ const http_method_1 = require("../../../../shared/http-method");
9
+ const common_schemas_1 = require("../../../../shared/common-schemas");
10
+ var AdminBlogCreatePostCommand;
11
+ (function (AdminBlogCreatePostCommand) {
12
+ // Request/Response
13
+ AdminBlogCreatePostCommand.Request = schemas_1.CreatePostRequestSchema;
14
+ AdminBlogCreatePostCommand.Response = zod_1.z.union([schemas_1.PostResponseSchema, common_schemas_1.ErrorResponseSchema]);
15
+ // Path/URL/Method
16
+ AdminBlogCreatePostCommand.PATH = blog_admin_posts_routes_1.BLOG_ADMIN_POSTS_ROUTES.CREATE;
17
+ AdminBlogCreatePostCommand.URL = rest_api_1.REST_API.V1.BLOG.ADMIN.POSTS.CREATE;
18
+ AdminBlogCreatePostCommand.METHOD = http_method_1.HttpMethod.POST;
19
+ })(AdminBlogCreatePostCommand || (exports.AdminBlogCreatePostCommand = AdminBlogCreatePostCommand = {}));
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ import { HttpMethod } from '../../../../shared/http-method';
3
+ export declare namespace AdminBlogDeleteCategoryCommand {
4
+ const Request: z.ZodObject<{}, z.core.$strip>;
5
+ const Response: z.ZodUnion<readonly [z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
6
+ code: z.ZodString;
7
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
8
+ }, z.core.$strip>]>;
9
+ const PATH: ":uuid";
10
+ const URL: (uuid: string) => string;
11
+ const METHOD = HttpMethod.DELETE;
12
+ type RequestType = z.infer<typeof Request>;
13
+ type ResponseType = z.infer<typeof Response>;
14
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AdminBlogDeleteCategoryCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const blog_admin_categories_routes_1 = require("../../routes/blog-admin-categories.routes");
6
+ const rest_api_1 = require("../../../../rest-api");
7
+ const http_method_1 = require("../../../../shared/http-method");
8
+ const common_schemas_1 = require("../../../../shared/common-schemas");
9
+ var AdminBlogDeleteCategoryCommand;
10
+ (function (AdminBlogDeleteCategoryCommand) {
11
+ // Request/Response
12
+ AdminBlogDeleteCategoryCommand.Request = zod_1.z.object({});
13
+ AdminBlogDeleteCategoryCommand.Response = zod_1.z.union([common_schemas_1.EmptyResponseSchema, common_schemas_1.ErrorResponseSchema]);
14
+ // Path/URL/Method
15
+ AdminBlogDeleteCategoryCommand.PATH = blog_admin_categories_routes_1.BLOG_ADMIN_CATEGORIES_ROUTES.DELETE;
16
+ AdminBlogDeleteCategoryCommand.URL = (uuid) => rest_api_1.REST_API.V1.BLOG.ADMIN.CATEGORIES.DELETE(uuid);
17
+ AdminBlogDeleteCategoryCommand.METHOD = http_method_1.HttpMethod.DELETE;
18
+ })(AdminBlogDeleteCategoryCommand || (exports.AdminBlogDeleteCategoryCommand = AdminBlogDeleteCategoryCommand = {}));
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ import { HttpMethod } from '../../../../shared/http-method';
3
+ export declare namespace AdminBlogDeletePostCommand {
4
+ const Request: z.ZodObject<{}, z.core.$strip>;
5
+ const Response: z.ZodUnion<readonly [z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
6
+ code: z.ZodString;
7
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
8
+ }, z.core.$strip>]>;
9
+ const PATH: ":uuid";
10
+ const URL: (uuid: string) => string;
11
+ const METHOD = HttpMethod.DELETE;
12
+ type RequestType = z.infer<typeof Request>;
13
+ type ResponseType = z.infer<typeof Response>;
14
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AdminBlogDeletePostCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const blog_admin_posts_routes_1 = require("../../routes/blog-admin-posts.routes");
6
+ const rest_api_1 = require("../../../../rest-api");
7
+ const http_method_1 = require("../../../../shared/http-method");
8
+ const common_schemas_1 = require("../../../../shared/common-schemas");
9
+ var AdminBlogDeletePostCommand;
10
+ (function (AdminBlogDeletePostCommand) {
11
+ // Request/Response
12
+ AdminBlogDeletePostCommand.Request = zod_1.z.object({});
13
+ AdminBlogDeletePostCommand.Response = zod_1.z.union([common_schemas_1.EmptyResponseSchema, common_schemas_1.ErrorResponseSchema]);
14
+ // Path/URL/Method
15
+ AdminBlogDeletePostCommand.PATH = blog_admin_posts_routes_1.BLOG_ADMIN_POSTS_ROUTES.DELETE;
16
+ AdminBlogDeletePostCommand.URL = (uuid) => rest_api_1.REST_API.V1.BLOG.ADMIN.POSTS.DELETE(uuid);
17
+ AdminBlogDeletePostCommand.METHOD = http_method_1.HttpMethod.DELETE;
18
+ })(AdminBlogDeletePostCommand || (exports.AdminBlogDeletePostCommand = AdminBlogDeletePostCommand = {}));
@@ -0,0 +1,6 @@
1
+ export * from './create-category.command';
2
+ export * from './update-category.command';
3
+ export * from './delete-category.command';
4
+ export * from './create-post.command';
5
+ export * from './update-post.command';
6
+ export * from './delete-post.command';
@@ -0,0 +1,22 @@
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("./create-category.command"), exports);
18
+ __exportStar(require("./update-category.command"), exports);
19
+ __exportStar(require("./delete-category.command"), exports);
20
+ __exportStar(require("./create-post.command"), exports);
21
+ __exportStar(require("./update-post.command"), exports);
22
+ __exportStar(require("./delete-post.command"), exports);
@@ -0,0 +1,27 @@
1
+ import { z } from 'zod';
2
+ import { HttpMethod } from '../../../../shared/http-method';
3
+ export declare namespace AdminBlogUpdateCategoryCommand {
4
+ const Request: z.ZodObject<{
5
+ alias: z.ZodOptional<z.ZodString>;
6
+ title: z.ZodOptional<z.ZodString>;
7
+ order: z.ZodOptional<z.ZodNumber>;
8
+ status: z.ZodOptional<z.ZodEnum<typeof import("../../schemas").BlogCategoryStatus>>;
9
+ }, z.core.$strip>;
10
+ const Response: z.ZodUnion<readonly [z.ZodObject<{
11
+ uuid: z.ZodString;
12
+ alias: z.ZodString;
13
+ title: z.ZodString;
14
+ order: z.ZodNumber;
15
+ status: z.ZodEnum<typeof import("../../schemas").BlogCategoryStatus>;
16
+ createdAt: z.ZodString;
17
+ updatedAt: z.ZodString;
18
+ }, z.core.$strip>, z.ZodObject<{
19
+ code: z.ZodString;
20
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
21
+ }, z.core.$strip>]>;
22
+ const PATH: ":uuid";
23
+ const URL: (uuid: string) => string;
24
+ const METHOD = HttpMethod.PATCH;
25
+ type RequestType = z.infer<typeof Request>;
26
+ type ResponseType = z.infer<typeof Response>;
27
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AdminBlogUpdateCategoryCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const schemas_1 = require("../../schemas");
6
+ const blog_admin_categories_routes_1 = require("../../routes/blog-admin-categories.routes");
7
+ const rest_api_1 = require("../../../../rest-api");
8
+ const http_method_1 = require("../../../../shared/http-method");
9
+ const common_schemas_1 = require("../../../../shared/common-schemas");
10
+ var AdminBlogUpdateCategoryCommand;
11
+ (function (AdminBlogUpdateCategoryCommand) {
12
+ // Request/Response
13
+ AdminBlogUpdateCategoryCommand.Request = schemas_1.UpdateCategoryRequestSchema;
14
+ AdminBlogUpdateCategoryCommand.Response = zod_1.z.union([schemas_1.CategoryResponseSchema, common_schemas_1.ErrorResponseSchema]);
15
+ // Path/URL/Method
16
+ AdminBlogUpdateCategoryCommand.PATH = blog_admin_categories_routes_1.BLOG_ADMIN_CATEGORIES_ROUTES.UPDATE;
17
+ AdminBlogUpdateCategoryCommand.URL = (uuid) => rest_api_1.REST_API.V1.BLOG.ADMIN.CATEGORIES.UPDATE(uuid);
18
+ AdminBlogUpdateCategoryCommand.METHOD = http_method_1.HttpMethod.PATCH;
19
+ })(AdminBlogUpdateCategoryCommand || (exports.AdminBlogUpdateCategoryCommand = AdminBlogUpdateCategoryCommand = {}));