@eintrek/erp-shell 0.1.22 → 0.1.25
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/auth/permission-provider.d.ts +6 -8
- package/dist/auth/permission-utils.d.ts +24 -7
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +154 -49
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +153 -47
- package/dist/index.js.map +1 -1
- package/dist/navigation/nav-user.d.ts +13 -1
- package/dist/navigation/navigation-data-helpers.d.ts +6 -2
- package/dist/providers/permission-rules-context.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
/** Cross-app / module link shown in the user menu (e.g. Accounting, HR). */
|
|
3
|
+
export interface NavUserSystemLink {
|
|
4
|
+
label: string;
|
|
5
|
+
href: string;
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
}
|
|
1
8
|
export interface NavUserProps {
|
|
2
9
|
/**
|
|
3
10
|
* Currently-selected organization context. The shell only reads `name`,
|
|
@@ -26,5 +33,10 @@ export interface NavUserProps {
|
|
|
26
33
|
selectOrganizationHref?: string;
|
|
27
34
|
/** Redirect after signOut. Default: "/auth/signin". */
|
|
28
35
|
signInRedirectHref?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Links to sibling ERP apps (Accounting, HR, …). Absolute URLs preferred
|
|
38
|
+
* so navigation works across origins; relative paths use the Next router.
|
|
39
|
+
*/
|
|
40
|
+
systemLinks?: NavUserSystemLink[];
|
|
29
41
|
}
|
|
30
|
-
export declare function NavUser({ organization, avatarSrc, profileHref, selectOrganizationHref, signInRedirectHref, }?: NavUserProps): import("react/jsx-runtime").JSX.Element | null;
|
|
42
|
+
export declare function NavUser({ organization, avatarSrc, profileHref, selectOrganizationHref, signInRedirectHref, systemLinks, }?: NavUserProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -2,8 +2,12 @@ import type { PermissionRulesMap } from "../providers/permission-rules-context";
|
|
|
2
2
|
import type { Module, Tool } from "./navigation-types";
|
|
3
3
|
/**
|
|
4
4
|
* True when the user's child-group segments include at least one of the
|
|
5
|
-
* groups required for `permissionRouteKey`.
|
|
6
|
-
*
|
|
5
|
+
* groups required for `permissionRouteKey`.
|
|
6
|
+
*
|
|
7
|
+
* Fail-closed:
|
|
8
|
+
* - Nav item without `permissionRouteKey` → deny (must declare a key)
|
|
9
|
+
* - Key absent from `rulesMap` → deny (unknown route is not public)
|
|
10
|
+
* - Key present with `required_child_groups: []` → allow (explicit public)
|
|
7
11
|
*/
|
|
8
12
|
export declare function canAccessNavPermissionRoute(permissionRouteKey: string | undefined, rulesMap: PermissionRulesMap, userChildSegments: string[]): boolean;
|
|
9
13
|
/** Footer tools — same JWT child-group rules as main nav. */
|
|
@@ -48,8 +48,8 @@ export interface PermissionRulesProviderProps {
|
|
|
48
48
|
*/
|
|
49
49
|
export declare function PermissionRulesProvider({ children, data, isLoading, isError, fallbackPolicies, }: PermissionRulesProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
50
50
|
/**
|
|
51
|
-
* Read the permission rules.
|
|
52
|
-
*
|
|
51
|
+
* Read the permission rules. Outside the provider, report loading so
|
|
52
|
+
* fail-closed consumers (nav / gates) do not treat empty maps as "allow all".
|
|
53
53
|
*/
|
|
54
54
|
export declare function usePermissionRules(): PermissionRulesContextValue;
|
|
55
55
|
export {};
|