easywork-common-lib 1.0.1310 → 1.0.1314

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.
Files changed (31) hide show
  1. package/dist/entities/helpers/sales/agent/connection/h_agent_connection.entity.js +1 -1
  2. package/dist/entities/helpers/sales/agent/connection/h_agent_connection.entity.js.map +1 -1
  3. package/dist/entities/thirdparty/wati/index.d.ts +7 -0
  4. package/dist/entities/thirdparty/wati/index.js +24 -0
  5. package/dist/entities/thirdparty/wati/index.js.map +1 -0
  6. package/dist/entities/thirdparty/wati/wati-chat.entity.d.ts +27 -0
  7. package/dist/entities/thirdparty/wati/wati-chat.entity.js +207 -0
  8. package/dist/entities/thirdparty/wati/wati-chat.entity.js.map +1 -0
  9. package/dist/entities/thirdparty/wati/wati-configuration.entity.d.ts +22 -0
  10. package/dist/entities/thirdparty/wati/wati-configuration.entity.js +149 -0
  11. package/dist/entities/thirdparty/wati/wati-configuration.entity.js.map +1 -0
  12. package/dist/entities/thirdparty/wati/wati-events.entity.d.ts +9 -0
  13. package/dist/entities/thirdparty/wati/wati-events.entity.js +63 -0
  14. package/dist/entities/thirdparty/wati/wati-events.entity.js.map +1 -0
  15. package/dist/entities/thirdparty/wati/wati-message.entity.d.ts +30 -0
  16. package/dist/entities/thirdparty/wati/wati-message.entity.js +280 -0
  17. package/dist/entities/thirdparty/wati/wati-message.entity.js.map +1 -0
  18. package/dist/entities/thirdparty/wati/wati-user-access-log.entity.d.ts +71 -0
  19. package/dist/entities/thirdparty/wati/wati-user-access-log.entity.js +216 -0
  20. package/dist/entities/thirdparty/wati/wati-user-access-log.entity.js.map +1 -0
  21. package/dist/entities/thirdparty/wati/wati-user-access.entity.d.ts +31 -0
  22. package/dist/entities/thirdparty/wati/wati-user-access.entity.js +193 -0
  23. package/dist/entities/thirdparty/wati/wati-user-access.entity.js.map +1 -0
  24. package/dist/entities/thirdparty/wati/wati.enum.d.ts +69 -0
  25. package/dist/entities/thirdparty/wati/wati.enum.js +83 -0
  26. package/dist/entities/thirdparty/wati/wati.enum.js.map +1 -0
  27. package/dist/entities/tools/mail/mail-contact.entity.d.ts +11 -0
  28. package/dist/entities/tools/mail/mail-contact.entity.js +61 -0
  29. package/dist/entities/tools/mail/mail-contact.entity.js.map +1 -0
  30. package/dist/modules/authorization/authorization.module.d.ts +2 -2
  31. package/package.json +1 -1
