@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.
Files changed (194) hide show
  1. package/dist/src/api/lib/categories-language.d.ts +10 -0
  2. package/dist/src/api/lib/categories-language.d.ts.map +1 -0
  3. package/dist/src/api/lib/categories-language.js +1 -0
  4. package/dist/src/api/lib/events.d.ts +28 -0
  5. package/dist/src/api/lib/events.d.ts.map +1 -0
  6. package/dist/src/api/lib/events.js +1 -0
  7. package/dist/src/api/lib/posts-language.d.ts +17 -0
  8. package/dist/src/api/lib/posts-language.d.ts.map +1 -0
  9. package/dist/src/api/lib/posts-language.js +1 -0
  10. package/dist/src/api/lib/search.d.ts +13 -0
  11. package/dist/src/api/lib/search.d.ts.map +1 -0
  12. package/dist/src/api/lib/search.js +1 -0
  13. package/dist/src/api/modules/admin/admin.module.d.ts +197 -180
  14. package/dist/src/api/modules/admin/admin.module.d.ts.map +1 -1
  15. package/dist/src/api/modules/admin/admin.module.js +1 -2
  16. package/dist/src/api/modules/admin/categories/categories.admin.module.d.ts +83 -80
  17. package/dist/src/api/modules/admin/categories/categories.admin.module.d.ts.map +1 -1
  18. package/dist/src/api/modules/admin/categories/categories.admin.module.js +1 -2
  19. package/dist/src/api/modules/admin/categories/routes/create.route.d.ts +38 -34
  20. package/dist/src/api/modules/admin/categories/routes/create.route.d.ts.map +1 -1
  21. package/dist/src/api/modules/admin/categories/routes/create.route.js +1 -2
  22. package/dist/src/api/modules/admin/categories/routes/delete.route.d.ts +15 -18
  23. package/dist/src/api/modules/admin/categories/routes/delete.route.d.ts.map +1 -1
  24. package/dist/src/api/modules/admin/categories/routes/delete.route.js +1 -2
  25. package/dist/src/api/modules/admin/categories/routes/edit.route.d.ts +38 -38
  26. package/dist/src/api/modules/admin/categories/routes/edit.route.d.ts.map +1 -1
  27. package/dist/src/api/modules/admin/categories/routes/edit.route.js +1 -2
  28. package/dist/src/api/modules/admin/posts/posts.admin.module.d.ts +104 -93
  29. package/dist/src/api/modules/admin/posts/posts.admin.module.d.ts.map +1 -1
  30. package/dist/src/api/modules/admin/posts/posts.admin.module.js +1 -2
  31. package/dist/src/api/modules/admin/posts/routes/create.route.d.ts +58 -44
  32. package/dist/src/api/modules/admin/posts/routes/create.route.d.ts.map +1 -1
  33. package/dist/src/api/modules/admin/posts/routes/create.route.js +1 -2
  34. package/dist/src/api/modules/admin/posts/routes/delete.route.d.ts +15 -18
  35. package/dist/src/api/modules/admin/posts/routes/delete.route.d.ts.map +1 -1
  36. package/dist/src/api/modules/admin/posts/routes/delete.route.js +1 -2
  37. package/dist/src/api/modules/admin/posts/routes/edit.route.d.ts +47 -43
  38. package/dist/src/api/modules/admin/posts/routes/edit.route.d.ts.map +1 -1
  39. package/dist/src/api/modules/admin/posts/routes/edit.route.js +1 -2
  40. package/dist/src/api/modules/categories/categories.module.d.ts +65 -64
  41. package/dist/src/api/modules/categories/categories.module.d.ts.map +1 -1
  42. package/dist/src/api/modules/categories/categories.module.js +1 -2
  43. package/dist/src/api/modules/categories/routes/get.route.d.ts +56 -45
  44. package/dist/src/api/modules/categories/routes/get.route.d.ts.map +1 -1
  45. package/dist/src/api/modules/categories/routes/get.route.js +1 -2
  46. package/dist/src/api/modules/categories/test.route.d.ts +20 -23
  47. package/dist/src/api/modules/categories/test.route.d.ts.map +1 -1
  48. package/dist/src/api/modules/categories/test.route.js +1 -2
  49. package/dist/src/api/modules/posts/posts.module.d.ts +68 -54
  50. package/dist/src/api/modules/posts/posts.module.d.ts.map +1 -1
  51. package/dist/src/api/modules/posts/posts.module.js +1 -2
  52. package/dist/src/api/modules/posts/routes/get.route.d.ts +97 -66
  53. package/dist/src/api/modules/posts/routes/get.route.d.ts.map +1 -1
  54. package/dist/src/api/modules/posts/routes/get.route.js +1 -2
  55. package/dist/src/config.api.d.ts +1 -4
  56. package/dist/src/config.api.d.ts.map +1 -1
  57. package/dist/src/config.api.js +1 -2
  58. package/dist/src/config.d.ts +1 -4
  59. package/dist/src/config.d.ts.map +1 -1
  60. package/dist/src/config.js +1 -2
  61. package/dist/src/const.d.ts +2 -5
  62. package/dist/src/const.d.ts.map +1 -1
  63. package/dist/src/const.js +1 -2
  64. package/dist/src/database/categories.d.ts +76 -98
  65. package/dist/src/database/categories.d.ts.map +1 -1
  66. package/dist/src/database/categories.js +1 -2
  67. package/dist/src/database/index.d.ts +4 -4
  68. package/dist/src/database/index.d.ts.map +1 -0
  69. package/dist/src/database/index.js +1 -1
  70. package/dist/src/database/posts.d.ts +91 -132
  71. package/dist/src/database/posts.d.ts.map +1 -1
  72. package/dist/src/database/posts.js +1 -2
  73. package/dist/src/database/relations.d.ts +4 -7
  74. package/dist/src/database/relations.d.ts.map +1 -1
  75. package/dist/src/database/relations.js +1 -2
  76. package/dist/src/emails/test-template.d.ts +18 -20
  77. package/dist/src/emails/test-template.d.ts.map +1 -1
  78. package/dist/src/emails/test-template.js +1 -2
  79. package/dist/src/globals.css +44 -0
  80. package/dist/src/locales/en.json +92 -0
  81. package/dist/src/locales/index.d.ts +4 -0
  82. package/dist/src/locales/index.d.ts.map +1 -0
  83. package/dist/src/locales/index.js +1 -0
  84. package/dist/src/routes/admin/blog/categories/page.d.ts +5 -7
  85. package/dist/src/routes/admin/blog/categories/page.d.ts.map +1 -1
  86. package/dist/src/routes/admin/blog/categories/page.js +1 -2
  87. package/dist/src/routes/admin/blog/posts/page.d.ts +5 -7
  88. package/dist/src/routes/admin/blog/posts/page.d.ts.map +1 -1
  89. package/dist/src/routes/admin/blog/posts/page.js +1 -2
  90. package/dist/src/routes/breadcrumb/admin/blog/categories/page.d.ts +2 -0
  91. package/dist/src/routes/breadcrumb/admin/blog/categories/page.d.ts.map +1 -0
  92. package/dist/src/routes/breadcrumb/admin/blog/categories/page.js +1 -0
  93. package/dist/src/routes/breadcrumb/admin/blog/posts/page.d.ts +2 -0
  94. package/dist/src/routes/breadcrumb/admin/blog/posts/page.d.ts.map +1 -0
  95. package/dist/src/routes/breadcrumb/admin/blog/posts/page.js +1 -0
  96. package/dist/src/views/admin/categories/actions/actions.d.ts +1 -4
  97. package/dist/src/views/admin/categories/actions/actions.d.ts.map +1 -1
  98. package/dist/src/views/admin/categories/actions/actions.js +1 -2
  99. package/dist/src/views/admin/categories/actions/create-edit/create-edit.d.ts +5 -8
  100. package/dist/src/views/admin/categories/actions/create-edit/create-edit.d.ts.map +1 -1
  101. package/dist/src/views/admin/categories/actions/create-edit/create-edit.js +1 -2
  102. package/dist/src/views/admin/categories/actions/create-edit/mutation-api.server.d.ts +11 -0
  103. package/dist/src/views/admin/categories/actions/create-edit/mutation-api.server.d.ts.map +1 -0
  104. package/dist/src/views/admin/categories/actions/create-edit/mutation-api.server.js +1 -0
  105. package/dist/src/views/admin/categories/table/actions/delete/delete-action.d.ts +3 -6
  106. package/dist/src/views/admin/categories/table/actions/delete/delete-action.d.ts.map +1 -1
  107. package/dist/src/views/admin/categories/table/actions/delete/delete-action.js +1 -2
  108. package/dist/src/views/admin/categories/table/actions/delete/mutation-api.server.d.ts +4 -0
  109. package/dist/src/views/admin/categories/table/actions/delete/mutation-api.server.d.ts.map +1 -0
  110. package/dist/src/views/admin/categories/table/actions/delete/mutation-api.server.js +1 -0
  111. package/dist/src/views/admin/categories/table/actions/edit-action.d.ts +5 -8
  112. package/dist/src/views/admin/categories/table/actions/edit-action.d.ts.map +1 -1
  113. package/dist/src/views/admin/categories/table/actions/edit-action.js +1 -2
  114. package/dist/src/views/admin/categories/table/categories-admin-view.d.ts +2 -5
  115. package/dist/src/views/admin/categories/table/categories-admin-view.d.ts.map +1 -1
  116. package/dist/src/views/admin/categories/table/categories-admin-view.js +1 -2
  117. package/dist/src/views/admin/posts/actions/actions.d.ts +1 -4
  118. package/dist/src/views/admin/posts/actions/actions.d.ts.map +1 -1
  119. package/dist/src/views/admin/posts/actions/actions.js +1 -2
  120. package/dist/src/views/admin/posts/actions/create-edit/create-edit.d.ts +7 -9
  121. package/dist/src/views/admin/posts/actions/create-edit/create-edit.d.ts.map +1 -1
  122. package/dist/src/views/admin/posts/actions/create-edit/create-edit.js +1 -2
  123. package/dist/src/views/admin/posts/actions/create-edit/multi-lang-fields.d.ts +10 -0
  124. package/dist/src/views/admin/posts/actions/create-edit/multi-lang-fields.d.ts.map +1 -0
  125. package/dist/src/views/admin/posts/actions/create-edit/multi-lang-fields.js +1 -0
  126. package/dist/src/views/admin/posts/actions/create-edit/mutation-api.server.d.ts +11 -0
  127. package/dist/src/views/admin/posts/actions/create-edit/mutation-api.server.d.ts.map +1 -0
  128. package/dist/src/views/admin/posts/actions/create-edit/mutation-api.server.js +1 -0
  129. package/dist/src/views/admin/posts/table/actions/delete/delete-action.d.ts +3 -6
  130. package/dist/src/views/admin/posts/table/actions/delete/delete-action.d.ts.map +1 -1
  131. package/dist/src/views/admin/posts/table/actions/delete/delete-action.js +1 -2
  132. package/dist/src/views/admin/posts/table/actions/delete/mutation-api.server.d.ts +4 -0
  133. package/dist/src/views/admin/posts/table/actions/delete/mutation-api.server.d.ts.map +1 -0
  134. package/dist/src/views/admin/posts/table/actions/delete/mutation-api.server.js +1 -0
  135. package/dist/src/views/admin/posts/table/actions/edit-action.d.ts +5 -8
  136. package/dist/src/views/admin/posts/table/actions/edit-action.d.ts.map +1 -1
  137. package/dist/src/views/admin/posts/table/actions/edit-action.js +1 -2
  138. package/dist/src/views/admin/posts/table/posts-admin-view.d.ts +2 -5
  139. package/dist/src/views/admin/posts/table/posts-admin-view.d.ts.map +1 -1
  140. package/dist/src/views/admin/posts/table/posts-admin-view.js +1 -2
  141. package/package.json +20 -18
  142. package/src/locales/en.json +17 -5
  143. package/src/locales/index.ts +11 -0
  144. package/src/routes/breadcrumb/admin/blog/categories/page.tsx +5 -0
  145. package/src/routes/breadcrumb/admin/blog/posts/page.tsx +5 -0
  146. package/dist/src/api/modules/admin/admin.module.js.map +0 -1
  147. package/dist/src/api/modules/admin/categories/categories.admin.module.js.map +0 -1
  148. package/dist/src/api/modules/admin/categories/routes/create.route.js.map +0 -1
  149. package/dist/src/api/modules/admin/categories/routes/delete.route.js.map +0 -1
  150. package/dist/src/api/modules/admin/categories/routes/edit.route.js.map +0 -1
  151. package/dist/src/api/modules/admin/posts/posts.admin.module.js.map +0 -1
  152. package/dist/src/api/modules/admin/posts/routes/create.route.js.map +0 -1
  153. package/dist/src/api/modules/admin/posts/routes/delete.route.js.map +0 -1
  154. package/dist/src/api/modules/admin/posts/routes/edit.route.js.map +0 -1
  155. package/dist/src/api/modules/categories/categories.module.js.map +0 -1
  156. package/dist/src/api/modules/categories/routes/get.route.js.map +0 -1
  157. package/dist/src/api/modules/categories/test.route.js.map +0 -1
  158. package/dist/src/api/modules/posts/posts.module.js.map +0 -1
  159. package/dist/src/api/modules/posts/routes/get.route.js.map +0 -1
  160. package/dist/src/config.api.js.map +0 -1
  161. package/dist/src/config.js.map +0 -1
  162. package/dist/src/const.js.map +0 -1
  163. package/dist/src/database/categories.js.map +0 -1
  164. package/dist/src/database/posts.js.map +0 -1
  165. package/dist/src/database/relations.js.map +0 -1
  166. package/dist/src/emails/test-template.js.map +0 -1
  167. package/dist/src/routes/admin/blog/categories/page.js.map +0 -1
  168. package/dist/src/routes/admin/blog/posts/page.js.map +0 -1
  169. package/dist/src/views/admin/categories/actions/actions.js.map +0 -1
  170. package/dist/src/views/admin/categories/actions/create-edit/create-edit.js.map +0 -1
  171. package/dist/src/views/admin/categories/actions/create-edit/mutation-api.d.ts +0 -14
  172. package/dist/src/views/admin/categories/actions/create-edit/mutation-api.d.ts.map +0 -1
  173. package/dist/src/views/admin/categories/actions/create-edit/mutation-api.js +0 -2
  174. package/dist/src/views/admin/categories/actions/create-edit/mutation-api.js.map +0 -1
  175. package/dist/src/views/admin/categories/table/actions/delete/delete-action.js.map +0 -1
  176. package/dist/src/views/admin/categories/table/actions/delete/mutation-api.d.ts +0 -7
  177. package/dist/src/views/admin/categories/table/actions/delete/mutation-api.d.ts.map +0 -1
  178. package/dist/src/views/admin/categories/table/actions/delete/mutation-api.js +0 -2
  179. package/dist/src/views/admin/categories/table/actions/delete/mutation-api.js.map +0 -1
  180. package/dist/src/views/admin/categories/table/actions/edit-action.js.map +0 -1
  181. package/dist/src/views/admin/categories/table/categories-admin-view.js.map +0 -1
  182. package/dist/src/views/admin/posts/actions/actions.js.map +0 -1
  183. package/dist/src/views/admin/posts/actions/create-edit/create-edit.js.map +0 -1
  184. package/dist/src/views/admin/posts/actions/create-edit/mutation-api.d.ts +0 -14
  185. package/dist/src/views/admin/posts/actions/create-edit/mutation-api.d.ts.map +0 -1
  186. package/dist/src/views/admin/posts/actions/create-edit/mutation-api.js +0 -2
  187. package/dist/src/views/admin/posts/actions/create-edit/mutation-api.js.map +0 -1
  188. package/dist/src/views/admin/posts/table/actions/delete/delete-action.js.map +0 -1
  189. package/dist/src/views/admin/posts/table/actions/delete/mutation-api.d.ts +0 -7
  190. package/dist/src/views/admin/posts/table/actions/delete/mutation-api.d.ts.map +0 -1
  191. package/dist/src/views/admin/posts/table/actions/delete/mutation-api.js +0 -2
  192. package/dist/src/views/admin/posts/table/actions/delete/mutation-api.js.map +0 -1
  193. package/dist/src/views/admin/posts/table/actions/edit-action.js.map +0 -1
  194. package/dist/src/views/admin/posts/table/posts-admin-view.js.map +0 -1
