@hedhog/admin 0.0.121 → 0.0.123
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/auth/auth.controller.d.ts +10 -1
- package/dist/auth/auth.controller.d.ts.map +1 -1
- package/dist/auth/auth.controller.js +6 -6
- package/dist/auth/auth.controller.js.map +1 -1
- package/dist/auth/auth.service.d.ts +10 -1
- package/dist/auth/auth.service.d.ts.map +1 -1
- package/dist/auth/guards/auth.guard.js +2 -2
- package/dist/auth/guards/auth.guard.js.map +1 -1
- package/dist/menu/dto/create.dto.d.ts +1 -1
- package/dist/menu/dto/create.dto.js +3 -3
- package/dist/menu/menu.controller.d.ts +33 -6
- package/dist/menu/menu.controller.d.ts.map +1 -1
- package/dist/menu/menu.controller.js +5 -5
- package/dist/menu/menu.controller.js.map +1 -1
- package/dist/menu/menu.service.d.ts +33 -6
- package/dist/menu/menu.service.d.ts.map +1 -1
- package/dist/menu/menu.service.js +4 -4
- package/dist/menu/menu.service.js.map +1 -1
- package/dist/menu/menu.service.spec.d.ts +0 -1
- package/dist/menu/menu.service.spec.js +206 -190
- package/dist/menu/menu.service.spec.js.map +1 -1
- package/dist/role/guards/role.guard.js +3 -3
- package/dist/role/guards/role.guard.js.map +1 -1
- package/dist/role/role.controller.d.ts +5 -5
- package/dist/role/role.controller.js +4 -4
- package/dist/role/role.controller.js.map +1 -1
- package/dist/role/role.service.d.ts +7 -7
- package/dist/role/role.service.d.ts.map +1 -1
- package/dist/role/role.service.js +8 -4
- package/dist/role/role.service.js.map +1 -1
- package/dist/route/route.controller.d.ts +27 -6
- package/dist/route/route.controller.d.ts.map +1 -1
- package/dist/route/route.controller.js +2 -2
- package/dist/route/route.controller.js.map +1 -1
- package/dist/route/route.service.d.ts +27 -6
- package/dist/route/route.service.d.ts.map +1 -1
- package/dist/route/route.service.spec.d.ts +0 -1
- package/dist/route/route.service.spec.js +260 -249
- package/dist/route/route.service.spec.js.map +1 -1
- package/dist/screen/dto/create.dto.d.ts +0 -2
- package/dist/screen/dto/create.dto.d.ts.map +1 -1
- package/dist/screen/dto/create.dto.js +0 -10
- package/dist/screen/dto/create.dto.js.map +1 -1
- package/dist/screen/screen.controller.d.ts +24 -6
- package/dist/screen/screen.controller.d.ts.map +1 -1
- package/dist/screen/screen.controller.js +2 -2
- package/dist/screen/screen.controller.js.map +1 -1
- package/dist/screen/screen.service.d.ts +24 -6
- package/dist/screen/screen.service.d.ts.map +1 -1
- package/dist/screen/screen.service.js +1 -3
- package/dist/screen/screen.service.js.map +1 -1
- package/dist/screen/screen.service.spec.d.ts +0 -1
- package/dist/screen/screen.service.spec.js +257 -240
- package/dist/screen/screen.service.spec.js.map +1 -1
- package/dist/user/user.controller.d.ts +32 -5
- package/dist/user/user.controller.d.ts.map +1 -1
- package/dist/user/user.controller.js +2 -2
- package/dist/user/user.controller.js.map +1 -1
- package/dist/user/user.service.d.ts +32 -5
- package/dist/user/user.service.d.ts.map +1 -1
- package/hedhog.yaml +5 -5
- package/package.json +3 -3
- package/src/auth/auth.controller.ts +1 -1
- package/src/auth/guards/auth.guard.ts +1 -1
- package/src/menu/dto/create.dto.ts +3 -3
- package/src/menu/menu.controller.ts +3 -3
- package/src/menu/menu.service.spec.ts +247 -247
- package/src/menu/menu.service.ts +3 -3
- package/src/role/guards/role.guard.ts +1 -1
- package/src/role/role.controller.ts +3 -3
- package/src/role/role.service.ts +8 -21
- package/src/route/route.controller.ts +1 -1
- package/src/route/route.service.spec.ts +300 -300
- package/src/screen/dto/create.dto.ts +0 -8
- package/src/screen/screen.controller.ts +1 -1
- package/src/screen/screen.service.spec.ts +298 -298
- package/src/screen/screen.service.ts +1 -3
- package/src/user/user.controller.ts +1 -1
@@ -1,242 +1,259 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
2
|
+
// import {
|
3
|
+
// PageOrderDirection,
|
4
|
+
// PaginationDTO,
|
5
|
+
// PaginationService,
|
6
|
+
// } from '@hedhog/pagination';
|
7
|
+
// import { PrismaService } from '@hedhog/prisma';
|
8
|
+
// import { BadRequestException } from '@nestjs/common';
|
9
|
+
// import { Test, TestingModule } from '@nestjs/testing';
|
10
|
+
// import { DeleteDTO } from '../dto/delete.dto';
|
11
|
+
// import { UpdateIdsDTO } from '../dto/update-ids.dto';
|
12
|
+
// import { ScreenService } from './screen.service';
|
13
|
+
// describe('ScreenService', () => {
|
14
|
+
// let service: ScreenService;
|
15
|
+
// let prismaService: PrismaService;
|
16
|
+
// let paginationService: PaginationService;
|
17
|
+
// beforeEach(async () => {
|
18
|
+
// const module: TestingModule = await Test.createTestingModule({
|
19
|
+
// providers: [
|
20
|
+
// ScreenService,
|
21
|
+
// {
|
22
|
+
// provide: PrismaService,
|
23
|
+
// useValue: {
|
24
|
+
// screens: {
|
25
|
+
// create: jest.fn(),
|
26
|
+
// update: jest.fn(),
|
27
|
+
// deleteMany: jest.fn(),
|
28
|
+
// findUnique: jest.fn(),
|
29
|
+
// },
|
30
|
+
// route: {
|
31
|
+
// findMany: jest.fn(),
|
32
|
+
// },
|
33
|
+
// role_screen: {
|
34
|
+
// deleteMany: jest.fn(),
|
35
|
+
// createMany: jest.fn(),
|
36
|
+
// },
|
37
|
+
// route_screens: {
|
38
|
+
// deleteMany: jest.fn(),
|
39
|
+
// createMany: jest.fn(),
|
40
|
+
// },
|
41
|
+
// createInsensitiveSearch: jest.fn(),
|
42
|
+
// },
|
43
|
+
// },
|
44
|
+
// {
|
45
|
+
// provide: PaginationService,
|
46
|
+
// useValue: {
|
47
|
+
// paginate: jest.fn(),
|
48
|
+
// },
|
49
|
+
// },
|
50
|
+
// ],
|
51
|
+
// }).compile();
|
52
|
+
// service = module.get<ScreenService>(ScreenService);
|
53
|
+
// prismaService = module.get<PrismaService>(PrismaService);
|
54
|
+
// paginationService = module.get<PaginationService>(PaginationService);
|
55
|
+
// });
|
56
|
+
// it('should be defined', () => {
|
57
|
+
// expect(service).toBeDefined();
|
58
|
+
// });
|
59
|
+
// describe('create', () => {
|
60
|
+
// it('should create a screen', async () => {
|
61
|
+
// const createDTO = {
|
62
|
+
// name: 'Test Screen',
|
63
|
+
// slug: 'test-screen',
|
64
|
+
// description: 'This is a test screen',
|
65
|
+
// icon: 'test-icon',
|
66
|
+
// };
|
67
|
+
// jest
|
68
|
+
// .spyOn(prismaService.screens, 'create')
|
69
|
+
// .mockResolvedValue(createDTO as any);
|
70
|
+
// const result = await service.create(createDTO);
|
71
|
+
// expect(prismaService.screens.create).toHaveBeenCalledWith({
|
72
|
+
// data: createDTO,
|
73
|
+
// });
|
74
|
+
// expect(result).toEqual(createDTO);
|
75
|
+
// });
|
76
|
+
// });
|
77
|
+
// describe('delete', () => {
|
78
|
+
// it('should throw an error if no ids are provided', async () => {
|
79
|
+
// const deleteDTO: DeleteDTO = { ids: null };
|
80
|
+
// await expect(service.delete(deleteDTO)).rejects.toThrow(
|
81
|
+
// new BadRequestException(
|
82
|
+
// `You must select at least one screen to delete.`,
|
83
|
+
// ),
|
84
|
+
// );
|
85
|
+
// });
|
86
|
+
// it('should delete screens by ids', async () => {
|
87
|
+
// const deleteDTO: DeleteDTO = { ids: [1, 2] };
|
88
|
+
// jest.spyOn(prismaService.screens, 'deleteMany').mockResolvedValue({
|
89
|
+
// count: 2,
|
90
|
+
// });
|
91
|
+
// await service.delete(deleteDTO);
|
92
|
+
// expect(prismaService.screens.deleteMany).toHaveBeenCalledWith({
|
93
|
+
// where: { id: { in: deleteDTO.ids } },
|
94
|
+
// });
|
95
|
+
// });
|
96
|
+
// });
|
97
|
+
// describe('update', () => {
|
98
|
+
// it('should update a screen', async () => {
|
99
|
+
// const updateDTO = {
|
100
|
+
// id: 1,
|
101
|
+
// name: 'Updated Screen',
|
102
|
+
// slug: 'updated-screen',
|
103
|
+
// icon: 'update-icon',
|
104
|
+
// created_at: new Date(),
|
105
|
+
// updated_at: new Date(),
|
106
|
+
// };
|
107
|
+
// const updateInput = { id: 1, data: updateDTO };
|
108
|
+
// jest.spyOn(prismaService.screens, 'update').mockResolvedValue(updateDTO);
|
109
|
+
// const result = await service.update(updateInput);
|
110
|
+
// expect(prismaService.screens.update).toHaveBeenCalledWith({
|
111
|
+
// where: { id: updateInput.id },
|
112
|
+
// data: updateInput.data,
|
113
|
+
// });
|
114
|
+
// expect(result).toEqual(updateDTO);
|
115
|
+
// });
|
116
|
+
// });
|
117
|
+
// describe('get', () => {
|
118
|
+
// it('should get a screen by id', async () => {
|
119
|
+
// const screen = {
|
120
|
+
// id: 1,
|
121
|
+
// name: 'Updated Screen',
|
122
|
+
// slug: 'updated-screen',
|
123
|
+
// icon: 'update-icon',
|
124
|
+
// created_at: new Date(),
|
125
|
+
// updated_at: new Date(),
|
126
|
+
// };
|
127
|
+
// jest.spyOn(prismaService.screens, 'findUnique').mockResolvedValue(screen);
|
128
|
+
// const result = await service.get(1);
|
129
|
+
// expect(prismaService.screens.findUnique).toHaveBeenCalledWith({
|
130
|
+
// where: { id: 1 },
|
131
|
+
// });
|
132
|
+
// expect(result).toEqual(screen);
|
133
|
+
// });
|
134
|
+
// });
|
135
|
+
// describe('updateRoles', () => {
|
136
|
+
// it('should update role for a screen', async () => {
|
137
|
+
// const screenId = 1;
|
138
|
+
// const updateIdsDTO: UpdateIdsDTO = { ids: [1, 2, 3] };
|
139
|
+
// jest.spyOn(prismaService.role_screen, 'deleteMany').mockResolvedValue({
|
140
|
+
// count: 1,
|
141
|
+
// });
|
142
|
+
// jest.spyOn(prismaService.role_screen, 'createMany').mockResolvedValue({
|
143
|
+
// count: updateIdsDTO.ids.length,
|
144
|
+
// });
|
145
|
+
// await service.updateRoles(screenId, updateIdsDTO);
|
146
|
+
// expect(prismaService.role_screen.deleteMany).toHaveBeenCalledWith({
|
147
|
+
// where: { screen_id: screenId },
|
148
|
+
// });
|
149
|
+
// expect(prismaService.role_screen.createMany).toHaveBeenCalledWith({
|
150
|
+
// data: updateIdsDTO.ids.map((roleId) => ({
|
151
|
+
// screen_id: screenId,
|
152
|
+
// role_id: roleId,
|
153
|
+
// })),
|
154
|
+
// skipDuplicates: true,
|
155
|
+
// });
|
156
|
+
// });
|
157
|
+
// });
|
158
|
+
// describe('updateRoutes', () => {
|
159
|
+
// it('should delete existing route_screens and create new ones', async () => {
|
160
|
+
// const screenId = 1;
|
161
|
+
// const updateIdsDTO: UpdateIdsDTO = { ids: [1, 2, 3] };
|
162
|
+
// prismaService.route.findMany = jest
|
163
|
+
// .fn()
|
164
|
+
// .mockResolvedValue([{ id: 1 }, { id: 2 }, { id: 3 }]);
|
165
|
+
// prismaService.route_screens.deleteMany = jest.fn();
|
166
|
+
// prismaService.route_screens.createMany = jest.fn();
|
167
|
+
// await service.updateRoutes(screenId, updateIdsDTO);
|
168
|
+
// expect(prismaService.route.findMany).toHaveBeenCalledWith({
|
169
|
+
// where: { id: { in: updateIdsDTO.ids } },
|
170
|
+
// select: { id: true },
|
171
|
+
// });
|
172
|
+
// expect(prismaService.route_screens.deleteMany).toHaveBeenCalledWith({
|
173
|
+
// where: { screen_id: screenId },
|
174
|
+
// });
|
175
|
+
// expect(prismaService.route_screens.createMany).toHaveBeenCalledWith({
|
176
|
+
// data: updateIdsDTO.ids.map((routeId) => ({
|
177
|
+
// screen_id: screenId,
|
178
|
+
// route_id: routeId,
|
179
|
+
// })),
|
180
|
+
// skipDuplicates: true,
|
181
|
+
// });
|
182
|
+
// });
|
183
|
+
// });
|
184
|
+
// describe('listRoles', () => {
|
185
|
+
// it('should call paginate method with correct parameters', async () => {
|
186
|
+
// const locale = 'en';
|
187
|
+
// const screenId = 1;
|
188
|
+
// const paginationParams: PaginationDTO = {
|
189
|
+
// page: 1,
|
190
|
+
// pageSize: 10,
|
191
|
+
// search: '',
|
192
|
+
// sortField: '',
|
193
|
+
// sortOrder: PageOrderDirection.Asc,
|
194
|
+
// fields: '',
|
195
|
+
// };
|
196
|
+
// paginationService.paginate = jest.fn().mockResolvedValue({
|
197
|
+
// data: [],
|
198
|
+
// total: 0,
|
199
|
+
// });
|
200
|
+
// await service.listRoles(locale, screenId, paginationParams);
|
201
|
+
// expect(paginationService.paginate).toHaveBeenCalledWith(
|
202
|
+
// prismaService.role,
|
203
|
+
// paginationParams,
|
204
|
+
// {
|
205
|
+
// include: {
|
206
|
+
// role_screen: {
|
207
|
+
// where: {
|
208
|
+
// screen_id: screenId,
|
209
|
+
// },
|
210
|
+
// select: {
|
211
|
+
// role_id: true,
|
212
|
+
// screen_id: true,
|
213
|
+
// },
|
214
|
+
// },
|
215
|
+
// },
|
216
|
+
// },
|
217
|
+
// );
|
218
|
+
// });
|
219
|
+
// });
|
220
|
+
// describe('listRoutes', () => {
|
221
|
+
// it('should paginate the route linked to a screen', async () => {
|
222
|
+
// const paginationParams: PaginationDTO = {
|
223
|
+
// page: 1,
|
224
|
+
// pageSize: 10,
|
225
|
+
// search: '',
|
226
|
+
// sortField: '',
|
227
|
+
// sortOrder: PageOrderDirection.Asc,
|
228
|
+
// fields: '',
|
229
|
+
// };
|
230
|
+
// const screenId = 1;
|
231
|
+
// const mockPaginationResult = {
|
232
|
+
// data: [],
|
233
|
+
// total: 10,
|
234
|
+
// lastPage: 1,
|
235
|
+
// page: 1,
|
236
|
+
// prev: 0,
|
237
|
+
// next: 2,
|
238
|
+
// pageSize: 10,
|
239
|
+
// };
|
240
|
+
// jest
|
241
|
+
// .spyOn(paginationService, 'paginate')
|
242
|
+
// .mockResolvedValue(mockPaginationResult);
|
243
|
+
// await service.listRoutes(screenId, paginationParams);
|
244
|
+
// expect(paginationService.paginate).toHaveBeenCalledWith(
|
245
|
+
// prismaService.route,
|
246
|
+
// paginationParams,
|
247
|
+
// {
|
248
|
+
// include: {
|
249
|
+
// route_screens: {
|
250
|
+
// where: { screen_id: screenId },
|
251
|
+
// select: { route_id: true, screen_id: true },
|
252
|
+
// },
|
253
|
+
// },
|
254
|
+
// },
|
255
|
+
// );
|
256
|
+
// });
|
257
|
+
// });
|
258
|
+
// });
|
242
259
|
//# sourceMappingURL=screen.service.spec.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"screen.service.spec.js","sourceRoot":"","sources":["../../src/screen/screen.service.spec.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"screen.service.spec.js","sourceRoot":"","sources":["../../src/screen/screen.service.spec.ts"],"names":[],"mappings":";AAAA,WAAW;AACX,wBAAwB;AACxB,mBAAmB;AACnB,uBAAuB;AACvB,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AACf,gCAAgC;AAChC,YAAY;AACZ,UAAU;AACV,QAAQ;AAER,kCAAkC;AAClC,8EAA8E;AAC9E,6BAA6B;AAC7B,4BAA4B;AAC5B,kDAAkD;AAClD,mBAAmB;AACnB,wBAAwB;AACxB,sBAAsB;AACtB,yBAAyB;AACzB,6CAA6C;AAC7C,sBAAsB;AACtB,WAAW;AAEX,mEAAmE;AACnE,oBAAoB;AACpB,oBAAoB;AACpB,YAAY;AAEZ,qEAAqE;AAErE,iEAAiE;AACjE,8BAA8B;AAC9B,4BAA4B;AAC5B,YAAY;AACZ,uBAAuB;AACvB,6BAA6B;AAC7B,yBAAyB;AACzB,uCAAuC;AACvC,mBAAmB;AACnB,0BAA0B;AAC1B,iCAAiC;AACjC,mCAAmC;AACnC,mBAAmB;AACnB,iBAAiB;AACjB,eAAe;AACf,aAAa;AACb,WAAW;AACX,UAAU;AACV,QAAQ;AAER,mCAAmC;AACnC,uEAAuE;AACvE,kDAAkD;AAClD,mBAAmB;AACnB,wBAAwB;AACxB,sBAAsB;AACtB,yBAAyB;AACzB,6CAA6C;AAC7C,sBAAsB;AACtB,WAAW;AACX,4BAA4B;AAC5B,uCAAuC;AACvC,oBAAoB;AACpB,qBAAqB;AACrB,uBAAuB;AACvB,mBAAmB;AACnB,mBAAmB;AACnB,mBAAmB;AACnB,wBAAwB;AACxB,WAAW;AAEX,aAAa;AACb,gDAAgD;AAChD,oDAAoD;AAEpD,8DAA8D;AAE9D,iEAAiE;AACjE,+BAA+B;AAC/B,4BAA4B;AAC5B,YAAY;AACZ,uBAAuB;AACvB,+BAA+B;AAC/B,gDAAgD;AAChD,6DAA6D;AAC7D,iBAAiB;AACjB,eAAe;AACf,aAAa;AACb,WAAW;AACX,UAAU;AACV,QAAQ;AACR,MAAM"}
|
@@ -8,10 +8,37 @@ export declare class UserController {
|
|
8
8
|
constructor(userService: UserService);
|
9
9
|
list(paginationParams: any): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
|
10
10
|
listRoles(userId: number, paginationParams: any): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
|
11
|
-
updateRoles(userId: number, data: UpdateIdsDTO): Promise<
|
12
|
-
get(userId: number): Promise<
|
13
|
-
|
14
|
-
|
15
|
-
|
11
|
+
updateRoles(userId: number, data: UpdateIdsDTO): Promise<import(".prisma/client").Prisma.BatchPayload>;
|
12
|
+
get(userId: number): Promise<{
|
13
|
+
code: string | null;
|
14
|
+
name: string;
|
15
|
+
id: number;
|
16
|
+
created_at: Date;
|
17
|
+
updated_at: Date;
|
18
|
+
multifactor_id: number | null;
|
19
|
+
email: string;
|
20
|
+
password: string;
|
21
|
+
}>;
|
22
|
+
create(data: CreateDTO): Promise<{
|
23
|
+
code: string | null;
|
24
|
+
name: string;
|
25
|
+
id: number;
|
26
|
+
created_at: Date;
|
27
|
+
updated_at: Date;
|
28
|
+
multifactor_id: number | null;
|
29
|
+
email: string;
|
30
|
+
password: string;
|
31
|
+
}>;
|
32
|
+
update(userId: number, data: UpdateDTO): Promise<{
|
33
|
+
code: string | null;
|
34
|
+
name: string;
|
35
|
+
id: number;
|
36
|
+
created_at: Date;
|
37
|
+
updated_at: Date;
|
38
|
+
multifactor_id: number | null;
|
39
|
+
email: string;
|
40
|
+
password: string;
|
41
|
+
}>;
|
42
|
+
delete(data: DeleteDTO): Promise<import(".prisma/client").Prisma.BatchPayload>;
|
16
43
|
}
|
17
44
|
//# sourceMappingURL=user.controller.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"user.controller.d.ts","sourceRoot":"","sources":["../../src/user/user.controller.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,qBAEa,cAAc;IAGvB,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAAX,WAAW,EAAE,WAAW;IAIrC,IAAI,CAAe,gBAAgB,KAAA;IAKnC,SAAS,CACkB,MAAM,EAAE,MAAM,EAC/B,gBAAgB,KAAA;IAM1B,WAAW,CACgB,MAAM,EAAE,MAAM,EACrC,IAAI,EAAE,YAAY;IAMtB,GAAG,CAAgC,MAAM,EAAE,MAAM
|
1
|
+
{"version":3,"file":"user.controller.d.ts","sourceRoot":"","sources":["../../src/user/user.controller.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,qBAEa,cAAc;IAGvB,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAAX,WAAW,EAAE,WAAW;IAIrC,IAAI,CAAe,gBAAgB,KAAA;IAKnC,SAAS,CACkB,MAAM,EAAE,MAAM,EAC/B,gBAAgB,KAAA;IAM1B,WAAW,CACgB,MAAM,EAAE,MAAM,EACrC,IAAI,EAAE,YAAY;IAMtB,GAAG,CAAgC,MAAM,EAAE,MAAM;;;;;;;;;;IAKvD,MAAM,CAAS,IAAI,EAAE,SAAS;;;;;;;;;;IAKxB,MAAM,CACqB,MAAM,EAAE,MAAM,EACrC,IAAI,EAAE,SAAS;;;;;;;;;;IASnB,MAAM,CAAS,IAAI,EAAE,SAAS;CAGrC"}
|
@@ -17,7 +17,7 @@ const pagination_1 = require("@hedhog/pagination");
|
|
17
17
|
const common_1 = require("@nestjs/common");
|
18
18
|
const delete_dto_1 = require("../dto/delete.dto");
|
19
19
|
const update_ids_dto_1 = require("../dto/update-ids.dto");
|
20
|
-
const
|
20
|
+
const core_1 = require("@hedhog/core");
|
21
21
|
const create_dto_1 = require("./dto/create.dto");
|
22
22
|
const update_dto_1 = require("./dto/update.dto");
|
23
23
|
const user_service_1 = require("./user.service");
|
@@ -104,7 +104,7 @@ __decorate([
|
|
104
104
|
__metadata("design:returntype", Promise)
|
105
105
|
], UserController.prototype, "delete", null);
|
106
106
|
exports.UserController = UserController = __decorate([
|
107
|
-
(0,
|
107
|
+
(0, core_1.Role)(),
|
108
108
|
(0, common_1.Controller)('user'),
|
109
109
|
__param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => user_service_1.UserService))),
|
110
110
|
__metadata("design:paramtypes", [user_service_1.UserService])
|