@vitnode/core 1.2.0-canary.53 → 1.2.0-canary.54

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 (179) hide show
  1. package/dist/scripts/prepare-database.d.ts +0 -1
  2. package/dist/scripts/prepare-database.d.ts.map +1 -1
  3. package/dist/scripts/scripts.js +4 -4
  4. package/dist/src/api/adapters/cron/node-cron.adapter.d.ts +3 -0
  5. package/dist/src/api/adapters/cron/node-cron.adapter.d.ts.map +1 -0
  6. package/dist/src/api/adapters/cron/node-cron.adapter.js +11 -0
  7. package/dist/src/api/config.d.ts.map +1 -1
  8. package/dist/src/api/config.js +21 -9
  9. package/dist/src/api/lib/cron.d.ts +18 -0
  10. package/dist/src/api/lib/cron.d.ts.map +1 -0
  11. package/dist/src/api/lib/cron.js +22 -0
  12. package/dist/src/api/lib/module.d.ts +4 -1
  13. package/dist/src/api/lib/module.d.ts.map +1 -1
  14. package/dist/src/api/lib/module.js +3 -2
  15. package/dist/src/api/lib/plugin.d.ts +2 -0
  16. package/dist/src/api/lib/plugin.d.ts.map +1 -1
  17. package/dist/src/api/lib/plugin.js +9 -1
  18. package/dist/src/api/middlewares/cron-auth.middleware.d.ts +3 -0
  19. package/dist/src/api/middlewares/cron-auth.middleware.d.ts.map +1 -0
  20. package/dist/src/api/middlewares/cron-auth.middleware.js +19 -0
  21. package/dist/src/api/middlewares/global.middleware.d.ts +6 -0
  22. package/dist/src/api/middlewares/global.middleware.d.ts.map +1 -1
  23. package/dist/src/api/middlewares/global.middleware.js +33 -22
  24. package/dist/src/api/models/user/sign-up.d.ts +1 -1
  25. package/dist/src/api/models/user.d.ts +1 -1
  26. package/dist/src/api/modules/admin/admin.module.d.ts +163 -1
  27. package/dist/src/api/modules/admin/admin.module.d.ts.map +1 -1
  28. package/dist/src/api/modules/admin/admin.module.js +6 -3
  29. package/dist/src/api/modules/admin/advanced/advanced.admin.module.d.ts +164 -0
  30. package/dist/src/api/modules/admin/advanced/advanced.admin.module.d.ts.map +1 -0
  31. package/dist/src/api/modules/admin/advanced/advanced.admin.module.js +11 -0
  32. package/dist/src/api/modules/admin/advanced/cron/cron.admin.module.d.ts +164 -0
  33. package/dist/src/api/modules/admin/advanced/cron/cron.admin.module.d.ts.map +1 -0
  34. package/dist/src/api/modules/admin/advanced/cron/cron.admin.module.js +12 -0
  35. package/dist/src/api/modules/admin/advanced/cron/routes/get.route.d.ts +98 -0
  36. package/dist/src/api/modules/admin/advanced/cron/routes/get.route.d.ts.map +1 -0
  37. package/dist/src/api/modules/admin/advanced/cron/routes/get.route.js +66 -0
  38. package/dist/src/api/modules/admin/advanced/cron/routes/run.route.d.ts +70 -0
  39. package/dist/src/api/modules/admin/advanced/cron/routes/run.route.d.ts.map +1 -0
  40. package/dist/src/api/modules/admin/advanced/cron/routes/run.route.js +95 -0
  41. package/dist/src/api/modules/admin/debug/debug.admin.module.js +1 -1
  42. package/dist/src/api/modules/admin/debug/routes/logs.route.js +1 -1
  43. package/dist/src/api/modules/admin/routes/session.route.js +1 -1
  44. package/dist/src/api/modules/admin/users/routes/list.route.js +1 -1
  45. package/dist/src/api/modules/admin/users/routes/users.route.d.ts +3 -3
  46. package/dist/src/api/modules/admin/users/routes/users.route.js +1 -1
  47. package/dist/src/api/modules/admin/users/users.admin.module.js +1 -1
  48. package/dist/src/api/modules/cron/cron/clean.cron.d.ts +2 -0
  49. package/dist/src/api/modules/cron/cron/clean.cron.d.ts.map +1 -0
  50. package/dist/src/api/modules/cron/cron/clean.cron.js +24 -0
  51. package/dist/src/api/modules/cron/cron.module.d.ts +26 -0
  52. package/dist/src/api/modules/cron/cron.module.d.ts.map +1 -0
  53. package/dist/src/api/modules/cron/cron.module.js +14 -0
  54. package/dist/src/api/modules/cron/helpers/process-cron-jobs.d.ts +36 -0
  55. package/dist/src/api/modules/cron/helpers/process-cron-jobs.d.ts.map +1 -0
  56. package/dist/src/api/modules/cron/helpers/process-cron-jobs.js +72 -0
  57. package/dist/src/api/modules/cron/routes/cron.route.d.ts +27 -0
  58. package/dist/src/api/modules/cron/routes/cron.route.d.ts.map +1 -0
  59. package/dist/src/api/modules/cron/routes/cron.route.js +95 -0
  60. package/dist/src/api/modules/middleware/middleware.module.js +1 -1
  61. package/dist/src/api/modules/middleware/route.js +1 -1
  62. package/dist/src/api/modules/users/routes/change-password.route.js +1 -1
  63. package/dist/src/api/modules/users/routes/reset-passowrd.route.js +1 -1
  64. package/dist/src/api/modules/users/routes/session.route.js +1 -1
  65. package/dist/src/api/modules/users/routes/sign-in.route.js +1 -1
  66. package/dist/src/api/modules/users/routes/sign-out.route.js +1 -1
  67. package/dist/src/api/modules/users/routes/sign-up.route.js +1 -1
  68. package/dist/src/api/modules/users/routes/test.route.js +1 -1
  69. package/dist/src/api/modules/users/sso/routes/callback.route.js +1 -1
  70. package/dist/src/api/modules/users/sso/routes/create-url.route.js +1 -1
  71. package/dist/src/api/modules/users/sso/sso.module.js +1 -1
  72. package/dist/src/api/modules/users/users.module.js +1 -1
  73. package/dist/src/api/plugin.d.ts.map +1 -1
  74. package/dist/src/api/plugin.js +4 -2
  75. package/dist/src/app_admin/core/advanced/cron/page.d.ts +11 -0
  76. package/dist/src/app_admin/core/advanced/cron/page.d.ts.map +1 -0
  77. package/dist/src/app_admin/core/advanced/cron/page.js +42 -0
  78. package/dist/src/components/switchers/langs/{language-swietcher.d.ts → language-switcher.d.ts} +1 -1
  79. package/dist/src/components/switchers/langs/language-switcher.d.ts.map +1 -0
  80. package/dist/src/components/tiptap/extension.d.ts +4 -0
  81. package/dist/src/components/tiptap/extension.d.ts.map +1 -0
  82. package/dist/src/components/tiptap/extension.js +26 -0
  83. package/dist/src/components/tiptap/toolbar/actions/bold-action.d.ts +2 -0
  84. package/dist/src/components/tiptap/toolbar/actions/bold-action.d.ts.map +1 -0
  85. package/dist/src/components/tiptap/toolbar/actions/bold-action.js +39 -0
  86. package/dist/src/components/tiptap/toolbar/actions/headings-action.d.ts +2 -0
  87. package/dist/src/components/tiptap/toolbar/actions/headings-action.d.ts.map +1 -0
  88. package/dist/src/components/tiptap/toolbar/actions/headings-action.js +94 -0
  89. package/dist/src/components/tiptap/toolbar/actions/italic-action.d.ts +2 -0
  90. package/dist/src/components/tiptap/toolbar/actions/italic-action.d.ts.map +1 -0
  91. package/dist/src/components/tiptap/toolbar/actions/italic-action.js +38 -0
  92. package/dist/src/components/tiptap/toolbar/actions/list-action.d.ts +2 -0
  93. package/dist/src/components/tiptap/toolbar/actions/list-action.d.ts.map +1 -0
  94. package/dist/src/components/tiptap/toolbar/actions/list-action.js +60 -0
  95. package/dist/src/components/tiptap/toolbar/actions/text-format-more/text-format-more.d.ts +2 -0
  96. package/dist/src/components/tiptap/toolbar/actions/text-format-more/text-format-more.d.ts.map +1 -0
  97. package/dist/src/components/tiptap/toolbar/actions/text-format-more/text-format-more.js +59 -0
  98. package/dist/src/components/tiptap/toolbar/actions/underline-action.d.ts +2 -0
  99. package/dist/src/components/tiptap/toolbar/actions/underline-action.d.ts.map +1 -0
  100. package/dist/src/components/tiptap/toolbar/actions/underline-action.js +38 -0
  101. package/dist/src/components/tiptap/toolbar/actions/undo-redo-actions.d.ts +2 -0
  102. package/dist/src/components/tiptap/toolbar/actions/undo-redo-actions.d.ts.map +1 -0
  103. package/dist/src/components/tiptap/toolbar/actions/undo-redo-actions.js +63 -0
  104. package/dist/src/components/tiptap/toolbar/actions/utils/tooltip-shortcut.d.ts +4 -0
  105. package/dist/src/components/tiptap/toolbar/actions/utils/tooltip-shortcut.d.ts.map +1 -0
  106. package/dist/src/components/tiptap/toolbar/actions/utils/tooltip-shortcut.js +11 -0
  107. package/dist/src/components/tiptap/toolbar/tiptap-toolbar.d.ts +5 -0
  108. package/dist/src/components/tiptap/toolbar/tiptap-toolbar.d.ts.map +1 -0
  109. package/dist/src/components/tiptap/toolbar/tiptap-toolbar.js +35 -0
  110. package/dist/src/components/tiptap/toolbar/use-toolbar-editor.d.ts +9 -0
  111. package/dist/src/components/tiptap/toolbar/use-toolbar-editor.d.ts.map +1 -0
  112. package/dist/src/components/tiptap/toolbar/use-toolbar-editor.js +5 -0
  113. package/dist/src/components/ui/button-client.d.ts.map +1 -1
  114. package/dist/src/components/ui/button-client.js +1 -1
  115. package/dist/src/components/ui/button.js +1 -1
  116. package/dist/src/components/ui/editor-content.d.ts +4 -0
  117. package/dist/src/components/ui/editor-content.d.ts.map +1 -0
  118. package/dist/src/components/ui/editor-content.js +10 -0
  119. package/dist/src/components/ui/editor.d.ts +6 -0
  120. package/dist/src/components/ui/editor.d.ts.map +1 -0
  121. package/dist/src/components/ui/editor.js +35 -0
  122. package/dist/src/components/ui/sidebar.js +14 -14
  123. package/dist/src/components/ui/table.js +1 -1
  124. package/dist/src/components/ui/tooltip.d.ts +4 -1
  125. package/dist/src/components/ui/tooltip.d.ts.map +1 -1
  126. package/dist/src/components/ui/tooltip.js +18 -2
  127. package/dist/src/database/cron.d.ts +171 -0
  128. package/dist/src/database/cron.d.ts.map +1 -0
  129. package/dist/src/database/cron.js +22 -0
  130. package/dist/src/database/users.d.ts +2 -2
  131. package/dist/src/database/users.js +1 -1
  132. package/dist/src/lib/api/get-next-cron-run-date.d.ts +2 -0
  133. package/dist/src/lib/api/get-next-cron-run-date.d.ts.map +1 -0
  134. package/dist/src/lib/api/get-next-cron-run-date.js +14 -0
  135. package/dist/src/lib/api/get-next-cron-run-date.test.d.ts +2 -0
  136. package/dist/src/lib/api/get-next-cron-run-date.test.d.ts.map +1 -0
  137. package/dist/src/lib/api/get-next-cron-run-date.test.js +55 -0
  138. package/dist/src/lib/api/should-cron-job-run.d.ts +2 -0
  139. package/dist/src/lib/api/should-cron-job-run.d.ts.map +1 -0
  140. package/dist/src/lib/api/should-cron-job-run.js +16 -0
  141. package/dist/src/lib/api/should-cron-job-run.test.d.ts +2 -0
  142. package/dist/src/lib/api/should-cron-job-run.test.d.ts.map +1 -0
  143. package/dist/src/lib/api/should-cron-job-run.test.js +213 -0
  144. package/dist/src/lib/config.d.ts +1 -0
  145. package/dist/src/lib/config.d.ts.map +1 -1
  146. package/dist/src/lib/config.js +7 -5
  147. package/dist/src/lib/ctrl-or-command-character.d.ts +2 -0
  148. package/dist/src/lib/ctrl-or-command-character.d.ts.map +1 -0
  149. package/dist/src/lib/ctrl-or-command-character.js +9 -0
  150. package/dist/src/lib/navigation.d.ts +1 -1
  151. package/dist/src/lib/navigation.d.ts.map +1 -1
  152. package/dist/src/views/admin/layouts/admin-layout.js +1 -1
  153. package/dist/src/views/admin/layouts/sidebar/nav/item.d.ts.map +1 -1
  154. package/dist/src/views/admin/layouts/sidebar/nav/item.js +0 -3
  155. package/dist/src/views/admin/layouts/sidebar/nav/nav.d.ts.map +1 -1
  156. package/dist/src/views/admin/layouts/sidebar/nav/nav.js +12 -1
  157. package/dist/src/views/admin/views/core/advanced/cron/cron-table-view.d.ts +5 -0
  158. package/dist/src/views/admin/views/core/advanced/cron/cron-table-view.d.ts.map +1 -0
  159. package/dist/src/views/admin/views/core/advanced/cron/cron-table-view.js +97 -0
  160. package/dist/src/views/admin/views/core/advanced/cron/run-action/mutation-api.d.ts +4 -0
  161. package/dist/src/views/admin/views/core/advanced/cron/run-action/mutation-api.d.ts.map +1 -0
  162. package/dist/src/views/admin/views/core/advanced/cron/run-action/mutation-api.js +23 -0
  163. package/dist/src/views/admin/views/core/advanced/cron/run-action/run-action.d.ts +4 -0
  164. package/dist/src/views/admin/views/core/advanced/cron/run-action/run-action.d.ts.map +1 -0
  165. package/dist/src/views/admin/views/core/advanced/cron/run-action/run-action.js +37 -0
  166. package/dist/src/views/admin/views/core/debug/system-logs/actions/more/more.d.ts.map +1 -1
  167. package/dist/src/views/admin/views/core/debug/system-logs/actions/more/more.js +11 -20
  168. package/dist/src/views/admin/views/core/test.d.ts.map +1 -1
  169. package/dist/src/views/admin/views/core/test.js +116 -106
  170. package/dist/src/views/layouts/theme/header/header.js +1 -1
  171. package/dist/src/vitnode.config.d.ts +2 -0
  172. package/dist/src/vitnode.config.d.ts.map +1 -1
  173. package/dist/tsconfig.tsbuildinfo +1 -1
  174. package/package.json +32 -26
  175. package/src/app_admin/core/advanced/cron/page.tsx +41 -0
  176. package/src/locales/en.json +43 -0
  177. package/src/tiptap.css +20 -0
  178. package/dist/src/components/switchers/langs/language-swietcher.d.ts.map +0 -1
  179. /package/dist/src/components/switchers/langs/{language-swietcher.js → language-switcher.js} +0 -0
