@botonic/plugin-flow-builder 0.43.2 → 0.44.0-alpha.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 (312) hide show
  1. package/lib/cjs/action/ai-agent.js +55 -61
  2. package/lib/cjs/action/ai-agent.js.map +1 -1
  3. package/lib/cjs/action/fallback.js +28 -32
  4. package/lib/cjs/action/fallback.js.map +1 -1
  5. package/lib/cjs/action/first-interaction.js +61 -71
  6. package/lib/cjs/action/first-interaction.js.map +1 -1
  7. package/lib/cjs/action/index.js +66 -79
  8. package/lib/cjs/action/index.js.map +1 -1
  9. package/lib/cjs/action/knowledge-bases.js +64 -72
  10. package/lib/cjs/action/knowledge-bases.js.map +1 -1
  11. package/lib/cjs/action/payload.js +61 -70
  12. package/lib/cjs/action/payload.js.map +1 -1
  13. package/lib/cjs/api.d.ts +7 -2
  14. package/lib/cjs/api.js +58 -36
  15. package/lib/cjs/api.js.map +1 -1
  16. package/lib/cjs/constants.d.ts +1 -1
  17. package/lib/cjs/content-fields/content-fields-base.js +3 -6
  18. package/lib/cjs/content-fields/content-fields-base.js.map +1 -1
  19. package/lib/cjs/content-fields/flow-ai-agent.d.ts +0 -1
  20. package/lib/cjs/content-fields/flow-ai-agent.js +4 -7
  21. package/lib/cjs/content-fields/flow-ai-agent.js.map +1 -1
  22. package/lib/cjs/content-fields/flow-bot-action.d.ts +0 -1
  23. package/lib/cjs/content-fields/flow-bot-action.js +14 -17
  24. package/lib/cjs/content-fields/flow-bot-action.js.map +1 -1
  25. package/lib/cjs/content-fields/flow-button.d.ts +0 -1
  26. package/lib/cjs/content-fields/flow-button.js +10 -16
  27. package/lib/cjs/content-fields/flow-button.js.map +1 -1
  28. package/lib/cjs/content-fields/flow-capture-user-input.d.ts +13 -0
  29. package/lib/cjs/content-fields/flow-capture-user-input.js +43 -0
  30. package/lib/cjs/content-fields/flow-capture-user-input.js.map +1 -0
  31. package/lib/cjs/content-fields/flow-carousel.d.ts +0 -1
  32. package/lib/cjs/content-fields/flow-carousel.js +16 -23
  33. package/lib/cjs/content-fields/flow-carousel.js.map +1 -1
  34. package/lib/cjs/content-fields/flow-channel-conditional.d.ts +0 -1
  35. package/lib/cjs/content-fields/flow-channel-conditional.js +14 -17
  36. package/lib/cjs/content-fields/flow-channel-conditional.js.map +1 -1
  37. package/lib/cjs/content-fields/flow-country-conditional.d.ts +0 -1
  38. package/lib/cjs/content-fields/flow-country-conditional.js +17 -21
  39. package/lib/cjs/content-fields/flow-country-conditional.js.map +1 -1
  40. package/lib/cjs/content-fields/flow-custom-conditional.js +18 -22
  41. package/lib/cjs/content-fields/flow-custom-conditional.js.map +1 -1
  42. package/lib/cjs/content-fields/flow-element.d.ts +0 -1
  43. package/lib/cjs/content-fields/flow-element.js +5 -9
  44. package/lib/cjs/content-fields/flow-element.js.map +1 -1
  45. package/lib/cjs/content-fields/flow-go-to-flow.d.ts +0 -1
  46. package/lib/cjs/content-fields/flow-go-to-flow.js +15 -18
  47. package/lib/cjs/content-fields/flow-go-to-flow.js.map +1 -1
  48. package/lib/cjs/content-fields/flow-handoff.d.ts +0 -1
  49. package/lib/cjs/content-fields/flow-handoff.js +29 -35
  50. package/lib/cjs/content-fields/flow-handoff.js.map +1 -1
  51. package/lib/cjs/content-fields/flow-image.d.ts +0 -1
  52. package/lib/cjs/content-fields/flow-image.js +2 -5
  53. package/lib/cjs/content-fields/flow-image.js.map +1 -1
  54. package/lib/cjs/content-fields/flow-knowledge-base.d.ts +0 -1
  55. package/lib/cjs/content-fields/flow-knowledge-base.js +5 -8
  56. package/lib/cjs/content-fields/flow-knowledge-base.js.map +1 -1
  57. package/lib/cjs/content-fields/flow-queue-status-conditional.d.ts +0 -1
  58. package/lib/cjs/content-fields/flow-queue-status-conditional.js +55 -65
  59. package/lib/cjs/content-fields/flow-queue-status-conditional.js.map +1 -1
  60. package/lib/cjs/content-fields/flow-rating.d.ts +0 -1
  61. package/lib/cjs/content-fields/flow-rating.js +2 -5
  62. package/lib/cjs/content-fields/flow-rating.js.map +1 -1
  63. package/lib/cjs/content-fields/flow-text.d.ts +0 -1
  64. package/lib/cjs/content-fields/flow-text.js +5 -8
  65. package/lib/cjs/content-fields/flow-text.js.map +1 -1
  66. package/lib/cjs/content-fields/flow-video.d.ts +0 -1
  67. package/lib/cjs/content-fields/flow-video.js +2 -5
  68. package/lib/cjs/content-fields/flow-video.js.map +1 -1
  69. package/lib/cjs/content-fields/flow-webview.js +15 -18
  70. package/lib/cjs/content-fields/flow-webview.js.map +1 -1
  71. package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.d.ts +0 -1
  72. package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js +3 -6
  73. package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js.map +1 -1
  74. package/lib/cjs/content-fields/flow-whatsapp-template.d.ts +0 -1
  75. package/lib/cjs/content-fields/flow-whatsapp-template.js +6 -12
  76. package/lib/cjs/content-fields/flow-whatsapp-template.js.map +1 -1
  77. package/lib/cjs/content-fields/hubtype-fields/capture-user-input.d.ts +19 -0
  78. package/lib/cjs/content-fields/hubtype-fields/capture-user-input.js +12 -0
  79. package/lib/cjs/content-fields/hubtype-fields/capture-user-input.js.map +1 -0
  80. package/lib/cjs/content-fields/hubtype-fields/function.js +1 -1
  81. package/lib/cjs/content-fields/hubtype-fields/function.js.map +1 -1
  82. package/lib/cjs/content-fields/hubtype-fields/index.d.ts +1 -0
  83. package/lib/cjs/content-fields/hubtype-fields/index.js +1 -0
  84. package/lib/cjs/content-fields/hubtype-fields/index.js.map +1 -1
  85. package/lib/cjs/content-fields/hubtype-fields/node-types.d.ts +2 -1
  86. package/lib/cjs/content-fields/hubtype-fields/node-types.js +4 -3
  87. package/lib/cjs/content-fields/hubtype-fields/node-types.js.map +1 -1
  88. package/lib/cjs/content-fields/hubtype-fields/nodes.d.ts +2 -1
  89. package/lib/cjs/content-fields/hubtype-fields/rating.js +1 -1
  90. package/lib/cjs/content-fields/hubtype-fields/rating.js.map +1 -1
  91. package/lib/cjs/content-fields/index.d.ts +3 -2
  92. package/lib/cjs/content-fields/index.js +3 -1
  93. package/lib/cjs/content-fields/index.js.map +1 -1
  94. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +2 -5
  95. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +1 -1
  96. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +2 -5
  97. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +1 -1
  98. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +0 -1
  99. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +3 -6
  100. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +1 -1
  101. package/lib/cjs/filters/index.js +5 -8
  102. package/lib/cjs/filters/index.js.map +1 -1
  103. package/lib/cjs/flow-factory.js +49 -51
  104. package/lib/cjs/flow-factory.js.map +1 -1
  105. package/lib/cjs/functions/index.js +18 -21
  106. package/lib/cjs/functions/index.js.map +1 -1
  107. package/lib/cjs/helpers.js +1 -2
  108. package/lib/cjs/helpers.js.map +1 -1
  109. package/lib/cjs/index.js +68 -73
  110. package/lib/cjs/index.js.map +1 -1
  111. package/lib/cjs/services/hubtype-queues-api.js +10 -12
  112. package/lib/cjs/services/hubtype-queues-api.js.map +1 -1
  113. package/lib/cjs/tracking.d.ts +1 -1
  114. package/lib/cjs/tracking.js +33 -43
  115. package/lib/cjs/tracking.js.map +1 -1
  116. package/lib/cjs/types.js +2 -2
  117. package/lib/cjs/types.js.map +1 -1
  118. package/lib/cjs/user-input/capture-user-input-api.d.ts +20 -0
  119. package/lib/cjs/user-input/capture-user-input-api.js +84 -0
  120. package/lib/cjs/user-input/capture-user-input-api.js.map +1 -0
  121. package/lib/cjs/user-input/index.d.ts +1 -2
  122. package/lib/cjs/user-input/index.js +25 -24
  123. package/lib/cjs/user-input/index.js.map +1 -1
  124. package/lib/cjs/user-input/keyword.js +31 -36
  125. package/lib/cjs/user-input/keyword.js.map +1 -1
  126. package/lib/cjs/user-input/smart-intent.js +55 -59
  127. package/lib/cjs/user-input/smart-intent.js.map +1 -1
  128. package/lib/cjs/utils.js +7 -9
  129. package/lib/cjs/utils.js.map +1 -1
  130. package/lib/cjs/webview/contents-context.d.ts +0 -1
  131. package/lib/cjs/webview/types.js +1 -1
  132. package/lib/cjs/webview/types.js.map +1 -1
  133. package/lib/cjs/webview/use-webview-contents.js +10 -9
  134. package/lib/cjs/webview/use-webview-contents.js.map +1 -1
  135. package/lib/esm/action/ai-agent.js +61 -63
  136. package/lib/esm/action/ai-agent.js.map +1 -1
  137. package/lib/esm/action/fallback.js +32 -32
  138. package/lib/esm/action/fallback.js.map +1 -1
  139. package/lib/esm/action/first-interaction.js +69 -75
  140. package/lib/esm/action/first-interaction.js.map +1 -1
  141. package/lib/esm/action/index.js +93 -101
  142. package/lib/esm/action/index.js.map +1 -1
  143. package/lib/esm/action/knowledge-bases.js +71 -75
  144. package/lib/esm/action/knowledge-bases.js.map +1 -1
  145. package/lib/esm/action/payload.js +67 -72
  146. package/lib/esm/action/payload.js.map +1 -1
  147. package/lib/esm/api.d.ts +7 -2
  148. package/lib/esm/api.js +77 -51
  149. package/lib/esm/api.js.map +1 -1
  150. package/lib/esm/constants.d.ts +1 -1
  151. package/lib/esm/constants.js +17 -14
  152. package/lib/esm/constants.js.map +1 -1
  153. package/lib/esm/content-fields/content-fields-base.js +13 -12
  154. package/lib/esm/content-fields/content-fields-base.js.map +1 -1
  155. package/lib/esm/content-fields/flow-ai-agent.d.ts +0 -1
  156. package/lib/esm/content-fields/flow-ai-agent.js +18 -17
  157. package/lib/esm/content-fields/flow-ai-agent.js.map +1 -1
  158. package/lib/esm/content-fields/flow-bot-action.d.ts +0 -1
  159. package/lib/esm/content-fields/flow-bot-action.js +25 -24
  160. package/lib/esm/content-fields/flow-bot-action.js.map +1 -1
  161. package/lib/esm/content-fields/flow-button.d.ts +0 -1
  162. package/lib/esm/content-fields/flow-button.js +25 -27
  163. package/lib/esm/content-fields/flow-button.js.map +1 -1
  164. package/lib/esm/content-fields/flow-capture-user-input.d.ts +13 -0
  165. package/lib/esm/content-fields/flow-capture-user-input.js +43 -0
  166. package/lib/esm/content-fields/flow-capture-user-input.js.map +1 -0
  167. package/lib/esm/content-fields/flow-carousel.d.ts +0 -1
  168. package/lib/esm/content-fields/flow-carousel.js +39 -42
  169. package/lib/esm/content-fields/flow-carousel.js.map +1 -1
  170. package/lib/esm/content-fields/flow-channel-conditional.d.ts +0 -1
  171. package/lib/esm/content-fields/flow-channel-conditional.js +24 -23
  172. package/lib/esm/content-fields/flow-channel-conditional.js.map +1 -1
  173. package/lib/esm/content-fields/flow-country-conditional.d.ts +0 -1
  174. package/lib/esm/content-fields/flow-country-conditional.js +27 -27
  175. package/lib/esm/content-fields/flow-country-conditional.js.map +1 -1
  176. package/lib/esm/content-fields/flow-custom-conditional.js +30 -30
  177. package/lib/esm/content-fields/flow-custom-conditional.js.map +1 -1
  178. package/lib/esm/content-fields/flow-element.d.ts +0 -1
  179. package/lib/esm/content-fields/flow-element.js +16 -16
  180. package/lib/esm/content-fields/flow-element.js.map +1 -1
  181. package/lib/esm/content-fields/flow-go-to-flow.d.ts +0 -1
  182. package/lib/esm/content-fields/flow-go-to-flow.js +25 -24
  183. package/lib/esm/content-fields/flow-go-to-flow.js.map +1 -1
  184. package/lib/esm/content-fields/flow-handoff.d.ts +0 -1
  185. package/lib/esm/content-fields/flow-handoff.js +40 -42
  186. package/lib/esm/content-fields/flow-handoff.js.map +1 -1
  187. package/lib/esm/content-fields/flow-image.d.ts +0 -1
  188. package/lib/esm/content-fields/flow-image.js +12 -11
  189. package/lib/esm/content-fields/flow-image.js.map +1 -1
  190. package/lib/esm/content-fields/flow-knowledge-base.d.ts +0 -1
  191. package/lib/esm/content-fields/flow-knowledge-base.js +15 -14
  192. package/lib/esm/content-fields/flow-knowledge-base.js.map +1 -1
  193. package/lib/esm/content-fields/flow-queue-status-conditional.d.ts +0 -1
  194. package/lib/esm/content-fields/flow-queue-status-conditional.js +67 -73
  195. package/lib/esm/content-fields/flow-queue-status-conditional.js.map +1 -1
  196. package/lib/esm/content-fields/flow-rating.d.ts +0 -1
  197. package/lib/esm/content-fields/flow-rating.js +23 -22
  198. package/lib/esm/content-fields/flow-rating.js.map +1 -1
  199. package/lib/esm/content-fields/flow-text.d.ts +0 -1
  200. package/lib/esm/content-fields/flow-text.js +25 -24
  201. package/lib/esm/content-fields/flow-text.js.map +1 -1
  202. package/lib/esm/content-fields/flow-video.d.ts +0 -1
  203. package/lib/esm/content-fields/flow-video.js +12 -11
  204. package/lib/esm/content-fields/flow-video.js.map +1 -1
  205. package/lib/esm/content-fields/flow-webview.js +23 -22
  206. package/lib/esm/content-fields/flow-webview.js.map +1 -1
  207. package/lib/esm/content-fields/flow-whatsapp-cta-url-button.d.ts +0 -1
  208. package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js +31 -30
  209. package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js.map +1 -1
  210. package/lib/esm/content-fields/flow-whatsapp-template.d.ts +0 -1
  211. package/lib/esm/content-fields/flow-whatsapp-template.js +45 -47
  212. package/lib/esm/content-fields/flow-whatsapp-template.js.map +1 -1
  213. package/lib/esm/content-fields/hubtype-fields/ai-agent.js +2 -1
  214. package/lib/esm/content-fields/hubtype-fields/bot-action.js +2 -1
  215. package/lib/esm/content-fields/hubtype-fields/button.js +2 -1
  216. package/lib/esm/content-fields/hubtype-fields/capture-user-input.d.ts +19 -0
  217. package/lib/esm/content-fields/hubtype-fields/capture-user-input.js +12 -0
  218. package/lib/esm/content-fields/hubtype-fields/capture-user-input.js.map +1 -0
  219. package/lib/esm/content-fields/hubtype-fields/carousel.js +2 -1
  220. package/lib/esm/content-fields/hubtype-fields/channel-conditional.js +2 -1
  221. package/lib/esm/content-fields/hubtype-fields/common.js +2 -1
  222. package/lib/esm/content-fields/hubtype-fields/country-conditional.js +2 -1
  223. package/lib/esm/content-fields/hubtype-fields/custom-conditional.js +2 -1
  224. package/lib/esm/content-fields/hubtype-fields/fallback.js +2 -1
  225. package/lib/esm/content-fields/hubtype-fields/function.js +5 -2
  226. package/lib/esm/content-fields/hubtype-fields/function.js.map +1 -1
  227. package/lib/esm/content-fields/hubtype-fields/go-to-flow.js +2 -1
  228. package/lib/esm/content-fields/hubtype-fields/handoff.js +2 -1
  229. package/lib/esm/content-fields/hubtype-fields/image.js +2 -1
  230. package/lib/esm/content-fields/hubtype-fields/index.d.ts +1 -0
  231. package/lib/esm/content-fields/hubtype-fields/index.js +27 -23
  232. package/lib/esm/content-fields/hubtype-fields/index.js.map +1 -1
  233. package/lib/esm/content-fields/hubtype-fields/keyword.js +2 -1
  234. package/lib/esm/content-fields/hubtype-fields/knowledge-base.js +2 -1
  235. package/lib/esm/content-fields/hubtype-fields/node-types.d.ts +2 -1
  236. package/lib/esm/content-fields/hubtype-fields/node-types.js +10 -6
  237. package/lib/esm/content-fields/hubtype-fields/node-types.js.map +1 -1
  238. package/lib/esm/content-fields/hubtype-fields/nodes.d.ts +2 -1
  239. package/lib/esm/content-fields/hubtype-fields/nodes.js +2 -1
  240. package/lib/esm/content-fields/hubtype-fields/payload.js +2 -1
  241. package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.js +2 -1
  242. package/lib/esm/content-fields/hubtype-fields/rating.js +5 -2
  243. package/lib/esm/content-fields/hubtype-fields/rating.js.map +1 -1
  244. package/lib/esm/content-fields/hubtype-fields/smart-intent.js +2 -1
  245. package/lib/esm/content-fields/hubtype-fields/text.js +2 -1
  246. package/lib/esm/content-fields/hubtype-fields/url.js +2 -1
  247. package/lib/esm/content-fields/hubtype-fields/video.js +2 -1
  248. package/lib/esm/content-fields/hubtype-fields/webview.js +2 -1
  249. package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.js +2 -1
  250. package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.js +2 -1
  251. package/lib/esm/content-fields/hubtype-fields/whatsapp-template.js +2 -1
  252. package/lib/esm/content-fields/index.d.ts +3 -2
  253. package/lib/esm/content-fields/index.js +46 -22
  254. package/lib/esm/content-fields/index.js.map +1 -1
  255. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +10 -9
  256. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +1 -1
  257. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +10 -9
  258. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +1 -1
  259. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +0 -1
  260. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +18 -17
  261. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +1 -1
  262. package/lib/esm/filters/index.js +10 -9
  263. package/lib/esm/filters/index.js.map +1 -1
  264. package/lib/esm/flow-factory.js +56 -54
  265. package/lib/esm/flow-factory.js.map +1 -1
  266. package/lib/esm/functions/index.js +24 -22
  267. package/lib/esm/functions/index.js.map +1 -1
  268. package/lib/esm/helpers.js +4 -1
  269. package/lib/esm/helpers.js.map +1 -1
  270. package/lib/esm/index.js +101 -99
  271. package/lib/esm/index.js.map +1 -1
  272. package/lib/esm/services/hubtype-queues-api.js +17 -15
  273. package/lib/esm/services/hubtype-queues-api.js.map +1 -1
  274. package/lib/esm/tracking.d.ts +1 -1
  275. package/lib/esm/tracking.js +42 -45
  276. package/lib/esm/tracking.js.map +1 -1
  277. package/lib/esm/types.js +7 -4
  278. package/lib/esm/types.js.map +1 -1
  279. package/lib/esm/user-input/capture-user-input-api.d.ts +20 -0
  280. package/lib/esm/user-input/capture-user-input-api.js +84 -0
  281. package/lib/esm/user-input/capture-user-input-api.js.map +1 -0
  282. package/lib/esm/user-input/index.d.ts +1 -2
  283. package/lib/esm/user-input/index.js +30 -25
  284. package/lib/esm/user-input/index.js.map +1 -1
  285. package/lib/esm/user-input/keyword.js +40 -41
  286. package/lib/esm/user-input/keyword.js.map +1 -1
  287. package/lib/esm/user-input/smart-intent.js +65 -65
  288. package/lib/esm/user-input/smart-intent.js.map +1 -1
  289. package/lib/esm/utils.js +22 -15
  290. package/lib/esm/utils.js.map +1 -1
  291. package/lib/esm/webview/contents-context.d.ts +0 -1
  292. package/lib/esm/webview/contents-context.js +6 -2
  293. package/lib/esm/webview/contents-context.js.map +1 -1
  294. package/lib/esm/webview/index.js +9 -3
  295. package/lib/esm/webview/index.js.map +1 -1
  296. package/lib/esm/webview/types.js +5 -2
  297. package/lib/esm/webview/types.js.map +1 -1
  298. package/lib/esm/webview/use-webview-contents.js +28 -23
  299. package/lib/esm/webview/use-webview-contents.js.map +1 -1
  300. package/package.json +2 -2
  301. package/src/api.ts +35 -1
  302. package/src/content-fields/flow-capture-user-input.tsx +45 -0
  303. package/src/content-fields/hubtype-fields/capture-user-input.ts +21 -0
  304. package/src/content-fields/hubtype-fields/index.ts +1 -0
  305. package/src/content-fields/hubtype-fields/node-types.ts +1 -0
  306. package/src/content-fields/hubtype-fields/nodes.ts +2 -0
  307. package/src/content-fields/index.ts +3 -0
  308. package/src/flow-factory.ts +4 -0
  309. package/src/index.ts +4 -3
  310. package/src/tracking.ts +2 -2
  311. package/src/user-input/capture-user-input-api.ts +134 -0
  312. package/src/user-input/index.ts +13 -8
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FlowFactory = void 0;
4
- const tslib_1 = require("tslib");
5
4
  const content_fields_1 = require("./content-fields");
