grm-shared-library 1.0.44 → 1.0.46
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/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/modules/control-centre/dtos/create-control-centre.dto.d.ts +1 -0
- package/dist/modules/control-centre/dtos/create-control-centre.dto.js +5 -0
- package/dist/modules/control-centre/interfaces/control-centre.d.ts +2 -0
- package/dist/modules/organization/dtos/create-organization.dto.d.ts +0 -1
- package/dist/modules/organization/dtos/create-organization.dto.js +0 -4
- package/dist/modules/organization/interfaces/organization.d.ts +0 -2
- package/dist/modules/permission/data/permissions.data.js +4 -4
- package/dist/modules/permission/enums/permission-actions.enum.d.ts +20 -20
- package/dist/modules/permission/enums/permission-actions.enum.js +25 -25
- package/dist/modules/role/data/roles.data.js +66 -50
- package/dist/modules/role/enums/role.enum.d.ts +5 -5
- package/dist/modules/role/enums/role.enum.js +5 -5
- package/dist/modules/user/dtos/create-user.dto.d.ts +1 -1
- package/dist/modules/user/dtos/create-user.dto.js +1 -1
- package/dist/modules/user/interfaces/user.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ export * from './modules/common/index';
|
|
|
6
6
|
export * from './modules/permission/index';
|
|
7
7
|
export * from './modules/role/index';
|
|
8
8
|
export * from './modules/user/index';
|
|
9
|
-
export * from './modules/partner/index';
|
|
10
9
|
export * from './modules/control-centre/index';
|
|
11
10
|
/**
|
|
12
11
|
* Kafka
|
package/dist/index.js
CHANGED
|
@@ -22,7 +22,6 @@ __exportStar(require("./modules/common/index"), exports);
|
|
|
22
22
|
__exportStar(require("./modules/permission/index"), exports);
|
|
23
23
|
__exportStar(require("./modules/role/index"), exports);
|
|
24
24
|
__exportStar(require("./modules/user/index"), exports);
|
|
25
|
-
__exportStar(require("./modules/partner/index"), exports);
|
|
26
25
|
__exportStar(require("./modules/control-centre/index"), exports);
|
|
27
26
|
/**
|
|
28
27
|
* Kafka
|
|
@@ -33,6 +33,7 @@ __decorate([
|
|
|
33
33
|
__decorate([
|
|
34
34
|
(0, class_validator_1.IsEmail)(),
|
|
35
35
|
(0, class_validator_1.IsOptional)(),
|
|
36
|
+
(0, class_validator_1.MaxLength)(50),
|
|
36
37
|
__metadata("design:type", String)
|
|
37
38
|
], CreateControlCentreDto.prototype, "email", void 0);
|
|
38
39
|
__decorate([
|
|
@@ -60,3 +61,7 @@ __decorate([
|
|
|
60
61
|
(0, class_validator_1.IsOptional)(),
|
|
61
62
|
__metadata("design:type", Object)
|
|
62
63
|
], CreateControlCentreDto.prototype, "attributes", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, class_validator_1.IsNumber)(),
|
|
66
|
+
__metadata("design:type", Number)
|
|
67
|
+
], CreateControlCentreDto.prototype, "organizationId", void 0);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { MapAddressDto } from "../../common";
|
|
2
2
|
import { ContactPersonDto } from "../../common/dtos/contact-person.dto";
|
|
3
|
+
import { Organization } from "../../organization";
|
|
3
4
|
export interface ControlCentre {
|
|
4
5
|
id?: number;
|
|
5
6
|
name: string;
|
|
@@ -10,6 +11,7 @@ export interface ControlCentre {
|
|
|
10
11
|
logo?: string;
|
|
11
12
|
contactPerson: ContactPersonDto;
|
|
12
13
|
attributes?: Record<string, any>;
|
|
14
|
+
organization: Organization;
|
|
13
15
|
createdAt?: Date;
|
|
14
16
|
updatedAt?: Date;
|
|
15
17
|
}
|
|
@@ -78,7 +78,3 @@ __decorate([
|
|
|
78
78
|
(0, class_validator_1.IsOptional)(),
|
|
79
79
|
__metadata("design:type", Array)
|
|
80
80
|
], CreateOrganizationDto.prototype, "controlCentreIds", void 0);
|
|
81
|
-
__decorate([
|
|
82
|
-
(0, class_validator_1.IsNumber)({}, { each: true }),
|
|
83
|
-
__metadata("design:type", Array)
|
|
84
|
-
], CreateOrganizationDto.prototype, "partnerIds", void 0);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ContactPersonDto } from "../../common/dtos/contact-person.dto";
|
|
2
2
|
import { MapAddressDto } from "../../common/dtos/map-address.dto";
|
|
3
3
|
import { ControlCentre } from "../../control-centre";
|
|
4
|
-
import { Partner } from "../../partner";
|
|
5
4
|
export interface Organization {
|
|
6
5
|
id?: number;
|
|
7
6
|
name: string;
|
|
@@ -15,7 +14,6 @@ export interface Organization {
|
|
|
15
14
|
logo?: string;
|
|
16
15
|
contactPerson: ContactPersonDto;
|
|
17
16
|
controlCentres?: ControlCentre[];
|
|
18
|
-
partners?: Partner[];
|
|
19
17
|
createdAt?: Date;
|
|
20
18
|
updatedAt?: Date;
|
|
21
19
|
}
|
|
@@ -16,10 +16,10 @@ exports.PERMISSIONS_DATA = [
|
|
|
16
16
|
{
|
|
17
17
|
module: permissions_moudule_enum_1.PermissionsModule.PARTNER,
|
|
18
18
|
actions: [
|
|
19
|
-
permission_actions_enum_1.PermissionActions.
|
|
20
|
-
permission_actions_enum_1.PermissionActions.
|
|
21
|
-
permission_actions_enum_1.PermissionActions.
|
|
22
|
-
permission_actions_enum_1.PermissionActions.
|
|
19
|
+
permission_actions_enum_1.PermissionActions.CREATE_CONTROL_CENTRE,
|
|
20
|
+
permission_actions_enum_1.PermissionActions.READ_CONTROL_CENTRE,
|
|
21
|
+
permission_actions_enum_1.PermissionActions.UPDATE_CONTROL_CENTRE,
|
|
22
|
+
permission_actions_enum_1.PermissionActions.DELETE_CONTROL_CENTRE
|
|
23
23
|
]
|
|
24
24
|
},
|
|
25
25
|
{
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
export declare enum PermissionActions {
|
|
2
|
-
CREATE_ORGANIZATION = "create
|
|
3
|
-
READ_ORGANIZATION = "read
|
|
4
|
-
UPDATE_ORGANIZATION = "update
|
|
5
|
-
DELETE_ORGANIZATION = "delete
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
CREATE_INCIDENT = "create
|
|
19
|
-
READ_INCIDENT = "read
|
|
20
|
-
UPDATE_INCIDENT = "update
|
|
21
|
-
DELETE_INCIDENT = "delete
|
|
2
|
+
CREATE_ORGANIZATION = "create:organization",
|
|
3
|
+
READ_ORGANIZATION = "read:organization",
|
|
4
|
+
UPDATE_ORGANIZATION = "update:organization",
|
|
5
|
+
DELETE_ORGANIZATION = "delete:organization",
|
|
6
|
+
CREATE_CONTROL_CENTRE = "create:control-centre",
|
|
7
|
+
READ_CONTROL_CENTRE = "read:control-centre",
|
|
8
|
+
UPDATE_CONTROL_CENTRE = "update:control-centre",
|
|
9
|
+
DELETE_CONTROL_CENTRE = "delete:control-centre",
|
|
10
|
+
CREATE_ROLE = "create:role",
|
|
11
|
+
READ_ROLE = "read:role",
|
|
12
|
+
UPDATE_ROLE = "update:role",
|
|
13
|
+
DELETE_ROLE = "delete:role",
|
|
14
|
+
CREATE_USER = "create:user",
|
|
15
|
+
READ_USER = "read:user",
|
|
16
|
+
UPDATE_USER = "update:user",
|
|
17
|
+
DELETE_USER = "delete:user",
|
|
18
|
+
CREATE_INCIDENT = "create:incident",
|
|
19
|
+
READ_INCIDENT = "read:incident",
|
|
20
|
+
UPDATE_INCIDENT = "update:incident",
|
|
21
|
+
DELETE_INCIDENT = "delete:incident"
|
|
22
22
|
}
|
|
@@ -3,29 +3,29 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PermissionActions = void 0;
|
|
4
4
|
var PermissionActions;
|
|
5
5
|
(function (PermissionActions) {
|
|
6
|
-
//Module: Organization
|
|
7
|
-
PermissionActions["CREATE_ORGANIZATION"] = "create
|
|
8
|
-
PermissionActions["READ_ORGANIZATION"] = "read
|
|
9
|
-
PermissionActions["UPDATE_ORGANIZATION"] = "update
|
|
10
|
-
PermissionActions["DELETE_ORGANIZATION"] = "delete
|
|
11
|
-
//Module:
|
|
12
|
-
PermissionActions["
|
|
13
|
-
PermissionActions["
|
|
14
|
-
PermissionActions["
|
|
15
|
-
PermissionActions["
|
|
16
|
-
//Module:
|
|
17
|
-
PermissionActions["
|
|
18
|
-
PermissionActions["
|
|
19
|
-
PermissionActions["
|
|
20
|
-
PermissionActions["
|
|
21
|
-
//Module:
|
|
22
|
-
PermissionActions["
|
|
23
|
-
PermissionActions["
|
|
24
|
-
PermissionActions["
|
|
25
|
-
PermissionActions["
|
|
26
|
-
//Module: Incident
|
|
27
|
-
PermissionActions["CREATE_INCIDENT"] = "create
|
|
28
|
-
PermissionActions["READ_INCIDENT"] = "read
|
|
29
|
-
PermissionActions["UPDATE_INCIDENT"] = "update
|
|
30
|
-
PermissionActions["DELETE_INCIDENT"] = "delete
|
|
6
|
+
// Module: Organization
|
|
7
|
+
PermissionActions["CREATE_ORGANIZATION"] = "create:organization";
|
|
8
|
+
PermissionActions["READ_ORGANIZATION"] = "read:organization";
|
|
9
|
+
PermissionActions["UPDATE_ORGANIZATION"] = "update:organization";
|
|
10
|
+
PermissionActions["DELETE_ORGANIZATION"] = "delete:organization";
|
|
11
|
+
// Module: ControlCentre
|
|
12
|
+
PermissionActions["CREATE_CONTROL_CENTRE"] = "create:control-centre";
|
|
13
|
+
PermissionActions["READ_CONTROL_CENTRE"] = "read:control-centre";
|
|
14
|
+
PermissionActions["UPDATE_CONTROL_CENTRE"] = "update:control-centre";
|
|
15
|
+
PermissionActions["DELETE_CONTROL_CENTRE"] = "delete:control-centre";
|
|
16
|
+
// Module: Role
|
|
17
|
+
PermissionActions["CREATE_ROLE"] = "create:role";
|
|
18
|
+
PermissionActions["READ_ROLE"] = "read:role";
|
|
19
|
+
PermissionActions["UPDATE_ROLE"] = "update:role";
|
|
20
|
+
PermissionActions["DELETE_ROLE"] = "delete:role";
|
|
21
|
+
// Module: User
|
|
22
|
+
PermissionActions["CREATE_USER"] = "create:user";
|
|
23
|
+
PermissionActions["READ_USER"] = "read:user";
|
|
24
|
+
PermissionActions["UPDATE_USER"] = "update:user";
|
|
25
|
+
PermissionActions["DELETE_USER"] = "delete:user";
|
|
26
|
+
// Module: Incident
|
|
27
|
+
PermissionActions["CREATE_INCIDENT"] = "create:incident";
|
|
28
|
+
PermissionActions["READ_INCIDENT"] = "read:incident";
|
|
29
|
+
PermissionActions["UPDATE_INCIDENT"] = "update:incident";
|
|
30
|
+
PermissionActions["DELETE_INCIDENT"] = "delete:incident";
|
|
31
31
|
})(PermissionActions || (exports.PermissionActions = PermissionActions = {}));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ROLES_DATA = void 0;
|
|
4
|
+
const permission_1 = require("../../permission");
|
|
4
5
|
const role_enum_1 = require("../enums/role.enum");
|
|
5
6
|
exports.ROLES_DATA = [
|
|
6
7
|
{
|
|
@@ -9,69 +10,84 @@ exports.ROLES_DATA = [
|
|
|
9
10
|
permissions: ['*']
|
|
10
11
|
},
|
|
11
12
|
{
|
|
12
|
-
name: role_enum_1.Roles.
|
|
13
|
-
description: 'Organization Admin',
|
|
13
|
+
name: role_enum_1.Roles.ORGANIZATION_ADMIN,
|
|
14
|
+
description: 'Organization Admin: Manage Organization & Set up Control Centres',
|
|
14
15
|
permissions: [
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
16
|
+
//organization
|
|
17
|
+
permission_1.PermissionActions.READ_ORGANIZATION,
|
|
18
|
+
permission_1.PermissionActions.UPDATE_ORGANIZATION,
|
|
19
|
+
//control centre
|
|
20
|
+
permission_1.PermissionActions.CREATE_CONTROL_CENTRE,
|
|
21
|
+
permission_1.PermissionActions.READ_CONTROL_CENTRE,
|
|
22
|
+
permission_1.PermissionActions.UPDATE_CONTROL_CENTRE,
|
|
23
|
+
permission_1.PermissionActions.DELETE_CONTROL_CENTRE,
|
|
24
|
+
//Role
|
|
25
|
+
permission_1.PermissionActions.READ_ROLE,
|
|
26
|
+
//User
|
|
27
|
+
permission_1.PermissionActions.CREATE_USER,
|
|
28
|
+
permission_1.PermissionActions.READ_USER,
|
|
29
|
+
permission_1.PermissionActions.UPDATE_USER,
|
|
30
|
+
permission_1.PermissionActions.DELETE_USER,
|
|
31
|
+
//Incident
|
|
32
|
+
permission_1.PermissionActions.CREATE_INCIDENT,
|
|
33
|
+
permission_1.PermissionActions.READ_INCIDENT,
|
|
34
|
+
permission_1.PermissionActions.UPDATE_INCIDENT
|
|
31
35
|
]
|
|
32
36
|
},
|
|
33
37
|
{
|
|
34
|
-
name: role_enum_1.Roles.
|
|
35
|
-
description: 'Organization User',
|
|
38
|
+
name: role_enum_1.Roles.ORGANIZATION_USER,
|
|
39
|
+
description: 'Organization User: View organization-wide data',
|
|
36
40
|
permissions: [
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
//organization
|
|
42
|
+
permission_1.PermissionActions.READ_ORGANIZATION,
|
|
43
|
+
//control centre
|
|
44
|
+
permission_1.PermissionActions.READ_CONTROL_CENTRE,
|
|
45
|
+
//Role
|
|
46
|
+
permission_1.PermissionActions.READ_ROLE,
|
|
47
|
+
//User
|
|
48
|
+
permission_1.PermissionActions.READ_USER,
|
|
49
|
+
//Incident
|
|
50
|
+
permission_1.PermissionActions.READ_INCIDENT
|
|
44
51
|
]
|
|
45
52
|
},
|
|
46
53
|
{
|
|
47
|
-
name: role_enum_1.Roles.
|
|
48
|
-
description: '
|
|
54
|
+
name: role_enum_1.Roles.CONTROL_CENTRE_ADMIN,
|
|
55
|
+
description: 'Control Centre Admin: Manage Control Centre',
|
|
49
56
|
permissions: [
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
//Organization
|
|
58
|
+
permission_1.PermissionActions.READ_ORGANIZATION,
|
|
59
|
+
//Control Centre
|
|
60
|
+
permission_1.PermissionActions.READ_CONTROL_CENTRE,
|
|
61
|
+
permission_1.PermissionActions.UPDATE_CONTROL_CENTRE,
|
|
62
|
+
//Role
|
|
63
|
+
permission_1.PermissionActions.READ_ROLE,
|
|
64
|
+
//User
|
|
65
|
+
permission_1.PermissionActions.CREATE_USER,
|
|
66
|
+
permission_1.PermissionActions.READ_USER,
|
|
67
|
+
permission_1.PermissionActions.UPDATE_USER,
|
|
68
|
+
permission_1.PermissionActions.DELETE_USER,
|
|
69
|
+
//Incident
|
|
70
|
+
permission_1.PermissionActions.CREATE_INCIDENT,
|
|
71
|
+
permission_1.PermissionActions.READ_INCIDENT,
|
|
72
|
+
permission_1.PermissionActions.UPDATE_INCIDENT
|
|
62
73
|
]
|
|
63
74
|
},
|
|
64
75
|
{
|
|
65
|
-
name: role_enum_1.Roles.
|
|
66
|
-
description: '
|
|
76
|
+
name: role_enum_1.Roles.CONTROL_CENTRE_USER,
|
|
77
|
+
description: 'Control Centre User: View control centre-wide data & Manage Incidents',
|
|
67
78
|
permissions: [
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
79
|
+
//Organization
|
|
80
|
+
permission_1.PermissionActions.READ_ORGANIZATION,
|
|
81
|
+
//Control Centre
|
|
82
|
+
permission_1.PermissionActions.READ_CONTROL_CENTRE,
|
|
83
|
+
//Role
|
|
84
|
+
permission_1.PermissionActions.READ_ROLE,
|
|
85
|
+
//User
|
|
86
|
+
permission_1.PermissionActions.READ_USER,
|
|
87
|
+
//Incident
|
|
88
|
+
permission_1.PermissionActions.CREATE_INCIDENT,
|
|
89
|
+
permission_1.PermissionActions.READ_INCIDENT,
|
|
90
|
+
permission_1.PermissionActions.UPDATE_INCIDENT
|
|
75
91
|
]
|
|
76
92
|
}
|
|
77
93
|
];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare enum Roles {
|
|
2
|
-
SUPER_ADMIN = "
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
SUPER_ADMIN = "Super Admin",
|
|
3
|
+
ORGANIZATION_ADMIN = "Org:Admin",
|
|
4
|
+
ORGANIZATION_USER = "Org:User",
|
|
5
|
+
CONTROL_CENTRE_ADMIN = "Control-Centre:Admin",
|
|
6
|
+
CONTROL_CENTRE_USER = "Control-Centre:User"
|
|
7
7
|
}
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Roles = void 0;
|
|
4
4
|
var Roles;
|
|
5
5
|
(function (Roles) {
|
|
6
|
-
Roles["SUPER_ADMIN"] = "
|
|
7
|
-
Roles["
|
|
8
|
-
Roles["
|
|
9
|
-
Roles["
|
|
10
|
-
Roles["
|
|
6
|
+
Roles["SUPER_ADMIN"] = "Super Admin";
|
|
7
|
+
Roles["ORGANIZATION_ADMIN"] = "Org:Admin";
|
|
8
|
+
Roles["ORGANIZATION_USER"] = "Org:User";
|
|
9
|
+
Roles["CONTROL_CENTRE_ADMIN"] = "Control-Centre:Admin";
|
|
10
|
+
Roles["CONTROL_CENTRE_USER"] = "Control-Centre:User";
|
|
11
11
|
})(Roles || (exports.Roles = Roles = {}));
|
|
@@ -81,7 +81,7 @@ __decorate([
|
|
|
81
81
|
(0, class_validator_1.IsNumber)(),
|
|
82
82
|
(0, class_validator_1.IsOptional)(),
|
|
83
83
|
__metadata("design:type", Number)
|
|
84
|
-
], CreateUserDto.prototype, "
|
|
84
|
+
], CreateUserDto.prototype, "controlCentreId", void 0);
|
|
85
85
|
__decorate([
|
|
86
86
|
(0, class_validator_1.IsNumber)(),
|
|
87
87
|
(0, class_validator_1.IsNotEmpty)(),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { ControlCentre } from "../../control-centre";
|
|
1
2
|
import { Organization } from "../../organization";
|
|
2
|
-
import { Partner } from "../../partner/interfaces/partner";
|
|
3
3
|
import { Role } from "../../role";
|
|
4
4
|
export interface User {
|
|
5
5
|
id?: number;
|
|
@@ -15,7 +15,7 @@ export interface User {
|
|
|
15
15
|
isEmailVerified?: boolean;
|
|
16
16
|
otp?: string;
|
|
17
17
|
otpExpiresAt?: Date;
|
|
18
|
-
|
|
18
|
+
controlCentre?: ControlCentre;
|
|
19
19
|
organization: Organization;
|
|
20
20
|
createdAt?: Date;
|
|
21
21
|
updatedAt?: Date;
|