@veruna/api-contracts 1.0.16 → 1.0.18

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 (68) hide show
  1. package/build/rest-api.d.ts +2 -0
  2. package/build/rest-api.js +2 -0
  3. package/build/routes/seo-pages-public.routes.d.ts +2 -0
  4. package/build/routes/seo-pages-public.routes.js +2 -0
  5. package/build/shared/common-schemas.d.ts +6 -7
  6. package/build/shared/common-schemas.js +17 -8
  7. package/build/shared/index.d.ts +1 -0
  8. package/build/shared/index.js +1 -0
  9. package/build/v1/auth/auth.errors.d.ts +2 -1
  10. package/build/v1/auth/auth.errors.js +5 -0
  11. package/build/v1/blog/admin/commands/create-category.command.d.ts +1 -1
  12. package/build/v1/blog/admin/commands/create-post.command.d.ts +1 -1
  13. package/build/v1/blog/admin/commands/delete-category.command.d.ts +3 -1
  14. package/build/v1/blog/admin/commands/delete-category.command.js +4 -4
  15. package/build/v1/blog/admin/commands/delete-post.command.d.ts +3 -1
  16. package/build/v1/blog/admin/commands/delete-post.command.js +4 -4
  17. package/build/v1/blog/admin/commands/update-category.command.d.ts +1 -1
  18. package/build/v1/blog/admin/commands/update-post.command.d.ts +1 -1
  19. package/build/v1/blog/admin/queries/get-category.query.d.ts +3 -1
  20. package/build/v1/blog/admin/queries/get-category.query.js +1 -2
  21. package/build/v1/blog/admin/queries/get-post.query.d.ts +3 -1
  22. package/build/v1/blog/admin/queries/get-post.query.js +1 -2
  23. package/build/v1/blog/admin/queries/get-posts.query.d.ts +1 -1
  24. package/build/v1/blog/public/queries/get-post-by-alias.query.d.ts +3 -1
  25. package/build/v1/blog/public/queries/get-post-by-alias.query.js +1 -2
  26. package/build/v1/blog/public/queries/get-posts.query.d.ts +1 -1
  27. package/build/v1/blog/public/queries/get-posts.query.js +2 -2
  28. package/build/v1/blog/schemas/create-category-request.schema.d.ts +1 -1
  29. package/build/v1/blog/schemas/create-category-request.schema.js +1 -1
  30. package/build/v1/blog/schemas/create-post-request.schema.d.ts +1 -1
  31. package/build/v1/blog/schemas/create-post-request.schema.js +2 -2
  32. package/build/v1/blog/schemas/get-posts-query.schema.d.ts +2 -2
  33. package/build/v1/blog/schemas/get-posts-query.schema.js +2 -2
  34. package/build/v1/blog/schemas/index.d.ts +1 -0
  35. package/build/v1/blog/schemas/index.js +1 -0
  36. package/build/v1/blog/schemas/route-params.schema.d.ts +17 -0
  37. package/build/v1/blog/schemas/route-params.schema.js +23 -0
  38. package/build/v1/blog/schemas/update-category-request.schema.d.ts +1 -1
  39. package/build/v1/blog/schemas/update-category-request.schema.js +1 -1
  40. package/build/v1/blog/schemas/update-post-request.schema.d.ts +1 -1
  41. package/build/v1/blog/schemas/update-post-request.schema.js +2 -2
  42. package/build/v1/seo-pages/admin/commands/create-page.command.d.ts +13 -1
  43. package/build/v1/seo-pages/admin/commands/update-page.command.d.ts +13 -1
  44. package/build/v1/seo-pages/admin/queries/get-page.query.d.ts +6 -0
  45. package/build/v1/seo-pages/admin/queries/get-pages.query.d.ts +6 -7
  46. package/build/v1/seo-pages/admin/queries/get-pages.query.js +1 -1
  47. package/build/v1/seo-pages/public/queries/get-hierarchy-list.query.d.ts +23 -0
  48. package/build/v1/seo-pages/public/queries/get-hierarchy-list.query.js +14 -0
  49. package/build/v1/seo-pages/public/queries/get-index-page.query.d.ts +33 -0
  50. package/build/v1/seo-pages/public/queries/get-index-page.query.js +14 -0
  51. package/build/v1/seo-pages/public/queries/get-page-by-alias.query.d.ts +6 -0
  52. package/build/v1/seo-pages/public/queries/index.d.ts +2 -0
  53. package/build/v1/seo-pages/public/queries/index.js +5 -1
  54. package/build/v1/seo-pages/schemas/create-page-request.schema.d.ts +7 -1
  55. package/build/v1/seo-pages/schemas/create-page-request.schema.js +14 -2
  56. package/build/v1/seo-pages/schemas/index.d.ts +2 -1
  57. package/build/v1/seo-pages/schemas/index.js +6 -1
  58. package/build/v1/seo-pages/schemas/page-hierarchy.schema.d.ts +48 -0
  59. package/build/v1/seo-pages/schemas/page-hierarchy.schema.js +30 -0
  60. package/build/v1/seo-pages/schemas/page-response.schema.d.ts +27 -1
  61. package/build/v1/seo-pages/schemas/page-response.schema.js +35 -7
  62. package/build/v1/seo-pages/schemas/page-type.enum.d.ts +6 -3
  63. package/build/v1/seo-pages/schemas/page-type.enum.js +6 -3
  64. package/build/v1/seo-pages/schemas/update-page-request.schema.d.ts +7 -1
  65. package/build/v1/seo-pages/schemas/update-page-request.schema.js +15 -2
  66. package/build/v1/seo-pages/seo-pages.errors.d.ts +8 -1
  67. package/build/v1/seo-pages/seo-pages.errors.js +37 -0
  68. package/package.json +1 -1
