hgs-twilio-class-lib 1.1.59 → 1.1.60

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"
@@ -12,4 +12,5 @@ export type SearchParameterType = {
12
12
  instanceId?: string;
13
13
  hoursOfOperationId?: string;
14
14
  getPromptForIVR?: boolean;
15
+ getPromptForIVRByLanguage?: boolean;
15
16
  };
@@ -20,7 +20,7 @@ class GPMController {
20
20
  add(data) {
21
21
  return __awaiter(this, void 0, void 0, function* () {
22
22
  try {
23
- const gpmprompt = new CxConfiguratorGPMPromptModel_1.CxConfiguratorGPMPromptModel(data.id, data.name, data.type, data.fileType, data.value, data.language, data.voice, data.hints, data.createdAt, data.updatedAt, data.fileLocation);
23
+ const gpmprompt = new CxConfiguratorGPMPromptModel_1.CxConfiguratorGPMPromptModel(data.id, data.name, data.type, data.fileType, data.value, data.language, data.voice, data.hints, data.createdAt, data.updatedAt);
24
24
  if (gpmprompt.validationMessages.length > 0) {
25
25
  throw gpmprompt.validationMessages;
26
26
  }
@@ -77,7 +77,10 @@ class GPMController {
77
77
  if (query.getFilterContent) {
78
78
  result.filterContent = CXConfigPromptFilter_1.CXConfigPromptFilterService.getFilterData(result.filterOptions);
79
79
  }
80
- if (query.getPromptForIVR) {
80
+ if (query.getPromptForIVR && query.getPromptForIVRByLanguage) {
81
+ result.items = transformArrayToJson(result.items);
82
+ }
83
+ if (query.getPromptForIVR && !query.getPromptForIVRByLanguage) {
81
84
  result.items = transformArrayToJson(result.items);
82
85
  }
83
86
  if ("filterOptions" in result) {
@@ -94,7 +97,7 @@ class GPMController {
94
97
  edit(data) {
95
98
  return __awaiter(this, void 0, void 0, function* () {
96
99
  try {
97
- const gpmprompt = new CxConfiguratorGPMPromptModel_1.CxConfiguratorGPMPromptModel(data.id, data.name, data.type, data.fileType, data.value, data.language, data.voice, data.hints, data.createdAt, data.updatedAt, data.fileLocation);
100
+ const gpmprompt = new CxConfiguratorGPMPromptModel_1.CxConfiguratorGPMPromptModel(data.id, data.name, data.type, data.fileType, data.value, data.language, data.voice, data.hints, data.createdAt, data.updatedAt);
98
101
  if (gpmprompt.validationMessages.length > 0) {
99
102
  throw gpmprompt.validationMessages;
100
103
  }
@@ -149,3 +152,13 @@ function transformArrayToJson(inputArray) {
149
152
  return acc;
150
153
  }, {});
151
154
  }
155
+ function transformArrayByLanguage(inputArray) {
156
+ return inputArray.reduce((acc, item) => {
157
+ const { name, value, voice, language, type, hints } = item;
158
+ if (!acc[language]) {
159
+ acc[language] = {};
160
+ }
161
+ acc[language][name] = { value, voice, type, hints };
162
+ return acc;
163
+ }, {});
164
+ }
package/package.json CHANGED
@@ -1,56 +1,56 @@
1
- {
2
- "name": "hgs-twilio-class-lib",
3
- "version": "1.1.59",
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.60",
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
+ }