@neohm/nestend 3.3.1 → 3.3.3
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/README.md +100 -3
- package/dist/admin/controllers/admin.system.user.controller.d.ts +24 -0
- package/dist/admin/controllers/admin.system.user.controller.d.ts.map +1 -0
- package/dist/admin/controllers/admin.system.user.controller.js +107 -0
- package/dist/admin/controllers/admin.system.user.controller.js.map +1 -0
- package/dist/admin/dtos/add.system.user.dto.d.ts +5 -0
- package/dist/admin/dtos/add.system.user.dto.d.ts.map +1 -0
- package/dist/admin/dtos/add.system.user.dto.js +28 -0
- package/dist/admin/dtos/add.system.user.dto.js.map +1 -0
- package/dist/admin/dtos/system.user.list.dto.d.ts +4 -0
- package/dist/admin/dtos/system.user.list.dto.d.ts.map +1 -0
- package/dist/admin/dtos/system.user.list.dto.js +8 -0
- package/dist/admin/dtos/system.user.list.dto.js.map +1 -0
- package/dist/admin/es6.classes.d.ts +7 -3
- package/dist/admin/es6.classes.d.ts.map +1 -1
- package/dist/admin/es6.classes.js +12 -1
- package/dist/admin/es6.classes.js.map +1 -1
- package/dist/admin/libraries/system.user.data.processor.d.ts +12 -0
- package/dist/admin/libraries/system.user.data.processor.d.ts.map +1 -0
- package/dist/admin/libraries/system.user.data.processor.js +69 -0
- package/dist/admin/libraries/system.user.data.processor.js.map +1 -0
- package/dist/admin/libraries/system.user.list.processor.d.ts +15 -0
- package/dist/admin/libraries/system.user.list.processor.d.ts.map +1 -0
- package/dist/admin/libraries/system.user.list.processor.js +50 -0
- package/dist/admin/libraries/system.user.list.processor.js.map +1 -0
- package/dist/admin/services/system.user.service.d.ts +6 -0
- package/dist/admin/services/system.user.service.d.ts.map +1 -0
- package/dist/admin/services/system.user.service.js +34 -0
- package/dist/admin/services/system.user.service.js.map +1 -0
- package/dist/auth/auth.module.d.ts.map +1 -1
- package/dist/auth/auth.module.js +12 -1
- package/dist/auth/auth.module.js.map +1 -1
- package/dist/auth/controllers/auth.controller.d.ts.map +1 -1
- package/dist/auth/controllers/auth.controller.js +2 -0
- package/dist/auth/controllers/auth.controller.js.map +1 -1
- package/dist/auth/controllers/impersonation.controller.d.ts +13 -0
- package/dist/auth/controllers/impersonation.controller.d.ts.map +1 -0
- package/dist/auth/controllers/impersonation.controller.js +66 -0
- package/dist/auth/controllers/impersonation.controller.js.map +1 -0
- package/dist/auth/dtos/impersonation.login.dto.d.ts +5 -0
- package/dist/auth/dtos/impersonation.login.dto.d.ts.map +1 -0
- package/dist/auth/dtos/impersonation.login.dto.js +25 -0
- package/dist/auth/dtos/impersonation.login.dto.js.map +1 -0
- package/dist/auth/entities/system.auth.session.entity.d.ts +1 -0
- package/dist/auth/entities/system.auth.session.entity.d.ts.map +1 -1
- package/dist/auth/entities/system.auth.session.entity.js +4 -0
- package/dist/auth/entities/system.auth.session.entity.js.map +1 -1
- package/dist/auth/entities/system.refresh.token.entity.d.ts +1 -0
- package/dist/auth/entities/system.refresh.token.entity.d.ts.map +1 -1
- package/dist/auth/entities/system.refresh.token.entity.js +4 -0
- package/dist/auth/entities/system.refresh.token.entity.js.map +1 -1
- package/dist/auth/entities/user.entity.d.ts +1 -0
- package/dist/auth/entities/user.entity.d.ts.map +1 -1
- package/dist/auth/entities/user.entity.js +4 -0
- package/dist/auth/entities/user.entity.js.map +1 -1
- package/dist/auth/es6.classes.d.ts +4 -2
- package/dist/auth/es6.classes.d.ts.map +1 -1
- package/dist/auth/es6.classes.js +6 -1
- package/dist/auth/es6.classes.js.map +1 -1
- package/dist/auth/helpers/auth.d.ts +3 -1
- package/dist/auth/helpers/auth.d.ts.map +1 -1
- package/dist/auth/helpers/auth.js +10 -2
- package/dist/auth/helpers/auth.js.map +1 -1
- package/dist/auth/middlewares/jwt.middleware.d.ts.map +1 -1
- package/dist/auth/middlewares/jwt.middleware.js +1 -1
- package/dist/auth/middlewares/jwt.middleware.js.map +1 -1
- package/dist/auth/services/auth.service.d.ts +2 -0
- package/dist/auth/services/auth.service.d.ts.map +1 -1
- package/dist/auth/services/auth.service.js +26 -4
- package/dist/auth/services/auth.service.js.map +1 -1
- package/dist/auth/services/impersonation.service.d.ts +20 -0
- package/dist/auth/services/impersonation.service.d.ts.map +1 -0
- package/dist/auth/services/impersonation.service.js +89 -0
- package/dist/auth/services/impersonation.service.js.map +1 -0
- package/dist/auth/types/auth.types.d.ts +7 -0
- package/dist/auth/types/auth.types.d.ts.map +1 -1
- package/dist/common/enums/audit.action.enum.d.ts +1 -0
- package/dist/common/enums/audit.action.enum.d.ts.map +1 -1
- package/dist/common/enums/audit.action.enum.js +1 -0
- package/dist/common/enums/audit.action.enum.js.map +1 -1
- package/dist/common/jobs/dispatch.scheduled.event.job.d.ts +2 -0
- package/dist/common/jobs/dispatch.scheduled.event.job.d.ts.map +1 -1
- package/dist/common/jobs/dispatch.scheduled.event.job.js +19 -6
- package/dist/common/jobs/dispatch.scheduled.event.job.js.map +1 -1
- package/dist/document/document.module.d.ts.map +1 -1
- package/dist/document/document.module.js +3 -1
- package/dist/document/document.module.js.map +1 -1
- package/dist/document/enums/pdf.default.enum.d.ts +10 -0
- package/dist/document/enums/pdf.default.enum.d.ts.map +1 -0
- package/dist/document/enums/pdf.default.enum.js +15 -0
- package/dist/document/enums/pdf.default.enum.js.map +1 -0
- package/dist/document/es6.classes.d.ts +2 -1
- package/dist/document/es6.classes.d.ts.map +1 -1
- package/dist/document/es6.classes.js +2 -0
- package/dist/document/es6.classes.js.map +1 -1
- package/dist/document/services/pdf.service.d.ts +21 -0
- package/dist/document/services/pdf.service.d.ts.map +1 -0
- package/dist/document/services/pdf.service.js +168 -0
- package/dist/document/services/pdf.service.js.map +1 -0
- package/dist/document/types/pdf.types.d.ts +41 -0
- package/dist/document/types/pdf.types.d.ts.map +1 -0
- package/dist/document/types/pdf.types.js +3 -0
- package/dist/document/types/pdf.types.js.map +1 -0
- package/dist/global/utilities/schedule.utility.d.ts +1 -0
- package/dist/global/utilities/schedule.utility.d.ts.map +1 -1
- package/dist/global/utilities/schedule.utility.js +3 -0
- package/dist/global/utilities/schedule.utility.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/migrations/1749600000003.CreateSysUsersTable.d.ts.map +1 -1
- package/dist/migrations/1749600000003.CreateSysUsersTable.js +1 -0
- package/dist/migrations/1749600000003.CreateSysUsersTable.js.map +1 -1
- package/dist/migrations/1749600000014.CreateSysRefreshTokensTable.d.ts.map +1 -1
- package/dist/migrations/1749600000014.CreateSysRefreshTokensTable.js +7 -0
- package/dist/migrations/1749600000014.CreateSysRefreshTokensTable.js.map +1 -1
- package/dist/migrations/1749600000024.CreateSysAuthSessionsTable.d.ts.map +1 -1
- package/dist/migrations/1749600000024.CreateSysAuthSessionsTable.js +7 -0
- package/dist/migrations/1749600000024.CreateSysAuthSessionsTable.js.map +1 -1
- package/package.json +6 -2
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SystemUserListProcessor = void 0;
|
|
4
|
+
const sort_direction_enum_1 = require("../../common/enums/sort.direction.enum");
|
|
5
|
+
const filter_operator_enum_1 = require("../../common/enums/filter.operator.enum");
|
|
6
|
+
const filter_value_type_enum_1 = require("../../common/enums/filter.value.type.enum");
|
|
7
|
+
const common_list_processor_1 = require("../../common/libraries/common.list.processor");
|
|
8
|
+
const user_type_enum_1 = require("../../auth/enums/user.type.enum");
|
|
9
|
+
class SystemUserListProcessor extends common_list_processor_1.CommonListProcessor {
|
|
10
|
+
constructor(sqlService) {
|
|
11
|
+
super();
|
|
12
|
+
this.sqlService = sqlService;
|
|
13
|
+
}
|
|
14
|
+
async process(payload) {
|
|
15
|
+
this.config = {
|
|
16
|
+
query: 'sys_users u',
|
|
17
|
+
columns: [
|
|
18
|
+
{ key: 'u.id', identifier: 'id' },
|
|
19
|
+
{ key: 'u.full_name', identifier: 'full_name', searchable: true },
|
|
20
|
+
{ key: 'u.email', identifier: 'email', searchable: true },
|
|
21
|
+
{ key: 'u.active', identifier: 'active' },
|
|
22
|
+
{ key: 'u.user_type', identifier: 'user_type' },
|
|
23
|
+
{ key: 'u.has_global_access', identifier: 'has_global_access' },
|
|
24
|
+
{ key: 'u.country', identifier: 'country' },
|
|
25
|
+
{ key: 'u.contact_code', identifier: 'contact_code' },
|
|
26
|
+
{ key: 'u.contact', identifier: 'contact', searchable: true },
|
|
27
|
+
{ key: 'u.last_login_at', identifier: 'last_login_at' },
|
|
28
|
+
{ key: 'u.email_verified_at', identifier: 'email_verified_at' },
|
|
29
|
+
{ key: 'u.created_at', identifier: 'created_at' },
|
|
30
|
+
{ key: 'u.deleted_at', identifier: 'deleted_at' },
|
|
31
|
+
],
|
|
32
|
+
defaultSort: { field: 'created_at', direction: sort_direction_enum_1.SortDirection.DESC },
|
|
33
|
+
};
|
|
34
|
+
this.payload = {
|
|
35
|
+
...payload,
|
|
36
|
+
filters: [
|
|
37
|
+
...(payload.filters ?? []),
|
|
38
|
+
{
|
|
39
|
+
identifier: 'user_type',
|
|
40
|
+
value: user_type_enum_1.UserType.SYSTEM_USER,
|
|
41
|
+
value_type: filter_value_type_enum_1.FilterValueTypeEnum.STRING,
|
|
42
|
+
operator: filter_operator_enum_1.FilterOperatorEnum.EQ,
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
};
|
|
46
|
+
return this.handle();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.SystemUserListProcessor = SystemUserListProcessor;
|
|
50
|
+
//# sourceMappingURL=system.user.list.processor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system.user.list.processor.js","sourceRoot":"","sources":["../../../src/admin/libraries/system.user.list.processor.ts"],"names":[],"mappings":";;;AAAA,gFAAuE;AACvE,kFAA6E;AAC7E,sFAAgF;AAChF,wFAAmF;AAEnF,oEAA2D;AAU3D,MAAa,uBA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,GAAG;YACb,GAAG,OAAO;YACV,OAAO,EAAE;gBACP,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC;gBAC1B;oBACE,UAAU,EAAE,WAAW;oBACvB,KAAK,EAAE,yBAAQ,CAAC,WAAW;oBAC3B,UAAU,EAAE,4CAAmB,CAAC,MAAM;oBACtC,QAAQ,EAAE,yCAAkB,CAAC,EAAE;iBAChC;aACF;SACF,CAAC;QAEF,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;IACvB,CAAC;CACF;AAzCD,0DAyCC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AdminUserEntity } from '../../auth/entities/admin.user.entity';
|
|
2
|
+
import { DeleteResult } from '../types/admin.types';
|
|
3
|
+
export declare class SystemUserService {
|
|
4
|
+
delete(id: string, actor: AdminUserEntity): Promise<DeleteResult>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=system.user.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system.user.service.d.ts","sourceRoot":"","sources":["../../../src/admin/services/system.user.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAMxE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpD,qBACa,iBAAiB;IAMtB,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,YAAY,CAAC;CAaxE"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.SystemUserService = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const user_entity_1 = require("../../auth/entities/user.entity");
|
|
12
|
+
const user_type_enum_1 = require("../../auth/enums/user.type.enum");
|
|
13
|
+
const access_revocation_1 = require("../../auth/utilities/access.revocation");
|
|
14
|
+
const not_found_exception_1 = require("../../global/exceptions/not.found.exception");
|
|
15
|
+
const operation_exception_1 = require("../../global/exceptions/operation.exception");
|
|
16
|
+
let SystemUserService = class SystemUserService {
|
|
17
|
+
async delete(id, actor) {
|
|
18
|
+
const user = await user_entity_1.UserEntity.findOne({ where: { id } });
|
|
19
|
+
if (!user)
|
|
20
|
+
throw new not_found_exception_1.NotFoundException('No user exists for this id');
|
|
21
|
+
if (user.user_type !== user_type_enum_1.UserType.SYSTEM_USER)
|
|
22
|
+
throw new operation_exception_1.OperationException('This user is not a system user');
|
|
23
|
+
await user_entity_1.UserEntity.getRepository().manager.transaction(async (trx) => {
|
|
24
|
+
await access_revocation_1.AccessRevocation.revokeAll(trx, id, false);
|
|
25
|
+
await trx.softDelete(user_entity_1.UserEntity, { id });
|
|
26
|
+
});
|
|
27
|
+
return { id, deleted: true, deleted_by: actor.id };
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
exports.SystemUserService = SystemUserService;
|
|
31
|
+
exports.SystemUserService = SystemUserService = __decorate([
|
|
32
|
+
(0, common_1.Injectable)()
|
|
33
|
+
], SystemUserService);
|
|
34
|
+
//# sourceMappingURL=system.user.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system.user.service.js","sourceRoot":"","sources":["../../../src/admin/services/system.user.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAE5C,iEAA6D;AAC7D,oEAA2D;AAC3D,8EAA0E;AAC1E,qFAAgF;AAChF,qFAAiF;AAK1E,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAM5B,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,KAAsB;QAC7C,MAAM,IAAI,GAAG,MAAM,wBAAU,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QACzD,IAAI,CAAC,IAAI;YAAE,MAAM,IAAI,uCAAiB,CAAC,4BAA4B,CAAC,CAAC;QACrE,IAAI,IAAI,CAAC,SAAS,KAAK,yBAAQ,CAAC,WAAW;YACzC,MAAM,IAAI,wCAAkB,CAAC,gCAAgC,CAAC,CAAC;QAEjE,MAAM,wBAAU,CAAC,aAAa,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;YACjE,MAAM,oCAAgB,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;YACjD,MAAM,GAAG,CAAC,UAAU,CAAC,wBAAU,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;QAEH,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;IACrD,CAAC;CACF,CAAA;AAnBY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;GACA,iBAAiB,CAmB7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.module.d.ts","sourceRoot":"","sources":["../../src/auth/auth.module.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAId,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"auth.module.d.ts","sourceRoot":"","sources":["../../src/auth/auth.module.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAId,MAAM,gBAAgB,CAAC;AAkBxB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAqH5D,qBAMa,UAAU;IACrB,MAAM,CAAC,QAAQ,CAAC,OAAO,GAAE,iBAAsB,GAAG,aAAa;CAShE"}
|
package/dist/auth/auth.module.js
CHANGED
|
@@ -13,6 +13,7 @@ const jwt_1 = require("@nestjs/jwt");
|
|
|
13
13
|
const passport_1 = require("@nestjs/passport");
|
|
14
14
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
15
15
|
const common_module_1 = require("../common/common.module");
|
|
16
|
+
const audit_service_1 = require("../common/services/audit.service");
|
|
16
17
|
const cache_service_1 = require("../common/services/cache.service");
|
|
17
18
|
const encryption_service_1 = require("../common/services/encryption.service");
|
|
18
19
|
const api_key_guard_1 = require("./guards/api.key.guard");
|
|
@@ -24,7 +25,7 @@ const jwt_middleware_1 = require("./middlewares/jwt.middleware");
|
|
|
24
25
|
const admin_jwt_middleware_1 = require("./middlewares/admin.jwt.middleware");
|
|
25
26
|
const api_key_middleware_1 = require("./middlewares/api.key.middleware");
|
|
26
27
|
const es6_classes_1 = require("./es6.classes");
|
|
27
|
-
const [ApiKeyService, ScopeService, AuthService, AdminAuthService, GoogleAuthService, RoleService,] = es6_classes_1.es6Classes.services;
|
|
28
|
+
const [ApiKeyService, ScopeService, AuthService, AdminAuthService, GoogleAuthService, RoleService, ImpersonationService,] = es6_classes_1.es6Classes.services;
|
|
28
29
|
function createAuthImports() {
|
|
29
30
|
return [
|
|
30
31
|
common_module_1.CommonModule,
|
|
@@ -72,6 +73,15 @@ function createAuthProviders(options = {}) {
|
|
|
72
73
|
useFactory: (dataSource) => new RoleService(dataSource),
|
|
73
74
|
inject: [(0, typeorm_1.getDataSourceToken)(options.dataSourceName)],
|
|
74
75
|
},
|
|
76
|
+
{
|
|
77
|
+
provide: ImpersonationService,
|
|
78
|
+
useFactory: (authService, auditService, dataSource) => new ImpersonationService(authService, auditService, dataSource),
|
|
79
|
+
inject: [
|
|
80
|
+
AuthService,
|
|
81
|
+
audit_service_1.AuditService,
|
|
82
|
+
(0, typeorm_1.getDataSourceToken)(options.dataSourceName),
|
|
83
|
+
],
|
|
84
|
+
},
|
|
75
85
|
GoogleAuthService,
|
|
76
86
|
jwt_strategy_1.JwtStrategy,
|
|
77
87
|
jwt_refresh_strategy_1.JwtRefreshStrategy,
|
|
@@ -86,6 +96,7 @@ function createAuthProviders(options = {}) {
|
|
|
86
96
|
const authExports = [
|
|
87
97
|
AuthService,
|
|
88
98
|
AdminAuthService,
|
|
99
|
+
ImpersonationService,
|
|
89
100
|
ApiKeyService,
|
|
90
101
|
ScopeService,
|
|
91
102
|
RoleService,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.module.js","sourceRoot":"","sources":["../../src/auth/auth.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAKwB;AACxB,qCAAoE;AACpE,+CAAkD;AAClD,6CAAqD;AAErD,2DAAuD;AACvD,oEAAgE;AAChE,8EAA0E;AAC1E,0DAAqD;AACrD,4DAAuD;AACvD,kEAA6D;AAC7D,0EAAqE;AACrE,0DAAsD;AACtD,iEAA6D;AAC7D,6EAAwE;AACxE,yEAAoE;AACpE,+CAA2C;AAI3C,MAAM,CACJ,aAAa,EACb,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,
|
|
1
|
+
{"version":3,"file":"auth.module.js","sourceRoot":"","sources":["../../src/auth/auth.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAKwB;AACxB,qCAAoE;AACpE,+CAAkD;AAClD,6CAAqD;AAErD,2DAAuD;AACvD,oEAAgE;AAChE,oEAAgE;AAChE,8EAA0E;AAC1E,0DAAqD;AACrD,4DAAuD;AACvD,kEAA6D;AAC7D,0EAAqE;AACrE,0DAAsD;AACtD,iEAA6D;AAC7D,6EAAwE;AACxE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C;IAWnB,QAAQ,CACJ,GAAG,EAAE,WAAW,EACjB,OAAO,EAAE,OAAO,GACtB,OAAO,CAAC,aAAa,CAAC;IAOnB,OAAO,CACH,GAAG,EAAE,eAAe,EACrB,OAAO,EAAE,OAAO,GACtB,OAAO,CAAC,aAAa,CAAC;IAWnB,MAAM,CAAS,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,IAAI,CAAA;KAAE,CAAC;IAShE,cAAc,CACV,GAAG,EAAE,iBAAiB,GAC7B,OAAO,CAAC;QAAE,OAAO,EAAE,IAAI,CAAA;KAAE,CAAC;IAM7B,OAAO,CAAC,SAAS;CAMlB"}
|
|
@@ -36,11 +36,13 @@ let AuthController = class AuthController {
|
|
|
36
36
|
}
|
|
37
37
|
async login(dto, request) {
|
|
38
38
|
const user = await this.authService.validateCredentials(dto.email, dto.password);
|
|
39
|
+
this.authService.assertTenantLogin(user);
|
|
39
40
|
return this.authService.issueTokens(user, this.contextOf(request));
|
|
40
41
|
}
|
|
41
42
|
async googleLogin(dto, request) {
|
|
42
43
|
const tokenInfo = await this.googleAuthService.verifyIdToken(dto.id_token);
|
|
43
44
|
const user = await new google_user_data_processor_1.GoogleUserDataProcessor().process(tokenInfo);
|
|
45
|
+
this.authService.assertTenantLogin(user);
|
|
44
46
|
return this.authService.issueTokens(user, this.contextOf(request));
|
|
45
47
|
}
|
|
46
48
|
async register(dto, request) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.controller.js","sourceRoot":"","sources":["../../../src/auth/controllers/auth.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAQwB;AACxB,6CAAuE;AAEvE,2DAAuD;AACvD,yEAAoE;AAMpE,iDAA6C;AAC7C,+DAA0D;AAC1D,uDAAmD;AACnD,iEAA4D;AAC5D,qEAAgE;AAChE,6FAAuF;AACvF,yFAAmF;AACnF,iGAA2F;AAIpF,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,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,KAAK,CAAC,OAAO,CACH,GAAoB,EACrB,OAAgB;QAEvB,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9E,CAAC;IASK,AAAN,KAAK,CAAC,MAAM,CAAS,GAAoB;QACvC,MAAM,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QACjD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;IAMK,AAAN,KAAK,CAAC,cAAc,CACV,GAAsB;QAE9B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC;QACvD,MAAM,IAAI,4DAA2B,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;IAEO,SAAS,CAAC,OAAgB;QAChC,OAAO;YACL,UAAU,EAAE,OAAO,CAAC,EAAE;YACtB,UAAU,EAAE,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC;SAC1C,CAAC;IACJ,CAAC;CACF,CAAA;
|
|
1
|
+
{"version":3,"file":"auth.controller.js","sourceRoot":"","sources":["../../../src/auth/controllers/auth.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAQwB;AACxB,6CAAuE;AAEvE,2DAAuD;AACvD,yEAAoE;AAMpE,iDAA6C;AAC7C,+DAA0D;AAC1D,uDAAmD;AACnD,iEAA4D;AAC5D,qEAAgE;AAChE,6FAAuF;AACvF,yFAAmF;AACnF,iGAA2F;AAIpF,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,YACmB,WAAwB,EACxB,iBAAoC;QADpC,gBAAW,GAAX,WAAW,CAAa;QACxB,sBAAiB,GAAjB,iBAAiB,CAAmB;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Request } from 'express';
|
|
2
|
+
import { TenantEntity } from '../../tenant/entities/tenant.entity';
|
|
3
|
+
import { ImpersonationLoginDto } from '../dtos/impersonation.login.dto';
|
|
4
|
+
import { ImpersonationService } from '../services/impersonation.service';
|
|
5
|
+
import { ImpersonationSession } from '../types/auth.types';
|
|
6
|
+
export declare class ImpersonationController {
|
|
7
|
+
private readonly impersonationService;
|
|
8
|
+
constructor(impersonationService: ImpersonationService);
|
|
9
|
+
login(dto: ImpersonationLoginDto, request: Request): Promise<ImpersonationSession>;
|
|
10
|
+
tenants(): Promise<TenantEntity[]>;
|
|
11
|
+
private contextOf;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=impersonation.controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"impersonation.controller.d.ts","sourceRoot":"","sources":["../../../src/auth/controllers/impersonation.controller.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAqB,MAAM,qBAAqB,CAAC;AAE9E,qBAEa,uBAAuB;IACtB,OAAO,CAAC,QAAQ,CAAC,oBAAoB;gBAApB,oBAAoB,EAAE,oBAAoB;IAQjE,KAAK,CACD,GAAG,EAAE,qBAAqB,EAC3B,OAAO,EAAE,OAAO,GACtB,OAAO,CAAC,oBAAoB,CAAC;IAW1B,OAAO,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IAIxC,OAAO,CAAC,SAAS;CAMlB"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.ImpersonationController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
18
|
+
const impersonation_login_dto_1 = require("../dtos/impersonation.login.dto");
|
|
19
|
+
const impersonation_service_1 = require("../services/impersonation.service");
|
|
20
|
+
let ImpersonationController = class ImpersonationController {
|
|
21
|
+
constructor(impersonationService) {
|
|
22
|
+
this.impersonationService = impersonationService;
|
|
23
|
+
}
|
|
24
|
+
async login(dto, request) {
|
|
25
|
+
return this.impersonationService.login(dto, this.contextOf(request));
|
|
26
|
+
}
|
|
27
|
+
async tenants() {
|
|
28
|
+
return this.impersonationService.accessibleTenants();
|
|
29
|
+
}
|
|
30
|
+
contextOf(request) {
|
|
31
|
+
return {
|
|
32
|
+
ip_address: request.ip,
|
|
33
|
+
user_agent: request.headers['user-agent'],
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
exports.ImpersonationController = ImpersonationController;
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, common_1.Post)('login'),
|
|
40
|
+
(0, swagger_1.ApiOperation)({
|
|
41
|
+
summary: 'Sign a global-access user into one organization.',
|
|
42
|
+
description: 'Takes the same credentials as `POST /auth/login` plus the `tenant_id` to enter. The account must be a tenantless system user with `has_global_access`; anything else is refused. The returned pair behaves like an ordinary tenant-user session scoped to that organization, and a refresh keeps it there.',
|
|
43
|
+
}),
|
|
44
|
+
__param(0, (0, common_1.Body)()),
|
|
45
|
+
__param(1, (0, common_1.Req)()),
|
|
46
|
+
__metadata("design:type", Function),
|
|
47
|
+
__metadata("design:paramtypes", [impersonation_login_dto_1.ImpersonationLoginDto, Object]),
|
|
48
|
+
__metadata("design:returntype", Promise)
|
|
49
|
+
], ImpersonationController.prototype, "login", null);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, common_1.Get)('tenants'),
|
|
52
|
+
(0, swagger_1.ApiBearerAuth)(),
|
|
53
|
+
(0, swagger_1.ApiOperation)({
|
|
54
|
+
summary: 'Active organizations the caller may sign in to.',
|
|
55
|
+
description: 'Requires a live session for a global-access user — an impersonated one included, so it also backs an in-app organization switcher.',
|
|
56
|
+
}),
|
|
57
|
+
__metadata("design:type", Function),
|
|
58
|
+
__metadata("design:paramtypes", []),
|
|
59
|
+
__metadata("design:returntype", Promise)
|
|
60
|
+
], ImpersonationController.prototype, "tenants", null);
|
|
61
|
+
exports.ImpersonationController = ImpersonationController = __decorate([
|
|
62
|
+
(0, swagger_1.ApiTags)('Impersonation'),
|
|
63
|
+
(0, common_1.Controller)('api/auth/impersonation'),
|
|
64
|
+
__metadata("design:paramtypes", [impersonation_service_1.ImpersonationService])
|
|
65
|
+
], ImpersonationController);
|
|
66
|
+
//# sourceMappingURL=impersonation.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"impersonation.controller.js","sourceRoot":"","sources":["../../../src/auth/controllers/impersonation.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAkE;AAClE,6CAAuE;AAGvE,6EAAwE;AACxE,6EAAy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AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvC,qBAAa,qBAAsB,SAAQ,QAAQ;IAIjD,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ImpersonationLoginDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
15
|
+
const login_dto_1 = require("./login.dto");
|
|
16
|
+
class ImpersonationLoginDto extends login_dto_1.LoginDto {
|
|
17
|
+
}
|
|
18
|
+
exports.ImpersonationLoginDto = ImpersonationLoginDto;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, swagger_1.ApiProperty)({ format: 'uuid' }),
|
|
21
|
+
(0, class_validator_1.IsUUID)(),
|
|
22
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], ImpersonationLoginDto.prototype, "tenant_id", void 0);
|
|
25
|
+
//# sourceMappingURL=impersonation.login.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"impersonation.login.dto.js","sourceRoot":"","sources":["../../../src/auth/dtos/impersonation.login.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAqD;AACrD,6CAA8C;AAC9C,2CAAuC;AAGvC,MAAa,qBAAsB,SAAQ,oBAAQ;CAKlD;AALD,sDAKC;AADC;IAHC,IAAA,qBAAW,EAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAC/B,IAAA,wBAAM,GAAE;IACR,IAAA,4BAAU,GAAE;;wDACK"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system.auth.session.entity.d.ts","sourceRoot":"","sources":["../../../src/auth/entities/system.auth.session.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAS/D,qBACa,uBAAwB,SAAQ,UAAU;IAErD,OAAO,EAAE,MAAM,CAAC;IAGhB,QAAQ,EAAE,OAAO,CAAC;IAGlB,kBAAkB,EAAE,MAAM,CAAC;IAG3B,UAAU,EAAE,IAAI,CAAC;IAGjB,cAAc,EAAE,IAAI,CAAC;CACtB"}
|
|
1
|
+
{"version":3,"file":"system.auth.session.entity.d.ts","sourceRoot":"","sources":["../../../src/auth/entities/system.auth.session.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAS/D,qBACa,uBAAwB,SAAQ,UAAU;IAErD,OAAO,EAAE,MAAM,CAAC;IAGhB,QAAQ,EAAE,OAAO,CAAC;IAIlB,SAAS,EAAE,MAAM,CAAC;IAGlB,kBAAkB,EAAE,MAAM,CAAC;IAG3B,UAAU,EAAE,IAAI,CAAC;IAGjB,cAAc,EAAE,IAAI,CAAC;CACtB"}
|
|
@@ -23,6 +23,10 @@ __decorate([
|
|
|
23
23
|
(0, typeorm_1.Column)({ type: 'boolean', default: false }),
|
|
24
24
|
__metadata("design:type", Boolean)
|
|
25
25
|
], SystemAuthSessionEntity.prototype, "is_admin", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], SystemAuthSessionEntity.prototype, "tenant_id", void 0);
|
|
26
30
|
__decorate([
|
|
27
31
|
(0, typeorm_1.Column)({ type: 'varchar' }),
|
|
28
32
|
__metadata("design:type", String)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system.auth.session.entity.js","sourceRoot":"","sources":["../../../src/auth/entities/system.auth.session.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAyC;AACzC,mEAA+D;AAUxD,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,wBAAU;
|
|
1
|
+
{"version":3,"file":"system.auth.session.entity.js","sourceRoot":"","sources":["../../../src/auth/entities/system.auth.session.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAyC;AACzC,mEAA+D;AAUxD,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,wBAAU;CAmBtD,CAAA;AAnBY,0DAAuB;AAElC;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;wDACT;AAGhB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;yDAC1B;AAIlB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0DACvB;AAGlB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;mEACD;AAG3B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;8BACpB,IAAI;2DAAC;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;8BAChB,IAAI;+DAAC;kCAlBV,uBAAuB;IADnC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,mBAAmB,EAAE,CAAC;GACzB,uBAAuB,CAmBnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system.refresh.token.entity.d.ts","sourceRoot":"","sources":["../../../src/auth/entities/system.refresh.token.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAEnE,qBACa,wBAAyB,SAAQ,YAAY;IAExD,OAAO,EAAE,MAAM,CAAC;IAIhB,QAAQ,EAAE,OAAO,CAAC;IAGlB,UAAU,EAAE,MAAM,CAAC;IAGnB,UAAU,EAAE,MAAM,CAAC;IAGnB,UAAU,EAAE,MAAM,CAAC;IAGnB,UAAU,EAAE,IAAI,CAAC;IAGjB,UAAU,EAAE,IAAI,CAAC;IAGjB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACjC"}
|
|
1
|
+
{"version":3,"file":"system.refresh.token.entity.d.ts","sourceRoot":"","sources":["../../../src/auth/entities/system.refresh.token.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAEnE,qBACa,wBAAyB,SAAQ,YAAY;IAExD,OAAO,EAAE,MAAM,CAAC;IAIhB,QAAQ,EAAE,OAAO,CAAC;IAIlB,SAAS,EAAE,MAAM,CAAC;IAGlB,UAAU,EAAE,MAAM,CAAC;IAGnB,UAAU,EAAE,MAAM,CAAC;IAGnB,UAAU,EAAE,MAAM,CAAC;IAGnB,UAAU,EAAE,IAAI,CAAC;IAGjB,UAAU,EAAE,IAAI,CAAC;IAGjB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACjC"}
|
|
@@ -23,6 +23,10 @@ __decorate([
|
|
|
23
23
|
(0, typeorm_1.Column)({ type: 'boolean', default: false }),
|
|
24
24
|
__metadata("design:type", Boolean)
|
|
25
25
|
], SystemRefreshTokenEntity.prototype, "is_admin", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.Column)({ type: 'uuid', nullable: true }),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], SystemRefreshTokenEntity.prototype, "tenant_id", void 0);
|
|
26
30
|
__decorate([
|
|
27
31
|
(0, typeorm_1.Column)({ type: 'varchar' }),
|
|
28
32
|
__metadata("design:type", String)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system.refresh.token.entity.js","sourceRoot":"","sources":["../../../src/auth/entities/system.refresh.token.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAyC;AACzC,uEAAmE;AAG5D,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,4BAAY;
|
|
1
|
+
{"version":3,"file":"system.refresh.token.entity.js","sourceRoot":"","sources":["../../../src/auth/entities/system.refresh.token.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAyC;AACzC,uEAAmE;AAG5D,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,4BAAY;CA6BzD,CAAA;AA7BY,4DAAwB;AAEnC;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;yDACT;AAIhB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;0DAC1B;AAIlB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2DACvB;AAGlB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;4DACT;AAGnB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;4DACT;AAGnB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;4DACN;AAGnB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;8BACpB,IAAI;4DAAC;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;8BACpB,IAAI;4DAAC;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;4DACM;mCA5BrB,wBAAwB;IADpC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,oBAAoB,EAAE,CAAC;GAC1B,wBAAwB,CA6BpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.entity.d.ts","sourceRoot":"","sources":["../../../src/auth/entities/user.entity.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,qBACa,UAAW,SAAQ,UAAU;IAExC,MAAM,EAAE,OAAO,CAAC;IAIhB,SAAS,EAAE,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"user.entity.d.ts","sourceRoot":"","sources":["../../../src/auth/entities/user.entity.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,qBACa,UAAW,SAAQ,UAAU;IAExC,MAAM,EAAE,OAAO,CAAC;IAIhB,SAAS,EAAE,QAAQ,CAAC;IAIpB,iBAAiB,EAAE,OAAO,CAAC;IAG3B,SAAS,EAAE,MAAM,CAAC;IAGlB,KAAK,EAAE,MAAM,CAAC;IAGd,OAAO,EAAE,MAAM,CAAC;IAGhB,YAAY,EAAE,MAAM,CAAC;IAGrB,OAAO,EAAE,MAAM,CAAC;IAGhB,QAAQ,EAAE,MAAM,CAAC;IAGjB,aAAa,EAAE,IAAI,CAAC;IAGpB,iBAAiB,EAAE,IAAI,CAAC;IAGxB,mBAAmB,EAAE,IAAI,CAAC;IAG1B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAGhC,SAAS,EAAE,MAAM,CAAC;IAKlB,MAAM,EAAE,YAAY,CAAC;IAGrB,SAAS,EAAE,cAAc,EAAE,CAAC;IAM5B,OAAO,EAAE,iBAAiB,CAAC;CAC5B"}
|
|
@@ -25,6 +25,10 @@ __decorate([
|
|
|
25
25
|
(0, typeorm_1.Column)({ type: 'varchar', default: user_type_enum_1.UserType.TENANT_USER }),
|
|
26
26
|
__metadata("design:type", String)
|
|
27
27
|
], UserEntity.prototype, "user_type", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: false }),
|
|
30
|
+
__metadata("design:type", Boolean)
|
|
31
|
+
], UserEntity.prototype, "has_global_access", void 0);
|
|
28
32
|
__decorate([
|
|
29
33
|
(0, typeorm_1.Column)({ type: 'text' }),
|
|
30
34
|
__metadata("design:type", String)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../../src/auth/entities/user.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAOiB;AACjB,mEAA+D;AAC/D,uEAAmE;AACnE,4DAAmD;AAK5C,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,wBAAU;
|
|
1
|
+
{"version":3,"file":"user.entity.js","sourceRoot":"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X,IAAI;uDAAC;AAG1B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;8CACM;AAGhC;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACvB;AAKlB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,4BAAY,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IACtD,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;8BAC1B,4BAAY;0CAAC;AAGrB;IADC,IAAA,mBAAS,EAAC,gBAAgB,EAAE,CAAC,SAAyB,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC;;6CAC/C;AAM5B;IAJC,IAAA,kBAAQ,EACP,mBAAmB,EACnB,CAAC,WAA8B,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CACrD;;2CAC0B;qBAzDhB,UAAU;IADtB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;GACjB,UAAU,CA0DtB"}
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { AuthController } from './controllers/auth.controller';
|
|
2
2
|
import { AdminAuthController } from './controllers/admin.auth.controller';
|
|
3
|
+
import { ImpersonationController } from './controllers/impersonation.controller';
|
|
3
4
|
import { ApiKeyService } from './services/api.key.service';
|
|
4
5
|
import { ScopeService } from './services/scope.service';
|
|
5
6
|
import { RoleService } from './services/role.service';
|
|
6
7
|
import { AuthService } from './services/auth.service';
|
|
7
8
|
import { AdminAuthService } from './services/admin.auth.service';
|
|
8
9
|
import { GoogleAuthService } from './services/google.auth.service';
|
|
10
|
+
import { ImpersonationService } from './services/impersonation.service';
|
|
9
11
|
import { AdminLoginDto } from './dtos/admin.login.dto';
|
|
10
12
|
import { ChangePasswordDto } from './dtos/change.password.dto';
|
|
11
13
|
import { GoogleLoginDto } from './dtos/google.login.dto';
|
|
12
14
|
import { LoginDto } from './dtos/login.dto';
|
|
13
15
|
import { RefreshTokenDto } from './dtos/refresh.token.dto';
|
|
14
16
|
export declare const es6Classes: {
|
|
15
|
-
controllers: (typeof AuthController | typeof AdminAuthController)[];
|
|
16
|
-
services: readonly [typeof ApiKeyService, typeof ScopeService, typeof AuthService, typeof AdminAuthService, typeof GoogleAuthService, typeof RoleService];
|
|
17
|
+
controllers: (typeof AuthController | typeof AdminAuthController | typeof ImpersonationController)[];
|
|
18
|
+
services: readonly [typeof ApiKeyService, typeof ScopeService, typeof AuthService, typeof AdminAuthService, typeof GoogleAuthService, typeof RoleService, typeof ImpersonationService];
|
|
17
19
|
libraries: any[];
|
|
18
20
|
dtos: (typeof LoginDto | typeof GoogleLoginDto | typeof RefreshTokenDto | typeof ChangePasswordDto | typeof AdminLoginDto)[];
|
|
19
21
|
jobs: any[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"es6.classes.d.ts","sourceRoot":"","sources":["../../src/auth/es6.classes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"es6.classes.d.ts","sourceRoot":"","sources":["../../src/auth/es6.classes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAG3D,eAAO,MAAM,UAAU;;;;;;;CAuBtB,CAAC"}
|
package/dist/auth/es6.classes.js
CHANGED
|
@@ -3,20 +3,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.es6Classes = void 0;
|
|
4
4
|
const auth_controller_1 = require("./controllers/auth.controller");
|
|
5
5
|
const admin_auth_controller_1 = require("./controllers/admin.auth.controller");
|
|
6
|
+
const impersonation_controller_1 = require("./controllers/impersonation.controller");
|
|
6
7
|
const api_key_service_1 = require("./services/api.key.service");
|
|
7
8
|
const scope_service_1 = require("./services/scope.service");
|
|
8
9
|
const role_service_1 = require("./services/role.service");
|
|
9
10
|
const auth_service_1 = require("./services/auth.service");
|
|
10
11
|
const admin_auth_service_1 = require("./services/admin.auth.service");
|
|
11
12
|
const google_auth_service_1 = require("./services/google.auth.service");
|
|
13
|
+
const impersonation_service_1 = require("./services/impersonation.service");
|
|
12
14
|
const admin_login_dto_1 = require("./dtos/admin.login.dto");
|
|
13
15
|
const change_password_dto_1 = require("./dtos/change.password.dto");
|
|
14
16
|
const google_login_dto_1 = require("./dtos/google.login.dto");
|
|
17
|
+
const impersonation_login_dto_1 = require("./dtos/impersonation.login.dto");
|
|
15
18
|
const login_dto_1 = require("./dtos/login.dto");
|
|
16
19
|
const refresh_token_dto_1 = require("./dtos/refresh.token.dto");
|
|
17
20
|
const register_dto_1 = require("./dtos/register.dto");
|
|
18
21
|
exports.es6Classes = {
|
|
19
|
-
controllers: [auth_controller_1.AuthController, admin_auth_controller_1.AdminAuthController],
|
|
22
|
+
controllers: [auth_controller_1.AuthController, admin_auth_controller_1.AdminAuthController, impersonation_controller_1.ImpersonationController],
|
|
20
23
|
services: [
|
|
21
24
|
api_key_service_1.ApiKeyService,
|
|
22
25
|
scope_service_1.ScopeService,
|
|
@@ -24,12 +27,14 @@ exports.es6Classes = {
|
|
|
24
27
|
admin_auth_service_1.AdminAuthService,
|
|
25
28
|
google_auth_service_1.GoogleAuthService,
|
|
26
29
|
role_service_1.RoleService,
|
|
30
|
+
impersonation_service_1.ImpersonationService,
|
|
27
31
|
],
|
|
28
32
|
libraries: [],
|
|
29
33
|
dtos: [
|
|
30
34
|
admin_login_dto_1.AdminLoginDto,
|
|
31
35
|
change_password_dto_1.ChangePasswordDto,
|
|
32
36
|
google_login_dto_1.GoogleLoginDto,
|
|
37
|
+
impersonation_login_dto_1.ImpersonationLoginDto,
|
|
33
38
|
login_dto_1.LoginDto,
|
|
34
39
|
refresh_token_dto_1.RefreshTokenDto,
|
|
35
40
|
register_dto_1.RegisterDto,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"es6.classes.js","sourceRoot":"","sources":["../../src/auth/es6.classes.ts"],"names":[],"mappings":";;;AAAA,mEAA+D;AAC/D,+EAA0E;AAC1E,gEAA2D;AAC3D,4DAAwD;AACxD,0DAAsD;AACtD,0DAAsD;AACtD,sEAAiE;AACjE,wEAAmE;AACnE,4DAAuD;AACvD,oEAA+D;AAC/D,8DAAyD;AACzD,gDAA4C;AAC5C,gEAA2D;AAC3D,sDAAkD;AAErC,QAAA,UAAU,GAAG;IACxB,WAAW,EAAE,CAAC,gCAAc,EAAE,2CAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"es6.classes.js","sourceRoot":"","sources":["../../src/auth/es6.classes.ts"],"names":[],"mappings":";;;AAAA,mEAA+D;AAC/D,+EAA0E;AAC1E,qFAAiF;AACjF,gEAA2D;AAC3D,4DAAwD;AACxD,0DAAsD;AACtD,0DAAsD;AACtD,sEAAiE;AACjE,wEAAmE;AACnE,4EAAwE;AACxE,4DAAuD;AACvD,oEAA+D;AAC/D,8DAAyD;AACzD,4EAAuE;AACvE,gDAA4C;AAC5C,gEAA2D;AAC3D,sDAAkD;AAErC,QAAA,UAAU,GAAG;IACxB,WAAW,EAAE,CAAC,gCAAc,EAAE,2CAAmB,EAAE,kDAAuB,CAAC;IAC3E,QAAQ,EAAE;QACR,+BAAa;QACb,4BAAY;QACZ,0BAAW;QACX,qCAAgB;QAChB,uCAAiB;QACjB,0BAAW;QACX,4CAAoB;KACZ;IACV,SAAS,EAAE,EAAE;IACb,IAAI,EAAE;QACJ,+BAAa;QACb,uCAAiB;QACjB,iCAAc;QACd,+CAAqB;QACrB,oBAAQ;QACR,mCAAe;QACf,0BAAW;KACZ;IACD,IAAI,EAAE,EAAE;IACR,WAAW,EAAE,EAAE;CAChB,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { AuthContextValue } from '../types/auth.types';
|
|
2
2
|
export declare class Auth {
|
|
3
|
-
static loadUserContext(userId: string, sessionIdentifier?: string): Promise<AuthContextValue | null>;
|
|
3
|
+
static loadUserContext(userId: string, sessionIdentifier?: string, impersonatedTenantId?: string): Promise<AuthContextValue | null>;
|
|
4
4
|
static runWithContext<T>(context: AuthContextValue, callback: () => T): T;
|
|
5
5
|
static enterContext(context: AuthContextValue): void;
|
|
6
6
|
static user(): Record<string, any> | undefined;
|
|
7
7
|
static session(): string | undefined;
|
|
8
|
+
static impersonatedTenant(): string | undefined;
|
|
9
|
+
static isImpersonating(): boolean;
|
|
8
10
|
}
|
|
9
11
|
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/auth/helpers/auth.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAW5D,qBAAa,IAAI;WAMF,eAAe,CAC1B,MAAM,EAAE,MAAM,EACd,iBAAiB,CAAC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/auth/helpers/auth.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAW5D,qBAAa,IAAI;WAMF,eAAe,CAC1B,MAAM,EAAE,MAAM,EACd,iBAAiB,CAAC,EAAE,MAAM,EAC1B,oBAAoB,CAAC,EAAE,MAAM,GAC5B,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IA0BnC,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC;IASzE,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI;IAIpD,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS;IAI9C,MAAM,CAAC,OAAO,IAAI,MAAM,GAAG,SAAS;IAKpC,MAAM,CAAC,kBAAkB,IAAI,MAAM,GAAG,SAAS;IAI/C,MAAM,CAAC,eAAe,IAAI,OAAO;CAGlC"}
|
|
@@ -5,7 +5,7 @@ const async_hooks_1 = require("async_hooks");
|
|
|
5
5
|
const user_entity_1 = require("../entities/user.entity");
|
|
6
6
|
const storage = new async_hooks_1.AsyncLocalStorage();
|
|
7
7
|
class Auth {
|
|
8
|
-
static async loadUserContext(userId, sessionIdentifier) {
|
|
8
|
+
static async loadUserContext(userId, sessionIdentifier, impersonatedTenantId) {
|
|
9
9
|
const user = await user_entity_1.UserEntity.findOne({ where: { id: userId } });
|
|
10
10
|
if (!user)
|
|
11
11
|
return null;
|
|
@@ -14,7 +14,9 @@ class Auth {
|
|
|
14
14
|
delete userObject.created_at;
|
|
15
15
|
delete userObject.updated_at;
|
|
16
16
|
delete userObject.deleted_at;
|
|
17
|
-
|
|
17
|
+
if (impersonatedTenantId)
|
|
18
|
+
userObject.tenant_id = impersonatedTenantId;
|
|
19
|
+
return { user: userObject, sessionIdentifier, impersonatedTenantId };
|
|
18
20
|
}
|
|
19
21
|
static runWithContext(context, callback) {
|
|
20
22
|
return storage.run(context, callback);
|
|
@@ -28,6 +30,12 @@ class Auth {
|
|
|
28
30
|
static session() {
|
|
29
31
|
return storage.getStore()?.sessionIdentifier;
|
|
30
32
|
}
|
|
33
|
+
static impersonatedTenant() {
|
|
34
|
+
return storage.getStore()?.impersonatedTenantId;
|
|
35
|
+
}
|
|
36
|
+
static isImpersonating() {
|
|
37
|
+
return !!storage.getStore()?.impersonatedTenantId;
|
|
38
|
+
}
|
|
31
39
|
}
|
|
32
40
|
exports.Auth = Auth;
|
|
33
41
|
//# sourceMappingURL=auth.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/auth/helpers/auth.ts"],"names":[],"mappings":";;;AAAA,6CAAgD;AAChD,yDAAqD;AAGrD,MAAM,OAAO,GAAG,IAAI,+B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