@lastbrain/app 2.0.18 → 2.0.21
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/app-shell/not-found.js +2 -2
- package/dist/components/LanguageSwitcher.d.ts +7 -0
- package/dist/components/LanguageSwitcher.d.ts.map +1 -0
- package/dist/components/LanguageSwitcher.js +62 -0
- package/dist/config/version.d.ts.map +1 -1
- package/dist/config/version.js +19 -21
- package/dist/i18n/LanguageProvider.d.ts +4 -0
- package/dist/i18n/LanguageProvider.d.ts.map +1 -0
- package/dist/i18n/LanguageProvider.js +6 -0
- package/dist/i18n/TranslationsScript.d.ts +8 -0
- package/dist/i18n/TranslationsScript.d.ts.map +1 -0
- package/dist/i18n/TranslationsScript.js +10 -0
- package/dist/i18n/cookies.d.ts +6 -0
- package/dist/i18n/cookies.d.ts.map +1 -0
- package/dist/i18n/cookies.js +24 -0
- package/dist/i18n/langHrefHelper.d.ts +36 -0
- package/dist/i18n/langHrefHelper.d.ts.map +1 -0
- package/dist/i18n/langHrefHelper.js +41 -0
- package/dist/i18n/server-helpers.d.ts +33 -0
- package/dist/i18n/server-helpers.d.ts.map +1 -0
- package/dist/i18n/server-helpers.js +39 -0
- package/dist/i18n/server-lang.d.ts +10 -0
- package/dist/i18n/server-lang.d.ts.map +1 -0
- package/dist/i18n/server-lang.js +42 -0
- package/dist/i18n/server.d.ts +10 -0
- package/dist/i18n/server.d.ts.map +1 -0
- package/dist/i18n/server.js +8 -0
- package/dist/i18n/types.d.ts +38 -0
- package/dist/i18n/types.d.ts.map +1 -0
- package/dist/i18n/types.js +4 -0
- package/dist/i18n/useLangRouter.d.ts +12 -0
- package/dist/i18n/useLangRouter.d.ts.map +1 -0
- package/dist/i18n/useLangRouter.js +18 -0
- package/dist/i18n/useLink.d.ts +34 -0
- package/dist/i18n/useLink.d.ts.map +1 -0
- package/dist/i18n/useLink.js +58 -0
- package/dist/i18n/useModuleTranslation.d.ts +11 -0
- package/dist/i18n/useModuleTranslation.d.ts.map +1 -0
- package/dist/i18n/useModuleTranslation.js +23 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/layouts/AdminLayout.js +1 -1
- package/dist/layouts/AppProviders.d.ts +4 -1
- package/dist/layouts/AppProviders.d.ts.map +1 -1
- package/dist/layouts/AppProviders.js +18 -8
- package/dist/layouts/AuthLayout.js +1 -1
- package/dist/layouts/AuthLayoutWithSidebar.d.ts.map +1 -1
- package/dist/layouts/AuthLayoutWithSidebar.js +5 -3
- package/dist/layouts/RootLayout.d.ts +4 -1
- package/dist/layouts/RootLayout.d.ts.map +1 -1
- package/dist/layouts/RootLayout.js +2 -2
- package/dist/scripts/i18n-build.d.ts +7 -0
- package/dist/scripts/i18n-build.d.ts.map +1 -0
- package/dist/scripts/i18n-build.js +100 -0
- package/dist/scripts/init-app.js +12 -12
- package/dist/scripts/module-build.d.ts.map +1 -1
- package/dist/scripts/module-build.js +384 -81
- package/dist/styles.css +1 -1
- package/dist/templates/DefaultDoc.d.ts.map +1 -1
- package/dist/templates/DefaultDoc.js +90 -2
- package/dist/templates/middleware-i18n.example.d.ts +16 -0
- package/dist/templates/middleware-i18n.example.d.ts.map +1 -0
- package/dist/templates/middleware-i18n.example.js +72 -0
- package/package.json +14 -3
- package/src/app-shell/not-found.tsx +2 -2
- package/src/components/LanguageSwitcher.tsx +156 -0
- package/src/config/version.ts +19 -21
- package/src/i18n/LanguageProvider.tsx +7 -0
- package/src/i18n/README_LANG_HELPERS.md +187 -0
- package/src/i18n/TranslationsScript.tsx +17 -0
- package/src/i18n/cookies.ts +24 -0
- package/src/i18n/langHrefHelper.ts +51 -0
- package/src/i18n/server-helpers.ts +48 -0
- package/src/i18n/server-lang.ts +51 -0
- package/src/i18n/server.ts +13 -0
- package/src/i18n/types.ts +39 -0
- package/src/i18n/useLangRouter.ts +21 -0
- package/src/i18n/useLink.ts +60 -0
- package/src/i18n/useModuleTranslation.ts +27 -0
- package/src/index.ts +20 -0
- package/src/layouts/AdminLayout.tsx +1 -1
- package/src/layouts/AppProviders.tsx +35 -16
- package/src/layouts/AuthLayout.tsx +1 -1
- package/src/layouts/AuthLayoutWithSidebar.tsx +5 -3
- package/src/layouts/RootLayout.tsx +12 -5
- package/src/scripts/i18n-build.ts +122 -0
- package/src/scripts/init-app.ts +12 -12
- package/src/scripts/module-build.ts +476 -94
- package/src/templates/DefaultDoc.tsx +511 -1
- package/src/templates/middleware-i18n.example.ts +92 -0
- package/dist/app-shell/(admin)/dashboard/page.d.ts +0 -2
- package/dist/app-shell/(admin)/dashboard/page.d.ts.map +0 -1
- package/dist/app-shell/(admin)/dashboard/page.js +0 -5
- package/dist/app-shell/(admin)/page.d.ts +0 -2
- package/dist/app-shell/(admin)/page.d.ts.map +0 -1
- package/dist/app-shell/(admin)/page.js +0 -5
- package/dist/app-shell/(auth)/dashboard/page.d.ts +0 -2
- package/dist/app-shell/(auth)/dashboard/page.d.ts.map +0 -1
- package/dist/app-shell/(auth)/dashboard/page.js +0 -5
- package/dist/app-shell/(auth)/page.d.ts +0 -2
- package/dist/app-shell/(auth)/page.d.ts.map +0 -1
- package/dist/app-shell/(auth)/page.js +0 -5
- package/dist/components/TableStructure.d.ts +0 -8
- package/dist/components/TableStructure.d.ts.map +0 -1
- package/dist/components/TableStructure.js +0 -37
- package/dist/hooks/useNotificationsSimple.d.ts +0 -20
- package/dist/hooks/useNotificationsSimple.d.ts.map +0 -1
- package/dist/hooks/useNotificationsSimple.js +0 -37
- package/dist/module-build.d.ts +0 -2
- package/dist/module-build.d.ts.map +0 -1
- package/dist/module-build.js +0 -50
- package/dist/modules/index.d.ts +0 -3
- package/dist/modules/index.d.ts.map +0 -1
- package/dist/modules/index.js +0 -2
- package/dist/src/__tests__/module-registry.test.d.ts +0 -2
- package/dist/src/__tests__/module-registry.test.d.ts.map +0 -1
- package/dist/src/__tests__/module-registry.test.js +0 -53
- package/dist/src/app-shell/(admin)/layout.d.ts +0 -4
- package/dist/src/app-shell/(admin)/layout.d.ts.map +0 -1
- package/dist/src/app-shell/(admin)/layout.js +0 -5
- package/dist/src/app-shell/(auth)/layout.d.ts +0 -4
- package/dist/src/app-shell/(auth)/layout.d.ts.map +0 -1
- package/dist/src/app-shell/(auth)/layout.js +0 -5
- package/dist/src/app-shell/(public)/page.d.ts +0 -2
- package/dist/src/app-shell/(public)/page.d.ts.map +0 -1
- package/dist/src/app-shell/(public)/page.js +0 -5
- package/dist/src/app-shell/layout.d.ts +0 -3
- package/dist/src/app-shell/layout.d.ts.map +0 -1
- package/dist/src/app-shell/layout.js +0 -3
- package/dist/src/app-shell/not-found.d.ts +0 -2
- package/dist/src/app-shell/not-found.d.ts.map +0 -1
- package/dist/src/app-shell/not-found.js +0 -10
- package/dist/src/auth/authHelpers.d.ts +0 -7
- package/dist/src/auth/authHelpers.d.ts.map +0 -1
- package/dist/src/auth/authHelpers.js +0 -19
- package/dist/src/auth/useAuthSession.d.ts +0 -7
- package/dist/src/auth/useAuthSession.d.ts.map +0 -1
- package/dist/src/auth/useAuthSession.js +0 -49
- package/dist/src/cli.d.ts +0 -3
- package/dist/src/cli.d.ts.map +0 -1
- package/dist/src/cli.js +0 -143
- package/dist/src/components/NotificationContainer.d.ts +0 -2
- package/dist/src/components/NotificationContainer.d.ts.map +0 -1
- package/dist/src/components/NotificationContainer.js +0 -8
- package/dist/src/hooks/useNotifications.d.ts +0 -30
- package/dist/src/hooks/useNotifications.d.ts.map +0 -1
- package/dist/src/hooks/useNotifications.js +0 -165
- package/dist/src/index.d.ts +0 -22
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -22
- package/dist/src/layouts/AdminLayout.d.ts +0 -4
- package/dist/src/layouts/AdminLayout.d.ts.map +0 -1
- package/dist/src/layouts/AdminLayout.js +0 -4
- package/dist/src/layouts/AdminLayoutWithSidebar.d.ts +0 -10
- package/dist/src/layouts/AdminLayoutWithSidebar.d.ts.map +0 -1
- package/dist/src/layouts/AdminLayoutWithSidebar.js +0 -62
- package/dist/src/layouts/AppProviders.d.ts +0 -27
- package/dist/src/layouts/AppProviders.d.ts.map +0 -1
- package/dist/src/layouts/AppProviders.js +0 -48
- package/dist/src/layouts/AuthLayout.d.ts +0 -4
- package/dist/src/layouts/AuthLayout.d.ts.map +0 -1
- package/dist/src/layouts/AuthLayout.js +0 -4
- package/dist/src/layouts/AuthLayoutWithSidebar.d.ts +0 -12
- package/dist/src/layouts/AuthLayoutWithSidebar.d.ts.map +0 -1
- package/dist/src/layouts/AuthLayoutWithSidebar.js +0 -60
- package/dist/src/layouts/PublicLayout.d.ts +0 -8
- package/dist/src/layouts/PublicLayout.d.ts.map +0 -1
- package/dist/src/layouts/PublicLayout.js +0 -6
- package/dist/src/layouts/PublicLayoutWithSidebar.d.ts +0 -9
- package/dist/src/layouts/PublicLayoutWithSidebar.d.ts.map +0 -1
- package/dist/src/layouts/PublicLayoutWithSidebar.js +0 -60
- package/dist/src/layouts/RootLayout.d.ts +0 -6
- package/dist/src/layouts/RootLayout.d.ts.map +0 -1
- package/dist/src/layouts/RootLayout.js +0 -9
- package/dist/src/modules/module-loader.d.ts +0 -5
- package/dist/src/modules/module-loader.d.ts.map +0 -1
- package/dist/src/modules/module-loader.js +0 -10
- package/dist/src/scripts/db-init.d.ts +0 -2
- package/dist/src/scripts/db-init.d.ts.map +0 -1
- package/dist/src/scripts/db-init.js +0 -300
- package/dist/src/scripts/db-migrations-sync.d.ts +0 -2
- package/dist/src/scripts/db-migrations-sync.d.ts.map +0 -1
- package/dist/src/scripts/db-migrations-sync.js +0 -84
- package/dist/src/scripts/dev-sync.d.ts +0 -2
- package/dist/src/scripts/dev-sync.d.ts.map +0 -1
- package/dist/src/scripts/dev-sync.js +0 -194
- package/dist/src/scripts/init-app.d.ts +0 -12
- package/dist/src/scripts/init-app.d.ts.map +0 -1
- package/dist/src/scripts/init-app.js +0 -2175
- package/dist/src/scripts/module-add.d.ts +0 -2
- package/dist/src/scripts/module-add.d.ts.map +0 -1
- package/dist/src/scripts/module-add.js +0 -232
- package/dist/src/scripts/module-build.d.ts +0 -2
- package/dist/src/scripts/module-build.d.ts.map +0 -1
- package/dist/src/scripts/module-build.js +0 -1280
- package/dist/src/scripts/module-create.d.ts +0 -28
- package/dist/src/scripts/module-create.d.ts.map +0 -1
- package/dist/src/scripts/module-create.js +0 -1429
- package/dist/src/scripts/module-delete.d.ts +0 -6
- package/dist/src/scripts/module-delete.d.ts.map +0 -1
- package/dist/src/scripts/module-delete.js +0 -147
- package/dist/src/scripts/module-list.d.ts +0 -2
- package/dist/src/scripts/module-list.d.ts.map +0 -1
- package/dist/src/scripts/module-list.js +0 -61
- package/dist/src/scripts/module-remove.d.ts +0 -2
- package/dist/src/scripts/module-remove.d.ts.map +0 -1
- package/dist/src/scripts/module-remove.js +0 -311
- package/dist/src/scripts/readme-build.d.ts +0 -2
- package/dist/src/scripts/readme-build.d.ts.map +0 -1
- package/dist/src/scripts/readme-build.js +0 -39
- package/dist/src/scripts/script-runner.d.ts +0 -5
- package/dist/src/scripts/script-runner.d.ts.map +0 -1
- package/dist/src/scripts/script-runner.js +0 -25
- package/dist/src/templates/AuthGuidePage.d.ts +0 -2
- package/dist/src/templates/AuthGuidePage.d.ts.map +0 -1
- package/dist/src/templates/AuthGuidePage.js +0 -9
- package/dist/src/templates/DefaultDoc.d.ts +0 -2
- package/dist/src/templates/DefaultDoc.d.ts.map +0 -1
- package/dist/src/templates/DefaultDoc.js +0 -240
- package/dist/src/templates/DocPage.d.ts +0 -17
- package/dist/src/templates/DocPage.d.ts.map +0 -1
- package/dist/src/templates/DocPage.js +0 -193
- package/dist/src/templates/DocsPageWithModules.d.ts +0 -2
- package/dist/src/templates/DocsPageWithModules.d.ts.map +0 -1
- package/dist/src/templates/DocsPageWithModules.js +0 -8
- package/dist/src/templates/MigrationsGuidePage.d.ts +0 -2
- package/dist/src/templates/MigrationsGuidePage.d.ts.map +0 -1
- package/dist/src/templates/MigrationsGuidePage.js +0 -11
- package/dist/src/templates/ModuleGuidePage.d.ts +0 -2
- package/dist/src/templates/ModuleGuidePage.d.ts.map +0 -1
- package/dist/src/templates/ModuleGuidePage.js +0 -14
- package/dist/src/templates/SimpleDocPage.d.ts +0 -2
- package/dist/src/templates/SimpleDocPage.d.ts.map +0 -1
- package/dist/src/templates/SimpleDocPage.js +0 -28
- package/dist/src/templates/SimpleHomePage.d.ts +0 -6
- package/dist/src/templates/SimpleHomePage.d.ts.map +0 -1
- package/dist/src/templates/SimpleHomePage.js +0 -7
- package/dist/src/types/menu.d.ts +0 -23
- package/dist/src/types/menu.d.ts.map +0 -1
- package/dist/src/types/menu.js +0 -1
- package/dist/templates/HomePage.d.ts +0 -6
- package/dist/templates/HomePage.d.ts.map +0 -1
- package/dist/templates/HomePage.js +0 -6
- package/dist/templates/components/AppAside.d.ts +0 -6
- package/dist/templates/components/AppAside.d.ts.map +0 -1
- package/dist/templates/components/AppAside.js +0 -9
- package/dist/templates/layouts/admin-layout.d.ts +0 -4
- package/dist/templates/layouts/admin-layout.d.ts.map +0 -1
- package/dist/templates/layouts/admin-layout.js +0 -6
- package/dist/templates/layouts/auth-layout.d.ts +0 -4
- package/dist/templates/layouts/auth-layout.d.ts.map +0 -1
- package/dist/templates/layouts/auth-layout.js +0 -6
- package/dist/templates/migrations/20201010100000_init.sql +0 -123
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
export default function AuthDashboardPage() {
|
|
4
|
-
return (_jsxs("div", { className: "mx-auto max-w-4xl space-y-3 px-4 py-16", children: [_jsx("h1", { className: "text-3xl font-bold", children: "Tableau de bord" }), _jsx("p", { className: "text-slate-600", children: "Bienvenue utilisateur \u2014 votre session est active." })] }));
|
|
5
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
interface TableStructureProps {
|
|
2
|
-
tableName: string;
|
|
3
|
-
title?: string;
|
|
4
|
-
description?: string;
|
|
5
|
-
}
|
|
6
|
-
export declare function TableStructure({ tableName, title, description, }: TableStructureProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export {};
|
|
8
|
-
//# sourceMappingURL=TableStructure.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TableStructure.d.ts","sourceRoot":"","sources":["../../src/components/TableStructure.tsx"],"names":[],"mappings":"AA6BA,UAAU,mBAAmB;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,KAAK,EACL,WAAW,GACZ,EAAE,mBAAmB,2CAgIrB"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useEffect, useState } from "react";
|
|
4
|
-
import { Card, CardBody, CardHeader, Table, TableHeader, TableColumn, TableBody, TableRow, TableCell, Chip, Spinner, } from "@lastbrain/ui";
|
|
5
|
-
import { createBrowserClient } from "@supabase/ssr";
|
|
6
|
-
export function TableStructure({ tableName, title, description, }) {
|
|
7
|
-
const [columns, setColumns] = useState([]);
|
|
8
|
-
const [loading, setLoading] = useState(true);
|
|
9
|
-
const [error, setError] = useState(null);
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
const fetchStructure = async () => {
|
|
12
|
-
try {
|
|
13
|
-
const supabase = createBrowserClient(process.env.NEXT_PUBLIC_SUPABASE_URL, process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY);
|
|
14
|
-
const { data, error } = await supabase.rpc("get_table_structure", {
|
|
15
|
-
table_name: tableName,
|
|
16
|
-
});
|
|
17
|
-
if (error)
|
|
18
|
-
throw error;
|
|
19
|
-
setColumns(data || []);
|
|
20
|
-
}
|
|
21
|
-
catch (err) {
|
|
22
|
-
setError(err instanceof Error ? err.message : "Erreur lors du chargement");
|
|
23
|
-
}
|
|
24
|
-
finally {
|
|
25
|
-
setLoading(false);
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
fetchStructure();
|
|
29
|
-
}, [tableName]);
|
|
30
|
-
if (loading) {
|
|
31
|
-
return (_jsx(Card, { children: _jsx(CardBody, { className: "flex justify-center items-center py-8", children: _jsx(Spinner, { size: "lg" }) }) }));
|
|
32
|
-
}
|
|
33
|
-
if (error) {
|
|
34
|
-
return (_jsx(Card, { children: _jsx(CardBody, { children: _jsxs("p", { className: "text-red-500", children: ["Erreur: ", error] }) }) }));
|
|
35
|
-
}
|
|
36
|
-
return (_jsxs(Card, { children: [_jsx(CardHeader, { children: _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("h3", { className: "text-lg font-semibold", children: title || `Table: ${tableName}` }), description && (_jsx("p", { className: "text-sm text-slate-600 dark:text-slate-400", children: description }))] }) }), _jsx(CardBody, { children: _jsxs(Table, { "aria-label": `Structure de la table ${tableName}`, children: [_jsxs(TableHeader, { children: [_jsx(TableColumn, { children: "COLONNE" }), _jsx(TableColumn, { children: "TYPE" }), _jsx(TableColumn, { children: "NULLABLE" }), _jsx(TableColumn, { children: "CONTRAINTES" }), _jsx(TableColumn, { children: "RELATION" })] }), _jsx(TableBody, { children: columns.map((col) => (_jsxs(TableRow, { children: [_jsx(TableCell, { children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("code", { className: "font-mono text-sm", children: col.column_name }), col.is_primary_key && (_jsx(Chip, { size: "sm", color: "primary", variant: "flat", children: "PK" }))] }) }), _jsx(TableCell, { children: _jsx("code", { className: "font-mono text-sm text-purple-600 dark:text-purple-400", children: col.data_type }) }), _jsx(TableCell, { children: _jsx(Chip, { size: "sm", color: col.is_nullable === "YES" ? "warning" : "success", variant: "flat", children: col.is_nullable === "YES" ? "NULL" : "NOT NULL" }) }), _jsx(TableCell, { children: col.column_default && (_jsxs(Chip, { size: "sm", variant: "flat", children: ["default: ", col.column_default.substring(0, 30), col.column_default.length > 30 ? "..." : ""] })) }), _jsx(TableCell, { children: col.is_foreign_key && col.foreign_table && (_jsxs("div", { className: "flex items-center gap-1", children: [_jsx(Chip, { size: "sm", color: "secondary", variant: "flat", children: "FK" }), _jsxs("code", { className: "font-mono text-xs", children: ["\u2192 ", col.foreign_table, ".", col.foreign_column] })] })) })] }, col.column_name))) })] }) })] }));
|
|
37
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Hook simple pour utiliser les notifications partout dans l'app
|
|
3
|
-
* Wrapper autour du contexte pour plus de simplicité
|
|
4
|
-
*/
|
|
5
|
-
export declare function useNotificationsSimple(): {
|
|
6
|
-
notifications: import("./useNotifications.js").UserNotification[];
|
|
7
|
-
unreadCount: number;
|
|
8
|
-
loading: boolean;
|
|
9
|
-
error: string | null;
|
|
10
|
-
isEmpty: boolean;
|
|
11
|
-
hasUnread: boolean;
|
|
12
|
-
refetch: () => Promise<void>;
|
|
13
|
-
markAsRead: (id: string) => Promise<void>;
|
|
14
|
-
markAllAsRead: () => Promise<void>;
|
|
15
|
-
deleteNotification: (id: string) => Promise<void>;
|
|
16
|
-
realtimeActive: boolean;
|
|
17
|
-
lastUpdate: any;
|
|
18
|
-
};
|
|
19
|
-
export default useNotificationsSimple;
|
|
20
|
-
//# sourceMappingURL=useNotificationsSimple.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useNotificationsSimple.d.ts","sourceRoot":"","sources":["../../src/hooks/useNotificationsSimple.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,sBAAsB;;;;;;;;;;;;;EAmCrC;AAED,eAAe,sBAAsB,CAAC"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { useNotifications as useNotificationsContext } from "../layouts/AppProviders.js";
|
|
2
|
-
/**
|
|
3
|
-
* Hook simple pour utiliser les notifications partout dans l'app
|
|
4
|
-
* Wrapper autour du contexte pour plus de simplicité
|
|
5
|
-
*/
|
|
6
|
-
export function useNotificationsSimple() {
|
|
7
|
-
const context = useNotificationsContext();
|
|
8
|
-
// Log uniquement en cas de problème pour le debug
|
|
9
|
-
if (context.error || (context.data.notifications.length > 0 && process.env.NODE_ENV === 'development')) {
|
|
10
|
-
console.log("[useNotificationsSimple] État:", {
|
|
11
|
-
dataNotifications: context.data.notifications?.length || 0,
|
|
12
|
-
dataUnreadCount: context.data.unreadCount,
|
|
13
|
-
loading: context.loading,
|
|
14
|
-
error: context.error,
|
|
15
|
-
realtimeActive: context.realtimeActive
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
return {
|
|
19
|
-
// Données principales
|
|
20
|
-
notifications: context.data.notifications,
|
|
21
|
-
unreadCount: context.data.unreadCount,
|
|
22
|
-
// États
|
|
23
|
-
loading: context.loading,
|
|
24
|
-
error: context.error,
|
|
25
|
-
isEmpty: context.isEmpty,
|
|
26
|
-
hasUnread: context.hasUnread,
|
|
27
|
-
// Actions
|
|
28
|
-
refetch: context.refetch,
|
|
29
|
-
markAsRead: context.markAsRead,
|
|
30
|
-
markAllAsRead: context.markAllAsRead,
|
|
31
|
-
deleteNotification: context.deleteNotification,
|
|
32
|
-
// Realtime info
|
|
33
|
-
realtimeActive: context.realtimeActive,
|
|
34
|
-
lastUpdate: context.lastRealtimePayload,
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
export default useNotificationsSimple;
|
package/dist/module-build.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"module-build.d.ts","sourceRoot":"","sources":["../src/module-build.ts"],"names":[],"mappings":"AAuDA,wBAAgB,cAAc,SAO7B"}
|
package/dist/module-build.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
-
import { moduleConfigs } from "./modules/index.js";
|
|
5
|
-
const webAppRoot = path.join(fileURLToPath(new URL("../../../apps/web", import.meta.url)));
|
|
6
|
-
const appDirectory = path.join(webAppRoot, "app");
|
|
7
|
-
function ensureDirectory(dir) {
|
|
8
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
9
|
-
}
|
|
10
|
-
function toPascalCase(value) {
|
|
11
|
-
return value
|
|
12
|
-
.split(/[^a-zA-Z0-9]+/)
|
|
13
|
-
.filter(Boolean)
|
|
14
|
-
.map((segment) => segment[0].toUpperCase() + segment.slice(1))
|
|
15
|
-
.join("");
|
|
16
|
-
}
|
|
17
|
-
function buildPage(moduleConfig, page) {
|
|
18
|
-
const segments = page.path.replace(/^\//, "").split("/").filter(Boolean);
|
|
19
|
-
const routeDir = path.join(appDirectory, ...segments);
|
|
20
|
-
const filePath = path.join(routeDir, "page.tsx");
|
|
21
|
-
ensureDirectory(routeDir);
|
|
22
|
-
const wrapperSuffix = segments.length ? toPascalCase(segments.join("-")) : "Root";
|
|
23
|
-
const wrapperName = `${page.componentExport}${wrapperSuffix}Route`;
|
|
24
|
-
const content = `import { ${page.componentExport} } from "${moduleConfig.moduleName}";
|
|
25
|
-
|
|
26
|
-
export default function ${wrapperName}() {
|
|
27
|
-
return <${page.componentExport} />;
|
|
28
|
-
}
|
|
29
|
-
`;
|
|
30
|
-
fs.writeFileSync(filePath, content);
|
|
31
|
-
console.log(`⭐ Generated page: ${filePath}`);
|
|
32
|
-
}
|
|
33
|
-
function buildApi(moduleConfig, api) {
|
|
34
|
-
const segments = api.path.replace(/^\//, "").split("/").filter(Boolean);
|
|
35
|
-
const routeDir = path.join(appDirectory, ...segments);
|
|
36
|
-
const filePath = path.join(routeDir, "route.ts");
|
|
37
|
-
ensureDirectory(routeDir);
|
|
38
|
-
const content = `export { ${api.handlerExport} } from "${moduleConfig.moduleName}/${api.entryPoint}";
|
|
39
|
-
`;
|
|
40
|
-
fs.writeFileSync(filePath, content);
|
|
41
|
-
console.log(`🔌 Generated API route: ${filePath}`);
|
|
42
|
-
}
|
|
43
|
-
export function runModuleBuild() {
|
|
44
|
-
ensureDirectory(appDirectory);
|
|
45
|
-
for (const moduleConfig of moduleConfigs) {
|
|
46
|
-
moduleConfig.pages.forEach((page) => buildPage(moduleConfig, page));
|
|
47
|
-
moduleConfig.apis.forEach((api) => buildApi(moduleConfig, api));
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
runModuleBuild();
|
package/dist/modules/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/modules/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGzD,eAAO,MAAM,aAAa,EAAE,iBAAiB,EAAsB,CAAC"}
|
package/dist/modules/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"module-registry.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/module-registry.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from "vitest";
|
|
2
|
-
import { AVAILABLE_MODULES } from "@lastbrain/core/config/modules";
|
|
3
|
-
describe("Module Registry", () => {
|
|
4
|
-
describe("AVAILABLE_MODULES", () => {
|
|
5
|
-
it("should have at least one module defined", () => {
|
|
6
|
-
expect(AVAILABLE_MODULES.length).toBeGreaterThan(0);
|
|
7
|
-
});
|
|
8
|
-
it("should have auth module defined", () => {
|
|
9
|
-
const authModule = AVAILABLE_MODULES.find((m) => m.name === "auth");
|
|
10
|
-
expect(authModule).toBeDefined();
|
|
11
|
-
expect(authModule?.package).toBe("@lastbrain/module-auth");
|
|
12
|
-
});
|
|
13
|
-
it("should have ai module defined", () => {
|
|
14
|
-
const aiModule = AVAILABLE_MODULES.find((m) => m.name === "ai");
|
|
15
|
-
expect(aiModule).toBeDefined();
|
|
16
|
-
expect(aiModule?.package).toBe("@lastbrain/module-ai");
|
|
17
|
-
});
|
|
18
|
-
it("should have all required properties for each module", () => {
|
|
19
|
-
AVAILABLE_MODULES.forEach((module) => {
|
|
20
|
-
expect(module.name).toBeDefined();
|
|
21
|
-
expect(module.package).toBeDefined();
|
|
22
|
-
expect(module.emoji).toBeDefined();
|
|
23
|
-
expect(module.description).toBeDefined();
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
it("should have unique module names", () => {
|
|
27
|
-
const names = AVAILABLE_MODULES.map((m) => m.name);
|
|
28
|
-
const uniqueNames = new Set(names);
|
|
29
|
-
expect(names.length).toBe(uniqueNames.size);
|
|
30
|
-
});
|
|
31
|
-
it("should have unique package names", () => {
|
|
32
|
-
const packages = AVAILABLE_MODULES.map((m) => m.package);
|
|
33
|
-
const uniquePackages = new Set(packages);
|
|
34
|
-
expect(packages.length).toBe(uniquePackages.size);
|
|
35
|
-
});
|
|
36
|
-
it("should have emoji", () => {
|
|
37
|
-
AVAILABLE_MODULES.forEach((module) => {
|
|
38
|
-
// Check if emoji contains at least one emoji (basic check)
|
|
39
|
-
expect(module.emoji).toMatch(/[\u{1F300}-\u{1F9FF}]/u);
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
it("should have non-empty descriptions", () => {
|
|
43
|
-
AVAILABLE_MODULES.forEach((module) => {
|
|
44
|
-
expect(module.description.length).toBeGreaterThan(0);
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
it("should have valid package names", () => {
|
|
48
|
-
AVAILABLE_MODULES.forEach((module) => {
|
|
49
|
-
expect(module.package).toMatch(/^@lastbrain(-labs)?\/module-/);
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../src/app-shell/(admin)/layout.tsx"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,2CAQA"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
export default function AdminShellLayout({ children, }) {
|
|
4
|
-
return (_jsxs("div", { className: "mx-auto max-w-5xl px-4 py-16", children: [_jsx("h1", { className: "text-3xl font-bold", children: "Section Admin" }), _jsx("p", { className: "text-slate-600", children: "Gestion avanc\u00E9e des modules." }), children] }));
|
|
5
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../src/app-shell/(auth)/layout.tsx"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,2CAQA"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
export default function AuthLayout({ children, }) {
|
|
4
|
-
return (_jsxs("div", { className: "mx-auto max-w-5xl px-4 py-16", children: [_jsx("h1", { className: "text-3xl font-bold", children: "Section Auth" }), _jsx("p", { className: "text-slate-600", children: "Les pages authentifi\u00E9es regroup\u00E9es ici." }), children] }));
|
|
5
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../../src/app-shell/(public)/page.tsx"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,UAAU,4CAYjC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
export default function PublicPage() {
|
|
4
|
-
return (_jsxs("div", { className: "mx-auto max-w-3xl space-y-4 px-4 py-16 text-center", children: [_jsx("h1", { className: "text-3xl font-bold", children: "Bienvenue sur LastBrain" }), _jsx("p", { className: "text-slate-600", children: "Cette coquille publique pr\u00E9sente la structure par d\u00E9faut." }), _jsx("button", { className: "rounded-full bg-slate-900 px-5 py-2 text-white", children: "Connexion" })] }));
|
|
5
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../src/app-shell/layout.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,eAAe,UAAU,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"not-found.d.ts","sourceRoot":"","sources":["../../../src/app-shell/not-found.tsx"],"names":[],"mappings":"AAIA,MAAM,CAAC,OAAO,UAAU,QAAQ,4CAuB/B"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Button } from "@lastbrain/ui";
|
|
4
|
-
import { useRouter } from "next/navigation";
|
|
5
|
-
export default function NotFound() {
|
|
6
|
-
const router = useRouter();
|
|
7
|
-
return (_jsx("div", { className: "flex min-h-screen items-center justify-center bg-background", children: _jsxs("div", { className: "mx-auto max-w-md text-center", children: [_jsx("h1", { className: "mb-4 text-6xl font-bold text-foreground", children: "404" }), _jsx("h2", { className: "mb-4 text-2xl font-semibold text-foreground", children: "Page non trouv\u00E9e" }), _jsx("p", { className: "mb-8 text-muted-foreground", children: "La page que vous recherchez n'existe pas ou a \u00E9t\u00E9 d\u00E9plac\u00E9e." }), _jsx(Button, { onPress: () => {
|
|
8
|
-
router.back();
|
|
9
|
-
}, className: "inline-flex items-center justify-center rounded-md bg-primary px-6 py-3 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90", children: "Retour \u00E0 l'accueil" })] }) }));
|
|
10
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare function signOut(): Promise<void>;
|
|
2
|
-
export declare function signIn(email: string, password: string): Promise<{
|
|
3
|
-
user: import("@supabase/supabase-js").AuthUser;
|
|
4
|
-
session: import("@supabase/supabase-js").AuthSession;
|
|
5
|
-
weakPassword?: import("@supabase/supabase-js").WeakPassword;
|
|
6
|
-
}>;
|
|
7
|
-
//# sourceMappingURL=authHelpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"authHelpers.d.ts","sourceRoot":"","sources":["../../../src/auth/authHelpers.ts"],"names":[],"mappings":"AAIA,wBAAsB,OAAO,kBAM5B;AAED,wBAAsB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;;;;GAW3D"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { supabaseBrowserClient } from "@lastbrain/core";
|
|
3
|
-
export async function signOut() {
|
|
4
|
-
const { error } = await supabaseBrowserClient.auth.signOut();
|
|
5
|
-
if (error) {
|
|
6
|
-
console.error("Error signing out:", error);
|
|
7
|
-
throw error;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
export async function signIn(email, password) {
|
|
11
|
-
const { data, error } = await supabaseBrowserClient.auth.signInWithPassword({
|
|
12
|
-
email,
|
|
13
|
-
password,
|
|
14
|
-
});
|
|
15
|
-
if (error) {
|
|
16
|
-
throw error;
|
|
17
|
-
}
|
|
18
|
-
return data;
|
|
19
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAuthSession.d.ts","sourceRoot":"","sources":["../../../src/auth/useAuthSession.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAElD,wBAAgB,cAAc;;;;EAmD7B"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
import { supabaseBrowserClient } from "@lastbrain/core";
|
|
4
|
-
export function useAuthSession() {
|
|
5
|
-
const [user, setUser] = useState(null);
|
|
6
|
-
const [loading, setLoading] = useState(true);
|
|
7
|
-
const [isSuperAdmin, setIsSuperAdmin] = useState(false);
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
const checkSuperAdmin = async (userId) => {
|
|
10
|
-
try {
|
|
11
|
-
const { data, error } = await supabaseBrowserClient.rpc("is_superadmin", { user_id: userId });
|
|
12
|
-
if (!error && data) {
|
|
13
|
-
setIsSuperAdmin(data);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
catch (error) {
|
|
17
|
-
console.error("Error checking superadmin status:", error);
|
|
18
|
-
setIsSuperAdmin(false);
|
|
19
|
-
}
|
|
20
|
-
finally {
|
|
21
|
-
// Ne terminer le loading qu'après avoir vérifié le status admin
|
|
22
|
-
setLoading(false);
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
// Récupérer la session initiale
|
|
26
|
-
supabaseBrowserClient.auth.getSession().then(({ data: { session } }) => {
|
|
27
|
-
setUser(session?.user ?? null);
|
|
28
|
-
if (session?.user) {
|
|
29
|
-
checkSuperAdmin(session.user.id);
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
setLoading(false);
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
// Écouter les changements d'auth
|
|
36
|
-
const { data: { subscription }, } = supabaseBrowserClient.auth.onAuthStateChange((_event, session) => {
|
|
37
|
-
setUser(session?.user ?? null);
|
|
38
|
-
if (session?.user) {
|
|
39
|
-
checkSuperAdmin(session.user.id);
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
setIsSuperAdmin(false);
|
|
43
|
-
setLoading(false);
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
return () => subscription.unsubscribe();
|
|
47
|
-
}, []);
|
|
48
|
-
return { user, loading, isSuperAdmin };
|
|
49
|
-
}
|
package/dist/src/cli.d.ts
DELETED
package/dist/src/cli.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/src/cli.js
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { Command } from "commander";
|
|
3
|
-
import path from "path";
|
|
4
|
-
import { initApp } from "./scripts/init-app.js";
|
|
5
|
-
import { addModule } from "./scripts/module-add.js";
|
|
6
|
-
import { removeModule } from "./scripts/module-remove.js";
|
|
7
|
-
import { listModules } from "./scripts/module-list.js";
|
|
8
|
-
import { createModule } from "./scripts/module-create.js";
|
|
9
|
-
const program = new Command();
|
|
10
|
-
program
|
|
11
|
-
.name("lastbrain")
|
|
12
|
-
.description("CLI pour créer et gérer des applications LastBrain")
|
|
13
|
-
.version("0.1.0");
|
|
14
|
-
program
|
|
15
|
-
.command("init [directory]")
|
|
16
|
-
.description("Initialise une nouvelle application Next.js LastBrain")
|
|
17
|
-
.option("-f, --force", "Écrase les fichiers existants")
|
|
18
|
-
.option("--no-heroui", "Ne pas utiliser HeroUI (Tailwind CSS uniquement)")
|
|
19
|
-
.option("--with-auth", "Inclure le module d'authentification")
|
|
20
|
-
.option("--no-interactive", "Mode non-interactif (skip la sélection des modules)")
|
|
21
|
-
.action(async (directory, options) => {
|
|
22
|
-
try {
|
|
23
|
-
const targetDir = directory
|
|
24
|
-
? path.resolve(process.cwd(), directory)
|
|
25
|
-
: process.cwd();
|
|
26
|
-
await initApp({
|
|
27
|
-
force: options.force || false,
|
|
28
|
-
targetDir,
|
|
29
|
-
projectName: directory || path.basename(process.cwd()),
|
|
30
|
-
useHeroUI: options.heroui !== false, // Par défaut true, false si --no-heroui
|
|
31
|
-
withAuth: options.withAuth || false,
|
|
32
|
-
interactive: options.interactive !== false,
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
catch (error) {
|
|
36
|
-
console.error("❌ Erreur lors de l'initialisation:", error);
|
|
37
|
-
process.exit(1);
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
program
|
|
41
|
-
.command("add-module <module>")
|
|
42
|
-
.description("Ajoute un module à l'application")
|
|
43
|
-
.action(async (moduleName) => {
|
|
44
|
-
try {
|
|
45
|
-
await addModule(moduleName, process.cwd());
|
|
46
|
-
}
|
|
47
|
-
catch (error) {
|
|
48
|
-
console.error("❌ Erreur lors de l'ajout du module:", error);
|
|
49
|
-
process.exit(1);
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
program
|
|
53
|
-
.command("remove-module <module>")
|
|
54
|
-
.description("Supprime un module de l'application")
|
|
55
|
-
.action(async (moduleName) => {
|
|
56
|
-
try {
|
|
57
|
-
await removeModule(moduleName, process.cwd());
|
|
58
|
-
}
|
|
59
|
-
catch (error) {
|
|
60
|
-
console.error("❌ Erreur lors de la suppression du module:", error);
|
|
61
|
-
process.exit(1);
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
program
|
|
65
|
-
.command("list-modules")
|
|
66
|
-
.description("Liste les modules disponibles et installés")
|
|
67
|
-
.action(async () => {
|
|
68
|
-
try {
|
|
69
|
-
await listModules(process.cwd());
|
|
70
|
-
}
|
|
71
|
-
catch (error) {
|
|
72
|
-
console.error("❌ Erreur lors de la liste des modules:", error);
|
|
73
|
-
process.exit(1);
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
program
|
|
77
|
-
.command("create-module")
|
|
78
|
-
.description("Crée un nouveau module dans packages/")
|
|
79
|
-
.action(async () => {
|
|
80
|
-
try {
|
|
81
|
-
await createModule();
|
|
82
|
-
}
|
|
83
|
-
catch (error) {
|
|
84
|
-
console.error("❌ Erreur lors de la création du module:", error);
|
|
85
|
-
process.exit(1);
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
// Commandes de build et maintenance
|
|
89
|
-
program
|
|
90
|
-
.command("module:build")
|
|
91
|
-
.description("Build les configurations de modules")
|
|
92
|
-
.option("--debug", "Affiche tous les logs détaillés")
|
|
93
|
-
.action(async (options) => {
|
|
94
|
-
try {
|
|
95
|
-
// Passer le flag debug via process.argv pour que module-build puisse le lire
|
|
96
|
-
if (options.debug && !process.argv.includes("--debug")) {
|
|
97
|
-
process.argv.push("--debug");
|
|
98
|
-
}
|
|
99
|
-
const { runModuleBuild } = await import("./scripts/module-build.js");
|
|
100
|
-
await runModuleBuild();
|
|
101
|
-
}
|
|
102
|
-
catch (error) {
|
|
103
|
-
console.error("❌ Erreur lors du build des modules:", error);
|
|
104
|
-
process.exit(1);
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
program
|
|
108
|
-
.command("db:init")
|
|
109
|
-
.description("Initialise la base de données Supabase")
|
|
110
|
-
.action(async () => {
|
|
111
|
-
try {
|
|
112
|
-
await import("./scripts/db-init.js");
|
|
113
|
-
}
|
|
114
|
-
catch (error) {
|
|
115
|
-
console.error("❌ Erreur lors de l'initialisation de la DB:", error);
|
|
116
|
-
process.exit(1);
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
program
|
|
120
|
-
.command("db:migrations:sync")
|
|
121
|
-
.description("Synchronise les migrations de modules")
|
|
122
|
-
.action(async () => {
|
|
123
|
-
try {
|
|
124
|
-
await import("./scripts/db-migrations-sync.js");
|
|
125
|
-
}
|
|
126
|
-
catch (error) {
|
|
127
|
-
console.error("❌ Erreur lors de la sync des migrations:", error);
|
|
128
|
-
process.exit(1);
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
program
|
|
132
|
-
.command("readme:create")
|
|
133
|
-
.description("Génère le fichier README")
|
|
134
|
-
.action(async () => {
|
|
135
|
-
try {
|
|
136
|
-
await import("./scripts/readme-build.js");
|
|
137
|
-
}
|
|
138
|
-
catch (error) {
|
|
139
|
-
console.error("❌ Erreur lors de la création du README:", error);
|
|
140
|
-
process.exit(1);
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
program.parse();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationContainer.d.ts","sourceRoot":"","sources":["../../../src/components/NotificationContainer.tsx"],"names":[],"mappings":"AAKA,wBAAgB,qBAAqB,4CAcpC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { Notification } from "@lastbrain/ui";
|
|
4
|
-
import { useNotifications } from "../layouts/AppProviders";
|
|
5
|
-
export function NotificationContainer() {
|
|
6
|
-
const { data, loading, markAsRead, markAllAsRead, deleteNotification } = useNotifications();
|
|
7
|
-
return (_jsx(Notification, { notifications: data.notifications, unreadCount: data.unreadCount, loading: loading, onMarkAsRead: markAsRead, onMarkAllAsRead: markAllAsRead, onDelete: deleteNotification }));
|
|
8
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { User } from "@supabase/supabase-js";
|
|
2
|
-
export interface UserNotification {
|
|
3
|
-
id: string;
|
|
4
|
-
owner_id: string;
|
|
5
|
-
title: string;
|
|
6
|
-
message: string;
|
|
7
|
-
body?: string;
|
|
8
|
-
type: string;
|
|
9
|
-
read: boolean;
|
|
10
|
-
created_at: string;
|
|
11
|
-
updated_at: string;
|
|
12
|
-
}
|
|
13
|
-
export interface NotificationsData {
|
|
14
|
-
notifications: UserNotification[];
|
|
15
|
-
unreadCount: number;
|
|
16
|
-
}
|
|
17
|
-
export declare function useNotifications(user?: User | null): {
|
|
18
|
-
data: NotificationsData;
|
|
19
|
-
loading: boolean;
|
|
20
|
-
error: string | null;
|
|
21
|
-
refetch: () => Promise<void>;
|
|
22
|
-
markAsRead: (notificationId: string) => Promise<void>;
|
|
23
|
-
markAllAsRead: () => Promise<void>;
|
|
24
|
-
deleteNotification: (notificationId: string) => Promise<void>;
|
|
25
|
-
isEmpty: boolean;
|
|
26
|
-
hasUnread: boolean;
|
|
27
|
-
realtimeActive: boolean;
|
|
28
|
-
lastRealtimePayload: any;
|
|
29
|
-
};
|
|
30
|
-
//# sourceMappingURL=useNotifications.d.ts.map
|