@vitnode/blog 1.2.0-canary.76 → 1.2.0-canary.78
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,110 +1,121 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
export declare const postsAdminModule: import("@vitnode/core/api/lib/module").BuildModuleReturn<"@vitnode/blog", "posts", [import("@vitnode/core/api/lib/route").Route<"@vitnode/blog", {
|
|
2
|
+
method: "put";
|
|
3
|
+
path: "/{id}";
|
|
4
|
+
request: {
|
|
5
|
+
params: import("zod").ZodObject<{
|
|
6
|
+
id: import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<number, string>>;
|
|
7
|
+
}, import("zod/v4/core").$strip>;
|
|
8
|
+
body: {
|
|
9
|
+
content: {
|
|
10
|
+
"application/json": {
|
|
11
|
+
schema: import("zod").ZodObject<{
|
|
12
|
+
title: import("zod").ZodArray<import("zod").ZodObject<{
|
|
13
|
+
languageCode: import("zod").ZodString;
|
|
14
|
+
value: import("zod").ZodString;
|
|
15
|
+
}, import("zod/v4/core").$strip>>;
|
|
16
|
+
content: import("zod").ZodArray<import("zod").ZodObject<{
|
|
17
|
+
languageCode: import("zod").ZodString;
|
|
18
|
+
value: import("zod").ZodString;
|
|
19
|
+
}, import("zod/v4/core").$strip>>;
|
|
20
|
+
friendlyUrl: import("zod").ZodArray<import("zod").ZodObject<{
|
|
21
|
+
languageCode: import("zod").ZodString;
|
|
22
|
+
value: import("zod").ZodString;
|
|
23
|
+
}, import("zod/v4/core").$strip>>;
|
|
24
|
+
categoryId: import("zod").ZodNumber;
|
|
25
|
+
}, import("zod/v4/core").$strip>;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
17
28
|
};
|
|
18
|
-
};
|
|
19
29
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
responses: {
|
|
31
|
+
200: {
|
|
32
|
+
content: {
|
|
33
|
+
"application/json": {
|
|
34
|
+
schema: import("zod").ZodObject<{
|
|
35
|
+
id: import("zod").ZodNumber;
|
|
36
|
+
categoryId: import("zod").ZodNumber;
|
|
37
|
+
createdAt: import("zod").ZodDate;
|
|
38
|
+
updatedAt: import("zod").ZodDate;
|
|
39
|
+
}, import("zod/v4/core").$strip>;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
description: string;
|
|
43
|
+
};
|
|
44
|
+
400: {
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
404: {
|
|
48
|
+
description: string;
|
|
34
49
|
};
|
|
35
|
-
};
|
|
36
|
-
description: string;
|
|
37
|
-
};
|
|
38
|
-
400: {
|
|
39
|
-
description: string;
|
|
40
|
-
};
|
|
41
|
-
404: {
|
|
42
|
-
description: string;
|
|
43
50
|
};
|
|
44
|
-
};
|
|
45
51
|
} & {
|
|
46
|
-
|
|
52
|
+
path: string;
|
|
47
53
|
}>, import("@vitnode/core/api/lib/route").Route<"@vitnode/blog", {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
method: "post";
|
|
55
|
+
path: "/";
|
|
56
|
+
request: {
|
|
57
|
+
body: {
|
|
58
|
+
content: {
|
|
59
|
+
"application/json": {
|
|
60
|
+
schema: import("zod").ZodObject<{
|
|
61
|
+
title: import("zod").ZodArray<import("zod").ZodObject<{
|
|
62
|
+
languageCode: import("zod").ZodString;
|
|
63
|
+
value: import("zod").ZodString;
|
|
64
|
+
}, import("zod/v4/core").$strip>>;
|
|
65
|
+
content: import("zod").ZodArray<import("zod").ZodObject<{
|
|
66
|
+
languageCode: import("zod").ZodString;
|
|
67
|
+
value: import("zod").ZodString;
|
|
68
|
+
}, import("zod/v4/core").$strip>>;
|
|
69
|
+
friendlyUrl: import("zod").ZodArray<import("zod").ZodObject<{
|
|
70
|
+
languageCode: import("zod").ZodString;
|
|
71
|
+
value: import("zod").ZodString;
|
|
72
|
+
}, import("zod/v4/core").$strip>>;
|
|
73
|
+
categoryId: import("zod").ZodNumber;
|
|
74
|
+
}, import("zod/v4/core").$strip>;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
59
77
|
};
|
|
60
|
-
};
|
|
61
78
|
};
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
79
|
+
responses: {
|
|
80
|
+
201: {
|
|
81
|
+
content: {
|
|
82
|
+
"application/json": {
|
|
83
|
+
schema: import("zod").ZodObject<{
|
|
84
|
+
id: import("zod").ZodNumber;
|
|
85
|
+
categoryId: import("zod").ZodNumber;
|
|
86
|
+
createdAt: import("zod").ZodDate;
|
|
87
|
+
updatedAt: import("zod").ZodDate;
|
|
88
|
+
}, import("zod/v4/core").$strip>;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
description: string;
|
|
92
|
+
};
|
|
93
|
+
400: {
|
|
94
|
+
description: string;
|
|
95
|
+
};
|
|
96
|
+
404: {
|
|
97
|
+
description: string;
|
|
76
98
|
};
|
|
77
|
-
};
|
|
78
|
-
description: string;
|
|
79
|
-
};
|
|
80
|
-
400: {
|
|
81
|
-
description: string;
|
|
82
|
-
};
|
|
83
|
-
404: {
|
|
84
|
-
description: string;
|
|
85
99
|
};
|
|
86
|
-
};
|
|
87
100
|
} & {
|
|
88
|
-
|
|
101
|
+
path: string;
|
|
89
102
|
}>, import("@vitnode/core/api/lib/route").Route<"@vitnode/blog", {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
};
|
|
97
|
-
responses: {
|
|
98
|
-
204: {
|
|
99
|
-
description: string;
|
|
103
|
+
method: "delete";
|
|
104
|
+
path: "/{id}";
|
|
105
|
+
request: {
|
|
106
|
+
params: import("zod").ZodObject<{
|
|
107
|
+
id: import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<number, string>>;
|
|
108
|
+
}, import("zod/v4/core").$strip>;
|
|
100
109
|
};
|
|
101
|
-
|
|
102
|
-
|
|
110
|
+
responses: {
|
|
111
|
+
204: {
|
|
112
|
+
description: string;
|
|
113
|
+
};
|
|
114
|
+
404: {
|
|
115
|
+
description: string;
|
|
116
|
+
};
|
|
103
117
|
};
|
|
104
|
-
};
|
|
105
118
|
} & {
|
|
106
|
-
|
|
119
|
+
path: string;
|
|
107
120
|
}>], import("@vitnode/core/api/lib/module").BaseBuildModuleReturn<"@vitnode/blog", string, import("@vitnode/core/api/lib/route").Route<"@vitnode/blog", import("@hono/zod-openapi").RouteConfig>[]>[]>;
|
|
108
|
-
//#endregion
|
|
109
|
-
export { postsAdminModule };
|
|
110
121
|
//# sourceMappingURL=posts.admin.module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"posts.admin.module.d.ts","
|
|
1
|
+
{"version":3,"file":"posts.admin.module.d.ts","sourceRoot":"","sources":["../../../../../../src/api/modules/admin/posts/posts.admin.module.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sMAI3B,CAAC"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{CONFIG_PLUGIN
|
|
2
|
-
//# sourceMappingURL=posts.admin.module.js.map
|
|
1
|
+
import{buildModule}from"@vitnode/core/api/lib/module";import{CONFIG_PLUGIN}from"../../../../const.js";import{createPostRoute}from"./routes/create.route.js";import{deletePostRoute}from"./routes/delete.route.js";import{editPostRoute}from"./routes/edit.route.js";export const postsAdminModule=buildModule({pluginId:CONFIG_PLUGIN.pluginId,name:"posts",routes:[editPostRoute,createPostRoute,deletePostRoute]});
|
|
@@ -1,53 +1,67 @@
|
|
|
1
1
|
import { z } from "@hono/zod-openapi";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
export declare const zodCreatePostSchema: z.ZodObject<{
|
|
3
|
+
title: z.ZodArray<z.ZodObject<{
|
|
4
|
+
languageCode: z.ZodString;
|
|
5
|
+
value: z.ZodString;
|
|
6
|
+
}, z.core.$strip>>;
|
|
7
|
+
content: z.ZodArray<z.ZodObject<{
|
|
8
|
+
languageCode: z.ZodString;
|
|
9
|
+
value: z.ZodString;
|
|
10
|
+
}, z.core.$strip>>;
|
|
11
|
+
friendlyUrl: z.ZodArray<z.ZodObject<{
|
|
12
|
+
languageCode: z.ZodString;
|
|
13
|
+
value: z.ZodString;
|
|
14
|
+
}, z.core.$strip>>;
|
|
15
|
+
categoryId: z.ZodNumber;
|
|
7
16
|
}, z.core.$strip>;
|
|
8
|
-
declare const createPostRoute: import("@vitnode/core/api/lib/route").Route<"@vitnode/blog", {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
export declare const createPostRoute: import("@vitnode/core/api/lib/route").Route<"@vitnode/blog", {
|
|
18
|
+
method: "post";
|
|
19
|
+
path: "/";
|
|
20
|
+
request: {
|
|
21
|
+
body: {
|
|
22
|
+
content: {
|
|
23
|
+
"application/json": {
|
|
24
|
+
schema: z.ZodObject<{
|
|
25
|
+
title: z.ZodArray<z.ZodObject<{
|
|
26
|
+
languageCode: z.ZodString;
|
|
27
|
+
value: z.ZodString;
|
|
28
|
+
}, z.core.$strip>>;
|
|
29
|
+
content: z.ZodArray<z.ZodObject<{
|
|
30
|
+
languageCode: z.ZodString;
|
|
31
|
+
value: z.ZodString;
|
|
32
|
+
}, z.core.$strip>>;
|
|
33
|
+
friendlyUrl: z.ZodArray<z.ZodObject<{
|
|
34
|
+
languageCode: z.ZodString;
|
|
35
|
+
value: z.ZodString;
|
|
36
|
+
}, z.core.$strip>>;
|
|
37
|
+
categoryId: z.ZodNumber;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
20
41
|
};
|
|
21
|
-
};
|
|
22
42
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
43
|
+
responses: {
|
|
44
|
+
201: {
|
|
45
|
+
content: {
|
|
46
|
+
"application/json": {
|
|
47
|
+
schema: z.ZodObject<{
|
|
48
|
+
id: z.ZodNumber;
|
|
49
|
+
categoryId: z.ZodNumber;
|
|
50
|
+
createdAt: z.ZodDate;
|
|
51
|
+
updatedAt: z.ZodDate;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
description: string;
|
|
56
|
+
};
|
|
57
|
+
400: {
|
|
58
|
+
description: string;
|
|
59
|
+
};
|
|
60
|
+
404: {
|
|
61
|
+
description: string;
|
|
37
62
|
};
|
|
38
|
-
};
|
|
39
|
-
description: string;
|
|
40
|
-
};
|
|
41
|
-
400: {
|
|
42
|
-
description: string;
|
|
43
|
-
};
|
|
44
|
-
404: {
|
|
45
|
-
description: string;
|
|
46
63
|
};
|
|
47
|
-
};
|
|
48
64
|
} & {
|
|
49
|
-
|
|
65
|
+
path: string;
|
|
50
66
|
}>;
|
|
51
|
-
//#endregion
|
|
52
|
-
export { createPostRoute, zodCreatePostSchema };
|
|
53
67
|
//# sourceMappingURL=create.route.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.route.d.ts","
|
|
1
|
+
{"version":3,"file":"create.route.d.ts","sourceRoot":"","sources":["../../../../../../../src/api/modules/admin/posts/routes/create.route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAyBtC,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;iBAK9B,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoG1B,CAAC"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=create.route.js.map
|
|
1
|
+
import{z}from"@hono/zod-openapi";import{buildRoute}from"@vitnode/core/api/lib/route";import{core_languages_words}from"@vitnode/core/database/languages";import{multiLangValueSchema}from"@vitnode/core/lib/helpers/multi-lang";import{and,eq,inArray}from"drizzle-orm";import{HTTPException}from"hono/http-exception";import{CONFIG_PLUGIN}from"../../../../../const.js";import{blog_categories}from"../../../../../database/categories.js";import{blog_posts}from"../../../../../database/posts.js";import{POST_LANG_TABLE,savePostTranslations,slugifyMultiLang}from"../../../../lib/posts-language.js";import{reindexBlogPost}from"../../../../lib/search.js";const zodPostResponseSchema=z.object({id:z.number(),categoryId:z.number(),createdAt:z.date(),updatedAt:z.date()});export const zodCreatePostSchema=z.object({title:multiLangValueSchema({minLength:3,maxLength:255}).min(1),content:multiLangValueSchema(),friendlyUrl:multiLangValueSchema({minLength:1,maxLength:255}).min(1),categoryId:z.number()});export const createPostRoute=buildRoute({pluginId:CONFIG_PLUGIN.pluginId,adminStaffPermission:{module:"posts",permission:"can_create"},route:{method:"post",path:"/",request:{body:{content:{"application/json":{schema:zodCreatePostSchema}}}},responses:{201:{content:{"application/json":{schema:zodPostResponseSchema}},description:"Post created successfully"},400:{description:"Bad request - Invalid input data"},404:{description:"Category not found"}}},handler:async c=>{const{title,content,friendlyUrl,categoryId}=c.req.valid("json");const slugFriendlyUrl=slugifyMultiLang(friendlyUrl);const friendlyUrlValues=[...new Set(slugFriendlyUrl.map(item=>item.value).filter(Boolean))];if(friendlyUrlValues.length===0){throw new HTTPException(400,{message:"Friendly URL is required."})}const[category]=await c.get("db").select({id:blog_categories.id}).from(blog_categories).where(eq(blog_categories.id,categoryId)).limit(1);if(!category){throw new HTTPException(404,{message:"Category not found."})}const[duplicate]=await c.get("db").select({itemId:core_languages_words.itemId}).from(core_languages_words).where(and(eq(core_languages_words.pluginCode,CONFIG_PLUGIN.pluginId),eq(core_languages_words.tableName,POST_LANG_TABLE),eq(core_languages_words.variable,"friendlyUrl"),inArray(core_languages_words.value,friendlyUrlValues))).limit(1);if(duplicate){throw new HTTPException(400,{message:"Post with this title already exists."})}const[post]=await c.get("db").insert(blog_posts).values({categoryId,authorId:c.get("admin")?.user.id??c.get("user")?.id??null}).returning();await savePostTranslations(c,post.id,{title,content,friendlyUrl});await reindexBlogPost(c,post);await c.get("events").emit("blog.post.created",{postId:post.id,categoryId:post.categoryId});return c.json(post,201)}});
|
|
@@ -1,24 +1,21 @@
|
|
|
1
1
|
import { z } from "@hono/zod-openapi";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}, z.core.$strip>;
|
|
10
|
-
};
|
|
11
|
-
responses: {
|
|
12
|
-
204: {
|
|
13
|
-
description: string;
|
|
2
|
+
export declare const deletePostRoute: import("@vitnode/core/api/lib/route").Route<"@vitnode/blog", {
|
|
3
|
+
method: "delete";
|
|
4
|
+
path: "/{id}";
|
|
5
|
+
request: {
|
|
6
|
+
params: z.ZodObject<{
|
|
7
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
8
|
+
}, z.core.$strip>;
|
|
14
9
|
};
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
responses: {
|
|
11
|
+
204: {
|
|
12
|
+
description: string;
|
|
13
|
+
};
|
|
14
|
+
404: {
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
17
|
};
|
|
18
|
-
};
|
|
19
18
|
} & {
|
|
20
|
-
|
|
19
|
+
path: string;
|
|
21
20
|
}>;
|
|
22
|
-
//#endregion
|
|
23
|
-
export { deletePostRoute };
|
|
24
21
|
//# sourceMappingURL=delete.route.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete.route.d.ts","
|
|
1
|
+
{"version":3,"file":"delete.route.d.ts","sourceRoot":"","sources":["../../../../../../../src/api/modules/admin/posts/routes/delete.route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAQtC,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;EA0C1B,CAAC"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=delete.route.js.map
|
|
1
|
+
import{z}from"@hono/zod-openapi";import{buildRoute}from"@vitnode/core/api/lib/route";import{eq}from"drizzle-orm";import{HTTPException}from"hono/http-exception";import{CONFIG_PLUGIN}from"../../../../../const.js";import{blog_posts}from"../../../../../database/posts.js";export const deletePostRoute=buildRoute({pluginId:CONFIG_PLUGIN.pluginId,adminStaffPermission:{module:"posts",permission:"can_delete"},route:{method:"delete",path:"/{id}",request:{params:z.object({id:z.string().transform(Number)})},responses:{204:{description:"Post deleted successfully"},404:{description:"Post not found"}}},handler:async c=>{const{id}=c.req.valid("param");const result=await c.get("db").delete(blog_posts).where(eq(blog_posts.id,id)).returning();if(result.length===0){throw new HTTPException(404)}await c.get("search").delete("blog_post",id);await c.get("events").emit("blog.post.deleted",{postId:id,categoryId:result[0].categoryId});return c.body(null,204)}});
|
|
@@ -1,51 +1,55 @@
|
|
|
1
1
|
import { z } from "@hono/zod-openapi";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
2
|
+
export declare const editPostRoute: import("@vitnode/core/api/lib/route").Route<"@vitnode/blog", {
|
|
3
|
+
method: "put";
|
|
4
|
+
path: "/{id}";
|
|
5
|
+
request: {
|
|
6
|
+
params: z.ZodObject<{
|
|
7
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
body: {
|
|
10
|
+
content: {
|
|
11
|
+
"application/json": {
|
|
12
|
+
schema: z.ZodObject<{
|
|
13
|
+
title: z.ZodArray<z.ZodObject<{
|
|
14
|
+
languageCode: z.ZodString;
|
|
15
|
+
value: z.ZodString;
|
|
16
|
+
}, z.core.$strip>>;
|
|
17
|
+
content: z.ZodArray<z.ZodObject<{
|
|
18
|
+
languageCode: z.ZodString;
|
|
19
|
+
value: z.ZodString;
|
|
20
|
+
}, z.core.$strip>>;
|
|
21
|
+
friendlyUrl: z.ZodArray<z.ZodObject<{
|
|
22
|
+
languageCode: z.ZodString;
|
|
23
|
+
value: z.ZodString;
|
|
24
|
+
}, z.core.$strip>>;
|
|
25
|
+
categoryId: z.ZodNumber;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
18
29
|
};
|
|
19
|
-
};
|
|
20
30
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
responses: {
|
|
32
|
+
200: {
|
|
33
|
+
content: {
|
|
34
|
+
"application/json": {
|
|
35
|
+
schema: z.ZodObject<{
|
|
36
|
+
id: z.ZodNumber;
|
|
37
|
+
categoryId: z.ZodNumber;
|
|
38
|
+
createdAt: z.ZodDate;
|
|
39
|
+
updatedAt: z.ZodDate;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
description: string;
|
|
44
|
+
};
|
|
45
|
+
400: {
|
|
46
|
+
description: string;
|
|
47
|
+
};
|
|
48
|
+
404: {
|
|
49
|
+
description: string;
|
|
35
50
|
};
|
|
36
|
-
};
|
|
37
|
-
description: string;
|
|
38
|
-
};
|
|
39
|
-
400: {
|
|
40
|
-
description: string;
|
|
41
|
-
};
|
|
42
|
-
404: {
|
|
43
|
-
description: string;
|
|
44
51
|
};
|
|
45
|
-
};
|
|
46
52
|
} & {
|
|
47
|
-
|
|
53
|
+
path: string;
|
|
48
54
|
}>;
|
|
49
|
-
//#endregion
|
|
50
|
-
export { editPostRoute };
|
|
51
55
|
//# sourceMappingURL=edit.route.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit.route.d.ts","
|
|
1
|
+
{"version":3,"file":"edit.route.d.ts","sourceRoot":"","sources":["../../../../../../../src/api/modules/admin/posts/routes/edit.route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAyBtC,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiHxB,CAAC"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=edit.route.js.map
|
|
1
|
+
import{z}from"@hono/zod-openapi";import{buildRoute}from"@vitnode/core/api/lib/route";import{core_languages_words}from"@vitnode/core/database/languages";import{and,eq,inArray,ne}from"drizzle-orm";import{HTTPException}from"hono/http-exception";import{CONFIG_PLUGIN}from"../../../../../const.js";import{blog_categories}from"../../../../../database/categories.js";import{blog_posts}from"../../../../../database/posts.js";import{POST_LANG_TABLE,savePostTranslations,slugifyMultiLang}from"../../../../lib/posts-language.js";import{reindexBlogPost}from"../../../../lib/search.js";import{zodCreatePostSchema}from"./create.route.js";const zodPostResponseSchema=z.object({id:z.number(),categoryId:z.number(),createdAt:z.date(),updatedAt:z.date()});export const editPostRoute=buildRoute({pluginId:CONFIG_PLUGIN.pluginId,adminStaffPermission:{module:"posts",permission:"can_edit"},route:{method:"put",path:"/{id}",request:{params:z.object({id:z.string().transform(Number)}),body:{content:{"application/json":{schema:zodCreatePostSchema}}}},responses:{200:{content:{"application/json":{schema:zodPostResponseSchema}},description:"Post updated successfully"},400:{description:"Bad request - Invalid input data"},404:{description:"Post or category not found"}}},handler:async c=>{const{id}=c.req.valid("param");const{title,content,friendlyUrl,categoryId}=c.req.valid("json");const slugFriendlyUrl=slugifyMultiLang(friendlyUrl);const friendlyUrlValues=[...new Set(slugFriendlyUrl.map(item=>item.value).filter(Boolean))];if(friendlyUrlValues.length===0){throw new HTTPException(400,{message:"Friendly URL is required."})}const[existingPost]=await c.get("db").select({id:blog_posts.id}).from(blog_posts).where(eq(blog_posts.id,id)).limit(1);if(!existingPost){throw new HTTPException(404,{message:"Post not found."})}const[category]=await c.get("db").select({id:blog_categories.id}).from(blog_categories).where(eq(blog_categories.id,categoryId)).limit(1);if(!category){throw new HTTPException(404,{message:"Category not found."})}const[duplicate]=await c.get("db").select({itemId:core_languages_words.itemId}).from(core_languages_words).where(and(eq(core_languages_words.pluginCode,CONFIG_PLUGIN.pluginId),eq(core_languages_words.tableName,POST_LANG_TABLE),eq(core_languages_words.variable,"friendlyUrl"),inArray(core_languages_words.value,friendlyUrlValues),ne(core_languages_words.itemId,id))).limit(1);if(duplicate){throw new HTTPException(400,{message:"Post with this title already exists."})}const[post]=await c.get("db").update(blog_posts).set({categoryId}).where(eq(blog_posts.id,id)).returning();await savePostTranslations(c,id,{title,content,friendlyUrl});await reindexBlogPost(c,post);await c.get("events").emit("blog.post.updated",{postId:post.id,categoryId:post.categoryId});return c.json(post)}});
|