@veruna/api-contracts 1.0.4 → 1.0.7

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 (73) hide show
  1. package/build/index.d.ts +3 -5
  2. package/build/index.js +3 -5
  3. package/build/rest-api.d.ts +3 -0
  4. package/build/rest-api.js +6 -0
  5. package/build/shared/error-response.schema.d.ts +25 -0
  6. package/build/shared/error-response.schema.js +22 -0
  7. package/build/shared/index.d.ts +2 -0
  8. package/build/shared/index.js +18 -0
  9. package/build/utils/index.d.ts +1 -0
  10. package/build/utils/index.js +17 -0
  11. package/build/utils/path-builder.d.ts +20 -0
  12. package/build/utils/path-builder.js +46 -0
  13. package/build/v1/auth/commands/delete-session.command.d.ts +3 -5
  14. package/build/v1/auth/commands/delete-session.command.js +8 -4
  15. package/build/v1/auth/commands/login.command.d.ts +3 -5
  16. package/build/v1/auth/commands/login.command.js +7 -5
  17. package/build/v1/auth/commands/logout-all.command.d.ts +2 -4
  18. package/build/v1/auth/commands/logout-all.command.js +8 -4
  19. package/build/v1/auth/commands/logout.command.d.ts +2 -4
  20. package/build/v1/auth/commands/logout.command.js +8 -4
  21. package/build/v1/auth/commands/signup.command.d.ts +3 -5
  22. package/build/v1/auth/commands/signup.command.js +7 -5
  23. package/build/v1/auth/index.d.ts +2 -0
  24. package/build/v1/auth/index.js +2 -0
  25. package/build/v1/auth/queries/get-sessions.query.d.ts +3 -5
  26. package/build/v1/auth/queries/get-sessions.query.js +8 -5
  27. package/build/v1/blog/admin/commands/create-category.command.d.ts +2 -5
  28. package/build/v1/blog/admin/commands/create-category.command.js +1 -5
  29. package/build/v1/blog/admin/commands/create-post.command.d.ts +2 -5
  30. package/build/v1/blog/admin/commands/create-post.command.js +1 -5
  31. package/build/v1/blog/admin/commands/delete-category.command.d.ts +1 -4
  32. package/build/v1/blog/admin/commands/delete-category.command.js +1 -3
  33. package/build/v1/blog/admin/commands/delete-post.command.d.ts +1 -4
  34. package/build/v1/blog/admin/commands/delete-post.command.js +1 -3
  35. package/build/v1/blog/admin/commands/update-category.command.d.ts +2 -5
  36. package/build/v1/blog/admin/commands/update-category.command.js +1 -5
  37. package/build/v1/blog/admin/commands/update-post.command.d.ts +2 -5
  38. package/build/v1/blog/admin/commands/update-post.command.js +1 -5
  39. package/build/v1/blog/admin/queries/get-categories.query.d.ts +2 -5
  40. package/build/v1/blog/admin/queries/get-categories.query.js +1 -4
  41. package/build/v1/blog/admin/queries/get-category.query.d.ts +2 -5
  42. package/build/v1/blog/admin/queries/get-category.query.js +1 -4
  43. package/build/v1/blog/admin/queries/get-post.query.d.ts +2 -5
  44. package/build/v1/blog/admin/queries/get-post.query.js +1 -4
  45. package/build/v1/blog/admin/queries/get-posts.query.d.ts +2 -38
  46. package/build/v1/blog/admin/queries/get-posts.query.js +3 -6
  47. package/build/v1/blog/index.d.ts +2 -0
  48. package/build/v1/blog/index.js +2 -0
  49. package/build/v1/blog/public/queries/get-categories.query.d.ts +2 -5
  50. package/build/v1/blog/public/queries/get-categories.query.js +1 -4
  51. package/build/v1/blog/public/queries/get-post-by-alias.query.d.ts +2 -5
  52. package/build/v1/blog/public/queries/get-post-by-alias.query.js +1 -4
  53. package/build/v1/blog/public/queries/get-posts.query.d.ts +2 -38
  54. package/build/v1/blog/public/queries/get-posts.query.js +3 -6
  55. package/build/v1/unregistered-users/commands/authenticate.command.d.ts +4 -6
  56. package/build/v1/unregistered-users/commands/authenticate.command.js +5 -5
  57. package/build/v1/unregistered-users/controllers.d.ts +4 -0
  58. package/build/v1/unregistered-users/controllers.js +7 -0
  59. package/build/v1/unregistered-users/routes/unreg-users.routes.d.ts +6 -0
  60. package/build/v1/unregistered-users/routes/unreg-users.routes.js +9 -0
  61. package/build/v1/users/commands/change-password.command.d.ts +2 -4
  62. package/build/v1/users/commands/change-password.command.js +8 -5
  63. package/build/v1/users/commands/delete-account.command.d.ts +2 -4
  64. package/build/v1/users/commands/delete-account.command.js +8 -5
  65. package/build/v1/users/commands/toggle-marketing-consent.command.d.ts +2 -4
  66. package/build/v1/users/commands/toggle-marketing-consent.command.js +8 -5
  67. package/build/v1/users/commands/update-profile.command.d.ts +2 -4
  68. package/build/v1/users/commands/update-profile.command.js +8 -5
  69. package/build/v1/users/index.d.ts +2 -0
  70. package/build/v1/users/index.js +2 -0
  71. package/build/v1/users/queries/get-current-user.query.d.ts +3 -5
  72. package/build/v1/users/queries/get-current-user.query.js +7 -5
  73. package/package.json +1 -1
