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