@vitnode/blog 1.2.0-canary.78 → 2.0.0-canary.10
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/admin/content.d.ts +5 -0
- package/dist/src/admin/content.d.ts.map +1 -0
- package/dist/src/admin/content.js +1 -0
- package/dist/src/admin/nav.d.ts +41 -0
- package/dist/src/admin/nav.d.ts.map +1 -0
- package/dist/src/admin/nav.js +1 -0
- package/dist/src/api/lib/events.d.ts +11 -3
- package/dist/src/api/lib/events.d.ts.map +1 -1
- package/dist/src/api/lib/events.js +1 -1
- package/dist/src/api/modules/admin/admin.module.d.ts +1 -218
- package/dist/src/api/modules/admin/admin.module.d.ts.map +1 -1
- package/dist/src/api/modules/admin/admin.module.js +1 -1
- package/dist/src/config.api.d.ts.map +1 -1
- package/dist/src/config.api.js +1 -1
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/config.js +1 -1
- package/dist/src/content/category.d.ts +5 -0
- package/dist/src/content/category.d.ts.map +1 -0
- package/dist/src/content/category.js +1 -0
- package/dist/src/content/post.d.ts +10 -0
- package/dist/src/content/post.d.ts.map +1 -0
- package/dist/src/content/post.js +1 -0
- package/dist/src/database/categories.d.ts +10 -77
- package/dist/src/database/categories.d.ts.map +1 -1
- package/dist/src/database/categories.js +1 -1
- package/dist/src/database/posts.d.ts +22 -92
- package/dist/src/database/posts.d.ts.map +1 -1
- package/dist/src/database/posts.js +1 -1
- package/dist/src/globals.css +1 -0
- package/dist/src/locales/en.json +50 -73
- package/dist/src/locales/index.d.ts.map +1 -1
- package/dist/src/locales/index.js +1 -1
- package/dist/src/locales/pl.json +69 -0
- package/dist/src/views/admin/article/editor-field.d.ts +4 -0
- package/dist/src/views/admin/article/editor-field.d.ts.map +1 -0
- package/dist/src/views/admin/article/editor-field.js +1 -0
- package/dist/src/views/admin/article/form-layout.d.ts +3 -0
- package/dist/src/views/admin/article/form-layout.d.ts.map +1 -0
- package/dist/src/views/admin/article/form-layout.js +1 -0
- package/dist/src/views/admin/category/color-cell.d.ts +4 -0
- package/dist/src/views/admin/category/color-cell.d.ts.map +1 -0
- package/dist/src/views/admin/category/color-cell.js +1 -0
- package/dist/src/views/admin/category/color-field.d.ts +3 -0
- package/dist/src/views/admin/category/color-field.d.ts.map +1 -0
- package/dist/src/views/admin/category/color-field.js +1 -0
- package/dist/vitest.config.d.ts +3 -0
- package/dist/vitest.config.d.ts.map +1 -0
- package/package.json +32 -25
- package/src/locales/en.json +50 -73
- package/src/locales/index.ts +1 -0
- package/src/locales/pl.json +69 -0
- package/tsconfig.build.json +6 -1
- package/dist/src/api/lib/categories-language.d.ts +0 -10
- package/dist/src/api/lib/categories-language.d.ts.map +0 -1
- package/dist/src/api/lib/categories-language.js +0 -1
- package/dist/src/api/lib/posts-language.d.ts +0 -17
- package/dist/src/api/lib/posts-language.d.ts.map +0 -1
- package/dist/src/api/lib/posts-language.js +0 -1
- package/dist/src/api/lib/search.d.ts +0 -13
- package/dist/src/api/lib/search.d.ts.map +0 -1
- package/dist/src/api/lib/search.js +0 -1
- package/dist/src/api/modules/admin/categories/categories.admin.module.d.ts +0 -100
- package/dist/src/api/modules/admin/categories/categories.admin.module.d.ts.map +0 -1
- package/dist/src/api/modules/admin/categories/categories.admin.module.js +0 -1
- package/dist/src/api/modules/admin/categories/routes/create.route.d.ts +0 -47
- package/dist/src/api/modules/admin/categories/routes/create.route.d.ts.map +0 -1
- package/dist/src/api/modules/admin/categories/routes/create.route.js +0 -1
- package/dist/src/api/modules/admin/categories/routes/delete.route.d.ts +0 -21
- package/dist/src/api/modules/admin/categories/routes/delete.route.d.ts.map +0 -1
- package/dist/src/api/modules/admin/categories/routes/delete.route.js +0 -1
- package/dist/src/api/modules/admin/categories/routes/edit.route.d.ts +0 -46
- package/dist/src/api/modules/admin/categories/routes/edit.route.d.ts.map +0 -1
- package/dist/src/api/modules/admin/categories/routes/edit.route.js +0 -1
- package/dist/src/api/modules/admin/posts/posts.admin.module.d.ts +0 -121
- package/dist/src/api/modules/admin/posts/posts.admin.module.d.ts.map +0 -1
- package/dist/src/api/modules/admin/posts/posts.admin.module.js +0 -1
- package/dist/src/api/modules/admin/posts/routes/create.route.d.ts +0 -67
- package/dist/src/api/modules/admin/posts/routes/create.route.d.ts.map +0 -1
- package/dist/src/api/modules/admin/posts/routes/create.route.js +0 -1
- package/dist/src/api/modules/admin/posts/routes/delete.route.d.ts +0 -21
- package/dist/src/api/modules/admin/posts/routes/delete.route.d.ts.map +0 -1
- package/dist/src/api/modules/admin/posts/routes/delete.route.js +0 -1
- package/dist/src/api/modules/admin/posts/routes/edit.route.d.ts +0 -55
- package/dist/src/api/modules/admin/posts/routes/edit.route.d.ts.map +0 -1
- package/dist/src/api/modules/admin/posts/routes/edit.route.js +0 -1
- package/dist/src/api/modules/categories/categories.module.d.ts +0 -75
- package/dist/src/api/modules/categories/categories.module.d.ts.map +0 -1
- package/dist/src/api/modules/categories/categories.module.js +0 -1
- package/dist/src/api/modules/categories/routes/get.route.d.ts +0 -62
- package/dist/src/api/modules/categories/routes/get.route.d.ts.map +0 -1
- package/dist/src/api/modules/categories/routes/get.route.js +0 -1
- package/dist/src/api/modules/categories/test.route.d.ts +0 -27
- package/dist/src/api/modules/categories/test.route.d.ts.map +0 -1
- package/dist/src/api/modules/categories/test.route.js +0 -1
- package/dist/src/api/modules/posts/posts.module.d.ts +0 -73
- package/dist/src/api/modules/posts/posts.module.d.ts.map +0 -1
- package/dist/src/api/modules/posts/posts.module.js +0 -1
- package/dist/src/api/modules/posts/routes/get.route.d.ts +0 -105
- package/dist/src/api/modules/posts/routes/get.route.d.ts.map +0 -1
- package/dist/src/api/modules/posts/routes/get.route.js +0 -1
- package/dist/src/database/index.d.ts +0 -4
- package/dist/src/database/index.d.ts.map +0 -1
- package/dist/src/database/index.js +0 -1
- package/dist/src/database/relations.d.ts +0 -7
- package/dist/src/database/relations.d.ts.map +0 -1
- package/dist/src/database/relations.js +0 -1
- package/dist/src/routes/admin/blog/categories/page.d.ts +0 -9
- package/dist/src/routes/admin/blog/categories/page.d.ts.map +0 -1
- package/dist/src/routes/admin/blog/categories/page.js +0 -1
- package/dist/src/routes/admin/blog/posts/page.d.ts +0 -9
- package/dist/src/routes/admin/blog/posts/page.d.ts.map +0 -1
- package/dist/src/routes/admin/blog/posts/page.js +0 -1
- package/dist/src/routes/breadcrumb/admin/blog/categories/page.d.ts +0 -2
- package/dist/src/routes/breadcrumb/admin/blog/categories/page.d.ts.map +0 -1
- package/dist/src/routes/breadcrumb/admin/blog/categories/page.js +0 -1
- package/dist/src/routes/breadcrumb/admin/blog/posts/page.d.ts +0 -2
- package/dist/src/routes/breadcrumb/admin/blog/posts/page.d.ts.map +0 -1
- package/dist/src/routes/breadcrumb/admin/blog/posts/page.js +0 -1
- package/dist/src/views/admin/categories/actions/actions.d.ts +0 -3
- package/dist/src/views/admin/categories/actions/actions.d.ts.map +0 -1
- package/dist/src/views/admin/categories/actions/actions.js +0 -1
- package/dist/src/views/admin/categories/actions/create-edit/create-edit.d.ts +0 -8
- package/dist/src/views/admin/categories/actions/create-edit/create-edit.d.ts.map +0 -1
- package/dist/src/views/admin/categories/actions/create-edit/create-edit.js +0 -1
- package/dist/src/views/admin/categories/actions/create-edit/mutation-api.server.d.ts +0 -11
- package/dist/src/views/admin/categories/actions/create-edit/mutation-api.server.d.ts.map +0 -1
- package/dist/src/views/admin/categories/actions/create-edit/mutation-api.server.js +0 -1
- package/dist/src/views/admin/categories/table/actions/delete/delete-action.d.ts +0 -5
- package/dist/src/views/admin/categories/table/actions/delete/delete-action.d.ts.map +0 -1
- package/dist/src/views/admin/categories/table/actions/delete/delete-action.js +0 -1
- package/dist/src/views/admin/categories/table/actions/delete/mutation-api.server.d.ts +0 -4
- package/dist/src/views/admin/categories/table/actions/delete/mutation-api.server.d.ts.map +0 -1
- package/dist/src/views/admin/categories/table/actions/delete/mutation-api.server.js +0 -1
- package/dist/src/views/admin/categories/table/actions/edit-action.d.ts +0 -9
- package/dist/src/views/admin/categories/table/actions/edit-action.d.ts.map +0 -1
- package/dist/src/views/admin/categories/table/actions/edit-action.js +0 -1
- package/dist/src/views/admin/categories/table/categories-admin-view.d.ts +0 -4
- package/dist/src/views/admin/categories/table/categories-admin-view.d.ts.map +0 -1
- package/dist/src/views/admin/categories/table/categories-admin-view.js +0 -1
- package/dist/src/views/admin/posts/actions/actions.d.ts +0 -3
- package/dist/src/views/admin/posts/actions/actions.d.ts.map +0 -1
- package/dist/src/views/admin/posts/actions/actions.js +0 -1
- package/dist/src/views/admin/posts/actions/create-edit/create-edit.d.ts +0 -9
- package/dist/src/views/admin/posts/actions/create-edit/create-edit.d.ts.map +0 -1
- package/dist/src/views/admin/posts/actions/create-edit/create-edit.js +0 -1
- package/dist/src/views/admin/posts/actions/create-edit/multi-lang-fields.d.ts +0 -10
- package/dist/src/views/admin/posts/actions/create-edit/multi-lang-fields.d.ts.map +0 -1
- package/dist/src/views/admin/posts/actions/create-edit/multi-lang-fields.js +0 -1
- package/dist/src/views/admin/posts/actions/create-edit/mutation-api.server.d.ts +0 -11
- package/dist/src/views/admin/posts/actions/create-edit/mutation-api.server.d.ts.map +0 -1
- package/dist/src/views/admin/posts/actions/create-edit/mutation-api.server.js +0 -1
- package/dist/src/views/admin/posts/table/actions/delete/delete-action.d.ts +0 -5
- package/dist/src/views/admin/posts/table/actions/delete/delete-action.d.ts.map +0 -1
- package/dist/src/views/admin/posts/table/actions/delete/delete-action.js +0 -1
- package/dist/src/views/admin/posts/table/actions/delete/mutation-api.server.d.ts +0 -4
- package/dist/src/views/admin/posts/table/actions/delete/mutation-api.server.d.ts.map +0 -1
- package/dist/src/views/admin/posts/table/actions/delete/mutation-api.server.js +0 -1
- package/dist/src/views/admin/posts/table/actions/edit-action.d.ts +0 -9
- package/dist/src/views/admin/posts/table/actions/edit-action.d.ts.map +0 -1
- package/dist/src/views/admin/posts/table/actions/edit-action.js +0 -1
- package/dist/src/views/admin/posts/table/posts-admin-view.d.ts +0 -4
- package/dist/src/views/admin/posts/table/posts-admin-view.d.ts.map +0 -1
- package/dist/src/views/admin/posts/table/posts-admin-view.js +0 -1
- package/src/routes/admin/blog/categories/page.tsx +0 -64
- package/src/routes/admin/blog/posts/page.tsx +0 -64
- package/src/routes/breadcrumb/admin/blog/categories/page.tsx +0 -5
- package/src/routes/breadcrumb/admin/blog/posts/page.tsx +0 -5
|
@@ -1,121 +0,0 @@
|
|
|
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
|
-
};
|
|
28
|
-
};
|
|
29
|
-
};
|
|
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;
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
} & {
|
|
52
|
-
path: string;
|
|
53
|
-
}>, import("@vitnode/core/api/lib/route").Route<"@vitnode/blog", {
|
|
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
|
-
};
|
|
77
|
-
};
|
|
78
|
-
};
|
|
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;
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
|
-
} & {
|
|
101
|
-
path: string;
|
|
102
|
-
}>, import("@vitnode/core/api/lib/route").Route<"@vitnode/blog", {
|
|
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>;
|
|
109
|
-
};
|
|
110
|
-
responses: {
|
|
111
|
-
204: {
|
|
112
|
-
description: string;
|
|
113
|
-
};
|
|
114
|
-
404: {
|
|
115
|
-
description: string;
|
|
116
|
-
};
|
|
117
|
-
};
|
|
118
|
-
} & {
|
|
119
|
-
path: string;
|
|
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>[]>[]>;
|
|
121
|
-
//# sourceMappingURL=posts.admin.module.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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,67 +0,0 @@
|
|
|
1
|
-
import { z } from "@hono/zod-openapi";
|
|
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;
|
|
16
|
-
}, z.core.$strip>;
|
|
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
|
-
};
|
|
41
|
-
};
|
|
42
|
-
};
|
|
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;
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
} & {
|
|
65
|
-
path: string;
|
|
66
|
-
}>;
|
|
67
|
-
//# sourceMappingURL=create.route.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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,21 +0,0 @@
|
|
|
1
|
-
import { z } from "@hono/zod-openapi";
|
|
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>;
|
|
9
|
-
};
|
|
10
|
-
responses: {
|
|
11
|
-
204: {
|
|
12
|
-
description: string;
|
|
13
|
-
};
|
|
14
|
-
404: {
|
|
15
|
-
description: string;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
} & {
|
|
19
|
-
path: string;
|
|
20
|
-
}>;
|
|
21
|
-
//# sourceMappingURL=delete.route.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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,55 +0,0 @@
|
|
|
1
|
-
import { z } from "@hono/zod-openapi";
|
|
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
|
-
};
|
|
29
|
-
};
|
|
30
|
-
};
|
|
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;
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
} & {
|
|
53
|
-
path: string;
|
|
54
|
-
}>;
|
|
55
|
-
//# sourceMappingURL=edit.route.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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)}});
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
export declare const categoriesModule: import("@vitnode/core/api/lib/module").BuildModuleReturn<"@vitnode/blog", "categories", [import("@vitnode/core/api/lib/route").Route<"@vitnode/blog", {
|
|
2
|
-
method: "get";
|
|
3
|
-
path: "/";
|
|
4
|
-
request: {
|
|
5
|
-
query: import("zod").ZodObject<{
|
|
6
|
-
cursor: import("zod").ZodOptional<import("zod").ZodString>;
|
|
7
|
-
first: import("zod").ZodOptional<import("zod").ZodString>;
|
|
8
|
-
last: import("zod").ZodOptional<import("zod").ZodString>;
|
|
9
|
-
order: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
10
|
-
asc: "asc";
|
|
11
|
-
desc: "desc";
|
|
12
|
-
}>>;
|
|
13
|
-
orderBy: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
14
|
-
updatedAt: "updatedAt";
|
|
15
|
-
}>>;
|
|
16
|
-
search: import("zod").ZodOptional<import("zod").ZodString>;
|
|
17
|
-
}, import("zod/v4/core").$strip>;
|
|
18
|
-
};
|
|
19
|
-
responses: {
|
|
20
|
-
200: {
|
|
21
|
-
content: {
|
|
22
|
-
"application/json": {
|
|
23
|
-
schema: import("zod").ZodObject<{
|
|
24
|
-
edges: import("zod").ZodArray<import("zod").ZodObject<{
|
|
25
|
-
id: import("zod").ZodNumber;
|
|
26
|
-
titleTranslations: import("zod").ZodArray<import("zod").ZodObject<{
|
|
27
|
-
languageCode: import("zod").ZodString;
|
|
28
|
-
value: import("zod").ZodString;
|
|
29
|
-
}, import("zod/v4/core").$strip>>;
|
|
30
|
-
color: import("zod").ZodNullable<import("zod").ZodString>;
|
|
31
|
-
createdAt: import("zod").ZodDate;
|
|
32
|
-
updatedAt: import("zod").ZodDate;
|
|
33
|
-
}, import("zod/v4/core").$strip>>;
|
|
34
|
-
pageInfo: import("zod").ZodObject<{
|
|
35
|
-
totalCount: import("zod").ZodNumber;
|
|
36
|
-
count: import("zod").ZodNumber;
|
|
37
|
-
hasNextPage: import("zod").ZodBoolean;
|
|
38
|
-
hasPreviousPage: import("zod").ZodBoolean;
|
|
39
|
-
startCursor: import("zod").ZodNullable<import("zod").ZodNumber>;
|
|
40
|
-
endCursor: import("zod").ZodNullable<import("zod").ZodNumber>;
|
|
41
|
-
}, import("zod/v4/core").$strip>;
|
|
42
|
-
}, import("zod/v4/core").$strip>;
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
description: string;
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
} & {
|
|
49
|
-
path: string;
|
|
50
|
-
}>, import("@vitnode/core/api/lib/route").Route<"@vitnode/blog", {
|
|
51
|
-
method: "post";
|
|
52
|
-
description: string;
|
|
53
|
-
path: "/test";
|
|
54
|
-
responses: {
|
|
55
|
-
200: {
|
|
56
|
-
content: {
|
|
57
|
-
"text/plain": {
|
|
58
|
-
schema: import("zod").ZodString;
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
description: string;
|
|
62
|
-
};
|
|
63
|
-
201: {
|
|
64
|
-
content: {
|
|
65
|
-
"text/plain": {
|
|
66
|
-
schema: import("zod").ZodString;
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
description: string;
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
} & {
|
|
73
|
-
path: string;
|
|
74
|
-
}>], import("@vitnode/core/api/lib/module").BaseBuildModuleReturn<"@vitnode/blog", string, import("@vitnode/core/api/lib/route").Route<"@vitnode/blog", import("@hono/zod-openapi").RouteConfig>[]>[]>;
|
|
75
|
-
//# sourceMappingURL=categories.module.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"categories.module.d.ts","sourceRoot":"","sources":["../../../../../src/api/modules/categories/categories.module.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sMAI3B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{buildModule}from"@vitnode/core/api/lib/module";import{CONFIG_PLUGIN}from"../../../const.js";import{categoriesRoute}from"./routes/get.route.js";import{testRoute}from"./test.route.js";export const categoriesModule=buildModule({pluginId:CONFIG_PLUGIN.pluginId,name:"categories",routes:[categoriesRoute,testRoute]});
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { z } from "@hono/zod-openapi";
|
|
2
|
-
export declare const zodCategorySchema: z.ZodObject<{
|
|
3
|
-
id: z.ZodNumber;
|
|
4
|
-
titleTranslations: z.ZodArray<z.ZodObject<{
|
|
5
|
-
languageCode: z.ZodString;
|
|
6
|
-
value: z.ZodString;
|
|
7
|
-
}, z.core.$strip>>;
|
|
8
|
-
color: z.ZodNullable<z.ZodString>;
|
|
9
|
-
createdAt: z.ZodDate;
|
|
10
|
-
updatedAt: z.ZodDate;
|
|
11
|
-
}, z.core.$strip>;
|
|
12
|
-
export declare const categoriesRoute: import("@vitnode/core/api/lib/route").Route<"@vitnode/blog", {
|
|
13
|
-
method: "get";
|
|
14
|
-
path: "/";
|
|
15
|
-
request: {
|
|
16
|
-
query: z.ZodObject<{
|
|
17
|
-
cursor: z.ZodOptional<z.ZodString>;
|
|
18
|
-
first: z.ZodOptional<z.ZodString>;
|
|
19
|
-
last: z.ZodOptional<z.ZodString>;
|
|
20
|
-
order: z.ZodOptional<z.ZodEnum<{
|
|
21
|
-
asc: "asc";
|
|
22
|
-
desc: "desc";
|
|
23
|
-
}>>;
|
|
24
|
-
orderBy: z.ZodOptional<z.ZodEnum<{
|
|
25
|
-
updatedAt: "updatedAt";
|
|
26
|
-
}>>;
|
|
27
|
-
search: z.ZodOptional<z.ZodString>;
|
|
28
|
-
}, z.core.$strip>;
|
|
29
|
-
};
|
|
30
|
-
responses: {
|
|
31
|
-
200: {
|
|
32
|
-
content: {
|
|
33
|
-
"application/json": {
|
|
34
|
-
schema: z.ZodObject<{
|
|
35
|
-
edges: z.ZodArray<z.ZodObject<{
|
|
36
|
-
id: z.ZodNumber;
|
|
37
|
-
titleTranslations: z.ZodArray<z.ZodObject<{
|
|
38
|
-
languageCode: z.ZodString;
|
|
39
|
-
value: z.ZodString;
|
|
40
|
-
}, z.core.$strip>>;
|
|
41
|
-
color: z.ZodNullable<z.ZodString>;
|
|
42
|
-
createdAt: z.ZodDate;
|
|
43
|
-
updatedAt: z.ZodDate;
|
|
44
|
-
}, z.core.$strip>>;
|
|
45
|
-
pageInfo: z.ZodObject<{
|
|
46
|
-
totalCount: z.ZodNumber;
|
|
47
|
-
count: z.ZodNumber;
|
|
48
|
-
hasNextPage: z.ZodBoolean;
|
|
49
|
-
hasPreviousPage: z.ZodBoolean;
|
|
50
|
-
startCursor: z.ZodNullable<z.ZodNumber>;
|
|
51
|
-
endCursor: z.ZodNullable<z.ZodNumber>;
|
|
52
|
-
}, z.core.$strip>;
|
|
53
|
-
}, z.core.$strip>;
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
description: string;
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
} & {
|
|
60
|
-
path: string;
|
|
61
|
-
}>;
|
|
62
|
-
//# sourceMappingURL=get.route.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get.route.d.ts","sourceRoot":"","sources":["../../../../../../src/api/modules/categories/routes/get.route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAsBtC,eAAO,MAAM,iBAAiB;;;;;;;;;iBAQ5B,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiG1B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
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_languages_words}from"@vitnode/core/database/languages";import{multiLangValueSchema}from"@vitnode/core/lib/helpers/multi-lang";import{and,eq,ilike,inArray}from"drizzle-orm";import{CONFIG_PLUGIN}from"../../../../const.js";import{blog_categories}from"../../../../database/categories.js";import{CATEGORY_LANG_TABLE,CATEGORY_LANG_VARIABLE,loadCategoryTranslations}from"../../../lib/categories-language.js";const zodMultiLangValue=multiLangValueSchema();export const zodCategorySchema=z.object({id:z.number(),titleTranslations:zodMultiLangValue,color:z.string().nullable(),createdAt:z.date(),updatedAt:z.date()});export const categoriesRoute=buildRoute({pluginId:CONFIG_PLUGIN.pluginId,route:{method:"get",path:"/",request:{query:zodPaginationQuery.extend({order:z.enum(["asc","desc"]).optional(),orderBy:z.enum(["updatedAt"]).optional(),search:z.string().optional()})},responses:{200:{content:{"application/json":{schema:z.object({edges:z.array(zodCategorySchema),pageInfo:zodPaginationPageInfo})}},description:"Categories retrieved successfully"}}},handler:async c=>{const query=c.req.valid("query");const data=await withPagination({c,params:{query},primaryCursor:blog_categories.id,query:async({limit,where,orderBy})=>{const searchCondition=query.search?inArray(blog_categories.id,c.get("db").select({id:core_languages_words.itemId}).from(core_languages_words).where(and(eq(core_languages_words.pluginCode,CONFIG_PLUGIN.pluginId),eq(core_languages_words.tableName,CATEGORY_LANG_TABLE),eq(core_languages_words.variable,CATEGORY_LANG_VARIABLE),ilike(core_languages_words.value,`%${query.search}%`)))):undefined;let combinedWhere;if(searchCondition){if(where){combinedWhere=and(where,searchCondition)}else{combinedWhere=searchCondition}}else{combinedWhere=where}return await c.get("db").select().from(blog_categories).where(combinedWhere).orderBy(orderBy).limit(limit)},table:blog_categories,orderBy:{column:query.orderBy?blog_categories[query.orderBy]:blog_categories.updatedAt,order:query.order??"desc"}});const translations=await loadCategoryTranslations(c,data.edges.map(edge=>edge.id));return c.json({...data,edges:data.edges.map(edge=>({...edge,titleTranslations:translations.get(edge.id)??[]}))})}});
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const testRoute: import("@vitnode/core/api/lib/route").Route<"@vitnode/blog", {
|
|
3
|
-
method: "post";
|
|
4
|
-
description: string;
|
|
5
|
-
path: "/test";
|
|
6
|
-
responses: {
|
|
7
|
-
200: {
|
|
8
|
-
content: {
|
|
9
|
-
"text/plain": {
|
|
10
|
-
schema: z.ZodString;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
description: string;
|
|
14
|
-
};
|
|
15
|
-
201: {
|
|
16
|
-
content: {
|
|
17
|
-
"text/plain": {
|
|
18
|
-
schema: z.ZodString;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
description: string;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
} & {
|
|
25
|
-
path: string;
|
|
26
|
-
}>;
|
|
27
|
-
//# sourceMappingURL=test.route.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test.route.d.ts","sourceRoot":"","sources":["../../../../../src/api/modules/categories/test.route.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;EA2CpB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{buildRoute}from"@vitnode/core/api/lib/route";import{UserModel}from"@vitnode/core/api/models/user";import{z}from"zod";import{CONFIG_PLUGIN}from"../../../const.js";import TestTemplateEmail from"../../../emails/test-template.js";export const testRoute=buildRoute({pluginId:CONFIG_PLUGIN.pluginId,route:{method:"post",description:"Test route",path:"/test",responses:{200:{content:{"text/plain":{schema:z.string()}},description:"User"},201:{content:{"text/plain":{schema:z.string()}},description:"User"}}},handler:async c=>{const user=await new UserModel().getUserById({id:2,c});if(!user)throw new Error("User not found");await c.get("email").send({subject:"Test Email",content:TestTemplateEmail,user});await c.get("log").warn("This is a test warn log");return c.text("test")}});
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
export declare const postsModule: import("@vitnode/core/api/lib/module").BuildModuleReturn<"@vitnode/blog", "posts", [import("@vitnode/core/api/lib/route").Route<"@vitnode/blog", {
|
|
2
|
-
method: "get";
|
|
3
|
-
path: "/";
|
|
4
|
-
request: {
|
|
5
|
-
query: import("zod").ZodObject<{
|
|
6
|
-
cursor: import("zod").ZodOptional<import("zod").ZodString>;
|
|
7
|
-
first: import("zod").ZodOptional<import("zod").ZodString>;
|
|
8
|
-
last: import("zod").ZodOptional<import("zod").ZodString>;
|
|
9
|
-
order: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
10
|
-
asc: "asc";
|
|
11
|
-
desc: "desc";
|
|
12
|
-
}>>;
|
|
13
|
-
orderBy: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
14
|
-
createdAt: "createdAt";
|
|
15
|
-
updatedAt: "updatedAt";
|
|
16
|
-
}>>;
|
|
17
|
-
categoryId: import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<number, string>>>;
|
|
18
|
-
}, import("zod/v4/core").$strip>;
|
|
19
|
-
};
|
|
20
|
-
responses: {
|
|
21
|
-
200: {
|
|
22
|
-
content: {
|
|
23
|
-
"application/json": {
|
|
24
|
-
schema: import("zod").ZodObject<{
|
|
25
|
-
edges: import("zod").ZodArray<import("zod").ZodObject<{
|
|
26
|
-
id: import("zod").ZodNumber;
|
|
27
|
-
titleTranslations: import("zod").ZodArray<import("zod").ZodObject<{
|
|
28
|
-
languageCode: import("zod").ZodString;
|
|
29
|
-
value: import("zod").ZodString;
|
|
30
|
-
}, import("zod/v4/core").$strip>>;
|
|
31
|
-
contentTranslations: import("zod").ZodArray<import("zod").ZodObject<{
|
|
32
|
-
languageCode: import("zod").ZodString;
|
|
33
|
-
value: import("zod").ZodString;
|
|
34
|
-
}, import("zod/v4/core").$strip>>;
|
|
35
|
-
friendlyUrlTranslations: import("zod").ZodArray<import("zod").ZodObject<{
|
|
36
|
-
languageCode: import("zod").ZodString;
|
|
37
|
-
value: import("zod").ZodString;
|
|
38
|
-
}, import("zod/v4/core").$strip>>;
|
|
39
|
-
categoryId: import("zod").ZodNumber;
|
|
40
|
-
createdAt: import("zod").ZodDate;
|
|
41
|
-
updatedAt: import("zod").ZodDate;
|
|
42
|
-
category: import("zod").ZodObject<{
|
|
43
|
-
id: import("zod").ZodNumber;
|
|
44
|
-
titleTranslations: import("zod").ZodArray<import("zod").ZodObject<{
|
|
45
|
-
languageCode: import("zod").ZodString;
|
|
46
|
-
value: import("zod").ZodString;
|
|
47
|
-
}, import("zod/v4/core").$strip>>;
|
|
48
|
-
}, import("zod/v4/core").$strip>;
|
|
49
|
-
author: import("zod").ZodNullable<import("zod").ZodObject<{
|
|
50
|
-
id: import("zod").ZodNumber;
|
|
51
|
-
name: import("zod").ZodString;
|
|
52
|
-
nameCode: import("zod").ZodString;
|
|
53
|
-
avatarColor: import("zod").ZodString;
|
|
54
|
-
}, import("zod/v4/core").$strip>>;
|
|
55
|
-
}, import("zod/v4/core").$strip>>;
|
|
56
|
-
pageInfo: import("zod").ZodObject<{
|
|
57
|
-
totalCount: import("zod").ZodNumber;
|
|
58
|
-
count: import("zod").ZodNumber;
|
|
59
|
-
hasNextPage: import("zod").ZodBoolean;
|
|
60
|
-
hasPreviousPage: import("zod").ZodBoolean;
|
|
61
|
-
startCursor: import("zod").ZodNullable<import("zod").ZodNumber>;
|
|
62
|
-
endCursor: import("zod").ZodNullable<import("zod").ZodNumber>;
|
|
63
|
-
}, import("zod/v4/core").$strip>;
|
|
64
|
-
}, import("zod/v4/core").$strip>;
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
description: string;
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
} & {
|
|
71
|
-
path: string;
|
|
72
|
-
}>], import("@vitnode/core/api/lib/module").BaseBuildModuleReturn<"@vitnode/blog", string, import("@vitnode/core/api/lib/route").Route<"@vitnode/blog", import("@hono/zod-openapi").RouteConfig>[]>[]>;
|
|
73
|
-
//# sourceMappingURL=posts.module.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"posts.module.d.ts","sourceRoot":"","sources":["../../../../../src/api/modules/posts/posts.module.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sMAItB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{buildModule}from"@vitnode/core/api/lib/module";import{CONFIG_PLUGIN}from"../../../const.js";import{postsRoute}from"./routes/get.route.js";export const postsModule=buildModule({pluginId:CONFIG_PLUGIN.pluginId,name:"posts",routes:[postsRoute]});
|