@pilotdev/pilot-web-sdk 24.4.0 → 24.9.0
Sign up to get free protection for your applications and to get access to all the features.
- package/esm2020/lib/contexts/context.mjs +29 -0
- package/esm2020/lib/contexts/document-annotations-list-context.mjs +15 -0
- package/esm2020/lib/contexts/index.mjs +4 -0
- package/esm2020/lib/contexts/render-context.mjs +22 -0
- package/esm2020/lib/data/access.mjs +26 -0
- package/esm2020/lib/data/annotations.mjs +2 -0
- package/esm2020/lib/data/attribute.mjs +17 -0
- package/esm2020/lib/data/data-object.mjs +19 -0
- package/esm2020/lib/data/file.mjs +2 -0
- package/esm2020/lib/data/files-snapshot.mjs +2 -0
- package/esm2020/lib/data/index.mjs +13 -0
- package/esm2020/lib/data/modifier.mjs +2 -0
- package/esm2020/lib/data/object-builder.mjs +2 -0
- package/esm2020/lib/data/organisation-unit.mjs +7 -0
- package/esm2020/lib/data/person.mjs +2 -0
- package/esm2020/lib/data/relation.mjs +2 -0
- package/esm2020/lib/data/subscriptionType.mjs +6 -0
- package/esm2020/lib/idata.plugin.mjs +2 -0
- package/esm2020/lib/injectable/index.mjs +5 -0
- package/esm2020/lib/injectable/modifier-provider.mjs +2 -0
- package/esm2020/lib/injectable/objects-repository.mjs +2 -0
- package/esm2020/lib/injectable/render-context-provider.mjs +2 -0
- package/esm2020/lib/injectable/repository-events.mjs +2 -0
- package/esm2020/lib/menu/checkable-menu.builder.mjs +14 -0
- package/esm2020/lib/menu/index.mjs +5 -0
- package/esm2020/lib/menu/menu-item.builder.mjs +39 -0
- package/esm2020/lib/menu/menu.builder.mjs +68 -0
- package/esm2020/lib/menu/menu.mjs +22 -0
- package/esm2020/lib/toolbar/index.mjs +7 -0
- package/esm2020/lib/toolbar/toolbar-item-submenu.handler.mjs +11 -0
- package/esm2020/lib/toolbar/toolbar-item.builder.mjs +41 -0
- package/esm2020/lib/toolbar/toolbar-menu-item.builder.mjs +15 -0
- package/esm2020/lib/toolbar/toolbar-toggle-item.builder.mjs +14 -0
- package/esm2020/lib/toolbar/toolbar.builder.mjs +88 -0
- package/esm2020/lib/toolbar/toolbar.mjs +27 -0
- package/esm2020/lib/tools/attribute-permission.info.mjs +41 -0
- package/esm2020/lib/tools/guid.mjs +53 -0
- package/esm2020/lib/tools/index.mjs +4 -0
- package/esm2020/lib/tools/utils.mjs +8 -0
- package/esm2020/pilotdev-pilot-web-sdk.mjs +5 -0
- package/esm2020/public-api.mjs +11 -0
- package/fesm2015/pilotdev-pilot-web-sdk.mjs +588 -0
- package/fesm2015/pilotdev-pilot-web-sdk.mjs.map +1 -0
- package/fesm2020/pilotdev-pilot-web-sdk.mjs +588 -0
- package/fesm2020/pilotdev-pilot-web-sdk.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/contexts/context.d.ts +22 -0
- package/lib/contexts/document-annotations-list-context.d.ts +12 -0
- package/{src/lib/contexts/index.ts → lib/contexts/index.d.ts} +1 -1
- package/lib/contexts/render-context.d.ts +17 -0
- package/lib/data/access.d.ts +35 -0
- package/lib/data/annotations.d.ts +15 -0
- package/lib/data/attribute.d.ts +30 -0
- package/lib/data/data-object.d.ts +74 -0
- package/lib/data/file.d.ts +23 -0
- package/lib/data/files-snapshot.d.ts +8 -0
- package/{src/lib/data/index.ts → lib/data/index.d.ts} +2 -2
- package/lib/data/modifier.d.ts +30 -0
- package/lib/data/object-builder.d.ts +110 -0
- package/lib/data/organisation-unit.d.ts +18 -0
- package/lib/data/person.d.ts +17 -0
- package/lib/data/relation.d.ts +8 -0
- package/lib/data/subscriptionType.d.ts +4 -0
- package/lib/idata.plugin.d.ts +2 -0
- package/{src/lib/injectable/index.ts → lib/injectable/index.d.ts} +2 -2
- package/{src/lib/injectable/modifier-provider.ts → lib/injectable/modifier-provider.d.ts} +5 -6
- package/lib/injectable/objects-repository.d.ts +72 -0
- package/lib/injectable/render-context-provider.d.ts +10 -0
- package/lib/injectable/repository-events.d.ts +31 -0
- package/lib/menu/checkable-menu.builder.d.ts +11 -0
- package/{src/lib/menu/index.ts → lib/menu/index.d.ts} +1 -2
- package/lib/menu/menu-item.builder.d.ts +27 -0
- package/lib/menu/menu.builder.d.ts +49 -0
- package/lib/menu/menu.d.ts +18 -0
- package/{src/lib/toolbar/index.ts → lib/toolbar/index.d.ts} +1 -2
- package/lib/toolbar/toolbar-item-submenu.handler.d.ts +9 -0
- package/lib/toolbar/toolbar-item.builder.d.ts +28 -0
- package/lib/toolbar/toolbar-menu-item.builder.d.ts +13 -0
- package/lib/toolbar/toolbar-toggle-item.builder.d.ts +11 -0
- package/lib/toolbar/toolbar.builder.d.ts +65 -0
- package/lib/toolbar/toolbar.d.ts +19 -0
- package/lib/tools/attribute-permission.info.d.ts +8 -0
- package/lib/tools/guid.d.ts +7 -0
- package/lib/tools/index.d.ts +3 -0
- package/lib/tools/utils.d.ts +3 -0
- package/package.json +22 -3
- package/{src/public-api.ts → public-api.d.ts} +1 -4
- package/.eslintrc.json +0 -31
- package/ng-package.json +0 -7
- package/src/lib/contexts/context.ts +0 -38
- package/src/lib/contexts/document-annotations-list-context.ts +0 -21
- package/src/lib/contexts/render-context.ts +0 -28
- package/src/lib/data/access.ts +0 -40
- package/src/lib/data/annotations.ts +0 -20
- package/src/lib/data/attribute.ts +0 -33
- package/src/lib/data/data-object.ts +0 -78
- package/src/lib/data/file.ts +0 -25
- package/src/lib/data/files-snapshot.ts +0 -9
- package/src/lib/data/modifier.ts +0 -31
- package/src/lib/data/object-builder.ts +0 -111
- package/src/lib/data/organisation-unit.ts +0 -20
- package/src/lib/data/person.ts +0 -17
- package/src/lib/data/relation.ts +0 -10
- package/src/lib/data/subscriptionType.ts +0 -5
- package/src/lib/idata.plugin.ts +0 -2
- package/src/lib/injectable/objects-repository.ts +0 -74
- package/src/lib/injectable/render-context-provider.ts +0 -11
- package/src/lib/injectable/repository-events.ts +0 -33
- package/src/lib/menu/checkable-menu.builder.ts +0 -15
- package/src/lib/menu/menu-item.builder.ts +0 -45
- package/src/lib/menu/menu.builder.ts +0 -79
- package/src/lib/menu/menu.ts +0 -24
- package/src/lib/toolbar/toolbar-item-submenu.handler.ts +0 -12
- package/src/lib/toolbar/toolbar-item.builder.ts +0 -45
- package/src/lib/toolbar/toolbar-menu-item.builder.ts +0 -16
- package/src/lib/toolbar/toolbar-toggle-item.builder.ts +0 -15
- package/src/lib/toolbar/toolbar.builder.ts +0 -104
- package/src/lib/toolbar/toolbar.ts +0 -31
- package/src/lib/tools/attribute-permission.info.ts +0 -51
- package/src/lib/tools/guid.ts +0 -63
- package/src/lib/tools/index.ts +0 -3
- package/src/lib/tools/utils.ts +0 -8
- package/tsconfig.lib.json +0 -15
- package/tsconfig.lib.prod.json +0 -10
@@ -1,51 +0,0 @@
|
|
1
|
-
import { objectToMap } from "./utils";
|
2
|
-
|
3
|
-
export class AttributePermissionInfo {
|
4
|
-
private ATTRIBUTE_NAME_MARKER = '&';
|
5
|
-
|
6
|
-
orgUnits: number[];
|
7
|
-
orgUnitAttributes: string[];
|
8
|
-
|
9
|
-
constructor(editableForPositionsSource: string[]) {
|
10
|
-
this.orgUnits = new Array<number>();
|
11
|
-
this.orgUnitAttributes = new Array<string>();
|
12
|
-
|
13
|
-
if (!editableForPositionsSource)
|
14
|
-
return;
|
15
|
-
|
16
|
-
editableForPositionsSource.forEach(str => {
|
17
|
-
if (str.length > 0 && str[0] === this.ATTRIBUTE_NAME_MARKER) {
|
18
|
-
this.orgUnitAttributes.push(str.substring(1));
|
19
|
-
}
|
20
|
-
else {
|
21
|
-
const num = Number(str);
|
22
|
-
if (!isNaN(num))
|
23
|
-
this.orgUnits.push(num);
|
24
|
-
}
|
25
|
-
});
|
26
|
-
}
|
27
|
-
|
28
|
-
extractAllOrgUnits(obj: any): number[] {
|
29
|
-
const attrMap = objectToMap<any>(obj.attributes);
|
30
|
-
return this.extractAllOrgUnitsByAttributes(attrMap);
|
31
|
-
}
|
32
|
-
|
33
|
-
extractAllOrgUnitsByAttributes(attributes: Map<string, any>) : number[] {
|
34
|
-
let result = new Array<number>();
|
35
|
-
if (!this.orgUnitAttributes || !attributes )
|
36
|
-
return result;
|
37
|
-
|
38
|
-
this.orgUnitAttributes.forEach(permissionAttributeName => {
|
39
|
-
if (attributes.has(permissionAttributeName)){
|
40
|
-
const value = attributes.get(permissionAttributeName);
|
41
|
-
if (value && Array.isArray(value)){
|
42
|
-
value.forEach(intValue => {
|
43
|
-
result.push(intValue);
|
44
|
-
});
|
45
|
-
}
|
46
|
-
}
|
47
|
-
});
|
48
|
-
|
49
|
-
return result;
|
50
|
-
}
|
51
|
-
}
|
package/src/lib/tools/guid.ts
DELETED
@@ -1,63 +0,0 @@
|
|
1
|
-
const byteToHex = Array();
|
2
|
-
for (let i = 0; i < 256; ++i) {
|
3
|
-
byteToHex.push((i + 0x100).toString(16).slice(1));
|
4
|
-
}
|
5
|
-
|
6
|
-
export class Guid {
|
7
|
-
private static readonly regex = "(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})";
|
8
|
-
|
9
|
-
static readonly EMPTY = "00000000-0000-0000-0000-000000000000";
|
10
|
-
|
11
|
-
static newGuid(): string {
|
12
|
-
|
13
|
-
if (window.isSecureContext) {
|
14
|
-
// If crypto.getRandomValues is available try to use it.
|
15
|
-
return window.crypto.randomUUID();
|
16
|
-
}
|
17
|
-
|
18
|
-
// Fall back to Math.random if a higher quality random number generator is not available.
|
19
|
-
const uuid = new Array(16);
|
20
|
-
var d = new Date().getTime();
|
21
|
-
for (var i = 0; i < 16; i++) {
|
22
|
-
var r = ((d + Math.random() * 256) % 256) | 0;
|
23
|
-
d = Math.trunc(d / 256);
|
24
|
-
uuid[i] = r;
|
25
|
-
}
|
26
|
-
|
27
|
-
// Makes uuid compliant to RFC-4122
|
28
|
-
uuid[6] = (uuid[6] & 0x0F) | 0x40; // uuid version
|
29
|
-
uuid[8] = (uuid[8] & 0x3F) | 0x80; // uuid variant
|
30
|
-
|
31
|
-
return this.stringify(uuid);
|
32
|
-
}
|
33
|
-
|
34
|
-
static isGuid(str: string) {
|
35
|
-
const regex = new RegExp(this.regex);
|
36
|
-
return regex.test(str) && str.length === 36;
|
37
|
-
}
|
38
|
-
|
39
|
-
private static stringify(arr: Array<number>) {
|
40
|
-
return (
|
41
|
-
byteToHex[arr[0]] +
|
42
|
-
byteToHex[arr[1]] +
|
43
|
-
byteToHex[arr[2]] +
|
44
|
-
byteToHex[arr[3]] +
|
45
|
-
'-' +
|
46
|
-
byteToHex[arr[4]] +
|
47
|
-
byteToHex[arr[5]] +
|
48
|
-
'-' +
|
49
|
-
byteToHex[arr[6]] +
|
50
|
-
byteToHex[arr[7]] +
|
51
|
-
'-' +
|
52
|
-
byteToHex[arr[8]] +
|
53
|
-
byteToHex[arr[9]] +
|
54
|
-
'-' +
|
55
|
-
byteToHex[arr[10]] +
|
56
|
-
byteToHex[arr[11]] +
|
57
|
-
byteToHex[arr[12]] +
|
58
|
-
byteToHex[arr[13]] +
|
59
|
-
byteToHex[arr[14]] +
|
60
|
-
byteToHex[arr[15]]
|
61
|
-
).toLowerCase();
|
62
|
-
}
|
63
|
-
}
|
package/src/lib/tools/index.ts
DELETED
package/src/lib/tools/utils.ts
DELETED
package/tsconfig.lib.json
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
2
|
-
{
|
3
|
-
"extends": "../../tsconfig.json",
|
4
|
-
"compilerOptions": {
|
5
|
-
"outDir": "../../out-tsc/lib",
|
6
|
-
"declaration": true,
|
7
|
-
"declarationMap": true,
|
8
|
-
"inlineSources": true,
|
9
|
-
"types": [],
|
10
|
-
"strict": true
|
11
|
-
},
|
12
|
-
"exclude": [
|
13
|
-
"**/*.spec.ts"
|
14
|
-
]
|
15
|
-
}
|
package/tsconfig.lib.prod.json
DELETED