@vitnode/blog 1.2.0-canary.52 → 1.2.0-canary.54

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.
Files changed (61) hide show
  1. package/dist/src/api/modules/admin/admin.module.d.ts +8 -8
  2. package/dist/src/api/modules/admin/admin.module.js +1 -1
  3. package/dist/src/api/modules/admin/categories/categories.admin.module.d.ts +4 -4
  4. package/dist/src/api/modules/admin/categories/categories.admin.module.js +1 -1
  5. package/dist/src/api/modules/admin/categories/routes/create.route.d.ts +3 -3
  6. package/dist/src/api/modules/admin/categories/routes/create.route.d.ts.map +1 -1
  7. package/dist/src/api/modules/admin/categories/routes/create.route.js +1 -1
  8. package/dist/src/api/modules/admin/categories/routes/delete.route.d.ts +1 -1
  9. package/dist/src/api/modules/admin/categories/routes/delete.route.js +1 -1
  10. package/dist/src/api/modules/admin/categories/routes/edit.route.d.ts +3 -3
  11. package/dist/src/api/modules/admin/categories/routes/edit.route.js +1 -1
  12. package/dist/src/api/modules/admin/posts/posts.admin.module.d.ts +4 -4
  13. package/dist/src/api/modules/admin/posts/posts.admin.module.js +1 -1
  14. package/dist/src/api/modules/admin/posts/routes/create.route.d.ts +3 -3
  15. package/dist/src/api/modules/admin/posts/routes/create.route.d.ts.map +1 -1
  16. package/dist/src/api/modules/admin/posts/routes/create.route.js +1 -1
  17. package/dist/src/api/modules/admin/posts/routes/delete.route.d.ts +1 -1
  18. package/dist/src/api/modules/admin/posts/routes/delete.route.js +1 -1
  19. package/dist/src/api/modules/admin/posts/routes/edit.route.d.ts +3 -3
  20. package/dist/src/api/modules/admin/posts/routes/edit.route.js +1 -1
  21. package/dist/src/api/modules/categories/categories.module.d.ts +3 -3
  22. package/dist/src/api/modules/categories/categories.module.js +1 -1
  23. package/dist/src/api/modules/categories/routes/get.route.d.ts +2 -2
  24. package/dist/src/api/modules/categories/routes/get.route.d.ts.map +1 -1
  25. package/dist/src/api/modules/categories/routes/get.route.js +1 -1
  26. package/dist/src/api/modules/categories/test.route.d.ts +3 -3
  27. package/dist/src/api/modules/categories/test.route.js +1 -1
  28. package/dist/src/api/modules/posts/posts.module.d.ts +1 -1
  29. package/dist/src/api/modules/posts/posts.module.js +1 -1
  30. package/dist/src/api/modules/posts/routes/get.route.d.ts +2 -2
  31. package/dist/src/api/modules/posts/routes/get.route.js +1 -1
  32. package/dist/src/app_admin/blog/categories/page.d.ts +2 -2
  33. package/dist/src/app_admin/blog/categories/page.d.ts.map +1 -1
  34. package/dist/src/app_admin/blog/categories/page.js +1 -1
  35. package/dist/src/app_admin/blog/posts/page.d.ts +2 -2
  36. package/dist/src/app_admin/blog/posts/page.d.ts.map +1 -1
  37. package/dist/src/app_admin/blog/posts/page.js +1 -1
  38. package/dist/src/config.api.js +1 -1
  39. package/dist/src/config.js +1 -1
  40. package/dist/src/database/index.d.ts +3 -3
  41. package/dist/src/emails/test-template.d.ts +1 -1
  42. package/dist/src/emails/test-template.d.ts.map +1 -1
  43. package/dist/src/emails/test-template.js +1 -1
  44. package/dist/src/views/admin/categories/actions/actions.js +1 -1
  45. package/dist/src/views/admin/categories/actions/create-edit/create-edit.d.ts +2 -2
  46. package/dist/src/views/admin/categories/actions/create-edit/mutation-api.d.ts +2 -2
  47. package/dist/src/views/admin/categories/actions/create-edit/mutation-api.d.ts.map +1 -1
  48. package/dist/src/views/admin/categories/table/actions/edit-action.d.ts +1 -1
  49. package/dist/src/views/admin/categories/table/actions/edit-action.js +1 -1
  50. package/dist/src/views/admin/posts/actions/actions.js +1 -1
  51. package/dist/src/views/admin/posts/actions/create-edit/create-edit.d.ts +2 -2
  52. package/dist/src/views/admin/posts/actions/create-edit/create-edit.d.ts.map +1 -1
  53. package/dist/src/views/admin/posts/actions/create-edit/mutation-api.d.ts +2 -2
  54. package/dist/src/views/admin/posts/actions/create-edit/mutation-api.d.ts.map +1 -1
  55. package/dist/src/views/admin/posts/table/actions/edit-action.d.ts +1 -1
  56. package/dist/src/views/admin/posts/table/actions/edit-action.d.ts.map +1 -1
  57. package/dist/src/views/admin/posts/table/actions/edit-action.js +1 -1
  58. package/dist/tsconfig.tsbuildinfo +1 -1
  59. package/package.json +16 -19
  60. package/src/app_admin/blog/categories/page.tsx +15 -16
  61. package/src/app_admin/blog/posts/page.tsx +15 -16
