@botonic/plugin-flow-builder 0.56.0-alpha.0 → 0.57.0-rslib-esm.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 (564) hide show
  1. package/lib/esm/action/ai-agent-from-user-input.d.ts +2 -2
  2. package/lib/esm/action/ai-agent-from-user-input.js +9 -6
  3. package/lib/esm/action/ai-agent-from-user-input.js.map +1 -1
  4. package/lib/esm/action/context.d.ts +2 -2
  5. package/lib/esm/action/context.js +9 -6
  6. package/lib/esm/action/context.js.map +1 -1
  7. package/lib/esm/action/fallback.d.ts +2 -2
  8. package/lib/esm/action/fallback.js +16 -11
  9. package/lib/esm/action/fallback.js.map +1 -1
  10. package/lib/esm/action/first-interaction.d.ts +2 -2
  11. package/lib/esm/action/first-interaction.js +39 -27
  12. package/lib/esm/action/first-interaction.js.map +1 -1
  13. package/lib/esm/action/get-contents.d.ts +1 -1
  14. package/lib/esm/action/get-contents.js +37 -20
  15. package/lib/esm/action/get-contents.js.map +1 -1
  16. package/lib/esm/action/index.d.ts +1 -1
  17. package/lib/esm/action/index.js +68 -32
  18. package/lib/esm/action/index.js.map +1 -1
  19. package/lib/esm/action/payload.d.ts +2 -2
  20. package/lib/esm/action/payload.js +27 -23
  21. package/lib/esm/action/payload.js.map +1 -1
  22. package/lib/esm/api.d.ts +2 -2
  23. package/lib/esm/api.js +55 -44
  24. package/lib/esm/api.js.map +1 -1
  25. package/lib/esm/constants.js +16 -18
  26. package/lib/esm/constants.js.map +1 -1
  27. package/lib/esm/content-fields/content-fields-base.d.ts +2 -2
  28. package/lib/esm/content-fields/content-fields-base.js +33 -29
  29. package/lib/esm/content-fields/content-fields-base.js.map +1 -1
  30. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.d.ts +1 -1
  31. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +35 -33
  32. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +1 -1
  33. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.d.ts +1 -1
  34. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.js +15 -15
  35. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +1 -1
  36. package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.d.ts +2 -2
  37. package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.js +50 -35
  38. package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.js.map +1 -1
  39. package/lib/esm/content-fields/flow-ai-agent-base.d.ts +4 -4
  40. package/lib/esm/content-fields/flow-ai-agent-base.js +50 -47
  41. package/lib/esm/content-fields/flow-ai-agent-base.js.map +1 -1
  42. package/lib/esm/content-fields/flow-ai-agent-router.d.ts +5 -5
  43. package/lib/esm/content-fields/flow-ai-agent-router.js +57 -46
  44. package/lib/esm/content-fields/flow-ai-agent-router.js.map +1 -1
  45. package/lib/esm/content-fields/flow-ai-agent.d.ts +4 -4
  46. package/lib/esm/content-fields/flow-ai-agent.js +33 -22
  47. package/lib/esm/content-fields/flow-ai-agent.js.map +1 -1
  48. package/lib/esm/content-fields/flow-bot-action.d.ts +3 -3
  49. package/lib/esm/content-fields/flow-bot-action.js +23 -15
  50. package/lib/esm/content-fields/flow-bot-action.js.map +1 -1
  51. package/lib/esm/content-fields/flow-button.d.ts +5 -5
  52. package/lib/esm/content-fields/flow-button.js +48 -29
  53. package/lib/esm/content-fields/flow-button.js.map +1 -1
  54. package/lib/esm/content-fields/flow-capture-user-input.d.ts +2 -2
  55. package/lib/esm/content-fields/flow-capture-user-input.js +24 -23
  56. package/lib/esm/content-fields/flow-capture-user-input.js.map +1 -1
  57. package/lib/esm/content-fields/flow-carousel.d.ts +4 -4
  58. package/lib/esm/content-fields/flow-carousel.js +99 -58
  59. package/lib/esm/content-fields/flow-carousel.js.map +1 -1
  60. package/lib/esm/content-fields/flow-channel-conditional.d.ts +3 -3
  61. package/lib/esm/content-fields/flow-channel-conditional.js +26 -22
  62. package/lib/esm/content-fields/flow-channel-conditional.js.map +1 -1
  63. package/lib/esm/content-fields/flow-country-conditional.d.ts +3 -3
  64. package/lib/esm/content-fields/flow-country-conditional.js +26 -21
  65. package/lib/esm/content-fields/flow-country-conditional.js.map +1 -1
  66. package/lib/esm/content-fields/flow-custom-conditional.d.ts +3 -3
  67. package/lib/esm/content-fields/flow-custom-conditional.js +31 -33
  68. package/lib/esm/content-fields/flow-custom-conditional.js.map +1 -1
  69. package/lib/esm/content-fields/flow-element.d.ts +4 -4
  70. package/lib/esm/content-fields/flow-element.js +37 -20
  71. package/lib/esm/content-fields/flow-element.js.map +1 -1
  72. package/lib/esm/content-fields/flow-go-to-flow.d.ts +3 -3
  73. package/lib/esm/content-fields/flow-go-to-flow.js +25 -20
  74. package/lib/esm/content-fields/flow-go-to-flow.js.map +1 -1
  75. package/lib/esm/content-fields/flow-handoff.d.ts +3 -3
  76. package/lib/esm/content-fields/flow-handoff.js +30 -19
  77. package/lib/esm/content-fields/flow-handoff.js.map +1 -1
  78. package/lib/esm/content-fields/flow-image.d.ts +2 -2
  79. package/lib/esm/content-fields/flow-image.js +24 -15
  80. package/lib/esm/content-fields/flow-image.js.map +1 -1
  81. package/lib/esm/content-fields/flow-queue-status-conditional.d.ts +3 -3
  82. package/lib/esm/content-fields/flow-queue-status-conditional.js +45 -40
  83. package/lib/esm/content-fields/flow-queue-status-conditional.js.map +1 -1
  84. package/lib/esm/content-fields/flow-rating.d.ts +3 -3
  85. package/lib/esm/content-fields/flow-rating.js +62 -40
  86. package/lib/esm/content-fields/flow-rating.js.map +1 -1
  87. package/lib/esm/content-fields/flow-text.d.ts +4 -4
  88. package/lib/esm/content-fields/flow-text.js +51 -29
  89. package/lib/esm/content-fields/flow-text.js.map +1 -1
  90. package/lib/esm/content-fields/flow-video.d.ts +2 -2
  91. package/lib/esm/content-fields/flow-video.js +24 -15
  92. package/lib/esm/content-fields/flow-video.js.map +1 -1
  93. package/lib/esm/content-fields/flow-webview.d.ts +2 -2
  94. package/lib/esm/content-fields/flow-webview.js +31 -28
  95. package/lib/esm/content-fields/flow-webview.js.map +1 -1
  96. package/lib/esm/content-fields/flow-whatsapp-cta-url-button.d.ts +3 -3
  97. package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js +91 -52
  98. package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js.map +1 -1
  99. package/lib/esm/content-fields/flow-whatsapp-request-contact-info.d.ts +3 -4
  100. package/lib/esm/content-fields/flow-whatsapp-request-contact-info.js +32 -26
  101. package/lib/esm/content-fields/flow-whatsapp-request-contact-info.js.map +1 -1
  102. package/lib/esm/content-fields/flow-whatsapp-template.d.ts +2 -2
  103. package/lib/esm/content-fields/flow-whatsapp-template.js +119 -102
  104. package/lib/esm/content-fields/flow-whatsapp-template.js.map +1 -1
  105. package/lib/esm/content-fields/hubtype-fields/ai-agent-router.d.ts +3 -3
  106. package/lib/esm/content-fields/hubtype-fields/ai-agent-router.js +3 -2
  107. package/lib/esm/content-fields/hubtype-fields/ai-agent-router.js.map +1 -1
  108. package/lib/esm/content-fields/hubtype-fields/ai-agent.d.ts +2 -2
  109. package/lib/esm/content-fields/hubtype-fields/ai-agent.js +3 -2
  110. package/lib/esm/content-fields/hubtype-fields/ai-agent.js.map +1 -1
  111. package/lib/esm/content-fields/hubtype-fields/bot-action.d.ts +2 -2
  112. package/lib/esm/content-fields/hubtype-fields/bot-action.js +3 -2
  113. package/lib/esm/content-fields/hubtype-fields/bot-action.js.map +1 -1
  114. package/lib/esm/content-fields/hubtype-fields/button.d.ts +1 -1
  115. package/lib/esm/content-fields/hubtype-fields/button.js +3 -2
  116. package/lib/esm/content-fields/hubtype-fields/button.js.map +1 -1
  117. package/lib/esm/content-fields/hubtype-fields/capture-user-input.d.ts +2 -2
  118. package/lib/esm/content-fields/hubtype-fields/capture-user-input.js +6 -6
  119. package/lib/esm/content-fields/hubtype-fields/capture-user-input.js.map +1 -1
  120. package/lib/esm/content-fields/hubtype-fields/carousel.d.ts +3 -3
  121. package/lib/esm/content-fields/hubtype-fields/carousel.js +3 -2
  122. package/lib/esm/content-fields/hubtype-fields/carousel.js.map +1 -1
  123. package/lib/esm/content-fields/hubtype-fields/channel-conditional.d.ts +3 -3
  124. package/lib/esm/content-fields/hubtype-fields/channel-conditional.js +3 -2
  125. package/lib/esm/content-fields/hubtype-fields/channel-conditional.js.map +1 -1
  126. package/lib/esm/content-fields/hubtype-fields/common.d.ts +2 -2
  127. package/lib/esm/content-fields/hubtype-fields/common.js +3 -2
  128. package/lib/esm/content-fields/hubtype-fields/common.js.map +1 -1
  129. package/lib/esm/content-fields/hubtype-fields/country-conditional.d.ts +3 -3
  130. package/lib/esm/content-fields/hubtype-fields/country-conditional.js +3 -2
  131. package/lib/esm/content-fields/hubtype-fields/country-conditional.js.map +1 -1
  132. package/lib/esm/content-fields/hubtype-fields/custom-conditional-v2.d.ts +2 -2
  133. package/lib/esm/content-fields/hubtype-fields/custom-conditional-v2.js +15 -15
  134. package/lib/esm/content-fields/hubtype-fields/custom-conditional-v2.js.map +1 -1
  135. package/lib/esm/content-fields/hubtype-fields/custom-conditional.d.ts +3 -3
  136. package/lib/esm/content-fields/hubtype-fields/custom-conditional.js +3 -2
  137. package/lib/esm/content-fields/hubtype-fields/custom-conditional.js.map +1 -1
  138. package/lib/esm/content-fields/hubtype-fields/fallback.d.ts +2 -2
  139. package/lib/esm/content-fields/hubtype-fields/fallback.js +3 -2
  140. package/lib/esm/content-fields/hubtype-fields/fallback.js.map +1 -1
  141. package/lib/esm/content-fields/hubtype-fields/function.d.ts +2 -2
  142. package/lib/esm/content-fields/hubtype-fields/function.js +6 -6
  143. package/lib/esm/content-fields/hubtype-fields/function.js.map +1 -1
  144. package/lib/esm/content-fields/hubtype-fields/go-to-flow.d.ts +2 -2
  145. package/lib/esm/content-fields/hubtype-fields/go-to-flow.js +3 -2
  146. package/lib/esm/content-fields/hubtype-fields/go-to-flow.js.map +1 -1
  147. package/lib/esm/content-fields/hubtype-fields/handoff.d.ts +2 -2
  148. package/lib/esm/content-fields/hubtype-fields/handoff.js +3 -2
  149. package/lib/esm/content-fields/hubtype-fields/handoff.js.map +1 -1
  150. package/lib/esm/content-fields/hubtype-fields/image.d.ts +2 -2
  151. package/lib/esm/content-fields/hubtype-fields/image.js +3 -2
  152. package/lib/esm/content-fields/hubtype-fields/image.js.map +1 -1
  153. package/lib/esm/content-fields/hubtype-fields/index.d.ts +27 -27
  154. package/lib/esm/content-fields/hubtype-fields/index.js +56 -30
  155. package/lib/esm/content-fields/hubtype-fields/index.js.map +1 -1
  156. package/lib/esm/content-fields/hubtype-fields/keyword.d.ts +2 -2
  157. package/lib/esm/content-fields/hubtype-fields/keyword.js +3 -2
  158. package/lib/esm/content-fields/hubtype-fields/keyword.js.map +1 -1
  159. package/lib/esm/content-fields/hubtype-fields/node-types.js +12 -12
  160. package/lib/esm/content-fields/hubtype-fields/node-types.js.map +1 -1
  161. package/lib/esm/content-fields/hubtype-fields/nodes.d.ts +23 -23
  162. package/lib/esm/content-fields/hubtype-fields/nodes.js +3 -2
  163. package/lib/esm/content-fields/hubtype-fields/nodes.js.map +1 -1
  164. package/lib/esm/content-fields/hubtype-fields/payload.d.ts +1 -1
  165. package/lib/esm/content-fields/hubtype-fields/payload.js +3 -2
  166. package/lib/esm/content-fields/hubtype-fields/payload.js.map +1 -1
  167. package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.d.ts +3 -3
  168. package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.js +3 -2
  169. package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.js.map +1 -1
  170. package/lib/esm/content-fields/hubtype-fields/rating.d.ts +2 -2
  171. package/lib/esm/content-fields/hubtype-fields/rating.js +6 -6
  172. package/lib/esm/content-fields/hubtype-fields/rating.js.map +1 -1
  173. package/lib/esm/content-fields/hubtype-fields/smart-intent.d.ts +2 -2
  174. package/lib/esm/content-fields/hubtype-fields/smart-intent.js +3 -2
  175. package/lib/esm/content-fields/hubtype-fields/smart-intent.js.map +1 -1
  176. package/lib/esm/content-fields/hubtype-fields/text.d.ts +3 -3
  177. package/lib/esm/content-fields/hubtype-fields/text.js +3 -2
  178. package/lib/esm/content-fields/hubtype-fields/text.js.map +1 -1
  179. package/lib/esm/content-fields/hubtype-fields/url.d.ts +1 -1
  180. package/lib/esm/content-fields/hubtype-fields/url.js +3 -2
  181. package/lib/esm/content-fields/hubtype-fields/url.js.map +1 -1
  182. package/lib/esm/content-fields/hubtype-fields/video.d.ts +2 -2
  183. package/lib/esm/content-fields/hubtype-fields/video.js +3 -2
  184. package/lib/esm/content-fields/hubtype-fields/video.js.map +1 -1
  185. package/lib/esm/content-fields/hubtype-fields/webview.d.ts +2 -2
  186. package/lib/esm/content-fields/hubtype-fields/webview.js +3 -2
  187. package/lib/esm/content-fields/hubtype-fields/webview.js.map +1 -1
  188. package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.d.ts +2 -2
  189. package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.js +3 -2
  190. package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.js.map +1 -1
  191. package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.d.ts +3 -3
  192. package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.js +3 -2
  193. package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +1 -1
  194. package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.d.ts +2 -2
  195. package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.js +3 -2
  196. package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +1 -1
  197. package/lib/esm/content-fields/hubtype-fields/whatsapp-template.d.ts +3 -3
  198. package/lib/esm/content-fields/hubtype-fields/whatsapp-template.js +6 -6
  199. package/lib/esm/content-fields/hubtype-fields/whatsapp-template.js.map +1 -1
  200. package/lib/esm/content-fields/index.d.ts +23 -23
  201. package/lib/esm/content-fields/index.js +72 -51
  202. package/lib/esm/content-fields/index.js.map +1 -1
  203. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +3 -3
  204. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +16 -14
  205. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +1 -1
  206. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +4 -4
  207. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +20 -15
  208. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +1 -1
  209. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +4 -4
  210. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +46 -26
  211. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +1 -1
  212. package/lib/esm/content-fields/whatsapp-button-list/index.d.ts +3 -3
  213. package/lib/esm/content-fields/whatsapp-button-list/index.js +11 -9
  214. package/lib/esm/content-fields/whatsapp-button-list/index.js.map +1 -1
  215. package/lib/esm/filters/index.d.ts +2 -2
  216. package/lib/esm/filters/index.js +8 -9
  217. package/lib/esm/filters/index.js.map +1 -1
  218. package/lib/esm/flow-factory.d.ts +3 -3
  219. package/lib/esm/flow-factory.js +57 -51
  220. package/lib/esm/flow-factory.js.map +1 -1
  221. package/lib/esm/functions/index.d.ts +1 -1
  222. package/lib/esm/functions/index.js +25 -19
  223. package/lib/esm/functions/index.js.map +1 -1
  224. package/lib/esm/index.d.ts +12 -12
  225. package/lib/esm/index.js +94 -77
  226. package/lib/esm/index.js.map +1 -1
  227. package/lib/esm/package.json +3 -0
  228. package/lib/esm/services/hubtype-queues-api.js +14 -14
  229. package/lib/esm/services/hubtype-queues-api.js.map +1 -1
  230. package/lib/esm/structured-output/flow-builder-content.js +14 -13
  231. package/lib/esm/structured-output/flow-builder-content.js.map +1 -1
  232. package/lib/esm/tracking.d.ts +2 -2
  233. package/lib/esm/tracking.js +27 -21
  234. package/lib/esm/tracking.js.map +1 -1
  235. package/lib/esm/types.d.ts +5 -5
  236. package/lib/esm/types.js +9 -9
  237. package/lib/esm/types.js.map +1 -1
  238. package/lib/esm/user-input/capture-user-input-api.d.ts +2 -2
  239. package/lib/esm/user-input/capture-user-input-api.js +44 -33
  240. package/lib/esm/user-input/capture-user-input-api.js.map +1 -1
  241. package/lib/esm/user-input/index.d.ts +2 -2
  242. package/lib/esm/user-input/index.js +23 -14
  243. package/lib/esm/user-input/index.js.map +1 -1
  244. package/lib/esm/user-input/keyword.d.ts +2 -2
  245. package/lib/esm/user-input/keyword.js +31 -26
  246. package/lib/esm/user-input/keyword.js.map +1 -1
  247. package/lib/esm/user-input/smart-intent.d.ts +2 -2
  248. package/lib/esm/user-input/smart-intent.js +36 -32
  249. package/lib/esm/user-input/smart-intent.js.map +1 -1
  250. package/lib/esm/utils/ai-agent.d.ts +3 -3
  251. package/lib/esm/utils/ai-agent.js +17 -12
  252. package/lib/esm/utils/ai-agent.js.map +1 -1
  253. package/lib/esm/utils/authentication.js +10 -7
  254. package/lib/esm/utils/authentication.js.map +1 -1
  255. package/lib/esm/utils/flow-locale.js +14 -18
  256. package/lib/esm/utils/flow-locale.js.map +1 -1
  257. package/lib/esm/utils/get-flow-builder-plugin.d.ts +1 -1
  258. package/lib/esm/utils/get-flow-builder-plugin.js +4 -4
  259. package/lib/esm/utils/get-flow-builder-plugin.js.map +1 -1
  260. package/lib/esm/utils/hubtype-assistant-content.d.ts +1 -2
  261. package/lib/esm/utils/hubtype-assistant-content.js +57 -54
  262. package/lib/esm/utils/hubtype-assistant-content.js.map +1 -1
  263. package/lib/esm/utils/input.js +16 -14
  264. package/lib/esm/utils/input.js.map +1 -1
  265. package/lib/esm/webview/contents-context.d.ts +1 -1
  266. package/lib/esm/webview/contents-context.js +13 -11
  267. package/lib/esm/webview/contents-context.js.map +1 -1
  268. package/lib/esm/webview/index.d.ts +3 -3
  269. package/lib/esm/webview/index.js +10 -9
  270. package/lib/esm/webview/index.js.map +1 -1
  271. package/lib/esm/webview/types.d.ts +1 -1
  272. package/lib/esm/webview/types.js +6 -6
  273. package/lib/esm/webview/types.js.map +1 -1
  274. package/lib/esm/webview/use-webview-contents.d.ts +1 -1
  275. package/lib/esm/webview/use-webview-contents.js +46 -39
  276. package/lib/esm/webview/use-webview-contents.js.map +1 -1
  277. package/package.json +8 -7
  278. package/src/content-fields/flow-ai-agent-base.tsx +0 -11
  279. package/src/content-fields/flow-whatsapp-request-contact-info.tsx +1 -17
  280. package/src/index.ts +5 -5
  281. package/src/types.ts +6 -6
  282. package/src/utils/hubtype-assistant-content.ts +0 -14
  283. package/lib/cjs/action/ai-agent-from-user-input.d.ts +0 -3
  284. package/lib/cjs/action/ai-agent-from-user-input.js +0 -32
  285. package/lib/cjs/action/ai-agent-from-user-input.js.map +0 -1
  286. package/lib/cjs/action/context.d.ts +0 -11
  287. package/lib/cjs/action/context.js +0 -17
  288. package/lib/cjs/action/context.js.map +0 -1
  289. package/lib/cjs/action/fallback.d.ts +0 -3
  290. package/lib/cjs/action/fallback.js +0 -36
  291. package/lib/cjs/action/fallback.js.map +0 -1
  292. package/lib/cjs/action/first-interaction.d.ts +0 -3
  293. package/lib/cjs/action/first-interaction.js +0 -88
  294. package/lib/cjs/action/first-interaction.js.map +0 -1
  295. package/lib/cjs/action/get-contents.d.ts +0 -3
  296. package/lib/cjs/action/get-contents.js +0 -39
  297. package/lib/cjs/action/get-contents.js.map +0 -1
  298. package/lib/cjs/action/index.d.ts +0 -25
  299. package/lib/cjs/action/index.js +0 -90
  300. package/lib/cjs/action/index.js.map +0 -1
  301. package/lib/cjs/action/payload.d.ts +0 -3
  302. package/lib/cjs/action/payload.js +0 -74
  303. package/lib/cjs/action/payload.js.map +0 -1
  304. package/lib/cjs/api.d.ts +0 -40
  305. package/lib/cjs/api.js +0 -205
  306. package/lib/cjs/api.js.map +0 -1
  307. package/lib/cjs/constants.d.ts +0 -13
  308. package/lib/cjs/constants.js +0 -19
  309. package/lib/cjs/constants.js.map +0 -1
  310. package/lib/cjs/content-fields/content-fields-base.d.ts +0 -20
  311. package/lib/cjs/content-fields/content-fields-base.js +0 -74
  312. package/lib/cjs/content-fields/content-fields-base.js.map +0 -1
  313. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.d.ts +0 -15
  314. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +0 -71
  315. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +0 -1
  316. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.d.ts +0 -9
  317. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.js +0 -58
  318. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +0 -1
  319. package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.d.ts +0 -17
  320. package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.js +0 -79
  321. package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.js.map +0 -1
  322. package/lib/cjs/content-fields/flow-ai-agent-base.d.ts +0 -25
  323. package/lib/cjs/content-fields/flow-ai-agent-base.js +0 -97
  324. package/lib/cjs/content-fields/flow-ai-agent-base.js.map +0 -1
  325. package/lib/cjs/content-fields/flow-ai-agent-router.d.ts +0 -21
  326. package/lib/cjs/content-fields/flow-ai-agent-router.js +0 -125
  327. package/lib/cjs/content-fields/flow-ai-agent-router.js.map +0 -1
  328. package/lib/cjs/content-fields/flow-ai-agent.d.ts +0 -17
  329. package/lib/cjs/content-fields/flow-ai-agent.js +0 -64
  330. package/lib/cjs/content-fields/flow-ai-agent.js.map +0 -1
  331. package/lib/cjs/content-fields/flow-bot-action.d.ts +0 -14
  332. package/lib/cjs/content-fields/flow-bot-action.js +0 -45
  333. package/lib/cjs/content-fields/flow-bot-action.js.map +0 -1
  334. package/lib/cjs/content-fields/flow-button.d.ts +0 -31
  335. package/lib/cjs/content-fields/flow-button.js +0 -86
  336. package/lib/cjs/content-fields/flow-button.js.map +0 -1
  337. package/lib/cjs/content-fields/flow-capture-user-input.d.ts +0 -14
  338. package/lib/cjs/content-fields/flow-capture-user-input.js +0 -45
  339. package/lib/cjs/content-fields/flow-capture-user-input.js.map +0 -1
  340. package/lib/cjs/content-fields/flow-carousel.d.ts +0 -22
  341. package/lib/cjs/content-fields/flow-carousel.js +0 -152
  342. package/lib/cjs/content-fields/flow-carousel.js.map +0 -1
  343. package/lib/cjs/content-fields/flow-channel-conditional.d.ts +0 -14
  344. package/lib/cjs/content-fields/flow-channel-conditional.js +0 -57
  345. package/lib/cjs/content-fields/flow-channel-conditional.js.map +0 -1
  346. package/lib/cjs/content-fields/flow-country-conditional.d.ts +0 -13
  347. package/lib/cjs/content-fields/flow-country-conditional.js +0 -59
  348. package/lib/cjs/content-fields/flow-country-conditional.js.map +0 -1
  349. package/lib/cjs/content-fields/flow-custom-conditional.d.ts +0 -17
  350. package/lib/cjs/content-fields/flow-custom-conditional.js +0 -89
  351. package/lib/cjs/content-fields/flow-custom-conditional.js.map +0 -1
  352. package/lib/cjs/content-fields/flow-element.d.ts +0 -22
  353. package/lib/cjs/content-fields/flow-element.js +0 -50
  354. package/lib/cjs/content-fields/flow-element.js.map +0 -1
  355. package/lib/cjs/content-fields/flow-go-to-flow.d.ts +0 -13
  356. package/lib/cjs/content-fields/flow-go-to-flow.js +0 -51
  357. package/lib/cjs/content-fields/flow-go-to-flow.js.map +0 -1
  358. package/lib/cjs/content-fields/flow-handoff.d.ts +0 -17
  359. package/lib/cjs/content-fields/flow-handoff.js +0 -68
  360. package/lib/cjs/content-fields/flow-handoff.js.map +0 -1
  361. package/lib/cjs/content-fields/flow-image.d.ts +0 -10
  362. package/lib/cjs/content-fields/flow-image.js +0 -33
  363. package/lib/cjs/content-fields/flow-image.js.map +0 -1
  364. package/lib/cjs/content-fields/flow-queue-status-conditional.d.ts +0 -30
  365. package/lib/cjs/content-fields/flow-queue-status-conditional.js +0 -95
  366. package/lib/cjs/content-fields/flow-queue-status-conditional.js.map +0 -1
  367. package/lib/cjs/content-fields/flow-rating.d.ts +0 -15
  368. package/lib/cjs/content-fields/flow-rating.js +0 -66
  369. package/lib/cjs/content-fields/flow-rating.js.map +0 -1
  370. package/lib/cjs/content-fields/flow-text.d.ts +0 -15
  371. package/lib/cjs/content-fields/flow-text.js +0 -60
  372. package/lib/cjs/content-fields/flow-text.js.map +0 -1
  373. package/lib/cjs/content-fields/flow-video.d.ts +0 -10
  374. package/lib/cjs/content-fields/flow-video.js +0 -33
  375. package/lib/cjs/content-fields/flow-video.js.map +0 -1
  376. package/lib/cjs/content-fields/flow-webview.d.ts +0 -16
  377. package/lib/cjs/content-fields/flow-webview.js +0 -78
  378. package/lib/cjs/content-fields/flow-webview.js.map +0 -1
  379. package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.d.ts +0 -21
  380. package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js +0 -92
  381. package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js.map +0 -1
  382. package/lib/cjs/content-fields/flow-whatsapp-request-contact-info.d.ts +0 -11
  383. package/lib/cjs/content-fields/flow-whatsapp-request-contact-info.js +0 -45
  384. package/lib/cjs/content-fields/flow-whatsapp-request-contact-info.js.map +0 -1
  385. package/lib/cjs/content-fields/flow-whatsapp-template.d.ts +0 -37
  386. package/lib/cjs/content-fields/flow-whatsapp-template.js +0 -264
  387. package/lib/cjs/content-fields/flow-whatsapp-template.js.map +0 -1
  388. package/lib/cjs/content-fields/hubtype-fields/ai-agent-router.d.ts +0 -21
  389. package/lib/cjs/content-fields/hubtype-fields/ai-agent-router.js +0 -3
  390. package/lib/cjs/content-fields/hubtype-fields/ai-agent-router.js.map +0 -1
  391. package/lib/cjs/content-fields/hubtype-fields/ai-agent.d.ts +0 -25
  392. package/lib/cjs/content-fields/hubtype-fields/ai-agent.js +0 -3
  393. package/lib/cjs/content-fields/hubtype-fields/ai-agent.js.map +0 -1
  394. package/lib/cjs/content-fields/hubtype-fields/bot-action.d.ts +0 -10
  395. package/lib/cjs/content-fields/hubtype-fields/bot-action.js +0 -3
  396. package/lib/cjs/content-fields/hubtype-fields/bot-action.js.map +0 -1
  397. package/lib/cjs/content-fields/hubtype-fields/button.d.ts +0 -8
  398. package/lib/cjs/content-fields/hubtype-fields/button.js +0 -3
  399. package/lib/cjs/content-fields/hubtype-fields/button.js.map +0 -1
  400. package/lib/cjs/content-fields/hubtype-fields/capture-user-input.d.ts +0 -19
  401. package/lib/cjs/content-fields/hubtype-fields/capture-user-input.js +0 -12
  402. package/lib/cjs/content-fields/hubtype-fields/capture-user-input.js.map +0 -1
  403. package/lib/cjs/content-fields/hubtype-fields/carousel.d.ts +0 -17
  404. package/lib/cjs/content-fields/hubtype-fields/carousel.js +0 -3
  405. package/lib/cjs/content-fields/hubtype-fields/carousel.js.map +0 -1
  406. package/lib/cjs/content-fields/hubtype-fields/channel-conditional.d.ts +0 -10
  407. package/lib/cjs/content-fields/hubtype-fields/channel-conditional.js +0 -3
  408. package/lib/cjs/content-fields/hubtype-fields/channel-conditional.js.map +0 -1
  409. package/lib/cjs/content-fields/hubtype-fields/common.d.ts +0 -83
  410. package/lib/cjs/content-fields/hubtype-fields/common.js +0 -3
  411. package/lib/cjs/content-fields/hubtype-fields/common.js.map +0 -1
  412. package/lib/cjs/content-fields/hubtype-fields/country-conditional.d.ts +0 -10
  413. package/lib/cjs/content-fields/hubtype-fields/country-conditional.js +0 -3
  414. package/lib/cjs/content-fields/hubtype-fields/country-conditional.js.map +0 -1
  415. package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.d.ts +0 -56
  416. package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.js +0 -36
  417. package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.js.map +0 -1
  418. package/lib/cjs/content-fields/hubtype-fields/custom-conditional.d.ts +0 -11
  419. package/lib/cjs/content-fields/hubtype-fields/custom-conditional.js +0 -3
  420. package/lib/cjs/content-fields/hubtype-fields/custom-conditional.js.map +0 -1
  421. package/lib/cjs/content-fields/hubtype-fields/fallback.d.ts +0 -9
  422. package/lib/cjs/content-fields/hubtype-fields/fallback.js +0 -3
  423. package/lib/cjs/content-fields/hubtype-fields/fallback.js.map +0 -1
  424. package/lib/cjs/content-fields/hubtype-fields/function.d.ts +0 -30
  425. package/lib/cjs/content-fields/hubtype-fields/function.js +0 -11
  426. package/lib/cjs/content-fields/hubtype-fields/function.js.map +0 -1
  427. package/lib/cjs/content-fields/hubtype-fields/go-to-flow.d.ts +0 -9
  428. package/lib/cjs/content-fields/hubtype-fields/go-to-flow.js +0 -3
  429. package/lib/cjs/content-fields/hubtype-fields/go-to-flow.js.map +0 -1
  430. package/lib/cjs/content-fields/hubtype-fields/handoff.d.ts +0 -11
  431. package/lib/cjs/content-fields/hubtype-fields/handoff.js +0 -3
  432. package/lib/cjs/content-fields/hubtype-fields/handoff.js.map +0 -1
  433. package/lib/cjs/content-fields/hubtype-fields/image.d.ts +0 -8
  434. package/lib/cjs/content-fields/hubtype-fields/image.js +0 -3
  435. package/lib/cjs/content-fields/hubtype-fields/image.js.map +0 -1
  436. package/lib/cjs/content-fields/hubtype-fields/index.d.ts +0 -27
  437. package/lib/cjs/content-fields/hubtype-fields/index.js +0 -31
  438. package/lib/cjs/content-fields/hubtype-fields/index.js.map +0 -1
  439. package/lib/cjs/content-fields/hubtype-fields/keyword.d.ts +0 -9
  440. package/lib/cjs/content-fields/hubtype-fields/keyword.js +0 -3
  441. package/lib/cjs/content-fields/hubtype-fields/keyword.js.map +0 -1
  442. package/lib/cjs/content-fields/hubtype-fields/node-types.d.ts +0 -31
  443. package/lib/cjs/content-fields/hubtype-fields/node-types.js +0 -38
  444. package/lib/cjs/content-fields/hubtype-fields/node-types.js.map +0 -1
  445. package/lib/cjs/content-fields/hubtype-fields/nodes.d.ts +0 -26
  446. package/lib/cjs/content-fields/hubtype-fields/nodes.js +0 -3
  447. package/lib/cjs/content-fields/hubtype-fields/nodes.js.map +0 -1
  448. package/lib/cjs/content-fields/hubtype-fields/payload.d.ts +0 -8
  449. package/lib/cjs/content-fields/hubtype-fields/payload.js +0 -3
  450. package/lib/cjs/content-fields/hubtype-fields/payload.js.map +0 -1
  451. package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.d.ts +0 -25
  452. package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.js +0 -3
  453. package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.js.map +0 -1
  454. package/lib/cjs/content-fields/hubtype-fields/rating.d.ts +0 -23
  455. package/lib/cjs/content-fields/hubtype-fields/rating.js +0 -9
  456. package/lib/cjs/content-fields/hubtype-fields/rating.js.map +0 -1
  457. package/lib/cjs/content-fields/hubtype-fields/smart-intent.d.ts +0 -12
  458. package/lib/cjs/content-fields/hubtype-fields/smart-intent.js +0 -3
  459. package/lib/cjs/content-fields/hubtype-fields/smart-intent.js.map +0 -1
  460. package/lib/cjs/content-fields/hubtype-fields/text.d.ts +0 -11
  461. package/lib/cjs/content-fields/hubtype-fields/text.js +0 -3
  462. package/lib/cjs/content-fields/hubtype-fields/text.js.map +0 -1
  463. package/lib/cjs/content-fields/hubtype-fields/url.d.ts +0 -8
  464. package/lib/cjs/content-fields/hubtype-fields/url.js +0 -3
  465. package/lib/cjs/content-fields/hubtype-fields/url.js.map +0 -1
  466. package/lib/cjs/content-fields/hubtype-fields/video.d.ts +0 -8
  467. package/lib/cjs/content-fields/hubtype-fields/video.js +0 -3
  468. package/lib/cjs/content-fields/hubtype-fields/video.js.map +0 -1
  469. package/lib/cjs/content-fields/hubtype-fields/webview.d.ts +0 -17
  470. package/lib/cjs/content-fields/hubtype-fields/webview.js +0 -3
  471. package/lib/cjs/content-fields/hubtype-fields/webview.js.map +0 -1
  472. package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.d.ts +0 -21
  473. package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.js +0 -3
  474. package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.js.map +0 -1
  475. package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.d.ts +0 -17
  476. package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.js +0 -3
  477. package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +0 -1
  478. package/lib/cjs/content-fields/hubtype-fields/whatsapp-request-contact-info.d.ts +0 -8
  479. package/lib/cjs/content-fields/hubtype-fields/whatsapp-request-contact-info.js +0 -3
  480. package/lib/cjs/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +0 -1
  481. package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.d.ts +0 -96
  482. package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.js +0 -9
  483. package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.js.map +0 -1
  484. package/lib/cjs/content-fields/index.d.ts +0 -25
  485. package/lib/cjs/content-fields/index.js +0 -52
  486. package/lib/cjs/content-fields/index.js.map +0 -1
  487. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +0 -14
  488. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +0 -41
  489. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +0 -1
  490. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +0 -13
  491. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +0 -36
  492. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +0 -1
  493. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +0 -14
  494. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +0 -46
  495. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +0 -1
  496. package/lib/cjs/content-fields/whatsapp-button-list/index.d.ts +0 -3
  497. package/lib/cjs/content-fields/whatsapp-button-list/index.js +0 -10
  498. package/lib/cjs/content-fields/whatsapp-button-list/index.js.map +0 -1
  499. package/lib/cjs/filters/index.d.ts +0 -12
  500. package/lib/cjs/filters/index.js +0 -17
  501. package/lib/cjs/filters/index.js.map +0 -1
  502. package/lib/cjs/flow-factory.d.ts +0 -12
  503. package/lib/cjs/flow-factory.js +0 -69
  504. package/lib/cjs/flow-factory.js.map +0 -1
  505. package/lib/cjs/functions/index.d.ts +0 -11
  506. package/lib/cjs/functions/index.js +0 -49
  507. package/lib/cjs/functions/index.js.map +0 -1
  508. package/lib/cjs/index.d.ts +0 -45
  509. package/lib/cjs/index.js +0 -178
  510. package/lib/cjs/index.js.map +0 -1
  511. package/lib/cjs/services/hubtype-queues-api.d.ts +0 -14
  512. package/lib/cjs/services/hubtype-queues-api.js +0 -26
  513. package/lib/cjs/services/hubtype-queues-api.js.map +0 -1
  514. package/lib/cjs/structured-output/flow-builder-content.d.ts +0 -13
  515. package/lib/cjs/structured-output/flow-builder-content.js +0 -15
  516. package/lib/cjs/structured-output/flow-builder-content.js.map +0 -1
  517. package/lib/cjs/tracking.d.ts +0 -16
  518. package/lib/cjs/tracking.js +0 -71
  519. package/lib/cjs/tracking.js.map +0 -1
  520. package/lib/cjs/types.d.ts +0 -62
  521. package/lib/cjs/types.js +0 -14
  522. package/lib/cjs/types.js.map +0 -1
  523. package/lib/cjs/user-input/capture-user-input-api.d.ts +0 -21
  524. package/lib/cjs/user-input/capture-user-input-api.js +0 -88
  525. package/lib/cjs/user-input/capture-user-input-api.js.map +0 -1
  526. package/lib/cjs/user-input/index.d.ts +0 -4
  527. package/lib/cjs/user-input/index.js +0 -37
  528. package/lib/cjs/user-input/index.js.map +0 -1
  529. package/lib/cjs/user-input/keyword.d.ts +0 -27
  530. package/lib/cjs/user-input/keyword.js +0 -84
  531. package/lib/cjs/user-input/keyword.js.map +0 -1
  532. package/lib/cjs/user-input/smart-intent.d.ts +0 -24
  533. package/lib/cjs/user-input/smart-intent.js +0 -89
  534. package/lib/cjs/user-input/smart-intent.js.map +0 -1
  535. package/lib/cjs/utils/ai-agent.d.ts +0 -11
  536. package/lib/cjs/utils/ai-agent.js +0 -28
  537. package/lib/cjs/utils/ai-agent.js.map +0 -1
  538. package/lib/cjs/utils/authentication.d.ts +0 -2
  539. package/lib/cjs/utils/authentication.js +0 -21
  540. package/lib/cjs/utils/authentication.js.map +0 -1
  541. package/lib/cjs/utils/flow-locale.d.ts +0 -22
  542. package/lib/cjs/utils/flow-locale.js +0 -79
  543. package/lib/cjs/utils/flow-locale.js.map +0 -1
  544. package/lib/cjs/utils/get-flow-builder-plugin.d.ts +0 -3
  545. package/lib/cjs/utils/get-flow-builder-plugin.js +0 -16
  546. package/lib/cjs/utils/get-flow-builder-plugin.js.map +0 -1
  547. package/lib/cjs/utils/hubtype-assistant-content.d.ts +0 -13
  548. package/lib/cjs/utils/hubtype-assistant-content.js +0 -184
  549. package/lib/cjs/utils/hubtype-assistant-content.js.map +0 -1
  550. package/lib/cjs/utils/input.d.ts +0 -6
  551. package/lib/cjs/utils/input.js +0 -35
  552. package/lib/cjs/utils/input.js.map +0 -1
  553. package/lib/cjs/webview/contents-context.d.ts +0 -2
  554. package/lib/cjs/webview/contents-context.js +0 -12
  555. package/lib/cjs/webview/contents-context.js.map +0 -1
  556. package/lib/cjs/webview/index.d.ts +0 -3
  557. package/lib/cjs/webview/index.js +0 -10
  558. package/lib/cjs/webview/index.js.map +0 -1
  559. package/lib/cjs/webview/types.d.ts +0 -47
  560. package/lib/cjs/webview/types.js +0 -9
  561. package/lib/cjs/webview/types.js.map +0 -1
  562. package/lib/cjs/webview/use-webview-contents.d.ts +0 -2
  563. package/lib/cjs/webview/use-webview-contents.js +0 -83
  564. package/lib/cjs/webview/use-webview-contents.js.map +0 -1