5
+ const flow_capture_user_input_1 = require("./content-fields/flow-capture-user-input");
6
6
  const hubtype_fields_1 = require("./content-fields/hubtype-fields");
7
7
  class FlowFactory {
8
8
  constructor(request, cmsApi, locale) {
@@ -10,57 +10,55 @@ class FlowFactory {
10
10
  this.cmsApi = cmsApi;
11
11
  this.locale = locale;
12
12
  }
13
- getFlowContent(hubtypeContent) {
14
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
15
- switch (hubtypeContent.type) {
16
- case hubtype_fields_1.HtNodeWithContentType.TEXT:
17
- return content_fields_1.FlowText.fromHubtypeCMS(hubtypeContent, this.locale, this.cmsApi);
18
- case hubtype_fields_1.HtNodeWithContentType.IMAGE:
19
- return content_fields_1.FlowImage.fromHubtypeCMS(hubtypeContent, this.locale);
20
- case hubtype_fields_1.HtNodeWithContentType.CAROUSEL:
21
- return content_fields_1.FlowCarousel.fromHubtypeCMS(hubtypeContent, this.locale, this.cmsApi);
22
- case hubtype_fields_1.HtNodeWithContentType.VIDEO:
23
- return content_fields_1.FlowVideo.fromHubtypeCMS(hubtypeContent, this.locale);
24
- case hubtype_fields_1.HtNodeWithContentType.WHATSAPP_BUTTON_LIST:
25
- return content_fields_1.FlowWhatsappButtonList.fromHubtypeCMS(hubtypeContent, this.locale, this.cmsApi);
26
- case hubtype_fields_1.HtNodeWithContentType.WHATSAPP_CTA_URL_BUTTON:
27
- return content_fields_1.FlowWhatsappCtaUrlButtonNode.fromHubtypeCMS(hubtypeContent, this.locale, this.cmsApi);
28
- case hubtype_fields_1.HtNodeWithContentType.HANDOFF:
29
- return content_fields_1.FlowHandoff.fromHubtypeCMS(hubtypeContent, this.locale, this.cmsApi);
30
- case hubtype_fields_1.HtNodeWithContentType.KNOWLEDGE_BASE:
31
- return content_fields_1.FlowKnowledgeBase.fromHubtypeCMS(hubtypeContent);
32
- case hubtype_fields_1.HtNodeWithContentType.AI_AGENT:
33
- return content_fields_1.FlowAiAgent.fromHubtypeCMS(hubtypeContent);
34
- case hubtype_fields_1.HtNodeWithContentType.RATING:
35
- return content_fields_1.FlowRating.fromHubtypeCMS(hubtypeContent, this.locale);
36
- case hubtype_fields_1.HtNodeWithContentType.BOT_ACTION:
37
- return content_fields_1.FlowBotAction.fromHubtypeCMS(hubtypeContent, this.cmsApi);
38
- case hubtype_fields_1.HtNodeWithContentType.FUNCTION:
39
- return this.resolveFlowFunctionContent(hubtypeContent);
40
- case hubtype_fields_1.HtNodeWithContentType.GO_TO_FLOW:
41
- return content_fields_1.FlowGoToFlow.fromHubtypeCMS(hubtypeContent, this.cmsApi);
42
- case hubtype_fields_1.HtNodeWithContentType.WHATSAPP_TEMPLATE:
43
- return content_fields_1.FlowWhatsappTemplate.fromHubtypeCMS(hubtypeContent);
44
- default:
45
- return undefined;
46
- }
47
- });
13
+ async getFlowContent(hubtypeContent) {
14
+ switch (hubtypeContent.type) {
15
+ case hubtype_fields_1.HtNodeWithContentType.TEXT:
16
+ return content_fields_1.FlowText.fromHubtypeCMS(hubtypeContent, this.locale, this.cmsApi);
17
+ case hubtype_fields_1.HtNodeWithContentType.IMAGE:
18
+ return content_fields_1.FlowImage.fromHubtypeCMS(hubtypeContent, this.locale);
19
+ case hubtype_fields_1.HtNodeWithContentType.CAROUSEL:
20
+ return content_fields_1.FlowCarousel.fromHubtypeCMS(hubtypeContent, this.locale, this.cmsApi);
21
+ case hubtype_fields_1.HtNodeWithContentType.VIDEO:
22
+ return content_fields_1.FlowVideo.fromHubtypeCMS(hubtypeContent, this.locale);
23
+ case hubtype_fields_1.HtNodeWithContentType.WHATSAPP_BUTTON_LIST:
24
+ return content_fields_1.FlowWhatsappButtonList.fromHubtypeCMS(hubtypeContent, this.locale, this.cmsApi);
25
+ case hubtype_fields_1.HtNodeWithContentType.WHATSAPP_CTA_URL_BUTTON:
26
+ return content_fields_1.FlowWhatsappCtaUrlButtonNode.fromHubtypeCMS(hubtypeContent, this.locale, this.cmsApi);
27
+ case hubtype_fields_1.HtNodeWithContentType.HANDOFF:
28
+ return content_fields_1.FlowHandoff.fromHubtypeCMS(hubtypeContent, this.locale, this.cmsApi);
29
+ case hubtype_fields_1.HtNodeWithContentType.KNOWLEDGE_BASE:
30
+ return content_fields_1.FlowKnowledgeBase.fromHubtypeCMS(hubtypeContent);
31
+ case hubtype_fields_1.HtNodeWithContentType.AI_AGENT:
32
+ return content_fields_1.FlowAiAgent.fromHubtypeCMS(hubtypeContent);
33
+ case hubtype_fields_1.HtNodeWithContentType.RATING:
34
+ return content_fields_1.FlowRating.fromHubtypeCMS(hubtypeContent, this.locale);
35
+ case hubtype_fields_1.HtNodeWithContentType.BOT_ACTION:
36
+ return content_fields_1.FlowBotAction.fromHubtypeCMS(hubtypeContent, this.cmsApi);
37
+ case hubtype_fields_1.HtNodeWithContentType.FUNCTION:
38
+ return this.resolveFlowFunctionContent(hubtypeContent);
39
+ case hubtype_fields_1.HtNodeWithContentType.GO_TO_FLOW:
40
+ return content_fields_1.FlowGoToFlow.fromHubtypeCMS(hubtypeContent, this.cmsApi);
41
+ case hubtype_fields_1.HtNodeWithContentType.WHATSAPP_TEMPLATE:
42
+ return content_fields_1.FlowWhatsappTemplate.fromHubtypeCMS(hubtypeContent);
43
+ case hubtype_fields_1.HtNodeWithContentType.CAPTURE_USER_INPUT:
44
+ return flow_capture_user_input_1.FlowCaptureUserInput.fromHubtypeCMS(hubtypeContent);
45
+ default:
46
+ return undefined;
47
+ }
48
48
  }
49
- resolveFlowFunctionContent(hubtypeContent) {
50
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
51
- switch (hubtypeContent.content.action) {
52
- case 'check-country':
53
- return content_fields_1.FlowCountryConditional.fromHubtypeCMS(hubtypeContent, this.currentRequest);
54
- case 'get-channel-type':
55
- return content_fields_1.FlowChannelConditional.fromHubtypeCMS(hubtypeContent, this.currentRequest);
56
- case 'check-queue-status':
57
- return content_fields_1.FlowQueueStatusConditional.fromHubtypeCMS(hubtypeContent, this.locale);
58
- case 'check-bot-variable':
59
- return content_fields_1.FlowCustomConditional.fromHubtypeCMS(hubtypeContent, this.currentRequest);
60
- default:
61
- return undefined;
62
- }
63
- });
49
+ async resolveFlowFunctionContent(hubtypeContent) {
50
+ switch (hubtypeContent.content.action) {
51
+ case 'check-country':
52
+ return content_fields_1.FlowCountryConditional.fromHubtypeCMS(hubtypeContent, this.currentRequest);
53
+ case 'get-channel-type':
54
+ return content_fields_1.FlowChannelConditional.fromHubtypeCMS(hubtypeContent, this.currentRequest);
55
+ case 'check-queue-status':
56
+ return content_fields_1.FlowQueueStatusConditional.fromHubtypeCMS(hubtypeContent, this.locale);
57
+ case 'check-bot-variable':
58
+ return content_fields_1.FlowCustomConditional.fromHubtypeCMS(hubtypeContent, this.currentRequest);
59
+ default:
60
+ return undefined;
61
+ }
64
62
  }
