@botonic/plugin-flow-builder 0.58.0-alpha-new-stack.0 → 0.58.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (923) hide show
  1. package/README.md +1 -1
  2. package/lib/cjs/action/ai-agent-from-user-input.d.ts +3 -0
  3. package/lib/cjs/action/ai-agent-from-user-input.js +38 -0
  4. package/lib/cjs/action/ai-agent-from-user-input.js.map +1 -0
  5. package/lib/cjs/action/context.d.ts +11 -0
  6. package/lib/cjs/action/context.js +17 -0
  7. package/lib/cjs/action/context.js.map +1 -0
  8. package/lib/cjs/action/fallback.d.ts +3 -0
  9. package/lib/cjs/action/fallback.js +36 -0
  10. package/lib/cjs/action/fallback.js.map +1 -0
  11. package/lib/cjs/action/first-interaction.d.ts +3 -0
  12. package/lib/cjs/action/first-interaction.js +93 -0
  13. package/lib/cjs/action/first-interaction.js.map +1 -0
  14. package/lib/cjs/action/get-contents.d.ts +3 -0
  15. package/lib/cjs/action/get-contents.js +44 -0
  16. package/lib/cjs/action/get-contents.js.map +1 -0
  17. package/lib/cjs/action/index.d.ts +25 -0
  18. package/lib/cjs/action/index.js +95 -0
  19. package/lib/cjs/action/index.js.map +1 -0
  20. package/lib/cjs/action/payload.d.ts +3 -0
  21. package/lib/cjs/action/payload.js +74 -0
  22. package/lib/cjs/action/payload.js.map +1 -0
  23. package/lib/cjs/api.d.ts +45 -0
  24. package/lib/cjs/api.js +227 -0
  25. package/lib/cjs/api.js.map +1 -0
  26. package/lib/cjs/bot-context-manager.d.ts +17 -0
  27. package/lib/cjs/bot-context-manager.js +93 -0
  28. package/lib/cjs/bot-context-manager.js.map +1 -0
  29. package/lib/cjs/constants.js +20 -0
  30. package/lib/cjs/constants.js.map +1 -0
  31. package/lib/cjs/content-fields/contact-reasons-conditional-matcher.d.ts +4 -0
  32. package/lib/cjs/content-fields/contact-reasons-conditional-matcher.js +12 -0
  33. package/lib/cjs/content-fields/contact-reasons-conditional-matcher.js.map +1 -0
  34. package/lib/cjs/content-fields/content-fields-base.d.ts +20 -0
  35. package/lib/cjs/content-fields/content-fields-base.js +74 -0
  36. package/lib/cjs/content-fields/content-fields-base.js.map +1 -0
  37. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.d.ts +15 -0
  38. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +71 -0
  39. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +1 -0
  40. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.d.ts +9 -0
  41. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.js +58 -0
  42. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +1 -0
  43. package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.d.ts +17 -0
  44. package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.js +79 -0
  45. package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.js.map +1 -0
  46. package/lib/cjs/content-fields/flow-ai-agent-base.d.ts +25 -0
  47. package/lib/cjs/content-fields/flow-ai-agent-base.js +97 -0
  48. package/lib/cjs/content-fields/flow-ai-agent-base.js.map +1 -0
  49. package/lib/cjs/content-fields/flow-ai-agent-router.d.ts +21 -0
  50. package/lib/cjs/content-fields/flow-ai-agent-router.js +126 -0
  51. package/lib/cjs/content-fields/flow-ai-agent-router.js.map +1 -0
  52. package/lib/cjs/content-fields/flow-ai-agent.d.ts +17 -0
  53. package/lib/cjs/content-fields/flow-ai-agent.js +65 -0
  54. package/lib/cjs/content-fields/flow-ai-agent.js.map +1 -0
  55. package/lib/cjs/content-fields/flow-bot-action.d.ts +14 -0
  56. package/lib/cjs/content-fields/flow-bot-action.js +45 -0
  57. package/lib/cjs/content-fields/flow-bot-action.js.map +1 -0
  58. package/lib/cjs/content-fields/flow-button.d.ts +31 -0
  59. package/lib/cjs/content-fields/flow-button.js +86 -0
  60. package/lib/cjs/content-fields/flow-button.js.map +1 -0
  61. package/lib/cjs/content-fields/flow-capture-user-input.d.ts +14 -0
  62. package/lib/cjs/content-fields/flow-capture-user-input.js +45 -0
  63. package/lib/cjs/content-fields/flow-capture-user-input.js.map +1 -0
  64. package/lib/cjs/content-fields/flow-carousel.d.ts +22 -0
  65. package/lib/cjs/content-fields/flow-carousel.js +152 -0
  66. package/lib/cjs/content-fields/flow-carousel.js.map +1 -0
  67. package/lib/cjs/content-fields/flow-channel-conditional.d.ts +14 -0
  68. package/lib/cjs/content-fields/flow-channel-conditional.js +57 -0
  69. package/lib/cjs/content-fields/flow-channel-conditional.js.map +1 -0
  70. package/lib/cjs/content-fields/flow-contact-reasons-conditional.d.ts +17 -0
  71. package/lib/cjs/content-fields/flow-contact-reasons-conditional.js +88 -0
  72. package/lib/cjs/content-fields/flow-contact-reasons-conditional.js.map +1 -0
  73. package/lib/cjs/content-fields/flow-country-conditional.d.ts +13 -0
  74. package/lib/cjs/content-fields/flow-country-conditional.js +59 -0
  75. package/lib/cjs/content-fields/flow-country-conditional.js.map +1 -0
  76. package/lib/cjs/content-fields/flow-custom-conditional.d.ts +17 -0
  77. package/lib/cjs/content-fields/flow-custom-conditional.js +89 -0
  78. package/lib/cjs/content-fields/flow-custom-conditional.js.map +1 -0
  79. package/lib/cjs/content-fields/flow-do-nothing.d.ts +9 -0
  80. package/lib/cjs/content-fields/flow-do-nothing.js +27 -0
  81. package/lib/cjs/content-fields/flow-do-nothing.js.map +1 -0
  82. package/lib/cjs/content-fields/flow-element.d.ts +22 -0
  83. package/lib/cjs/content-fields/flow-element.js +50 -0
  84. package/lib/cjs/content-fields/flow-element.js.map +1 -0
  85. package/lib/cjs/content-fields/flow-go-to-flow.d.ts +13 -0
  86. package/lib/cjs/content-fields/flow-go-to-flow.js +51 -0
  87. package/lib/cjs/content-fields/flow-go-to-flow.js.map +1 -0
  88. package/lib/cjs/content-fields/flow-handoff.d.ts +23 -0
  89. package/lib/cjs/content-fields/flow-handoff.js +104 -0
  90. package/lib/cjs/content-fields/flow-handoff.js.map +1 -0
  91. package/lib/cjs/content-fields/flow-image.d.ts +10 -0
  92. package/lib/cjs/content-fields/flow-image.js +33 -0
  93. package/lib/cjs/content-fields/flow-image.js.map +1 -0
  94. package/lib/cjs/content-fields/flow-queue-status-conditional.d.ts +30 -0
  95. package/lib/cjs/content-fields/flow-queue-status-conditional.js +95 -0
  96. package/lib/cjs/content-fields/flow-queue-status-conditional.js.map +1 -0
  97. package/lib/cjs/content-fields/flow-rating.d.ts +15 -0
  98. package/lib/cjs/content-fields/flow-rating.js +66 -0
  99. package/lib/cjs/content-fields/flow-rating.js.map +1 -0
  100. package/lib/cjs/content-fields/flow-text.d.ts +15 -0
  101. package/lib/cjs/content-fields/flow-text.js +60 -0
  102. package/lib/cjs/content-fields/flow-text.js.map +1 -0
  103. package/lib/cjs/content-fields/flow-update-variables.d.ts +15 -0
  104. package/lib/cjs/content-fields/flow-update-variables.js +137 -0
  105. package/lib/cjs/content-fields/flow-update-variables.js.map +1 -0
  106. package/lib/cjs/content-fields/flow-video.d.ts +10 -0
  107. package/lib/cjs/content-fields/flow-video.js +33 -0
  108. package/lib/cjs/content-fields/flow-video.js.map +1 -0
  109. package/lib/cjs/content-fields/flow-webview.d.ts +16 -0
  110. package/lib/cjs/content-fields/flow-webview.js +78 -0
  111. package/lib/cjs/content-fields/flow-webview.js.map +1 -0
  112. package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.d.ts +21 -0
  113. package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js +92 -0
  114. package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js.map +1 -0
  115. package/lib/cjs/content-fields/flow-whatsapp-request-contact-info.d.ts +11 -0
  116. package/lib/cjs/content-fields/flow-whatsapp-request-contact-info.js +46 -0
  117. package/lib/cjs/content-fields/flow-whatsapp-request-contact-info.js.map +1 -0
  118. package/lib/cjs/content-fields/flow-whatsapp-template.d.ts +37 -0
  119. package/lib/cjs/content-fields/flow-whatsapp-template.js +264 -0
  120. package/lib/cjs/content-fields/flow-whatsapp-template.js.map +1 -0
  121. package/lib/cjs/content-fields/hubtype-fields/ai-agent-router.d.ts +21 -0
  122. package/lib/cjs/content-fields/hubtype-fields/ai-agent-router.js +3 -0
  123. package/lib/cjs/content-fields/hubtype-fields/ai-agent-router.js.map +1 -0
  124. package/lib/cjs/content-fields/hubtype-fields/ai-agent.d.ts +25 -0
  125. package/lib/cjs/content-fields/hubtype-fields/ai-agent.js +3 -0
  126. package/lib/cjs/content-fields/hubtype-fields/ai-agent.js.map +1 -0
  127. package/lib/cjs/content-fields/hubtype-fields/bot-action.d.ts +10 -0
  128. package/lib/cjs/content-fields/hubtype-fields/bot-action.js +3 -0
  129. package/lib/cjs/content-fields/hubtype-fields/bot-action.js.map +1 -0
  130. package/lib/cjs/content-fields/hubtype-fields/button.d.ts +8 -0
  131. package/lib/cjs/content-fields/hubtype-fields/button.js +3 -0
  132. package/lib/cjs/content-fields/hubtype-fields/button.js.map +1 -0
  133. package/lib/cjs/content-fields/hubtype-fields/capture-user-input.d.ts +19 -0
  134. package/lib/cjs/content-fields/hubtype-fields/capture-user-input.js +12 -0
  135. package/lib/cjs/content-fields/hubtype-fields/capture-user-input.js.map +1 -0
  136. package/lib/cjs/content-fields/hubtype-fields/carousel.d.ts +17 -0
  137. package/lib/cjs/content-fields/hubtype-fields/carousel.js +3 -0
  138. package/lib/cjs/content-fields/hubtype-fields/carousel.js.map +1 -0
  139. package/lib/cjs/content-fields/hubtype-fields/channel-conditional.d.ts +10 -0
  140. package/lib/cjs/content-fields/hubtype-fields/channel-conditional.js +3 -0
  141. package/lib/cjs/content-fields/hubtype-fields/channel-conditional.js.map +1 -0
  142. package/lib/cjs/content-fields/hubtype-fields/common.d.ts +83 -0
  143. package/lib/cjs/content-fields/hubtype-fields/common.js +3 -0
  144. package/lib/cjs/content-fields/hubtype-fields/common.js.map +1 -0
  145. package/lib/cjs/content-fields/hubtype-fields/contact-reasons-conditional.d.ts +19 -0
  146. package/lib/cjs/content-fields/hubtype-fields/contact-reasons-conditional.js +3 -0
  147. package/lib/cjs/content-fields/hubtype-fields/contact-reasons-conditional.js.map +1 -0
  148. package/lib/cjs/content-fields/hubtype-fields/country-conditional.d.ts +10 -0
  149. package/lib/cjs/content-fields/hubtype-fields/country-conditional.js +3 -0
  150. package/lib/cjs/content-fields/hubtype-fields/country-conditional.js.map +1 -0
  151. package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.d.ts +56 -0
  152. package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.js +36 -0
  153. package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.js.map +1 -0
  154. package/lib/cjs/content-fields/hubtype-fields/custom-conditional.d.ts +11 -0
  155. package/lib/cjs/content-fields/hubtype-fields/custom-conditional.js +3 -0
  156. package/lib/cjs/content-fields/hubtype-fields/custom-conditional.js.map +1 -0
  157. package/lib/cjs/content-fields/hubtype-fields/do-nothing.d.ts +6 -0
  158. package/lib/cjs/content-fields/hubtype-fields/do-nothing.js +3 -0
  159. package/lib/cjs/content-fields/hubtype-fields/do-nothing.js.map +1 -0
  160. package/lib/cjs/content-fields/hubtype-fields/fallback.d.ts +9 -0
  161. package/lib/cjs/content-fields/hubtype-fields/fallback.js +3 -0
  162. package/lib/cjs/content-fields/hubtype-fields/fallback.js.map +1 -0
  163. package/lib/cjs/content-fields/hubtype-fields/function.d.ts +30 -0
  164. package/lib/cjs/content-fields/hubtype-fields/function.js +11 -0
  165. package/lib/cjs/content-fields/hubtype-fields/function.js.map +1 -0
  166. package/lib/cjs/content-fields/hubtype-fields/go-to-flow.d.ts +9 -0
  167. package/lib/cjs/content-fields/hubtype-fields/go-to-flow.js +3 -0
  168. package/lib/cjs/content-fields/hubtype-fields/go-to-flow.js.map +1 -0
  169. package/lib/cjs/content-fields/hubtype-fields/handoff.d.ts +21 -0
  170. package/lib/cjs/content-fields/hubtype-fields/handoff.js +10 -0
  171. package/lib/cjs/content-fields/hubtype-fields/handoff.js.map +1 -0
  172. package/lib/cjs/content-fields/hubtype-fields/image.d.ts +8 -0
  173. package/lib/cjs/content-fields/hubtype-fields/image.js +3 -0
  174. package/lib/cjs/content-fields/hubtype-fields/image.js.map +1 -0
  175. package/lib/cjs/content-fields/hubtype-fields/index.d.ts +28 -0
  176. package/lib/cjs/content-fields/hubtype-fields/index.js +32 -0
  177. package/lib/cjs/content-fields/hubtype-fields/index.js.map +1 -0
  178. package/lib/cjs/content-fields/hubtype-fields/keyword.d.ts +9 -0
  179. package/lib/cjs/content-fields/hubtype-fields/keyword.js +3 -0
  180. package/lib/cjs/content-fields/hubtype-fields/keyword.js.map +1 -0
  181. package/lib/cjs/content-fields/hubtype-fields/node-types.d.ts +34 -0
  182. package/lib/cjs/content-fields/hubtype-fields/node-types.js +41 -0
  183. package/lib/cjs/content-fields/hubtype-fields/node-types.js.map +1 -0
  184. package/lib/cjs/content-fields/hubtype-fields/nodes.d.ts +29 -0
  185. package/lib/cjs/content-fields/hubtype-fields/nodes.js +3 -0
  186. package/lib/cjs/content-fields/hubtype-fields/nodes.js.map +1 -0
  187. package/lib/cjs/content-fields/hubtype-fields/payload.d.ts +8 -0
  188. package/lib/cjs/content-fields/hubtype-fields/payload.js +3 -0
  189. package/lib/cjs/content-fields/hubtype-fields/payload.js.map +1 -0
  190. package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.d.ts +25 -0
  191. package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.js +3 -0
  192. package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.js.map +1 -0
  193. package/lib/cjs/content-fields/hubtype-fields/rating.d.ts +23 -0
  194. package/lib/cjs/content-fields/hubtype-fields/rating.js +9 -0
  195. package/lib/cjs/content-fields/hubtype-fields/rating.js.map +1 -0
  196. package/lib/cjs/content-fields/hubtype-fields/smart-intent.d.ts +12 -0
  197. package/lib/cjs/content-fields/hubtype-fields/smart-intent.js +3 -0
  198. package/lib/cjs/content-fields/hubtype-fields/smart-intent.js.map +1 -0
  199. package/lib/cjs/content-fields/hubtype-fields/text.d.ts +11 -0
  200. package/lib/cjs/content-fields/hubtype-fields/text.js +3 -0
  201. package/lib/cjs/content-fields/hubtype-fields/text.js.map +1 -0
  202. package/lib/cjs/content-fields/hubtype-fields/update-variables.d.ts +9 -0
  203. package/lib/cjs/content-fields/hubtype-fields/update-variables.js +3 -0
  204. package/lib/cjs/content-fields/hubtype-fields/update-variables.js.map +1 -0
  205. package/lib/cjs/content-fields/hubtype-fields/url.d.ts +8 -0
  206. package/lib/cjs/content-fields/hubtype-fields/url.js +3 -0
  207. package/lib/cjs/content-fields/hubtype-fields/url.js.map +1 -0
  208. package/lib/cjs/content-fields/hubtype-fields/video.d.ts +8 -0
  209. package/lib/cjs/content-fields/hubtype-fields/video.js +3 -0
  210. package/lib/cjs/content-fields/hubtype-fields/video.js.map +1 -0
  211. package/lib/cjs/content-fields/hubtype-fields/webview.d.ts +17 -0
  212. package/lib/cjs/content-fields/hubtype-fields/webview.js +3 -0
  213. package/lib/cjs/content-fields/hubtype-fields/webview.js.map +1 -0
  214. package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.d.ts +21 -0
  215. package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.js +3 -0
  216. package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.js.map +1 -0
  217. package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.d.ts +17 -0
  218. package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.js +3 -0
  219. package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +1 -0
  220. package/lib/cjs/content-fields/hubtype-fields/whatsapp-request-contact-info.d.ts +10 -0
  221. package/lib/cjs/content-fields/hubtype-fields/whatsapp-request-contact-info.js +3 -0
  222. package/lib/cjs/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +1 -0
  223. package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.d.ts +96 -0
  224. package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.js +9 -0
  225. package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.js.map +1 -0
  226. package/lib/cjs/content-fields/index.d.ts +28 -0
  227. package/lib/cjs/content-fields/index.js +58 -0
  228. package/lib/cjs/content-fields/index.js.map +1 -0
  229. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +14 -0
  230. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +41 -0
  231. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +1 -0
  232. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +13 -0
  233. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +36 -0
  234. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +1 -0
  235. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +14 -0
  236. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +46 -0
  237. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +1 -0
  238. package/lib/cjs/content-fields/whatsapp-button-list/index.d.ts +3 -0
  239. package/lib/cjs/content-fields/whatsapp-button-list/index.js +10 -0
  240. package/lib/cjs/content-fields/whatsapp-button-list/index.js.map +1 -0
  241. package/lib/cjs/filters/index.d.ts +12 -0
  242. package/lib/cjs/filters/index.js +17 -0
  243. package/lib/cjs/filters/index.js.map +1 -0
  244. package/lib/cjs/flow-factory.d.ts +12 -0
  245. package/lib/cjs/flow-factory.js +75 -0
  246. package/lib/cjs/flow-factory.js.map +1 -0
  247. package/lib/cjs/functions/index.d.ts +11 -0
  248. package/lib/cjs/functions/index.js +49 -0
  249. package/lib/cjs/functions/index.js.map +1 -0
  250. package/lib/cjs/index.d.ts +42 -0
  251. package/lib/cjs/index.js +142 -0
  252. package/lib/cjs/index.js.map +1 -0
  253. package/lib/cjs/services/contact-info-fields-api.d.ts +7 -0
  254. package/lib/cjs/services/contact-info-fields-api.js +28 -0
  255. package/lib/cjs/services/contact-info-fields-api.js.map +1 -0
  256. package/lib/cjs/services/hubtype-queues-api.js +26 -0
  257. package/lib/cjs/services/hubtype-queues-api.js.map +1 -0
  258. package/lib/cjs/structured-output/flow-builder-content.js +15 -0
  259. package/lib/cjs/structured-output/flow-builder-content.js.map +1 -0
  260. package/lib/cjs/tracking.d.ts +16 -0
  261. package/lib/cjs/tracking.js +71 -0
  262. package/lib/cjs/tracking.js.map +1 -0
  263. package/lib/cjs/types.d.ts +62 -0
  264. package/lib/cjs/types.js +14 -0
  265. package/lib/cjs/types.js.map +1 -0
  266. package/lib/cjs/user-input/capture-user-input-api.d.ts +21 -0
  267. package/lib/cjs/user-input/capture-user-input-api.js +88 -0
  268. package/lib/cjs/user-input/capture-user-input-api.js.map +1 -0
  269. package/lib/cjs/user-input/index.d.ts +4 -0
  270. package/lib/cjs/user-input/index.js +37 -0
  271. package/lib/cjs/user-input/index.js.map +1 -0
  272. package/lib/cjs/user-input/keyword.d.ts +27 -0
  273. package/lib/cjs/user-input/keyword.js +84 -0
  274. package/lib/cjs/user-input/keyword.js.map +1 -0
  275. package/lib/cjs/user-input/smart-intent.d.ts +24 -0
  276. package/lib/cjs/user-input/smart-intent.js +89 -0
  277. package/lib/cjs/user-input/smart-intent.js.map +1 -0
  278. package/lib/cjs/utils/ai-agent.d.ts +11 -0
  279. package/lib/cjs/utils/ai-agent.js +28 -0
  280. package/lib/cjs/utils/ai-agent.js.map +1 -0
  281. package/lib/cjs/utils/authentication.js +21 -0
  282. package/lib/cjs/utils/authentication.js.map +1 -0
  283. package/lib/cjs/utils/flow-locale.js +79 -0
  284. package/lib/cjs/utils/flow-locale.js.map +1 -0
  285. package/lib/cjs/utils/get-flow-builder-plugin.d.ts +3 -0
  286. package/lib/cjs/utils/get-flow-builder-plugin.js +16 -0
  287. package/lib/cjs/utils/get-flow-builder-plugin.js.map +1 -0
  288. package/lib/cjs/utils/hubtype-assistant-content.d.ts +13 -0
  289. package/lib/cjs/utils/hubtype-assistant-content.js +184 -0
  290. package/lib/cjs/utils/hubtype-assistant-content.js.map +1 -0
  291. package/lib/cjs/utils/input.js +35 -0
  292. package/lib/cjs/utils/input.js.map +1 -0
  293. package/lib/cjs/webview/contents-context.d.ts +2 -0
  294. package/lib/cjs/webview/contents-context.js +12 -0
  295. package/lib/cjs/webview/contents-context.js.map +1 -0
  296. package/lib/cjs/webview/index.d.ts +3 -0
  297. package/lib/cjs/webview/index.js +10 -0
  298. package/lib/cjs/webview/index.js.map +1 -0
  299. package/lib/cjs/webview/types.d.ts +47 -0
  300. package/lib/cjs/webview/types.js +9 -0
  301. package/lib/cjs/webview/types.js.map +1 -0
  302. package/lib/cjs/webview/use-webview-contents.d.ts +2 -0
  303. package/lib/cjs/webview/use-webview-contents.js +83 -0
  304. package/lib/cjs/webview/use-webview-contents.js.map +1 -0
  305. package/lib/esm/action/ai-agent-from-user-input.d.ts +3 -0
  306. package/lib/esm/action/ai-agent-from-user-input.js +38 -0
  307. package/lib/esm/action/ai-agent-from-user-input.js.map +1 -0
  308. package/lib/esm/action/context.d.ts +11 -0
  309. package/lib/esm/action/context.js +17 -0
  310. package/lib/esm/action/context.js.map +1 -0
  311. package/lib/esm/action/fallback.d.ts +3 -0
  312. package/lib/esm/action/fallback.js +36 -0
  313. package/lib/esm/action/fallback.js.map +1 -0
  314. package/lib/esm/action/first-interaction.d.ts +3 -0
  315. package/lib/esm/action/first-interaction.js +93 -0
  316. package/lib/esm/action/first-interaction.js.map +1 -0
  317. package/lib/esm/action/get-contents.d.ts +3 -0
  318. package/lib/esm/action/get-contents.js +44 -0
  319. package/lib/esm/action/get-contents.js.map +1 -0
  320. package/lib/esm/action/index.d.ts +25 -0
  321. package/lib/esm/action/index.js +95 -0
  322. package/lib/esm/action/index.js.map +1 -0
  323. package/lib/esm/action/payload.d.ts +3 -0
  324. package/lib/esm/action/payload.js +74 -0
  325. package/lib/esm/action/payload.js.map +1 -0
  326. package/lib/esm/api.d.ts +45 -0
  327. package/lib/esm/api.js +227 -0
  328. package/lib/esm/api.js.map +1 -0
  329. package/lib/esm/bot-context-manager.d.ts +17 -0
  330. package/lib/esm/bot-context-manager.js +93 -0
  331. package/lib/esm/bot-context-manager.js.map +1 -0
  332. package/lib/esm/constants.d.ts +14 -0
  333. package/lib/esm/constants.js +20 -0
  334. package/lib/esm/constants.js.map +1 -0
  335. package/lib/esm/content-fields/contact-reasons-conditional-matcher.d.ts +4 -0
  336. package/lib/esm/content-fields/contact-reasons-conditional-matcher.js +12 -0
  337. package/lib/esm/content-fields/contact-reasons-conditional-matcher.js.map +1 -0
  338. package/lib/esm/content-fields/content-fields-base.d.ts +20 -0
  339. package/lib/esm/content-fields/content-fields-base.js +74 -0
  340. package/lib/esm/content-fields/content-fields-base.js.map +1 -0
  341. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.d.ts +15 -0
  342. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +71 -0
  343. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +1 -0
  344. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.d.ts +9 -0
  345. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.js +58 -0
  346. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +1 -0
  347. package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.d.ts +17 -0
  348. package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.js +79 -0
  349. package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.js.map +1 -0
  350. package/lib/esm/content-fields/flow-ai-agent-base.d.ts +25 -0
  351. package/lib/esm/content-fields/flow-ai-agent-base.js +97 -0
  352. package/lib/esm/content-fields/flow-ai-agent-base.js.map +1 -0
  353. package/lib/esm/content-fields/flow-ai-agent-router.d.ts +21 -0
  354. package/lib/esm/content-fields/flow-ai-agent-router.js +126 -0
  355. package/lib/esm/content-fields/flow-ai-agent-router.js.map +1 -0
  356. package/lib/esm/content-fields/flow-ai-agent.d.ts +17 -0
  357. package/lib/esm/content-fields/flow-ai-agent.js +65 -0
  358. package/lib/esm/content-fields/flow-ai-agent.js.map +1 -0
  359. package/lib/esm/content-fields/flow-bot-action.d.ts +14 -0
  360. package/lib/esm/content-fields/flow-bot-action.js +45 -0
  361. package/lib/esm/content-fields/flow-bot-action.js.map +1 -0
  362. package/lib/esm/content-fields/flow-button.d.ts +31 -0
  363. package/lib/esm/content-fields/flow-button.js +86 -0
  364. package/lib/esm/content-fields/flow-button.js.map +1 -0
  365. package/lib/esm/content-fields/flow-capture-user-input.d.ts +14 -0
  366. package/lib/esm/content-fields/flow-capture-user-input.js +45 -0
  367. package/lib/esm/content-fields/flow-capture-user-input.js.map +1 -0
  368. package/lib/esm/content-fields/flow-carousel.d.ts +22 -0
  369. package/lib/esm/content-fields/flow-carousel.js +152 -0
  370. package/lib/esm/content-fields/flow-carousel.js.map +1 -0
  371. package/lib/esm/content-fields/flow-channel-conditional.d.ts +14 -0
  372. package/lib/esm/content-fields/flow-channel-conditional.js +57 -0
  373. package/lib/esm/content-fields/flow-channel-conditional.js.map +1 -0
  374. package/lib/esm/content-fields/flow-contact-reasons-conditional.d.ts +17 -0
  375. package/lib/esm/content-fields/flow-contact-reasons-conditional.js +88 -0
  376. package/lib/esm/content-fields/flow-contact-reasons-conditional.js.map +1 -0
  377. package/lib/esm/content-fields/flow-country-conditional.d.ts +13 -0
  378. package/lib/esm/content-fields/flow-country-conditional.js +59 -0
  379. package/lib/esm/content-fields/flow-country-conditional.js.map +1 -0
  380. package/lib/esm/content-fields/flow-custom-conditional.d.ts +17 -0
  381. package/lib/esm/content-fields/flow-custom-conditional.js +89 -0
  382. package/lib/esm/content-fields/flow-custom-conditional.js.map +1 -0
  383. package/lib/esm/content-fields/flow-do-nothing.d.ts +9 -0
  384. package/lib/esm/content-fields/flow-do-nothing.js +27 -0
  385. package/lib/esm/content-fields/flow-do-nothing.js.map +1 -0
  386. package/lib/esm/content-fields/flow-element.d.ts +22 -0
  387. package/lib/esm/content-fields/flow-element.js +50 -0
  388. package/lib/esm/content-fields/flow-element.js.map +1 -0
  389. package/lib/esm/content-fields/flow-go-to-flow.d.ts +13 -0
  390. package/lib/esm/content-fields/flow-go-to-flow.js +51 -0
  391. package/lib/esm/content-fields/flow-go-to-flow.js.map +1 -0
  392. package/lib/esm/content-fields/flow-handoff.d.ts +23 -0
  393. package/lib/esm/content-fields/flow-handoff.js +104 -0
  394. package/lib/esm/content-fields/flow-handoff.js.map +1 -0
  395. package/lib/esm/content-fields/flow-image.d.ts +10 -0
  396. package/lib/esm/content-fields/flow-image.js +33 -0
  397. package/lib/esm/content-fields/flow-image.js.map +1 -0
  398. package/lib/esm/content-fields/flow-queue-status-conditional.d.ts +30 -0
  399. package/lib/esm/content-fields/flow-queue-status-conditional.js +95 -0
  400. package/lib/esm/content-fields/flow-queue-status-conditional.js.map +1 -0
  401. package/lib/esm/content-fields/flow-rating.d.ts +15 -0
  402. package/lib/esm/content-fields/flow-rating.js +66 -0
  403. package/lib/esm/content-fields/flow-rating.js.map +1 -0
  404. package/lib/esm/content-fields/flow-text.d.ts +15 -0
  405. package/lib/esm/content-fields/flow-text.js +60 -0
  406. package/lib/esm/content-fields/flow-text.js.map +1 -0
  407. package/lib/esm/content-fields/flow-update-variables.d.ts +15 -0
  408. package/lib/esm/content-fields/flow-update-variables.js +137 -0
  409. package/lib/esm/content-fields/flow-update-variables.js.map +1 -0
  410. package/lib/esm/content-fields/flow-video.d.ts +10 -0
  411. package/lib/esm/content-fields/flow-video.js +33 -0
  412. package/lib/esm/content-fields/flow-video.js.map +1 -0
  413. package/lib/esm/content-fields/flow-webview.d.ts +16 -0
  414. package/lib/esm/content-fields/flow-webview.js +78 -0
  415. package/lib/esm/content-fields/flow-webview.js.map +1 -0
  416. package/lib/esm/content-fields/flow-whatsapp-cta-url-button.d.ts +21 -0
  417. package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js +92 -0
  418. package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js.map +1 -0
  419. package/lib/esm/content-fields/flow-whatsapp-request-contact-info.d.ts +11 -0
  420. package/lib/esm/content-fields/flow-whatsapp-request-contact-info.js +46 -0
  421. package/lib/esm/content-fields/flow-whatsapp-request-contact-info.js.map +1 -0
  422. package/lib/esm/content-fields/flow-whatsapp-template.d.ts +37 -0
  423. package/lib/esm/content-fields/flow-whatsapp-template.js +264 -0
  424. package/lib/esm/content-fields/flow-whatsapp-template.js.map +1 -0
  425. package/lib/esm/content-fields/hubtype-fields/ai-agent-router.d.ts +21 -0
  426. package/lib/esm/content-fields/hubtype-fields/ai-agent-router.js +3 -0
  427. package/lib/esm/content-fields/hubtype-fields/ai-agent-router.js.map +1 -0
  428. package/lib/esm/content-fields/hubtype-fields/ai-agent.d.ts +25 -0
  429. package/lib/esm/content-fields/hubtype-fields/ai-agent.js +3 -0
  430. package/lib/esm/content-fields/hubtype-fields/ai-agent.js.map +1 -0
  431. package/lib/esm/content-fields/hubtype-fields/bot-action.d.ts +10 -0
  432. package/lib/esm/content-fields/hubtype-fields/bot-action.js +3 -0
  433. package/lib/esm/content-fields/hubtype-fields/bot-action.js.map +1 -0
  434. package/lib/esm/content-fields/hubtype-fields/button.d.ts +8 -0
  435. package/lib/esm/content-fields/hubtype-fields/button.js +3 -0
  436. package/lib/esm/content-fields/hubtype-fields/button.js.map +1 -0
  437. package/lib/esm/content-fields/hubtype-fields/capture-user-input.d.ts +19 -0
  438. package/lib/esm/content-fields/hubtype-fields/capture-user-input.js +12 -0
  439. package/lib/esm/content-fields/hubtype-fields/capture-user-input.js.map +1 -0
  440. package/lib/esm/content-fields/hubtype-fields/carousel.d.ts +17 -0
  441. package/lib/esm/content-fields/hubtype-fields/carousel.js +3 -0
  442. package/lib/esm/content-fields/hubtype-fields/carousel.js.map +1 -0
  443. package/lib/esm/content-fields/hubtype-fields/channel-conditional.d.ts +10 -0
  444. package/lib/esm/content-fields/hubtype-fields/channel-conditional.js +3 -0
  445. package/lib/esm/content-fields/hubtype-fields/channel-conditional.js.map +1 -0
  446. package/lib/esm/content-fields/hubtype-fields/common.d.ts +83 -0
  447. package/lib/esm/content-fields/hubtype-fields/common.js +3 -0
  448. package/lib/esm/content-fields/hubtype-fields/common.js.map +1 -0
  449. package/lib/esm/content-fields/hubtype-fields/contact-reasons-conditional.d.ts +19 -0
  450. package/lib/esm/content-fields/hubtype-fields/contact-reasons-conditional.js +3 -0
  451. package/lib/esm/content-fields/hubtype-fields/contact-reasons-conditional.js.map +1 -0
  452. package/lib/esm/content-fields/hubtype-fields/country-conditional.d.ts +10 -0
  453. package/lib/esm/content-fields/hubtype-fields/country-conditional.js +3 -0
  454. package/lib/esm/content-fields/hubtype-fields/country-conditional.js.map +1 -0
  455. package/lib/esm/content-fields/hubtype-fields/custom-conditional-v2.d.ts +56 -0
  456. package/lib/esm/content-fields/hubtype-fields/custom-conditional-v2.js +36 -0
  457. package/lib/esm/content-fields/hubtype-fields/custom-conditional-v2.js.map +1 -0
  458. package/lib/esm/content-fields/hubtype-fields/custom-conditional.d.ts +11 -0
  459. package/lib/esm/content-fields/hubtype-fields/custom-conditional.js +3 -0
  460. package/lib/esm/content-fields/hubtype-fields/custom-conditional.js.map +1 -0
  461. package/lib/esm/content-fields/hubtype-fields/do-nothing.d.ts +6 -0
  462. package/lib/esm/content-fields/hubtype-fields/do-nothing.js +3 -0
  463. package/lib/esm/content-fields/hubtype-fields/do-nothing.js.map +1 -0
  464. package/lib/esm/content-fields/hubtype-fields/fallback.d.ts +9 -0
  465. package/lib/esm/content-fields/hubtype-fields/fallback.js +3 -0
  466. package/lib/esm/content-fields/hubtype-fields/fallback.js.map +1 -0
  467. package/lib/esm/content-fields/hubtype-fields/function.d.ts +30 -0
  468. package/lib/esm/content-fields/hubtype-fields/function.js +11 -0
  469. package/lib/esm/content-fields/hubtype-fields/function.js.map +1 -0
  470. package/lib/esm/content-fields/hubtype-fields/go-to-flow.d.ts +9 -0
  471. package/lib/esm/content-fields/hubtype-fields/go-to-flow.js +3 -0
  472. package/lib/esm/content-fields/hubtype-fields/go-to-flow.js.map +1 -0
  473. package/lib/esm/content-fields/hubtype-fields/handoff.d.ts +21 -0
  474. package/lib/esm/content-fields/hubtype-fields/handoff.js +10 -0
  475. package/lib/esm/content-fields/hubtype-fields/handoff.js.map +1 -0
  476. package/lib/esm/content-fields/hubtype-fields/image.d.ts +8 -0
  477. package/lib/esm/content-fields/hubtype-fields/image.js +3 -0
  478. package/lib/esm/content-fields/hubtype-fields/image.js.map +1 -0
  479. package/lib/esm/content-fields/hubtype-fields/index.d.ts +28 -0
  480. package/lib/esm/content-fields/hubtype-fields/index.js +32 -0
  481. package/lib/esm/content-fields/hubtype-fields/index.js.map +1 -0
  482. package/lib/esm/content-fields/hubtype-fields/keyword.d.ts +9 -0
  483. package/lib/esm/content-fields/hubtype-fields/keyword.js +3 -0
  484. package/lib/esm/content-fields/hubtype-fields/keyword.js.map +1 -0
  485. package/lib/esm/content-fields/hubtype-fields/node-types.d.ts +34 -0
  486. package/lib/esm/content-fields/hubtype-fields/node-types.js +41 -0
  487. package/lib/esm/content-fields/hubtype-fields/node-types.js.map +1 -0
  488. package/lib/esm/content-fields/hubtype-fields/nodes.d.ts +29 -0
  489. package/lib/esm/content-fields/hubtype-fields/nodes.js +3 -0
  490. package/lib/esm/content-fields/hubtype-fields/nodes.js.map +1 -0
  491. package/lib/esm/content-fields/hubtype-fields/payload.d.ts +8 -0
  492. package/lib/esm/content-fields/hubtype-fields/payload.js +3 -0
  493. package/lib/esm/content-fields/hubtype-fields/payload.js.map +1 -0
  494. package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.d.ts +25 -0
  495. package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.js +3 -0
  496. package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.js.map +1 -0
  497. package/lib/esm/content-fields/hubtype-fields/rating.d.ts +23 -0
  498. package/lib/esm/content-fields/hubtype-fields/rating.js +9 -0
  499. package/lib/esm/content-fields/hubtype-fields/rating.js.map +1 -0
  500. package/lib/esm/content-fields/hubtype-fields/smart-intent.d.ts +12 -0
  501. package/lib/esm/content-fields/hubtype-fields/smart-intent.js +3 -0
  502. package/lib/esm/content-fields/hubtype-fields/smart-intent.js.map +1 -0
  503. package/lib/esm/content-fields/hubtype-fields/text.d.ts +11 -0
  504. package/lib/esm/content-fields/hubtype-fields/text.js +3 -0
  505. package/lib/esm/content-fields/hubtype-fields/text.js.map +1 -0
  506. package/lib/esm/content-fields/hubtype-fields/update-variables.d.ts +9 -0
  507. package/lib/esm/content-fields/hubtype-fields/update-variables.js +3 -0
  508. package/lib/esm/content-fields/hubtype-fields/update-variables.js.map +1 -0
  509. package/lib/esm/content-fields/hubtype-fields/url.d.ts +8 -0
  510. package/lib/esm/content-fields/hubtype-fields/url.js +3 -0
  511. package/lib/esm/content-fields/hubtype-fields/url.js.map +1 -0
  512. package/lib/esm/content-fields/hubtype-fields/video.d.ts +8 -0
  513. package/lib/esm/content-fields/hubtype-fields/video.js +3 -0
  514. package/lib/esm/content-fields/hubtype-fields/video.js.map +1 -0
  515. package/lib/esm/content-fields/hubtype-fields/webview.d.ts +17 -0
  516. package/lib/esm/content-fields/hubtype-fields/webview.js +3 -0
  517. package/lib/esm/content-fields/hubtype-fields/webview.js.map +1 -0
  518. package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.d.ts +21 -0
  519. package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.js +3 -0
  520. package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.js.map +1 -0
  521. package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.d.ts +17 -0
  522. package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.js +3 -0
  523. package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +1 -0
  524. package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.d.ts +10 -0
  525. package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.js +3 -0
  526. package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +1 -0
  527. package/lib/esm/content-fields/hubtype-fields/whatsapp-template.d.ts +96 -0
  528. package/lib/esm/content-fields/hubtype-fields/whatsapp-template.js +9 -0
  529. package/lib/esm/content-fields/hubtype-fields/whatsapp-template.js.map +1 -0
  530. package/lib/esm/content-fields/index.d.ts +28 -0
  531. package/lib/esm/content-fields/index.js +58 -0
  532. package/lib/esm/content-fields/index.js.map +1 -0
  533. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +14 -0
  534. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +41 -0
  535. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +1 -0
  536. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +13 -0
  537. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +36 -0
  538. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +1 -0
  539. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +14 -0
  540. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +46 -0
  541. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +1 -0
  542. package/lib/esm/content-fields/whatsapp-button-list/index.d.ts +3 -0
  543. package/lib/esm/content-fields/whatsapp-button-list/index.js +10 -0
  544. package/lib/esm/content-fields/whatsapp-button-list/index.js.map +1 -0
  545. package/lib/esm/filters/index.d.ts +12 -0
  546. package/lib/esm/filters/index.js +17 -0
  547. package/lib/esm/filters/index.js.map +1 -0
  548. package/lib/esm/flow-factory.d.ts +12 -0
  549. package/lib/esm/flow-factory.js +75 -0
  550. package/lib/esm/flow-factory.js.map +1 -0
  551. package/lib/esm/functions/index.d.ts +11 -0
  552. package/lib/esm/functions/index.js +49 -0
  553. package/lib/esm/functions/index.js.map +1 -0
  554. package/lib/esm/index.d.ts +42 -0
  555. package/lib/esm/index.js +142 -0
  556. package/lib/esm/index.js.map +1 -0
  557. package/lib/esm/services/contact-info-fields-api.d.ts +7 -0
  558. package/lib/esm/services/contact-info-fields-api.js +28 -0
  559. package/lib/esm/services/contact-info-fields-api.js.map +1 -0
  560. package/lib/esm/services/hubtype-queues-api.d.ts +14 -0
  561. package/lib/esm/services/hubtype-queues-api.js +26 -0
  562. package/lib/esm/services/hubtype-queues-api.js.map +1 -0
  563. package/lib/esm/structured-output/flow-builder-content.d.ts +13 -0
  564. package/lib/esm/structured-output/flow-builder-content.js +15 -0
  565. package/lib/esm/structured-output/flow-builder-content.js.map +1 -0
  566. package/lib/esm/tracking.d.ts +16 -0
  567. package/lib/esm/tracking.js +71 -0
  568. package/lib/esm/tracking.js.map +1 -0
  569. package/lib/esm/types.d.ts +62 -0
  570. package/lib/esm/types.js +14 -0
  571. package/lib/esm/types.js.map +1 -0
  572. package/lib/esm/user-input/capture-user-input-api.d.ts +21 -0
  573. package/lib/esm/user-input/capture-user-input-api.js +88 -0
  574. package/lib/esm/user-input/capture-user-input-api.js.map +1 -0
  575. package/lib/esm/user-input/index.d.ts +4 -0
  576. package/lib/esm/user-input/index.js +37 -0
  577. package/lib/esm/user-input/index.js.map +1 -0
  578. package/lib/esm/user-input/keyword.d.ts +27 -0
  579. package/lib/esm/user-input/keyword.js +84 -0
  580. package/lib/esm/user-input/keyword.js.map +1 -0
  581. package/lib/esm/user-input/smart-intent.d.ts +24 -0
  582. package/lib/esm/user-input/smart-intent.js +89 -0
  583. package/lib/esm/user-input/smart-intent.js.map +1 -0
  584. package/lib/esm/utils/ai-agent.d.ts +11 -0
  585. package/lib/esm/utils/ai-agent.js +28 -0
  586. package/lib/esm/utils/ai-agent.js.map +1 -0
  587. package/lib/esm/utils/authentication.d.ts +2 -0
  588. package/lib/esm/utils/authentication.js +21 -0
  589. package/lib/esm/utils/authentication.js.map +1 -0
  590. package/lib/esm/utils/flow-locale.d.ts +22 -0
  591. package/lib/esm/utils/flow-locale.js +79 -0
  592. package/lib/esm/utils/flow-locale.js.map +1 -0
  593. package/lib/esm/utils/get-flow-builder-plugin.d.ts +3 -0
  594. package/lib/esm/utils/get-flow-builder-plugin.js +16 -0
  595. package/lib/esm/utils/get-flow-builder-plugin.js.map +1 -0
  596. package/lib/esm/utils/hubtype-assistant-content.d.ts +13 -0
  597. package/lib/esm/utils/hubtype-assistant-content.js +184 -0
  598. package/lib/esm/utils/hubtype-assistant-content.js.map +1 -0
  599. package/lib/esm/utils/input.d.ts +6 -0
  600. package/lib/esm/utils/input.js +35 -0
  601. package/lib/esm/utils/input.js.map +1 -0
  602. package/lib/esm/webview/contents-context.d.ts +2 -0
  603. package/lib/esm/webview/contents-context.js +12 -0
  604. package/lib/esm/webview/contents-context.js.map +1 -0
  605. package/lib/esm/webview/index.d.ts +3 -0
  606. package/lib/esm/webview/index.js +10 -0
  607. package/lib/esm/webview/index.js.map +1 -0
  608. package/lib/esm/webview/types.d.ts +47 -0
  609. package/lib/esm/webview/types.js +9 -0
  610. package/lib/esm/webview/types.js.map +1 -0
  611. package/lib/esm/webview/use-webview-contents.d.ts +2 -0
  612. package/lib/esm/webview/use-webview-contents.js +83 -0
  613. package/lib/esm/webview/use-webview-contents.js.map +1 -0
  614. package/package.json +9 -11
  615. package/src/content-fields/flow-contact-reasons-conditional.tsx +34 -5
  616. package/src/content-fields/flow-update-variables.tsx +182 -0
  617. package/src/content-fields/hubtype-fields/contact-reasons-conditional.ts +4 -1
  618. package/src/content-fields/hubtype-fields/node-types.ts +1 -0
  619. package/src/content-fields/hubtype-fields/nodes.ts +2 -0
  620. package/src/content-fields/hubtype-fields/update-variables.ts +10 -0
  621. package/src/content-fields/index.ts +3 -0
  622. package/src/flow-factory.ts +7 -0
  623. package/src/services/contact-info-fields-api.ts +36 -0
  624. package/lib/action/ai-agent-from-user-input.d.ts +0 -3
  625. package/lib/action/ai-agent-from-user-input.js +0 -43
  626. package/lib/action/ai-agent-from-user-input.js.map +0 -1
  627. package/lib/action/context.d.ts +0 -11
  628. package/lib/action/context.js +0 -20
  629. package/lib/action/context.js.map +0 -1
  630. package/lib/action/fallback.d.ts +0 -3
  631. package/lib/action/fallback.js +0 -41
  632. package/lib/action/fallback.js.map +0 -1
  633. package/lib/action/first-interaction.d.ts +0 -3
  634. package/lib/action/first-interaction.js +0 -110
  635. package/lib/action/first-interaction.js.map +0 -1
  636. package/lib/action/get-contents.d.ts +0 -3
  637. package/lib/action/get-contents.js +0 -59
  638. package/lib/action/get-contents.js.map +0 -1
  639. package/lib/action/index.d.ts +0 -25
  640. package/lib/action/index.js +0 -133
  641. package/lib/action/index.js.map +0 -1
  642. package/lib/action/payload.d.ts +0 -3
  643. package/lib/action/payload.js +0 -78
  644. package/lib/action/payload.js.map +0 -1
  645. package/lib/api.d.ts +0 -45
  646. package/lib/api.js +0 -240
  647. package/lib/api.js.map +0 -1
  648. package/lib/bot-context-manager.d.ts +0 -17
  649. package/lib/bot-context-manager.js +0 -101
  650. package/lib/bot-context-manager.js.map +0 -1
  651. package/lib/constants.js +0 -18
  652. package/lib/constants.js.map +0 -1
  653. package/lib/content-fields/contact-reasons-conditional-matcher.d.ts +0 -4
  654. package/lib/content-fields/contact-reasons-conditional-matcher.js +0 -10
  655. package/lib/content-fields/contact-reasons-conditional-matcher.js.map +0 -1
  656. package/lib/content-fields/content-fields-base.d.ts +0 -20
  657. package/lib/content-fields/content-fields-base.js +0 -78
  658. package/lib/content-fields/content-fields-base.js.map +0 -1
  659. package/lib/content-fields/custom-conditional/custom-conditional-v2-evaluators.d.ts +0 -15
  660. package/lib/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +0 -73
  661. package/lib/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +0 -1
  662. package/lib/content-fields/custom-conditional/custom-conditional-v2-resolver.d.ts +0 -9
  663. package/lib/content-fields/custom-conditional/custom-conditional-v2-resolver.js +0 -58
  664. package/lib/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +0 -1
  665. package/lib/content-fields/custom-conditional/flow-custom-condition-v2.d.ts +0 -17
  666. package/lib/content-fields/custom-conditional/flow-custom-condition-v2.js +0 -94
  667. package/lib/content-fields/custom-conditional/flow-custom-condition-v2.js.map +0 -1
  668. package/lib/content-fields/flow-ai-agent-base.d.ts +0 -25
  669. package/lib/content-fields/flow-ai-agent-base.js +0 -106
  670. package/lib/content-fields/flow-ai-agent-base.js.map +0 -1
  671. package/lib/content-fields/flow-ai-agent-router.d.ts +0 -21
  672. package/lib/content-fields/flow-ai-agent-router.js +0 -137
  673. package/lib/content-fields/flow-ai-agent-router.js.map +0 -1
  674. package/lib/content-fields/flow-ai-agent.d.ts +0 -17
  675. package/lib/content-fields/flow-ai-agent.js +0 -76
  676. package/lib/content-fields/flow-ai-agent.js.map +0 -1
  677. package/lib/content-fields/flow-bot-action.d.ts +0 -14
  678. package/lib/content-fields/flow-bot-action.js +0 -53
  679. package/lib/content-fields/flow-bot-action.js.map +0 -1
  680. package/lib/content-fields/flow-button.d.ts +0 -31
  681. package/lib/content-fields/flow-button.js +0 -105
  682. package/lib/content-fields/flow-button.js.map +0 -1
  683. package/lib/content-fields/flow-capture-user-input.d.ts +0 -14
  684. package/lib/content-fields/flow-capture-user-input.js +0 -46
  685. package/lib/content-fields/flow-capture-user-input.js.map +0 -1
  686. package/lib/content-fields/flow-carousel.d.ts +0 -22
  687. package/lib/content-fields/flow-carousel.js +0 -193
  688. package/lib/content-fields/flow-carousel.js.map +0 -1
  689. package/lib/content-fields/flow-channel-conditional.d.ts +0 -14
  690. package/lib/content-fields/flow-channel-conditional.js +0 -61
  691. package/lib/content-fields/flow-channel-conditional.js.map +0 -1
  692. package/lib/content-fields/flow-contact-reasons-conditional.d.ts +0 -14
  693. package/lib/content-fields/flow-contact-reasons-conditional.js +0 -68
  694. package/lib/content-fields/flow-contact-reasons-conditional.js.map +0 -1
  695. package/lib/content-fields/flow-country-conditional.d.ts +0 -13
  696. package/lib/content-fields/flow-country-conditional.js +0 -64
  697. package/lib/content-fields/flow-country-conditional.js.map +0 -1
  698. package/lib/content-fields/flow-custom-conditional.d.ts +0 -17
  699. package/lib/content-fields/flow-custom-conditional.js +0 -87
  700. package/lib/content-fields/flow-custom-conditional.js.map +0 -1
  701. package/lib/content-fields/flow-do-nothing.d.ts +0 -9
  702. package/lib/content-fields/flow-do-nothing.js +0 -33
  703. package/lib/content-fields/flow-do-nothing.js.map +0 -1
  704. package/lib/content-fields/flow-element.d.ts +0 -22
  705. package/lib/content-fields/flow-element.js +0 -67
  706. package/lib/content-fields/flow-element.js.map +0 -1
  707. package/lib/content-fields/flow-go-to-flow.d.ts +0 -13
  708. package/lib/content-fields/flow-go-to-flow.js +0 -56
  709. package/lib/content-fields/flow-go-to-flow.js.map +0 -1
  710. package/lib/content-fields/flow-handoff.d.ts +0 -23
  711. package/lib/content-fields/flow-handoff.js +0 -117
  712. package/lib/content-fields/flow-handoff.js.map +0 -1
  713. package/lib/content-fields/flow-image.d.ts +0 -10
  714. package/lib/content-fields/flow-image.js +0 -42
  715. package/lib/content-fields/flow-image.js.map +0 -1
  716. package/lib/content-fields/flow-queue-status-conditional.d.ts +0 -30
  717. package/lib/content-fields/flow-queue-status-conditional.js +0 -100
  718. package/lib/content-fields/flow-queue-status-conditional.js.map +0 -1
  719. package/lib/content-fields/flow-rating.d.ts +0 -15
  720. package/lib/content-fields/flow-rating.js +0 -88
  721. package/lib/content-fields/flow-rating.js.map +0 -1
  722. package/lib/content-fields/flow-text.d.ts +0 -15
  723. package/lib/content-fields/flow-text.js +0 -82
  724. package/lib/content-fields/flow-text.js.map +0 -1
  725. package/lib/content-fields/flow-video.d.ts +0 -10
  726. package/lib/content-fields/flow-video.js +0 -42
  727. package/lib/content-fields/flow-video.js.map +0 -1
  728. package/lib/content-fields/flow-webview.d.ts +0 -16
  729. package/lib/content-fields/flow-webview.js +0 -81
  730. package/lib/content-fields/flow-webview.js.map +0 -1
  731. package/lib/content-fields/flow-whatsapp-cta-url-button.d.ts +0 -21
  732. package/lib/content-fields/flow-whatsapp-cta-url-button.js +0 -131
  733. package/lib/content-fields/flow-whatsapp-cta-url-button.js.map +0 -1
  734. package/lib/content-fields/flow-whatsapp-request-contact-info.d.ts +0 -11
  735. package/lib/content-fields/flow-whatsapp-request-contact-info.js +0 -62
  736. package/lib/content-fields/flow-whatsapp-request-contact-info.js.map +0 -1
  737. package/lib/content-fields/flow-whatsapp-template.d.ts +0 -37
  738. package/lib/content-fields/flow-whatsapp-template.js +0 -281
  739. package/lib/content-fields/flow-whatsapp-template.js.map +0 -1
  740. package/lib/content-fields/hubtype-fields/ai-agent-router.d.ts +0 -21
  741. package/lib/content-fields/hubtype-fields/ai-agent-router.js +0 -4
  742. package/lib/content-fields/hubtype-fields/ai-agent-router.js.map +0 -1
  743. package/lib/content-fields/hubtype-fields/ai-agent.d.ts +0 -25
  744. package/lib/content-fields/hubtype-fields/ai-agent.js +0 -4
  745. package/lib/content-fields/hubtype-fields/ai-agent.js.map +0 -1
  746. package/lib/content-fields/hubtype-fields/bot-action.d.ts +0 -10
  747. package/lib/content-fields/hubtype-fields/bot-action.js +0 -4
  748. package/lib/content-fields/hubtype-fields/bot-action.js.map +0 -1
  749. package/lib/content-fields/hubtype-fields/button.d.ts +0 -8
  750. package/lib/content-fields/hubtype-fields/button.js +0 -4
  751. package/lib/content-fields/hubtype-fields/button.js.map +0 -1
  752. package/lib/content-fields/hubtype-fields/capture-user-input.d.ts +0 -19
  753. package/lib/content-fields/hubtype-fields/capture-user-input.js +0 -12
  754. package/lib/content-fields/hubtype-fields/capture-user-input.js.map +0 -1
  755. package/lib/content-fields/hubtype-fields/carousel.d.ts +0 -17
  756. package/lib/content-fields/hubtype-fields/carousel.js +0 -4
  757. package/lib/content-fields/hubtype-fields/carousel.js.map +0 -1
  758. package/lib/content-fields/hubtype-fields/channel-conditional.d.ts +0 -10
  759. package/lib/content-fields/hubtype-fields/channel-conditional.js +0 -4
  760. package/lib/content-fields/hubtype-fields/channel-conditional.js.map +0 -1
  761. package/lib/content-fields/hubtype-fields/common.d.ts +0 -83
  762. package/lib/content-fields/hubtype-fields/common.js +0 -4
  763. package/lib/content-fields/hubtype-fields/common.js.map +0 -1
  764. package/lib/content-fields/hubtype-fields/contact-reasons-conditional.d.ts +0 -16
  765. package/lib/content-fields/hubtype-fields/contact-reasons-conditional.js +0 -4
  766. package/lib/content-fields/hubtype-fields/contact-reasons-conditional.js.map +0 -1
  767. package/lib/content-fields/hubtype-fields/country-conditional.d.ts +0 -10
  768. package/lib/content-fields/hubtype-fields/country-conditional.js +0 -4
  769. package/lib/content-fields/hubtype-fields/country-conditional.js.map +0 -1
  770. package/lib/content-fields/hubtype-fields/custom-conditional-v2.d.ts +0 -56
  771. package/lib/content-fields/hubtype-fields/custom-conditional-v2.js +0 -36
  772. package/lib/content-fields/hubtype-fields/custom-conditional-v2.js.map +0 -1
  773. package/lib/content-fields/hubtype-fields/custom-conditional.d.ts +0 -11
  774. package/lib/content-fields/hubtype-fields/custom-conditional.js +0 -4
  775. package/lib/content-fields/hubtype-fields/custom-conditional.js.map +0 -1
  776. package/lib/content-fields/hubtype-fields/do-nothing.d.ts +0 -6
  777. package/lib/content-fields/hubtype-fields/do-nothing.js +0 -4
  778. package/lib/content-fields/hubtype-fields/do-nothing.js.map +0 -1
  779. package/lib/content-fields/hubtype-fields/fallback.d.ts +0 -9
  780. package/lib/content-fields/hubtype-fields/fallback.js +0 -4
  781. package/lib/content-fields/hubtype-fields/fallback.js.map +0 -1
  782. package/lib/content-fields/hubtype-fields/function.d.ts +0 -30
  783. package/lib/content-fields/hubtype-fields/function.js +0 -11
  784. package/lib/content-fields/hubtype-fields/function.js.map +0 -1
  785. package/lib/content-fields/hubtype-fields/go-to-flow.d.ts +0 -9
  786. package/lib/content-fields/hubtype-fields/go-to-flow.js +0 -4
  787. package/lib/content-fields/hubtype-fields/go-to-flow.js.map +0 -1
  788. package/lib/content-fields/hubtype-fields/handoff.d.ts +0 -21
  789. package/lib/content-fields/hubtype-fields/handoff.js +0 -10
  790. package/lib/content-fields/hubtype-fields/handoff.js.map +0 -1
  791. package/lib/content-fields/hubtype-fields/image.d.ts +0 -8
  792. package/lib/content-fields/hubtype-fields/image.js +0 -4
  793. package/lib/content-fields/hubtype-fields/image.js.map +0 -1
  794. package/lib/content-fields/hubtype-fields/index.d.ts +0 -28
  795. package/lib/content-fields/hubtype-fields/index.js +0 -59
  796. package/lib/content-fields/hubtype-fields/index.js.map +0 -1
  797. package/lib/content-fields/hubtype-fields/keyword.d.ts +0 -9
  798. package/lib/content-fields/hubtype-fields/keyword.js +0 -4
  799. package/lib/content-fields/hubtype-fields/keyword.js.map +0 -1
  800. package/lib/content-fields/hubtype-fields/node-types.d.ts +0 -33
  801. package/lib/content-fields/hubtype-fields/node-types.js +0 -40
  802. package/lib/content-fields/hubtype-fields/node-types.js.map +0 -1
  803. package/lib/content-fields/hubtype-fields/nodes.d.ts +0 -28
  804. package/lib/content-fields/hubtype-fields/nodes.js +0 -4
  805. package/lib/content-fields/hubtype-fields/nodes.js.map +0 -1
  806. package/lib/content-fields/hubtype-fields/payload.d.ts +0 -8
  807. package/lib/content-fields/hubtype-fields/payload.js +0 -4
  808. package/lib/content-fields/hubtype-fields/payload.js.map +0 -1
  809. package/lib/content-fields/hubtype-fields/queue-status-conditional.d.ts +0 -25
  810. package/lib/content-fields/hubtype-fields/queue-status-conditional.js +0 -4
  811. package/lib/content-fields/hubtype-fields/queue-status-conditional.js.map +0 -1
  812. package/lib/content-fields/hubtype-fields/rating.d.ts +0 -23
  813. package/lib/content-fields/hubtype-fields/rating.js +0 -9
  814. package/lib/content-fields/hubtype-fields/rating.js.map +0 -1
  815. package/lib/content-fields/hubtype-fields/smart-intent.d.ts +0 -12
  816. package/lib/content-fields/hubtype-fields/smart-intent.js +0 -4
  817. package/lib/content-fields/hubtype-fields/smart-intent.js.map +0 -1
  818. package/lib/content-fields/hubtype-fields/text.d.ts +0 -11
  819. package/lib/content-fields/hubtype-fields/text.js +0 -4
  820. package/lib/content-fields/hubtype-fields/text.js.map +0 -1
  821. package/lib/content-fields/hubtype-fields/url.d.ts +0 -8
  822. package/lib/content-fields/hubtype-fields/url.js +0 -4
  823. package/lib/content-fields/hubtype-fields/url.js.map +0 -1
  824. package/lib/content-fields/hubtype-fields/video.d.ts +0 -8
  825. package/lib/content-fields/hubtype-fields/video.js +0 -4
  826. package/lib/content-fields/hubtype-fields/video.js.map +0 -1
  827. package/lib/content-fields/hubtype-fields/webview.d.ts +0 -17
  828. package/lib/content-fields/hubtype-fields/webview.js +0 -4
  829. package/lib/content-fields/hubtype-fields/webview.js.map +0 -1
  830. package/lib/content-fields/hubtype-fields/whatsapp-button-list.d.ts +0 -21
  831. package/lib/content-fields/hubtype-fields/whatsapp-button-list.js +0 -4
  832. package/lib/content-fields/hubtype-fields/whatsapp-button-list.js.map +0 -1
  833. package/lib/content-fields/hubtype-fields/whatsapp-cta-url-button.d.ts +0 -17
  834. package/lib/content-fields/hubtype-fields/whatsapp-cta-url-button.js +0 -4
  835. package/lib/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +0 -1
  836. package/lib/content-fields/hubtype-fields/whatsapp-request-contact-info.d.ts +0 -10
  837. package/lib/content-fields/hubtype-fields/whatsapp-request-contact-info.js +0 -4
  838. package/lib/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +0 -1
  839. package/lib/content-fields/hubtype-fields/whatsapp-template.d.ts +0 -96
  840. package/lib/content-fields/hubtype-fields/whatsapp-template.js +0 -9
  841. package/lib/content-fields/hubtype-fields/whatsapp-template.js.map +0 -1
  842. package/lib/content-fields/index.d.ts +0 -27
  843. package/lib/content-fields/index.js +0 -79
  844. package/lib/content-fields/index.js.map +0 -1
  845. package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +0 -14
  846. package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +0 -43
  847. package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +0 -1
  848. package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +0 -13
  849. package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +0 -41
  850. package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +0 -1
  851. package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +0 -14
  852. package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +0 -66
  853. package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +0 -1
  854. package/lib/content-fields/whatsapp-button-list/index.d.ts +0 -3
  855. package/lib/content-fields/whatsapp-button-list/index.js +0 -12
  856. package/lib/content-fields/whatsapp-button-list/index.js.map +0 -1
  857. package/lib/filters/index.d.ts +0 -12
  858. package/lib/filters/index.js +0 -16
  859. package/lib/filters/index.js.map +0 -1
  860. package/lib/flow-factory.d.ts +0 -12
  861. package/lib/flow-factory.js +0 -79
  862. package/lib/flow-factory.js.map +0 -1
  863. package/lib/functions/index.d.ts +0 -11
  864. package/lib/functions/index.js +0 -55
  865. package/lib/functions/index.js.map +0 -1
  866. package/lib/index.d.ts +0 -42
  867. package/lib/index.js +0 -157
  868. package/lib/index.js.map +0 -1
  869. package/lib/services/hubtype-queues-api.js +0 -26
  870. package/lib/services/hubtype-queues-api.js.map +0 -1
  871. package/lib/structured-output/flow-builder-content.js +0 -16
  872. package/lib/structured-output/flow-builder-content.js.map +0 -1
  873. package/lib/tracking.d.ts +0 -16
  874. package/lib/tracking.js +0 -77
  875. package/lib/tracking.js.map +0 -1
  876. package/lib/types.d.ts +0 -62
  877. package/lib/types.js +0 -14
  878. package/lib/types.js.map +0 -1
  879. package/lib/user-input/capture-user-input-api.d.ts +0 -21
  880. package/lib/user-input/capture-user-input-api.js +0 -99
  881. package/lib/user-input/capture-user-input-api.js.map +0 -1
  882. package/lib/user-input/index.d.ts +0 -4
  883. package/lib/user-input/index.js +0 -46
  884. package/lib/user-input/index.js.map +0 -1
  885. package/lib/user-input/keyword.d.ts +0 -27
  886. package/lib/user-input/keyword.js +0 -89
  887. package/lib/user-input/keyword.js.map +0 -1
  888. package/lib/user-input/smart-intent.d.ts +0 -24
  889. package/lib/user-input/smart-intent.js +0 -93
  890. package/lib/user-input/smart-intent.js.map +0 -1
  891. package/lib/utils/ai-agent.d.ts +0 -11
  892. package/lib/utils/ai-agent.js +0 -33
  893. package/lib/utils/ai-agent.js.map +0 -1
  894. package/lib/utils/authentication.js +0 -24
  895. package/lib/utils/authentication.js.map +0 -1
  896. package/lib/utils/flow-locale.js +0 -75
  897. package/lib/utils/flow-locale.js.map +0 -1
  898. package/lib/utils/get-flow-builder-plugin.d.ts +0 -3
  899. package/lib/utils/get-flow-builder-plugin.js +0 -16
  900. package/lib/utils/get-flow-builder-plugin.js.map +0 -1
  901. package/lib/utils/hubtype-assistant-content.d.ts +0 -13
  902. package/lib/utils/hubtype-assistant-content.js +0 -200
  903. package/lib/utils/hubtype-assistant-content.js.map +0 -1
  904. package/lib/utils/input.js +0 -37
  905. package/lib/utils/input.js.map +0 -1
  906. package/lib/webview/contents-context.d.ts +0 -2
  907. package/lib/webview/contents-context.js +0 -14
  908. package/lib/webview/contents-context.js.map +0 -1
  909. package/lib/webview/index.d.ts +0 -3
  910. package/lib/webview/index.js +0 -11
  911. package/lib/webview/index.js.map +0 -1
  912. package/lib/webview/types.d.ts +0 -47
  913. package/lib/webview/types.js +0 -9
  914. package/lib/webview/types.js.map +0 -1
  915. package/lib/webview/use-webview-contents.d.ts +0 -2
  916. package/lib/webview/use-webview-contents.js +0 -90
  917. package/lib/webview/use-webview-contents.js.map +0 -1
  918. /package/lib/{constants.d.ts → cjs/constants.d.ts} +0 -0
  919. /package/lib/{services → cjs/services}/hubtype-queues-api.d.ts +0 -0
  920. /package/lib/{structured-output → cjs/structured-output}/flow-builder-content.d.ts +0 -0
  921. /package/lib/{utils → cjs/utils}/authentication.d.ts +0 -0
  922. /package/lib/{utils → cjs/utils}/flow-locale.d.ts +0 -0
  923. /package/lib/{utils → cjs/utils}/input.d.ts +0 -0