@@ -1,34 +1,37 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.trackEvent = trackEvent;
4
- exports.trackFlowContent = trackFlowContent;
5
- exports.trackOneContent = trackOneContent;
6
- exports.getCommonFlowContentEventArgsForContentId = getCommonFlowContentEventArgsForContentId;
7
- const core_1 = require("@botonic/core");
8
- const uuid_1 = require("uuid");
9
- const hubtype_fields_1 = require("./content-fields/hubtype-fields");
10
- const get_flow_builder_plugin_1 = require("./utils/get-flow-builder-plugin");
1
+ import { EventAction } from "@botonic/core";
2
+ import { v7 } from "uuid";
3
+ import { HtNodeWithContentType } from "./content-fields/hubtype-fields/index.js";
4
+ import { getFlowBuilderPlugin } from "./utils/get-flow-builder-plugin.js";
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
11
14
  async function trackEvent(request, eventAction, args) {
12
- const flowBuilderPlugin = (0, get_flow_builder_plugin_1.getFlowBuilderPlugin)(request.plugins);
15
+ const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins);
13
16
  if (flowBuilderPlugin.trackEvent) {
14
17
  await flowBuilderPlugin.trackEvent(request, eventAction, args);
15
18
  }
16
19
  return;
17
20
  }
18
21
  async function trackFlowContent(request, contents) {
19
- const flowBuilderPlugin = (0, get_flow_builder_plugin_1.getFlowBuilderPlugin)(request.plugins);
22
+ const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins);
20
23
  const cmsApi = flowBuilderPlugin.cmsApi;
