@veruna/api-contracts 1.0.17 → 1.0.19
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/controllers/ai-provider.controllers.d.ts +5 -0
- package/build/controllers/ai-provider.controllers.js +8 -0
- package/build/controllers/file.controllers.d.ts +5 -0
- package/build/controllers/file.controllers.js +8 -0
- package/build/controllers/index.d.ts +2 -0
- package/build/controllers/index.js +6 -1
- package/build/rest-api.d.ts +23 -0
- package/build/rest-api.js +28 -0
- package/build/routes/ai-provider-admin.routes.d.ts +11 -0
- package/build/routes/ai-provider-admin.routes.js +14 -0
- package/build/routes/ai-provider-public.routes.d.ts +7 -0
- package/build/routes/ai-provider-public.routes.js +10 -0
- package/build/routes/file.routes.d.ts +14 -0
- package/build/routes/file.routes.js +20 -0
- package/build/routes/index.d.ts +3 -0
- package/build/routes/index.js +7 -1
- package/build/routes/seo-pages-public.routes.d.ts +2 -0
- package/build/routes/seo-pages-public.routes.js +2 -0
- package/build/v1/ai-provider/admin/commands/create-provider.command.d.ts +23 -0
- package/build/v1/ai-provider/admin/commands/create-provider.command.js +13 -0
- package/build/v1/ai-provider/admin/commands/delete-provider.command.d.ts +14 -0
- package/build/v1/ai-provider/admin/commands/delete-provider.command.js +17 -0
- package/build/v1/ai-provider/admin/commands/index.d.ts +3 -0
- package/build/v1/ai-provider/admin/commands/index.js +19 -0
- package/build/v1/ai-provider/admin/commands/update-provider.command.d.ts +27 -0
- package/build/v1/ai-provider/admin/commands/update-provider.command.js +14 -0
- package/build/v1/ai-provider/admin/queries/get-provider.query.d.ts +20 -0
- package/build/v1/ai-provider/admin/queries/get-provider.query.js +13 -0
- package/build/v1/ai-provider/admin/queries/get-providers.query.d.ts +31 -0
- package/build/v1/ai-provider/admin/queries/get-providers.query.js +14 -0
- package/build/v1/ai-provider/admin/queries/index.d.ts +2 -0
- package/build/v1/ai-provider/admin/queries/index.js +18 -0
- package/build/v1/ai-provider/ai-provider.errors.d.ts +7 -0
- package/build/v1/ai-provider/ai-provider.errors.js +23 -0
- package/build/v1/ai-provider/index.d.ts +5 -0
- package/build/v1/ai-provider/index.js +21 -0
- package/build/v1/ai-provider/public/queries/get-active-providers.query.d.ts +18 -0
- package/build/v1/ai-provider/public/queries/get-active-providers.query.js +16 -0
- package/build/v1/ai-provider/public/queries/index.d.ts +1 -0
- package/build/v1/ai-provider/public/queries/index.js +17 -0
- package/build/v1/ai-provider/schemas/ai-provider-status.enum.d.ts +7 -0
- package/build/v1/ai-provider/schemas/ai-provider-status.enum.js +11 -0
- package/build/v1/ai-provider/schemas/create-provider-request.schema.d.ts +9 -0
- package/build/v1/ai-provider/schemas/create-provider-request.schema.js +16 -0
- package/build/v1/ai-provider/schemas/index.d.ts +5 -0
- package/build/v1/ai-provider/schemas/index.js +21 -0
- package/build/v1/ai-provider/schemas/provider-response.schema.d.ts +15 -0
- package/build/v1/ai-provider/schemas/provider-response.schema.js +18 -0
- package/build/v1/ai-provider/schemas/route-params.schema.d.ts +4 -0
- package/build/v1/ai-provider/schemas/route-params.schema.js +8 -0
- package/build/v1/ai-provider/schemas/update-provider-request.schema.d.ts +9 -0
- package/build/v1/ai-provider/schemas/update-provider-request.schema.js +17 -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/file/commands/delete-file-by-key.command.d.ts +15 -0
- package/build/v1/file/commands/delete-file-by-key.command.js +15 -0
- package/build/v1/file/commands/delete-file.command.d.ts +15 -0
- package/build/v1/file/commands/delete-file.command.js +18 -0
- package/build/v1/file/commands/index.d.ts +4 -0
- package/build/v1/file/commands/index.js +20 -0
- package/build/v1/file/commands/upload-file.command.d.ts +16 -0
- package/build/v1/file/commands/upload-file.command.js +15 -0
- package/build/v1/file/commands/upload-image.command.d.ts +19 -0
- package/build/v1/file/commands/upload-image.command.js +15 -0
- package/build/v1/file/file.errors.d.ts +15 -0
- package/build/v1/file/file.errors.js +73 -0
- package/build/v1/file/index.d.ts +6 -0
- package/build/v1/file/index.js +26 -0
- package/build/v1/file/queries/get-file.query.d.ts +33 -0
- package/build/v1/file/queries/get-file.query.js +18 -0
- package/build/v1/file/queries/index.d.ts +3 -0
- package/build/v1/file/queries/index.js +19 -0
- package/build/v1/file/queries/list-files.query.d.ts +38 -0
- package/build/v1/file/queries/list-files.query.js +15 -0
- package/build/v1/file/queries/list-folders.query.d.ts +17 -0
- package/build/v1/file/queries/list-folders.query.js +15 -0
- package/build/v1/file/schemas/delete-file-by-key-request.schema.d.ts +7 -0
- package/build/v1/file/schemas/delete-file-by-key-request.schema.js +10 -0
- package/build/v1/file/schemas/delete-file-response.schema.d.ts +15 -0
- package/build/v1/file/schemas/delete-file-response.schema.js +18 -0
- package/build/v1/file/schemas/file-category.enum.d.ts +9 -0
- package/build/v1/file/schemas/file-category.enum.js +13 -0
- package/build/v1/file/schemas/file-response.schema.d.ts +18 -0
- package/build/v1/file/schemas/file-response.schema.js +21 -0
- package/build/v1/file/schemas/file-status.enum.d.ts +10 -0
- package/build/v1/file/schemas/file-status.enum.js +14 -0
- package/build/v1/file/schemas/file-variant-response.schema.d.ts +13 -0
- package/build/v1/file/schemas/file-variant-response.schema.js +16 -0
- package/build/v1/file/schemas/file-with-variants-response.schema.d.ts +26 -0
- package/build/v1/file/schemas/file-with-variants-response.schema.js +13 -0
- package/build/v1/file/schemas/folder-response.schema.d.ts +17 -0
- package/build/v1/file/schemas/folder-response.schema.js +17 -0
- package/build/v1/file/schemas/image-format.enum.d.ts +7 -0
- package/build/v1/file/schemas/image-format.enum.js +11 -0
- package/build/v1/file/schemas/index.d.ts +16 -0
- package/build/v1/file/schemas/index.js +37 -0
- package/build/v1/file/schemas/list-files-request.schema.d.ts +14 -0
- package/build/v1/file/schemas/list-files-request.schema.js +17 -0
- package/build/v1/file/schemas/list-files-response.schema.d.ts +26 -0
- package/build/v1/file/schemas/list-files-response.schema.js +13 -0
- package/build/v1/file/schemas/list-folders-request.schema.d.ts +7 -0
- package/build/v1/file/schemas/list-folders-request.schema.js +10 -0
- package/build/v1/file/schemas/upload-file-request.schema.d.ts +7 -0
- package/build/v1/file/schemas/upload-file-request.schema.js +10 -0
- package/build/v1/file/schemas/upload-file-response.schema.d.ts +9 -0
- package/build/v1/file/schemas/upload-file-response.schema.js +12 -0
- package/build/v1/file/schemas/upload-image-request.schema.d.ts +18 -0
- package/build/v1/file/schemas/upload-image-request.schema.js +28 -0
- package/build/v1/file/schemas/upload-image-response.schema.d.ts +10 -0
- package/build/v1/file/schemas/upload-image-response.schema.js +19 -0
- package/build/v1/index.d.ts +1 -0
- package/build/v1/index.js +1 -0
- 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
|
@@ -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
|
};
|