@veruna/api-contracts 1.0.38 → 1.0.40

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 (28) hide show
  1. package/build/v1/blog/admin/commands/create-post.command.d.ts +8 -0
  2. package/build/v1/blog/admin/commands/update-post.command.d.ts +8 -0
  3. package/build/v1/blog/admin/queries/get-post.query.d.ts +4 -0
  4. package/build/v1/blog/admin/queries/get-posts.query.d.ts +4 -0
  5. package/build/v1/blog/blog.errors.d.ts +2 -1
  6. package/build/v1/blog/blog.errors.js +5 -0
  7. package/build/v1/blog/public/queries/get-post-by-alias.query.d.ts +8 -0
  8. package/build/v1/blog/public/queries/get-post-by-alias.query.js +1 -1
  9. package/build/v1/blog/public/queries/get-posts.query.d.ts +4 -0
  10. package/build/v1/blog/schemas/blog-post-mark.enum.d.ts +7 -0
  11. package/build/v1/blog/schemas/blog-post-mark.enum.js +11 -0
  12. package/build/v1/blog/schemas/create-post-request.schema.d.ts +5 -0
  13. package/build/v1/blog/schemas/create-post-request.schema.js +22 -3
  14. package/build/v1/blog/schemas/index.d.ts +2 -0
  15. package/build/v1/blog/schemas/index.js +2 -0
  16. package/build/v1/blog/schemas/post-response.schema.d.ts +5 -0
  17. package/build/v1/blog/schemas/post-response.schema.js +5 -0
  18. package/build/v1/blog/schemas/public-post-response.schema.d.ts +43 -0
  19. package/build/v1/blog/schemas/public-post-response.schema.js +20 -0
  20. package/build/v1/blog/schemas/update-post-request.schema.d.ts +5 -0
  21. package/build/v1/blog/schemas/update-post-request.schema.js +23 -2
  22. package/build/v1/seo-pages/public/queries/get-hierarchy-list.query.d.ts +17 -8
  23. package/build/v1/seo-pages/public/queries/get-hierarchy-list.query.js +1 -1
  24. package/build/v1/seo-pages/schemas/index.d.ts +1 -1
  25. package/build/v1/seo-pages/schemas/index.js +2 -1
  26. package/build/v1/seo-pages/schemas/page-hierarchy.schema.d.ts +28 -1
  27. package/build/v1/seo-pages/schemas/page-hierarchy.schema.js +9 -2
  28. package/package.json +1 -1
@@ -11,6 +11,10 @@ export declare namespace AdminBlogCreatePostCommand {
11
11
  author: z.ZodString;
12
12
  categoryIds: z.ZodArray<z.ZodString>;
13
13
  status: z.ZodDefault<z.ZodEnum<typeof import("../../schemas").BlogPostStatus>>;
14
+ pageId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
15
+ marks: z.ZodDefault<z.ZodArray<z.ZodEnum<typeof import("../../schemas").BlogPostMark>>>;
16
+ aiWidgetPlaceholder: z.ZodOptional<z.ZodNullable<z.ZodString>>;
17
+ aiWidgetPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
14
18
  }, z.core.$strip>;
15
19
  const Response: z.ZodObject<{
16
20
  uuid: z.ZodString;
@@ -32,6 +36,10 @@ export declare namespace AdminBlogCreatePostCommand {
32
36
  }, z.core.$strip>>;
33
37
  viewsCount: z.ZodNumber;
34
38
  status: z.ZodEnum<typeof import("../../schemas").BlogPostStatus>;
39
+ pageId: z.ZodNullable<z.ZodString>;
40
+ marks: z.ZodArray<z.ZodEnum<typeof import("../../schemas").BlogPostMark>>;
41
+ aiWidgetPlaceholder: z.ZodNullable<z.ZodString>;
42
+ aiWidgetPrompt: z.ZodNullable<z.ZodString>;
35
43
  createdAt: z.ZodString;
36
44
  updatedAt: z.ZodString;
37
45
  }, z.core.$strip>;
@@ -11,6 +11,10 @@ export declare namespace AdminBlogUpdatePostCommand {
11
11
  author: z.ZodOptional<z.ZodString>;
12
12
  categoryIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
13
13
  status: z.ZodOptional<z.ZodEnum<typeof import("../../schemas").BlogPostStatus>>;
14
+ pageId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
15
+ marks: z.ZodOptional<z.ZodArray<z.ZodEnum<typeof import("../../schemas").BlogPostMark>>>;
16
+ aiWidgetPlaceholder: z.ZodOptional<z.ZodNullable<z.ZodString>>;
17
+ aiWidgetPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
14
18
  }, z.core.$strip>;
