@cognigy/rest-api-client 0.13.2 → 0.14.0
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/CHANGELOG.md +5 -1
- package/build/apigroups/ResourcesAPIGroup_2_0.js +15 -3
- package/build/shared/charts/descriptors/apps/setHtmlAppState.js +83 -13
- package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/azureOpenAIProviderConnection.js +14 -0
- package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/index.js +19 -0
- package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/openAIProviderConnection.js +11 -0
- package/build/shared/charts/descriptors/index.js +8 -5
- package/build/shared/charts/descriptors/message/question/optionalQuestion.js +22 -6
- package/build/shared/charts/descriptors/message/question/question.js +193 -25
- package/build/shared/charts/descriptors/message/say.js +33 -2
- package/build/shared/charts/descriptors/service/completeText.js +316 -0
- package/build/shared/charts/descriptors/service/handoverV2.js +47 -1
- package/build/shared/charts/descriptors/service/index.js +3 -1
- package/build/shared/charts/descriptors/voice/mappers/setSessionConfig.mapper.js +40 -7
- package/build/shared/charts/descriptors/voice/mappers/transfer.mapper.js +93 -32
- package/build/shared/charts/descriptors/voice/nodes/play.js +8 -6
- package/build/shared/charts/descriptors/voice/nodes/sessionSpeechParameters.js +90 -8
- package/build/shared/charts/descriptors/voice/nodes/transfer.js +2 -2
- package/build/shared/charts/descriptors/voice/utils/helper.js +11 -1
- package/build/shared/charts/descriptors/voicegateway/nodes/agentAssist.js +2 -2
- package/build/shared/charts/descriptors/voicegateway2/nodes/play.js +4 -1
- package/build/shared/charts/descriptors/voicegateway2/nodes/refer.js +3 -3
- package/build/shared/charts/descriptors/voicegateway2/nodes/setSessionConfig.js +125 -26
- package/build/shared/charts/descriptors/voicegateway2/nodes/transfer.js +91 -7
- package/build/shared/charts/descriptors/voicegateway2/utils/helper.js +18 -11
- package/build/shared/charts/descriptors/voicegateway2/utils/strip-nulls.js +4 -1
- package/build/shared/charts/helpers/generativeAI/getRephraseWithAIFields.js +100 -0
- package/build/shared/charts/helpers/generativeAI/rephraseSentenceWithAi.js +44 -0
- package/build/shared/constants.js +2 -1
- package/build/shared/interfaces/ai.js +16 -0
- package/build/shared/interfaces/analytics/IAnalyticsDataGoals.js +3 -0
- package/build/shared/interfaces/endpointInterface.js +1 -0
- package/build/shared/interfaces/filemanager/IRuntimeFile.js +30 -0
- package/build/shared/interfaces/filemanager/index.js +1 -0
- package/build/shared/interfaces/handover.js +39 -3
- package/build/shared/interfaces/messageAPI/endpoints.js +2 -0
- package/build/shared/interfaces/messageAPI/handover.js +6 -0
- package/build/shared/interfaces/resources/IConnectionSchema.js +2 -1
- package/build/shared/interfaces/resources/IExtension.js +2 -1
- package/build/shared/interfaces/resources/IFlow.js +2 -1
- package/build/shared/interfaces/resources/ILexicon.js +15 -2
- package/build/shared/interfaces/resources/INodeDescriptorSet.js +1 -1
- package/build/shared/interfaces/resources/intent/IIntent.js +5 -2
- package/build/shared/interfaces/resources/intent/IIntentRelation.js +3 -1
- package/build/shared/interfaces/resources/settings/IAgentSettings.js +9 -4
- package/build/shared/interfaces/resources/settings/IGenerativeAISettings.js +136 -0
- package/build/shared/interfaces/resources/settings/index.js +7 -1
- package/build/shared/interfaces/restAPI/resources/flow/v2.0/sentence/IGenerateSentencesRest_2_0.js +3 -0
- package/package.json +1 -1
- package/types/index.d.ts +569 -184
|
@@ -12,7 +12,7 @@ exports.transferNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
12
12
|
type: "transfer",
|
|
13
13
|
defaultLabel: "Transfer",
|
|
14
14
|
preview: {
|
|
15
|
-
key: "
|
|
15
|
+
key: "transferTarget",
|
|
16
16
|
type: "text",
|
|
17
17
|
},
|
|
18
18
|
appearance: {
|
|
@@ -20,7 +20,26 @@ exports.transferNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
20
20
|
},
|
|
21
21
|
fields: [
|
|
22
22
|
{
|
|
23
|
-
key: "
|
|
23
|
+
key: "transferType",
|
|
24
|
+
label: "Transfer Type",
|
|
25
|
+
type: "select",
|
|
26
|
+
params: {
|
|
27
|
+
options: [
|
|
28
|
+
{
|
|
29
|
+
label: "Refer",
|
|
30
|
+
value: "refer"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
label: "Dial",
|
|
34
|
+
value: "dial"
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
defaultValue: "refer",
|
|
39
|
+
description: "Refer the call or create a new one",
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
key: "transferTarget",
|
|
24
43
|
label: "Target",
|
|
25
44
|
type: "cognigyText",
|
|
26
45
|
params: {
|
|
@@ -29,6 +48,16 @@ exports.transferNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
29
48
|
description: "E.164 syntax or a SIP URI are supported",
|
|
30
49
|
defaultValue: "+49123456789",
|
|
31
50
|
},
|
|
51
|
+
{
|
|
52
|
+
key: "transferReason",
|
|
53
|
+
label: "Reason",
|
|
54
|
+
type: "cognigyText",
|
|
55
|
+
params: {
|
|
56
|
+
required: true,
|
|
57
|
+
},
|
|
58
|
+
description: "Reason for the transfer",
|
|
59
|
+
defaultValue: "Bot initiated a transfer.",
|
|
60
|
+
},
|
|
32
61
|
{
|
|
33
62
|
key: "useTransferSipHeaders",
|
|
34
63
|
label: "Custom Transfer SIP Headers",
|
|
@@ -49,6 +78,37 @@ exports.transferNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
49
78
|
value: true,
|
|
50
79
|
},
|
|
51
80
|
},
|
|
81
|
+
/* Dial specific */
|
|
82
|
+
{
|
|
83
|
+
key: "dialCallerId",
|
|
84
|
+
label: "Caller ID",
|
|
85
|
+
type: "text",
|
|
86
|
+
description: "The caller ID, some carriers like Twilio require a registered number for outgoing calls.",
|
|
87
|
+
condition: {
|
|
88
|
+
key: "transferType",
|
|
89
|
+
value: "dial",
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
key: "dialMusic",
|
|
94
|
+
label: "Dial Music",
|
|
95
|
+
type: "text",
|
|
96
|
+
description: "URL to a .wav or .mp3 audio file of custom audio or ringback to play to the caller while the outbound call is ringing",
|
|
97
|
+
condition: {
|
|
98
|
+
key: "transferType",
|
|
99
|
+
value: "dial",
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
key: "dialTranscriptionWebhook",
|
|
104
|
+
label: "Transcription Webhook",
|
|
105
|
+
type: "text",
|
|
106
|
+
description: "Webhook to receive an HTTP POST when an interim or final transcription is received. Uses the default recognizer.",
|
|
107
|
+
condition: {
|
|
108
|
+
key: "transferType",
|
|
109
|
+
value: "dial",
|
|
110
|
+
},
|
|
111
|
+
}
|
|
52
112
|
],
|
|
53
113
|
sections: [
|
|
54
114
|
{
|
|
@@ -61,7 +121,27 @@ exports.transferNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
61
121
|
form: [
|
|
62
122
|
{
|
|
63
123
|
type: "field",
|
|
64
|
-
key: "
|
|
124
|
+
key: "transferType",
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
type: "field",
|
|
128
|
+
key: "transferReason",
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
type: "field",
|
|
132
|
+
key: "transferTarget",
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
type: "field",
|
|
136
|
+
key: "dialCallerId",
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
type: "field",
|
|
140
|
+
key: "dialMusic",
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
type: "field",
|
|
144
|
+
key: "dialTranscriptionWebhook",
|
|
65
145
|
},
|
|
66
146
|
{
|
|
67
147
|
type: "section",
|
|
@@ -71,16 +151,20 @@ exports.transferNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
71
151
|
summary: "Transfer the call to another target",
|
|
72
152
|
function: async ({ cognigy, config }) => {
|
|
73
153
|
const { api, input } = cognigy;
|
|
74
|
-
const {
|
|
154
|
+
const { transferType, transferTarget, useTransferSipHeaders, transferSipHeaders, transferReason, dialMusic, dialTranscriptionWebhook, dialCallerId } = config;
|
|
75
155
|
const transferParams = {
|
|
76
|
-
|
|
77
|
-
|
|
156
|
+
transferType,
|
|
157
|
+
transferReason,
|
|
158
|
+
transferTarget,
|
|
78
159
|
useTransferSipHeaders,
|
|
79
160
|
transferSipHeaders,
|
|
161
|
+
dialMusic,
|
|
162
|
+
dialCallerId,
|
|
163
|
+
dialTranscriptionWebhook,
|
|
80
164
|
};
|
|
81
165
|
try {
|
|
82
166
|
if (input.channel === "adminconsole") {
|
|
83
|
-
api.say("Transferring a call is not supported in the Interaction Panel, please use the
|
|
167
|
+
api.say("Transferring a call is not supported in the Interaction Panel, please use the VoiceGateway endpoint.", null);
|
|
84
168
|
return;
|
|
85
169
|
}
|
|
86
170
|
if (useTransferSipHeaders &&
|
|
@@ -1,20 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isValidJSON = exports.cleanTarget = void 0;
|
|
4
|
-
function cleanTarget(
|
|
5
|
-
if (
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
function cleanTarget(rawTarget, isPrefixRequired) {
|
|
5
|
+
if (rawTarget.includes("@")) {
|
|
6
|
+
// handle sip refer
|
|
7
|
+
const sip = rawTarget.replace(/\s/g, "");
|
|
8
|
+
if (rawTarget.substring(0, 4) === "sip:")
|
|
8
9
|
return sip;
|
|
9
10
|
return `sip:${sip}`;
|
|
10
11
|
}
|
|
11
|
-
|
|
12
|
-
let
|
|
13
|
-
if (
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
// handle telephone refer
|
|
13
|
+
let processedTarget = rawTarget;
|
|
14
|
+
if (processedTarget.toLowerCase().startsWith("tel:")) {
|
|
15
|
+
// remove "tel:" first
|
|
16
|
+
processedTarget = processedTarget.slice(4);
|
|
17
|
+
}
|
|
18
|
+
// clear up invalid chars
|
|
19
|
+
processedTarget = processedTarget.replace(/\s|\(|\)|\-/g, "");
|
|
20
|
+
if (processedTarget.substring(0, 2) === "00") {
|
|
21
|
+
// replace "00" with "+"
|
|
22
|
+
processedTarget = `+${processedTarget.slice(2)}`;
|
|
23
|
+
}
|
|
24
|
+
return isPrefixRequired ? "tel:" + processedTarget : processedTarget;
|
|
18
25
|
}
|
|
19
26
|
exports.cleanTarget = cleanTarget;
|
|
20
27
|
function isValidJSON(json) {
|
|
@@ -3,7 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.stripNulls = void 0;
|
|
4
4
|
function stripNulls(data) {
|
|
5
5
|
Object.entries(data).forEach(([key, value]) => {
|
|
6
|
-
if (typeof value === "undefined" ||
|
|
6
|
+
if (typeof value === "undefined" ||
|
|
7
|
+
typeof value === null ||
|
|
8
|
+
(typeof value === "string" &&
|
|
9
|
+
value.length == 0)) {
|
|
7
10
|
delete data[key];
|
|
8
11
|
}
|
|
9
12
|
if (typeof value === "object" && (typeof value !== "number" || typeof value !== "string")) {
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRephraseWithAISection = exports.getRephraseWithAIFields = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* @returns The fields for rephraseWithAI
|
|
6
|
+
*/
|
|
7
|
+
const getRephraseWithAIFields = () => {
|
|
8
|
+
const fields = [
|
|
9
|
+
{
|
|
10
|
+
key: "generativeAI_rephraseOutputMode",
|
|
11
|
+
type: "select",
|
|
12
|
+
label: "Rephrase Output",
|
|
13
|
+
params: {
|
|
14
|
+
required: true,
|
|
15
|
+
options: [
|
|
16
|
+
{
|
|
17
|
+
label: "None",
|
|
18
|
+
value: "none"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
label: "Based on Previous User Inputs",
|
|
22
|
+
value: "userInputs"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
label: "Based on Custom Input",
|
|
26
|
+
value: "customInputs"
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
defaultValue: "none",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
key: "generativeAI_amountOfLastUserInputs",
|
|
34
|
+
type: "slider",
|
|
35
|
+
label: "Number of Previous User Inputs",
|
|
36
|
+
params: {
|
|
37
|
+
min: 1,
|
|
38
|
+
max: 10,
|
|
39
|
+
step: 1,
|
|
40
|
+
},
|
|
41
|
+
defaultValue: 5,
|
|
42
|
+
condition: {
|
|
43
|
+
key: "generativeAI_rephraseOutputMode",
|
|
44
|
+
value: "userInputs",
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
key: "generativeAI_customInputs",
|
|
49
|
+
type: "cognigyTextArray",
|
|
50
|
+
label: "Custom Inputs",
|
|
51
|
+
condition: {
|
|
52
|
+
key: "generativeAI_rephraseOutputMode",
|
|
53
|
+
value: "customInputs",
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
key: "generativeAI_temperature",
|
|
58
|
+
type: "slider",
|
|
59
|
+
label: "Temperature",
|
|
60
|
+
params: {
|
|
61
|
+
min: 0,
|
|
62
|
+
max: 1,
|
|
63
|
+
step: 0.1,
|
|
64
|
+
},
|
|
65
|
+
defaultValue: 0.7,
|
|
66
|
+
condition: {
|
|
67
|
+
or: [
|
|
68
|
+
{
|
|
69
|
+
key: "generativeAI_rephraseOutputMode",
|
|
70
|
+
value: "userInputs",
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
key: "generativeAI_rephraseOutputMode",
|
|
74
|
+
value: "customInputs",
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
];
|
|
80
|
+
return fields;
|
|
81
|
+
};
|
|
82
|
+
exports.getRephraseWithAIFields = getRephraseWithAIFields;
|
|
83
|
+
/**
|
|
84
|
+
* @returns The section for rephraseWithAI
|
|
85
|
+
*/
|
|
86
|
+
const getRephraseWithAISection = () => {
|
|
87
|
+
return {
|
|
88
|
+
key: "aiEnhancedOutput",
|
|
89
|
+
label: "AI-enhanced output",
|
|
90
|
+
defaultCollapsed: true,
|
|
91
|
+
fields: [
|
|
92
|
+
"generativeAI_rephraseOutputMode",
|
|
93
|
+
"generativeAI_amountOfLastUserInputs",
|
|
94
|
+
"generativeAI_customInputs",
|
|
95
|
+
"generativeAI_temperature",
|
|
96
|
+
]
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
exports.getRephraseWithAISection = getRephraseWithAISection;
|
|
100
|
+
//# sourceMappingURL=getRephraseWithAIFields.js.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.rephraseMultipleSentencesWithAI = exports.rephraseSentenceWithAI = void 0;
|
|
4
|
+
const rephraseSentenceWithAI = async (sentence, config, api, organisationId) => {
|
|
5
|
+
const { generativeAI_rephraseOutputMode } = config;
|
|
6
|
+
if (generativeAI_rephraseOutputMode === "userInputs" || generativeAI_rephraseOutputMode === "customInputs") {
|
|
7
|
+
sentence = await api.rephraseSentenceWithAI(sentence, createRephraseSentenceWithAIOptions(config));
|
|
8
|
+
}
|
|
9
|
+
return sentence;
|
|
10
|
+
};
|
|
11
|
+
exports.rephraseSentenceWithAI = rephraseSentenceWithAI;
|
|
12
|
+
const rephraseMultipleSentencesWithAI = async (sentences, config, api, organisationId) => {
|
|
13
|
+
const { generativeAI_rephraseOutputMode, generativeAI_amountOfLastUserInputs, generativeAI_customInputs, generativeAI_temperature } = config;
|
|
14
|
+
if (generativeAI_rephraseOutputMode === "userInputs" || generativeAI_rephraseOutputMode === "customInputs") {
|
|
15
|
+
sentences = await api.rephraseMultipleSentencesWithAI(sentences, createRephraseSentenceWithAIOptions(config));
|
|
16
|
+
}
|
|
17
|
+
return sentences;
|
|
18
|
+
};
|
|
19
|
+
exports.rephraseMultipleSentencesWithAI = rephraseMultipleSentencesWithAI;
|
|
20
|
+
const createRephraseSentenceWithAIOptions = (params) => {
|
|
21
|
+
const options = {
|
|
22
|
+
promptType: params.promtType,
|
|
23
|
+
questionType: params.questionType,
|
|
24
|
+
temperature: params.generativeAI_temperature,
|
|
25
|
+
question: params.question,
|
|
26
|
+
answer: params.answer,
|
|
27
|
+
};
|
|
28
|
+
switch (params.generativeAI_rephraseOutputMode) {
|
|
29
|
+
case "none":
|
|
30
|
+
break;
|
|
31
|
+
case "userInputs":
|
|
32
|
+
options.useLastUserInputs = true;
|
|
33
|
+
options.amountOfUserInputs = params.generativeAI_amountOfLastUserInputs;
|
|
34
|
+
return options;
|
|
35
|
+
case "customInputs":
|
|
36
|
+
options.useLastUserInputs = false;
|
|
37
|
+
options.customInputs = params.generativeAI_customInputs;
|
|
38
|
+
return options;
|
|
39
|
+
default:
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
return {};
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=rephraseSentenceWithAi.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ADMIN_CONSOLE_URL_TOKEN = exports.X_COGNIGY_ORIGIN = exports.EMBEDDED_EXTENSION = exports.INTERNAL_STORAGE_PROVIDER_EXTENSION = exports.VOICE_GATEWAY_2_EXTENSION = exports.MICROSOFT_EXTENSION = exports.VOICE_GATEWAY_EXTENSION = exports.SMTP_EXTENSION = exports.SQL_EXTENSION = exports.MONGO_DB_EXTENSION = exports.BASIC_EXTENSION = exports.MAX_INT32 = exports.PASSWORD_RESET_TOKEN_TTL_IN_SECONDS = exports.SCOPED_USER = exports.SYSTEM_EMAIL = exports.SYSTEM = exports.CREATED_BY_SSO = void 0;
|
|
3
|
+
exports.GENERATIVE_AI_PROVIDER_EXTENSION = exports.ADMIN_CONSOLE_URL_TOKEN = exports.X_COGNIGY_ORIGIN = exports.EMBEDDED_EXTENSION = exports.INTERNAL_STORAGE_PROVIDER_EXTENSION = exports.VOICE_GATEWAY_2_EXTENSION = exports.MICROSOFT_EXTENSION = exports.VOICE_GATEWAY_EXTENSION = exports.SMTP_EXTENSION = exports.SQL_EXTENSION = exports.MONGO_DB_EXTENSION = exports.BASIC_EXTENSION = exports.MAX_INT32 = exports.PASSWORD_RESET_TOKEN_TTL_IN_SECONDS = exports.SCOPED_USER = exports.SYSTEM_EMAIL = exports.SYSTEM = exports.CREATED_BY_SSO = void 0;
|
|
4
4
|
exports.CREATED_BY_SSO = "000000000000000000000550";
|
|
5
5
|
exports.SYSTEM = "000000000000000000000000";
|
|
6
6
|
exports.SYSTEM_EMAIL = "system@mail.com";
|
|
@@ -20,4 +20,5 @@ exports.INTERNAL_STORAGE_PROVIDER_EXTENSION = "@cognigy/internal-storage-provide
|
|
|
20
20
|
exports.EMBEDDED_EXTENSION = "@embedded/";
|
|
21
21
|
exports.X_COGNIGY_ORIGIN = "x-cognigy-origin";
|
|
22
22
|
exports.ADMIN_CONSOLE_URL_TOKEN = "ffffffffffffffffffff55555555555555555eeeeeeeeeeeeeeeaaaaaaaaaaaa";
|
|
23
|
+
exports.GENERATIVE_AI_PROVIDER_EXTENSION = "@cognigy/generative-ai-provider";
|
|
23
24
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1,3 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AzureOpenAiModels = exports.OpenAiModels = void 0;
|
|
4
|
+
var OpenAiModels;
|
|
5
|
+
(function (OpenAiModels) {
|
|
6
|
+
OpenAiModels["davinci"] = "text-davinci-003";
|
|
7
|
+
OpenAiModels["curie"] = "text-curie-001";
|
|
8
|
+
OpenAiModels["babbage"] = "text-babbage-001";
|
|
9
|
+
OpenAiModels["ada"] = "text-ada-001";
|
|
10
|
+
})(OpenAiModels = exports.OpenAiModels || (exports.OpenAiModels = {}));
|
|
11
|
+
var AzureOpenAiModels;
|
|
12
|
+
(function (AzureOpenAiModels) {
|
|
13
|
+
AzureOpenAiModels["davinci3"] = "text-davinci-003";
|
|
14
|
+
AzureOpenAiModels["davinci2"] = "text-davinci-002";
|
|
15
|
+
AzureOpenAiModels["curie"] = "text-curie-001";
|
|
16
|
+
AzureOpenAiModels["babbage"] = "text-babbage-001";
|
|
17
|
+
AzureOpenAiModels["ada"] = "text-ada-001";
|
|
18
|
+
})(AzureOpenAiModels = exports.AzureOpenAiModels || (exports.AzureOpenAiModels = {}));
|
|
3
19
|
//# sourceMappingURL=ai.js.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runtimeFileQuerySchema = exports.runtimeFileSchema = exports.runtimeFileStatus = void 0;
|
|
4
|
+
/* Custom modules */
|
|
5
|
+
const createQuerySchema_1 = require("../../helper/createQuerySchema");
|
|
6
|
+
exports.runtimeFileStatus = [
|
|
7
|
+
"infected",
|
|
8
|
+
"scanned", // we have scanned the file and it is not infected
|
|
9
|
+
];
|
|
10
|
+
exports.runtimeFileSchema = {
|
|
11
|
+
title: "runtimeFileSchema",
|
|
12
|
+
type: "object",
|
|
13
|
+
additionalProperties: false,
|
|
14
|
+
required: [
|
|
15
|
+
"projectId",
|
|
16
|
+
"organisationId",
|
|
17
|
+
],
|
|
18
|
+
properties: {
|
|
19
|
+
_id: { type: "string", format: "mongo-id" },
|
|
20
|
+
name: { type: "string" },
|
|
21
|
+
mimeType: { type: "string" },
|
|
22
|
+
size: { type: "number" },
|
|
23
|
+
storageConnection: { type: "string", format: "uuid" },
|
|
24
|
+
status: { type: "string", enum: [...exports.runtimeFileStatus] },
|
|
25
|
+
projectId: { type: "string", format: "mongo-id" },
|
|
26
|
+
organisationId: { type: "string", format: "mongo-id" }
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
exports.runtimeFileQuerySchema = (0, createQuerySchema_1.createQuerySchema)("runtimeFileQuerySchema", exports.runtimeFileSchema);
|
|
30
|
+
//# sourceMappingURL=IRuntimeFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.genesysCloudSettingsSchema = exports.liveAgentSettingsSchema = exports.salesforceSettingsSchema = exports.chatwootSettingsSchema = exports.handoverAgentReplySchema = exports.rceSettingsSchema = exports.foreignSessionDataSchema = exports.handoverSettingsSchema = exports.whisperAssistConfigurations = exports.handoverProviders = exports.internalHandoverProviders = exports.externalHandoverProviders = void 0;
|
|
3
|
+
exports.genesysCloudSettingsSchema = exports.liveAgentSettingsSchema = exports.salesforceSettingsSchema = exports.chatwootSettingsSchema = exports.handoverAgentReplySchema = exports.eightByEightSettingsSchema = exports.rceSettingsSchema = exports.foreignSessionDataSchema = exports.handoverRequestSettingsSchema = exports.handoverSettingsSchema = exports.whisperAssistConfigurations = exports.handoverProviders = exports.internalHandoverProviders = exports.externalHandoverProviders = void 0;
|
|
4
4
|
exports.externalHandoverProviders = [
|
|
5
5
|
"rce",
|
|
6
6
|
"chatwoot",
|
|
7
7
|
"salesforce",
|
|
8
8
|
"liveAgent",
|
|
9
|
-
"genesysCloud"
|
|
9
|
+
"genesysCloud",
|
|
10
|
+
"eightByEight",
|
|
10
11
|
];
|
|
11
12
|
exports.internalHandoverProviders = [
|
|
12
13
|
"cognigy",
|
|
@@ -28,7 +29,7 @@ exports.handoverSettingsSchema = {
|
|
|
28
29
|
properties: {
|
|
29
30
|
provider: {
|
|
30
31
|
type: "string",
|
|
31
|
-
enum: ["none", "chatwoot", "cognigy", "rce", "salesforce", "liveAgent", "genesysCloud"]
|
|
32
|
+
enum: ["none", "chatwoot", "cognigy", "rce", "salesforce", "liveAgent", "genesysCloud", "eightByEight"]
|
|
32
33
|
},
|
|
33
34
|
providerSettings: {
|
|
34
35
|
type: "object",
|
|
@@ -40,6 +41,7 @@ exports.handoverSettingsSchema = {
|
|
|
40
41
|
accountId: { type: "string" },
|
|
41
42
|
baseUrl: { type: "string" },
|
|
42
43
|
apiKey: { type: "string" },
|
|
44
|
+
apiTenant: { type: "string" },
|
|
43
45
|
usePlatformToken: { type: "boolean" },
|
|
44
46
|
forwardOnlyHandoverConversations: { type: "boolean" },
|
|
45
47
|
apiAccessToken: { type: "string" },
|
|
@@ -76,6 +78,14 @@ exports.handoverSettingsSchema = {
|
|
|
76
78
|
}
|
|
77
79
|
}
|
|
78
80
|
};
|
|
81
|
+
exports.handoverRequestSettingsSchema = {
|
|
82
|
+
title: "handoverRequestSettingsSchema",
|
|
83
|
+
type: "object",
|
|
84
|
+
additionalProperties: false,
|
|
85
|
+
properties: {
|
|
86
|
+
additionalCategoryIds: { type: "array" }
|
|
87
|
+
}
|
|
88
|
+
};
|
|
79
89
|
exports.foreignSessionDataSchema = {
|
|
80
90
|
title: "foreignSettingsDataSchema",
|
|
81
91
|
type: "object",
|
|
@@ -130,6 +140,32 @@ exports.rceSettingsSchema = {
|
|
|
130
140
|
}
|
|
131
141
|
}
|
|
132
142
|
};
|
|
143
|
+
exports.eightByEightSettingsSchema = {
|
|
144
|
+
"title": "eightByEightSettingsSchema",
|
|
145
|
+
"type": "object",
|
|
146
|
+
"additionalProperties": false,
|
|
147
|
+
"required": [
|
|
148
|
+
"baseUrl",
|
|
149
|
+
"apiKey",
|
|
150
|
+
"apiTenant"
|
|
151
|
+
],
|
|
152
|
+
"properties": {
|
|
153
|
+
"baseUrl": {
|
|
154
|
+
"type": "string",
|
|
155
|
+
"format": "url"
|
|
156
|
+
},
|
|
157
|
+
"apiKey": {
|
|
158
|
+
"type": "string"
|
|
159
|
+
},
|
|
160
|
+
"apiTenant": {
|
|
161
|
+
"type": "string",
|
|
162
|
+
"maxLength": 255
|
|
163
|
+
},
|
|
164
|
+
"forwardOnlyHandoverConversations": {
|
|
165
|
+
"type": "boolean"
|
|
166
|
+
},
|
|
167
|
+
}
|
|
168
|
+
};
|
|
133
169
|
exports.handoverAgentReplySchema = {
|
|
134
170
|
"required": ["sessionId", "message"],
|
|
135
171
|
"type": "object",
|
|
@@ -229,6 +229,8 @@ exports.anyEndpointSettingsSchema = {
|
|
|
229
229
|
enableSTT: { type: "boolean" },
|
|
230
230
|
enableTTS: { type: "boolean" },
|
|
231
231
|
enableTypingIndicator: { type: "boolean" },
|
|
232
|
+
enableFileAttachment: { type: "boolean" },
|
|
233
|
+
fileAttachmentMaxSize: { type: "number" },
|
|
232
234
|
facebookPageToken: { type: "string" },
|
|
233
235
|
finishOnKey: {
|
|
234
236
|
type: "string",
|
|
@@ -65,6 +65,9 @@ exports.createHandoverRequestDataSchema = {
|
|
|
65
65
|
"foreignSessionData": {
|
|
66
66
|
"type": "object"
|
|
67
67
|
},
|
|
68
|
+
"settings": {
|
|
69
|
+
"type": "object"
|
|
70
|
+
},
|
|
68
71
|
"foreignSessionId": {
|
|
69
72
|
"type": "string"
|
|
70
73
|
},
|
|
@@ -160,6 +163,9 @@ exports.sendMessageToProviderSchema = {
|
|
|
160
163
|
"sessionId": {
|
|
161
164
|
"type": "string"
|
|
162
165
|
},
|
|
166
|
+
"projectId": {
|
|
167
|
+
"type": "string"
|
|
168
|
+
},
|
|
163
169
|
"messages": {
|
|
164
170
|
"type": "array",
|
|
165
171
|
"items": {
|
|
@@ -21,7 +21,7 @@ exports.flowInDBSchema = {
|
|
|
21
21
|
title: "flowInDBSchema",
|
|
22
22
|
type: "object",
|
|
23
23
|
additionalProperties: false,
|
|
24
|
-
properties: Object.assign(Object.assign({}, IEntityMeta_1.entityMetaSchema.properties), { attachedFlows: { type: "array", additionalItems: { type: "string", format: "mongo-id" } }, localizedData: { type: "array", items: exports.localizedFlowDataSchema }, context: {}, img: { type: "string" }, name: { type: "string", format: "resource-name" }, chartReference: { type: "string", format: "mongo-id" }, projectReference: { type: "string", format: "mongo-id" }, organisationReference: { type: "string", format: "mongo-id" }, referenceId: { type: "string", format: "uuid" } }),
|
|
24
|
+
properties: Object.assign(Object.assign({}, IEntityMeta_1.entityMetaSchema.properties), { attachedFlows: { type: "array", additionalItems: { type: "string", format: "mongo-id" } }, localizedData: { type: "array", items: exports.localizedFlowDataSchema }, context: {}, img: { type: "string" }, name: { type: "string", format: "resource-name" }, description: { type: "string", format: "resource-description" }, chartReference: { type: "string", format: "mongo-id" }, projectReference: { type: "string", format: "mongo-id" }, organisationReference: { type: "string", format: "mongo-id" }, referenceId: { type: "string", format: "uuid" } }),
|
|
25
25
|
};
|
|
26
26
|
const generateFlowRedisKeys = (data) => {
|
|
27
27
|
return [
|
|
@@ -40,6 +40,7 @@ exports.flowDataSchema = {
|
|
|
40
40
|
context: {},
|
|
41
41
|
img: { type: "string" },
|
|
42
42
|
name: { type: "string", format: "resource-name" },
|
|
43
|
+
description: { type: "string", format: "resource-description" },
|
|
43
44
|
}
|
|
44
45
|
};
|
|
45
46
|
exports.flowSchema = {
|
|
@@ -1,17 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.generateExportFromLexiconRedisKeys = exports.lexiconQuerySchema = exports.lexiconSchema = exports.lexiconDataSchema = void 0;
|
|
3
|
+
exports.generateExportFromLexiconRedisKeys = exports.lexiconQuerySchema = exports.lexiconSchema = exports.lexiconDataSchema = exports.lexiconGenerationSchema = void 0;
|
|
4
4
|
/* Custom Modules */
|
|
5
5
|
const createQuerySchema_1 = require("../../helper/createQuerySchema");
|
|
6
6
|
/* Interfaces & Types */
|
|
7
7
|
const IEntityMeta_1 = require("./IEntityMeta");
|
|
8
|
+
exports.lexiconGenerationSchema = {
|
|
9
|
+
title: "lexiconGenerationSchema",
|
|
10
|
+
type: "object",
|
|
11
|
+
additionalProperties: false,
|
|
12
|
+
minProperties: 1,
|
|
13
|
+
properties: {
|
|
14
|
+
shouldGenerateLexiconEntries: { type: "boolean" },
|
|
15
|
+
generateLexiconEntriesLimit: { type: "number" },
|
|
16
|
+
defaultSlot: { type: "string" },
|
|
17
|
+
languageCode: { type: "string" }
|
|
18
|
+
}
|
|
19
|
+
};
|
|
8
20
|
exports.lexiconDataSchema = {
|
|
9
21
|
title: "lexiconDataSchema",
|
|
10
22
|
type: "object",
|
|
11
23
|
additionalProperties: false,
|
|
12
24
|
minProperties: 1,
|
|
13
25
|
properties: {
|
|
14
|
-
name: { type: "string", format: "resource-name" }
|
|
26
|
+
name: { type: "string", format: "resource-name" },
|
|
27
|
+
description: { type: "string", format: "resource-description" },
|
|
15
28
|
}
|
|
16
29
|
};
|
|
17
30
|
exports.lexiconSchema = {
|