@vitnode/core 1.2.0-canary.23 → 1.2.0-canary.24

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 (165) 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 +30 -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 +161 -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 +159 -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 +160 -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 +70 -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 +1 -1
  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 +8 -0
  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 +7 -7
  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/database/logs.d.ts +116 -0
  103. package/dist/src/database/logs.d.ts.map +1 -0
  104. package/dist/src/database/logs.js +18 -0
  105. package/dist/src/database/sessions.d.ts +19 -0
  106. package/dist/src/database/sessions.d.ts.map +1 -1
  107. package/dist/src/database/sessions.js +3 -0
  108. package/dist/src/lib/fetcher/core.d.ts +2 -1
  109. package/dist/src/lib/fetcher/core.d.ts.map +1 -1
  110. package/dist/src/lib/fetcher/core.js +2 -2
  111. package/dist/src/lib/fetcher-client.d.ts +2 -1
  112. package/dist/src/lib/fetcher-client.d.ts.map +1 -1
  113. package/dist/src/lib/fetcher-client.js +3 -2
  114. package/dist/src/lib/fetcher.d.ts +2 -1
  115. package/dist/src/lib/fetcher.d.ts.map +1 -1
  116. package/dist/src/lib/fetcher.js +2 -1
  117. package/dist/src/views/admin/layouts/admin-layout.d.ts.map +1 -1
  118. package/dist/src/views/admin/layouts/admin-layout.js +5 -1
  119. package/dist/src/views/admin/layouts/user-bar/client.d.ts.map +1 -1
  120. package/dist/src/views/admin/layouts/user-bar/client.js +26 -18
  121. package/dist/src/views/admin/views/core/debug/actions/clear-cache/clear-cache.d.ts +2 -0
  122. package/dist/src/views/admin/views/core/debug/actions/clear-cache/clear-cache.d.ts.map +1 -0
  123. package/dist/src/views/admin/views/core/debug/actions/clear-cache/clear-cache.js +35 -0
  124. package/dist/src/views/admin/views/core/debug/actions/clear-cache/mutation-api.d.ts +2 -0
  125. package/dist/src/views/admin/views/core/debug/actions/clear-cache/mutation-api.d.ts.map +1 -0
  126. package/dist/src/views/admin/views/core/debug/actions/clear-cache/mutation-api.js +5 -0
  127. package/dist/src/views/admin/views/core/debug/debug-admin-view.d.ts +4 -0
  128. package/dist/src/views/admin/views/core/debug/debug-admin-view.d.ts.map +1 -0
  129. package/dist/src/views/admin/views/core/debug/debug-admin-view.js +110 -0
  130. package/dist/src/views/auth/sso/buttons/sso-buttons.d.ts +1 -1
  131. package/dist/src/views/auth/sso/buttons/sso-buttons.d.ts.map +1 -1
  132. package/dist/src/views/auth/sso/buttons/sso-buttons.js +5 -2
  133. package/dist/src/views/layouts/theme/header/header.d.ts +4 -1
  134. package/dist/src/views/layouts/theme/header/header.d.ts.map +1 -1
  135. package/dist/src/views/layouts/theme/header/header.js +8 -4
  136. package/dist/src/views/layouts/theme/layout.d.ts +3 -1
  137. package/dist/src/views/layouts/theme/layout.d.ts.map +1 -1
  138. package/dist/src/views/layouts/theme/layout.js +4 -3
  139. package/dist/src/vitnode.config.d.ts +11 -5
  140. package/dist/src/vitnode.config.d.ts.map +1 -1
  141. package/dist/src/vitnode.config.js +2 -1
  142. package/dist/tsconfig.tsbuildinfo +1 -1
  143. package/package.json +39 -22
  144. package/src/app_admin/core/debug/page.tsx +43 -0
  145. package/src/app_admin/core/users/page.tsx +6 -1
  146. package/src/locales/en.json +35 -1
  147. package/src/vitnode.config.ts +16 -6
  148. package/dist/src/api/lib/get-user-ip.d.ts +0 -3
  149. package/dist/src/api/lib/get-user-ip.d.ts.map +0 -1
  150. package/dist/src/api/lib/get-user-ip.js +0 -8
  151. package/dist/src/api/middlewares/global/global.d.ts.map +0 -1
  152. package/dist/src/api/middlewares/global/global.js +0 -47
  153. package/dist/src/api/plugins/email/nodemailer.d.ts.map +0 -1
  154. package/dist/src/api/plugins/email/resend.d.ts.map +0 -1
  155. package/dist/src/api/plugins/sso/discord.d.ts.map +0 -1
  156. package/dist/src/api/plugins/sso/facebook.d.ts.map +0 -1
  157. package/dist/src/api/plugins/sso/google.d.ts.map +0 -1
  158. package/dist/src/components/switchers/theme-switcher.d.ts.map +0 -1
  159. /package/dist/src/api/{plugins → adapters}/sso/discord.d.ts +0 -0
  160. /package/dist/src/api/{plugins → adapters}/sso/discord.js +0 -0
  161. /package/dist/src/api/{plugins → adapters}/sso/facebook.d.ts +0 -0
  162. /package/dist/src/api/{plugins → adapters}/sso/facebook.js +0 -0
  163. /package/dist/src/api/{plugins → adapters}/sso/google.d.ts +0 -0
  164. /package/dist/src/api/{plugins → adapters}/sso/google.js +0 -0
  165. /package/dist/src/components/switchers/{theme-switcher.d.ts → themes/theme-switcher.d.ts} +0 -0
