@cognigy/rest-api-client 0.11.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (362) hide show
  1. package/.eslintignore +15 -0
  2. package/.eslintrc.json +28 -0
  3. package/.prettierrc.json +7 -0
  4. package/.snyk +1 -1
  5. package/build/GenericAPIFn.js +3 -3
  6. package/build/GenericUploadFn.js +8 -5
  7. package/build/PluginBase.js +1 -1
  8. package/build/RestAPIClient.js +15 -1
  9. package/build/apigroups/AdministrationAPIGroup_2_0.js +68 -40
  10. package/build/apigroups/AnalyticsAPIGroup_2_0.js +12 -0
  11. package/build/apigroups/ExternalAPIGroup_2_0.js +5 -5
  12. package/build/apigroups/InsightsAPIGroup_2_0.js +58 -0
  13. package/build/apigroups/ManagementAPIGroup_2_0.js +19 -15
  14. package/build/apigroups/MetricsAPIGroup_2_0.js +29 -29
  15. package/build/apigroups/ResourcesAPIGroup_2_0.js +250 -177
  16. package/build/apigroups/SessionsAPIGroup_2_0.js +7 -7
  17. package/build/apigroups/index.js +5 -1
  18. package/build/authentication/ApiKey/ApiKeyAuthentication.js +1 -1
  19. package/build/authentication/AuthenticationAPI.js +2 -2
  20. package/build/authentication/BasicAuthentication/BasicAuthentication.js +9 -2
  21. package/build/authentication/OAuth2/ILoginByClientCredentialsParameters.js +3 -0
  22. package/build/authentication/OAuth2/IOAuth2ClientCredentialsGrantAccessTokenRequest.js +11 -0
  23. package/build/authentication/OAuth2/IOAuth2ErrorResponse.js +1 -1
  24. package/build/authentication/OAuth2/OAuth2Authentication.js +67 -34
  25. package/build/connector/AxiosAdapter.js +28 -24
  26. package/build/connector/isRetryAllowed.js +0 -1
  27. package/build/connector/retryAfterDelay.js +3 -3
  28. package/build/shared/{interfaces/restAPI/administration/user/v2.0/IDeleteUserMeRest_2_0.js → api/liveAgent/liveAgentInterfaces.js} +1 -1
  29. package/build/shared/charts/createNodeDescriptor.js +1 -1
  30. package/build/shared/charts/descriptors/allFields.js +1 -1
  31. package/build/shared/charts/descriptors/{profile → analytics}/activateProfile.js +2 -2
  32. package/build/shared/charts/descriptors/{profile → analytics}/blindMode.js +11 -4
  33. package/build/shared/charts/descriptors/{profile → analytics}/completeGoal.js +2 -2
  34. package/build/shared/charts/descriptors/{profile → analytics}/deactivateProfile.js +2 -2
  35. package/build/shared/charts/descriptors/{profile → analytics}/deleteProfile.js +2 -2
  36. package/build/shared/charts/descriptors/{profile → analytics}/index.js +5 -1
  37. package/build/shared/charts/descriptors/{profile → analytics}/mergeProfile.js +2 -2
  38. package/build/shared/charts/descriptors/{profile → analytics}/overwriteAnalytics.js +59 -4
  39. package/build/shared/charts/descriptors/analytics/requestRating.js +57 -0
  40. package/build/shared/charts/descriptors/analytics/setRating.js +39 -0
  41. package/build/shared/charts/descriptors/{profile → analytics}/updateProfile.js +2 -2
  42. package/build/shared/charts/descriptors/apps/getAppSessionPin.js +46 -0
  43. package/build/shared/charts/descriptors/apps/index.js +14 -0
  44. package/build/shared/charts/descriptors/apps/initAppSession.js +488 -0
  45. package/build/shared/charts/descriptors/apps/setAdaptiveCardAppState.js +79 -0
  46. package/build/shared/charts/descriptors/apps/setAppState.js +44 -0
  47. package/build/shared/charts/descriptors/apps/setHtmlAppState.js +108 -0
  48. package/build/shared/charts/descriptors/connectionNodes/internalStorageProviders/amazonStorageProviderConnection.js +14 -0
  49. package/build/shared/charts/descriptors/connectionNodes/internalStorageProviders/azureBlobStorageProviderConnection.js +13 -0
  50. package/build/shared/charts/descriptors/connectionNodes/internalStorageProviders/googleCloudStorageProviderConnection.js +13 -0
  51. package/build/shared/charts/descriptors/connectionNodes/internalStorageProviders/index.js +23 -0
  52. package/build/shared/charts/descriptors/connectionNodes/mongoDB/aggregate.js +1 -1
  53. package/build/shared/charts/descriptors/connectionNodes/mongoDB/find.js +1 -1
  54. package/build/shared/charts/descriptors/connectionNodes/mongoDB/findOne.js +1 -1
  55. package/build/shared/charts/descriptors/connectionNodes/mongoDB/index.js +1 -1
  56. package/build/shared/charts/descriptors/connectionNodes/mongoDB/insert.js +1 -1
  57. package/build/shared/charts/descriptors/connectionNodes/mongoDB/remove.js +1 -1
  58. package/build/shared/charts/descriptors/connectionNodes/mongoDB/updateMany.js +1 -1
  59. package/build/shared/charts/descriptors/connectionNodes/mongoDB/updateOne.js +1 -1
  60. package/build/shared/charts/descriptors/connectionNodes/smtp/emailNotification.js +8 -6
  61. package/build/shared/charts/descriptors/connectionNodes/smtp/index.js +1 -1
  62. package/build/shared/charts/descriptors/connectionNodes/smtp/sendEmail.js +4 -4
  63. package/build/shared/charts/descriptors/connectionNodes/sql/index.js +1 -1
  64. package/build/shared/charts/descriptors/connectionNodes/sql/runQuery.js +1 -1
  65. package/build/shared/charts/descriptors/connectionNodes/sql/runStoredProcedure.js +1 -1
  66. package/build/shared/charts/descriptors/connectionNodes/sql/runTransaction.js +1 -1
  67. package/build/shared/charts/descriptors/data/addToContext.js +1 -1
  68. package/build/shared/charts/descriptors/data/code.js +1 -1
  69. package/build/shared/charts/descriptors/data/copyDataToContext.js +1 -1
  70. package/build/shared/charts/descriptors/data/copySlotsToContext.js +1 -1
  71. package/build/shared/charts/descriptors/data/log.js +1 -1
  72. package/build/shared/charts/descriptors/data/removeFromContext.js +1 -1
  73. package/build/shared/charts/descriptors/data/resetContext.js +1 -1
  74. package/build/shared/charts/descriptors/end.js +2 -1
  75. package/build/shared/charts/descriptors/index.js +98 -70
  76. package/build/shared/charts/descriptors/liveAgent/assistInfo.js +195 -0
  77. package/build/shared/charts/descriptors/liveAgent/index.js +6 -0
  78. package/build/shared/charts/descriptors/liveAgent/utils/buildCognigyWhisperAssistResponse.js +135 -0
  79. package/build/shared/charts/descriptors/liveAgent/utils/index.js +6 -0
  80. package/build/shared/charts/descriptors/logic/disableSlotFillers.js +1 -1
  81. package/build/shared/charts/descriptors/logic/enableSlotFillers.js +1 -1
  82. package/build/shared/charts/descriptors/logic/executeFlow.js +1 -1
  83. package/build/shared/charts/descriptors/logic/goTo.js +2 -1
  84. package/build/shared/charts/descriptors/logic/if/else.js +3 -1
  85. package/build/shared/charts/descriptors/logic/if/if.js +3 -2
  86. package/build/shared/charts/descriptors/logic/if/then.js +3 -1
  87. package/build/shared/charts/descriptors/logic/index.js +5 -3
  88. package/build/shared/charts/descriptors/logic/interval/elseInterval.js +2 -1
  89. package/build/shared/charts/descriptors/logic/interval/interval.js +1 -1
  90. package/build/shared/charts/descriptors/logic/interval/onInterval.js +2 -1
  91. package/build/shared/charts/descriptors/logic/once/afterwards.js +2 -1
  92. package/build/shared/charts/descriptors/logic/once/onFirstExecution.js +2 -1
  93. package/build/shared/charts/descriptors/logic/once/once.js +1 -1
  94. package/build/shared/charts/descriptors/logic/resetState.js +1 -1
  95. package/build/shared/charts/descriptors/logic/setState.js +1 -1
  96. package/build/shared/charts/descriptors/logic/setTranslation.js +88 -0
  97. package/build/shared/charts/descriptors/logic/sleep.js +1 -1
  98. package/build/shared/charts/descriptors/logic/stop.js +1 -1
  99. package/build/shared/charts/descriptors/logic/switch/case.js +3 -1
  100. package/build/shared/charts/descriptors/logic/switch/default.js +3 -1
  101. package/build/shared/charts/descriptors/logic/switch/switch.js +74 -12
  102. package/build/shared/charts/descriptors/logic/switchLocale.js +31 -3
  103. package/build/shared/charts/descriptors/logic/think.js +8 -4
  104. package/build/shared/charts/descriptors/logic/thinkV2.js +104 -0
  105. package/build/shared/charts/descriptors/logic/wait.js +3 -10
  106. package/build/shared/charts/descriptors/message/checkChannelChange/checkChannelChange.js +2 -1
  107. package/build/shared/charts/descriptors/message/checkChannelChange/onNo.js +4 -2
  108. package/build/shared/charts/descriptors/message/checkChannelChange/onYes.js +4 -2
  109. package/build/shared/charts/descriptors/message/checkChannelChange/unchanged.js +4 -2
  110. package/build/shared/charts/descriptors/message/datePicker.js +5 -5
  111. package/build/shared/charts/descriptors/message/question/onAnswer.js +4 -2
  112. package/build/shared/charts/descriptors/message/question/onQuestion.js +4 -2
  113. package/build/shared/charts/descriptors/message/question/optionalQuestion.js +2 -2
  114. package/build/shared/charts/descriptors/message/question/question.js +655 -60
  115. package/build/shared/charts/descriptors/message/question/utils/datepickerUtils.js +32 -2
  116. package/build/shared/charts/descriptors/message/question/utils/evaluateQuestionAnswer.js +12 -3
  117. package/build/shared/charts/descriptors/message/question/utils/generateAnswerShortForm.js +37 -0
  118. package/build/shared/charts/descriptors/message/question/utils/getQuestionText.js +36 -0
  119. package/build/shared/charts/descriptors/message/question/utils/questionHandover.js +13 -0
  120. package/build/shared/charts/descriptors/message/question/utils/resetNodeState.js +12 -0
  121. package/build/shared/charts/descriptors/message/question/utils/storeQuestionAnswer.js +30 -0
  122. package/build/shared/charts/descriptors/message/question/utils/validateQuestionAnswer.js +22 -0
  123. package/build/shared/charts/descriptors/message/say.js +10 -4
  124. package/build/shared/charts/descriptors/message/sendImage.js +1 -1
  125. package/build/shared/charts/descriptors/message/sendText.js +1 -1
  126. package/build/shared/charts/descriptors/microsoft/getToken.js +34 -0
  127. package/build/shared/charts/descriptors/microsoft/index.js +22 -0
  128. package/build/shared/charts/descriptors/microsoft/invalidateToken.js +29 -0
  129. package/build/shared/charts/descriptors/microsoft/tokenStatus/index.js +51 -0
  130. package/build/shared/charts/descriptors/microsoft/tokenStatus/tokenGranted.js +24 -0
  131. package/build/shared/charts/descriptors/microsoft/tokenStatus/tokenNotGranted.js +24 -0
  132. package/build/shared/charts/descriptors/microsoft/utils/design.js +5 -0
  133. package/build/shared/charts/descriptors/nlu/addLexiconKeyphrase.js +1 -1
  134. package/build/shared/charts/descriptors/nlu/executeCognigyNLU.js +23 -3
  135. package/build/shared/charts/descriptors/nlu/extractAnswer.js +115 -0
  136. package/build/shared/charts/descriptors/nlu/fuzzySearch.js +270 -0
  137. package/build/shared/charts/descriptors/nlu/index.js +7 -1
  138. package/build/shared/charts/descriptors/nlu/matchPattern.js +113 -0
  139. package/build/shared/charts/descriptors/nlu/regexSlotFiller.js +1 -1
  140. package/build/shared/charts/descriptors/nlu/utils/patternMatcher.js +265 -0
  141. package/build/shared/charts/descriptors/placeholder.js +1 -1
  142. package/build/shared/charts/descriptors/requiredFields.js +1 -1
  143. package/build/shared/charts/descriptors/service/checkAgentAvailability.js +203 -0
  144. package/build/shared/charts/descriptors/service/handover.js +30 -3
  145. package/build/shared/charts/descriptors/service/handoverV2.js +192 -0
  146. package/build/shared/charts/descriptors/service/httpRequest.js +40 -10
  147. package/build/shared/charts/descriptors/service/index.js +5 -1
  148. package/build/shared/charts/descriptors/service/triggerFunction/onScheduled.js +3 -1
  149. package/build/shared/charts/descriptors/service/triggerFunction/onSchedulingError.js +3 -1
  150. package/build/shared/charts/descriptors/service/triggerFunction/triggerFunction.js +1 -1
  151. package/build/shared/charts/descriptors/start.js +2 -1
  152. package/build/shared/charts/descriptors/voice/index.js +20 -0
  153. package/build/shared/charts/descriptors/voice/interface/IAudioCodes.js +3 -0
  154. package/build/shared/charts/descriptors/voice/interface/IVoiceGateway2.js +3 -0
  155. package/build/shared/charts/descriptors/voice/mappers/hangup.mapper.js +59 -0
  156. package/build/shared/charts/descriptors/voice/mappers/play.mapper.js +99 -0
  157. package/build/shared/charts/descriptors/voice/mappers/setSessionConfig.mapper.js +296 -0
  158. package/build/shared/charts/descriptors/voice/mappers/transfer.mapper.js +86 -0
  159. package/build/shared/charts/descriptors/voice/nodes/bargeIn.js +60 -0
  160. package/build/shared/charts/descriptors/voice/nodes/continuousAsr.js +72 -0
  161. package/build/shared/charts/descriptors/voice/nodes/dtmf.js +86 -0
  162. package/build/shared/charts/descriptors/voice/nodes/hangup.js +48 -0
  163. package/build/shared/charts/descriptors/voice/nodes/noUserInput.js +105 -0
  164. package/build/shared/charts/descriptors/voice/nodes/play.js +95 -0
  165. package/build/shared/charts/descriptors/voice/nodes/sessionSpeechParameters.js +105 -0
  166. package/build/shared/charts/descriptors/voice/nodes/transfer.js +114 -0
  167. package/build/shared/charts/descriptors/voice/utils/constants.js +8 -0
  168. package/build/shared/charts/descriptors/voice/utils/design.js +5 -0
  169. package/build/shared/charts/descriptors/voice/utils/helper.js +11 -0
  170. package/build/shared/charts/descriptors/voicegateway/index.js +1 -1
  171. package/build/shared/charts/descriptors/voicegateway/nodes/agentAssist.js +1 -1
  172. package/build/shared/charts/descriptors/voicegateway/nodes/callRecording.js +37 -17
  173. package/build/shared/charts/descriptors/voicegateway/nodes/handover.js +20 -34
  174. package/build/shared/charts/descriptors/voicegateway/nodes/hangup.js +11 -20
  175. package/build/shared/charts/descriptors/voicegateway/nodes/playURL.js +23 -29
  176. package/build/shared/charts/descriptors/voicegateway/nodes/sendMessage.js +5 -5
  177. package/build/shared/charts/descriptors/voicegateway/nodes/sendMetaData.js +1 -1
  178. package/build/shared/charts/descriptors/voicegateway/nodes/setSessionParams.js +4 -4
  179. package/build/shared/charts/descriptors/voicegateway/utils/paramUtils.js +34 -6
  180. package/build/shared/charts/descriptors/voicegateway2/index.js +25 -0
  181. package/build/shared/charts/descriptors/voicegateway2/nodes/dtmf.js +60 -0
  182. package/build/shared/charts/descriptors/voicegateway2/nodes/hangup.js +46 -0
  183. package/build/shared/charts/descriptors/voicegateway2/nodes/play.js +113 -0
  184. package/build/shared/charts/descriptors/voicegateway2/nodes/refer.js +103 -0
  185. package/build/shared/charts/descriptors/voicegateway2/nodes/sendMetadata.js +64 -0
  186. package/build/shared/charts/descriptors/voicegateway2/nodes/setSessionConfig.js +354 -0
  187. package/build/shared/charts/descriptors/voicegateway2/nodes/transfer.js +99 -0
  188. package/build/shared/charts/descriptors/voicegateway2/utils/constants.js +7 -0
  189. package/build/shared/charts/descriptors/voicegateway2/utils/design.js +5 -0
  190. package/build/shared/charts/descriptors/voicegateway2/utils/helper.js +39 -0
  191. package/build/shared/charts/descriptors/voicegateway2/utils/strip-nulls.js +19 -0
  192. package/build/shared/constants.js +11 -1
  193. package/build/shared/errors/baseError.js +35 -2
  194. package/build/shared/handoverClients/interfaces/TAnyProviderResponse.js +3 -0
  195. package/build/shared/handoverClients/interfaces/THandoverEventType.js +12 -0
  196. package/build/shared/helper/BaseContext.js +1 -1
  197. package/build/shared/helper/defaultDatepickerFunction.js +13 -0
  198. package/build/shared/helper/rest/array.js +19 -0
  199. package/build/shared/helper/rest/boolean.js +5 -1
  200. package/build/shared/helper/rest/index.js +4 -1
  201. package/build/shared/helper/rest/query-string/index.js +5 -5
  202. package/build/shared/helper/rest/query.js +0 -0
  203. package/build/shared/interfaces/IApiKey.js +1 -1
  204. package/build/shared/interfaces/IEndpointTranslationSettings.js +32 -0
  205. package/build/shared/interfaces/IHandoverRequestStatus.js +3 -0
  206. package/build/shared/interfaces/IHttpRequest.js +3 -0
  207. package/build/shared/interfaces/IOrganisation.js +22 -3
  208. package/build/shared/interfaces/IProfile.js +1 -1
  209. package/build/shared/interfaces/ISayNodeSettings.js +3 -0
  210. package/build/shared/interfaces/TEntrypointType.js +2 -0
  211. package/build/shared/interfaces/ai.js +0 -1
  212. package/build/shared/interfaces/amazonLexV2Interface.js +3 -0
  213. package/build/shared/interfaces/amqpInterface.js +4 -1
  214. package/build/shared/interfaces/analytics/IAnalyticsFlowHistoryData.js +3 -0
  215. package/build/shared/interfaces/analytics/IAnalyticsRating.js +13 -0
  216. package/build/shared/interfaces/analytics/IAnalyticsSourceData.js +196 -45
  217. package/build/shared/interfaces/analytics/IStepEvent.js +4 -1
  218. package/build/shared/interfaces/analytics/TAnalyticsMode.js +10 -0
  219. package/build/shared/interfaces/analytics/TAnalyticsType.js +5 -0
  220. package/build/shared/interfaces/debugEvents/IErrorEventPayload.js +3 -0
  221. package/build/shared/interfaces/debugEvents/TDebugEndpointEvent.js +1 -0
  222. package/build/shared/interfaces/debugEvents/TDebugEventType.js +2 -1
  223. package/build/shared/interfaces/fileStorage.js +23 -0
  224. package/build/shared/interfaces/handover.js +151 -3
  225. package/build/shared/interfaces/journeys/IJourney.js +1 -1
  226. package/build/shared/interfaces/license.js +34 -0
  227. package/build/shared/interfaces/license.js.map +1 -0
  228. package/build/shared/interfaces/management/deleteOrganisation/deleteOrganisationTypes.js +3 -0
  229. package/build/shared/interfaces/messageAPI/ai.js +15 -1
  230. package/build/shared/interfaces/messageAPI/analytics.js +3 -0
  231. package/build/shared/interfaces/messageAPI/endpoints.js +361 -11
  232. package/build/shared/interfaces/messageAPI/handover.js +270 -0
  233. package/build/shared/interfaces/resources/IAppTemplate.js +24 -0
  234. package/build/shared/interfaces/resources/IAuditEvent.js +39 -3
  235. package/build/shared/interfaces/resources/IChart.js +2 -1
  236. package/build/shared/interfaces/resources/IChartNode.js +58 -11
  237. package/build/shared/interfaces/resources/IConnection.js +1 -1
  238. package/build/shared/interfaces/resources/IConnectionSchema.js +1 -1
  239. package/build/shared/interfaces/resources/IEndpoint.js +7 -2
  240. package/build/shared/interfaces/resources/IExtension.js +17 -0
  241. package/build/shared/interfaces/resources/IFile.js +1 -1
  242. package/build/shared/interfaces/resources/IFlow.js +10 -2
  243. package/build/shared/interfaces/resources/IFlowState.js +1 -1
  244. package/build/shared/interfaces/resources/IFunctionInstance.js +1 -1
  245. package/build/shared/interfaces/resources/IHandoverConfiguration.js +13 -0
  246. package/build/shared/interfaces/resources/ILexicon.js +9 -3
  247. package/build/shared/interfaces/resources/ILexiconEntry.js +1 -1
  248. package/build/shared/interfaces/resources/INLUConnector.js +15 -2
  249. package/build/shared/interfaces/resources/INodeDescriptorSet.js +169 -53
  250. package/build/shared/interfaces/resources/IOptionsResolverFunction.js +18 -0
  251. package/build/shared/interfaces/resources/IOrganisationDeletion.js +10 -0
  252. package/build/shared/interfaces/resources/IPlaybookRun.js +61 -0
  253. package/build/shared/interfaces/resources/IProject.js +20 -1
  254. package/build/shared/interfaces/resources/IRemoveDuplicatedSlotsAndUpdateLexionEntries.js +3 -0
  255. package/build/shared/interfaces/resources/ISlotFiller.js +38 -21
  256. package/build/shared/interfaces/resources/ISnapshot.js +1 -1
  257. package/build/shared/interfaces/resources/ITrackAnalyticsStepsArguments.js +3 -0
  258. package/build/shared/interfaces/resources/TNLUConnectorType.js +3 -1
  259. package/build/shared/interfaces/resources/TResourceType.js +1 -0
  260. package/build/shared/interfaces/resources/TRestChannelType.js +10 -0
  261. package/build/shared/interfaces/resources/TSocketChannelType.js +9 -5
  262. package/build/shared/interfaces/resources/TWebhookChannelType.js +10 -0
  263. package/build/shared/interfaces/resources/chart/IChartExecutable.js +3 -2
  264. package/build/shared/interfaces/resources/chart/IChartExecutableNode.js +1 -0
  265. package/build/shared/interfaces/resources/intent/IIntent.js +26 -6
  266. package/build/shared/interfaces/resources/intent/IIntentTrainGroup.js +22 -2
  267. package/build/shared/interfaces/resources/intent/ISentence.js +32 -8
  268. package/build/shared/interfaces/resources/settings/IAgentSettings.js +81 -2
  269. package/build/shared/interfaces/resources/settings/IFlowSettings.js +20 -2
  270. package/build/shared/interfaces/resources/settings/ISharedSettings.js +5 -1
  271. package/build/shared/interfaces/resources/yesNoIntent/IYesNoItem.js +9 -0
  272. package/build/shared/interfaces/resources/yesNoIntent/index.js +3 -0
  273. package/build/shared/interfaces/restAPI/administration/liveAgent/v2.0/IReadLiveAgentAccountRest_2_0.js +3 -0
  274. package/build/shared/interfaces/restAPI/administration/liveAgent/v2.0/IReadProjectInboxRest_2_0.js +3 -0
  275. package/build/shared/interfaces/restAPI/administration/liveAgent/v2.0/ISetupCognigyLiveAgentInboxRest_2_0.js +3 -0
  276. package/build/shared/interfaces/restAPI/administration/liveAgent/v2.0/ISetupCognigyLiveAgentRest_2_0.js +3 -0
  277. package/build/shared/interfaces/restAPI/administration/liveAgent/v2.0/IUpdateCognigyLiveAgentInboxRest_2_0.js +3 -0
  278. package/build/shared/interfaces/restAPI/administration/liveAgent/v2.0/index.js +3 -0
  279. package/build/shared/interfaces/restAPI/administration/organisations/v2.0/IReadCollectionsToBeDeletedRest_2_0.js +21 -0
  280. package/build/shared/interfaces/restAPI/administration/organisations/v2.0/IRequestOrganisationDeletionRest_2_0.js +3 -0
  281. package/build/shared/interfaces/restAPI/administration/organisations/v2.0/index.js +3 -0
  282. package/build/shared/interfaces/restAPI/analytics/IDeleteAnalyticsRecordsRest_2_0.js +3 -0
  283. package/build/shared/interfaces/restAPI/analytics/IUpdateAnalyticsRecordProperties_2_0.js +3 -0
  284. package/build/shared/interfaces/restAPI/analytics/IUpdateAnalyticsRecordsRest_2_0.js +3 -0
  285. package/build/shared/interfaces/restAPI/audio/v2.0/IAudioPreviewLanguages_2_0.js +3 -0
  286. package/build/shared/interfaces/restAPI/audio/v2.0/IAudioPreviewRest_2_0.js +3 -0
  287. package/build/shared/interfaces/restAPI/audio/v2.0/IIndexAudioPreviewLanguages_2_0.js +4 -0
  288. package/build/shared/interfaces/restAPI/audio/v2.0/ITestVoiceProviderRest_2_0.js +3 -0
  289. package/build/shared/interfaces/restAPI/audio/v2.0/ITestVoiceProvider_2_0.js +3 -0
  290. package/build/shared/interfaces/restAPI/audio/v2.0/IVGCallSettings_2_0.js +4 -0
  291. package/build/shared/interfaces/restAPI/audio/v2.0/IVoicePrepareCallRest_2_0.js +3 -0
  292. package/build/shared/interfaces/restAPI/audio/v2.0/IVoicePrepareCall_2_0.js +4 -0
  293. package/build/shared/interfaces/restAPI/audio/v2.0/index.js +3 -0
  294. package/build/shared/interfaces/restAPI/insights/IAnalyticsQueryFilter_2_0.js +3 -0
  295. package/build/shared/interfaces/restAPI/insights/TAnalyticsQueryFilterOperator_2_0.js +3 -0
  296. package/build/shared/interfaces/restAPI/insights/messages/IGenerateMessagesRest_2_0.js +5 -0
  297. package/build/shared/interfaces/restAPI/insights/messages/ILoadMessagesReportByQueryHashResponse_2_0.js +3 -0
  298. package/build/shared/interfaces/restAPI/insights/messages/ILoadMessagesReportByQueryHashRestData_2_0.js +3 -0
  299. package/build/shared/interfaces/restAPI/insights/messages/ITopNMessages_2_0.js +3 -0
  300. package/build/shared/interfaces/restAPI/insights/publish/IPublishAnalyticsRestDataBody.js +4 -0
  301. package/build/shared/interfaces/restAPI/insights/reports/IGenerateReportResponse_2_0.js +3 -0
  302. package/build/shared/interfaces/restAPI/insights/reports/IGenerateReportRest_2_0.js +41 -0
  303. package/build/shared/interfaces/restAPI/insights/reports/ILoadReportByQueryHashResponse_2_0.js +3 -0
  304. package/build/shared/interfaces/restAPI/insights/reports/ILoadReportByQueryHashRest_2_0.js +3 -0
  305. package/build/shared/interfaces/restAPI/insights/steps/IGenerateStepReportRest_2_0.js +3 -0
  306. package/build/shared/interfaces/restAPI/insights/steps/IIndexStepsRest_2_0.js +3 -0
  307. package/build/shared/interfaces/restAPI/insights/steps/ILoadStepReportByQueryHashResponse_2_0.js +3 -0
  308. package/build/shared/interfaces/restAPI/insights/steps/ILoadStepReportByQueryHashRestData_2_0.js +3 -0
  309. package/build/shared/interfaces/restAPI/insights/steps/IStepIndexItem_2_0.js +3 -0
  310. package/build/shared/interfaces/restAPI/insights/steps/IStepReport_2_0.js +3 -0
  311. package/build/shared/interfaces/restAPI/insights/steps/IStep_2_0.js +3 -0
  312. package/build/shared/interfaces/restAPI/insights/transcripts/IGenerateTranscriptsRest_2_0.js +3 -0
  313. package/build/shared/interfaces/restAPI/insights/transcripts/ILoadTranscriptsReportByQueryHashResponse_2_0.js +3 -0
  314. package/build/shared/interfaces/restAPI/insights/transcripts/ILoadTranscriptsReportByQueryHashRestData_2_0.js +3 -0
  315. package/build/shared/interfaces/restAPI/insights/transcripts/IStepPath_2_0.js +3 -0
  316. package/build/shared/interfaces/restAPI/management/organisations/v2.0/IDeleteOrganisationRest_2_0.js +4 -0
  317. package/build/shared/interfaces/restAPI/resources/chart/v2.0/ISearchChartNodesRest_2_0.js +3 -0
  318. package/build/shared/interfaces/restAPI/resources/extension/v2.0/IUpdateExtensionPackageRest_2_0.js +4 -0
  319. package/build/shared/interfaces/restAPI/resources/file/v2.0/IUploadFileRest_2_0.js +3 -0
  320. package/build/shared/interfaces/restAPI/resources/file/v2.0/index.js +3 -0
  321. package/build/shared/interfaces/restAPI/resources/flow/v2.0/ICloneFlowRest_2_0.js +4 -0
  322. package/build/shared/interfaces/restAPI/resources/flow/v2.0/ICreateFlowFromChildrenRest_2_0.js +4 -0
  323. package/build/shared/interfaces/restAPI/resources/flow/v2.0/sentence/IYesNoSentence_2_0.js +3 -0
  324. package/build/shared/interfaces/restAPI/resources/flow/v2.0/settings/ILocaleSettings_2_0.js +16 -0
  325. package/build/shared/interfaces/restAPI/resources/lexicon/v2.0/IComposeLexiconDownloadLinkRest_2_0.js +3 -0
  326. package/build/shared/interfaces/restAPI/resources/locales/v2.0/yesNoIntents/IDeleteYesNoIntentRest_2_0.js +3 -0
  327. package/build/shared/interfaces/restAPI/resources/locales/v2.0/yesNoIntents/IReadYesNoIntentsRest_2_0.js +3 -0
  328. package/build/shared/interfaces/restAPI/resources/locales/v2.0/yesNoIntents/ITrainYesNoIntentsRest_2_0.js +3 -0
  329. package/build/shared/interfaces/restAPI/resources/locales/v2.0/yesNoIntents/IUpdateYesNoIntentRest_2_0.js +3 -0
  330. package/build/shared/interfaces/restAPI/resources/locales/v2.0/yesNoIntents/IYesNoIntentItem_2_0.js +3 -0
  331. package/build/shared/interfaces/restAPI/resources/locales/v2.0/yesNoIntents/IYesNoIntentMetaData_2_0.js +4 -0
  332. package/build/shared/interfaces/restAPI/resources/locales/v2.0/yesNoIntents/IYesNoIntents_2_0.js +8 -0
  333. package/build/shared/interfaces/restAPI/resources/locales/v2.0/yesNoIntents/index.js +3 -0
  334. package/build/shared/interfaces/restAPI/resources/locales/v2.0/yesNoSentence/ICreateYesNoSentenceRest_2_0.js +3 -0
  335. package/build/shared/interfaces/restAPI/resources/locales/v2.0/yesNoSentence/IDeleteYesNoSentenceRest_2_0.js +3 -0
  336. package/build/shared/interfaces/restAPI/resources/locales/v2.0/yesNoSentence/IIndexYesNoSentencesRest_2_0.js +3 -0
  337. package/build/shared/interfaces/restAPI/resources/locales/v2.0/yesNoSentence/IReadYesNoSentenceRest_2_0.js +3 -0
  338. package/build/shared/interfaces/restAPI/resources/locales/v2.0/yesNoSentence/IUpdateYesNoSentenceRest_2_0.js +3 -0
  339. package/build/shared/interfaces/restAPI/resources/locales/v2.0/yesNoSentence/index.js +3 -0
  340. package/build/shared/interfaces/restAPI/resources/nluconnector/v2.0/TNLUConnectorType_2_0.js +5 -1
  341. package/build/shared/interfaces/restAPI/resources/nodedescriptorsets/v2.0/IOptionsResolverRest_2_0.js +3 -0
  342. package/build/shared/interfaces/restAPI/resources/playbook/v2.0/IDeletePlaybookRunRest_2_0.js +3 -0
  343. package/build/shared/interfaces/restAPI/resources/playbook/v2.0/IIndexPlaybookRunsRest_2_0.js +3 -0
  344. package/build/shared/interfaces/restAPI/resources/playbook/v2.0/IPlaybookRunIndexItem_2_0.js +3 -0
  345. package/build/shared/interfaces/restAPI/resources/playbook/v2.0/IPlaybookRun_2_0.js +7 -0
  346. package/build/shared/interfaces/restAPI/resources/playbook/v2.0/IReadPlaybookRunRest_2_0.js +3 -0
  347. package/build/shared/interfaces/restAPI/resources/playbook/v2.0/ISchedulePlaybookRunRest_2_0.js +3 -0
  348. package/build/shared/interfaces/restAPI/resources/project/v2.0/ICreateProjectRest_2_0.js +1 -0
  349. package/build/shared/interfaces/restAPI/resources/project/v2.0/ITrainAllProjectFlowsRest_2_0.js +3 -0
  350. package/build/shared/interfaces/restAPI/resources/project/v2.0/settings/ITestTranslationSettingsRest_2_0.js +3 -0
  351. package/build/shared/interfaces/restAPI/resources/project/v2.0/settings/ITestTranslationSettings_2_0.js +3 -0
  352. package/build/shared/interfaces/security/IACL.js +1 -1
  353. package/build/shared/interfaces/security/IPermission.js +10 -0
  354. package/build/shared/interfaces/security/IRole.js +21 -3
  355. package/build/shared/interfaces/sessionstate/ISessionState.js +3 -0
  356. package/build/shared/interfaces/sessionstate/index.js +3 -0
  357. package/build/shared/interfaces/trainer/ITrainerRecord.js +5 -1
  358. package/build/shared/interfaces/translation.js +11 -0
  359. package/build/shared/interfaces/user.js +1 -1
  360. package/package.json +40 -31
  361. package/types/index.d.ts +12527 -8567
  362. package/build/shared/charts/descriptors/logic/checkFrustration.js +0 -82
