@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,105 @@
1
1
  import { z } from "@hono/zod-openapi";
2
- //#region src/api/modules/posts/routes/get.route.d.ts
3
- declare const zodPostSchema: z.ZodObject<{
4
- id: z.ZodNumber;
5
- title: z.ZodString;
6
- titleSeo: z.ZodString;
7
- content: z.ZodString;
8
- categoryId: z.ZodNumber;
9
- createdAt: z.ZodDate;
10
- updatedAt: z.ZodDate;
11
- category: z.ZodObject<{
2
+ export declare const zodPostSchema: z.ZodObject<{
12
3
  id: z.ZodNumber;
13
- title: z.ZodString;
14
- titleSeo: z.ZodString;
15
- }, z.core.$strip>;
16
- }, z.core.$strip>;
17
- declare const postsRoute: import("@vitnode/core/api/lib/route").Route<"@vitnode/blog", {
18
- method: "get";
19
- path: "/";
20
- request: {
21
- query: z.ZodObject<{
22
- cursor: z.ZodOptional<z.ZodString>;
23
- first: z.ZodOptional<z.ZodString>;
24
- last: z.ZodOptional<z.ZodString>;
25
- order: z.ZodOptional<z.ZodEnum<{
26
- asc: "asc";
27
- desc: "desc";
28
- }>>;
29
- orderBy: z.ZodOptional<z.ZodEnum<{
30
- createdAt: "createdAt";
31
- updatedAt: "updatedAt";
32
- }>>;
33
- categoryId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
4
+ titleTranslations: z.ZodArray<z.ZodObject<{
5
+ languageCode: z.ZodString;
6
+ value: z.ZodString;
7
+ }, z.core.$strip>>;
8
+ contentTranslations: z.ZodArray<z.ZodObject<{
9
+ languageCode: z.ZodString;
10
+ value: z.ZodString;
11
+ }, z.core.$strip>>;
12
+ friendlyUrlTranslations: z.ZodArray<z.ZodObject<{
13
+ languageCode: z.ZodString;
14
+ value: z.ZodString;
15
+ }, z.core.$strip>>;
16
+ categoryId: z.ZodNumber;
17
+ createdAt: z.ZodDate;
18
+ updatedAt: z.ZodDate;
19
+ category: z.ZodObject<{
20
+ id: z.ZodNumber;
21
+ titleTranslations: z.ZodArray<z.ZodObject<{
22
+ languageCode: z.ZodString;
23
+ value: z.ZodString;
24
+ }, z.core.$strip>>;
34
25
  }, z.core.$strip>;
35
- };
36
- responses: {
37
- 200: {
38
- content: {
39
- "application/json": {
40
- schema: z.ZodObject<{
41
- edges: z.ZodArray<z.ZodObject<{
42
- id: z.ZodNumber;
43
- title: z.ZodString;
44
- titleSeo: z.ZodString;
45
- content: z.ZodString;
46
- categoryId: z.ZodNumber;
47
- createdAt: z.ZodDate;
48
- updatedAt: z.ZodDate;
49
- category: z.ZodObject<{
50
- id: z.ZodNumber;
51
- title: z.ZodString;
52
- titleSeo: z.ZodString;
53
- }, z.core.$strip>;
54
- }, z.core.$strip>>;
55
- pageInfo: z.ZodObject<{
56
- totalCount: z.ZodNumber;
57
- count: z.ZodNumber;
58
- hasNextPage: z.ZodBoolean;
59
- hasPreviousPage: z.ZodBoolean;
60
- startCursor: z.ZodNullable<z.ZodNumber>;
61
- endCursor: z.ZodNullable<z.ZodNumber>;
62
- }, z.core.$strip>;
63
- }, z.core.$strip>;
26
+ author: z.ZodNullable<z.ZodObject<{
27
+ id: z.ZodNumber;
28
+ name: z.ZodString;
29
+ nameCode: z.ZodString;
30
+ avatarColor: z.ZodString;
31
+ }, z.core.$strip>>;
32
+ }, z.core.$strip>;
33
+ export declare const postsRoute: import("@vitnode/core/api/lib/route").Route<"@vitnode/blog", {
34
+ method: "get";
35
+ path: "/";
36
+ request: {
37
+ query: z.ZodObject<{
38
+ cursor: z.ZodOptional<z.ZodString>;
39
+ first: z.ZodOptional<z.ZodString>;
40
+ last: z.ZodOptional<z.ZodString>;
41
+ order: z.ZodOptional<z.ZodEnum<{
42
+ asc: "asc";
43
+ desc: "desc";
44
+ }>>;
45
+ orderBy: z.ZodOptional<z.ZodEnum<{
46
+ createdAt: "createdAt";
47
+ updatedAt: "updatedAt";
48
+ }>>;
49
+ categoryId: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>>;
50
+ }, z.core.$strip>;
51
+ };
52
+ responses: {
53
+ 200: {
54
+ content: {
55
+ "application/json": {
56
+ schema: z.ZodObject<{
57
+ edges: z.ZodArray<z.ZodObject<{
58
+ id: z.ZodNumber;
59
+ titleTranslations: z.ZodArray<z.ZodObject<{
60
+ languageCode: z.ZodString;
61
+ value: z.ZodString;
62
+ }, z.core.$strip>>;
63
+ contentTranslations: z.ZodArray<z.ZodObject<{
64
+ languageCode: z.ZodString;
65
+ value: z.ZodString;
66
+ }, z.core.$strip>>;
67
+ friendlyUrlTranslations: z.ZodArray<z.ZodObject<{
68
+ languageCode: z.ZodString;
69
+ value: z.ZodString;
70
+ }, z.core.$strip>>;
71
+ categoryId: z.ZodNumber;
72
+ createdAt: z.ZodDate;
73
+ updatedAt: z.ZodDate;
74
+ category: z.ZodObject<{
75
+ id: z.ZodNumber;
76
+ titleTranslations: z.ZodArray<z.ZodObject<{
77
+ languageCode: z.ZodString;
78
+ value: z.ZodString;
79
+ }, z.core.$strip>>;
80
+ }, z.core.$strip>;
81
+ author: z.ZodNullable<z.ZodObject<{
82
+ id: z.ZodNumber;
83
+ name: z.ZodString;
84
+ nameCode: z.ZodString;
85
+ avatarColor: z.ZodString;
86
+ }, z.core.$strip>>;
87
+ }, z.core.$strip>>;
88
+ pageInfo: z.ZodObject<{
89
+ totalCount: z.ZodNumber;
90
+ count: z.ZodNumber;
91
+ hasNextPage: z.ZodBoolean;
92
+ hasPreviousPage: z.ZodBoolean;
93
+ startCursor: z.ZodNullable<z.ZodNumber>;
94
+ endCursor: z.ZodNullable<z.ZodNumber>;
95
+ }, z.core.$strip>;
96
+ }, z.core.$strip>;
97
+ };
98
+ };
99
+ description: string;
64
100
  };
65
- };
66
- description: string;
67
101
  };
68
- };
69
102
  } & {
70
- path: string;
103
+ path: string;
71
104
  }>;
72
- //#endregion
73
- export { postsRoute, zodPostSchema };
74
105
  //# sourceMappingURL=get.route.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get.route.d.ts","names":[],"sources":["../../../../../../src/api/modules/posts/routes/get.route.ts"],"mappings":";;cAaa,eAAa,EAAA;;;;;;;;;;;;;;cAeb,kDAAU"}
1
+ {"version":3,"file":"get.route.d.ts","sourceRoot":"","sources":["../../../../../../src/api/modules/posts/routes/get.route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAoBtC,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsBxB,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwGrB,CAAC"}
@@ -1,2 +1 @@
1
- import{CONFIG_PLUGIN as e}from"../../../../const.js";import{blog_categories as t}from"../../../../database/categories.js";import{blog_posts as n}from"../../../../database/posts.js";import{z as r}from"@hono/zod-openapi";import{buildRoute as i}from"@vitnode/core/api/lib/route";import{eq as a}from"drizzle-orm";import{withPagination as o,zodPaginationPageInfo as s,zodPaginationQuery as c}from"@vitnode/core/api/lib/with-pagination";const l=r.object({id:r.number(),title:r.string(),titleSeo:r.string(),content:r.string(),categoryId:r.number(),createdAt:r.date(),updatedAt:r.date(),category:r.object({id:r.number(),title:r.string(),titleSeo:r.string()})}),u=i({pluginId:e.pluginId,route:{method:`get`,path:`/`,request:{query:c.extend({order:r.enum([`asc`,`desc`]).optional(),orderBy:r.enum([`updatedAt`,`createdAt`]).optional(),categoryId:r.string().transform(Number).optional()})},responses:{200:{content:{"application/json":{schema:r.object({edges:r.array(l),pageInfo:s})}},description:`Posts retrieved successfully`}}},handler:async e=>{let r=e.req.valid(`query`),i=await o({c:e,params:{query:r},primaryCursor:n.id,query:async({limit:i,where:o,orderBy:s})=>await e.get(`db`).select({id:n.id,title:n.title,titleSeo:n.titleSeo,content:n.content,categoryId:n.categoryId,createdAt:n.createdAt,updatedAt:n.updatedAt,category:{id:t.id,title:t.title,titleSeo:t.titleSeo}}).from(n).innerJoin(t,a(n.categoryId,t.id)).where(r.categoryId?a(n.categoryId,r.categoryId):o).orderBy(s).limit(i),table:n,orderBy:{column:r.orderBy?n[r.orderBy]:n.updatedAt,order:r.order??`desc`}});return e.json(i)}});export{u as postsRoute,l as zodPostSchema};
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_users}from"@vitnode/core/database/users";import{multiLangValueSchema}from"@vitnode/core/lib/helpers/multi-lang";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";import{loadCategoryTranslations}from"../../../lib/categories-language.js";import{loadPostTranslations}from"../../../lib/posts-language.js";const zodMultiLangValue=multiLangValueSchema();export const zodPostSchema=z.object({id:z.number(),titleTranslations:zodMultiLangValue,contentTranslations:zodMultiLangValue,friendlyUrlTranslations:zodMultiLangValue,categoryId:z.number(),createdAt:z.date(),updatedAt:z.date(),category:z.object({id:z.number(),titleTranslations:zodMultiLangValue}),author:z.object({id:z.number(),name:z.string(),nameCode:z.string(),avatarColor:z.string()}).nullable()});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,categoryId:blog_posts.categoryId,createdAt:blog_posts.createdAt,updatedAt:blog_posts.updatedAt,category:{id:blog_categories.id},author:{id:core_users.id,name:core_users.name,nameCode:core_users.nameCode,avatarColor:core_users.avatarColor}}).from(blog_posts).innerJoin(blog_categories,eq(blog_posts.categoryId,blog_categories.id)).leftJoin(core_users,eq(core_users.id,blog_posts.authorId)).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"}});const[translations,categoryTranslations]=await Promise.all([loadPostTranslations(c,data.edges.map(edge=>edge.id)),loadCategoryTranslations(c,data.edges.map(edge=>edge.category.id))]);return c.json({...data,edges:data.edges.map(edge=>{const words=translations.get(edge.id);return{...edge,titleTranslations:words?.title??[],contentTranslations:words?.content??[],friendlyUrlTranslations:words?.friendlyUrl??[],category:{...edge.category,titleTranslations:categoryTranslations.get(edge.category.id)??[]}}})})}});
@@ -1,5 +1,2 @@
1
- //#region src/config.api.d.ts
2
- declare const blogApiPlugin: () => import("@vitnode/core/api/lib/plugin").BuildPluginApiReturn;
3
- //#endregion
4
- export { blogApiPlugin };
1
+ export declare const blogApiPlugin: () => import("@vitnode/core/api/lib/plugin").BuildPluginApiReturn;
5
2
  //# sourceMappingURL=config.api.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.api.d.ts","names":[],"sources":["../../src/config.api.ts"],"mappings":";cAQa,4DAAa"}