@@ -57,6 +57,8 @@ export declare const REST_API: {
57
57
  readonly DELETE: (uuid: string) => string;
58
58
  };
59
59
  readonly PUBLIC: {
60
+ readonly GET_INDEX: "/api/v1/seo-pages";
61
+ readonly GET_LIST: "/api/v1/seo-pages/list";
60
62
  readonly GET_BY_ALIAS: (alias: string) => string;
61
63
  };
62
64
  };
package/build/rest-api.js CHANGED
@@ -67,6 +67,8 @@ exports.REST_API = {
67
67
  DELETE: (uuid) => `${exports.ROOT}/${controllers_1.SEO_PAGES_ADMIN_CONTROLLER}/${uuid}`,
68
68
  },
69
69
  PUBLIC: {
70
+ GET_INDEX: `${exports.ROOT}/${controllers_1.SEO_PAGES_PUBLIC_CONTROLLER}`,
71
+ GET_LIST: `${exports.ROOT}/${controllers_1.SEO_PAGES_PUBLIC_CONTROLLER}/${routes_1.SEO_PAGES_PUBLIC_ROUTES.GET_LIST}`,
70
72
  GET_BY_ALIAS: (alias) => `${exports.ROOT}/${controllers_1.SEO_PAGES_PUBLIC_CONTROLLER}/${alias}`,
71
73
  },
72
74
  },
@@ -2,5 +2,7 @@
2
2
  * SEO Pages Public Routes
3
3
  */
4
4
  export declare const SEO_PAGES_PUBLIC_ROUTES: {
5
+ readonly GET_INDEX: "";
6
+ readonly GET_LIST: "list";
5
7
  readonly GET_BY_ALIAS: ":alias";
6
8
  };
@@ -5,5 +5,7 @@ exports.SEO_PAGES_PUBLIC_ROUTES = void 0;
5
5
  * SEO Pages Public Routes
6
6
  */
7
7
  exports.SEO_PAGES_PUBLIC_ROUTES = {
8
+ GET_INDEX: '', // GET /seo-pages (returns INDEX page)
9
+ GET_LIST: 'list', // GET /seo-pages/list (hierarchical list of MAIN pages with SUB children)
8
10
  GET_BY_ALIAS: ':alias', // GET /seo-pages/:alias
9
11
  };
@@ -1,4 +1,10 @@
1
1
  import { z } from 'zod';
2
+ /**
3
+ * Query parameter array transform
4
+ * Converts single string or array of strings to array
5
+ * Usage: queryArraySchema() for optional, queryArraySchema(false) for required
6
+ */
7
+ export declare const queryArraySchema: (optional?: boolean) => z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<string[], string | string[]>> | z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<string[], string | string[]>>>;
2
8
  /**
3
9
  * Empty Response (for void operations)
4
10
  */
@@ -9,10 +15,3 @@ export declare const EmptyResponseSchema: z.ZodObject<{}, z.core.$strip>;
9
15
  export declare const DeleteResponseSchema: z.ZodObject<{
10
16
  uuid: z.ZodString;
11
17
  }, z.core.$strip>;
12
- /**
13
- * Error Response Schema
14
- */
15
- export declare const ErrorResponseSchema: z.ZodObject<{
16
- code: z.ZodString;
17
- details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
18
- }, z.core.$strip>;
@@ -1,8 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ErrorResponseSchema = exports.DeleteResponseSchema = exports.EmptyResponseSchema = void 0;
3
+ exports.DeleteResponseSchema = exports.EmptyResponseSchema = exports.queryArraySchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const regex_1 = require("./regex");
6
+ /**
7
+ * Query parameter array transform
8
+ * Converts single string or array of strings to array
9
+ * Usage: queryArraySchema() for optional, queryArraySchema(false) for required
10
+ */
11
+ const queryArraySchema = (optional = true) => {
12
+ const schema = zod_1.z
13
+ .union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())])
14
+ .transform((val) => {
15
+ if (Array.isArray(val))
16
+ return val;
17
+ return [val];
18
+ });
19
+ return optional ? schema.optional() : schema;
20
+ };
21
+ exports.queryArraySchema = queryArraySchema;
6
22
  /**
7
23
  * Empty Response (for void operations)
8
24
  */
