@vitnode/blog 1.2.0-canary.74 → 1.2.0-canary.76

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 (156) hide show
  1. package/dist/src/api/modules/admin/admin.module.d.ts +180 -177
  2. package/dist/src/api/modules/admin/admin.module.d.ts.map +1 -1
  3. package/dist/src/api/modules/admin/admin.module.js +2 -1
  4. package/dist/src/api/modules/admin/admin.module.js.map +1 -0
  5. package/dist/src/api/modules/admin/categories/categories.admin.module.d.ts +80 -77
  6. package/dist/src/api/modules/admin/categories/categories.admin.module.d.ts.map +1 -1
  7. package/dist/src/api/modules/admin/categories/categories.admin.module.js +2 -1
  8. package/dist/src/api/modules/admin/categories/categories.admin.module.js.map +1 -0
  9. package/dist/src/api/modules/admin/categories/routes/create.route.d.ts +34 -31
  10. package/dist/src/api/modules/admin/categories/routes/create.route.d.ts.map +1 -1
  11. package/dist/src/api/modules/admin/categories/routes/create.route.js +2 -1
  12. package/dist/src/api/modules/admin/categories/routes/create.route.js.map +1 -0
  13. package/dist/src/api/modules/admin/categories/routes/delete.route.d.ts +18 -15
  14. package/dist/src/api/modules/admin/categories/routes/delete.route.d.ts.map +1 -1
  15. package/dist/src/api/modules/admin/categories/routes/delete.route.js +2 -1
  16. package/dist/src/api/modules/admin/categories/routes/delete.route.js.map +1 -0
  17. package/dist/src/api/modules/admin/categories/routes/edit.route.d.ts +38 -35
  18. package/dist/src/api/modules/admin/categories/routes/edit.route.d.ts.map +1 -1
  19. package/dist/src/api/modules/admin/categories/routes/edit.route.js +2 -1
  20. package/dist/src/api/modules/admin/categories/routes/edit.route.js.map +1 -0
  21. package/dist/src/api/modules/admin/posts/posts.admin.module.d.ts +93 -90
  22. package/dist/src/api/modules/admin/posts/posts.admin.module.d.ts.map +1 -1
  23. package/dist/src/api/modules/admin/posts/posts.admin.module.js +2 -1
  24. package/dist/src/api/modules/admin/posts/posts.admin.module.js.map +1 -0
  25. package/dist/src/api/modules/admin/posts/routes/create.route.d.ts +44 -41
  26. package/dist/src/api/modules/admin/posts/routes/create.route.d.ts.map +1 -1
  27. package/dist/src/api/modules/admin/posts/routes/create.route.js +2 -1
  28. package/dist/src/api/modules/admin/posts/routes/create.route.js.map +1 -0
  29. package/dist/src/api/modules/admin/posts/routes/delete.route.d.ts +18 -15
  30. package/dist/src/api/modules/admin/posts/routes/delete.route.d.ts.map +1 -1
  31. package/dist/src/api/modules/admin/posts/routes/delete.route.js +2 -1
  32. package/dist/src/api/modules/admin/posts/routes/delete.route.js.map +1 -0
  33. package/dist/src/api/modules/admin/posts/routes/edit.route.d.ts +43 -40
  34. package/dist/src/api/modules/admin/posts/routes/edit.route.d.ts.map +1 -1
  35. package/dist/src/api/modules/admin/posts/routes/edit.route.js +2 -1
  36. package/dist/src/api/modules/admin/posts/routes/edit.route.js.map +1 -0
  37. package/dist/src/api/modules/categories/categories.module.d.ts +64 -61
  38. package/dist/src/api/modules/categories/categories.module.d.ts.map +1 -1
  39. package/dist/src/api/modules/categories/categories.module.js +2 -1
  40. package/dist/src/api/modules/categories/categories.module.js.map +1 -0
  41. package/dist/src/api/modules/categories/routes/get.route.d.ts +45 -42
  42. package/dist/src/api/modules/categories/routes/get.route.d.ts.map +1 -1
  43. package/dist/src/api/modules/categories/routes/get.route.js +2 -1
  44. package/dist/src/api/modules/categories/routes/get.route.js.map +1 -0
  45. package/dist/src/api/modules/categories/test.route.d.ts +23 -20
  46. package/dist/src/api/modules/categories/test.route.d.ts.map +1 -1
  47. package/dist/src/api/modules/categories/test.route.js +2 -1
  48. package/dist/src/api/modules/categories/test.route.js.map +1 -0
  49. package/dist/src/api/modules/posts/posts.module.d.ts +54 -51
  50. package/dist/src/api/modules/posts/posts.module.d.ts.map +1 -1
  51. package/dist/src/api/modules/posts/posts.module.js +2 -1
  52. package/dist/src/api/modules/posts/posts.module.js.map +1 -0
  53. package/dist/src/api/modules/posts/routes/get.route.d.ts +64 -61
  54. package/dist/src/api/modules/posts/routes/get.route.d.ts.map +1 -1
  55. package/dist/src/api/modules/posts/routes/get.route.js +2 -1
  56. package/dist/src/api/modules/posts/routes/get.route.js.map +1 -0
  57. package/dist/src/config.api.d.ts +4 -1
  58. package/dist/src/config.api.d.ts.map +1 -1
  59. package/dist/src/config.api.js +2 -1
  60. package/dist/src/config.api.js.map +1 -0
  61. package/dist/src/config.d.ts +4 -1
  62. package/dist/src/config.d.ts.map +1 -1
  63. package/dist/src/config.js +2 -1
  64. package/dist/src/config.js.map +1 -0
  65. package/dist/src/const.d.ts +5 -2
  66. package/dist/src/const.d.ts.map +1 -1
  67. package/dist/src/const.js +2 -1
  68. package/dist/src/const.js.map +1 -0
  69. package/dist/src/database/categories.d.ts +98 -95
  70. package/dist/src/database/categories.d.ts.map +1 -1
  71. package/dist/src/database/categories.js +2 -1
  72. package/dist/src/database/categories.js.map +1 -0
  73. package/dist/src/database/index.d.ts +4 -4
  74. package/dist/src/database/index.js +1 -1
  75. package/dist/src/database/posts.d.ts +132 -129
  76. package/dist/src/database/posts.d.ts.map +1 -1
  77. package/dist/src/database/posts.js +2 -1
  78. package/dist/src/database/posts.js.map +1 -0
  79. package/dist/src/database/relations.d.ts +7 -4
  80. package/dist/src/database/relations.d.ts.map +1 -1
  81. package/dist/src/database/relations.js +2 -1
  82. package/dist/src/database/relations.js.map +1 -0
  83. package/dist/src/emails/test-template.d.ts +20 -18
  84. package/dist/src/emails/test-template.d.ts.map +1 -1
  85. package/dist/src/emails/test-template.js +2 -1
  86. package/dist/src/emails/test-template.js.map +1 -0
  87. package/dist/src/routes/admin/blog/categories/page.d.ts +7 -5
  88. package/dist/src/routes/admin/blog/categories/page.d.ts.map +1 -1
  89. package/dist/src/routes/admin/blog/categories/page.js +2 -1
  90. package/dist/src/routes/admin/blog/categories/page.js.map +1 -0
  91. package/dist/src/routes/admin/blog/posts/page.d.ts +7 -5
  92. package/dist/src/routes/admin/blog/posts/page.d.ts.map +1 -1
  93. package/dist/src/routes/admin/blog/posts/page.js +2 -1
  94. package/dist/src/routes/admin/blog/posts/page.js.map +1 -0
  95. package/dist/src/views/admin/categories/actions/actions.d.ts +4 -1
  96. package/dist/src/views/admin/categories/actions/actions.d.ts.map +1 -1
  97. package/dist/src/views/admin/categories/actions/actions.js +2 -1
  98. package/dist/src/views/admin/categories/actions/actions.js.map +1 -0
  99. package/dist/src/views/admin/categories/actions/create-edit/create-edit.d.ts +8 -5
  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 +2 -1
  102. package/dist/src/views/admin/categories/actions/create-edit/create-edit.js.map +1 -0
  103. package/dist/src/views/admin/categories/actions/create-edit/mutation-api.d.ts +10 -7
  104. package/dist/src/views/admin/categories/actions/create-edit/mutation-api.d.ts.map +1 -1
  105. package/dist/src/views/admin/categories/actions/create-edit/mutation-api.js +2 -1
  106. package/dist/src/views/admin/categories/actions/create-edit/mutation-api.js.map +1 -0
  107. package/dist/src/views/admin/categories/table/actions/delete/delete-action.d.ts +7 -4
  108. package/dist/src/views/admin/categories/table/actions/delete/delete-action.d.ts.map +1 -1
  109. package/dist/src/views/admin/categories/table/actions/delete/delete-action.js +2 -1
  110. package/dist/src/views/admin/categories/table/actions/delete/delete-action.js.map +1 -0
  111. package/dist/src/views/admin/categories/table/actions/delete/mutation-api.d.ts +5 -2
  112. package/dist/src/views/admin/categories/table/actions/delete/mutation-api.d.ts.map +1 -1
  113. package/dist/src/views/admin/categories/table/actions/delete/mutation-api.js +2 -1
  114. package/dist/src/views/admin/categories/table/actions/delete/mutation-api.js.map +1 -0
  115. package/dist/src/views/admin/categories/table/actions/edit-action.d.ts +8 -5
  116. package/dist/src/views/admin/categories/table/actions/edit-action.d.ts.map +1 -1
  117. package/dist/src/views/admin/categories/table/actions/edit-action.js +2 -1
  118. package/dist/src/views/admin/categories/table/actions/edit-action.js.map +1 -0
  119. package/dist/src/views/admin/categories/table/categories-admin-view.d.ts +5 -2
  120. package/dist/src/views/admin/categories/table/categories-admin-view.d.ts.map +1 -1
  121. package/dist/src/views/admin/categories/table/categories-admin-view.js +2 -1
  122. package/dist/src/views/admin/categories/table/categories-admin-view.js.map +1 -0
  123. package/dist/src/views/admin/posts/actions/actions.d.ts +4 -1
  124. package/dist/src/views/admin/posts/actions/actions.d.ts.map +1 -1
  125. package/dist/src/views/admin/posts/actions/actions.js +2 -1
  126. package/dist/src/views/admin/posts/actions/actions.js.map +1 -0
  127. package/dist/src/views/admin/posts/actions/create-edit/create-edit.d.ts +8 -5
  128. package/dist/src/views/admin/posts/actions/create-edit/create-edit.d.ts.map +1 -1
  129. package/dist/src/views/admin/posts/actions/create-edit/create-edit.js +2 -1
  130. package/dist/src/views/admin/posts/actions/create-edit/create-edit.js.map +1 -0
  131. package/dist/src/views/admin/posts/actions/create-edit/mutation-api.d.ts +10 -7
  132. package/dist/src/views/admin/posts/actions/create-edit/mutation-api.d.ts.map +1 -1
  133. package/dist/src/views/admin/posts/actions/create-edit/mutation-api.js +2 -1
  134. package/dist/src/views/admin/posts/actions/create-edit/mutation-api.js.map +1 -0
  135. package/dist/src/views/admin/posts/table/actions/delete/delete-action.d.ts +7 -4
  136. package/dist/src/views/admin/posts/table/actions/delete/delete-action.d.ts.map +1 -1
  137. package/dist/src/views/admin/posts/table/actions/delete/delete-action.js +2 -1
  138. package/dist/src/views/admin/posts/table/actions/delete/delete-action.js.map +1 -0
  139. package/dist/src/views/admin/posts/table/actions/delete/mutation-api.d.ts +5 -2
  140. package/dist/src/views/admin/posts/table/actions/delete/mutation-api.d.ts.map +1 -1
  141. package/dist/src/views/admin/posts/table/actions/delete/mutation-api.js +2 -1
  142. package/dist/src/views/admin/posts/table/actions/delete/mutation-api.js.map +1 -0
  143. package/dist/src/views/admin/posts/table/actions/edit-action.d.ts +8 -5
  144. package/dist/src/views/admin/posts/table/actions/edit-action.d.ts.map +1 -1
  145. package/dist/src/views/admin/posts/table/actions/edit-action.js +2 -1
  146. package/dist/src/views/admin/posts/table/actions/edit-action.js.map +1 -0
  147. package/dist/src/views/admin/posts/table/posts-admin-view.d.ts +5 -2
  148. package/dist/src/views/admin/posts/table/posts-admin-view.d.ts.map +1 -1
  149. package/dist/src/views/admin/posts/table/posts-admin-view.js +2 -1
  150. package/dist/src/views/admin/posts/table/posts-admin-view.js.map +1 -0
  151. package/package.json +12 -15
  152. package/src/locales/en.json +11 -1
  153. package/src/routes/admin/blog/categories/page.tsx +19 -2
  154. package/src/routes/admin/blog/posts/page.tsx +19 -2
  155. package/tsconfig.build.json +5 -0
  156. package/dist/src/database/index.d.ts.map +0 -1
