@hedhog/admin 0.0.104 → 0.0.105
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +141 -141
- package/dist/admin.module.js +7 -7
- package/dist/admin.module.js.map +1 -1
- package/dist/auth/auth.service.d.ts +1 -1
- package/dist/auth/auth.service.d.ts.map +1 -1
- package/dist/auth/auth.service.js +8 -8
- package/dist/auth/auth.service.js.map +1 -1
- package/dist/auth/auth.service.spec.js +16 -16
- package/dist/auth/auth.service.spec.js.map +1 -1
- package/dist/dto/with-locale.dto.d.ts +4 -0
- package/dist/dto/with-locale.dto.d.ts.map +1 -0
- package/dist/dto/{with-locales.dto.js → with-locale.dto.js} +5 -5
- package/dist/dto/with-locale.dto.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/locale/locale.controller.js +1 -1
- package/dist/locale/locale.controller.js.map +1 -1
- package/dist/locale/locale.middleware.d.ts +1 -1
- package/dist/locale/locale.middleware.d.ts.map +1 -1
- package/dist/locale/locale.middleware.js +2 -2
- package/dist/locale/locale.middleware.js.map +1 -1
- package/dist/locale/locale.service.d.ts +6 -6
- package/dist/locale/locale.service.d.ts.map +1 -1
- package/dist/locale/locale.service.js +40 -40
- package/dist/locale/locale.service.js.map +1 -1
- package/dist/locale/locale.service.spec.js +14 -14
- package/dist/locale/locale.service.spec.js.map +1 -1
- package/dist/menu/menu.controller.js +3 -3
- package/dist/menu/menu.controller.js.map +1 -1
- package/dist/menu/menu.service.d.ts +3 -3
- package/dist/menu/menu.service.d.ts.map +1 -1
- package/dist/menu/menu.service.js +35 -35
- package/dist/menu/menu.service.js.map +1 -1
- package/dist/menu/menu.service.spec.js +33 -37
- package/dist/menu/menu.service.spec.js.map +1 -1
- package/dist/role/dto/create.dto.d.ts +2 -2
- package/dist/role/dto/create.dto.d.ts.map +1 -1
- package/dist/role/dto/create.dto.js +2 -2
- package/dist/role/dto/create.dto.js.map +1 -1
- package/dist/role/guards/role.guard.js +4 -4
- package/dist/role/guards/role.guard.js.map +1 -1
- package/dist/role/role.controller.js +7 -7
- package/dist/role/role.controller.js.map +1 -1
- package/dist/role/role.service.d.ts +2 -2
- package/dist/role/role.service.d.ts.map +1 -1
- package/dist/role/role.service.js +35 -35
- package/dist/role/role.service.js.map +1 -1
- package/dist/role/role.service.spec.d.ts +0 -1
- package/dist/role/role.service.spec.js +400 -340
- package/dist/role/role.service.spec.js.map +1 -1
- package/dist/route/route.controller.js +3 -3
- package/dist/route/route.controller.js.map +1 -1
- package/dist/route/route.service.d.ts +2 -2
- package/dist/route/route.service.d.ts.map +1 -1
- package/dist/route/route.service.js +18 -18
- package/dist/route/route.service.js.map +1 -1
- package/dist/route/route.service.spec.js +27 -27
- package/dist/route/route.service.spec.js.map +1 -1
- package/dist/screen/screen.controller.js +4 -4
- package/dist/screen/screen.controller.js.map +1 -1
- package/dist/screen/screen.service.d.ts +2 -2
- package/dist/screen/screen.service.d.ts.map +1 -1
- package/dist/screen/screen.service.js +16 -16
- package/dist/screen/screen.service.js.map +1 -1
- package/dist/screen/screen.service.spec.js +16 -16
- package/dist/screen/screen.service.spec.js.map +1 -1
- package/dist/setting/dto/setting.dto.d.ts +9 -0
- package/dist/setting/dto/setting.dto.d.ts.map +1 -0
- package/dist/setting/dto/{settings.dto.js → setting.dto.js} +6 -6
- package/dist/setting/dto/setting.dto.js.map +1 -0
- package/dist/setting/{settings.controller.d.ts → setting.controller.d.ts} +6 -6
- package/dist/setting/setting.controller.d.ts.map +1 -0
- package/dist/setting/{settings.controller.js → setting.controller.js} +20 -20
- package/dist/setting/setting.controller.js.map +1 -0
- package/dist/setting/setting.module.d.ts +3 -0
- package/dist/setting/setting.module.d.ts.map +1 -0
- package/dist/setting/{settings.module.js → setting.module.js} +6 -6
- package/dist/setting/setting.module.js.map +1 -0
- package/dist/setting/{settings.service.d.ts → setting.service.d.ts} +4 -4
- package/dist/setting/setting.service.d.ts.map +1 -0
- package/dist/setting/{settings.service.js → setting.service.js} +42 -42
- package/dist/setting/setting.service.js.map +1 -0
- package/dist/setting/setting.service.spec.d.ts +2 -0
- package/dist/setting/setting.service.spec.d.ts.map +1 -0
- package/dist/setting/{settings.service.spec.js → setting.service.spec.js} +17 -17
- package/dist/setting/setting.service.spec.js.map +1 -0
- package/dist/user/user.controller.js +3 -3
- package/dist/user/user.controller.js.map +1 -1
- package/dist/user/user.service.d.ts +2 -2
- package/dist/user/user.service.d.ts.map +1 -1
- package/dist/user/user.service.js +9 -9
- package/dist/user/user.service.js.map +1 -1
- package/dist/user/user.service.spec.js +24 -24
- package/dist/user/user.service.spec.js.map +1 -1
- package/package.json +2 -2
- package/src/admin.module.ts +36 -0
- package/src/auth/auth.controller.ts +48 -0
- package/src/auth/auth.module.ts +39 -0
- package/src/auth/auth.service.spec.ts +196 -0
- package/src/auth/auth.service.ts +175 -0
- package/src/auth/decorators/public.decorator.ts +4 -0
- package/src/auth/decorators/user.decorator.ts +17 -0
- package/src/auth/dto/forget.dto.ts +6 -0
- package/src/auth/dto/login.dto.ts +15 -0
- package/src/auth/dto/otp.dto.ts +11 -0
- package/src/auth/enums/multifactor-type.enum.ts +4 -0
- package/src/auth/guards/auth.guard.ts +50 -0
- package/src/auth/types/user.type.ts +8 -0
- package/src/dto/delete.dto.ts +8 -0
- package/src/dto/update-ids.dto.ts +9 -0
- package/src/dto/with-locale.dto.ts +8 -0
- package/src/index.ts +34 -0
- package/src/locale/dto/create.dto.ts +12 -0
- package/src/locale/dto/delete.dto.ts +8 -0
- package/src/locale/dto/set-enabled.dto.ts +9 -0
- package/src/locale/dto/update.dto.ts +15 -0
- package/src/locale/index.ts +4 -0
- package/src/locale/locale.controller.ts +79 -0
- package/src/locale/locale.decorator.ts +8 -0
- package/src/locale/locale.middleware.ts +34 -0
- package/src/locale/locale.module.ts +23 -0
- package/src/locale/locale.service.spec.ts +193 -0
- package/src/locale/locale.service.ts +366 -0
- package/src/menu/dto/create.dto.ts +25 -0
- package/src/menu/dto/order.dto.ts +8 -0
- package/src/menu/dto/update.dto.ts +19 -0
- package/src/menu/menu.controller.ts +106 -0
- package/src/menu/menu.module.ts +18 -0
- package/src/menu/menu.service.spec.ts +247 -0
- package/src/menu/menu.service.ts +263 -0
- package/src/role/decorators/role.decorator.ts +4 -0
- package/src/role/dto/create.dto.ts +7 -0
- package/src/role/dto/update.dto.ts +4 -0
- package/src/role/guards/role.guard.ts +122 -0
- package/src/role/role.controller.ts +126 -0
- package/src/role/role.module.ts +28 -0
- package/src/role/role.service.spec.ts +417 -0
- package/src/role/role.service.ts +302 -0
- package/src/route/dto/create.dto.ts +13 -0
- package/src/route/dto/update.dto.ts +15 -0
- package/src/route/route.controller.ts +91 -0
- package/src/route/route.module.ts +18 -0
- package/src/route/route.service.spec.ts +299 -0
- package/src/route/route.service.ts +164 -0
- package/src/screen/dto/create.dto.ts +19 -0
- package/src/screen/dto/update.dto.ts +19 -0
- package/src/screen/screen.controller.ts +93 -0
- package/src/screen/screen.module.ts +18 -0
- package/src/screen/screen.service.spec.ts +298 -0
- package/src/screen/screen.service.ts +181 -0
- package/src/setting/dto/create.dto.ts +1 -0
- package/src/setting/dto/setting-user.dto.ts +6 -0
- package/src/setting/dto/setting.dto.ts +17 -0
- package/src/setting/dto/update.dto.ts +3 -0
- package/src/setting/setting.controller.ts +100 -0
- package/src/setting/setting.module.ts +18 -0
- package/src/setting/setting.service.spec.ts +183 -0
- package/src/setting/setting.service.ts +346 -0
- package/src/types/http-method.ts +8 -0
- package/src/user/constants/user.constants.ts +1 -0
- package/src/user/dto/create.dto.ts +24 -0
- package/src/user/dto/update.dto.ts +41 -0
- package/src/user/user.controller.ts +75 -0
- package/src/user/user.module.ts +18 -0
- package/src/user/user.service.spec.ts +294 -0
- package/src/user/user.service.ts +129 -0
- package/tsconfig.lib.json +9 -0
- package/tsconfig.production.json +20 -0
- package/dist/dto/with-locales.dto.d.ts +0 -4
- package/dist/dto/with-locales.dto.d.ts.map +0 -1
- package/dist/dto/with-locales.dto.js.map +0 -1
- package/dist/setting/dto/settings.dto.d.ts +0 -9
- package/dist/setting/dto/settings.dto.d.ts.map +0 -1
- package/dist/setting/dto/settings.dto.js.map +0 -1
- package/dist/setting/settings.controller.d.ts.map +0 -1
- package/dist/setting/settings.controller.js.map +0 -1
- package/dist/setting/settings.module.d.ts +0 -3
- package/dist/setting/settings.module.d.ts.map +0 -1
- package/dist/setting/settings.module.js.map +0 -1
- package/dist/setting/settings.service.d.ts.map +0 -1
- package/dist/setting/settings.service.js.map +0 -1
- package/dist/setting/settings.service.spec.d.ts +0 -2
- package/dist/setting/settings.service.spec.d.ts.map +0 -1
- package/dist/setting/settings.service.spec.js.map +0 -1
@@ -0,0 +1,294 @@
|
|
1
|
+
import {
|
2
|
+
PageOrderDirection,
|
3
|
+
PaginationDTO,
|
4
|
+
PaginationService,
|
5
|
+
} from '@hedhog/pagination';
|
6
|
+
import { PrismaService } from '@hedhog/prisma';
|
7
|
+
import { BadRequestException } from '@nestjs/common';
|
8
|
+
import { Test, TestingModule } from '@nestjs/testing';
|
9
|
+
import { genSalt, hash } from 'bcrypt';
|
10
|
+
import { DeleteDTO } from '../dto/delete.dto';
|
11
|
+
import { UpdateIdsDTO } from '../dto/update-ids.dto';
|
12
|
+
import { SALT_ROUNDS } from './constants/user.constants';
|
13
|
+
import { CreateDTO } from './dto/create.dto';
|
14
|
+
import { UpdateDTO } from './dto/update.dto';
|
15
|
+
import { UserService } from './user.service';
|
16
|
+
|
17
|
+
jest.mock('bcrypt', () => ({
|
18
|
+
genSalt: jest.fn().mockResolvedValue('mockSalt'),
|
19
|
+
hash: jest.fn().mockResolvedValue('mockHashedPassword'),
|
20
|
+
}));
|
21
|
+
|
22
|
+
describe('UserService', () => {
|
23
|
+
let service: UserService;
|
24
|
+
let prismaService: PrismaService;
|
25
|
+
let paginationService: PaginationService;
|
26
|
+
|
27
|
+
beforeEach(async () => {
|
28
|
+
const module: TestingModule = await Test.createTestingModule({
|
29
|
+
providers: [
|
30
|
+
UserService,
|
31
|
+
{
|
32
|
+
provide: PrismaService,
|
33
|
+
useValue: {
|
34
|
+
user: {
|
35
|
+
findUnique: jest.fn(),
|
36
|
+
create: jest.fn(),
|
37
|
+
update: jest.fn(),
|
38
|
+
deleteMany: jest.fn(),
|
39
|
+
},
|
40
|
+
role_user: {
|
41
|
+
deleteMany: jest.fn(),
|
42
|
+
createMany: jest.fn(),
|
43
|
+
},
|
44
|
+
createInsensitiveSearch: jest.fn(),
|
45
|
+
},
|
46
|
+
},
|
47
|
+
{
|
48
|
+
provide: PaginationService,
|
49
|
+
useValue: {
|
50
|
+
paginate: jest.fn(),
|
51
|
+
},
|
52
|
+
},
|
53
|
+
],
|
54
|
+
}).compile();
|
55
|
+
|
56
|
+
service = module.get<UserService>(UserService);
|
57
|
+
prismaService = module.get<PrismaService>(PrismaService);
|
58
|
+
paginationService = module.get<PaginationService>(PaginationService);
|
59
|
+
});
|
60
|
+
|
61
|
+
it('should be defined', () => {
|
62
|
+
expect(service).toBeDefined();
|
63
|
+
});
|
64
|
+
|
65
|
+
describe('listRoles', () => {
|
66
|
+
it('should return paginated role for a specific user', async () => {
|
67
|
+
const paginationParams: PaginationDTO = {
|
68
|
+
page: 1,
|
69
|
+
pageSize: 10,
|
70
|
+
search: '',
|
71
|
+
sortField: '',
|
72
|
+
sortOrder: PageOrderDirection.Asc,
|
73
|
+
fields: '',
|
74
|
+
};
|
75
|
+
|
76
|
+
const mockPaginatedRoles = {
|
77
|
+
data: [],
|
78
|
+
total: 10,
|
79
|
+
lastPage: 1,
|
80
|
+
page: 1,
|
81
|
+
prev: 0,
|
82
|
+
next: 2,
|
83
|
+
pageSize: 10,
|
84
|
+
};
|
85
|
+
|
86
|
+
jest
|
87
|
+
.spyOn(paginationService, 'paginate')
|
88
|
+
.mockResolvedValue(mockPaginatedRoles);
|
89
|
+
|
90
|
+
const result = await service.listRoles(1, paginationParams);
|
91
|
+
|
92
|
+
expect(paginationService.paginate).toHaveBeenCalledWith(
|
93
|
+
prismaService.role,
|
94
|
+
paginationParams,
|
95
|
+
{
|
96
|
+
include: {
|
97
|
+
role_user: {
|
98
|
+
where: { user_id: 1 },
|
99
|
+
select: { user_id: true, role_id: true },
|
100
|
+
},
|
101
|
+
},
|
102
|
+
},
|
103
|
+
);
|
104
|
+
expect(result).toEqual(mockPaginatedRoles);
|
105
|
+
});
|
106
|
+
});
|
107
|
+
|
108
|
+
describe('updateRoles', () => {
|
109
|
+
it('should update user role', async () => {
|
110
|
+
const updateIdsDTO: UpdateIdsDTO = { ids: [1, 2] };
|
111
|
+
|
112
|
+
jest
|
113
|
+
.spyOn(prismaService.role_user, 'deleteMany')
|
114
|
+
.mockResolvedValue({ count: 1 });
|
115
|
+
jest
|
116
|
+
.spyOn(prismaService.role_user, 'createMany')
|
117
|
+
.mockResolvedValue({ count: 2 });
|
118
|
+
|
119
|
+
await service.updateRoles(1, updateIdsDTO);
|
120
|
+
|
121
|
+
expect(prismaService.role_user.deleteMany).toHaveBeenCalledWith({
|
122
|
+
where: { user_id: 1 },
|
123
|
+
});
|
124
|
+
expect(prismaService.role_user.createMany).toHaveBeenCalledWith({
|
125
|
+
data: [
|
126
|
+
{ user_id: 1, role_id: 1 },
|
127
|
+
{ user_id: 1, role_id: 2 },
|
128
|
+
],
|
129
|
+
skipDuplicates: true,
|
130
|
+
});
|
131
|
+
});
|
132
|
+
});
|
133
|
+
|
134
|
+
describe('getUsers', () => {
|
135
|
+
it('should return paginated user', async () => {
|
136
|
+
const paginationParams: PaginationDTO = {
|
137
|
+
page: 1,
|
138
|
+
pageSize: 10,
|
139
|
+
search: '',
|
140
|
+
sortField: '',
|
141
|
+
sortOrder: PageOrderDirection.Asc,
|
142
|
+
fields: '',
|
143
|
+
};
|
144
|
+
|
145
|
+
const mockPaginatedUsers = {
|
146
|
+
data: [],
|
147
|
+
total: 10,
|
148
|
+
lastPage: 1,
|
149
|
+
page: 1,
|
150
|
+
prev: 0,
|
151
|
+
next: 2,
|
152
|
+
pageSize: 10,
|
153
|
+
};
|
154
|
+
|
155
|
+
jest.spyOn(prismaService, 'createInsensitiveSearch').mockReturnValue([]);
|
156
|
+
jest
|
157
|
+
.spyOn(paginationService, 'paginate')
|
158
|
+
.mockResolvedValue(mockPaginatedUsers);
|
159
|
+
|
160
|
+
const result = await service.getUsers(paginationParams);
|
161
|
+
|
162
|
+
expect(prismaService.createInsensitiveSearch).toHaveBeenCalledWith(
|
163
|
+
['name', 'email'],
|
164
|
+
paginationParams,
|
165
|
+
);
|
166
|
+
expect(paginationService.paginate).toHaveBeenCalledWith(
|
167
|
+
prismaService.user,
|
168
|
+
paginationParams,
|
169
|
+
{ where: { OR: [] } },
|
170
|
+
);
|
171
|
+
expect(result).toEqual(mockPaginatedUsers);
|
172
|
+
});
|
173
|
+
});
|
174
|
+
|
175
|
+
describe('get', () => {
|
176
|
+
it('should return a specific user by ID', async () => {
|
177
|
+
const mockUser = {
|
178
|
+
id: 1,
|
179
|
+
name: 'Test User',
|
180
|
+
email: 'user@email.com',
|
181
|
+
password: 'hashedpassword',
|
182
|
+
created_at: new Date(),
|
183
|
+
updated_at: new Date(),
|
184
|
+
multifactor_id: null,
|
185
|
+
code: null,
|
186
|
+
};
|
187
|
+
jest.spyOn(prismaService.user, 'findUnique').mockResolvedValue(mockUser);
|
188
|
+
|
189
|
+
const result = await service.get(1);
|
190
|
+
|
191
|
+
expect(prismaService.user.findUnique).toHaveBeenCalledWith({
|
192
|
+
where: { id: 1 },
|
193
|
+
});
|
194
|
+
expect(result).toEqual(mockUser);
|
195
|
+
});
|
196
|
+
});
|
197
|
+
|
198
|
+
describe('hashPassword', () => {
|
199
|
+
it('should hash the password correctly', async () => {
|
200
|
+
const password = 'plainPassword';
|
201
|
+
const result = await service.hashPassword(password);
|
202
|
+
|
203
|
+
expect(genSalt).toHaveBeenCalledWith(SALT_ROUNDS);
|
204
|
+
expect(hash).toHaveBeenCalledWith(password, 'mockSalt');
|
205
|
+
expect(result).toEqual('mockHashedPassword');
|
206
|
+
});
|
207
|
+
});
|
208
|
+
|
209
|
+
describe('create', () => {
|
210
|
+
it('should create a new user with hashed password', async () => {
|
211
|
+
const createDTO: CreateDTO = {
|
212
|
+
email: 'test@test.com',
|
213
|
+
name: 'Test User',
|
214
|
+
password: 'password123',
|
215
|
+
};
|
216
|
+
const mockUser = {
|
217
|
+
id: 1,
|
218
|
+
name: 'Test User',
|
219
|
+
email: 'user@email.com',
|
220
|
+
password: 'hashedpassword',
|
221
|
+
created_at: new Date(),
|
222
|
+
updated_at: new Date(),
|
223
|
+
multifactor_id: null,
|
224
|
+
code: null,
|
225
|
+
};
|
226
|
+
|
227
|
+
jest.spyOn(prismaService.user, 'create').mockResolvedValue(mockUser);
|
228
|
+
|
229
|
+
const result = await service.create(createDTO);
|
230
|
+
|
231
|
+
expect(prismaService.user.create).toHaveBeenCalledWith({
|
232
|
+
data: {
|
233
|
+
email: createDTO.email,
|
234
|
+
name: createDTO.name,
|
235
|
+
password: 'mockHashedPassword',
|
236
|
+
},
|
237
|
+
});
|
238
|
+
expect(result).toEqual(mockUser);
|
239
|
+
});
|
240
|
+
});
|
241
|
+
|
242
|
+
describe('update', () => {
|
243
|
+
it('should update an existing user', async () => {
|
244
|
+
const updateDTO: UpdateDTO = { name: 'Updated User' };
|
245
|
+
const updateInput = { id: 1, data: updateDTO };
|
246
|
+
const mockUser = {
|
247
|
+
id: 1,
|
248
|
+
name: 'Updated User',
|
249
|
+
email: 'user@email.com',
|
250
|
+
password: 'hashedpassword',
|
251
|
+
created_at: new Date(),
|
252
|
+
updated_at: new Date(),
|
253
|
+
multifactor_id: null,
|
254
|
+
code: null,
|
255
|
+
};
|
256
|
+
jest.spyOn(prismaService.user, 'update').mockResolvedValue(mockUser);
|
257
|
+
|
258
|
+
const result = await service.update(updateInput);
|
259
|
+
|
260
|
+
expect(prismaService.user.update).toHaveBeenCalledWith({
|
261
|
+
where: { id: updateInput.id },
|
262
|
+
data: updateInput.data,
|
263
|
+
});
|
264
|
+
expect(result).toEqual(mockUser);
|
265
|
+
});
|
266
|
+
});
|
267
|
+
|
268
|
+
describe('delete', () => {
|
269
|
+
it('should throw an error if no ids are provided', async () => {
|
270
|
+
const deleteDTO: DeleteDTO = { ids: null };
|
271
|
+
|
272
|
+
await expect(service.delete(deleteDTO)).rejects.toThrow(
|
273
|
+
new BadRequestException('You must select at least one user to delete.'),
|
274
|
+
);
|
275
|
+
});
|
276
|
+
|
277
|
+
it('should delete user by ids', async () => {
|
278
|
+
const deleteDTO: DeleteDTO = { ids: [1, 2] };
|
279
|
+
|
280
|
+
jest
|
281
|
+
.spyOn(prismaService.user, 'deleteMany')
|
282
|
+
.mockResolvedValue({ count: 2 });
|
283
|
+
|
284
|
+
await service.delete(deleteDTO);
|
285
|
+
|
286
|
+
expect(prismaService.user.deleteMany).toHaveBeenCalledWith({
|
287
|
+
where: {
|
288
|
+
id: { in: deleteDTO.ids },
|
289
|
+
email: { not: { startsWith: 'root@' } },
|
290
|
+
},
|
291
|
+
});
|
292
|
+
});
|
293
|
+
});
|
294
|
+
});
|
@@ -0,0 +1,129 @@
|
|
1
|
+
import { PaginationDTO, PaginationService } from '@hedhog/pagination';
|
2
|
+
import { PrismaService } from '@hedhog/prisma';
|
3
|
+
import {
|
4
|
+
BadRequestException,
|
5
|
+
Inject,
|
6
|
+
Injectable,
|
7
|
+
forwardRef,
|
8
|
+
} from '@nestjs/common';
|
9
|
+
import { genSalt, hash } from 'bcrypt';
|
10
|
+
import { DeleteDTO } from '../dto/delete.dto';
|
11
|
+
import { UpdateIdsDTO } from '../dto/update-ids.dto';
|
12
|
+
import { SALT_ROUNDS } from './constants/user.constants';
|
13
|
+
import { CreateDTO } from './dto/create.dto';
|
14
|
+
import { UpdateDTO } from './dto/update.dto';
|
15
|
+
|
16
|
+
@Injectable()
|
17
|
+
export class UserService {
|
18
|
+
constructor(
|
19
|
+
@Inject(forwardRef(() => PrismaService))
|
20
|
+
private readonly prismaService: PrismaService,
|
21
|
+
@Inject(forwardRef(() => PaginationService))
|
22
|
+
private readonly paginationService: PaginationService,
|
23
|
+
) {}
|
24
|
+
|
25
|
+
async listRoles(userId: number, paginationParams: PaginationDTO) {
|
26
|
+
return this.paginationService.paginate(
|
27
|
+
this.prismaService.role,
|
28
|
+
paginationParams,
|
29
|
+
{
|
30
|
+
include: {
|
31
|
+
role_user: {
|
32
|
+
where: {
|
33
|
+
user_id: userId,
|
34
|
+
},
|
35
|
+
select: {
|
36
|
+
user_id: true,
|
37
|
+
role_id: true,
|
38
|
+
},
|
39
|
+
},
|
40
|
+
},
|
41
|
+
},
|
42
|
+
);
|
43
|
+
}
|
44
|
+
|
45
|
+
async updateRoles(userId: number, { ids }: UpdateIdsDTO) {
|
46
|
+
await this.prismaService.role_user.deleteMany({
|
47
|
+
where: {
|
48
|
+
user_id: userId,
|
49
|
+
},
|
50
|
+
});
|
51
|
+
|
52
|
+
return this.prismaService.role_user.createMany({
|
53
|
+
data: ids.map((role) => {
|
54
|
+
return {
|
55
|
+
user_id: userId,
|
56
|
+
role_id: role,
|
57
|
+
};
|
58
|
+
}),
|
59
|
+
skipDuplicates: true,
|
60
|
+
});
|
61
|
+
}
|
62
|
+
|
63
|
+
async getUsers(paginationParams: PaginationDTO) {
|
64
|
+
const fields = ['name', 'email'];
|
65
|
+
const OR = this.prismaService.createInsensitiveSearch(
|
66
|
+
fields,
|
67
|
+
paginationParams,
|
68
|
+
);
|
69
|
+
|
70
|
+
return this.paginationService.paginate(
|
71
|
+
this.prismaService.user,
|
72
|
+
paginationParams,
|
73
|
+
{
|
74
|
+
where: {
|
75
|
+
OR,
|
76
|
+
},
|
77
|
+
},
|
78
|
+
);
|
79
|
+
}
|
80
|
+
|
81
|
+
async get(userId: number) {
|
82
|
+
return this.prismaService.user.findUnique({ where: { id: userId } });
|
83
|
+
}
|
84
|
+
|
85
|
+
async hashPassword(password: string): Promise<string> {
|
86
|
+
const salt = await genSalt(SALT_ROUNDS);
|
87
|
+
return hash(password, salt);
|
88
|
+
}
|
89
|
+
|
90
|
+
async create({ email, name, password }: CreateDTO) {
|
91
|
+
const hashedPassword = await this.hashPassword(password);
|
92
|
+
|
93
|
+
return this.prismaService.user.create({
|
94
|
+
data: {
|
95
|
+
email,
|
96
|
+
name,
|
97
|
+
password: hashedPassword,
|
98
|
+
},
|
99
|
+
});
|
100
|
+
}
|
101
|
+
|
102
|
+
async update({ id, data }: { id: number; data: UpdateDTO }) {
|
103
|
+
return this.prismaService.user.update({
|
104
|
+
where: { id },
|
105
|
+
data,
|
106
|
+
});
|
107
|
+
}
|
108
|
+
|
109
|
+
async delete({ ids }: DeleteDTO) {
|
110
|
+
if (ids == undefined || ids == null) {
|
111
|
+
throw new BadRequestException(
|
112
|
+
`You must select at least one user to delete.`,
|
113
|
+
);
|
114
|
+
}
|
115
|
+
|
116
|
+
return this.prismaService.user.deleteMany({
|
117
|
+
where: {
|
118
|
+
id: {
|
119
|
+
in: ids,
|
120
|
+
},
|
121
|
+
email: {
|
122
|
+
not: {
|
123
|
+
startsWith: 'root@',
|
124
|
+
},
|
125
|
+
},
|
126
|
+
},
|
127
|
+
});
|
128
|
+
}
|
129
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
"experimentalDecorators": true,
|
4
|
+
"target": "es2017",
|
5
|
+
"module": "commonjs",
|
6
|
+
"lib": ["es2017", "es7", "es6"],
|
7
|
+
"declaration": true,
|
8
|
+
"declarationMap": true,
|
9
|
+
"sourceMap": true,
|
10
|
+
"outDir": "./dist",
|
11
|
+
"rootDir": "./src",
|
12
|
+
"strict": true,
|
13
|
+
"noImplicitAny": false,
|
14
|
+
"strictNullChecks": false,
|
15
|
+
"allowSyntheticDefaultImports": true,
|
16
|
+
"esModuleInterop": true,
|
17
|
+
"emitDecoratorMetadata": true
|
18
|
+
},
|
19
|
+
"exclude": ["node_modules", "dist", "src/migrations"]
|
20
|
+
}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"with-locales.dto.d.ts","sourceRoot":"","sources":["../../src/dto/with-locales.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,cAAc;IAIzB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"with-locales.dto.js","sourceRoot":"","sources":["../../src/dto/with-locales.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAuE;AAEvE,MAAa,cAAc;CAK1B;AALD,wCAKC;AADC;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;+CACC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"settings.dto.d.ts","sourceRoot":"","sources":["../../../src/setting/dto/settings.dto.ts"],"names":[],"mappings":"AAGA,cAAM,OAAO;IAEX,IAAI,EAAE,MAAM,CAAC;IAGb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,qBAAa,WAAW;IAItB,QAAQ,EAAE,OAAO,EAAE,CAAC;CACrB"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"settings.dto.js","sourceRoot":"","sources":["../../../src/setting/dto/settings.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAoE;AACpE,yDAAyC;AAEzC,MAAM,OAAO;CAMZ;AAJC;IADC,IAAA,0BAAQ,GAAE;;qCACE;AAGb;IADC,IAAA,0BAAQ,GAAE;;sCACG;AAGhB,MAAa,WAAW;CAKvB;AALD,kCAKC;AADC;IAHC,IAAA,yBAAO,GAAE;IACT,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,OAAO,CAAC;;6CACA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"settings.controller.d.ts","sourceRoot":"","sources":["../../src/setting/settings.controller.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAG9C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,qBAEa,kBAAkB;IAG3B,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAAf,eAAe,EAAE,eAAe;IAI7C,mBAAmB,CACT,gBAAgB,KAAA,EACpB,MAAM,KAAA,EACD,IAAI,EAAE,MAAM;IAUvB,gBAAgB,CAAe,gBAAgB,KAAA,EAAY,MAAM,KAAA;IAKjE,WAAW,CAAe,gBAAgB,KAAA,EAAY,MAAM,KAAA;IAK5D,IAAI,CAAmC,SAAS,EAAE,MAAM;IAK9D,MAAM,CAAS,IAAI,EAAE,SAAS;IAKxB,kBAAkB,CACP,IAAI,EAAE,MAAM,EACnB,EAAE,KAAK,EAAE,EAAE,cAAc,EACzB,EAAE,EAAE,EAAE;;KAAA;IAMV,cAAc,CAAgB,IAAI,EAAE,MAAM,EAAU,IAAI,EAAE,SAAS;IAKnE,eAAe,CAAS,IAAI,EAAE,WAAW;;;IAKzC,MAAM,CACwB,SAAS,EAAE,MAAM,EAC3C,IAAI,EAAE,SAAS;IASnB,MAAM,CAAS,IAAI,EAAE,SAAS;CAGrC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"settings.controller.js","sourceRoot":"","sources":["../../src/setting/settings.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAgD;AAChD,2CAYwB;AACxB,sEAAyD;AACzD,kDAA8C;AAC9C,sCAAmC;AACnC,sEAAyD;AACzD,iDAA6C;AAC7C,6DAAwD;AACxD,qDAAiD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,OAAO,CAAC;IACS,WAAA,IAAA,cAAK,EAAC,MAAM,CAAC,CAAA;IAAgB,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAO,sBAAS;;wDAExE;AAGK;IADL,IAAA,YAAG,GAAE;IACiB,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAO,0BAAW;;yDAE9C;AAGK;IADL,IAAA,cAAK,EAAC,YAAY,CAAC;IAEjB,WAAA,IAAA,cAAK,EAAC,WAAW,EAAE,qBAAY,CAAC,CAAA;IAChC,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAO,sBAAS;;gDAMxB;AAGK;IADL,IAAA,eAAM,GAAE;IACK,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAO,sBAAS;;gDAEnC;6BAxEU,kBAAkB;IAF9B,IAAA,qBAAI,GAAE;IACN,IAAA,mBAAU,EAAC,UAAU,CAAC;IAGlB,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,kCAAe,CAAC,CAAC,CAAA;qCACR,kCAAe;GAHxC,kBAAkB,CAyE9B"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"settings.module.d.ts","sourceRoot":"","sources":["../../src/setting/settings.module.ts"],"names":[],"mappings":"AAOA,qBAUa,aAAa;CAAG"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"settings.module.js","sourceRoot":"","sources":["../../src/setting/settings.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,mDAAsD;AACtD,2CAA8C;AAC9C,2CAAoD;AACpD,+DAA2D;AAC3D,yDAAqD;AACrD,qDAAiD;AAY1C,IAAM,aAAa,GAAnB,MAAM,aAAa;CAAG,CAAA;AAAhB,sCAAa;wBAAb,aAAa;IAVzB,IAAA,eAAM,EAAC;QACN,SAAS,EAAE,CAAC,kCAAe,CAAC;QAC5B,OAAO,EAAE,CAAC,kCAAe,CAAC;QAC1B,WAAW,EAAE,CAAC,wCAAkB,CAAC;QACjC,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CAAC,CAAC,OAAO,EAAE,EAAE;YAC/B,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC;gBAClE,OAAO,CAAC,KAAK,CAAC;QAClB,CAAC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAA;AA1UY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,sBAAa,CAAC,CAAC,CAAA;IAEvC,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,8BAAiB,CAAC,CAAC,CAAA;qCADZ,sBAAa;QAET,8BAAiB;GAL5C,eAAe,CA0U3B"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"settings.service.spec.d.ts","sourceRoot":"","sources":["../../src/setting/settings.service.spec.ts"],"names":[],"mappings":""}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"settings.service.spec.js","sourceRoot":"","sources":["../../src/setting/settings.service.spec.ts"],"names":[],"mappings":";;AAAA,mDAAuD;AACvD,2CAA+C;AAC/C,2CAAqD;AACrD,6CAAsD;AAGtD,yDAAqD;AAErD,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,IAAI,OAAwB,CAAC;IAC7B,IAAI,aAA4B,CAAC;IACjC,4CAA4C;IAE5C,UAAU,CAAC,KAAK,IAAI,EAAE;QACpB,MAAM,MAAM,GAAkB,MAAM,cAAI,CAAC,mBAAmB,CAAC;YAC3D,SAAS,EAAE;gBACT,kCAAe;gBACf;oBACE,OAAO,EAAE,sBAAa;oBACtB,QAAQ,EAAE;wBACR,QAAQ,EAAE;4BACR,UAAU,EAAE,IAAI,CAAC,EAAE,EAAE;4BACrB,MAAM,EA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