@vitnode/blog 1.2.0-canary.17 → 1.2.0-canary.19
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/modules/categories/categories.module.d.ts +343 -0
- package/dist/src/api/modules/categories/categories.module.d.ts.map +1 -0
- package/dist/src/api/modules/categories/categories.module.js +1 -0
- package/dist/src/api/modules/categories/routes/create.route.d.ts +79 -0
- package/dist/src/api/modules/categories/routes/create.route.d.ts.map +1 -0
- package/dist/src/api/modules/categories/routes/create.route.js +1 -0
- package/dist/src/api/modules/categories/routes/delete.route.d.ts +40 -0
- package/dist/src/api/modules/categories/routes/delete.route.d.ts.map +1 -0
- package/dist/src/api/modules/categories/routes/delete.route.js +1 -0
- package/dist/src/api/modules/categories/routes/edit.route.d.ts +100 -0
- package/dist/src/api/modules/categories/routes/edit.route.d.ts.map +1 -0
- package/dist/src/api/modules/categories/routes/edit.route.js +1 -0
- package/dist/src/api/modules/categories/routes/get.route.d.ts +148 -0
- package/dist/src/api/modules/categories/routes/get.route.d.ts.map +1 -0
- package/dist/src/api/modules/categories/routes/get.route.js +1 -0
- package/dist/src/api/modules/posts/posts.module.d.ts +448 -0
- package/dist/src/api/modules/posts/posts.module.d.ts.map +1 -0
- package/dist/src/api/modules/posts/posts.module.js +1 -0
- package/dist/src/api/modules/posts/routes/create.route.d.ts +109 -0
- package/dist/src/api/modules/posts/routes/create.route.d.ts.map +1 -0
- package/dist/src/api/modules/posts/routes/create.route.js +1 -0
- package/dist/src/api/modules/posts/routes/delete.route.d.ts +40 -0
- package/dist/src/api/modules/posts/routes/delete.route.d.ts.map +1 -0
- package/dist/src/api/modules/posts/routes/delete.route.js +1 -0
- package/dist/src/api/modules/posts/routes/edit.route.d.ts +127 -0
- package/dist/src/api/modules/posts/routes/edit.route.d.ts.map +1 -0
- package/dist/src/api/modules/posts/routes/edit.route.js +1 -0
- package/dist/src/api/modules/posts/routes/get.route.d.ts +208 -0
- package/dist/src/api/modules/posts/routes/get.route.d.ts.map +1 -0
- package/dist/src/api/modules/posts/routes/get.route.js +1 -0
- package/dist/src/app_admin/blog/categories/page.d.ts +5 -0
- package/dist/src/app_admin/blog/categories/page.d.ts.map +1 -0
- package/dist/src/app_admin/blog/categories/page.js +1 -0
- package/dist/src/config.api.d.ts +2 -0
- package/dist/src/config.api.d.ts.map +1 -0
- package/dist/src/config.api.js +1 -0
- package/dist/src/config.d.ts +4 -0
- package/dist/src/config.d.ts.map +1 -0
- package/dist/src/config.js +1 -0
- package/dist/src/database/categories.d.ts +97 -0
- package/dist/src/database/categories.d.ts.map +1 -0
- package/dist/src/database/categories.js +1 -0
- package/{src/database/index.ts → dist/src/database/index.d.ts} +1 -3
- package/dist/src/database/index.d.ts.map +1 -0
- package/dist/src/database/index.js +1 -0
- package/dist/src/database/posts.d.ts +131 -0
- package/dist/src/database/posts.d.ts.map +1 -0
- package/dist/src/database/posts.js +1 -0
- package/dist/src/database/relations.d.ts +7 -0
- package/dist/src/database/relations.d.ts.map +1 -0
- package/dist/src/database/relations.js +1 -0
- package/dist/src/plugin.d.ts +2 -0
- package/dist/src/plugin.d.ts.map +1 -0
- package/dist/src/plugin.js +1 -0
- package/dist/src/views/admin/categories/actions/actions.d.ts +2 -0
- package/dist/src/views/admin/categories/actions/actions.d.ts.map +1 -0
- package/dist/src/views/admin/categories/actions/actions.js +1 -0
- package/dist/src/views/admin/categories/actions/create-edit/create-edit.d.ts +8 -0
- package/dist/src/views/admin/categories/actions/create-edit/create-edit.d.ts.map +1 -0
- package/dist/src/views/admin/categories/actions/create-edit/create-edit.js +1 -0
- package/dist/src/views/admin/categories/actions/create-edit/mutation-api.d.ts +11 -0
- package/dist/src/views/admin/categories/actions/create-edit/mutation-api.d.ts.map +1 -0
- package/dist/src/views/admin/categories/actions/create-edit/mutation-api.js +1 -0
- package/dist/src/views/admin/categories/categories-admin-view.d.ts +4 -0
- package/dist/src/views/admin/categories/categories-admin-view.d.ts.map +1 -0
- package/dist/src/views/admin/categories/categories-admin-view.js +1 -0
- package/dist/src/views/admin/categories/row-actions/delete/delete-action.d.ts +5 -0
- package/dist/src/views/admin/categories/row-actions/delete/delete-action.d.ts.map +1 -0
- package/dist/src/views/admin/categories/row-actions/delete/delete-action.js +1 -0
- package/dist/src/views/admin/categories/row-actions/delete/mutation-api.d.ts +4 -0
- package/dist/src/views/admin/categories/row-actions/delete/mutation-api.d.ts.map +1 -0
- package/dist/src/views/admin/categories/row-actions/delete/mutation-api.js +1 -0
- package/dist/src/views/admin/categories/row-actions/edit-action.d.ts +9 -0
- package/dist/src/views/admin/categories/row-actions/edit-action.d.ts.map +1 -0
- package/dist/src/views/admin/categories/row-actions/edit-action.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +3 -3
- package/src/database/categories.ts +0 -12
- package/src/database/posts.ts +0 -19
- package/src/database/relations.ts +0 -18
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { z } from '@hono/zod-openapi';
|
|
2
|
+
export declare const categoriesRoute: {
|
|
3
|
+
handler: (c: import("hono").Context<import("@vitnode/core/api/middlewares/global/global").EnvVitNode, "/", {
|
|
4
|
+
in: {
|
|
5
|
+
query: {
|
|
6
|
+
orderBy?: "updatedAt" | undefined;
|
|
7
|
+
cursor?: string | undefined;
|
|
8
|
+
first?: string | undefined;
|
|
9
|
+
last?: string | undefined;
|
|
10
|
+
order?: "asc" | "desc" | undefined;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
out: {
|
|
14
|
+
query: {
|
|
15
|
+
orderBy?: "updatedAt" | undefined;
|
|
16
|
+
cursor?: string | undefined;
|
|
17
|
+
first?: string | undefined;
|
|
18
|
+
last?: string | undefined;
|
|
19
|
+
order?: "asc" | "desc" | undefined;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
}>) => Promise<Response & import("hono").TypedResponse<{
|
|
23
|
+
edges: {
|
|
24
|
+
id: number;
|
|
25
|
+
title: string;
|
|
26
|
+
createdAt: string;
|
|
27
|
+
updatedAt: string;
|
|
28
|
+
titleSeo: string;
|
|
29
|
+
}[];
|
|
30
|
+
pageInfo: {
|
|
31
|
+
count: number;
|
|
32
|
+
endCursor: null | number;
|
|
33
|
+
hasNextPage: boolean;
|
|
34
|
+
hasPreviousPage: boolean;
|
|
35
|
+
startCursor: null | number;
|
|
36
|
+
totalCount: number;
|
|
37
|
+
};
|
|
38
|
+
}, 200, "json">>;
|
|
39
|
+
pluginId: "@vitnode/blog";
|
|
40
|
+
route: {
|
|
41
|
+
method: "get";
|
|
42
|
+
path: "/";
|
|
43
|
+
request: {
|
|
44
|
+
query: z.ZodObject<{
|
|
45
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
46
|
+
first: z.ZodOptional<z.ZodString>;
|
|
47
|
+
last: z.ZodOptional<z.ZodString>;
|
|
48
|
+
} & {
|
|
49
|
+
order: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
|
|
50
|
+
orderBy: z.ZodOptional<z.ZodEnum<["updatedAt"]>>;
|
|
51
|
+
}, "strip", z.ZodTypeAny, {
|
|
52
|
+
orderBy?: "updatedAt" | undefined;
|
|
53
|
+
cursor?: string | undefined;
|
|
54
|
+
first?: string | undefined;
|
|
55
|
+
last?: string | undefined;
|
|
56
|
+
order?: "asc" | "desc" | undefined;
|
|
57
|
+
}, {
|
|
58
|
+
orderBy?: "updatedAt" | undefined;
|
|
59
|
+
cursor?: string | undefined;
|
|
60
|
+
first?: string | undefined;
|
|
61
|
+
last?: string | undefined;
|
|
62
|
+
order?: "asc" | "desc" | undefined;
|
|
63
|
+
}>;
|
|
64
|
+
};
|
|
65
|
+
responses: {
|
|
66
|
+
200: {
|
|
67
|
+
content: {
|
|
68
|
+
'application/json': {
|
|
69
|
+
schema: z.ZodObject<{
|
|
70
|
+
edges: z.ZodArray<z.ZodObject<{
|
|
71
|
+
id: z.ZodNumber;
|
|
72
|
+
title: z.ZodString;
|
|
73
|
+
createdAt: z.ZodDate;
|
|
74
|
+
updatedAt: z.ZodDate;
|
|
75
|
+
}, "strip", z.ZodTypeAny, {
|
|
76
|
+
id: number;
|
|
77
|
+
title: string;
|
|
78
|
+
createdAt: Date;
|
|
79
|
+
updatedAt: Date;
|
|
80
|
+
}, {
|
|
81
|
+
id: number;
|
|
82
|
+
title: string;
|
|
83
|
+
createdAt: Date;
|
|
84
|
+
updatedAt: Date;
|
|
85
|
+
}>, "many">;
|
|
86
|
+
pageInfo: z.ZodObject<{
|
|
87
|
+
totalCount: z.ZodNumber;
|
|
88
|
+
count: z.ZodNumber;
|
|
89
|
+
hasNextPage: z.ZodBoolean;
|
|
90
|
+
hasPreviousPage: z.ZodBoolean;
|
|
91
|
+
startCursor: z.ZodNullable<z.ZodNumber>;
|
|
92
|
+
endCursor: z.ZodNullable<z.ZodNumber>;
|
|
93
|
+
}, "strip", z.ZodTypeAny, {
|
|
94
|
+
count: number;
|
|
95
|
+
totalCount: number;
|
|
96
|
+
hasNextPage: boolean;
|
|
97
|
+
hasPreviousPage: boolean;
|
|
98
|
+
startCursor: number | null;
|
|
99
|
+
endCursor: number | null;
|
|
100
|
+
}, {
|
|
101
|
+
count: number;
|
|
102
|
+
totalCount: number;
|
|
103
|
+
hasNextPage: boolean;
|
|
104
|
+
hasPreviousPage: boolean;
|
|
105
|
+
startCursor: number | null;
|
|
106
|
+
endCursor: number | null;
|
|
107
|
+
}>;
|
|
108
|
+
}, "strip", z.ZodTypeAny, {
|
|
109
|
+
edges: {
|
|
110
|
+
id: number;
|
|
111
|
+
title: string;
|
|
112
|
+
createdAt: Date;
|
|
113
|
+
updatedAt: Date;
|
|
114
|
+
}[];
|
|
115
|
+
pageInfo: {
|
|
116
|
+
count: number;
|
|
117
|
+
totalCount: number;
|
|
118
|
+
hasNextPage: boolean;
|
|
119
|
+
hasPreviousPage: boolean;
|
|
120
|
+
startCursor: number | null;
|
|
121
|
+
endCursor: number | null;
|
|
122
|
+
};
|
|
123
|
+
}, {
|
|
124
|
+
edges: {
|
|
125
|
+
id: number;
|
|
126
|
+
title: string;
|
|
127
|
+
createdAt: Date;
|
|
128
|
+
updatedAt: Date;
|
|
129
|
+
}[];
|
|
130
|
+
pageInfo: {
|
|
131
|
+
count: number;
|
|
132
|
+
totalCount: number;
|
|
133
|
+
hasNextPage: boolean;
|
|
134
|
+
hasPreviousPage: boolean;
|
|
135
|
+
startCursor: number | null;
|
|
136
|
+
endCursor: number | null;
|
|
137
|
+
};
|
|
138
|
+
}>;
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
description: string;
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
} & {
|
|
145
|
+
getRoutingPath: () => "/";
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
//# sourceMappingURL=get.route.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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;AAkBtC,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqD1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
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{CONFIG_PLUGIN}from"../../../../config.js";import{blog_categories}from"../../../../database/categories.js";const zodCategorySchema=z.object({id:z.number(),title:z.string(),createdAt:z.date(),updatedAt:z.date()});export const categoriesRoute=buildRoute({...CONFIG_PLUGIN,route:{method:"get",path:"/",request:{query:zodPaginationQuery.extend({order:z.enum(["asc","desc"]).optional(),orderBy:z.enum(["updatedAt"]).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})=>await c.get("db").select().from(blog_categories).where(where).orderBy(orderBy).limit(limit),table:blog_categories,orderBy:{column:query.orderBy?blog_categories[query.orderBy]:blog_categories.updatedAt,order:query.order??"desc"}});return c.json(data)}});
|
|
@@ -0,0 +1,448 @@
|
|
|
1
|
+
export declare const postsModule: import("@vitnode/core/api/lib/module").BuildModuleReturn<"@vitnode/blog", "posts", [{
|
|
2
|
+
handler: (c: import("hono").Context<import("@vitnode/core/api/middlewares/global/global").EnvVitNode, "/", {
|
|
3
|
+
in: {
|
|
4
|
+
query: {
|
|
5
|
+
orderBy?: "createdAt" | "updatedAt" | undefined;
|
|
6
|
+
cursor?: string | undefined;
|
|
7
|
+
first?: string | undefined;
|
|
8
|
+
last?: string | undefined;
|
|
9
|
+
order?: "asc" | "desc" | undefined;
|
|
10
|
+
categoryId?: string | undefined;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
out: {
|
|
14
|
+
query: {
|
|
15
|
+
orderBy?: "createdAt" | "updatedAt" | undefined;
|
|
16
|
+
cursor?: string | undefined;
|
|
17
|
+
first?: string | undefined;
|
|
18
|
+
last?: string | undefined;
|
|
19
|
+
order?: "asc" | "desc" | undefined;
|
|
20
|
+
categoryId?: number | undefined;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
}>) => Promise<Response & import("hono").TypedResponse<{
|
|
24
|
+
edges: {
|
|
25
|
+
id: number;
|
|
26
|
+
title: string;
|
|
27
|
+
titleSeo: string;
|
|
28
|
+
content: string;
|
|
29
|
+
categoryId: number;
|
|
30
|
+
createdAt: string;
|
|
31
|
+
updatedAt: string;
|
|
32
|
+
category: {
|
|
33
|
+
id: number;
|
|
34
|
+
title: string;
|
|
35
|
+
titleSeo: string;
|
|
36
|
+
};
|
|
37
|
+
}[];
|
|
38
|
+
pageInfo: {
|
|
39
|
+
count: number;
|
|
40
|
+
endCursor: null | number;
|
|
41
|
+
hasNextPage: boolean;
|
|
42
|
+
hasPreviousPage: boolean;
|
|
43
|
+
startCursor: null | number;
|
|
44
|
+
totalCount: number;
|
|
45
|
+
};
|
|
46
|
+
}, 200, "json">>;
|
|
47
|
+
pluginId: "@vitnode/blog";
|
|
48
|
+
route: {
|
|
49
|
+
method: "get";
|
|
50
|
+
path: "/";
|
|
51
|
+
request: {
|
|
52
|
+
query: import("zod").ZodObject<{
|
|
53
|
+
cursor: import("zod").ZodOptional<import("zod").ZodString>;
|
|
54
|
+
first: import("zod").ZodOptional<import("zod").ZodString>;
|
|
55
|
+
last: import("zod").ZodOptional<import("zod").ZodString>;
|
|
56
|
+
} & {
|
|
57
|
+
order: import("zod").ZodOptional<import("zod").ZodEnum<["asc", "desc"]>>;
|
|
58
|
+
orderBy: import("zod").ZodOptional<import("zod").ZodEnum<["updatedAt", "createdAt"]>>;
|
|
59
|
+
categoryId: import("zod").ZodOptional<import("zod").ZodEffects<import("zod").ZodString, number, string>>;
|
|
60
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
61
|
+
orderBy?: "createdAt" | "updatedAt" | undefined;
|
|
62
|
+
cursor?: string | undefined;
|
|
63
|
+
first?: string | undefined;
|
|
64
|
+
last?: string | undefined;
|
|
65
|
+
order?: "asc" | "desc" | undefined;
|
|
66
|
+
categoryId?: number | undefined;
|
|
67
|
+
}, {
|
|
68
|
+
orderBy?: "createdAt" | "updatedAt" | undefined;
|
|
69
|
+
cursor?: string | undefined;
|
|
70
|
+
first?: string | undefined;
|
|
71
|
+
last?: string | undefined;
|
|
72
|
+
order?: "asc" | "desc" | undefined;
|
|
73
|
+
categoryId?: string | undefined;
|
|
74
|
+
}>;
|
|
75
|
+
};
|
|
76
|
+
responses: {
|
|
77
|
+
200: {
|
|
78
|
+
content: {
|
|
79
|
+
'application/json': {
|
|
80
|
+
schema: import("zod").ZodObject<{
|
|
81
|
+
edges: import("zod").ZodArray<import("zod").ZodObject<{
|
|
82
|
+
id: import("zod").ZodNumber;
|
|
83
|
+
title: import("zod").ZodString;
|
|
84
|
+
titleSeo: import("zod").ZodString;
|
|
85
|
+
content: import("zod").ZodString;
|
|
86
|
+
categoryId: import("zod").ZodNumber;
|
|
87
|
+
createdAt: import("zod").ZodDate;
|
|
88
|
+
updatedAt: import("zod").ZodDate;
|
|
89
|
+
category: import("zod").ZodObject<{
|
|
90
|
+
id: import("zod").ZodNumber;
|
|
91
|
+
title: import("zod").ZodString;
|
|
92
|
+
titleSeo: import("zod").ZodString;
|
|
93
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
94
|
+
id: number;
|
|
95
|
+
title: string;
|
|
96
|
+
titleSeo: string;
|
|
97
|
+
}, {
|
|
98
|
+
id: number;
|
|
99
|
+
title: string;
|
|
100
|
+
titleSeo: string;
|
|
101
|
+
}>;
|
|
102
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
103
|
+
id: number;
|
|
104
|
+
title: string;
|
|
105
|
+
createdAt: Date;
|
|
106
|
+
updatedAt: Date;
|
|
107
|
+
titleSeo: string;
|
|
108
|
+
content: string;
|
|
109
|
+
category: {
|
|
110
|
+
id: number;
|
|
111
|
+
title: string;
|
|
112
|
+
titleSeo: string;
|
|
113
|
+
};
|
|
114
|
+
categoryId: number;
|
|
115
|
+
}, {
|
|
116
|
+
id: number;
|
|
117
|
+
title: string;
|
|
118
|
+
createdAt: Date;
|
|
119
|
+
updatedAt: Date;
|
|
120
|
+
titleSeo: string;
|
|
121
|
+
content: string;
|
|
122
|
+
category: {
|
|
123
|
+
id: number;
|
|
124
|
+
title: string;
|
|
125
|
+
titleSeo: string;
|
|
126
|
+
};
|
|
127
|
+
categoryId: number;
|
|
128
|
+
}>, "many">;
|
|
129
|
+
pageInfo: import("zod").ZodObject<{
|
|
130
|
+
totalCount: import("zod").ZodNumber;
|
|
131
|
+
count: import("zod").ZodNumber;
|
|
132
|
+
hasNextPage: import("zod").ZodBoolean;
|
|
133
|
+
hasPreviousPage: import("zod").ZodBoolean;
|
|
134
|
+
startCursor: import("zod").ZodNullable<import("zod").ZodNumber>;
|
|
135
|
+
endCursor: import("zod").ZodNullable<import("zod").ZodNumber>;
|
|
136
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
137
|
+
count: number;
|
|
138
|
+
totalCount: number;
|
|
139
|
+
hasNextPage: boolean;
|
|
140
|
+
hasPreviousPage: boolean;
|
|
141
|
+
startCursor: number | null;
|
|
142
|
+
endCursor: number | null;
|
|
143
|
+
}, {
|
|
144
|
+
count: number;
|
|
145
|
+
totalCount: number;
|
|
146
|
+
hasNextPage: boolean;
|
|
147
|
+
hasPreviousPage: boolean;
|
|
148
|
+
startCursor: number | null;
|
|
149
|
+
endCursor: number | null;
|
|
150
|
+
}>;
|
|
151
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
152
|
+
edges: {
|
|
153
|
+
id: number;
|
|
154
|
+
title: string;
|
|
155
|
+
createdAt: Date;
|
|
156
|
+
updatedAt: Date;
|
|
157
|
+
titleSeo: string;
|
|
158
|
+
content: string;
|
|
159
|
+
category: {
|
|
160
|
+
id: number;
|
|
161
|
+
title: string;
|
|
162
|
+
titleSeo: string;
|
|
163
|
+
};
|
|
164
|
+
categoryId: number;
|
|
165
|
+
}[];
|
|
166
|
+
pageInfo: {
|
|
167
|
+
count: number;
|
|
168
|
+
totalCount: number;
|
|
169
|
+
hasNextPage: boolean;
|
|
170
|
+
hasPreviousPage: boolean;
|
|
171
|
+
startCursor: number | null;
|
|
172
|
+
endCursor: number | null;
|
|
173
|
+
};
|
|
174
|
+
}, {
|
|
175
|
+
edges: {
|
|
176
|
+
id: number;
|
|
177
|
+
title: string;
|
|
178
|
+
createdAt: Date;
|
|
179
|
+
updatedAt: Date;
|
|
180
|
+
titleSeo: string;
|
|
181
|
+
content: string;
|
|
182
|
+
category: {
|
|
183
|
+
id: number;
|
|
184
|
+
title: string;
|
|
185
|
+
titleSeo: string;
|
|
186
|
+
};
|
|
187
|
+
categoryId: number;
|
|
188
|
+
}[];
|
|
189
|
+
pageInfo: {
|
|
190
|
+
count: number;
|
|
191
|
+
totalCount: number;
|
|
192
|
+
hasNextPage: boolean;
|
|
193
|
+
hasPreviousPage: boolean;
|
|
194
|
+
startCursor: number | null;
|
|
195
|
+
endCursor: number | null;
|
|
196
|
+
};
|
|
197
|
+
}>;
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
description: string;
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
} & {
|
|
204
|
+
getRoutingPath: () => "/";
|
|
205
|
+
};
|
|
206
|
+
}, {
|
|
207
|
+
handler: (c: import("hono").Context<import("@vitnode/core/api/middlewares/global/global").EnvVitNode, "/", {
|
|
208
|
+
in: {
|
|
209
|
+
json: {
|
|
210
|
+
title: string;
|
|
211
|
+
content: string;
|
|
212
|
+
categoryId: number;
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
out: {
|
|
216
|
+
json: {
|
|
217
|
+
title: string;
|
|
218
|
+
content: string;
|
|
219
|
+
categoryId: number;
|
|
220
|
+
};
|
|
221
|
+
};
|
|
222
|
+
}>) => Promise<Response & import("hono").TypedResponse<{
|
|
223
|
+
id: number;
|
|
224
|
+
title: string;
|
|
225
|
+
createdAt: string;
|
|
226
|
+
updatedAt: string;
|
|
227
|
+
titleSeo: string;
|
|
228
|
+
content: string;
|
|
229
|
+
categoryId: number;
|
|
230
|
+
}, 201, "json">>;
|
|
231
|
+
pluginId: "@vitnode/blog";
|
|
232
|
+
route: {
|
|
233
|
+
method: "post";
|
|
234
|
+
path: "/";
|
|
235
|
+
request: {
|
|
236
|
+
body: {
|
|
237
|
+
content: {
|
|
238
|
+
'application/json': {
|
|
239
|
+
schema: import("zod").ZodObject<{
|
|
240
|
+
title: import("zod").ZodString;
|
|
241
|
+
content: import("zod").ZodString;
|
|
242
|
+
categoryId: import("zod").ZodNumber;
|
|
243
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
244
|
+
title: string;
|
|
245
|
+
content: string;
|
|
246
|
+
categoryId: number;
|
|
247
|
+
}, {
|
|
248
|
+
title: string;
|
|
249
|
+
content: string;
|
|
250
|
+
categoryId: number;
|
|
251
|
+
}>;
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
responses: {
|
|
257
|
+
201: {
|
|
258
|
+
content: {
|
|
259
|
+
'application/json': {
|
|
260
|
+
schema: import("zod").ZodObject<{
|
|
261
|
+
id: import("zod").ZodNumber;
|
|
262
|
+
title: import("zod").ZodString;
|
|
263
|
+
titleSeo: import("zod").ZodString;
|
|
264
|
+
content: import("zod").ZodString;
|
|
265
|
+
categoryId: import("zod").ZodNumber;
|
|
266
|
+
createdAt: import("zod").ZodDate;
|
|
267
|
+
updatedAt: import("zod").ZodDate;
|
|
268
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
269
|
+
id: number;
|
|
270
|
+
title: string;
|
|
271
|
+
createdAt: Date;
|
|
272
|
+
updatedAt: Date;
|
|
273
|
+
titleSeo: string;
|
|
274
|
+
content: string;
|
|
275
|
+
categoryId: number;
|
|
276
|
+
}, {
|
|
277
|
+
id: number;
|
|
278
|
+
title: string;
|
|
279
|
+
createdAt: Date;
|
|
280
|
+
updatedAt: Date;
|
|
281
|
+
titleSeo: string;
|
|
282
|
+
content: string;
|
|
283
|
+
categoryId: number;
|
|
284
|
+
}>;
|
|
285
|
+
};
|
|
286
|
+
};
|
|
287
|
+
description: string;
|
|
288
|
+
};
|
|
289
|
+
400: {
|
|
290
|
+
description: string;
|
|
291
|
+
};
|
|
292
|
+
404: {
|
|
293
|
+
description: string;
|
|
294
|
+
};
|
|
295
|
+
};
|
|
296
|
+
} & {
|
|
297
|
+
getRoutingPath: () => "/";
|
|
298
|
+
};
|
|
299
|
+
}, {
|
|
300
|
+
handler: (c: import("hono").Context<import("@vitnode/core/api/middlewares/global/global").EnvVitNode, "/:id", {
|
|
301
|
+
in: {
|
|
302
|
+
param: {
|
|
303
|
+
id: string;
|
|
304
|
+
};
|
|
305
|
+
};
|
|
306
|
+
out: {
|
|
307
|
+
param: {
|
|
308
|
+
id: number;
|
|
309
|
+
};
|
|
310
|
+
};
|
|
311
|
+
} & {
|
|
312
|
+
in: {
|
|
313
|
+
json: {
|
|
314
|
+
title: string;
|
|
315
|
+
content: string;
|
|
316
|
+
categoryId: number;
|
|
317
|
+
};
|
|
318
|
+
};
|
|
319
|
+
out: {
|
|
320
|
+
json: {
|
|
321
|
+
title: string;
|
|
322
|
+
content: string;
|
|
323
|
+
categoryId: number;
|
|
324
|
+
};
|
|
325
|
+
};
|
|
326
|
+
}>) => Promise<Response & import("hono").TypedResponse<{
|
|
327
|
+
id: number;
|
|
328
|
+
title: string;
|
|
329
|
+
titleSeo: string;
|
|
330
|
+
content: string;
|
|
331
|
+
categoryId: number;
|
|
332
|
+
createdAt: string;
|
|
333
|
+
updatedAt: string;
|
|
334
|
+
}, 400 | 200 | 404, "json">>;
|
|
335
|
+
pluginId: "@vitnode/blog";
|
|
336
|
+
route: {
|
|
337
|
+
method: "put";
|
|
338
|
+
path: "/{id}";
|
|
339
|
+
request: {
|
|
340
|
+
params: import("zod").ZodObject<{
|
|
341
|
+
id: import("zod").ZodEffects<import("zod").ZodString, number, string>;
|
|
342
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
343
|
+
id: number;
|
|
344
|
+
}, {
|
|
345
|
+
id: string;
|
|
346
|
+
}>;
|
|
347
|
+
body: {
|
|
348
|
+
content: {
|
|
349
|
+
'application/json': {
|
|
350
|
+
schema: import("zod").ZodObject<{
|
|
351
|
+
title: import("zod").ZodString;
|
|
352
|
+
content: import("zod").ZodString;
|
|
353
|
+
categoryId: import("zod").ZodNumber;
|
|
354
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
355
|
+
title: string;
|
|
356
|
+
content: string;
|
|
357
|
+
categoryId: number;
|
|
358
|
+
}, {
|
|
359
|
+
title: string;
|
|
360
|
+
content: string;
|
|
361
|
+
categoryId: number;
|
|
362
|
+
}>;
|
|
363
|
+
};
|
|
364
|
+
};
|
|
365
|
+
};
|
|
366
|
+
};
|
|
367
|
+
responses: {
|
|
368
|
+
200: {
|
|
369
|
+
content: {
|
|
370
|
+
'application/json': {
|
|
371
|
+
schema: import("zod").ZodObject<{
|
|
372
|
+
id: import("zod").ZodNumber;
|
|
373
|
+
title: import("zod").ZodString;
|
|
374
|
+
titleSeo: import("zod").ZodString;
|
|
375
|
+
content: import("zod").ZodString;
|
|
376
|
+
categoryId: import("zod").ZodNumber;
|
|
377
|
+
createdAt: import("zod").ZodDate;
|
|
378
|
+
updatedAt: import("zod").ZodDate;
|
|
379
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
380
|
+
id: number;
|
|
381
|
+
title: string;
|
|
382
|
+
createdAt: Date;
|
|
383
|
+
updatedAt: Date;
|
|
384
|
+
titleSeo: string;
|
|
385
|
+
content: string;
|
|
386
|
+
categoryId: number;
|
|
387
|
+
}, {
|
|
388
|
+
id: number;
|
|
389
|
+
title: string;
|
|
390
|
+
createdAt: Date;
|
|
391
|
+
updatedAt: Date;
|
|
392
|
+
titleSeo: string;
|
|
393
|
+
content: string;
|
|
394
|
+
categoryId: number;
|
|
395
|
+
}>;
|
|
396
|
+
};
|
|
397
|
+
};
|
|
398
|
+
description: string;
|
|
399
|
+
};
|
|
400
|
+
400: {
|
|
401
|
+
description: string;
|
|
402
|
+
};
|
|
403
|
+
404: {
|
|
404
|
+
description: string;
|
|
405
|
+
};
|
|
406
|
+
};
|
|
407
|
+
} & {
|
|
408
|
+
getRoutingPath: () => "/:id";
|
|
409
|
+
};
|
|
410
|
+
}, {
|
|
411
|
+
handler: (c: import("hono").Context<import("@vitnode/core/api/middlewares/global/global").EnvVitNode, "/:id", {
|
|
412
|
+
in: {
|
|
413
|
+
param: {
|
|
414
|
+
id: string;
|
|
415
|
+
};
|
|
416
|
+
};
|
|
417
|
+
out: {
|
|
418
|
+
param: {
|
|
419
|
+
id: number;
|
|
420
|
+
};
|
|
421
|
+
};
|
|
422
|
+
}>) => Promise<Response & import("hono").TypedResponse<null, 204, "body">>;
|
|
423
|
+
pluginId: "@vitnode/blog";
|
|
424
|
+
route: {
|
|
425
|
+
method: "delete";
|
|
426
|
+
path: "/{id}";
|
|
427
|
+
request: {
|
|
428
|
+
params: import("zod").ZodObject<{
|
|
429
|
+
id: import("zod").ZodEffects<import("zod").ZodString, number, string>;
|
|
430
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
431
|
+
id: number;
|
|
432
|
+
}, {
|
|
433
|
+
id: string;
|
|
434
|
+
}>;
|
|
435
|
+
};
|
|
436
|
+
responses: {
|
|
437
|
+
204: {
|
|
438
|
+
description: string;
|
|
439
|
+
};
|
|
440
|
+
404: {
|
|
441
|
+
description: string;
|
|
442
|
+
};
|
|
443
|
+
};
|
|
444
|
+
} & {
|
|
445
|
+
getRoutingPath: () => "/:id";
|
|
446
|
+
};
|
|
447
|
+
}], import("@vitnode/core/api/lib/module").BaseBuildModuleReturn<"@vitnode/blog", string, import("@vitnode/core/api/lib/route").Route<"@vitnode/blog", import("@hono/zod-openapi").RouteConfig, import("@hono/zod-openapi").RouteHandler<import("@hono/zod-openapi").RouteConfig>>[]>[]>;
|
|
448
|
+
//# sourceMappingURL=posts.module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"posts.module.d.ts","sourceRoot":"","sources":["../../../../../src/api/modules/posts/posts.module.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wRAItB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{buildModule}from"@vitnode/core/api/lib/module";import{CONFIG_PLUGIN}from"../../../config.js";import{createPostRoute}from"./routes/create.route.js";import{deletePostRoute}from"./routes/delete.route.js";import{editPostRoute}from"./routes/edit.route.js";import{postsRoute}from"./routes/get.route.js";export const postsModule=buildModule({...CONFIG_PLUGIN,name:"posts",routes:[postsRoute,createPostRoute,editPostRoute,deletePostRoute]});
|