@veruna/api-contracts 1.0.14 → 1.0.15

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 (53) hide show
  1. package/build/controllers/index.d.ts +1 -0
  2. package/build/controllers/index.js +4 -1
  3. package/build/controllers/seo-pages.controllers.d.ts +5 -0
  4. package/build/controllers/seo-pages.controllers.js +8 -0
  5. package/build/rest-api.d.ts +12 -0
  6. package/build/rest-api.js +13 -0
  7. package/build/routes/index.d.ts +2 -0
  8. package/build/routes/index.js +5 -1
  9. package/build/routes/seo-pages-admin.routes.d.ts +10 -0
  10. package/build/routes/seo-pages-admin.routes.js +13 -0
  11. package/build/routes/seo-pages-public.routes.d.ts +6 -0
  12. package/build/routes/seo-pages-public.routes.js +9 -0
  13. package/build/v1/blog/blog.errors.d.ts +18 -0
  14. package/build/v1/blog/blog.errors.js +84 -0
  15. package/build/v1/blog/index.d.ts +1 -0
  16. package/build/v1/blog/index.js +1 -0
  17. package/build/v1/blog/schemas/create-category-request.schema.js +3 -3
  18. package/build/v1/blog/schemas/create-post-request.schema.js +4 -4
  19. package/build/v1/index.d.ts +1 -0
  20. package/build/v1/index.js +1 -0
  21. package/build/v1/seo-pages/admin/commands/create-page.command.d.ts +29 -0
  22. package/build/v1/seo-pages/admin/commands/create-page.command.js +13 -0
  23. package/build/v1/seo-pages/admin/commands/delete-page.command.d.ts +12 -0
  24. package/build/v1/seo-pages/admin/commands/delete-page.command.js +13 -0
  25. package/build/v1/seo-pages/admin/commands/index.d.ts +6 -0
  26. package/build/v1/seo-pages/admin/commands/index.js +12 -0
  27. package/build/v1/seo-pages/admin/commands/update-page.command.d.ts +29 -0
  28. package/build/v1/seo-pages/admin/commands/update-page.command.js +13 -0
  29. package/build/v1/seo-pages/admin/queries/get-page.query.d.ts +21 -0
  30. package/build/v1/seo-pages/admin/queries/get-page.query.js +14 -0
  31. package/build/v1/seo-pages/admin/queries/get-pages.query.d.ts +34 -0
  32. package/build/v1/seo-pages/admin/queries/get-pages.query.js +19 -0
  33. package/build/v1/seo-pages/admin/queries/index.d.ts +5 -0
  34. package/build/v1/seo-pages/admin/queries/index.js +10 -0
  35. package/build/v1/seo-pages/index.d.ts +8 -0
  36. package/build/v1/seo-pages/index.js +32 -0
  37. package/build/v1/seo-pages/public/queries/get-page-by-alias.query.d.ts +21 -0
  38. package/build/v1/seo-pages/public/queries/get-page-by-alias.query.js +14 -0
  39. package/build/v1/seo-pages/public/queries/index.d.ts +4 -0
  40. package/build/v1/seo-pages/public/queries/index.js +8 -0
  41. package/build/v1/seo-pages/schemas/create-page-request.schema.d.ts +14 -0
  42. package/build/v1/seo-pages/schemas/create-page-request.schema.js +18 -0
  43. package/build/v1/seo-pages/schemas/index.d.ts +7 -0
  44. package/build/v1/seo-pages/schemas/index.js +14 -0
  45. package/build/v1/seo-pages/schemas/page-response.schema.d.ts +17 -0
  46. package/build/v1/seo-pages/schemas/page-response.schema.js +21 -0
  47. package/build/v1/seo-pages/schemas/page-type.enum.d.ts +8 -0
  48. package/build/v1/seo-pages/schemas/page-type.enum.js +12 -0
  49. package/build/v1/seo-pages/schemas/update-page-request.schema.d.ts +14 -0
  50. package/build/v1/seo-pages/schemas/update-page-request.schema.js +18 -0
  51. package/build/v1/seo-pages/seo-pages.errors.d.ts +11 -0
  52. package/build/v1/seo-pages/seo-pages.errors.js +43 -0
  53. package/package.json +1 -1
@@ -5,3 +5,4 @@ export { AUTH_CONTROLLER } from './auth.controllers';
5
5
  export { USERS_CONTROLLER } from './users.controllers';
6
6
  export { UNREG_USERS_CONTROLLER } from './unreg-users.controllers';
7
7
  export { BLOG_ADMIN_CATEGORIES_CONTROLLER, BLOG_ADMIN_POSTS_CONTROLLER, BLOG_PUBLIC_CATEGORIES_CONTROLLER, BLOG_PUBLIC_POSTS_CONTROLLER, } from './blog.controllers';
8
+ export { SEO_PAGES_ADMIN_CONTROLLER, SEO_PAGES_PUBLIC_CONTROLLER, } from './seo-pages.controllers';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BLOG_PUBLIC_POSTS_CONTROLLER = exports.BLOG_PUBLIC_CATEGORIES_CONTROLLER = exports.BLOG_ADMIN_POSTS_CONTROLLER = exports.BLOG_ADMIN_CATEGORIES_CONTROLLER = exports.UNREG_USERS_CONTROLLER = exports.USERS_CONTROLLER = exports.AUTH_CONTROLLER = void 0;
3
+ exports.SEO_PAGES_PUBLIC_CONTROLLER = exports.SEO_PAGES_ADMIN_CONTROLLER = exports.BLOG_PUBLIC_POSTS_CONTROLLER = exports.BLOG_PUBLIC_CATEGORIES_CONTROLLER = exports.BLOG_ADMIN_POSTS_CONTROLLER = exports.BLOG_ADMIN_CATEGORIES_CONTROLLER = exports.UNREG_USERS_CONTROLLER = exports.USERS_CONTROLLER = exports.AUTH_CONTROLLER = void 0;
4
4
  /**
5
5
  * Centralized exports for all controllers
6
6
  */
