@flusys/nestjs-auth 8.0.0-beta.1 → 8.0.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/config/message-keys.d.ts +2 -0
- package/controllers/user-permission.controller.d.ts +3 -1
- package/dtos/user-permission.dto.d.ts +30 -0
- package/fesm/118.js +175 -1
- package/fesm/120.js +68 -0
- package/fesm/24.js +34 -1
- package/fesm/config/index.js +2 -0
- package/fesm/dtos/index.js +14 -2
- package/fesm/index.js +20 -2
- package/fesm/interceptors/index.js +2 -0
- package/package.json +3 -3
- package/services/user-permission.service.d.ts +2 -0
package/config/message-keys.d.ts
CHANGED
|
@@ -92,6 +92,8 @@ export declare const BRANCH_MESSAGES: {
|
|
|
92
92
|
export declare const USER_PERMISSION_MESSAGES: {
|
|
93
93
|
readonly COMPANY_LIST_SUCCESS: "user.permission.company.list.success";
|
|
94
94
|
readonly BRANCH_LIST_SUCCESS: "user.permission.branch.list.success";
|
|
95
|
+
readonly COMPANY_USERS_SUCCESS: "user.permission.company.users.success";
|
|
96
|
+
readonly BRANCH_USERS_SUCCESS: "user.permission.branch.users.success";
|
|
95
97
|
readonly BATCH_SUCCESS: "user.permission.batch.success";
|
|
96
98
|
readonly ALREADY_ASSIGNED: "user.permission.already.assigned";
|
|
97
99
|
readonly PERMISSION_NOT_FOUND: "user.permission.not.found";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ILoggedUserInfo } from '@flusys/nestjs-shared/interfaces';
|
|
2
|
-
import { AssignUserBranchDto, AssignUserCompanyDto, UserBranchesResponseDto, UserCompaniesResponseDto } from '../dtos/user-permission.dto.js';
|
|
2
|
+
import { AssignUserBranchDto, AssignUserCompanyDto, BranchPermittedUsersResponseDto, CompanyPermittedUsersResponseDto, GetBranchUsersDto, GetCompanyUsersDto, UserBranchesResponseDto, UserCompaniesResponseDto } from '../dtos/user-permission.dto.js';
|
|
3
3
|
import { UserPermissionService } from '../services/user-permission.service.js';
|
|
4
4
|
export declare class UserPermissionController {
|
|
5
5
|
private readonly permissionService;
|
|
@@ -18,5 +18,7 @@ export declare class UserPermissionController {
|
|
|
18
18
|
messageVariables: Record<string, number>;
|
|
19
19
|
}>;
|
|
20
20
|
getUserBranches(userId: string, companyId?: string): Promise<UserBranchesResponseDto>;
|
|
21
|
+
getCompanyUsers(dto: GetCompanyUsersDto): Promise<CompanyPermittedUsersResponseDto>;
|
|
22
|
+
getBranchUsers(dto: GetBranchUsersDto): Promise<BranchPermittedUsersResponseDto>;
|
|
21
23
|
private processBatchPermissions;
|
|
22
24
|
}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
export declare class GetCompanyUsersDto {
|
|
2
|
+
companyId: string;
|
|
3
|
+
}
|
|
4
|
+
export declare class GetBranchUsersDto {
|
|
5
|
+
branchId: string;
|
|
6
|
+
}
|
|
1
7
|
export declare class PermissionItemDto {
|
|
2
8
|
targetId: string;
|
|
3
9
|
isAdd: boolean;
|
|
@@ -31,6 +37,30 @@ export declare class UserCompaniesResponseDto {
|
|
|
31
37
|
messageKey: string;
|
|
32
38
|
data: UserCompanyPermissionDto[];
|
|
33
39
|
}
|
|
40
|
+
export declare class CompanyPermittedUserDto {
|
|
41
|
+
id: string;
|
|
42
|
+
userId: string;
|
|
43
|
+
userName: string;
|
|
44
|
+
userEmail: string;
|
|
45
|
+
}
|
|
46
|
+
export declare class BranchPermittedUserDto {
|
|
47
|
+
id: string;
|
|
48
|
+
userId: string;
|
|
49
|
+
userName: string;
|
|
50
|
+
userEmail: string;
|
|
51
|
+
}
|
|
52
|
+
export declare class CompanyPermittedUsersResponseDto {
|
|
53
|
+
success: boolean;
|
|
54
|
+
message: string;
|
|
55
|
+
messageKey: string;
|
|
56
|
+
data: CompanyPermittedUserDto[];
|
|
57
|
+
}
|
|
58
|
+
export declare class BranchPermittedUsersResponseDto {
|
|
59
|
+
success: boolean;
|
|
60
|
+
message: string;
|
|
61
|
+
messageKey: string;
|
|
62
|
+
data: BranchPermittedUserDto[];
|
|
63
|
+
}
|
|
34
64
|
export declare class UserBranchesResponseDto {
|
|
35
65
|
success: boolean;
|
|
36
66
|
message: string;
|
package/fesm/118.js
CHANGED
|
@@ -907,6 +907,32 @@ function _ts_metadata(metadataKey, metadataValue) {
|
|
|
907
907
|
|
|
908
908
|
|
|
909
909
|
|
|
910
|
+
/**
|
|
911
|
+
* Get users permitted for a company
|
|
912
|
+
*/ class GetCompanyUsersDto {
|
|
913
|
+
companyId;
|
|
914
|
+
}
|
|
915
|
+
_ts_decorate([
|
|
916
|
+
(0,_nestjs_swagger__rspack_import_0.ApiProperty)({
|
|
917
|
+
description: 'Company ID',
|
|
918
|
+
example: '550e8400-e29b-41d4-a716-446655440001'
|
|
919
|
+
}),
|
|
920
|
+
(0,class_validator__rspack_import_2.IsUUID)(),
|
|
921
|
+
_ts_metadata("design:type", String)
|
|
922
|
+
], GetCompanyUsersDto.prototype, "companyId", void 0);
|
|
923
|
+
/**
|
|
924
|
+
* Get users permitted for a branch
|
|
925
|
+
*/ class GetBranchUsersDto {
|
|
926
|
+
branchId;
|
|
927
|
+
}
|
|
928
|
+
_ts_decorate([
|
|
929
|
+
(0,_nestjs_swagger__rspack_import_0.ApiProperty)({
|
|
930
|
+
description: 'Branch ID',
|
|
931
|
+
example: '550e8400-e29b-41d4-a716-446655440002'
|
|
932
|
+
}),
|
|
933
|
+
(0,class_validator__rspack_import_2.IsUUID)(),
|
|
934
|
+
_ts_metadata("design:type", String)
|
|
935
|
+
], GetBranchUsersDto.prototype, "branchId", void 0);
|
|
910
936
|
/**
|
|
911
937
|
* Permission item for batch assignment/revocation
|
|
912
938
|
*/ class PermissionItemDto {
|
|
@@ -1154,6 +1180,148 @@ _ts_decorate([
|
|
|
1154
1180
|
}),
|
|
1155
1181
|
_ts_metadata("design:type", Array)
|
|
1156
1182
|
], UserCompaniesResponseDto.prototype, "data", void 0);
|
|
1183
|
+
/**
|
|
1184
|
+
* A user permitted against a company, with basic user details
|
|
1185
|
+
*/ class CompanyPermittedUserDto {
|
|
1186
|
+
id;
|
|
1187
|
+
userId;
|
|
1188
|
+
userName;
|
|
1189
|
+
userEmail;
|
|
1190
|
+
}
|
|
1191
|
+
_ts_decorate([
|
|
1192
|
+
(0,_nestjs_swagger__rspack_import_0.ApiProperty)({
|
|
1193
|
+
description: 'Permission ID',
|
|
1194
|
+
example: '550e8400-e29b-41d4-a716-446655440010'
|
|
1195
|
+
}),
|
|
1196
|
+
_ts_metadata("design:type", String)
|
|
1197
|
+
], CompanyPermittedUserDto.prototype, "id", void 0);
|
|
1198
|
+
_ts_decorate([
|
|
1199
|
+
(0,_nestjs_swagger__rspack_import_0.ApiProperty)({
|
|
1200
|
+
description: 'User ID',
|
|
1201
|
+
example: '550e8400-e29b-41d4-a716-446655440000'
|
|
1202
|
+
}),
|
|
1203
|
+
_ts_metadata("design:type", String)
|
|
1204
|
+
], CompanyPermittedUserDto.prototype, "userId", void 0);
|
|
1205
|
+
_ts_decorate([
|
|
1206
|
+
(0,_nestjs_swagger__rspack_import_0.ApiProperty)({
|
|
1207
|
+
description: 'User name',
|
|
1208
|
+
example: 'Jane Doe'
|
|
1209
|
+
}),
|
|
1210
|
+
_ts_metadata("design:type", String)
|
|
1211
|
+
], CompanyPermittedUserDto.prototype, "userName", void 0);
|
|
1212
|
+
_ts_decorate([
|
|
1213
|
+
(0,_nestjs_swagger__rspack_import_0.ApiProperty)({
|
|
1214
|
+
description: 'User email',
|
|
1215
|
+
example: 'jane.doe@example.com'
|
|
1216
|
+
}),
|
|
1217
|
+
_ts_metadata("design:type", String)
|
|
1218
|
+
], CompanyPermittedUserDto.prototype, "userEmail", void 0);
|
|
1219
|
+
/**
|
|
1220
|
+
* A user permitted against a branch, with basic user details
|
|
1221
|
+
*/ class BranchPermittedUserDto {
|
|
1222
|
+
id;
|
|
1223
|
+
userId;
|
|
1224
|
+
userName;
|
|
1225
|
+
userEmail;
|
|
1226
|
+
}
|
|
1227
|
+
_ts_decorate([
|
|
1228
|
+
(0,_nestjs_swagger__rspack_import_0.ApiProperty)({
|
|
1229
|
+
description: 'Permission ID',
|
|
1230
|
+
example: '550e8400-e29b-41d4-a716-446655440020'
|
|
1231
|
+
}),
|
|
1232
|
+
_ts_metadata("design:type", String)
|
|
1233
|
+
], BranchPermittedUserDto.prototype, "id", void 0);
|
|
1234
|
+
_ts_decorate([
|
|
1235
|
+
(0,_nestjs_swagger__rspack_import_0.ApiProperty)({
|
|
1236
|
+
description: 'User ID',
|
|
1237
|
+
example: '550e8400-e29b-41d4-a716-446655440000'
|
|
1238
|
+
}),
|
|
1239
|
+
_ts_metadata("design:type", String)
|
|
1240
|
+
], BranchPermittedUserDto.prototype, "userId", void 0);
|
|
1241
|
+
_ts_decorate([
|
|
1242
|
+
(0,_nestjs_swagger__rspack_import_0.ApiProperty)({
|
|
1243
|
+
description: 'User name',
|
|
1244
|
+
example: 'Jane Doe'
|
|
1245
|
+
}),
|
|
1246
|
+
_ts_metadata("design:type", String)
|
|
1247
|
+
], BranchPermittedUserDto.prototype, "userName", void 0);
|
|
1248
|
+
_ts_decorate([
|
|
1249
|
+
(0,_nestjs_swagger__rspack_import_0.ApiProperty)({
|
|
1250
|
+
description: 'User email',
|
|
1251
|
+
example: 'jane.doe@example.com'
|
|
1252
|
+
}),
|
|
1253
|
+
_ts_metadata("design:type", String)
|
|
1254
|
+
], BranchPermittedUserDto.prototype, "userEmail", void 0);
|
|
1255
|
+
/**
|
|
1256
|
+
* Company permitted users response
|
|
1257
|
+
*/ class CompanyPermittedUsersResponseDto {
|
|
1258
|
+
success;
|
|
1259
|
+
message;
|
|
1260
|
+
messageKey;
|
|
1261
|
+
data;
|
|
1262
|
+
}
|
|
1263
|
+
_ts_decorate([
|
|
1264
|
+
(0,_nestjs_swagger__rspack_import_0.ApiProperty)({
|
|
1265
|
+
example: true
|
|
1266
|
+
}),
|
|
1267
|
+
_ts_metadata("design:type", Boolean)
|
|
1268
|
+
], CompanyPermittedUsersResponseDto.prototype, "success", void 0);
|
|
1269
|
+
_ts_decorate([
|
|
1270
|
+
(0,_nestjs_swagger__rspack_import_0.ApiProperty)({
|
|
1271
|
+
example: 'Company users retrieved successfully'
|
|
1272
|
+
}),
|
|
1273
|
+
_ts_metadata("design:type", String)
|
|
1274
|
+
], CompanyPermittedUsersResponseDto.prototype, "message", void 0);
|
|
1275
|
+
_ts_decorate([
|
|
1276
|
+
(0,_nestjs_swagger__rspack_import_0.ApiProperty)({
|
|
1277
|
+
example: 'user.permission.company.users.success'
|
|
1278
|
+
}),
|
|
1279
|
+
_ts_metadata("design:type", String)
|
|
1280
|
+
], CompanyPermittedUsersResponseDto.prototype, "messageKey", void 0);
|
|
1281
|
+
_ts_decorate([
|
|
1282
|
+
(0,_nestjs_swagger__rspack_import_0.ApiProperty)({
|
|
1283
|
+
description: 'List of users permitted for this company',
|
|
1284
|
+
type: [
|
|
1285
|
+
CompanyPermittedUserDto
|
|
1286
|
+
]
|
|
1287
|
+
}),
|
|
1288
|
+
_ts_metadata("design:type", Array)
|
|
1289
|
+
], CompanyPermittedUsersResponseDto.prototype, "data", void 0);
|
|
1290
|
+
/**
|
|
1291
|
+
* Branch permitted users response
|
|
1292
|
+
*/ class BranchPermittedUsersResponseDto {
|
|
1293
|
+
success;
|
|
1294
|
+
message;
|
|
1295
|
+
messageKey;
|
|
1296
|
+
data;
|
|
1297
|
+
}
|
|
1298
|
+
_ts_decorate([
|
|
1299
|
+
(0,_nestjs_swagger__rspack_import_0.ApiProperty)({
|
|
1300
|
+
example: true
|
|
1301
|
+
}),
|
|
1302
|
+
_ts_metadata("design:type", Boolean)
|
|
1303
|
+
], BranchPermittedUsersResponseDto.prototype, "success", void 0);
|
|
1304
|
+
_ts_decorate([
|
|
1305
|
+
(0,_nestjs_swagger__rspack_import_0.ApiProperty)({
|
|
1306
|
+
example: 'Branch users retrieved successfully'
|
|
1307
|
+
}),
|
|
1308
|
+
_ts_metadata("design:type", String)
|
|
1309
|
+
], BranchPermittedUsersResponseDto.prototype, "message", void 0);
|
|
1310
|
+
_ts_decorate([
|
|
1311
|
+
(0,_nestjs_swagger__rspack_import_0.ApiProperty)({
|
|
1312
|
+
example: 'user.permission.branch.users.success'
|
|
1313
|
+
}),
|
|
1314
|
+
_ts_metadata("design:type", String)
|
|
1315
|
+
], BranchPermittedUsersResponseDto.prototype, "messageKey", void 0);
|
|
1316
|
+
_ts_decorate([
|
|
1317
|
+
(0,_nestjs_swagger__rspack_import_0.ApiProperty)({
|
|
1318
|
+
description: 'List of users permitted for this branch',
|
|
1319
|
+
type: [
|
|
1320
|
+
BranchPermittedUserDto
|
|
1321
|
+
]
|
|
1322
|
+
}),
|
|
1323
|
+
_ts_metadata("design:type", Array)
|
|
1324
|
+
], BranchPermittedUsersResponseDto.prototype, "data", void 0);
|
|
1157
1325
|
/**
|
|
1158
1326
|
* User branches response
|
|
1159
1327
|
*/ class UserBranchesResponseDto {
|
|
@@ -1210,12 +1378,18 @@ _ts_decorate([
|
|
|
1210
1378
|
|
|
1211
1379
|
__webpack_require__.d(__webpack_exports__, {
|
|
1212
1380
|
DU: () => (AssignUserCompanyDto),
|
|
1381
|
+
GF: () => (GetBranchUsersDto),
|
|
1213
1382
|
LU: () => (UserCompaniesResponseDto),
|
|
1214
1383
|
Qm: () => (UserBranchPermissionDto),
|
|
1215
1384
|
RP: () => (UserCompanyPermissionDto),
|
|
1216
1385
|
Uu: () => (PermissionItemDto),
|
|
1386
|
+
a: () => (CompanyPermittedUsersResponseDto),
|
|
1387
|
+
bK: () => (BranchPermittedUsersResponseDto),
|
|
1388
|
+
i_: () => (CompanyPermittedUserDto),
|
|
1217
1389
|
qW: () => (AssignUserBranchDto),
|
|
1218
|
-
|
|
1390
|
+
tu: () => (BranchPermittedUserDto),
|
|
1391
|
+
wc: () => (UserBranchesResponseDto),
|
|
1392
|
+
xx: () => (GetCompanyUsersDto)
|
|
1219
1393
|
});
|
|
1220
1394
|
|
|
1221
1395
|
|
package/fesm/120.js
CHANGED
|
@@ -1834,6 +1834,34 @@ class UserPermissionController {
|
|
|
1834
1834
|
}))
|
|
1835
1835
|
};
|
|
1836
1836
|
}
|
|
1837
|
+
async getCompanyUsers(dto) {
|
|
1838
|
+
const permissions = await this.permissionService.findUsersForCompany(dto.companyId);
|
|
1839
|
+
return {
|
|
1840
|
+
success: true,
|
|
1841
|
+
message: 'Company users retrieved successfully',
|
|
1842
|
+
messageKey: message_keys/* .USER_PERMISSION_MESSAGES.COMPANY_USERS_SUCCESS */.jz.COMPANY_USERS_SUCCESS,
|
|
1843
|
+
data: permissions.filter((p)=>!!p.user).map((p)=>({
|
|
1844
|
+
id: p.id,
|
|
1845
|
+
userId: p.userId,
|
|
1846
|
+
userName: p.user?.name || p.user?.email || '',
|
|
1847
|
+
userEmail: p.user?.email || ''
|
|
1848
|
+
}))
|
|
1849
|
+
};
|
|
1850
|
+
}
|
|
1851
|
+
async getBranchUsers(dto) {
|
|
1852
|
+
const permissions = await this.permissionService.findUsersForBranch(dto.branchId);
|
|
1853
|
+
return {
|
|
1854
|
+
success: true,
|
|
1855
|
+
message: 'Branch users retrieved successfully',
|
|
1856
|
+
messageKey: message_keys/* .USER_PERMISSION_MESSAGES.BRANCH_USERS_SUCCESS */.jz.BRANCH_USERS_SUCCESS,
|
|
1857
|
+
data: permissions.filter((p)=>!!p.user).map((p)=>({
|
|
1858
|
+
id: p.id,
|
|
1859
|
+
userId: p.userId,
|
|
1860
|
+
userName: p.user?.name || p.user?.email || '',
|
|
1861
|
+
userEmail: p.user?.email || ''
|
|
1862
|
+
}))
|
|
1863
|
+
};
|
|
1864
|
+
}
|
|
1837
1865
|
/** Process batch permission assignments/revocations */ async processBatchPermissions(userId, items, type, user) {
|
|
1838
1866
|
let added = 0, removed = 0;
|
|
1839
1867
|
for (const item of items){
|
|
@@ -1965,6 +1993,46 @@ user_permission_controller_ts_decorate([
|
|
|
1965
1993
|
]),
|
|
1966
1994
|
user_permission_controller_ts_metadata("design:returntype", Promise)
|
|
1967
1995
|
], UserPermissionController.prototype, "getUserBranches", null);
|
|
1996
|
+
user_permission_controller_ts_decorate([
|
|
1997
|
+
(0,common_.Post)('get-company-users'),
|
|
1998
|
+
(0,nestjs_shared_.RequirePermission)(nestjs_shared_.USER_PERMISSIONS.READ),
|
|
1999
|
+
(0,swagger_.ApiOperation)({
|
|
2000
|
+
summary: 'Get users permitted for a company'
|
|
2001
|
+
}),
|
|
2002
|
+
(0,swagger_.ApiBody)({
|
|
2003
|
+
type: user_permission_dto/* .GetCompanyUsersDto */.xx
|
|
2004
|
+
}),
|
|
2005
|
+
(0,swagger_.ApiResponse)({
|
|
2006
|
+
status: 200,
|
|
2007
|
+
type: user_permission_dto/* .CompanyPermittedUsersResponseDto */.a
|
|
2008
|
+
}),
|
|
2009
|
+
user_permission_controller_ts_param(0, (0,common_.Body)()),
|
|
2010
|
+
user_permission_controller_ts_metadata("design:type", Function),
|
|
2011
|
+
user_permission_controller_ts_metadata("design:paramtypes", [
|
|
2012
|
+
typeof user_permission_dto/* .GetCompanyUsersDto */.xx === "undefined" ? Object : user_permission_dto/* .GetCompanyUsersDto */.xx
|
|
2013
|
+
]),
|
|
2014
|
+
user_permission_controller_ts_metadata("design:returntype", Promise)
|
|
2015
|
+
], UserPermissionController.prototype, "getCompanyUsers", null);
|
|
2016
|
+
user_permission_controller_ts_decorate([
|
|
2017
|
+
(0,common_.Post)('get-branch-users'),
|
|
2018
|
+
(0,nestjs_shared_.RequirePermission)(nestjs_shared_.USER_PERMISSIONS.READ),
|
|
2019
|
+
(0,swagger_.ApiOperation)({
|
|
2020
|
+
summary: 'Get users permitted for a branch'
|
|
2021
|
+
}),
|
|
2022
|
+
(0,swagger_.ApiBody)({
|
|
2023
|
+
type: user_permission_dto/* .GetBranchUsersDto */.GF
|
|
2024
|
+
}),
|
|
2025
|
+
(0,swagger_.ApiResponse)({
|
|
2026
|
+
status: 200,
|
|
2027
|
+
type: user_permission_dto/* .BranchPermittedUsersResponseDto */.bK
|
|
2028
|
+
}),
|
|
2029
|
+
user_permission_controller_ts_param(0, (0,common_.Body)()),
|
|
2030
|
+
user_permission_controller_ts_metadata("design:type", Function),
|
|
2031
|
+
user_permission_controller_ts_metadata("design:paramtypes", [
|
|
2032
|
+
typeof user_permission_dto/* .GetBranchUsersDto */.GF === "undefined" ? Object : user_permission_dto/* .GetBranchUsersDto */.GF
|
|
2033
|
+
]),
|
|
2034
|
+
user_permission_controller_ts_metadata("design:returntype", Promise)
|
|
2035
|
+
], UserPermissionController.prototype, "getBranchUsers", null);
|
|
1968
2036
|
UserPermissionController = user_permission_controller_ts_decorate([
|
|
1969
2037
|
(0,swagger_.ApiTags)('User Permissions'),
|
|
1970
2038
|
(0,swagger_.ApiBearerAuth)(),
|
package/fesm/24.js
CHANGED
|
@@ -173,6 +173,8 @@ const BRANCH_MESSAGES = {
|
|
|
173
173
|
const USER_PERMISSION_MESSAGES = {
|
|
174
174
|
COMPANY_LIST_SUCCESS: 'user.permission.company.list.success',
|
|
175
175
|
BRANCH_LIST_SUCCESS: 'user.permission.branch.list.success',
|
|
176
|
+
COMPANY_USERS_SUCCESS: 'user.permission.company.users.success',
|
|
177
|
+
BRANCH_USERS_SUCCESS: 'user.permission.branch.users.success',
|
|
176
178
|
BATCH_SUCCESS: 'user.permission.batch.success',
|
|
177
179
|
ALREADY_ASSIGNED: 'user.permission.already.assigned',
|
|
178
180
|
PERMISSION_NOT_FOUND: 'user.permission.not.found',
|
|
@@ -3632,6 +3634,37 @@ class UserPermissionService {
|
|
|
3632
3634
|
}
|
|
3633
3635
|
return queryBuilder.getMany();
|
|
3634
3636
|
}
|
|
3637
|
+
// Reverse Lookups (target -> users)
|
|
3638
|
+
/** Find all users permitted for a given company */ async findUsersForCompany(companyId) {
|
|
3639
|
+
const repository = await this.getRepository();
|
|
3640
|
+
return repository.find({
|
|
3641
|
+
where: {
|
|
3642
|
+
targetId: companyId,
|
|
3643
|
+
permissionType: _entities_user_company_permission_entity_js__rspack_import_5/* .PermissionType.COMPANY */.e.COMPANY
|
|
3644
|
+
},
|
|
3645
|
+
relations: [
|
|
3646
|
+
'user'
|
|
3647
|
+
],
|
|
3648
|
+
order: {
|
|
3649
|
+
createdAt: 'DESC'
|
|
3650
|
+
}
|
|
3651
|
+
});
|
|
3652
|
+
}
|
|
3653
|
+
/** Find all users permitted for a given branch */ async findUsersForBranch(branchId) {
|
|
3654
|
+
const repository = await this.getRepository();
|
|
3655
|
+
return repository.find({
|
|
3656
|
+
where: {
|
|
3657
|
+
targetId: branchId,
|
|
3658
|
+
permissionType: _entities_user_company_permission_entity_js__rspack_import_5/* .PermissionType.BRANCH */.e.BRANCH
|
|
3659
|
+
},
|
|
3660
|
+
relations: [
|
|
3661
|
+
'user'
|
|
3662
|
+
],
|
|
3663
|
+
order: {
|
|
3664
|
+
createdAt: 'DESC'
|
|
3665
|
+
}
|
|
3666
|
+
});
|
|
3667
|
+
}
|
|
3635
3668
|
}
|
|
3636
3669
|
_ts_decorate([
|
|
3637
3670
|
(0,_flusys_nestjs_shared__rspack_import_0.LogAction)({
|
|
@@ -3740,7 +3773,7 @@ class UserService extends _flusys_nestjs_shared_classes__rspack_import_1.ApiServ
|
|
|
3740
3773
|
userEnricher;
|
|
3741
3774
|
permissionRepository;
|
|
3742
3775
|
dataSource;
|
|
3743
|
-
logAdapter = (0,_flusys_nestjs_shared_classes__rspack_import_1.createModuleLogger)(
|
|
3776
|
+
logAdapter = (0,_flusys_nestjs_shared_classes__rspack_import_1.createModuleLogger)('auth');
|
|
3744
3777
|
constructor(cacheManager, utilsService, dataSourceProvider, authConfig, userEnricher){
|
|
3745
3778
|
super(_config_index_js__rspack_import_11/* .AUTH_EVENT_ENTITIES.USER */.g.USER, cacheManager, utilsService, UserService.name, true, (/* inlined export .AUTH_EVENT_MODULE */"auth"), dataSourceProvider, _entities_app_user_entity_js__rspack_import_7/* .AppUser */.$), this.cacheManager = cacheManager, this.utilsService = utilsService, this.authConfig = authConfig, this.userEnricher = userEnricher;
|
|
3746
3779
|
}
|
package/fesm/config/index.js
CHANGED
|
@@ -194,6 +194,8 @@ const BRANCH_MESSAGES = {
|
|
|
194
194
|
const USER_PERMISSION_MESSAGES = {
|
|
195
195
|
COMPANY_LIST_SUCCESS: 'user.permission.company.list.success',
|
|
196
196
|
BRANCH_LIST_SUCCESS: 'user.permission.branch.list.success',
|
|
197
|
+
COMPANY_USERS_SUCCESS: 'user.permission.company.users.success',
|
|
198
|
+
BRANCH_USERS_SUCCESS: 'user.permission.branch.users.success',
|
|
197
199
|
BATCH_SUCCESS: 'user.permission.batch.success',
|
|
198
200
|
ALREADY_ASSIGNED: 'user.permission.already.assigned',
|
|
199
201
|
PERMISSION_NOT_FOUND: 'user.permission.not.found',
|
package/fesm/dtos/index.js
CHANGED
|
@@ -20,6 +20,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
20
20
|
DU: () => (/* reexport safe */ _user_permission_dto_js__rspack_import_5.DU),
|
|
21
21
|
ET: () => (/* reexport safe */ _company_branch_dto_js__rspack_import_1.ET),
|
|
22
22
|
G3: () => (/* reexport safe */ _authentication_dto_js__rspack_import_0.G3),
|
|
23
|
+
GF: () => (/* reexport safe */ _user_permission_dto_js__rspack_import_5.GF),
|
|
23
24
|
Ky: () => (/* reexport safe */ _company_dto_js__rspack_import_2.Ky),
|
|
24
25
|
LU: () => (/* reexport safe */ _user_permission_dto_js__rspack_import_5.LU),
|
|
25
26
|
Oo: () => (/* reexport safe */ _company_branch_dto_js__rspack_import_1.Oo),
|
|
@@ -38,14 +39,17 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
38
39
|
Vw: () => (/* reexport safe */ _company_branch_dto_js__rspack_import_1.Vw),
|
|
39
40
|
X8: () => (/* reexport safe */ _social_auth_dto_js__rspack_import_3.X8),
|
|
40
41
|
_M: () => (/* reexport safe */ _authentication_dto_js__rspack_import_0._M),
|
|
42
|
+
a: () => (/* reexport safe */ _user_permission_dto_js__rspack_import_5.a),
|
|
41
43
|
a2: () => (/* reexport safe */ _social_auth_dto_js__rspack_import_3.a2),
|
|
42
44
|
aZ: () => (/* reexport safe */ _authentication_dto_js__rspack_import_0.aZ),
|
|
45
|
+
bK: () => (/* reexport safe */ _user_permission_dto_js__rspack_import_5.bK),
|
|
43
46
|
cd: () => (/* reexport safe */ _company_dto_js__rspack_import_2.cd),
|
|
44
47
|
dp: () => (/* reexport safe */ _authentication_dto_js__rspack_import_0.dp),
|
|
45
48
|
fF: () => (/* reexport safe */ _authentication_dto_js__rspack_import_0.fF),
|
|
46
49
|
fP: () => (/* reexport safe */ _social_auth_dto_js__rspack_import_3.fP),
|
|
47
50
|
gw: () => (/* reexport safe */ _authentication_dto_js__rspack_import_0.gw),
|
|
48
51
|
iJ: () => (/* reexport safe */ _authentication_dto_js__rspack_import_0.iJ),
|
|
52
|
+
i_: () => (/* reexport safe */ _user_permission_dto_js__rspack_import_5.i_),
|
|
49
53
|
k2: () => (/* reexport safe */ _authentication_dto_js__rspack_import_0.k2),
|
|
50
54
|
kd: () => (/* reexport safe */ _social_auth_dto_js__rspack_import_3.kd),
|
|
51
55
|
kq: () => (/* reexport safe */ _user_dto_js__rspack_import_4.kq),
|
|
@@ -58,9 +62,11 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
58
62
|
rn: () => (/* reexport safe */ _authentication_dto_js__rspack_import_0.rn),
|
|
59
63
|
s4: () => (/* reexport safe */ _social_auth_dto_js__rspack_import_3.s4),
|
|
60
64
|
sx: () => (/* reexport safe */ _user_dto_js__rspack_import_4.sx),
|
|
65
|
+
tu: () => (/* reexport safe */ _user_permission_dto_js__rspack_import_5.tu),
|
|
61
66
|
vb: () => (/* reexport safe */ _authentication_dto_js__rspack_import_0.vb),
|
|
62
67
|
wc: () => (/* reexport safe */ _user_permission_dto_js__rspack_import_5.wc),
|
|
63
|
-
xG: () => (/* reexport safe */ _authentication_dto_js__rspack_import_0.xG)
|
|
68
|
+
xG: () => (/* reexport safe */ _authentication_dto_js__rspack_import_0.xG),
|
|
69
|
+
xx: () => (/* reexport safe */ _user_permission_dto_js__rspack_import_5.xx)
|
|
64
70
|
});
|
|
65
71
|
|
|
66
72
|
|
|
@@ -78,10 +84,14 @@ __webpack_require__.C(__rspack_chunk_3);
|
|
|
78
84
|
var __webpack_exports__ = __webpack_exec__(9029);var __webpack_exports__AssignUserBranchDto = __webpack_exports__.qW;
|
|
79
85
|
var __webpack_exports__AssignUserCompanyDto = __webpack_exports__.DU;
|
|
80
86
|
var __webpack_exports__BranchInfoDto = __webpack_exports__.UQ;
|
|
87
|
+
var __webpack_exports__BranchPermittedUserDto = __webpack_exports__.tu;
|
|
88
|
+
var __webpack_exports__BranchPermittedUsersResponseDto = __webpack_exports__.bK;
|
|
81
89
|
var __webpack_exports__BranchSelectionInfoDto = __webpack_exports__.G3;
|
|
82
90
|
var __webpack_exports__ChangePasswordDto = __webpack_exports__.$h;
|
|
83
91
|
var __webpack_exports__CompanyBranchResponseDto = __webpack_exports__.ET;
|
|
84
92
|
var __webpack_exports__CompanyInfoDto = __webpack_exports__.fF;
|
|
93
|
+
var __webpack_exports__CompanyPermittedUserDto = __webpack_exports__.i_;
|
|
94
|
+
var __webpack_exports__CompanyPermittedUsersResponseDto = __webpack_exports__.a;
|
|
85
95
|
var __webpack_exports__CompanyResponseDto = __webpack_exports__.cd;
|
|
86
96
|
var __webpack_exports__CompanySelectionResponseDto = __webpack_exports__.iJ;
|
|
87
97
|
var __webpack_exports__CompanyWithBranchesDto = __webpack_exports__.TF;
|
|
@@ -90,6 +100,8 @@ var __webpack_exports__CreateCompanyDto = __webpack_exports__.l4;
|
|
|
90
100
|
var __webpack_exports__CreateSocialAuthConfigDto = __webpack_exports__.X8;
|
|
91
101
|
var __webpack_exports__CreateUserDto = __webpack_exports__.TG;
|
|
92
102
|
var __webpack_exports__ForgotPasswordDto = __webpack_exports__.mG;
|
|
103
|
+
var __webpack_exports__GetBranchUsersDto = __webpack_exports__.GF;
|
|
104
|
+
var __webpack_exports__GetCompanyUsersDto = __webpack_exports__.xx;
|
|
93
105
|
var __webpack_exports__LoginDto = __webpack_exports__.pb;
|
|
94
106
|
var __webpack_exports__LoginResponseDto = __webpack_exports__.gw;
|
|
95
107
|
var __webpack_exports__LoginResponseRequiresEmailVerificationDto = __webpack_exports__.rn;
|
|
@@ -120,4 +132,4 @@ var __webpack_exports__UserInfoDto = __webpack_exports__.dp;
|
|
|
120
132
|
var __webpack_exports__UserLookupResponseDto = __webpack_exports__.sx;
|
|
121
133
|
var __webpack_exports__UserResponseDto = __webpack_exports__.kq;
|
|
122
134
|
var __webpack_exports__VerifyEmailDto = __webpack_exports__.rl;
|
|
123
|
-
export { __webpack_exports__AssignUserBranchDto as AssignUserBranchDto, __webpack_exports__AssignUserCompanyDto as AssignUserCompanyDto, __webpack_exports__BranchInfoDto as BranchInfoDto, __webpack_exports__BranchSelectionInfoDto as BranchSelectionInfoDto, __webpack_exports__ChangePasswordDto as ChangePasswordDto, __webpack_exports__CompanyBranchResponseDto as CompanyBranchResponseDto, __webpack_exports__CompanyInfoDto as CompanyInfoDto, __webpack_exports__CompanyResponseDto as CompanyResponseDto, __webpack_exports__CompanySelectionResponseDto as CompanySelectionResponseDto, __webpack_exports__CompanyWithBranchesDto as CompanyWithBranchesDto, __webpack_exports__CreateCompanyBranchDto as CreateCompanyBranchDto, __webpack_exports__CreateCompanyDto as CreateCompanyDto, __webpack_exports__CreateSocialAuthConfigDto as CreateSocialAuthConfigDto, __webpack_exports__CreateUserDto as CreateUserDto, __webpack_exports__ForgotPasswordDto as ForgotPasswordDto, __webpack_exports__LoginDto as LoginDto, __webpack_exports__LoginResponseDto as LoginResponseDto, __webpack_exports__LoginResponseRequiresEmailVerificationDto as LoginResponseRequiresEmailVerificationDto, __webpack_exports__MeResponseDto as MeResponseDto, __webpack_exports__PermissionItemDto as PermissionItemDto, __webpack_exports__RefreshTokenDto as RefreshTokenDto, __webpack_exports__RegistrationDto as RegistrationDto, __webpack_exports__RegistrationResponseDto as RegistrationResponseDto, __webpack_exports__ResendVerificationDto as ResendVerificationDto, __webpack_exports__ResetPasswordDto as ResetPasswordDto, __webpack_exports__SelectDto as SelectDto, __webpack_exports__SocialAuthConfigResponseDto as SocialAuthConfigResponseDto, __webpack_exports__SocialAuthorizeDto as SocialAuthorizeDto, __webpack_exports__SocialAuthorizeResponseDto as SocialAuthorizeResponseDto, __webpack_exports__SocialCallbackDto as SocialCallbackDto, __webpack_exports__SocialProviderInfoDto as SocialProviderInfoDto, __webpack_exports__SocialProvidersDto as SocialProvidersDto, __webpack_exports__SwitchCompanyDto as SwitchCompanyDto, __webpack_exports__UpdateCompanyBranchDto as UpdateCompanyBranchDto, __webpack_exports__UpdateCompanyDto as UpdateCompanyDto, __webpack_exports__UpdateSocialAuthConfigDto as UpdateSocialAuthConfigDto, __webpack_exports__UpdateUserDto as UpdateUserDto, __webpack_exports__UserBranchPermissionDto as UserBranchPermissionDto, __webpack_exports__UserBranchesResponseDto as UserBranchesResponseDto, __webpack_exports__UserCompaniesResponseDto as UserCompaniesResponseDto, __webpack_exports__UserCompanyPermissionDto as UserCompanyPermissionDto, __webpack_exports__UserInfoDto as UserInfoDto, __webpack_exports__UserLookupResponseDto as UserLookupResponseDto, __webpack_exports__UserResponseDto as UserResponseDto, __webpack_exports__VerifyEmailDto as VerifyEmailDto };
|
|
135
|
+
export { __webpack_exports__AssignUserBranchDto as AssignUserBranchDto, __webpack_exports__AssignUserCompanyDto as AssignUserCompanyDto, __webpack_exports__BranchInfoDto as BranchInfoDto, __webpack_exports__BranchPermittedUserDto as BranchPermittedUserDto, __webpack_exports__BranchPermittedUsersResponseDto as BranchPermittedUsersResponseDto, __webpack_exports__BranchSelectionInfoDto as BranchSelectionInfoDto, __webpack_exports__ChangePasswordDto as ChangePasswordDto, __webpack_exports__CompanyBranchResponseDto as CompanyBranchResponseDto, __webpack_exports__CompanyInfoDto as CompanyInfoDto, __webpack_exports__CompanyPermittedUserDto as CompanyPermittedUserDto, __webpack_exports__CompanyPermittedUsersResponseDto as CompanyPermittedUsersResponseDto, __webpack_exports__CompanyResponseDto as CompanyResponseDto, __webpack_exports__CompanySelectionResponseDto as CompanySelectionResponseDto, __webpack_exports__CompanyWithBranchesDto as CompanyWithBranchesDto, __webpack_exports__CreateCompanyBranchDto as CreateCompanyBranchDto, __webpack_exports__CreateCompanyDto as CreateCompanyDto, __webpack_exports__CreateSocialAuthConfigDto as CreateSocialAuthConfigDto, __webpack_exports__CreateUserDto as CreateUserDto, __webpack_exports__ForgotPasswordDto as ForgotPasswordDto, __webpack_exports__GetBranchUsersDto as GetBranchUsersDto, __webpack_exports__GetCompanyUsersDto as GetCompanyUsersDto, __webpack_exports__LoginDto as LoginDto, __webpack_exports__LoginResponseDto as LoginResponseDto, __webpack_exports__LoginResponseRequiresEmailVerificationDto as LoginResponseRequiresEmailVerificationDto, __webpack_exports__MeResponseDto as MeResponseDto, __webpack_exports__PermissionItemDto as PermissionItemDto, __webpack_exports__RefreshTokenDto as RefreshTokenDto, __webpack_exports__RegistrationDto as RegistrationDto, __webpack_exports__RegistrationResponseDto as RegistrationResponseDto, __webpack_exports__ResendVerificationDto as ResendVerificationDto, __webpack_exports__ResetPasswordDto as ResetPasswordDto, __webpack_exports__SelectDto as SelectDto, __webpack_exports__SocialAuthConfigResponseDto as SocialAuthConfigResponseDto, __webpack_exports__SocialAuthorizeDto as SocialAuthorizeDto, __webpack_exports__SocialAuthorizeResponseDto as SocialAuthorizeResponseDto, __webpack_exports__SocialCallbackDto as SocialCallbackDto, __webpack_exports__SocialProviderInfoDto as SocialProviderInfoDto, __webpack_exports__SocialProvidersDto as SocialProvidersDto, __webpack_exports__SwitchCompanyDto as SwitchCompanyDto, __webpack_exports__UpdateCompanyBranchDto as UpdateCompanyBranchDto, __webpack_exports__UpdateCompanyDto as UpdateCompanyDto, __webpack_exports__UpdateSocialAuthConfigDto as UpdateSocialAuthConfigDto, __webpack_exports__UpdateUserDto as UpdateUserDto, __webpack_exports__UserBranchPermissionDto as UserBranchPermissionDto, __webpack_exports__UserBranchesResponseDto as UserBranchesResponseDto, __webpack_exports__UserCompaniesResponseDto as UserCompaniesResponseDto, __webpack_exports__UserCompanyPermissionDto as UserCompanyPermissionDto, __webpack_exports__UserInfoDto as UserInfoDto, __webpack_exports__UserLookupResponseDto as UserLookupResponseDto, __webpack_exports__UserResponseDto as UserResponseDto, __webpack_exports__VerifyEmailDto as VerifyEmailDto };
|
package/fesm/index.js
CHANGED
|
@@ -523,6 +523,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
523
523
|
DU: () => (/* reexport safe */ _user_permission_dto_js__rspack_import_5.DU),
|
|
524
524
|
ET: () => (/* reexport safe */ _company_branch_dto_js__rspack_import_1.ET),
|
|
525
525
|
G3: () => (/* reexport safe */ _authentication_dto_js__rspack_import_0.G3),
|
|
526
|
+
GF: () => (/* reexport safe */ _user_permission_dto_js__rspack_import_5.GF),
|
|
526
527
|
Ky: () => (/* reexport safe */ _company_dto_js__rspack_import_2.Ky),
|
|
527
528
|
LU: () => (/* reexport safe */ _user_permission_dto_js__rspack_import_5.LU),
|
|
528
529
|
Oo: () => (/* reexport safe */ _company_branch_dto_js__rspack_import_1.Oo),
|
|
@@ -541,14 +542,17 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
541
542
|
Vw: () => (/* reexport safe */ _company_branch_dto_js__rspack_import_1.Vw),
|
|
542
543
|
X8: () => (/* reexport safe */ _social_auth_dto_js__rspack_import_3.X8),
|
|
543
544
|
_M: () => (/* reexport safe */ _authentication_dto_js__rspack_import_0._M),
|
|
545
|
+
a: () => (/* reexport safe */ _user_permission_dto_js__rspack_import_5.a),
|
|
544
546
|
a2: () => (/* reexport safe */ _social_auth_dto_js__rspack_import_3.a2),
|
|
545
547
|
aZ: () => (/* reexport safe */ _authentication_dto_js__rspack_import_0.aZ),
|
|
548
|
+
bK: () => (/* reexport safe */ _user_permission_dto_js__rspack_import_5.bK),
|
|
546
549
|
cd: () => (/* reexport safe */ _company_dto_js__rspack_import_2.cd),
|
|
547
550
|
dp: () => (/* reexport safe */ _authentication_dto_js__rspack_import_0.dp),
|
|
548
551
|
fF: () => (/* reexport safe */ _authentication_dto_js__rspack_import_0.fF),
|
|
549
552
|
fP: () => (/* reexport safe */ _social_auth_dto_js__rspack_import_3.fP),
|
|
550
553
|
gw: () => (/* reexport safe */ _authentication_dto_js__rspack_import_0.gw),
|
|
551
554
|
iJ: () => (/* reexport safe */ _authentication_dto_js__rspack_import_0.iJ),
|
|
555
|
+
i_: () => (/* reexport safe */ _user_permission_dto_js__rspack_import_5.i_),
|
|
552
556
|
k2: () => (/* reexport safe */ _authentication_dto_js__rspack_import_0.k2),
|
|
553
557
|
kd: () => (/* reexport safe */ _social_auth_dto_js__rspack_import_3.kd),
|
|
554
558
|
kq: () => (/* reexport safe */ _user_dto_js__rspack_import_4.kq),
|
|
@@ -561,9 +565,11 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
561
565
|
rn: () => (/* reexport safe */ _authentication_dto_js__rspack_import_0.rn),
|
|
562
566
|
s4: () => (/* reexport safe */ _social_auth_dto_js__rspack_import_3.s4),
|
|
563
567
|
sx: () => (/* reexport safe */ _user_dto_js__rspack_import_4.sx),
|
|
568
|
+
tu: () => (/* reexport safe */ _user_permission_dto_js__rspack_import_5.tu),
|
|
564
569
|
vb: () => (/* reexport safe */ _authentication_dto_js__rspack_import_0.vb),
|
|
565
570
|
wc: () => (/* reexport safe */ _user_permission_dto_js__rspack_import_5.wc),
|
|
566
|
-
xG: () => (/* reexport safe */ _authentication_dto_js__rspack_import_0.xG)
|
|
571
|
+
xG: () => (/* reexport safe */ _authentication_dto_js__rspack_import_0.xG),
|
|
572
|
+
xx: () => (/* reexport safe */ _user_permission_dto_js__rspack_import_5.xx)
|
|
567
573
|
});
|
|
568
574
|
|
|
569
575
|
|
|
@@ -684,6 +690,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
684
690
|
W1: () => (/* reexport */ config/* .BRANCH_MESSAGES */.W1),
|
|
685
691
|
zF: () => (/* reexport */ controllers/* .BranchController */.zF),
|
|
686
692
|
UQ: () => (/* reexport */ dtos/* .BranchInfoDto */.UQ),
|
|
693
|
+
tu: () => (/* reexport */ dtos/* .BranchPermittedUserDto */.tu),
|
|
694
|
+
bK: () => (/* reexport */ dtos/* .BranchPermittedUsersResponseDto */.bK),
|
|
687
695
|
G3: () => (/* reexport */ dtos/* .BranchSelectionInfoDto */.G3),
|
|
688
696
|
O_: () => (/* reexport */ services/* .BranchService */.O_),
|
|
689
697
|
hg: () => (/* reexport */ config/* .COMPANY_MESSAGES */.hg),
|
|
@@ -694,6 +702,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
694
702
|
ET: () => (/* reexport */ dtos/* .CompanyBranchResponseDto */.ET),
|
|
695
703
|
wD: () => (/* reexport */ controllers/* .CompanyController */.wD),
|
|
696
704
|
fF: () => (/* reexport */ dtos/* .CompanyInfoDto */.fF),
|
|
705
|
+
i_: () => (/* reexport */ dtos/* .CompanyPermittedUserDto */.i_),
|
|
706
|
+
a: () => (/* reexport */ dtos/* .CompanyPermittedUsersResponseDto */.a),
|
|
697
707
|
cd: () => (/* reexport */ dtos/* .CompanyResponseDto */.cd),
|
|
698
708
|
Qg: () => (/* reexport */ controllers/* .CompanySelectionController */.Qg),
|
|
699
709
|
iJ: () => (/* reexport */ dtos/* .CompanySelectionResponseDto */.iJ),
|
|
@@ -708,6 +718,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
708
718
|
sv: () => (/* reexport */ config/* .EMAIL_VERIFICATION_MESSAGES */.sv),
|
|
709
719
|
Q1: () => (/* reexport */ controllers/* .EmailVerificationController */.Q1),
|
|
710
720
|
mG: () => (/* reexport */ dtos/* .ForgotPasswordDto */.mG),
|
|
721
|
+
GF: () => (/* reexport */ dtos/* .GetBranchUsersDto */.GF),
|
|
722
|
+
xx: () => (/* reexport */ dtos/* .GetCompanyUsersDto */.xx),
|
|
711
723
|
Ps: () => (/* reexport */ jwt_strategy/* .JwtStrategy */.P),
|
|
712
724
|
pb: () => (/* reexport */ dtos/* .LoginDto */.pb),
|
|
713
725
|
gw: () => (/* reexport */ dtos/* .LoginResponseDto */.gw),
|
|
@@ -1345,6 +1357,8 @@ var __webpack_exports__BCRYPT_SALT_ROUNDS = __webpack_exports__.aK;
|
|
|
1345
1357
|
var __webpack_exports__BRANCH_MESSAGES = __webpack_exports__.W1;
|
|
1346
1358
|
var __webpack_exports__BranchController = __webpack_exports__.zF;
|
|
1347
1359
|
var __webpack_exports__BranchInfoDto = __webpack_exports__.UQ;
|
|
1360
|
+
var __webpack_exports__BranchPermittedUserDto = __webpack_exports__.tu;
|
|
1361
|
+
var __webpack_exports__BranchPermittedUsersResponseDto = __webpack_exports__.bK;
|
|
1348
1362
|
var __webpack_exports__BranchSelectionInfoDto = __webpack_exports__.G3;
|
|
1349
1363
|
var __webpack_exports__BranchService = __webpack_exports__.O_;
|
|
1350
1364
|
var __webpack_exports__COMPANY_MESSAGES = __webpack_exports__.hg;
|
|
@@ -1355,6 +1369,8 @@ var __webpack_exports__CompanyBranch = __webpack_exports__.At;
|
|
|
1355
1369
|
var __webpack_exports__CompanyBranchResponseDto = __webpack_exports__.ET;
|
|
1356
1370
|
var __webpack_exports__CompanyController = __webpack_exports__.wD;
|
|
1357
1371
|
var __webpack_exports__CompanyInfoDto = __webpack_exports__.fF;
|
|
1372
|
+
var __webpack_exports__CompanyPermittedUserDto = __webpack_exports__.i_;
|
|
1373
|
+
var __webpack_exports__CompanyPermittedUsersResponseDto = __webpack_exports__.a;
|
|
1358
1374
|
var __webpack_exports__CompanyResponseDto = __webpack_exports__.cd;
|
|
1359
1375
|
var __webpack_exports__CompanySelectionController = __webpack_exports__.Qg;
|
|
1360
1376
|
var __webpack_exports__CompanySelectionResponseDto = __webpack_exports__.iJ;
|
|
@@ -1369,6 +1385,8 @@ var __webpack_exports__DEFAULT_COOKIE_NAME = __webpack_exports__.rv;
|
|
|
1369
1385
|
var __webpack_exports__EMAIL_VERIFICATION_MESSAGES = __webpack_exports__.sv;
|
|
1370
1386
|
var __webpack_exports__EmailVerificationController = __webpack_exports__.Q1;
|
|
1371
1387
|
var __webpack_exports__ForgotPasswordDto = __webpack_exports__.mG;
|
|
1388
|
+
var __webpack_exports__GetBranchUsersDto = __webpack_exports__.GF;
|
|
1389
|
+
var __webpack_exports__GetCompanyUsersDto = __webpack_exports__.xx;
|
|
1372
1390
|
var __webpack_exports__JwtStrategy = __webpack_exports__.Ps;
|
|
1373
1391
|
var __webpack_exports__LoginDto = __webpack_exports__.pb;
|
|
1374
1392
|
var __webpack_exports__LoginResponseDto = __webpack_exports__.gw;
|
|
@@ -1434,4 +1452,4 @@ var __webpack_exports__parseExpiryToMs = __webpack_exports__.om;
|
|
|
1434
1452
|
var __webpack_exports__toBranchInfo = __webpack_exports__.QH;
|
|
1435
1453
|
var __webpack_exports__toCompanyInfo = __webpack_exports__.$C;
|
|
1436
1454
|
var __webpack_exports__toUserInfo = __webpack_exports__.FV;
|
|
1437
|
-
export { __webpack_exports__AUTH_EMAIL_PROVIDER as AUTH_EMAIL_PROVIDER, __webpack_exports__AUTH_EVENT_ACTIONS as AUTH_EVENT_ACTIONS, __webpack_exports__AUTH_EVENT_ENTITIES as AUTH_EVENT_ENTITIES, __webpack_exports__AUTH_EVENT_MODULE as AUTH_EVENT_MODULE, __webpack_exports__AUTH_MESSAGES as AUTH_MESSAGES, __webpack_exports__AUTH_MODULE_OPTIONS as AUTH_MODULE_OPTIONS, __webpack_exports__AppUser as AppUser, __webpack_exports__AssignUserBranchDto as AssignUserBranchDto, __webpack_exports__AssignUserCompanyDto as AssignUserCompanyDto, __webpack_exports__AuthConfigService as AuthConfigService, __webpack_exports__AuthDataSourceProvider as AuthDataSourceProvider, __webpack_exports__AuthEmailService as AuthEmailService, __webpack_exports__AuthModule as AuthModule, __webpack_exports__AuthenticationController as AuthenticationController, __webpack_exports__AuthenticationService as AuthenticationService, __webpack_exports__BCRYPT_SALT_ROUNDS as BCRYPT_SALT_ROUNDS, __webpack_exports__BRANCH_MESSAGES as BRANCH_MESSAGES, __webpack_exports__BranchController as BranchController, __webpack_exports__BranchInfoDto as BranchInfoDto, __webpack_exports__BranchSelectionInfoDto as BranchSelectionInfoDto, __webpack_exports__BranchService as BranchService, __webpack_exports__COMPANY_MESSAGES as COMPANY_MESSAGES, __webpack_exports__ChangePasswordDto as ChangePasswordDto, __webpack_exports__ClearToken as ClearToken, __webpack_exports__Company as Company, __webpack_exports__CompanyBranch as CompanyBranch, __webpack_exports__CompanyBranchResponseDto as CompanyBranchResponseDto, __webpack_exports__CompanyController as CompanyController, __webpack_exports__CompanyInfoDto as CompanyInfoDto, __webpack_exports__CompanyResponseDto as CompanyResponseDto, __webpack_exports__CompanySelectionController as CompanySelectionController, __webpack_exports__CompanySelectionResponseDto as CompanySelectionResponseDto, __webpack_exports__CompanySelectionSessionService as CompanySelectionSessionService, __webpack_exports__CompanyService as CompanyService, __webpack_exports__CompanyWithBranchesDto as CompanyWithBranchesDto, __webpack_exports__CreateCompanyBranchDto as CreateCompanyBranchDto, __webpack_exports__CreateCompanyDto as CreateCompanyDto, __webpack_exports__CreateSocialAuthConfigDto as CreateSocialAuthConfigDto, __webpack_exports__CreateUserDto as CreateUserDto, __webpack_exports__DEFAULT_COOKIE_NAME as DEFAULT_COOKIE_NAME, __webpack_exports__EMAIL_VERIFICATION_MESSAGES as EMAIL_VERIFICATION_MESSAGES, __webpack_exports__EmailVerificationController as EmailVerificationController, __webpack_exports__ForgotPasswordDto as ForgotPasswordDto, __webpack_exports__JwtStrategy as JwtStrategy, __webpack_exports__LoginDto as LoginDto, __webpack_exports__LoginResponseDto as LoginResponseDto, __webpack_exports__LoginResponseRequiresEmailVerificationDto as LoginResponseRequiresEmailVerificationDto, __webpack_exports__MAX_COOKIE_BYTES as MAX_COOKIE_BYTES, __webpack_exports__MeResponseDto as MeResponseDto, __webpack_exports__PendingRegistration as PendingRegistration, __webpack_exports__PermissionItemDto as PermissionItemDto, __webpack_exports__PermissionType as PermissionType, __webpack_exports__RefreshTokenDto as RefreshTokenDto, __webpack_exports__RegistrationDto as RegistrationDto, __webpack_exports__RegistrationResponseDto as RegistrationResponseDto, __webpack_exports__ResendVerificationDto as ResendVerificationDto, __webpack_exports__ResetPasswordDto as ResetPasswordDto, __webpack_exports__SESSION_CACHE_PREFIX as SESSION_CACHE_PREFIX, __webpack_exports__SOCIAL_AUTH_CONFIG_MESSAGES as SOCIAL_AUTH_CONFIG_MESSAGES, __webpack_exports__SOCIAL_AUTH_MESSAGES as SOCIAL_AUTH_MESSAGES, __webpack_exports__SOCIAL_STATE_PREFIX as SOCIAL_STATE_PREFIX, __webpack_exports__SOCIAL_STATE_TTL_MS as SOCIAL_STATE_TTL_MS, __webpack_exports__SelectDto as SelectDto, __webpack_exports__SetToken as SetToken, __webpack_exports__SocialAuthConfig as SocialAuthConfig, __webpack_exports__SocialAuthConfigController as SocialAuthConfigController, __webpack_exports__SocialAuthConfigResponseDto as SocialAuthConfigResponseDto, __webpack_exports__SocialAuthConfigService as SocialAuthConfigService, __webpack_exports__SocialAuthController as SocialAuthController, __webpack_exports__SocialAuthService as SocialAuthService, __webpack_exports__SocialAuthorizeDto as SocialAuthorizeDto, __webpack_exports__SocialAuthorizeResponseDto as SocialAuthorizeResponseDto, __webpack_exports__SocialCallbackDto as SocialCallbackDto, __webpack_exports__SocialProviderInfoDto as SocialProviderInfoDto, __webpack_exports__SocialProviderTypeEnum as SocialProviderTypeEnum, __webpack_exports__SocialProvidersDto as SocialProvidersDto, __webpack_exports__SwitchCompanyDto as SwitchCompanyDto, __webpack_exports__TOKEN_REVOKED_PREFIX as TOKEN_REVOKED_PREFIX, __webpack_exports__TokenType as TokenType, __webpack_exports__USER_ENRICHER as USER_ENRICHER, __webpack_exports__USER_MESSAGES as USER_MESSAGES, __webpack_exports__USER_PERMISSION_MESSAGES as USER_PERMISSION_MESSAGES, __webpack_exports__UpdateCompanyBranchDto as UpdateCompanyBranchDto, __webpack_exports__UpdateCompanyDto as UpdateCompanyDto, __webpack_exports__UpdateSocialAuthConfigDto as UpdateSocialAuthConfigDto, __webpack_exports__UpdateUserDto as UpdateUserDto, __webpack_exports__UserBranchPermissionDto as UserBranchPermissionDto, __webpack_exports__UserBranchesResponseDto as UserBranchesResponseDto, __webpack_exports__UserCompaniesResponseDto as UserCompaniesResponseDto, __webpack_exports__UserCompanyPermission as UserCompanyPermission, __webpack_exports__UserCompanyPermissionDto as UserCompanyPermissionDto, __webpack_exports__UserController as UserController, __webpack_exports__UserInfoDto as UserInfoDto, __webpack_exports__UserLookupResponseDto as UserLookupResponseDto, __webpack_exports__UserPermissionController as UserPermissionController, __webpack_exports__UserPermissionService as UserPermissionService, __webpack_exports__UserResponseDto as UserResponseDto, __webpack_exports__UserService as UserService, __webpack_exports__UserToken as UserToken, __webpack_exports__VerifyEmailDto as VerifyEmailDto, __webpack_exports__authSwaggerConfig as authSwaggerConfig, __webpack_exports__generateTokens as generateTokens, __webpack_exports__getAuthEntitiesByConfig as getAuthEntitiesByConfig, __webpack_exports__getSocialProvider as getSocialProvider, __webpack_exports__parseExpiryToMs as parseExpiryToMs, __webpack_exports__toBranchInfo as toBranchInfo, __webpack_exports__toCompanyInfo as toCompanyInfo, __webpack_exports__toUserInfo as toUserInfo };
|
|
1455
|
+
export { __webpack_exports__AUTH_EMAIL_PROVIDER as AUTH_EMAIL_PROVIDER, __webpack_exports__AUTH_EVENT_ACTIONS as AUTH_EVENT_ACTIONS, __webpack_exports__AUTH_EVENT_ENTITIES as AUTH_EVENT_ENTITIES, __webpack_exports__AUTH_EVENT_MODULE as AUTH_EVENT_MODULE, __webpack_exports__AUTH_MESSAGES as AUTH_MESSAGES, __webpack_exports__AUTH_MODULE_OPTIONS as AUTH_MODULE_OPTIONS, __webpack_exports__AppUser as AppUser, __webpack_exports__AssignUserBranchDto as AssignUserBranchDto, __webpack_exports__AssignUserCompanyDto as AssignUserCompanyDto, __webpack_exports__AuthConfigService as AuthConfigService, __webpack_exports__AuthDataSourceProvider as AuthDataSourceProvider, __webpack_exports__AuthEmailService as AuthEmailService, __webpack_exports__AuthModule as AuthModule, __webpack_exports__AuthenticationController as AuthenticationController, __webpack_exports__AuthenticationService as AuthenticationService, __webpack_exports__BCRYPT_SALT_ROUNDS as BCRYPT_SALT_ROUNDS, __webpack_exports__BRANCH_MESSAGES as BRANCH_MESSAGES, __webpack_exports__BranchController as BranchController, __webpack_exports__BranchInfoDto as BranchInfoDto, __webpack_exports__BranchPermittedUserDto as BranchPermittedUserDto, __webpack_exports__BranchPermittedUsersResponseDto as BranchPermittedUsersResponseDto, __webpack_exports__BranchSelectionInfoDto as BranchSelectionInfoDto, __webpack_exports__BranchService as BranchService, __webpack_exports__COMPANY_MESSAGES as COMPANY_MESSAGES, __webpack_exports__ChangePasswordDto as ChangePasswordDto, __webpack_exports__ClearToken as ClearToken, __webpack_exports__Company as Company, __webpack_exports__CompanyBranch as CompanyBranch, __webpack_exports__CompanyBranchResponseDto as CompanyBranchResponseDto, __webpack_exports__CompanyController as CompanyController, __webpack_exports__CompanyInfoDto as CompanyInfoDto, __webpack_exports__CompanyPermittedUserDto as CompanyPermittedUserDto, __webpack_exports__CompanyPermittedUsersResponseDto as CompanyPermittedUsersResponseDto, __webpack_exports__CompanyResponseDto as CompanyResponseDto, __webpack_exports__CompanySelectionController as CompanySelectionController, __webpack_exports__CompanySelectionResponseDto as CompanySelectionResponseDto, __webpack_exports__CompanySelectionSessionService as CompanySelectionSessionService, __webpack_exports__CompanyService as CompanyService, __webpack_exports__CompanyWithBranchesDto as CompanyWithBranchesDto, __webpack_exports__CreateCompanyBranchDto as CreateCompanyBranchDto, __webpack_exports__CreateCompanyDto as CreateCompanyDto, __webpack_exports__CreateSocialAuthConfigDto as CreateSocialAuthConfigDto, __webpack_exports__CreateUserDto as CreateUserDto, __webpack_exports__DEFAULT_COOKIE_NAME as DEFAULT_COOKIE_NAME, __webpack_exports__EMAIL_VERIFICATION_MESSAGES as EMAIL_VERIFICATION_MESSAGES, __webpack_exports__EmailVerificationController as EmailVerificationController, __webpack_exports__ForgotPasswordDto as ForgotPasswordDto, __webpack_exports__GetBranchUsersDto as GetBranchUsersDto, __webpack_exports__GetCompanyUsersDto as GetCompanyUsersDto, __webpack_exports__JwtStrategy as JwtStrategy, __webpack_exports__LoginDto as LoginDto, __webpack_exports__LoginResponseDto as LoginResponseDto, __webpack_exports__LoginResponseRequiresEmailVerificationDto as LoginResponseRequiresEmailVerificationDto, __webpack_exports__MAX_COOKIE_BYTES as MAX_COOKIE_BYTES, __webpack_exports__MeResponseDto as MeResponseDto, __webpack_exports__PendingRegistration as PendingRegistration, __webpack_exports__PermissionItemDto as PermissionItemDto, __webpack_exports__PermissionType as PermissionType, __webpack_exports__RefreshTokenDto as RefreshTokenDto, __webpack_exports__RegistrationDto as RegistrationDto, __webpack_exports__RegistrationResponseDto as RegistrationResponseDto, __webpack_exports__ResendVerificationDto as ResendVerificationDto, __webpack_exports__ResetPasswordDto as ResetPasswordDto, __webpack_exports__SESSION_CACHE_PREFIX as SESSION_CACHE_PREFIX, __webpack_exports__SOCIAL_AUTH_CONFIG_MESSAGES as SOCIAL_AUTH_CONFIG_MESSAGES, __webpack_exports__SOCIAL_AUTH_MESSAGES as SOCIAL_AUTH_MESSAGES, __webpack_exports__SOCIAL_STATE_PREFIX as SOCIAL_STATE_PREFIX, __webpack_exports__SOCIAL_STATE_TTL_MS as SOCIAL_STATE_TTL_MS, __webpack_exports__SelectDto as SelectDto, __webpack_exports__SetToken as SetToken, __webpack_exports__SocialAuthConfig as SocialAuthConfig, __webpack_exports__SocialAuthConfigController as SocialAuthConfigController, __webpack_exports__SocialAuthConfigResponseDto as SocialAuthConfigResponseDto, __webpack_exports__SocialAuthConfigService as SocialAuthConfigService, __webpack_exports__SocialAuthController as SocialAuthController, __webpack_exports__SocialAuthService as SocialAuthService, __webpack_exports__SocialAuthorizeDto as SocialAuthorizeDto, __webpack_exports__SocialAuthorizeResponseDto as SocialAuthorizeResponseDto, __webpack_exports__SocialCallbackDto as SocialCallbackDto, __webpack_exports__SocialProviderInfoDto as SocialProviderInfoDto, __webpack_exports__SocialProviderTypeEnum as SocialProviderTypeEnum, __webpack_exports__SocialProvidersDto as SocialProvidersDto, __webpack_exports__SwitchCompanyDto as SwitchCompanyDto, __webpack_exports__TOKEN_REVOKED_PREFIX as TOKEN_REVOKED_PREFIX, __webpack_exports__TokenType as TokenType, __webpack_exports__USER_ENRICHER as USER_ENRICHER, __webpack_exports__USER_MESSAGES as USER_MESSAGES, __webpack_exports__USER_PERMISSION_MESSAGES as USER_PERMISSION_MESSAGES, __webpack_exports__UpdateCompanyBranchDto as UpdateCompanyBranchDto, __webpack_exports__UpdateCompanyDto as UpdateCompanyDto, __webpack_exports__UpdateSocialAuthConfigDto as UpdateSocialAuthConfigDto, __webpack_exports__UpdateUserDto as UpdateUserDto, __webpack_exports__UserBranchPermissionDto as UserBranchPermissionDto, __webpack_exports__UserBranchesResponseDto as UserBranchesResponseDto, __webpack_exports__UserCompaniesResponseDto as UserCompaniesResponseDto, __webpack_exports__UserCompanyPermission as UserCompanyPermission, __webpack_exports__UserCompanyPermissionDto as UserCompanyPermissionDto, __webpack_exports__UserController as UserController, __webpack_exports__UserInfoDto as UserInfoDto, __webpack_exports__UserLookupResponseDto as UserLookupResponseDto, __webpack_exports__UserPermissionController as UserPermissionController, __webpack_exports__UserPermissionService as UserPermissionService, __webpack_exports__UserResponseDto as UserResponseDto, __webpack_exports__UserService as UserService, __webpack_exports__UserToken as UserToken, __webpack_exports__VerifyEmailDto as VerifyEmailDto, __webpack_exports__authSwaggerConfig as authSwaggerConfig, __webpack_exports__generateTokens as generateTokens, __webpack_exports__getAuthEntitiesByConfig as getAuthEntitiesByConfig, __webpack_exports__getSocialProvider as getSocialProvider, __webpack_exports__parseExpiryToMs as parseExpiryToMs, __webpack_exports__toBranchInfo as toBranchInfo, __webpack_exports__toCompanyInfo as toCompanyInfo, __webpack_exports__toUserInfo as toUserInfo };
|
|
@@ -131,6 +131,8 @@ const BRANCH_MESSAGES = {
|
|
|
131
131
|
const USER_PERMISSION_MESSAGES = {
|
|
132
132
|
COMPANY_LIST_SUCCESS: 'user.permission.company.list.success',
|
|
133
133
|
BRANCH_LIST_SUCCESS: 'user.permission.branch.list.success',
|
|
134
|
+
COMPANY_USERS_SUCCESS: 'user.permission.company.users.success',
|
|
135
|
+
BRANCH_USERS_SUCCESS: 'user.permission.branch.users.success',
|
|
134
136
|
BATCH_SUCCESS: 'user.permission.batch.success',
|
|
135
137
|
ALREADY_ASSIGNED: 'user.permission.already.assigned',
|
|
136
138
|
PERMISSION_NOT_FOUND: 'user.permission.not.found',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flusys/nestjs-auth",
|
|
3
|
-
"version": "8.0.0
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"description": "Authentication and authorization infrastructure for NestJS applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./fesm/index.js",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"rxjs": "^7.8.0"
|
|
92
92
|
},
|
|
93
93
|
"dependencies": {
|
|
94
|
-
"@flusys/nestjs-core": "8.0.0
|
|
95
|
-
"@flusys/nestjs-shared": "8.0.0
|
|
94
|
+
"@flusys/nestjs-core": "8.0.0",
|
|
95
|
+
"@flusys/nestjs-shared": "8.0.0"
|
|
96
96
|
}
|
|
97
97
|
}
|
|
@@ -18,4 +18,6 @@ export declare class UserPermissionService {
|
|
|
18
18
|
private revokeBranchPermissionsForCompany;
|
|
19
19
|
findUserCompanies: (userId: string) => Promise<UserCompanyPermission[]>;
|
|
20
20
|
findUserBranches(userId: string, companyId?: string): Promise<UserCompanyPermission[]>;
|
|
21
|
+
findUsersForCompany(companyId: string): Promise<UserCompanyPermission[]>;
|
|
22
|
+
findUsersForBranch(branchId: string): Promise<UserCompanyPermission[]>;
|
|
21
23
|
}
|