hgs-twilio-class-lib 1.1.83 → 1.1.85
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/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
# Flex V2 Backend Code
|
|
2
|
-
|
|
3
|
-
Package to manage Flex V2 Backend.
|
|
4
|
-
|
|
5
|
-
Run "npm install hgs-twilio-class-lib --save"
|
|
1
|
+
# Flex V2 Backend Code
|
|
2
|
+
|
|
3
|
+
Package to manage Flex V2 Backend.
|
|
4
|
+
|
|
5
|
+
Run "npm install hgs-twilio-class-lib --save"
|
|
@@ -46,7 +46,7 @@ class AgentScorecardController {
|
|
|
46
46
|
throw AgentScorecarddetails.validationMessages; // Throw error if data validation fails
|
|
47
47
|
}
|
|
48
48
|
// Open database connection
|
|
49
|
-
const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.
|
|
49
|
+
const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.agentScorecardDatabaseName);
|
|
50
50
|
const database = databaseConnection.result;
|
|
51
51
|
// Start database transaction
|
|
52
52
|
const dbTransaction = database.transactionItem(DatabaseConfig_1.databaseConfig.tables.agentScorecardTable, "readwrite");
|
|
@@ -81,7 +81,7 @@ class AgentScorecardController {
|
|
|
81
81
|
throw AgentScorecarddetails.validationMessages; // Throw error if data validation fails
|
|
82
82
|
}
|
|
83
83
|
// Open database connection
|
|
84
|
-
const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.
|
|
84
|
+
const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.agentScorecardDatabaseName);
|
|
85
85
|
const database = databaseConnection.result;
|
|
86
86
|
// Start database transaction
|
|
87
87
|
const dbTransaction = database.transactionItem(DatabaseConfig_1.databaseConfig.tables.agentScorecardTable, "readwrite");
|
|
@@ -112,7 +112,7 @@ class AgentScorecardController {
|
|
|
112
112
|
return __awaiter(this, void 0, void 0, function* () {
|
|
113
113
|
try {
|
|
114
114
|
// Open database connection
|
|
115
|
-
const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.
|
|
115
|
+
const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.agentScorecardDatabaseName);
|
|
116
116
|
const database = databaseConnection.result;
|
|
117
117
|
// Start database transaction
|
|
118
118
|
const dbTransaction = database.transactionItem(DatabaseConfig_1.databaseConfig.tables.agentScorecardTable, "readwrite");
|
|
@@ -153,7 +153,7 @@ class AgentScorecardController {
|
|
|
153
153
|
return __awaiter(this, void 0, void 0, function* () {
|
|
154
154
|
try {
|
|
155
155
|
// Open database connection
|
|
156
|
-
const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.
|
|
156
|
+
const databaseConnection = yield this._dbFactory.asyncOpen(DatabaseConfig_1.databaseConfig.agentScorecardDatabaseName);
|
|
157
157
|
const database = databaseConnection.result;
|
|
158
158
|
// Start database transaction
|
|
159
159
|
const dbTransaction = database.transactionItem(DatabaseConfig_1.databaseConfig.tables.agentScorecardTable, "readwrite");
|
|
@@ -33,13 +33,14 @@ class HoopBusinessHoursController {
|
|
|
33
33
|
* @returns - Business hours status
|
|
34
34
|
*/
|
|
35
35
|
getBusinessHours(query) {
|
|
36
|
-
var _a, _b;
|
|
36
|
+
var _a, _b, _c;
|
|
37
37
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38
38
|
try {
|
|
39
39
|
// Initialize the default status object
|
|
40
40
|
let status = {
|
|
41
41
|
isOpen: true,
|
|
42
42
|
isHoliday: false,
|
|
43
|
+
isYesterdayHoliday: false,
|
|
43
44
|
isPartialDay: false,
|
|
44
45
|
isRegularDay: true,
|
|
45
46
|
description: {
|
|
@@ -115,6 +116,7 @@ class HoopBusinessHoursController {
|
|
|
115
116
|
const timezone = isProfileAvailable.timeZone || "America/New_York";
|
|
116
117
|
const now = (0, moment_timezone_1.default)().tz(timezone); // Current time in specified timezone
|
|
117
118
|
const today = (0, moment_timezone_1.default)().tz(timezone).format("YYYY-MM-DD");
|
|
119
|
+
const yesterday = (0, moment_timezone_1.default)().tz(timezone).subtract(1, "day").format("YYYY-MM-DD");
|
|
118
120
|
const endDateTime = endDatePeriod
|
|
119
121
|
? moment_timezone_1.default.tz(endDatePeriod, "YYYY-MM-DD HH:mm", timezone).endOf('day')
|
|
120
122
|
: null;
|
|
@@ -179,6 +181,7 @@ class HoopBusinessHoursController {
|
|
|
179
181
|
}
|
|
180
182
|
// Check if today is a holiday
|
|
181
183
|
const todayHoliday = ((_b = holidays.find((holiday) => (0, moment_timezone_1.default)(holiday.date).format("YYYY-MM-DD") === today)) === null || _b === void 0 ? void 0 : _b.description) || "";
|
|
184
|
+
const yesterdayHoliday = ((_c = holidays.find((holiday) => (0, moment_timezone_1.default)(holiday.date).format("YYYY-MM-DD") === yesterday)) === null || _c === void 0 ? void 0 : _c.description) || "";
|
|
182
185
|
const partialDayToday = partialDays.find((partialDay) => (0, moment_timezone_1.default)(partialDay.date).format("YYYY-MM-DD") === today);
|
|
183
186
|
// Update status if today is a holiday
|
|
184
187
|
if (todayHoliday) {
|
|
@@ -211,6 +214,9 @@ class HoopBusinessHoursController {
|
|
|
211
214
|
status.description = HoopDescription;
|
|
212
215
|
}
|
|
213
216
|
}
|
|
217
|
+
if (yesterdayHoliday) {
|
|
218
|
+
status.isYesterdayHoliday = true;
|
|
219
|
+
}
|
|
214
220
|
status.weeklyTiming = resolvedWeeklyTimings;
|
|
215
221
|
status.weeklyTimingString = weeklyTimingString;
|
|
216
222
|
status.timeZone = isProfileAvailable.timeZone;
|
package/package.json
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "hgs-twilio-class-lib",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"description": "Flex 2.0 backend to connect with any database ",
|
|
5
|
-
"main": "./lib/index.js",
|
|
6
|
-
"types": "./types/index.d.ts",
|
|
7
|
-
"type": "commonjs",
|
|
8
|
-
"files": [
|
|
9
|
-
"lib",
|
|
10
|
-
"types",
|
|
11
|
-
"package.json"
|
|
12
|
-
],
|
|
13
|
-
"publishConfig": {
|
|
14
|
-
"directory": "lib"
|
|
15
|
-
},
|
|
16
|
-
"scripts": {
|
|
17
|
-
"clean": "rimraf lib types",
|
|
18
|
-
"build": "npm run clean && tsc",
|
|
19
|
-
"start": "node lib/server.js",
|
|
20
|
-
"dev": "nodemon server.ts",
|
|
21
|
-
"test": "echo \"Error: no test specified\" && exit 1",
|
|
22
|
-
"check:unused": "ts-prune"
|
|
23
|
-
},
|
|
24
|
-
"author": "HGS",
|
|
25
|
-
"license": "",
|
|
26
|
-
"devDependencies": {
|
|
27
|
-
"@rollup/plugin-commonjs": "^28.0.3",
|
|
28
|
-
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
29
|
-
"@rollup/plugin-typescript": "^12.1.2",
|
|
30
|
-
"@types/express": "4.17.21",
|
|
31
|
-
"@types/node": "20.11.17",
|
|
32
|
-
"@types/uuid": "9.0.8",
|
|
33
|
-
"esbuild": "^0.25.4",
|
|
34
|
-
"express": "^4.18.2",
|
|
35
|
-
"fast-glob": "^3.3.3",
|
|
36
|
-
"nodemon": "^3.1.0",
|
|
37
|
-
"rimraf": "^6.0.1",
|
|
38
|
-
"rollup": "^2.79.2",
|
|
39
|
-
"rollup-plugin-terser": "^7.0.2",
|
|
40
|
-
"rollup-plugin-visualizer": "^5.14.0",
|
|
41
|
-
"ts-loader": "9.5.1",
|
|
42
|
-
"ts-node": "^10.9.2",
|
|
43
|
-
"typescript": "5.3.3"
|
|
44
|
-
},
|
|
45
|
-
"dependencies": {
|
|
46
|
-
"@aws-sdk/client-connect": "3.723.0",
|
|
47
|
-
"cors": "^2.8.5",
|
|
48
|
-
"moment": "2.30.1",
|
|
49
|
-
"moment-timezone": "^0.5.46",
|
|
50
|
-
"twilio": "4.22.0",
|
|
51
|
-
"uuid": "^9.0.1"
|
|
52
|
-
},
|
|
53
|
-
"engines": {
|
|
54
|
-
"node": ">=18"
|
|
55
|
-
}
|
|
56
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "hgs-twilio-class-lib",
|
|
3
|
+
"version": "1.1.85",
|
|
4
|
+
"description": "Flex 2.0 backend to connect with any database ",
|
|
5
|
+
"main": "./lib/index.js",
|
|
6
|
+
"types": "./types/index.d.ts",
|
|
7
|
+
"type": "commonjs",
|
|
8
|
+
"files": [
|
|
9
|
+
"lib",
|
|
10
|
+
"types",
|
|
11
|
+
"package.json"
|
|
12
|
+
],
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"directory": "lib"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"clean": "rimraf lib types",
|
|
18
|
+
"build": "npm run clean && tsc",
|
|
19
|
+
"start": "node lib/server.js",
|
|
20
|
+
"dev": "nodemon server.ts",
|
|
21
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
22
|
+
"check:unused": "ts-prune"
|
|
23
|
+
},
|
|
24
|
+
"author": "HGS",
|
|
25
|
+
"license": "",
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@rollup/plugin-commonjs": "^28.0.3",
|
|
28
|
+
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
29
|
+
"@rollup/plugin-typescript": "^12.1.2",
|
|
30
|
+
"@types/express": "4.17.21",
|
|
31
|
+
"@types/node": "20.11.17",
|
|
32
|
+
"@types/uuid": "9.0.8",
|
|
33
|
+
"esbuild": "^0.25.4",
|
|
34
|
+
"express": "^4.18.2",
|
|
35
|
+
"fast-glob": "^3.3.3",
|
|
36
|
+
"nodemon": "^3.1.0",
|
|
37
|
+
"rimraf": "^6.0.1",
|
|
38
|
+
"rollup": "^2.79.2",
|
|
39
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
40
|
+
"rollup-plugin-visualizer": "^5.14.0",
|
|
41
|
+
"ts-loader": "9.5.1",
|
|
42
|
+
"ts-node": "^10.9.2",
|
|
43
|
+
"typescript": "5.3.3"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@aws-sdk/client-connect": "3.723.0",
|
|
47
|
+
"cors": "^2.8.5",
|
|
48
|
+
"moment": "2.30.1",
|
|
49
|
+
"moment-timezone": "^0.5.46",
|
|
50
|
+
"twilio": "4.22.0",
|
|
51
|
+
"uuid": "^9.0.1"
|
|
52
|
+
},
|
|
53
|
+
"engines": {
|
|
54
|
+
"node": ">=18"
|
|
55
|
+
}
|
|
56
|
+
}
|