grm-shared-library 1.0.229 → 1.0.231
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/decorators/case-decorators.js +7 -12
- package/dist/exceptions/custom-exception/custom-rpc.exception.js +5 -9
- package/dist/exceptions/enums/error-codes.enum.js +1 -4
- package/dist/exceptions/error-logger/error-logger.js +2 -6
- package/dist/exceptions/filters/all-exceptions.filter.js +17 -20
- package/dist/exceptions/filters/http-exceptions.filter.js +10 -13
- package/dist/exceptions/index.js +7 -23
- package/dist/exceptions/interfaces/error-context.js +1 -2
- package/dist/exceptions/interfaces/error-response.js +1 -2
- package/dist/index.js +18 -34
- package/dist/interfaces/i-request-with-user.js +1 -2
- package/dist/interfaces/jwt-payload.js +1 -2
- package/dist/interfaces/server-message.js +1 -2
- package/dist/interfaces/validated-user.js +1 -2
- package/dist/kafka/dtos/otp/create-otp-payload.dto.js +25 -29
- package/dist/kafka/dtos/otp/otp-payload.dto.js +10 -14
- package/dist/kafka/dtos/password/password-reset-payload.dto.js +13 -17
- package/dist/kafka/dtos/user/create-user-created-payload.dto.js +27 -31
- package/dist/kafka/dtos/user/create-user-registered-payload.dto.js +14 -18
- package/dist/kafka/dtos/user/user-created-payload.dto.js +10 -14
- package/dist/kafka/dtos/user/user-registered-payload.dto.js +6 -10
- package/dist/kafka/index.js +8 -24
- package/dist/kafka/topics.js +1 -4
- package/dist/modules/auth/dtos/change-password.dto.js +17 -21
- package/dist/modules/auth/dtos/forgot-password.dto.js +4 -8
- package/dist/modules/auth/dtos/login.dto.js +9 -13
- package/dist/modules/auth/dtos/refresh-token.dto.js +4 -8
- package/dist/modules/auth/dtos/register.dto.js +43 -47
- package/dist/modules/auth/dtos/resend-otp.dto.js +7 -11
- package/dist/modules/auth/dtos/reset-password.dto.js +15 -19
- package/dist/modules/auth/dtos/verify-otp.dto.js +6 -10
- package/dist/modules/auth/enums/otp-action.js +2 -5
- package/dist/modules/auth/index.d.ts +1 -0
- package/dist/modules/auth/index.js +12 -26
- package/dist/modules/auth/interfaces/login-response.js +1 -2
- package/dist/modules/auth/interfaces/register-response.js +1 -2
- package/dist/modules/auth/validators/match.decorator.js +3 -6
- package/dist/modules/common/constants/password-regex.const.js +1 -5
- package/dist/modules/common/constants/service.const.js +1 -4
- package/dist/modules/common/dtos/contact-person.dto.js +12 -16
- package/dist/modules/common/dtos/map-address.dto.js +20 -24
- package/dist/modules/common/dtos/map-location.dto.js +10 -14
- package/dist/modules/common/index.js +7 -23
- package/dist/modules/common/interfaces/contact-person.js +1 -2
- package/dist/modules/common/interfaces/map-address.js +1 -2
- package/dist/modules/common/interfaces/map-location.js +1 -2
- package/dist/modules/control-centre/dtos/create-control-centre.dto.js +29 -33
- package/dist/modules/control-centre/dtos/update-control-centre.dto.js +3 -7
- package/dist/modules/control-centre/enums/control-centre.enum.js +2 -5
- package/dist/modules/control-centre/index.js +4 -20
- package/dist/modules/control-centre/interfaces/control-centre.js +1 -2
- package/dist/modules/email/index.js +1 -17
- package/dist/modules/email/interfaces/user-created.js +1 -2
- package/dist/modules/incident/dtos/action/create-incident-action.dto.js +13 -17
- package/dist/modules/incident/dtos/action/incident-action.dto.js +8 -12
- package/dist/modules/incident/dtos/action/update-inident-action.dto.js +3 -7
- package/dist/modules/incident/dtos/assignment/create-incident-assignment.dto.js +14 -18
- package/dist/modules/incident/dtos/assignment/incident-assignment.dto.js +8 -12
- package/dist/modules/incident/dtos/assignment/update-incident-assignment.dto.js +3 -7
- package/dist/modules/incident/dtos/attachment/create-incident-attachment.dto.js +12 -16
- package/dist/modules/incident/dtos/attachment/update-incident-attachment.dto.js +3 -7
- package/dist/modules/incident/dtos/category/create-incident-category.dto.js +10 -14
- package/dist/modules/incident/dtos/category/update-incident-category.dto.js +3 -7
- package/dist/modules/incident/dtos/incident/create-incident.dto.js +53 -57
- package/dist/modules/incident/dtos/incident/incident.dto.js +37 -41
- package/dist/modules/incident/dtos/incident/update-incident.dto.js +3 -7
- package/dist/modules/incident/dtos/reporter/create-incident-reporter.dto.js +12 -16
- package/dist/modules/incident/dtos/reporter/incident-reporter.dto.js +10 -14
- package/dist/modules/incident/dtos/reporter/update-incident-reporter.dto.js +3 -7
- package/dist/modules/incident/dtos/response-unit-assignment/create-incident-response-unit-assignment.dto.js +16 -20
- package/dist/modules/incident/dtos/response-unit-assignment/incident-response-unit-assignment.dto.js +3 -7
- package/dist/modules/incident/dtos/response-unit-assignment/update-incident-response-unit-assignment.dto.js +8 -12
- package/dist/modules/incident/dtos/type/create-incident-type.dto.js +12 -16
- package/dist/modules/incident/dtos/type/update-incident-type.dto.js +3 -7
- package/dist/modules/incident/enums/incident-actions.enum.js +2 -5
- package/dist/modules/incident/enums/incident-app-id.enum.js +2 -5
- package/dist/modules/incident/enums/incident-channel.enum.js +2 -5
- package/dist/modules/incident/enums/incident-class.enum.js +2 -5
- package/dist/modules/incident/enums/incident-priority.enum.js +2 -5
- package/dist/modules/incident/enums/incident-status.enum.js +2 -5
- package/dist/modules/incident/enums/incident-workflow-queue-name.enum.js +2 -5
- package/dist/modules/incident/index.js +37 -53
- package/dist/modules/incident/intefaces/incident-action.js +1 -2
- package/dist/modules/incident/intefaces/incident-assignment.js +1 -2
- package/dist/modules/incident/intefaces/incident-attachment.js +1 -2
- package/dist/modules/incident/intefaces/incident-category.js +1 -2
- package/dist/modules/incident/intefaces/incident-reporter.js +1 -2
- package/dist/modules/incident/intefaces/incident-response-unit-assignment.js +1 -2
- package/dist/modules/incident/intefaces/incident-type.js +1 -2
- package/dist/modules/incident/intefaces/incident.js +1 -2
- package/dist/modules/organization/dtos/create-organization.dto.js +41 -45
- package/dist/modules/organization/dtos/organization-sla.dto.js +12 -16
- package/dist/modules/organization/dtos/update-organization.dto.js +3 -7
- package/dist/modules/organization/enums/org-status.enum.js +2 -5
- package/dist/modules/organization/enums/org-type.enum.js +2 -5
- package/dist/modules/organization/index.d.ts +1 -0
- package/dist/modules/organization/index.js +10 -22
- package/dist/modules/organization/interfaces/organization-sla.js +1 -2
- package/dist/modules/organization/interfaces/organization.js +1 -2
- package/dist/modules/permission/data/permissions.data.js +28 -31
- package/dist/modules/permission/dtos/create-permission.dto.js +7 -11
- package/dist/modules/permission/dtos/update-permission.dto.js +3 -7
- package/dist/modules/permission/enums/permission-actions.enum.js +2 -5
- package/dist/modules/permission/enums/permissions-moudule.enum.js +2 -5
- package/dist/modules/permission/index.js +6 -22
- package/dist/modules/permission/interfaces/permission.js +1 -2
- package/dist/modules/response-unit/dtos/person-unit/base-person-unit.dto.js +15 -19
- package/dist/modules/response-unit/dtos/person-unit/create-person-unit.dto.js +3 -7
- package/dist/modules/response-unit/dtos/person-unit/person-unit.dto.js +2 -6
- package/dist/modules/response-unit/dtos/person-unit/update-person-unit.dto.js +3 -7
- package/dist/modules/response-unit/dtos/response-unit/base-response-unit.dto.js +25 -29
- package/dist/modules/response-unit/dtos/response-unit/create-response-unit.dto.js +3 -7
- package/dist/modules/response-unit/dtos/response-unit/response-unit.dto.js +2 -6
- package/dist/modules/response-unit/dtos/response-unit/station.dto.js +8 -12
- package/dist/modules/response-unit/dtos/response-unit/update-response-unit.dto.js +3 -7
- package/dist/modules/response-unit/dtos/team-unit/base-team-unit.dto.js +10 -14
- package/dist/modules/response-unit/dtos/team-unit/create-team-unit.dto.js +3 -7
- package/dist/modules/response-unit/dtos/team-unit/crew/create-team-unit-crew.dto.js +3 -7
- package/dist/modules/response-unit/dtos/team-unit/crew/team-unit-crew.dto.js +14 -18
- package/dist/modules/response-unit/dtos/team-unit/crew/update-team-unit-crew.dto.js +3 -7
- package/dist/modules/response-unit/dtos/team-unit/team-unit.dto.js +2 -6
- package/dist/modules/response-unit/dtos/team-unit/update-team-unit.dto.js +3 -7
- package/dist/modules/response-unit/dtos/vehicle-unit/base-vehicle-unit.dto.js +27 -31
- package/dist/modules/response-unit/dtos/vehicle-unit/create-vehicle-unit.dto.js +3 -7
- package/dist/modules/response-unit/dtos/vehicle-unit/crew/create-vehicle-unit-crew.dto.js +3 -7
- package/dist/modules/response-unit/dtos/vehicle-unit/crew/update-vehicle-unit-crew.dto.js +11 -15
- package/dist/modules/response-unit/dtos/vehicle-unit/crew/vehicle-unit-crew.dto.js +19 -23
- package/dist/modules/response-unit/dtos/vehicle-unit/device/create-vehicle-unit-device.dto.js +3 -7
- package/dist/modules/response-unit/dtos/vehicle-unit/device/update-vehicle-unit-device.dto.js +3 -7
- package/dist/modules/response-unit/dtos/vehicle-unit/device/vehicle-unit-device.dto.js +23 -27
- package/dist/modules/response-unit/dtos/vehicle-unit/update-vehicle-unit.dto.js +3 -7
- package/dist/modules/response-unit/dtos/vehicle-unit/vehicle-type/ambulance-vehicle/ambulance-vehicle.dto.js +2 -6
- package/dist/modules/response-unit/dtos/vehicle-unit/vehicle-type/ambulance-vehicle/base-ambulance-vehicle.dto.js +6 -10
- package/dist/modules/response-unit/dtos/vehicle-unit/vehicle-type/ambulance-vehicle/create-ambulance-vehicle.dto.js +3 -7
- package/dist/modules/response-unit/dtos/vehicle-unit/vehicle-type/ambulance-vehicle/update-ambulance-vehicle.dto.js +3 -7
- package/dist/modules/response-unit/dtos/vehicle-unit/vehicle-type/fire-vehicle/base-fire-vehicle.dto.js +6 -10
- package/dist/modules/response-unit/dtos/vehicle-unit/vehicle-type/fire-vehicle/create-fire-vehicle.dto.js +3 -7
- package/dist/modules/response-unit/dtos/vehicle-unit/vehicle-type/fire-vehicle/fire-vehicle.dto.js +2 -6
- package/dist/modules/response-unit/dtos/vehicle-unit/vehicle-type/fire-vehicle/update-fire-vehicle.dto.js +3 -7
- package/dist/modules/response-unit/dtos/vehicle-unit/vehicle-type/road-rescue-vehicle/base-road-rescue-vehicle.dto.js +5 -9
- package/dist/modules/response-unit/dtos/vehicle-unit/vehicle-type/road-rescue-vehicle/create-road-rescue-vehicle.dto.js +3 -7
- package/dist/modules/response-unit/dtos/vehicle-unit/vehicle-type/road-rescue-vehicle/road-rescue-vehicle.dto.js +2 -6
- package/dist/modules/response-unit/dtos/vehicle-unit/vehicle-type/road-rescue-vehicle/update-road-rescue-vehicle.dto.js +3 -7
- package/dist/modules/response-unit/dtos/vehicle-unit/vehicle-type/security-vehicle/base-security-vehicle.dto.js +5 -9
- package/dist/modules/response-unit/dtos/vehicle-unit/vehicle-type/security-vehicle/create-security-vehicle.dto.js +3 -7
- package/dist/modules/response-unit/dtos/vehicle-unit/vehicle-type/security-vehicle/security-vehicle.dto.js +2 -6
- package/dist/modules/response-unit/dtos/vehicle-unit/vehicle-type/security-vehicle/update-security-vehicle.dto.js +3 -7
- package/dist/modules/response-unit/dtos/vehicle-unit/vehicle-unit.dto.js +2 -6
- package/dist/modules/response-unit/enums/person-unit/person-unit-category.enum.js +2 -5
- package/dist/modules/response-unit/enums/person-unit/person-unit-status.enum.js +2 -5
- package/dist/modules/response-unit/enums/response-unit/response-unit-type.enum.js +2 -5
- package/dist/modules/response-unit/enums/vehicle-unit/vehicle-crew/ambulance-vehicle-role.enum.js +2 -5
- package/dist/modules/response-unit/enums/vehicle-unit/vehicle-crew/fire-vehicle-role.enum.js +2 -5
- package/dist/modules/response-unit/enums/vehicle-unit/vehicle-crew/road-rescue-vehicle-role.enum.js +2 -5
- package/dist/modules/response-unit/enums/vehicle-unit/vehicle-crew/security-vehicle-role.enum.js +2 -5
- package/dist/modules/response-unit/enums/vehicle-unit/vehicle-type/ambulance-vehicle-type.enum.js +2 -5
- package/dist/modules/response-unit/enums/vehicle-unit/vehicle-type/fire-vehicle-type.enum.js +2 -5
- package/dist/modules/response-unit/enums/vehicle-unit/vehicle-type/road-rescue-vehicle-type.enum.js +2 -5
- package/dist/modules/response-unit/enums/vehicle-unit/vehicle-type/security-vehicle-type.enum.js +2 -5
- package/dist/modules/response-unit/enums/vehicle-unit/vehicle-unit-ownership.enum.js +2 -5
- package/dist/modules/response-unit/enums/vehicle-unit/vehicle-unit-status.enum.js +2 -5
- package/dist/modules/response-unit/enums/vehicle-unit/vehicle-unit-type.enum.js +2 -5
- package/dist/modules/response-unit/index.js +67 -83
- package/dist/modules/response-unit/interfaces/person-unit/person-unit.js +1 -2
- package/dist/modules/response-unit/interfaces/response-unit/response-unit.js +1 -2
- package/dist/modules/response-unit/interfaces/team-unit/team-unit-crew.js +1 -2
- package/dist/modules/response-unit/interfaces/team-unit/team-unit.js +1 -2
- package/dist/modules/response-unit/interfaces/vehicle-unit/vehicle-type/ambulance-vehicle.js +1 -2
- package/dist/modules/response-unit/interfaces/vehicle-unit/vehicle-type/fire-vehicle.js +1 -2
- package/dist/modules/response-unit/interfaces/vehicle-unit/vehicle-type/road-rescue-vehicle.js +1 -2
- package/dist/modules/response-unit/interfaces/vehicle-unit/vehicle-type/security-vehicle.js +1 -2
- package/dist/modules/response-unit/interfaces/vehicle-unit/vehicle-unit-crew.js +1 -2
- package/dist/modules/response-unit/interfaces/vehicle-unit/vehicle-unit-device.js +1 -2
- package/dist/modules/response-unit/interfaces/vehicle-unit/vehicle-unit.js +1 -2
- package/dist/modules/response-unit/validators/valid-vehicle-role.decorator.js +16 -19
- package/dist/modules/role/data/roles.data.js +62 -65
- package/dist/modules/role/dtos/create-role.dto.js +10 -14
- package/dist/modules/role/dtos/update-tole.dto.js +3 -7
- package/dist/modules/role/enums/role.enum.js +2 -5
- package/dist/modules/role/index.js +5 -21
- package/dist/modules/role/interfaces/role.js +1 -2
- package/dist/modules/user/dtos/create-user.dto.js +41 -45
- package/dist/modules/user/dtos/update-user.dto.js +3 -7
- package/dist/modules/user/enums/user-status.enum.js +2 -5
- package/dist/modules/user/index.js +4 -20
- package/dist/modules/user/interfaces/user.js +1 -2
- package/dist/modules/workflow/index.js +1 -17
- package/dist/modules/workflow/interfaces/workflow-query-info.js +1 -2
- package/package.json +3 -1
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const fire_vehicle_role_enum_1 = require("../enums/vehicle-unit/vehicle-crew/fire-vehicle-role.enum");
|
|
9
|
-
const road_rescue_vehicle_role_enum_1 = require("../enums/vehicle-unit/vehicle-crew/road-rescue-vehicle-role.enum");
|
|
10
|
-
function IsValidVehicleRole(validationOptions) {
|
|
1
|
+
import { registerDecorator } from "class-validator";
|
|
2
|
+
import { VehicleUnitType } from "../enums/vehicle-unit/vehicle-unit-type.enum";
|
|
3
|
+
import { AmbulanceVehicleRole } from "../enums/vehicle-unit/vehicle-crew/ambulance-vehicle-role.enum";
|
|
4
|
+
import { SecurityVehicleRole } from "../enums/vehicle-unit/vehicle-crew/security-vehicle-role.enum";
|
|
5
|
+
import { FireVehicleRole } from "../enums/vehicle-unit/vehicle-crew/fire-vehicle-role.enum";
|
|
6
|
+
import { RoadRescueVehicleRole } from "../enums/vehicle-unit/vehicle-crew/road-rescue-vehicle-role.enum";
|
|
7
|
+
export function IsValidVehicleRole(validationOptions) {
|
|
11
8
|
return function (object, propertyName) {
|
|
12
|
-
|
|
9
|
+
registerDecorator({
|
|
13
10
|
name: 'isValidVehicleRole',
|
|
14
11
|
target: object.constructor,
|
|
15
12
|
propertyName: propertyName,
|
|
@@ -21,14 +18,14 @@ function IsValidVehicleRole(validationOptions) {
|
|
|
21
18
|
return true;
|
|
22
19
|
}
|
|
23
20
|
switch (vehicleType) {
|
|
24
|
-
case
|
|
25
|
-
return Object.values(
|
|
26
|
-
case
|
|
27
|
-
return Object.values(
|
|
28
|
-
case
|
|
29
|
-
return Object.values(
|
|
30
|
-
case
|
|
31
|
-
return Object.values(
|
|
21
|
+
case VehicleUnitType.AMBULANCE:
|
|
22
|
+
return Object.values(AmbulanceVehicleRole).includes(value);
|
|
23
|
+
case VehicleUnitType.SECURITY:
|
|
24
|
+
return Object.values(SecurityVehicleRole).includes(value);
|
|
25
|
+
case VehicleUnitType.FIRE:
|
|
26
|
+
return Object.values(FireVehicleRole).includes(value);
|
|
27
|
+
case VehicleUnitType.ROAD_RESCUE:
|
|
28
|
+
return Object.values(RoadRescueVehicleRole).includes(value);
|
|
32
29
|
default:
|
|
33
30
|
return true;
|
|
34
31
|
}
|
|
@@ -1,120 +1,117 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const permission_1 = require("../../permission");
|
|
5
|
-
const role_enum_1 = require("../enums/role.enum");
|
|
6
|
-
exports.ROLES_DATA = [
|
|
1
|
+
import { PermissionActions } from "../../permission";
|
|
2
|
+
import { Roles } from "../enums/role.enum";
|
|
3
|
+
export const ROLES_DATA = [
|
|
7
4
|
{
|
|
8
|
-
name:
|
|
5
|
+
name: Roles.SUPER_ADMIN,
|
|
9
6
|
description: 'Super Admin',
|
|
10
7
|
permissions: ['*']
|
|
11
8
|
},
|
|
12
9
|
{
|
|
13
|
-
name:
|
|
10
|
+
name: Roles.ORGANIZATION_OWNER,
|
|
14
11
|
description: 'Organization Owner: Manages all Organization functions',
|
|
15
12
|
permissions: [
|
|
16
13
|
//organization
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
PermissionActions.READ_ORGANIZATION,
|
|
15
|
+
PermissionActions.UPDATE_ORGANIZATION,
|
|
16
|
+
PermissionActions.DELETE_ORGANIZATION,
|
|
20
17
|
//control centre
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
PermissionActions.CREATE_CONTROL_CENTRE,
|
|
19
|
+
PermissionActions.READ_CONTROL_CENTRE,
|
|
20
|
+
PermissionActions.UPDATE_CONTROL_CENTRE,
|
|
21
|
+
PermissionActions.DELETE_CONTROL_CENTRE,
|
|
25
22
|
//Role
|
|
26
|
-
|
|
23
|
+
PermissionActions.READ_ROLE,
|
|
27
24
|
//User
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
PermissionActions.CREATE_USER,
|
|
26
|
+
PermissionActions.READ_USER,
|
|
27
|
+
PermissionActions.UPDATE_USER,
|
|
28
|
+
PermissionActions.DELETE_USER,
|
|
32
29
|
//Incident
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
PermissionActions.CREATE_INCIDENT,
|
|
31
|
+
PermissionActions.READ_INCIDENT,
|
|
32
|
+
PermissionActions.UPDATE_INCIDENT,
|
|
33
|
+
PermissionActions.DELETE_INCIDENT
|
|
37
34
|
]
|
|
38
35
|
},
|
|
39
36
|
{
|
|
40
|
-
name:
|
|
37
|
+
name: Roles.ORGANIZATION_ADMIN,
|
|
41
38
|
description: 'Organization Admin: Manage Organization & Set up Control Centres',
|
|
42
39
|
permissions: [
|
|
43
40
|
//organization
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
PermissionActions.READ_ORGANIZATION,
|
|
42
|
+
PermissionActions.UPDATE_ORGANIZATION,
|
|
46
43
|
//control centre
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
PermissionActions.CREATE_CONTROL_CENTRE,
|
|
45
|
+
PermissionActions.READ_CONTROL_CENTRE,
|
|
46
|
+
PermissionActions.UPDATE_CONTROL_CENTRE,
|
|
47
|
+
PermissionActions.DELETE_CONTROL_CENTRE,
|
|
51
48
|
//Role
|
|
52
|
-
|
|
49
|
+
PermissionActions.READ_ROLE,
|
|
53
50
|
//User
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
51
|
+
PermissionActions.CREATE_USER,
|
|
52
|
+
PermissionActions.READ_USER,
|
|
53
|
+
PermissionActions.UPDATE_USER,
|
|
54
|
+
PermissionActions.DELETE_USER,
|
|
58
55
|
//Incident
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
56
|
+
PermissionActions.CREATE_INCIDENT,
|
|
57
|
+
PermissionActions.READ_INCIDENT,
|
|
58
|
+
PermissionActions.UPDATE_INCIDENT
|
|
62
59
|
]
|
|
63
60
|
},
|
|
64
61
|
{
|
|
65
|
-
name:
|
|
62
|
+
name: Roles.ORGANIZATION_USER,
|
|
66
63
|
description: 'Organization User: View organization-wide data',
|
|
67
64
|
permissions: [
|
|
68
65
|
//organization
|
|
69
|
-
|
|
66
|
+
PermissionActions.READ_ORGANIZATION,
|
|
70
67
|
//control centre
|
|
71
|
-
|
|
68
|
+
PermissionActions.READ_CONTROL_CENTRE,
|
|
72
69
|
//Role
|
|
73
|
-
|
|
70
|
+
PermissionActions.READ_ROLE,
|
|
74
71
|
//User
|
|
75
|
-
|
|
72
|
+
PermissionActions.READ_USER,
|
|
76
73
|
//Incident
|
|
77
|
-
|
|
74
|
+
PermissionActions.READ_INCIDENT
|
|
78
75
|
]
|
|
79
76
|
},
|
|
80
77
|
{
|
|
81
|
-
name:
|
|
78
|
+
name: Roles.CONTROL_CENTRE_ADMIN,
|
|
82
79
|
description: 'Control Centre Admin: Manage Control Centre',
|
|
83
80
|
permissions: [
|
|
84
81
|
//Organization
|
|
85
|
-
|
|
82
|
+
PermissionActions.READ_ORGANIZATION,
|
|
86
83
|
//Control Centre
|
|
87
|
-
|
|
88
|
-
|
|
84
|
+
PermissionActions.READ_CONTROL_CENTRE,
|
|
85
|
+
PermissionActions.UPDATE_CONTROL_CENTRE,
|
|
89
86
|
//Role
|
|
90
|
-
|
|
87
|
+
PermissionActions.READ_ROLE,
|
|
91
88
|
//User
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
89
|
+
PermissionActions.CREATE_USER,
|
|
90
|
+
PermissionActions.READ_USER,
|
|
91
|
+
PermissionActions.UPDATE_USER,
|
|
92
|
+
PermissionActions.DELETE_USER,
|
|
96
93
|
//Incident
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
94
|
+
PermissionActions.CREATE_INCIDENT,
|
|
95
|
+
PermissionActions.READ_INCIDENT,
|
|
96
|
+
PermissionActions.UPDATE_INCIDENT
|
|
100
97
|
]
|
|
101
98
|
},
|
|
102
99
|
{
|
|
103
|
-
name:
|
|
100
|
+
name: Roles.CONTROL_CENTRE_USER,
|
|
104
101
|
description: 'Control Centre User: View control centre-wide data & Manage Incidents',
|
|
105
102
|
permissions: [
|
|
106
103
|
//Organization
|
|
107
|
-
|
|
104
|
+
PermissionActions.READ_ORGANIZATION,
|
|
108
105
|
//Control Centre
|
|
109
|
-
|
|
106
|
+
PermissionActions.READ_CONTROL_CENTRE,
|
|
110
107
|
//Role
|
|
111
|
-
|
|
108
|
+
PermissionActions.READ_ROLE,
|
|
112
109
|
//User
|
|
113
|
-
|
|
110
|
+
PermissionActions.READ_USER,
|
|
114
111
|
//Incident
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
112
|
+
PermissionActions.CREATE_INCIDENT,
|
|
113
|
+
PermissionActions.READ_INCIDENT,
|
|
114
|
+
PermissionActions.UPDATE_INCIDENT
|
|
118
115
|
]
|
|
119
116
|
}
|
|
120
117
|
];
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8,26 +7,23 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const role_enum_1 = require("../enums/role.enum");
|
|
15
|
-
class CreateRoleDto {
|
|
10
|
+
import { IsArray, IsEnum, IsNotEmpty, IsOptional, IsString } from "class-validator";
|
|
11
|
+
import { Roles } from "../enums/role.enum";
|
|
12
|
+
export class CreateRoleDto {
|
|
16
13
|
}
|
|
17
|
-
exports.CreateRoleDto = CreateRoleDto;
|
|
18
14
|
__decorate([
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
IsEnum(Roles),
|
|
16
|
+
IsNotEmpty(),
|
|
21
17
|
__metadata("design:type", String)
|
|
22
18
|
], CreateRoleDto.prototype, "name", void 0);
|
|
23
19
|
__decorate([
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
IsString(),
|
|
21
|
+
IsOptional(),
|
|
26
22
|
__metadata("design:type", String)
|
|
27
23
|
], CreateRoleDto.prototype, "description", void 0);
|
|
28
24
|
__decorate([
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
IsArray(),
|
|
26
|
+
IsString({ each: true }),
|
|
27
|
+
IsNotEmpty(),
|
|
32
28
|
__metadata("design:type", Array)
|
|
33
29
|
], CreateRoleDto.prototype, "permissions", void 0);
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const mapped_types_1 = require("@nestjs/mapped-types");
|
|
5
|
-
const create_role_dto_1 = require("./create-role.dto");
|
|
6
|
-
class UpdateRoleDto extends (0, mapped_types_1.PartialType)(create_role_dto_1.CreateRoleDto) {
|
|
1
|
+
import { PartialType } from "@nestjs/mapped-types";
|
|
2
|
+
import { CreateRoleDto } from "./create-role.dto";
|
|
3
|
+
export class UpdateRoleDto extends PartialType(CreateRoleDto) {
|
|
7
4
|
}
|
|
8
|
-
exports.UpdateRoleDto = UpdateRoleDto;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Roles = void 0;
|
|
4
|
-
var Roles;
|
|
1
|
+
export var Roles;
|
|
5
2
|
(function (Roles) {
|
|
6
3
|
Roles["SUPER_ADMIN"] = "Super-Admin";
|
|
7
4
|
Roles["ORGANIZATION_OWNER"] = "Org:Owner";
|
|
@@ -10,4 +7,4 @@ var Roles;
|
|
|
10
7
|
Roles["CONTROL_CENTRE_ADMIN"] = "Control-Centre:Admin";
|
|
11
8
|
Roles["CONTROL_CENTRE_USER"] = "Control-Centre:User";
|
|
12
9
|
Roles["MOBILE_USER"] = "Mobile-User";
|
|
13
|
-
})(Roles || (
|
|
10
|
+
})(Roles || (Roles = {}));
|
|
@@ -1,21 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./data/roles.data"), exports);
|
|
18
|
-
__exportStar(require("./dtos/create-role.dto"), exports);
|
|
19
|
-
__exportStar(require("./dtos/update-tole.dto"), exports);
|
|
20
|
-
__exportStar(require("./enums/role.enum"), exports);
|
|
21
|
-
__exportStar(require("./interfaces/role"), exports);
|
|
1
|
+
export * from './data/roles.data';
|
|
2
|
+
export * from './dtos/create-role.dto';
|
|
3
|
+
export * from './dtos/update-tole.dto';
|
|
4
|
+
export * from './enums/role.enum';
|
|
5
|
+
export * from './interfaces/role';
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -8,87 +7,84 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const role_1 = require("../../role");
|
|
18
|
-
class CreateUserDto {
|
|
10
|
+
import { ArrayNotEmpty, IsArray, IsBoolean, IsDate, IsEmail, IsEnum, IsNotEmpty, IsNumber, IsOptional, IsPhoneNumber, IsString, Matches, MaxLength, MinLength, } from 'class-validator';
|
|
11
|
+
import { SentenceCase } from '../../../decorators/case-decorators';
|
|
12
|
+
import { UserStatus } from '../enums/user-status.enum';
|
|
13
|
+
import { PASSWORD_ERROR_MESSAGE, PASSWORD_REGEX } from '../../common/constants/password-regex.const';
|
|
14
|
+
import { Roles } from '../../role';
|
|
15
|
+
export class CreateUserDto {
|
|
19
16
|
}
|
|
20
|
-
exports.CreateUserDto = CreateUserDto;
|
|
21
17
|
__decorate([
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
IsString(),
|
|
19
|
+
IsNotEmpty(),
|
|
20
|
+
MinLength(2),
|
|
21
|
+
MaxLength(50),
|
|
22
|
+
SentenceCase(),
|
|
27
23
|
__metadata("design:type", String)
|
|
28
24
|
], CreateUserDto.prototype, "name", void 0);
|
|
29
25
|
__decorate([
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
IsEmail(),
|
|
27
|
+
IsNotEmpty(),
|
|
28
|
+
MaxLength(50),
|
|
33
29
|
__metadata("design:type", String)
|
|
34
30
|
], CreateUserDto.prototype, "email", void 0);
|
|
35
31
|
__decorate([
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
IsPhoneNumber(),
|
|
33
|
+
MaxLength(20),
|
|
34
|
+
IsOptional(),
|
|
39
35
|
__metadata("design:type", String)
|
|
40
36
|
], CreateUserDto.prototype, "phoneNumber", void 0);
|
|
41
37
|
__decorate([
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
IsArray(),
|
|
39
|
+
IsEnum(Roles, { each: true }),
|
|
40
|
+
ArrayNotEmpty(),
|
|
45
41
|
__metadata("design:type", Array)
|
|
46
42
|
], CreateUserDto.prototype, "roles", void 0);
|
|
47
43
|
__decorate([
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
44
|
+
IsString(),
|
|
45
|
+
MinLength(8),
|
|
46
|
+
Matches(PASSWORD_REGEX, { message: PASSWORD_ERROR_MESSAGE }),
|
|
47
|
+
IsOptional(),
|
|
52
48
|
__metadata("design:type", String)
|
|
53
49
|
], CreateUserDto.prototype, "password", void 0);
|
|
54
50
|
__decorate([
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
IsString(),
|
|
52
|
+
IsOptional(),
|
|
57
53
|
__metadata("design:type", String)
|
|
58
54
|
], CreateUserDto.prototype, "avatar", void 0);
|
|
59
55
|
__decorate([
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
56
|
+
IsString(),
|
|
57
|
+
IsOptional(),
|
|
58
|
+
MaxLength(50),
|
|
63
59
|
__metadata("design:type", String)
|
|
64
60
|
], CreateUserDto.prototype, "designation", void 0);
|
|
65
61
|
__decorate([
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
IsEnum(UserStatus),
|
|
63
|
+
IsOptional(),
|
|
68
64
|
__metadata("design:type", String)
|
|
69
65
|
], CreateUserDto.prototype, "status", void 0);
|
|
70
66
|
__decorate([
|
|
71
|
-
|
|
72
|
-
|
|
67
|
+
IsBoolean(),
|
|
68
|
+
IsOptional(),
|
|
73
69
|
__metadata("design:type", Boolean)
|
|
74
70
|
], CreateUserDto.prototype, "isTermsAccepted", void 0);
|
|
75
71
|
__decorate([
|
|
76
|
-
|
|
77
|
-
|
|
72
|
+
IsString(),
|
|
73
|
+
IsOptional(),
|
|
78
74
|
__metadata("design:type", String)
|
|
79
75
|
], CreateUserDto.prototype, "verificationToken", void 0);
|
|
80
76
|
__decorate([
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
IsDate(),
|
|
78
|
+
IsOptional(),
|
|
83
79
|
__metadata("design:type", Date)
|
|
84
80
|
], CreateUserDto.prototype, "verificationTokenExpiresAt", void 0);
|
|
85
81
|
__decorate([
|
|
86
|
-
|
|
87
|
-
|
|
82
|
+
IsNumber(),
|
|
83
|
+
IsNotEmpty(),
|
|
88
84
|
__metadata("design:type", Number)
|
|
89
85
|
], CreateUserDto.prototype, "controlCentreId", void 0);
|
|
90
86
|
__decorate([
|
|
91
|
-
|
|
92
|
-
|
|
87
|
+
IsNumber(),
|
|
88
|
+
IsNotEmpty(),
|
|
93
89
|
__metadata("design:type", Number)
|
|
94
90
|
], CreateUserDto.prototype, "organizationId", void 0);
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const mapped_types_1 = require("@nestjs/mapped-types");
|
|
5
|
-
const create_user_dto_1 = require("./create-user.dto");
|
|
6
|
-
class UpdateUserDto extends (0, mapped_types_1.PartialType)(create_user_dto_1.CreateUserDto) {
|
|
1
|
+
import { PartialType } from "@nestjs/mapped-types";
|
|
2
|
+
import { CreateUserDto } from "./create-user.dto";
|
|
3
|
+
export class UpdateUserDto extends PartialType(CreateUserDto) {
|
|
7
4
|
}
|
|
8
|
-
exports.UpdateUserDto = UpdateUserDto;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UserStatus = void 0;
|
|
4
|
-
var UserStatus;
|
|
1
|
+
export var UserStatus;
|
|
5
2
|
(function (UserStatus) {
|
|
6
3
|
UserStatus["ACTIVE"] = "active";
|
|
7
4
|
UserStatus["INACTIVE"] = "inactive";
|
|
8
5
|
UserStatus["PENDING"] = "pending";
|
|
9
|
-
})(UserStatus || (
|
|
6
|
+
})(UserStatus || (UserStatus = {}));
|
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./dtos/create-user.dto"), exports);
|
|
18
|
-
__exportStar(require("./dtos/update-user.dto"), exports);
|
|
19
|
-
__exportStar(require("./enums/user-status.enum"), exports);
|
|
20
|
-
__exportStar(require("./interfaces/user"), exports);
|
|
1
|
+
export * from './dtos/create-user.dto';
|
|
2
|
+
export * from './dtos/update-user.dto';
|
|
3
|
+
export * from './enums/user-status.enum';
|
|
4
|
+
export * from './interfaces/user';
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./interfaces/workflow-query-info"), exports);
|
|
1
|
+
export * from './interfaces/workflow-query-info';
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|