1
+ {"version":3,"file":"config.api.d.ts","sourceRoot":"","sources":["../../src/config.api.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,aAAa,mEAwBzB,CAAC"}
@@ -1,2 +1 @@
1
- import{CONFIG_PLUGIN as e}from"./const.js";import{adminModule as t}from"./api/modules/admin/admin.module.js";import{categoriesModule as n}from"./api/modules/categories/categories.module.js";import{postsModule as r}from"./api/modules/posts/posts.module.js";import{buildApiPlugin as i}from"@vitnode/core/api/lib/plugin";const a=()=>i({pluginId:e.pluginId,modules:[t,n,r],permissionStaff:{moderator:{posts:[`can_edit`,`can_delete`]},admin:{posts:[`can_view`,{permission:`can_create`,dependsOn:[`can_view`]},`can_edit`,`can_delete`],categories:[`can_view`,`can_create`,`can_edit`,`can_delete`]}}});export{a as blogApiPlugin};
2
- //# sourceMappingURL=config.api.js.map
1
+ import{buildApiPlugin}from"@vitnode/core/api/lib/plugin";import{CONFIG_PLUGIN}from"./const.js";import{blogPostSearchIndexer}from"./api/lib/search.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";import messages from"./locales/index.js";export const blogApiPlugin=()=>{return buildApiPlugin({pluginId:CONFIG_PLUGIN.pluginId,messages,modules:[adminModule,categoriesModule,postsModule],searchIndexers:[blogPostSearchIndexer],permissionStaff:{moderator:{posts:["can_edit","can_delete"]},admin:{posts:["can_view",{permission:"can_create",dependsOn:["can_view"]},"can_edit","can_delete"],categories:["can_view","can_create","can_edit","can_delete"]}}})};
@@ -1,5 +1,2 @@
1
- //#region src/config.d.ts
2
- declare const blogPlugin: () => import("@vitnode/core/lib/plugin").BuildPluginReturn<"@vitnode/blog">;
3
- //#endregion
4
- export { blogPlugin };
1
+ export declare const blogPlugin: () => import("@vitnode/core/lib/plugin").BuildPluginReturn<"@vitnode/blog">;
5
2
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","names":[],"sources":["../../src/config.tsx"],"mappings":";cAKa,qDAAU"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,UAAU,6EAqBtB,CAAC"}
@@ -1,2 +1 @@
1
- import{CONFIG_PLUGIN as e}from"./const.js";import{jsx as t}from"react/jsx-runtime";import{buildPlugin as n}from"@vitnode/core/lib/plugin";import{ListIcon as r,NotebookPenIcon as i}from"lucide-react";const a=()=>n({pluginId:e.pluginId,admin:{nav:[{id:`posts`,href:`/admin/blog/posts`,icon:t(i,{}),permission:{module:`posts`,permission:`can_view`}},{id:`categories`,href:`/admin/blog/categories`,icon:t(r,{}),permission:{module:`categories`,permission:`can_view`}}]}});export{a as blogPlugin};
2
- //# sourceMappingURL=config.js.map
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";import messages from"./locales/index.js";export const blogPlugin=()=>{return buildPlugin({pluginId:CONFIG_PLUGIN.pluginId,messages,admin:{nav:[{id:"posts",href:"/admin/blog/posts",icon:_jsx(NotebookPenIcon,{}),permission:{module:"posts",permission:"can_view"}},{id:"categories",href:"/admin/blog/categories",icon:_jsx(ListIcon,{}),permission:{module:"categories",permission:"can_view"}}]}})};
@@ -1,7 +1,4 @@
1
- //#region src/const.d.ts
2
- declare const CONFIG_PLUGIN: {
3
- pluginId: "@vitnode/blog";
1
+ export declare const CONFIG_PLUGIN: {
2
+ pluginId: "@vitnode/blog";
4
3
  };
5
- //#endregion
6
- export { CONFIG_PLUGIN };
7
4
  //# sourceMappingURL=const.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"const.d.ts","names":[],"sources":["../../src/const.ts"],"mappings":";cAAa;EAAA"}
1
+ {"version":3,"file":"const.d.ts","sourceRoot":"","sources":["../../src/const.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;CAEzB,CAAC"}
package/dist/src/const.js CHANGED
@@ -1,2 +1 @@
1
- const e={pluginId:`@vitnode/blog`};export{e as CONFIG_PLUGIN};
2
- //# sourceMappingURL=const.js.map
1
+ export const CONFIG_PLUGIN={pluginId:"@vitnode/blog"};
@@ -1,100 +1,78 @@
1
- //#region src/database/categories.d.ts
2
- declare const blog_categories: Omit<import("drizzle-orm/pg-core").PgTableWithColumns<{
3
- name: "blog_categories";
4
- schema: undefined;
5
- columns: {
6
- id: import("drizzle-orm/pg-core").PgColumn<{
7
- name: "id";
8
- tableName: "blog_categories";
9
- dataType: "number";
10
- columnType: "PgSerial";
11
- data: number;
12
- driverParam: number;
13
- notNull: true;
14
- hasDefault: true;
15
- isPrimaryKey: true;
16
- isAutoincrement: false;
17
- hasRuntimeDefault: false;
18
- enumValues: undefined;
19
- baseColumn: never;
20
- identity: undefined;
21
- generated: undefined;
22
- }, {}, {}>;
23
- title: import("drizzle-orm/pg-core").PgColumn<{
24
- name: "title";
25
- tableName: "blog_categories";
26
- dataType: "string";
27
- columnType: "PgVarchar";
28
- data: string;
29
- driverParam: string;
30
- notNull: true;
31
- hasDefault: false;
32
- isPrimaryKey: false;
33
- isAutoincrement: false;
34
- hasRuntimeDefault: false;
35
- enumValues: [string, ...string[]];
36
- baseColumn: never;
37
- identity: undefined;
38
- generated: undefined;
39
- }, {}, {
40
- length: 100;
41
- }>;
42
- createdAt: import("drizzle-orm/pg-core").PgColumn<{
43
- name: "createdAt";
44
- tableName: "blog_categories";
45
- dataType: "date";
46
- columnType: "PgTimestamp";
47
- data: Date;
48
- driverParam: string;
49
- notNull: true;
50
- hasDefault: true;
51
- isPrimaryKey: false;
52
- isAutoincrement: false;
53
- hasRuntimeDefault: false;
54
- enumValues: undefined;
55
- baseColumn: never;
56
- identity: undefined;
57
- generated: undefined;
58
- }, {}, {}>;
59
- updatedAt: import("drizzle-orm/pg-core").PgColumn<{
60
- name: "updatedAt";
61
- tableName: "blog_categories";
62
- dataType: "date";
63
- columnType: "PgTimestamp";
64
- data: Date;
65
- driverParam: string;
66
- notNull: true;
67
- hasDefault: true;
68
- isPrimaryKey: false;
69
- isAutoincrement: false;
70
- hasRuntimeDefault: false;
71
- enumValues: undefined;
72
- baseColumn: never;
73
- identity: undefined;
74
- generated: undefined;
75
- }, {}, {}>;
76
- titleSeo: import("drizzle-orm/pg-core").PgColumn<{
77
- name: "titleSeo";
78
- tableName: "blog_categories";
79
- dataType: "string";
80
- columnType: "PgVarchar";
81
- data: string;
82
- driverParam: string;
83
- notNull: true;
84
- hasDefault: true;
85
- isPrimaryKey: false;
86
- isAutoincrement: false;
87
- hasRuntimeDefault: false;
88
- enumValues: [string, ...string[]];
89
- baseColumn: never;
90
- identity: undefined;
91
- generated: undefined;
92
- }, {}, {
93
- length: 100;
94
- }>;
95
- };
96
- dialect: "pg";
1
+ export declare const blog_categories: Omit<import("drizzle-orm/pg-core").PgTableWithColumns<{
2
+ name: "blog_categories";
3
+ schema: undefined;
4
+ columns: {
5
+ id: import("drizzle-orm/pg-core").PgColumn<{
6
+ name: "id";
7
+ tableName: "blog_categories";
8
+ dataType: "number";
9
+ columnType: "PgSerial";
10
+ data: number;
11
+ driverParam: number;
12
+ notNull: true;
13
+ hasDefault: true;
14
+ isPrimaryKey: true;
15
+ isAutoincrement: false;
16
+ hasRuntimeDefault: false;
17
+ enumValues: undefined;
18
+ baseColumn: never;
19
+ identity: undefined;
20
+ generated: undefined;
21
+ }, {}, {}>;
22
+ color: import("drizzle-orm/pg-core").PgColumn<{
23
+ name: "color";
24
+ tableName: "blog_categories";
25
+ dataType: "string";
26
+ columnType: "PgVarchar";
27
+ data: string;
28
+ driverParam: string;
29
+ notNull: false;
30
+ hasDefault: false;
31
+ isPrimaryKey: false;
32
+ isAutoincrement: false;
33
+ hasRuntimeDefault: false;
34
+ enumValues: [string, ...string[]];
35
+ baseColumn: never;
36
+ identity: undefined;
37
+ generated: undefined;
38
+ }, {}, {
39
+ length: 50;
40
+ }>;
41
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
42
+ name: "createdAt";
43
+ tableName: "blog_categories";
44
+ dataType: "date";
45
+ columnType: "PgTimestamp";
46
+ data: Date;
47
+ driverParam: string;
48
+ notNull: true;
49
+ hasDefault: true;
50
+ isPrimaryKey: false;
51
+ isAutoincrement: false;
52
+ hasRuntimeDefault: false;
53
+ enumValues: undefined;
54
+ baseColumn: never;
55
+ identity: undefined;
56
+ generated: undefined;
57
+ }, {}, {}>;
58
+ updatedAt: import("drizzle-orm/pg-core").PgColumn<{
59
+ name: "updatedAt";
60
+ tableName: "blog_categories";
61
+ dataType: "date";
62
+ columnType: "PgTimestamp";
63
+ data: Date;
64
+ driverParam: string;
65
+ notNull: true;
66
+ hasDefault: true;
67
+ isPrimaryKey: false;
68
+ isAutoincrement: false;
69
+ hasRuntimeDefault: false;
70
+ enumValues: undefined;
71
+ baseColumn: never;
72
+ identity: undefined;
73
+ generated: undefined;
74
+ }, {}, {}>;
75
+ };
76
+ dialect: "pg";
97
77
  }>, "enableRLS">;
98
- //#endregion
99
- export { blog_categories };
100
78
  //# sourceMappingURL=categories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"categories.d.ts","names":[],"sources":["../../../src/database/categories.ts"],"mappings":";cAEa,iBAAe,mCAAA"}
1
+ {"version":3,"file":"categories.d.ts","sourceRoot":"","sources":["../../../src/database/categories.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAQb,CAAC"}
@@ -1,2 +1 @@
1
- import{pgTable as e}from"drizzle-orm/pg-core";const t=e(`blog_categories`,e=>({id:e.serial().primaryKey(),title:e.varchar({length:100}).notNull(),createdAt:e.timestamp().notNull().defaultNow(),updatedAt:e.timestamp().notNull().$onUpdate(()=>new Date),titleSeo:e.varchar({length:100}).notNull().unique().default(``)})).enableRLS();export{t as blog_categories};
2
- //# sourceMappingURL=categories.js.map
1
+ import{pgTable}from"drizzle-orm/pg-core";export const blog_categories=pgTable("blog_categories",t=>({id:t.serial().primaryKey(),color:t.varchar({length:50}),createdAt:t.timestamp().notNull().defaultNow(),updatedAt:t.timestamp().notNull().$onUpdate(()=>new Date)})).enableRLS();
@@ -1,4 +1,4 @@
1
- import { blog_categories } from "./categories.js";
2
- import { blog_posts } from "./posts.js";
3
- import { blog_categories_relations, blog_posts_relations } from "./relations.js";
4
- export { blog_categories, blog_categories_relations, blog_posts, blog_posts_relations };
1
+ export * from "./categories";
2
+ export * from "./posts";
3
+ export * from "./relations";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/database/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AAGxB,cAAc,aAAa,CAAC"}
@@ -1 +1 @@
1
- import{blog_categories as e}from"./categories.js";import{blog_posts as t}from"./posts.js";import{blog_categories_relations as n,blog_posts_relations as r}from"./relations.js";export{e as blog_categories,n as blog_categories_relations,t as blog_posts,r as blog_posts_relations};
1
+ export*from"./categories.js";export*from"./posts.js";export*from"./relations.js";