@vitnode/core 1.2.0-canary.30 → 1.2.0-canary.32

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 (96) hide show
  1. package/config/next.config.ts +0 -18
  2. package/dist/scripts/get-config.d.ts +6 -2
  3. package/dist/scripts/get-config.d.ts.map +1 -1
  4. package/dist/scripts/prepare-database.d.ts +1 -0
  5. package/dist/scripts/prepare-database.d.ts.map +1 -1
  6. package/dist/scripts/run-interactive-shell-command.d.ts.map +1 -1
  7. package/dist/scripts/scripts.js +4 -2
  8. package/dist/scripts/shared/file-utils.d.ts.map +1 -1
  9. package/dist/src/api/config.js +3 -3
  10. package/dist/src/api/lib/logger-middleware.d.ts +3 -3
  11. package/dist/src/api/lib/logger-middleware.d.ts.map +1 -1
  12. package/dist/src/api/lib/logger-middleware.js +6 -6
  13. package/dist/src/api/middlewares/global.middleware.d.ts +15 -5
  14. package/dist/src/api/middlewares/global.middleware.d.ts.map +1 -1
  15. package/dist/src/api/middlewares/global.middleware.js +4 -2
  16. package/dist/src/api/middlewares/rate-limiter.middleware.d.ts +1 -1
  17. package/dist/src/api/middlewares/rate-limiter.middleware.d.ts.map +1 -1
  18. package/dist/src/api/middlewares/rate-limiter.middleware.js +8 -2
  19. package/dist/src/api/models/device.js +1 -1
  20. package/dist/src/api/models/email.d.ts +10 -6
  21. package/dist/src/api/models/email.d.ts.map +1 -1
  22. package/dist/src/api/models/email.js +27 -8
  23. package/dist/src/api/models/session-admin.js +3 -3
  24. package/dist/src/api/models/session.js +1 -1
  25. package/dist/src/api/models/sso.d.ts.map +1 -1
  26. package/dist/src/api/models/sso.js +2 -2
  27. package/dist/src/api/models/user/sign-up.d.ts +1 -1
  28. package/dist/src/api/models/user/sign-up.js +1 -1
  29. package/dist/src/api/models/user.d.ts +1 -1
  30. package/dist/src/api/models/user.d.ts.map +1 -1
  31. package/dist/src/api/modules/admin/admin.module.d.ts +32 -32
  32. package/dist/src/api/modules/admin/debug/debug.admin.module.d.ts +16 -16
  33. package/dist/src/api/modules/admin/debug/routes/logs.route.d.ts +16 -16
  34. package/dist/src/api/modules/admin/debug/routes/logs.route.js +6 -2
  35. package/dist/src/api/modules/admin/routes/session.route.d.ts +4 -4
  36. package/dist/src/api/modules/admin/users/routes/list.route.d.ts +12 -12
  37. package/dist/src/api/modules/admin/users/routes/users.route.d.ts +12 -12
  38. package/dist/src/api/modules/admin/users/users.admin.module.d.ts +12 -12
  39. package/dist/src/api/modules/middleware/route.js +1 -1
  40. package/dist/src/api/modules/users/routes/session.route.d.ts +4 -4
  41. package/dist/src/api/modules/users/routes/sign-up.route.d.ts +8 -8
  42. package/dist/src/api/modules/users/routes/test.route.d.ts +1 -1
  43. package/dist/src/api/modules/users/routes/test.route.d.ts.map +1 -1
  44. package/dist/src/api/modules/users/routes/test.route.js +7 -8
  45. package/dist/src/api/modules/users/users.module.d.ts +11 -11
  46. package/dist/src/app_admin/core/debug/page.d.ts +2 -2
  47. package/dist/src/app_admin/core/debug/page.d.ts.map +1 -1
  48. package/dist/src/app_admin/core/debug/page.js +2 -1
  49. package/dist/src/app_admin/core/users/page.d.ts +2 -2
  50. package/dist/src/app_admin/core/users/page.d.ts.map +1 -1
  51. package/dist/src/app_admin/core/users/page.js +2 -1
  52. package/dist/src/components/confirm-action/confirm-action-alert-dialog.d.ts +2 -2
  53. package/dist/src/components/confirm-action/confirm-action-alert-dialog.d.ts.map +1 -1
  54. package/dist/src/components/confirm-action/confirm-action-alert-dialog.js +2 -1
  55. package/dist/src/components/form/fields/combobox-async.js +1 -1
  56. package/dist/src/components/form/fields/combobox.js +1 -1
  57. package/dist/src/components/table/content.d.ts.map +1 -1
  58. package/dist/src/components/table/content.js +57 -60
  59. package/dist/src/components/table/data-table.d.ts.map +1 -1
  60. package/dist/src/components/table/data-table.js +26 -29
  61. package/dist/src/components/ui/button.d.ts +1 -1
  62. package/dist/src/components/ui/menubar.js +1 -1
  63. package/dist/src/components/ui/sidebar.d.ts +1 -1
  64. package/dist/src/components/ui/sidebar.d.ts.map +1 -1
  65. package/dist/src/components/ui/sidebar.js +1 -1
  66. package/dist/src/database/logs.d.ts +21 -4
  67. package/dist/src/database/logs.d.ts.map +1 -1
  68. package/dist/src/database/logs.js +11 -8
  69. package/dist/src/emails/default-template.d.ts +30 -0
  70. package/dist/src/emails/default-template.d.ts.map +1 -0
  71. package/dist/src/emails/default-template.js +106 -0
  72. package/dist/src/lib/api/get-session-admin-api.d.ts +1 -1
  73. package/dist/src/lib/api/get-session-api.d.ts +1 -1
  74. package/dist/src/lib/config.d.ts +2 -2
  75. package/dist/src/lib/config.d.ts.map +1 -1
  76. package/dist/src/lib/config.js +5 -8
  77. package/dist/src/lib/fetcher/core.d.ts.map +1 -1
  78. package/dist/src/lib/fetcher/core.js +5 -1
  79. package/dist/src/views/admin/layouts/admin-layout.d.ts.map +1 -1
  80. package/dist/src/views/admin/layouts/admin-layout.js +2 -2
  81. package/dist/src/views/admin/views/core/debug/system-logs/actions/more/more.d.ts +17 -1
  82. package/dist/src/views/admin/views/core/debug/system-logs/actions/more/more.d.ts.map +1 -1
  83. package/dist/src/views/admin/views/core/debug/system-logs/actions/more/more.js +2 -1
  84. package/dist/src/views/admin/views/core/debug/system-logs/system-logs-view.d.ts +2 -2
  85. package/dist/src/views/auth/sign-up/form/mutation-api.d.ts +1 -1
  86. package/dist/src/views/auth/sign-up/form/use-form.d.ts +4 -4
  87. package/dist/src/views/layouts/theme/header/header.d.ts.map +1 -1
  88. package/dist/src/views/layouts/theme/header/header.js +3 -3
  89. package/dist/src/vitnode.config.d.ts +3 -4
  90. package/dist/src/vitnode.config.d.ts.map +1 -1
  91. package/dist/tsconfig.tsbuildinfo +1 -1
  92. package/package.json +24 -24
  93. package/src/app_admin/core/debug/page.tsx +2 -1
  94. package/src/app_admin/core/users/page.tsx +2 -1
  95. package/dist/emails/my-email.d.ts +0 -2
  96. package/dist/emails/my-email.d.ts.map +0 -1
