@veruna/api-contracts 1.0.17 → 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.
- package/build/rest-api.d.ts +2 -0
- package/build/rest-api.js +2 -0
- package/build/routes/seo-pages-public.routes.d.ts +2 -0
- package/build/routes/seo-pages-public.routes.js +2 -0
- package/build/v1/auth/auth.errors.d.ts +2 -1
- package/build/v1/auth/auth.errors.js +5 -0
- package/build/v1/blog/admin/commands/delete-category.command.d.ts +3 -1
- package/build/v1/blog/admin/commands/delete-category.command.js +4 -4
- package/build/v1/blog/admin/commands/delete-post.command.d.ts +3 -1
- package/build/v1/blog/admin/commands/delete-post.command.js +4 -4
- package/build/v1/blog/admin/queries/get-category.query.d.ts +3 -1
- package/build/v1/blog/admin/queries/get-category.query.js +1 -2
- package/build/v1/blog/admin/queries/get-post.query.d.ts +3 -1
- package/build/v1/blog/admin/queries/get-post.query.js +1 -2
- package/build/v1/blog/public/queries/get-post-by-alias.query.d.ts +3 -1
- package/build/v1/blog/public/queries/get-post-by-alias.query.js +1 -2
- package/build/v1/blog/schemas/create-post-request.schema.js +1 -1
- package/build/v1/blog/schemas/index.d.ts +1 -0
- package/build/v1/blog/schemas/index.js +1 -0
- package/build/v1/blog/schemas/route-params.schema.d.ts +17 -0
- package/build/v1/blog/schemas/route-params.schema.js +23 -0
- package/build/v1/blog/schemas/update-post-request.schema.js +1 -1
- package/build/v1/seo-pages/admin/commands/create-page.command.d.ts +12 -0
- package/build/v1/seo-pages/admin/commands/update-page.command.d.ts +12 -0
- package/build/v1/seo-pages/admin/queries/get-page.query.d.ts +6 -0
- package/build/v1/seo-pages/admin/queries/get-pages.query.d.ts +6 -7
- package/build/v1/seo-pages/admin/queries/get-pages.query.js +1 -1
- package/build/v1/seo-pages/public/queries/get-hierarchy-list.query.d.ts +23 -0
- package/build/v1/seo-pages/public/queries/get-hierarchy-list.query.js +14 -0
- package/build/v1/seo-pages/public/queries/get-index-page.query.d.ts +33 -0
- package/build/v1/seo-pages/public/queries/get-index-page.query.js +14 -0
- package/build/v1/seo-pages/public/queries/get-page-by-alias.query.d.ts +6 -0
- package/build/v1/seo-pages/public/queries/index.d.ts +2 -0
- package/build/v1/seo-pages/public/queries/index.js +5 -1
- package/build/v1/seo-pages/schemas/create-page-request.schema.d.ts +6 -0
- package/build/v1/seo-pages/schemas/create-page-request.schema.js +14 -2
- package/build/v1/seo-pages/schemas/index.d.ts +2 -1
- package/build/v1/seo-pages/schemas/index.js +6 -1
- package/build/v1/seo-pages/schemas/page-hierarchy.schema.d.ts +48 -0
- package/build/v1/seo-pages/schemas/page-hierarchy.schema.js +30 -0
- package/build/v1/seo-pages/schemas/page-response.schema.d.ts +27 -1
- package/build/v1/seo-pages/schemas/page-response.schema.js +35 -7
- package/build/v1/seo-pages/schemas/page-type.enum.d.ts +6 -3
- package/build/v1/seo-pages/schemas/page-type.enum.js +6 -3
- package/build/v1/seo-pages/schemas/update-page-request.schema.d.ts +6 -0
- package/build/v1/seo-pages/schemas/update-page-request.schema.js +15 -2
- package/build/v1/seo-pages/seo-pages.errors.d.ts +8 -1
- package/build/v1/seo-pages/seo-pages.errors.js +37 -0
- package/package.json +1 -1
package/build/rest-api.d.ts
CHANGED
|
@@ -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
|
},
|
|
@@ -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
|
};
|
|
@@ -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
|
};
|
|
@@ -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<{
|
|
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
|
|
6
|
+
const shared_1 = require("../../../../shared");
|
|
7
|
+
const schemas_1 = require("../../schemas");
|
|
8
8
|
var AdminBlogDeleteCategoryCommand;
|
|
9
9
|
(function (AdminBlogDeleteCategoryCommand) {
|
|
10
|
-
AdminBlogDeleteCategoryCommand.Request =
|
|
11
|
-
AdminBlogDeleteCategoryCommand.Response =
|
|
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<{
|
|
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
|
|
6
|
+
const shared_1 = require("../../../../shared");
|
|
7
|
+
const schemas_1 = require("../../schemas");
|
|
8
8
|
var AdminBlogDeletePostCommand;
|
|
9
9
|
(function (AdminBlogDeletePostCommand) {
|
|
10
|
-
AdminBlogDeletePostCommand.Request =
|
|
11
|
-
AdminBlogDeletePostCommand.Response =
|
|
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 = {}));
|
|
@@ -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<{
|
|
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 =
|
|
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<{
|
|
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 =
|
|
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;
|
|
@@ -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<{
|
|
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 =
|
|
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;
|
|
@@ -9,7 +9,7 @@ exports.CreatePostRequestSchema = zod_1.z.object({
|
|
|
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),
|
|
@@ -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
|
+
});
|
|
@@ -9,7 +9,7 @@ exports.UpdatePostRequestSchema = zod_1.z.object({
|
|
|
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(),
|
|
@@ -9,12 +9,18 @@ export declare namespace AdminSeoPageCreatePageCommand {
|
|
|
9
9
|
content: z.ZodString;
|
|
10
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>;
|
|
@@ -9,12 +9,18 @@ export declare namespace AdminSeoPageUpdatePageCommand {
|
|
|
9
9
|
content: z.ZodOptional<z.ZodString>;
|
|
10
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>;
|
|
@@ -11,12 +11,18 @@ export declare namespace AdminSeoPageGetPageQuery {
|
|
|
11
11
|
content: z.ZodString;
|
|
12
12
|
alias: z.ZodString;
|
|
13
13
|
type: z.ZodEnum<typeof import("../../schemas").PageType>;
|
|
14
|
+
icon: z.ZodString;
|
|
14
15
|
faq: z.ZodObject<{
|
|
15
16
|
items: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
16
17
|
question: z.ZodString;
|
|
17
18
|
answer: z.ZodString;
|
|
18
19
|
}, z.core.$strip>>>;
|
|
19
20
|
}, z.core.$strip>;
|
|
21
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
22
|
+
order: z.ZodNumber;
|
|
23
|
+
placeholder: z.ZodNullable<z.ZodString>;
|
|
24
|
+
seoName: z.ZodNullable<z.ZodString>;
|
|
25
|
+
marks: z.ZodArray<z.ZodString>;
|
|
20
26
|
createdAt: z.ZodString;
|
|
21
27
|
updatedAt: z.ZodString;
|
|
22
28
|
}, z.core.$strip>;
|
|
@@ -12,15 +12,14 @@ export declare namespace AdminSeoPageGetPagesQuery {
|
|
|
12
12
|
metaDescription: z.ZodString;
|
|
13
13
|
title: z.ZodString;
|
|
14
14
|
description: z.ZodString;
|
|
15
|
-
content: z.ZodString;
|
|
16
15
|
alias: z.ZodString;
|
|
17
16
|
type: z.ZodEnum<typeof import("../../schemas").PageType>;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
icon: z.ZodString;
|
|
18
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
19
|
+
order: z.ZodNumber;
|
|
20
|
+
placeholder: z.ZodNullable<z.ZodString>;
|
|
21
|
+
seoName: z.ZodNullable<z.ZodString>;
|
|
22
|
+
marks: z.ZodArray<z.ZodString>;
|
|
24
23
|
createdAt: z.ZodString;
|
|
25
24
|
updatedAt: z.ZodString;
|
|
26
25
|
}, z.core.$strip>>;
|
|
@@ -7,7 +7,7 @@ const pagination_schema_1 = require("../../../../shared/pagination.schema");
|
|
|
7
7
|
const rest_api_1 = require("../../../../rest-api");
|
|
8
8
|
const http_method_1 = require("../../../../shared/http-method");
|
|
9
9
|
const PagesListAdminResponseSchema = zod_1.z.object({
|
|
10
|
-
data: zod_1.z.array(schemas_1.
|
|
10
|
+
data: zod_1.z.array(schemas_1.PageListItemSchema),
|
|
11
11
|
meta: pagination_schema_1.PaginationMetaSchema,
|
|
12
12
|
});
|
|
13
13
|
var AdminSeoPageGetPagesQuery;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { HttpMethod } from '../../../../shared/http-method';
|
|
3
|
+
export declare namespace SeoPageGetHierarchyListQuery {
|
|
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<{
|
|
12
|
+
uuid: z.ZodString;
|
|
13
|
+
alias: z.ZodString;
|
|
14
|
+
icon: z.ZodString;
|
|
15
|
+
seoText: z.ZodNullable<z.ZodString>;
|
|
16
|
+
marks: z.ZodArray<z.ZodString>;
|
|
17
|
+
}, z.core.$strip>>;
|
|
18
|
+
}, z.core.$strip>>;
|
|
19
|
+
const URL: "/api/v1/seo-pages/list";
|
|
20
|
+
const METHOD = HttpMethod.GET;
|
|
21
|
+
type RequestType = z.infer<typeof Request>;
|
|
22
|
+
type ResponseType = z.infer<typeof Response>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SeoPageGetHierarchyListQuery = 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 SeoPageGetHierarchyListQuery;
|
|
9
|
+
(function (SeoPageGetHierarchyListQuery) {
|
|
10
|
+
SeoPageGetHierarchyListQuery.Request = zod_1.z.object({});
|
|
11
|
+
SeoPageGetHierarchyListQuery.Response = schemas_1.PageHierarchyListSchema;
|
|
12
|
+
SeoPageGetHierarchyListQuery.URL = rest_api_1.REST_API.V1.SEO_PAGES.PUBLIC.GET_LIST;
|
|
13
|
+
SeoPageGetHierarchyListQuery.METHOD = http_method_1.HttpMethod.GET;
|
|
14
|
+
})(SeoPageGetHierarchyListQuery || (exports.SeoPageGetHierarchyListQuery = SeoPageGetHierarchyListQuery = {}));
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { HttpMethod } from '../../../../shared/http-method';
|
|
3
|
+
export declare namespace SeoPageGetIndexPageQuery {
|
|
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
|
+
icon: z.ZodString;
|
|
15
|
+
faq: z.ZodObject<{
|
|
16
|
+
items: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
17
|
+
question: z.ZodString;
|
|
18
|
+
answer: z.ZodString;
|
|
19
|
+
}, z.core.$strip>>>;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
22
|
+
order: z.ZodNumber;
|
|
23
|
+
placeholder: z.ZodNullable<z.ZodString>;
|
|
24
|
+
seoName: z.ZodNullable<z.ZodString>;
|
|
25
|
+
marks: z.ZodArray<z.ZodString>;
|
|
26
|
+
createdAt: z.ZodString;
|
|
27
|
+
updatedAt: z.ZodString;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
const URL: "/api/v1/seo-pages";
|
|
30
|
+
const METHOD = HttpMethod.GET;
|
|
31
|
+
type RequestType = z.infer<typeof Request>;
|
|
32
|
+
type ResponseType = z.infer<typeof Response>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SeoPageGetIndexPageQuery = 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 SeoPageGetIndexPageQuery;
|
|
9
|
+
(function (SeoPageGetIndexPageQuery) {
|
|
10
|
+
SeoPageGetIndexPageQuery.Request = zod_1.z.object({});
|
|
11
|
+
SeoPageGetIndexPageQuery.Response = schemas_1.PageResponseSchema;
|
|
12
|
+
SeoPageGetIndexPageQuery.URL = rest_api_1.REST_API.V1.SEO_PAGES.PUBLIC.GET_INDEX;
|
|
13
|
+
SeoPageGetIndexPageQuery.METHOD = http_method_1.HttpMethod.GET;
|
|
14
|
+
})(SeoPageGetIndexPageQuery || (exports.SeoPageGetIndexPageQuery = SeoPageGetIndexPageQuery = {}));
|
|
@@ -11,12 +11,18 @@ export declare namespace SeoPageGetPageByAliasQuery {
|
|
|
11
11
|
content: z.ZodString;
|
|
12
12
|
alias: z.ZodString;
|
|
13
13
|
type: z.ZodEnum<typeof import("../../schemas").PageType>;
|
|
14
|
+
icon: z.ZodString;
|
|
14
15
|
faq: z.ZodObject<{
|
|
15
16
|
items: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
16
17
|
question: z.ZodString;
|
|
17
18
|
answer: z.ZodString;
|
|
18
19
|
}, z.core.$strip>>>;
|
|
19
20
|
}, z.core.$strip>;
|
|
21
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
22
|
+
order: z.ZodNumber;
|
|
23
|
+
placeholder: z.ZodNullable<z.ZodString>;
|
|
24
|
+
seoName: z.ZodNullable<z.ZodString>;
|
|
25
|
+
marks: z.ZodArray<z.ZodString>;
|
|
20
26
|
createdAt: z.ZodString;
|
|
21
27
|
updatedAt: z.ZodString;
|
|
22
28
|
}, z.core.$strip>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Centralized exports for SEO Pages public queries
|
|
3
3
|
*/
|
|
4
|
+
export { SeoPageGetIndexPageQuery } from './get-index-page.query';
|
|
5
|
+
export { SeoPageGetHierarchyListQuery } from './get-hierarchy-list.query';
|
|
4
6
|
export { SeoPageGetPageByAliasQuery } from './get-page-by-alias.query';
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SeoPageGetPageByAliasQuery = void 0;
|
|
3
|
+
exports.SeoPageGetPageByAliasQuery = exports.SeoPageGetHierarchyListQuery = exports.SeoPageGetIndexPageQuery = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Centralized exports for SEO Pages public queries
|
|
6
6
|
*/
|
|
7
|
+
var get_index_page_query_1 = require("./get-index-page.query");
|
|
8
|
+
Object.defineProperty(exports, "SeoPageGetIndexPageQuery", { enumerable: true, get: function () { return get_index_page_query_1.SeoPageGetIndexPageQuery; } });
|
|
9
|
+
var get_hierarchy_list_query_1 = require("./get-hierarchy-list.query");
|
|
10
|
+
Object.defineProperty(exports, "SeoPageGetHierarchyListQuery", { enumerable: true, get: function () { return get_hierarchy_list_query_1.SeoPageGetHierarchyListQuery; } });
|
|
7
11
|
var get_page_by_alias_query_1 = require("./get-page-by-alias.query");
|
|
8
12
|
Object.defineProperty(exports, "SeoPageGetPageByAliasQuery", { enumerable: true, get: function () { return get_page_by_alias_query_1.SeoPageGetPageByAliasQuery; } });
|
|
@@ -11,10 +11,16 @@ export declare const CreatePageRequestSchema: z.ZodObject<{
|
|
|
11
11
|
content: z.ZodString;
|
|
12
12
|
alias: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
13
13
|
type: z.ZodEnum<typeof PageType>;
|
|
14
|
+
icon: z.ZodString;
|
|
14
15
|
faq: z.ZodOptional<z.ZodObject<{
|
|
15
16
|
items: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
16
17
|
question: z.ZodString;
|
|
17
18
|
answer: z.ZodString;
|
|
18
19
|
}, z.core.$strip>>>;
|
|
19
20
|
}, z.core.$strip>>;
|
|
21
|
+
parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
22
|
+
order: z.ZodDefault<z.ZodNumber>;
|
|
23
|
+
placeholder: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
24
|
+
seoName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
25
|
+
marks: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
20
26
|
}, z.core.$strip>;
|
|
@@ -14,7 +14,19 @@ exports.CreatePageRequestSchema = zod_1.z.object({
|
|
|
14
14
|
title: zod_1.z.string().min(1).max(300),
|
|
15
15
|
description: zod_1.z.string().min(1),
|
|
16
16
|
content: zod_1.z.string().min(1),
|
|
17
|
-
alias: zod_1.z
|
|
18
|
-
|
|
17
|
+
alias: zod_1.z
|
|
18
|
+
.string()
|
|
19
|
+
.min(1)
|
|
20
|
+
.max(200)
|
|
21
|
+
.regex(shared_1.SLUG_REGEX)
|
|
22
|
+
.transform((val) => val.toLowerCase().trim()),
|
|
23
|
+
type: zod_1.z.enum(page_type_enum_1.PageType),
|
|
24
|
+
icon: zod_1.z.string().min(1).max(100),
|
|
19
25
|
faq: faq_schema_1.FaqSchema.optional(),
|
|
26
|
+
// Hierarchy & additional fields
|
|
27
|
+
parentId: zod_1.z.string().regex(shared_1.UUID_REGEX).nullable().optional(),
|
|
28
|
+
order: zod_1.z.number().int().min(0).default(0),
|
|
29
|
+
placeholder: zod_1.z.string().max(500).nullable().optional(),
|
|
30
|
+
seoName: zod_1.z.string().max(200).nullable().optional(),
|
|
31
|
+
marks: zod_1.z.array(zod_1.z.string().max(50)).default([]),
|
|
20
32
|
});
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* Centralized exports for SEO Pages schemas
|
|
3
3
|
*/
|
|
4
4
|
export { PageType } from './page-type.enum';
|
|
5
|
-
export { PageResponseSchema } from './page-response.schema';
|
|
5
|
+
export { PageResponseSchema, PageListItemSchema } from './page-response.schema';
|
|
6
|
+
export { PageHierarchySubItemSchema, PageHierarchyItemSchema, PageHierarchyListSchema, type PageHierarchySubItem, type PageHierarchyItem, type PageHierarchyList, } from './page-hierarchy.schema';
|
|
6
7
|
export { CreatePageRequestSchema } from './create-page-request.schema';
|
|
7
8
|
export { UpdatePageRequestSchema } from './update-page-request.schema';
|
|
8
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.PageResponseSchema = exports.PageType = void 0;
|
|
3
|
+
exports.FaqItemSchema = exports.FaqSchema = exports.UpdatePageRequestSchema = exports.CreatePageRequestSchema = 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
|
*/
|
|
@@ -8,6 +8,11 @@ var page_type_enum_1 = require("./page-type.enum");
|
|
|
8
8
|
Object.defineProperty(exports, "PageType", { enumerable: true, get: function () { return page_type_enum_1.PageType; } });
|
|
9
9
|
var page_response_schema_1 = require("./page-response.schema");
|
|
10
10
|
Object.defineProperty(exports, "PageResponseSchema", { enumerable: true, get: function () { return page_response_schema_1.PageResponseSchema; } });
|
|
11
|
+
Object.defineProperty(exports, "PageListItemSchema", { enumerable: true, get: function () { return page_response_schema_1.PageListItemSchema; } });
|
|
12
|
+
var page_hierarchy_schema_1 = require("./page-hierarchy.schema");
|
|
13
|
+
Object.defineProperty(exports, "PageHierarchySubItemSchema", { enumerable: true, get: function () { return page_hierarchy_schema_1.PageHierarchySubItemSchema; } });
|
|
14
|
+
Object.defineProperty(exports, "PageHierarchyItemSchema", { enumerable: true, get: function () { return page_hierarchy_schema_1.PageHierarchyItemSchema; } });
|
|
15
|
+
Object.defineProperty(exports, "PageHierarchyListSchema", { enumerable: true, get: function () { return page_hierarchy_schema_1.PageHierarchyListSchema; } });
|
|
11
16
|
var create_page_request_schema_1 = require("./create-page-request.schema");
|
|
12
17
|
Object.defineProperty(exports, "CreatePageRequestSchema", { enumerable: true, get: function () { return create_page_request_schema_1.CreatePageRequestSchema; } });
|
|
13
18
|
var update_page_request_schema_1 = require("./update-page-request.schema");
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Sub page item in hierarchy (simplified view)
|
|
4
|
+
*/
|
|
5
|
+
export declare const PageHierarchySubItemSchema: 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
|
+
}, z.core.$strip>;
|
|
12
|
+
/**
|
|
13
|
+
* Main page item with sub pages (simplified hierarchy view)
|
|
14
|
+
*/
|
|
15
|
+
export declare const PageHierarchyItemSchema: z.ZodObject<{
|
|
16
|
+
uuid: z.ZodString;
|
|
17
|
+
alias: z.ZodString;
|
|
18
|
+
icon: z.ZodString;
|
|
19
|
+
seoText: z.ZodNullable<z.ZodString>;
|
|
20
|
+
marks: z.ZodArray<z.ZodString>;
|
|
21
|
+
sub: z.ZodArray<z.ZodObject<{
|
|
22
|
+
uuid: z.ZodString;
|
|
23
|
+
alias: z.ZodString;
|
|
24
|
+
icon: z.ZodString;
|
|
25
|
+
seoText: z.ZodNullable<z.ZodString>;
|
|
26
|
+
marks: z.ZodArray<z.ZodString>;
|
|
27
|
+
}, z.core.$strip>>;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
/**
|
|
30
|
+
* Full hierarchical list response
|
|
31
|
+
*/
|
|
32
|
+
export declare const PageHierarchyListSchema: z.ZodArray<z.ZodObject<{
|
|
33
|
+
uuid: z.ZodString;
|
|
34
|
+
alias: z.ZodString;
|
|
35
|
+
icon: z.ZodString;
|
|
36
|
+
seoText: z.ZodNullable<z.ZodString>;
|
|
37
|
+
marks: z.ZodArray<z.ZodString>;
|
|
38
|
+
sub: z.ZodArray<z.ZodObject<{
|
|
39
|
+
uuid: z.ZodString;
|
|
40
|
+
alias: z.ZodString;
|
|
41
|
+
icon: z.ZodString;
|
|
42
|
+
seoText: z.ZodNullable<z.ZodString>;
|
|
43
|
+
marks: z.ZodArray<z.ZodString>;
|
|
44
|
+
}, z.core.$strip>>;
|
|
45
|
+
}, z.core.$strip>>;
|
|
46
|
+
export type PageHierarchySubItem = z.infer<typeof PageHierarchySubItemSchema>;
|
|
47
|
+
export type PageHierarchyItem = z.infer<typeof PageHierarchyItemSchema>;
|
|
48
|
+
export type PageHierarchyList = z.infer<typeof PageHierarchyListSchema>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PageHierarchyListSchema = exports.PageHierarchyItemSchema = exports.PageHierarchySubItemSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const shared_1 = require("../../../shared");
|
|
6
|
+
/**
|
|
7
|
+
* Sub page item in hierarchy (simplified view)
|
|
8
|
+
*/
|
|
9
|
+
exports.PageHierarchySubItemSchema = zod_1.z.object({
|
|
10
|
+
uuid: zod_1.z.string().regex(shared_1.UUID_REGEX),
|
|
11
|
+
alias: zod_1.z.string(),
|
|
12
|
+
icon: zod_1.z.string(),
|
|
13
|
+
seoText: zod_1.z.string().nullable(),
|
|
14
|
+
marks: zod_1.z.array(zod_1.z.string()),
|
|
15
|
+
});
|
|
16
|
+
/**
|
|
17
|
+
* Main page item with sub pages (simplified hierarchy view)
|
|
18
|
+
*/
|
|
19
|
+
exports.PageHierarchyItemSchema = zod_1.z.object({
|
|
20
|
+
uuid: zod_1.z.string().regex(shared_1.UUID_REGEX),
|
|
21
|
+
alias: zod_1.z.string(),
|
|
22
|
+
icon: zod_1.z.string(),
|
|
23
|
+
seoText: zod_1.z.string().nullable(),
|
|
24
|
+
marks: zod_1.z.array(zod_1.z.string()),
|
|
25
|
+
sub: zod_1.z.array(exports.PageHierarchySubItemSchema),
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* Full hierarchical list response
|
|
29
|
+
*/
|
|
30
|
+
exports.PageHierarchyListSchema = zod_1.z.array(exports.PageHierarchyItemSchema);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { PageType } from './page-type.enum';
|
|
3
3
|
/**
|
|
4
|
-
* SEO Page Response Schema
|
|
4
|
+
* SEO Page Response Schema (full, with content)
|
|
5
5
|
*/
|
|
6
6
|
export declare const PageResponseSchema: z.ZodObject<{
|
|
7
7
|
uuid: z.ZodString;
|
|
@@ -12,12 +12,38 @@ export declare const PageResponseSchema: z.ZodObject<{
|
|
|
12
12
|
content: z.ZodString;
|
|
13
13
|
alias: z.ZodString;
|
|
14
14
|
type: z.ZodEnum<typeof PageType>;
|
|
15
|
+
icon: z.ZodString;
|
|
15
16
|
faq: z.ZodObject<{
|
|
16
17
|
items: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
17
18
|
question: z.ZodString;
|
|
18
19
|
answer: z.ZodString;
|
|
19
20
|
}, z.core.$strip>>>;
|
|
20
21
|
}, z.core.$strip>;
|
|
22
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
23
|
+
order: z.ZodNumber;
|
|
24
|
+
placeholder: z.ZodNullable<z.ZodString>;
|
|
25
|
+
seoName: z.ZodNullable<z.ZodString>;
|
|
26
|
+
marks: z.ZodArray<z.ZodString>;
|
|
27
|
+
createdAt: z.ZodString;
|
|
28
|
+
updatedAt: z.ZodString;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
/**
|
|
31
|
+
* SEO Page List Item Schema (without content for performance)
|
|
32
|
+
*/
|
|
33
|
+
export declare const PageListItemSchema: z.ZodObject<{
|
|
34
|
+
uuid: z.ZodString;
|
|
35
|
+
metaTitle: z.ZodString;
|
|
36
|
+
metaDescription: z.ZodString;
|
|
37
|
+
title: z.ZodString;
|
|
38
|
+
description: z.ZodString;
|
|
39
|
+
alias: z.ZodString;
|
|
40
|
+
type: z.ZodEnum<typeof PageType>;
|
|
41
|
+
icon: z.ZodString;
|
|
42
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
43
|
+
order: z.ZodNumber;
|
|
44
|
+
placeholder: z.ZodNullable<z.ZodString>;
|
|
45
|
+
seoName: z.ZodNullable<z.ZodString>;
|
|
46
|
+
marks: z.ZodArray<z.ZodString>;
|
|
21
47
|
createdAt: z.ZodString;
|
|
22
48
|
updatedAt: z.ZodString;
|
|
23
49
|
}, z.core.$strip>;
|
|
@@ -1,23 +1,51 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PageResponseSchema = void 0;
|
|
3
|
+
exports.PageListItemSchema = exports.PageResponseSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
5
|
+
const shared_1 = require("../../../shared");
|
|
6
6
|
const page_type_enum_1 = require("./page-type.enum");
|
|
7
7
|
const faq_schema_1 = require("./faq.schema");
|
|
8
8
|
/**
|
|
9
|
-
* SEO Page Response Schema
|
|
9
|
+
* SEO Page Response Schema (full, with content)
|
|
10
10
|
*/
|
|
11
11
|
exports.PageResponseSchema = zod_1.z.object({
|
|
12
|
-
uuid: zod_1.z.string().regex(
|
|
12
|
+
uuid: zod_1.z.string().regex(shared_1.UUID_REGEX),
|
|
13
13
|
metaTitle: zod_1.z.string(),
|
|
14
14
|
metaDescription: zod_1.z.string(),
|
|
15
15
|
title: zod_1.z.string(),
|
|
16
16
|
description: zod_1.z.string(),
|
|
17
17
|
content: zod_1.z.string(),
|
|
18
18
|
alias: zod_1.z.string(),
|
|
19
|
-
type: zod_1.z.
|
|
19
|
+
type: zod_1.z.enum(page_type_enum_1.PageType),
|
|
20
|
+
icon: zod_1.z.string(),
|
|
20
21
|
faq: faq_schema_1.FaqSchema,
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
// Hierarchy & additional fields
|
|
23
|
+
parentId: zod_1.z.string().regex(shared_1.UUID_REGEX).nullable(),
|
|
24
|
+
order: zod_1.z.number(),
|
|
25
|
+
placeholder: zod_1.z.string().nullable(),
|
|
26
|
+
seoName: zod_1.z.string().nullable(),
|
|
27
|
+
marks: zod_1.z.array(zod_1.z.string()),
|
|
28
|
+
createdAt: zod_1.z.string().regex(shared_1.DATETIME_REGEX),
|
|
29
|
+
updatedAt: zod_1.z.string().regex(shared_1.DATETIME_REGEX),
|
|
30
|
+
});
|
|
31
|
+
/**
|
|
32
|
+
* SEO Page List Item Schema (without content for performance)
|
|
33
|
+
*/
|
|
34
|
+
exports.PageListItemSchema = zod_1.z.object({
|
|
35
|
+
uuid: zod_1.z.string().regex(shared_1.UUID_REGEX),
|
|
36
|
+
metaTitle: zod_1.z.string(),
|
|
37
|
+
metaDescription: zod_1.z.string(),
|
|
38
|
+
title: zod_1.z.string(),
|
|
39
|
+
description: zod_1.z.string(),
|
|
40
|
+
alias: zod_1.z.string(),
|
|
41
|
+
type: zod_1.z.enum(page_type_enum_1.PageType),
|
|
42
|
+
icon: zod_1.z.string(),
|
|
43
|
+
// Hierarchy & additional fields
|
|
44
|
+
parentId: zod_1.z.string().regex(shared_1.UUID_REGEX).nullable(),
|
|
45
|
+
order: zod_1.z.number(),
|
|
46
|
+
placeholder: zod_1.z.string().nullable(),
|
|
47
|
+
seoName: zod_1.z.string().nullable(),
|
|
48
|
+
marks: zod_1.z.array(zod_1.z.string()),
|
|
49
|
+
createdAt: zod_1.z.string().regex(shared_1.DATETIME_REGEX),
|
|
50
|
+
updatedAt: zod_1.z.string().regex(shared_1.DATETIME_REGEX),
|
|
23
51
|
});
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* SEO Page Type
|
|
3
|
+
* - INDEX: Main site page (singleton)
|
|
4
|
+
* - MAIN: Top-level pages
|
|
5
|
+
* - SUB: Child pages (linked to MAIN via parentId)
|
|
3
6
|
*/
|
|
4
7
|
export declare enum PageType {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
INDEX = "index",
|
|
9
|
+
MAIN = "main",
|
|
10
|
+
SUB = "sub"
|
|
8
11
|
}
|
|
@@ -3,10 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PageType = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* SEO Page Type
|
|
6
|
+
* - INDEX: Main site page (singleton)
|
|
7
|
+
* - MAIN: Top-level pages
|
|
8
|
+
* - SUB: Child pages (linked to MAIN via parentId)
|
|
6
9
|
*/
|
|
7
10
|
var PageType;
|
|
8
11
|
(function (PageType) {
|
|
9
|
-
PageType["
|
|
10
|
-
PageType["
|
|
11
|
-
PageType["
|
|
12
|
+
PageType["INDEX"] = "index";
|
|
13
|
+
PageType["MAIN"] = "main";
|
|
14
|
+
PageType["SUB"] = "sub";
|
|
12
15
|
})(PageType || (exports.PageType = PageType = {}));
|
|
@@ -11,10 +11,16 @@ export declare const UpdatePageRequestSchema: z.ZodObject<{
|
|
|
11
11
|
content: z.ZodOptional<z.ZodString>;
|
|
12
12
|
alias: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
13
13
|
type: z.ZodOptional<z.ZodEnum<typeof PageType>>;
|
|
14
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
14
15
|
faq: z.ZodOptional<z.ZodObject<{
|
|
15
16
|
items: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
16
17
|
question: z.ZodString;
|
|
17
18
|
answer: z.ZodString;
|
|
18
19
|
}, z.core.$strip>>>;
|
|
19
20
|
}, z.core.$strip>>;
|
|
21
|
+
parentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
22
|
+
order: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
placeholder: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
24
|
+
seoName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
25
|
+
marks: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
20
26
|
}, z.core.$strip>;
|
|
@@ -14,7 +14,20 @@ exports.UpdatePageRequestSchema = zod_1.z.object({
|
|
|
14
14
|
title: zod_1.z.string().min(1).max(300).optional(),
|
|
15
15
|
description: zod_1.z.string().min(1).optional(),
|
|
16
16
|
content: zod_1.z.string().min(1).optional(),
|
|
17
|
-
alias: zod_1.z
|
|
18
|
-
|
|
17
|
+
alias: zod_1.z
|
|
18
|
+
.string()
|
|
19
|
+
.min(1)
|
|
20
|
+
.max(200)
|
|
21
|
+
.regex(shared_1.SLUG_REGEX)
|
|
22
|
+
.transform((val) => val.toLowerCase().trim())
|
|
23
|
+
.optional(),
|
|
24
|
+
type: zod_1.z.enum(page_type_enum_1.PageType).optional(),
|
|
25
|
+
icon: zod_1.z.string().min(1).max(100).optional(),
|
|
19
26
|
faq: faq_schema_1.FaqSchema.optional(),
|
|
27
|
+
// Hierarchy & additional fields
|
|
28
|
+
parentId: zod_1.z.string().regex(shared_1.UUID_REGEX).nullable().optional(),
|
|
29
|
+
order: zod_1.z.number().int().min(0).optional(),
|
|
30
|
+
placeholder: zod_1.z.string().max(500).nullable().optional(),
|
|
31
|
+
seoName: zod_1.z.string().max(200).nullable().optional(),
|
|
32
|
+
marks: zod_1.z.array(zod_1.z.string().max(50)).optional(),
|
|
20
33
|
});
|
|
@@ -7,6 +7,13 @@ export declare enum SeoPageErrorCode {
|
|
|
7
7
|
PAGE_UPDATE_FAILED = "PAGE_UPDATE_FAILED",
|
|
8
8
|
PAGE_DELETE_FAILED = "PAGE_DELETE_FAILED",
|
|
9
9
|
INVALID_ALIAS_FORMAT = "INVALID_ALIAS_FORMAT",
|
|
10
|
-
INVALID_FAQ_FORMAT = "INVALID_FAQ_FORMAT"
|
|
10
|
+
INVALID_FAQ_FORMAT = "INVALID_FAQ_FORMAT",
|
|
11
|
+
INDEX_PAGE_ALREADY_EXISTS = "INDEX_PAGE_ALREADY_EXISTS",
|
|
12
|
+
PARENT_PAGE_NOT_FOUND = "PARENT_PAGE_NOT_FOUND",
|
|
13
|
+
PARENT_MUST_BE_MAIN_TYPE = "PARENT_MUST_BE_MAIN_TYPE",
|
|
14
|
+
SUB_PAGE_REQUIRES_PARENT = "SUB_PAGE_REQUIRES_PARENT",
|
|
15
|
+
INDEX_PAGE_CANNOT_HAVE_PARENT = "INDEX_PAGE_CANNOT_HAVE_PARENT",
|
|
16
|
+
MAIN_PAGE_CANNOT_HAVE_PARENT = "MAIN_PAGE_CANNOT_HAVE_PARENT",
|
|
17
|
+
CANNOT_DELETE_PAGE_WITH_CHILDREN = "CANNOT_DELETE_PAGE_WITH_CHILDREN"
|
|
11
18
|
}
|
|
12
19
|
export declare const SEO_PAGE_ERRORS: Record<SeoPageErrorCode, ErrorMetadata>;
|
|
@@ -11,6 +11,14 @@ var SeoPageErrorCode;
|
|
|
11
11
|
SeoPageErrorCode["PAGE_DELETE_FAILED"] = "PAGE_DELETE_FAILED";
|
|
12
12
|
SeoPageErrorCode["INVALID_ALIAS_FORMAT"] = "INVALID_ALIAS_FORMAT";
|
|
13
13
|
SeoPageErrorCode["INVALID_FAQ_FORMAT"] = "INVALID_FAQ_FORMAT";
|
|
14
|
+
// Hierarchy validation
|
|
15
|
+
SeoPageErrorCode["INDEX_PAGE_ALREADY_EXISTS"] = "INDEX_PAGE_ALREADY_EXISTS";
|
|
16
|
+
SeoPageErrorCode["PARENT_PAGE_NOT_FOUND"] = "PARENT_PAGE_NOT_FOUND";
|
|
17
|
+
SeoPageErrorCode["PARENT_MUST_BE_MAIN_TYPE"] = "PARENT_MUST_BE_MAIN_TYPE";
|
|
18
|
+
SeoPageErrorCode["SUB_PAGE_REQUIRES_PARENT"] = "SUB_PAGE_REQUIRES_PARENT";
|
|
19
|
+
SeoPageErrorCode["INDEX_PAGE_CANNOT_HAVE_PARENT"] = "INDEX_PAGE_CANNOT_HAVE_PARENT";
|
|
20
|
+
SeoPageErrorCode["MAIN_PAGE_CANNOT_HAVE_PARENT"] = "MAIN_PAGE_CANNOT_HAVE_PARENT";
|
|
21
|
+
SeoPageErrorCode["CANNOT_DELETE_PAGE_WITH_CHILDREN"] = "CANNOT_DELETE_PAGE_WITH_CHILDREN";
|
|
14
22
|
})(SeoPageErrorCode || (exports.SeoPageErrorCode = SeoPageErrorCode = {}));
|
|
15
23
|
exports.SEO_PAGE_ERRORS = {
|
|
16
24
|
[SeoPageErrorCode.PAGE_NOT_FOUND]: {
|
|
@@ -45,4 +53,33 @@ exports.SEO_PAGE_ERRORS = {
|
|
|
45
53
|
code: SeoPageErrorCode.INVALID_FAQ_FORMAT,
|
|
46
54
|
statusCode: 400,
|
|
47
55
|
},
|
|
56
|
+
// Hierarchy validation
|
|
57
|
+
[SeoPageErrorCode.INDEX_PAGE_ALREADY_EXISTS]: {
|
|
58
|
+
code: SeoPageErrorCode.INDEX_PAGE_ALREADY_EXISTS,
|
|
59
|
+
statusCode: 409,
|
|
60
|
+
},
|
|
61
|
+
[SeoPageErrorCode.PARENT_PAGE_NOT_FOUND]: {
|
|
62
|
+
code: SeoPageErrorCode.PARENT_PAGE_NOT_FOUND,
|
|
63
|
+
statusCode: 404,
|
|
64
|
+
},
|
|
65
|
+
[SeoPageErrorCode.PARENT_MUST_BE_MAIN_TYPE]: {
|
|
66
|
+
code: SeoPageErrorCode.PARENT_MUST_BE_MAIN_TYPE,
|
|
67
|
+
statusCode: 400,
|
|
68
|
+
},
|
|
69
|
+
[SeoPageErrorCode.SUB_PAGE_REQUIRES_PARENT]: {
|
|
70
|
+
code: SeoPageErrorCode.SUB_PAGE_REQUIRES_PARENT,
|
|
71
|
+
statusCode: 400,
|
|
72
|
+
},
|
|
73
|
+
[SeoPageErrorCode.INDEX_PAGE_CANNOT_HAVE_PARENT]: {
|
|
74
|
+
code: SeoPageErrorCode.INDEX_PAGE_CANNOT_HAVE_PARENT,
|
|
75
|
+
statusCode: 400,
|
|
76
|
+
},
|
|
77
|
+
[SeoPageErrorCode.MAIN_PAGE_CANNOT_HAVE_PARENT]: {
|
|
78
|
+
code: SeoPageErrorCode.MAIN_PAGE_CANNOT_HAVE_PARENT,
|
|
79
|
+
statusCode: 400,
|
|
80
|
+
},
|
|
81
|
+
[SeoPageErrorCode.CANNOT_DELETE_PAGE_WITH_CHILDREN]: {
|
|
82
|
+
code: SeoPageErrorCode.CANNOT_DELETE_PAGE_WITH_CHILDREN,
|
|
83
|
+
statusCode: 409,
|
|
84
|
+
},
|
|
48
85
|
};
|