@nyaruka/temba-components 0.131.1 → 0.131.2

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 (427) hide show
  1. package/.github/workflows/publish.yml +4 -1
  2. package/CHANGELOG.md +61 -1
  3. package/demo/data/flows/food-order.json +2 -2
  4. package/demo/data/flows/sample-flow.json +74 -125
  5. package/dist/static/svg/index.svg +1 -1
  6. package/dist/temba-components.js +1155 -618
  7. package/dist/temba-components.js.map +1 -1
  8. package/out-tsc/src/Icons.js +4 -1
  9. package/out-tsc/src/Icons.js.map +1 -1
  10. package/out-tsc/src/events.js.map +1 -1
  11. package/out-tsc/src/flow/CanvasMenu.js +200 -0
  12. package/out-tsc/src/flow/CanvasMenu.js.map +1 -0
  13. package/out-tsc/src/flow/CanvasNode.js +327 -19
  14. package/out-tsc/src/flow/CanvasNode.js.map +1 -1
  15. package/out-tsc/src/flow/Editor.js +562 -66
  16. package/out-tsc/src/flow/Editor.js.map +1 -1
  17. package/out-tsc/src/flow/NodeEditor.js +240 -93
  18. package/out-tsc/src/flow/NodeEditor.js.map +1 -1
  19. package/out-tsc/src/flow/NodeTypeSelector.js +499 -0
  20. package/out-tsc/src/flow/NodeTypeSelector.js.map +1 -0
  21. package/out-tsc/src/flow/actions/add_contact_groups.js +3 -3
  22. package/out-tsc/src/flow/actions/add_contact_groups.js.map +1 -1
  23. package/out-tsc/src/flow/actions/add_contact_urn.js +62 -4
  24. package/out-tsc/src/flow/actions/add_contact_urn.js.map +1 -1
  25. package/out-tsc/src/flow/actions/add_input_labels.js +3 -3
  26. package/out-tsc/src/flow/actions/add_input_labels.js.map +1 -1
  27. package/out-tsc/src/flow/actions/play_audio.js +2 -2
  28. package/out-tsc/src/flow/actions/play_audio.js.map +1 -1
  29. package/out-tsc/src/flow/actions/remove_contact_groups.js +6 -5
  30. package/out-tsc/src/flow/actions/remove_contact_groups.js.map +1 -1
  31. package/out-tsc/src/flow/actions/request_optin.js +2 -2
  32. package/out-tsc/src/flow/actions/request_optin.js.map +1 -1
  33. package/out-tsc/src/flow/actions/say_msg.js +2 -2
  34. package/out-tsc/src/flow/actions/say_msg.js.map +1 -1
  35. package/out-tsc/src/flow/actions/send_broadcast.js +76 -23
  36. package/out-tsc/src/flow/actions/send_broadcast.js.map +1 -1
  37. package/out-tsc/src/flow/actions/send_email.js +4 -5
  38. package/out-tsc/src/flow/actions/send_email.js.map +1 -1
  39. package/out-tsc/src/flow/actions/send_msg.js +9 -19
  40. package/out-tsc/src/flow/actions/send_msg.js.map +1 -1
  41. package/out-tsc/src/flow/actions/set_contact_channel.js +5 -9
  42. package/out-tsc/src/flow/actions/set_contact_channel.js.map +1 -1
  43. package/out-tsc/src/flow/actions/set_contact_field.js +19 -20
  44. package/out-tsc/src/flow/actions/set_contact_field.js.map +1 -1
  45. package/out-tsc/src/flow/actions/set_contact_language.js +2 -2
  46. package/out-tsc/src/flow/actions/set_contact_language.js.map +1 -1
  47. package/out-tsc/src/flow/actions/set_contact_name.js +2 -12
  48. package/out-tsc/src/flow/actions/set_contact_name.js.map +1 -1
  49. package/out-tsc/src/flow/actions/set_contact_status.js +2 -2
  50. package/out-tsc/src/flow/actions/set_contact_status.js.map +1 -1
  51. package/out-tsc/src/flow/actions/set_run_result.js +3 -3
  52. package/out-tsc/src/flow/actions/set_run_result.js.map +1 -1
  53. package/out-tsc/src/flow/actions/start_session.js +180 -6
  54. package/out-tsc/src/flow/actions/start_session.js.map +1 -1
  55. package/out-tsc/src/flow/config.js +11 -15
  56. package/out-tsc/src/flow/config.js.map +1 -1
  57. package/out-tsc/src/flow/currencies.js +45 -0
  58. package/out-tsc/src/flow/currencies.js.map +1 -0
  59. package/out-tsc/src/flow/nodes/shared-rules.js +257 -0
  60. package/out-tsc/src/flow/nodes/shared-rules.js.map +1 -0
  61. package/out-tsc/src/flow/nodes/shared.js +17 -0
  62. package/out-tsc/src/flow/nodes/shared.js.map +1 -0
  63. package/out-tsc/src/flow/nodes/split_by_airtime.js +205 -5
  64. package/out-tsc/src/flow/nodes/split_by_airtime.js.map +1 -1
  65. package/out-tsc/src/flow/nodes/split_by_contact_field.js +147 -3
  66. package/out-tsc/src/flow/nodes/split_by_contact_field.js.map +1 -1
  67. package/out-tsc/src/flow/nodes/split_by_expression.js +68 -2
  68. package/out-tsc/src/flow/nodes/split_by_expression.js.map +1 -1
  69. package/out-tsc/src/flow/nodes/split_by_groups.js +12 -9
  70. package/out-tsc/src/flow/nodes/split_by_groups.js.map +1 -1
  71. package/out-tsc/src/flow/nodes/split_by_intent.js +7 -0
  72. package/out-tsc/src/flow/nodes/split_by_intent.js.map +1 -0
  73. package/out-tsc/src/flow/nodes/split_by_llm.js +3 -2
  74. package/out-tsc/src/flow/nodes/split_by_llm.js.map +1 -1
  75. package/out-tsc/src/flow/nodes/split_by_llm_categorize.js +2 -2
  76. package/out-tsc/src/flow/nodes/split_by_llm_categorize.js.map +1 -1
  77. package/out-tsc/src/flow/nodes/split_by_random.js +3 -3
  78. package/out-tsc/src/flow/nodes/split_by_random.js.map +1 -1
  79. package/out-tsc/src/flow/nodes/split_by_resthook.js +108 -0
  80. package/out-tsc/src/flow/nodes/split_by_resthook.js.map +1 -0
  81. package/out-tsc/src/flow/nodes/split_by_run_result.js +206 -3
  82. package/out-tsc/src/flow/nodes/split_by_run_result.js.map +1 -1
  83. package/out-tsc/src/flow/nodes/split_by_scheme.js +153 -2
  84. package/out-tsc/src/flow/nodes/split_by_scheme.js.map +1 -1
  85. package/out-tsc/src/flow/nodes/split_by_subflow.js +6 -4
  86. package/out-tsc/src/flow/nodes/split_by_subflow.js.map +1 -1
  87. package/out-tsc/src/flow/nodes/split_by_ticket.js +3 -2
  88. package/out-tsc/src/flow/nodes/split_by_ticket.js.map +1 -1
  89. package/out-tsc/src/flow/nodes/split_by_webhook.js +3 -2
  90. package/out-tsc/src/flow/nodes/split_by_webhook.js.map +1 -1
  91. package/out-tsc/src/flow/nodes/wait_for_audio.js +2 -2
  92. package/out-tsc/src/flow/nodes/wait_for_audio.js.map +1 -1
  93. package/out-tsc/src/flow/nodes/wait_for_digits.js +2 -2
  94. package/out-tsc/src/flow/nodes/wait_for_digits.js.map +1 -1
  95. package/out-tsc/src/flow/nodes/wait_for_image.js +2 -2
  96. package/out-tsc/src/flow/nodes/wait_for_image.js.map +1 -1
  97. package/out-tsc/src/flow/nodes/wait_for_location.js +2 -2
  98. package/out-tsc/src/flow/nodes/wait_for_location.js.map +1 -1
  99. package/out-tsc/src/flow/nodes/wait_for_menu.js +2 -2
  100. package/out-tsc/src/flow/nodes/wait_for_menu.js.map +1 -1
  101. package/out-tsc/src/flow/nodes/wait_for_response.js +32 -567
  102. package/out-tsc/src/flow/nodes/wait_for_response.js.map +1 -1
  103. package/out-tsc/src/flow/nodes/wait_for_video.js +2 -2
  104. package/out-tsc/src/flow/nodes/wait_for_video.js.map +1 -1
  105. package/out-tsc/src/flow/types.js +71 -12
  106. package/out-tsc/src/flow/types.js.map +1 -1
  107. package/out-tsc/src/flow/utils.js +101 -14
  108. package/out-tsc/src/flow/utils.js.map +1 -1
  109. package/out-tsc/src/form/FieldRenderer.js +2 -4
  110. package/out-tsc/src/form/FieldRenderer.js.map +1 -1
  111. package/out-tsc/src/interfaces.js +3 -0
  112. package/out-tsc/src/interfaces.js.map +1 -1
  113. package/out-tsc/src/list/SortableList.js +98 -33
  114. package/out-tsc/src/list/SortableList.js.map +1 -1
  115. package/out-tsc/src/live/ContactChat.js +15 -18
  116. package/out-tsc/src/live/ContactChat.js.map +1 -1
  117. package/out-tsc/src/store/AppState.js +53 -0
  118. package/out-tsc/src/store/AppState.js.map +1 -1
  119. package/out-tsc/src/utils.js +254 -13
  120. package/out-tsc/src/utils.js.map +1 -1
  121. package/out-tsc/temba-modules.js +4 -0
  122. package/out-tsc/temba-modules.js.map +1 -1
  123. package/out-tsc/test/ActionHelper.js +3 -3
  124. package/out-tsc/test/ActionHelper.js.map +1 -1
  125. package/out-tsc/test/NodeHelper.js +6 -3
  126. package/out-tsc/test/NodeHelper.js.map +1 -1
  127. package/out-tsc/test/actions/add_contact_urn.test.js +202 -0
  128. package/out-tsc/test/actions/add_contact_urn.test.js.map +1 -0
  129. package/out-tsc/test/actions/send_broadcast.test.js +148 -0
  130. package/out-tsc/test/actions/send_broadcast.test.js.map +1 -0
  131. package/out-tsc/test/actions/send_email.test.js +17 -23
  132. package/out-tsc/test/actions/send_email.test.js.map +1 -1
  133. package/out-tsc/test/actions/send_msg.test.js +33 -15
  134. package/out-tsc/test/actions/send_msg.test.js.map +1 -1
  135. package/out-tsc/test/actions/start_session.test.js +116 -0
  136. package/out-tsc/test/actions/start_session.test.js.map +1 -0
  137. package/out-tsc/test/nodes/split_by_airtime.test.js +604 -0
  138. package/out-tsc/test/nodes/split_by_airtime.test.js.map +1 -0
  139. package/out-tsc/test/nodes/split_by_contact_field.test.js +387 -0
  140. package/out-tsc/test/nodes/split_by_contact_field.test.js.map +1 -0
  141. package/out-tsc/test/nodes/split_by_expression.test.js +614 -0
  142. package/out-tsc/test/nodes/split_by_expression.test.js.map +1 -0
  143. package/out-tsc/test/nodes/split_by_random.test.js +3 -3
  144. package/out-tsc/test/nodes/split_by_random.test.js.map +1 -1
  145. package/out-tsc/test/nodes/split_by_resthook.test.js +337 -0
  146. package/out-tsc/test/nodes/split_by_resthook.test.js.map +1 -0
  147. package/out-tsc/test/nodes/split_by_run_result.test.js +920 -0
  148. package/out-tsc/test/nodes/split_by_run_result.test.js.map +1 -0
  149. package/out-tsc/test/nodes/split_by_scheme.test.js +399 -0
  150. package/out-tsc/test/nodes/split_by_scheme.test.js.map +1 -0
  151. package/out-tsc/test/nodes/split_by_subflow.test.js +333 -0
  152. package/out-tsc/test/nodes/split_by_subflow.test.js.map +1 -0
  153. package/out-tsc/test/nodes/wait_for_digits.test.js +2 -2
  154. package/out-tsc/test/nodes/wait_for_digits.test.js.map +1 -1
  155. package/out-tsc/test/nodes/wait_for_response.test.js +2 -1
  156. package/out-tsc/test/nodes/wait_for_response.test.js.map +1 -1
  157. package/out-tsc/test/temba-action-drag-between-nodes.test.js +252 -0
  158. package/out-tsc/test/temba-action-drag-between-nodes.test.js.map +1 -0
  159. package/out-tsc/test/temba-canvas-menu.test.js +122 -0
  160. package/out-tsc/test/temba-canvas-menu.test.js.map +1 -0
  161. package/out-tsc/test/temba-flow-editor-node.test.js +85 -2
  162. package/out-tsc/test/temba-flow-editor-node.test.js.map +1 -1
  163. package/out-tsc/test/temba-flow-editor.test.js +7 -8
  164. package/out-tsc/test/temba-flow-editor.test.js.map +1 -1
  165. package/out-tsc/test/temba-node-editor.test.js +3 -1
  166. package/out-tsc/test/temba-node-editor.test.js.map +1 -1
  167. package/out-tsc/test/temba-node-type-selector.test.js +115 -0
  168. package/out-tsc/test/temba-node-type-selector.test.js.map +1 -0
  169. package/out-tsc/test/temba-omnibox.test.js +2 -1
  170. package/out-tsc/test/temba-omnibox.test.js.map +1 -1
  171. package/out-tsc/test/temba-sortable-list.test.js +51 -0
  172. package/out-tsc/test/temba-sortable-list.test.js.map +1 -1
  173. package/out-tsc/test/temba-utils-index.test.js +1 -27
  174. package/out-tsc/test/temba-utils-index.test.js.map +1 -1
  175. package/out-tsc/test/utils.test.js +2 -0
  176. package/out-tsc/test/utils.test.js.map +1 -1
  177. package/package.json +2 -1
  178. package/screenshots/truth/actions/add_contact_groups/editor/descriptive-group-names.png +0 -0
  179. package/screenshots/truth/actions/add_contact_groups/editor/long-group-names.png +0 -0
  180. package/screenshots/truth/actions/add_contact_groups/editor/many-groups.png +0 -0
  181. package/screenshots/truth/actions/add_contact_groups/editor/multiple-groups.png +0 -0
  182. package/screenshots/truth/actions/add_contact_groups/editor/single-group.png +0 -0
  183. package/screenshots/truth/actions/add_contact_groups/render/descriptive-group-names.png +0 -0
  184. package/screenshots/truth/actions/add_contact_groups/render/long-group-names.png +0 -0
  185. package/screenshots/truth/actions/add_contact_groups/render/many-groups.png +0 -0
  186. package/screenshots/truth/actions/add_contact_groups/render/multiple-groups.png +0 -0
  187. package/screenshots/truth/actions/add_contact_groups/render/single-group.png +0 -0
  188. package/screenshots/truth/actions/add_contact_urn/editor/expression-facebook.png +0 -0
  189. package/screenshots/truth/actions/add_contact_urn/editor/expression-phone.png +0 -0
  190. package/screenshots/truth/actions/add_contact_urn/editor/facebook-id.png +0 -0
  191. package/screenshots/truth/actions/add_contact_urn/editor/instagram-handle.png +0 -0
  192. package/screenshots/truth/actions/add_contact_urn/editor/line-id.png +0 -0
  193. package/screenshots/truth/actions/add_contact_urn/editor/phone-number.png +0 -0
  194. package/screenshots/truth/actions/add_contact_urn/editor/telegram-id.png +0 -0
  195. package/screenshots/truth/actions/add_contact_urn/editor/viber-id.png +0 -0
  196. package/screenshots/truth/actions/add_contact_urn/editor/wechat-id.png +0 -0
  197. package/screenshots/truth/actions/add_contact_urn/editor/whatsapp.png +0 -0
  198. package/screenshots/truth/actions/add_contact_urn/render/expression-facebook.png +0 -0
  199. package/screenshots/truth/actions/add_contact_urn/render/expression-phone.png +0 -0
  200. package/screenshots/truth/actions/add_contact_urn/render/facebook-id.png +0 -0
  201. package/screenshots/truth/actions/add_contact_urn/render/instagram-handle.png +0 -0
  202. package/screenshots/truth/actions/add_contact_urn/render/line-id.png +0 -0
  203. package/screenshots/truth/actions/add_contact_urn/render/phone-number.png +0 -0
  204. package/screenshots/truth/actions/add_contact_urn/render/telegram-id.png +0 -0
  205. package/screenshots/truth/actions/add_contact_urn/render/viber-id.png +0 -0
  206. package/screenshots/truth/actions/add_contact_urn/render/wechat-id.png +0 -0
  207. package/screenshots/truth/actions/add_contact_urn/render/whatsapp.png +0 -0
  208. package/screenshots/truth/actions/remove_contact_groups/editor/cleanup-groups.png +0 -0
  209. package/screenshots/truth/actions/remove_contact_groups/editor/long-descriptive-group-names.png +0 -0
  210. package/screenshots/truth/actions/remove_contact_groups/editor/many-groups.png +0 -0
  211. package/screenshots/truth/actions/remove_contact_groups/editor/multiple-groups.png +0 -0
  212. package/screenshots/truth/actions/remove_contact_groups/editor/remove-from-all-groups.png +0 -0
  213. package/screenshots/truth/actions/remove_contact_groups/editor/single-group.png +0 -0
  214. package/screenshots/truth/actions/remove_contact_groups/render/cleanup-groups.png +0 -0
  215. package/screenshots/truth/actions/remove_contact_groups/render/long-descriptive-group-names.png +0 -0
  216. package/screenshots/truth/actions/remove_contact_groups/render/many-groups.png +0 -0
  217. package/screenshots/truth/actions/remove_contact_groups/render/multiple-groups.png +0 -0
  218. package/screenshots/truth/actions/remove_contact_groups/render/remove-from-all-groups.png +0 -0
  219. package/screenshots/truth/actions/remove_contact_groups/render/single-group.png +0 -0
  220. package/screenshots/truth/actions/send_broadcast/editor/contacts-only.png +0 -0
  221. package/screenshots/truth/actions/send_broadcast/editor/groups-and-contacts.png +0 -0
  222. package/screenshots/truth/actions/send_broadcast/editor/groups-only.png +0 -0
  223. package/screenshots/truth/actions/send_broadcast/editor/many-groups.png +0 -0
  224. package/screenshots/truth/actions/send_broadcast/editor/multiline-text.png +0 -0
  225. package/screenshots/truth/actions/send_broadcast/editor/with-attachments.png +0 -0
  226. package/screenshots/truth/actions/send_broadcast/render/contacts-only.png +0 -0
  227. package/screenshots/truth/actions/send_broadcast/render/groups-and-contacts.png +0 -0
  228. package/screenshots/truth/actions/send_broadcast/render/groups-only.png +0 -0
  229. package/screenshots/truth/actions/send_broadcast/render/many-groups.png +0 -0
  230. package/screenshots/truth/actions/send_broadcast/render/multiline-text.png +0 -0
  231. package/screenshots/truth/actions/send_broadcast/render/with-attachments.png +0 -0
  232. package/screenshots/truth/actions/send_email/editor/complex-business-email.png +0 -0
  233. package/screenshots/truth/actions/send_email/editor/empty-body.png +0 -0
  234. package/screenshots/truth/actions/send_email/editor/empty-subject.png +0 -0
  235. package/screenshots/truth/actions/send_email/editor/long-subject.png +0 -0
  236. package/screenshots/truth/actions/send_email/editor/multiline-body.png +0 -0
  237. package/screenshots/truth/actions/send_email/editor/multiple-recipients.png +0 -0
  238. package/screenshots/truth/actions/send_email/editor/simple-email.png +0 -0
  239. package/screenshots/truth/actions/send_email/editor/with-expressions.png +0 -0
  240. package/screenshots/truth/actions/send_email/render/complex-business-email.png +0 -0
  241. package/screenshots/truth/actions/send_email/render/empty-body.png +0 -0
  242. package/screenshots/truth/actions/send_email/render/empty-subject.png +0 -0
  243. package/screenshots/truth/actions/send_email/render/long-subject.png +0 -0
  244. package/screenshots/truth/actions/send_email/render/multiline-body.png +0 -0
  245. package/screenshots/truth/actions/send_email/render/multiple-recipients.png +0 -0
  246. package/screenshots/truth/actions/send_email/render/simple-email.png +0 -0
  247. package/screenshots/truth/actions/send_email/render/with-expressions.png +0 -0
  248. package/screenshots/truth/actions/send_msg/editor/long-quick-replies.png +0 -0
  249. package/screenshots/truth/actions/send_msg/editor/multiline-text-with-replies.png +0 -0
  250. package/screenshots/truth/actions/send_msg/editor/simple-text.png +0 -0
  251. package/screenshots/truth/actions/send_msg/editor/text-with-linebreaks.png +0 -0
  252. package/screenshots/truth/actions/send_msg/editor/text-with-many-quick-replies.png +0 -0
  253. package/screenshots/truth/actions/send_msg/editor/text-with-quick-replies.png +0 -0
  254. package/screenshots/truth/actions/send_msg/editor/text-without-quick-replies.png +0 -0
  255. package/screenshots/truth/actions/send_msg/render/long-quick-replies.png +0 -0
  256. package/screenshots/truth/actions/send_msg/render/multiline-text-with-replies.png +0 -0
  257. package/screenshots/truth/actions/send_msg/render/simple-text.png +0 -0
  258. package/screenshots/truth/actions/send_msg/render/text-with-linebreaks.png +0 -0
  259. package/screenshots/truth/actions/send_msg/render/text-with-many-quick-replies.png +0 -0
  260. package/screenshots/truth/actions/send_msg/render/text-with-quick-replies.png +0 -0
  261. package/screenshots/truth/actions/send_msg/render/text-without-quick-replies.png +0 -0
  262. package/screenshots/truth/actions/start_session/editor/contact-query.png +0 -0
  263. package/screenshots/truth/actions/start_session/editor/contacts-only.png +0 -0
  264. package/screenshots/truth/actions/start_session/editor/create-contact.png +0 -0
  265. package/screenshots/truth/actions/start_session/editor/groups-and-contacts.png +0 -0
  266. package/screenshots/truth/actions/start_session/editor/groups-only.png +0 -0
  267. package/screenshots/truth/actions/start_session/editor/many-recipients.png +0 -0
  268. package/screenshots/truth/actions/start_session/render/contact-query.png +0 -0
  269. package/screenshots/truth/actions/start_session/render/contacts-only.png +0 -0
  270. package/screenshots/truth/actions/start_session/render/create-contact.png +0 -0
  271. package/screenshots/truth/actions/start_session/render/groups-and-contacts.png +0 -0
  272. package/screenshots/truth/actions/start_session/render/groups-only.png +0 -0
  273. package/screenshots/truth/actions/start_session/render/many-recipients.png +0 -0
  274. package/screenshots/truth/canvas-menu/open.png +0 -0
  275. package/screenshots/truth/editor/router.png +0 -0
  276. package/screenshots/truth/editor/wait.png +0 -0
  277. package/screenshots/truth/list/fields-dragging.png +0 -0
  278. package/screenshots/truth/list/sortable-dragging.png +0 -0
  279. package/screenshots/truth/node-type-selector/action-mode.png +0 -0
  280. package/screenshots/truth/node-type-selector/split-mode.png +0 -0
  281. package/screenshots/truth/nodes/split_by_llm/editor/information-extraction.png +0 -0
  282. package/screenshots/truth/nodes/split_by_llm/editor/sentiment-analysis.png +0 -0
  283. package/screenshots/truth/nodes/split_by_llm/editor/summarization.png +0 -0
  284. package/screenshots/truth/nodes/split_by_llm/editor/translation-task.png +0 -0
  285. package/screenshots/truth/nodes/split_by_llm/render/information-extraction.png +0 -0
  286. package/screenshots/truth/nodes/split_by_llm/render/sentiment-analysis.png +0 -0
  287. package/screenshots/truth/nodes/split_by_llm/render/summarization.png +0 -0
  288. package/screenshots/truth/nodes/split_by_llm/render/translation-task.png +0 -0
  289. package/screenshots/truth/nodes/split_by_llm_categorize/editor/basic-categorization.png +0 -0
  290. package/screenshots/truth/nodes/split_by_llm_categorize/editor/custom-input-and-result-name.png +0 -0
  291. package/screenshots/truth/nodes/split_by_llm_categorize/editor/feedback-categorization.png +0 -0
  292. package/screenshots/truth/nodes/split_by_llm_categorize/editor/many-categories.png +0 -0
  293. package/screenshots/truth/nodes/split_by_llm_categorize/editor/minimal-categories.png +0 -0
  294. package/screenshots/truth/nodes/split_by_llm_categorize/render/basic-categorization.png +0 -0
  295. package/screenshots/truth/nodes/split_by_llm_categorize/render/custom-input-and-result-name.png +0 -0
  296. package/screenshots/truth/nodes/split_by_llm_categorize/render/feedback-categorization.png +0 -0
  297. package/screenshots/truth/nodes/split_by_llm_categorize/render/many-categories.png +0 -0
  298. package/screenshots/truth/nodes/split_by_llm_categorize/render/minimal-categories.png +0 -0
  299. package/screenshots/truth/nodes/split_by_random/editor/ab-test-multiple-variants.png +0 -0
  300. package/screenshots/truth/nodes/split_by_random/editor/sampling-split.png +0 -0
  301. package/screenshots/truth/nodes/split_by_random/editor/three-way-split.png +0 -0
  302. package/screenshots/truth/nodes/split_by_random/editor/two-bucket-split.png +0 -0
  303. package/screenshots/truth/nodes/split_by_random/render/ab-test-multiple-variants.png +0 -0
  304. package/screenshots/truth/nodes/split_by_random/render/sampling-split.png +0 -0
  305. package/screenshots/truth/nodes/split_by_random/render/three-way-split.png +0 -0
  306. package/screenshots/truth/nodes/split_by_random/render/two-bucket-split.png +0 -0
  307. package/screenshots/truth/nodes/wait_for_digits/editor/basic-digits-wait.png +0 -0
  308. package/screenshots/truth/nodes/wait_for_digits/editor/phone-number-collection.png +0 -0
  309. package/screenshots/truth/nodes/wait_for_digits/editor/single-digit-with-timeout.png +0 -0
  310. package/screenshots/truth/nodes/wait_for_digits/editor/verification-code.png +0 -0
  311. package/screenshots/truth/nodes/wait_for_digits/render/basic-digits-wait.png +0 -0
  312. package/screenshots/truth/nodes/wait_for_digits/render/phone-number-collection.png +0 -0
  313. package/screenshots/truth/nodes/wait_for_digits/render/single-digit-with-timeout.png +0 -0
  314. package/screenshots/truth/nodes/wait_for_digits/render/verification-code.png +0 -0
  315. package/screenshots/truth/nodes/wait_for_response/editor/basic-wait.png +0 -0
  316. package/screenshots/truth/nodes/wait_for_response/editor/custom-result-name.png +0 -0
  317. package/screenshots/truth/nodes/wait_for_response/editor/no-timeout.png +0 -0
  318. package/screenshots/truth/nodes/wait_for_response/editor/short-timeout.png +0 -0
  319. package/screenshots/truth/nodes/wait_for_response/render/basic-wait.png +0 -0
  320. package/screenshots/truth/nodes/wait_for_response/render/custom-result-name.png +0 -0
  321. package/screenshots/truth/nodes/wait_for_response/render/no-timeout.png +0 -0
  322. package/screenshots/truth/nodes/wait_for_response/render/short-timeout.png +0 -0
  323. package/src/Icons.ts +4 -1
  324. package/src/events.ts +2 -6
  325. package/src/flow/CanvasMenu.ts +217 -0
  326. package/src/flow/CanvasNode.ts +408 -10
  327. package/src/flow/Editor.ts +683 -44
  328. package/src/flow/NodeEditor.ts +304 -125
  329. package/src/flow/NodeTypeSelector.ts +592 -0
  330. package/src/flow/actions/add_contact_groups.ts +4 -4
  331. package/src/flow/actions/add_contact_urn.ts +76 -4
  332. package/src/flow/actions/add_input_labels.ts +4 -4
  333. package/src/flow/actions/play_audio.ts +2 -2
  334. package/src/flow/actions/remove_contact_groups.ts +14 -6
  335. package/src/flow/actions/request_optin.ts +2 -2
  336. package/src/flow/actions/say_msg.ts +2 -2
  337. package/src/flow/actions/send_broadcast.ts +85 -23
  338. package/src/flow/actions/send_email.ts +10 -6
  339. package/src/flow/actions/send_msg.ts +22 -32
  340. package/src/flow/actions/set_contact_channel.ts +5 -11
  341. package/src/flow/actions/set_contact_field.ts +20 -25
  342. package/src/flow/actions/set_contact_language.ts +9 -4
  343. package/src/flow/actions/set_contact_name.ts +3 -15
  344. package/src/flow/actions/set_contact_status.ts +3 -3
  345. package/src/flow/actions/set_run_result.ts +4 -4
  346. package/src/flow/actions/start_session.ts +208 -6
  347. package/src/flow/config.ts +13 -15
  348. package/src/flow/currencies.ts +51 -0
  349. package/src/flow/nodes/shared-rules.ts +301 -0
  350. package/src/flow/nodes/shared.ts +18 -0
  351. package/src/flow/nodes/split_by_airtime.ts +238 -5
  352. package/src/flow/nodes/split_by_contact_field.ts +185 -3
  353. package/src/flow/nodes/split_by_expression.ts +94 -2
  354. package/src/flow/nodes/split_by_groups.ts +15 -10
  355. package/src/flow/nodes/split_by_intent.ts +7 -0
  356. package/src/flow/nodes/split_by_llm.ts +4 -3
  357. package/src/flow/nodes/split_by_llm_categorize.ts +4 -4
  358. package/src/flow/nodes/split_by_random.ts +5 -5
  359. package/src/flow/nodes/split_by_resthook.ts +130 -0
  360. package/src/flow/nodes/split_by_run_result.ts +249 -3
  361. package/src/flow/nodes/split_by_scheme.ts +192 -2
  362. package/src/flow/nodes/split_by_subflow.ts +6 -4
  363. package/src/flow/nodes/split_by_ticket.ts +4 -3
  364. package/src/flow/nodes/split_by_webhook.ts +6 -5
  365. package/src/flow/nodes/wait_for_audio.ts +2 -2
  366. package/src/flow/nodes/wait_for_digits.ts +2 -2
  367. package/src/flow/nodes/wait_for_image.ts +2 -2
  368. package/src/flow/nodes/wait_for_location.ts +2 -2
  369. package/src/flow/nodes/wait_for_menu.ts +2 -2
  370. package/src/flow/nodes/wait_for_response.ts +48 -679
  371. package/src/flow/nodes/wait_for_video.ts +2 -2
  372. package/src/flow/types.ts +109 -23
  373. package/src/flow/utils.ts +108 -14
  374. package/src/form/FieldRenderer.ts +2 -4
  375. package/src/interfaces.ts +3 -0
  376. package/src/list/SortableList.ts +109 -34
  377. package/src/live/ContactChat.ts +15 -18
  378. package/src/store/AppState.ts +69 -0
  379. package/src/store/flow-definition.d.ts +2 -5
  380. package/src/utils.ts +332 -12
  381. package/static/api/channels.json +46 -0
  382. package/static/api/resthooks.json +31 -0
  383. package/static/svg/index.svg +1 -1
  384. package/static/svg/work/traced/lightning-02.svg +1 -0
  385. package/static/svg/work/used/lightning-02.svg +3 -0
  386. package/temba-modules.ts +4 -0
  387. package/test/ActionHelper.ts +3 -3
  388. package/test/NodeHelper.ts +6 -3
  389. package/test/actions/add_contact_urn.test.ts +287 -0
  390. package/test/actions/send_broadcast.test.ts +190 -0
  391. package/test/actions/send_email.test.ts +17 -23
  392. package/test/actions/send_msg.test.ts +39 -15
  393. package/test/actions/start_session.test.ts +151 -0
  394. package/test/nodes/split_by_airtime.test.ts +673 -0
  395. package/test/nodes/split_by_contact_field.test.ts +451 -0
  396. package/test/nodes/split_by_expression.test.ts +751 -0
  397. package/test/nodes/split_by_random.test.ts +3 -3
  398. package/test/nodes/split_by_resthook.test.ts +398 -0
  399. package/test/nodes/split_by_run_result.test.ts +1109 -0
  400. package/test/nodes/split_by_scheme.test.ts +486 -0
  401. package/test/nodes/split_by_subflow.test.ts +381 -0
  402. package/test/nodes/wait_for_digits.test.ts +2 -2
  403. package/test/nodes/wait_for_response.test.ts +2 -1
  404. package/test/temba-action-drag-between-nodes.test.ts +301 -0
  405. package/test/temba-canvas-menu.test.ts +156 -0
  406. package/test/temba-flow-editor-node.test.ts +102 -2
  407. package/test/temba-flow-editor.test.ts +7 -8
  408. package/test/temba-node-editor.test.ts +3 -1
  409. package/test/temba-node-type-selector.test.ts +152 -0
  410. package/test/temba-omnibox.test.ts +2 -1
  411. package/test/temba-sortable-list.test.ts +69 -0
  412. package/test/temba-utils-index.test.ts +0 -35
  413. package/test/utils.test.ts +2 -0
  414. package/test-assets/contacts/history.json +14 -20
  415. package/web-dev-server.config.mjs +3 -1
  416. package/out-tsc/src/flow/actions/call_classifier.js +0 -11
  417. package/out-tsc/src/flow/actions/call_classifier.js.map +0 -1
  418. package/out-tsc/src/flow/actions/call_resthook.js +0 -11
  419. package/out-tsc/src/flow/actions/call_resthook.js.map +0 -1
  420. package/out-tsc/src/flow/actions/split_by_expression_example.js +0 -77
  421. package/out-tsc/src/flow/actions/split_by_expression_example.js.map +0 -1
  422. package/out-tsc/src/flow/actions/transfer_airtime.js +0 -11
  423. package/out-tsc/src/flow/actions/transfer_airtime.js.map +0 -1
  424. package/src/flow/actions/call_classifier.ts +0 -12
  425. package/src/flow/actions/call_resthook.ts +0 -12
  426. package/src/flow/actions/split_by_expression_example.ts +0 -88
  427. package/src/flow/actions/transfer_airtime.ts +0 -12
