@botonic/plugin-flow-builder 0.46.2 → 0.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (316) hide show
  1. package/lib/cjs/action/ai-agent-from-user-input.d.ts +3 -0
  2. package/lib/cjs/action/ai-agent-from-user-input.js +23 -0
  3. package/lib/cjs/action/ai-agent-from-user-input.js.map +1 -0
  4. package/lib/cjs/action/context.d.ts +11 -0
  5. package/lib/cjs/action/context.js +17 -0
  6. package/lib/cjs/action/context.js.map +1 -0
  7. package/lib/cjs/action/fallback.d.ts +1 -1
  8. package/lib/cjs/action/first-interaction.d.ts +1 -1
  9. package/lib/cjs/action/first-interaction.js +4 -4
  10. package/lib/cjs/action/first-interaction.js.map +1 -1
  11. package/lib/cjs/action/get-contents.d.ts +3 -0
  12. package/lib/cjs/action/get-contents.js +44 -0
  13. package/lib/cjs/action/get-contents.js.map +1 -0
  14. package/lib/cjs/action/index.d.ts +6 -15
  15. package/lib/cjs/action/index.js +31 -94
  16. package/lib/cjs/action/index.js.map +1 -1
  17. package/lib/cjs/action/knowledge-bases.d.ts +1 -1
  18. package/lib/cjs/action/knowledge-bases.js +3 -3
  19. package/lib/cjs/action/knowledge-bases.js.map +1 -1
  20. package/lib/cjs/action/payload.d.ts +1 -1
  21. package/lib/cjs/api.d.ts +0 -1
  22. package/lib/cjs/api.js +0 -7
  23. package/lib/cjs/api.js.map +1 -1
  24. package/lib/cjs/content-fields/content-fields-base.d.ts +5 -4
  25. package/lib/cjs/content-fields/content-fields-base.js +7 -7
  26. package/lib/cjs/content-fields/content-fields-base.js.map +1 -1
  27. package/lib/cjs/content-fields/flow-ai-agent.d.ts +14 -6
  28. package/lib/cjs/content-fields/flow-ai-agent.js +100 -17
  29. package/lib/cjs/content-fields/flow-ai-agent.js.map +1 -1
  30. package/lib/cjs/content-fields/flow-bot-action.d.ts +4 -2
  31. package/lib/cjs/content-fields/flow-bot-action.js +10 -5
  32. package/lib/cjs/content-fields/flow-bot-action.js.map +1 -1
  33. package/lib/cjs/content-fields/flow-button.d.ts +4 -2
  34. package/lib/cjs/content-fields/flow-button.js +5 -2
  35. package/lib/cjs/content-fields/flow-button.js.map +1 -1
  36. package/lib/cjs/content-fields/flow-capture-user-input.d.ts +4 -3
  37. package/lib/cjs/content-fields/flow-capture-user-input.js +7 -5
  38. package/lib/cjs/content-fields/flow-capture-user-input.js.map +1 -1
  39. package/lib/cjs/content-fields/flow-carousel.d.ts +4 -3
  40. package/lib/cjs/content-fields/flow-carousel.js +11 -7
  41. package/lib/cjs/content-fields/flow-carousel.js.map +1 -1
  42. package/lib/cjs/content-fields/flow-channel-conditional.d.ts +5 -4
  43. package/lib/cjs/content-fields/flow-channel-conditional.js +10 -7
  44. package/lib/cjs/content-fields/flow-channel-conditional.js.map +1 -1
  45. package/lib/cjs/content-fields/flow-country-conditional.d.ts +5 -4
  46. package/lib/cjs/content-fields/flow-country-conditional.js +11 -7
  47. package/lib/cjs/content-fields/flow-country-conditional.js.map +1 -1
  48. package/lib/cjs/content-fields/flow-custom-conditional.d.ts +5 -4
  49. package/lib/cjs/content-fields/flow-custom-conditional.js +11 -7
  50. package/lib/cjs/content-fields/flow-custom-conditional.js.map +1 -1
  51. package/lib/cjs/content-fields/flow-element.d.ts +4 -4
  52. package/lib/cjs/content-fields/flow-element.js +7 -3
  53. package/lib/cjs/content-fields/flow-element.js.map +1 -1
  54. package/lib/cjs/content-fields/flow-go-to-flow.d.ts +3 -3
  55. package/lib/cjs/content-fields/flow-go-to-flow.js +7 -15
  56. package/lib/cjs/content-fields/flow-go-to-flow.js.map +1 -1
  57. package/lib/cjs/content-fields/flow-handoff.d.ts +5 -4
  58. package/lib/cjs/content-fields/flow-handoff.js +11 -7
  59. package/lib/cjs/content-fields/flow-handoff.js.map +1 -1
  60. package/lib/cjs/content-fields/flow-image.d.ts +4 -3
  61. package/lib/cjs/content-fields/flow-image.js +8 -4
  62. package/lib/cjs/content-fields/flow-image.js.map +1 -1
  63. package/lib/cjs/content-fields/flow-knowledge-base.d.ts +4 -3
  64. package/lib/cjs/content-fields/flow-knowledge-base.js +7 -3
  65. package/lib/cjs/content-fields/flow-knowledge-base.js.map +1 -1
  66. package/lib/cjs/content-fields/flow-queue-status-conditional.d.ts +3 -2
  67. package/lib/cjs/content-fields/flow-queue-status-conditional.js +7 -3
  68. package/lib/cjs/content-fields/flow-queue-status-conditional.js.map +1 -1
  69. package/lib/cjs/content-fields/flow-rating.d.ts +4 -3
  70. package/lib/cjs/content-fields/flow-rating.js +13 -9
  71. package/lib/cjs/content-fields/flow-rating.js.map +1 -1
  72. package/lib/cjs/content-fields/flow-text.d.ts +4 -4
  73. package/lib/cjs/content-fields/flow-text.js +10 -6
  74. package/lib/cjs/content-fields/flow-text.js.map +1 -1
  75. package/lib/cjs/content-fields/flow-video.d.ts +4 -3
  76. package/lib/cjs/content-fields/flow-video.js +8 -4
  77. package/lib/cjs/content-fields/flow-video.js.map +1 -1
  78. package/lib/cjs/content-fields/flow-webview.d.ts +3 -2
  79. package/lib/cjs/content-fields/flow-webview.js +6 -3
  80. package/lib/cjs/content-fields/flow-webview.js.map +1 -1
  81. package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.d.ts +5 -3
  82. package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js +14 -10
  83. package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js.map +1 -1
  84. package/lib/cjs/content-fields/flow-whatsapp-template.d.ts +5 -3
  85. package/lib/cjs/content-fields/flow-whatsapp-template.js +26 -22
  86. package/lib/cjs/content-fields/flow-whatsapp-template.js.map +1 -1
  87. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +4 -3
  88. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +6 -4
  89. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +1 -1
  90. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +4 -3
  91. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +7 -5
  92. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +1 -1
  93. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +4 -3
  94. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +10 -6
  95. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +1 -1
  96. package/lib/cjs/content-fields/whatsapp-button-list/index.d.ts +3 -0
  97. package/lib/cjs/content-fields/whatsapp-button-list/index.js +10 -0
  98. package/lib/cjs/content-fields/whatsapp-button-list/index.js.map +1 -0
  99. package/lib/cjs/filters/index.d.ts +1 -0
  100. package/lib/cjs/filters/index.js +15 -0
  101. package/lib/cjs/filters/index.js.map +1 -1
  102. package/lib/cjs/index.d.ts +1 -1
  103. package/lib/cjs/index.js +4 -8
  104. package/lib/cjs/index.js.map +1 -1
  105. package/lib/cjs/structured-output/flow-builder-content.js.map +1 -0
  106. package/lib/cjs/tracking.js +6 -6
  107. package/lib/cjs/tracking.js.map +1 -1
  108. package/lib/cjs/types.d.ts +1 -1
  109. package/lib/cjs/user-input/capture-user-input-api.js +4 -4
  110. package/lib/cjs/user-input/capture-user-input-api.js.map +1 -1
  111. package/lib/cjs/user-input/index.js +4 -4
  112. package/lib/cjs/user-input/index.js.map +1 -1
  113. package/lib/cjs/user-input/smart-intent.js +2 -2
  114. package/lib/cjs/user-input/smart-intent.js.map +1 -1
  115. package/lib/cjs/utils/ai-agent.d.ts +18 -0
  116. package/lib/cjs/utils/ai-agent.js +177 -0
  117. package/lib/cjs/utils/ai-agent.js.map +1 -0
  118. package/lib/cjs/utils/authentication.d.ts +2 -0
  119. package/lib/cjs/utils/authentication.js +21 -0
  120. package/lib/cjs/utils/authentication.js.map +1 -0
  121. package/lib/cjs/{helpers.d.ts → utils/get-flow-builder-plugin.d.ts} +1 -1
  122. package/lib/cjs/{helpers.js → utils/get-flow-builder-plugin.js} +1 -1
  123. package/lib/cjs/utils/get-flow-builder-plugin.js.map +1 -0
  124. package/lib/cjs/{utils.d.ts → utils/input.d.ts} +1 -2
  125. package/lib/cjs/{utils.js → utils/input.js} +3 -21
  126. package/lib/cjs/utils/input.js.map +1 -0
  127. package/lib/esm/action/ai-agent-from-user-input.d.ts +3 -0
  128. package/lib/esm/action/ai-agent-from-user-input.js +23 -0
  129. package/lib/esm/action/ai-agent-from-user-input.js.map +1 -0
  130. package/lib/esm/action/context.d.ts +11 -0
  131. package/lib/esm/action/context.js +17 -0
  132. package/lib/esm/action/context.js.map +1 -0
  133. package/lib/esm/action/fallback.d.ts +1 -1
  134. package/lib/esm/action/first-interaction.d.ts +1 -1
  135. package/lib/esm/action/first-interaction.js +4 -4
  136. package/lib/esm/action/first-interaction.js.map +1 -1
  137. package/lib/esm/action/get-contents.d.ts +3 -0
  138. package/lib/esm/action/get-contents.js +44 -0
  139. package/lib/esm/action/get-contents.js.map +1 -0
  140. package/lib/esm/action/index.d.ts +6 -15
  141. package/lib/esm/action/index.js +31 -94
  142. package/lib/esm/action/index.js.map +1 -1
  143. package/lib/esm/action/knowledge-bases.d.ts +1 -1
  144. package/lib/esm/action/knowledge-bases.js +3 -3
  145. package/lib/esm/action/knowledge-bases.js.map +1 -1
  146. package/lib/esm/action/payload.d.ts +1 -1
  147. package/lib/esm/api.d.ts +0 -1
  148. package/lib/esm/api.js +0 -7
  149. package/lib/esm/api.js.map +1 -1
  150. package/lib/esm/content-fields/content-fields-base.d.ts +5 -4
  151. package/lib/esm/content-fields/content-fields-base.js +7 -7
  152. package/lib/esm/content-fields/content-fields-base.js.map +1 -1
  153. package/lib/esm/content-fields/flow-ai-agent.d.ts +14 -6
  154. package/lib/esm/content-fields/flow-ai-agent.js +100 -17
  155. package/lib/esm/content-fields/flow-ai-agent.js.map +1 -1
  156. package/lib/esm/content-fields/flow-bot-action.d.ts +4 -2
  157. package/lib/esm/content-fields/flow-bot-action.js +10 -5
  158. package/lib/esm/content-fields/flow-bot-action.js.map +1 -1
  159. package/lib/esm/content-fields/flow-button.d.ts +4 -2
  160. package/lib/esm/content-fields/flow-button.js +5 -2
  161. package/lib/esm/content-fields/flow-button.js.map +1 -1
  162. package/lib/esm/content-fields/flow-capture-user-input.d.ts +4 -3
  163. package/lib/esm/content-fields/flow-capture-user-input.js +7 -5
  164. package/lib/esm/content-fields/flow-capture-user-input.js.map +1 -1
  165. package/lib/esm/content-fields/flow-carousel.d.ts +4 -3
  166. package/lib/esm/content-fields/flow-carousel.js +11 -7
  167. package/lib/esm/content-fields/flow-carousel.js.map +1 -1
  168. package/lib/esm/content-fields/flow-channel-conditional.d.ts +5 -4
  169. package/lib/esm/content-fields/flow-channel-conditional.js +10 -7
  170. package/lib/esm/content-fields/flow-channel-conditional.js.map +1 -1
  171. package/lib/esm/content-fields/flow-country-conditional.d.ts +5 -4
  172. package/lib/esm/content-fields/flow-country-conditional.js +11 -7
  173. package/lib/esm/content-fields/flow-country-conditional.js.map +1 -1
  174. package/lib/esm/content-fields/flow-custom-conditional.d.ts +5 -4
  175. package/lib/esm/content-fields/flow-custom-conditional.js +11 -7
  176. package/lib/esm/content-fields/flow-custom-conditional.js.map +1 -1
  177. package/lib/esm/content-fields/flow-element.d.ts +4 -4
  178. package/lib/esm/content-fields/flow-element.js +7 -3
  179. package/lib/esm/content-fields/flow-element.js.map +1 -1
  180. package/lib/esm/content-fields/flow-go-to-flow.d.ts +3 -3
  181. package/lib/esm/content-fields/flow-go-to-flow.js +7 -15
  182. package/lib/esm/content-fields/flow-go-to-flow.js.map +1 -1
  183. package/lib/esm/content-fields/flow-handoff.d.ts +5 -4
  184. package/lib/esm/content-fields/flow-handoff.js +11 -7
  185. package/lib/esm/content-fields/flow-handoff.js.map +1 -1
  186. package/lib/esm/content-fields/flow-image.d.ts +4 -3
  187. package/lib/esm/content-fields/flow-image.js +8 -4
  188. package/lib/esm/content-fields/flow-image.js.map +1 -1
  189. package/lib/esm/content-fields/flow-knowledge-base.d.ts +4 -3
  190. package/lib/esm/content-fields/flow-knowledge-base.js +7 -3
  191. package/lib/esm/content-fields/flow-knowledge-base.js.map +1 -1
  192. package/lib/esm/content-fields/flow-queue-status-conditional.d.ts +3 -2
  193. package/lib/esm/content-fields/flow-queue-status-conditional.js +7 -3
  194. package/lib/esm/content-fields/flow-queue-status-conditional.js.map +1 -1
  195. package/lib/esm/content-fields/flow-rating.d.ts +4 -3
  196. package/lib/esm/content-fields/flow-rating.js +13 -9
  197. package/lib/esm/content-fields/flow-rating.js.map +1 -1
  198. package/lib/esm/content-fields/flow-text.d.ts +4 -4
  199. package/lib/esm/content-fields/flow-text.js +10 -6
  200. package/lib/esm/content-fields/flow-text.js.map +1 -1
  201. package/lib/esm/content-fields/flow-video.d.ts +4 -3
  202. package/lib/esm/content-fields/flow-video.js +8 -4
  203. package/lib/esm/content-fields/flow-video.js.map +1 -1
  204. package/lib/esm/content-fields/flow-webview.d.ts +3 -2
  205. package/lib/esm/content-fields/flow-webview.js +6 -3
  206. package/lib/esm/content-fields/flow-webview.js.map +1 -1
  207. package/lib/esm/content-fields/flow-whatsapp-cta-url-button.d.ts +5 -3
  208. package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js +14 -10
  209. package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js.map +1 -1
  210. package/lib/esm/content-fields/flow-whatsapp-template.d.ts +5 -3
  211. package/lib/esm/content-fields/flow-whatsapp-template.js +26 -22
  212. package/lib/esm/content-fields/flow-whatsapp-template.js.map +1 -1
  213. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +4 -3
  214. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +6 -4
  215. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +1 -1
  216. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +4 -3
  217. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +7 -5
  218. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +1 -1
  219. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +4 -3
  220. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +10 -6
  221. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +1 -1
  222. package/lib/esm/content-fields/whatsapp-button-list/index.d.ts +3 -0
  223. package/lib/esm/content-fields/whatsapp-button-list/index.js +10 -0
  224. package/lib/esm/content-fields/whatsapp-button-list/index.js.map +1 -0
  225. package/lib/esm/filters/index.d.ts +1 -0
  226. package/lib/esm/filters/index.js +15 -0
  227. package/lib/esm/filters/index.js.map +1 -1
  228. package/lib/esm/index.d.ts +1 -1
  229. package/lib/esm/index.js +4 -8
  230. package/lib/esm/index.js.map +1 -1
  231. package/lib/esm/structured-output/flow-builder-content.js.map +1 -0
  232. package/lib/esm/tracking.js +6 -6
  233. package/lib/esm/tracking.js.map +1 -1
  234. package/lib/esm/types.d.ts +1 -1
  235. package/lib/esm/user-input/capture-user-input-api.js +4 -4
  236. package/lib/esm/user-input/capture-user-input-api.js.map +1 -1
  237. package/lib/esm/user-input/index.js +4 -4
  238. package/lib/esm/user-input/index.js.map +1 -1
  239. package/lib/esm/user-input/smart-intent.js +2 -2
  240. package/lib/esm/user-input/smart-intent.js.map +1 -1
  241. package/lib/esm/utils/ai-agent.d.ts +18 -0
  242. package/lib/esm/utils/ai-agent.js +177 -0
  243. package/lib/esm/utils/ai-agent.js.map +1 -0
  244. package/lib/esm/utils/authentication.d.ts +2 -0
  245. package/lib/esm/utils/authentication.js +21 -0
  246. package/lib/esm/utils/authentication.js.map +1 -0
  247. package/lib/esm/{helpers.d.ts → utils/get-flow-builder-plugin.d.ts} +1 -1
  248. package/lib/esm/{helpers.js → utils/get-flow-builder-plugin.js} +1 -1
  249. package/lib/esm/utils/get-flow-builder-plugin.js.map +1 -0
  250. package/lib/esm/{utils.d.ts → utils/input.d.ts} +1 -2
  251. package/lib/esm/{utils.js → utils/input.js} +3 -21
  252. package/lib/esm/utils/input.js.map +1 -0
  253. package/package.json +2 -2
  254. package/src/action/ai-agent-from-user-input.ts +35 -0
  255. package/src/action/context.ts +29 -0
  256. package/src/action/fallback.ts +1 -1
  257. package/src/action/first-interaction.ts +4 -4
  258. package/src/action/get-contents.ts +51 -0
  259. package/src/action/index.tsx +42 -136
  260. package/src/action/knowledge-bases.ts +5 -2
  261. package/src/action/payload.ts +1 -1
  262. package/src/api.ts +0 -8
  263. package/src/content-fields/content-fields-base.ts +11 -9
  264. package/src/content-fields/flow-ai-agent.tsx +166 -31
  265. package/src/content-fields/flow-bot-action.tsx +17 -6
  266. package/src/content-fields/flow-button.tsx +8 -3
  267. package/src/content-fields/flow-capture-user-input.tsx +9 -6
  268. package/src/content-fields/flow-carousel.tsx +21 -11
  269. package/src/content-fields/flow-channel-conditional.tsx +16 -9
  270. package/src/content-fields/flow-country-conditional.tsx +17 -9
  271. package/src/content-fields/flow-custom-conditional.tsx +17 -9
  272. package/src/content-fields/flow-element.tsx +10 -11
  273. package/src/content-fields/flow-go-to-flow.tsx +10 -24
  274. package/src/content-fields/flow-handoff.tsx +21 -10
  275. package/src/content-fields/flow-image.tsx +11 -5
  276. package/src/content-fields/flow-knowledge-base.tsx +11 -5
  277. package/src/content-fields/flow-queue-status-conditional.tsx +13 -5
  278. package/src/content-fields/flow-rating.tsx +16 -16
  279. package/src/content-fields/flow-text.tsx +13 -7
  280. package/src/content-fields/flow-video.tsx +11 -5
  281. package/src/content-fields/flow-webview.tsx +12 -5
  282. package/src/content-fields/flow-whatsapp-cta-url-button.tsx +16 -12
  283. package/src/content-fields/flow-whatsapp-template.tsx +28 -24
  284. package/src/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.tsx +8 -5
  285. package/src/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.tsx +8 -6
  286. package/src/content-fields/whatsapp-button-list/flow-whatsapp-button-list.tsx +15 -15
  287. package/src/content-fields/whatsapp-button-list/index.ts +3 -0
  288. package/src/filters/index.ts +20 -0
  289. package/src/index.ts +3 -14
  290. package/src/tracking.ts +1 -1
  291. package/src/types.ts +1 -1
  292. package/src/user-input/capture-user-input-api.ts +2 -2
  293. package/src/user-input/index.ts +1 -1
  294. package/src/user-input/smart-intent.ts +1 -1
  295. package/src/utils/ai-agent.ts +233 -0
  296. package/src/utils/authentication.ts +23 -0
  297. package/src/{helpers.ts → utils/get-flow-builder-plugin.ts} +1 -1
  298. package/src/{utils.ts → utils/input.ts} +3 -23
  299. package/lib/cjs/action/ai-agent/index.d.ts +0 -3
  300. package/lib/cjs/action/ai-agent/index.js +0 -94
  301. package/lib/cjs/action/ai-agent/index.js.map +0 -1
  302. package/lib/cjs/action/ai-agent/structured-output/flow-builder-content.js.map +0 -1
  303. package/lib/cjs/helpers.js.map +0 -1
  304. package/lib/cjs/utils.js.map +0 -1
  305. package/lib/esm/action/ai-agent/index.d.ts +0 -3
  306. package/lib/esm/action/ai-agent/index.js +0 -94
  307. package/lib/esm/action/ai-agent/index.js.map +0 -1
  308. package/lib/esm/action/ai-agent/structured-output/flow-builder-content.js.map +0 -1
  309. package/lib/esm/helpers.js.map +0 -1
  310. package/lib/esm/utils.js.map +0 -1
  311. package/src/action/ai-agent/index.ts +0 -138
  312. /package/lib/cjs/{action/ai-agent/structured-output → structured-output}/flow-builder-content.d.ts +0 -0
  313. /package/lib/cjs/{action/ai-agent/structured-output → structured-output}/flow-builder-content.js +0 -0
  314. /package/lib/esm/{action/ai-agent/structured-output → structured-output}/flow-builder-content.d.ts +0 -0
  315. /package/lib/esm/{action/ai-agent/structured-output → structured-output}/flow-builder-content.js +0 -0
  316. /package/src/{action/ai-agent/structured-output → structured-output}/flow-builder-content.ts +0 -0
