@botonic/plugin-flow-builder 0.44.2 → 0.45.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 (337) hide show
  1. package/lib/cjs/action/ai-agent.d.ts +2 -2
  2. package/lib/cjs/action/ai-agent.js.map +1 -1
  3. package/lib/cjs/action/fallback.d.ts +2 -2
  4. package/lib/cjs/action/fallback.js.map +1 -1
  5. package/lib/cjs/action/first-interaction.d.ts +2 -2
  6. package/lib/cjs/action/first-interaction.js +1 -1
  7. package/lib/cjs/action/first-interaction.js.map +1 -1
  8. package/lib/cjs/action/index.d.ts +4 -4
  9. package/lib/cjs/action/index.js.map +1 -1
  10. package/lib/cjs/action/knowledge-bases.d.ts +2 -2
  11. package/lib/cjs/action/payload.d.ts +2 -2
  12. package/lib/cjs/action/payload.js.map +1 -1
  13. package/lib/cjs/api.d.ts +3 -3
  14. package/lib/cjs/api.js +10 -5
  15. package/lib/cjs/api.js.map +1 -1
  16. package/lib/cjs/content-fields/content-fields-base.d.ts +4 -2
  17. package/lib/cjs/content-fields/content-fields-base.js +21 -2
  18. package/lib/cjs/content-fields/content-fields-base.js.map +1 -1
  19. package/lib/cjs/content-fields/flow-ai-agent.d.ts +3 -3
  20. package/lib/cjs/content-fields/flow-ai-agent.js +3 -1
  21. package/lib/cjs/content-fields/flow-ai-agent.js.map +1 -1
  22. package/lib/cjs/content-fields/flow-bot-action.d.ts +3 -3
  23. package/lib/cjs/content-fields/flow-bot-action.js.map +1 -1
  24. package/lib/cjs/content-fields/flow-button.d.ts +4 -4
  25. package/lib/cjs/content-fields/flow-button.js +6 -5
  26. package/lib/cjs/content-fields/flow-button.js.map +1 -1
  27. package/lib/cjs/content-fields/flow-capture-user-input.d.ts +2 -2
  28. package/lib/cjs/content-fields/flow-carousel.d.ts +4 -4
  29. package/lib/cjs/content-fields/flow-carousel.js +1 -1
  30. package/lib/cjs/content-fields/flow-carousel.js.map +1 -1
  31. package/lib/cjs/content-fields/flow-channel-conditional.d.ts +3 -3
  32. package/lib/cjs/content-fields/flow-channel-conditional.js.map +1 -1
  33. package/lib/cjs/content-fields/flow-country-conditional.d.ts +3 -3
  34. package/lib/cjs/content-fields/flow-country-conditional.js.map +1 -1
  35. package/lib/cjs/content-fields/flow-custom-conditional.d.ts +3 -3
  36. package/lib/cjs/content-fields/flow-custom-conditional.js +1 -2
  37. package/lib/cjs/content-fields/flow-custom-conditional.js.map +1 -1
  38. package/lib/cjs/content-fields/flow-element.d.ts +4 -4
  39. package/lib/cjs/content-fields/flow-element.js +3 -3
  40. package/lib/cjs/content-fields/flow-element.js.map +1 -1
  41. package/lib/cjs/content-fields/flow-go-to-flow.d.ts +3 -3
  42. package/lib/cjs/content-fields/flow-go-to-flow.js.map +1 -1
  43. package/lib/cjs/content-fields/flow-handoff.d.ts +3 -3
  44. package/lib/cjs/content-fields/flow-handoff.js +2 -2
  45. package/lib/cjs/content-fields/flow-handoff.js.map +1 -1
  46. package/lib/cjs/content-fields/flow-image.d.ts +2 -2
  47. package/lib/cjs/content-fields/flow-image.js +1 -1
  48. package/lib/cjs/content-fields/flow-image.js.map +1 -1
  49. package/lib/cjs/content-fields/flow-knowledge-base.d.ts +2 -2
  50. package/lib/cjs/content-fields/flow-knowledge-base.js.map +1 -1
  51. package/lib/cjs/content-fields/flow-queue-status-conditional.d.ts +3 -3
  52. package/lib/cjs/content-fields/flow-queue-status-conditional.js.map +1 -1
  53. package/lib/cjs/content-fields/flow-rating.d.ts +2 -2
  54. package/lib/cjs/content-fields/flow-rating.js +3 -3
  55. package/lib/cjs/content-fields/flow-rating.js.map +1 -1
  56. package/lib/cjs/content-fields/flow-text.d.ts +5 -5
  57. package/lib/cjs/content-fields/flow-text.js +1 -1
  58. package/lib/cjs/content-fields/flow-text.js.map +1 -1
  59. package/lib/cjs/content-fields/flow-video.d.ts +2 -2
  60. package/lib/cjs/content-fields/flow-video.js +1 -1
  61. package/lib/cjs/content-fields/flow-video.js.map +1 -1
  62. package/lib/cjs/content-fields/flow-webview.d.ts +2 -2
  63. package/lib/cjs/content-fields/flow-webview.js.map +1 -1
  64. package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.d.ts +3 -3
  65. package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js +10 -6
  66. package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js.map +1 -1
  67. package/lib/cjs/content-fields/flow-whatsapp-template.d.ts +2 -2
  68. package/lib/cjs/content-fields/flow-whatsapp-template.js.map +1 -1
  69. package/lib/cjs/content-fields/hubtype-fields/ai-agent.d.ts +2 -2
  70. package/lib/cjs/content-fields/hubtype-fields/bot-action.d.ts +2 -2
  71. package/lib/cjs/content-fields/hubtype-fields/button.d.ts +1 -1
  72. package/lib/cjs/content-fields/hubtype-fields/capture-user-input.d.ts +2 -2
  73. package/lib/cjs/content-fields/hubtype-fields/carousel.d.ts +3 -3
  74. package/lib/cjs/content-fields/hubtype-fields/channel-conditional.d.ts +3 -3
  75. package/lib/cjs/content-fields/hubtype-fields/common.d.ts +2 -2
  76. package/lib/cjs/content-fields/hubtype-fields/country-conditional.d.ts +3 -3
  77. package/lib/cjs/content-fields/hubtype-fields/custom-conditional.d.ts +3 -3
  78. package/lib/cjs/content-fields/hubtype-fields/fallback.d.ts +2 -2
  79. package/lib/cjs/content-fields/hubtype-fields/function.d.ts +2 -2
  80. package/lib/cjs/content-fields/hubtype-fields/go-to-flow.d.ts +2 -2
  81. package/lib/cjs/content-fields/hubtype-fields/handoff.d.ts +2 -2
  82. package/lib/cjs/content-fields/hubtype-fields/image.d.ts +2 -2
  83. package/lib/cjs/content-fields/hubtype-fields/keyword.d.ts +2 -2
  84. package/lib/cjs/content-fields/hubtype-fields/knowledge-base.d.ts +2 -2
  85. package/lib/cjs/content-fields/hubtype-fields/nodes.d.ts +21 -21
  86. package/lib/cjs/content-fields/hubtype-fields/payload.d.ts +1 -1
  87. package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.d.ts +3 -3
  88. package/lib/cjs/content-fields/hubtype-fields/rating.d.ts +2 -2
  89. package/lib/cjs/content-fields/hubtype-fields/smart-intent.d.ts +2 -2
  90. package/lib/cjs/content-fields/hubtype-fields/text.d.ts +3 -3
  91. package/lib/cjs/content-fields/hubtype-fields/url.d.ts +1 -1
  92. package/lib/cjs/content-fields/hubtype-fields/video.d.ts +2 -2
  93. package/lib/cjs/content-fields/hubtype-fields/webview.d.ts +2 -2
  94. package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.d.ts +2 -2
  95. package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.d.ts +4 -4
  96. package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.d.ts +4 -4
  97. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +3 -3
  98. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +2 -2
  99. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +1 -1
  100. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +3 -3
  101. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +3 -2
  102. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +1 -1
  103. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +3 -3
  104. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +3 -2
  105. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +1 -1
  106. package/lib/cjs/filters/index.d.ts +3 -3
  107. package/lib/cjs/flow-factory.d.ts +4 -4
  108. package/lib/cjs/functions/index.d.ts +2 -2
  109. package/lib/cjs/helpers.d.ts +2 -2
  110. package/lib/cjs/index.d.ts +6 -5
  111. package/lib/cjs/index.js +5 -1
  112. package/lib/cjs/index.js.map +1 -1
  113. package/lib/cjs/tracking.d.ts +3 -3
  114. package/lib/cjs/tracking.js.map +1 -1
  115. package/lib/cjs/types.d.ts +4 -3
  116. package/lib/cjs/types.js.map +1 -1
  117. package/lib/cjs/user-input/capture-user-input-api.d.ts +3 -3
  118. package/lib/cjs/user-input/capture-user-input-api.js.map +1 -1
  119. package/lib/cjs/user-input/index.d.ts +3 -3
  120. package/lib/cjs/user-input/index.js.map +1 -1
  121. package/lib/cjs/user-input/keyword.d.ts +3 -3
  122. package/lib/cjs/user-input/keyword.js.map +1 -1
  123. package/lib/cjs/user-input/smart-intent.d.ts +3 -3
  124. package/lib/cjs/user-input/smart-intent.js +6 -3
  125. package/lib/cjs/user-input/smart-intent.js.map +1 -1
  126. package/lib/cjs/utils.d.ts +2 -3
  127. package/lib/cjs/utils.js +0 -21
  128. package/lib/cjs/utils.js.map +1 -1
  129. package/lib/cjs/webview/contents-context.d.ts +1 -1
  130. package/lib/cjs/webview/types.d.ts +1 -1
  131. package/lib/cjs/webview/use-webview-contents.d.ts +1 -1
  132. package/lib/esm/action/ai-agent.d.ts +2 -2
  133. package/lib/esm/action/ai-agent.js.map +1 -1
  134. package/lib/esm/action/fallback.d.ts +2 -2
  135. package/lib/esm/action/fallback.js.map +1 -1
  136. package/lib/esm/action/first-interaction.d.ts +2 -2
  137. package/lib/esm/action/first-interaction.js +1 -1
  138. package/lib/esm/action/first-interaction.js.map +1 -1
  139. package/lib/esm/action/index.d.ts +4 -4
  140. package/lib/esm/action/index.js.map +1 -1
  141. package/lib/esm/action/knowledge-bases.d.ts +2 -2
  142. package/lib/esm/action/payload.d.ts +2 -2
  143. package/lib/esm/action/payload.js.map +1 -1
  144. package/lib/esm/api.d.ts +3 -3
  145. package/lib/esm/api.js +10 -5
  146. package/lib/esm/api.js.map +1 -1
  147. package/lib/esm/content-fields/content-fields-base.d.ts +4 -2
  148. package/lib/esm/content-fields/content-fields-base.js +21 -2
  149. package/lib/esm/content-fields/content-fields-base.js.map +1 -1
  150. package/lib/esm/content-fields/flow-ai-agent.d.ts +3 -3
  151. package/lib/esm/content-fields/flow-ai-agent.js +3 -1
  152. package/lib/esm/content-fields/flow-ai-agent.js.map +1 -1
  153. package/lib/esm/content-fields/flow-bot-action.d.ts +3 -3
  154. package/lib/esm/content-fields/flow-bot-action.js.map +1 -1
  155. package/lib/esm/content-fields/flow-button.d.ts +4 -4
  156. package/lib/esm/content-fields/flow-button.js +6 -5
  157. package/lib/esm/content-fields/flow-button.js.map +1 -1
  158. package/lib/esm/content-fields/flow-capture-user-input.d.ts +2 -2
  159. package/lib/esm/content-fields/flow-carousel.d.ts +4 -4
  160. package/lib/esm/content-fields/flow-carousel.js +1 -1
  161. package/lib/esm/content-fields/flow-carousel.js.map +1 -1
  162. package/lib/esm/content-fields/flow-channel-conditional.d.ts +3 -3
  163. package/lib/esm/content-fields/flow-channel-conditional.js.map +1 -1
  164. package/lib/esm/content-fields/flow-country-conditional.d.ts +3 -3
  165. package/lib/esm/content-fields/flow-country-conditional.js.map +1 -1
  166. package/lib/esm/content-fields/flow-custom-conditional.d.ts +3 -3
  167. package/lib/esm/content-fields/flow-custom-conditional.js +1 -2
  168. package/lib/esm/content-fields/flow-custom-conditional.js.map +1 -1
  169. package/lib/esm/content-fields/flow-element.d.ts +4 -4
  170. package/lib/esm/content-fields/flow-element.js +3 -3
  171. package/lib/esm/content-fields/flow-element.js.map +1 -1
  172. package/lib/esm/content-fields/flow-go-to-flow.d.ts +3 -3
  173. package/lib/esm/content-fields/flow-go-to-flow.js.map +1 -1
  174. package/lib/esm/content-fields/flow-handoff.d.ts +3 -3
  175. package/lib/esm/content-fields/flow-handoff.js +2 -2
  176. package/lib/esm/content-fields/flow-handoff.js.map +1 -1
  177. package/lib/esm/content-fields/flow-image.d.ts +2 -2
  178. package/lib/esm/content-fields/flow-image.js +1 -1
  179. package/lib/esm/content-fields/flow-image.js.map +1 -1
  180. package/lib/esm/content-fields/flow-knowledge-base.d.ts +2 -2
  181. package/lib/esm/content-fields/flow-knowledge-base.js.map +1 -1
  182. package/lib/esm/content-fields/flow-queue-status-conditional.d.ts +3 -3
  183. package/lib/esm/content-fields/flow-queue-status-conditional.js.map +1 -1
  184. package/lib/esm/content-fields/flow-rating.d.ts +2 -2
  185. package/lib/esm/content-fields/flow-rating.js +3 -3
  186. package/lib/esm/content-fields/flow-rating.js.map +1 -1
  187. package/lib/esm/content-fields/flow-text.d.ts +5 -5
  188. package/lib/esm/content-fields/flow-text.js +1 -1
  189. package/lib/esm/content-fields/flow-text.js.map +1 -1
  190. package/lib/esm/content-fields/flow-video.d.ts +2 -2
  191. package/lib/esm/content-fields/flow-video.js +1 -1
  192. package/lib/esm/content-fields/flow-video.js.map +1 -1
  193. package/lib/esm/content-fields/flow-webview.d.ts +2 -2
  194. package/lib/esm/content-fields/flow-webview.js.map +1 -1
  195. package/lib/esm/content-fields/flow-whatsapp-cta-url-button.d.ts +3 -3
  196. package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js +10 -6
  197. package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js.map +1 -1
  198. package/lib/esm/content-fields/flow-whatsapp-template.d.ts +2 -2
  199. package/lib/esm/content-fields/flow-whatsapp-template.js.map +1 -1
  200. package/lib/esm/content-fields/hubtype-fields/ai-agent.d.ts +2 -2
  201. package/lib/esm/content-fields/hubtype-fields/bot-action.d.ts +2 -2
  202. package/lib/esm/content-fields/hubtype-fields/button.d.ts +1 -1
  203. package/lib/esm/content-fields/hubtype-fields/capture-user-input.d.ts +2 -2
  204. package/lib/esm/content-fields/hubtype-fields/carousel.d.ts +3 -3
  205. package/lib/esm/content-fields/hubtype-fields/channel-conditional.d.ts +3 -3
  206. package/lib/esm/content-fields/hubtype-fields/common.d.ts +2 -2
  207. package/lib/esm/content-fields/hubtype-fields/country-conditional.d.ts +3 -3
  208. package/lib/esm/content-fields/hubtype-fields/custom-conditional.d.ts +3 -3
  209. package/lib/esm/content-fields/hubtype-fields/fallback.d.ts +2 -2
  210. package/lib/esm/content-fields/hubtype-fields/function.d.ts +2 -2
  211. package/lib/esm/content-fields/hubtype-fields/go-to-flow.d.ts +2 -2
  212. package/lib/esm/content-fields/hubtype-fields/handoff.d.ts +2 -2
  213. package/lib/esm/content-fields/hubtype-fields/image.d.ts +2 -2
  214. package/lib/esm/content-fields/hubtype-fields/keyword.d.ts +2 -2
  215. package/lib/esm/content-fields/hubtype-fields/knowledge-base.d.ts +2 -2
  216. package/lib/esm/content-fields/hubtype-fields/nodes.d.ts +21 -21
  217. package/lib/esm/content-fields/hubtype-fields/payload.d.ts +1 -1
  218. package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.d.ts +3 -3
  219. package/lib/esm/content-fields/hubtype-fields/rating.d.ts +2 -2
  220. package/lib/esm/content-fields/hubtype-fields/smart-intent.d.ts +2 -2
  221. package/lib/esm/content-fields/hubtype-fields/text.d.ts +3 -3
  222. package/lib/esm/content-fields/hubtype-fields/url.d.ts +1 -1
  223. package/lib/esm/content-fields/hubtype-fields/video.d.ts +2 -2
  224. package/lib/esm/content-fields/hubtype-fields/webview.d.ts +2 -2
  225. package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.d.ts +2 -2
  226. package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.d.ts +4 -4
  227. package/lib/esm/content-fields/hubtype-fields/whatsapp-template.d.ts +4 -4
  228. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +3 -3
  229. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +2 -2
  230. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +1 -1
  231. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +3 -3
  232. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +3 -2
  233. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +1 -1
  234. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +3 -3
  235. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +3 -2
  236. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +1 -1
  237. package/lib/esm/filters/index.d.ts +3 -3
  238. package/lib/esm/flow-factory.d.ts +4 -4
  239. package/lib/esm/functions/index.d.ts +2 -2
  240. package/lib/esm/helpers.d.ts +2 -2
  241. package/lib/esm/index.d.ts +6 -5
  242. package/lib/esm/index.js +5 -1
  243. package/lib/esm/index.js.map +1 -1
  244. package/lib/esm/tracking.d.ts +3 -3
  245. package/lib/esm/tracking.js.map +1 -1
  246. package/lib/esm/types.d.ts +4 -3
  247. package/lib/esm/types.js.map +1 -1
  248. package/lib/esm/user-input/capture-user-input-api.d.ts +3 -3
  249. package/lib/esm/user-input/capture-user-input-api.js.map +1 -1
  250. package/lib/esm/user-input/index.d.ts +3 -3
  251. package/lib/esm/user-input/index.js.map +1 -1
  252. package/lib/esm/user-input/keyword.d.ts +3 -3
  253. package/lib/esm/user-input/keyword.js.map +1 -1
  254. package/lib/esm/user-input/smart-intent.d.ts +3 -3
  255. package/lib/esm/user-input/smart-intent.js +6 -3
  256. package/lib/esm/user-input/smart-intent.js.map +1 -1
  257. package/lib/esm/utils.d.ts +2 -3
  258. package/lib/esm/utils.js +0 -21
  259. package/lib/esm/utils.js.map +1 -1
  260. package/lib/esm/webview/contents-context.d.ts +1 -1
  261. package/lib/esm/webview/types.d.ts +1 -1
  262. package/lib/esm/webview/use-webview-contents.d.ts +1 -1
  263. package/package.json +5 -8
  264. package/src/action/ai-agent.ts +7 -7
  265. package/src/action/fallback.ts +5 -5
  266. package/src/action/first-interaction.ts +5 -5
  267. package/src/action/index.tsx +6 -6
  268. package/src/action/knowledge-bases.ts +7 -7
  269. package/src/action/payload.ts +4 -4
  270. package/src/api.ts +31 -21
  271. package/src/content-fields/content-fields-base.ts +32 -4
  272. package/src/content-fields/flow-ai-agent.tsx +11 -4
  273. package/src/content-fields/flow-bot-action.tsx +4 -4
  274. package/src/content-fields/flow-button.tsx +15 -12
  275. package/src/content-fields/flow-capture-user-input.tsx +2 -2
  276. package/src/content-fields/flow-carousel.tsx +6 -7
  277. package/src/content-fields/flow-channel-conditional.tsx +4 -4
  278. package/src/content-fields/flow-country-conditional.tsx +4 -4
  279. package/src/content-fields/flow-custom-conditional.tsx +5 -6
  280. package/src/content-fields/flow-element.tsx +16 -7
  281. package/src/content-fields/flow-go-to-flow.tsx +4 -4
  282. package/src/content-fields/flow-handoff.tsx +11 -5
  283. package/src/content-fields/flow-image.tsx +3 -4
  284. package/src/content-fields/flow-knowledge-base.tsx +2 -4
  285. package/src/content-fields/flow-queue-status-conditional.tsx +4 -5
  286. package/src/content-fields/flow-rating.tsx +5 -5
  287. package/src/content-fields/flow-text.tsx +10 -7
  288. package/src/content-fields/flow-video.tsx +3 -4
  289. package/src/content-fields/flow-webview.tsx +3 -3
  290. package/src/content-fields/flow-whatsapp-cta-url-button.tsx +25 -22
  291. package/src/content-fields/flow-whatsapp-template.tsx +10 -11
  292. package/src/content-fields/hubtype-fields/ai-agent.ts +2 -2
  293. package/src/content-fields/hubtype-fields/bot-action.ts +2 -2
  294. package/src/content-fields/hubtype-fields/button.ts +1 -1
  295. package/src/content-fields/hubtype-fields/capture-user-input.ts +2 -2
  296. package/src/content-fields/hubtype-fields/carousel.ts +3 -3
  297. package/src/content-fields/hubtype-fields/channel-conditional.ts +3 -3
  298. package/src/content-fields/hubtype-fields/common.ts +5 -2
  299. package/src/content-fields/hubtype-fields/country-conditional.ts +3 -3
  300. package/src/content-fields/hubtype-fields/custom-conditional.ts +3 -3
  301. package/src/content-fields/hubtype-fields/fallback.ts +2 -2
  302. package/src/content-fields/hubtype-fields/function.ts +2 -2
  303. package/src/content-fields/hubtype-fields/go-to-flow.ts +2 -2
  304. package/src/content-fields/hubtype-fields/handoff.ts +2 -2
  305. package/src/content-fields/hubtype-fields/image.ts +2 -2
  306. package/src/content-fields/hubtype-fields/keyword.ts +2 -2
  307. package/src/content-fields/hubtype-fields/knowledge-base.ts +2 -2
  308. package/src/content-fields/hubtype-fields/nodes.ts +21 -21
  309. package/src/content-fields/hubtype-fields/payload.ts +1 -1
  310. package/src/content-fields/hubtype-fields/queue-status-conditional.ts +3 -3
  311. package/src/content-fields/hubtype-fields/rating.ts +2 -2
  312. package/src/content-fields/hubtype-fields/smart-intent.ts +2 -2
  313. package/src/content-fields/hubtype-fields/text.ts +3 -3
  314. package/src/content-fields/hubtype-fields/url.ts +1 -1
  315. package/src/content-fields/hubtype-fields/video.ts +2 -2
  316. package/src/content-fields/hubtype-fields/webview.ts +2 -2
  317. package/src/content-fields/hubtype-fields/whatsapp-button-list.ts +2 -2
  318. package/src/content-fields/hubtype-fields/whatsapp-cta-url-button.ts +4 -4
  319. package/src/content-fields/hubtype-fields/whatsapp-template.ts +4 -4
  320. package/src/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.tsx +11 -5
  321. package/src/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.tsx +10 -5
  322. package/src/content-fields/whatsapp-button-list/flow-whatsapp-button-list.tsx +14 -9
  323. package/src/filters/index.ts +3 -3
  324. package/src/flow-factory.ts +5 -5
  325. package/src/functions/index.ts +2 -2
  326. package/src/helpers.ts +2 -2
  327. package/src/index.ts +24 -19
  328. package/src/tracking.ts +5 -5
  329. package/src/types.ts +8 -7
  330. package/src/user-input/capture-user-input-api.ts +4 -4
  331. package/src/user-input/index.ts +6 -3
  332. package/src/user-input/keyword.ts +4 -4
  333. package/src/user-input/smart-intent.ts +14 -8
  334. package/src/utils.ts +3 -35
  335. package/src/webview/contents-context.ts +1 -1
  336. package/src/webview/types.ts +1 -1
  337. package/src/webview/use-webview-contents.ts +6 -6
