@ws-ui/roles-editor 1.8.0
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/Container.d.ts +2 -0
- package/dist/Dialogs/RemoveDialog.d.ts +7 -0
- package/dist/Dialogs/index.d.ts +2 -0
- package/dist/NavBar.d.ts +12 -0
- package/dist/Sidebar/Roles/RolePrivileges.d.ts +4 -0
- package/dist/Sidebar/Roles/index.d.ts +2 -0
- package/dist/Sidebar/Roles/rolesContext.d.ts +9 -0
- package/dist/Sidebar/index.d.ts +2 -0
- package/dist/Sidebar/withPortal.d.ts +3 -0
- package/dist/Sidebar/withResizableSidebar.d.ts +3 -0
- package/dist/Standalone/Modals.d.ts +2 -0
- package/dist/Standalone/index.d.ts +2 -0
- package/dist/Tabs/NoneSelected.d.ts +6 -0
- package/dist/Tabs/Privileges/Graph/ConnectionLine.d.ts +3 -0
- package/dist/Tabs/Privileges/Graph/Edge.d.ts +3 -0
- package/dist/Tabs/Privileges/Graph/graph.d.ts +8 -0
- package/dist/Tabs/Privileges/Graph/utils.d.ts +30 -0
- package/dist/Tabs/Privileges/Includes.d.ts +11 -0
- package/dist/Tabs/Privileges/NoneSelected.d.ts +3 -0
- package/dist/Tabs/Privileges/Sidebar.d.ts +9 -0
- package/dist/Tabs/Privileges/Table.d.ts +14 -0
- package/dist/Tabs/Privileges/Tree.d.ts +3 -0
- package/dist/Tabs/Privileges/helpers.d.ts +45 -0
- package/dist/Tabs/Privileges/index.d.ts +2 -0
- package/dist/Tabs/Roles/Card.d.ts +6 -0
- package/dist/Tabs/Roles/NoResults.d.ts +1 -0
- package/dist/Tabs/Roles/Row.d.ts +18 -0
- package/dist/Tabs/Roles/RowContainer.d.ts +13 -0
- package/dist/Tabs/Roles/Table.d.ts +5 -0
- package/dist/Tabs/Roles/index.d.ts +2 -0
- package/dist/Tabs/Roles/utils.d.ts +16 -0
- package/dist/Tabs/index.d.ts +3 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useRolesFlagsSync.d.ts +1 -0
- package/dist/index.cjs.js +72 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.es.js +27348 -0
- package/dist/index.es.js.map +1 -0
- package/dist/main.d.ts +1 -0
- package/dist/roles-editor.css +1 -0
- package/dist/types.d.ts +3 -0
- package/dist/vite.svg +1 -0
- package/package.json +58 -0
package/dist/NavBar.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TabType } from './types';
|
|
2
|
+
interface INavbarProps {
|
|
3
|
+
qodly: boolean;
|
|
4
|
+
activeTab: TabType;
|
|
5
|
+
forceLogin?: boolean;
|
|
6
|
+
restrictedByDefault?: boolean;
|
|
7
|
+
onTabChange: (value: TabType) => void;
|
|
8
|
+
onRestrictedByDefaultChange: (value: boolean) => void;
|
|
9
|
+
onForceLoginChange: (value: boolean) => void;
|
|
10
|
+
}
|
|
11
|
+
export default function Navbar({ qodly, activeTab, forceLogin, onTabChange, restrictedByDefault, onRestrictedByDefaultChange, onForceLoginChange, }: INavbarProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React, FC } from 'react';
|
|
2
|
+
interface ISelectedRole {
|
|
3
|
+
selectedRole: string | null;
|
|
4
|
+
selectRole: (role: string | null) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const SelectedRoleContext: React.Context<ISelectedRole | undefined>;
|
|
7
|
+
declare const SelectedRoleProvider: FC;
|
|
8
|
+
declare function useSelectedRole(): ISelectedRole;
|
|
9
|
+
export { SelectedRoleProvider, useSelectedRole };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
declare function withResizableSidebar<T extends JSX.IntrinsicAttributes>(Component: React.ComponentType<T>, initialWidth?: number, maxWidth?: number, resizeDirection?: 'left' | 'right'): (props: T) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default withResizableSidebar;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Position, MarkerType, Node } from 'react-flow-renderer';
|
|
2
|
+
export declare function getEdgeParams(source: Node, target: any): {
|
|
3
|
+
sx: any;
|
|
4
|
+
sy: any;
|
|
5
|
+
tx: any;
|
|
6
|
+
ty: any;
|
|
7
|
+
sourcePos: Position;
|
|
8
|
+
targetPos: Position;
|
|
9
|
+
};
|
|
10
|
+
export declare function createNodesAndEdges(): {
|
|
11
|
+
nodes: {
|
|
12
|
+
id: string;
|
|
13
|
+
data: {
|
|
14
|
+
label: string;
|
|
15
|
+
};
|
|
16
|
+
position: {
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
};
|
|
20
|
+
}[];
|
|
21
|
+
edges: {
|
|
22
|
+
id: string;
|
|
23
|
+
target: string;
|
|
24
|
+
source: string;
|
|
25
|
+
type: string;
|
|
26
|
+
markerEnd: {
|
|
27
|
+
type: MarkerType;
|
|
28
|
+
};
|
|
29
|
+
}[];
|
|
30
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TById, TSanitizedPrivilege } from '@ws-ui/store';
|
|
3
|
+
interface IIncludesProps {
|
|
4
|
+
privileges: TById;
|
|
5
|
+
selectedPrivilege: TSanitizedPrivilege;
|
|
6
|
+
onSelect: (selected: string) => void;
|
|
7
|
+
setShowIncluded: (show: boolean) => void;
|
|
8
|
+
showIncluded: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const Includes: React.FC<IIncludesProps>;
|
|
11
|
+
export default Includes;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TById, TSanitizedPrivilege } from '@ws-ui/store';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
interface ISidebarProps {
|
|
4
|
+
privileges: TById;
|
|
5
|
+
selectPrivilege: (priv: TSanitizedPrivilege | null) => void;
|
|
6
|
+
selectedPrivilege: TSanitizedPrivilege | null;
|
|
7
|
+
}
|
|
8
|
+
declare const Sidebar: React.FC<ISidebarProps>;
|
|
9
|
+
export default Sidebar;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { EPermissionType, IResource, TSanitizedPrivilege, TById } from '@ws-ui/store';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
export interface IGroupedResource {
|
|
4
|
+
prefix: string;
|
|
5
|
+
type: EPermissionType;
|
|
6
|
+
resources: IResource[];
|
|
7
|
+
}
|
|
8
|
+
declare const Table: React.FC<{
|
|
9
|
+
selectedPrivilege: TSanitizedPrivilege;
|
|
10
|
+
onSelect: (selected: string) => void;
|
|
11
|
+
showIncluded?: boolean;
|
|
12
|
+
privileges: TById;
|
|
13
|
+
}>;
|
|
14
|
+
export default Table;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { EPermissionType, ESubPermissionType, TById, TPermissionOption } from '@ws-ui/store';
|
|
2
|
+
export type PermissionType = EPermissionType;
|
|
3
|
+
export interface IPermission {
|
|
4
|
+
type: PermissionType;
|
|
5
|
+
applyTo: string;
|
|
6
|
+
}
|
|
7
|
+
export type TDataClassPermission = {
|
|
8
|
+
applyTo: string;
|
|
9
|
+
type: EPermissionType.DATACLASS;
|
|
10
|
+
methods: TPermissionOption[];
|
|
11
|
+
attributes: TPermissionOption[];
|
|
12
|
+
};
|
|
13
|
+
export type TSingletonPermission = {
|
|
14
|
+
applyTo: string;
|
|
15
|
+
type: EPermissionType.SINGLETON;
|
|
16
|
+
methods: TPermissionOption[];
|
|
17
|
+
attributes: TPermissionOption[];
|
|
18
|
+
};
|
|
19
|
+
export type TGroupedPermissions = {
|
|
20
|
+
[key: string]: {
|
|
21
|
+
applyTo: string;
|
|
22
|
+
type: EPermissionType.DATASTORE;
|
|
23
|
+
methods: TPermissionOption[];
|
|
24
|
+
dataClasses: TDataClassPermission[];
|
|
25
|
+
singletons: TSingletonPermission[];
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export declare function search(keyword: string, methods?: any[], dataClasses?: any[], singletons?: any[]): TPermissionOption[];
|
|
29
|
+
export declare const groupPermissions: (methods?: any[], dataClasses?: any[], singletons?: any[]) => TGroupedPermissions;
|
|
30
|
+
export declare const checkMethodType: (privs: TById, dataClasses?: any[]) => TById;
|
|
31
|
+
export declare const checkPermissionsExist: (privileges: TById, catalog: datasources.IEnhancedCatalog) => {
|
|
32
|
+
[x: string]: {
|
|
33
|
+
resources: {
|
|
34
|
+
exists: boolean;
|
|
35
|
+
resource: string;
|
|
36
|
+
type: EPermissionType | ESubPermissionType;
|
|
37
|
+
subType?: ESubPermissionType;
|
|
38
|
+
permissions: import('@ws-ui/store').IResourcePermission[];
|
|
39
|
+
}[];
|
|
40
|
+
id: string;
|
|
41
|
+
privilege: string;
|
|
42
|
+
includes: string[];
|
|
43
|
+
parents: string[];
|
|
44
|
+
};
|
|
45
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const NoResults: React.FC;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TById, TPermissionOption } from '@ws-ui/store';
|
|
2
|
+
export declare const Row: React.FC<{
|
|
3
|
+
privileges: {
|
|
4
|
+
rolePrivs: TById;
|
|
5
|
+
otherPrivs: TById;
|
|
6
|
+
};
|
|
7
|
+
permission: TPermissionOption;
|
|
8
|
+
hasChild?: boolean;
|
|
9
|
+
isChild?: boolean;
|
|
10
|
+
depth: number;
|
|
11
|
+
className?: string;
|
|
12
|
+
inSearch?: boolean;
|
|
13
|
+
toggleCollapse?: () => void;
|
|
14
|
+
collapsed?: boolean;
|
|
15
|
+
toastMessageCallback: () => void;
|
|
16
|
+
isRestrictedByDefault?: boolean;
|
|
17
|
+
allPrivileges?: any;
|
|
18
|
+
}>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TById } from '@ws-ui/store';
|
|
2
|
+
import { TDataClassPermission, TSingletonPermission } from '../Privileges/helpers';
|
|
3
|
+
export declare const RowContainer: React.FC<{
|
|
4
|
+
depth: number;
|
|
5
|
+
permission: TDataClassPermission | TSingletonPermission;
|
|
6
|
+
privileges: {
|
|
7
|
+
rolePrivs: TById;
|
|
8
|
+
otherPrivs: TById;
|
|
9
|
+
};
|
|
10
|
+
childCollapsed?: boolean;
|
|
11
|
+
didChildCollapsed?: (status: boolean) => void;
|
|
12
|
+
toastMessageCallback: () => void;
|
|
13
|
+
}>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TById, TPermissionOption } from '@ws-ui/store';
|
|
2
|
+
type PermissionResult = {
|
|
3
|
+
value: boolean;
|
|
4
|
+
inherited: boolean;
|
|
5
|
+
from: string[];
|
|
6
|
+
explicitly: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const getPermissionsOfPrivs: (permission: TPermissionOption, otherPrivs: TById, rolePrivs: TById, isRestricted?: boolean) => {
|
|
9
|
+
read: PermissionResult;
|
|
10
|
+
create: PermissionResult;
|
|
11
|
+
update: PermissionResult;
|
|
12
|
+
drop: PermissionResult;
|
|
13
|
+
execute: PermissionResult;
|
|
14
|
+
promote: PermissionResult;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useRolesFlagsSync';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useRolesFlagsSync(): void;
|