@hedhog/admin 0.12.1 → 0.12.2
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/{hedhog.yaml → bkp.hedhog.yaml} +1012 -814
- package/dist/auth/consts/body.js +23 -23
- package/package.json +43 -43
- package/src/admin.module.ts +37 -37
- package/src/auth/auth.controller.ts +72 -72
- package/src/auth/auth.module.ts +39 -39
- package/src/auth/auth.service.spec.ts +196 -196
- package/src/auth/auth.service.ts +234 -234
- package/src/auth/consts/body.ts +26 -26
- package/src/auth/consts/subject.ts +1 -1
- package/src/auth/dto/forget.dto.ts +6 -6
- package/src/auth/dto/login.dto.ts +15 -15
- package/src/auth/dto/otp.dto.ts +11 -11
- package/src/auth/dto/reset.dto.ts +14 -14
- package/src/auth/enums/multifactor-type.enum.ts +4 -4
- package/src/auth/guards/auth.guard.ts +50 -50
- package/src/auth/types/user.type.ts +8 -8
- package/src/dto/delete.dto.ts +8 -8
- package/src/dto/update-ids.dto.ts +9 -9
- package/src/index.ts +20 -20
- package/src/menu/dto/create.dto.ts +25 -25
- package/src/menu/dto/order.dto.ts +8 -8
- package/src/menu/dto/update.dto.ts +19 -19
- package/src/menu/menu.controller.ts +105 -105
- package/src/menu/menu.module.ts +18 -18
- package/src/menu/menu.service.spec.ts +247 -247
- package/src/menu/menu.service.ts +263 -263
- package/src/role/dto/create.dto.ts +7 -7
- package/src/role/dto/update.dto.ts +4 -4
- package/src/role/guards/role.guard.ts +123 -123
- package/src/role/role.controller.ts +126 -126
- package/src/role/role.module.ts +28 -28
- package/src/role/role.service.spec.ts +417 -417
- package/src/role/role.service.ts +289 -289
- package/src/route/dto/create.dto.ts +13 -13
- package/src/route/dto/update.dto.ts +15 -15
- package/src/route/route.controller.ts +91 -91
- package/src/route/route.module.ts +18 -18
- package/src/route/route.service.spec.ts +300 -300
- package/src/route/route.service.ts +164 -164
- package/src/screen/dto/create.dto.ts +11 -11
- package/src/screen/dto/update.dto.ts +19 -19
- package/src/screen/screen.controller.ts +93 -93
- package/src/screen/screen.module.ts +18 -18
- package/src/screen/screen.service.spec.ts +298 -298
- package/src/screen/screen.service.ts +179 -179
- package/src/types/http-method.ts +8 -8
- package/src/user/constants/user.constants.ts +1 -1
- package/src/user/dto/create.dto.ts +24 -24
- package/src/user/dto/update.dto.ts +41 -41
- package/src/user/user.controller.ts +75 -75
- package/src/user/user.module.ts +18 -18
- package/src/user/user.service.spec.ts +294 -294
- package/src/user/user.service.ts +129 -129
@@ -1,91 +1,91 @@
|
|
1
|
-
import { Pagination, PaginationDTO } from '@hedhog/pagination';
|
2
|
-
import {
|
3
|
-
Body,
|
4
|
-
Controller,
|
5
|
-
Delete,
|
6
|
-
forwardRef,
|
7
|
-
Get,
|
8
|
-
Inject,
|
9
|
-
Param,
|
10
|
-
ParseIntPipe,
|
11
|
-
Patch,
|
12
|
-
Post,
|
13
|
-
} from '@nestjs/common';
|
14
|
-
import { DeleteDTO } from '../dto/delete.dto';
|
15
|
-
import { UpdateIdsDTO } from '../dto/update-ids.dto';
|
16
|
-
import { Locale } from '@hedhog/locale';
|
17
|
-
import { Role } from '@hedhog/core';
|
18
|
-
import { CreateDTO } from './dto/create.dto';
|
19
|
-
import { UpdateDTO } from './dto/update.dto';
|
20
|
-
import { RouteService } from './route.service';
|
21
|
-
|
22
|
-
@Role()
|
23
|
-
@Controller('route')
|
24
|
-
export class RouteController {
|
25
|
-
constructor(
|
26
|
-
@Inject(forwardRef(() => RouteService))
|
27
|
-
private readonly routeService: RouteService,
|
28
|
-
) {}
|
29
|
-
|
30
|
-
@Get()
|
31
|
-
async list(@Pagination() paginationParams) {
|
32
|
-
return this.routeService.list(paginationParams);
|
33
|
-
}
|
34
|
-
|
35
|
-
@Get(':routeId')
|
36
|
-
async get(@Param('routeId', ParseIntPipe) routeId: number) {
|
37
|
-
return this.routeService.get(routeId);
|
38
|
-
}
|
39
|
-
|
40
|
-
@Post()
|
41
|
-
async create(@Body() { url, method }: CreateDTO) {
|
42
|
-
return this.routeService.create({ url, method });
|
43
|
-
}
|
44
|
-
|
45
|
-
@Patch(':routeId')
|
46
|
-
async update(
|
47
|
-
@Param('routeId', ParseIntPipe) routeId: number,
|
48
|
-
@Body() data: UpdateDTO,
|
49
|
-
) {
|
50
|
-
return this.routeService.update({ id: routeId, data });
|
51
|
-
}
|
52
|
-
|
53
|
-
@Delete()
|
54
|
-
async delete(@Body() data: DeleteDTO) {
|
55
|
-
return this.routeService.delete(data);
|
56
|
-
}
|
57
|
-
|
58
|
-
@Get(':routeId/role')
|
59
|
-
async listRoles(
|
60
|
-
@Param('routeId', ParseIntPipe) routeId: number,
|
61
|
-
@Pagination() paginationParams: PaginationDTO,
|
62
|
-
@Locale() locale,
|
63
|
-
) {
|
64
|
-
return this.routeService.listRoles(locale, routeId, paginationParams);
|
65
|
-
}
|
66
|
-
|
67
|
-
@Patch(':routeId/role')
|
68
|
-
async updateRoles(
|
69
|
-
@Param('routeId', ParseIntPipe) routeId: number,
|
70
|
-
@Body() data: UpdateIdsDTO,
|
71
|
-
) {
|
72
|
-
return this.routeService.updateRoles(routeId, data);
|
73
|
-
}
|
74
|
-
|
75
|
-
@Get(':routeId/screens')
|
76
|
-
async listScreens(
|
77
|
-
@Param('routeId', ParseIntPipe) routeId: number,
|
78
|
-
@Pagination() paginationParams: PaginationDTO,
|
79
|
-
@Locale() locale,
|
80
|
-
) {
|
81
|
-
return this.routeService.listScreens(locale, routeId, paginationParams);
|
82
|
-
}
|
83
|
-
|
84
|
-
@Patch(':routeId/screens')
|
85
|
-
async updateScreens(
|
86
|
-
@Param('routeId', ParseIntPipe) routeId: number,
|
87
|
-
@Body() data: UpdateIdsDTO,
|
88
|
-
) {
|
89
|
-
return this.routeService.updateScreens(routeId, data);
|
90
|
-
}
|
91
|
-
}
|
1
|
+
import { Pagination, PaginationDTO } from '@hedhog/pagination';
|
2
|
+
import {
|
3
|
+
Body,
|
4
|
+
Controller,
|
5
|
+
Delete,
|
6
|
+
forwardRef,
|
7
|
+
Get,
|
8
|
+
Inject,
|
9
|
+
Param,
|
10
|
+
ParseIntPipe,
|
11
|
+
Patch,
|
12
|
+
Post,
|
13
|
+
} from '@nestjs/common';
|
14
|
+
import { DeleteDTO } from '../dto/delete.dto';
|
15
|
+
import { UpdateIdsDTO } from '../dto/update-ids.dto';
|
16
|
+
import { Locale } from '@hedhog/locale';
|
17
|
+
import { Role } from '@hedhog/core';
|
18
|
+
import { CreateDTO } from './dto/create.dto';
|
19
|
+
import { UpdateDTO } from './dto/update.dto';
|
20
|
+
import { RouteService } from './route.service';
|
21
|
+
|
22
|
+
@Role()
|
23
|
+
@Controller('route')
|
24
|
+
export class RouteController {
|
25
|
+
constructor(
|
26
|
+
@Inject(forwardRef(() => RouteService))
|
27
|
+
private readonly routeService: RouteService,
|
28
|
+
) {}
|
29
|
+
|
30
|
+
@Get()
|
31
|
+
async list(@Pagination() paginationParams) {
|
32
|
+
return this.routeService.list(paginationParams);
|
33
|
+
}
|
34
|
+
|
35
|
+
@Get(':routeId')
|
36
|
+
async get(@Param('routeId', ParseIntPipe) routeId: number) {
|
37
|
+
return this.routeService.get(routeId);
|
38
|
+
}
|
39
|
+
|
40
|
+
@Post()
|
41
|
+
async create(@Body() { url, method }: CreateDTO) {
|
42
|
+
return this.routeService.create({ url, method });
|
43
|
+
}
|
44
|
+
|
45
|
+
@Patch(':routeId')
|
46
|
+
async update(
|
47
|
+
@Param('routeId', ParseIntPipe) routeId: number,
|
48
|
+
@Body() data: UpdateDTO,
|
49
|
+
) {
|
50
|
+
return this.routeService.update({ id: routeId, data });
|
51
|
+
}
|
52
|
+
|
53
|
+
@Delete()
|
54
|
+
async delete(@Body() data: DeleteDTO) {
|
55
|
+
return this.routeService.delete(data);
|
56
|
+
}
|
57
|
+
|
58
|
+
@Get(':routeId/role')
|
59
|
+
async listRoles(
|
60
|
+
@Param('routeId', ParseIntPipe) routeId: number,
|
61
|
+
@Pagination() paginationParams: PaginationDTO,
|
62
|
+
@Locale() locale,
|
63
|
+
) {
|
64
|
+
return this.routeService.listRoles(locale, routeId, paginationParams);
|
65
|
+
}
|
66
|
+
|
67
|
+
@Patch(':routeId/role')
|
68
|
+
async updateRoles(
|
69
|
+
@Param('routeId', ParseIntPipe) routeId: number,
|
70
|
+
@Body() data: UpdateIdsDTO,
|
71
|
+
) {
|
72
|
+
return this.routeService.updateRoles(routeId, data);
|
73
|
+
}
|
74
|
+
|
75
|
+
@Get(':routeId/screens')
|
76
|
+
async listScreens(
|
77
|
+
@Param('routeId', ParseIntPipe) routeId: number,
|
78
|
+
@Pagination() paginationParams: PaginationDTO,
|
79
|
+
@Locale() locale,
|
80
|
+
) {
|
81
|
+
return this.routeService.listScreens(locale, routeId, paginationParams);
|
82
|
+
}
|
83
|
+
|
84
|
+
@Patch(':routeId/screens')
|
85
|
+
async updateScreens(
|
86
|
+
@Param('routeId', ParseIntPipe) routeId: number,
|
87
|
+
@Body() data: UpdateIdsDTO,
|
88
|
+
) {
|
89
|
+
return this.routeService.updateScreens(routeId, data);
|
90
|
+
}
|
91
|
+
}
|
@@ -1,18 +1,18 @@
|
|
1
|
-
import { PaginationModule } from '@hedhog/pagination';
|
2
|
-
import { PrismaModule } from '@hedhog/prisma';
|
3
|
-
import { Module, forwardRef } from '@nestjs/common';
|
4
|
-
import { RouteController } from './route.controller';
|
5
|
-
import { RouteService } from './route.service';
|
6
|
-
import { AuthModule } from '../auth/auth.module';
|
7
|
-
|
8
|
-
@Module({
|
9
|
-
providers: [RouteService],
|
10
|
-
exports: [RouteService],
|
11
|
-
controllers: [RouteController],
|
12
|
-
imports: [
|
13
|
-
forwardRef(() => AuthModule),
|
14
|
-
forwardRef(() => PrismaModule),
|
15
|
-
forwardRef(() => PaginationModule),
|
16
|
-
],
|
17
|
-
})
|
18
|
-
export class RouteModule {}
|
1
|
+
import { PaginationModule } from '@hedhog/pagination';
|
2
|
+
import { PrismaModule } from '@hedhog/prisma';
|
3
|
+
import { Module, forwardRef } from '@nestjs/common';
|
4
|
+
import { RouteController } from './route.controller';
|
5
|
+
import { RouteService } from './route.service';
|
6
|
+
import { AuthModule } from '../auth/auth.module';
|
7
|
+
|
8
|
+
@Module({
|
9
|
+
providers: [RouteService],
|
10
|
+
exports: [RouteService],
|
11
|
+
controllers: [RouteController],
|
12
|
+
imports: [
|
13
|
+
forwardRef(() => AuthModule),
|
14
|
+
forwardRef(() => PrismaModule),
|
15
|
+
forwardRef(() => PaginationModule),
|
16
|
+
],
|
17
|
+
})
|
18
|
+
export class RouteModule {}
|