@@ -0,0 +1,95 @@
1
+ import { eq } from "drizzle-orm";
2
+ import { z } from "zod";
3
+ import { buildRoute } from "../../../lib/route.js";
4
+ import { cronAuthMiddleware } from "../../../middlewares/cron-auth.middleware.js";
5
+ import { CONFIG_PLUGIN } from "../../../../config.js";
6
+ import { core_cron } from "../../../../database/cron.js";
7
+ import { getNextCronRunDate } from "../../../../lib/api/get-next-cron-run-date.js";
8
+ import { cleanupOutdatedCronJobs, processCronJobs, updateCronJobs } from "../helpers/process-cron-jobs.js";
9
+ export const runCronRoute = buildRoute({
10
+ pluginId: CONFIG_PLUGIN.pluginId,
11
+ route: {
12
+ method: "post",
13
+ description: "Run cron job",
14
+ path: "/",
15
+ middleware: [
16
+ cronAuthMiddleware()
17
+ ],
18
+ responses: {
19
+ 200: {
20
+ content: {
21
+ "text/plain": {
22
+ schema: z.string()
23
+ }
24
+ },
25
+ description: "Cron started successfully"
26
+ },
27
+ 403: {
28
+ description: "Access Denied"
29
+ }
30
+ }
31
+ },
32
+ handler: async (c)=>{
33
+ const db = c.get("db");
34
+ const cronJobs = c.get("core").cron;
35
+ try {
36
+ const cronFromDb = await db.select().from(core_cron);
37
+ await cleanupOutdatedCronJobs(db, cronFromDb, cronJobs);
38
+ const now = new Date();
39
+ let executedJobs = 0;
40
+ const { newJobs, jobsToExecute, jobsToUpdate } = processCronJobs(cronJobs, cronFromDb);
41
+ if (newJobs.length > 0) {
42
+ try {
43
+ const newJobsValues = newJobs.map((job)=>({
44
+ name: job.name,
45
+ description: job.description || null,
46
+ lastRun: null,
47
+ nextRun: null,
48
+ pluginId: job.pluginId,
49
+ module: job.module,
50
+ schedule: job.schedule
51
+ }));
52
+ await db.insert(core_cron).values(newJobsValues);
53
+ } catch (error) {
54
+ await c.get("log").error(`Error inserting new cron jobs: ${error}`);
55
+ }
56
+ }
57
+ try {
58
+ await updateCronJobs(db, jobsToUpdate);
59
+ } catch (error) {
60
+ await c.get("log").error(`Error updating cron jobs: ${error}`);
61
+ }
62
+ if (jobsToExecute.length > 0) {
63
+ const executionPromises = jobsToExecute.map(async (job)=>{
64
+ try {
65
+ await job.handler(c);
66
+ const dbJob = cronFromDb.find((dbJob)=>dbJob.name === job.name && dbJob.pluginId === job.pluginId && dbJob.module === job.module);
67
+ if (dbJob) {
68
+ await db.update(core_cron).set({
69
+ lastRun: now,
70
+ nextRun: getNextCronRunDate(job.schedule, now)
71
+ }).where(eq(core_cron.id, dbJob.id));
72
+ }
73
+ return {
74
+ success: true,
75
+ jobName: job.name
76
+ };
77
+ } catch (error) {
78
+ await c.get("log").error(`Error executing cron job "${job.pluginId}:${job.module}:${job.name}": ${error}`);
79
+ return {
80
+ success: false,
81
+ jobName: job.name,
82
+ error
83
+ };
84
+ }
85
+ });
86
+ const results = await Promise.allSettled(executionPromises);
87
+ executedJobs = results.filter((result)=>result.status === "fulfilled" && result.value.success).length;
88
+ }
89
+ return c.text(`Cron jobs processed. Executed ${executedJobs} jobs.`, 200);
90
+ } catch (error) {
91
+ await c.get("log").error(`Error processing cron jobs: ${error}`);
92
+ return c.text("Error processing cron jobs", 500);
93
+ }
94
+ }
95
+ });
@@ -2,7 +2,7 @@ import { buildModule } from "../../lib/module.js";
2
2
  import { CONFIG_PLUGIN } from "../../../config.js";
