easywork-common-lib 1.0.978 → 1.0.979

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 (23) hide show
  1. package/dist/entities/thirdparty/wati/index.d.ts +2 -0
  2. package/dist/entities/thirdparty/wati/index.js +2 -0
  3. package/dist/entities/thirdparty/wati/index.js.map +1 -1
  4. package/dist/entities/thirdparty/wati/wati-chat.entity.d.ts +6 -4
  5. package/dist/entities/thirdparty/wati/wati-chat.entity.js +35 -10
  6. package/dist/entities/thirdparty/wati/wati-chat.entity.js.map +1 -1
  7. package/dist/entities/thirdparty/wati/wati-configuration.entity.d.ts +3 -0
  8. package/dist/entities/thirdparty/wati/wati-configuration.entity.js +19 -0
  9. package/dist/entities/thirdparty/wati/wati-configuration.entity.js.map +1 -1
  10. package/dist/entities/thirdparty/wati/wati-message.entity.d.ts +33 -6
  11. package/dist/entities/thirdparty/wati/wati-message.entity.js +197 -39
  12. package/dist/entities/thirdparty/wati/wati-message.entity.js.map +1 -1
  13. package/dist/entities/thirdparty/wati/wati-subscription.entity.d.ts +31 -0
  14. package/dist/entities/thirdparty/wati/wati-subscription.entity.js +185 -0
  15. package/dist/entities/thirdparty/wati/wati-subscription.entity.js.map +1 -0
  16. package/dist/entities/thirdparty/wati/wati-usage-tracking.entity.d.ts +14 -0
  17. package/dist/entities/thirdparty/wati/wati-usage-tracking.entity.js +118 -0
  18. package/dist/entities/thirdparty/wati/wati-usage-tracking.entity.js.map +1 -0
  19. package/dist/entities/thirdparty/wati/wati.enum.d.ts +1 -0
  20. package/dist/entities/thirdparty/wati/wati.enum.js +1 -0
  21. package/dist/entities/thirdparty/wati/wati.enum.js.map +1 -1
  22. package/package.json +1 -1
  23. package/tsconfig.tsbuildinfo +1 -1
