hgs-twilio-class-lib 1.1.82 → 1.1.84

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"
@@ -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;
@@ -9,7 +9,7 @@ class SyncMap extends ServiceObjectStore_1.ServiceObjectStore {
9
9
  super(name, transaction, autoIncrement, indexNames, keyPath);
10
10
  }
11
11
  getMap() {
12
- return SyncMapTransaction_1.SyncMapTransaction.syncMapInstance.syncMap.fetch().then((map) => {
12
+ return SyncMapTransaction_1.SyncMapTransaction.syncMapInstance.syncMaps.fetch().then((map) => {
13
13
  return map;
14
14
  });
15
15
  }
package/package.json CHANGED
@@ -1,56 +1,56 @@
1
- {
2
- "name": "hgs-twilio-class-lib",
3
- "version": "1.1.82",
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.84",
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
+ }