@invect/rbac 0.0.1 → 0.0.3
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/README.md +39 -77
- package/dist/backend/index.cjs +72 -40
- package/dist/backend/index.cjs.map +1 -1
- package/dist/backend/index.d.cts +49 -0
- package/dist/backend/index.d.cts.map +1 -0
- package/dist/backend/index.d.mts +49 -0
- package/dist/backend/index.d.mts.map +1 -0
- package/dist/backend/index.d.ts +1 -1
- package/dist/backend/index.d.ts.map +1 -1
- package/dist/backend/index.mjs +72 -40
- package/dist/backend/index.mjs.map +1 -1
- package/dist/backend/plugin.d.ts +12 -14
- package/dist/backend/plugin.d.ts.map +1 -1
- package/dist/frontend/components/TeamsPage.d.ts.map +1 -1
- package/dist/frontend/components/access-control/ScopeDetailPanel.d.ts.map +1 -1
- package/dist/frontend/components/access-control/index.d.ts +0 -1
- package/dist/frontend/components/access-control/index.d.ts.map +1 -1
- package/dist/frontend/index.cjs +61 -61
- package/dist/frontend/index.cjs.map +1 -1
- package/dist/frontend/index.d.cts +227 -0
- package/dist/frontend/index.d.cts.map +1 -0
- package/dist/frontend/index.d.mts +227 -0
- package/dist/frontend/index.d.mts.map +1 -0
- package/dist/frontend/index.d.ts +2 -2
- package/dist/frontend/index.d.ts.map +1 -1
- package/dist/frontend/index.mjs +7 -7
- package/dist/frontend/index.mjs.map +1 -1
- package/dist/frontend/types.d.ts +1 -1
- package/dist/shared/types.d.cts +2 -0
- package/dist/shared/types.d.mts +2 -0
- package/dist/types-D4DI2gyU.d.cts +175 -0
- package/dist/types-D4DI2gyU.d.cts.map +1 -0
- package/dist/types-DxJoguYy.d.mts +175 -0
- package/dist/types-DxJoguYy.d.mts.map +1 -0
- package/package.json +44 -46
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { C as ScopeTreeResponse, D as UpdateTeamRequest, E as TeamWithMembers, T as TeamMember, c as FlowAccessRecord, d as GrantScopeAccessRequest, i as CreateTeamRequest, m as MovePreviewResponse, n as AddTeamMemberRequest, o as EffectiveFlowAccessResponse, p as MovePreviewRequest, r as AuthMeResponse, t as AccessibleFlowsResponse, u as GrantFlowAccessRequest, w as Team, x as ScopeAccessRecord } from "../types-D4DI2gyU.cjs";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import { ComponentType, ReactNode } from "react";
|
|
4
|
+
import * as _tanstack_react_query0 from "@tanstack/react-query";
|
|
5
|
+
|
|
6
|
+
//#region src/frontend/providers/RbacProvider.d.ts
|
|
7
|
+
interface RbacContextValue {
|
|
8
|
+
/** Current user identity, null if not authenticated */
|
|
9
|
+
user: AuthMeResponse['identity'];
|
|
10
|
+
/** Whether the user is authenticated */
|
|
11
|
+
isAuthenticated: boolean;
|
|
12
|
+
/** Set of all permissions the user has */
|
|
13
|
+
permissions: Set<string>;
|
|
14
|
+
/** Check if the user has a specific permission */
|
|
15
|
+
checkPermission: (permission: string) => boolean;
|
|
16
|
+
/** Whether the auth/me query is still loading */
|
|
17
|
+
isLoading: boolean;
|
|
18
|
+
}
|
|
19
|
+
declare function RbacProvider({
|
|
20
|
+
children
|
|
21
|
+
}: {
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
24
|
+
/**
|
|
25
|
+
* Access RBAC context — current user, permissions, and permission checking.
|
|
26
|
+
*
|
|
27
|
+
* Must be used within an `<RbacProvider>`.
|
|
28
|
+
* Returns a safe fallback (unauthenticated, allow all) if provider is missing.
|
|
29
|
+
*/
|
|
30
|
+
declare function useRbac(): RbacContextValue;
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/frontend/types.d.ts
|
|
33
|
+
/**
|
|
34
|
+
* A frontend plugin that contributes UI to the Invect application.
|
|
35
|
+
* Plugins are registered via `<Invect plugins={[myPlugin]} />`.
|
|
36
|
+
*/
|
|
37
|
+
interface InvectFrontendPlugin {
|
|
38
|
+
/** Unique plugin ID — should match backend plugin ID for manifest resolution */
|
|
39
|
+
id: string;
|
|
40
|
+
/** Display name */
|
|
41
|
+
name?: string;
|
|
42
|
+
/** Add items to the sidebar navigation */
|
|
43
|
+
sidebar?: PluginSidebarContribution[];
|
|
44
|
+
/** Add top-level routes (pages) */
|
|
45
|
+
routes?: PluginRouteContribution[];
|
|
46
|
+
/** Add tabs to contextual panels (flow editor right panel, etc.) */
|
|
47
|
+
panelTabs?: PluginPanelTabContribution[];
|
|
48
|
+
/** Add action buttons/components to contextual headers */
|
|
49
|
+
headerActions?: PluginHeaderActionContribution[];
|
|
50
|
+
/**
|
|
51
|
+
* Named component implementations — resolved from backend componentIds.
|
|
52
|
+
* Key = componentId (e.g. 'rbac.FlowAccessPanel'), value = React component.
|
|
53
|
+
*/
|
|
54
|
+
components?: Record<string, ComponentType<Record<string, unknown>>>;
|
|
55
|
+
/** Wrap the React tree with additional providers (auth context, etc.) */
|
|
56
|
+
providers?: ComponentType<{
|
|
57
|
+
children: ReactNode;
|
|
58
|
+
}>[];
|
|
59
|
+
/**
|
|
60
|
+
* Inject headers into every API request.
|
|
61
|
+
* Called before each request. Return headers to merge.
|
|
62
|
+
*/
|
|
63
|
+
apiHeaders?: () => Record<string, string> | Promise<Record<string, string>>;
|
|
64
|
+
/**
|
|
65
|
+
* Check if the current user has a specific permission.
|
|
66
|
+
* Returns true/false to override, or undefined to defer to default.
|
|
67
|
+
*/
|
|
68
|
+
checkPermission?: (permission: string, context?: PermissionContext) => boolean | undefined;
|
|
69
|
+
}
|
|
70
|
+
interface PluginSidebarContribution {
|
|
71
|
+
label: string;
|
|
72
|
+
icon: ComponentType<{
|
|
73
|
+
className?: string;
|
|
74
|
+
}>;
|
|
75
|
+
path: string;
|
|
76
|
+
/** Position hint: 'top' (after defaults), 'bottom' (before theme toggle) */
|
|
77
|
+
position?: 'top' | 'bottom';
|
|
78
|
+
/** Required permission — item hidden if check fails */
|
|
79
|
+
permission?: string;
|
|
80
|
+
}
|
|
81
|
+
interface PluginRouteContribution {
|
|
82
|
+
path: string;
|
|
83
|
+
component: ComponentType<{
|
|
84
|
+
basePath: string;
|
|
85
|
+
}>;
|
|
86
|
+
/** If true, route is nested under the flow layout */
|
|
87
|
+
flowScoped?: boolean;
|
|
88
|
+
}
|
|
89
|
+
interface PluginPanelTabContribution {
|
|
90
|
+
/** Where the tab appears */
|
|
91
|
+
context: 'flowEditor' | 'nodeConfig';
|
|
92
|
+
label: string;
|
|
93
|
+
icon?: ComponentType<{
|
|
94
|
+
className?: string;
|
|
95
|
+
}>;
|
|
96
|
+
component: ComponentType<PanelTabProps>;
|
|
97
|
+
/** Required permission — tab hidden if check fails */
|
|
98
|
+
permission?: string;
|
|
99
|
+
}
|
|
100
|
+
interface PluginHeaderActionContribution {
|
|
101
|
+
/** Where the action appears */
|
|
102
|
+
context: 'flowHeader' | 'flowList';
|
|
103
|
+
component: ComponentType<HeaderActionProps>;
|
|
104
|
+
/** Required permission — action hidden if check fails */
|
|
105
|
+
permission?: string;
|
|
106
|
+
}
|
|
107
|
+
interface PanelTabProps {
|
|
108
|
+
flowId: string;
|
|
109
|
+
basePath: string;
|
|
110
|
+
}
|
|
111
|
+
interface HeaderActionProps {
|
|
112
|
+
flowId?: string;
|
|
113
|
+
basePath: string;
|
|
114
|
+
}
|
|
115
|
+
interface PermissionContext {
|
|
116
|
+
resourceType?: string;
|
|
117
|
+
resourceId?: string;
|
|
118
|
+
flowId?: string;
|
|
119
|
+
}
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region src/frontend/components/ShareButton.d.ts
|
|
122
|
+
declare function ShareButton({
|
|
123
|
+
flowId
|
|
124
|
+
}: HeaderActionProps): react_jsx_runtime0.JSX.Element | null;
|
|
125
|
+
//#endregion
|
|
126
|
+
//#region src/frontend/components/ShareFlowModal.d.ts
|
|
127
|
+
/**
|
|
128
|
+
* ShareFlowModal — Modal for managing flow access permissions.
|
|
129
|
+
*
|
|
130
|
+
* Shows current access records and allows granting/revoking access.
|
|
131
|
+
*/
|
|
132
|
+
interface ShareFlowModalProps {
|
|
133
|
+
flowId: string;
|
|
134
|
+
onClose: () => void;
|
|
135
|
+
}
|
|
136
|
+
declare function ShareFlowModal({
|
|
137
|
+
flowId,
|
|
138
|
+
onClose
|
|
139
|
+
}: ShareFlowModalProps): react_jsx_runtime0.JSX.Element;
|
|
140
|
+
//#endregion
|
|
141
|
+
//#region src/frontend/components/FlowAccessPanel.d.ts
|
|
142
|
+
declare function FlowAccessPanel({
|
|
143
|
+
flowId
|
|
144
|
+
}: PanelTabProps): react_jsx_runtime0.JSX.Element;
|
|
145
|
+
//#endregion
|
|
146
|
+
//#region src/frontend/components/access-control/AccessControlPage.d.ts
|
|
147
|
+
declare function AccessControlPage(): react_jsx_runtime0.JSX.Element;
|
|
148
|
+
//#endregion
|
|
149
|
+
//#region src/frontend/components/TeamsPage.d.ts
|
|
150
|
+
/**
|
|
151
|
+
* TeamsPage — Team management page with create/edit/delete teams and member management.
|
|
152
|
+
*/
|
|
153
|
+
declare function TeamsPage(): react_jsx_runtime0.JSX.Element;
|
|
154
|
+
//#endregion
|
|
155
|
+
//#region src/frontend/components/UserMenuSection.d.ts
|
|
156
|
+
/**
|
|
157
|
+
* UserMenuSection — Sidebar footer component showing current user info.
|
|
158
|
+
*
|
|
159
|
+
* Displays the authenticated user's name and role in the sidebar footer area.
|
|
160
|
+
* This is a standalone component — not directly injected via plugin system
|
|
161
|
+
* but available for host apps to use in custom sidebar layouts.
|
|
162
|
+
*/
|
|
163
|
+
declare function UserMenuSection({
|
|
164
|
+
collapsed
|
|
165
|
+
}: {
|
|
166
|
+
collapsed?: boolean;
|
|
167
|
+
}): react_jsx_runtime0.JSX.Element | null;
|
|
168
|
+
declare function UserAvatar({
|
|
169
|
+
className
|
|
170
|
+
}: {
|
|
171
|
+
className?: string;
|
|
172
|
+
}): react_jsx_runtime0.JSX.Element | null;
|
|
173
|
+
//#endregion
|
|
174
|
+
//#region src/frontend/hooks/useFlowAccess.d.ts
|
|
175
|
+
/** Fetch access records for a specific flow */
|
|
176
|
+
declare function useFlowAccess(flowId: string | undefined): _tanstack_react_query0.UseQueryResult<{
|
|
177
|
+
access: FlowAccessRecord[];
|
|
178
|
+
}, Error>;
|
|
179
|
+
/** Fetch all flow IDs accessible to the current user with their effective permission */
|
|
180
|
+
declare function useAccessibleFlows(): _tanstack_react_query0.UseQueryResult<AccessibleFlowsResponse, Error>;
|
|
181
|
+
/** Grant access to a flow */
|
|
182
|
+
declare function useGrantFlowAccess(flowId: string): _tanstack_react_query0.UseMutationResult<any, Error, GrantFlowAccessRequest, unknown>;
|
|
183
|
+
/** Revoke a specific access record */
|
|
184
|
+
declare function useRevokeFlowAccess(flowId: string): _tanstack_react_query0.UseMutationResult<void, Error, string, unknown>;
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region src/frontend/hooks/useTeams.d.ts
|
|
187
|
+
/** List all teams */
|
|
188
|
+
declare function useTeams(): _tanstack_react_query0.UseQueryResult<{
|
|
189
|
+
teams: Team[];
|
|
190
|
+
}, Error>;
|
|
191
|
+
/** Get a single team with members */
|
|
192
|
+
declare function useTeam(teamId: string | undefined): _tanstack_react_query0.UseQueryResult<TeamWithMembers, Error>;
|
|
193
|
+
/** Get current user's teams */
|
|
194
|
+
declare function useMyTeams(): _tanstack_react_query0.UseQueryResult<{
|
|
195
|
+
teams: Team[];
|
|
196
|
+
}, Error>;
|
|
197
|
+
/** Create a team */
|
|
198
|
+
declare function useCreateTeam(): _tanstack_react_query0.UseMutationResult<Team, Error, CreateTeamRequest, unknown>;
|
|
199
|
+
/** Update a team */
|
|
200
|
+
declare function useUpdateTeam(teamId: string): _tanstack_react_query0.UseMutationResult<any, Error, UpdateTeamRequest, unknown>;
|
|
201
|
+
/** Delete a team */
|
|
202
|
+
declare function useDeleteTeam(): _tanstack_react_query0.UseMutationResult<void, Error, string, unknown>;
|
|
203
|
+
/** Add a member to a team */
|
|
204
|
+
declare function useAddTeamMember(teamId: string): _tanstack_react_query0.UseMutationResult<TeamMember, Error, AddTeamMemberRequest, unknown>;
|
|
205
|
+
/** Remove a member from a team */
|
|
206
|
+
declare function useRemoveTeamMember(teamId: string): _tanstack_react_query0.UseMutationResult<void, Error, string, unknown>;
|
|
207
|
+
//#endregion
|
|
208
|
+
//#region src/frontend/hooks/useScopes.d.ts
|
|
209
|
+
declare function useScopeTree(): _tanstack_react_query0.UseQueryResult<ScopeTreeResponse, Error>;
|
|
210
|
+
declare function useScopeAccess(scopeId: string | undefined): _tanstack_react_query0.UseQueryResult<{
|
|
211
|
+
access: ScopeAccessRecord[];
|
|
212
|
+
}, Error>;
|
|
213
|
+
declare function useGrantScopeAccess(scopeId: string): _tanstack_react_query0.UseMutationResult<ScopeAccessRecord, Error, GrantScopeAccessRequest, unknown>;
|
|
214
|
+
declare function useRevokeScopeAccess(scopeId: string): _tanstack_react_query0.UseMutationResult<void, Error, string, unknown>;
|
|
215
|
+
declare function useEffectiveFlowAccess(flowId: string | undefined): _tanstack_react_query0.UseQueryResult<EffectiveFlowAccessResponse, Error>;
|
|
216
|
+
declare function useMoveFlow(flowId: string): _tanstack_react_query0.UseMutationResult<{
|
|
217
|
+
success: boolean;
|
|
218
|
+
flowId: string;
|
|
219
|
+
scopeId: string | null;
|
|
220
|
+
}, Error, string | null, unknown>;
|
|
221
|
+
declare function usePreviewMove(): _tanstack_react_query0.UseMutationResult<MovePreviewResponse, Error, MovePreviewRequest, unknown>;
|
|
222
|
+
//#endregion
|
|
223
|
+
//#region src/frontend/index.d.ts
|
|
224
|
+
declare const rbacFrontend: InvectFrontendPlugin;
|
|
225
|
+
//#endregion
|
|
226
|
+
export { AccessControlPage, FlowAccessPanel, type HeaderActionProps, type InvectFrontendPlugin, type PanelTabProps, type PermissionContext, type PluginHeaderActionContribution, type PluginPanelTabContribution, type PluginRouteContribution, type PluginSidebarContribution, RbacProvider, ShareButton, ShareFlowModal, TeamsPage, UserAvatar, UserMenuSection, rbacFrontend, useAccessibleFlows, useAddTeamMember, useCreateTeam, useDeleteTeam, useEffectiveFlowAccess, useFlowAccess, useGrantFlowAccess, useGrantScopeAccess, useMoveFlow, useMyTeams, usePreviewMove, useRbac, useRemoveTeamMember, useRevokeFlowAccess, useRevokeScopeAccess, useScopeAccess, useScopeTree, useTeam, useTeams, useUpdateTeam };
|
|
227
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/frontend/providers/RbacProvider.tsx","../../src/frontend/types.ts","../../src/frontend/components/ShareButton.tsx","../../src/frontend/components/ShareFlowModal.tsx","../../src/frontend/components/FlowAccessPanel.tsx","../../src/frontend/components/access-control/AccessControlPage.tsx","../../src/frontend/components/TeamsPage.tsx","../../src/frontend/components/UserMenuSection.tsx","../../src/frontend/hooks/useFlowAccess.ts","../../src/frontend/hooks/useTeams.ts","../../src/frontend/hooks/useScopes.ts","../../src/frontend/index.ts"],"mappings":";;;;;;UAkBiB,gBAAA;EAET;EAAN,IAAA,EAAM,cAAA;EAIN;EAFA,eAAA;EAIA;EAFA,WAAA,EAAa,GAAA;EAIb;EAFA,eAAA,GAAkB,UAAA;EAET;EAAT,SAAA;AAAA;AAAA,iBAac,YAAA,CAAA;EAAe;AAAA;EAAc,QAAA,EAAU,SAAA;AAAA,IAAW,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;;;;iBA2DlD,OAAA,CAAA,GAAW,gBAAA;;;;;;;UCnFV,oBAAA;EDKf;ECHA,EAAA;EDKa;ECFb,IAAA;EDIkB;ECDlB,OAAA,GAAU,yBAAA;EDGD;ECAT,MAAA,GAAS,uBAAA;EDaK;ECVd,SAAA,GAAY,0BAAA;;EAGZ,aAAA,GAAgB,8BAAA;EDOqC;;;;ECDrD,UAAA,GAAa,MAAA,SAAe,aAAA,CAAc,MAAA;EDCb;ECE7B,SAAA,GAAY,aAAA;IAAgB,QAAA,EAAU,SAAA;EAAA;EDF0B;;;AA2DlE;ECnDE,UAAA,SAAmB,MAAA,mBAAyB,OAAA,CAAQ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A,CAAA,iBAAA,EAAA,KAAA,EAAA,uBAAA;AAAA,iBAyBnC,oBAAA,CAAqB,OAAA,WAAe,sBAAA,CAAA,iBAAA,OAAA,KAAA;AAAA,iBAyBpC,sBAAA,CAAuB,MAAA,uBAA0B,sBAAA,CAAA,cAAA,CAAA,2BAAA,EAAA,KAAA;AAAA,iBAoBjD,WAAA,CAAY,MAAA,WAAD,sBAAA,CAAe,iBAAA;;;;GAAf,KAAA;AAAA,iBA8BX,cAAA,CAAA,GAAc,sBAAA,CAAA,iBAAA,CAAA,mBAAA,EAAA,KAAA,EAAA,kBAAA;;;cChIjB,YAAA,EAAc,oBAAA"}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { C as ScopeTreeResponse, D as UpdateTeamRequest, E as TeamWithMembers, T as TeamMember, c as FlowAccessRecord, d as GrantScopeAccessRequest, i as CreateTeamRequest, m as MovePreviewResponse, n as AddTeamMemberRequest, o as EffectiveFlowAccessResponse, p as MovePreviewRequest, r as AuthMeResponse, t as AccessibleFlowsResponse, u as GrantFlowAccessRequest, w as Team, x as ScopeAccessRecord } from "../types-DxJoguYy.mjs";
|
|
2
|
+
import { ComponentType, ReactNode } from "react";
|
|
3
|
+
import * as _tanstack_react_query0 from "@tanstack/react-query";
|
|
4
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/frontend/providers/RbacProvider.d.ts
|
|
7
|
+
interface RbacContextValue {
|
|
8
|
+
/** Current user identity, null if not authenticated */
|
|
9
|
+
user: AuthMeResponse['identity'];
|
|
10
|
+
/** Whether the user is authenticated */
|
|
11
|
+
isAuthenticated: boolean;
|
|
12
|
+
/** Set of all permissions the user has */
|
|
13
|
+
permissions: Set<string>;
|
|
14
|
+
/** Check if the user has a specific permission */
|
|
15
|
+
checkPermission: (permission: string) => boolean;
|
|
16
|
+
/** Whether the auth/me query is still loading */
|
|
17
|
+
isLoading: boolean;
|
|
18
|
+
}
|
|
19
|
+
declare function RbacProvider({
|
|
20
|
+
children
|
|
21
|
+
}: {
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
24
|
+
/**
|
|
25
|
+
* Access RBAC context — current user, permissions, and permission checking.
|
|
26
|
+
*
|
|
27
|
+
* Must be used within an `<RbacProvider>`.
|
|
28
|
+
* Returns a safe fallback (unauthenticated, allow all) if provider is missing.
|
|
29
|
+
*/
|
|
30
|
+
declare function useRbac(): RbacContextValue;
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/frontend/types.d.ts
|
|
33
|
+
/**
|
|
34
|
+
* A frontend plugin that contributes UI to the Invect application.
|
|
35
|
+
* Plugins are registered via `<Invect plugins={[myPlugin]} />`.
|
|
36
|
+
*/
|
|
37
|
+
interface InvectFrontendPlugin {
|
|
38
|
+
/** Unique plugin ID — should match backend plugin ID for manifest resolution */
|
|
39
|
+
id: string;
|
|
40
|
+
/** Display name */
|
|
41
|
+
name?: string;
|
|
42
|
+
/** Add items to the sidebar navigation */
|
|
43
|
+
sidebar?: PluginSidebarContribution[];
|
|
44
|
+
/** Add top-level routes (pages) */
|
|
45
|
+
routes?: PluginRouteContribution[];
|
|
46
|
+
/** Add tabs to contextual panels (flow editor right panel, etc.) */
|
|
47
|
+
panelTabs?: PluginPanelTabContribution[];
|
|
48
|
+
/** Add action buttons/components to contextual headers */
|
|
49
|
+
headerActions?: PluginHeaderActionContribution[];
|
|
50
|
+
/**
|
|
51
|
+
* Named component implementations — resolved from backend componentIds.
|
|
52
|
+
* Key = componentId (e.g. 'rbac.FlowAccessPanel'), value = React component.
|
|
53
|
+
*/
|
|
54
|
+
components?: Record<string, ComponentType<Record<string, unknown>>>;
|
|
55
|
+
/** Wrap the React tree with additional providers (auth context, etc.) */
|
|
56
|
+
providers?: ComponentType<{
|
|
57
|
+
children: ReactNode;
|
|
58
|
+
}>[];
|
|
59
|
+
/**
|
|
60
|
+
* Inject headers into every API request.
|
|
61
|
+
* Called before each request. Return headers to merge.
|
|
62
|
+
*/
|
|
63
|
+
apiHeaders?: () => Record<string, string> | Promise<Record<string, string>>;
|
|
64
|
+
/**
|
|
65
|
+
* Check if the current user has a specific permission.
|
|
66
|
+
* Returns true/false to override, or undefined to defer to default.
|
|
67
|
+
*/
|
|
68
|
+
checkPermission?: (permission: string, context?: PermissionContext) => boolean | undefined;
|
|
69
|
+
}
|
|
70
|
+
interface PluginSidebarContribution {
|
|
71
|
+
label: string;
|
|
72
|
+
icon: ComponentType<{
|
|
73
|
+
className?: string;
|
|
74
|
+
}>;
|
|
75
|
+
path: string;
|
|
76
|
+
/** Position hint: 'top' (after defaults), 'bottom' (before theme toggle) */
|
|
77
|
+
position?: 'top' | 'bottom';
|
|
78
|
+
/** Required permission — item hidden if check fails */
|
|
79
|
+
permission?: string;
|
|
80
|
+
}
|
|
81
|
+
interface PluginRouteContribution {
|
|
82
|
+
path: string;
|
|
83
|
+
component: ComponentType<{
|
|
84
|
+
basePath: string;
|
|
85
|
+
}>;
|
|
86
|
+
/** If true, route is nested under the flow layout */
|
|
87
|
+
flowScoped?: boolean;
|
|
88
|
+
}
|
|
89
|
+
interface PluginPanelTabContribution {
|
|
90
|
+
/** Where the tab appears */
|
|
91
|
+
context: 'flowEditor' | 'nodeConfig';
|
|
92
|
+
label: string;
|
|
93
|
+
icon?: ComponentType<{
|
|
94
|
+
className?: string;
|
|
95
|
+
}>;
|
|
96
|
+
component: ComponentType<PanelTabProps>;
|
|
97
|
+
/** Required permission — tab hidden if check fails */
|
|
98
|
+
permission?: string;
|
|
99
|
+
}
|
|
100
|
+
interface PluginHeaderActionContribution {
|
|
101
|
+
/** Where the action appears */
|
|
102
|
+
context: 'flowHeader' | 'flowList';
|
|
103
|
+
component: ComponentType<HeaderActionProps>;
|
|
104
|
+
/** Required permission — action hidden if check fails */
|
|
105
|
+
permission?: string;
|
|
106
|
+
}
|
|
107
|
+
interface PanelTabProps {
|
|
108
|
+
flowId: string;
|
|
109
|
+
basePath: string;
|
|
110
|
+
}
|
|
111
|
+
interface HeaderActionProps {
|
|
112
|
+
flowId?: string;
|
|
113
|
+
basePath: string;
|
|
114
|
+
}
|
|
115
|
+
interface PermissionContext {
|
|
116
|
+
resourceType?: string;
|
|
117
|
+
resourceId?: string;
|
|
118
|
+
flowId?: string;
|
|
119
|
+
}
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region src/frontend/components/ShareButton.d.ts
|
|
122
|
+
declare function ShareButton({
|
|
123
|
+
flowId
|
|
124
|
+
}: HeaderActionProps): react_jsx_runtime0.JSX.Element | null;
|
|
125
|
+
//#endregion
|
|
126
|
+
//#region src/frontend/components/ShareFlowModal.d.ts
|
|
127
|
+
/**
|
|
128
|
+
* ShareFlowModal — Modal for managing flow access permissions.
|
|
129
|
+
*
|
|
130
|
+
* Shows current access records and allows granting/revoking access.
|
|
131
|
+
*/
|
|
132
|
+
interface ShareFlowModalProps {
|
|
133
|
+
flowId: string;
|
|
134
|
+
onClose: () => void;
|
|
135
|
+
}
|
|
136
|
+
declare function ShareFlowModal({
|
|
137
|
+
flowId,
|
|
138
|
+
onClose
|
|
139
|
+
}: ShareFlowModalProps): react_jsx_runtime0.JSX.Element;
|
|
140
|
+
//#endregion
|
|
141
|
+
//#region src/frontend/components/FlowAccessPanel.d.ts
|
|
142
|
+
declare function FlowAccessPanel({
|
|
143
|
+
flowId
|
|
144
|
+
}: PanelTabProps): react_jsx_runtime0.JSX.Element;
|
|
145
|
+
//#endregion
|
|
146
|
+
//#region src/frontend/components/access-control/AccessControlPage.d.ts
|
|
147
|
+
declare function AccessControlPage(): react_jsx_runtime0.JSX.Element;
|
|
148
|
+
//#endregion
|
|
149
|
+
//#region src/frontend/components/TeamsPage.d.ts
|
|
150
|
+
/**
|
|
151
|
+
* TeamsPage — Team management page with create/edit/delete teams and member management.
|
|
152
|
+
*/
|
|
153
|
+
declare function TeamsPage(): react_jsx_runtime0.JSX.Element;
|
|
154
|
+
//#endregion
|
|
155
|
+
//#region src/frontend/components/UserMenuSection.d.ts
|
|
156
|
+
/**
|
|
157
|
+
* UserMenuSection — Sidebar footer component showing current user info.
|
|
158
|
+
*
|
|
159
|
+
* Displays the authenticated user's name and role in the sidebar footer area.
|
|
160
|
+
* This is a standalone component — not directly injected via plugin system
|
|
161
|
+
* but available for host apps to use in custom sidebar layouts.
|
|
162
|
+
*/
|
|
163
|
+
declare function UserMenuSection({
|
|
164
|
+
collapsed
|
|
165
|
+
}: {
|
|
166
|
+
collapsed?: boolean;
|
|
167
|
+
}): react_jsx_runtime0.JSX.Element | null;
|
|
168
|
+
declare function UserAvatar({
|
|
169
|
+
className
|
|
170
|
+
}: {
|
|
171
|
+
className?: string;
|
|
172
|
+
}): react_jsx_runtime0.JSX.Element | null;
|
|
173
|
+
//#endregion
|
|
174
|
+
//#region src/frontend/hooks/useFlowAccess.d.ts
|
|
175
|
+
/** Fetch access records for a specific flow */
|
|
176
|
+
declare function useFlowAccess(flowId: string | undefined): _tanstack_react_query0.UseQueryResult<{
|
|
177
|
+
access: FlowAccessRecord[];
|
|
178
|
+
}, Error>;
|
|
179
|
+
/** Fetch all flow IDs accessible to the current user with their effective permission */
|
|
180
|
+
declare function useAccessibleFlows(): _tanstack_react_query0.UseQueryResult<AccessibleFlowsResponse, Error>;
|
|
181
|
+
/** Grant access to a flow */
|
|
182
|
+
declare function useGrantFlowAccess(flowId: string): _tanstack_react_query0.UseMutationResult<any, Error, GrantFlowAccessRequest, unknown>;
|
|
183
|
+
/** Revoke a specific access record */
|
|
184
|
+
declare function useRevokeFlowAccess(flowId: string): _tanstack_react_query0.UseMutationResult<void, Error, string, unknown>;
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region src/frontend/hooks/useTeams.d.ts
|
|
187
|
+
/** List all teams */
|
|
188
|
+
declare function useTeams(): _tanstack_react_query0.UseQueryResult<{
|
|
189
|
+
teams: Team[];
|
|
190
|
+
}, Error>;
|
|
191
|
+
/** Get a single team with members */
|
|
192
|
+
declare function useTeam(teamId: string | undefined): _tanstack_react_query0.UseQueryResult<TeamWithMembers, Error>;
|
|
193
|
+
/** Get current user's teams */
|
|
194
|
+
declare function useMyTeams(): _tanstack_react_query0.UseQueryResult<{
|
|
195
|
+
teams: Team[];
|
|
196
|
+
}, Error>;
|
|
197
|
+
/** Create a team */
|
|
198
|
+
declare function useCreateTeam(): _tanstack_react_query0.UseMutationResult<Team, Error, CreateTeamRequest, unknown>;
|
|
199
|
+
/** Update a team */
|
|
200
|
+
declare function useUpdateTeam(teamId: string): _tanstack_react_query0.UseMutationResult<any, Error, UpdateTeamRequest, unknown>;
|
|
201
|
+
/** Delete a team */
|
|
202
|
+
declare function useDeleteTeam(): _tanstack_react_query0.UseMutationResult<void, Error, string, unknown>;
|
|
203
|
+
/** Add a member to a team */
|
|
204
|
+
declare function useAddTeamMember(teamId: string): _tanstack_react_query0.UseMutationResult<TeamMember, Error, AddTeamMemberRequest, unknown>;
|
|
205
|
+
/** Remove a member from a team */
|
|
206
|
+
declare function useRemoveTeamMember(teamId: string): _tanstack_react_query0.UseMutationResult<void, Error, string, unknown>;
|
|
207
|
+
//#endregion
|
|
208
|
+
//#region src/frontend/hooks/useScopes.d.ts
|
|
209
|
+
declare function useScopeTree(): _tanstack_react_query0.UseQueryResult<ScopeTreeResponse, Error>;
|
|
210
|
+
declare function useScopeAccess(scopeId: string | undefined): _tanstack_react_query0.UseQueryResult<{
|
|
211
|
+
access: ScopeAccessRecord[];
|
|
212
|
+
}, Error>;
|
|
213
|
+
declare function useGrantScopeAccess(scopeId: string): _tanstack_react_query0.UseMutationResult<ScopeAccessRecord, Error, GrantScopeAccessRequest, unknown>;
|
|
214
|
+
declare function useRevokeScopeAccess(scopeId: string): _tanstack_react_query0.UseMutationResult<void, Error, string, unknown>;
|
|
215
|
+
declare function useEffectiveFlowAccess(flowId: string | undefined): _tanstack_react_query0.UseQueryResult<EffectiveFlowAccessResponse, Error>;
|
|
216
|
+
declare function useMoveFlow(flowId: string): _tanstack_react_query0.UseMutationResult<{
|
|
217
|
+
success: boolean;
|
|
218
|
+
flowId: string;
|
|
219
|
+
scopeId: string | null;
|
|
220
|
+
}, Error, string | null, unknown>;
|
|
221
|
+
declare function usePreviewMove(): _tanstack_react_query0.UseMutationResult<MovePreviewResponse, Error, MovePreviewRequest, unknown>;
|
|
222
|
+
//#endregion
|
|
223
|
+
//#region src/frontend/index.d.ts
|
|
224
|
+
declare const rbacFrontend: InvectFrontendPlugin;
|
|
225
|
+
//#endregion
|
|
226
|
+
export { AccessControlPage, FlowAccessPanel, type HeaderActionProps, type InvectFrontendPlugin, type PanelTabProps, type PermissionContext, type PluginHeaderActionContribution, type PluginPanelTabContribution, type PluginRouteContribution, type PluginSidebarContribution, RbacProvider, ShareButton, ShareFlowModal, TeamsPage, UserAvatar, UserMenuSection, rbacFrontend, useAccessibleFlows, useAddTeamMember, useCreateTeam, useDeleteTeam, useEffectiveFlowAccess, useFlowAccess, useGrantFlowAccess, useGrantScopeAccess, useMoveFlow, useMyTeams, usePreviewMove, useRbac, useRemoveTeamMember, useRevokeFlowAccess, useRevokeScopeAccess, useScopeAccess, useScopeTree, useTeam, useTeams, useUpdateTeam };
|
|
227
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/frontend/providers/RbacProvider.tsx","../../src/frontend/types.ts","../../src/frontend/components/ShareButton.tsx","../../src/frontend/components/ShareFlowModal.tsx","../../src/frontend/components/FlowAccessPanel.tsx","../../src/frontend/components/access-control/AccessControlPage.tsx","../../src/frontend/components/TeamsPage.tsx","../../src/frontend/components/UserMenuSection.tsx","../../src/frontend/hooks/useFlowAccess.ts","../../src/frontend/hooks/useTeams.ts","../../src/frontend/hooks/useScopes.ts","../../src/frontend/index.ts"],"mappings":";;;;;;UAkBiB,gBAAA;EAET;EAAN,IAAA,EAAM,cAAA;EAIN;EAFA,eAAA;EAIA;EAFA,WAAA,EAAa,GAAA;EAIb;EAFA,eAAA,GAAkB,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A,EAAA,KAAA,EAAA,iBAAA;;iBA0Bb,aAAA,CAAc,MAAA,WAAc,sBAAA,CAAA,iBAAA,MAAA,KAAA,EAAA,iBAAA;;iBA2B5B,aAAA,CAAA,GAAa,sBAAA,CAAA,iBAAA,OAAA,KAAA;ATnF7B;AAAA,iBS0GgB,gBAAA,CAAiB,MAAA,WAAc,sBAAA,CAAA,iBAAA,CAAA,UAAA,EAAA,KAAA,EAAA,oBAAA;;iBA2B/B,mBAAA,CAAoB,MAAA,WAAc,sBAAA,CAAA,iBAAA,OAAA,KAAA;;;iBCnKlC,YAAA,CAAA,GAAY,sBAAA,CAAA,cAAA,CAAA,iBAAA,EAAA,KAAA;AAAA,iBAkBZ,cAAA,CAAe,OAAA,8CAA2B,cAAA;UAG9B,iBAAA;AAAA;iBAgBZ,mBAAA,CAAoB,OAAA,WAAe,sBAAA,CAAA,iBAAA,CAAA,iBAAA,EAAA,KAAA,EAAA,uBAAA;AAAA,iBAyBnC,oBAAA,CAAqB,OAAA,WAAe,sBAAA,CAAA,iBAAA,OAAA,KAAA;AAAA,iBAyBpC,sBAAA,CAAuB,MAAA,uBAA0B,sBAAA,CAAA,cAAA,CAAA,2BAAA,EAAA,KAAA;AAAA,iBAoBjD,WAAA,CAAY,MAAA,WAAD,sBAAA,CAAe,iBAAA;;;;GAAf,KAAA;AAAA,iBA8BX,cAAA,CAAA,GAAc,sBAAA,CAAA,iBAAA,CAAA,mBAAA,EAAA,KAAA,EAAA,kBAAA;;;cChIjB,YAAA,EAAc,oBAAA"}
|
package/dist/frontend/index.d.ts
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* @invect/rbac/ui — Frontend Plugin Entry Point
|
|
3
3
|
*
|
|
4
4
|
* This is the browser-safe entry point that exports the RBAC frontend plugin.
|
|
5
|
-
* Import via: `import {
|
|
5
|
+
* Import via: `import { rbacFrontend } from '@invect/rbac/ui'`
|
|
6
6
|
*
|
|
7
7
|
* No Node.js dependencies. No @invect/core runtime imports.
|
|
8
8
|
*/
|
|
9
9
|
import { RbacProvider, useRbac } from './providers/RbacProvider';
|
|
10
10
|
import type { InvectFrontendPlugin } from './types';
|
|
11
|
-
export declare const
|
|
11
|
+
export declare const rbacFrontend: InvectFrontendPlugin;
|
|
12
12
|
export { RbacProvider, useRbac };
|
|
13
13
|
export { ShareButton } from './components/ShareButton';
|
|
14
14
|
export { ShareFlowModal } from './components/ShareFlowModal';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/frontend/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAIjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAMpD,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/frontend/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAIjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAMpD,eAAO,MAAM,YAAY,EAAE,oBAqE1B,CAAC;AAOF,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC;AAGjC,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAG3E,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,QAAQ,EACR,OAAO,EACP,UAAU,EACV,aAAa,EACb,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,WAAW,EACX,cAAc,GACf,MAAM,mBAAmB,CAAC;AAG3B,YAAY,EACV,oBAAoB,EACpB,yBAAyB,EACzB,uBAAuB,EACvB,0BAA0B,EAC1B,8BAA8B,EAC9B,aAAa,EACb,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,SAAS,CAAC"}
|
package/dist/frontend/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ChevronDown, ChevronRight, ExternalLink, FolderInput, GripVertical, Move, Plus, Search, Share2, Shield, Trash2, User, Users, Workflow, X } from "lucide-react";
|
|
2
2
|
import { Fragment, createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
4
|
-
import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, PageLayout, useApiClient } from "@invect/
|
|
4
|
+
import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, PageLayout, useApiClient } from "@invect/ui";
|
|
5
5
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { clsx } from "clsx";
|
|
7
7
|
import { twMerge } from "tailwind-merge";
|
|
@@ -339,7 +339,7 @@ function ShareFlowModal({ flowId, onClose }) {
|
|
|
339
339
|
/* @__PURE__ */ jsx("div", { className: "my-1 border-t border-imp-border" }),
|
|
340
340
|
/* @__PURE__ */ jsx("button", {
|
|
341
341
|
type: "button",
|
|
342
|
-
className: "w-full px-3 py-1.5 text-left text-xs text-
|
|
342
|
+
className: "w-full px-3 py-1.5 text-left text-xs text-imp-destructive hover:bg-imp-destructive/10",
|
|
343
343
|
onClick: () => {
|
|
344
344
|
handleRevoke(record.id);
|
|
345
345
|
setOpenRoleDropdown(null);
|
|
@@ -1097,7 +1097,7 @@ function AccessTable({ rows, isLoading, emptyLabel }) {
|
|
|
1097
1097
|
children: row.canRemove && row.onRemove ? /* @__PURE__ */ jsx("button", {
|
|
1098
1098
|
type: "button",
|
|
1099
1099
|
onClick: () => setPendingRemovalRow(row),
|
|
1100
|
-
className: "p-1 rounded text-imp-muted-foreground hover:bg-
|
|
1100
|
+
className: "p-1 rounded text-imp-muted-foreground hover:bg-imp-destructive/10 hover:text-imp-destructive",
|
|
1101
1101
|
children: /* @__PURE__ */ jsx(Trash2, { className: "h-3.5 w-3.5" })
|
|
1102
1102
|
}) : null
|
|
1103
1103
|
})
|
|
@@ -1341,7 +1341,7 @@ function ScopeDetailPanel({ scopeId, scopeName, users, userMap, teams, isAdmin }
|
|
|
1341
1341
|
children: /* @__PURE__ */ jsxs("button", {
|
|
1342
1342
|
type: "button",
|
|
1343
1343
|
onClick: () => setShowDeleteConfirm(true),
|
|
1344
|
-
className: "flex items-center gap-1.5 rounded-md border border-
|
|
1344
|
+
className: "flex items-center gap-1.5 rounded-md border border-imp-destructive/30 px-3 py-1.5 text-xs font-medium text-imp-destructive transition-colors hover:bg-imp-destructive/10",
|
|
1345
1345
|
children: [/* @__PURE__ */ jsx(Trash2, { className: "w-4 h-4" }), " Delete team"]
|
|
1346
1346
|
})
|
|
1347
1347
|
}) : null]
|
|
@@ -2855,11 +2855,11 @@ function UserAvatar({ className }) {
|
|
|
2855
2855
|
* @invect/rbac/ui — Frontend Plugin Entry Point
|
|
2856
2856
|
*
|
|
2857
2857
|
* This is the browser-safe entry point that exports the RBAC frontend plugin.
|
|
2858
|
-
* Import via: `import {
|
|
2858
|
+
* Import via: `import { rbacFrontend } from '@invect/rbac/ui'`
|
|
2859
2859
|
*
|
|
2860
2860
|
* No Node.js dependencies. No @invect/core runtime imports.
|
|
2861
2861
|
*/
|
|
2862
|
-
const
|
|
2862
|
+
const rbacFrontend = {
|
|
2863
2863
|
id: "rbac",
|
|
2864
2864
|
name: "Role-Based Access Control",
|
|
2865
2865
|
providers: [RbacProvider],
|
|
@@ -2894,6 +2894,6 @@ const rbacFrontendPlugin = {
|
|
|
2894
2894
|
checkPermission: (_permission, _context) => {}
|
|
2895
2895
|
};
|
|
2896
2896
|
//#endregion
|
|
2897
|
-
export { AccessControlPage, FlowAccessPanel, RbacProvider, ShareButton, ShareFlowModal, TeamsPage, UserAvatar, UserMenuSection,
|
|
2897
|
+
export { AccessControlPage, FlowAccessPanel, RbacProvider, ShareButton, ShareFlowModal, TeamsPage, UserAvatar, UserMenuSection, rbacFrontend, useAccessibleFlows, useAddTeamMember, useCreateTeam, useDeleteTeam, useEffectiveFlowAccess, useFlowAccess, useGrantFlowAccess, useGrantScopeAccess, useMoveFlow, useMyTeams, usePreviewMove, useRbac, useRemoveTeamMember, useRevokeFlowAccess, useRevokeScopeAccess, useScopeAccess, useScopeTree, useTeam, useTeams, useUpdateTeam };
|
|
2898
2898
|
|
|
2899
2899
|
//# sourceMappingURL=index.mjs.map
|