@botonic/plugin-flow-builder 0.57.0-rslib-esm.2 → 0.57.1-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (905) hide show
  1. package/README.md +1 -1
  2. package/lib/cjs/action/ai-agent-from-user-input.d.ts +3 -0
  3. package/lib/cjs/action/ai-agent-from-user-input.js +38 -0
  4. package/lib/cjs/action/ai-agent-from-user-input.js.map +1 -0
  5. package/lib/cjs/action/context.d.ts +11 -0
  6. package/lib/cjs/action/context.js +17 -0
  7. package/lib/cjs/action/context.js.map +1 -0
  8. package/lib/cjs/action/fallback.d.ts +3 -0
  9. package/lib/cjs/action/fallback.js +36 -0
  10. package/lib/cjs/action/fallback.js.map +1 -0
  11. package/lib/cjs/action/first-interaction.d.ts +3 -0
  12. package/lib/cjs/action/first-interaction.js +93 -0
  13. package/lib/cjs/action/first-interaction.js.map +1 -0
  14. package/lib/cjs/action/get-contents.d.ts +3 -0
  15. package/lib/cjs/action/get-contents.js +44 -0
  16. package/lib/cjs/action/get-contents.js.map +1 -0
  17. package/lib/cjs/action/index.d.ts +25 -0
  18. package/lib/cjs/action/index.js +95 -0
  19. package/lib/cjs/action/index.js.map +1 -0
  20. package/lib/cjs/action/payload.d.ts +3 -0
  21. package/lib/cjs/action/payload.js +74 -0
  22. package/lib/cjs/action/payload.js.map +1 -0
  23. package/lib/cjs/api.d.ts +45 -0
  24. package/lib/cjs/api.js +227 -0
  25. package/lib/cjs/api.js.map +1 -0
  26. package/lib/cjs/bot-context-manager.d.ts +17 -0
  27. package/lib/cjs/bot-context-manager.js +93 -0
  28. package/lib/cjs/bot-context-manager.js.map +1 -0
  29. package/lib/cjs/constants.d.ts +14 -0
  30. package/lib/cjs/constants.js +20 -0
  31. package/lib/cjs/constants.js.map +1 -0
  32. package/lib/cjs/content-fields/contact-reasons-conditional-matcher.d.ts +4 -0
  33. package/lib/cjs/content-fields/contact-reasons-conditional-matcher.js +12 -0
  34. package/lib/cjs/content-fields/contact-reasons-conditional-matcher.js.map +1 -0
  35. package/lib/cjs/content-fields/content-fields-base.d.ts +20 -0
  36. package/lib/cjs/content-fields/content-fields-base.js +74 -0
  37. package/lib/cjs/content-fields/content-fields-base.js.map +1 -0
  38. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.d.ts +15 -0
  39. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +71 -0
  40. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +1 -0
  41. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.d.ts +9 -0
  42. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.js +58 -0
  43. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +1 -0
  44. package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.d.ts +17 -0
  45. package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.js +79 -0
  46. package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.js.map +1 -0
  47. package/lib/cjs/content-fields/flow-ai-agent-base.d.ts +25 -0
  48. package/lib/cjs/content-fields/flow-ai-agent-base.js +97 -0
  49. package/lib/cjs/content-fields/flow-ai-agent-base.js.map +1 -0
  50. package/lib/cjs/content-fields/flow-ai-agent-router.d.ts +21 -0
  51. package/lib/cjs/content-fields/flow-ai-agent-router.js +126 -0
  52. package/lib/cjs/content-fields/flow-ai-agent-router.js.map +1 -0
  53. package/lib/cjs/content-fields/flow-ai-agent.d.ts +17 -0
  54. package/lib/cjs/content-fields/flow-ai-agent.js +65 -0
  55. package/lib/cjs/content-fields/flow-ai-agent.js.map +1 -0
  56. package/lib/cjs/content-fields/flow-bot-action.d.ts +14 -0
  57. package/lib/cjs/content-fields/flow-bot-action.js +45 -0
  58. package/lib/cjs/content-fields/flow-bot-action.js.map +1 -0
  59. package/lib/cjs/content-fields/flow-button.d.ts +31 -0
  60. package/lib/cjs/content-fields/flow-button.js +86 -0
  61. package/lib/cjs/content-fields/flow-button.js.map +1 -0
  62. package/lib/cjs/content-fields/flow-capture-user-input.d.ts +14 -0
  63. package/lib/cjs/content-fields/flow-capture-user-input.js +45 -0
  64. package/lib/cjs/content-fields/flow-capture-user-input.js.map +1 -0
  65. package/lib/cjs/content-fields/flow-carousel.d.ts +22 -0
  66. package/lib/cjs/content-fields/flow-carousel.js +152 -0
  67. package/lib/cjs/content-fields/flow-carousel.js.map +1 -0
  68. package/lib/cjs/content-fields/flow-channel-conditional.d.ts +14 -0
  69. package/lib/cjs/content-fields/flow-channel-conditional.js +57 -0
  70. package/lib/cjs/content-fields/flow-channel-conditional.js.map +1 -0
  71. package/lib/cjs/content-fields/flow-contact-reasons-conditional.d.ts +17 -0
  72. package/lib/cjs/content-fields/flow-contact-reasons-conditional.js +88 -0
  73. package/lib/cjs/content-fields/flow-contact-reasons-conditional.js.map +1 -0
  74. package/lib/cjs/content-fields/flow-country-conditional.d.ts +13 -0
  75. package/lib/cjs/content-fields/flow-country-conditional.js +59 -0
  76. package/lib/cjs/content-fields/flow-country-conditional.js.map +1 -0
  77. package/lib/cjs/content-fields/flow-custom-conditional.d.ts +17 -0
  78. package/lib/cjs/content-fields/flow-custom-conditional.js +89 -0
  79. package/lib/cjs/content-fields/flow-custom-conditional.js.map +1 -0
  80. package/lib/cjs/content-fields/flow-do-nothing.d.ts +9 -0
  81. package/lib/cjs/content-fields/flow-do-nothing.js +27 -0
  82. package/lib/cjs/content-fields/flow-do-nothing.js.map +1 -0
  83. package/lib/cjs/content-fields/flow-element.d.ts +22 -0
  84. package/lib/cjs/content-fields/flow-element.js +50 -0
  85. package/lib/cjs/content-fields/flow-element.js.map +1 -0
  86. package/lib/cjs/content-fields/flow-go-to-flow.d.ts +13 -0
  87. package/lib/cjs/content-fields/flow-go-to-flow.js +51 -0
  88. package/lib/cjs/content-fields/flow-go-to-flow.js.map +1 -0
  89. package/lib/cjs/content-fields/flow-handoff.d.ts +23 -0
  90. package/lib/cjs/content-fields/flow-handoff.js +104 -0
  91. package/lib/cjs/content-fields/flow-handoff.js.map +1 -0
  92. package/lib/cjs/content-fields/flow-image.d.ts +10 -0
  93. package/lib/cjs/content-fields/flow-image.js +33 -0
  94. package/lib/cjs/content-fields/flow-image.js.map +1 -0
  95. package/lib/cjs/content-fields/flow-queue-status-conditional.d.ts +30 -0
  96. package/lib/cjs/content-fields/flow-queue-status-conditional.js +95 -0
  97. package/lib/cjs/content-fields/flow-queue-status-conditional.js.map +1 -0
  98. package/lib/cjs/content-fields/flow-rating.d.ts +15 -0
  99. package/lib/cjs/content-fields/flow-rating.js +66 -0
  100. package/lib/cjs/content-fields/flow-rating.js.map +1 -0
  101. package/lib/cjs/content-fields/flow-text.d.ts +15 -0
  102. package/lib/cjs/content-fields/flow-text.js +60 -0
  103. package/lib/cjs/content-fields/flow-text.js.map +1 -0
  104. package/lib/cjs/content-fields/flow-video.d.ts +10 -0
  105. package/lib/cjs/content-fields/flow-video.js +33 -0
  106. package/lib/cjs/content-fields/flow-video.js.map +1 -0
  107. package/lib/cjs/content-fields/flow-webview.d.ts +16 -0
  108. package/lib/cjs/content-fields/flow-webview.js +78 -0
  109. package/lib/cjs/content-fields/flow-webview.js.map +1 -0
  110. package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.d.ts +21 -0
  111. package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js +92 -0
  112. package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js.map +1 -0
  113. package/lib/cjs/content-fields/flow-whatsapp-request-contact-info.d.ts +11 -0
  114. package/lib/cjs/content-fields/flow-whatsapp-request-contact-info.js +46 -0
  115. package/lib/cjs/content-fields/flow-whatsapp-request-contact-info.js.map +1 -0
  116. package/lib/cjs/content-fields/flow-whatsapp-template.d.ts +37 -0
  117. package/lib/cjs/content-fields/flow-whatsapp-template.js +264 -0
  118. package/lib/cjs/content-fields/flow-whatsapp-template.js.map +1 -0
  119. package/lib/cjs/content-fields/hubtype-fields/ai-agent-router.d.ts +21 -0
  120. package/lib/cjs/content-fields/hubtype-fields/ai-agent-router.js +3 -0
  121. package/lib/cjs/content-fields/hubtype-fields/ai-agent-router.js.map +1 -0
  122. package/lib/cjs/content-fields/hubtype-fields/ai-agent.d.ts +25 -0
  123. package/lib/cjs/content-fields/hubtype-fields/ai-agent.js +3 -0
  124. package/lib/cjs/content-fields/hubtype-fields/ai-agent.js.map +1 -0
  125. package/lib/cjs/content-fields/hubtype-fields/bot-action.d.ts +10 -0
  126. package/lib/cjs/content-fields/hubtype-fields/bot-action.js +3 -0
  127. package/lib/cjs/content-fields/hubtype-fields/bot-action.js.map +1 -0
  128. package/lib/cjs/content-fields/hubtype-fields/button.d.ts +8 -0
  129. package/lib/cjs/content-fields/hubtype-fields/button.js +3 -0
  130. package/lib/cjs/content-fields/hubtype-fields/button.js.map +1 -0
  131. package/lib/cjs/content-fields/hubtype-fields/capture-user-input.d.ts +19 -0
  132. package/lib/cjs/content-fields/hubtype-fields/capture-user-input.js +12 -0
  133. package/lib/cjs/content-fields/hubtype-fields/capture-user-input.js.map +1 -0
  134. package/lib/cjs/content-fields/hubtype-fields/carousel.d.ts +17 -0
  135. package/lib/cjs/content-fields/hubtype-fields/carousel.js +3 -0
  136. package/lib/cjs/content-fields/hubtype-fields/carousel.js.map +1 -0
  137. package/lib/cjs/content-fields/hubtype-fields/channel-conditional.d.ts +10 -0
  138. package/lib/cjs/content-fields/hubtype-fields/channel-conditional.js +3 -0
  139. package/lib/cjs/content-fields/hubtype-fields/channel-conditional.js.map +1 -0
  140. package/lib/cjs/content-fields/hubtype-fields/common.d.ts +83 -0
  141. package/lib/cjs/content-fields/hubtype-fields/common.js +3 -0
  142. package/lib/cjs/content-fields/hubtype-fields/common.js.map +1 -0
  143. package/lib/cjs/content-fields/hubtype-fields/contact-reasons-conditional.d.ts +19 -0
  144. package/lib/cjs/content-fields/hubtype-fields/contact-reasons-conditional.js +3 -0
  145. package/lib/cjs/content-fields/hubtype-fields/contact-reasons-conditional.js.map +1 -0
  146. package/lib/cjs/content-fields/hubtype-fields/country-conditional.d.ts +10 -0
  147. package/lib/cjs/content-fields/hubtype-fields/country-conditional.js +3 -0
  148. package/lib/cjs/content-fields/hubtype-fields/country-conditional.js.map +1 -0
  149. package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.d.ts +56 -0
  150. package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.js +36 -0
  151. package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.js.map +1 -0
  152. package/lib/cjs/content-fields/hubtype-fields/custom-conditional.d.ts +11 -0
  153. package/lib/cjs/content-fields/hubtype-fields/custom-conditional.js +3 -0
  154. package/lib/cjs/content-fields/hubtype-fields/custom-conditional.js.map +1 -0
  155. package/lib/cjs/content-fields/hubtype-fields/do-nothing.d.ts +6 -0
  156. package/lib/cjs/content-fields/hubtype-fields/do-nothing.js +3 -0
  157. package/lib/cjs/content-fields/hubtype-fields/do-nothing.js.map +1 -0
  158. package/lib/cjs/content-fields/hubtype-fields/fallback.d.ts +9 -0
  159. package/lib/cjs/content-fields/hubtype-fields/fallback.js +3 -0
  160. package/lib/cjs/content-fields/hubtype-fields/fallback.js.map +1 -0
  161. package/lib/cjs/content-fields/hubtype-fields/function.d.ts +30 -0
  162. package/lib/cjs/content-fields/hubtype-fields/function.js +11 -0
  163. package/lib/cjs/content-fields/hubtype-fields/function.js.map +1 -0
  164. package/lib/cjs/content-fields/hubtype-fields/go-to-flow.d.ts +9 -0
  165. package/lib/cjs/content-fields/hubtype-fields/go-to-flow.js +3 -0
  166. package/lib/cjs/content-fields/hubtype-fields/go-to-flow.js.map +1 -0
  167. package/lib/cjs/content-fields/hubtype-fields/handoff.d.ts +21 -0
  168. package/lib/cjs/content-fields/hubtype-fields/handoff.js +10 -0
  169. package/lib/cjs/content-fields/hubtype-fields/handoff.js.map +1 -0
  170. package/lib/cjs/content-fields/hubtype-fields/image.d.ts +8 -0
  171. package/lib/cjs/content-fields/hubtype-fields/image.js +3 -0
  172. package/lib/cjs/content-fields/hubtype-fields/image.js.map +1 -0
  173. package/lib/cjs/content-fields/hubtype-fields/index.d.ts +28 -0
  174. package/lib/cjs/content-fields/hubtype-fields/index.js +32 -0
  175. package/lib/cjs/content-fields/hubtype-fields/index.js.map +1 -0
  176. package/lib/cjs/content-fields/hubtype-fields/keyword.d.ts +9 -0
  177. package/lib/cjs/content-fields/hubtype-fields/keyword.js +3 -0
  178. package/lib/cjs/content-fields/hubtype-fields/keyword.js.map +1 -0
  179. package/lib/cjs/content-fields/hubtype-fields/node-types.d.ts +33 -0
  180. package/lib/cjs/content-fields/hubtype-fields/node-types.js +40 -0
  181. package/lib/cjs/content-fields/hubtype-fields/node-types.js.map +1 -0
  182. package/lib/cjs/content-fields/hubtype-fields/nodes.d.ts +28 -0
  183. package/lib/cjs/content-fields/hubtype-fields/nodes.js +3 -0
  184. package/lib/cjs/content-fields/hubtype-fields/nodes.js.map +1 -0
  185. package/lib/cjs/content-fields/hubtype-fields/payload.d.ts +8 -0
  186. package/lib/cjs/content-fields/hubtype-fields/payload.js +3 -0
  187. package/lib/cjs/content-fields/hubtype-fields/payload.js.map +1 -0
  188. package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.d.ts +25 -0
  189. package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.js +3 -0
  190. package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.js.map +1 -0
  191. package/lib/cjs/content-fields/hubtype-fields/rating.d.ts +23 -0
  192. package/lib/cjs/content-fields/hubtype-fields/rating.js +9 -0
  193. package/lib/cjs/content-fields/hubtype-fields/rating.js.map +1 -0
  194. package/lib/cjs/content-fields/hubtype-fields/smart-intent.d.ts +12 -0
  195. package/lib/cjs/content-fields/hubtype-fields/smart-intent.js +3 -0
  196. package/lib/cjs/content-fields/hubtype-fields/smart-intent.js.map +1 -0
  197. package/lib/cjs/content-fields/hubtype-fields/text.d.ts +11 -0
  198. package/lib/cjs/content-fields/hubtype-fields/text.js +3 -0
  199. package/lib/cjs/content-fields/hubtype-fields/text.js.map +1 -0
  200. package/lib/cjs/content-fields/hubtype-fields/url.d.ts +8 -0
  201. package/lib/cjs/content-fields/hubtype-fields/url.js +3 -0
  202. package/lib/cjs/content-fields/hubtype-fields/url.js.map +1 -0
  203. package/lib/cjs/content-fields/hubtype-fields/video.d.ts +8 -0
  204. package/lib/cjs/content-fields/hubtype-fields/video.js +3 -0
  205. package/lib/cjs/content-fields/hubtype-fields/video.js.map +1 -0
  206. package/lib/cjs/content-fields/hubtype-fields/webview.d.ts +17 -0
  207. package/lib/cjs/content-fields/hubtype-fields/webview.js +3 -0
  208. package/lib/cjs/content-fields/hubtype-fields/webview.js.map +1 -0
  209. package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.d.ts +21 -0
  210. package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.js +3 -0
  211. package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.js.map +1 -0
  212. package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.d.ts +17 -0
  213. package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.js +3 -0
  214. package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +1 -0
  215. package/lib/cjs/content-fields/hubtype-fields/whatsapp-request-contact-info.d.ts +10 -0
  216. package/lib/cjs/content-fields/hubtype-fields/whatsapp-request-contact-info.js +3 -0
  217. package/lib/cjs/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +1 -0
  218. package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.d.ts +96 -0
  219. package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.js +9 -0
  220. package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.js.map +1 -0
  221. package/lib/cjs/content-fields/index.d.ts +27 -0
  222. package/lib/cjs/content-fields/index.js +56 -0
  223. package/lib/cjs/content-fields/index.js.map +1 -0
  224. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +14 -0
  225. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +41 -0
  226. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +1 -0
  227. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +13 -0
  228. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +36 -0
  229. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +1 -0
  230. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +14 -0
  231. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +46 -0
  232. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +1 -0
  233. package/lib/cjs/content-fields/whatsapp-button-list/index.d.ts +3 -0
  234. package/lib/cjs/content-fields/whatsapp-button-list/index.js +10 -0
  235. package/lib/cjs/content-fields/whatsapp-button-list/index.js.map +1 -0
  236. package/lib/cjs/filters/index.d.ts +12 -0
  237. package/lib/cjs/filters/index.js +17 -0
  238. package/lib/cjs/filters/index.js.map +1 -0
  239. package/lib/cjs/flow-factory.d.ts +12 -0
  240. package/lib/cjs/flow-factory.js +73 -0
  241. package/lib/cjs/flow-factory.js.map +1 -0
  242. package/lib/cjs/functions/index.d.ts +11 -0
  243. package/lib/cjs/functions/index.js +49 -0
  244. package/lib/cjs/functions/index.js.map +1 -0
  245. package/lib/cjs/index.d.ts +42 -0
  246. package/lib/cjs/index.js +142 -0
  247. package/lib/cjs/index.js.map +1 -0
  248. package/lib/cjs/services/hubtype-queues-api.js +26 -0
  249. package/lib/cjs/services/hubtype-queues-api.js.map +1 -0
  250. package/lib/cjs/structured-output/flow-builder-content.js +15 -0
  251. package/lib/cjs/structured-output/flow-builder-content.js.map +1 -0
  252. package/lib/cjs/tracking.d.ts +16 -0
  253. package/lib/cjs/tracking.js +71 -0
  254. package/lib/cjs/tracking.js.map +1 -0
  255. package/lib/cjs/types.d.ts +62 -0
  256. package/lib/cjs/types.js +14 -0
  257. package/lib/cjs/types.js.map +1 -0
  258. package/lib/cjs/user-input/capture-user-input-api.d.ts +21 -0
  259. package/lib/cjs/user-input/capture-user-input-api.js +88 -0
  260. package/lib/cjs/user-input/capture-user-input-api.js.map +1 -0
  261. package/lib/cjs/user-input/index.d.ts +4 -0
  262. package/lib/cjs/user-input/index.js +37 -0
  263. package/lib/cjs/user-input/index.js.map +1 -0
  264. package/lib/cjs/user-input/keyword.d.ts +27 -0
  265. package/lib/cjs/user-input/keyword.js +84 -0
  266. package/lib/cjs/user-input/keyword.js.map +1 -0
  267. package/lib/cjs/user-input/smart-intent.d.ts +24 -0
  268. package/lib/cjs/user-input/smart-intent.js +89 -0
  269. package/lib/cjs/user-input/smart-intent.js.map +1 -0
  270. package/lib/cjs/utils/ai-agent.d.ts +11 -0
  271. package/lib/cjs/utils/ai-agent.js +28 -0
  272. package/lib/cjs/utils/ai-agent.js.map +1 -0
  273. package/lib/cjs/utils/authentication.js +21 -0
  274. package/lib/cjs/utils/authentication.js.map +1 -0
  275. package/lib/cjs/utils/flow-locale.js +79 -0
  276. package/lib/cjs/utils/flow-locale.js.map +1 -0
  277. package/lib/cjs/utils/get-flow-builder-plugin.d.ts +3 -0
  278. package/lib/cjs/utils/get-flow-builder-plugin.js +16 -0
  279. package/lib/cjs/utils/get-flow-builder-plugin.js.map +1 -0
  280. package/lib/cjs/utils/hubtype-assistant-content.d.ts +13 -0
  281. package/lib/cjs/utils/hubtype-assistant-content.js +184 -0
  282. package/lib/cjs/utils/hubtype-assistant-content.js.map +1 -0
  283. package/lib/cjs/utils/input.js +35 -0
  284. package/lib/cjs/utils/input.js.map +1 -0
  285. package/lib/cjs/webview/contents-context.d.ts +2 -0
  286. package/lib/cjs/webview/contents-context.js +12 -0
  287. package/lib/cjs/webview/contents-context.js.map +1 -0
  288. package/lib/cjs/webview/index.d.ts +3 -0
  289. package/lib/cjs/webview/index.js +10 -0
  290. package/lib/cjs/webview/index.js.map +1 -0
  291. package/lib/cjs/webview/types.d.ts +47 -0
  292. package/lib/cjs/webview/types.js +9 -0
  293. package/lib/cjs/webview/types.js.map +1 -0
  294. package/lib/cjs/webview/use-webview-contents.d.ts +2 -0
  295. package/lib/cjs/webview/use-webview-contents.js +83 -0
  296. package/lib/cjs/webview/use-webview-contents.js.map +1 -0
  297. package/lib/esm/action/ai-agent-from-user-input.d.ts +3 -0
  298. package/lib/esm/action/ai-agent-from-user-input.js +38 -0
  299. package/lib/esm/action/ai-agent-from-user-input.js.map +1 -0
  300. package/lib/esm/action/context.d.ts +11 -0
  301. package/lib/esm/action/context.js +17 -0
  302. package/lib/esm/action/context.js.map +1 -0
  303. package/lib/esm/action/fallback.d.ts +3 -0
  304. package/lib/esm/action/fallback.js +36 -0
  305. package/lib/esm/action/fallback.js.map +1 -0
  306. package/lib/esm/action/first-interaction.d.ts +3 -0
  307. package/lib/esm/action/first-interaction.js +93 -0
  308. package/lib/esm/action/first-interaction.js.map +1 -0
  309. package/lib/esm/action/get-contents.d.ts +3 -0
  310. package/lib/esm/action/get-contents.js +44 -0
  311. package/lib/esm/action/get-contents.js.map +1 -0
  312. package/lib/esm/action/index.d.ts +25 -0
  313. package/lib/esm/action/index.js +95 -0
  314. package/lib/esm/action/index.js.map +1 -0
  315. package/lib/esm/action/payload.d.ts +3 -0
  316. package/lib/esm/action/payload.js +74 -0
  317. package/lib/esm/action/payload.js.map +1 -0
  318. package/lib/esm/api.d.ts +45 -0
  319. package/lib/esm/api.js +227 -0
  320. package/lib/esm/api.js.map +1 -0
  321. package/lib/esm/bot-context-manager.d.ts +17 -0
  322. package/lib/esm/bot-context-manager.js +93 -0
  323. package/lib/esm/bot-context-manager.js.map +1 -0
  324. package/lib/esm/constants.d.ts +14 -0
  325. package/lib/esm/constants.js +20 -0
  326. package/lib/esm/constants.js.map +1 -0
  327. package/lib/esm/content-fields/contact-reasons-conditional-matcher.d.ts +4 -0
  328. package/lib/esm/content-fields/contact-reasons-conditional-matcher.js +12 -0
  329. package/lib/esm/content-fields/contact-reasons-conditional-matcher.js.map +1 -0
  330. package/lib/esm/content-fields/content-fields-base.d.ts +20 -0
  331. package/lib/esm/content-fields/content-fields-base.js +74 -0
  332. package/lib/esm/content-fields/content-fields-base.js.map +1 -0
  333. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.d.ts +15 -0
  334. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +71 -0
  335. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +1 -0
  336. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.d.ts +9 -0
  337. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.js +58 -0
  338. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +1 -0
  339. package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.d.ts +17 -0
  340. package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.js +79 -0
  341. package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.js.map +1 -0
  342. package/lib/esm/content-fields/flow-ai-agent-base.d.ts +25 -0
  343. package/lib/esm/content-fields/flow-ai-agent-base.js +97 -0
  344. package/lib/esm/content-fields/flow-ai-agent-base.js.map +1 -0
  345. package/lib/esm/content-fields/flow-ai-agent-router.d.ts +21 -0
  346. package/lib/esm/content-fields/flow-ai-agent-router.js +126 -0
  347. package/lib/esm/content-fields/flow-ai-agent-router.js.map +1 -0
  348. package/lib/esm/content-fields/flow-ai-agent.d.ts +17 -0
  349. package/lib/esm/content-fields/flow-ai-agent.js +65 -0
  350. package/lib/esm/content-fields/flow-ai-agent.js.map +1 -0
  351. package/lib/esm/content-fields/flow-bot-action.d.ts +14 -0
  352. package/lib/esm/content-fields/flow-bot-action.js +45 -0
  353. package/lib/esm/content-fields/flow-bot-action.js.map +1 -0
  354. package/lib/esm/content-fields/flow-button.d.ts +31 -0
  355. package/lib/esm/content-fields/flow-button.js +86 -0
  356. package/lib/esm/content-fields/flow-button.js.map +1 -0
  357. package/lib/esm/content-fields/flow-capture-user-input.d.ts +14 -0
  358. package/lib/esm/content-fields/flow-capture-user-input.js +45 -0
  359. package/lib/esm/content-fields/flow-capture-user-input.js.map +1 -0
  360. package/lib/esm/content-fields/flow-carousel.d.ts +22 -0
  361. package/lib/esm/content-fields/flow-carousel.js +152 -0
  362. package/lib/esm/content-fields/flow-carousel.js.map +1 -0
  363. package/lib/esm/content-fields/flow-channel-conditional.d.ts +14 -0
  364. package/lib/esm/content-fields/flow-channel-conditional.js +57 -0
  365. package/lib/esm/content-fields/flow-channel-conditional.js.map +1 -0
  366. package/lib/esm/content-fields/flow-contact-reasons-conditional.d.ts +17 -0
  367. package/lib/esm/content-fields/flow-contact-reasons-conditional.js +88 -0
  368. package/lib/esm/content-fields/flow-contact-reasons-conditional.js.map +1 -0
  369. package/lib/esm/content-fields/flow-country-conditional.d.ts +13 -0
  370. package/lib/esm/content-fields/flow-country-conditional.js +59 -0
  371. package/lib/esm/content-fields/flow-country-conditional.js.map +1 -0
  372. package/lib/esm/content-fields/flow-custom-conditional.d.ts +17 -0
  373. package/lib/esm/content-fields/flow-custom-conditional.js +89 -0
  374. package/lib/esm/content-fields/flow-custom-conditional.js.map +1 -0
  375. package/lib/esm/content-fields/flow-do-nothing.d.ts +9 -0
  376. package/lib/esm/content-fields/flow-do-nothing.js +27 -0
  377. package/lib/esm/content-fields/flow-do-nothing.js.map +1 -0
  378. package/lib/esm/content-fields/flow-element.d.ts +22 -0
  379. package/lib/esm/content-fields/flow-element.js +50 -0
  380. package/lib/esm/content-fields/flow-element.js.map +1 -0
  381. package/lib/esm/content-fields/flow-go-to-flow.d.ts +13 -0
  382. package/lib/esm/content-fields/flow-go-to-flow.js +51 -0
  383. package/lib/esm/content-fields/flow-go-to-flow.js.map +1 -0
  384. package/lib/esm/content-fields/flow-handoff.d.ts +23 -0
  385. package/lib/esm/content-fields/flow-handoff.js +104 -0
  386. package/lib/esm/content-fields/flow-handoff.js.map +1 -0
  387. package/lib/esm/content-fields/flow-image.d.ts +10 -0
  388. package/lib/esm/content-fields/flow-image.js +33 -0
  389. package/lib/esm/content-fields/flow-image.js.map +1 -0
  390. package/lib/esm/content-fields/flow-queue-status-conditional.d.ts +30 -0
  391. package/lib/esm/content-fields/flow-queue-status-conditional.js +95 -0
  392. package/lib/esm/content-fields/flow-queue-status-conditional.js.map +1 -0
  393. package/lib/esm/content-fields/flow-rating.d.ts +15 -0
  394. package/lib/esm/content-fields/flow-rating.js +66 -0
  395. package/lib/esm/content-fields/flow-rating.js.map +1 -0
  396. package/lib/esm/content-fields/flow-text.d.ts +15 -0
  397. package/lib/esm/content-fields/flow-text.js +60 -0
  398. package/lib/esm/content-fields/flow-text.js.map +1 -0
  399. package/lib/esm/content-fields/flow-video.d.ts +10 -0
  400. package/lib/esm/content-fields/flow-video.js +33 -0
  401. package/lib/esm/content-fields/flow-video.js.map +1 -0
  402. package/lib/esm/content-fields/flow-webview.d.ts +16 -0
  403. package/lib/esm/content-fields/flow-webview.js +78 -0
  404. package/lib/esm/content-fields/flow-webview.js.map +1 -0
  405. package/lib/esm/content-fields/flow-whatsapp-cta-url-button.d.ts +21 -0
  406. package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js +92 -0
  407. package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js.map +1 -0
  408. package/lib/esm/content-fields/flow-whatsapp-request-contact-info.d.ts +11 -0
  409. package/lib/esm/content-fields/flow-whatsapp-request-contact-info.js +46 -0
  410. package/lib/esm/content-fields/flow-whatsapp-request-contact-info.js.map +1 -0
  411. package/lib/esm/content-fields/flow-whatsapp-template.d.ts +37 -0
  412. package/lib/esm/content-fields/flow-whatsapp-template.js +264 -0
  413. package/lib/esm/content-fields/flow-whatsapp-template.js.map +1 -0
  414. package/lib/esm/content-fields/hubtype-fields/ai-agent-router.d.ts +21 -0
  415. package/lib/esm/content-fields/hubtype-fields/ai-agent-router.js +3 -0
  416. package/lib/esm/content-fields/hubtype-fields/ai-agent-router.js.map +1 -0
  417. package/lib/esm/content-fields/hubtype-fields/ai-agent.d.ts +25 -0
  418. package/lib/esm/content-fields/hubtype-fields/ai-agent.js +3 -0
  419. package/lib/esm/content-fields/hubtype-fields/ai-agent.js.map +1 -0
  420. package/lib/esm/content-fields/hubtype-fields/bot-action.d.ts +10 -0
  421. package/lib/esm/content-fields/hubtype-fields/bot-action.js +3 -0
  422. package/lib/esm/content-fields/hubtype-fields/bot-action.js.map +1 -0
  423. package/lib/esm/content-fields/hubtype-fields/button.d.ts +8 -0
  424. package/lib/esm/content-fields/hubtype-fields/button.js +3 -0
  425. package/lib/esm/content-fields/hubtype-fields/button.js.map +1 -0
  426. package/lib/esm/content-fields/hubtype-fields/capture-user-input.d.ts +19 -0
  427. package/lib/esm/content-fields/hubtype-fields/capture-user-input.js +12 -0
  428. package/lib/esm/content-fields/hubtype-fields/capture-user-input.js.map +1 -0
  429. package/lib/esm/content-fields/hubtype-fields/carousel.d.ts +17 -0
  430. package/lib/esm/content-fields/hubtype-fields/carousel.js +3 -0
  431. package/lib/esm/content-fields/hubtype-fields/carousel.js.map +1 -0
  432. package/lib/esm/content-fields/hubtype-fields/channel-conditional.d.ts +10 -0
  433. package/lib/esm/content-fields/hubtype-fields/channel-conditional.js +3 -0
  434. package/lib/esm/content-fields/hubtype-fields/channel-conditional.js.map +1 -0
  435. package/lib/esm/content-fields/hubtype-fields/common.d.ts +83 -0
  436. package/lib/esm/content-fields/hubtype-fields/common.js +3 -0
  437. package/lib/esm/content-fields/hubtype-fields/common.js.map +1 -0
  438. package/lib/esm/content-fields/hubtype-fields/contact-reasons-conditional.d.ts +19 -0
  439. package/lib/esm/content-fields/hubtype-fields/contact-reasons-conditional.js +3 -0
  440. package/lib/esm/content-fields/hubtype-fields/contact-reasons-conditional.js.map +1 -0
  441. package/lib/esm/content-fields/hubtype-fields/country-conditional.d.ts +10 -0
  442. package/lib/esm/content-fields/hubtype-fields/country-conditional.js +3 -0
  443. package/lib/esm/content-fields/hubtype-fields/country-conditional.js.map +1 -0
  444. package/lib/esm/content-fields/hubtype-fields/custom-conditional-v2.d.ts +56 -0
  445. package/lib/esm/content-fields/hubtype-fields/custom-conditional-v2.js +36 -0
  446. package/lib/esm/content-fields/hubtype-fields/custom-conditional-v2.js.map +1 -0
  447. package/lib/esm/content-fields/hubtype-fields/custom-conditional.d.ts +11 -0
  448. package/lib/esm/content-fields/hubtype-fields/custom-conditional.js +3 -0
  449. package/lib/esm/content-fields/hubtype-fields/custom-conditional.js.map +1 -0
  450. package/lib/esm/content-fields/hubtype-fields/do-nothing.d.ts +6 -0
  451. package/lib/esm/content-fields/hubtype-fields/do-nothing.js +3 -0
  452. package/lib/esm/content-fields/hubtype-fields/do-nothing.js.map +1 -0
  453. package/lib/esm/content-fields/hubtype-fields/fallback.d.ts +9 -0
  454. package/lib/esm/content-fields/hubtype-fields/fallback.js +3 -0
  455. package/lib/esm/content-fields/hubtype-fields/fallback.js.map +1 -0
  456. package/lib/esm/content-fields/hubtype-fields/function.d.ts +30 -0
  457. package/lib/esm/content-fields/hubtype-fields/function.js +11 -0
  458. package/lib/esm/content-fields/hubtype-fields/function.js.map +1 -0
  459. package/lib/esm/content-fields/hubtype-fields/go-to-flow.d.ts +9 -0
  460. package/lib/esm/content-fields/hubtype-fields/go-to-flow.js +3 -0
  461. package/lib/esm/content-fields/hubtype-fields/go-to-flow.js.map +1 -0
  462. package/lib/esm/content-fields/hubtype-fields/handoff.d.ts +21 -0
  463. package/lib/esm/content-fields/hubtype-fields/handoff.js +10 -0
  464. package/lib/esm/content-fields/hubtype-fields/handoff.js.map +1 -0
  465. package/lib/esm/content-fields/hubtype-fields/image.d.ts +8 -0
  466. package/lib/esm/content-fields/hubtype-fields/image.js +3 -0
  467. package/lib/esm/content-fields/hubtype-fields/image.js.map +1 -0
  468. package/lib/esm/content-fields/hubtype-fields/index.d.ts +28 -0
  469. package/lib/esm/content-fields/hubtype-fields/index.js +32 -0
  470. package/lib/esm/content-fields/hubtype-fields/index.js.map +1 -0
  471. package/lib/esm/content-fields/hubtype-fields/keyword.d.ts +9 -0
  472. package/lib/esm/content-fields/hubtype-fields/keyword.js +3 -0
  473. package/lib/esm/content-fields/hubtype-fields/keyword.js.map +1 -0
  474. package/lib/esm/content-fields/hubtype-fields/node-types.d.ts +33 -0
  475. package/lib/esm/content-fields/hubtype-fields/node-types.js +40 -0
  476. package/lib/esm/content-fields/hubtype-fields/node-types.js.map +1 -0
  477. package/lib/esm/content-fields/hubtype-fields/nodes.d.ts +28 -0
  478. package/lib/esm/content-fields/hubtype-fields/nodes.js +3 -0
  479. package/lib/esm/content-fields/hubtype-fields/nodes.js.map +1 -0
  480. package/lib/esm/content-fields/hubtype-fields/payload.d.ts +8 -0
  481. package/lib/esm/content-fields/hubtype-fields/payload.js +3 -0
  482. package/lib/esm/content-fields/hubtype-fields/payload.js.map +1 -0
  483. package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.d.ts +25 -0
  484. package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.js +3 -0
  485. package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.js.map +1 -0
  486. package/lib/esm/content-fields/hubtype-fields/rating.d.ts +23 -0
  487. package/lib/esm/content-fields/hubtype-fields/rating.js +9 -0
  488. package/lib/esm/content-fields/hubtype-fields/rating.js.map +1 -0
  489. package/lib/esm/content-fields/hubtype-fields/smart-intent.d.ts +12 -0
  490. package/lib/esm/content-fields/hubtype-fields/smart-intent.js +3 -0
  491. package/lib/esm/content-fields/hubtype-fields/smart-intent.js.map +1 -0
  492. package/lib/esm/content-fields/hubtype-fields/text.d.ts +11 -0
  493. package/lib/esm/content-fields/hubtype-fields/text.js +3 -0
  494. package/lib/esm/content-fields/hubtype-fields/text.js.map +1 -0
  495. package/lib/esm/content-fields/hubtype-fields/url.d.ts +8 -0
  496. package/lib/esm/content-fields/hubtype-fields/url.js +3 -0
  497. package/lib/esm/content-fields/hubtype-fields/url.js.map +1 -0
  498. package/lib/esm/content-fields/hubtype-fields/video.d.ts +8 -0
  499. package/lib/esm/content-fields/hubtype-fields/video.js +3 -0
  500. package/lib/esm/content-fields/hubtype-fields/video.js.map +1 -0
  501. package/lib/esm/content-fields/hubtype-fields/webview.d.ts +17 -0
  502. package/lib/esm/content-fields/hubtype-fields/webview.js +3 -0
  503. package/lib/esm/content-fields/hubtype-fields/webview.js.map +1 -0
  504. package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.d.ts +21 -0
  505. package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.js +3 -0
  506. package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.js.map +1 -0
  507. package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.d.ts +17 -0
  508. package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.js +3 -0
  509. package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +1 -0
  510. package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.d.ts +10 -0
  511. package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.js +3 -0
  512. package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +1 -0
  513. package/lib/esm/content-fields/hubtype-fields/whatsapp-template.d.ts +96 -0
  514. package/lib/esm/content-fields/hubtype-fields/whatsapp-template.js +9 -0
  515. package/lib/esm/content-fields/hubtype-fields/whatsapp-template.js.map +1 -0
  516. package/lib/esm/content-fields/index.d.ts +27 -0
  517. package/lib/esm/content-fields/index.js +56 -0
  518. package/lib/esm/content-fields/index.js.map +1 -0
  519. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +14 -0
  520. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +41 -0
  521. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +1 -0
  522. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +13 -0
  523. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +36 -0
  524. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +1 -0
  525. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +14 -0
  526. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +46 -0
  527. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +1 -0
  528. package/lib/esm/content-fields/whatsapp-button-list/index.d.ts +3 -0
  529. package/lib/esm/content-fields/whatsapp-button-list/index.js +10 -0
  530. package/lib/esm/content-fields/whatsapp-button-list/index.js.map +1 -0
  531. package/lib/esm/filters/index.d.ts +12 -0
  532. package/lib/esm/filters/index.js +17 -0
  533. package/lib/esm/filters/index.js.map +1 -0
  534. package/lib/esm/flow-factory.d.ts +12 -0
  535. package/lib/esm/flow-factory.js +73 -0
  536. package/lib/esm/flow-factory.js.map +1 -0
  537. package/lib/esm/functions/index.d.ts +11 -0
  538. package/lib/esm/functions/index.js +49 -0
  539. package/lib/esm/functions/index.js.map +1 -0
  540. package/lib/esm/index.d.ts +42 -0
  541. package/lib/esm/index.js +142 -0
  542. package/lib/esm/index.js.map +1 -0
  543. package/lib/esm/services/hubtype-queues-api.d.ts +14 -0
  544. package/lib/esm/services/hubtype-queues-api.js +26 -0
  545. package/lib/esm/services/hubtype-queues-api.js.map +1 -0
  546. package/lib/esm/structured-output/flow-builder-content.d.ts +13 -0
  547. package/lib/esm/structured-output/flow-builder-content.js +15 -0
  548. package/lib/esm/structured-output/flow-builder-content.js.map +1 -0
  549. package/lib/esm/tracking.d.ts +16 -0
  550. package/lib/esm/tracking.js +71 -0
  551. package/lib/esm/tracking.js.map +1 -0
  552. package/lib/esm/types.d.ts +62 -0
  553. package/lib/esm/types.js +14 -0
  554. package/lib/esm/types.js.map +1 -0
  555. package/lib/esm/user-input/capture-user-input-api.d.ts +21 -0
  556. package/lib/esm/user-input/capture-user-input-api.js +88 -0
  557. package/lib/esm/user-input/capture-user-input-api.js.map +1 -0
  558. package/lib/esm/user-input/index.d.ts +4 -0
  559. package/lib/esm/user-input/index.js +37 -0
  560. package/lib/esm/user-input/index.js.map +1 -0
  561. package/lib/esm/user-input/keyword.d.ts +27 -0
  562. package/lib/esm/user-input/keyword.js +84 -0
  563. package/lib/esm/user-input/keyword.js.map +1 -0
  564. package/lib/esm/user-input/smart-intent.d.ts +24 -0
  565. package/lib/esm/user-input/smart-intent.js +89 -0
  566. package/lib/esm/user-input/smart-intent.js.map +1 -0
  567. package/lib/esm/utils/ai-agent.d.ts +11 -0
  568. package/lib/esm/utils/ai-agent.js +28 -0
  569. package/lib/esm/utils/ai-agent.js.map +1 -0
  570. package/lib/esm/utils/authentication.d.ts +2 -0
  571. package/lib/esm/utils/authentication.js +21 -0
  572. package/lib/esm/utils/authentication.js.map +1 -0
  573. package/lib/esm/utils/flow-locale.d.ts +22 -0
  574. package/lib/esm/utils/flow-locale.js +79 -0
  575. package/lib/esm/utils/flow-locale.js.map +1 -0
  576. package/lib/esm/utils/get-flow-builder-plugin.d.ts +3 -0
  577. package/lib/esm/utils/get-flow-builder-plugin.js +16 -0
  578. package/lib/esm/utils/get-flow-builder-plugin.js.map +1 -0
  579. package/lib/esm/utils/hubtype-assistant-content.d.ts +13 -0
  580. package/lib/esm/utils/hubtype-assistant-content.js +184 -0
  581. package/lib/esm/utils/hubtype-assistant-content.js.map +1 -0
  582. package/lib/esm/utils/input.d.ts +6 -0
  583. package/lib/esm/utils/input.js +35 -0
  584. package/lib/esm/utils/input.js.map +1 -0
  585. package/lib/esm/webview/contents-context.d.ts +2 -0
  586. package/lib/esm/webview/contents-context.js +12 -0
  587. package/lib/esm/webview/contents-context.js.map +1 -0
  588. package/lib/esm/webview/index.d.ts +3 -0
  589. package/lib/esm/webview/index.js +10 -0
  590. package/lib/esm/webview/index.js.map +1 -0
  591. package/lib/esm/webview/types.d.ts +47 -0
  592. package/lib/esm/webview/types.js +9 -0
  593. package/lib/esm/webview/types.js.map +1 -0
  594. package/lib/esm/webview/use-webview-contents.d.ts +2 -0
  595. package/lib/esm/webview/use-webview-contents.js +83 -0
  596. package/lib/esm/webview/use-webview-contents.js.map +1 -0
  597. package/package.json +10 -12
  598. package/src/action/ai-agent-from-user-input.ts +7 -0
  599. package/src/action/first-interaction.ts +6 -0
  600. package/src/action/get-contents.ts +17 -2
  601. package/src/action/index.tsx +7 -0
  602. package/src/api.ts +52 -15
  603. package/src/bot-context-manager.ts +153 -0
  604. package/src/constants.ts +2 -1
  605. package/src/content-fields/contact-reasons-conditional-matcher.ts +24 -0
  606. package/src/content-fields/flow-ai-agent-base.tsx +1 -1
  607. package/src/content-fields/flow-ai-agent-router.tsx +1 -0
  608. package/src/content-fields/flow-ai-agent.tsx +1 -0
  609. package/src/content-fields/flow-contact-reasons-conditional.tsx +119 -0
  610. package/src/content-fields/flow-do-nothing.tsx +29 -0
  611. package/src/content-fields/flow-handoff.tsx +54 -7
  612. package/src/content-fields/flow-whatsapp-request-contact-info.tsx +2 -0
  613. package/src/content-fields/hubtype-fields/contact-reasons-conditional.ts +21 -0
  614. package/src/content-fields/hubtype-fields/do-nothing.ts +7 -0
  615. package/src/content-fields/hubtype-fields/handoff.ts +17 -1
  616. package/src/content-fields/hubtype-fields/index.ts +1 -0
  617. package/src/content-fields/hubtype-fields/node-types.ts +2 -0
  618. package/src/content-fields/hubtype-fields/nodes.ts +4 -0
  619. package/src/content-fields/hubtype-fields/whatsapp-request-contact-info.ts +2 -0
  620. package/src/content-fields/index.ts +6 -0
  621. package/src/flow-factory.ts +11 -0
  622. package/src/index.ts +26 -88
  623. package/src/types.ts +1 -2
  624. package/lib/action/ai-agent-from-user-input.d.ts +0 -3
  625. package/lib/action/ai-agent-from-user-input.js +0 -35
  626. package/lib/action/ai-agent-from-user-input.js.map +0 -1
  627. package/lib/action/context.d.ts +0 -11
  628. package/lib/action/context.js +0 -20
  629. package/lib/action/context.js.map +0 -1
  630. package/lib/action/fallback.d.ts +0 -3
  631. package/lib/action/fallback.js +0 -41
  632. package/lib/action/fallback.js.map +0 -1
  633. package/lib/action/first-interaction.d.ts +0 -3
  634. package/lib/action/first-interaction.js +0 -100
  635. package/lib/action/first-interaction.js.map +0 -1
  636. package/lib/action/get-contents.d.ts +0 -3
  637. package/lib/action/get-contents.js +0 -56
  638. package/lib/action/get-contents.js.map +0 -1
  639. package/lib/action/index.d.ts +0 -25
  640. package/lib/action/index.js +0 -126
  641. package/lib/action/index.js.map +0 -1
  642. package/lib/action/payload.d.ts +0 -3
  643. package/lib/action/payload.js +0 -78
  644. package/lib/action/payload.js.map +0 -1
  645. package/lib/api.d.ts +0 -40
  646. package/lib/api.js +0 -216
  647. package/lib/api.js.map +0 -1
  648. package/lib/constants.d.ts +0 -13
  649. package/lib/constants.js +0 -17
  650. package/lib/constants.js.map +0 -1
  651. package/lib/content-fields/content-fields-base.d.ts +0 -20
  652. package/lib/content-fields/content-fields-base.js +0 -78
  653. package/lib/content-fields/content-fields-base.js.map +0 -1
  654. package/lib/content-fields/custom-conditional/custom-conditional-v2-evaluators.d.ts +0 -15
  655. package/lib/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +0 -73
  656. package/lib/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +0 -1
  657. package/lib/content-fields/custom-conditional/custom-conditional-v2-resolver.d.ts +0 -9
  658. package/lib/content-fields/custom-conditional/custom-conditional-v2-resolver.js +0 -58
  659. package/lib/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +0 -1
  660. package/lib/content-fields/custom-conditional/flow-custom-condition-v2.d.ts +0 -17
  661. package/lib/content-fields/custom-conditional/flow-custom-condition-v2.js +0 -94
  662. package/lib/content-fields/custom-conditional/flow-custom-condition-v2.js.map +0 -1
  663. package/lib/content-fields/flow-ai-agent-base.d.ts +0 -25
  664. package/lib/content-fields/flow-ai-agent-base.js +0 -106
  665. package/lib/content-fields/flow-ai-agent-base.js.map +0 -1
  666. package/lib/content-fields/flow-ai-agent-router.d.ts +0 -21
  667. package/lib/content-fields/flow-ai-agent-router.js +0 -136
  668. package/lib/content-fields/flow-ai-agent-router.js.map +0 -1
  669. package/lib/content-fields/flow-ai-agent.d.ts +0 -17
  670. package/lib/content-fields/flow-ai-agent.js +0 -75
  671. package/lib/content-fields/flow-ai-agent.js.map +0 -1
  672. package/lib/content-fields/flow-bot-action.d.ts +0 -14
  673. package/lib/content-fields/flow-bot-action.js +0 -53
  674. package/lib/content-fields/flow-bot-action.js.map +0 -1
  675. package/lib/content-fields/flow-button.d.ts +0 -31
  676. package/lib/content-fields/flow-button.js +0 -105
  677. package/lib/content-fields/flow-button.js.map +0 -1
  678. package/lib/content-fields/flow-capture-user-input.d.ts +0 -14
  679. package/lib/content-fields/flow-capture-user-input.js +0 -46
  680. package/lib/content-fields/flow-capture-user-input.js.map +0 -1
  681. package/lib/content-fields/flow-carousel.d.ts +0 -22
  682. package/lib/content-fields/flow-carousel.js +0 -193
  683. package/lib/content-fields/flow-carousel.js.map +0 -1
  684. package/lib/content-fields/flow-channel-conditional.d.ts +0 -14
  685. package/lib/content-fields/flow-channel-conditional.js +0 -61
  686. package/lib/content-fields/flow-channel-conditional.js.map +0 -1
  687. package/lib/content-fields/flow-country-conditional.d.ts +0 -13
  688. package/lib/content-fields/flow-country-conditional.js +0 -64
  689. package/lib/content-fields/flow-country-conditional.js.map +0 -1
  690. package/lib/content-fields/flow-custom-conditional.d.ts +0 -17
  691. package/lib/content-fields/flow-custom-conditional.js +0 -87
  692. package/lib/content-fields/flow-custom-conditional.js.map +0 -1
  693. package/lib/content-fields/flow-element.d.ts +0 -22
  694. package/lib/content-fields/flow-element.js +0 -67
  695. package/lib/content-fields/flow-element.js.map +0 -1
  696. package/lib/content-fields/flow-go-to-flow.d.ts +0 -13
  697. package/lib/content-fields/flow-go-to-flow.js +0 -56
  698. package/lib/content-fields/flow-go-to-flow.js.map +0 -1
  699. package/lib/content-fields/flow-handoff.d.ts +0 -17
  700. package/lib/content-fields/flow-handoff.js +0 -79
  701. package/lib/content-fields/flow-handoff.js.map +0 -1
  702. package/lib/content-fields/flow-image.d.ts +0 -10
  703. package/lib/content-fields/flow-image.js +0 -42
  704. package/lib/content-fields/flow-image.js.map +0 -1
  705. package/lib/content-fields/flow-queue-status-conditional.d.ts +0 -30
  706. package/lib/content-fields/flow-queue-status-conditional.js +0 -100
  707. package/lib/content-fields/flow-queue-status-conditional.js.map +0 -1
  708. package/lib/content-fields/flow-rating.d.ts +0 -15
  709. package/lib/content-fields/flow-rating.js +0 -88
  710. package/lib/content-fields/flow-rating.js.map +0 -1
  711. package/lib/content-fields/flow-text.d.ts +0 -15
  712. package/lib/content-fields/flow-text.js +0 -82
  713. package/lib/content-fields/flow-text.js.map +0 -1
  714. package/lib/content-fields/flow-video.d.ts +0 -10
  715. package/lib/content-fields/flow-video.js +0 -42
  716. package/lib/content-fields/flow-video.js.map +0 -1
  717. package/lib/content-fields/flow-webview.d.ts +0 -16
  718. package/lib/content-fields/flow-webview.js +0 -81
  719. package/lib/content-fields/flow-webview.js.map +0 -1
  720. package/lib/content-fields/flow-whatsapp-cta-url-button.d.ts +0 -21
  721. package/lib/content-fields/flow-whatsapp-cta-url-button.js +0 -131
  722. package/lib/content-fields/flow-whatsapp-cta-url-button.js.map +0 -1
  723. package/lib/content-fields/flow-whatsapp-request-contact-info.d.ts +0 -11
  724. package/lib/content-fields/flow-whatsapp-request-contact-info.js +0 -61
  725. package/lib/content-fields/flow-whatsapp-request-contact-info.js.map +0 -1
  726. package/lib/content-fields/flow-whatsapp-template.d.ts +0 -37
  727. package/lib/content-fields/flow-whatsapp-template.js +0 -281
  728. package/lib/content-fields/flow-whatsapp-template.js.map +0 -1
  729. package/lib/content-fields/hubtype-fields/ai-agent-router.d.ts +0 -21
  730. package/lib/content-fields/hubtype-fields/ai-agent-router.js +0 -4
  731. package/lib/content-fields/hubtype-fields/ai-agent-router.js.map +0 -1
  732. package/lib/content-fields/hubtype-fields/ai-agent.d.ts +0 -25
  733. package/lib/content-fields/hubtype-fields/ai-agent.js +0 -4
  734. package/lib/content-fields/hubtype-fields/ai-agent.js.map +0 -1
  735. package/lib/content-fields/hubtype-fields/bot-action.d.ts +0 -10
  736. package/lib/content-fields/hubtype-fields/bot-action.js +0 -4
  737. package/lib/content-fields/hubtype-fields/bot-action.js.map +0 -1
  738. package/lib/content-fields/hubtype-fields/button.d.ts +0 -8
  739. package/lib/content-fields/hubtype-fields/button.js +0 -4
  740. package/lib/content-fields/hubtype-fields/button.js.map +0 -1
  741. package/lib/content-fields/hubtype-fields/capture-user-input.d.ts +0 -19
  742. package/lib/content-fields/hubtype-fields/capture-user-input.js +0 -12
  743. package/lib/content-fields/hubtype-fields/capture-user-input.js.map +0 -1
  744. package/lib/content-fields/hubtype-fields/carousel.d.ts +0 -17
  745. package/lib/content-fields/hubtype-fields/carousel.js +0 -4
  746. package/lib/content-fields/hubtype-fields/carousel.js.map +0 -1
  747. package/lib/content-fields/hubtype-fields/channel-conditional.d.ts +0 -10
  748. package/lib/content-fields/hubtype-fields/channel-conditional.js +0 -4
  749. package/lib/content-fields/hubtype-fields/channel-conditional.js.map +0 -1
  750. package/lib/content-fields/hubtype-fields/common.d.ts +0 -83
  751. package/lib/content-fields/hubtype-fields/common.js +0 -4
  752. package/lib/content-fields/hubtype-fields/common.js.map +0 -1
  753. package/lib/content-fields/hubtype-fields/country-conditional.d.ts +0 -10
  754. package/lib/content-fields/hubtype-fields/country-conditional.js +0 -4
  755. package/lib/content-fields/hubtype-fields/country-conditional.js.map +0 -1
  756. package/lib/content-fields/hubtype-fields/custom-conditional-v2.d.ts +0 -56
  757. package/lib/content-fields/hubtype-fields/custom-conditional-v2.js +0 -36
  758. package/lib/content-fields/hubtype-fields/custom-conditional-v2.js.map +0 -1
  759. package/lib/content-fields/hubtype-fields/custom-conditional.d.ts +0 -11
  760. package/lib/content-fields/hubtype-fields/custom-conditional.js +0 -4
  761. package/lib/content-fields/hubtype-fields/custom-conditional.js.map +0 -1
  762. package/lib/content-fields/hubtype-fields/fallback.d.ts +0 -9
  763. package/lib/content-fields/hubtype-fields/fallback.js +0 -4
  764. package/lib/content-fields/hubtype-fields/fallback.js.map +0 -1
  765. package/lib/content-fields/hubtype-fields/function.d.ts +0 -30
  766. package/lib/content-fields/hubtype-fields/function.js +0 -11
  767. package/lib/content-fields/hubtype-fields/function.js.map +0 -1
  768. package/lib/content-fields/hubtype-fields/go-to-flow.d.ts +0 -9
  769. package/lib/content-fields/hubtype-fields/go-to-flow.js +0 -4
  770. package/lib/content-fields/hubtype-fields/go-to-flow.js.map +0 -1
  771. package/lib/content-fields/hubtype-fields/handoff.d.ts +0 -11
  772. package/lib/content-fields/hubtype-fields/handoff.js +0 -4
  773. package/lib/content-fields/hubtype-fields/handoff.js.map +0 -1
  774. package/lib/content-fields/hubtype-fields/image.d.ts +0 -8
  775. package/lib/content-fields/hubtype-fields/image.js +0 -4
  776. package/lib/content-fields/hubtype-fields/image.js.map +0 -1
  777. package/lib/content-fields/hubtype-fields/index.d.ts +0 -27
  778. package/lib/content-fields/hubtype-fields/index.js +0 -57
  779. package/lib/content-fields/hubtype-fields/index.js.map +0 -1
  780. package/lib/content-fields/hubtype-fields/keyword.d.ts +0 -9
  781. package/lib/content-fields/hubtype-fields/keyword.js +0 -4
  782. package/lib/content-fields/hubtype-fields/keyword.js.map +0 -1
  783. package/lib/content-fields/hubtype-fields/node-types.d.ts +0 -31
  784. package/lib/content-fields/hubtype-fields/node-types.js +0 -38
  785. package/lib/content-fields/hubtype-fields/node-types.js.map +0 -1
  786. package/lib/content-fields/hubtype-fields/nodes.d.ts +0 -26
  787. package/lib/content-fields/hubtype-fields/nodes.js +0 -4
  788. package/lib/content-fields/hubtype-fields/nodes.js.map +0 -1
  789. package/lib/content-fields/hubtype-fields/payload.d.ts +0 -8
  790. package/lib/content-fields/hubtype-fields/payload.js +0 -4
  791. package/lib/content-fields/hubtype-fields/payload.js.map +0 -1
  792. package/lib/content-fields/hubtype-fields/queue-status-conditional.d.ts +0 -25
  793. package/lib/content-fields/hubtype-fields/queue-status-conditional.js +0 -4
  794. package/lib/content-fields/hubtype-fields/queue-status-conditional.js.map +0 -1
  795. package/lib/content-fields/hubtype-fields/rating.d.ts +0 -23
  796. package/lib/content-fields/hubtype-fields/rating.js +0 -9
  797. package/lib/content-fields/hubtype-fields/rating.js.map +0 -1
  798. package/lib/content-fields/hubtype-fields/smart-intent.d.ts +0 -12
  799. package/lib/content-fields/hubtype-fields/smart-intent.js +0 -4
  800. package/lib/content-fields/hubtype-fields/smart-intent.js.map +0 -1
  801. package/lib/content-fields/hubtype-fields/text.d.ts +0 -11
  802. package/lib/content-fields/hubtype-fields/text.js +0 -4
  803. package/lib/content-fields/hubtype-fields/text.js.map +0 -1
  804. package/lib/content-fields/hubtype-fields/url.d.ts +0 -8
  805. package/lib/content-fields/hubtype-fields/url.js +0 -4
  806. package/lib/content-fields/hubtype-fields/url.js.map +0 -1
  807. package/lib/content-fields/hubtype-fields/video.d.ts +0 -8
  808. package/lib/content-fields/hubtype-fields/video.js +0 -4
  809. package/lib/content-fields/hubtype-fields/video.js.map +0 -1
  810. package/lib/content-fields/hubtype-fields/webview.d.ts +0 -17
  811. package/lib/content-fields/hubtype-fields/webview.js +0 -4
  812. package/lib/content-fields/hubtype-fields/webview.js.map +0 -1
  813. package/lib/content-fields/hubtype-fields/whatsapp-button-list.d.ts +0 -21
  814. package/lib/content-fields/hubtype-fields/whatsapp-button-list.js +0 -4
  815. package/lib/content-fields/hubtype-fields/whatsapp-button-list.js.map +0 -1
  816. package/lib/content-fields/hubtype-fields/whatsapp-cta-url-button.d.ts +0 -17
  817. package/lib/content-fields/hubtype-fields/whatsapp-cta-url-button.js +0 -4
  818. package/lib/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +0 -1
  819. package/lib/content-fields/hubtype-fields/whatsapp-request-contact-info.d.ts +0 -8
  820. package/lib/content-fields/hubtype-fields/whatsapp-request-contact-info.js +0 -4
  821. package/lib/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +0 -1
  822. package/lib/content-fields/hubtype-fields/whatsapp-template.d.ts +0 -96
  823. package/lib/content-fields/hubtype-fields/whatsapp-template.js +0 -9
  824. package/lib/content-fields/hubtype-fields/whatsapp-template.js.map +0 -1
  825. package/lib/content-fields/index.d.ts +0 -25
  826. package/lib/content-fields/index.js +0 -73
  827. package/lib/content-fields/index.js.map +0 -1
  828. package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +0 -14
  829. package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +0 -43
  830. package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +0 -1
  831. package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +0 -13
  832. package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +0 -41
  833. package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +0 -1
  834. package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +0 -14
  835. package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +0 -66
  836. package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +0 -1
  837. package/lib/content-fields/whatsapp-button-list/index.d.ts +0 -3
  838. package/lib/content-fields/whatsapp-button-list/index.js +0 -12
  839. package/lib/content-fields/whatsapp-button-list/index.js.map +0 -1
  840. package/lib/filters/index.d.ts +0 -12
  841. package/lib/filters/index.js +0 -16
  842. package/lib/filters/index.js.map +0 -1
  843. package/lib/flow-factory.d.ts +0 -12
  844. package/lib/flow-factory.js +0 -75
  845. package/lib/flow-factory.js.map +0 -1
  846. package/lib/functions/index.d.ts +0 -11
  847. package/lib/functions/index.js +0 -55
  848. package/lib/functions/index.js.map +0 -1
  849. package/lib/index.d.ts +0 -45
  850. package/lib/index.js +0 -195
  851. package/lib/index.js.map +0 -1
  852. package/lib/services/hubtype-queues-api.js +0 -26
  853. package/lib/services/hubtype-queues-api.js.map +0 -1
  854. package/lib/structured-output/flow-builder-content.js +0 -16
  855. package/lib/structured-output/flow-builder-content.js.map +0 -1
  856. package/lib/tracking.d.ts +0 -16
  857. package/lib/tracking.js +0 -77
  858. package/lib/tracking.js.map +0 -1
  859. package/lib/types.d.ts +0 -62
  860. package/lib/types.js +0 -14
  861. package/lib/types.js.map +0 -1
  862. package/lib/user-input/capture-user-input-api.d.ts +0 -21
  863. package/lib/user-input/capture-user-input-api.js +0 -99
  864. package/lib/user-input/capture-user-input-api.js.map +0 -1
  865. package/lib/user-input/index.d.ts +0 -4
  866. package/lib/user-input/index.js +0 -46
  867. package/lib/user-input/index.js.map +0 -1
  868. package/lib/user-input/keyword.d.ts +0 -27
  869. package/lib/user-input/keyword.js +0 -89
  870. package/lib/user-input/keyword.js.map +0 -1
  871. package/lib/user-input/smart-intent.d.ts +0 -24
  872. package/lib/user-input/smart-intent.js +0 -93
  873. package/lib/user-input/smart-intent.js.map +0 -1
  874. package/lib/utils/ai-agent.d.ts +0 -11
  875. package/lib/utils/ai-agent.js +0 -33
  876. package/lib/utils/ai-agent.js.map +0 -1
  877. package/lib/utils/authentication.js +0 -24
  878. package/lib/utils/authentication.js.map +0 -1
  879. package/lib/utils/flow-locale.js +0 -75
  880. package/lib/utils/flow-locale.js.map +0 -1
  881. package/lib/utils/get-flow-builder-plugin.d.ts +0 -3
  882. package/lib/utils/get-flow-builder-plugin.js +0 -16
  883. package/lib/utils/get-flow-builder-plugin.js.map +0 -1
  884. package/lib/utils/hubtype-assistant-content.d.ts +0 -13
  885. package/lib/utils/hubtype-assistant-content.js +0 -200
  886. package/lib/utils/hubtype-assistant-content.js.map +0 -1
  887. package/lib/utils/input.js +0 -37
  888. package/lib/utils/input.js.map +0 -1
  889. package/lib/webview/contents-context.d.ts +0 -2
  890. package/lib/webview/contents-context.js +0 -14
  891. package/lib/webview/contents-context.js.map +0 -1
  892. package/lib/webview/index.d.ts +0 -3
  893. package/lib/webview/index.js +0 -11
  894. package/lib/webview/index.js.map +0 -1
  895. package/lib/webview/types.d.ts +0 -47
  896. package/lib/webview/types.js +0 -9
  897. package/lib/webview/types.js.map +0 -1
  898. package/lib/webview/use-webview-contents.d.ts +0 -2
  899. package/lib/webview/use-webview-contents.js +0 -90
  900. package/lib/webview/use-webview-contents.js.map +0 -1
  901. /package/lib/{services → cjs/services}/hubtype-queues-api.d.ts +0 -0
  902. /package/lib/{structured-output → cjs/structured-output}/flow-builder-content.d.ts +0 -0
  903. /package/lib/{utils → cjs/utils}/authentication.d.ts +0 -0
  904. /package/lib/{utils → cjs/utils}/flow-locale.d.ts +0 -0
  905. /package/lib/{utils → cjs/utils}/input.d.ts +0 -0