package/build/index.d.ts CHANGED
@@ -1,6 +1,4 @@
1
- export * from './shared/http-method';
2
- export * from './shared/regex';
3
- export * from './v1/auth';
4
- export * from './v1/users';
5
- export * from './v1/unregistered-users';
1
+ export * from './shared';
2
+ export * from './v1';
6
3
  export * from './locales';
4
+ export * from './utils';
package/build/index.js CHANGED
@@ -15,9 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  // Export all contracts
18
- __exportStar(require("./shared/http-method"), exports);
19
- __exportStar(require("./shared/regex"), exports);
20
- __exportStar(require("./v1/auth"), exports);
21
- __exportStar(require("./v1/users"), exports);
22
- __exportStar(require("./v1/unregistered-users"), exports);
18
+ __exportStar(require("./shared"), exports);
19
+ __exportStar(require("./v1"), exports);
23
20
  __exportStar(require("./locales"), exports);
21
+ __exportStar(require("./utils"), exports);
@@ -18,6 +18,9 @@ export declare const REST_API: {
18
18
  readonly ME_MARKETING_CONSENT: "/api/v1/users/me/marketing-consent";
19
19
  readonly ME_PASSWORD: "/api/v1/users/me/password";
20
20
  };
21
+ readonly UNREG: {
22
+ readonly AUTHENTICATE: "/api/v1/unreg/";
23
+ };
21
24
  readonly BLOG: {
22
25
  readonly ADMIN: {
23
26
  readonly CATEGORIES: {
package/build/rest-api.js CHANGED
@@ -11,6 +11,8 @@ const controllers_2 = require("./v1/auth/controllers");
11
11
  const auth_routes_1 = require("./v1/auth/routes/auth.routes");
12
12
  const controllers_3 = require("./v1/users/controllers");
13
13
  const users_routes_1 = require("./v1/users/routes/users.routes");
14
+ const controllers_4 = require("./v1/unregistered-users/controllers");
15
+ const unreg_users_routes_1 = require("./v1/unregistered-users/routes/unreg-users.routes");
14
16
  exports.ROOT = '/api';
15
17
  exports.REST_API = {
16
18
  V1: {
@@ -29,6 +31,10 @@ exports.REST_API = {
29
31
  ME_MARKETING_CONSENT: `${exports.ROOT}/${controllers_3.USERS_CONTROLLER}/${users_routes_1.USERS_ROUTES.ME_MARKETING_CONSENT}`,
30
32
  ME_PASSWORD: `${exports.ROOT}/${controllers_3.USERS_CONTROLLER}/${users_routes_1.USERS_ROUTES.ME_PASSWORD}`,
31
33
  },
34
+ // Unregistered Users
35
+ UNREG: {
36
+ AUTHENTICATE: `${exports.ROOT}/${controllers_4.UNREG_USERS_CONTROLLER}/${unreg_users_routes_1.UNREG_USERS_ROUTES.AUTHENTICATE}`,
37
+ },
32
38
  // Blog module
33
39
  BLOG: {
34
40
  ADMIN: {
@@ -0,0 +1,25 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Base error response schema
4
+ */
5
+ export declare const ErrorResponseSchema: z.ZodObject<{
6
+ statusCode: z.ZodNumber;
7
+ message: z.ZodString;
8
+ error: z.ZodString;
9
+ code: z.ZodOptional<z.ZodString>;
10
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
11
+ timestamp: z.ZodString;
12
+ }, z.core.$strip>;
13
+ export type ErrorResponse = z.infer<typeof ErrorResponseSchema>;
14
+ /**
15
+ * Validation error response schema
16
+ */
17
+ export declare const ValidationErrorResponseSchema: z.ZodObject<{
18
+ statusCode: z.ZodNumber;
19
+ message: z.ZodString;
20
+ error: z.ZodString;
21
+ timestamp: z.ZodString;
22
+ code: z.ZodLiteral<"VALIDATION_ERROR">;
23
+ details: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
24
+ }, z.core.$strip>;
25
+ export type ValidationErrorResponse = z.infer<typeof ValidationErrorResponseSchema>;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ValidationErrorResponseSchema = exports.ErrorResponseSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ /**
6
+ * Base error response schema
7
+ */
8
+ exports.ErrorResponseSchema = zod_1.z.object({
9
+ statusCode: zod_1.z.number(),
10
+ message: zod_1.z.string(),
11
+ error: zod_1.z.string(),
12
+ code: zod_1.z.string().optional(),
13
+ details: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional(),
14
+ timestamp: zod_1.z.string(),
15
+ });
16
+ /**
17
+ * Validation error response schema
18
+ */
19
+ exports.ValidationErrorResponseSchema = exports.ErrorResponseSchema.extend({
20
+ code: zod_1.z.literal('VALIDATION_ERROR'),
21
+ details: zod_1.z.record(zod_1.z.string(), zod_1.z.array(zod_1.z.string())),
22
+ });
@@ -0,0 +1,2 @@
1
+ export * from './error-response.schema';
2
+ export * from './pagination.schema';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./error-response.schema"), exports);
18
+ __exportStar(require("./pagination.schema"), exports);
@@ -0,0 +1 @@
1
+ export * from './path-builder';
@@ -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("./path-builder"), exports);
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Build URL path with parameters
3
+ * @example
4
+ * buildPath('/users/:id', { id: '123' }) // '/users/123'
5
+ * buildPath('/users/:id/posts/:postId', { id: '1', postId: '2' }) // '/users/1/posts/2'
6
+ */
7
+ export declare function buildPath(pattern: string, params?: Record<string, string | number>): string;
8
+ /**
9
+ * Build URL with query parameters
10
+ * @example
11
+ * buildUrl('/users', { page: 1, limit: 10 }) // '/users?page=1&limit=10'
12
+ */
13
+ export declare function buildUrl(path: string, queryParams?: Record<string, string | number | boolean | undefined>): string;
14
+ /**
15
+ * Build full URL with path params and query params
16
+ * @example
17
+ * buildFullUrl('/users/:id', { id: '123' }, { include: 'posts' })
18
+ * // '/users/123?include=posts'
19
+ */
20
+ export declare function buildFullUrl(pattern: string, pathParams?: Record<string, string | number>, queryParams?: Record<string, string | number | boolean | undefined>): string;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildPath = buildPath;
4
+ exports.buildUrl = buildUrl;
5
+ exports.buildFullUrl = buildFullUrl;
6
+ /**
7
+ * Build URL path with parameters
8
+ * @example
9
+ * buildPath('/users/:id', { id: '123' }) // '/users/123'
10
+ * buildPath('/users/:id/posts/:postId', { id: '1', postId: '2' }) // '/users/1/posts/2'
11
+ */
12
+ function buildPath(pattern, params) {
13
+ if (!params) {
14
+ return pattern;
15
+ }
16
+ let path = pattern;
17
+ for (const [key, value] of Object.entries(params)) {
18
+ path = path.replace(`:${key}`, String(value));
19
+ }
20
+ return path;
21
+ }
22
+ /**
23
+ * Build URL with query parameters
24
+ * @example
25
+ * buildUrl('/users', { page: 1, limit: 10 }) // '/users?page=1&limit=10'
26
+ */
27
+ function buildUrl(path, queryParams) {
28
+ if (!queryParams || Object.keys(queryParams).length === 0) {
29
+ return path;
30
+ }
31
+ const query = Object.entries(queryParams)
32
+ .filter(([_, value]) => value !== undefined && value !== null)
33
+ .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`)
34
+ .join('&');
35
+ return query ? `${path}?${query}` : path;
36
+ }
37
+ /**
38
+ * Build full URL with path params and query params
39
+ * @example
40
+ * buildFullUrl('/users/:id', { id: '123' }, { include: 'posts' })
41
+ * // '/users/123?include=posts'
42
+ */
43
+ function buildFullUrl(pattern, pathParams, queryParams) {
44
+ const path = buildPath(pattern, pathParams);
45
+ return buildUrl(path, queryParams);
46
+ }
@@ -2,11 +2,9 @@ import { z } from 'zod';
2
2
  import { HttpMethod } from '../../../shared/http-method';
3
3
  export declare namespace AuthDeleteSessionCommand {
4
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 URL: (sessionId: string) => string;
5
+ const Response: z.ZodObject<{}, z.core.$strip>;
6
+ const PATH: "sessions/:id";
7
+ const URL: (id: string) => string;
10
8
  const METHOD = HttpMethod.DELETE;
11
9
  type RequestType = z.infer<typeof Request>;
12
10
  type ResponseType = z.infer<typeof Response>;
@@ -2,13 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AuthDeleteSessionCommand = void 0;
4
4
  const zod_1 = require("zod");
5
- const auth_paths_1 = require("../auth.paths");
5
+ const auth_routes_1 = require("../routes/auth.routes");
6
+ const rest_api_1 = require("../../../rest-api");
6
7
  const http_method_1 = require("../../../shared/http-method");
7
8
  const common_schemas_1 = require("../../../shared/common-schemas");
8
9
  var AuthDeleteSessionCommand;
9
10
  (function (AuthDeleteSessionCommand) {
10
- AuthDeleteSessionCommand.Request = zod_1.z.object({}); // Session ID in URL params
11
- AuthDeleteSessionCommand.Response = zod_1.z.union([common_schemas_1.EmptyResponseSchema, common_schemas_1.ErrorResponseSchema]);
12
- AuthDeleteSessionCommand.URL = (sessionId) => auth_paths_1.AUTH_API_PATHS.SESSION_BY_ID(sessionId);
11
+ // Request/Response
12
+ AuthDeleteSessionCommand.Request = zod_1.z.object({});
13
+ AuthDeleteSessionCommand.Response = common_schemas_1.EmptyResponseSchema;
14
+ // Path/URL/Method
15
+ AuthDeleteSessionCommand.PATH = auth_routes_1.AUTH_ROUTES.SESSION_BY_ID;
16
+ AuthDeleteSessionCommand.URL = (id) => rest_api_1.REST_API.V1.AUTH.SESSION_BY_ID(id);
13
17
  AuthDeleteSessionCommand.METHOD = http_method_1.HttpMethod.DELETE;
14
18
  })(AuthDeleteSessionCommand || (exports.AuthDeleteSessionCommand = AuthDeleteSessionCommand = {}));
@@ -5,7 +5,7 @@ export declare namespace AuthLoginCommand {
5
5
  email: z.ZodString;
6
6
  password: z.ZodString;
7
7
  }, z.core.$strip>;
8
- const Response: z.ZodUnion<readonly [z.ZodObject<{
8
+ const Response: z.ZodObject<{
9
9
  user: z.ZodObject<{
10
10
  uuid: z.ZodString;
11
11
  email: z.ZodString;
@@ -23,10 +23,8 @@ export declare namespace AuthLoginCommand {
23
23
  createdAt: z.ZodString;
24
24
  lastUsedAt: z.ZodString;
25
25
  }, z.core.$strip>;
26
- }, z.core.$strip>, z.ZodObject<{
27
- code: z.ZodString;
28
- details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
29
- }, z.core.$strip>]>;
26
+ }, z.core.$strip>;
27
+ const PATH: "login";
30
28
  const URL: "/api/v1/auth/login";
31
29
  const METHOD = HttpMethod.POST;
32
30
  type RequestType = z.infer<typeof Request>;
@@ -1,16 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AuthLoginCommand = void 0;
4
- const zod_1 = require("zod");
5
4
  const login_request_schema_1 = require("../schemas/login-request.schema");
6
5
  const auth_response_schema_1 = require("../schemas/auth-response.schema");
7
- const auth_paths_1 = require("../auth.paths");
6
+ const auth_routes_1 = require("../routes/auth.routes");
7
+ const rest_api_1 = require("../../../rest-api");
8
8
  const http_method_1 = require("../../../shared/http-method");
9
- const common_schemas_1 = require("../../../shared/common-schemas");
10
9
  var AuthLoginCommand;
11
10
  (function (AuthLoginCommand) {
11
+ // Request/Response
12
12
  AuthLoginCommand.Request = login_request_schema_1.LoginRequestSchema;
13
- AuthLoginCommand.Response = zod_1.z.union([auth_response_schema_1.AuthResponseSchema, common_schemas_1.ErrorResponseSchema]);
14
- AuthLoginCommand.URL = auth_paths_1.AUTH_API_PATHS.LOGIN;
13
+ AuthLoginCommand.Response = auth_response_schema_1.AuthResponseSchema;
14
+ // Path/URL/Method
15
+ AuthLoginCommand.PATH = auth_routes_1.AUTH_ROUTES.LOGIN;
16
+ AuthLoginCommand.URL = rest_api_1.REST_API.V1.AUTH.LOGIN;
15
17
  AuthLoginCommand.METHOD = http_method_1.HttpMethod.POST;
16
18
  })(AuthLoginCommand || (exports.AuthLoginCommand = AuthLoginCommand = {}));
@@ -2,10 +2,8 @@ import { z } from 'zod';
2
2
  import { HttpMethod } from '../../../shared/http-method';
3
3
  export declare namespace AuthLogoutAllCommand {
4
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>]>;
5
+ const Response: z.ZodObject<{}, z.core.$strip>;
6
+ const PATH: "logout-all";
9
7
  const URL: "/api/v1/auth/logout-all";
10
8
  const METHOD = HttpMethod.POST;
11
9
  type RequestType = z.infer<typeof Request>;
@@ -2,13 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AuthLogoutAllCommand = void 0;
4
4
  const zod_1 = require("zod");
5
- const auth_paths_1 = require("../auth.paths");
5
+ const auth_routes_1 = require("../routes/auth.routes");
6
+ const rest_api_1 = require("../../../rest-api");
6
7
  const http_method_1 = require("../../../shared/http-method");
7
8
  const common_schemas_1 = require("../../../shared/common-schemas");
8
9
  var AuthLogoutAllCommand;
9
10
  (function (AuthLogoutAllCommand) {
10
- AuthLogoutAllCommand.Request = zod_1.z.object({}); // No request body
11
- AuthLogoutAllCommand.Response = zod_1.z.union([common_schemas_1.EmptyResponseSchema, common_schemas_1.ErrorResponseSchema]);
12
- AuthLogoutAllCommand.URL = auth_paths_1.AUTH_API_PATHS.LOGOUT_ALL;
11
+ // Request/Response
12
+ AuthLogoutAllCommand.Request = zod_1.z.object({});
13
+ AuthLogoutAllCommand.Response = common_schemas_1.EmptyResponseSchema;
14
+ // Path/URL/Method
15
+ AuthLogoutAllCommand.PATH = auth_routes_1.AUTH_ROUTES.LOGOUT_ALL;
16
+ AuthLogoutAllCommand.URL = rest_api_1.REST_API.V1.AUTH.LOGOUT_ALL;
13
17
  AuthLogoutAllCommand.METHOD = http_method_1.HttpMethod.POST;
14
18
  })(AuthLogoutAllCommand || (exports.AuthLogoutAllCommand = AuthLogoutAllCommand = {}));
@@ -2,10 +2,8 @@ import { z } from 'zod';
2
2
  import { HttpMethod } from '../../../shared/http-method';
3
3
  export declare namespace AuthLogoutCommand {
4
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>]>;
5
+ const Response: z.ZodObject<{}, z.core.$strip>;
6
+ const PATH: "logout";
9
7
  const URL: "/api/v1/auth/logout";
10
8
  const METHOD = HttpMethod.POST;
11
9
  type RequestType = z.infer<typeof Request>;
@@ -2,13 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AuthLogoutCommand = void 0;
4
4
  const zod_1 = require("zod");
5
- const auth_paths_1 = require("../auth.paths");
5
+ const auth_routes_1 = require("../routes/auth.routes");
6
+ const rest_api_1 = require("../../../rest-api");
6
7
  const http_method_1 = require("../../../shared/http-method");
7
8
  const common_schemas_1 = require("../../../shared/common-schemas");
8
9
  var AuthLogoutCommand;
9
10
  (function (AuthLogoutCommand) {
10
- AuthLogoutCommand.Request = zod_1.z.object({}); // No request body
11
- AuthLogoutCommand.Response = zod_1.z.union([common_schemas_1.EmptyResponseSchema, common_schemas_1.ErrorResponseSchema]);
12
- AuthLogoutCommand.URL = auth_paths_1.AUTH_API_PATHS.LOGOUT;
11
+ // Request/Response
12
+ AuthLogoutCommand.Request = zod_1.z.object({});
13
+ AuthLogoutCommand.Response = common_schemas_1.EmptyResponseSchema;
14
+ // Path/URL/Method
15
+ AuthLogoutCommand.PATH = auth_routes_1.AUTH_ROUTES.LOGOUT;
16
+ AuthLogoutCommand.URL = rest_api_1.REST_API.V1.AUTH.LOGOUT;
13
17
  AuthLogoutCommand.METHOD = http_method_1.HttpMethod.POST;
14
18
  })(AuthLogoutCommand || (exports.AuthLogoutCommand = AuthLogoutCommand = {}));
@@ -14,7 +14,7 @@ export declare namespace AuthSignupCommand {
14
14
  utmTerm: z.ZodOptional<z.ZodString>;
15
15
  }, z.core.$strip>>;
16
16
  }, z.core.$strip>;
17
- const Response: z.ZodUnion<readonly [z.ZodObject<{
17
+ const Response: z.ZodObject<{
18
18
  user: z.ZodObject<{
19
19
  uuid: z.ZodString;
20
20
  email: z.ZodString;
@@ -32,10 +32,8 @@ export declare namespace AuthSignupCommand {
32
32
  createdAt: z.ZodString;
33
33
  lastUsedAt: z.ZodString;
34
34
  }, z.core.$strip>;
35
- }, z.core.$strip>, z.ZodObject<{
36
- code: z.ZodString;
37
- details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
38
- }, z.core.$strip>]>;
35
+ }, z.core.$strip>;
36
+ const PATH: "signup";
39
37
  const URL: "/api/v1/auth/signup";
40
38
  const METHOD = HttpMethod.POST;
41
39
  type RequestType = z.infer<typeof Request>;
@@ -1,16 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AuthSignupCommand = void 0;
4
- const zod_1 = require("zod");
5
4
  const signup_request_schema_1 = require("../schemas/signup-request.schema");
6
5
  const auth_response_schema_1 = require("../schemas/auth-response.schema");
7
- const auth_paths_1 = require("../auth.paths");
6
+ const auth_routes_1 = require("../routes/auth.routes");
7
+ const rest_api_1 = require("../../../rest-api");
8
8
  const http_method_1 = require("../../../shared/http-method");
9
- const common_schemas_1 = require("../../../shared/common-schemas");
10
9
  var AuthSignupCommand;
11
10
  (function (AuthSignupCommand) {
11
+ // Request/Response
12
12
  AuthSignupCommand.Request = signup_request_schema_1.SignUpRequestSchema;
13
- AuthSignupCommand.Response = zod_1.z.union([auth_response_schema_1.AuthResponseSchema, common_schemas_1.ErrorResponseSchema]);
14
- AuthSignupCommand.URL = auth_paths_1.AUTH_API_PATHS.SIGNUP;
13
+ AuthSignupCommand.Response = auth_response_schema_1.AuthResponseSchema;
14
+ // Path/URL/Method
15
+ AuthSignupCommand.PATH = auth_routes_1.AUTH_ROUTES.SIGNUP;
16
+ AuthSignupCommand.URL = rest_api_1.REST_API.V1.AUTH.SIGNUP;
15
17
  AuthSignupCommand.METHOD = http_method_1.HttpMethod.POST;
16
18
  })(AuthSignupCommand || (exports.AuthSignupCommand = AuthSignupCommand = {}));
@@ -2,5 +2,7 @@ export * from './schemas';
2
2
  export * from './auth.types';
3
3
  export * from './auth.paths';
4
4
  export * from './auth.errors';
5
+ export * from './controllers';
6
+ export * from './routes/auth.routes';
5
7
  export * from './commands';
6
8
  export * from './queries';
@@ -18,5 +18,7 @@ __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
+ __exportStar(require("./controllers"), exports);
22
+ __exportStar(require("./routes/auth.routes"), exports);
21
23
  __exportStar(require("./commands"), exports);
22
24
  __exportStar(require("./queries"), exports);
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
  import { HttpMethod } from '../../../shared/http-method';
3
3
  export declare namespace AuthGetSessionsQuery {
4
4
  const Request: z.ZodObject<{}, z.core.$strip>;
5
- const Response: z.ZodUnion<readonly [z.ZodObject<{
5
+ const Response: z.ZodObject<{
6
6
  sessions: z.ZodArray<z.ZodObject<{
7
7
  uuid: z.ZodString;
8
8
  deviceName: z.ZodString;
@@ -11,10 +11,8 @@ export declare namespace AuthGetSessionsQuery {
11
11
  createdAt: z.ZodString;
12
12
  lastUsedAt: z.ZodString;
13
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>]>;
14
+ }, z.core.$strip>;
15
+ const PATH: "sessions";
18
16
  const URL: "/api/v1/auth/sessions";
19
17
  const METHOD = HttpMethod.GET;
20
18
  type RequestType = z.infer<typeof Request>;
@@ -3,13 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AuthGetSessionsQuery = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const auth_response_schema_1 = require("../schemas/auth-response.schema");
6
- const auth_paths_1 = require("../auth.paths");
6
+ const auth_routes_1 = require("../routes/auth.routes");
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 AuthGetSessionsQuery;
10
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;
11
+ // Request/Response
12
+ AuthGetSessionsQuery.Request = zod_1.z.object({});
13
+ AuthGetSessionsQuery.Response = auth_response_schema_1.SessionsListResponseSchema;
14
+ // Path/URL/Method
15
+ AuthGetSessionsQuery.PATH = auth_routes_1.AUTH_ROUTES.SESSIONS;
16
+ AuthGetSessionsQuery.URL = rest_api_1.REST_API.V1.AUTH.SESSIONS;
14
17
  AuthGetSessionsQuery.METHOD = http_method_1.HttpMethod.GET;
15
18
  })(AuthGetSessionsQuery || (exports.AuthGetSessionsQuery = AuthGetSessionsQuery = {}));
@@ -7,7 +7,7 @@ export declare namespace AdminBlogCreateCategoryCommand {
7
7
  order: z.ZodDefault<z.ZodNumber>;
8
8
  status: z.ZodDefault<z.ZodEnum<typeof import("../../schemas").BlogCategoryStatus>>;
9
9
  }, z.core.$strip>;
10
- const Response: z.ZodUnion<readonly [z.ZodObject<{
10
+ const Response: z.ZodObject<{
11
11
  uuid: z.ZodString;
12
12
  alias: z.ZodString;
13
13
  title: z.ZodString;
@@ -15,10 +15,7 @@ export declare namespace AdminBlogCreateCategoryCommand {
15
15
  status: z.ZodEnum<typeof import("../../schemas").BlogCategoryStatus>;
16
16
  createdAt: z.ZodString;
17
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>]>;
18
+ }, z.core.$strip>;
22
19
  const PATH: "";
23
20
  const URL: "/api/v1/admin/blog/categories/";
24
21
  const METHOD = HttpMethod.POST;
@@ -1,18 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AdminBlogCreateCategoryCommand = void 0;
4
- const zod_1 = require("zod");
5
4
  const schemas_1 = require("../../schemas");
6
5
  const blog_admin_categories_routes_1 = require("../../routes/blog-admin-categories.routes");
7
6
  const rest_api_1 = require("../../../../rest-api");
8
7
  const http_method_1 = require("../../../../shared/http-method");
9
- const common_schemas_1 = require("../../../../shared/common-schemas");
10
8
  var AdminBlogCreateCategoryCommand;
11
9
  (function (AdminBlogCreateCategoryCommand) {
12
- // Request/Response
13
10
  AdminBlogCreateCategoryCommand.Request = schemas_1.CreateCategoryRequestSchema;
14
- AdminBlogCreateCategoryCommand.Response = zod_1.z.union([schemas_1.CategoryResponseSchema, common_schemas_1.ErrorResponseSchema]);
15
- // Path/URL/Method
11
+ AdminBlogCreateCategoryCommand.Response = schemas_1.CategoryResponseSchema;
16
12
  AdminBlogCreateCategoryCommand.PATH = blog_admin_categories_routes_1.BLOG_ADMIN_CATEGORIES_ROUTES.CREATE;
17
13
  AdminBlogCreateCategoryCommand.URL = rest_api_1.REST_API.V1.BLOG.ADMIN.CATEGORIES.CREATE;
18
14
  AdminBlogCreateCategoryCommand.METHOD = http_method_1.HttpMethod.POST;
@@ -12,7 +12,7 @@ export declare namespace AdminBlogCreatePostCommand {
12
12
  categoryIds: z.ZodArray<z.ZodString>;
13
13
  status: z.ZodDefault<z.ZodEnum<typeof import("../../schemas").BlogPostStatus>>;
14
14
  }, z.core.$strip>;
15
- const Response: z.ZodUnion<readonly [z.ZodObject<{
15
+ const Response: z.ZodObject<{
16
16
  uuid: z.ZodString;
17
17
  alias: z.ZodString;
18
18
  title: z.ZodString;
@@ -34,10 +34,7 @@ export declare namespace AdminBlogCreatePostCommand {
34
34
  status: z.ZodEnum<typeof import("../../schemas").BlogPostStatus>;
35
35
  createdAt: z.ZodString;
36
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>]>;
37
+ }, z.core.$strip>;
41
38
  const PATH: "";
42
39
  const URL: "/api/v1/admin/blog/posts/";
43
40
  const METHOD = HttpMethod.POST;
@@ -1,18 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AdminBlogCreatePostCommand = void 0;
4
- const zod_1 = require("zod");
5
4
  const schemas_1 = require("../../schemas");
6
5
  const blog_admin_posts_routes_1 = require("../../routes/blog-admin-posts.routes");
7
6
  const rest_api_1 = require("../../../../rest-api");
8
7
  const http_method_1 = require("../../../../shared/http-method");
9
- const common_schemas_1 = require("../../../../shared/common-schemas");
10
8
  var AdminBlogCreatePostCommand;
11
9
  (function (AdminBlogCreatePostCommand) {
12
- // Request/Response
13
10
  AdminBlogCreatePostCommand.Request = schemas_1.CreatePostRequestSchema;
14
- AdminBlogCreatePostCommand.Response = zod_1.z.union([schemas_1.PostResponseSchema, common_schemas_1.ErrorResponseSchema]);
15
- // Path/URL/Method
11
+ AdminBlogCreatePostCommand.Response = schemas_1.PostResponseSchema;
16
12
  AdminBlogCreatePostCommand.PATH = blog_admin_posts_routes_1.BLOG_ADMIN_POSTS_ROUTES.CREATE;
17
13
  AdminBlogCreatePostCommand.URL = rest_api_1.REST_API.V1.BLOG.ADMIN.POSTS.CREATE;
18
14
  AdminBlogCreatePostCommand.METHOD = http_method_1.HttpMethod.POST;
@@ -2,10 +2,7 @@ import { z } from 'zod';
2
2
  import { HttpMethod } from '../../../../shared/http-method';
3
3
  export declare namespace AdminBlogDeleteCategoryCommand {
4
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>]>;
5
+ const Response: z.ZodObject<{}, z.core.$strip>;
9
6
  const PATH: ":uuid";
10
7
  const URL: (uuid: string) => string;
11
8
  const METHOD = HttpMethod.DELETE;
@@ -8,10 +8,8 @@ const http_method_1 = require("../../../../shared/http-method");
8
8
  const common_schemas_1 = require("../../../../shared/common-schemas");
9
9
  var AdminBlogDeleteCategoryCommand;
10
10
  (function (AdminBlogDeleteCategoryCommand) {
11
- // Request/Response
12
11
  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
12
+ AdminBlogDeleteCategoryCommand.Response = common_schemas_1.EmptyResponseSchema;
15
13
  AdminBlogDeleteCategoryCommand.PATH = blog_admin_categories_routes_1.BLOG_ADMIN_CATEGORIES_ROUTES.DELETE;
16
14
  AdminBlogDeleteCategoryCommand.URL = (uuid) => rest_api_1.REST_API.V1.BLOG.ADMIN.CATEGORIES.DELETE(uuid);
17
15
  AdminBlogDeleteCategoryCommand.METHOD = http_method_1.HttpMethod.DELETE;
@@ -2,10 +2,7 @@ import { z } from 'zod';
2
2
  import { HttpMethod } from '../../../../shared/http-method';
3
3
  export declare namespace AdminBlogDeletePostCommand {
4
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>]>;
5
+ const Response: z.ZodObject<{}, z.core.$strip>;
9
6
  const PATH: ":uuid";
10
7
  const URL: (uuid: string) => string;
11
8
  const METHOD = HttpMethod.DELETE;
@@ -8,10 +8,8 @@ const http_method_1 = require("../../../../shared/http-method");
8
8
  const common_schemas_1 = require("../../../../shared/common-schemas");
9
9
  var AdminBlogDeletePostCommand;
10
10
  (function (AdminBlogDeletePostCommand) {
11
- // Request/Response
12
11
  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
12
+ AdminBlogDeletePostCommand.Response = common_schemas_1.EmptyResponseSchema;
15
13
  AdminBlogDeletePostCommand.PATH = blog_admin_posts_routes_1.BLOG_ADMIN_POSTS_ROUTES.DELETE;
16
14
  AdminBlogDeletePostCommand.URL = (uuid) => rest_api_1.REST_API.V1.BLOG.ADMIN.POSTS.DELETE(uuid);
17
15
  AdminBlogDeletePostCommand.METHOD = http_method_1.HttpMethod.DELETE;