@@ -0,0 +1,70 @@
1
+ import { z } from "zod";
2
+ import { CONFIG_PLUGIN } from "../../../../../config.js";
3
+ import { core_logs, coreLogsType } from "../../../../../database/logs.js";
4
+ import { buildRoute } from "../../../../lib/route.js";
5
+ import { withPagination, zodPaginationPageInfo, zodPaginationQuery } from "../../../../lib/with-pagination.js";
6
+ export const logsDebugAdminRoute = buildRoute({
7
+ ...CONFIG_PLUGIN,
8
+ route: {
9
+ method: 'get',
10
+ description: 'Get Admin Debug Logs',
11
+ path: '/logs',
12
+ request: {
13
+ query: zodPaginationQuery.extend({
14
+ order: z.enum([
15
+ 'asc',
16
+ 'desc'
17
+ ]).optional(),
18
+ orderBy: z.enum([
19
+ 'type',
20
+ 'createdAt',
21
+ 'pluginId'
22
+ ]).optional()
23
+ })
24
+ },
25
+ responses: {
26
+ 200: {
27
+ content: {
28
+ 'application/json': {
29
+ schema: z.object({
30
+ edges: z.array(z.object({
31
+ id: z.number(),
32
+ pluginId: z.string(),
33
+ type: z.enum(coreLogsType.enumValues),
34
+ content: z.string(),
35
+ createdAt: z.date(),
36
+ ipAddress: z.string()
37
+ })),
38
+ pageInfo: zodPaginationPageInfo
39
+ })
40
+ }
41
+ },
42
+ description: 'List of users'
43
+ }
44
+ }
45
+ },
46
+ handler: async (c)=>{
47
+ const query = c.req.valid('query');
48
+ const data = await withPagination({
49
+ params: {
50
+ query
51
+ },
52
+ primaryCursor: core_logs.id,
53
+ query: async ({ limit, where, orderBy })=>await c.get('db').select({
54
+ id: core_logs.id,
55
+ pluginId: core_logs.pluginId,
56
+ type: core_logs.type,
57
+ content: core_logs.content,
58
+ createdAt: core_logs.createdAt,
59
+ ipAddress: core_logs.ipAddress
60
+ }).from(core_logs).where(where).orderBy(orderBy).limit(limit),
61
+ table: core_logs,
62
+ orderBy: {
63
+ column: query.orderBy ? core_logs[query.orderBy] : core_logs.createdAt,
64
+ order: query.order ?? 'desc'
65
+ },
66
+ c
67
+ });
68
+ return c.json(data);
69
+ }
70
+ });
@@ -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,6 +1,6 @@
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
6
  method: "get";
