@nyaruka/temba-components 0.139.0 → 0.141.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.
- package/.github/workflows/cla.yml +1 -1
- package/.github/workflows/copilot-setup-steps.yml +6 -1
- package/.lintstagedrc.js +10 -0
- package/CHANGELOG.md +32 -0
- package/demo/data/flows/sample-flow.json +24 -0
- package/dist/locales/es.js +5 -5
- package/dist/locales/es.js.map +1 -1
- package/dist/locales/fr.js +5 -5
- package/dist/locales/fr.js.map +1 -1
- package/dist/locales/locale-codes.js +11 -2
- package/dist/locales/locale-codes.js.map +1 -1
- package/dist/locales/pt.js +5 -5
- package/dist/locales/pt.js.map +1 -1
- package/dist/temba-components.js +702 -338
- package/dist/temba-components.js.map +1 -1
- package/out-tsc/src/display/Chat.js +10 -7
- package/out-tsc/src/display/Chat.js.map +1 -1
- package/out-tsc/src/display/Dropdown.js +3 -1
- package/out-tsc/src/display/Dropdown.js.map +1 -1
- package/out-tsc/src/display/FloatingTab.js +4 -4
- package/out-tsc/src/display/FloatingTab.js.map +1 -1
- package/out-tsc/src/display/Thumbnail.js +163 -5
- package/out-tsc/src/display/Thumbnail.js.map +1 -1
- package/out-tsc/src/flow/CanvasNode.js +65 -23
- package/out-tsc/src/flow/CanvasNode.js.map +1 -1
- package/out-tsc/src/flow/Editor.js +369 -49
- package/out-tsc/src/flow/Editor.js.map +1 -1
- package/out-tsc/src/flow/NodeEditor.js +118 -10
- package/out-tsc/src/flow/NodeEditor.js.map +1 -1
- package/out-tsc/src/flow/Plumber.js +61 -14
- package/out-tsc/src/flow/Plumber.js.map +1 -1
- package/out-tsc/src/flow/StickyNote.js +13 -4
- package/out-tsc/src/flow/StickyNote.js.map +1 -1
- package/out-tsc/src/flow/actions/add_contact_groups.js +4 -1
- package/out-tsc/src/flow/actions/add_contact_groups.js.map +1 -1
- package/out-tsc/src/flow/actions/add_input_labels.js +4 -1
- package/out-tsc/src/flow/actions/add_input_labels.js.map +1 -1
- package/out-tsc/src/flow/actions/audio-player.js +112 -0
- package/out-tsc/src/flow/actions/audio-player.js.map +1 -0
- package/out-tsc/src/flow/actions/enter_flow.js +43 -0
- package/out-tsc/src/flow/actions/enter_flow.js.map +1 -0
- package/out-tsc/src/flow/actions/play_audio.js +57 -4
- package/out-tsc/src/flow/actions/play_audio.js.map +1 -1
- package/out-tsc/src/flow/actions/remove_contact_groups.js +6 -1
- package/out-tsc/src/flow/actions/remove_contact_groups.js.map +1 -1
- package/out-tsc/src/flow/actions/say_msg.js +86 -3
- package/out-tsc/src/flow/actions/say_msg.js.map +1 -1
- package/out-tsc/src/flow/actions/send_broadcast.js +6 -2
- package/out-tsc/src/flow/actions/send_broadcast.js.map +1 -1
- package/out-tsc/src/flow/actions/set_contact_channel.js +13 -0
- package/out-tsc/src/flow/actions/set_contact_channel.js.map +1 -1
- package/out-tsc/src/flow/actions/set_contact_status.js +7 -5
- package/out-tsc/src/flow/actions/set_contact_status.js.map +1 -1
- package/out-tsc/src/flow/actions/start_session.js +10 -3
- package/out-tsc/src/flow/actions/start_session.js.map +1 -1
- package/out-tsc/src/flow/config.js +11 -3
- package/out-tsc/src/flow/config.js.map +1 -1
- package/out-tsc/src/flow/nodes/shared-rules.js +1 -1
- package/out-tsc/src/flow/nodes/shared-rules.js.map +1 -1
- package/out-tsc/src/flow/nodes/split_by_contact_field.js +18 -5
- package/out-tsc/src/flow/nodes/split_by_contact_field.js.map +1 -1
- package/out-tsc/src/flow/nodes/split_by_expression.js +1 -1
- package/out-tsc/src/flow/nodes/split_by_expression.js.map +1 -1
- package/out-tsc/src/flow/nodes/split_by_llm_categorize.js +0 -1
- package/out-tsc/src/flow/nodes/split_by_llm_categorize.js.map +1 -1
- package/out-tsc/src/flow/nodes/split_by_random.js +0 -1
- package/out-tsc/src/flow/nodes/split_by_random.js.map +1 -1
- package/out-tsc/src/flow/nodes/split_by_run_result.js +10 -4
- package/out-tsc/src/flow/nodes/split_by_run_result.js.map +1 -1
- package/out-tsc/src/flow/nodes/terminal.js +7 -0
- package/out-tsc/src/flow/nodes/terminal.js.map +1 -0
- package/out-tsc/src/flow/nodes/wait_for_audio.js +77 -0
- package/out-tsc/src/flow/nodes/wait_for_audio.js.map +1 -0
- package/out-tsc/src/flow/nodes/wait_for_dial.js +151 -0
- package/out-tsc/src/flow/nodes/wait_for_dial.js.map +1 -0
- package/out-tsc/src/flow/nodes/wait_for_digits.js +61 -1
- package/out-tsc/src/flow/nodes/wait_for_digits.js.map +1 -1
- package/out-tsc/src/flow/nodes/wait_for_menu.js +173 -2
- package/out-tsc/src/flow/nodes/wait_for_menu.js.map +1 -1
- package/out-tsc/src/flow/nodes/wait_for_response.js +1 -1
- package/out-tsc/src/flow/nodes/wait_for_response.js.map +1 -1
- package/out-tsc/src/flow/operators.js +21 -5
- package/out-tsc/src/flow/operators.js.map +1 -1
- package/out-tsc/src/flow/types.js.map +1 -1
- package/out-tsc/src/flow/utils.js +79 -3
- package/out-tsc/src/flow/utils.js.map +1 -1
- package/out-tsc/src/form/ArrayEditor.js +4 -2
- package/out-tsc/src/form/ArrayEditor.js.map +1 -1
- package/out-tsc/src/form/FieldRenderer.js +56 -0
- package/out-tsc/src/form/FieldRenderer.js.map +1 -1
- package/out-tsc/src/interfaces.js +1 -0
- package/out-tsc/src/interfaces.js.map +1 -1
- package/out-tsc/src/layout/Dialog.js +51 -7
- package/out-tsc/src/layout/Dialog.js.map +1 -1
- package/out-tsc/src/layout/Modax.js +20 -2
- package/out-tsc/src/layout/Modax.js.map +1 -1
- package/out-tsc/src/list/ContentMenu.js +14 -1
- package/out-tsc/src/list/ContentMenu.js.map +1 -1
- package/out-tsc/src/locales/es.js +5 -5
- package/out-tsc/src/locales/es.js.map +1 -1
- package/out-tsc/src/locales/fr.js +5 -5
- package/out-tsc/src/locales/fr.js.map +1 -1
- package/out-tsc/src/locales/locale-codes.js +11 -2
- package/out-tsc/src/locales/locale-codes.js.map +1 -1
- package/out-tsc/src/locales/pt.js +5 -5
- package/out-tsc/src/locales/pt.js.map +1 -1
- package/out-tsc/src/simulator/Simulator.js +21 -4
- package/out-tsc/src/simulator/Simulator.js.map +1 -1
- package/out-tsc/src/store/AppState.js +102 -3
- package/out-tsc/src/store/AppState.js.map +1 -1
- package/out-tsc/test/actions/add_contact_groups.test.js +35 -0
- package/out-tsc/test/actions/add_contact_groups.test.js.map +1 -1
- package/out-tsc/test/actions/add_input_labels.test.js +53 -0
- package/out-tsc/test/actions/add_input_labels.test.js.map +1 -0
- package/out-tsc/test/actions/enter_flow.test.js +71 -0
- package/out-tsc/test/actions/enter_flow.test.js.map +1 -0
- package/out-tsc/test/actions/play_audio.test.js +118 -0
- package/out-tsc/test/actions/play_audio.test.js.map +1 -0
- package/out-tsc/test/actions/remove_contact_groups.test.js +24 -0
- package/out-tsc/test/actions/remove_contact_groups.test.js.map +1 -1
- package/out-tsc/test/actions/say_msg.test.js +158 -0
- package/out-tsc/test/actions/say_msg.test.js.map +1 -0
- package/out-tsc/test/actions/send_broadcast.test.js +41 -0
- package/out-tsc/test/actions/send_broadcast.test.js.map +1 -1
- package/out-tsc/test/actions/set_contact_channel.test.js +67 -0
- package/out-tsc/test/actions/set_contact_channel.test.js.map +1 -0
- package/out-tsc/test/actions/set_contact_field.test.js +52 -0
- package/out-tsc/test/actions/set_contact_field.test.js.map +1 -0
- package/out-tsc/test/actions/set_contact_language.test.js +39 -0
- package/out-tsc/test/actions/set_contact_language.test.js.map +1 -0
- package/out-tsc/test/actions/set_contact_name.test.js +28 -0
- package/out-tsc/test/actions/set_contact_name.test.js.map +1 -0
- package/out-tsc/test/actions/set_contact_status.test.js +44 -0
- package/out-tsc/test/actions/set_contact_status.test.js.map +1 -0
- package/out-tsc/test/actions/set_run_result.test.js +47 -0
- package/out-tsc/test/actions/set_run_result.test.js.map +1 -0
- package/out-tsc/test/actions/start_session.test.js +76 -0
- package/out-tsc/test/actions/start_session.test.js.map +1 -1
- package/out-tsc/test/nodes/split_by_contact_field.test.js +50 -0
- package/out-tsc/test/nodes/split_by_contact_field.test.js.map +1 -1
- package/out-tsc/test/nodes/split_by_run_result.test.js +82 -0
- package/out-tsc/test/nodes/split_by_run_result.test.js.map +1 -1
- package/out-tsc/test/nodes/split_by_ticket.test.js +139 -0
- package/out-tsc/test/nodes/split_by_ticket.test.js.map +1 -0
- package/out-tsc/test/nodes/split_by_webhook.test.js +111 -0
- package/out-tsc/test/nodes/split_by_webhook.test.js.map +1 -0
- package/out-tsc/test/nodes/wait_for_audio.test.js +156 -0
- package/out-tsc/test/nodes/wait_for_audio.test.js.map +1 -0
- package/out-tsc/test/nodes/wait_for_dial.test.js +336 -0
- package/out-tsc/test/nodes/wait_for_dial.test.js.map +1 -0
- package/out-tsc/test/nodes/wait_for_digits.test.js +198 -84
- package/out-tsc/test/nodes/wait_for_digits.test.js.map +1 -1
- package/out-tsc/test/nodes/wait_for_menu.test.js +340 -0
- package/out-tsc/test/nodes/wait_for_menu.test.js.map +1 -0
- package/out-tsc/test/temba-flow-collision.test.js +261 -6
- package/out-tsc/test/temba-flow-collision.test.js.map +1 -1
- package/out-tsc/test/temba-flow-editor.test.js +187 -0
- package/out-tsc/test/temba-flow-editor.test.js.map +1 -1
- package/out-tsc/test/temba-flow-plumber.test.js +19 -0
- package/out-tsc/test/temba-flow-plumber.test.js.map +1 -1
- package/out-tsc/test/temba-node-type-selector.test.js +6 -6
- package/out-tsc/test/temba-node-type-selector.test.js.map +1 -1
- package/out-tsc/test/temba-select.test.js +4 -1
- package/out-tsc/test/temba-select.test.js.map +1 -1
- package/out-tsc/test/utils.test.js +4 -2
- package/out-tsc/test/utils.test.js.map +1 -1
- package/package.json +3 -9
- package/screenshots/truth/actions/add_contact_groups/render/descriptive-group-names.png +0 -0
- package/screenshots/truth/actions/add_contact_groups/render/long-group-names.png +0 -0
- package/screenshots/truth/actions/add_contact_groups/render/many-groups.png +0 -0
- package/screenshots/truth/actions/add_contact_groups/render/multiple-groups.png +0 -0
- package/screenshots/truth/actions/add_contact_groups/render/single-group.png +0 -0
- package/screenshots/truth/actions/add_contact_urn/render/expression-facebook.png +0 -0
- package/screenshots/truth/actions/add_contact_urn/render/expression-phone.png +0 -0
- package/screenshots/truth/actions/add_contact_urn/render/facebook-id.png +0 -0
- package/screenshots/truth/actions/add_contact_urn/render/instagram-handle.png +0 -0
- package/screenshots/truth/actions/add_contact_urn/render/line-id.png +0 -0
- package/screenshots/truth/actions/add_contact_urn/render/phone-number.png +0 -0
- package/screenshots/truth/actions/add_contact_urn/render/telegram-id.png +0 -0
- package/screenshots/truth/actions/add_contact_urn/render/viber-id.png +0 -0
- package/screenshots/truth/actions/add_contact_urn/render/wechat-id.png +0 -0
- package/screenshots/truth/actions/add_contact_urn/render/whatsapp.png +0 -0
- package/screenshots/truth/actions/add_input_labels/editor/multiple-labels.png +0 -0
- package/screenshots/truth/actions/add_input_labels/editor/single-label.png +0 -0
- package/screenshots/truth/actions/add_input_labels/render/multiple-labels.png +0 -0
- package/screenshots/truth/actions/add_input_labels/render/single-label.png +0 -0
- package/screenshots/truth/actions/enter_flow/editor/basic-flow.png +0 -0
- package/screenshots/truth/actions/enter_flow/editor/long-flow-name.png +0 -0
- package/screenshots/truth/actions/enter_flow/render/basic-flow.png +0 -0
- package/screenshots/truth/actions/enter_flow/render/long-flow-name.png +0 -0
- package/screenshots/truth/actions/play_audio/editor/expression-url.png +0 -0
- package/screenshots/truth/actions/play_audio/editor/static-url.png +0 -0
- package/screenshots/truth/actions/play_audio/render/expression-url.png +0 -0
- package/screenshots/truth/actions/play_audio/render/static-url.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/render/cleanup-groups.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/render/long-descriptive-group-names.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/render/many-groups.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/render/multiple-groups.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/render/remove-from-all-groups.png +0 -0
- package/screenshots/truth/actions/remove_contact_groups/render/single-group.png +0 -0
- package/screenshots/truth/actions/say_msg/editor/multiline-text.png +0 -0
- package/screenshots/truth/actions/say_msg/editor/simple-text.png +0 -0
- package/screenshots/truth/actions/say_msg/editor/text-with-audio-url.png +0 -0
- package/screenshots/truth/actions/say_msg/render/multiline-text.png +0 -0
- package/screenshots/truth/actions/say_msg/render/simple-text.png +0 -0
- package/screenshots/truth/actions/say_msg/render/text-with-audio-url.png +0 -0
- package/screenshots/truth/actions/send_broadcast/render/contacts-only.png +0 -0
- package/screenshots/truth/actions/send_broadcast/render/groups-and-contacts.png +0 -0
- package/screenshots/truth/actions/send_broadcast/render/groups-only.png +0 -0
- package/screenshots/truth/actions/send_broadcast/render/many-groups.png +0 -0
- package/screenshots/truth/actions/send_broadcast/render/multiline-text.png +0 -0
- package/screenshots/truth/actions/send_email/render/complex-business-email.png +0 -0
- package/screenshots/truth/actions/send_email/render/empty-body.png +0 -0
- package/screenshots/truth/actions/send_email/render/empty-subject.png +0 -0
- package/screenshots/truth/actions/send_email/render/long-subject.png +0 -0
- package/screenshots/truth/actions/send_email/render/multiline-body.png +0 -0
- package/screenshots/truth/actions/send_email/render/multiple-recipients.png +0 -0
- package/screenshots/truth/actions/send_email/render/simple-email.png +0 -0
- package/screenshots/truth/actions/send_email/render/with-expressions.png +0 -0
- package/screenshots/truth/actions/send_msg/render/long-quick-replies.png +0 -0
- package/screenshots/truth/actions/send_msg/render/multiline-text-with-replies.png +0 -0
- package/screenshots/truth/actions/send_msg/render/simple-text.png +0 -0
- package/screenshots/truth/actions/send_msg/render/text-with-linebreaks.png +0 -0
- package/screenshots/truth/actions/send_msg/render/text-with-many-quick-replies.png +0 -0
- package/screenshots/truth/actions/send_msg/render/text-with-quick-replies.png +0 -0
- package/screenshots/truth/actions/send_msg/render/text-without-quick-replies.png +0 -0
- package/screenshots/truth/actions/set_contact_channel/editor/sms-channel.png +0 -0
- package/screenshots/truth/actions/set_contact_channel/editor/whatsapp-channel.png +0 -0
- package/screenshots/truth/actions/set_contact_channel/render/sms-channel.png +0 -0
- package/screenshots/truth/actions/set_contact_channel/render/whatsapp-channel.png +0 -0
- package/screenshots/truth/actions/set_contact_field/editor/clear-value.png +0 -0
- package/screenshots/truth/actions/set_contact_field/editor/set-value.png +0 -0
- package/screenshots/truth/actions/set_contact_field/render/clear-value.png +0 -0
- package/screenshots/truth/actions/set_contact_field/render/set-value.png +0 -0
- package/screenshots/truth/actions/set_contact_language/editor/english.png +0 -0
- package/screenshots/truth/actions/set_contact_language/editor/french.png +0 -0
- package/screenshots/truth/actions/set_contact_language/render/english.png +0 -0
- package/screenshots/truth/actions/set_contact_language/render/french.png +0 -0
- package/screenshots/truth/actions/set_contact_name/editor/expression-name.png +0 -0
- package/screenshots/truth/actions/set_contact_name/editor/static-name.png +0 -0
- package/screenshots/truth/actions/set_contact_name/render/expression-name.png +0 -0
- package/screenshots/truth/actions/set_contact_name/render/static-name.png +0 -0
- package/screenshots/truth/actions/set_contact_status/editor/active.png +0 -0
- package/screenshots/truth/actions/set_contact_status/editor/archived.png +0 -0
- package/screenshots/truth/actions/set_contact_status/editor/blocked.png +0 -0
- package/screenshots/truth/actions/set_contact_status/render/active.png +0 -0
- package/screenshots/truth/actions/set_contact_status/render/archived.png +0 -0
- package/screenshots/truth/actions/set_contact_status/render/blocked.png +0 -0
- package/screenshots/truth/actions/set_run_result/editor/expression-value.png +0 -0
- package/screenshots/truth/actions/set_run_result/editor/with-category.png +0 -0
- package/screenshots/truth/actions/set_run_result/render/expression-value.png +0 -0
- package/screenshots/truth/actions/set_run_result/render/with-category.png +0 -0
- package/screenshots/truth/actions/start_session/render/contact-query.png +0 -0
- package/screenshots/truth/actions/start_session/render/contacts-only.png +0 -0
- package/screenshots/truth/actions/start_session/render/create-contact.png +0 -0
- package/screenshots/truth/actions/start_session/render/groups-and-contacts.png +0 -0
- package/screenshots/truth/actions/start_session/render/groups-only.png +0 -0
- package/screenshots/truth/actions/start_session/render/many-recipients.png +0 -0
- package/screenshots/truth/editor/router.png +0 -0
- package/screenshots/truth/editor/wait.png +0 -0
- package/screenshots/truth/nodes/split_by_llm/render/information-extraction.png +0 -0
- package/screenshots/truth/nodes/split_by_llm/render/sentiment-analysis.png +0 -0
- package/screenshots/truth/nodes/split_by_llm/render/summarization.png +0 -0
- package/screenshots/truth/nodes/split_by_llm/render/translation-task.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/editor/basic-categorization.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/editor/custom-input-and-result-name.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/editor/feedback-categorization.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/editor/many-categories.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/editor/minimal-categories.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/render/basic-categorization.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/render/custom-input-and-result-name.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/render/feedback-categorization.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/render/many-categories.png +0 -0
- package/screenshots/truth/nodes/split_by_llm_categorize/render/minimal-categories.png +0 -0
- package/screenshots/truth/nodes/split_by_random/editor/ab-test-multiple-variants.png +0 -0
- package/screenshots/truth/nodes/split_by_random/editor/sampling-split.png +0 -0
- package/screenshots/truth/nodes/split_by_random/editor/three-way-split.png +0 -0
- package/screenshots/truth/nodes/split_by_random/editor/two-bucket-split.png +0 -0
- package/screenshots/truth/nodes/split_by_random/render/ab-test-multiple-variants.png +0 -0
- package/screenshots/truth/nodes/split_by_random/render/sampling-split.png +0 -0
- package/screenshots/truth/nodes/split_by_random/render/three-way-split.png +0 -0
- package/screenshots/truth/nodes/split_by_random/render/two-bucket-split.png +0 -0
- package/screenshots/truth/nodes/wait_for_audio/editor/basic-audio-wait.png +0 -0
- package/screenshots/truth/nodes/wait_for_audio/render/basic-audio-wait.png +0 -0
- package/screenshots/truth/nodes/wait_for_dial/editor/basic-dial.png +0 -0
- package/screenshots/truth/nodes/wait_for_dial/editor/dial-with-limits.png +0 -0
- package/screenshots/truth/nodes/wait_for_dial/render/basic-dial.png +0 -0
- package/screenshots/truth/nodes/wait_for_dial/render/dial-with-limits.png +0 -0
- package/screenshots/truth/nodes/wait_for_digits/editor/basic-digits-wait.png +0 -0
- package/screenshots/truth/nodes/wait_for_digits/editor/digits-with-rules.png +0 -0
- package/screenshots/truth/nodes/wait_for_digits/render/basic-digits-wait.png +0 -0
- package/screenshots/truth/nodes/wait_for_digits/render/digits-with-rules.png +0 -0
- package/screenshots/truth/nodes/wait_for_menu/editor/menu-with-digits.png +0 -0
- package/screenshots/truth/nodes/wait_for_menu/render/menu-with-digits.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/editor/basic-wait.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/editor/custom-result-name.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/editor/no-timeout.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/editor/short-timeout.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/render/basic-wait.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/render/custom-result-name.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/render/no-timeout.png +0 -0
- package/screenshots/truth/nodes/wait_for_response/render/short-timeout.png +0 -0
- package/src/display/Chat.ts +13 -7
- package/src/display/Dropdown.ts +3 -1
- package/src/display/FloatingTab.ts +4 -4
- package/src/display/Thumbnail.ts +162 -2
- package/src/flow/CanvasNode.ts +70 -24
- package/src/flow/Editor.ts +440 -99
- package/src/flow/NodeEditor.ts +137 -9
- package/src/flow/Plumber.ts +89 -14
- package/src/flow/StickyNote.ts +14 -4
- package/src/flow/actions/add_contact_groups.ts +4 -1
- package/src/flow/actions/add_input_labels.ts +4 -1
- package/src/flow/actions/audio-player.ts +127 -0
- package/src/flow/actions/enter_flow.ts +44 -0
- package/src/flow/actions/play_audio.ts +64 -5
- package/src/flow/actions/remove_contact_groups.ts +6 -1
- package/src/flow/actions/say_msg.ts +94 -4
- package/src/flow/actions/send_broadcast.ts +6 -2
- package/src/flow/actions/set_contact_channel.ts +13 -1
- package/src/flow/actions/set_contact_status.ts +7 -5
- package/src/flow/actions/start_session.ts +10 -3
- package/src/flow/config.ts +11 -3
- package/src/flow/nodes/shared-rules.ts +1 -1
- package/src/flow/nodes/split_by_contact_field.ts +16 -5
- package/src/flow/nodes/split_by_expression.ts +1 -1
- package/src/flow/nodes/split_by_llm_categorize.ts +0 -1
- package/src/flow/nodes/split_by_random.ts +0 -1
- package/src/flow/nodes/split_by_run_result.ts +10 -4
- package/src/flow/nodes/terminal.ts +9 -0
- package/src/flow/nodes/wait_for_audio.ts +88 -0
- package/src/flow/nodes/wait_for_dial.ts +176 -0
- package/src/flow/nodes/wait_for_digits.ts +87 -2
- package/src/flow/nodes/wait_for_menu.ts +209 -3
- package/src/flow/nodes/wait_for_response.ts +1 -1
- package/src/flow/operators.ts +23 -5
- package/src/flow/types.ts +23 -1
- package/src/flow/utils.ts +82 -3
- package/src/form/ArrayEditor.ts +4 -2
- package/src/form/FieldRenderer.ts +71 -1
- package/src/interfaces.ts +2 -1
- package/src/layout/Dialog.ts +52 -7
- package/src/layout/Modax.ts +19 -2
- package/src/list/ContentMenu.ts +15 -1
- package/src/locales/es.ts +18 -13
- package/src/locales/fr.ts +18 -13
- package/src/locales/locale-codes.ts +11 -2
- package/src/locales/pt.ts +18 -13
- package/src/simulator/Simulator.ts +25 -4
- package/src/store/AppState.ts +120 -1
- package/src/store/flow-definition.d.ts +2 -0
- package/test/actions/add_contact_groups.test.ts +38 -0
- package/test/actions/add_input_labels.test.ts +67 -0
- package/test/actions/enter_flow.test.ts +88 -0
- package/test/actions/play_audio.test.ts +155 -0
- package/test/actions/remove_contact_groups.test.ts +29 -0
- package/test/actions/say_msg.test.ts +196 -0
- package/test/actions/send_broadcast.test.ts +44 -0
- package/test/actions/set_contact_channel.test.ts +88 -0
- package/test/actions/set_contact_field.test.ts +68 -0
- package/test/actions/set_contact_language.test.ts +55 -0
- package/test/actions/set_contact_name.test.ts +39 -0
- package/test/actions/set_contact_status.test.ts +64 -0
- package/test/actions/set_run_result.test.ts +61 -0
- package/test/actions/start_session.test.ts +82 -0
- package/test/nodes/split_by_contact_field.test.ts +59 -0
- package/test/nodes/split_by_run_result.test.ts +100 -0
- package/test/nodes/split_by_ticket.test.ts +157 -0
- package/test/nodes/split_by_webhook.test.ts +131 -0
- package/test/nodes/wait_for_audio.test.ts +182 -0
- package/test/nodes/wait_for_dial.test.ts +382 -0
- package/test/nodes/wait_for_digits.test.ts +233 -109
- package/test/nodes/wait_for_menu.test.ts +383 -0
- package/test/temba-flow-collision.test.ts +286 -6
- package/test/temba-flow-editor.test.ts +240 -0
- package/test/temba-flow-plumber.test.ts +62 -0
- package/test/temba-node-type-selector.test.ts +6 -6
- package/test/temba-select.test.ts +6 -1
- package/test/utils.test.ts +4 -2
- package/screenshots/truth/nodes/wait_for_digits/editor/phone-number-collection.png +0 -0
- package/screenshots/truth/nodes/wait_for_digits/editor/single-digit-with-timeout.png +0 -0
- package/screenshots/truth/nodes/wait_for_digits/editor/verification-code.png +0 -0
- package/screenshots/truth/nodes/wait_for_digits/render/phone-number-collection.png +0 -0
- package/screenshots/truth/nodes/wait_for_digits/render/single-digit-with-timeout.png +0 -0
- package/screenshots/truth/nodes/wait_for_digits/render/verification-code.png +0 -0
|
@@ -2,6 +2,7 @@ import { expect } from '@open-wc/testing';
|
|
|
2
2
|
import { wait_for_digits } from '../../src/flow/nodes/wait_for_digits';
|
|
3
3
|
import { Node } from '../../src/store/flow-definition';
|
|
4
4
|
import { NodeTest } from '../NodeHelper';
|
|
5
|
+
import { createOperatorOption } from '../../src/flow/operators';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Test suite for the wait_for_digits node configuration.
|
|
@@ -20,15 +21,29 @@ describe('wait_for_digits node config', () => {
|
|
|
20
21
|
expect(wait_for_digits.type).to.equal('wait_for_digits');
|
|
21
22
|
});
|
|
22
23
|
|
|
23
|
-
it('
|
|
24
|
-
expect(wait_for_digits.
|
|
24
|
+
it('is voice-only', () => {
|
|
25
|
+
expect(wait_for_digits.flowTypes).to.deep.equal(['voice']);
|
|
25
26
|
});
|
|
26
27
|
|
|
27
|
-
it('
|
|
28
|
-
expect(wait_for_digits.form).to.
|
|
29
|
-
expect(wait_for_digits.
|
|
30
|
-
expect(wait_for_digits.
|
|
31
|
-
|
|
28
|
+
it('has form with rules and result_name', () => {
|
|
29
|
+
expect(wait_for_digits.form).to.exist;
|
|
30
|
+
expect(wait_for_digits.form!.rules).to.exist;
|
|
31
|
+
expect(wait_for_digits.form!.result_name).to.exist;
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('has layout configuration', () => {
|
|
35
|
+
expect(wait_for_digits.layout).to.deep.equal([
|
|
36
|
+
{
|
|
37
|
+
type: 'text',
|
|
38
|
+
text: 'Rules match against all digits pressed by the caller followed by the # sign.'
|
|
39
|
+
},
|
|
40
|
+
'rules',
|
|
41
|
+
'result_name'
|
|
42
|
+
]);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('has large dialog size', () => {
|
|
46
|
+
expect(wait_for_digits.dialogSize).to.equal('large');
|
|
32
47
|
});
|
|
33
48
|
});
|
|
34
49
|
|
|
@@ -40,157 +55,266 @@ describe('wait_for_digits node config', () => {
|
|
|
40
55
|
actions: [],
|
|
41
56
|
router: {
|
|
42
57
|
type: 'switch',
|
|
58
|
+
operand: '@input.text',
|
|
43
59
|
wait: {
|
|
44
60
|
type: 'msg',
|
|
45
61
|
hint: {
|
|
46
|
-
type: 'digits'
|
|
47
|
-
count: 4
|
|
62
|
+
type: 'digits'
|
|
48
63
|
}
|
|
49
64
|
},
|
|
50
65
|
result_name: 'digits',
|
|
66
|
+
default_category_uuid: 'all-cat',
|
|
67
|
+
cases: [],
|
|
51
68
|
categories: [
|
|
52
69
|
{
|
|
53
|
-
uuid: '
|
|
54
|
-
name: '
|
|
55
|
-
exit_uuid: '
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
uuid: 'digits-cat-2',
|
|
59
|
-
name: 'Other',
|
|
60
|
-
exit_uuid: 'digits-exit-2'
|
|
70
|
+
uuid: 'all-cat',
|
|
71
|
+
name: 'All Responses',
|
|
72
|
+
exit_uuid: 'all-exit'
|
|
61
73
|
}
|
|
62
74
|
]
|
|
63
75
|
},
|
|
64
|
-
exits: [
|
|
65
|
-
{ uuid: 'digits-exit-1', destination_uuid: null },
|
|
66
|
-
{ uuid: 'digits-exit-2', destination_uuid: null }
|
|
67
|
-
]
|
|
76
|
+
exits: [{ uuid: 'all-exit', destination_uuid: null }]
|
|
68
77
|
} as Node,
|
|
69
78
|
{ type: 'wait_for_digits' },
|
|
70
79
|
'basic-digits-wait'
|
|
71
80
|
);
|
|
72
81
|
});
|
|
73
82
|
|
|
74
|
-
it('renders
|
|
83
|
+
it('renders digits with rules', async () => {
|
|
75
84
|
await helper.testNode(
|
|
76
85
|
{
|
|
77
86
|
uuid: 'test-digits-node-2',
|
|
78
87
|
actions: [],
|
|
79
88
|
router: {
|
|
80
89
|
type: 'switch',
|
|
90
|
+
operand: '@input.text',
|
|
81
91
|
wait: {
|
|
82
92
|
type: 'msg',
|
|
83
93
|
hint: {
|
|
84
|
-
type: 'digits'
|
|
85
|
-
count: 1
|
|
86
|
-
},
|
|
87
|
-
timeout: {
|
|
88
|
-
category_uuid: 'timeout-cat',
|
|
89
|
-
seconds: 30
|
|
94
|
+
type: 'digits'
|
|
90
95
|
}
|
|
91
96
|
},
|
|
92
|
-
result_name: '
|
|
93
|
-
|
|
97
|
+
result_name: 'pin',
|
|
98
|
+
default_category_uuid: 'other-cat',
|
|
99
|
+
cases: [
|
|
94
100
|
{
|
|
95
|
-
uuid: '
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
101
|
+
uuid: 'case-1',
|
|
102
|
+
type: 'has_number_eq',
|
|
103
|
+
arguments: ['1234'],
|
|
104
|
+
category_uuid: 'valid-cat'
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
categories: [
|
|
99
108
|
{
|
|
100
|
-
uuid: '
|
|
101
|
-
name: '
|
|
102
|
-
exit_uuid: '
|
|
109
|
+
uuid: 'valid-cat',
|
|
110
|
+
name: 'Valid PIN',
|
|
111
|
+
exit_uuid: 'valid-exit'
|
|
103
112
|
},
|
|
104
113
|
{
|
|
105
|
-
uuid: '
|
|
114
|
+
uuid: 'other-cat',
|
|
106
115
|
name: 'Other',
|
|
107
|
-
exit_uuid: '
|
|
116
|
+
exit_uuid: 'other-exit'
|
|
108
117
|
}
|
|
109
118
|
]
|
|
110
119
|
},
|
|
111
120
|
exits: [
|
|
112
|
-
{ uuid: '
|
|
113
|
-
{ uuid: '
|
|
114
|
-
{ uuid: 'digits-exit-2', destination_uuid: null }
|
|
121
|
+
{ uuid: 'valid-exit', destination_uuid: null },
|
|
122
|
+
{ uuid: 'other-exit', destination_uuid: null }
|
|
115
123
|
]
|
|
116
124
|
} as Node,
|
|
117
125
|
{ type: 'wait_for_digits' },
|
|
118
|
-
'
|
|
126
|
+
'digits-with-rules'
|
|
119
127
|
);
|
|
120
128
|
});
|
|
129
|
+
});
|
|
121
130
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
131
|
+
describe('data transformation', () => {
|
|
132
|
+
it('converts node to form data', () => {
|
|
133
|
+
const node: Node = {
|
|
134
|
+
uuid: 'test-node',
|
|
135
|
+
actions: [],
|
|
136
|
+
router: {
|
|
137
|
+
type: 'switch',
|
|
138
|
+
result_name: 'digits',
|
|
139
|
+
operand: '@input.text',
|
|
140
|
+
categories: [
|
|
141
|
+
{
|
|
142
|
+
uuid: 'valid-cat',
|
|
143
|
+
name: 'Valid',
|
|
144
|
+
exit_uuid: 'valid-exit'
|
|
135
145
|
},
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
]
|
|
150
|
-
},
|
|
151
|
-
exits: [
|
|
152
|
-
{ uuid: 'phone-exit-1', destination_uuid: null },
|
|
153
|
-
{ uuid: 'phone-exit-2', destination_uuid: null },
|
|
154
|
-
{ uuid: 'phone-exit-3', destination_uuid: null }
|
|
146
|
+
{
|
|
147
|
+
uuid: 'other-cat',
|
|
148
|
+
name: 'Other',
|
|
149
|
+
exit_uuid: 'other-exit'
|
|
150
|
+
}
|
|
151
|
+
],
|
|
152
|
+
cases: [
|
|
153
|
+
{
|
|
154
|
+
uuid: 'case-1',
|
|
155
|
+
type: 'has_number_eq',
|
|
156
|
+
arguments: ['1234'],
|
|
157
|
+
category_uuid: 'valid-cat'
|
|
158
|
+
}
|
|
155
159
|
]
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
+
},
|
|
161
|
+
exits: [
|
|
162
|
+
{ uuid: 'valid-exit', destination_uuid: null },
|
|
163
|
+
{ uuid: 'other-exit', destination_uuid: null }
|
|
164
|
+
]
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
const formData = wait_for_digits.toFormData!(node);
|
|
168
|
+
|
|
169
|
+
expect(formData.uuid).to.equal('test-node');
|
|
170
|
+
expect(formData.result_name).to.equal('digits');
|
|
171
|
+
expect(formData.rules).to.have.length(1);
|
|
172
|
+
expect(formData.rules[0]).to.deep.equal({
|
|
173
|
+
operator: createOperatorOption('has_number_eq'),
|
|
174
|
+
value1: '1234',
|
|
175
|
+
value2: '',
|
|
176
|
+
category: 'Valid'
|
|
177
|
+
});
|
|
160
178
|
});
|
|
161
179
|
|
|
162
|
-
it('
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
180
|
+
it('converts node with no rules to form data', () => {
|
|
181
|
+
const node: Node = {
|
|
182
|
+
uuid: 'test-node',
|
|
183
|
+
actions: [],
|
|
184
|
+
router: {
|
|
185
|
+
type: 'switch',
|
|
186
|
+
result_name: 'digits',
|
|
187
|
+
categories: []
|
|
188
|
+
},
|
|
189
|
+
exits: []
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
const formData = wait_for_digits.toFormData!(node);
|
|
193
|
+
expect(formData.rules).to.deep.equal([]);
|
|
194
|
+
expect(formData.result_name).to.equal('digits');
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
it('converts form data to node with rules', () => {
|
|
198
|
+
const formData = {
|
|
199
|
+
uuid: 'test-node',
|
|
200
|
+
result_name: 'digits',
|
|
201
|
+
rules: [
|
|
202
|
+
{
|
|
203
|
+
operator: { value: 'has_number_eq', name: 'is equal to' },
|
|
204
|
+
value1: '1234',
|
|
205
|
+
value2: '',
|
|
206
|
+
category: 'Valid PIN'
|
|
207
|
+
}
|
|
208
|
+
]
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
const originalNode: Node = {
|
|
212
|
+
uuid: 'test-node',
|
|
213
|
+
actions: [],
|
|
214
|
+
exits: [],
|
|
215
|
+
router: { type: 'switch', categories: [] }
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
const result = wait_for_digits.fromFormData!(formData, originalNode);
|
|
219
|
+
|
|
220
|
+
expect(result.uuid).to.equal('test-node');
|
|
221
|
+
expect(result.router?.result_name).to.equal('digits');
|
|
222
|
+
expect(result.router?.operand).to.equal('@input.text');
|
|
223
|
+
expect(result.router?.categories).to.have.length(2); // Valid PIN, Other
|
|
224
|
+
expect(result.router?.cases).to.have.length(1);
|
|
225
|
+
expect(result.exits).to.have.length(2);
|
|
226
|
+
|
|
227
|
+
// Check wait config has digits hint (without count)
|
|
228
|
+
expect(result.router?.wait?.type).to.equal('msg');
|
|
229
|
+
expect(result.router?.wait?.hint?.type).to.equal('digits');
|
|
230
|
+
expect(result.router?.wait?.hint?.count).to.be.undefined;
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
it('converts form data with no rules', () => {
|
|
234
|
+
const formData = {
|
|
235
|
+
uuid: 'test-node',
|
|
236
|
+
result_name: 'digits',
|
|
237
|
+
rules: []
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
const originalNode: Node = {
|
|
241
|
+
uuid: 'test-node',
|
|
242
|
+
actions: [],
|
|
243
|
+
exits: [],
|
|
244
|
+
router: { type: 'switch', categories: [] }
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
const result = wait_for_digits.fromFormData!(formData, originalNode);
|
|
248
|
+
|
|
249
|
+
// Should have just "All Responses" default category (no user rules)
|
|
250
|
+
expect(result.router?.categories).to.have.length(1);
|
|
251
|
+
expect(result.router!.categories[0].name).to.equal('All Responses');
|
|
252
|
+
expect(result.router?.cases).to.have.length(0);
|
|
253
|
+
expect(result.router?.wait?.hint?.type).to.equal('digits');
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
it('preserves category UUIDs', () => {
|
|
257
|
+
const formData = {
|
|
258
|
+
uuid: 'test-node',
|
|
259
|
+
result_name: 'digits',
|
|
260
|
+
rules: [
|
|
261
|
+
{
|
|
262
|
+
operator: { value: 'has_number_eq', name: 'is equal to' },
|
|
263
|
+
value1: '1234',
|
|
264
|
+
value2: '',
|
|
265
|
+
category: 'Valid'
|
|
266
|
+
}
|
|
267
|
+
]
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
const originalNode: Node = {
|
|
271
|
+
uuid: 'test-node',
|
|
272
|
+
actions: [],
|
|
273
|
+
router: {
|
|
274
|
+
type: 'switch',
|
|
275
|
+
categories: [
|
|
276
|
+
{
|
|
277
|
+
uuid: 'orig-valid',
|
|
278
|
+
name: 'Valid',
|
|
279
|
+
exit_uuid: 'orig-valid-exit'
|
|
175
280
|
},
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
281
|
+
{
|
|
282
|
+
uuid: 'orig-other',
|
|
283
|
+
name: 'Other',
|
|
284
|
+
exit_uuid: 'orig-other-exit'
|
|
285
|
+
}
|
|
286
|
+
],
|
|
287
|
+
cases: [
|
|
288
|
+
{
|
|
289
|
+
uuid: 'orig-case',
|
|
290
|
+
type: 'has_number_eq',
|
|
291
|
+
arguments: ['1234'],
|
|
292
|
+
category_uuid: 'orig-valid'
|
|
293
|
+
}
|
|
189
294
|
]
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
295
|
+
},
|
|
296
|
+
exits: [
|
|
297
|
+
{ uuid: 'orig-valid-exit', destination_uuid: 'dest-1' },
|
|
298
|
+
{ uuid: 'orig-other-exit', destination_uuid: null }
|
|
299
|
+
]
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
const result = wait_for_digits.fromFormData!(formData, originalNode);
|
|
303
|
+
|
|
304
|
+
const valid = result.router!.categories.find((c) => c.name === 'Valid');
|
|
305
|
+
expect(valid?.uuid).to.equal('orig-valid');
|
|
306
|
+
expect(valid?.exit_uuid).to.equal('orig-valid-exit');
|
|
307
|
+
|
|
308
|
+
const other = result.router!.categories.find((c) => c.name === 'Other');
|
|
309
|
+
expect(other?.uuid).to.equal('orig-other');
|
|
310
|
+
});
|
|
311
|
+
});
|
|
312
|
+
|
|
313
|
+
describe('validation', () => {
|
|
314
|
+
it('validates with no errors', () => {
|
|
315
|
+
const formData = { rules: [] };
|
|
316
|
+
const result = wait_for_digits.validate!(formData);
|
|
317
|
+
expect(result.valid).to.be.true;
|
|
194
318
|
});
|
|
195
319
|
});
|
|
196
320
|
});
|