@@ -0,0 +1,333 @@
1
+ import { expect } from '@open-wc/testing';
2
+ import { split_by_subflow } from '../../src/flow/nodes/split_by_subflow';
3
+ import { NodeTest } from '../NodeHelper';
4
+ /**
5
+ * Test suite for the split_by_subflow node configuration.
6
+ */
7
+ describe('split_by_subflow node config', () => {
8
+ const helper = new NodeTest(split_by_subflow, 'split_by_subflow');
9
+ describe('basic properties', () => {
10
+ helper.testBasicProperties();
11
+ it('has correct name', () => {
12
+ expect(split_by_subflow.name).to.equal('Enter a Flow');
13
+ });
14
+ it('has correct type', () => {
15
+ expect(split_by_subflow.type).to.equal('split_by_subflow');
16
+ });
17
+ it('has showAsAction set to true', () => {
18
+ expect(split_by_subflow.showAsAction).to.be.true;
19
+ });
20
+ it('has form configuration', () => {
21
+ expect(split_by_subflow.form).to.exist;
22
+ expect(split_by_subflow.form.flow).to.exist;
23
+ expect(split_by_subflow.form.flow.type).to.equal('select');
24
+ expect(split_by_subflow.form.flow.required).to.be.true;
25
+ });
26
+ it('has layout configuration', () => {
27
+ expect(split_by_subflow.layout).to.exist;
28
+ expect(split_by_subflow.layout).to.deep.equal(['flow']);
29
+ });
30
+ });
31
+ describe('toFormData', () => {
32
+ it('extracts data from node with enter_flow action', () => {
33
+ const node = {
34
+ uuid: 'test-node',
35
+ actions: [
36
+ {
37
+ uuid: 'test-action',
38
+ type: 'enter_flow',
39
+ flow: { uuid: 'flow-123', name: 'Registration Flow' }
40
+ }
41
+ ],
42
+ router: {
43
+ type: 'switch',
44
+ operand: '@child.status',
45
+ cases: [
46
+ {
47
+ uuid: 'case-1',
48
+ type: 'has_only_text',
49
+ arguments: ['completed'],
50
+ category_uuid: 'cat-1'
51
+ }
52
+ ],
53
+ categories: [
54
+ { uuid: 'cat-1', name: 'Complete', exit_uuid: 'exit-1' },
55
+ { uuid: 'cat-2', name: 'Expired', exit_uuid: 'exit-2' }
56
+ ],
57
+ default_category_uuid: 'cat-2'
58
+ },
59
+ exits: [
60
+ { uuid: 'exit-1', destination_uuid: null },
61
+ { uuid: 'exit-2', destination_uuid: null }
62
+ ]
63
+ };
64
+ const formData = split_by_subflow.toFormData(node);
65
+ expect(formData.uuid).to.equal('test-node');
66
+ expect(formData.flow).to.be.an('array');
67
+ expect(formData.flow).to.have.lengthOf(1);
68
+ expect(formData.flow[0]).to.deep.equal({
69
+ uuid: 'flow-123',
70
+ name: 'Registration Flow'
71
+ });
72
+ });
73
+ it('handles empty node', () => {
74
+ const node = {
75
+ uuid: 'test-node',
76
+ actions: [],
77
+ exits: []
78
+ };
79
+ const formData = split_by_subflow.toFormData(node);
80
+ expect(formData.uuid).to.equal('test-node');
81
+ expect(formData.flow).to.be.an('array');
82
+ expect(formData.flow).to.have.lengthOf(0);
83
+ });
84
+ });
85
+ describe('fromFormData', () => {
86
+ it('creates node with enter_flow action and router from form data', () => {
87
+ const formData = {
88
+ uuid: 'test-node',
89
+ flow: [{ uuid: 'flow-123', name: 'Registration Flow' }]
90
+ };
91
+ const originalNode = {
92
+ uuid: 'test-node',
93
+ actions: [],
94
+ exits: []
95
+ };
96
+ const node = split_by_subflow.fromFormData(formData, originalNode);
97
+ // Check node structure
98
+ expect(node.uuid).to.equal('test-node');
99
+ expect(node.actions).to.have.length(1);
100
+ expect(node.actions[0].type).to.equal('enter_flow');
101
+ // Check enter_flow action has properly formatted flow
102
+ const enterFlowAction = node.actions[0];
103
+ expect(enterFlowAction.flow).to.exist;
104
+ expect(enterFlowAction.flow.uuid).to.equal('flow-123');
105
+ expect(enterFlowAction.flow.name).to.equal('Registration Flow');
106
+ // Check router
107
+ expect(node.router).to.exist;
108
+ expect(node.router.type).to.equal('switch');
109
+ expect(node.router.operand).to.equal('@child.status');
110
+ expect(node.router.categories).to.have.length(2);
111
+ expect(node.router.categories[0].name).to.equal('Complete');
112
+ expect(node.router.categories[1].name).to.equal('Expired');
113
+ // Check exits
114
+ expect(node.exits).to.have.length(2);
115
+ });
116
+ it('handles empty flow selection', () => {
117
+ const formData = {
118
+ uuid: 'test-node',
119
+ flow: []
120
+ };
121
+ const originalNode = {
122
+ uuid: 'test-node',
123
+ actions: [],
124
+ exits: []
125
+ };
126
+ const node = split_by_subflow.fromFormData(formData, originalNode);
127
+ // Should still create the node structure
128
+ expect(node.actions).to.have.length(1);
129
+ const enterFlowAction = node.actions[0];
130
+ expect(enterFlowAction.flow.uuid).to.equal('');
131
+ expect(enterFlowAction.flow.name).to.equal('');
132
+ });
133
+ it('preserves UUIDs when editing existing node', () => {
134
+ const existingNode = {
135
+ uuid: 'test-node',
136
+ actions: [
137
+ {
138
+ uuid: 'existing-action-uuid',
139
+ type: 'enter_flow',
140
+ flow: { uuid: 'flow-old', name: 'Old Flow' }
141
+ }
142
+ ],
143
+ router: {
144
+ type: 'switch',
145
+ operand: '@child.status',
146
+ cases: [
147
+ {
148
+ uuid: 'existing-case-uuid',
149
+ type: 'has_only_text',
150
+ arguments: ['completed'],
151
+ category_uuid: 'existing-cat-1'
152
+ }
153
+ ],
154
+ categories: [
155
+ {
156
+ uuid: 'existing-cat-1',
157
+ name: 'Complete',
158
+ exit_uuid: 'existing-exit-1'
159
+ },
160
+ {
161
+ uuid: 'existing-cat-2',
162
+ name: 'Expired',
163
+ exit_uuid: 'existing-exit-2'
164
+ }
165
+ ],
166
+ default_category_uuid: 'existing-cat-2'
167
+ },
168
+ exits: [
169
+ { uuid: 'existing-exit-1', destination_uuid: null },
170
+ { uuid: 'existing-exit-2', destination_uuid: null }
171
+ ]
172
+ };
173
+ const formData = {
174
+ uuid: 'test-node',
175
+ flow: [{ uuid: 'flow-new', name: 'New Flow' }]
176
+ };
177
+ const node = split_by_subflow.fromFormData(formData, existingNode);
178
+ // Should preserve action UUID
179
+ expect(node.actions[0].uuid).to.equal('existing-action-uuid');
180
+ // Should preserve router structure UUIDs
181
+ expect(node.router.categories[0].uuid).to.equal('existing-cat-1');
182
+ expect(node.router.categories[1].uuid).to.equal('existing-cat-2');
183
+ expect(node.exits[0].uuid).to.equal('existing-exit-1');
184
+ expect(node.exits[1].uuid).to.equal('existing-exit-2');
185
+ // But should update the flow
186
+ const enterFlowAction = node.actions[0];
187
+ expect(enterFlowAction.flow.uuid).to.equal('flow-new');
188
+ expect(enterFlowAction.flow.name).to.equal('New Flow');
189
+ });
190
+ });
191
+ describe('round-trip transformation', () => {
192
+ it('should preserve node structure through toFormData -> fromFormData', () => {
193
+ const originalNode = {
194
+ uuid: 'test-node-uuid',
195
+ actions: [
196
+ {
197
+ uuid: 'action-uuid',
198
+ type: 'enter_flow',
199
+ flow: { uuid: 'flow-456', name: 'My Subflow' }
200
+ }
201
+ ],
202
+ router: {
203
+ type: 'switch',
204
+ operand: '@child.status',
205
+ cases: [
206
+ {
207
+ uuid: 'case-uuid',
208
+ type: 'has_only_text',
209
+ arguments: ['completed'],
210
+ category_uuid: 'cat-complete'
211
+ }
212
+ ],
213
+ categories: [
214
+ {
215
+ uuid: 'cat-complete',
216
+ name: 'Complete',
217
+ exit_uuid: 'exit-complete'
218
+ },
219
+ {
220
+ uuid: 'cat-expired',
221
+ name: 'Expired',
222
+ exit_uuid: 'exit-expired'
223
+ }
224
+ ],
225
+ default_category_uuid: 'cat-expired'
226
+ },
227
+ exits: [
228
+ { uuid: 'exit-complete', destination_uuid: null },
229
+ { uuid: 'exit-expired', destination_uuid: null }
230
+ ]
231
+ };
232
+ // Convert to form data
233
+ const formData = split_by_subflow.toFormData(originalNode);
234
+ // Convert back to node
235
+ const resultNode = split_by_subflow.fromFormData(formData, originalNode);
236
+ // Should match the original structure
237
+ expect(resultNode).to.deep.equal(originalNode);
238
+ });
239
+ });
240
+ describe('NodeEditor integration', () => {
241
+ it('should properly use node fromFormData when formDataToNode is called', async () => {
242
+ // This test simulates the bug where node.fromFormData should be used
243
+ // to create the entire node (including actions), not action.fromFormData
244
+ const { fixture, html } = await import('@open-wc/testing');
245
+ await import('../../temba-modules');
246
+ const originalNode = {
247
+ uuid: 'test-node-uuid',
248
+ actions: [
249
+ {
250
+ uuid: 'action-uuid',
251
+ type: 'enter_flow',
252
+ flow: { uuid: 'flow-old', name: 'Old Flow' }
253
+ }
254
+ ],
255
+ router: {
256
+ type: 'switch',
257
+ operand: '@child.status',
258
+ cases: [
259
+ {
260
+ uuid: 'case-uuid',
261
+ type: 'has_only_text',
262
+ arguments: ['completed'],
263
+ category_uuid: 'cat-complete'
264
+ }
265
+ ],
266
+ categories: [
267
+ {
268
+ uuid: 'cat-complete',
269
+ name: 'Complete',
270
+ exit_uuid: 'exit-complete'
271
+ },
272
+ {
273
+ uuid: 'cat-expired',
274
+ name: 'Expired',
275
+ exit_uuid: 'exit-expired'
276
+ }
277
+ ],
278
+ default_category_uuid: 'cat-expired'
279
+ },
280
+ exits: [
281
+ { uuid: 'exit-complete', destination_uuid: null },
282
+ { uuid: 'exit-expired', destination_uuid: null }
283
+ ]
284
+ };
285
+ const nodeUI = {
286
+ type: 'split_by_subflow',
287
+ position: { left: 50, top: 50 }
288
+ };
289
+ // Create the node editor
290
+ const nodeEditor = (await fixture(html `
291
+ <temba-node-editor
292
+ .node=${originalNode}
293
+ .nodeUI=${nodeUI}
294
+ .action=${originalNode.actions[0]}
295
+ .isOpen=${true}
296
+ ></temba-node-editor>
297
+ `));
298
+ await nodeEditor.updateComplete;
299
+ await new Promise((resolve) => setTimeout(resolve, 200));
300
+ await nodeEditor.updateComplete;
301
+ // Get the initial formData to verify toFormData was called
302
+ const initialFormData = nodeEditor.formData;
303
+ expect(initialFormData.flow).to.exist;
304
+ expect(initialFormData.flow).to.have.lengthOf(1);
305
+ expect(initialFormData.flow[0].uuid).to.equal('flow-old');
306
+ // Simulate changing the flow selection
307
+ const newFormData = {
308
+ ...initialFormData,
309
+ flow: [{ uuid: 'flow-new', name: 'New Flow' }]
310
+ };
311
+ // Call formDataToNode directly to test the transformation
312
+ const resultNode = nodeEditor.formDataToNode(newFormData);
313
+ // Verify that the result node has the new flow properly formatted
314
+ expect(resultNode).to.exist;
315
+ expect(resultNode.actions).to.have.length(1);
316
+ const enterFlowAction = resultNode.actions[0];
317
+ expect(enterFlowAction.type).to.equal('enter_flow');
318
+ // This is the key assertion - the flow should be properly formatted
319
+ // as created by node's fromFormData, not by action's fromFormData
320
+ expect(enterFlowAction.flow).to.exist;
321
+ expect(enterFlowAction.flow.uuid).to.equal('flow-new');
322
+ expect(enterFlowAction.flow.name).to.equal('New Flow');
323
+ // The flow should NOT have extra properties that might come from the select component
324
+ expect(enterFlowAction.flow).to.not.have.property('value');
325
+ // Verify router structure was also created properly by node's fromFormData
326
+ expect(resultNode.router).to.exist;
327
+ expect(resultNode.router.type).to.equal('switch');
328
+ expect(resultNode.router.categories).to.have.length(2);
329
+ expect(resultNode.exits).to.have.length(2);
330
+ });
331
+ });
332
+ });
333
+ //# sourceMappingURL=split_by_subflow.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"split_by_subflow.test.js","sourceRoot":"","sources":["../../../test/nodes/split_by_subflow.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAEzE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;GAEG;AACH,QAAQ,CAAC,8BAA8B,EAAE,GAAG,EAAE;IAC5C,MAAM,MAAM,GAAG,IAAI,QAAQ,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAAC;IAElE,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;QAChC,MAAM,CAAC,mBAAmB,EAAE,CAAC;QAE7B,EAAE,CAAC,kBAAkB,EAAE,GAAG,EAAE;YAC1B,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;QACzD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,kBAAkB,EAAE,GAAG,EAAE;YAC1B,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,8BAA8B,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AAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { expect } from '@open-wc/testing';\nimport { split_by_subflow } from '../../src/flow/nodes/split_by_subflow';\nimport { Node } from '../../src/store/flow-definition';\nimport { NodeTest } from '../NodeHelper';\n\n/**\n * Test suite for the split_by_subflow node configuration.\n */\ndescribe('split_by_subflow node config', () => {\n const helper = new NodeTest(split_by_subflow, 'split_by_subflow');\n\n describe('basic properties', () => {\n helper.testBasicProperties();\n\n it('has correct name', () => {\n expect(split_by_subflow.name).to.equal('Enter a Flow');\n });\n\n it('has correct type', () => {\n expect(split_by_subflow.type).to.equal('split_by_subflow');\n });\n\n it('has showAsAction set to true', () => {\n expect(split_by_subflow.showAsAction).to.be.true;\n });\n\n it('has form configuration', () => {\n expect(split_by_subflow.form).to.exist;\n expect(split_by_subflow.form.flow).to.exist;\n expect(split_by_subflow.form.flow.type).to.equal('select');\n expect(split_by_subflow.form.flow.required).to.be.true;\n });\n\n it('has layout configuration', () => {\n expect(split_by_subflow.layout).to.exist;\n expect(split_by_subflow.layout).to.deep.equal(['flow']);\n });\n });\n\n describe('toFormData', () => {\n it('extracts data from node with enter_flow action', () => {\n const node: Node = {\n uuid: 'test-node',\n actions: [\n {\n uuid: 'test-action',\n type: 'enter_flow',\n flow: { uuid: 'flow-123', name: 'Registration Flow' }\n } as any\n ],\n router: {\n type: 'switch',\n operand: '@child.status',\n cases: [\n {\n uuid: 'case-1',\n type: 'has_only_text',\n arguments: ['completed'],\n category_uuid: 'cat-1'\n }\n ],\n categories: [\n { uuid: 'cat-1', name: 'Complete', exit_uuid: 'exit-1' },\n { uuid: 'cat-2', name: 'Expired', exit_uuid: 'exit-2' }\n ],\n default_category_uuid: 'cat-2'\n },\n exits: [\n { uuid: 'exit-1', destination_uuid: null },\n { uuid: 'exit-2', destination_uuid: null }\n ]\n };\n\n const formData = split_by_subflow.toFormData(node);\n\n expect(formData.uuid).to.equal('test-node');\n expect(formData.flow).to.be.an('array');\n expect(formData.flow).to.have.lengthOf(1);\n expect(formData.flow[0]).to.deep.equal({\n uuid: 'flow-123',\n name: 'Registration Flow'\n });\n });\n\n it('handles empty node', () => {\n const node: Node = {\n uuid: 'test-node',\n actions: [],\n exits: []\n };\n\n const formData = split_by_subflow.toFormData(node);\n\n expect(formData.uuid).to.equal('test-node');\n expect(formData.flow).to.be.an('array');\n expect(formData.flow).to.have.lengthOf(0);\n });\n });\n\n describe('fromFormData', () => {\n it('creates node with enter_flow action and router from form data', () => {\n const formData = {\n uuid: 'test-node',\n flow: [{ uuid: 'flow-123', name: 'Registration Flow' }]\n };\n\n const originalNode: Node = {\n uuid: 'test-node',\n actions: [],\n exits: []\n };\n\n const node = split_by_subflow.fromFormData(formData, originalNode);\n\n // Check node structure\n expect(node.uuid).to.equal('test-node');\n expect(node.actions).to.have.length(1);\n expect(node.actions[0].type).to.equal('enter_flow');\n\n // Check enter_flow action has properly formatted flow\n const enterFlowAction = node.actions[0] as any;\n expect(enterFlowAction.flow).to.exist;\n expect(enterFlowAction.flow.uuid).to.equal('flow-123');\n expect(enterFlowAction.flow.name).to.equal('Registration Flow');\n\n // Check router\n expect(node.router).to.exist;\n expect(node.router.type).to.equal('switch');\n expect(node.router.operand).to.equal('@child.status');\n expect(node.router.categories).to.have.length(2);\n expect(node.router.categories[0].name).to.equal('Complete');\n expect(node.router.categories[1].name).to.equal('Expired');\n\n // Check exits\n expect(node.exits).to.have.length(2);\n });\n\n it('handles empty flow selection', () => {\n const formData = {\n uuid: 'test-node',\n flow: []\n };\n\n const originalNode: Node = {\n uuid: 'test-node',\n actions: [],\n exits: []\n };\n\n const node = split_by_subflow.fromFormData(formData, originalNode);\n\n // Should still create the node structure\n expect(node.actions).to.have.length(1);\n const enterFlowAction = node.actions[0] as any;\n expect(enterFlowAction.flow.uuid).to.equal('');\n expect(enterFlowAction.flow.name).to.equal('');\n });\n\n it('preserves UUIDs when editing existing node', () => {\n const existingNode: Node = {\n uuid: 'test-node',\n actions: [\n {\n uuid: 'existing-action-uuid',\n type: 'enter_flow',\n flow: { uuid: 'flow-old', name: 'Old Flow' }\n } as any\n ],\n router: {\n type: 'switch',\n operand: '@child.status',\n cases: [\n {\n uuid: 'existing-case-uuid',\n type: 'has_only_text',\n arguments: ['completed'],\n category_uuid: 'existing-cat-1'\n }\n ],\n categories: [\n {\n uuid: 'existing-cat-1',\n name: 'Complete',\n exit_uuid: 'existing-exit-1'\n },\n {\n uuid: 'existing-cat-2',\n name: 'Expired',\n exit_uuid: 'existing-exit-2'\n }\n ],\n default_category_uuid: 'existing-cat-2'\n },\n exits: [\n { uuid: 'existing-exit-1', destination_uuid: null },\n { uuid: 'existing-exit-2', destination_uuid: null }\n ]\n };\n\n const formData = {\n uuid: 'test-node',\n flow: [{ uuid: 'flow-new', name: 'New Flow' }]\n };\n\n const node = split_by_subflow.fromFormData(formData, existingNode);\n\n // Should preserve action UUID\n expect(node.actions[0].uuid).to.equal('existing-action-uuid');\n\n // Should preserve router structure UUIDs\n expect(node.router.categories[0].uuid).to.equal('existing-cat-1');\n expect(node.router.categories[1].uuid).to.equal('existing-cat-2');\n expect(node.exits[0].uuid).to.equal('existing-exit-1');\n expect(node.exits[1].uuid).to.equal('existing-exit-2');\n\n // But should update the flow\n const enterFlowAction = node.actions[0] as any;\n expect(enterFlowAction.flow.uuid).to.equal('flow-new');\n expect(enterFlowAction.flow.name).to.equal('New Flow');\n });\n });\n\n describe('round-trip transformation', () => {\n it('should preserve node structure through toFormData -> fromFormData', () => {\n const originalNode: Node = {\n uuid: 'test-node-uuid',\n actions: [\n {\n uuid: 'action-uuid',\n type: 'enter_flow',\n flow: { uuid: 'flow-456', name: 'My Subflow' }\n } as any\n ],\n router: {\n type: 'switch',\n operand: '@child.status',\n cases: [\n {\n uuid: 'case-uuid',\n type: 'has_only_text',\n arguments: ['completed'],\n category_uuid: 'cat-complete'\n }\n ],\n categories: [\n {\n uuid: 'cat-complete',\n name: 'Complete',\n exit_uuid: 'exit-complete'\n },\n {\n uuid: 'cat-expired',\n name: 'Expired',\n exit_uuid: 'exit-expired'\n }\n ],\n default_category_uuid: 'cat-expired'\n },\n exits: [\n { uuid: 'exit-complete', destination_uuid: null },\n { uuid: 'exit-expired', destination_uuid: null }\n ]\n };\n\n // Convert to form data\n const formData = split_by_subflow.toFormData(originalNode);\n\n // Convert back to node\n const resultNode = split_by_subflow.fromFormData(formData, originalNode);\n\n // Should match the original structure\n expect(resultNode).to.deep.equal(originalNode);\n });\n });\n\n describe('NodeEditor integration', () => {\n it('should properly use node fromFormData when formDataToNode is called', async () => {\n // This test simulates the bug where node.fromFormData should be used\n // to create the entire node (including actions), not action.fromFormData\n\n const { fixture, html } = await import('@open-wc/testing');\n await import('../../temba-modules');\n\n const originalNode: Node = {\n uuid: 'test-node-uuid',\n actions: [\n {\n uuid: 'action-uuid',\n type: 'enter_flow',\n flow: { uuid: 'flow-old', name: 'Old Flow' }\n } as any\n ],\n router: {\n type: 'switch',\n operand: '@child.status',\n cases: [\n {\n uuid: 'case-uuid',\n type: 'has_only_text',\n arguments: ['completed'],\n category_uuid: 'cat-complete'\n }\n ],\n categories: [\n {\n uuid: 'cat-complete',\n name: 'Complete',\n exit_uuid: 'exit-complete'\n },\n {\n uuid: 'cat-expired',\n name: 'Expired',\n exit_uuid: 'exit-expired'\n }\n ],\n default_category_uuid: 'cat-expired'\n },\n exits: [\n { uuid: 'exit-complete', destination_uuid: null },\n { uuid: 'exit-expired', destination_uuid: null }\n ]\n };\n\n const nodeUI = {\n type: 'split_by_subflow',\n position: { left: 50, top: 50 }\n };\n\n // Create the node editor\n const nodeEditor = (await fixture(html`\n <temba-node-editor\n .node=${originalNode}\n .nodeUI=${nodeUI}\n .action=${originalNode.actions[0]}\n .isOpen=${true}\n ></temba-node-editor>\n `)) as any;\n\n await nodeEditor.updateComplete;\n await new Promise((resolve) => setTimeout(resolve, 200));\n await nodeEditor.updateComplete;\n\n // Get the initial formData to verify toFormData was called\n const initialFormData = nodeEditor.formData;\n expect(initialFormData.flow).to.exist;\n expect(initialFormData.flow).to.have.lengthOf(1);\n expect(initialFormData.flow[0].uuid).to.equal('flow-old');\n\n // Simulate changing the flow selection\n const newFormData = {\n ...initialFormData,\n flow: [{ uuid: 'flow-new', name: 'New Flow' }]\n };\n\n // Call formDataToNode directly to test the transformation\n const resultNode = nodeEditor.formDataToNode(newFormData);\n\n // Verify that the result node has the new flow properly formatted\n expect(resultNode).to.exist;\n expect(resultNode.actions).to.have.length(1);\n\n const enterFlowAction = resultNode.actions[0] as any;\n expect(enterFlowAction.type).to.equal('enter_flow');\n\n // This is the key assertion - the flow should be properly formatted\n // as created by node's fromFormData, not by action's fromFormData\n expect(enterFlowAction.flow).to.exist;\n expect(enterFlowAction.flow.uuid).to.equal('flow-new');\n expect(enterFlowAction.flow.name).to.equal('New Flow');\n\n // The flow should NOT have extra properties that might come from the select component\n expect(enterFlowAction.flow).to.not.have.property('value');\n\n // Verify router structure was also created properly by node's fromFormData\n expect(resultNode.router).to.exist;\n expect(resultNode.router.type).to.equal('switch');\n expect(resultNode.router.categories).to.have.length(2);\n expect(resultNode.exits).to.have.length(2);\n });\n });\n});\n"]}
@@ -14,8 +14,8 @@ describe('wait_for_digits node config', () => {
14
14
  it('has correct type', () => {
15
15
  expect(wait_for_digits.type).to.equal('wait_for_digits');
16
16
  });
17
- it('has correct color', () => {
18
- expect(wait_for_digits.color).to.exist;
17
+ it('has correct group', () => {
18
+ expect(wait_for_digits.group).to.exist;
19
19
  });
20
20
  it('is a simple node config without form or layout', () => {
21
21
  expect(wait_for_digits.form).to.be.undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"wait_for_digits.test.js","sourceRoot":"","sources":["../../../test/nodes/wait_for_digits.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,eAAe,E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ACL,EAAE,IAAI,EAAE,cAAc,EAAE,gBAAgB,EAAE,IAAI,EAAE;oBAChD,EAAE,IAAI,EAAE,cAAc,EAAE,gBAAgB,EAAE,IAAI,EAAE;oBAChD,EAAE,IAAI,EAAE,cAAc,EAAE,gBAAgB,EAAE,IAAI,EAAE;iBACjD;aACM,EACT,EAAE,IAAI,EAAE,iBAAiB,EAAE,EAC3B,yBAAyB,CAC1B,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,2BAA2B,EAAE,KAAK,IAAI,EAAE;YACzC,MAAM,MAAM,CAAC,QAAQ,CACnB;gBACE,IAAI,EAAE,oBAAoB;gBAC1B,OAAO,EAAE,EAAE;gBACX,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE;wBACJ,IAAI,EAAE,KAAK;wBACX,IAAI,EAAE;4BACJ,IAAI,EAAE,QAAQ;4BACd,KAAK,EAAE,CAAC;yBACT;qBACF;oBACD,WAAW,EAAE,mBAAmB;oBAChC,UAAU,EAAE;wBACV;4BACE,IAAI,EAAE,YAAY;4BAClB,IAAI,EAAE,YAAY;4BAClB,SAAS,EAAE,aAAa;yBACzB;wBACD,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE;qBAChE;iBACF;gBACD,KAAK,EAAE;oBACL,EAAE,IAAI,EAAE,aAAa,EAAE,gBAAgB,EAAE,IAAI,EAAE;oBAC/C,EAAE,IAAI,EAAE,aAAa,EAAE,gBAAgB,EAAE,IAAI,EAAE;iBAChD;aACM,EACT,EAAE,IAAI,EAAE,iBAAiB,EAAE,EAC3B,mBAAmB,CACpB,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { expect } from '@open-wc/testing';\nimport { wait_for_digits } from '../../src/flow/nodes/wait_for_digits';\nimport { Node } from '../../src/store/flow-definition';\nimport { NodeTest } from '../NodeHelper';\n\n/**\n * Test suite for the wait_for_digits node configuration.\n */\ndescribe('wait_for_digits node config', () => {\n const helper = new NodeTest(wait_for_digits, 'wait_for_digits');\n\n describe('basic properties', () => {\n helper.testBasicProperties();\n\n it('has correct name', () => {\n expect(wait_for_digits.name).to.equal('Wait for Digits');\n });\n\n it('has correct type', () => {\n expect(wait_for_digits.type).to.equal('wait_for_digits');\n });\n\n it('has correct color', () => {\n expect(wait_for_digits.color).to.exist;\n });\n\n it('is a simple node config without form or layout', () => {\n expect(wait_for_digits.form).to.be.undefined;\n expect(wait_for_digits.layout).to.be.undefined;\n expect(wait_for_digits.toFormData).to.be.undefined;\n expect(wait_for_digits.fromFormData).to.be.undefined;\n });\n });\n\n describe('node scenarios', () => {\n it('renders basic digits wait', async () => {\n await helper.testNode(\n {\n uuid: 'test-digits-node-1',\n actions: [],\n router: {\n type: 'switch',\n wait: {\n type: 'msg',\n hint: {\n type: 'digits',\n count: 4\n }\n },\n result_name: 'digits',\n categories: [\n {\n uuid: 'digits-cat-1',\n name: 'Has Number',\n exit_uuid: 'digits-exit-1'\n },\n {\n uuid: 'digits-cat-2',\n name: 'Other',\n exit_uuid: 'digits-exit-2'\n }\n ]\n },\n exits: [\n { uuid: 'digits-exit-1', destination_uuid: null },\n { uuid: 'digits-exit-2', destination_uuid: null }\n ]\n } as Node,\n { type: 'wait_for_digits' },\n 'basic-digits-wait'\n );\n });\n\n it('renders single digit with timeout', async () => {\n await helper.testNode(\n {\n uuid: 'test-digits-node-2',\n actions: [],\n router: {\n type: 'switch',\n wait: {\n type: 'msg',\n hint: {\n type: 'digits',\n count: 1\n },\n timeout: {\n category_uuid: 'timeout-cat',\n seconds: 30\n }\n },\n result_name: 'pin_digit',\n categories: [\n {\n uuid: 'digits-cat-1',\n name: 'Has Number',\n exit_uuid: 'digits-exit-1'\n },\n {\n uuid: 'timeout-cat',\n name: 'No Response',\n exit_uuid: 'timeout-exit'\n },\n {\n uuid: 'digits-cat-2',\n name: 'Other',\n exit_uuid: 'digits-exit-2'\n }\n ]\n },\n exits: [\n { uuid: 'digits-exit-1', destination_uuid: null },\n { uuid: 'timeout-exit', destination_uuid: null },\n { uuid: 'digits-exit-2', destination_uuid: null }\n ]\n } as Node,\n { type: 'wait_for_digits' },\n 'single-digit-with-timeout'\n );\n });\n\n it('renders phone number collection', async () => {\n await helper.testNode(\n {\n uuid: 'test-digits-node-3',\n actions: [],\n router: {\n type: 'switch',\n wait: {\n type: 'msg',\n hint: {\n type: 'digits',\n count: 10\n }\n },\n result_name: 'phone_number',\n categories: [\n {\n uuid: 'phone-cat-1',\n name: 'Valid Phone',\n exit_uuid: 'phone-exit-1'\n },\n {\n uuid: 'phone-cat-2',\n name: 'Invalid',\n exit_uuid: 'phone-exit-2'\n },\n { uuid: 'phone-cat-3', name: 'Other', exit_uuid: 'phone-exit-3' }\n ]\n },\n exits: [\n { uuid: 'phone-exit-1', destination_uuid: null },\n { uuid: 'phone-exit-2', destination_uuid: null },\n { uuid: 'phone-exit-3', destination_uuid: null }\n ]\n } as Node,\n { type: 'wait_for_digits' },\n 'phone-number-collection'\n );\n });\n\n it('renders verification code', async () => {\n await helper.testNode(\n {\n uuid: 'test-digits-node-4',\n actions: [],\n router: {\n type: 'switch',\n wait: {\n type: 'msg',\n hint: {\n type: 'digits',\n count: 6\n }\n },\n result_name: 'verification_code',\n categories: [\n {\n uuid: 'code-cat-1',\n name: 'Valid Code',\n exit_uuid: 'code-exit-1'\n },\n { uuid: 'code-cat-2', name: 'Other', exit_uuid: 'code-exit-2' }\n ]\n },\n exits: [\n { uuid: 'code-exit-1', destination_uuid: null },\n { uuid: 'code-exit-2', destination_uuid: null }\n ]\n } as Node,\n { type: 'wait_for_digits' },\n 'verification-code'\n );\n });\n });\n});\n"]}
1
+ {"version":3,"file":"wait_for_digits.test.js","sourceRoot":"","sources":["../../../test/nodes/wait_for_digits.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAA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E;iBACF;gBACD,KAAK,EAAE;oBACL,EAAE,IAAI,EAAE,cAAc,EAAE,gBAAgB,EAAE,IAAI,EAAE;oBAChD,EAAE,IAAI,EAAE,cAAc,EAAE,gBAAgB,EAAE,IAAI,EAAE;oBAChD,EAAE,IAAI,EAAE,cAAc,EAAE,gBAAgB,EAAE,IAAI,EAAE;iBACjD;aACM,EACT,EAAE,IAAI,EAAE,iBAAiB,EAAE,EAC3B,yBAAyB,CAC1B,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,2BAA2B,EAAE,KAAK,IAAI,EAAE;YACzC,MAAM,MAAM,CAAC,QAAQ,CACnB;gBACE,IAAI,EAAE,oBAAoB;gBAC1B,OAAO,EAAE,EAAE;gBACX,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE;wBACJ,IAAI,EAAE,KAAK;wBACX,IAAI,EAAE;4BACJ,IAAI,EAAE,QAAQ;4BACd,KAAK,EAAE,CAAC;yBACT;qBACF;oBACD,WAAW,EAAE,mBAAmB;oBAChC,UAAU,EAAE;wBACV;4BACE,IAAI,EAAE,YAAY;4BAClB,IAAI,EAAE,YAAY;4BAClB,SAAS,EAAE,aAAa;yBACzB;wBACD,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE;qBAChE;iBACF;gBACD,KAAK,EAAE;oBACL,EAAE,IAAI,EAAE,aAAa,EAAE,gBAAgB,EAAE,IAAI,EAAE;oBAC/C,EAAE,IAAI,EAAE,aAAa,EAAE,gBAAgB,EAAE,IAAI,EAAE;iBAChD;aACM,EACT,EAAE,IAAI,EAAE,iBAAiB,EAAE,EAC3B,mBAAmB,CACpB,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { expect } from '@open-wc/testing';\nimport { wait_for_digits } from '../../src/flow/nodes/wait_for_digits';\nimport { Node } from '../../src/store/flow-definition';\nimport { NodeTest } from '../NodeHelper';\n\n/**\n * Test suite for the wait_for_digits node configuration.\n */\ndescribe('wait_for_digits node config', () => {\n const helper = new NodeTest(wait_for_digits, 'wait_for_digits');\n\n describe('basic properties', () => {\n helper.testBasicProperties();\n\n it('has correct name', () => {\n expect(wait_for_digits.name).to.equal('Wait for Digits');\n });\n\n it('has correct type', () => {\n expect(wait_for_digits.type).to.equal('wait_for_digits');\n });\n\n it('has correct group', () => {\n expect(wait_for_digits.group).to.exist;\n });\n\n it('is a simple node config without form or layout', () => {\n expect(wait_for_digits.form).to.be.undefined;\n expect(wait_for_digits.layout).to.be.undefined;\n expect(wait_for_digits.toFormData).to.be.undefined;\n expect(wait_for_digits.fromFormData).to.be.undefined;\n });\n });\n\n describe('node scenarios', () => {\n it('renders basic digits wait', async () => {\n await helper.testNode(\n {\n uuid: 'test-digits-node-1',\n actions: [],\n router: {\n type: 'switch',\n wait: {\n type: 'msg',\n hint: {\n type: 'digits',\n count: 4\n }\n },\n result_name: 'digits',\n categories: [\n {\n uuid: 'digits-cat-1',\n name: 'Has Number',\n exit_uuid: 'digits-exit-1'\n },\n {\n uuid: 'digits-cat-2',\n name: 'Other',\n exit_uuid: 'digits-exit-2'\n }\n ]\n },\n exits: [\n { uuid: 'digits-exit-1', destination_uuid: null },\n { uuid: 'digits-exit-2', destination_uuid: null }\n ]\n } as Node,\n { type: 'wait_for_digits' },\n 'basic-digits-wait'\n );\n });\n\n it('renders single digit with timeout', async () => {\n await helper.testNode(\n {\n uuid: 'test-digits-node-2',\n actions: [],\n router: {\n type: 'switch',\n wait: {\n type: 'msg',\n hint: {\n type: 'digits',\n count: 1\n },\n timeout: {\n category_uuid: 'timeout-cat',\n seconds: 30\n }\n },\n result_name: 'pin_digit',\n categories: [\n {\n uuid: 'digits-cat-1',\n name: 'Has Number',\n exit_uuid: 'digits-exit-1'\n },\n {\n uuid: 'timeout-cat',\n name: 'No Response',\n exit_uuid: 'timeout-exit'\n },\n {\n uuid: 'digits-cat-2',\n name: 'Other',\n exit_uuid: 'digits-exit-2'\n }\n ]\n },\n exits: [\n { uuid: 'digits-exit-1', destination_uuid: null },\n { uuid: 'timeout-exit', destination_uuid: null },\n { uuid: 'digits-exit-2', destination_uuid: null }\n ]\n } as Node,\n { type: 'wait_for_digits' },\n 'single-digit-with-timeout'\n );\n });\n\n it('renders phone number collection', async () => {\n await helper.testNode(\n {\n uuid: 'test-digits-node-3',\n actions: [],\n router: {\n type: 'switch',\n wait: {\n type: 'msg',\n hint: {\n type: 'digits',\n count: 10\n }\n },\n result_name: 'phone_number',\n categories: [\n {\n uuid: 'phone-cat-1',\n name: 'Valid Phone',\n exit_uuid: 'phone-exit-1'\n },\n {\n uuid: 'phone-cat-2',\n name: 'Invalid',\n exit_uuid: 'phone-exit-2'\n },\n { uuid: 'phone-cat-3', name: 'Other', exit_uuid: 'phone-exit-3' }\n ]\n },\n exits: [\n { uuid: 'phone-exit-1', destination_uuid: null },\n { uuid: 'phone-exit-2', destination_uuid: null },\n { uuid: 'phone-exit-3', destination_uuid: null }\n ]\n } as Node,\n { type: 'wait_for_digits' },\n 'phone-number-collection'\n );\n });\n\n it('renders verification code', async () => {\n await helper.testNode(\n {\n uuid: 'test-digits-node-4',\n actions: [],\n router: {\n type: 'switch',\n wait: {\n type: 'msg',\n hint: {\n type: 'digits',\n count: 6\n }\n },\n result_name: 'verification_code',\n categories: [\n {\n uuid: 'code-cat-1',\n name: 'Valid Code',\n exit_uuid: 'code-exit-1'\n },\n { uuid: 'code-cat-2', name: 'Other', exit_uuid: 'code-exit-2' }\n ]\n },\n exits: [\n { uuid: 'code-exit-1', destination_uuid: null },\n { uuid: 'code-exit-2', destination_uuid: null }\n ]\n } as Node,\n { type: 'wait_for_digits' },\n 'verification-code'\n );\n });\n });\n});\n"]}
@@ -326,7 +326,8 @@ describe('wait_for_response node config', () => {
326
326
  };
327
327
  const result = wait_for_response.fromFormData(formData, originalNode);
328
328
  expect(result.uuid).to.equal('test-node');
329
- expect((_a = result.router) === null || _a === void 0 ? void 0 : _a.result_name).to.equal('response');
329
+ // When no result_name is provided, it should not be set
330
+ expect((_a = result.router) === null || _a === void 0 ? void 0 : _a.result_name).to.be.undefined;
330
331
  });
331
332
  it('handles operators with no operands correctly', () => {
332
333
  var _a, _b, _c;