15
19
  const Response: z.ZodObject<{
16
20
  uuid: z.ZodString;
@@ -32,6 +36,10 @@ export declare namespace AdminBlogUpdatePostCommand {
32
36
  }, z.core.$strip>>;
33
37
  viewsCount: z.ZodNumber;
34
38
  status: z.ZodEnum<typeof import("../../schemas").BlogPostStatus>;
39
+ pageId: z.ZodNullable<z.ZodString>;
40
+ marks: z.ZodArray<z.ZodEnum<typeof import("../../schemas").BlogPostMark>>;
41
+ aiWidgetPlaceholder: z.ZodNullable<z.ZodString>;
42
+ aiWidgetPrompt: z.ZodNullable<z.ZodString>;
35
43
  createdAt: z.ZodString;
36
44
  updatedAt: z.ZodString;
37
45
  }, z.core.$strip>;
@@ -24,6 +24,10 @@ export declare namespace AdminBlogGetPostQuery {
24
24
  }, z.core.$strip>>;
25
25
  viewsCount: z.ZodNumber;
26
26
  status: z.ZodEnum<typeof import("../../schemas").BlogPostStatus>;
27
+ pageId: z.ZodNullable<z.ZodString>;
28
+ marks: z.ZodArray<z.ZodEnum<typeof import("../../schemas").BlogPostMark>>;
29
+ aiWidgetPlaceholder: z.ZodNullable<z.ZodString>;
30
+ aiWidgetPrompt: z.ZodNullable<z.ZodString>;
27
31
  createdAt: z.ZodString;
28
32
  updatedAt: z.ZodString;
29
33
  }, z.core.$strip>;
@@ -28,6 +28,10 @@ export declare namespace AdminBlogGetPostsQuery {
28
28
  }, z.core.$strip>>;
29
29
  viewsCount: z.ZodNumber;
30
30
  status: z.ZodEnum<typeof import("../../schemas").BlogPostStatus>;
31
+ pageId: z.ZodNullable<z.ZodString>;
32
+ marks: z.ZodArray<z.ZodEnum<typeof import("../../schemas").BlogPostMark>>;
33
+ aiWidgetPlaceholder: z.ZodNullable<z.ZodString>;
34
+ aiWidgetPrompt: z.ZodNullable<z.ZodString>;
31
35
  createdAt: z.ZodString;
32
36
  updatedAt: z.ZodString;
33
37
  }, z.core.$strip>>;
@@ -13,6 +13,7 @@ export declare enum BlogErrorCode {
13
13
  POST_CREATION_FAILED = "POST_CREATION_FAILED",
14
14
  POST_UPDATE_FAILED = "POST_UPDATE_FAILED",
15
15
  POST_DELETE_FAILED = "POST_DELETE_FAILED",
16
- INVALID_ALIAS_FORMAT = "INVALID_ALIAS_FORMAT"
16
+ INVALID_ALIAS_FORMAT = "INVALID_ALIAS_FORMAT",
17
+ AI_WIDGET_VALIDATION_FAILED = "AI_WIDGET_VALIDATION_FAILED"
17
18
  }
18
19
  export declare const BLOG_ERRORS: Record<BlogErrorCode, ErrorMetadata>;
@@ -20,6 +20,7 @@ var BlogErrorCode;
20
20
  BlogErrorCode["POST_DELETE_FAILED"] = "POST_DELETE_FAILED";
21
21
  // Validation errors
22
22
  BlogErrorCode["INVALID_ALIAS_FORMAT"] = "INVALID_ALIAS_FORMAT";
23
+ BlogErrorCode["AI_WIDGET_VALIDATION_FAILED"] = "AI_WIDGET_VALIDATION_FAILED";
23
24
  })(BlogErrorCode || (exports.BlogErrorCode = BlogErrorCode = {}));
