@rufous/aem 1.0.181 → 1.0.183
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/build/events/company-assigned-project-event.d.ts +2 -0
- package/build/events/company-unassigned-project-event.d.ts +17 -0
- package/build/events/company-unassigned-project-event.js +2 -0
- package/build/events/subjects.d.ts +1 -0
- package/build/events/subjects.js +1 -0
- package/build/index.d.ts +3 -0
- package/build/index.js +3 -0
- package/build/middlewares/require-company-or-candidate-auth.d.ts +2 -0
- package/build/middlewares/require-company-or-candidate-auth.js +22 -0
- package/build/middlewares/require-partner-or-candidate-auth.d.ts +2 -0
- package/build/middlewares/require-partner-or-candidate-auth.js +23 -0
- package/package.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Subjects } from './subjects';
|
|
2
|
+
export interface CompanyUnAssignedProjectEvent {
|
|
3
|
+
subject: Subjects.CompanyUnAssignedProject;
|
|
4
|
+
data: {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
companyId: string;
|
|
8
|
+
employeeId: string;
|
|
9
|
+
personalId: string;
|
|
10
|
+
personalEmailId: string;
|
|
11
|
+
candidatePrice: number;
|
|
12
|
+
companyPrice: number;
|
|
13
|
+
employeeEmailId: string;
|
|
14
|
+
workStartDate: string;
|
|
15
|
+
workEndData: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -55,6 +55,7 @@ export declare enum Subjects {
|
|
|
55
55
|
CompanyEmployeeCreated = "company:employee:created",
|
|
56
56
|
CompanyProjectCreated = "company:project:created",
|
|
57
57
|
CompanyAssignedProject = "company:assigned:project",
|
|
58
|
+
CompanyUnAssignedProject = "company:unassigned:project",
|
|
58
59
|
RemoveChatGroup = "remove:chat:group",
|
|
59
60
|
AddChatGroup = "add:chat:group",
|
|
60
61
|
SendNotification = "send:notification",
|
package/build/events/subjects.js
CHANGED
|
@@ -59,6 +59,7 @@ var Subjects;
|
|
|
59
59
|
Subjects["CompanyEmployeeCreated"] = "company:employee:created";
|
|
60
60
|
Subjects["CompanyProjectCreated"] = "company:project:created";
|
|
61
61
|
Subjects["CompanyAssignedProject"] = "company:assigned:project";
|
|
62
|
+
Subjects["CompanyUnAssignedProject"] = "company:unassigned:project";
|
|
62
63
|
Subjects["RemoveChatGroup"] = "remove:chat:group";
|
|
63
64
|
Subjects["AddChatGroup"] = "add:chat:group";
|
|
64
65
|
Subjects["SendNotification"] = "send:notification";
|
package/build/index.d.ts
CHANGED
|
@@ -25,6 +25,8 @@ export * from './middlewares/require-superadmin-auth';
|
|
|
25
25
|
export * from './middlewares/require-superadmin-or-candidate-auth';
|
|
26
26
|
export * from './middlewares/require-superadmin-or-partner-auth';
|
|
27
27
|
export * from './middlewares/require-superadmin-or-company-auth';
|
|
28
|
+
export * from './middlewares/require-partner-or-candidate-auth';
|
|
29
|
+
export * from './middlewares/require-company-or-candidate-auth';
|
|
28
30
|
export * from './middlewares/validate-request';
|
|
29
31
|
export * from './events/add-chat-group-event';
|
|
30
32
|
export * from './events/admin-hierarchy-created-event';
|
|
@@ -62,6 +64,7 @@ export * from './events/employee-created-event';
|
|
|
62
64
|
export * from './events/company-employee-created-event';
|
|
63
65
|
export * from './events/company-project-created-event';
|
|
64
66
|
export * from './events/company-assigned-project-event';
|
|
67
|
+
export * from './events/company-unassigned-project-event';
|
|
65
68
|
export * from './events/partner-employee-created-event';
|
|
66
69
|
export * from './events/employee-status-updated-event';
|
|
67
70
|
export * from './events/invite-accepted-event';
|
package/build/index.js
CHANGED
|
@@ -38,6 +38,8 @@ __exportStar(require("./middlewares/require-superadmin-auth"), exports);
|
|
|
38
38
|
__exportStar(require("./middlewares/require-superadmin-or-candidate-auth"), exports);
|
|
39
39
|
__exportStar(require("./middlewares/require-superadmin-or-partner-auth"), exports);
|
|
40
40
|
__exportStar(require("./middlewares/require-superadmin-or-company-auth"), exports);
|
|
41
|
+
__exportStar(require("./middlewares/require-partner-or-candidate-auth"), exports);
|
|
42
|
+
__exportStar(require("./middlewares/require-company-or-candidate-auth"), exports);
|
|
41
43
|
__exportStar(require("./middlewares/validate-request"), exports);
|
|
42
44
|
__exportStar(require("./events/add-chat-group-event"), exports);
|
|
43
45
|
__exportStar(require("./events/admin-hierarchy-created-event"), exports);
|
|
@@ -75,6 +77,7 @@ __exportStar(require("./events/employee-created-event"), exports);
|
|
|
75
77
|
__exportStar(require("./events/company-employee-created-event"), exports);
|
|
76
78
|
__exportStar(require("./events/company-project-created-event"), exports);
|
|
77
79
|
__exportStar(require("./events/company-assigned-project-event"), exports);
|
|
80
|
+
__exportStar(require("./events/company-unassigned-project-event"), exports);
|
|
78
81
|
__exportStar(require("./events/partner-employee-created-event"), exports);
|
|
79
82
|
__exportStar(require("./events/employee-status-updated-event"), exports);
|
|
80
83
|
__exportStar(require("./events/invite-accepted-event"), exports);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.requireCompanyOrCandidateAuth = void 0;
|
|
4
|
+
var not_authorized_error_1 = require("../errors/not-authorized-error");
|
|
5
|
+
var user_type_1 = require("../types/user-type");
|
|
6
|
+
var user_status_1 = require("../types/user-status");
|
|
7
|
+
exports.requireCompanyOrCandidateAuth = function (req, res, next) {
|
|
8
|
+
if (!req.currentUser) {
|
|
9
|
+
throw new not_authorized_error_1.NotAuthorizedError();
|
|
10
|
+
}
|
|
11
|
+
if (req.currentUser.ust === user_status_1.UserStatus.Suspended) {
|
|
12
|
+
throw new not_authorized_error_1.NotAuthorizedError();
|
|
13
|
+
}
|
|
14
|
+
if (req.currentUser.uty != user_type_1.UserType.Candidate
|
|
15
|
+
&& req.currentUser.uty != user_type_1.UserType.CompanyEmployee
|
|
16
|
+
&& req.currentUser.uty != user_type_1.UserType.CompanySuperuser
|
|
17
|
+
&& req.currentUser.uty != user_type_1.UserType.CompanyEmployeeManager
|
|
18
|
+
&& req.currentUser.uty != user_type_1.UserType.CompanyManager) {
|
|
19
|
+
throw new not_authorized_error_1.NotAuthorizedError();
|
|
20
|
+
}
|
|
21
|
+
next();
|
|
22
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.requirePartnerOrCandidateAuth = void 0;
|
|
4
|
+
var not_authorized_error_1 = require("../errors/not-authorized-error");
|
|
5
|
+
var user_type_1 = require("../types/user-type");
|
|
6
|
+
var user_status_1 = require("../types/user-status");
|
|
7
|
+
exports.requirePartnerOrCandidateAuth = function (req, res, next) {
|
|
8
|
+
if (!req.currentUser) {
|
|
9
|
+
throw new not_authorized_error_1.NotAuthorizedError();
|
|
10
|
+
}
|
|
11
|
+
if (req.currentUser.ust === user_status_1.UserStatus.Suspended) {
|
|
12
|
+
throw new not_authorized_error_1.NotAuthorizedError();
|
|
13
|
+
}
|
|
14
|
+
if (req.currentUser.uty != user_type_1.UserType.Candidate
|
|
15
|
+
&& req.currentUser.uty != user_type_1.UserType.PartnerCustomerSupport
|
|
16
|
+
&& req.currentUser.uty != user_type_1.UserType.PartnerEmployee
|
|
17
|
+
&& req.currentUser.uty != user_type_1.UserType.PartnerEmployeeManager
|
|
18
|
+
&& req.currentUser.uty != user_type_1.UserType.PartnerManager
|
|
19
|
+
&& req.currentUser.uty != user_type_1.UserType.PartnerSuperuser) {
|
|
20
|
+
throw new not_authorized_error_1.NotAuthorizedError();
|
|
21
|
+
}
|
|
22
|
+
next();
|
|
23
|
+
};
|