@@ -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,6 +1,7 @@
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: {
@@ -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,7 +293,7 @@ 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
299
  method: "get";
@@ -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 DebugAdminView: 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 DebugAdminView>): 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;;uDAInB,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;EAO5B,CAAC;AAEF,wBAA8B,IAAI,CAChC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,oDAkBnD"}
@@ -0,0 +1,44 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { getTranslations } from "next-intl/server";
3
+ import React from "react";
4
+ import { I18nProvider } from "../../../components/i18n-provider.js";
5
+ import { DataTableSkeleton } from "../../../components/table/data-table.js";
6
+ import { HeaderContent } from "../../../components/ui/header-content.js";
7
+ import { ClearCacheAction } from "../../../views/admin/views/core/debug/actions/clear-cache/clear-cache.js";
8
+ const DebugAdminView = /*#__PURE__*/ React.lazy(async ()=>import("../../../views/admin/views/core/debug/debug-admin-view.js").then((module)=>({
9
+ default: module.DebugAdminView
10
+ })));
11
+ export const generateMetadata = async ()=>{
12
+ const t = await getTranslations('admin.debug');
13
+ return {
14
+ title: t('title'),
15
+ description: t('desc')
16
+ };
17
+ };
18
+ export default async function Page(props) {
19
+ const t = await getTranslations('admin.debug');
20
+ return /*#__PURE__*/ _jsx(I18nProvider, {
21
+ namespaces: "admin.debug",
22
+ children: /*#__PURE__*/ _jsxs("div", {
23
+ className: "p-4",
24
+ children: [
25
+ /*#__PURE__*/ _jsx(HeaderContent, {
26
+ desc: t('desc'),
27
+ h1: t('title'),
28
+ children: /*#__PURE__*/ _jsx(ClearCacheAction, {})
29
+ }),
30
+ /*#__PURE__*/ _jsx(HeaderContent, {
31
+ h2: t('logs.title')
32
+ }),
33
+ /*#__PURE__*/ _jsx(React.Suspense, {
34
+ fallback: /*#__PURE__*/ _jsx(DataTableSkeleton, {
35
+ columns: 4
36
+ }),
37
+ children: /*#__PURE__*/ _jsx(DebugAdminView, {
38
+ ...props
39
+ })
40
+ })
41
+ ]
42
+ })
43
+ });
44
+ }
@@ -1,6 +1,9 @@
1
1
  import type { Metadata } from 'next/dist/types';
2
2
  import React from 'react';
3
- import { UsersAdminView } from '../../../views/admin/views/core/users/users-admin-view';
3
+ declare const UsersAdminView: React.LazyExoticComponent<({ searchParams, }: {
4
+ searchParams: Promise<Record<string, string | string[] | undefined>>;
5
+ }) => Promise<import("react/jsx-runtime").JSX.Element>>;
4
6
  export declare const generateMetadata: () => Promise<Metadata>;
5
7
  export default function Page(props: React.ComponentProps<typeof UsersAdminView>): Promise<import("react/jsx-runtime").JSX.Element>;
8
+ export {};
6
9
  //# sourceMappingURL=page.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../../../src/app_admin/core/users/page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGhD,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AAEjF,eAAO,MAAM,gBAAgB,QAAa,OAAO,CAAC,QAAQ,CAMzD,CAAC;AAEF,wBAA8B,IAAI,CAChC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,oDAgBnD"}
1
+ {"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../../../src/app_admin/core/users/page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGhD,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,QAAA,MAAM,cAAc;;uDAInB,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAAa,OAAO,CAAC,QAAQ,CAMzD,CAAC;AAEF,wBAA8B,IAAI,CAChC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,oDAgBnD"}
@@ -3,7 +3,9 @@ import { getTranslations } from "next-intl/server";
3
3
  import React from "react";
4
4
  import { DataTableSkeleton } from "../../../components/table/data-table.js";
5
5
  import { HeaderContent } from "../../../components/ui/header-content.js";
