@campxdev/server-shared 1.0.7 → 1.0.9
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/index.d.ts +2 -0
- package/dist/common/index.d.ts.map +1 -1
- package/dist/common/index.js +2 -0
- package/dist/common/index.js.map +1 -1
- package/dist/common/interceptors/request.interceptor.d.ts +16 -0
- package/dist/common/interceptors/request.interceptor.d.ts.map +1 -0
- package/dist/common/interceptors/request.interceptor.js +109 -0
- package/dist/common/interceptors/request.interceptor.js.map +1 -0
- package/dist/common/store/request-store.d.ts +4 -0
- package/dist/common/store/request-store.d.ts.map +1 -1
- package/dist/common/store/request-store.js +16 -1
- package/dist/common/store/request-store.js.map +1 -1
- package/dist/common/store/store-config.d.ts +0 -2
- package/dist/common/store/store-config.d.ts.map +1 -1
- package/dist/common/store/store-config.js +1 -5
- package/dist/common/store/store-config.js.map +1 -1
- package/dist/common/store/store.interceptor.d.ts +6 -0
- package/dist/common/store/store.interceptor.d.ts.map +1 -0
- package/dist/common/store/store.interceptor.js +38 -0
- package/dist/common/store/store.interceptor.js.map +1 -0
- package/dist/domain/entities/index.d.ts +4 -0
- package/dist/domain/entities/index.d.ts.map +1 -0
- package/dist/domain/entities/index.js +20 -0
- package/dist/domain/entities/index.js.map +1 -0
- package/dist/domain/entities/profile-permission.entity.d.ts +12 -0
- package/dist/domain/entities/profile-permission.entity.d.ts.map +1 -0
- package/dist/domain/entities/profile-permission.entity.js +65 -0
- package/dist/domain/entities/profile-permission.entity.js.map +1 -0
- package/dist/domain/entities/profile.entity.d.ts +10 -0
- package/dist/domain/entities/profile.entity.d.ts.map +1 -0
- package/dist/domain/entities/profile.entity.js +55 -0
- package/dist/domain/entities/profile.entity.js.map +1 -0
- package/dist/domain/entities/user.entity.d.ts +20 -0
- package/dist/domain/entities/user.entity.d.ts.map +1 -0
- package/dist/domain/entities/user.entity.js +106 -0
- package/dist/domain/entities/user.entity.js.map +1 -0
- package/dist/domain/index.d.ts +2 -0
- package/dist/domain/index.d.ts.map +1 -1
- package/dist/domain/index.js +2 -0
- package/dist/domain/index.js.map +1 -1
- package/dist/domain/shared-domain.module.d.ts +3 -0
- package/dist/domain/shared-domain.module.d.ts.map +1 -0
- package/dist/domain/shared-domain.module.js +22 -0
- package/dist/domain/shared-domain.module.js.map +1 -0
- package/dist/permissions/check-permission.guard.d.ts +48 -0
- package/dist/permissions/check-permission.guard.d.ts.map +1 -0
- package/dist/permissions/check-permission.guard.js +57 -0
- package/dist/permissions/check-permission.guard.js.map +1 -0
- package/dist/permissions/index.d.ts +1 -0
- package/dist/permissions/index.d.ts.map +1 -1
- package/dist/permissions/permissions.d.ts +2 -2
- package/dist/permissions/permissions.d.ts.map +1 -1
- package/dist/permissions/permissions.js +2 -2
- package/dist/permissions/permissions.js.map +1 -1
- package/dist/shared-module/shared.module.d.ts.map +1 -1
- package/dist/shared-module/shared.module.js +5 -8
- package/dist/shared-module/shared.module.js.map +1 -1
- package/dist/shared-module/shared.service.d.ts +5 -3
- package/dist/shared-module/shared.service.d.ts.map +1 -1
- package/dist/shared-module/shared.service.js +13 -7
- package/dist/shared-module/shared.service.js.map +1 -1
- package/dist/utils/utils.d.ts +1 -0
- package/dist/utils/utils.d.ts.map +1 -1
- package/dist/utils/utils.js +11 -1
- package/dist/utils/utils.js.map +1 -1
- package/package.json +1 -1
package/dist/common/index.d.ts
CHANGED
|
@@ -4,7 +4,9 @@ export * from './decorators/request.decorators';
|
|
|
4
4
|
export * from './decorators/time-validation.decorator';
|
|
5
5
|
export * from './filters/unhandled-exception.filter';
|
|
6
6
|
export * from './guards/guard';
|
|
7
|
+
export * from './interceptors/request.interceptor';
|
|
7
8
|
export * from './interfaces/context.interface';
|
|
8
9
|
export * from './store/request-store';
|
|
9
10
|
export * from './store/store-config';
|
|
11
|
+
export * from './store/store.interceptor';
|
|
10
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,wCAAwC,CAAC;AACvD,cAAc,iCAAiC,CAAC;AAChD,cAAc,wCAAwC,CAAC;AACvD,cAAc,sCAAsC,CAAC;AACrD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,wCAAwC,CAAC;AACvD,cAAc,iCAAiC,CAAC;AAChD,cAAc,wCAAwC,CAAC;AACvD,cAAc,sCAAsC,CAAC;AACrD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oCAAoC,CAAC;AACnD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC"}
|
package/dist/common/index.js
CHANGED
|
@@ -20,7 +20,9 @@ __exportStar(require("./decorators/request.decorators"), exports);
|
|
|
20
20
|
__exportStar(require("./decorators/time-validation.decorator"), exports);
|
|
21
21
|
__exportStar(require("./filters/unhandled-exception.filter"), exports);
|
|
22
22
|
__exportStar(require("./guards/guard"), exports);
|
|
23
|
+
__exportStar(require("./interceptors/request.interceptor"), exports);
|
|
23
24
|
__exportStar(require("./interfaces/context.interface"), exports);
|
|
24
25
|
__exportStar(require("./store/request-store"), exports);
|
|
25
26
|
__exportStar(require("./store/store-config"), exports);
|
|
27
|
+
__exportStar(require("./store/store.interceptor"), exports);
|
|
26
28
|
//# sourceMappingURL=index.js.map
|
package/dist/common/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,yEAAuD;AACvD,kEAAgD;AAChD,yEAAuD;AACvD,uEAAqD;AACrD,iDAA+B;AAC/B,iEAA+C;AAC/C,wDAAsC;AACtC,uDAAqC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,yEAAuD;AACvD,kEAAgD;AAChD,yEAAuD;AACvD,uEAAqD;AACrD,iDAA+B;AAC/B,qEAAmD;AACnD,iEAA+C;AAC/C,wDAAsC;AACtC,uDAAqC;AACrC,4DAA0C"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CallHandler, ExecutionContext, NestInterceptor } from '@nestjs/common';
|
|
2
|
+
import { Reflector } from '@nestjs/core';
|
|
3
|
+
import { SharedService } from '../../shared-module';
|
|
4
|
+
export declare class RequestInterceptor implements NestInterceptor {
|
|
5
|
+
private readonly reflector;
|
|
6
|
+
private readonly sharedService;
|
|
7
|
+
constructor(reflector: Reflector, sharedService: SharedService);
|
|
8
|
+
intercept(context: ExecutionContext, next: CallHandler<any>): Promise<import("rxjs").Observable<any>>;
|
|
9
|
+
private hasAuth;
|
|
10
|
+
private checkAuth;
|
|
11
|
+
private hasPermission;
|
|
12
|
+
private checkPermission;
|
|
13
|
+
private hasEvaluatorAuth;
|
|
14
|
+
private checkEvaluatorAuth;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=request.interceptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.interceptor.d.ts","sourceRoot":"","sources":["../../../src/common/interceptors/request.interceptor.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,gBAAgB,EAGhB,eAAe,EAGhB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAWpD,qBACa,kBAAmB,YAAW,eAAe;IAEtD,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,aAAa;gBADb,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,aAAa;IAGzC,SAAS,CAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,WAAW,CAAC,GAAG,CAAC;IAsBjE,OAAO,CAAC,OAAO;IAMf,OAAO,CAAC,SAAS;IAajB,OAAO,CAAC,aAAa;YASP,eAAe;IAY7B,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,kBAAkB;CAe3B"}
|
|
@@ -0,0 +1,109 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.RequestInterceptor = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const core_1 = require("@nestjs/core");
|
|
15
|
+
const check_permission_guard_1 = require("../../permissions/check-permission.guard");
|
|
16
|
+
const shared_module_1 = require("../../shared-module");
|
|
17
|
+
const utils_1 = require("../../utils");
|
|
18
|
+
const guard_1 = require("../guards/guard");
|
|
19
|
+
const request_store_1 = require("../store/request-store");
|
|
20
|
+
let RequestInterceptor = class RequestInterceptor {
|
|
21
|
+
reflector;
|
|
22
|
+
sharedService;
|
|
23
|
+
constructor(reflector, sharedService) {
|
|
24
|
+
this.reflector = reflector;
|
|
25
|
+
this.sharedService = sharedService;
|
|
26
|
+
}
|
|
27
|
+
async intercept(context, next) {
|
|
28
|
+
const data = context.switchToRpc().getData();
|
|
29
|
+
(0, request_store_1.setRequest)(data);
|
|
30
|
+
const connection = await this.sharedService.getConnection(data);
|
|
31
|
+
(0, request_store_1.setTenantDataSource)(connection.rootDataSource);
|
|
32
|
+
(0, request_store_1.setTenantDetails)(data.tenantDetails);
|
|
33
|
+
(0, request_store_1.setUserData)(data.userData);
|
|
34
|
+
// Check if the request is authenticated
|
|
35
|
+
if (this.hasAuth(context))
|
|
36
|
+
this.checkAuth(data);
|
|
37
|
+
// Check if the request is authenticated as an regular user
|
|
38
|
+
const permission = this.hasPermission(context);
|
|
39
|
+
if (permission.check)
|
|
40
|
+
await this.checkPermission(data, permission.permissionSlug);
|
|
41
|
+
// Check if the request is authenticated as an evaluator
|
|
42
|
+
if (this.hasEvaluatorAuth(context))
|
|
43
|
+
this.checkEvaluatorAuth(data);
|
|
44
|
+
return next.handle();
|
|
45
|
+
}
|
|
46
|
+
hasAuth(context) {
|
|
47
|
+
const authMethod = this.reflector.get(guard_1.AUTHENTICATE, context.getHandler());
|
|
48
|
+
const authClass = this.reflector.get(guard_1.AUTHENTICATE, context.getClass());
|
|
49
|
+
return !!authMethod || !!authClass;
|
|
50
|
+
}
|
|
51
|
+
checkAuth(data) {
|
|
52
|
+
if (data.isMicroservice)
|
|
53
|
+
return;
|
|
54
|
+
if (!data.userData) {
|
|
55
|
+
throw new common_1.UnauthorizedException();
|
|
56
|
+
}
|
|
57
|
+
if (!(0, utils_1.checkEqual)(data.userData.tenantId, data.tenantDetails.id)) {
|
|
58
|
+
throw new common_1.UnprocessableEntityException('Invalid Client Request');
|
|
59
|
+
}
|
|
60
|
+
if (!data.userData.isActive) {
|
|
61
|
+
throw new common_1.UnauthorizedException('User is not active');
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
hasPermission(context) {
|
|
65
|
+
const methodPermission = this.reflector.get(guard_1.CHECK_PERMISSION_KEY, context.getHandler());
|
|
66
|
+
const classPermission = this.reflector.get(guard_1.CHECK_PERMISSION_KEY, context.getClass());
|
|
67
|
+
return {
|
|
68
|
+
check: !!methodPermission || !!classPermission,
|
|
69
|
+
permissionSlug: methodPermission || classPermission,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
async checkPermission(data, permission) {
|
|
73
|
+
if (data.isMicroservice)
|
|
74
|
+
return;
|
|
75
|
+
this.checkAuth(data);
|
|
76
|
+
const val = await (0, check_permission_guard_1.validateRequestPermission)(permission, this.sharedService.getCheckPermission());
|
|
77
|
+
if (!val) {
|
|
78
|
+
throw new common_1.ForbiddenException('You are not authorized to perform this action');
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
hasEvaluatorAuth(context) {
|
|
82
|
+
const authMethod = this.reflector.get(guard_1.CHECK_EVALUATOR, context.getHandler());
|
|
83
|
+
const authClass = this.reflector.get(guard_1.CHECK_EVALUATOR, context.getClass());
|
|
84
|
+
return !!authMethod || !!authClass;
|
|
85
|
+
}
|
|
86
|
+
checkEvaluatorAuth(data) {
|
|
87
|
+
if (data.isMicroservice)
|
|
88
|
+
return;
|
|
89
|
+
if (!data.userData) {
|
|
90
|
+
throw new common_1.UnauthorizedException();
|
|
91
|
+
}
|
|
92
|
+
if (!(0, utils_1.checkEqual)(data.userData.tenantId, data.tenantDetails.id)) {
|
|
93
|
+
throw new common_1.UnprocessableEntityException('Invalid Client Request');
|
|
94
|
+
}
|
|
95
|
+
if (!data.userData.isActive) {
|
|
96
|
+
throw new common_1.UnauthorizedException('User is not active');
|
|
97
|
+
}
|
|
98
|
+
if (!data.userData.evaluatorId) {
|
|
99
|
+
throw new common_1.ForbiddenException('User is not evaluator');
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
RequestInterceptor = __decorate([
|
|
104
|
+
(0, common_1.Injectable)(),
|
|
105
|
+
__metadata("design:paramtypes", [core_1.Reflector,
|
|
106
|
+
shared_module_1.SharedService])
|
|
107
|
+
], RequestInterceptor);
|
|
108
|
+
exports.RequestInterceptor = RequestInterceptor;
|
|
109
|
+
//# sourceMappingURL=request.interceptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.interceptor.js","sourceRoot":"","sources":["../../../src/common/interceptors/request.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAQwB;AACxB,uCAAyC;AACzC,qFAAqF;AACrF,uDAAoD;AACpD,uCAAyC;AACzC,2CAAsF;AAEtF,0DAKgC;AAGzB,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAEV;IACA;IAFnB,YACmB,SAAoB,EACpB,aAA4B;QAD5B,cAAS,GAAT,SAAS,CAAW;QACpB,kBAAa,GAAb,aAAa,CAAe;IAC5C,CAAC;IAEJ,KAAK,CAAC,SAAS,CAAC,OAAyB,EAAE,IAAsB;QAC/D,MAAM,IAAI,GAAQ,OAAO,CAAC,WAAW,EAAE,CAAC,OAAO,EAAc,CAAC;QAE9D,IAAA,0BAAU,EAAC,IAAI,CAAC,CAAC;QACjB,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAChE,IAAA,mCAAmB,EAAC,UAAU,CAAC,cAAc,CAAC,CAAC;QAC/C,IAAA,gCAAgB,EAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACrC,IAAA,2BAAW,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAE3B,wCAAwC;QACxC,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;YAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAEhD,2DAA2D;QAC3D,MAAM,UAAU,GAAG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CAAC,wBAAwB,CAAC,CAAC;SAClE;QACD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE;YAC3B,MAAM,IAAI,8BAAqB,CAAC,oBAAoB,CAAC,CAAC;SACvD;QACD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE;YAC9B,MAAM,IAAI,2BAAkB,CAAC,uBAAuB,CAAC,CAAC;SACvD;IACH,CAAC;CACF,CAAA;AAzFY,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;qCAGmB,gBAAS;QACL,6BAAa;GAHpC,kBAAkB,CAyF9B;AAzFY,gDAAkB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { NextFunction, Request, Response } from 'express';
|
|
1
2
|
import { DataSource, EntityManager } from 'typeorm';
|
|
2
3
|
import { IRequest, TenantDetails, UserData } from '../interfaces/context.interface';
|
|
3
4
|
export declare const EXPRESS_REQUEST = "EXPRESS_REQUEST";
|
|
@@ -5,6 +6,9 @@ export declare const TENANT_EASY_WDMS_DATA_SOURCE = "TENANT_EASY_WDMS_DATA_SOURC
|
|
|
5
6
|
export declare const TENANT_DATA_SOURCE = "TENANT_DATA_SOURCE";
|
|
6
7
|
export declare const TENANT_DETAILS = "TENANT_DETAILS";
|
|
7
8
|
export declare const USER_DATA = "USER_DATA";
|
|
9
|
+
export declare function setExpressRequest(req: Request): void;
|
|
10
|
+
export declare function getExpressRequest(): any;
|
|
11
|
+
export declare const storeMiddleWare: (req: Request, _res: Response, next: NextFunction) => void;
|
|
8
12
|
export declare function setRequest(req: any): void;
|
|
9
13
|
export declare function getRequest(): IRequest;
|
|
10
14
|
export declare function setTenantDataSource(dataSource: DataSource): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-store.d.ts","sourceRoot":"","sources":["../../../src/common/store/request-store.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAEpD,OAAO,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.getLeadId = exports.getEvaluatorId = exports.getUserData = exports.setUserData = exports.getS3BaseUrl = exports.getTenantDetails = exports.getTenantDetailsIfExists = exports.setTenantDetails = exports.getManager = exports.getDataSource = exports.setTenantDataSource = exports.getRequest = exports.setRequest = exports.USER_DATA = exports.TENANT_DETAILS = exports.TENANT_DATA_SOURCE = exports.TENANT_EASY_WDMS_DATA_SOURCE = exports.EXPRESS_REQUEST = void 0;
|
|
3
|
+
exports.getEasyWDMSManager = exports.getEasyWDMSDataSource = exports.getLeadId = exports.getEvaluatorId = exports.getUserData = exports.setUserData = exports.getS3BaseUrl = exports.getTenantDetails = exports.getTenantDetailsIfExists = exports.setTenantDetails = exports.getManager = exports.getDataSource = exports.setTenantDataSource = exports.getRequest = exports.setRequest = exports.storeMiddleWare = exports.getExpressRequest = exports.setExpressRequest = exports.USER_DATA = exports.TENANT_DETAILS = exports.TENANT_DATA_SOURCE = exports.TENANT_EASY_WDMS_DATA_SOURCE = exports.EXPRESS_REQUEST = void 0;
|
|
4
4
|
const common_1 = require("@nestjs/common");
|
|
5
5
|
const utils_1 = require("../../utils/utils");
|
|
6
6
|
const store_config_1 = require("./store-config");
|
|
@@ -9,6 +9,21 @@ exports.TENANT_EASY_WDMS_DATA_SOURCE = 'TENANT_EASY_WDMS_DATA_SOURCE';
|
|
|
9
9
|
exports.TENANT_DATA_SOURCE = 'TENANT_DATA_SOURCE';
|
|
10
10
|
exports.TENANT_DETAILS = 'TENANT_DETAILS';
|
|
11
11
|
exports.USER_DATA = 'USER_DATA';
|
|
12
|
+
function setExpressRequest(req) {
|
|
13
|
+
(0, store_config_1.set)(exports.EXPRESS_REQUEST, req);
|
|
14
|
+
}
|
|
15
|
+
exports.setExpressRequest = setExpressRequest;
|
|
16
|
+
function getExpressRequest() {
|
|
17
|
+
return (0, store_config_1.get)(exports.EXPRESS_REQUEST);
|
|
18
|
+
}
|
|
19
|
+
exports.getExpressRequest = getExpressRequest;
|
|
20
|
+
const storeMiddleWare = (req, _res, next) => {
|
|
21
|
+
store_config_1.store.run(new Map(), () => {
|
|
22
|
+
setExpressRequest(req);
|
|
23
|
+
return next();
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
exports.storeMiddleWare = storeMiddleWare;
|
|
12
27
|
function setRequest(req) {
|
|
13
28
|
(0, store_config_1.set)(exports.EXPRESS_REQUEST, req);
|
|
14
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-store.js","sourceRoot":"","sources":["../../../src/common/store/request-store.ts"],"names":[],"mappings":";;;AAAA,2CAA8D;
|
|
1
|
+
{"version":3,"file":"request-store.js","sourceRoot":"","sources":["../../../src/common/store/request-store.ts"],"names":[],"mappings":";;;AAAA,2CAA8D;AAG9D,6CAAgD;AAEhD,iDAAiD;AAEpC,QAAA,eAAe,GAAG,iBAAiB,CAAC;AACpC,QAAA,4BAA4B,GAAG,8BAA8B,CAAC;AAC9D,QAAA,kBAAkB,GAAG,oBAAoB,CAAC;AAC1C,QAAA,cAAc,GAAG,gBAAgB,CAAC;AAClC,QAAA,SAAS,GAAG,WAAW,CAAC;AAErC,SAAgB,iBAAiB,CAAC,GAAY;IAC5C,IAAA,kBAAG,EAAC,uBAAe,EAAE,GAAG,CAAC,CAAC;AAC5B,CAAC;AAFD,8CAEC;AAED,SAAgB,iBAAiB;IAC/B,OAAO,IAAA,kBAAG,EAAC,uBAAe,CAAC,CAAC;AAC9B,CAAC;AAFD,8CAEC;AAEM,MAAM,eAAe,GAAG,CAAC,GAAY,EAAE,IAAc,EAAE,IAAkB,EAAE,EAAE;IAClF,oBAAK,CAAC,GAAG,CAAC,IAAI,GAAG,EAAE,EAAE,GAAG,EAAE;QACxB,iBAAiB,CAAC,GAAG,CAAC,CAAC;QACvB,OAAO,IAAI,EAAE,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AALW,QAAA,eAAe,mBAK1B;AAEF,SAAgB,UAAU,CAAC,GAAQ;IACjC,IAAA,kBAAG,EAAC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AE,GAAG,EAAE,UAAU,CAAC;AACjC,CAAC;AAHD,oCAGC;AAED,SAAgB,WAAW,CAAC,IAAc;IACxC,IAAA,kBAAG,EAAC,iBAAS,EAAE,IAAI,CAAC,CAAC;AACvB,CAAC;AAFD,kCAEC;AAED,SAAgB,WAAW;IACzB,OAAO,IAAA,kBAAG,EAAC,iBAAS,CAAC,CAAC;AACxB,CAAC;AAFD,kCAEC;AAED,SAAgB,cAAc;IAC5B,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAE;QAC1B,MAAM,IAAI,qCAA4B,CAAC,0BAA0B,CAAC,CAAC;KACpE;IACD,OAAO,QAAQ,EAAE,WAAW,CAAC;AAC/B,CAAC;AAND,wCAMC;AAED,SAAgB,SAAS;IACvB,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE;QACrB,MAAM,IAAI,qCAA4B,CAAC,oBAAoB,CAAC,CAAC;KAC9D;IAED,OAAO,QAAQ,EAAE,MAAM,CAAC;AAC1B,CAAC;AAPD,8BAOC;AAED,SAAgB,qBAAqB;IACnC,MAAM,UAAU,GAAG,IAAA,kBAAG,EAAa,oCAA4B,CAAC,CAAC;IACjE,IAAI,CAAC,UAAU,EAAE;QACf,MAAM,IAAI,qCAA4B,CAAC,kCAAkC,CAAC,CAAC;KAC5E;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;AAND,sDAMC;AAED,SAAgB,kBAAkB;IAChC,MAAM,UAAU,GAAG,qBAAqB,EAAE,CAAC;IAC3C,OAAO,UAAU,CAAC,OAAO,CAAC;AAC5B,CAAC;AAHD,gDAGC"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { NextFunction, Request, Response } from 'express';
|
|
3
2
|
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
4
3
|
export declare const store: AsyncLocalStorage<unknown>;
|
|
5
|
-
export declare const storeMiddleWare: (_req: Request, _res: Response, next: NextFunction) => void;
|
|
6
4
|
export declare const getStore: () => Map<string, any>;
|
|
7
5
|
export declare const set: (key: string, value: any) => Map<string, any>;
|
|
8
6
|
export declare function get<T>(key: string): T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store-config.d.ts","sourceRoot":"","sources":["../../../src/common/store/store-config.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"store-config.d.ts","sourceRoot":"","sources":["../../../src/common/store/store-config.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,eAAO,MAAM,KAAK,4BAA0B,CAAC;AAE7C,eAAO,MAAM,QAAQ,wBAMpB,CAAC;AAEF,eAAO,MAAM,GAAG,QAAS,MAAM,SAAS,GAAG,qBAA+B,CAAC;AAE3E,wBAAgB,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,CAIrC"}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.get = exports.set = exports.getStore = exports.
|
|
3
|
+
exports.get = exports.set = exports.getStore = exports.store = void 0;
|
|
4
4
|
const common_1 = require("@nestjs/common");
|
|
5
5
|
const node_async_hooks_1 = require("node:async_hooks");
|
|
6
6
|
exports.store = new node_async_hooks_1.AsyncLocalStorage();
|
|
7
|
-
const storeMiddleWare = (_req, _res, next) => {
|
|
8
|
-
exports.store.run(new Map(), () => next());
|
|
9
|
-
};
|
|
10
|
-
exports.storeMiddleWare = storeMiddleWare;
|
|
11
7
|
const getStore = () => {
|
|
12
8
|
const data = exports.store.getStore();
|
|
13
9
|
if (!data) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store-config.js","sourceRoot":"","sources":["../../../src/common/store/store-config.ts"],"names":[],"mappings":";;;AAAA,2CAAqD;
|
|
1
|
+
{"version":3,"file":"store-config.js","sourceRoot":"","sources":["../../../src/common/store/store-config.ts"],"names":[],"mappings":";;;AAAA,2CAAqD;AACrD,uDAAqD;AAExC,QAAA,KAAK,GAAG,IAAI,oCAAiB,EAAE,CAAC;AAEtC,MAAM,QAAQ,GAAG,GAAG,EAAE;IAC3B,MAAM,IAAI,GAAG,aAAK,CAAC,QAAQ,EAAE,CAAC;IAC9B,IAAI,CAAC,IAAI,EAAE;QACT,MAAM,IAAI,4BAAmB,CAAC,kCAAkC,CAAC,CAAC;KACnE;IACD,OAAO,IAAwB,CAAC;AAClC,CAAC,CAAC;AANW,QAAA,QAAQ,YAMnB;AAEK,MAAM,GAAG,GAAG,CAAC,GAAW,EAAE,KAAU,EAAE,EAAE,CAAC,IAAA,gBAAQ,GAAE,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AAA9D,QAAA,GAAG,OAA2D;AAE3E,SAAgB,GAAG,CAAI,GAAW;IAChC,MAAM,IAAI,GAAG,aAAK,CAAC,QAAQ,EAAsB,CAAC;IAClD,IAAI,CAAC,IAAI;QAAE,OAAO;IAClB,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACvB,CAAC;AAJD,kBAIC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CallHandler, ExecutionContext, NestInterceptor } from '@nestjs/common';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
export declare class StoreInterceptor implements NestInterceptor {
|
|
4
|
+
intercept(_: ExecutionContext, next: CallHandler): Observable<unknown>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=store.interceptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.interceptor.d.ts","sourceRoot":"","sources":["../../../src/common/store/store.interceptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAc,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC5F,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAGlC,qBACa,gBAAiB,YAAW,eAAe;IACtD,SAAS,CAAC,CAAC,EAAE,gBAAgB,EAAE,IAAI,EAAE,WAAW;CAmBjD"}
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.StoreInterceptor = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const rxjs_1 = require("rxjs");
|
|
12
|
+
const store_config_1 = require("./store-config");
|
|
13
|
+
let StoreInterceptor = class StoreInterceptor {
|
|
14
|
+
intercept(_, next) {
|
|
15
|
+
return new rxjs_1.Observable((sub) => {
|
|
16
|
+
store_config_1.store.run(new Map(), () => {
|
|
17
|
+
return new Promise((resolve) => {
|
|
18
|
+
next.handle().subscribe({
|
|
19
|
+
next: (value) => {
|
|
20
|
+
sub.next(value);
|
|
21
|
+
sub.complete();
|
|
22
|
+
resolve();
|
|
23
|
+
},
|
|
24
|
+
error: (err) => {
|
|
25
|
+
sub.error(err);
|
|
26
|
+
resolve();
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
StoreInterceptor = __decorate([
|
|
35
|
+
(0, common_1.Injectable)()
|
|
36
|
+
], StoreInterceptor);
|
|
37
|
+
exports.StoreInterceptor = StoreInterceptor;
|
|
38
|
+
//# sourceMappingURL=store.interceptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.interceptor.js","sourceRoot":"","sources":["../../../src/common/store/store.interceptor.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4F;AAC5F,+BAAkC;AAClC,iDAAuC;AAGhC,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAC3B,SAAS,CAAC,CAAmB,EAAE,IAAiB;QAC9C,OAAO,IAAI,iBAAU,CAAC,CAAC,GAAG,EAAE,EAAE;YAC5B,oBAAK,CAAC,GAAG,CAAC,IAAI,GAAG,EAAE,EAAE,GAAG,EAAE;gBACxB,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;oBACnC,IAAI,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC;wBACtB,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE;4BACd,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;4BAChB,GAAG,CAAC,QAAQ,EAAE,CAAC;4BACf,OAAO,EAAE,CAAC;wBACZ,CAAC;wBACD,KAAK,EAAE,CAAC,GAAG,EAAE,EAAE;4BACb,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;4BACf,OAAO,EAAE,CAAC;wBACZ,CAAC;qBACF,CAAC,CAAC;gBACL,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AApBY,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;GACA,gBAAgB,CAoB5B;AApBY,4CAAgB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/domain/entities/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
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("./profile-permission.entity"), exports);
|
|
18
|
+
__exportStar(require("./profile.entity"), exports);
|
|
19
|
+
__exportStar(require("./user.entity"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA4C;AAC5C,mDAAiC;AACjC,gDAA8B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class ProfilePermission {
|
|
2
|
+
id: number;
|
|
3
|
+
profileId: number;
|
|
4
|
+
groupSlug: string;
|
|
5
|
+
permissionSlug: string;
|
|
6
|
+
hasPermission: boolean;
|
|
7
|
+
permissions: string[];
|
|
8
|
+
lastUpdatedBy: number;
|
|
9
|
+
updatedAt: string;
|
|
10
|
+
createdAt: string;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=profile-permission.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile-permission.entity.d.ts","sourceRoot":"","sources":["../../../src/domain/entities/profile-permission.entity.ts"],"names":[],"mappings":"AAQA,qBACa,iBAAiB;IAE5B,EAAE,EAAE,MAAM,CAAC;IAGX,SAAS,EAAE,MAAM,CAAC;IAGlB,SAAS,EAAE,MAAM,CAAC;IAGlB,cAAc,EAAE,MAAM,CAAC;IAGvB,aAAa,EAAE,OAAO,CAAC;IAGvB,WAAW,EAAE,MAAM,EAAE,CAAC;IAGtB,aAAa,EAAE,MAAM,CAAC;IAGtB,SAAS,EAAE,MAAM,CAAC;IAGlB,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ProfilePermission = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
let ProfilePermission = class ProfilePermission {
|
|
15
|
+
id;
|
|
16
|
+
profileId;
|
|
17
|
+
groupSlug;
|
|
18
|
+
permissionSlug;
|
|
19
|
+
hasPermission;
|
|
20
|
+
permissions;
|
|
21
|
+
lastUpdatedBy;
|
|
22
|
+
updatedAt;
|
|
23
|
+
createdAt;
|
|
24
|
+
};
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
27
|
+
__metadata("design:type", Number)
|
|
28
|
+
], ProfilePermission.prototype, "id", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)(),
|
|
31
|
+
__metadata("design:type", Number)
|
|
32
|
+
], ProfilePermission.prototype, "profileId", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)(),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], ProfilePermission.prototype, "groupSlug", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)(),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], ProfilePermission.prototype, "permissionSlug", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)(),
|
|
43
|
+
__metadata("design:type", Boolean)
|
|
44
|
+
], ProfilePermission.prototype, "hasPermission", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.Column)({ type: 'simple-array' }),
|
|
47
|
+
__metadata("design:type", Array)
|
|
48
|
+
], ProfilePermission.prototype, "permissions", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
51
|
+
__metadata("design:type", Number)
|
|
52
|
+
], ProfilePermission.prototype, "lastUpdatedBy", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], ProfilePermission.prototype, "updatedAt", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
59
|
+
__metadata("design:type", String)
|
|
60
|
+
], ProfilePermission.prototype, "createdAt", void 0);
|
|
61
|
+
ProfilePermission = __decorate([
|
|
62
|
+
(0, typeorm_1.Entity)()
|
|
63
|
+
], ProfilePermission);
|
|
64
|
+
exports.ProfilePermission = ProfilePermission;
|
|
65
|
+
//# sourceMappingURL=profile-permission.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile-permission.entity.js","sourceRoot":"","sources":["../../../src/domain/entities/profile-permission.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAMiB;AAGV,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAE5B,EAAE,CAAS;IAGX,SAAS,CAAS;IAGlB,SAAS,CAAS;IAGlB,cAAc,CAAS;IAGvB,aAAa,CAAU;IAGvB,WAAW,CAAW;IAGtB,aAAa,CAAS;IAGtB,SAAS,CAAS;IAGlB,SAAS,CAAS;CACnB,CAAA;AA1BC;IAAC,IAAA,gCAAsB,GAAE;;6CACd;AAEX;IAAC,IAAA,gBAAM,GAAE;;oDACS;AAElB;IAAC,IAAA,gBAAM,GAAE;;oDACS;AAElB;IAAC,IAAA,gBAAM,GAAE;;yDACc;AAEvB;IAAC,IAAA,gBAAM,GAAE;;wDACc;AAEvB;IAAC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;;sDACX;AAEtB;IAAC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wDACL;AAEtB;IAAC,IAAA,0BAAgB,GAAE;;oDACD;AAElB;IAAC,IAAA,0BAAgB,GAAE;;oDACD;AA1BP,iBAAiB;IAD7B,IAAA,gBAAM,GAAE;GACI,iBAAiB,CA2B7B;AA3BY,8CAAiB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile.entity.d.ts","sourceRoot":"","sources":["../../../src/domain/entities/profile.entity.ts"],"names":[],"mappings":"AAQA,qBACa,OAAO;IAElB,EAAE,EAAE,MAAM,CAAC;IAGX,IAAI,EAAE,MAAM,CAAC;IAGb,WAAW,EAAE,MAAM,CAAC;IAGpB,IAAI,EAAE,MAAM,CAAC;IAGb,SAAS,EAAE,MAAM,CAAC;IAGlB,SAAS,EAAE,MAAM,CAAC;IAGlB,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -0,0 +1,55 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Profile = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
let Profile = class Profile {
|
|
15
|
+
id;
|
|
16
|
+
name;
|
|
17
|
+
description;
|
|
18
|
+
type;
|
|
19
|
+
createdBy;
|
|
20
|
+
updatedAt;
|
|
21
|
+
createdAt;
|
|
22
|
+
};
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
25
|
+
__metadata("design:type", Number)
|
|
26
|
+
], Profile.prototype, "id", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, typeorm_1.Column)(),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], Profile.prototype, "name", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.Column)(),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], Profile.prototype, "description", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.Column)(),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], Profile.prototype, "type", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.Column)(),
|
|
41
|
+
__metadata("design:type", Number)
|
|
42
|
+
], Profile.prototype, "createdBy", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], Profile.prototype, "updatedAt", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], Profile.prototype, "createdAt", void 0);
|
|
51
|
+
Profile = __decorate([
|
|
52
|
+
(0, typeorm_1.Entity)()
|
|
53
|
+
], Profile);
|
|
54
|
+
exports.Profile = Profile;
|
|
55
|
+
//# sourceMappingURL=profile.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile.entity.js","sourceRoot":"","sources":["../../../src/domain/entities/profile.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAMiB;AAGV,IAAM,OAAO,GAAb,MAAM,OAAO;IAElB,EAAE,CAAS;IAGX,IAAI,CAAS;IAGb,WAAW,CAAS;IAGpB,IAAI,CAAS;IAGb,SAAS,CAAS;IAGlB,SAAS,CAAS;IAGlB,SAAS,CAAS;CACnB,CAAA;AApBC;IAAC,IAAA,gCAAsB,GAAE;;mCACd;AAEX;IAAC,IAAA,gBAAM,GAAE;;qCACI;AAEb;IAAC,IAAA,gBAAM,GAAE;;4CACW;AAEpB;IAAC,IAAA,gBAAM,GAAE;;qCACI;AAEb;IAAC,IAAA,gBAAM,GAAE;;0CACS;AAElB;IAAC,IAAA,0BAAgB,GAAE;;0CACD;AAElB;IAAC,IAAA,0BAAgB,GAAE;;0CACD;AApBP,OAAO;IADnB,IAAA,gBAAM,GAAE;GACI,OAAO,CAqBnB;AArBY,0BAAO"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Profile } from './profile.entity';
|
|
2
|
+
export declare class User {
|
|
3
|
+
id: number;
|
|
4
|
+
type: string;
|
|
5
|
+
fullName: string;
|
|
6
|
+
username: string;
|
|
7
|
+
email: string;
|
|
8
|
+
mobile: string;
|
|
9
|
+
password: string;
|
|
10
|
+
isActive: boolean;
|
|
11
|
+
isSuperuser: boolean;
|
|
12
|
+
roleId: number;
|
|
13
|
+
departmentId: number;
|
|
14
|
+
pictureId: number;
|
|
15
|
+
profiles: Profile[];
|
|
16
|
+
schoolId: number;
|
|
17
|
+
createdAt: string;
|
|
18
|
+
updatedAt: string;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=user.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.entity.d.ts","sourceRoot":"","sources":["../../../src/domain/entities/user.entity.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,qBACa,IAAI;IAEf,EAAE,EAAE,MAAM,CAAC;IAGX,IAAI,EAAE,MAAM,CAAC;IAGb,QAAQ,EAAE,MAAM,CAAC;IAGjB,QAAQ,EAAE,MAAM,CAAC;IAGjB,KAAK,EAAE,MAAM,CAAC;IAGd,MAAM,EAAE,MAAM,CAAC;IAGf,QAAQ,EAAE,MAAM,CAAC;IAGjB,QAAQ,EAAE,OAAO,CAAC;IAGlB,WAAW,EAAE,OAAO,CAAC;IAGrB,MAAM,EAAE,MAAM,CAAC;IAGf,YAAY,EAAE,MAAM,CAAC;IAGrB,SAAS,EAAE,MAAM,CAAC;IAQlB,QAAQ,EAAE,OAAO,EAAE,CAAC;IAGpB,QAAQ,EAAE,MAAM,CAAC;IAGjB,SAAS,EAAE,MAAM,CAAC;IAGlB,SAAS,EAAE,MAAM,CAAC;CACnB"}
|