@@ -15,3 +15,6 @@ Object.defineProperty(exports, "BLOG_ADMIN_CATEGORIES_CONTROLLER", { enumerable:
15
15
  Object.defineProperty(exports, "BLOG_ADMIN_POSTS_CONTROLLER", { enumerable: true, get: function () { return blog_controllers_1.BLOG_ADMIN_POSTS_CONTROLLER; } });
16
16
  Object.defineProperty(exports, "BLOG_PUBLIC_CATEGORIES_CONTROLLER", { enumerable: true, get: function () { return blog_controllers_1.BLOG_PUBLIC_CATEGORIES_CONTROLLER; } });
17
17
  Object.defineProperty(exports, "BLOG_PUBLIC_POSTS_CONTROLLER", { enumerable: true, get: function () { return blog_controllers_1.BLOG_PUBLIC_POSTS_CONTROLLER; } });
18
+ var seo_pages_controllers_1 = require("./seo-pages.controllers");
19
+ Object.defineProperty(exports, "SEO_PAGES_ADMIN_CONTROLLER", { enumerable: true, get: function () { return seo_pages_controllers_1.SEO_PAGES_ADMIN_CONTROLLER; } });
20
+ Object.defineProperty(exports, "SEO_PAGES_PUBLIC_CONTROLLER", { enumerable: true, get: function () { return seo_pages_controllers_1.SEO_PAGES_PUBLIC_CONTROLLER; } });
@@ -0,0 +1,5 @@
1
+ /**
2
+ * SEO Pages Controller paths for NestJS @Controller decorator
3
+ */
4
+ export declare const SEO_PAGES_ADMIN_CONTROLLER: "v1/admin/seo-pages";
5
+ export declare const SEO_PAGES_PUBLIC_CONTROLLER: "v1/seo-pages";
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SEO_PAGES_PUBLIC_CONTROLLER = exports.SEO_PAGES_ADMIN_CONTROLLER = void 0;
4
+ /**
5
+ * SEO Pages Controller paths for NestJS @Controller decorator
6
+ */
7
+ exports.SEO_PAGES_ADMIN_CONTROLLER = 'v1/admin/seo-pages';
8
+ exports.SEO_PAGES_PUBLIC_CONTROLLER = 'v1/seo-pages';
@@ -48,5 +48,17 @@ export declare const REST_API: {
48
48
  };
49
49
  };
50
50
  };
51
+ readonly SEO_PAGES: {
52
+ readonly ADMIN: {
53
+ readonly CREATE: "/api/v1/admin/seo-pages/";
54
+ readonly GET_ALL: "/api/v1/admin/seo-pages/";
55
+ readonly GET_BY_UUID: (uuid: string) => string;
56
+ readonly UPDATE: (uuid: string) => string;
57
+ readonly DELETE: (uuid: string) => string;
58
+ };
59
+ readonly PUBLIC: {
60
+ readonly GET_BY_ALIAS: (alias: string) => string;
61
+ };
62
+ };
51
63
  };
52
64
  };
package/build/rest-api.js CHANGED
@@ -57,5 +57,18 @@ exports.REST_API = {
57
57
  },
58
58
  },
59
59
  },
60
+ // SEO Pages module
61
+ SEO_PAGES: {
62
+ ADMIN: {
63
+ CREATE: `${exports.ROOT}/${controllers_1.SEO_PAGES_ADMIN_CONTROLLER}/${routes_1.SEO_PAGES_ADMIN_ROUTES.CREATE}`,
64
+ GET_ALL: `${exports.ROOT}/${controllers_1.SEO_PAGES_ADMIN_CONTROLLER}/${routes_1.SEO_PAGES_ADMIN_ROUTES.GET_ALL}`,
65
+ GET_BY_UUID: (uuid) => `${exports.ROOT}/${controllers_1.SEO_PAGES_ADMIN_CONTROLLER}/${uuid}`,
66
+ UPDATE: (uuid) => `${exports.ROOT}/${controllers_1.SEO_PAGES_ADMIN_CONTROLLER}/${uuid}`,
67
+ DELETE: (uuid) => `${exports.ROOT}/${controllers_1.SEO_PAGES_ADMIN_CONTROLLER}/${uuid}`,
68
+ },
69
+ PUBLIC: {
70
+ GET_BY_ALIAS: (alias) => `${exports.ROOT}/${controllers_1.SEO_PAGES_PUBLIC_CONTROLLER}/${alias}`,
71
+ },
72
+ },
60
73
  },
61
74
  };
@@ -7,3 +7,5 @@ export { UNREG_USERS_ROUTES } from './unreg-users.routes';
7
7
  export { BLOG_ADMIN_CATEGORIES_ROUTES } from './blog-admin-categories.routes';
8
8
  export { BLOG_ADMIN_POSTS_ROUTES } from './blog-admin-posts.routes';
9
9
  export { BLOG_PUBLIC_CATEGORIES_ROUTES, BLOG_PUBLIC_POSTS_ROUTES } from './blog-public.routes';
10
+ export { SEO_PAGES_ADMIN_ROUTES } from './seo-pages-admin.routes';
11
+ export { SEO_PAGES_PUBLIC_ROUTES } from './seo-pages-public.routes';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BLOG_PUBLIC_POSTS_ROUTES = exports.BLOG_PUBLIC_CATEGORIES_ROUTES = exports.BLOG_ADMIN_POSTS_ROUTES = exports.BLOG_ADMIN_CATEGORIES_ROUTES = exports.UNREG_USERS_ROUTES = exports.USERS_ROUTES = exports.AUTH_ROUTES = void 0;
3
+ exports.SEO_PAGES_PUBLIC_ROUTES = exports.SEO_PAGES_ADMIN_ROUTES = exports.BLOG_PUBLIC_POSTS_ROUTES = exports.BLOG_PUBLIC_CATEGORIES_ROUTES = exports.BLOG_ADMIN_POSTS_ROUTES = exports.BLOG_ADMIN_CATEGORIES_ROUTES = exports.UNREG_USERS_ROUTES = exports.USERS_ROUTES = exports.AUTH_ROUTES = void 0;
4
4
  /**
5
5
  * Centralized exports for all routes
6
6
  */
@@ -17,3 +17,7 @@ Object.defineProperty(exports, "BLOG_ADMIN_POSTS_ROUTES", { enumerable: true, ge
17
17
  var blog_public_routes_1 = require("./blog-public.routes");
18
18
  Object.defineProperty(exports, "BLOG_PUBLIC_CATEGORIES_ROUTES", { enumerable: true, get: function () { return blog_public_routes_1.BLOG_PUBLIC_CATEGORIES_ROUTES; } });
19
19
  Object.defineProperty(exports, "BLOG_PUBLIC_POSTS_ROUTES", { enumerable: true, get: function () { return blog_public_routes_1.BLOG_PUBLIC_POSTS_ROUTES; } });
20
+ var seo_pages_admin_routes_1 = require("./seo-pages-admin.routes");
21
+ Object.defineProperty(exports, "SEO_PAGES_ADMIN_ROUTES", { enumerable: true, get: function () { return seo_pages_admin_routes_1.SEO_PAGES_ADMIN_ROUTES; } });
22
+ var seo_pages_public_routes_1 = require("./seo-pages-public.routes");
23
+ Object.defineProperty(exports, "SEO_PAGES_PUBLIC_ROUTES", { enumerable: true, get: function () { return seo_pages_public_routes_1.SEO_PAGES_PUBLIC_ROUTES; } });
@@ -0,0 +1,10 @@
1
+ /**
2
+ * SEO Pages Admin Routes
3
+ */
4
+ export declare const SEO_PAGES_ADMIN_ROUTES: {
5
+ readonly CREATE: "";
6
+ readonly GET_ALL: "";
7
+ readonly GET_BY_UUID: ":uuid";
8
+ readonly UPDATE: ":uuid";
9
+ readonly DELETE: ":uuid";
10
+ };
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SEO_PAGES_ADMIN_ROUTES = void 0;
4
+ /**
5
+ * SEO Pages Admin Routes
6
+ */
7
+ exports.SEO_PAGES_ADMIN_ROUTES = {
8
+ CREATE: '',
9
+ GET_ALL: '',
10
+ GET_BY_UUID: ':uuid',
11
+ UPDATE: ':uuid',
12
+ DELETE: ':uuid',
13
+ };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * SEO Pages Public Routes
3
+ */
4
+ export declare const SEO_PAGES_PUBLIC_ROUTES: {
5
+ readonly GET_BY_ALIAS: ":alias";
6
+ };
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SEO_PAGES_PUBLIC_ROUTES = void 0;
4
+ /**
5
+ * SEO Pages Public Routes
6
+ */
7
+ exports.SEO_PAGES_PUBLIC_ROUTES = {
8
+ GET_BY_ALIAS: ':alias', // GET /seo-pages/:alias
9
+ };
@@ -0,0 +1,18 @@
1
+ import { ErrorMetadata } from '../../shared';
2
+ export declare enum BlogErrorCode {
3
+ CATEGORY_NOT_FOUND = "CATEGORY_NOT_FOUND",
4
+ CATEGORY_ALIAS_ALREADY_EXISTS = "CATEGORY_ALIAS_ALREADY_EXISTS",
5
+ CATEGORY_IN_USE = "CATEGORY_IN_USE",
6
+ INVALID_CATEGORY_STATUS = "INVALID_CATEGORY_STATUS",
7
+ CATEGORY_CREATION_FAILED = "CATEGORY_CREATION_FAILED",
8
+ CATEGORY_UPDATE_FAILED = "CATEGORY_UPDATE_FAILED",
9
+ CATEGORY_DELETE_FAILED = "CATEGORY_DELETE_FAILED",
10
+ POST_NOT_FOUND = "POST_NOT_FOUND",
11
+ POST_ALIAS_ALREADY_EXISTS = "POST_ALIAS_ALREADY_EXISTS",
12
+ INVALID_POST_STATUS = "INVALID_POST_STATUS",
13
+ POST_CREATION_FAILED = "POST_CREATION_FAILED",
14
+ POST_UPDATE_FAILED = "POST_UPDATE_FAILED",
15
+ POST_DELETE_FAILED = "POST_DELETE_FAILED",
16
+ INVALID_ALIAS_FORMAT = "INVALID_ALIAS_FORMAT"
17
+ }
18
+ export declare const BLOG_ERRORS: Record<BlogErrorCode, ErrorMetadata>;
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BLOG_ERRORS = exports.BlogErrorCode = void 0;
4
+ var BlogErrorCode;
5
+ (function (BlogErrorCode) {
6
+ // Category errors
7
+ BlogErrorCode["CATEGORY_NOT_FOUND"] = "CATEGORY_NOT_FOUND";
8
+ BlogErrorCode["CATEGORY_ALIAS_ALREADY_EXISTS"] = "CATEGORY_ALIAS_ALREADY_EXISTS";
9
+ BlogErrorCode["CATEGORY_IN_USE"] = "CATEGORY_IN_USE";
10
+ BlogErrorCode["INVALID_CATEGORY_STATUS"] = "INVALID_CATEGORY_STATUS";
11
+ BlogErrorCode["CATEGORY_CREATION_FAILED"] = "CATEGORY_CREATION_FAILED";
12
+ BlogErrorCode["CATEGORY_UPDATE_FAILED"] = "CATEGORY_UPDATE_FAILED";
13
+ BlogErrorCode["CATEGORY_DELETE_FAILED"] = "CATEGORY_DELETE_FAILED";
14
+ // Post errors
15
+ BlogErrorCode["POST_NOT_FOUND"] = "POST_NOT_FOUND";
16
+ BlogErrorCode["POST_ALIAS_ALREADY_EXISTS"] = "POST_ALIAS_ALREADY_EXISTS";
17
+ BlogErrorCode["INVALID_POST_STATUS"] = "INVALID_POST_STATUS";
18
+ BlogErrorCode["POST_CREATION_FAILED"] = "POST_CREATION_FAILED";
19
+ BlogErrorCode["POST_UPDATE_FAILED"] = "POST_UPDATE_FAILED";
20
+ BlogErrorCode["POST_DELETE_FAILED"] = "POST_DELETE_FAILED";
21
+ // Validation errors
22
+ BlogErrorCode["INVALID_ALIAS_FORMAT"] = "INVALID_ALIAS_FORMAT";
23
+ })(BlogErrorCode || (exports.BlogErrorCode = BlogErrorCode = {}));
24
+ exports.BLOG_ERRORS = {
25
+ // Category errors
26
+ [BlogErrorCode.CATEGORY_NOT_FOUND]: {
27
+ code: BlogErrorCode.CATEGORY_NOT_FOUND,
28
+ statusCode: 404,
29
+ },
30
+ [BlogErrorCode.CATEGORY_ALIAS_ALREADY_EXISTS]: {
31
+ code: BlogErrorCode.CATEGORY_ALIAS_ALREADY_EXISTS,
32
+ statusCode: 409,
33
+ },
34
+ [BlogErrorCode.CATEGORY_IN_USE]: {
35
+ code: BlogErrorCode.CATEGORY_IN_USE,
36
+ statusCode: 400,
37
+ },
38
+ [BlogErrorCode.INVALID_CATEGORY_STATUS]: {
39
+ code: BlogErrorCode.INVALID_CATEGORY_STATUS,
40
+ statusCode: 400,
41
+ },
42
+ [BlogErrorCode.CATEGORY_CREATION_FAILED]: {
43
+ code: BlogErrorCode.CATEGORY_CREATION_FAILED,
44
+ statusCode: 500,
45
+ },
46
+ [BlogErrorCode.CATEGORY_UPDATE_FAILED]: {
47
+ code: BlogErrorCode.CATEGORY_UPDATE_FAILED,
48
+ statusCode: 500,
49
+ },
50
+ [BlogErrorCode.CATEGORY_DELETE_FAILED]: {
51
+ code: BlogErrorCode.CATEGORY_DELETE_FAILED,
52
+ statusCode: 500,
53
+ },
54
+ // Post errors
55
+ [BlogErrorCode.POST_NOT_FOUND]: {
56
+ code: BlogErrorCode.POST_NOT_FOUND,
57
+ statusCode: 404,
58
+ },
59
+ [BlogErrorCode.POST_ALIAS_ALREADY_EXISTS]: {
60
+ code: BlogErrorCode.POST_ALIAS_ALREADY_EXISTS,
61
+ statusCode: 409,
62
+ },
63
+ [BlogErrorCode.INVALID_POST_STATUS]: {
64
+ code: BlogErrorCode.INVALID_POST_STATUS,
65
+ statusCode: 400,
66
+ },
67
+ [BlogErrorCode.POST_CREATION_FAILED]: {
68
+ code: BlogErrorCode.POST_CREATION_FAILED,
69
+ statusCode: 500,
70
+ },
71
+ [BlogErrorCode.POST_UPDATE_FAILED]: {
72
+ code: BlogErrorCode.POST_UPDATE_FAILED,
73
+ statusCode: 500,
74
+ },
75
+ [BlogErrorCode.POST_DELETE_FAILED]: {
76
+ code: BlogErrorCode.POST_DELETE_FAILED,
77
+ statusCode: 500,
78
+ },
79
+ // Validation errors
80
+ [BlogErrorCode.INVALID_ALIAS_FORMAT]: {
81
+ code: BlogErrorCode.INVALID_ALIAS_FORMAT,
82
+ statusCode: 400,
83
+ },
84
+ };
@@ -1,4 +1,5 @@
1
1
  export * from './schemas';
2
+ export * from './blog.errors';
2
3
  export * from './admin/commands';
3
4
  export * from './admin/queries';
4
5
  export * from './public/queries';
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.BLOG_PUBLIC_POSTS_ROUTES = exports.BLOG_PUBLIC_CATEGORIES_ROUTES = exports.BLOG_ADMIN_POSTS_ROUTES = exports.BLOG_ADMIN_CATEGORIES_ROUTES = exports.BLOG_PUBLIC_POSTS_CONTROLLER = exports.BLOG_PUBLIC_CATEGORIES_CONTROLLER = exports.BLOG_ADMIN_POSTS_CONTROLLER = exports.BLOG_ADMIN_CATEGORIES_CONTROLLER = void 0;
18
18
  __exportStar(require("./schemas"), exports);
19
+ __exportStar(require("./blog.errors"), exports);
19
20
  __exportStar(require("./admin/commands"), exports);
20
21
  __exportStar(require("./admin/queries"), exports);
21
22
  __exportStar(require("./public/queries"), exports);
@@ -2,11 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CreateCategoryRequestSchema = void 0;
4
4
  const zod_1 = require("zod");
5
- const regex_1 = require("../../../shared/regex");
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(regex_1.SLUG_REGEX),
8
+ alias: zod_1.z.string().min(1).max(100).regex(shared_1.SLUG_REGEX),
9
9
  title: zod_1.z.string().min(1).max(200),
10
10
  order: zod_1.z.number().int().nonnegative().default(0),
11
- status: zod_1.z.nativeEnum(blog_category_status_enum_1.BlogCategoryStatus).default(blog_category_status_enum_1.BlogCategoryStatus.DRAFT),
11
+ status: zod_1.z.enum(blog_category_status_enum_1.BlogCategoryStatus).default(blog_category_status_enum_1.BlogCategoryStatus.DRAFT),
12
12
  });