@@ -1,131 +1,134 @@
1
- export declare const blog_posts: Omit<import("drizzle-orm/pg-core").PgTableWithColumns<{
2
- name: "blog_posts";
3
- schema: undefined;
4
- columns: {
5
- id: import("drizzle-orm/pg-core").PgColumn<{
6
- name: "id";
7
- tableName: "blog_posts";
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
- title: import("drizzle-orm/pg-core").PgColumn<{
23
- name: "title";
24
- tableName: "blog_posts";
25
- dataType: "string";
26
- columnType: "PgVarchar";
27
- data: string;
28
- driverParam: string;
29
- notNull: true;
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: 255;
40
- }>;
41
- titleSeo: import("drizzle-orm/pg-core").PgColumn<{
42
- name: "titleSeo";
43
- tableName: "blog_posts";
44
- dataType: "string";
45
- columnType: "PgVarchar";
46
- data: string;
47
- driverParam: string;
48
- notNull: true;
49
- hasDefault: false;
50
- isPrimaryKey: false;
51
- isAutoincrement: false;
52
- hasRuntimeDefault: false;
53
- enumValues: [string, ...string[]];
54
- baseColumn: never;
55
- identity: undefined;
56
- generated: undefined;
57
- }, {}, {
58
- length: 255;
59
- }>;
60
- content: import("drizzle-orm/pg-core").PgColumn<{
61
- name: "content";
62
- tableName: "blog_posts";
63
- dataType: "string";
64
- columnType: "PgText";
65
- data: string;
66
- driverParam: string;
67
- notNull: true;
68
- hasDefault: false;
69
- isPrimaryKey: false;
70
- isAutoincrement: false;
71
- hasRuntimeDefault: false;
72
- enumValues: [string, ...string[]];
73
- baseColumn: never;
74
- identity: undefined;
75
- generated: undefined;
76
- }, {}, {}>;
77
- categoryId: import("drizzle-orm/pg-core").PgColumn<{
78
- name: "categoryId";
79
- tableName: "blog_posts";
80
- dataType: "number";
81
- columnType: "PgInteger";
82
- data: number;
83
- driverParam: string | number;
84
- notNull: true;
85
- hasDefault: false;
86
- isPrimaryKey: false;
87
- isAutoincrement: false;
88
- hasRuntimeDefault: false;
89
- enumValues: undefined;
90
- baseColumn: never;
91
- identity: undefined;
92
- generated: undefined;
93
- }, {}, {}>;
94
- createdAt: import("drizzle-orm/pg-core").PgColumn<{
95
- name: "createdAt";
96
- tableName: "blog_posts";
97
- dataType: "date";
98
- columnType: "PgTimestamp";
99
- data: Date;
100
- driverParam: string;
101
- notNull: true;
102
- hasDefault: true;
103
- isPrimaryKey: false;
104
- isAutoincrement: false;
105
- hasRuntimeDefault: false;
106
- enumValues: undefined;
107
- baseColumn: never;
108
- identity: undefined;
109
- generated: undefined;
110
- }, {}, {}>;
111
- updatedAt: import("drizzle-orm/pg-core").PgColumn<{
112
- name: "updatedAt";
113
- tableName: "blog_posts";
114
- dataType: "date";
115
- columnType: "PgTimestamp";
116
- data: Date;
117
- driverParam: string;
118
- notNull: true;
119
- hasDefault: true;
120
- isPrimaryKey: false;
121
- isAutoincrement: false;
122
- hasRuntimeDefault: false;
123
- enumValues: undefined;
124
- baseColumn: never;
125
- identity: undefined;
126
- generated: undefined;
127
- }, {}, {}>;
128
- };
129
- dialect: "pg";
1
+ //#region src/database/posts.d.ts
2
+ declare const blog_posts: Omit<import("drizzle-orm/pg-core").PgTableWithColumns<{
3
+ name: "blog_posts";
4
+ schema: undefined;
5
+ columns: {
6
+ id: import("drizzle-orm/pg-core").PgColumn<{
7
+ name: "id";
8
+ tableName: "blog_posts";
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_posts";
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: 255;
41
+ }>;
42
+ titleSeo: import("drizzle-orm/pg-core").PgColumn<{
43
+ name: "titleSeo";
44
+ tableName: "blog_posts";
45
+ dataType: "string";
46
+ columnType: "PgVarchar";
47
+ data: string;
48
+ driverParam: string;
49
+ notNull: true;
50
+ hasDefault: false;
51
+ isPrimaryKey: false;
52
+ isAutoincrement: false;
53
+ hasRuntimeDefault: false;
54
+ enumValues: [string, ...string[]];
55
+ baseColumn: never;
56
+ identity: undefined;
57
+ generated: undefined;
58
+ }, {}, {
59
+ length: 255;
60
+ }>;
61
+ content: import("drizzle-orm/pg-core").PgColumn<{
62
+ name: "content";
63
+ tableName: "blog_posts";
64
+ dataType: "string";
65
+ columnType: "PgText";
66
+ data: string;
67
+ driverParam: string;
68
+ notNull: true;
69
+ hasDefault: false;
70
+ isPrimaryKey: false;
71
+ isAutoincrement: false;
72
+ hasRuntimeDefault: false;
73
+ enumValues: [string, ...string[]];
74
+ baseColumn: never;
75
+ identity: undefined;
76
+ generated: undefined;
77
+ }, {}, {}>;
78
+ categoryId: import("drizzle-orm/pg-core").PgColumn<{
79
+ name: "categoryId";
80
+ tableName: "blog_posts";
81
+ dataType: "number";
82
+ columnType: "PgInteger";
83
+ data: number;
84
+ driverParam: string | number;
85
+ notNull: true;
86
+ hasDefault: false;
87
+ isPrimaryKey: false;
88
+ isAutoincrement: false;
89
+ hasRuntimeDefault: false;
90
+ enumValues: undefined;
91
+ baseColumn: never;
92
+ identity: undefined;
93
+ generated: undefined;
94
+ }, {}, {}>;
95
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
96
+ name: "createdAt";
97
+ tableName: "blog_posts";
98
+ dataType: "date";
99
+ columnType: "PgTimestamp";
100
+ data: Date;
101
+ driverParam: string;
102
+ notNull: true;
103
+ hasDefault: true;
104
+ isPrimaryKey: false;
105
+ isAutoincrement: false;
106
+ hasRuntimeDefault: false;
107
+ enumValues: undefined;
108
+ baseColumn: never;
109
+ identity: undefined;
110
+ generated: undefined;
111
+ }, {}, {}>;
112
+ updatedAt: import("drizzle-orm/pg-core").PgColumn<{
113
+ name: "updatedAt";
114
+ tableName: "blog_posts";
115
+ dataType: "date";
116
+ columnType: "PgTimestamp";
117
+ data: Date;
118
+ driverParam: string;
119
+ notNull: true;
120
+ hasDefault: true;
121
+ isPrimaryKey: false;
122
+ isAutoincrement: false;
123
+ hasRuntimeDefault: false;
124
+ enumValues: undefined;
125
+ baseColumn: never;
126
+ identity: undefined;
127
+ generated: undefined;
128
+ }, {}, {}>;
129
+ };
130
+ dialect: "pg";
130
131
  }>, "enableRLS">;
132
+ //#endregion
133
+ export { blog_posts };
131
134
  //# sourceMappingURL=posts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"posts.d.ts","sourceRoot":"","sources":["../../../src/database/posts.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAcR,CAAC"}
1
+ {"version":3,"file":"posts.d.ts","names":[],"sources":["../../../src/database/posts.ts"],"mappings":";cAIa,YAAU,mCAAA"}
@@ -1 +1,2 @@
1
- import{pgTable}from"drizzle-orm/pg-core";import{blog_categories}from"./categories.js";export const blog_posts=pgTable("blog_posts",t=>({id:t.serial().primaryKey(),title:t.varchar({length:255}).notNull(),titleSeo:t.varchar({length:255}).notNull().unique(),content:t.text().notNull(),categoryId:t.integer().references(()=>blog_categories.id).notNull(),createdAt:t.timestamp().notNull().defaultNow(),updatedAt:t.timestamp().notNull().$onUpdate(()=>new Date)})).enableRLS();
1
+ import{blog_categories as e}from"./categories.js";import{pgTable as t}from"drizzle-orm/pg-core";const n=t(`blog_posts`,t=>({id:t.serial().primaryKey(),title:t.varchar({length:255}).notNull(),titleSeo:t.varchar({length:255}).notNull().unique(),content:t.text().notNull(),categoryId:t.integer().references(()=>e.id).notNull(),createdAt:t.timestamp().notNull().defaultNow(),updatedAt:t.timestamp().notNull().$onUpdate(()=>new Date)})).enableRLS();export{n as blog_posts};
2
+ //# sourceMappingURL=posts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"posts.js","names":[],"sources":["../../../src/database/posts.ts"],"sourcesContent":["import { pgTable } from \"drizzle-orm/pg-core\";\n\nimport { blog_categories } from \"./categories\";\n\nexport const blog_posts = pgTable(\"blog_posts\", t => ({\n id: t.serial().primaryKey(),\n title: t.varchar({ length: 255 }).notNull(),\n titleSeo: t.varchar({ length: 255 }).notNull().unique(),\n content: t.text().notNull(),\n categoryId: t\n .integer()\n .references(() => blog_categories.id)\n .notNull(),\n createdAt: t.timestamp().notNull().defaultNow(),\n updatedAt: t\n .timestamp()\n .notNull()\n .$onUpdate(() => new Date()),\n})).enableRLS();\n"],"mappings":"gGAIA,MAAa,EAAa,EAAQ,aAAc,IAAM,CACpD,GAAI,EAAE,OAAO,CAAC,CAAC,WAAW,EAC1B,MAAO,EAAE,QAAQ,CAAE,OAAQ,GAAI,CAAC,CAAC,CAAC,QAAQ,EAC1C,SAAU,EAAE,QAAQ,CAAE,OAAQ,GAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,OAAO,EACtD,QAAS,EAAE,KAAK,CAAC,CAAC,QAAQ,EAC1B,WAAY,EACT,QAAQ,CAAC,CACT,eAAiB,EAAgB,EAAE,CAAC,CACpC,QAAQ,EACX,UAAW,EAAE,UAAU,CAAC,CAAC,QAAQ,CAAC,CAAC,WAAW,EAC9C,UAAW,EACR,UAAU,CAAC,CACX,QAAQ,CAAC,CACT,cAAgB,IAAI,IAAM,CAC/B,EAAE,CAAC,CAAC,UAAU"}
@@ -1,7 +1,10 @@
1
- export declare const blog_posts_relations: import("drizzle-orm").Relations<"blog_posts", {
2
- category: import("drizzle-orm").One<"blog_categories", true>;
1
+ //#region src/database/relations.d.ts
2
+ declare const blog_posts_relations: import("drizzle-orm").Relations<"blog_posts", {
3
+ category: import("drizzle-orm").One<"blog_categories", true>;
3
4
  }>;
4
- export declare const blog_categories_relations: import("drizzle-orm").Relations<"blog_categories", {
5
- posts: import("drizzle-orm").Many<"blog_posts">;
5
+ declare const blog_categories_relations: import("drizzle-orm").Relations<"blog_categories", {
6
+ posts: import("drizzle-orm").Many<"blog_posts">;
6
7
  }>;
8
+ //#endregion
9
+ export { blog_categories_relations, blog_posts_relations };
7
10
  //# sourceMappingURL=relations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"relations.d.ts","sourceRoot":"","sources":["../../../src/database/relations.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,oBAAoB;;EAK9B,CAAC;AAEJ,eAAO,MAAM,yBAAyB;;EAKrC,CAAC"}
1
+ {"version":3,"file":"relations.d.ts","names":[],"sources":["../../../src/database/relations.ts"],"mappings":";cAKa,4CAAoB;;;cAOpB,iDAAyB"}
@@ -1 +1,2 @@
1
- import{relations}from"drizzle-orm";import{blog_categories}from"./categories.js";import{blog_posts}from"./posts.js";export const blog_posts_relations=relations(blog_posts,({one})=>({category:one(blog_categories,{fields:[blog_posts.categoryId],references:[blog_categories.id]})}));export const blog_categories_relations=relations(blog_categories,({many})=>({posts:many(blog_posts)}));
1
+ import{blog_categories as e}from"./categories.js";import{blog_posts as t}from"./posts.js";import{relations as n}from"drizzle-orm";const r=n(t,({one:n})=>({category:n(e,{fields:[t.categoryId],references:[e.id]})})),i=n(e,({many:e})=>({posts:e(t)}));export{i as blog_categories_relations,r as blog_posts_relations};
2
+ //# sourceMappingURL=relations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relations.js","names":[],"sources":["../../../src/database/relations.ts"],"sourcesContent":["import { relations } from \"drizzle-orm\";\n\nimport { blog_categories } from \"./categories\";\nimport { blog_posts } from \"./posts\";\n\nexport const blog_posts_relations = relations(blog_posts, ({ one }) => ({\n category: one(blog_categories, {\n fields: [blog_posts.categoryId],\n references: [blog_categories.id],\n }),\n}));\n\nexport const blog_categories_relations = relations(\n blog_categories,\n ({ many }) => ({\n posts: many(blog_posts),\n }),\n);\n"],"mappings":"kIAKA,MAAa,EAAuB,EAAU,GAAa,CAAE,UAAW,CACtE,SAAU,EAAI,EAAiB,CAC7B,OAAQ,CAAC,EAAW,UAAU,EAC9B,WAAY,CAAC,EAAgB,EAAE,CACjC,CAAC,CACH,EAAE,EAEW,EAA4B,EACvC,GACC,CAAE,WAAY,CACb,MAAO,EAAK,CAAU,CACxB,EACF"}
@@ -1,23 +1,25 @@
1
- import { type DefaultTemplateEmailProps } from "@vitnode/core/emails/default-template";
1
+ import { DefaultTemplateEmailProps } from "@vitnode/core/emails/default-template";
2
+ //#region src/emails/test-template.d.ts
2
3
  declare function TestTemplateEmail({ user, ...props }: DefaultTemplateEmailProps): import("react").JSX.Element | null;
3
4
  declare namespace TestTemplateEmail {
4
- var PreviewProps: {
5
- children: string;
6
- templateProps: {
7
- metadata: {
8
- title: string;
9
- shortTitle: string;
10
- url: string;
11
- };
12
- logo: {
13
- src: string;
14
- };
15
- };
16
- i18n: {
17
- messages: {};
18
- locale: string;
19
- };
5
+ var PreviewProps: {
6
+ children: string;
7
+ templateProps: {
8
+ metadata: {
9
+ title: string;
10
+ shortTitle: string;
11
+ url: string;
12
+ };
13
+ logo: {
14
+ src: string;
15
+ };
20
16
  };
17
+ i18n: {
18
+ messages: {};
19
+ locale: string;
20
+ };
21
+ };
21
22
  }
22
- export default TestTemplateEmail;
23
+ //#endregion
24
+ export { TestTemplateEmail as default };
23
25
  //# sourceMappingURL=test-template.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"test-template.d.ts","sourceRoot":"","sources":["../../../src/emails/test-template.tsx"],"names":[],"mappings":"AACA,OAA6B,EAC3B,KAAK,yBAAyB,EAC/B,MAAM,uCAAuC,CAAC;AAK/C,iBAAwB,iBAAiB,CAAC,EACxC,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,yBAAyB,sCAQ3B;kBAXuB,iBAAiB;;;;;;;;;;;;;;;;;;;eAAjB,iBAAiB"}
1
+ {"version":3,"file":"test-template.d.ts","names":[],"sources":["../../../src/emails/test-template.tsx"],"mappings":";;iBAQwB,oBACtB,SACG,SACF,4CAAyB,IAAA;kBAHJ"}
@@ -1 +1,2 @@
1
- import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{Text}from"@react-email/components";import DefaultTemplateEmail from"@vitnode/core/emails/default-template";TestTemplateEmail.PreviewProps=DefaultTemplateEmail.PreviewProps;export default function TestTemplateEmail({user,...props}){if(!user)return null;return _jsx(DefaultTemplateEmail,{...props,children:_jsxs(Text,{children:["This message is for ",user.name]})})}
1
+ import e from"@vitnode/core/emails/default-template";import{Text as t}from"react-email";import{jsx as n,jsxs as r}from"react/jsx-runtime";i.PreviewProps=e.PreviewProps;function i({user:i,...a}){return i?n(e,{...a,children:r(t,{children:[`This message is for `,i.name]})}):null}export{i as default};
2
+ //# sourceMappingURL=test-template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-template.js","names":[],"sources":["../../../src/emails/test-template.tsx"],"sourcesContent":["import DefaultTemplateEmail, {\n type DefaultTemplateEmailProps,\n} from \"@vitnode/core/emails/default-template\";\nimport { Text } from \"react-email\";\n\nTestTemplateEmail.PreviewProps =\n DefaultTemplateEmail.PreviewProps satisfies DefaultTemplateEmailProps;\n\nexport default function TestTemplateEmail({\n user,\n ...props\n}: DefaultTemplateEmailProps) {\n if (!user) return null;\n\n return (\n <DefaultTemplateEmail {...props}>\n <Text>This message is for {user.name}</Text>\n </DefaultTemplateEmail>\n );\n}\n"],"mappings":"0IAKA,EAAkB,aAChB,EAAqB,aAEvB,SAAwB,EAAkB,CACxC,OACA,GAAG,GACyB,CAG5B,OAFK,EAGH,EAAC,EAAD,CAAsB,GAAI,WACxB,EAAC,EAAD,CAAA,SAAA,CAAM,uBAAqB,EAAK,IAAW,CAAA,CAAA,CACvB,CAAA,EALN,IAOpB"}
@@ -1,9 +1,11 @@
1
- import type { Metadata } from "next";
2
1
  import React from "react";
2
+ import { Metadata } from "next";
3
+ //#region src/routes/admin/blog/categories/page.d.ts
3
4
  declare const CategoriesAdminView: React.ComponentType<{
4
- searchParams: Promise<Record<string, string | string[] | undefined>>;
5
+ searchParams: Promise<Record<string, string | string[] | undefined>>;
5
6
  }>;
6
- export declare const generateMetadata: () => Promise<Metadata>;
7
- export default function CategoriesPage(params: React.ComponentProps<typeof CategoriesAdminView>): Promise<React.JSX.Element>;
8
- export {};
7
+ declare const generateMetadata: () => Promise<Metadata>;
8
+ declare function CategoriesPage(params: React.ComponentProps<typeof CategoriesAdminView>): Promise<React.JSX.Element>;
9
+ //#endregion
10
+ export { CategoriesPage as default, generateMetadata };
9
11
  //# sourceMappingURL=page.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../../../../src/routes/admin/blog/categories/page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAOrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,QAAA,MAAM,mBAAmB;;EAIxB,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAAa,OAAO,CAAC,QAAQ,CAMzD,CAAC;AAEF,wBAA8B,cAAc,CAC1C,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,mBAAmB,CAAC,8BAoBzD"}
1
+ {"version":3,"file":"page.d.ts","names":[],"sources":["../../../../../../src/routes/admin/blog/categories/page.tsx"],"mappings":";;;cAcM,qBAAmB,MAAA;;;cAMZ,wBAA6B,QAAQ;iBAQpB,eAC5B,QAAQ,MAAM,sBAAsB,uBAAoB,QAAA,MAAA,IAAA"}
@@ -1 +1,2 @@
1
- import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{I18nProvider}from"@vitnode/core/components/i18n-provider";import{DataTableSkeleton}from"@vitnode/core/components/table/data-table";import{HeaderContent}from"@vitnode/core/components/ui/header-content";import{getTranslations}from"next-intl/server";import dynamic from"next/dynamic";import React from"react";import{ActionsCategoriesAdmin}from"../../../../views/admin/categories/actions/actions.js";const CategoriesAdminView=dynamic(async()=>import("../../../../views/admin/categories/table/categories-admin-view.js").then(mod=>({default:mod.CategoriesAdminView})));export const generateMetadata=async()=>{const t=await getTranslations("@vitnode/blog.admin.nav");return{title:t("categories")}};export default async function CategoriesPage(params){const[t,tNav]=await Promise.all([getTranslations("@vitnode/blog.admin.categories"),getTranslations("@vitnode/blog.admin.nav")]);return _jsx(I18nProvider,{namespaces:["@vitnode/blog.admin.categories"],children:_jsxs("div",{className:"p-4",children:[_jsx(HeaderContent,{desc:t("desc"),h1:tNav("categories"),children:_jsx(ActionsCategoriesAdmin,{})}),_jsx(React.Suspense,{fallback:_jsx(DataTableSkeleton,{columns:4}),children:_jsx(CategoriesAdminView,{...params})})]})})}
1
+ import{CONFIG_PLUGIN as e}from"../../../../const.js";import{ActionsCategoriesAdmin as t}from"../../../../views/admin/categories/actions/actions.js";import{jsx as n,jsxs as r}from"react/jsx-runtime";import{I18nProvider as i}from"@vitnode/core/components/i18n-provider";import{DataTableSkeleton as a}from"@vitnode/core/components/table/data-table";import{HeaderContent as o}from"@vitnode/core/components/ui/header-content";import{checkAdminPermissionApi as s}from"@vitnode/core/lib/api/get-session-admin-api";import{getTranslations as c}from"next-intl/server";import l from"next/dynamic";import{notFound as u}from"next/navigation";import d from"react";const f=l(async()=>import(`../../../../views/admin/categories/table/categories-admin-view.js`).then(e=>({default:e.CategoriesAdminView}))),p=async()=>({title:(await c(`@vitnode/blog.admin.nav`))(`categories`)});async function m(l){let[p,m,h,g]=await Promise.all([c(`@vitnode/blog.admin.categories`),c(`@vitnode/blog.admin.nav`),s({plugin:e.pluginId,module:`categories`,permission:`can_view`}),s({plugin:e.pluginId,module:`categories`,permission:`can_create`})]);return h||u(),n(i,{namespaces:[`@vitnode/blog.admin.categories`],children:r(`div`,{className:`p-4`,children:[n(o,{desc:p(`desc`),h1:m(`categories`),children:g&&n(t,{})}),n(d.Suspense,{fallback:n(a,{columns:4}),children:n(f,{...l})})]})})}export{m as default,p as generateMetadata};
2
+ //# sourceMappingURL=page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page.js","names":[],"sources":["../../../../../../src/routes/admin/blog/categories/page.tsx"],"sourcesContent":["import type { Metadata } from \"next\";\n\nimport { I18nProvider } from \"@vitnode/core/components/i18n-provider\";\nimport { DataTableSkeleton } from \"@vitnode/core/components/table/data-table\";\nimport { HeaderContent } from \"@vitnode/core/components/ui/header-content\";\nimport { checkAdminPermissionApi } from \"@vitnode/core/lib/api/get-session-admin-api\";\nimport { getTranslations } from \"next-intl/server\";\nimport dynamic from \"next/dynamic\";\nimport { notFound } from \"next/navigation\";\nimport React from \"react\";\n\nimport { CONFIG_PLUGIN } from \"@/const\";\nimport { ActionsCategoriesAdmin } from \"@/views/admin/categories/actions/actions\";\n\nconst CategoriesAdminView = dynamic(async () =>\n import(\"@/views/admin/categories/table/categories-admin-view\").then(mod => ({\n default: mod.CategoriesAdminView,\n })),\n);\n\nexport const generateMetadata = async (): Promise<Metadata> => {\n const t = await getTranslations(\"@vitnode/blog.admin.nav\");\n\n return {\n title: t(\"categories\"),\n };\n};\n\nexport default async function CategoriesPage(\n params: React.ComponentProps<typeof CategoriesAdminView>,\n) {\n const [t, tNav, canView, canCreate] = await Promise.all([\n getTranslations(\"@vitnode/blog.admin.categories\"),\n getTranslations(\"@vitnode/blog.admin.nav\"),\n checkAdminPermissionApi({\n plugin: CONFIG_PLUGIN.pluginId,\n module: \"categories\",\n permission: \"can_view\",\n }),\n checkAdminPermissionApi({\n plugin: CONFIG_PLUGIN.pluginId,\n module: \"categories\",\n permission: \"can_create\",\n }),\n ]);\n\n if (!canView) {\n notFound();\n }\n\n return (\n <I18nProvider namespaces={[\"@vitnode/blog.admin.categories\"]}>\n <div className=\"p-4\">\n <HeaderContent desc={t(\"desc\")} h1={tNav(\"categories\")}>\n {canCreate && <ActionsCategoriesAdmin />}\n </HeaderContent>\n\n <React.Suspense fallback={<DataTableSkeleton columns={4} />}>\n <CategoriesAdminView {...params} />\n </React.Suspense>\n </div>\n </I18nProvider>\n );\n}\n"],"mappings":"0oBAcA,MAAM,EAAsB,EAAQ,SAClC,OAAO,oEAAuD,CAAC,KAAK,IAAQ,CAC1E,QAAS,EAAI,mBACf,EAAE,CACJ,EAEa,EAAmB,UAGvB,CACL,OAAO,MAHO,EAAgB,yBAAyB,EAAA,CAG9C,YAAY,CACvB,GAGF,eAA8B,EAC5B,EACA,CACA,GAAM,CAAC,EAAG,EAAM,EAAS,GAAa,MAAM,QAAQ,IAAI,CACtD,EAAgB,gCAAgC,EAChD,EAAgB,yBAAyB,EACzC,EAAwB,CACtB,OAAQ,EAAc,SACtB,OAAQ,aACR,WAAY,UACd,CAAC,EACD,EAAwB,CACtB,OAAQ,EAAc,SACtB,OAAQ,aACR,WAAY,YACd,CAAC,CACH,CAAC,EAMD,OAJK,GACH,EAAS,EAIT,EAAC,EAAD,CAAc,WAAY,CAAC,gCAAgC,WACzD,EAAC,MAAD,CAAK,UAAU,eAAf,CACE,EAAC,EAAD,CAAe,KAAM,EAAE,MAAM,EAAG,GAAI,EAAK,YAAY,WAClD,GAAa,EAAC,EAAD,CAAyB,CAAA,CAC1B,CAAA,EAEf,EAAC,EAAM,SAAP,CAAgB,SAAU,EAAC,EAAD,CAAmB,QAAS,CAAI,CAAA,WACxD,EAAC,EAAD,CAAqB,GAAI,CAAS,CAAA,CACpB,CAAA,CACb,GACO,CAAA,CAElB"}
@@ -1,9 +1,11 @@
1
- import type { Metadata } from "next";
2
1
  import React from "react";
2
+ import { Metadata } from "next";
3
+ //#region src/routes/admin/blog/posts/page.d.ts
3
4
  declare const PostsAdminView: React.ComponentType<{
4
- searchParams: Promise<Record<string, string | string[] | undefined>>;
5
+ searchParams: Promise<Record<string, string | string[] | undefined>>;
5
6
  }>;
6
- export declare const generateMetadata: () => Promise<Metadata>;
7
- export default function PostsPage(params: React.ComponentProps<typeof PostsAdminView>): Promise<React.JSX.Element>;
8
- export {};
7
+ declare const generateMetadata: () => Promise<Metadata>;
8
+ declare function PostsPage(params: React.ComponentProps<typeof PostsAdminView>): Promise<React.JSX.Element>;
9
+ //#endregion
10
+ export { PostsPage as default, generateMetadata };
9
11
  //# sourceMappingURL=page.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../../../../src/routes/admin/blog/posts/page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAOrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,QAAA,MAAM,cAAc;;EAInB,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAAa,OAAO,CAAC,QAAQ,CAMzD,CAAC;AAEF,wBAA8B,SAAS,CACrC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,8BAoBpD"}
1
+ {"version":3,"file":"page.d.ts","names":[],"sources":["../../../../../../src/routes/admin/blog/posts/page.tsx"],"mappings":";;;cAcM,gBAAc,MAAA;;;cAMP,wBAA6B,QAAQ;iBAQpB,UAC5B,QAAQ,MAAM,sBAAsB,kBAAe,QAAA,MAAA,IAAA"}
@@ -1 +1,2 @@
1
- import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{I18nProvider}from"@vitnode/core/components/i18n-provider";import{DataTableSkeleton}from"@vitnode/core/components/table/data-table";import{HeaderContent}from"@vitnode/core/components/ui/header-content";import{getTranslations}from"next-intl/server";import dynamic from"next/dynamic";import React from"react";import{ActionsPostsAdmin}from"../../../../views/admin/posts/actions/actions.js";const PostsAdminView=dynamic(async()=>import("../../../../views/admin/posts/table/posts-admin-view.js").then(mod=>({default:mod.PostsAdminView})));export const generateMetadata=async()=>{const t=await getTranslations("@vitnode/blog.admin.nav");return{title:t("posts")}};export default async function PostsPage(params){const[t,tNav]=await Promise.all([getTranslations("@vitnode/blog.admin.posts"),getTranslations("@vitnode/blog.admin.nav")]);return _jsx(I18nProvider,{namespaces:["@vitnode/blog.admin.posts"],children:_jsxs("div",{className:"p-4",children:[_jsx(HeaderContent,{desc:t("desc"),h1:tNav("posts"),children:_jsx(ActionsPostsAdmin,{})}),_jsx(React.Suspense,{fallback:_jsx(DataTableSkeleton,{columns:5}),children:_jsx(PostsAdminView,{...params})})]})})}
1
+ import{CONFIG_PLUGIN as e}from"../../../../const.js";import{ActionsPostsAdmin as t}from"../../../../views/admin/posts/actions/actions.js";import{jsx as n,jsxs as r}from"react/jsx-runtime";import{I18nProvider as i}from"@vitnode/core/components/i18n-provider";import{DataTableSkeleton as a}from"@vitnode/core/components/table/data-table";import{HeaderContent as o}from"@vitnode/core/components/ui/header-content";import{checkAdminPermissionApi as s}from"@vitnode/core/lib/api/get-session-admin-api";import{getTranslations as c}from"next-intl/server";import l from"next/dynamic";import{notFound as u}from"next/navigation";import d from"react";const f=l(async()=>import(`../../../../views/admin/posts/table/posts-admin-view.js`).then(e=>({default:e.PostsAdminView}))),p=async()=>({title:(await c(`@vitnode/blog.admin.nav`))(`posts`)});async function m(l){let[p,m,h,g]=await Promise.all([c(`@vitnode/blog.admin.posts`),c(`@vitnode/blog.admin.nav`),s({plugin:e.pluginId,module:`posts`,permission:`can_view`}),s({plugin:e.pluginId,module:`posts`,permission:`can_create`})]);return h||u(),n(i,{namespaces:[`@vitnode/blog.admin.posts`],children:r(`div`,{className:`p-4`,children:[n(o,{desc:p(`desc`),h1:m(`posts`),children:g&&n(t,{})}),n(d.Suspense,{fallback:n(a,{columns:5}),children:n(f,{...l})})]})})}export{m as default,p as generateMetadata};
2
+ //# sourceMappingURL=page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page.js","names":[],"sources":["../../../../../../src/routes/admin/blog/posts/page.tsx"],"sourcesContent":["import type { Metadata } from \"next\";\n\nimport { I18nProvider } from \"@vitnode/core/components/i18n-provider\";\nimport { DataTableSkeleton } from \"@vitnode/core/components/table/data-table\";\nimport { HeaderContent } from \"@vitnode/core/components/ui/header-content\";\nimport { checkAdminPermissionApi } from \"@vitnode/core/lib/api/get-session-admin-api\";\nimport { getTranslations } from \"next-intl/server\";\nimport dynamic from \"next/dynamic\";\nimport { notFound } from \"next/navigation\";\nimport React from \"react\";\n\nimport { CONFIG_PLUGIN } from \"@/const\";\nimport { ActionsPostsAdmin } from \"@/views/admin/posts/actions/actions\";\n\nconst PostsAdminView = dynamic(async () =>\n import(\"@/views/admin/posts/table/posts-admin-view\").then(mod => ({\n default: mod.PostsAdminView,\n })),\n);\n\nexport const generateMetadata = async (): Promise<Metadata> => {\n const t = await getTranslations(\"@vitnode/blog.admin.nav\");\n\n return {\n title: t(\"posts\"),\n };\n};\n\nexport default async function PostsPage(\n params: React.ComponentProps<typeof PostsAdminView>,\n) {\n const [t, tNav, canView, canCreate] = await Promise.all([\n getTranslations(\"@vitnode/blog.admin.posts\"),\n getTranslations(\"@vitnode/blog.admin.nav\"),\n checkAdminPermissionApi({\n plugin: CONFIG_PLUGIN.pluginId,\n module: \"posts\",\n permission: \"can_view\",\n }),\n checkAdminPermissionApi({\n plugin: CONFIG_PLUGIN.pluginId,\n module: \"posts\",\n permission: \"can_create\",\n }),\n ]);\n\n if (!canView) {\n notFound();\n }\n\n return (\n <I18nProvider namespaces={[\"@vitnode/blog.admin.posts\"]}>\n <div className=\"p-4\">\n <HeaderContent desc={t(\"desc\")} h1={tNav(\"posts\")}>\n {canCreate && <ActionsPostsAdmin />}\n </HeaderContent>\n\n <React.Suspense fallback={<DataTableSkeleton columns={5} />}>\n <PostsAdminView {...params} />\n </React.Suspense>\n </div>\n </I18nProvider>\n );\n}\n"],"mappings":"goBAcA,MAAM,EAAiB,EAAQ,SAC7B,OAAO,0DAA6C,CAAC,KAAK,IAAQ,CAChE,QAAS,EAAI,cACf,EAAE,CACJ,EAEa,EAAmB,UAGvB,CACL,OAAO,MAHO,EAAgB,yBAAyB,EAAA,CAG9C,OAAO,CAClB,GAGF,eAA8B,EAC5B,EACA,CACA,GAAM,CAAC,EAAG,EAAM,EAAS,GAAa,MAAM,QAAQ,IAAI,CACtD,EAAgB,2BAA2B,EAC3C,EAAgB,yBAAyB,EACzC,EAAwB,CACtB,OAAQ,EAAc,SACtB,OAAQ,QACR,WAAY,UACd,CAAC,EACD,EAAwB,CACtB,OAAQ,EAAc,SACtB,OAAQ,QACR,WAAY,YACd,CAAC,CACH,CAAC,EAMD,OAJK,GACH,EAAS,EAIT,EAAC,EAAD,CAAc,WAAY,CAAC,2BAA2B,WACpD,EAAC,MAAD,CAAK,UAAU,eAAf,CACE,EAAC,EAAD,CAAe,KAAM,EAAE,MAAM,EAAG,GAAI,EAAK,OAAO,WAC7C,GAAa,EAAC,EAAD,CAAoB,CAAA,CACrB,CAAA,EAEf,EAAC,EAAM,SAAP,CAAgB,SAAU,EAAC,EAAD,CAAmB,QAAS,CAAI,CAAA,WACxD,EAAC,EAAD,CAAgB,GAAI,CAAS,CAAA,CACf,CAAA,CACb,GACO,CAAA,CAElB"}
@@ -1,3 +1,6 @@
1
1
  import React from "react";
2
- export declare const ActionsCategoriesAdmin: () => React.JSX.Element;
2
+ //#region src/views/admin/categories/actions/actions.d.ts
3
+ declare const ActionsCategoriesAdmin: () => React.JSX.Element;
4
+ //#endregion
5
+ export { ActionsCategoriesAdmin };
3
6
  //# sourceMappingURL=actions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../../../../src/views/admin/categories/actions/actions.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,eAAO,MAAM,sBAAsB,yBAwBlC,CAAC"}
1
+ {"version":3,"file":"actions.d.ts","names":[],"sources":["../../../../../../src/views/admin/categories/actions/actions.tsx"],"mappings":";;cAuBa,8BAAsB,MAAA,IAAA"}
@@ -1 +1,2 @@
1
- "use client";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{Button}from"@vitnode/core/components/ui/button";import{Dialog,DialogContent,DialogDescription,DialogHeader,DialogTitle,DialogTrigger}from"@vitnode/core/components/ui/dialog";import{Loader}from"@vitnode/core/components/ui/loader";import{PlusIcon}from"lucide-react";import{useTranslations}from"next-intl";import dynamic from"next/dynamic";import React from"react";const CreateEditActionCategoriesAdmin=dynamic(async()=>import("./create-edit/create-edit.js").then(mod=>({default:mod.CreateEditActionCategoriesAdmin})));export const ActionsCategoriesAdmin=()=>{const t=useTranslations("@vitnode/blog.admin.categories.create");return _jsxs(Dialog,{children:[_jsx(DialogTrigger,{asChild:true,children:_jsxs(Button,{children:[_jsx(PlusIcon,{}),t("title")]})}),_jsxs(DialogContent,{children:[_jsxs(DialogHeader,{children:[_jsx(DialogTitle,{children:t("title")}),_jsx(DialogDescription,{children:t("desc")})]}),_jsx(React.Suspense,{fallback:_jsx(Loader,{}),children:_jsx(CreateEditActionCategoriesAdmin,{})})]})]})};
1
+ "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import{PlusIcon as n}from"lucide-react";import r from"next/dynamic";import i from"react";import{Button as a}from"@vitnode/core/components/ui/button";import{Dialog as o,DialogContent as s,DialogDescription as c,DialogHeader as l,DialogTitle as u,DialogTrigger as d}from"@vitnode/core/components/ui/dialog";import{Loader as f}from"@vitnode/core/components/ui/loader";import{useTranslations as p}from"next-intl";const m=r(async()=>import(`./create-edit/create-edit.js`).then(e=>({default:e.CreateEditActionCategoriesAdmin}))),h=()=>{let r=p(`@vitnode/blog.admin.categories.create`);return t(o,{children:[t(d,{render:e(a,{}),children:[e(n,{}),r(`title`)]}),t(s,{children:[t(l,{children:[e(u,{children:r(`title`)}),e(c,{children:r(`desc`)})]}),e(i.Suspense,{fallback:e(f,{}),children:e(m,{})})]})]})};export{h as ActionsCategoriesAdmin};
2
+ //# sourceMappingURL=actions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions.js","names":[],"sources":["../../../../../../src/views/admin/categories/actions/actions.tsx"],"sourcesContent":["\"use client\";\n\nimport { Button } from \"@vitnode/core/components/ui/button\";\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n} from \"@vitnode/core/components/ui/dialog\";\nimport { Loader } from \"@vitnode/core/components/ui/loader\";\nimport { PlusIcon } from \"lucide-react\";\nimport { useTranslations } from \"next-intl\";\nimport dynamic from \"next/dynamic\";\nimport React from \"react\";\n\nconst CreateEditActionCategoriesAdmin = dynamic(async () =>\n import(\"./create-edit/create-edit\").then(mod => ({\n default: mod.CreateEditActionCategoriesAdmin,\n })),\n);\n\nexport const ActionsCategoriesAdmin = () => {\n const t = useTranslations(\"@vitnode/blog.admin.categories.create\");\n\n return (\n <Dialog>\n <DialogTrigger render={<Button />}>\n <PlusIcon />\n {t(\"title\")}\n </DialogTrigger>\n\n <DialogContent>\n <DialogHeader>\n <DialogTitle>{t(\"title\")}</DialogTitle>\n <DialogDescription>{t(\"desc\")}</DialogDescription>\n </DialogHeader>\n\n <React.Suspense fallback={<Loader />}>\n <CreateEditActionCategoriesAdmin />\n </React.Suspense>\n </DialogContent>\n </Dialog>\n );\n};\n"],"mappings":"wdAiBA,MAAM,EAAkC,EAAQ,SAC9C,OAAO,+BAA4B,CAAC,KAAK,IAAQ,CAC/C,QAAS,EAAI,+BACf,EAAE,CACJ,EAEa,MAA+B,CAC1C,IAAM,EAAI,EAAgB,uCAAuC,EAEjE,OACE,EAAC,EAAD,CAAA,SAAA,CACE,EAAC,EAAD,CAAe,OAAQ,EAAC,EAAD,CAAS,CAAA,WAAhC,CACE,EAAC,EAAD,CAAW,CAAA,EACV,EAAE,OAAO,CACG,IAEf,EAAC,EAAD,CAAA,SAAA,CACE,EAAC,EAAD,CAAA,SAAA,CACE,EAAC,EAAD,CAAA,SAAc,EAAE,OAAO,CAAe,CAAA,EACtC,EAAC,EAAD,CAAA,SAAoB,EAAE,MAAM,CAAqB,CAAA,CACrC,CAAA,CAAA,EAEd,EAAC,EAAM,SAAP,CAAgB,SAAU,EAAC,EAAD,CAAS,CAAA,WACjC,EAAC,EAAD,CAAkC,CAAA,CACpB,CAAA,CACH,CAAA,CAAA,CACT,CAAA,CAAA,CAEZ"}
@@ -1,8 +1,11 @@
1
+ import { zodCreateCategorySchema } from "../../../../../api/modules/admin/categories/routes/create.route.js";
1
2
  import { z } from "zod";
2
- import type { zodCreateCategorySchema } from "../../../../../api/modules/admin/categories/routes/create.route";
3
- export declare const CreateEditActionCategoriesAdmin: ({ data, }: {
4
- data?: z.infer<typeof zodCreateCategorySchema> & {
5
- id: number;
6
- };
3
+ //#region src/views/admin/categories/actions/create-edit/create-edit.d.ts
4
+ declare const CreateEditActionCategoriesAdmin: ({ data }: {
5
+ data?: z.infer<typeof zodCreateCategorySchema> & {
6
+ id: number;
7
+ };
7
8
  }) => import("react").JSX.Element;
9
+ //#endregion
10
+ export { CreateEditActionCategoriesAdmin };
8
11
  //# sourceMappingURL=create-edit.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-edit.d.ts","sourceRoot":"","sources":["../../../../../../../src/views/admin/categories/actions/create-edit/create-edit.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oDAAoD,CAAC;AAIlG,eAAO,MAAM,+BAA+B,GAAI,WAE7C;IACD,IAAI,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;CACjE,gCAqEA,CAAC"}
1
+ {"version":3,"file":"create-edit.d.ts","names":[],"sources":["../../../../../../../src/views/admin/categories/actions/create-edit/create-edit.tsx"],"mappings":";;;cAea,oCAAmC;EAG9C,OAAO,EAAE,aAAa;IAA6B;;sBACpD,IAAA"}
@@ -1 +1,2 @@
1
- import{jsx as _jsx}from"react/jsx-runtime";import{AutoForm}from"@vitnode/core/components/form/auto-form";import{AutoFormInput}from"@vitnode/core/components/form/fields/input";import{useDialog}from"@vitnode/core/components/ui/dialog";import{usePathname,useRouter}from"@vitnode/core/lib/navigation";import{useTranslations}from"next-intl";import{toast}from"sonner";import{z}from"zod";import{createMutationApi,editMutationApi}from"./mutation-api.js";export const CreateEditActionCategoriesAdmin=({data})=>{const t=useTranslations("@vitnode/blog.admin.categories");const tCore=useTranslations("core.global.errors");const{setOpen}=useDialog();const{push}=useRouter();const pathname=usePathname();const formSchema=z.object({title:z.string().default(data?.title??"")});const onSubmit=async(values,form)=>{let error="";if(data?.id){const mutation=await editMutationApi({id:data.id,...values});if(mutation?.error){error=mutation.error}}else{const mutation=await createMutationApi(values);if(mutation?.error){error=mutation.error}}if(error){if(error.includes("already exists")){form.setError("title",{type:"manual",message:t("create.form.title.already_exists")});return}toast.error(tCore("title"),{description:tCore("internal_server_error")});return}setOpen?.(false);push(pathname)};return _jsx(AutoForm,{fields:[{id:"title",component:props=>_jsx(AutoFormInput,{label:t("create.form.title.label"),...props})}],formSchema:formSchema,onSubmit:onSubmit,submitButtonProps:{children:t(`${data?"edit":"create"}.submit`)}})};
1
+ import{createMutationApi as e,editMutationApi as t}from"./mutation-api.js";import{z as n}from"zod";import{jsx as r}from"react/jsx-runtime";import{useDialog as i}from"@vitnode/core/components/ui/dialog";import{useTranslations as a}from"next-intl";import{toast as o}from"sonner";import{AutoForm as s}from"@vitnode/core/components/form/auto-form";import{AutoFormInput as c}from"@vitnode/core/components/form/fields/input";import{usePathname as l,useRouter as u}from"@vitnode/core/lib/navigation";const d=({data:d})=>{let f=a(`@vitnode/blog.admin.categories`),p=a(`core.global.errors`),{setOpen:m}=i(),{push:h}=u(),g=l();return r(s,{fields:[{id:`title`,component:e=>r(c,{label:f(`create.form.title.label`),...e})}],formSchema:n.object({title:n.string().default(d?.title??``)}),onSubmit:async(n,r)=>{let i=``;if(d?.id){let e=await t({id:d.id,...n});e?.error&&(i=e.error)}else{let t=await e(n);t?.error&&(i=t.error)}if(i){if(i.includes(`already exists`)){r.setError(`title`,{type:`manual`,message:f(`create.form.title.already_exists`)});return}o.error(p(`title`),{description:p(`internal_server_error`)});return}m?.(!1),h(g)},submitButtonProps:{children:f(`${d?`edit`:`create`}.submit`)}})};export{d as CreateEditActionCategoriesAdmin};
2
+ //# sourceMappingURL=create-edit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-edit.js","names":[],"sources":["../../../../../../../src/views/admin/categories/actions/create-edit/create-edit.tsx"],"sourcesContent":["import {\n AutoForm,\n type AutoFormOnSubmit,\n} from \"@vitnode/core/components/form/auto-form\";\nimport { AutoFormInput } from \"@vitnode/core/components/form/fields/input\";\nimport { useDialog } from \"@vitnode/core/components/ui/dialog\";\nimport { usePathname, useRouter } from \"@vitnode/core/lib/navigation\";\nimport { useTranslations } from \"next-intl\";\nimport { toast } from \"sonner\";\nimport { z } from \"zod\";\n\nimport type { zodCreateCategorySchema } from \"@/api/modules/admin/categories/routes/create.route\";\n\nimport { createMutationApi, editMutationApi } from \"./mutation-api\";\n\nexport const CreateEditActionCategoriesAdmin = ({\n data,\n}: {\n data?: z.infer<typeof zodCreateCategorySchema> & { id: number };\n}) => {\n const t = useTranslations(\"@vitnode/blog.admin.categories\");\n const tCore = useTranslations(\"core.global.errors\");\n const { setOpen } = useDialog();\n const { push } = useRouter();\n const pathname = usePathname();\n const formSchema = z.object({\n title: z.string().default(data?.title ?? \"\"),\n });\n\n const onSubmit: AutoFormOnSubmit<typeof formSchema> = async (\n values,\n form,\n ) => {\n let error = \"\";\n if (data?.id) {\n const mutation = await editMutationApi({\n id: data.id,\n ...values,\n });\n\n if (mutation?.error) {\n error = mutation.error;\n }\n } else {\n const mutation = await createMutationApi(values);\n\n if (mutation?.error) {\n error = mutation.error;\n }\n }\n\n if (error) {\n if (error.includes(\"already exists\")) {\n form.setError(\"title\", {\n type: \"manual\",\n message: t(\"create.form.title.already_exists\"),\n });\n\n return;\n }\n\n toast.error(tCore(\"title\"), {\n description: tCore(\"internal_server_error\"),\n });\n\n return;\n }\n setOpen?.(false);\n push(pathname);\n };\n\n return (\n <AutoForm\n fields={[\n {\n id: \"title\",\n component: props => (\n <AutoFormInput label={t(\"create.form.title.label\")} {...props} />\n ),\n },\n ]}\n formSchema={formSchema}\n onSubmit={onSubmit}\n submitButtonProps={{\n children: t(`${data ? \"edit\" : \"create\"}.submit`),\n }}\n />\n );\n};\n"],"mappings":"6eAeA,MAAa,GAAmC,CAC9C,UAGI,CACJ,IAAM,EAAI,EAAgB,gCAAgC,EACpD,EAAQ,EAAgB,oBAAoB,EAC5C,CAAE,WAAY,EAAU,EACxB,CAAE,QAAS,EAAU,EACrB,EAAW,EAAY,EA+C7B,OACE,EAAC,EAAD,CACE,OAAQ,CACN,CACE,GAAI,QACJ,UAAW,GACT,EAAC,EAAD,CAAe,MAAO,EAAE,yBAAyB,EAAG,GAAI,CAAQ,CAAA,CAEpE,CACF,EACY,WAxDG,EAAE,OAAO,CAC1B,MAAO,EAAE,OAAO,CAAC,CAAC,QAAQ,GAAM,OAAS,EAAE,CAC7C,CAsDgB,EACF,eApDZ,EACA,IACG,CACH,IAAI,EAAQ,GACZ,GAAI,GAAM,GAAI,CACZ,IAAM,EAAW,MAAM,EAAgB,CACrC,GAAI,EAAK,GACT,GAAG,CACL,CAAC,EAEG,GAAU,QACZ,EAAQ,EAAS,MAErB,KAAO,CACL,IAAM,EAAW,MAAM,EAAkB,CAAM,EAE3C,GAAU,QACZ,EAAQ,EAAS,MAErB,CAEA,GAAI,EAAO,CACT,GAAI,EAAM,SAAS,gBAAgB,EAAG,CACpC,EAAK,SAAS,QAAS,CACrB,KAAM,SACN,QAAS,EAAE,kCAAkC,CAC/C,CAAC,EAED,MACF,CAEA,EAAM,MAAM,EAAM,OAAO,EAAG,CAC1B,YAAa,EAAM,uBAAuB,CAC5C,CAAC,EAED,MACF,CACA,IAAU,EAAK,EACf,EAAK,CAAQ,CACf,EAcI,kBAAmB,CACjB,SAAU,EAAE,GAAG,EAAO,OAAS,SAAS,QAAQ,CAClD,CACD,CAAA,CAEL"}
@@ -1,11 +1,14 @@
1
- import type { z } from "zod";
2
- import type { zodCreateCategorySchema } from "../../../../../api/modules/admin/categories/routes/create.route";
3
- export declare const createMutationApi: (body: z.infer<typeof zodCreateCategorySchema>) => Promise<{
4
- error: string;
1
+ import { zodCreateCategorySchema } from "../../../../../api/modules/admin/categories/routes/create.route.js";
2
+ import { z } from "zod";
3
+ //#region src/views/admin/categories/actions/create-edit/mutation-api.d.ts
4
+ declare const createMutationApi: (body: z.infer<typeof zodCreateCategorySchema>) => Promise<{
5
+ error: string;
5
6
  } | undefined>;
6
- export declare const editMutationApi: ({ id, ...body }: z.infer<typeof zodCreateCategorySchema> & {
7
- id: number;
7
+ declare const editMutationApi: ({ id, ...body }: z.infer<typeof zodCreateCategorySchema> & {
8
+ id: number;
8
9
  }) => Promise<{
9
- error: string;
10
+ error: string;
10
11
  } | undefined>;
12
+ //#endregion
13
+ export { createMutationApi, editMutationApi };
11
14
  //# sourceMappingURL=mutation-api.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mutation-api.d.ts","sourceRoot":"","sources":["../../../../../../../src/views/admin/categories/actions/create-edit/mutation-api.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAK7B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iEAAiE,CAAC;AAI/G,eAAO,MAAM,iBAAiB,GAC5B,MAAM,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC;;cAoB9C,CAAC;AAEF,eAAO,MAAM,eAAe,GAAU,iBAGnC,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE;;cAsB1D,CAAC"}
1
+ {"version":3,"file":"mutation-api.d.ts","names":[],"sources":["../../../../../../../src/views/admin/categories/actions/create-edit/mutation-api.ts"],"mappings":";;;cAWa,oBACX,MAAM,EAAE,aAAa,6BAAwB;;;cAsBlC,oBAAyB,OAAA,QAGnC,EAAE,aAAa;EAA6B;MAAY"}
@@ -1 +1,2 @@
1
- "use server";import{fetcher}from"@vitnode/core/lib/fetcher";import{revalidatePath}from"next/cache";import{categoriesAdminModule}from"../../../../../api/modules/admin/categories/categories.admin.module.js";export const createMutationApi=async body=>{const res=await fetcher(categoriesAdminModule,{prefixPath:"/admin",method:"post",module:"categories",path:"/",args:{body}});if(res.status!==201){return{error:await res.text()}}revalidatePath("/[locale]/admin/(auth)/(plugins)/(vitnode-blog)/blog/categories","page")};export const editMutationApi=async({id,...body})=>{const res=await fetcher(categoriesAdminModule,{prefixPath:"/admin",method:"put",module:"categories",path:"/{id}",args:{params:{id},body}});if(res.status!==200){return{error:await res.text()}}revalidatePath("/[locale]/admin/(auth)/(plugins)/(vitnode-blog)/blog/categories","page")};
1
+ "use server";import{categoriesAdminModule as e}from"../../../../../api/modules/admin/categories/categories.admin.module.js";import{fetcher as t}from"@vitnode/core/lib/fetcher";import{revalidatePath as n}from"next/cache";const r=async r=>{let i=await t(e,{prefixPath:`/admin`,method:`post`,module:`categories`,path:`/`,args:{body:r}});if(i.status!==201)return{error:await i.text()};n(`/[locale]/admin/(auth)/(plugins)/(vitnode-blog)/blog/categories`,`page`)},i=async({id:r,...i})=>{let a=await t(e,{prefixPath:`/admin`,method:`put`,module:`categories`,path:`/{id}`,args:{params:{id:r},body:i}});if(a.status!==200)return{error:await a.text()};n(`/[locale]/admin/(auth)/(plugins)/(vitnode-blog)/blog/categories`,`page`)};export{r as createMutationApi,i as editMutationApi};
2
+ //# sourceMappingURL=mutation-api.js.map