rez_core 1.0.39 → 1.0.41
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/constant/global.constant.d.ts +2 -0
- package/dist/constant/global.constant.js +3 -1
- package/dist/constant/global.constant.js.map +1 -1
- package/dist/module/auth/guards/role.guard.js +3 -3
- package/dist/module/listmaster/controller/list-master.controller.d.ts +14 -0
- package/dist/module/listmaster/controller/list-master.controller.js +38 -0
- package/dist/module/listmaster/controller/list-master.controller.js.map +1 -0
- package/dist/module/listmaster/entity/list-master-items.entity.d.ts +11 -0
- package/dist/module/listmaster/entity/list-master-items.entity.js +55 -0
- package/dist/module/listmaster/entity/list-master-items.entity.js.map +1 -0
- package/dist/module/listmaster/entity/list-master.entity.d.ts +12 -0
- package/dist/module/listmaster/entity/list-master.entity.js +59 -0
- package/dist/module/listmaster/entity/list-master.entity.js.map +1 -0
- package/dist/module/listmaster/listmaster.module.d.ts +2 -0
- package/dist/module/listmaster/listmaster.module.js +27 -0
- package/dist/module/listmaster/listmaster.module.js.map +1 -0
- package/dist/module/listmaster/repository/list-master-items.repository.d.ts +10 -0
- package/dist/module/listmaster/repository/list-master-items.repository.js +38 -0
- package/dist/module/listmaster/repository/list-master-items.repository.js.map +1 -0
- package/dist/module/listmaster/repository/list-master.repository.d.ts +7 -0
- package/dist/module/listmaster/repository/list-master.repository.js +34 -0
- package/dist/module/listmaster/repository/list-master.repository.js.map +1 -0
- package/dist/module/listmaster/service/list-master.service.d.ts +18 -0
- package/dist/module/listmaster/service/list-master.service.js +51 -0
- package/dist/module/listmaster/service/list-master.service.js.map +1 -0
- package/dist/module/master/controller/master.controller.d.ts +3 -1
- package/dist/module/master/controller/master.controller.js.map +1 -1
- package/dist/module/master/service/master.service.d.ts +16 -4
- package/dist/module/master/service/master.service.js +103 -7
- package/dist/module/master/service/master.service.js.map +1 -1
- package/dist/module/meta/entity/entity-master.entity.d.ts +1 -1
- package/dist/module/meta/entity/entity-master.entity.js +1 -1
- package/dist/module/meta/entity/entity-master.entity.js.map +1 -1
- package/dist/module/meta/repository/entity-table.repository.js +3 -1
- package/dist/module/meta/repository/entity-table.repository.js.map +1 -1
- package/dist/module/meta/service/entity-master.service.d.ts +3 -0
- package/dist/module/meta/service/entity-master.service.js +11 -0
- package/dist/module/meta/service/entity-master.service.js.map +1 -1
- package/dist/module/meta/service/entity-service-impl.service.js +1 -1
- package/dist/module/meta/service/entity-service-impl.service.js.map +1 -1
- package/dist/module/module/controller/module-access.controller.d.ts +22 -2
- package/dist/module/module/controller/module-access.controller.js +12 -0
- package/dist/module/module/controller/module-access.controller.js.map +1 -1
- package/dist/module/module/repository/module-access.repository.d.ts +25 -3
- package/dist/module/module/repository/module-access.repository.js +57 -5
- package/dist/module/module/repository/module-access.repository.js.map +1 -1
- package/dist/module/module/service/module-access.service.d.ts +22 -2
- package/dist/module/module/service/module-access.service.js +3 -0
- package/dist/module/module/service/module-access.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/service/file-util.service.d.ts +3 -0
- package/dist/utils/service/file-util.service.js +15 -0
- package/dist/utils/service/file-util.service.js.map +1 -0
- package/package.json +4 -2
- package/src/constant/global.constant.ts +2 -0
- package/src/module/auth/guards/jwt.guard.ts +22 -22
- package/src/module/auth/guards/role.guard.ts +68 -68
- package/src/module/auth/services/auth.service.ts +29 -29
- package/src/module/auth/services/jwt.service.ts +11 -11
- package/src/module/auth/strategies/local.strategy.ts +13 -13
- package/src/module/dev/dev.module.ts +12 -12
- package/src/module/dev/service/dev.service.ts +7 -7
- package/src/module/enterprise/entity/enterprise.entity.ts +37 -37
- package/src/module/enterprise/entity/organization.entity.ts +80 -80
- package/src/module/listmaster/controller/list-master.controller.ts +14 -0
- package/src/module/listmaster/entity/list-master-items.entity.ts +33 -0
- package/src/module/listmaster/entity/list-master.entity.ts +35 -0
- package/src/module/listmaster/listmaster.module.ts +14 -0
- package/src/module/listmaster/repository/list-master-items.repository.ts +21 -0
- package/src/module/listmaster/repository/list-master.repository.ts +15 -0
- package/src/module/listmaster/service/list-master.service.ts +44 -0
- package/src/module/master/controller/master.controller.ts +26 -22
- package/src/module/master/service/master.service.ts +133 -9
- package/src/module/meta/dto/entity-list-data.dto.ts +6 -6
- package/src/module/meta/entity/attribute-master.entity.ts +67 -67
- package/src/module/meta/entity/entity-master.entity.ts +1 -1
- package/src/module/meta/entity/preference.entity.ts +65 -65
- package/src/module/meta/repository/attribute-master.repository.ts +28 -28
- package/src/module/meta/repository/entity-table.repository.ts +3 -1
- package/src/module/meta/repository/preference.repository.ts +20 -20
- package/src/module/meta/service/entity-master.service.ts +14 -0
- package/src/module/meta/service/entity-service-impl.service.ts +1 -1
- package/src/module/module/controller/menu.controller.ts +15 -15
- package/src/module/module/controller/module-access.controller.ts +16 -1
- package/src/module/module/entity/module-access.entity.ts +22 -22
- package/src/module/module/entity/module-action.entity.ts +19 -19
- package/src/module/module/repository/module-access.repository.ts +74 -6
- package/src/module/module/service/module-access.service.ts +10 -0
- package/src/module/user/controller/user.controller.ts +28 -28
- package/src/module/user/dto/update-user.dto.ts +4 -4
- package/src/module/user/entity/user-role-mapping.entity.ts +21 -21
- package/src/module/user/entity/user-session.entity.ts +61 -61
- package/src/module/user/entity/user.entity.ts +35 -35
- package/src/module/user/repository/role.repository.ts +16 -16
- package/src/module/user/repository/userSession.repository.ts +33 -33
- package/src/utils/service/encryptUtil.service.ts +97 -97
- package/src/utils/service/excelUtil.service.ts +15 -15
- package/src/utils/service/file-util.service.ts +11 -0
- package/src/utils/service/reflection-helper.service.ts +53 -53
- package/.idea/250218_nodejs_core.iml +0 -12
- package/.idea/codeStyles/Project.xml +0 -59
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/dataSources.xml +0 -12
- package/.idea/modules.xml +0 -8
- package/.idea/prettier.xml +0 -6
- package/.idea/vcs.xml +0 -6
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FileUtil = void 0;
|
|
4
|
+
const fs = require("node:fs");
|
|
5
|
+
class FileUtil {
|
|
6
|
+
static deleteFile(path) {
|
|
7
|
+
fs.unlink(path, (err) => {
|
|
8
|
+
if (err) {
|
|
9
|
+
console.log(`Error deleting file ${path}:`, err);
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.FileUtil = FileUtil;
|
|
15
|
+
//# sourceMappingURL=file-util.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-util.service.js","sourceRoot":"","sources":["../../../src/utils/service/file-util.service.ts"],"names":[],"mappings":";;;AAAA,8BAA8B;AAE9B,MAAa,QAAQ;IACnB,MAAM,CAAC,UAAU,CAAC,IAAY;QAC5B,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE;YACtB,IAAI,GAAG,EAAE,CAAC;gBACR,OAAO,CAAC,GAAG,CAAC,uBAAuB,IAAI,GAAG,EAAE,GAAG,CAAC,CAAC;YACnD,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AARD,4BAQC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rez_core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.41",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "",
|
|
6
6
|
"private": false,
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@nestjs/core": "^11.0.1",
|
|
27
27
|
"@nestjs/jwt": "^11.0.0",
|
|
28
28
|
"@nestjs/passport": "^11.0.5",
|
|
29
|
-
"@nestjs/platform-express": "^11.0.
|
|
29
|
+
"@nestjs/platform-express": "^11.0.20",
|
|
30
30
|
"@nestjs/swagger": "^11.0.3",
|
|
31
31
|
"@nestjs/typeorm": "^11.0.0",
|
|
32
32
|
"250218_nodejs_core": "file:",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"dotenv": "^16.4.7",
|
|
40
40
|
"exceljs": "^4.4.0",
|
|
41
41
|
"moment": "^2.30.1",
|
|
42
|
+
"multer": "^1.4.5-lts.2",
|
|
42
43
|
"mysql2": "^3.12.0",
|
|
43
44
|
"passport": "^0.7.0",
|
|
44
45
|
"passport-google-oauth20": "^2.0.0",
|
|
@@ -61,6 +62,7 @@
|
|
|
61
62
|
"@swc/core": "^1.10.7",
|
|
62
63
|
"@types/express": "^5.0.0",
|
|
63
64
|
"@types/jest": "^29.5.14",
|
|
65
|
+
"@types/multer": "^1.4.12",
|
|
64
66
|
"@types/node": "^22.10.7",
|
|
65
67
|
"@types/supertest": "^6.0.2",
|
|
66
68
|
"eslint": "^9.18.0",
|
|
@@ -7,6 +7,8 @@ export const ENTITYTYPE_ENTITYTABLECOLUMN = 'ETC';
|
|
|
7
7
|
export const ENTITYTYPE_PREFERENCEMASTER = 'PRM';
|
|
8
8
|
export const ENTITYTYPE_VIEWMASTER = 'VMS';
|
|
9
9
|
export const ENTITYTYPE_MEDIA = 'MDA';
|
|
10
|
+
export const ENTITYTYPE_LISTMASTER = 'LMS';
|
|
11
|
+
export const ENTITYTYPE_LISTMASTERITEMS = 'LMI';
|
|
10
12
|
|
|
11
13
|
export const STORAGETYPE_SINGLEJSON = 'singlejson';
|
|
12
14
|
export const STORAGETYPE_COLUMN = 'column';
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { ExecutionContext, Injectable } from '@nestjs/common';
|
|
2
|
-
import { AuthGuard } from '@nestjs/passport';
|
|
3
|
-
import { Reflector } from '@nestjs/core';
|
|
4
|
-
import { Observable } from 'rxjs';
|
|
5
|
-
|
|
6
|
-
@Injectable()
|
|
7
|
-
export class JwtAuthGuard extends AuthGuard('jwt') {
|
|
8
|
-
constructor(private reflector: Reflector) {
|
|
9
|
-
super();
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
canActivate(
|
|
13
|
-
context: ExecutionContext,
|
|
14
|
-
): Promise<boolean> | boolean | Observable<boolean> {
|
|
15
|
-
const isPublic = this.reflector.getAllAndOverride('isPublic', [
|
|
16
|
-
context.getHandler(),
|
|
17
|
-
context.getClass(),
|
|
18
|
-
]);
|
|
19
|
-
if (isPublic) return true;
|
|
20
|
-
return super.canActivate(context);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
1
|
+
import { ExecutionContext, Injectable } from '@nestjs/common';
|
|
2
|
+
import { AuthGuard } from '@nestjs/passport';
|
|
3
|
+
import { Reflector } from '@nestjs/core';
|
|
4
|
+
import { Observable } from 'rxjs';
|
|
5
|
+
|
|
6
|
+
@Injectable()
|
|
7
|
+
export class JwtAuthGuard extends AuthGuard('jwt') {
|
|
8
|
+
constructor(private reflector: Reflector) {
|
|
9
|
+
super();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
canActivate(
|
|
13
|
+
context: ExecutionContext,
|
|
14
|
+
): Promise<boolean> | boolean | Observable<boolean> {
|
|
15
|
+
const isPublic = this.reflector.getAllAndOverride('isPublic', [
|
|
16
|
+
context.getHandler(),
|
|
17
|
+
context.getClass(),
|
|
18
|
+
]);
|
|
19
|
+
if (isPublic) return true;
|
|
20
|
+
return super.canActivate(context);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CanActivate,
|
|
3
|
-
ExecutionContext,
|
|
4
|
-
ForbiddenException,
|
|
5
|
-
Injectable,
|
|
6
|
-
UnauthorizedException,
|
|
7
|
-
} from '@nestjs/common';
|
|
8
|
-
import { Reflector } from '@nestjs/core';
|
|
9
|
-
import { UserData } from '../../user/entity/user.entity';
|
|
10
|
-
import { InjectEntityManager } from '@nestjs/typeorm';
|
|
11
|
-
import { EntityManager } from 'typeorm';
|
|
12
|
-
|
|
13
|
-
@Injectable()
|
|
14
|
-
export class RolesGuard implements CanActivate {
|
|
15
|
-
constructor(
|
|
16
|
-
private reflector: Reflector,
|
|
17
|
-
@InjectEntityManager() private entityManager: EntityManager,
|
|
18
|
-
) {}
|
|
19
|
-
|
|
20
|
-
async canActivate(context: ExecutionContext) {
|
|
21
|
-
const request = context
|
|
22
|
-
.switchToHttp()
|
|
23
|
-
.getRequest<Request & { user: any }>();
|
|
24
|
-
const object = request.user;
|
|
25
|
-
|
|
26
|
-
const users: UserData = await this.entityManager.query(
|
|
27
|
-
`SELECT * FROM cr_user WHERE id = ${object.userId} LIMIT 1`,
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
const user = users[0];
|
|
31
|
-
if (!user || !user['role_id']) {
|
|
32
|
-
throw new UnauthorizedException('User not authorized');
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const requiredModule = this.reflector.get<string>(
|
|
36
|
-
'moduleCode',
|
|
37
|
-
context.getHandler(),
|
|
38
|
-
);
|
|
39
|
-
const requiredActions = this.reflector.get<string>(
|
|
40
|
-
'actions',
|
|
41
|
-
context.getHandler(),
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
const roleAccess = await this.entityManager.query(
|
|
45
|
-
`SELECT *
|
|
46
|
-
FROM cr_module_access
|
|
47
|
-
WHERE role_id = ${user['role_id']}
|
|
48
|
-
AND module_code = '${requiredModule}'`,
|
|
49
|
-
);
|
|
50
|
-
|
|
51
|
-
if (!roleAccess || roleAccess.length === 0) {
|
|
52
|
-
throw new ForbiddenException(
|
|
53
|
-
'Access denied: No permissions found for this module',
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const hasAccess = roleAccess.some(
|
|
58
|
-
(access) =>
|
|
59
|
-
requiredActions.includes(access.action_type) &&
|
|
60
|
-
access.access_flag === 1,
|
|
61
|
-
);
|
|
62
|
-
|
|
63
|
-
if (!hasAccess) {
|
|
64
|
-
throw new ForbiddenException('Access denied: Insufficient permissions.');
|
|
65
|
-
}
|
|
66
|
-
return true;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
CanActivate,
|
|
3
|
+
ExecutionContext,
|
|
4
|
+
ForbiddenException,
|
|
5
|
+
Injectable,
|
|
6
|
+
UnauthorizedException,
|
|
7
|
+
} from '@nestjs/common';
|
|
8
|
+
import { Reflector } from '@nestjs/core';
|
|
9
|
+
import { UserData } from '../../user/entity/user.entity';
|
|
10
|
+
import { InjectEntityManager } from '@nestjs/typeorm';
|
|
11
|
+
import { EntityManager } from 'typeorm';
|
|
12
|
+
|
|
13
|
+
@Injectable()
|
|
14
|
+
export class RolesGuard implements CanActivate {
|
|
15
|
+
constructor(
|
|
16
|
+
private reflector: Reflector,
|
|
17
|
+
@InjectEntityManager() private entityManager: EntityManager,
|
|
18
|
+
) {}
|
|
19
|
+
|
|
20
|
+
async canActivate(context: ExecutionContext) {
|
|
21
|
+
const request = context
|
|
22
|
+
.switchToHttp()
|
|
23
|
+
.getRequest<Request & { user: any }>();
|
|
24
|
+
const object = request.user;
|
|
25
|
+
|
|
26
|
+
const users: UserData = await this.entityManager.query(
|
|
27
|
+
`SELECT * FROM cr_user WHERE id = ${object.userId} LIMIT 1`,
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
const user = users[0];
|
|
31
|
+
if (!user || !user['role_id']) {
|
|
32
|
+
throw new UnauthorizedException('User not authorized');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const requiredModule = this.reflector.get<string>(
|
|
36
|
+
'moduleCode',
|
|
37
|
+
context.getHandler(),
|
|
38
|
+
);
|
|
39
|
+
const requiredActions = this.reflector.get<string>(
|
|
40
|
+
'actions',
|
|
41
|
+
context.getHandler(),
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
const roleAccess = await this.entityManager.query(
|
|
45
|
+
`SELECT *
|
|
46
|
+
FROM cr_module_access
|
|
47
|
+
WHERE role_id = ${user['role_id']}
|
|
48
|
+
AND module_code = '${requiredModule}'`,
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
if (!roleAccess || roleAccess.length === 0) {
|
|
52
|
+
throw new ForbiddenException(
|
|
53
|
+
'Access denied: No permissions found for this module',
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const hasAccess = roleAccess.some(
|
|
58
|
+
(access) =>
|
|
59
|
+
requiredActions.includes(access.action_type) &&
|
|
60
|
+
access.access_flag === 1,
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
if (!hasAccess) {
|
|
64
|
+
throw new ForbiddenException('Access denied: Insufficient permissions.');
|
|
65
|
+
}
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { BadRequestException, Injectable } from '@nestjs/common';
|
|
2
|
-
import { UserService } from '../../user/service/user.service';
|
|
3
|
-
import { JwtService } from '@nestjs/jwt';
|
|
4
|
-
import { UserData } from '../../user/entity/user.entity';
|
|
5
|
-
|
|
6
|
-
@Injectable()
|
|
7
|
-
export class AuthService {
|
|
8
|
-
constructor(
|
|
9
|
-
private userService: UserService,
|
|
10
|
-
private jwtService: JwtService,
|
|
11
|
-
) {}
|
|
12
|
-
|
|
13
|
-
async validateUser(email: string, password: string): Promise<UserData> {
|
|
14
|
-
const user = await this.userService.findByEmailId(email);
|
|
15
|
-
if (!user) {
|
|
16
|
-
throw new BadRequestException('User not found');
|
|
17
|
-
}
|
|
18
|
-
const isMatch: boolean = password === user.password;
|
|
19
|
-
if (!isMatch) {
|
|
20
|
-
throw new BadRequestException('Password does not match');
|
|
21
|
-
}
|
|
22
|
-
return user;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
async login(user: UserData) {
|
|
26
|
-
const payload = { email: user.email_id, id: user.id };
|
|
27
|
-
return { access_token: this.jwtService.sign(payload) };
|
|
28
|
-
}
|
|
29
|
-
}
|
|
1
|
+
import { BadRequestException, Injectable } from '@nestjs/common';
|
|
2
|
+
import { UserService } from '../../user/service/user.service';
|
|
3
|
+
import { JwtService } from '@nestjs/jwt';
|
|
4
|
+
import { UserData } from '../../user/entity/user.entity';
|
|
5
|
+
|
|
6
|
+
@Injectable()
|
|
7
|
+
export class AuthService {
|
|
8
|
+
constructor(
|
|
9
|
+
private userService: UserService,
|
|
10
|
+
private jwtService: JwtService,
|
|
11
|
+
) {}
|
|
12
|
+
|
|
13
|
+
async validateUser(email: string, password: string): Promise<UserData> {
|
|
14
|
+
const user = await this.userService.findByEmailId(email);
|
|
15
|
+
if (!user) {
|
|
16
|
+
throw new BadRequestException('User not found');
|
|
17
|
+
}
|
|
18
|
+
const isMatch: boolean = password === user.password;
|
|
19
|
+
if (!isMatch) {
|
|
20
|
+
throw new BadRequestException('Password does not match');
|
|
21
|
+
}
|
|
22
|
+
return user;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async login(user: UserData) {
|
|
26
|
+
const payload = { email: user.email_id, id: user.id };
|
|
27
|
+
return { access_token: this.jwtService.sign(payload) };
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Injectable } from '@nestjs/common';
|
|
2
|
-
import { JwtService } from '@nestjs/jwt';
|
|
3
|
-
|
|
4
|
-
@Injectable()
|
|
5
|
-
export class JwtAuthService {
|
|
6
|
-
constructor(private readonly jwtService: JwtService) {}
|
|
7
|
-
|
|
8
|
-
generateJwt(payload: any): string {
|
|
9
|
-
return this.jwtService.sign(payload);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
1
|
+
import { Injectable } from '@nestjs/common';
|
|
2
|
+
import { JwtService } from '@nestjs/jwt';
|
|
3
|
+
|
|
4
|
+
@Injectable()
|
|
5
|
+
export class JwtAuthService {
|
|
6
|
+
constructor(private readonly jwtService: JwtService) {}
|
|
7
|
+
|
|
8
|
+
generateJwt(payload: any): string {
|
|
9
|
+
return this.jwtService.sign(payload);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { PassportStrategy } from '@nestjs/passport';
|
|
2
|
-
import { AuthService } from '../services/auth.service';
|
|
3
|
-
import { Injectable } from '@nestjs/common';
|
|
4
|
-
import { Strategy } from 'passport-jwt';
|
|
5
|
-
|
|
6
|
-
@Injectable()
|
|
7
|
-
export class LocalStrategy extends PassportStrategy(Strategy) {
|
|
8
|
-
constructor(private authService: AuthService) {
|
|
9
|
-
super({
|
|
10
|
-
usernameField: 'email',
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
}
|
|
1
|
+
import { PassportStrategy } from '@nestjs/passport';
|
|
2
|
+
import { AuthService } from '../services/auth.service';
|
|
3
|
+
import { Injectable } from '@nestjs/common';
|
|
4
|
+
import { Strategy } from 'passport-jwt';
|
|
5
|
+
|
|
6
|
+
@Injectable()
|
|
7
|
+
export class LocalStrategy extends PassportStrategy(Strategy) {
|
|
8
|
+
constructor(private authService: AuthService) {
|
|
9
|
+
super({
|
|
10
|
+
usernameField: 'email',
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Module } from '@nestjs/common';
|
|
2
|
-
import { EntityModule } from '../meta/entity.module';
|
|
3
|
-
import { UserModule } from '../user/user.module';
|
|
4
|
-
import { ModuleModule } from '../module/module.module';
|
|
5
|
-
import { DevService } from './service/dev.service';
|
|
6
|
-
|
|
7
|
-
@Module({
|
|
8
|
-
imports: [EntityModule, UserModule, ModuleModule],
|
|
9
|
-
controllers: [],
|
|
10
|
-
providers: [DevService],
|
|
11
|
-
})
|
|
12
|
-
export class DevModule {}
|
|
1
|
+
import { Module } from '@nestjs/common';
|
|
2
|
+
import { EntityModule } from '../meta/entity.module';
|
|
3
|
+
import { UserModule } from '../user/user.module';
|
|
4
|
+
import { ModuleModule } from '../module/module.module';
|
|
5
|
+
import { DevService } from './service/dev.service';
|
|
6
|
+
|
|
7
|
+
@Module({
|
|
8
|
+
imports: [EntityModule, UserModule, ModuleModule],
|
|
9
|
+
controllers: [],
|
|
10
|
+
providers: [DevService],
|
|
11
|
+
})
|
|
12
|
+
export class DevModule {}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Injectable } from '@nestjs/common';
|
|
2
|
-
import { UserService } from '../../user/service/user.service';
|
|
3
|
-
|
|
4
|
-
@Injectable()
|
|
5
|
-
export class DevService {
|
|
6
|
-
constructor(private readonly userService: UserService) {}
|
|
7
|
-
}
|
|
1
|
+
import { Injectable } from '@nestjs/common';
|
|
2
|
+
import { UserService } from '../../user/service/user.service';
|
|
3
|
+
|
|
4
|
+
@Injectable()
|
|
5
|
+
export class DevService {
|
|
6
|
+
constructor(private readonly userService: UserService) {}
|
|
7
|
+
}
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
|
|
2
|
-
|
|
3
|
-
@Entity({ name: 'cr_enterprise' })
|
|
4
|
-
export class EnterpriseData {
|
|
5
|
-
@PrimaryGeneratedColumn({ name: 'id', type: 'bigint' })
|
|
6
|
-
id: number;
|
|
7
|
-
|
|
8
|
-
@Column({ name: 'entity_type', type: 'varchar', nullable: true, length: 50 })
|
|
9
|
-
entityType: string;
|
|
10
|
-
|
|
11
|
-
@Column({ name: 'code', type: 'varchar', nullable: true, length: 50 })
|
|
12
|
-
code: string;
|
|
13
|
-
|
|
14
|
-
@Column({ name: 'name', type: 'varchar', nullable: true, length: 50 })
|
|
15
|
-
name: string;
|
|
16
|
-
|
|
17
|
-
@Column({ name: 'status', type: 'varchar', nullable: true, length: 50 })
|
|
18
|
-
status: string;
|
|
19
|
-
|
|
20
|
-
@Column({ name: 'created_by', type: 'int', nullable: true })
|
|
21
|
-
createdBy: number;
|
|
22
|
-
|
|
23
|
-
@Column({ name: 'modified_by', type: 'int', nullable: true })
|
|
24
|
-
modifiedBy: number;
|
|
25
|
-
|
|
26
|
-
@Column({ name: 'created_date', type: 'datetime', nullable: true })
|
|
27
|
-
createdDate: Date;
|
|
28
|
-
|
|
29
|
-
@Column({ name: 'modified_date', type: 'datetime', nullable: true })
|
|
30
|
-
modifiedDate: Date;
|
|
31
|
-
|
|
32
|
-
@Column({ name: 'app_code', type: 'varchar', nullable: true, length: 50 })
|
|
33
|
-
appCode: string;
|
|
34
|
-
|
|
35
|
-
@Column({ name: 'app_url_name', type: 'varchar', nullable: true, length: 50 })
|
|
36
|
-
appUrlName: string;
|
|
37
|
-
}
|
|
1
|
+
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
|
|
2
|
+
|
|
3
|
+
@Entity({ name: 'cr_enterprise' })
|
|
4
|
+
export class EnterpriseData {
|
|
5
|
+
@PrimaryGeneratedColumn({ name: 'id', type: 'bigint' })
|
|
6
|
+
id: number;
|
|
7
|
+
|
|
8
|
+
@Column({ name: 'entity_type', type: 'varchar', nullable: true, length: 50 })
|
|
9
|
+
entityType: string;
|
|
10
|
+
|
|
11
|
+
@Column({ name: 'code', type: 'varchar', nullable: true, length: 50 })
|
|
12
|
+
code: string;
|
|
13
|
+
|
|
14
|
+
@Column({ name: 'name', type: 'varchar', nullable: true, length: 50 })
|
|
15
|
+
name: string;
|
|
16
|
+
|
|
17
|
+
@Column({ name: 'status', type: 'varchar', nullable: true, length: 50 })
|
|
18
|
+
status: string;
|
|
19
|
+
|
|
20
|
+
@Column({ name: 'created_by', type: 'int', nullable: true })
|
|
21
|
+
createdBy: number;
|
|
22
|
+
|
|
23
|
+
@Column({ name: 'modified_by', type: 'int', nullable: true })
|
|
24
|
+
modifiedBy: number;
|
|
25
|
+
|
|
26
|
+
@Column({ name: 'created_date', type: 'datetime', nullable: true })
|
|
27
|
+
createdDate: Date;
|
|
28
|
+
|
|
29
|
+
@Column({ name: 'modified_date', type: 'datetime', nullable: true })
|
|
30
|
+
modifiedDate: Date;
|
|
31
|
+
|
|
32
|
+
@Column({ name: 'app_code', type: 'varchar', nullable: true, length: 50 })
|
|
33
|
+
appCode: string;
|
|
34
|
+
|
|
35
|
+
@Column({ name: 'app_url_name', type: 'varchar', nullable: true, length: 50 })
|
|
36
|
+
appUrlName: string;
|
|
37
|
+
}
|
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
|
|
2
|
-
|
|
3
|
-
@Entity({ name: 'cr_organization' })
|
|
4
|
-
export class OrganizationData {
|
|
5
|
-
@PrimaryGeneratedColumn({ name: 'id', type: 'int' })
|
|
6
|
-
id: number;
|
|
7
|
-
|
|
8
|
-
@Column({ name: 'enterprise_id', type: 'int' })
|
|
9
|
-
enterprise_id: number;
|
|
10
|
-
|
|
11
|
-
@Column({ name: 'code', nullable: true })
|
|
12
|
-
code: string;
|
|
13
|
-
|
|
14
|
-
@Column({ name: 'app_code', nullable: true })
|
|
15
|
-
appCode: string;
|
|
16
|
-
|
|
17
|
-
@Column({ name: 'name', nullable: true })
|
|
18
|
-
name: string;
|
|
19
|
-
|
|
20
|
-
@Column({ name: 'status', type: 'varchar', nullable: true })
|
|
21
|
-
status: string;
|
|
22
|
-
|
|
23
|
-
@Column({ name: 'seq_no', nullable: true })
|
|
24
|
-
seq_no: number;
|
|
25
|
-
|
|
26
|
-
@Column({ name: 'created_by', nullable: true })
|
|
27
|
-
created_by: number;
|
|
28
|
-
|
|
29
|
-
@Column({ name: 'modified_by', nullable: true })
|
|
30
|
-
modified_by: number;
|
|
31
|
-
|
|
32
|
-
@Column({ name: 'created_date', nullable: true })
|
|
33
|
-
created_date: Date;
|
|
34
|
-
|
|
35
|
-
@Column({ name: 'parent_id', nullable: true })
|
|
36
|
-
parent_id: number;
|
|
37
|
-
|
|
38
|
-
@Column({ name: 'modified_date', nullable: true })
|
|
39
|
-
modified_date: Date;
|
|
40
|
-
|
|
41
|
-
@Column({ name: 'contact_number', nullable: true })
|
|
42
|
-
contact_number: string;
|
|
43
|
-
|
|
44
|
-
@Column({ name: 'email', nullable: true })
|
|
45
|
-
emailId: string;
|
|
46
|
-
|
|
47
|
-
@Column({ name: 'entity_type', nullable: true })
|
|
48
|
-
entity_type: string;
|
|
49
|
-
|
|
50
|
-
@Column({ name: 'primary_contact_name', nullable: true })
|
|
51
|
-
primary_contact_name: string;
|
|
52
|
-
|
|
53
|
-
@Column({ name: 'address', nullable: true })
|
|
54
|
-
address: string;
|
|
55
|
-
|
|
56
|
-
@Column({ name: 'gstin', nullable: true })
|
|
57
|
-
gstin: string;
|
|
58
|
-
|
|
59
|
-
@Column({ name: 'company_pan_number', nullable: true })
|
|
60
|
-
company_pan_number: string;
|
|
61
|
-
|
|
62
|
-
@Column({ name: 'bankacc_benef_name', nullable: true })
|
|
63
|
-
bankacc_benef_name: string;
|
|
64
|
-
|
|
65
|
-
@Column({ name: 'bankacc_bank_name', nullable: true })
|
|
66
|
-
bankacc_bank_name: string;
|
|
67
|
-
|
|
68
|
-
@Column({ name: 'bankacc_account_number', nullable: true })
|
|
69
|
-
bankaccAccountNumber: string;
|
|
70
|
-
|
|
71
|
-
@Column({ name: 'bankacc_branch_IFSC', nullable: true })
|
|
72
|
-
bankacc_account_number: string;
|
|
73
|
-
|
|
74
|
-
@Column({
|
|
75
|
-
name: 'organization_type',
|
|
76
|
-
type: 'varchar',
|
|
77
|
-
nullable: true,
|
|
78
|
-
})
|
|
79
|
-
organization_type: string;
|
|
80
|
-
}
|
|
1
|
+
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
|
|
2
|
+
|
|
3
|
+
@Entity({ name: 'cr_organization' })
|
|
4
|
+
export class OrganizationData {
|
|
5
|
+
@PrimaryGeneratedColumn({ name: 'id', type: 'int' })
|
|
6
|
+
id: number;
|
|
7
|
+
|
|
8
|
+
@Column({ name: 'enterprise_id', type: 'int' })
|
|
9
|
+
enterprise_id: number;
|
|
10
|
+
|
|
11
|
+
@Column({ name: 'code', nullable: true })
|
|
12
|
+
code: string;
|
|
13
|
+
|
|
14
|
+
@Column({ name: 'app_code', nullable: true })
|
|
15
|
+
appCode: string;
|
|
16
|
+
|
|
17
|
+
@Column({ name: 'name', nullable: true })
|
|
18
|
+
name: string;
|
|
19
|
+
|
|
20
|
+
@Column({ name: 'status', type: 'varchar', nullable: true })
|
|
21
|
+
status: string;
|
|
22
|
+
|
|
23
|
+
@Column({ name: 'seq_no', nullable: true })
|
|
24
|
+
seq_no: number;
|
|
25
|
+
|
|
26
|
+
@Column({ name: 'created_by', nullable: true })
|
|
27
|
+
created_by: number;
|
|
28
|
+
|
|
29
|
+
@Column({ name: 'modified_by', nullable: true })
|
|
30
|
+
modified_by: number;
|
|
31
|
+
|
|
32
|
+
@Column({ name: 'created_date', nullable: true })
|
|
33
|
+
created_date: Date;
|
|
34
|
+
|
|
35
|
+
@Column({ name: 'parent_id', nullable: true })
|
|
36
|
+
parent_id: number;
|
|
37
|
+
|
|
38
|
+
@Column({ name: 'modified_date', nullable: true })
|
|
39
|
+
modified_date: Date;
|
|
40
|
+
|
|
41
|
+
@Column({ name: 'contact_number', nullable: true })
|
|
42
|
+
contact_number: string;
|
|
43
|
+
|
|
44
|
+
@Column({ name: 'email', nullable: true })
|
|
45
|
+
emailId: string;
|
|
46
|
+
|
|
47
|
+
@Column({ name: 'entity_type', nullable: true })
|
|
48
|
+
entity_type: string;
|
|
49
|
+
|
|
50
|
+
@Column({ name: 'primary_contact_name', nullable: true })
|
|
51
|
+
primary_contact_name: string;
|
|
52
|
+
|
|
53
|
+
@Column({ name: 'address', nullable: true })
|
|
54
|
+
address: string;
|
|
55
|
+
|
|
56
|
+
@Column({ name: 'gstin', nullable: true })
|
|
57
|
+
gstin: string;
|
|
58
|
+
|
|
59
|
+
@Column({ name: 'company_pan_number', nullable: true })
|
|
60
|
+
company_pan_number: string;
|
|
61
|
+
|
|
62
|
+
@Column({ name: 'bankacc_benef_name', nullable: true })
|
|
63
|
+
bankacc_benef_name: string;
|
|
64
|
+
|
|
65
|
+
@Column({ name: 'bankacc_bank_name', nullable: true })
|
|
66
|
+
bankacc_bank_name: string;
|
|
67
|
+
|
|
68
|
+
@Column({ name: 'bankacc_account_number', nullable: true })
|
|
69
|
+
bankaccAccountNumber: string;
|
|
70
|
+
|
|
71
|
+
@Column({ name: 'bankacc_branch_IFSC', nullable: true })
|
|
72
|
+
bankacc_account_number: string;
|
|
73
|
+
|
|
74
|
+
@Column({
|
|
75
|
+
name: 'organization_type',
|
|
76
|
+
type: 'varchar',
|
|
77
|
+
nullable: true,
|
|
78
|
+
})
|
|
79
|
+
organization_type: string;
|
|
80
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Controller, Get, Param } from "@nestjs/common";
|
|
2
|
+
import { ListMasterService } from "../service/list-master.service";
|
|
3
|
+
|
|
4
|
+
@Controller("list-master")
|
|
5
|
+
export class ListMasterController {
|
|
6
|
+
|
|
7
|
+
constructor(private readonly service: ListMasterService) {}
|
|
8
|
+
|
|
9
|
+
@Get(':type')
|
|
10
|
+
getDropdownData(@Param('type') type: string) {
|
|
11
|
+
return this.service.getDropdownOptions(type);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
}
|