hgs-twilio-class-lib 1.1.87 → 1.1.89
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/lib/controller/AgentScoreDataController.d.ts +44 -0
- package/lib/controller/AgentScoreDataController.js +247 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +3 -1
- package/lib/models/impl/AgentScoreDataModel.d.ts +63 -0
- package/lib/models/impl/AgentScoreDataModel.js +268 -0
- package/package.json +1 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { SyncServiceFactory } from "../twilio/impl/sync/SyncServiceFactory";
|
|
2
|
+
import { SearchParameterType } from "../common/type/SearchParameterType";
|
|
3
|
+
import { AgentScoreDataModel } from "../models/impl/AgentScoreDataModel";
|
|
4
|
+
export declare class AgentScoreDataController {
|
|
5
|
+
private _dbFactory;
|
|
6
|
+
constructor(dbFactory: SyncServiceFactory);
|
|
7
|
+
private getDatabaseConnection;
|
|
8
|
+
private getItemTransaction;
|
|
9
|
+
private getsyncTransaction;
|
|
10
|
+
addMap(reqBody: {
|
|
11
|
+
syncMapName: string;
|
|
12
|
+
Id: string;
|
|
13
|
+
ttl: number;
|
|
14
|
+
}): Promise<any>;
|
|
15
|
+
getAllMaps(query: SearchParameterType & {
|
|
16
|
+
syncServiceName: string;
|
|
17
|
+
}): Promise<any>;
|
|
18
|
+
getMap(query: {
|
|
19
|
+
syncMapName: string;
|
|
20
|
+
}): Promise<any>;
|
|
21
|
+
deletemap(reqBody: {
|
|
22
|
+
syncMapName: string;
|
|
23
|
+
}): Promise<any>;
|
|
24
|
+
addItem(reqBody: {
|
|
25
|
+
syncMapName: string;
|
|
26
|
+
ttl: number;
|
|
27
|
+
data: AgentScoreDataModel;
|
|
28
|
+
}): Promise<any>;
|
|
29
|
+
getItem(query: Pick<AgentScoreDataModel, "id"> & {
|
|
30
|
+
syncMapName: string;
|
|
31
|
+
}): Promise<any>;
|
|
32
|
+
getAllItems(query: SearchParameterType & {
|
|
33
|
+
syncMapName: string;
|
|
34
|
+
}): Promise<any>;
|
|
35
|
+
editItem(reqBody: {
|
|
36
|
+
syncMapName: string;
|
|
37
|
+
data: AgentScoreDataModel;
|
|
38
|
+
ifMatch: string | undefined;
|
|
39
|
+
}): Promise<any>;
|
|
40
|
+
deleteItem(query: Pick<AgentScoreDataModel, "id"> & {
|
|
41
|
+
syncMapName: string;
|
|
42
|
+
}): Promise<any>;
|
|
43
|
+
routeHandler(req: any, res: any): Promise<any>;
|
|
44
|
+
}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AgentScoreDataController = void 0;
|
|
13
|
+
const DatabaseConfig_1 = require("../config/DatabaseConfig");
|
|
14
|
+
const AgentScoreDataModel_1 = require("../models/impl/AgentScoreDataModel");
|
|
15
|
+
class AgentScoreDataController {
|
|
16
|
+
constructor(dbFactory) {
|
|
17
|
+
this._dbFactory = dbFactory;
|
|
18
|
+
}
|
|
19
|
+
getDatabaseConnection() {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.agentScorecardDatabaseName);
|
|
22
|
+
return databaseConnection.result;
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
getItemTransaction(syncMapName) {
|
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
const database = yield this.getDatabaseConnection();
|
|
28
|
+
const dbTransaction = database.transactionItem(syncMapName, "readwrite");
|
|
29
|
+
return dbTransaction;
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
getsyncTransaction(syncMapName) {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
const database = yield this.getDatabaseConnection();
|
|
35
|
+
const dbTransaction = database.transaction(syncMapName, "readwrite");
|
|
36
|
+
return dbTransaction;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
addMap(reqBody) {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
try {
|
|
42
|
+
const { syncMapName, Id, ttl } = reqBody;
|
|
43
|
+
if (!syncMapName) {
|
|
44
|
+
throw new Error("uniqueName is required.");
|
|
45
|
+
}
|
|
46
|
+
const dbTransaction = yield this.getsyncTransaction(syncMapName);
|
|
47
|
+
const table = dbTransaction.objectStore(syncMapName);
|
|
48
|
+
return table.add(syncMapName, Id, ttl);
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
console.error("Error adding real-time dashboard Map:", error);
|
|
52
|
+
throw error;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
getAllMaps(query) {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
try {
|
|
59
|
+
console.log("check for syncServiceName:::", query.syncServiceName);
|
|
60
|
+
const { syncServiceName } = query;
|
|
61
|
+
if (!syncServiceName) {
|
|
62
|
+
throw new Error(`Invalid syncServiceName: ${syncServiceName}`);
|
|
63
|
+
}
|
|
64
|
+
const dbTransaction = yield this.getsyncTransaction(syncServiceName);
|
|
65
|
+
const table = dbTransaction.objectStore(syncServiceName);
|
|
66
|
+
const allowedFields = [
|
|
67
|
+
"syncServiceName"
|
|
68
|
+
];
|
|
69
|
+
if (query.getFilterContent) {
|
|
70
|
+
query.allowedFields = allowedFields;
|
|
71
|
+
}
|
|
72
|
+
let result = yield table.getAll(syncServiceName);
|
|
73
|
+
console.log("syncmap name:::", result);
|
|
74
|
+
return { result };
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
console.error("Error retrieving all syncmaps:", error);
|
|
78
|
+
return error;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
getMap(query) {
|
|
83
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
84
|
+
try {
|
|
85
|
+
const { syncMapName } = query;
|
|
86
|
+
if (!syncMapName) {
|
|
87
|
+
throw new Error("syncMapName is required.");
|
|
88
|
+
}
|
|
89
|
+
const dbTransaction = yield this.getsyncTransaction(syncMapName);
|
|
90
|
+
const table = dbTransaction.objectStore(syncMapName);
|
|
91
|
+
const result = yield table.get(syncMapName);
|
|
92
|
+
return result;
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
console.error("Error retrieving item:", error);
|
|
96
|
+
return error;
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
deletemap(reqBody) {
|
|
101
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
102
|
+
try {
|
|
103
|
+
const { syncMapName } = reqBody;
|
|
104
|
+
if (!syncMapName) {
|
|
105
|
+
throw new Error("syncMapName is required.");
|
|
106
|
+
}
|
|
107
|
+
const dbTransaction = yield this.getsyncTransaction(syncMapName);
|
|
108
|
+
const table = dbTransaction.objectStore(syncMapName);
|
|
109
|
+
const result = yield table.delete(syncMapName);
|
|
110
|
+
return result;
|
|
111
|
+
}
|
|
112
|
+
catch (error) {
|
|
113
|
+
console.error("Error deleting item:", error);
|
|
114
|
+
return error;
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
addItem(reqBody) {
|
|
119
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
120
|
+
try {
|
|
121
|
+
const { syncMapName, data, ttl } = reqBody;
|
|
122
|
+
if (!syncMapName) {
|
|
123
|
+
throw new Error("syncMapName is required.");
|
|
124
|
+
}
|
|
125
|
+
const AgentScorecarddetails = new AgentScoreDataModel_1.AgentScoreDataModel(data.id, data.ht, data.tsCompleted, data.tsCreated, data.taskSid, data.queueName, data.channel, data.HoldTimeline, data.UnHoldTimeline, data.taskCreated, data.reservationCreated, data.tsHangUp, data.from, data.to, data.isOutbound, data.queueSid, data.hang_up_by, data.createdAt, data.updatedAt);
|
|
126
|
+
if (AgentScorecarddetails.validationMessages.length > 0) {
|
|
127
|
+
throw AgentScorecarddetails.validationMessages;
|
|
128
|
+
}
|
|
129
|
+
const dbTransaction = yield this.getItemTransaction(syncMapName);
|
|
130
|
+
const table = dbTransaction.objectStore(syncMapName);
|
|
131
|
+
const result = yield table.add(AgentScorecarddetails.serialize, AgentScorecarddetails.id, ttl);
|
|
132
|
+
return result;
|
|
133
|
+
}
|
|
134
|
+
catch (error) {
|
|
135
|
+
console.error("Error adding real-time dashboard item:", error);
|
|
136
|
+
throw error;
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
getItem(query) {
|
|
141
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
142
|
+
try {
|
|
143
|
+
const { syncMapName, id } = query;
|
|
144
|
+
if (!syncMapName) {
|
|
145
|
+
throw new Error("syncMapName is required.");
|
|
146
|
+
}
|
|
147
|
+
const dbTransaction = yield this.getItemTransaction(syncMapName);
|
|
148
|
+
const table = dbTransaction.objectStore(syncMapName);
|
|
149
|
+
const result = yield table.get(id);
|
|
150
|
+
return result;
|
|
151
|
+
}
|
|
152
|
+
catch (error) {
|
|
153
|
+
console.error("Error retrieving item:", error);
|
|
154
|
+
return error;
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
getAllItems(query) {
|
|
159
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
160
|
+
try {
|
|
161
|
+
const { syncMapName } = query;
|
|
162
|
+
if (!syncMapName) {
|
|
163
|
+
throw new Error(`Invalid syncMapName: ${syncMapName}`);
|
|
164
|
+
}
|
|
165
|
+
const dbTransaction = yield this.getItemTransaction(syncMapName);
|
|
166
|
+
const table = dbTransaction.objectStore(syncMapName);
|
|
167
|
+
let result = yield table.getAllItems(query);
|
|
168
|
+
return { result, meta: query };
|
|
169
|
+
}
|
|
170
|
+
catch (error) {
|
|
171
|
+
console.error("Error retrieving all queue details:", error);
|
|
172
|
+
return error;
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
editItem(reqBody) {
|
|
177
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
178
|
+
try {
|
|
179
|
+
const { syncMapName, data, ifMatch } = reqBody;
|
|
180
|
+
if (!syncMapName) {
|
|
181
|
+
throw new Error("syncMapName is required.");
|
|
182
|
+
}
|
|
183
|
+
const AgentScorecarddetails = new AgentScoreDataModel_1.AgentScoreDataModel(data.id, data.ht, data.tsCompleted, data.tsCreated, data.taskSid, data.queueName, data.channel, data.HoldTimeline, data.UnHoldTimeline, data.taskCreated, data.reservationCreated, data.tsHangUp, data.from, data.to, data.isOutbound, data.queueSid, data.hang_up_by, data.createdAt, data.updatedAt);
|
|
184
|
+
if (AgentScorecarddetails.validationMessages.length > 0) {
|
|
185
|
+
throw AgentScorecarddetails.validationMessages;
|
|
186
|
+
}
|
|
187
|
+
const dbTransaction = yield this.getItemTransaction(syncMapName);
|
|
188
|
+
const table = dbTransaction.objectStore(syncMapName);
|
|
189
|
+
const key = AgentScorecarddetails.id;
|
|
190
|
+
const result = yield table.putItem(AgentScorecarddetails.serialize, key, ifMatch);
|
|
191
|
+
return result;
|
|
192
|
+
}
|
|
193
|
+
catch (error) {
|
|
194
|
+
console.error("Error editing real-time item:", error);
|
|
195
|
+
return error;
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
deleteItem(query) {
|
|
200
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
201
|
+
try {
|
|
202
|
+
const { syncMapName, id } = query;
|
|
203
|
+
if (!syncMapName) {
|
|
204
|
+
throw new Error("syncMapName is required.");
|
|
205
|
+
}
|
|
206
|
+
const dbTransaction = yield this.getItemTransaction(syncMapName);
|
|
207
|
+
const table = dbTransaction.objectStore(syncMapName);
|
|
208
|
+
const result = yield table.delete(id);
|
|
209
|
+
return result;
|
|
210
|
+
}
|
|
211
|
+
catch (error) {
|
|
212
|
+
console.error("Error deleting item:", error);
|
|
213
|
+
return error;
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
routeHandler(req, res) {
|
|
218
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
219
|
+
try {
|
|
220
|
+
const urlParts = req.path.split("/");
|
|
221
|
+
const method = urlParts[1];
|
|
222
|
+
if (!method) {
|
|
223
|
+
return res.status(400).json({ error: "Method is required" });
|
|
224
|
+
}
|
|
225
|
+
const selectedMethod = this[method];
|
|
226
|
+
if (!selectedMethod) {
|
|
227
|
+
return res.status(404).json({ error: `Method "${method}" not found` });
|
|
228
|
+
}
|
|
229
|
+
const input = req.method === "GET" ? req.query : req.body;
|
|
230
|
+
const result = yield selectedMethod.call(this, input);
|
|
231
|
+
return res.json({
|
|
232
|
+
status: 200,
|
|
233
|
+
message: "Success",
|
|
234
|
+
data: result
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
catch (err) {
|
|
238
|
+
console.error("RealTimeDashboard error:", err);
|
|
239
|
+
return res.status(500).json({
|
|
240
|
+
status: 500,
|
|
241
|
+
error: (err === null || err === void 0 ? void 0 : err.message) || err
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
exports.AgentScoreDataController = AgentScoreDataController;
|
package/lib/index.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ import { TaskInfoPanelController } from "./controller/twilio/TaskInfoPanelContro
|
|
|
35
35
|
import { AgentScorecardController } from "./controller/twilio/AgentScorecardController";
|
|
36
36
|
import { AgentActionsController } from "./controller/twilio/AgentActionsController";
|
|
37
37
|
import { RealTimeDashboardController } from "./controller/RealTimeDashboardController";
|
|
38
|
+
import { AgentScoreDataController } from "./controller/AgentScoreDataController";
|
|
38
39
|
import * as models from "./models";
|
|
39
|
-
export { DatabaseFactory, GPMController, TwilioAuthTokenConfig, SyncServiceFactory, CxConfigAssetController, CxConfigController, CallLogsController, CxConfigOtherController, CxConfigExternalNumbersController, CxConfigQueueMenuController, TwilioClient, AuditLogController, QuickLinksController, NavigationController, QualityFormsController, RealTimeReportsWGDetailsController, RealTimeReportsQueueDetailsController, PlaybackScreenrecordingsController, CxConfigUIConfigController, HoopProfilesListController, HoopOverrideBranchesController, HoopOperationsController, HoopHolidaysController, HoopPartialDaysController, HoopBusinessHoursController, CallbackAndVoicemailController, HoopMainController, HoopNotesController, HoopBusinessHoursControllerAConnect, AWSConnectAPIConfig, AWSClient, HoopServiceFactory, ChannelSettingsController, TaskInfoPanelController, AgentScorecardController, AgentActionsController, RealTimeDashboardController };
|
|
40
|
+
export { DatabaseFactory, GPMController, TwilioAuthTokenConfig, SyncServiceFactory, CxConfigAssetController, CxConfigController, CallLogsController, CxConfigOtherController, CxConfigExternalNumbersController, CxConfigQueueMenuController, TwilioClient, AuditLogController, QuickLinksController, NavigationController, QualityFormsController, RealTimeReportsWGDetailsController, RealTimeReportsQueueDetailsController, PlaybackScreenrecordingsController, CxConfigUIConfigController, HoopProfilesListController, HoopOverrideBranchesController, HoopOperationsController, HoopHolidaysController, HoopPartialDaysController, HoopBusinessHoursController, CallbackAndVoicemailController, HoopMainController, HoopNotesController, HoopBusinessHoursControllerAConnect, AWSConnectAPIConfig, AWSClient, HoopServiceFactory, ChannelSettingsController, TaskInfoPanelController, AgentScorecardController, AgentActionsController, RealTimeDashboardController, AgentScoreDataController };
|
|
40
41
|
export { models };
|
package/lib/index.js
CHANGED
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.models = exports.RealTimeDashboardController = exports.AgentActionsController = exports.AgentScorecardController = exports.TaskInfoPanelController = exports.ChannelSettingsController = exports.HoopServiceFactory = exports.AWSClient = exports.AWSConnectAPIConfig = exports.HoopBusinessHoursControllerAConnect = exports.HoopNotesController = exports.HoopMainController = exports.CallbackAndVoicemailController = exports.HoopBusinessHoursController = exports.HoopPartialDaysController = exports.HoopHolidaysController = exports.HoopOperationsController = exports.HoopOverrideBranchesController = exports.HoopProfilesListController = exports.CxConfigUIConfigController = exports.PlaybackScreenrecordingsController = exports.RealTimeReportsQueueDetailsController = exports.RealTimeReportsWGDetailsController = exports.QualityFormsController = exports.NavigationController = exports.QuickLinksController = exports.AuditLogController = exports.TwilioClient = exports.CxConfigQueueMenuController = exports.CxConfigExternalNumbersController = exports.CxConfigOtherController = exports.CallLogsController = exports.CxConfigController = exports.CxConfigAssetController = exports.SyncServiceFactory = exports.TwilioAuthTokenConfig = exports.GPMController = exports.DatabaseFactory = void 0;
|
|
26
|
+
exports.models = exports.AgentScoreDataController = exports.RealTimeDashboardController = exports.AgentActionsController = exports.AgentScorecardController = exports.TaskInfoPanelController = exports.ChannelSettingsController = exports.HoopServiceFactory = exports.AWSClient = exports.AWSConnectAPIConfig = exports.HoopBusinessHoursControllerAConnect = exports.HoopNotesController = exports.HoopMainController = exports.CallbackAndVoicemailController = exports.HoopBusinessHoursController = exports.HoopPartialDaysController = exports.HoopHolidaysController = exports.HoopOperationsController = exports.HoopOverrideBranchesController = exports.HoopProfilesListController = exports.CxConfigUIConfigController = exports.PlaybackScreenrecordingsController = exports.RealTimeReportsQueueDetailsController = exports.RealTimeReportsWGDetailsController = exports.QualityFormsController = exports.NavigationController = exports.QuickLinksController = exports.AuditLogController = exports.TwilioClient = exports.CxConfigQueueMenuController = exports.CxConfigExternalNumbersController = exports.CxConfigOtherController = exports.CallLogsController = exports.CxConfigController = exports.CxConfigAssetController = exports.SyncServiceFactory = exports.TwilioAuthTokenConfig = exports.GPMController = exports.DatabaseFactory = void 0;
|
|
27
27
|
const DatabaseFactory_1 = require("./common/abstract/DatabaseFactory");
|
|
28
28
|
Object.defineProperty(exports, "DatabaseFactory", { enumerable: true, get: function () { return DatabaseFactory_1.DatabaseFactory; } });
|
|
29
29
|
const GPMController_1 = require("./controller/twilio/GPMController");
|
|
@@ -98,5 +98,7 @@ const AgentActionsController_1 = require("./controller/twilio/AgentActionsContro
|
|
|
98
98
|
Object.defineProperty(exports, "AgentActionsController", { enumerable: true, get: function () { return AgentActionsController_1.AgentActionsController; } });
|
|
99
99
|
const RealTimeDashboardController_1 = require("./controller/RealTimeDashboardController");
|
|
100
100
|
Object.defineProperty(exports, "RealTimeDashboardController", { enumerable: true, get: function () { return RealTimeDashboardController_1.RealTimeDashboardController; } });
|
|
101
|
+
const AgentScoreDataController_1 = require("./controller/AgentScoreDataController");
|
|
102
|
+
Object.defineProperty(exports, "AgentScoreDataController", { enumerable: true, get: function () { return AgentScoreDataController_1.AgentScoreDataController; } });
|
|
101
103
|
const models = __importStar(require("./models"));
|
|
102
104
|
exports.models = models;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { BaseModel } from "../abstract/BaseModel";
|
|
2
|
+
import { validationMessage } from "../interface/IBaseModel";
|
|
3
|
+
export declare class AgentScoreDataModel extends BaseModel {
|
|
4
|
+
private _id;
|
|
5
|
+
private _ht;
|
|
6
|
+
private _tsCompleted;
|
|
7
|
+
private _tsCreated;
|
|
8
|
+
private _taskSid;
|
|
9
|
+
private _queueName;
|
|
10
|
+
private _channel;
|
|
11
|
+
private _HoldTimeline;
|
|
12
|
+
private _UnHoldTimeline;
|
|
13
|
+
private _taskCreated;
|
|
14
|
+
private _reservationCreated;
|
|
15
|
+
private _tsHangUp;
|
|
16
|
+
private _from;
|
|
17
|
+
private _to;
|
|
18
|
+
private _isOutbound;
|
|
19
|
+
private _queueSid;
|
|
20
|
+
private _hang_up_by;
|
|
21
|
+
private _createdAt;
|
|
22
|
+
private _updatedAt;
|
|
23
|
+
constructor(id: string, ht: string, tsCompleted: string, tsCreated: string, taskSid: string, queueName: string, channel: string, HoldTimeline: number, UnHoldTimeline: number, taskCreated: number, reservationCreated: number, tsHangUp: number, from: number, to: number, isOutbound: number, queueSid: string, hang_up_by: string, createdAt: Date | undefined | string, updatedAt: Date | undefined | string);
|
|
24
|
+
get id(): string;
|
|
25
|
+
set id(value: string);
|
|
26
|
+
get ht(): string;
|
|
27
|
+
set ht(value: string);
|
|
28
|
+
get tsCompleted(): string;
|
|
29
|
+
set tsCompleted(value: string);
|
|
30
|
+
get tsCreated(): string;
|
|
31
|
+
set tsCreated(value: string);
|
|
32
|
+
get taskSid(): string;
|
|
33
|
+
set taskSid(value: string);
|
|
34
|
+
get queueName(): string;
|
|
35
|
+
set queueName(value: string);
|
|
36
|
+
get channel(): string;
|
|
37
|
+
set channel(value: string);
|
|
38
|
+
get HoldTimeline(): number;
|
|
39
|
+
set HoldTimeline(value: number);
|
|
40
|
+
get UnHoldTimeline(): number;
|
|
41
|
+
set UnHoldTimeline(value: number);
|
|
42
|
+
get taskCreated(): number;
|
|
43
|
+
set taskCreated(value: number);
|
|
44
|
+
get reservationCreated(): number;
|
|
45
|
+
set reservationCreated(value: number);
|
|
46
|
+
get tsHangUp(): number;
|
|
47
|
+
set tsHangUp(value: number);
|
|
48
|
+
get from(): number;
|
|
49
|
+
set from(value: number);
|
|
50
|
+
get to(): number;
|
|
51
|
+
set to(value: number);
|
|
52
|
+
get isOutbound(): number;
|
|
53
|
+
set isOutbound(value: number);
|
|
54
|
+
get queueSid(): string;
|
|
55
|
+
set queueSid(value: string);
|
|
56
|
+
get hang_up_by(): string;
|
|
57
|
+
set hang_up_by(value: string);
|
|
58
|
+
get createdAt(): Date | undefined | string;
|
|
59
|
+
set createdAt(value: Date | undefined | string);
|
|
60
|
+
get updatedAt(): Date | undefined | string;
|
|
61
|
+
set updatedAt(value: Date | undefined | string);
|
|
62
|
+
validateData(): validationMessage[];
|
|
63
|
+
}
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AgentScoreDataModel = void 0;
|
|
4
|
+
const BaseModel_1 = require("../abstract/BaseModel");
|
|
5
|
+
class AgentScoreDataModel extends BaseModel_1.BaseModel {
|
|
6
|
+
constructor(id, ht, tsCompleted, tsCreated, taskSid, queueName, channel, HoldTimeline, UnHoldTimeline, taskCreated, reservationCreated, tsHangUp, from, to, isOutbound, queueSid, hang_up_by, createdAt, updatedAt) {
|
|
7
|
+
super();
|
|
8
|
+
this._id = id;
|
|
9
|
+
this._ht = ht;
|
|
10
|
+
this._tsCompleted = tsCompleted;
|
|
11
|
+
this._tsCreated = tsCreated;
|
|
12
|
+
this._taskSid = taskSid;
|
|
13
|
+
this._queueName = queueName;
|
|
14
|
+
this._channel = channel;
|
|
15
|
+
this._HoldTimeline = HoldTimeline;
|
|
16
|
+
this._UnHoldTimeline = UnHoldTimeline;
|
|
17
|
+
this._taskCreated = taskCreated;
|
|
18
|
+
this._reservationCreated = reservationCreated;
|
|
19
|
+
this._tsHangUp = tsHangUp;
|
|
20
|
+
this._from = from;
|
|
21
|
+
this._to = to;
|
|
22
|
+
this._isOutbound = isOutbound;
|
|
23
|
+
this._queueSid = queueSid;
|
|
24
|
+
this._hang_up_by = hang_up_by;
|
|
25
|
+
this._createdAt = createdAt;
|
|
26
|
+
this._updatedAt = updatedAt;
|
|
27
|
+
}
|
|
28
|
+
// Getters and Setters
|
|
29
|
+
get id() {
|
|
30
|
+
return this._id;
|
|
31
|
+
}
|
|
32
|
+
set id(value) {
|
|
33
|
+
this._id = value;
|
|
34
|
+
}
|
|
35
|
+
get ht() {
|
|
36
|
+
return this.ht;
|
|
37
|
+
}
|
|
38
|
+
set ht(value) {
|
|
39
|
+
this._ht = value;
|
|
40
|
+
}
|
|
41
|
+
get tsCompleted() {
|
|
42
|
+
return this._tsCompleted;
|
|
43
|
+
}
|
|
44
|
+
set tsCompleted(value) {
|
|
45
|
+
this._tsCompleted = value;
|
|
46
|
+
}
|
|
47
|
+
get tsCreated() {
|
|
48
|
+
return this._tsCreated;
|
|
49
|
+
}
|
|
50
|
+
set tsCreated(value) {
|
|
51
|
+
this._tsCreated = value;
|
|
52
|
+
}
|
|
53
|
+
get taskSid() {
|
|
54
|
+
return this._taskSid;
|
|
55
|
+
}
|
|
56
|
+
set taskSid(value) {
|
|
57
|
+
this._taskSid = value;
|
|
58
|
+
}
|
|
59
|
+
get queueName() {
|
|
60
|
+
return this._queueName;
|
|
61
|
+
}
|
|
62
|
+
set queueName(value) {
|
|
63
|
+
this._queueName = value;
|
|
64
|
+
}
|
|
65
|
+
get channel() {
|
|
66
|
+
return this._channel;
|
|
67
|
+
}
|
|
68
|
+
set channel(value) {
|
|
69
|
+
this._channel = value;
|
|
70
|
+
}
|
|
71
|
+
get HoldTimeline() {
|
|
72
|
+
return this._HoldTimeline;
|
|
73
|
+
}
|
|
74
|
+
set HoldTimeline(value) {
|
|
75
|
+
this._HoldTimeline = value;
|
|
76
|
+
}
|
|
77
|
+
get UnHoldTimeline() {
|
|
78
|
+
return this._UnHoldTimeline;
|
|
79
|
+
}
|
|
80
|
+
set UnHoldTimeline(value) {
|
|
81
|
+
this._UnHoldTimeline = value;
|
|
82
|
+
}
|
|
83
|
+
get taskCreated() {
|
|
84
|
+
return this._taskCreated;
|
|
85
|
+
}
|
|
86
|
+
set taskCreated(value) {
|
|
87
|
+
this._taskCreated = value;
|
|
88
|
+
}
|
|
89
|
+
get reservationCreated() {
|
|
90
|
+
return this._reservationCreated;
|
|
91
|
+
}
|
|
92
|
+
set reservationCreated(value) {
|
|
93
|
+
this._reservationCreated = value;
|
|
94
|
+
}
|
|
95
|
+
get tsHangUp() {
|
|
96
|
+
return this._tsHangUp;
|
|
97
|
+
}
|
|
98
|
+
set tsHangUp(value) {
|
|
99
|
+
this._tsHangUp = value;
|
|
100
|
+
}
|
|
101
|
+
get from() {
|
|
102
|
+
return this._from;
|
|
103
|
+
}
|
|
104
|
+
set from(value) {
|
|
105
|
+
this._from = value;
|
|
106
|
+
}
|
|
107
|
+
get to() {
|
|
108
|
+
return this._to;
|
|
109
|
+
}
|
|
110
|
+
set to(value) {
|
|
111
|
+
this._to = value;
|
|
112
|
+
}
|
|
113
|
+
get isOutbound() {
|
|
114
|
+
return this._isOutbound;
|
|
115
|
+
}
|
|
116
|
+
set isOutbound(value) {
|
|
117
|
+
this._isOutbound = value;
|
|
118
|
+
}
|
|
119
|
+
get queueSid() {
|
|
120
|
+
return this._queueSid;
|
|
121
|
+
}
|
|
122
|
+
set queueSid(value) {
|
|
123
|
+
this._queueSid = value;
|
|
124
|
+
}
|
|
125
|
+
get hang_up_by() {
|
|
126
|
+
return this._hang_up_by;
|
|
127
|
+
}
|
|
128
|
+
set hang_up_by(value) {
|
|
129
|
+
this._hang_up_by = value;
|
|
130
|
+
}
|
|
131
|
+
get createdAt() {
|
|
132
|
+
return this._createdAt;
|
|
133
|
+
}
|
|
134
|
+
set createdAt(value) {
|
|
135
|
+
this._createdAt = value;
|
|
136
|
+
}
|
|
137
|
+
get updatedAt() {
|
|
138
|
+
return this._updatedAt;
|
|
139
|
+
}
|
|
140
|
+
set updatedAt(value) {
|
|
141
|
+
this._updatedAt = value;
|
|
142
|
+
}
|
|
143
|
+
// Validation Method
|
|
144
|
+
validateData() {
|
|
145
|
+
this.validationMessages = [];
|
|
146
|
+
if (typeof this._id !== "string" || !this._id.trim()) {
|
|
147
|
+
this.validationMessages.push({
|
|
148
|
+
type: "Error",
|
|
149
|
+
fieldDescription: "id",
|
|
150
|
+
message: "ID must be a non-empty string",
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
if (typeof this._ht !== "string" || !this._ht.trim()) {
|
|
154
|
+
this.validationMessages.push({
|
|
155
|
+
type: "Error",
|
|
156
|
+
fieldDescription: "ht",
|
|
157
|
+
message: "ht must be a non-empty string",
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
if (typeof this._tsCompleted !== "string" || !this._tsCompleted.trim()) {
|
|
161
|
+
this.validationMessages.push({
|
|
162
|
+
type: "Error",
|
|
163
|
+
fieldDescription: "tsCompleted",
|
|
164
|
+
message: "tsCompleted must be a non-empty string",
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
if (typeof this._tsCreated !== "string" || this._tsCreated.trim()) {
|
|
168
|
+
this.validationMessages.push({
|
|
169
|
+
type: "Error",
|
|
170
|
+
fieldDescription: "tsCreated",
|
|
171
|
+
message: "tsCreated must be a non-empty string",
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
if (typeof this._taskSid !== "string" || this._taskSid.trim()) {
|
|
175
|
+
this.validationMessages.push({
|
|
176
|
+
type: "Error",
|
|
177
|
+
fieldDescription: "taskSid",
|
|
178
|
+
message: "taskSid must be a non-empty string",
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
if (typeof this._queueName !== "string" || this._queueName.trim()) {
|
|
182
|
+
this.validationMessages.push({
|
|
183
|
+
type: "Error",
|
|
184
|
+
fieldDescription: "queueName",
|
|
185
|
+
message: "queueName must be a non-empty string",
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
if (typeof this._channel !== "string" || this._channel.trim()) {
|
|
189
|
+
this.validationMessages.push({
|
|
190
|
+
type: "Error",
|
|
191
|
+
fieldDescription: "channel",
|
|
192
|
+
message: "Channel must be a non-empty string",
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
if (typeof this._HoldTimeline !== "number" || this._HoldTimeline < 0) {
|
|
196
|
+
this.validationMessages.push({
|
|
197
|
+
type: "Error",
|
|
198
|
+
fieldDescription: "HoldTimeline",
|
|
199
|
+
message: "HoldTimeline must be a non-negative number",
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
if (typeof this._UnHoldTimeline !== "number" || this._UnHoldTimeline < 0) {
|
|
203
|
+
this.validationMessages.push({
|
|
204
|
+
type: "Error",
|
|
205
|
+
fieldDescription: "UnHoldTimeline",
|
|
206
|
+
message: "UnHoldTimeline must be a non-negative number",
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
if (typeof this._taskCreated !== "number" || this._taskCreated < 0) {
|
|
210
|
+
this.validationMessages.push({
|
|
211
|
+
type: "Error",
|
|
212
|
+
fieldDescription: "taskCreated",
|
|
213
|
+
message: "taskCreated must be a non-negative number",
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
if (typeof this._reservationCreated !== "number" || this._reservationCreated < 0) {
|
|
217
|
+
this.validationMessages.push({
|
|
218
|
+
type: "Error",
|
|
219
|
+
fieldDescription: "reservationCreated",
|
|
220
|
+
message: "reservationCreated must be a non-negative number",
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
if (typeof this._tsHangUp !== "number" || this._tsHangUp < 0) {
|
|
224
|
+
this.validationMessages.push({
|
|
225
|
+
type: "Error",
|
|
226
|
+
fieldDescription: "tsHangUp",
|
|
227
|
+
message: "tsHangUp must be a non-negative number",
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
if (typeof this._from !== "number" || this._from < 0) {
|
|
231
|
+
this.validationMessages.push({
|
|
232
|
+
type: "Error",
|
|
233
|
+
fieldDescription: "from",
|
|
234
|
+
message: "from must be a non-negative number",
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
if (typeof this._to !== "number" || this._to < 0) {
|
|
238
|
+
this.validationMessages.push({
|
|
239
|
+
type: "Error",
|
|
240
|
+
fieldDescription: "to",
|
|
241
|
+
message: "to must be a non-negative number",
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
if (typeof this._isOutbound !== "number" || this._isOutbound < 0) {
|
|
245
|
+
this.validationMessages.push({
|
|
246
|
+
type: "Error",
|
|
247
|
+
fieldDescription: "isOutbound",
|
|
248
|
+
message: "isOutbound must be a non-negative number",
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
if (typeof this._queueSid !== "string" || this._queueSid.trim()) {
|
|
252
|
+
this.validationMessages.push({
|
|
253
|
+
type: "Error",
|
|
254
|
+
fieldDescription: "queueSid",
|
|
255
|
+
message: "queueSid must be a non-empty string",
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
if (typeof this._hang_up_by !== "string" || this._hang_up_by.trim()) {
|
|
259
|
+
this.validationMessages.push({
|
|
260
|
+
type: "Error",
|
|
261
|
+
fieldDescription: "hang_up_by",
|
|
262
|
+
message: "hang_up_by must be a non-empty string"
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
return this.validationMessages;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
exports.AgentScoreDataModel = AgentScoreDataModel;
|