@cognigy/rest-api-client 0.12.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/build/GenericAPIFn.js +3 -3
- package/build/GenericUploadFn.js +8 -5
- package/build/PluginBase.js +1 -1
- package/build/RestAPIClient.js +1 -1
- package/build/apigroups/AdministrationAPIGroup_2_0.js +53 -47
- package/build/apigroups/AnalyticsAPIGroup_2_0.js +1 -1
- package/build/apigroups/ExternalAPIGroup_2_0.js +5 -5
- package/build/apigroups/InsightsAPIGroup_2_0.js +17 -12
- 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 +238 -186
- package/build/apigroups/SessionsAPIGroup_2_0.js +7 -7
- package/build/authentication/ApiKey/ApiKeyAuthentication.js +1 -1
- package/build/authentication/AuthenticationAPI.js +2 -2
- package/build/authentication/BasicAuthentication/BasicAuthentication.js +2 -2
- package/build/authentication/OAuth2/IOAuth2ErrorResponse.js +1 -1
- package/build/authentication/OAuth2/OAuth2Authentication.js +34 -27
- 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/debugEvents/TSessionStateEmitParams.js → api/liveAgent/liveAgentInterfaces.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 +0 -0
- package/build/shared/charts/descriptors/{profile → analytics}/mergeProfile.js +2 -2
- package/build/shared/charts/descriptors/{profile → analytics}/overwriteAnalytics.js +6 -3
- package/build/shared/charts/descriptors/{profile → analytics}/requestRating.js +2 -2
- package/build/shared/charts/descriptors/{profile → analytics}/setRating.js +2 -2
- 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 +7 -1
- package/build/shared/charts/descriptors/apps/initAppSession.js +467 -12
- package/build/shared/charts/descriptors/apps/setAdaptiveCardAppState.js +79 -0
- package/build/shared/charts/descriptors/apps/setAppState.js +13 -15
- 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 +2 -2
- package/build/shared/charts/descriptors/connectionNodes/smtp/index.js +1 -1
- package/build/shared/charts/descriptors/connectionNodes/smtp/sendEmail.js +2 -2
- 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 +1 -1
- package/build/shared/charts/descriptors/index.js +25 -16
- 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 +1 -1
- package/build/shared/charts/descriptors/logic/if/else.js +1 -1
- package/build/shared/charts/descriptors/logic/if/if.js +1 -1
- package/build/shared/charts/descriptors/logic/if/then.js +1 -1
- package/build/shared/charts/descriptors/logic/interval/elseInterval.js +1 -1
- package/build/shared/charts/descriptors/logic/interval/interval.js +1 -1
- package/build/shared/charts/descriptors/logic/interval/onInterval.js +1 -1
- package/build/shared/charts/descriptors/logic/once/afterwards.js +1 -1
- package/build/shared/charts/descriptors/logic/once/onFirstExecution.js +1 -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 +1 -1
- 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 +1 -1
- package/build/shared/charts/descriptors/logic/switch/default.js +1 -1
- package/build/shared/charts/descriptors/logic/switch/switch.js +22 -8
- package/build/shared/charts/descriptors/logic/switchLocale.js +1 -1
- package/build/shared/charts/descriptors/logic/think.js +1 -1
- package/build/shared/charts/descriptors/logic/thinkV2.js +1 -1
- package/build/shared/charts/descriptors/logic/wait.js +1 -1
- package/build/shared/charts/descriptors/message/checkChannelChange/checkChannelChange.js +1 -1
- package/build/shared/charts/descriptors/message/checkChannelChange/onNo.js +1 -1
- package/build/shared/charts/descriptors/message/checkChannelChange/onYes.js +1 -1
- package/build/shared/charts/descriptors/message/checkChannelChange/unchanged.js +1 -1
- package/build/shared/charts/descriptors/message/datePicker.js +5 -5
- package/build/shared/charts/descriptors/message/question/onAnswer.js +1 -1
- package/build/shared/charts/descriptors/message/question/onQuestion.js +1 -1
- package/build/shared/charts/descriptors/message/question/optionalQuestion.js +2 -2
- package/build/shared/charts/descriptors/message/question/question.js +201 -24
- package/build/shared/charts/descriptors/message/question/utils/datepickerUtils.js +31 -2
- package/build/shared/charts/descriptors/message/question/utils/evaluateQuestionAnswer.js +4 -1
- package/build/shared/charts/descriptors/message/question/utils/questionHandover.js +13 -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 +1 -1
- package/build/shared/charts/descriptors/microsoft/index.js +1 -1
- package/build/shared/charts/descriptors/microsoft/invalidateToken.js +1 -1
- package/build/shared/charts/descriptors/microsoft/tokenStatus/index.js +1 -1
- package/build/shared/charts/descriptors/microsoft/tokenStatus/tokenGranted.js +1 -1
- package/build/shared/charts/descriptors/microsoft/tokenStatus/tokenNotGranted.js +1 -1
- package/build/shared/charts/descriptors/nlu/addLexiconKeyphrase.js +1 -1
- package/build/shared/charts/descriptors/nlu/executeCognigyNLU.js +18 -3
- package/build/shared/charts/descriptors/nlu/extractAnswer.js +1 -1
- package/build/shared/charts/descriptors/nlu/fuzzySearch.js +2 -2
- package/build/shared/charts/descriptors/nlu/matchPattern.js +13 -4
- package/build/shared/charts/descriptors/nlu/regexSlotFiller.js +1 -1
- package/build/shared/charts/descriptors/nlu/utils/patternMatcher.js +129 -61
- 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 +1 -1
- package/build/shared/charts/descriptors/service/handoverV2.js +66 -3
- package/build/shared/charts/descriptors/service/httpRequest.js +16 -5
- package/build/shared/charts/descriptors/service/index.js +3 -1
- package/build/shared/charts/descriptors/service/triggerFunction/onScheduled.js +1 -1
- package/build/shared/charts/descriptors/service/triggerFunction/onSchedulingError.js +1 -1
- package/build/shared/charts/descriptors/service/triggerFunction/triggerFunction.js +1 -1
- package/build/shared/charts/descriptors/start.js +1 -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 +1 -1
- package/build/shared/charts/descriptors/voicegateway/nodes/handover.js +18 -32
- package/build/shared/charts/descriptors/voicegateway/nodes/hangup.js +11 -20
- package/build/shared/charts/descriptors/voicegateway/nodes/playURL.js +14 -29
- package/build/shared/charts/descriptors/voicegateway/nodes/sendMessage.js +4 -4
- 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 +25 -5
- package/build/shared/charts/descriptors/voicegateway2/index.js +6 -2
- package/build/shared/charts/descriptors/voicegateway2/nodes/dtmf.js +9 -5
- package/build/shared/charts/descriptors/voicegateway2/nodes/hangup.js +17 -19
- package/build/shared/charts/descriptors/voicegateway2/nodes/play.js +19 -105
- package/build/shared/charts/descriptors/voicegateway2/nodes/refer.js +73 -14
- package/build/shared/charts/descriptors/voicegateway2/nodes/sendMetadata.js +64 -0
- package/build/shared/charts/descriptors/voicegateway2/nodes/setSessionConfig.js +95 -325
- 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/helper.js +39 -0
- package/build/shared/constants.js +3 -1
- package/build/shared/errors/baseError.js +2 -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/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/IOrganisation.js +21 -2
- package/build/shared/interfaces/IProfile.js +1 -1
- package/build/shared/interfaces/ISayNodeSettings.js +3 -0
- package/build/shared/interfaces/ai.js +0 -1
- package/build/shared/interfaces/amazonLexV2Interface.js +3 -0
- package/build/shared/interfaces/amqpInterface.js +1 -1
- package/build/shared/interfaces/analytics/IAnalyticsRating.js +13 -0
- package/build/shared/interfaces/analytics/IStepEvent.js +2 -0
- package/build/shared/interfaces/fileStorage.js +23 -0
- package/build/shared/interfaces/handover.js +74 -4
- package/build/shared/interfaces/journeys/IJourney.js +1 -1
- package/build/shared/interfaces/management/deleteOrganisation/deleteOrganisationTypes.js +3 -0
- package/build/shared/interfaces/messageAPI/analytics.js +3 -0
- package/build/shared/interfaces/messageAPI/endpoints.js +89 -3
- 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 +25 -2
- package/build/shared/interfaces/resources/IChart.js +2 -1
- package/build/shared/interfaces/resources/IChartNode.js +3 -2
- 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 +2 -0
- 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 +1 -1
- package/build/shared/interfaces/resources/ILexiconEntry.js +1 -1
- package/build/shared/interfaces/resources/INodeDescriptorSet.js +5 -1
- package/build/shared/interfaces/resources/IOrganisationDeletion.js +10 -0
- package/build/shared/interfaces/resources/IPlaybookRun.js +7 -7
- package/build/shared/interfaces/resources/IProject.js +14 -1
- package/build/shared/interfaces/resources/IRemoveDuplicatedSlotsAndUpdateLexionEntries.js +3 -0
- package/build/shared/interfaces/resources/TNLUConnectorType.js +1 -0
- package/build/shared/interfaces/resources/TRestChannelType.js +5 -0
- package/build/shared/interfaces/resources/TSocketChannelType.js +5 -5
- package/build/shared/interfaces/resources/TWebhookChannelType.js +10 -0
- package/build/shared/interfaces/resources/intent/IIntent.js +26 -8
- package/build/shared/interfaces/resources/intent/IIntentTrainGroup.js +19 -1
- package/build/shared/interfaces/resources/settings/IAgentSettings.js +47 -6
- 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/IUpdateCognigyLiveAgentInboxRest_2_0.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/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/publish/IPublishAnalyticsRestDataBody.js +4 -0
- package/build/shared/interfaces/restAPI/management/organisations/v2.0/IDeleteOrganisationRest_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/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/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/{flow/v2.0/intent → locales/v2.0/yesNoIntents}/ITrainYesNoIntentsRest_2_0.js +0 -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 +2 -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 +4 -0
- package/build/shared/interfaces/security/IRole.js +13 -1
- package/build/shared/interfaces/trainer/ITrainerRecord.js +1 -1
- package/build/shared/interfaces/user.js +1 -1
- package/package.json +40 -31
- package/types/index.d.ts +1734 -501
|
@@ -6,7 +6,7 @@ const createNodeDescriptor_1 = require("../../../createNodeDescriptor");
|
|
|
6
6
|
/** Helper Modules */
|
|
7
7
|
const design_1 = require("../utils/design");
|
|
8
8
|
const paramUtils_1 = require("../utils/paramUtils");
|
|
9
|
-
exports.sendMessageNode = createNodeDescriptor_1.createNodeDescriptor({
|
|
9
|
+
exports.sendMessageNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
10
10
|
type: "sendMessage",
|
|
11
11
|
defaultLabel: "Send Message",
|
|
12
12
|
summary: "Sends a prompt via VG",
|
|
@@ -208,7 +208,7 @@ exports.sendMessageNode = createNodeDescriptor_1.createNodeDescriptor({
|
|
|
208
208
|
type: "json",
|
|
209
209
|
defaultValue: "{}"
|
|
210
210
|
}
|
|
211
|
-
].concat(paramUtils_1.getParameterFields()),
|
|
211
|
+
].concat((0, paramUtils_1.getParameterFields)()),
|
|
212
212
|
sections: [
|
|
213
213
|
{
|
|
214
214
|
key: "advanced",
|
|
@@ -222,7 +222,7 @@ exports.sendMessageNode = createNodeDescriptor_1.createNodeDescriptor({
|
|
|
222
222
|
value: true
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
|
-
].concat(paramUtils_1.getParamSections({ key: "setActivityParams", value: true })),
|
|
225
|
+
].concat((0, paramUtils_1.getParamSections)({ key: "setActivityParams", value: true })),
|
|
226
226
|
form: [
|
|
227
227
|
{ type: "field", key: "text" },
|
|
228
228
|
{ type: "field", key: "setActivityParams" },
|
|
@@ -249,7 +249,7 @@ exports.sendMessageNode = createNodeDescriptor_1.createNodeDescriptor({
|
|
|
249
249
|
const { text, activityParams, setActivityParams } = config;
|
|
250
250
|
let compiledParams = activityParams || {};
|
|
251
251
|
if (setActivityParams) {
|
|
252
|
-
paramUtils_1.compileParams(config, compiledParams);
|
|
252
|
+
(0, paramUtils_1.compileParams)(config, compiledParams);
|
|
253
253
|
}
|
|
254
254
|
if (text) {
|
|
255
255
|
api.output(null, {
|
|
@@ -5,7 +5,7 @@ exports.sendMetaDataNode = void 0;
|
|
|
5
5
|
const createNodeDescriptor_1 = require("../../../createNodeDescriptor");
|
|
6
6
|
/** Helper Modules */
|
|
7
7
|
const design_1 = require("../utils/design");
|
|
8
|
-
exports.sendMetaDataNode = createNodeDescriptor_1.createNodeDescriptor({
|
|
8
|
+
exports.sendMetaDataNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
9
9
|
type: "sendMetaData",
|
|
10
10
|
defaultLabel: "Send Meta Data",
|
|
11
11
|
summary: "Sends meta data via SIP INFO messages",
|
|
@@ -6,7 +6,7 @@ const createNodeDescriptor_1 = require("../../../createNodeDescriptor");
|
|
|
6
6
|
/** Helper Modules */
|
|
7
7
|
const design_1 = require("../utils/design");
|
|
8
8
|
const paramUtils_1 = require("../utils/paramUtils");
|
|
9
|
-
exports.setSessionParamsNode = createNodeDescriptor_1.createNodeDescriptor({
|
|
9
|
+
exports.setSessionParamsNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
10
10
|
type: "setSessionParams",
|
|
11
11
|
defaultLabel: "Set Session Parameters",
|
|
12
12
|
summary: "Sets VG configuration settings for the session",
|
|
@@ -21,7 +21,7 @@ exports.setSessionParamsNode = createNodeDescriptor_1.createNodeDescriptor({
|
|
|
21
21
|
required: true
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
].concat(paramUtils_1.getParameterFields()),
|
|
24
|
+
].concat((0, paramUtils_1.getParameterFields)()),
|
|
25
25
|
sections: [
|
|
26
26
|
{
|
|
27
27
|
key: "advanced",
|
|
@@ -31,7 +31,7 @@ exports.setSessionParamsNode = createNodeDescriptor_1.createNodeDescriptor({
|
|
|
31
31
|
"sessionParams",
|
|
32
32
|
]
|
|
33
33
|
}
|
|
34
|
-
].concat(paramUtils_1.getParamSections()),
|
|
34
|
+
].concat((0, paramUtils_1.getParamSections)()),
|
|
35
35
|
appearance: {
|
|
36
36
|
color: design_1.nodeColor
|
|
37
37
|
},
|
|
@@ -51,7 +51,7 @@ exports.setSessionParamsNode = createNodeDescriptor_1.createNodeDescriptor({
|
|
|
51
51
|
const { api } = cognigy;
|
|
52
52
|
const { sessionParams } = config;
|
|
53
53
|
let compiledParams = sessionParams || {};
|
|
54
|
-
paramUtils_1.compileParams(config, compiledParams);
|
|
54
|
+
(0, paramUtils_1.compileParams)(config, compiledParams);
|
|
55
55
|
// output the activity to the voice gateway
|
|
56
56
|
api.output(null, {
|
|
57
57
|
"_cognigy": {
|
|
@@ -9,6 +9,7 @@ exports.getParamSections = exports.getParameterFields = exports.compileParams =
|
|
|
9
9
|
const compileParams = (config, compiledParams) => {
|
|
10
10
|
const EXCLUDEDKEYS = ["activityParams", "text", "setActivityParams", "sttContextBoostAzure", "sttContextBoost", "azureUseContextPhrases"];
|
|
11
11
|
Object.keys(config).forEach((key) => {
|
|
12
|
+
var _a;
|
|
12
13
|
if (EXCLUDEDKEYS.indexOf(key) === -1) {
|
|
13
14
|
if (!key.startsWith("dtmfCollect") || (key.startsWith("dtmfCollect") && config["dtmfCollect"])) {
|
|
14
15
|
switch (typeof config[key]) {
|
|
@@ -38,7 +39,7 @@ const compileParams = (config, compiledParams) => {
|
|
|
38
39
|
break;
|
|
39
40
|
case "number":
|
|
40
41
|
case "string":
|
|
41
|
-
if (config[key])
|
|
42
|
+
if (config[key] || ((_a = config[key]) === null || _a === void 0 ? void 0 : _a.toString()) === '0')
|
|
42
43
|
compiledParams[key] = config[key];
|
|
43
44
|
break;
|
|
44
45
|
case "boolean":
|
|
@@ -128,9 +129,9 @@ const getParameterFields = () => [
|
|
|
128
129
|
type: "slider",
|
|
129
130
|
label: "Barge In Minimum Words",
|
|
130
131
|
description: "Defines the minimum number of words that the user must say for the Voice Gateway to consider it a barge in",
|
|
131
|
-
defaultValue:
|
|
132
|
+
defaultValue: 1,
|
|
132
133
|
params: {
|
|
133
|
-
min:
|
|
134
|
+
min: 1,
|
|
134
135
|
max: 5,
|
|
135
136
|
step: 1,
|
|
136
137
|
},
|
|
@@ -188,7 +189,7 @@ const getParameterFields = () => [
|
|
|
188
189
|
key: "userNoInputRetries",
|
|
189
190
|
type: "number",
|
|
190
191
|
label: "No User Input Retries",
|
|
191
|
-
description: "Defines the maximum number of allowed timeouts for no user input",
|
|
192
|
+
description: "Defines the maximum number of allowed timeouts for no user input.",
|
|
192
193
|
defaultValue: 0,
|
|
193
194
|
},
|
|
194
195
|
{
|
|
@@ -198,6 +199,17 @@ const getParameterFields = () => [
|
|
|
198
199
|
description: "Send an data input to the Flow if there is no user input",
|
|
199
200
|
defaultValue: false,
|
|
200
201
|
},
|
|
202
|
+
{
|
|
203
|
+
key: "userNoInputAutoHangup",
|
|
204
|
+
type: "toggle",
|
|
205
|
+
label: "Hangup after all retries",
|
|
206
|
+
description: "Automatically hangup if there is still no user input after all retries",
|
|
207
|
+
defaultValue: false,
|
|
208
|
+
condition: {
|
|
209
|
+
key: "userNoInputSendEvent",
|
|
210
|
+
value: true
|
|
211
|
+
}
|
|
212
|
+
},
|
|
201
213
|
{
|
|
202
214
|
key: "userNoInputSpeech",
|
|
203
215
|
type: "cognigyText",
|
|
@@ -239,10 +251,14 @@ const getParameterFields = () => [
|
|
|
239
251
|
type: "number",
|
|
240
252
|
label: "Continuous ASR Timeout",
|
|
241
253
|
description: "Defines the automatic speech recognition (ASR) timeout (in milliseconds)",
|
|
242
|
-
defaultValue:
|
|
254
|
+
defaultValue: 3000,
|
|
243
255
|
condition: {
|
|
244
256
|
key: "continuousASR",
|
|
245
257
|
value: true
|
|
258
|
+
},
|
|
259
|
+
params: {
|
|
260
|
+
min: 500,
|
|
261
|
+
max: 60000
|
|
246
262
|
}
|
|
247
263
|
},
|
|
248
264
|
{
|
|
@@ -317,6 +333,9 @@ const getParameterFields = () => [
|
|
|
317
333
|
condition: {
|
|
318
334
|
key: "dtmfCollect",
|
|
319
335
|
value: true
|
|
336
|
+
},
|
|
337
|
+
params: {
|
|
338
|
+
min: 1
|
|
320
339
|
}
|
|
321
340
|
},
|
|
322
341
|
{
|
|
@@ -435,6 +454,7 @@ const getParamSections = (condition) => [
|
|
|
435
454
|
"userNoInputTimeoutMS",
|
|
436
455
|
"userNoInputRetries",
|
|
437
456
|
"userNoInputSendEvent",
|
|
457
|
+
"userNoInputAutoHangup",
|
|
438
458
|
"userNoInputSpeech",
|
|
439
459
|
"userNoInputUrl",
|
|
440
460
|
],
|
|
@@ -7,14 +7,18 @@ const dtmf_1 = require("./nodes/dtmf");
|
|
|
7
7
|
const hangup_1 = require("./nodes/hangup");
|
|
8
8
|
const play_1 = require("./nodes/play");
|
|
9
9
|
const refer_1 = require("./nodes/refer");
|
|
10
|
+
const transfer_1 = require("./nodes/transfer");
|
|
10
11
|
const setSessionConfig_1 = require("./nodes/setSessionConfig");
|
|
11
|
-
|
|
12
|
+
const sendMetadata_1 = require("./nodes/sendMetadata");
|
|
13
|
+
exports.cognigyVoiceGateway2Module = (0, createNodeDescriptor_1.createExtension)({
|
|
12
14
|
nodes: [
|
|
13
15
|
setSessionConfig_1.setSessionConfigNode,
|
|
14
16
|
dtmf_1.dtmfNode,
|
|
15
17
|
hangup_1.hangupNode,
|
|
16
18
|
play_1.playNode,
|
|
17
|
-
refer_1.referNode
|
|
19
|
+
refer_1.referNode,
|
|
20
|
+
transfer_1.transferNode,
|
|
21
|
+
sendMetadata_1.sendMetadataNode
|
|
18
22
|
],
|
|
19
23
|
connections: []
|
|
20
24
|
});
|
|
@@ -5,25 +5,30 @@ exports.dtmfNode = void 0;
|
|
|
5
5
|
const createNodeDescriptor_1 = require("../../../createNodeDescriptor");
|
|
6
6
|
/** Helper Modules */
|
|
7
7
|
const design_1 = require("../utils/design");
|
|
8
|
-
exports.dtmfNode = createNodeDescriptor_1.createNodeDescriptor({
|
|
8
|
+
exports.dtmfNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
9
9
|
type: "dtmf",
|
|
10
10
|
defaultLabel: "DTMF",
|
|
11
|
+
summary: "Plays DTMF digits to the caller",
|
|
12
|
+
preview: {
|
|
13
|
+
key: "dtmf",
|
|
14
|
+
type: "text"
|
|
15
|
+
},
|
|
11
16
|
appearance: {
|
|
12
17
|
color: design_1.nodeColor
|
|
13
18
|
},
|
|
14
19
|
fields: [
|
|
15
20
|
{
|
|
16
21
|
key: "dtmf",
|
|
17
|
-
label: "Digit
|
|
22
|
+
label: "Digit Sequence",
|
|
18
23
|
description: "Digit sequence to play to the caller",
|
|
19
|
-
type: "
|
|
24
|
+
type: "cognigyText",
|
|
20
25
|
params: {
|
|
21
26
|
required: true
|
|
22
27
|
}
|
|
23
28
|
},
|
|
24
29
|
{
|
|
25
30
|
key: "duration",
|
|
26
|
-
label: "Pause
|
|
31
|
+
label: "Pause Time",
|
|
27
32
|
description: "Pause time in ms between digits",
|
|
28
33
|
type: "slider",
|
|
29
34
|
defaultValue: 500,
|
|
@@ -34,7 +39,6 @@ exports.dtmfNode = createNodeDescriptor_1.createNodeDescriptor({
|
|
|
34
39
|
}
|
|
35
40
|
}
|
|
36
41
|
],
|
|
37
|
-
summary: "Plays DTMF digits to the caller",
|
|
38
42
|
function: async ({ cognigy, config }) => {
|
|
39
43
|
const { api } = cognigy;
|
|
40
44
|
const { dtmf, duration } = config;
|
|
@@ -4,45 +4,43 @@ exports.hangupNode = void 0;
|
|
|
4
4
|
/** Custom Modules */
|
|
5
5
|
const createNodeDescriptor_1 = require("../../../createNodeDescriptor");
|
|
6
6
|
/** Helper Modules */
|
|
7
|
+
const constants_1 = require("../utils/constants");
|
|
7
8
|
const design_1 = require("../utils/design");
|
|
8
|
-
|
|
9
|
+
const hangup_mapper_1 = require("../../voice/mappers/hangup.mapper");
|
|
10
|
+
exports.hangupNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
9
11
|
type: "hangup",
|
|
10
12
|
defaultLabel: "Hang Up",
|
|
13
|
+
preview: {
|
|
14
|
+
key: "hangupReason",
|
|
15
|
+
type: "text"
|
|
16
|
+
},
|
|
11
17
|
appearance: {
|
|
12
18
|
color: design_1.nodeColor
|
|
13
19
|
},
|
|
20
|
+
summary: "Hangs up the call",
|
|
14
21
|
fields: [
|
|
15
22
|
{
|
|
16
23
|
key: "hangupReason",
|
|
17
24
|
label: "Reason for hang up",
|
|
18
|
-
type: "
|
|
25
|
+
type: "cognigyText",
|
|
19
26
|
defaultValue: "Bot ended the call",
|
|
20
27
|
params: {
|
|
21
28
|
required: true
|
|
22
29
|
}
|
|
23
30
|
}
|
|
24
31
|
],
|
|
25
|
-
summary: "Hangs up the call",
|
|
26
32
|
function: async ({ cognigy, config }) => {
|
|
27
33
|
const { api } = cognigy;
|
|
28
34
|
const { hangupReason } = config;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
};
|
|
35
|
+
try {
|
|
36
|
+
const payload = hangup_mapper_1.hangUp.handleInput(constants_1.ENDPOINTS.VOICE_GATEWAY, hangupReason);
|
|
37
|
+
api.say(null, {
|
|
38
|
+
_cognigy: payload
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
throw new Error(`Error on hangup node. Error message: ${error.message}`);
|
|
38
43
|
}
|
|
39
|
-
api.say(null, {
|
|
40
|
-
_cognigy: {
|
|
41
|
-
_voiceGateway2: {
|
|
42
|
-
json: voiceGateway2Payload
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
44
|
}
|
|
47
45
|
});
|
|
48
46
|
//# sourceMappingURL=hangup.js.map
|
|
@@ -4,12 +4,18 @@ exports.playNode = void 0;
|
|
|
4
4
|
/** Custom Modules */
|
|
5
5
|
const createNodeDescriptor_1 = require("../../../createNodeDescriptor");
|
|
6
6
|
/** Helper Modules */
|
|
7
|
+
const play_mapper_1 = require("../../voice/mappers/play.mapper");
|
|
8
|
+
const constants_1 = require("../utils/constants");
|
|
7
9
|
const design_1 = require("../utils/design");
|
|
8
|
-
const strip_nulls_1 = require("../utils/strip-nulls");
|
|
9
10
|
const setSessionConfig_1 = require("./setSessionConfig");
|
|
10
|
-
exports.playNode = createNodeDescriptor_1.createNodeDescriptor({
|
|
11
|
+
exports.playNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
11
12
|
type: "play",
|
|
12
13
|
defaultLabel: "Play",
|
|
14
|
+
summary: "Streams a media file into the call with the ability to loop it",
|
|
15
|
+
preview: {
|
|
16
|
+
key: "url",
|
|
17
|
+
type: "text"
|
|
18
|
+
},
|
|
13
19
|
appearance: {
|
|
14
20
|
color: design_1.nodeColor
|
|
15
21
|
},
|
|
@@ -17,7 +23,7 @@ exports.playNode = createNodeDescriptor_1.createNodeDescriptor({
|
|
|
17
23
|
{
|
|
18
24
|
key: "url",
|
|
19
25
|
label: "Media URL",
|
|
20
|
-
type: "
|
|
26
|
+
type: "cognigyText",
|
|
21
27
|
description: "You can use MP3 or WAV encoded files",
|
|
22
28
|
params: {
|
|
23
29
|
required: true
|
|
@@ -51,16 +57,6 @@ exports.playNode = createNodeDescriptor_1.createNodeDescriptor({
|
|
|
51
57
|
...setSessionConfig_1.voiceConfigFields
|
|
52
58
|
],
|
|
53
59
|
sections: [
|
|
54
|
-
{
|
|
55
|
-
key: "params_tts",
|
|
56
|
-
label: "Synthesizer (TTS)",
|
|
57
|
-
defaultCollapsed: true,
|
|
58
|
-
fields: ["ttsVoice", "ttsLanguage", "ttsVendor"],
|
|
59
|
-
condition: {
|
|
60
|
-
key: "setActivityParams",
|
|
61
|
-
value: true
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
60
|
{
|
|
65
61
|
key: "params_stt",
|
|
66
62
|
label: "Recognizer (STT)",
|
|
@@ -81,16 +77,6 @@ exports.playNode = createNodeDescriptor_1.createNodeDescriptor({
|
|
|
81
77
|
value: true
|
|
82
78
|
}
|
|
83
79
|
},
|
|
84
|
-
{
|
|
85
|
-
key: "params_user_timeouts",
|
|
86
|
-
label: "User Input Timeout",
|
|
87
|
-
defaultCollapsed: true,
|
|
88
|
-
fields: ["userNoInputMode", "userNoInputSpeech", "userNoInputUrl", "userNoInputTimeout", "userNoInputRetries"],
|
|
89
|
-
condition: {
|
|
90
|
-
key: "setActivityParams",
|
|
91
|
-
value: true
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
80
|
{
|
|
95
81
|
key: "params_dtmf",
|
|
96
82
|
label: "DTMF",
|
|
@@ -100,100 +86,28 @@ exports.playNode = createNodeDescriptor_1.createNodeDescriptor({
|
|
|
100
86
|
key: "setActivityParams",
|
|
101
87
|
value: true
|
|
102
88
|
}
|
|
103
|
-
}
|
|
89
|
+
},
|
|
104
90
|
],
|
|
105
91
|
form: [
|
|
106
92
|
{ type: "field", key: "url" },
|
|
107
93
|
{ type: "field", key: "loop" },
|
|
108
94
|
{ type: "field", key: "setActivityParams" },
|
|
109
|
-
{ type: "section", key: "params_tts" },
|
|
110
95
|
{ type: "section", key: "params_stt" },
|
|
111
96
|
{ type: "section", key: "params_bargein" },
|
|
112
|
-
{ type: "section", key: "params_user_timeouts" },
|
|
113
97
|
{ type: "section", key: "params_dtmf" },
|
|
114
98
|
],
|
|
115
|
-
summary: "Streams a media file into the call with the ability to loop it",
|
|
116
99
|
function: async ({ cognigy, config }) => {
|
|
117
100
|
const { api } = cognigy;
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
if (setActivityParams) {
|
|
126
|
-
const activityConfig = {};
|
|
127
|
-
const synthesizer = {
|
|
128
|
-
language: config.ttsLanguage,
|
|
129
|
-
voice: config.ttsVoice,
|
|
130
|
-
vendor: config.ttsVendor
|
|
131
|
-
};
|
|
132
|
-
activityConfig.synthesizer = synthesizer;
|
|
133
|
-
const recognizer = {
|
|
134
|
-
language: config.sttLanguage,
|
|
135
|
-
vendor: config.sttVendor || "default",
|
|
136
|
-
hints: config.sttHints,
|
|
137
|
-
vad: {
|
|
138
|
-
enable: config.sttVadEnabled,
|
|
139
|
-
mode: config.sttVadMode,
|
|
140
|
-
voiceMs: config.sttVadVoiceMs
|
|
141
|
-
}
|
|
142
|
-
};
|
|
143
|
-
activityConfig.recognizer = recognizer;
|
|
144
|
-
const bargein = {
|
|
145
|
-
enable: false,
|
|
146
|
-
minBargeinWordCount: config.bargeInMinWordCount,
|
|
147
|
-
input: [],
|
|
148
|
-
actionHook: "voice"
|
|
149
|
-
};
|
|
150
|
-
if (config.bargeInOnDtmf) {
|
|
151
|
-
bargein.dtmfBargein = true;
|
|
152
|
-
bargein.input.push("digits");
|
|
153
|
-
}
|
|
154
|
-
if (config.bargeInOnSpeech) {
|
|
155
|
-
bargein.input.push("speech");
|
|
156
|
-
}
|
|
157
|
-
if (bargein.input.length > 0) {
|
|
158
|
-
bargein.enable = true;
|
|
159
|
-
bargein.sticky = true;
|
|
160
|
-
}
|
|
161
|
-
activityConfig.bargeIn = bargein;
|
|
162
|
-
const user = {
|
|
163
|
-
noInputMode: config.userNoInputMode,
|
|
164
|
-
noInputTimeout: (config.userNoInputTimeout || 10000) / 1000,
|
|
165
|
-
noInputRetries: config.userNoInputRetries,
|
|
166
|
-
noInputSpeech: config.userNoInputSpeech,
|
|
167
|
-
noInputUrl: config.userNoInputUrl
|
|
168
|
-
};
|
|
169
|
-
activityConfig.user = user;
|
|
170
|
-
if (config.dtmfEnable) {
|
|
171
|
-
if (!activityConfig.bargeIn) {
|
|
172
|
-
activityConfig.bargeIn = {
|
|
173
|
-
enable: false
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
activityConfig.bargeIn.interDigitTimeout = (config.dtmfInterDigitTimeout || 500) / 1000;
|
|
177
|
-
activityConfig.bargeIn.maxDigits = config.dtmfMaxDigits;
|
|
178
|
-
activityConfig.bargeIn.minDigits = config.dtmfMinDigits;
|
|
179
|
-
activityConfig.bargeIn.finishOnKey = config.dtmfSubmitDigit;
|
|
180
|
-
if (!voiceGateway2Payload.play.activityConfig) {
|
|
181
|
-
voiceGateway2Payload.play.activityConfig = {};
|
|
182
|
-
}
|
|
183
|
-
voiceGateway2Payload.play.activityConfig.dtmf = true;
|
|
184
|
-
}
|
|
185
|
-
if (Object.keys(activityConfig).length > 0) {
|
|
186
|
-
voiceGateway2Payload.play.activityConfig = activityConfig;
|
|
187
|
-
}
|
|
101
|
+
try {
|
|
102
|
+
const payload = play_mapper_1.play.handleInput(constants_1.ENDPOINTS.VOICE_GATEWAY, config);
|
|
103
|
+
api.say(null, {
|
|
104
|
+
_cognigy: payload
|
|
105
|
+
});
|
|
188
106
|
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
json: voiceGateway2Payload
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
});
|
|
107
|
+
catch (error) {
|
|
108
|
+
throw new Error(`Error on play node. Error message: ${error.message}`);
|
|
109
|
+
}
|
|
110
|
+
;
|
|
197
111
|
}
|
|
198
112
|
});
|
|
199
113
|
//# sourceMappingURL=play.js.map
|
|
@@ -4,13 +4,25 @@ exports.referNode = void 0;
|
|
|
4
4
|
/** Custom Modules */
|
|
5
5
|
const createNodeDescriptor_1 = require("../../../createNodeDescriptor");
|
|
6
6
|
/** Helper Modules */
|
|
7
|
+
const transfer_mapper_1 = require("../../voice/mappers/transfer.mapper");
|
|
8
|
+
const constants_1 = require("../utils/constants");
|
|
7
9
|
const design_1 = require("../utils/design");
|
|
8
|
-
|
|
10
|
+
const helper_1 = require("../utils/helper");
|
|
11
|
+
exports.referNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
9
12
|
type: "refer",
|
|
10
13
|
defaultLabel: "Refer",
|
|
14
|
+
summary: "Transfer the call to another target",
|
|
15
|
+
preview: {
|
|
16
|
+
key: "referTo",
|
|
17
|
+
type: "text"
|
|
18
|
+
},
|
|
11
19
|
appearance: {
|
|
12
20
|
color: design_1.nodeColor
|
|
13
21
|
},
|
|
22
|
+
constraints: {
|
|
23
|
+
placement: {},
|
|
24
|
+
creatable: false,
|
|
25
|
+
},
|
|
14
26
|
fields: [
|
|
15
27
|
{
|
|
16
28
|
key: "referTo",
|
|
@@ -21,24 +33,71 @@ exports.referNode = createNodeDescriptor_1.createNodeDescriptor({
|
|
|
21
33
|
},
|
|
22
34
|
description: "E.164 syntax or a SIP URI are supported",
|
|
23
35
|
defaultValue: "+49176123456789"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
key: "useTransferSipHeaders",
|
|
39
|
+
label: "Custom Transfer SIP Headers",
|
|
40
|
+
type: "toggle",
|
|
41
|
+
description: "Add data to be sent as SIP headers in the generated SIP message",
|
|
42
|
+
defaultValue: false
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
key: "transferSipHeaders",
|
|
46
|
+
label: "Transfer SIP Headers",
|
|
47
|
+
type: "json",
|
|
48
|
+
description: "The data to be sent as SIP headers in the generated SIP message",
|
|
49
|
+
defaultValue: {
|
|
50
|
+
"X-Custom-Header": "YourValue"
|
|
51
|
+
},
|
|
52
|
+
condition: {
|
|
53
|
+
key: "useTransferSipHeaders",
|
|
54
|
+
value: true
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
sections: [
|
|
59
|
+
{
|
|
60
|
+
key: "advanced",
|
|
61
|
+
label: "Advanced",
|
|
62
|
+
defaultCollapsed: true,
|
|
63
|
+
fields: [
|
|
64
|
+
"useTransferSipHeaders",
|
|
65
|
+
"transferSipHeaders",
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
form: [
|
|
70
|
+
{
|
|
71
|
+
type: "field",
|
|
72
|
+
key: "referTo"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
type: "section",
|
|
76
|
+
key: "advanced"
|
|
24
77
|
}
|
|
25
78
|
],
|
|
26
|
-
summary: "Transfer the call to another target",
|
|
27
79
|
function: async ({ cognigy, config }) => {
|
|
28
|
-
const { api } = cognigy;
|
|
29
|
-
const { referTo } = config;
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
80
|
+
const { api, input } = cognigy;
|
|
81
|
+
const { referTo, useTransferSipHeaders, transferSipHeaders } = config;
|
|
82
|
+
const transferParams = {
|
|
83
|
+
transferReason: '',
|
|
84
|
+
transferTarget: (0, helper_1.cleanTarget)(referTo),
|
|
85
|
+
useTransferSipHeaders,
|
|
86
|
+
transferSipHeaders
|
|
34
87
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
88
|
+
try {
|
|
89
|
+
const payload = transfer_mapper_1.transfer.handleInput(constants_1.ENDPOINTS.VOICE_GATEWAY, transferParams, false);
|
|
90
|
+
if (input.channel === "adminconsole") {
|
|
91
|
+
api.output('You are using the deprecated Refer Node. Please replace it with new Transfer Node in the Node Selection Menu.', null);
|
|
40
92
|
}
|
|
41
|
-
|
|
93
|
+
api.log('error', 'You are using the deprecated Refer Node. Please replace it with new Transfer Node in the Node Selection Menu.');
|
|
94
|
+
api.say(null, {
|
|
95
|
+
_cognigy: payload
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
throw new Error(`Error on Refer node. Error message: ${error.message}`);
|
|
100
|
+
}
|
|
42
101
|
}
|
|
43
102
|
});
|
|
44
103
|
//# sourceMappingURL=refer.js.map
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendMetadataNode = void 0;
|
|
4
|
+
/** Custom Modules */
|
|
5
|
+
const createNodeDescriptor_1 = require("../../../createNodeDescriptor");
|
|
6
|
+
/** Helper Modules */
|
|
7
|
+
const design_1 = require("../utils/design");
|
|
8
|
+
const helper_1 = require("../utils/helper");
|
|
9
|
+
exports.sendMetadataNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
10
|
+
type: "sendMetadata",
|
|
11
|
+
defaultLabel: "Send Metadata",
|
|
12
|
+
summary: "Sends metadata via SIP INFO messages",
|
|
13
|
+
fields: [
|
|
14
|
+
{
|
|
15
|
+
key: "metadata",
|
|
16
|
+
label: "Metadata",
|
|
17
|
+
type: "json",
|
|
18
|
+
defaultValue: { myParamName: "myParamValue" },
|
|
19
|
+
params: {
|
|
20
|
+
require: true,
|
|
21
|
+
},
|
|
22
|
+
description: "The metadata to send via SIP INFO messages",
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
appearance: {
|
|
26
|
+
color: design_1.nodeColor,
|
|
27
|
+
},
|
|
28
|
+
form: [
|
|
29
|
+
{
|
|
30
|
+
type: "field",
|
|
31
|
+
key: "metadata",
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
function: async ({ cognigy, config }) => {
|
|
35
|
+
const { api } = cognigy;
|
|
36
|
+
const { metadata } = config;
|
|
37
|
+
const voiceGateway2Payload = {
|
|
38
|
+
"sip:request": {
|
|
39
|
+
headers: {
|
|
40
|
+
"Content-Type": "application/json",
|
|
41
|
+
},
|
|
42
|
+
body: "",
|
|
43
|
+
method: "INFO",
|
|
44
|
+
actionHook: "/info",
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
if (metadata) {
|
|
48
|
+
if ((0, helper_1.isValidJSON)(metadata)) {
|
|
49
|
+
voiceGateway2Payload["sip:request"].body = JSON.stringify(metadata);
|
|
50
|
+
api.say(null, {
|
|
51
|
+
_cognigy: {
|
|
52
|
+
_voiceGateway2: {
|
|
53
|
+
json: voiceGateway2Payload,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
api.log("error", "Invalid JSON in Metadata Field");
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
//# sourceMappingURL=sendMetadata.js.map
|