@ws-ui/store 1.11.12-rc7 → 1.11.12
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/hooks/store.d.ts +3 -3
- package/dist/index.cjs.js +43 -43
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +10524 -9885
- package/dist/index.es.js.map +1 -1
- package/dist/modules/explorer/index.d.ts +1 -1
- package/dist/modules/explorer/reducer.d.ts +1 -1
- package/dist/modules/explorer/thunks.d.ts +10 -2
- package/dist/modules/explorer/types.d.ts +26 -1
- package/dist/modules/explorer/utils.d.ts +2 -2
- package/dist/modules/index.d.ts +3 -3
- package/dist/modules/modals/thunks.d.ts +9 -1
- package/dist/modules/roles/adapter.d.ts +180 -1
- package/dist/modules/roles/index.d.ts +2 -1
- package/dist/modules/roles/reducer.d.ts +1 -1
- package/dist/modules/roles/thunks.d.ts +2 -1
- package/dist/modules/roles/types.d.ts +108 -0
- package/dist/modules/settings/index.d.ts +1 -1
- package/dist/modules/settings/reducer.d.ts +19 -3
- package/dist/modules/settings/types.d.ts +6 -2
- package/dist/modules/tasks/selectors.d.ts +3 -3
- package/dist/modules/webforms/datasources.adapter.d.ts +3 -3
- package/dist/selectors/catalog.d.ts +27 -27
- package/dist/selectors/common.d.ts +12 -12
- package/dist/selectors/components.d.ts +3 -3
- package/dist/selectors/datasources.d.ts +24 -24
- package/dist/selectors/debugger.d.ts +84 -84
- package/dist/selectors/explorer.d.ts +89 -89
- package/dist/selectors/modals.d.ts +3 -3
- package/dist/selectors/roles.d.ts +42 -42
- package/dist/selectors/settings.d.ts +34 -34
- package/dist/selectors/states.d.ts +18 -18
- package/dist/selectors/styles.d.ts +15 -15
- package/dist/selectors/tabs.d.ts +15 -15
- package/dist/selectors/webforms.d.ts +42 -42
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PayloadAction } from '@reduxjs/toolkit';
|
|
2
|
-
import { ITreeItem } from '
|
|
2
|
+
import { ITreeItem } from './types';
|
|
3
3
|
export declare const findNodeByPath: (tree: ITreeItem[], path: string) => ITreeItem | null;
|
|
4
4
|
declare const stateSlice: import('@reduxjs/toolkit').Slice<ITreeItem[], {
|
|
5
5
|
renameClassesFolder: (state: ITreeItem[], action: PayloadAction<{
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
import { FileFolderType, IFileInfo, ISaveFileResponse, ISetFileContentResponse, ITab, ITextEditorSelection
|
|
1
|
+
import { FileFolderType, IFileInfo, ISaveFileResponse, ISetFileContentResponse, ITab, ITextEditorSelection } from '@ws-ui/shared';
|
|
2
2
|
import { ClassFileTypes } from '../root/types';
|
|
3
3
|
import { AppState } from '..';
|
|
4
4
|
import { ISettingsState } from '../settings';
|
|
5
|
-
import { IOpenFilePayload, ISwitchEditorPayload } from './types';
|
|
5
|
+
import { IOpenFilePayload, ISwitchEditorPayload, ITreeItem } from './types';
|
|
6
|
+
interface ICreateNewFilePayload {
|
|
7
|
+
fileName: string;
|
|
8
|
+
type: FileFolderType;
|
|
9
|
+
path: string;
|
|
10
|
+
parentNode: ITreeItem;
|
|
11
|
+
content?: string;
|
|
12
|
+
qodly: boolean;
|
|
13
|
+
}
|
|
6
14
|
export declare function getDefaultContent(root: FileFolderType, projectSettings: ISettingsState['project']): never[] | "" | {
|
|
7
15
|
metadata: {
|
|
8
16
|
v: string;
|
|
@@ -1,4 +1,29 @@
|
|
|
1
|
-
import { IEditor, IFileInfo, ITabFlags, ITab } from '@ws-ui/shared';
|
|
1
|
+
import { FileFolderType, IEditor, IFileInfo, ITabFlags, ITab } from '@ws-ui/shared';
|
|
2
|
+
export interface ITreeItem {
|
|
3
|
+
id?: string;
|
|
4
|
+
name: string;
|
|
5
|
+
path: string;
|
|
6
|
+
children?: ITreeItem[];
|
|
7
|
+
type: FileFolderType;
|
|
8
|
+
date?: string;
|
|
9
|
+
size?: number;
|
|
10
|
+
ext?: string;
|
|
11
|
+
error: null | {
|
|
12
|
+
message: string;
|
|
13
|
+
};
|
|
14
|
+
flags: {
|
|
15
|
+
[key: string]: boolean;
|
|
16
|
+
};
|
|
17
|
+
tipKey?: string;
|
|
18
|
+
config: {
|
|
19
|
+
editor?: IEditor;
|
|
20
|
+
supportedEditors?: IEditor[];
|
|
21
|
+
};
|
|
22
|
+
isRoot?: boolean;
|
|
23
|
+
info?: {
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
2
27
|
export interface INodePermissions {
|
|
3
28
|
canRemove: boolean;
|
|
4
29
|
canAdd: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { IEditors } from './types';
|
|
1
|
+
import { IEditors, ITreeItem } from './types';
|
|
3
2
|
import { AppState } from '..';
|
|
3
|
+
import { INodeInfo, IEditor } from '@ws-ui/shared';
|
|
4
4
|
export declare function getNodeRelativePath(nodePath: string): string;
|
|
5
5
|
export declare function parseEditor(path: string, key: string | null, fallbackEditor?: IEditor): IEditor;
|
|
6
6
|
export declare function getEditors(path: string): IEditors;
|
package/dist/modules/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { default as rootReducer } from './root';
|
|
2
2
|
export declare const stateReducer: import('redux').Reducer<import('redux').CombinedState<{
|
|
3
3
|
root: import('./root').IRootState;
|
|
4
|
-
explorer: import('
|
|
4
|
+
explorer: import('./explorer').ITreeItem[];
|
|
5
5
|
debugger: import('./debugger').IDebuggerState;
|
|
6
|
-
settings: import('
|
|
6
|
+
settings: import('./settings').ISettingsState;
|
|
7
7
|
catalog: {
|
|
8
8
|
state: "loading";
|
|
9
9
|
} | {
|
|
@@ -13,7 +13,7 @@ export declare const stateReducer: import('redux').Reducer<import('redux').Combi
|
|
|
13
13
|
state: "error";
|
|
14
14
|
error: string;
|
|
15
15
|
};
|
|
16
|
-
roles: import('
|
|
16
|
+
roles: import('./roles').IRolesState;
|
|
17
17
|
sharedDatasources: import('./shared-datasources').ISharedDatasourcesState;
|
|
18
18
|
sharedAppEvents: import('./shared-app-events').ISharedAppEventsState;
|
|
19
19
|
savedConditions: import('./shared-conditions').ISavedConditionsState;
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IModal, ModalType } from '@ws-ui/shared';
|
|
2
|
+
interface IOpenModalPayload extends Omit<IModal, 'id' | 'isOpen' | 'type'> {
|
|
3
|
+
type?: ModalType;
|
|
4
|
+
}
|
|
5
|
+
interface IOpenModalReturnValue {
|
|
6
|
+
confirmed?: boolean;
|
|
7
|
+
options?: Record<string, boolean>;
|
|
8
|
+
}
|
|
2
9
|
export declare const openModal: import('@reduxjs/toolkit').AsyncThunk<IOpenModalReturnValue, IOpenModalPayload, {
|
|
3
10
|
state?: unknown;
|
|
4
11
|
dispatch?: import('redux').Dispatch;
|
|
@@ -9,3 +16,4 @@ export declare const openModal: import('@reduxjs/toolkit').AsyncThunk<IOpenModal
|
|
|
9
16
|
fulfilledMeta?: unknown;
|
|
10
17
|
rejectedMeta?: unknown;
|
|
11
18
|
}>;
|
|
19
|
+
export {};
|
|
@@ -1,5 +1,184 @@
|
|
|
1
|
-
import { EPermissionType, IResourcePermission, TRole, TRolesDict,
|
|
1
|
+
import { EPermissionType, IGraphData, IPermission, IPrivilege, IResource, IResourcePermission, IResourcesByPermission, ISanitized, TById, TRawData, TRole, TRolesDict, TSanitizedPrivilege } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* pushes uniquely list of items
|
|
4
|
+
* @param array input array
|
|
5
|
+
* @param args list of elements to add to the array
|
|
6
|
+
* @returns an array containing unique fields
|
|
7
|
+
*/
|
|
8
|
+
export declare function uniquePush<T = string>(array: T[], ...args: T[]): T[];
|
|
9
|
+
/**
|
|
10
|
+
* Sanitize a privileges array
|
|
11
|
+
* @param data unsanitized data
|
|
12
|
+
* @returns sanitized data
|
|
13
|
+
*/
|
|
14
|
+
export declare function sanitizePrivileges(data: IPrivilege[]): TById;
|
|
15
|
+
/**
|
|
16
|
+
* sort list of sanitized pivileges
|
|
17
|
+
* @param dict sanitized data
|
|
18
|
+
* @returns sorted privileges
|
|
19
|
+
*/
|
|
20
|
+
export declare function sort(dict: TById): TSanitizedPrivilege[];
|
|
21
|
+
/**
|
|
22
|
+
* Lists the parents of a specific element
|
|
23
|
+
* @param id identifier of the current element
|
|
24
|
+
* @param dict sanitized privileges
|
|
25
|
+
* @returns parents of the current element
|
|
26
|
+
*/
|
|
27
|
+
export declare function parents(id: string, dict: TById): string[];
|
|
28
|
+
/**
|
|
29
|
+
* Lists the children of a specific element
|
|
30
|
+
* @param id identifier of the current element
|
|
31
|
+
* @param dict sanitized privileges
|
|
32
|
+
* @returns children of the current element
|
|
33
|
+
*/
|
|
34
|
+
export declare function children(id: string, dict: TById): string[];
|
|
35
|
+
/**
|
|
36
|
+
* Calculates from a sanitized privileges dictionary the list of allowed to include children
|
|
37
|
+
* @param id identifier of the current element
|
|
38
|
+
* @param dict sanitized privileges
|
|
39
|
+
* @returns allowed to include privileges
|
|
40
|
+
*/
|
|
41
|
+
export declare function allowed(id: string, dict: TById): string[];
|
|
42
|
+
/**
|
|
43
|
+
* Removes an element from a sanitized dictionary
|
|
44
|
+
* @param id identifier of the current element
|
|
45
|
+
* @param dict sanitized privileges
|
|
46
|
+
* @returns new dictionary containing the initialone except the one with "id"
|
|
47
|
+
*/
|
|
48
|
+
export declare function remove(id: string, dict: TById): TById;
|
|
49
|
+
/**
|
|
50
|
+
* Adds an existing node as a child of another node
|
|
51
|
+
* @param parentId the parent identifier
|
|
52
|
+
* @param childId the child identifer
|
|
53
|
+
* @param dict sanitized privileges dictionary
|
|
54
|
+
* @returns the new dictionary
|
|
55
|
+
*/
|
|
56
|
+
export declare function addIn(parentId: string, childId: string, dict: TById): TById;
|
|
57
|
+
/**
|
|
58
|
+
* Removes an existing node from its (specified) parent
|
|
59
|
+
* @param parentId the parent identifier
|
|
60
|
+
* @param childId the child identifer
|
|
61
|
+
* @param dict sanitized privileges dictionary
|
|
62
|
+
* @returns the new dictionary
|
|
63
|
+
*/
|
|
64
|
+
export declare function removeFrom(parentId: string, childId: string, dict: TById): TById;
|
|
65
|
+
/**
|
|
66
|
+
* Create a new privilege
|
|
67
|
+
* @param name the privilege name
|
|
68
|
+
* @param dict sanitized privileges dictionary
|
|
69
|
+
* @returns the new dictionary
|
|
70
|
+
*/
|
|
71
|
+
export declare function create(name: string, dict: TById): TById;
|
|
2
72
|
export declare function createWithResource(name: string, resource: string, type: EPermissionType, action: IResourcePermission['name'], dict: TById): TById;
|
|
73
|
+
/**
|
|
74
|
+
* Renames an existing node
|
|
75
|
+
* @param name the new name
|
|
76
|
+
* @param id the node identifier
|
|
77
|
+
* @param dict sanitized privileges dictionary
|
|
78
|
+
* @returns the new dictionary
|
|
79
|
+
*/
|
|
80
|
+
export declare function rename(name: string, id: string, dict: TById): TById;
|
|
81
|
+
/**
|
|
82
|
+
* Populates a list privileges IDs
|
|
83
|
+
* @param ids the identifiers of privileges to populate
|
|
84
|
+
* @param dict sanitized privileges dictionary
|
|
85
|
+
* @returns populated privileges
|
|
86
|
+
*/
|
|
87
|
+
export declare function populateShallow(ids: string[], dict: TById): (IPrivilege | null)[];
|
|
88
|
+
/**
|
|
89
|
+
* Get the privilege object from its identifier
|
|
90
|
+
* @param id the identifier of the node
|
|
91
|
+
* @param dict sanitized privileges dictionary
|
|
92
|
+
* @returns populated privilege
|
|
93
|
+
*/
|
|
94
|
+
export declare function getPrivilegeById(id: string, dict: TById): TSanitizedPrivilege | null;
|
|
95
|
+
/**
|
|
96
|
+
* Maps the privileges to their permissions
|
|
97
|
+
* @param param0 the raw permission object
|
|
98
|
+
* @returns an object mapping the privilege to its permission
|
|
99
|
+
*/
|
|
100
|
+
export declare function actionsToPrivs({ applyTo: _, type, ...actions }: IPermission): {
|
|
101
|
+
[privName: string]: string[];
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Converts a raw permission to a resource
|
|
105
|
+
* @param item a permission
|
|
106
|
+
* @returns the resource object
|
|
107
|
+
*/
|
|
108
|
+
export declare function getResourceFromType(item: IPermission): IResource;
|
|
109
|
+
/**
|
|
110
|
+
* Sanitizes the raw permissions
|
|
111
|
+
* @param data list of raw permissions
|
|
112
|
+
* @param byKey dictionary
|
|
113
|
+
* @returns a new dictionary containing the sanitized permissions
|
|
114
|
+
*/
|
|
115
|
+
export declare function sanitizePermissions(data: IPermission[], byKey: TById): TById;
|
|
116
|
+
/**
|
|
117
|
+
* Converts a dictionary indexed by id to a new one indexed by name
|
|
118
|
+
* @param dict dictioanry
|
|
119
|
+
* @returns a new dictionary indexed by privilege name
|
|
120
|
+
*/
|
|
121
|
+
export declare function getDictByName(dict: TById): TById;
|
|
122
|
+
/**
|
|
123
|
+
* Sanitizes the content of roles.json file
|
|
124
|
+
* @param data raw data
|
|
125
|
+
* @returns sanitized data
|
|
126
|
+
*/
|
|
127
|
+
export declare function sanitize(data: TRawData): ISanitized;
|
|
128
|
+
/**
|
|
129
|
+
* Converts sanitized data to a valid API payload
|
|
130
|
+
* @param data sanitized dictionary
|
|
131
|
+
* @returns raw data
|
|
132
|
+
*/
|
|
133
|
+
export declare function toAPI(data: ISanitized): TRawData;
|
|
134
|
+
export declare function getGraphData(id: string, dict: TById): IGraphData;
|
|
135
|
+
/**
|
|
136
|
+
*
|
|
137
|
+
* @param id privilege id
|
|
138
|
+
* @param permission
|
|
139
|
+
* @param dict
|
|
140
|
+
*/
|
|
141
|
+
export declare function addPermission(id: string, permission: IPermission, dict: TById): TById;
|
|
142
|
+
/**
|
|
143
|
+
*
|
|
144
|
+
* @param id
|
|
145
|
+
* @param permission
|
|
146
|
+
* @param dict
|
|
147
|
+
*/
|
|
148
|
+
export declare function removePermission(id: string, permission: IPermission, dict: TById): TById;
|
|
149
|
+
/**
|
|
150
|
+
* @param resourcesByPermission
|
|
151
|
+
* @param dict
|
|
152
|
+
*/
|
|
153
|
+
export declare function removeMultiplePermissions(resourcesByPermission: IResourcesByPermission, dict: TById): TById;
|
|
154
|
+
/**
|
|
155
|
+
*
|
|
156
|
+
* @param id
|
|
157
|
+
* @param permission
|
|
158
|
+
* @param dict
|
|
159
|
+
*/
|
|
160
|
+
export declare function resetResources(id: string, dict: TById): TById;
|
|
161
|
+
/**
|
|
162
|
+
*
|
|
163
|
+
* @param id privilege id
|
|
164
|
+
* @param resource resource name
|
|
165
|
+
* @param type resource type
|
|
166
|
+
* @param permission permission name
|
|
167
|
+
* @param dict privileges dictionary
|
|
168
|
+
* @returns
|
|
169
|
+
*/
|
|
3
170
|
export declare function togglePrivilegePermission(id: string, resource: string, type: EPermissionType, permission: IResourcePermission['name'], dict: TById): TById;
|
|
171
|
+
/**
|
|
172
|
+
*
|
|
173
|
+
* @param id
|
|
174
|
+
* @param permission
|
|
175
|
+
* @param dict
|
|
176
|
+
*/
|
|
177
|
+
export declare function togglePermission(id: string, resource: IResource, permission: IResourcePermission, dict: TById): TById;
|
|
178
|
+
export declare function getPromotions(id: string, dict: TById): Record<string, string[]>;
|
|
179
|
+
export declare function getInheritedResources(id: string, dict: TById): IResource[];
|
|
4
180
|
export declare const toState: (rolesArray: TRole[]) => TRolesDict;
|
|
181
|
+
export declare const removeRole: (id: string, roles: TRolesDict) => TRolesDict;
|
|
5
182
|
export declare const editRole: (id: string, newName: string, roles: TRolesDict) => TRolesDict;
|
|
183
|
+
export declare const createRole: (id: string, name: string, roles: TRolesDict) => TRolesDict;
|
|
184
|
+
export declare const saveRole: (role: TRole, roles: TRolesDict) => TRolesDict;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
declare const _default: import('redux').Reducer<import('
|
|
1
|
+
declare const _default: import('redux').Reducer<import('./types').IRolesState>;
|
|
2
2
|
export default _default;
|
|
3
3
|
export * from './reducer';
|
|
4
4
|
export * from './thunks';
|
|
5
|
+
export * from './types';
|
|
5
6
|
export * from './adapter';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PayloadAction } from '@reduxjs/toolkit';
|
|
2
|
-
import { IRolesState, TById, TRawData, TRolesDict } from '
|
|
2
|
+
import { IRolesState, TById, TRawData, TRolesDict } from './types';
|
|
3
3
|
declare const stateSlice: import('@reduxjs/toolkit').Slice<IRolesState, {
|
|
4
4
|
updatePrivileges: (state: import('immer/dist/internal').WritableDraft<IRolesState>, action: PayloadAction<TById>) => void;
|
|
5
5
|
updateRoles: (state: import('immer/dist/internal').WritableDraft<IRolesState>, action: PayloadAction<TRolesDict>) => void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ITabFlags, IFileContentResponse, ISetFileContentResponse
|
|
1
|
+
import { ITabFlags, IFileContentResponse, ISetFileContentResponse } from '@ws-ui/shared';
|
|
2
2
|
import { AppState } from '..';
|
|
3
|
+
import { ISanitized } from './types';
|
|
3
4
|
export declare const fetchRoles: import('@reduxjs/toolkit').AsyncThunk<IFileContentResponse<ISanitized>, void, {
|
|
4
5
|
state: AppState;
|
|
5
6
|
rejectValue: string;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { ITabFlags } from '@ws-ui/shared';
|
|
2
|
+
export type TRawData = Partial<{
|
|
3
|
+
privileges: IPrivilege[];
|
|
4
|
+
roles: IRole[];
|
|
5
|
+
permissions: Partial<{
|
|
6
|
+
allowed: IPermission[];
|
|
7
|
+
}>;
|
|
8
|
+
forceLogin: boolean;
|
|
9
|
+
restrictedByDefault: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
export type TPermissionOption = Pick<IPermission, 'applyTo' | 'type' | 'subType'>;
|
|
12
|
+
export type TAction = 'read' | 'create' | 'update' | 'drop' | 'execute' | 'promote';
|
|
13
|
+
export type IRolesState = ISanitized & {
|
|
14
|
+
flags: ITabFlags;
|
|
15
|
+
date?: string;
|
|
16
|
+
selectedTab: 'privileges' | 'roles';
|
|
17
|
+
initialState?: {
|
|
18
|
+
roles: TRolesDict;
|
|
19
|
+
privileges: TById;
|
|
20
|
+
forceLogin?: boolean;
|
|
21
|
+
restrictedByDefault?: boolean;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export interface IPrivilege {
|
|
25
|
+
id?: string;
|
|
26
|
+
privilege: string;
|
|
27
|
+
includes?: string[];
|
|
28
|
+
}
|
|
29
|
+
export interface IRole {
|
|
30
|
+
id?: string;
|
|
31
|
+
role: string;
|
|
32
|
+
privileges?: string[];
|
|
33
|
+
}
|
|
34
|
+
export type TRole = Required<IRole>;
|
|
35
|
+
export declare enum EPermissionType {
|
|
36
|
+
DATACLASS = "dataclass",
|
|
37
|
+
METHOD = "method",
|
|
38
|
+
ATTRIBUTE = "attribute",
|
|
39
|
+
DATASTORE = "datastore",
|
|
40
|
+
SINGLETON = "singleton",
|
|
41
|
+
SINGLETON_METHOD = "singletonMethod"
|
|
42
|
+
}
|
|
43
|
+
export declare enum ESubPermissionType {
|
|
44
|
+
DS_METHOD = "dsMethod",
|
|
45
|
+
DATACLASS_METHOD = "dataclassMethod",
|
|
46
|
+
ENTITY_METHOD = "entityMethod",
|
|
47
|
+
ENTITY_SEL_METHOD = "entityselMethod"
|
|
48
|
+
}
|
|
49
|
+
export interface IPermission {
|
|
50
|
+
applyTo: string;
|
|
51
|
+
type: EPermissionType | ESubPermissionType;
|
|
52
|
+
subType?: ESubPermissionType;
|
|
53
|
+
read?: string | string[];
|
|
54
|
+
create?: string | string[];
|
|
55
|
+
update?: string | string[];
|
|
56
|
+
drop?: string | string[];
|
|
57
|
+
execute?: string | string[];
|
|
58
|
+
promote?: string | string[];
|
|
59
|
+
}
|
|
60
|
+
export interface IResourcesByPermission {
|
|
61
|
+
[id: string]: {
|
|
62
|
+
applyTo: IPermission['applyTo'];
|
|
63
|
+
type: IPermission['type'];
|
|
64
|
+
subType?: IPermission['subType'];
|
|
65
|
+
}[];
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Sanitized data
|
|
69
|
+
*/
|
|
70
|
+
export interface ISanitized {
|
|
71
|
+
privileges: TById;
|
|
72
|
+
roles: TRolesDict;
|
|
73
|
+
forceLogin?: boolean;
|
|
74
|
+
restrictedByDefault?: boolean;
|
|
75
|
+
}
|
|
76
|
+
export interface IResourcePermission {
|
|
77
|
+
name: TAction;
|
|
78
|
+
from: string[];
|
|
79
|
+
checked?: boolean;
|
|
80
|
+
info?: string;
|
|
81
|
+
}
|
|
82
|
+
export interface IResource {
|
|
83
|
+
resource: string;
|
|
84
|
+
type: EPermissionType | ESubPermissionType;
|
|
85
|
+
subType?: ESubPermissionType;
|
|
86
|
+
permissions: IResourcePermission[];
|
|
87
|
+
exists?: boolean;
|
|
88
|
+
}
|
|
89
|
+
export type TSanitizedPrivilege = Required<IPrivilege> & {
|
|
90
|
+
parents: string[];
|
|
91
|
+
resources: IResource[];
|
|
92
|
+
};
|
|
93
|
+
export type TById = {
|
|
94
|
+
[id: string]: TSanitizedPrivilege;
|
|
95
|
+
};
|
|
96
|
+
export type TRolesDict = {
|
|
97
|
+
[id: string]: TRole;
|
|
98
|
+
};
|
|
99
|
+
export interface ILink {
|
|
100
|
+
source: string;
|
|
101
|
+
target: string;
|
|
102
|
+
}
|
|
103
|
+
export interface IGraphData {
|
|
104
|
+
selected: string;
|
|
105
|
+
parents: string[][];
|
|
106
|
+
children: string[][];
|
|
107
|
+
links: ILink[];
|
|
108
|
+
}
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import { PayloadAction } from '@reduxjs/toolkit';
|
|
2
|
-
import {
|
|
3
|
-
import { TSetSettingPayload } from './types';
|
|
2
|
+
import { IAppSettingsResponse } from '@ws-ui/shared';
|
|
3
|
+
import { TSetSettingPayload, TSettingPath } from './types';
|
|
4
|
+
export interface ISettingsState {
|
|
5
|
+
session: {
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
};
|
|
8
|
+
project: {
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
};
|
|
11
|
+
server: IAppSettingsResponse;
|
|
12
|
+
welcometour: {
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
4
16
|
declare const stateSlice: import('@reduxjs/toolkit').Slice<ISettingsState, {
|
|
5
17
|
setSetting(state: ISettingsState, action: TSetSettingPayload): void;
|
|
6
18
|
setSettings(state: ISettingsState, action: PayloadAction<{
|
|
@@ -14,7 +26,11 @@ declare const stateSlice: import('@reduxjs/toolkit').Slice<ISettingsState, {
|
|
|
14
26
|
};
|
|
15
27
|
}>): void;
|
|
16
28
|
}, "settings">;
|
|
17
|
-
export declare const setSetting: import('@reduxjs/toolkit').ActionCreatorWithPayload<
|
|
29
|
+
export declare const setSetting: import('@reduxjs/toolkit').ActionCreatorWithPayload<{
|
|
30
|
+
path: TSettingPath;
|
|
31
|
+
settingsKey: string;
|
|
32
|
+
value: any;
|
|
33
|
+
}, "settings/setSetting">, setSettings: import('@reduxjs/toolkit').ActionCreatorWithPayload<{
|
|
18
34
|
path: TSettingPath;
|
|
19
35
|
value: any;
|
|
20
36
|
}, "settings/setSettings">, setSettingsAsText: import('@reduxjs/toolkit').ActionCreatorWithPayload<{
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { PayloadAction } from '@reduxjs/toolkit';
|
|
2
|
-
|
|
3
|
-
export type TSetSettingPayload = PayloadAction<
|
|
2
|
+
export type TSettingPath = 'session' | 'project' | 'welcometour';
|
|
3
|
+
export type TSetSettingPayload = PayloadAction<{
|
|
4
|
+
path: TSettingPath;
|
|
5
|
+
settingsKey: string;
|
|
6
|
+
value: any;
|
|
7
|
+
}>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare const selectAllTasks: ((state: import('redux').EmptyObject & {
|
|
2
2
|
root: import('..').IRootState;
|
|
3
|
-
explorer: import('
|
|
3
|
+
explorer: import('..').ITreeItem[];
|
|
4
4
|
debugger: import('..').IDebuggerState;
|
|
5
|
-
settings: import('
|
|
5
|
+
settings: import('..').ISettingsState;
|
|
6
6
|
catalog: {
|
|
7
7
|
state: "loading";
|
|
8
8
|
} | {
|
|
@@ -12,7 +12,7 @@ export declare const selectAllTasks: ((state: import('redux').EmptyObject & {
|
|
|
12
12
|
state: "error";
|
|
13
13
|
error: string;
|
|
14
14
|
};
|
|
15
|
-
roles: import('
|
|
15
|
+
roles: import('..').IRolesState;
|
|
16
16
|
sharedDatasources: import('..').ISharedDatasourcesState;
|
|
17
17
|
sharedAppEvents: import('..').ISharedAppEventsState;
|
|
18
18
|
savedConditions: import('..').ISavedConditionsState;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare const listDsNamespaces: import('lodash').CurriedFunction2<string, import('redux').CombinedState<{
|
|
2
2
|
root: import('..').IRootState;
|
|
3
|
-
explorer: import('
|
|
3
|
+
explorer: import('..').ITreeItem[];
|
|
4
4
|
debugger: import('..').IDebuggerState;
|
|
5
|
-
settings: import('
|
|
5
|
+
settings: import('..').ISettingsState;
|
|
6
6
|
catalog: {
|
|
7
7
|
state: "loading";
|
|
8
8
|
} | {
|
|
@@ -12,7 +12,7 @@ export declare const listDsNamespaces: import('lodash').CurriedFunction2<string,
|
|
|
12
12
|
state: "error";
|
|
13
13
|
error: string;
|
|
14
14
|
};
|
|
15
|
-
roles: import('
|
|
15
|
+
roles: import('..').IRolesState;
|
|
16
16
|
sharedDatasources: import('..').ISharedDatasourcesState;
|
|
17
17
|
sharedAppEvents: import('..').ISharedAppEventsState;
|
|
18
18
|
savedConditions: import('..').ISavedConditionsState;
|