@vitnode/core 1.2.0-canary.23 → 1.2.0-canary.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/scripts/plugin.d.ts.map +1 -1
- package/dist/scripts/scripts.js +2 -9
- package/dist/scripts/shared/file-utils.d.ts.map +1 -1
- package/dist/src/api/{plugins → adapters}/email/nodemailer.d.ts +1 -1
- package/dist/src/api/adapters/email/nodemailer.d.ts.map +1 -0
- package/dist/src/api/{plugins → adapters}/email/nodemailer.js +1 -1
- package/dist/src/api/{plugins → adapters}/email/resend.d.ts +1 -1
- package/dist/src/api/adapters/email/resend.d.ts.map +1 -0
- package/dist/src/api/{plugins → adapters}/email/resend.js +1 -1
- package/dist/src/api/adapters/sso/discord.d.ts.map +1 -0
- package/dist/src/api/adapters/sso/facebook.d.ts.map +1 -0
- package/dist/src/api/adapters/sso/google.d.ts.map +1 -0
- package/dist/src/api/config.d.ts.map +1 -1
- package/dist/src/api/config.js +6 -5
- package/dist/src/api/lib/logger-middleware.d.ts +8 -0
- package/dist/src/api/lib/logger-middleware.d.ts.map +1 -0
- package/dist/src/api/lib/logger-middleware.js +30 -0
- package/dist/src/api/lib/route.d.ts +1 -1
- package/dist/src/api/lib/route.d.ts.map +1 -1
- package/dist/src/api/lib/route.js +1 -1
- package/dist/src/api/middlewares/{global/global.d.ts → global.middleware.d.ts} +10 -8
- package/dist/src/api/middlewares/global.middleware.d.ts.map +1 -0
- package/dist/src/api/middlewares/global.middleware.js +86 -0
- package/dist/src/api/middlewares/rate-limiter.middleware.d.ts +4 -0
- package/dist/src/api/middlewares/rate-limiter.middleware.d.ts.map +1 -0
- package/dist/src/api/middlewares/rate-limiter.middleware.js +26 -0
- package/dist/src/api/models/device.d.ts +4 -1
- package/dist/src/api/models/device.d.ts.map +1 -1
- package/dist/src/api/models/device.js +21 -14
- package/dist/src/api/models/email.d.ts +1 -2
- package/dist/src/api/models/email.d.ts.map +1 -1
- package/dist/src/api/models/email.js +9 -16
- package/dist/src/api/models/password.d.ts.map +1 -1
- package/dist/src/api/models/password.js +8 -1
- package/dist/src/api/models/session-admin.d.ts +1 -1
- package/dist/src/api/models/session-admin.d.ts.map +1 -1
- package/dist/src/api/models/session-admin.js +40 -16
- package/dist/src/api/models/session.d.ts +1 -1
- package/dist/src/api/models/session.d.ts.map +1 -1
- package/dist/src/api/models/session.js +28 -12
- package/dist/src/api/models/sso.js +1 -1
- package/dist/src/api/models/user/sign-up.d.ts +1 -1
- package/dist/src/api/models/user/sign-up.d.ts.map +1 -1
- package/dist/src/api/models/user/sign-up.js +2 -3
- package/dist/src/api/models/user.d.ts +1 -1
- package/dist/src/api/models/user.d.ts.map +1 -1
- package/dist/src/api/modules/admin/admin.module.d.ts +161 -8
- package/dist/src/api/modules/admin/admin.module.d.ts.map +1 -1
- package/dist/src/api/modules/admin/admin.module.js +3 -1
- package/dist/src/api/modules/admin/debug/debug.admin.module.d.ts +159 -0
- package/dist/src/api/modules/admin/debug/debug.admin.module.d.ts.map +1 -0
- package/dist/src/api/modules/admin/debug/debug.admin.module.js +10 -0
- package/dist/src/api/modules/admin/debug/routes/logs.route.d.ts +160 -0
- package/dist/src/api/modules/admin/debug/routes/logs.route.d.ts.map +1 -0
- package/dist/src/api/modules/admin/debug/routes/logs.route.js +70 -0
- package/dist/src/api/modules/admin/routes/session.route.d.ts +1 -5
- package/dist/src/api/modules/admin/routes/session.route.d.ts.map +1 -1
- package/dist/src/api/modules/admin/routes/session.route.js +0 -4
- package/dist/src/api/modules/admin/users/routes/list.route.d.ts +1 -1
- package/dist/src/api/modules/admin/users/routes/users.route.d.ts +1 -1
- package/dist/src/api/modules/admin/users/users.admin.module.d.ts +1 -1
- package/dist/src/api/modules/middleware/middleware.module.d.ts +1 -1
- package/dist/src/api/modules/middleware/route.d.ts +1 -1
- package/dist/src/api/modules/middleware/route.d.ts.map +1 -1
- package/dist/src/api/modules/middleware/route.js +2 -4
- package/dist/src/api/modules/users/routes/session.route.d.ts +1 -1
- package/dist/src/api/modules/users/routes/sign-in.route.d.ts +1 -1
- package/dist/src/api/modules/users/routes/sign-out.route.d.ts +1 -1
- package/dist/src/api/modules/users/routes/sign-up.route.d.ts +1 -1
- package/dist/src/api/modules/users/routes/test.route.d.ts +1 -1
- package/dist/src/api/modules/users/routes/test.route.d.ts.map +1 -1
- package/dist/src/api/modules/users/routes/test.route.js +8 -0
- package/dist/src/api/modules/users/sso/routes/callback.route.d.ts +1 -1
- package/dist/src/api/modules/users/sso/routes/create-url.route.d.ts +1 -1
- package/dist/src/api/modules/users/sso/sso.module.d.ts +2 -2
- package/dist/src/api/modules/users/users.module.d.ts +7 -7
- package/dist/src/app_admin/core/debug/page.d.ts +11 -0
- package/dist/src/app_admin/core/debug/page.d.ts.map +1 -0
- package/dist/src/app_admin/core/debug/page.js +44 -0
- package/dist/src/app_admin/core/users/page.d.ts +4 -1
- package/dist/src/app_admin/core/users/page.d.ts.map +1 -1
- package/dist/src/app_admin/core/users/page.js +3 -1
- package/dist/src/components/confirm-action/confirm-action-alert-dialog.d.ts +15 -0
- package/dist/src/components/confirm-action/confirm-action-alert-dialog.d.ts.map +1 -0
- package/dist/src/components/confirm-action/confirm-action-alert-dialog.js +41 -0
- package/dist/src/components/confirm-action/content.d.ts +7 -0
- package/dist/src/components/confirm-action/content.d.ts.map +1 -0
- package/dist/src/components/confirm-action/content.js +31 -0
- package/dist/src/components/date-format.d.ts +2 -1
- package/dist/src/components/date-format.d.ts.map +1 -1
- package/dist/src/components/date-format.js +4 -1
- package/dist/src/components/switchers/langs/language-swietcher.d.ts +5 -0
- package/dist/src/components/switchers/langs/language-swietcher.d.ts.map +1 -0
- package/dist/src/components/switchers/langs/language-swietcher.js +45 -0
- package/dist/src/components/switchers/themes/theme-switcher.d.ts.map +1 -0
- package/dist/src/components/switchers/{theme-switcher.js → themes/theme-switcher.js} +1 -1
- package/dist/src/components/table/data-table.d.ts.map +1 -1
- package/dist/src/components/table/data-table.js +2 -7
- package/dist/src/components/ui/alert-dialog.d.ts +7 -2
- package/dist/src/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/src/components/ui/alert-dialog.js +39 -5
- package/dist/src/database/logs.d.ts +116 -0
- package/dist/src/database/logs.d.ts.map +1 -0
- package/dist/src/database/logs.js +18 -0
- package/dist/src/database/sessions.d.ts +19 -0
- package/dist/src/database/sessions.d.ts.map +1 -1
- package/dist/src/database/sessions.js +3 -0
- package/dist/src/lib/fetcher/core.d.ts +2 -1
- package/dist/src/lib/fetcher/core.d.ts.map +1 -1
- package/dist/src/lib/fetcher/core.js +2 -2
- package/dist/src/lib/fetcher-client.d.ts +2 -1
- package/dist/src/lib/fetcher-client.d.ts.map +1 -1
- package/dist/src/lib/fetcher-client.js +3 -2
- package/dist/src/lib/fetcher.d.ts +2 -1
- package/dist/src/lib/fetcher.d.ts.map +1 -1
- package/dist/src/lib/fetcher.js +2 -1
- package/dist/src/views/admin/layouts/admin-layout.d.ts.map +1 -1
- package/dist/src/views/admin/layouts/admin-layout.js +5 -1
- package/dist/src/views/admin/layouts/user-bar/client.d.ts.map +1 -1
- package/dist/src/views/admin/layouts/user-bar/client.js +26 -18
- package/dist/src/views/admin/views/core/debug/actions/clear-cache/clear-cache.d.ts +2 -0
- package/dist/src/views/admin/views/core/debug/actions/clear-cache/clear-cache.d.ts.map +1 -0
- package/dist/src/views/admin/views/core/debug/actions/clear-cache/clear-cache.js +35 -0
- package/dist/src/views/admin/views/core/debug/actions/clear-cache/mutation-api.d.ts +2 -0
- package/dist/src/views/admin/views/core/debug/actions/clear-cache/mutation-api.d.ts.map +1 -0
- package/dist/src/views/admin/views/core/debug/actions/clear-cache/mutation-api.js +5 -0
- package/dist/src/views/admin/views/core/debug/debug-admin-view.d.ts +4 -0
- package/dist/src/views/admin/views/core/debug/debug-admin-view.d.ts.map +1 -0
- package/dist/src/views/admin/views/core/debug/debug-admin-view.js +110 -0
- package/dist/src/views/auth/sso/buttons/sso-buttons.d.ts +1 -1
- package/dist/src/views/auth/sso/buttons/sso-buttons.d.ts.map +1 -1
- package/dist/src/views/auth/sso/buttons/sso-buttons.js +5 -2
- package/dist/src/views/layouts/theme/header/header.d.ts +4 -1
- package/dist/src/views/layouts/theme/header/header.d.ts.map +1 -1
- package/dist/src/views/layouts/theme/header/header.js +8 -4
- package/dist/src/views/layouts/theme/layout.d.ts +3 -1
- package/dist/src/views/layouts/theme/layout.d.ts.map +1 -1
- package/dist/src/views/layouts/theme/layout.js +4 -3
- package/dist/src/vitnode.config.d.ts +11 -5
- package/dist/src/vitnode.config.d.ts.map +1 -1
- package/dist/src/vitnode.config.js +2 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +39 -22
- package/src/app_admin/core/debug/page.tsx +43 -0
- package/src/app_admin/core/users/page.tsx +6 -1
- package/src/locales/en.json +35 -1
- package/src/vitnode.config.ts +16 -6
- package/dist/src/api/lib/get-user-ip.d.ts +0 -3
- package/dist/src/api/lib/get-user-ip.d.ts.map +0 -1
- package/dist/src/api/lib/get-user-ip.js +0 -8
- package/dist/src/api/middlewares/global/global.d.ts.map +0 -1
- package/dist/src/api/middlewares/global/global.js +0 -47
- package/dist/src/api/plugins/email/nodemailer.d.ts.map +0 -1
- package/dist/src/api/plugins/email/resend.d.ts.map +0 -1
- package/dist/src/api/plugins/sso/discord.d.ts.map +0 -1
- package/dist/src/api/plugins/sso/facebook.d.ts.map +0 -1
- package/dist/src/api/plugins/sso/google.d.ts.map +0 -1
- package/dist/src/components/switchers/theme-switcher.d.ts.map +0 -1
- /package/dist/src/api/{plugins → adapters}/sso/discord.d.ts +0 -0
- /package/dist/src/api/{plugins → adapters}/sso/discord.js +0 -0
- /package/dist/src/api/{plugins → adapters}/sso/facebook.d.ts +0 -0
- /package/dist/src/api/{plugins → adapters}/sso/facebook.js +0 -0
- /package/dist/src/api/{plugins → adapters}/sso/google.d.ts +0 -0
- /package/dist/src/api/{plugins → adapters}/sso/google.js +0 -0
- /package/dist/src/components/switchers/{theme-switcher.d.ts → themes/theme-switcher.d.ts} +0 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { CONFIG_PLUGIN } from "../../../../../config.js";
|
|
3
|
+
import { core_logs, coreLogsType } from "../../../../../database/logs.js";
|
|
4
|
+
import { buildRoute } from "../../../../lib/route.js";
|
|
5
|
+
import { withPagination, zodPaginationPageInfo, zodPaginationQuery } from "../../../../lib/with-pagination.js";
|
|
6
|
+
export const logsDebugAdminRoute = buildRoute({
|
|
7
|
+
...CONFIG_PLUGIN,
|
|
8
|
+
route: {
|
|
9
|
+
method: 'get',
|
|
10
|
+
description: 'Get Admin Debug Logs',
|
|
11
|
+
path: '/logs',
|
|
12
|
+
request: {
|
|
13
|
+
query: zodPaginationQuery.extend({
|
|
14
|
+
order: z.enum([
|
|
15
|
+
'asc',
|
|
16
|
+
'desc'
|
|
17
|
+
]).optional(),
|
|
18
|
+
orderBy: z.enum([
|
|
19
|
+
'type',
|
|
20
|
+
'createdAt',
|
|
21
|
+
'pluginId'
|
|
22
|
+
]).optional()
|
|
23
|
+
})
|
|
24
|
+
},
|
|
25
|
+
responses: {
|
|
26
|
+
200: {
|
|
27
|
+
content: {
|
|
28
|
+
'application/json': {
|
|
29
|
+
schema: z.object({
|
|
30
|
+
edges: z.array(z.object({
|
|
31
|
+
id: z.number(),
|
|
32
|
+
pluginId: z.string(),
|
|
33
|
+
type: z.enum(coreLogsType.enumValues),
|
|
34
|
+
content: z.string(),
|
|
35
|
+
createdAt: z.date(),
|
|
36
|
+
ipAddress: z.string()
|
|
37
|
+
})),
|
|
38
|
+
pageInfo: zodPaginationPageInfo
|
|
39
|
+
})
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
description: 'List of users'
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
handler: async (c)=>{
|
|
47
|
+
const query = c.req.valid('query');
|
|
48
|
+
const data = await withPagination({
|
|
49
|
+
params: {
|
|
50
|
+
query
|
|
51
|
+
},
|
|
52
|
+
primaryCursor: core_logs.id,
|
|
53
|
+
query: async ({ limit, where, orderBy })=>await c.get('db').select({
|
|
54
|
+
id: core_logs.id,
|
|
55
|
+
pluginId: core_logs.pluginId,
|
|
56
|
+
type: core_logs.type,
|
|
57
|
+
content: core_logs.content,
|
|
58
|
+
createdAt: core_logs.createdAt,
|
|
59
|
+
ipAddress: core_logs.ipAddress
|
|
60
|
+
}).from(core_logs).where(where).orderBy(orderBy).limit(limit),
|
|
61
|
+
table: core_logs,
|
|
62
|
+
orderBy: {
|
|
63
|
+
column: query.orderBy ? core_logs[query.orderBy] : core_logs.createdAt,
|
|
64
|
+
order: query.order ?? 'desc'
|
|
65
|
+
},
|
|
66
|
+
c
|
|
67
|
+
});
|
|
68
|
+
return c.json(data);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const sessionAdminRoute: {
|
|
3
|
-
handler: (c: import("hono").Context<import("../../../middlewares/global
|
|
3
|
+
handler: (c: import("hono").Context<import("../../../middlewares/global.middleware").EnvVitNode, "/session", {}>) => Response & import("hono").TypedResponse<{
|
|
4
4
|
user: {
|
|
5
5
|
avatarColor: string;
|
|
6
6
|
birthday: string | null;
|
|
@@ -19,10 +19,6 @@ export declare const sessionAdminRoute: {
|
|
|
19
19
|
route: {
|
|
20
20
|
method: "get";
|
|
21
21
|
description: string;
|
|
22
|
-
pluginConfig: {
|
|
23
|
-
id: string;
|
|
24
|
-
name: string;
|
|
25
|
-
};
|
|
26
22
|
path: "/session";
|
|
27
23
|
responses: {
|
|
28
24
|
200: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.route.d.ts","sourceRoot":"","sources":["../../../../../../src/api/modules/admin/routes/session.route.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"session.route.d.ts","sourceRoot":"","sources":["../../../../../../src/api/modules/admin/routes/session.route.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2C5B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from '@hono/zod-openapi';
|
|
2
2
|
export declare const listUsersAdminRoute: {
|
|
3
|
-
handler: (c: import("hono").Context<import("../../../../middlewares/global
|
|
3
|
+
handler: (c: import("hono").Context<import("../../../../middlewares/global.middleware").EnvVitNode, "/list", {
|
|
4
4
|
in: {
|
|
5
5
|
query: {
|
|
6
6
|
orderBy?: "name" | "createdAt" | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from '@hono/zod-openapi';
|
|
2
2
|
export declare const usersAdminRoute: {
|
|
3
|
-
handler: (c: import("hono").Context<import("../../../../middlewares/global
|
|
3
|
+
handler: (c: import("hono").Context<import("../../../../middlewares/global.middleware").EnvVitNode, "/list", {
|
|
4
4
|
in: {
|
|
5
5
|
query: {
|
|
6
6
|
orderBy?: "id" | "name" | "createdAt" | "email" | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const usersAdminModule: import("../../../../api/lib/module").BuildModuleReturn<"@vitnode/core", "users", [{
|
|
2
|
-
handler: (c: import("hono").Context<import("../../../middlewares/global
|
|
2
|
+
handler: (c: import("hono").Context<import("../../../middlewares/global.middleware").EnvVitNode, "/list", {
|
|
3
3
|
in: {
|
|
4
4
|
query: {
|
|
5
5
|
orderBy?: "name" | "createdAt" | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const middlewareModule: import("../../../api/lib/module").BuildModuleReturn<"@vitnode/core", "middleware", [{
|
|
2
|
-
handler: (c: import("hono").Context<import("../../middlewares/global
|
|
2
|
+
handler: (c: import("hono").Context<import("../../middlewares/global.middleware").EnvVitNode, "/", {}>) => Response & import("hono").TypedResponse<{
|
|
3
3
|
isEmail: boolean;
|
|
4
4
|
sso: {
|
|
5
5
|
id: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const routeMiddleware: {
|
|
3
|
-
handler: (c: import("hono").Context<import("../../middlewares/global
|
|
3
|
+
handler: (c: import("hono").Context<import("../../middlewares/global.middleware").EnvVitNode, "/", {}>) => Response & import("hono").TypedResponse<{
|
|
4
4
|
isEmail: boolean;
|
|
5
5
|
sso: {
|
|
6
6
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../src/api/modules/middleware/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../src/api/modules/middleware/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4B1B,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { buildRoute } from "../../lib/route.js";
|
|
3
|
-
import { EmailModel } from "../../models/email.js";
|
|
4
3
|
import { CONFIG_PLUGIN } from "../../../config.js";
|
|
5
4
|
export const routeMiddleware = buildRoute({
|
|
6
5
|
...CONFIG_PLUGIN,
|
|
@@ -26,10 +25,9 @@ export const routeMiddleware = buildRoute({
|
|
|
26
25
|
}
|
|
27
26
|
},
|
|
28
27
|
handler: (c)=>{
|
|
29
|
-
const sso = c.get('core').authorization.
|
|
30
|
-
const email = new EmailModel(c);
|
|
28
|
+
const sso = c.get('core').authorization.ssoProviders;
|
|
31
29
|
return c.json({
|
|
32
|
-
isEmail:
|
|
30
|
+
isEmail: !!c.get('core').emailAdapter,
|
|
33
31
|
sso: sso.map((s)=>({
|
|
34
32
|
id: s.id,
|
|
35
33
|
name: s.name
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const sessionRoute: {
|
|
3
|
-
handler: (c: import("hono").Context<import("../../../middlewares/global
|
|
3
|
+
handler: (c: import("hono").Context<import("../../../middlewares/global.middleware").EnvVitNode, "/session", {}>) => Promise<Response & import("hono").TypedResponse<{
|
|
4
4
|
user: {
|
|
5
5
|
isAdmin: boolean;
|
|
6
6
|
avatarColor: string;
|
|
@@ -13,7 +13,7 @@ export declare const zodSignInSchema: z.ZodObject<{
|
|
|
13
13
|
isAdmin?: boolean | undefined;
|
|
14
14
|
}>;
|
|
15
15
|
export declare const signInRoute: {
|
|
16
|
-
handler: (c: import("hono").Context<import("../../../middlewares/global
|
|
16
|
+
handler: (c: import("hono").Context<import("../../../middlewares/global.middleware").EnvVitNode, "/sign_in", {
|
|
17
17
|
in: {
|
|
18
18
|
json: {
|
|
19
19
|
email: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from '@hono/zod-openapi';
|
|
2
2
|
export declare const signOutRoute: {
|
|
3
|
-
handler: (c: import("hono").Context<import("../../../middlewares/global
|
|
3
|
+
handler: (c: import("hono").Context<import("../../../middlewares/global.middleware").EnvVitNode, "/sign_out", {
|
|
4
4
|
in: {
|
|
5
5
|
json: {
|
|
6
6
|
isAdmin?: boolean | undefined;
|
|
@@ -16,7 +16,7 @@ export declare const zodSignUpSchema: z.ZodObject<{
|
|
|
16
16
|
newsletter?: boolean | undefined;
|
|
17
17
|
}>;
|
|
18
18
|
export declare const signUpRoute: {
|
|
19
|
-
handler: (c: import("hono").Context<import("../../../middlewares/global
|
|
19
|
+
handler: (c: import("hono").Context<import("../../../middlewares/global.middleware").EnvVitNode, "/sign_up", {
|
|
20
20
|
in: {
|
|
21
21
|
json: {
|
|
22
22
|
name: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const testRoute: {
|
|
3
|
-
handler: (c: import("hono").Context<import("../../../middlewares/global
|
|
3
|
+
handler: (c: import("hono").Context<import("../../../middlewares/global.middleware").EnvVitNode, "/test", {}>) => Response & import("hono").TypedResponse<"test", 200 | 201, "text">;
|
|
4
4
|
pluginId: "@vitnode/core";
|
|
5
5
|
route: {
|
|
6
6
|
method: "get";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.route.d.ts","sourceRoot":"","sources":["../../../../../../src/api/modules/users/routes/test.route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"test.route.d.ts","sourceRoot":"","sources":["../../../../../../src/api/modules/users/routes/test.route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCpB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { buildRoute } from "../../../lib/route.js";
|
|
3
3
|
import { CONFIG_PLUGIN } from "../../../../config.js";
|
|
4
|
+
// import { EmailModel } from '../../../models/email';
|
|
4
5
|
export const testRoute = buildRoute({
|
|
5
6
|
...CONFIG_PLUGIN,
|
|
6
7
|
route: {
|
|
@@ -27,6 +28,13 @@ export const testRoute = buildRoute({
|
|
|
27
28
|
}
|
|
28
29
|
},
|
|
29
30
|
handler: (c)=>{
|
|
31
|
+
// new EmailModel(c).send({
|
|
32
|
+
// html: '<p>Test email</p>',
|
|
33
|
+
// to: 'ithereplay@gmail.com',
|
|
34
|
+
// subject: 'Test Email',
|
|
35
|
+
// });
|
|
36
|
+
// throw new Error('Test error');
|
|
37
|
+
// c.get('log').warn('This is a test warn log');
|
|
30
38
|
return c.text('test');
|
|
31
39
|
}
|
|
32
40
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const callbackRoute: {
|
|
3
|
-
handler: (c: import("hono").Context<import("../../../../middlewares/global
|
|
3
|
+
handler: (c: import("hono").Context<import("../../../../middlewares/global.middleware").EnvVitNode, "/:providerId/callback", {
|
|
4
4
|
in: {
|
|
5
5
|
param: {
|
|
6
6
|
providerId: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const createUrlRoute: {
|
|
3
|
-
handler: (c: import("hono").Context<import("../../../../middlewares/global
|
|
3
|
+
handler: (c: import("hono").Context<import("../../../../middlewares/global.middleware").EnvVitNode, "/:providerId", {
|
|
4
4
|
in: {
|
|
5
5
|
param: {
|
|
6
6
|
providerId: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const ssoUserModule: import("../../../../api/lib/module").BuildModuleReturn<"@vitnode/core", "sso", [{
|
|
2
|
-
handler: (c: import("hono").Context<import("../../../middlewares/global
|
|
2
|
+
handler: (c: import("hono").Context<import("../../../middlewares/global.middleware").EnvVitNode, "/:providerId/callback", {
|
|
3
3
|
in: {
|
|
4
4
|
param: {
|
|
5
5
|
providerId: string;
|
|
@@ -74,7 +74,7 @@ export declare const ssoUserModule: import("../../../../api/lib/module").BuildMo
|
|
|
74
74
|
getRoutingPath: () => "/:providerId/callback";
|
|
75
75
|
};
|
|
76
76
|
}, {
|
|
77
|
-
handler: (c: import("hono").Context<import("../../../middlewares/global
|
|
77
|
+
handler: (c: import("hono").Context<import("../../../middlewares/global.middleware").EnvVitNode, "/:providerId", {
|
|
78
78
|
in: {
|
|
79
79
|
param: {
|
|
80
80
|
providerId: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const usersModule: import("../../../api/lib/module").BuildModuleReturn<"@vitnode/core", "users", [{
|
|
2
|
-
handler: (c: import("hono").Context<import("../../middlewares/global
|
|
2
|
+
handler: (c: import("hono").Context<import("../../middlewares/global.middleware").EnvVitNode, "/session", {}>) => Promise<Response & import("hono").TypedResponse<{
|
|
3
3
|
user: {
|
|
4
4
|
isAdmin: boolean;
|
|
5
5
|
avatarColor: string;
|
|
@@ -99,7 +99,7 @@ export declare const usersModule: import("../../../api/lib/module").BuildModuleR
|
|
|
99
99
|
getRoutingPath: () => "/session";
|
|
100
100
|
};
|
|
101
101
|
}, {
|
|
102
|
-
handler: (c: import("hono").Context<import("../../middlewares/global
|
|
102
|
+
handler: (c: import("hono").Context<import("../../middlewares/global.middleware").EnvVitNode, "/sign_in", {
|
|
103
103
|
in: {
|
|
104
104
|
json: {
|
|
105
105
|
email: string;
|
|
@@ -171,7 +171,7 @@ export declare const usersModule: import("../../../api/lib/module").BuildModuleR
|
|
|
171
171
|
getRoutingPath: () => "/sign_in";
|
|
172
172
|
};
|
|
173
173
|
}, {
|
|
174
|
-
handler: (c: import("hono").Context<import("../../middlewares/global
|
|
174
|
+
handler: (c: import("hono").Context<import("../../middlewares/global.middleware").EnvVitNode, "/sign_out", {
|
|
175
175
|
in: {
|
|
176
176
|
json: {
|
|
177
177
|
isAdmin?: boolean | undefined;
|
|
@@ -215,7 +215,7 @@ export declare const usersModule: import("../../../api/lib/module").BuildModuleR
|
|
|
215
215
|
getRoutingPath: () => "/sign_out";
|
|
216
216
|
};
|
|
217
217
|
}, {
|
|
218
|
-
handler: (c: import("hono").Context<import("../../middlewares/global
|
|
218
|
+
handler: (c: import("hono").Context<import("../../middlewares/global.middleware").EnvVitNode, "/sign_up", {
|
|
219
219
|
in: {
|
|
220
220
|
json: {
|
|
221
221
|
name: string;
|
|
@@ -293,7 +293,7 @@ export declare const usersModule: import("../../../api/lib/module").BuildModuleR
|
|
|
293
293
|
getRoutingPath: () => "/sign_up";
|
|
294
294
|
};
|
|
295
295
|
}, {
|
|
296
|
-
handler: (c: import("hono").Context<import("../../middlewares/global
|
|
296
|
+
handler: (c: import("hono").Context<import("../../middlewares/global.middleware").EnvVitNode, "/test", {}>) => Response & import("hono").TypedResponse<"test", 200 | 201, "text">;
|
|
297
297
|
pluginId: "@vitnode/core";
|
|
298
298
|
route: {
|
|
299
299
|
method: "get";
|
|
@@ -321,7 +321,7 @@ export declare const usersModule: import("../../../api/lib/module").BuildModuleR
|
|
|
321
321
|
getRoutingPath: () => "/test";
|
|
322
322
|
};
|
|
323
323
|
}], import("../../../api/lib/module").BuildModuleReturn<"@vitnode/core", "sso", [{
|
|
324
|
-
handler: (c: import("hono").Context<import("../../middlewares/global
|
|
324
|
+
handler: (c: import("hono").Context<import("../../middlewares/global.middleware").EnvVitNode, "/:providerId/callback", {
|
|
325
325
|
in: {
|
|
326
326
|
param: {
|
|
327
327
|
providerId: string;
|
|
@@ -396,7 +396,7 @@ export declare const usersModule: import("../../../api/lib/module").BuildModuleR
|
|
|
396
396
|
getRoutingPath: () => "/:providerId/callback";
|
|
397
397
|
};
|
|
398
398
|
}, {
|
|
399
|
-
handler: (c: import("hono").Context<import("../../middlewares/global
|
|
399
|
+
handler: (c: import("hono").Context<import("../../middlewares/global.middleware").EnvVitNode, "/:providerId", {
|
|
400
400
|
in: {
|
|
401
401
|
param: {
|
|
402
402
|
providerId: string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const DebugAdminView: React.LazyExoticComponent<({ searchParams, }: {
|
|
3
|
+
searchParams: Promise<Record<string, string | string[] | undefined>>;
|
|
4
|
+
}) => Promise<import("react/jsx-runtime").JSX.Element>>;
|
|
5
|
+
export declare const generateMetadata: () => Promise<{
|
|
6
|
+
title: string;
|
|
7
|
+
description: string;
|
|
8
|
+
}>;
|
|
9
|
+
export default function Page(props: React.ComponentProps<typeof DebugAdminView>): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=page.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../../../src/app_admin/core/debug/page.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,QAAA,MAAM,cAAc;;uDAInB,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;EAO5B,CAAC;AAEF,wBAA8B,IAAI,CAChC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,oDAkBnD"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { getTranslations } from "next-intl/server";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { I18nProvider } from "../../../components/i18n-provider.js";
|
|
5
|
+
import { DataTableSkeleton } from "../../../components/table/data-table.js";
|
|
6
|
+
import { HeaderContent } from "../../../components/ui/header-content.js";
|
|
7
|
+
import { ClearCacheAction } from "../../../views/admin/views/core/debug/actions/clear-cache/clear-cache.js";
|
|
8
|
+
const DebugAdminView = /*#__PURE__*/ React.lazy(async ()=>import("../../../views/admin/views/core/debug/debug-admin-view.js").then((module)=>({
|
|
9
|
+
default: module.DebugAdminView
|
|
10
|
+
})));
|
|
11
|
+
export const generateMetadata = async ()=>{
|
|
12
|
+
const t = await getTranslations('admin.debug');
|
|
13
|
+
return {
|
|
14
|
+
title: t('title'),
|
|
15
|
+
description: t('desc')
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export default async function Page(props) {
|
|
19
|
+
const t = await getTranslations('admin.debug');
|
|
20
|
+
return /*#__PURE__*/ _jsx(I18nProvider, {
|
|
21
|
+
namespaces: "admin.debug",
|
|
22
|
+
children: /*#__PURE__*/ _jsxs("div", {
|
|
23
|
+
className: "p-4",
|
|
24
|
+
children: [
|
|
25
|
+
/*#__PURE__*/ _jsx(HeaderContent, {
|
|
26
|
+
desc: t('desc'),
|
|
27
|
+
h1: t('title'),
|
|
28
|
+
children: /*#__PURE__*/ _jsx(ClearCacheAction, {})
|
|
29
|
+
}),
|
|
30
|
+
/*#__PURE__*/ _jsx(HeaderContent, {
|
|
31
|
+
h2: t('logs.title')
|
|
32
|
+
}),
|
|
33
|
+
/*#__PURE__*/ _jsx(React.Suspense, {
|
|
34
|
+
fallback: /*#__PURE__*/ _jsx(DataTableSkeleton, {
|
|
35
|
+
columns: 4
|
|
36
|
+
}),
|
|
37
|
+
children: /*#__PURE__*/ _jsx(DebugAdminView, {
|
|
38
|
+
...props
|
|
39
|
+
})
|
|
40
|
+
})
|
|
41
|
+
]
|
|
42
|
+
})
|
|
43
|
+
});
|
|
44
|
+
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { Metadata } from 'next/dist/types';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
|
|
3
|
+
declare const UsersAdminView: React.LazyExoticComponent<({ searchParams, }: {
|
|
4
|
+
searchParams: Promise<Record<string, string | string[] | undefined>>;
|
|
5
|
+
}) => Promise<import("react/jsx-runtime").JSX.Element>>;
|
|
4
6
|
export declare const generateMetadata: () => Promise<Metadata>;
|
|
5
7
|
export default function Page(props: React.ComponentProps<typeof UsersAdminView>): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
8
|
+
export {};
|
|
6
9
|
//# sourceMappingURL=page.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../../../src/app_admin/core/users/page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGhD,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../../../src/app_admin/core/users/page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGhD,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,QAAA,MAAM,cAAc;;uDAInB,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAAa,OAAO,CAAC,QAAQ,CAMzD,CAAC;AAEF,wBAA8B,IAAI,CAChC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,oDAgBnD"}
|
|
@@ -3,7 +3,9 @@ import { getTranslations } from "next-intl/server";
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { DataTableSkeleton } from "../../../components/table/data-table.js";
|
|
5
5
|
import { HeaderContent } from "../../../components/ui/header-content.js";
|
|
6
|
-
|
|
6
|
+
const UsersAdminView = /*#__PURE__*/ React.lazy(async ()=>import("../../../views/admin/views/core/users/users-admin-view.js").then((module)=>({
|
|
7
|
+
default: module.UsersAdminView
|
|
8
|
+
})));
|
|
7
9
|
export const generateMetadata = async ()=>{
|
|
8
10
|
const t = await getTranslations('admin.global.nav.users');
|
|
9
11
|
return {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AlertDialog } from '../ui/alert-dialog';
|
|
3
|
+
declare const ContentConfirmAction: React.LazyExoticComponent<({ onSubmit, textSubmit, }: {
|
|
4
|
+
onSubmit: (props: {
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
}) => Promise<void> | void;
|
|
7
|
+
textSubmit?: string;
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element>;
|
|
9
|
+
export declare const ConfirmActionAlertDialog: ({ children, title, description, textSubmit, onSubmit, ...props }: Omit<React.ComponentProps<typeof AlertDialog>, "children"> & React.ComponentProps<typeof ContentConfirmAction> & {
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
description?: React.ReactNode;
|
|
12
|
+
title?: React.ReactNode;
|
|
13
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=confirm-action-alert-dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confirm-action-alert-dialog.d.ts","sourceRoot":"","sources":["../../../../src/components/confirm-action/confirm-action-alert-dialog.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,WAAW,EAOZ,MAAM,oBAAoB,CAAC;AAE5B,QAAA,MAAM,oBAAoB;;;;cACG,CAAC;8CAG7B,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,kEAOtC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,WAAW,CAAC,EAAE,UAAU,CAAC,GAC3D,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,GAAG;IAClD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACzB,4CAqBF,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useTranslations } from "next-intl";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { AlertDialog, AlertDialogContent, AlertDialogDescription, AlertDialogFooterSkeleton, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from "../ui/alert-dialog.js";
|
|
6
|
+
const ContentConfirmAction = /*#__PURE__*/ React.lazy(async ()=>import("./content.js").then((module)=>({
|
|
7
|
+
default: module.ContentConfirmAction
|
|
8
|
+
})));
|
|
9
|
+
export const ConfirmActionAlertDialog = ({ children, title, description, textSubmit, onSubmit, ...props })=>{
|
|
10
|
+
const t = useTranslations('core.global.confirm_action');
|
|
11
|
+
return /*#__PURE__*/ _jsxs(AlertDialog, {
|
|
12
|
+
...props,
|
|
13
|
+
children: [
|
|
14
|
+
/*#__PURE__*/ _jsx(AlertDialogTrigger, {
|
|
15
|
+
asChild: true,
|
|
16
|
+
children: children
|
|
17
|
+
}),
|
|
18
|
+
/*#__PURE__*/ _jsxs(AlertDialogContent, {
|
|
19
|
+
children: [
|
|
20
|
+
/*#__PURE__*/ _jsxs(AlertDialogHeader, {
|
|
21
|
+
children: [
|
|
22
|
+
/*#__PURE__*/ _jsx(AlertDialogTitle, {
|
|
23
|
+
children: title ?? t('title')
|
|
24
|
+
}),
|
|
25
|
+
/*#__PURE__*/ _jsx(AlertDialogDescription, {
|
|
26
|
+
children: description ?? t('desc')
|
|
27
|
+
})
|
|
28
|
+
]
|
|
29
|
+
}),
|
|
30
|
+
/*#__PURE__*/ _jsx(React.Suspense, {
|
|
31
|
+
fallback: /*#__PURE__*/ _jsx(AlertDialogFooterSkeleton, {}),
|
|
32
|
+
children: /*#__PURE__*/ _jsx(ContentConfirmAction, {
|
|
33
|
+
onSubmit: onSubmit,
|
|
34
|
+
textSubmit: textSubmit
|
|
35
|
+
})
|
|
36
|
+
})
|
|
37
|
+
]
|
|
38
|
+
})
|
|
39
|
+
]
|
|
40
|
+
});
|
|
41
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../../src/components/confirm-action/content.tsx"],"names":[],"mappings":"AAUA,eAAO,MAAM,oBAAoB,GAAI,2BAGlC;IACD,QAAQ,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,IAAI,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACnE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,4CAmBA,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslations } from "next-intl";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { AlertDialogCancel, AlertDialogFooter, useAlertDialog } from "../ui/alert-dialog.js";
|
|
5
|
+
import { Button } from "../ui/button.js";
|
|
6
|
+
export const ContentConfirmAction = ({ onSubmit, textSubmit })=>{
|
|
7
|
+
const t = useTranslations('core.global.confirm_action');
|
|
8
|
+
const { setOpen } = useAlertDialog();
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10
|
+
const [_, formAction, isLoading] = React.useActionState(async ()=>{
|
|
11
|
+
await onSubmit({
|
|
12
|
+
onClose: ()=>setOpen?.(false)
|
|
13
|
+
});
|
|
14
|
+
}, null);
|
|
15
|
+
return /*#__PURE__*/ _jsx("form", {
|
|
16
|
+
action: formAction,
|
|
17
|
+
children: /*#__PURE__*/ _jsxs(AlertDialogFooter, {
|
|
18
|
+
children: [
|
|
19
|
+
/*#__PURE__*/ _jsx(AlertDialogCancel, {
|
|
20
|
+
children: t('cancel')
|
|
21
|
+
}),
|
|
22
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
23
|
+
isLoading: isLoading,
|
|
24
|
+
type: "submit",
|
|
25
|
+
variant: "destructive",
|
|
26
|
+
children: textSubmit ?? t('confirm')
|
|
27
|
+
})
|
|
28
|
+
]
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export declare const DateFormat: ({ date, updateInterval, }: {
|
|
1
|
+
export declare const DateFormat: ({ date, updateInterval, showFullDate, }: {
|
|
2
2
|
date: Date | string;
|
|
3
|
+
showFullDate?: boolean;
|
|
3
4
|
updateInterval?: number;
|
|
4
5
|
}) => string | import("react/jsx-runtime").JSX.Element;
|
|
5
6
|
//# sourceMappingURL=date-format.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-format.d.ts","sourceRoot":"","sources":["../../../src/components/date-format.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,UAAU,GAAI,
|
|
1
|
+
{"version":3,"file":"date-format.d.ts","sourceRoot":"","sources":["../../../src/components/date-format.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,UAAU,GAAI,yCAIxB;IACD,IAAI,EAAE,IAAI,GAAG,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,qDAuCA,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useFormatter, useNow } from "next-intl";
|
|
4
4
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./ui/tooltip.js";
|
|
5
|
-
export const DateFormat = ({ date, updateInterval })=>{
|
|
5
|
+
export const DateFormat = ({ date, updateInterval, showFullDate })=>{
|
|
6
6
|
const dateToFormat = typeof date === 'string' ? new Date(date) : date;
|
|
7
7
|
const format = useFormatter();
|
|
8
8
|
const now = useNow({
|
|
@@ -16,6 +16,9 @@ export const DateFormat = ({ date, updateInterval })=>{
|
|
|
16
16
|
hour: 'numeric',
|
|
17
17
|
minute: 'numeric'
|
|
18
18
|
});
|
|
19
|
+
if (showFullDate) {
|
|
20
|
+
return fullDate;
|
|
21
|
+
}
|
|
19
22
|
// When date is < 7 days
|
|
20
23
|
if (now.getTime() - dateToFormat.getTime() < 604800000) {
|
|
21
24
|
return /*#__PURE__*/ _jsx(TooltipProvider, {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"language-swietcher.d.ts","sourceRoot":"","sources":["../../../../../src/components/switchers/langs/language-swietcher.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAYrD,eAAO,MAAM,gBAAgB,GAAI,aAAa;IAAE,OAAO,EAAE,YAAY,EAAE,CAAA;CAAE,4CAuCxE,CAAC"}
|