@@ -2,16 +2,16 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CreatePostRequestSchema = void 0;
4
4
  const zod_1 = require("zod");
5
- const regex_1 = require("../../../shared/regex");
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(regex_1.SLUG_REGEX),
8
+ alias: zod_1.z.string().min(1).max(200).regex(shared_1.SLUG_REGEX),
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
12
  content: zod_1.z.string().min(1),
13
13
  image: zod_1.z.string().url(),
14
14
  author: zod_1.z.string().min(1).max(100),
15
- categoryIds: zod_1.z.array(zod_1.z.string().regex(regex_1.UUID_REGEX)).min(1),
16
- status: zod_1.z.nativeEnum(blog_post_status_enum_1.BlogPostStatus).default(blog_post_status_enum_1.BlogPostStatus.DRAFT),
15
+ categoryIds: zod_1.z.array(zod_1.z.string().regex(shared_1.UUID_REGEX)).min(1),
16
+ status: zod_1.z.enum(blog_post_status_enum_1.BlogPostStatus).default(blog_post_status_enum_1.BlogPostStatus.DRAFT),
17
17
  });
@@ -4,3 +4,4 @@ export * from './blog';
4
4
  export * from './users';
5
5
  export * from './email';
6
6
  export * from './notifications';
7
+ export * from './seo-pages';
package/build/v1/index.js CHANGED
@@ -20,3 +20,4 @@ __exportStar(require("./blog"), exports);
20
20
  __exportStar(require("./users"), exports);
21
21
  __exportStar(require("./email"), exports);
22
22
  __exportStar(require("./notifications"), exports);
