hgs-twilio-class-lib 1.1.57 → 1.1.58
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.
|
@@ -62,7 +62,6 @@ class HoopBusinessHoursController {
|
|
|
62
62
|
itemsPerPage: 200,
|
|
63
63
|
pageNo: 1,
|
|
64
64
|
});
|
|
65
|
-
console.log("-------------------------", profileInfo1.result.items, query.profileName);
|
|
66
65
|
const profilesList = profileInfo1.result.items;
|
|
67
66
|
const isProfileAvailable = profilesList.find((profile) => profile.profileName === query.profileName);
|
|
68
67
|
const profileId = isProfileAvailable.profileId;
|
|
@@ -12,8 +12,7 @@ export declare class CxConfiguratorGPMPromptModel extends BaseModel {
|
|
|
12
12
|
private _hints;
|
|
13
13
|
private _createdAt;
|
|
14
14
|
private _updatedAt;
|
|
15
|
-
|
|
16
|
-
constructor(id: string, name: string, type: PromptWidgetType, fileType: PromptFileType, value: string, language: string | null, voice: string | null, hints: string | null, createdAt: Date | undefined, updatedAt: Date | undefined, fileLocation: string | null);
|
|
15
|
+
constructor(id: string, name: string, type: PromptWidgetType, fileType: PromptFileType, value: string, language: string | null, voice: string | null, hints: string | null, createdAt: Date | undefined, updatedAt: Date | undefined);
|
|
17
16
|
get id(): string;
|
|
18
17
|
set id(value: string);
|
|
19
18
|
get name(): string;
|
|
@@ -34,7 +33,5 @@ export declare class CxConfiguratorGPMPromptModel extends BaseModel {
|
|
|
34
33
|
set createdAt(value: Date | undefined);
|
|
35
34
|
get updatedAt(): Date | undefined;
|
|
36
35
|
set updatedAt(value: Date | undefined);
|
|
37
|
-
get fileLocation(): string | null;
|
|
38
|
-
set fileLocation(value: string | null);
|
|
39
36
|
validateData(): validationMessage[];
|
|
40
37
|
}
|
|
@@ -4,7 +4,7 @@ exports.CxConfiguratorGPMPromptModel = void 0;
|
|
|
4
4
|
const BaseModel_1 = require("../../abstract/BaseModel");
|
|
5
5
|
const uuid_1 = require("uuid");
|
|
6
6
|
class CxConfiguratorGPMPromptModel extends BaseModel_1.BaseModel {
|
|
7
|
-
constructor(id, name, type, fileType, value, language, voice, hints, createdAt, updatedAt
|
|
7
|
+
constructor(id, name, type, fileType, value, language, voice, hints, createdAt, updatedAt) {
|
|
8
8
|
super();
|
|
9
9
|
this._id = id;
|
|
10
10
|
this._name = name;
|
|
@@ -16,7 +16,6 @@ class CxConfiguratorGPMPromptModel extends BaseModel_1.BaseModel {
|
|
|
16
16
|
this._hints = hints;
|
|
17
17
|
this._createdAt = createdAt;
|
|
18
18
|
this._updatedAt = updatedAt;
|
|
19
|
-
this._fileLocation = fileLocation;
|
|
20
19
|
}
|
|
21
20
|
// Getters and Setters
|
|
22
21
|
get id() {
|
|
@@ -79,12 +78,6 @@ class CxConfiguratorGPMPromptModel extends BaseModel_1.BaseModel {
|
|
|
79
78
|
set updatedAt(value) {
|
|
80
79
|
this._updatedAt = value;
|
|
81
80
|
}
|
|
82
|
-
get fileLocation() {
|
|
83
|
-
return this._fileLocation;
|
|
84
|
-
}
|
|
85
|
-
set fileLocation(value) {
|
|
86
|
-
this._fileLocation = value;
|
|
87
|
-
}
|
|
88
81
|
// Validation method
|
|
89
82
|
validateData() {
|
|
90
83
|
console.log(" data in validation method", this);
|
|
@@ -137,10 +130,14 @@ class CxConfiguratorGPMPromptModel extends BaseModel_1.BaseModel {
|
|
|
137
130
|
},
|
|
138
131
|
},
|
|
139
132
|
value: {
|
|
140
|
-
validator: (value) => {
|
|
133
|
+
validator: (value, model) => {
|
|
141
134
|
const errors = [];
|
|
142
|
-
|
|
143
|
-
|
|
135
|
+
const isAudio = model.fileType === "Audio";
|
|
136
|
+
if (isAudio && (value === null || typeof value !== "string" || value.trim() === "")) {
|
|
137
|
+
errors.push("Value is required when fileType is 'Audio'.");
|
|
138
|
+
}
|
|
139
|
+
else if (value !== null && (typeof value !== "string" || value.trim() === "")) {
|
|
140
|
+
errors.push("Value must be a non-empty string or null.");
|
|
144
141
|
}
|
|
145
142
|
else if (value.trim().length < 5) {
|
|
146
143
|
errors.push("Value must be at least 5 characters long.");
|
|
@@ -154,7 +151,7 @@ class CxConfiguratorGPMPromptModel extends BaseModel_1.BaseModel {
|
|
|
154
151
|
: ["Language must be a non-empty string or null."],
|
|
155
152
|
},
|
|
156
153
|
voice: {
|
|
157
|
-
validator: (value) => value === null || (typeof value === "string" && value.trim() !== "")
|
|
154
|
+
validator: (value, model) => value === null || (typeof value === "string" && value.trim() !== "")
|
|
158
155
|
? []
|
|
159
156
|
: ["Voice must be a non-empty string or null."],
|
|
160
157
|
},
|
|
@@ -178,20 +175,7 @@ class CxConfiguratorGPMPromptModel extends BaseModel_1.BaseModel {
|
|
|
178
175
|
? []
|
|
179
176
|
: ["UpdatedAt must be a valid date."];
|
|
180
177
|
},
|
|
181
|
-
}
|
|
182
|
-
fileLocation: {
|
|
183
|
-
validator: (value, model) => {
|
|
184
|
-
const errors = [];
|
|
185
|
-
const isAudio = model.fileType === "Audio";
|
|
186
|
-
if (isAudio && (value === null || typeof value !== "string" || value.trim() === "")) {
|
|
187
|
-
errors.push("FileLocation is required when fileType is 'Audio'.");
|
|
188
|
-
}
|
|
189
|
-
else if (value !== null && (typeof value !== "string" || value.trim() === "")) {
|
|
190
|
-
errors.push("FileLocation must be a non-empty string or null.");
|
|
191
|
-
}
|
|
192
|
-
return errors;
|
|
193
|
-
},
|
|
194
|
-
},
|
|
178
|
+
}
|
|
195
179
|
};
|
|
196
180
|
for (const key in validationRules) {
|
|
197
181
|
if (!validationRules.hasOwnProperty(key))
|