@ws-ui/store 0.3.1 → 0.3.2

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.
@@ -4,7 +4,6 @@ export declare const serializeModel: (nodes: ModelNode[], modelProps: Partial<{
4
4
  backgroundColor: string;
5
5
  backgroundImage: string;
6
6
  backgroundVariant: 'dotted' | 'grid' | 'none';
7
- zoom: number;
8
7
  }>) => ServerModel;
9
8
  export declare function getDefaultName(prefix: string, _propertyKey: string, items: Record<string, any>): string;
10
9
  export declare const isRelatedEntityAttr: (attribute: catalog.IAttribute) => boolean;
@@ -3,7 +3,11 @@ export declare const useDataclasses: () => Record<string, catalog.IDataClass>;
3
3
  export declare const useCollections: () => Record<string, catalog.IDataClass>;
4
4
  export declare const useDataclass: (dataclassId: string) => catalog.IDataClass;
5
5
  export declare const useAttribute: (dataclassId: string, attributeId: string) => catalog.IAttribute | undefined;
6
- export declare const useModelProperties: () => Record<string, any>;
6
+ export declare const useModelViewport: () => {
7
+ zoom: number;
8
+ x: number;
9
+ y: number;
10
+ } | undefined;
7
11
  export declare const useModelFlags: () => {
8
12
  deleteDataclass: any;
9
13
  draggableDataclass: any;
@@ -1,4 +1,4 @@
1
- import { EPermissionType, IGraphData, IPermission, IPrivilege, IResource, IResourcePermission, ISanitized, TById, TRawData, TRole, TRolesDict, TSanitizedPrivilege } from './types';
1
+ import { EPermissionType, IGraphData, IPermission, IPrivilege, IResource, IResourcePermission, IResourcesByPermission, ISanitized, TById, TRawData, TRole, TRolesDict, TSanitizedPrivilege } from './types';
2
2
  /**
3
3
  * pushes uniquely list of items
4
4
  * @param array input array
@@ -146,6 +146,11 @@ export declare function addPermission(id: string, permission: IPermission, dict:
146
146
  * @param dict
147
147
  */
148
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;
149
154
  /**
150
155
  *
151
156
  * @param id
@@ -37,8 +37,8 @@ export declare enum EPermissionType {
37
37
  ENTITY_SEL_METHOD = "entityselMethod",
38
38
  ATTRIBUTE = "attribute",
39
39
  DATASTORE = "datastore",
40
- SINGLTON = "singleton",
41
- SINGLTON_METHOD = "singletonMethod"
40
+ SINGLETON = "singleton",
41
+ SINGLETON_METHOD = "singletonMethod"
42
42
  }
43
43
  export interface IPermission {
44
44
  applyTo: string;
@@ -50,6 +50,12 @@ export interface IPermission {
50
50
  execute?: string | string[];
51
51
  promote?: string | string[];
52
52
  }
53
+ export interface IResourcesByPermission {
54
+ [id: string]: {
55
+ applyTo: IPermission['applyTo'];
56
+ type: IPermission['type'];
57
+ }[];
58
+ }
53
59
  /**
54
60
  * Sanitized data
55
61
  */
@@ -68,6 +74,7 @@ export interface IResource {
68
74
  resource: string;
69
75
  type: EPermissionType;
70
76
  permissions: IResourcePermission[];
77
+ exists?: boolean;
71
78
  }
72
79
  export type TSanitizedPrivilege = Required<IPrivilege> & {
73
80
  parents: string[];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ws-ui/store",
3
3
  "private": false,
4
- "version": "0.3.1",
4
+ "version": "0.3.2",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs.js",
7
7
  "module": "./dist/index.es.js",
@@ -26,11 +26,11 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@reduxjs/toolkit": "^1.7.1",
29
+ "@ws-ui/shared": "^0.3.2",
29
30
  "react-redux": "^7.2.6"
30
31
  },
31
32
  "peerDependencies": {
32
- "@ws-ui/icons": "^0.2.1",
33
- "@ws-ui/shared": "^0.2.33",
33
+ "@ws-ui/icons": "^0.2.2",
34
34
  "lodash": "^4.17.21",
35
35
  "minimatch": "^5.1.0",
36
36
  "react": "^17.0.2",