@botonic/plugin-flow-builder 0.56.0-alpha.0 → 0.57.0-rslib-esm.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 (733) hide show
  1. package/README.md +1 -1
  2. package/lib/{cjs/action → action}/ai-agent-from-user-input.d.ts +2 -2
  3. package/lib/{cjs/action → action}/ai-agent-from-user-input.js +9 -6
  4. package/lib/action/ai-agent-from-user-input.js.map +1 -0
  5. package/lib/{esm/action → action}/context.d.ts +2 -2
  6. package/lib/action/context.js +20 -0
  7. package/lib/action/context.js.map +1 -0
  8. package/lib/{cjs/action → action}/fallback.d.ts +2 -2
  9. package/lib/{cjs/action → action}/fallback.js +16 -11
  10. package/lib/action/fallback.js.map +1 -0
  11. package/lib/action/first-interaction.d.ts +3 -0
  12. package/lib/{cjs/action → action}/first-interaction.js +39 -27
  13. package/lib/action/first-interaction.js.map +1 -0
  14. package/lib/{cjs/action → action}/get-contents.d.ts +1 -1
  15. package/lib/action/get-contents.js +56 -0
  16. package/lib/action/get-contents.js.map +1 -0
  17. package/lib/{esm/action → action}/index.d.ts +1 -1
  18. package/lib/{esm/action → action}/index.js +68 -32
  19. package/lib/action/index.js.map +1 -0
  20. package/lib/action/payload.d.ts +3 -0
  21. package/lib/{cjs/action → action}/payload.js +27 -23
  22. package/lib/action/payload.js.map +1 -0
  23. package/lib/{cjs/api.d.ts → api.d.ts} +2 -2
  24. package/lib/{esm/api.js → api.js} +55 -44
  25. package/lib/api.js.map +1 -0
  26. package/lib/constants.js +17 -0
  27. package/lib/constants.js.map +1 -0
  28. package/lib/{esm/content-fields → content-fields}/content-fields-base.d.ts +2 -2
  29. package/lib/content-fields/content-fields-base.js +78 -0
  30. package/lib/content-fields/content-fields-base.js.map +1 -0
  31. package/lib/{esm/content-fields → content-fields}/custom-conditional/custom-conditional-v2-evaluators.d.ts +1 -1
  32. package/lib/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +73 -0
  33. package/lib/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +1 -0
  34. package/lib/{esm/content-fields → content-fields}/custom-conditional/custom-conditional-v2-resolver.d.ts +1 -1
  35. package/lib/{cjs/content-fields → content-fields}/custom-conditional/custom-conditional-v2-resolver.js +15 -15
  36. package/lib/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +1 -0
  37. package/lib/{cjs/content-fields → content-fields}/custom-conditional/flow-custom-condition-v2.d.ts +3 -3
  38. package/lib/content-fields/custom-conditional/flow-custom-condition-v2.js +94 -0
  39. package/lib/content-fields/custom-conditional/flow-custom-condition-v2.js.map +1 -0
  40. package/lib/{esm/content-fields → content-fields}/flow-ai-agent-base.d.ts +4 -4
  41. package/lib/content-fields/flow-ai-agent-base.js +100 -0
  42. package/lib/content-fields/flow-ai-agent-base.js.map +1 -0
  43. package/lib/{esm/content-fields → content-fields}/flow-ai-agent-router.d.ts +5 -5
  44. package/lib/{esm/content-fields → content-fields}/flow-ai-agent-router.js +57 -46
  45. package/lib/content-fields/flow-ai-agent-router.js.map +1 -0
  46. package/lib/{cjs/content-fields → content-fields}/flow-ai-agent.d.ts +4 -4
  47. package/lib/{cjs/content-fields → content-fields}/flow-ai-agent.js +33 -22
  48. package/lib/content-fields/flow-ai-agent.js.map +1 -0
  49. package/lib/{esm/content-fields → content-fields}/flow-bot-action.d.ts +3 -3
  50. package/lib/{esm/content-fields → content-fields}/flow-bot-action.js +23 -15
  51. package/lib/content-fields/flow-bot-action.js.map +1 -0
  52. package/lib/{esm/content-fields → content-fields}/flow-button.d.ts +5 -5
  53. package/lib/{esm/content-fields → content-fields}/flow-button.js +48 -29
  54. package/lib/content-fields/flow-button.js.map +1 -0
  55. package/lib/{cjs/content-fields → content-fields}/flow-capture-user-input.d.ts +2 -2
  56. package/lib/content-fields/flow-capture-user-input.js +46 -0
  57. package/lib/content-fields/flow-capture-user-input.js.map +1 -0
  58. package/lib/{esm/content-fields → content-fields}/flow-carousel.d.ts +4 -4
  59. package/lib/content-fields/flow-carousel.js +193 -0
  60. package/lib/content-fields/flow-carousel.js.map +1 -0
  61. package/lib/{esm/content-fields → content-fields}/flow-channel-conditional.d.ts +3 -3
  62. package/lib/{esm/content-fields → content-fields}/flow-channel-conditional.js +26 -22
  63. package/lib/content-fields/flow-channel-conditional.js.map +1 -0
  64. package/lib/{cjs/content-fields → content-fields}/flow-country-conditional.d.ts +3 -3
  65. package/lib/{esm/content-fields → content-fields}/flow-country-conditional.js +26 -21
  66. package/lib/content-fields/flow-country-conditional.js.map +1 -0
  67. package/lib/{cjs/content-fields → content-fields}/flow-custom-conditional.d.ts +4 -4
  68. package/lib/{esm/content-fields → content-fields}/flow-custom-conditional.js +31 -33
  69. package/lib/content-fields/flow-custom-conditional.js.map +1 -0
  70. package/lib/{cjs/content-fields → content-fields}/flow-element.d.ts +4 -4
  71. package/lib/content-fields/flow-element.js +67 -0
  72. package/lib/content-fields/flow-element.js.map +1 -0
  73. package/lib/{esm/content-fields → content-fields}/flow-go-to-flow.d.ts +3 -3
  74. package/lib/{esm/content-fields → content-fields}/flow-go-to-flow.js +25 -20
  75. package/lib/content-fields/flow-go-to-flow.js.map +1 -0
  76. package/lib/{cjs/content-fields → content-fields}/flow-handoff.d.ts +3 -3
  77. package/lib/{cjs/content-fields → content-fields}/flow-handoff.js +30 -19
  78. package/lib/content-fields/flow-handoff.js.map +1 -0
  79. package/lib/{cjs/content-fields → content-fields}/flow-image.d.ts +2 -2
  80. package/lib/content-fields/flow-image.js +42 -0
  81. package/lib/content-fields/flow-image.js.map +1 -0
  82. package/lib/{cjs/content-fields → content-fields}/flow-queue-status-conditional.d.ts +3 -3
  83. package/lib/{cjs/content-fields → content-fields}/flow-queue-status-conditional.js +45 -40
  84. package/lib/content-fields/flow-queue-status-conditional.js.map +1 -0
  85. package/lib/{esm/content-fields → content-fields}/flow-rating.d.ts +3 -3
  86. package/lib/content-fields/flow-rating.js +88 -0
  87. package/lib/content-fields/flow-rating.js.map +1 -0
  88. package/lib/{cjs/content-fields → content-fields}/flow-text.d.ts +4 -4
  89. package/lib/content-fields/flow-text.js +82 -0
  90. package/lib/content-fields/flow-text.js.map +1 -0
  91. package/lib/{esm/content-fields → content-fields}/flow-video.d.ts +2 -2
  92. package/lib/content-fields/flow-video.js +42 -0
  93. package/lib/content-fields/flow-video.js.map +1 -0
  94. package/lib/{esm/content-fields → content-fields}/flow-webview.d.ts +2 -2
  95. package/lib/{cjs/content-fields → content-fields}/flow-webview.js +31 -28
  96. package/lib/content-fields/flow-webview.js.map +1 -0
  97. package/lib/{esm/content-fields → content-fields}/flow-whatsapp-cta-url-button.d.ts +3 -3
  98. package/lib/content-fields/flow-whatsapp-cta-url-button.js +131 -0
  99. package/lib/content-fields/flow-whatsapp-cta-url-button.js.map +1 -0
  100. package/lib/{esm/content-fields → content-fields}/flow-whatsapp-request-contact-info.d.ts +3 -4
  101. package/lib/content-fields/flow-whatsapp-request-contact-info.js +51 -0
  102. package/lib/content-fields/flow-whatsapp-request-contact-info.js.map +1 -0
  103. package/lib/{cjs/content-fields → content-fields}/flow-whatsapp-template.d.ts +2 -2
  104. package/lib/{esm/content-fields → content-fields}/flow-whatsapp-template.js +119 -102
  105. package/lib/content-fields/flow-whatsapp-template.js.map +1 -0
  106. package/lib/{cjs/content-fields → content-fields}/hubtype-fields/ai-agent-router.d.ts +3 -3
  107. package/lib/content-fields/hubtype-fields/ai-agent-router.js +4 -0
  108. package/lib/content-fields/hubtype-fields/ai-agent-router.js.map +1 -0
  109. package/lib/{cjs/content-fields → content-fields}/hubtype-fields/ai-agent.d.ts +2 -2
  110. package/lib/content-fields/hubtype-fields/ai-agent.js +4 -0
  111. package/lib/content-fields/hubtype-fields/ai-agent.js.map +1 -0
  112. package/lib/{cjs/content-fields → content-fields}/hubtype-fields/bot-action.d.ts +2 -2
  113. package/lib/content-fields/hubtype-fields/bot-action.js +4 -0
  114. package/lib/content-fields/hubtype-fields/bot-action.js.map +1 -0
  115. package/lib/{cjs/content-fields → content-fields}/hubtype-fields/button.d.ts +1 -1
  116. package/lib/content-fields/hubtype-fields/button.js +4 -0
  117. package/lib/content-fields/hubtype-fields/button.js.map +1 -0
  118. package/lib/{cjs/content-fields → content-fields}/hubtype-fields/capture-user-input.d.ts +2 -2
  119. package/lib/content-fields/hubtype-fields/capture-user-input.js +12 -0
  120. package/lib/content-fields/hubtype-fields/capture-user-input.js.map +1 -0
  121. package/lib/{esm/content-fields → content-fields}/hubtype-fields/carousel.d.ts +3 -3
  122. package/lib/content-fields/hubtype-fields/carousel.js +4 -0
  123. package/lib/content-fields/hubtype-fields/carousel.js.map +1 -0
  124. package/lib/{cjs/content-fields → content-fields}/hubtype-fields/channel-conditional.d.ts +3 -3
  125. package/lib/content-fields/hubtype-fields/channel-conditional.js +4 -0
  126. package/lib/content-fields/hubtype-fields/channel-conditional.js.map +1 -0
  127. package/lib/{esm/content-fields → content-fields}/hubtype-fields/common.d.ts +2 -2
  128. package/lib/content-fields/hubtype-fields/common.js +4 -0
  129. package/lib/content-fields/hubtype-fields/common.js.map +1 -0
  130. package/lib/{cjs/content-fields → content-fields}/hubtype-fields/country-conditional.d.ts +3 -3
  131. package/lib/content-fields/hubtype-fields/country-conditional.js +4 -0
  132. package/lib/content-fields/hubtype-fields/country-conditional.js.map +1 -0
  133. package/lib/{esm/content-fields → content-fields}/hubtype-fields/custom-conditional-v2.d.ts +2 -2
  134. package/lib/{esm/content-fields → content-fields}/hubtype-fields/custom-conditional-v2.js +15 -15
  135. package/lib/content-fields/hubtype-fields/custom-conditional-v2.js.map +1 -0
  136. package/lib/{esm/content-fields → content-fields}/hubtype-fields/custom-conditional.d.ts +3 -3
  137. package/lib/content-fields/hubtype-fields/custom-conditional.js +4 -0
  138. package/lib/content-fields/hubtype-fields/custom-conditional.js.map +1 -0
  139. package/lib/{esm/content-fields → content-fields}/hubtype-fields/fallback.d.ts +2 -2
  140. package/lib/content-fields/hubtype-fields/fallback.js +4 -0
  141. package/lib/content-fields/hubtype-fields/fallback.js.map +1 -0
  142. package/lib/{esm/content-fields → content-fields}/hubtype-fields/function.d.ts +2 -2
  143. package/lib/content-fields/hubtype-fields/function.js +11 -0
  144. package/lib/content-fields/hubtype-fields/function.js.map +1 -0
  145. package/lib/{cjs/content-fields → content-fields}/hubtype-fields/go-to-flow.d.ts +2 -2
  146. package/lib/content-fields/hubtype-fields/go-to-flow.js +4 -0
  147. package/lib/content-fields/hubtype-fields/go-to-flow.js.map +1 -0
  148. package/lib/{cjs/content-fields → content-fields}/hubtype-fields/handoff.d.ts +2 -2
  149. package/lib/content-fields/hubtype-fields/handoff.js +4 -0
  150. package/lib/content-fields/hubtype-fields/handoff.js.map +1 -0
  151. package/lib/{esm/content-fields → content-fields}/hubtype-fields/image.d.ts +2 -2
  152. package/lib/content-fields/hubtype-fields/image.js +4 -0
  153. package/lib/content-fields/hubtype-fields/image.js.map +1 -0
  154. package/lib/content-fields/hubtype-fields/index.d.ts +27 -0
  155. package/lib/content-fields/hubtype-fields/index.js +57 -0
  156. package/lib/content-fields/hubtype-fields/index.js.map +1 -0
  157. package/lib/{cjs/content-fields → content-fields}/hubtype-fields/keyword.d.ts +2 -2
  158. package/lib/content-fields/hubtype-fields/keyword.js +4 -0
  159. package/lib/content-fields/hubtype-fields/keyword.js.map +1 -0
  160. package/lib/{cjs/content-fields → content-fields}/hubtype-fields/node-types.js +12 -12
  161. package/lib/content-fields/hubtype-fields/node-types.js.map +1 -0
  162. package/lib/{cjs/content-fields → content-fields}/hubtype-fields/nodes.d.ts +23 -23
  163. package/lib/content-fields/hubtype-fields/nodes.js +4 -0
  164. package/lib/content-fields/hubtype-fields/nodes.js.map +1 -0
  165. package/lib/{esm/content-fields → content-fields}/hubtype-fields/payload.d.ts +1 -1
  166. package/lib/content-fields/hubtype-fields/payload.js +4 -0
  167. package/lib/content-fields/hubtype-fields/payload.js.map +1 -0
  168. package/lib/{esm/content-fields → content-fields}/hubtype-fields/queue-status-conditional.d.ts +3 -3
  169. package/lib/content-fields/hubtype-fields/queue-status-conditional.js +4 -0
  170. package/lib/content-fields/hubtype-fields/queue-status-conditional.js.map +1 -0
  171. package/lib/{esm/content-fields → content-fields}/hubtype-fields/rating.d.ts +2 -2
  172. package/lib/content-fields/hubtype-fields/rating.js +9 -0
  173. package/lib/content-fields/hubtype-fields/rating.js.map +1 -0
  174. package/lib/{esm/content-fields → content-fields}/hubtype-fields/smart-intent.d.ts +2 -2
  175. package/lib/content-fields/hubtype-fields/smart-intent.js +4 -0
  176. package/lib/content-fields/hubtype-fields/smart-intent.js.map +1 -0
  177. package/lib/{esm/content-fields → content-fields}/hubtype-fields/text.d.ts +3 -3
  178. package/lib/content-fields/hubtype-fields/text.js +4 -0
  179. package/lib/content-fields/hubtype-fields/text.js.map +1 -0
  180. package/lib/{cjs/content-fields → content-fields}/hubtype-fields/url.d.ts +1 -1
  181. package/lib/content-fields/hubtype-fields/url.js +4 -0
  182. package/lib/content-fields/hubtype-fields/url.js.map +1 -0
  183. package/lib/{esm/content-fields → content-fields}/hubtype-fields/video.d.ts +2 -2
  184. package/lib/content-fields/hubtype-fields/video.js +4 -0
  185. package/lib/content-fields/hubtype-fields/video.js.map +1 -0
  186. package/lib/{esm/content-fields → content-fields}/hubtype-fields/webview.d.ts +2 -2
  187. package/lib/content-fields/hubtype-fields/webview.js +4 -0
  188. package/lib/content-fields/hubtype-fields/webview.js.map +1 -0
  189. package/lib/{esm/content-fields → content-fields}/hubtype-fields/whatsapp-button-list.d.ts +2 -2
  190. package/lib/content-fields/hubtype-fields/whatsapp-button-list.js +4 -0
  191. package/lib/content-fields/hubtype-fields/whatsapp-button-list.js.map +1 -0
  192. package/lib/{cjs/content-fields → content-fields}/hubtype-fields/whatsapp-cta-url-button.d.ts +3 -3
  193. package/lib/content-fields/hubtype-fields/whatsapp-cta-url-button.js +4 -0
  194. package/lib/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +1 -0
  195. package/lib/{cjs/content-fields → content-fields}/hubtype-fields/whatsapp-request-contact-info.d.ts +2 -2
  196. package/lib/content-fields/hubtype-fields/whatsapp-request-contact-info.js +4 -0
  197. package/lib/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +1 -0
  198. package/lib/{cjs/content-fields → content-fields}/hubtype-fields/whatsapp-template.d.ts +3 -3
  199. package/lib/content-fields/hubtype-fields/whatsapp-template.js +9 -0
  200. package/lib/content-fields/hubtype-fields/whatsapp-template.js.map +1 -0
  201. package/lib/content-fields/index.d.ts +25 -0
  202. package/lib/content-fields/index.js +73 -0
  203. package/lib/content-fields/index.js.map +1 -0
  204. package/lib/{cjs/content-fields → content-fields}/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +3 -3
  205. package/lib/{esm/content-fields → content-fields}/whatsapp-button-list/flow-whatsapp-button-list-row.js +16 -14
  206. package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +1 -0
  207. package/lib/{cjs/content-fields → content-fields}/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +4 -4
  208. package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +41 -0
  209. package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +1 -0
  210. package/lib/{esm/content-fields → content-fields}/whatsapp-button-list/flow-whatsapp-button-list.d.ts +4 -4
  211. package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +66 -0
  212. package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +1 -0
  213. package/lib/{esm/content-fields → content-fields}/whatsapp-button-list/index.d.ts +3 -3
  214. package/lib/content-fields/whatsapp-button-list/index.js +12 -0
  215. package/lib/content-fields/whatsapp-button-list/index.js.map +1 -0
  216. package/lib/{cjs/filters → filters}/index.d.ts +2 -2
  217. package/lib/filters/index.js +16 -0
  218. package/lib/filters/index.js.map +1 -0
  219. package/lib/{cjs/flow-factory.d.ts → flow-factory.d.ts} +3 -3
  220. package/lib/flow-factory.js +75 -0
  221. package/lib/flow-factory.js.map +1 -0
  222. package/lib/{esm/functions → functions}/index.d.ts +1 -1
  223. package/lib/{cjs/functions → functions}/index.js +25 -19
  224. package/lib/functions/index.js.map +1 -0
  225. package/lib/{cjs/index.d.ts → index.d.ts} +12 -12
  226. package/lib/{esm/index.js → index.js} +94 -77
  227. package/lib/index.js.map +1 -0
  228. package/lib/services/hubtype-queues-api.js +26 -0
  229. package/lib/services/hubtype-queues-api.js.map +1 -0
  230. package/lib/structured-output/flow-builder-content.js +16 -0
  231. package/lib/structured-output/flow-builder-content.js.map +1 -0
  232. package/lib/{cjs/tracking.d.ts → tracking.d.ts} +2 -2
  233. package/lib/{cjs/tracking.js → tracking.js} +27 -21
  234. package/lib/tracking.js.map +1 -0
  235. package/lib/{esm/types.d.ts → types.d.ts} +5 -5
  236. package/lib/types.js +14 -0
  237. package/lib/types.js.map +1 -0
  238. package/lib/{esm/user-input → user-input}/capture-user-input-api.d.ts +2 -2
  239. package/lib/{cjs/user-input → user-input}/capture-user-input-api.js +44 -33
  240. package/lib/user-input/capture-user-input-api.js.map +1 -0
  241. package/lib/{esm/user-input → user-input}/index.d.ts +2 -2
  242. package/lib/user-input/index.js +46 -0
  243. package/lib/user-input/index.js.map +1 -0
  244. package/lib/{esm/user-input → user-input}/keyword.d.ts +2 -2
  245. package/lib/{esm/user-input → user-input}/keyword.js +31 -26
  246. package/lib/user-input/keyword.js.map +1 -0
  247. package/lib/{cjs/user-input → user-input}/smart-intent.d.ts +2 -2
  248. package/lib/{cjs/user-input → user-input}/smart-intent.js +36 -32
  249. package/lib/user-input/smart-intent.js.map +1 -0
  250. package/lib/{cjs/utils → utils}/ai-agent.d.ts +3 -3
  251. package/lib/utils/ai-agent.js +33 -0
  252. package/lib/utils/ai-agent.js.map +1 -0
  253. package/lib/{cjs/utils → utils}/authentication.js +10 -7
  254. package/lib/utils/authentication.js.map +1 -0
  255. package/lib/{cjs/utils → utils}/flow-locale.js +14 -18
  256. package/lib/utils/flow-locale.js.map +1 -0
  257. package/lib/{cjs/utils → utils}/get-flow-builder-plugin.d.ts +1 -1
  258. package/lib/{cjs/utils → utils}/get-flow-builder-plugin.js +4 -4
  259. package/lib/utils/get-flow-builder-plugin.js.map +1 -0
  260. package/lib/{cjs/utils → utils}/hubtype-assistant-content.d.ts +1 -2
  261. package/lib/{cjs/utils → utils}/hubtype-assistant-content.js +57 -54
  262. package/lib/utils/hubtype-assistant-content.js.map +1 -0
  263. package/lib/utils/input.js +37 -0
  264. package/lib/utils/input.js.map +1 -0
  265. package/lib/{cjs/webview → webview}/contents-context.d.ts +1 -1
  266. package/lib/webview/contents-context.js +14 -0
  267. package/lib/webview/contents-context.js.map +1 -0
  268. package/lib/webview/index.d.ts +3 -0
  269. package/lib/webview/index.js +11 -0
  270. package/lib/webview/index.js.map +1 -0
  271. package/lib/{esm/webview → webview}/types.d.ts +1 -1
  272. package/lib/webview/types.js +9 -0
  273. package/lib/webview/types.js.map +1 -0
  274. package/lib/{cjs/webview → webview}/use-webview-contents.d.ts +1 -1
  275. package/lib/webview/use-webview-contents.js +90 -0
  276. package/lib/webview/use-webview-contents.js.map +1 -0
  277. package/package.json +10 -8
  278. package/src/content-fields/flow-ai-agent-base.tsx +0 -11
  279. package/src/content-fields/flow-whatsapp-request-contact-info.tsx +1 -17
  280. package/src/content-fields/index.ts +2 -2
  281. package/src/index.ts +5 -5
  282. package/src/types.ts +6 -6
  283. package/src/utils/hubtype-assistant-content.ts +0 -14
  284. package/lib/cjs/action/ai-agent-from-user-input.js.map +0 -1
  285. package/lib/cjs/action/context.d.ts +0 -11
  286. package/lib/cjs/action/context.js +0 -17
  287. package/lib/cjs/action/context.js.map +0 -1
  288. package/lib/cjs/action/fallback.js.map +0 -1
  289. package/lib/cjs/action/first-interaction.d.ts +0 -3
  290. package/lib/cjs/action/first-interaction.js.map +0 -1
  291. package/lib/cjs/action/get-contents.js +0 -39
  292. package/lib/cjs/action/get-contents.js.map +0 -1
  293. package/lib/cjs/action/index.d.ts +0 -25
  294. package/lib/cjs/action/index.js +0 -90
  295. package/lib/cjs/action/index.js.map +0 -1
  296. package/lib/cjs/action/payload.d.ts +0 -3
  297. package/lib/cjs/action/payload.js.map +0 -1
  298. package/lib/cjs/api.js +0 -205
  299. package/lib/cjs/api.js.map +0 -1
  300. package/lib/cjs/constants.js +0 -19
  301. package/lib/cjs/constants.js.map +0 -1
  302. package/lib/cjs/content-fields/content-fields-base.d.ts +0 -20
  303. package/lib/cjs/content-fields/content-fields-base.js +0 -74
  304. package/lib/cjs/content-fields/content-fields-base.js.map +0 -1
  305. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.d.ts +0 -15
  306. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +0 -71
  307. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +0 -1
  308. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.d.ts +0 -9
  309. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +0 -1
  310. package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.js +0 -79
  311. package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.js.map +0 -1
  312. package/lib/cjs/content-fields/flow-ai-agent-base.d.ts +0 -25
  313. package/lib/cjs/content-fields/flow-ai-agent-base.js +0 -97
  314. package/lib/cjs/content-fields/flow-ai-agent-base.js.map +0 -1
  315. package/lib/cjs/content-fields/flow-ai-agent-router.d.ts +0 -21
  316. package/lib/cjs/content-fields/flow-ai-agent-router.js +0 -125
  317. package/lib/cjs/content-fields/flow-ai-agent-router.js.map +0 -1
  318. package/lib/cjs/content-fields/flow-ai-agent.js.map +0 -1
  319. package/lib/cjs/content-fields/flow-bot-action.d.ts +0 -14
  320. package/lib/cjs/content-fields/flow-bot-action.js +0 -45
  321. package/lib/cjs/content-fields/flow-bot-action.js.map +0 -1
  322. package/lib/cjs/content-fields/flow-button.d.ts +0 -31
  323. package/lib/cjs/content-fields/flow-button.js +0 -86
  324. package/lib/cjs/content-fields/flow-button.js.map +0 -1
  325. package/lib/cjs/content-fields/flow-capture-user-input.js +0 -45
  326. package/lib/cjs/content-fields/flow-capture-user-input.js.map +0 -1
  327. package/lib/cjs/content-fields/flow-carousel.d.ts +0 -22
  328. package/lib/cjs/content-fields/flow-carousel.js +0 -152
  329. package/lib/cjs/content-fields/flow-carousel.js.map +0 -1
  330. package/lib/cjs/content-fields/flow-channel-conditional.d.ts +0 -14
  331. package/lib/cjs/content-fields/flow-channel-conditional.js +0 -57
  332. package/lib/cjs/content-fields/flow-channel-conditional.js.map +0 -1
  333. package/lib/cjs/content-fields/flow-country-conditional.js +0 -59
  334. package/lib/cjs/content-fields/flow-country-conditional.js.map +0 -1
  335. package/lib/cjs/content-fields/flow-custom-conditional.js +0 -89
  336. package/lib/cjs/content-fields/flow-custom-conditional.js.map +0 -1
  337. package/lib/cjs/content-fields/flow-element.js +0 -50
  338. package/lib/cjs/content-fields/flow-element.js.map +0 -1
  339. package/lib/cjs/content-fields/flow-go-to-flow.d.ts +0 -13
  340. package/lib/cjs/content-fields/flow-go-to-flow.js +0 -51
  341. package/lib/cjs/content-fields/flow-go-to-flow.js.map +0 -1
  342. package/lib/cjs/content-fields/flow-handoff.js.map +0 -1
  343. package/lib/cjs/content-fields/flow-image.js +0 -33
  344. package/lib/cjs/content-fields/flow-image.js.map +0 -1
  345. package/lib/cjs/content-fields/flow-queue-status-conditional.js.map +0 -1
  346. package/lib/cjs/content-fields/flow-rating.d.ts +0 -15
  347. package/lib/cjs/content-fields/flow-rating.js +0 -66
  348. package/lib/cjs/content-fields/flow-rating.js.map +0 -1
  349. package/lib/cjs/content-fields/flow-text.js +0 -60
  350. package/lib/cjs/content-fields/flow-text.js.map +0 -1
  351. package/lib/cjs/content-fields/flow-video.d.ts +0 -10
  352. package/lib/cjs/content-fields/flow-video.js +0 -33
  353. package/lib/cjs/content-fields/flow-video.js.map +0 -1
  354. package/lib/cjs/content-fields/flow-webview.d.ts +0 -16
  355. package/lib/cjs/content-fields/flow-webview.js.map +0 -1
  356. package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.d.ts +0 -21
  357. package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js +0 -92
  358. package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js.map +0 -1
  359. package/lib/cjs/content-fields/flow-whatsapp-request-contact-info.d.ts +0 -11
  360. package/lib/cjs/content-fields/flow-whatsapp-request-contact-info.js +0 -45
  361. package/lib/cjs/content-fields/flow-whatsapp-request-contact-info.js.map +0 -1
  362. package/lib/cjs/content-fields/flow-whatsapp-template.js +0 -264
  363. package/lib/cjs/content-fields/flow-whatsapp-template.js.map +0 -1
  364. package/lib/cjs/content-fields/hubtype-fields/ai-agent-router.js +0 -3
  365. package/lib/cjs/content-fields/hubtype-fields/ai-agent-router.js.map +0 -1
  366. package/lib/cjs/content-fields/hubtype-fields/ai-agent.js +0 -3
  367. package/lib/cjs/content-fields/hubtype-fields/ai-agent.js.map +0 -1
  368. package/lib/cjs/content-fields/hubtype-fields/bot-action.js +0 -3
  369. package/lib/cjs/content-fields/hubtype-fields/bot-action.js.map +0 -1
  370. package/lib/cjs/content-fields/hubtype-fields/button.js +0 -3
  371. package/lib/cjs/content-fields/hubtype-fields/button.js.map +0 -1
  372. package/lib/cjs/content-fields/hubtype-fields/capture-user-input.js +0 -12
  373. package/lib/cjs/content-fields/hubtype-fields/capture-user-input.js.map +0 -1
  374. package/lib/cjs/content-fields/hubtype-fields/carousel.d.ts +0 -17
  375. package/lib/cjs/content-fields/hubtype-fields/carousel.js +0 -3
  376. package/lib/cjs/content-fields/hubtype-fields/carousel.js.map +0 -1
  377. package/lib/cjs/content-fields/hubtype-fields/channel-conditional.js +0 -3
  378. package/lib/cjs/content-fields/hubtype-fields/channel-conditional.js.map +0 -1
  379. package/lib/cjs/content-fields/hubtype-fields/common.d.ts +0 -83
  380. package/lib/cjs/content-fields/hubtype-fields/common.js +0 -3
  381. package/lib/cjs/content-fields/hubtype-fields/common.js.map +0 -1
  382. package/lib/cjs/content-fields/hubtype-fields/country-conditional.js +0 -3
  383. package/lib/cjs/content-fields/hubtype-fields/country-conditional.js.map +0 -1
  384. package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.d.ts +0 -56
  385. package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.js +0 -36
  386. package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.js.map +0 -1
  387. package/lib/cjs/content-fields/hubtype-fields/custom-conditional.d.ts +0 -11
  388. package/lib/cjs/content-fields/hubtype-fields/custom-conditional.js +0 -3
  389. package/lib/cjs/content-fields/hubtype-fields/custom-conditional.js.map +0 -1
  390. package/lib/cjs/content-fields/hubtype-fields/fallback.d.ts +0 -9
  391. package/lib/cjs/content-fields/hubtype-fields/fallback.js +0 -3
  392. package/lib/cjs/content-fields/hubtype-fields/fallback.js.map +0 -1
  393. package/lib/cjs/content-fields/hubtype-fields/function.d.ts +0 -30
  394. package/lib/cjs/content-fields/hubtype-fields/function.js +0 -11
  395. package/lib/cjs/content-fields/hubtype-fields/function.js.map +0 -1
  396. package/lib/cjs/content-fields/hubtype-fields/go-to-flow.js +0 -3
  397. package/lib/cjs/content-fields/hubtype-fields/go-to-flow.js.map +0 -1
  398. package/lib/cjs/content-fields/hubtype-fields/handoff.js +0 -3
  399. package/lib/cjs/content-fields/hubtype-fields/handoff.js.map +0 -1
  400. package/lib/cjs/content-fields/hubtype-fields/image.d.ts +0 -8
  401. package/lib/cjs/content-fields/hubtype-fields/image.js +0 -3
  402. package/lib/cjs/content-fields/hubtype-fields/image.js.map +0 -1
  403. package/lib/cjs/content-fields/hubtype-fields/index.d.ts +0 -27
  404. package/lib/cjs/content-fields/hubtype-fields/index.js +0 -31
  405. package/lib/cjs/content-fields/hubtype-fields/index.js.map +0 -1
  406. package/lib/cjs/content-fields/hubtype-fields/keyword.js +0 -3
  407. package/lib/cjs/content-fields/hubtype-fields/keyword.js.map +0 -1
  408. package/lib/cjs/content-fields/hubtype-fields/node-types.js.map +0 -1
  409. package/lib/cjs/content-fields/hubtype-fields/nodes.js +0 -3
  410. package/lib/cjs/content-fields/hubtype-fields/nodes.js.map +0 -1
  411. package/lib/cjs/content-fields/hubtype-fields/payload.d.ts +0 -8
  412. package/lib/cjs/content-fields/hubtype-fields/payload.js +0 -3
  413. package/lib/cjs/content-fields/hubtype-fields/payload.js.map +0 -1
  414. package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.d.ts +0 -25
  415. package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.js +0 -3
  416. package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.js.map +0 -1
  417. package/lib/cjs/content-fields/hubtype-fields/rating.d.ts +0 -23
  418. package/lib/cjs/content-fields/hubtype-fields/rating.js +0 -9
  419. package/lib/cjs/content-fields/hubtype-fields/rating.js.map +0 -1
  420. package/lib/cjs/content-fields/hubtype-fields/smart-intent.d.ts +0 -12
  421. package/lib/cjs/content-fields/hubtype-fields/smart-intent.js +0 -3
  422. package/lib/cjs/content-fields/hubtype-fields/smart-intent.js.map +0 -1
  423. package/lib/cjs/content-fields/hubtype-fields/text.d.ts +0 -11
  424. package/lib/cjs/content-fields/hubtype-fields/text.js +0 -3
  425. package/lib/cjs/content-fields/hubtype-fields/text.js.map +0 -1
  426. package/lib/cjs/content-fields/hubtype-fields/url.js +0 -3
  427. package/lib/cjs/content-fields/hubtype-fields/url.js.map +0 -1
  428. package/lib/cjs/content-fields/hubtype-fields/video.d.ts +0 -8
  429. package/lib/cjs/content-fields/hubtype-fields/video.js +0 -3
  430. package/lib/cjs/content-fields/hubtype-fields/video.js.map +0 -1
  431. package/lib/cjs/content-fields/hubtype-fields/webview.d.ts +0 -17
  432. package/lib/cjs/content-fields/hubtype-fields/webview.js +0 -3
  433. package/lib/cjs/content-fields/hubtype-fields/webview.js.map +0 -1
  434. package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.d.ts +0 -21
  435. package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.js +0 -3
  436. package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.js.map +0 -1
  437. package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.js +0 -3
  438. package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +0 -1
  439. package/lib/cjs/content-fields/hubtype-fields/whatsapp-request-contact-info.js +0 -3
  440. package/lib/cjs/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +0 -1
  441. package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.js +0 -9
  442. package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.js.map +0 -1
  443. package/lib/cjs/content-fields/index.d.ts +0 -25
  444. package/lib/cjs/content-fields/index.js +0 -52
  445. package/lib/cjs/content-fields/index.js.map +0 -1
  446. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +0 -41
  447. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +0 -1
  448. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +0 -36
  449. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +0 -1
  450. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +0 -14
  451. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +0 -46
  452. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +0 -1
  453. package/lib/cjs/content-fields/whatsapp-button-list/index.d.ts +0 -3
  454. package/lib/cjs/content-fields/whatsapp-button-list/index.js +0 -10
  455. package/lib/cjs/content-fields/whatsapp-button-list/index.js.map +0 -1
  456. package/lib/cjs/filters/index.js +0 -17
  457. package/lib/cjs/filters/index.js.map +0 -1
  458. package/lib/cjs/flow-factory.js +0 -69
  459. package/lib/cjs/flow-factory.js.map +0 -1
  460. package/lib/cjs/functions/index.d.ts +0 -11
  461. package/lib/cjs/functions/index.js.map +0 -1
  462. package/lib/cjs/index.js +0 -178
  463. package/lib/cjs/index.js.map +0 -1
  464. package/lib/cjs/services/hubtype-queues-api.js +0 -26
  465. package/lib/cjs/services/hubtype-queues-api.js.map +0 -1
  466. package/lib/cjs/structured-output/flow-builder-content.js +0 -15
  467. package/lib/cjs/structured-output/flow-builder-content.js.map +0 -1
  468. package/lib/cjs/tracking.js.map +0 -1
  469. package/lib/cjs/types.d.ts +0 -62
  470. package/lib/cjs/types.js +0 -14
  471. package/lib/cjs/types.js.map +0 -1
  472. package/lib/cjs/user-input/capture-user-input-api.d.ts +0 -21
  473. package/lib/cjs/user-input/capture-user-input-api.js.map +0 -1
  474. package/lib/cjs/user-input/index.d.ts +0 -4
  475. package/lib/cjs/user-input/index.js +0 -37
  476. package/lib/cjs/user-input/index.js.map +0 -1
  477. package/lib/cjs/user-input/keyword.d.ts +0 -27
  478. package/lib/cjs/user-input/keyword.js +0 -84
  479. package/lib/cjs/user-input/keyword.js.map +0 -1
  480. package/lib/cjs/user-input/smart-intent.js.map +0 -1
  481. package/lib/cjs/utils/ai-agent.js +0 -28
  482. package/lib/cjs/utils/ai-agent.js.map +0 -1
  483. package/lib/cjs/utils/authentication.js.map +0 -1
  484. package/lib/cjs/utils/flow-locale.js.map +0 -1
  485. package/lib/cjs/utils/get-flow-builder-plugin.js.map +0 -1
  486. package/lib/cjs/utils/hubtype-assistant-content.js.map +0 -1
  487. package/lib/cjs/utils/input.js +0 -35
  488. package/lib/cjs/utils/input.js.map +0 -1
  489. package/lib/cjs/webview/contents-context.js +0 -12
  490. package/lib/cjs/webview/contents-context.js.map +0 -1
  491. package/lib/cjs/webview/index.d.ts +0 -3
  492. package/lib/cjs/webview/index.js +0 -10
  493. package/lib/cjs/webview/index.js.map +0 -1
  494. package/lib/cjs/webview/types.d.ts +0 -47
  495. package/lib/cjs/webview/types.js +0 -9
  496. package/lib/cjs/webview/types.js.map +0 -1
  497. package/lib/cjs/webview/use-webview-contents.js +0 -83
  498. package/lib/cjs/webview/use-webview-contents.js.map +0 -1
  499. package/lib/esm/action/ai-agent-from-user-input.d.ts +0 -3
  500. package/lib/esm/action/ai-agent-from-user-input.js +0 -32
  501. package/lib/esm/action/ai-agent-from-user-input.js.map +0 -1
  502. package/lib/esm/action/context.js +0 -17
  503. package/lib/esm/action/context.js.map +0 -1
  504. package/lib/esm/action/fallback.d.ts +0 -3
  505. package/lib/esm/action/fallback.js +0 -36
  506. package/lib/esm/action/fallback.js.map +0 -1
  507. package/lib/esm/action/first-interaction.d.ts +0 -3
  508. package/lib/esm/action/first-interaction.js +0 -88
  509. package/lib/esm/action/first-interaction.js.map +0 -1
  510. package/lib/esm/action/get-contents.d.ts +0 -3
  511. package/lib/esm/action/get-contents.js +0 -39
  512. package/lib/esm/action/get-contents.js.map +0 -1
  513. package/lib/esm/action/index.js.map +0 -1
  514. package/lib/esm/action/payload.d.ts +0 -3
  515. package/lib/esm/action/payload.js +0 -74
  516. package/lib/esm/action/payload.js.map +0 -1
  517. package/lib/esm/api.d.ts +0 -40
  518. package/lib/esm/api.js.map +0 -1
  519. package/lib/esm/constants.d.ts +0 -13
  520. package/lib/esm/constants.js +0 -19
  521. package/lib/esm/constants.js.map +0 -1
  522. package/lib/esm/content-fields/content-fields-base.js +0 -74
  523. package/lib/esm/content-fields/content-fields-base.js.map +0 -1
  524. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +0 -71
  525. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +0 -1
  526. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.js +0 -58
  527. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +0 -1
  528. package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.d.ts +0 -17
  529. package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.js +0 -79
  530. package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.js.map +0 -1
  531. package/lib/esm/content-fields/flow-ai-agent-base.js +0 -97
  532. package/lib/esm/content-fields/flow-ai-agent-base.js.map +0 -1
  533. package/lib/esm/content-fields/flow-ai-agent-router.js.map +0 -1
  534. package/lib/esm/content-fields/flow-ai-agent.d.ts +0 -17
  535. package/lib/esm/content-fields/flow-ai-agent.js +0 -64
  536. package/lib/esm/content-fields/flow-ai-agent.js.map +0 -1
  537. package/lib/esm/content-fields/flow-bot-action.js.map +0 -1
  538. package/lib/esm/content-fields/flow-button.js.map +0 -1
  539. package/lib/esm/content-fields/flow-capture-user-input.d.ts +0 -14
  540. package/lib/esm/content-fields/flow-capture-user-input.js +0 -45
  541. package/lib/esm/content-fields/flow-capture-user-input.js.map +0 -1
  542. package/lib/esm/content-fields/flow-carousel.js +0 -152
  543. package/lib/esm/content-fields/flow-carousel.js.map +0 -1
  544. package/lib/esm/content-fields/flow-channel-conditional.js.map +0 -1
  545. package/lib/esm/content-fields/flow-country-conditional.d.ts +0 -13
  546. package/lib/esm/content-fields/flow-country-conditional.js.map +0 -1
  547. package/lib/esm/content-fields/flow-custom-conditional.d.ts +0 -17
  548. package/lib/esm/content-fields/flow-custom-conditional.js.map +0 -1
  549. package/lib/esm/content-fields/flow-element.d.ts +0 -22
  550. package/lib/esm/content-fields/flow-element.js +0 -50
  551. package/lib/esm/content-fields/flow-element.js.map +0 -1
  552. package/lib/esm/content-fields/flow-go-to-flow.js.map +0 -1
  553. package/lib/esm/content-fields/flow-handoff.d.ts +0 -17
  554. package/lib/esm/content-fields/flow-handoff.js +0 -68
  555. package/lib/esm/content-fields/flow-handoff.js.map +0 -1
  556. package/lib/esm/content-fields/flow-image.d.ts +0 -10
  557. package/lib/esm/content-fields/flow-image.js +0 -33
  558. package/lib/esm/content-fields/flow-image.js.map +0 -1
  559. package/lib/esm/content-fields/flow-queue-status-conditional.d.ts +0 -30
  560. package/lib/esm/content-fields/flow-queue-status-conditional.js +0 -95
  561. package/lib/esm/content-fields/flow-queue-status-conditional.js.map +0 -1
  562. package/lib/esm/content-fields/flow-rating.js +0 -66
  563. package/lib/esm/content-fields/flow-rating.js.map +0 -1
  564. package/lib/esm/content-fields/flow-text.d.ts +0 -15
  565. package/lib/esm/content-fields/flow-text.js +0 -60
  566. package/lib/esm/content-fields/flow-text.js.map +0 -1
  567. package/lib/esm/content-fields/flow-video.js +0 -33
  568. package/lib/esm/content-fields/flow-video.js.map +0 -1
  569. package/lib/esm/content-fields/flow-webview.js +0 -78
  570. package/lib/esm/content-fields/flow-webview.js.map +0 -1
  571. package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js +0 -92
  572. package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js.map +0 -1
  573. package/lib/esm/content-fields/flow-whatsapp-request-contact-info.js +0 -45
  574. package/lib/esm/content-fields/flow-whatsapp-request-contact-info.js.map +0 -1
  575. package/lib/esm/content-fields/flow-whatsapp-template.d.ts +0 -37
  576. package/lib/esm/content-fields/flow-whatsapp-template.js.map +0 -1
  577. package/lib/esm/content-fields/hubtype-fields/ai-agent-router.d.ts +0 -21
  578. package/lib/esm/content-fields/hubtype-fields/ai-agent-router.js +0 -3
  579. package/lib/esm/content-fields/hubtype-fields/ai-agent-router.js.map +0 -1
  580. package/lib/esm/content-fields/hubtype-fields/ai-agent.d.ts +0 -25
  581. package/lib/esm/content-fields/hubtype-fields/ai-agent.js +0 -3
  582. package/lib/esm/content-fields/hubtype-fields/ai-agent.js.map +0 -1
  583. package/lib/esm/content-fields/hubtype-fields/bot-action.d.ts +0 -10
  584. package/lib/esm/content-fields/hubtype-fields/bot-action.js +0 -3
  585. package/lib/esm/content-fields/hubtype-fields/bot-action.js.map +0 -1
  586. package/lib/esm/content-fields/hubtype-fields/button.d.ts +0 -8
  587. package/lib/esm/content-fields/hubtype-fields/button.js +0 -3
  588. package/lib/esm/content-fields/hubtype-fields/button.js.map +0 -1
  589. package/lib/esm/content-fields/hubtype-fields/capture-user-input.d.ts +0 -19
  590. package/lib/esm/content-fields/hubtype-fields/capture-user-input.js +0 -12
  591. package/lib/esm/content-fields/hubtype-fields/capture-user-input.js.map +0 -1
  592. package/lib/esm/content-fields/hubtype-fields/carousel.js +0 -3
  593. package/lib/esm/content-fields/hubtype-fields/carousel.js.map +0 -1
  594. package/lib/esm/content-fields/hubtype-fields/channel-conditional.d.ts +0 -10
  595. package/lib/esm/content-fields/hubtype-fields/channel-conditional.js +0 -3
  596. package/lib/esm/content-fields/hubtype-fields/channel-conditional.js.map +0 -1
  597. package/lib/esm/content-fields/hubtype-fields/common.js +0 -3
  598. package/lib/esm/content-fields/hubtype-fields/common.js.map +0 -1
  599. package/lib/esm/content-fields/hubtype-fields/country-conditional.d.ts +0 -10
  600. package/lib/esm/content-fields/hubtype-fields/country-conditional.js +0 -3
  601. package/lib/esm/content-fields/hubtype-fields/country-conditional.js.map +0 -1
  602. package/lib/esm/content-fields/hubtype-fields/custom-conditional-v2.js.map +0 -1
  603. package/lib/esm/content-fields/hubtype-fields/custom-conditional.js +0 -3
  604. package/lib/esm/content-fields/hubtype-fields/custom-conditional.js.map +0 -1
  605. package/lib/esm/content-fields/hubtype-fields/fallback.js +0 -3
  606. package/lib/esm/content-fields/hubtype-fields/fallback.js.map +0 -1
  607. package/lib/esm/content-fields/hubtype-fields/function.js +0 -11
  608. package/lib/esm/content-fields/hubtype-fields/function.js.map +0 -1
  609. package/lib/esm/content-fields/hubtype-fields/go-to-flow.d.ts +0 -9
  610. package/lib/esm/content-fields/hubtype-fields/go-to-flow.js +0 -3
  611. package/lib/esm/content-fields/hubtype-fields/go-to-flow.js.map +0 -1
  612. package/lib/esm/content-fields/hubtype-fields/handoff.d.ts +0 -11
  613. package/lib/esm/content-fields/hubtype-fields/handoff.js +0 -3
  614. package/lib/esm/content-fields/hubtype-fields/handoff.js.map +0 -1
  615. package/lib/esm/content-fields/hubtype-fields/image.js +0 -3
  616. package/lib/esm/content-fields/hubtype-fields/image.js.map +0 -1
  617. package/lib/esm/content-fields/hubtype-fields/index.d.ts +0 -27
  618. package/lib/esm/content-fields/hubtype-fields/index.js +0 -31
  619. package/lib/esm/content-fields/hubtype-fields/index.js.map +0 -1
  620. package/lib/esm/content-fields/hubtype-fields/keyword.d.ts +0 -9
  621. package/lib/esm/content-fields/hubtype-fields/keyword.js +0 -3
  622. package/lib/esm/content-fields/hubtype-fields/keyword.js.map +0 -1
  623. package/lib/esm/content-fields/hubtype-fields/node-types.d.ts +0 -31
  624. package/lib/esm/content-fields/hubtype-fields/node-types.js +0 -38
  625. package/lib/esm/content-fields/hubtype-fields/node-types.js.map +0 -1
  626. package/lib/esm/content-fields/hubtype-fields/nodes.d.ts +0 -26
  627. package/lib/esm/content-fields/hubtype-fields/nodes.js +0 -3
  628. package/lib/esm/content-fields/hubtype-fields/nodes.js.map +0 -1
  629. package/lib/esm/content-fields/hubtype-fields/payload.js +0 -3
  630. package/lib/esm/content-fields/hubtype-fields/payload.js.map +0 -1
  631. package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.js +0 -3
  632. package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.js.map +0 -1
  633. package/lib/esm/content-fields/hubtype-fields/rating.js +0 -9
  634. package/lib/esm/content-fields/hubtype-fields/rating.js.map +0 -1
  635. package/lib/esm/content-fields/hubtype-fields/smart-intent.js +0 -3
  636. package/lib/esm/content-fields/hubtype-fields/smart-intent.js.map +0 -1
  637. package/lib/esm/content-fields/hubtype-fields/text.js +0 -3
  638. package/lib/esm/content-fields/hubtype-fields/text.js.map +0 -1
  639. package/lib/esm/content-fields/hubtype-fields/url.d.ts +0 -8
  640. package/lib/esm/content-fields/hubtype-fields/url.js +0 -3
  641. package/lib/esm/content-fields/hubtype-fields/url.js.map +0 -1
  642. package/lib/esm/content-fields/hubtype-fields/video.js +0 -3
  643. package/lib/esm/content-fields/hubtype-fields/video.js.map +0 -1
  644. package/lib/esm/content-fields/hubtype-fields/webview.js +0 -3
  645. package/lib/esm/content-fields/hubtype-fields/webview.js.map +0 -1
  646. package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.js +0 -3
  647. package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.js.map +0 -1
  648. package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.d.ts +0 -17
  649. package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.js +0 -3
  650. package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +0 -1
  651. package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.d.ts +0 -8
  652. package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.js +0 -3
  653. package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +0 -1
  654. package/lib/esm/content-fields/hubtype-fields/whatsapp-template.d.ts +0 -96
  655. package/lib/esm/content-fields/hubtype-fields/whatsapp-template.js +0 -9
  656. package/lib/esm/content-fields/hubtype-fields/whatsapp-template.js.map +0 -1
  657. package/lib/esm/content-fields/index.d.ts +0 -25
  658. package/lib/esm/content-fields/index.js +0 -52
  659. package/lib/esm/content-fields/index.js.map +0 -1
  660. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +0 -14
  661. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +0 -1
  662. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +0 -13
  663. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +0 -36
  664. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +0 -1
  665. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +0 -46
  666. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +0 -1
  667. package/lib/esm/content-fields/whatsapp-button-list/index.js +0 -10
  668. package/lib/esm/content-fields/whatsapp-button-list/index.js.map +0 -1
  669. package/lib/esm/filters/index.d.ts +0 -12
  670. package/lib/esm/filters/index.js +0 -17
  671. package/lib/esm/filters/index.js.map +0 -1
  672. package/lib/esm/flow-factory.d.ts +0 -12
  673. package/lib/esm/flow-factory.js +0 -69
  674. package/lib/esm/flow-factory.js.map +0 -1
  675. package/lib/esm/functions/index.js +0 -49
  676. package/lib/esm/functions/index.js.map +0 -1
  677. package/lib/esm/index.d.ts +0 -45
  678. package/lib/esm/index.js.map +0 -1
  679. package/lib/esm/services/hubtype-queues-api.d.ts +0 -14
  680. package/lib/esm/services/hubtype-queues-api.js +0 -26
  681. package/lib/esm/services/hubtype-queues-api.js.map +0 -1
  682. package/lib/esm/structured-output/flow-builder-content.d.ts +0 -13
  683. package/lib/esm/structured-output/flow-builder-content.js +0 -15
  684. package/lib/esm/structured-output/flow-builder-content.js.map +0 -1
  685. package/lib/esm/tracking.d.ts +0 -16
  686. package/lib/esm/tracking.js +0 -71
  687. package/lib/esm/tracking.js.map +0 -1
  688. package/lib/esm/types.js +0 -14
  689. package/lib/esm/types.js.map +0 -1
  690. package/lib/esm/user-input/capture-user-input-api.js +0 -88
  691. package/lib/esm/user-input/capture-user-input-api.js.map +0 -1
  692. package/lib/esm/user-input/index.js +0 -37
  693. package/lib/esm/user-input/index.js.map +0 -1
  694. package/lib/esm/user-input/keyword.js.map +0 -1
  695. package/lib/esm/user-input/smart-intent.d.ts +0 -24
  696. package/lib/esm/user-input/smart-intent.js +0 -89
  697. package/lib/esm/user-input/smart-intent.js.map +0 -1
  698. package/lib/esm/utils/ai-agent.d.ts +0 -11
  699. package/lib/esm/utils/ai-agent.js +0 -28
  700. package/lib/esm/utils/ai-agent.js.map +0 -1
  701. package/lib/esm/utils/authentication.d.ts +0 -2
  702. package/lib/esm/utils/authentication.js +0 -21
  703. package/lib/esm/utils/authentication.js.map +0 -1
  704. package/lib/esm/utils/flow-locale.d.ts +0 -22
  705. package/lib/esm/utils/flow-locale.js +0 -79
  706. package/lib/esm/utils/flow-locale.js.map +0 -1
  707. package/lib/esm/utils/get-flow-builder-plugin.d.ts +0 -3
  708. package/lib/esm/utils/get-flow-builder-plugin.js +0 -16
  709. package/lib/esm/utils/get-flow-builder-plugin.js.map +0 -1
  710. package/lib/esm/utils/hubtype-assistant-content.d.ts +0 -13
  711. package/lib/esm/utils/hubtype-assistant-content.js +0 -184
  712. package/lib/esm/utils/hubtype-assistant-content.js.map +0 -1
  713. package/lib/esm/utils/input.d.ts +0 -6
  714. package/lib/esm/utils/input.js +0 -35
  715. package/lib/esm/utils/input.js.map +0 -1
  716. package/lib/esm/webview/contents-context.d.ts +0 -2
  717. package/lib/esm/webview/contents-context.js +0 -12
  718. package/lib/esm/webview/contents-context.js.map +0 -1
  719. package/lib/esm/webview/index.d.ts +0 -3
  720. package/lib/esm/webview/index.js +0 -10
  721. package/lib/esm/webview/index.js.map +0 -1
  722. package/lib/esm/webview/types.js +0 -9
  723. package/lib/esm/webview/types.js.map +0 -1
  724. package/lib/esm/webview/use-webview-contents.d.ts +0 -2
  725. package/lib/esm/webview/use-webview-contents.js +0 -83
  726. package/lib/esm/webview/use-webview-contents.js.map +0 -1
  727. /package/lib/{cjs/constants.d.ts → constants.d.ts} +0 -0
  728. /package/lib/{cjs/content-fields → content-fields}/hubtype-fields/node-types.d.ts +0 -0
  729. /package/lib/{cjs/services → services}/hubtype-queues-api.d.ts +0 -0
  730. /package/lib/{cjs/structured-output → structured-output}/flow-builder-content.d.ts +0 -0
  731. /package/lib/{cjs/utils → utils}/authentication.d.ts +0 -0
  732. /package/lib/{cjs/utils → utils}/flow-locale.d.ts +0 -0
  733. /package/lib/{cjs/utils → utils}/input.d.ts +0 -0
