@vitnode/core 1.2.0-canary.73 → 1.2.0-canary.74

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitnode/core",
3
- "version": "1.2.0-canary.73",
3
+ "version": "1.2.0-canary.74",
4
4
  "description": "Core package for VitNode, providing essential functionalities and configurations.",
5
5
  "author": "VitNode Team",
6
6
  "license": "MIT",
@@ -75,7 +75,7 @@
75
75
  "vite": "^8.0.16",
76
76
  "vitest": "^4.1.8",
77
77
  "zod": "^4.4.3",
78
- "@vitnode/config": "1.2.0-canary.73"
78
+ "@vitnode/config": "1.2.0-canary.74"
79
79
  },
80
80
  "bin": {
81
81
  "vitnode": "./dist/scripts/scripts.js"
@@ -0,0 +1,42 @@
1
+ import { getTranslations } from "next-intl/server";
2
+ import dynamic from "next/dynamic";
3
+ import React from "react";
4
+
5
+ import { I18nProvider } from "@/components/i18n-provider";
6
+ import { DataTableSkeleton } from "@/components/table/data-table";
7
+ import { HeaderContent } from "@/components/ui/header-content";
8
+
9
+ const CronTableView = dynamic(async () =>
10
+ import("@/views/admin/views/core/advanced/cron/cron-table-view").then(
11
+ module => ({
12
+ default: module.CronTableView,
13
+ }),
14
+ ),
15
+ );
16
+
17
+ export const generateMetadata = async () => {
18
+ const t = await getTranslations("admin.advanced.cron");
19
+
20
+ return {
21
+ title: t("title"),
22
+ description: t("desc"),
23
+ };
24
+ };
25
+
26
+ export default async function Page(
27
+ props: React.ComponentProps<typeof CronTableView>,
28
+ ) {
29
+ const t = await getTranslations("admin.advanced.cron");
30
+
31
+ return (
32
+ <I18nProvider namespaces={["admin.advanced.cron"]}>
33
+ <div className="p-4">
34
+ <HeaderContent desc={t("desc")} h1={t("title")} />
35
+
36
+ <React.Suspense fallback={<DataTableSkeleton columns={6} />}>
37
+ <CronTableView {...props} />
38
+ </React.Suspense>
39
+ </div>
40
+ </I18nProvider>
41
+ );
42
+ }
@@ -0,0 +1,46 @@
1
+ import { getTranslations } from "next-intl/server";
2
+ import dynamic from "next/dynamic";
3
+ import React from "react";
4
+
5
+ import { I18nProvider } from "@/components/i18n-provider";
6
+ import { DataTableSkeleton } from "@/components/table/data-table";
7
+ import { HeaderContent } from "@/components/ui/header-content";
8
+ import { ClearCacheAction } from "@/views/admin/views/core/debug/actions/clear-cache/clear-cache";
9
+
10
+ const SystemLogsView = dynamic(async () =>
11
+ import("@/views/admin/views/core/debug/system-logs/system-logs-view").then(
12
+ module => ({
13
+ default: module.SystemLogsView,
14
+ }),
15
+ ),
16
+ );
17
+
18
+ export const generateMetadata = async () => {
19
+ const t = await getTranslations("admin.debug");
20
+
21
+ return {
22
+ title: t("title"),
23
+ description: t("desc"),
24
+ };
25
+ };
26
+
27
+ export default async function Page(
28
+ props: React.ComponentProps<typeof SystemLogsView>,
29
+ ) {
30
+ const t = await getTranslations("admin.debug");
31
+
32
+ return (
33
+ <I18nProvider namespaces="admin.debug">
34
+ <div className="p-4">
35
+ <HeaderContent desc={t("desc")} h1={t("title")}>
36
+ <ClearCacheAction />
37
+ </HeaderContent>
38
+
39
+ <HeaderContent h2={t("logs.title")} />
40
+ <React.Suspense fallback={<DataTableSkeleton columns={4} />}>
41
+ <SystemLogsView {...props} />
42
+ </React.Suspense>
43
+ </div>
44
+ </I18nProvider>
45
+ );
46
+ }
@@ -0,0 +1,5 @@
1
+ import { DashboardAdminView } from "@/views/admin/views/core/dashboard/dashboard-admin-view";
2
+
3
+ export default function Page() {
4
+ return <DashboardAdminView />;
5
+ }
@@ -0,0 +1,5 @@
1
+ import { TestView } from "@/views/admin/views/core/test";
2
+
3
+ export default function Page() {
4
+ return <TestView />;
5
+ }
@@ -0,0 +1,65 @@
1
+ import type { Metadata } from "next/dist/types";
2
+
3
+ import { getTranslations } from "next-intl/server";
4
+ import dynamic from "next/dynamic";
5
+ import React from "react";
6
+
7
+ import { adminModule } from "@/api/modules/admin/admin.module";
8
+ import { I18nProvider } from "@/components/i18n-provider";
9
+ import { Loader } from "@/components/ui/loader";
10
+ import { fetcher } from "@/lib/fetcher";
11
+
12
+ const ShowUserAdminView = dynamic(async () =>
13
+ import("@/views/admin/views/core/users/show/show-user-admin-view").then(
14
+ module => ({
15
+ default: module.ShowUserAdminView,
16
+ }),
17
+ ),
18
+ );
19
+
20
+ export const generateMetadata = async ({
21
+ params,
22
+ }: {
23
+ params: Promise<{ nameCode: string }>;
24
+ }): Promise<Metadata> => {
25
+ const { nameCode } = await params;
26
+ const t = await getTranslations("admin.user.show");
27
+ const res = await fetcher(adminModule, {
28
+ path: "/{nameCode}",
29
+ method: "get",
30
+ module: "admin/users",
31
+ args: {
32
+ params: { nameCode },
33
+ },
34
+ });
35
+
36
+ if (!res.ok) {
37
+ return {
38
+ title: t("title"),
39
+ };
40
+ }
41
+
42
+ const data = await res.json();
43
+
44
+ return {
45
+ title: `${data.name} - ${t("title")}`,
46
+ };
47
+ };
48
+
49
+ export default async function Page({
50
+ params,
51
+ }: {
52
+ params: Promise<{ nameCode: string }>;
53
+ }) {
54
+ const { nameCode } = await params;
55
+
56
+ return (
57
+ <I18nProvider namespaces="admin.user">
58
+ <div className="p-4">
59
+ <React.Suspense fallback={<Loader />}>
60
+ <ShowUserAdminView nameCode={nameCode} />
61
+ </React.Suspense>
62
+ </div>
63
+ </I18nProvider>
64
+ );
65
+ }
@@ -0,0 +1,47 @@
1
+ import type { Metadata } from "next/dist/types";
2
+
3
+ import { getTranslations } from "next-intl/server";
4
+ import dynamic from "next/dynamic";
5
+ import React from "react";
6
+
7
+ import { I18nProvider } from "@/components/i18n-provider";
8
+ import { DataTableSkeleton } from "@/components/table/data-table";
9
+ import { HeaderContent } from "@/components/ui/header-content";
10
+ import { CreateUserAdmin } from "@/views/admin/views/core/users/actions/create/create";
11
+
12
+ const UsersAdminView = dynamic(async () =>
13
+ import("@/views/admin/views/core/users/users-admin-view").then(module => ({
14
+ default: module.UsersAdminView,
15
+ })),
16
+ );
17
+
18
+ export const generateMetadata = async (): Promise<Metadata> => {
19
+ const t = await getTranslations("admin.global.nav.users");
20
+
21
+ return {
22
+ title: t("list"),
23
+ };
24
+ };
25
+
26
+ export default async function Page(
27
+ props: React.ComponentProps<typeof UsersAdminView>,
28
+ ) {
29
+ const [t, tNav] = await Promise.all([
30
+ getTranslations("admin.user.list"),
31
+ getTranslations("admin.global.nav.users"),
32
+ ]);
33
+
34
+ return (
35
+ <I18nProvider namespaces="admin.user">
36
+ <div className="p-4">
37
+ <HeaderContent desc={t("desc")} h1={tNav("list")}>
38
+ <CreateUserAdmin />
39
+ </HeaderContent>
40
+
41
+ <React.Suspense fallback={<DataTableSkeleton columns={2} />}>
42
+ <UsersAdminView {...props} />
43
+ </React.Suspense>
44
+ </div>
45
+ </I18nProvider>
46
+ );
47
+ }
@@ -0,0 +1,46 @@
1
+ import type { Metadata } from "next/dist/types";
2
+
3
+ import { getTranslations } from "next-intl/server";
4
+ import dynamic from "next/dynamic";
5
+ import React from "react";
6
+
7
+ import { I18nProvider } from "@/components/i18n-provider";
8
+ import { DataTableSkeleton } from "@/components/table/data-table";
9
+ import { HeaderContent } from "@/components/ui/header-content";
10
+
11
+ const RolesAdminView = dynamic(async () =>
12
+ import("@/views/admin/views/core/users/roles/roles-admin-view").then(
13
+ module => ({
14
+ default: module.RolesAdminView,
15
+ }),
16
+ ),
17
+ );
18
+
19
+ export const generateMetadata = async (): Promise<Metadata> => {
20
+ const t = await getTranslations("admin.global.nav.users");
21
+
22
+ return {
23
+ title: t("roles"),
24
+ };
25
+ };
26
+
27
+ export default async function Page(
28
+ props: React.ComponentProps<typeof RolesAdminView>,
29
+ ) {
30
+ const [t, tNav] = await Promise.all([
31
+ getTranslations("admin.role.list"),
32
+ getTranslations("admin.global.nav.users"),
33
+ ]);
34
+
35
+ return (
36
+ <I18nProvider namespaces="admin.role">
37
+ <div className="p-4">
38
+ <HeaderContent desc={t("desc")} h1={tNav("roles")} />
39
+
40
+ <React.Suspense fallback={<DataTableSkeleton columns={2} />}>
41
+ <RolesAdminView {...props} />
42
+ </React.Suspense>
43
+ </div>
44
+ </I18nProvider>
45
+ );
46
+ }
@@ -0,0 +1,11 @@
1
+ export default function Page() {
2
+ return (
3
+ <div className="flex min-h-screen flex-col items-center justify-center gap-2 text-center">
4
+ <h1 className="text-2xl font-bold">Blank test page</h1>
5
+ <p className="text-muted-foreground">
6
+ This page renders without the main layout — no header or footer, just
7
+ the root providers.
8
+ </p>
9
+ </div>
10
+ );
11
+ }
@@ -0,0 +1,17 @@
1
+ import { BreadcrumbAdmin } from "@/views/admin/layouts/breadcrumb/breadcrumb-admin";
2
+
3
+ // Generic catch-all breadcrumb for every authenticated admin route (core +
4
+ // plugins). More specific slot folders (e.g. core/users/[nameCode]) override it.
5
+ //
6
+ // NOTE: must live at the `@breadcrumb` slot ROOT (not under a `(plugins)` route
7
+ // group) — a parallel-route slot only matches `children` sharing its route-group
8
+ // structure, so a nested catch-all would miss pages from other plugin groups.
9
+ export default async function BreadcrumbSlot({
10
+ params,
11
+ }: {
12
+ params: Promise<{ all?: string[] }>;
13
+ }) {
14
+ const { all } = await params;
15
+
16
+ return <BreadcrumbAdmin segments={all ?? []} />;
17
+ }
@@ -0,0 +1,12 @@
1
+ import { BreadcrumbUserAdmin } from "@/views/admin/layouts/breadcrumb/breadcrumb-user-admin";
2
+
3
+ // Resolves the real user name server-side for the user detail breadcrumb.
4
+ export default async function BreadcrumbSlot({
5
+ params,
6
+ }: {
7
+ params: Promise<{ nameCode: string }>;
8
+ }) {
9
+ const { nameCode } = await params;
10
+
11
+ return <BreadcrumbUserAdmin nameCode={nameCode} />;
12
+ }
@@ -0,0 +1,4 @@
1
+ // Fallback for the @breadcrumb slot on unmatched soft-navigation/hard loads.
2
+ export default function Default() {
3
+ return null;
4
+ }
@@ -0,0 +1,17 @@
1
+ import { BreadcrumbMain } from "@/views/breadcrumb/breadcrumb-main";
2
+
3
+ // Generic catch-all breadcrumb for public pages: humanizes URL segments.
4
+ // Specific slot folders (login, register, …) override it with translated labels.
5
+ //
6
+ // NOTE: must live at the `@breadcrumb` slot ROOT (not under a `(plugins)` route
7
+ // group) — a parallel-route slot only matches `children` sharing its route-group
8
+ // structure, so a nested catch-all would miss pages outside that group.
9
+ export default async function BreadcrumbSlot({
10
+ params,
11
+ }: {
12
+ params: Promise<{ rest?: string[] }>;
13
+ }) {
14
+ const { rest } = await params;
15
+
16
+ return <BreadcrumbMain segments={rest ?? []} />;
17
+ }
@@ -0,0 +1,4 @@
1
+ // Fallback for the @breadcrumb slot on unmatched soft-navigation/hard loads.
2
+ export default function Default() {
3
+ return null;
4
+ }
@@ -0,0 +1,11 @@
1
+ import { getTranslations } from "next-intl/server";
2
+
3
+ import { BreadcrumbMain } from "@/views/breadcrumb/breadcrumb-main";
4
+
5
+ export default async function BreadcrumbSlot() {
6
+ const t = await getTranslations("core.global");
7
+
8
+ return (
9
+ <BreadcrumbMain labels={{ "/login": t("login") }} segments={["login"]} />
10
+ );
11
+ }
@@ -0,0 +1,20 @@
1
+ import { getTranslations } from "next-intl/server";
2
+
3
+ import { BreadcrumbMain } from "@/views/breadcrumb/breadcrumb-main";
4
+
5
+ export default async function BreadcrumbSlot() {
6
+ const [tGlobal, tAuth] = await Promise.all([
7
+ getTranslations("core.global"),
8
+ getTranslations("core.auth"),
9
+ ]);
10
+
11
+ return (
12
+ <BreadcrumbMain
13
+ labels={{
14
+ "/login": tGlobal("login"),
15
+ "/login/reset-password": tAuth("reset_password.title"),
16
+ }}
17
+ segments={["login", "reset-password"]}
18
+ />
19
+ );
20
+ }
@@ -0,0 +1,6 @@
1
+ // Home page (/) has no breadcrumb. An explicit slot page (not just default.tsx)
2
+ // is required so client-side navigation back to "/" clears a previously-rendered
3
+ // breadcrumb — otherwise Next.js keeps the slot's stale active state on soft nav.
4
+ export default function BreadcrumbSlot() {
5
+ return null;
6
+ }
@@ -0,0 +1,14 @@
1
+ import { getTranslations } from "next-intl/server";
2
+
3
+ import { BreadcrumbMain } from "@/views/breadcrumb/breadcrumb-main";
4
+
5
+ export default async function BreadcrumbSlot() {
6
+ const t = await getTranslations("core.global");
7
+
8
+ return (
9
+ <BreadcrumbMain
10
+ labels={{ "/register": t("register") }}
11
+ segments={["register"]}
12
+ />
13
+ );
14
+ }
@@ -0,0 +1,22 @@
1
+ import type { Metadata } from "next/dist/types";
2
+
3
+ import { getTranslations } from "next-intl/server";
4
+
5
+ import { SignInView } from "@/views/auth/sign-in/sign-in-view";
6
+
7
+ export const generateMetadata = async ({
8
+ params,
9
+ }: {
10
+ params: Promise<{ locale: string }>;
11
+ }): Promise<Metadata> => {
12
+ const { locale } = await params;
13
+ const t = await getTranslations({ locale, namespace: "core.global" });
14
+
15
+ return {
16
+ title: t("login"),
17
+ };
18
+ };
19
+
20
+ export default function Page() {
21
+ return <SignInView />;
22
+ }
@@ -0,0 +1,27 @@
1
+ import type { Metadata } from "next/dist/types";
2
+
3
+ import { getTranslations } from "next-intl/server";
4
+
5
+ import { PasswordResetView } from "@/views/auth/password-reset/password-reset-view";
6
+
7
+ export const generateMetadata = async ({
8
+ params,
9
+ }: {
10
+ params: Promise<{ locale: string }>;
11
+ }): Promise<Metadata> => {
12
+ const { locale } = await params;
13
+ const t = await getTranslations({
14
+ locale,
15
+ namespace: "core.auth.reset_password",
16
+ });
17
+
18
+ return {
19
+ title: t("title"),
20
+ };
21
+ };
22
+
23
+ export default function Page(
24
+ props: React.ComponentProps<typeof PasswordResetView>,
25
+ ) {
26
+ return <PasswordResetView {...props} />;
27
+ }
@@ -0,0 +1,19 @@
1
+ import { CallbackSSOView } from "@/views/auth/sso/callback/callback-sso-view";
2
+
3
+ export default async function Page({
4
+ params,
5
+ searchParams,
6
+ }: {
7
+ params: Promise<{ providerId: string }>;
8
+ searchParams: Promise<Record<string, string>>;
9
+ }) {
10
+ const { providerId } = await params;
11
+ const currentSearchParams = await searchParams;
12
+
13
+ return (
14
+ <CallbackSSOView
15
+ providerId={providerId}
16
+ searchParams={currentSearchParams}
17
+ />
18
+ );
19
+ }
@@ -0,0 +1,22 @@
1
+ import type { Metadata } from "next/dist/types";
2
+
3
+ import { getTranslations } from "next-intl/server";
4
+
5
+ import { SignUpView } from "@/views/auth/sign-up/sign-up-view";
6
+
7
+ export const generateMetadata = async ({
8
+ params,
9
+ }: {
10
+ params: Promise<{ locale: string }>;
11
+ }): Promise<Metadata> => {
12
+ const { locale } = await params;
13
+ const t = await getTranslations({ locale, namespace: "core.global" });
14
+
15
+ return {
16
+ title: t("register"),
17
+ };
18
+ };
19
+
20
+ export default function Page() {
21
+ return <SignUpView />;
22
+ }