@flowselections/admin-installatietechniek 1.0.1
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-lib/_core-safelist.d.ts +2 -0
- package/dist-lib/_core-safelist.d.ts.map +1 -0
- package/dist-lib/_core-safelist.js +15 -0
- package/dist-lib/components/AdminForInstallatieTechniek.d.ts +12 -0
- package/dist-lib/components/AdminForInstallatieTechniek.d.ts.map +1 -0
- package/dist-lib/components/AdminForInstallatieTechniek.js +359 -0
- package/dist-lib/components/TemplateModuleLogo.d.ts +6 -0
- package/dist-lib/components/TemplateModuleLogo.d.ts.map +1 -0
- package/dist-lib/components/TemplateModuleLogo.js +4 -0
- package/dist-lib/components/TemplateModulePage.d.ts +2 -0
- package/dist-lib/components/TemplateModulePage.d.ts.map +1 -0
- package/dist-lib/components/TemplateModulePage.js +44 -0
- package/dist-lib/components/TemplatePage.d.ts +2 -0
- package/dist-lib/components/TemplatePage.d.ts.map +1 -0
- package/dist-lib/components/TemplatePage.js +4 -0
- package/dist-lib/components/settings/MijnModuleSettingsCard.d.ts +2 -0
- package/dist-lib/components/settings/MijnModuleSettingsCard.d.ts.map +1 -0
- package/dist-lib/components/settings/MijnModuleSettingsCard.js +42 -0
- package/dist-lib/hooks/useMijnModuleData.d.ts +13 -0
- package/dist-lib/hooks/useMijnModuleData.d.ts.map +1 -0
- package/dist-lib/hooks/useMijnModuleData.js +49 -0
- package/dist-lib/hooks/useModulePermission.d.ts +17 -0
- package/dist-lib/hooks/useModulePermission.d.ts.map +1 -0
- package/dist-lib/hooks/useModulePermission.js +42 -0
- package/dist-lib/index.d.ts +10 -0
- package/dist-lib/index.d.ts.map +1 -0
- package/dist-lib/index.js +19 -0
- package/dist-lib/integrations/supabase/auth-attacher.d.ts +2 -0
- package/dist-lib/integrations/supabase/auth-attacher.d.ts.map +1 -0
- package/dist-lib/integrations/supabase/auth-attacher.js +12 -0
- package/dist-lib/integrations/supabase/auth-middleware.d.ts +20806 -0
- package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -0
- package/dist-lib/integrations/supabase/auth-middleware.js +49 -0
- package/dist-lib/integrations/supabase/client.d.ts +20802 -0
- package/dist-lib/integrations/supabase/client.d.ts.map +1 -0
- package/dist-lib/integrations/supabase/client.js +13 -0
- package/dist-lib/integrations/supabase/client.server.d.ts +20802 -0
- package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -0
- package/dist-lib/integrations/supabase/client.server.js +32 -0
- package/dist-lib/integrations/supabase/types.d.ts +21382 -0
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -0
- package/dist-lib/integrations/supabase/types.js +89 -0
- package/dist-lib/lib/admin.functions.d.ts +228936 -0
- package/dist-lib/lib/admin.functions.d.ts.map +1 -0
- package/dist-lib/lib/admin.functions.js +410 -0
- package/dist-lib/lib/admin.server.d.ts +29 -0
- package/dist-lib/lib/admin.server.d.ts.map +1 -0
- package/dist-lib/lib/admin.server.js +63 -0
- package/dist-lib/lib/moduleDiscovery.d.ts +10 -0
- package/dist-lib/lib/moduleDiscovery.d.ts.map +1 -0
- package/dist-lib/lib/moduleDiscovery.js +54 -0
- package/dist-lib/lib/utils.d.ts +3 -0
- package/dist-lib/lib/utils.d.ts.map +1 -0
- package/dist-lib/lib/utils.js +5 -0
- package/dist-lib/lib/validationSchemas.d.ts +15 -0
- package/dist-lib/lib/validationSchemas.d.ts.map +1 -0
- package/dist-lib/lib/validationSchemas.js +25 -0
- package/dist-lib/styles.css +1 -0
- package/package.json +87 -0
- package/public/logo.png +0 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type ModulePermission = "none" | "view" | "edit";
|
|
2
|
+
/**
|
|
3
|
+
* Haalt de effectieve rechten van de ingelogde gebruiker op voor alle
|
|
4
|
+
* geregistreerde modules. Persoonlijke uitzonderingen winnen van rolrechten.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useMyModulePermissions(): {
|
|
7
|
+
permissions: Record<string, ModulePermission>;
|
|
8
|
+
loading: boolean;
|
|
9
|
+
};
|
|
10
|
+
/** Effectief recht voor één module: "none" | "view" | "edit". */
|
|
11
|
+
export declare function useModulePermission(moduleId: string): {
|
|
12
|
+
permission: ModulePermission;
|
|
13
|
+
canView: boolean;
|
|
14
|
+
canEdit: boolean;
|
|
15
|
+
loading: boolean;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=useModulePermission.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useModulePermission.d.ts","sourceRoot":"","sources":["../../src/hooks/useModulePermission.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAExD;;;GAGG;AACH,wBAAgB,sBAAsB;;;EAyBrC;AAED,iEAAiE;AACjE,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM;;;;;EASnD"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import { supabase } from "../integrations/supabase/client";
|
|
3
|
+
/**
|
|
4
|
+
* Haalt de effectieve rechten van de ingelogde gebruiker op voor alle
|
|
5
|
+
* geregistreerde modules. Persoonlijke uitzonderingen winnen van rolrechten.
|
|
6
|
+
*/
|
|
7
|
+
export function useMyModulePermissions() {
|
|
8
|
+
const [permissions, setPermissions] = useState({});
|
|
9
|
+
const [loading, setLoading] = useState(true);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
let cancelled = false;
|
|
12
|
+
(async () => {
|
|
13
|
+
const { data, error } = await supabase.rpc("my_module_permissions");
|
|
14
|
+
if (cancelled)
|
|
15
|
+
return;
|
|
16
|
+
const rows = Array.isArray(data) ? data : [];
|
|
17
|
+
if (!error) {
|
|
18
|
+
const map = {};
|
|
19
|
+
for (const row of rows) {
|
|
20
|
+
map[row.module_id] = row.permission;
|
|
21
|
+
}
|
|
22
|
+
setPermissions(map);
|
|
23
|
+
}
|
|
24
|
+
setLoading(false);
|
|
25
|
+
})();
|
|
26
|
+
return () => {
|
|
27
|
+
cancelled = true;
|
|
28
|
+
};
|
|
29
|
+
}, []);
|
|
30
|
+
return { permissions, loading };
|
|
31
|
+
}
|
|
32
|
+
/** Effectief recht voor één module: "none" | "view" | "edit". */
|
|
33
|
+
export function useModulePermission(moduleId) {
|
|
34
|
+
const { permissions, loading } = useMyModulePermissions();
|
|
35
|
+
const permission = permissions[moduleId] ?? "none";
|
|
36
|
+
return {
|
|
37
|
+
permission,
|
|
38
|
+
canView: permission === "view" || permission === "edit",
|
|
39
|
+
canEdit: permission === "edit",
|
|
40
|
+
loading,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { FlowModule } from "@flowselections/core";
|
|
2
|
+
export * from './_core-safelist';
|
|
3
|
+
export { AdminForInstallatieTechniek } from './components/AdminForInstallatieTechniek';
|
|
4
|
+
export type { AdminForInstallatieTechniekProps, AdminModuleInput } from './components/AdminForInstallatieTechniek';
|
|
5
|
+
export { useModulePermission, useMyModulePermissions } from './hooks/useModulePermission';
|
|
6
|
+
export type { ModulePermission } from './hooks/useModulePermission';
|
|
7
|
+
export { useDiscoveredModules } from './lib/moduleDiscovery';
|
|
8
|
+
export type { DiscoveredModule } from './lib/moduleDiscovery';
|
|
9
|
+
export declare const adminInstallatietechniekModule: FlowModule;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AACvF,YAAY,EAAE,gCAAgC,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AACnH,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAC1F,YAAY,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG9D,eAAO,MAAM,8BAA8B,EAAE,UAY5C,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// src/index.ts — MODULE CONTRACT
|
|
3
|
+
// ============================================================================
|
|
4
|
+
import { Shield } from "lucide-react";
|
|
5
|
+
export * from './_core-safelist';
|
|
6
|
+
export { AdminForInstallatieTechniek } from './components/AdminForInstallatieTechniek';
|
|
7
|
+
export { useModulePermission, useMyModulePermissions } from './hooks/useModulePermission';
|
|
8
|
+
export { useDiscoveredModules } from './lib/moduleDiscovery';
|
|
9
|
+
export const adminInstallatietechniekModule = {
|
|
10
|
+
id: "admin-installatietechniek",
|
|
11
|
+
name: "Admin Installatietechniek",
|
|
12
|
+
version: "1.0.0",
|
|
13
|
+
nav: {
|
|
14
|
+
label: "Admin",
|
|
15
|
+
href: "/admin-installatietechniek",
|
|
16
|
+
icon: Shield,
|
|
17
|
+
},
|
|
18
|
+
settingsCards: [],
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-attacher.d.ts","sourceRoot":"","sources":["../../../src/integrations/supabase/auth-attacher.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,kBAAkB,mHAQ9B,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This file is automatically generated. Do not edit it directly.
|
|
2
|
+
import { createMiddleware } from '@tanstack/react-start';
|
|
3
|
+
import { supabase } from './client';
|
|
4
|
+
// Must be registered as a global `functionMiddleware` in `src/start.ts`; otherwise
|
|
5
|
+
// the browser never attaches the bearer token to serverFn RPCs.
|
|
6
|
+
export const attachSupabaseAuth = createMiddleware({ type: 'function' }).client(async ({ next }) => {
|
|
7
|
+
const { data } = await supabase.auth.getSession();
|
|
8
|
+
const token = data.session?.access_token;
|
|
9
|
+
return next({
|
|
10
|
+
headers: token ? { Authorization: `Bearer ${token}` } : {},
|
|
11
|
+
});
|
|
12
|
+
});
|