65
63
  }
66
64
  exports.FlowFactory = FlowFactory;
@@ -1 +1 @@
1
- {"version":3,"file":"flow-factory.js","sourceRoot":"","sources":["../../src/flow-factory.ts"],"names":[],"mappings":";;;;AAGA,qDAmByB;AACzB,oEAIwC;AAExC,MAAa,WAAW;IAKtB,YAAY,OAAsB,EAAE,MAAsB,EAAE,MAAc;QACxE,IAAI,CAAC,cAAc,GAAG,OAAO,CAAA;QAC7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAEK,cAAc,CAClB,cAA+B;;YAE/B,QAAQ,cAAc,CAAC,IAAI,EAAE;gBAC3B,KAAK,sCAAqB,CAAC,IAAI;oBAC7B,OAAO,yBAAQ,CAAC,cAAc,CAAC,cAAc,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;gBAC1E,KAAK,sCAAqB,CAAC,KAAK;oBAC9B,OAAO,0BAAS,CAAC,cAAc,CAAC,cAAc,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;gBAC9D,KAAK,sCAAqB,CAAC,QAAQ;oBACjC,OAAO,6BAAY,CAAC,cAAc,CAChC,cAAc,EACd,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,MAAM,CACZ,CAAA;gBACH,KAAK,sCAAqB,CAAC,KAAK;oBAC9B,OAAO,0BAAS,CAAC,cAAc,CAAC,cAAc,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;gBAC9D,KAAK,sCA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CAAC,iBAAiB;gBAC1C,OAAO,qCAAoB,CAAC,cAAc,CAAC,cAAc,CAAC,CAAA;YAE5D,KAAK,sCAAqB,CAAC,kBAAkB;gBAC3C,OAAO,8CAAoB,CAAC,cAAc,CAAC,cAAc,CAAC,CAAA;YAE5D;gBACE,OAAO,SAAS,CAAA;QACpB,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,0BAA0B,CACtC,cAA8B;QAE9B,QAAQ,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;YACtC,KAAK,eAAe;gBAClB,OAAO,uCAAsB,CAAC,cAAc,CAC1C,cAAc,EACd,IAAI,CAAC,cAAc,CACpB,CAAA;YACH,KAAK,kBAAkB;gBACrB,OAAO,uCAAsB,CAAC,cAAc,CAC1C,cAAc,EACd,IAAI,CAAC,cAAc,CACpB,CAAA;YACH,KAAK,oBAAoB;gBACvB,OAAO,2CAA0B,CAAC,cAAc,CAC9C,cAAc,EACd,IAAI,CAAC,MAAM,CACZ,CAAA;YACH,KAAK,oBAAoB;gBACvB,OAAO,sCAAqB,CAAC,cAAc,CACzC,cAAc,EACd,IAAI,CAAC,cAAc,CACpB,CAAA;YACH;gBACE,OAAO,SAAS,CAAA;QACpB,CAAC;IACH,CAAC;CACF;AAvGD,kCAuGC"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getArgumentsByLocale = exports.CustomFunction = exports.DEFAULT_FUNCTION_NAMES = void 0;
4
- const tslib_1 = require("tslib");
3
+ exports.CustomFunction = exports.DEFAULT_FUNCTION_NAMES = void 0;
4
+ exports.getArgumentsByLocale = getArgumentsByLocale;
5
5
  exports.DEFAULT_FUNCTION_NAMES = [
6
6
  'check-queue-status',
7
7
  'get-channel-type',
@@ -14,25 +14,23 @@ class CustomFunction {
14
14
  this.currentRequest = currentRequest;
15
15
  this.locale = locale;
16
16
  }
17
- call(functionNode) {
18
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
19
- const functionNodeId = functionNode.id;
20
- const functionArguments = getArgumentsByLocale(functionNode.content.arguments, this.locale);
21
- const nameValues = functionArguments.map(arg => {
22
- return { [arg.name]: arg.value };
23
- });
24
- const args = Object.assign({
25
- request: this.currentRequest,
26
- results: functionNode.content.result_mapping.map(r => r.result),
27
- }, ...nameValues);
28
- const functionResult = yield this.functions[functionNode.content.action](args);
29
- // TODO define result_mapping per locale??
30
- const result = functionNode.content.result_mapping.find(r => r.result === functionResult);
31
- if (!(result === null || result === void 0 ? void 0 : result.target)) {
32
- throw new Error(`No result found for result_mapping for node with id: ${functionNodeId}`);
33
- }
34
- return result.target.id;
17
+ async call(functionNode) {
18
+ const functionNodeId = functionNode.id;
19
+ const functionArguments = getArgumentsByLocale(functionNode.content.arguments, this.locale);
20
+ const nameValues = functionArguments.map(arg => {
21
+ return { [arg.name]: arg.value };
35
22
  });
23
+ const args = Object.assign({
24
+ request: this.currentRequest,
25
+ results: functionNode.content.result_mapping.map(r => r.result),
26
+ }, ...nameValues);
27
+ const functionResult = await this.functions[functionNode.content.action](args);
28
+ // TODO define result_mapping per locale??
29
+ const result = functionNode.content.result_mapping.find(r => r.result === functionResult);
30
+ if (!result?.target) {
31
+ throw new Error(`No result found for result_mapping for node with id: ${functionNodeId}`);
32
+ }
33
+ return result.target.id;
36
34
  }
37
35
  }
38
36
  exports.CustomFunction = CustomFunction;
@@ -48,5 +46,4 @@ function getArgumentsByLocale(args, locale) {
48
46
  }
49
47
  return resultArguments;
50
48
  }
51
- exports.getArgumentsByLocale = getArgumentsByLocale;
52
49
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/functions/index.ts"],"names":[],"mappings":";;;;AAQa,QAAA,sBAAsB,GAAG;IACpC,oBAAoB;IACpB,kBAAkB;IAClB,eAAe;IACf,oBAAoB;CACrB,CAAA;AAED,MAAa,cAAc;IAKzB,YACE,SAA2B,EAC3B,cAA6B,EAC7B,MAA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 exports.getFlowBuilderPlugin = getFlowBuilderPlugin;
4
4
  const FLOW_BUILDER_PLUGIN_NAME = 'BotonicPluginFlowBuilder';
5
5
  function getFlowBuilderPlugin(plugins) {
6
6
  const ERROR_MESSAGE = `You must include '@botonic/plugin-flow-builder' in your plugins file.`;
@@ -13,5 +13,4 @@ function getFlowBuilderPlugin(plugins) {
13
13
  }
14
14
  return flowBuilderPlugin;
15
15
  }
16
- exports.getFlowBuilderPlugin = getFlowBuilderPlugin;
17
16
  //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":";;;AAIA,MAAM,wBAAwB,GAAG,0BAA0B,CAAA;AAE3D,SAAgB,oBAAoB,CAClC,OAAwB;IAExB,MAAM,aAAa,GAAG,uEAAuE,CAAA;IAE7F,IAAI,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;QACvC,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAA;KAC/B;IAED,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CACnD,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,KAAK,wBAAwB,CACxB,CAAA;IAExC,IAAI,CAAC,iBAAiB,EAAE;QACtB,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAA;KAC/B;IAED,OAAO,iBAAiB,CAAA;AAC1B,CAAC;AAlBD,oDAkBC"}
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":";;AAMA,oDAkBC;AApBD,MAAM,wBAAwB,GAAG,0BAA0B,CAAA;AAE3D,SAAgB,oBAAoB,CAClC,OAAwB;IAExB,MAAM,aAAa,GAAG,uEAAuE,CAAA;IAE7F,IAAI,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAA;IAChC,CAAC;IAED,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CACnD,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,KAAK,wBAAwB,CACxB,CAAA;IAExC,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAA;IAChC,CAAC;IAED,OAAO,iBAAiB,CAAA;AAC1B,CAAC"}
package/lib/cjs/index.js CHANGED
@@ -15,7 +15,6 @@ const utils_1 = require("./utils");
15
15
  // TODO: Create a proper service to wrap all calls and allow api versioning
16
16
  class BotonicPluginFlowBuilder {
17
17
  constructor(options) {
18
- var _a, _b, _c;
19
18
  this.apiUrl = options.apiUrl || constants_1.FLOW_BUILDER_API_URL_PROD;
20
19
  this.jsonVersion = options.jsonVersion || types_1.FlowBuilderJSONVersion.LATEST;
21
20
  this.flow = options.flow;
@@ -23,13 +22,16 @@ class BotonicPluginFlowBuilder {
23
22
  this.trackEvent = options.trackEvent;
24
23
  this.getKnowledgeBaseResponse = options.getKnowledgeBaseResponse;
25
24
  this.getAiAgentResponse = options.getAiAgentResponse;
26
- this.smartIntentsConfig = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.smartIntentsConfig), { useLatest: this.jsonVersion === types_1.FlowBuilderJSONVersion.LATEST });
25
+ this.smartIntentsConfig = {
26
+ ...options?.smartIntentsConfig,
27
+ useLatest: this.jsonVersion === types_1.FlowBuilderJSONVersion.LATEST,
28
+ };
27
29
  const customFunctions = options.customFunctions || {};
28
30
  this.functions = customFunctions;
29
31
  this.inShadowing = {
30
- allowKeywords: ((_a = options.inShadowing) === null || _a === void 0 ? void 0 : _a.allowKeywords) || false,
31
- allowSmartIntents: ((_b = options.inShadowing) === null || _b === void 0 ? void 0 : _b.allowSmartIntents) || false,
32
- allowKnowledgeBases: ((_c = options.inShadowing) === null || _c === void 0 ? void 0 : _c.allowKnowledgeBases) || false,
32
+ allowKeywords: options.inShadowing?.allowKeywords || false,
33
+ allowSmartIntents: options.inShadowing?.allowSmartIntents || false,
34
+ allowKnowledgeBases: options.inShadowing?.allowKnowledgeBases || false,
33
35
  };
34
36
  this.contentFilters = options.contentFilters || [];
35
37
  this.customRatingMessageEnabled =
@@ -41,32 +43,29 @@ class BotonicPluginFlowBuilder {
41
43
  }
42
44
  return `${this.apiUrl}/v1/bot_flows/{bot_id}/versions/${this.jsonVersion}/`;
43
45
  }
44
- pre(request) {
45
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
46
- // When AI Agent is executed in Whatsapp, button payloads come as referral and must be converted to text being processed by the agent.
47
- this.convertWhatsappAiAgentEmptyPayloads(request);
48
- this.currentRequest = request;
49
- this.cmsApi = yield api_1.FlowBuilderApi.create({
50
- flowUrl: this.resolveFlowUrl(request),
51
- url: this.apiUrl,
52
- flow: this.flow,
53
- accessToken: this.getAccessToken(request.session),
54
- request: this.currentRequest,
55
- });
56
- const checkUserTextInput = (0, utils_1.inputHasTextData)(request.input) && !request.input.payload;
57
- if (checkUserTextInput) {
58
- const resolvedLocale = this.cmsApi.getResolvedLocale();
59
- const nodeByUserInput = yield (0, user_input_1.getNodeByUserInput)(this.cmsApi, resolvedLocale, request, this.smartIntentsConfig);
60
- request.input.payload = this.cmsApi.getPayload(nodeByUserInput === null || nodeByUserInput === void 0 ? void 0 : nodeByUserInput.target);
61
- }
62
- this.updateRequestBeforeRoutes(request);
46
+ async pre(request) {
47
+ // When AI Agent is executed in Whatsapp, button payloads come as referral and must be converted to text being processed by the agent.
48
+ this.convertWhatsappAiAgentEmptyPayloads(request);
49
+ this.currentRequest = request;
50
+ this.cmsApi = await api_1.FlowBuilderApi.create({
51
+ flowUrl: this.resolveFlowUrl(request),
52
+ url: this.apiUrl,
53
+ flow: this.flow,
54
+ accessToken: this.getAccessToken(request.session),
55
+ request: this.currentRequest,
63
56
  });
57
+ const checkUserTextInput = (0, utils_1.inputHasTextData)(request.input) && !request.input.payload;
58
+ if (checkUserTextInput) {
59
+ const resolvedLocale = this.cmsApi.getResolvedLocale();
60
+ const nextPayload = await (0, user_input_1.getNextPayloadByUserInput)(this.cmsApi, resolvedLocale, request, this.smartIntentsConfig);
61
+ request.input.payload = nextPayload;
62
+ }
63
+ this.updateRequestBeforeRoutes(request);
64
64
  }
65
65
  convertWhatsappAiAgentEmptyPayloads(request) {
66
- var _a;
67
66
  if (request.session.user.provider === core_1.PROVIDER.WHATSAPP) {
68
67
  const shouldUseReferral = request.input.referral &&
69
- ((_a = request.input.payload) === null || _a === void 0 ? void 0 : _a.startsWith(constants_1.EMPTY_PAYLOAD));
68
+ request.input.payload?.startsWith(constants_1.EMPTY_PAYLOAD);
70
69
  if (shouldUseReferral) {
71
70
  request.input.type = core_1.INPUT.TEXT;
72
71
  request.input.data = request.input.referral;
@@ -74,6 +73,7 @@ class BotonicPluginFlowBuilder {
74
73
  }
75
74
  }
76
75
  updateRequestBeforeRoutes(request) {
76
+ this.cmsApi.removeCaptureUserInputId();
77
77
  if (request.input.payload) {
78
78
  request.input.payload = this.removeSourceSuffix(request.input.payload);
79
79
  if (this.cmsApi.isBotAction(request.input.payload)) {
@@ -89,58 +89,50 @@ class BotonicPluginFlowBuilder {
89
89
  post(request) {
90
90
  request.input.nluResolution = undefined;
91
91
  }
92
- getContentsByContentID(contentID, prevContents) {
93
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
94
- const node = this.cmsApi.getNodeByContentID(contentID);
95
- return yield this.getContentsByNode(node, prevContents);
96
- });
92
+ async getContentsByContentID(contentID, prevContents) {
93
+ const node = this.cmsApi.getNodeByContentID(contentID);
94
+ return await this.getContentsByNode(node, prevContents);
97
95
  }
98
96
  getUUIDByContentID(contentID) {
99
97
  const node = this.cmsApi.getNodeByContentID(contentID);
100
98
  return node.id;
101
99
  }
102
- getContentsById(id, prevContents) {
103
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
104
- const node = this.cmsApi.getNodeById(id);
105
- return yield this.getContentsByNode(node, prevContents);
106
- });
100
+ async getContentsById(id, prevContents) {
101
+ const node = this.cmsApi.getNodeById(id);
102
+ return await this.getContentsByNode(node, prevContents);
107
103
  }
108
- getStartContents() {
109
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
110
- const startNode = this.cmsApi.getStartNode();
111
- this.currentRequest.session.flow_thread_id = (0, uuid_1.v7)();
112
- return yield this.getContentsByNode(startNode);
113
- });
104
+ async getStartContents() {
105
+ const startNode = this.cmsApi.getStartNode();
106
+ this.currentRequest.session.flow_thread_id = (0, uuid_1.v7)();
107
+ return await this.getContentsByNode(startNode);
114
108
  }
115
- getContentsByNode(node, prevContents) {
116
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
117
- const contents = prevContents || [];
118
- const resolvedLocale = this.cmsApi.getResolvedLocale();
119
- if (node.type === hubtype_fields_1.HtNodeWithContentType.FUNCTION &&
120
- !functions_1.DEFAULT_FUNCTION_NAMES.includes(node.content.action)) {
121
- const customFunctionResolver = new functions_1.CustomFunction(this.functions, this.currentRequest, resolvedLocale);
122
- const targetId = yield customFunctionResolver.call(node);
123
- return this.getContentsById(targetId, contents);
124
- }
125
- const flowFactory = new flow_factory_1.FlowFactory(this.currentRequest, this.cmsApi, resolvedLocale);
126
- const content = yield flowFactory.getFlowContent(node);
127
- if (content) {
128
- contents.push(content);
129
- }
130
- // If node is BOT_ACTION not add more contents to render, next nodes render after execute action
131
- if (node.type === hubtype_fields_1.HtNodeWithContentType.BOT_ACTION) {
132
- return contents;
133
- }
134
- // TODO: prevent infinite recursive calls
135
- if (content && content.followUp) {
136
- return this.getContentsById(content.followUp.id, contents);
137
- }
138
- else if (node.follow_up) {
139
- console.log('FOLLOWUP FROM NODE-------> OLD SYSTEM');
140
- return this.getContentsById(node.follow_up.id, contents);
141
- }
109
+ async getContentsByNode(node, prevContents) {
110
+ const contents = prevContents || [];
111
+ const resolvedLocale = this.cmsApi.getResolvedLocale();
112
+ if (node.type === hubtype_fields_1.HtNodeWithContentType.FUNCTION &&
113
+ !functions_1.DEFAULT_FUNCTION_NAMES.includes(node.content.action)) {
114
+ const customFunctionResolver = new functions_1.CustomFunction(this.functions, this.currentRequest, resolvedLocale);
115
+ const targetId = await customFunctionResolver.call(node);
116
+ return this.getContentsById(targetId, contents);
117
+ }
118
+ const flowFactory = new flow_factory_1.FlowFactory(this.currentRequest, this.cmsApi, resolvedLocale);
119
+ const content = await flowFactory.getFlowContent(node);
120
+ if (content) {
121
+ contents.push(content);
122
+ }
123
+ // If node is BOT_ACTION not add more contents to render, next nodes render after execute action
124
+ if (node.type === hubtype_fields_1.HtNodeWithContentType.BOT_ACTION) {
142
125
  return contents;
143
- });
126
+ }
127
+ // TODO: prevent infinite recursive calls
128
+ if (content && content.followUp) {
129
+ return this.getContentsById(content.followUp.id, contents);
130
+ }
131
+ else if (node.follow_up) {
132
+ console.log('FOLLOWUP FROM NODE-------> OLD SYSTEM');
133
+ return this.getContentsById(node.follow_up.id, contents);
134
+ }
135
+ return contents;
144
136
  }
145
137
  getPayloadParams(payload) {
146
138
  const payloadParams = JSON.parse(payload.split(constants_1.SEPARATOR)[1] || '{}');
@@ -150,13 +142,16 @@ class BotonicPluginFlowBuilder {
150
142
  return this.cmsApi.getFlowName(flowId);
151
143
  }
152
144
  getRatingSubmittedInfo(payload) {
153
- const buttonId = payload === null || payload === void 0 ? void 0 : payload.split(constants_1.SEPARATOR)[1];
145
+ const buttonId = payload?.split(constants_1.SEPARATOR)[1];
154
146
  const ratingNode = this.cmsApi.getRatingNodeByButtonId(buttonId);
155
147
  const ratingButton = this.cmsApi.getRatingButtonById(ratingNode, buttonId);
156
148
  const possibleOptions = ratingNode.content.buttons.map(button => button.text);
157
149
  const possibleValues = ratingNode.content.buttons.map(button => button.value);
158
- return Object.assign(Object.assign({}, ratingButton), { possibleOptions,
159
- possibleValues });
150
+ return {
151
+ ...ratingButton,
152
+ possibleOptions,
153
+ possibleValues,
154
+ };
160
155
  }
161
156
  }
162
157
  exports.default = BotonicPluginFlowBuilder;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,wCAOsB;AAEtB,+BAAmC;AAEnC,+BAAsC;AACtC,2CAKoB;AAEpB,oEAKwC;AACxC,iDAA4C;AAC5C,2CAAoE;AACpE,mCAUgB;AAChB,6CAAiD;AAEjD,mCAAiE;AAEjE,2EAA2E;AAE3E,MAAqB,wBAAwB;IAkB3C,YAAY,OAA8D;;QACxE,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,qCAAyB,CAAA;QACzD,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,8BAAsB,CAAC,MAAM,CAAA;QACvE,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAA;QACxB,IAAI,CAAC,cAAc,GAAG,IAAA,6BAAqB,EAAC,OAAO,CAAC,cAAc,CAAC,CAAA;QACnE,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAA;QACpC,IAAI,CAAC,wBAAwB,GAAG,OAAO,CAAC,wBAAwB,CAAA;QAChE,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAA;QACpD,IAAI,CAAC,kBAAkB,mCAClB,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,kBAAkB,KAC9B,SAAS,EAAE,IAAI,CAAC,WAAW,KAAK,8BAAsB,CAAC,MAAM,GAC9D,CAAA;QACD,MAAM,eAAe,GAAG,OAAO,CAAC,eAAe,IAAI,EAAE,CAAA;QACrD,IAAI,CAAC,SAAS,GAAG,eAAe,CAAA;QAChC,IAAI,CAAC,WAAW,GAAG;YACjB,aAAa,EAAE,CAAA,MAAA,OAAO,CAAC,WAAW,0CAAE,aAAa,KAAI,KAAK;YAC1D,iBAAiB,EAAE,CAAA,MAAA,OAAO,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G,OAAO,EAAE,KAAK,CAAC,qBAAS,CAAC,CAAC,CAAC,CAAC,CAAA;QAC7C,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,uBAAuB,CAAC,QAAQ,CAAC,CAAA;QAEhE,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAA;QAC1E,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CACpD,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CACtB,CAAA;QACD,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CACnD,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CACvB,CAAA;QAED,OAAO;YACL,GAAG,YAAY;YACf,eAAe;YACf,cAAc;SACf,CAAA;IACH,CAAC;CACF;AAxND,2CAwNC;AAED,mDAAwB;AACxB,yCAAkD;AAAzC,iHAAA,oBAAoB,OAAA;AAC7B,2DAAgC;AAEhC,uCAA6C;AAApC,4GAAA,gBAAgB,OAAA;AACzB,iCAMgB;AAHd,+GAAA,sBAAsB,OAAA;AAIxB,oDAAyB"}
@@ -9,19 +9,17 @@ class HubtypeQueuesApi {
9
9
  this.queueId = queueId;
10
10
  this.checkAvailableAgents = checkAvailableAgents || false;
11
11
  }
12
- getAvailability() {
13
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
14
- const response = yield axios_1.default.get(`${HUBTYPE_API_URL}/external/v1/queues/${this.queueId}/availability/`,
15
- // TODO: Make it configurable in the future
16
- {
17
- params: {
18
- check_queue_schedule: true,
19
- check_waiting_cases: false,
20
- check_available_agents: this.checkAvailableAgents,
21
- },
22
- });
23
- return response.data;
12
+ async getAvailability() {
13
+ const response = await axios_1.default.get(`${HUBTYPE_API_URL}/external/v1/queues/${this.queueId}/availability/`,
14
+ // TODO: Make it configurable in the future
15
+ {
16
+ params: {
17
+ check_queue_schedule: true,
18
+ check_waiting_cases: false,
19
+ check_available_agents: this.checkAvailableAgents,
20
+ },
24
21
  });
22
+ return response.data;
25
23
  }
26
24
  }
27
25
  exports.HubtypeQueuesApi = HubtypeQueuesApi;
@@ -1 +1 @@
1
- {"version":3,"file":"hubtype-queues-api.js","sourceRoot":"","sources":["../../../src/services/hubtype-queues-api.ts"],"names":[],"mappings":";;;;AAAA,0DAAyB;AAEzB,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,yBAAyB,CAAA;AAUhF,MAAa,gBAAgB;IAI3B,YAAY,OAAe,EAAE,oBAA8B;QACzD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,oBAAoB,GAAG,oBAAoB,IAAI,KAAK,CAAA;IAC3D,CAAC;IAEK,eAAe;;YACnB,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,GAAG,CAC9B,GAAG,eAAe,uBAAuB,IAAI,CAAC,OAAO,gBAAgB;YACrE,2CAA2C;YAC3C;gBACE,MAAM,EAAE;oBACN,oBAAoB,EAAE,IAAI;oBAC1B,mBAAmB,EAAE,KAAK;oBAC1B,sBAAsB,EAAE,IAAI,CAAC,oBAAoB;iBAClD;aACF,CACF,CAAA;YACD,OAAO,QAAQ,CAAC,IAAI,CAAA;QACtB,CAAC;KAAA;CACF;AAvBD,4CAuBC"}
1
+ {"version":3,"file":"hubtype-queues-api.js","sourceRoot":"","sources":["../../../src/services/hubtype-queues-api.ts"],"names":[],"mappings":";;;;AAAA,0DAAyB;AAEzB,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,yBAAyB,CAAA;AAUhF,MAAa,gBAAgB;IAI3B,YAAY,OAAe,EAAE,oBAA8B;QACzD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,oBAAoB,GAAG,oBAAoB,IAAI,KAAK,CAAA;IAC3D,CAAC;IAED,KAAK,CAAC,eAAe;QACnB,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,GAAG,CAC9B,GAAG,eAAe,uBAAuB,IAAI,CAAC,OAAO,gBAAgB;QACrE,2CAA2C;QAC3C;YACE,MAAM,EAAE;gBACN,oBAAoB,EAAE,IAAI;gBAC1B,mBAAmB,EAAE,KAAK;gBAC1B,sBAAsB,EAAE,IAAI,CAAC,oBAAoB;aAClD;SACF,CACF,CAAA;QACD,OAAO,QAAQ,CAAC,IAAI,CAAA;IACtB,CAAC;CACF;AAvBD,4CAuBC"}
@@ -12,5 +12,5 @@ type CommonFlowContentEventArgs = {
12
12
  flowNodeId: string;
13
13
  flowNodeContentId: string;
14
14
  };
15
- export declare function getCommonFlowContentEventArgsForContentId(request: ActionRequest, contentId: string): CommonFlowContentEventArgs;
15
+ export declare function getCommonFlowContentEventArgsForContentId(request: ActionRequest, id: string): CommonFlowContentEventArgs;
16
16
  export {};