@cognigy/rest-api-client 2025.18.1 → 2025.20.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/apigroups/InsightsAPIGroup_2_0.js +10 -10
- package/build/apigroups/MetricsAPIGroup_2_0.js +4 -0
- package/build/authentication/OAuth2/OAuth2Authentication.js +2 -0
- package/build/connector/AxiosAdapter.js +4 -1
- package/build/shared/charts/descriptors/nlu/fuzzySearch.js +6 -6
- package/build/shared/charts/descriptors/service/aiAgent/aiAgentJob.js +81 -21
- package/build/shared/charts/descriptors/service/aiAgent/aiAgentJobCallMCPTool.js +7 -5
- package/build/shared/charts/descriptors/service/aiAgent/aiAgentJobMCPTool.js +8 -1
- package/build/shared/charts/descriptors/service/aiAgent/helpers/createToolDefinitions.js +2 -0
- package/build/shared/charts/descriptors/service/llmPrompt/LLMPromptV2.js +78 -18
- package/build/shared/charts/descriptors/service/llmPrompt/llmPromptMCPTool.js +8 -1
- package/build/shared/charts/descriptors/voice/mappers/transfer.mapper.js +20 -6
- package/build/shared/charts/descriptors/voicegateway2/nodes/transfer.js +39 -3
- package/build/shared/interfaces/IOrganisation.js +1 -0
- package/build/shared/interfaces/handover.js +3 -1
- package/build/shared/interfaces/messageAPI/endpoints.js +2 -0
- package/build/shared/interfaces/resources/IAuditEvent.js +2 -1
- package/build/shared/interfaces/resources/knowledgeStore/IKnowledgeSource.js +1 -1
- package/build/shared/interfaces/restAPI/metrics/logs/v2.0/ITailLogEntriesRest_2_0.js +3 -0
- package/dist/esm/apigroups/InsightsAPIGroup_2_0.js +10 -10
- package/dist/esm/apigroups/MetricsAPIGroup_2_0.js +4 -0
- package/dist/esm/authentication/OAuth2/OAuth2Authentication.js +2 -0
- package/dist/esm/connector/AxiosAdapter.js +4 -1
- package/dist/esm/shared/charts/descriptors/nlu/fuzzySearch.js +6 -6
- package/dist/esm/shared/charts/descriptors/service/aiAgent/aiAgentJob.js +81 -21
- package/dist/esm/shared/charts/descriptors/service/aiAgent/aiAgentJobCallMCPTool.js +7 -5
- package/dist/esm/shared/charts/descriptors/service/aiAgent/aiAgentJobMCPTool.js +8 -1
- package/dist/esm/shared/charts/descriptors/service/aiAgent/helpers/createToolDefinitions.js +2 -0
- package/dist/esm/shared/charts/descriptors/service/llmPrompt/LLMPromptV2.js +85 -25
- package/dist/esm/shared/charts/descriptors/service/llmPrompt/llmPromptMCPTool.js +8 -1
- package/dist/esm/shared/charts/descriptors/voice/mappers/transfer.mapper.js +20 -6
- package/dist/esm/shared/charts/descriptors/voicegateway2/nodes/transfer.js +39 -3
- package/dist/esm/shared/interfaces/IOrganisation.js +1 -0
- package/dist/esm/shared/interfaces/handover.js +3 -1
- package/dist/esm/shared/interfaces/messageAPI/endpoints.js +2 -0
- package/dist/esm/shared/interfaces/resources/IAuditEvent.js +2 -1
- package/dist/esm/shared/interfaces/resources/knowledgeStore/IKnowledgeSource.js +1 -1
- package/dist/esm/shared/interfaces/restAPI/metrics/logs/v2.0/ITailLogEntriesRest_2_0.js +2 -0
- package/package.json +1 -1
- package/types/index.d.ts +873 -816
- package/build/test.js +0 -39
- package/dist/esm/shared/interfaces/restAPI/management/authentication/ICreateJWTToken.js +0 -1
- package/dist/esm/test.js +0 -39
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { cleanTarget } from "../../../descriptors/voicegateway2/utils/helper";
|
|
3
3
|
import { isValidUrl, isValidPhoneNumber } from "../utils/helper";
|
|
4
4
|
export const transfer = {
|
|
5
|
-
handleInput(endpointType, params, isGenericNode = false, recognitionChannel, sttVendor, sttLanguage, googleModel, sttDeepgramModel, sttDisablePunctuation, deepgramEndpointing, deepgramEndpointingValue, deepgramSmartFormatting, anchorMedia) {
|
|
5
|
+
handleInput(endpointType, params, isGenericNode = false, recognitionChannel, sttVendor, sttLanguage, googleModel, sttDeepgramModel, sttDisablePunctuation, deepgramEndpointing, deepgramEndpointingValue, deepgramSmartFormatting, mediaPath, anchorMedia) {
|
|
6
6
|
try {
|
|
7
7
|
switch (endpointType) {
|
|
8
8
|
case "bandwidth":
|
|
@@ -21,14 +21,14 @@ export const transfer = {
|
|
|
21
21
|
return this.handleAudioCodesInput(prepareTransferParams(params), endpointType);
|
|
22
22
|
case "voiceGateway2":
|
|
23
23
|
default:
|
|
24
|
-
return this.handleVGInput(prepareTransferParams(params), recognitionChannel, sttVendor, sttLanguage, googleModel, sttDeepgramModel, sttDisablePunctuation, deepgramEndpointing, deepgramEndpointingValue, deepgramSmartFormatting, anchorMedia);
|
|
24
|
+
return this.handleVGInput(prepareTransferParams(params), recognitionChannel, sttVendor, sttLanguage, googleModel, sttDeepgramModel, sttDisablePunctuation, deepgramEndpointing, deepgramEndpointingValue, deepgramSmartFormatting, mediaPath, anchorMedia);
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
catch (error) {
|
|
28
28
|
throw Error(error.message);
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
|
-
handleVGInput(transferParam, recognitionChannel, sttVendor, sttLanguage, googleModel, sttDeepgramModel, sttDisablePunctuation, deepgramEndpointing, deepgramEndpointingValue, deepgramSmartFormatting, anchorMedia) {
|
|
31
|
+
handleVGInput(transferParam, recognitionChannel, sttVendor, sttLanguage, googleModel, sttDeepgramModel, sttDisablePunctuation, deepgramEndpointing, deepgramEndpointingValue, deepgramSmartFormatting, mediaPath, anchorMedia) {
|
|
32
32
|
const { transferType, transferTarget, transferReason, referredBy, useTransferSipHeaders, transferSipHeaders, dialMusic, dialTranscriptionWebhook, dialCallerId, amdEnabled, amdRedirectOnMachineDetected, amdRedirectText, dialTimeout, timeLimit, sttLabel } = transferParam;
|
|
33
33
|
const payload = {
|
|
34
34
|
_voiceGateway2: {
|
|
@@ -52,6 +52,19 @@ export const transfer = {
|
|
|
52
52
|
if (timeLimit && timeLimit > 0) {
|
|
53
53
|
dialVerb.timeLimit = timeLimit;
|
|
54
54
|
}
|
|
55
|
+
if (process.env.FEATURE_DISABLE_VG_MEDIA_PATH === "true") {
|
|
56
|
+
if (typeof anchorMedia === "boolean") {
|
|
57
|
+
dialVerb.anchorMedia = anchorMedia;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
if (mediaPath) {
|
|
62
|
+
dialVerb.mediaPath = mediaPath;
|
|
63
|
+
}
|
|
64
|
+
else if (typeof anchorMedia === "boolean") {
|
|
65
|
+
dialVerb.mediaPath = anchorMedia ? "fullMedia" : "partialMedia";
|
|
66
|
+
}
|
|
67
|
+
}
|
|
55
68
|
if (amdEnabled) {
|
|
56
69
|
dialVerb.amd = {
|
|
57
70
|
actionHook: "amd"
|
|
@@ -72,6 +85,9 @@ export const transfer = {
|
|
|
72
85
|
};
|
|
73
86
|
/* By default we set the target to phone */
|
|
74
87
|
dialVerb.target = [phoneTarget];
|
|
88
|
+
if (process.env.FEATURE_DISABLE_VG_MEDIA_PATH === "true") {
|
|
89
|
+
delete dialVerb.mediaPath;
|
|
90
|
+
}
|
|
75
91
|
/* If targets includes an @ we set the target to sip */
|
|
76
92
|
if (transferTarget === null || transferTarget === void 0 ? void 0 : transferTarget.includes("@")) {
|
|
77
93
|
dialVerb.target = [sipTarget];
|
|
@@ -134,12 +150,10 @@ export const transfer = {
|
|
|
134
150
|
}
|
|
135
151
|
dialVerb.callerId = dialCallerId;
|
|
136
152
|
}
|
|
137
|
-
if (anchorMedia) {
|
|
138
|
-
dialVerb.anchorMedia = anchorMedia;
|
|
139
|
-
}
|
|
140
153
|
payload._voiceGateway2.json["dial"] = dialVerb;
|
|
141
154
|
break;
|
|
142
155
|
case "refer":
|
|
156
|
+
mediaPath = undefined;
|
|
143
157
|
default:
|
|
144
158
|
const referVerb = {
|
|
145
159
|
"referTo": cleanTarget(transferTarget, false),
|
|
@@ -79,6 +79,33 @@ export const transferNode = createNodeDescriptor({
|
|
|
79
79
|
value: "dial"
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
|
+
{
|
|
83
|
+
key: "mediaPath",
|
|
84
|
+
label: "UI__NODE_EDITOR__VOICEGATEWAY2__TRANSFER__FIELDS__MEDIA_PATH__LABEL",
|
|
85
|
+
type: "select",
|
|
86
|
+
description: "UI__NODE_EDITOR__VOICEGATEWAY2__TRANSFER__FIELDS__MEDIA_PATH__DESCRIPTION",
|
|
87
|
+
defaultValue: "partialMedia",
|
|
88
|
+
params: {
|
|
89
|
+
options: [
|
|
90
|
+
{
|
|
91
|
+
label: "UI__NODE_EDITOR__VOICEGATEWAY2__TRANSFER__FIELDS__MEDIA_PATH__OPTIONS__FULL_MEDIA__LABEL",
|
|
92
|
+
value: "fullMedia"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
label: "UI__NODE_EDITOR__VOICEGATEWAY2__TRANSFER__FIELDS__MEDIA_PATH__OPTIONS__PARTIAL_MEDIA__LABEL",
|
|
96
|
+
value: "partialMedia"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
label: "UI__NODE_EDITOR__VOICEGATEWAY2__TRANSFER__FIELDS__MEDIA_PATH__OPTIONS__NO_MEDIA__LABEL",
|
|
100
|
+
value: "noMedia"
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
condition: {
|
|
105
|
+
key: "transferType",
|
|
106
|
+
value: "dial"
|
|
107
|
+
}
|
|
108
|
+
},
|
|
82
109
|
{
|
|
83
110
|
key: "useTransferSipHeaders",
|
|
84
111
|
label: "UI__NODE_EDITOR__VOICEGATEWAY2__TRANSFER__FIELDS__USE_TRANSFER_SIP_HEADERS__LABEL",
|
|
@@ -460,7 +487,7 @@ export const transferNode = createNodeDescriptor({
|
|
|
460
487
|
defaultCollapsed: true,
|
|
461
488
|
fields: [
|
|
462
489
|
"referredBy",
|
|
463
|
-
"anchorMedia",
|
|
490
|
+
process.env.FEATURE_DISABLE_VG_MEDIA_PATH === "true" ? "anchorMedia" : "mediaPath",
|
|
464
491
|
"useTransferSipHeaders",
|
|
465
492
|
"transferSipHeaders",
|
|
466
493
|
"enableAnsweringMachineDetection"
|
|
@@ -524,7 +551,7 @@ export const transferNode = createNodeDescriptor({
|
|
|
524
551
|
summary: "UI__NODE_EDITOR__VOICEGATEWAY2__TRANSFER__SUMMARY",
|
|
525
552
|
function: ({ cognigy, config, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
526
553
|
const { api, input } = cognigy;
|
|
527
|
-
const { transferType, transferTarget, referredBy,
|
|
554
|
+
const { transferType, transferTarget, referredBy, mediaPath, 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, anchorMedia } = config;
|
|
528
555
|
const transferParams = {
|
|
529
556
|
transferType,
|
|
530
557
|
transferReason,
|
|
@@ -542,6 +569,7 @@ export const transferNode = createNodeDescriptor({
|
|
|
542
569
|
timeLimit,
|
|
543
570
|
sttLabel,
|
|
544
571
|
};
|
|
572
|
+
let media = mediaPath;
|
|
545
573
|
try {
|
|
546
574
|
if (input.channel === "adminconsole") {
|
|
547
575
|
let textWarningAdminChannel = "Transferring a call is not supported in the Interaction Panel, please use the VoiceGateway endpoint.";
|
|
@@ -554,6 +582,14 @@ export const transferNode = createNodeDescriptor({
|
|
|
554
582
|
if (!enableTimeLimit) {
|
|
555
583
|
delete transferParams.timeLimit;
|
|
556
584
|
}
|
|
585
|
+
if (transferType === "dial" && typeof anchorMedia === "boolean" && (mediaPath === null || mediaPath === undefined) && process.env.FEATURE_DISABLE_VG_MEDIA_PATH === "false") {
|
|
586
|
+
if (anchorMedia) {
|
|
587
|
+
media = "fullMedia";
|
|
588
|
+
}
|
|
589
|
+
else {
|
|
590
|
+
media = "partialMedia";
|
|
591
|
+
}
|
|
592
|
+
}
|
|
557
593
|
if (agentAssistEnabled && dialTranscriptionWebhook) {
|
|
558
594
|
try {
|
|
559
595
|
const agentAssistConfigId = api.getAgentAssistConfigId();
|
|
@@ -589,7 +625,7 @@ export const transferNode = createNodeDescriptor({
|
|
|
589
625
|
transferParams.useTransferSipHeaders = false;
|
|
590
626
|
api.log("error", "Invalid JSON in Transfer SIP Headers");
|
|
591
627
|
}
|
|
592
|
-
const payload = transfer.handleInput("voiceGateway2", transferParams, false, recognitionChannel, sttVendor, sttLanguage, googleModel, sttDeepgramModel, sttDisablePunctuation, deepgramEndpointing, deepgramEndpointingValue, deepgramSmartFormatting, anchorMedia);
|
|
628
|
+
const payload = transfer.handleInput("voiceGateway2", transferParams, false, recognitionChannel, sttVendor, sttLanguage, googleModel, sttDeepgramModel, sttDisablePunctuation, deepgramEndpointing, deepgramEndpointingValue, deepgramSmartFormatting, media, anchorMedia);
|
|
593
629
|
yield api.say(null, {
|
|
594
630
|
_cognigy: payload,
|
|
595
631
|
});
|
|
@@ -56,6 +56,7 @@ export const organisationDataSchema = {
|
|
|
56
56
|
stepEventsTTLInMinutes: { type: "integer", minimum: 0 },
|
|
57
57
|
disabled: { type: "boolean" },
|
|
58
58
|
name: { type: "string", minLength: 1, format: "resource-name" },
|
|
59
|
+
businessUnitId: { type: "string" },
|
|
59
60
|
passwordPolicy: organisationPasswordPolicySchema,
|
|
60
61
|
quotaMaxChannelsPerProject: { type: "integer", minimum: 0 },
|
|
61
62
|
quotaMaxMessagesPerDay: { type: "integer", minimum: 0 },
|
|
@@ -119,6 +119,7 @@ export const handoverSettingsSchema = {
|
|
|
119
119
|
redactTranscriptTileMessages: { type: "boolean" },
|
|
120
120
|
enableAgentCopilotAuthentication: { type: "boolean" },
|
|
121
121
|
agentCopilotAuthentication: { type: "string" },
|
|
122
|
+
oAuth2Connection: { type: "string" },
|
|
122
123
|
}
|
|
123
124
|
}
|
|
124
125
|
}
|
|
@@ -151,7 +152,8 @@ export const foreignSessionDataSchema = {
|
|
|
151
152
|
clientPollTimeout: { type: "number" },
|
|
152
153
|
accessToken: { type: "string" },
|
|
153
154
|
lastEventId: { type: "string" },
|
|
154
|
-
apiKey: { type: "string" }
|
|
155
|
+
apiKey: { type: "string" },
|
|
156
|
+
endHandoverOnParticipantChange: { type: "boolean" }
|
|
155
157
|
}
|
|
156
158
|
};
|
|
157
159
|
export const rceSettingsSchema = {
|
|
@@ -38,6 +38,7 @@ export const endpointTypes = [
|
|
|
38
38
|
"zoomContactCenter",
|
|
39
39
|
];
|
|
40
40
|
const transferTypes = ["dial", "sip:refer"];
|
|
41
|
+
const mediaPathTypes = ["fullMedia", "partialMedia", "noMedia"];
|
|
41
42
|
export const webchatPersistentMenuSchema = {
|
|
42
43
|
title: "webchatPersistentMenuSchema",
|
|
43
44
|
type: "object",
|
|
@@ -151,6 +152,7 @@ const callFailoverSettingsSchema = {
|
|
|
151
152
|
deepgramEndpointing: { type: "boolean" },
|
|
152
153
|
deepgramEndpointingValue: { type: "number" },
|
|
153
154
|
dialTranscribeDeepgramTier: { type: "string" },
|
|
155
|
+
mediaPath: { type: "string", enum: [...mediaPathTypes] },
|
|
154
156
|
anchorMedia: { type: "boolean" }
|
|
155
157
|
}
|
|
156
158
|
};
|
|
@@ -107,7 +107,8 @@ export const actionTypes = [
|
|
|
107
107
|
"processKnowledgeSourceFile",
|
|
108
108
|
"setupObservationConfig",
|
|
109
109
|
"updateObservationConfig",
|
|
110
|
-
"resolveAiOpsCenterError"
|
|
110
|
+
"resolveAiOpsCenterError",
|
|
111
|
+
"odataRequest",
|
|
111
112
|
];
|
|
112
113
|
export const auditEventSchema = {
|
|
113
114
|
title: "auditEventSchema",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* Interfaces & Types */
|
|
2
2
|
import { entityMetaSchema } from "../IEntityMeta";
|
|
3
3
|
export const knowledgeSourceStatus = ["ready", "ingesting", "disabled", "failure"];
|
|
4
|
-
export const knowledgeSourceType = ["pdf", "txt", "docx", "pptx", "ctxt", "url", "manual", "jpeg", "jpg", "png", "bmp", "heif", "tiff"];
|
|
4
|
+
export const knowledgeSourceType = ["pdf", "txt", "docx", "pptx", "ctxt", "url", "manual", "jpeg", "jpg", "png", "bmp", "heif", "tiff", "extension"];
|
|
5
5
|
export const knowledgeSourceDataSchema = {
|
|
6
6
|
title: "knowledgeSourceDataSchema",
|
|
7
7
|
type: "object",
|