@@ -1,74 +1,75 @@
1
- //#region src/api/modules/categories/categories.module.d.ts
2
- declare const categoriesModule: import("@vitnode/core/api/lib/module").BuildModuleReturn<"@vitnode/blog", "categories", [import("@vitnode/core/api/lib/route").Route<"@vitnode/blog", {
3
- method: "get";
4
- path: "/";
5
- request: {
6
- query: import("zod").ZodObject<{
7
- cursor: import("zod").ZodOptional<import("zod").ZodString>;
8
- first: import("zod").ZodOptional<import("zod").ZodString>;
9
- last: import("zod").ZodOptional<import("zod").ZodString>;
10
- order: import("zod").ZodOptional<import("zod").ZodEnum<{
11
- asc: "asc";
12
- desc: "desc";
13
- }>>;
14
- orderBy: import("zod").ZodOptional<import("zod").ZodEnum<{
15
- updatedAt: "updatedAt";
16
- }>>;
17
- search: import("zod").ZodOptional<import("zod").ZodString>;
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
- title: import("zod").ZodString;
28
- createdAt: import("zod").ZodDate;
29
- updatedAt: import("zod").ZodDate;
30
- }, import("zod/v4/core").$strip>>;
31
- pageInfo: import("zod").ZodObject<{
32
- totalCount: import("zod").ZodNumber;
33
- count: import("zod").ZodNumber;
34
- hasNextPage: import("zod").ZodBoolean;
35
- hasPreviousPage: import("zod").ZodBoolean;
36
- startCursor: import("zod").ZodNullable<import("zod").ZodNumber>;
37
- endCursor: import("zod").ZodNullable<import("zod").ZodNumber>;
38
- }, import("zod/v4/core").$strip>;
39
- }, import("zod/v4/core").$strip>;
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
- path: string;
49
+ path: string;
47
50
  }>, import("@vitnode/core/api/lib/route").Route<"@vitnode/blog", {
48
- method: "post";
49
- description: string;
50
- path: "/test";
51
- responses: {
52
- 200: {
53
- content: {
54
- "text/plain": {
55
- schema: import("zod").ZodString;
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
- description: string;
59
- };
60
- 201: {
61
- content: {
62
- "text/plain": {
63
- schema: import("zod").ZodString;
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
- path: string;
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","names":[],"sources":["../../../../../src/api/modules/categories/categories.module.ts"],"mappings":";cAOa,yDAAgB,wFAAA"}
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 as e}from"../../../const.js";import{categoriesRoute as t}from"./routes/get.route.js";import{testRoute as n}from"./test.route.js";import{buildModule as r}from"@vitnode/core/api/lib/module";const i=r({pluginId:e.pluginId,name:`categories`,routes:[t,n]});export{i as categoriesModule};
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
- //#region src/api/modules/categories/routes/get.route.d.ts
3
- declare const categoriesRoute: import("@vitnode/core/api/lib/route").Route<"@vitnode/blog", {
4
- method: "get";
5
- path: "/";
6
- request: {
7
- query: z.ZodObject<{
8
- cursor: z.ZodOptional<z.ZodString>;
9
- first: z.ZodOptional<z.ZodString>;
10
- last: z.ZodOptional<z.ZodString>;
11
- order: z.ZodOptional<z.ZodEnum<{
12
- asc: "asc";
13
- desc: "desc";
14
- }>>;
15
- orderBy: z.ZodOptional<z.ZodEnum<{
16
- updatedAt: "updatedAt";
17
- }>>;
18
- search: z.ZodOptional<z.ZodString>;
19
- }, z.core.$strip>;
20
- };
21
- responses: {
22
- 200: {
23
- content: {
24
- "application/json": {
25
- schema: z.ZodObject<{
26
- edges: z.ZodArray<z.ZodObject<{
27
- id: z.ZodNumber;
28
- title: z.ZodString;
29
- createdAt: z.ZodDate;
30
- updatedAt: z.ZodDate;
31
- }, z.core.$strip>>;
32
- pageInfo: z.ZodObject<{
33
- totalCount: z.ZodNumber;
34
- count: z.ZodNumber;
35
- hasNextPage: z.ZodBoolean;
36
- hasPreviousPage: z.ZodBoolean;
37
- startCursor: z.ZodNullable<z.ZodNumber>;
38
- endCursor: z.ZodNullable<z.ZodNumber>;
39
- }, z.core.$strip>;
40
- }, z.core.$strip>;
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
- path: string;
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","names":[],"sources":["../../../../../../src/api/modules/categories/routes/get.route.ts"],"mappings":";;cAmBa,uDAAe"}
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{CONFIG_PLUGIN as e}from"../../../../const.js";import{blog_categories as t}from"../../../../database/categories.js";import{z as n}from"@hono/zod-openapi";import{buildRoute as r}from"@vitnode/core/api/lib/route";import{and as i,ilike as a}from"drizzle-orm";import{withPagination as o,zodPaginationPageInfo as s,zodPaginationQuery as c}from"@vitnode/core/api/lib/with-pagination";const l=n.object({id:n.number(),title:n.string(),createdAt:n.date(),updatedAt:n.date()}),u=r({pluginId:e.pluginId,route:{method:`get`,path:`/`,request:{query:c.extend({order:n.enum([`asc`,`desc`]).optional(),orderBy:n.enum([`updatedAt`]).optional(),search:n.string().optional()})},responses:{200:{content:{"application/json":{schema:n.object({edges:n.array(l),pageInfo:s})}},description:`Categories retrieved successfully`}}},handler:async e=>{let n=e.req.valid(`query`),r=await o({c:e,params:{query:n},primaryCursor:t.id,query:async({limit:r,where:o,orderBy:s})=>{let c=n.search?a(t.title,`%${n.search}%`):void 0,l;return l=c?o?i(o,c):c:o,await e.get(`db`).select().from(t).where(l).orderBy(s).limit(r)},table:t,orderBy:{column:n.orderBy?t[n.orderBy]:t.updatedAt,order:n.order??`desc`}});return e.json(r)}});export{u as categoriesRoute};
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
- //#region src/api/modules/categories/test.route.d.ts
3
- declare const testRoute: import("@vitnode/core/api/lib/route").Route<"@vitnode/blog", {
4
- method: "post";
5
- description: string;
6
- path: "/test";
7
- responses: {
8
- 200: {
9
- content: {
10
- "text/plain": {
11
- schema: z.ZodString;
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
- description: string;
15
- };
16
- 201: {
17
- content: {
18
- "text/plain": {
19
- schema: z.ZodString;
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
- path: string;
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","names":[],"sources":["../../../../../src/api/modules/categories/test.route.ts"],"mappings":";;cAOa,iDAAS;;;;;;;;kBAAT,EAAA;;;;;;;;kBAAA,EAAA"}
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{CONFIG_PLUGIN as e}from"../../../const.js";import t from"../../../emails/test-template.js";import{buildRoute as n}from"@vitnode/core/api/lib/route";import{UserModel as r}from"@vitnode/core/api/models/user";import{z as i}from"zod";const a=n({pluginId:e.pluginId,route:{method:`post`,description:`Test route`,path:`/test`,responses:{200:{content:{"text/plain":{schema:i.string()}},description:`User`},201:{content:{"text/plain":{schema:i.string()}},description:`User`}}},handler:async e=>{let n=await new r().getUserById({id:2,c:e});if(!n)throw Error(`User not found`);return await e.get(`email`).send({subject:`Test Email`,content:t,user:n}),await e.get(`log`).warn(`This is a test warn log`),e.text(`test`)}});export{a as testRoute};
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
- //#region src/api/modules/posts/posts.module.d.ts
2
- declare const postsModule: import("@vitnode/core/api/lib/module").BuildModuleReturn<"@vitnode/blog", "posts", [import("@vitnode/core/api/lib/route").Route<"@vitnode/blog", {
3
- method: "get";
4
- path: "/";
5
- request: {
6
- query: import("zod").ZodObject<{
7
- cursor: import("zod").ZodOptional<import("zod").ZodString>;
8
- first: import("zod").ZodOptional<import("zod").ZodString>;
9
- last: import("zod").ZodOptional<import("zod").ZodString>;
10
- order: import("zod").ZodOptional<import("zod").ZodEnum<{
11
- asc: "asc";
12
- desc: "desc";
13
- }>>;
14
- orderBy: import("zod").ZodOptional<import("zod").ZodEnum<{
15
- createdAt: "createdAt";
16
- updatedAt: "updatedAt";
17
- }>>;
18
- categoryId: import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<number, string>>>;
19
- }, import("zod/v4/core").$strip>;
20
- };
21
- responses: {
22
- 200: {
23
- content: {
24
- "application/json": {
25
- schema: import("zod").ZodObject<{
26
- edges: import("zod").ZodArray<import("zod").ZodObject<{
27
- id: import("zod").ZodNumber;
28
- title: import("zod").ZodString;
29
- titleSeo: import("zod").ZodString;
30
- content: import("zod").ZodString;
31
- categoryId: import("zod").ZodNumber;
32
- createdAt: import("zod").ZodDate;
33
- updatedAt: import("zod").ZodDate;
34
- category: import("zod").ZodObject<{
35
- id: import("zod").ZodNumber;
36
- title: import("zod").ZodString;
37
- titleSeo: import("zod").ZodString;
38
- }, import("zod/v4/core").$strip>;
39
- }, import("zod/v4/core").$strip>>;
40
- pageInfo: import("zod").ZodObject<{
41
- totalCount: import("zod").ZodNumber;
42
- count: import("zod").ZodNumber;
43
- hasNextPage: import("zod").ZodBoolean;
44
- hasPreviousPage: import("zod").ZodBoolean;
45
- startCursor: import("zod").ZodNullable<import("zod").ZodNumber>;
46
- endCursor: import("zod").ZodNullable<import("zod").ZodNumber>;
47
- }, import("zod/v4/core").$strip>;
48
- }, import("zod/v4/core").$strip>;
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
- path: string;
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","names":[],"sources":["../../../../../src/api/modules/posts/posts.module.ts"],"mappings":";cAMa,oDAAW,mFAAA"}
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 as e}from"../../../const.js";import{postsRoute as t}from"./routes/get.route.js";import{buildModule as n}from"@vitnode/core/api/lib/module";const r=n({pluginId:e.pluginId,name:`posts`,routes:[t]});export{r as postsModule};
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]});