24
25
  exports.BLOG_ERRORS = {
25
26
  // Category errors
@@ -81,4 +82,8 @@ exports.BLOG_ERRORS = {
81
82
  code: BlogErrorCode.INVALID_ALIAS_FORMAT,
82
83
  statusCode: 400,
83
84
  },
85
+ [BlogErrorCode.AI_WIDGET_VALIDATION_FAILED]: {
86
+ code: BlogErrorCode.AI_WIDGET_VALIDATION_FAILED,
87
+ statusCode: 400,
88
+ },
84
89
  };
@@ -24,8 +24,16 @@ export declare namespace BlogGetPostByAliasQuery {
24
24
  }, z.core.$strip>>;
25
25
  viewsCount: z.ZodNumber;
26
26
  status: z.ZodEnum<typeof import("../../schemas").BlogPostStatus>;
27
+ pageId: z.ZodNullable<z.ZodString>;
28
+ marks: z.ZodArray<z.ZodEnum<typeof import("../../schemas").BlogPostMark>>;
29
+ aiWidgetPlaceholder: z.ZodNullable<z.ZodString>;
30
+ aiWidgetPrompt: z.ZodNullable<z.ZodString>;
27
31
  createdAt: z.ZodString;
28
32
  updatedAt: z.ZodString;
33
+ page: z.ZodNullable<z.ZodObject<{
34
+ uuid: z.ZodString;
35
+ alias: z.ZodString;
36
+ }, z.core.$strip>>;
29
37
  }, z.core.$strip>;
30
38
  const URL: (alias: string) => string;
31
39
  const METHOD = HttpMethod.GET;
@@ -7,7 +7,7 @@ const http_method_1 = require("../../../../shared/http-method");
7
7
  var BlogGetPostByAliasQuery;
8
8
  (function (BlogGetPostByAliasQuery) {
9
9
  BlogGetPostByAliasQuery.Request = schemas_1.AliasParamSchema;
10
- BlogGetPostByAliasQuery.Response = schemas_1.PostResponseSchema;
10
+ BlogGetPostByAliasQuery.Response = schemas_1.PublicPostResponseSchema;
11
11
  BlogGetPostByAliasQuery.URL = (alias) => rest_api_1.REST_API.V1.BLOG.PUBLIC.POSTS.GET_BY_ALIAS(alias);
12
12
  BlogGetPostByAliasQuery.METHOD = http_method_1.HttpMethod.GET;
13
13
  })(BlogGetPostByAliasQuery || (exports.BlogGetPostByAliasQuery = BlogGetPostByAliasQuery = {}));
@@ -27,6 +27,10 @@ export declare namespace BlogGetPostsQuery {
27
27
  }, z.core.$strip>>;
28
28
  viewsCount: z.ZodNumber;
29
29
  status: z.ZodEnum<typeof import("../../schemas").BlogPostStatus>;
30
+ pageId: z.ZodNullable<z.ZodString>;
31
+ marks: z.ZodArray<z.ZodEnum<typeof import("../../schemas").BlogPostMark>>;
32
+ aiWidgetPlaceholder: z.ZodNullable<z.ZodString>;
33
+ aiWidgetPrompt: z.ZodNullable<z.ZodString>;
30
34
  createdAt: z.ZodString;
31
35
  updatedAt: z.ZodString;
32
36
  }, z.core.$strip>>;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Blog Post Marks Enum