3
3
  import { routeMiddleware } from "./route.js";
4
4
  export const middlewareModule = buildModule({
5
- ...CONFIG_PLUGIN,
5
+ pluginId: CONFIG_PLUGIN.pluginId,
6
6
  name: "middleware",
7
7
  routes: [
8
8
  routeMiddleware
@@ -16,7 +16,7 @@ export const routeMiddlewareSchema = z.object({
16
16
  }).optional()
17
17
  });
18
18
  export const routeMiddleware = buildRoute({
19
- ...CONFIG_PLUGIN,
19
+ pluginId: CONFIG_PLUGIN.pluginId,
20
20
  route: {
21
21
  path: "/",
22
22
  method: "get",
@@ -17,7 +17,7 @@ export const zodChangePasswordSchema = z.object({
17
17
  })
18
18
  });
19
19
  export const changePasswordRoute = buildRoute({
20
- ...CONFIG_PLUGIN,
20
+ pluginId: CONFIG_PLUGIN.pluginId,
21
21
  route: {
22
22
  method: "post",
23
23
  description: "Change user password",
@@ -8,7 +8,7 @@ import { core_users, core_users_forgot_password } from "../../../../database/use
8
8
  import ResetPasswordEmailTemplate from "../../../../emails/reset-password.js";
9
9
  import { CONFIG } from "../../../../lib/config.js";
10
10
  export const resetPasswordRoute = buildRoute({
11
- ...CONFIG_PLUGIN,
11
+ pluginId: CONFIG_PLUGIN.pluginId,
12
12
  route: {
13
13
  method: "post",
14
14
  description: "Request a password reset",
@@ -3,7 +3,7 @@ import { buildRoute } from "../../../lib/route.js";
3
3
  import { SessionAdminModel } from "../../../models/session-admin.js";
4
4
  import { CONFIG_PLUGIN } from "../../../../config.js";
5
5
  export const sessionRoute = buildRoute({
6
- ...CONFIG_PLUGIN,
6
+ pluginId: CONFIG_PLUGIN.pluginId,
7
7
  route: {
8
8
  method: "get",
9
9
  description: "Verify session",
@@ -16,7 +16,7 @@ export const zodSignInSchema = z.object({
16
16
  })
17
17
  });
18
18
  export const signInRoute = buildRoute({
19
- ...CONFIG_PLUGIN,
19
+ pluginId: CONFIG_PLUGIN.pluginId,
20
20
  route: {
21
21
  method: "post",
22
22
  description: "Sign in with email and password",
@@ -4,7 +4,7 @@ import { SessionModel } from "../../../models/session.js";
4
4
  import { SessionAdminModel } from "../../../models/session-admin.js";
5
5
  import { CONFIG_PLUGIN } from "../../../../config.js";
6
6
  export const signOutRoute = buildRoute({
7
- ...CONFIG_PLUGIN,
7
+ pluginId: CONFIG_PLUGIN.pluginId,
8
8
  route: {
9
9
  method: "delete",
10
10
  description: "Sign out the current admin",
@@ -20,7 +20,7 @@ export const zodSignUpSchema = z.object({
20
20
  newsletter: z.boolean().default(false).optional()
21
21
  });
22
22
  export const signUpRoute = buildRoute({
23
- ...CONFIG_PLUGIN,
23
+ pluginId: CONFIG_PLUGIN.pluginId,
24
24
  route: {
25
25
  method: "post",
26
26
  description: "Create a new user",
@@ -2,7 +2,7 @@ import { z } from "zod";
2
2
  import { buildRoute } from "../../../lib/route.js";
3
3
  import { CONFIG_PLUGIN } from "../../../../config.js";
4
4
  export const testRoute = buildRoute({
5
- ...CONFIG_PLUGIN,
5
+ pluginId: CONFIG_PLUGIN.pluginId,
6
6
  route: {
7
7
  method: "post",
8
8
  description: "Test route",
@@ -4,7 +4,7 @@ import { SessionModel } from "../../../../models/session.js";
4
4
  import { SSOModel } from "../../../../models/sso.js";
5
5
  import { CONFIG_PLUGIN } from "../../../../../config.js";
6
6
  export const callbackRoute = buildRoute({
7
- ...CONFIG_PLUGIN,
7
+ pluginId: CONFIG_PLUGIN.pluginId,
8
8
  route: {
9
9
  method: "get",
10
10
  description: "SSO Callback",
@@ -3,7 +3,7 @@ import { buildRoute } from "../../../../lib/route.js";
3
3
  import { SSOModel } from "../../../../models/sso.js";
4
4
  import { CONFIG_PLUGIN } from "../../../../../config.js";
5
5
  export const createUrlRoute = buildRoute({
6
- ...CONFIG_PLUGIN,
6
+ pluginId: CONFIG_PLUGIN.pluginId,
7
7
  route: {
8
8
  method: "post",
9
9
  description: "Generate SSO URL",
@@ -3,7 +3,7 @@ import { CONFIG_PLUGIN } from "../../../../config.js";
3
3
  import { callbackRoute } from "./routes/callback.route.js";
4
4
  import { createUrlRoute } from "./routes/create-url.route.js";
5
5
  export const ssoUserModule = buildModule({
6
- ...CONFIG_PLUGIN,
6
+ pluginId: CONFIG_PLUGIN.pluginId,
7
7
  name: "sso",
8
8
  routes: [
9
9
  callbackRoute,
@@ -9,7 +9,7 @@ import { signUpRoute } from "./routes/sign-up.route.js";
9
9
  import { testRoute } from "./routes/test.route.js";
10
10
  import { ssoUserModule } from "./sso/sso.module.js";
11
11
  export const usersModule = buildModule({
12
- ...CONFIG_PLUGIN,
12
+ pluginId: CONFIG_PLUGIN.pluginId,
13
13
  name: "users",
14
14
  routes: [
15
15
  sessionRoute,
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/api/plugin.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,qBAAqB,6CAGhC,CAAC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/api/plugin.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,qBAAqB,6CAGhC,CAAC"}
@@ -1,13 +1,15 @@
1
1
  import { CONFIG_PLUGIN } from "../config.js";
2
2
  import { buildApiPlugin } from "./lib/plugin.js";
3
3
  import { adminModule } from "./modules/admin/admin.module.js";
4
+ import { cronModule } from "./modules/cron/cron.module.js";
4
5
  import { middlewareModule } from "./modules/middleware/middleware.module.js";
5
6
  import { usersModule } from "./modules/users/users.module.js";
6
7
  export const newBuildPluginApiCore = buildApiPlugin({
7
- ...CONFIG_PLUGIN,
8
+ pluginId: CONFIG_PLUGIN.pluginId,
8
9
  modules: [
9
10
  middlewareModule,
10
11
  usersModule,
11
- adminModule
12
+ adminModule,
13
+ cronModule
12
14
  ]
13
15
  });
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ declare const CronTableView: React.ComponentType<{
3
+ searchParams: Promise<import("../../../../components/table/data-table").SearchParamsDataTable>;
4
+ }>;
5
+ export declare const generateMetadata: () => Promise<{
6
+ title: string;
7
+ description: string;
8
+ }>;
9
+ export default function Page(props: React.ComponentProps<typeof CronTableView>): 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/advanced/cron/page.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,QAAA,MAAM,aAAa;;EAMlB,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;EAO5B,CAAC;AAEF,wBAA8B,IAAI,CAChC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,oDAelD"}
@@ -0,0 +1,42 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import dynamic from "next/dynamic";
3
+ import { getTranslations } from "next-intl/server";
4
+ import React from "react";
5
+ import { I18nProvider } from "../../../../components/i18n-provider.js";
6
+ import { DataTableSkeleton } from "../../../../components/table/data-table.js";
7
+ import { HeaderContent } from "../../../../components/ui/header-content.js";
8
+ const CronTableView = dynamic(async ()=>import("../../../../views/admin/views/core/advanced/cron/cron-table-view.js").then((module)=>({
9
+ default: module.CronTableView
10
+ })));
11
+ export const generateMetadata = async ()=>{
12
+ const t = await getTranslations("admin.advanced.cron");
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.advanced.cron");
20
+ return /*#__PURE__*/ _jsx(I18nProvider, {
21
+ namespaces: [
22
+ "admin.advanced.cron"
23
+ ],
24
+ children: /*#__PURE__*/ _jsxs("div", {
25
+ className: "p-4",
26
+ children: [
27
+ /*#__PURE__*/ _jsx(HeaderContent, {
28
+ h1: t("title"),
29
+ desc: t("desc")
30
+ }),
31
+ /*#__PURE__*/ _jsx(React.Suspense, {
32
+ fallback: /*#__PURE__*/ _jsx(DataTableSkeleton, {
33
+ columns: 6
34
+ }),
35
+ children: /*#__PURE__*/ _jsx(CronTableView, {
36
+ ...props
37
+ })
38
+ })
39
+ ]
40
+ })
41
+ });
42
+ }
@@ -2,4 +2,4 @@ import type { LocaleConfig } from "../../../vitnode.config";
2
2
  export declare const LanguageSwitcher: ({ locales }: {
3
3
  locales: LocaleConfig[];
4
4
  }) => import("react/jsx-runtime").JSX.Element;
5
- //# sourceMappingURL=language-swietcher.d.ts.map
5
+ //# sourceMappingURL=language-switcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"language-switcher.d.ts","sourceRoot":"","sources":["../../../../../src/components/switchers/langs/language-switcher.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAUrD,eAAO,MAAM,gBAAgB,GAAI,aAAa;IAAE,OAAO,EAAE,YAAY,EAAE,CAAA;CAAE,4CAwCxE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { Extensions } from "@tiptap/react";
2
+ export declare const SUPPORTED_HEADINGS_LEVELS: readonly [1, 2, 3, 4];
3
+ export declare const tiptapExtensions: Extensions;
4
+ //# sourceMappingURL=extension.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap/extension.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD,eAAO,MAAM,yBAAyB,uBAAwB,CAAC;AAE/D,eAAO,MAAM,gBAAgB,EAAE,UAgB9B,CAAC"}
@@ -0,0 +1,26 @@
1
+ import StarterKit from "@tiptap/starter-kit";
2
+ export const SUPPORTED_HEADINGS_LEVELS = [
3
+ 1,
4
+ 2,
5
+ 3,
6
+ 4
7
+ ];
8
+ export const tiptapExtensions = [
9
+ StarterKit.configure({
10
+ orderedList: {
11
+ HTMLAttributes: {
12
+ class: "list-decimal"
13
+ }
14
+ },
15
+ bulletList: {
16
+ HTMLAttributes: {
17
+ class: "list-disc"
18
+ }
19
+ },
20
+ heading: {
21
+ levels: [
22
+ ...SUPPORTED_HEADINGS_LEVELS
23
+ ]
24
+ }
25
+ })
26
+ ];
@@ -0,0 +1,2 @@
1
+ export declare const BoldAction: () => import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=bold-action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bold-action.d.ts","sourceRoot":"","sources":["../../../../../../src/components/tiptap/toolbar/actions/bold-action.tsx"],"names":[],"mappings":"AAQA,eAAO,MAAM,UAAU,+CA+BtB,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useEditorState } from "@tiptap/react";
3
+ import { BoldIcon } from "lucide-react";
4
+ import { useTranslations } from "next-intl";
5
+ import { Toggle } from "../../../ui/toggle.js";
6
+ import { TooltipWithContent } from "../../../ui/tooltip.js";
7
+ import { useToolbarEditor } from "../use-toolbar-editor.js";
8
+ import { TooltipShortcut } from "./utils/tooltip-shortcut.js";
9
+ export const BoldAction = ()=>{
10
+ const t = useTranslations("core.global.editor");
11
+ const { editor } = useToolbarEditor();
12
+ const { isBold } = useEditorState({
13
+ editor,
14
+ selector: (ctx)=>{
15
+ return {
16
+ isBold: ctx.editor.isActive("bold")
17
+ };
18
+ }
19
+ });
20
+ return /*#__PURE__*/ _jsx(TooltipWithContent, {
21
+ text: /*#__PURE__*/ _jsxs(_Fragment, {
22
+ children: [
23
+ t("bold"),
24
+ " ",
25
+ /*#__PURE__*/ _jsx(TooltipShortcut, {
26
+ children: "+B"
27
+ })
28
+ ]
29
+ }),
30
+ children: /*#__PURE__*/ _jsx("div", {
31
+ children: /*#__PURE__*/ _jsx(Toggle, {
32
+ "aria-label": t("bold"),
33
+ onClick: ()=>editor.chain().focus().toggleBold().run(),
34
+ pressed: isBold,
35
+ children: /*#__PURE__*/ _jsx(BoldIcon, {})
36
+ })
37
+ })
38
+ });
39
+ };
@@ -0,0 +1,2 @@
1
+ export declare const HeadingsAction: () => import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=headings-action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"headings-action.d.ts","sourceRoot":"","sources":["../../../../../../src/components/tiptap/toolbar/actions/headings-action.tsx"],"names":[],"mappings":"AA+BA,eAAO,MAAM,cAAc,+CAmE1B,CAAC"}
@@ -0,0 +1,94 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEditorState } from "@tiptap/react";
3
+ import { ChevronDown, Heading1Icon, Heading2Icon, Heading3Icon, Heading4Icon, PilcrowIcon } from "lucide-react";
4
+ import { useTranslations } from "next-intl";
5
+ import { Button } from "../../../ui/button.js";
6
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuShortcut, DropdownMenuTrigger } from "../../../ui/dropdown-menu.js";
7
+ import { CtrlOrCommandCharacter } from "../../../../lib/ctrl-or-command-character.js";
8
+ import { cn } from "../../../../lib/utils.js";
9
+ import { SUPPORTED_HEADINGS_LEVELS } from "../../extension.js";
10
+ import { useToolbarEditor } from "../use-toolbar-editor.js";
11
+ const ICONS = {
12
+ paragraph: /*#__PURE__*/ _jsx(PilcrowIcon, {}),
13
+ heading_1: /*#__PURE__*/ _jsx(Heading1Icon, {}),
14
+ heading_2: /*#__PURE__*/ _jsx(Heading2Icon, {}),
15
+ heading_3: /*#__PURE__*/ _jsx(Heading3Icon, {}),
16
+ heading_4: /*#__PURE__*/ _jsx(Heading4Icon, {})
17
+ };
18
+ export const HeadingsAction = ()=>{
19
+ const t = useTranslations("core.global.editor");
20
+ const { editor } = useToolbarEditor();
21
+ const { isParagraph, isHeaderActive } = useEditorState({
22
+ editor,
23
+ selector: (ctx)=>{
24
+ return {
25
+ isParagraph: !ctx.editor.isActive("heading"),
26
+ isHeaderActive: (level)=>ctx.editor.isActive("heading", {
27
+ level
28
+ })
29
+ };
30
+ }
31
+ });
32
+ return /*#__PURE__*/ _jsxs(DropdownMenu, {
33
+ children: [
34
+ /*#__PURE__*/ _jsx(DropdownMenuTrigger, {
35
+ asChild: true,
36
+ children: /*#__PURE__*/ _jsxs(Button, {
37
+ className: "w-32 justify-between",
38
+ variant: "ghost",
39
+ children: [
40
+ isParagraph ? t("paragraph") : t("heading", {
41
+ level: SUPPORTED_HEADINGS_LEVELS.find((level)=>isHeaderActive(level)) ?? 1
42
+ }),
43
+ /*#__PURE__*/ _jsx(ChevronDown, {
44
+ className: "ml-auto"
45
+ })
46
+ ]
47
+ })
48
+ }),
49
+ /*#__PURE__*/ _jsxs(DropdownMenuContent, {
50
+ className: "min-w-[12rem]",
51
+ align: "start",
52
+ children: [
53
+ /*#__PURE__*/ _jsxs(DropdownMenuItem, {
54
+ onClick: ()=>editor.chain().focus().setParagraph().run(),
55
+ className: cn({
56
+ "bg-accent": isParagraph
57
+ }),
58
+ children: [
59
+ ICONS.paragraph,
60
+ t("paragraph"),
61
+ /*#__PURE__*/ _jsxs(DropdownMenuShortcut, {
62
+ children: [
63
+ /*#__PURE__*/ _jsx(CtrlOrCommandCharacter, {}),
64
+ "+Alt+0"
65
+ ]
66
+ })
67
+ ]
68
+ }),
69
+ SUPPORTED_HEADINGS_LEVELS.map((level)=>/*#__PURE__*/ _jsxs(DropdownMenuItem, {
70
+ onClick: ()=>editor.chain().focus().toggleHeading({
71
+ level
72
+ }).run(),
73
+ className: cn({
74
+ "bg-accent": isHeaderActive(level)
75
+ }),
76
+ children: [
77
+ ICONS[`heading_${level}`],
78
+ t("heading", {
79
+ level
80
+ }),
81
+ /*#__PURE__*/ _jsxs(DropdownMenuShortcut, {
82
+ children: [
83
+ /*#__PURE__*/ _jsx(CtrlOrCommandCharacter, {}),
84
+ "+Alt+",
85
+ level
86
+ ]
87
+ })
88
+ ]
89
+ }, level))
90
+ ]
91
+ })
92
+ ]
93
+ });
94
+ };
@@ -0,0 +1,2 @@
1
+ export declare const ItalicAction: () => import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=italic-action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"italic-action.d.ts","sourceRoot":"","sources":["../../../../../../src/components/tiptap/toolbar/actions/italic-action.tsx"],"names":[],"mappings":"AAQA,eAAO,MAAM,YAAY,+CAgCxB,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useEditorState } from "@tiptap/react";
3
+ import { ItalicIcon } from "lucide-react";
4
+ import { useTranslations } from "next-intl";
5
+ import { Toggle } from "../../../ui/toggle.js";
6
+ import { TooltipWithContent } from "../../../ui/tooltip.js";
7
+ import { useToolbarEditor } from "../use-toolbar-editor.js";
8
+ import { TooltipShortcut } from "./utils/tooltip-shortcut.js";
9
+ export const ItalicAction = ()=>{
10
+ const t = useTranslations("core.global.editor");
11
+ const { editor } = useToolbarEditor();
12
+ const { isItalic } = useEditorState({
13
+ editor,
14
+ selector: (ctx)=>{
15
+ return {
16
+ isItalic: ctx.editor.isActive("italic")
17
+ };
18
+ }
19
+ });
20
+ return /*#__PURE__*/ _jsx(TooltipWithContent, {
21
+ text: /*#__PURE__*/ _jsxs(_Fragment, {
22
+ children: [
23
+ t("italic"),
24
+ /*#__PURE__*/ _jsx(TooltipShortcut, {
25
+ children: "+I"
26
+ })
27
+ ]
28
+ }),
29
+ children: /*#__PURE__*/ _jsx("div", {
30
+ children: /*#__PURE__*/ _jsx(Toggle, {
31
+ "aria-label": t("italic"),
32
+ onClick: ()=>editor.chain().focus().toggleItalic().run(),
33
+ pressed: isItalic,
34
+ children: /*#__PURE__*/ _jsx(ItalicIcon, {})
35
+ })
36
+ })
37
+ });
38
+ };
@@ -0,0 +1,2 @@
1
+ export declare const ListAction: () => import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=list-action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-action.d.ts","sourceRoot":"","sources":["../../../../../../src/components/tiptap/toolbar/actions/list-action.tsx"],"names":[],"mappings":"AAQA,eAAO,MAAM,UAAU,+CAqDtB,CAAC"}
@@ -0,0 +1,60 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useEditorState } from "@tiptap/react";
3
+ import { ItalicIcon } from "lucide-react";
4
+ import { useTranslations } from "next-intl";
5
+ import { Toggle } from "../../../ui/toggle.js";
6
+ import { TooltipWithContent } from "../../../ui/tooltip.js";
7
+ import { useToolbarEditor } from "../use-toolbar-editor.js";
8
+ import { TooltipShortcut } from "./utils/tooltip-shortcut.js";
9
+ export const ListAction = ()=>{
10
+ const t = useTranslations("core.global.editor");
11
+ const { editor } = useToolbarEditor();
12
+ const { isItalic } = useEditorState({
13
+ editor,
14
+ selector: (ctx)=>{
15
+ return {
16
+ isItalic: ctx.editor.isActive("italic")
17
+ };
18
+ }
19
+ });
20
+ return /*#__PURE__*/ _jsxs(_Fragment, {
21
+ children: [
22
+ /*#__PURE__*/ _jsx(TooltipWithContent, {
23
+ text: /*#__PURE__*/ _jsxs(_Fragment, {
24
+ children: [
25
+ t("italic"),
26
+ /*#__PURE__*/ _jsx(TooltipShortcut, {
27
+ children: "+I"
28
+ })
29
+ ]
30
+ }),
31
+ children: /*#__PURE__*/ _jsx("div", {
32
+ children: /*#__PURE__*/ _jsx(Toggle, {
33
+ "aria-label": t("italic"),
34
+ onClick: ()=>editor.chain().focus().toggleItalic().run(),
35
+ pressed: isItalic,
36
+ children: /*#__PURE__*/ _jsx(ItalicIcon, {})
37
+ })
38
+ })
39
+ }),
40
+ /*#__PURE__*/ _jsx(TooltipWithContent, {
41
+ text: /*#__PURE__*/ _jsxs(_Fragment, {
42
+ children: [
43
+ t("italic"),
44
+ /*#__PURE__*/ _jsx(TooltipShortcut, {
45
+ children: "+I"
46
+ })
47
+ ]
48
+ }),
49
+ children: /*#__PURE__*/ _jsx("div", {
50
+ children: /*#__PURE__*/ _jsx(Toggle, {
51
+ "aria-label": t("italic"),
52
+ onClick: ()=>editor.chain().focus().toggleItalic().run(),
53
+ pressed: isItalic,
54
+ children: /*#__PURE__*/ _jsx(ItalicIcon, {})
55
+ })
56
+ })
57
+ })
58
+ ]
59
+ });
60
+ };
@@ -0,0 +1,2 @@
1
+ export declare const TextFormatMore: () => import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=text-format-more.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-format-more.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/tiptap/toolbar/actions/text-format-more/text-format-more.tsx"],"names":[],"mappings":"AAeA,eAAO,MAAM,cAAc,+CA+C1B,CAAC"}