21
- for (const content of contents) {
24
+ for (const content of contents){
22
25
  await trackOneContent(request, content, cmsApi);
23
26
  }
24
27
  }
25
28
  async function trackOneContent(request, content, cmsApi) {
26
29
  if (!cmsApi) {
27
- const flowBuilderPlugin = (0, get_flow_builder_plugin_1.getFlowBuilderPlugin)(request.plugins);
30
+ const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins);
28
31
  cmsApi = flowBuilderPlugin.cmsApi;
29
32
  }
30
33
  const nodeContent = cmsApi.getNodeById(content.id);
31
- if (nodeContent.type !== hubtype_fields_1.HtNodeWithContentType.AI_AGENT) {
34
+ if (nodeContent.type !== HtNodeWithContentType.AI_AGENT) {
32
35
  const event = getContentEventArgs(request, nodeContent);
33
36
  const { action, ...eventArgs } = event;
34
37
  await trackEvent(request, action, eventArgs);
@@ -41,31 +44,34 @@ function getContentEventArgs(request, nodeContent) {
41
44
  const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } = getCommonFlowContentEventArgs(request, nodeContent);
42
45
  setSessionFlowThreadId(request, flowThreadId);
43
46
  return {
44
- action: core_1.EventAction.FlowNode,
47
+ action: EventAction.FlowNode,
45
48
  flowId,
46
49
  flowName,
47
50
  flowNodeId,
48
51
  flowNodeContentId,
49
52
  flowThreadId,
50
- flowNodeIsMeaningful: nodeContent.is_meaningful ?? false,
53
+ flowNodeIsMeaningful: nodeContent.is_meaningful ?? false
51
54
  };
52
55
  }
53
56
  function getCommonFlowContentEventArgs(request, nodeContent) {
54
- const flowBuilderPlugin = (0, get_flow_builder_plugin_1.getFlowBuilderPlugin)(request.plugins);
57
+ const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins);
55
58
  const flowName = flowBuilderPlugin.getFlowName(nodeContent.flow_id);
56
- const flowThreadId = request.session.flow_thread_id ?? (0, uuid_1.v7)();
59
+ const flowThreadId = request.session.flow_thread_id ?? v7();
57
60
  return {
58
61
  flowThreadId,
59
62
  flowId: nodeContent.flow_id,
60
63
  flowName,
61
64
  flowNodeId: nodeContent.id,
62
- flowNodeContentId: nodeContent.code ?? '',
65
+ flowNodeContentId: nodeContent.code ?? ''
63
66
  };
64
67
  }
