rez_core 1.0.45 → 1.0.47
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/.idea/250218_nodejs_core.iml +12 -0
- package/.idea/codeStyles/Project.xml +59 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/dataSources.xml +12 -0
- package/.idea/modules.xml +8 -0
- package/.idea/prettier.xml +6 -0
- package/.idea/vcs.xml +6 -0
- package/dist/module/auth/guards/role.guard.js +3 -3
- package/dist/module/listmaster/controller/list-master.controller.d.ts +2 -10
- package/dist/module/listmaster/controller/list-master.controller.js +7 -5
- package/dist/module/listmaster/controller/list-master.controller.js.map +1 -1
- package/dist/module/listmaster/entity/list-master-items.entity.d.ts +1 -0
- package/dist/module/listmaster/entity/list-master-items.entity.js +4 -0
- package/dist/module/listmaster/entity/list-master-items.entity.js.map +1 -1
- package/dist/module/listmaster/entity/list-master.entity.d.ts +1 -0
- package/dist/module/listmaster/entity/list-master.entity.js +4 -0
- package/dist/module/listmaster/entity/list-master.entity.js.map +1 -1
- package/dist/module/listmaster/listmaster.module.js +3 -1
- package/dist/module/listmaster/listmaster.module.js.map +1 -1
- package/dist/module/listmaster/repository/list-master-items.repository.js +1 -1
- package/dist/module/listmaster/repository/list-master-items.repository.js.map +1 -1
- package/dist/module/listmaster/service/list-master.service.d.ts +9 -10
- package/dist/module/listmaster/service/list-master.service.js +49 -4
- package/dist/module/listmaster/service/list-master.service.js.map +1 -1
- package/dist/module/master/service/master.service.js.map +1 -1
- package/dist/module/meta/entity/view-master.entity.d.ts +1 -2
- package/dist/module/meta/entity/view-master.entity.js +2 -6
- package/dist/module/meta/entity/view-master.entity.js.map +1 -1
- package/dist/module/meta/entity.module.js +3 -1
- package/dist/module/meta/entity.module.js.map +1 -1
- package/dist/module/meta/service/update-form-json.service.d.ts +9 -0
- package/dist/module/meta/service/update-form-json.service.js +39 -0
- package/dist/module/meta/service/update-form-json.service.js.map +1 -0
- package/dist/module/module/controller/module-access.controller.d.ts +2 -0
- package/dist/module/module/repository/module-access.repository.d.ts +2 -0
- package/dist/module/module/repository/module-access.repository.js +2 -0
- package/dist/module/module/repository/module-access.repository.js.map +1 -1
- package/dist/module/module/service/module-access.service.d.ts +2 -0
- package/dist/module/third-party-module/entity/third-party-api-registry.entity.d.ts +5 -2
- package/dist/module/third-party-module/entity/third-party-api-registry.entity.js +14 -2
- package/dist/module/third-party-module/entity/third-party-api-registry.entity.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- 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/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 +8 -9
- package/src/module/listmaster/entity/list-master-items.entity.ts +3 -0
- package/src/module/listmaster/entity/list-master.entity.ts +3 -0
- package/src/module/listmaster/listmaster.module.ts +3 -1
- package/src/module/listmaster/repository/list-master-items.repository.ts +1 -1
- package/src/module/listmaster/service/list-master.service.ts +59 -3
- package/src/module/master/service/master.service.ts +2 -0
- package/src/module/meta/dto/entity-list-data.dto.ts +6 -6
- package/src/module/meta/entity/preference.entity.ts +65 -65
- package/src/module/meta/entity/view-master.entity.ts +2 -5
- package/src/module/meta/entity.module.ts +3 -1
- package/src/module/meta/repository/preference.repository.ts +20 -20
- package/src/module/meta/service/update-form-json.service.ts +31 -0
- package/src/module/module/controller/menu.controller.ts +15 -15
- 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 +2 -0
- package/src/module/third-party-module/entity/third-party-api-registry.entity.ts +24 -15
- 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/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/reflection-helper.service.ts +53 -53
|
@@ -6,17 +6,22 @@ import {
|
|
|
6
6
|
} from '@nestjs/common';
|
|
7
7
|
import { ListMasterItemsRepository } from '../repository/list-master-items.repository';
|
|
8
8
|
import { ListMasterRepository } from '../repository/list-master.repository';
|
|
9
|
+
import { ApiRegistryService } from '../../third-party-module/service/api-registry.service';
|
|
10
|
+
import { firstValueFrom } from 'rxjs';
|
|
11
|
+
import { HttpService } from '@nestjs/axios';
|
|
9
12
|
|
|
10
13
|
@Injectable()
|
|
11
14
|
export class ListMasterService extends EntityServiceImpl {
|
|
12
15
|
constructor(
|
|
13
16
|
private readonly listMasterRepo: ListMasterRepository,
|
|
14
17
|
private readonly listItemsRepo: ListMasterItemsRepository,
|
|
18
|
+
private readonly apiRegistryService: ApiRegistryService,
|
|
19
|
+
private readonly httpService: HttpService,
|
|
15
20
|
) {
|
|
16
21
|
super();
|
|
17
22
|
}
|
|
18
23
|
|
|
19
|
-
async getDropdownOptions(type: string) {
|
|
24
|
+
async getDropdownOptions(type: string, params: Record<string, string>) {
|
|
20
25
|
const config = await this.listMasterRepo.findByType(type);
|
|
21
26
|
|
|
22
27
|
if (!config) throw new NotFoundException(`Type ${type} not found`);
|
|
@@ -29,8 +34,7 @@ export class ListMasterService extends EntityServiceImpl {
|
|
|
29
34
|
return this.listItemsRepo.findItemsByType(type);
|
|
30
35
|
|
|
31
36
|
case 'custom':
|
|
32
|
-
|
|
33
|
-
return { message: `Custom API for type ${type} not implemented` };
|
|
37
|
+
return this.fetchFromExternalSource(config.custom_source_id, params);
|
|
34
38
|
|
|
35
39
|
default:
|
|
36
40
|
throw new BadRequestException(`Unknown source: ${config.source}`);
|
|
@@ -55,4 +59,56 @@ export class ListMasterService extends EntityServiceImpl {
|
|
|
55
59
|
}
|
|
56
60
|
return result;
|
|
57
61
|
}
|
|
62
|
+
|
|
63
|
+
private async fetchFromExternalSource(
|
|
64
|
+
customSourceId: number,
|
|
65
|
+
params?: Record<string, string>,
|
|
66
|
+
) {
|
|
67
|
+
let apiRegistry = await this.apiRegistryService.findById(customSourceId);
|
|
68
|
+
if (!apiRegistry) return [];
|
|
69
|
+
|
|
70
|
+
const url = `${apiRegistry.base_url}${apiRegistry.endpoint}`;
|
|
71
|
+
const payload = this.injectDynamicParams(apiRegistry.request_payload_schema, params);
|
|
72
|
+
|
|
73
|
+
const response = await firstValueFrom(
|
|
74
|
+
this.httpService.request({
|
|
75
|
+
url,
|
|
76
|
+
method: apiRegistry.http_method || 'POST',
|
|
77
|
+
data: payload,
|
|
78
|
+
headers: apiRegistry.headers ? apiRegistry.headers : undefined,
|
|
79
|
+
}),
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
const data = this.extractByPath(response.data, apiRegistry.response_data_path);
|
|
83
|
+
|
|
84
|
+
if (Array.isArray(data) && typeof data[0] === 'string') {
|
|
85
|
+
return data.map((item: string) => ({ label: item, value: item }));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return data.map((item: any) => ({
|
|
89
|
+
label: item[apiRegistry?.label],
|
|
90
|
+
value: item[apiRegistry?.value],
|
|
91
|
+
}));
|
|
92
|
+
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
private injectDynamicParams(payload: any, params?: Record<string, string>): any {
|
|
96
|
+
if(params) {
|
|
97
|
+
const stringified = JSON.stringify(payload);
|
|
98
|
+
const replaced = stringified.replace(/{{(.*?)}}/g, (_, key) => params[key.trim()] || '');
|
|
99
|
+
return JSON.parse(replaced);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
private extractByPath(obj: any, path: string): any {
|
|
104
|
+
if (!path || !obj) return obj;
|
|
105
|
+
|
|
106
|
+
return path.split('.').reduce((acc, key) => {
|
|
107
|
+
if (acc && typeof acc === 'object') {
|
|
108
|
+
return acc[key];
|
|
109
|
+
}
|
|
110
|
+
return undefined;
|
|
111
|
+
}, obj);
|
|
112
|
+
}
|
|
113
|
+
|
|
58
114
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { EntityTab } from './entity-tab.dto';
|
|
2
|
-
|
|
3
|
-
export class EntityListData {
|
|
4
|
-
entity_list: any;
|
|
5
|
-
entity_tabs: EntityTab[];
|
|
6
|
-
}
|
|
1
|
+
import { EntityTab } from './entity-tab.dto';
|
|
2
|
+
|
|
3
|
+
export class EntityListData {
|
|
4
|
+
entity_list: any;
|
|
5
|
+
entity_tabs: EntityTab[];
|
|
6
|
+
}
|
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
import { BaseEntity } from './base-entity.entity';
|
|
2
|
-
import { Column, Entity } from 'typeorm';
|
|
3
|
-
import { ENTITYTYPE_PREFERENCEMASTER } from '../../../constant/global.constant';
|
|
4
|
-
|
|
5
|
-
@Entity({ name: 'cr_preference_master' })
|
|
6
|
-
export class PreferenceMaster extends BaseEntity {
|
|
7
|
-
constructor() {
|
|
8
|
-
super();
|
|
9
|
-
this.entity_type = ENTITYTYPE_PREFERENCEMASTER;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
@Column({ name: 'appcode', type: 'varchar', length: 200, nullable: true })
|
|
13
|
-
appCode: string;
|
|
14
|
-
|
|
15
|
-
@Column({
|
|
16
|
-
name: 'display_name',
|
|
17
|
-
type: 'varchar',
|
|
18
|
-
length: 200,
|
|
19
|
-
nullable: true,
|
|
20
|
-
})
|
|
21
|
-
display_name: string;
|
|
22
|
-
|
|
23
|
-
@Column({
|
|
24
|
-
name: 'preference_key',
|
|
25
|
-
type: 'varchar',
|
|
26
|
-
length: 200,
|
|
27
|
-
nullable: true,
|
|
28
|
-
})
|
|
29
|
-
preference_key: string;
|
|
30
|
-
|
|
31
|
-
@Column({
|
|
32
|
-
name: 'preference_value',
|
|
33
|
-
type: 'varchar',
|
|
34
|
-
length: 200,
|
|
35
|
-
nullable: true,
|
|
36
|
-
})
|
|
37
|
-
preference_value: string;
|
|
38
|
-
|
|
39
|
-
@Column({
|
|
40
|
-
name: 'description',
|
|
41
|
-
type: 'varchar',
|
|
42
|
-
length: 2000,
|
|
43
|
-
nullable: true,
|
|
44
|
-
})
|
|
45
|
-
description: string;
|
|
46
|
-
|
|
47
|
-
@Column({ name: 'reflect_on', type: 'varchar', length: 200, nullable: true })
|
|
48
|
-
reflect_on: string;
|
|
49
|
-
|
|
50
|
-
@Column({
|
|
51
|
-
name: 'default_value',
|
|
52
|
-
type: 'varchar',
|
|
53
|
-
length: 200,
|
|
54
|
-
nullable: true,
|
|
55
|
-
})
|
|
56
|
-
default_value: string;
|
|
57
|
-
|
|
58
|
-
@Column({
|
|
59
|
-
name: 'possible_values',
|
|
60
|
-
type: 'varchar',
|
|
61
|
-
length: 200,
|
|
62
|
-
nullable: true,
|
|
63
|
-
})
|
|
64
|
-
possible_values: string;
|
|
65
|
-
}
|
|
1
|
+
import { BaseEntity } from './base-entity.entity';
|
|
2
|
+
import { Column, Entity } from 'typeorm';
|
|
3
|
+
import { ENTITYTYPE_PREFERENCEMASTER } from '../../../constant/global.constant';
|
|
4
|
+
|
|
5
|
+
@Entity({ name: 'cr_preference_master' })
|
|
6
|
+
export class PreferenceMaster extends BaseEntity {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.entity_type = ENTITYTYPE_PREFERENCEMASTER;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@Column({ name: 'appcode', type: 'varchar', length: 200, nullable: true })
|
|
13
|
+
appCode: string;
|
|
14
|
+
|
|
15
|
+
@Column({
|
|
16
|
+
name: 'display_name',
|
|
17
|
+
type: 'varchar',
|
|
18
|
+
length: 200,
|
|
19
|
+
nullable: true,
|
|
20
|
+
})
|
|
21
|
+
display_name: string;
|
|
22
|
+
|
|
23
|
+
@Column({
|
|
24
|
+
name: 'preference_key',
|
|
25
|
+
type: 'varchar',
|
|
26
|
+
length: 200,
|
|
27
|
+
nullable: true,
|
|
28
|
+
})
|
|
29
|
+
preference_key: string;
|
|
30
|
+
|
|
31
|
+
@Column({
|
|
32
|
+
name: 'preference_value',
|
|
33
|
+
type: 'varchar',
|
|
34
|
+
length: 200,
|
|
35
|
+
nullable: true,
|
|
36
|
+
})
|
|
37
|
+
preference_value: string;
|
|
38
|
+
|
|
39
|
+
@Column({
|
|
40
|
+
name: 'description',
|
|
41
|
+
type: 'varchar',
|
|
42
|
+
length: 2000,
|
|
43
|
+
nullable: true,
|
|
44
|
+
})
|
|
45
|
+
description: string;
|
|
46
|
+
|
|
47
|
+
@Column({ name: 'reflect_on', type: 'varchar', length: 200, nullable: true })
|
|
48
|
+
reflect_on: string;
|
|
49
|
+
|
|
50
|
+
@Column({
|
|
51
|
+
name: 'default_value',
|
|
52
|
+
type: 'varchar',
|
|
53
|
+
length: 200,
|
|
54
|
+
nullable: true,
|
|
55
|
+
})
|
|
56
|
+
default_value: string;
|
|
57
|
+
|
|
58
|
+
@Column({
|
|
59
|
+
name: 'possible_values',
|
|
60
|
+
type: 'varchar',
|
|
61
|
+
length: 200,
|
|
62
|
+
nullable: true,
|
|
63
|
+
})
|
|
64
|
+
possible_values: string;
|
|
65
|
+
}
|
|
@@ -12,11 +12,8 @@ export class ViewMaster extends BaseEntity {
|
|
|
12
12
|
@Column({ length: 50, nullable: true })
|
|
13
13
|
mapped_entity_type: string;
|
|
14
14
|
|
|
15
|
-
@Column({
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
@Column({nullable: true})
|
|
19
|
-
section_information: string;
|
|
15
|
+
@Column({ length: 50, nullable: true })
|
|
16
|
+
identifier: string;
|
|
20
17
|
|
|
21
18
|
@Column({nullable: true})
|
|
22
19
|
description: string;
|
|
@@ -23,6 +23,7 @@ import { MediaData } from './entity/media-data.entity';
|
|
|
23
23
|
import { MediaDataService } from './service/media-data.service';
|
|
24
24
|
import { MediaDataRepository } from './repository/media-data.repository';
|
|
25
25
|
import { MediaController } from './controller/media.controller';
|
|
26
|
+
import { ViewMaster } from './entity/view-master.entity';
|
|
26
27
|
|
|
27
28
|
@Module({
|
|
28
29
|
imports: [
|
|
@@ -32,7 +33,8 @@ import { MediaController } from './controller/media.controller';
|
|
|
32
33
|
PreferenceMaster,
|
|
33
34
|
EntityTable,
|
|
34
35
|
EntityTableColumn,
|
|
35
|
-
MediaData
|
|
36
|
+
MediaData,
|
|
37
|
+
ViewMaster,
|
|
36
38
|
]),
|
|
37
39
|
UtilsModule,
|
|
38
40
|
],
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { Injectable } from '@nestjs/common';
|
|
2
|
-
import { InjectRepository } from '@nestjs/typeorm';
|
|
3
|
-
import { PreferenceMaster } from '../entity/preference.entity';
|
|
4
|
-
import { Repository } from 'typeorm';
|
|
5
|
-
|
|
6
|
-
@Injectable()
|
|
7
|
-
export class PreferenceRepository {
|
|
8
|
-
constructor(
|
|
9
|
-
@InjectRepository(PreferenceMaster)
|
|
10
|
-
private readonly preferenceRepository: Repository<PreferenceMaster>,
|
|
11
|
-
) {}
|
|
12
|
-
|
|
13
|
-
async findByPreferenceKey(
|
|
14
|
-
preferenceKey: string,
|
|
15
|
-
): Promise<PreferenceMaster | null> {
|
|
16
|
-
return await this.preferenceRepository.findOne({
|
|
17
|
-
where: { preference_key: preferenceKey },
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
}
|
|
1
|
+
import { Injectable } from '@nestjs/common';
|
|
2
|
+
import { InjectRepository } from '@nestjs/typeorm';
|
|
3
|
+
import { PreferenceMaster } from '../entity/preference.entity';
|
|
4
|
+
import { Repository } from 'typeorm';
|
|
5
|
+
|
|
6
|
+
@Injectable()
|
|
7
|
+
export class PreferenceRepository {
|
|
8
|
+
constructor(
|
|
9
|
+
@InjectRepository(PreferenceMaster)
|
|
10
|
+
private readonly preferenceRepository: Repository<PreferenceMaster>,
|
|
11
|
+
) {}
|
|
12
|
+
|
|
13
|
+
async findByPreferenceKey(
|
|
14
|
+
preferenceKey: string,
|
|
15
|
+
): Promise<PreferenceMaster | null> {
|
|
16
|
+
return await this.preferenceRepository.findOne({
|
|
17
|
+
where: { preference_key: preferenceKey },
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Injectable } from "@nestjs/common";
|
|
2
|
+
import { InjectRepository } from "@nestjs/typeorm";
|
|
3
|
+
import { ViewMaster } from "../entity/view-master.entity";
|
|
4
|
+
import { Repository } from "typeorm";
|
|
5
|
+
import { ClockIDGenService } from "src/utils/service/clockIDGenUtil.service";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@Injectable()
|
|
10
|
+
export class UpdateFormJsonService {
|
|
11
|
+
constructor(
|
|
12
|
+
@InjectRepository(ViewMaster)
|
|
13
|
+
private readonly viewMasterRepository: Repository<ViewMaster>,
|
|
14
|
+
private readonly clockIDGenService: ClockIDGenService,
|
|
15
|
+
|
|
16
|
+
) {}
|
|
17
|
+
|
|
18
|
+
async updateFormJson(body:any): Promise<ViewMaster> {
|
|
19
|
+
|
|
20
|
+
const entityType = this.clockIDGenService.idGenerator();
|
|
21
|
+
|
|
22
|
+
const newViewMasterRecord = ({})
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
return this.viewMasterRepository.save(newViewMasterRecord)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Controller, Get, Request, UseGuards } from '@nestjs/common';
|
|
2
|
-
import { MenuService } from '../service/menu.service';
|
|
3
|
-
import { JwtAuthGuard } from 'src/module/auth/guards/jwt.guard';
|
|
4
|
-
|
|
5
|
-
@Controller('menu')
|
|
6
|
-
export class MenuController {
|
|
7
|
-
constructor(private readonly menuService: MenuService) {}
|
|
8
|
-
|
|
9
|
-
@UseGuards(JwtAuthGuard)
|
|
10
|
-
@Get()
|
|
11
|
-
async getMenu(@Request() req) {
|
|
12
|
-
const userId = req.user.userId;
|
|
13
|
-
return this.menuService.getUserMenu(userId);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
1
|
+
import { Controller, Get, Request, UseGuards } from '@nestjs/common';
|
|
2
|
+
import { MenuService } from '../service/menu.service';
|
|
3
|
+
import { JwtAuthGuard } from 'src/module/auth/guards/jwt.guard';
|
|
4
|
+
|
|
5
|
+
@Controller('menu')
|
|
6
|
+
export class MenuController {
|
|
7
|
+
constructor(private readonly menuService: MenuService) {}
|
|
8
|
+
|
|
9
|
+
@UseGuards(JwtAuthGuard)
|
|
10
|
+
@Get()
|
|
11
|
+
async getMenu(@Request() req) {
|
|
12
|
+
const userId = req.user.userId;
|
|
13
|
+
return this.menuService.getUserMenu(userId);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
|
|
2
|
-
|
|
3
|
-
@Entity({ name: 'cr_module_access' })
|
|
4
|
-
export class ModuleAccess {
|
|
5
|
-
@PrimaryGeneratedColumn()
|
|
6
|
-
id: number;
|
|
7
|
-
|
|
8
|
-
@Column({type: 'varchar', length: 100, nullable: true})
|
|
9
|
-
module_code: string;
|
|
10
|
-
|
|
11
|
-
@Column({type: 'varchar', length: 100, nullable: true })
|
|
12
|
-
role_code: string;
|
|
13
|
-
|
|
14
|
-
@Column({type: 'int', nullable: true })
|
|
15
|
-
access_flag: number;
|
|
16
|
-
|
|
17
|
-
@Column({type: 'varchar', length: 100, nullable: true })
|
|
18
|
-
action_type: string;
|
|
19
|
-
|
|
20
|
-
@Column({type: 'varchar', length: 100, nullable: true})
|
|
21
|
-
app_code: string;
|
|
22
|
-
}
|
|
1
|
+
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
|
|
2
|
+
|
|
3
|
+
@Entity({ name: 'cr_module_access' })
|
|
4
|
+
export class ModuleAccess {
|
|
5
|
+
@PrimaryGeneratedColumn()
|
|
6
|
+
id: number;
|
|
7
|
+
|
|
8
|
+
@Column({type: 'varchar', length: 100, nullable: true})
|
|
9
|
+
module_code: string;
|
|
10
|
+
|
|
11
|
+
@Column({type: 'varchar', length: 100, nullable: true })
|
|
12
|
+
role_code: string;
|
|
13
|
+
|
|
14
|
+
@Column({type: 'int', nullable: true })
|
|
15
|
+
access_flag: number;
|
|
16
|
+
|
|
17
|
+
@Column({type: 'varchar', length: 100, nullable: true })
|
|
18
|
+
action_type: string;
|
|
19
|
+
|
|
20
|
+
@Column({type: 'varchar', length: 100, nullable: true})
|
|
21
|
+
app_code: string;
|
|
22
|
+
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
|
|
2
|
-
|
|
3
|
-
@Entity({ name: 'module_action' })
|
|
4
|
-
export class ModuleAction {
|
|
5
|
-
@PrimaryGeneratedColumn()
|
|
6
|
-
id: number;
|
|
7
|
-
|
|
8
|
-
@Column({type: 'int', nullable: true})
|
|
9
|
-
module_id: number;
|
|
10
|
-
|
|
11
|
-
@Column({type: 'varchar', length: 100, nullable: true })
|
|
12
|
-
module_code: string;
|
|
13
|
-
|
|
14
|
-
@Column({type: 'varchar', length: 100, nullable: true })
|
|
15
|
-
action_name:string
|
|
16
|
-
|
|
17
|
-
@Column({type: 'varchar', length: 50, nullable: true })
|
|
18
|
-
action_type: string;
|
|
19
|
-
}
|
|
1
|
+
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
|
|
2
|
+
|
|
3
|
+
@Entity({ name: 'module_action' })
|
|
4
|
+
export class ModuleAction {
|
|
5
|
+
@PrimaryGeneratedColumn()
|
|
6
|
+
id: number;
|
|
7
|
+
|
|
8
|
+
@Column({type: 'int', nullable: true})
|
|
9
|
+
module_id: number;
|
|
10
|
+
|
|
11
|
+
@Column({type: 'varchar', length: 100, nullable: true })
|
|
12
|
+
module_code: string;
|
|
13
|
+
|
|
14
|
+
@Column({type: 'varchar', length: 100, nullable: true })
|
|
15
|
+
action_name:string
|
|
16
|
+
|
|
17
|
+
@Column({type: 'varchar', length: 50, nullable: true })
|
|
18
|
+
action_type: string;
|
|
19
|
+
}
|
|
@@ -199,6 +199,7 @@ export class ModuleAccessRepository {
|
|
|
199
199
|
role: {
|
|
200
200
|
id: savedRole.id,
|
|
201
201
|
name: savedRole.name,
|
|
202
|
+
status: savedRole.status,
|
|
202
203
|
code: savedRole.code,
|
|
203
204
|
},
|
|
204
205
|
};
|
|
@@ -250,6 +251,7 @@ export class ModuleAccessRepository {
|
|
|
250
251
|
role: {
|
|
251
252
|
id: role.id,
|
|
252
253
|
name: role.name,
|
|
254
|
+
status: role.status,
|
|
253
255
|
code: role.code,
|
|
254
256
|
},
|
|
255
257
|
};
|
|
@@ -5,39 +5,48 @@ export class ThirdPartyApiRegistry {
|
|
|
5
5
|
@PrimaryGeneratedColumn()
|
|
6
6
|
id: number;
|
|
7
7
|
|
|
8
|
-
@Column({nullable: true})
|
|
8
|
+
@Column({ nullable: true })
|
|
9
9
|
api_name: string;
|
|
10
10
|
|
|
11
|
-
@Column({nullable: true})
|
|
11
|
+
@Column({ nullable: true })
|
|
12
12
|
provider_name: string;
|
|
13
13
|
|
|
14
|
-
@Column({nullable: true})
|
|
14
|
+
@Column({ nullable: true })
|
|
15
15
|
base_url: string;
|
|
16
16
|
|
|
17
|
-
@Column({nullable: true})
|
|
17
|
+
@Column({ nullable: true })
|
|
18
18
|
endpoint: string;
|
|
19
19
|
|
|
20
|
-
@Column({nullable: true})
|
|
20
|
+
@Column({ nullable: true })
|
|
21
21
|
http_method: string;
|
|
22
22
|
|
|
23
|
-
@Column({type: 'json', nullable: true})
|
|
24
|
-
headers: string
|
|
23
|
+
@Column({ type: 'json', nullable: true })
|
|
24
|
+
headers: Record<string, string>;
|
|
25
25
|
|
|
26
|
-
@Column({nullable: true})
|
|
27
|
-
request_payload_schema: string
|
|
26
|
+
@Column({ nullable: true, type: 'json' })
|
|
27
|
+
request_payload_schema: Record<string, any>;
|
|
28
28
|
|
|
29
|
-
@Column({nullable: true})
|
|
29
|
+
@Column({ nullable: true })
|
|
30
|
+
response_data_path: string;
|
|
31
|
+
|
|
32
|
+
@Column({ nullable: true })
|
|
30
33
|
auth_type: string;
|
|
31
34
|
|
|
32
|
-
@Column({nullable: true, type: 'json'})
|
|
35
|
+
@Column({ nullable: true, type: 'json' })
|
|
33
36
|
auth_config: string;
|
|
34
37
|
|
|
35
|
-
@Column({nullable: true})
|
|
38
|
+
@Column({ nullable: true })
|
|
36
39
|
is_active: number;
|
|
37
40
|
|
|
38
|
-
@Column({nullable: true, type: 'datetime'})
|
|
39
|
-
created_date:
|
|
41
|
+
@Column({ nullable: true, type: 'datetime' })
|
|
42
|
+
created_date: Date;
|
|
40
43
|
|
|
41
|
-
@Column({nullable: true, type: 'datetime'})
|
|
44
|
+
@Column({ nullable: true, type: 'datetime' })
|
|
42
45
|
modified_date: Date;
|
|
46
|
+
|
|
47
|
+
@Column({ nullable: true})
|
|
48
|
+
label: string;
|
|
49
|
+
|
|
50
|
+
@Column({ nullable: true })
|
|
51
|
+
value: string;
|
|
43
52
|
}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Body,
|
|
3
|
-
Controller,
|
|
4
|
-
HttpStatus,
|
|
5
|
-
Inject,
|
|
6
|
-
Post,
|
|
7
|
-
Res,
|
|
8
|
-
ValidationPipe,
|
|
9
|
-
} from '@nestjs/common';
|
|
10
|
-
import { UserService } from '../service/user.service';
|
|
11
|
-
import { CreateUserDto } from '../dto/create-user.dto';
|
|
12
|
-
import { Response } from 'express';
|
|
13
|
-
|
|
14
|
-
@Controller('user')
|
|
15
|
-
export class UserController {
|
|
16
|
-
constructor(
|
|
17
|
-
@Inject('UserService') private readonly userService: UserService,
|
|
18
|
-
) {}
|
|
19
|
-
|
|
20
|
-
@Post('signup')
|
|
21
|
-
async signup(
|
|
22
|
-
@Body(new ValidationPipe()) createUserDto: CreateUserDto,
|
|
23
|
-
@Res() res: Response,
|
|
24
|
-
) {
|
|
25
|
-
const result = await this.userService.createEntity(createUserDto, null);
|
|
26
|
-
res.status(HttpStatus.OK).json(result);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
Body,
|
|
3
|
+
Controller,
|
|
4
|
+
HttpStatus,
|
|
5
|
+
Inject,
|
|
6
|
+
Post,
|
|
7
|
+
Res,
|
|
8
|
+
ValidationPipe,
|
|
9
|
+
} from '@nestjs/common';
|
|
10
|
+
import { UserService } from '../service/user.service';
|
|
11
|
+
import { CreateUserDto } from '../dto/create-user.dto';
|
|
12
|
+
import { Response } from 'express';
|
|
13
|
+
|
|
14
|
+
@Controller('user')
|
|
15
|
+
export class UserController {
|
|
16
|
+
constructor(
|
|
17
|
+
@Inject('UserService') private readonly userService: UserService,
|
|
18
|
+
) {}
|
|
19
|
+
|
|
20
|
+
@Post('signup')
|
|
21
|
+
async signup(
|
|
22
|
+
@Body(new ValidationPipe()) createUserDto: CreateUserDto,
|
|
23
|
+
@Res() res: Response,
|
|
24
|
+
) {
|
|
25
|
+
const result = await this.userService.createEntity(createUserDto, null);
|
|
26
|
+
res.status(HttpStatus.OK).json(result);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PartialType } from '@nestjs/mapped-types';
|
|
2
|
-
import { CreateUserDto } from './create-user.dto';
|
|
3
|
-
|
|
4
|
-
export class UpdateUserDto extends PartialType(CreateUserDto) {}
|
|
1
|
+
import { PartialType } from '@nestjs/mapped-types';
|
|
2
|
+
import { CreateUserDto } from './create-user.dto';
|
|
3
|
+
|
|
4
|
+
export class UpdateUserDto extends PartialType(CreateUserDto) {}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
|
|
2
|
-
|
|
3
|
-
@Entity({ name: 'cr_user_role_mapping' })
|
|
4
|
-
export class UserRoleMapping {
|
|
5
|
-
constructor(user_id: number, role_id: number) {
|
|
6
|
-
this.user_id = user_id;
|
|
7
|
-
this.role_id = role_id;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
@PrimaryGeneratedColumn()
|
|
11
|
-
id: number;
|
|
12
|
-
|
|
13
|
-
@Column({ type: 'bigint', nullable: true })
|
|
14
|
-
user_id: number;
|
|
15
|
-
|
|
16
|
-
@Column({ type: 'bigint', nullable: true })
|
|
17
|
-
role_id: number;
|
|
18
|
-
|
|
19
|
-
@Column({ type: 'int', nullable: true })
|
|
20
|
-
is_default: number;
|
|
21
|
-
}
|
|
1
|
+
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
|
|
2
|
+
|
|
3
|
+
@Entity({ name: 'cr_user_role_mapping' })
|
|
4
|
+
export class UserRoleMapping {
|
|
5
|
+
constructor(user_id: number, role_id: number) {
|
|
6
|
+
this.user_id = user_id;
|
|
7
|
+
this.role_id = role_id;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@PrimaryGeneratedColumn()
|
|
11
|
+
id: number;
|
|
12
|
+
|
|
13
|
+
@Column({ type: 'bigint', nullable: true })
|
|
14
|
+
user_id: number;
|
|
15
|
+
|
|
16
|
+
@Column({ type: 'bigint', nullable: true })
|
|
17
|
+
role_id: number;
|
|
18
|
+
|
|
19
|
+
@Column({ type: 'int', nullable: true })
|
|
20
|
+
is_default: number;
|
|
21
|
+
}
|