@@ -0,0 +1,31 @@
1
+ import { BaseEntityOnlyEssential } from "../../../common";
2
+ import { Group } from "../../group.entity";
3
+ export declare enum WatiPlanType {
4
+ GROWTH = "GROWTH",
5
+ PRO = "PRO",
6
+ BUSINESS = "BUSINESS"
7
+ }
8
+ export declare enum WatiSubscriptionStatus {
9
+ ACTIVE = "ACTIVE",
10
+ EXPIRED = "EXPIRED",
11
+ SUSPENDED = "SUSPENDED",
12
+ CANCELLED = "CANCELLED",
13
+ TRIAL = "TRIAL"
14
+ }
15
+ export declare class WatiSubscription extends BaseEntityOnlyEssential {
16
+ groupId: string;
17
+ group: Group;
18
+ planType: WatiPlanType;
19
+ status: WatiSubscriptionStatus;
20
+ startDate: Date;
21
+ expirationDate: Date;
22
+ maxUsers: number;
23
+ additionalUserCost: number;
24
+ maxSendsPerMonth?: number;
25
+ maxApiCallsPerMonth: number;
26
+ webhooksEnabled: boolean;
27
+ automationTriggersPerMonth: number;
28
+ maxIntegrations?: number;
29
+ monthlyPrice: number;
30
+ notes?: string;
31
+ }
@@ -0,0 +1,185 @@
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.WatiSubscription = exports.WatiSubscriptionStatus = exports.WatiPlanType = 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 common_1 = require("../../../common");
17
+ const group_entity_1 = require("../../group.entity");
18
+ var WatiPlanType;
19
+ (function (WatiPlanType) {
20
+ WatiPlanType["GROWTH"] = "GROWTH";
21
+ WatiPlanType["PRO"] = "PRO";
22
+ WatiPlanType["BUSINESS"] = "BUSINESS";
23
+ })(WatiPlanType || (exports.WatiPlanType = WatiPlanType = {}));
24
+ var WatiSubscriptionStatus;
25
+ (function (WatiSubscriptionStatus) {
26
+ WatiSubscriptionStatus["ACTIVE"] = "ACTIVE";
27
+ WatiSubscriptionStatus["EXPIRED"] = "EXPIRED";
28
+ WatiSubscriptionStatus["SUSPENDED"] = "SUSPENDED";
29
+ WatiSubscriptionStatus["CANCELLED"] = "CANCELLED";
30
+ WatiSubscriptionStatus["TRIAL"] = "TRIAL";
31
+ })(WatiSubscriptionStatus || (exports.WatiSubscriptionStatus = WatiSubscriptionStatus = {}));
32
+ let WatiSubscription = class WatiSubscription extends common_1.BaseEntityOnlyEssential {
33
+ groupId;
34
+ group;
35
+ planType;
36
+ status;
37
+ startDate;
38
+ expirationDate;
39
+ maxUsers;
40
+ additionalUserCost;
41
+ maxSendsPerMonth;
42
+ maxApiCallsPerMonth;
43
+ webhooksEnabled;
44
+ automationTriggersPerMonth;
45
+ maxIntegrations;
46
+ monthlyPrice;
47
+ notes;
48
+ };
49
+ exports.WatiSubscription = WatiSubscription;
50
+ __decorate([
51
+ (0, swagger_1.ApiProperty)({ description: "ID del grupo que tiene la suscripción" }),
52
+ (0, class_validator_1.IsString)(),
53
+ (0, typeorm_1.Index)(),
54
+ (0, typeorm_1.Column)({ type: "uuid" }),
55
+ __metadata("design:type", String)
56
+ ], WatiSubscription.prototype, "groupId", void 0);
57
+ __decorate([
58
+ (0, typeorm_1.ManyToOne)(() => group_entity_1.Group, { onDelete: "CASCADE" }),
59
+ (0, typeorm_1.JoinColumn)({ name: "groupId" }),
60
+ __metadata("design:type", group_entity_1.Group)
61
+ ], WatiSubscription.prototype, "group", void 0);
62
+ __decorate([
63
+ (0, swagger_1.ApiProperty)({
64
+ enum: WatiPlanType,
65
+ description: "Tipo de plan de Wati",
66
+ }),
67
+ (0, class_validator_1.IsEnum)(WatiPlanType),
68
+ (0, typeorm_1.Column)({ type: "enum", enum: WatiPlanType }),
69
+ __metadata("design:type", String)
70
+ ], WatiSubscription.prototype, "planType", void 0);
71
+ __decorate([
72
+ (0, swagger_1.ApiProperty)({
73
+ enum: WatiSubscriptionStatus,
74
+ description: "Estado de la suscripción",
75
+ }),
76
+ (0, class_validator_1.IsEnum)(WatiSubscriptionStatus),
77
+ (0, typeorm_1.Column)({ type: "enum", enum: WatiSubscriptionStatus }),
78
+ __metadata("design:type", String)
79
+ ], WatiSubscription.prototype, "status", void 0);
80
+ __decorate([
81
+ (0, swagger_1.ApiProperty)({
82
+ description: "Fecha de inicio de la suscripción",
83
+ }),
84
+ (0, class_validator_1.IsDate)(),
85
+ (0, typeorm_1.Column)({ type: "timestamp with time zone" }),
86
+ __metadata("design:type", Date)
87
+ ], WatiSubscription.prototype, "startDate", void 0);
88
+ __decorate([
89
+ (0, swagger_1.ApiProperty)({
90
+ description: "Fecha de expiración de la suscripción",
91
+ }),
92
+ (0, class_validator_1.IsDate)(),
93
+ (0, typeorm_1.Column)({ type: "timestamp with time zone" }),
94
+ __metadata("design:type", Date)
95
+ ], WatiSubscription.prototype, "expirationDate", void 0);
96
+ __decorate([
97
+ (0, swagger_1.ApiProperty)({
98
+ description: "Número máximo de usuarios incluidos",
99
+ }),
100
+ (0, class_validator_1.IsNumber)(),
101
+ (0, class_validator_1.Min)(1),
102
+ (0, typeorm_1.Column)({ type: "int" }),
103
+ __metadata("design:type", Number)
104
+ ], WatiSubscription.prototype, "maxUsers", void 0);
105
+ __decorate([
106
+ (0, swagger_1.ApiProperty)({
107
+ description: "Costo por usuario adicional (USD por mes)",
108
+ }),
109
+ (0, class_validator_1.IsNumber)(),
110
+ (0, class_validator_1.Min)(0),
111
+ (0, typeorm_1.Column)({ type: "decimal", precision: 10, scale: 2 }),
112
+ __metadata("design:type", Number)
113
+ ], WatiSubscription.prototype, "additionalUserCost", void 0);
114
+ __decorate([
115
+ (0, swagger_1.ApiProperty)({
116
+ description: "Número máximo de envíos por mes",
117
+ required: false,
118
+ }),
119
+ (0, class_validator_1.IsNumber)(),
120
+ (0, class_validator_1.IsOptional)(),
121
+ (0, class_validator_1.Min)(0),
122
+ (0, typeorm_1.Column)({ type: "int", nullable: true }),
123
+ __metadata("design:type", Number)
124
+ ], WatiSubscription.prototype, "maxSendsPerMonth", void 0);
125
+ __decorate([
126
+ (0, swagger_1.ApiProperty)({
127
+ description: "Número máximo de llamadas API por mes",
128
+ }),
129
+ (0, class_validator_1.IsNumber)(),
130
+ (0, class_validator_1.Min)(0),
131
+ (0, typeorm_1.Column)({ type: "int" }),
132
+ __metadata("design:type", Number)
133
+ ], WatiSubscription.prototype, "maxApiCallsPerMonth", void 0);
134
+ __decorate([
135
+ (0, swagger_1.ApiProperty)({
136
+ description: "Si tiene webhooks habilitados",
137
+ }),
138
+ (0, class_validator_1.IsBoolean)(),
139
+ (0, typeorm_1.Column)({ type: "boolean", default: false }),
140
+ __metadata("design:type", Boolean)
141
+ ], WatiSubscription.prototype, "webhooksEnabled", void 0);
142
+ __decorate([
143
+ (0, swagger_1.ApiProperty)({
144
+ description: "Número de activadores de automatización gratis por mes",
145
+ }),
146
+ (0, class_validator_1.IsNumber)(),
147
+ (0, class_validator_1.Min)(0),
148
+ (0, typeorm_1.Column)({ type: "int" }),
149
+ __metadata("design:type", Number)
150
+ ], WatiSubscription.prototype, "automationTriggersPerMonth", void 0);
151
+ __decorate([
152
+ (0, swagger_1.ApiProperty)({
153
+ description: "Número de integraciones permitidas",
154
+ required: false,
155
+ }),
156
+ (0, class_validator_1.IsNumber)(),
157
+ (0, class_validator_1.IsOptional)(),
158
+ (0, class_validator_1.Min)(0),
159
+ (0, typeorm_1.Column)({ type: "int", nullable: true }),
160
+ __metadata("design:type", Number)
161
+ ], WatiSubscription.prototype, "maxIntegrations", void 0);
162
+ __decorate([
163
+ (0, swagger_1.ApiProperty)({
164
+ description: "Precio mensual en USD",
165
+ }),
166
+ (0, class_validator_1.IsNumber)(),
167
+ (0, class_validator_1.Min)(0),
168
+ (0, typeorm_1.Column)({ type: "decimal", precision: 10, scale: 2 }),
169
+ __metadata("design:type", Number)
170
+ ], WatiSubscription.prototype, "monthlyPrice", void 0);
171
+ __decorate([
172
+ (0, swagger_1.ApiProperty)({
173
+ description: "Notas adicionales sobre la suscripción",
174
+ required: false,
175
+ }),
176
+ (0, class_validator_1.IsString)(),
177
+ (0, class_validator_1.IsOptional)(),
178
+ (0, typeorm_1.Column)({ type: "text", nullable: true }),
179
+ __metadata("design:type", String)
180
+ ], WatiSubscription.prototype, "notes", void 0);
181
+ exports.WatiSubscription = WatiSubscription = __decorate([
182
+ (0, typeorm_1.Entity)("wati_subscriptions"),
183
+ (0, typeorm_1.Index)(["groupId", "status"])
184
+ ], WatiSubscription);
185
+ //# sourceMappingURL=wati-subscription.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wati-subscription.entity.js","sourceRoot":"","sources":["../../../../src/entities/thirdparty/wati/wati-subscription.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAuE;AACvE,6CAA8C;AAC9C,qDAAiG;AACjG,4CAA0D;AAC1D,qDAA2C;AAE3C,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,2BAAW,CAAA;IACX,qCAAqB,CAAA;AACvB,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB;AAED,IAAY,sBAMX;AAND,WAAY,sBAAsB;IAChC,2CAAiB,CAAA;IACjB,6CAAmB,CAAA;IACnB,iDAAuB,CAAA;IACvB,iDAAuB,CAAA;IACvB,yCAAe,CAAA;AACjB,CAAC,EANW,sBAAsB,sCAAtB,sBAAsB,QAMjC;AAIM,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,gCAAuB;IAK3D,OAAO,CAAS;IAIhB,KAAK,CAAQ;IAQb,QAAQ,CAAe;IAQvB,MAAM,CAAyB;IAO/B,SAAS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./wati-subscription.entity";
3
+ export declare class WatiUsageTracking extends BaseEntityOnlyEssential {
4
+ subscriptionId: string;
5
+ subscription: WatiSubscription;
6
+ year: number;
7
+ month: number;
8
+ messagesSent: number;
9
+ apiCallsMade: number;
10
+ automationTriggersUsed: number;
11
+ activeUsers: number;
12
+ overageCost: number;
13
+ lastUpdated: Date;
14
+ }
@@ -0,0 +1,118 @@
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.WatiUsageTracking = 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 common_1 = require("../../../common");
17
+ const wati_subscription_entity_1 = require("./wati-subscription.entity");
18
+ let WatiUsageTracking = class WatiUsageTracking extends common_1.BaseEntityOnlyEssential {
19
+ subscriptionId;
20
+ subscription;
21
+ year;
22
+ month;
23
+ messagesSent;
24
+ apiCallsMade;
25
+ automationTriggersUsed;
26
+ activeUsers;
27
+ overageCost;
28
+ lastUpdated;
29
+ };
30
+ exports.WatiUsageTracking = WatiUsageTracking;
31
+ __decorate([
32
+ (0, swagger_1.ApiProperty)({ description: "ID de la suscripción de Wati" }),
33
+ (0, class_validator_1.IsString)(),
34
+ (0, typeorm_1.Index)(),
35
+ (0, typeorm_1.Column)({ type: "uuid" }),
36
+ __metadata("design:type", String)
37
+ ], WatiUsageTracking.prototype, "subscriptionId", void 0);
38
+ __decorate([
39
+ (0, typeorm_1.ManyToOne)(() => wati_subscription_entity_1.WatiSubscription, { onDelete: "CASCADE" }),
40
+ (0, typeorm_1.JoinColumn)({ name: "subscriptionId" }),
41
+ __metadata("design:type", wati_subscription_entity_1.WatiSubscription)
42
+ ], WatiUsageTracking.prototype, "subscription", void 0);
43
+ __decorate([
44
+ (0, swagger_1.ApiProperty)({
45
+ description: "Año del período de uso",
46
+ }),
47
+ (0, class_validator_1.IsNumber)(),
48
+ (0, class_validator_1.Min)(2024),
49
+ (0, typeorm_1.Column)({ type: "int" }),
50
+ __metadata("design:type", Number)
51
+ ], WatiUsageTracking.prototype, "year", void 0);
52
+ __decorate([
53
+ (0, swagger_1.ApiProperty)({
54
+ description: "Mes del período de uso (1-12)",
55
+ }),
56
+ (0, class_validator_1.IsNumber)(),
57
+ (0, class_validator_1.Min)(1),
58
+ (0, typeorm_1.Column)({ type: "int" }),
59
+ __metadata("design:type", Number)
60
+ ], WatiUsageTracking.prototype, "month", void 0);
61
+ __decorate([
62
+ (0, swagger_1.ApiProperty)({
63
+ description: "Número de mensajes enviados en el mes",
64
+ }),
65
+ (0, class_validator_1.IsNumber)(),
66
+ (0, class_validator_1.Min)(0),
67
+ (0, typeorm_1.Column)({ type: "int", default: 0 }),
68
+ __metadata("design:type", Number)
69
+ ], WatiUsageTracking.prototype, "messagesSent", void 0);
70
+ __decorate([
71
+ (0, swagger_1.ApiProperty)({
72
+ description: "Número de llamadas API realizadas en el mes",
73
+ }),
74
+ (0, class_validator_1.IsNumber)(),
75
+ (0, class_validator_1.Min)(0),
76
+ (0, typeorm_1.Column)({ type: "int", default: 0 }),
77
+ __metadata("design:type", Number)
78
+ ], WatiUsageTracking.prototype, "apiCallsMade", void 0);
79
+ __decorate([
80
+ (0, swagger_1.ApiProperty)({
81
+ description: "Número de activadores de automatización usados en el mes",
82
+ }),
83
+ (0, class_validator_1.IsNumber)(),
84
+ (0, class_validator_1.Min)(0),
85
+ (0, typeorm_1.Column)({ type: "int", default: 0 }),
86
+ __metadata("design:type", Number)
87
+ ], WatiUsageTracking.prototype, "automationTriggersUsed", void 0);
88
+ __decorate([
89
+ (0, swagger_1.ApiProperty)({
90
+ description: "Número de usuarios activos en el mes",
91
+ }),
92
+ (0, class_validator_1.IsNumber)(),
93
+ (0, class_validator_1.Min)(0),
94
+ (0, typeorm_1.Column)({ type: "int", default: 0 }),
95
+ __metadata("design:type", Number)
96
+ ], WatiUsageTracking.prototype, "activeUsers", void 0);
97
+ __decorate([
98
+ (0, swagger_1.ApiProperty)({
99
+ description: "Costo adicional por exceso de límites (USD)",
100
+ }),
101
+ (0, class_validator_1.IsNumber)(),
102
+ (0, class_validator_1.Min)(0),
103
+ (0, typeorm_1.Column)({ type: "decimal", precision: 10, scale: 2, default: 0 }),
104
+ __metadata("design:type", Number)
105
+ ], WatiUsageTracking.prototype, "overageCost", void 0);
106
+ __decorate([
107
+ (0, swagger_1.ApiProperty)({
108
+ description: "Última actualización del tracking",
109
+ }),
110
+ (0, class_validator_1.IsDate)(),
111
+ (0, typeorm_1.Column)({ type: "timestamp with time zone", default: () => "CURRENT_TIMESTAMP" }),
112
+ __metadata("design:type", Date)
113
+ ], WatiUsageTracking.prototype, "lastUpdated", void 0);
114
+ exports.WatiUsageTracking = WatiUsageTracking = __decorate([
115
+ (0, typeorm_1.Entity)("wati_usage_tracking"),
116
+ (0, typeorm_1.Index)(["subscriptionId", "month", "year"], { unique: true })
117
+ ], WatiUsageTracking);
118
+ //# sourceMappingURL=wati-usage-tracking.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wati-usage-tracking.entity.js","sourceRoot":"","sources":["../../../../src/entities/thirdparty/wati/wati-usage-tracking.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAuE;AACvE,6CAA8C;AAC9C,qDAAkE;AAClE,4CAA0D;AAC1D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;IAF7B,IAAA,gBAAM,EAAC,qBAAqB,CAAC;IAC7B,IAAA,eAAK,EAAC,CAAC,gBAAgB,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;GAChD,iBAAiB,CAyE7B"}
@@ -29,6 +29,7 @@ export declare enum WatiEventType {
29
29
  sentMessageREAD = "sentMessageREAD",
30
30
  sentMessageREPLIED = "sentMessageREPLIED",
31
31
  templateMessageFailed = "templateMessageFailed",
32
+ sessionMessageSent_v2 = "sessionMessageSent_v2",
32
33
  templateMessageSent_v2 = "templateMessageSent_v2",
33
34
  sentMessageDELIVERED_v2 = "sentMessageDELIVERED_v2",
34
35
  sentMessageREAD_v2 = "sentMessageREAD_v2",
@@ -36,6 +36,7 @@ var WatiEventType;
36
36
  WatiEventType["sentMessageREAD"] = "sentMessageREAD";
37
37
  WatiEventType["sentMessageREPLIED"] = "sentMessageREPLIED";
38
38
  WatiEventType["templateMessageFailed"] = "templateMessageFailed";
39
+ WatiEventType["sessionMessageSent_v2"] = "sessionMessageSent_v2";
39
40
  WatiEventType["templateMessageSent_v2"] = "templateMessageSent_v2";
40
41
  WatiEventType["sentMessageDELIVERED_v2"] = "sentMessageDELIVERED_v2";
41
42
  WatiEventType["sentMessageREAD_v2"] = "sentMessageREAD_v2";
@@ -1 +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,IAAY,aAaX;AAbD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,wEAAuD,CAAA;IACvD,0DAAyC,CAAA;IACzC,4DAA2C,CAAA;IAC3C,8DAA6C,CAAA;IAC7C,oDAAmC,CAAA;IACnC,0DAAyC,CAAA;IACzC,gEAA+C,CAAA;IAC/C,kEAAiD,CAAA;IACjD,oEAAmD,CAAA;IACnD,0DAAyC,CAAA;IACzC,gEAA+C,CAAA;AACjD,CAAC,EAbW,aAAa,6BAAb,aAAa,QAaxB;AAED,IAAY,8BAOX;AAPD,WAAY,8BAA8B;IACxC,+CAAa,CAAA;IACb,qEAAmC,CAAA;IACnC,uEAAqC,CAAA;IACrC,uDAAqB,CAAA;IACrB,mFAAiD,CAAA;IACjD,uFAAqD,CAAA;AACvD,CAAC,EAPW,8BAA8B,8CAA9B,8BAA8B,QAOzC;AAED,IAAY,yBAOX;AAPD,WAAY,yBAAyB;IACnC,4DAA+B,CAAA;IAC/B,0FAA6D,CAAA;IAC7D,8CAAiB,CAAA;IACjB,wEAA2C,CAAA;IAC3C,4DAA+B,CAAA;IAC/B,oDAAuB,CAAA;AACzB,CAAC,EAPW,yBAAyB,yCAAzB,yBAAyB,QAOpC"}
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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ANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easywork-common-lib",
3
- "version": "1.0.978",
3
+ "version": "1.0.979",
4
4
  "description": "Librería común de Easywork",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {