@vitnode/core 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 (183) hide show
  1. package/dist/scripts/plugin.d.ts.map +1 -1
  2. package/dist/scripts/scripts.js +2 -9
  3. package/dist/scripts/shared/file-utils.d.ts.map +1 -1
  4. package/dist/src/api/{plugins → adapters}/email/nodemailer.d.ts +1 -1
  5. package/dist/src/api/adapters/email/nodemailer.d.ts.map +1 -0
  6. package/dist/src/api/{plugins → adapters}/email/nodemailer.js +1 -1
  7. package/dist/src/api/{plugins → adapters}/email/resend.d.ts +1 -1
  8. package/dist/src/api/adapters/email/resend.d.ts.map +1 -0
  9. package/dist/src/api/{plugins → adapters}/email/resend.js +1 -1
  10. package/dist/src/api/adapters/sso/discord.d.ts.map +1 -0
  11. package/dist/src/api/adapters/sso/facebook.d.ts.map +1 -0
  12. package/dist/src/api/adapters/sso/google.d.ts.map +1 -0
  13. package/dist/src/api/config.d.ts.map +1 -1
  14. package/dist/src/api/config.js +6 -5
  15. package/dist/src/api/lib/logger-middleware.d.ts +8 -0
  16. package/dist/src/api/lib/logger-middleware.d.ts.map +1 -0
  17. package/dist/src/api/lib/logger-middleware.js +35 -0
  18. package/dist/src/api/lib/route.d.ts +1 -1
  19. package/dist/src/api/lib/route.d.ts.map +1 -1
  20. package/dist/src/api/lib/route.js +1 -1
  21. package/dist/src/api/middlewares/{global/global.d.ts → global.middleware.d.ts} +10 -8
  22. package/dist/src/api/middlewares/global.middleware.d.ts.map +1 -0
  23. package/dist/src/api/middlewares/global.middleware.js +86 -0
  24. package/dist/src/api/middlewares/rate-limiter.middleware.d.ts +4 -0
  25. package/dist/src/api/middlewares/rate-limiter.middleware.d.ts.map +1 -0
  26. package/dist/src/api/middlewares/rate-limiter.middleware.js +26 -0
  27. package/dist/src/api/models/device.d.ts +4 -1
  28. package/dist/src/api/models/device.d.ts.map +1 -1
  29. package/dist/src/api/models/device.js +21 -14
  30. package/dist/src/api/models/email.d.ts +1 -2
  31. package/dist/src/api/models/email.d.ts.map +1 -1
  32. package/dist/src/api/models/email.js +9 -16
  33. package/dist/src/api/models/password.d.ts.map +1 -1
  34. package/dist/src/api/models/password.js +8 -1
  35. package/dist/src/api/models/session-admin.d.ts +1 -1
  36. package/dist/src/api/models/session-admin.d.ts.map +1 -1
  37. package/dist/src/api/models/session-admin.js +40 -16
  38. package/dist/src/api/models/session.d.ts +1 -1
  39. package/dist/src/api/models/session.d.ts.map +1 -1
  40. package/dist/src/api/models/session.js +28 -12
  41. package/dist/src/api/models/sso.js +1 -1
  42. package/dist/src/api/models/user/sign-up.d.ts +1 -1
  43. package/dist/src/api/models/user/sign-up.d.ts.map +1 -1
  44. package/dist/src/api/models/user/sign-up.js +2 -3
  45. package/dist/src/api/models/user.d.ts +1 -1
  46. package/dist/src/api/models/user.d.ts.map +1 -1
  47. package/dist/src/api/modules/admin/admin.module.d.ts +223 -8
  48. package/dist/src/api/modules/admin/admin.module.d.ts.map +1 -1
  49. package/dist/src/api/modules/admin/admin.module.js +3 -1
  50. package/dist/src/api/modules/admin/debug/debug.admin.module.d.ts +221 -0
  51. package/dist/src/api/modules/admin/debug/debug.admin.module.d.ts.map +1 -0
  52. package/dist/src/api/modules/admin/debug/debug.admin.module.js +10 -0
  53. package/dist/src/api/modules/admin/debug/routes/logs.route.d.ts +222 -0
  54. package/dist/src/api/modules/admin/debug/routes/logs.route.d.ts.map +1 -0
  55. package/dist/src/api/modules/admin/debug/routes/logs.route.js +90 -0
  56. package/dist/src/api/modules/admin/routes/session.route.d.ts +1 -5
  57. package/dist/src/api/modules/admin/routes/session.route.d.ts.map +1 -1
  58. package/dist/src/api/modules/admin/routes/session.route.js +0 -4
  59. package/dist/src/api/modules/admin/users/routes/list.route.d.ts +1 -1
  60. package/dist/src/api/modules/admin/users/routes/users.route.d.ts +1 -1
  61. package/dist/src/api/modules/admin/users/users.admin.module.d.ts +1 -1
  62. package/dist/src/api/modules/middleware/middleware.module.d.ts +1 -1
  63. package/dist/src/api/modules/middleware/route.d.ts +1 -1
  64. package/dist/src/api/modules/middleware/route.d.ts.map +1 -1
  65. package/dist/src/api/modules/middleware/route.js +2 -4
  66. package/dist/src/api/modules/users/routes/session.route.d.ts +1 -1
  67. package/dist/src/api/modules/users/routes/sign-in.route.d.ts +1 -1
  68. package/dist/src/api/modules/users/routes/sign-out.route.d.ts +1 -1
  69. package/dist/src/api/modules/users/routes/sign-up.route.d.ts +1 -1
  70. package/dist/src/api/modules/users/routes/test.route.d.ts +2 -2
  71. package/dist/src/api/modules/users/routes/test.route.d.ts.map +1 -1
  72. package/dist/src/api/modules/users/routes/test.route.js +9 -1
  73. package/dist/src/api/modules/users/sso/routes/callback.route.d.ts +1 -1
  74. package/dist/src/api/modules/users/sso/routes/create-url.route.d.ts +1 -1
  75. package/dist/src/api/modules/users/sso/sso.module.d.ts +2 -2
  76. package/dist/src/api/modules/users/users.module.d.ts +8 -8
  77. package/dist/src/app_admin/core/debug/page.d.ts +11 -0
  78. package/dist/src/app_admin/core/debug/page.d.ts.map +1 -0
  79. package/dist/src/app_admin/core/debug/page.js +44 -0
  80. package/dist/src/app_admin/core/users/page.d.ts +4 -1
  81. package/dist/src/app_admin/core/users/page.d.ts.map +1 -1
  82. package/dist/src/app_admin/core/users/page.js +3 -1
  83. package/dist/src/components/confirm-action/confirm-action-alert-dialog.d.ts +15 -0
  84. package/dist/src/components/confirm-action/confirm-action-alert-dialog.d.ts.map +1 -0
  85. package/dist/src/components/confirm-action/confirm-action-alert-dialog.js +41 -0
  86. package/dist/src/components/confirm-action/content.d.ts +7 -0
  87. package/dist/src/components/confirm-action/content.d.ts.map +1 -0
  88. package/dist/src/components/confirm-action/content.js +31 -0
  89. package/dist/src/components/date-format.d.ts +2 -1
  90. package/dist/src/components/date-format.d.ts.map +1 -1
  91. package/dist/src/components/date-format.js +4 -1
  92. package/dist/src/components/switchers/langs/language-swietcher.d.ts +5 -0
  93. package/dist/src/components/switchers/langs/language-swietcher.d.ts.map +1 -0
  94. package/dist/src/components/switchers/langs/language-swietcher.js +45 -0
  95. package/dist/src/components/switchers/themes/theme-switcher.d.ts.map +1 -0
  96. package/dist/src/components/switchers/{theme-switcher.js → themes/theme-switcher.js} +1 -1
  97. package/dist/src/components/table/data-table.d.ts.map +1 -1
  98. package/dist/src/components/table/data-table.js +2 -7
  99. package/dist/src/components/ui/alert-dialog.d.ts +7 -2
  100. package/dist/src/components/ui/alert-dialog.d.ts.map +1 -1
  101. package/dist/src/components/ui/alert-dialog.js +39 -5
  102. package/dist/src/components/ui/dialog.js +1 -1
  103. package/dist/src/database/logs.d.ts +203 -0
  104. package/dist/src/database/logs.d.ts.map +1 -0
  105. package/dist/src/database/logs.js +31 -0
  106. package/dist/src/database/sessions.d.ts +19 -0
  107. package/dist/src/database/sessions.d.ts.map +1 -1
  108. package/dist/src/database/sessions.js +3 -0
  109. package/dist/src/lib/fetcher/core.d.ts +2 -1
  110. package/dist/src/lib/fetcher/core.d.ts.map +1 -1
  111. package/dist/src/lib/fetcher/core.js +2 -2
  112. package/dist/src/lib/fetcher-client.d.ts +2 -1
  113. package/dist/src/lib/fetcher-client.d.ts.map +1 -1
  114. package/dist/src/lib/fetcher-client.js +3 -2
  115. package/dist/src/lib/fetcher.d.ts +2 -1
  116. package/dist/src/lib/fetcher.d.ts.map +1 -1
  117. package/dist/src/lib/fetcher.js +2 -1
  118. package/dist/src/views/admin/layouts/admin-layout.d.ts.map +1 -1
  119. package/dist/src/views/admin/layouts/admin-layout.js +5 -1
  120. package/dist/src/views/admin/layouts/user-bar/client.d.ts.map +1 -1
  121. package/dist/src/views/admin/layouts/user-bar/client.js +26 -18
  122. package/dist/src/views/admin/views/core/debug/actions/clear-cache/clear-cache.d.ts +2 -0
  123. package/dist/src/views/admin/views/core/debug/actions/clear-cache/clear-cache.d.ts.map +1 -0
  124. package/dist/src/views/admin/views/core/debug/actions/clear-cache/clear-cache.js +35 -0
  125. package/dist/src/views/admin/views/core/debug/actions/clear-cache/mutation-api.d.ts +2 -0
  126. package/dist/src/views/admin/views/core/debug/actions/clear-cache/mutation-api.d.ts.map +1 -0
  127. package/dist/src/views/admin/views/core/debug/actions/clear-cache/mutation-api.js +5 -0
  128. package/dist/src/views/admin/views/core/debug/system-logs/actions/more/content.d.ts +3 -0
  129. package/dist/src/views/admin/views/core/debug/system-logs/actions/more/content.d.ts.map +1 -0
  130. package/dist/src/views/admin/views/core/debug/system-logs/actions/more/content.js +281 -0
  131. package/dist/src/views/admin/views/core/debug/system-logs/actions/more/more.d.ts +5 -0
  132. package/dist/src/views/admin/views/core/debug/system-logs/actions/more/more.d.ts.map +1 -0
  133. package/dist/src/views/admin/views/core/debug/system-logs/actions/more/more.js +74 -0
  134. package/dist/src/views/admin/views/core/debug/system-logs/badges/badge-status.d.ts +4 -0
  135. package/dist/src/views/admin/views/core/debug/system-logs/badges/badge-status.d.ts.map +1 -0
  136. package/dist/src/views/admin/views/core/debug/system-logs/badges/badge-status.js +8 -0
  137. package/dist/src/views/admin/views/core/debug/system-logs/badges/badge-type-log.d.ts +3 -0
  138. package/dist/src/views/admin/views/core/debug/system-logs/badges/badge-type-log.d.ts.map +1 -0
  139. package/dist/src/views/admin/views/core/debug/system-logs/badges/badge-type-log.js +30 -0
  140. package/dist/src/views/admin/views/core/debug/system-logs/system-logs-view.d.ts +31 -0
  141. package/dist/src/views/admin/views/core/debug/system-logs/system-logs-view.d.ts.map +1 -0
  142. package/dist/src/views/admin/views/core/debug/system-logs/system-logs-view.js +96 -0
  143. package/dist/src/views/auth/sso/buttons/sso-buttons.d.ts +1 -1
  144. package/dist/src/views/auth/sso/buttons/sso-buttons.d.ts.map +1 -1
  145. package/dist/src/views/auth/sso/buttons/sso-buttons.js +5 -2
  146. package/dist/src/views/layouts/theme/header/header.d.ts +4 -1
  147. package/dist/src/views/layouts/theme/header/header.d.ts.map +1 -1
  148. package/dist/src/views/layouts/theme/header/header.js +8 -4
  149. package/dist/src/views/layouts/theme/layout.d.ts +3 -1
  150. package/dist/src/views/layouts/theme/layout.d.ts.map +1 -1
  151. package/dist/src/views/layouts/theme/layout.js +4 -3
  152. package/dist/src/vitnode.config.d.ts +11 -5
  153. package/dist/src/vitnode.config.d.ts.map +1 -1
  154. package/dist/src/vitnode.config.js +2 -1
  155. package/dist/tsconfig.tsbuildinfo +1 -1
  156. package/package.json +45 -28
  157. package/src/locales/en.json +59 -1
  158. package/dist/src/api/lib/get-user-ip.d.ts +0 -3
  159. package/dist/src/api/lib/get-user-ip.d.ts.map +0 -1
  160. package/dist/src/api/lib/get-user-ip.js +0 -8
  161. package/dist/src/api/middlewares/global/global.d.ts.map +0 -1
  162. package/dist/src/api/middlewares/global/global.js +0 -47
  163. package/dist/src/api/plugins/email/nodemailer.d.ts.map +0 -1
  164. package/dist/src/api/plugins/email/resend.d.ts.map +0 -1
  165. package/dist/src/api/plugins/sso/discord.d.ts.map +0 -1
  166. package/dist/src/api/plugins/sso/facebook.d.ts.map +0 -1
  167. package/dist/src/api/plugins/sso/google.d.ts.map +0 -1
  168. package/dist/src/components/switchers/theme-switcher.d.ts.map +0 -1
  169. package/src/app/login/page.tsx +0 -22
  170. package/src/app/login/sso/[providerId]/page.tsx +0 -19
  171. package/src/app/register/page.tsx +0 -22
  172. package/src/app_admin/core/page.tsx +0 -5
  173. package/src/app_admin/core/test/page.tsx +0 -5
  174. package/src/app_admin/core/users/page.tsx +0 -35
  175. package/src/drizzle.config.ts +0 -58
  176. package/src/vitnode.config.ts +0 -104
  177. /package/dist/src/api/{plugins → adapters}/sso/discord.d.ts +0 -0
  178. /package/dist/src/api/{plugins → adapters}/sso/discord.js +0 -0
  179. /package/dist/src/api/{plugins → adapters}/sso/facebook.d.ts +0 -0
  180. /package/dist/src/api/{plugins → adapters}/sso/facebook.js +0 -0
  181. /package/dist/src/api/{plugins → adapters}/sso/google.d.ts +0 -0
  182. /package/dist/src/api/{plugins → adapters}/sso/google.js +0 -0
  183. /package/dist/src/components/switchers/{theme-switcher.d.ts → themes/theme-switcher.d.ts} +0 -0
@@ -0,0 +1,222 @@
1
+ import { z } from 'zod';
2
+ export declare const logsDebugAdminRoute: {
3
+ handler: (c: import("hono").Context<import("../../../../middlewares/global.middleware").EnvVitNode, "/logs", {
4
+ in: {
5
+ query: {
6
+ orderBy?: "createdAt" | "type" | "pluginId" | undefined;
7
+ cursor?: string | undefined;
8
+ order?: "asc" | "desc" | undefined;
9
+ first?: string | undefined;
10
+ last?: string | undefined;
11
+ };
12
+ };
13
+ out: {
14
+ query: {
15
+ orderBy?: "createdAt" | "type" | "pluginId" | undefined;
16
+ cursor?: string | undefined;
17
+ order?: "asc" | "desc" | undefined;
18
+ first?: string | undefined;
19
+ last?: string | undefined;
20
+ };
21
+ };
22
+ }>) => Promise<Response & import("hono").TypedResponse<{
23
+ edges: {
24
+ id: number;
25
+ pluginId: string;
26
+ type: "warn" | "error" | "debug";
27
+ content: string;
28
+ createdAt: string;
29
+ ipAddress: string;
30
+ method: string;
31
+ path: string;
32
+ userAgent: string | null;
33
+ statusCode: number;
34
+ user: {
35
+ id: number;
36
+ name: string;
37
+ nameCode: string;
38
+ } | null;
39
+ }[];
40
+ pageInfo: {
41
+ count: number;
42
+ endCursor: null | number;
43
+ hasNextPage: boolean;
44
+ hasPreviousPage: boolean;
45
+ startCursor: null | number;
46
+ totalCount: number;
47
+ };
48
+ }, 200, "json">>;
49
+ pluginId: "@vitnode/core";
50
+ route: {
51
+ method: "get";
52
+ description: string;
53
+ path: "/logs";
54
+ request: {
55
+ query: z.ZodObject<{
56
+ cursor: z.ZodOptional<z.ZodString>;
57
+ first: z.ZodOptional<z.ZodString>;
58
+ last: z.ZodOptional<z.ZodString>;
59
+ } & {
60
+ order: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
61
+ orderBy: z.ZodOptional<z.ZodEnum<["type", "createdAt", "pluginId"]>>;
62
+ }, "strip", z.ZodTypeAny, {
63
+ orderBy?: "createdAt" | "type" | "pluginId" | undefined;
64
+ cursor?: string | undefined;
65
+ order?: "asc" | "desc" | undefined;
66
+ first?: string | undefined;
67
+ last?: string | undefined;
68
+ }, {
69
+ orderBy?: "createdAt" | "type" | "pluginId" | undefined;
70
+ cursor?: string | undefined;
71
+ order?: "asc" | "desc" | undefined;
72
+ first?: string | undefined;
73
+ last?: string | undefined;
74
+ }>;
75
+ };
76
+ responses: {
77
+ 200: {
78
+ content: {
79
+ 'application/json': {
80
+ schema: z.ZodObject<{
81
+ edges: z.ZodArray<z.ZodObject<{
82
+ id: z.ZodNumber;
83
+ pluginId: z.ZodString;
84
+ type: z.ZodEnum<["warn", "error", "debug"]>;
85
+ content: z.ZodString;
86
+ createdAt: z.ZodDate;
87
+ ipAddress: z.ZodString;
88
+ method: z.ZodString;
89
+ path: z.ZodString;
90
+ userAgent: z.ZodNullable<z.ZodString>;
91
+ statusCode: z.ZodNumber;
92
+ user: z.ZodNullable<z.ZodObject<{
93
+ id: z.ZodNumber;
94
+ name: z.ZodString;
95
+ nameCode: z.ZodString;
96
+ }, "strip", z.ZodTypeAny, {
97
+ id: number;
98
+ name: string;
99
+ nameCode: string;
100
+ }, {
101
+ id: number;
102
+ name: string;
103
+ nameCode: string;
104
+ }>>;
105
+ }, "strip", z.ZodTypeAny, {
106
+ ipAddress: string;
107
+ user: {
108
+ id: number;
109
+ name: string;
110
+ nameCode: string;
111
+ } | null;
112
+ id: number;
113
+ createdAt: Date;
114
+ userAgent: string | null;
115
+ type: "warn" | "error" | "debug";
116
+ path: string;
117
+ pluginId: string;
118
+ content: string;
119
+ method: string;
120
+ statusCode: number;
121
+ }, {
122
+ ipAddress: string;
123
+ user: {
124
+ id: number;
125
+ name: string;
126
+ nameCode: string;
127
+ } | null;
128
+ id: number;
129
+ createdAt: Date;
130
+ userAgent: string | null;
131
+ type: "warn" | "error" | "debug";
132
+ path: string;
133
+ pluginId: string;
134
+ content: string;
135
+ method: string;
136
+ statusCode: number;
137
+ }>, "many">;
138
+ pageInfo: z.ZodObject<{
139
+ totalCount: z.ZodNumber;
140
+ count: z.ZodNumber;
141
+ hasNextPage: z.ZodBoolean;
142
+ hasPreviousPage: z.ZodBoolean;
143
+ startCursor: z.ZodNullable<z.ZodNumber>;
144
+ endCursor: z.ZodNullable<z.ZodNumber>;
145
+ }, "strip", z.ZodTypeAny, {
146
+ count: number;
147
+ totalCount: number;
148
+ hasNextPage: boolean;
149
+ hasPreviousPage: boolean;
150
+ startCursor: number | null;
151
+ endCursor: number | null;
152
+ }, {
153
+ count: number;
154
+ totalCount: number;
155
+ hasNextPage: boolean;
156
+ hasPreviousPage: boolean;
157
+ startCursor: number | null;
158
+ endCursor: number | null;
159
+ }>;
160
+ }, "strip", z.ZodTypeAny, {
161
+ edges: {
162
+ ipAddress: string;
163
+ user: {
164
+ id: number;
165
+ name: string;
166
+ nameCode: string;
167
+ } | null;
168
+ id: number;
169
+ createdAt: Date;
170
+ userAgent: string | null;
171
+ type: "warn" | "error" | "debug";
172
+ path: string;
173
+ pluginId: string;
174
+ content: string;
175
+ method: string;
176
+ statusCode: number;
177
+ }[];
178
+ pageInfo: {
179
+ count: number;
180
+ totalCount: number;
181
+ hasNextPage: boolean;
182
+ hasPreviousPage: boolean;
183
+ startCursor: number | null;
184
+ endCursor: number | null;
185
+ };
186
+ }, {
187
+ edges: {
188
+ ipAddress: string;
189
+ user: {
190
+ id: number;
191
+ name: string;
192
+ nameCode: string;
193
+ } | null;
194
+ id: number;
195
+ createdAt: Date;
196
+ userAgent: string | null;
197
+ type: "warn" | "error" | "debug";
198
+ path: string;
199
+ pluginId: string;
200
+ content: string;
201
+ method: string;
202
+ statusCode: number;
203
+ }[];
204
+ pageInfo: {
205
+ count: number;
206
+ totalCount: number;
207
+ hasNextPage: boolean;
208
+ hasPreviousPage: boolean;
209
+ startCursor: number | null;
210
+ endCursor: number | null;
211
+ };
212
+ }>;
213
+ };
214
+ };
215
+ description: string;
216
+ };
217
+ };
218
+ } & {
219
+ getRoutingPath: () => "/logs";
220
+ };
221
+ };
222
+ //# sourceMappingURL=logs.route.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logs.route.d.ts","sourceRoot":"","sources":["../../../../../../../src/api/modules/admin/debug/routes/logs.route.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwF9B,CAAC"}
@@ -0,0 +1,90 @@
1
+ import { eq } from "drizzle-orm";
2
+ import { z } from "zod";
3
+ import { CONFIG_PLUGIN } from "../../../../../config.js";
4
+ import { core_logs, coreLogsType } from "../../../../../database/logs.js";
5
+ import { core_users } from "../../../../../database/users.js";
6
+ import { buildRoute } from "../../../../lib/route.js";
7
+ import { withPagination, zodPaginationPageInfo, zodPaginationQuery } from "../../../../lib/with-pagination.js";
8
+ export const logsDebugAdminRoute = buildRoute({
9
+ ...CONFIG_PLUGIN,
10
+ route: {
11
+ method: 'get',
12
+ description: 'Get Admin Debug Logs',
13
+ path: '/logs',
14
+ request: {
15
+ query: zodPaginationQuery.extend({
16
+ order: z.enum([
17
+ 'asc',
18
+ 'desc'
19
+ ]).optional(),
20
+ orderBy: z.enum([
21
+ 'type',
22
+ 'createdAt',
23
+ 'pluginId'
24
+ ]).optional()
25
+ })
26
+ },
27
+ responses: {
28
+ 200: {
29
+ content: {
30
+ 'application/json': {
31
+ schema: z.object({
32
+ edges: z.array(z.object({
33
+ id: z.number(),
34
+ pluginId: z.string(),
35
+ type: z.enum(coreLogsType.enumValues),
36
+ content: z.string(),
37
+ createdAt: z.date(),
38
+ ipAddress: z.string(),
39
+ method: z.string(),
40
+ path: z.string(),
41
+ userAgent: z.string().nullable(),
42
+ statusCode: z.number(),
43
+ user: z.object({
44
+ id: z.number(),
45
+ name: z.string(),
46
+ nameCode: z.string()
47
+ }).nullable()
48
+ })),
49
+ pageInfo: zodPaginationPageInfo
50
+ })
51
+ }
52
+ },
53
+ description: 'List of users'
54
+ }
55
+ }
56
+ },
57
+ handler: async (c)=>{
58
+ const query = c.req.valid('query');
59
+ const data = await withPagination({
60
+ params: {
61
+ query
62
+ },
63
+ primaryCursor: core_logs.id,
64
+ query: async ({ limit, where, orderBy })=>await c.get('db').select({
65
+ id: core_logs.id,
66
+ pluginId: core_logs.pluginId,
67
+ type: core_logs.type,
68
+ content: core_logs.content,
69
+ createdAt: core_logs.createdAt,
70
+ ipAddress: core_logs.ipAddress,
71
+ method: core_logs.method,
72
+ path: core_logs.path,
73
+ userAgent: core_logs.userAgent,
74
+ statusCode: core_logs.statusCode,
75
+ user: {
76
+ id: core_users.id,
77
+ name: core_users.name,
78
+ nameCode: core_users.nameCode
79
+ }
80
+ }).from(core_logs).leftJoin(core_users, eq(core_users.id, core_logs.userId)).where(where).orderBy(orderBy).limit(limit),
81
+ table: core_logs,
82
+ orderBy: {
83
+ column: query.orderBy ? core_logs[query.orderBy] : core_logs.createdAt,
84
+ order: query.order ?? 'desc'
85
+ },
86
+ c
87
+ });
88
+ return c.json(data);
89
+ }
90
+ });
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  export declare const sessionAdminRoute: {
3
- handler: (c: import("hono").Context<import("../../../middlewares/global/global").EnvVitNode, "/session", {}>) => Response & import("hono").TypedResponse<{
3
+ handler: (c: import("hono").Context<import("../../../middlewares/global.middleware").EnvVitNode, "/session", {}>) => Response & import("hono").TypedResponse<{
4
4
  user: {
5
5
  avatarColor: string;
6
6
  birthday: string | null;
@@ -19,10 +19,6 @@ export declare const sessionAdminRoute: {
19
19
  route: {
20
20
  method: "get";
21
21
  description: string;
22
- pluginConfig: {
23
- id: string;
24
- name: string;
25
- };
26
22
  path: "/session";
27
23
  responses: {
28
24
  200: {
@@ -1 +1 @@
1
- {"version":3,"file":"session.route.d.ts","sourceRoot":"","sources":["../../../../../../src/api/modules/admin/routes/session.route.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+C5B,CAAC"}
1
+ {"version":3,"file":"session.route.d.ts","sourceRoot":"","sources":["../../../../../../src/api/modules/admin/routes/session.route.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2C5B,CAAC"}
@@ -7,10 +7,6 @@ export const sessionAdminRoute = buildRoute({
7
7
  route: {
8
8
  method: 'get',
9
9
  description: 'Verify admin session',
10
- pluginConfig: {
11
- id: 'core',
12
- name: 'Core'
13
- },
14
10
  path: '/session',
15
11
  responses: {
16
12
  200: {
@@ -1,6 +1,6 @@
1
1
  import { z } from '@hono/zod-openapi';
2
2
  export declare const listUsersAdminRoute: {
3
- handler: (c: import("hono").Context<import("../../../../middlewares/global/global").EnvVitNode, "/list", {
3
+ handler: (c: import("hono").Context<import("../../../../middlewares/global.middleware").EnvVitNode, "/list", {
4
4
  in: {
5
5
  query: {
6
6
  orderBy?: "name" | "createdAt" | undefined;
@@ -1,6 +1,6 @@
1
1
  import { z } from '@hono/zod-openapi';
2
2
  export declare const usersAdminRoute: {
3
- handler: (c: import("hono").Context<import("../../../../middlewares/global/global").EnvVitNode, "/list", {
3
+ handler: (c: import("hono").Context<import("../../../../middlewares/global.middleware").EnvVitNode, "/list", {
4
4
  in: {
5
5
  query: {
6
6
  orderBy?: "id" | "name" | "createdAt" | "email" | undefined;
@@ -1,5 +1,5 @@
1
1
  export declare const usersAdminModule: import("../../../../api/lib/module").BuildModuleReturn<"@vitnode/core", "users", [{
2
- handler: (c: import("hono").Context<import("../../../middlewares/global/global").EnvVitNode, "/list", {
2
+ handler: (c: import("hono").Context<import("../../../middlewares/global.middleware").EnvVitNode, "/list", {
3
3
  in: {
4
4
  query: {
5
5
  orderBy?: "name" | "createdAt" | undefined;
@@ -1,5 +1,5 @@
1
1
  export declare const middlewareModule: import("../../../api/lib/module").BuildModuleReturn<"@vitnode/core", "middleware", [{
2
- handler: (c: import("hono").Context<import("../../middlewares/global/global").EnvVitNode, "/", {}>) => Response & import("hono").TypedResponse<{
2
+ handler: (c: import("hono").Context<import("../../middlewares/global.middleware").EnvVitNode, "/", {}>) => Response & import("hono").TypedResponse<{
3
3
  isEmail: boolean;
4
4
  sso: {
5
5
  id: string;
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  export declare const routeMiddleware: {
3
- handler: (c: import("hono").Context<import("../../middlewares/global/global").EnvVitNode, "/", {}>) => Response & import("hono").TypedResponse<{
3
+ handler: (c: import("hono").Context<import("../../middlewares/global.middleware").EnvVitNode, "/", {}>) => Response & import("hono").TypedResponse<{
4
4
  isEmail: boolean;
5
5
  sso: {
6
6
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../src/api/modules/middleware/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6B1B,CAAC"}
1
+ {"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../src/api/modules/middleware/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4B1B,CAAC"}
@@ -1,6 +1,5 @@
1
1
  import { z } from "zod";
2
2
  import { buildRoute } from "../../lib/route.js";
3
- import { EmailModel } from "../../models/email.js";
4
3
  import { CONFIG_PLUGIN } from "../../../config.js";
5
4
  export const routeMiddleware = buildRoute({
6
5
  ...CONFIG_PLUGIN,
@@ -26,10 +25,9 @@ export const routeMiddleware = buildRoute({
26
25
  }
27
26
  },
28
27
  handler: (c)=>{
29
- const sso = c.get('core').authorization.ssoPlugins;
30
- const email = new EmailModel(c);
28
+ const sso = c.get('core').authorization.ssoProviders;
31
29
  return c.json({
32
- isEmail: email.isAvailable(),
30
+ isEmail: !!c.get('core').emailAdapter,
33
31
  sso: sso.map((s)=>({
34
32
  id: s.id,
35
33
  name: s.name
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  export declare const sessionRoute: {
3
- handler: (c: import("hono").Context<import("../../../middlewares/global/global").EnvVitNode, "/session", {}>) => Promise<Response & import("hono").TypedResponse<{
3
+ handler: (c: import("hono").Context<import("../../../middlewares/global.middleware").EnvVitNode, "/session", {}>) => Promise<Response & import("hono").TypedResponse<{
4
4
  user: {
5
5
  isAdmin: boolean;
6
6
  avatarColor: string;
@@ -13,7 +13,7 @@ export declare const zodSignInSchema: z.ZodObject<{
13
13
  isAdmin?: boolean | undefined;
14
14
  }>;
15
15
  export declare const signInRoute: {
16
- handler: (c: import("hono").Context<import("../../../middlewares/global/global").EnvVitNode, "/sign_in", {
16
+ handler: (c: import("hono").Context<import("../../../middlewares/global.middleware").EnvVitNode, "/sign_in", {
17
17
  in: {
18
18
  json: {
19
19
  email: string;
@@ -1,6 +1,6 @@
1
1
  import { z } from '@hono/zod-openapi';
2
2
  export declare const signOutRoute: {
3
- handler: (c: import("hono").Context<import("../../../middlewares/global/global").EnvVitNode, "/sign_out", {
3
+ handler: (c: import("hono").Context<import("../../../middlewares/global.middleware").EnvVitNode, "/sign_out", {
4
4
  in: {
5
5
  json: {
6
6
  isAdmin?: boolean | undefined;
@@ -16,7 +16,7 @@ export declare const zodSignUpSchema: z.ZodObject<{
16
16
  newsletter?: boolean | undefined;
17
17
  }>;
18
18
  export declare const signUpRoute: {
19
- handler: (c: import("hono").Context<import("../../../middlewares/global/global").EnvVitNode, "/sign_up", {
19
+ handler: (c: import("hono").Context<import("../../../middlewares/global.middleware").EnvVitNode, "/sign_up", {
20
20
  in: {
21
21
  json: {
22
22
  name: string;
@@ -1,9 +1,9 @@
1
1
  import { z } from 'zod';
2
2
  export declare const testRoute: {
3
- handler: (c: import("hono").Context<import("../../../middlewares/global/global").EnvVitNode, "/test", {}>) => Response & import("hono").TypedResponse<"test", 200 | 201, "text">;
3
+ handler: (c: import("hono").Context<import("../../../middlewares/global.middleware").EnvVitNode, "/test", {}>) => Response & import("hono").TypedResponse<"test", 200 | 201, "text">;
4
4
  pluginId: "@vitnode/core";
5
5
  route: {
6
- method: "get";
6
+ method: "post";
7
7
  description: string;
8
8
  path: "/test";
9
9
  responses: {
@@ -1 +1 @@
1
- {"version":3,"file":"test.route.d.ts","sourceRoot":"","sources":["../../../../../../src/api/modules/users/routes/test.route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BpB,CAAC"}
1
+ {"version":3,"file":"test.route.d.ts","sourceRoot":"","sources":["../../../../../../src/api/modules/users/routes/test.route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCpB,CAAC"}
@@ -1,10 +1,11 @@
1
1
  import { z } from "zod";
2
2
  import { buildRoute } from "../../../lib/route.js";
3
3
  import { CONFIG_PLUGIN } from "../../../../config.js";
4
+ // import { EmailModel } from '../../../models/email';
4
5
  export const testRoute = buildRoute({
5
6
  ...CONFIG_PLUGIN,
6
7
  route: {
7
- method: 'get',
8
+ method: 'post',
8
9
  description: 'Test route',
9
10
  path: '/test',
10
11
  responses: {
@@ -27,6 +28,13 @@ export const testRoute = buildRoute({
27
28
  }
28
29
  },
29
30
  handler: (c)=>{
31
+ // new EmailModel(c).send({
32
+ // html: '<p>Test email</p>',
33
+ // to: 'ithereplay@gmail.com',
34
+ // subject: 'Test Email',
35
+ // });
36
+ // throw new Error('Test error');
37
+ c.get('log').warn('This is a test warn log');
30
38
  return c.text('test');
31
39
  }
32
40
  });
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  export declare const callbackRoute: {
3
- handler: (c: import("hono").Context<import("../../../../middlewares/global/global").EnvVitNode, "/:providerId/callback", {
3
+ handler: (c: import("hono").Context<import("../../../../middlewares/global.middleware").EnvVitNode, "/:providerId/callback", {
4
4
  in: {
5
5
  param: {
6
6
  providerId: string;
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  export declare const createUrlRoute: {
3
- handler: (c: import("hono").Context<import("../../../../middlewares/global/global").EnvVitNode, "/:providerId", {
3
+ handler: (c: import("hono").Context<import("../../../../middlewares/global.middleware").EnvVitNode, "/:providerId", {
4
4
  in: {
5
5
  param: {
6
6
  providerId: string;
@@ -1,5 +1,5 @@
1
1
  export declare const ssoUserModule: import("../../../../api/lib/module").BuildModuleReturn<"@vitnode/core", "sso", [{
2
- handler: (c: import("hono").Context<import("../../../middlewares/global/global").EnvVitNode, "/:providerId/callback", {
2
+ handler: (c: import("hono").Context<import("../../../middlewares/global.middleware").EnvVitNode, "/:providerId/callback", {
3
3
  in: {
4
4
  param: {
5
5
  providerId: string;
@@ -74,7 +74,7 @@ export declare const ssoUserModule: import("../../../../api/lib/module").BuildMo
74
74
  getRoutingPath: () => "/:providerId/callback";
75
75
  };
76
76
  }, {
77
- handler: (c: import("hono").Context<import("../../../middlewares/global/global").EnvVitNode, "/:providerId", {
77
+ handler: (c: import("hono").Context<import("../../../middlewares/global.middleware").EnvVitNode, "/:providerId", {
78
78
  in: {
79
79
  param: {
80
80
  providerId: string;
@@ -1,5 +1,5 @@
1
1
  export declare const usersModule: import("../../../api/lib/module").BuildModuleReturn<"@vitnode/core", "users", [{
2
- handler: (c: import("hono").Context<import("../../middlewares/global/global").EnvVitNode, "/session", {}>) => Promise<Response & import("hono").TypedResponse<{
2
+ handler: (c: import("hono").Context<import("../../middlewares/global.middleware").EnvVitNode, "/session", {}>) => Promise<Response & import("hono").TypedResponse<{
3
3
  user: {
4
4
  isAdmin: boolean;
5
5
  avatarColor: string;
@@ -99,7 +99,7 @@ export declare const usersModule: import("../../../api/lib/module").BuildModuleR
99
99
  getRoutingPath: () => "/session";
100
100
  };
101
101
  }, {
102
- handler: (c: import("hono").Context<import("../../middlewares/global/global").EnvVitNode, "/sign_in", {
102
+ handler: (c: import("hono").Context<import("../../middlewares/global.middleware").EnvVitNode, "/sign_in", {
103
103
  in: {
104
104
  json: {
105
105
  email: string;
@@ -171,7 +171,7 @@ export declare const usersModule: import("../../../api/lib/module").BuildModuleR
171
171
  getRoutingPath: () => "/sign_in";
172
172
  };
173
173
  }, {
174
- handler: (c: import("hono").Context<import("../../middlewares/global/global").EnvVitNode, "/sign_out", {
174
+ handler: (c: import("hono").Context<import("../../middlewares/global.middleware").EnvVitNode, "/sign_out", {
175
175
  in: {
176
176
  json: {
177
177
  isAdmin?: boolean | undefined;
@@ -215,7 +215,7 @@ export declare const usersModule: import("../../../api/lib/module").BuildModuleR
215
215
  getRoutingPath: () => "/sign_out";
216
216
  };
217
217
  }, {
218
- handler: (c: import("hono").Context<import("../../middlewares/global/global").EnvVitNode, "/sign_up", {
218
+ handler: (c: import("hono").Context<import("../../middlewares/global.middleware").EnvVitNode, "/sign_up", {
219
219
  in: {
220
220
  json: {
221
221
  name: string;
@@ -293,10 +293,10 @@ export declare const usersModule: import("../../../api/lib/module").BuildModuleR
293
293
  getRoutingPath: () => "/sign_up";
294
294
  };
295
295
  }, {
296
- handler: (c: import("hono").Context<import("../../middlewares/global/global").EnvVitNode, "/test", {}>) => Response & import("hono").TypedResponse<"test", 200 | 201, "text">;
296
+ handler: (c: import("hono").Context<import("../../middlewares/global.middleware").EnvVitNode, "/test", {}>) => Response & import("hono").TypedResponse<"test", 200 | 201, "text">;
297
297
  pluginId: "@vitnode/core";
298
298
  route: {
299
- method: "get";
299
+ method: "post";
300
300
  description: string;
301
301
  path: "/test";
302
302
  responses: {
@@ -321,7 +321,7 @@ export declare const usersModule: import("../../../api/lib/module").BuildModuleR
321
321
  getRoutingPath: () => "/test";
322
322
  };
323
323
  }], import("../../../api/lib/module").BuildModuleReturn<"@vitnode/core", "sso", [{
324
- handler: (c: import("hono").Context<import("../../middlewares/global/global").EnvVitNode, "/:providerId/callback", {
324
+ handler: (c: import("hono").Context<import("../../middlewares/global.middleware").EnvVitNode, "/:providerId/callback", {
325
325
  in: {
326
326
  param: {
327
327
  providerId: string;
@@ -396,7 +396,7 @@ export declare const usersModule: import("../../../api/lib/module").BuildModuleR
396
396
  getRoutingPath: () => "/:providerId/callback";
397
397
  };
398
398
  }, {
399
- handler: (c: import("hono").Context<import("../../middlewares/global/global").EnvVitNode, "/:providerId", {
399
+ handler: (c: import("hono").Context<import("../../middlewares/global.middleware").EnvVitNode, "/:providerId", {
400
400
  in: {
401
401
  param: {
402
402
  providerId: string;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ declare const SystemLogsView: React.LazyExoticComponent<({ searchParams, }: {
3
+ searchParams: Promise<Record<string, string | string[] | undefined>>;
4
+ }) => Promise<import("react/jsx-runtime").JSX.Element>>;
5
+ export declare const generateMetadata: () => Promise<{
6
+ title: string;
7
+ description: string;
8
+ }>;
9
+ export default function Page(props: React.ComponentProps<typeof SystemLogsView>): Promise<import("react/jsx-runtime").JSX.Element>;
10
+ export {};
11
+ //# sourceMappingURL=page.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../../../src/app_admin/core/debug/page.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,QAAA,MAAM,cAAc;;uDAMnB,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;EAO5B,CAAC;AAEF,wBAA8B,IAAI,CAChC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,oDAkBnD"}