rez_core 1.0.95 → 1.0.96
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/module/auth/auth.module.js +8 -4
- package/dist/module/auth/auth.module.js.map +1 -1
- package/dist/module/meta/entity/entity-table-column.entity.d.ts +2 -0
- package/dist/module/meta/entity/entity-table-column.entity.js +13 -0
- package/dist/module/meta/entity/entity-table-column.entity.js.map +1 -1
- package/dist/module/user/service/user-session.service.d.ts +4 -2
- package/dist/module/user/service/user-session.service.js +8 -4
- package/dist/module/user/service/user-session.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/auth/auth.module.ts +12 -4
- package/src/module/meta/entity/entity-table-column.entity.ts +11 -0
- package/src/module/user/service/user-session.service.ts +8 -3
- package/src/resources/dev.properties.yaml +7 -0
- package/src/resources/uat.properties.yaml +2 -1
|
@@ -29,10 +29,14 @@ exports.AuthModule = AuthModule = __decorate([
|
|
|
29
29
|
jwt_1.JwtModule.registerAsync({
|
|
30
30
|
imports: [config_1.ConfigModule],
|
|
31
31
|
inject: [config_1.ConfigService],
|
|
32
|
-
useFactory: async (configService) =>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
useFactory: async (configService) => {
|
|
33
|
+
const expiryInHours = parseFloat(configService.get('TOKEN_EXPIRY') || '1');
|
|
34
|
+
const expiryInSeconds = expiryInHours * 60 * 60;
|
|
35
|
+
return {
|
|
36
|
+
secret: configService.get('SECRET_KEY'),
|
|
37
|
+
signOptions: { expiresIn: expiryInSeconds },
|
|
38
|
+
};
|
|
39
|
+
},
|
|
36
40
|
}),
|
|
37
41
|
typeorm_1.TypeOrmModule.forFeature([user_session_entity_1.UserSession]),
|
|
38
42
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.module.js","sourceRoot":"","sources":["../../../src/module/auth/auth.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,2CAA6D;AAC7D,qCAAwC;AACxC,6CAAgD;AAChD,4DAAwD;AACxD,wDAAwD;AACxD,kDAAkD;AAElD,+CAAkD;AAClD,4EAAiE;AACjE,kEAA8D;AAC9D,oDAAiD;
|
|
1
|
+
{"version":3,"file":"auth.module.js","sourceRoot":"","sources":["../../../src/module/auth/auth.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,2CAA6D;AAC7D,qCAAwC;AACxC,6CAAgD;AAChD,4DAAwD;AACxD,wDAAwD;AACxD,kDAAkD;AAElD,+CAAkD;AAClD,4EAAiE;AACjE,kEAA8D;AAC9D,oDAAiD;AAiC1C,IAAM,UAAU,GAAhB,MAAM,UAAU;CAAG,CAAA;AAAb,gCAAU;qBAAV,UAAU;IA/BtB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,qBAAY;YACZ,yBAAc,CAAC,QAAQ,CAAC,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC;YACnD,eAAS,CAAC,aAAa,CAAC;gBACtB,OAAO,EAAE,CAAC,qBAAY,CAAC;gBACvB,MAAM,EAAE,CAAC,sBAAa,CAAC;gBACvB,UAAU,EAAE,KAAK,EAAE,aAA4B,EAAE,EAAE;oBACjD,MAAM,aAAa,GAAG,UAAU,CAC9B,aAAa,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,GAAG,CACzC,CAAC;oBACF,MAAM,eAAe,GAAG,aAAa,GAAG,EAAE,GAAG,EAAE,CAAC;oBAEhD,OAAO;wBACL,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,YAAY,CAAC;wBACvC,WAAW,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE;qBAC5C,CAAC;gBACJ,CAAC;aACF,CAAC;YAEF,uBAAa,CAAC,UAAU,CAAC,CAAC,iCAAW,CAAC,CAAC;SACxC;QACD,SAAS,EAAE;YACT,4BAAc;YACd,0BAAW;YACX,wBAAY;YACZ,gCAAc;YACd,uBAAU;SACX;QACD,OAAO,EAAE,CAAC,4BAAc,EAAE,wBAAY,EAAE,uBAAU,CAAC;KACpD,CAAC;GACW,UAAU,CAAG"}
|
|
@@ -60,6 +60,19 @@ __decorate([
|
|
|
60
60
|
(0, typeorm_1.Column)({ name: 'data_type', nullable: true }),
|
|
61
61
|
__metadata("design:type", String)
|
|
62
62
|
], EntityTableColumn.prototype, "data_type", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, typeorm_1.Column)({
|
|
65
|
+
name: 'data_source_type',
|
|
66
|
+
type: 'varchar',
|
|
67
|
+
nullable: true,
|
|
68
|
+
length: 50,
|
|
69
|
+
}),
|
|
70
|
+
__metadata("design:type", String)
|
|
71
|
+
], EntityTableColumn.prototype, "data_source_type", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, typeorm_1.Column)({ name: 'datasource_list', type: 'varchar', nullable: true }),
|
|
74
|
+
__metadata("design:type", String)
|
|
75
|
+
], EntityTableColumn.prototype, "datasource_list", void 0);
|
|
63
76
|
__decorate([
|
|
64
77
|
(0, typeorm_1.Column)({ name: 'visible', nullable: true }),
|
|
65
78
|
__metadata("design:type", String)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-table-column.entity.js","sourceRoot":"","sources":["../../../../src/module/meta/entity/entity-table-column.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uEAAiF;AACjF,qCAAyC;AACzC,6DAAkD;AAG3C,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,+BAAU;IAC/C;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,GAAG,8CAA4B,CAAC;IAClD,CAAC;
|
|
1
|
+
{"version":3,"file":"entity-table-column.entity.js","sourceRoot":"","sources":["../../../../src/module/meta/entity/entity-table-column.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uEAAiF;AACjF,qCAAyC;AACzC,6DAAkD;AAG3C,IAAM,iBAAiB,GAAvB,MAAM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EAAE,SAAS;QACf,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,EAAE;KACX,CAAC;;2DACuB;AAGzB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0DAC7C;AAGxB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDAC5B;4BAhDL,iBAAiB;IAD7B,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,wBAAwB,EAAE,CAAC;;GAC9B,iBAAiB,CAiD7B"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { UserSession } from '../entity/user-session.entity';
|
|
2
2
|
import { ClockIDGenService } from '../../../utils/service/clockIDGenUtil.service';
|
|
3
3
|
import { UserSessionRepository } from '../repository/userSession.repository';
|
|
4
|
-
import { JwtAuthService } from '
|
|
4
|
+
import { JwtAuthService } from 'src/module/auth/services/jwt.service';
|
|
5
|
+
import { ConfigService } from '@nestjs/config';
|
|
5
6
|
export declare class UserSessionService {
|
|
6
7
|
private readonly userSessionRepository;
|
|
7
8
|
private readonly jwtAuthService;
|
|
8
9
|
private readonly clockIDGenService;
|
|
9
|
-
|
|
10
|
+
private configService;
|
|
11
|
+
constructor(userSessionRepository: UserSessionRepository, jwtAuthService: JwtAuthService, clockIDGenService: ClockIDGenService, configService: ConfigService);
|
|
10
12
|
createSession(user: any): Promise<string>;
|
|
11
13
|
findBySessionKey(sessionKey: string): Promise<UserSession | null>;
|
|
12
14
|
updateSession(userSession: UserSession): Promise<void>;
|
|
@@ -14,12 +14,14 @@ const user_session_entity_1 = require("../entity/user-session.entity");
|
|
|
14
14
|
const clockIDGenUtil_service_1 = require("../../../utils/service/clockIDGenUtil.service");
|
|
15
15
|
const common_1 = require("@nestjs/common");
|
|
16
16
|
const userSession_repository_1 = require("../repository/userSession.repository");
|
|
17
|
-
const jwt_service_1 = require("
|
|
17
|
+
const jwt_service_1 = require("../../auth/services/jwt.service");
|
|
18
|
+
const config_1 = require("@nestjs/config");
|
|
18
19
|
let UserSessionService = class UserSessionService {
|
|
19
|
-
constructor(userSessionRepository, jwtAuthService, clockIDGenService) {
|
|
20
|
+
constructor(userSessionRepository, jwtAuthService, clockIDGenService, configService) {
|
|
20
21
|
this.userSessionRepository = userSessionRepository;
|
|
21
22
|
this.jwtAuthService = jwtAuthService;
|
|
22
23
|
this.clockIDGenService = clockIDGenService;
|
|
24
|
+
this.configService = configService;
|
|
23
25
|
}
|
|
24
26
|
async createSession(user) {
|
|
25
27
|
const sessionToken = this.clockIDGenService.idGenerator('SES');
|
|
@@ -28,7 +30,8 @@ let UserSessionService = class UserSessionService {
|
|
|
28
30
|
userSession.session_key = sessionToken;
|
|
29
31
|
userSession.is_session_loggedout = 0;
|
|
30
32
|
userSession.login_time = new Date();
|
|
31
|
-
|
|
33
|
+
const expiryTokenInHours = this.configService.get('TOKEN_EXPIRY') || 1;
|
|
34
|
+
userSession.expiry_date = new Date(Date.now() + expiryTokenInHours * 60 * 60 * 1000);
|
|
32
35
|
await this.userSessionRepository.saveSession(userSession);
|
|
33
36
|
const payload = { userId: user.id, sessionToken };
|
|
34
37
|
const accessToken = this.jwtAuthService.generateJwt(payload);
|
|
@@ -48,6 +51,7 @@ exports.UserSessionService = UserSessionService = __decorate([
|
|
|
48
51
|
(0, common_1.Injectable)(),
|
|
49
52
|
__metadata("design:paramtypes", [userSession_repository_1.UserSessionRepository,
|
|
50
53
|
jwt_service_1.JwtAuthService,
|
|
51
|
-
clockIDGenUtil_service_1.ClockIDGenService
|
|
54
|
+
clockIDGenUtil_service_1.ClockIDGenService,
|
|
55
|
+
config_1.ConfigService])
|
|
52
56
|
], UserSessionService);
|
|
53
57
|
//# sourceMappingURL=user-session.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-session.service.js","sourceRoot":"","sources":["../../../../src/module/user/service/user-session.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uEAA4D;AAC5D,0FAAkF;AAClF,2CAA4C;AAC5C,iFAA6E;AAC7E,
|
|
1
|
+
{"version":3,"file":"user-session.service.js","sourceRoot":"","sources":["../../../../src/module/user/service/user-session.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uEAA4D;AAC5D,0FAAkF;AAClF,2CAA4C;AAC5C,iFAA6E;AAC7E,iEAAsE;AACtE,2CAA+C;AAGxC,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC7B,YACmB,qBAA4C,EAC5C,cAA8B,EAC9B,iBAAoC,EAC7C,aAA4B;QAHnB,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,mBAAc,GAAd,cAAc,CAAgB;QAC9B,sBAAiB,GAAjB,iBAAiB,CAAmB;QAC7C,kBAAa,GAAb,aAAa,CAAe;IACnC,CAAC;IACJ,KAAK,CAAC,aAAa,CAAC,IAAI;QACtB,MAAM,YAAY,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAE/D,MAAM,WAAW,GAAQ,IAAI,iCAAW,EAAE,CAAC;QAC3C,WAAW,CAAC,OAAO,GAAG,IAAI,CAAC,EAAE,CAAC;QAC9B,WAAW,CAAC,WAAW,GAAG,YAAY,CAAC;QACvC,WAAW,CAAC,oBAAoB,GAAG,CAAC,CAAC;QACrC,WAAW,CAAC,UAAU,GAAG,IAAI,IAAI,EAAE,CAAC;QACpC,MAAM,kBAAkB,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QACvE,WAAW,CAAC,WAAW,GAAG,IAAI,IAAI,CAChC,IAAI,CAAC,GAAG,EAAE,GAAG,kBAAkB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CACjD,CAAC;QAEF,MAAM,IAAI,CAAC,qBAAqB,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;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