@@ -13,10 +29,3 @@ exports.EmptyResponseSchema = zod_1.z.object({});
13
29
  exports.DeleteResponseSchema = zod_1.z.object({
14
30
  uuid: zod_1.z.string().regex(regex_1.UUID_REGEX),
15
31
  });
16
- /**
17
- * Error Response Schema
18
- */
19
- exports.ErrorResponseSchema = zod_1.z.object({
20
- code: zod_1.z.string(),
21
- details: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional(),
22
- });
@@ -4,3 +4,4 @@ export * from './pagination.schema';
4
4
  export * from './common.errors';
5
5
  export * from './regex';
6
6
  export * from './device-type.enum';
7
+ export * from './common-schemas';
@@ -20,3 +20,4 @@ __exportStar(require("./pagination.schema"), exports);
20
20
  __exportStar(require("./common.errors"), exports);
21
21
  __exportStar(require("./regex"), exports);
22
22
  __exportStar(require("./device-type.enum"), exports);
23
+ __exportStar(require("./common-schemas"), exports);
@@ -10,6 +10,7 @@ export declare enum AuthErrorCode {
10
10
  PASSWORD_TOO_WEAK = "PASSWORD_TOO_WEAK",
11
11
  UNREG_USER_ALREADY_MIGRATED = "UNREG_USER_ALREADY_MIGRATED",
12
12
  SESSION_NOT_OWNED_BY_USER = "SESSION_NOT_OWNED_BY_USER",
13
- INSUFFICIENT_PERMISSIONS = "INSUFFICIENT_PERMISSIONS"
13
+ INSUFFICIENT_PERMISSIONS = "INSUFFICIENT_PERMISSIONS",
14
+ CANNOT_DELETE_CURRENT_SESSION = "CANNOT_DELETE_CURRENT_SESSION"
14
15
  }
15
16
  export declare const AUTH_ERRORS: Record<AuthErrorCode, ErrorMetadata>;
@@ -14,6 +14,7 @@ var AuthErrorCode;
14
14
  AuthErrorCode["UNREG_USER_ALREADY_MIGRATED"] = "UNREG_USER_ALREADY_MIGRATED";
15
15
  AuthErrorCode["SESSION_NOT_OWNED_BY_USER"] = "SESSION_NOT_OWNED_BY_USER";
16
16
  AuthErrorCode["INSUFFICIENT_PERMISSIONS"] = "INSUFFICIENT_PERMISSIONS";
17
+ AuthErrorCode["CANNOT_DELETE_CURRENT_SESSION"] = "CANNOT_DELETE_CURRENT_SESSION";
17
18
  })(AuthErrorCode || (exports.AuthErrorCode = AuthErrorCode = {}));
