@rufous/aem 1.1.65 → 1.1.67

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.
Files changed (101) hide show
  1. package/build/errors/bad-request-error.js +3 -1
  2. package/build/errors/custom-error.js +3 -1
  3. package/build/errors/database-connection-error.js +3 -1
  4. package/build/errors/internal-server-error.js +3 -1
  5. package/build/errors/not-authorized-error.js +3 -1
  6. package/build/errors/not-found-error.js +3 -1
  7. package/build/errors/not-verified-error.js +3 -1
  8. package/build/errors/permission-denied-error.js +3 -1
  9. package/build/errors/request-validation-error.js +3 -1
  10. package/build/errors/security-error.js +3 -1
  11. package/build/events/base-listener.js +1 -1
  12. package/build/events/send-workitem-email-event.d.ts +7 -0
  13. package/build/events/send-workitem-email-event.js +2 -0
  14. package/build/events/subjects.d.ts +2 -0
  15. package/build/events/subjects.js +3 -1
  16. package/build/events/users-leaves-calculation-event.d.ts +7 -0
  17. package/build/events/users-leaves-calculation-event.js +2 -0
  18. package/build/index.d.ts +2 -0
  19. package/build/index.js +8 -2
  20. package/build/middlewares/current-user.js +2 -1
  21. package/build/middlewares/error-handler.js +2 -1
  22. package/build/middlewares/require-auth.js +2 -1
  23. package/build/middlewares/require-candidate-auth.js +2 -1
  24. package/build/middlewares/require-company-employee-auth.js +2 -1
  25. package/build/middlewares/require-company-employee-manager-auth.js +2 -1
  26. package/build/middlewares/require-company-manager-auth.js +2 -1
  27. package/build/middlewares/require-company-or-candidate-auth.js +2 -1
  28. package/build/middlewares/require-company-superuser-auth.js +2 -1
  29. package/build/middlewares/require-customer-support-auth.js +2 -1
  30. package/build/middlewares/require-partner-candidate-auth.js +2 -1
  31. package/build/middlewares/require-partner-employee-auth.js +2 -1
  32. package/build/middlewares/require-partner-employee-manager-auth.js +2 -1
  33. package/build/middlewares/require-partner-manager-auth.js +2 -1
  34. package/build/middlewares/require-partner-or-candidate-auth.js +2 -1
  35. package/build/middlewares/require-partner-superuser-auth.js +2 -1
  36. package/build/middlewares/require-superadmin-auth.js +2 -1
  37. package/build/middlewares/require-superadmin-or-candidate-auth.js +2 -1
  38. package/build/middlewares/require-superadmin-or-company-auth.js +2 -1
  39. package/build/middlewares/require-superadmin-or-partner-auth.js +2 -1
  40. package/build/middlewares/required-permissions.js +5 -4
  41. package/build/middlewares/validate-request.js +3 -2
  42. package/build/types/access-level.js +1 -1
  43. package/build/types/agreement-status.js +1 -1
  44. package/build/types/agreement-type.js +1 -1
  45. package/build/types/agreement-user-type.js +1 -1
  46. package/build/types/app-type.js +1 -1
  47. package/build/types/asset-allocation-status.js +1 -1
  48. package/build/types/asset-status.js +1 -1
  49. package/build/types/bank-account-type.js +1 -1
  50. package/build/types/candidate-states.js +1 -1
  51. package/build/types/candidate-status.js +1 -1
  52. package/build/types/chat-group-action-type.js +1 -1
  53. package/build/types/chat-message-status.js +1 -1
  54. package/build/types/chat-message-type.js +1 -1
  55. package/build/types/company-states.js +1 -1
  56. package/build/types/company-status.js +1 -1
  57. package/build/types/company-type.js +1 -1
  58. package/build/types/country-type.js +1 -1
  59. package/build/types/currency-type.js +1 -1
  60. package/build/types/current-slot-status.js +1 -1
  61. package/build/types/device-push-type.js +1 -1
  62. package/build/types/device-type.js +1 -1
  63. package/build/types/document-status.js +1 -1
  64. package/build/types/education-type.js +1 -1
  65. package/build/types/email-delivery-type.js +1 -1
  66. package/build/types/email-template.js +1 -1
  67. package/build/types/email-type.js +1 -1
  68. package/build/types/employment-type.js +1 -1
  69. package/build/types/file-type.js +1 -1
  70. package/build/types/gender-type.js +1 -1
  71. package/build/types/invite-status.js +1 -1
  72. package/build/types/job-application-initiated-by.js +1 -1
  73. package/build/types/job-application-state.js +1 -1
  74. package/build/types/job-status.js +1 -1
  75. package/build/types/kyc-status.js +1 -1
  76. package/build/types/notification-type.js +1 -1
  77. package/build/types/order-status.d.ts +4 -1
  78. package/build/types/order-status.js +4 -1
  79. package/build/types/order-type.js +1 -1
  80. package/build/types/otp-status.js +1 -1
  81. package/build/types/otp-type.js +1 -1
  82. package/build/types/partner-states.js +1 -1
  83. package/build/types/partner-status.js +1 -1
  84. package/build/types/partner-type.js +1 -1
  85. package/build/types/payment-status.js +1 -1
  86. package/build/types/payment-type.js +1 -1
  87. package/build/types/profile-type.js +1 -1
  88. package/build/types/project-status.js +1 -1
  89. package/build/types/razorpay-account-status.js +1 -1
  90. package/build/types/resume-status.js +1 -1
  91. package/build/types/service-type.js +1 -1
  92. package/build/types/sms-template.js +1 -1
  93. package/build/types/sms-type.js +1 -1
  94. package/build/types/task-status.js +1 -1
  95. package/build/types/timesheet-payment-status.js +1 -1
  96. package/build/types/timesheet-status.js +1 -1
  97. package/build/types/user-status.js +1 -1
  98. package/build/types/user-type.d.ts +4 -4
  99. package/build/types/user-type.js +1 -1
  100. package/build/types/work-states.js +1 -1
  101. package/package.json +3 -3
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
3
3
  var extendStatics = function (d, b) {
4
4
  extendStatics = Object.setPrototypeOf ||
5
5
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
3
3
  var extendStatics = function (d, b) {
4
4
  extendStatics = Object.setPrototypeOf ||
5
5
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
3
3
  var extendStatics = function (d, b) {
4
4
  extendStatics = Object.setPrototypeOf ||
5
5
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
3
3
  var extendStatics = function (d, b) {
4
4
  extendStatics = Object.setPrototypeOf ||
5
5
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
3
3
  var extendStatics = function (d, b) {
4
4
  extendStatics = Object.setPrototypeOf ||
5
5
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
3
3
  var extendStatics = function (d, b) {
4
4
  extendStatics = Object.setPrototypeOf ||
5
5
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
3
3
  var extendStatics = function (d, b) {
4
4
  extendStatics = Object.setPrototypeOf ||
5
5
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
3
3
  var extendStatics = function (d, b) {
4
4
  extendStatics = Object.setPrototypeOf ||
5
5
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
3
3
  var extendStatics = function (d, b) {
4
4
  extendStatics = Object.setPrototypeOf ||
5
5
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
3
3
  var extendStatics = function (d, b) {
4
4
  extendStatics = Object.setPrototypeOf ||
5
5
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -18,7 +18,7 @@ var Listener = /** @class */ (function () {
18
18
  var _this = this;
19
19
  var subscription = this.client.subscribe(this.subject, this.queueGroupName, this.subscriptionOptions());
20
20
  subscription.on('message', function (msg) {
21
- console.log("Message received: " + _this.subject + " / " + _this.queueGroupName);
21
+ console.log("Message received: ".concat(_this.subject, " / ").concat(_this.queueGroupName));
22
22
  var parsedData = _this.parseMessage(msg);
23
23
  _this.onMessage(parsedData, msg);
24
24
  });
@@ -0,0 +1,7 @@
1
+ import { Subjects } from './subjects';
2
+ export interface SendWorkitemEmailEvent {
3
+ subject: Subjects.SendWorkitemEmail;
4
+ data: {
5
+ startTime: string;
6
+ };
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -103,12 +103,14 @@ export declare enum Subjects {
103
103
  TabInformationCreated = "tab:information:created",
104
104
  RazorpayAccountCreated = "razorpay:account:created",
105
105
  RecurringWorkitem = "recurring:workitem",
106
+ SendWorkitemEmail = "send:workitem:email",
106
107
  TeamCreated = "team:created",
107
108
  UserRoleCreatedOrUpdated = "user:role:created:or:updated",
108
109
  UserProfileCreated = "user:profile:created",
109
110
  UserProfileDeleted = "user:profile:deleted",
110
111
  UserPermissionCreated = "user:permission:created",
111
112
  UserRoleDeleted = "user:role:deleted",
113
+ UsersLeavesCalculation = "users:leaves:calculation",
112
114
  UpdateFirebaseWorkitems = "update:firebase:workitems",
113
115
  WorkitemCreatedOrUpdated = "workitem:created:or:updated"
114
116
  }
@@ -107,12 +107,14 @@ var Subjects;
107
107
  Subjects["TabInformationCreated"] = "tab:information:created";
108
108
  Subjects["RazorpayAccountCreated"] = "razorpay:account:created";
109
109
  Subjects["RecurringWorkitem"] = "recurring:workitem";
110
+ Subjects["SendWorkitemEmail"] = "send:workitem:email";
110
111
  Subjects["TeamCreated"] = "team:created";
111
112
  Subjects["UserRoleCreatedOrUpdated"] = "user:role:created:or:updated";
112
113
  Subjects["UserProfileCreated"] = "user:profile:created";
113
114
  Subjects["UserProfileDeleted"] = "user:profile:deleted";
114
115
  Subjects["UserPermissionCreated"] = "user:permission:created";
115
116
  Subjects["UserRoleDeleted"] = "user:role:deleted";
117
+ Subjects["UsersLeavesCalculation"] = "users:leaves:calculation";
116
118
  Subjects["UpdateFirebaseWorkitems"] = "update:firebase:workitems";
117
119
  Subjects["WorkitemCreatedOrUpdated"] = "workitem:created:or:updated";
118
- })(Subjects = exports.Subjects || (exports.Subjects = {}));
120
+ })(Subjects || (exports.Subjects = Subjects = {}));
@@ -0,0 +1,7 @@
1
+ import { Subjects } from './subjects';
2
+ export interface UsersLeavesCalculationEvent {
3
+ subject: Subjects.UsersLeavesCalculation;
4
+ data: {
5
+ startTime: string;
6
+ };
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/build/index.d.ts CHANGED
@@ -141,6 +141,8 @@ export * from './events/workitem-created-or-updated-event';
141
141
  export * from './events/master-permission-created-event';
142
142
  export * from './events/master-role-created-event';
143
143
  export * from './events/user-permission-created-event';
144
+ export * from './events/users-leaves-calculation-event';
145
+ export * from './events/send-workitem-email-event';
144
146
  export * from './events/project-agreement-created-event';
145
147
  export * from './types/access-level';
146
148
  export * from './types/asset-status';
package/build/index.js CHANGED
@@ -1,13 +1,17 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[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);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
8
12
  }));
9
13
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
15
  };
12
16
  Object.defineProperty(exports, "__esModule", { value: true });
13
17
  // Re-export stuff from errors and middlewares
@@ -154,6 +158,8 @@ __exportStar(require("./events/workitem-created-or-updated-event"), exports);
154
158
  __exportStar(require("./events/master-permission-created-event"), exports);
155
159
  __exportStar(require("./events/master-role-created-event"), exports);
156
160
  __exportStar(require("./events/user-permission-created-event"), exports);
161
+ __exportStar(require("./events/users-leaves-calculation-event"), exports);
162
+ __exportStar(require("./events/send-workitem-email-event"), exports);
157
163
  __exportStar(require("./events/project-agreement-created-event"), exports);
158
164
  __exportStar(require("./types/access-level"), exports);
159
165
  __exportStar(require("./types/asset-status"), exports);
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.currentUser = void 0;
7
7
  var jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
8
- exports.currentUser = function (req, res, next) {
8
+ var currentUser = function (req, res, next) {
9
9
  var _a, _b, _c, _d;
10
10
  if (!((_a = req.session) === null || _a === void 0 ? void 0 : _a.jwt)) {
11
11
  var noToken = false;
@@ -33,3 +33,4 @@ exports.currentUser = function (req, res, next) {
33
33
  catch (err) { }
34
34
  next();
35
35
  };
36
+ exports.currentUser = currentUser;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.errorHandler = void 0;
4
4
  var custom_error_1 = require("../errors/custom-error");
5
- exports.errorHandler = function (err, req, res, next) {
5
+ var errorHandler = function (err, req, res, next) {
6
6
  if (err instanceof custom_error_1.CustomError) {
7
7
  return res.status(err.statusCode).send({ errors: err.serializeErrors() });
8
8
  }
@@ -11,3 +11,4 @@ exports.errorHandler = function (err, req, res, next) {
11
11
  errors: [{ message: 'Something went wrong' }]
12
12
  });
13
13
  };
14
+ exports.errorHandler = errorHandler;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.requireAuth = void 0;
4
4
  var not_authorized_error_1 = require("../errors/not-authorized-error");
5
5
  var user_status_1 = require("../types/user-status");
6
- exports.requireAuth = function (req, res, next) {
6
+ var requireAuth = function (req, res, next) {
7
7
  if (!req.currentUser) {
8
8
  throw new not_authorized_error_1.NotAuthorizedError();
9
9
  }
@@ -12,3 +12,4 @@ exports.requireAuth = function (req, res, next) {
12
12
  }
13
13
  next();
14
14
  };
15
+ exports.requireAuth = requireAuth;
@@ -4,7 +4,7 @@ exports.requireCandidateAuth = void 0;
4
4
  var not_authorized_error_1 = require("../errors/not-authorized-error");
5
5
  var user_type_1 = require("../types/user-type");
6
6
  var user_status_1 = require("../types/user-status");
7
- exports.requireCandidateAuth = function (req, res, next) {
7
+ var requireCandidateAuth = function (req, res, next) {
8
8
  if (!req.currentUser) {
9
9
  throw new not_authorized_error_1.NotAuthorizedError();
10
10
  }
@@ -17,3 +17,4 @@ exports.requireCandidateAuth = function (req, res, next) {
17
17
  }
18
18
  next();
19
19
  };
20
+ exports.requireCandidateAuth = requireCandidateAuth;
@@ -4,7 +4,7 @@ exports.requireCompanyEmployeeAuth = void 0;
4
4
  var not_authorized_error_1 = require("../errors/not-authorized-error");
5
5
  var user_type_1 = require("../types/user-type");
6
6
  var user_status_1 = require("../types/user-status");
7
- exports.requireCompanyEmployeeAuth = function (req, res, next) {
7
+ var requireCompanyEmployeeAuth = function (req, res, next) {
8
8
  if (!req.currentUser) {
9
9
  throw new not_authorized_error_1.NotAuthorizedError();
10
10
  }
@@ -20,3 +20,4 @@ exports.requireCompanyEmployeeAuth = function (req, res, next) {
20
20
  }
21
21
  next();
22
22
  };
23
+ exports.requireCompanyEmployeeAuth = requireCompanyEmployeeAuth;
@@ -4,7 +4,7 @@ exports.requireCompanyEmployeeAdminAuth = void 0;
4
4
  var not_authorized_error_1 = require("../errors/not-authorized-error");
5
5
  var user_type_1 = require("../types/user-type");
6
6
  var user_status_1 = require("../types/user-status");
7
- exports.requireCompanyEmployeeAdminAuth = function (req, res, next) {
7
+ var requireCompanyEmployeeAdminAuth = function (req, res, next) {
8
8
  if (!req.currentUser) {
9
9
  throw new not_authorized_error_1.NotAuthorizedError();
10
10
  }
@@ -17,3 +17,4 @@ exports.requireCompanyEmployeeAdminAuth = function (req, res, next) {
17
17
  }
18
18
  next();
19
19
  };
20
+ exports.requireCompanyEmployeeAdminAuth = requireCompanyEmployeeAdminAuth;
@@ -4,7 +4,7 @@ exports.requireCompanyManagerAuth = void 0;
4
4
  var not_authorized_error_1 = require("../errors/not-authorized-error");
5
5
  var user_type_1 = require("../types/user-type");
6
6
  var user_status_1 = require("../types/user-status");
7
- exports.requireCompanyManagerAuth = function (req, res, next) {
7
+ var requireCompanyManagerAuth = function (req, res, next) {
8
8
  if (!req.currentUser) {
9
9
  throw new not_authorized_error_1.NotAuthorizedError();
10
10
  }
@@ -17,3 +17,4 @@ exports.requireCompanyManagerAuth = function (req, res, next) {
17
17
  }
18
18
  next();
19
19
  };
20
+ exports.requireCompanyManagerAuth = requireCompanyManagerAuth;
@@ -4,7 +4,7 @@ exports.requireCompanyOrCandidateAuth = void 0;
4
4
  var not_authorized_error_1 = require("../errors/not-authorized-error");
5
5
  var user_type_1 = require("../types/user-type");
6
6
  var user_status_1 = require("../types/user-status");
7
- exports.requireCompanyOrCandidateAuth = function (req, res, next) {
7
+ var requireCompanyOrCandidateAuth = function (req, res, next) {
8
8
  if (!req.currentUser) {
9
9
  throw new not_authorized_error_1.NotAuthorizedError();
10
10
  }
@@ -21,3 +21,4 @@ exports.requireCompanyOrCandidateAuth = function (req, res, next) {
21
21
  }
22
22
  next();
23
23
  };
24
+ exports.requireCompanyOrCandidateAuth = requireCompanyOrCandidateAuth;
@@ -4,7 +4,7 @@ exports.requireCompanySuperuserAuth = void 0;
4
4
  var not_authorized_error_1 = require("../errors/not-authorized-error");
5
5
  var user_type_1 = require("../types/user-type");
6
6
  var user_status_1 = require("../types/user-status");
7
- exports.requireCompanySuperuserAuth = function (req, res, next) {
7
+ var requireCompanySuperuserAuth = function (req, res, next) {
8
8
  if (!req.currentUser) {
9
9
  throw new not_authorized_error_1.NotAuthorizedError();
10
10
  }
@@ -17,3 +17,4 @@ exports.requireCompanySuperuserAuth = function (req, res, next) {
17
17
  }
18
18
  next();
19
19
  };
20
+ exports.requireCompanySuperuserAuth = requireCompanySuperuserAuth;
@@ -4,7 +4,7 @@ exports.requireCustomerSupportAuth = void 0;
4
4
  var not_authorized_error_1 = require("../errors/not-authorized-error");
5
5
  var user_type_1 = require("../types/user-type");
6
6
  var user_status_1 = require("../types/user-status");
7
- exports.requireCustomerSupportAuth = function (req, res, next) {
7
+ var requireCustomerSupportAuth = function (req, res, next) {
8
8
  if (!req.currentUser) {
9
9
  throw new not_authorized_error_1.NotAuthorizedError();
10
10
  }
@@ -16,3 +16,4 @@ exports.requireCustomerSupportAuth = function (req, res, next) {
16
16
  }
17
17
  next();
18
18
  };
19
+ exports.requireCustomerSupportAuth = requireCustomerSupportAuth;
@@ -4,7 +4,7 @@ exports.requirePartnerCandidateAuth = void 0;
4
4
  var not_authorized_error_1 = require("../errors/not-authorized-error");
5
5
  var user_type_1 = require("../types/user-type");
6
6
  var user_status_1 = require("../types/user-status");
7
- exports.requirePartnerCandidateAuth = function (req, res, next) {
7
+ var requirePartnerCandidateAuth = function (req, res, next) {
8
8
  if (!req.currentUser) {
9
9
  throw new not_authorized_error_1.NotAuthorizedError();
10
10
  }
@@ -21,3 +21,4 @@ exports.requirePartnerCandidateAuth = function (req, res, next) {
21
21
  }
22
22
  next();
23
23
  };
24
+ exports.requirePartnerCandidateAuth = requirePartnerCandidateAuth;
@@ -4,7 +4,7 @@ exports.requirePartnerEmployeeAuth = void 0;
4
4
  var not_authorized_error_1 = require("../errors/not-authorized-error");
5
5
  var user_type_1 = require("../types/user-type");
6
6
  var user_status_1 = require("../types/user-status");
7
- exports.requirePartnerEmployeeAuth = function (req, res, next) {
7
+ var requirePartnerEmployeeAuth = function (req, res, next) {
8
8
  if (!req.currentUser) {
9
9
  throw new not_authorized_error_1.NotAuthorizedError();
10
10
  }
@@ -20,3 +20,4 @@ exports.requirePartnerEmployeeAuth = function (req, res, next) {
20
20
  }
21
21
  next();
22
22
  };
23
+ exports.requirePartnerEmployeeAuth = requirePartnerEmployeeAuth;
@@ -4,7 +4,7 @@ exports.requirePartnerEmployeeAdminAuth = void 0;
4
4
  var not_authorized_error_1 = require("../errors/not-authorized-error");
5
5
  var user_type_1 = require("../types/user-type");
6
6
  var user_status_1 = require("../types/user-status");
7
- exports.requirePartnerEmployeeAdminAuth = function (req, res, next) {
7
+ var requirePartnerEmployeeAdminAuth = function (req, res, next) {
8
8
  if (!req.currentUser) {
9
9
  throw new not_authorized_error_1.NotAuthorizedError();
10
10
  }
@@ -17,3 +17,4 @@ exports.requirePartnerEmployeeAdminAuth = function (req, res, next) {
17
17
  }
18
18
  next();
19
19
  };
20
+ exports.requirePartnerEmployeeAdminAuth = requirePartnerEmployeeAdminAuth;
@@ -4,7 +4,7 @@ exports.requirePartnerManagerAuth = void 0;
4
4
  var not_authorized_error_1 = require("../errors/not-authorized-error");
5
5
  var user_type_1 = require("../types/user-type");
6
6
  var user_status_1 = require("../types/user-status");
7
- exports.requirePartnerManagerAuth = function (req, res, next) {
7
+ var requirePartnerManagerAuth = function (req, res, next) {
8
8
  if (!req.currentUser) {
9
9
  throw new not_authorized_error_1.NotAuthorizedError();
10
10
  }
@@ -17,3 +17,4 @@ exports.requirePartnerManagerAuth = function (req, res, next) {
17
17
  }
18
18
  next();
19
19
  };
20
+ exports.requirePartnerManagerAuth = requirePartnerManagerAuth;
@@ -4,7 +4,7 @@ exports.requirePartnerOrCandidateAuth = void 0;
4
4
  var not_authorized_error_1 = require("../errors/not-authorized-error");
5
5
  var user_type_1 = require("../types/user-type");
6
6
  var user_status_1 = require("../types/user-status");
7
- exports.requirePartnerOrCandidateAuth = function (req, res, next) {
7
+ var requirePartnerOrCandidateAuth = function (req, res, next) {
8
8
  if (!req.currentUser) {
9
9
  throw new not_authorized_error_1.NotAuthorizedError();
10
10
  }
@@ -22,3 +22,4 @@ exports.requirePartnerOrCandidateAuth = function (req, res, next) {
22
22
  }
23
23
  next();
24
24
  };
25
+ exports.requirePartnerOrCandidateAuth = requirePartnerOrCandidateAuth;
@@ -4,7 +4,7 @@ exports.requirePartnerSuperuserAuth = void 0;
4
4
  var not_authorized_error_1 = require("../errors/not-authorized-error");
5
5
  var user_type_1 = require("../types/user-type");
6
6
  var user_status_1 = require("../types/user-status");
7
- exports.requirePartnerSuperuserAuth = function (req, res, next) {
7
+ var requirePartnerSuperuserAuth = function (req, res, next) {
8
8
  if (!req.currentUser) {
9
9
  throw new not_authorized_error_1.NotAuthorizedError();
10
10
  }
@@ -17,3 +17,4 @@ exports.requirePartnerSuperuserAuth = function (req, res, next) {
17
17
  }
18
18
  next();
19
19
  };
20
+ exports.requirePartnerSuperuserAuth = requirePartnerSuperuserAuth;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.requireSuperAdminAuth = void 0;
4
4
  var not_authorized_error_1 = require("../errors/not-authorized-error");
5
5
  var user_type_1 = require("../types/user-type");
6
- exports.requireSuperAdminAuth = function (req, res, next) {
6
+ var requireSuperAdminAuth = function (req, res, next) {
7
7
  if (!req.currentUser) {
8
8
  throw new not_authorized_error_1.NotAuthorizedError();
9
9
  }
@@ -12,3 +12,4 @@ exports.requireSuperAdminAuth = function (req, res, next) {
12
12
  }
13
13
  next();
14
14
  };
15
+ exports.requireSuperAdminAuth = requireSuperAdminAuth;
@@ -4,7 +4,7 @@ exports.requireSuperAdminOrCandidateAuth = void 0;
4
4
  var not_authorized_error_1 = require("../errors/not-authorized-error");
5
5
  var user_type_1 = require("../types/user-type");
6
6
  var user_status_1 = require("../types/user-status");
7
- exports.requireSuperAdminOrCandidateAuth = function (req, res, next) {
7
+ var requireSuperAdminOrCandidateAuth = function (req, res, next) {
8
8
  if (!req.currentUser) {
9
9
  throw new not_authorized_error_1.NotAuthorizedError();
10
10
  }
@@ -18,3 +18,4 @@ exports.requireSuperAdminOrCandidateAuth = function (req, res, next) {
18
18
  }
19
19
  next();
20
20
  };
21
+ exports.requireSuperAdminOrCandidateAuth = requireSuperAdminOrCandidateAuth;
@@ -4,7 +4,7 @@ exports.requireSuperAdminOrCompanyAuth = void 0;
4
4
  var not_authorized_error_1 = require("../errors/not-authorized-error");
5
5
  var user_type_1 = require("../types/user-type");
6
6
  var user_status_1 = require("../types/user-status");
7
- exports.requireSuperAdminOrCompanyAuth = function (req, res, next) {
7
+ var requireSuperAdminOrCompanyAuth = function (req, res, next) {
8
8
  if (!req.currentUser) {
9
9
  throw new not_authorized_error_1.NotAuthorizedError();
10
10
  }
@@ -22,3 +22,4 @@ exports.requireSuperAdminOrCompanyAuth = function (req, res, next) {
22
22
  }
23
23
  next();
24
24
  };
25
+ exports.requireSuperAdminOrCompanyAuth = requireSuperAdminOrCompanyAuth;
@@ -4,7 +4,7 @@ exports.requireSuperAdminOrPartnerAuth = void 0;
4
4
  var not_authorized_error_1 = require("../errors/not-authorized-error");
5
5
  var user_type_1 = require("../types/user-type");
6
6
  var user_status_1 = require("../types/user-status");
7
- exports.requireSuperAdminOrPartnerAuth = function (req, res, next) {
7
+ var requireSuperAdminOrPartnerAuth = function (req, res, next) {
8
8
  if (!req.currentUser) {
9
9
  throw new not_authorized_error_1.NotAuthorizedError();
10
10
  }
@@ -23,3 +23,4 @@ exports.requireSuperAdminOrPartnerAuth = function (req, res, next) {
23
23
  }
24
24
  next();
25
25
  };
26
+ exports.requireSuperAdminOrPartnerAuth = requireSuperAdminOrPartnerAuth;
@@ -9,12 +9,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -44,7 +44,7 @@ var not_authorized_error_1 = require("../errors/not-authorized-error");
44
44
  var user_status_1 = require("../types/user-status");
45
45
  var mongoose_1 = __importDefault(require("mongoose"));
46
46
  var permission_denied_error_1 = require("../errors/permission-denied-error");
47
- exports.requirePermissions = function (accessType, permissionType, userModel, permissionsModel) {
47
+ var requirePermissions = function (accessType, permissionType, userModel, permissionsModel) {
48
48
  return function (req, res, next) { return __awaiter(void 0, void 0, void 0, function () {
49
49
  var user, userDetails, ispermExist, roles, permissions, permissionsArr;
50
50
  return __generator(this, function (_a) {
@@ -91,3 +91,4 @@ exports.requirePermissions = function (accessType, permissionType, userModel, pe
91
91
  });
92
92
  }); };
93
93
  };
94
+ exports.requirePermissions = requirePermissions;
@@ -3,10 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.validateRequest = void 0;
4
4
  var express_validator_1 = require("express-validator");
5
5
  var request_validation_error_1 = require("../errors/request-validation-error");
6
- exports.validateRequest = function (req, res, next) {
7
- var errors = express_validator_1.validationResult(req);
6
+ var validateRequest = function (req, res, next) {
7
+ var errors = (0, express_validator_1.validationResult)(req);
8
8
  if (!errors.isEmpty()) {
9
9
  throw new request_validation_error_1.RequestValidationError(errors.array());
10
10
  }
11
11
  next();
12
12
  };
13
+ exports.validateRequest = validateRequest;
@@ -13,4 +13,4 @@ var AccessLevel;
13
13
  AccessLevel[AccessLevel["Employee"] = 19] = "Employee";
14
14
  AccessLevel[AccessLevel["Candidate"] = 9] = "Candidate";
15
15
  AccessLevel[AccessLevel["NoAccess"] = 0] = "NoAccess";
16
- })(AccessLevel = exports.AccessLevel || (exports.AccessLevel = {}));
16
+ })(AccessLevel || (exports.AccessLevel = AccessLevel = {}));
@@ -7,4 +7,4 @@ var AgreementStatus;
7
7
  AgreementStatus["rejected"] = "Rejected";
8
8
  AgreementStatus["pending"] = "Pending";
9
9
  AgreementStatus["updated"] = "Updated";
10
- })(AgreementStatus = exports.AgreementStatus || (exports.AgreementStatus = {}));
10
+ })(AgreementStatus || (exports.AgreementStatus = AgreementStatus = {}));
@@ -7,4 +7,4 @@ var AgreementType;
7
7
  AgreementType["Company"] = "Company";
8
8
  AgreementType["Partner"] = "Partner";
9
9
  AgreementType["Candidate"] = "Candidate";
10
- })(AgreementType = exports.AgreementType || (exports.AgreementType = {}));
10
+ })(AgreementType || (exports.AgreementType = AgreementType = {}));