3
+ * Used as feature flags for blog posts
4
+ */
5
+ export declare enum BlogPostMark {
6
+ AI_WIDGET = "AI_WIDGET"
7
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BlogPostMark = void 0;
4
+ /**
5
+ * Blog Post Marks Enum
6
+ * Used as feature flags for blog posts
7
+ */
8
+ var BlogPostMark;
9
+ (function (BlogPostMark) {
10
+ BlogPostMark["AI_WIDGET"] = "AI_WIDGET";
11
+ })(BlogPostMark || (exports.BlogPostMark = BlogPostMark = {}));
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { BlogPostStatus } from './blog-post-status.enum';
3
+ import { BlogPostMark } from './blog-post-mark.enum';
3
4
  export declare const CreatePostRequestSchema: z.ZodObject<{
4
5
  alias: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
5
6
  title: z.ZodString;
@@ -10,4 +11,8 @@ export declare const CreatePostRequestSchema: z.ZodObject<{
10
11
  author: z.ZodString;
11
12
  categoryIds: z.ZodArray<z.ZodString>;
12
13
  status: z.ZodDefault<z.ZodEnum<typeof BlogPostStatus>>;
14
+ pageId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
15
+ marks: z.ZodDefault<z.ZodArray<z.ZodEnum<typeof BlogPostMark>>>;
16
+ aiWidgetPlaceholder: z.ZodOptional<z.ZodNullable<z.ZodString>>;
17
+ aiWidgetPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
13
18
  }, z.core.$strip>;
@@ -4,8 +4,15 @@ exports.CreatePostRequestSchema = void 0;
4
4
  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
- exports.CreatePostRequestSchema = zod_1.z.object({
8
- alias: zod_1.z.string().min(1).max(200).regex(shared_1.SLUG_REGEX).transform(val => val.toLowerCase().trim()),
7
+ const blog_post_mark_enum_1 = require("./blog-post-mark.enum");
8
+ exports.CreatePostRequestSchema = zod_1.z
9
+ .object({
10
+ alias: zod_1.z
11
+ .string()
12
+ .min(1)
13
+ .max(200)
14
+ .regex(shared_1.SLUG_REGEX)
15
+ .transform((val) => val.toLowerCase().trim()),
9
16
  title: zod_1.z.string().min(1).max(300),
10
17
  metaTitle: zod_1.z.string().min(1).max(100),
11
18
  metaDescription: zod_1.z.string().min(1).max(200),
@@ -13,5 +20,17 @@ exports.CreatePostRequestSchema = zod_1.z.object({
13
20
  image: zod_1.z.string().url(),
14
21
  author: zod_1.z.string().min(1).max(100),
15
22
  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),
23
+ status: zod_1.z.nativeEnum(blog_post_status_enum_1.BlogPostStatus).default(blog_post_status_enum_1.BlogPostStatus.DRAFT),
24
+ pageId: zod_1.z.string().regex(shared_1.UUID_REGEX).nullable().optional(),
25
+ marks: zod_1.z.array(zod_1.z.nativeEnum(blog_post_mark_enum_1.BlogPostMark)).default([]),
26
+ aiWidgetPlaceholder: zod_1.z.string().max(500).nullable().optional(),
27
+ aiWidgetPrompt: zod_1.z.string().max(2000).nullable().optional(),
28
+ })
29
+ .refine((data) => {
30
+ if (data.marks.includes(blog_post_mark_enum_1.BlogPostMark.AI_WIDGET)) {
31
+ return data.pageId && data.aiWidgetPlaceholder && data.aiWidgetPrompt;
32
+ }
33
+ return true;
34
+ }, {
35
+ message: 'pageId, aiWidgetPlaceholder and aiWidgetPrompt are required when AI_WIDGET mark is present',
17
36
  });
@@ -1,9 +1,11 @@
1
1
  export * from './blog-category-status.enum';
2
2
  export * from './blog-post-status.enum';
3
+ export * from './blog-post-mark.enum';
3
4
  export * from './category-response.schema';
4
5
  export * from './create-category-request.schema';
5
6
  export * from './update-category-request.schema';
6
7
  export * from './post-response.schema';
8
+ export * from './public-post-response.schema';
7
9
  export * from './create-post-request.schema';
8
10
  export * from './update-post-request.schema';
9
11
  export * from './get-posts-query.schema';
@@ -16,10 +16,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./blog-category-status.enum"), exports);
18
18
  __exportStar(require("./blog-post-status.enum"), exports);
19
+ __exportStar(require("./blog-post-mark.enum"), exports);
19
20
  __exportStar(require("./category-response.schema"), exports);
20
21
  __exportStar(require("./create-category-request.schema"), exports);
21
22
  __exportStar(require("./update-category-request.schema"), exports);
22
23
  __exportStar(require("./post-response.schema"), exports);
24
+ __exportStar(require("./public-post-response.schema"), exports);
23
25
  __exportStar(require("./create-post-request.schema"), exports);
24
26
  __exportStar(require("./update-post-request.schema"), exports);
25
27
  __exportStar(require("./get-posts-query.schema"), exports);
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { BlogPostStatus } from './blog-post-status.enum';
3
+ import { BlogPostMark } from './blog-post-mark.enum';
3
4
  /**
4
5
  * Post Response Schema
5
6
  */
@@ -23,6 +24,10 @@ export declare const PostResponseSchema: z.ZodObject<{
23
24
  }, z.core.$strip>>;
24
25
  viewsCount: z.ZodNumber;
25
26
  status: z.ZodEnum<typeof BlogPostStatus>;
27
+ pageId: z.ZodNullable<z.ZodString>;
28
+ marks: z.ZodArray<z.ZodEnum<typeof BlogPostMark>>;
29
+ aiWidgetPlaceholder: z.ZodNullable<z.ZodString>;
30
+ aiWidgetPrompt: z.ZodNullable<z.ZodString>;
26
31
  createdAt: z.ZodString;
27
32
  updatedAt: z.ZodString;
28
33
  }, z.core.$strip>;
@@ -4,6 +4,7 @@ exports.PostResponseSchema = void 0;
4
4
  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
+ const blog_post_mark_enum_1 = require("./blog-post-mark.enum");
7
8
  const category_response_schema_1 = require("./category-response.schema");
8
9
  /**
9
10
  * Post Response Schema
@@ -20,6 +21,10 @@ exports.PostResponseSchema = zod_1.z.object({
20
21
  categories: zod_1.z.array(category_response_schema_1.CategoryResponseSchema),
21
22
  viewsCount: zod_1.z.number().int().nonnegative(),
22
23
  status: zod_1.z.nativeEnum(blog_post_status_enum_1.BlogPostStatus),
24
+ pageId: zod_1.z.string().regex(regex_1.UUID_REGEX).nullable(),
25
+ marks: zod_1.z.array(zod_1.z.nativeEnum(blog_post_mark_enum_1.BlogPostMark)),
26
+ aiWidgetPlaceholder: zod_1.z.string().nullable(),
27
+ aiWidgetPrompt: zod_1.z.string().nullable(),
23
28
  createdAt: zod_1.z.string().regex(regex_1.DATETIME_REGEX),
24
29
  updatedAt: zod_1.z.string().regex(regex_1.DATETIME_REGEX),
25
30
  });
@@ -0,0 +1,43 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Mini Page object for public post response
4
+ */
5
+ export declare const MiniPageSchema: z.ZodObject<{
6
+ uuid: z.ZodString;
7
+ alias: z.ZodString;
8
+ }, z.core.$strip>;
9
+ /**
10
+ * Public Post Response Schema
11
+ * Extends PostResponseSchema with page object
12
+ */
13
+ export declare const PublicPostResponseSchema: z.ZodObject<{
14
+ uuid: z.ZodString;
15
+ alias: z.ZodString;
16
+ title: z.ZodString;
17
+ metaTitle: z.ZodString;
18
+ metaDescription: z.ZodString;
19
+ content: z.ZodString;
20
+ image: z.ZodString;
21
+ author: z.ZodString;
22
+ categories: z.ZodArray<z.ZodObject<{
23
+ uuid: z.ZodString;
24
+ alias: z.ZodString;
25
+ title: z.ZodString;
26
+ order: z.ZodNumber;
27
+ status: z.ZodEnum<typeof import("./blog-category-status.enum").BlogCategoryStatus>;
28
+ createdAt: z.ZodString;
29
+ updatedAt: z.ZodString;
30
+ }, z.core.$strip>>;
31
+ viewsCount: z.ZodNumber;
32
+ status: z.ZodEnum<typeof import("./blog-post-status.enum").BlogPostStatus>;
33
+ pageId: z.ZodNullable<z.ZodString>;
34
+ marks: z.ZodArray<z.ZodEnum<typeof import("./blog-post-mark.enum").BlogPostMark>>;
35
+ aiWidgetPlaceholder: z.ZodNullable<z.ZodString>;
36
+ aiWidgetPrompt: z.ZodNullable<z.ZodString>;
37
+ createdAt: z.ZodString;
38
+ updatedAt: z.ZodString;
39
+ page: z.ZodNullable<z.ZodObject<{
40
+ uuid: z.ZodString;
41
+ alias: z.ZodString;
42
+ }, z.core.$strip>>;
43
+ }, z.core.$strip>;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PublicPostResponseSchema = exports.MiniPageSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const regex_1 = require("../../../shared/regex");
6
+ const post_response_schema_1 = require("./post-response.schema");
7
+ /**
8
+ * Mini Page object for public post response
9
+ */
10
+ exports.MiniPageSchema = zod_1.z.object({
11
+ uuid: zod_1.z.string().regex(regex_1.UUID_REGEX),
12
+ alias: zod_1.z.string(),
13
+ });
14
+ /**
15
+ * Public Post Response Schema
16
+ * Extends PostResponseSchema with page object
17
+ */
18
+ exports.PublicPostResponseSchema = post_response_schema_1.PostResponseSchema.extend({
19
+ page: exports.MiniPageSchema.nullable(),
20
+ });
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { BlogPostStatus } from './blog-post-status.enum';
3
+ import { BlogPostMark } from './blog-post-mark.enum';
3
4
  export declare const UpdatePostRequestSchema: z.ZodObject<{
4
5
  alias: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
5
6
  title: z.ZodOptional<z.ZodString>;
@@ -10,4 +11,8 @@ export declare const UpdatePostRequestSchema: z.ZodObject<{
10
11
  author: z.ZodOptional<z.ZodString>;
11
12
  categoryIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
12
13
  status: z.ZodOptional<z.ZodEnum<typeof BlogPostStatus>>;
14
+ pageId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
15
+ marks: z.ZodOptional<z.ZodArray<z.ZodEnum<typeof BlogPostMark>>>;
16
+ aiWidgetPlaceholder: z.ZodOptional<z.ZodNullable<z.ZodString>>;
17
+ aiWidgetPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
13
18
  }, z.core.$strip>;
@@ -4,8 +4,16 @@ exports.UpdatePostRequestSchema = void 0;
4
4
  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
- exports.UpdatePostRequestSchema = zod_1.z.object({
8
- alias: zod_1.z.string().min(1).max(200).regex(regex_1.SLUG_REGEX).transform(val => val.toLowerCase().trim()).optional(),
7
+ const blog_post_mark_enum_1 = require("./blog-post-mark.enum");
8
+ exports.UpdatePostRequestSchema = zod_1.z
9
+ .object({
10
+ alias: zod_1.z
11
+ .string()
12
+ .min(1)
13
+ .max(200)
14
+ .regex(regex_1.SLUG_REGEX)
15
+ .transform((val) => val.toLowerCase().trim())
16
+ .optional(),
9
17
  title: zod_1.z.string().min(1).max(300).optional(),
10
18
  metaTitle: zod_1.z.string().min(1).max(100).optional(),
11
19
  metaDescription: zod_1.z.string().min(1).max(200).optional(),
@@ -14,4 +22,17 @@ exports.UpdatePostRequestSchema = zod_1.z.object({
14
22
  author: zod_1.z.string().min(1).max(100).optional(),
15
23
  categoryIds: zod_1.z.array(zod_1.z.string().regex(regex_1.UUID_REGEX)).min(1).optional(),
16
24
  status: zod_1.z.nativeEnum(blog_post_status_enum_1.BlogPostStatus).optional(),
25
+ pageId: zod_1.z.string().regex(regex_1.UUID_REGEX).nullable().optional(),
26
+ marks: zod_1.z.array(zod_1.z.nativeEnum(blog_post_mark_enum_1.BlogPostMark)).optional(),
27
+ aiWidgetPlaceholder: zod_1.z.string().max(500).nullable().optional(),
28
+ aiWidgetPrompt: zod_1.z.string().max(2000).nullable().optional(),
29
+ })
30
+ .refine((data) => {
31
+ var _a;
32
+ if ((_a = data.marks) === null || _a === void 0 ? void 0 : _a.includes(blog_post_mark_enum_1.BlogPostMark.AI_WIDGET)) {
33
+ return data.pageId && data.aiWidgetPlaceholder && data.aiWidgetPrompt;
34
+ }
35
+ return true;
36
+ }, {
37
+ message: 'pageId, aiWidgetPlaceholder and aiWidgetPrompt are required when AI_WIDGET mark is present',
17
38
  });
@@ -2,20 +2,29 @@ import { z } from 'zod';
2
2
  import { HttpMethod } from '../../../../shared/http-method';
3
3
  export declare namespace SeoPageGetHierarchyListQuery {
4
4
  const Request: z.ZodObject<{}, z.core.$strip>;
5
- const Response: z.ZodArray<z.ZodObject<{
6
- uuid: z.ZodString;
7
- alias: z.ZodString;
8
- icon: z.ZodString;
9
- seoText: z.ZodNullable<z.ZodString>;
10
- marks: z.ZodArray<z.ZodString>;
11
- sub: z.ZodArray<z.ZodObject<{
5
+ const Response: z.ZodObject<{
6
+ index: z.ZodNullable<z.ZodObject<{
12
7
  uuid: z.ZodString;
13
8
  alias: z.ZodString;
14
9
  icon: z.ZodString;
15
10
  seoText: z.ZodNullable<z.ZodString>;
16
11
  marks: z.ZodArray<z.ZodString>;
17
12
  }, z.core.$strip>>;
18
- }, z.core.$strip>>;
13
+ pages: z.ZodArray<z.ZodObject<{
14
+ uuid: z.ZodString;
15
+ alias: z.ZodString;
16
+ icon: z.ZodString;
17
+ seoText: z.ZodNullable<z.ZodString>;
18
+ marks: z.ZodArray<z.ZodString>;
19
+ sub: z.ZodArray<z.ZodObject<{
20
+ uuid: z.ZodString;
21
+ alias: z.ZodString;
22
+ icon: z.ZodString;
23
+ seoText: z.ZodNullable<z.ZodString>;
24
+ marks: z.ZodArray<z.ZodString>;
25
+ }, z.core.$strip>>;
26
+ }, z.core.$strip>>;
27
+ }, z.core.$strip>;
19
28
  const URL: "/api/v1/seo-pages/list";
20
29
  const METHOD = HttpMethod.GET;
21
30
  type RequestType = z.infer<typeof Request>;
@@ -8,7 +8,7 @@ const http_method_1 = require("../../../../shared/http-method");
8
8
  var SeoPageGetHierarchyListQuery;
9
9
  (function (SeoPageGetHierarchyListQuery) {
10
10
  SeoPageGetHierarchyListQuery.Request = zod_1.z.object({});
11
- SeoPageGetHierarchyListQuery.Response = schemas_1.PageHierarchyListSchema;
11
+ SeoPageGetHierarchyListQuery.Response = schemas_1.PageHierarchyResponseSchema;
12
12
  SeoPageGetHierarchyListQuery.URL = rest_api_1.REST_API.V1.SEO_PAGES.PUBLIC.GET_LIST;
13
13
  SeoPageGetHierarchyListQuery.METHOD = http_method_1.HttpMethod.GET;
14
14
  })(SeoPageGetHierarchyListQuery || (exports.SeoPageGetHierarchyListQuery = SeoPageGetHierarchyListQuery = {}));
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export { PageType } from './page-type.enum';
5
5
  export { PageResponseSchema, PageListItemSchema } from './page-response.schema';
6
- export { PageHierarchySubItemSchema, PageHierarchyItemSchema, PageHierarchyListSchema, type PageHierarchySubItem, type PageHierarchyItem, type PageHierarchyList, } from './page-hierarchy.schema';
6
+ export { PageHierarchySubItemSchema, PageHierarchyItemSchema, PageHierarchyListSchema, PageHierarchyResponseSchema, type PageHierarchySubItem, type PageHierarchyItem, type PageHierarchyList, type PageHierarchyResponse, } from './page-hierarchy.schema';
7
7
  export { CreatePageRequestSchema } from './create-page-request.schema';
8
8
  export { UpdatePageRequestSchema } from './update-page-request.schema';
9
9
  export { FaqSchema, FaqItemSchema, type Faq, type FaqItem } from './faq.schema';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FaqItemSchema = exports.FaqSchema = exports.UpdatePageRequestSchema = exports.CreatePageRequestSchema = exports.PageHierarchyListSchema = exports.PageHierarchyItemSchema = exports.PageHierarchySubItemSchema = exports.PageListItemSchema = exports.PageResponseSchema = exports.PageType = void 0;
3
+ exports.FaqItemSchema = exports.FaqSchema = exports.UpdatePageRequestSchema = exports.CreatePageRequestSchema = exports.PageHierarchyResponseSchema = exports.PageHierarchyListSchema = exports.PageHierarchyItemSchema = exports.PageHierarchySubItemSchema = exports.PageListItemSchema = exports.PageResponseSchema = exports.PageType = void 0;
4
4
  /**
5
5
  * Centralized exports for SEO Pages schemas
6
6
  */
@@ -13,6 +13,7 @@ var page_hierarchy_schema_1 = require("./page-hierarchy.schema");
13
13
  Object.defineProperty(exports, "PageHierarchySubItemSchema", { enumerable: true, get: function () { return page_hierarchy_schema_1.PageHierarchySubItemSchema; } });
14
14
  Object.defineProperty(exports, "PageHierarchyItemSchema", { enumerable: true, get: function () { return page_hierarchy_schema_1.PageHierarchyItemSchema; } });
15
15
  Object.defineProperty(exports, "PageHierarchyListSchema", { enumerable: true, get: function () { return page_hierarchy_schema_1.PageHierarchyListSchema; } });
16
+ Object.defineProperty(exports, "PageHierarchyResponseSchema", { enumerable: true, get: function () { return page_hierarchy_schema_1.PageHierarchyResponseSchema; } });
16
17
  var create_page_request_schema_1 = require("./create-page-request.schema");
17
18
  Object.defineProperty(exports, "CreatePageRequestSchema", { enumerable: true, get: function () { return create_page_request_schema_1.CreatePageRequestSchema; } });
18
19
  var update_page_request_schema_1 = require("./update-page-request.schema");
@@ -27,7 +27,7 @@ export declare const PageHierarchyItemSchema: z.ZodObject<{
27
27
  }, z.core.$strip>>;
28
28
  }, z.core.$strip>;
29
29
  /**
30
- * Full hierarchical list response
30
+ * Full hierarchical list response (array of main pages)
31
31
  */
32
32
  export declare const PageHierarchyListSchema: z.ZodArray<z.ZodObject<{
33
33
  uuid: z.ZodString;
@@ -43,6 +43,33 @@ export declare const PageHierarchyListSchema: z.ZodArray<z.ZodObject<{
43
43
  marks: z.ZodArray<z.ZodString>;
44
44
  }, z.core.$strip>>;
45
45
  }, z.core.$strip>>;
46
+ /**
47
+ * Hierarchy response with index page
48
+ */
49
+ export declare const PageHierarchyResponseSchema: z.ZodObject<{
50
+ index: z.ZodNullable<z.ZodObject<{
51
+ uuid: z.ZodString;
52
+ alias: z.ZodString;
53
+ icon: z.ZodString;
54
+ seoText: z.ZodNullable<z.ZodString>;
55
+ marks: z.ZodArray<z.ZodString>;
56
+ }, z.core.$strip>>;
57
+ pages: z.ZodArray<z.ZodObject<{
58
+ uuid: z.ZodString;
59
+ alias: z.ZodString;
60
+ icon: z.ZodString;
61
+ seoText: z.ZodNullable<z.ZodString>;
62
+ marks: z.ZodArray<z.ZodString>;
63
+ sub: z.ZodArray<z.ZodObject<{
64
+ uuid: z.ZodString;
65
+ alias: z.ZodString;
66
+ icon: z.ZodString;
67
+ seoText: z.ZodNullable<z.ZodString>;
68
+ marks: z.ZodArray<z.ZodString>;
69
+ }, z.core.$strip>>;
70
+ }, z.core.$strip>>;
71
+ }, z.core.$strip>;
46
72
  export type PageHierarchySubItem = z.infer<typeof PageHierarchySubItemSchema>;
47
73
  export type PageHierarchyItem = z.infer<typeof PageHierarchyItemSchema>;
48
74
  export type PageHierarchyList = z.infer<typeof PageHierarchyListSchema>;
75
+ export type PageHierarchyResponse = z.infer<typeof PageHierarchyResponseSchema>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PageHierarchyListSchema = exports.PageHierarchyItemSchema = exports.PageHierarchySubItemSchema = void 0;
3
+ exports.PageHierarchyResponseSchema = exports.PageHierarchyListSchema = exports.PageHierarchyItemSchema = exports.PageHierarchySubItemSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const shared_1 = require("../../../shared");
6
6
  /**
@@ -25,6 +25,13 @@ exports.PageHierarchyItemSchema = zod_1.z.object({
25
25
  sub: zod_1.z.array(exports.PageHierarchySubItemSchema),
26
26
  });
27
27
  /**
28
- * Full hierarchical list response
28
+ * Full hierarchical list response (array of main pages)
29
29
  */
30
30
  exports.PageHierarchyListSchema = zod_1.z.array(exports.PageHierarchyItemSchema);
31
+ /**
32
+ * Hierarchy response with index page
33
+ */
34
+ exports.PageHierarchyResponseSchema = zod_1.z.object({
35
+ index: exports.PageHierarchySubItemSchema.nullable(),
36
+ pages: exports.PageHierarchyListSchema,
37
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veruna/api-contracts",
3
- "version": "1.0.38",
3
+ "version": "1.0.40",
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",