@cognigy/rest-api-client 4.94.0 → 4.96.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 +10 -0
- package/build/shared/charts/descriptors/analytics/addMemory.js +1 -1
- package/build/shared/charts/descriptors/knowledgeSearch/searchExtractOutput.js +9 -1
- package/build/shared/charts/descriptors/service/GPTPrompt.js +10 -2
- package/build/shared/charts/descriptors/service/aiAgent/aiAgentJob.js +158 -37
- package/build/shared/charts/descriptors/voice/mappers/transfer.mapper.js +4 -1
- package/build/shared/charts/descriptors/voice/nodes/bargeIn.js +1 -1
- package/build/shared/charts/descriptors/voice/nodes/continuousAsr.js +1 -1
- package/build/shared/charts/descriptors/voice/nodes/dtmf.js +1 -1
- package/build/shared/charts/descriptors/voice/nodes/hangup.js +1 -1
- package/build/shared/charts/descriptors/voice/nodes/muteSpeechInput.js +1 -1
- package/build/shared/charts/descriptors/voice/nodes/noUserInput.js +1 -1
- package/build/shared/charts/descriptors/voice/nodes/play.js +1 -1
- package/build/shared/charts/descriptors/voice/nodes/sendMetadata.js +1 -1
- package/build/shared/charts/descriptors/voice/nodes/sessionSpeechParameters.js +1 -1
- package/build/shared/charts/descriptors/voice/nodes/transfer.js +1 -1
- package/build/shared/charts/descriptors/voicegateway2/nodes/dtmf.js +1 -1
- package/build/shared/charts/descriptors/voicegateway2/nodes/hangup.js +1 -1
- package/build/shared/charts/descriptors/voicegateway2/nodes/muteSpeechInput.js +1 -1
- package/build/shared/charts/descriptors/voicegateway2/nodes/play.js +1 -1
- package/build/shared/charts/descriptors/voicegateway2/nodes/record.js +1 -1
- package/build/shared/charts/descriptors/voicegateway2/nodes/refer.js +1 -1
- package/build/shared/charts/descriptors/voicegateway2/nodes/sendMetadata.js +1 -1
- package/build/shared/charts/descriptors/voicegateway2/nodes/setSessionConfig.js +1 -1
- package/build/shared/charts/descriptors/voicegateway2/nodes/transfer.js +47 -2
- package/build/shared/constants.js +10 -1
- package/build/shared/helper/nlu/textCleaner.js +10 -2
- package/build/shared/interfaces/IProfile.js +1 -0
- package/build/shared/interfaces/IProfileSchema.js +5 -0
- package/build/shared/interfaces/generativeAI/IGenerativeAIModels.js +1 -0
- package/build/shared/interfaces/messageAPI/endpoints.js +2 -0
- package/build/shared/interfaces/messageAPI/handover.js +3 -3
- package/build/shared/interfaces/resources/IAiAgent.js +10 -0
- package/build/shared/interfaces/resources/IConnection.js +3 -2
- package/build/shared/interfaces/resources/IGlobalResource.js +3 -0
- package/build/shared/interfaces/resources/ILargeLanguageModel.js +10 -1
- package/build/shared/interfaces/resources/intent/IDefaultReply.js +0 -1
- package/dist/esm/shared/charts/descriptors/analytics/addMemory.js +1 -1
- package/dist/esm/shared/charts/descriptors/knowledgeSearch/searchExtractOutput.js +9 -1
- package/dist/esm/shared/charts/descriptors/service/GPTPrompt.js +10 -2
- package/dist/esm/shared/charts/descriptors/service/aiAgent/aiAgentJob.js +158 -37
- package/dist/esm/shared/charts/descriptors/voice/mappers/transfer.mapper.js +4 -1
- package/dist/esm/shared/charts/descriptors/voice/nodes/bargeIn.js +1 -1
- package/dist/esm/shared/charts/descriptors/voice/nodes/continuousAsr.js +1 -1
- package/dist/esm/shared/charts/descriptors/voice/nodes/dtmf.js +1 -1
- package/dist/esm/shared/charts/descriptors/voice/nodes/hangup.js +1 -1
- package/dist/esm/shared/charts/descriptors/voice/nodes/muteSpeechInput.js +1 -1
- package/dist/esm/shared/charts/descriptors/voice/nodes/noUserInput.js +1 -1
- package/dist/esm/shared/charts/descriptors/voice/nodes/play.js +1 -1
- package/dist/esm/shared/charts/descriptors/voice/nodes/sendMetadata.js +1 -1
- package/dist/esm/shared/charts/descriptors/voice/nodes/sessionSpeechParameters.js +1 -1
- package/dist/esm/shared/charts/descriptors/voice/nodes/transfer.js +1 -1
- package/dist/esm/shared/charts/descriptors/voicegateway2/nodes/dtmf.js +1 -1
- package/dist/esm/shared/charts/descriptors/voicegateway2/nodes/hangup.js +1 -1
- package/dist/esm/shared/charts/descriptors/voicegateway2/nodes/muteSpeechInput.js +1 -1
- package/dist/esm/shared/charts/descriptors/voicegateway2/nodes/play.js +1 -1
- package/dist/esm/shared/charts/descriptors/voicegateway2/nodes/record.js +1 -1
- package/dist/esm/shared/charts/descriptors/voicegateway2/nodes/refer.js +1 -1
- package/dist/esm/shared/charts/descriptors/voicegateway2/nodes/sendMetadata.js +1 -1
- package/dist/esm/shared/charts/descriptors/voicegateway2/nodes/setSessionConfig.js +1 -1
- package/dist/esm/shared/charts/descriptors/voicegateway2/nodes/transfer.js +47 -2
- package/dist/esm/shared/constants.js +9 -0
- package/dist/esm/shared/helper/nlu/textCleaner.js +10 -2
- package/dist/esm/shared/interfaces/IProfile.js +1 -0
- package/dist/esm/shared/interfaces/IProfileSchema.js +5 -0
- package/dist/esm/shared/interfaces/generativeAI/IGenerativeAIModels.js +1 -0
- package/dist/esm/shared/interfaces/messageAPI/endpoints.js +2 -0
- package/dist/esm/shared/interfaces/messageAPI/handover.js +2 -2
- package/dist/esm/shared/interfaces/resources/IAiAgent.js +10 -0
- package/dist/esm/shared/interfaces/resources/IConnection.js +3 -2
- package/dist/esm/shared/interfaces/resources/IGlobalResource.js +2 -0
- package/dist/esm/shared/interfaces/resources/ILargeLanguageModel.js +10 -1
- package/dist/esm/shared/interfaces/resources/intent/IDefaultReply.js +0 -1
- package/package.json +2 -2
- package/types/index.d.ts +264 -95
|
@@ -16,7 +16,7 @@ export const transferNode = createNodeDescriptor({
|
|
|
16
16
|
appearance: {
|
|
17
17
|
color: nodeColor,
|
|
18
18
|
},
|
|
19
|
-
tags: ["
|
|
19
|
+
tags: ["voice"],
|
|
20
20
|
fields: [
|
|
21
21
|
{
|
|
22
22
|
key: "transferType",
|
|
@@ -155,6 +155,39 @@ export const transferNode = createNodeDescriptor({
|
|
|
155
155
|
max: 300
|
|
156
156
|
}
|
|
157
157
|
},
|
|
158
|
+
{
|
|
159
|
+
key: "enableTimeLimit",
|
|
160
|
+
label: "UI__NODE_EDITOR__TRANSFER__FIELDS__ENABLE_DURATION_LIMIT__LABEL",
|
|
161
|
+
type: "toggle",
|
|
162
|
+
description: "UI__NODE_EDITOR__TRANSFER__FIELDS__ENABLE_DURATION_LIMIT__DESCRIPTION",
|
|
163
|
+
condition: {
|
|
164
|
+
key: "transferType",
|
|
165
|
+
value: "dial"
|
|
166
|
+
},
|
|
167
|
+
defaultValue: false,
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
key: "timeLimit",
|
|
171
|
+
label: "UI__NODE_EDITOR__TRANSFER__FIELDS__DURATION_LIMIT__LABEL",
|
|
172
|
+
type: "number",
|
|
173
|
+
description: "UI__NODE_EDITOR__TRANSFER__FIELDS__DURATION_LIMIT__DESCRIPTION",
|
|
174
|
+
condition: {
|
|
175
|
+
and: [
|
|
176
|
+
{
|
|
177
|
+
key: "transferType",
|
|
178
|
+
value: "dial"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
key: "enableTimeLimit",
|
|
182
|
+
value: true
|
|
183
|
+
},
|
|
184
|
+
]
|
|
185
|
+
},
|
|
186
|
+
defaultValue: 600,
|
|
187
|
+
params: {
|
|
188
|
+
max: 12000
|
|
189
|
+
}
|
|
190
|
+
},
|
|
158
191
|
{
|
|
159
192
|
key: "agentAssistEnabled",
|
|
160
193
|
label: "UI__NODE_EDITOR__TRANSFER__FIELDS__AGENT_ASSIST_ENABLED__LABEL",
|
|
@@ -459,6 +492,14 @@ export const transferNode = createNodeDescriptor({
|
|
|
459
492
|
type: "field",
|
|
460
493
|
key: "dialTimeout"
|
|
461
494
|
},
|
|
495
|
+
{
|
|
496
|
+
type: "field",
|
|
497
|
+
key: "enableTimeLimit"
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
type: "field",
|
|
501
|
+
key: "timeLimit"
|
|
502
|
+
},
|
|
462
503
|
{
|
|
463
504
|
type: "field",
|
|
464
505
|
key: "agentAssistEnabled"
|
|
@@ -483,7 +524,7 @@ export const transferNode = createNodeDescriptor({
|
|
|
483
524
|
summary: "UI__NODE_EDITOR__VOICEGATEWAY2__TRANSFER__SUMMARY",
|
|
484
525
|
function: ({ cognigy, config, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
485
526
|
const { api, input } = cognigy;
|
|
486
|
-
const { transferType, transferTarget, referredBy, anchorMedia, useTransferSipHeaders, transferSipHeaders = {}, transferReason, dialMusic, dialTranscriptionWebhook, dialCallerId, recognitionChannel, sttVendor, sttLanguage, sttDisablePunctuation, dialTimeout, amdEnabled, amdRedirectOnMachineDetected, amdRedirectText, sttLabel, googleModel, sttDeepgramModel, deepgramEndpointing, deepgramEndpointingValue, deepgramSmartFormatting, agentAssistEnabled, agentAssistHeadersKey = customHeaderDefaultValue } = config;
|
|
527
|
+
const { transferType, transferTarget, referredBy, anchorMedia, useTransferSipHeaders, transferSipHeaders = {}, transferReason, dialMusic, dialTranscriptionWebhook, dialCallerId, recognitionChannel, sttVendor, sttLanguage, sttDisablePunctuation, dialTimeout, enableTimeLimit, timeLimit, amdEnabled, amdRedirectOnMachineDetected, amdRedirectText, sttLabel, googleModel, sttDeepgramModel, deepgramEndpointing, deepgramEndpointingValue, deepgramSmartFormatting, agentAssistEnabled, agentAssistHeadersKey = customHeaderDefaultValue } = config;
|
|
487
528
|
const transferParams = {
|
|
488
529
|
transferType,
|
|
489
530
|
transferReason,
|
|
@@ -498,6 +539,7 @@ export const transferNode = createNodeDescriptor({
|
|
|
498
539
|
amdRedirectOnMachineDetected,
|
|
499
540
|
amdRedirectText,
|
|
500
541
|
dialTimeout,
|
|
542
|
+
timeLimit,
|
|
501
543
|
sttLabel,
|
|
502
544
|
};
|
|
503
545
|
try {
|
|
@@ -509,6 +551,9 @@ export const transferNode = createNodeDescriptor({
|
|
|
509
551
|
yield api.say(textWarningAdminChannel, null);
|
|
510
552
|
return;
|
|
511
553
|
}
|
|
554
|
+
if (!enableTimeLimit) {
|
|
555
|
+
delete transferParams.timeLimit;
|
|
556
|
+
}
|
|
512
557
|
if (agentAssistEnabled && dialTranscriptionWebhook) {
|
|
513
558
|
try {
|
|
514
559
|
const agentAssistConfigId = api.getAgentAssistConfigId();
|
|
@@ -50,4 +50,13 @@ export const IP_NOT_AVAILABLE = "not available";
|
|
|
50
50
|
* Number of seconds in one minute.
|
|
51
51
|
*/
|
|
52
52
|
export const SECONDS_PER_MINUTE = 60;
|
|
53
|
+
// Platform provided LLM
|
|
54
|
+
export const PLATFORM_PROVIDED_LLM_USE_CASES = [
|
|
55
|
+
"intentSentenceGeneration",
|
|
56
|
+
"flowGeneration",
|
|
57
|
+
"lexiconGeneration",
|
|
58
|
+
"generateNodeOutput",
|
|
59
|
+
];
|
|
60
|
+
export const PLATFORM_PROVIDED_LLM_ID = "aaaaaaaa-aaaa-aaaa-aaaa-000000000000";
|
|
61
|
+
export const PLATFORM_PROVIDED_LLM_CONNECTION_ID = "aaaaaaaa-aaaa-aaaa-aaaa-000000000001";
|
|
53
62
|
//# sourceMappingURL=constants.js.map
|
|
@@ -173,9 +173,17 @@ export class TextCleaner {
|
|
|
173
173
|
for (let phraseToDetect of Object.keys(this.dictSpecials)) {
|
|
174
174
|
// make phrase regex-safe
|
|
175
175
|
phraseToDetect = phraseToDetect.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
|
|
176
|
-
|
|
176
|
+
// check if phraseToDetect is a single special character (e.g., *, ., +)
|
|
177
|
+
const isSpecialChar = /^[-\/\\^$*+?.()|[\]{}#]$/.test(phraseToDetect.replace(/\\/g, '')); // Remove escaping before testing
|
|
178
|
+
// for special characters like '*', don't use word boundaries since they can appear between numbers
|
|
179
|
+
// for normal words like "hello", use word boundaries (\b) to match whole words only
|
|
180
|
+
const regexPattern = isSpecialChar
|
|
181
|
+
? `(${phraseToDetect})` // Match special char anywhere (e.g., in "8*4")
|
|
182
|
+
: `\\b(${phraseToDetect})\\b`; // Match whole words only (e.g., not "hello" in "hello123")
|
|
183
|
+
const matches = normalizedPhrase.match(new RegExp(regexPattern, 'gi'));
|
|
177
184
|
if (matches) {
|
|
178
|
-
normalizedPhrase = normalizedPhrase.replace(new RegExp(
|
|
185
|
+
normalizedPhrase = normalizedPhrase.replace(new RegExp(regexPattern, "gi"), this.dictSpecials[phraseToDetect.replace(/\\/g, '')] // Remove escaping to get original key
|
|
186
|
+
);
|
|
179
187
|
}
|
|
180
188
|
}
|
|
181
189
|
return normalizedPhrase;
|
|
@@ -10,6 +10,7 @@ export const profileDataSchema = {
|
|
|
10
10
|
properties: {
|
|
11
11
|
active: { type: "boolean" },
|
|
12
12
|
contactIds: { type: "array", items: { type: "string" }, additionalItems: false, minItems: 1 },
|
|
13
|
+
contactIdsHash: { type: "string" },
|
|
13
14
|
expiresAt: { type: "object" },
|
|
14
15
|
profile: {},
|
|
15
16
|
},
|
|
@@ -21,6 +21,11 @@ export const profileSchemaSchema = {
|
|
|
21
21
|
},
|
|
22
22
|
} }),
|
|
23
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* WARNING!!
|
|
26
|
+
* make sure to update the default values for the profile mongoose model in the models/profiles.ts file
|
|
27
|
+
* when changing the profile schema and the default profile object below
|
|
28
|
+
*/
|
|
24
29
|
export const defaultProfile = {
|
|
25
30
|
firstname: "",
|
|
26
31
|
lastname: "",
|
|
@@ -135,6 +135,8 @@ const callFailoverSettingsSchema = {
|
|
|
135
135
|
dialCallerId: { type: "string" },
|
|
136
136
|
dialMusic: { type: "string" },
|
|
137
137
|
dialTimeout: { type: "number" },
|
|
138
|
+
timeLimit: { type: "number" },
|
|
139
|
+
enableTimeLimit: { type: "boolean" },
|
|
138
140
|
dialTranscribeEnabled: { type: "boolean" },
|
|
139
141
|
dialTranscribeVendor: { type: "string" },
|
|
140
142
|
dialTranscribeLanguage: { type: "string" },
|
|
@@ -238,8 +238,8 @@ export const activateHandoverConversationSchema = {
|
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
240
|
};
|
|
241
|
-
export const
|
|
242
|
-
title: "
|
|
241
|
+
export const pollEventSchema = {
|
|
242
|
+
title: "pollEventSchema",
|
|
243
243
|
type: "object",
|
|
244
244
|
additionalProperties: false,
|
|
245
245
|
required: ["handoverSettings", "traceId", "disableSensitiveLogging"],
|
|
@@ -19,6 +19,16 @@ export const aiAgentDataSchema = {
|
|
|
19
19
|
formality: { type: "string" }
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
|
+
voiceConfigs: {
|
|
23
|
+
type: "object",
|
|
24
|
+
properties: {
|
|
25
|
+
ttsVoice: { type: "string" },
|
|
26
|
+
ttsLanguage: { type: "string" },
|
|
27
|
+
ttsVendor: { type: "string" },
|
|
28
|
+
ttsModel: { type: "string" }
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
enableVoiceConfigs: { type: "boolean" },
|
|
22
32
|
safetySettings: {
|
|
23
33
|
type: "object",
|
|
24
34
|
properties: {
|
|
@@ -8,7 +8,7 @@ export const connectionFieldReturnFormat = [
|
|
|
8
8
|
];
|
|
9
9
|
export const generateConnectionsRedisKey = (data) => {
|
|
10
10
|
return [
|
|
11
|
-
`organisationId:${data.organisationReference}
|
|
11
|
+
`organisationId:${data.organisationReference}:${data.projectReference ? `projectId:${data.projectReference}:` : ''}connection:${data.referenceId}`
|
|
12
12
|
];
|
|
13
13
|
};
|
|
14
14
|
export const connectionFieldDataSchema = {
|
|
@@ -50,7 +50,8 @@ export const connectionDataSchema = {
|
|
|
50
50
|
},
|
|
51
51
|
extension: { type: "string", format: "package-name" },
|
|
52
52
|
type: { type: "string", format: "resource-name" },
|
|
53
|
-
isDeprecated: { type: "boolean" }
|
|
53
|
+
isDeprecated: { type: "boolean" },
|
|
54
|
+
resourceLevel: { type: "string", enum: ["organisation", "project"] }
|
|
54
55
|
}
|
|
55
56
|
};
|
|
56
57
|
export const connectionSchema = {
|
|
@@ -119,7 +119,16 @@ export const largeLanguageModelDataSchema = {
|
|
|
119
119
|
alephAlpha: alephAlphaMetaSchema,
|
|
120
120
|
anthropic: anthropicMetaSchema,
|
|
121
121
|
awsBedrock: awsBedrockMetaSchema,
|
|
122
|
-
fallbacks: llmFallbackSchema
|
|
122
|
+
fallbacks: llmFallbackSchema,
|
|
123
|
+
resourceLevel: { type: "string", enum: ["organisation", "project"] },
|
|
124
|
+
assignedToProjects: {
|
|
125
|
+
type: "array",
|
|
126
|
+
uniqueItems: true,
|
|
127
|
+
items: {
|
|
128
|
+
type: "string",
|
|
129
|
+
format: "mongo-id"
|
|
130
|
+
}
|
|
131
|
+
}
|
|
123
132
|
}
|
|
124
133
|
};
|
|
125
134
|
export const largeLanguageModelSchema = {
|
|
@@ -15,7 +15,6 @@ export const defaultReplyInDBSchema = {
|
|
|
15
15
|
additionalProperties: false,
|
|
16
16
|
properties: Object.assign(Object.assign(Object.assign({}, entityMetaSchema.properties), defaultReplyDataSchema.properties), { localeReference: { type: "string", format: "mongo-id" }, intentReference: { type: "string", format: "mongo-id" }, flowReference: { type: "string", format: "mongo-id" }, projectReference: { type: "string", format: "mongo-id" }, organisationReference: { type: "string", format: "mongo-id" } })
|
|
17
17
|
};
|
|
18
|
-
;
|
|
19
18
|
export const defaultReplySchema = {
|
|
20
19
|
title: "defaultReplySchema",
|
|
21
20
|
type: "object",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cognigy/rest-api-client",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.96.0",
|
|
4
4
|
"description": "Cognigy REST-Client",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"license": "Cognigy Proprietary License",
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"ajv": "6.12.6",
|
|
34
|
-
"axios": "1.7.
|
|
34
|
+
"axios": "1.7.9",
|
|
35
35
|
"form-data": "4.0.0",
|
|
36
36
|
"tus-js-client": "^3.1.1",
|
|
37
37
|
"uuidv4": "6.2.13"
|