23
+ __exportStar(require("./seo-pages"), exports);
@@ -0,0 +1,29 @@
1
+ import { z } from 'zod';
2
+ import { HttpMethod } from '../../../../shared/http-method';
3
+ export declare namespace AdminSeoPageCreatePageCommand {
4
+ const Request: z.ZodObject<{
5
+ metaTitle: z.ZodString;
6
+ metaDescription: z.ZodString;
7
+ title: z.ZodString;
8
+ description: z.ZodString;
9
+ content: z.ZodString;
10
+ alias: z.ZodString;
11
+ type: z.ZodEnum<typeof import("../../schemas").PageType>;
12
+ }, z.core.$strip>;
13
+ const Response: z.ZodObject<{
14
+ uuid: z.ZodString;
15
+ metaTitle: z.ZodString;
16
+ metaDescription: z.ZodString;
17
+ title: z.ZodString;
18
+ description: z.ZodString;
19
+ content: z.ZodString;
20
+ alias: z.ZodString;
21
+ type: z.ZodEnum<typeof import("../../schemas").PageType>;
22
+ createdAt: z.ZodString;
23
+ updatedAt: z.ZodString;
24
+ }, z.core.$strip>;
25
+ const URL: "/api/v1/admin/seo-pages/";
26
+ const METHOD = HttpMethod.POST;
27
+ type RequestType = z.infer<typeof Request>;
28
+ type ResponseType = z.infer<typeof Response>;
29
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AdminSeoPageCreatePageCommand = void 0;
4
+ const schemas_1 = require("../../schemas");
5
+ const rest_api_1 = require("../../../../rest-api");
6
+ const http_method_1 = require("../../../../shared/http-method");
7
+ var AdminSeoPageCreatePageCommand;
8
+ (function (AdminSeoPageCreatePageCommand) {
9
+ AdminSeoPageCreatePageCommand.Request = schemas_1.CreatePageRequestSchema;
10
+ AdminSeoPageCreatePageCommand.Response = schemas_1.PageResponseSchema;
11
+ AdminSeoPageCreatePageCommand.URL = rest_api_1.REST_API.V1.SEO_PAGES.ADMIN.CREATE;
12
+ AdminSeoPageCreatePageCommand.METHOD = http_method_1.HttpMethod.POST;
13
+ })(AdminSeoPageCreatePageCommand || (exports.AdminSeoPageCreatePageCommand = AdminSeoPageCreatePageCommand = {}));
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+ import { HttpMethod } from '../../../../shared/http-method';
3
+ export declare namespace AdminSeoPageDeletePageCommand {
4
+ const Request: z.ZodObject<{}, z.core.$strip>;
5
+ const Response: z.ZodObject<{
6
+ success: z.ZodBoolean;
7
+ }, z.core.$strip>;
8
+ const URL: (uuid: string) => string;
9
+ const METHOD = HttpMethod.DELETE;
10
+ type RequestType = z.infer<typeof Request>;
11
+ type ResponseType = z.infer<typeof Response>;
12
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AdminSeoPageDeletePageCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const rest_api_1 = require("../../../../rest-api");
6
+ const http_method_1 = require("../../../../shared/http-method");
7
+ var AdminSeoPageDeletePageCommand;
8
+ (function (AdminSeoPageDeletePageCommand) {
9
+ AdminSeoPageDeletePageCommand.Request = zod_1.z.object({});
10
+ AdminSeoPageDeletePageCommand.Response = zod_1.z.object({ success: zod_1.z.boolean() });
11
+ AdminSeoPageDeletePageCommand.URL = (uuid) => rest_api_1.REST_API.V1.SEO_PAGES.ADMIN.DELETE(uuid);
12
+ AdminSeoPageDeletePageCommand.METHOD = http_method_1.HttpMethod.DELETE;
13
+ })(AdminSeoPageDeletePageCommand || (exports.AdminSeoPageDeletePageCommand = AdminSeoPageDeletePageCommand = {}));
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Centralized exports for SEO Pages admin commands
3
+ */
4
+ export { AdminSeoPageCreatePageCommand } from './create-page.command';
5
+ export { AdminSeoPageUpdatePageCommand } from './update-page.command';
6
+ export { AdminSeoPageDeletePageCommand } from './delete-page.command';
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AdminSeoPageDeletePageCommand = exports.AdminSeoPageUpdatePageCommand = exports.AdminSeoPageCreatePageCommand = void 0;
4
+ /**
5
+ * Centralized exports for SEO Pages admin commands
6
+ */
7
+ var create_page_command_1 = require("./create-page.command");
8
+ Object.defineProperty(exports, "AdminSeoPageCreatePageCommand", { enumerable: true, get: function () { return create_page_command_1.AdminSeoPageCreatePageCommand; } });
9
+ var update_page_command_1 = require("./update-page.command");
10
+ Object.defineProperty(exports, "AdminSeoPageUpdatePageCommand", { enumerable: true, get: function () { return update_page_command_1.AdminSeoPageUpdatePageCommand; } });
11
+ var delete_page_command_1 = require("./delete-page.command");
12
+ Object.defineProperty(exports, "AdminSeoPageDeletePageCommand", { enumerable: true, get: function () { return delete_page_command_1.AdminSeoPageDeletePageCommand; } });
@@ -0,0 +1,29 @@
1
+ import { z } from 'zod';
2
+ import { HttpMethod } from '../../../../shared/http-method';
3
+ export declare namespace AdminSeoPageUpdatePageCommand {
4
+ const Request: z.ZodObject<{
5
+ metaTitle: z.ZodOptional<z.ZodString>;
6
+ metaDescription: z.ZodOptional<z.ZodString>;
7
+ title: z.ZodOptional<z.ZodString>;
8
+ description: z.ZodOptional<z.ZodString>;
9
+ content: z.ZodOptional<z.ZodString>;
10
+ alias: z.ZodOptional<z.ZodString>;
11
+ type: z.ZodOptional<z.ZodEnum<typeof import("../../schemas").PageType>>;
12
+ }, z.core.$strip>;
13
+ const Response: z.ZodObject<{
14
+ uuid: z.ZodString;
15
+ metaTitle: z.ZodString;
16
+ metaDescription: z.ZodString;
17
+ title: z.ZodString;
18
+ description: z.ZodString;
19
+ content: z.ZodString;
20
+ alias: z.ZodString;
21
+ type: z.ZodEnum<typeof import("../../schemas").PageType>;
22
+ createdAt: z.ZodString;
23
+ updatedAt: z.ZodString;
24
+ }, z.core.$strip>;
25
+ const URL: (uuid: string) => string;
26
+ const METHOD = HttpMethod.PATCH;
27
+ type RequestType = z.infer<typeof Request>;
28
+ type ResponseType = z.infer<typeof Response>;
29
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AdminSeoPageUpdatePageCommand = void 0;
4
+ const schemas_1 = require("../../schemas");
5
+ const rest_api_1 = require("../../../../rest-api");
6
+ const http_method_1 = require("../../../../shared/http-method");
7
+ var AdminSeoPageUpdatePageCommand;
8
+ (function (AdminSeoPageUpdatePageCommand) {
9
+ AdminSeoPageUpdatePageCommand.Request = schemas_1.UpdatePageRequestSchema;
10
+ AdminSeoPageUpdatePageCommand.Response = schemas_1.PageResponseSchema;
11
+ AdminSeoPageUpdatePageCommand.URL = (uuid) => rest_api_1.REST_API.V1.SEO_PAGES.ADMIN.UPDATE(uuid);
12
+ AdminSeoPageUpdatePageCommand.METHOD = http_method_1.HttpMethod.PATCH;
13
+ })(AdminSeoPageUpdatePageCommand || (exports.AdminSeoPageUpdatePageCommand = AdminSeoPageUpdatePageCommand = {}));
@@ -0,0 +1,21 @@
1
+ import { z } from 'zod';
2
+ import { HttpMethod } from '../../../../shared/http-method';
3
+ export declare namespace AdminSeoPageGetPageQuery {
4
+ const Request: z.ZodObject<{}, z.core.$strip>;
5
+ const Response: z.ZodObject<{
6
+ uuid: z.ZodString;
7
+ metaTitle: z.ZodString;
8
+ metaDescription: z.ZodString;
9
+ title: z.ZodString;
10
+ description: z.ZodString;
11
+ content: z.ZodString;
12
+ alias: z.ZodString;
13
+ type: z.ZodEnum<typeof import("../../schemas").PageType>;
14
+ createdAt: z.ZodString;
15
+ updatedAt: z.ZodString;
16
+ }, z.core.$strip>;
17
+ const URL: (uuid: string) => string;
18
+ const METHOD = HttpMethod.GET;
19
+ type RequestType = z.infer<typeof Request>;
20
+ type ResponseType = z.infer<typeof Response>;
21
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AdminSeoPageGetPageQuery = void 0;
4
+ const zod_1 = require("zod");
5
+ const schemas_1 = require("../../schemas");
6
+ const rest_api_1 = require("../../../../rest-api");
7
+ const http_method_1 = require("../../../../shared/http-method");
8
+ var AdminSeoPageGetPageQuery;
9
+ (function (AdminSeoPageGetPageQuery) {
10
+ AdminSeoPageGetPageQuery.Request = zod_1.z.object({});
11
+ AdminSeoPageGetPageQuery.Response = schemas_1.PageResponseSchema;
12
+ AdminSeoPageGetPageQuery.URL = (uuid) => rest_api_1.REST_API.V1.SEO_PAGES.ADMIN.GET_BY_UUID(uuid);
13
+ AdminSeoPageGetPageQuery.METHOD = http_method_1.HttpMethod.GET;
14
+ })(AdminSeoPageGetPageQuery || (exports.AdminSeoPageGetPageQuery = AdminSeoPageGetPageQuery = {}));
@@ -0,0 +1,34 @@
1
+ import { z } from 'zod';
2
+ import { HttpMethod } from '../../../../shared/http-method';
3
+ export declare namespace AdminSeoPageGetPagesQuery {
4
+ const Request: z.ZodObject<{
5
+ page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
6
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
7
+ }, z.core.$strip>;
8
+ const Response: z.ZodObject<{
9
+ data: z.ZodArray<z.ZodObject<{
10
+ uuid: z.ZodString;
11
+ metaTitle: z.ZodString;
12
+ metaDescription: z.ZodString;
13
+ title: z.ZodString;
14
+ description: z.ZodString;
15
+ content: z.ZodString;
16
+ alias: z.ZodString;
17
+ type: z.ZodEnum<typeof import("../../schemas").PageType>;
18
+ createdAt: z.ZodString;
19
+ updatedAt: z.ZodString;
20
+ }, z.core.$strip>>;
21
+ meta: z.ZodObject<{
22
+ page: z.ZodNumber;
23
+ limit: z.ZodNumber;
24
+ total: z.ZodNumber;
25
+ totalPages: z.ZodNumber;
26
+ hasNext: z.ZodBoolean;
27
+ hasPrev: z.ZodBoolean;
28
+ }, z.core.$strip>;
29
+ }, z.core.$strip>;
30
+ const URL: "/api/v1/admin/seo-pages/";
31
+ const METHOD = HttpMethod.GET;
32
+ type RequestType = z.infer<typeof Request>;
33
+ type ResponseType = z.infer<typeof Response>;
34
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AdminSeoPageGetPagesQuery = void 0;
4
+ const zod_1 = require("zod");
5
+ const schemas_1 = require("../../schemas");
6
+ const pagination_schema_1 = require("../../../../shared/pagination.schema");
7
+ const rest_api_1 = require("../../../../rest-api");
8
+ const http_method_1 = require("../../../../shared/http-method");
9
+ const PagesListAdminResponseSchema = zod_1.z.object({
10
+ data: zod_1.z.array(schemas_1.PageResponseSchema),
11
+ meta: pagination_schema_1.PaginationMetaSchema,
12
+ });
13
+ var AdminSeoPageGetPagesQuery;
14
+ (function (AdminSeoPageGetPagesQuery) {
15
+ AdminSeoPageGetPagesQuery.Request = pagination_schema_1.PaginationQuerySchema;
16
+ AdminSeoPageGetPagesQuery.Response = PagesListAdminResponseSchema;
17
+ AdminSeoPageGetPagesQuery.URL = rest_api_1.REST_API.V1.SEO_PAGES.ADMIN.GET_ALL;
18
+ AdminSeoPageGetPagesQuery.METHOD = http_method_1.HttpMethod.GET;
19
+ })(AdminSeoPageGetPagesQuery || (exports.AdminSeoPageGetPagesQuery = AdminSeoPageGetPagesQuery = {}));
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Centralized exports for SEO Pages admin queries
3
+ */
4
+ export { AdminSeoPageGetPagesQuery } from './get-pages.query';
5
+ export { AdminSeoPageGetPageQuery } from './get-page.query';
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AdminSeoPageGetPageQuery = exports.AdminSeoPageGetPagesQuery = void 0;
4
+ /**
5
+ * Centralized exports for SEO Pages admin queries
6
+ */
7
+ var get_pages_query_1 = require("./get-pages.query");
8
+ Object.defineProperty(exports, "AdminSeoPageGetPagesQuery", { enumerable: true, get: function () { return get_pages_query_1.AdminSeoPageGetPagesQuery; } });
9
+ var get_page_query_1 = require("./get-page.query");
10
+ Object.defineProperty(exports, "AdminSeoPageGetPageQuery", { enumerable: true, get: function () { return get_page_query_1.AdminSeoPageGetPageQuery; } });
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Centralized exports for SEO Pages contracts
3
+ */
4
+ export { SeoPageErrorCode, SEO_PAGE_ERRORS } from './seo-pages.errors';
5
+ export * from './schemas';
6
+ export * from './admin/commands';
7
+ export * from './admin/queries';
8
+ export * from './public/queries';
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ /**
3
+ * Centralized exports for SEO Pages contracts
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
17
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
18
+ };
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.SEO_PAGE_ERRORS = exports.SeoPageErrorCode = void 0;
21
+ // Errors
22
+ var seo_pages_errors_1 = require("./seo-pages.errors");
23
+ Object.defineProperty(exports, "SeoPageErrorCode", { enumerable: true, get: function () { return seo_pages_errors_1.SeoPageErrorCode; } });
24
+ Object.defineProperty(exports, "SEO_PAGE_ERRORS", { enumerable: true, get: function () { return seo_pages_errors_1.SEO_PAGE_ERRORS; } });
25
+ // Schemas
26
+ __exportStar(require("./schemas"), exports);
27
+ // Admin Commands
28
+ __exportStar(require("./admin/commands"), exports);
29
+ // Admin Queries
30
+ __exportStar(require("./admin/queries"), exports);
31
+ // Public Queries
32
+ __exportStar(require("./public/queries"), exports);
@@ -0,0 +1,21 @@
1
+ import { z } from 'zod';
2
+ import { HttpMethod } from '../../../../shared/http-method';
3
+ export declare namespace SeoPageGetPageByAliasQuery {
4
+ const Request: z.ZodObject<{}, z.core.$strip>;
5
+ const Response: z.ZodObject<{
6
+ uuid: z.ZodString;
7
+ metaTitle: z.ZodString;
8
+ metaDescription: z.ZodString;
9
+ title: z.ZodString;
10
+ description: z.ZodString;
11
+ content: z.ZodString;
12
+ alias: z.ZodString;
13
+ type: z.ZodEnum<typeof import("../../schemas").PageType>;
14
+ createdAt: z.ZodString;
15
+ updatedAt: z.ZodString;
16
+ }, z.core.$strip>;
17
+ const URL: (alias: string) => string;
18
+ const METHOD = HttpMethod.GET;
19
+ type RequestType = z.infer<typeof Request>;
20
+ type ResponseType = z.infer<typeof Response>;
21
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SeoPageGetPageByAliasQuery = void 0;
4
+ const zod_1 = require("zod");
5
+ const schemas_1 = require("../../schemas");
6
+ const rest_api_1 = require("../../../../rest-api");
7
+ const http_method_1 = require("../../../../shared/http-method");
8
+ var SeoPageGetPageByAliasQuery;
9
+ (function (SeoPageGetPageByAliasQuery) {
10
+ SeoPageGetPageByAliasQuery.Request = zod_1.z.object({});
11
+ SeoPageGetPageByAliasQuery.Response = schemas_1.PageResponseSchema;
12
+ SeoPageGetPageByAliasQuery.URL = (alias) => rest_api_1.REST_API.V1.SEO_PAGES.PUBLIC.GET_BY_ALIAS(alias);
13
+ SeoPageGetPageByAliasQuery.METHOD = http_method_1.HttpMethod.GET;
14
+ })(SeoPageGetPageByAliasQuery || (exports.SeoPageGetPageByAliasQuery = SeoPageGetPageByAliasQuery = {}));
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Centralized exports for SEO Pages public queries
3
+ */
4
+ export { SeoPageGetPageByAliasQuery } from './get-page-by-alias.query';
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SeoPageGetPageByAliasQuery = void 0;
4
+ /**
5
+ * Centralized exports for SEO Pages public queries
6
+ */
7
+ var get_page_by_alias_query_1 = require("./get-page-by-alias.query");
8
+ Object.defineProperty(exports, "SeoPageGetPageByAliasQuery", { enumerable: true, get: function () { return get_page_by_alias_query_1.SeoPageGetPageByAliasQuery; } });
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ import { PageType } from './page-type.enum';
3
+ /**
4
+ * Create SEO Page Request Schema
5
+ */
6
+ export declare const CreatePageRequestSchema: z.ZodObject<{
7
+ metaTitle: z.ZodString;
8
+ metaDescription: z.ZodString;
9
+ title: z.ZodString;
10
+ description: z.ZodString;
11
+ content: z.ZodString;
12
+ alias: z.ZodString;
13
+ type: z.ZodEnum<typeof PageType>;
14
+ }, z.core.$strip>;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreatePageRequestSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const shared_1 = require("../../../shared");
6
+ const page_type_enum_1 = require("./page-type.enum");
7
+ /**
8
+ * Create SEO Page Request Schema
9
+ */
10
+ exports.CreatePageRequestSchema = zod_1.z.object({
11
+ metaTitle: zod_1.z.string().min(1).max(100),
12
+ metaDescription: zod_1.z.string().min(1).max(200),
13
+ title: zod_1.z.string().min(1).max(300),
14
+ description: zod_1.z.string().min(1),
15
+ content: zod_1.z.string().min(1),
16
+ alias: zod_1.z.string().min(1).max(200).regex(shared_1.SLUG_REGEX),
17
+ type: zod_1.z.nativeEnum(page_type_enum_1.PageType),
18
+ });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Centralized exports for SEO Pages schemas
3
+ */
4
+ export { PageType } from './page-type.enum';
5
+ export { PageResponseSchema } from './page-response.schema';
6
+ export { CreatePageRequestSchema } from './create-page-request.schema';
7
+ export { UpdatePageRequestSchema } from './update-page-request.schema';
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdatePageRequestSchema = exports.CreatePageRequestSchema = exports.PageResponseSchema = exports.PageType = void 0;
4
+ /**
5
+ * Centralized exports for SEO Pages schemas
6
+ */
7
+ var page_type_enum_1 = require("./page-type.enum");
8
+ Object.defineProperty(exports, "PageType", { enumerable: true, get: function () { return page_type_enum_1.PageType; } });
9
+ var page_response_schema_1 = require("./page-response.schema");
10
+ Object.defineProperty(exports, "PageResponseSchema", { enumerable: true, get: function () { return page_response_schema_1.PageResponseSchema; } });
11
+ var create_page_request_schema_1 = require("./create-page-request.schema");
12
+ Object.defineProperty(exports, "CreatePageRequestSchema", { enumerable: true, get: function () { return create_page_request_schema_1.CreatePageRequestSchema; } });
13
+ var update_page_request_schema_1 = require("./update-page-request.schema");
14
+ Object.defineProperty(exports, "UpdatePageRequestSchema", { enumerable: true, get: function () { return update_page_request_schema_1.UpdatePageRequestSchema; } });
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ import { PageType } from './page-type.enum';
3
+ /**
4
+ * SEO Page Response Schema
5
+ */
6
+ export declare const PageResponseSchema: z.ZodObject<{
7
+ uuid: z.ZodString;
8
+ metaTitle: z.ZodString;
9
+ metaDescription: z.ZodString;
10
+ title: z.ZodString;
11
+ description: z.ZodString;
12
+ content: z.ZodString;
13
+ alias: z.ZodString;
14
+ type: z.ZodEnum<typeof PageType>;
15
+ createdAt: z.ZodString;
16
+ updatedAt: z.ZodString;
17
+ }, z.core.$strip>;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PageResponseSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const regex_1 = require("../../../shared/regex");
6
+ const page_type_enum_1 = require("./page-type.enum");
7
+ /**
8
+ * SEO Page Response Schema
9
+ */
10
+ exports.PageResponseSchema = zod_1.z.object({
11
+ uuid: zod_1.z.string().regex(regex_1.UUID_REGEX),
12
+ metaTitle: zod_1.z.string(),
13
+ metaDescription: zod_1.z.string(),
14
+ title: zod_1.z.string(),
15
+ description: zod_1.z.string(),
16
+ content: zod_1.z.string(),
17
+ alias: zod_1.z.string(),
18
+ type: zod_1.z.nativeEnum(page_type_enum_1.PageType),
19
+ createdAt: zod_1.z.string().regex(regex_1.DATETIME_REGEX),
20
+ updatedAt: zod_1.z.string().regex(regex_1.DATETIME_REGEX),
21
+ });
@@ -0,0 +1,8 @@
1
+ /**
2
+ * SEO Page Type
3
+ */
4
+ export declare enum PageType {
5
+ CATEGORY = "category",
6
+ AI_MODEL = "ai_model",
7
+ META = "meta"
8
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PageType = void 0;
4
+ /**
5
+ * SEO Page Type
6
+ */
7
+ var PageType;
8
+ (function (PageType) {
9
+ PageType["CATEGORY"] = "category";
10
+ PageType["AI_MODEL"] = "ai_model";
11
+ PageType["META"] = "meta";
12
+ })(PageType || (exports.PageType = PageType = {}));
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ import { PageType } from './page-type.enum';
3
+ /**
4
+ * Update SEO Page Request Schema
5
+ */
6
+ export declare const UpdatePageRequestSchema: z.ZodObject<{
7
+ metaTitle: z.ZodOptional<z.ZodString>;
8
+ metaDescription: z.ZodOptional<z.ZodString>;
9
+ title: z.ZodOptional<z.ZodString>;
10
+ description: z.ZodOptional<z.ZodString>;
11
+ content: z.ZodOptional<z.ZodString>;
12
+ alias: z.ZodOptional<z.ZodString>;
13
+ type: z.ZodOptional<z.ZodEnum<typeof PageType>>;
14
+ }, z.core.$strip>;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdatePageRequestSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const shared_1 = require("../../../shared");
6
+ const page_type_enum_1 = require("./page-type.enum");
7
+ /**
8
+ * Update SEO Page Request Schema
9
+ */
10
+ exports.UpdatePageRequestSchema = zod_1.z.object({
11
+ metaTitle: zod_1.z.string().min(1).max(100).optional(),
12
+ metaDescription: zod_1.z.string().min(1).max(200).optional(),
13
+ title: zod_1.z.string().min(1).max(300).optional(),
14
+ description: zod_1.z.string().min(1).optional(),
15
+ content: zod_1.z.string().min(1).optional(),
16
+ alias: zod_1.z.string().min(1).max(200).regex(shared_1.SLUG_REGEX).optional(),
17
+ type: zod_1.z.nativeEnum(page_type_enum_1.PageType).optional(),
18
+ });
@@ -0,0 +1,11 @@
1
+ import { ErrorMetadata } from '../../shared';
2
+ export declare enum SeoPageErrorCode {
3
+ PAGE_NOT_FOUND = "PAGE_NOT_FOUND",
4
+ PAGE_ALIAS_ALREADY_EXISTS = "PAGE_ALIAS_ALREADY_EXISTS",
5
+ INVALID_PAGE_TYPE = "INVALID_PAGE_TYPE",
6
+ PAGE_CREATION_FAILED = "PAGE_CREATION_FAILED",
7
+ PAGE_UPDATE_FAILED = "PAGE_UPDATE_FAILED",
8
+ PAGE_DELETE_FAILED = "PAGE_DELETE_FAILED",
9
+ INVALID_ALIAS_FORMAT = "INVALID_ALIAS_FORMAT"
10
+ }
11
+ export declare const SEO_PAGE_ERRORS: Record<SeoPageErrorCode, ErrorMetadata>;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SEO_PAGE_ERRORS = exports.SeoPageErrorCode = void 0;
4
+ var SeoPageErrorCode;
5
+ (function (SeoPageErrorCode) {
6
+ SeoPageErrorCode["PAGE_NOT_FOUND"] = "PAGE_NOT_FOUND";
7
+ SeoPageErrorCode["PAGE_ALIAS_ALREADY_EXISTS"] = "PAGE_ALIAS_ALREADY_EXISTS";
8
+ SeoPageErrorCode["INVALID_PAGE_TYPE"] = "INVALID_PAGE_TYPE";
9
+ SeoPageErrorCode["PAGE_CREATION_FAILED"] = "PAGE_CREATION_FAILED";
10
+ SeoPageErrorCode["PAGE_UPDATE_FAILED"] = "PAGE_UPDATE_FAILED";
11
+ SeoPageErrorCode["PAGE_DELETE_FAILED"] = "PAGE_DELETE_FAILED";
12
+ SeoPageErrorCode["INVALID_ALIAS_FORMAT"] = "INVALID_ALIAS_FORMAT";
13
+ })(SeoPageErrorCode || (exports.SeoPageErrorCode = SeoPageErrorCode = {}));
14
+ exports.SEO_PAGE_ERRORS = {
15
+ [SeoPageErrorCode.PAGE_NOT_FOUND]: {
16
+ code: SeoPageErrorCode.PAGE_NOT_FOUND,
17
+ statusCode: 404,
18
+ },
19
+ [SeoPageErrorCode.PAGE_ALIAS_ALREADY_EXISTS]: {
20
+ code: SeoPageErrorCode.PAGE_ALIAS_ALREADY_EXISTS,
21
+ statusCode: 409,
22
+ },
23
+ [SeoPageErrorCode.INVALID_PAGE_TYPE]: {
24
+ code: SeoPageErrorCode.INVALID_PAGE_TYPE,
25
+ statusCode: 400,
26
+ },
27
+ [SeoPageErrorCode.PAGE_CREATION_FAILED]: {
28
+ code: SeoPageErrorCode.PAGE_CREATION_FAILED,
29
+ statusCode: 500,
30
+ },
31
+ [SeoPageErrorCode.PAGE_UPDATE_FAILED]: {
32
+ code: SeoPageErrorCode.PAGE_UPDATE_FAILED,
33
+ statusCode: 500,
34
+ },
35
+ [SeoPageErrorCode.PAGE_DELETE_FAILED]: {
36
+ code: SeoPageErrorCode.PAGE_DELETE_FAILED,
37
+ statusCode: 500,
38
+ },
39
+ [SeoPageErrorCode.INVALID_ALIAS_FORMAT]: {
40
+ code: SeoPageErrorCode.INVALID_ALIAS_FORMAT,
41
+ statusCode: 400,
42
+ },
43
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veruna/api-contracts",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "description": "API contracts for Veruna project - Zod schemas, types, and paths",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",