@cognigy/rest-api-client 0.11.0 → 0.12.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 (189) hide show
  1. package/.snyk +1 -1
  2. package/build/GenericUploadFn.js +1 -1
  3. package/build/RestAPIClient.js +14 -0
  4. package/build/apigroups/AdministrationAPIGroup_2_0.js +25 -3
  5. package/build/apigroups/AnalyticsAPIGroup_2_0.js +12 -0
  6. package/build/apigroups/InsightsAPIGroup_2_0.js +53 -0
  7. package/build/apigroups/ResourcesAPIGroup_2_0.js +23 -2
  8. package/build/apigroups/index.js +5 -1
  9. package/build/authentication/BasicAuthentication/BasicAuthentication.js +8 -1
  10. package/build/authentication/OAuth2/ILoginByClientCredentialsParameters.js +3 -0
  11. package/build/authentication/OAuth2/IOAuth2ClientCredentialsGrantAccessTokenRequest.js +11 -0
  12. package/build/authentication/OAuth2/OAuth2Authentication.js +41 -15
  13. package/build/shared/charts/createNodeDescriptor.js +1 -1
  14. package/build/shared/charts/descriptors/apps/index.js +8 -0
  15. package/build/shared/charts/descriptors/apps/initAppSession.js +33 -0
  16. package/build/shared/charts/descriptors/apps/setAppState.js +46 -0
  17. package/build/shared/charts/descriptors/connectionNodes/smtp/emailNotification.js +6 -4
  18. package/build/shared/charts/descriptors/connectionNodes/smtp/sendEmail.js +2 -2
  19. package/build/shared/charts/descriptors/end.js +1 -0
  20. package/build/shared/charts/descriptors/index.js +86 -67
  21. package/build/shared/charts/descriptors/logic/goTo.js +1 -0
  22. package/build/shared/charts/descriptors/logic/if/else.js +2 -0
  23. package/build/shared/charts/descriptors/logic/if/if.js +2 -1
  24. package/build/shared/charts/descriptors/logic/if/then.js +2 -0
  25. package/build/shared/charts/descriptors/logic/index.js +5 -3
  26. package/build/shared/charts/descriptors/logic/interval/elseInterval.js +1 -0
  27. package/build/shared/charts/descriptors/logic/interval/onInterval.js +1 -0
  28. package/build/shared/charts/descriptors/logic/once/afterwards.js +1 -0
  29. package/build/shared/charts/descriptors/logic/once/onFirstExecution.js +1 -0
  30. package/build/shared/charts/descriptors/logic/setTranslation.js +88 -0
  31. package/build/shared/charts/descriptors/logic/switch/case.js +2 -0
  32. package/build/shared/charts/descriptors/logic/switch/default.js +2 -0
  33. package/build/shared/charts/descriptors/logic/switch/switch.js +52 -4
  34. package/build/shared/charts/descriptors/logic/switchLocale.js +30 -2
  35. package/build/shared/charts/descriptors/logic/think.js +7 -3
  36. package/build/shared/charts/descriptors/logic/thinkV2.js +104 -0
  37. package/build/shared/charts/descriptors/logic/wait.js +2 -9
  38. package/build/shared/charts/descriptors/message/checkChannelChange/checkChannelChange.js +1 -0
  39. package/build/shared/charts/descriptors/message/checkChannelChange/onNo.js +3 -1
  40. package/build/shared/charts/descriptors/message/checkChannelChange/onYes.js +3 -1
  41. package/build/shared/charts/descriptors/message/checkChannelChange/unchanged.js +3 -1
  42. package/build/shared/charts/descriptors/message/question/onAnswer.js +3 -1
  43. package/build/shared/charts/descriptors/message/question/onQuestion.js +3 -1
  44. package/build/shared/charts/descriptors/message/question/question.js +474 -56
  45. package/build/shared/charts/descriptors/message/question/utils/datepickerUtils.js +1 -0
  46. package/build/shared/charts/descriptors/message/question/utils/evaluateQuestionAnswer.js +9 -3
  47. package/build/shared/charts/descriptors/message/question/utils/generateAnswerShortForm.js +37 -0
  48. package/build/shared/charts/descriptors/message/question/utils/getQuestionText.js +36 -0
  49. package/build/shared/charts/descriptors/message/question/utils/resetNodeState.js +12 -0
  50. package/build/shared/charts/descriptors/message/question/utils/storeQuestionAnswer.js +30 -0
  51. package/build/shared/charts/descriptors/message/question/utils/validateQuestionAnswer.js +22 -0
  52. package/build/shared/charts/descriptors/microsoft/getToken.js +34 -0
  53. package/build/shared/charts/descriptors/microsoft/index.js +22 -0
  54. package/build/shared/charts/descriptors/microsoft/invalidateToken.js +29 -0
  55. package/build/shared/charts/descriptors/microsoft/tokenStatus/index.js +51 -0
  56. package/build/shared/charts/descriptors/microsoft/tokenStatus/tokenGranted.js +24 -0
  57. package/build/shared/charts/descriptors/microsoft/tokenStatus/tokenNotGranted.js +24 -0
  58. package/build/shared/charts/descriptors/microsoft/utils/design.js +5 -0
  59. package/build/shared/charts/descriptors/nlu/executeCognigyNLU.js +5 -0
  60. package/build/shared/charts/descriptors/nlu/extractAnswer.js +115 -0
  61. package/build/shared/charts/descriptors/nlu/fuzzySearch.js +270 -0
  62. package/build/shared/charts/descriptors/nlu/index.js +7 -1
  63. package/build/shared/charts/descriptors/nlu/matchPattern.js +104 -0
  64. package/build/shared/charts/descriptors/nlu/utils/patternMatcher.js +197 -0
  65. package/build/shared/charts/descriptors/profile/index.js +5 -1
  66. package/build/shared/charts/descriptors/profile/overwriteAnalytics.js +54 -2
  67. package/build/shared/charts/descriptors/profile/requestRating.js +57 -0
  68. package/build/shared/charts/descriptors/profile/setRating.js +39 -0
  69. package/build/shared/charts/descriptors/service/handover.js +29 -2
  70. package/build/shared/charts/descriptors/service/handoverV2.js +129 -0
  71. package/build/shared/charts/descriptors/service/httpRequest.js +26 -7
  72. package/build/shared/charts/descriptors/service/index.js +3 -1
  73. package/build/shared/charts/descriptors/service/triggerFunction/onScheduled.js +2 -0
  74. package/build/shared/charts/descriptors/service/triggerFunction/onSchedulingError.js +2 -0
  75. package/build/shared/charts/descriptors/start.js +1 -0
  76. package/build/shared/charts/descriptors/voicegateway/nodes/callRecording.js +36 -16
  77. package/build/shared/charts/descriptors/voicegateway/nodes/handover.js +2 -2
  78. package/build/shared/charts/descriptors/voicegateway/nodes/playURL.js +9 -0
  79. package/build/shared/charts/descriptors/voicegateway/nodes/sendMessage.js +1 -1
  80. package/build/shared/charts/descriptors/voicegateway/utils/paramUtils.js +9 -1
  81. package/build/shared/charts/descriptors/voicegateway2/index.js +21 -0
  82. package/build/shared/charts/descriptors/voicegateway2/nodes/dtmf.js +56 -0
  83. package/build/shared/charts/descriptors/voicegateway2/nodes/hangup.js +48 -0
  84. package/build/shared/charts/descriptors/voicegateway2/nodes/play.js +199 -0
  85. package/build/shared/charts/descriptors/voicegateway2/nodes/refer.js +44 -0
  86. package/build/shared/charts/descriptors/voicegateway2/nodes/setSessionConfig.js +584 -0
  87. package/build/shared/charts/descriptors/voicegateway2/utils/design.js +5 -0
  88. package/build/shared/charts/descriptors/voicegateway2/utils/strip-nulls.js +19 -0
  89. package/build/shared/constants.js +9 -1
  90. package/build/shared/errors/baseError.js +34 -1
  91. package/build/shared/helper/rest/array.js +19 -0
  92. package/build/shared/helper/rest/boolean.js +5 -1
  93. package/build/shared/helper/rest/index.js +4 -1
  94. package/build/shared/interfaces/IEndpointTranslationSettings.js +32 -0
  95. package/build/shared/interfaces/IHandoverRequestStatus.js +3 -0
  96. package/build/shared/interfaces/{restAPI/administration/user/v2.0/IDeleteUserMeRest_2_0.js → IHttpRequest.js} +1 -1
  97. package/build/shared/interfaces/IOrganisation.js +1 -1
  98. package/build/shared/interfaces/TEntrypointType.js +2 -0
  99. package/build/shared/interfaces/amqpInterface.js +3 -0
  100. package/build/shared/interfaces/analytics/IAnalyticsFlowHistoryData.js +3 -0
  101. package/build/shared/interfaces/analytics/IAnalyticsSourceData.js +196 -45
  102. package/build/shared/interfaces/analytics/IStepEvent.js +2 -1
  103. package/build/shared/interfaces/analytics/TAnalyticsMode.js +10 -0
  104. package/build/shared/interfaces/analytics/TAnalyticsType.js +5 -0
  105. package/build/shared/interfaces/debugEvents/IErrorEventPayload.js +3 -0
  106. package/build/shared/interfaces/debugEvents/TDebugEndpointEvent.js +1 -0
  107. package/build/shared/interfaces/debugEvents/TDebugEventType.js +2 -1
  108. package/build/shared/interfaces/debugEvents/TSessionStateEmitParams.js +3 -0
  109. package/build/shared/interfaces/handover.js +81 -3
  110. package/build/shared/interfaces/license.js +34 -0
  111. package/build/shared/interfaces/license.js.map +1 -0
  112. package/build/shared/interfaces/messageAPI/ai.js +15 -1
  113. package/build/shared/interfaces/messageAPI/endpoints.js +273 -9
  114. package/build/shared/interfaces/resources/IAuditEvent.js +15 -2
  115. package/build/shared/interfaces/resources/IChartNode.js +56 -10
  116. package/build/shared/interfaces/resources/IEndpoint.js +5 -2
  117. package/build/shared/interfaces/resources/IFlow.js +1 -1
  118. package/build/shared/interfaces/resources/ILexicon.js +8 -2
  119. package/build/shared/interfaces/resources/INLUConnector.js +15 -2
  120. package/build/shared/interfaces/resources/INodeDescriptorSet.js +164 -52
  121. package/build/shared/interfaces/resources/IOptionsResolverFunction.js +18 -0
  122. package/build/shared/interfaces/resources/IPlaybookRun.js +61 -0
  123. package/build/shared/interfaces/resources/IProject.js +7 -1
  124. package/build/shared/interfaces/resources/ISlotFiller.js +38 -21
  125. package/build/shared/interfaces/resources/ISnapshot.js +1 -1
  126. package/build/shared/interfaces/resources/ITrackAnalyticsStepsArguments.js +3 -0
  127. package/build/shared/interfaces/resources/TNLUConnectorType.js +2 -1
  128. package/build/shared/interfaces/resources/TResourceType.js +1 -0
  129. package/build/shared/interfaces/resources/TRestChannelType.js +5 -0
  130. package/build/shared/interfaces/resources/TSocketChannelType.js +5 -1
  131. package/build/shared/interfaces/resources/chart/IChartExecutable.js +3 -2
  132. package/build/shared/interfaces/resources/chart/IChartExecutableNode.js +1 -0
  133. package/build/shared/interfaces/resources/intent/IIntent.js +4 -2
  134. package/build/shared/interfaces/resources/intent/IIntentTrainGroup.js +3 -1
  135. package/build/shared/interfaces/resources/intent/ISentence.js +32 -8
  136. package/build/shared/interfaces/resources/settings/IAgentSettings.js +40 -2
  137. package/build/shared/interfaces/resources/settings/IFlowSettings.js +1 -1
  138. package/build/shared/interfaces/restAPI/administration/liveAgent/v2.0/IReadLiveAgentAccountRest_2_0.js +3 -0
  139. package/build/shared/interfaces/restAPI/administration/liveAgent/v2.0/IReadProjectInboxRest_2_0.js +3 -0
  140. package/build/shared/interfaces/restAPI/administration/liveAgent/v2.0/ISetupCognigyLiveAgentInboxRest_2_0.js +3 -0
  141. package/build/shared/interfaces/restAPI/administration/liveAgent/v2.0/ISetupCognigyLiveAgentRest_2_0.js +3 -0
  142. package/build/shared/interfaces/restAPI/administration/liveAgent/v2.0/index.js +3 -0
  143. package/build/shared/interfaces/restAPI/analytics/IDeleteAnalyticsRecordsRest_2_0.js +3 -0
  144. package/build/shared/interfaces/restAPI/analytics/IUpdateAnalyticsRecordProperties_2_0.js +3 -0
  145. package/build/shared/interfaces/restAPI/analytics/IUpdateAnalyticsRecordsRest_2_0.js +3 -0
  146. package/build/shared/interfaces/restAPI/insights/IAnalyticsQueryFilter_2_0.js +3 -0
  147. package/build/shared/interfaces/restAPI/insights/TAnalyticsQueryFilterOperator_2_0.js +3 -0
  148. package/build/shared/interfaces/restAPI/insights/messages/IGenerateMessagesRest_2_0.js +5 -0
  149. package/build/shared/interfaces/restAPI/insights/messages/ILoadMessagesReportByQueryHashResponse_2_0.js +3 -0
  150. package/build/shared/interfaces/restAPI/insights/messages/ILoadMessagesReportByQueryHashRestData_2_0.js +3 -0
  151. package/build/shared/interfaces/restAPI/insights/messages/ITopNMessages_2_0.js +3 -0
  152. package/build/shared/interfaces/restAPI/insights/reports/IGenerateReportResponse_2_0.js +3 -0
  153. package/build/shared/interfaces/restAPI/insights/reports/IGenerateReportRest_2_0.js +41 -0
  154. package/build/shared/interfaces/restAPI/insights/reports/ILoadReportByQueryHashResponse_2_0.js +3 -0
  155. package/build/shared/interfaces/restAPI/insights/reports/ILoadReportByQueryHashRest_2_0.js +3 -0
  156. package/build/shared/interfaces/restAPI/insights/steps/IGenerateStepReportRest_2_0.js +3 -0
  157. package/build/shared/interfaces/restAPI/insights/steps/IIndexStepsRest_2_0.js +3 -0
  158. package/build/shared/interfaces/restAPI/insights/steps/ILoadStepReportByQueryHashResponse_2_0.js +3 -0
  159. package/build/shared/interfaces/restAPI/insights/steps/ILoadStepReportByQueryHashRestData_2_0.js +3 -0
  160. package/build/shared/interfaces/restAPI/insights/steps/IStepIndexItem_2_0.js +3 -0
  161. package/build/shared/interfaces/restAPI/insights/steps/IStepReport_2_0.js +3 -0
  162. package/build/shared/interfaces/restAPI/insights/steps/IStep_2_0.js +3 -0
  163. package/build/shared/interfaces/restAPI/insights/transcripts/IGenerateTranscriptsRest_2_0.js +3 -0
  164. package/build/shared/interfaces/restAPI/insights/transcripts/ILoadTranscriptsReportByQueryHashResponse_2_0.js +3 -0
  165. package/build/shared/interfaces/restAPI/insights/transcripts/ILoadTranscriptsReportByQueryHashRestData_2_0.js +3 -0
  166. package/build/shared/interfaces/restAPI/insights/transcripts/IStepPath_2_0.js +3 -0
  167. package/build/shared/interfaces/restAPI/resources/chart/v2.0/ISearchChartNodesRest_2_0.js +3 -0
  168. package/build/shared/interfaces/restAPI/resources/extension/v2.0/IUpdateExtensionPackageRest_2_0.js +4 -0
  169. package/build/shared/interfaces/restAPI/resources/flow/v2.0/ICreateFlowFromChildrenRest_2_0.js +4 -0
  170. package/build/shared/interfaces/restAPI/resources/flow/v2.0/intent/ITrainYesNoIntentsRest_2_0.js +3 -0
  171. package/build/shared/interfaces/restAPI/resources/lexicon/v2.0/IComposeLexiconDownloadLinkRest_2_0.js +3 -0
  172. package/build/shared/interfaces/restAPI/resources/nluconnector/v2.0/TNLUConnectorType_2_0.js +3 -1
  173. package/build/shared/interfaces/restAPI/resources/nodedescriptorsets/v2.0/IOptionsResolverRest_2_0.js +3 -0
  174. package/build/shared/interfaces/restAPI/resources/playbook/v2.0/IDeletePlaybookRunRest_2_0.js +3 -0
  175. package/build/shared/interfaces/restAPI/resources/playbook/v2.0/IIndexPlaybookRunsRest_2_0.js +3 -0
  176. package/build/shared/interfaces/restAPI/resources/playbook/v2.0/IPlaybookRunIndexItem_2_0.js +3 -0
  177. package/build/shared/interfaces/restAPI/resources/playbook/v2.0/IPlaybookRun_2_0.js +7 -0
  178. package/build/shared/interfaces/restAPI/resources/playbook/v2.0/IReadPlaybookRunRest_2_0.js +3 -0
  179. package/build/shared/interfaces/restAPI/resources/playbook/v2.0/ISchedulePlaybookRunRest_2_0.js +3 -0
  180. package/build/shared/interfaces/security/IACL.js +1 -1
  181. package/build/shared/interfaces/security/IPermission.js +6 -0
  182. package/build/shared/interfaces/security/IRole.js +8 -2
  183. package/build/shared/interfaces/sessionstate/ISessionState.js +3 -0
  184. package/build/shared/interfaces/sessionstate/index.js +3 -0
  185. package/build/shared/interfaces/trainer/ITrainerRecord.js +4 -0
  186. package/build/shared/interfaces/translation.js +11 -0
  187. package/package.json +5 -5
  188. package/types/index.d.ts +3905 -1178
  189. package/build/shared/charts/descriptors/logic/checkFrustration.js +0 -82
