@vitnode/blog 1.2.0-canary.76 → 1.2.0-canary.77
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/dist/src/api/lib/categories-language.d.ts +10 -0
- package/dist/src/api/lib/categories-language.d.ts.map +1 -0
- package/dist/src/api/lib/categories-language.js +1 -0
- package/dist/src/api/lib/events.d.ts +28 -0
- package/dist/src/api/lib/events.d.ts.map +1 -0
- package/dist/src/api/lib/events.js +1 -0
- package/dist/src/api/lib/posts-language.d.ts +17 -0
- package/dist/src/api/lib/posts-language.d.ts.map +1 -0
- package/dist/src/api/lib/posts-language.js +1 -0
- package/dist/src/api/lib/search.d.ts +13 -0
- package/dist/src/api/lib/search.d.ts.map +1 -0
- package/dist/src/api/lib/search.js +1 -0
- package/dist/src/api/modules/admin/admin.module.d.ts +197 -180
- package/dist/src/api/modules/admin/admin.module.d.ts.map +1 -1
- package/dist/src/api/modules/admin/admin.module.js +1 -2
- package/dist/src/api/modules/admin/categories/categories.admin.module.d.ts +83 -80
- package/dist/src/api/modules/admin/categories/categories.admin.module.d.ts.map +1 -1
- package/dist/src/api/modules/admin/categories/categories.admin.module.js +1 -2
- package/dist/src/api/modules/admin/categories/routes/create.route.d.ts +38 -34
- package/dist/src/api/modules/admin/categories/routes/create.route.d.ts.map +1 -1
- package/dist/src/api/modules/admin/categories/routes/create.route.js +1 -2
- package/dist/src/api/modules/admin/categories/routes/delete.route.d.ts +15 -18
- package/dist/src/api/modules/admin/categories/routes/delete.route.d.ts.map +1 -1
- package/dist/src/api/modules/admin/categories/routes/delete.route.js +1 -2
- package/dist/src/api/modules/admin/categories/routes/edit.route.d.ts +38 -38
- package/dist/src/api/modules/admin/categories/routes/edit.route.d.ts.map +1 -1
- package/dist/src/api/modules/admin/categories/routes/edit.route.js +1 -2
- package/dist/src/api/modules/admin/posts/posts.admin.module.d.ts +104 -93
- package/dist/src/api/modules/admin/posts/posts.admin.module.d.ts.map +1 -1
- package/dist/src/api/modules/admin/posts/posts.admin.module.js +1 -2
- package/dist/src/api/modules/admin/posts/routes/create.route.d.ts +58 -44
- package/dist/src/api/modules/admin/posts/routes/create.route.d.ts.map +1 -1
- package/dist/src/api/modules/admin/posts/routes/create.route.js +1 -2
- package/dist/src/api/modules/admin/posts/routes/delete.route.d.ts +15 -18
- package/dist/src/api/modules/admin/posts/routes/delete.route.d.ts.map +1 -1
- package/dist/src/api/modules/admin/posts/routes/delete.route.js +1 -2
- package/dist/src/api/modules/admin/posts/routes/edit.route.d.ts +47 -43
- package/dist/src/api/modules/admin/posts/routes/edit.route.d.ts.map +1 -1
- package/dist/src/api/modules/admin/posts/routes/edit.route.js +1 -2
- package/dist/src/api/modules/categories/categories.module.d.ts +65 -64
- package/dist/src/api/modules/categories/categories.module.d.ts.map +1 -1
- package/dist/src/api/modules/categories/categories.module.js +1 -2
- package/dist/src/api/modules/categories/routes/get.route.d.ts +56 -45
- package/dist/src/api/modules/categories/routes/get.route.d.ts.map +1 -1
- package/dist/src/api/modules/categories/routes/get.route.js +1 -2
- package/dist/src/api/modules/categories/test.route.d.ts +20 -23
- package/dist/src/api/modules/categories/test.route.d.ts.map +1 -1
- package/dist/src/api/modules/categories/test.route.js +1 -2
- package/dist/src/api/modules/posts/posts.module.d.ts +68 -54
- package/dist/src/api/modules/posts/posts.module.d.ts.map +1 -1
- package/dist/src/api/modules/posts/posts.module.js +1 -2
- package/dist/src/api/modules/posts/routes/get.route.d.ts +97 -66
- package/dist/src/api/modules/posts/routes/get.route.d.ts.map +1 -1
- package/dist/src/api/modules/posts/routes/get.route.js +1 -2
- package/dist/src/config.api.d.ts +1 -4
- package/dist/src/config.api.d.ts.map +1 -1
- package/dist/src/config.api.js +1 -2
- package/dist/src/config.d.ts +1 -4
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/config.js +1 -2
- package/dist/src/const.d.ts +2 -5
- package/dist/src/const.d.ts.map +1 -1
- package/dist/src/const.js +1 -2
- package/dist/src/database/categories.d.ts +76 -98
- package/dist/src/database/categories.d.ts.map +1 -1
- package/dist/src/database/categories.js +1 -2
- package/dist/src/database/index.d.ts +4 -4
- package/dist/src/database/index.d.ts.map +1 -0
- package/dist/src/database/index.js +1 -1
- package/dist/src/database/posts.d.ts +91 -132
- package/dist/src/database/posts.d.ts.map +1 -1
- package/dist/src/database/posts.js +1 -2
- package/dist/src/database/relations.d.ts +4 -7
- package/dist/src/database/relations.d.ts.map +1 -1
- package/dist/src/database/relations.js +1 -2
- package/dist/src/emails/test-template.d.ts +18 -20
- package/dist/src/emails/test-template.d.ts.map +1 -1
- package/dist/src/emails/test-template.js +1 -2
- package/dist/src/globals.css +44 -0
- package/dist/src/locales/en.json +92 -0
- package/dist/src/locales/index.d.ts +4 -0
- package/dist/src/locales/index.d.ts.map +1 -0
- package/dist/src/locales/index.js +1 -0
- package/dist/src/routes/admin/blog/categories/page.d.ts +5 -7
- package/dist/src/routes/admin/blog/categories/page.d.ts.map +1 -1
- package/dist/src/routes/admin/blog/categories/page.js +1 -2
- package/dist/src/routes/admin/blog/posts/page.d.ts +5 -7
- package/dist/src/routes/admin/blog/posts/page.d.ts.map +1 -1
- package/dist/src/routes/admin/blog/posts/page.js +1 -2
- package/dist/src/routes/breadcrumb/admin/blog/categories/page.d.ts +2 -0
- package/dist/src/routes/breadcrumb/admin/blog/categories/page.d.ts.map +1 -0
- package/dist/src/routes/breadcrumb/admin/blog/categories/page.js +1 -0
- package/dist/src/routes/breadcrumb/admin/blog/posts/page.d.ts +2 -0
- package/dist/src/routes/breadcrumb/admin/blog/posts/page.d.ts.map +1 -0
- package/dist/src/routes/breadcrumb/admin/blog/posts/page.js +1 -0
- package/dist/src/views/admin/categories/actions/actions.d.ts +1 -4
- package/dist/src/views/admin/categories/actions/actions.d.ts.map +1 -1
- package/dist/src/views/admin/categories/actions/actions.js +1 -2
- package/dist/src/views/admin/categories/actions/create-edit/create-edit.d.ts +5 -8
- package/dist/src/views/admin/categories/actions/create-edit/create-edit.d.ts.map +1 -1
- package/dist/src/views/admin/categories/actions/create-edit/create-edit.js +1 -2
- package/dist/src/views/admin/categories/actions/create-edit/mutation-api.server.d.ts +11 -0
- package/dist/src/views/admin/categories/actions/create-edit/mutation-api.server.d.ts.map +1 -0
- package/dist/src/views/admin/categories/actions/create-edit/mutation-api.server.js +1 -0
- package/dist/src/views/admin/categories/table/actions/delete/delete-action.d.ts +3 -6
- package/dist/src/views/admin/categories/table/actions/delete/delete-action.d.ts.map +1 -1
- package/dist/src/views/admin/categories/table/actions/delete/delete-action.js +1 -2
- package/dist/src/views/admin/categories/table/actions/delete/mutation-api.server.d.ts +4 -0
- package/dist/src/views/admin/categories/table/actions/delete/mutation-api.server.d.ts.map +1 -0
- package/dist/src/views/admin/categories/table/actions/delete/mutation-api.server.js +1 -0
- package/dist/src/views/admin/categories/table/actions/edit-action.d.ts +5 -8
- package/dist/src/views/admin/categories/table/actions/edit-action.d.ts.map +1 -1
- package/dist/src/views/admin/categories/table/actions/edit-action.js +1 -2
- package/dist/src/views/admin/categories/table/categories-admin-view.d.ts +2 -5
- package/dist/src/views/admin/categories/table/categories-admin-view.d.ts.map +1 -1
- package/dist/src/views/admin/categories/table/categories-admin-view.js +1 -2
- package/dist/src/views/admin/posts/actions/actions.d.ts +1 -4
- package/dist/src/views/admin/posts/actions/actions.d.ts.map +1 -1
- package/dist/src/views/admin/posts/actions/actions.js +1 -2
- package/dist/src/views/admin/posts/actions/create-edit/create-edit.d.ts +7 -9
- package/dist/src/views/admin/posts/actions/create-edit/create-edit.d.ts.map +1 -1
- package/dist/src/views/admin/posts/actions/create-edit/create-edit.js +1 -2
- package/dist/src/views/admin/posts/actions/create-edit/multi-lang-fields.d.ts +10 -0
- package/dist/src/views/admin/posts/actions/create-edit/multi-lang-fields.d.ts.map +1 -0
- package/dist/src/views/admin/posts/actions/create-edit/multi-lang-fields.js +1 -0
- package/dist/src/views/admin/posts/actions/create-edit/mutation-api.server.d.ts +11 -0
- package/dist/src/views/admin/posts/actions/create-edit/mutation-api.server.d.ts.map +1 -0
- package/dist/src/views/admin/posts/actions/create-edit/mutation-api.server.js +1 -0
- package/dist/src/views/admin/posts/table/actions/delete/delete-action.d.ts +3 -6
- package/dist/src/views/admin/posts/table/actions/delete/delete-action.d.ts.map +1 -1
- package/dist/src/views/admin/posts/table/actions/delete/delete-action.js +1 -2
- package/dist/src/views/admin/posts/table/actions/delete/mutation-api.server.d.ts +4 -0
- package/dist/src/views/admin/posts/table/actions/delete/mutation-api.server.d.ts.map +1 -0
- package/dist/src/views/admin/posts/table/actions/delete/mutation-api.server.js +1 -0
- package/dist/src/views/admin/posts/table/actions/edit-action.d.ts +5 -8
- package/dist/src/views/admin/posts/table/actions/edit-action.d.ts.map +1 -1
- package/dist/src/views/admin/posts/table/actions/edit-action.js +1 -2
- package/dist/src/views/admin/posts/table/posts-admin-view.d.ts +2 -5
- package/dist/src/views/admin/posts/table/posts-admin-view.d.ts.map +1 -1
- package/dist/src/views/admin/posts/table/posts-admin-view.js +1 -2
- package/package.json +20 -18
- package/src/locales/en.json +17 -5
- package/src/locales/index.ts +11 -0
- package/src/routes/breadcrumb/admin/blog/categories/page.tsx +5 -0
- package/src/routes/breadcrumb/admin/blog/posts/page.tsx +5 -0
- package/dist/src/api/modules/admin/admin.module.js.map +0 -1
- package/dist/src/api/modules/admin/categories/categories.admin.module.js.map +0 -1
- package/dist/src/api/modules/admin/categories/routes/create.route.js.map +0 -1
- package/dist/src/api/modules/admin/categories/routes/delete.route.js.map +0 -1
- package/dist/src/api/modules/admin/categories/routes/edit.route.js.map +0 -1
- package/dist/src/api/modules/admin/posts/posts.admin.module.js.map +0 -1
- package/dist/src/api/modules/admin/posts/routes/create.route.js.map +0 -1
- package/dist/src/api/modules/admin/posts/routes/delete.route.js.map +0 -1
- package/dist/src/api/modules/admin/posts/routes/edit.route.js.map +0 -1
- package/dist/src/api/modules/categories/categories.module.js.map +0 -1
- package/dist/src/api/modules/categories/routes/get.route.js.map +0 -1
- package/dist/src/api/modules/categories/test.route.js.map +0 -1
- package/dist/src/api/modules/posts/posts.module.js.map +0 -1
- package/dist/src/api/modules/posts/routes/get.route.js.map +0 -1
- package/dist/src/config.api.js.map +0 -1
- package/dist/src/config.js.map +0 -1
- package/dist/src/const.js.map +0 -1
- package/dist/src/database/categories.js.map +0 -1
- package/dist/src/database/posts.js.map +0 -1
- package/dist/src/database/relations.js.map +0 -1
- package/dist/src/emails/test-template.js.map +0 -1
- package/dist/src/routes/admin/blog/categories/page.js.map +0 -1
- package/dist/src/routes/admin/blog/posts/page.js.map +0 -1
- package/dist/src/views/admin/categories/actions/actions.js.map +0 -1
- package/dist/src/views/admin/categories/actions/create-edit/create-edit.js.map +0 -1
- package/dist/src/views/admin/categories/actions/create-edit/mutation-api.d.ts +0 -14
- package/dist/src/views/admin/categories/actions/create-edit/mutation-api.d.ts.map +0 -1
- package/dist/src/views/admin/categories/actions/create-edit/mutation-api.js +0 -2
- package/dist/src/views/admin/categories/actions/create-edit/mutation-api.js.map +0 -1
- package/dist/src/views/admin/categories/table/actions/delete/delete-action.js.map +0 -1
- package/dist/src/views/admin/categories/table/actions/delete/mutation-api.d.ts +0 -7
- package/dist/src/views/admin/categories/table/actions/delete/mutation-api.d.ts.map +0 -1
- package/dist/src/views/admin/categories/table/actions/delete/mutation-api.js +0 -2
- package/dist/src/views/admin/categories/table/actions/delete/mutation-api.js.map +0 -1
- package/dist/src/views/admin/categories/table/actions/edit-action.js.map +0 -1
- package/dist/src/views/admin/categories/table/categories-admin-view.js.map +0 -1
- package/dist/src/views/admin/posts/actions/actions.js.map +0 -1
- package/dist/src/views/admin/posts/actions/create-edit/create-edit.js.map +0 -1
- package/dist/src/views/admin/posts/actions/create-edit/mutation-api.d.ts +0 -14
- package/dist/src/views/admin/posts/actions/create-edit/mutation-api.d.ts.map +0 -1
- package/dist/src/views/admin/posts/actions/create-edit/mutation-api.js +0 -2
- package/dist/src/views/admin/posts/actions/create-edit/mutation-api.js.map +0 -1
- package/dist/src/views/admin/posts/table/actions/delete/delete-action.js.map +0 -1
- package/dist/src/views/admin/posts/table/actions/delete/mutation-api.d.ts +0 -7
- package/dist/src/views/admin/posts/table/actions/delete/mutation-api.d.ts.map +0 -1
- package/dist/src/views/admin/posts/table/actions/delete/mutation-api.js +0 -2
- package/dist/src/views/admin/posts/table/actions/delete/mutation-api.js.map +0 -1
- package/dist/src/views/admin/posts/table/actions/edit-action.js.map +0 -1
- package/dist/src/views/admin/posts/table/posts-admin-view.js.map +0 -1
|
@@ -1,74 +1,105 @@
|
|
|
1
1
|
import { z } from "@hono/zod-openapi";
|
|
2
|
-
|
|
3
|
-
declare const zodPostSchema: z.ZodObject<{
|
|
4
|
-
id: z.ZodNumber;
|
|
5
|
-
title: z.ZodString;
|
|
6
|
-
titleSeo: z.ZodString;
|
|
7
|
-
content: z.ZodString;
|
|
8
|
-
categoryId: z.ZodNumber;
|
|
9
|
-
createdAt: z.ZodDate;
|
|
10
|
-
updatedAt: z.ZodDate;
|
|
11
|
-
category: z.ZodObject<{
|
|
2
|
+
export declare const zodPostSchema: z.ZodObject<{
|
|
12
3
|
id: z.ZodNumber;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}, z.core.$strip
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
4
|
+
titleTranslations: z.ZodArray<z.ZodObject<{
|
|
5
|
+
languageCode: z.ZodString;
|
|
6
|
+
value: z.ZodString;
|
|
7
|
+
}, z.core.$strip>>;
|
|
8
|
+
contentTranslations: z.ZodArray<z.ZodObject<{
|
|
9
|
+
languageCode: z.ZodString;
|
|
10
|
+
value: z.ZodString;
|
|
11
|
+
}, z.core.$strip>>;
|
|
12
|
+
friendlyUrlTranslations: z.ZodArray<z.ZodObject<{
|
|
13
|
+
languageCode: z.ZodString;
|
|
14
|
+
value: z.ZodString;
|
|
15
|
+
}, z.core.$strip>>;
|
|
16
|
+
categoryId: z.ZodNumber;
|
|
17
|
+
createdAt: z.ZodDate;
|
|
18
|
+
updatedAt: z.ZodDate;
|
|
19
|
+
category: z.ZodObject<{
|
|
20
|
+
id: z.ZodNumber;
|
|
21
|
+
titleTranslations: z.ZodArray<z.ZodObject<{
|
|
22
|
+
languageCode: z.ZodString;
|
|
23
|
+
value: z.ZodString;
|
|
24
|
+
}, z.core.$strip>>;
|
|
34
25
|
}, z.core.$strip>;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
26
|
+
author: z.ZodNullable<z.ZodObject<{
|
|
27
|
+
id: z.ZodNumber;
|
|
28
|
+
name: z.ZodString;
|
|
29
|
+
nameCode: z.ZodString;
|
|
30
|
+
avatarColor: z.ZodString;
|
|
31
|
+
}, z.core.$strip>>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
export declare const postsRoute: import("@vitnode/core/api/lib/route").Route<"@vitnode/blog", {
|
|
34
|
+
method: "get";
|
|
35
|
+
path: "/";
|
|
36
|
+
request: {
|
|
37
|
+
query: z.ZodObject<{
|
|
38
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
39
|
+
first: z.ZodOptional<z.ZodString>;
|
|
40
|
+
last: z.ZodOptional<z.ZodString>;
|
|
41
|
+
order: z.ZodOptional<z.ZodEnum<{
|
|
42
|
+
asc: "asc";
|
|
43
|
+
desc: "desc";
|
|
44
|
+
}>>;
|
|
45
|
+
orderBy: z.ZodOptional<z.ZodEnum<{
|
|
46
|
+
createdAt: "createdAt";
|
|
47
|
+
updatedAt: "updatedAt";
|
|
48
|
+
}>>;
|
|
49
|
+
categoryId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
};
|
|
52
|
+
responses: {
|
|
53
|
+
200: {
|
|
54
|
+
content: {
|
|
55
|
+
"application/json": {
|
|
56
|
+
schema: z.ZodObject<{
|
|
57
|
+
edges: z.ZodArray<z.ZodObject<{
|
|
58
|
+
id: z.ZodNumber;
|
|
59
|
+
titleTranslations: z.ZodArray<z.ZodObject<{
|
|
60
|
+
languageCode: z.ZodString;
|
|
61
|
+
value: z.ZodString;
|
|
62
|
+
}, z.core.$strip>>;
|
|
63
|
+
contentTranslations: z.ZodArray<z.ZodObject<{
|
|
64
|
+
languageCode: z.ZodString;
|
|
65
|
+
value: z.ZodString;
|
|
66
|
+
}, z.core.$strip>>;
|
|
67
|
+
friendlyUrlTranslations: z.ZodArray<z.ZodObject<{
|
|
68
|
+
languageCode: z.ZodString;
|
|
69
|
+
value: z.ZodString;
|
|
70
|
+
}, z.core.$strip>>;
|
|
71
|
+
categoryId: z.ZodNumber;
|
|
72
|
+
createdAt: z.ZodDate;
|
|
73
|
+
updatedAt: z.ZodDate;
|
|
74
|
+
category: z.ZodObject<{
|
|
75
|
+
id: z.ZodNumber;
|
|
76
|
+
titleTranslations: z.ZodArray<z.ZodObject<{
|
|
77
|
+
languageCode: z.ZodString;
|
|
78
|
+
value: z.ZodString;
|
|
79
|
+
}, z.core.$strip>>;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
author: z.ZodNullable<z.ZodObject<{
|
|
82
|
+
id: z.ZodNumber;
|
|
83
|
+
name: z.ZodString;
|
|
84
|
+
nameCode: z.ZodString;
|
|
85
|
+
avatarColor: z.ZodString;
|
|
86
|
+
}, z.core.$strip>>;
|
|
87
|
+
}, z.core.$strip>>;
|
|
88
|
+
pageInfo: z.ZodObject<{
|
|
89
|
+
totalCount: z.ZodNumber;
|
|
90
|
+
count: z.ZodNumber;
|
|
91
|
+
hasNextPage: z.ZodBoolean;
|
|
92
|
+
hasPreviousPage: z.ZodBoolean;
|
|
93
|
+
startCursor: z.ZodNullable<z.ZodNumber>;
|
|
94
|
+
endCursor: z.ZodNullable<z.ZodNumber>;
|
|
95
|
+
}, z.core.$strip>;
|
|
96
|
+
}, z.core.$strip>;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
description: string;
|
|
64
100
|
};
|
|
65
|
-
};
|
|
66
|
-
description: string;
|
|
67
101
|
};
|
|
68
|
-
};
|
|
69
102
|
} & {
|
|
70
|
-
|
|
103
|
+
path: string;
|
|
71
104
|
}>;
|
|
72
|
-
//#endregion
|
|
73
|
-
export { postsRoute, zodPostSchema };
|
|
74
105
|
//# sourceMappingURL=get.route.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.route.d.ts","
|
|
1
|
+
{"version":3,"file":"get.route.d.ts","sourceRoot":"","sources":["../../../../../../src/api/modules/posts/routes/get.route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAoBtC,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsBxB,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwGrB,CAAC"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=get.route.js.map
|
|
1
|
+
import{z}from"@hono/zod-openapi";import{buildRoute}from"@vitnode/core/api/lib/route";import{withPagination,zodPaginationPageInfo,zodPaginationQuery}from"@vitnode/core/api/lib/with-pagination";import{core_users}from"@vitnode/core/database/users";import{multiLangValueSchema}from"@vitnode/core/lib/helpers/multi-lang";import{eq}from"drizzle-orm";import{CONFIG_PLUGIN}from"../../../../const.js";import{blog_categories}from"../../../../database/categories.js";import{blog_posts}from"../../../../database/posts.js";import{loadCategoryTranslations}from"../../../lib/categories-language.js";import{loadPostTranslations}from"../../../lib/posts-language.js";const zodMultiLangValue=multiLangValueSchema();export const zodPostSchema=z.object({id:z.number(),titleTranslations:zodMultiLangValue,contentTranslations:zodMultiLangValue,friendlyUrlTranslations:zodMultiLangValue,categoryId:z.number(),createdAt:z.date(),updatedAt:z.date(),category:z.object({id:z.number(),titleTranslations:zodMultiLangValue}),author:z.object({id:z.number(),name:z.string(),nameCode:z.string(),avatarColor:z.string()}).nullable()});export const postsRoute=buildRoute({pluginId:CONFIG_PLUGIN.pluginId,route:{method:"get",path:"/",request:{query:zodPaginationQuery.extend({order:z.enum(["asc","desc"]).optional(),orderBy:z.enum(["updatedAt","createdAt"]).optional(),categoryId:z.string().transform(Number).optional()})},responses:{200:{content:{"application/json":{schema:z.object({edges:z.array(zodPostSchema),pageInfo:zodPaginationPageInfo})}},description:"Posts retrieved successfully"}}},handler:async c=>{const query=c.req.valid("query");const data=await withPagination({c,params:{query},primaryCursor:blog_posts.id,query:async({limit,where,orderBy})=>await c.get("db").select({id:blog_posts.id,categoryId:blog_posts.categoryId,createdAt:blog_posts.createdAt,updatedAt:blog_posts.updatedAt,category:{id:blog_categories.id},author:{id:core_users.id,name:core_users.name,nameCode:core_users.nameCode,avatarColor:core_users.avatarColor}}).from(blog_posts).innerJoin(blog_categories,eq(blog_posts.categoryId,blog_categories.id)).leftJoin(core_users,eq(core_users.id,blog_posts.authorId)).where(query.categoryId?eq(blog_posts.categoryId,query.categoryId):where).orderBy(orderBy).limit(limit),table:blog_posts,orderBy:{column:query.orderBy?blog_posts[query.orderBy]:blog_posts.updatedAt,order:query.order??"desc"}});const[translations,categoryTranslations]=await Promise.all([loadPostTranslations(c,data.edges.map(edge=>edge.id)),loadCategoryTranslations(c,data.edges.map(edge=>edge.category.id))]);return c.json({...data,edges:data.edges.map(edge=>{const words=translations.get(edge.id);return{...edge,titleTranslations:words?.title??[],contentTranslations:words?.content??[],friendlyUrlTranslations:words?.friendlyUrl??[],category:{...edge.category,titleTranslations:categoryTranslations.get(edge.category.id)??[]}}})})}});
|
package/dist/src/config.api.d.ts
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
declare const blogApiPlugin: () => import("@vitnode/core/api/lib/plugin").BuildPluginApiReturn;
|
|
3
|
-
//#endregion
|
|
4
|
-
export { blogApiPlugin };
|
|
1
|
+
export declare const blogApiPlugin: () => import("@vitnode/core/api/lib/plugin").BuildPluginApiReturn;
|
|
5
2
|
//# sourceMappingURL=config.api.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.api.d.ts","
|
|
1
|
+
{"version":3,"file":"config.api.d.ts","sourceRoot":"","sources":["../../src/config.api.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,aAAa,mEAwBzB,CAAC"}
|
package/dist/src/config.api.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{CONFIG_PLUGIN
|
|
2
|
-
//# sourceMappingURL=config.api.js.map
|
|
1
|
+
import{buildApiPlugin}from"@vitnode/core/api/lib/plugin";import{CONFIG_PLUGIN}from"./const.js";import{blogPostSearchIndexer}from"./api/lib/search.js";import{adminModule}from"./api/modules/admin/admin.module.js";import{categoriesModule}from"./api/modules/categories/categories.module.js";import{postsModule}from"./api/modules/posts/posts.module.js";import messages from"./locales/index.js";export const blogApiPlugin=()=>{return buildApiPlugin({pluginId:CONFIG_PLUGIN.pluginId,messages,modules:[adminModule,categoriesModule,postsModule],searchIndexers:[blogPostSearchIndexer],permissionStaff:{moderator:{posts:["can_edit","can_delete"]},admin:{posts:["can_view",{permission:"can_create",dependsOn:["can_view"]},"can_edit","can_delete"],categories:["can_view","can_create","can_edit","can_delete"]}}})};
|
package/dist/src/config.d.ts
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
declare const blogPlugin: () => import("@vitnode/core/lib/plugin").BuildPluginReturn<"@vitnode/blog">;
|
|
3
|
-
//#endregion
|
|
4
|
-
export { blogPlugin };
|
|
1
|
+
export declare const blogPlugin: () => import("@vitnode/core/lib/plugin").BuildPluginReturn<"@vitnode/blog">;
|
|
5
2
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/src/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,UAAU,6EAqBtB,CAAC"}
|
package/dist/src/config.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=config.js.map
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import{buildPlugin}from"@vitnode/core/lib/plugin";import{ListIcon,NotebookPenIcon}from"lucide-react";import{CONFIG_PLUGIN}from"./const.js";import messages from"./locales/index.js";export const blogPlugin=()=>{return buildPlugin({pluginId:CONFIG_PLUGIN.pluginId,messages,admin:{nav:[{id:"posts",href:"/admin/blog/posts",icon:_jsx(NotebookPenIcon,{}),permission:{module:"posts",permission:"can_view"}},{id:"categories",href:"/admin/blog/categories",icon:_jsx(ListIcon,{}),permission:{module:"categories",permission:"can_view"}}]}})};
|
package/dist/src/const.d.ts
CHANGED
package/dist/src/const.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"const.d.ts","
|
|
1
|
+
{"version":3,"file":"const.d.ts","sourceRoot":"","sources":["../../src/const.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;CAEzB,CAAC"}
|
package/dist/src/const.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
const
|
|
2
|
-
//# sourceMappingURL=const.js.map
|
|
1
|
+
export const CONFIG_PLUGIN={pluginId:"@vitnode/blog"};
|
|
@@ -1,100 +1,78 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
name: "titleSeo";
|
|
78
|
-
tableName: "blog_categories";
|
|
79
|
-
dataType: "string";
|
|
80
|
-
columnType: "PgVarchar";
|
|
81
|
-
data: string;
|
|
82
|
-
driverParam: string;
|
|
83
|
-
notNull: true;
|
|
84
|
-
hasDefault: true;
|
|
85
|
-
isPrimaryKey: false;
|
|
86
|
-
isAutoincrement: false;
|
|
87
|
-
hasRuntimeDefault: false;
|
|
88
|
-
enumValues: [string, ...string[]];
|
|
89
|
-
baseColumn: never;
|
|
90
|
-
identity: undefined;
|
|
91
|
-
generated: undefined;
|
|
92
|
-
}, {}, {
|
|
93
|
-
length: 100;
|
|
94
|
-
}>;
|
|
95
|
-
};
|
|
96
|
-
dialect: "pg";
|
|
1
|
+
export declare const blog_categories: Omit<import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
2
|
+
name: "blog_categories";
|
|
3
|
+
schema: undefined;
|
|
4
|
+
columns: {
|
|
5
|
+
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
6
|
+
name: "id";
|
|
7
|
+
tableName: "blog_categories";
|
|
8
|
+
dataType: "number";
|
|
9
|
+
columnType: "PgSerial";
|
|
10
|
+
data: number;
|
|
11
|
+
driverParam: number;
|
|
12
|
+
notNull: true;
|
|
13
|
+
hasDefault: true;
|
|
14
|
+
isPrimaryKey: true;
|
|
15
|
+
isAutoincrement: false;
|
|
16
|
+
hasRuntimeDefault: false;
|
|
17
|
+
enumValues: undefined;
|
|
18
|
+
baseColumn: never;
|
|
19
|
+
identity: undefined;
|
|
20
|
+
generated: undefined;
|
|
21
|
+
}, {}, {}>;
|
|
22
|
+
color: import("drizzle-orm/pg-core").PgColumn<{
|
|
23
|
+
name: "color";
|
|
24
|
+
tableName: "blog_categories";
|
|
25
|
+
dataType: "string";
|
|
26
|
+
columnType: "PgVarchar";
|
|
27
|
+
data: string;
|
|
28
|
+
driverParam: string;
|
|
29
|
+
notNull: false;
|
|
30
|
+
hasDefault: false;
|
|
31
|
+
isPrimaryKey: false;
|
|
32
|
+
isAutoincrement: false;
|
|
33
|
+
hasRuntimeDefault: false;
|
|
34
|
+
enumValues: [string, ...string[]];
|
|
35
|
+
baseColumn: never;
|
|
36
|
+
identity: undefined;
|
|
37
|
+
generated: undefined;
|
|
38
|
+
}, {}, {
|
|
39
|
+
length: 50;
|
|
40
|
+
}>;
|
|
41
|
+
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
42
|
+
name: "createdAt";
|
|
43
|
+
tableName: "blog_categories";
|
|
44
|
+
dataType: "date";
|
|
45
|
+
columnType: "PgTimestamp";
|
|
46
|
+
data: Date;
|
|
47
|
+
driverParam: string;
|
|
48
|
+
notNull: true;
|
|
49
|
+
hasDefault: true;
|
|
50
|
+
isPrimaryKey: false;
|
|
51
|
+
isAutoincrement: false;
|
|
52
|
+
hasRuntimeDefault: false;
|
|
53
|
+
enumValues: undefined;
|
|
54
|
+
baseColumn: never;
|
|
55
|
+
identity: undefined;
|
|
56
|
+
generated: undefined;
|
|
57
|
+
}, {}, {}>;
|
|
58
|
+
updatedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
59
|
+
name: "updatedAt";
|
|
60
|
+
tableName: "blog_categories";
|
|
61
|
+
dataType: "date";
|
|
62
|
+
columnType: "PgTimestamp";
|
|
63
|
+
data: Date;
|
|
64
|
+
driverParam: string;
|
|
65
|
+
notNull: true;
|
|
66
|
+
hasDefault: true;
|
|
67
|
+
isPrimaryKey: false;
|
|
68
|
+
isAutoincrement: false;
|
|
69
|
+
hasRuntimeDefault: false;
|
|
70
|
+
enumValues: undefined;
|
|
71
|
+
baseColumn: never;
|
|
72
|
+
identity: undefined;
|
|
73
|
+
generated: undefined;
|
|
74
|
+
}, {}, {}>;
|
|
75
|
+
};
|
|
76
|
+
dialect: "pg";
|
|
97
77
|
}>, "enableRLS">;
|
|
98
|
-
//#endregion
|
|
99
|
-
export { blog_categories };
|
|
100
78
|
//# sourceMappingURL=categories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"categories.d.ts","
|
|
1
|
+
{"version":3,"file":"categories.d.ts","sourceRoot":"","sources":["../../../src/database/categories.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAQb,CAAC"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{pgTable
|
|
2
|
-
//# sourceMappingURL=categories.js.map
|
|
1
|
+
import{pgTable}from"drizzle-orm/pg-core";export const blog_categories=pgTable("blog_categories",t=>({id:t.serial().primaryKey(),color:t.varchar({length:50}),createdAt:t.timestamp().notNull().defaultNow(),updatedAt:t.timestamp().notNull().$onUpdate(()=>new Date)})).enableRLS();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
export * from "./categories";
|
|
2
|
+
export * from "./posts";
|
|
3
|
+
export * from "./relations";
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/database/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AAGxB,cAAc,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export*from"./categories.js";export*from"./posts.js";export*from"./relations.js";
|