@@ -1,49 +1,55 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CustomFunction = exports.DEFAULT_FUNCTION_NAMES = void 0;
4
- exports.getArgumentsByLocale = getArgumentsByLocale;
5
- exports.DEFAULT_FUNCTION_NAMES = [
1
+ const DEFAULT_FUNCTION_NAMES = [
6
2
  'check-queue-status',
7
3
  'get-channel-type',
8
4
  'check-country',
9
- 'check-bot-variable',
5
+ 'check-bot-variable'
10
6
  ];
11
7
  class CustomFunction {
12
- constructor(functions, currentRequest, locale) {
13
- this.functions = functions;
14
- this.currentRequest = currentRequest;
15
- this.locale = locale;
16
- }
17
8
  async call(functionNode) {
18
9
  const functionNodeId = functionNode.id;
19
10
  const functionArguments = getArgumentsByLocale(functionNode.content.arguments, this.locale);
20
- const nameValues = functionArguments.map(arg => {
21
- return { [arg.name]: arg.value };
11
+ const nameValues = functionArguments.map((arg)=>{
12
+ return {
13
+ [arg.name]: arg.value
14
+ };
22
15
  });
23
16
  const args = Object.assign({
24
17
  request: this.currentRequest,
25
- results: functionNode.content.result_mapping.map(r => r.result),
18
+ results: functionNode.content.result_mapping.map((r)=>r.result)
26
19
  }, ...nameValues);
27
20
  const functionResult = await this.functions[functionNode.content.action](args);
28
21
  // TODO define result_mapping per locale??
29
- const result = functionNode.content.result_mapping.find(r => r.result === functionResult);
22
+ const result = functionNode.content.result_mapping.find((r)=>r.result === functionResult);
30
23
  if (!result?.target) {
31
24
  throw new Error(`No result found for result_mapping for node with id: ${functionNodeId}`);
32
25
  }
33
26
  return result.target.id;
34
27
  }
28
+ constructor(functions, currentRequest, locale){
29
+ this.functions = functions;
30
+ this.currentRequest = currentRequest;
31
+ this.locale = locale;
32
+ }
35
33
  }
36
- exports.CustomFunction = CustomFunction;
37
34
  function getArgumentsByLocale(args, locale) {
38
35
  let resultArguments = [];
39
- for (const arg of args) {
36
+ for (const arg of args){
40
37
  if ('locale' in arg && arg.locale === locale) {
41
- resultArguments = [...resultArguments, ...arg.values];
38
+ resultArguments = [
39
+ ...resultArguments,
40
+ ...arg.values
41
+ ];
42
42
  }
43
43
  if ('type' in arg) {
44
- resultArguments = [...resultArguments, arg];
44
+ resultArguments = [
45
+ ...resultArguments,
46
+ arg
47
+ ];
45
48
  }
46
49
  }
47
50
  return resultArguments;
48
51
  }
52
+
53
+ export { CustomFunction, DEFAULT_FUNCTION_NAMES, getArgumentsByLocale };
54
+
49
55
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functions/index.js","sources":["../../src/functions/index.ts"],"sourcesContent":["import type { ActionRequest } from '@botonic/react'\n\nimport type {\n HtFunctionArgument,\n HtFunctionArguments,\n HtFunctionNode,\n} from '../content-fields/hubtype-fields'\n\nexport const DEFAULT_FUNCTION_NAMES = [\n 'check-queue-status',\n 'get-channel-type',\n 'check-country',\n 'check-bot-variable',\n]\n\nexport class CustomFunction {\n public functions: Record<any, any>\n public currentRequest: ActionRequest\n public locale: string\n\n constructor(\n functions: Record<any, any>,\n currentRequest: ActionRequest,\n locale: string\n ) {\n this.functions = functions\n this.currentRequest = currentRequest\n this.locale = locale\n }\n\n async call(functionNode: HtFunctionNode): Promise<string> {\n const functionNodeId = functionNode.id\n const functionArguments = getArgumentsByLocale(\n functionNode.content.arguments,\n this.locale\n )\n const nameValues = functionArguments.map(arg => {\n return { [arg.name]: arg.value }\n })\n\n const args = Object.assign(\n {\n request: this.currentRequest,\n results: functionNode.content.result_mapping.map(r => r.result),\n },\n ...nameValues\n )\n const functionResult =\n await this.functions[functionNode.content.action](args)\n // TODO define result_mapping per locale??\n const result = functionNode.content.result_mapping.find(\n r => r.result === functionResult\n )\n if (!result?.target) {\n throw new Error(\n `No result found for result_mapping for node with id: ${functionNodeId}`\n )\n }\n return result.target.id\n }\n}\n\nexport function getArgumentsByLocale(\n args: HtFunctionArguments[],\n locale: string\n): HtFunctionArgument[] {\n let resultArguments: HtFunctionArgument[] = []\n for (const arg of args) {\n if ('locale' in arg && arg.locale === locale) {\n resultArguments = [...resultArguments, ...arg.values]\n }\n if ('type' in arg) {\n resultArguments = [...resultArguments, arg]\n }\n }\n\n return resultArguments\n}\n"],"names":["DEFAULT_FUNCTION_NAMES","CustomFunction","functionNode","functionNodeId","functionArguments","getArgumentsByLocale","nameValues","arg","args","Object","r","functionResult","result","Error","functions","currentRequest","locale","resultArguments"],"mappings":"AAQO,MAAMA,sBAAsBA,GAAG;IACpC;IACA;IACA;IACA;CACD;AAEM,MAAMC,cAAcA;IAezB,MAAM,KAAKC,YAA4B,EAAmB;QACxD,MAAMC,iBAAiBD,aAAa,EAAE;QACtC,MAAME,oBAAoBC,oBAAoBA,CAC5CH,aAAa,OAAO,CAAC,SAAS,EAC9B,IAAI,CAAC,MAAM;QAEb,MAAMI,aAAaF,kBAAkB,GAAG,CAACG,CAAAA;YACvC,OAAO;gBAAE,CAACA,IAAI,IAAI,CAAC,EAAEA,IAAI,KAAK;YAAC;QACjC;QAEA,MAAMC,OAAOC,OAAO,MAAM,CACxB;YACE,SAAS,IAAI,CAAC,cAAc;YAC5B,SAASP,aAAa,OAAO,CAAC,cAAc,CAAC,GAAG,CAACQ,CAAAA,IAAKA,EAAE,MAAM;QAChE,MACGJ;QAEL,MAAMK,iBACJ,MAAM,IAAI,CAAC,SAAS,CAACT,aAAa,OAAO,CAAC,MAAM,CAAC,CAACM;QACpD,0CAA0C;QAC1C,MAAMI,SAASV,aAAa,OAAO,CAAC,cAAc,CAAC,IAAI,CACrDQ,CAAAA,IAAKA,EAAE,MAAM,KAAKC;QAEpB,IAAI,CAACC,QAAQ,QAAQ;YACnB,MAAM,IAAIC,MACR,CAAC,qDAAqD,EAAEV,gBAAgB;QAE5E;QACA,OAAOS,OAAO,MAAM,CAAC,EAAE;IACzB;IAvCA,YACEE,SAA2B,EAC3BC,cAA6B,EAC7BC,MAAc,CACd;QACA,IAAI,CAAC,SAAS,GAAGF;QACjB,IAAI,CAAC,cAAc,GAAGC;QACtB,IAAI,CAAC,MAAM,GAAGC;IAChB;AAgCF;AAEO,SAASX,oBAAoBA,CAClCG,IAA2B,EAC3BQ,MAAc;IAEd,IAAIC,kBAAwC,EAAE;IAC9C,KAAK,MAAMV,OAAOC,KAAM;QACtB,IAAI,YAAYD,OAAOA,IAAI,MAAM,KAAKS,QAAQ;YAC5CC,kBAAkB;mBAAIA;mBAAoBV,IAAI,MAAM;aAAC;QACvD;QACA,IAAI,UAAUA,KAAK;YACjBU,kBAAkB;mBAAIA;gBAAiBV;aAAI;QAC7C;IACF;IAEA,OAAOU;AACT"}
@@ -1,9 +1,9 @@
1
1
  import { type Plugin, type PluginPreRequest, type ResolvedPlugins, type Session } from '@botonic/core';
2
- import { FlowBuilderApi } from './api';
3
- import type { FlowContent } from './content-fields';
4
- import { type HtNodeWithContent } from './content-fields/hubtype-fields';
5
- import { type AiAgentFunction, type BotonicPluginFlowBuilderOptions, type ContentFilter, FlowBuilderJSONVersion, type InShadowingConfig, type PayloadParamsBase, type RatingSubmittedInfo, type TrackEventFunction } from './types';
6
- import type { SmartIntentsInferenceConfig } from './user-input/smart-intent';
2
+ import { FlowBuilderApi } from './api.js';
3
+ import type { FlowContent } from './content-fields/index.js';
4
+ import { type HtNodeWithContent } from './content-fields/hubtype-fields/index.js';
5
+ import { type AiAgentFunction, type BotonicPluginFlowBuilderOptions, type ContentFilter, FlowBuilderJSONVersion, type InShadowingConfig, type PayloadParamsBase, type RatingSubmittedInfo, type TrackEventFunction } from './types.js';
6
+ import type { SmartIntentsInferenceConfig } from './user-input/smart-intent.js';
7
7
  export default class BotonicPluginFlowBuilder implements Plugin {
8
8
  cmsApi: FlowBuilderApi;
9
9
  private flow?;
@@ -36,10 +36,10 @@ export default class BotonicPluginFlowBuilder implements Plugin {
36
36
  getRatingSubmittedInfo(payload: string): RatingSubmittedInfo;
37
37
  setInShadowing(inShadowing: InShadowingConfig): void;
38
38
  }
39
- export * from './action';
40
- export { AGENT_RATING_PAYLOAD, EMPTY_PAYLOAD } from './constants';
41
- export * from './content-fields';
42
- export { HtBotActionNode } from './content-fields/hubtype-fields';
43
- export { getCommonFlowContentEventArgsForContentId, trackFlowContent, } from './tracking';
44
- export { BotonicPluginFlowBuilderOptions, ContentFilter, FlowBuilderJSONVersion, PayloadParamsBase, RatingSubmittedInfo, } from './types';
45
- export * from './webview';
39
+ export * from './action/index.js';
40
+ export { AGENT_RATING_PAYLOAD, EMPTY_PAYLOAD } from './constants.js';
41
+ export * from './content-fields/index.js';
42
+ export type { HtBotActionNode } from './content-fields/hubtype-fields/index.js';
43
+ export { getCommonFlowContentEventArgsForContentId, trackFlowContent, } from './tracking.js';
44
+ export { type BotonicPluginFlowBuilderOptions, type ContentFilter, FlowBuilderJSONVersion, type PayloadParamsBase, type RatingSubmittedInfo, } from './types.js';
45
+ export * from './webview/index.js';
@@ -1,47 +1,45 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FlowBuilderJSONVersion = exports.trackFlowContent = exports.getCommonFlowContentEventArgsForContentId = exports.EMPTY_PAYLOAD = exports.AGENT_RATING_PAYLOAD = void 0;
4
- const tslib_1 = require("tslib");
5
- const core_1 = require("@botonic/core");
6
- const uuid_1 = require("uuid");
7
- const api_1 = require("./api");
8
- const constants_1 = require("./constants");
9
- const hubtype_fields_1 = require("./content-fields/hubtype-fields");
10
- const flow_factory_1 = require("./flow-factory");
11
- const functions_1 = require("./functions");
12
- const types_1 = require("./types");
13
- const user_input_1 = require("./user-input");
14
- const authentication_1 = require("./utils/authentication");
15
- const input_1 = require("./utils/input");
16
- // TODO: Create a proper service to wrap all calls and allow api versioning
1
+ import { INPUT, PROVIDER } from "@botonic/core";
2
+ import { v7 } from "uuid";
3
+ import { FlowBuilderApi } from "./api.js";
4
+ import { AGENT_RATING_PAYLOAD, EMPTY_PAYLOAD, FLOW_BUILDER_API_URL_PROD, SEPARATOR, SOURCE_INFO_SEPARATOR } from "./constants.js";
5
+ import { HtNodeWithContentType } from "./content-fields/hubtype-fields/index.js";
6
+ import { FlowFactory } from "./flow-factory.js";
7
+ import { CustomFunction, DEFAULT_FUNCTION_NAMES } from "./functions/index.js";
8
+ import { FlowBuilderJSONVersion } from "./types.js";
9
+ import { getNextPayloadByUserInput } from "./user-input/index.js";
10
+ import { resolveGetAccessToken } from "./utils/authentication.js";
11
+ import { inputHasTextOrTranscript } from "./utils/input.js";
12
+
13
+ export * from "./action/index.js";
14
+ export * from "./content-fields/index.js";
15
+ export * from "./webview/index.js";
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
17
39
  class BotonicPluginFlowBuilder {
18
- constructor(options) {
19
- this.apiUrl = options.apiUrl || constants_1.FLOW_BUILDER_API_URL_PROD;
20
- this.jsonVersion = options.jsonVersion || types_1.FlowBuilderJSONVersion.LATEST;
21
- this.flow = options.flow;
22
- this.getAccessToken = (0, authentication_1.resolveGetAccessToken)(options.getAccessToken);
23
- this.trackEvent = options.trackEvent;
24
- this.getAiAgentResponse = options.getAiAgentResponse;
25
- this.smartIntentsConfig = {
26
- ...options?.smartIntentsConfig,
27
- useLatest: this.jsonVersion === types_1.FlowBuilderJSONVersion.LATEST,
28
- };
29
- const customFunctions = options.customFunctions || {};
30
- this.functions = customFunctions;
31
- this.inShadowing = {
32
- allowKeywords: options.inShadowing?.allowKeywords || false,
33
- allowSmartIntents: options.inShadowing?.allowSmartIntents || false,
34
- allowAiAgents: options.inShadowing?.allowAiAgents || false,
35
- };
36
- this.contentFilters = options.contentFilters || [];
37
- this.customRatingMessageEnabled =
38
- options.customRatingMessageEnabled || false;
39
- this.disableAIAgentInFirstInteraction =
40
- options.disableAIAgentInFirstInteraction || false;
41
- }
42
40
  resolveFlowUrl(request) {
43
41
  if (request.session.is_test_integration) {
44
- return `${this.apiUrl}/v1/bot_flows/{bot_id}/versions/${types_1.FlowBuilderJSONVersion.DRAFT}/`;
42
+ return `${this.apiUrl}/v1/bot_flows/{bot_id}/versions/${FlowBuilderJSONVersion.DRAFT}/`;
45
43
  }
46
44
  return `${this.apiUrl}/v1/bot_flows/{bot_id}/versions/${this.jsonVersion}/`;
47
45
  }
@@ -49,27 +47,26 @@ class BotonicPluginFlowBuilder {
49
47
  // When AI Agent is executed in Whatsapp, button payloads come as referral and must be converted to text being processed by the agent.
50
48
  this.convertWhatsappAiAgentEmptyPayloads(request);
51
49
  this.currentRequest = request;
52
- this.cmsApi = await api_1.FlowBuilderApi.create({
50
+ this.cmsApi = await FlowBuilderApi.create({
53
51
  flowUrl: this.resolveFlowUrl(request),
54
52
  url: this.apiUrl,
55
53
  flow: this.flow,
56
54
  accessToken: this.getAccessToken(request.session),
57
- request: this.currentRequest,
55
+ request: this.currentRequest
58
56
  });
59
- const checkUserTextInput = (0, input_1.inputHasTextOrTranscript)(request.input) && !request.input.payload;
57
+ const checkUserTextInput = inputHasTextOrTranscript(request.input) && !request.input.payload;
60
58
  if (checkUserTextInput) {
61
59
  const resolvedLocale = this.cmsApi.getResolvedLocale();
62
- const nextPayload = await (0, user_input_1.getNextPayloadByUserInput)(this.cmsApi, resolvedLocale, request, this.smartIntentsConfig);
60
+ const nextPayload = await getNextPayloadByUserInput(this.cmsApi, resolvedLocale, request, this.smartIntentsConfig);
63
61
  request.input.payload = nextPayload;
64
62
  }
65
63
  await this.updateRequestBeforeRoutes(request);
66
64
  }
67
65
  convertWhatsappAiAgentEmptyPayloads(request) {
68
- if (request.session.user.provider === core_1.PROVIDER.WHATSAPP) {
69
- const shouldUseReferral = request.input.referral &&
70
- request.input.payload?.startsWith(constants_1.EMPTY_PAYLOAD);
66
+ if (request.session.user.provider === PROVIDER.WHATSAPP) {
67
+ const shouldUseReferral = request.input.referral && request.input.payload?.startsWith(EMPTY_PAYLOAD);
71
68
  if (shouldUseReferral) {
72
- request.input.type = core_1.INPUT.TEXT;
69
+ request.input.type = INPUT.TEXT;
73
70
  request.input.data = request.input.referral;
74
71
  }
75
72
  }
@@ -80,8 +77,7 @@ class BotonicPluginFlowBuilder {
80
77
  request.input.payload = this.removeSourceSuffix(request.input.payload);
81
78
  if (this.cmsApi.isBotAction(request.input.payload)) {
82
79
  const cmsBotAction = this.cmsApi.getNodeById(request.input.payload);
83
- request.input.payload =
84
- this.cmsApi.createPayloadWithParams(cmsBotAction);
80
+ request.input.payload = this.cmsApi.createPayloadWithParams(cmsBotAction);
85
81
  // Re-execute convertWhatsappAiAgentEmptyPayloads function to handle
86
82
  // the case that a BotAction has a payload equals to EMPTY_PAYLOAD
87
83
  this.convertWhatsappAiAgentEmptyPayloads(request);
@@ -89,7 +85,7 @@ class BotonicPluginFlowBuilder {
89
85
  }
90
86
  }
91
87
  removeSourceSuffix(payload) {
92
- return payload.split(constants_1.SOURCE_INFO_SEPARATOR)[0];
88
+ return payload.split(SOURCE_INFO_SEPARATOR)[0];
93
89
  }
94
90
  post(request) {
95
91
  request.input.nluResolution = undefined;
@@ -109,70 +105,91 @@ class BotonicPluginFlowBuilder {
109
105
  }
110
106
  async getStartContents() {
111
107
  const startNode = this.cmsApi.getStartNode();
112
- this.currentRequest.session.flow_thread_id = (0, uuid_1.v7)();
108
+ this.currentRequest.session.flow_thread_id = v7();
113
109
  return await this.getContentsByNode(startNode);
114
110
  }
115
111
  async getContentsByNode(node, prevContents) {
116
112
  const contents = prevContents || [];
117
113
  const resolvedLocale = this.cmsApi.getResolvedLocale();
118
- if (node.type === hubtype_fields_1.HtNodeWithContentType.FUNCTION &&
119
- !functions_1.DEFAULT_FUNCTION_NAMES.includes(node.content.action)) {
120
- const customFunctionResolver = new functions_1.CustomFunction(this.functions, this.currentRequest, resolvedLocale);
114
+ if (node.type === HtNodeWithContentType.FUNCTION && !DEFAULT_FUNCTION_NAMES.includes(node.content.action)) {
115
+ const customFunctionResolver = new CustomFunction(this.functions, this.currentRequest, resolvedLocale);
121
116
  const targetId = await customFunctionResolver.call(node);
122
117
  return this.getContentsById(targetId, contents);
123
118
  }
124
- const flowFactory = new flow_factory_1.FlowFactory(this.currentRequest, this.cmsApi, resolvedLocale);
119
+ const flowFactory = new FlowFactory(this.currentRequest, this.cmsApi, resolvedLocale);
125
120
  const content = await flowFactory.getFlowContent(node);
126
121
  if (content) {
127
122
  contents.push(content);
128
123
  }
129
124
  // If node is BOT_ACTION not add more contents to render, next nodes render after execute action
130
- if (node.type === hubtype_fields_1.HtNodeWithContentType.BOT_ACTION) {
125
+ if (node.type === HtNodeWithContentType.BOT_ACTION) {
131
126
  return contents;
132
127
  }
133
128
  // TODO: prevent infinite recursive calls
134
129
  if (content?.followUp) {
135
130
  return this.getContentsById(content.followUp.id, contents);
136
- }
137
- else if (node.follow_up) {
131
+ } else if (node.follow_up) {
138
132
  console.log('FOLLOWUP FROM NODE-------> OLD SYSTEM');
139
133
  return this.getContentsById(node.follow_up.id, contents);
140
134
  }
141
135
  return contents;
142
136
  }
143
137
  getPayloadParams(payload) {
144
- const payloadParams = JSON.parse(payload.split(constants_1.SEPARATOR)[1] || '{}');
138
+ const payloadParams = JSON.parse(payload.split(SEPARATOR)[1] || '{}');
145
139
  return payloadParams;
146
140
  }
147
141
  getFlowName(flowId) {
148
142
  return this.cmsApi.getFlowName(flowId);
149
143
  }
150
144
  getRatingSubmittedInfo(payload) {
151
- const buttonId = payload?.split(constants_1.SEPARATOR)[1];
145
+ const buttonId = payload?.split(SEPARATOR)[1];
152
146
  const ratingNode = this.cmsApi.getRatingNodeByButtonId(buttonId);
153
147
  const ratingButton = this.cmsApi.getRatingButtonById(ratingNode, buttonId);
154
- const possibleOptions = ratingNode.content.buttons.map(button => button.text);
155
- const possibleValues = ratingNode.content.buttons.map(button => button.value);
148
+ const possibleOptions = ratingNode.content.buttons.map((button)=>button.text);
149
+ const possibleValues = ratingNode.content.buttons.map((button)=>button.value);
156
150
  return {
157
151
  ...ratingButton,
158
152
  possibleOptions,
159
- possibleValues,
153
+ possibleValues
160
154
  };
161
155
  }
162
156
  setInShadowing(inShadowing) {
163
157
  this.inShadowing = inShadowing;
164
158
  }
159
+ constructor(options){
160
+ this.apiUrl = options.apiUrl || FLOW_BUILDER_API_URL_PROD;
161
+ this.jsonVersion = options.jsonVersion || FlowBuilderJSONVersion.LATEST;
162
+ this.flow = options.flow;
163
+ this.getAccessToken = resolveGetAccessToken(options.getAccessToken);
164
+ this.trackEvent = options.trackEvent;
165
+ this.getAiAgentResponse = options.getAiAgentResponse;
166
+ this.smartIntentsConfig = {
167
+ ...options?.smartIntentsConfig,
168
+ useLatest: this.jsonVersion === FlowBuilderJSONVersion.LATEST
169
+ };
170
+ const customFunctions = options.customFunctions || {};
171
+ this.functions = customFunctions;
172
+ this.inShadowing = {
173
+ allowKeywords: options.inShadowing?.allowKeywords || false,
174
+ allowSmartIntents: options.inShadowing?.allowSmartIntents || false,
175
+ allowAiAgents: options.inShadowing?.allowAiAgents || false
176
+ };
177
+ this.contentFilters = options.contentFilters || [];
178
+ this.customRatingMessageEnabled = options.customRatingMessageEnabled || false;
179
+ this.disableAIAgentInFirstInteraction = options.disableAIAgentInFirstInteraction || false;
180
+ }
165
181
  }
166
- exports.default = BotonicPluginFlowBuilder;
167
- tslib_1.__exportStar(require("./action"), exports);
168
- var constants_2 = require("./constants");
169
- Object.defineProperty(exports, "AGENT_RATING_PAYLOAD", { enumerable: true, get: function () { return constants_2.AGENT_RATING_PAYLOAD; } });
170
- Object.defineProperty(exports, "EMPTY_PAYLOAD", { enumerable: true, get: function () { return constants_2.EMPTY_PAYLOAD; } });
171
- tslib_1.__exportStar(require("./content-fields"), exports);
172
- var tracking_1 = require("./tracking");
173
- Object.defineProperty(exports, "getCommonFlowContentEventArgsForContentId", { enumerable: true, get: function () { return tracking_1.getCommonFlowContentEventArgsForContentId; } });
174
- Object.defineProperty(exports, "trackFlowContent", { enumerable: true, get: function () { return tracking_1.trackFlowContent; } });
175
- var types_2 = require("./types");
176
- Object.defineProperty(exports, "FlowBuilderJSONVersion", { enumerable: true, get: function () { return types_2.FlowBuilderJSONVersion; } });
177
- tslib_1.__exportStar(require("./webview"), exports);
182
+ // TODO: Create a proper service to wrap all calls and allow api versioning
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+
191
+ export { AGENT_RATING_PAYLOAD, EMPTY_PAYLOAD, FlowBuilderJSONVersion };
192
+ export { getCommonFlowContentEventArgsForContentId, trackFlowContent } from "./tracking.js";
193
+ export default BotonicPluginFlowBuilder;
194
+
178
195
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import {\n INPUT,\n type Plugin,\n type PluginPreRequest,\n PROVIDER,\n type ResolvedPlugins,\n type Session,\n} from '@botonic/core'\nimport type { ActionRequest } from '@botonic/react'\nimport { v7 as uuidv7 } from 'uuid'\n\nimport { FlowBuilderApi } from './api'\nimport {\n EMPTY_PAYLOAD,\n FLOW_BUILDER_API_URL_PROD,\n SEPARATOR,\n SOURCE_INFO_SEPARATOR,\n} from './constants'\nimport type { FlowContent } from './content-fields'\nimport {\n type HtBotActionNode,\n type HtFlowBuilderData,\n type HtNodeWithContent,\n HtNodeWithContentType,\n} from './content-fields/hubtype-fields'\nimport { FlowFactory } from './flow-factory'\nimport { CustomFunction, DEFAULT_FUNCTION_NAMES } from './functions'\nimport {\n type AiAgentFunction,\n type BotonicPluginFlowBuilderOptions,\n type ContentFilter,\n FlowBuilderJSONVersion,\n type InShadowingConfig,\n type PayloadParamsBase,\n type RatingSubmittedInfo,\n type TrackEventFunction,\n} from './types'\nimport { getNextPayloadByUserInput } from './user-input'\nimport type { SmartIntentsInferenceConfig } from './user-input/smart-intent'\nimport { resolveGetAccessToken } from './utils/authentication'\nimport { inputHasTextOrTranscript } from './utils/input'\n\n// TODO: Create a proper service to wrap all calls and allow api versioning\n\nexport default class BotonicPluginFlowBuilder implements Plugin {\n public cmsApi: FlowBuilderApi\n private flow?: HtFlowBuilderData\n private functions: Record<any, any>\n private currentRequest: PluginPreRequest\n public getAccessToken: (session: Session) => string\n public trackEvent?: TrackEventFunction\n public getAiAgentResponse?: AiAgentFunction\n public smartIntentsConfig: SmartIntentsInferenceConfig\n public inShadowing: InShadowingConfig\n public contentFilters: ContentFilter[]\n\n // TODO: Rethink how we construct FlowBuilderApi to be simpler\n public jsonVersion: FlowBuilderJSONVersion\n public apiUrl: string\n public customRatingMessageEnabled: boolean\n public disableAIAgentInFirstInteraction: boolean\n\n constructor(options: BotonicPluginFlowBuilderOptions<ResolvedPlugins, any>) {\n this.apiUrl = options.apiUrl || FLOW_BUILDER_API_URL_PROD\n this.jsonVersion = options.jsonVersion || FlowBuilderJSONVersion.LATEST\n this.flow = options.flow\n this.getAccessToken = resolveGetAccessToken(options.getAccessToken)\n this.trackEvent = options.trackEvent\n this.getAiAgentResponse = options.getAiAgentResponse\n this.smartIntentsConfig = {\n ...options?.smartIntentsConfig,\n useLatest: this.jsonVersion === FlowBuilderJSONVersion.LATEST,\n }\n const customFunctions = options.customFunctions || {}\n this.functions = customFunctions\n this.inShadowing = {\n allowKeywords: options.inShadowing?.allowKeywords || false,\n allowSmartIntents: options.inShadowing?.allowSmartIntents || false,\n allowAiAgents: options.inShadowing?.allowAiAgents || false,\n }\n this.contentFilters = options.contentFilters || []\n this.customRatingMessageEnabled =\n options.customRatingMessageEnabled || false\n this.disableAIAgentInFirstInteraction =\n options.disableAIAgentInFirstInteraction || false\n }\n\n resolveFlowUrl(request: PluginPreRequest): string {\n if (request.session.is_test_integration) {\n return `${this.apiUrl}/v1/bot_flows/{bot_id}/versions/${FlowBuilderJSONVersion.DRAFT}/`\n }\n return `${this.apiUrl}/v1/bot_flows/{bot_id}/versions/${this.jsonVersion}/`\n }\n\n async pre(request: PluginPreRequest): Promise<void> {\n // When AI Agent is executed in Whatsapp, button payloads come as referral and must be converted to text being processed by the agent.\n this.convertWhatsappAiAgentEmptyPayloads(request)\n\n this.currentRequest = request\n this.cmsApi = await FlowBuilderApi.create({\n flowUrl: this.resolveFlowUrl(request),\n url: this.apiUrl,\n flow: this.flow,\n accessToken: this.getAccessToken(request.session),\n request: this.currentRequest,\n })\n\n const checkUserTextInput =\n inputHasTextOrTranscript(request.input) && !request.input.payload\n\n if (checkUserTextInput) {\n const resolvedLocale = this.cmsApi.getResolvedLocale()\n const nextPayload = await getNextPayloadByUserInput(\n this.cmsApi,\n resolvedLocale,\n request as unknown as ActionRequest,\n this.smartIntentsConfig\n )\n request.input.payload = nextPayload\n }\n\n await this.updateRequestBeforeRoutes(request)\n }\n\n private convertWhatsappAiAgentEmptyPayloads(request: PluginPreRequest): void {\n if (request.session.user.provider === PROVIDER.WHATSAPP) {\n const shouldUseReferral =\n request.input.referral &&\n request.input.payload?.startsWith(EMPTY_PAYLOAD)\n\n if (shouldUseReferral) {\n request.input.type = INPUT.TEXT\n request.input.data = request.input.referral\n }\n }\n }\n\n private async updateRequestBeforeRoutes(\n request: PluginPreRequest\n ): Promise<void> {\n this.cmsApi.removeCaptureUserInputId()\n if (request.input.payload) {\n request.input.payload = this.removeSourceSuffix(request.input.payload)\n\n if (this.cmsApi.isBotAction(request.input.payload)) {\n const cmsBotAction = this.cmsApi.getNodeById<HtBotActionNode>(\n request.input.payload\n )\n\n request.input.payload =\n this.cmsApi.createPayloadWithParams(cmsBotAction)\n\n // Re-execute convertWhatsappAiAgentEmptyPayloads function to handle\n // the case that a BotAction has a payload equals to EMPTY_PAYLOAD\n this.convertWhatsappAiAgentEmptyPayloads(request)\n }\n }\n }\n\n private removeSourceSuffix(payload: string): string {\n return payload.split(SOURCE_INFO_SEPARATOR)[0]\n }\n\n post(request: PluginPreRequest): void {\n request.input.nluResolution = undefined\n delete request.session.user.system_locale_updated\n }\n\n async getContentsByContentID(\n contentID: string,\n prevContents?: FlowContent[]\n ): Promise<FlowContent[]> {\n const node = this.cmsApi.getNodeByContentID(contentID) as HtNodeWithContent\n return await this.getContentsByNode(node, prevContents)\n }\n\n getUUIDByContentID(contentID: string): string {\n const node = this.cmsApi.getNodeByContentID(contentID)\n return node.id\n }\n\n private async getContentsById(\n id: string,\n prevContents?: FlowContent[]\n ): Promise<FlowContent[]> {\n const node = this.cmsApi.getNodeById(id) as HtNodeWithContent\n return await this.getContentsByNode(node, prevContents)\n }\n\n async getStartContents(): Promise<FlowContent[]> {\n const startNode = this.cmsApi.getStartNode()\n this.currentRequest.session.flow_thread_id = uuidv7()\n return await this.getContentsByNode(startNode)\n }\n\n async getContentsByNode(\n node: HtNodeWithContent,\n prevContents?: FlowContent[]\n ): Promise<FlowContent[]> {\n const contents = prevContents || []\n const resolvedLocale = this.cmsApi.getResolvedLocale()\n\n if (\n node.type === HtNodeWithContentType.FUNCTION &&\n !DEFAULT_FUNCTION_NAMES.includes(node.content.action)\n ) {\n const customFunctionResolver = new CustomFunction(\n this.functions,\n this.currentRequest,\n resolvedLocale\n )\n const targetId = await customFunctionResolver.call(node)\n return this.getContentsById(targetId, contents)\n }\n\n const flowFactory = new FlowFactory(\n this.currentRequest,\n this.cmsApi,\n resolvedLocale\n )\n const content = await flowFactory.getFlowContent(node)\n if (content) {\n contents.push(content)\n }\n\n // If node is BOT_ACTION not add more contents to render, next nodes render after execute action\n if (node.type === HtNodeWithContentType.BOT_ACTION) {\n return contents\n }\n\n // TODO: prevent infinite recursive calls\n if (content?.followUp) {\n return this.getContentsById(content.followUp.id, contents)\n } else if (node.follow_up) {\n console.log('FOLLOWUP FROM NODE-------> OLD SYSTEM')\n return this.getContentsById(node.follow_up.id, contents)\n }\n\n return contents\n }\n\n getPayloadParams<T extends PayloadParamsBase>(payload: string): T {\n const payloadParams = JSON.parse(payload.split(SEPARATOR)[1] || '{}')\n return payloadParams\n }\n\n getFlowName(flowId: string): string {\n return this.cmsApi.getFlowName(flowId)\n }\n\n getRatingSubmittedInfo(payload: string): RatingSubmittedInfo {\n const buttonId = payload?.split(SEPARATOR)[1]\n const ratingNode = this.cmsApi.getRatingNodeByButtonId(buttonId)\n\n const ratingButton = this.cmsApi.getRatingButtonById(ratingNode, buttonId)\n const possibleOptions = ratingNode.content.buttons.map(\n button => button.text\n )\n const possibleValues = ratingNode.content.buttons.map(\n button => button.value\n )\n\n return {\n ...ratingButton,\n possibleOptions,\n possibleValues,\n }\n }\n\n setInShadowing(inShadowing: InShadowingConfig): void {\n this.inShadowing = inShadowing\n }\n}\n\nexport * from './action'\nexport { AGENT_RATING_PAYLOAD, EMPTY_PAYLOAD } from './constants'\nexport * from './content-fields'\nexport type { HtBotActionNode } from './content-fields/hubtype-fields'\nexport {\n getCommonFlowContentEventArgsForContentId,\n trackFlowContent,\n} from './tracking'\nexport {\n type BotonicPluginFlowBuilderOptions,\n type ContentFilter,\n FlowBuilderJSONVersion,\n type PayloadParamsBase,\n type RatingSubmittedInfo,\n} from './types'\nexport * from './webview'\n"],"names":["INPUT","PROVIDER","v7","uuidv7","FlowBuilderApi","EMPTY_PAYLOAD","FLOW_BUILDER_API_URL_PROD","SEPARATOR","SOURCE_INFO_SEPARATOR","HtNodeWithContentType","FlowFactory","CustomFunction","DEFAULT_FUNCTION_NAMES","FlowBuilderJSONVersion","getNextPayloadByUserInput","resolveGetAccessToken","inputHasTextOrTranscript","BotonicPluginFlowBuilder","request","checkUserTextInput","resolvedLocale","nextPayload","shouldUseReferral","cmsBotAction","payload","undefined","contentID","prevContents","node","id","startNode","contents","customFunctionResolver","targetId","flowFactory","content","console","payloadParams","JSON","flowId","buttonId","ratingNode","ratingButton","possibleOptions","button","possibleValues","inShadowing","options","customFunctions","AGENT_RATING_PAYLOAD","getCommonFlowContentEventArgsForContentId","trackFlowContent"],"mappings":"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"}
@@ -0,0 +1,26 @@
1
+ import axios from "axios";
2
+
3
+
4
+
5
+ const HUBTYPE_API_URL = process.env.HUBTYPE_API_URL || 'https://api.hubtype.com';
6
+ class HubtypeQueuesApi {
7
+ async getAvailability() {
8
+ const response = await axios.get(`${HUBTYPE_API_URL}/external/v1/queues/${this.queueId}/availability/`, // TODO: Make it configurable in the future
9
+ {
10
+ params: {
11
+ check_queue_schedule: true,
12
+ check_waiting_cases: false,
13
+ check_available_agents: this.checkAvailableAgents
14
+ }
15
+ });
16
+ return response.data;
17
+ }
18
+ constructor(queueId, checkAvailableAgents){
19
+ this.queueId = queueId;
20
+ this.checkAvailableAgents = checkAvailableAgents || false;
21
+ }
22
+ }
23
+
24
+ export { HubtypeQueuesApi };
25
+
26
+ //# sourceMappingURL=hubtype-queues-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"services/hubtype-queues-api.js","sources":["../../src/services/hubtype-queues-api.ts"],"sourcesContent":["import axios from 'axios'\n\nconst HUBTYPE_API_URL = process.env.HUBTYPE_API_URL || 'https://api.hubtype.com'\n\nexport interface AvailabilityData {\n available: boolean\n waiting_cases: number\n availability_threshold_waiting_cases: number\n open: boolean\n name: string\n available_agents: number\n}\nexport class HubtypeQueuesApi {\n public queueId: string\n public checkAvailableAgents: boolean\n\n constructor(queueId: string, checkAvailableAgents?: boolean) {\n this.queueId = queueId\n this.checkAvailableAgents = checkAvailableAgents || false\n }\n\n async getAvailability(): Promise<AvailabilityData> {\n const response = await axios.get(\n `${HUBTYPE_API_URL}/external/v1/queues/${this.queueId}/availability/`,\n // TODO: Make it configurable in the future\n {\n params: {\n check_queue_schedule: true,\n check_waiting_cases: false,\n check_available_agents: this.checkAvailableAgents,\n },\n }\n )\n return response.data\n }\n}\n"],"names":["axios","HUBTYPE_API_URL","process","HubtypeQueuesApi","response","queueId","checkAvailableAgents"],"mappings":";;;AAAyB;AAEzB,MAAMC,eAAeA,GAAGC,QAAQ,GAAG,CAAC,eAAe,IAAI;AAUhD,MAAMC,gBAAgBA;IAS3B,MAAM,kBAA6C;QACjD,MAAMC,WAAW,MAAMJ,SAAS,CAC9B,GAAGC,eAAeA,CAAC,oBAAoB,EAAE,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,EACrE,2CAA2C;QAC3C;YACE,QAAQ;gBACN,sBAAsB;gBACtB,qBAAqB;gBACrB,wBAAwB,IAAI,CAAC,oBAAoB;YACnD;QACF;QAEF,OAAOG,SAAS,IAAI;IACtB;IAlBA,YAAYC,OAAe,EAAEC,oBAA8B,CAAE;QAC3D,IAAI,CAAC,OAAO,GAAGD;QACf,IAAI,CAAC,oBAAoB,GAAGC,wBAAwB;IACtD;AAgBF"}
@@ -0,0 +1,16 @@
1
+ import { z } from "zod";
2
+
3
+
4
+
5
+ var flow_builder_content_FlowBuilderOutputMessageType = /*#__PURE__*/ function(FlowBuilderOutputMessageType) {
6
+ FlowBuilderOutputMessageType["FlowBuilderContent"] = "flowBuilderContent";
7
+ return FlowBuilderOutputMessageType;
8
+ }({});
9
+ const FlowBuilderContentSchema = z.object({
10
+ type: z.literal("flowBuilderContent"),
11
+ contentId: z.string()
12
+ }).describe('A Flow Builder content ID. Use it only when asked explicitly in the prompt');
13
+
14
+ export { FlowBuilderContentSchema, flow_builder_content_FlowBuilderOutputMessageType as FlowBuilderOutputMessageType };
15
+
16
+ //# sourceMappingURL=flow-builder-content.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structured-output/flow-builder-content.js","sources":["../../src/structured-output/flow-builder-content.ts"],"sourcesContent":["import type { BaseMessage } from '@botonic/core'\nimport { z } from 'zod'\n\nexport enum FlowBuilderOutputMessageType {\n FlowBuilderContent = 'flowBuilderContent',\n}\n\nexport interface FlowBuilderContentMessage\n extends BaseMessage<FlowBuilderOutputMessageType.FlowBuilderContent> {\n type: FlowBuilderOutputMessageType.FlowBuilderContent\n contentId: string\n}\n\nexport const FlowBuilderContentSchema = z\n .object({\n type: z.literal(FlowBuilderOutputMessageType.FlowBuilderContent),\n contentId: z.string(),\n })\n .describe(\n 'A Flow Builder content ID. Use it only when asked explicitly in the prompt'\n )\n"],"names":["z","FlowBuilderOutputMessageType","FlowBuilderContentSchema"],"mappings":";;;AACuB;AAEhB,IAAKC,iDAA4BA,0BAA5BA;;WAAAA;MAEX;AAQM,MAAMC,wBAAwBA,GAAGF,QAC/B,CAAC;IACN,MAAMA,SAAS;IACf,WAAWA,QAAQ;AACrB,GACC,QAAQ,CACP,8EACD"}
@@ -1,7 +1,7 @@
1
1
  import { type BotContext, EventAction } from '@botonic/core';
2
2
  import type { ActionRequest } from '@botonic/react';
3
- import type { FlowBuilderApi } from './api';
4
- import type { FlowContent } from './content-fields';
3
+ import type { FlowBuilderApi } from './api.js';
4
+ import type { FlowContent } from './content-fields/index.js';
5
5
  export declare function trackEvent(request: ActionRequest, eventAction: EventAction, args?: Record<string, any>): Promise<void>;
6
6
  export declare function trackFlowContent(request: ActionRequest, contents: FlowContent[]): Promise<void>;
7
7
  export declare function trackOneContent(request: ActionRequest, content: FlowContent, cmsApi?: FlowBuilderApi): Promise<void>;
@@ -1,34 +1,37 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.trackEvent = trackEvent;
4
- exports.trackFlowContent = trackFlowContent;
5
- exports.trackOneContent = trackOneContent;
6
- exports.getCommonFlowContentEventArgsForContentId = getCommonFlowContentEventArgsForContentId;
7
- const core_1 = require("@botonic/core");
8
- const uuid_1 = require("uuid");
9
- const hubtype_fields_1 = require("./content-fields/hubtype-fields");
10
- const get_flow_builder_plugin_1 = require("./utils/get-flow-builder-plugin");
1
+ import { EventAction } from "@botonic/core";
2
+ import { v7 } from "uuid";
3
+ import { HtNodeWithContentType } from "./content-fields/hubtype-fields/index.js";
4
+ import { getFlowBuilderPlugin } from "./utils/get-flow-builder-plugin.js";
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
11
14
  async function trackEvent(request, eventAction, args) {
12
- const flowBuilderPlugin = (0, get_flow_builder_plugin_1.getFlowBuilderPlugin)(request.plugins);
15
+ const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins);
13
16
  if (flowBuilderPlugin.trackEvent) {
14
17
  await flowBuilderPlugin.trackEvent(request, eventAction, args);
15
18
  }
16
19
  return;
17
20
  }
18
21
  async function trackFlowContent(request, contents) {
19
- const flowBuilderPlugin = (0, get_flow_builder_plugin_1.getFlowBuilderPlugin)(request.plugins);
22
+ const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins);
20
23
  const cmsApi = flowBuilderPlugin.cmsApi;
21
- for (const content of contents) {
24
+ for (const content of contents){
22
25
  await trackOneContent(request, content, cmsApi);
23
26
  }
24
27
  }
25
28
  async function trackOneContent(request, content, cmsApi) {
26
29
  if (!cmsApi) {
27
- const flowBuilderPlugin = (0, get_flow_builder_plugin_1.getFlowBuilderPlugin)(request.plugins);
30
+ const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins);
28
31
  cmsApi = flowBuilderPlugin.cmsApi;
29
32
  }
30
33
  const nodeContent = cmsApi.getNodeById(content.id);
31
- if (nodeContent.type !== hubtype_fields_1.HtNodeWithContentType.AI_AGENT) {
34
+ if (nodeContent.type !== HtNodeWithContentType.AI_AGENT) {
32
35
  const event = getContentEventArgs(request, nodeContent);
33
36
  const { action, ...eventArgs } = event;
34
37
  await trackEvent(request, action, eventArgs);
@@ -41,31 +44,34 @@ function getContentEventArgs(request, nodeContent) {
41
44
  const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } = getCommonFlowContentEventArgs(request, nodeContent);
42
45
  setSessionFlowThreadId(request, flowThreadId);
43
46
  return {
44
- action: core_1.EventAction.FlowNode,
47
+ action: EventAction.FlowNode,
45
48
  flowId,
46
49
  flowName,
47
50
  flowNodeId,
48
51
  flowNodeContentId,
49
52
  flowThreadId,
50
- flowNodeIsMeaningful: nodeContent.is_meaningful ?? false,
53
+ flowNodeIsMeaningful: nodeContent.is_meaningful ?? false
51
54
  };
52
55
  }
53
56
  function getCommonFlowContentEventArgs(request, nodeContent) {
54
- const flowBuilderPlugin = (0, get_flow_builder_plugin_1.getFlowBuilderPlugin)(request.plugins);
57
+ const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins);
55
58
  const flowName = flowBuilderPlugin.getFlowName(nodeContent.flow_id);
56
- const flowThreadId = request.session.flow_thread_id ?? (0, uuid_1.v7)();
59
+ const flowThreadId = request.session.flow_thread_id ?? v7();
57
60
  return {
58
61
  flowThreadId,
59
62
  flowId: nodeContent.flow_id,
60
63
  flowName,
61
64
  flowNodeId: nodeContent.id,
62
- flowNodeContentId: nodeContent.code ?? '',
65
+ flowNodeContentId: nodeContent.code ?? ''
63
66
  };
64
67
  }
65
68
  function getCommonFlowContentEventArgsForContentId(botContext, id) {
66
- const flowBuilderPlugin = (0, get_flow_builder_plugin_1.getFlowBuilderPlugin)(botContext.plugins);
69
+ const flowBuilderPlugin = getFlowBuilderPlugin(botContext.plugins);
67
70
  const cmsApi = flowBuilderPlugin.cmsApi;
68
71
  const nodeContent = cmsApi.getNodeById(id);
69
72
  return getCommonFlowContentEventArgs(botContext, nodeContent);
70
73
  }
74
+
75
+ export { getCommonFlowContentEventArgsForContentId, trackEvent, trackFlowContent, trackOneContent };
76
+
71
77
  //# sourceMappingURL=tracking.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tracking.js","sources":["../src/tracking.ts"],"sourcesContent":["import { type BotContext, EventAction, type EventFlow } from '@botonic/core'\nimport type { ActionRequest } from '@botonic/react'\nimport { v7 as uuidv7 } from 'uuid'\n\nimport type { FlowBuilderApi } from './api'\nimport type { FlowContent } from './content-fields'\nimport {\n type HtNodeWithContent,\n HtNodeWithContentType,\n} from './content-fields/hubtype-fields'\nimport { getFlowBuilderPlugin } from './utils/get-flow-builder-plugin'\n\nexport async function trackEvent(\n request: ActionRequest,\n eventAction: EventAction,\n args?: Record<string, any>\n): Promise<void> {\n const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins)\n if (flowBuilderPlugin.trackEvent) {\n await flowBuilderPlugin.trackEvent(request, eventAction, args)\n }\n return\n}\n\nexport async function trackFlowContent(\n request: ActionRequest,\n contents: FlowContent[]\n) {\n const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins)\n const cmsApi = flowBuilderPlugin.cmsApi\n for (const content of contents) {\n await trackOneContent(request, content, cmsApi)\n }\n}\n\nexport async function trackOneContent(\n request: ActionRequest,\n content: FlowContent,\n cmsApi?: FlowBuilderApi\n) {\n if (!cmsApi) {\n const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins)\n cmsApi = flowBuilderPlugin.cmsApi\n }\n\n const nodeContent = cmsApi.getNodeById<HtNodeWithContent>(content.id)\n if (nodeContent.type !== HtNodeWithContentType.AI_AGENT) {\n const event = getContentEventArgs(request, nodeContent)\n const { action, ...eventArgs } = event\n await trackEvent(request, action, eventArgs)\n }\n}\n\nfunction setSessionFlowThreadId(\n request: ActionRequest,\n flowThreadId: string\n): void {\n request.session.flow_thread_id = flowThreadId\n}\n\nfunction getContentEventArgs(\n request: ActionRequest,\n nodeContent: HtNodeWithContent\n): EventFlow {\n const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } =\n getCommonFlowContentEventArgs(request, nodeContent)\n\n setSessionFlowThreadId(request, flowThreadId)\n\n return {\n action: EventAction.FlowNode,\n flowId,\n flowName,\n flowNodeId,\n flowNodeContentId,\n flowThreadId,\n flowNodeIsMeaningful: nodeContent.is_meaningful ?? false,\n }\n}\n\ntype CommonFlowContentEventArgs = {\n flowThreadId: string\n flowId: string\n flowName: string\n flowNodeId: string\n flowNodeContentId: string\n}\n\nfunction getCommonFlowContentEventArgs(\n request: ActionRequest,\n nodeContent: HtNodeWithContent\n): CommonFlowContentEventArgs {\n const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins)\n const flowName = flowBuilderPlugin.getFlowName(nodeContent.flow_id)\n const flowThreadId = request.session.flow_thread_id ?? uuidv7()\n\n return {\n flowThreadId,\n flowId: nodeContent.flow_id,\n flowName,\n flowNodeId: nodeContent.id,\n flowNodeContentId: nodeContent.code ?? '',\n }\n}\n\nexport function getCommonFlowContentEventArgsForContentId(\n botContext: BotContext,\n id: string\n): CommonFlowContentEventArgs {\n const flowBuilderPlugin = getFlowBuilderPlugin(botContext.plugins)\n const cmsApi = flowBuilderPlugin.cmsApi\n const nodeContent = cmsApi.getNodeById<HtNodeWithContent>(id)\n\n return getCommonFlowContentEventArgs(botContext, nodeContent)\n}\n"],"names":["EventAction","v7","uuidv7","HtNodeWithContentType","getFlowBuilderPlugin","trackEvent","request","eventAction","args","flowBuilderPlugin","trackFlowContent","contents","cmsApi","content","trackOneContent","nodeContent","event","getContentEventArgs","action","eventArgs","setSessionFlowThreadId","flowThreadId","flowId","flowName","flowNodeId","flowNodeContentId","getCommonFlowContentEventArgs","getCommonFlowContentEventArgsForContentId","botContext","id"],"mappings":";;;;;;;;;AAA4E;AAEzC;AAOK;AAC8B;AAE/D,eAAeK,UAAUA,CAC9BC,OAAsB,EACtBC,WAAwB,EACxBC,IAA0B;IAE1B,MAAMC,oBAAoBL,oBAAoBA,CAACE,QAAQ,OAAO;IAC9D,IAAIG,kBAAkB,UAAU,EAAE;QAChC,MAAMA,kBAAkB,UAAU,CAACH,SAASC,aAAaC;IAC3D;IACA;AACF;AAEO,eAAeE,gBAAgBA,CACpCJ,OAAsB,EACtBK,QAAuB;IAEvB,MAAMF,oBAAoBL,oBAAoBA,CAACE,QAAQ,OAAO;IAC9D,MAAMM,SAASH,kBAAkB,MAAM;IACvC,KAAK,MAAMI,WAAWF,SAAU;QAC9B,MAAMG,eAAeA,CAACR,SAASO,SAASD;IAC1C;AACF;AAEO,eAAeE,eAAeA,CACnCR,OAAsB,EACtBO,OAAoB,EACpBD,MAAuB;IAEvB,IAAI,CAACA,QAAQ;QACX,MAAMH,oBAAoBL,oBAAoBA,CAACE,QAAQ,OAAO;QAC9DM,SAASH,kBAAkB,MAAM;IACnC;IAEA,MAAMM,cAAcH,OAAO,WAAW,CAAoBC,QAAQ,EAAE;IACpE,IAAIE,YAAY,IAAI,KAAKZ,8BAA8B,EAAE;QACvD,MAAMa,QAAQC,mBAAmBA,CAACX,SAASS;QAC3C,MAAM,EAAEG,MAAM,EAAE,GAAGC,WAAW,GAAGH;QACjC,MAAMX,UAAUA,CAACC,SAASY,QAAQC;IACpC;AACF;AAEA,SAASC,sBAAsBA,CAC7Bd,OAAsB,EACtBe,YAAoB;IAEpBf,QAAQ,OAAO,CAAC,cAAc,GAAGe;AACnC;AAEA,SAASJ,mBAAmBA,CAC1BX,OAAsB,EACtBS,WAA8B;IAE9B,MAAM,EAAEM,YAAY,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,iBAAiB,EAAE,GACrEC,6BAA6BA,CAACpB,SAASS;IAEzCK,sBAAsBA,CAACd,SAASe;IAEhC,OAAO;QACL,QAAQrB,oBAAoB;QAC5BsB;QACAC;QACAC;QACAC;QACAJ;QACA,sBAAsBN,YAAY,aAAa,IAAI;IACrD;AACF;AAUA,SAASW,6BAA6BA,CACpCpB,OAAsB,EACtBS,WAA8B;IAE9B,MAAMN,oBAAoBL,oBAAoBA,CAACE,QAAQ,OAAO;IAC9D,MAAMiB,WAAWd,kBAAkB,WAAW,CAACM,YAAY,OAAO;IAClE,MAAMM,eAAef,QAAQ,OAAO,CAAC,cAAc,IAAIJ,EAAMA;IAE7D,OAAO;QACLmB;QACA,QAAQN,YAAY,OAAO;QAC3BQ;QACA,YAAYR,YAAY,EAAE;QAC1B,mBAAmBA,YAAY,IAAI,IAAI;IACzC;AACF;AAEO,SAASY,yCAAyCA,CACvDC,UAAsB,EACtBC,EAAU;IAEV,MAAMpB,oBAAoBL,oBAAoBA,CAACwB,WAAW,OAAO;IACjE,MAAMhB,SAASH,kBAAkB,MAAM;IACvC,MAAMM,cAAcH,OAAO,WAAW,CAAoBiB;IAE1D,OAAOH,6BAA6BA,CAACE,YAAYb;AACnD"}
@@ -1,7 +1,7 @@
1
- import { AiAgentArgs, type BotContext, GuardrailRule, type InferenceResponse, type PluginPreRequest, type ResolvedPlugins } from '@botonic/core';
2
- import type { FlowContent } from './content-fields';
3
- import type { HtFlowBuilderData, HtRatingButton } from './content-fields/hubtype-fields';
4
- import type { FlowBuilderContentMessage } from './structured-output/flow-builder-content';
1
+ import type { AiAgentArgs, BotContext, GuardrailRule, InferenceResponse, PluginPreRequest, ResolvedPlugins } from '@botonic/core';
2
+ import type { FlowContent } from './content-fields/index.js';
3
+ import type { HtFlowBuilderData, HtRatingButton } from './content-fields/hubtype-fields/index.js';
4
+ import type { FlowBuilderContentMessage } from './structured-output/flow-builder-content.js';
5
5
  export interface InShadowingConfig {
6
6
  allowKeywords: boolean;
7
7
  allowSmartIntents: boolean;
@@ -59,4 +59,4 @@ export interface RatingSubmittedInfo extends HtRatingButton {
59
59
  possibleOptions: string[];
60
60
  possibleValues: number[];
61
61
  }
62
- export { AiAgentArgs, GuardrailRule };
62
+ export type { AiAgentArgs, GuardrailRule };
package/lib/types.js ADDED
@@ -0,0 +1,14 @@
1
+ var types_ProcessEnvNodeEnvs = /*#__PURE__*/ function(ProcessEnvNodeEnvs) {
2
+ ProcessEnvNodeEnvs["PRODUCTION"] = "production";
3
+ ProcessEnvNodeEnvs["DEVELOPMENT"] = "development";
4
+ return ProcessEnvNodeEnvs;
5
+ }({});
6
+ var types_FlowBuilderJSONVersion = /*#__PURE__*/ function(FlowBuilderJSONVersion) {
7
+ FlowBuilderJSONVersion["DRAFT"] = "draft";
8
+ FlowBuilderJSONVersion["LATEST"] = "latest";
9
+ return FlowBuilderJSONVersion;
10
+ }({});
11
+
12
+ export { types_FlowBuilderJSONVersion as FlowBuilderJSONVersion, types_ProcessEnvNodeEnvs as ProcessEnvNodeEnvs };
13
+
14
+ //# sourceMappingURL=types.js.map