@@ -1 +1 @@
1
- {"version":3,"file":"keyword.js","sourceRoot":"","sources":["../../../src/user-input/keyword.ts"],"names":[],"mappings":";;;AAAA,wCAAkE;AAIlE,4CAA8C;AAK9C,0CAGoB;AAOpB,MAAa,cAAc;IASzB,YAAY,EAAE,MAAM,EAAE,MAAM,EA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AK,CAAC,iBAAiB;QAC7B,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,iBAAiB,EAAE,GACvD,IAAA,oDAAyC,EACvC,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,aAAuB,CAC7B,CAAA;QAEH,MAAM,KAAK,GAAiB;YAC1B,MAAM,EAAE,kBAAW,CAAC,OAAO;YAC3B,UAAU;YACV,MAAM;YACN,QAAQ;YACR,iBAAiB;YACjB,YAAY,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,cAAwB;YAC3D,cAAc,EAAE,IAAI,CAAC,cAAwB;YAC7C,iBAAiB,EAAE,IAAI,CAAC,QAAQ;YAChC,mBAAmB,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU;YAClD,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAc;SAC7C,CAAA;QACD,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAA;QACtC,MAAM,IAAA,qBAAU,EAAC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,CAAA;IACnD,CAAC;CACF;AA5GD,wCA4GC"}
@@ -1,6 +1,6 @@
1
- import { ActionRequest } from '@botonic/react';
2
- import { FlowBuilderApi } from '../api';
3
- import { HtSmartIntentNode } from '../content-fields/hubtype-fields/smart-intent';
1
+ import type { ActionRequest } from '@botonic/react';
2
+ import type { FlowBuilderApi } from '../api';
3
+ import type { HtSmartIntentNode } from '../content-fields/hubtype-fields/smart-intent';
4
4
  export interface SmartIntentsInferenceParams {
5
5
  bot_id: string;
6
6
  text: string;
@@ -14,11 +14,13 @@ class SmartIntentsApi {
14
14
  this.flowId = flowId;
15
15
  }
16
16
  async getNodeByInput() {
17
- if (!this.currentRequest.input.data)
17
+ if (!this.currentRequest.input.data) {
18
18
  return undefined;
19
+ }
19
20
  const smartIntentNodes = this.cmsApi.getSmartIntentNodes();
20
- if (!smartIntentNodes.length)
21
+ if (!smartIntentNodes.length) {
21
22
  return undefined;
23
+ }
22
24
  const params = {
23
25
  bot_id: this.currentRequest.session.bot.id,
24
26
  text: this.currentRequest.input.data,
@@ -59,8 +61,9 @@ class SmartIntentsApi {
59
61
  return undefined;
60
62
  }
61
63
  resolveUseLatest() {
62
- if (this.currentRequest.session.is_test_integration)
64
+ if (this.currentRequest.session.is_test_integration) {
63
65
  return false;
66
+ }
64
67
  return this.smartIntentsConfig.useLatest;
65
68
  }
66
69
  async getInference(inferenceParams) {
@@ -1 +1 @@
1
- {"version":3,"file":"smart-intent.js","sourceRoot":"","sources":["../../../src/user-input/smart-intent.ts"],"names":[],"mappings":";;;;AAAA,wCAAsE;AAEtE,0DAAyB;AAIzB,wCAAiD;AACjD,0CAGoB;AAepB,MAAa,eAAe;IAC1B,YACS,MAAsB,EACtB,cAA6B,EAC7B,kBAA+C,EAC/C,MAAe;QAHf,WAAM,GAAN,MAAM,CAAgB;QACtB,mBAAc,GAAd,cAAc,CAAe;QAC7B,uBAAkB,GAAlB,kBAAkB,CAA6B;QAC/C,WAAM,GAAN,MAAM,CAAS;IACrB,CAAC;IAEJ,KAAK,CAAC,cAAc;QAClB,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI;YAAE,OAAO,SAAS,CAAA;QACrD,MAAM,gBAAgB,GAAG,IAAI,CAAC,MAAM,CAAC,mBAAmB,EAAE,CAAA;QAC1D,IAAI,CAAC,gBAAgB,CAAC,MAAM;YAAE,OAAO,SAAS,CAAA;QAE9C,MAAM,MAAM,GAAG;YACb,MAAM,EAAE,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAC1C,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI;YACpC,wBAAwB,EAAE,IAAI,CAAC,kBAAkB,CAAC,oBAAoB;YACtE,UAAU,EAAE,IAAI,CAAC,gBAAgB,EAAE;SACpC,CAAA;QAED,IAAI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AAC,OAAO,CAAC,CAAA;QAE3E,OAAO,MAAM,IAAA,eAAK,EAAC;YACjB,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,0CAA0C;YAC7E,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,KAAK,EAAE;gBAChC,cAAc,EAAE,kBAAkB;aACnC;YACD,IAAI,EAAE,eAAe;YACrB,OAAO,EAAE,KAAK;SACf,CAAC,CAAA;IACJ,CAAC;CACF;AA7FD,0CA6FC"}
@@ -1,7 +1,6 @@
1
- import { Input, Session } from '@botonic/core';
2
- import { ActionRequest } from '@botonic/react';
1
+ import { type Input, type Session } from '@botonic/core';
2
+ import type { ActionRequest } from '@botonic/react';
3
3
  export declare function resolveGetAccessToken(getAccessToken: (session: Session) => string): (session: Session) => string;
4
- export declare function getValueFromKeyPath(request: ActionRequest, keyPath: string): any;
5
4
  export declare function inputHasTextData(input: Input): boolean;
6
5
  export declare function isKeywordsAllowed(request: ActionRequest): boolean;
7
6
  export declare function isSmartIntentsAllowed(request: ActionRequest): boolean;
package/lib/esm/utils.js CHANGED
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.resolveGetAccessToken = resolveGetAccessToken;
4
- exports.getValueFromKeyPath = getValueFromKeyPath;
5
4
  exports.inputHasTextData = inputHasTextData;
6
5
  exports.isKeywordsAllowed = isKeywordsAllowed;
7
6
  exports.isSmartIntentsAllowed = isSmartIntentsAllowed;
@@ -25,26 +24,6 @@ function resolveGetAccessToken(getAccessToken) {
25
24
  throw new Error('No method defined for getting access token');
26
25
  }
27
26
  }
28
- function getValueFromKeyPath(request, keyPath) {
29
- if (keyPath.startsWith('session.user.contact_info.')) {
30
- const name = keyPath.split('.').at(-1);
31
- return request.session.user.contact_info?.find(contact => contact.name === name)?.value;
32
- }
33
- if (keyPath.startsWith('input.') || keyPath.startsWith('session.')) {
34
- return keyPath
35
- .split('.')
36
- .reduce((object, key) => resolveObjectKey(object, key), request);
37
- }
38
- return keyPath
39
- .split('.')
40
- .reduce((object, key) => resolveObjectKey(object, key), request.session.user.extra_data);
41
- }
42
- function resolveObjectKey(object, key) {
43
- if (object && object[key] !== undefined) {
44
- return object[key];
45
- }
46
- return undefined;
47
- }
48
27
  function inputHasTextData(input) {
49
28
  return input.data !== undefined && input.type === core_1.INPUT.TEXT;
50
29
  }
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;AAaA,sDAWC;AAED,kDAuBC;AASD,4CAEC;AAWD,8CAEC;AAED,sDAEC;AAED,0DAEC;AAjFD,wCAAqD;AAGrD,uCAAgD;AAChD,mCAA+D;AAE/D,SAAS,yBAAyB,CAAC,OAAgB;IACjD,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAA;IACrD,CAAC;IACD,OAAO,OAAO,CAAC,aAAa,CAAA;AAC9B,CAAC;AAED,SAAgB,qBAAqB,CACnC,cAA4C;IAE5C,QAAQ,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;QAC7B,KAAK,0BAAkB,CAAC,UAAU;YAChC,OAAO,yBAAyB,CAAA;QAClC,KAAK,0BAAkB,CAAC,WAAW;YACjC,OAAO,cAAc,CAAA;QACvB;YACE,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAA;IACjE,CAAC;AACH,CAAC;AAED,SAAgB,mBAAmB,CACjC,OAAsB,EACtB,OAAe;IAEf,IAAI,OAAO,CAAC,UAAU,CAAC,4BAA4B,CAAC,EAAE,CAAC;QACrD,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;QACtC,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAC5C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AU,CAAC,CAAA;IACrD,MAAM,iBAAiB,GAAG,IAAA,8BAAoB,EAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IAC/D,OAAO,CAAC,SAAS,IAAI,CAAC,SAAS,IAAI,iBAAiB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAA;AAC5E,CAAC;AAED,SAAgB,iBAAiB,CAAC,OAAsB;IACtD,OAAO,YAAY,CAAC,OAAO,EAAE,eAAe,CAAC,CAAA;AAC/C,CAAC;AAED,SAAgB,qBAAqB,CAAC,OAAsB;IAC1D,OAAO,YAAY,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAA;AACnD,CAAC;AAED,SAAgB,uBAAuB,CAAC,OAAsB;IAC5D,OAAO,YAAY,CAAC,OAAO,EAAE,qBAAqB,CAAC,CAAA;AACrD,CAAC"}
@@ -1,2 +1,2 @@
1
- import { MapContentsType, WebviewContentsContextType } from './types';
1
+ import type { MapContentsType, WebviewContentsContextType } from './types';
2
2
  export declare const createWebviewContentsContext: <T extends MapContentsType>() => import("react").Context<WebviewContentsContextType<T>>;
@@ -1,4 +1,4 @@
1
- import { FlowBuilderJSONVersion } from '../types';
1
+ import type { FlowBuilderJSONVersion } from '../types';
2
2
  export declare enum WebviewContentType {
3
3
  TEXT = "webview-text",
4
4
  IMAGE = "webview-image"
@@ -1,2 +1,2 @@
1
- import { MapContentsType, UseWebviewContents, UseWebviewContentsProps } from './types';
1
+ import { type MapContentsType, type UseWebviewContents, type UseWebviewContentsProps } from './types';
2
2
  export declare function useWebviewContents<T extends MapContentsType>({ apiUrl, version, botId, webviewId, providerId, locale, mapContents, }: UseWebviewContentsProps<T>): UseWebviewContents<T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botonic/plugin-flow-builder",
3
- "version": "0.44.2",
3
+ "version": "0.45.0-alpha.1",
4
4
  "main": "./lib/cjs/index.js",
5
5
  "module": "./lib/esm/index.js",
6
6
  "description": "Use Flow Builder to show your contents",
@@ -10,11 +10,12 @@
10
10
  "test": "../../node_modules/.bin/jest --coverage",
11
11
  "cloc": "../../scripts/qa/cloc-package.sh .",
12
12
  "prepublishOnly": "rm -rf lib && npm i && npm run build",
13
- "lint": "npm run lint_core -- --fix",
14
- "lint_core": "../../node_modules/.bin/eslint --cache --quiet 'src/**/*.ts*'"
13
+ "lint": "biome check --write src/ tests/",
14
+ "lint:check": "biome check src/ tests/",
15
+ "format": "biome format --write src/ tests/"
15
16
  },
16
17
  "dependencies": {
17
- "@botonic/react": "0.44.1",
18
+ "@botonic/react": "^0.45.0-alpha.1",
18
19
  "axios": "^1.13.2",
19
20
  "uuid": "^10.0.0"
20
21
  },
@@ -43,10 +44,6 @@
43
44
  "conversational-ui",
44
45
  "javascript"
45
46
  ],
46
- "eslintConfig": {
47
- "extends": "../.eslintrc.js",
48
- "root": true
49
- },
50
47
  "devDependencies": {
51
48
  "@types/uuid": "^10.0.0"
52
49
  }
@@ -1,16 +1,16 @@
1
1
  import {
2
- BotContext,
2
+ type BotContext,
3
3
  EventAction,
4
- EventAiAgent,
5
- InferenceResponse,
4
+ type EventAiAgent,
5
+ type InferenceResponse,
6
6
  } from '@botonic/core'
7
7
 
8
- import { FlowAiAgent, FlowContent } from '../content-fields'
9
- import { HtNodeWithContent } from '../content-fields/hubtype-fields'
8
+ import { FlowAiAgent, type FlowContent } from '../content-fields'
9
+ import type { HtNodeWithContent } from '../content-fields/hubtype-fields'
10
10
  import { getFlowBuilderPlugin } from '../helpers'
11
11
  import { trackEvent } from '../tracking'
12
- import { GuardrailRule } from '../types'
13
- import { FlowBuilderContext } from './index'
12
+ import type { GuardrailRule } from '../types'
13
+ import type { FlowBuilderContext } from './index'
14
14
 
15
15
  export async function getContentsByAiAgent({
16
16
  cmsApi,
@@ -1,13 +1,13 @@
1
- import { EventAction, EventFallback } from '@botonic/core'
2
- import { ActionRequest } from '@botonic/react'
1
+ import { EventAction, type EventFallback } from '@botonic/core'
2
+ import type { ActionRequest } from '@botonic/react'
3
3
 
4
- import { FlowBuilderApi } from '../api'
5
- import { FlowContent } from '../content-fields'
4
+ import type { FlowBuilderApi } from '../api'
5
+ import type { FlowContent } from '../content-fields'
6
6
  import {
7
7
  getCommonFlowContentEventArgsForContentId,
8
8
  trackEvent,
9
9
  } from '../tracking'
10
- import { FlowBuilderContext } from './index'
10
+ import type { FlowBuilderContext } from './index'
11
11
 
12
12
  export async function getContentsByFallback({
13
13
  cmsApi,
@@ -1,10 +1,10 @@
1
- import { FlowBuilderApi } from '../api'
1
+ import type { FlowBuilderApi } from '../api'
2
2
  import { MAIN_FLOW_NAME } from '../constants'
3
- import { FlowBotAction, FlowContent } from '../content-fields'
4
- import BotonicPluginFlowBuilder from '../index'
3
+ import { FlowBotAction, type FlowContent } from '../content-fields'
4
+ import type BotonicPluginFlowBuilder from '../index'
5
5
  import { inputHasTextData } from '../utils'
6
6
  import { getContentsByAiAgent } from './ai-agent'
7
- import { FlowBuilderContext } from './index'
7
+ import type { FlowBuilderContext } from './index'
8
8
  import { getContentsByKnowledgeBase } from './knowledge-bases'
9
9
  import { getContentsByPayload } from './payload'
10
10
 
@@ -30,7 +30,7 @@ export async function getContentsByFirstInteraction(
30
30
  if (contentsByContentID.length > 0) {
31
31
  return contentsByContentID
32
32
  }
33
- } catch (error) {
33
+ } catch (_error) {
34
34
  console.warn(
35
35
  `The contentID ${contentID} is not found. Returning the firstInteractionContents`
36
36
  )
@@ -1,20 +1,20 @@
1
- import { BotContext, INPUT, isDev, isWebchat } from '@botonic/core'
1
+ import { type BotContext, INPUT, isDev, isWebchat } from '@botonic/core'
2
2
  import {
3
- ActionRequest,
3
+ type ActionRequest,
4
4
  Multichannel,
5
5
  RequestContext,
6
6
  WebchatSettings,
7
- WebchatSettingsProps,
7
+ type WebchatSettingsProps,
8
8
  } from '@botonic/react'
9
9
  import React from 'react'
10
10
 
11
- import { FlowBuilderApi } from '../api'
11
+ import type { FlowBuilderApi } from '../api'
12
12
  import { EMPTY_PAYLOAD } from '../constants'
13
- import { FlowContent, FlowHandoff } from '../content-fields'
13
+ import { type FlowContent, FlowHandoff } from '../content-fields'
14
14
  import { FlowBotAction } from '../content-fields/flow-bot-action'
15
15
  import { ContentFilterExecutor } from '../filters'
16
16
  import { getFlowBuilderPlugin } from '../helpers'
17
- import BotonicPluginFlowBuilder from '../index'
17
+ import type BotonicPluginFlowBuilder from '../index'
18
18
  import { inputHasTextData } from '../utils'
19
19
  import { getContentsByAiAgent } from './ai-agent'
20
20
  import { getContentsByFallback } from './fallback'
@@ -1,24 +1,24 @@
1
1
  import {
2
- BotContext,
2
+ type BotContext,
3
3
  EventAction,
4
- EventKnowledgeBase,
4
+ type EventKnowledgeBase,
5
+ type KnowledgeBasesResponse,
5
6
  KnowledgebaseFailReason,
6
- KnowledgeBasesResponse,
7
- ResolvedPlugins,
7
+ type ResolvedPlugins,
8
8
  } from '@botonic/core'
9
9
 
10
10
  import {
11
11
  DISABLED_MEMORY_LENGTH,
12
- FlowContent,
12
+ type FlowContent,
13
13
  FlowKnowledgeBase,
14
14
  } from '../content-fields'
15
15
  import {
16
16
  getCommonFlowContentEventArgsForContentId,
17
17
  trackEvent,
18
18
  } from '../tracking'
19
- import { KnowledgeBaseFunction } from '../types'
19
+ import type { KnowledgeBaseFunction } from '../types'
20
20
  import { inputHasTextData, isKnowledgeBasesAllowed } from '../utils'
21
- import { FlowBuilderContext } from './index'
21
+ import type { FlowBuilderContext } from './index'
22
22
 
23
23
  export async function getContentsByKnowledgeBase({
24
24
  cmsApi,
@@ -1,4 +1,4 @@
1
- import { EventAction, EventFeedback, storeCaseRating } from '@botonic/core'
1
+ import { EventAction, type EventFeedback, storeCaseRating } from '@botonic/core'
2
2
  import { v7 as uuid } from 'uuid'
3
3
 
4
4
  import {
@@ -6,10 +6,10 @@ import {
6
6
  PUSH_FLOW_PAYLOAD,
7
7
  SEPARATOR,
8
8
  } from '../constants'
9
- import { FlowContent } from '../content-fields'
10
- import { HtNodeWithContent } from '../content-fields/hubtype-fields'
9
+ import type { FlowContent } from '../content-fields'
10
+ import type { HtNodeWithContent } from '../content-fields/hubtype-fields'
11
11
  import { trackEvent } from '../tracking'
12
- import { FlowBuilderContext } from './index'
12
+ import type { FlowBuilderContext } from './index'
13
13
 
14
14
  export async function getContentsByPayload(
15
15
  context: FlowBuilderContext
package/src/api.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { PluginPreRequest } from '@botonic/core'
1
+ import type { PluginPreRequest } from '@botonic/core'
2
2
  import axios from 'axios'
3
3
 
4
4
  import {
@@ -8,23 +8,23 @@ import {
8
8
  UUID_REGEXP,
9
9
  } from './constants'
10
10
  import {
11
- HtBotActionNode,
12
- HtCaptureUserInputNode,
13
- HtFallbackNode,
14
- HtFlowBuilderData,
15
- HtFlowWebview,
16
- HtGoToFlow,
17
- HtKeywordNode,
18
- HtNodeComponent,
19
- HtNodeLink,
20
- HtNodeWithContent,
11
+ type HtBotActionNode,
12
+ type HtCaptureUserInputNode,
13
+ type HtFallbackNode,
14
+ type HtFlowBuilderData,
15
+ type HtFlowWebview,
16
+ type HtGoToFlow,
17
+ type HtKeywordNode,
18
+ type HtNodeComponent,
19
+ type HtNodeLink,
20
+ type HtNodeWithContent,
21
21
  HtNodeWithContentType,
22
- HtPayloadNode,
23
- HtRatingButton,
24
- HtRatingNode,
25
- HtSmartIntentNode,
22
+ type HtPayloadNode,
23
+ type HtRatingButton,
24
+ type HtRatingNode,
25
+ type HtSmartIntentNode,
26
26
  } from './content-fields/hubtype-fields'
27
- import { FlowBuilderApiOptions, ProcessEnvNodeEnvs } from './types'
27
+ import { type FlowBuilderApiOptions, ProcessEnvNodeEnvs } from './types'
28
28
 
29
29
  export class FlowBuilderApi {
30
30
  url: string
@@ -70,19 +70,25 @@ export class FlowBuilderApi {
70
70
 
71
71
  getNodeByFlowId(id: string): HtNodeWithContent {
72
72
  const subFlow = this.flow.flows.find(subFlow => subFlow.id === id)
73
- if (!subFlow) throw Error(`SubFlow with id: '${id}' not found`)
73
+ if (!subFlow) {
74
+ throw Error(`SubFlow with id: '${id}' not found`)
75
+ }
74
76
  return this.getNodeById<HtNodeWithContent>(subFlow.start_node_id)
75
77
  }
76
78
 
77
79
  getNodeByCampaignId<T extends HtNodeComponent>(id: string): T {
78
80
  const campaign = this.flow.campaigns.find(campaign => campaign.id === id)
79
- if (!campaign) throw Error(`Campaign with id: '${id}' not found`)
81
+ if (!campaign) {
82
+ throw Error(`Campaign with id: '${id}' not found`)
83
+ }
80
84
  return this.getNodeById<T>(campaign.start_node_id)
81
85
  }
82
86
 
83
87
  getNodeById<T extends HtNodeComponent>(id: string): T {
84
88
  const node = this.flow.nodes.find(node => node.id === id)
85
- if (!node) console.error(`Node with id: '${id}' not found`)
89
+ if (!node) {
90
+ console.error(`Node with id: '${id}' not found`)
91
+ }
86
92
 
87
93
  return node as T
88
94
  }
@@ -117,13 +123,17 @@ export class FlowBuilderApi {
117
123
  const content = this.flow.nodes.find(node =>
118
124
  'code' in node ? node.code === contentID : false
119
125
  )
120
- if (!content) throw Error(`Node with contentID: '${contentID}' not found`)
126
+ if (!content) {
127
+ throw Error(`Node with contentID: '${contentID}' not found`)
128
+ }
121
129
  return content
122
130
  }
123
131
 
124
132
  getStartNode(): HtNodeWithContent {
125
133
  const startNodeId = this.flow.start_node_id
126
- if (!startNodeId) throw new Error('Start node id must be defined')
134
+ if (!startNodeId) {
135
+ throw new Error('Start node id must be defined')
136
+ }
127
137
  return this.getNodeById(startNodeId)
128
138
  }
129
139
 
@@ -1,11 +1,10 @@
1
- import { ActionRequest } from '@botonic/react'
1
+ import type { ActionRequest } from '@botonic/react'
2
2
 
3
3
  import {
4
4
  ACCESS_TOKEN_VARIABLE_KEY,
5
5
  VARIABLE_PATTERN_GLOBAL,
6
6
  } from '../constants'
7
- import { getValueFromKeyPath } from '../utils'
8
- import {
7
+ import type {
9
8
  HtMediaFileLocale,
10
9
  HtNodeLink,
11
10
  HtQueueLocale,
@@ -53,7 +52,7 @@ export abstract class ContentFieldsBase {
53
52
  const keyPath = match.slice(1, -1).replaceAll('\\', '')
54
53
  const botVariable = keyPath.endsWith(ACCESS_TOKEN_VARIABLE_KEY)
55
54
  ? match
56
- : getValueFromKeyPath(request, keyPath)
55
+ : this.getValueFromKeyPath(request, keyPath)
57
56
  // TODO In local if change variable and render multiple times the value is always the last update
58
57
  replacedText = replacedText.replace(
59
58
  match,
@@ -65,6 +64,35 @@ export abstract class ContentFieldsBase {
65
64
  return replacedText
66
65
  }
67
66
 
67
+ getValueFromKeyPath(request: ActionRequest, keyPath: string): any {
68
+ if (keyPath.startsWith('session.user.contact_info.')) {
69
+ const name = keyPath.split('.').at(-1)
70
+ return request.session.user.contact_info?.find(
71
+ contact => contact.name === name
72
+ )?.value
73
+ }
74
+
75
+ if (keyPath.startsWith('input.') || keyPath.startsWith('session.')) {
76
+ return keyPath
77
+ .split('.')
78
+ .reduce((object, key) => this.resolveObjectKey(object, key), request)
79
+ }
80
+
81
+ return keyPath
82
+ .split('.')
83
+ .reduce(
84
+ (object, key) => this.resolveObjectKey(object, key),
85
+ request.session.user.extra_data
86
+ )
87
+ }
88
+
89
+ private resolveObjectKey(object: any, key: string): any {
90
+ if (object && object[key] !== undefined) {
91
+ return object[key]
92
+ }
93
+ return undefined
94
+ }
95
+
68
96
  private isValidType(botVariable: any): boolean {
69
97
  const validTypes = ['boolean', 'string', 'number']
70
98
  return validTypes.includes(typeof botVariable)
@@ -1,11 +1,14 @@
1
- import { AgenticOutputMessage } from '@botonic/core'
2
- import { ActionRequest } from '@botonic/react'
1
+ import type { AgenticOutputMessage } from '@botonic/core'
2
+ import type { ActionRequest } from '@botonic/react'
3
3
 
4
4
  import { trackOneContent } from '../tracking'
5
5
  import { ContentFieldsBase } from './content-fields-base'
6
6
  import { FlowCarousel } from './flow-carousel'
7
7
  import { FlowText } from './flow-text'
8
- import { HtAiAgentNode, HtInputGuardrailRule } from './hubtype-fields/ai-agent'
8
+ import type {
9
+ HtAiAgentNode,
10
+ HtInputGuardrailRule,
11
+ } from './hubtype-fields/ai-agent'
9
12
 
10
13
  export class FlowAiAgent extends ContentFieldsBase {
11
14
  public name: string = ''
@@ -40,7 +43,11 @@ export class FlowAiAgent extends ContentFieldsBase {
40
43
  return (
41
44
  <>
42
45
  {this.responses.map((response: AgenticOutputMessage) => {
43
- if (response.type === 'text' || response.type === 'textWithButtons') {
46
+ if (
47
+ response.type === 'text' ||
48
+ response.type === 'textWithButtons' ||
49
+ response.type === 'botExecutor'
50
+ ) {
44
51
  return FlowText.fromAIAgent(id, response)
45
52
  }
46
53
 
@@ -1,13 +1,13 @@
1
- import { BotonicAction, EventAction, EventBotAction } from '@botonic/core'
2
- import { ActionRequest } from '@botonic/react'
1
+ import { BotonicAction, EventAction, type EventBotAction } from '@botonic/core'
2
+ import type { ActionRequest } from '@botonic/react'
3
3
 
4
- import { FlowBuilderApi } from '../api'
4
+ import type { FlowBuilderApi } from '../api'
5
5
  import {
6
6
  getCommonFlowContentEventArgsForContentId,
7
7
  trackEvent,
8
8
  } from '../tracking'
9
9
  import { ContentFieldsBase } from './content-fields-base'
10
- import { HtBotActionNode } from './hubtype-fields'
10
+ import type { HtBotActionNode } from './hubtype-fields'
11
11
 
12
12
  export class FlowBotAction extends ContentFieldsBase {
13
13
  public code: string
@@ -1,18 +1,17 @@
1
- import { ActionRequest, Button, Reply, Webview } from '@botonic/react'
2
- import React from 'react'
1
+ import { type ActionRequest, Button, Reply, type Webview } from '@botonic/react'
3
2
 
4
- import { FlowBuilderApi } from '../api'
3
+ import type { FlowBuilderApi } from '../api'
5
4
  import { SOURCE_INFO_SEPARATOR } from '../constants'
6
5
  import { ContentFieldsBase } from './content-fields-base'
7
6
  import { FlowWebview } from './flow-webview'
8
7
  import {
9
- HtButton,
8
+ type HtButton,
10
9
  HtButtonStyle,
11
- HtNodeWithContent,
10
+ type HtNodeWithContent,
12
11
  HtNodeWithContentType,
13
- HtUrlNode,
12
+ type HtUrlNode,
14
13
  } from './hubtype-fields'
15
- import { HtRatingButton } from './hubtype-fields/rating'
14
+ import type { HtRatingButton } from './hubtype-fields/rating'
16
15
 
17
16
  export class FlowButton extends ContentFieldsBase {
18
17
  public text = ''
@@ -28,15 +27,15 @@ export class FlowButton extends ContentFieldsBase {
28
27
  locale: string,
29
28
  cmsApi: FlowBuilderApi
30
29
  ): FlowButton {
31
- const urlId = this.getUrlId(cmsButton, locale)
30
+ const urlId = FlowButton.getUrlId(cmsButton, locale)
32
31
 
33
32
  const newButton = new FlowButton(cmsButton.id)
34
- newButton.text = this.getTextByLocale(locale, cmsButton.text)
33
+ newButton.text = FlowButton.getTextByLocale(locale, cmsButton.text)
35
34
  if (cmsButton.target) {
36
- const webview = this.getTargetWebview(cmsApi, cmsButton.target.id)
35
+ const webview = FlowButton.getTargetWebview(cmsApi, cmsButton.target.id)
37
36
  if (webview) {
38
37
  newButton.flowWebview = webview
39
- const params = this.getWebviewParams(webview, cmsApi)
38
+ const params = FlowButton.getWebviewParams(webview, cmsApi)
40
39
  newButton.webview = { name: webview.webviewComponentName }
41
40
  newButton.params = params
42
41
  } else {
@@ -58,8 +57,12 @@ export class FlowButton extends ContentFieldsBase {
58
57
  ) {
59
58
  const params: Record<string, string> = {
60
59
  webviewId: webview.webviewTargetId,
60
+ t: Date.now().toString(),
61
61
  }
62
- const exitSuccessContentID = this.getExitSuccessContentID(webview, cmsApi)
62
+ const exitSuccessContentID = FlowButton.getExitSuccessContentID(
63
+ webview,
64
+ cmsApi
65
+ )
63
66
 
64
67
  if (exitSuccessContentID) {
65
68
  params.exitSuccessContentID = exitSuccessContentID
@@ -1,10 +1,10 @@
1
- import { ActionRequest } from '@botonic/react'
1
+ import type { ActionRequest } from '@botonic/react'
2
2
 
3
3
  import { getFlowBuilderPlugin } from '../helpers'
4
4
  import { ContentFieldsBase } from './content-fields-base'
5
5
  import {
6
6
  HtAiValidationType,
7
- HtCaptureUserInputNode,
7
+ type HtCaptureUserInputNode,
8
8
  } from './hubtype-fields/capture-user-input'
9
9
 
10
10
  export class FlowCaptureUserInput extends ContentFieldsBase {
@@ -1,22 +1,21 @@
1
- import { CarouselMessage, isWhatsapp } from '@botonic/core'
1
+ import { type CarouselMessage, isWhatsapp } from '@botonic/core'
2
2
  import {
3
- ActionRequest,
3
+ type ActionRequest,
4
4
  Button,
5
5
  CardType,
6
6
  Carousel,
7
7
  Text,
8
8
  WhatsappCTAUrlButton,
9
9
  WhatsappCTAUrlHeaderType,
10
- WhatsappInteractiveMediaCard,
10
+ type WhatsappInteractiveMediaCard,
11
11
  WhatsappInteractiveMediaCarousel,
12
12
  } from '@botonic/react'
13
- import React from 'react'
14
13
 
15
- import { FlowBuilderApi } from '../api'
14
+ import type { FlowBuilderApi } from '../api'
16
15
  import { trackOneContent } from '../tracking'
17
16
  import { ContentFieldsBase } from './content-fields-base'
18
17
  import { FlowElement } from './flow-element'
19
- import { HtCarouselNode } from './hubtype-fields'
18
+ import type { HtCarouselNode } from './hubtype-fields'
20
19
 
21
20
  const DEFAULT_TEXT_MESSAGE = 'These are the options'
22
21
  export class FlowCarousel extends ContentFieldsBase {
@@ -33,7 +32,7 @@ export class FlowCarousel extends ContentFieldsBase {
33
32
  newCarousel.elements = component.content.elements.map(element =>
34
33
  FlowElement.fromHubtypeCMS(element, locale, cmsApi)
35
34
  )
36
- newCarousel.whatsappText = this.getTextByLocale(
35
+ newCarousel.whatsappText = FlowCarousel.getTextByLocale(
37
36
  locale,
38
37
  component.content.whatsapp_text
39
38
  )