@@ -1,23 +1,42 @@
1
+ import { render } from "@react-email/components";
1
2
  import { HTTPException } from "hono/http-exception";
3
+ import DefaultTemplateEmail from "../../emails/default-template.js";
4
+ import { CONFIG } from "../../lib/config.js";
2
5
  export class EmailModel {
3
6
  constructor(c){
4
7
  this.c = c;
5
8
  }
6
9
  c;
7
- send(args) {
10
+ async send({ html, replyTo, subject, to, content }) {
8
11
  const core = this.c.get('core');
9
- const provider = core.emailAdapter;
12
+ const provider = core.email?.adapter;
10
13
  if (!provider) {
11
14
  throw new HTTPException(500, {
12
15
  message: 'Email provider not found'
13
16
  });
14
17
  }
15
- void provider.sendEmail({
16
- ...args,
17
- metadata: core.metadata
18
- }).catch((err)=>{
19
- const error = err instanceof Error ? err : new Error('Unknown error from email provider');
20
- this.c.get('log').error(`Failed to send email: ${error.message}`);
18
+ const htmlContent = html ?? DefaultTemplateEmail({
19
+ children: content,
20
+ metadata: {
21
+ ...core.metadata,
22
+ url: CONFIG.web.href
23
+ },
24
+ logo: core.email?.options?.logo
21
25
  });
26
+ try {
27
+ await provider.sendEmail({
28
+ html: await render(htmlContent),
29
+ to,
30
+ subject,
31
+ replyTo,
32
+ metadata: core.metadata,
33
+ text: await render(htmlContent, {
34
+ plainText: true
35
+ })
36
+ });
37
+ } catch (err) {
38
+ const error = err instanceof Error ? err : new Error('Unknown error from email provider');
39
+ await this.c.get('log').error(`Failed to send email: ${error.message}`);
40
+ }
22
41
  }
23
42
  }
@@ -49,7 +49,7 @@ export class SessionAdminModel {
49
49
  secure: this.c.get('core').authorization.cookieSecure,
50
50
  path: '/',
51
51
  expires: new Date(Date.now() + this.c.get('core').authorization.adminCookieExpires),
52
- domain: CONFIG.frontend.hostname
52
+ domain: CONFIG.web.hostname
53
53
  });
54
54
  return {
55
55
  token
@@ -62,7 +62,7 @@ export class SessionAdminModel {
62
62
  await this.c.get('db').delete(core_admin_sessions).where(eq(core_admin_sessions.token, hashedToken));
63
63
  deleteCookie(this.c, this.c.get('core').authorization.adminCookieName, {
64
64
  path: '/',
65
- domain: CONFIG.frontend.hostname
65
+ domain: CONFIG.web.hostname
66
66
  });
67
67
  }
68
68
  async getUser() {
@@ -78,7 +78,7 @@ export class SessionAdminModel {
78
78
  if (!session) {
79
79
  deleteCookie(this.c, this.c.get('core').authorization.adminCookieName, {
80
80
  path: '/',
81
- domain: CONFIG.frontend.hostname
81
+ domain: CONFIG.web.hostname
82
82
  });
83
83
  return null;
84
84
  }
@@ -34,7 +34,7 @@ export class SessionModel {
34
34
  secure: this.c.get('core').authorization.cookieSecure,
35
35
  path: '/',
36
36
  expires: this.c.get('core').authorization.cookie_expires > 0 ? new Date(Date.now() + this.c.get('core').authorization.cookie_expires) : undefined,
37
- domain: CONFIG.frontend.hostname
37
+ domain: CONFIG.web.hostname
38
38
  });
39
39
  return {
40
40
  token
@@ -1 +1 @@
1
- {"version":3,"file":"sso.d.ts","sourceRoot":"","sources":["../../../../src/api/models/sso.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAapC,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,CACV,IAAI,EAAE,MAAM,KACT,OAAO,CAAC;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC3D,SAAS,EAAE,CAAC,IAAI,EAAE;QAChB,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC;KACpB,KAAK,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/D,MAAM,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM,CAAC;IAC7C,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,WACqB,CAAC;AAEjE,qBAAa,QAAQ;gBACP,CAAC,EAAE,OAAO;IAKtB,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAU;IAC5B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiB;IAEzC,OAAO,CAAC,QAAQ,CAAC,UAAU,CA6BzB;IAEI,QAAQ,CAAC,EACb,IAAI,EACJ,UAAU,EACV,KAAK,GACN,EAAE;QACD,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,MAAM,CAAC;QACnB,KAAK,EAAE,MAAM,CAAC;KACf,GAAG,OAAO,CAAC;QACV,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IA+DI,YAAY;IA2BZ,MAAM,CAAC,UAAU,EAAE,MAAM;IASzB,WAAW,CAAC,KAAK,EAAE,MAAM;CA+BhC"}
1
+ {"version":3,"file":"sso.d.ts","sourceRoot":"","sources":["../../../../src/api/models/sso.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAapC,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,CACV,IAAI,EAAE,MAAM,KACT,OAAO,CAAC;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC3D,SAAS,EAAE,CAAC,IAAI,EAAE;QAChB,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC;KACpB,KAAK,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/D,MAAM,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM,CAAC;IAC7C,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,WACgB,CAAC;AAE5D,qBAAa,QAAQ;gBACP,CAAC,EAAE,OAAO;IAKtB,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAU;IAC5B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiB;IAEzC,OAAO,CAAC,QAAQ,CAAC,UAAU,CA6BzB;IAEI,QAAQ,CAAC,EACb,IAAI,EACJ,UAAU,EACV,KAAK,GACN,EAAE;QACD,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,MAAM,CAAC;QACnB,KAAK,EAAE,MAAM,CAAC;KACf,GAAG,OAAO,CAAC;QACV,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IA+DI,YAAY;IA2BZ,MAAM,CAAC,UAAU,EAAE,MAAM;IASzB,WAAW,CAAC,KAAK,EAAE,MAAM;CA+BhC"}
@@ -6,7 +6,7 @@ import { core_users, core_users_sso } from "../../database/users.js";
6
6
  import { CONFIG } from "../../lib/config.js";
7
7
  import { removeSpecialCharacters } from "../../lib/special-characters.js";
8
8
  import { UserModel } from "./user.js";
9
- export const getRedirectUri = (code)=>new URL(`${CONFIG.frontend.href}login/sso/${code}`).toString();
9
+ export const getRedirectUri = (code)=>new URL(`${CONFIG.web.href}login/sso/${code}`).toString();
10
10
  export class SSOModel {
11
11
  constructor(c){
12
12
  this.c = c;
@@ -83,7 +83,7 @@ export class SSOModel {
83
83
  httpOnly: true,
84
84
  secure: this.c.get('core').authorization.cookieSecure,
85
85
  path: '/',
86
- domain: CONFIG.frontend.hostname
86
+ domain: CONFIG.web.hostname
87
87
  });
88
88
  return state;
89
89
  }
@@ -5,13 +5,13 @@ export declare const signUp: ({ email, name, newsletter, hashedPassword, }: {
5
5
  name: string;
6
6
  newsletter?: boolean;
7
7
  }, c: Context) => Promise<{
8
+ email: string;
8
9
  ipAddress: string;
9
10
  id: number;
10
11
  name: string;
11
12
  createdAt: Date;
12
13
  language: string;
13
14
  nameCode: string;
14
- email: string;
15
15
  newsletter: boolean;
16
16
  avatarColor: string;
17
17
  emailVerified: boolean;
@@ -33,7 +33,7 @@ const getDefaultData = async (c)=>{
33
33
  }
34
34
  return {
35
35
  roleId: defaultRole.id,
36
- emailVerified: !c.get('core').emailAdapter
36
+ emailVerified: !c.get('core').email?.adapter
37
37
  };
38
38
  };
39
39
  export const signUp = async ({ email, name, newsletter, hashedPassword }, c)=>{
@@ -28,13 +28,13 @@ export declare class UserModel {
28
28
  name: string;
29
29
  newsletter?: boolean;
30
30
  }, c: import("hono").Context) => Promise<{
31
+ email: string;
31
32
  ipAddress: string;
32
33
  id: number;
33
34
  name: string;
34
35
  createdAt: Date;
35
36
  language: string;
36
37
  nameCode: string;
37
- email: string;
38
38
  newsletter: boolean;
39
39
  avatarColor: string;
40
40
  emailVerified: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../../src/api/models/user.ts"],"names":[],"mappings":"AAIA,qBAAa,SAAS;IACpB,WAAW;;;;;;;;;;;;;;cAAe;IAC1B,kBAAkB;;;;;;;OAAsB;IACxC,MAAM;;;;kBAEo3C,CAAC;;;;;;;;;;;;;;OAF32C;CACjB"}
1
+ {"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../../src/api/models/user.ts"],"names":[],"mappings":"AAIA,qBAAa,SAAS;IACpB,WAAW;;;;;;;;;;;;;;cAAe;IAC1B,kBAAkB;;;;;;;OAAsB;IACxC,MAAM;;;;kBAEs3C,CAAC;;;;;;;;;;;;;;OAF72C;CACjB"}
@@ -36,22 +36,22 @@ export declare const adminModule: import("../../../api/lib/module").BuildModuleR
36
36
  roleId: import("zod").ZodNumber;
37
37
  birthday: import("zod").ZodNullable<import("zod").ZodDate>;
38
38
  }, "strip", import("zod").ZodTypeAny, {
39
+ email: string;
39
40
  id: number;
40
41
  name: string;
41
42
  createdAt: Date;
42
43
  nameCode: string;
43
- email: string;
44
44
  newsletter: boolean;
45
45
  avatarColor: string;
46
46
  emailVerified: boolean;
47
47
  roleId: number;
48
48
  birthday: Date | null;
49
49
  }, {
50
+ email: string;
50
51
  id: number;
51
52
  name: string;
52
53
  createdAt: Date;
53
54
  nameCode: string;
54
- email: string;
55
55
  newsletter: boolean;
56
56
  avatarColor: string;
57
57
  emailVerified: boolean;
@@ -61,11 +61,11 @@ export declare const adminModule: import("../../../api/lib/module").BuildModuleR
61
61
  vitnode_version: import("zod").ZodString;
62
62
  }, "strip", import("zod").ZodTypeAny, {
63
63
  user: {
64
+ email: string;
64
65
  id: number;
65
66
  name: string;
66
67
  createdAt: Date;
67
68
  nameCode: string;
68
- email: string;
69
69
  newsletter: boolean;
70
70
  avatarColor: string;
71
71
  emailVerified: boolean;
@@ -75,11 +75,11 @@ export declare const adminModule: import("../../../api/lib/module").BuildModuleR
75
75
  vitnode_version: string;
76
76
  }, {
77
77
  user: {
78
+ email: string;
78
79
  id: number;
79
80
  name: string;
80
81
  createdAt: Date;
81
82
  nameCode: string;
82
- email: string;
83
83
  newsletter: boolean;
84
84
  avatarColor: string;
85
85
  emailVerified: boolean;
@@ -103,18 +103,18 @@ export declare const adminModule: import("../../../api/lib/module").BuildModuleR
103
103
  handler: (c: import("hono").Context<import("../../middlewares/global.middleware").EnvVitNode, "/logs", {
104
104
  in: {
105
105
  query: {
106
- orderBy?: "createdAt" | "type" | "pluginId" | undefined;
107
- cursor?: string | undefined;
108
106
  order?: "asc" | "desc" | undefined;
107
+ cursor?: string | undefined;
108
+ orderBy?: "type" | "createdAt" | "pluginId" | undefined;
109
109
  first?: string | undefined;
110
110
  last?: string | undefined;
111
111
  };
112
112
  };
113
113
  out: {
114
114
  query: {
115
- orderBy?: "createdAt" | "type" | "pluginId" | undefined;
116
- cursor?: string | undefined;
117
115
  order?: "asc" | "desc" | undefined;
116
+ cursor?: string | undefined;
117
+ orderBy?: "type" | "createdAt" | "pluginId" | undefined;
118
118
  first?: string | undefined;
119
119
  last?: string | undefined;
120
120
  };
@@ -160,15 +160,15 @@ export declare const adminModule: import("../../../api/lib/module").BuildModuleR
160
160
  order: import("zod").ZodOptional<import("zod").ZodEnum<["asc", "desc"]>>;
161
161
  orderBy: import("zod").ZodOptional<import("zod").ZodEnum<["type", "createdAt", "pluginId"]>>;
162
162
  }, "strip", import("zod").ZodTypeAny, {
163
- orderBy?: "createdAt" | "type" | "pluginId" | undefined;
164
- cursor?: string | undefined;
165
163
  order?: "asc" | "desc" | undefined;
164
+ cursor?: string | undefined;
165
+ orderBy?: "type" | "createdAt" | "pluginId" | undefined;
166
166
  first?: string | undefined;
167
167
  last?: string | undefined;
168
168
  }, {
169
- orderBy?: "createdAt" | "type" | "pluginId" | undefined;
170
- cursor?: string | undefined;
171
169
  order?: "asc" | "desc" | undefined;
170
+ cursor?: string | undefined;
171
+ orderBy?: "type" | "createdAt" | "pluginId" | undefined;
172
172
  first?: string | undefined;
173
173
  last?: string | undefined;
174
174
  }>;
@@ -211,12 +211,12 @@ export declare const adminModule: import("../../../api/lib/module").BuildModuleR
211
211
  nameCode: string;
212
212
  } | null;
213
213
  id: number;
214
+ content: string;
215
+ type: "warn" | "error" | "debug";
214
216
  createdAt: Date;
215
217
  userAgent: string | null;
216
- type: "warn" | "error" | "debug";
217
218
  path: string;
218
219
  pluginId: string;
219
- content: string;
220
220
  statusCode: number;
221
221
  }, {
222
222
  method: string;
@@ -227,12 +227,12 @@ export declare const adminModule: import("../../../api/lib/module").BuildModuleR
227
227
  nameCode: string;
228
228
  } | null;
229
229
  id: number;
230
+ content: string;
231
+ type: "warn" | "error" | "debug";
230
232
  createdAt: Date;
231
233
  userAgent: string | null;
232
- type: "warn" | "error" | "debug";
233
234
  path: string;
234
235
  pluginId: string;
235
- content: string;
236
236
  statusCode: number;
237
237
  }>, "many">;
238
238
  pageInfo: import("zod").ZodObject<{
@@ -267,12 +267,12 @@ export declare const adminModule: import("../../../api/lib/module").BuildModuleR
267
267
  nameCode: string;
268
268
  } | null;
269
269
  id: number;
270
+ content: string;
271
+ type: "warn" | "error" | "debug";
270
272
  createdAt: Date;
271
273
  userAgent: string | null;
272
- type: "warn" | "error" | "debug";
273
274
  path: string;
274
275
  pluginId: string;
275
- content: string;
276
276
  statusCode: number;
277
277
  }[];
278
278
  pageInfo: {
@@ -293,12 +293,12 @@ export declare const adminModule: import("../../../api/lib/module").BuildModuleR
293
293
  nameCode: string;
294
294
  } | null;
295
295
  id: number;
296
+ content: string;
297
+ type: "warn" | "error" | "debug";
296
298
  createdAt: Date;
297
299
  userAgent: string | null;
298
- type: "warn" | "error" | "debug";
299
300
  path: string;
300
301
  pluginId: string;
301
- content: string;
302
302
  statusCode: number;
303
303
  }[];
304
304
  pageInfo: {
@@ -322,18 +322,18 @@ export declare const adminModule: import("../../../api/lib/module").BuildModuleR
322
322
  handler: (c: import("hono").Context<import("../../middlewares/global.middleware").EnvVitNode, "/list", {
323
323
  in: {
324
324
  query: {
325
- orderBy?: "name" | "createdAt" | undefined;
326
- cursor?: string | undefined;
327
325
  order?: "asc" | "desc" | undefined;
326
+ cursor?: string | undefined;
327
+ orderBy?: "name" | "createdAt" | undefined;
328
328
  first?: string | undefined;
329
329
  last?: string | undefined;
330
330
  };
331
331
  };
332
332
  out: {
333
333
  query: {
334
- orderBy?: "name" | "createdAt" | undefined;
335
- cursor?: string | undefined;
336
334
  order?: "asc" | "desc" | undefined;
335
+ cursor?: string | undefined;
336
+ orderBy?: "name" | "createdAt" | undefined;
337
337
  first?: string | undefined;
338
338
  last?: string | undefined;
339
339
  };
@@ -375,15 +375,15 @@ export declare const adminModule: import("../../../api/lib/module").BuildModuleR
375
375
  order: import("zod").ZodOptional<import("zod").ZodEnum<["asc", "desc"]>>;
376
376
  orderBy: import("zod").ZodOptional<import("zod").ZodEnum<["name", "createdAt"]>>;
377
377
  }, "strip", import("zod").ZodTypeAny, {
378
- orderBy?: "name" | "createdAt" | undefined;
379
- cursor?: string | undefined;
380
378
  order?: "asc" | "desc" | undefined;
379
+ cursor?: string | undefined;
380
+ orderBy?: "name" | "createdAt" | undefined;
381
381
  first?: string | undefined;
382
382
  last?: string | undefined;
383
383
  }, {
384
- orderBy?: "name" | "createdAt" | undefined;
385
- cursor?: string | undefined;
386
384
  order?: "asc" | "desc" | undefined;
385
+ cursor?: string | undefined;
386
+ orderBy?: "name" | "createdAt" | undefined;
387
387
  first?: string | undefined;
388
388
  last?: string | undefined;
389
389
  }>;
@@ -406,24 +406,24 @@ export declare const adminModule: import("../../../api/lib/module").BuildModuleR
406
406
  birthday: import("zod").ZodNullable<import("zod").ZodDate>;
407
407
  language: import("zod").ZodString;
408
408
  }, "strip", import("zod").ZodTypeAny, {
409
+ email: string;
409
410
  id: number;
410
411
  name: string;
411
412
  createdAt: Date;
412
413
  language: string;
413
414
  nameCode: string;
414
- email: string;
415
415
  newsletter: boolean;
416
416
  avatarColor: string;
417
417
  emailVerified: boolean;
418
418
  roleId: number;
419
419
  birthday: Date | null;
420
420
  }, {
421
+ email: string;
421
422
  id: number;
422
423
  name: string;
423
424
  createdAt: Date;
424
425
  language: string;
425
426
  nameCode: string;
426
- email: string;
427
427
  newsletter: boolean;
428
428
  avatarColor: string;
429
429
  emailVerified: boolean;
@@ -454,12 +454,12 @@ export declare const adminModule: import("../../../api/lib/module").BuildModuleR
454
454
  }>;
455
455
  }, "strip", import("zod").ZodTypeAny, {
456
456
  edges: {
457
+ email: string;
457
458
  id: number;
458
459
  name: string;
459
460
  createdAt: Date;
460
461
  language: string;
461
462
  nameCode: string;
462
- email: string;
463
463
  newsletter: boolean;
464
464
  avatarColor: string;
465
465
  emailVerified: boolean;
@@ -476,12 +476,12 @@ export declare const adminModule: import("../../../api/lib/module").BuildModuleR
476
476
  };
477
477
  }, {
478
478
  edges: {
479
+ email: string;
479
480
  id: number;
480
481
  name: string;
481
482
  createdAt: Date;
482
483
  language: string;
483
484
  nameCode: string;
484
- email: string;
485
485
  newsletter: boolean;
486
486
  avatarColor: string;
487
487
  emailVerified: boolean;
@@ -2,18 +2,18 @@ export declare const debugAdminModule: import("../../../lib/module").BuildModule
2
2
  handler: (c: import("hono").Context<import("../../../middlewares/global.middleware").EnvVitNode, "/logs", {
3
3
  in: {
4
4
  query: {
5
- orderBy?: "createdAt" | "type" | "pluginId" | undefined;
6
- cursor?: string | undefined;
7
5
  order?: "asc" | "desc" | undefined;
6
+ cursor?: string | undefined;
7
+ orderBy?: "type" | "createdAt" | "pluginId" | undefined;
8
8
  first?: string | undefined;
9
9
  last?: string | undefined;
10
10
  };
11
11
  };
12
12
  out: {
13
13
  query: {
14
- orderBy?: "createdAt" | "type" | "pluginId" | undefined;
15
- cursor?: string | undefined;
16
14
  order?: "asc" | "desc" | undefined;
15
+ cursor?: string | undefined;
16
+ orderBy?: "type" | "createdAt" | "pluginId" | undefined;
17
17
  first?: string | undefined;
18
18
  last?: string | undefined;
19
19
  };
@@ -59,15 +59,15 @@ export declare const debugAdminModule: import("../../../lib/module").BuildModule
59
59
  order: import("zod").ZodOptional<import("zod").ZodEnum<["asc", "desc"]>>;
60
60
  orderBy: import("zod").ZodOptional<import("zod").ZodEnum<["type", "createdAt", "pluginId"]>>;
61
61
  }, "strip", import("zod").ZodTypeAny, {
62
- orderBy?: "createdAt" | "type" | "pluginId" | undefined;
63
- cursor?: string | undefined;
64
62
  order?: "asc" | "desc" | undefined;
63
+ cursor?: string | undefined;
64
+ orderBy?: "type" | "createdAt" | "pluginId" | undefined;
65
65
  first?: string | undefined;
66
66
  last?: string | undefined;
67
67
  }, {
68
- orderBy?: "createdAt" | "type" | "pluginId" | undefined;
69
- cursor?: string | undefined;
70
68
  order?: "asc" | "desc" | undefined;
69
+ cursor?: string | undefined;
70
+ orderBy?: "type" | "createdAt" | "pluginId" | undefined;
71
71
  first?: string | undefined;
72
72
  last?: string | undefined;
73
73
  }>;
@@ -110,12 +110,12 @@ export declare const debugAdminModule: import("../../../lib/module").BuildModule
110
110
  nameCode: string;
111
111
  } | null;
112
112
  id: number;
113
+ content: string;
114
+ type: "warn" | "error" | "debug";
113
115
  createdAt: Date;
114
116
  userAgent: string | null;
115
- type: "warn" | "error" | "debug";
116
117
  path: string;
117
118
  pluginId: string;
118
- content: string;
119
119
  statusCode: number;
120
120
  }, {
121
121
  method: string;
@@ -126,12 +126,12 @@ export declare const debugAdminModule: import("../../../lib/module").BuildModule
126
126
  nameCode: string;
127
127
  } | null;
128
128
  id: number;
129
+ content: string;
130
+ type: "warn" | "error" | "debug";
129
131
  createdAt: Date;
130
132
  userAgent: string | null;
131
- type: "warn" | "error" | "debug";
132
133
  path: string;
133
134
  pluginId: string;
134
- content: string;
135
135
  statusCode: number;
136
136
  }>, "many">;
137
137
  pageInfo: import("zod").ZodObject<{
@@ -166,12 +166,12 @@ export declare const debugAdminModule: import("../../../lib/module").BuildModule
166
166
  nameCode: string;
167
167
  } | null;
168
168
  id: number;
169
+ content: string;
170
+ type: "warn" | "error" | "debug";
169
171
  createdAt: Date;
170
172
  userAgent: string | null;
171
- type: "warn" | "error" | "debug";
172
173
  path: string;
173
174
  pluginId: string;
174
- content: string;
175
175
  statusCode: number;
176
176
  }[];
177
177
  pageInfo: {
@@ -192,12 +192,12 @@ export declare const debugAdminModule: import("../../../lib/module").BuildModule
192
192
  nameCode: string;
193
193
  } | null;
194
194
  id: number;
195
+ content: string;
196
+ type: "warn" | "error" | "debug";
195
197
  createdAt: Date;
196
198
  userAgent: string | null;
197
- type: "warn" | "error" | "debug";
198
199
  path: string;
199
200
  pluginId: string;
200
- content: string;
201
201
  statusCode: number;
202
202
  }[];
203
203
  pageInfo: {
@@ -3,18 +3,18 @@ export declare const logsDebugAdminRoute: {
3
3
  handler: (c: import("hono").Context<import("../../../../middlewares/global.middleware").EnvVitNode, "/logs", {
4
4
  in: {
5
5
  query: {
6
- orderBy?: "createdAt" | "type" | "pluginId" | undefined;
7
- cursor?: string | undefined;
8
6
  order?: "asc" | "desc" | undefined;
7
+ cursor?: string | undefined;
8
+ orderBy?: "type" | "createdAt" | "pluginId" | undefined;
9
9
  first?: string | undefined;
10
10
  last?: string | undefined;
11
11
  };
12
12
  };
13
13
  out: {
14
14
  query: {
15
- orderBy?: "createdAt" | "type" | "pluginId" | undefined;
16
- cursor?: string | undefined;
17
15
  order?: "asc" | "desc" | undefined;
16
+ cursor?: string | undefined;
17
+ orderBy?: "type" | "createdAt" | "pluginId" | undefined;
18
18
  first?: string | undefined;
19
19
  last?: string | undefined;
20
20
  };
@@ -60,15 +60,15 @@ export declare const logsDebugAdminRoute: {
60
60
  order: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
61
61
  orderBy: z.ZodOptional<z.ZodEnum<["type", "createdAt", "pluginId"]>>;
62
62
  }, "strip", z.ZodTypeAny, {
63
- orderBy?: "createdAt" | "type" | "pluginId" | undefined;
64
- cursor?: string | undefined;
65
63
  order?: "asc" | "desc" | undefined;
64
+ cursor?: string | undefined;
65
+ orderBy?: "type" | "createdAt" | "pluginId" | undefined;
66
66
  first?: string | undefined;
67
67
  last?: string | undefined;
68
68
  }, {
69
- orderBy?: "createdAt" | "type" | "pluginId" | undefined;
70
- cursor?: string | undefined;
71
69
  order?: "asc" | "desc" | undefined;
70
+ cursor?: string | undefined;
71
+ orderBy?: "type" | "createdAt" | "pluginId" | undefined;
72
72
  first?: string | undefined;
73
73
  last?: string | undefined;
74
74
  }>;
@@ -111,12 +111,12 @@ export declare const logsDebugAdminRoute: {
111
111
  nameCode: string;
112
112
  } | null;
113
113
  id: number;
114
+ content: string;
115
+ type: "warn" | "error" | "debug";
114
116
  createdAt: Date;
115
117
  userAgent: string | null;
116
- type: "warn" | "error" | "debug";
117
118
  path: string;
118
119
  pluginId: string;
119
- content: string;
120
120
  statusCode: number;
121
121
  }, {
122
122
  method: string;
@@ -127,12 +127,12 @@ export declare const logsDebugAdminRoute: {
127
127
  nameCode: string;
128
128
  } | null;
129
129
  id: number;
130
+ content: string;
131
+ type: "warn" | "error" | "debug";
130
132
  createdAt: Date;
131
133
  userAgent: string | null;
132
- type: "warn" | "error" | "debug";
133
134
  path: string;
134
135
  pluginId: string;
135
- content: string;
136
136
  statusCode: number;
137
137
  }>, "many">;
138
138
  pageInfo: z.ZodObject<{
@@ -167,12 +167,12 @@ export declare const logsDebugAdminRoute: {
167
167
  nameCode: string;
168
168
  } | null;
169
169
  id: number;
170
+ content: string;
171
+ type: "warn" | "error" | "debug";
170
172
  createdAt: Date;
171
173
  userAgent: string | null;
172
- type: "warn" | "error" | "debug";
173
174
  path: string;
174
175
  pluginId: string;
175
- content: string;
176
176
  statusCode: number;
177
177
  }[];
178
178
  pageInfo: {
@@ -193,12 +193,12 @@ export declare const logsDebugAdminRoute: {
193
193
  nameCode: string;
194
194
  } | null;
195
195
  id: number;
196
+ content: string;
197
+ type: "warn" | "error" | "debug";
196
198
  createdAt: Date;
197
199
  userAgent: string | null;
198
- type: "warn" | "error" | "debug";
199
200
  path: string;
200
201
  pluginId: string;
201
- content: string;
202
202
  statusCode: number;
203
203
  }[];
204
204
  pageInfo: {
@@ -1,7 +1,7 @@
1
1
  import { eq } from "drizzle-orm";
2
2
  import { z } from "zod";
3
3
  import { CONFIG_PLUGIN } from "../../../../../config.js";
4
- import { core_logs, coreLogsType } from "../../../../../database/logs.js";
4
+ import { core_logs } from "../../../../../database/logs.js";
5
5
  import { core_users } from "../../../../../database/users.js";
6
6
  import { buildRoute } from "../../../../lib/route.js";
7
7
  import { withPagination, zodPaginationPageInfo, zodPaginationQuery } from "../../../../lib/with-pagination.js";
@@ -32,7 +32,11 @@ export const logsDebugAdminRoute = buildRoute({
32
32
  edges: z.array(z.object({
33
33
  id: z.number(),
34
34
  pluginId: z.string(),
35
- type: z.enum(coreLogsType.enumValues),
35
+ type: z.enum([
36
+ 'warn',
37
+ 'error',
38
+ 'debug'
39
+ ]),
36
40
  content: z.string(),
37
41
  createdAt: z.date(),
38
42
  ipAddress: z.string(),