easywork-common-lib 1.0.1352 → 1.0.1353
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/sales.enum.d.ts +2 -1
- package/dist/common/enums/sales.enum.js +1 -0
- package/dist/common/enums/sales.enum.js.map +1 -1
- package/dist/entities/subscriptions/payment-history.entity.d.ts +24 -0
- package/dist/entities/subscriptions/payment-history.entity.js +124 -0
- package/dist/entities/subscriptions/payment-history.entity.js.map +1 -0
- package/dist/entities/thirdparty/wati/index.d.ts +7 -0
- package/dist/entities/thirdparty/wati/index.js +24 -0
- package/dist/entities/thirdparty/wati/index.js.map +1 -0
- package/dist/entities/thirdparty/wati/wati-chat.entity.d.ts +27 -0
- package/dist/entities/thirdparty/wati/wati-chat.entity.js +207 -0
- package/dist/entities/thirdparty/wati/wati-chat.entity.js.map +1 -0
- package/dist/entities/thirdparty/wati/wati-configuration.entity.d.ts +22 -0
- package/dist/entities/thirdparty/wati/wati-configuration.entity.js +149 -0
- package/dist/entities/thirdparty/wati/wati-configuration.entity.js.map +1 -0
- package/dist/entities/thirdparty/wati/wati-events.entity.d.ts +9 -0
- package/dist/entities/thirdparty/wati/wati-events.entity.js +63 -0
- package/dist/entities/thirdparty/wati/wati-events.entity.js.map +1 -0
- package/dist/entities/thirdparty/wati/wati-message.entity.d.ts +30 -0
- package/dist/entities/thirdparty/wati/wati-message.entity.js +280 -0
- package/dist/entities/thirdparty/wati/wati-message.entity.js.map +1 -0
- package/dist/entities/thirdparty/wati/wati-user-access-log.entity.d.ts +71 -0
- package/dist/entities/thirdparty/wati/wati-user-access-log.entity.js +216 -0
- package/dist/entities/thirdparty/wati/wati-user-access-log.entity.js.map +1 -0
- package/dist/entities/thirdparty/wati/wati-user-access.entity.d.ts +31 -0
- package/dist/entities/thirdparty/wati/wati-user-access.entity.js +193 -0
- package/dist/entities/thirdparty/wati/wati-user-access.entity.js.map +1 -0
- package/dist/entities/thirdparty/wati/wati.enum.d.ts +69 -0
- package/dist/entities/thirdparty/wati/wati.enum.js +83 -0
- package/dist/entities/thirdparty/wati/wati.enum.js.map +1 -0
- package/dist/grpc/drive/drive.proto +339 -339
- package/dist/grpc/drive/leads.proto +114 -114
- package/dist/modules/authorization/services/resource-access-filter.service.js +21 -21
- package/package.json +55 -55
|
@@ -0,0 +1,216 @@
|
|
|
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.WatiUserAccessLogAction = exports.WatiUserAccessLog = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const common_1 = require("../../../common");
|
|
15
|
+
const wati_configuration_entity_1 = require("./wati-configuration.entity");
|
|
16
|
+
const user_entity_1 = require("../../user.entity");
|
|
17
|
+
const group_entity_1 = require("../../group.entity");
|
|
18
|
+
let WatiUserAccessLog = class WatiUserAccessLog extends common_1.EntityBase {
|
|
19
|
+
groupId;
|
|
20
|
+
group;
|
|
21
|
+
watiUserAccessId;
|
|
22
|
+
watiConfigurationId;
|
|
23
|
+
watiConfiguration;
|
|
24
|
+
targetUserId;
|
|
25
|
+
targetUser;
|
|
26
|
+
actionByUserId;
|
|
27
|
+
actionByUser;
|
|
28
|
+
action;
|
|
29
|
+
previousData;
|
|
30
|
+
newData;
|
|
31
|
+
metadata;
|
|
32
|
+
description;
|
|
33
|
+
result;
|
|
34
|
+
errorMessage;
|
|
35
|
+
static createAccessCreatedLog(groupId, watiUserAccessId, watiConfigurationId, targetUserId, actionByUserId, newData) {
|
|
36
|
+
return {
|
|
37
|
+
groupId,
|
|
38
|
+
watiUserAccessId,
|
|
39
|
+
watiConfigurationId,
|
|
40
|
+
targetUserId,
|
|
41
|
+
actionByUserId,
|
|
42
|
+
action: WatiUserAccessLogAction.ACCESS_CREATED,
|
|
43
|
+
newData,
|
|
44
|
+
description: `Acceso WATI creado para usuario ${targetUserId}`,
|
|
45
|
+
result: "SUCCESS",
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
static createUserTypeChangedLog(groupId, watiUserAccessId, watiConfigurationId, targetUserId, actionByUserId, previousUserType, newUserType) {
|
|
49
|
+
return {
|
|
50
|
+
groupId,
|
|
51
|
+
watiUserAccessId,
|
|
52
|
+
watiConfigurationId,
|
|
53
|
+
targetUserId,
|
|
54
|
+
actionByUserId,
|
|
55
|
+
action: WatiUserAccessLogAction.ROLE_CHANGED,
|
|
56
|
+
previousData: { userType: previousUserType },
|
|
57
|
+
newData: { userType: newUserType },
|
|
58
|
+
description: `Tipo de usuario cambiado de ${previousUserType} a ${newUserType}`,
|
|
59
|
+
result: "SUCCESS",
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
static createMessageSentLog(groupId, watiUserAccessId, watiConfigurationId, targetUserId, messageType, messageCount = 1) {
|
|
63
|
+
return {
|
|
64
|
+
groupId,
|
|
65
|
+
watiUserAccessId,
|
|
66
|
+
watiConfigurationId,
|
|
67
|
+
targetUserId,
|
|
68
|
+
action: WatiUserAccessLogAction.MESSAGE_SENT,
|
|
69
|
+
metadata: { messageType, messageCount },
|
|
70
|
+
description: `Mensaje ${messageType} enviado`,
|
|
71
|
+
result: "SUCCESS",
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
static createLimitExceededLog(groupId, watiUserAccessId, watiConfigurationId, targetUserId, limitType, currentUsage, limit) {
|
|
75
|
+
return {
|
|
76
|
+
groupId,
|
|
77
|
+
watiUserAccessId,
|
|
78
|
+
watiConfigurationId,
|
|
79
|
+
targetUserId,
|
|
80
|
+
action: WatiUserAccessLogAction.LIMIT_EXCEEDED,
|
|
81
|
+
metadata: { limitType, currentUsage, limit },
|
|
82
|
+
description: `Límite excedido: ${limitType} (${currentUsage}/${limit})`,
|
|
83
|
+
result: "FAILED",
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
exports.WatiUserAccessLog = WatiUserAccessLog;
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, typeorm_1.Column)({ type: "uuid", comment: "ID del grupo (tenant) - CRÍTICO para multitenancy" }),
|
|
90
|
+
(0, typeorm_1.Index)(),
|
|
91
|
+
__metadata("design:type", String)
|
|
92
|
+
], WatiUserAccessLog.prototype, "groupId", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
(0, typeorm_1.ManyToOne)(() => group_entity_1.Group, { onDelete: "CASCADE" }),
|
|
95
|
+
(0, typeorm_1.JoinColumn)({ name: "groupId" }),
|
|
96
|
+
__metadata("design:type", group_entity_1.Group)
|
|
97
|
+
], WatiUserAccessLog.prototype, "group", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, typeorm_1.Column)({ type: "uuid", comment: "ID del registro de acceso de usuario afectado" }),
|
|
100
|
+
__metadata("design:type", String)
|
|
101
|
+
], WatiUserAccessLog.prototype, "watiUserAccessId", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
(0, typeorm_1.Column)({ type: "uuid", comment: "ID de la configuración WATI" }),
|
|
104
|
+
(0, typeorm_1.Index)(),
|
|
105
|
+
__metadata("design:type", String)
|
|
106
|
+
], WatiUserAccessLog.prototype, "watiConfigurationId", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
(0, typeorm_1.ManyToOne)(() => wati_configuration_entity_1.WatiConfiguration, { onDelete: "CASCADE" }),
|
|
109
|
+
(0, typeorm_1.JoinColumn)({ name: "watiConfigurationId" }),
|
|
110
|
+
__metadata("design:type", wati_configuration_entity_1.WatiConfiguration)
|
|
111
|
+
], WatiUserAccessLog.prototype, "watiConfiguration", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
(0, typeorm_1.Column)({ type: "uuid", comment: "ID del usuario objetivo (sobre quien se hace la acción)" }),
|
|
114
|
+
(0, typeorm_1.Index)(),
|
|
115
|
+
__metadata("design:type", String)
|
|
116
|
+
], WatiUserAccessLog.prototype, "targetUserId", void 0);
|
|
117
|
+
__decorate([
|
|
118
|
+
(0, typeorm_1.ManyToOne)(() => user_entity_1.User, { onDelete: "CASCADE" }),
|
|
119
|
+
(0, typeorm_1.JoinColumn)({ name: "targetUserId" }),
|
|
120
|
+
__metadata("design:type", user_entity_1.User)
|
|
121
|
+
], WatiUserAccessLog.prototype, "targetUser", void 0);
|
|
122
|
+
__decorate([
|
|
123
|
+
(0, typeorm_1.Column)({ type: "uuid", nullable: true, comment: "ID del usuario que ejecuta la acción" }),
|
|
124
|
+
__metadata("design:type", String)
|
|
125
|
+
], WatiUserAccessLog.prototype, "actionByUserId", void 0);
|
|
126
|
+
__decorate([
|
|
127
|
+
(0, typeorm_1.ManyToOne)(() => user_entity_1.User, { onDelete: "SET NULL", nullable: true }),
|
|
128
|
+
(0, typeorm_1.JoinColumn)({ name: "actionByUserId" }),
|
|
129
|
+
__metadata("design:type", user_entity_1.User)
|
|
130
|
+
], WatiUserAccessLog.prototype, "actionByUser", void 0);
|
|
131
|
+
__decorate([
|
|
132
|
+
(0, typeorm_1.Column)({
|
|
133
|
+
type: "varchar",
|
|
134
|
+
length: 100,
|
|
135
|
+
comment: "Tipo de acción realizada",
|
|
136
|
+
}),
|
|
137
|
+
__metadata("design:type", String)
|
|
138
|
+
], WatiUserAccessLog.prototype, "action", void 0);
|
|
139
|
+
__decorate([
|
|
140
|
+
(0, typeorm_1.Column)({
|
|
141
|
+
type: "jsonb",
|
|
142
|
+
nullable: true,
|
|
143
|
+
comment: "Datos anteriores (para cambios de configuración)",
|
|
144
|
+
}),
|
|
145
|
+
__metadata("design:type", Object)
|
|
146
|
+
], WatiUserAccessLog.prototype, "previousData", void 0);
|
|
147
|
+
__decorate([
|
|
148
|
+
(0, typeorm_1.Column)({
|
|
149
|
+
type: "jsonb",
|
|
150
|
+
nullable: true,
|
|
151
|
+
comment: "Datos nuevos (para cambios de configuración)",
|
|
152
|
+
}),
|
|
153
|
+
__metadata("design:type", Object)
|
|
154
|
+
], WatiUserAccessLog.prototype, "newData", void 0);
|
|
155
|
+
__decorate([
|
|
156
|
+
(0, typeorm_1.Column)({
|
|
157
|
+
type: "jsonb",
|
|
158
|
+
nullable: true,
|
|
159
|
+
comment: "Metadatos adicionales de la acción",
|
|
160
|
+
}),
|
|
161
|
+
__metadata("design:type", Object)
|
|
162
|
+
], WatiUserAccessLog.prototype, "metadata", void 0);
|
|
163
|
+
__decorate([
|
|
164
|
+
(0, typeorm_1.Column)({
|
|
165
|
+
type: "text",
|
|
166
|
+
nullable: true,
|
|
167
|
+
comment: "Descripción detallada de la acción",
|
|
168
|
+
}),
|
|
169
|
+
__metadata("design:type", String)
|
|
170
|
+
], WatiUserAccessLog.prototype, "description", void 0);
|
|
171
|
+
__decorate([
|
|
172
|
+
(0, typeorm_1.Column)({
|
|
173
|
+
type: "varchar",
|
|
174
|
+
length: 50,
|
|
175
|
+
default: "SUCCESS",
|
|
176
|
+
comment: "Resultado de la acción",
|
|
177
|
+
}),
|
|
178
|
+
__metadata("design:type", String)
|
|
179
|
+
], WatiUserAccessLog.prototype, "result", void 0);
|
|
180
|
+
__decorate([
|
|
181
|
+
(0, typeorm_1.Column)({
|
|
182
|
+
type: "text",
|
|
183
|
+
nullable: true,
|
|
184
|
+
comment: "Mensaje de error si la acción falló",
|
|
185
|
+
}),
|
|
186
|
+
__metadata("design:type", String)
|
|
187
|
+
], WatiUserAccessLog.prototype, "errorMessage", void 0);
|
|
188
|
+
exports.WatiUserAccessLog = WatiUserAccessLog = __decorate([
|
|
189
|
+
(0, typeorm_1.Entity)("wati_user_access_logs"),
|
|
190
|
+
(0, typeorm_1.Index)(["groupId", "watiConfigurationId"])
|
|
191
|
+
], WatiUserAccessLog);
|
|
192
|
+
var WatiUserAccessLogAction;
|
|
193
|
+
(function (WatiUserAccessLogAction) {
|
|
194
|
+
WatiUserAccessLogAction["ACCESS_CREATED"] = "ACCESS_CREATED";
|
|
195
|
+
WatiUserAccessLogAction["ACCESS_UPDATED"] = "ACCESS_UPDATED";
|
|
196
|
+
WatiUserAccessLogAction["ACCESS_DELETED"] = "ACCESS_DELETED";
|
|
197
|
+
WatiUserAccessLogAction["ACCESS_SUSPENDED"] = "ACCESS_SUSPENDED";
|
|
198
|
+
WatiUserAccessLogAction["ACCESS_REACTIVATED"] = "ACCESS_REACTIVATED";
|
|
199
|
+
WatiUserAccessLogAction["ROLE_CHANGED"] = "ROLE_CHANGED";
|
|
200
|
+
WatiUserAccessLogAction["PERMISSIONS_UPDATED"] = "PERMISSIONS_UPDATED";
|
|
201
|
+
WatiUserAccessLogAction["LIMITS_UPDATED"] = "LIMITS_UPDATED";
|
|
202
|
+
WatiUserAccessLogAction["MESSAGE_SENT"] = "MESSAGE_SENT";
|
|
203
|
+
WatiUserAccessLogAction["MESSAGE_FAILED"] = "MESSAGE_FAILED";
|
|
204
|
+
WatiUserAccessLogAction["SESSION_STARTED"] = "SESSION_STARTED";
|
|
205
|
+
WatiUserAccessLogAction["SESSION_ENDED"] = "SESSION_ENDED";
|
|
206
|
+
WatiUserAccessLogAction["LIMIT_EXCEEDED"] = "LIMIT_EXCEEDED";
|
|
207
|
+
WatiUserAccessLogAction["LIMIT_WARNING"] = "LIMIT_WARNING";
|
|
208
|
+
WatiUserAccessLogAction["USAGE_RESET"] = "USAGE_RESET";
|
|
209
|
+
WatiUserAccessLogAction["CONFIGURATION_ACCESSED"] = "CONFIGURATION_ACCESSED";
|
|
210
|
+
WatiUserAccessLogAction["REPORT_GENERATED"] = "REPORT_GENERATED";
|
|
211
|
+
WatiUserAccessLogAction["BULK_ACTION_PERFORMED"] = "BULK_ACTION_PERFORMED";
|
|
212
|
+
WatiUserAccessLogAction["UNAUTHORIZED_ACCESS_ATTEMPT"] = "UNAUTHORIZED_ACCESS_ATTEMPT";
|
|
213
|
+
WatiUserAccessLogAction["LOGIN_SUCCESS"] = "LOGIN_SUCCESS";
|
|
214
|
+
WatiUserAccessLogAction["LOGIN_FAILED"] = "LOGIN_FAILED";
|
|
215
|
+
})(WatiUserAccessLogAction || (exports.WatiUserAccessLogAction = WatiUserAccessLogAction = {}));
|
|
216
|
+
//# sourceMappingURL=wati-user-access-log.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wati-user-access-log.entity.js","sourceRoot":"","sources":["../../../../src/entities/thirdparty/wati/wati-user-access-log.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAuE;AACvE,4CAA6C;AAE7C,2EAAgE;AAChE,mDAAyC;AACzC,qDAA2C;AASpC,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,mBAAU;IAG/C,OAAO,CAAS;IAIhB,KAAK,CAAQ;IAGb,gBAAgB,CAAS;IAIzB,mBAAmB,CAAS;IAI5B,iBAAiB,CAAoB;IAIrC,YAAY,CAAS;IAIrB,UAAU,CAAO;IAGjB,cAAc,CAAU;IAIxB,YAAY,CAAQ;IAOpB,MAAM,CAA0B;IAOhC,YAAY,CAMV;IAOF,OAAO,CAML;IAOF,QAAQ,CASN;IAOF,WAAW,CAAU;IAQrB,MAAM,CAAmC;IAOzC,YAAY,CAAU;IAOtB,MAAM,CAAC,sBAAsB,CAC3B,OAAe,EACf,gBAAwB,EACxB,mBAA2B,EAC3B,YAAoB,EACpB,cAAsB,EACtB,OAAY;QAEZ,OAAO;YACL,OA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,iBAAiB;IAF7B,IAAA,gBAAM,EAAC,uBAAuB,CAAC;IAC/B,IAAA,eAAK,EAAC,CAAC,SAAS,EAAE,qBAAqB,CAAC,CAAC;GAC7B,iBAAiB,CA4M7B;AAKD,IAAY,uBAiCX;AAjCD,WAAY,uBAAuB;IAEjC,4DAAiC,CAAA;IACjC,4DAAiC,CAAA;IACjC,4DAAiC,CAAA;IACjC,gEAAqC,CAAA;IACrC,oEAAyC,CAAA;IAGzC,wDAA6B,CAAA;IAC7B,sEAA2C,CAAA;IAC3C,4DAAiC,CAAA;IAGjC,wDAA6B,CAAA;IAC7B,4DAAiC,CAAA;IACjC,8DAAmC,CAAA;IACnC,0DAA+B,CAAA;IAG/B,4DAAiC,CAAA;IACjC,0DAA+B,CAAA;IAC/B,sDAA2B,CAAA;IAG3B,4EAAiD,CAAA;IACjD,gEAAqC,CAAA;IACrC,0EAA+C,CAAA;IAG/C,sFAA2D,CAAA;IAC3D,0DAA+B,CAAA;IAC/B,wDAA6B,CAAA;AAC/B,CAAC,EAjCW,uBAAuB,uCAAvB,uBAAuB,QAiClC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { EntityBase } from "../../../common";
|
|
2
|
+
import { WatiUserType, WatiUserAccessStatus } from "./wati.enum";
|
|
3
|
+
import { WatiConfiguration } from "./wati-configuration.entity";
|
|
4
|
+
import { User } from "../../user.entity";
|
|
5
|
+
import { Group } from "../../group.entity";
|
|
6
|
+
export declare class WatiUserAccess extends EntityBase {
|
|
7
|
+
groupId: string;
|
|
8
|
+
group: Group;
|
|
9
|
+
watiConfigurationId: string;
|
|
10
|
+
watiConfiguration: WatiConfiguration;
|
|
11
|
+
userId: string;
|
|
12
|
+
user: User;
|
|
13
|
+
userType: WatiUserType;
|
|
14
|
+
status: WatiUserAccessStatus;
|
|
15
|
+
watiUserId?: string;
|
|
16
|
+
watiUserEmail?: string;
|
|
17
|
+
currentMonthSessionMessages: number;
|
|
18
|
+
currentMonthTemplateMessages: number;
|
|
19
|
+
lastAccessAt?: Date;
|
|
20
|
+
lastMessageSentAt?: Date;
|
|
21
|
+
receiveNotifications: boolean;
|
|
22
|
+
createdByUserId?: string;
|
|
23
|
+
notes?: string;
|
|
24
|
+
countsAgainstWatiLimit(): boolean;
|
|
25
|
+
canSendMessages(): boolean;
|
|
26
|
+
canViewConversations(): boolean;
|
|
27
|
+
canBeAssigned(): boolean;
|
|
28
|
+
incrementMessageCounter(type: "session" | "template"): void;
|
|
29
|
+
updateLastAccess(): void;
|
|
30
|
+
resetMonthlyCounters(): void;
|
|
31
|
+
}
|
|
@@ -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,gCA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,EAAE,SAAS;QACf,OAAO,EAAE,CAAC;QACV,OAAO,EAAE,iDAAiD;KAC3D,CAAC;;oEACmC;AAOrC;IALC,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,WAAW;QACjB,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,mDAAmD;KAC7D,CAAC;8BACa,IAAI;oDAAC;AAOpB;IALC,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,WAAW;QACjB,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,wCA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