@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.
- package/dist/scripts/prepare-database.d.ts +0 -1
- package/dist/scripts/prepare-database.d.ts.map +1 -1
- package/dist/scripts/scripts.js +4 -4
- package/dist/src/api/adapters/cron/node-cron.adapter.d.ts +3 -0
- package/dist/src/api/adapters/cron/node-cron.adapter.d.ts.map +1 -0
- package/dist/src/api/adapters/cron/node-cron.adapter.js +11 -0
- package/dist/src/api/config.d.ts.map +1 -1
- package/dist/src/api/config.js +21 -9
- package/dist/src/api/lib/cron.d.ts +18 -0
- package/dist/src/api/lib/cron.d.ts.map +1 -0
- package/dist/src/api/lib/cron.js +22 -0
- package/dist/src/api/lib/module.d.ts +4 -1
- package/dist/src/api/lib/module.d.ts.map +1 -1
- package/dist/src/api/lib/module.js +3 -2
- package/dist/src/api/lib/plugin.d.ts +2 -0
- package/dist/src/api/lib/plugin.d.ts.map +1 -1
- package/dist/src/api/lib/plugin.js +9 -1
- package/dist/src/api/middlewares/cron-auth.middleware.d.ts +3 -0
- package/dist/src/api/middlewares/cron-auth.middleware.d.ts.map +1 -0
- package/dist/src/api/middlewares/cron-auth.middleware.js +19 -0
- package/dist/src/api/middlewares/global.middleware.d.ts +6 -0
- package/dist/src/api/middlewares/global.middleware.d.ts.map +1 -1
- package/dist/src/api/middlewares/global.middleware.js +33 -22
- package/dist/src/api/models/user/sign-up.d.ts +1 -1
- package/dist/src/api/models/user.d.ts +1 -1
- package/dist/src/api/modules/admin/admin.module.d.ts +163 -1
- package/dist/src/api/modules/admin/admin.module.d.ts.map +1 -1
- package/dist/src/api/modules/admin/admin.module.js +6 -3
- package/dist/src/api/modules/admin/advanced/advanced.admin.module.d.ts +164 -0
- package/dist/src/api/modules/admin/advanced/advanced.admin.module.d.ts.map +1 -0
- package/dist/src/api/modules/admin/advanced/advanced.admin.module.js +11 -0
- package/dist/src/api/modules/admin/advanced/cron/cron.admin.module.d.ts +164 -0
- package/dist/src/api/modules/admin/advanced/cron/cron.admin.module.d.ts.map +1 -0
- package/dist/src/api/modules/admin/advanced/cron/cron.admin.module.js +12 -0
- package/dist/src/api/modules/admin/advanced/cron/routes/get.route.d.ts +98 -0
- package/dist/src/api/modules/admin/advanced/cron/routes/get.route.d.ts.map +1 -0
- package/dist/src/api/modules/admin/advanced/cron/routes/get.route.js +66 -0
- package/dist/src/api/modules/admin/advanced/cron/routes/run.route.d.ts +70 -0
- package/dist/src/api/modules/admin/advanced/cron/routes/run.route.d.ts.map +1 -0
- package/dist/src/api/modules/admin/advanced/cron/routes/run.route.js +95 -0
- package/dist/src/api/modules/admin/debug/debug.admin.module.js +1 -1
- package/dist/src/api/modules/admin/debug/routes/logs.route.js +1 -1
- package/dist/src/api/modules/admin/routes/session.route.js +1 -1
- package/dist/src/api/modules/admin/users/routes/list.route.js +1 -1
- package/dist/src/api/modules/admin/users/routes/users.route.d.ts +3 -3
- package/dist/src/api/modules/admin/users/routes/users.route.js +1 -1
- package/dist/src/api/modules/admin/users/users.admin.module.js +1 -1
- package/dist/src/api/modules/cron/cron/clean.cron.d.ts +2 -0
- package/dist/src/api/modules/cron/cron/clean.cron.d.ts.map +1 -0
- package/dist/src/api/modules/cron/cron/clean.cron.js +24 -0
- package/dist/src/api/modules/cron/cron.module.d.ts +26 -0
- package/dist/src/api/modules/cron/cron.module.d.ts.map +1 -0
- package/dist/src/api/modules/cron/cron.module.js +14 -0
- package/dist/src/api/modules/cron/helpers/process-cron-jobs.d.ts +36 -0
- package/dist/src/api/modules/cron/helpers/process-cron-jobs.d.ts.map +1 -0
- package/dist/src/api/modules/cron/helpers/process-cron-jobs.js +72 -0
- package/dist/src/api/modules/cron/routes/cron.route.d.ts +27 -0
- package/dist/src/api/modules/cron/routes/cron.route.d.ts.map +1 -0
- package/dist/src/api/modules/cron/routes/cron.route.js +95 -0
- package/dist/src/api/modules/middleware/middleware.module.js +1 -1
- package/dist/src/api/modules/middleware/route.js +1 -1
- package/dist/src/api/modules/users/routes/change-password.route.js +1 -1
- package/dist/src/api/modules/users/routes/reset-passowrd.route.js +1 -1
- package/dist/src/api/modules/users/routes/session.route.js +1 -1
- package/dist/src/api/modules/users/routes/sign-in.route.js +1 -1
- package/dist/src/api/modules/users/routes/sign-out.route.js +1 -1
- package/dist/src/api/modules/users/routes/sign-up.route.js +1 -1
- package/dist/src/api/modules/users/routes/test.route.js +1 -1
- package/dist/src/api/modules/users/sso/routes/callback.route.js +1 -1
- package/dist/src/api/modules/users/sso/routes/create-url.route.js +1 -1
- package/dist/src/api/modules/users/sso/sso.module.js +1 -1
- package/dist/src/api/modules/users/users.module.js +1 -1
- package/dist/src/api/plugin.d.ts.map +1 -1
- package/dist/src/api/plugin.js +4 -2
- package/dist/src/app_admin/core/advanced/cron/page.d.ts +11 -0
- package/dist/src/app_admin/core/advanced/cron/page.d.ts.map +1 -0
- package/dist/src/app_admin/core/advanced/cron/page.js +42 -0
- package/dist/src/components/switchers/langs/{language-swietcher.d.ts → language-switcher.d.ts} +1 -1
- package/dist/src/components/switchers/langs/language-switcher.d.ts.map +1 -0
- package/dist/src/components/tiptap/extension.d.ts +4 -0
- package/dist/src/components/tiptap/extension.d.ts.map +1 -0
- package/dist/src/components/tiptap/extension.js +26 -0
- package/dist/src/components/tiptap/toolbar/actions/bold-action.d.ts +2 -0
- package/dist/src/components/tiptap/toolbar/actions/bold-action.d.ts.map +1 -0
- package/dist/src/components/tiptap/toolbar/actions/bold-action.js +39 -0
- package/dist/src/components/tiptap/toolbar/actions/headings-action.d.ts +2 -0
- package/dist/src/components/tiptap/toolbar/actions/headings-action.d.ts.map +1 -0
- package/dist/src/components/tiptap/toolbar/actions/headings-action.js +94 -0
- package/dist/src/components/tiptap/toolbar/actions/italic-action.d.ts +2 -0
- package/dist/src/components/tiptap/toolbar/actions/italic-action.d.ts.map +1 -0
- package/dist/src/components/tiptap/toolbar/actions/italic-action.js +38 -0
- package/dist/src/components/tiptap/toolbar/actions/list-action.d.ts +2 -0
- package/dist/src/components/tiptap/toolbar/actions/list-action.d.ts.map +1 -0
- package/dist/src/components/tiptap/toolbar/actions/list-action.js +60 -0
- package/dist/src/components/tiptap/toolbar/actions/text-format-more/text-format-more.d.ts +2 -0
- package/dist/src/components/tiptap/toolbar/actions/text-format-more/text-format-more.d.ts.map +1 -0
- package/dist/src/components/tiptap/toolbar/actions/text-format-more/text-format-more.js +59 -0
- package/dist/src/components/tiptap/toolbar/actions/underline-action.d.ts +2 -0
- package/dist/src/components/tiptap/toolbar/actions/underline-action.d.ts.map +1 -0
- package/dist/src/components/tiptap/toolbar/actions/underline-action.js +38 -0
- package/dist/src/components/tiptap/toolbar/actions/undo-redo-actions.d.ts +2 -0
- package/dist/src/components/tiptap/toolbar/actions/undo-redo-actions.d.ts.map +1 -0
- package/dist/src/components/tiptap/toolbar/actions/undo-redo-actions.js +63 -0
- package/dist/src/components/tiptap/toolbar/actions/utils/tooltip-shortcut.d.ts +4 -0
- package/dist/src/components/tiptap/toolbar/actions/utils/tooltip-shortcut.d.ts.map +1 -0
- package/dist/src/components/tiptap/toolbar/actions/utils/tooltip-shortcut.js +11 -0
- package/dist/src/components/tiptap/toolbar/tiptap-toolbar.d.ts +5 -0
- package/dist/src/components/tiptap/toolbar/tiptap-toolbar.d.ts.map +1 -0
- package/dist/src/components/tiptap/toolbar/tiptap-toolbar.js +35 -0
- package/dist/src/components/tiptap/toolbar/use-toolbar-editor.d.ts +9 -0
- package/dist/src/components/tiptap/toolbar/use-toolbar-editor.d.ts.map +1 -0
- package/dist/src/components/tiptap/toolbar/use-toolbar-editor.js +5 -0
- package/dist/src/components/ui/button-client.d.ts.map +1 -1
- package/dist/src/components/ui/button-client.js +1 -1
- package/dist/src/components/ui/button.js +1 -1
- package/dist/src/components/ui/editor-content.d.ts +4 -0
- package/dist/src/components/ui/editor-content.d.ts.map +1 -0
- package/dist/src/components/ui/editor-content.js +10 -0
- package/dist/src/components/ui/editor.d.ts +6 -0
- package/dist/src/components/ui/editor.d.ts.map +1 -0
- package/dist/src/components/ui/editor.js +35 -0
- package/dist/src/components/ui/sidebar.js +14 -14
- package/dist/src/components/ui/table.js +1 -1
- package/dist/src/components/ui/tooltip.d.ts +4 -1
- package/dist/src/components/ui/tooltip.d.ts.map +1 -1
- package/dist/src/components/ui/tooltip.js +18 -2
- package/dist/src/database/cron.d.ts +171 -0
- package/dist/src/database/cron.d.ts.map +1 -0
- package/dist/src/database/cron.js +22 -0
- package/dist/src/database/users.d.ts +2 -2
- package/dist/src/database/users.js +1 -1
- package/dist/src/lib/api/get-next-cron-run-date.d.ts +2 -0
- package/dist/src/lib/api/get-next-cron-run-date.d.ts.map +1 -0
- package/dist/src/lib/api/get-next-cron-run-date.js +14 -0
- package/dist/src/lib/api/get-next-cron-run-date.test.d.ts +2 -0
- package/dist/src/lib/api/get-next-cron-run-date.test.d.ts.map +1 -0
- package/dist/src/lib/api/get-next-cron-run-date.test.js +55 -0
- package/dist/src/lib/api/should-cron-job-run.d.ts +2 -0
- package/dist/src/lib/api/should-cron-job-run.d.ts.map +1 -0
- package/dist/src/lib/api/should-cron-job-run.js +16 -0
- package/dist/src/lib/api/should-cron-job-run.test.d.ts +2 -0
- package/dist/src/lib/api/should-cron-job-run.test.d.ts.map +1 -0
- package/dist/src/lib/api/should-cron-job-run.test.js +213 -0
- package/dist/src/lib/config.d.ts +1 -0
- package/dist/src/lib/config.d.ts.map +1 -1
- package/dist/src/lib/config.js +7 -5
- package/dist/src/lib/ctrl-or-command-character.d.ts +2 -0
- package/dist/src/lib/ctrl-or-command-character.d.ts.map +1 -0
- package/dist/src/lib/ctrl-or-command-character.js +9 -0
- package/dist/src/lib/navigation.d.ts +1 -1
- package/dist/src/lib/navigation.d.ts.map +1 -1
- package/dist/src/views/admin/layouts/admin-layout.js +1 -1
- package/dist/src/views/admin/layouts/sidebar/nav/item.d.ts.map +1 -1
- package/dist/src/views/admin/layouts/sidebar/nav/item.js +0 -3
- package/dist/src/views/admin/layouts/sidebar/nav/nav.d.ts.map +1 -1
- package/dist/src/views/admin/layouts/sidebar/nav/nav.js +12 -1
- package/dist/src/views/admin/views/core/advanced/cron/cron-table-view.d.ts +5 -0
- package/dist/src/views/admin/views/core/advanced/cron/cron-table-view.d.ts.map +1 -0
- package/dist/src/views/admin/views/core/advanced/cron/cron-table-view.js +97 -0
- package/dist/src/views/admin/views/core/advanced/cron/run-action/mutation-api.d.ts +4 -0
- package/dist/src/views/admin/views/core/advanced/cron/run-action/mutation-api.d.ts.map +1 -0
- package/dist/src/views/admin/views/core/advanced/cron/run-action/mutation-api.js +23 -0
- package/dist/src/views/admin/views/core/advanced/cron/run-action/run-action.d.ts +4 -0
- package/dist/src/views/admin/views/core/advanced/cron/run-action/run-action.d.ts.map +1 -0
- package/dist/src/views/admin/views/core/advanced/cron/run-action/run-action.js +37 -0
- package/dist/src/views/admin/views/core/debug/system-logs/actions/more/more.d.ts.map +1 -1
- package/dist/src/views/admin/views/core/debug/system-logs/actions/more/more.js +11 -20
- package/dist/src/views/admin/views/core/test.d.ts.map +1 -1
- package/dist/src/views/admin/views/core/test.js +116 -106
- package/dist/src/views/layouts/theme/header/header.js +1 -1
- package/dist/src/vitnode.config.d.ts +2 -0
- package/dist/src/vitnode.config.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +32 -26
- package/src/app_admin/core/advanced/cron/page.tsx +41 -0
- package/src/locales/en.json +43 -0
- package/src/tiptap.css +20 -0
- package/dist/src/components/switchers/langs/language-swietcher.d.ts.map +0 -1
- /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
|
-
|
|
5
|
+
pluginId: CONFIG_PLUGIN.pluginId,
|
|
6
6
|
name: "middleware",
|
|
7
7
|
routes: [
|
|
8
8
|
routeMiddleware
|
|
@@ -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
|
-
|
|
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
|
-
|
|
6
|
+
pluginId: CONFIG_PLUGIN.pluginId,
|
|
7
7
|
route: {
|
|
8
8
|
method: "get",
|
|
9
9
|
description: "Verify session",
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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":"
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/api/plugin.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,qBAAqB,6CAGhC,CAAC"}
|
package/dist/src/api/plugin.js
CHANGED
|
@@ -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
|
-
|
|
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
|
+
}
|
package/dist/src/components/switchers/langs/{language-swietcher.d.ts → language-switcher.d.ts}
RENAMED
|
@@ -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-
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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"}
|