65
68
  function getCommonFlowContentEventArgsForContentId(botContext, id) {
66
- const flowBuilderPlugin = (0, get_flow_builder_plugin_1.getFlowBuilderPlugin)(botContext.plugins);
69
+ const flowBuilderPlugin = getFlowBuilderPlugin(botContext.plugins);
67
70
  const cmsApi = flowBuilderPlugin.cmsApi;
68
71
  const nodeContent = cmsApi.getNodeById(id);
69
72
  return getCommonFlowContentEventArgs(botContext, nodeContent);
70
73
  }
74
+
75
+ export { getCommonFlowContentEventArgsForContentId, trackEvent, trackFlowContent, trackOneContent };
76
+
71
77
  //# sourceMappingURL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AyC,CACvD,UAAsB,EACtB,EAAU;IAEV,MAAM,iBAAiB,GAAG,IAAA,8CAAoB,EAAC,UAAU,CAAC,OAAO,CAAC,CAAA;IAClE,MAAM,MAAM,GAAG,iBAAiB,CAAC,MAAM,CAAA;IACvC,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,CAAoB,EAAE,CAAC,CAAA;IAE7D,OAAO,6BAA6B,CAAC,UAAU,EAAE,WAAW,CAAC,CAAA;AAC/D,CAAC"}