6
- import { UsersAdminView } from "../../../views/admin/views/core/users/users-admin-view.js";
6
+ const UsersAdminView = /*#__PURE__*/ React.lazy(async ()=>import("../../../views/admin/views/core/users/users-admin-view.js").then((module)=>({
7
+ default: module.UsersAdminView
8
+ })));
7
9
  export const generateMetadata = async ()=>{
8
10
  const t = await getTranslations('admin.global.nav.users');
9
11
  return {
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { AlertDialog } from '../ui/alert-dialog';
3
+ declare const ContentConfirmAction: React.LazyExoticComponent<({ onSubmit, textSubmit, }: {
4
+ onSubmit: (props: {
5
+ onClose: () => void;
6
+ }) => Promise<void> | void;
7
+ textSubmit?: string;
8
+ }) => import("react/jsx-runtime").JSX.Element>;
9
+ export declare const ConfirmActionAlertDialog: ({ children, title, description, textSubmit, onSubmit, ...props }: Omit<React.ComponentProps<typeof AlertDialog>, "children"> & React.ComponentProps<typeof ContentConfirmAction> & {
10
+ children: React.ReactNode;
11
+ description?: React.ReactNode;
12
+ title?: React.ReactNode;
13
+ }) => import("react/jsx-runtime").JSX.Element;
14
+ export {};
15
+ //# sourceMappingURL=confirm-action-alert-dialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"confirm-action-alert-dialog.d.ts","sourceRoot":"","sources":["../../../../src/components/confirm-action/confirm-action-alert-dialog.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,WAAW,EAOZ,MAAM,oBAAoB,CAAC;AAE5B,QAAA,MAAM,oBAAoB;;;;cACG,CAAC;8CAG7B,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,kEAOtC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,WAAW,CAAC,EAAE,UAAU,CAAC,GAC3D,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,GAAG;IAClD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACzB,4CAqBF,CAAC"}
@@ -0,0 +1,41 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useTranslations } from "next-intl";
4
+ import React from "react";
5
+ import { AlertDialog, AlertDialogContent, AlertDialogDescription, AlertDialogFooterSkeleton, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from "../ui/alert-dialog.js";
6
+ const ContentConfirmAction = /*#__PURE__*/ React.lazy(async ()=>import("./content.js").then((module)=>({
7
+ default: module.ContentConfirmAction
8
+ })));
9
+ export const ConfirmActionAlertDialog = ({ children, title, description, textSubmit, onSubmit, ...props })=>{
10
+ const t = useTranslations('core.global.confirm_action');
11
+ return /*#__PURE__*/ _jsxs(AlertDialog, {
12
+ ...props,
13
+ children: [
14
+ /*#__PURE__*/ _jsx(AlertDialogTrigger, {
15
+ asChild: true,
16
+ children: children
17
+ }),
18
+ /*#__PURE__*/ _jsxs(AlertDialogContent, {
19
+ children: [
20
+ /*#__PURE__*/ _jsxs(AlertDialogHeader, {
21
+ children: [
22
+ /*#__PURE__*/ _jsx(AlertDialogTitle, {
23
+ children: title ?? t('title')
24
+ }),
25
+ /*#__PURE__*/ _jsx(AlertDialogDescription, {
26
+ children: description ?? t('desc')
27
+ })
28
+ ]
29
+ }),
30
+ /*#__PURE__*/ _jsx(React.Suspense, {
31
+ fallback: /*#__PURE__*/ _jsx(AlertDialogFooterSkeleton, {}),
32
+ children: /*#__PURE__*/ _jsx(ContentConfirmAction, {
33
+ onSubmit: onSubmit,
34
+ textSubmit: textSubmit
35
+ })
36
+ })
37
+ ]
38
+ })
39
+ ]
40
+ });
41
+ };
@@ -0,0 +1,7 @@
1
+ export declare const ContentConfirmAction: ({ onSubmit, textSubmit, }: {
2
+ onSubmit: (props: {
3
+ onClose: () => void;
4
+ }) => Promise<void> | void;
5
+ textSubmit?: string;
6
+ }) => import("react/jsx-runtime").JSX.Element;
7
+ //# sourceMappingURL=content.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../../src/components/confirm-action/content.tsx"],"names":[],"mappings":"AAUA,eAAO,MAAM,oBAAoB,GAAI,2BAGlC;IACD,QAAQ,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,IAAI,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACnE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,4CAmBA,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useTranslations } from "next-intl";
3
+ import React from "react";
4
+ import { AlertDialogCancel, AlertDialogFooter, useAlertDialog } from "../ui/alert-dialog.js";
5
+ import { Button } from "../ui/button.js";
6
+ export const ContentConfirmAction = ({ onSubmit, textSubmit })=>{
7
+ const t = useTranslations('core.global.confirm_action');
8
+ const { setOpen } = useAlertDialog();
9
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
10
+ const [_, formAction, isLoading] = React.useActionState(async ()=>{
11
+ await onSubmit({
12
+ onClose: ()=>setOpen?.(false)
13
+ });
14
+ }, null);
15
+ return /*#__PURE__*/ _jsx("form", {
16
+ action: formAction,
17
+ children: /*#__PURE__*/ _jsxs(AlertDialogFooter, {
18
+ children: [
19
+ /*#__PURE__*/ _jsx(AlertDialogCancel, {
20
+ children: t('cancel')
21
+ }),
22
+ /*#__PURE__*/ _jsx(Button, {
23
+ isLoading: isLoading,
24
+ type: "submit",
25
+ variant: "destructive",
26
+ children: textSubmit ?? t('confirm')
27
+ })
28
+ ]
29
+ })
30
+ });
31
+ };
@@ -1,5 +1,6 @@
1
- export declare const DateFormat: ({ date, updateInterval, }: {
1
+ export declare const DateFormat: ({ date, updateInterval, showFullDate, }: {
2
2
  date: Date | string;
3
+ showFullDate?: boolean;
3
4
  updateInterval?: number;
4
5
  }) => string | import("react/jsx-runtime").JSX.Element;
5
6
  //# sourceMappingURL=date-format.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"date-format.d.ts","sourceRoot":"","sources":["../../../src/components/date-format.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,UAAU,GAAI,2BAGxB;IACD,IAAI,EAAE,IAAI,GAAG,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,qDAmCA,CAAC"}
1
+ {"version":3,"file":"date-format.d.ts","sourceRoot":"","sources":["../../../src/components/date-format.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,UAAU,GAAI,yCAIxB;IACD,IAAI,EAAE,IAAI,GAAG,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,qDAuCA,CAAC"}
@@ -2,7 +2,7 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useFormatter, useNow } from "next-intl";
4
4
  import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./ui/tooltip.js";
5
- export const DateFormat = ({ date, updateInterval })=>{
5
+ export const DateFormat = ({ date, updateInterval, showFullDate })=>{
6
6
  const dateToFormat = typeof date === 'string' ? new Date(date) : date;
7
7
  const format = useFormatter();
8
8
  const now = useNow({
@@ -16,6 +16,9 @@ export const DateFormat = ({ date, updateInterval })=>{
16
16
  hour: 'numeric',
17
17
  minute: 'numeric'
18
18
  });
19
+ if (showFullDate) {
20
+ return fullDate;
21
+ }
19
22
  // When date is < 7 days
20
23
  if (now.getTime() - dateToFormat.getTime() < 604800000) {
21
24
  return /*#__PURE__*/ _jsx(TooltipProvider, {
@@ -0,0 +1,5 @@
1
+ import type { LocaleConfig } from '../../../vitnode.config';
2
+ export declare const LanguageSwitcher: ({ locales }: {
3
+ locales: LocaleConfig[];
4
+ }) => import("react/jsx-runtime").JSX.Element;
5
+ //# sourceMappingURL=language-swietcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"language-swietcher.d.ts","sourceRoot":"","sources":["../../../../../src/components/switchers/langs/language-swietcher.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAYrD,eAAO,MAAM,gBAAgB,GAAI,aAAa;IAAE,OAAO,EAAE,YAAY,EAAE,CAAA;CAAE,4CAuCxE,CAAC"}