@veruna/api-contracts 1.0.3 → 1.0.7
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/index.d.ts +4 -3
- package/build/index.js +4 -3
- package/build/locales/en.d.ts +31 -0
- package/build/locales/en.js +38 -0
- package/build/locales/index.d.ts +66 -0
- package/build/locales/index.js +22 -0
- package/build/locales/ru.d.ts +30 -0
- package/build/locales/ru.js +38 -0
- package/build/rest-api.d.ts +52 -0
- package/build/rest-api.js +67 -0
- package/build/shared/common-schemas.d.ts +12 -0
- package/build/shared/common-schemas.js +15 -0
- package/build/shared/error-response.schema.d.ts +25 -0
- package/build/shared/error-response.schema.js +22 -0
- package/build/shared/index.d.ts +2 -0
- package/build/shared/index.js +18 -0
- package/build/shared/pagination.schema.d.ts +35 -0
- package/build/shared/pagination.schema.js +30 -0
- package/build/shared/regex.d.ts +8 -0
- package/build/shared/regex.js +16 -0
- package/build/utils/index.d.ts +1 -0
- package/build/utils/index.js +17 -0
- package/build/utils/path-builder.d.ts +20 -0
- package/build/utils/path-builder.js +46 -0
- package/build/v1/auth/auth.types.d.ts +2 -1
- package/build/v1/auth/auth.types.js +4 -1
- package/build/v1/auth/commands/delete-session.command.d.ts +11 -0
- package/build/v1/auth/commands/delete-session.command.js +18 -0
- package/build/v1/auth/commands/index.d.ts +2 -0
- package/build/v1/auth/commands/index.js +2 -0
- package/build/v1/auth/commands/login.command.d.ts +3 -5
- package/build/v1/auth/commands/login.command.js +10 -7
- package/build/v1/auth/commands/logout-all.command.d.ts +11 -0
- package/build/v1/auth/commands/logout-all.command.js +18 -0
- package/build/v1/auth/commands/logout.command.d.ts +2 -4
- package/build/v1/auth/commands/logout.command.js +9 -5
- package/build/v1/auth/commands/signup.command.d.ts +3 -5
- package/build/v1/auth/commands/signup.command.js +10 -7
- package/build/v1/auth/controllers.d.ts +4 -0
- package/build/v1/auth/controllers.js +7 -0
- package/build/v1/auth/index.d.ts +4 -1
- package/build/v1/auth/index.js +4 -1
- package/build/v1/auth/queries/get-sessions.query.d.ts +20 -0
- package/build/v1/auth/queries/get-sessions.query.js +18 -0
- package/build/v1/auth/queries/index.d.ts +1 -0
- package/build/v1/auth/queries/index.js +17 -0
- package/build/v1/auth/routes/auth.routes.d.ts +12 -0
- package/build/v1/auth/routes/auth.routes.js +15 -0
- package/build/v1/auth/schemas/auth-response.schema.d.ts +36 -0
- package/build/v1/auth/schemas/auth-response.schema.js +20 -0
- package/build/v1/auth/schemas/index.d.ts +5 -0
- package/build/v1/auth/schemas/index.js +21 -0
- package/build/v1/auth/schemas/login-request.schema.d.ts +9 -0
- package/build/v1/auth/schemas/login-request.schema.js +13 -0
- package/build/v1/auth/schemas/session-response.schema.d.ts +13 -0
- package/build/v1/auth/schemas/session-response.schema.js +17 -0
- package/build/v1/auth/schemas/signup-request.schema.d.ts +28 -0
- package/build/v1/auth/schemas/signup-request.schema.js +26 -0
- package/build/v1/auth/schemas/user-role.enum.d.ts +7 -0
- package/build/v1/auth/schemas/user-role.enum.js +11 -0
- package/build/v1/blog/admin/commands/create-category.command.d.ts +24 -0
- package/build/v1/blog/admin/commands/create-category.command.js +15 -0
- package/build/v1/blog/admin/commands/create-post.command.d.ts +43 -0
- package/build/v1/blog/admin/commands/create-post.command.js +15 -0
- package/build/v1/blog/admin/commands/delete-category.command.d.ts +11 -0
- package/build/v1/blog/admin/commands/delete-category.command.js +16 -0
- package/build/v1/blog/admin/commands/delete-post.command.d.ts +11 -0
- package/build/v1/blog/admin/commands/delete-post.command.js +16 -0
- package/build/v1/blog/admin/commands/index.d.ts +6 -0
- package/build/v1/blog/admin/commands/index.js +22 -0
- package/build/v1/blog/admin/commands/update-category.command.d.ts +24 -0
- package/build/v1/blog/admin/commands/update-category.command.js +15 -0
- package/build/v1/blog/admin/commands/update-post.command.d.ts +43 -0
- package/build/v1/blog/admin/commands/update-post.command.js +15 -0
- package/build/v1/blog/admin/queries/get-categories.query.d.ts +24 -0
- package/build/v1/blog/admin/queries/get-categories.query.js +22 -0
- package/build/v1/blog/admin/queries/get-category.query.d.ts +19 -0
- package/build/v1/blog/admin/queries/get-category.query.js +16 -0
- package/build/v1/blog/admin/queries/get-post.query.d.ts +33 -0
- package/build/v1/blog/admin/queries/get-post.query.js +16 -0
- package/build/v1/blog/admin/queries/get-posts.query.d.ts +48 -0
- package/build/v1/blog/admin/queries/get-posts.query.js +21 -0
- package/build/v1/blog/admin/queries/index.d.ts +4 -0
- package/build/v1/blog/admin/queries/index.js +20 -0
- package/build/v1/blog/blog.paths.d.ts +36 -0
- package/build/v1/blog/blog.paths.js +47 -0
- package/build/v1/blog/blog.types.d.ts +12 -0
- package/build/v1/blog/blog.types.js +7 -0
- package/build/v1/blog/controllers.d.ts +7 -0
- package/build/v1/blog/controllers.js +10 -0
- package/build/v1/blog/index.d.ts +8 -0
- package/build/v1/blog/index.js +24 -0
- package/build/v1/blog/public/queries/get-categories.query.d.ts +21 -0
- package/build/v1/blog/public/queries/get-categories.query.js +19 -0
- package/build/v1/blog/public/queries/get-post-by-alias.query.d.ts +33 -0
- package/build/v1/blog/public/queries/get-post-by-alias.query.js +16 -0
- package/build/v1/blog/public/queries/get-posts.query.d.ts +47 -0
- package/build/v1/blog/public/queries/get-posts.query.js +21 -0
- package/build/v1/blog/public/queries/index.d.ts +3 -0
- package/build/v1/blog/public/queries/index.js +19 -0
- package/build/v1/blog/routes/blog-admin-categories.routes.d.ts +11 -0
- package/build/v1/blog/routes/blog-admin-categories.routes.js +14 -0
- package/build/v1/blog/routes/blog-admin-posts.routes.d.ts +10 -0
- package/build/v1/blog/routes/blog-admin-posts.routes.js +13 -0
- package/build/v1/blog/routes/blog-public.routes.d.ts +10 -0
- package/build/v1/blog/routes/blog-public.routes.js +13 -0
- package/build/v1/blog/routes/index.d.ts +3 -0
- package/build/v1/blog/routes/index.js +19 -0
- package/build/v1/blog/schemas/blog-category-status.enum.d.ts +8 -0
- package/build/v1/blog/schemas/blog-category-status.enum.js +12 -0
- package/build/v1/blog/schemas/blog-post-status.enum.d.ts +8 -0
- package/build/v1/blog/schemas/blog-post-status.enum.js +12 -0
- package/build/v1/blog/schemas/category-response.schema.d.ts +14 -0
- package/build/v1/blog/schemas/category-response.schema.js +18 -0
- package/build/v1/blog/schemas/create-category-request.schema.d.ts +8 -0
- package/build/v1/blog/schemas/create-category-request.schema.js +12 -0
- package/build/v1/blog/schemas/create-post-request.schema.d.ts +13 -0
- package/build/v1/blog/schemas/create-post-request.schema.js +17 -0
- package/build/v1/blog/schemas/get-posts-query.schema.d.ts +13 -0
- package/build/v1/blog/schemas/get-posts-query.schema.js +13 -0
- package/build/v1/blog/schemas/index.d.ts +9 -0
- package/build/v1/blog/schemas/index.js +25 -0
- package/build/v1/blog/schemas/post-response.schema.d.ts +28 -0
- package/build/v1/blog/schemas/post-response.schema.js +25 -0
- package/build/v1/blog/schemas/update-category-request.schema.d.ts +8 -0
- package/build/v1/blog/schemas/update-category-request.schema.js +12 -0
- package/build/v1/blog/schemas/update-post-request.schema.d.ts +13 -0
- package/build/v1/blog/schemas/update-post-request.schema.js +17 -0
- package/build/v1/unregistered-users/commands/authenticate.command.d.ts +18 -0
- package/build/v1/unregistered-users/commands/authenticate.command.js +15 -0
- package/build/v1/unregistered-users/commands/index.d.ts +1 -0
- package/build/v1/unregistered-users/commands/index.js +17 -0
- package/build/v1/unregistered-users/controllers.d.ts +4 -0
- package/build/v1/unregistered-users/controllers.js +7 -0
- package/build/v1/unregistered-users/index.d.ts +2 -1
- package/build/v1/unregistered-users/index.js +2 -1
- package/build/v1/unregistered-users/routes/unreg-users.routes.d.ts +6 -0
- package/build/v1/unregistered-users/routes/unreg-users.routes.js +9 -0
- package/build/v1/unregistered-users/schemas/authenticate-request.schema.d.ts +7 -0
- package/build/v1/unregistered-users/schemas/authenticate-request.schema.js +10 -0
- package/build/v1/unregistered-users/schemas/authenticate-response.schema.d.ts +11 -0
- package/build/v1/unregistered-users/schemas/authenticate-response.schema.js +15 -0
- package/build/v1/unregistered-users/schemas/index.d.ts +3 -0
- package/build/v1/unregistered-users/schemas/index.js +19 -0
- package/build/v1/unregistered-users/schemas/unreg-user-status.enum.d.ts +8 -0
- package/build/v1/unregistered-users/schemas/unreg-user-status.enum.js +12 -0
- package/build/v1/unregistered-users/unregistered-users.types.d.ts +3 -1
- package/build/v1/unregistered-users/unregistered-users.types.js +6 -0
- package/build/v1/users/commands/change-password.command.d.ts +2 -4
- package/build/v1/users/commands/change-password.command.js +8 -5
- package/build/v1/users/commands/delete-account.command.d.ts +11 -0
- package/build/v1/users/commands/delete-account.command.js +16 -0
- package/build/v1/users/commands/index.d.ts +2 -0
- package/build/v1/users/commands/index.js +2 -0
- package/build/v1/users/commands/toggle-marketing-consent.command.d.ts +13 -0
- package/build/v1/users/commands/toggle-marketing-consent.command.js +16 -0
- package/build/v1/users/commands/update-profile.command.d.ts +2 -4
- package/build/v1/users/commands/update-profile.command.js +8 -5
- package/build/v1/users/controllers.d.ts +4 -0
- package/build/v1/users/controllers.js +7 -0
- package/build/v1/users/index.d.ts +3 -1
- package/build/v1/users/index.js +3 -1
- package/build/v1/users/queries/get-current-user.query.d.ts +3 -5
- package/build/v1/users/queries/get-current-user.query.js +7 -5
- package/build/v1/users/routes/users.routes.d.ts +9 -0
- package/build/v1/users/routes/users.routes.js +12 -0
- package/build/v1/users/schemas/change-password-request.schema.d.ts +10 -0
- package/build/v1/users/schemas/change-password-request.schema.js +14 -0
- package/build/v1/users/schemas/delete-account-request.schema.d.ts +5 -0
- package/build/v1/users/schemas/delete-account-request.schema.js +8 -0
- package/build/v1/users/schemas/index.d.ts +6 -0
- package/build/v1/users/schemas/index.js +22 -0
- package/build/v1/users/{users.schemas.d.ts → schemas/response-unions.schema.d.ts} +0 -42
- package/build/v1/users/schemas/response-unions.schema.js +14 -0
- package/build/v1/users/schemas/toggle-marketing-consent-request.schema.d.ts +7 -0
- package/build/v1/users/schemas/toggle-marketing-consent-request.schema.js +10 -0
- package/build/v1/users/schemas/update-profile-request.schema.d.ts +8 -0
- package/build/v1/users/schemas/update-profile-request.schema.js +11 -0
- package/build/v1/users/schemas/user-response.schema.d.ts +12 -0
- package/build/v1/users/schemas/user-response.schema.js +16 -0
- package/build/v1/users/users.types.d.ts +2 -4
- package/package.json +1 -1
- package/build/v1/auth/auth.schemas.d.ts +0 -87
- package/build/v1/auth/auth.schemas.js +0 -69
- package/build/v1/unregistered-users/unregistered-users.schemas.d.ts +0 -24
- package/build/v1/unregistered-users/unregistered-users.schemas.js +0 -28
- package/build/v1/users/users.schemas.js +0 -58
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Blog Controller paths for NestJS @Controller decorator
|
|
3
|
+
*/
|
|
4
|
+
export declare const BLOG_ADMIN_CATEGORIES_CONTROLLER: "v1/admin/blog/categories";
|
|
5
|
+
export declare const BLOG_ADMIN_POSTS_CONTROLLER: "v1/admin/blog/posts";
|
|
6
|
+
export declare const BLOG_PUBLIC_CATEGORIES_CONTROLLER: "v1/blog/categories";
|
|
7
|
+
export declare const BLOG_PUBLIC_POSTS_CONTROLLER: "v1/blog/posts";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
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 = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Blog Controller paths for NestJS @Controller decorator
|
|
6
|
+
*/
|
|
7
|
+
exports.BLOG_ADMIN_CATEGORIES_CONTROLLER = 'v1/admin/blog/categories';
|
|
8
|
+
exports.BLOG_ADMIN_POSTS_CONTROLLER = 'v1/admin/blog/posts';
|
|
9
|
+
exports.BLOG_PUBLIC_CATEGORIES_CONTROLLER = 'v1/blog/categories';
|
|
10
|
+
exports.BLOG_PUBLIC_POSTS_CONTROLLER = 'v1/blog/posts';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./schemas"), exports);
|
|
18
|
+
__exportStar(require("./blog.types"), exports);
|
|
19
|
+
__exportStar(require("./blog.paths"), exports);
|
|
20
|
+
__exportStar(require("./controllers"), exports);
|
|
21
|
+
__exportStar(require("./routes"), exports);
|
|
22
|
+
__exportStar(require("./admin/commands"), exports);
|
|
23
|
+
__exportStar(require("./admin/queries"), exports);
|
|
24
|
+
__exportStar(require("./public/queries"), exports);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { HttpMethod } from '../../../../shared/http-method';
|
|
3
|
+
export declare namespace BlogGetCategoriesQuery {
|
|
4
|
+
const Request: z.ZodObject<{}, z.core.$strip>;
|
|
5
|
+
const Response: z.ZodObject<{
|
|
6
|
+
categories: z.ZodArray<z.ZodObject<{
|
|
7
|
+
uuid: z.ZodString;
|
|
8
|
+
alias: z.ZodString;
|
|
9
|
+
title: z.ZodString;
|
|
10
|
+
order: z.ZodNumber;
|
|
11
|
+
status: z.ZodEnum<typeof import("../../schemas").BlogCategoryStatus>;
|
|
12
|
+
createdAt: z.ZodString;
|
|
13
|
+
updatedAt: z.ZodString;
|
|
14
|
+
}, z.core.$strip>>;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
const PATH: "";
|
|
17
|
+
const URL: "/api/v1/blog/categories/";
|
|
18
|
+
const METHOD = HttpMethod.GET;
|
|
19
|
+
type RequestType = z.infer<typeof Request>;
|
|
20
|
+
type ResponseType = z.infer<typeof Response>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BlogGetCategoriesQuery = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const schemas_1 = require("../../schemas");
|
|
6
|
+
const blog_public_routes_1 = require("../../routes/blog-public.routes");
|
|
7
|
+
const rest_api_1 = require("../../../../rest-api");
|
|
8
|
+
const http_method_1 = require("../../../../shared/http-method");
|
|
9
|
+
const CategoriesListPublicResponseSchema = zod_1.z.object({
|
|
10
|
+
categories: zod_1.z.array(schemas_1.CategoryResponseSchema),
|
|
11
|
+
});
|
|
12
|
+
var BlogGetCategoriesQuery;
|
|
13
|
+
(function (BlogGetCategoriesQuery) {
|
|
14
|
+
BlogGetCategoriesQuery.Request = zod_1.z.object({});
|
|
15
|
+
BlogGetCategoriesQuery.Response = CategoriesListPublicResponseSchema;
|
|
16
|
+
BlogGetCategoriesQuery.PATH = blog_public_routes_1.BLOG_PUBLIC_CATEGORIES_ROUTES.GET_ALL;
|
|
17
|
+
BlogGetCategoriesQuery.URL = rest_api_1.REST_API.V1.BLOG.PUBLIC.CATEGORIES.GET_ALL;
|
|
18
|
+
BlogGetCategoriesQuery.METHOD = http_method_1.HttpMethod.GET;
|
|
19
|
+
})(BlogGetCategoriesQuery || (exports.BlogGetCategoriesQuery = BlogGetCategoriesQuery = {}));
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { HttpMethod } from '../../../../shared/http-method';
|
|
3
|
+
export declare namespace BlogGetPostByAliasQuery {
|
|
4
|
+
const Request: z.ZodObject<{}, z.core.$strip>;
|
|
5
|
+
const Response: z.ZodObject<{
|
|
6
|
+
uuid: z.ZodString;
|
|
7
|
+
alias: z.ZodString;
|
|
8
|
+
title: z.ZodString;
|
|
9
|
+
metaTitle: z.ZodString;
|
|
10
|
+
metaDescription: z.ZodString;
|
|
11
|
+
content: z.ZodString;
|
|
12
|
+
image: z.ZodString;
|
|
13
|
+
author: z.ZodString;
|
|
14
|
+
categories: z.ZodArray<z.ZodObject<{
|
|
15
|
+
uuid: z.ZodString;
|
|
16
|
+
alias: z.ZodString;
|
|
17
|
+
title: z.ZodString;
|
|
18
|
+
order: z.ZodNumber;
|
|
19
|
+
status: z.ZodEnum<typeof import("../../schemas").BlogCategoryStatus>;
|
|
20
|
+
createdAt: z.ZodString;
|
|
21
|
+
updatedAt: z.ZodString;
|
|
22
|
+
}, z.core.$strip>>;
|
|
23
|
+
viewsCount: z.ZodNumber;
|
|
24
|
+
status: z.ZodEnum<typeof import("../../schemas").BlogPostStatus>;
|
|
25
|
+
createdAt: z.ZodString;
|
|
26
|
+
updatedAt: z.ZodString;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
const PATH: ":alias";
|
|
29
|
+
const URL: (alias: string) => string;
|
|
30
|
+
const METHOD = HttpMethod.GET;
|
|
31
|
+
type RequestType = z.infer<typeof Request>;
|
|
32
|
+
type ResponseType = z.infer<typeof Response>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BlogGetPostByAliasQuery = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const schemas_1 = require("../../schemas");
|
|
6
|
+
const blog_public_routes_1 = require("../../routes/blog-public.routes");
|
|
7
|
+
const rest_api_1 = require("../../../../rest-api");
|
|
8
|
+
const http_method_1 = require("../../../../shared/http-method");
|
|
9
|
+
var BlogGetPostByAliasQuery;
|
|
10
|
+
(function (BlogGetPostByAliasQuery) {
|
|
11
|
+
BlogGetPostByAliasQuery.Request = zod_1.z.object({});
|
|
12
|
+
BlogGetPostByAliasQuery.Response = schemas_1.PostResponseSchema;
|
|
13
|
+
BlogGetPostByAliasQuery.PATH = blog_public_routes_1.BLOG_PUBLIC_POSTS_ROUTES.GET_BY_ALIAS;
|
|
14
|
+
BlogGetPostByAliasQuery.URL = (alias) => rest_api_1.REST_API.V1.BLOG.PUBLIC.POSTS.GET_BY_ALIAS(alias);
|
|
15
|
+
BlogGetPostByAliasQuery.METHOD = http_method_1.HttpMethod.GET;
|
|
16
|
+
})(BlogGetPostByAliasQuery || (exports.BlogGetPostByAliasQuery = BlogGetPostByAliasQuery = {}));
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { HttpMethod } from '../../../../shared/http-method';
|
|
3
|
+
export declare namespace BlogGetPostsQuery {
|
|
4
|
+
const Request: z.ZodObject<{
|
|
5
|
+
page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
6
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
7
|
+
categoryAliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
const Response: z.ZodObject<{
|
|
10
|
+
data: z.ZodArray<z.ZodObject<{
|
|
11
|
+
uuid: z.ZodString;
|
|
12
|
+
alias: z.ZodString;
|
|
13
|
+
title: z.ZodString;
|
|
14
|
+
metaTitle: z.ZodString;
|
|
15
|
+
metaDescription: z.ZodString;
|
|
16
|
+
content: z.ZodString;
|
|
17
|
+
image: z.ZodString;
|
|
18
|
+
author: z.ZodString;
|
|
19
|
+
categories: z.ZodArray<z.ZodObject<{
|
|
20
|
+
uuid: z.ZodString;
|
|
21
|
+
alias: z.ZodString;
|
|
22
|
+
title: z.ZodString;
|
|
23
|
+
order: z.ZodNumber;
|
|
24
|
+
status: z.ZodEnum<typeof import("../../schemas").BlogCategoryStatus>;
|
|
25
|
+
createdAt: z.ZodString;
|
|
26
|
+
updatedAt: z.ZodString;
|
|
27
|
+
}, z.core.$strip>>;
|
|
28
|
+
viewsCount: z.ZodNumber;
|
|
29
|
+
status: z.ZodEnum<typeof import("../../schemas").BlogPostStatus>;
|
|
30
|
+
createdAt: z.ZodString;
|
|
31
|
+
updatedAt: z.ZodString;
|
|
32
|
+
}, z.core.$strip>>;
|
|
33
|
+
meta: z.ZodObject<{
|
|
34
|
+
page: z.ZodNumber;
|
|
35
|
+
limit: z.ZodNumber;
|
|
36
|
+
total: z.ZodNumber;
|
|
37
|
+
totalPages: z.ZodNumber;
|
|
38
|
+
hasNext: z.ZodBoolean;
|
|
39
|
+
hasPrev: z.ZodBoolean;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
const PATH: "";
|
|
43
|
+
const URL: "/api/v1/blog/posts/";
|
|
44
|
+
const METHOD = HttpMethod.GET;
|
|
45
|
+
type RequestType = z.infer<typeof Request>;
|
|
46
|
+
type ResponseType = z.infer<typeof Response>;
|
|
47
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BlogGetPostsQuery = 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 blog_public_routes_1 = require("../../routes/blog-public.routes");
|
|
8
|
+
const rest_api_1 = require("../../../../rest-api");
|
|
9
|
+
const http_method_1 = require("../../../../shared/http-method");
|
|
10
|
+
const PostsListResponseSchema = zod_1.z.object({
|
|
11
|
+
data: zod_1.z.array(schemas_1.PostResponseSchema),
|
|
12
|
+
meta: pagination_schema_1.PaginationMetaSchema,
|
|
13
|
+
});
|
|
14
|
+
var BlogGetPostsQuery;
|
|
15
|
+
(function (BlogGetPostsQuery) {
|
|
16
|
+
BlogGetPostsQuery.Request = schemas_1.GetPostsQueryPublicSchema;
|
|
17
|
+
BlogGetPostsQuery.Response = PostsListResponseSchema;
|
|
18
|
+
BlogGetPostsQuery.PATH = blog_public_routes_1.BLOG_PUBLIC_POSTS_ROUTES.GET_ALL;
|
|
19
|
+
BlogGetPostsQuery.URL = rest_api_1.REST_API.V1.BLOG.PUBLIC.POSTS.GET_ALL;
|
|
20
|
+
BlogGetPostsQuery.METHOD = http_method_1.HttpMethod.GET;
|
|
21
|
+
})(BlogGetPostsQuery || (exports.BlogGetPostsQuery = BlogGetPostsQuery = {}));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./get-categories.query"), exports);
|
|
18
|
+
__exportStar(require("./get-posts.query"), exports);
|
|
19
|
+
__exportStar(require("./get-post-by-alias.query"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Blog Admin Categories Routes
|
|
3
|
+
* For NestJS method decorators (@Get, @Post, etc.)
|
|
4
|
+
*/
|
|
5
|
+
export declare const BLOG_ADMIN_CATEGORIES_ROUTES: {
|
|
6
|
+
readonly CREATE: "";
|
|
7
|
+
readonly GET_ALL: "";
|
|
8
|
+
readonly GET_BY_UUID: ":uuid";
|
|
9
|
+
readonly UPDATE: ":uuid";
|
|
10
|
+
readonly DELETE: ":uuid";
|
|
11
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BLOG_ADMIN_CATEGORIES_ROUTES = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Blog Admin Categories Routes
|
|
6
|
+
* For NestJS method decorators (@Get, @Post, etc.)
|
|
7
|
+
*/
|
|
8
|
+
exports.BLOG_ADMIN_CATEGORIES_ROUTES = {
|
|
9
|
+
CREATE: '', // POST to controller base
|
|
10
|
+
GET_ALL: '', // GET to controller base
|
|
11
|
+
GET_BY_UUID: ':uuid', // GET /categories/:uuid
|
|
12
|
+
UPDATE: ':uuid', // PATCH /categories/:uuid
|
|
13
|
+
DELETE: ':uuid', // DELETE /categories/:uuid
|
|
14
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BLOG_ADMIN_POSTS_ROUTES = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Blog Admin Posts Routes
|
|
6
|
+
*/
|
|
7
|
+
exports.BLOG_ADMIN_POSTS_ROUTES = {
|
|
8
|
+
CREATE: '',
|
|
9
|
+
GET_ALL: '',
|
|
10
|
+
GET_BY_UUID: ':uuid',
|
|
11
|
+
UPDATE: ':uuid',
|
|
12
|
+
DELETE: ':uuid',
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BLOG_PUBLIC_POSTS_ROUTES = exports.BLOG_PUBLIC_CATEGORIES_ROUTES = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Blog Public Routes
|
|
6
|
+
*/
|
|
7
|
+
exports.BLOG_PUBLIC_CATEGORIES_ROUTES = {
|
|
8
|
+
GET_ALL: '', // GET /categories
|
|
9
|
+
};
|
|
10
|
+
exports.BLOG_PUBLIC_POSTS_ROUTES = {
|
|
11
|
+
GET_ALL: '', // GET /posts
|
|
12
|
+
GET_BY_ALIAS: ':alias', // GET /posts/:alias
|
|
13
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./blog-admin-categories.routes"), exports);
|
|
18
|
+
__exportStar(require("./blog-admin-posts.routes"), exports);
|
|
19
|
+
__exportStar(require("./blog-public.routes"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BlogCategoryStatus = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Blog Category Status
|
|
6
|
+
*/
|
|
7
|
+
var BlogCategoryStatus;
|
|
8
|
+
(function (BlogCategoryStatus) {
|
|
9
|
+
BlogCategoryStatus["DRAFT"] = "draft";
|
|
10
|
+
BlogCategoryStatus["PUBLISHED"] = "published";
|
|
11
|
+
BlogCategoryStatus["ARCHIVED"] = "archived";
|
|
12
|
+
})(BlogCategoryStatus || (exports.BlogCategoryStatus = BlogCategoryStatus = {}));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BlogPostStatus = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Blog Post Status
|
|
6
|
+
*/
|
|
7
|
+
var BlogPostStatus;
|
|
8
|
+
(function (BlogPostStatus) {
|
|
9
|
+
BlogPostStatus["DRAFT"] = "draft";
|
|
10
|
+
BlogPostStatus["PUBLISHED"] = "published";
|
|
11
|
+
BlogPostStatus["ARCHIVED"] = "archived";
|
|
12
|
+
})(BlogPostStatus || (exports.BlogPostStatus = BlogPostStatus = {}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BlogCategoryStatus } from './blog-category-status.enum';
|
|
3
|
+
/**
|
|
4
|
+
* Category Response Schema
|
|
5
|
+
*/
|
|
6
|
+
export declare const CategoryResponseSchema: z.ZodObject<{
|
|
7
|
+
uuid: z.ZodString;
|
|
8
|
+
alias: z.ZodString;
|
|
9
|
+
title: z.ZodString;
|
|
10
|
+
order: z.ZodNumber;
|
|
11
|
+
status: z.ZodEnum<typeof BlogCategoryStatus>;
|
|
12
|
+
createdAt: z.ZodString;
|
|
13
|
+
updatedAt: z.ZodString;
|
|
14
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CategoryResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const regex_1 = require("../../../shared/regex");
|
|
6
|
+
const blog_category_status_enum_1 = require("./blog-category-status.enum");
|
|
7
|
+
/**
|
|
8
|
+
* Category Response Schema
|
|
9
|
+
*/
|
|
10
|
+
exports.CategoryResponseSchema = zod_1.z.object({
|
|
11
|
+
uuid: zod_1.z.string().regex(regex_1.UUID_REGEX),
|
|
12
|
+
alias: zod_1.z.string(),
|
|
13
|
+
title: zod_1.z.string(),
|
|
14
|
+
order: zod_1.z.number().int().nonnegative(),
|
|
15
|
+
status: zod_1.z.nativeEnum(blog_category_status_enum_1.BlogCategoryStatus),
|
|
16
|
+
createdAt: zod_1.z.string().regex(regex_1.DATETIME_REGEX),
|
|
17
|
+
updatedAt: zod_1.z.string().regex(regex_1.DATETIME_REGEX),
|
|
18
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BlogCategoryStatus } from './blog-category-status.enum';
|
|
3
|
+
export declare const CreateCategoryRequestSchema: z.ZodObject<{
|
|
4
|
+
alias: z.ZodString;
|
|
5
|
+
title: z.ZodString;
|
|
6
|
+
order: z.ZodDefault<z.ZodNumber>;
|
|
7
|
+
status: z.ZodDefault<z.ZodEnum<typeof BlogCategoryStatus>>;
|
|
8
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateCategoryRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const regex_1 = require("../../../shared/regex");
|
|
6
|
+
const blog_category_status_enum_1 = require("./blog-category-status.enum");
|
|
7
|
+
exports.CreateCategoryRequestSchema = zod_1.z.object({
|
|
8
|
+
alias: zod_1.z.string().min(1).max(100).regex(regex_1.SLUG_REGEX),
|
|
9
|
+
title: zod_1.z.string().min(1).max(200),
|
|
10
|
+
order: zod_1.z.number().int().nonnegative().default(0),
|
|
11
|
+
status: zod_1.z.nativeEnum(blog_category_status_enum_1.BlogCategoryStatus).default(blog_category_status_enum_1.BlogCategoryStatus.DRAFT),
|
|
12
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BlogPostStatus } from './blog-post-status.enum';
|
|
3
|
+
export declare const CreatePostRequestSchema: z.ZodObject<{
|
|
4
|
+
alias: z.ZodString;
|
|
5
|
+
title: z.ZodString;
|
|
6
|
+
metaTitle: z.ZodString;
|
|
7
|
+
metaDescription: z.ZodString;
|
|
8
|
+
content: z.ZodString;
|
|
9
|
+
image: z.ZodString;
|
|
10
|
+
author: z.ZodString;
|
|
11
|
+
categoryIds: z.ZodArray<z.ZodString>;
|
|
12
|
+
status: z.ZodDefault<z.ZodEnum<typeof BlogPostStatus>>;
|
|
13
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreatePostRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const regex_1 = require("../../../shared/regex");
|
|
6
|
+
const blog_post_status_enum_1 = require("./blog-post-status.enum");
|
|
7
|
+
exports.CreatePostRequestSchema = zod_1.z.object({
|
|
8
|
+
alias: zod_1.z.string().min(1).max(200).regex(regex_1.SLUG_REGEX),
|
|
9
|
+
title: zod_1.z.string().min(1).max(300),
|
|
10
|
+
metaTitle: zod_1.z.string().min(1).max(100),
|
|
11
|
+
metaDescription: zod_1.z.string().min(1).max(200),
|
|
12
|
+
content: zod_1.z.string().min(1),
|
|
13
|
+
image: zod_1.z.string().url(),
|
|
14
|
+
author: zod_1.z.string().min(1).max(100),
|
|
15
|
+
categoryIds: zod_1.z.array(zod_1.z.string().regex(regex_1.UUID_REGEX)).min(1),
|
|
16
|
+
status: zod_1.z.nativeEnum(blog_post_status_enum_1.BlogPostStatus).default(blog_post_status_enum_1.BlogPostStatus.DRAFT),
|
|
17
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BlogPostStatus } from './blog-post-status.enum';
|
|
3
|
+
export declare const GetPostsQueryAdminSchema: z.ZodObject<{
|
|
4
|
+
page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
5
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
6
|
+
status: z.ZodOptional<z.ZodEnum<typeof BlogPostStatus>>;
|
|
7
|
+
categoryAliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export declare const GetPostsQueryPublicSchema: z.ZodObject<{
|
|
10
|
+
page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
11
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
12
|
+
categoryAliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
13
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetPostsQueryPublicSchema = exports.GetPostsQueryAdminSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const pagination_schema_1 = require("../../../shared/pagination.schema");
|
|
6
|
+
const blog_post_status_enum_1 = require("./blog-post-status.enum");
|
|
7
|
+
exports.GetPostsQueryAdminSchema = pagination_schema_1.PaginationQuerySchema.extend({
|
|
8
|
+
status: zod_1.z.nativeEnum(blog_post_status_enum_1.BlogPostStatus).optional(),
|
|
9
|
+
categoryAliases: zod_1.z.array(zod_1.z.string()).optional(),
|
|
10
|
+
});
|
|
11
|
+
exports.GetPostsQueryPublicSchema = pagination_schema_1.PaginationQuerySchema.extend({
|
|
12
|
+
categoryAliases: zod_1.z.array(zod_1.z.string()).optional(),
|
|
13
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './blog-category-status.enum';
|
|
2
|
+
export * from './blog-post-status.enum';
|
|
3
|
+
export * from './category-response.schema';
|
|
4
|
+
export * from './create-category-request.schema';
|
|
5
|
+
export * from './update-category-request.schema';
|
|
6
|
+
export * from './post-response.schema';
|
|
7
|
+
export * from './create-post-request.schema';
|
|
8
|
+
export * from './update-post-request.schema';
|
|
9
|
+
export * from './get-posts-query.schema';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./blog-category-status.enum"), exports);
|
|
18
|
+
__exportStar(require("./blog-post-status.enum"), exports);
|
|
19
|
+
__exportStar(require("./category-response.schema"), exports);
|
|
20
|
+
__exportStar(require("./create-category-request.schema"), exports);
|
|
21
|
+
__exportStar(require("./update-category-request.schema"), exports);
|
|
22
|
+
__exportStar(require("./post-response.schema"), exports);
|
|
23
|
+
__exportStar(require("./create-post-request.schema"), exports);
|
|
24
|
+
__exportStar(require("./update-post-request.schema"), exports);
|
|
25
|
+
__exportStar(require("./get-posts-query.schema"), exports);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BlogPostStatus } from './blog-post-status.enum';
|
|
3
|
+
/**
|
|
4
|
+
* Post Response Schema
|
|
5
|
+
*/
|
|
6
|
+
export declare const PostResponseSchema: z.ZodObject<{
|
|
7
|
+
uuid: z.ZodString;
|
|
8
|
+
alias: z.ZodString;
|
|
9
|
+
title: z.ZodString;
|
|
10
|
+
metaTitle: z.ZodString;
|
|
11
|
+
metaDescription: z.ZodString;
|
|
12
|
+
content: z.ZodString;
|
|
13
|
+
image: z.ZodString;
|
|
14
|
+
author: z.ZodString;
|
|
15
|
+
categories: z.ZodArray<z.ZodObject<{
|
|
16
|
+
uuid: z.ZodString;
|
|
17
|
+
alias: z.ZodString;
|
|
18
|
+
title: z.ZodString;
|
|
19
|
+
order: z.ZodNumber;
|
|
20
|
+
status: z.ZodEnum<typeof import("./blog-category-status.enum").BlogCategoryStatus>;
|
|
21
|
+
createdAt: z.ZodString;
|
|
22
|
+
updatedAt: z.ZodString;
|
|
23
|
+
}, z.core.$strip>>;
|
|
24
|
+
viewsCount: z.ZodNumber;
|
|
25
|
+
status: z.ZodEnum<typeof BlogPostStatus>;
|
|
26
|
+
createdAt: z.ZodString;
|
|
27
|
+
updatedAt: z.ZodString;
|
|
28
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PostResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const regex_1 = require("../../../shared/regex");
|
|
6
|
+
const blog_post_status_enum_1 = require("./blog-post-status.enum");
|
|
7
|
+
const category_response_schema_1 = require("./category-response.schema");
|
|
8
|
+
/**
|
|
9
|
+
* Post Response Schema
|
|
10
|
+
*/
|
|
11
|
+
exports.PostResponseSchema = zod_1.z.object({
|
|
12
|
+
uuid: zod_1.z.string().regex(regex_1.UUID_REGEX),
|
|
13
|
+
alias: zod_1.z.string(),
|
|
14
|
+
title: zod_1.z.string(),
|
|
15
|
+
metaTitle: zod_1.z.string(),
|
|
16
|
+
metaDescription: zod_1.z.string(),
|
|
17
|
+
content: zod_1.z.string(),
|
|
18
|
+
image: zod_1.z.string(),
|
|
19
|
+
author: zod_1.z.string(),
|
|
20
|
+
categories: zod_1.z.array(category_response_schema_1.CategoryResponseSchema),
|
|
21
|
+
viewsCount: zod_1.z.number().int().nonnegative(),
|
|
22
|
+
status: zod_1.z.nativeEnum(blog_post_status_enum_1.BlogPostStatus),
|
|
23
|
+
createdAt: zod_1.z.string().regex(regex_1.DATETIME_REGEX),
|
|
24
|
+
updatedAt: zod_1.z.string().regex(regex_1.DATETIME_REGEX),
|
|
25
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BlogCategoryStatus } from './blog-category-status.enum';
|
|
3
|
+
export declare const UpdateCategoryRequestSchema: z.ZodObject<{
|
|
4
|
+
alias: z.ZodOptional<z.ZodString>;
|
|
5
|
+
title: z.ZodOptional<z.ZodString>;
|
|
6
|
+
order: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
status: z.ZodOptional<z.ZodEnum<typeof BlogCategoryStatus>>;
|
|
8
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateCategoryRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const regex_1 = require("../../../shared/regex");
|
|
6
|
+
const blog_category_status_enum_1 = require("./blog-category-status.enum");
|
|
7
|
+
exports.UpdateCategoryRequestSchema = zod_1.z.object({
|
|
8
|
+
alias: zod_1.z.string().min(1).max(100).regex(regex_1.SLUG_REGEX).optional(),
|
|
9
|
+
title: zod_1.z.string().min(1).max(200).optional(),
|
|
10
|
+
order: zod_1.z.number().int().nonnegative().optional(),
|
|
11
|
+
status: zod_1.z.nativeEnum(blog_category_status_enum_1.BlogCategoryStatus).optional(),
|
|
12
|
+
});
|