@@ -0,0 +1,193 @@
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.WatiUserAccess = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const common_1 = require("../../../common");
15
+ const wati_enum_1 = require("./wati.enum");
16
+ const wati_configuration_entity_1 = require("./wati-configuration.entity");
17
+ const user_entity_1 = require("../../user.entity");
18
+ const group_entity_1 = require("../../group.entity");
19
+ let WatiUserAccess = class WatiUserAccess extends common_1.EntityBase {
20
+ groupId;
21
+ group;
22
+ watiConfigurationId;
23
+ watiConfiguration;
24
+ userId;
25
+ user;
26
+ userType;
27
+ status;
28
+ watiUserId;
29
+ watiUserEmail;
30
+ currentMonthSessionMessages;
31
+ currentMonthTemplateMessages;
32
+ lastAccessAt;
33
+ lastMessageSentAt;
34
+ receiveNotifications;
35
+ createdByUserId;
36
+ notes;
37
+ countsAgainstWatiLimit() {
38
+ return this.userType === wati_enum_1.WatiUserType.WATI_USER && this.status === wati_enum_1.WatiUserAccessStatus.ACTIVE;
39
+ }
40
+ canSendMessages() {
41
+ return this.userType === wati_enum_1.WatiUserType.WATI_USER && this.status === wati_enum_1.WatiUserAccessStatus.ACTIVE;
42
+ }
43
+ canViewConversations() {
44
+ return this.status === wati_enum_1.WatiUserAccessStatus.ACTIVE;
45
+ }
46
+ canBeAssigned() {
47
+ return this.userType === wati_enum_1.WatiUserType.WATI_USER && this.status === wati_enum_1.WatiUserAccessStatus.ACTIVE;
48
+ }
49
+ incrementMessageCounter(type) {
50
+ if (type === "session") {
51
+ this.currentMonthSessionMessages++;
52
+ }
53
+ else {
54
+ this.currentMonthTemplateMessages++;
55
+ }
56
+ this.lastMessageSentAt = new Date();
57
+ }
58
+ updateLastAccess() {
59
+ this.lastAccessAt = new Date();
60
+ }
61
+ resetMonthlyCounters() {
62
+ this.currentMonthSessionMessages = 0;
63
+ this.currentMonthTemplateMessages = 0;
64
+ }
65
+ };
66
+ exports.WatiUserAccess = WatiUserAccess;
67
+ __decorate([
68
+ (0, typeorm_1.Column)({ type: "uuid", comment: "ID del grupo (tenant) - CRÍTICO para multitenancy" }),
69
+ (0, typeorm_1.Index)(),
70
+ __metadata("design:type", String)
71
+ ], WatiUserAccess.prototype, "groupId", void 0);
72
+ __decorate([
73
+ (0, typeorm_1.ManyToOne)(() => group_entity_1.Group, { onDelete: "CASCADE" }),
74
+ (0, typeorm_1.JoinColumn)({ name: "groupId" }),
75
+ __metadata("design:type", group_entity_1.Group)
76
+ ], WatiUserAccess.prototype, "group", void 0);
77
+ __decorate([
78
+ (0, typeorm_1.Column)({ type: "uuid", comment: "ID de la configuración WATI asociada" }),
79
+ (0, typeorm_1.Index)(),
80
+ __metadata("design:type", String)
81
+ ], WatiUserAccess.prototype, "watiConfigurationId", void 0);
82
+ __decorate([
83
+ (0, typeorm_1.ManyToOne)(() => wati_configuration_entity_1.WatiConfiguration, { onDelete: "CASCADE" }),
84
+ (0, typeorm_1.JoinColumn)({ name: "watiConfigurationId" }),
85
+ __metadata("design:type", wati_configuration_entity_1.WatiConfiguration)
86
+ ], WatiUserAccess.prototype, "watiConfiguration", void 0);
87
+ __decorate([
88
+ (0, typeorm_1.Column)({ type: "uuid", comment: "ID del usuario de Easywork" }),
89
+ (0, typeorm_1.Index)(),
90
+ __metadata("design:type", String)
91
+ ], WatiUserAccess.prototype, "userId", void 0);
92
+ __decorate([
93
+ (0, typeorm_1.ManyToOne)(() => user_entity_1.User, { onDelete: "CASCADE" }),
94
+ (0, typeorm_1.JoinColumn)({ name: "userId" }),
95
+ __metadata("design:type", user_entity_1.User)
96
+ ], WatiUserAccess.prototype, "user", void 0);
97
+ __decorate([
98
+ (0, typeorm_1.Column)({
99
+ type: "enum",
100
+ enum: wati_enum_1.WatiUserType,
101
+ default: wati_enum_1.WatiUserType.VIEWER,
102
+ comment: "Tipo de usuario: WATI_USER (cuenta contra límite) o VIEWER (no cuenta)",
103
+ }),
104
+ __metadata("design:type", String)
105
+ ], WatiUserAccess.prototype, "userType", void 0);
106
+ __decorate([
107
+ (0, typeorm_1.Column)({
108
+ type: "enum",
109
+ enum: wati_enum_1.WatiUserAccessStatus,
110
+ default: wati_enum_1.WatiUserAccessStatus.ACTIVE,
111
+ comment: "Estado del acceso del usuario",
112
+ }),
113
+ __metadata("design:type", String)
114
+ ], WatiUserAccess.prototype, "status", void 0);
115
+ __decorate([
116
+ (0, typeorm_1.Column)({
117
+ type: "varchar",
118
+ length: 255,
119
+ nullable: true,
120
+ comment: "ID del usuario en WATI (para usuarios WATI_USER)",
121
+ }),
122
+ __metadata("design:type", String)
123
+ ], WatiUserAccess.prototype, "watiUserId", void 0);
124
+ __decorate([
125
+ (0, typeorm_1.Column)({
126
+ type: "varchar",
127
+ length: 255,
128
+ nullable: true,
129
+ comment: "Email asociado en WATI (para usuarios WATI_USER)",
130
+ }),
131
+ __metadata("design:type", String)
132
+ ], WatiUserAccess.prototype, "watiUserEmail", void 0);
133
+ __decorate([
134
+ (0, typeorm_1.Column)({
135
+ type: "integer",
136
+ default: 0,
137
+ comment: "Mensajes de sesión enviados en el mes actual",
138
+ }),
139
+ __metadata("design:type", Number)
140
+ ], WatiUserAccess.prototype, "currentMonthSessionMessages", void 0);
141
+ __decorate([
142
+ (0, typeorm_1.Column)({
143
+ type: "integer",
144
+ default: 0,
145
+ comment: "Mensajes de plantilla enviados en el mes actual",
146
+ }),
147
+ __metadata("design:type", Number)
148
+ ], WatiUserAccess.prototype, "currentMonthTemplateMessages", void 0);
149
+ __decorate([
150
+ (0, typeorm_1.Column)({
151
+ type: "timestamp",
152
+ nullable: true,
153
+ comment: "Última vez que el usuario accedió al sistema WATI",
154
+ }),
155
+ __metadata("design:type", Date)
156
+ ], WatiUserAccess.prototype, "lastAccessAt", void 0);
157
+ __decorate([
158
+ (0, typeorm_1.Column)({
159
+ type: "timestamp",
160
+ nullable: true,
161
+ comment: "Última vez que el usuario envió un mensaje",
162
+ }),
163
+ __metadata("design:type", Date)
164
+ ], WatiUserAccess.prototype, "lastMessageSentAt", void 0);
165
+ __decorate([
166
+ (0, typeorm_1.Column)({
167
+ type: "boolean",
168
+ default: true,
169
+ comment: "Si el usuario recibe notificaciones de nuevos mensajes",
170
+ }),
171
+ __metadata("design:type", Boolean)
172
+ ], WatiUserAccess.prototype, "receiveNotifications", void 0);
173
+ __decorate([
174
+ (0, typeorm_1.Column)({
175
+ type: "uuid",
176
+ nullable: true,
177
+ comment: "Usuario que creó este acceso",
178
+ }),
179
+ __metadata("design:type", String)
180
+ ], WatiUserAccess.prototype, "createdByUserId", void 0);
181
+ __decorate([
182
+ (0, typeorm_1.Column)({
183
+ type: "text",
184
+ nullable: true,
185
+ comment: "Notas adicionales sobre este acceso de usuario",
186
+ }),
187
+ __metadata("design:type", String)
188
+ ], WatiUserAccess.prototype, "notes", void 0);
189
+ exports.WatiUserAccess = WatiUserAccess = __decorate([
190
+ (0, typeorm_1.Entity)("wati_user_access"),
191
+ (0, typeorm_1.Index)(["groupId", "userId", "watiConfigurationId"], { unique: true })
192
+ ], WatiUserAccess);
193
+ //# sourceMappingURL=wati-user-access.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wati-user-access.entity.js","sourceRoot":"","sources":["../../../../src/entities/thirdparty/wati/wati-user-access.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAuE;AACvE,4CAA6C;AAC7C,2CAAiE;AACjE,2EAAgE;AAChE,mDAAyC;AACzC,qDAA2C;AASpC,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,mBAAU;IAG5C,OAAO,CAAS;IAIhB,KAAK,CAAQ;IAIb,mBAAmB,CAAS;IAI5B,iBAAiB,CAAoB;IAIrC,MAAM,CAAS;IAIf,IAAI,CAAO;IAQX,QAAQ,CAAe;IAQvB,MAAM,CAAuB;IAQ7B,UAAU,CAAU;IAQpB,aAAa,CAAU;IAQvB,2BAA2B,CAAS;IAOpC,4BAA4B,CAAS;IAOrC,YAAY,CAAQ;IAOpB,iBAAiB,CAAQ;IAQzB,oBAAoB,CAAU;IAQ9B,eAAe,CAAU;IAOzB,KAAK,CAAU;IAOf,sBAAsB;QACpB,OAAO,IAAI,CAAC,QAAQ,KAAK,wBAAY,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,KAAK,gCAAoB,CAAC,MAAM,CAAC;IACjG,CAAC;IAMD,eAAe;QACb,OAAO,IAAI,CAAC,QAAQ,KAAK,wBAAY,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,KAAK,gCAAoB,CAAC,MAAM,CAAC;IACjG,CAAC;IAKD,oBAAoB;QAClB,OAAO,IAAI,CAAC,MAAM,KAAK,gCAAoB,CAAC,MAAM,CAAC;IACrD,CAAC;IAMD,aAAa;QACX,OAAO,IAAI,CAAC,QAAQ,KAAK,wBAAY,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,KAAK,gCAAoB,CAAC,MAAM,CAAC;IACjG,CAAC;IAKD,uBAAuB,CAAC,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QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,4CAA4C;KACtD,CAAC;8BACkB,IAAI;yDAAC;AAQzB;IALC,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,wDAAwD;KAClE,CAAC;;4DAC4B;AAQ9B;IALC,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,8BAA8B;KACxC,CAAC;;uDACuB;AAOzB;IALC,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,gDAAgD;KAC1D,CAAC;;6CACa;yBA3GJ,cAAc;IAF1B,IAAA,gBAAM,EAAC,kBAAkB,CAAC;IAC1B,IAAA,eAAK,EAAC,CAAC,SAAS,EAAE,QAAQ,EAAE,qBAAqB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;GACzD,cAAc,CAuK1B"}
@@ -0,0 +1,69 @@
1
+ export declare enum WatiMessageDirection {
2
+ INBOUND = "INBOUND",
3
+ OUTBOUND = "OUTBOUND"
4
+ }
5
+ export declare enum WatiMessageStatus {
6
+ PENDING = "PENDING",
7
+ SENT = "SENT",
8
+ DELIVERED = "DELIVERED",
9
+ READ = "READ",
10
+ FAILED = "FAILED"
11
+ }
12
+ export declare enum WatiMessageType {
13
+ image = "image",
14
+ text = "text",
15
+ document = "document",
16
+ location = "location",
17
+ voice = "voice",
18
+ audio = "audio",
19
+ button = "button",
20
+ video = "video",
21
+ sticker = "sticker"
22
+ }
23
+ export declare enum WatiEventType {
24
+ message = "message",
25
+ newContactMessageReceived = "newContactMessageReceived",
26
+ sessionMessageSent_v2 = "sessionMessageSent_v2",
27
+ templateMessageSent_v2 = "templateMessageSent_v2",
28
+ sentMessageDELIVERED_v2 = "sentMessageDELIVERED_v2",
29
+ sentMessageREAD_v2 = "sentMessageREAD_v2",
30
+ sentMessageREPLIED_v2 = "sentMessageREPLIED_v2",
31
+ templateMessageFailed = "templateMessageFailed",
32
+ templateMessageSent = "templateMessageSent"
33
+ }
34
+ export declare enum WhatsAppConversationStatusEnum {
35
+ OPEN = "OPEN",
36
+ CLOSED_BY_AGENT = "CLOSED_BY_AGENT",
37
+ CLOSED_BY_SYSTEM = "CLOSED_BY_SYSTEM",
38
+ ARCHIVED = "ARCHIVED",
39
+ PENDING_AGENT_RESPONSE = "PENDING_AGENT_RESPONSE",
40
+ PENDING_CONTACT_RESPONSE = "PENDING_CONTACT_RESPONSE"
41
+ }
42
+ export declare enum WatiIntegrationStatusEnum {
43
+ PENDING_SETUP = "PENDING_SETUP",
44
+ WEBHOOK_PENDING_VERIFICATION = "WEBHOOK_PENDING_VERIFICATION",
45
+ ACTIVE = "ACTIVE",
46
+ CONFIGURATION_ERROR = "CONFIGURATION_ERROR",
47
+ WEBHOOK_ERROR = "WEBHOOK_ERROR",
48
+ API_ERROR = "API_ERROR"
49
+ }
50
+ export declare enum WatiPlanType {
51
+ GROWTH = "GROWTH",
52
+ PRO = "PRO",
53
+ BUSINESS = "BUSINESS"
54
+ }
55
+ export declare enum WatiUserType {
56
+ WATI_USER = "WATI_USER",
57
+ VIEWER = "VIEWER"
58
+ }
59
+ export declare enum WatiUserAccessStatus {
60
+ ACTIVE = "ACTIVE",
61
+ INACTIVE = "INACTIVE",
62
+ SUSPENDED = "SUSPENDED",
63
+ PENDING = "PENDING"
64
+ }
65
+ export declare enum WatiMessageCostType {
66
+ SESSION = "SESSION",
67
+ TEMPLATE = "TEMPLATE",
68
+ INBOUND = "INBOUND"
69
+ }
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WatiMessageCostType = exports.WatiUserAccessStatus = exports.WatiUserType = exports.WatiPlanType = exports.WatiIntegrationStatusEnum = exports.WhatsAppConversationStatusEnum = exports.WatiEventType = exports.WatiMessageType = exports.WatiMessageStatus = exports.WatiMessageDirection = void 0;
4
+ var WatiMessageDirection;
5
+ (function (WatiMessageDirection) {
6
+ WatiMessageDirection["INBOUND"] = "INBOUND";
7
+ WatiMessageDirection["OUTBOUND"] = "OUTBOUND";
8
+ })(WatiMessageDirection || (exports.WatiMessageDirection = WatiMessageDirection = {}));
9
+ var WatiMessageStatus;
10
+ (function (WatiMessageStatus) {
11
+ WatiMessageStatus["PENDING"] = "PENDING";
12
+ WatiMessageStatus["SENT"] = "SENT";
13
+ WatiMessageStatus["DELIVERED"] = "DELIVERED";
14
+ WatiMessageStatus["READ"] = "READ";
15
+ WatiMessageStatus["FAILED"] = "FAILED";
16
+ })(WatiMessageStatus || (exports.WatiMessageStatus = WatiMessageStatus = {}));
17
+ var WatiMessageType;
18
+ (function (WatiMessageType) {
19
+ WatiMessageType["image"] = "image";
20
+ WatiMessageType["text"] = "text";
21
+ WatiMessageType["document"] = "document";
22
+ WatiMessageType["location"] = "location";
23
+ WatiMessageType["voice"] = "voice";
24
+ WatiMessageType["audio"] = "audio";
25
+ WatiMessageType["button"] = "button";
26
+ WatiMessageType["video"] = "video";
27
+ WatiMessageType["sticker"] = "sticker";
28
+ })(WatiMessageType || (exports.WatiMessageType = WatiMessageType = {}));
29
+ var WatiEventType;
30
+ (function (WatiEventType) {
31
+ WatiEventType["message"] = "message";
32
+ WatiEventType["newContactMessageReceived"] = "newContactMessageReceived";
33
+ WatiEventType["sessionMessageSent_v2"] = "sessionMessageSent_v2";
34
+ WatiEventType["templateMessageSent_v2"] = "templateMessageSent_v2";
35
+ WatiEventType["sentMessageDELIVERED_v2"] = "sentMessageDELIVERED_v2";
36
+ WatiEventType["sentMessageREAD_v2"] = "sentMessageREAD_v2";
37
+ WatiEventType["sentMessageREPLIED_v2"] = "sentMessageREPLIED_v2";
38
+ WatiEventType["templateMessageFailed"] = "templateMessageFailed";
39
+ WatiEventType["templateMessageSent"] = "templateMessageSent";
40
+ })(WatiEventType || (exports.WatiEventType = WatiEventType = {}));
41
+ var WhatsAppConversationStatusEnum;
42
+ (function (WhatsAppConversationStatusEnum) {
43
+ WhatsAppConversationStatusEnum["OPEN"] = "OPEN";
44
+ WhatsAppConversationStatusEnum["CLOSED_BY_AGENT"] = "CLOSED_BY_AGENT";
45
+ WhatsAppConversationStatusEnum["CLOSED_BY_SYSTEM"] = "CLOSED_BY_SYSTEM";
46
+ WhatsAppConversationStatusEnum["ARCHIVED"] = "ARCHIVED";
47
+ WhatsAppConversationStatusEnum["PENDING_AGENT_RESPONSE"] = "PENDING_AGENT_RESPONSE";
48
+ WhatsAppConversationStatusEnum["PENDING_CONTACT_RESPONSE"] = "PENDING_CONTACT_RESPONSE";
49
+ })(WhatsAppConversationStatusEnum || (exports.WhatsAppConversationStatusEnum = WhatsAppConversationStatusEnum = {}));
50
+ var WatiIntegrationStatusEnum;
51
+ (function (WatiIntegrationStatusEnum) {
52
+ WatiIntegrationStatusEnum["PENDING_SETUP"] = "PENDING_SETUP";
53
+ WatiIntegrationStatusEnum["WEBHOOK_PENDING_VERIFICATION"] = "WEBHOOK_PENDING_VERIFICATION";
54
+ WatiIntegrationStatusEnum["ACTIVE"] = "ACTIVE";
55
+ WatiIntegrationStatusEnum["CONFIGURATION_ERROR"] = "CONFIGURATION_ERROR";
56
+ WatiIntegrationStatusEnum["WEBHOOK_ERROR"] = "WEBHOOK_ERROR";
57
+ WatiIntegrationStatusEnum["API_ERROR"] = "API_ERROR";
58
+ })(WatiIntegrationStatusEnum || (exports.WatiIntegrationStatusEnum = WatiIntegrationStatusEnum = {}));
59
+ var WatiPlanType;
60
+ (function (WatiPlanType) {
61
+ WatiPlanType["GROWTH"] = "GROWTH";
62
+ WatiPlanType["PRO"] = "PRO";
63
+ WatiPlanType["BUSINESS"] = "BUSINESS";
64
+ })(WatiPlanType || (exports.WatiPlanType = WatiPlanType = {}));
65
+ var WatiUserType;
66
+ (function (WatiUserType) {
67
+ WatiUserType["WATI_USER"] = "WATI_USER";
68
+ WatiUserType["VIEWER"] = "VIEWER";
69
+ })(WatiUserType || (exports.WatiUserType = WatiUserType = {}));
70
+ var WatiUserAccessStatus;
71
+ (function (WatiUserAccessStatus) {
72
+ WatiUserAccessStatus["ACTIVE"] = "ACTIVE";
73
+ WatiUserAccessStatus["INACTIVE"] = "INACTIVE";
74
+ WatiUserAccessStatus["SUSPENDED"] = "SUSPENDED";
75
+ WatiUserAccessStatus["PENDING"] = "PENDING";
76
+ })(WatiUserAccessStatus || (exports.WatiUserAccessStatus = WatiUserAccessStatus = {}));
77
+ var WatiMessageCostType;
78
+ (function (WatiMessageCostType) {
79
+ WatiMessageCostType["SESSION"] = "SESSION";
80
+ WatiMessageCostType["TEMPLATE"] = "TEMPLATE";
81
+ WatiMessageCostType["INBOUND"] = "INBOUND";
82
+ })(WatiMessageCostType || (exports.WatiMessageCostType = WatiMessageCostType = {}));
83
+ //# sourceMappingURL=wati.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wati.enum.js","sourceRoot":"","sources":["../../../../src/entities/thirdparty/wati/wati.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC9B,2CAAmB,CAAA;IACnB,6CAAqB,CAAA;AACvB,CAAC,EAHW,oBAAoB,oCAApB,oBAAoB,QAG/B;AAED,IAAY,iBAMX;AAND,WAAY,iBAAiB;IAC3B,wCAAmB,CAAA;IACnB,kCAAa,CAAA;IACb,4CAAuB,CAAA;IACvB,kCAAa,CAAA;IACb,sCAAiB,CAAA;AACnB,CAAC,EANW,iBAAiB,iCAAjB,iBAAiB,QAM5B;AAED,IAAY,eAUX;AAVD,WAAY,eAAe;IACzB,kCAAe,CAAA;IACf,gCAAa,CAAA;IACb,wCAAqB,CAAA;IACrB,wCAAqB,CAAA;IACrB,kCAAe,CAAA;IACf,kCAAe,CAAA;IACf,oCAAiB,CAAA;IACjB,kCAAe,CAAA;IACf,sCAAmB,CAAA;AACrB,CAAC,EAVW,eAAe,+BAAf,eAAe,QAU1B;AAED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AmB,CAAA;AACrB,CAAC,EATW,mBAAmB,mCAAnB,mBAAmB,QAS9B"}
@@ -0,0 +1,11 @@
1
+ import { BaseEntity } from 'typeorm';
2
+ import { User } from '../../user.entity';
3
+ export declare class MailContact extends BaseEntity {
4
+ id: string;
5
+ name: string;
6
+ lastname: string;
7
+ email: string;
8
+ createdBy?: User;
9
+ createdAt?: Date;
10
+ updatedAt?: Date;
11
+ }
@@ -0,0 +1,61 @@
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.MailContact = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const swagger_1 = require("@nestjs/swagger");
15
+ const user_entity_1 = require("../../user.entity");
16
+ let MailContact = class MailContact extends typeorm_1.BaseEntity {
17
+ id;
18
+ name;
19
+ lastname;
20
+ email;
21
+ createdBy;
22
+ createdAt;
23
+ updatedAt;
24
+ };
25
+ exports.MailContact = MailContact;
26
+ __decorate([
27
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
28
+ __metadata("design:type", String)
29
+ ], MailContact.prototype, "id", void 0);
30
+ __decorate([
31
+ (0, swagger_1.ApiProperty)({ description: 'Contact name', required: true }),
32
+ (0, typeorm_1.Column)(),
33
+ __metadata("design:type", String)
34
+ ], MailContact.prototype, "name", void 0);
35
+ __decorate([
36
+ (0, swagger_1.ApiProperty)({ description: 'Contact last name', required: true }),
37
+ (0, typeorm_1.Column)(),
38
+ __metadata("design:type", String)
39
+ ], MailContact.prototype, "lastname", void 0);
40
+ __decorate([
41
+ (0, swagger_1.ApiProperty)({ description: 'Contact email', required: true }),
42
+ (0, typeorm_1.Column)(),
43
+ __metadata("design:type", String)
44
+ ], MailContact.prototype, "email", void 0);
45
+ __decorate([
46
+ (0, swagger_1.ApiProperty)({ description: 'User who created this contact', required: false }),
47
+ (0, typeorm_1.ManyToOne)(() => user_entity_1.User, { nullable: true, onDelete: 'SET NULL' }),
48
+ __metadata("design:type", user_entity_1.User)
49
+ ], MailContact.prototype, "createdBy", void 0);
50
+ __decorate([
51
+ (0, typeorm_1.CreateDateColumn)(),
52
+ __metadata("design:type", Date)
53
+ ], MailContact.prototype, "createdAt", void 0);
54
+ __decorate([
55
+ (0, typeorm_1.UpdateDateColumn)(),
56
+ __metadata("design:type", Date)
57
+ ], MailContact.prototype, "updatedAt", void 0);
58
+ exports.MailContact = MailContact = __decorate([
59
+ (0, typeorm_1.Entity)()
60
+ ], MailContact);
61
+ //# sourceMappingURL=mail-contact.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mail-contact.entity.js","sourceRoot":"","sources":["../../../../src/entities/tools/mail/mail-contact.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA4H;AAC5H,6CAA8C;AAE9C,mDAAyC;AAGlC,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,oBAAU;IAEzC,EAAE,CAAS;IAIX,IAAI,CAAS;IAIb,QAAQ,CAAS;IAIjB,KAAK,CAAS;IAId,SAAS,CAAQ;IAGjB,SAAS,CAAQ;IAGjB,SAAS,CAAQ;CAClB,CAAA;AAzBY,kCAAW;AAEtB;IADC,IAAA,gCAAsB,EAAC,MAAM,CAAC;;uCACpB;AAIX;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,cAAc,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC5D,IAAA,gBAAM,GAAE;;yCACI;AAIb;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,mBAAmB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACjE,IAAA,gBAAM,GAAE;;6CACQ;AAIjB;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,eAAe,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC7D,IAAA,gBAAM,GAAE;;0CACK;AAId;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,+BAA+B,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAC9E,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;8BACpD,kBAAI;8CAAC;AAGjB;IADC,IAAA,0BAAgB,GAAE;8BACP,IAAI;8CAAC;AAGjB;IADC,IAAA,0BAAgB,GAAE;8BACP,IAAI;8CAAC;sBAxBN,WAAW;IADvB,IAAA,gBAAM,GAAE;GACI,WAAW,CAyBvB"}
@@ -19,8 +19,8 @@ export declare class AuthorizationModule {
19
19
  }): {
20
20
  module: typeof AuthorizationModule;
21
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)[];
22
+ providers: (typeof TaskAuthorizationService | typeof PolicyAuthorizationService | typeof LeadAuthorizationService | typeof ContactAuthorizationService | typeof ResourceAuthorizationFactory | typeof PermissionEvaluatorService | typeof ResourceAuthorizationService | typeof ResourceAccessFilterService | typeof DynamicFilterService | typeof PermissionCacheService | typeof AuthorizationService)[];
23
+ exports: (typeof TaskAuthorizationService | typeof PolicyAuthorizationService | typeof LeadAuthorizationService | typeof ContactAuthorizationService | typeof ResourceAuthorizationFactory | typeof PermissionEvaluatorService | typeof ResourceAuthorizationService | typeof ResourceAccessFilterService | typeof DynamicFilterService | typeof PermissionCacheService | typeof AuthorizationService)[];
24
24
  global: boolean;
25
25
  };
26
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easywork-common-lib",
3
- "version": "1.0.1310",
3
+ "version": "1.0.1314",
4
4
  "description": "Librería común de Easywork",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",