@cognigy/rest-api-client 0.17.0 → 0.19.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 +12 -0
- package/build/GenericTusFn.js +6 -1
- package/build/GenericUploadFn.js +3 -5
- package/build/apigroups/AdministrationAPIGroup_2_0.js +3 -1
- package/build/apigroups/MetricsAPIGroup_2_0.js +5 -0
- package/build/apigroups/ResourcesAPIGroup_2_0.js +21 -7
- package/build/connector/AxiosAdapter.js +35 -15
- package/build/shared/charts/createNodeDescriptor.js +5 -5
- package/build/shared/charts/descriptors/agentAssist/constants/constants.js +16 -1
- package/build/shared/charts/descriptors/agentAssist/helpers/agentAssistTranslator.helper.js +19 -0
- package/build/shared/charts/descriptors/agentAssist/helpers/determineMetadata.js +15 -0
- package/build/shared/charts/descriptors/agentAssist/helpers/getFontSizeFieldOptions.js +84 -0
- package/build/shared/charts/descriptors/agentAssist/helpers/getLanguageName.helper.js +33 -0
- package/build/shared/charts/descriptors/agentAssist/helpers/knowledgeSearch/answerExtraction.helper.js +59 -0
- package/build/shared/charts/descriptors/agentAssist/helpers/knowledgeSearch/configValidator.helper.js +20 -0
- package/build/shared/charts/descriptors/agentAssist/helpers/knowledgeSearch/errorHandler.helper.js +64 -0
- package/build/shared/charts/descriptors/agentAssist/helpers/knowledgeSearch/followUpDetection.helper.js +72 -0
- package/build/shared/charts/descriptors/agentAssist/helpers/knowledgeSearch/knowledgeSearch.helper.js +58 -0
- package/build/shared/charts/descriptors/agentAssist/helpers/sentiment.helper.js +7 -13
- package/build/shared/charts/descriptors/agentAssist/htmlTemplates/identityAssistTemplate.js +17 -18
- package/build/shared/charts/descriptors/agentAssist/htmlTemplates/knowledgeAssistTemplate.js +330 -153
- package/build/shared/charts/descriptors/agentAssist/htmlTemplates/nextActionWidgetTemplate.js +212 -80
- package/build/shared/charts/descriptors/agentAssist/htmlTemplates/sentimentAnalysisTemplate.js +11 -6
- package/build/shared/charts/descriptors/agentAssist/htmlTemplates/transcriptAssistTemplate.js +15 -13
- package/build/shared/charts/descriptors/agentAssist/identityAssist.js +88 -15
- package/build/shared/charts/descriptors/agentAssist/knowledgeAssist.js +192 -327
- package/build/shared/charts/descriptors/agentAssist/locales/cs.locale.js +11 -0
- package/build/shared/charts/descriptors/agentAssist/locales/de.locale.js +11 -0
- package/build/shared/charts/descriptors/agentAssist/locales/en.locale.js +11 -0
- package/build/shared/charts/descriptors/agentAssist/locales/es.locale.js +11 -0
- package/build/shared/charts/descriptors/agentAssist/locales/fr.locale.js +11 -0
- package/build/shared/charts/descriptors/agentAssist/locales/index.js +22 -0
- package/build/shared/charts/descriptors/agentAssist/locales/ja.locale.js +11 -0
- package/build/shared/charts/descriptors/agentAssist/locales/ko.locale.js +11 -0
- package/build/shared/charts/descriptors/agentAssist/locales/pt.locale.js +11 -0
- package/build/shared/charts/descriptors/agentAssist/nextActionAssist.js +484 -10
- package/build/shared/charts/descriptors/agentAssist/sentimentAssist.js +32 -9
- package/build/shared/charts/descriptors/agentAssist/setAdaptiveCardTile.js +2 -0
- package/build/shared/charts/descriptors/agentAssist/setAgentAssistGrid.js +2 -1
- package/build/shared/charts/descriptors/agentAssist/setHtmlTile.js +5 -3
- package/build/shared/charts/descriptors/agentAssist/setIframeTile.js +5 -3
- package/build/shared/charts/descriptors/agentAssist/setSecureFormsTile.js +2 -2
- package/build/shared/charts/descriptors/agentAssist/transcriptAssist.js +42 -3
- package/build/shared/charts/descriptors/analytics/activateProfile.js +1 -0
- package/build/shared/charts/descriptors/analytics/blindMode.js +2 -0
- package/build/shared/charts/descriptors/analytics/completeGoal.js +1 -0
- package/build/shared/charts/descriptors/analytics/deactivateProfile.js +1 -0
- package/build/shared/charts/descriptors/analytics/deleteProfile.js +1 -0
- package/build/shared/charts/descriptors/analytics/index.js +3 -1
- package/build/shared/charts/descriptors/analytics/mergeProfile.js +1 -0
- package/build/shared/charts/descriptors/analytics/overwriteAnalytics.js +9 -0
- package/build/shared/charts/descriptors/analytics/requestRating.js +56 -2
- package/build/shared/charts/descriptors/analytics/setRating.js +4 -2
- package/build/shared/charts/descriptors/analytics/trackMilestone.js +95 -0
- package/build/shared/charts/descriptors/analytics/updateProfile.js +1 -0
- package/build/shared/charts/descriptors/apps/initAppSession.js +1 -0
- package/build/shared/charts/descriptors/apps/setAdaptiveCardAppState.js +35 -10
- package/build/shared/charts/descriptors/apps/setHtmlAppState.js +25 -2
- package/build/shared/charts/descriptors/apps/utils/getXAppsOverlaySettings.js +54 -0
- package/build/shared/charts/descriptors/connectionNodes/documentParserProviders/azureAIDocumentIntelligenceConnection.js +12 -0
- package/build/shared/charts/descriptors/connectionNodes/documentParserProviders/index.js +13 -0
- package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/awsBedrockProviderConnection.js +12 -0
- package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/azureOpenAIProviderConnection.js +4 -3
- package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/azureOpenAIProviderConnectionV2.js +3 -3
- package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/azureOpenAIProviderOauth2Connection.js +14 -0
- package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/index.js +16 -8
- package/build/shared/charts/descriptors/connectionNodes/generativeAIProviders/openAIProviderConnection.js +3 -3
- package/build/shared/charts/descriptors/data/addToContext.js +7 -0
- package/build/shared/charts/descriptors/data/copyDataToContext.js +3 -0
- package/build/shared/charts/descriptors/data/copySlotsToContext.js +3 -0
- package/build/shared/charts/descriptors/data/debugMessage.js +73 -0
- package/build/shared/charts/descriptors/data/index.js +3 -1
- package/build/shared/charts/descriptors/data/removeFromContext.js +9 -1
- package/build/shared/charts/descriptors/data/resetContext.js +1 -0
- package/build/shared/charts/descriptors/index.js +8 -4
- package/build/shared/charts/descriptors/knowledgeSearch/searchExtractOutput.js +36 -11
- package/build/shared/charts/descriptors/logic/resetState.js +1 -0
- package/build/shared/charts/descriptors/logic/setState.js +2 -1
- package/build/shared/charts/descriptors/logic/setTranslation.js +3 -1
- package/build/shared/charts/descriptors/logic/switchLocale.js +1 -0
- package/build/shared/charts/descriptors/logic/think.js +3 -1
- package/build/shared/charts/descriptors/logic/thinkV2.js +2 -0
- package/build/shared/charts/descriptors/message/question/optionalQuestion.js +1 -1
- package/build/shared/charts/descriptors/message/question/question.js +173 -7
- package/build/shared/charts/descriptors/message/question/utils/evaluateQuestionAnswer.js +44 -3
- package/build/shared/charts/descriptors/message/question/utils/validateQuestionAnswer.js +4 -2
- package/build/shared/charts/descriptors/nlu/cleanText.js +1 -0
- package/build/shared/charts/descriptors/nlu/fuzzySearch.js +23 -1
- package/build/shared/charts/descriptors/nlu/generativeSlotFiller/prompt.js +45 -19
- package/build/shared/charts/descriptors/nlu/index.js +1 -3
- package/build/shared/charts/descriptors/service/GPTPrompt.js +362 -29
- package/build/shared/charts/descriptors/service/LLMEntityExtract.js +283 -0
- package/build/shared/charts/descriptors/service/handoverV2.js +84 -1
- package/build/shared/charts/descriptors/service/httpRequest.js +68 -3
- package/build/shared/charts/descriptors/service/index.js +3 -1
- package/build/shared/charts/descriptors/voice/mappers/setSessionConfig.mapper.js +110 -27
- package/build/shared/charts/descriptors/voice/mappers/transfer.mapper.js +4 -4
- package/build/shared/charts/descriptors/voice/nodes/bargeIn.js +2 -0
- package/build/shared/charts/descriptors/voice/nodes/continuousAsr.js +2 -0
- package/build/shared/charts/descriptors/voice/nodes/dtmf.js +2 -0
- package/build/shared/charts/descriptors/voice/nodes/muteSpeechInput.js +1 -0
- package/build/shared/charts/descriptors/voice/nodes/noUserInput.js +2 -0
- package/build/shared/charts/descriptors/voice/nodes/play.js +8 -1
- package/build/shared/charts/descriptors/voice/nodes/sessionSpeechParameters.js +46 -45
- package/build/shared/charts/descriptors/voice/nodes/transfer.js +2 -0
- package/build/shared/charts/descriptors/voicegateway2/nodes/dtmf.js +2 -0
- package/build/shared/charts/descriptors/voicegateway2/nodes/hangup.js +2 -0
- package/build/shared/charts/descriptors/voicegateway2/nodes/muteSpeechInput.js +3 -0
- package/build/shared/charts/descriptors/voicegateway2/nodes/play.js +1 -1
- package/build/shared/charts/descriptors/voicegateway2/nodes/record.js +1 -0
- package/build/shared/charts/descriptors/voicegateway2/nodes/refer.js +1 -0
- package/build/shared/charts/descriptors/voicegateway2/nodes/sendMetadata.js +1 -0
- package/build/shared/charts/descriptors/voicegateway2/nodes/setSessionConfig.js +329 -47
- package/build/shared/charts/descriptors/voicegateway2/nodes/transfer.js +27 -31
- package/build/shared/charts/descriptors/voicegateway2/utils/helper.js +2 -2
- package/build/shared/charts/helpers/generativeAI/generativeAIPrompts.js +55 -0
- package/build/shared/charts/helpers/generativeAI/rephraseSentenceWithAi.js +4 -2
- package/build/shared/constants.js +10 -1
- package/build/shared/handoverClients/interfaces/THandoverEventType.js +1 -0
- package/build/shared/helper/logFullConfigToDebugMode.js +30 -0
- package/build/shared/helper/nlu/textCleaner.js +3 -1
- package/build/shared/interfaces/IOrganisation.js +1 -0
- package/build/shared/interfaces/IProfile.js +1 -0
- package/build/shared/interfaces/IProfileSchema.js +3 -0
- package/build/shared/interfaces/analytics/IAnalyticsSourceData.js +20 -20
- package/build/shared/interfaces/{restAPI/resources/journey/v2.0/IJourneyProgress_2_0.js → analytics/IMilestoneAnalytics.js} +1 -1
- package/build/shared/interfaces/{restAPI/resources/journey/v2.0/IJourney_2_0.js → appsession/IAppSession.js} +1 -1
- package/build/shared/interfaces/{restAPI/resources/journey/v2.0/IJourneyStep_2_0.js → appsession/ISetAppState.js} +1 -1
- package/build/shared/interfaces/appsession/ISetAppStateOptions.js +3 -0
- package/build/shared/interfaces/appsession/ISetAppStateOverlaySettings.js +3 -0
- package/build/shared/interfaces/appsession/ISetAppStateOverlaySettingsMetaData.js +3 -0
- package/build/shared/interfaces/debugEvents/TDebugEventMessagePayload.js +3 -0
- package/build/shared/interfaces/debugEvents/TDebugEventType.js +2 -0
- package/build/shared/interfaces/fileStorage.js +6 -0
- package/build/shared/interfaces/generativeAI/IGenerativeAIModels.js +45 -52
- package/build/shared/interfaces/handover.js +44 -2
- package/build/shared/interfaces/license.js +3 -2
- package/build/shared/interfaces/license.js.map +1 -1
- package/build/shared/interfaces/messageAPI/endpoints.js +17 -2
- package/build/shared/interfaces/messageAPI/handover.js +25 -2
- package/build/shared/interfaces/nlu/nlu.js +3 -0
- package/build/shared/interfaces/resources/IAuditEvent.js +10 -9
- package/build/shared/interfaces/resources/IConnection.js +1 -0
- package/build/shared/interfaces/resources/IEndpoint.js +1 -2
- package/build/shared/interfaces/resources/ILargeLanguageModel.js +56 -21
- package/build/shared/interfaces/resources/IMilestone.js +50 -0
- package/build/shared/interfaces/resources/INodeDescriptorSet.js +96 -75
- package/build/shared/interfaces/resources/TResourceType.js +12 -5
- package/build/shared/interfaces/resources/knowledgeStore/IKnowledgeSource.js +1 -1
- package/build/shared/interfaces/resources/settings/IAgentSettings.js +12 -7
- package/build/shared/interfaces/resources/settings/IGenerativeAISettings.js +8 -0
- package/build/shared/interfaces/resources/settings/IKnowledgeAISettings.js +18 -0
- package/build/shared/interfaces/resources/settings/index.js +4 -1
- package/build/shared/interfaces/restAPI/administration/organisations/v2.0/IReadCollectionsToBeDeletedRest_2_0.js +0 -1
- package/build/shared/interfaces/restAPI/administration/organisations/v2.0/IReadOrganisationKnowledgeChunksCountRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/operations/index.js +3 -0
- package/build/shared/interfaces/restAPI/operations/nlu/v2.0/IGenerateNluScoresRest_2_0.js +57 -0
- package/build/shared/interfaces/restAPI/operations/nlu/v2.0/index.js +3 -0
- package/build/shared/interfaces/restAPI/resources/largeLanguageModel/v2.0/IAvailableModelsForLLMProvider_2_0 .js +18 -0
- package/build/shared/interfaces/restAPI/resources/largeLanguageModel/v2.0/IGetAvailableModelsForLLMRest_2_0 .js +3 -0
- package/build/shared/interfaces/restAPI/resources/{journey/v2.0/IJourneyIndexItem_2_0.js → milestone/v2.0/ICloneMilestoneRest_2_0.js} +1 -1
- package/build/shared/interfaces/restAPI/resources/milestone/v2.0/ICreateMilestoneRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/milestone/v2.0/IDeleteMilestoneRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/milestone/v2.0/IIndexMilestonesRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/milestone/v2.0/IMilestoneIndexItem_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/milestone/v2.0/IMilestoneStepMetric_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/milestone/v2.0/IMilestoneStep_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/milestone/v2.0/IMilestone_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/{journey/v2.0/IIndexJourneysRest_2_0.js → milestone/v2.0/IReadMilestoneRest_2_0.js} +1 -1
- package/build/shared/interfaces/restAPI/resources/milestone/v2.0/IUpdateMilestoneRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/milestone/v2.0/index.js +3 -0
- package/build/shared/interfaces/restAPI/resources/uploadResumable/v2.0/IUploadResumableRest_2_0.js +3 -1
- package/build/shared/interfaces/security/IPermission.js +4 -2
- package/build/shared/interfaces/security/IRole.js +2 -0
- package/build/shared/interfaces/security/ISystemCapabilities.js +3 -0
- package/build/shared/interfaces/security/index.js +1 -1
- package/build/shared/interfaces/trainer/ITrainerRecord.js +2 -2
- package/build/shared/interfaces/user.js +1 -1
- package/package.json +2 -2
- package/types/index.d.ts +2194 -957
- package/build/shared/charts/descriptors/nlu/extractAnswer.js +0 -115
- package/build/shared/interfaces/journeys/IJourney.js +0 -83
- package/build/shared/interfaces/journeys/IJourneyProgress.js +0 -40
- package/build/shared/interfaces/journeys/IJourneyTrackEvent.js +0 -35
- package/build/shared/interfaces/journeys/index.js +0 -14
- package/build/shared/interfaces/restAPI/resources/journey/v2.0/IJourneyTrackEvents_2_0.js +0 -3
- package/build/shared/interfaces/restAPI/resources/journey/v2.0/IReadJourneyProgressRest_2_0.js +0 -3
- package/build/shared/interfaces/restAPI/resources/journey/v2.0/IReadJourneyRest_2_0.js +0 -3
- package/build/shared/interfaces/restAPI/resources/journey/v2.0/ITrackJourneyEventRest_2_0.js +0 -3
- package/build/shared/interfaces/restAPI/resources/journey/v2.0/IUpdateSelectedJourneyRest_2_0.js +0 -3
- /package/build/shared/interfaces/{restAPI/resources/journey/v2.0 → appsession}/index.js +0 -0
|
@@ -8,6 +8,7 @@ const sentimentAnalysisTemplate_1 = require("./htmlTemplates/sentimentAnalysisTe
|
|
|
8
8
|
const prompt_1 = require("../nlu/generativeSlotFiller/prompt");
|
|
9
9
|
const constants_1 = require("./constants/constants");
|
|
10
10
|
const sentiment_helper_1 = require("./helpers/sentiment.helper");
|
|
11
|
+
const getFontSizeFieldOptions_1 = require("./helpers/getFontSizeFieldOptions");
|
|
11
12
|
/**
|
|
12
13
|
* Node name: "sentimentAssist"
|
|
13
14
|
*
|
|
@@ -39,24 +40,42 @@ exports.SENTIMENT_ASSIST = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
39
40
|
options: [
|
|
40
41
|
{
|
|
41
42
|
label: "UI__NODE_EDITOR__SENTIMENT_ASSIST__FIELDS__SENTIMENT_ANALYSIS_INPUT__OPTIONS__LAST_INPUT__LABEL",
|
|
42
|
-
value: "lastInput"
|
|
43
|
+
value: "lastInput",
|
|
43
44
|
},
|
|
44
45
|
{
|
|
45
46
|
label: "UI__NODE_EDITOR__SENTIMENT_ASSIST__FIELDS__SENTIMENT_ANALYSIS_INPUT__OPTIONS__LAST_TEN_INPUTS__LABEL",
|
|
46
|
-
value: "lastTenInputs"
|
|
47
|
+
value: "lastTenInputs",
|
|
47
48
|
},
|
|
48
|
-
]
|
|
49
|
-
}
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
key: "fontSize",
|
|
54
|
+
type: "select",
|
|
55
|
+
label: "UI__NODE_EDITOR__COPILOT__TILE_UI_PREFERENCES__FONT_SIZE",
|
|
56
|
+
description: "UI__NODE_EDITOR__COPILOT__TILE_UI_PREFERENCES__FONT_SIZE__INFO",
|
|
57
|
+
defaultValue: "text-sm",
|
|
58
|
+
params: {
|
|
59
|
+
options: getFontSizeFieldOptions_1.getFontSizeFieldOptions,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
sections: [
|
|
64
|
+
{
|
|
65
|
+
key: "uiPreferences",
|
|
66
|
+
label: "UI__NODE_EDITOR__COPILOT__TILE_UI_PREFERENCES__TITLE",
|
|
67
|
+
defaultCollapsed: true,
|
|
68
|
+
fields: ["fontSize"],
|
|
50
69
|
},
|
|
51
70
|
],
|
|
52
|
-
sections: [],
|
|
53
71
|
form: [
|
|
54
72
|
{ type: "field", key: "tileId" },
|
|
55
73
|
{ type: "field", key: "sentimentAnalysisInput" },
|
|
74
|
+
{ type: "section", key: "uiPreferences" },
|
|
56
75
|
].filter((element) => !!element),
|
|
57
76
|
function: async (params) => {
|
|
58
77
|
const { cognigy, config } = params;
|
|
59
|
-
const { api } = cognigy;
|
|
78
|
+
const { api, input } = cognigy;
|
|
60
79
|
const sentimentSelection = config.sentimentAnalysisInput;
|
|
61
80
|
try {
|
|
62
81
|
let prompt = "";
|
|
@@ -70,7 +89,11 @@ exports.SENTIMENT_ASSIST = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
70
89
|
}
|
|
71
90
|
const sentiment = await (0, sentiment_helper_1.sentimentAnalysis)(api, prompt);
|
|
72
91
|
const data = {
|
|
73
|
-
html: (0, sentimentAnalysisTemplate_1.default)(
|
|
92
|
+
html: (0, sentimentAnalysisTemplate_1.default)({
|
|
93
|
+
sentiment,
|
|
94
|
+
fontSize: config.fontSize,
|
|
95
|
+
input,
|
|
96
|
+
}),
|
|
74
97
|
};
|
|
75
98
|
cognigy.api.sendTileUpdateToAgentAssistWorkspace(Object.assign(Object.assign({}, params), { tile: {
|
|
76
99
|
id: config.tileId,
|
|
@@ -79,8 +102,8 @@ exports.SENTIMENT_ASSIST = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
79
102
|
} }));
|
|
80
103
|
}
|
|
81
104
|
catch (err) {
|
|
82
|
-
api.
|
|
105
|
+
api.logDebugError(err, "Sentiment Assist Error");
|
|
83
106
|
}
|
|
84
|
-
}
|
|
107
|
+
},
|
|
85
108
|
});
|
|
86
109
|
//# sourceMappingURL=sentimentAssist.js.map
|
|
@@ -46,6 +46,7 @@ exports.SET_ADAPTIVE_CARD_TILE = (0, createNodeDescriptor_1.createNodeDescriptor
|
|
|
46
46
|
description: "UI__NODE_EDITOR__SET_ADAPTIVE_CARD_TILE__CARD__DESCRIPTION",
|
|
47
47
|
params: {
|
|
48
48
|
required: true,
|
|
49
|
+
showPromtByDefault: true,
|
|
49
50
|
},
|
|
50
51
|
defaultValue: sampleAdaptiveCard,
|
|
51
52
|
},
|
|
@@ -68,6 +69,7 @@ exports.SET_ADAPTIVE_CARD_TILE = (0, createNodeDescriptor_1.createNodeDescriptor
|
|
|
68
69
|
type: "card",
|
|
69
70
|
data: card,
|
|
70
71
|
} }));
|
|
72
|
+
api.logDebugMessage(`UI__DEBUG_MODE__SET_ADAPTIVE_CARD_TILE__MESSAGE '${config.tileId}`);
|
|
71
73
|
return;
|
|
72
74
|
},
|
|
73
75
|
});
|
|
@@ -110,10 +110,11 @@ exports.SET_AGENT_ASSIST_GRID = (0, createNodeDescriptor_1.createNodeDescriptor)
|
|
|
110
110
|
const agentAssistConfig = config[configKey];
|
|
111
111
|
const background = config[backgroundSelectorKey];
|
|
112
112
|
if (!checkAgentAssistKeys(agentAssistConfig)) {
|
|
113
|
-
api.
|
|
113
|
+
api.logDebugError("A valid AI Copilot configuration was not provided", "Copilot: Set Grid Error");
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
116
|
cognigy.api.sendConfigUpdateToAgentAssistWorkspace(Object.assign(Object.assign({}, params), { agentAssistConfig: Object.assign(Object.assign({}, agentAssistConfig), { background: background === null || background === void 0 ? void 0 : background.data }) }));
|
|
117
|
+
api.logDebugMessage(`UI__DEBUG_MODE__SET_AGENT_ASSIST_GRID__MESSAGE`);
|
|
117
118
|
return;
|
|
118
119
|
},
|
|
119
120
|
});
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SET_HTML_TILE = exports.formExampleHTML = void 0;
|
|
4
4
|
/* Custom modules */
|
|
5
5
|
const createNodeDescriptor_1 = require("../../createNodeDescriptor");
|
|
6
|
+
const determineMetadata_1 = require("./helpers/determineMetadata");
|
|
6
7
|
const htmlContentKey = "htmlContent";
|
|
7
8
|
const htmlJsonKey = "htmlJSON";
|
|
8
9
|
exports.formExampleHTML = `<!DOCTYPE html>
|
|
@@ -77,19 +78,20 @@ exports.SET_HTML_TILE = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
77
78
|
return;
|
|
78
79
|
}
|
|
79
80
|
try {
|
|
80
|
-
const data = Object.assign({ html: htmlContent }, (
|
|
81
|
+
const data = Object.assign({ html: htmlContent }, (0, determineMetadata_1.determineMetadata)(jsonData));
|
|
81
82
|
cognigy.api.sendTileUpdateToAgentAssistWorkspace(Object.assign(Object.assign({}, params), { tile: {
|
|
82
83
|
id: config.tileId,
|
|
83
84
|
type: "html",
|
|
84
85
|
data,
|
|
85
86
|
} }));
|
|
87
|
+
api.logDebugMessage("Successfully set HTML Tile content");
|
|
86
88
|
}
|
|
87
89
|
catch (error) {
|
|
88
90
|
if (error instanceof SyntaxError) {
|
|
89
|
-
api.
|
|
91
|
+
api.logDebugError("Please provide a valid JSON in the JSON Data field", "Copilot: HTML Tile Error");
|
|
90
92
|
}
|
|
91
93
|
else {
|
|
92
|
-
api.
|
|
94
|
+
api.logDebugError(error, "Copilot: HTML Tile Error");
|
|
93
95
|
}
|
|
94
96
|
}
|
|
95
97
|
return;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SET_IFRAME_TILE = void 0;
|
|
4
4
|
/* Custom modules */
|
|
5
5
|
const createNodeDescriptor_1 = require("../../createNodeDescriptor");
|
|
6
|
+
const determineMetadata_1 = require("./helpers/determineMetadata");
|
|
6
7
|
const iframeUrlKey = "iframeUrl";
|
|
7
8
|
const iframeJsonKey = "iframeJSON";
|
|
8
9
|
const urlRegex = new RegExp(/^(https?:\/\/)?[\w\-]+(\.[\w\-]+)+[/#?]?.*$/i);
|
|
@@ -65,19 +66,20 @@ exports.SET_IFRAME_TILE = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
65
66
|
return;
|
|
66
67
|
}
|
|
67
68
|
try {
|
|
68
|
-
const data = Object.assign({ url }, (
|
|
69
|
+
const data = Object.assign({ url }, (0, determineMetadata_1.determineMetadata)(jsonData));
|
|
69
70
|
cognigy.api.sendTileUpdateToAgentAssistWorkspace(Object.assign(Object.assign({}, params), { tile: {
|
|
70
71
|
id: config.tileId,
|
|
71
72
|
type: "iframe",
|
|
72
73
|
data,
|
|
73
74
|
} }));
|
|
75
|
+
api.logDebugMessage(`UI__DEBUG_MODE__SET_IFRAME_TILE__MESSAGE`);
|
|
74
76
|
}
|
|
75
77
|
catch (error) {
|
|
76
78
|
if (error instanceof SyntaxError) {
|
|
77
|
-
api.
|
|
79
|
+
api.logDebugError("Please provide a valid JSON in the JSON Data field", "Copilot: IFrame Tile Error");
|
|
78
80
|
}
|
|
79
81
|
else {
|
|
80
|
-
api.
|
|
82
|
+
api.logDebugError(error, "Copilot: IFrame Tile Error");
|
|
81
83
|
}
|
|
82
84
|
}
|
|
83
85
|
return;
|
|
@@ -72,14 +72,14 @@ exports.SET_SECURE_FORMS_TILE = (0, createNodeDescriptor_1.createNodeDescriptor)
|
|
|
72
72
|
const { cognigy, config } = params;
|
|
73
73
|
const { api, input } = cognigy;
|
|
74
74
|
if (!config.tileId) {
|
|
75
|
-
api.
|
|
75
|
+
api.logDebugError("Missing required parameter: 'tileId'", "Copilot: SecureForms Tile");
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
78
|
const updateAgentTile = agentAssistTile(params);
|
|
79
79
|
const contextKey = "secureForms";
|
|
80
80
|
let contextVal = api.getSystemContext(contextKey);
|
|
81
81
|
function handleError(error) {
|
|
82
|
-
api.
|
|
82
|
+
api.logDebugError(error, "SecureForms Tile Error", "Copilot: SecureForms Tile Error");
|
|
83
83
|
updateAgentTile(3, { error });
|
|
84
84
|
}
|
|
85
85
|
/**
|
|
@@ -6,6 +6,7 @@ const createNodeDescriptor_1 = require("../../createNodeDescriptor");
|
|
|
6
6
|
const transcriptAssistTemplate_1 = require("./htmlTemplates/transcriptAssistTemplate");
|
|
7
7
|
const constants_1 = require("./constants/constants");
|
|
8
8
|
const sentiment_helper_1 = require("./helpers/sentiment.helper");
|
|
9
|
+
const getFontSizeFieldOptions_1 = require("./helpers/getFontSizeFieldOptions");
|
|
9
10
|
/**
|
|
10
11
|
* Node name: "transcriptAssist"
|
|
11
12
|
*
|
|
@@ -37,11 +38,39 @@ exports.TRANSCRIPT_ASSIST = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
37
38
|
type: "toggle",
|
|
38
39
|
defaultValue: false,
|
|
39
40
|
},
|
|
41
|
+
{
|
|
42
|
+
key: "fontSize",
|
|
43
|
+
type: "select",
|
|
44
|
+
label: "UI__NODE_EDITOR__COPILOT__TILE_UI_PREFERENCES__FONT_SIZE",
|
|
45
|
+
description: "UI__NODE_EDITOR__COPILOT__TILE_UI_PREFERENCES__FONT_SIZE__INFO",
|
|
46
|
+
defaultValue: "text-sm",
|
|
47
|
+
params: {
|
|
48
|
+
options: getFontSizeFieldOptions_1.getFontSizeFieldOptions,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
key: "messageFontSize",
|
|
53
|
+
type: "select",
|
|
54
|
+
label: "UI__NODE_EDITOR__COPILOT__TILE_UI_PREFERENCES__FONT_SIZE",
|
|
55
|
+
description: "UI__NODE_EDITOR__COPILOT__TILE_UI_PREFERENCES__FONT_SIZE__INFO",
|
|
56
|
+
defaultValue: "text-sm",
|
|
57
|
+
params: {
|
|
58
|
+
options: getFontSizeFieldOptions_1.getFontSizeFieldOptions,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
sections: [
|
|
63
|
+
{
|
|
64
|
+
key: "uiPreferences",
|
|
65
|
+
label: "UI__NODE_EDITOR__COPILOT__TILE_UI_PREFERENCES__TITLE",
|
|
66
|
+
defaultCollapsed: true,
|
|
67
|
+
fields: ["fontSize", "messageFontSize"],
|
|
68
|
+
},
|
|
40
69
|
],
|
|
41
|
-
sections: [],
|
|
42
70
|
form: [
|
|
43
71
|
{ type: "field", key: "tileId" },
|
|
44
72
|
{ type: "field", key: "enableSentiment" },
|
|
73
|
+
{ type: "section", key: "uiPreferences" },
|
|
45
74
|
].filter((element) => !!element),
|
|
46
75
|
function: async (params) => {
|
|
47
76
|
const { cognigy, config } = params;
|
|
@@ -50,21 +79,31 @@ exports.TRANSCRIPT_ASSIST = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
50
79
|
let sentiment;
|
|
51
80
|
try {
|
|
52
81
|
const inputText = cognigy.input.text;
|
|
82
|
+
if (!inputText) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
53
85
|
if (sentimentEnabled) {
|
|
54
86
|
const prompt = `${constants_1.LAST_INPUT_PROMPT} ${inputText}`;
|
|
55
87
|
sentiment = await (0, sentiment_helper_1.sentimentAnalysis)(api, prompt);
|
|
56
88
|
}
|
|
57
89
|
const data = {
|
|
58
|
-
html: (0, transcriptAssistTemplate_1.default)(
|
|
90
|
+
html: (0, transcriptAssistTemplate_1.default)({
|
|
91
|
+
message: inputText,
|
|
92
|
+
assetsBaseURL: process.env.AGENT_ASSIST_WORKSPACE_FRONTEND_URL_WITH_PROTOCOL || "",
|
|
93
|
+
sentiment,
|
|
94
|
+
fontSize: config.fontSize,
|
|
95
|
+
messageFontSize: config.messageFontSize
|
|
96
|
+
}),
|
|
59
97
|
};
|
|
60
98
|
cognigy.api.sendTileUpdateToAgentAssistWorkspace(Object.assign(Object.assign({}, params), { tile: {
|
|
61
99
|
id: config.tileId,
|
|
62
100
|
type: "html",
|
|
63
101
|
data,
|
|
64
102
|
} }));
|
|
103
|
+
api.logDebugMessage(`UI__DEBUG_MODE__TRANSCRIPT_ASSIST__MESSAGE`);
|
|
65
104
|
}
|
|
66
105
|
catch (error) {
|
|
67
|
-
api.
|
|
106
|
+
api.logDebugError(error, "Copilot: Transcript Tile Error");
|
|
68
107
|
}
|
|
69
108
|
return;
|
|
70
109
|
},
|
|
@@ -21,6 +21,7 @@ exports.ACTIVATE_PROFILE = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
21
21
|
function: async ({ cognigy }) => {
|
|
22
22
|
const { api } = cognigy;
|
|
23
23
|
await api.activateProfile();
|
|
24
|
+
api.logDebugMessage(`UI__DEBUG_MODE__ACTIVATE_PROFILE__MESSAGE`);
|
|
24
25
|
}
|
|
25
26
|
});
|
|
26
27
|
//# sourceMappingURL=activateProfile.js.map
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.BLIND_MODE = void 0;
|
|
4
4
|
/* Custom modules */
|
|
5
5
|
const createNodeDescriptor_1 = require("../../createNodeDescriptor");
|
|
6
|
+
const logFullConfigToDebugMode_1 = require("../../../helper/logFullConfigToDebugMode");
|
|
6
7
|
/**
|
|
7
8
|
* Node name: 'blindMode'
|
|
8
9
|
*
|
|
@@ -52,6 +53,7 @@ exports.BLIND_MODE = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
52
53
|
disableConversations,
|
|
53
54
|
disableIntentTrainer,
|
|
54
55
|
}, input.traceId);
|
|
56
|
+
(0, logFullConfigToDebugMode_1.logFullConfigToDebugMode)(cognigy, config);
|
|
55
57
|
}
|
|
56
58
|
});
|
|
57
59
|
//# sourceMappingURL=blindMode.js.map
|
|
@@ -28,6 +28,7 @@ exports.DEACTIVATE_PROFILE = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
28
28
|
const { api } = cognigy;
|
|
29
29
|
const { deleteData } = config;
|
|
30
30
|
await api.deactivateProfile(deleteData);
|
|
31
|
+
api.logDebugMessage(`UI__DEBUG_MODE__DEACTIVATE_PROFILE__MESSAGE`);
|
|
31
32
|
}
|
|
32
33
|
});
|
|
33
34
|
//# sourceMappingURL=deactivateProfile.js.map
|
|
@@ -21,6 +21,7 @@ exports.DELETE_PROFILE = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
21
21
|
function: async ({ cognigy }) => {
|
|
22
22
|
const { api } = cognigy;
|
|
23
23
|
await api.deleteProfile();
|
|
24
|
+
api.logDebugMessage(`UI__DEBUG_MODE__DELETE_PROFILE__MESSAGE`);
|
|
24
25
|
}
|
|
25
26
|
});
|
|
26
27
|
//# sourceMappingURL=deleteProfile.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.REQUEST_RATING = exports.SET_RATING = exports.OVERWRITE_ANALYTICS = exports.BLIND_MODE = exports.UPDATE_PROFILE = exports.MERGE_PROFILE = exports.DELETE_PROFILE = exports.DEACTIVATE_PROFILE = exports.COMPLETE_GOAL = exports.ACTIVATE_PROFILE = void 0;
|
|
3
|
+
exports.TRACK_MILESTONE = exports.REQUEST_RATING = exports.SET_RATING = exports.OVERWRITE_ANALYTICS = exports.BLIND_MODE = exports.UPDATE_PROFILE = exports.MERGE_PROFILE = exports.DELETE_PROFILE = exports.DEACTIVATE_PROFILE = exports.COMPLETE_GOAL = exports.ACTIVATE_PROFILE = void 0;
|
|
4
4
|
var activateProfile_1 = require("./activateProfile");
|
|
5
5
|
Object.defineProperty(exports, "ACTIVATE_PROFILE", { enumerable: true, get: function () { return activateProfile_1.ACTIVATE_PROFILE; } });
|
|
6
6
|
var completeGoal_1 = require("./completeGoal");
|
|
@@ -21,4 +21,6 @@ var setRating_1 = require("./setRating");
|
|
|
21
21
|
Object.defineProperty(exports, "SET_RATING", { enumerable: true, get: function () { return setRating_1.SET_RATING; } });
|
|
22
22
|
var requestRating_1 = require("./requestRating");
|
|
23
23
|
Object.defineProperty(exports, "REQUEST_RATING", { enumerable: true, get: function () { return requestRating_1.REQUEST_RATING; } });
|
|
24
|
+
var trackMilestone_1 = require("./trackMilestone");
|
|
25
|
+
Object.defineProperty(exports, "TRACK_MILESTONE", { enumerable: true, get: function () { return trackMilestone_1.TRACK_MILESTONE; } });
|
|
24
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -31,6 +31,7 @@ exports.MERGE_PROFILE = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
31
31
|
const { api } = cognigy;
|
|
32
32
|
const { contactId } = config;
|
|
33
33
|
await api.mergeProfile(contactId);
|
|
34
|
+
api.logDebugMessage(`UI__DEBUG_MODE__MERGE_PROFILE__MESSAGE '${contactId}'`);
|
|
34
35
|
}
|
|
35
36
|
});
|
|
36
37
|
//# sourceMappingURL=mergeProfile.js.map
|
|
@@ -196,11 +196,13 @@ exports.OVERWRITE_ANALYTICS = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
196
196
|
tags: ["analytics", "customize"],
|
|
197
197
|
function: async ({ cognigy, config }) => {
|
|
198
198
|
const { api } = cognigy;
|
|
199
|
+
let stringUpdateValue = "";
|
|
199
200
|
for (let key of Object.keys(config)) {
|
|
200
201
|
if (key === "handoverEscalations") {
|
|
201
202
|
const parsedHandoverEscalations = parseInt(config[key]);
|
|
202
203
|
if (!isNaN(parsedHandoverEscalations)) {
|
|
203
204
|
api.setAnalyticsData(key, parsedHandoverEscalations);
|
|
205
|
+
stringUpdateValue += `${key}: ${parsedHandoverEscalations}<br>`;
|
|
204
206
|
}
|
|
205
207
|
continue;
|
|
206
208
|
}
|
|
@@ -208,6 +210,7 @@ exports.OVERWRITE_ANALYTICS = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
208
210
|
case "string":
|
|
209
211
|
if (config[key] && config[key].length > 0 && config[key] !== "cUndefined") {
|
|
210
212
|
api.setAnalyticsData(key, config[key]);
|
|
213
|
+
stringUpdateValue += `${key}: ${config[key]}<br>`;
|
|
211
214
|
}
|
|
212
215
|
break;
|
|
213
216
|
case "object":
|
|
@@ -217,10 +220,15 @@ exports.OVERWRITE_ANALYTICS = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
217
220
|
else if (config[key] && Object.keys(config[key]).length > 0) {
|
|
218
221
|
api.setAnalyticsData(key, config[key]);
|
|
219
222
|
}
|
|
223
|
+
try {
|
|
224
|
+
stringUpdateValue += `${key}: ${JSON.stringify(config[key])}<br>`;
|
|
225
|
+
}
|
|
226
|
+
catch (err) { }
|
|
220
227
|
break;
|
|
221
228
|
case "number":
|
|
222
229
|
if (config[key] && Number(config[key])) {
|
|
223
230
|
api.setAnalyticsData(key, config[key]);
|
|
231
|
+
stringUpdateValue += `${key}: ${config[key]}<br>`;
|
|
224
232
|
}
|
|
225
233
|
break;
|
|
226
234
|
}
|
|
@@ -228,6 +236,7 @@ exports.OVERWRITE_ANALYTICS = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
228
236
|
api.setAnalyticsData("understood", null);
|
|
229
237
|
}
|
|
230
238
|
}
|
|
239
|
+
api.logDebugMessage(stringUpdateValue);
|
|
231
240
|
}
|
|
232
241
|
});
|
|
233
242
|
//# sourceMappingURL=overwriteAnalytics.js.map
|
|
@@ -21,37 +21,91 @@ exports.REQUEST_RATING = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
21
21
|
type: "text",
|
|
22
22
|
},
|
|
23
23
|
fields: [
|
|
24
|
+
{
|
|
25
|
+
key: "ratingScreenTitleText",
|
|
26
|
+
type: "cognigyText",
|
|
27
|
+
label: "UI__NODE_EDITOR__REQUEST_RATING__RATING_SCREEN_TITLE_TEXT__LABEL",
|
|
28
|
+
description: "UI__NODE_EDITOR__REQUEST_RATING__RATING_SCREEN_TITLE_TEXT__DESCRIPTION",
|
|
29
|
+
params: {
|
|
30
|
+
placeholder: "UI__NODE_EDITOR__REQUEST_RATING__RATING_SCREEN_TITLE_TEXT__PLACEHOLDER",
|
|
31
|
+
},
|
|
32
|
+
},
|
|
24
33
|
{
|
|
25
34
|
key: "ratingTitleText",
|
|
26
35
|
type: "cognigyText",
|
|
27
36
|
label: "UI__NODE_EDITOR__REQUEST_RATING__RATING_TITLE_TEXT__LABEL",
|
|
28
37
|
description: "UI__NODE_EDITOR__REQUEST_RATING__RATING_TITLE_TEXT__DESCRIPTION",
|
|
38
|
+
params: {
|
|
39
|
+
placeholder: "UI__NODE_EDITOR__REQUEST_RATING__RATING_TITLE_TEXT__PLACEHOLDER",
|
|
40
|
+
},
|
|
29
41
|
},
|
|
30
42
|
{
|
|
31
43
|
key: "ratingCommentText",
|
|
32
44
|
type: "cognigyText",
|
|
33
45
|
label: "UI__NODE_EDITOR__REQUEST_RATING__RATING_COMMENT_TEXT__LABEL",
|
|
34
46
|
description: "UI__NODE_EDITOR__REQUEST_RATING__RATING_COMMENT_TEXT__DESCRIPTION",
|
|
47
|
+
params: {
|
|
48
|
+
placeholder: "UI__NODE_EDITOR__REQUEST_RATING__RATING_COMMENT_TEXT__PLACEHOLDER",
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
key: "ratingSubmitButtonText",
|
|
53
|
+
type: "cognigyText",
|
|
54
|
+
label: "UI__NODE_EDITOR__REQUEST_RATING__RATING_SUBMIT_BUTTON_TEXT__LABEL",
|
|
55
|
+
description: "UI__NODE_EDITOR__REQUEST_RATING__RATING_SUBMIT_BUTTON_TEXT__DESCRIPTION",
|
|
56
|
+
params: {
|
|
57
|
+
placeholder: "UI__NODE_EDITOR__REQUEST_RATING__RATING_SUBMIT_BUTTON_TEXT__PLACEHOLDER",
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
key: "ratingEventBannerText",
|
|
62
|
+
type: "cognigyText",
|
|
63
|
+
label: "UI__NODE_EDITOR__REQUEST_RATING__RATING_EVENT_BANNER_TEXT__LABEL",
|
|
64
|
+
description: "UI__NODE_EDITOR__REQUEST_RATING__RATING_EVENT_BANNER_TEXT__DESCRIPTION",
|
|
65
|
+
params: {
|
|
66
|
+
placeholder: "UI__NODE_EDITOR__REQUEST_RATING__RATING_EVENT_BANNER_TEXT__PLACEHOLDER",
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
key: "ratingChatStatusMessage",
|
|
71
|
+
type: "cognigyText",
|
|
72
|
+
label: "UI__NODE_EDITOR__REQUEST_RATING__RATING_STATUS_MESSAGE__LABEL",
|
|
73
|
+
description: "UI__NODE_EDITOR__REQUEST_RATING__RATING_STATUS_MESSAGE__DESCRIPTION",
|
|
74
|
+
params: {
|
|
75
|
+
placeholder: "UI__NODE_EDITOR__REQUEST_RATING__RATING_STATUS_MESSAGE__PLACEHOLDER",
|
|
76
|
+
},
|
|
35
77
|
},
|
|
36
78
|
],
|
|
37
79
|
form: [
|
|
80
|
+
{ type: "field", key: "ratingScreenTitleText" },
|
|
38
81
|
{ type: "field", key: "ratingTitleText" },
|
|
39
82
|
{ type: "field", key: "ratingCommentText" },
|
|
83
|
+
{ type: "field", key: "ratingSubmitButtonText" },
|
|
84
|
+
{ type: "field", key: "ratingEventBannerText" },
|
|
85
|
+
{ type: "field", key: "ratingChatStatusMessage" },
|
|
40
86
|
],
|
|
41
|
-
tags: ["analytics", "rating"
|
|
87
|
+
tags: ["analytics", "rating"],
|
|
42
88
|
function: async ({ cognigy, config }) => {
|
|
43
89
|
const { api } = cognigy;
|
|
90
|
+
const ratingScreenTitleText = config.ratingScreenTitleText;
|
|
44
91
|
const ratingTitleText = config.ratingTitleText;
|
|
45
92
|
const ratingCommentText = config.ratingCommentText;
|
|
93
|
+
const ratingSubmitButtonText = config.ratingSubmitButtonText;
|
|
94
|
+
const ratingEventBannerText = config.ratingEventBannerText;
|
|
95
|
+
const ratingChatStatusMessage = config.ratingChatStatusMessage;
|
|
46
96
|
api.say("", {
|
|
47
97
|
_plugin: {
|
|
48
98
|
type: "request-rating",
|
|
49
99
|
data: {
|
|
100
|
+
ratingScreenTitleText,
|
|
50
101
|
ratingTitleText,
|
|
51
102
|
ratingCommentText,
|
|
103
|
+
ratingSubmitButtonText,
|
|
104
|
+
ratingEventBannerText,
|
|
105
|
+
ratingChatStatusMessage,
|
|
52
106
|
},
|
|
53
107
|
},
|
|
54
108
|
});
|
|
55
|
-
}
|
|
109
|
+
},
|
|
56
110
|
});
|
|
57
111
|
//# sourceMappingURL=requestRating.js.map
|
|
@@ -30,10 +30,12 @@ exports.SET_RATING = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
30
30
|
tags: ["analytics", "rating", "success"],
|
|
31
31
|
function: async ({ cognigy, config }) => {
|
|
32
32
|
const { api } = cognigy;
|
|
33
|
+
const { rating, ratingComment } = config;
|
|
33
34
|
api.setRating({
|
|
34
|
-
rating:
|
|
35
|
-
comment:
|
|
35
|
+
rating: rating,
|
|
36
|
+
comment: ratingComment
|
|
36
37
|
});
|
|
38
|
+
api.logDebugMessage(`UI__DEBUG_MODE__SET_RATING__MESSAGE_1 ${rating}<br>UI__DEBUG_MODE__SET_RATING__MESSAGE_2 ${ratingComment}`);
|
|
37
39
|
}
|
|
38
40
|
});
|
|
39
41
|
//# sourceMappingURL=setRating.js.map
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TRACK_MILESTONE = void 0;
|
|
4
|
+
/* Custom modules */
|
|
5
|
+
const createNodeDescriptor_1 = require("../../createNodeDescriptor");
|
|
6
|
+
/* Npm modules */
|
|
7
|
+
const uuid_1 = require("uuid");
|
|
8
|
+
/**
|
|
9
|
+
* Node name: 'trackMilestone'
|
|
10
|
+
*
|
|
11
|
+
* Purpose:
|
|
12
|
+
* Track a milestone with steps
|
|
13
|
+
* @param milestoneReferenceId the reference id of the milestone to track
|
|
14
|
+
*/
|
|
15
|
+
exports.TRACK_MILESTONE = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
16
|
+
type: "trackMilestone",
|
|
17
|
+
defaultLabel: "Track Milestone",
|
|
18
|
+
summary: 'UI__NODE_EDITOR__TRACK_MILESTONE__SUMMARY',
|
|
19
|
+
appearance: {
|
|
20
|
+
showIcon: false
|
|
21
|
+
},
|
|
22
|
+
fields: [
|
|
23
|
+
{
|
|
24
|
+
key: "milestone",
|
|
25
|
+
type: "milestoneAndStepsSelect",
|
|
26
|
+
label: "UI__NODE_EDITOR__MILESTONES__CHOOSE_MILESTONE__LABEL",
|
|
27
|
+
defaultValue: {
|
|
28
|
+
milestoneReferenceId: "",
|
|
29
|
+
stepIds: []
|
|
30
|
+
},
|
|
31
|
+
params: {
|
|
32
|
+
required: true
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
preview: {
|
|
37
|
+
key: "milestone",
|
|
38
|
+
type: "text"
|
|
39
|
+
},
|
|
40
|
+
tags: ["analytics"],
|
|
41
|
+
function: async ({ cognigy, config, projectId, organisationId, }) => {
|
|
42
|
+
var _a;
|
|
43
|
+
const { api } = cognigy;
|
|
44
|
+
if (!(config === null || config === void 0 ? void 0 : config.milestone)) {
|
|
45
|
+
api.log("error", `Invalid config for 'trackMilestone' Node`);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const sessionState = api.getSessionStateCopy();
|
|
49
|
+
const { selectedSteps, version, name, milestoneId, } = config.milestone;
|
|
50
|
+
const activeCycleIds = ((_a = sessionState.analytics) === null || _a === void 0 ? void 0 : _a.milestoneCycleIds) || {};
|
|
51
|
+
let cycleId = activeCycleIds[milestoneId];
|
|
52
|
+
const hasStartStep = selectedSteps.some(step => step.type === "start");
|
|
53
|
+
if (!cycleId && !hasStartStep) {
|
|
54
|
+
api.log("warn", `No start step found for milestone ${name} (${milestoneId}). Ignoring milestone tracking.`);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
// Create a new cycle id if there is a start step
|
|
58
|
+
if (hasStartStep) {
|
|
59
|
+
cycleId = (0, uuid_1.v4)();
|
|
60
|
+
activeCycleIds[milestoneId] = cycleId;
|
|
61
|
+
const sessionStateAnalyticsUpdate = Object.assign(Object.assign({}, sessionState.analytics), { milestoneCycleIds: activeCycleIds });
|
|
62
|
+
api.setSessionState("analytics", sessionStateAnalyticsUpdate);
|
|
63
|
+
}
|
|
64
|
+
const { sessionId, endpointUrlToken, endpointName, channel, endpointType, localeName, localeReferenceId, traceId, snapshotId, snapshotName, contactId } = api.getMetadata();
|
|
65
|
+
for (const step of selectedSteps) {
|
|
66
|
+
const payload = {
|
|
67
|
+
data: {
|
|
68
|
+
traceId: traceId,
|
|
69
|
+
disableSensitiveLogging: false,
|
|
70
|
+
},
|
|
71
|
+
analyticsdata: {
|
|
72
|
+
projectId,
|
|
73
|
+
organisationId,
|
|
74
|
+
sessionId,
|
|
75
|
+
version,
|
|
76
|
+
timestamp: new Date(),
|
|
77
|
+
milestoneCycleId: cycleId,
|
|
78
|
+
milestoneId,
|
|
79
|
+
stepId: step.stepId,
|
|
80
|
+
endpointUrlToken,
|
|
81
|
+
endpointName,
|
|
82
|
+
endpointType,
|
|
83
|
+
channel,
|
|
84
|
+
localeName,
|
|
85
|
+
localeReferenceId,
|
|
86
|
+
snapshotId,
|
|
87
|
+
snapshotName,
|
|
88
|
+
contactId
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
await api.sendTrackMilestone(payload);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
//# sourceMappingURL=trackMilestone.js.map
|
|
@@ -40,6 +40,7 @@ exports.UPDATE_PROFILE = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
40
40
|
const { key, value } = config;
|
|
41
41
|
const { api } = cognigy;
|
|
42
42
|
await api.updateProfile(key, value);
|
|
43
|
+
api.logDebugMessage(`UI__DEBUG_MODE__UPDATE_PROFILE__MESSAGE '${key}' UI__DEBUG_MODE__UPDATE_PROFILE__MESSAGE_2 '${value}'`);
|
|
43
44
|
}
|
|
44
45
|
});
|
|
45
46
|
//# sourceMappingURL=updateProfile.js.map
|
|
@@ -478,6 +478,7 @@ exports.INIT_APP_SESSION = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
|
478
478
|
const finalUrl = (0, buildAppUrl_1.buildAppUrl)(input.apps.baseUrl, (_a = input.apps.session) === null || _a === void 0 ? void 0 : _a.token);
|
|
479
479
|
api.addToInput("apps.url", finalUrl);
|
|
480
480
|
api.addToInput("apps.customization", customization || null);
|
|
481
|
+
api.logDebugMessage(`Token: ${input.apps.session.token}<br>URL: <a href="${input.apps.url} " target="_blank">${input.apps.url}</a>`);
|
|
481
482
|
},
|
|
482
483
|
});
|
|
483
484
|
//# sourceMappingURL=initAppSession.js.map
|