1
+ {"version":3,"file":"tracking.js","sources":["../../src/tracking.ts"],"sourcesContent":["import { type BotContext, EventAction, type EventFlow } from '@botonic/core'\nimport type { ActionRequest } from '@botonic/react'\nimport { v7 as uuidv7 } from 'uuid'\n\nimport type { FlowBuilderApi } from './api'\nimport type { FlowContent } from './content-fields'\nimport {\n type HtNodeWithContent,\n HtNodeWithContentType,\n} from './content-fields/hubtype-fields'\nimport { getFlowBuilderPlugin } from './utils/get-flow-builder-plugin'\n\nexport async function trackEvent(\n request: ActionRequest,\n eventAction: EventAction,\n args?: Record<string, any>\n): Promise<void> {\n const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins)\n if (flowBuilderPlugin.trackEvent) {\n await flowBuilderPlugin.trackEvent(request, eventAction, args)\n }\n return\n}\n\nexport async function trackFlowContent(\n request: ActionRequest,\n contents: FlowContent[]\n) {\n const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins)\n const cmsApi = flowBuilderPlugin.cmsApi\n for (const content of contents) {\n await trackOneContent(request, content, cmsApi)\n }\n}\n\nexport async function trackOneContent(\n request: ActionRequest,\n content: FlowContent,\n cmsApi?: FlowBuilderApi\n) {\n if (!cmsApi) {\n const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins)\n cmsApi = flowBuilderPlugin.cmsApi\n }\n\n const nodeContent = cmsApi.getNodeById<HtNodeWithContent>(content.id)\n if (nodeContent.type !== HtNodeWithContentType.AI_AGENT) {\n const event = getContentEventArgs(request, nodeContent)\n const { action, ...eventArgs } = event\n await trackEvent(request, action, eventArgs)\n }\n}\n\nfunction setSessionFlowThreadId(\n request: ActionRequest,\n flowThreadId: string\n): void {\n request.session.flow_thread_id = flowThreadId\n}\n\nfunction getContentEventArgs(\n request: ActionRequest,\n nodeContent: HtNodeWithContent\n): EventFlow {\n const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } =\n getCommonFlowContentEventArgs(request, nodeContent)\n\n setSessionFlowThreadId(request, flowThreadId)\n\n return {\n action: EventAction.FlowNode,\n flowId,\n flowName,\n flowNodeId,\n flowNodeContentId,\n flowThreadId,\n flowNodeIsMeaningful: nodeContent.is_meaningful ?? false,\n }\n}\n\ntype CommonFlowContentEventArgs = {\n flowThreadId: string\n flowId: string\n flowName: string\n flowNodeId: string\n flowNodeContentId: string\n}\n\nfunction getCommonFlowContentEventArgs(\n request: ActionRequest,\n nodeContent: HtNodeWithContent\n): CommonFlowContentEventArgs {\n const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins)\n const flowName = flowBuilderPlugin.getFlowName(nodeContent.flow_id)\n const flowThreadId = request.session.flow_thread_id ?? uuidv7()\n\n return {\n flowThreadId,\n flowId: nodeContent.flow_id,\n flowName,\n flowNodeId: nodeContent.id,\n flowNodeContentId: nodeContent.code ?? '',\n }\n}\n\nexport function getCommonFlowContentEventArgsForContentId(\n botContext: BotContext,\n id: string\n): CommonFlowContentEventArgs {\n const flowBuilderPlugin = getFlowBuilderPlugin(botContext.plugins)\n const cmsApi = flowBuilderPlugin.cmsApi\n const nodeContent = cmsApi.getNodeById<HtNodeWithContent>(id)\n\n return getCommonFlowContentEventArgs(botContext, nodeContent)\n}\n"],"names":["EventAction","v7","uuidv7","HtNodeWithContentType","getFlowBuilderPlugin","trackEvent","request","eventAction","args","flowBuilderPlugin","trackFlowContent","contents","cmsApi","content","trackOneContent","nodeContent","event","getContentEventArgs","action","eventArgs","setSessionFlowThreadId","flowThreadId","flowId","flowName","flowNodeId","flowNodeContentId","getCommonFlowContentEventArgs","getCommonFlowContent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;IAEhC,OAAO;QACL,QAAQrB,oBAAoB;QAC5BsB;QACAC;QACAC;QACAC;QACAJ;QACA,sBAAsBN,YAAY,aAAa,IAAI;IACrD;AACF;AAUA,SAASW,6BAA6BA,CACpCpB,OAAsB,EACtBS,WAA8B;IAE9B,MAAMN,oBAAoBL,oBAAoBA,CAACE,QAAQ,OAAO;IAC9D,MAAMiB,WAAWd,kBAAkB,WAAW,CAACM,YAAY,OAAO;IAClE,MAAMM,eAAef,QAAQ,OAAO,CAAC,cAAc,IAAIJ,EAAMA;IAE7D,OAAO;QACLmB;QACA,QAAQN,YAAY,OAAO;QAC3BQ;QACA,YAAYR,YAAY,EAAE;QAC1B,mBAAmBA,YAAY,IAAI,IAAI;IACzC;AACF;AAEO,SAASY,yCAAyCA,CACvDC,UAAsB,EACtBC,EAAU;IAEV,MAAMpB,oBAAoBL,oBAAoBA,CAACwB,WAAW,OAAO;IACjE,MAAMhB,SAASH,kBAAkB,MAAM;IACvC,MAAMM,cAAcH,OAAO,WAAW,CAAoBiB;IAE1D,OAAOH,6BAA6BA,CAACE,YAAYb;AACnD"}
@@ -1,7 +1,7 @@
1
- import { AiAgentArgs, type BotContext, GuardrailRule, type InferenceResponse, type PluginPreRequest, type ResolvedPlugins } from '@botonic/core';
2
- import type { FlowContent } from './content-fields';
3
- import type { HtFlowBuilderData, HtRatingButton } from './content-fields/hubtype-fields';
4
- import type { FlowBuilderContentMessage } from './structured-output/flow-builder-content';
1
+ import type { AiAgentArgs, BotContext, GuardrailRule, InferenceResponse, PluginPreRequest, ResolvedPlugins } from '@botonic/core';
2
+ import type { FlowContent } from './content-fields/index.js';
3
+ import type { HtFlowBuilderData, HtRatingButton } from './content-fields/hubtype-fields/index.js';
4
+ import type { FlowBuilderContentMessage } from './structured-output/flow-builder-content.js';
5
5
  export interface InShadowingConfig {
6
6
  allowKeywords: boolean;
7
7
  allowSmartIntents: boolean;
@@ -59,4 +59,4 @@ export interface RatingSubmittedInfo extends HtRatingButton {
59
59
  possibleOptions: string[];
60
60
  possibleValues: number[];
61
61
  }
62
- export { AiAgentArgs, GuardrailRule };
62
+ export type { AiAgentArgs, GuardrailRule };
package/lib/esm/types.js CHANGED
@@ -1,14 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FlowBuilderJSONVersion = exports.ProcessEnvNodeEnvs = void 0;
4
- var ProcessEnvNodeEnvs;
5
- (function (ProcessEnvNodeEnvs) {
1
+ var types_ProcessEnvNodeEnvs = /*#__PURE__*/ function(ProcessEnvNodeEnvs) {
6
2
  ProcessEnvNodeEnvs["PRODUCTION"] = "production";
7
3
  ProcessEnvNodeEnvs["DEVELOPMENT"] = "development";
8
- })(ProcessEnvNodeEnvs || (exports.ProcessEnvNodeEnvs = ProcessEnvNodeEnvs = {}));
9
- var FlowBuilderJSONVersion;
10
- (function (FlowBuilderJSONVersion) {
4
+ return ProcessEnvNodeEnvs;
5
+ }({});
6
+ var types_FlowBuilderJSONVersion = /*#__PURE__*/ function(FlowBuilderJSONVersion) {
11
7
  FlowBuilderJSONVersion["DRAFT"] = "draft";
12
8
  FlowBuilderJSONVersion["LATEST"] = "latest";
13
- })(FlowBuilderJSONVersion || (exports.FlowBuilderJSONVersion = FlowBuilderJSONVersion = {}));
9
+ return FlowBuilderJSONVersion;
10
+ }({});
11
+
12
+ export { types_FlowBuilderJSONVersion as FlowBuilderJSONVersion, types_ProcessEnvNodeEnvs as ProcessEnvNodeEnvs };
13
+
14
14
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;AAwEA,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,+CAAyB,CAAA;IACzB,iDAA2B,CAAA;AAC7B,CAAC,EAHW,kBAAkB,kCAAlB,kBAAkB,QAG7B;AAED,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAChC,yCAAe,CAAA;IACf,2CAAiB,CAAA;AACnB,CAAC,EAHW,sBAAsB,sCAAtB,sBAAsB,QAGjC"}
1
+ {"version":3,"file":"types.js","sources":["../../src/types.ts"],"sourcesContent":["import type {\n AiAgentArgs,\n BotContext,\n GuardrailRule,\n InferenceResponse,\n PluginPreRequest,\n ResolvedPlugins,\n} from '@botonic/core'\nimport type { FlowContent } from './content-fields'\nimport type {\n HtFlowBuilderData,\n HtRatingButton,\n} from './content-fields/hubtype-fields'\nimport type { FlowBuilderContentMessage } from './structured-output/flow-builder-content'\n\nexport interface InShadowingConfig {\n allowKeywords: boolean\n allowSmartIntents: boolean\n allowAiAgents: boolean\n}\n\nexport interface BotonicPluginFlowBuilderOptions<\n TPlugins extends ResolvedPlugins = ResolvedPlugins,\n TExtraData = any,\n> {\n apiUrl?: string\n jsonVersion?: FlowBuilderJSONVersion\n flow?: HtFlowBuilderData\n customFunctions?: Record<any, any>\n getAccessToken: () => string\n trackEvent?: TrackEventFunction<TPlugins, TExtraData>\n getAiAgentResponse?: AiAgentFunction<TPlugins, TExtraData>\n smartIntentsConfig?: { numSmartIntentsToUse: number }\n inShadowing?: Partial<InShadowingConfig>\n contentFilters?: ContentFilter<TPlugins, TExtraData>[]\n customRatingMessageEnabled?: boolean\n disableAIAgentInFirstInteraction?: boolean\n}\n\nexport type TrackEventFunction<\n TPlugins extends ResolvedPlugins = ResolvedPlugins,\n TExtraData = any,\n> = (\n request: BotContext<TPlugins, TExtraData>,\n eventAction: string,\n args?: Record<string, any>\n) => Promise<void>\n\nexport type AiAgentFunction<\n TPlugins extends ResolvedPlugins = ResolvedPlugins,\n TExtraData = any,\n> = (\n request: BotContext<TPlugins, TExtraData>,\n aiAgentArgs: AiAgentArgs\n) => Promise<InferenceResponse<FlowBuilderContentMessage>>\n\nexport type ContentFilter<\n TPlugins extends ResolvedPlugins = ResolvedPlugins,\n TExtraData = any,\n> = (\n request: BotContext<TPlugins, TExtraData>,\n content: FlowContent\n) => Promise<FlowContent> | FlowContent\n\nexport interface FlowBuilderApiOptions {\n url: string\n flowUrl: string\n flow?: HtFlowBuilderData\n accessToken: string\n request: PluginPreRequest\n}\n\nexport enum ProcessEnvNodeEnvs {\n PRODUCTION = 'production',\n DEVELOPMENT = 'development',\n}\n\nexport enum FlowBuilderJSONVersion {\n DRAFT = 'draft',\n LATEST = 'latest',\n}\n\nexport interface SmartIntentResponse {\n data: {\n smart_intent_title: string\n text: string\n smart_intents_used: {\n title: string\n description: string\n }[]\n }\n}\n\nexport interface PayloadParamsBase {\n contentID: string\n followUpContentID?: string\n}\n\nexport interface RatingSubmittedInfo extends HtRatingButton {\n possibleOptions: string[]\n possibleValues: number[]\n}\n\nexport type { AiAgentArgs, GuardrailRule }\n"],"names":["ProcessEnvNodeEnvs","FlowBuilderJSONVersion"],"mappings":"AAwEO,IAAKA,wBAAkBA,0BAAlBA;;;WAAAA;MAGX;AAEM,IAAKC,4BAAsBA,0BAAtBA;;;WAAAA;MAGX"}
@@ -1,6 +1,6 @@
1
1
  import type { ActionRequest } from '@botonic/react';
2
- import type { FlowBuilderApi } from '../api';
3
- import { type HtCaptureUserInputNode } from '../content-fields/hubtype-fields';
2
+ import type { FlowBuilderApi } from '../api.js';
3
+ import { type HtCaptureUserInputNode } from '../content-fields/hubtype-fields/index.js';
4
4
  interface AiCaptureResponseSuccess {
5
5
  success: true;
6
6
  value: string;
@@ -1,29 +1,34 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CaptureUserInputApi = void 0;
4
- const tslib_1 = require("tslib");
5
- const core_1 = require("@botonic/core");
6
- const axios_1 = tslib_1.__importDefault(require("axios"));
7
- const content_fields_1 = require("../content-fields");
8
- const hubtype_fields_1 = require("../content-fields/hubtype-fields");
9
- const tracking_1 = require("../tracking");
10
- const get_flow_builder_plugin_1 = require("../utils/get-flow-builder-plugin");
11
- const input_1 = require("../utils/input");
1
+ import { EventAction } from "@botonic/core";
2
+ import axios from "axios";
3
+ import { FlowCaptureUserInput } from "../content-fields/index.js";
4
+ import { HtAiValidationType } from "../content-fields/hubtype-fields/index.js";
5
+ import { getCommonFlowContentEventArgsForContentId, trackEvent } from "../tracking.js";
6
+ import { getFlowBuilderPlugin } from "../utils/get-flow-builder-plugin.js";
7
+ import { inputHasTextOrTranscript } from "../utils/input.js";
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
12
23
  class CaptureUserInputApi {
13
- constructor(cmsApi, request, textOrTranscript) {
14
- this.cmsApi = cmsApi;
15
- this.request = request;
16
- this.textOrTranscript = textOrTranscript;
17
- }
18
24
  async getNextNodeId() {
19
- if ((0, input_1.inputHasTextOrTranscript)(this.request.input) &&
20
- this.cmsApi.shouldCaptureUserInput()) {
25
+ if (inputHasTextOrTranscript(this.request.input) && this.cmsApi.shouldCaptureUserInput()) {
21
26
  const captureUserInputNode = this.cmsApi.getCaptureUserInputNode();
22
27
  if (!captureUserInputNode || !this.textOrTranscript) {
23
28
  return undefined;
24
29
  }
25
- const captureUserInput = content_fields_1.FlowCaptureUserInput.fromHubtypeCMS(captureUserInputNode);
26
- if (captureUserInput.aiValidationType === hubtype_fields_1.HtAiValidationType.NONE) {
30
+ const captureUserInput = FlowCaptureUserInput.fromHubtypeCMS(captureUserInputNode);
31
+ if (captureUserInput.aiValidationType === HtAiValidationType.NONE) {
27
32
  this.cmsApi.setUserExtraDataVariable(captureUserInputNode.content.field_name, this.textOrTranscript);
28
33
  await this.trackUserInputCapture(captureUserInputNode, true);
29
34
  return captureUserInput.captureSuccessId;
@@ -45,30 +50,29 @@ class CaptureUserInputApi {
45
50
  const data = {
46
51
  field_name: captureUserInputNode.content.field_name,
47
52
  validation_instructions: captureUserInputNode.content.ai_validation_instructions,
48
- user_input: this.textOrTranscript,
53
+ user_input: this.textOrTranscript
49
54
  };
50
- const pluginFlowBuilder = (0, get_flow_builder_plugin_1.getFlowBuilderPlugin)(this.request.plugins);
55
+ const pluginFlowBuilder = getFlowBuilderPlugin(this.request.plugins);
51
56
  const token = pluginFlowBuilder.getAccessToken(this.request.session);
52
57
  const config = {
53
58
  headers: {
54
59
  'Content-Type': 'application/json',
55
- Authorization: `Bearer ${token}`,
56
- },
60
+ Authorization: `Bearer ${token}`
61
+ }
57
62
  };
58
- const aiCaptureResponse = await axios_1.default.post(url, data, config);
63
+ const aiCaptureResponse = await axios.post(url, data, config);
59
64
  return aiCaptureResponse.data;
60
- }
61
- catch (error) {
65
+ } catch (error) {
62
66
  console.warn('Error getting ai/capture_user_input', error);
63
67
  }
64
68
  return {
65
- success: false,
69
+ success: false
66
70
  };
67
71
  }
68
72
  async trackUserInputCapture(captureUserInputNode, captureSuccess) {
69
- const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } = (0, tracking_1.getCommonFlowContentEventArgsForContentId)(this.request, captureUserInputNode.id);
73
+ const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } = getCommonFlowContentEventArgsForContentId(this.request, captureUserInputNode.id);
70
74
  const event = {
71
- action: core_1.EventAction.CaptureUserInput,
75
+ action: EventAction.CaptureUserInput,
72
76
  flowThreadId,
73
77
  flowId,
74
78
  flowName,
@@ -78,11 +82,18 @@ class CaptureUserInputApi {
78
82
  fieldName: captureUserInputNode.content.field_name,
79
83
  userInput: this.textOrTranscript,
80
84
  captureSuccess,
81
- messageId: this.request.input.message_id,
85
+ messageId: this.request.input.message_id
82
86
  };
83
87
  const { action, ...eventArgs } = event;
84
- await (0, tracking_1.trackEvent)(this.request, action, eventArgs);
88
+ await trackEvent(this.request, action, eventArgs);
89
+ }
90
+ constructor(cmsApi, request, textOrTranscript){
91
+ this.cmsApi = cmsApi;
92
+ this.request = request;
93
+ this.textOrTranscript = textOrTranscript;
85
94
  }
86
95
  }
87
- exports.CaptureUserInputApi = CaptureUserInputApi;
96
+
97
+ export { CaptureUserInputApi };
98
+
88
99
  //# sourceMappingURL=capture-user-input-api.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"capture-user-input-api.js","sourceRoot":"","sources":["../../../src/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,CAAC;QAED,OAAO;YACL,OAAO,EAAE,KAAK;SACf,CAAA;IACH,CAAC;IAED,KAAK,CAAC,qBAAqB,CACzB,oBAA4C,EAC5C,cAAuB;QAEvB,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,iBAAiB,EAAE,GACrE,IAAA,oDAAyC,EACvC,IAAI,CAAC,OAAO,EACZ,oBAAoB,CAAC,EAAE,CACxB,CAAA;QACH,MAAM,KAAK,GAA0B;YACnC,MAAM,EAAE,kBAAW,CAAC,gBAAgB;YACpC,YAAY;YACZ,MAAM;YACN,QAAQ;YACR,UAAU;YACV,iBAAiB;YACjB,oBAAoB,EAAE,KAAK;YAC3B,SAAS,EAAE,oBAAoB,CAAC,OAAO,CAAC,UAAU;YAClD,SAAS,EAAE,IAAI,CAAC,gBAAgB;YAChC,cAAc;YACd,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU;SACzC,CAAA;QACD,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAA;QACtC,MAAM,IAAA,qBAAU,EAAC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,CAAA;IACnD,CAAC;CACF;AAnHD,kDAmHC"}
1
+ {"version":3,"file":"user-input/capture-user-input-api.js","sources":["../../../src/user-input/capture-user-input-api.ts"],"sourcesContent":["import { EventAction, type EventCaptureUserInput } from '@botonic/core'\nimport type { ActionRequest } from '@botonic/react'\nimport axios from 'axios'\n\nimport type { FlowBuilderApi } from '../api'\nimport { FlowCaptureUserInput } from '../content-fields'\nimport {\n HtAiValidationType,\n type HtCaptureUserInputNode,\n} from '../content-fields/hubtype-fields'\nimport {\n getCommonFlowContentEventArgsForContentId,\n trackEvent,\n} from '../tracking'\nimport { getFlowBuilderPlugin } from '../utils/get-flow-builder-plugin'\nimport { inputHasTextOrTranscript } from '../utils/input'\n\ninterface AiCaptureResponseSuccess {\n success: true\n value: string\n}\n\ninterface AiCaptureResponseFailure {\n success: false\n}\n\ntype AiCaptureResponse = AiCaptureResponseSuccess | AiCaptureResponseFailure\n\nexport class CaptureUserInputApi {\n private cmsApi: FlowBuilderApi\n private request: ActionRequest\n private textOrTranscript: string\n\n constructor(\n cmsApi: FlowBuilderApi,\n request: ActionRequest,\n textOrTranscript: string\n ) {\n this.cmsApi = cmsApi\n this.request = request\n this.textOrTranscript = textOrTranscript\n }\n\n async getNextNodeId(): Promise<string | undefined> {\n if (\n inputHasTextOrTranscript(this.request.input) &&\n this.cmsApi.shouldCaptureUserInput()\n ) {\n const captureUserInputNode = this.cmsApi.getCaptureUserInputNode()\n if (!captureUserInputNode || !this.textOrTranscript) {\n return undefined\n }\n const captureUserInput =\n FlowCaptureUserInput.fromHubtypeCMS(captureUserInputNode)\n\n if (captureUserInput.aiValidationType === HtAiValidationType.NONE) {\n this.cmsApi.setUserExtraDataVariable(\n captureUserInputNode.content.field_name,\n this.textOrTranscript\n )\n await this.trackUserInputCapture(captureUserInputNode, true)\n return captureUserInput.captureSuccessId\n }\n\n const aiCaptureResponse =\n await this.getAiCaptureResponse(captureUserInputNode)\n if (!aiCaptureResponse.success) {\n await this.trackUserInputCapture(captureUserInputNode, false)\n return captureUserInput.captureFailId\n }\n\n this.cmsApi.setUserExtraDataVariable(\n captureUserInputNode.content.field_name,\n aiCaptureResponse.value\n )\n await this.trackUserInputCapture(captureUserInputNode, true)\n return captureUserInput.captureSuccessId\n }\n return undefined\n }\n\n async getAiCaptureResponse(\n captureUserInputNode: HtCaptureUserInputNode\n ): Promise<AiCaptureResponse> {\n try {\n const url = `${process.env.HUBTYPE_API_URL}/external/v1/capture_user_input/`\n const data = {\n field_name: captureUserInputNode.content.field_name,\n validation_instructions:\n captureUserInputNode.content.ai_validation_instructions,\n user_input: this.textOrTranscript,\n }\n const pluginFlowBuilder = getFlowBuilderPlugin(this.request.plugins)\n const token = pluginFlowBuilder.getAccessToken(this.request.session)\n\n const config = {\n headers: {\n 'Content-Type': 'application/json',\n Authorization: `Bearer ${token}`,\n },\n }\n\n const aiCaptureResponse = await axios.post<AiCaptureResponse>(\n url,\n data,\n config\n )\n\n return aiCaptureResponse.data\n } catch (error) {\n console.warn('Error getting ai/capture_user_input', error)\n }\n\n return {\n success: false,\n }\n }\n\n async trackUserInputCapture(\n captureUserInputNode: HtCaptureUserInputNode,\n captureSuccess: boolean\n ): Promise<void> {\n const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } =\n getCommonFlowContentEventArgsForContentId(\n this.request,\n captureUserInputNode.id\n )\n const event: EventCaptureUserInput = {\n action: EventAction.CaptureUserInput,\n flowThreadId,\n flowId,\n flowName,\n flowNodeId,\n flowNodeContentId,\n flowNodeIsMeaningful: false,\n fieldName: captureUserInputNode.content.field_name,\n userInput: this.textOrTranscript,\n captureSuccess,\n messageId: this.request.input.message_id,\n }\n const { action, ...eventArgs } = event\n await trackEvent(this.request, action, eventArgs)\n }\n}\n"],"names":["EventAction","axios","FlowCaptureUserInput","HtAiValidationType","getCommonFlowContentEventArgsForContentId","trackEvent","getFlowBuilderPlugin","inputHasTextOrTranscript","CaptureUserInputApi","captureUserInputNode","undefined","captureUserInput","aiCaptureResponse","url","process","data","pluginFlowBuilder","token","config","error","console","captureSuccess","flowThreadId","flowId","flowName","flowNodeId","flowNodeContentId","event","action","eventArgs","cmsApi","request","textOrTranscript"],"mappings":";;;;;;;;;;;;;;;AAAuE;AAE9C;AAG+B;AAIf;AAIrB;AACmD;AACd;AAalD,MAAMQ,mBAAmBA;IAe9B,MAAM,gBAA6C;QACjD,IACED,wBAAwBA,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,KAC3C,IAAI,CAAC,MAAM,CAAC,sBAAsB,IAClC;YACA,MAAME,uBAAuB,IAAI,CAAC,MAAM,CAAC,uBAAuB;YAChE,IAAI,CAACA,wBAAwB,CAAC,IAAI,CAAC,gBAAgB,EAAE;gBACnD,OAAOC;YACT;YACA,MAAMC,mBACJT,mCAAmC,CA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AI,CAAC,uCAAuCD;QACtD;QAEA,OAAO;YACL,SAAS;QACX;IACF;IAEA,MAAM,sBACJV,oBAA4C,EAC5CY,cAAuB,EACR;QACf,MAAM,EAAEC,YAAY,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,iBAAiB,EAAE,GACrEtB,yCAAyCA,CACvC,IAAI,CAAC,OAAO,EACZK,qBAAqB,EAAE;QAE3B,MAAMkB,QAA+B;YACnC,QAAQ3B,4BAA4B;YACpCsB;YACAC;YACAC;YACAC;YACAC;YACA,sBAAsB;YACtB,WAAWjB,qBAAqB,OAAO,CAAC,UAAU;YAClD,WAAW,IAAI,CAAC,gBAAgB;YAChCY;YACA,WAAW,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU;QAC1C;QACA,MAAM,EAAEO,MAAM,EAAE,GAAGC,WAAW,GAAGF;QACjC,MAAMtB,UAAUA,CAAC,IAAI,CAAC,OAAO,EAAEuB,QAAQC;IACzC;IA7GA,YACEC,MAAsB,EACtBC,OAAsB,EACtBC,gBAAwB,CACxB;QACA,IAAI,CAAC,MAAM,GAAGF;QACd,IAAI,CAAC,OAAO,GAAGC;QACf,IAAI,CAAC,gBAAgB,GAAGC;IAC1B;AAsGF"}
@@ -1,4 +1,4 @@
1
1
  import type { ActionRequest } from '@botonic/react';
2
- import type { FlowBuilderApi } from '../api';
3
- import { type SmartIntentsInferenceConfig } from './smart-intent';
2
+ import type { FlowBuilderApi } from '../api.js';
3
+ import { type SmartIntentsInferenceConfig } from './smart-intent.js';
4
4
  export declare function getNextPayloadByUserInput(cmsApi: FlowBuilderApi, locale: string, request: ActionRequest, smartIntentsConfig: SmartIntentsInferenceConfig): Promise<string | undefined>;
@@ -1,31 +1,37 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getNextPayloadByUserInput = getNextPayloadByUserInput;
4
- const input_1 = require("../utils/input");
5
- const capture_user_input_api_1 = require("./capture-user-input-api");
6
- const keyword_1 = require("./keyword");
7
- const smart_intent_1 = require("./smart-intent");
1
+ import { getTextOrTranscript, isKeywordsAllowed, isSmartIntentsAllowed } from "../utils/input.js";
2
+ import { CaptureUserInputApi } from "./capture-user-input-api.js";
3
+ import { KeywordMatcher } from "./keyword.js";
4
+ import { SmartIntentsApi } from "./smart-intent.js";
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
8
14
  async function getNextPayloadByUserInput(cmsApi, locale, request, smartIntentsConfig) {
9
- const userTextOrTranscript = (0, input_1.getTextOrTranscript)(request.input);
15
+ const userTextOrTranscript = getTextOrTranscript(request.input);
10
16
  if (userTextOrTranscript) {
11
17
  if (cmsApi.shouldCaptureUserInput()) {
12
- const captureUserInputApi = new capture_user_input_api_1.CaptureUserInputApi(cmsApi, request, userTextOrTranscript);
18
+ const captureUserInputApi = new CaptureUserInputApi(cmsApi, request, userTextOrTranscript);
13
19
  return await captureUserInputApi.getNextNodeId();
14
20
  }
15
- if ((0, input_1.isKeywordsAllowed)(request)) {
16
- const keywordMatcher = new keyword_1.KeywordMatcher({
21
+ if (isKeywordsAllowed(request)) {
22
+ const keywordMatcher = new KeywordMatcher({
17
23
  cmsApi,
18
24
  locale,
19
25
  request,
20
- userTextOrTranscript,
26
+ userTextOrTranscript
21
27
  });
22
28
  const keywordNode = await keywordMatcher.getNodeByInput();
23
29
  if (keywordNode) {
24
30
  return cmsApi.getPayload(keywordNode.target);
25
31
  }
26
32
  }
27
- if ((0, input_1.isSmartIntentsAllowed)(request)) {
28
- const smartIntentsApi = new smart_intent_1.SmartIntentsApi(cmsApi, request, smartIntentsConfig, userTextOrTranscript);
33
+ if (isSmartIntentsAllowed(request)) {
34
+ const smartIntentsApi = new SmartIntentsApi(cmsApi, request, smartIntentsConfig, userTextOrTranscript);
29
35
  const smartIntentNode = await smartIntentsApi.getNodeByInput();
30
36
  if (smartIntentNode) {
31
37
  return cmsApi.getPayload(smartIntentNode.target);
@@ -34,4 +40,7 @@ async function getNextPayloadByUserInput(cmsApi, locale, request, smartIntentsCo
34
40
  }
35
41
  return undefined;
36
42
  }
43
+
44
+ export { getNextPayloadByUserInput };
45
+
37
46
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/user-input/index.ts"],"names":[],"mappings":";;AAeA,8DA6CC;AAzDD,0CAIuB;AACvB,qEAA8D;AAC9D,uCAA0C;AAC1C,iDAGuB;AAEhB,KAAK,UAAU,yBAAyB,CAC7C,MAAsB,EACtB,MAAc,EACd,OAAsB,EACtB,kBAA+C;IAE/C,MAAM,oBAAoB,GAAG,IAAA,2BAAmB,EAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC/D,IAAI,oBAAoB,EAAE,CAAC;QACzB,IAAI,MAAM,CAAC,sBAAsB,EAAE,EAAE,CAAC;YACpC,MAAM,mBAAmB,GAAG,IAAI,4CAAmB,CACjD,MAAM,EACN,OAAO,EACP,oBAAoB,CACrB,CAAA;YACD,OAAO,MAAM,mBAAmB,CAAC,aAAa,EAAE,CAAA;QAClD,CAAC;QAED,IAAI,IAAA,yBAAiB,EAAC,OAAO,CAAC,EAAE,CAAC;YAC/B,MAAM,cAAc,GAAG,IAAI,wBAAc,CAAC;gBACxC,MAAM;gBACN,MAAM;gBACN,OAAO;gBACP,oBAAoB;aACrB,CAAC,CAAA;YACF,MAAM,WAAW,GAAG,MAAM,cAAc,CAAC,cAAc,EAAE,CAAA;YACzD,IAAI,WAAW,EAAE,CAAC;gBAChB,OAAO,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;YAC9C,CAAC;QACH,CAAC;QAED,IAAI,IAAA,6BAAqB,EAAC,OAAO,CAAC,EAAE,CAAC;YACnC,MAAM,eAAe,GAAG,IAAI,8BAAe,CACzC,MAAM,EACN,OAAO,EACP,kBAAkB,EAClB,oBAAoB,CACrB,CAAA;YACD,MAAM,eAAe,GAAG,MAAM,eAAe,CAAC,cAAc,EAAE,CAAA;YAC9D,IAAI,eAAe,EAAE,CAAC;gBACpB,OAAO,MAAM,CAAC,UAAU,CAAC,eAAe,CAAC,MAAM,CAAC,CAAA;YAClD,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAA;AAClB,CAAC"}
1
+ {"version":3,"file":"user-input/index.js","sources":["../../../src/user-input/index.ts"],"sourcesContent":["import type { ActionRequest } from '@botonic/react'\n\nimport type { FlowBuilderApi } from '../api'\nimport {\n getTextOrTranscript,\n isKeywordsAllowed,\n isSmartIntentsAllowed,\n} from '../utils/input'\nimport { CaptureUserInputApi } from './capture-user-input-api'\nimport { KeywordMatcher } from './keyword'\nimport {\n SmartIntentsApi,\n type SmartIntentsInferenceConfig,\n} from './smart-intent'\n\nexport async function getNextPayloadByUserInput(\n cmsApi: FlowBuilderApi,\n locale: string,\n request: ActionRequest,\n smartIntentsConfig: SmartIntentsInferenceConfig\n): Promise<string | undefined> {\n const userTextOrTranscript = getTextOrTranscript(request.input)\n if (userTextOrTranscript) {\n if (cmsApi.shouldCaptureUserInput()) {\n const captureUserInputApi = new CaptureUserInputApi(\n cmsApi,\n request,\n userTextOrTranscript\n )\n return await captureUserInputApi.getNextNodeId()\n }\n\n if (isKeywordsAllowed(request)) {\n const keywordMatcher = new KeywordMatcher({\n cmsApi,\n locale,\n request,\n userTextOrTranscript,\n })\n const keywordNode = await keywordMatcher.getNodeByInput()\n if (keywordNode) {\n return cmsApi.getPayload(keywordNode.target)\n }\n }\n\n if (isSmartIntentsAllowed(request)) {\n const smartIntentsApi = new SmartIntentsApi(\n cmsApi,\n request,\n smartIntentsConfig,\n userTextOrTranscript\n )\n const smartIntentNode = await smartIntentsApi.getNodeByInput()\n if (smartIntentNode) {\n return cmsApi.getPayload(smartIntentNode.target)\n }\n }\n }\n\n return undefined\n}\n"],"names":["getTextOrTranscript","isKeywordsAllowed","isSmartIntentsAllowed","CaptureUserInputApi","KeywordMatcher","SmartIntentsApi","getNextPayloadByUserInput","cmsApi","locale","request","smartIntentsConfig","userTextOrTranscript","captureUserInputApi","keywordMatcher","keywordNode","smartIntentsApi","smartIntentNode","undefined"],"mappings":";;;;;;;;;AAOuB;AACuC;AACpB;AAInB;AAEhB,eAAeM,yBAAyBA,CAC7CC,MAAsB,EACtBC,MAAc,EACdC,OAAsB,EACtBC,kBAA+C;IAE/C,MAAMC,uBAAuBX,mBAAmBA,CAACS,QAAQ,KAAK;IAC9D,IAAIE,sBAAsB;QACxB,IAAIJ,OAAO,sBAAsB,IAAI;YACnC,MAAMK,sBAAsB,IAAIT,mBAAmBA,CACjDI,QACAE,SACAE;YAEF,OAAO,MAAMC,oBAAoB,aAAa;QAChD;QAEA,IAAIX,iBAAiBA,CAACQ,UAAU;YAC9B,MAAMI,iBAAiB,IAAIT,cAAcA,CAAC;gBACxCG;gBACAC;gBACAC;gBACAE;YACF;YACA,MAAMG,cAAc,MAAMD,eAAe,cAAc;YACvD,IAAIC,aAAa;gBACf,OAAOP,OAAO,UAAU,CAACO,YAAY,MAAM;YAC7C;QACF;QAEA,IAAIZ,qBAAqBA,CAACO,UAAU;YAClC,MAAMM,kBAAkB,IAAIV,eAAeA,CACzCE,QACAE,SACAC,oBACAC;YAEF,MAAMK,kBAAkB,MAAMD,gBAAgB,cAAc;YAC5D,IAAIC,iBAAiB;gBACnB,OAAOT,OAAO,UAAU,CAACS,gBAAgB,MAAM;YACjD;QACF;IACF;IAEA,OAAOC;AACT"}
@@ -1,6 +1,6 @@
1
1
  import type { ActionRequest } from '@botonic/react';
2
- import type { FlowBuilderApi } from '../api';
3
- import type { HtKeywordNode } from '../content-fields/hubtype-fields';
2
+ import type { FlowBuilderApi } from '../api.js';
3
+ import type { HtKeywordNode } from '../content-fields/hubtype-fields/index.js';
4
4
  interface KeywordProps {
5
5
  cmsApi: FlowBuilderApi;
6
6
  locale: string;
@@ -1,17 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.KeywordMatcher = void 0;
4
- const core_1 = require("@botonic/core");
5
- const constants_1 = require("../constants");
6
- const tracking_1 = require("../tracking");
1
+ import { EventAction, NluType } from "@botonic/core";
2
+ import { REG_EXP_PATTERN } from "../constants.js";
3
+ import { getCommonFlowContentEventArgsForContentId, trackEvent } from "../tracking.js";
4
+
5
+
6
+
7
+
8
+
9
+
10
+
7
11
  class KeywordMatcher {
8
- constructor({ cmsApi, locale, request, userTextOrTranscript }) {
9
- this.cmsApi = cmsApi;
10
- this.locale = locale;
11
- this.request = request;
12
- this.isRegExp = false;
13
- this.userTextOrTranscript = userTextOrTranscript;
14
- }
15
12
  async getNodeByInput() {
16
13
  const keywordNodes = this.cmsApi.getKeywordNodes();
17
14
  const keywordNode = this.getNodeByKeyword(this.userTextOrTranscript, keywordNodes);
@@ -20,19 +17,19 @@ class KeywordMatcher {
20
17
  }
21
18
  const targetPayload = this.cmsApi.getPayload(keywordNode.target);
22
19
  this.request.input.nluResolution = {
23
- type: core_1.NluType.Keyword,
20
+ type: NluType.Keyword,
24
21
  matchedValue: this.matchedKeyword,
25
- payload: targetPayload,
22
+ payload: targetPayload
26
23
  };
27
24
  await this.trackKeywordEvent();
28
25
  return keywordNode;
29
26
  }
30
27
  getNodeByKeyword(userInput, keywordNodes) {
31
- const matchedKeywordNode = keywordNodes.find(node => this.matchKeywords(userInput, node));
28
+ const matchedKeywordNode = keywordNodes.find((node)=>this.matchKeywords(userInput, node));
32
29
  return matchedKeywordNode?.target ? matchedKeywordNode : undefined;
33
30
  }
34
31
  matchKeywords(userInput, node) {
35
- const result = node.content.keywords.find(keywords => {
32
+ const result = node.content.keywords.find((keywords)=>{
36
33
  if (keywords.locale === this.locale) {
37
34
  this.keywordNodeId = node.id;
38
35
  this.flowId = this.cmsApi.getNodeById(node.id).flow_id;
@@ -43,15 +40,14 @@ class KeywordMatcher {
43
40
  return Boolean(result);
44
41
  }
45
42
  inputMatchesAnyKeyword(userInput, keywords) {
46
- return keywords.some(keyword => {
47
- const regExpMatchArray = keyword.match(constants_1.REG_EXP_PATTERN);
43
+ return keywords.some((keyword)=>{
44
+ const regExpMatchArray = keyword.match(REG_EXP_PATTERN);
48
45
  if (regExpMatchArray) {
49
46
  const keywordAsRegExp = this.resolveKeywordAsRegExp(regExpMatchArray);
50
47
  const match = userInput.match(keywordAsRegExp);
51
48
  this.isRegExp = true;
52
49
  this.matchedKeyword = match ? match[0] : undefined;
53
- }
54
- else {
50
+ } else {
55
51
  this.isRegExp = false;
56
52
  this.matchedKeyword = userInput.includes(keyword) ? keyword : undefined;
57
53
  }
@@ -63,9 +59,9 @@ class KeywordMatcher {
63
59
  return new RegExp(pattern, flags);
64
60
  }
65
61
  async trackKeywordEvent() {
66
- const { flowId, flowName, flowNodeId, flowNodeContentId } = (0, tracking_1.getCommonFlowContentEventArgsForContentId)(this.request, this.keywordNodeId);
62
+ const { flowId, flowName, flowNodeId, flowNodeContentId } = getCommonFlowContentEventArgsForContentId(this.request, this.keywordNodeId);
67
63
  const event = {
68
- action: core_1.EventAction.Keyword,
64
+ action: EventAction.Keyword,
69
65
  flowNodeId,
70
66
  flowId,
71
67
  flowName,
@@ -74,11 +70,20 @@ class KeywordMatcher {
74
70
  nluKeywordName: this.matchedKeyword,
75
71
  nluKeywordIsRegex: this.isRegExp,
76
72
  nluKeywordMessageId: this.request.input.message_id,
77
- userInput: this.userTextOrTranscript,
73
+ userInput: this.userTextOrTranscript
78
74
  };
79
75
  const { action, ...eventArgs } = event;
80
- await (0, tracking_1.trackEvent)(this.request, action, eventArgs);
76
+ await trackEvent(this.request, action, eventArgs);
77
+ }
78
+ constructor({ cmsApi, locale, request, userTextOrTranscript }){
79
+ this.cmsApi = cmsApi;
80
+ this.locale = locale;
81
+ this.request = request;
82
+ this.isRegExp = false;
83
+ this.userTextOrTranscript = userTextOrTranscript;
81
84
  }
82
85
  }
83
- exports.KeywordMatcher = KeywordMatcher;
86
+
87
+ export { KeywordMatcher };
88
+
84
89
  //# sourceMappingURL=keyword.js.map
@@ -1 +1 @@
1
- {"version":3,"file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AAc,GAAG,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAA;YACzE,CAAC;YAED,OAAO,IAAI,CAAC,cAAc,KAAK,SAAS,CAAA;QAC1C,CAAC,CAAC,CAAA;IACJ,CAAC;IAEO,sBAAsB,CAAC,gBAAkC;QAC/D,MAAM,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,GAAG,gBAAgB,CAAA;QAC3C,OAAO,IAAI,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;IACnC,CAAC;IAEO,KAAK,CAAC,iBAAiB;QAC7B,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,iBAAiB,EAAE,GACvD,IAAA,oDAAyC,EACvC,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,aAAuB,CAC7B,CAAA;QAEH,MAAM,KAAK,GAAiB;YAC1B,MAAM,EAAE,kBAAW,CAAC,OAAO;YAC3B,UAAU;YACV,MAAM;YACN,QAAQ;YACR,iBAAiB;YACjB,YAAY,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,cAAwB;YAC3D,cAAc,EAAE,IAAI,CAAC,cAAwB;YAC7C,iBAAiB,EAAE,IAAI,CAAC,QAAQ;YAChC,mBAAmB,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU;YAClD,SAAS,EAAE,IAAI,CAAC,oBAAoB;SACrC,CAAA;QACD,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAA;QACtC,MAAM,IAAA,qBAAU,EAAC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,CAAA;IACnD,CAAC;CACF;AAjHD,wCAiHC"}
1
+ {"version":3,"file":"user-input/keyword.js","sources":["../../../src/user-input/keyword.ts"],"sourcesContent":["import { EventAction, type EventKeyword, NluType } from '@botonic/core'\nimport type { ActionRequest } from '@botonic/react'\n\nimport type { FlowBuilderApi } from '../api'\nimport { REG_EXP_PATTERN } from '../constants'\nimport type {\n HtKeywordNode,\n HtNodeWithContent,\n} from '../content-fields/hubtype-fields'\nimport {\n getCommonFlowContentEventArgsForContentId,\n trackEvent,\n} from '../tracking'\n\ninterface KeywordProps {\n cmsApi: FlowBuilderApi\n locale: string\n request: ActionRequest\n userTextOrTranscript: string\n}\nexport class KeywordMatcher {\n public cmsApi: FlowBuilderApi\n public locale: string\n public request: ActionRequest\n public isRegExp: boolean\n public matchedKeyword?: string\n public keywordNodeId?: string\n public flowId?: string\n public userTextOrTranscript: string\n\n constructor({ cmsApi, locale, request, userTextOrTranscript }: KeywordProps) {\n this.cmsApi = cmsApi\n this.locale = locale\n this.request = request\n this.isRegExp = false\n this.userTextOrTranscript = userTextOrTranscript\n }\n\n async getNodeByInput(): Promise<HtKeywordNode | undefined> {\n const keywordNodes = this.cmsApi.getKeywordNodes()\n const keywordNode = this.getNodeByKeyword(\n this.userTextOrTranscript,\n keywordNodes\n )\n if (!keywordNode || !this.matchedKeyword) {\n return undefined\n }\n const targetPayload = this.cmsApi.getPayload(keywordNode.target)\n\n this.request.input.nluResolution = {\n type: NluType.Keyword,\n matchedValue: this.matchedKeyword,\n payload: targetPayload,\n }\n await this.trackKeywordEvent()\n return keywordNode\n }\n\n private getNodeByKeyword(\n userInput: string,\n keywordNodes: HtKeywordNode[]\n ): HtKeywordNode | undefined {\n const matchedKeywordNode = keywordNodes.find(node =>\n this.matchKeywords(userInput, node)\n )\n\n return matchedKeywordNode?.target ? matchedKeywordNode : undefined\n }\n\n private matchKeywords(userInput: string, node: HtKeywordNode): boolean {\n const result = node.content.keywords.find(keywords => {\n if (keywords.locale === this.locale) {\n this.keywordNodeId = node.id\n this.flowId = this.cmsApi.getNodeById<HtNodeWithContent>(\n node.id\n ).flow_id\n return this.inputMatchesAnyKeyword(userInput, keywords.values)\n }\n\n return false\n })\n\n return Boolean(result)\n }\n\n private inputMatchesAnyKeyword(\n userInput: string,\n keywords: string[]\n ): boolean {\n return keywords.some(keyword => {\n const regExpMatchArray = keyword.match(REG_EXP_PATTERN)\n\n if (regExpMatchArray) {\n const keywordAsRegExp = this.resolveKeywordAsRegExp(regExpMatchArray)\n const match = userInput.match(keywordAsRegExp)\n this.isRegExp = true\n this.matchedKeyword = match ? match[0] : undefined\n } else {\n this.isRegExp = false\n this.matchedKeyword = userInput.includes(keyword) ? keyword : undefined\n }\n\n return this.matchedKeyword !== undefined\n })\n }\n\n private resolveKeywordAsRegExp(regExpMatchArray: RegExpMatchArray): RegExp {\n const [, pattern, flags] = regExpMatchArray\n return new RegExp(pattern, flags)\n }\n\n private async trackKeywordEvent() {\n const { flowId, flowName, flowNodeId, flowNodeContentId } =\n getCommonFlowContentEventArgsForContentId(\n this.request,\n this.keywordNodeId as string\n )\n\n const event: EventKeyword = {\n action: EventAction.Keyword,\n flowNodeId,\n flowId,\n flowName,\n flowNodeContentId,\n flowThreadId: this.request.session.flow_thread_id as string,\n nluKeywordName: this.matchedKeyword as string,\n nluKeywordIsRegex: this.isRegExp,\n nluKeywordMessageId: this.request.input.message_id,\n userInput: this.userTextOrTranscript,\n }\n const { action, ...eventArgs } = event\n await trackEvent(this.request, action, eventArgs)\n }\n}\n"],"names":["EventAction","NluType","REG_EXP_PATTERN","getCommonFlowContentEventArgsForContentId","trackEvent","KeywordMatcher","keywordNodes","keywordNode","undefined","targetPayload","userInput","matchedKeywordNode","node","result","keywords","Boolean","keyword","regExpMatchArray","keywordAsRegExp","match","pattern","flags","RegExp","flowId","flowName","flowNodeId","flowNodeContentId","event","action","eventArgs","cmsApi","locale","request","userTextOrTranscript"],"mappings":";;;;;;;AAAuE;AAIzB;AAQ1B;AAQb,MAAMK,cAAcA;IAkBzB,MAAM,iBAAqD;QACzD,MAAMC,eAAe,IAAI,CAAC,MAAM,CAAC,eAAe;QAChD,MAAMC,cAAc,IAAI,CAAC,gBAAgB,CACvC,IAAI,CAAC,oBAAoB,EACzBD;QAEF,IAAI,C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C,OAAO;gBACL,IAAI,CAAC,QAAQ,GAAG;gBAChB,IAAI,CAAC,cAAc,GAAGE,UAAU,QAAQ,CAACM,WAAWA,UAAUR;YAChE;YAEA,OAAO,IAAI,CAAC,cAAc,KAAKA;QACjC;IACF;IAEQ,uBAAuBS,gBAAkC,EAAU;QACzE,MAAM,GAAGG,SAASC,MAAM,GAAGJ;QAC3B,OAAO,IAAIK,OAAOF,SAASC;IAC7B;IAEA,MAAc,oBAAoB;QAChC,MAAM,EAAEE,MAAM,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,iBAAiB,EAAE,GACvDvB,yCAAyCA,CACvC,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,aAAa;QAGtB,MAAMwB,QAAsB;YAC1B,QAAQ3B,mBAAmB;YAC3ByB;YACAF;YACAC;YACAE;YACA,cAAc,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,cAAc;YACjD,gBAAgB,IAAI,CAAC,cAAc;YACnC,mBAAmB,IAAI,CAAC,QAAQ;YAChC,qBAAqB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU;YAClD,WAAW,IAAI,CAAC,oBAAoB;QACtC;QACA,MAAM,EAAEE,MAAM,EAAE,GAAGC,WAAW,GAAGF;QACjC,MAAMvB,UAAUA,CAAC,IAAI,CAAC,OAAO,EAAEwB,QAAQC;IACzC;IAtGA,YAAY,EAAEC,MAAM,EAAEC,MAAM,EAAEC,OAAO,EAAEC,oBAAoB,EAAgB,CAAE;QAC3E,IAAI,CAAC,MAAM,GAAGH;QACd,IAAI,CAAC,MAAM,GAAGC;QACd,IAAI,CAAC,OAAO,GAAGC;QACf,IAAI,CAAC,QAAQ,GAAG;QAChB,IAAI,CAAC,oBAAoB,GAAGC;IAC9B;AAiGF"}
@@ -1,6 +1,6 @@
1
1
  import type { ActionRequest } from '@botonic/react';
2
- import type { FlowBuilderApi } from '../api';
3
- import type { HtSmartIntentNode } from '../content-fields/hubtype-fields/smart-intent';
2
+ import type { FlowBuilderApi } from '../api.js';
3
+ import type { HtSmartIntentNode } from '../content-fields/hubtype-fields/smart-intent.js';
4
4
  export interface SmartIntentsInferenceParams {
5
5
  bot_id: string;
6
6
  text: string;