@cognigy/rest-api-client 0.12.0 → 0.13.1
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/CHANGELOG.md +15 -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
|
@@ -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: {
|
|
@@ -10,7 +10,7 @@ const design_1 = require("./utils/design");
|
|
|
10
10
|
* Purpose:
|
|
11
11
|
* Manually request permissions or token exchange
|
|
12
12
|
*/
|
|
13
|
-
exports.microsoftGetTokenNode = createNodeDescriptor_1.createNodeDescriptor({
|
|
13
|
+
exports.microsoftGetTokenNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
14
14
|
type: "microsoftGetToken",
|
|
15
15
|
defaultLabel: "Get Token",
|
|
16
16
|
summary: "Get or renew a token for SSO",
|
|
@@ -9,7 +9,7 @@ const getToken_1 = require("./getToken");
|
|
|
9
9
|
const invalidateToken_1 = require("./invalidateToken");
|
|
10
10
|
const tokenGranted_1 = require("./tokenStatus/tokenGranted");
|
|
11
11
|
const tokenNotGranted_1 = require("./tokenStatus/tokenNotGranted");
|
|
12
|
-
exports.cognigyMicrosoftModule = createNodeDescriptor_1.createExtension({
|
|
12
|
+
exports.cognigyMicrosoftModule = (0, createNodeDescriptor_1.createExtension)({
|
|
13
13
|
nodes: [
|
|
14
14
|
tokenStatus_1.microsoftTokenStatusNode,
|
|
15
15
|
invalidateToken_1.microsoftInvalidateTokenNode,
|
|
@@ -10,7 +10,7 @@ const design_1 = require("./utils/design");
|
|
|
10
10
|
* Purpose:
|
|
11
11
|
* The SSO token gets removed
|
|
12
12
|
*/
|
|
13
|
-
exports.microsoftInvalidateTokenNode = createNodeDescriptor_1.createNodeDescriptor({
|
|
13
|
+
exports.microsoftInvalidateTokenNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
14
14
|
type: "microsoftInvalidateToken",
|
|
15
15
|
defaultLabel: "Invalidate Token",
|
|
16
16
|
summary: "Remove the SSO Token",
|
|
@@ -10,7 +10,7 @@ const design_1 = require("../utils/design");
|
|
|
10
10
|
* Purpose:
|
|
11
11
|
* divide the flow into granted and not granted requests
|
|
12
12
|
*/
|
|
13
|
-
exports.microsoftTokenStatusNode = createNodeDescriptor_1.createNodeDescriptor({
|
|
13
|
+
exports.microsoftTokenStatusNode = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
14
14
|
type: "microsoftTokenStatus",
|
|
15
15
|
defaultLabel: "Token Status",
|
|
16
16
|
summary: "Verify the token status for SSO",
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.microsoftTokenGranted = void 0;
|
|
4
4
|
const createNodeDescriptor_1 = require("../../../createNodeDescriptor");
|
|
5
5
|
const design_1 = require("../utils/design");
|
|
6
|
-
exports.microsoftTokenGranted = createNodeDescriptor_1.createNodeDescriptor({
|
|
6
|
+
exports.microsoftTokenGranted = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
7
7
|
type: "microsoftTokenGranted",
|
|
8
8
|
parentType: "microsoftTokenStatus",
|
|
9
9
|
defaultLabel: "Granted",
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.microsoftTokenNotGranted = void 0;
|
|
4
4
|
const createNodeDescriptor_1 = require("../../../createNodeDescriptor");
|
|
5
5
|
const design_1 = require("../utils/design");
|
|
6
|
-
exports.microsoftTokenNotGranted = createNodeDescriptor_1.createNodeDescriptor({
|
|
6
|
+
exports.microsoftTokenNotGranted = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
7
7
|
type: "microsoftTokenNotGranted",
|
|
8
8
|
parentType: "microsoftTokenStatus",
|
|
9
9
|
defaultLabel: "Not Granted",
|
|
@@ -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",
|
|
@@ -11,7 +11,7 @@ const logger_1 = require("../../../helper/logger");
|
|
|
11
11
|
* Purpose:
|
|
12
12
|
* Runs Cognigy NLU
|
|
13
13
|
*/
|
|
14
|
-
exports.EXECUTE_COGNIGY_NLU = createNodeDescriptor_1.createNodeDescriptor({
|
|
14
|
+
exports.EXECUTE_COGNIGY_NLU = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
15
15
|
type: "executeCognigyNLU",
|
|
16
16
|
defaultLabel: "Execute Cognigy NLU",
|
|
17
17
|
summary: "Executes the built-in Cognigy NLU",
|
|
@@ -97,6 +97,12 @@ exports.EXECUTE_COGNIGY_NLU = createNodeDescriptor_1.createNodeDescriptor({
|
|
|
97
97
|
type: "toggle",
|
|
98
98
|
label: "Find Type",
|
|
99
99
|
defaultValue: true
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
key: "processDefaultReply",
|
|
103
|
+
type: "toggle",
|
|
104
|
+
label: "Process Intent Default Reply",
|
|
105
|
+
defaultValue: false
|
|
100
106
|
}
|
|
101
107
|
],
|
|
102
108
|
sections: [
|
|
@@ -108,7 +114,8 @@ exports.EXECUTE_COGNIGY_NLU = createNodeDescriptor_1.createNodeDescriptor({
|
|
|
108
114
|
"parseIntents",
|
|
109
115
|
"parseSystemSlots",
|
|
110
116
|
"parseSlots",
|
|
111
|
-
"findType"
|
|
117
|
+
"findType",
|
|
118
|
+
"processDefaultReply"
|
|
112
119
|
]
|
|
113
120
|
}
|
|
114
121
|
],
|
|
@@ -123,7 +130,7 @@ exports.EXECUTE_COGNIGY_NLU = createNodeDescriptor_1.createNodeDescriptor({
|
|
|
123
130
|
tags: ["nlu"],
|
|
124
131
|
function: async ({ cognigy, config }) => {
|
|
125
132
|
const { api, input } = cognigy;
|
|
126
|
-
const { text, data, mode, contextKey, inputKey, parseIntents, parseSlots, parseSystemSlots, findType } = config;
|
|
133
|
+
const { text, data, mode, contextKey, inputKey, parseIntents, parseSlots, parseSystemSlots, findType, processDefaultReply } = config;
|
|
127
134
|
if (mode === "context" && !contextKey) {
|
|
128
135
|
logger_1.default.log("error", { traceId: input.traceId, disableSensitiveLogging: false }, "No context key provided in addLexiconKeyphrse with context mode");
|
|
129
136
|
return;
|
|
@@ -133,6 +140,14 @@ exports.EXECUTE_COGNIGY_NLU = createNodeDescriptor_1.createNodeDescriptor({
|
|
|
133
140
|
throw new errors_1.InvalidArgumentError("Execute Cognigy NLU is not allowed with nonConversational endpoint", { traceId: input.traceId, disableSensitiveLogging: false });
|
|
134
141
|
}
|
|
135
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
|
+
}
|
|
136
151
|
if (result.tokens) {
|
|
137
152
|
delete result.tokens;
|
|
138
153
|
}
|
|
@@ -9,7 +9,7 @@ const createNodeDescriptor_1 = require("../../createNodeDescriptor");
|
|
|
9
9
|
* Purpose:
|
|
10
10
|
* Answers a question based on a given context with the built-in question answering module
|
|
11
11
|
*/
|
|
12
|
-
exports.EXTRACT_ANSWER = createNodeDescriptor_1.createNodeDescriptor({
|
|
12
|
+
exports.EXTRACT_ANSWER = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
13
13
|
type: "extractAnswer",
|
|
14
14
|
defaultLabel: "Extract Answer",
|
|
15
15
|
summary: "Answers a question based on a given context with the built-in question answering module",
|
|
@@ -6,7 +6,7 @@ const objectSizeValidator_1 = require("../../../helper/objectSizeValidator");
|
|
|
6
6
|
const getFuzzySearchMaxObjectSizeInBytes = () => {
|
|
7
7
|
return parseInt(process.env.FUZZYSEARCH_MAX_OBJECT_SIZE) || 524288;
|
|
8
8
|
};
|
|
9
|
-
exports.FUZZY_SEARCH = createNodeDescriptor_1.createNodeDescriptor({
|
|
9
|
+
exports.FUZZY_SEARCH = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
10
10
|
type: "fuzzySearch",
|
|
11
11
|
defaultLabel: "Fuzzy Search",
|
|
12
12
|
summary: "Performs a fuzzy search on a given collection of source data",
|
|
@@ -232,7 +232,7 @@ exports.FUZZY_SEARCH = createNodeDescriptor_1.createNodeDescriptor({
|
|
|
232
232
|
shouldSort,
|
|
233
233
|
threshold: newThreshold,
|
|
234
234
|
};
|
|
235
|
-
const validObjectSize = objectSizeValidator_1.validateObjectSize(items, getFuzzySearchMaxObjectSizeInBytes());
|
|
235
|
+
const validObjectSize = (0, objectSizeValidator_1.validateObjectSize)(items, getFuzzySearchMaxObjectSizeInBytes());
|
|
236
236
|
let result = null;
|
|
237
237
|
if (validObjectSize.valid) {
|
|
238
238
|
result = api.fuseSearch(items, options, searchPattern);
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.MATCH_PATTERN = void 0;
|
|
4
4
|
const createNodeDescriptor_1 = require("../../createNodeDescriptor");
|
|
5
5
|
const patternMatcher_1 = require("./utils/patternMatcher");
|
|
6
|
-
exports.MATCH_PATTERN = createNodeDescriptor_1.createNodeDescriptor({
|
|
6
|
+
exports.MATCH_PATTERN = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
7
7
|
type: "matchPattern",
|
|
8
8
|
defaultLabel: "Match Pattern",
|
|
9
9
|
preview: {
|
|
@@ -56,6 +56,13 @@ exports.MATCH_PATTERN = createNodeDescriptor_1.createNodeDescriptor({
|
|
|
56
56
|
description: "Whether to tag existing slots or not",
|
|
57
57
|
type: "toggle",
|
|
58
58
|
defaultValue: true
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
key: "useFullSystemslotText",
|
|
62
|
+
label: "Replace system slots with full text",
|
|
63
|
+
description: "Match the full system slot text and use detailed values",
|
|
64
|
+
type: "toggle",
|
|
65
|
+
defaultValue: true,
|
|
59
66
|
}
|
|
60
67
|
],
|
|
61
68
|
sections: [
|
|
@@ -67,7 +74,8 @@ exports.MATCH_PATTERN = createNodeDescriptor_1.createNodeDescriptor({
|
|
|
67
74
|
"createNewSlots",
|
|
68
75
|
"tagExistingSlots",
|
|
69
76
|
"detailedCompoundSlots",
|
|
70
|
-
"
|
|
77
|
+
"useFullSystemslotText",
|
|
78
|
+
"alternateInput",
|
|
71
79
|
]
|
|
72
80
|
}
|
|
73
81
|
],
|
|
@@ -78,7 +86,7 @@ exports.MATCH_PATTERN = createNodeDescriptor_1.createNodeDescriptor({
|
|
|
78
86
|
],
|
|
79
87
|
function: async ({ cognigy, config }) => {
|
|
80
88
|
let { input, api } = cognigy;
|
|
81
|
-
const { patterns, patternGroupName, alternateInput, detailedCompoundSlots, createNewSlots, tagExistingSlots } = config;
|
|
89
|
+
const { patterns, patternGroupName, alternateInput, detailedCompoundSlots, createNewSlots, tagExistingSlots, useFullSystemslotText } = config;
|
|
82
90
|
if (!patterns || !Array.isArray(patterns) || patterns.length === 0) {
|
|
83
91
|
throw new Error("No patterns to match specified");
|
|
84
92
|
}
|
|
@@ -90,13 +98,14 @@ exports.MATCH_PATTERN = createNodeDescriptor_1.createNodeDescriptor({
|
|
|
90
98
|
if (alternateInput) {
|
|
91
99
|
nluResult = await api.executeCognigyNLU(alternateInput, {}, input.inputId, {});
|
|
92
100
|
}
|
|
93
|
-
patternMatcher_1.patternMatcher({
|
|
101
|
+
(0, patternMatcher_1.patternMatcher)({
|
|
94
102
|
input,
|
|
95
103
|
patterns,
|
|
96
104
|
patternGroupName,
|
|
97
105
|
detailedCompoundSlots,
|
|
98
106
|
tagExistingSlots,
|
|
99
107
|
createNewSlots,
|
|
108
|
+
useFullSystemslotText,
|
|
100
109
|
nluResult
|
|
101
110
|
});
|
|
102
111
|
}
|
|
@@ -9,7 +9,7 @@ const createNodeDescriptor_1 = require("../../createNodeDescriptor");
|
|
|
9
9
|
* Purpose:
|
|
10
10
|
* Fills slots dynamically by evaluating a custom regular expression
|
|
11
11
|
*/
|
|
12
|
-
exports.REGEX_SLOT_FILLER = createNodeDescriptor_1.createNodeDescriptor({
|
|
12
|
+
exports.REGEX_SLOT_FILLER = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
13
13
|
type: "regexSlotFiller",
|
|
14
14
|
defaultLabel: "Regex Slot Filler",
|
|
15
15
|
summary: "Fills Slots dynamically by evaluating a custom regular expression",
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.patternMatcher = void 0;
|
|
4
|
+
const cognigySlots_1 = require("../../../../interfaces/cognigySlots");
|
|
5
|
+
const systemSlots = new Set(cognigySlots_1.cognigySystemSlots);
|
|
4
6
|
/**
|
|
5
7
|
* Finds compound slots using pattern inside the user input
|
|
6
8
|
* @param input Cognigy Input Object
|
|
@@ -12,7 +14,8 @@ exports.patternMatcher = void 0;
|
|
|
12
14
|
* @param nluResult result from cognigy NLU since there was an alternative input
|
|
13
15
|
*/
|
|
14
16
|
const patternMatcher = (params) => {
|
|
15
|
-
|
|
17
|
+
var _a;
|
|
18
|
+
const { input, patternGroupName, detailedCompoundSlots, tagExistingSlots, createNewSlots, nluResult, useFullSystemslotText } = params;
|
|
16
19
|
let { patterns } = params;
|
|
17
20
|
// prune patterns if more than 20
|
|
18
21
|
if (patterns.length > 20) {
|
|
@@ -25,6 +28,7 @@ const patternMatcher = (params) => {
|
|
|
25
28
|
// we use let because we strip out found phrases later
|
|
26
29
|
let inputText = nluResult.text || input.text; // ci.processText
|
|
27
30
|
let inputSlots = nluResult.slots || input.slots;
|
|
31
|
+
const detailedSlots = ((_a = input.nlu) === null || _a === void 0 ? void 0 : _a.detailedSlots) || {};
|
|
28
32
|
const regexPatterns = [];
|
|
29
33
|
// go through patterns and create regex versions of each that is not empty string
|
|
30
34
|
patterns.forEach((pattern) => {
|
|
@@ -49,44 +53,14 @@ const patternMatcher = (params) => {
|
|
|
49
53
|
tags.push("");
|
|
50
54
|
const slotValues = [];
|
|
51
55
|
if (inputSlots[slotName]) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
case "TEMPERATURE":
|
|
61
|
-
inputSlots.TEMPERATURE.forEach((s) => {
|
|
62
|
-
// just add the number
|
|
63
|
-
slotValues.push(s.value);
|
|
64
|
-
});
|
|
65
|
-
break;
|
|
66
|
-
case "AGE":
|
|
67
|
-
inputSlots.AGE.forEach((s) => {
|
|
68
|
-
// just add the number
|
|
69
|
-
slotValues.push(s.value);
|
|
70
|
-
});
|
|
71
|
-
break;
|
|
72
|
-
case "PERCENTAGE":
|
|
73
|
-
inputSlots.PERCENTAGE.forEach((s) => {
|
|
74
|
-
// just add the number
|
|
75
|
-
slotValues.push(s + "%");
|
|
76
|
-
slotValues.push(s + " percent");
|
|
77
|
-
});
|
|
78
|
-
break;
|
|
79
|
-
case "NUMBER":
|
|
80
|
-
inputSlots.NUMBER.forEach((s) => {
|
|
81
|
-
// just add the number
|
|
82
|
-
slotValues.push(s);
|
|
83
|
-
});
|
|
84
|
-
break;
|
|
85
|
-
default:
|
|
86
|
-
inputSlots[slotName].forEach((s) => {
|
|
87
|
-
// it's important to use the synonym, as this is the text that was actually found
|
|
88
|
-
slotValues.push(s.synonym);
|
|
89
|
-
});
|
|
56
|
+
if (systemSlots.has(slotName)) {
|
|
57
|
+
processFoundSystemSlots(useFullSystemslotText, inputSlots, detailedSlots, slotName, slotValues);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
inputSlots[slotName].forEach((s) => {
|
|
61
|
+
// it's important to use the synonym, as this is the text that was actually found
|
|
62
|
+
slotValues.push(s.synonym);
|
|
63
|
+
});
|
|
90
64
|
}
|
|
91
65
|
const slotRegex = slotValues.join("|");
|
|
92
66
|
// replace the slots name with the list of actually found entites for this slot
|
|
@@ -94,12 +68,14 @@ const patternMatcher = (params) => {
|
|
|
94
68
|
}
|
|
95
69
|
});
|
|
96
70
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
71
|
+
if (parsedPattern != "()") {
|
|
72
|
+
regexPatterns.push({
|
|
73
|
+
"pattern": pattern,
|
|
74
|
+
"parsedPattern": parsedPattern,
|
|
75
|
+
"tags": tags,
|
|
76
|
+
"slots": slots
|
|
77
|
+
});
|
|
78
|
+
}
|
|
103
79
|
}
|
|
104
80
|
});
|
|
105
81
|
const compoundGroups = [];
|
|
@@ -127,22 +103,13 @@ const patternMatcher = (params) => {
|
|
|
127
103
|
// iterate through matches, starting at the first group result ([0] is the full match)
|
|
128
104
|
for (let i = 1; i < matches.length; i++) {
|
|
129
105
|
let originalSlot = null;
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
originalSlot = Number(matches[i]);
|
|
138
|
-
break;
|
|
139
|
-
case "DATE":
|
|
140
|
-
// @ts-ignore
|
|
141
|
-
const dateSlot = inputSlots.DATE.find(e => (e["text"] === matches[i]));
|
|
142
|
-
originalSlot = (dateSlot === null || dateSlot === void 0 ? void 0 : dateSlot.start) || (dateSlot === null || dateSlot === void 0 ? void 0 : dateSlot.end);
|
|
143
|
-
break;
|
|
144
|
-
default:
|
|
145
|
-
originalSlot = inputSlots[pattern.slots[i - 1]].find(e => (e.synonym) ? e.synonym.toLowerCase() === matches[i].toLowerCase() : false);
|
|
106
|
+
const match = matches[i];
|
|
107
|
+
const slot = pattern.slots[i - 1];
|
|
108
|
+
if (systemSlots.has(slot)) {
|
|
109
|
+
originalSlot = handleSystemSlotMatches(useFullSystemslotText, match, slot, inputSlots, detailedSlots);
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
originalSlot = inputSlots[pattern.slots[i - 1]].find(e => (e.synonym) ? e.synonym.toLowerCase() === matches[i].toLowerCase() : false);
|
|
146
113
|
}
|
|
147
114
|
// create compound groups
|
|
148
115
|
if (detailedCompoundSlots) {
|
|
@@ -194,4 +161,105 @@ const patternMatcher = (params) => {
|
|
|
194
161
|
return input;
|
|
195
162
|
};
|
|
196
163
|
exports.patternMatcher = patternMatcher;
|
|
164
|
+
const processFoundSystemSlots = (useFullSystemslotText, inputSlots, detailedSlots, slotName, slotValues) => {
|
|
165
|
+
var _a;
|
|
166
|
+
if (useFullSystemslotText) {
|
|
167
|
+
// we use the detailed system slots to get the text value
|
|
168
|
+
(_a = detailedSlots[slotName]) === null || _a === void 0 ? void 0 : _a.forEach((s) => {
|
|
169
|
+
slotValues.push(s.text);
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
else if (inputSlots[slotName]) {
|
|
173
|
+
switch (slotName) {
|
|
174
|
+
case "DATE":
|
|
175
|
+
inputSlots.DATE.forEach((s) => {
|
|
176
|
+
if (s.start)
|
|
177
|
+
slotValues.push(s["text"]);
|
|
178
|
+
});
|
|
179
|
+
break;
|
|
180
|
+
case "NUMBER":
|
|
181
|
+
inputSlots.NUMBER.forEach((s) => {
|
|
182
|
+
slotValues.push(s);
|
|
183
|
+
});
|
|
184
|
+
break;
|
|
185
|
+
case "DURATION":
|
|
186
|
+
inputSlots.DURATION.forEach((s) => {
|
|
187
|
+
slotValues.push(s["years"] || s["months"] || s["weeks"] || s["days"] || s["hours"] || s["minutes"] || s["seconds"]);
|
|
188
|
+
});
|
|
189
|
+
break;
|
|
190
|
+
case "TEMPERATURE":
|
|
191
|
+
inputSlots.TEMPERATURE.forEach((s) => {
|
|
192
|
+
slotValues.push(s.value);
|
|
193
|
+
});
|
|
194
|
+
break;
|
|
195
|
+
case "AGE":
|
|
196
|
+
inputSlots.AGE.forEach((s) => {
|
|
197
|
+
slotValues.push(s.value);
|
|
198
|
+
});
|
|
199
|
+
break;
|
|
200
|
+
case "PERCENTAGE":
|
|
201
|
+
inputSlots.PERCENTAGE.forEach((s) => {
|
|
202
|
+
slotValues.push(s + "%");
|
|
203
|
+
slotValues.push(s + " percent");
|
|
204
|
+
});
|
|
205
|
+
break;
|
|
206
|
+
case "EMAIL":
|
|
207
|
+
inputSlots.EMAIL.forEach((s) => {
|
|
208
|
+
slotValues.push(s);
|
|
209
|
+
});
|
|
210
|
+
break;
|
|
211
|
+
case "URL":
|
|
212
|
+
inputSlots.URL.forEach((s) => {
|
|
213
|
+
slotValues.push(s);
|
|
214
|
+
});
|
|
215
|
+
break;
|
|
216
|
+
case "MONEY":
|
|
217
|
+
inputSlots.MONEY.forEach((s) => {
|
|
218
|
+
slotValues.push(s.value);
|
|
219
|
+
});
|
|
220
|
+
break;
|
|
221
|
+
case "DISTANCE":
|
|
222
|
+
inputSlots.DISTANCE.forEach((s) => {
|
|
223
|
+
slotValues.push(s.value);
|
|
224
|
+
});
|
|
225
|
+
break;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
const handleSystemSlotMatches = (useFullSystemslotText, match, slotName, inputSlots, detailedSlots) => {
|
|
230
|
+
if (useFullSystemslotText) {
|
|
231
|
+
const matchedSlot = detailedSlots[slotName].find(e => (e["text"] === match));
|
|
232
|
+
if (!matchedSlot) {
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
switch (slotName) {
|
|
236
|
+
case "NUMBER":
|
|
237
|
+
case "PERCENTAGE":
|
|
238
|
+
return matchedSlot.data.value;
|
|
239
|
+
case "DATE":
|
|
240
|
+
return Object.assign(Object.assign({}, matchedSlot.data), { text: matchedSlot.text });
|
|
241
|
+
default:
|
|
242
|
+
return matchedSlot.data;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
switch (slotName) {
|
|
247
|
+
case "PERCENTAGE":
|
|
248
|
+
return Number(match.replace(new RegExp("[^0-9]", "gi"), ""));
|
|
249
|
+
case "TEMPERATURE":
|
|
250
|
+
case "AGE":
|
|
251
|
+
case "NUMBER":
|
|
252
|
+
case "MONEY":
|
|
253
|
+
case "DISTANCE":
|
|
254
|
+
case "DURATION":
|
|
255
|
+
return Number(match);
|
|
256
|
+
case "DATE":
|
|
257
|
+
// @ts-ignore
|
|
258
|
+
const dateSlot = inputSlots.DATE.find(e => (e["text"] === match));
|
|
259
|
+
return (dateSlot === null || dateSlot === void 0 ? void 0 : dateSlot.start) || (dateSlot === null || dateSlot === void 0 ? void 0 : dateSlot.end);
|
|
260
|
+
default:
|
|
261
|
+
return match;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
};
|
|
197
265
|
//# sourceMappingURL=patternMatcher.js.map
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PLACEHOLDER = void 0;
|
|
4
4
|
/* Custom modules */
|
|
5
5
|
const createNodeDescriptor_1 = require("../createNodeDescriptor");
|
|
6
|
-
exports.PLACEHOLDER = createNodeDescriptor_1.createNodeDescriptor({
|
|
6
|
+
exports.PLACEHOLDER = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
7
7
|
type: "placeholder",
|
|
8
8
|
defaultLabel: "Placeholder",
|
|
9
9
|
summary: "This node is used as a Placeholder.",
|
|
@@ -4,7 +4,7 @@ exports.REQUIRED_FIELDS = void 0;
|
|
|
4
4
|
/* Custom modules */
|
|
5
5
|
const createNodeDescriptor_1 = require("../createNodeDescriptor");
|
|
6
6
|
const mongoDBConnection_1 = require("./connectionNodes/mongoDB/mongoDBConnection");
|
|
7
|
-
exports.REQUIRED_FIELDS = createNodeDescriptor_1.createNodeDescriptor({
|
|
7
|
+
exports.REQUIRED_FIELDS = (0, createNodeDescriptor_1.createNodeDescriptor)({
|
|
8
8
|
type: "requiredFields",
|
|
9
9
|
defaultLabel: "Required Fields",
|
|
10
10
|
appearance: {
|