@campxdev/server-shared 1.2.35 → 1.2.36
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/common/config/mongo.config.d.ts +3 -3
- package/dist/common/config/mongo.config.js +23 -23
- package/dist/common/decorators/request.decorators.d.ts +5 -5
- package/dist/common/decorators/request.decorators.js +36 -36
- package/dist/common/decorators/time-validation.decorator.d.ts +2 -2
- package/dist/common/decorators/time-validation.decorator.js +26 -26
- package/dist/common/filters/unhandled-exception.filter.d.ts +4 -4
- package/dist/common/filters/unhandled-exception.filter.js +38 -37
- package/dist/common/filters/unhandled-exception.filter.js.map +1 -1
- package/dist/common/guards/guard.d.ts +8 -8
- package/dist/common/guards/guard.js +24 -24
- package/dist/common/index.d.ts +10 -10
- package/dist/common/index.js +26 -26
- package/dist/common/interceptors/request.interceptor.d.ts +20 -20
- package/dist/common/interceptors/request.interceptor.js +143 -142
- package/dist/common/interceptors/request.interceptor.js.map +1 -1
- package/dist/common/interfaces/context.interface.d.ts +125 -125
- package/dist/common/interfaces/context.interface.js +2 -2
- package/dist/common/store/request-store.d.ts +44 -44
- package/dist/common/store/request-store.js +166 -166
- package/dist/common/store/store-config.d.ts +6 -6
- package/dist/common/store/store-config.js +23 -23
- package/dist/common/store/store.interceptor.d.ts +5 -5
- package/dist/common/store/store.interceptor.js +37 -36
- package/dist/common/store/store.interceptor.js.map +1 -1
- package/dist/domain/db-connection.module.d.ts +3 -3
- package/dist/domain/db-connection.module.js +29 -28
- package/dist/domain/db-connection.module.js.map +1 -1
- package/dist/domain/entities/evaluator.entity.d.ts +17 -17
- package/dist/domain/entities/evaluator.entity.js +112 -111
- package/dist/domain/entities/evaluator.entity.js.map +1 -1
- package/dist/domain/entities/leads.entity.d.ts +26 -26
- package/dist/domain/entities/leads.entity.js +161 -160
- package/dist/domain/entities/leads.entity.js.map +1 -1
- package/dist/domain/entities/profile-permission.entity.d.ts +13 -13
- package/dist/domain/entities/profile-permission.entity.js +70 -69
- package/dist/domain/entities/profile-permission.entity.js.map +1 -1
- package/dist/domain/entities/profile.entity.d.ts +26 -26
- package/dist/domain/entities/profile.entity.js +99 -98
- package/dist/domain/entities/profile.entity.js.map +1 -1
- package/dist/domain/entities/student.entity.d.ts +26 -26
- package/dist/domain/entities/student.entity.js +124 -123
- package/dist/domain/entities/student.entity.js.map +1 -1
- package/dist/domain/entities/user.entity.d.ts +20 -20
- package/dist/domain/entities/user.entity.js +136 -135
- package/dist/domain/entities/user.entity.js.map +1 -1
- package/dist/domain/index.d.ts +10 -10
- package/dist/domain/index.js +26 -26
- package/dist/domain/schemas/global-users.schema.d.ts +60 -60
- package/dist/domain/schemas/global-users.schema.d.ts.map +1 -1
- package/dist/domain/schemas/global-users.schema.js +158 -156
- package/dist/domain/schemas/global-users.schema.js.map +1 -1
- package/dist/domain/schemas/tenant.schema.d.ts +106 -106
- package/dist/domain/schemas/tenant.schema.d.ts.map +1 -1
- package/dist/domain/schemas/tenant.schema.js +347 -338
- package/dist/domain/schemas/tenant.schema.js.map +1 -1
- package/dist/domain/shared-domain.module.d.ts +2 -2
- package/dist/domain/shared-domain.module.js +27 -26
- package/dist/domain/shared-domain.module.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +21 -21
- package/dist/permissions/app-permissions/commute-x-permissions.d.ts +118 -118
- package/dist/permissions/app-permissions/commute-x-permissions.js +128 -128
- package/dist/permissions/app-permissions/enroll-x-permissions.d.ts +498 -498
- package/dist/permissions/app-permissions/enroll-x-permissions.js +816 -816
- package/dist/permissions/app-permissions/exams-permissions.d.ts +745 -745
- package/dist/permissions/app-permissions/exams-permissions.js +1218 -1218
- package/dist/permissions/app-permissions/hostels-permissions.d.ts +424 -424
- package/dist/permissions/app-permissions/hostels-permissions.js +537 -537
- package/dist/permissions/app-permissions/payments-permissions.d.ts +364 -364
- package/dist/permissions/app-permissions/payments-permissions.js +486 -486
- package/dist/permissions/app-permissions/people-x-permissions.d.ts +346 -346
- package/dist/permissions/app-permissions/people-x-permissions.js +356 -356
- package/dist/permissions/app-permissions/square-permissions.d.ts +1219 -1219
- package/dist/permissions/app-permissions/square-permissions.d.ts.map +1 -1
- package/dist/permissions/app-permissions/square-permissions.js +2235 -2237
- package/dist/permissions/app-permissions/square-permissions.js.map +1 -1
- package/dist/permissions/check-permission.guard.d.ts +9 -9
- package/dist/permissions/check-permission.guard.js +60 -60
- package/dist/permissions/index.d.ts +9 -9
- package/dist/permissions/index.js +32 -32
- package/dist/permissions/permissions.d.ts +7422 -7422
- package/dist/permissions/permissions.js +122 -122
- package/dist/shared-module/index.d.ts +2 -2
- package/dist/shared-module/index.js +7 -7
- package/dist/shared-module/shared.module.d.ts +10 -10
- package/dist/shared-module/shared.module.js +37 -36
- package/dist/shared-module/shared.module.js.map +1 -1
- package/dist/shared-module/shared.service.d.ts +67 -67
- package/dist/shared-module/shared.service.js +212 -211
- package/dist/shared-module/shared.service.js.map +1 -1
- package/dist/utils/constants.d.ts +25 -25
- package/dist/utils/constants.js +28 -28
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.js +18 -18
- package/dist/utils/utils.d.ts +26 -26
- package/dist/utils/utils.js +250 -250
- package/package.json +46 -46
|
@@ -1,143 +1,144 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.RequestInterceptor = void 0;
|
|
16
|
-
const common_1 = require("@nestjs/common");
|
|
17
|
-
const core_1 = require("@nestjs/core");
|
|
18
|
-
const mongoose_1 = require("@nestjs/mongoose");
|
|
19
|
-
const mongoose_2 = require("mongoose");
|
|
20
|
-
const domain_1 = require("../../domain");
|
|
21
|
-
const check_permission_guard_1 = require("../../permissions/check-permission.guard");
|
|
22
|
-
const shared_module_1 = require("../../shared-module");
|
|
23
|
-
const utils_1 = require("../../utils");
|
|
24
|
-
const guard_1 = require("../guards/guard");
|
|
25
|
-
const request_store_1 = require("../store/request-store");
|
|
26
|
-
let RequestInterceptor =
|
|
27
|
-
reflector;
|
|
28
|
-
sharedService;
|
|
29
|
-
globalUserModel;
|
|
30
|
-
constructor(reflector, sharedService, globalUserModel) {
|
|
31
|
-
this.reflector = reflector;
|
|
32
|
-
this.sharedService = sharedService;
|
|
33
|
-
this.globalUserModel = globalUserModel;
|
|
34
|
-
}
|
|
35
|
-
async intercept(context, next) {
|
|
36
|
-
const data = context.switchToRpc().getData();
|
|
37
|
-
(0, request_store_1.setRequest)(data);
|
|
38
|
-
const connection = await this.sharedService.getConnection(data);
|
|
39
|
-
(0, request_store_1.setTenantDataSource)(connection?.rootDataSource);
|
|
40
|
-
(0, request_store_1.setTenantDetails)(data.tenantDetails);
|
|
41
|
-
(0, request_store_1.setUserData)(data.userData);
|
|
42
|
-
(0, request_store_1.setInstitution)(data.institution);
|
|
43
|
-
// Check if the request is authenticated
|
|
44
|
-
if (this.hasAuth(context))
|
|
45
|
-
this.checkAuth(data.isMicroservice);
|
|
46
|
-
// Check if the request is authenticated as an regular user
|
|
47
|
-
const permission = this.hasPermission(context);
|
|
48
|
-
if (permission.check) {
|
|
49
|
-
await this.checkPermission(permission.permissionSlug, data.isMicroservice);
|
|
50
|
-
}
|
|
51
|
-
// Check if the request is authenticated as lead user
|
|
52
|
-
if (this.hasLeadAuth(context))
|
|
53
|
-
this.checkLeadAuth(data);
|
|
54
|
-
// Check if the request is authenticated as an evaluator
|
|
55
|
-
if (this.hasEvaluatorAuth(context))
|
|
56
|
-
this.checkEvaluatorAuth(data);
|
|
57
|
-
return next.handle();
|
|
58
|
-
}
|
|
59
|
-
hasAuth(context) {
|
|
60
|
-
const authMethod = this.reflector.get(guard_1.AUTHENTICATE, context.getHandler());
|
|
61
|
-
const authClass = this.reflector.get(guard_1.AUTHENTICATE, context.getClass());
|
|
62
|
-
return !!authMethod || !!authClass;
|
|
63
|
-
}
|
|
64
|
-
checkAuth(isMicroService) {
|
|
65
|
-
if (isMicroService)
|
|
66
|
-
return;
|
|
67
|
-
const userData = (0, request_store_1.getUserData)();
|
|
68
|
-
const tenantDetails = (0, request_store_1.getTenantDetails)();
|
|
69
|
-
if (!userData) {
|
|
70
|
-
throw new common_1.UnauthorizedException();
|
|
71
|
-
}
|
|
72
|
-
if (!(0, utils_1.checkEqual)(userData.tenantId, tenantDetails.id)) {
|
|
73
|
-
throw new common_1.UnprocessableEntityException('Invalid Client Request');
|
|
74
|
-
}
|
|
75
|
-
if (!userData.isActive) {
|
|
76
|
-
throw new common_1.UnauthorizedException('User is not active');
|
|
77
|
-
}
|
|
78
|
-
if (!userData.id || !userData.userId) {
|
|
79
|
-
throw new common_1.UnauthorizedException('User is not active');
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
hasPermission(context) {
|
|
83
|
-
const methodPermission = this.reflector.get(guard_1.CHECK_PERMISSION_KEY, context.getHandler());
|
|
84
|
-
const classPermission = this.reflector.get(guard_1.CHECK_PERMISSION_KEY, context.getClass());
|
|
85
|
-
return {
|
|
86
|
-
check: !!methodPermission || !!classPermission,
|
|
87
|
-
permissionSlug: methodPermission || classPermission,
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
async checkPermission(permission, isMicroservice) {
|
|
91
|
-
if (isMicroservice)
|
|
92
|
-
return;
|
|
93
|
-
this.checkAuth();
|
|
94
|
-
const val = await (0, check_permission_guard_1.validateRequestPermission)(permission, this.sharedService.getCheckPermission(), this.globalUserModel);
|
|
95
|
-
if (!val) {
|
|
96
|
-
throw new common_1.ForbiddenException('You are not authorized to perform this action');
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
hasLeadAuth(context) {
|
|
100
|
-
const authMethod = this.reflector.get(guard_1.LEAD_AUTHENTICATE, context.getHandler());
|
|
101
|
-
const authClass = this.reflector.get(guard_1.LEAD_AUTHENTICATE, context.getClass());
|
|
102
|
-
return !!authMethod || !!authClass;
|
|
103
|
-
}
|
|
104
|
-
checkLeadAuth(data) {
|
|
105
|
-
if (data.isMicroservice)
|
|
106
|
-
return;
|
|
107
|
-
if (!data.userData) {
|
|
108
|
-
throw new common_1.UnauthorizedException();
|
|
109
|
-
}
|
|
110
|
-
if (!(0, utils_1.checkEqual)(data.userData.tenantId, data.tenantDetails.id)) {
|
|
111
|
-
throw new common_1.UnprocessableEntityException('Invalid Client Request');
|
|
112
|
-
}
|
|
113
|
-
if (!data.userData.leadId) {
|
|
114
|
-
throw new common_1.ForbiddenException('You are not a lead user');
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
hasEvaluatorAuth(context) {
|
|
118
|
-
const authMethod = this.reflector.get(guard_1.CHECK_EVALUATOR, context.getHandler());
|
|
119
|
-
const authClass = this.reflector.get(guard_1.CHECK_EVALUATOR, context.getClass());
|
|
120
|
-
return !!authMethod || !!authClass;
|
|
121
|
-
}
|
|
122
|
-
checkEvaluatorAuth(data) {
|
|
123
|
-
if (data.isMicroservice)
|
|
124
|
-
return;
|
|
125
|
-
if (!data.userData) {
|
|
126
|
-
throw new common_1.UnauthorizedException();
|
|
127
|
-
}
|
|
128
|
-
if (!(0, utils_1.checkEqual)(data.userData.tenantId, data.tenantDetails.id)) {
|
|
129
|
-
throw new common_1.UnprocessableEntityException('Invalid Client Request');
|
|
130
|
-
}
|
|
131
|
-
if (!data.userData.evaluatorId) {
|
|
132
|
-
throw new common_1.ForbiddenException('User is not evaluator');
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
(0, common_1.Injectable)(),
|
|
138
|
-
__param(2, (0, mongoose_1.InjectModel)(domain_1.GlobalUser.name)),
|
|
139
|
-
__metadata("design:paramtypes", [core_1.Reflector,
|
|
140
|
-
shared_module_1.SharedService,
|
|
141
|
-
mongoose_2.Model])
|
|
142
|
-
], RequestInterceptor);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.RequestInterceptor = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const core_1 = require("@nestjs/core");
|
|
18
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
19
|
+
const mongoose_2 = require("mongoose");
|
|
20
|
+
const domain_1 = require("../../domain");
|
|
21
|
+
const check_permission_guard_1 = require("../../permissions/check-permission.guard");
|
|
22
|
+
const shared_module_1 = require("../../shared-module");
|
|
23
|
+
const utils_1 = require("../../utils");
|
|
24
|
+
const guard_1 = require("../guards/guard");
|
|
25
|
+
const request_store_1 = require("../store/request-store");
|
|
26
|
+
let RequestInterceptor = class RequestInterceptor {
|
|
27
|
+
reflector;
|
|
28
|
+
sharedService;
|
|
29
|
+
globalUserModel;
|
|
30
|
+
constructor(reflector, sharedService, globalUserModel) {
|
|
31
|
+
this.reflector = reflector;
|
|
32
|
+
this.sharedService = sharedService;
|
|
33
|
+
this.globalUserModel = globalUserModel;
|
|
34
|
+
}
|
|
35
|
+
async intercept(context, next) {
|
|
36
|
+
const data = context.switchToRpc().getData();
|
|
37
|
+
(0, request_store_1.setRequest)(data);
|
|
38
|
+
const connection = await this.sharedService.getConnection(data);
|
|
39
|
+
(0, request_store_1.setTenantDataSource)(connection?.rootDataSource);
|
|
40
|
+
(0, request_store_1.setTenantDetails)(data.tenantDetails);
|
|
41
|
+
(0, request_store_1.setUserData)(data.userData);
|
|
42
|
+
(0, request_store_1.setInstitution)(data.institution);
|
|
43
|
+
// Check if the request is authenticated
|
|
44
|
+
if (this.hasAuth(context))
|
|
45
|
+
this.checkAuth(data.isMicroservice);
|
|
46
|
+
// Check if the request is authenticated as an regular user
|
|
47
|
+
const permission = this.hasPermission(context);
|
|
48
|
+
if (permission.check) {
|
|
49
|
+
await this.checkPermission(permission.permissionSlug, data.isMicroservice);
|
|
50
|
+
}
|
|
51
|
+
// Check if the request is authenticated as lead user
|
|
52
|
+
if (this.hasLeadAuth(context))
|
|
53
|
+
this.checkLeadAuth(data);
|
|
54
|
+
// Check if the request is authenticated as an evaluator
|
|
55
|
+
if (this.hasEvaluatorAuth(context))
|
|
56
|
+
this.checkEvaluatorAuth(data);
|
|
57
|
+
return next.handle();
|
|
58
|
+
}
|
|
59
|
+
hasAuth(context) {
|
|
60
|
+
const authMethod = this.reflector.get(guard_1.AUTHENTICATE, context.getHandler());
|
|
61
|
+
const authClass = this.reflector.get(guard_1.AUTHENTICATE, context.getClass());
|
|
62
|
+
return !!authMethod || !!authClass;
|
|
63
|
+
}
|
|
64
|
+
checkAuth(isMicroService) {
|
|
65
|
+
if (isMicroService)
|
|
66
|
+
return;
|
|
67
|
+
const userData = (0, request_store_1.getUserData)();
|
|
68
|
+
const tenantDetails = (0, request_store_1.getTenantDetails)();
|
|
69
|
+
if (!userData) {
|
|
70
|
+
throw new common_1.UnauthorizedException();
|
|
71
|
+
}
|
|
72
|
+
if (!(0, utils_1.checkEqual)(userData.tenantId, tenantDetails.id)) {
|
|
73
|
+
throw new common_1.UnprocessableEntityException('Invalid Client Request');
|
|
74
|
+
}
|
|
75
|
+
if (!userData.isActive) {
|
|
76
|
+
throw new common_1.UnauthorizedException('User is not active');
|
|
77
|
+
}
|
|
78
|
+
if (!userData.id || !userData.userId) {
|
|
79
|
+
throw new common_1.UnauthorizedException('User is not active');
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
hasPermission(context) {
|
|
83
|
+
const methodPermission = this.reflector.get(guard_1.CHECK_PERMISSION_KEY, context.getHandler());
|
|
84
|
+
const classPermission = this.reflector.get(guard_1.CHECK_PERMISSION_KEY, context.getClass());
|
|
85
|
+
return {
|
|
86
|
+
check: !!methodPermission || !!classPermission,
|
|
87
|
+
permissionSlug: methodPermission || classPermission,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
async checkPermission(permission, isMicroservice) {
|
|
91
|
+
if (isMicroservice)
|
|
92
|
+
return;
|
|
93
|
+
this.checkAuth();
|
|
94
|
+
const val = await (0, check_permission_guard_1.validateRequestPermission)(permission, this.sharedService.getCheckPermission(), this.globalUserModel);
|
|
95
|
+
if (!val) {
|
|
96
|
+
throw new common_1.ForbiddenException('You are not authorized to perform this action');
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
hasLeadAuth(context) {
|
|
100
|
+
const authMethod = this.reflector.get(guard_1.LEAD_AUTHENTICATE, context.getHandler());
|
|
101
|
+
const authClass = this.reflector.get(guard_1.LEAD_AUTHENTICATE, context.getClass());
|
|
102
|
+
return !!authMethod || !!authClass;
|
|
103
|
+
}
|
|
104
|
+
checkLeadAuth(data) {
|
|
105
|
+
if (data.isMicroservice)
|
|
106
|
+
return;
|
|
107
|
+
if (!data.userData) {
|
|
108
|
+
throw new common_1.UnauthorizedException();
|
|
109
|
+
}
|
|
110
|
+
if (!(0, utils_1.checkEqual)(data.userData.tenantId, data.tenantDetails.id)) {
|
|
111
|
+
throw new common_1.UnprocessableEntityException('Invalid Client Request');
|
|
112
|
+
}
|
|
113
|
+
if (!data.userData.leadId) {
|
|
114
|
+
throw new common_1.ForbiddenException('You are not a lead user');
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
hasEvaluatorAuth(context) {
|
|
118
|
+
const authMethod = this.reflector.get(guard_1.CHECK_EVALUATOR, context.getHandler());
|
|
119
|
+
const authClass = this.reflector.get(guard_1.CHECK_EVALUATOR, context.getClass());
|
|
120
|
+
return !!authMethod || !!authClass;
|
|
121
|
+
}
|
|
122
|
+
checkEvaluatorAuth(data) {
|
|
123
|
+
if (data.isMicroservice)
|
|
124
|
+
return;
|
|
125
|
+
if (!data.userData) {
|
|
126
|
+
throw new common_1.UnauthorizedException();
|
|
127
|
+
}
|
|
128
|
+
if (!(0, utils_1.checkEqual)(data.userData.tenantId, data.tenantDetails.id)) {
|
|
129
|
+
throw new common_1.UnprocessableEntityException('Invalid Client Request');
|
|
130
|
+
}
|
|
131
|
+
if (!data.userData.evaluatorId) {
|
|
132
|
+
throw new common_1.ForbiddenException('User is not evaluator');
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
RequestInterceptor = __decorate([
|
|
137
|
+
(0, common_1.Injectable)(),
|
|
138
|
+
__param(2, (0, mongoose_1.InjectModel)(domain_1.GlobalUser.name)),
|
|
139
|
+
__metadata("design:paramtypes", [core_1.Reflector,
|
|
140
|
+
shared_module_1.SharedService,
|
|
141
|
+
mongoose_2.Model])
|
|
142
|
+
], RequestInterceptor);
|
|
143
|
+
exports.RequestInterceptor = RequestInterceptor;
|
|
143
144
|
//# sourceMappingURL=request.interceptor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.interceptor.js","sourceRoot":"","sources":["../../../src/common/interceptors/request.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAQwB;AACxB,uCAAyC;AACzC,+CAA+C;AAC/C,uCAAiC;AACjC,yCAA0C;AAC1C,qFAAqF;AACrF,uDAAoD;AACpD,uCAAyC;AACzC,2CAKyB;AAEzB,0DAQgC;AAGzB,IAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"request.interceptor.js","sourceRoot":"","sources":["../../../src/common/interceptors/request.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAQwB;AACxB,uCAAyC;AACzC,+CAA+C;AAC/C,uCAAiC;AACjC,yCAA0C;AAC1C,qFAAqF;AACrF,uDAAoD;AACpD,uCAAyC;AACzC,2CAKyB;AAEzB,0DAQgC;AAGzB,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAEV;IACA;IAC8B;IAHjD,YACmB,SAAoB,EACpB,aAA4B,EACE,eAAkC;QAFhE,cAAS,GAAT,SAAS,CAAW;QACpB,kBAAa,GAAb,aAAa,CAAe;QACE,oBAAe,GAAf,eAAe,CAAmB;IAChF,CAAC;IAEJ,KAAK,CAAC,SAAS,CAAC,OAAyB,EAAE,IAAsB;QAC/D,MAAM,IAAI,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,OAAO,EAAc,CAAC;QAEzD,IAAA,0BAAU,EAAC,IAAI,CAAC,CAAC;QACjB,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,IAAI,CAAC,C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cAAc;YAAE,OAAO;QAChC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,MAAM,IAAI,8BAAqB,EAAE,CAAC;SACnC;QACD,IAAI,CAAC,IAAA,kBAAU,EAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,EAAE;YAC9D,MAAM,IAAI,qCAA4B,CAAC,wBAAwB,CAAC,CAAC;SAClE;QACD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE;YAC9B,MAAM,IAAI,2BAAkB,CAAC,uBAAuB,CAAC,CAAC;SACvD;IACH,CAAC;CACF,CAAA;AAxHY,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;IAKR,WAAA,IAAA,sBAAW,EAAC,mBAAU,CAAC,IAAI,CAAC,CAAA;qCAFD,gBAAS;QACL,6BAAa;QACmB,gBAAK;GAJ5D,kBAAkB,CAwH9B;AAxHY,gDAAkB"}
|
|
@@ -1,126 +1,126 @@
|
|
|
1
|
-
import * as mongoose from 'mongoose';
|
|
2
|
-
import { PaymentCredentials } from '../../domain/schemas/tenant.schema';
|
|
3
|
-
export interface IRequest {
|
|
4
|
-
cmd: {
|
|
5
|
-
cmd: string;
|
|
6
|
-
action: string;
|
|
7
|
-
version?: string;
|
|
8
|
-
service?: string;
|
|
9
|
-
};
|
|
10
|
-
body?: any;
|
|
11
|
-
param?: any;
|
|
12
|
-
query?: any;
|
|
13
|
-
file?: any;
|
|
14
|
-
files?: any;
|
|
15
|
-
request?: {
|
|
16
|
-
subDomain: string;
|
|
17
|
-
sessionId: string;
|
|
18
|
-
};
|
|
19
|
-
tenantDetails?: TenantDetails;
|
|
20
|
-
userData?: UserData;
|
|
21
|
-
institution?: IInstitution;
|
|
22
|
-
isMicroservice?: boolean;
|
|
23
|
-
}
|
|
24
|
-
export interface TenantDetails {
|
|
25
|
-
_id: mongoose.Types.ObjectId;
|
|
26
|
-
id: string;
|
|
27
|
-
name: string;
|
|
28
|
-
subDomain: string;
|
|
29
|
-
database: string;
|
|
30
|
-
env: Env;
|
|
31
|
-
easyWDMSConfig: IEasyWDMSConfig;
|
|
32
|
-
smtpConfig?: SmtpConfig;
|
|
33
|
-
paymentCredentials?: PaymentCredentials[];
|
|
34
|
-
}
|
|
35
|
-
export interface SmtpConfig {
|
|
36
|
-
host: string;
|
|
37
|
-
port: number;
|
|
38
|
-
secure: boolean;
|
|
39
|
-
username: string;
|
|
40
|
-
password: string;
|
|
41
|
-
from: string;
|
|
42
|
-
}
|
|
43
|
-
export interface Env {
|
|
44
|
-
s3BucketName: string;
|
|
45
|
-
sentryDsn: string;
|
|
46
|
-
clientName: string;
|
|
47
|
-
studentAndroidApp: string;
|
|
48
|
-
studentIOSApp: string;
|
|
49
|
-
facultyAndroidApp: string;
|
|
50
|
-
facultyIOSApp: string;
|
|
51
|
-
_id: string;
|
|
52
|
-
}
|
|
53
|
-
export interface IEasyWDMSConfig {
|
|
54
|
-
_id: string;
|
|
55
|
-
host: string;
|
|
56
|
-
port: number;
|
|
57
|
-
username: string;
|
|
58
|
-
password: string;
|
|
59
|
-
database: string;
|
|
60
|
-
baseApiUrl: string;
|
|
61
|
-
}
|
|
62
|
-
export interface UserData {
|
|
63
|
-
id?: number;
|
|
64
|
-
userId?: string;
|
|
65
|
-
email?: string;
|
|
66
|
-
type?: string;
|
|
67
|
-
username?: string;
|
|
68
|
-
fullName?: string;
|
|
69
|
-
isSuperUser?: boolean;
|
|
70
|
-
isActive: boolean;
|
|
71
|
-
tenantId?: string;
|
|
72
|
-
evaluatorId?: number;
|
|
73
|
-
leadId?: number;
|
|
74
|
-
userAgent?: string;
|
|
75
|
-
}
|
|
76
|
-
export interface SendSmsInterface {
|
|
77
|
-
to: string[];
|
|
78
|
-
message: string;
|
|
79
|
-
sender: string;
|
|
80
|
-
apiKey: string;
|
|
81
|
-
}
|
|
82
|
-
export interface IInstitution {
|
|
83
|
-
_id?: string;
|
|
84
|
-
id?: number;
|
|
85
|
-
name?: string;
|
|
86
|
-
code?: string;
|
|
87
|
-
address?: string;
|
|
88
|
-
recognitionDetails?: string;
|
|
89
|
-
phone?: string;
|
|
90
|
-
createdById?: number;
|
|
91
|
-
updatedById?: number;
|
|
92
|
-
updatedAt?: string;
|
|
93
|
-
createdAt?: string;
|
|
94
|
-
images?: Image;
|
|
95
|
-
imageSquare?: Image;
|
|
96
|
-
principals?: IInstitutionPrincipalDetails[];
|
|
97
|
-
}
|
|
98
|
-
export interface IInstitutionPrincipalDetails {
|
|
99
|
-
name?: string;
|
|
100
|
-
email?: string;
|
|
101
|
-
}
|
|
102
|
-
export interface Image {
|
|
103
|
-
id?: number;
|
|
104
|
-
originalFileName?: string;
|
|
105
|
-
key?: string;
|
|
106
|
-
type?: string;
|
|
107
|
-
typeId?: number;
|
|
108
|
-
globalTypeId?: null;
|
|
109
|
-
subtype?: string;
|
|
110
|
-
mediaType?: string;
|
|
111
|
-
mimeType?: string;
|
|
112
|
-
fileSize?: number;
|
|
113
|
-
storageDetails?: StorageDetails;
|
|
114
|
-
createdAt?: string;
|
|
115
|
-
updatedAt?: string;
|
|
116
|
-
url?: string;
|
|
117
|
-
}
|
|
118
|
-
export interface StorageDetails {
|
|
119
|
-
Key?: string;
|
|
120
|
-
key?: string;
|
|
121
|
-
ETag?: string;
|
|
122
|
-
Bucket?: string;
|
|
123
|
-
Location?: string;
|
|
124
|
-
ServerSideEncryption?: string;
|
|
125
|
-
}
|
|
1
|
+
import * as mongoose from 'mongoose';
|
|
2
|
+
import { PaymentCredentials } from '../../domain/schemas/tenant.schema';
|
|
3
|
+
export interface IRequest {
|
|
4
|
+
cmd: {
|
|
5
|
+
cmd: string;
|
|
6
|
+
action: string;
|
|
7
|
+
version?: string;
|
|
8
|
+
service?: string;
|
|
9
|
+
};
|
|
10
|
+
body?: any;
|
|
11
|
+
param?: any;
|
|
12
|
+
query?: any;
|
|
13
|
+
file?: any;
|
|
14
|
+
files?: any;
|
|
15
|
+
request?: {
|
|
16
|
+
subDomain: string;
|
|
17
|
+
sessionId: string;
|
|
18
|
+
};
|
|
19
|
+
tenantDetails?: TenantDetails;
|
|
20
|
+
userData?: UserData;
|
|
21
|
+
institution?: IInstitution;
|
|
22
|
+
isMicroservice?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface TenantDetails {
|
|
25
|
+
_id: mongoose.Types.ObjectId;
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
subDomain: string;
|
|
29
|
+
database: string;
|
|
30
|
+
env: Env;
|
|
31
|
+
easyWDMSConfig: IEasyWDMSConfig;
|
|
32
|
+
smtpConfig?: SmtpConfig;
|
|
33
|
+
paymentCredentials?: PaymentCredentials[];
|
|
34
|
+
}
|
|
35
|
+
export interface SmtpConfig {
|
|
36
|
+
host: string;
|
|
37
|
+
port: number;
|
|
38
|
+
secure: boolean;
|
|
39
|
+
username: string;
|
|
40
|
+
password: string;
|
|
41
|
+
from: string;
|
|
42
|
+
}
|
|
43
|
+
export interface Env {
|
|
44
|
+
s3BucketName: string;
|
|
45
|
+
sentryDsn: string;
|
|
46
|
+
clientName: string;
|
|
47
|
+
studentAndroidApp: string;
|
|
48
|
+
studentIOSApp: string;
|
|
49
|
+
facultyAndroidApp: string;
|
|
50
|
+
facultyIOSApp: string;
|
|
51
|
+
_id: string;
|
|
52
|
+
}
|
|
53
|
+
export interface IEasyWDMSConfig {
|
|
54
|
+
_id: string;
|
|
55
|
+
host: string;
|
|
56
|
+
port: number;
|
|
57
|
+
username: string;
|
|
58
|
+
password: string;
|
|
59
|
+
database: string;
|
|
60
|
+
baseApiUrl: string;
|
|
61
|
+
}
|
|
62
|
+
export interface UserData {
|
|
63
|
+
id?: number;
|
|
64
|
+
userId?: string;
|
|
65
|
+
email?: string;
|
|
66
|
+
type?: string;
|
|
67
|
+
username?: string;
|
|
68
|
+
fullName?: string;
|
|
69
|
+
isSuperUser?: boolean;
|
|
70
|
+
isActive: boolean;
|
|
71
|
+
tenantId?: string;
|
|
72
|
+
evaluatorId?: number;
|
|
73
|
+
leadId?: number;
|
|
74
|
+
userAgent?: string;
|
|
75
|
+
}
|
|
76
|
+
export interface SendSmsInterface {
|
|
77
|
+
to: string[];
|
|
78
|
+
message: string;
|
|
79
|
+
sender: string;
|
|
80
|
+
apiKey: string;
|
|
81
|
+
}
|
|
82
|
+
export interface IInstitution {
|
|
83
|
+
_id?: string;
|
|
84
|
+
id?: number;
|
|
85
|
+
name?: string;
|
|
86
|
+
code?: string;
|
|
87
|
+
address?: string;
|
|
88
|
+
recognitionDetails?: string;
|
|
89
|
+
phone?: string;
|
|
90
|
+
createdById?: number;
|
|
91
|
+
updatedById?: number;
|
|
92
|
+
updatedAt?: string;
|
|
93
|
+
createdAt?: string;
|
|
94
|
+
images?: Image;
|
|
95
|
+
imageSquare?: Image;
|
|
96
|
+
principals?: IInstitutionPrincipalDetails[];
|
|
97
|
+
}
|
|
98
|
+
export interface IInstitutionPrincipalDetails {
|
|
99
|
+
name?: string;
|
|
100
|
+
email?: string;
|
|
101
|
+
}
|
|
102
|
+
export interface Image {
|
|
103
|
+
id?: number;
|
|
104
|
+
originalFileName?: string;
|
|
105
|
+
key?: string;
|
|
106
|
+
type?: string;
|
|
107
|
+
typeId?: number;
|
|
108
|
+
globalTypeId?: null;
|
|
109
|
+
subtype?: string;
|
|
110
|
+
mediaType?: string;
|
|
111
|
+
mimeType?: string;
|
|
112
|
+
fileSize?: number;
|
|
113
|
+
storageDetails?: StorageDetails;
|
|
114
|
+
createdAt?: string;
|
|
115
|
+
updatedAt?: string;
|
|
116
|
+
url?: string;
|
|
117
|
+
}
|
|
118
|
+
export interface StorageDetails {
|
|
119
|
+
Key?: string;
|
|
120
|
+
key?: string;
|
|
121
|
+
ETag?: string;
|
|
122
|
+
Bucket?: string;
|
|
123
|
+
Location?: string;
|
|
124
|
+
ServerSideEncryption?: string;
|
|
125
|
+
}
|
|
126
126
|
//# sourceMappingURL=context.interface.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=context.interface.js.map
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import { NextFunction, Request, Response } from 'express';
|
|
2
|
-
import { DataSource, EntityManager } from 'typeorm';
|
|
3
|
-
import { IInstitution, IRequest, TenantDetails, UserData } from '../interfaces/context.interface';
|
|
4
|
-
export declare function setExpressRequest(req: Request): void;
|
|
5
|
-
export declare function getExpressRequest(): any;
|
|
6
|
-
export declare const storeMiddleWare: (req: Request, _res: Response, next: NextFunction) => void;
|
|
7
|
-
type IStoreSession<T> = {
|
|
8
|
-
setParams: () => void;
|
|
9
|
-
session: () => T | Promise<T>;
|
|
10
|
-
};
|
|
11
|
-
export declare const storeSession: <T>({ session, setParams }: IStoreSession<T>) => Promise<T>;
|
|
12
|
-
export declare function setRequest(req: any): void;
|
|
13
|
-
export declare function getRequest(): IRequest;
|
|
14
|
-
export declare function setTenantDataSource(dataSource: DataSource): void;
|
|
15
|
-
export declare function getDataSource(): DataSource;
|
|
16
|
-
export declare function getManager(): EntityManager;
|
|
17
|
-
export declare function setTenantDetails(tenant: TenantDetails): void;
|
|
18
|
-
export declare function getTenantDetailsIfExists(): TenantDetails;
|
|
19
|
-
export declare function getTenantDetails(): TenantDetails;
|
|
20
|
-
export declare function setUserData(user: UserData): void;
|
|
21
|
-
export declare function getUserData(): UserData;
|
|
22
|
-
export declare function getEvaluatorId(): number;
|
|
23
|
-
export declare function getLeadId(): number;
|
|
24
|
-
export declare function getEasyWDMSDataSource(): DataSource;
|
|
25
|
-
export declare function getEasyWDMSManager(): EntityManager;
|
|
26
|
-
export declare function getAWSKeys(): {
|
|
27
|
-
accessKeyId: string;
|
|
28
|
-
secretAccessKey: string;
|
|
29
|
-
region: string;
|
|
30
|
-
bucketName: string;
|
|
31
|
-
baseUrl: string;
|
|
32
|
-
};
|
|
33
|
-
export declare function getS3BucketName(): string;
|
|
34
|
-
export declare function getS3BaseUrl(): string;
|
|
35
|
-
export declare function getMySQLCredentials(): {
|
|
36
|
-
host: string;
|
|
37
|
-
port: number;
|
|
38
|
-
username: string;
|
|
39
|
-
password: string;
|
|
40
|
-
};
|
|
41
|
-
export declare function setInstitution(institution: IInstitution): void;
|
|
42
|
-
export declare function getInstitutionOrFail(): IInstitution;
|
|
43
|
-
export declare function getInstitution(): IInstitution;
|
|
44
|
-
export {};
|
|
1
|
+
import { NextFunction, Request, Response } from 'express';
|
|
2
|
+
import { DataSource, EntityManager } from 'typeorm';
|
|
3
|
+
import { IInstitution, IRequest, TenantDetails, UserData } from '../interfaces/context.interface';
|
|
4
|
+
export declare function setExpressRequest(req: Request): void;
|
|
5
|
+
export declare function getExpressRequest(): any;
|
|
6
|
+
export declare const storeMiddleWare: (req: Request, _res: Response, next: NextFunction) => void;
|
|
7
|
+
type IStoreSession<T> = {
|
|
8
|
+
setParams: () => void;
|
|
9
|
+
session: () => T | Promise<T>;
|
|
10
|
+
};
|
|
11
|
+
export declare const storeSession: <T>({ session, setParams }: IStoreSession<T>) => Promise<T>;
|
|
12
|
+
export declare function setRequest(req: any): void;
|
|
13
|
+
export declare function getRequest(): IRequest;
|
|
14
|
+
export declare function setTenantDataSource(dataSource: DataSource): void;
|
|
15
|
+
export declare function getDataSource(): DataSource;
|
|
16
|
+
export declare function getManager(): EntityManager;
|
|
17
|
+
export declare function setTenantDetails(tenant: TenantDetails): void;
|
|
18
|
+
export declare function getTenantDetailsIfExists(): TenantDetails;
|
|
19
|
+
export declare function getTenantDetails(): TenantDetails;
|
|
20
|
+
export declare function setUserData(user: UserData): void;
|
|
21
|
+
export declare function getUserData(): UserData;
|
|
22
|
+
export declare function getEvaluatorId(): number;
|
|
23
|
+
export declare function getLeadId(): number;
|
|
24
|
+
export declare function getEasyWDMSDataSource(): DataSource;
|
|
25
|
+
export declare function getEasyWDMSManager(): EntityManager;
|
|
26
|
+
export declare function getAWSKeys(): {
|
|
27
|
+
accessKeyId: string;
|
|
28
|
+
secretAccessKey: string;
|
|
29
|
+
region: string;
|
|
30
|
+
bucketName: string;
|
|
31
|
+
baseUrl: string;
|
|
32
|
+
};
|
|
33
|
+
export declare function getS3BucketName(): string;
|
|
34
|
+
export declare function getS3BaseUrl(): string;
|
|
35
|
+
export declare function getMySQLCredentials(): {
|
|
36
|
+
host: string;
|
|
37
|
+
port: number;
|
|
38
|
+
username: string;
|
|
39
|
+
password: string;
|
|
40
|
+
};
|
|
41
|
+
export declare function setInstitution(institution: IInstitution): void;
|
|
42
|
+
export declare function getInstitutionOrFail(): IInstitution;
|
|
43
|
+
export declare function getInstitution(): IInstitution;
|
|
44
|
+
export {};
|
|
45
45
|
//# sourceMappingURL=request-store.d.ts.map
|