easywork-common-lib 1.0.1022 → 1.0.1024
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/common/enums/common.enum.d.ts +14 -0
- package/dist/common/enums/common.enum.js +17 -1
- package/dist/common/enums/common.enum.js.map +1 -1
- package/dist/entities/all-activities.entity.d.ts +38 -0
- package/dist/entities/all-activities.entity.js +261 -0
- package/dist/entities/all-activities.entity.js.map +1 -0
- package/dist/entities/index.d.ts +1 -0
- package/dist/entities/index.js +1 -0
- package/dist/entities/index.js.map +1 -1
- package/dist/modules/authorization/authorization.module.d.ts +26 -0
- package/dist/modules/authorization/authorization.module.js +105 -0
- package/dist/modules/authorization/authorization.module.js.map +1 -0
- package/dist/modules/authorization/config/resource-configurations.d.ts +12 -0
- package/dist/modules/authorization/config/resource-configurations.js +124 -0
- package/dist/modules/authorization/config/resource-configurations.js.map +1 -0
- package/dist/modules/authorization/decorators/contact-permissions.decorator.d.ts +13 -0
- package/dist/modules/authorization/decorators/contact-permissions.decorator.js +101 -0
- package/dist/modules/authorization/decorators/contact-permissions.decorator.js.map +1 -0
- package/dist/modules/authorization/decorators/permissions.decorator.d.ts +51 -0
- package/dist/modules/authorization/decorators/permissions.decorator.js +144 -0
- package/dist/modules/authorization/decorators/permissions.decorator.js.map +1 -0
- package/dist/modules/authorization/factories/resource-authorization.factory.d.ts +55 -0
- package/dist/modules/authorization/factories/resource-authorization.factory.js +184 -0
- package/dist/modules/authorization/factories/resource-authorization.factory.js.map +1 -0
- package/dist/modules/authorization/index.d.ts +7 -0
- package/dist/modules/authorization/index.js +24 -0
- package/dist/modules/authorization/index.js.map +1 -0
- package/dist/modules/authorization/interfaces/authorization.interface.d.ts +23 -0
- package/dist/modules/authorization/interfaces/authorization.interface.js +3 -0
- package/dist/modules/authorization/interfaces/authorization.interface.js.map +1 -0
- package/dist/modules/authorization/services/authorization.service.d.ts +25 -0
- package/dist/modules/authorization/services/authorization.service.js +139 -0
- package/dist/modules/authorization/services/authorization.service.js.map +1 -0
- package/dist/modules/authorization/services/dynamic-filter.service.d.ts +9 -0
- package/dist/modules/authorization/services/dynamic-filter.service.js +238 -0
- package/dist/modules/authorization/services/dynamic-filter.service.js.map +1 -0
- package/dist/modules/authorization/services/index.d.ts +7 -0
- package/dist/modules/authorization/services/index.js +24 -0
- package/dist/modules/authorization/services/index.js.map +1 -0
- package/dist/modules/authorization/services/modules/contact-authorization.service.d.ts +29 -0
- package/dist/modules/authorization/services/modules/contact-authorization.service.js +105 -0
- package/dist/modules/authorization/services/modules/contact-authorization.service.js.map +1 -0
- package/dist/modules/authorization/services/modules/index.d.ts +4 -0
- package/dist/modules/authorization/services/modules/index.js +21 -0
- package/dist/modules/authorization/services/modules/index.js.map +1 -0
- package/dist/modules/authorization/services/modules/lead-authorization.service.d.ts +27 -0
- package/dist/modules/authorization/services/modules/lead-authorization.service.js +96 -0
- package/dist/modules/authorization/services/modules/lead-authorization.service.js.map +1 -0
- package/dist/modules/authorization/services/modules/policy-authorization.service.d.ts +28 -0
- package/dist/modules/authorization/services/modules/policy-authorization.service.js +100 -0
- package/dist/modules/authorization/services/modules/policy-authorization.service.js.map +1 -0
- package/dist/modules/authorization/services/modules/task-authorization.service.d.ts +28 -0
- package/dist/modules/authorization/services/modules/task-authorization.service.js +100 -0
- package/dist/modules/authorization/services/modules/task-authorization.service.js.map +1 -0
- package/dist/modules/authorization/services/permission-cache.service.d.ts +10 -0
- package/dist/modules/authorization/services/permission-cache.service.js +48 -0
- package/dist/modules/authorization/services/permission-cache.service.js.map +1 -0
- package/dist/modules/authorization/services/permission-evaluator.service.d.ts +26 -0
- package/dist/modules/authorization/services/permission-evaluator.service.js +349 -0
- package/dist/modules/authorization/services/permission-evaluator.service.js.map +1 -0
- package/dist/modules/authorization/services/resource-access-filter.service.d.ts +20 -0
- package/dist/modules/authorization/services/resource-access-filter.service.js +406 -0
- package/dist/modules/authorization/services/resource-access-filter.service.js.map +1 -0
- package/dist/modules/authorization/services/resource-authorization.service.d.ts +47 -0
- package/dist/modules/authorization/services/resource-authorization.service.js +192 -0
- package/dist/modules/authorization/services/resource-authorization.service.js.map +1 -0
- package/dist/modules/index.d.ts +1 -0
- package/dist/modules/index.js +1 -0
- package/dist/modules/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -16,3 +16,17 @@ export declare enum MeetingCRMType {
|
|
|
16
16
|
RECEIPT = "receipt",
|
|
17
17
|
AGENT = "agent"
|
|
18
18
|
}
|
|
19
|
+
export declare enum ActivityStatus {
|
|
20
|
+
PENDING = "pending",
|
|
21
|
+
IN_PROGRESS = "in_progress",
|
|
22
|
+
COMPLETED = "completed",
|
|
23
|
+
CANCELLED = "cancelled",
|
|
24
|
+
OVERDUE = "overdue",
|
|
25
|
+
PENDING_REVIEW = "pending_review"
|
|
26
|
+
}
|
|
27
|
+
export declare enum AllActivitiesType {
|
|
28
|
+
TASK_CRM = "task_crm",
|
|
29
|
+
EVENT_CRM = "event_crm",
|
|
30
|
+
MEETING_CRM = "meeting_crm",
|
|
31
|
+
COMMENT = "comment"
|
|
32
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MeetingCRMType = exports.MeetingType = exports.MeetingStatus = void 0;
|
|
3
|
+
exports.AllActivitiesType = exports.ActivityStatus = exports.MeetingCRMType = exports.MeetingType = exports.MeetingStatus = void 0;
|
|
4
4
|
var MeetingStatus;
|
|
5
5
|
(function (MeetingStatus) {
|
|
6
6
|
MeetingStatus["CANCELLED"] = "cancelled";
|
|
@@ -22,4 +22,20 @@ var MeetingCRMType;
|
|
|
22
22
|
MeetingCRMType["RECEIPT"] = "receipt";
|
|
23
23
|
MeetingCRMType["AGENT"] = "agent";
|
|
24
24
|
})(MeetingCRMType || (exports.MeetingCRMType = MeetingCRMType = {}));
|
|
25
|
+
var ActivityStatus;
|
|
26
|
+
(function (ActivityStatus) {
|
|
27
|
+
ActivityStatus["PENDING"] = "pending";
|
|
28
|
+
ActivityStatus["IN_PROGRESS"] = "in_progress";
|
|
29
|
+
ActivityStatus["COMPLETED"] = "completed";
|
|
30
|
+
ActivityStatus["CANCELLED"] = "cancelled";
|
|
31
|
+
ActivityStatus["OVERDUE"] = "overdue";
|
|
32
|
+
ActivityStatus["PENDING_REVIEW"] = "pending_review";
|
|
33
|
+
})(ActivityStatus || (exports.ActivityStatus = ActivityStatus = {}));
|
|
34
|
+
var AllActivitiesType;
|
|
35
|
+
(function (AllActivitiesType) {
|
|
36
|
+
AllActivitiesType["TASK_CRM"] = "task_crm";
|
|
37
|
+
AllActivitiesType["EVENT_CRM"] = "event_crm";
|
|
38
|
+
AllActivitiesType["MEETING_CRM"] = "meeting_crm";
|
|
39
|
+
AllActivitiesType["COMMENT"] = "comment";
|
|
40
|
+
})(AllActivitiesType || (exports.AllActivitiesType = AllActivitiesType = {}));
|
|
25
41
|
//# sourceMappingURL=common.enum.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.enum.js","sourceRoot":"","sources":["../../../src/common/enums/common.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,wCAAuB,CAAA;IACvB,kCAAiB,CAAA;IACjB,wCAAuB,CAAA;IACvB,oCAAmB,CAAA;AACrB,CAAC,EALW,aAAa,6BAAb,aAAa,QAKxB;AAED,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,wCAAyB,CAAA;IACzB,8BAAe,CAAA;AACjB,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB;AAED,IAAY,cAOX;AAPD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,mCAAiB,CAAA;IACjB,qCAAmB,CAAA;IACnB,+BAAa,CAAA;IACb,qCAAmB,CAAA;IACnB,iCAAe,CAAA;AACjB,CAAC,EAPW,cAAc,8BAAd,cAAc,QAOzB"}
|
|
1
|
+
{"version":3,"file":"common.enum.js","sourceRoot":"","sources":["../../../src/common/enums/common.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,wCAAuB,CAAA;IACvB,kCAAiB,CAAA;IACjB,wCAAuB,CAAA;IACvB,oCAAmB,CAAA;AACrB,CAAC,EALW,aAAa,6BAAb,aAAa,QAKxB;AAED,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,wCAAyB,CAAA;IACzB,8BAAe,CAAA;AACjB,CAAC,EAHW,WAAW,2BAAX,WAAW,QAGtB;AAED,IAAY,cAOX;AAPD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,mCAAiB,CAAA;IACjB,qCAAmB,CAAA;IACnB,+BAAa,CAAA;IACb,qCAAmB,CAAA;IACnB,iCAAe,CAAA;AACjB,CAAC,EAPW,cAAc,8BAAd,cAAc,QAOzB;AAED,IAAY,cAOX;AAPD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,6CAA2B,CAAA;IAC3B,yCAAuB,CAAA;IACvB,yCAAuB,CAAA;IACvB,qCAAmB,CAAA;IACnB,mDAAiC,CAAA;AACnC,CAAC,EAPW,cAAc,8BAAd,cAAc,QAOzB;AAED,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,0CAAqB,CAAA;IACrB,4CAAuB,CAAA;IACvB,gDAA2B,CAAA;IAC3B,wCAAmB,CAAA;AACrB,CAAC,EALW,iBAAiB,iCAAjB,iBAAiB,QAK5B"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { TaskCRM } from "./helpers/tools/task_crm.entity";
|
|
2
|
+
import { EventCRM } from "./helpers/tools/event_crm.entity";
|
|
3
|
+
import { MeetingCRM } from "./helpers/meeting_crm.entity";
|
|
4
|
+
import { CommentBase } from "../common/database/comment.base.entity";
|
|
5
|
+
import { AllActivitiesType, ActivityStatus } from "../common/enums/common.enum";
|
|
6
|
+
export declare class AllActivities {
|
|
7
|
+
id: string;
|
|
8
|
+
type: AllActivitiesType;
|
|
9
|
+
title: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
activityDate?: Date;
|
|
12
|
+
status?: ActivityStatus;
|
|
13
|
+
priority?: string;
|
|
14
|
+
taskCrmId?: string;
|
|
15
|
+
taskCrm?: TaskCRM;
|
|
16
|
+
eventCrmId?: string;
|
|
17
|
+
eventCrm?: EventCRM;
|
|
18
|
+
meetingCrmId?: string;
|
|
19
|
+
meetingCrm?: MeetingCRM;
|
|
20
|
+
commentId?: string;
|
|
21
|
+
comment?: CommentBase;
|
|
22
|
+
metadata?: Record<string, any>;
|
|
23
|
+
createdAt: Date;
|
|
24
|
+
updatedAt: Date;
|
|
25
|
+
get activityEntity(): TaskCRM | EventCRM | MeetingCRM | CommentBase | undefined;
|
|
26
|
+
get specificEntityId(): string | undefined;
|
|
27
|
+
get isConsistent(): boolean;
|
|
28
|
+
get activitySummary(): {
|
|
29
|
+
id: string;
|
|
30
|
+
type: string;
|
|
31
|
+
title: string;
|
|
32
|
+
description?: string;
|
|
33
|
+
date?: Date;
|
|
34
|
+
status?: string;
|
|
35
|
+
entityType?: string;
|
|
36
|
+
entityId?: string;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
@@ -0,0 +1,261 @@
|
|
|
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.AllActivities = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const class_transformer_1 = require("class-transformer");
|
|
15
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
16
|
+
const task_crm_entity_1 = require("./helpers/tools/task_crm.entity");
|
|
17
|
+
const event_crm_entity_1 = require("./helpers/tools/event_crm.entity");
|
|
18
|
+
const meeting_crm_entity_1 = require("./helpers/meeting_crm.entity");
|
|
19
|
+
const comment_base_entity_1 = require("../common/database/comment.base.entity");
|
|
20
|
+
const common_enum_1 = require("../common/enums/common.enum");
|
|
21
|
+
let AllActivities = class AllActivities {
|
|
22
|
+
id;
|
|
23
|
+
type;
|
|
24
|
+
title;
|
|
25
|
+
description;
|
|
26
|
+
activityDate;
|
|
27
|
+
status;
|
|
28
|
+
priority;
|
|
29
|
+
taskCrmId;
|
|
30
|
+
taskCrm;
|
|
31
|
+
eventCrmId;
|
|
32
|
+
eventCrm;
|
|
33
|
+
meetingCrmId;
|
|
34
|
+
meetingCrm;
|
|
35
|
+
commentId;
|
|
36
|
+
comment;
|
|
37
|
+
metadata;
|
|
38
|
+
createdAt;
|
|
39
|
+
updatedAt;
|
|
40
|
+
get activityEntity() {
|
|
41
|
+
switch (this.type) {
|
|
42
|
+
case common_enum_1.AllActivitiesType.TASK_CRM:
|
|
43
|
+
return this.taskCrm;
|
|
44
|
+
case common_enum_1.AllActivitiesType.EVENT_CRM:
|
|
45
|
+
return this.eventCrm;
|
|
46
|
+
case common_enum_1.AllActivitiesType.MEETING_CRM:
|
|
47
|
+
return this.meetingCrm;
|
|
48
|
+
case common_enum_1.AllActivitiesType.COMMENT:
|
|
49
|
+
return this.comment;
|
|
50
|
+
default:
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
get specificEntityId() {
|
|
55
|
+
switch (this.type) {
|
|
56
|
+
case common_enum_1.AllActivitiesType.TASK_CRM:
|
|
57
|
+
return this.taskCrmId;
|
|
58
|
+
case common_enum_1.AllActivitiesType.EVENT_CRM:
|
|
59
|
+
return this.eventCrmId;
|
|
60
|
+
case common_enum_1.AllActivitiesType.MEETING_CRM:
|
|
61
|
+
return this.meetingCrmId;
|
|
62
|
+
case common_enum_1.AllActivitiesType.COMMENT:
|
|
63
|
+
return this.commentId;
|
|
64
|
+
default:
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
get isConsistent() {
|
|
69
|
+
const entityCounts = [
|
|
70
|
+
this.taskCrmId ? 1 : 0,
|
|
71
|
+
this.eventCrmId ? 1 : 0,
|
|
72
|
+
this.meetingCrmId ? 1 : 0,
|
|
73
|
+
this.commentId ? 1 : 0,
|
|
74
|
+
].reduce((a, b) => a + b, 0);
|
|
75
|
+
return entityCounts === 1;
|
|
76
|
+
}
|
|
77
|
+
get activitySummary() {
|
|
78
|
+
return {
|
|
79
|
+
id: this.id,
|
|
80
|
+
type: this.type,
|
|
81
|
+
title: this.title,
|
|
82
|
+
description: this.description,
|
|
83
|
+
date: this.activityDate,
|
|
84
|
+
status: this.status,
|
|
85
|
+
entityType: this.activityEntity?.constructor.name,
|
|
86
|
+
entityId: this.specificEntityId,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
exports.AllActivities = AllActivities;
|
|
91
|
+
__decorate([
|
|
92
|
+
(0, swagger_1.ApiProperty)({
|
|
93
|
+
type: String,
|
|
94
|
+
description: "UUID de la actividad",
|
|
95
|
+
format: "uuid",
|
|
96
|
+
}),
|
|
97
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
|
|
98
|
+
__metadata("design:type", String)
|
|
99
|
+
], AllActivities.prototype, "id", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
(0, swagger_1.ApiProperty)({
|
|
102
|
+
enum: common_enum_1.AllActivitiesType,
|
|
103
|
+
description: "Tipo de actividad",
|
|
104
|
+
}),
|
|
105
|
+
(0, typeorm_1.Column)({
|
|
106
|
+
type: "enum",
|
|
107
|
+
enum: common_enum_1.AllActivitiesType,
|
|
108
|
+
}),
|
|
109
|
+
__metadata("design:type", String)
|
|
110
|
+
], AllActivities.prototype, "type", void 0);
|
|
111
|
+
__decorate([
|
|
112
|
+
(0, swagger_1.ApiProperty)({
|
|
113
|
+
type: String,
|
|
114
|
+
description: "Título de la actividad",
|
|
115
|
+
}),
|
|
116
|
+
(0, typeorm_1.Column)({ length: 255 }),
|
|
117
|
+
__metadata("design:type", String)
|
|
118
|
+
], AllActivities.prototype, "title", void 0);
|
|
119
|
+
__decorate([
|
|
120
|
+
(0, swagger_1.ApiProperty)({
|
|
121
|
+
type: String,
|
|
122
|
+
description: "Descripción de la actividad",
|
|
123
|
+
required: false,
|
|
124
|
+
}),
|
|
125
|
+
(0, typeorm_1.Column)({ type: "text", nullable: true }),
|
|
126
|
+
__metadata("design:type", String)
|
|
127
|
+
], AllActivities.prototype, "description", void 0);
|
|
128
|
+
__decorate([
|
|
129
|
+
(0, swagger_1.ApiProperty)({
|
|
130
|
+
type: Date,
|
|
131
|
+
description: "Fecha de la actividad",
|
|
132
|
+
required: false,
|
|
133
|
+
}),
|
|
134
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
135
|
+
__metadata("design:type", Date)
|
|
136
|
+
], AllActivities.prototype, "activityDate", void 0);
|
|
137
|
+
__decorate([
|
|
138
|
+
(0, swagger_1.ApiProperty)({
|
|
139
|
+
enum: common_enum_1.ActivityStatus,
|
|
140
|
+
description: "Estado de la actividad",
|
|
141
|
+
required: false,
|
|
142
|
+
}),
|
|
143
|
+
(0, typeorm_1.Column)({
|
|
144
|
+
type: "enum",
|
|
145
|
+
enum: common_enum_1.ActivityStatus,
|
|
146
|
+
nullable: true,
|
|
147
|
+
}),
|
|
148
|
+
__metadata("design:type", String)
|
|
149
|
+
], AllActivities.prototype, "status", void 0);
|
|
150
|
+
__decorate([
|
|
151
|
+
(0, swagger_1.ApiProperty)({
|
|
152
|
+
type: String,
|
|
153
|
+
description: "Prioridad de la actividad",
|
|
154
|
+
required: false,
|
|
155
|
+
}),
|
|
156
|
+
(0, typeorm_1.Column)({ length: 20, nullable: true }),
|
|
157
|
+
__metadata("design:type", String)
|
|
158
|
+
], AllActivities.prototype, "priority", void 0);
|
|
159
|
+
__decorate([
|
|
160
|
+
(0, class_transformer_1.Exclude)(),
|
|
161
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
162
|
+
(0, typeorm_1.Index)(),
|
|
163
|
+
__metadata("design:type", String)
|
|
164
|
+
], AllActivities.prototype, "taskCrmId", void 0);
|
|
165
|
+
__decorate([
|
|
166
|
+
(0, class_transformer_1.Exclude)(),
|
|
167
|
+
(0, typeorm_1.ManyToOne)(() => task_crm_entity_1.TaskCRM, { nullable: true, onDelete: "CASCADE" }),
|
|
168
|
+
(0, typeorm_1.JoinColumn)({ name: "taskCrmId" }),
|
|
169
|
+
__metadata("design:type", task_crm_entity_1.TaskCRM)
|
|
170
|
+
], AllActivities.prototype, "taskCrm", void 0);
|
|
171
|
+
__decorate([
|
|
172
|
+
(0, class_transformer_1.Exclude)(),
|
|
173
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
174
|
+
(0, typeorm_1.Index)(),
|
|
175
|
+
__metadata("design:type", String)
|
|
176
|
+
], AllActivities.prototype, "eventCrmId", void 0);
|
|
177
|
+
__decorate([
|
|
178
|
+
(0, class_transformer_1.Exclude)(),
|
|
179
|
+
(0, typeorm_1.ManyToOne)(() => event_crm_entity_1.EventCRM, { nullable: true, onDelete: "CASCADE" }),
|
|
180
|
+
(0, typeorm_1.JoinColumn)({ name: "eventCrmId" }),
|
|
181
|
+
__metadata("design:type", event_crm_entity_1.EventCRM)
|
|
182
|
+
], AllActivities.prototype, "eventCrm", void 0);
|
|
183
|
+
__decorate([
|
|
184
|
+
(0, class_transformer_1.Exclude)(),
|
|
185
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
186
|
+
(0, typeorm_1.Index)(),
|
|
187
|
+
__metadata("design:type", String)
|
|
188
|
+
], AllActivities.prototype, "meetingCrmId", void 0);
|
|
189
|
+
__decorate([
|
|
190
|
+
(0, class_transformer_1.Exclude)(),
|
|
191
|
+
(0, typeorm_1.ManyToOne)(() => meeting_crm_entity_1.MeetingCRM, { nullable: true, onDelete: "CASCADE" }),
|
|
192
|
+
(0, typeorm_1.JoinColumn)({ name: "meetingCrmId" }),
|
|
193
|
+
__metadata("design:type", meeting_crm_entity_1.MeetingCRM)
|
|
194
|
+
], AllActivities.prototype, "meetingCrm", void 0);
|
|
195
|
+
__decorate([
|
|
196
|
+
(0, class_transformer_1.Exclude)(),
|
|
197
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
198
|
+
(0, typeorm_1.Index)(),
|
|
199
|
+
__metadata("design:type", String)
|
|
200
|
+
], AllActivities.prototype, "commentId", void 0);
|
|
201
|
+
__decorate([
|
|
202
|
+
(0, class_transformer_1.Exclude)(),
|
|
203
|
+
(0, typeorm_1.ManyToOne)(() => comment_base_entity_1.CommentBase, { nullable: true, onDelete: "CASCADE" }),
|
|
204
|
+
(0, typeorm_1.JoinColumn)({ name: "commentId" }),
|
|
205
|
+
__metadata("design:type", comment_base_entity_1.CommentBase)
|
|
206
|
+
], AllActivities.prototype, "comment", void 0);
|
|
207
|
+
__decorate([
|
|
208
|
+
(0, swagger_1.ApiProperty)({
|
|
209
|
+
type: Object,
|
|
210
|
+
description: "Metadatos adicionales de la actividad",
|
|
211
|
+
required: false,
|
|
212
|
+
}),
|
|
213
|
+
(0, typeorm_1.Column)({
|
|
214
|
+
type: "json",
|
|
215
|
+
nullable: true,
|
|
216
|
+
}),
|
|
217
|
+
__metadata("design:type", Object)
|
|
218
|
+
], AllActivities.prototype, "metadata", void 0);
|
|
219
|
+
__decorate([
|
|
220
|
+
(0, swagger_1.ApiProperty)({
|
|
221
|
+
type: Date,
|
|
222
|
+
description: "Fecha de creación del registro",
|
|
223
|
+
}),
|
|
224
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
225
|
+
__metadata("design:type", Date)
|
|
226
|
+
], AllActivities.prototype, "createdAt", void 0);
|
|
227
|
+
__decorate([
|
|
228
|
+
(0, swagger_1.ApiProperty)({
|
|
229
|
+
type: Date,
|
|
230
|
+
description: "Fecha de última modificación del registro",
|
|
231
|
+
}),
|
|
232
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
233
|
+
__metadata("design:type", Date)
|
|
234
|
+
], AllActivities.prototype, "updatedAt", void 0);
|
|
235
|
+
__decorate([
|
|
236
|
+
(0, class_transformer_1.Expose)(),
|
|
237
|
+
__metadata("design:type", Object),
|
|
238
|
+
__metadata("design:paramtypes", [])
|
|
239
|
+
], AllActivities.prototype, "activityEntity", null);
|
|
240
|
+
__decorate([
|
|
241
|
+
(0, class_transformer_1.Expose)(),
|
|
242
|
+
__metadata("design:type", String),
|
|
243
|
+
__metadata("design:paramtypes", [])
|
|
244
|
+
], AllActivities.prototype, "specificEntityId", null);
|
|
245
|
+
__decorate([
|
|
246
|
+
(0, class_transformer_1.Expose)(),
|
|
247
|
+
__metadata("design:type", Boolean),
|
|
248
|
+
__metadata("design:paramtypes", [])
|
|
249
|
+
], AllActivities.prototype, "isConsistent", null);
|
|
250
|
+
__decorate([
|
|
251
|
+
(0, class_transformer_1.Expose)(),
|
|
252
|
+
__metadata("design:type", Object),
|
|
253
|
+
__metadata("design:paramtypes", [])
|
|
254
|
+
], AllActivities.prototype, "activitySummary", null);
|
|
255
|
+
exports.AllActivities = AllActivities = __decorate([
|
|
256
|
+
(0, typeorm_1.Entity)(),
|
|
257
|
+
(0, typeorm_1.Index)(['type']),
|
|
258
|
+
(0, typeorm_1.Index)(['activityDate']),
|
|
259
|
+
(0, typeorm_1.Index)(['status'])
|
|
260
|
+
], AllActivities);
|
|
261
|
+
//# sourceMappingURL=all-activities.entity.js.map
|
|
@@ -0,0 +1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C,GAAG,EAAE,CAAC,iCAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IACrE,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;8BACxB,iCAAW;8CAAC;AAYtB;IATC,IAAA,qBAAW,EAAC;QACX,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,uCAAuC;QACpD,QAAQ,EAAE,KAAK;KAChB,CAAC;IACD,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACf,CAAC;;+CAC6B;AAQ/B;IALC,IAAA,qBAAW,EAAC;QACX,IAAI,EAAE,IAAI;QACV,WAAW,EAAE,gCAAgC;KAC9C,CAAC;IACD,IAAA,0BAAgB,GAAE;8BACR,IAAI;gDAAC;AAOhB;IALC,IAAA,qBAAW,EAAC;QACX,IAAI,EAAE,IAAI;QACV,WAAW,EAAE,2CAA2C;KACzD,CAAC;IACD,IAAA,0BAAgB,GAAE;8BACR,IAAI;gDAAC;AAGhB;IAAC,IAAA,0BAAM,GAAE;;;mDAcR;AAGD;IAAC,IAAA,0BAAM,GAAE;;;qDAcR;AAGD;IAAC,IAAA,0BAAM,GAAE;;;iDAWR;AAGD;IAAC,IAAA,0BAAM,GAAE;;;oDAqBR;wBAvMU,aAAa;IAJzB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,CAAC,MAAM,CAAC,CAAC;IACf,IAAA,eAAK,EAAC,CAAC,cAAc,CAAC,CAAC;IACvB,IAAA,eAAK,EAAC,CAAC,QAAQ,CAAC,CAAC;GACL,aAAa,CAwMzB"}
|
package/dist/entities/index.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export * from "./tools/mail/email-signature.entity";
|
|
|
30
30
|
export * from "./tools/mail/mailbox-user-access.entity";
|
|
31
31
|
export * from "./tools/mail/mailbox.entity";
|
|
32
32
|
export * from "./tools/mail/mail.entity";
|
|
33
|
+
export * from "./all-activities.entity";
|
|
33
34
|
export * from "./thirdparty/google-webhooks-config.entity";
|
|
34
35
|
export * from "./thirdparty/google-gmail-watch-record.entity";
|
|
35
36
|
export * from "./thirdparty/oauth.entity";
|
package/dist/entities/index.js
CHANGED
|
@@ -46,6 +46,7 @@ __exportStar(require("./tools/mail/email-signature.entity"), exports);
|
|
|
46
46
|
__exportStar(require("./tools/mail/mailbox-user-access.entity"), exports);
|
|
47
47
|
__exportStar(require("./tools/mail/mailbox.entity"), exports);
|
|
48
48
|
__exportStar(require("./tools/mail/mail.entity"), exports);
|
|
49
|
+
__exportStar(require("./all-activities.entity"), exports);
|
|
49
50
|
__exportStar(require("./thirdparty/google-webhooks-config.entity"), exports);
|
|
50
51
|
__exportStar(require("./thirdparty/google-gmail-watch-record.entity"), exports);
|
|
51
52
|
__exportStar(require("./thirdparty/oauth.entity"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iEAA+C;AAC/C,oDAAkC;AAClC,0CAAwB;AACxB,+DAA6C;AAC7C,iDAA+B;AAC/B,iDAA+B;AAC/B,uDAAqC;AACrC,yDAAuC;AACvC,2DAAyC;AACzC,mDAAiC;AACjC,4DAA0C;AAC1C,kDAAgC;AAChC,mDAAiC;AACjC,sDAAoC;AACpC,iDAA+B;AAC/B,2CAAyB;AACzB,mDAAiC;AACjC,oDAAkC;AAClC,yDAAuC;AACvC,gDAA8B;AAC9B,0CAAwB;AACxB,+CAA6B;AAC7B,4DAA0C;AAC1C,gDAA8B;AAC9B,mDAAiC;AAGjC,iDAA+B;AAG/B,0CAAwB;AAGxB,uDAAqC;AAGrC,sEAAoD;AACpD,0EAAwD;AACxD,8DAA4C;AAC5C,2DAAyC;AAGzC,6EAA2D;AAC3D,gFAA8D;AAC9D,4DAA0C;AAC1C,uEAAqD;AACrD,oDAAkC;AAGlC,8DAA4C;AAC5C,sEAAoD;AACpD,yEAAuD;AAGvD,4CAA0B;AAG1B,iDAA+B;AAG/B,2DAAyC;AAGzC,oDAAkC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iEAA+C;AAC/C,oDAAkC;AAClC,0CAAwB;AACxB,+DAA6C;AAC7C,iDAA+B;AAC/B,iDAA+B;AAC/B,uDAAqC;AACrC,yDAAuC;AACvC,2DAAyC;AACzC,mDAAiC;AACjC,4DAA0C;AAC1C,kDAAgC;AAChC,mDAAiC;AACjC,sDAAoC;AACpC,iDAA+B;AAC/B,2CAAyB;AACzB,mDAAiC;AACjC,oDAAkC;AAClC,yDAAuC;AACvC,gDAA8B;AAC9B,0CAAwB;AACxB,+CAA6B;AAC7B,4DAA0C;AAC1C,gDAA8B;AAC9B,mDAAiC;AAGjC,iDAA+B;AAG/B,0CAAwB;AAGxB,uDAAqC;AAGrC,sEAAoD;AACpD,0EAAwD;AACxD,8DAA4C;AAC5C,2DAAyC;AAGzC,0DAAwC;AAGxC,6EAA2D;AAC3D,gFAA8D;AAC9D,4DAA0C;AAC1C,uEAAqD;AACrD,oDAAkC;AAGlC,8DAA4C;AAC5C,sEAAoD;AACpD,yEAAuD;AAGvD,4CAA0B;AAG1B,iDAA+B;AAG/B,2DAAyC;AAGzC,oDAAkC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AuthorizationService } from './services/authorization.service';
|
|
2
|
+
import { PermissionEvaluatorService } from './services/permission-evaluator.service';
|
|
3
|
+
import { PermissionCacheService } from './services/permission-cache.service';
|
|
4
|
+
import { ResourceAccessFilterService } from './services/resource-access-filter.service';
|
|
5
|
+
import { ResourceAuthorizationService } from './services/resource-authorization.service';
|
|
6
|
+
import { DynamicFilterService } from './services/dynamic-filter.service';
|
|
7
|
+
import { ContactAuthorizationService } from './services/modules/contact-authorization.service';
|
|
8
|
+
import { LeadAuthorizationService } from './services/modules/lead-authorization.service';
|
|
9
|
+
import { PolicyAuthorizationService } from './services/modules/policy-authorization.service';
|
|
10
|
+
import { TaskAuthorizationService } from './services/modules/task-authorization.service';
|
|
11
|
+
import { ResourceAuthorizationFactory } from './factories/resource-authorization.factory';
|
|
12
|
+
export declare class AuthorizationModule {
|
|
13
|
+
static forRoot(options?: {
|
|
14
|
+
cache?: {
|
|
15
|
+
ttl?: number;
|
|
16
|
+
max?: number;
|
|
17
|
+
store?: any;
|
|
18
|
+
};
|
|
19
|
+
}): {
|
|
20
|
+
module: typeof AuthorizationModule;
|
|
21
|
+
imports: import("@nestjs/common").DynamicModule[];
|
|
22
|
+
providers: (typeof ResourceAccessFilterService | typeof ResourceAuthorizationService | typeof DynamicFilterService | typeof PermissionEvaluatorService | typeof PermissionCacheService | typeof AuthorizationService | typeof ResourceAuthorizationFactory | typeof ContactAuthorizationService | typeof LeadAuthorizationService | typeof PolicyAuthorizationService | typeof TaskAuthorizationService)[];
|
|
23
|
+
exports: (typeof ResourceAccessFilterService | typeof ResourceAuthorizationService | typeof DynamicFilterService | typeof PermissionEvaluatorService | typeof PermissionCacheService | typeof AuthorizationService | typeof ResourceAuthorizationFactory | typeof ContactAuthorizationService | typeof LeadAuthorizationService | typeof PolicyAuthorizationService | typeof TaskAuthorizationService)[];
|
|
24
|
+
global: boolean;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
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 AuthorizationModule_1;
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.AuthorizationModule = void 0;
|
|
11
|
+
const common_1 = require("@nestjs/common");
|
|
12
|
+
const cache_manager_1 = require("@nestjs/cache-manager");
|
|
13
|
+
const authorization_service_1 = require("./services/authorization.service");
|
|
14
|
+
const permission_evaluator_service_1 = require("./services/permission-evaluator.service");
|
|
15
|
+
const permission_cache_service_1 = require("./services/permission-cache.service");
|
|
16
|
+
const resource_access_filter_service_1 = require("./services/resource-access-filter.service");
|
|
17
|
+
const resource_authorization_service_1 = require("./services/resource-authorization.service");
|
|
18
|
+
const dynamic_filter_service_1 = require("./services/dynamic-filter.service");
|
|
19
|
+
const contact_authorization_service_1 = require("./services/modules/contact-authorization.service");
|
|
20
|
+
const lead_authorization_service_1 = require("./services/modules/lead-authorization.service");
|
|
21
|
+
const policy_authorization_service_1 = require("./services/modules/policy-authorization.service");
|
|
22
|
+
const task_authorization_service_1 = require("./services/modules/task-authorization.service");
|
|
23
|
+
const resource_authorization_factory_1 = require("./factories/resource-authorization.factory");
|
|
24
|
+
let AuthorizationModule = AuthorizationModule_1 = class AuthorizationModule {
|
|
25
|
+
static forRoot(options) {
|
|
26
|
+
return {
|
|
27
|
+
module: AuthorizationModule_1,
|
|
28
|
+
imports: [
|
|
29
|
+
cache_manager_1.CacheModule.register({
|
|
30
|
+
ttl: options?.cache?.ttl || 300,
|
|
31
|
+
max: options?.cache?.max || 1000,
|
|
32
|
+
store: options?.cache?.store,
|
|
33
|
+
isGlobal: true,
|
|
34
|
+
}),
|
|
35
|
+
],
|
|
36
|
+
providers: [
|
|
37
|
+
authorization_service_1.AuthorizationService,
|
|
38
|
+
permission_evaluator_service_1.PermissionEvaluatorService,
|
|
39
|
+
permission_cache_service_1.PermissionCacheService,
|
|
40
|
+
resource_access_filter_service_1.ResourceAccessFilterService,
|
|
41
|
+
resource_authorization_service_1.ResourceAuthorizationService,
|
|
42
|
+
dynamic_filter_service_1.DynamicFilterService,
|
|
43
|
+
contact_authorization_service_1.ContactAuthorizationService,
|
|
44
|
+
lead_authorization_service_1.LeadAuthorizationService,
|
|
45
|
+
policy_authorization_service_1.PolicyAuthorizationService,
|
|
46
|
+
task_authorization_service_1.TaskAuthorizationService,
|
|
47
|
+
resource_authorization_factory_1.ResourceAuthorizationFactory,
|
|
48
|
+
],
|
|
49
|
+
exports: [
|
|
50
|
+
authorization_service_1.AuthorizationService,
|
|
51
|
+
permission_evaluator_service_1.PermissionEvaluatorService,
|
|
52
|
+
permission_cache_service_1.PermissionCacheService,
|
|
53
|
+
resource_access_filter_service_1.ResourceAccessFilterService,
|
|
54
|
+
resource_authorization_service_1.ResourceAuthorizationService,
|
|
55
|
+
dynamic_filter_service_1.DynamicFilterService,
|
|
56
|
+
contact_authorization_service_1.ContactAuthorizationService,
|
|
57
|
+
lead_authorization_service_1.LeadAuthorizationService,
|
|
58
|
+
policy_authorization_service_1.PolicyAuthorizationService,
|
|
59
|
+
task_authorization_service_1.TaskAuthorizationService,
|
|
60
|
+
resource_authorization_factory_1.ResourceAuthorizationFactory,
|
|
61
|
+
],
|
|
62
|
+
global: true,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
exports.AuthorizationModule = AuthorizationModule;
|
|
67
|
+
exports.AuthorizationModule = AuthorizationModule = AuthorizationModule_1 = __decorate([
|
|
68
|
+
(0, common_1.Global)(),
|
|
69
|
+
(0, common_1.Module)({
|
|
70
|
+
imports: [
|
|
71
|
+
cache_manager_1.CacheModule.register({
|
|
72
|
+
ttl: 300,
|
|
73
|
+
max: 1000,
|
|
74
|
+
isGlobal: true,
|
|
75
|
+
}),
|
|
76
|
+
],
|
|
77
|
+
providers: [
|
|
78
|
+
authorization_service_1.AuthorizationService,
|
|
79
|
+
permission_evaluator_service_1.PermissionEvaluatorService,
|
|
80
|
+
permission_cache_service_1.PermissionCacheService,
|
|
81
|
+
resource_access_filter_service_1.ResourceAccessFilterService,
|
|
82
|
+
resource_authorization_service_1.ResourceAuthorizationService,
|
|
83
|
+
dynamic_filter_service_1.DynamicFilterService,
|
|
84
|
+
contact_authorization_service_1.ContactAuthorizationService,
|
|
85
|
+
lead_authorization_service_1.LeadAuthorizationService,
|
|
86
|
+
policy_authorization_service_1.PolicyAuthorizationService,
|
|
87
|
+
task_authorization_service_1.TaskAuthorizationService,
|
|
88
|
+
resource_authorization_factory_1.ResourceAuthorizationFactory,
|
|
89
|
+
],
|
|
90
|
+
exports: [
|
|
91
|
+
authorization_service_1.AuthorizationService,
|
|
92
|
+
permission_evaluator_service_1.PermissionEvaluatorService,
|
|
93
|
+
permission_cache_service_1.PermissionCacheService,
|
|
94
|
+
resource_access_filter_service_1.ResourceAccessFilterService,
|
|
95
|
+
resource_authorization_service_1.ResourceAuthorizationService,
|
|
96
|
+
dynamic_filter_service_1.DynamicFilterService,
|
|
97
|
+
contact_authorization_service_1.ContactAuthorizationService,
|
|
98
|
+
lead_authorization_service_1.LeadAuthorizationService,
|
|
99
|
+
policy_authorization_service_1.PolicyAuthorizationService,
|
|
100
|
+
task_authorization_service_1.TaskAuthorizationService,
|
|
101
|
+
resource_authorization_factory_1.ResourceAuthorizationFactory,
|
|
102
|
+
],
|
|
103
|
+
})
|
|
104
|
+
], AuthorizationModule);
|
|
105
|
+
//# sourceMappingURL=authorization.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authorization.module.js","sourceRoot":"","sources":["../../../src/modules/authorization/authorization.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAgD;AAChD,yDAAoD;AAGpD,4EAAwE;AACxE,0FAAqF;AACrF,kFAA6E;AAC7E,8FAAwF;AACxF,8FAAyF;AACzF,8EAAyE;AAGzE,oGAA+F;AAC/F,8FAAyF;AACzF,kGAA6F;AAC7F,8FAAyF;AAGzF,+FAA0F;AAgEnF,IAAM,m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,6DAA4B;SAC7B;QACD,OAAO,EAAE;YAEP,4CAAoB;YACpB,yDAA0B;YAC1B,iDAAsB;YACtB,4DAA2B;YAC3B,6DAA4B;YAC5B,6CAAoB;YAGpB,2DAA2B;YAC3B,qDAAwB;YACxB,yDAA0B;YAC1B,qDAAwB;YAGxB,6DAA4B;SAC7B;KACF,CAAC;GACW,mBAAmB,CA+D/B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ResourceConfig } from "../services/resource-authorization.service";
|
|
2
|
+
export declare const CONTACT_RESOURCE_CONFIG: ResourceConfig;
|
|
3
|
+
export declare const LEAD_RESOURCE_CONFIG: ResourceConfig;
|
|
4
|
+
export declare const POLICY_RESOURCE_CONFIG: ResourceConfig;
|
|
5
|
+
export declare const TASK_RESOURCE_CONFIG: ResourceConfig;
|
|
6
|
+
export declare const CLAIM_RESOURCE_CONFIG: ResourceConfig;
|
|
7
|
+
export declare const RECEIPT_RESOURCE_CONFIG: ResourceConfig;
|
|
8
|
+
export declare const RESOURCE_CONFIGURATIONS: Record<string, ResourceConfig>;
|
|
9
|
+
export declare function getResourceConfig(resourceName: string): ResourceConfig;
|
|
10
|
+
export declare function hasSubGroupSupport(resourceName: string): boolean;
|
|
11
|
+
export declare function getColumnMapping(resourceName: string, logicalField: keyof ResourceConfig["columnMappings"]): string;
|
|
12
|
+
export declare function getAvailableResources(): string[];
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RESOURCE_CONFIGURATIONS = exports.RECEIPT_RESOURCE_CONFIG = exports.CLAIM_RESOURCE_CONFIG = exports.TASK_RESOURCE_CONFIG = exports.POLICY_RESOURCE_CONFIG = exports.LEAD_RESOURCE_CONFIG = exports.CONTACT_RESOURCE_CONFIG = void 0;
|
|
4
|
+
exports.getResourceConfig = getResourceConfig;
|
|
5
|
+
exports.hasSubGroupSupport = hasSubGroupSupport;
|
|
6
|
+
exports.getColumnMapping = getColumnMapping;
|
|
7
|
+
exports.getAvailableResources = getAvailableResources;
|
|
8
|
+
exports.CONTACT_RESOURCE_CONFIG = {
|
|
9
|
+
name: "contact",
|
|
10
|
+
entityName: "Contact",
|
|
11
|
+
columnMappings: {
|
|
12
|
+
assignedTo: "assignedById",
|
|
13
|
+
observers: "observerId",
|
|
14
|
+
createdBy: "createdById",
|
|
15
|
+
groupId: "groupId",
|
|
16
|
+
subGroupId: "subGroupId",
|
|
17
|
+
},
|
|
18
|
+
subGroupConfig: {
|
|
19
|
+
enabled: true,
|
|
20
|
+
relationField: "subGroupId",
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
exports.LEAD_RESOURCE_CONFIG = {
|
|
24
|
+
name: "lead",
|
|
25
|
+
entityName: "Lead",
|
|
26
|
+
columnMappings: {
|
|
27
|
+
assignedTo: "assignedById",
|
|
28
|
+
observers: "observer",
|
|
29
|
+
createdBy: "createdById",
|
|
30
|
+
groupId: "groupId",
|
|
31
|
+
subGroupId: "subGroupId",
|
|
32
|
+
},
|
|
33
|
+
subGroupConfig: {
|
|
34
|
+
enabled: true,
|
|
35
|
+
relationField: "subGroupId",
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
exports.POLICY_RESOURCE_CONFIG = {
|
|
39
|
+
name: "policy",
|
|
40
|
+
entityName: "Policy",
|
|
41
|
+
columnMappings: {
|
|
42
|
+
assignedTo: "assignedById",
|
|
43
|
+
observers: "observers",
|
|
44
|
+
createdBy: "createdById",
|
|
45
|
+
groupId: "groupId",
|
|
46
|
+
subGroupId: "subGroupId",
|
|
47
|
+
},
|
|
48
|
+
subGroupConfig: {
|
|
49
|
+
enabled: true,
|
|
50
|
+
relationField: "subGroupId",
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
exports.TASK_RESOURCE_CONFIG = {
|
|
54
|
+
name: "task",
|
|
55
|
+
entityName: "Task",
|
|
56
|
+
columnMappings: {
|
|
57
|
+
assignedTo: "responsible",
|
|
58
|
+
observers: "observers",
|
|
59
|
+
createdBy: "createdBy",
|
|
60
|
+
groupId: "groupId",
|
|
61
|
+
subGroupId: "subGroupId",
|
|
62
|
+
participants: "participants",
|
|
63
|
+
id: "id",
|
|
64
|
+
},
|
|
65
|
+
subGroupConfig: {
|
|
66
|
+
enabled: true,
|
|
67
|
+
relationField: "subGroupId",
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
exports.CLAIM_RESOURCE_CONFIG = {
|
|
71
|
+
name: "claim",
|
|
72
|
+
entityName: "Claim",
|
|
73
|
+
columnMappings: {
|
|
74
|
+
assignedTo: "assignedTo",
|
|
75
|
+
observers: "observers",
|
|
76
|
+
createdBy: "createdBy",
|
|
77
|
+
groupId: "groupId",
|
|
78
|
+
},
|
|
79
|
+
subGroupConfig: {
|
|
80
|
+
enabled: true,
|
|
81
|
+
relationField: "subGroupId",
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
exports.RECEIPT_RESOURCE_CONFIG = {
|
|
85
|
+
name: "receipt",
|
|
86
|
+
entityName: "Receipt",
|
|
87
|
+
columnMappings: {
|
|
88
|
+
assignedTo: "assignedTo",
|
|
89
|
+
observers: "observers",
|
|
90
|
+
createdBy: "createdBy",
|
|
91
|
+
groupId: "groupId",
|
|
92
|
+
},
|
|
93
|
+
subGroupConfig: {
|
|
94
|
+
enabled: true,
|
|
95
|
+
relationField: "subGroupId",
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
exports.RESOURCE_CONFIGURATIONS = {
|
|
99
|
+
contact: exports.CONTACT_RESOURCE_CONFIG,
|
|
100
|
+
lead: exports.LEAD_RESOURCE_CONFIG,
|
|
101
|
+
policy: exports.POLICY_RESOURCE_CONFIG,
|
|
102
|
+
task: exports.TASK_RESOURCE_CONFIG,
|
|
103
|
+
claim: exports.CLAIM_RESOURCE_CONFIG,
|
|
104
|
+
receipt: exports.RECEIPT_RESOURCE_CONFIG,
|
|
105
|
+
};
|
|
106
|
+
function getResourceConfig(resourceName) {
|
|
107
|
+
const config = exports.RESOURCE_CONFIGURATIONS[resourceName];
|
|
108
|
+
if (!config) {
|
|
109
|
+
throw new Error(`Resource configuration not found for: ${resourceName}`);
|
|
110
|
+
}
|
|
111
|
+
return config;
|
|
112
|
+
}
|
|
113
|
+
function hasSubGroupSupport(resourceName) {
|
|
114
|
+
const config = getResourceConfig(resourceName);
|
|
115
|
+
return config.subGroupConfig?.enabled ?? false;
|
|
116
|
+
}
|
|
117
|
+
function getColumnMapping(resourceName, logicalField) {
|
|
118
|
+
const config = getResourceConfig(resourceName);
|
|
119
|
+
return config.columnMappings[logicalField] || logicalField;
|
|
120
|
+
}
|
|
121
|
+
function getAvailableResources() {
|
|
122
|
+
return Object.keys(exports.RESOURCE_CONFIGURATIONS);
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=resource-configurations.js.map
|