@@ -1,12 +1,10 @@
1
1
  import {
2
+ type BotContext,
2
3
  EventAction,
3
4
  type EventRedirectFlow,
4
- INPUT,
5
- PROVIDER,
6
5
  } from '@botonic/core'
7
- import type { ActionRequest } from '@botonic/react'
6
+
8
7
  import type { FlowBuilderApi } from '../api'
9
- import { AI_AGENTS_FLOW_NAME } from '../constants'
10
8
  import {
11
9
  getCommonFlowContentEventArgsForContentId,
12
10
  trackEvent,
@@ -34,26 +32,9 @@ export class FlowGoToFlow extends ContentFieldsBase {
34
32
  return newGoToFlow
35
33
  }
36
34
 
37
- static async resolveToAiAgentsFlow(
38
- botContext: ActionRequest,
39
- component: HtGoToFlow,
40
- cmsApi: FlowBuilderApi
41
- ): Promise<void> {
42
- const goToFlowContent = FlowGoToFlow.fromHubtypeCMS(component, cmsApi)
43
- if (goToFlowContent.flowTargetName === AI_AGENTS_FLOW_NAME) {
44
- await goToFlowContent.trackFlow(botContext)
45
-
46
- botContext.input.payload = undefined
47
- if (botContext.session.user.provider === PROVIDER.WHATSAPP) {
48
- botContext.input.type = INPUT.TEXT
49
- botContext.input.data = botContext.input.referral
50
- }
51
- }
52
- }
53
-
54
- async trackFlow(request: ActionRequest): Promise<void> {
35
+ async trackFlow(botContext: BotContext): Promise<void> {
55
36
  const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } =
56
- getCommonFlowContentEventArgsForContentId(request, this.id)
37
+ getCommonFlowContentEventArgsForContentId(botContext, this.id)
57
38
  const eventGoToFlow: EventRedirectFlow = {
58
39
  action: EventAction.RedirectFlow,
59
40
  flowThreadId,
@@ -66,7 +47,12 @@ export class FlowGoToFlow extends ContentFieldsBase {
66
47
  flowNodeIsMeaningful: false,
67
48
  }
68
49
  const { action, ...eventArgs } = eventGoToFlow
69
- await trackEvent(request, action, eventArgs)
50
+ await trackEvent(botContext, action, eventArgs)
51
+ }
52
+
53
+ async processContent(botContext: BotContext): Promise<void> {
54
+ await this.trackFlow(botContext)
55
+ return
70
56
  }
71
57
 
72
58
  toBotonic(): JSX.Element {
@@ -1,5 +1,11 @@
1
- import { HandOffBuilder, HelpdeskEvent, isDev, isWebchat } from '@botonic/core'
2
- import { type ActionRequest, WebchatSettings } from '@botonic/react'
1
+ import {
2
+ type BotContext,
3
+ HandOffBuilder,
4
+ HelpdeskEvent,
5
+ isDev,
6
+ isWebchat,
7
+ } from '@botonic/core'
8
+ import { WebchatSettings } from '@botonic/react'
3
9
 
4
10
  import type { FlowBuilderApi } from '../api'
5
11
  import { getCommonFlowContentEventArgsForContentId } from '../tracking'
@@ -47,8 +53,8 @@ export class FlowHandoff extends ContentFieldsBase {
47
53
  return undefined
48
54
  }
49
55
 
50
- async doHandoff(request: ActionRequest): Promise<void> {
51
- const handOffBuilder = new HandOffBuilder(request.session)
56
+ async doHandoff(botContext: BotContext): Promise<void> {
57
+ const handOffBuilder = new HandOffBuilder(botContext.session)
52
58
  handOffBuilder.withAutoAssignOnWaiting(this.handoffAutoAssign)
53
59
 
54
60
  if (this.hasQueuePositionChangedNotificationsEnabled) {
@@ -62,12 +68,12 @@ export class FlowHandoff extends ContentFieldsBase {
62
68
  }
63
69
 
64
70
  if (this.queue) {
65
- const language = request.getSystemLocale()
71
+ const language = botContext.getSystemLocale()
66
72
 
67
73
  handOffBuilder.withQueue(this.queue.id)
68
74
 
69
75
  const { flowId, flowName, flowNodeId, flowNodeContentId } =
70
- getCommonFlowContentEventArgsForContentId(request, this.id)
76
+ getCommonFlowContentEventArgsForContentId(botContext, this.id)
71
77
 
72
78
  handOffBuilder.withBotEvent({
73
79
  flowId,
@@ -85,13 +91,18 @@ export class FlowHandoff extends ContentFieldsBase {
85
91
  }
86
92
 
87
93
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
88
- async trackFlow(_request: ActionRequest): Promise<void> {
94
+ async trackFlow(_botContext: BotContext): Promise<void> {
89
95
  // TODO: Not apply for this content because backend track handoff success event
90
96
  }
91
97
 
92
- toBotonic(id: string, request: ActionRequest): JSX.Element {
93
- return isDev(request.session) || isWebchat(request.session) ? (
94
- <WebchatSettings key={id} enableUserInput={true} />
98
+ async processContent(botContext: BotContext): Promise<void> {
99
+ await this.doHandoff(botContext)
100
+ return
101
+ }
102
+
103
+ toBotonic(botContext: BotContext): JSX.Element {
104
+ return isDev(botContext.session) || isWebchat(botContext.session) ? (
105
+ <WebchatSettings key={this.id} enableUserInput={true} />
95
106
  ) : (
96
107
  <></>
97
108
  )
@@ -1,4 +1,5 @@
1
- import { type ActionRequest, Image } from '@botonic/react'
1
+ import type { BotContext } from '@botonic/core'
2
+ import { Image } from '@botonic/react'
2
3
 
3
4
  import { trackOneContent } from '../tracking'
4
5
  import { ContentFieldsBase } from './content-fields-base'
@@ -16,11 +17,16 @@ export class FlowImage extends ContentFieldsBase {
16
17
  return newImage
17
18
  }
18
19
 
19
- async trackFlow(request: ActionRequest): Promise<void> {
20
- await trackOneContent(request, this)
20
+ async trackFlow(botContext: BotContext): Promise<void> {
21
+ await trackOneContent(botContext, this)
21
22
  }
22
23
 
23
- toBotonic(id: string): JSX.Element {
24
- return <Image key={id} src={this.src} />
24
+ async processContent(botContext: BotContext): Promise<void> {
25
+ await this.trackFlow(botContext)
26
+ return
27
+ }
28
+
29
+ toBotonic(): JSX.Element {
30
+ return <Image key={this.id} src={this.src} />
25
31
  }
26
32
  }
@@ -1,4 +1,5 @@
1
- import { type ActionRequest, Text } from '@botonic/react'
1
+ import type { BotContext } from '@botonic/core'
2
+ import { Text } from '@botonic/react'
2
3
 
3
4
  import { ContentFieldsBase } from './content-fields-base'
4
5
  import type { HtKnowledgeBaseNode } from './hubtype-fields'
@@ -30,19 +31,24 @@ export class FlowKnowledgeBase extends ContentFieldsBase {
30
31
  }
31
32
 
32
33
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
33
- async trackFlow(_request: ActionRequest): Promise<void> {
34
+ async trackFlow(_botContext: BotContext): Promise<void> {
34
35
  // TODO: Review how we can track here the knowledge base event here.
35
36
  // We should store event args in an attribute of FlowKnowledgeBase
36
37
  // when knowledge base is resolved inside the flow builder action
37
38
  }
38
39
 
39
- toBotonic(id: string, request: ActionRequest): JSX.Element {
40
+ async processContent(botContext: BotContext): Promise<void> {
41
+ await this.trackFlow(botContext)
42
+ return
43
+ }
44
+
45
+ toBotonic(botContext: BotContext): JSX.Element {
40
46
  return (
41
47
  <Text
42
- key={id}
48
+ key={this.id}
43
49
  feedbackEnabled={this.feedbackEnabled}
44
50
  inferenceId={this.inferenceId}
45
- botInteractionId={request.input.bot_interaction_id}
51
+ botInteractionId={botContext.input.bot_interaction_id}
46
52
  >
47
53
  {this.text}
48
54
  </Text>
@@ -1,5 +1,8 @@
1
- import { EventAction, type EventConditionalQueueStatus } from '@botonic/core'
2
- import type { ActionRequest } from '@botonic/react'
1
+ import {
2
+ type BotContext,
3
+ EventAction,
4
+ type EventConditionalQueueStatus,
5
+ } from '@botonic/core'
3
6
 
4
7
  import { getArgumentsByLocale } from '../functions'
5
8
  import { HubtypeQueuesApi } from '../services/hubtype-queues-api'
@@ -99,9 +102,9 @@ export class FlowQueueStatusConditional extends ContentFieldsBase {
99
102
  return data.open ? QueueStatusResult.OPEN : QueueStatusResult.CLOSED
100
103
  }
101
104
 
102
- async trackFlow(request: ActionRequest): Promise<void> {
105
+ async trackFlow(botContext: BotContext): Promise<void> {
103
106
  const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } =
104
- getCommonFlowContentEventArgsForContentId(request, this.id)
107
+ getCommonFlowContentEventArgsForContentId(botContext, this.id)
105
108
  if (!this.conditionalResult?.result) {
106
109
  console.warn(
107
110
  `Tracking event for node ${this.code} but no conditional result found`
@@ -121,7 +124,12 @@ export class FlowQueueStatusConditional extends ContentFieldsBase {
121
124
  isAvailableAgent: this.isAvailableAgent,
122
125
  }
123
126
  const { action, ...eventArgs } = eventQueueStatusConditional
124
- await trackEvent(request, action, eventArgs)
127
+ await trackEvent(botContext, action, eventArgs)
128
+ }
129
+
130
+ async processContent(botContext: BotContext): Promise<void> {
131
+ await this.trackFlow(botContext)
132
+ return
125
133
  }
126
134
 
127
135
  toBotonic(): JSX.Element {
@@ -1,13 +1,8 @@
1
- import { isDev, isWebchat, isWhatsapp } from '@botonic/core'
2
- import {
3
- type ActionRequest,
4
- CustomRatingMessage,
5
- Text,
6
- WhatsappButtonList,
7
- } from '@botonic/react'
1
+ import { type BotContext, isDev, isWebchat, isWhatsapp } from '@botonic/core'
2
+ import { CustomRatingMessage, Text, WhatsappButtonList } from '@botonic/react'
8
3
 
9
- import { getFlowBuilderPlugin } from '../helpers'
10
4
  import { trackOneContent } from '../tracking'
5
+ import { getFlowBuilderPlugin } from '../utils/get-flow-builder-plugin'
11
6
  import { ContentFieldsBase } from './content-fields-base'
12
7
  import { FlowButton } from './flow-button'
13
8
  import { type HtRatingNode, RatingType } from './hubtype-fields'
@@ -40,17 +35,22 @@ export class FlowRating extends ContentFieldsBase {
40
35
  return newRating
41
36
  }
42
37
 
43
- async trackFlow(request: ActionRequest): Promise<void> {
44
- await trackOneContent(request, this)
38
+ async trackFlow(botContext: BotContext): Promise<void> {
39
+ await trackOneContent(botContext, this)
45
40
  }
46
41
 
47
- toBotonic(id: string, request: ActionRequest): JSX.Element {
48
- const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins)
42
+ async processContent(botContext: BotContext): Promise<void> {
43
+ await this.trackFlow(botContext)
44
+ return
45
+ }
46
+
47
+ toBotonic(botContext: BotContext): JSX.Element {
48
+ const flowBuilderPlugin = getFlowBuilderPlugin(botContext.plugins)
49
49
  const customRatingMessageEnabled =
50
50
  flowBuilderPlugin.customRatingMessageEnabled
51
- const replacedText = this.replaceVariables(this.text, request)
51
+ const replacedText = this.replaceVariables(this.text, botContext)
52
52
 
53
- if (isWhatsapp(request.session)) {
53
+ if (isWhatsapp(botContext.session)) {
54
54
  return (
55
55
  <WhatsappButtonList
56
56
  body={replacedText}
@@ -68,7 +68,7 @@ export class FlowRating extends ContentFieldsBase {
68
68
  }
69
69
 
70
70
  if (
71
- (isWebchat(request.session) || isDev(request.session)) &&
71
+ (isWebchat(botContext.session) || isDev(botContext.session)) &&
72
72
  customRatingMessageEnabled
73
73
  ) {
74
74
  const payloads = this.buttons
@@ -88,7 +88,7 @@ export class FlowRating extends ContentFieldsBase {
88
88
  }
89
89
 
90
90
  return (
91
- <Text key={id}>
91
+ <Text key={this.id}>
92
92
  {replacedText}
93
93
  {this.buttons.map((button, buttonIndex) =>
94
94
  button.renderButton(buttonIndex)
@@ -1,9 +1,10 @@
1
1
  import type {
2
+ BotContext,
2
3
  BotExecutorMessage,
3
4
  TextMessage,
4
5
  TextWithButtonsMessage,
5
6
  } from '@botonic/core'
6
- import { type ActionRequest, Text } from '@botonic/react'
7
+ import { Text } from '@botonic/react'
7
8
 
8
9
  import type { FlowBuilderApi } from '../api'
9
10
  import { EMPTY_PAYLOAD, SOURCE_INFO_SEPARATOR } from '../constants'
@@ -34,10 +35,10 @@ export class FlowText extends ContentFieldsBase {
34
35
  return newText
35
36
  }
36
37
 
37
- async trackFlow(request: ActionRequest): Promise<void> {
38
- await trackOneContent(request, this)
38
+ async trackFlow(botContext: BotContext): Promise<void> {
39
+ await trackOneContent(botContext, this)
39
40
  for (const button of this.buttons) {
40
- await button.trackFlow(request)
41
+ await button.trackFlow(botContext)
41
42
  }
42
43
  }
43
44
 
@@ -68,10 +69,15 @@ export class FlowText extends ContentFieldsBase {
68
69
  )
69
70
  }
70
71
 
71
- toBotonic(id: string, request: ActionRequest): JSX.Element {
72
- const replacedText = this.replaceVariables(this.text, request)
72
+ async processContent(botContext: BotContext): Promise<void> {
73
+ await this.trackFlow(botContext)
74
+ return
75
+ }
76
+
77
+ toBotonic(botContext: BotContext): JSX.Element {
78
+ const replacedText = this.replaceVariables(this.text, botContext)
73
79
  return (
74
- <Text key={id}>
80
+ <Text key={this.id}>
75
81
  {replacedText}
76
82
  {this.buttons.map((button, buttonIndex) =>
77
83
  button.renderButton(buttonIndex, this.buttonStyle)
@@ -1,4 +1,5 @@
1
- import { type ActionRequest, Video } from '@botonic/react'
1
+ import type { BotContext } from '@botonic/core'
2
+ import { Video } from '@botonic/react'
2
3
 
3
4
  import { trackOneContent } from '../tracking'
4
5
  import { ContentFieldsBase } from './content-fields-base'
@@ -16,11 +17,16 @@ export class FlowVideo extends ContentFieldsBase {
16
17
  return newVideo
17
18
  }
18
19
 
19
- async trackFlow(request: ActionRequest): Promise<void> {
20
- await trackOneContent(request, this)
20
+ async trackFlow(botContext: BotContext): Promise<void> {
21
+ await trackOneContent(botContext, this)
21
22
  }
22
23
 
23
- toBotonic(id: string): JSX.Element {
24
- return <Video key={id} src={this.src} />
24
+ async processContent(botContext: BotContext): Promise<void> {
25
+ await this.trackFlow(botContext)
26
+ return
27
+ }
28
+
29
+ toBotonic(): JSX.Element {
30
+ return <Video key={this.id} src={this.src} />
25
31
  }
26
32
  }
@@ -1,5 +1,8 @@
1
- import { EventAction, type EventWebviewActionTriggered } from '@botonic/core'
2
- import type { ActionRequest } from '@botonic/react'
1
+ import {
2
+ type BotContext,
3
+ EventAction,
4
+ type EventWebviewActionTriggered,
5
+ } from '@botonic/core'
3
6
 
4
7
  import {
5
8
  getCommonFlowContentEventArgsForContentId,
@@ -25,9 +28,9 @@ export class FlowWebview extends ContentFieldsBase {
25
28
  return newWebview
26
29
  }
27
30
 
28
- async trackFlow(request: ActionRequest): Promise<void> {
31
+ async trackFlow(botContext: BotContext): Promise<void> {
29
32
  const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } =
30
- getCommonFlowContentEventArgsForContentId(request, this.id)
33
+ getCommonFlowContentEventArgsForContentId(botContext, this.id)
31
34
 
32
35
  const eventWebviewActionTriggered: EventWebviewActionTriggered = {
33
36
  action: EventAction.WebviewActionTriggered,
@@ -41,6 +44,10 @@ export class FlowWebview extends ContentFieldsBase {
41
44
  webviewName: this.webviewName,
42
45
  }
43
46
  const { action, ...eventArgs } = eventWebviewActionTriggered
44
- await trackEvent(request, action, eventArgs)
47
+ await trackEvent(botContext, action, eventArgs)
48
+ }
49
+
50
+ async processContent(): Promise<void> {
51
+ return
45
52
  }
46
53
  }
@@ -1,6 +1,5 @@
1
- import { isWhatsapp } from '@botonic/core'
1
+ import { type BotContext, isWhatsapp } from '@botonic/core'
2
2
  import {
3
- type ActionRequest,
4
3
  Button,
5
4
  Text,
6
5
  WhatsappCTAUrlButton,
@@ -115,14 +114,19 @@ export class FlowWhatsappCtaUrlButtonNode extends ContentFieldsBase {
115
114
  }
116
115
  }
117
116
 
118
- async trackFlow(request: ActionRequest): Promise<void> {
119
- await trackOneContent(request, this)
117
+ async trackFlow(botContext: BotContext): Promise<void> {
118
+ await trackOneContent(botContext, this)
120
119
  }
121
120
 
122
- toBotonic(id: string, request: ActionRequest): JSX.Element {
123
- const replacedText = this.replaceVariables(this.text, request)
121
+ async processContent(botContext: BotContext): Promise<void> {
122
+ await this.trackFlow(botContext)
123
+ return
124
+ }
125
+
126
+ toBotonic(botContext: BotContext): JSX.Element {
127
+ const replacedText = this.replaceVariables(this.text, botContext)
124
128
 
125
- if (!isWhatsapp(request.session)) {
129
+ if (!isWhatsapp(botContext.session)) {
126
130
  return (
127
131
  <Text>
128
132
  {replacedText}
@@ -137,7 +141,7 @@ export class FlowWhatsappCtaUrlButtonNode extends ContentFieldsBase {
137
141
  ) {
138
142
  return (
139
143
  <WhatsappCTAUrlButton
140
- key={id}
144
+ key={this.id}
141
145
  body={replacedText}
142
146
  headerType={this.headerType}
143
147
  headerImage={this.headerImage}
@@ -154,7 +158,7 @@ export class FlowWhatsappCtaUrlButtonNode extends ContentFieldsBase {
154
158
  ) {
155
159
  return (
156
160
  <WhatsappCTAUrlButton
157
- key={id}
161
+ key={this.id}
158
162
  body={replacedText}
159
163
  headerType={this.headerType}
160
164
  headerVideo={this.headerVideo}
@@ -171,7 +175,7 @@ export class FlowWhatsappCtaUrlButtonNode extends ContentFieldsBase {
171
175
  ) {
172
176
  return (
173
177
  <WhatsappCTAUrlButton
174
- key={id}
178
+ key={this.id}
175
179
  body={replacedText}
176
180
  headerType={this.headerType}
177
181
  headerDocument={this.headerDocument}
@@ -185,7 +189,7 @@ export class FlowWhatsappCtaUrlButtonNode extends ContentFieldsBase {
185
189
  if (this.headerType === WhatsappCTAUrlHeaderType.Text && this.header) {
186
190
  return (
187
191
  <WhatsappCTAUrlButton
188
- key={id}
192
+ key={this.id}
189
193
  body={replacedText}
190
194
  header={this.header}
191
195
  headerType={this.headerType}
@@ -198,7 +202,7 @@ export class FlowWhatsappCtaUrlButtonNode extends ContentFieldsBase {
198
202
 
199
203
  return (
200
204
  <WhatsappCTAUrlButton
201
- key={id}
205
+ key={this.id}
202
206
  body={replacedText}
203
207
  footer={this.footer}
204
208
  displayText={this.displayText}
@@ -1,6 +1,5 @@
1
- import { isWhatsapp } from '@botonic/core'
1
+ import { type BotContext, isWhatsapp } from '@botonic/core'
2
2
  import {
3
- type ActionRequest,
4
3
  Text,
5
4
  WhatsAppTemplateButtonSubType,
6
5
  WhatsAppTemplateComponentType,
@@ -15,8 +14,8 @@ import {
15
14
  type WhatsappTemplateVoiceCallButton,
16
15
  } from '@botonic/react'
17
16
 
18
- import { getFlowBuilderPlugin } from '../helpers'
19
17
  import { trackOneContent } from '../tracking'
18
+ import { getFlowBuilderPlugin } from '../utils/get-flow-builder-plugin'
20
19
  import { ContentFieldsBase } from './content-fields-base'
21
20
  import type {
22
21
  HtButton,
@@ -81,7 +80,7 @@ export class FlowWhatsappTemplate extends ContentFieldsBase {
81
80
  whatsappTemplate: HtWhatsAppTemplate,
82
81
  headerVariables: HeaderVariables,
83
82
  locale: string,
84
- request: ActionRequest
83
+ botContext: BotContext
85
84
  ): WhatsappTemplateComponentHeader | undefined {
86
85
  const headerComponent = whatsappTemplate.components.find(
87
86
  component => component.type === WhatsAppTemplateComponentType.HEADER
@@ -91,7 +90,7 @@ export class FlowWhatsappTemplate extends ContentFieldsBase {
91
90
  headerComponent &&
92
91
  headerComponent.format === WhatsAppTemplateParameterType.TEXT
93
92
  ) {
94
- return this.createHeaderTextComponent(headerVariables, request)
93
+ return this.createHeaderTextComponent(headerVariables, botContext)
95
94
  }
96
95
 
97
96
  if (
@@ -113,12 +112,12 @@ export class FlowWhatsappTemplate extends ContentFieldsBase {
113
112
 
114
113
  private createHeaderTextComponent(
115
114
  headerVariables: HeaderVariables,
116
- request: ActionRequest
115
+ botContext: BotContext
117
116
  ): WhatsappTemplateComponentHeader {
118
117
  return {
119
118
  type: WhatsAppTemplateComponentType.HEADER,
120
119
  parameters: Object.values(headerVariables.text || {}).map(value => {
121
- const valueVariable = this.replaceVariables(value, request)
120
+ const valueVariable = this.replaceVariables(value, botContext)
122
121
  return {
123
122
  type: WhatsAppTemplateParameterType.TEXT,
124
123
  text: valueVariable,
@@ -163,15 +162,15 @@ export class FlowWhatsappTemplate extends ContentFieldsBase {
163
162
  }
164
163
  }
165
164
 
166
- // TODO: To use named variables (contact_info_fields) we need to take it from request.session.user.contact_info, this only be able in toBotonic method
165
+ // TODO: To use named variables (contact_info_fields) we need to take it from botContext.session.user.contact_info, this only be able in toBotonic method
167
166
  private getBodyComponent(
168
167
  variableValues: Record<string, string>,
169
- request: ActionRequest
168
+ botContext: BotContext
170
169
  ): WhatsappTemplateComponentBody {
171
170
  return {
172
171
  type: WhatsAppTemplateComponentType.BODY,
173
172
  parameters: Object.entries(variableValues).map(([key, value]) => {
174
- const valueVariable = this.replaceVariables(value, request)
173
+ const valueVariable = this.replaceVariables(value, botContext)
175
174
  return {
176
175
  type: WhatsAppTemplateParameterType.TEXT,
177
176
  parameter_name: key,
@@ -185,7 +184,7 @@ export class FlowWhatsappTemplate extends ContentFieldsBase {
185
184
  whatsappTemplate: HtWhatsAppTemplate,
186
185
  buttonNodes: HtButton[],
187
186
  urlVariableValues: Record<string, string>,
188
- request: ActionRequest
187
+ botContext: BotContext
189
188
  ): WhatsappTemplateComponentButtons | undefined {
190
189
  const htWhatsappTemplateButtons = whatsappTemplate.components.find(
191
190
  component => component.type === WhatsAppTemplateComponentType.BUTTONS
@@ -200,7 +199,7 @@ export class FlowWhatsappTemplate extends ContentFieldsBase {
200
199
  if (!urlParam) {
201
200
  return null
202
201
  }
203
- return this.createUrlButtonComponent(index, urlParam, request)
202
+ return this.createUrlButtonComponent(index, urlParam, botContext)
204
203
  }
205
204
 
206
205
  if (button.type === WhatsAppTemplateButtonSubType.QUICK_REPLY) {
@@ -224,9 +223,9 @@ export class FlowWhatsappTemplate extends ContentFieldsBase {
224
223
  private createUrlButtonComponent(
225
224
  index: number,
226
225
  urlParam: string,
227
- request: ActionRequest
226
+ botContext: BotContext
228
227
  ): WhatsappTemplateUrlButton {
229
- const variableUrlParam = this.replaceVariables(urlParam, request)
228
+ const variableUrlParam = this.replaceVariables(urlParam, botContext)
230
229
  return {
231
230
  type: WhatsAppTemplateComponentType.BUTTON,
232
231
  sub_type: WhatsAppTemplateButtonSubType.URL,
@@ -270,34 +269,39 @@ export class FlowWhatsappTemplate extends ContentFieldsBase {
270
269
  }
271
270
  }
272
271
 
273
- async trackFlow(request: ActionRequest): Promise<void> {
274
- await trackOneContent(request, this)
272
+ async trackFlow(botContext: BotContext): Promise<void> {
273
+ await trackOneContent(botContext, this)
275
274
  }
276
275
 
277
- toBotonic(id: string, request: ActionRequest): JSX.Element {
276
+ async processContent(botContext: BotContext): Promise<void> {
277
+ await this.trackFlow(botContext)
278
+ return
279
+ }
280
+
281
+ toBotonic(botContext: BotContext): JSX.Element {
278
282
  const templateName = this.htWhatsappTemplate.name
279
283
  const templateLanguage = this.htWhatsappTemplate.language
280
- const body = this.getBodyComponent(this.variableValues, request)
281
- const pluginFlowBuilder = getFlowBuilderPlugin(request.plugins)
284
+ const body = this.getBodyComponent(this.variableValues, botContext)
285
+ const pluginFlowBuilder = getFlowBuilderPlugin(botContext.plugins)
282
286
  const resolvedLocale = pluginFlowBuilder.cmsApi.getResolvedLocale()
283
287
 
284
288
  const header = this.getHeaderComponent(
285
289
  this.htWhatsappTemplate,
286
290
  this.headerVariables || ({} as HeaderVariables),
287
291
  resolvedLocale,
288
- request
292
+ botContext
289
293
  )
290
294
  const buttons = this.getButtons(
291
295
  this.htWhatsappTemplate,
292
296
  this.buttons || [],
293
297
  this.urlVariableValues || {},
294
- request
298
+ botContext
295
299
  )
296
300
 
297
- if (isWhatsapp(request.session)) {
301
+ if (isWhatsapp(botContext.session)) {
298
302
  return (
299
303
  <WhatsappTemplate
300
- key={id}
304
+ key={this.id}
301
305
  name={templateName}
302
306
  language={templateLanguage}
303
307
  header={header}
@@ -308,7 +312,7 @@ export class FlowWhatsappTemplate extends ContentFieldsBase {
308
312
  }
309
313
 
310
314
  return (
311
- <Text key={id}>
315
+ <Text key={this.id}>
312
316
  {`WhatsApp Template: ${templateName} (${templateLanguage})`}
313
317
  {header && `${JSON.stringify(header, null, 2)}`}
314
318
  {body && `${JSON.stringify(body, null, 2)}`}
@@ -1,4 +1,4 @@
1
- import type { ActionRequest, WhatsappButtonListRowProps } from '@botonic/react'
1
+ import type { WhatsappButtonListRowProps } from '@botonic/react'
2
2
 
3
3
  import type { FlowBuilderApi } from '../../api'
4
4
  import { SOURCE_INFO_SEPARATOR } from '../../constants'
@@ -29,12 +29,15 @@ export class FlowWhatsappButtonListRow extends ContentFieldsBase {
29
29
  return newRow
30
30
  }
31
31
 
32
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
33
- async trackFlow(_request: ActionRequest): Promise<void> {
34
- // Not apply for this content, because it is a child of the FlowWhatsappButtonList content
32
+ async trackFlow(): Promise<void> {
33
+ return
35
34
  }
36
35
 
37
- toBotonic(
36
+ async processContent(): Promise<void> {
37
+ return
38
+ }
39
+
40
+ renderRow(
38
41
  rowIndex: number,
39
42
  sectionIndex: number
40
43
  ): WhatsappButtonListRowProps | undefined {