@servicelabsco/nestjs-utility-services 1.2.34 → 1.2.36
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/dist/auth/es6.classes.d.ts +2 -2
- package/dist/auth/es6.classes.js +2 -2
- package/dist/auth/services/{access.manager.d.ts → access.service.d.ts} +3 -1
- package/dist/auth/services/{access.manager.js → access.service.js} +25 -6
- package/dist/auth/services/access.service.js.map +1 -0
- package/dist/auth/services/es6.service.d.ts +4 -4
- package/dist/auth/services/es6.service.js +6 -6
- package/dist/auth/services/es6.service.js.map +1 -1
- package/dist/auth/services/index.d.ts +1 -1
- package/dist/auth/services/index.js +1 -1
- package/dist/platformUtility/controllers/bull.job.controller.d.ts +3 -3
- package/dist/platformUtility/controllers/bull.job.controller.js +5 -5
- package/dist/platformUtility/controllers/bull.job.controller.js.map +1 -1
- package/dist/platformUtility/controllers/queue.controller.d.ts +3 -3
- package/dist/platformUtility/controllers/queue.controller.js +5 -5
- package/dist/system/controllers/data.controller.js +5 -1
- package/dist/system/controllers/data.controller.js.map +1 -1
- package/dist/system/controllers/menu.controller.d.ts +5 -1
- package/dist/system/controllers/menu.controller.js +18 -2
- package/dist/system/controllers/menu.controller.js.map +1 -1
- package/dist/system/controllers/preference.controller.d.ts +3 -3
- package/dist/system/controllers/preference.controller.js +5 -5
- package/dist/system/controllers/preference.controller.js.map +1 -1
- package/dist/system/es6.classes.d.ts +1 -1
- package/dist/system/jobs/model.scanner.job.js +3 -1
- package/dist/system/jobs/model.scanner.job.js.map +1 -1
- package/dist/system/services/business.rule.service.d.ts +3 -3
- package/dist/system/services/business.rule.service.js +5 -5
- package/dist/system/services/menu.service.d.ts +3 -3
- package/dist/system/services/menu.service.js +7 -7
- package/dist/system/services/model.service.d.ts +4 -4
- package/dist/system/services/model.service.js +7 -8
- package/dist/system/services/model.service.js.map +1 -1
- package/dist/system/services/report.service.d.ts +3 -3
- package/dist/system/services/report.service.js +6 -6
- package/dist/system/services/ui.action.service.d.ts +3 -3
- package/dist/system/services/ui.action.service.js +7 -7
- package/dist/system/services/ui.action.service.js.map +1 -1
- package/dist/system/services/user.preference.service.d.ts +3 -3
- package/dist/system/services/user.preference.service.js +5 -5
- package/dist/system/services/user.preference.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/auth/services/access.manager.js.map +0 -1
@@ -11,14 +11,14 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
12
|
exports.BusinessRuleService = void 0;
|
13
13
|
const common_1 = require("@nestjs/common");
|
14
|
-
const
|
14
|
+
const access_service_1 = require("../../auth/services/access.service");
|
15
15
|
const business_rule_entity_1 = require("../entities/business.rule.entity");
|
16
16
|
const business_rule_filter_validator_1 = require("./../libraries/business.rule.filter.validator");
|
17
17
|
const business_rule_query_evaluator_1 = require("./../libraries/business.rule.query.evaluator");
|
18
18
|
const common_service_1 = require("./common.service");
|
19
19
|
let BusinessRuleService = class BusinessRuleService {
|
20
|
-
constructor(
|
21
|
-
this.
|
20
|
+
constructor(accessService, commonService) {
|
21
|
+
this.accessService = accessService;
|
22
22
|
this.commonService = commonService;
|
23
23
|
}
|
24
24
|
async getQueryRestrictions(modelId) {
|
@@ -51,13 +51,13 @@ let BusinessRuleService = class BusinessRuleService {
|
|
51
51
|
validateRoleCheck(roles) {
|
52
52
|
if (roles.length === 0)
|
53
53
|
return true;
|
54
|
-
return this.
|
54
|
+
return this.accessService.hasRoleAssignments(roles, true);
|
55
55
|
}
|
56
56
|
};
|
57
57
|
exports.BusinessRuleService = BusinessRuleService;
|
58
58
|
exports.BusinessRuleService = BusinessRuleService = __decorate([
|
59
59
|
(0, common_1.Injectable)(),
|
60
|
-
__metadata("design:paramtypes", [
|
60
|
+
__metadata("design:paramtypes", [access_service_1.AccessService,
|
61
61
|
common_service_1.CommonService])
|
62
62
|
], BusinessRuleService);
|
63
63
|
//# sourceMappingURL=business.rule.service.js.map
|
@@ -1,12 +1,12 @@
|
|
1
|
-
import {
|
1
|
+
import { AccessService } from '../../auth/services/access.service';
|
2
2
|
import { MenuEntity } from '../entities/menu.entity';
|
3
3
|
import { PreferenceService } from './preference.service';
|
4
4
|
import { UiActionService } from './ui.action.service';
|
5
5
|
export declare class MenuService {
|
6
|
-
private readonly
|
6
|
+
private readonly accessService;
|
7
7
|
private readonly preferenceService;
|
8
8
|
private readonly uiActionService;
|
9
|
-
constructor(
|
9
|
+
constructor(accessService: AccessService, preferenceService: PreferenceService, uiActionService: UiActionService);
|
10
10
|
getMenus(): Promise<{
|
11
11
|
modules: any[];
|
12
12
|
pages: any;
|
@@ -13,7 +13,7 @@ exports.MenuService = void 0;
|
|
13
13
|
const common_1 = require("@nestjs/common");
|
14
14
|
const class_transformer_1 = require("class-transformer");
|
15
15
|
const typeorm_1 = require("typeorm");
|
16
|
-
const
|
16
|
+
const access_service_1 = require("../../auth/services/access.service");
|
17
17
|
const operation_exception_1 = require("../../common/exceptions/operation.exception");
|
18
18
|
const class_mapper_1 = require("../../common/libraries/class.mapper");
|
19
19
|
const menu_entity_1 = require("../entities/menu.entity");
|
@@ -26,8 +26,8 @@ const preference_service_1 = require("./preference.service");
|
|
26
26
|
const ui_action_service_1 = require("./ui.action.service");
|
27
27
|
const SourceHash = require("../../config/source.hash");
|
28
28
|
let MenuService = class MenuService {
|
29
|
-
constructor(
|
30
|
-
this.
|
29
|
+
constructor(accessService, preferenceService, uiActionService) {
|
30
|
+
this.accessService = accessService;
|
31
31
|
this.preferenceService = preferenceService;
|
32
32
|
this.uiActionService = uiActionService;
|
33
33
|
}
|
@@ -92,12 +92,12 @@ let MenuService = class MenuService {
|
|
92
92
|
return data;
|
93
93
|
}
|
94
94
|
isMenuAllowed(roles) {
|
95
|
-
if (this.
|
95
|
+
if (this.accessService.hasRoleId(1))
|
96
96
|
return true;
|
97
97
|
if (!roles)
|
98
|
-
return this.
|
98
|
+
return this.accessService.hasRoleId(1);
|
99
99
|
for (const role of roles) {
|
100
|
-
if (!role.deleted_at && this.
|
100
|
+
if (!role.deleted_at && this.accessService.hasRoleId(role.role_id))
|
101
101
|
return true;
|
102
102
|
}
|
103
103
|
return false;
|
@@ -106,7 +106,7 @@ let MenuService = class MenuService {
|
|
106
106
|
exports.MenuService = MenuService;
|
107
107
|
exports.MenuService = MenuService = __decorate([
|
108
108
|
(0, common_1.Injectable)(),
|
109
|
-
__metadata("design:paramtypes", [
|
109
|
+
__metadata("design:paramtypes", [access_service_1.AccessService,
|
110
110
|
preference_service_1.PreferenceService,
|
111
111
|
ui_action_service_1.UiActionService])
|
112
112
|
], MenuService);
|
@@ -1,16 +1,16 @@
|
|
1
|
-
import {
|
2
|
-
import { AccessManager } from '../../auth/services/access.manager';
|
1
|
+
import { AccessService } from '../../auth/services/access.service';
|
3
2
|
import { ModelEntity } from '../entities/model.entity';
|
4
3
|
import { UiActionEntity } from '../entities/ui.action.entity';
|
5
4
|
import { ColumnManager } from '../libraries/column.manager';
|
5
|
+
import { PropertyService } from './property.service';
|
6
6
|
import { SecurityRuleService } from './security.rule.service';
|
7
7
|
import { UiActionService } from './ui.action.service';
|
8
8
|
export declare class ModelService {
|
9
9
|
private readonly uiActionService;
|
10
|
-
private readonly
|
10
|
+
private readonly accessService;
|
11
11
|
private readonly securityRuleService;
|
12
12
|
private readonly propertyService;
|
13
|
-
constructor(uiActionService: UiActionService,
|
13
|
+
constructor(uiActionService: UiActionService, accessService: AccessService, securityRuleService: SecurityRuleService, propertyService: PropertyService);
|
14
14
|
getUiActions(model: ModelEntity): Promise<UiActionEntity[]>;
|
15
15
|
validateHashAccess(hash: string, operation: string): Promise<ModelEntity>;
|
16
16
|
private getModelFromHash;
|
@@ -10,9 +10,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
10
10
|
};
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
12
|
exports.ModelService = void 0;
|
13
|
-
const property_service_1 = require("./property.service");
|
14
13
|
const common_1 = require("@nestjs/common");
|
15
|
-
const
|
14
|
+
const access_service_1 = require("../../auth/services/access.service");
|
16
15
|
const access_exception_1 = require("../../common/exceptions/access.exception");
|
17
16
|
const operation_exception_1 = require("../../common/exceptions/operation.exception");
|
18
17
|
const class_mapper_1 = require("../../common/libraries/class.mapper");
|
@@ -20,14 +19,15 @@ const model_entity_1 = require("../entities/model.entity");
|
|
20
19
|
const model_role_entity_1 = require("../entities/model.role.entity");
|
21
20
|
const ui_action_entity_1 = require("../entities/ui.action.entity");
|
22
21
|
const column_manager_1 = require("../libraries/column.manager");
|
22
|
+
const property_service_1 = require("./property.service");
|
23
23
|
const security_rule_service_1 = require("./security.rule.service");
|
24
24
|
const ui_action_service_1 = require("./ui.action.service");
|
25
25
|
const SourceHash = require("../../config/source.hash");
|
26
26
|
const ROLEMAPPING = require("../../config/role.mapping");
|
27
27
|
let ModelService = class ModelService {
|
28
|
-
constructor(uiActionService,
|
28
|
+
constructor(uiActionService, accessService, securityRuleService, propertyService) {
|
29
29
|
this.uiActionService = uiActionService;
|
30
|
-
this.
|
30
|
+
this.accessService = accessService;
|
31
31
|
this.securityRuleService = securityRuleService;
|
32
32
|
this.propertyService = propertyService;
|
33
33
|
}
|
@@ -73,7 +73,6 @@ let ModelService = class ModelService {
|
|
73
73
|
async getModelFromIdentifier(identifier) {
|
74
74
|
if (identifier.length < 1)
|
75
75
|
return null;
|
76
|
-
global.console.log('identifier', identifier);
|
77
76
|
return model_entity_1.ModelEntity.findOne({
|
78
77
|
where: { route_identifier: identifier },
|
79
78
|
});
|
@@ -94,7 +93,7 @@ let ModelService = class ModelService {
|
|
94
93
|
return this.validateUnRegulatedModelAccess(model, operation);
|
95
94
|
}
|
96
95
|
for (const role of roles) {
|
97
|
-
if (this.
|
96
|
+
if (this.accessService.hasRoleId(role.role_id)) {
|
98
97
|
if (role.scope.includes(operation)) {
|
99
98
|
return true;
|
100
99
|
}
|
@@ -103,7 +102,7 @@ let ModelService = class ModelService {
|
|
103
102
|
return false;
|
104
103
|
}
|
105
104
|
validateUnRegulatedModelAccess(model, operation) {
|
106
|
-
if (!this.
|
105
|
+
if (!this.accessService.hasRoleId(ROLEMAPPING.internal))
|
107
106
|
return false;
|
108
107
|
return model.allowed_permissions.includes(operation);
|
109
108
|
}
|
@@ -112,7 +111,7 @@ exports.ModelService = ModelService;
|
|
112
111
|
exports.ModelService = ModelService = __decorate([
|
113
112
|
(0, common_1.Injectable)(),
|
114
113
|
__metadata("design:paramtypes", [ui_action_service_1.UiActionService,
|
115
|
-
|
114
|
+
access_service_1.AccessService,
|
116
115
|
security_rule_service_1.SecurityRuleService,
|
117
116
|
property_service_1.PropertyService])
|
118
117
|
], ModelService);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"model.service.js","sourceRoot":"","sources":["../../../src/system/services/model.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
1
|
+
{"version":3,"file":"model.service.js","sourceRoot":"","sources":["../../../src/system/services/model.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,uEAAmE;AACnE,+EAA2E;AAC3E,qFAAiF;AACjF,sEAAkE;AAClE,2DAAuD;AACvD,qEAAgE;AAChE,mEAA8D;AAC9D,gEAA4D;AAC5D,yDAAqD;AACrD,mEAA8D;AAC9D,2DAAsD;AACtD,uDAAwD;AACxD,yDAA0D;AAQnD,IAAM,YAAY,GAAlB,MAAM,YAAY;IAQrB,YACqB,eAAgC,EAChC,aAA4B,EAC5B,mBAAwC,EACxC,eAAgC;QAHhC,oBAAe,GAAf,eAAe,CAAiB;QAChC,kBAAa,GAAb,aAAa,CAAe;QAC5B,wBAAmB,GAAnB,mBAAmB,CAAqB;QACxC,oBAAe,GAAf,eAAe,CAAiB;IAClD,CAAC;IAQJ,KAAK,CAAC,YAAY,CAAC,KAAkB;QACjC,MAAM,OAAO,GAAG,EAAE,CAAC;QAGnB,IAAI,MAAM,IAAI,CAAC,mBAAmB,CAAC,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AAE,IAAI,EAAE,CAAC,CAAC;QAGzE,OAAO,aAAa,CAAC;IACzB,CAAC;IASD,KAAK,CAAC,mBAAmB,CAAC,KAAkB,EAAE,SAAiB;QAE3D,IAAI,KAAK,CAAC,UAAU;YAAE,OAAO,KAAK,CAAC;QAGnC,MAAM,KAAK,GAAG,MAAM,mCAAe,CAAC,IAAI,CAAC;YACrC,KAAK,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,EAAE,EAAE;SAChC,CAAC,CAAC;QAGH,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACrB,OAAO,IAAI,CAAC,8BAA8B,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QACjE,CAAC;QAED,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YAEvB,IAAI,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;gBAE7C,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;oBACjC,OAAO,IAAI,CAAC;gBAChB,CAAC;YACL,CAAC;QACL,CAAC;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;IASD,8BAA8B,CAAC,KAAkB,EAAE,SAAiB;QAChE,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,WAAW,CAAC,QAAQ,CAAC;YAAE,OAAO,KAAK,CAAC;QAEtE,OAAO,KAAK,CAAC,mBAAmB,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IACzD,CAAC;CACJ,CAAA;AA/KY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,mBAAU,GAAE;qCAU6B,mCAAe;QACjB,8BAAa;QACP,2CAAmB;QACvB,kCAAe;GAZ5C,YAAY,CA+KxB"}
|
@@ -1,12 +1,12 @@
|
|
1
|
-
import {
|
1
|
+
import { AccessService } from '../../auth/services/access.service';
|
2
2
|
import { ReportEntity } from '../entities/report.entity';
|
3
3
|
import { PreferenceService } from './preference.service';
|
4
4
|
import { UiActionService } from './ui.action.service';
|
5
5
|
export declare class ReportService {
|
6
|
-
private readonly
|
6
|
+
private readonly accessService;
|
7
7
|
private readonly preferenceService;
|
8
8
|
private readonly uiActionService;
|
9
|
-
constructor(
|
9
|
+
constructor(accessService: AccessService, preferenceService: PreferenceService, uiActionService: UiActionService);
|
10
10
|
hasAccess(id: number): Promise<boolean>;
|
11
11
|
getReportDetails(id: number): Promise<ReportEntity>;
|
12
12
|
}
|
@@ -11,7 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
12
|
exports.ReportService = void 0;
|
13
13
|
const common_1 = require("@nestjs/common");
|
14
|
-
const
|
14
|
+
const access_service_1 = require("../../auth/services/access.service");
|
15
15
|
const operation_exception_1 = require("../../common/exceptions/operation.exception");
|
16
16
|
const chart_entity_1 = require("../entities/chart.entity");
|
17
17
|
const report_entity_1 = require("../entities/report.entity");
|
@@ -21,8 +21,8 @@ const ui_action_service_1 = require("./ui.action.service");
|
|
21
21
|
const ROLEMAPPING = require("../../config/role.mapping");
|
22
22
|
const SourceHash = require("../../config/source.hash");
|
23
23
|
let ReportService = class ReportService {
|
24
|
-
constructor(
|
25
|
-
this.
|
24
|
+
constructor(accessService, preferenceService, uiActionService) {
|
25
|
+
this.accessService = accessService;
|
26
26
|
this.preferenceService = preferenceService;
|
27
27
|
this.uiActionService = uiActionService;
|
28
28
|
}
|
@@ -31,9 +31,9 @@ let ReportService = class ReportService {
|
|
31
31
|
where: { report_id: id },
|
32
32
|
});
|
33
33
|
if (assignments.length === 0) {
|
34
|
-
return this.
|
34
|
+
return this.accessService.hasRoleId(ROLEMAPPING.internal) || this.accessService.hasRoleId(ROLEMAPPING.super_admin);
|
35
35
|
}
|
36
|
-
return this.
|
36
|
+
return this.accessService.hasRoleAssignments(assignments);
|
37
37
|
}
|
38
38
|
async getReportDetails(id) {
|
39
39
|
const report = await report_entity_1.ReportEntity.first(id, {
|
@@ -53,7 +53,7 @@ let ReportService = class ReportService {
|
|
53
53
|
exports.ReportService = ReportService;
|
54
54
|
exports.ReportService = ReportService = __decorate([
|
55
55
|
(0, common_1.Injectable)(),
|
56
|
-
__metadata("design:paramtypes", [
|
56
|
+
__metadata("design:paramtypes", [access_service_1.AccessService,
|
57
57
|
preference_service_1.PreferenceService,
|
58
58
|
ui_action_service_1.UiActionService])
|
59
59
|
], ReportService);
|
@@ -1,8 +1,8 @@
|
|
1
|
+
import { AccessService } from '../../auth/services/access.service';
|
1
2
|
import { UiActionEntity } from '../entities/ui.action.entity';
|
2
|
-
import { AccessManager } from '../../auth/services/access.manager';
|
3
3
|
export declare class UiActionService {
|
4
|
-
private readonly
|
5
|
-
constructor(
|
4
|
+
private readonly accessService;
|
5
|
+
constructor(accessService: AccessService);
|
6
6
|
getUiActions(source_type: string, source_id: number): Promise<UiActionEntity[]>;
|
7
7
|
private validateUiActionAccess;
|
8
8
|
private stripOffUnwanted;
|
@@ -11,12 +11,12 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
12
|
exports.UiActionService = void 0;
|
13
13
|
const common_1 = require("@nestjs/common");
|
14
|
-
const
|
14
|
+
const access_service_1 = require("../../auth/services/access.service");
|
15
15
|
const class_mapper_1 = require("../../common/libraries/class.mapper");
|
16
|
-
const
|
16
|
+
const ui_action_entity_1 = require("../entities/ui.action.entity");
|
17
17
|
let UiActionService = class UiActionService {
|
18
|
-
constructor(
|
19
|
-
this.
|
18
|
+
constructor(accessService) {
|
19
|
+
this.accessService = accessService;
|
20
20
|
}
|
21
21
|
async getUiActions(source_type, source_id) {
|
22
22
|
const actions = [];
|
@@ -36,9 +36,9 @@ let UiActionService = class UiActionService {
|
|
36
36
|
validateUiActionAccess(uiAction) {
|
37
37
|
if (uiAction.roles.length === 0 && uiAction.permissions.length === 0)
|
38
38
|
return true;
|
39
|
-
if (this.
|
39
|
+
if (this.accessService.hasRoleAssignments(uiAction.roles))
|
40
40
|
return true;
|
41
|
-
if (this.
|
41
|
+
if (this.accessService.hasPermissionAssignments(uiAction.permissions))
|
42
42
|
return true;
|
43
43
|
return false;
|
44
44
|
}
|
@@ -51,6 +51,6 @@ let UiActionService = class UiActionService {
|
|
51
51
|
exports.UiActionService = UiActionService;
|
52
52
|
exports.UiActionService = UiActionService = __decorate([
|
53
53
|
(0, common_1.Injectable)(),
|
54
|
-
__metadata("design:paramtypes", [
|
54
|
+
__metadata("design:paramtypes", [access_service_1.AccessService])
|
55
55
|
], UiActionService);
|
56
56
|
//# sourceMappingURL=ui.action.service.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ui.action.service.js","sourceRoot":"","sources":["../../../src/system/services/ui.action.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,
|
1
|
+
{"version":3,"file":"ui.action.service.js","sourceRoot":"","sources":["../../../src/system/services/ui.action.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,uEAAmE;AACnE,sEAAkE;AAClE,mEAA8D;AAGvD,IAAM,eAAe,GAArB,MAAM,eAAe;IACxB,YAA6B,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAAG,CAAC;IAC7D,KAAK,CAAC,YAAY,CAAC,WAAmB,EAAE,SAAiB;QACrD,MAAM,OAAO,GAAG,EAAE,CAAC;QAEnB,MAAM,OAAO,GAAG,MAAM,iCAAc,CAAC,IAAI,CAAC;YACtC,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE;YAC/C,SAAS,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,QAAQ,CAAC;YACjE,KAAK,EAAE;gBACH,aAAa,EAAE,KAAK;aACvB;SACJ,CAAC,CAAC;QAEH,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;YACvB,IAAI,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC;gBAAE,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;QAChG,CAAC,CAAC,CAAC;QAEH,OAAO,OAAO,CAAC;IACnB,CAAC;IAEO,sBAAsB,CAAC,QAAwB;QAEnD,IAAI,QAAQ,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,QAAQ,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QAGlF,IAAI,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC,QAAQ,CAAC,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QAEvE,IAAI,IAAI,CAAC,aAAa,CAAC,wBAAwB,CAAC,QAAQ,CAAC,WAAW,CAAC;YAAE,OAAO,IAAI,CAAC;QAEnF,OAAO,KAAK,CAAC;IACjB,CAAC;IAEO,gBAAgB,CAAC,QAAwB;QAC7C,OAAO,QAAQ,CAAC,KAAK,CAAC;QACtB,OAAO,QAAQ,CAAC,WAAW,CAAC;QAE5B,OAAO,0BAAW,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAClD,CAAC;CACJ,CAAA;AAtCY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;qCAEmC,8BAAa;GADhD,eAAe,CAsC3B"}
|
@@ -1,8 +1,8 @@
|
|
1
|
+
import { AccessService } from '../../auth/services/access.service';
|
1
2
|
import { UserPreferenceEntity } from '../entities/user.preference.entity';
|
2
|
-
import { AccessManager } from '../../auth/services/access.manager';
|
3
3
|
export declare class UserPreferenceService {
|
4
|
-
private readonly
|
5
|
-
constructor(
|
4
|
+
private readonly accessService;
|
5
|
+
constructor(accessService: AccessService);
|
6
6
|
getUserPreferences(): Promise<UserPreferenceEntity[]>;
|
7
7
|
getUserPreference(key: string): Promise<any>;
|
8
8
|
setUserPreference(name: string, value: any): Promise<UserPreferenceEntity>;
|
@@ -12,12 +12,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.UserPreferenceService = void 0;
|
13
13
|
const common_1 = require("@nestjs/common");
|
14
14
|
const typeorm_1 = require("typeorm");
|
15
|
-
const
|
15
|
+
const access_service_1 = require("../../auth/services/access.service");
|
16
16
|
const auth_1 = require("../../common/libraries/auth");
|
17
|
-
const
|
17
|
+
const user_preference_entity_1 = require("../entities/user.preference.entity");
|
18
18
|
let UserPreferenceService = class UserPreferenceService {
|
19
|
-
constructor(
|
20
|
-
this.
|
19
|
+
constructor(accessService) {
|
20
|
+
this.accessService = accessService;
|
21
21
|
}
|
22
22
|
async getUserPreferences() {
|
23
23
|
const user = auth_1.Auth.user();
|
@@ -71,6 +71,6 @@ let UserPreferenceService = class UserPreferenceService {
|
|
71
71
|
exports.UserPreferenceService = UserPreferenceService;
|
72
72
|
exports.UserPreferenceService = UserPreferenceService = __decorate([
|
73
73
|
(0, common_1.Injectable)(),
|
74
|
-
__metadata("design:paramtypes", [
|
74
|
+
__metadata("design:paramtypes", [access_service_1.AccessService])
|
75
75
|
], UserPreferenceService);
|
76
76
|
//# sourceMappingURL=user.preference.service.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"user.preference.service.js","sourceRoot":"","sources":["../../../src/system/services/user.preference.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,2CAA4C;AAC5C,qCAAsC;AACtC
|
1
|
+
{"version":3,"file":"user.preference.service.js","sourceRoot":"","sources":["../../../src/system/services/user.preference.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,2CAA4C;AAC5C,qCAAsC;AACtC,uEAAmE;AACnE,sDAAmD;AACnD,+EAA0E;AAQnE,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAK9B,YAA6B,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAAG,CAAC;IAE7D,KAAK,CAAC,kBAAkB;QACpB,MAAM,IAAI,GAAG,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