@flusys/nestjs-auth 5.0.3 → 5.1.0
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/cjs/controllers/user-permission.controller.js +2 -2
- package/cjs/controllers/user.controller.js +5 -8
- package/fesm/controllers/user-permission.controller.js +3 -3
- package/fesm/controllers/user.controller.js +6 -9
- package/fesm/services/branch.service.js +1 -1
- package/fesm/services/company.service.js +1 -1
- package/package.json +3 -3
- package/services/branch.service.d.ts +4 -4
- package/services/company.service.d.ts +3 -3
- package/services/user.service.d.ts +2 -2
|
@@ -9,9 +9,9 @@ Object.defineProperty(exports, "UserPermissionController", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _nestjsshared = require("@flusys/nestjs-shared");
|
|
12
|
-
const _config = require("../config");
|
|
13
12
|
const _common = require("@nestjs/common");
|
|
14
13
|
const _swagger = require("@nestjs/swagger");
|
|
14
|
+
const _config = require("../config");
|
|
15
15
|
const _userpermissiondto = require("../dtos/user-permission.dto");
|
|
16
16
|
const _usercompanypermissionentity = require("../entities/user-company-permission.entity");
|
|
17
17
|
const _userpermissionservice = require("../services/user-permission.service");
|
|
@@ -214,7 +214,7 @@ UserPermissionController = _ts_decorate([
|
|
|
214
214
|
(0, _swagger.ApiTags)('User Permissions'),
|
|
215
215
|
(0, _swagger.ApiBearerAuth)(),
|
|
216
216
|
(0, _common.Controller)('administration/permissions'),
|
|
217
|
-
(0, _common.UseGuards)(_nestjsshared.JwtAuthGuard),
|
|
217
|
+
(0, _common.UseGuards)(_nestjsshared.JwtAuthGuard, _nestjsshared.PermissionGuard),
|
|
218
218
|
_ts_param(0, (0, _common.Inject)(_userpermissionservice.UserPermissionService)),
|
|
219
219
|
_ts_metadata("design:type", Function),
|
|
220
220
|
_ts_metadata("design:paramtypes", [
|
|
@@ -9,12 +9,12 @@ Object.defineProperty(exports, "UserController", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _classes = require("@flusys/nestjs-shared/classes");
|
|
12
|
-
const _config = require("../config");
|
|
13
12
|
const _decorators = require("@flusys/nestjs-shared/decorators");
|
|
14
13
|
const _guards = require("@flusys/nestjs-shared/guards");
|
|
15
14
|
const _interfaces = require("@flusys/nestjs-shared/interfaces");
|
|
16
15
|
const _common = require("@nestjs/common");
|
|
17
16
|
const _swagger = require("@nestjs/swagger");
|
|
17
|
+
const _config = require("../config");
|
|
18
18
|
const _userdto = require("../dtos/user.dto");
|
|
19
19
|
const _userservice = require("../services/user.service");
|
|
20
20
|
function _define_property(obj, key, value) {
|
|
@@ -176,7 +176,7 @@ let UserController = class UserController extends (0, _classes.createApiControll
|
|
|
176
176
|
};
|
|
177
177
|
_ts_decorate([
|
|
178
178
|
(0, _common.Post)(':id/profile-extras'),
|
|
179
|
-
(0, _common.UseGuards)(_guards.JwtAuthGuard),
|
|
179
|
+
(0, _common.UseGuards)(_guards.JwtAuthGuard, _guards.PermissionGuard),
|
|
180
180
|
(0, _swagger.ApiBearerAuth)(),
|
|
181
181
|
(0, _decorators.RequirePermission)(_classes.USER_PERMISSIONS.READ),
|
|
182
182
|
(0, _swagger.ApiOperation)({
|
|
@@ -198,7 +198,7 @@ _ts_decorate([
|
|
|
198
198
|
], UserController.prototype, "getProfileWithExtras", null);
|
|
199
199
|
_ts_decorate([
|
|
200
200
|
(0, _common.Post)(':id/verify-email'),
|
|
201
|
-
(0, _common.UseGuards)(_guards.JwtAuthGuard),
|
|
201
|
+
(0, _common.UseGuards)(_guards.JwtAuthGuard, _guards.PermissionGuard),
|
|
202
202
|
(0, _swagger.ApiBearerAuth)(),
|
|
203
203
|
(0, _decorators.RequirePermission)(_classes.USER_PERMISSIONS.UPDATE),
|
|
204
204
|
(0, _swagger.ApiOperation)({
|
|
@@ -217,7 +217,7 @@ _ts_decorate([
|
|
|
217
217
|
], UserController.prototype, "verifyEmail", null);
|
|
218
218
|
_ts_decorate([
|
|
219
219
|
(0, _common.Post)(':id/verify-phone'),
|
|
220
|
-
(0, _common.UseGuards)(_guards.JwtAuthGuard),
|
|
220
|
+
(0, _common.UseGuards)(_guards.JwtAuthGuard, _guards.PermissionGuard),
|
|
221
221
|
(0, _swagger.ApiBearerAuth)(),
|
|
222
222
|
(0, _decorators.RequirePermission)(_classes.USER_PERMISSIONS.UPDATE),
|
|
223
223
|
(0, _swagger.ApiOperation)({
|
|
@@ -236,7 +236,7 @@ _ts_decorate([
|
|
|
236
236
|
], UserController.prototype, "verifyPhone", null);
|
|
237
237
|
_ts_decorate([
|
|
238
238
|
(0, _common.Post)(':id/status'),
|
|
239
|
-
(0, _common.UseGuards)(_guards.JwtAuthGuard),
|
|
239
|
+
(0, _common.UseGuards)(_guards.JwtAuthGuard, _guards.PermissionGuard),
|
|
240
240
|
(0, _swagger.ApiBearerAuth)(),
|
|
241
241
|
(0, _decorators.RequirePermission)(_classes.USER_PERMISSIONS.UPDATE),
|
|
242
242
|
(0, _swagger.ApiOperation)({
|
|
@@ -301,7 +301,6 @@ _ts_decorate([
|
|
|
301
301
|
(0, _common.Post)(':id/profile-section/:sectionId'),
|
|
302
302
|
(0, _common.UseGuards)(_guards.JwtAuthGuard),
|
|
303
303
|
(0, _swagger.ApiBearerAuth)(),
|
|
304
|
-
(0, _decorators.RequirePermission)(_classes.USER_PERMISSIONS.READ),
|
|
305
304
|
(0, _swagger.ApiOperation)({
|
|
306
305
|
summary: 'Get profile section data',
|
|
307
306
|
description: 'Returns data for a specific profile section.'
|
|
@@ -329,7 +328,6 @@ _ts_decorate([
|
|
|
329
328
|
(0, _common.Post)(':id/profile-section/:sectionId/update'),
|
|
330
329
|
(0, _common.UseGuards)(_guards.JwtAuthGuard),
|
|
331
330
|
(0, _swagger.ApiBearerAuth)(),
|
|
332
|
-
(0, _decorators.RequirePermission)(_classes.USER_PERMISSIONS.UPDATE),
|
|
333
331
|
(0, _swagger.ApiOperation)({
|
|
334
332
|
summary: 'Update profile section',
|
|
335
333
|
description: 'Updates a specific profile section data.'
|
|
@@ -359,7 +357,6 @@ _ts_decorate([
|
|
|
359
357
|
(0, _common.Post)(':id/profile-completion'),
|
|
360
358
|
(0, _common.UseGuards)(_guards.JwtAuthGuard),
|
|
361
359
|
(0, _swagger.ApiBearerAuth)(),
|
|
362
|
-
(0, _decorators.RequirePermission)(_classes.USER_PERMISSIONS.READ),
|
|
363
360
|
(0, _swagger.ApiOperation)({
|
|
364
361
|
summary: 'Get profile completion percentage',
|
|
365
362
|
description: 'Returns overall profile completion percentage.'
|
|
@@ -25,10 +25,10 @@ function _ts_param(paramIndex, decorator) {
|
|
|
25
25
|
decorator(target, key, paramIndex);
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
import { JwtAuthGuard, RequirePermission, USER_PERMISSIONS } from '@flusys/nestjs-shared';
|
|
29
|
-
import { USER_PERMISSION_MESSAGES } from '../config';
|
|
28
|
+
import { JwtAuthGuard, PermissionGuard, RequirePermission, USER_PERMISSIONS } from '@flusys/nestjs-shared';
|
|
30
29
|
import { Body, Controller, Inject, Post, UseGuards } from '@nestjs/common';
|
|
31
30
|
import { ApiBearerAuth, ApiBody, ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
|
|
31
|
+
import { USER_PERMISSION_MESSAGES } from '../config';
|
|
32
32
|
import { AssignUserBranchDto, AssignUserCompanyDto, UserBranchesResponseDto, UserCompaniesResponseDto } from '../dtos/user-permission.dto';
|
|
33
33
|
import { PermissionType } from '../entities/user-company-permission.entity';
|
|
34
34
|
import { UserPermissionService } from '../services/user-permission.service';
|
|
@@ -204,7 +204,7 @@ UserPermissionController = _ts_decorate([
|
|
|
204
204
|
ApiTags('User Permissions'),
|
|
205
205
|
ApiBearerAuth(),
|
|
206
206
|
Controller('administration/permissions'),
|
|
207
|
-
UseGuards(JwtAuthGuard),
|
|
207
|
+
UseGuards(JwtAuthGuard, PermissionGuard),
|
|
208
208
|
_ts_param(0, Inject(UserPermissionService)),
|
|
209
209
|
_ts_metadata("design:type", Function),
|
|
210
210
|
_ts_metadata("design:paramtypes", [
|
|
@@ -26,12 +26,12 @@ function _ts_param(paramIndex, decorator) {
|
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
import { createApiController, USER_PERMISSIONS } from '@flusys/nestjs-shared/classes';
|
|
29
|
-
import { USER_MESSAGES } from '../config';
|
|
30
29
|
import { CurrentUser, RequirePermission } from '@flusys/nestjs-shared/decorators';
|
|
31
|
-
import { JwtAuthGuard } from '@flusys/nestjs-shared/guards';
|
|
30
|
+
import { JwtAuthGuard, PermissionGuard } from '@flusys/nestjs-shared/guards';
|
|
32
31
|
import { ILoggedUserInfo } from '@flusys/nestjs-shared/interfaces';
|
|
33
32
|
import { Body, Controller, Inject, Param, Post, UseGuards } from '@nestjs/common';
|
|
34
33
|
import { ApiBearerAuth, ApiBody, ApiOperation, ApiParam, ApiTags } from '@nestjs/swagger';
|
|
34
|
+
import { USER_MESSAGES } from '../config';
|
|
35
35
|
import { CreateUserDto, UpdateUserDto, UserResponseDto } from '../dtos/user.dto';
|
|
36
36
|
import { UserService } from '../services/user.service';
|
|
37
37
|
export class UserController extends createApiController(CreateUserDto, UpdateUserDto, UserResponseDto, {
|
|
@@ -166,7 +166,7 @@ export class UserController extends createApiController(CreateUserDto, UpdateUse
|
|
|
166
166
|
}
|
|
167
167
|
_ts_decorate([
|
|
168
168
|
Post(':id/profile-extras'),
|
|
169
|
-
UseGuards(JwtAuthGuard),
|
|
169
|
+
UseGuards(JwtAuthGuard, PermissionGuard),
|
|
170
170
|
ApiBearerAuth(),
|
|
171
171
|
RequirePermission(USER_PERMISSIONS.READ),
|
|
172
172
|
ApiOperation({
|
|
@@ -188,7 +188,7 @@ _ts_decorate([
|
|
|
188
188
|
], UserController.prototype, "getProfileWithExtras", null);
|
|
189
189
|
_ts_decorate([
|
|
190
190
|
Post(':id/verify-email'),
|
|
191
|
-
UseGuards(JwtAuthGuard),
|
|
191
|
+
UseGuards(JwtAuthGuard, PermissionGuard),
|
|
192
192
|
ApiBearerAuth(),
|
|
193
193
|
RequirePermission(USER_PERMISSIONS.UPDATE),
|
|
194
194
|
ApiOperation({
|
|
@@ -207,7 +207,7 @@ _ts_decorate([
|
|
|
207
207
|
], UserController.prototype, "verifyEmail", null);
|
|
208
208
|
_ts_decorate([
|
|
209
209
|
Post(':id/verify-phone'),
|
|
210
|
-
UseGuards(JwtAuthGuard),
|
|
210
|
+
UseGuards(JwtAuthGuard, PermissionGuard),
|
|
211
211
|
ApiBearerAuth(),
|
|
212
212
|
RequirePermission(USER_PERMISSIONS.UPDATE),
|
|
213
213
|
ApiOperation({
|
|
@@ -226,7 +226,7 @@ _ts_decorate([
|
|
|
226
226
|
], UserController.prototype, "verifyPhone", null);
|
|
227
227
|
_ts_decorate([
|
|
228
228
|
Post(':id/status'),
|
|
229
|
-
UseGuards(JwtAuthGuard),
|
|
229
|
+
UseGuards(JwtAuthGuard, PermissionGuard),
|
|
230
230
|
ApiBearerAuth(),
|
|
231
231
|
RequirePermission(USER_PERMISSIONS.UPDATE),
|
|
232
232
|
ApiOperation({
|
|
@@ -291,7 +291,6 @@ _ts_decorate([
|
|
|
291
291
|
Post(':id/profile-section/:sectionId'),
|
|
292
292
|
UseGuards(JwtAuthGuard),
|
|
293
293
|
ApiBearerAuth(),
|
|
294
|
-
RequirePermission(USER_PERMISSIONS.READ),
|
|
295
294
|
ApiOperation({
|
|
296
295
|
summary: 'Get profile section data',
|
|
297
296
|
description: 'Returns data for a specific profile section.'
|
|
@@ -319,7 +318,6 @@ _ts_decorate([
|
|
|
319
318
|
Post(':id/profile-section/:sectionId/update'),
|
|
320
319
|
UseGuards(JwtAuthGuard),
|
|
321
320
|
ApiBearerAuth(),
|
|
322
|
-
RequirePermission(USER_PERMISSIONS.UPDATE),
|
|
323
321
|
ApiOperation({
|
|
324
322
|
summary: 'Update profile section',
|
|
325
323
|
description: 'Updates a specific profile section data.'
|
|
@@ -349,7 +347,6 @@ _ts_decorate([
|
|
|
349
347
|
Post(':id/profile-completion'),
|
|
350
348
|
UseGuards(JwtAuthGuard),
|
|
351
349
|
ApiBearerAuth(),
|
|
352
|
-
RequirePermission(USER_PERMISSIONS.READ),
|
|
353
350
|
ApiOperation({
|
|
354
351
|
summary: 'Get profile completion percentage',
|
|
355
352
|
description: 'Returns overall profile completion percentage.'
|
|
@@ -25,7 +25,7 @@ function _ts_param(paramIndex, decorator) {
|
|
|
25
25
|
decorator(target, key, paramIndex);
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
import {
|
|
28
|
+
import { HybridCache, RequestScopedApiService } from '@flusys/nestjs-shared/classes';
|
|
29
29
|
import { UtilsService } from '@flusys/nestjs-shared/modules';
|
|
30
30
|
import { applyCompanyFilter } from '@flusys/nestjs-shared/utils';
|
|
31
31
|
import { Inject, Injectable, Scope } from '@nestjs/common';
|
|
@@ -25,7 +25,7 @@ function _ts_param(paramIndex, decorator) {
|
|
|
25
25
|
decorator(target, key, paramIndex);
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
import {
|
|
28
|
+
import { HybridCache, RequestScopedApiService } from '@flusys/nestjs-shared/classes';
|
|
29
29
|
import { UtilsService } from '@flusys/nestjs-shared/modules';
|
|
30
30
|
import { Inject, Injectable, Scope } from '@nestjs/common';
|
|
31
31
|
import { Company } from '../entities/company.entity';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flusys/nestjs-auth",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"description": "Authentication and authorization infrastructure for NestJS applications",
|
|
5
5
|
"main": "cjs/index.js",
|
|
6
6
|
"module": "fesm/index.js",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"rxjs": "^7.8.0"
|
|
94
94
|
},
|
|
95
95
|
"dependencies": {
|
|
96
|
-
"@flusys/nestjs-core": "5.0
|
|
97
|
-
"@flusys/nestjs-shared": "5.0
|
|
96
|
+
"@flusys/nestjs-core": "5.1.0",
|
|
97
|
+
"@flusys/nestjs-shared": "5.1.0"
|
|
98
98
|
}
|
|
99
99
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HybridCache, RequestScopedApiService } from '@flusys/nestjs-shared/classes';
|
|
2
2
|
import { FilterAndPaginationDto } from '@flusys/nestjs-shared/dtos';
|
|
3
3
|
import { ILoggedUserInfo } from '@flusys/nestjs-shared/interfaces';
|
|
4
4
|
import { UtilsService } from '@flusys/nestjs-shared/modules';
|
|
5
|
-
import { EntityTarget,
|
|
5
|
+
import { EntityTarget, SelectQueryBuilder } from 'typeorm';
|
|
6
6
|
import { CreateCompanyBranchDto, UpdateCompanyBranchDto } from '../dtos/company-branch.dto';
|
|
7
|
-
import { ICompanyBranch } from '../interfaces/company-branch.interface';
|
|
8
7
|
import { CompanyBranch } from '../entities/company-branch.entity';
|
|
8
|
+
import { ICompanyBranch } from '../interfaces/company-branch.interface';
|
|
9
9
|
import { AuthConfigService } from './auth-config.service';
|
|
10
10
|
import { AuthDataSourceProvider } from './auth-datasource.provider';
|
|
11
|
-
export declare class BranchService extends RequestScopedApiService<CreateCompanyBranchDto, UpdateCompanyBranchDto, ICompanyBranch, CompanyBranch
|
|
11
|
+
export declare class BranchService extends RequestScopedApiService<CreateCompanyBranchDto, UpdateCompanyBranchDto, ICompanyBranch, CompanyBranch> {
|
|
12
12
|
protected cacheManager: HybridCache;
|
|
13
13
|
protected utilsService: UtilsService;
|
|
14
14
|
private readonly dataSourceProvider;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HybridCache, RequestScopedApiService } from '@flusys/nestjs-shared/classes';
|
|
2
2
|
import { ILoggedUserInfo } from '@flusys/nestjs-shared/interfaces';
|
|
3
3
|
import { UtilsService } from '@flusys/nestjs-shared/modules';
|
|
4
|
-
import { EntityTarget,
|
|
4
|
+
import { EntityTarget, SelectQueryBuilder } from 'typeorm';
|
|
5
5
|
import { CreateCompanyDto, UpdateCompanyDto } from '../dtos/company.dto';
|
|
6
6
|
import { Company } from '../entities/company.entity';
|
|
7
7
|
import { ICompany } from '../interfaces/company.interface';
|
|
8
8
|
import { AuthDataSourceProvider } from './auth-datasource.provider';
|
|
9
|
-
export declare class CompanyService extends RequestScopedApiService<CreateCompanyDto, UpdateCompanyDto, ICompany, Company
|
|
9
|
+
export declare class CompanyService extends RequestScopedApiService<CreateCompanyDto, UpdateCompanyDto, ICompany, Company> {
|
|
10
10
|
protected cacheManager: HybridCache;
|
|
11
11
|
protected utilsService: UtilsService;
|
|
12
12
|
private readonly dataSourceProvider;
|
|
@@ -2,14 +2,14 @@ import { HybridCache, RequestScopedApiService } from '@flusys/nestjs-shared/clas
|
|
|
2
2
|
import { FilterAndPaginationDto } from '@flusys/nestjs-shared/dtos';
|
|
3
3
|
import { ILoggedUserInfo } from '@flusys/nestjs-shared/interfaces';
|
|
4
4
|
import { UtilsService } from '@flusys/nestjs-shared/modules';
|
|
5
|
-
import { EntityTarget,
|
|
5
|
+
import { EntityTarget, SelectQueryBuilder } from 'typeorm';
|
|
6
6
|
import { CreateUserDto, UpdateUserDto } from '../dtos/user.dto';
|
|
7
7
|
import { AppUser } from '../entities/app-user.entity';
|
|
8
8
|
import { IEnrichedUser, IProfileExtras, IProfileSection, IProfileSectionData, IUserEnricher } from '../interfaces/user-enricher.interface';
|
|
9
9
|
import { IUser } from '../interfaces/user.interface';
|
|
10
10
|
import { AuthConfigService } from './auth-config.service';
|
|
11
11
|
import { AuthDataSourceProvider } from './auth-datasource.provider';
|
|
12
|
-
export declare class UserService extends RequestScopedApiService<CreateUserDto, UpdateUserDto, IUser, AppUser
|
|
12
|
+
export declare class UserService extends RequestScopedApiService<CreateUserDto, UpdateUserDto, IUser, AppUser> {
|
|
13
13
|
protected cacheManager: HybridCache;
|
|
14
14
|
protected utilsService: UtilsService;
|
|
15
15
|
private readonly dataSourceProvider;
|