@vitnode/blog 1.2.0-canary.23 → 1.2.0-canary.25

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