easywork-common-lib 1.0.1343 → 1.0.1344
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/entities/sales/agent.entity.d.ts +1 -1
- package/dist/entities/sales/agent.entity.js +2 -2
- package/dist/entities/sales/agent.entity.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,149 @@
|
|
|
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.WatiConfiguration = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
15
|
+
const class_validator_1 = require("class-validator");
|
|
16
|
+
const group_entity_1 = require("../../group.entity");
|
|
17
|
+
const common_1 = require("../../../common");
|
|
18
|
+
const wati_chat_entity_1 = require("./wati-chat.entity");
|
|
19
|
+
const wati_enum_1 = require("./wati.enum");
|
|
20
|
+
let WatiConfiguration = class WatiConfiguration extends common_1.EntityBase {
|
|
21
|
+
baseWebhookUrl;
|
|
22
|
+
generatedWebhookSecret;
|
|
23
|
+
apiEndpoint;
|
|
24
|
+
apiToken;
|
|
25
|
+
watiClientID;
|
|
26
|
+
associatedPhoneNumber;
|
|
27
|
+
status;
|
|
28
|
+
lastErrorDetails;
|
|
29
|
+
lastSuccessfulConnectionAt;
|
|
30
|
+
groupId;
|
|
31
|
+
group;
|
|
32
|
+
watiSubscription;
|
|
33
|
+
chats;
|
|
34
|
+
};
|
|
35
|
+
exports.WatiConfiguration = WatiConfiguration;
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, swagger_1.ApiProperty)({
|
|
38
|
+
description: "URL base del endpoint de webhooks de Easywork para esta integración. La URL completa se construye con identificadores y el secreto.",
|
|
39
|
+
}),
|
|
40
|
+
(0, class_validator_1.IsUrl)(),
|
|
41
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 512 }),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], WatiConfiguration.prototype, "baseWebhookUrl", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, swagger_1.ApiProperty)({
|
|
46
|
+
description: "Secreto generado por Easywork para validar los webhooks de Wati. Este secreto se añade a la URL que el usuario configura en Wati.",
|
|
47
|
+
}),
|
|
48
|
+
(0, class_validator_1.IsString)(),
|
|
49
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 255, select: false }),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], WatiConfiguration.prototype, "generatedWebhookSecret", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, swagger_1.ApiProperty)({ description: "URL base de la API de Wati" }),
|
|
54
|
+
(0, class_validator_1.IsUrl)(),
|
|
55
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 255 }),
|
|
56
|
+
__metadata("design:type", String)
|
|
57
|
+
], WatiConfiguration.prototype, "apiEndpoint", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, swagger_1.ApiProperty)({ description: "Token de acceso para la API de Wati" }),
|
|
60
|
+
(0, class_validator_1.IsString)(),
|
|
61
|
+
(0, typeorm_1.Column)({ type: "text", select: false }),
|
|
62
|
+
__metadata("design:type", String)
|
|
63
|
+
], WatiConfiguration.prototype, "apiToken", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, swagger_1.ApiProperty)({
|
|
66
|
+
description: "ID de cliente de Wati, identificador único de la cuenta de Wati",
|
|
67
|
+
example: "513892",
|
|
68
|
+
}),
|
|
69
|
+
(0, class_validator_1.IsString)(),
|
|
70
|
+
(0, typeorm_1.Index)(),
|
|
71
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 255 }),
|
|
72
|
+
__metadata("design:type", String)
|
|
73
|
+
], WatiConfiguration.prototype, "watiClientID", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, swagger_1.ApiProperty)({
|
|
76
|
+
description: "Número de WhatsApp asociado a esta configuración de Wati",
|
|
77
|
+
}),
|
|
78
|
+
(0, class_validator_1.IsString)(),
|
|
79
|
+
(0, typeorm_1.Index)(),
|
|
80
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 50 }),
|
|
81
|
+
__metadata("design:type", String)
|
|
82
|
+
], WatiConfiguration.prototype, "associatedPhoneNumber", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, swagger_1.ApiProperty)({
|
|
85
|
+
enum: wati_enum_1.WatiIntegrationStatusEnum,
|
|
86
|
+
description: "Estado actual de la integración con Wati",
|
|
87
|
+
default: wati_enum_1.WatiIntegrationStatusEnum.PENDING_SETUP,
|
|
88
|
+
}),
|
|
89
|
+
(0, class_validator_1.IsEnum)(wati_enum_1.WatiIntegrationStatusEnum),
|
|
90
|
+
(0, typeorm_1.Column)({
|
|
91
|
+
type: "enum",
|
|
92
|
+
enum: wati_enum_1.WatiIntegrationStatusEnum,
|
|
93
|
+
default: wati_enum_1.WatiIntegrationStatusEnum.PENDING_SETUP,
|
|
94
|
+
}),
|
|
95
|
+
__metadata("design:type", String)
|
|
96
|
+
], WatiConfiguration.prototype, "status", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
(0, swagger_1.ApiProperty)({
|
|
99
|
+
description: "Detalles del último error de configuración/conexión",
|
|
100
|
+
required: false,
|
|
101
|
+
}),
|
|
102
|
+
(0, class_validator_1.IsString)(),
|
|
103
|
+
(0, class_validator_1.IsOptional)(),
|
|
104
|
+
(0, typeorm_1.Column)({ type: "text", nullable: true }),
|
|
105
|
+
__metadata("design:type", String)
|
|
106
|
+
], WatiConfiguration.prototype, "lastErrorDetails", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
(0, swagger_1.ApiProperty)({
|
|
109
|
+
description: "Fecha del último intento de conexión exitoso",
|
|
110
|
+
required: false,
|
|
111
|
+
}),
|
|
112
|
+
(0, class_validator_1.IsDate)(),
|
|
113
|
+
(0, class_validator_1.IsOptional)(),
|
|
114
|
+
(0, typeorm_1.Column)({ type: "timestamp with time zone", nullable: true }),
|
|
115
|
+
__metadata("design:type", Date)
|
|
116
|
+
], WatiConfiguration.prototype, "lastSuccessfulConnectionAt", void 0);
|
|
117
|
+
__decorate([
|
|
118
|
+
(0, swagger_1.ApiProperty)({
|
|
119
|
+
description: "ID del Group (tenant) al que pertenece esta configuración",
|
|
120
|
+
}),
|
|
121
|
+
(0, class_validator_1.IsString)(),
|
|
122
|
+
(0, typeorm_1.Index)(),
|
|
123
|
+
(0, typeorm_1.Column)({ type: "uuid", unique: true }),
|
|
124
|
+
__metadata("design:type", String)
|
|
125
|
+
], WatiConfiguration.prototype, "groupId", void 0);
|
|
126
|
+
__decorate([
|
|
127
|
+
(0, typeorm_1.ManyToOne)(() => group_entity_1.Group, { onDelete: "CASCADE" }),
|
|
128
|
+
(0, typeorm_1.JoinColumn)({ name: "groupId" }),
|
|
129
|
+
__metadata("design:type", group_entity_1.Group)
|
|
130
|
+
], WatiConfiguration.prototype, "group", void 0);
|
|
131
|
+
__decorate([
|
|
132
|
+
(0, swagger_1.ApiProperty)({
|
|
133
|
+
description: "Información de la suscripción de Wati",
|
|
134
|
+
type: "object",
|
|
135
|
+
required: false,
|
|
136
|
+
}),
|
|
137
|
+
(0, class_validator_1.IsJSON)(),
|
|
138
|
+
(0, class_validator_1.IsOptional)(),
|
|
139
|
+
(0, typeorm_1.Column)({ type: "jsonb", nullable: true }),
|
|
140
|
+
__metadata("design:type", Object)
|
|
141
|
+
], WatiConfiguration.prototype, "watiSubscription", void 0);
|
|
142
|
+
__decorate([
|
|
143
|
+
(0, typeorm_1.OneToMany)(() => wati_chat_entity_1.WatiChat, (chat) => chat.watiConfiguration),
|
|
144
|
+
__metadata("design:type", Array)
|
|
145
|
+
], WatiConfiguration.prototype, "chats", void 0);
|
|
146
|
+
exports.WatiConfiguration = WatiConfiguration = __decorate([
|
|
147
|
+
(0, typeorm_1.Entity)("wati_configurations")
|
|
148
|
+
], WatiConfiguration);
|
|
149
|
+
//# sourceMappingURL=wati-configuration.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wati-configuration.entity.js","sourceRoot":"","sources":["../../../../src/entities/thirdparty/wati/wati-configuration.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAkF;AAClF,6CAA8C;AAC9C,qDAAsF;AACtF,qDAA2C;AAC3C,4CAA6C;AAC7C,yDAA8C;AAC9C,2CAAsE;AAG/D,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,mBAAU;IAO/C,cAAc,CAAS;IAQvB,sBAAsB,CAAS;IAK/B,WAAW,CAAS;IAKpB,QAAQ,CAAS;IASjB,YAAY,CAAS;IAQrB,qBAAqB,CAAS;IAa9B,MAAM,CAA4B;IASlC,gBAAgB,CAAU;IAS1B,0BAA0B,CAAQ;IAQlC,OAAO,CAAS;IAIhB,KAAK,CAAQ;IAUb,gBAAgB,CAGd;IAGF,KAAK,CAAa;CACnB,CAAA;AAtGY,8CAAiB;AAO5B;IANC,IAAA,qBAAW,EAAC;QACX,WAAW,EACT,qIAAqI;KACxI,CAAC;IACD,IAAA,uBAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,CA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Q,EAAE,IAAI,EAAE,CAAC;;2DAIxC;AAGF;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,2BAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC;;gDAC1C;4BArGP,iBAAiB;IAD7B,IAAA,gBAAM,EAAC,qBAAqB,CAAC;GACjB,iBAAiB,CAsG7B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseEntityOnlyEssential } from "../../../common";
|
|
2
|
+
import { WatiEventType } from "./wati.enum";
|
|
3
|
+
import { WatiConfiguration } from "./wati-configuration.entity";
|
|
4
|
+
export declare class WatiEvents extends BaseEntityOnlyEssential {
|
|
5
|
+
watiConfigurationId: string;
|
|
6
|
+
watiConfiguration: WatiConfiguration;
|
|
7
|
+
watiEventType: WatiEventType;
|
|
8
|
+
rawPayload?: object;
|
|
9
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
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.WatiEvents = void 0;
|
|
13
|
+
const common_1 = require("../../../common");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const wati_enum_1 = require("./wati.enum");
|
|
16
|
+
const typeorm_1 = require("typeorm");
|
|
17
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
18
|
+
const wati_configuration_entity_1 = require("./wati-configuration.entity");
|
|
19
|
+
let WatiEvents = class WatiEvents extends common_1.BaseEntityOnlyEssential {
|
|
20
|
+
watiConfigurationId;
|
|
21
|
+
watiConfiguration;
|
|
22
|
+
watiEventType;
|
|
23
|
+
rawPayload;
|
|
24
|
+
};
|
|
25
|
+
exports.WatiEvents = WatiEvents;
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, swagger_1.ApiProperty)({
|
|
28
|
+
description: "ID de la WatiConfiguration que originó este evento",
|
|
29
|
+
}),
|
|
30
|
+
(0, class_validator_1.IsString)(),
|
|
31
|
+
(0, typeorm_1.Index)(),
|
|
32
|
+
(0, typeorm_1.Column)({ type: "uuid" }),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], WatiEvents.prototype, "watiConfigurationId", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.ManyToOne)(() => wati_configuration_entity_1.WatiConfiguration, { onDelete: "CASCADE" }),
|
|
37
|
+
(0, typeorm_1.JoinColumn)({ name: "watiConfigurationId" }),
|
|
38
|
+
__metadata("design:type", wati_configuration_entity_1.WatiConfiguration)
|
|
39
|
+
], WatiEvents.prototype, "watiConfiguration", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, swagger_1.ApiProperty)({
|
|
42
|
+
enum: wati_enum_1.WatiEventType,
|
|
43
|
+
description: "Tipo de evento de Wati",
|
|
44
|
+
}),
|
|
45
|
+
(0, class_validator_1.IsEnum)(wati_enum_1.WatiEventType),
|
|
46
|
+
(0, typeorm_1.Column)({ type: "enum", enum: wati_enum_1.WatiEventType, nullable: false }),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], WatiEvents.prototype, "watiEventType", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, swagger_1.ApiProperty)({
|
|
51
|
+
description: "Payload crudo del evento de Wati",
|
|
52
|
+
type: "object",
|
|
53
|
+
required: false,
|
|
54
|
+
}),
|
|
55
|
+
(0, class_validator_1.IsJSON)(),
|
|
56
|
+
(0, class_validator_1.IsOptional)(),
|
|
57
|
+
(0, typeorm_1.Column)({ type: "jsonb", nullable: true, select: false }),
|
|
58
|
+
__metadata("design:type", Object)
|
|
59
|
+
], WatiEvents.prototype, "rawPayload", void 0);
|
|
60
|
+
exports.WatiEvents = WatiEvents = __decorate([
|
|
61
|
+
(0, typeorm_1.Entity)("wati_events")
|
|
62
|
+
], WatiEvents);
|
|
63
|
+
//# sourceMappingURL=wati-events.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wati-events.entity.js","sourceRoot":"","sources":["../../../../src/entities/thirdparty/wati/wati-events.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAA0D;AAC1D,qDAAuE;AACvE,2CAA4C;AAC5C,qCAAuE;AACvE,6CAA8C;AAC9C,2EAAgE;AAGzD,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,gCAAuB;IAOrD,mBAAmB,CAAS;IAI5B,iBAAiB,CAAoB;IAQrC,aAAa,CAAgB;IAU7B,UAAU,CAAU;CACrB,CAAA;AA9BY,gCAAU;AAOrB;IANC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,oDAAoD;KAClE,CAAC;IACD,IAAA,0BAAQ,GAAE;IACV,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;uDACG;AAI5B;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,6CAAiB,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IAC3D,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,qBAAqB,EAAE,CAAC;8BACzB,6CAAiB;qDAAC;AAQrC;IANC,IAAA,qBAAW,EAAC;QACX,IAAI,EAAE,yBAAa;QACnB,WAAW,EAAE,wBAAwB;KACtC,CAAC;IACD,IAAA,wBAAM,EAAC,yBAAa,CAAC;IACrB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,yBAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;iDAClC;AAU7B;IARC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,kCAAkC;QAC/C,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,KAAK;KAChB,CAAC;IACD,IAAA,wBAAM,GAAE;IACR,IAAA,4BAAU,GAAE;IACZ,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;;8CACrC;qBA7BT,UAAU;IADtB,IAAA,gBAAM,EAAC,aAAa,CAAC;GACT,UAAU,CA8BtB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { WatiChat } from "./wati-chat.entity";
|
|
2
|
+
import { User } from "../../user.entity";
|
|
3
|
+
import { WatiMessageDirection, WatiMessageType, WatiMessageStatus, WatiEventType } from "./wati.enum";
|
|
4
|
+
import { BaseEntitySimple } from "../../../common";
|
|
5
|
+
export declare class WatiMessage extends BaseEntitySimple {
|
|
6
|
+
watiChatId: string;
|
|
7
|
+
watiChat: WatiChat;
|
|
8
|
+
watiMessageId?: string;
|
|
9
|
+
watiTicketId?: string;
|
|
10
|
+
whatsappMessageId?: string;
|
|
11
|
+
watiConversationId?: string;
|
|
12
|
+
watiTemplateId?: string;
|
|
13
|
+
waId?: string;
|
|
14
|
+
senderName?: string;
|
|
15
|
+
content: string;
|
|
16
|
+
messageType: WatiMessageType;
|
|
17
|
+
direction: WatiMessageDirection;
|
|
18
|
+
channelMessageTimestamp: Date;
|
|
19
|
+
watiTimestamp?: number;
|
|
20
|
+
watiEventType?: WatiEventType;
|
|
21
|
+
watiMessageTemplateName?: string;
|
|
22
|
+
templateParametersUsed?: object;
|
|
23
|
+
messageData?: object;
|
|
24
|
+
sourceType?: string;
|
|
25
|
+
status: WatiMessageStatus;
|
|
26
|
+
deliveredAt?: Date;
|
|
27
|
+
readAt?: Date;
|
|
28
|
+
sentByCrmUserId?: string;
|
|
29
|
+
sentByCrmUser?: User;
|
|
30
|
+
}
|
|
@@ -0,0 +1,280 @@
|
|
|
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.WatiMessage = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
15
|
+
const class_validator_1 = require("class-validator");
|
|
16
|
+
const wati_chat_entity_1 = require("./wati-chat.entity");
|
|
17
|
+
const user_entity_1 = require("../../user.entity");
|
|
18
|
+
const wati_enum_1 = require("./wati.enum");
|
|
19
|
+
const common_1 = require("../../../common");
|
|
20
|
+
let WatiMessage = class WatiMessage extends common_1.BaseEntitySimple {
|
|
21
|
+
watiChatId;
|
|
22
|
+
watiChat;
|
|
23
|
+
watiMessageId;
|
|
24
|
+
watiTicketId;
|
|
25
|
+
whatsappMessageId;
|
|
26
|
+
watiConversationId;
|
|
27
|
+
watiTemplateId;
|
|
28
|
+
waId;
|
|
29
|
+
senderName;
|
|
30
|
+
content;
|
|
31
|
+
messageType;
|
|
32
|
+
direction;
|
|
33
|
+
channelMessageTimestamp;
|
|
34
|
+
watiTimestamp;
|
|
35
|
+
watiEventType;
|
|
36
|
+
watiMessageTemplateName;
|
|
37
|
+
templateParametersUsed;
|
|
38
|
+
messageData;
|
|
39
|
+
sourceType;
|
|
40
|
+
status;
|
|
41
|
+
deliveredAt;
|
|
42
|
+
readAt;
|
|
43
|
+
sentByCrmUserId;
|
|
44
|
+
sentByCrmUser;
|
|
45
|
+
};
|
|
46
|
+
exports.WatiMessage = WatiMessage;
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, swagger_1.ApiProperty)({ description: "ID del WatiChat al que pertenece este mensaje" }),
|
|
49
|
+
(0, class_validator_1.IsString)(),
|
|
50
|
+
(0, typeorm_1.Index)(),
|
|
51
|
+
(0, typeorm_1.Column)({ type: "uuid" }),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], WatiMessage.prototype, "watiChatId", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, typeorm_1.ManyToOne)(() => wati_chat_entity_1.WatiChat, (chat) => chat.messages, { onDelete: "CASCADE" }),
|
|
56
|
+
(0, typeorm_1.JoinColumn)({ name: "watiChatId" }),
|
|
57
|
+
__metadata("design:type", wati_chat_entity_1.WatiChat)
|
|
58
|
+
], WatiMessage.prototype, "watiChat", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, swagger_1.ApiProperty)({
|
|
61
|
+
description: "ID único del mensaje proporcionado por Wati (puede ser el mismo que whatsappMessageId)",
|
|
62
|
+
required: false,
|
|
63
|
+
}),
|
|
64
|
+
(0, class_validator_1.IsString)(),
|
|
65
|
+
(0, class_validator_1.IsOptional)(),
|
|
66
|
+
(0, class_validator_1.MaxLength)(255),
|
|
67
|
+
(0, typeorm_1.Index)(),
|
|
68
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: true }),
|
|
69
|
+
__metadata("design:type", String)
|
|
70
|
+
], WatiMessage.prototype, "watiMessageId", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, swagger_1.ApiProperty)({
|
|
73
|
+
description: "ID del ticket en Wati, si aplica",
|
|
74
|
+
required: false,
|
|
75
|
+
}),
|
|
76
|
+
(0, class_validator_1.IsString)(),
|
|
77
|
+
(0, class_validator_1.IsOptional)(),
|
|
78
|
+
(0, class_validator_1.MaxLength)(100),
|
|
79
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 100, nullable: true }),
|
|
80
|
+
__metadata("design:type", String)
|
|
81
|
+
], WatiMessage.prototype, "watiTicketId", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
(0, swagger_1.ApiProperty)({
|
|
84
|
+
description: "ID único del mensaje proporcionado por WhatsApp (WA_MSG_ID)",
|
|
85
|
+
required: false,
|
|
86
|
+
}),
|
|
87
|
+
(0, class_validator_1.IsString)(),
|
|
88
|
+
(0, class_validator_1.IsOptional)(),
|
|
89
|
+
(0, class_validator_1.MaxLength)(255),
|
|
90
|
+
(0, typeorm_1.Index)(),
|
|
91
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: true }),
|
|
92
|
+
__metadata("design:type", String)
|
|
93
|
+
], WatiMessage.prototype, "whatsappMessageId", void 0);
|
|
94
|
+
__decorate([
|
|
95
|
+
(0, swagger_1.ApiProperty)({
|
|
96
|
+
description: "ID de la conversación en Wati",
|
|
97
|
+
required: false,
|
|
98
|
+
}),
|
|
99
|
+
(0, class_validator_1.IsString)(),
|
|
100
|
+
(0, class_validator_1.IsOptional)(),
|
|
101
|
+
(0, class_validator_1.MaxLength)(255),
|
|
102
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: true }),
|
|
103
|
+
__metadata("design:type", String)
|
|
104
|
+
], WatiMessage.prototype, "watiConversationId", void 0);
|
|
105
|
+
__decorate([
|
|
106
|
+
(0, swagger_1.ApiProperty)({
|
|
107
|
+
description: "ID de la plantilla de Wati utilizada, si aplica",
|
|
108
|
+
required: false,
|
|
109
|
+
}),
|
|
110
|
+
(0, class_validator_1.IsString)(),
|
|
111
|
+
(0, class_validator_1.IsOptional)(),
|
|
112
|
+
(0, class_validator_1.MaxLength)(255),
|
|
113
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: true }),
|
|
114
|
+
__metadata("design:type", String)
|
|
115
|
+
], WatiMessage.prototype, "watiTemplateId", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
(0, swagger_1.ApiProperty)({
|
|
118
|
+
description: "WhatsApp ID del remitente",
|
|
119
|
+
required: false,
|
|
120
|
+
}),
|
|
121
|
+
(0, class_validator_1.IsString)(),
|
|
122
|
+
(0, class_validator_1.IsOptional)(),
|
|
123
|
+
(0, class_validator_1.MaxLength)(50),
|
|
124
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 50, nullable: true }),
|
|
125
|
+
__metadata("design:type", String)
|
|
126
|
+
], WatiMessage.prototype, "waId", void 0);
|
|
127
|
+
__decorate([
|
|
128
|
+
(0, swagger_1.ApiProperty)({
|
|
129
|
+
description: "Nombre del remitente tal como aparece en Wati",
|
|
130
|
+
required: false,
|
|
131
|
+
}),
|
|
132
|
+
(0, class_validator_1.IsString)(),
|
|
133
|
+
(0, class_validator_1.IsOptional)(),
|
|
134
|
+
(0, class_validator_1.MaxLength)(255),
|
|
135
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: true }),
|
|
136
|
+
__metadata("design:type", String)
|
|
137
|
+
], WatiMessage.prototype, "senderName", void 0);
|
|
138
|
+
__decorate([
|
|
139
|
+
(0, swagger_1.ApiProperty)({
|
|
140
|
+
description: "Contenido del mensaje (texto, URL de media para tipos no textuales)",
|
|
141
|
+
}),
|
|
142
|
+
(0, class_validator_1.IsString)(),
|
|
143
|
+
(0, typeorm_1.Column)({ type: "text" }),
|
|
144
|
+
__metadata("design:type", String)
|
|
145
|
+
], WatiMessage.prototype, "content", void 0);
|
|
146
|
+
__decorate([
|
|
147
|
+
(0, swagger_1.ApiProperty)({ enum: wati_enum_1.WatiMessageType, description: "Tipo de mensaje" }),
|
|
148
|
+
(0, class_validator_1.IsEnum)(wati_enum_1.WatiMessageType),
|
|
149
|
+
(0, typeorm_1.Column)({ type: "enum", enum: wati_enum_1.WatiMessageType }),
|
|
150
|
+
__metadata("design:type", String)
|
|
151
|
+
], WatiMessage.prototype, "messageType", void 0);
|
|
152
|
+
__decorate([
|
|
153
|
+
(0, swagger_1.ApiProperty)({
|
|
154
|
+
enum: wati_enum_1.WatiMessageDirection,
|
|
155
|
+
description: "Dirección del mensaje",
|
|
156
|
+
}),
|
|
157
|
+
(0, class_validator_1.IsEnum)(wati_enum_1.WatiMessageDirection),
|
|
158
|
+
(0, typeorm_1.Column)({ type: "enum", enum: wati_enum_1.WatiMessageDirection }),
|
|
159
|
+
__metadata("design:type", String)
|
|
160
|
+
], WatiMessage.prototype, "direction", void 0);
|
|
161
|
+
__decorate([
|
|
162
|
+
(0, swagger_1.ApiProperty)({
|
|
163
|
+
description: "Timestamp original del mensaje en WhatsApp/Wati (del webhook)",
|
|
164
|
+
}),
|
|
165
|
+
(0, class_validator_1.IsDate)(),
|
|
166
|
+
(0, typeorm_1.Column)({ type: "timestamp with time zone" }),
|
|
167
|
+
__metadata("design:type", Date)
|
|
168
|
+
], WatiMessage.prototype, "channelMessageTimestamp", void 0);
|
|
169
|
+
__decorate([
|
|
170
|
+
(0, swagger_1.ApiProperty)({
|
|
171
|
+
description: "Timestamp del mensaje en Wati (timestamp numérico)",
|
|
172
|
+
required: false,
|
|
173
|
+
}),
|
|
174
|
+
(0, class_validator_1.IsNumber)(),
|
|
175
|
+
(0, class_validator_1.IsOptional)(),
|
|
176
|
+
(0, typeorm_1.Column)({ type: "bigint", nullable: true }),
|
|
177
|
+
__metadata("design:type", Number)
|
|
178
|
+
], WatiMessage.prototype, "watiTimestamp", void 0);
|
|
179
|
+
__decorate([
|
|
180
|
+
(0, swagger_1.ApiProperty)({
|
|
181
|
+
enum: wati_enum_1.WatiEventType,
|
|
182
|
+
description: "Tipo de evento de Wati que generó/actualizó este mensaje",
|
|
183
|
+
required: false,
|
|
184
|
+
}),
|
|
185
|
+
(0, class_validator_1.IsEnum)(wati_enum_1.WatiEventType),
|
|
186
|
+
(0, class_validator_1.IsOptional)(),
|
|
187
|
+
(0, typeorm_1.Column)({ type: "enum", enum: wati_enum_1.WatiEventType, nullable: true }),
|
|
188
|
+
__metadata("design:type", String)
|
|
189
|
+
], WatiMessage.prototype, "watiEventType", void 0);
|
|
190
|
+
__decorate([
|
|
191
|
+
(0, swagger_1.ApiProperty)({
|
|
192
|
+
description: "Nombre de la plantilla de Wati usada, si aplica",
|
|
193
|
+
required: false,
|
|
194
|
+
}),
|
|
195
|
+
(0, class_validator_1.IsString)(),
|
|
196
|
+
(0, class_validator_1.IsOptional)(),
|
|
197
|
+
(0, class_validator_1.MaxLength)(255),
|
|
198
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 255, nullable: true }),
|
|
199
|
+
__metadata("design:type", String)
|
|
200
|
+
], WatiMessage.prototype, "watiMessageTemplateName", void 0);
|
|
201
|
+
__decorate([
|
|
202
|
+
(0, swagger_1.ApiProperty)({
|
|
203
|
+
description: "Parámetros JSON usados en la plantilla de mensaje, si aplica",
|
|
204
|
+
type: "object",
|
|
205
|
+
required: false,
|
|
206
|
+
}),
|
|
207
|
+
(0, class_validator_1.IsJSON)(),
|
|
208
|
+
(0, class_validator_1.IsOptional)(),
|
|
209
|
+
(0, typeorm_1.Column)({ type: "jsonb", nullable: true }),
|
|
210
|
+
__metadata("design:type", Object)
|
|
211
|
+
], WatiMessage.prototype, "templateParametersUsed", void 0);
|
|
212
|
+
__decorate([
|
|
213
|
+
(0, swagger_1.ApiProperty)({
|
|
214
|
+
description: "Datos multimedia del mensaje, si aplica",
|
|
215
|
+
type: "object",
|
|
216
|
+
required: false,
|
|
217
|
+
}),
|
|
218
|
+
(0, class_validator_1.IsJSON)(),
|
|
219
|
+
(0, class_validator_1.IsOptional)(),
|
|
220
|
+
(0, typeorm_1.Column)({ type: "jsonb", nullable: true }),
|
|
221
|
+
__metadata("design:type", Object)
|
|
222
|
+
], WatiMessage.prototype, "messageData", void 0);
|
|
223
|
+
__decorate([
|
|
224
|
+
(0, swagger_1.ApiProperty)({
|
|
225
|
+
description: "Tipo de fuente del mensaje (API, session, template, etc.)",
|
|
226
|
+
required: false,
|
|
227
|
+
}),
|
|
228
|
+
(0, class_validator_1.IsString)(),
|
|
229
|
+
(0, class_validator_1.IsOptional)(),
|
|
230
|
+
(0, class_validator_1.MaxLength)(50),
|
|
231
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 50, nullable: true }),
|
|
232
|
+
__metadata("design:type", String)
|
|
233
|
+
], WatiMessage.prototype, "sourceType", void 0);
|
|
234
|
+
__decorate([
|
|
235
|
+
(0, swagger_1.ApiProperty)({ enum: wati_enum_1.WatiMessageStatus, description: "Estado del mensaje" }),
|
|
236
|
+
(0, class_validator_1.IsEnum)(wati_enum_1.WatiMessageStatus),
|
|
237
|
+
(0, typeorm_1.Index)(),
|
|
238
|
+
(0, typeorm_1.Column)({ type: "enum", enum: wati_enum_1.WatiMessageStatus }),
|
|
239
|
+
__metadata("design:type", String)
|
|
240
|
+
], WatiMessage.prototype, "status", void 0);
|
|
241
|
+
__decorate([
|
|
242
|
+
(0, swagger_1.ApiProperty)({
|
|
243
|
+
description: "Fecha cuando el mensaje fue entregado",
|
|
244
|
+
required: false,
|
|
245
|
+
}),
|
|
246
|
+
(0, class_validator_1.IsDate)(),
|
|
247
|
+
(0, class_validator_1.IsOptional)(),
|
|
248
|
+
(0, typeorm_1.Column)({ type: "timestamp with time zone", nullable: true }),
|
|
249
|
+
__metadata("design:type", Date)
|
|
250
|
+
], WatiMessage.prototype, "deliveredAt", void 0);
|
|
251
|
+
__decorate([
|
|
252
|
+
(0, swagger_1.ApiProperty)({
|
|
253
|
+
description: "Fecha cuando el mensaje fue leído",
|
|
254
|
+
required: false,
|
|
255
|
+
}),
|
|
256
|
+
(0, class_validator_1.IsDate)(),
|
|
257
|
+
(0, class_validator_1.IsOptional)(),
|
|
258
|
+
(0, typeorm_1.Column)({ type: "timestamp with time zone", nullable: true }),
|
|
259
|
+
__metadata("design:type", Date)
|
|
260
|
+
], WatiMessage.prototype, "readAt", void 0);
|
|
261
|
+
__decorate([
|
|
262
|
+
(0, swagger_1.ApiProperty)({
|
|
263
|
+
description: "ID del User del CRM que envió el mensaje (si es outbound)",
|
|
264
|
+
required: false,
|
|
265
|
+
}),
|
|
266
|
+
(0, class_validator_1.IsString)(),
|
|
267
|
+
(0, class_validator_1.IsOptional)(),
|
|
268
|
+
(0, typeorm_1.Index)(),
|
|
269
|
+
(0, typeorm_1.Column)({ type: "uuid", nullable: true }),
|
|
270
|
+
__metadata("design:type", String)
|
|
271
|
+
], WatiMessage.prototype, "sentByCrmUserId", void 0);
|
|
272
|
+
__decorate([
|
|
273
|
+
(0, typeorm_1.ManyToOne)(() => user_entity_1.User, { onDelete: "SET NULL", nullable: true }),
|
|
274
|
+
(0, typeorm_1.JoinColumn)({ name: "sentByCrmUserId" }),
|
|
275
|
+
__metadata("design:type", user_entity_1.User)
|
|
276
|
+
], WatiMessage.prototype, "sentByCrmUser", void 0);
|
|
277
|
+
exports.WatiMessage = WatiMessage = __decorate([
|
|
278
|
+
(0, typeorm_1.Entity)("wati_messages")
|
|
279
|
+
], WatiMessage);
|
|
280
|
+
//# sourceMappingURL=wati-message.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wati-message.entity.js","sourceRoot":"","sources":["../../../../src/entities/thirdparty/wati/wati-message.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAuE;AACvE,6CAA8C;AAC9C,qDAAoG;AACpG,yDAA8C;AAC9C,mDAAyC;AACzC,2CAAsG;AACtG,4CAAmD;AAG5C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QAChD,QAAQ,EAAE,KAAK;KAChB,CAAC;IACD,IAAA,wBAAM,GAAE;IACR,IAAA,4BAAU,GAAE;IACZ,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,0BAA0B,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACpD,IAAI;2CAAC;AAUd;IARC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,2DAA2D;QACxE,QAAQ,EAAE,KAAK;KAChB,CAAC;IACD,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDAChB;AAIzB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC/D,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC;8BACxB,kBAAI;kDAAC;sBA7MV,WAAW;IADvB,IAAA,gBAAM,EAAC,eAAe,CAAC;GACX,WAAW,CA8MvB"}
|
|
@@ -0,0 +1,71 @@
|
|
|
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 WatiUserAccessLog extends EntityBase {
|
|
7
|
+
groupId: string;
|
|
8
|
+
group: Group;
|
|
9
|
+
watiUserAccessId: string;
|
|
10
|
+
watiConfigurationId: string;
|
|
11
|
+
watiConfiguration: WatiConfiguration;
|
|
12
|
+
targetUserId: string;
|
|
13
|
+
targetUser: User;
|
|
14
|
+
actionByUserId?: string;
|
|
15
|
+
actionByUser?: User;
|
|
16
|
+
action: WatiUserAccessLogAction;
|
|
17
|
+
previousData?: {
|
|
18
|
+
userType?: WatiUserType;
|
|
19
|
+
status?: WatiUserAccessStatus;
|
|
20
|
+
watiUserId?: string;
|
|
21
|
+
watiUserEmail?: string;
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
};
|
|
24
|
+
newData?: {
|
|
25
|
+
userType?: WatiUserType;
|
|
26
|
+
status?: WatiUserAccessStatus;
|
|
27
|
+
watiUserId?: string;
|
|
28
|
+
watiUserEmail?: string;
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
};
|
|
31
|
+
metadata?: {
|
|
32
|
+
messageId?: string;
|
|
33
|
+
messageType?: "session" | "template";
|
|
34
|
+
messageCount?: number;
|
|
35
|
+
costAmount?: number;
|
|
36
|
+
ipAddress?: string;
|
|
37
|
+
userAgent?: string;
|
|
38
|
+
reason?: string;
|
|
39
|
+
[key: string]: any;
|
|
40
|
+
};
|
|
41
|
+
description?: string;
|
|
42
|
+
result: "SUCCESS" | "FAILED" | "PARTIAL";
|
|
43
|
+
errorMessage?: string;
|
|
44
|
+
static createAccessCreatedLog(groupId: string, watiUserAccessId: string, watiConfigurationId: string, targetUserId: string, actionByUserId: string, newData: any): Partial<WatiUserAccessLog>;
|
|
45
|
+
static createUserTypeChangedLog(groupId: string, watiUserAccessId: string, watiConfigurationId: string, targetUserId: string, actionByUserId: string, previousUserType: WatiUserType, newUserType: WatiUserType): Partial<WatiUserAccessLog>;
|
|
46
|
+
static createMessageSentLog(groupId: string, watiUserAccessId: string, watiConfigurationId: string, targetUserId: string, messageType: "session" | "template", messageCount?: number): Partial<WatiUserAccessLog>;
|
|
47
|
+
static createLimitExceededLog(groupId: string, watiUserAccessId: string, watiConfigurationId: string, targetUserId: string, limitType: "session" | "template" | "user_count", currentUsage: number, limit: number): Partial<WatiUserAccessLog>;
|
|
48
|
+
}
|
|
49
|
+
export declare enum WatiUserAccessLogAction {
|
|
50
|
+
ACCESS_CREATED = "ACCESS_CREATED",
|
|
51
|
+
ACCESS_UPDATED = "ACCESS_UPDATED",
|
|
52
|
+
ACCESS_DELETED = "ACCESS_DELETED",
|
|
53
|
+
ACCESS_SUSPENDED = "ACCESS_SUSPENDED",
|
|
54
|
+
ACCESS_REACTIVATED = "ACCESS_REACTIVATED",
|
|
55
|
+
ROLE_CHANGED = "ROLE_CHANGED",
|
|
56
|
+
PERMISSIONS_UPDATED = "PERMISSIONS_UPDATED",
|
|
57
|
+
LIMITS_UPDATED = "LIMITS_UPDATED",
|
|
58
|
+
MESSAGE_SENT = "MESSAGE_SENT",
|
|
59
|
+
MESSAGE_FAILED = "MESSAGE_FAILED",
|
|
60
|
+
SESSION_STARTED = "SESSION_STARTED",
|
|
61
|
+
SESSION_ENDED = "SESSION_ENDED",
|
|
62
|
+
LIMIT_EXCEEDED = "LIMIT_EXCEEDED",
|
|
63
|
+
LIMIT_WARNING = "LIMIT_WARNING",
|
|
64
|
+
USAGE_RESET = "USAGE_RESET",
|
|
65
|
+
CONFIGURATION_ACCESSED = "CONFIGURATION_ACCESSED",
|
|
66
|
+
REPORT_GENERATED = "REPORT_GENERATED",
|
|
67
|
+
BULK_ACTION_PERFORMED = "BULK_ACTION_PERFORMED",
|
|
68
|
+
UNAUTHORIZED_ACCESS_ATTEMPT = "UNAUTHORIZED_ACCESS_ATTEMPT",
|
|
69
|
+
LOGIN_SUCCESS = "LOGIN_SUCCESS",
|
|
70
|
+
LOGIN_FAILED = "LOGIN_FAILED"
|
|
71
|
+
}
|