@cognigy/rest-api-client 0.11.0 → 0.13.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/.eslintignore +15 -0
- package/.eslintrc.json +28 -0
- package/.prettierrc.json +7 -0
- package/.snyk +1 -1
- package/build/GenericAPIFn.js +3 -3
- package/build/GenericUploadFn.js +8 -5
- package/build/PluginBase.js +1 -1
- package/build/RestAPIClient.js +15 -1
- package/build/apigroups/AdministrationAPIGroup_2_0.js +68 -40
- package/build/apigroups/AnalyticsAPIGroup_2_0.js +12 -0
- package/build/apigroups/ExternalAPIGroup_2_0.js +5 -5
- package/build/apigroups/InsightsAPIGroup_2_0.js +58 -0
- package/build/apigroups/ManagementAPIGroup_2_0.js +19 -15
- package/build/apigroups/MetricsAPIGroup_2_0.js +29 -29
- package/build/apigroups/ResourcesAPIGroup_2_0.js +250 -177
- package/build/apigroups/SessionsAPIGroup_2_0.js +7 -7
- package/build/apigroups/index.js +5 -1
- package/build/authentication/ApiKey/ApiKeyAuthentication.js +1 -1
- package/build/authentication/AuthenticationAPI.js +2 -2
- package/build/authentication/BasicAuthentication/BasicAuthentication.js +9 -2
- package/build/authentication/OAuth2/ILoginByClientCredentialsParameters.js +3 -0
- package/build/authentication/OAuth2/IOAuth2ClientCredentialsGrantAccessTokenRequest.js +11 -0
- package/build/authentication/OAuth2/IOAuth2ErrorResponse.js +1 -1
- package/build/authentication/OAuth2/OAuth2Authentication.js +67 -34
- package/build/connector/AxiosAdapter.js +28 -24
- package/build/connector/isRetryAllowed.js +0 -1
- package/build/connector/retryAfterDelay.js +3 -3
- package/build/shared/{interfaces/restAPI/administration/user/v2.0/IDeleteUserMeRest_2_0.js → api/liveAgent/liveAgentInterfaces.js} +1 -1
- package/build/shared/charts/createNodeDescriptor.js +1 -1
- package/build/shared/charts/descriptors/allFields.js +1 -1
- package/build/shared/charts/descriptors/{profile → analytics}/activateProfile.js +2 -2
- package/build/shared/charts/descriptors/{profile → analytics}/blindMode.js +11 -4
- package/build/shared/charts/descriptors/{profile → analytics}/completeGoal.js +2 -2
- package/build/shared/charts/descriptors/{profile → analytics}/deactivateProfile.js +2 -2
- package/build/shared/charts/descriptors/{profile → analytics}/deleteProfile.js +2 -2
- package/build/shared/charts/descriptors/{profile → analytics}/index.js +5 -1
- package/build/shared/charts/descriptors/{profile → analytics}/mergeProfile.js +2 -2
- package/build/shared/charts/descriptors/{profile → analytics}/overwriteAnalytics.js +59 -4
- package/build/shared/charts/descriptors/analytics/requestRating.js +57 -0
- package/build/shared/charts/descriptors/analytics/setRating.js +39 -0
- package/build/shared/charts/descriptors/{profile → analytics}/updateProfile.js +2 -2
- package/build/shared/charts/descriptors/apps/getAppSessionPin.js +46 -0
- package/build/shared/charts/descriptors/apps/index.js +14 -0
- package/build/shared/charts/descriptors/apps/initAppSession.js +488 -0
- package/build/shared/charts/descriptors/apps/setAdaptiveCardAppState.js +79 -0
- package/build/shared/charts/descriptors/apps/setAppState.js +44 -0
- package/build/shared/charts/descriptors/apps/setHtmlAppState.js +108 -0
- package/build/shared/charts/descriptors/connectionNodes/internalStorageProviders/amazonStorageProviderConnection.js +14 -0
- package/build/shared/charts/descriptors/connectionNodes/internalStorageProviders/azureBlobStorageProviderConnection.js +13 -0
- package/build/shared/charts/descriptors/connectionNodes/internalStorageProviders/googleCloudStorageProviderConnection.js +13 -0
- package/build/shared/charts/descriptors/connectionNodes/internalStorageProviders/index.js +23 -0
- package/build/shared/charts/descriptors/connectionNodes/mongoDB/aggregate.js +1 -1
- package/build/shared/charts/descriptors/connectionNodes/mongoDB/find.js +1 -1
- package/build/shared/charts/descriptors/connectionNodes/mongoDB/findOne.js +1 -1
- package/build/shared/charts/descriptors/connectionNodes/mongoDB/index.js +1 -1
- package/build/shared/charts/descriptors/connectionNodes/mongoDB/insert.js +1 -1
- package/build/shared/charts/descriptors/connectionNodes/mongoDB/remove.js +1 -1
- package/build/shared/charts/descriptors/connectionNodes/mongoDB/updateMany.js +1 -1
- package/build/shared/charts/descriptors/connectionNodes/mongoDB/updateOne.js +1 -1
- package/build/shared/charts/descriptors/connectionNodes/smtp/emailNotification.js +8 -6
- package/build/shared/charts/descriptors/connectionNodes/smtp/index.js +1 -1
- package/build/shared/charts/descriptors/connectionNodes/smtp/sendEmail.js +4 -4
- package/build/shared/charts/descriptors/connectionNodes/sql/index.js +1 -1
- package/build/shared/charts/descriptors/connectionNodes/sql/runQuery.js +1 -1
- package/build/shared/charts/descriptors/connectionNodes/sql/runStoredProcedure.js +1 -1
- package/build/shared/charts/descriptors/connectionNodes/sql/runTransaction.js +1 -1
- package/build/shared/charts/descriptors/data/addToContext.js +1 -1
- package/build/shared/charts/descriptors/data/code.js +1 -1
- package/build/shared/charts/descriptors/data/copyDataToContext.js +1 -1
- package/build/shared/charts/descriptors/data/copySlotsToContext.js +1 -1
- package/build/shared/charts/descriptors/data/log.js +1 -1
- package/build/shared/charts/descriptors/data/removeFromContext.js +1 -1
- package/build/shared/charts/descriptors/data/resetContext.js +1 -1
- package/build/shared/charts/descriptors/end.js +2 -1
- package/build/shared/charts/descriptors/index.js +98 -70
- package/build/shared/charts/descriptors/liveAgent/assistInfo.js +195 -0
- package/build/shared/charts/descriptors/liveAgent/index.js +6 -0
- package/build/shared/charts/descriptors/liveAgent/utils/buildCognigyWhisperAssistResponse.js +135 -0
- package/build/shared/charts/descriptors/liveAgent/utils/index.js +6 -0
- package/build/shared/charts/descriptors/logic/disableSlotFillers.js +1 -1
- package/build/shared/charts/descriptors/logic/enableSlotFillers.js +1 -1
- package/build/shared/charts/descriptors/logic/executeFlow.js +1 -1
- package/build/shared/charts/descriptors/logic/goTo.js +2 -1
- package/build/shared/charts/descriptors/logic/if/else.js +3 -1
- package/build/shared/charts/descriptors/logic/if/if.js +3 -2
- package/build/shared/charts/descriptors/logic/if/then.js +3 -1
- package/build/shared/charts/descriptors/logic/index.js +5 -3
- package/build/shared/charts/descriptors/logic/interval/elseInterval.js +2 -1
- package/build/shared/charts/descriptors/logic/interval/interval.js +1 -1
- package/build/shared/charts/descriptors/logic/interval/onInterval.js +2 -1
- package/build/shared/charts/descriptors/logic/once/afterwards.js +2 -1
- package/build/shared/charts/descriptors/logic/once/onFirstExecution.js +2 -1
- package/build/shared/charts/descriptors/logic/once/once.js +1 -1
- package/build/shared/charts/descriptors/logic/resetState.js +1 -1
- package/build/shared/charts/descriptors/logic/setState.js +1 -1
- package/build/shared/charts/descriptors/logic/setTranslation.js +88 -0
- package/build/shared/charts/descriptors/logic/sleep.js +1 -1
- package/build/shared/charts/descriptors/logic/stop.js +1 -1
- package/build/shared/charts/descriptors/logic/switch/case.js +3 -1
- package/build/shared/charts/descriptors/logic/switch/default.js +3 -1
- package/build/shared/charts/descriptors/logic/switch/switch.js +74 -12
- package/build/shared/charts/descriptors/logic/switchLocale.js +31 -3
- package/build/shared/charts/descriptors/logic/think.js +8 -4
- package/build/shared/charts/descriptors/logic/thinkV2.js +104 -0
- package/build/shared/charts/descriptors/logic/wait.js +3 -10
- package/build/shared/charts/descriptors/message/checkChannelChange/checkChannelChange.js +2 -1
- package/build/shared/charts/descriptors/message/checkChannelChange/onNo.js +4 -2
- package/build/shared/charts/descriptors/message/checkChannelChange/onYes.js +4 -2
- package/build/shared/charts/descriptors/message/checkChannelChange/unchanged.js +4 -2
- package/build/shared/charts/descriptors/message/datePicker.js +5 -5
- package/build/shared/charts/descriptors/message/question/onAnswer.js +4 -2
- package/build/shared/charts/descriptors/message/question/onQuestion.js +4 -2
- package/build/shared/charts/descriptors/message/question/optionalQuestion.js +2 -2
- package/build/shared/charts/descriptors/message/question/question.js +655 -60
- package/build/shared/charts/descriptors/message/question/utils/datepickerUtils.js +32 -2
- package/build/shared/charts/descriptors/message/question/utils/evaluateQuestionAnswer.js +12 -3
- package/build/shared/charts/descriptors/message/question/utils/generateAnswerShortForm.js +37 -0
- package/build/shared/charts/descriptors/message/question/utils/getQuestionText.js +36 -0
- package/build/shared/charts/descriptors/message/question/utils/questionHandover.js +13 -0
- package/build/shared/charts/descriptors/message/question/utils/resetNodeState.js +12 -0
- package/build/shared/charts/descriptors/message/question/utils/storeQuestionAnswer.js +30 -0
- package/build/shared/charts/descriptors/message/question/utils/validateQuestionAnswer.js +22 -0
- package/build/shared/charts/descriptors/message/say.js +10 -4
- package/build/shared/charts/descriptors/message/sendImage.js +1 -1
- package/build/shared/charts/descriptors/message/sendText.js +1 -1
- package/build/shared/charts/descriptors/microsoft/getToken.js +34 -0
- package/build/shared/charts/descriptors/microsoft/index.js +22 -0
- package/build/shared/charts/descriptors/microsoft/invalidateToken.js +29 -0
- package/build/shared/charts/descriptors/microsoft/tokenStatus/index.js +51 -0
- package/build/shared/charts/descriptors/microsoft/tokenStatus/tokenGranted.js +24 -0
- package/build/shared/charts/descriptors/microsoft/tokenStatus/tokenNotGranted.js +24 -0
- package/build/shared/charts/descriptors/microsoft/utils/design.js +5 -0
- package/build/shared/charts/descriptors/nlu/addLexiconKeyphrase.js +1 -1
- package/build/shared/charts/descriptors/nlu/executeCognigyNLU.js +23 -3
- package/build/shared/charts/descriptors/nlu/extractAnswer.js +115 -0
- package/build/shared/charts/descriptors/nlu/fuzzySearch.js +270 -0
- package/build/shared/charts/descriptors/nlu/index.js +7 -1
- package/build/shared/charts/descriptors/nlu/matchPattern.js +113 -0
- package/build/shared/charts/descriptors/nlu/regexSlotFiller.js +1 -1
- package/build/shared/charts/descriptors/nlu/utils/patternMatcher.js +265 -0
- package/build/shared/charts/descriptors/placeholder.js +1 -1
- package/build/shared/charts/descriptors/requiredFields.js +1 -1
- package/build/shared/charts/descriptors/service/checkAgentAvailability.js +203 -0
- package/build/shared/charts/descriptors/service/handover.js +30 -3
- package/build/shared/charts/descriptors/service/handoverV2.js +192 -0
- package/build/shared/charts/descriptors/service/httpRequest.js +40 -10
- package/build/shared/charts/descriptors/service/index.js +5 -1
- package/build/shared/charts/descriptors/service/triggerFunction/onScheduled.js +3 -1
- package/build/shared/charts/descriptors/service/triggerFunction/onSchedulingError.js +3 -1
- package/build/shared/charts/descriptors/service/triggerFunction/triggerFunction.js +1 -1
- package/build/shared/charts/descriptors/start.js +2 -1
- package/build/shared/charts/descriptors/voice/index.js +20 -0
- package/build/shared/charts/descriptors/voice/interface/IAudioCodes.js +3 -0
- package/build/shared/charts/descriptors/voice/interface/IVoiceGateway2.js +3 -0
- package/build/shared/charts/descriptors/voice/mappers/hangup.mapper.js +59 -0
- package/build/shared/charts/descriptors/voice/mappers/play.mapper.js +99 -0
- package/build/shared/charts/descriptors/voice/mappers/setSessionConfig.mapper.js +296 -0
- package/build/shared/charts/descriptors/voice/mappers/transfer.mapper.js +86 -0
- package/build/shared/charts/descriptors/voice/nodes/bargeIn.js +60 -0
- package/build/shared/charts/descriptors/voice/nodes/continuousAsr.js +72 -0
- package/build/shared/charts/descriptors/voice/nodes/dtmf.js +86 -0
- package/build/shared/charts/descriptors/voice/nodes/hangup.js +48 -0
- package/build/shared/charts/descriptors/voice/nodes/noUserInput.js +105 -0
- package/build/shared/charts/descriptors/voice/nodes/play.js +95 -0
- package/build/shared/charts/descriptors/voice/nodes/sessionSpeechParameters.js +105 -0
- package/build/shared/charts/descriptors/voice/nodes/transfer.js +114 -0
- package/build/shared/charts/descriptors/voice/utils/constants.js +8 -0
- package/build/shared/charts/descriptors/voice/utils/design.js +5 -0
- package/build/shared/charts/descriptors/voice/utils/helper.js +11 -0
- package/build/shared/charts/descriptors/voicegateway/index.js +1 -1
- package/build/shared/charts/descriptors/voicegateway/nodes/agentAssist.js +1 -1
- package/build/shared/charts/descriptors/voicegateway/nodes/callRecording.js +37 -17
- package/build/shared/charts/descriptors/voicegateway/nodes/handover.js +20 -34
- package/build/shared/charts/descriptors/voicegateway/nodes/hangup.js +11 -20
- package/build/shared/charts/descriptors/voicegateway/nodes/playURL.js +23 -29
- package/build/shared/charts/descriptors/voicegateway/nodes/sendMessage.js +5 -5
- package/build/shared/charts/descriptors/voicegateway/nodes/sendMetaData.js +1 -1
- package/build/shared/charts/descriptors/voicegateway/nodes/setSessionParams.js +4 -4
- package/build/shared/charts/descriptors/voicegateway/utils/paramUtils.js +34 -6
- package/build/shared/charts/descriptors/voicegateway2/index.js +25 -0
- package/build/shared/charts/descriptors/voicegateway2/nodes/dtmf.js +60 -0
- package/build/shared/charts/descriptors/voicegateway2/nodes/hangup.js +46 -0
- package/build/shared/charts/descriptors/voicegateway2/nodes/play.js +113 -0
- package/build/shared/charts/descriptors/voicegateway2/nodes/refer.js +103 -0
- package/build/shared/charts/descriptors/voicegateway2/nodes/sendMetadata.js +64 -0
- package/build/shared/charts/descriptors/voicegateway2/nodes/setSessionConfig.js +354 -0
- package/build/shared/charts/descriptors/voicegateway2/nodes/transfer.js +99 -0
- package/build/shared/charts/descriptors/voicegateway2/utils/constants.js +7 -0
- package/build/shared/charts/descriptors/voicegateway2/utils/design.js +5 -0
- package/build/shared/charts/descriptors/voicegateway2/utils/helper.js +39 -0
- package/build/shared/charts/descriptors/voicegateway2/utils/strip-nulls.js +19 -0
- package/build/shared/constants.js +11 -1
- package/build/shared/errors/baseError.js +35 -2
- package/build/shared/handoverClients/interfaces/TAnyProviderResponse.js +3 -0
- package/build/shared/handoverClients/interfaces/THandoverEventType.js +12 -0
- package/build/shared/helper/BaseContext.js +1 -1
- package/build/shared/helper/defaultDatepickerFunction.js +13 -0
- package/build/shared/helper/rest/array.js +19 -0
- package/build/shared/helper/rest/boolean.js +5 -1
- package/build/shared/helper/rest/index.js +4 -1
- package/build/shared/helper/rest/query-string/index.js +5 -5
- package/build/shared/helper/rest/query.js +0 -0
- package/build/shared/interfaces/IApiKey.js +1 -1
- package/build/shared/interfaces/IEndpointTranslationSettings.js +32 -0
- package/build/shared/interfaces/IHandoverRequestStatus.js +3 -0
- package/build/shared/interfaces/IHttpRequest.js +3 -0
- package/build/shared/interfaces/IOrganisation.js +22 -3
- package/build/shared/interfaces/IProfile.js +1 -1
- package/build/shared/interfaces/ISayNodeSettings.js +3 -0
- package/build/shared/interfaces/TEntrypointType.js +2 -0
- package/build/shared/interfaces/ai.js +0 -1
- package/build/shared/interfaces/amazonLexV2Interface.js +3 -0
- package/build/shared/interfaces/amqpInterface.js +4 -1
- package/build/shared/interfaces/analytics/IAnalyticsFlowHistoryData.js +3 -0
- package/build/shared/interfaces/analytics/IAnalyticsRating.js +13 -0
- package/build/shared/interfaces/analytics/IAnalyticsSourceData.js +196 -45
- package/build/shared/interfaces/analytics/IStepEvent.js +4 -1
- package/build/shared/interfaces/analytics/TAnalyticsMode.js +10 -0
- package/build/shared/interfaces/analytics/TAnalyticsType.js +5 -0
- package/build/shared/interfaces/debugEvents/IErrorEventPayload.js +3 -0
- package/build/shared/interfaces/debugEvents/TDebugEndpointEvent.js +1 -0
- package/build/shared/interfaces/debugEvents/TDebugEventType.js +2 -1
- package/build/shared/interfaces/fileStorage.js +23 -0
- package/build/shared/interfaces/handover.js +151 -3
- package/build/shared/interfaces/journeys/IJourney.js +1 -1
- package/build/shared/interfaces/license.js +34 -0
- package/build/shared/interfaces/license.js.map +1 -0
- package/build/shared/interfaces/management/deleteOrganisation/deleteOrganisationTypes.js +3 -0
- package/build/shared/interfaces/messageAPI/ai.js +15 -1
- package/build/shared/interfaces/messageAPI/analytics.js +3 -0
- package/build/shared/interfaces/messageAPI/endpoints.js +361 -11
- package/build/shared/interfaces/messageAPI/handover.js +270 -0
- package/build/shared/interfaces/resources/IAppTemplate.js +24 -0
- package/build/shared/interfaces/resources/IAuditEvent.js +39 -3
- package/build/shared/interfaces/resources/IChart.js +2 -1
- package/build/shared/interfaces/resources/IChartNode.js +58 -11
- package/build/shared/interfaces/resources/IConnection.js +1 -1
- package/build/shared/interfaces/resources/IConnectionSchema.js +1 -1
- package/build/shared/interfaces/resources/IEndpoint.js +7 -2
- package/build/shared/interfaces/resources/IExtension.js +17 -0
- package/build/shared/interfaces/resources/IFile.js +1 -1
- package/build/shared/interfaces/resources/IFlow.js +10 -2
- package/build/shared/interfaces/resources/IFlowState.js +1 -1
- package/build/shared/interfaces/resources/IFunctionInstance.js +1 -1
- package/build/shared/interfaces/resources/IHandoverConfiguration.js +13 -0
- package/build/shared/interfaces/resources/ILexicon.js +9 -3
- package/build/shared/interfaces/resources/ILexiconEntry.js +1 -1
- package/build/shared/interfaces/resources/INLUConnector.js +15 -2
- package/build/shared/interfaces/resources/INodeDescriptorSet.js +169 -53
- package/build/shared/interfaces/resources/IOptionsResolverFunction.js +18 -0
- package/build/shared/interfaces/resources/IOrganisationDeletion.js +10 -0
- package/build/shared/interfaces/resources/IPlaybookRun.js +61 -0
- package/build/shared/interfaces/resources/IProject.js +20 -1
- package/build/shared/interfaces/resources/IRemoveDuplicatedSlotsAndUpdateLexionEntries.js +3 -0
- package/build/shared/interfaces/resources/ISlotFiller.js +38 -21
- package/build/shared/interfaces/resources/ISnapshot.js +1 -1
- package/build/shared/interfaces/resources/ITrackAnalyticsStepsArguments.js +3 -0
- package/build/shared/interfaces/resources/TNLUConnectorType.js +3 -1
- package/build/shared/interfaces/resources/TResourceType.js +1 -0
- package/build/shared/interfaces/resources/TRestChannelType.js +10 -0
- package/build/shared/interfaces/resources/TSocketChannelType.js +9 -5
- package/build/shared/interfaces/resources/TWebhookChannelType.js +10 -0
- package/build/shared/interfaces/resources/chart/IChartExecutable.js +3 -2
- package/build/shared/interfaces/resources/chart/IChartExecutableNode.js +1 -0
- package/build/shared/interfaces/resources/intent/IIntent.js +26 -6
- package/build/shared/interfaces/resources/intent/IIntentTrainGroup.js +22 -2
- package/build/shared/interfaces/resources/intent/ISentence.js +32 -8
- package/build/shared/interfaces/resources/settings/IAgentSettings.js +81 -2
- package/build/shared/interfaces/resources/settings/IFlowSettings.js +20 -2
- package/build/shared/interfaces/resources/settings/ISharedSettings.js +5 -1
- package/build/shared/interfaces/resources/yesNoIntent/IYesNoItem.js +9 -0
- package/build/shared/interfaces/resources/yesNoIntent/index.js +3 -0
- package/build/shared/interfaces/restAPI/administration/liveAgent/v2.0/IReadLiveAgentAccountRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/administration/liveAgent/v2.0/IReadProjectInboxRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/administration/liveAgent/v2.0/ISetupCognigyLiveAgentInboxRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/administration/liveAgent/v2.0/ISetupCognigyLiveAgentRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/administration/liveAgent/v2.0/IUpdateCognigyLiveAgentInboxRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/administration/liveAgent/v2.0/index.js +3 -0
- package/build/shared/interfaces/restAPI/administration/organisations/v2.0/IReadCollectionsToBeDeletedRest_2_0.js +21 -0
- package/build/shared/interfaces/restAPI/administration/organisations/v2.0/IRequestOrganisationDeletionRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/administration/organisations/v2.0/index.js +3 -0
- package/build/shared/interfaces/restAPI/analytics/IDeleteAnalyticsRecordsRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/analytics/IUpdateAnalyticsRecordProperties_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/analytics/IUpdateAnalyticsRecordsRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/audio/v2.0/IAudioPreviewLanguages_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/audio/v2.0/IAudioPreviewRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/audio/v2.0/IIndexAudioPreviewLanguages_2_0.js +4 -0
- package/build/shared/interfaces/restAPI/audio/v2.0/ITestVoiceProviderRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/audio/v2.0/ITestVoiceProvider_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/audio/v2.0/IVGCallSettings_2_0.js +4 -0
- package/build/shared/interfaces/restAPI/audio/v2.0/IVoicePrepareCallRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/audio/v2.0/IVoicePrepareCall_2_0.js +4 -0
- package/build/shared/interfaces/restAPI/audio/v2.0/index.js +3 -0
- package/build/shared/interfaces/restAPI/insights/IAnalyticsQueryFilter_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/insights/TAnalyticsQueryFilterOperator_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/insights/messages/IGenerateMessagesRest_2_0.js +5 -0
- package/build/shared/interfaces/restAPI/insights/messages/ILoadMessagesReportByQueryHashResponse_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/insights/messages/ILoadMessagesReportByQueryHashRestData_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/insights/messages/ITopNMessages_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/insights/publish/IPublishAnalyticsRestDataBody.js +4 -0
- package/build/shared/interfaces/restAPI/insights/reports/IGenerateReportResponse_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/insights/reports/IGenerateReportRest_2_0.js +41 -0
- package/build/shared/interfaces/restAPI/insights/reports/ILoadReportByQueryHashResponse_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/insights/reports/ILoadReportByQueryHashRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/insights/steps/IGenerateStepReportRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/insights/steps/IIndexStepsRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/insights/steps/ILoadStepReportByQueryHashResponse_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/insights/steps/ILoadStepReportByQueryHashRestData_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/insights/steps/IStepIndexItem_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/insights/steps/IStepReport_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/insights/steps/IStep_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/insights/transcripts/IGenerateTranscriptsRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/insights/transcripts/ILoadTranscriptsReportByQueryHashResponse_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/insights/transcripts/ILoadTranscriptsReportByQueryHashRestData_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/insights/transcripts/IStepPath_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/management/organisations/v2.0/IDeleteOrganisationRest_2_0.js +4 -0
- package/build/shared/interfaces/restAPI/resources/chart/v2.0/ISearchChartNodesRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/extension/v2.0/IUpdateExtensionPackageRest_2_0.js +4 -0
- package/build/shared/interfaces/restAPI/resources/file/v2.0/IUploadFileRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/file/v2.0/index.js +3 -0
- package/build/shared/interfaces/restAPI/resources/flow/v2.0/ICloneFlowRest_2_0.js +4 -0
- package/build/shared/interfaces/restAPI/resources/flow/v2.0/ICreateFlowFromChildrenRest_2_0.js +4 -0
- package/build/shared/interfaces/restAPI/resources/flow/v2.0/sentence/IYesNoSentence_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/flow/v2.0/settings/ILocaleSettings_2_0.js +16 -0
- package/build/shared/interfaces/restAPI/resources/lexicon/v2.0/IComposeLexiconDownloadLinkRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/locales/v2.0/yesNoIntents/IDeleteYesNoIntentRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/locales/v2.0/yesNoIntents/IReadYesNoIntentsRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/locales/v2.0/yesNoIntents/ITrainYesNoIntentsRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/locales/v2.0/yesNoIntents/IUpdateYesNoIntentRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/locales/v2.0/yesNoIntents/IYesNoIntentItem_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/locales/v2.0/yesNoIntents/IYesNoIntentMetaData_2_0.js +4 -0
- package/build/shared/interfaces/restAPI/resources/locales/v2.0/yesNoIntents/IYesNoIntents_2_0.js +8 -0
- package/build/shared/interfaces/restAPI/resources/locales/v2.0/yesNoIntents/index.js +3 -0
- package/build/shared/interfaces/restAPI/resources/locales/v2.0/yesNoSentence/ICreateYesNoSentenceRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/locales/v2.0/yesNoSentence/IDeleteYesNoSentenceRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/locales/v2.0/yesNoSentence/IIndexYesNoSentencesRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/locales/v2.0/yesNoSentence/IReadYesNoSentenceRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/locales/v2.0/yesNoSentence/IUpdateYesNoSentenceRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/locales/v2.0/yesNoSentence/index.js +3 -0
- package/build/shared/interfaces/restAPI/resources/nluconnector/v2.0/TNLUConnectorType_2_0.js +5 -1
- package/build/shared/interfaces/restAPI/resources/nodedescriptorsets/v2.0/IOptionsResolverRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/playbook/v2.0/IDeletePlaybookRunRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/playbook/v2.0/IIndexPlaybookRunsRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/playbook/v2.0/IPlaybookRunIndexItem_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/playbook/v2.0/IPlaybookRun_2_0.js +7 -0
- package/build/shared/interfaces/restAPI/resources/playbook/v2.0/IReadPlaybookRunRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/playbook/v2.0/ISchedulePlaybookRunRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/project/v2.0/ICreateProjectRest_2_0.js +1 -0
- package/build/shared/interfaces/restAPI/resources/project/v2.0/ITrainAllProjectFlowsRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/project/v2.0/settings/ITestTranslationSettingsRest_2_0.js +3 -0
- package/build/shared/interfaces/restAPI/resources/project/v2.0/settings/ITestTranslationSettings_2_0.js +3 -0
- package/build/shared/interfaces/security/IACL.js +1 -1
- package/build/shared/interfaces/security/IPermission.js +10 -0
- package/build/shared/interfaces/security/IRole.js +21 -3
- package/build/shared/interfaces/sessionstate/ISessionState.js +3 -0
- package/build/shared/interfaces/sessionstate/index.js +3 -0
- package/build/shared/interfaces/trainer/ITrainerRecord.js +5 -1
- package/build/shared/interfaces/translation.js +11 -0
- package/build/shared/interfaces/user.js +1 -1
- package/package.json +40 -31
- package/types/index.d.ts +12527 -8567
- package/build/shared/charts/descriptors/logic/checkFrustration.js +0 -82
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getDatePickerSections = exports.getDatePickerFields = exports.showDatePicker = void 0;
|
|
4
|
+
/* Custom modules */
|
|
5
|
+
const defaultDatepickerFunction_1 = require("../../../../../helper/defaultDatepickerFunction");
|
|
4
6
|
/**
|
|
5
7
|
* Displays a Date Picker quick reply with the selected config
|
|
6
8
|
*/
|
|
@@ -29,6 +31,10 @@ const showDatePicker = (cognigy, config) => {
|
|
|
29
31
|
const minuteIncrement = config.datepicker_minuteIncrement;
|
|
30
32
|
const noCalendar = config.datepicker_noCalendar;
|
|
31
33
|
const weekNumbers = config.datepicker_weekNumbers;
|
|
34
|
+
const functionEnable = config.datepicker_functionEnable;
|
|
35
|
+
const functionDisable = config.datepicker_functionDisable;
|
|
36
|
+
const wantDisable = (wantEnableDisable === "disable") ? true : ((wantEnableDisable === "enable") ? false : null);
|
|
37
|
+
const functionToExecute = wantDisable === null ? null : (wantDisable ? functionDisable : functionEnable);
|
|
32
38
|
api.say("", {
|
|
33
39
|
_plugin: {
|
|
34
40
|
type: "date-picker",
|
|
@@ -38,8 +44,9 @@ const showDatePicker = (cognigy, config) => {
|
|
|
38
44
|
enableTime,
|
|
39
45
|
defaultDate,
|
|
40
46
|
mode,
|
|
41
|
-
wantDisable
|
|
47
|
+
wantDisable,
|
|
42
48
|
enable_disable: getDisabledEnabledDates(wantEnableDisable, disableEnableRange, enabledDates, disabledDates),
|
|
49
|
+
function_enable_disable: api.validateDatepickerFunctionInSecureContext(functionToExecute),
|
|
43
50
|
minDate,
|
|
44
51
|
maxDate,
|
|
45
52
|
openPickerButtonText,
|
|
@@ -75,7 +82,7 @@ const getDisabledEnabledDates = (wantEnableDisable, disableEnableRange, enabledD
|
|
|
75
82
|
}
|
|
76
83
|
return enabledDates;
|
|
77
84
|
}
|
|
78
|
-
else if (wantEnableDisable === "disable") {
|
|
85
|
+
else if (wantEnableDisable === "disable" && Array.isArray(disabledDates)) {
|
|
79
86
|
disabledDates = disabledDates.filter((value) => (value && value !== ""));
|
|
80
87
|
if (disableEnableRange) {
|
|
81
88
|
return [
|
|
@@ -124,6 +131,7 @@ const getDatePickerFields = (condition) => [{
|
|
|
124
131
|
{ label: "da", value: "da" },
|
|
125
132
|
{ label: "de", value: "de" },
|
|
126
133
|
{ label: "en", value: "en" },
|
|
134
|
+
{ label: "en_gb", value: "gb" },
|
|
127
135
|
{ label: "eo", value: "eo" },
|
|
128
136
|
{ label: "es", value: "es" },
|
|
129
137
|
{ label: "et", value: "et" },
|
|
@@ -271,6 +279,26 @@ const getDatePickerFields = (condition) => [{
|
|
|
271
279
|
value: "disable"
|
|
272
280
|
}
|
|
273
281
|
},
|
|
282
|
+
{
|
|
283
|
+
key: "datepicker_functionDisable",
|
|
284
|
+
type: "code",
|
|
285
|
+
label: "Disable Dates by function",
|
|
286
|
+
defaultValue: (0, defaultDatepickerFunction_1.defaultDatepickerFunction)("disable"),
|
|
287
|
+
condition: {
|
|
288
|
+
key: "datepicker_wantEnableDisable",
|
|
289
|
+
value: "disable"
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
key: "datepicker_functionEnable",
|
|
294
|
+
type: "code",
|
|
295
|
+
label: "Enable Dates by function",
|
|
296
|
+
defaultValue: (0, defaultDatepickerFunction_1.defaultDatepickerFunction)("enable"),
|
|
297
|
+
condition: {
|
|
298
|
+
key: "datepicker_wantEnableDisable",
|
|
299
|
+
value: "enable"
|
|
300
|
+
}
|
|
301
|
+
},
|
|
274
302
|
{
|
|
275
303
|
key: "datepicker_openPickerButtonText",
|
|
276
304
|
type: "cognigyText",
|
|
@@ -426,6 +454,8 @@ const getDatePickerSections = (prefix, condition) => [{
|
|
|
426
454
|
"datepicker_disableEnableRange",
|
|
427
455
|
"datepicker_enabledDates",
|
|
428
456
|
"datepicker_disabledDates",
|
|
457
|
+
"datepicker_functionEnable",
|
|
458
|
+
"datepicker_functionDisable",
|
|
429
459
|
],
|
|
430
460
|
condition
|
|
431
461
|
},
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.evaluateQuestionAnswer = void 0;
|
|
4
|
+
/* Custom modules */
|
|
5
|
+
const getQuestionText_1 = require("./getQuestionText");
|
|
6
|
+
/**
|
|
7
|
+
* Evaluates the answer of a question against its type
|
|
8
|
+
*/
|
|
4
9
|
function evaluateQuestionAnswer({ cognigy, config }) {
|
|
5
|
-
var _a;
|
|
6
10
|
const { type, keyphraseTag, usePositiveOnly, regex: regexField, storeDetailedResults } = config;
|
|
7
11
|
const { input } = cognigy;
|
|
8
12
|
let result;
|
|
@@ -13,8 +17,10 @@ function evaluateQuestionAnswer({ cognigy, config }) {
|
|
|
13
17
|
case "date":
|
|
14
18
|
const foundDate = (input.slots.DATE) ? true : false;
|
|
15
19
|
if (foundDate) {
|
|
16
|
-
if (input.slots.DATE[0] && input.slots.DATE[0].
|
|
20
|
+
if (input.slots.DATE.length === 1 && input.slots.DATE[0].start && !input.slots.DATE[0].end)
|
|
17
21
|
result = input.slots.DATE[0].start;
|
|
22
|
+
else if (input.slots.DATE.length === 1 && input.slots.DATE[0].start && input.slots.DATE[0].end)
|
|
23
|
+
result = input.slots.DATE[0];
|
|
18
24
|
else
|
|
19
25
|
result = input.slots.DATE;
|
|
20
26
|
}
|
|
@@ -36,6 +42,9 @@ function evaluateQuestionAnswer({ cognigy, config }) {
|
|
|
36
42
|
}
|
|
37
43
|
break;
|
|
38
44
|
case "regex":
|
|
45
|
+
if (!input.text) {
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
39
48
|
try {
|
|
40
49
|
const regexSplitted = regexField && typeof regexField === "string" && /^\/(.*)\/(.*)$/.exec(regexField.trim());
|
|
41
50
|
const regex = (type === "regex" && regexSplitted !== null) ? regexSplitted[1] : null;
|
|
@@ -90,7 +99,7 @@ function evaluateQuestionAnswer({ cognigy, config }) {
|
|
|
90
99
|
if (storeDetailedResults && result !== null && result !== undefined) {
|
|
91
100
|
result = {
|
|
92
101
|
"value": result,
|
|
93
|
-
"question": (
|
|
102
|
+
"question": (0, getQuestionText_1.getQuestionText)(config),
|
|
94
103
|
"timestamp": cognigy.input.currentTime.ISODate,
|
|
95
104
|
"answer": cognigy.input.text
|
|
96
105
|
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateAnswerShortForm = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Generates a readable shortform answer from any Question Type answer
|
|
6
|
+
* Especially important for dates
|
|
7
|
+
*
|
|
8
|
+
* @param type The question type
|
|
9
|
+
* @param answer The result of the question
|
|
10
|
+
* @returns string
|
|
11
|
+
*/
|
|
12
|
+
const generateAnswerShortForm = (type, answer, text) => {
|
|
13
|
+
let shortForm = answer;
|
|
14
|
+
switch (type) {
|
|
15
|
+
case "date":
|
|
16
|
+
shortForm = answer.plain;
|
|
17
|
+
break;
|
|
18
|
+
case "yesNo":
|
|
19
|
+
shortForm = text;
|
|
20
|
+
break;
|
|
21
|
+
case "temperature":
|
|
22
|
+
case "age":
|
|
23
|
+
shortForm = answer.value;
|
|
24
|
+
break;
|
|
25
|
+
case "money":
|
|
26
|
+
shortForm = `${answer.value} ${answer.unit}`;
|
|
27
|
+
break;
|
|
28
|
+
// and either
|
|
29
|
+
case "data":
|
|
30
|
+
shortForm = JSON.stringify(answer);
|
|
31
|
+
break;
|
|
32
|
+
// there are no good short forms for duration and others, so we will just leave them out
|
|
33
|
+
}
|
|
34
|
+
return shortForm;
|
|
35
|
+
};
|
|
36
|
+
exports.generateAnswerShortForm = generateAnswerShortForm;
|
|
37
|
+
//# sourceMappingURL=generateAnswerShortForm.js.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getQuestionText = void 0;
|
|
4
|
+
function getQuestionText(config) {
|
|
5
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35;
|
|
6
|
+
if (((_a = config === null || config === void 0 ? void 0 : config.say) === null || _a === void 0 ? void 0 : _a.type) === "quickReplies") {
|
|
7
|
+
return ((_f = (_e = (_d = (_c = (_b = config === null || config === void 0 ? void 0 : config.say) === null || _b === void 0 ? void 0 : _b._data) === null || _c === void 0 ? void 0 : _c._cognigy) === null || _d === void 0 ? void 0 : _d._default) === null || _e === void 0 ? void 0 : _e._quickReplies) === null || _f === void 0 ? void 0 : _f.text) ||
|
|
8
|
+
((_l = (_k = (_j = (_h = (_g = config === null || config === void 0 ? void 0 : config.say) === null || _g === void 0 ? void 0 : _g._data) === null || _h === void 0 ? void 0 : _h._cognigy) === null || _j === void 0 ? void 0 : _j._default) === null || _k === void 0 ? void 0 : _k._quickReplies) === null || _l === void 0 ? void 0 : _l.fallbackText) ||
|
|
9
|
+
((_m = config === null || config === void 0 ? void 0 : config.say) === null || _m === void 0 ? void 0 : _m.text);
|
|
10
|
+
}
|
|
11
|
+
else if (((_o = config === null || config === void 0 ? void 0 : config.say) === null || _o === void 0 ? void 0 : _o.type) === "list") {
|
|
12
|
+
return ((_t = (_s = (_r = (_q = (_p = config === null || config === void 0 ? void 0 : config.say) === null || _p === void 0 ? void 0 : _p._data) === null || _q === void 0 ? void 0 : _q._cognigy) === null || _r === void 0 ? void 0 : _r._default) === null || _s === void 0 ? void 0 : _s._list) === null || _t === void 0 ? void 0 : _t.fallbackText) || ((_u = config === null || config === void 0 ? void 0 : config.say) === null || _u === void 0 ? void 0 : _u.text);
|
|
13
|
+
}
|
|
14
|
+
else if (((_v = config === null || config === void 0 ? void 0 : config.say) === null || _v === void 0 ? void 0 : _v.type) === "gallery") {
|
|
15
|
+
return ((_0 = (_z = (_y = (_x = (_w = config === null || config === void 0 ? void 0 : config.say) === null || _w === void 0 ? void 0 : _w._data) === null || _x === void 0 ? void 0 : _x._cognigy) === null || _y === void 0 ? void 0 : _y._default) === null || _z === void 0 ? void 0 : _z._gallery) === null || _0 === void 0 ? void 0 : _0.fallbackText) || ((_1 = config === null || config === void 0 ? void 0 : config.say) === null || _1 === void 0 ? void 0 : _1.text);
|
|
16
|
+
}
|
|
17
|
+
else if (((_2 = config === null || config === void 0 ? void 0 : config.say) === null || _2 === void 0 ? void 0 : _2.type) === "audio") {
|
|
18
|
+
return ((_7 = (_6 = (_5 = (_4 = (_3 = config === null || config === void 0 ? void 0 : config.say) === null || _3 === void 0 ? void 0 : _3._data) === null || _4 === void 0 ? void 0 : _4._cognigy) === null || _5 === void 0 ? void 0 : _5._default) === null || _6 === void 0 ? void 0 : _6._audio) === null || _7 === void 0 ? void 0 : _7.fallbackText) || ((_8 = config === null || config === void 0 ? void 0 : config.say) === null || _8 === void 0 ? void 0 : _8.text);
|
|
19
|
+
}
|
|
20
|
+
else if (((_9 = config === null || config === void 0 ? void 0 : config.say) === null || _9 === void 0 ? void 0 : _9.type) === "video") {
|
|
21
|
+
return ((_14 = (_13 = (_12 = (_11 = (_10 = config === null || config === void 0 ? void 0 : config.say) === null || _10 === void 0 ? void 0 : _10._data) === null || _11 === void 0 ? void 0 : _11._cognigy) === null || _12 === void 0 ? void 0 : _12._default) === null || _13 === void 0 ? void 0 : _13._video) === null || _14 === void 0 ? void 0 : _14.fallbackText) || ((_15 = config === null || config === void 0 ? void 0 : config.say) === null || _15 === void 0 ? void 0 : _15.text);
|
|
22
|
+
}
|
|
23
|
+
else if (((_16 = config === null || config === void 0 ? void 0 : config.say) === null || _16 === void 0 ? void 0 : _16.type) === "buttons") {
|
|
24
|
+
return ((_21 = (_20 = (_19 = (_18 = (_17 = config === null || config === void 0 ? void 0 : config.say) === null || _17 === void 0 ? void 0 : _17._data) === null || _18 === void 0 ? void 0 : _18._cognigy) === null || _19 === void 0 ? void 0 : _19._default) === null || _20 === void 0 ? void 0 : _20._buttons) === null || _21 === void 0 ? void 0 : _21.text) ||
|
|
25
|
+
((_26 = (_25 = (_24 = (_23 = (_22 = config === null || config === void 0 ? void 0 : config.say) === null || _22 === void 0 ? void 0 : _22._data) === null || _23 === void 0 ? void 0 : _23._cognigy) === null || _24 === void 0 ? void 0 : _24._default) === null || _25 === void 0 ? void 0 : _25._buttons) === null || _26 === void 0 ? void 0 : _26.fallbackText) ||
|
|
26
|
+
((_27 = config === null || config === void 0 ? void 0 : config.say) === null || _27 === void 0 ? void 0 : _27.text);
|
|
27
|
+
}
|
|
28
|
+
else if (((_28 = config === null || config === void 0 ? void 0 : config.say) === null || _28 === void 0 ? void 0 : _28.type) === "image") {
|
|
29
|
+
return ((_33 = (_32 = (_31 = (_30 = (_29 = config === null || config === void 0 ? void 0 : config.say) === null || _29 === void 0 ? void 0 : _29._data) === null || _30 === void 0 ? void 0 : _30._cognigy) === null || _31 === void 0 ? void 0 : _31._default) === null || _32 === void 0 ? void 0 : _32._image) === null || _33 === void 0 ? void 0 : _33.fallbackText) || ((_34 = config === null || config === void 0 ? void 0 : config.say) === null || _34 === void 0 ? void 0 : _34.text);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
return (_35 = config === null || config === void 0 ? void 0 : config.say) === null || _35 === void 0 ? void 0 : _35.text;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.getQuestionText = getQuestionText;
|
|
36
|
+
//# sourceMappingURL=getQuestionText.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.questionHandover = void 0;
|
|
4
|
+
function questionHandover({ api, nodeId, resolveBehavior, input, }) {
|
|
5
|
+
api.setNextNode(nodeId);
|
|
6
|
+
api.setSystemContext(`lastEscalation-${nodeId}`, input.execution);
|
|
7
|
+
api.setSystemContext(`question-handover-${nodeId}`, {
|
|
8
|
+
resetEntrypoint: resolveBehavior === "resetEntrypoint"
|
|
9
|
+
});
|
|
10
|
+
api.setLastExecutionMarker(nodeId, input.execution);
|
|
11
|
+
}
|
|
12
|
+
exports.questionHandover = questionHandover;
|
|
13
|
+
//# sourceMappingURL=questionHandover.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resetNodeState = void 0;
|
|
4
|
+
function resetNodeState(api, nodeId) {
|
|
5
|
+
api.setLastExecutionMarker(nodeId, -1);
|
|
6
|
+
api.resetExecutionAmount(nodeId);
|
|
7
|
+
api.deleteSystemContext('activeQuestion');
|
|
8
|
+
api.deleteSystemContext('reconfirmationQuestionInProgress');
|
|
9
|
+
api.deleteSystemContext('reconfirmationQuestionInput');
|
|
10
|
+
}
|
|
11
|
+
exports.resetNodeState = resetNodeState;
|
|
12
|
+
//# sourceMappingURL=resetNodeState.js.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.storeQuestionAnswer = void 0;
|
|
4
|
+
const BaseContext_1 = require("../../../../../helper/BaseContext");
|
|
5
|
+
/**
|
|
6
|
+
* Stores the question answer into the Context and/or Input
|
|
7
|
+
*/
|
|
8
|
+
const storeQuestionAnswer = ({ storeResultInContext, contextKey, context, result, input }) => {
|
|
9
|
+
if (storeResultInContext && contextKey) {
|
|
10
|
+
// check whether contextKey or inputKey is a deep query and set
|
|
11
|
+
// storage location accordingly
|
|
12
|
+
let location = context;
|
|
13
|
+
let target = contextKey;
|
|
14
|
+
// this is a deep query
|
|
15
|
+
if (target.indexOf(".") > -1) {
|
|
16
|
+
const splits = target.split(".");
|
|
17
|
+
location = BaseContext_1.BaseContext.findLocationPathStateless(splits, true, location);
|
|
18
|
+
target = splits[splits.length - 1];
|
|
19
|
+
}
|
|
20
|
+
location[target] = result;
|
|
21
|
+
// always store result also in input to allow for
|
|
22
|
+
// easy handling in conditions etc.
|
|
23
|
+
input.result = result;
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
input.result = result;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
exports.storeQuestionAnswer = storeQuestionAnswer;
|
|
30
|
+
//# sourceMappingURL=storeQuestionAnswer.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateQuestionAnswer = void 0;
|
|
4
|
+
const validateQuestionAnswer = (cognigy, config) => {
|
|
5
|
+
const { additionalValidation, escalateIntentsAction, escalateIntentsThreshold, escalateIntentsValidIntents, } = config;
|
|
6
|
+
const { input, api } = cognigy;
|
|
7
|
+
let isValid = true;
|
|
8
|
+
// check if there is an extra condition defined and check whether it was truthy
|
|
9
|
+
if (additionalValidation) {
|
|
10
|
+
isValid = !!api.parseCognigyScriptCondition(additionalValidation);
|
|
11
|
+
}
|
|
12
|
+
if (escalateIntentsAction && escalateIntentsAction !== "none") {
|
|
13
|
+
// Intent matched, intent score lte escalate threshold and intent is a
|
|
14
|
+
// valid intent of the escalate intent allow list
|
|
15
|
+
if (input.intent && input.intentScore >= escalateIntentsThreshold && escalateIntentsValidIntents.indexOf(input.intent) > -1) {
|
|
16
|
+
isValid = false;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return isValid;
|
|
20
|
+
};
|
|
21
|
+
exports.validateQuestionAnswer = validateQuestionAnswer;
|
|
22
|
+
//# sourceMappingURL=validateQuestionAnswer.js.map
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SAY = void 0;
|
|
4
4
|
/* Custom modules */
|
|
5
5
|
const createNodeDescriptor_1 = require("../../createNodeDescriptor");
|
|
6
|
-
exports.SAY = createNodeDescriptor_1.createNodeDescriptor({
|
|
6
|
+
exports.SAY = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
7
7
|
type: "say",
|
|
8
8
|
defaultLabel: "Say",
|
|
9
9
|
summary: "Sends a message to the user on their current channel",
|
|
@@ -34,6 +34,12 @@ exports.SAY = createNodeDescriptor_1.createNodeDescriptor({
|
|
|
34
34
|
var _a;
|
|
35
35
|
const { api } = cognigy;
|
|
36
36
|
const { text, loop, linear, type, _data } = config.say;
|
|
37
|
+
/*Say nodes are always forwardable */
|
|
38
|
+
const settings = {
|
|
39
|
+
liveAgentSettings: {
|
|
40
|
+
forwardable: true
|
|
41
|
+
}
|
|
42
|
+
};
|
|
37
43
|
/**
|
|
38
44
|
* If the 'type' attribute is set to 'text' we essentially
|
|
39
45
|
* have a classic say node with a 'text' and 'data' attribute.
|
|
@@ -42,7 +48,7 @@ exports.SAY = createNodeDescriptor_1.createNodeDescriptor({
|
|
|
42
48
|
let outputText = "";
|
|
43
49
|
let filteredText;
|
|
44
50
|
if (Array.isArray(text)) {
|
|
45
|
-
filteredText = text.filter(t =>
|
|
51
|
+
filteredText = text.filter(t => t !== null && t !== undefined && t !== "").map(t => t === null || t === void 0 ? void 0 : t.toString());
|
|
46
52
|
}
|
|
47
53
|
if (linear) {
|
|
48
54
|
let nodeIndex = api.getSystemContext(`say:order-${nodeId}`);
|
|
@@ -74,14 +80,14 @@ exports.SAY = createNodeDescriptor_1.createNodeDescriptor({
|
|
|
74
80
|
if ((_a = _data === null || _data === void 0 ? void 0 : _data._cognigy) === null || _a === void 0 ? void 0 : _a._default) {
|
|
75
81
|
delete _data._cognigy._default;
|
|
76
82
|
}
|
|
77
|
-
api.say(outputText, _data);
|
|
83
|
+
api.say(outputText, _data, settings);
|
|
78
84
|
}
|
|
79
85
|
else {
|
|
80
86
|
/**
|
|
81
87
|
* This is a say node which is set to a type other than 'text' -
|
|
82
88
|
* so we have one of the new rich-media types such as 'gallery'
|
|
83
89
|
*/
|
|
84
|
-
api.say(null, config.say);
|
|
90
|
+
api.say(null, config.say, settings);
|
|
85
91
|
}
|
|
86
92
|
},
|
|
87
93
|
});
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SEND_IMAGE = void 0;
|
|
4
4
|
/* Custom modules */
|
|
5
5
|
const createNodeDescriptor_1 = require("../../createNodeDescriptor");
|
|
6
|
-
exports.SEND_IMAGE = createNodeDescriptor_1.createNodeDescriptor({
|
|
6
|
+
exports.SEND_IMAGE = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
7
7
|
type: "sendImage",
|
|
8
8
|
defaultLabel: "Send Image",
|
|
9
9
|
fields: [
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SEND_TEXT = void 0;
|
|
4
4
|
/* Custom modules */
|
|
5
5
|
const createNodeDescriptor_1 = require("../../createNodeDescriptor");
|
|
6
|
-
exports.SEND_TEXT = createNodeDescriptor_1.createNodeDescriptor({
|
|
6
|
+
exports.SEND_TEXT = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
7
7
|
type: "sendText",
|
|
8
8
|
defaultLabel: "Send Text",
|
|
9
9
|
appearance: {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.microsoftGetTokenNode = void 0;
|
|
4
|
+
/* Custom modules */
|
|
5
|
+
const createNodeDescriptor_1 = require("../../createNodeDescriptor");
|
|
6
|
+
const design_1 = require("./utils/design");
|
|
7
|
+
/**
|
|
8
|
+
* Node name: 'microsoftGetToken'
|
|
9
|
+
*
|
|
10
|
+
* Purpose:
|
|
11
|
+
* Manually request permissions or token exchange
|
|
12
|
+
*/
|
|
13
|
+
exports.microsoftGetTokenNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
14
|
+
type: "microsoftGetToken",
|
|
15
|
+
defaultLabel: "Get Token",
|
|
16
|
+
summary: "Get or renew a token for SSO",
|
|
17
|
+
appearance: {
|
|
18
|
+
showIcon: true,
|
|
19
|
+
color: design_1.nodeColor
|
|
20
|
+
},
|
|
21
|
+
tags: ["microsoft"],
|
|
22
|
+
function: async ({ cognigy }) => {
|
|
23
|
+
const { api } = cognigy;
|
|
24
|
+
api.addToContext("microsoftSsoPermissionRequest", "pending", "simple");
|
|
25
|
+
api.say("", {
|
|
26
|
+
_cognigy: {
|
|
27
|
+
_microsoftBotFramework: {
|
|
28
|
+
json: { requestMicrosoftSsoPermissions: true },
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=getToken.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cognigyMicrosoftModule = void 0;
|
|
4
|
+
/** Cognigy Modules */
|
|
5
|
+
const createNodeDescriptor_1 = require("../../createNodeDescriptor");
|
|
6
|
+
/** Nodes */
|
|
7
|
+
const tokenStatus_1 = require("./tokenStatus");
|
|
8
|
+
const getToken_1 = require("./getToken");
|
|
9
|
+
const invalidateToken_1 = require("./invalidateToken");
|
|
10
|
+
const tokenGranted_1 = require("./tokenStatus/tokenGranted");
|
|
11
|
+
const tokenNotGranted_1 = require("./tokenStatus/tokenNotGranted");
|
|
12
|
+
exports.cognigyMicrosoftModule = (0, createNodeDescriptor_1.createExtension)({
|
|
13
|
+
nodes: [
|
|
14
|
+
tokenStatus_1.microsoftTokenStatusNode,
|
|
15
|
+
invalidateToken_1.microsoftInvalidateTokenNode,
|
|
16
|
+
getToken_1.microsoftGetTokenNode,
|
|
17
|
+
tokenGranted_1.microsoftTokenGranted,
|
|
18
|
+
tokenNotGranted_1.microsoftTokenNotGranted
|
|
19
|
+
],
|
|
20
|
+
connections: []
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.microsoftInvalidateTokenNode = void 0;
|
|
4
|
+
/* Custom modules */
|
|
5
|
+
const createNodeDescriptor_1 = require("../../createNodeDescriptor");
|
|
6
|
+
const design_1 = require("./utils/design");
|
|
7
|
+
/**
|
|
8
|
+
* Node name: 'microsoftInvalidateToken'
|
|
9
|
+
*
|
|
10
|
+
* Purpose:
|
|
11
|
+
* The SSO token gets removed
|
|
12
|
+
*/
|
|
13
|
+
exports.microsoftInvalidateTokenNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
14
|
+
type: "microsoftInvalidateToken",
|
|
15
|
+
defaultLabel: "Invalidate Token",
|
|
16
|
+
summary: "Remove the SSO Token",
|
|
17
|
+
appearance: {
|
|
18
|
+
showIcon: true,
|
|
19
|
+
color: design_1.nodeColor
|
|
20
|
+
},
|
|
21
|
+
fields: [],
|
|
22
|
+
tags: ["microsoft"],
|
|
23
|
+
function: async ({ cognigy }) => {
|
|
24
|
+
const { api } = cognigy;
|
|
25
|
+
api.addToContext("microsoftSsoPermissionRequest", "declined", "simple");
|
|
26
|
+
api.say("", { _cognigy: { _microsoftBotFramework: { json: { revokeMicrosoftSsoPermissions: true } } } });
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=invalidateToken.js.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.microsoftTokenStatusNode = void 0;
|
|
4
|
+
/* Custom modules */
|
|
5
|
+
const createNodeDescriptor_1 = require("../../../createNodeDescriptor");
|
|
6
|
+
const design_1 = require("../utils/design");
|
|
7
|
+
/**
|
|
8
|
+
* Node name: 'teamsPermissions'
|
|
9
|
+
*
|
|
10
|
+
* Purpose:
|
|
11
|
+
* divide the flow into granted and not granted requests
|
|
12
|
+
*/
|
|
13
|
+
exports.microsoftTokenStatusNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
14
|
+
type: "microsoftTokenStatus",
|
|
15
|
+
defaultLabel: "Token Status",
|
|
16
|
+
summary: "Verify the token status for SSO",
|
|
17
|
+
appearance: {
|
|
18
|
+
showIcon: true,
|
|
19
|
+
color: design_1.nodeColor,
|
|
20
|
+
},
|
|
21
|
+
fields: [],
|
|
22
|
+
sections: [],
|
|
23
|
+
tags: ["microsoft"],
|
|
24
|
+
dependencies: {
|
|
25
|
+
children: ["microsoftTokenGranted", "microsoftTokenNotGranted"]
|
|
26
|
+
},
|
|
27
|
+
function: async ({ cognigy, childConfigs }) => {
|
|
28
|
+
const { api, input } = cognigy;
|
|
29
|
+
const tokenGrantedChild = childConfigs === null || childConfigs === void 0 ? void 0 : childConfigs.find((child) => child.type === "microsoftTokenGranted");
|
|
30
|
+
const tokenNotGrantedChild = childConfigs === null || childConfigs === void 0 ? void 0 : childConfigs.find((child) => child.type === "microsoftTokenNotGranted");
|
|
31
|
+
/** Permissions not requested */
|
|
32
|
+
if (!input.data.microsoftSsoPermissionRequest) {
|
|
33
|
+
api.setNextNode(tokenNotGrantedChild.id);
|
|
34
|
+
/** Permissions granted and token valid */
|
|
35
|
+
}
|
|
36
|
+
else if (input.data.microsoftSsoPermissionRequest === "completed" &&
|
|
37
|
+
input.data.microsoftSsoToken !== null) {
|
|
38
|
+
api.setNextNode(tokenGrantedChild.id);
|
|
39
|
+
/** Token expired or Logged out */
|
|
40
|
+
}
|
|
41
|
+
else if (input.data.microsoftSsoPermissionRequest === "completed" &&
|
|
42
|
+
input.data.microsoftSsoToken === null) {
|
|
43
|
+
api.setNextNode(tokenNotGrantedChild.id);
|
|
44
|
+
/** Permissions not yet accepted or declined */
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
api.setNextNode(tokenNotGrantedChild.id);
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.microsoftTokenGranted = void 0;
|
|
4
|
+
const createNodeDescriptor_1 = require("../../../createNodeDescriptor");
|
|
5
|
+
const design_1 = require("../utils/design");
|
|
6
|
+
exports.microsoftTokenGranted = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
7
|
+
type: "microsoftTokenGranted",
|
|
8
|
+
parentType: "microsoftTokenStatus",
|
|
9
|
+
defaultLabel: "Granted",
|
|
10
|
+
appearance: {
|
|
11
|
+
color: design_1.nodeColor,
|
|
12
|
+
textColor: "white",
|
|
13
|
+
contrastTextColor: "black",
|
|
14
|
+
variant: "mini",
|
|
15
|
+
},
|
|
16
|
+
constraints: {
|
|
17
|
+
deletable: false,
|
|
18
|
+
creatable: false,
|
|
19
|
+
collapsable: true,
|
|
20
|
+
childFlowCreatable: true,
|
|
21
|
+
placement: {}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=tokenGranted.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.microsoftTokenNotGranted = void 0;
|
|
4
|
+
const createNodeDescriptor_1 = require("../../../createNodeDescriptor");
|
|
5
|
+
const design_1 = require("../utils/design");
|
|
6
|
+
exports.microsoftTokenNotGranted = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
7
|
+
type: "microsoftTokenNotGranted",
|
|
8
|
+
parentType: "microsoftTokenStatus",
|
|
9
|
+
defaultLabel: "Not Granted",
|
|
10
|
+
appearance: {
|
|
11
|
+
color: design_1.nodeColor,
|
|
12
|
+
textColor: "white",
|
|
13
|
+
contrastTextColor: "black",
|
|
14
|
+
variant: "mini",
|
|
15
|
+
},
|
|
16
|
+
constraints: {
|
|
17
|
+
deletable: false,
|
|
18
|
+
creatable: false,
|
|
19
|
+
collapsable: true,
|
|
20
|
+
childFlowCreatable: true,
|
|
21
|
+
placement: {}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=tokenNotGranted.js.map
|
|
@@ -9,7 +9,7 @@ const createNodeDescriptor_1 = require("../../createNodeDescriptor");
|
|
|
9
9
|
* Purpose:
|
|
10
10
|
* Adds a keyphrase to a lexicon
|
|
11
11
|
*/
|
|
12
|
-
exports.ADD_LEXICON_KEYPHRASE = createNodeDescriptor_1.createNodeDescriptor({
|
|
12
|
+
exports.ADD_LEXICON_KEYPHRASE = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
13
13
|
type: "addLexiconKeyphrase",
|
|
14
14
|
defaultLabel: "Add Lexicon Keyphrase",
|
|
15
15
|
summary: "Adds a keyphrase to a lexicon",
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.EXECUTE_COGNIGY_NLU = void 0;
|
|
4
4
|
/* Custom modules */
|
|
5
5
|
const createNodeDescriptor_1 = require("../../createNodeDescriptor");
|
|
6
|
+
const errors_1 = require("../../../errors");
|
|
6
7
|
const logger_1 = require("../../../helper/logger");
|
|
7
8
|
/**
|
|
8
9
|
* Node name: 'executeCognigyNLU'
|
|
@@ -10,7 +11,7 @@ const logger_1 = require("../../../helper/logger");
|
|
|
10
11
|
* Purpose:
|
|
11
12
|
* Runs Cognigy NLU
|
|
12
13
|
*/
|
|
13
|
-
exports.EXECUTE_COGNIGY_NLU = createNodeDescriptor_1.createNodeDescriptor({
|
|
14
|
+
exports.EXECUTE_COGNIGY_NLU = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
14
15
|
type: "executeCognigyNLU",
|
|
15
16
|
defaultLabel: "Execute Cognigy NLU",
|
|
16
17
|
summary: "Executes the built-in Cognigy NLU",
|
|
@@ -96,6 +97,12 @@ exports.EXECUTE_COGNIGY_NLU = createNodeDescriptor_1.createNodeDescriptor({
|
|
|
96
97
|
type: "toggle",
|
|
97
98
|
label: "Find Type",
|
|
98
99
|
defaultValue: true
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
key: "processDefaultReply",
|
|
103
|
+
type: "toggle",
|
|
104
|
+
label: "Process Intent Default Reply",
|
|
105
|
+
defaultValue: false
|
|
99
106
|
}
|
|
100
107
|
],
|
|
101
108
|
sections: [
|
|
@@ -107,7 +114,8 @@ exports.EXECUTE_COGNIGY_NLU = createNodeDescriptor_1.createNodeDescriptor({
|
|
|
107
114
|
"parseIntents",
|
|
108
115
|
"parseSystemSlots",
|
|
109
116
|
"parseSlots",
|
|
110
|
-
"findType"
|
|
117
|
+
"findType",
|
|
118
|
+
"processDefaultReply"
|
|
111
119
|
]
|
|
112
120
|
}
|
|
113
121
|
],
|
|
@@ -122,12 +130,24 @@ exports.EXECUTE_COGNIGY_NLU = createNodeDescriptor_1.createNodeDescriptor({
|
|
|
122
130
|
tags: ["nlu"],
|
|
123
131
|
function: async ({ cognigy, config }) => {
|
|
124
132
|
const { api, input } = cognigy;
|
|
125
|
-
const { text, data, mode, contextKey, inputKey, parseIntents, parseSlots, parseSystemSlots, findType } = config;
|
|
133
|
+
const { text, data, mode, contextKey, inputKey, parseIntents, parseSlots, parseSystemSlots, findType, processDefaultReply } = config;
|
|
126
134
|
if (mode === "context" && !contextKey) {
|
|
127
135
|
logger_1.default.log("error", { traceId: input.traceId, disableSensitiveLogging: false }, "No context key provided in addLexiconKeyphrse with context mode");
|
|
128
136
|
return;
|
|
129
137
|
}
|
|
138
|
+
if ((input === null || input === void 0 ? void 0 : input.channel) === "nonConversational") {
|
|
139
|
+
logger_1.default.log("error", { traceId: input.traceId, disableSensitiveLogging: false }, "Execute Cognigy NLU is not allowed with nonConversational endpoint");
|
|
140
|
+
throw new errors_1.InvalidArgumentError("Execute Cognigy NLU is not allowed with nonConversational endpoint", { traceId: input.traceId, disableSensitiveLogging: false });
|
|
141
|
+
}
|
|
130
142
|
const result = await api.executeCognigyNLU(text, data, input.inputId, { parseIntents, parseSlots, parseSystemSlots, findType });
|
|
143
|
+
// Handle intent default reply if an intent was triggered, and the
|
|
144
|
+
// "Process Intent Default Reply" toggle was enabled
|
|
145
|
+
if (result.intent && processDefaultReply) {
|
|
146
|
+
const defaultReplyResult = await api.handleIntentDefaultReply(result);
|
|
147
|
+
if (defaultReplyResult.pendingDefaultReply) {
|
|
148
|
+
result.nlu.intentMapperResults.finalIntentDefaultReply = defaultReplyResult.pendingDefaultReply;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
131
151
|
if (result.tokens) {
|
|
132
152
|
delete result.tokens;
|
|
133
153
|
}
|