18
19
  exports.AUTH_ERRORS = {
19
20
  [AuthErrorCode.EMAIL_ALREADY_EXISTS]: {
@@ -42,4 +43,8 @@ exports.AUTH_ERRORS = {
42
43
  code: AuthErrorCode.INSUFFICIENT_PERMISSIONS,
43
44
  statusCode: 403,
44
45
  },
46
+ [AuthErrorCode.CANNOT_DELETE_CURRENT_SESSION]: {
47
+ code: AuthErrorCode.CANNOT_DELETE_CURRENT_SESSION,
48
+ statusCode: 400,
49
+ },
45
50
  };
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
  import { HttpMethod } from '../../../../shared/http-method';
3
3
  export declare namespace AdminBlogCreateCategoryCommand {
4
4
  const Request: z.ZodObject<{
5
- alias: z.ZodString;
5
+ alias: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
6
6
  title: z.ZodString;
7
7
  order: z.ZodDefault<z.ZodNumber>;
8
8
  status: z.ZodDefault<z.ZodEnum<typeof import("../../schemas").BlogCategoryStatus>>;
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
  import { HttpMethod } from '../../../../shared/http-method';
3
3
  export declare namespace AdminBlogCreatePostCommand {
4
4
  const Request: z.ZodObject<{
5
- alias: z.ZodString;
5
+ alias: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
6
6
  title: z.ZodString;
7
7
  metaTitle: z.ZodString;
8
8
  metaDescription: z.ZodString;
@@ -1,7 +1,9 @@
1
1
  import { z } from 'zod';
2
2
  import { HttpMethod } from '../../../../shared/http-method';
3
3
  export declare namespace AdminBlogDeleteCategoryCommand {
4
- const Request: z.ZodObject<{}, z.core.$strip>;
4
+ const Request: z.ZodObject<{
5
+ uuid: z.ZodString;
6
+ }, z.core.$strip>;
5
7
  const Response: z.ZodObject<{
6
8
  uuid: z.ZodString;
7
9
  }, z.core.$strip>;
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AdminBlogDeleteCategoryCommand = void 0;
4
- const zod_1 = require("zod");
5
4
  const rest_api_1 = require("../../../../rest-api");
6
5
  const http_method_1 = require("../../../../shared/http-method");
7
- const common_schemas_1 = require("../../../../shared/common-schemas");
6
+ const shared_1 = require("../../../../shared");
7
+ const schemas_1 = require("../../schemas");
8
8
  var AdminBlogDeleteCategoryCommand;
9
9
  (function (AdminBlogDeleteCategoryCommand) {
10
- AdminBlogDeleteCategoryCommand.Request = zod_1.z.object({});
11
- AdminBlogDeleteCategoryCommand.Response = common_schemas_1.DeleteResponseSchema;
10
+ AdminBlogDeleteCategoryCommand.Request = schemas_1.UuidParamSchema;
11
+ AdminBlogDeleteCategoryCommand.Response = shared_1.DeleteResponseSchema;
12
12
  AdminBlogDeleteCategoryCommand.URL = (uuid) => rest_api_1.REST_API.V1.BLOG.ADMIN.CATEGORIES.DELETE(uuid);
13
13
  AdminBlogDeleteCategoryCommand.METHOD = http_method_1.HttpMethod.DELETE;
14
14
  })(AdminBlogDeleteCategoryCommand || (exports.AdminBlogDeleteCategoryCommand = AdminBlogDeleteCategoryCommand = {}));
@@ -1,7 +1,9 @@
1
1
  import { z } from 'zod';
2
2
  import { HttpMethod } from '../../../../shared/http-method';
3
3
  export declare namespace AdminBlogDeletePostCommand {
4
- const Request: z.ZodObject<{}, z.core.$strip>;
4
+ const Request: z.ZodObject<{
5
+ uuid: z.ZodString;
6
+ }, z.core.$strip>;
5
7
  const Response: z.ZodObject<{
6
8
  uuid: z.ZodString;
7
9
  }, z.core.$strip>;
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AdminBlogDeletePostCommand = void 0;
4
- const zod_1 = require("zod");
5
4
  const rest_api_1 = require("../../../../rest-api");
6
5
  const http_method_1 = require("../../../../shared/http-method");
7
- const common_schemas_1 = require("../../../../shared/common-schemas");
6
+ const shared_1 = require("../../../../shared");
7
+ const schemas_1 = require("../../schemas");
8
8
  var AdminBlogDeletePostCommand;
9
9
  (function (AdminBlogDeletePostCommand) {
10
- AdminBlogDeletePostCommand.Request = zod_1.z.object({});
11
- AdminBlogDeletePostCommand.Response = common_schemas_1.DeleteResponseSchema;
10
+ AdminBlogDeletePostCommand.Request = schemas_1.UuidParamSchema;
11
+ AdminBlogDeletePostCommand.Response = shared_1.DeleteResponseSchema;
12
12
  AdminBlogDeletePostCommand.URL = (uuid) => rest_api_1.REST_API.V1.BLOG.ADMIN.POSTS.DELETE(uuid);
13
13
  AdminBlogDeletePostCommand.METHOD = http_method_1.HttpMethod.DELETE;
14
14
  })(AdminBlogDeletePostCommand || (exports.AdminBlogDeletePostCommand = AdminBlogDeletePostCommand = {}));
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
  import { HttpMethod } from '../../../../shared/http-method';
3
3
  export declare namespace AdminBlogUpdateCategoryCommand {
4
4
  const Request: z.ZodObject<{
5
- alias: z.ZodOptional<z.ZodString>;
5
+ alias: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
6
6
  title: z.ZodOptional<z.ZodString>;
7
7
  order: z.ZodOptional<z.ZodNumber>;
8
8
  status: z.ZodOptional<z.ZodEnum<typeof import("../../schemas").BlogCategoryStatus>>;
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
  import { HttpMethod } from '../../../../shared/http-method';
3
3
  export declare namespace AdminBlogUpdatePostCommand {
4
4
  const Request: z.ZodObject<{
5
- alias: z.ZodOptional<z.ZodString>;
5
+ alias: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
6
6
  title: z.ZodOptional<z.ZodString>;
7
7
  metaTitle: z.ZodOptional<z.ZodString>;
8
8
  metaDescription: z.ZodOptional<z.ZodString>;
@@ -1,7 +1,9 @@
1
1
  import { z } from 'zod';
2
2
  import { HttpMethod } from '../../../../shared/http-method';
3
3
  export declare namespace AdminBlogGetCategoryQuery {
4
- const Request: z.ZodObject<{}, z.core.$strip>;
4
+ const Request: z.ZodObject<{
5
+ uuid: z.ZodString;
6
+ }, z.core.$strip>;
5
7
  const Response: z.ZodObject<{
6
8
  uuid: z.ZodString;
7
9
  alias: z.ZodString;
@@ -1,13 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AdminBlogGetCategoryQuery = void 0;
4
- const zod_1 = require("zod");
5
4
  const schemas_1 = require("../../schemas");
6
5
  const rest_api_1 = require("../../../../rest-api");
7
6
  const http_method_1 = require("../../../../shared/http-method");
8
7
  var AdminBlogGetCategoryQuery;
9
8
  (function (AdminBlogGetCategoryQuery) {
10
- AdminBlogGetCategoryQuery.Request = zod_1.z.object({});
9
+ AdminBlogGetCategoryQuery.Request = schemas_1.UuidParamSchema;
11
10
  AdminBlogGetCategoryQuery.Response = schemas_1.CategoryResponseSchema;
12
11
  AdminBlogGetCategoryQuery.URL = (uuid) => rest_api_1.REST_API.V1.BLOG.ADMIN.CATEGORIES.GET_BY_UUID(uuid);
13
12
  AdminBlogGetCategoryQuery.METHOD = http_method_1.HttpMethod.GET;
@@ -1,7 +1,9 @@
1
1
  import { z } from 'zod';
2
2
  import { HttpMethod } from '../../../../shared/http-method';
3
3
  export declare namespace AdminBlogGetPostQuery {
4
- const Request: z.ZodObject<{}, z.core.$strip>;
4
+ const Request: z.ZodObject<{
5
+ uuid: z.ZodString;
6
+ }, z.core.$strip>;
5
7
  const Response: z.ZodObject<{
6
8
  uuid: z.ZodString;
7
9
  alias: z.ZodString;
@@ -1,13 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AdminBlogGetPostQuery = void 0;
4
- const zod_1 = require("zod");
5
4
  const schemas_1 = require("../../schemas");
6
5
  const rest_api_1 = require("../../../../rest-api");
7
6
  const http_method_1 = require("../../../../shared/http-method");
8
7
  var AdminBlogGetPostQuery;
9
8
  (function (AdminBlogGetPostQuery) {
10
- AdminBlogGetPostQuery.Request = zod_1.z.object({});
9
+ AdminBlogGetPostQuery.Request = schemas_1.UuidParamSchema;
11
10
  AdminBlogGetPostQuery.Response = schemas_1.PostResponseSchema;
12
11
  AdminBlogGetPostQuery.URL = (uuid) => rest_api_1.REST_API.V1.BLOG.ADMIN.POSTS.GET_BY_UUID(uuid);
13
12
  AdminBlogGetPostQuery.METHOD = http_method_1.HttpMethod.GET;
@@ -5,7 +5,7 @@ export declare namespace AdminBlogGetPostsQuery {
5
5
  page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
6
6
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
7
7
  status: z.ZodOptional<z.ZodEnum<typeof import("../../schemas").BlogPostStatus>>;
8
- categoryAliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
8
+ categoryAliases: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<string[], string | string[]>> | z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<string[], string | string[]>>>;
9
9
  }, z.core.$strip>;
10
10
  const Response: z.ZodObject<{
11
11
  data: z.ZodArray<z.ZodObject<{
@@ -1,7 +1,9 @@
1
1
  import { z } from 'zod';
2
2
  import { HttpMethod } from '../../../../shared/http-method';
3
3
  export declare namespace BlogGetPostByAliasQuery {
4
- const Request: z.ZodObject<{}, z.core.$strip>;
4
+ const Request: z.ZodObject<{
5
+ alias: z.ZodString;
6
+ }, z.core.$strip>;
5
7
  const Response: z.ZodObject<{
6
8
  uuid: z.ZodString;
7
9
  alias: z.ZodString;
@@ -1,13 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BlogGetPostByAliasQuery = void 0;
4
- const zod_1 = require("zod");
5
4
  const schemas_1 = require("../../schemas");
6
5
  const rest_api_1 = require("../../../../rest-api");
7
6
  const http_method_1 = require("../../../../shared/http-method");
8
7
  var BlogGetPostByAliasQuery;
9
8
  (function (BlogGetPostByAliasQuery) {
10
- BlogGetPostByAliasQuery.Request = zod_1.z.object({});
9
+ BlogGetPostByAliasQuery.Request = schemas_1.AliasParamSchema;
11
10
  BlogGetPostByAliasQuery.Response = schemas_1.PostResponseSchema;
12
11
  BlogGetPostByAliasQuery.URL = (alias) => rest_api_1.REST_API.V1.BLOG.PUBLIC.POSTS.GET_BY_ALIAS(alias);
13
12
  BlogGetPostByAliasQuery.METHOD = http_method_1.HttpMethod.GET;
@@ -4,7 +4,7 @@ export declare namespace BlogGetPostsQuery {
4
4
  const Request: z.ZodObject<{
5
5
  page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
6
6
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
7
- categoryAliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
7
+ categoryAliases: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<string[], string | string[]>> | z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<string[], string | string[]>>>;
8
8
  }, z.core.$strip>;
9
9
  const Response: z.ZodObject<{
10
10
  data: z.ZodArray<z.ZodObject<{
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BlogGetPostsQuery = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const schemas_1 = require("../../schemas");
6
- const pagination_schema_1 = require("../../../../shared/pagination.schema");
6
+ const shared_1 = require("../../../../shared");
7
7
  const rest_api_1 = require("../../../../rest-api");
8
8
  const http_method_1 = require("../../../../shared/http-method");
9
9
  const PostsListResponseSchema = zod_1.z.object({
10
10
  data: zod_1.z.array(schemas_1.PostResponseSchema),
11
- meta: pagination_schema_1.PaginationMetaSchema,
11
+ meta: shared_1.PaginationMetaSchema,
12
12
  });
13
13
  var BlogGetPostsQuery;
14
14
  (function (BlogGetPostsQuery) {
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { BlogCategoryStatus } from './blog-category-status.enum';
3
3
  export declare const CreateCategoryRequestSchema: z.ZodObject<{
4
- alias: z.ZodString;
4
+ alias: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
5
5
  title: z.ZodString;
6
6
  order: z.ZodDefault<z.ZodNumber>;
7
7
  status: z.ZodDefault<z.ZodEnum<typeof BlogCategoryStatus>>;
@@ -5,7 +5,7 @@ const zod_1 = require("zod");
5
5
  const shared_1 = require("../../../shared");
6
6
  const blog_category_status_enum_1 = require("./blog-category-status.enum");
7
7
  exports.CreateCategoryRequestSchema = zod_1.z.object({
8
- alias: zod_1.z.string().min(1).max(100).regex(shared_1.SLUG_REGEX),
8
+ alias: zod_1.z.string().min(1).max(100).regex(shared_1.SLUG_REGEX).transform(val => val.toLowerCase().trim()),
9
9
  title: zod_1.z.string().min(1).max(200),
10
10
  order: zod_1.z.number().int().nonnegative().default(0),
11
11
  status: zod_1.z.enum(blog_category_status_enum_1.BlogCategoryStatus).default(blog_category_status_enum_1.BlogCategoryStatus.DRAFT),
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { BlogPostStatus } from './blog-post-status.enum';
3
3
  export declare const CreatePostRequestSchema: z.ZodObject<{
4
- alias: z.ZodString;
4
+ alias: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
5
5
  title: z.ZodString;
6
6
  metaTitle: z.ZodString;
7
7
  metaDescription: z.ZodString;
@@ -5,11 +5,11 @@ const zod_1 = require("zod");
5
5
  const shared_1 = require("../../../shared");
6
6
  const blog_post_status_enum_1 = require("./blog-post-status.enum");
7
7
  exports.CreatePostRequestSchema = zod_1.z.object({
8
- alias: zod_1.z.string().min(1).max(200).regex(shared_1.SLUG_REGEX),
8
+ alias: zod_1.z.string().min(1).max(200).regex(shared_1.SLUG_REGEX).transform(val => val.toLowerCase().trim()),
9
9
  title: zod_1.z.string().min(1).max(300),
10
10
  metaTitle: zod_1.z.string().min(1).max(100),
11
11
  metaDescription: zod_1.z.string().min(1).max(200),
12
- content: zod_1.z.string().min(1),
12
+ content: zod_1.z.string().min(1).max(1000000),
13
13
  image: zod_1.z.string().url(),
14
14
  author: zod_1.z.string().min(1).max(100),
15
15
  categoryIds: zod_1.z.array(zod_1.z.string().regex(shared_1.UUID_REGEX)).min(1),
@@ -4,10 +4,10 @@ export declare const GetPostsQueryAdminSchema: z.ZodObject<{
4
4
  page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
5
5
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
6
6
  status: z.ZodOptional<z.ZodEnum<typeof BlogPostStatus>>;
7
- categoryAliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
7
+ categoryAliases: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<string[], string | string[]>> | z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<string[], string | string[]>>>;
8
8
  }, z.core.$strip>;
9
9
  export declare const GetPostsQueryPublicSchema: z.ZodObject<{
10
10
  page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
11
11
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
12
- categoryAliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
12
+ categoryAliases: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<string[], string | string[]>> | z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<string[], string | string[]>>>;
13
13
  }, z.core.$strip>;
@@ -6,8 +6,8 @@ const shared_1 = require("../../../shared");
6
6
  const blog_post_status_enum_1 = require("./blog-post-status.enum");
7
7
  exports.GetPostsQueryAdminSchema = shared_1.PaginationQuerySchema.extend({
8
8
  status: zod_1.z.enum(blog_post_status_enum_1.BlogPostStatus).optional(),
9
- categoryAliases: zod_1.z.array(zod_1.z.string()).optional(),
9
+ categoryAliases: (0, shared_1.queryArraySchema)(),
10
10
  });
11
11
  exports.GetPostsQueryPublicSchema = shared_1.PaginationQuerySchema.extend({
12
- categoryAliases: zod_1.z.array(zod_1.z.string()).optional(),
12
+ categoryAliases: (0, shared_1.queryArraySchema)(),
13
13
  });
@@ -7,3 +7,4 @@ export * from './post-response.schema';
7
7
  export * from './create-post-request.schema';
8
8
  export * from './update-post-request.schema';
9
9
  export * from './get-posts-query.schema';
10
+ export * from './route-params.schema';
@@ -23,3 +23,4 @@ __exportStar(require("./post-response.schema"), exports);
23
23
  __exportStar(require("./create-post-request.schema"), exports);
24
24
  __exportStar(require("./update-post-request.schema"), exports);
25
25
  __exportStar(require("./get-posts-query.schema"), exports);
26
+ __exportStar(require("./route-params.schema"), exports);
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Schema for UUID route parameter validation
4
+ * Used in admin endpoints: GET /posts/:uuid, DELETE /posts/:uuid, etc.
5
+ */
6
+ export declare const UuidParamSchema: z.ZodObject<{
7
+ uuid: z.ZodString;
8
+ }, z.core.$strip>;
9
+ /**
10
+ * Schema for alias route parameter validation
11
+ * Used in public endpoints: GET /posts/:alias
12
+ */
13
+ export declare const AliasParamSchema: z.ZodObject<{
14
+ alias: z.ZodString;
15
+ }, z.core.$strip>;
16
+ export type UuidParamType = z.infer<typeof UuidParamSchema>;
17
+ export type AliasParamType = z.infer<typeof AliasParamSchema>;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AliasParamSchema = exports.UuidParamSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const regex_1 = require("../../../shared/regex");
6
+ /**
7
+ * Schema for UUID route parameter validation
8
+ * Used in admin endpoints: GET /posts/:uuid, DELETE /posts/:uuid, etc.
9
+ */
10
+ exports.UuidParamSchema = zod_1.z.object({
11
+ uuid: zod_1.z.string().uuid({ message: 'Invalid UUID format' }),
12
+ });
13
+ /**
14
+ * Schema for alias route parameter validation
15
+ * Used in public endpoints: GET /posts/:alias
16
+ */
17
+ exports.AliasParamSchema = zod_1.z.object({
18
+ alias: zod_1.z
19
+ .string()
20
+ .min(1, { message: 'Alias cannot be empty' })
21
+ .max(200, { message: 'Alias too long (max 200 characters)' })
22
+ .regex(regex_1.SLUG_REGEX, { message: 'Alias must contain only lowercase letters, numbers, and hyphens' }),
23
+ });
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { BlogCategoryStatus } from './blog-category-status.enum';
3
3
  export declare const UpdateCategoryRequestSchema: z.ZodObject<{
4
- alias: z.ZodOptional<z.ZodString>;
4
+ alias: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
5
5
  title: z.ZodOptional<z.ZodString>;
6
6
  order: z.ZodOptional<z.ZodNumber>;
7
7
  status: z.ZodOptional<z.ZodEnum<typeof BlogCategoryStatus>>;
@@ -5,7 +5,7 @@ const zod_1 = require("zod");
5
5
  const regex_1 = require("../../../shared/regex");
6
6
  const blog_category_status_enum_1 = require("./blog-category-status.enum");
7
7
  exports.UpdateCategoryRequestSchema = zod_1.z.object({
8
- alias: zod_1.z.string().min(1).max(100).regex(regex_1.SLUG_REGEX).optional(),
8
+ alias: zod_1.z.string().min(1).max(100).regex(regex_1.SLUG_REGEX).transform(val => val.toLowerCase().trim()).optional(),
9
9
  title: zod_1.z.string().min(1).max(200).optional(),
10
10
  order: zod_1.z.number().int().nonnegative().optional(),
11
11
  status: zod_1.z.nativeEnum(blog_category_status_enum_1.BlogCategoryStatus).optional(),
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { BlogPostStatus } from './blog-post-status.enum';
3
3
  export declare const UpdatePostRequestSchema: z.ZodObject<{
4
- alias: z.ZodOptional<z.ZodString>;
4
+ alias: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
5
5
  title: z.ZodOptional<z.ZodString>;
6
6
  metaTitle: z.ZodOptional<z.ZodString>;
7
7
  metaDescription: z.ZodOptional<z.ZodString>;
@@ -5,11 +5,11 @@ const zod_1 = require("zod");
5
5
  const regex_1 = require("../../../shared/regex");
6
6
  const blog_post_status_enum_1 = require("./blog-post-status.enum");
7
7
  exports.UpdatePostRequestSchema = zod_1.z.object({
8
- alias: zod_1.z.string().min(1).max(200).regex(regex_1.SLUG_REGEX).optional(),
8
+ alias: zod_1.z.string().min(1).max(200).regex(regex_1.SLUG_REGEX).transform(val => val.toLowerCase().trim()).optional(),
9
9
  title: zod_1.z.string().min(1).max(300).optional(),
10
10
  metaTitle: zod_1.z.string().min(1).max(100).optional(),
11
11
  metaDescription: zod_1.z.string().min(1).max(200).optional(),
12
- content: zod_1.z.string().min(1).optional(),
12
+ content: zod_1.z.string().min(1).max(1000000).optional(),
13
13
  image: zod_1.z.string().url().optional(),
14
14
  author: zod_1.z.string().min(1).max(100).optional(),
15
15
  categoryIds: zod_1.z.array(zod_1.z.string().regex(regex_1.UUID_REGEX)).min(1).optional(),
@@ -7,14 +7,20 @@ export declare namespace AdminSeoPageCreatePageCommand {
7
7
  title: z.ZodString;
8
8
  description: z.ZodString;
9
9
  content: z.ZodString;
10
- alias: z.ZodString;
10
+ alias: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
11
11
  type: z.ZodEnum<typeof import("../../schemas").PageType>;
12
+ icon: z.ZodString;
12
13
  faq: z.ZodOptional<z.ZodObject<{
13
14
  items: z.ZodDefault<z.ZodArray<z.ZodObject<{
14
15
  question: z.ZodString;
15
16
  answer: z.ZodString;
16
17
  }, z.core.$strip>>>;
17
18
  }, z.core.$strip>>;
19
+ parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
20
+ order: z.ZodDefault<z.ZodNumber>;
21
+ placeholder: z.ZodOptional<z.ZodNullable<z.ZodString>>;
22
+ seoName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
23
+ marks: z.ZodDefault<z.ZodArray<z.ZodString>>;
18
24
  }, z.core.$strip>;
19
25
  const Response: z.ZodObject<{
20
26
  uuid: z.ZodString;
@@ -25,12 +31,18 @@ export declare namespace AdminSeoPageCreatePageCommand {
25
31
  content: z.ZodString;
26
32
  alias: z.ZodString;
27
33
  type: z.ZodEnum<typeof import("../../schemas").PageType>;
34
+ icon: z.ZodString;
28
35
  faq: z.ZodObject<{
29
36
  items: z.ZodDefault<z.ZodArray<z.ZodObject<{
30
37
  question: z.ZodString;
31
38
  answer: z.ZodString;
32
39
  }, z.core.$strip>>>;
33
40
  }, z.core.$strip>;
41
+ parentId: z.ZodNullable<z.ZodString>;
42
+ order: z.ZodNumber;
43
+ placeholder: z.ZodNullable<z.ZodString>;
44
+ seoName: z.ZodNullable<z.ZodString>;
45
+ marks: z.ZodArray<z.ZodString>;
34
46
  createdAt: z.ZodString;
35
47
  updatedAt: z.ZodString;
36
48
  }, z.core.$strip>;
@@ -7,14 +7,20 @@ export declare namespace AdminSeoPageUpdatePageCommand {
7
7
  title: z.ZodOptional<z.ZodString>;
8
8
  description: z.ZodOptional<z.ZodString>;
9
9
  content: z.ZodOptional<z.ZodString>;
10
- alias: z.ZodOptional<z.ZodString>;
10
+ alias: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
11
11
  type: z.ZodOptional<z.ZodEnum<typeof import("../../schemas").PageType>>;
12
+ icon: z.ZodOptional<z.ZodString>;
12
13
  faq: z.ZodOptional<z.ZodObject<{
13
14
  items: z.ZodDefault<z.ZodArray<z.ZodObject<{
14
15
  question: z.ZodString;
15
16
  answer: z.ZodString;
16
17
  }, z.core.$strip>>>;
17
18
  }, z.core.$strip>>;
19
+ parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
20
+ order: z.ZodOptional<z.ZodNumber>;
21
+ placeholder: z.ZodOptional<z.ZodNullable<z.ZodString>>;
22
+ seoName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
23
+ marks: z.ZodOptional<z.ZodArray<z.ZodString>>;
18
24
  }, z.core.$strip>;
19
25
  const Response: z.ZodObject<{
20
26
  uuid: z.ZodString;
@@ -25,12 +31,18 @@ export declare namespace AdminSeoPageUpdatePageCommand {
25
31
  content: z.ZodString;
26
32
  alias: z.ZodString;
27
33
  type: z.ZodEnum<typeof import("../../schemas").PageType>;
34
+ icon: z.ZodString;
28
35
  faq: z.ZodObject<{
29
36
  items: z.ZodDefault<z.ZodArray<z.ZodObject<{
30
37
  question: z.ZodString;
31
38
  answer: z.ZodString;
32
39
  }, z.core.$strip>>>;
33
40
  }, z.core.$strip>;
41
+ parentId: z.ZodNullable<z.ZodString>;
42
+ order: z.ZodNumber;
43
+ placeholder: z.ZodNullable<z.ZodString>;
44
+ seoName: z.ZodNullable<z.ZodString>;
45
+ marks: z.ZodArray<z.ZodString>;
34
46
  createdAt: z.ZodString;
35
47
  updatedAt: z.ZodString;
36
48
  }, z.core.$strip>;