package/lib/tracking.js DELETED
@@ -1,77 +0,0 @@
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
-
14
- async function trackEvent(request, eventAction, args) {
15
- const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins);
16
- if (flowBuilderPlugin.trackEvent) {
17
- await flowBuilderPlugin.trackEvent(request, eventAction, args);
18
- }
19
- return;
20
- }
21
- async function trackFlowContent(request, contents) {
22
- const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins);
23
- const cmsApi = flowBuilderPlugin.cmsApi;
24
- for (const content of contents){
25
- await trackOneContent(request, content, cmsApi);
26
- }
27
- }
28
- async function trackOneContent(request, content, cmsApi) {
29
- if (!cmsApi) {
30
- const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins);
31
- cmsApi = flowBuilderPlugin.cmsApi;
32
- }
33
- const nodeContent = cmsApi.getNodeById(content.id);
34
- if (nodeContent.type !== HtNodeWithContentType.AI_AGENT) {
35
- const event = getContentEventArgs(request, nodeContent);
36
- const { action, ...eventArgs } = event;
37
- await trackEvent(request, action, eventArgs);
38
- }
39
- }
40
- function setSessionFlowThreadId(request, flowThreadId) {
41
- request.session.flow_thread_id = flowThreadId;
42
- }
43
- function getContentEventArgs(request, nodeContent) {
44
- const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } = getCommonFlowContentEventArgs(request, nodeContent);
45
- setSessionFlowThreadId(request, flowThreadId);
46
- return {
47
- action: EventAction.FlowNode,
48
- flowId,
49
- flowName,
50
- flowNodeId,
51
- flowNodeContentId,
52
- flowThreadId,
53
- flowNodeIsMeaningful: nodeContent.is_meaningful ?? false
54
- };
55
- }
56
- function getCommonFlowContentEventArgs(request, nodeContent) {
57
- const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins);
58
- const flowName = flowBuilderPlugin.getFlowName(nodeContent.flow_id);
59
- const flowThreadId = request.session.flow_thread_id ?? v7();
60
- return {
61
- flowThreadId,
62
- flowId: nodeContent.flow_id,
63
- flowName,
64
- flowNodeId: nodeContent.id,
65
- flowNodeContentId: nodeContent.code ?? ''
66
- };
67
- }
68
- function getCommonFlowContentEventArgsForContentId(botContext, id) {
69
- const flowBuilderPlugin = getFlowBuilderPlugin(botContext.plugins);
70
- const cmsApi = flowBuilderPlugin.cmsApi;
71
- const nodeContent = cmsApi.getNodeById(id);
72
- return getCommonFlowContentEventArgs(botContext, nodeContent);
73
- }
74
-
75
- export { getCommonFlowContentEventArgsForContentId, trackEvent, trackFlowContent, trackOneContent };
76
-
77
- //# sourceMappingURL=tracking.js.map
@@ -1 +0,0 @@
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","getCommonFlowContentEventArgsForContentId","botContext","id"],"mappings":";;;;;;;;;AAA4E;AAEzC;AAOK;AAC8B;AAE/D,eAAeK,UAAUA,CAC9BC,OAAsB,EACtBC,WAAwB,EACxBC,IAA0B;IAE1B,MAAMC,oBAAoBL,oBAAoBA,CAACE,QAAQ,OAAO;IAC9D,IAAIG,kBAAkB,UAAU,EAAE;QAChC,MAAMA,kBAAkB,UAAU,CAACH,SAASC,aAAaC;IAC3D;IACA;AACF;AAEO,eAAeE,gBAAgBA,CACpCJ,OAAsB,EACtBK,QAAuB;IAEvB,MAAMF,oBAAoBL,oBAAoBA,CAACE,QAAQ,OAAO;IAC9D,MAAMM,SAASH,kBAAkB,MAAM;IACvC,KAAK,MAAMI,WAAWF,SAAU;QAC9B,MAAMG,eAAeA,CAACR,SAASO,SAASD;IAC1C;AACF;AAEO,eAAeE,eAAeA,CACnCR,OAAsB,EACtBO,OAAoB,EACpBD,MAAuB;IAEvB,IAAI,CAACA,QAAQ;QACX,MAAMH,oBAAoBL,oBAAoBA,CAACE,QAAQ,OAAO;QAC9DM,SAASH,kBAAkB,MAAM;IACnC;IAEA,MAAMM,cAAcH,OAAO,WAAW,CAAoBC,QAAQ,EAAE;IACpE,IAAIE,YAAY,IAAI,KAAKZ,8BAA8B,EAAE;QACvD,MAAMa,QAAQC,mBAAmBA,CAACX,SAASS;QAC3C,MAAM,EAAEG,MAAM,EAAE,GAAGC,WAAW,GAAGH;QACjC,MAAMX,UAAUA,CAACC,SAASY,QAAQC;IACpC;AACF;AAEA,SAASC,sBAAsBA,CAC7Bd,OAAsB,EACtBe,YAAoB;IAEpBf,QAAQ,OAAO,CAAC,cAAc,GAAGe;AACnC;AAEA,SAASJ,mBAAmBA,CAC1BX,OAAsB,EACtBS,WAA8B;IAE9B,MAAM,EAAEM,YAAY,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,iBAAiB,EAAE,GACrEC,6BAA6BA,CAACpB,SAASS;IAEzCK,sBAAsBA,CAACd,SAASe;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"}
package/lib/types.d.ts DELETED
@@ -1,62 +0,0 @@
1
- import type { AiAgentArgs, BotContext, GuardrailRule, InferenceResponse, 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
- export interface InShadowingConfig {
6
- allowKeywords: boolean;
7
- allowSmartIntents: boolean;
8
- allowAiAgents: boolean;
9
- }
10
- export interface BotonicPluginFlowBuilderOptions<TPlugins extends ResolvedPlugins = ResolvedPlugins, TExtraData = any> {
11
- apiUrl?: string;
12
- jsonVersion?: FlowBuilderJSONVersion;
13
- flow?: HtFlowBuilderData;
14
- customFunctions?: Record<any, any>;
15
- getAccessToken: () => string;
16
- trackEvent?: TrackEventFunction<TPlugins, TExtraData>;
17
- getAiAgentResponse?: AiAgentFunction<TPlugins, TExtraData>;
18
- smartIntentsConfig?: {
19
- numSmartIntentsToUse: number;
20
- };
21
- inShadowing?: Partial<InShadowingConfig>;
22
- contentFilters?: ContentFilter<TPlugins, TExtraData>[];
23
- customRatingMessageEnabled?: boolean;
24
- disableAIAgentInFirstInteraction?: boolean;
25
- }
26
- export type TrackEventFunction<TPlugins extends ResolvedPlugins = ResolvedPlugins, TExtraData = any> = (request: BotContext<TPlugins, TExtraData>, eventAction: string, args?: Record<string, any>) => Promise<void>;
27
- export type AiAgentFunction<TPlugins extends ResolvedPlugins = ResolvedPlugins, TExtraData = any> = (request: BotContext<TPlugins, TExtraData>, aiAgentArgs: AiAgentArgs) => Promise<InferenceResponse<FlowBuilderContentMessage>>;
28
- export type ContentFilter<TPlugins extends ResolvedPlugins = ResolvedPlugins, TExtraData = any> = (request: BotContext<TPlugins, TExtraData>, content: FlowContent) => Promise<FlowContent> | FlowContent;
29
- export interface FlowBuilderApiOptions {
30
- url: string;
31
- flowUrl: string;
32
- flow?: HtFlowBuilderData;
33
- accessToken: string;
34
- botContext: BotContext;
35
- }
36
- export declare enum ProcessEnvNodeEnvs {
37
- PRODUCTION = "production",
38
- DEVELOPMENT = "development"
39
- }
40
- export declare enum FlowBuilderJSONVersion {
41
- DRAFT = "draft",
42
- LATEST = "latest"
43
- }
44
- export interface SmartIntentResponse {
45
- data: {
46
- smart_intent_title: string;
47
- text: string;
48
- smart_intents_used: {
49
- title: string;
50
- description: string;
51
- }[];
52
- };
53
- }
54
- export interface PayloadParamsBase {
55
- contentID: string;
56
- followUpContentID?: string;
57
- }
58
- export interface RatingSubmittedInfo extends HtRatingButton {
59
- possibleOptions: string[];
60
- possibleValues: number[];
61
- }
62
- export type { AiAgentArgs, GuardrailRule };
package/lib/types.js DELETED
@@ -1,14 +0,0 @@
1
- var types_ProcessEnvNodeEnvs = /*#__PURE__*/ function(ProcessEnvNodeEnvs) {
2
- ProcessEnvNodeEnvs["PRODUCTION"] = "production";
3
- ProcessEnvNodeEnvs["DEVELOPMENT"] = "development";
4
- return ProcessEnvNodeEnvs;
5
- }({});
6
- var types_FlowBuilderJSONVersion = /*#__PURE__*/ function(FlowBuilderJSONVersion) {
7
- FlowBuilderJSONVersion["DRAFT"] = "draft";
8
- FlowBuilderJSONVersion["LATEST"] = "latest";
9
- return FlowBuilderJSONVersion;
10
- }({});
11
-
12
- export { types_FlowBuilderJSONVersion as FlowBuilderJSONVersion, types_ProcessEnvNodeEnvs as ProcessEnvNodeEnvs };
13
-
14
- //# sourceMappingURL=types.js.map
package/lib/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sources":["../src/types.ts"],"sourcesContent":["import type {\n AiAgentArgs,\n BotContext,\n GuardrailRule,\n InferenceResponse,\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 botContext: BotContext\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":"AAuEO,IAAKA,wBAAkBA,0BAAlBA;;;WAAAA;MAGX;AAEM,IAAKC,4BAAsBA,0BAAtBA;;;WAAAA;MAGX"}
@@ -1,21 +0,0 @@
1
- import type { ActionRequest } from '@botonic/react';
2
- import type { FlowBuilderApi } from '../api.js';
3
- import { type HtCaptureUserInputNode } from '../content-fields/hubtype-fields/index.js';
4
- interface AiCaptureResponseSuccess {
5
- success: true;
6
- value: string;
7
- }
8
- interface AiCaptureResponseFailure {
9
- success: false;
10
- }
11
- type AiCaptureResponse = AiCaptureResponseSuccess | AiCaptureResponseFailure;
12
- export declare class CaptureUserInputApi {
13
- private cmsApi;
14
- private request;
15
- private textOrTranscript;
16
- constructor(cmsApi: FlowBuilderApi, request: ActionRequest, textOrTranscript: string);
17
- getNextNodeId(): Promise<string | undefined>;
18
- getAiCaptureResponse(captureUserInputNode: HtCaptureUserInputNode): Promise<AiCaptureResponse>;
19
- trackUserInputCapture(captureUserInputNode: HtCaptureUserInputNode, captureSuccess: boolean): Promise<void>;
20
- }
21
- export {};
@@ -1,99 +0,0 @@
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
-
23
- class CaptureUserInputApi {
24
- async getNextNodeId() {
25
- if (inputHasTextOrTranscript(this.request.input) && this.cmsApi.shouldCaptureUserInput()) {
26
- const captureUserInputNode = this.cmsApi.getCaptureUserInputNode();
27
- if (!captureUserInputNode || !this.textOrTranscript) {
28
- return undefined;
29
- }
30
- const captureUserInput = FlowCaptureUserInput.fromHubtypeCMS(captureUserInputNode);
31
- if (captureUserInput.aiValidationType === HtAiValidationType.NONE) {
32
- this.cmsApi.setUserExtraDataVariable(captureUserInputNode.content.field_name, this.textOrTranscript);
33
- await this.trackUserInputCapture(captureUserInputNode, true);
34
- return captureUserInput.captureSuccessId;
35
- }
36
- const aiCaptureResponse = await this.getAiCaptureResponse(captureUserInputNode);
37
- if (!aiCaptureResponse.success) {
38
- await this.trackUserInputCapture(captureUserInputNode, false);
39
- return captureUserInput.captureFailId;
40
- }
41
- this.cmsApi.setUserExtraDataVariable(captureUserInputNode.content.field_name, aiCaptureResponse.value);
42
- await this.trackUserInputCapture(captureUserInputNode, true);
43
- return captureUserInput.captureSuccessId;
44
- }
45
- return undefined;
46
- }
47
- async getAiCaptureResponse(captureUserInputNode) {
48
- try {
49
- const url = `${process.env.HUBTYPE_API_URL}/external/v1/capture_user_input/`;
50
- const data = {
51
- field_name: captureUserInputNode.content.field_name,
52
- validation_instructions: captureUserInputNode.content.ai_validation_instructions,
53
- user_input: this.textOrTranscript
54
- };
55
- const pluginFlowBuilder = getFlowBuilderPlugin(this.request.plugins);
56
- const token = pluginFlowBuilder.getAccessToken(this.request.session);
57
- const config = {
58
- headers: {
59
- 'Content-Type': 'application/json',
60
- Authorization: `Bearer ${token}`
61
- }
62
- };
63
- const aiCaptureResponse = await axios.post(url, data, config);
64
- return aiCaptureResponse.data;
65
- } catch (error) {
66
- console.warn('Error getting ai/capture_user_input', error);
67
- }
68
- return {
69
- success: false
70
- };
71
- }
72
- async trackUserInputCapture(captureUserInputNode, captureSuccess) {
73
- const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } = getCommonFlowContentEventArgsForContentId(this.request, captureUserInputNode.id);
74
- const event = {
75
- action: EventAction.CaptureUserInput,
76
- flowThreadId,
77
- flowId,
78
- flowName,
79
- flowNodeId,
80
- flowNodeContentId,
81
- flowNodeIsMeaningful: false,
82
- fieldName: captureUserInputNode.content.field_name,
83
- userInput: this.textOrTranscript,
84
- captureSuccess,
85
- messageId: this.request.input.message_id
86
- };
87
- const { action, ...eventArgs } = event;
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;
94
- }
95
- }
96
-
97
- export { CaptureUserInputApi };
98
-
99
- //# sourceMappingURL=capture-user-input-api.js.map
@@ -1 +0,0 @@
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":"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"}
@@ -1,4 +0,0 @@
1
- import type { ActionRequest } from '@botonic/react';
2
- import type { FlowBuilderApi } from '../api.js';
3
- import { type SmartIntentsInferenceConfig } from './smart-intent.js';
4
- export declare function getNextPayloadByUserInput(cmsApi: FlowBuilderApi, locale: string, request: ActionRequest, smartIntentsConfig: SmartIntentsInferenceConfig): Promise<string | undefined>;
@@ -1,46 +0,0 @@
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
-
14
- async function getNextPayloadByUserInput(cmsApi, locale, request, smartIntentsConfig) {
15
- const userTextOrTranscript = getTextOrTranscript(request.input);
16
- if (userTextOrTranscript) {
17
- if (cmsApi.shouldCaptureUserInput()) {
18
- const captureUserInputApi = new CaptureUserInputApi(cmsApi, request, userTextOrTranscript);
19
- return await captureUserInputApi.getNextNodeId();
20
- }
21
- if (isKeywordsAllowed(request)) {
22
- const keywordMatcher = new KeywordMatcher({
23
- cmsApi,
24
- locale,
25
- request,
26
- userTextOrTranscript
27
- });
28
- const keywordNode = await keywordMatcher.getNodeByInput();
29
- if (keywordNode) {
30
- return cmsApi.getPayload(keywordNode.target);
31
- }
32
- }
33
- if (isSmartIntentsAllowed(request)) {
34
- const smartIntentsApi = new SmartIntentsApi(cmsApi, request, smartIntentsConfig, userTextOrTranscript);
35
- const smartIntentNode = await smartIntentsApi.getNodeByInput();
36
- if (smartIntentNode) {
37
- return cmsApi.getPayload(smartIntentNode.target);
38
- }
39
- }
40
- }
41
- return undefined;
42
- }
43
-
44
- export { getNextPayloadByUserInput };
45
-
46
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
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,27 +0,0 @@
1
- import type { ActionRequest } from '@botonic/react';
2
- import type { FlowBuilderApi } from '../api.js';
3
- import type { HtKeywordNode } from '../content-fields/hubtype-fields/index.js';
4
- interface KeywordProps {
5
- cmsApi: FlowBuilderApi;
6
- locale: string;
7
- request: ActionRequest;
8
- userTextOrTranscript: string;
9
- }
10
- export declare class KeywordMatcher {
11
- cmsApi: FlowBuilderApi;
12
- locale: string;
13
- request: ActionRequest;
14
- isRegExp: boolean;
15
- matchedKeyword?: string;
16
- keywordNodeId?: string;
17
- flowId?: string;
18
- userTextOrTranscript: string;
19
- constructor({ cmsApi, locale, request, userTextOrTranscript }: KeywordProps);
20
- getNodeByInput(): Promise<HtKeywordNode | undefined>;
21
- private getNodeByKeyword;
22
- private matchKeywords;
23
- private inputMatchesAnyKeyword;
24
- private resolveKeywordAsRegExp;
25
- private trackKeywordEvent;
26
- }
27
- export {};
@@ -1,89 +0,0 @@
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
-
11
- class KeywordMatcher {
12
- async getNodeByInput() {
13
- const keywordNodes = this.cmsApi.getKeywordNodes();
14
- const keywordNode = this.getNodeByKeyword(this.userTextOrTranscript, keywordNodes);
15
- if (!keywordNode || !this.matchedKeyword) {
16
- return undefined;
17
- }
18
- const targetPayload = this.cmsApi.getPayload(keywordNode.target);
19
- this.request.input.nluResolution = {
20
- type: NluType.Keyword,
21
- matchedValue: this.matchedKeyword,
22
- payload: targetPayload
23
- };
24
- await this.trackKeywordEvent();
25
- return keywordNode;
26
- }
27
- getNodeByKeyword(userInput, keywordNodes) {
28
- const matchedKeywordNode = keywordNodes.find((node)=>this.matchKeywords(userInput, node));
29
- return matchedKeywordNode?.target ? matchedKeywordNode : undefined;
30
- }
31
- matchKeywords(userInput, node) {
32
- const result = node.content.keywords.find((keywords)=>{
33
- if (keywords.locale === this.locale) {
34
- this.keywordNodeId = node.id;
35
- this.flowId = this.cmsApi.getNodeById(node.id).flow_id;
36
- return this.inputMatchesAnyKeyword(userInput, keywords.values);
37
- }
38
- return false;
39
- });
40
- return Boolean(result);
41
- }
42
- inputMatchesAnyKeyword(userInput, keywords) {
43
- return keywords.some((keyword)=>{
44
- const regExpMatchArray = keyword.match(REG_EXP_PATTERN);
45
- if (regExpMatchArray) {
46
- const keywordAsRegExp = this.resolveKeywordAsRegExp(regExpMatchArray);
47
- const match = userInput.match(keywordAsRegExp);
48
- this.isRegExp = true;
49
- this.matchedKeyword = match ? match[0] : undefined;
50
- } else {
51
- this.isRegExp = false;
52
- this.matchedKeyword = userInput.includes(keyword) ? keyword : undefined;
53
- }
54
- return this.matchedKeyword !== undefined;
55
- });
56
- }
57
- resolveKeywordAsRegExp(regExpMatchArray) {
58
- const [, pattern, flags] = regExpMatchArray;
59
- return new RegExp(pattern, flags);
60
- }
61
- async trackKeywordEvent() {
62
- const { flowId, flowName, flowNodeId, flowNodeContentId } = getCommonFlowContentEventArgsForContentId(this.request, this.keywordNodeId);
63
- const event = {
64
- action: EventAction.Keyword,
65
- flowNodeId,
66
- flowId,
67
- flowName,
68
- flowNodeContentId,
69
- flowThreadId: this.request.session.flow_thread_id,
70
- nluKeywordName: this.matchedKeyword,
71
- nluKeywordIsRegex: this.isRegExp,
72
- nluKeywordMessageId: this.request.input.message_id,
73
- userInput: this.userTextOrTranscript
74
- };
75
- const { action, ...eventArgs } = event;
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;
84
- }
85
- }
86
-
87
- export { KeywordMatcher };
88
-
89
- //# sourceMappingURL=keyword.js.map
@@ -1 +0,0 @@
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":"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"}
@@ -1,24 +0,0 @@
1
- import type { ActionRequest } from '@botonic/react';
2
- import type { FlowBuilderApi } from '../api.js';
3
- import type { HtSmartIntentNode } from '../content-fields/hubtype-fields/smart-intent.js';
4
- export interface SmartIntentsInferenceParams {
5
- bot_id: string;
6
- text: string;
7
- num_smart_intents_to_use?: number;
8
- use_latest: boolean;
9
- disabled_smart_intent_titles: string[];
10
- }
11
- export interface SmartIntentsInferenceConfig {
12
- useLatest: boolean;
13
- numSmartIntentsToUse?: number;
14
- }
15
- export declare class SmartIntentsApi {
16
- cmsApi: FlowBuilderApi;
17
- currentRequest: ActionRequest;
18
- smartIntentsConfig: SmartIntentsInferenceConfig;
19
- userTextOrTranscript: string;
20
- constructor(cmsApi: FlowBuilderApi, currentRequest: ActionRequest, smartIntentsConfig: SmartIntentsInferenceConfig, userTextOrTranscript: string);
21
- getNodeByInput(): Promise<HtSmartIntentNode | undefined>;
22
- private resolveUseLatest;
23
- private getInference;
24
- }
@@ -1,93 +0,0 @@
1
- import { EventAction, NluType } from "@botonic/core";
2
- import axios from "axios";
3
- import { getCommonFlowContentEventArgsForContentId, trackEvent } from "../tracking.js";
4
- import { getFlowBuilderPlugin } from "../utils/get-flow-builder-plugin.js";
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
- class SmartIntentsApi {
15
- async getNodeByInput() {
16
- if (!this.userTextOrTranscript) {
17
- return undefined;
18
- }
19
- const smartIntentNodes = this.cmsApi.getSmartIntentNodes();
20
- if (!smartIntentNodes.length) {
21
- return undefined;
22
- }
23
- const disabledSmartIntentTitles = smartIntentNodes.filter((smartIntentNode)=>smartIntentNode.content.is_active === false).map((smartIntentNode)=>smartIntentNode.content.title);
24
- const params = {
25
- bot_id: this.currentRequest.session.bot.id,
26
- text: this.userTextOrTranscript,
27
- num_smart_intents_to_use: this.smartIntentsConfig.numSmartIntentsToUse,
28
- use_latest: this.resolveUseLatest(),
29
- disabled_smart_intent_titles: disabledSmartIntentTitles
30
- };
31
- try {
32
- const response = await this.getInference(params);
33
- const smartIntentNode = smartIntentNodes.find((smartIntentNode)=>smartIntentNode.content.title === response.data.smart_intent_title);
34
- if (smartIntentNode) {
35
- const targetPayload = this.cmsApi.getPayload(smartIntentNode.target);
36
- this.currentRequest.input.nluResolution = {
37
- type: NluType.SmartIntent,
38
- matchedValue: smartIntentNode.content.title,
39
- payload: targetPayload
40
- };
41
- const { flowId, flowName, flowNodeId, flowNodeContentId } = getCommonFlowContentEventArgsForContentId(this.currentRequest, smartIntentNode.id);
42
- const event = {
43
- action: EventAction.IntentSmart,
44
- nluIntentSmartTitle: response.data.smart_intent_title,
45
- nluIntentSmartNumUsed: response.data.smart_intents_used.length,
46
- nluIntentSmartMessageId: this.currentRequest.input.message_id,
47
- userInput: this.userTextOrTranscript,
48
- flowThreadId: this.currentRequest.session.flow_thread_id,
49
- flowId,
50
- flowName,
51
- flowNodeContentId,
52
- flowNodeId
53
- };
54
- const { action, ...eventArgs } = event;
55
- await trackEvent(this.currentRequest, action, eventArgs);
56
- return smartIntentNode;
57
- }
58
- } catch (e) {
59
- console.error(e);
60
- }
61
- return undefined;
62
- }
63
- resolveUseLatest() {
64
- if (this.currentRequest.session.is_test_integration) {
65
- return false;
66
- }
67
- return this.smartIntentsConfig.useLatest;
68
- }
69
- async getInference(inferenceParams) {
70
- const pluginFlowBuilder = getFlowBuilderPlugin(this.currentRequest.plugins);
71
- const token = pluginFlowBuilder.getAccessToken(this.currentRequest.session);
72
- return await axios({
73
- method: 'POST',
74
- url: `${process.env.HUBTYPE_API_URL}/external/v2/ai/smart_intents/inference/`,
75
- headers: {
76
- Authorization: `Bearer ${token}`,
77
- 'Content-Type': 'application/json'
78
- },
79
- data: inferenceParams,
80
- timeout: 10000
81
- });
82
- }
83
- constructor(cmsApi, currentRequest, smartIntentsConfig, userTextOrTranscript){
84
- this.cmsApi = cmsApi;
85
- this.currentRequest = currentRequest;
86
- this.smartIntentsConfig = smartIntentsConfig;
87
- this.userTextOrTranscript = userTextOrTranscript;
88
- }
89
- }
90
-
91
- export { SmartIntentsApi };
92
-
93
- //# sourceMappingURL=smart-intent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"user-input/smart-intent.js","sources":["../../src/user-input/smart-intent.ts"],"sourcesContent":["import { EventAction, type EventIntentSmart, NluType } from '@botonic/core'\nimport type { ActionRequest } from '@botonic/react'\nimport axios from 'axios'\n\nimport type { FlowBuilderApi } from '../api'\nimport type { HtSmartIntentNode } from '../content-fields/hubtype-fields/smart-intent'\nimport {\n getCommonFlowContentEventArgsForContentId,\n trackEvent,\n} from '../tracking'\nimport type { SmartIntentResponse } from '../types'\nimport { getFlowBuilderPlugin } from '../utils/get-flow-builder-plugin'\n\nexport interface SmartIntentsInferenceParams {\n bot_id: string\n text: string\n num_smart_intents_to_use?: number\n use_latest: boolean\n disabled_smart_intent_titles: string[]\n}\n\nexport interface SmartIntentsInferenceConfig {\n useLatest: boolean\n numSmartIntentsToUse?: number\n}\n\nexport class SmartIntentsApi {\n constructor(\n public cmsApi: FlowBuilderApi,\n public currentRequest: ActionRequest,\n public smartIntentsConfig: SmartIntentsInferenceConfig,\n public userTextOrTranscript: string\n ) {}\n\n async getNodeByInput(): Promise<HtSmartIntentNode | undefined> {\n if (!this.userTextOrTranscript) {\n return undefined\n }\n const smartIntentNodes = this.cmsApi.getSmartIntentNodes()\n if (!smartIntentNodes.length) {\n return undefined\n }\n\n const disabledSmartIntentTitles = smartIntentNodes\n .filter(smartIntentNode => smartIntentNode.content.is_active === false)\n .map(smartIntentNode => smartIntentNode.content.title)\n\n const params = {\n bot_id: this.currentRequest.session.bot.id,\n text: this.userTextOrTranscript,\n num_smart_intents_to_use: this.smartIntentsConfig.numSmartIntentsToUse,\n use_latest: this.resolveUseLatest(),\n disabled_smart_intent_titles: disabledSmartIntentTitles,\n }\n\n try {\n const response = await this.getInference(params)\n const smartIntentNode = smartIntentNodes.find(\n smartIntentNode =>\n smartIntentNode.content.title === response.data.smart_intent_title\n )\n\n if (smartIntentNode) {\n const targetPayload = this.cmsApi.getPayload(smartIntentNode.target)\n this.currentRequest.input.nluResolution = {\n type: NluType.SmartIntent,\n matchedValue: smartIntentNode.content.title,\n payload: targetPayload,\n }\n\n const { flowId, flowName, flowNodeId, flowNodeContentId } =\n getCommonFlowContentEventArgsForContentId(\n this.currentRequest,\n smartIntentNode.id\n )\n\n const event: EventIntentSmart = {\n action: EventAction.IntentSmart,\n nluIntentSmartTitle: response.data.smart_intent_title,\n nluIntentSmartNumUsed: response.data.smart_intents_used.length,\n nluIntentSmartMessageId: this.currentRequest.input.message_id,\n userInput: this.userTextOrTranscript,\n flowThreadId: this.currentRequest.session.flow_thread_id as string,\n flowId,\n flowName,\n flowNodeContentId,\n flowNodeId,\n }\n const { action, ...eventArgs } = event\n\n await trackEvent(this.currentRequest, action, eventArgs)\n\n return smartIntentNode\n }\n } catch (e) {\n console.error(e)\n }\n return undefined\n }\n\n private resolveUseLatest(): boolean {\n if (this.currentRequest.session.is_test_integration) {\n return false\n }\n return this.smartIntentsConfig.useLatest\n }\n\n private async getInference(\n inferenceParams: SmartIntentsInferenceParams\n ): Promise<SmartIntentResponse> {\n const pluginFlowBuilder = getFlowBuilderPlugin(this.currentRequest.plugins)\n const token = pluginFlowBuilder.getAccessToken(this.currentRequest.session)\n\n return await axios({\n method: 'POST',\n url: `${process.env.HUBTYPE_API_URL}/external/v2/ai/smart_intents/inference/`,\n headers: {\n Authorization: `Bearer ${token}`,\n 'Content-Type': 'application/json',\n },\n data: inferenceParams,\n timeout: 10000,\n })\n }\n}\n"],"names":["EventAction","NluType","axios","getCommonFlowContentEventArgsForContentId","trackEvent","getFlowBuilderPlugin","SmartIntentsApi","undefined","smartIntentNodes","disabledSmartIntentTitles","smartIntentNode","params","response","targetPayload","flowId","flowName","flowNodeId","flowNodeContentId","event","action","eventArgs","e","console","inferenceParams","pluginFlowBuilder","token","process","cmsApi","currentRequest","smartIntentsConfig","userTextOrTranscript"],"mappings":"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"}