package/lib/api.d.ts DELETED
@@ -1,40 +0,0 @@
1
- import type { PluginPreRequest } from '@botonic/core';
2
- import { type HtBotActionNode, type HtCaptureUserInputNode, type HtFlowBuilderData, type HtFlowWebview, type HtKeywordNode, type HtNodeComponent, type HtNodeLink, type HtNodeWithContent, type HtRatingButton, type HtRatingNode, type HtSmartIntentNode } from './content-fields/hubtype-fields/index.js';
3
- import { type FlowBuilderApiOptions } from './types.js';
4
- export declare class FlowBuilderApi {
5
- url: string;
6
- flowUrl: string;
7
- flow: HtFlowBuilderData;
8
- request: PluginPreRequest;
9
- private constructor();
10
- static create(options: FlowBuilderApiOptions): Promise<FlowBuilderApi>;
11
- private getFlow;
12
- private updateSessionWithUserInfo;
13
- getNodeByFlowId(id: string): HtNodeWithContent;
14
- getNodeByCampaignId<T extends HtNodeComponent>(id: string): T;
15
- getNodeById<T extends HtNodeComponent>(id: string): T;
16
- getRatingNodeByButtonId(id: string): HtRatingNode;
17
- getRatingButtonById(ratingNode: HtRatingNode, id: string): HtRatingButton;
18
- getNodeByContentID(contentID: string): HtNodeComponent;
19
- getStartNode(): HtNodeWithContent;
20
- getFallbackNode(alternate: boolean): HtNodeWithContent;
21
- getSmartIntentNodes(): HtSmartIntentNode[];
22
- getKeywordNodes(): HtKeywordNode[];
23
- getPayload(target?: HtNodeLink): string | undefined;
24
- isBotAction(id: string): boolean;
25
- private isUUID;
26
- createPayloadWithParams(botActionNode: HtBotActionNode): string;
27
- private getFollowUpContentID;
28
- getFlowName(flowId: string): string;
29
- getCampaignFlowName(campaignId: string): string;
30
- getStartNodeAiAgentFlow(): HtNodeWithContent | undefined;
31
- isAiAgentEnabled(): boolean;
32
- getWebviewById(id: string): HtFlowWebview | undefined;
33
- shouldCaptureUserInput(): boolean;
34
- getCaptureUserInputId(): string | undefined;
35
- setCaptureUserInputId(id: string): void;
36
- removeCaptureUserInputId(): void;
37
- setUserExtraDataVariable(key: string, value: string): void;
38
- getCaptureUserInputNode(): HtCaptureUserInputNode | undefined;
39
- getResolvedLocale(): string;
40
- }
package/lib/api.js DELETED
@@ -1,216 +0,0 @@
1
- import axios from "axios";
2
- import { AI_AGENTS_FLOW_NAME, SEPARATOR, UUID_REGEXP } from "./constants.js";
3
- import { HtNodeWithContentType } from "./content-fields/hubtype-fields/index.js";
4
- import { ProcessEnvNodeEnvs } from "./types.js";
5
- import { FlowLocale } from "./utils/flow-locale.js";
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
- class FlowBuilderApi {
18
- static async create(options) {
19
- const newApi = new FlowBuilderApi();
20
- newApi.url = options.url;
21
- newApi.request = options.request;
22
- // TODO: Refactor later to combine logic from `FlowBuilderApi.create`, `resolveFlowUrl` and `getAccessToken` to be in one place
23
- if (process.env.NODE_ENV === ProcessEnvNodeEnvs.DEVELOPMENT) {
24
- await newApi.updateSessionWithUserInfo(options.accessToken);
25
- }
26
- const updatedRequest = newApi.request;
27
- newApi.flowUrl = options.flowUrl.replace('{bot_id}', updatedRequest.session.bot.id);
28
- newApi.flow = options.flow ?? await newApi.getFlow(options.accessToken);
29
- return newApi;
30
- }
31
- async getFlow(token) {
32
- const { data } = await axios.get(this.flowUrl, {
33
- headers: {
34
- Authorization: `Bearer ${token}`
35
- }
36
- });
37
- return data;
38
- }
39
- async updateSessionWithUserInfo(token) {
40
- const url = `${this.url}/v1/flow_builder/user_info/`;
41
- const response = await axios.get(url, {
42
- headers: {
43
- Authorization: `Bearer ${token}`
44
- }
45
- });
46
- this.request.session.organization_id = response.data.organization_id;
47
- this.request.session.bot.id = response.data.bot_id;
48
- }
49
- getNodeByFlowId(id) {
50
- const subFlow = this.flow.flows.find((subFlow)=>subFlow.id === id);
51
- if (!subFlow) {
52
- throw Error(`SubFlow with id: '${id}' not found`);
53
- }
54
- return this.getNodeById(subFlow.start_node_id);
55
- }
56
- getNodeByCampaignId(id) {
57
- const campaign = this.flow.campaigns.find((campaign)=>campaign.id === id);
58
- if (!campaign) {
59
- throw Error(`Campaign with id: '${id}' not found`);
60
- }
61
- return this.getNodeById(campaign.start_node_id);
62
- }
63
- getNodeById(id) {
64
- const node = this.flow.nodes.find((node)=>node.id === id);
65
- if (!node) {
66
- console.error(`Node with id: '${id}' not found`);
67
- }
68
- return node;
69
- }
70
- getRatingNodeByButtonId(id) {
71
- const ratingNodes = this.flow.nodes.filter((node)=>node.type === HtNodeWithContentType.RATING);
72
- const ratingNode = ratingNodes.find((node)=>node.content.buttons.some((button)=>button.id === id));
73
- if (!ratingNode) {
74
- throw Error(`Rating node with button id: '${id}' not found`);
75
- }
76
- return ratingNode;
77
- }
78
- getRatingButtonById(ratingNode, id) {
79
- const ratingButton = ratingNode.content.buttons.find((button)=>button.id === id);
80
- if (!ratingButton) {
81
- throw Error(`Rating button with id: '${id}' not found`);
82
- }
83
- return ratingButton;
84
- }
85
- getNodeByContentID(contentID) {
86
- const content = this.flow.nodes.find((node)=>'code' in node ? node.code === contentID : false);
87
- if (!content) {
88
- throw Error(`Node with contentID: '${contentID}' not found`);
89
- }
90
- return content;
91
- }
92
- getStartNode() {
93
- const startNodeId = this.flow.start_node_id;
94
- if (!startNodeId) {
95
- throw new Error('Start node id must be defined');
96
- }
97
- return this.getNodeById(startNodeId);
98
- }
99
- getFallbackNode(alternate) {
100
- const fallbackNode = this.flow.nodes.find((node)=>node.type === HtNodeWithContentType.FALLBACK);
101
- if (!fallbackNode) {
102
- throw new Error('Fallback node must be defined');
103
- }
104
- const fallbackFirstMessage = fallbackNode.content.first_message;
105
- if (!fallbackFirstMessage) {
106
- throw new Error('Fallback 1st message must be defined');
107
- }
108
- const fallbackSecondMessage = fallbackNode.content.second_message;
109
- if (!fallbackSecondMessage) {
110
- return this.getNodeById(fallbackFirstMessage.id);
111
- }
112
- return alternate ? this.getNodeById(fallbackFirstMessage.id) : this.getNodeById(fallbackSecondMessage.id);
113
- }
114
- getSmartIntentNodes() {
115
- return this.flow.nodes.filter((node)=>node.type === HtNodeWithContentType.SMART_INTENT);
116
- }
117
- getKeywordNodes() {
118
- return this.flow.nodes.filter((node)=>node.type === HtNodeWithContentType.KEYWORD);
119
- }
120
- getPayload(target) {
121
- if (!target) {
122
- return undefined;
123
- }
124
- return target.id;
125
- }
126
- isBotAction(id) {
127
- if (!this.isUUID(id)) {
128
- return false;
129
- }
130
- const node = this.getNodeById(id);
131
- return node?.type === HtNodeWithContentType.BOT_ACTION;
132
- }
133
- isUUID(str) {
134
- return UUID_REGEXP.test(str);
135
- }
136
- createPayloadWithParams(botActionNode) {
137
- const payloadId = botActionNode.content.payload_id;
138
- const payloadNode = this.getNodeById(payloadId);
139
- const customParams = JSON.parse(botActionNode.content.payload_params || '{}');
140
- const contentID = botActionNode.code;
141
- const followUpContentID = this.getFollowUpContentID(botActionNode.follow_up?.id);
142
- const payloadParams = {
143
- contentID,
144
- followUpContentID
145
- };
146
- const payloadJson = JSON.stringify({
147
- ...customParams,
148
- ...payloadParams
149
- });
150
- return `${payloadNode.content.payload}${SEPARATOR}${payloadJson}`;
151
- }
152
- getFollowUpContentID(id) {
153
- const followUpNode = id ? this.getNodeById(id) : undefined;
154
- return followUpNode?.code;
155
- }
156
- getFlowName(flowId) {
157
- const flow = this.flow.flows.find((flow)=>flow.id === flowId);
158
- return flow ? flow.name : this.getCampaignFlowName(flowId);
159
- }
160
- getCampaignFlowName(campaignId) {
161
- const campaign = this.flow.campaigns.find((campaign)=>campaign.id === campaignId);
162
- return campaign ? campaign.name : '';
163
- }
164
- getStartNodeAiAgentFlow() {
165
- const aiAgentFlow = this.flow.flows.find((flow)=>flow.name === AI_AGENTS_FLOW_NAME);
166
- if (!aiAgentFlow) {
167
- return undefined;
168
- }
169
- return this.getNodeById(aiAgentFlow.start_node_id);
170
- }
171
- isAiAgentEnabled() {
172
- return this.flow.is_ai_agent_active || false;
173
- }
174
- getWebviewById(id) {
175
- return this.flow.webviews.find((webview)=>webview.id === id);
176
- }
177
- shouldCaptureUserInput() {
178
- return !!this.getCaptureUserInputId();
179
- }
180
- getCaptureUserInputId() {
181
- return this.request.session.capture_user_input?.node_id;
182
- }
183
- setCaptureUserInputId(id) {
184
- if (this.request.session.capture_user_input) {
185
- this.request.session.capture_user_input.node_id = id;
186
- }
187
- this.request.session.capture_user_input = {
188
- node_id: id
189
- };
190
- }
191
- removeCaptureUserInputId() {
192
- this.request.session.capture_user_input = undefined;
193
- }
194
- setUserExtraDataVariable(key, value) {
195
- if (this.request.session.user.extra_data) {
196
- this.request.session.user.extra_data[key] = value;
197
- }
198
- }
199
- getCaptureUserInputNode() {
200
- const captureUserInputId = this.getCaptureUserInputId();
201
- if (!captureUserInputId) {
202
- return undefined;
203
- }
204
- return this.getNodeById(captureUserInputId);
205
- }
206
- getResolvedLocale() {
207
- const flowLocales = this.flow.locales;
208
- const defaultLocaleCode = this.flow.default_locale_code;
209
- return new FlowLocale(this.request, flowLocales, defaultLocaleCode).resolve();
210
- }
211
- constructor(){}
212
- }
213
-
214
- export { FlowBuilderApi };
215
-
216
- //# sourceMappingURL=api.js.map
package/lib/api.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"api.js","sources":["../src/api.ts"],"sourcesContent":["import type { PluginPreRequest } from '@botonic/core'\nimport axios from 'axios'\n\nimport { AI_AGENTS_FLOW_NAME, SEPARATOR, UUID_REGEXP } from './constants'\nimport {\n type HtBotActionNode,\n type HtCaptureUserInputNode,\n type HtFallbackNode,\n type HtFlowBuilderData,\n type HtFlowWebview,\n type HtGoToFlow,\n type HtKeywordNode,\n type HtNodeComponent,\n type HtNodeLink,\n type HtNodeWithContent,\n HtNodeWithContentType,\n type HtPayloadNode,\n type HtRatingButton,\n type HtRatingNode,\n type HtSmartIntentNode,\n} from './content-fields/hubtype-fields'\nimport {\n type FlowBuilderApiOptions,\n type PayloadParamsBase,\n ProcessEnvNodeEnvs,\n} from './types'\nimport { FlowLocale } from './utils/flow-locale'\n\nexport class FlowBuilderApi {\n url: string\n flowUrl: string\n flow: HtFlowBuilderData\n request: PluginPreRequest\n\n private constructor() {}\n\n static async create(options: FlowBuilderApiOptions): Promise<FlowBuilderApi> {\n const newApi = new FlowBuilderApi()\n\n newApi.url = options.url\n newApi.request = options.request\n // TODO: Refactor later to combine logic from `FlowBuilderApi.create`, `resolveFlowUrl` and `getAccessToken` to be in one place\n if (process.env.NODE_ENV === ProcessEnvNodeEnvs.DEVELOPMENT) {\n await newApi.updateSessionWithUserInfo(options.accessToken)\n }\n const updatedRequest = newApi.request\n newApi.flowUrl = options.flowUrl.replace(\n '{bot_id}',\n updatedRequest.session.bot.id\n )\n newApi.flow = options.flow ?? (await newApi.getFlow(options.accessToken))\n return newApi\n }\n\n private async getFlow(token: string): Promise<HtFlowBuilderData> {\n const { data } = await axios.get(this.flowUrl, {\n headers: { Authorization: `Bearer ${token}` },\n })\n return data as HtFlowBuilderData\n }\n\n private async updateSessionWithUserInfo(token: string) {\n const url = `${this.url}/v1/flow_builder/user_info/`\n const response = await axios.get(url, {\n headers: { Authorization: `Bearer ${token}` },\n })\n this.request.session.organization_id = response.data.organization_id\n this.request.session.bot.id = response.data.bot_id\n }\n\n getNodeByFlowId(id: string): HtNodeWithContent {\n const subFlow = this.flow.flows.find(subFlow => subFlow.id === id)\n if (!subFlow) {\n throw Error(`SubFlow with id: '${id}' not found`)\n }\n return this.getNodeById<HtNodeWithContent>(subFlow.start_node_id)\n }\n\n getNodeByCampaignId<T extends HtNodeComponent>(id: string): T {\n const campaign = this.flow.campaigns.find(campaign => campaign.id === id)\n if (!campaign) {\n throw Error(`Campaign with id: '${id}' not found`)\n }\n return this.getNodeById<T>(campaign.start_node_id)\n }\n\n getNodeById<T extends HtNodeComponent>(id: string): T {\n const node = this.flow.nodes.find(node => node.id === id)\n if (!node) {\n console.error(`Node with id: '${id}' not found`)\n }\n\n return node as T\n }\n\n getRatingNodeByButtonId(id: string): HtRatingNode {\n const ratingNodes = this.flow.nodes.filter(\n node => node.type === HtNodeWithContentType.RATING\n ) as HtRatingNode[]\n const ratingNode = ratingNodes.find(node =>\n node.content.buttons.some(button => button.id === id)\n ) as HtRatingNode | undefined\n\n if (!ratingNode) {\n throw Error(`Rating node with button id: '${id}' not found`)\n }\n\n return ratingNode\n }\n\n getRatingButtonById(ratingNode: HtRatingNode, id: string): HtRatingButton {\n const ratingButton = ratingNode.content.buttons.find(\n button => button.id === id\n ) as HtRatingButton | undefined\n if (!ratingButton) {\n throw Error(`Rating button with id: '${id}' not found`)\n }\n\n return ratingButton\n }\n\n getNodeByContentID(contentID: string): HtNodeComponent {\n const content = this.flow.nodes.find(node =>\n 'code' in node ? node.code === contentID : false\n )\n if (!content) {\n throw Error(`Node with contentID: '${contentID}' not found`)\n }\n return content\n }\n\n getStartNode(): HtNodeWithContent {\n const startNodeId = this.flow.start_node_id\n if (!startNodeId) {\n throw new Error('Start node id must be defined')\n }\n return this.getNodeById(startNodeId)\n }\n\n getFallbackNode(alternate: boolean): HtNodeWithContent {\n const fallbackNode = this.flow.nodes.find(\n node => node.type === HtNodeWithContentType.FALLBACK\n ) as HtFallbackNode | undefined\n if (!fallbackNode) {\n throw new Error('Fallback node must be defined')\n }\n const fallbackFirstMessage = fallbackNode.content.first_message\n if (!fallbackFirstMessage) {\n throw new Error('Fallback 1st message must be defined')\n }\n const fallbackSecondMessage = fallbackNode.content.second_message\n if (!fallbackSecondMessage) {\n return this.getNodeById(fallbackFirstMessage.id)\n }\n return alternate\n ? this.getNodeById(fallbackFirstMessage.id)\n : this.getNodeById(fallbackSecondMessage.id)\n }\n\n getSmartIntentNodes(): HtSmartIntentNode[] {\n return this.flow.nodes.filter(\n node => node.type === HtNodeWithContentType.SMART_INTENT\n ) as HtSmartIntentNode[]\n }\n\n getKeywordNodes(): HtKeywordNode[] {\n return this.flow.nodes.filter(\n node => node.type === HtNodeWithContentType.KEYWORD\n ) as HtKeywordNode[]\n }\n\n getPayload(target?: HtNodeLink): string | undefined {\n if (!target) {\n return undefined\n }\n\n return target.id\n }\n\n isBotAction(id: string): boolean {\n if (!this.isUUID(id)) {\n return false\n }\n const node = this.getNodeById(id)\n return node?.type === HtNodeWithContentType.BOT_ACTION\n }\n\n private isUUID(str: string): boolean {\n return UUID_REGEXP.test(str)\n }\n\n createPayloadWithParams(botActionNode: HtBotActionNode): string {\n const payloadId = botActionNode.content.payload_id\n const payloadNode = this.getNodeById<HtPayloadNode>(payloadId)\n const customParams = JSON.parse(\n botActionNode.content.payload_params || '{}'\n )\n\n const contentID = botActionNode.code\n\n const followUpContentID = this.getFollowUpContentID(\n botActionNode.follow_up?.id\n )\n\n const payloadParams: PayloadParamsBase = {\n contentID,\n followUpContentID,\n }\n\n const payloadJson = JSON.stringify({\n ...customParams,\n ...payloadParams,\n })\n return `${payloadNode.content.payload}${SEPARATOR}${payloadJson}`\n }\n\n private getFollowUpContentID(id?: string): string | undefined {\n const followUpNode = id\n ? this.getNodeById<HtNodeWithContent | HtGoToFlow>(id)\n : undefined\n\n return followUpNode?.code\n }\n\n getFlowName(flowId: string): string {\n const flow = this.flow.flows.find(flow => flow.id === flowId)\n return flow ? flow.name : this.getCampaignFlowName(flowId)\n }\n\n getCampaignFlowName(campaignId: string): string {\n const campaign = this.flow.campaigns.find(\n campaign => campaign.id === campaignId\n )\n return campaign ? campaign.name : ''\n }\n\n getStartNodeAiAgentFlow(): HtNodeWithContent | undefined {\n const aiAgentFlow = this.flow.flows.find(\n flow => flow.name === AI_AGENTS_FLOW_NAME\n )\n\n if (!aiAgentFlow) {\n return undefined\n }\n\n return this.getNodeById<HtNodeWithContent>(aiAgentFlow.start_node_id)\n }\n\n isAiAgentEnabled(): boolean {\n return this.flow.is_ai_agent_active || false\n }\n\n getWebviewById(id: string): HtFlowWebview | undefined {\n return this.flow.webviews.find(webview => webview.id === id)\n }\n\n shouldCaptureUserInput(): boolean {\n return !!this.getCaptureUserInputId()\n }\n\n getCaptureUserInputId(): string | undefined {\n return this.request.session.capture_user_input?.node_id\n }\n\n setCaptureUserInputId(id: string): void {\n if (this.request.session.capture_user_input) {\n this.request.session.capture_user_input.node_id = id\n }\n this.request.session.capture_user_input = { node_id: id }\n }\n\n removeCaptureUserInputId(): void {\n this.request.session.capture_user_input = undefined\n }\n\n setUserExtraDataVariable(key: string, value: string): void {\n if (this.request.session.user.extra_data) {\n this.request.session.user.extra_data[key] = value\n }\n }\n\n getCaptureUserInputNode(): HtCaptureUserInputNode | undefined {\n const captureUserInputId = this.getCaptureUserInputId()\n if (!captureUserInputId) {\n return undefined\n }\n return this.getNodeById<HtCaptureUserInputNode>(captureUserInputId)\n }\n\n getResolvedLocale(): string {\n const flowLocales = this.flow.locales\n const defaultLocaleCode = this.flow.default_locale_code\n\n return new FlowLocale(\n this.request,\n flowLocales,\n defaultLocaleCode\n ).resolve()\n }\n}\n"],"names":["axios","AI_AGENTS_FLOW_NAME","SEPARATOR","UUID_REGEXP","HtNodeWithContentType","ProcessEnvNodeEnvs","FlowLocale","FlowBuilderApi","options","newApi","process","updatedRequest","token","data","url","response","id","subFlow","Error","campaign","node","console","ratingNodes","ratingNode","button","ratingButton","contentID","content","startNodeId","alternate","fallbackNode","fallbackFirstMessage","fallbackSecondMessage","target","undefined","str","botActionNode","payloadId","payloadNode","customParams","JSON","followUpContentID","payloadParams","payloadJson","followUpNode","flowId","flow","campaignId","aiAgentFlow","webview","key","value","captureUserInputId","flowLocales","defaultLocale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AAU,EAAE;YACxC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAACD,IAAI,GAAGC;QAC9C;IACF;IAEA,0BAA8D;QAC5D,MAAMC,qBAAqB,IAAI,CAAC,qBAAqB;QACrD,IAAI,CAACA,oBAAoB;YACvB,OAAOlB;QACT;QACA,OAAO,IAAI,CAAC,WAAW,CAAyBkB;IAClD;IAEA,oBAA4B;QAC1B,MAAMC,cAAc,IAAI,CAAC,IAAI,CAAC,OAAO;QACrC,MAAMC,oBAAoB,IAAI,CAAC,IAAI,CAAC,mBAAmB;QAEvD,OAAO,IAAIhD,UAAUA,CACnB,IAAI,CAAC,OAAO,EACZ+C,aACAC,mBACA,OAAO;IACX;IAxQA,aAAsB,CAAC;AAyQzB"}
@@ -1,13 +0,0 @@
1
- export declare const FLOW_BUILDER_API_URL_PROD: string;
2
- export declare const SEPARATOR = "|";
3
- export declare const SOURCE_INFO_SEPARATOR = "|source_";
4
- export declare const EMPTY_PAYLOAD = "fb-empty-payload";
5
- export declare const VARIABLE_PATTERN_GLOBAL: RegExp;
6
- export declare const ACCESS_TOKEN_VARIABLE_KEY = "_access_token";
7
- export declare const REG_EXP_PATTERN: RegExp;
8
- export declare const UUID_REGEXP: RegExp;
9
- export declare const AGENT_RATING_PAYLOAD = "agent-rating";
10
- export declare const PUSH_FLOW_PAYLOAD = "push-flow";
11
- export declare const MAIN_FLOW_NAME = "Main";
12
- export declare const AI_AGENTS_FLOW_NAME = "AI Agents";
13
- export declare const FALLBACK_FLOW_NAME = "Fallback";
package/lib/constants.js DELETED
@@ -1,17 +0,0 @@
1
- const FLOW_BUILDER_API_URL_PROD = process.env.HUBTYPE_API_URL || 'https://api.hubtype.com';
2
- const SEPARATOR = '|';
3
- const SOURCE_INFO_SEPARATOR = `${SEPARATOR}source_`;
4
- const EMPTY_PAYLOAD = 'fb-empty-payload';
5
- const VARIABLE_PATTERN_GLOBAL = /{([^{}]+)}/g;
6
- const ACCESS_TOKEN_VARIABLE_KEY = '_access_token';
7
- const REG_EXP_PATTERN = /^\/(.*)\/([gimyus]*)$/;
8
- const UUID_REGEXP = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
9
- /* ********** PAYLOADS ********** */ const AGENT_RATING_PAYLOAD = 'agent-rating';
10
- const PUSH_FLOW_PAYLOAD = 'push-flow';
11
- /* ********** FLOW NAMES ********** */ const MAIN_FLOW_NAME = 'Main';
12
- const AI_AGENTS_FLOW_NAME = 'AI Agents';
13
- const FALLBACK_FLOW_NAME = 'Fallback';
14
-
15
- export { ACCESS_TOKEN_VARIABLE_KEY, AGENT_RATING_PAYLOAD, AI_AGENTS_FLOW_NAME, EMPTY_PAYLOAD, FALLBACK_FLOW_NAME, FLOW_BUILDER_API_URL_PROD, MAIN_FLOW_NAME, PUSH_FLOW_PAYLOAD, REG_EXP_PATTERN, SEPARATOR, SOURCE_INFO_SEPARATOR, UUID_REGEXP, VARIABLE_PATTERN_GLOBAL };
16
-
17
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sources":["../src/constants.ts"],"sourcesContent":["export const FLOW_BUILDER_API_URL_PROD =\n process.env.HUBTYPE_API_URL || 'https://api.hubtype.com'\nexport const SEPARATOR = '|'\nexport const SOURCE_INFO_SEPARATOR = `${SEPARATOR}source_`\nexport const EMPTY_PAYLOAD = 'fb-empty-payload'\nexport const VARIABLE_PATTERN_GLOBAL = /{([^{}]+)}/g\nexport const ACCESS_TOKEN_VARIABLE_KEY = '_access_token'\nexport const REG_EXP_PATTERN = /^\\/(.*)\\/([gimyus]*)$/\nexport const UUID_REGEXP =\n /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i\n\n/* ********** PAYLOADS ********** */\nexport const AGENT_RATING_PAYLOAD = 'agent-rating'\nexport const PUSH_FLOW_PAYLOAD = 'push-flow'\n\n/* ********** FLOW NAMES ********** */\nexport const MAIN_FLOW_NAME = 'Main'\nexport const AI_AGENTS_FLOW_NAME = 'AI Agents'\nexport const FALLBACK_FLOW_NAME = 'Fallback'\n"],"names":["FLOW_BUILDER_API_URL_PROD","process","SEPARATOR","SOURCE_INFO_SEPARATOR","EMPTY_PAYLOAD","VARIABLE_PATTERN_GLOBAL","ACCESS_TOKEN_VARIABLE_KEY","REG_EXP_PATTERN","UUID_REGEXP","AGENT_RATING_PAYLOAD","PUSH_FLOW_PAYLOAD","MAIN_FLOW_NAME","AI_AGENTS_FLOW_NAME","FALLBACK_FLOW_NAME"],"mappings":"AAAO,MAAMA,yBAAyBA,GACpCC,QAAQ,GAAG,CAAC,eAAe,IAAI,0BAAyB;AACnD,MAAMC,SAASA,GAAG,IAAG;AACrB,MAAMC,qBAAqBA,GAAG,GAAGD,SAASA,CAAC,OAAO,CAAC;AACnD,MAAME,aAAaA,GAAG,mBAAkB;AACxC,MAAMC,uBAAuBA,GAAG,cAAa;AAC7C,MAAMC,yBAAyBA,GAAG,gBAAe;AACjD,MAAMC,eAAeA,GAAG,wBAAuB;AAC/C,MAAMC,WAAWA,GACtB,kEAAiE;AAEnE,kCAAkC,GAC3B,MAAMC,oBAAoBA,GAAG,eAAc;AAC3C,MAAMC,iBAAiBA,GAAG,YAAW;AAE5C,oCAAoC,GAC7B,MAAMC,cAAcA,GAAG,OAAM;AAC7B,MAAMC,mBAAmBA,GAAG,YAAW;AACvC,MAAMC,kBAAkBA,GAAG,WAAU"}
@@ -1,20 +0,0 @@
1
- import type { BotContext } from '@botonic/core';
2
- import type { HtMediaFileLocale, HtNodeLink, HtQueueLocale, HtTextLocale, HtVideoLocale } from './hubtype-fields/index.js';
3
- import type { FlowContent } from './index.js';
4
- export declare abstract class ContentFieldsBase {
5
- readonly id: string;
6
- code: string;
7
- followUp?: HtNodeLink;
8
- constructor(id: string);
9
- abstract trackFlow(botContext: BotContext): Promise<void>;
10
- abstract processContent(botContext: BotContext): Promise<void>;
11
- filterContent(botContext: BotContext, content: FlowContent): Promise<FlowContent>;
12
- static getTextByLocale(locale: string, text: HtTextLocale[]): string;
13
- static getAssetByLocale(locale: string, asset: HtMediaFileLocale[]): string;
14
- static getVideoByLocale(locale: string, video: HtVideoLocale[]): string;
15
- static getQueueByLocale(locale: string, queues: HtQueueLocale[]): HtQueueLocale | undefined;
16
- replaceVariables(text: string, botContext: BotContext): string;
17
- getValueFromKeyPath(botContext: BotContext, keyPath: string): any;
18
- private resolveObjectKey;
19
- private isValidType;
20
- }
@@ -1,78 +0,0 @@
1
- import { ACCESS_TOKEN_VARIABLE_KEY, VARIABLE_PATTERN_GLOBAL } from "../constants.js";
2
- import { ContentFilterExecutor } from "../filters/index.js";
3
- import { getFlowBuilderPlugin } from "../utils/get-flow-builder-plugin.js";
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
- class ContentFieldsBase {
12
- async filterContent(botContext, content) {
13
- const flowBuilderPlugin = getFlowBuilderPlugin(botContext.plugins);
14
- const contentFilters = flowBuilderPlugin.contentFilters;
15
- const contentFilterExecutor = new ContentFilterExecutor({
16
- filters: contentFilters
17
- });
18
- const filteredContent = await contentFilterExecutor.filter(botContext, content);
19
- return filteredContent;
20
- }
21
- static getTextByLocale(locale, text) {
22
- const result = text.find((t)=>t.locale === locale);
23
- return result?.message ?? '';
24
- }
25
- static getAssetByLocale(locale, asset) {
26
- const result = asset.find((i)=>i.locale === locale);
27
- return result?.file ?? '';
28
- }
29
- static getVideoByLocale(locale, video) {
30
- const result = video.find((v)=>v.locale === locale);
31
- return result?.url ?? '';
32
- }
33
- static getQueueByLocale(locale, queues) {
34
- return queues.find((queue)=>queue.locale === locale);
35
- }
36
- replaceVariables(text, botContext) {
37
- if (!botContext) {
38
- return text;
39
- }
40
- return text.replace(VARIABLE_PATTERN_GLOBAL, (match)=>{
41
- // remove \\ ( escape for _ ) added by text node with markdown
42
- const keyPath = match.slice(1, -1).replaceAll('\\', '');
43
- const botVariable = keyPath.endsWith(ACCESS_TOKEN_VARIABLE_KEY) ? match : this.getValueFromKeyPath(botContext, keyPath);
44
- return this.isValidType(botVariable) ? String(botVariable) : match;
45
- });
46
- }
47
- getValueFromKeyPath(botContext, keyPath) {
48
- if (keyPath.startsWith('session.user.contact_info.')) {
49
- const name = keyPath.split('.').at(-1);
50
- return botContext.session.user.contact_info?.find((contact)=>contact.name === name)?.value;
51
- }
52
- if (keyPath.startsWith('input.') || keyPath.startsWith('session.')) {
53
- return keyPath.split('.').reduce((object, key)=>this.resolveObjectKey(object, key), botContext);
54
- }
55
- return keyPath.split('.').reduce((object, key)=>this.resolveObjectKey(object, key), botContext.session.user.extra_data);
56
- }
57
- resolveObjectKey(object, key) {
58
- if (object && object[key] !== undefined) {
59
- return object[key];
60
- }
61
- return undefined;
62
- }
63
- isValidType(botVariable) {
64
- const validTypes = [
65
- 'boolean',
66
- 'string',
67
- 'number'
68
- ];
69
- return validTypes.includes(typeof botVariable);
70
- }
71
- constructor(id){
72
- this.id = id;
73
- }
74
- }
75
-
76
- export { ContentFieldsBase };
77
-
78
- //# sourceMappingURL=content-fields-base.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"content-fields/content-fields-base.js","sources":["../../src/content-fields/content-fields-base.ts"],"sourcesContent":["import type { BotContext } from '@botonic/core'\nimport {\n ACCESS_TOKEN_VARIABLE_KEY,\n VARIABLE_PATTERN_GLOBAL,\n} from '../constants'\nimport { ContentFilterExecutor } from '../filters'\nimport { getFlowBuilderPlugin } from '../utils/get-flow-builder-plugin'\nimport type {\n HtMediaFileLocale,\n HtNodeLink,\n HtQueueLocale,\n HtTextLocale,\n HtVideoLocale,\n} from './hubtype-fields'\nimport type { FlowContent } from './index'\n\nexport abstract class ContentFieldsBase {\n public code: string\n public followUp?: HtNodeLink\n\n constructor(public readonly id: string) {}\n\n abstract trackFlow(botContext: BotContext): Promise<void>\n\n abstract processContent(botContext: BotContext): Promise<void>\n\n async filterContent(\n botContext: BotContext,\n content: FlowContent\n ): Promise<FlowContent> {\n const flowBuilderPlugin = getFlowBuilderPlugin(botContext.plugins)\n const contentFilters = flowBuilderPlugin.contentFilters\n const contentFilterExecutor = new ContentFilterExecutor({\n filters: contentFilters,\n })\n const filteredContent = await contentFilterExecutor.filter(\n botContext,\n content\n )\n return filteredContent\n }\n\n static getTextByLocale(locale: string, text: HtTextLocale[]): string {\n const result = text.find(t => t.locale === locale)\n return result?.message ?? ''\n }\n\n static getAssetByLocale(locale: string, asset: HtMediaFileLocale[]): string {\n const result = asset.find(i => i.locale === locale)\n return result?.file ?? ''\n }\n\n static getVideoByLocale(locale: string, video: HtVideoLocale[]): string {\n const result = video.find(v => v.locale === locale)\n return result?.url ?? ''\n }\n\n static getQueueByLocale(\n locale: string,\n queues: HtQueueLocale[]\n ): HtQueueLocale | undefined {\n return queues.find(queue => queue.locale === locale)\n }\n\n replaceVariables(text: string, botContext: BotContext): string {\n if (!botContext) {\n return text\n }\n\n return text.replace(VARIABLE_PATTERN_GLOBAL, match => {\n // remove \\\\ ( escape for _ ) added by text node with markdown\n const keyPath = match.slice(1, -1).replaceAll('\\\\', '')\n\n const botVariable = keyPath.endsWith(ACCESS_TOKEN_VARIABLE_KEY)\n ? match\n : this.getValueFromKeyPath(botContext, keyPath)\n\n return this.isValidType(botVariable) ? String(botVariable) : match\n })\n }\n\n getValueFromKeyPath(botContext: BotContext, keyPath: string): any {\n if (keyPath.startsWith('session.user.contact_info.')) {\n const name = keyPath.split('.').at(-1)\n return botContext.session.user.contact_info?.find(\n contact => contact.name === name\n )?.value\n }\n\n if (keyPath.startsWith('input.') || keyPath.startsWith('session.')) {\n return keyPath\n .split('.')\n .reduce((object, key) => this.resolveObjectKey(object, key), botContext)\n }\n\n return keyPath\n .split('.')\n .reduce(\n (object, key) => this.resolveObjectKey(object, key),\n botContext.session.user.extra_data\n )\n }\n\n private resolveObjectKey(object: any, key: string): any {\n if (object && object[key] !== undefined) {\n return object[key]\n }\n return undefined\n }\n\n private isValidType(botVariable: any): boolean {\n const validTypes = ['boolean', 'string', 'number']\n return validTypes.includes(typeof botVariable)\n }\n}\n"],"names":["ACCESS_TOKEN_VARIABLE_KEY","VARIABLE_PATTERN_GLOBAL","ContentFilterExecutor","getFlowBuilderPlugin","ContentFieldsBase","botContext","content","flowBuilderPlugin","contentFilters","contentFilterExecutor","filteredContent","locale","text","result","t","asset","i","video","v","queues","queue","match","keyPath","botVariable","String","name","contact","object","key","undefined","validTypes","id"],"mappings":";;;;;;;AAIqB;AAC6B;AACqB;AAUhE,MAAeI,iBAAiBA;IAUrC,MAAM,cACJC,UAAsB,EACtBC,OAAoB,EACE;QACtB,MAAMC,oBAAoBJ,oBAAoBA,CAACE,WAAW,OAAO;QACjE,MAAMG,iBAAiBD,kBAAkB,cAAc;QACvD,MAAME,wBAAwB,IAAIP,qBAAqBA,CAAC;YACtD,SAASM;QACX;QACA,MAAME,kBAAkB,MAAMD,sBAAsB,MAAM,CACxDJ,YACAC;QAEF,OAAOI;IACT;IAEA,OAAO,gBAAgBC,MAAc,EAAEC,IAAoB,EAAU;QACnE,MAAMC,SAASD,KAAK,IAAI,CAACE,CAAAA,IAAKA,EAAE,MAAM,KAAKH;QAC3C,OAAOE,QAAQ,WAAW;IAC5B;IAEA,OAAO,iBAAiBF,MAAc,EAAEI,KAA0B,EAAU;QAC1E,MAAMF,SAASE,MAAM,IAAI,CAACC,CAAAA,IAAKA,EAAE,MAAM,KAAKL;QAC5C,OAAOE,QAAQ,QAAQ;IACzB;IAEA,OAAO,iBAAiBF,MAAc,EAAEM,KAAsB,EAAU;QACtE,MAAMJ,SAASI,MAAM,IAAI,CAACC,CAAAA,IAAKA,EAAE,MAAM,KAAKP;QAC5C,OAAOE,QAAQ,OAAO;IACxB;IAEA,OAAO,iBACLF,MAAc,EACdQ,MAAuB,EACI;QAC3B,OAAOA,OAAO,IAAI,CAACC,CAAAA,QAASA,MAAM,MAAM,KAAKT;IAC/C;IAEA,iBAAiBC,IAAY,EAAEP,UAAsB,EAAU;QA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YAA4BQ,EAAU,CAAE;aAAZA,KAAAA;IAAa;AA8F3C"}
@@ -1,15 +0,0 @@
1
- import { BooleanConditionOperator, type HtBooleanCondition, type HtNumberCondition, type HtStringCondition, NumberConditionOperator, StringConditionOperator } from '../hubtype-fields/index.js';
2
- type StringEvaluator = (variable: string, value: string) => boolean;
3
- type NumberEvaluator = (variable: number, value: number, condition: HtNumberCondition) => boolean;
4
- type BooleanEvaluator = (variable: boolean) => boolean;
5
- export declare function getMinAndMax(condition: HtNumberCondition): {
6
- min: number;
7
- max: number;
8
- };
9
- export declare const STRING_CONDITION_EVALUATORS: Record<StringConditionOperator, StringEvaluator>;
10
- export declare const NUMBER_CONDITION_EVALUATORS: Record<NumberConditionOperator, NumberEvaluator>;
11
- export declare const BOOLEAN_CONDITION_EVALUATORS: Record<BooleanConditionOperator, BooleanEvaluator>;
12
- export declare function evaluateStringCondition(variable: string, condition: HtStringCondition): boolean;
13
- export declare function evaluateNumberCondition(variable: number, condition: HtNumberCondition): boolean;
14
- export declare function evaluateBooleanCondition(variable: boolean, condition: HtBooleanCondition): boolean;
15
- export {};
@@ -1,73 +0,0 @@
1
- import { BooleanConditionOperator, NumberConditionOperator, StringConditionOperator } from "../hubtype-fields/index.js";
2
-
3
-
4
-
5
- function getMinAndMax(condition) {
6
- if (condition.min !== undefined && condition.max !== undefined) {
7
- return {
8
- min: condition.min,
9
- max: condition.max
10
- };
11
- }
12
- throw new Error(`Min or max not found for number condition ${condition.operator}`);
13
- }
14
- const STRING_CONDITION_EVALUATORS = {
15
- [StringConditionOperator.Contains]: (variable, value)=>variable.includes(value),
16
- [StringConditionOperator.NotContains]: (variable, value)=>!variable.includes(value),
17
- [StringConditionOperator.EqualsTo]: (variable, value)=>variable === value,
18
- [StringConditionOperator.NotEqualsTo]: (variable, value)=>variable !== value,
19
- [StringConditionOperator.StartsWith]: (variable, value)=>variable.startsWith(value),
20
- [StringConditionOperator.NotStartsWith]: (variable, value)=>!variable.startsWith(value),
21
- [StringConditionOperator.EndsWith]: (variable, value)=>variable.endsWith(value),
22
- [StringConditionOperator.NotEndsWith]: (variable, value)=>!variable.endsWith(value)
23
- };
24
- const NUMBER_CONDITION_EVALUATORS = {
25
- [NumberConditionOperator.EqualsTo]: (variable, value)=>variable === value,
26
- [NumberConditionOperator.NotEqualsTo]: (variable, value)=>variable !== value,
27
- [NumberConditionOperator.GreaterThan]: (variable, value)=>variable > value,
28
- [NumberConditionOperator.LessThan]: (variable, value)=>variable < value,
29
- [NumberConditionOperator.GreaterThanOrEqualTo]: (variable, value)=>variable >= value,
30
- [NumberConditionOperator.LessThanOrEqualTo]: (variable, value)=>variable <= value,
31
- [NumberConditionOperator.Between]: (variable, _value, condition)=>{
32
- const { min, max } = getMinAndMax(condition);
33
- return variable >= min && variable <= max;
34
- },
35
- [NumberConditionOperator.NotBetween]: (variable, _value, condition)=>{
36
- const { min, max } = getMinAndMax(condition);
37
- return variable < min || variable > max;
38
- }
39
- };
40
- const BOOLEAN_CONDITION_EVALUATORS = {
41
- [BooleanConditionOperator.IsTruthy]: (variable)=>!!variable
42
- };
43
- function evaluateStringCondition(variable, condition) {
44
- if (condition.value === undefined) {
45
- throw new Error(`Value not found for string condition ${condition.operator}`);
46
- }
47
- const evaluator = STRING_CONDITION_EVALUATORS[condition.operator];
48
- if (!evaluator) {
49
- throw new Error(`Invalid string condition operator ${condition.operator}`);
50
- }
51
- return evaluator(variable, condition.value);
52
- }
53
- function evaluateNumberCondition(variable, condition) {
54
- if (condition.value === undefined) {
55
- throw new Error(`Value not found for number condition ${condition.operator}`);
56
- }
57
- const evaluator = NUMBER_CONDITION_EVALUATORS[condition.operator];
58
- if (!evaluator) {
59
- throw new Error(`Invalid number condition operator ${condition.operator}`);
60
- }
61
- return evaluator(variable, condition.value, condition);
62
- }
63
- function evaluateBooleanCondition(variable, condition) {
64
- const evaluator = BOOLEAN_CONDITION_EVALUATORS[condition.operator];
65
- if (!evaluator) {
66
- throw new Error(`Invalid boolean condition operator ${condition.operator}`);
67
- }
68
- return evaluator(variable);
69
- }
70
-
71
- export { BOOLEAN_CONDITION_EVALUATORS, NUMBER_CONDITION_EVALUATORS, STRING_CONDITION_EVALUATORS, evaluateBooleanCondition, evaluateNumberCondition, evaluateStringCondition, getMinAndMax };
72
-
73
- //# sourceMappingURL=custom-conditional-v2-evaluators.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"content-fields/custom-conditional/custom-conditional-v2-evaluators.js","sources":["../../../src/content-fields/custom-conditional/custom-conditional-v2-evaluators.ts"],"sourcesContent":["import {\n BooleanConditionOperator,\n type HtBooleanCondition,\n type HtNumberCondition,\n type HtStringCondition,\n NumberConditionOperator,\n StringConditionOperator,\n} from '../hubtype-fields'\n\ntype StringEvaluator = (variable: string, value: string) => boolean\n\ntype NumberEvaluator = (\n variable: number,\n value: number,\n condition: HtNumberCondition\n) => boolean\n\ntype BooleanEvaluator = (variable: boolean) => boolean\n\nexport function getMinAndMax(condition: HtNumberCondition): {\n min: number\n max: number\n} {\n if (condition.min !== undefined && condition.max !== undefined) {\n return { min: condition.min, max: condition.max }\n }\n throw new Error(\n `Min or max not found for number condition ${condition.operator}`\n )\n}\n\nexport const STRING_CONDITION_EVALUATORS: Record<\n StringConditionOperator,\n StringEvaluator\n> = {\n [StringConditionOperator.Contains]: (variable, value) =>\n variable.includes(value),\n [StringConditionOperator.NotContains]: (variable, value) =>\n !variable.includes(value),\n [StringConditionOperator.EqualsTo]: (variable, value) => variable === value,\n [StringConditionOperator.NotEqualsTo]: (variable, value) =>\n variable !== value,\n [StringConditionOperator.StartsWith]: (variable, value) =>\n variable.startsWith(value),\n [StringConditionOperator.NotStartsWith]: (variable, value) =>\n !variable.startsWith(value),\n [StringConditionOperator.EndsWith]: (variable, value) =>\n variable.endsWith(value),\n [StringConditionOperator.NotEndsWith]: (variable, value) =>\n !variable.endsWith(value),\n}\n\nexport const NUMBER_CONDITION_EVALUATORS: Record<\n NumberConditionOperator,\n NumberEvaluator\n> = {\n [NumberConditionOperator.EqualsTo]: (variable, value) => variable === value,\n [NumberConditionOperator.NotEqualsTo]: (variable, value) =>\n variable !== value,\n [NumberConditionOperator.GreaterThan]: (variable, value) => variable > value,\n [NumberConditionOperator.LessThan]: (variable, value) => variable < value,\n [NumberConditionOperator.GreaterThanOrEqualTo]: (variable, value) =>\n variable >= value,\n [NumberConditionOperator.LessThanOrEqualTo]: (variable, value) =>\n variable <= value,\n [NumberConditionOperator.Between]: (variable, _value, condition) => {\n const { min, max } = getMinAndMax(condition)\n return variable >= min && variable <= max\n },\n [NumberConditionOperator.NotBetween]: (variable, _value, condition) => {\n const { min, max } = getMinAndMax(condition)\n return variable < min || variable > max\n },\n}\n\nexport const BOOLEAN_CONDITION_EVALUATORS: Record<\n BooleanConditionOperator,\n BooleanEvaluator\n> = {\n [BooleanConditionOperator.IsTruthy]: variable => !!variable,\n}\n\nexport function evaluateStringCondition(\n variable: string,\n condition: HtStringCondition\n): boolean {\n if (condition.value === undefined) {\n throw new Error(\n `Value not found for string condition ${condition.operator}`\n )\n }\n const evaluator = STRING_CONDITION_EVALUATORS[condition.operator]\n if (!evaluator) {\n throw new Error(`Invalid string condition operator ${condition.operator}`)\n }\n return evaluator(variable, condition.value)\n}\n\nexport function evaluateNumberCondition(\n variable: number,\n condition: HtNumberCondition\n): boolean {\n if (condition.value === undefined) {\n throw new Error(\n `Value not found for number condition ${condition.operator}`\n )\n }\n const evaluator = NUMBER_CONDITION_EVALUATORS[condition.operator]\n if (!evaluator) {\n throw new Error(`Invalid number condition operator ${condition.operator}`)\n }\n return evaluator(variable, condition.value, condition)\n}\n\nexport function evaluateBooleanCondition(\n variable: boolean,\n condition: HtBooleanCondition\n): boolean {\n const evaluator = BOOLEAN_CONDITION_EVALUATORS[condition.operator]\n if (!evaluator) {\n throw new Error(`Invalid boolean condition operator ${condition.operator}`)\n }\n return evaluator(variable)\n}\n"],"names":["BooleanConditionOperator","NumberConditionOperator","StringConditionOperator","getMinAndMax","condition","undefined","Error","STRING_CONDITION_EVALUATORS","variable","value","NUMBER_CONDITION_EVALUATORS","_value","min","max","BOOLEAN_CONDITION_EVALUATORS","evaluateStringCondition","evaluator","evaluateNumberCondition","evaluateBooleanCondition"],"mappings":";;;AAO0B;AAYnB,SAASG,YAAYA,CAACC,SAA4B;IAIvD,IAAIA,UAAU,GAAG,KAAKC,aAAaD,UAAU,GAAG,KAAKC,WAAW;QAC9D,OAAO;YAAE,KAAKD,UAAU,GAAG;YAAE,KAAKA,UAAU,GAAG;QAAC;IAClD;IACA,MAAM,IAAIE,MACR,CAAC,0CAA0C,EAAEF,UAAU,QAAQ,EAAE;AAErE;AAEO,MAAMG,2BAA2BA,GAGpC;IACF,CAACL,gCAAgC,CAAC,EAAE,CAACM,UAAUC,QAC7CD,SAAS,QAAQ,CAACC;IACpB,CAACP,mCAAmC,CAAC,EAAE,CAACM,UAAUC,QAChD,CAACD,SAAS,QAAQ,CAACC;IACrB,CAACP,gCAAgC,CAAC,EAAE,CAACM,UAAUC,QAAUD,aAAaC;IACtE,CAACP,mCAAmC,CAAC,EAAE,CAACM,UAAUC,QAChDD,aAAaC;IACf,CAACP,kCAAkC,CAAC,EAAE,CAACM,UAAUC,QAC/CD,SAAS,UAAU,CAACC;IACtB,CAACP,qCAAqC,CAAC,EAAE,CAACM,UAAUC,QAClD,CAACD,SAAS,UAAU,CAACC;IACvB,CAACP,gCAAgC,CAAC,EAAE,CAACM,UAAUC,QAC7CD,SAAS,QAAQ,CAACC;IACpB,CAACP,mCAAmC,CAAC,EAAE,CAACM,UAAUC,QAChD,CAACD,SAAS,QAAQ,CAACC;AACvB,EAAC;AAEM,MAAMC,2BAA2BA,GAGpC;IACF,CAACT,gCAAgC,CAAC,EAAE,CAACO,UAAUC,QAAUD,aAAaC;IACtE,CAACR,mCAAmC,CAAC,EAAE,CAACO,UAAUC,QAChDD,aAAaC;IACf,CAACR,mCAAmC,CAAC,EAAE,CAACO,UAAUC,QAAUD,WAAWC;IACvE,CAACR,gCAAgC,CAAC,EAA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U,QAAQ,EAAE;IAC3E;IACA,OAAOY,UAAUR,UAAUJ,UAAU,KAAK,EAAEA;AAC9C;AAEO,SAASc,wBAAwBA,CACtCV,QAAiB,EACjBJ,SAA6B;IAE7B,MAAMY,YAAYF,4BAA4B,CAACV,UAAU,QAAQ,CAAC;IAClE,IAAI,CAACY,WAAW;QACd,MAAM,IAAIV,MAAM,CAAC,mCAAmC,EAAEF,UAAU,QAAQ,EAAE;IAC5E;IACA,OAAOY,UAAUR;AACnB"}
@@ -1,9 +0,0 @@
1
- import { type HtCondition, type HtNodeLink, VariableFormat } from '../hubtype-fields/index.js';
2
- export type ConditionMatch = {
3
- customResult: string;
4
- target: HtNodeLink;
5
- operator: string;
6
- };
7
- export declare function getConditionCustomResult(condition: HtCondition, variableFormat: VariableFormat): string;
8
- export declare function findLastMatchingCondition<T extends HtCondition>(conditions: T[], variable: unknown, variableFormat: VariableFormat, evaluate: (variable: unknown, condition: T) => boolean): ConditionMatch | undefined;
9
- export declare function resolveWithDefaultTarget(match: ConditionMatch | undefined, defaultTarget: HtNodeLink, nodeCode: string, defaultCustomResult?: string): ConditionMatch;
@@ -1,58 +0,0 @@
1
- import { NumberConditionOperator, VariableFormat } from "../hubtype-fields/index.js";
2
-
3
-
4
-
5
- function getConditionCustomResult(condition, variableFormat) {
6
- switch(variableFormat){
7
- case VariableFormat.String:
8
- return String(condition.value);
9
- case VariableFormat.Number:
10
- return getNumberConditionCustomResult(condition);
11
- case VariableFormat.Boolean:
12
- // Only reached after evaluateBooleanCondition succeeds; today that is isTruthy → 'true'
13
- return 'true';
14
- default:
15
- throw new Error(`Invalid variable format ${variableFormat}`);
16
- }
17
- }
18
- function getNumberConditionCustomResult(condition) {
19
- const numberCondition = condition;
20
- if (numberCondition.operator === NumberConditionOperator.Between || numberCondition.operator === NumberConditionOperator.NotBetween) {
21
- return `min: ${numberCondition.min} - max: ${numberCondition.max}`;
22
- }
23
- return String(numberCondition.value);
24
- }
25
- function findLastMatchingCondition(conditions, variable, variableFormat, evaluate) {
26
- let lastMatch;
27
- for (const condition of conditions){
28
- if (!evaluate(variable, condition)) {
29
- continue;
30
- }
31
- if (!condition.target) {
32
- continue;
33
- }
34
- lastMatch = {
35
- customResult: getConditionCustomResult(condition, variableFormat),
36
- target: condition.target,
37
- operator: condition.operator
38
- };
39
- }
40
- return lastMatch;
41
- }
42
- function resolveWithDefaultTarget(match, defaultTarget, nodeCode, defaultCustomResult = 'default') {
43
- if (match) {
44
- return match;
45
- }
46
- if (!defaultTarget) {
47
- throw new Error(`Default target not found for custom condition node ${nodeCode}`);
48
- }
49
- return {
50
- customResult: defaultCustomResult,
51
- target: defaultTarget,
52
- operator: ''
53
- };
54
- }
55
-
56
- export { findLastMatchingCondition, getConditionCustomResult, resolveWithDefaultTarget };
57
-
58
- //# sourceMappingURL=custom-conditional-v2-resolver.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"content-fields/custom-conditional/custom-conditional-v2-resolver.js","sources":["../../../src/content-fields/custom-conditional/custom-conditional-v2-resolver.ts"],"sourcesContent":["import {\n type HtCondition,\n type HtNodeLink,\n type HtNumberCondition,\n type HtStringCondition,\n NumberConditionOperator,\n VariableFormat,\n} from '../hubtype-fields'\n\nexport type ConditionMatch = {\n customResult: string\n target: HtNodeLink\n operator: string\n}\n\nexport function getConditionCustomResult(\n condition: HtCondition,\n variableFormat: VariableFormat\n): string {\n switch (variableFormat) {\n case VariableFormat.String:\n return String((condition as HtStringCondition).value)\n case VariableFormat.Number:\n return getNumberConditionCustomResult(condition as HtNumberCondition)\n case VariableFormat.Boolean:\n // Only reached after evaluateBooleanCondition succeeds; today that is isTruthy → 'true'\n return 'true'\n default:\n throw new Error(`Invalid variable format ${variableFormat}`)\n }\n}\n\nfunction getNumberConditionCustomResult(condition: HtNumberCondition): string {\n const numberCondition = condition as HtNumberCondition\n if (\n numberCondition.operator === NumberConditionOperator.Between ||\n numberCondition.operator === NumberConditionOperator.NotBetween\n ) {\n return `min: ${numberCondition.min} - max: ${numberCondition.max}`\n }\n return String(numberCondition.value)\n}\n\nexport function findLastMatchingCondition<T extends HtCondition>(\n conditions: T[],\n variable: unknown,\n variableFormat: VariableFormat,\n evaluate: (variable: unknown, condition: T) => boolean\n): ConditionMatch | undefined {\n let lastMatch: ConditionMatch | undefined\n\n for (const condition of conditions) {\n if (!evaluate(variable, condition)) {\n continue\n }\n\n if (!condition.target) {\n continue\n }\n\n lastMatch = {\n customResult: getConditionCustomResult(condition, variableFormat),\n target: condition.target,\n operator: condition.operator,\n }\n }\n\n return lastMatch\n}\n\nexport function resolveWithDefaultTarget(\n match: ConditionMatch | undefined,\n defaultTarget: HtNodeLink,\n nodeCode: string,\n defaultCustomResult: string = 'default'\n): ConditionMatch {\n if (match) {\n return match\n }\n\n if (!defaultTarget) {\n throw new Error(\n `Default target not found for custom condition node ${nodeCode}`\n )\n }\n\n return {\n customResult: defaultCustomResult,\n target: defaultTarget,\n operator: '',\n }\n}\n"],"names":["NumberConditionOperator","VariableFormat","getConditionCustomResult","condition","variableFormat","String","getNumberConditionCustomResult","Error","numberCondition","findLastMatchingCondition","conditions","variable","evaluate","lastMatch","resolveWithDefaultTarget","match","defaultTarget","nodeCode","defaultCustomResult"],"mappings":";;;AAO0B;AAQnB,SAASE,wBAAwBA,CACtCC,SAAsB,EACtBC,cAA8B;IAE9B,OAAQA;QACN,KAAKH,qBAAqB;YACxB,OAAOI,OAAQF,UAAgC,KAAK;QACtD,KAAKF,qBAAqB;YACxB,OAAOK,8BAA8BA,CAACH;QACxC,KAAKF,sBAAsB;YACzB,wFAAwF;YACxF,OAAO;QACT;YACE,MAAM,IAAIM,MAAM,CAAC,wBAAwB,EAAEH,gBAAgB;IAC/D;AACF;AAEA,SAASE,8BAA8BA,CAACH,SAA4B;IAClE,MAAMK,kBAAkBL;IACxB,IACEK,gBAAgB,QAAQ,KAAKR,+BAA+B,IAC5DQ,gBAAgB,QAAQ,KAAKR,kCAAkC,EAC/D;QACA,OAAO,CAAC,KAAK,EAAEQ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