@@ -48,6 +48,41 @@ exports.OVERWRITE_ANALYTICS = createNodeDescriptor_1.createNodeDescriptor({
48
48
  type: "cognigyText",
49
49
  label: "Custom Value 3",
50
50
  },
51
+ {
52
+ key: "custom4",
53
+ type: "cognigyText",
54
+ label: "Custom Value 4",
55
+ },
56
+ {
57
+ key: "custom5",
58
+ type: "cognigyText",
59
+ label: "Custom Value 5",
60
+ },
61
+ {
62
+ key: "custom6",
63
+ type: "cognigyText",
64
+ label: "Custom Value 6",
65
+ },
66
+ {
67
+ key: "custom7",
68
+ type: "cognigyText",
69
+ label: "Custom Value 7",
70
+ },
71
+ {
72
+ key: "custom8",
73
+ type: "cognigyText",
74
+ label: "Custom Value 8",
75
+ },
76
+ {
77
+ key: "custom9",
78
+ type: "cognigyText",
79
+ label: "Custom Value 9",
80
+ },
81
+ {
82
+ key: "custom10",
83
+ type: "cognigyText",
84
+ label: "Custom Value 10",
85
+ },
51
86
  {
52
87
  key: "intent",
53
88
  type: "cognigyText",
@@ -74,6 +109,11 @@ exports.OVERWRITE_ANALYTICS = createNodeDescriptor_1.createNodeDescriptor({
74
109
  type: "cognigyText",
75
110
  label: "State",
76
111
  },
112
+ {
113
+ key: "handoverEscalations",
114
+ type: "cognigyText",
115
+ label: "Handover Escalations",
116
+ },
77
117
  {
78
118
  key: "slots",
79
119
  type: "json",
@@ -117,7 +157,14 @@ exports.OVERWRITE_ANALYTICS = createNodeDescriptor_1.createNodeDescriptor({
117
157
  "customDesc",
118
158
  "custom1",
119
159
  "custom2",
120
- "custom3"
160
+ "custom3",
161
+ "custom4",
162
+ "custom5",
163
+ "custom6",
164
+ "custom7",
165
+ "custom8",
166
+ "custom9",
167
+ "custom10",
121
168
  ]
122
169
  },
123
170
  {
@@ -133,7 +180,8 @@ exports.OVERWRITE_ANALYTICS = createNodeDescriptor_1.createNodeDescriptor({
133
180
  "state",
134
181
  "slots",
135
182
  "completedGoals",
136
- "understood"
183
+ "understood",
184
+ "handoverEscalations",
137
185
  ]
138
186
  },
139
187
  ],
@@ -145,6 +193,10 @@ exports.OVERWRITE_ANALYTICS = createNodeDescriptor_1.createNodeDescriptor({
145
193
  function: async ({ cognigy, config }) => {
146
194
  const { api } = cognigy;
147
195
  for (let key of Object.keys(config)) {
196
+ if (key === "handoverEscalations") {
197
+ api.setAnalyticsData(key, parseInt(config[key]));
198
+ continue;
199
+ }
148
200
  switch (typeof config[key]) {
149
201
  case "string":
150
202
  if (config[key] && config[key].length > 0 && config[key] !== "cUndefined") {
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.REQUEST_RATING = void 0;
4
+ /* Custom modules */
5
+ const createNodeDescriptor_1 = require("../../createNodeDescriptor");
6
+ /**
7
+ * Node name: 'requestRating'
8
+ *
9
+ * Purpose:
10
+ * Send a rating request message to a webchat endpoint
11
+ */
12
+ exports.REQUEST_RATING = createNodeDescriptor_1.createNodeDescriptor({
13
+ type: "requestRating",
14
+ defaultLabel: "Request Rating",
15
+ summary: "Request a rating from a Webchat User",
16
+ appearance: {
17
+ showIcon: false,
18
+ },
19
+ preview: {
20
+ key: "ratingTitleText",
21
+ type: "text",
22
+ },
23
+ fields: [
24
+ {
25
+ key: "ratingTitleText",
26
+ type: "cognigyText",
27
+ label: "Rating Title",
28
+ description: "Define a custom title for the rating request dialog",
29
+ },
30
+ {
31
+ key: "ratingCommentText",
32
+ type: "cognigyText",
33
+ label: "Rating Comment Text",
34
+ description: "Define a custom comment text for the rating request dialog",
35
+ },
36
+ ],
37
+ form: [
38
+ { type: "field", key: "ratingTitleText" },
39
+ { type: "field", key: "ratingCommentText" },
40
+ ],
41
+ tags: ["message", "profile", "analytics", "rating",],
42
+ function: async ({ cognigy, config }) => {
43
+ const { api } = cognigy;
44
+ const ratingTitleText = config.ratingTitleText;
45
+ const ratingCommentText = config.ratingCommentText;
46
+ api.say("", {
47
+ _plugin: {
48
+ type: "request-rating",
49
+ data: {
50
+ ratingTitleText,
51
+ ratingCommentText,
52
+ },
53
+ },
54
+ });
55
+ }
56
+ });
57
+ //# sourceMappingURL=requestRating.js.map
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SET_RATING = void 0;
4
+ /* Custom modules */
5
+ const createNodeDescriptor_1 = require("../../createNodeDescriptor");
6
+ exports.SET_RATING = createNodeDescriptor_1.createNodeDescriptor({
7
+ type: "setRating",
8
+ defaultLabel: "Set Rating",
9
+ summary: "Sets the rating and rating comment for a conversation",
10
+ appearance: {
11
+ showIcon: false
12
+ },
13
+ fields: [
14
+ {
15
+ key: "rating",
16
+ type: "cognigyText",
17
+ label: "Rating Score",
18
+ description: "The rating for the conversation. -1 for a negative rating or 1 for a positive rating"
19
+ },
20
+ {
21
+ key: "ratingComment",
22
+ type: "cognigyText",
23
+ label: "Rating Comment",
24
+ },
25
+ ],
26
+ form: [
27
+ { type: "field", key: "rating" },
28
+ { type: "field", key: "ratingComment" }
29
+ ],
30
+ tags: ["profile", "analytics", "rating", "success"],
31
+ function: async ({ cognigy, config }) => {
32
+ const { api } = cognigy;
33
+ api.setRating({
34
+ rating: config.rating,
35
+ comment: config.ratingComment
36
+ });
37
+ }
38
+ });
39
+ //# sourceMappingURL=setRating.js.map
@@ -16,6 +16,10 @@ exports.HANDOVER = createNodeDescriptor_1.createNodeDescriptor({
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
  });
@@ -0,0 +1,129 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HANDOVER_V2 = void 0;
4
+ /* Custom modules */
5
+ const createNodeDescriptor_1 = require("../../createNodeDescriptor");
6
+ exports.HANDOVER_V2 = createNodeDescriptor_1.createNodeDescriptor({
7
+ type: "handoverToAgent",
8
+ defaultLabel: "Handover to Agent",
9
+ summary: "Sends a handover request to an agent",
10
+ appearance: {
11
+ showIcon: false
12
+ },
13
+ dependencies: {
14
+ children: [],
15
+ },
16
+ fields: [
17
+ {
18
+ key: "text",
19
+ type: "cognigyText",
20
+ label: "Handover Accepted Message",
21
+ description: "The message to display to the user once the handover request was accepted by the live chat provider"
22
+ },
23
+ {
24
+ key: "repeatHandoverMessage",
25
+ type: "toggle",
26
+ label: "Repeat Handover Accepted Message",
27
+ description: "Repeatedly respond with Handover Accepted Message for each user input until human agent responds",
28
+ defaultValue: false,
29
+ },
30
+ {
31
+ key: "cancelIntent",
32
+ type: "cognigyText",
33
+ label: "Cancel Intent",
34
+ description: "Name of the intent which will cancel the handover"
35
+ },
36
+ {
37
+ key: "quickReply",
38
+ type: "cognigyText",
39
+ label: "Cancel Button Text",
40
+ description: "Text of the Quick Reply Button which sends the user back to the Virtual Agent"
41
+ },
42
+ {
43
+ key: "liveAgentInboxId",
44
+ type: "cognigyText",
45
+ label: "Live Agent Inbox Id",
46
+ description: "Inbox Id in Live Agent"
47
+ },
48
+ {
49
+ key: "chatwootInboxId",
50
+ type: "cognigyText",
51
+ label: "Chatwoot Inbox Id",
52
+ description: "Inbox Id in Chatwoot"
53
+ },
54
+ {
55
+ key: "salesforcePrechatEntities",
56
+ type: "json",
57
+ label: "Salesforce Prechat Entites",
58
+ description: "The Salesforce entity that should be used.",
59
+ defaultValue: "[]",
60
+ },
61
+ {
62
+ key: "salesforcePrechatDetails",
63
+ label: "Salesforce Prechat Details",
64
+ type: "json",
65
+ description: "The details that should be displayed to the Live Chat Agent.",
66
+ defaultValue: "[]",
67
+ },
68
+ ],
69
+ sections: [
70
+ {
71
+ key: "cancelSettings",
72
+ label: "Cancel Handover Options",
73
+ defaultCollapsed: true,
74
+ fields: [
75
+ "cancelIntent",
76
+ "quickReply",
77
+ ]
78
+ },
79
+ {
80
+ key: "liveAgentSettings",
81
+ label: "Live Agent Settings",
82
+ defaultCollapsed: true,
83
+ fields: [
84
+ "liveAgentInboxId",
85
+ ]
86
+ },
87
+ {
88
+ key: "chatwootSettings",
89
+ label: "Chatwoot Settings",
90
+ defaultCollapsed: true,
91
+ fields: [
92
+ "chatwootInboxId",
93
+ ]
94
+ },
95
+ {
96
+ key: "salesforceSettings",
97
+ label: "Salesforce Settings",
98
+ defaultCollapsed: true,
99
+ fields: [
100
+ "salesforcePrechatEntities",
101
+ "salesforcePrechatDetails"
102
+ ]
103
+ }
104
+ ],
105
+ form: [
106
+ { type: "field", key: "text" },
107
+ { type: "field", key: "repeatHandoverMessage" },
108
+ { type: "section", key: "cancelSettings" },
109
+ // only render this field if "live agent" is enabled
110
+ process.env.FEATURE_USE_COGNIGY_LIVE_AGENT === "true" && {
111
+ type: "section",
112
+ key: "liveAgentSettings"
113
+ },
114
+ { type: "section", key: "chatwootSettings" },
115
+ { type: "section", key: "salesforceSettings" }
116
+ ]
117
+ .filter(element => !!element),
118
+ tags: ["service", "livechat", "chat", "hand over"],
119
+ function: async ({ cognigy, config, childConfigs, nodeId }) => {
120
+ const { api, input } = cognigy;
121
+ const result = await api.handoverV2({ cognigy, config, nodeId, childConfigs });
122
+ if ((result === null || result === void 0 ? void 0 : result.status) === "error") {
123
+ input.handover = result;
124
+ return;
125
+ }
126
+ api.stopExecution();
127
+ }
128
+ });
129
+ //# sourceMappingURL=handoverV2.js.map
@@ -93,16 +93,16 @@ exports.HTTP_REQUEST = createNodeDescriptor_1.createNodeDescriptor({
93
93
  },
94
94
  {
95
95
  key: "headers",
96
- type: "json",
96
+ type: "keyValuePairs",
97
97
  label: "Headers",
98
- description: "Headers to send in the request",
99
- defaultValue: {}
98
+ description: "Headers to send in the request (key/value pairs)",
99
+ defaultValue: {},
100
100
  },
101
101
  {
102
102
  key: "payloadType",
103
103
  type: "select",
104
104
  label: "Payload Type",
105
- description: "Whether to send JSON or Text payload in the request",
105
+ description: "Whether to send JSON, Text or Form-Data payload in the request",
106
106
  defaultValue: "json",
107
107
  params: {
108
108
  required: true,
@@ -114,6 +114,10 @@ exports.HTTP_REQUEST = createNodeDescriptor_1.createNodeDescriptor({
114
114
  {
115
115
  label: "Text",
116
116
  value: "text"
117
+ },
118
+ {
119
+ label: "Form-Data",
120
+ value: "form-data"
117
121
  }
118
122
  ]
119
123
  }
@@ -138,6 +142,16 @@ exports.HTTP_REQUEST = createNodeDescriptor_1.createNodeDescriptor({
138
142
  value: "json"
139
143
  }
140
144
  },
145
+ {
146
+ key: "payloadFormData",
147
+ type: "json",
148
+ label: "Payload",
149
+ defaultValue: {},
150
+ condition: {
151
+ key: "payloadType",
152
+ value: "form-data"
153
+ }
154
+ },
141
155
  {
142
156
  key: "storeLocation",
143
157
  type: "select",
@@ -350,6 +364,7 @@ exports.HTTP_REQUEST = createNodeDescriptor_1.createNodeDescriptor({
350
364
  "payloadType",
351
365
  "payloadText",
352
366
  "payloadJSON",
367
+ "payloadFormData",
353
368
  ],
354
369
  condition: {
355
370
  key: "type",
@@ -372,7 +387,7 @@ exports.HTTP_REQUEST = createNodeDescriptor_1.createNodeDescriptor({
372
387
  defaultCollapsed: true,
373
388
  fields: [
374
389
  "headers",
375
- "storeResponseHeaders"
390
+ "storeResponseHeaders",
376
391
  ]
377
392
  },
378
393
  {
@@ -436,7 +451,7 @@ exports.HTTP_REQUEST = createNodeDescriptor_1.createNodeDescriptor({
436
451
  function: async (httpRequestParams) => {
437
452
  const { cognigy, config } = httpRequestParams;
438
453
  const { api } = cognigy;
439
- const { url, inputKey, contextKey, payloadType, payloadJSON, payloadText, async, storeLocation, authType, } = config;
454
+ const { url, inputKey, contextKey, payloadType, payloadJSON, payloadText, payloadFormData, async, storeLocation, authType, } = config;
440
455
  const { oAuth2Connection } = config;
441
456
  const { basicConnection } = config;
442
457
  const { apiKeyAuthKeyConnection } = config;
@@ -475,10 +490,14 @@ exports.HTTP_REQUEST = createNodeDescriptor_1.createNodeDescriptor({
475
490
  break;
476
491
  }
477
492
  }
478
- if (payloadType === "json" && typeof payloadJSON === 'object') {
493
+ if (payloadType === "json" && typeof payloadJSON === "object") {
479
494
  config.payloadIsJSON = true;
480
495
  config.payload = payloadJSON;
481
496
  }
497
+ else if (payloadType === "form-data" && typeof payloadFormData === "object") {
498
+ config.payloadIsFormData = true;
499
+ config.payload = payloadFormData;
500
+ }
482
501
  else {
483
502
  config.payloadIsJSON = false;
484
503
  config.payload = payloadText;
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ON_SCHEDULING_ERROR = exports.ON_SCHEDULED = exports.TRIGGER_FUNCTION = exports.HTTP_CONNECTION_OAUTH2 = exports.HTTP_CONNECTION_APIKEYXKEY = exports.HTTP_CONNECTION_APIKEYAUTHKEY = exports.HTTP_CONNECTION_BASIC = exports.HTTP_REQUEST = exports.HANDOVER = void 0;
3
+ exports.ON_SCHEDULING_ERROR = exports.ON_SCHEDULED = exports.TRIGGER_FUNCTION = exports.HTTP_CONNECTION_OAUTH2 = exports.HTTP_CONNECTION_APIKEYXKEY = exports.HTTP_CONNECTION_APIKEYAUTHKEY = exports.HTTP_CONNECTION_BASIC = exports.HTTP_REQUEST = exports.HANDOVER_V2 = exports.HANDOVER = void 0;
4
4
  var handover_1 = require("./handover");
5
5
  Object.defineProperty(exports, "HANDOVER", { enumerable: true, get: function () { return handover_1.HANDOVER; } });
6
+ var handoverV2_1 = require("./handoverV2");
7
+ Object.defineProperty(exports, "HANDOVER_V2", { enumerable: true, get: function () { return handoverV2_1.HANDOVER_V2; } });
6
8
  var httpRequest_1 = require("./httpRequest");
7
9
  /* Node */
8
10
  Object.defineProperty(exports, "HTTP_REQUEST", { enumerable: true, get: function () { return httpRequest_1.HTTP_REQUEST; } });
@@ -11,11 +11,13 @@ exports.ON_SCHEDULED = createNodeDescriptor_1.createNodeDescriptor({
11
11
  color: '#57c95b',
12
12
  variant: "mini",
13
13
  textColor: "white",
14
+ contrastTextColor: "black",
14
15
  },
15
16
  constraints: {
16
17
  editable: false,
17
18
  deletable: false,
18
19
  collapsable: true,
20
+ childFlowCreatable: true,
19
21
  creatable: false,
20
22
  movable: false,
21
23
  placement: {}
@@ -11,11 +11,13 @@ exports.ON_SCHEDULING_ERROR = createNodeDescriptor_1.createNodeDescriptor({
11
11
  color: '#57c95b',
12
12
  variant: "mini",
13
13
  textColor: "white",
14
+ contrastTextColor: "black",
14
15
  },
15
16
  constraints: {
16
17
  editable: false,
17
18
  deletable: false,
18
19
  collapsable: true,
20
+ childFlowCreatable: true,
19
21
  creatable: false,
20
22
  movable: false,
21
23
  placement: {}
@@ -9,6 +9,7 @@ exports.START = createNodeDescriptor_1.createNodeDescriptor({
9
9
  appearance: {
10
10
  color: '#61D188',
11
11
  textColor: 'white',
12
+ contrastTextColor: 'black',
12
13
  variant: 'mini'
13
14
  },
14
15
  behavior: {
@@ -20,6 +20,8 @@ exports.callRecordingNode = createNodeDescriptor_1.createNodeDescriptor({
20
20
  options: [
21
21
  { value: "startCallRecording", label: "Start Call Recording" },
22
22
  { value: "stopCallRecording", label: "Stop Call Recording" },
23
+ { value: "pauseCallRecording", label: "Pause Call Recording" },
24
+ { value: "resumeCallRecording", label: "Resume Call Recording" },
23
25
  ]
24
26
  }
25
27
  },
@@ -41,6 +43,10 @@ exports.callRecordingNode = createNodeDescriptor_1.createNodeDescriptor({
41
43
  defaultValue: "",
42
44
  params: {
43
45
  required: true
46
+ },
47
+ condition: {
48
+ key: "activity",
49
+ value: "startCallRecording"
44
50
  }
45
51
  },
46
52
  {
@@ -66,22 +72,36 @@ exports.callRecordingNode = createNodeDescriptor_1.createNodeDescriptor({
66
72
  const { activity, callRecordingDestUsername, callRecordingId, callRecordingServer } = config;
67
73
  if (callRecordingServer && callRecordingId && callRecordingDestUsername) {
68
74
  let activities = [];
69
- if (activity === "startCallRecording") {
70
- activities.push({
71
- type: "event",
72
- name: "startCallRecording",
73
- activityParams: {
74
- callRecordingId,
75
- callRecordingDestUsername,
76
- callRecordingServer
77
- }
78
- });
79
- }
80
- if (activity === "stopCallRecording") {
81
- activities.push({
82
- type: "event",
83
- name: "stopCallRecording",
84
- });
75
+ switch (activity) {
76
+ case "startCallRecording":
77
+ activities.push({
78
+ type: "event",
79
+ name: "startCallRecording",
80
+ activityParams: {
81
+ callRecordingId,
82
+ callRecordingDestUsername,
83
+ callRecordingServer
84
+ }
85
+ });
86
+ break;
87
+ case "stopCallRecording":
88
+ activities.push({
89
+ type: "event",
90
+ name: "stopCallRecording",
91
+ });
92
+ break;
93
+ case "pauseCallRecording":
94
+ activities.push({
95
+ type: "event",
96
+ name: "pauseCallRecording",
97
+ });
98
+ break;
99
+ case "resumeCallRecording":
100
+ activities.push({
101
+ type: "event",
102
+ name: "resumeCallRecording",
103
+ });
104
+ break;
85
105
  }
86
106
  api.output(null, {
87
107
  "_cognigy": {
@@ -7,8 +7,8 @@ const createNodeDescriptor_1 = require("../../../createNodeDescriptor");
7
7
  const design_1 = require("../utils/design");
8
8
  exports.handoverNode = createNodeDescriptor_1.createNodeDescriptor({
9
9
  type: "handover",
10
- defaultLabel: "Handover",
11
- summary: "Hands the conversations to another target",
10
+ defaultLabel: "Transfer",
11
+ summary: "Transfers a conversation to another target",
12
12
  fields: [
13
13
  {
14
14
  key: "handoverReason",
@@ -25,6 +25,7 @@ exports.playURLNode = createNodeDescriptor_1.createNodeDescriptor({
25
25
  label: "Media Format",
26
26
  type: "select",
27
27
  defaultValue: "wav/lpcm16",
28
+ description: "Either Mu-Law (8 bit, 8 kHz) or Linear PCM (16 bit, 16 kHz) encoded with or without a WAV header",
28
29
  params: {
29
30
  options: [
30
31
  {
@@ -34,6 +35,14 @@ exports.playURLNode = createNodeDescriptor_1.createNodeDescriptor({
34
35
  {
35
36
  label: "raw/lpcm16",
36
37
  value: "raw/lpcm16"
38
+ },
39
+ {
40
+ label: "wav/mulaw",
41
+ value: "wav/mulaw"
42
+ },
43
+ {
44
+ label: "raw/mulaw",
45
+ value: "raw/mulaw"
37
46
  }
38
47
  ]
39
48
  }
@@ -252,7 +252,7 @@ exports.sendMessageNode = createNodeDescriptor_1.createNodeDescriptor({
252
252
  paramUtils_1.compileParams(config, compiledParams);
253
253
  }
254
254
  if (text) {
255
- api.output(text, {
255
+ api.output(null, {
256
256
  "_cognigy": {
257
257
  "_voiceGateway": {
258
258
  "json": {
@@ -84,6 +84,13 @@ const getParameterFields = () => [
84
84
  description: "Azure's Custom Speech model ID",
85
85
  defaultValue: ""
86
86
  },
87
+ {
88
+ key: "ttsDeploymentId",
89
+ type: "cognigyText",
90
+ label: "Azure TTS Deployment ID",
91
+ description: "Azure's Custom Speech model deployment ID",
92
+ defaultValue: ""
93
+ },
87
94
  {
88
95
  key: "azureEnableAudioLogging",
89
96
  type: "toggle",
@@ -120,7 +127,7 @@ const getParameterFields = () => [
120
127
  key: "bargeInMinWordCount",
121
128
  type: "slider",
122
129
  label: "Barge In Minimum Words",
123
- description: "Defines the minimum number of words that the user must say for the Voice Gateway to consider it a barge-in",
130
+ description: "Defines the minimum number of words that the user must say for the Voice Gateway to consider it a barge in",
124
131
  defaultValue: 0,
125
132
  params: {
126
133
  min: 0,
@@ -391,6 +398,7 @@ const getParamSections = (condition) => [
391
398
  "azureUseContextPhrases",
392
399
  "sttContextPhrasesAzure",
393
400
  "sttContextBoostAzure",
401
+ "ttsDeploymentId",
394
402
  "azureEnableAudioLogging",
395
403
  ],
396
404
  condition