@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,75 @@
|
|
|
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
|
-
|
|
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;
|
|
40
46
|
};
|
|
41
|
-
};
|
|
42
|
-
description: string;
|
|
43
47
|
};
|
|
44
|
-
};
|
|
45
48
|
} & {
|
|
46
|
-
|
|
49
|
+
path: string;
|
|
47
50
|
}>, import("@vitnode/core/api/lib/route").Route<"@vitnode/blog", {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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;
|
|
56
62
|
};
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
201: {
|
|
64
|
+
content: {
|
|
65
|
+
"text/plain": {
|
|
66
|
+
schema: import("zod").ZodString;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
description: string;
|
|
64
70
|
};
|
|
65
|
-
};
|
|
66
|
-
description: string;
|
|
67
71
|
};
|
|
68
|
-
};
|
|
69
72
|
} & {
|
|
70
|
-
|
|
73
|
+
path: string;
|
|
71
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>[]>[]>;
|
|
72
|
-
//#endregion
|
|
73
|
-
export { categoriesModule };
|
|
74
75
|
//# sourceMappingURL=categories.module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"categories.module.d.ts","
|
|
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,2 +1 @@
|
|
|
1
|
-
import{CONFIG_PLUGIN
|
|
2
|
-
//# sourceMappingURL=categories.module.js.map
|
|
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,51 +1,62 @@
|
|
|
1
1
|
import { z } from "@hono/zod-openapi";
|
|
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
|
-
|
|
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;
|
|
41
57
|
};
|
|
42
|
-
};
|
|
43
|
-
description: string;
|
|
44
58
|
};
|
|
45
|
-
};
|
|
46
59
|
} & {
|
|
47
|
-
|
|
60
|
+
path: string;
|
|
48
61
|
}>;
|
|
49
|
-
//#endregion
|
|
50
|
-
export { categoriesRoute };
|
|
51
62
|
//# 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/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,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_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,30 +1,27 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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;
|
|
12
14
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
201: {
|
|
16
|
+
content: {
|
|
17
|
+
"text/plain": {
|
|
18
|
+
schema: z.ZodString;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
description: string;
|
|
20
22
|
};
|
|
21
|
-
};
|
|
22
|
-
description: string;
|
|
23
23
|
};
|
|
24
|
-
};
|
|
25
24
|
} & {
|
|
26
|
-
|
|
25
|
+
path: string;
|
|
27
26
|
}>;
|
|
28
|
-
//#endregion
|
|
29
|
-
export { testRoute };
|
|
30
27
|
//# sourceMappingURL=test.route.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.route.d.ts","
|
|
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,2 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=test.route.js.map
|
|
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,59 +1,73 @@
|
|
|
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
|
-
|
|
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;
|
|
49
68
|
};
|
|
50
|
-
};
|
|
51
|
-
description: string;
|
|
52
69
|
};
|
|
53
|
-
};
|
|
54
70
|
} & {
|
|
55
|
-
|
|
71
|
+
path: string;
|
|
56
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>[]>[]>;
|
|
57
|
-
//#endregion
|
|
58
|
-
export { postsModule };
|
|
59
73
|
//# sourceMappingURL=posts.module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"posts.module.d.ts","
|
|
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,2 +1 @@
|
|
|
1
|
-
import{CONFIG_PLUGIN
|
|
2
|
-
//# sourceMappingURL=posts.module.js.map
|
|
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]});
|