@@ -24,7 +24,7 @@ export declare const adminModule: import("@vitnode/core/api/lib/module").BuildMo
24
24
  request: {
25
25
  body: {
26
26
  content: {
27
- 'application/json': {
27
+ "application/json": {
28
28
  schema: import("zod").ZodObject<{
29
29
  title: import("zod").ZodString;
30
30
  }, import("zod/v4/core").$strip>;
@@ -35,7 +35,7 @@ export declare const adminModule: import("@vitnode/core/api/lib/module").BuildMo
35
35
  responses: {
36
36
  201: {
37
37
  content: {
38
- 'application/json': {
38
+ "application/json": {
39
39
  schema: import("zod").ZodObject<{
40
40
  id: import("zod").ZodNumber;
41
41
  title: import("zod").ZodString;
@@ -93,7 +93,7 @@ export declare const adminModule: import("@vitnode/core/api/lib/module").BuildMo
93
93
  }, import("zod/v4/core").$strip>;
94
94
  body: {
95
95
  content: {
96
- 'application/json': {
96
+ "application/json": {
97
97
  schema: import("zod").ZodObject<{
98
98
  title: import("zod").ZodString;
99
99
  }, import("zod/v4/core").$strip>;
@@ -104,7 +104,7 @@ export declare const adminModule: import("@vitnode/core/api/lib/module").BuildMo
104
104
  responses: {
105
105
  200: {
106
106
  content: {
107
- 'application/json': {
107
+ "application/json": {
108
108
  schema: import("zod").ZodObject<{
109
109
  id: import("zod").ZodNumber;
110
110
  title: import("zod").ZodString;
@@ -204,7 +204,7 @@ export declare const adminModule: import("@vitnode/core/api/lib/module").BuildMo
204
204
  }, import("zod/v4/core").$strip>;
205
205
  body: {
206
206
  content: {
207
- 'application/json': {
207
+ "application/json": {
208
208
  schema: import("zod").ZodObject<{
209
209
  title: import("zod").ZodString;
210
210
  content: import("zod").ZodString;
@@ -217,7 +217,7 @@ export declare const adminModule: import("@vitnode/core/api/lib/module").BuildMo
217
217
  responses: {
218
218
  200: {
219
219
  content: {
220
- 'application/json': {
220
+ "application/json": {
221
221
  schema: import("zod").ZodObject<{
222
222
  id: import("zod").ZodNumber;
223
223
  title: import("zod").ZodString;
@@ -273,7 +273,7 @@ export declare const adminModule: import("@vitnode/core/api/lib/module").BuildMo
273
273
  request: {
274
274
  body: {
275
275
  content: {
276
- 'application/json': {
276
+ "application/json": {
277
277
  schema: import("zod").ZodObject<{
278
278
  title: import("zod").ZodString;
279
279
  content: import("zod").ZodString;
@@ -286,7 +286,7 @@ export declare const adminModule: import("@vitnode/core/api/lib/module").BuildMo
286
286
  responses: {
287
287
  201: {
288
288
  content: {
289
- 'application/json': {
289
+ "application/json": {
290
290
  schema: import("zod").ZodObject<{
291
291
  id: import("zod").ZodNumber;
292
292
  title: import("zod").ZodString;
@@ -1 +1 @@
1
- import{buildModule}from"@vitnode/core/api/lib/module";import{CONFIG_PLUGIN}from"../../../const.js";import{categoriesAdminModule}from"./categories/categories.admin.module.js";import{postsAdminModule}from"./posts/posts.admin.module.js";export const adminModule=buildModule({...CONFIG_PLUGIN,name:"admin",modules:[categoriesAdminModule,postsAdminModule],routes:[]});
1
+ import{buildModule}from"@vitnode/core/api/lib/module";import{CONFIG_PLUGIN}from"../../../const.js";import{categoriesAdminModule}from"./categories/categories.admin.module.js";import{postsAdminModule}from"./posts/posts.admin.module.js";export const adminModule=buildModule({pluginId:CONFIG_PLUGIN.pluginId,name:"admin",modules:[categoriesAdminModule,postsAdminModule],routes:[]});
@@ -24,7 +24,7 @@ export declare const categoriesAdminModule: import("@vitnode/core/api/lib/module
24
24
  request: {
25
25
  body: {
26
26
  content: {
27
- 'application/json': {
27
+ "application/json": {
28
28
  schema: import("zod").ZodObject<{
29
29
  title: import("zod").ZodString;
30
30
  }, import("zod/v4/core").$strip>;
@@ -35,7 +35,7 @@ export declare const categoriesAdminModule: import("@vitnode/core/api/lib/module
35
35
  responses: {
36
36
  201: {
37
37
  content: {
38
- 'application/json': {
38
+ "application/json": {
39
39
  schema: import("zod").ZodObject<{
40
40
  id: import("zod").ZodNumber;
41
41
  title: import("zod").ZodString;
@@ -93,7 +93,7 @@ export declare const categoriesAdminModule: import("@vitnode/core/api/lib/module
93
93
  }, import("zod/v4/core").$strip>;
94
94
  body: {
95
95
  content: {
96
- 'application/json': {
96
+ "application/json": {
97
97
  schema: import("zod").ZodObject<{
98
98
  title: import("zod").ZodString;
99
99
  }, import("zod/v4/core").$strip>;
@@ -104,7 +104,7 @@ export declare const categoriesAdminModule: import("@vitnode/core/api/lib/module
104
104
  responses: {
105
105
  200: {
106
106
  content: {
107
- 'application/json': {
107
+ "application/json": {
108
108
  schema: import("zod").ZodObject<{
109
109
  id: import("zod").ZodNumber;
110
110
  title: import("zod").ZodString;
@@ -1 +1 @@
1
- import{buildModule}from"@vitnode/core/api/lib/module";import{CONFIG_PLUGIN}from"../../../../const.js";import{createCategoryRoute}from"./routes/create.route.js";import{deleteCategoryRoute}from"./routes/delete.route.js";import{editCategoryRoute}from"./routes/edit.route.js";export const categoriesAdminModule=buildModule({...CONFIG_PLUGIN,name:"categories",routes:[createCategoryRoute,editCategoryRoute,deleteCategoryRoute]});
1
+ import{buildModule}from"@vitnode/core/api/lib/module";import{CONFIG_PLUGIN}from"../../../../const.js";import{createCategoryRoute}from"./routes/create.route.js";import{deleteCategoryRoute}from"./routes/delete.route.js";import{editCategoryRoute}from"./routes/edit.route.js";export const categoriesAdminModule=buildModule({pluginId:CONFIG_PLUGIN.pluginId,name:"categories",routes:[createCategoryRoute,editCategoryRoute,deleteCategoryRoute]});
@@ -1,4 +1,4 @@
1
- import { z } from '@hono/zod-openapi';
1
+ import { z } from "@hono/zod-openapi";
2
2
  export declare const zodCreateCategorySchema: z.ZodObject<{
3
3
  title: z.ZodString;
4
4
  }, z.core.$strip>;
@@ -28,7 +28,7 @@ export declare const createCategoryRoute: {
28
28
  request: {
29
29
  body: {
30
30
  content: {
31
- 'application/json': {
31
+ "application/json": {
32
32
  schema: z.ZodObject<{
33
33
  title: z.ZodString;
34
34
  }, z.core.$strip>;
@@ -39,7 +39,7 @@ export declare const createCategoryRoute: {
39
39
  responses: {
40
40
  201: {
41
41
  content: {
42
- 'application/json': {
42
+ "application/json": {
43
43
  schema: z.ZodObject<{
44
44
  id: z.ZodNumber;
45
45
  title: z.ZodString;
@@ -1 +1 @@
1
- {"version":3,"file":"create.route.d.ts","sourceRoot":"","sources":["../../../../../../../src/api/modules/admin/categories/routes/create.route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAStC,eAAO,MAAM,uBAAuB;;iBAElC,CAAC;AASH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyD9B,CAAC"}
1
+ {"version":3,"file":"create.route.d.ts","sourceRoot":"","sources":["../../../../../../../src/api/modules/admin/categories/routes/create.route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAgBtC,eAAO,MAAM,uBAAuB;;iBAElC,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyD9B,CAAC"}
@@ -1 +1 @@
1
- import{z}from"@hono/zod-openapi";import{buildRoute}from"@vitnode/core/api/lib/route";import{removeSpecialCharacters}from"@vitnode/core/lib/special-characters";import{eq}from"drizzle-orm";import{HTTPException}from"hono/http-exception";import{CONFIG_PLUGIN}from"../../../../../const.js";import{blog_categories}from"../../../../../database/categories.js";export const zodCreateCategorySchema=z.object({title:z.string()});const zodCategoryResponseSchema=z.object({id:z.number(),title:z.string(),createdAt:z.date(),updatedAt:z.date()});export const createCategoryRoute=buildRoute({...CONFIG_PLUGIN,route:{method:"post",path:"/",request:{body:{content:{"application/json":{schema:zodCreateCategorySchema}}}},responses:{201:{content:{"application/json":{schema:zodCategoryResponseSchema}},description:"Category created successfully"},400:{description:"Bad request - Invalid input data"}}},handler:async c=>{const{title}=c.req.valid("json");const titleSeo=removeSpecialCharacters(title);const[titleSEODuplocate]=await c.get("db").select({titleSeo:blog_categories.titleSeo}).from(blog_categories).where(eq(blog_categories.titleSeo,titleSeo)).limit(1);if(titleSEODuplocate?.titleSeo===titleSeo){throw new HTTPException(400,{message:"Category with this title already exists."})}const[category]=await c.get("db").insert(blog_categories).values({title,titleSeo:removeSpecialCharacters(title)}).returning();return c.json(category,201)}});
1
+ import{z}from"@hono/zod-openapi";import{buildRoute}from"@vitnode/core/api/lib/route";import{removeSpecialCharacters}from"@vitnode/core/lib/special-characters";import{eq}from"drizzle-orm";import{HTTPException}from"hono/http-exception";import{CONFIG_PLUGIN}from"../../../../../const.js";import{blog_categories}from"../../../../../database/categories.js";const zodCategoryResponseSchema=z.object({id:z.number(),title:z.string(),createdAt:z.date(),updatedAt:z.date()});export const zodCreateCategorySchema=z.object({title:z.string()});export const createCategoryRoute=buildRoute({pluginId:CONFIG_PLUGIN.pluginId,route:{method:"post",path:"/",request:{body:{content:{"application/json":{schema:zodCreateCategorySchema}}}},responses:{201:{content:{"application/json":{schema:zodCategoryResponseSchema}},description:"Category created successfully"},400:{description:"Bad request - Invalid input data"}}},handler:async c=>{const{title}=c.req.valid("json");const titleSeo=removeSpecialCharacters(title);const[titleSEODuplocate]=await c.get("db").select({titleSeo:blog_categories.titleSeo}).from(blog_categories).where(eq(blog_categories.titleSeo,titleSeo)).limit(1);if(titleSEODuplocate?.titleSeo===titleSeo){throw new HTTPException(400,{message:"Category with this title already exists."})}const[category]=await c.get("db").insert(blog_categories).values({title,titleSeo:removeSpecialCharacters(title)}).returning();return c.json(category,201)}});
@@ -1,4 +1,4 @@
1
- import { z } from '@hono/zod-openapi';
1
+ import { z } from "@hono/zod-openapi";
2
2
  export declare const deleteCategoryRoute: {
3
3
  handler: (c: import("hono").Context<import("@vitnode/core/api/middlewares/global.middleware").EnvVitNode, "/:id", {
4
4
  in: {
@@ -1 +1 @@
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_categories}from"../../../../../database/categories.js";export const deleteCategoryRoute=buildRoute({...CONFIG_PLUGIN,route:{method:"delete",path:"/{id}",request:{params:z.object({id:z.string().transform(Number)})},responses:{204:{description:"Category deleted successfully"},404:{description:"Category not found"}}},handler:async c=>{const{id}=c.req.valid("param");const result=await c.get("db").delete(blog_categories).where(eq(blog_categories.id,id)).returning();if(result.length===0){throw new HTTPException(404)}return c.body(null,204)}});
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_categories}from"../../../../../database/categories.js";export const deleteCategoryRoute=buildRoute({pluginId:CONFIG_PLUGIN.pluginId,route:{method:"delete",path:"/{id}",request:{params:z.object({id:z.string().transform(Number)})},responses:{204:{description:"Category deleted successfully"},404:{description:"Category not found"}}},handler:async c=>{const{id}=c.req.valid("param");const result=await c.get("db").delete(blog_categories).where(eq(blog_categories.id,id)).returning();if(result.length===0){throw new HTTPException(404)}return c.body(null,204)}});
@@ -1,4 +1,4 @@
1
- import { z } from '@hono/zod-openapi';
1
+ import { z } from "@hono/zod-openapi";
2
2
  export declare const editCategoryRoute: {
3
3
  handler: (c: import("hono").Context<import("@vitnode/core/api/middlewares/global.middleware").EnvVitNode, "/:id", {
4
4
  in: {
@@ -39,7 +39,7 @@ export declare const editCategoryRoute: {
39
39
  }, z.core.$strip>;
40
40
  body: {
41
41
  content: {
42
- 'application/json': {
42
+ "application/json": {
43
43
  schema: z.ZodObject<{
44
44
  title: z.ZodString;
45
45
  }, z.core.$strip>;
@@ -50,7 +50,7 @@ export declare const editCategoryRoute: {
50
50
  responses: {
51
51
  200: {
52
52
  content: {
53
- 'application/json': {
53
+ "application/json": {
54
54
  schema: z.ZodObject<{
55
55
  id: z.ZodNumber;
56
56
  title: z.ZodString;
@@ -1 +1 @@
1
- import{z}from"@hono/zod-openapi";import{buildRoute}from"@vitnode/core/api/lib/route";import{removeSpecialCharacters}from"@vitnode/core/lib/special-characters";import{eq}from"drizzle-orm";import{HTTPException}from"hono/http-exception";import{CONFIG_PLUGIN}from"../../../../../const.js";import{blog_categories}from"../../../../../database/categories.js";import{zodCreateCategorySchema}from"./create.route.js";const zodCategoryResponseSchema=z.object({id:z.number(),title:z.string(),createdAt:z.date(),updatedAt:z.date()});export const editCategoryRoute=buildRoute({...CONFIG_PLUGIN,route:{method:"put",path:"/{id}",request:{params:z.object({id:z.string().transform(Number)}),body:{content:{"application/json":{schema:zodCreateCategorySchema}}}},responses:{200:{content:{"application/json":{schema:zodCategoryResponseSchema}},description:"Category updated successfully"},400:{description:"Bad request - Invalid input data"},404:{description:"Category not found"}}},handler:async c=>{const{id}=c.req.valid("param");const{title}=c.req.valid("json");const titleSeo=removeSpecialCharacters(title);const[editData]=await c.get("db").select({titleSeo:blog_categories.titleSeo}).from(blog_categories).where(eq(blog_categories.id,id)).limit(1);if(!editData){throw new HTTPException(404)}const[titleSEODuplocate]=await c.get("db").select({titleSeo:blog_categories.titleSeo}).from(blog_categories).where(eq(blog_categories.titleSeo,titleSeo)).limit(1);if(titleSEODuplocate?.titleSeo===titleSeo&&titleSEODuplocate.titleSeo!==editData.titleSeo){throw new HTTPException(400,{message:"Category with this title already exists."})}const[category]=await c.get("db").update(blog_categories).set({title,titleSeo:removeSpecialCharacters(title)}).where(eq(blog_categories.id,id)).returning();return c.json(category)}});
1
+ import{z}from"@hono/zod-openapi";import{buildRoute}from"@vitnode/core/api/lib/route";import{removeSpecialCharacters}from"@vitnode/core/lib/special-characters";import{eq}from"drizzle-orm";import{HTTPException}from"hono/http-exception";import{CONFIG_PLUGIN}from"../../../../../const.js";import{blog_categories}from"../../../../../database/categories.js";import{zodCreateCategorySchema}from"./create.route.js";const zodCategoryResponseSchema=z.object({id:z.number(),title:z.string(),createdAt:z.date(),updatedAt:z.date()});export const editCategoryRoute=buildRoute({pluginId:CONFIG_PLUGIN.pluginId,route:{method:"put",path:"/{id}",request:{params:z.object({id:z.string().transform(Number)}),body:{content:{"application/json":{schema:zodCreateCategorySchema}}}},responses:{200:{content:{"application/json":{schema:zodCategoryResponseSchema}},description:"Category updated successfully"},400:{description:"Bad request - Invalid input data"},404:{description:"Category not found"}}},handler:async c=>{const{id}=c.req.valid("param");const{title}=c.req.valid("json");const titleSeo=removeSpecialCharacters(title);const[editData]=await c.get("db").select({titleSeo:blog_categories.titleSeo}).from(blog_categories).where(eq(blog_categories.id,id)).limit(1);if(!editData){throw new HTTPException(404)}const[titleSEODuplocate]=await c.get("db").select({titleSeo:blog_categories.titleSeo}).from(blog_categories).where(eq(blog_categories.titleSeo,titleSeo)).limit(1);if(titleSEODuplocate?.titleSeo===titleSeo&&titleSEODuplocate.titleSeo!==editData.titleSeo){throw new HTTPException(400,{message:"Category with this title already exists."})}const[category]=await c.get("db").update(blog_categories).set({title,titleSeo:removeSpecialCharacters(title)}).where(eq(blog_categories.id,id)).returning();return c.json(category)}});
@@ -44,7 +44,7 @@ export declare const postsAdminModule: import("@vitnode/core/api/lib/module").Bu
44
44
  }, import("zod/v4/core").$strip>;
45
45
  body: {
46
46
  content: {
47
- 'application/json': {
47
+ "application/json": {
48
48
  schema: import("zod").ZodObject<{
49
49
  title: import("zod").ZodString;
50
50
  content: import("zod").ZodString;
@@ -57,7 +57,7 @@ export declare const postsAdminModule: import("@vitnode/core/api/lib/module").Bu
57
57
  responses: {
58
58
  200: {
59
59
  content: {
60
- 'application/json': {
60
+ "application/json": {
61
61
  schema: import("zod").ZodObject<{
62
62
  id: import("zod").ZodNumber;
63
63
  title: import("zod").ZodString;
@@ -113,7 +113,7 @@ export declare const postsAdminModule: import("@vitnode/core/api/lib/module").Bu
113
113
  request: {
114
114
  body: {
115
115
  content: {
116
- 'application/json': {
116
+ "application/json": {
117
117
  schema: import("zod").ZodObject<{
118
118
  title: import("zod").ZodString;
119
119
  content: import("zod").ZodString;
@@ -126,7 +126,7 @@ export declare const postsAdminModule: import("@vitnode/core/api/lib/module").Bu
126
126
  responses: {
127
127
  201: {
128
128
  content: {
129
- 'application/json': {
129
+ "application/json": {
130
130
  schema: import("zod").ZodObject<{
131
131
  id: import("zod").ZodNumber;
132
132
  title: import("zod").ZodString;
@@ -1 +1 @@
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({...CONFIG_PLUGIN,name:"posts",routes:[editPostRoute,createPostRoute,deletePostRoute]});
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,4 +1,4 @@
1
- import { z } from '@hono/zod-openapi';
1
+ import { z } from "@hono/zod-openapi";
2
2
  export declare const zodCreatePostSchema: z.ZodObject<{
3
3
  title: z.ZodString;
4
4
  content: z.ZodString;
@@ -36,7 +36,7 @@ export declare const createPostRoute: {
36
36
  request: {
37
37
  body: {
38
38
  content: {
39
- 'application/json': {
39
+ "application/json": {
40
40
  schema: z.ZodObject<{
41
41
  title: z.ZodString;
42
42
  content: z.ZodString;
@@ -49,7 +49,7 @@ export declare const createPostRoute: {
49
49
  responses: {
50
50
  201: {
51
51
  content: {
52
- 'application/json': {
52
+ "application/json": {
53
53
  schema: z.ZodObject<{
54
54
  id: z.ZodNumber;
55
55
  title: z.ZodString;
@@ -1 +1 @@
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;AAUtC,eAAO,MAAM,mBAAmB;;;;iBAO9B,CAAC;AAYH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4E1B,CAAC"}
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;AAoBtC,eAAO,MAAM,mBAAmB;;;;iBAO9B,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4E1B,CAAC"}
@@ -1 +1 @@
1
- import{z}from"@hono/zod-openapi";import{buildRoute}from"@vitnode/core/api/lib/route";import{removeSpecialCharacters}from"@vitnode/core/lib/special-characters";import{eq}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";export const zodCreatePostSchema=z.object({title:z.string().min(3,"Title must be at least 3 characters long").max(255,"Title must not exceed 255 characters"),content:z.string(),categoryId:z.number()});const zodPostResponseSchema=z.object({id:z.number(),title:z.string(),titleSeo:z.string(),content:z.string(),categoryId:z.number(),createdAt:z.date(),updatedAt:z.date()});export const createPostRoute=buildRoute({...CONFIG_PLUGIN,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,categoryId}=c.req.valid("json");const titleSeo=removeSpecialCharacters(title);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[titleSEODuplicate]=await c.get("db").select({titleSeo:blog_posts.titleSeo}).from(blog_posts).where(eq(blog_posts.titleSeo,titleSeo)).limit(1);if(titleSEODuplicate?.titleSeo===titleSeo){throw new HTTPException(400,{message:"Post with this title already exists."})}const[post]=await c.get("db").insert(blog_posts).values({title,titleSeo,content,categoryId}).returning();return c.json(post,201)}});
1
+ import{z}from"@hono/zod-openapi";import{buildRoute}from"@vitnode/core/api/lib/route";import{removeSpecialCharacters}from"@vitnode/core/lib/special-characters";import{eq}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";const zodPostResponseSchema=z.object({id:z.number(),title:z.string(),titleSeo:z.string(),content:z.string(),categoryId:z.number(),createdAt:z.date(),updatedAt:z.date()});export const zodCreatePostSchema=z.object({title:z.string().min(3,"Title must be at least 3 characters long").max(255,"Title must not exceed 255 characters"),content:z.string(),categoryId:z.number()});export const createPostRoute=buildRoute({pluginId:CONFIG_PLUGIN.pluginId,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,categoryId}=c.req.valid("json");const titleSeo=removeSpecialCharacters(title);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[titleSEODuplicate]=await c.get("db").select({titleSeo:blog_posts.titleSeo}).from(blog_posts).where(eq(blog_posts.titleSeo,titleSeo)).limit(1);if(titleSEODuplicate?.titleSeo===titleSeo){throw new HTTPException(400,{message:"Post with this title already exists."})}const[post]=await c.get("db").insert(blog_posts).values({title,titleSeo,content,categoryId}).returning();return c.json(post,201)}});
@@ -1,4 +1,4 @@
1
- import { z } from '@hono/zod-openapi';
1
+ import { z } from "@hono/zod-openapi";
2
2
  export declare const deletePostRoute: {
3
3
  handler: (c: import("hono").Context<import("@vitnode/core/api/middlewares/global.middleware").EnvVitNode, "/:id", {
4
4
  in: {
@@ -1 +1 @@
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({...CONFIG_PLUGIN,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)}return c.body(null,204)}});
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,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)}return c.body(null,204)}});
@@ -1,4 +1,4 @@
1
- import { z } from '@hono/zod-openapi';
1
+ import { z } from "@hono/zod-openapi";
2
2
  export declare const editPostRoute: {
3
3
  handler: (c: import("hono").Context<import("@vitnode/core/api/middlewares/global.middleware").EnvVitNode, "/:id", {
4
4
  in: {
@@ -45,7 +45,7 @@ export declare const editPostRoute: {
45
45
  }, z.core.$strip>;
46
46
  body: {
47
47
  content: {
48
- 'application/json': {
48
+ "application/json": {
49
49
  schema: z.ZodObject<{
50
50
  title: z.ZodString;
51
51
  content: z.ZodString;
@@ -58,7 +58,7 @@ export declare const editPostRoute: {
58
58
  responses: {
59
59
  200: {
60
60
  content: {
61
- 'application/json': {
61
+ "application/json": {
62
62
  schema: z.ZodObject<{
63
63
  id: z.ZodNumber;
64
64
  title: z.ZodString;
@@ -1 +1 @@
1
- import{z}from"@hono/zod-openapi";import{buildRoute}from"@vitnode/core/api/lib/route";import{removeSpecialCharacters}from"@vitnode/core/lib/special-characters";import{eq}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{zodCreatePostSchema}from"./create.route.js";const zodPostResponseSchema=z.object({id:z.number(),title:z.string(),titleSeo:z.string(),content:z.string(),categoryId:z.number(),createdAt:z.date(),updatedAt:z.date()});export const editPostRoute=buildRoute({...CONFIG_PLUGIN,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,categoryId}=c.req.valid("json");const titleSeo=removeSpecialCharacters(title);const[existingPost]=await c.get("db").select({titleSeo:blog_posts.titleSeo}).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[titleSEODuplicate]=await c.get("db").select({titleSeo:blog_posts.titleSeo}).from(blog_posts).where(eq(blog_posts.titleSeo,titleSeo)).limit(1);if(titleSEODuplicate?.titleSeo===titleSeo&&titleSEODuplicate.titleSeo!==existingPost.titleSeo){throw new HTTPException(400,{message:"Post with this title already exists."})}const[post]=await c.get("db").update(blog_posts).set({title,titleSeo,content,categoryId}).where(eq(blog_posts.id,id)).returning();return c.json(post)}});
1
+ import{z}from"@hono/zod-openapi";import{buildRoute}from"@vitnode/core/api/lib/route";import{removeSpecialCharacters}from"@vitnode/core/lib/special-characters";import{eq}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{zodCreatePostSchema}from"./create.route.js";const zodPostResponseSchema=z.object({id:z.number(),title:z.string(),titleSeo:z.string(),content:z.string(),categoryId:z.number(),createdAt:z.date(),updatedAt:z.date()});export const editPostRoute=buildRoute({pluginId:CONFIG_PLUGIN.pluginId,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,categoryId}=c.req.valid("json");const titleSeo=removeSpecialCharacters(title);const[existingPost]=await c.get("db").select({titleSeo:blog_posts.titleSeo}).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[titleSEODuplicate]=await c.get("db").select({titleSeo:blog_posts.titleSeo}).from(blog_posts).where(eq(blog_posts.titleSeo,titleSeo)).limit(1);if(titleSEODuplicate?.titleSeo===titleSeo&&titleSEODuplicate.titleSeo!==existingPost.titleSeo){throw new HTTPException(400,{message:"Post with this title already exists."})}const[post]=await c.get("db").update(blog_posts).set({title,titleSeo,content,categoryId}).where(eq(blog_posts.id,id)).returning();return c.json(post)}});
@@ -59,7 +59,7 @@ export declare const categoriesModule: import("@vitnode/core/api/lib/module").Bu
59
59
  responses: {
60
60
  200: {
61
61
  content: {
62
- 'application/json': {
62
+ "application/json": {
63
63
  schema: import("zod").ZodObject<{
64
64
  edges: import("zod").ZodArray<import("zod").ZodObject<{
65
65
  id: import("zod").ZodNumber;
@@ -94,7 +94,7 @@ export declare const categoriesModule: import("@vitnode/core/api/lib/module").Bu
94
94
  responses: {
95
95
  200: {
96
96
  content: {
97
- 'text/plain': {
97
+ "text/plain": {
98
98
  schema: import("zod").ZodString;
99
99
  };
100
100
  };
@@ -102,7 +102,7 @@ export declare const categoriesModule: import("@vitnode/core/api/lib/module").Bu
102
102
  };
103
103
  201: {
104
104
  content: {
105
- 'text/plain': {
105
+ "text/plain": {
106
106
  schema: import("zod").ZodString;
107
107
  };
108
108
  };
@@ -1 +1 @@
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({...CONFIG_PLUGIN,name:"categories",routes:[categoriesRoute,testRoute]});
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,4 +1,4 @@
1
- import { z } from '@hono/zod-openapi';
1
+ import { z } from "@hono/zod-openapi";
2
2
  export declare const categoriesRoute: {
3
3
  handler: (c: import("hono").Context<import("@vitnode/core/api/middlewares/global.middleware").EnvVitNode, "/", {
4
4
  in: {
@@ -60,7 +60,7 @@ export declare const categoriesRoute: {
60
60
  responses: {
61
61
  200: {
62
62
  content: {
63
- 'application/json': {
63
+ "application/json": {
64
64
  schema: z.ZodObject<{
65
65
  edges: z.ZodArray<z.ZodObject<{
66
66
  id: z.ZodNumber;
@@ -1 +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;AAmBtC,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiE1B,CAAC"}
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;AAmBtC,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsE1B,CAAC"}
@@ -1 +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{and,ilike}from"drizzle-orm";import{CONFIG_PLUGIN}from"../../../../const.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(),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?ilike(blog_categories.title,`%${query.search}%`):undefined;const combinedWhere=searchCondition?where?and(where,searchCondition):searchCondition: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"}});return c.json(data)}});
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{and,ilike}from"drizzle-orm";import{CONFIG_PLUGIN}from"../../../../const.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({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?ilike(blog_categories.title,`%${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"}});return c.json(data)}});
@@ -1,4 +1,4 @@
1
- import { z } from 'zod';
1
+ import { z } from "zod";
2
2
  export declare const testRoute: {
3
3
  handler: (c: import("hono").Context<import("@vitnode/core/api/middlewares/global.middleware").EnvVitNode, "/test", {}>) => Promise<Response & import("hono").TypedResponse<"test", 201 | 200, "text">>;
4
4
  pluginId: "@vitnode/blog";
@@ -9,7 +9,7 @@ export declare const testRoute: {
9
9
  responses: {
10
10
  200: {
11
11
  content: {
12
- 'text/plain': {
12
+ "text/plain": {
13
13
  schema: z.ZodString;
14
14
  };
15
15
  };
@@ -17,7 +17,7 @@ export declare const testRoute: {
17
17
  };
18
18
  201: {
19
19
  content: {
20
- 'text/plain': {
20
+ "text/plain": {
21
21
  schema: z.ZodString;
22
22
  };
23
23
  };
@@ -1 +1 @@
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({...CONFIG_PLUGIN,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:3,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
+ 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:3,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")}});
@@ -67,7 +67,7 @@ export declare const postsModule: import("@vitnode/core/api/lib/module").BuildMo
67
67
  responses: {
68
68
  200: {
69
69
  content: {
70
- 'application/json': {
70
+ "application/json": {
71
71
  schema: import("zod").ZodObject<{
72
72
  edges: import("zod").ZodArray<import("zod").ZodObject<{
73
73
  id: import("zod").ZodNumber;
@@ -1 +1 @@
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({...CONFIG_PLUGIN,name:"posts",routes:[postsRoute]});
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]});
@@ -1,4 +1,4 @@
1
- import { z } from '@hono/zod-openapi';
1
+ import { z } from "@hono/zod-openapi";
2
2
  export declare const zodPostSchema: z.ZodObject<{
3
3
  id: z.ZodNumber;
4
4
  title: z.ZodString;
@@ -82,7 +82,7 @@ export declare const postsRoute: {
82
82
  responses: {
83
83
  200: {
84
84
  content: {
85
- 'application/json': {
85
+ "application/json": {
86
86
  schema: z.ZodObject<{
87
87
  edges: z.ZodArray<z.ZodObject<{
88
88
  id: z.ZodNumber;
@@ -1 +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{eq}from"drizzle-orm";import{CONFIG_PLUGIN}from"../../../../const.js";import{blog_categories}from"../../../../database/categories.js";import{blog_posts}from"../../../../database/posts.js";export const zodPostSchema=z.object({id:z.number(),title:z.string(),titleSeo:z.string(),content:z.string(),categoryId:z.number(),createdAt:z.date(),updatedAt:z.date(),category:z.object({id:z.number(),title:z.string(),titleSeo:z.string()})});export const postsRoute=buildRoute({...CONFIG_PLUGIN,route:{method:"get",path:"/",request:{query:zodPaginationQuery.extend({order:z.enum(["asc","desc"]).optional(),orderBy:z.enum(["updatedAt","createdAt"]).optional(),categoryId:z.string().transform(Number).optional()})},responses:{200:{content:{"application/json":{schema:z.object({edges:z.array(zodPostSchema),pageInfo:zodPaginationPageInfo})}},description:"Posts retrieved successfully"}}},handler:async c=>{const query=c.req.valid("query");const data=await withPagination({c,params:{query},primaryCursor:blog_posts.id,query:async({limit,where,orderBy})=>await c.get("db").select({id:blog_posts.id,title:blog_posts.title,titleSeo:blog_posts.titleSeo,content:blog_posts.content,categoryId:blog_posts.categoryId,createdAt:blog_posts.createdAt,updatedAt:blog_posts.updatedAt,category:{id:blog_categories.id,title:blog_categories.title,titleSeo:blog_categories.titleSeo}}).from(blog_posts).innerJoin(blog_categories,eq(blog_posts.categoryId,blog_categories.id)).where(query.categoryId?eq(blog_posts.categoryId,query.categoryId):where).orderBy(orderBy).limit(limit),table:blog_posts,orderBy:{column:query.orderBy?blog_posts[query.orderBy]:blog_posts.updatedAt,order:query.order??"desc"}});return c.json(data)}});
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{eq}from"drizzle-orm";import{CONFIG_PLUGIN}from"../../../../const.js";import{blog_categories}from"../../../../database/categories.js";import{blog_posts}from"../../../../database/posts.js";export const zodPostSchema=z.object({id:z.number(),title:z.string(),titleSeo:z.string(),content:z.string(),categoryId:z.number(),createdAt:z.date(),updatedAt:z.date(),category:z.object({id:z.number(),title:z.string(),titleSeo:z.string()})});export const postsRoute=buildRoute({pluginId:CONFIG_PLUGIN.pluginId,route:{method:"get",path:"/",request:{query:zodPaginationQuery.extend({order:z.enum(["asc","desc"]).optional(),orderBy:z.enum(["updatedAt","createdAt"]).optional(),categoryId:z.string().transform(Number).optional()})},responses:{200:{content:{"application/json":{schema:z.object({edges:z.array(zodPostSchema),pageInfo:zodPaginationPageInfo})}},description:"Posts retrieved successfully"}}},handler:async c=>{const query=c.req.valid("query");const data=await withPagination({c,params:{query},primaryCursor:blog_posts.id,query:async({limit,where,orderBy})=>await c.get("db").select({id:blog_posts.id,title:blog_posts.title,titleSeo:blog_posts.titleSeo,content:blog_posts.content,categoryId:blog_posts.categoryId,createdAt:blog_posts.createdAt,updatedAt:blog_posts.updatedAt,category:{id:blog_categories.id,title:blog_categories.title,titleSeo:blog_categories.titleSeo}}).from(blog_posts).innerJoin(blog_categories,eq(blog_posts.categoryId,blog_categories.id)).where(query.categoryId?eq(blog_posts.categoryId,query.categoryId):where).orderBy(orderBy).limit(limit),table:blog_posts,orderBy:{column:query.orderBy?blog_posts[query.orderBy]:blog_posts.updatedAt,order:query.order??"desc"}});return c.json(data)}});
@@ -1,5 +1,5 @@
1
- import type { Metadata } from 'next';
2
- import React from 'react';
1
+ import type { Metadata } from "next";
2
+ import React from "react";
3
3
  declare const CategoriesAdminView: React.ComponentType<{
4
4
  searchParams: Promise<Record<string, string | string[] | undefined>>;
5
5
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../../../src/app_admin/blog/categories/page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAOrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,QAAA,MAAM,mBAAmB;;EAIxB,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAAa,OAAO,CAAC,QAAQ,CAMzD,CAAC;AAEF,wBAA8B,cAAc,CAC1C,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,mBAAmB,CAAC,oDAoBzD"}
1
+ {"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../../../src/app_admin/blog/categories/page.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAGrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,QAAA,MAAM,mBAAmB;;EAIxB,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAAa,OAAO,CAAC,QAAQ,CAMzD,CAAC;AAEF,wBAA8B,cAAc,CAC1C,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,mBAAmB,CAAC,oDAoBzD"}
@@ -1 +1 @@
1
- import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{I18nProvider}from"@vitnode/core/components/i18n-provider";import{DataTableSkeleton}from"@vitnode/core/components/table/data-table";import{HeaderContent}from"@vitnode/core/components/ui/header-content";import{getTranslations}from"next-intl/server";import dynamic from"next/dynamic";import React from"react";import{ActionsCategoriesAdmin}from"../../../views/admin/categories/actions/actions.js";const CategoriesAdminView=dynamic(async()=>import("../../../views/admin/categories/table/categories-admin-view.js").then(mod=>({default:mod.CategoriesAdminView})));export const generateMetadata=async()=>{const t=await getTranslations("@vitnode/blog.admin.nav");return{title:t("categories")}};export default async function CategoriesPage(params){const[t,tNav]=await Promise.all([getTranslations("@vitnode/blog.admin.categories"),getTranslations("@vitnode/blog.admin.nav")]);return _jsx(I18nProvider,{namespaces:["@vitnode/blog.admin.categories"],children:_jsxs("div",{className:"p-4",children:[_jsx(HeaderContent,{desc:t("desc"),h1:tNav("categories"),children:_jsx(ActionsCategoriesAdmin,{})}),_jsx(React.Suspense,{fallback:_jsx(DataTableSkeleton,{columns:4}),children:_jsx(CategoriesAdminView,{...params})})]})})}
1
+ import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{I18nProvider}from"@vitnode/core/components/i18n-provider";import{DataTableSkeleton}from"@vitnode/core/components/table/data-table";import{HeaderContent}from"@vitnode/core/components/ui/header-content";import dynamic from"next/dynamic";import{getTranslations}from"next-intl/server";import React from"react";import{ActionsCategoriesAdmin}from"../../../views/admin/categories/actions/actions.js";const CategoriesAdminView=dynamic(async()=>import("../../../views/admin/categories/table/categories-admin-view.js").then(mod=>({default:mod.CategoriesAdminView})));export const generateMetadata=async()=>{const t=await getTranslations("@vitnode/blog.admin.nav");return{title:t("categories")}};export default async function CategoriesPage(params){const[t,tNav]=await Promise.all([getTranslations("@vitnode/blog.admin.categories"),getTranslations("@vitnode/blog.admin.nav")]);return _jsx(I18nProvider,{namespaces:["@vitnode/blog.admin.categories"],children:_jsxs("div",{className:"p-4",children:[_jsx(HeaderContent,{desc:t("desc"),h1:tNav("categories"),children:_jsx(ActionsCategoriesAdmin,{})}),_jsx(React.Suspense,{fallback:_jsx(DataTableSkeleton,{columns:4}),children:_jsx(CategoriesAdminView,{...params})})]})})}
@@ -1,5 +1,5 @@
1
- import type { Metadata } from 'next';
2
- import React from 'react';
1
+ import type { Metadata } from "next";
2
+ import React from "react";
3
3
  declare const PostsAdminView: React.ComponentType<{
4
4
  searchParams: Promise<Record<string, string | string[] | undefined>>;
5
5
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../../../src/app_admin/blog/posts/page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAOrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,QAAA,MAAM,cAAc;;EAInB,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAAa,OAAO,CAAC,QAAQ,CAMzD,CAAC;AAEF,wBAA8B,SAAS,CACrC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,oDAoBpD"}
1
+ {"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../../../src/app_admin/blog/posts/page.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAGrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,QAAA,MAAM,cAAc;;EAInB,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAAa,OAAO,CAAC,QAAQ,CAMzD,CAAC;AAEF,wBAA8B,SAAS,CACrC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,oDAoBpD"}
@@ -1 +1 @@
1
- import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{I18nProvider}from"@vitnode/core/components/i18n-provider";import{DataTableSkeleton}from"@vitnode/core/components/table/data-table";import{HeaderContent}from"@vitnode/core/components/ui/header-content";import{getTranslations}from"next-intl/server";import dynamic from"next/dynamic";import React from"react";import{ActionsPostsAdmin}from"../../../views/admin/posts/actions/actions.js";const PostsAdminView=dynamic(async()=>import("../../../views/admin/posts/table/posts-admin-view.js").then(mod=>({default:mod.PostsAdminView})));export const generateMetadata=async()=>{const t=await getTranslations("@vitnode/blog.admin.nav");return{title:t("posts")}};export default async function PostsPage(params){const[t,tNav]=await Promise.all([getTranslations("@vitnode/blog.admin.posts"),getTranslations("@vitnode/blog.admin.nav")]);return _jsx(I18nProvider,{namespaces:["@vitnode/blog.admin.posts"],children:_jsxs("div",{className:"p-4",children:[_jsx(HeaderContent,{desc:t("desc"),h1:tNav("posts"),children:_jsx(ActionsPostsAdmin,{})}),_jsx(React.Suspense,{fallback:_jsx(DataTableSkeleton,{columns:5}),children:_jsx(PostsAdminView,{...params})})]})})}
1
+ import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{I18nProvider}from"@vitnode/core/components/i18n-provider";import{DataTableSkeleton}from"@vitnode/core/components/table/data-table";import{HeaderContent}from"@vitnode/core/components/ui/header-content";import dynamic from"next/dynamic";import{getTranslations}from"next-intl/server";import React from"react";import{ActionsPostsAdmin}from"../../../views/admin/posts/actions/actions.js";const PostsAdminView=dynamic(async()=>import("../../../views/admin/posts/table/posts-admin-view.js").then(mod=>({default:mod.PostsAdminView})));export const generateMetadata=async()=>{const t=await getTranslations("@vitnode/blog.admin.nav");return{title:t("posts")}};export default async function PostsPage(params){const[t,tNav]=await Promise.all([getTranslations("@vitnode/blog.admin.posts"),getTranslations("@vitnode/blog.admin.nav")]);return _jsx(I18nProvider,{namespaces:["@vitnode/blog.admin.posts"],children:_jsxs("div",{className:"p-4",children:[_jsx(HeaderContent,{desc:t("desc"),h1:tNav("posts"),children:_jsx(ActionsPostsAdmin,{})}),_jsx(React.Suspense,{fallback:_jsx(DataTableSkeleton,{columns:5}),children:_jsx(PostsAdminView,{...params})})]})})}
@@ -1 +1 @@
1
- import{buildApiPlugin}from"@vitnode/core/api/lib/plugin";import{CONFIG_PLUGIN}from"./const.js";import{adminModule}from"./api/modules/admin/admin.module.js";import{categoriesModule}from"./api/modules/categories/categories.module.js";import{postsModule}from"./api/modules/posts/posts.module.js";export const blogApiPlugin=()=>{return buildApiPlugin({...CONFIG_PLUGIN,modules:[adminModule,categoriesModule,postsModule]})};
1
+ import{buildApiPlugin}from"@vitnode/core/api/lib/plugin";import{CONFIG_PLUGIN}from"./const.js";import{adminModule}from"./api/modules/admin/admin.module.js";import{categoriesModule}from"./api/modules/categories/categories.module.js";import{postsModule}from"./api/modules/posts/posts.module.js";export const blogApiPlugin=()=>{return buildApiPlugin({pluginId:CONFIG_PLUGIN.pluginId,modules:[adminModule,categoriesModule,postsModule]})};
@@ -1 +1 @@
1
- import{jsx as _jsx}from"react/jsx-runtime";import{buildPlugin}from"@vitnode/core/lib/plugin";import{ListIcon,NotebookPenIcon}from"lucide-react";import{CONFIG_PLUGIN}from"./const.js";export const blogPlugin=()=>{return buildPlugin({...CONFIG_PLUGIN,admin:{nav:[{id:"posts",href:"/admin/blog/posts",icon:_jsx(NotebookPenIcon,{})},{id:"categories",href:"/admin/blog/categories",icon:_jsx(ListIcon,{})}]}})};
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{buildPlugin}from"@vitnode/core/lib/plugin";import{ListIcon,NotebookPenIcon}from"lucide-react";import{CONFIG_PLUGIN}from"./const.js";export const blogPlugin=()=>{return buildPlugin({pluginId:CONFIG_PLUGIN.pluginId,admin:{nav:[{id:"posts",href:"/admin/blog/posts",icon:_jsx(NotebookPenIcon,{})},{id:"categories",href:"/admin/blog/categories",icon:_jsx(ListIcon,{})}]}})};
@@ -1,4 +1,4 @@
1
- export * from './categories';
2
- export * from './posts';
3
- export * from './relations';
1
+ export * from "./categories";
2
+ export * from "./posts";
3
+ export * from "./relations";
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- import { type DefaultTemplateEmailProps } from '@vitnode/core/emails/default-template';
1
+ import { type DefaultTemplateEmailProps } from "@vitnode/core/emails/default-template";
2
2
  declare function TestTemplateEmail({ user, ...props }: DefaultTemplateEmailProps): import("react/jsx-runtime").JSX.Element | null;
3
3
  declare namespace TestTemplateEmail {
4
4
  var PreviewProps: {
@@ -1 +1 @@
1
- {"version":3,"file":"test-template.d.ts","sourceRoot":"","sources":["../../../src/emails/test-template.tsx"],"names":[],"mappings":"AACA,OAA6B,EAC3B,KAAK,yBAAyB,EAC/B,MAAM,uCAAuC,CAAC;AAE/C,iBAAwB,iBAAiB,CAAC,EACxC,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,yBAAyB,kDAQ3B;kBAXuB,iBAAiB;;;;;;;;;;;;;;;;;;;eAAjB,iBAAiB"}
1
+ {"version":3,"file":"test-template.d.ts","sourceRoot":"","sources":["../../../src/emails/test-template.tsx"],"names":[],"mappings":"AACA,OAA6B,EAC3B,KAAK,yBAAyB,EAC/B,MAAM,uCAAuC,CAAC;AAK/C,iBAAwB,iBAAiB,CAAC,EACxC,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,yBAAyB,kDAQ3B;kBAXuB,iBAAiB;;;;;;;;;;;;;;;;;;;eAAjB,iBAAiB"}
@@ -1 +1 @@
1
- import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{Text}from"@react-email/components";import DefaultTemplateEmail from"@vitnode/core/emails/default-template";export default function TestTemplateEmail({user,...props}){if(!user)return null;return _jsx(DefaultTemplateEmail,{...props,children:_jsxs(Text,{children:["This message is for ",user.name]})})}TestTemplateEmail.PreviewProps=DefaultTemplateEmail.PreviewProps;
1
+ import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{Text}from"@react-email/components";import DefaultTemplateEmail from"@vitnode/core/emails/default-template";TestTemplateEmail.PreviewProps=DefaultTemplateEmail.PreviewProps;export default function TestTemplateEmail({user,...props}){if(!user)return null;return _jsx(DefaultTemplateEmail,{...props,children:_jsxs(Text,{children:["This message is for ",user.name]})})}
@@ -1 +1 @@
1
- "use client";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{Button}from"@vitnode/core/components/ui/button";import{Dialog,DialogContent,DialogDescription,DialogHeader,DialogTitle,DialogTrigger}from"@vitnode/core/components/ui/dialog";import{Loader}from"@vitnode/core/components/ui/loader";import{PlusIcon}from"lucide-react";import{useTranslations}from"next-intl";import dynamic from"next/dynamic";import React from"react";const CreateEditActionCategoriesAdmin=dynamic(async()=>import("./create-edit/create-edit.js").then(mod=>({default:mod.CreateEditActionCategoriesAdmin})));export const ActionsCategoriesAdmin=()=>{const t=useTranslations("@vitnode/blog.admin.categories.create");return _jsxs(Dialog,{children:[_jsx(DialogTrigger,{asChild:true,children:_jsxs(Button,{children:[_jsx(PlusIcon,{}),t("title")]})}),_jsxs(DialogContent,{children:[_jsxs(DialogHeader,{children:[_jsx(DialogTitle,{children:t("title")}),_jsx(DialogDescription,{children:t("desc")})]}),_jsx(React.Suspense,{fallback:_jsx(Loader,{}),children:_jsx(CreateEditActionCategoriesAdmin,{})})]})]})};
1
+ "use client";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{Button}from"@vitnode/core/components/ui/button";import{Dialog,DialogContent,DialogDescription,DialogHeader,DialogTitle,DialogTrigger}from"@vitnode/core/components/ui/dialog";import{Loader}from"@vitnode/core/components/ui/loader";import{PlusIcon}from"lucide-react";import dynamic from"next/dynamic";import{useTranslations}from"next-intl";import React from"react";const CreateEditActionCategoriesAdmin=dynamic(async()=>import("./create-edit/create-edit.js").then(mod=>({default:mod.CreateEditActionCategoriesAdmin})));export const ActionsCategoriesAdmin=()=>{const t=useTranslations("@vitnode/blog.admin.categories.create");return _jsxs(Dialog,{children:[_jsx(DialogTrigger,{asChild:true,children:_jsxs(Button,{children:[_jsx(PlusIcon,{}),t("title")]})}),_jsxs(DialogContent,{children:[_jsxs(DialogHeader,{children:[_jsx(DialogTitle,{children:t("title")}),_jsx(DialogDescription,{children:t("desc")})]}),_jsx(React.Suspense,{fallback:_jsx(Loader,{}),children:_jsx(CreateEditActionCategoriesAdmin,{})})]})]})};