@@ -0,0 +1,265 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.patternMatcher = void 0;
4
+ const cognigySlots_1 = require("../../../../interfaces/cognigySlots");
5
+ const systemSlots = new Set(cognigySlots_1.cognigySystemSlots);
6
+ /**
7
+ * Finds compound slots using pattern inside the user input
8
+ * @param input Cognigy Input Object
9
+ * @param patterns The patterns to check for
10
+ * @param patternGroupName Name for the compound group
11
+ * @param detailedCompoundSlots Store detailed results for compound slots
12
+ * @param tagExistingSlots Tag existing slots
13
+ * @param createNewSlots Create new slots from tags
14
+ * @param nluResult result from cognigy NLU since there was an alternative input
15
+ */
16
+ const patternMatcher = (params) => {
17
+ var _a;
18
+ const { input, patternGroupName, detailedCompoundSlots, tagExistingSlots, createNewSlots, nluResult, useFullSystemslotText } = params;
19
+ let { patterns } = params;
20
+ // prune patterns if more than 20
21
+ if (patterns.length > 20) {
22
+ patterns = patterns.slice(0, 20);
23
+ }
24
+ // firstly sort array to start with the longest patterns, as those will win
25
+ patterns.sort((a, b) => {
26
+ return b.length - a.length;
27
+ });
28
+ // we use let because we strip out found phrases later
29
+ let inputText = nluResult.text || input.text; // ci.processText
30
+ let inputSlots = nluResult.slots || input.slots;
31
+ const detailedSlots = ((_a = input.nlu) === null || _a === void 0 ? void 0 : _a.detailedSlots) || {};
32
+ const regexPatterns = [];
33
+ // go through patterns and create regex versions of each that is not empty string
34
+ patterns.forEach((pattern) => {
35
+ if (pattern) {
36
+ // set parsedPattern to pattern in case there are no slots
37
+ let parsedPattern = pattern;
38
+ // match all mentioned slots in the pattern
39
+ const foundSlots = pattern.match(/\@[\w>]+/g);
40
+ const tags = [];
41
+ const slots = [];
42
+ // if there are slots, process them
43
+ if (Array.isArray(foundSlots) && foundSlots.length > 0) {
44
+ foundSlots.forEach((slot) => {
45
+ // splits tags from slots
46
+ const split = slot.split(">");
47
+ const slotName = split[0].replace("@", "");
48
+ slots.push(slotName);
49
+ // if there is a tag (SLOT>TAG), remember it
50
+ if (split.length === 2)
51
+ tags.push(split[1]);
52
+ else
53
+ tags.push("");
54
+ const slotValues = [];
55
+ if (inputSlots[slotName]) {
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
+ });
64
+ }
65
+ const slotRegex = slotValues.join("|");
66
+ // replace the slots name with the list of actually found entites for this slot
67
+ parsedPattern = parsedPattern.replace(new RegExp(`${slot}`, "g"), `(${slotRegex})`);
68
+ }
69
+ });
70
+ }
71
+ if (parsedPattern != "()") {
72
+ regexPatterns.push({
73
+ "pattern": pattern,
74
+ "parsedPattern": parsedPattern,
75
+ "tags": tags,
76
+ "slots": slots
77
+ });
78
+ }
79
+ }
80
+ });
81
+ const compoundGroups = [];
82
+ // go through all created patterns and test them
83
+ regexPatterns.forEach((pattern) => {
84
+ let result;
85
+ const regExp = new RegExp(pattern.parsedPattern, "gi");
86
+ const regexMatches = [];
87
+ while (result = regExp.exec(inputText)) {
88
+ regexMatches.push(result);
89
+ }
90
+ regexMatches.forEach((m) => {
91
+ inputText = inputText.replace(m[0], "");
92
+ });
93
+ if (regexMatches.length > 0) {
94
+ // we found a match for this pattern!
95
+ regexMatches.forEach((matches, mi) => {
96
+ // set up a compoundGroup scaffold, just in case we need it
97
+ const matchedPatternGroup = {
98
+ "matchedPhrase": matches[0],
99
+ "components": []
100
+ };
101
+ if (!detailedCompoundSlots)
102
+ delete matchedPatternGroup.components;
103
+ // iterate through matches, starting at the first group result ([0] is the full match)
104
+ for (let i = 1; i < matches.length; i++) {
105
+ let originalSlot = null;
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);
113
+ }
114
+ // create compound groups
115
+ if (detailedCompoundSlots) {
116
+ const components = {
117
+ "slot": pattern.slots[i - 1],
118
+ "value": originalSlot.keyphrase || originalSlot
119
+ };
120
+ if (pattern.tags[i - 1])
121
+ components["tag"] = pattern.tags[i - 1];
122
+ else
123
+ components["tag"] = null;
124
+ matchedPatternGroup.components.push(components);
125
+ }
126
+ else {
127
+ if (pattern.tags[i - 1])
128
+ matchedPatternGroup[pattern.tags[i - 1]] = (originalSlot === null || originalSlot === void 0 ? void 0 : originalSlot.keyphrase) || originalSlot;
129
+ else
130
+ matchedPatternGroup[pattern.slots[i - 1]] = originalSlot || originalSlot.keyphrase;
131
+ }
132
+ if (pattern.tags[i - 1]) {
133
+ if (createNewSlots) {
134
+ if (inputSlots[pattern.tags[i - 1]]) {
135
+ inputSlots[pattern.tags[i - 1]].push(originalSlot);
136
+ }
137
+ else
138
+ inputSlots[pattern.tags[i - 1]] = [originalSlot];
139
+ }
140
+ if (tagExistingSlots) {
141
+ inputSlots[pattern.slots[i - 1]].forEach((s) => {
142
+ var _a, _b;
143
+ if (((_a = s === null || s === void 0 ? void 0 : s.synonym) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === ((_b = matches[i]) === null || _b === void 0 ? void 0 : _b.toLowerCase())) {
144
+ s["tags"] = (Array.isArray(s["tags"])) ? s["tags"].push(pattern.tags[i - 1]) : [pattern.tags[i - 1]];
145
+ }
146
+ });
147
+ }
148
+ }
149
+ }
150
+ compoundGroups.push(matchedPatternGroup);
151
+ });
152
+ }
153
+ });
154
+ if (!input["matchedPatterns"])
155
+ input["matchedPatterns"] = {};
156
+ if (compoundGroups && Array.isArray(compoundGroups) && compoundGroups.length > 0) {
157
+ input["matchedPatterns"][patternGroupName] = compoundGroups;
158
+ }
159
+ if (compoundGroups && compoundGroups.length === 0 && (typeof input["matchedPatterns"] !== 'object' || Object.keys(input["matchedPatterns"]).length === 0))
160
+ delete input["matchedPatterns"];
161
+ return input;
162
+ };
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
+ };
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: {
@@ -0,0 +1,203 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CHECK_AGENT_AVAILABILITY = void 0;
4
+ /* Custom modules */
5
+ const createNodeDescriptor_1 = require("../../createNodeDescriptor");
6
+ /**
7
+ * Node name: 'checkAgentAvailability'
8
+ *
9
+ * Purpose:
10
+ * Check if agents are available for handover
11
+ */
12
+ exports.CHECK_AGENT_AVAILABILITY = (0, createNodeDescriptor_1.createNodeDescriptor)({
13
+ type: "checkAgentAvailability",
14
+ defaultLabel: "Check Agent Availability",
15
+ summary: "Get the number of available agents for handover",
16
+ appearance: {
17
+ showIcon: false,
18
+ },
19
+ tags: ["service"],
20
+ fields: [
21
+ {
22
+ key: "chatwootInboxId",
23
+ type: "cognigyText",
24
+ label: "Chatwoot Inbox Id",
25
+ description: "Inbox Id in Chatwoot"
26
+ },
27
+ {
28
+ key: "liveAgentInboxId",
29
+ type: "cognigyText",
30
+ label: "Live Agent Inbox Id",
31
+ description: "Inbox Id in Live Agent"
32
+ },
33
+ {
34
+ key: "genesysCloudSkills",
35
+ type: "textArray",
36
+ label: "Skills",
37
+ description: "A list of skills that should be used to filter the available agents"
38
+ },
39
+ {
40
+ key: "genesysCloudProfileSkills",
41
+ type: "textArray",
42
+ label: "Profile Skills",
43
+ description: "A list of profile skills that should be used to filter the available agents"
44
+ },
45
+ {
46
+ key: "genesysCloudLanguageSkills",
47
+ type: "textArray",
48
+ label: "Language Skills",
49
+ description: "A list of language skills that should be used to filter the available agents"
50
+ },
51
+ {
52
+ key: "storeLocation",
53
+ type: "select",
54
+ label: "Where to store the result",
55
+ params: {
56
+ options: [
57
+ {
58
+ label: "Input",
59
+ value: "input"
60
+ },
61
+ {
62
+ label: "Context",
63
+ value: "context"
64
+ }
65
+ ],
66
+ required: true
67
+ },
68
+ defaultValue: "input"
69
+ },
70
+ {
71
+ key: "inputKey",
72
+ type: "cognigyText",
73
+ label: "Input Key to store Result",
74
+ description: "Where to store the result in the Input object. E.g. input.availableAgents",
75
+ defaultValue: "availableAgents",
76
+ condition: {
77
+ key: "storeLocation",
78
+ value: "input"
79
+ }
80
+ },
81
+ {
82
+ key: "contextKey",
83
+ type: "cognigyText",
84
+ label: "Context Key to store Result",
85
+ description: "Where to store the result in the Context object. E.g. context.availableAgents",
86
+ defaultValue: "availableAgents",
87
+ condition: {
88
+ key: "storeLocation",
89
+ value: "context"
90
+ }
91
+ },
92
+ {
93
+ key: "abortOnError",
94
+ type: "toggle",
95
+ label: "Abort Flow Execution on Error",
96
+ description: "Aborts Flow Execution on all HTTP status codes > 299",
97
+ defaultValue: false
98
+ },
99
+ {
100
+ key: "errorLogging",
101
+ type: "select",
102
+ label: "Error Logging",
103
+ description: "Whether to log errors into the Agent Logs",
104
+ defaultValue: "none",
105
+ params: {
106
+ required: true,
107
+ options: [
108
+ {
109
+ label: "Don't log errors",
110
+ value: "none"
111
+ },
112
+ {
113
+ label: "Log error codes and responses",
114
+ value: "basic"
115
+ },
116
+ {
117
+ label: "Log full errors and request payloads",
118
+ value: "full"
119
+ }
120
+ ]
121
+ }
122
+ },
123
+ {
124
+ key: "logWarning",
125
+ type: "description",
126
+ label: " ",
127
+ params: {
128
+ text: "WARNING: Logging full request payloads may expose sensitive information in the server and agent logs."
129
+ },
130
+ condition: {
131
+ key: "errorLogging",
132
+ value: "full"
133
+ }
134
+ },
135
+ ],
136
+ sections: [
137
+ {
138
+ key: "chatwootSettings",
139
+ label: "Chatwoot Settings",
140
+ defaultCollapsed: true,
141
+ fields: [
142
+ "chatwootInboxId",
143
+ ]
144
+ },
145
+ {
146
+ key: "liveAgentSettings",
147
+ label: "Live Agent Settings",
148
+ defaultCollapsed: true,
149
+ fields: [
150
+ "liveAgentInboxId",
151
+ ]
152
+ },
153
+ {
154
+ key: "genesysCloudSettings",
155
+ label: "Genesys Cloud Settings",
156
+ defaultCollapsed: true,
157
+ fields: [
158
+ "genesysCloudSkills",
159
+ "genesysCloudProfileSkills",
160
+ "genesysCloudLanguageSkills"
161
+ ]
162
+ },
163
+ {
164
+ key: "storage",
165
+ label: "Storage Options",
166
+ defaultCollapsed: true,
167
+ fields: [
168
+ "storeLocation",
169
+ "inputKey",
170
+ "contextKey",
171
+ ]
172
+ },
173
+ {
174
+ key: "errors",
175
+ label: "Error Handling",
176
+ defaultCollapsed: true,
177
+ fields: [
178
+ "errorLogging",
179
+ "logWarning",
180
+ "abortOnError"
181
+ ]
182
+ }
183
+ ],
184
+ form: [
185
+ { type: "section", key: "genesysCloudSettings" },
186
+ // only render this field if "live agent" is enabled
187
+ process.env.FEATURE_USE_COGNIGY_LIVE_AGENT === "true" && {
188
+ type: "section",
189
+ key: "liveAgentSettings"
190
+ },
191
+ { type: "section", key: "chatwootSettings" },
192
+ // { type: "section", key: "salesforceSettings" }, TODO
193
+ { type: "section", key: "storage" },
194
+ { type: "section", key: "errors" },
195
+ ]
196
+ .filter(element => !!element),
197
+ function: async ({ cognigy, config }) => {
198
+ const { api } = cognigy;
199
+ // @ts-ignore
200
+ return await api.checkAgentAvailability({ cognigy, config });
201
+ }
202
+ });
203
+ //# sourceMappingURL=checkAgentAvailability.js.map
@@ -9,13 +9,17 @@ const createNodeDescriptor_1 = require("../../createNodeDescriptor");
9
9
  * Purpose:
10
10
  * Sends a handover request service-handover if the channel is supported
11
11
  */
12
- exports.HANDOVER = createNodeDescriptor_1.createNodeDescriptor({
12
+ exports.HANDOVER = (0, createNodeDescriptor_1.createNodeDescriptor)({
13
13
  type: "handover",
14
14
  defaultLabel: "Handover",
15
15
  summary: "Sends a handover request to an agent",
16
16
  appearance: {
17
17
  showIcon: false
18
18
  },
19
+ constraints: {
20
+ placement: {},
21
+ creatable: false,
22
+ },
19
23
  fields: [
20
24
  {
21
25
  key: "text",
@@ -52,6 +56,12 @@ exports.HANDOVER = createNodeDescriptor_1.createNodeDescriptor({
52
56
  type: "cognigyText",
53
57
  label: "Chatwoot Inbox Id",
54
58
  description: "Inbox Id in Chatwoot"
59
+ },
60
+ {
61
+ key: "liveAgentInboxId",
62
+ type: "cognigyText",
63
+ label: "Live Agent Inbox Id",
64
+ description: "Inbox Id in Live Agent"
55
65
  }
56
66
  ],
57
67
  sections: [
@@ -62,6 +72,14 @@ exports.HANDOVER = createNodeDescriptor_1.createNodeDescriptor({
62
72
  fields: [
63
73
  "chatwootInboxId",
64
74
  ]
75
+ },
76
+ {
77
+ key: "liveAgentSettings",
78
+ label: "Live Agent Settings",
79
+ defaultCollapsed: true,
80
+ fields: [
81
+ "liveAgentInboxId",
82
+ ]
65
83
  }
66
84
  ],
67
85
  form: [
@@ -71,10 +89,19 @@ exports.HANDOVER = createNodeDescriptor_1.createNodeDescriptor({
71
89
  { type: "field", key: "unsupportedChannel" },
72
90
  { type: "field", key: "quickReply" },
73
91
  { type: "section", key: "chatwootSettings" },
74
- ],
92
+ // only render this field if "live agent" is enabled
93
+ process.env.FEATURE_USE_COGNIGY_LIVE_AGENT === "true" && {
94
+ type: "section",
95
+ key: "liveAgentSettings"
96
+ },
97
+ ]
98
+ .filter(element => !!element),
75
99
  tags: ["service", "livechat", "chat", "hand over"],
76
100
  function: async ({ cognigy, config, childConfigs, nodeId }) => {
77
- const { api } = cognigy;
101
+ const { api, input } = cognigy;
102
+ if (input.channel === "adminconsole") {
103
+ api.output("You are using the deprecated Handover Node. Please find the new Handover to Agent Node in the Node Selection Menu.", null);
104
+ }
78
105
  await api.handover({ cognigy, config, nodeId, childConfigs });
79
106
  }
80
107
  });