@botonic/plugin-flow-builder 0.57.0-rslib-esm.2 → 0.57.1-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/cjs/action/ai-agent-from-user-input.d.ts +3 -0
- package/lib/cjs/action/ai-agent-from-user-input.js +38 -0
- package/lib/cjs/action/ai-agent-from-user-input.js.map +1 -0
- package/lib/cjs/action/context.d.ts +11 -0
- package/lib/cjs/action/context.js +17 -0
- package/lib/cjs/action/context.js.map +1 -0
- package/lib/cjs/action/fallback.d.ts +3 -0
- package/lib/cjs/action/fallback.js +36 -0
- package/lib/cjs/action/fallback.js.map +1 -0
- package/lib/cjs/action/first-interaction.d.ts +3 -0
- package/lib/cjs/action/first-interaction.js +93 -0
- package/lib/cjs/action/first-interaction.js.map +1 -0
- package/lib/cjs/action/get-contents.d.ts +3 -0
- package/lib/cjs/action/get-contents.js +44 -0
- package/lib/cjs/action/get-contents.js.map +1 -0
- package/lib/cjs/action/index.d.ts +25 -0
- package/lib/cjs/action/index.js +95 -0
- package/lib/cjs/action/index.js.map +1 -0
- package/lib/cjs/action/payload.d.ts +3 -0
- package/lib/cjs/action/payload.js +74 -0
- package/lib/cjs/action/payload.js.map +1 -0
- package/lib/cjs/api.d.ts +45 -0
- package/lib/cjs/api.js +227 -0
- package/lib/cjs/api.js.map +1 -0
- package/lib/cjs/bot-context-manager.d.ts +17 -0
- package/lib/cjs/bot-context-manager.js +93 -0
- package/lib/cjs/bot-context-manager.js.map +1 -0
- package/lib/cjs/constants.d.ts +14 -0
- package/lib/cjs/constants.js +20 -0
- package/lib/cjs/constants.js.map +1 -0
- package/lib/cjs/content-fields/contact-reasons-conditional-matcher.d.ts +4 -0
- package/lib/cjs/content-fields/contact-reasons-conditional-matcher.js +12 -0
- package/lib/cjs/content-fields/contact-reasons-conditional-matcher.js.map +1 -0
- package/lib/cjs/content-fields/content-fields-base.d.ts +20 -0
- package/lib/cjs/content-fields/content-fields-base.js +74 -0
- package/lib/cjs/content-fields/content-fields-base.js.map +1 -0
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.d.ts +15 -0
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +71 -0
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +1 -0
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.d.ts +9 -0
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.js +58 -0
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +1 -0
- package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.d.ts +17 -0
- package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.js +79 -0
- package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.js.map +1 -0
- package/lib/cjs/content-fields/flow-ai-agent-base.d.ts +25 -0
- package/lib/cjs/content-fields/flow-ai-agent-base.js +97 -0
- package/lib/cjs/content-fields/flow-ai-agent-base.js.map +1 -0
- package/lib/cjs/content-fields/flow-ai-agent-router.d.ts +21 -0
- package/lib/cjs/content-fields/flow-ai-agent-router.js +126 -0
- package/lib/cjs/content-fields/flow-ai-agent-router.js.map +1 -0
- package/lib/cjs/content-fields/flow-ai-agent.d.ts +17 -0
- package/lib/cjs/content-fields/flow-ai-agent.js +65 -0
- package/lib/cjs/content-fields/flow-ai-agent.js.map +1 -0
- package/lib/cjs/content-fields/flow-bot-action.d.ts +14 -0
- package/lib/cjs/content-fields/flow-bot-action.js +45 -0
- package/lib/cjs/content-fields/flow-bot-action.js.map +1 -0
- package/lib/cjs/content-fields/flow-button.d.ts +31 -0
- package/lib/cjs/content-fields/flow-button.js +86 -0
- package/lib/cjs/content-fields/flow-button.js.map +1 -0
- package/lib/cjs/content-fields/flow-capture-user-input.d.ts +14 -0
- package/lib/cjs/content-fields/flow-capture-user-input.js +45 -0
- package/lib/cjs/content-fields/flow-capture-user-input.js.map +1 -0
- package/lib/cjs/content-fields/flow-carousel.d.ts +22 -0
- package/lib/cjs/content-fields/flow-carousel.js +152 -0
- package/lib/cjs/content-fields/flow-carousel.js.map +1 -0
- package/lib/cjs/content-fields/flow-channel-conditional.d.ts +14 -0
- package/lib/cjs/content-fields/flow-channel-conditional.js +57 -0
- package/lib/cjs/content-fields/flow-channel-conditional.js.map +1 -0
- package/lib/cjs/content-fields/flow-contact-reasons-conditional.d.ts +17 -0
- package/lib/cjs/content-fields/flow-contact-reasons-conditional.js +88 -0
- package/lib/cjs/content-fields/flow-contact-reasons-conditional.js.map +1 -0
- package/lib/cjs/content-fields/flow-country-conditional.d.ts +13 -0
- package/lib/cjs/content-fields/flow-country-conditional.js +59 -0
- package/lib/cjs/content-fields/flow-country-conditional.js.map +1 -0
- package/lib/cjs/content-fields/flow-custom-conditional.d.ts +17 -0
- package/lib/cjs/content-fields/flow-custom-conditional.js +89 -0
- package/lib/cjs/content-fields/flow-custom-conditional.js.map +1 -0
- package/lib/cjs/content-fields/flow-do-nothing.d.ts +9 -0
- package/lib/cjs/content-fields/flow-do-nothing.js +27 -0
- package/lib/cjs/content-fields/flow-do-nothing.js.map +1 -0
- package/lib/cjs/content-fields/flow-element.d.ts +22 -0
- package/lib/cjs/content-fields/flow-element.js +50 -0
- package/lib/cjs/content-fields/flow-element.js.map +1 -0
- package/lib/cjs/content-fields/flow-go-to-flow.d.ts +13 -0
- package/lib/cjs/content-fields/flow-go-to-flow.js +51 -0
- package/lib/cjs/content-fields/flow-go-to-flow.js.map +1 -0
- package/lib/cjs/content-fields/flow-handoff.d.ts +23 -0
- package/lib/cjs/content-fields/flow-handoff.js +104 -0
- package/lib/cjs/content-fields/flow-handoff.js.map +1 -0
- package/lib/cjs/content-fields/flow-image.d.ts +10 -0
- package/lib/cjs/content-fields/flow-image.js +33 -0
- package/lib/cjs/content-fields/flow-image.js.map +1 -0
- package/lib/cjs/content-fields/flow-queue-status-conditional.d.ts +30 -0
- package/lib/cjs/content-fields/flow-queue-status-conditional.js +95 -0
- package/lib/cjs/content-fields/flow-queue-status-conditional.js.map +1 -0
- package/lib/cjs/content-fields/flow-rating.d.ts +15 -0
- package/lib/cjs/content-fields/flow-rating.js +66 -0
- package/lib/cjs/content-fields/flow-rating.js.map +1 -0
- package/lib/cjs/content-fields/flow-text.d.ts +15 -0
- package/lib/cjs/content-fields/flow-text.js +60 -0
- package/lib/cjs/content-fields/flow-text.js.map +1 -0
- package/lib/cjs/content-fields/flow-video.d.ts +10 -0
- package/lib/cjs/content-fields/flow-video.js +33 -0
- package/lib/cjs/content-fields/flow-video.js.map +1 -0
- package/lib/cjs/content-fields/flow-webview.d.ts +16 -0
- package/lib/cjs/content-fields/flow-webview.js +78 -0
- package/lib/cjs/content-fields/flow-webview.js.map +1 -0
- package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.d.ts +21 -0
- package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js +92 -0
- package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js.map +1 -0
- package/lib/cjs/content-fields/flow-whatsapp-request-contact-info.d.ts +11 -0
- package/lib/cjs/content-fields/flow-whatsapp-request-contact-info.js +46 -0
- package/lib/cjs/content-fields/flow-whatsapp-request-contact-info.js.map +1 -0
- package/lib/cjs/content-fields/flow-whatsapp-template.d.ts +37 -0
- package/lib/cjs/content-fields/flow-whatsapp-template.js +264 -0
- package/lib/cjs/content-fields/flow-whatsapp-template.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/ai-agent-router.d.ts +21 -0
- package/lib/cjs/content-fields/hubtype-fields/ai-agent-router.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/ai-agent-router.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/ai-agent.d.ts +25 -0
- package/lib/cjs/content-fields/hubtype-fields/ai-agent.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/ai-agent.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/bot-action.d.ts +10 -0
- package/lib/cjs/content-fields/hubtype-fields/bot-action.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/bot-action.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/button.d.ts +8 -0
- package/lib/cjs/content-fields/hubtype-fields/button.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/button.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/capture-user-input.d.ts +19 -0
- package/lib/cjs/content-fields/hubtype-fields/capture-user-input.js +12 -0
- package/lib/cjs/content-fields/hubtype-fields/capture-user-input.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/carousel.d.ts +17 -0
- package/lib/cjs/content-fields/hubtype-fields/carousel.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/carousel.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/channel-conditional.d.ts +10 -0
- package/lib/cjs/content-fields/hubtype-fields/channel-conditional.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/channel-conditional.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/common.d.ts +83 -0
- package/lib/cjs/content-fields/hubtype-fields/common.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/common.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/contact-reasons-conditional.d.ts +19 -0
- package/lib/cjs/content-fields/hubtype-fields/contact-reasons-conditional.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/contact-reasons-conditional.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/country-conditional.d.ts +10 -0
- package/lib/cjs/content-fields/hubtype-fields/country-conditional.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/country-conditional.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.d.ts +56 -0
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.js +36 -0
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional.d.ts +11 -0
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/do-nothing.d.ts +6 -0
- package/lib/cjs/content-fields/hubtype-fields/do-nothing.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/do-nothing.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/fallback.d.ts +9 -0
- package/lib/cjs/content-fields/hubtype-fields/fallback.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/fallback.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/function.d.ts +30 -0
- package/lib/cjs/content-fields/hubtype-fields/function.js +11 -0
- package/lib/cjs/content-fields/hubtype-fields/function.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/go-to-flow.d.ts +9 -0
- package/lib/cjs/content-fields/hubtype-fields/go-to-flow.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/go-to-flow.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/handoff.d.ts +21 -0
- package/lib/cjs/content-fields/hubtype-fields/handoff.js +10 -0
- package/lib/cjs/content-fields/hubtype-fields/handoff.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/image.d.ts +8 -0
- package/lib/cjs/content-fields/hubtype-fields/image.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/image.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/index.d.ts +28 -0
- package/lib/cjs/content-fields/hubtype-fields/index.js +32 -0
- package/lib/cjs/content-fields/hubtype-fields/index.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/keyword.d.ts +9 -0
- package/lib/cjs/content-fields/hubtype-fields/keyword.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/keyword.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/node-types.d.ts +33 -0
- package/lib/cjs/content-fields/hubtype-fields/node-types.js +40 -0
- package/lib/cjs/content-fields/hubtype-fields/node-types.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/nodes.d.ts +28 -0
- package/lib/cjs/content-fields/hubtype-fields/nodes.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/nodes.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/payload.d.ts +8 -0
- package/lib/cjs/content-fields/hubtype-fields/payload.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/payload.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.d.ts +25 -0
- package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/rating.d.ts +23 -0
- package/lib/cjs/content-fields/hubtype-fields/rating.js +9 -0
- package/lib/cjs/content-fields/hubtype-fields/rating.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/smart-intent.d.ts +12 -0
- package/lib/cjs/content-fields/hubtype-fields/smart-intent.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/smart-intent.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/text.d.ts +11 -0
- package/lib/cjs/content-fields/hubtype-fields/text.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/text.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/url.d.ts +8 -0
- package/lib/cjs/content-fields/hubtype-fields/url.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/url.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/video.d.ts +8 -0
- package/lib/cjs/content-fields/hubtype-fields/video.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/video.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/webview.d.ts +17 -0
- package/lib/cjs/content-fields/hubtype-fields/webview.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/webview.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.d.ts +21 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.d.ts +17 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-request-contact-info.d.ts +10 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-request-contact-info.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.d.ts +96 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.js +9 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.js.map +1 -0
- package/lib/cjs/content-fields/index.d.ts +27 -0
- package/lib/cjs/content-fields/index.js +56 -0
- package/lib/cjs/content-fields/index.js.map +1 -0
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +14 -0
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +41 -0
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +1 -0
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +13 -0
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +36 -0
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +1 -0
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +14 -0
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +46 -0
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +1 -0
- package/lib/cjs/content-fields/whatsapp-button-list/index.d.ts +3 -0
- package/lib/cjs/content-fields/whatsapp-button-list/index.js +10 -0
- package/lib/cjs/content-fields/whatsapp-button-list/index.js.map +1 -0
- package/lib/cjs/filters/index.d.ts +12 -0
- package/lib/cjs/filters/index.js +17 -0
- package/lib/cjs/filters/index.js.map +1 -0
- package/lib/cjs/flow-factory.d.ts +12 -0
- package/lib/cjs/flow-factory.js +73 -0
- package/lib/cjs/flow-factory.js.map +1 -0
- package/lib/cjs/functions/index.d.ts +11 -0
- package/lib/cjs/functions/index.js +49 -0
- package/lib/cjs/functions/index.js.map +1 -0
- package/lib/cjs/index.d.ts +42 -0
- package/lib/cjs/index.js +142 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/services/hubtype-queues-api.js +26 -0
- package/lib/cjs/services/hubtype-queues-api.js.map +1 -0
- package/lib/cjs/structured-output/flow-builder-content.js +15 -0
- package/lib/cjs/structured-output/flow-builder-content.js.map +1 -0
- package/lib/cjs/tracking.d.ts +16 -0
- package/lib/cjs/tracking.js +71 -0
- package/lib/cjs/tracking.js.map +1 -0
- package/lib/cjs/types.d.ts +62 -0
- package/lib/cjs/types.js +14 -0
- package/lib/cjs/types.js.map +1 -0
- package/lib/cjs/user-input/capture-user-input-api.d.ts +21 -0
- package/lib/cjs/user-input/capture-user-input-api.js +88 -0
- package/lib/cjs/user-input/capture-user-input-api.js.map +1 -0
- package/lib/cjs/user-input/index.d.ts +4 -0
- package/lib/cjs/user-input/index.js +37 -0
- package/lib/cjs/user-input/index.js.map +1 -0
- package/lib/cjs/user-input/keyword.d.ts +27 -0
- package/lib/cjs/user-input/keyword.js +84 -0
- package/lib/cjs/user-input/keyword.js.map +1 -0
- package/lib/cjs/user-input/smart-intent.d.ts +24 -0
- package/lib/cjs/user-input/smart-intent.js +89 -0
- package/lib/cjs/user-input/smart-intent.js.map +1 -0
- package/lib/cjs/utils/ai-agent.d.ts +11 -0
- package/lib/cjs/utils/ai-agent.js +28 -0
- package/lib/cjs/utils/ai-agent.js.map +1 -0
- package/lib/cjs/utils/authentication.js +21 -0
- package/lib/cjs/utils/authentication.js.map +1 -0
- package/lib/cjs/utils/flow-locale.js +79 -0
- package/lib/cjs/utils/flow-locale.js.map +1 -0
- package/lib/cjs/utils/get-flow-builder-plugin.d.ts +3 -0
- package/lib/cjs/utils/get-flow-builder-plugin.js +16 -0
- package/lib/cjs/utils/get-flow-builder-plugin.js.map +1 -0
- package/lib/cjs/utils/hubtype-assistant-content.d.ts +13 -0
- package/lib/cjs/utils/hubtype-assistant-content.js +184 -0
- package/lib/cjs/utils/hubtype-assistant-content.js.map +1 -0
- package/lib/cjs/utils/input.js +35 -0
- package/lib/cjs/utils/input.js.map +1 -0
- package/lib/cjs/webview/contents-context.d.ts +2 -0
- package/lib/cjs/webview/contents-context.js +12 -0
- package/lib/cjs/webview/contents-context.js.map +1 -0
- package/lib/cjs/webview/index.d.ts +3 -0
- package/lib/cjs/webview/index.js +10 -0
- package/lib/cjs/webview/index.js.map +1 -0
- package/lib/cjs/webview/types.d.ts +47 -0
- package/lib/cjs/webview/types.js +9 -0
- package/lib/cjs/webview/types.js.map +1 -0
- package/lib/cjs/webview/use-webview-contents.d.ts +2 -0
- package/lib/cjs/webview/use-webview-contents.js +83 -0
- package/lib/cjs/webview/use-webview-contents.js.map +1 -0
- package/lib/esm/action/ai-agent-from-user-input.d.ts +3 -0
- package/lib/esm/action/ai-agent-from-user-input.js +38 -0
- package/lib/esm/action/ai-agent-from-user-input.js.map +1 -0
- package/lib/esm/action/context.d.ts +11 -0
- package/lib/esm/action/context.js +17 -0
- package/lib/esm/action/context.js.map +1 -0
- package/lib/esm/action/fallback.d.ts +3 -0
- package/lib/esm/action/fallback.js +36 -0
- package/lib/esm/action/fallback.js.map +1 -0
- package/lib/esm/action/first-interaction.d.ts +3 -0
- package/lib/esm/action/first-interaction.js +93 -0
- package/lib/esm/action/first-interaction.js.map +1 -0
- package/lib/esm/action/get-contents.d.ts +3 -0
- package/lib/esm/action/get-contents.js +44 -0
- package/lib/esm/action/get-contents.js.map +1 -0
- package/lib/esm/action/index.d.ts +25 -0
- package/lib/esm/action/index.js +95 -0
- package/lib/esm/action/index.js.map +1 -0
- package/lib/esm/action/payload.d.ts +3 -0
- package/lib/esm/action/payload.js +74 -0
- package/lib/esm/action/payload.js.map +1 -0
- package/lib/esm/api.d.ts +45 -0
- package/lib/esm/api.js +227 -0
- package/lib/esm/api.js.map +1 -0
- package/lib/esm/bot-context-manager.d.ts +17 -0
- package/lib/esm/bot-context-manager.js +93 -0
- package/lib/esm/bot-context-manager.js.map +1 -0
- package/lib/esm/constants.d.ts +14 -0
- package/lib/esm/constants.js +20 -0
- package/lib/esm/constants.js.map +1 -0
- package/lib/esm/content-fields/contact-reasons-conditional-matcher.d.ts +4 -0
- package/lib/esm/content-fields/contact-reasons-conditional-matcher.js +12 -0
- package/lib/esm/content-fields/contact-reasons-conditional-matcher.js.map +1 -0
- package/lib/esm/content-fields/content-fields-base.d.ts +20 -0
- package/lib/esm/content-fields/content-fields-base.js +74 -0
- package/lib/esm/content-fields/content-fields-base.js.map +1 -0
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.d.ts +15 -0
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +71 -0
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +1 -0
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.d.ts +9 -0
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.js +58 -0
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +1 -0
- package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.d.ts +17 -0
- package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.js +79 -0
- package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.js.map +1 -0
- package/lib/esm/content-fields/flow-ai-agent-base.d.ts +25 -0
- package/lib/esm/content-fields/flow-ai-agent-base.js +97 -0
- package/lib/esm/content-fields/flow-ai-agent-base.js.map +1 -0
- package/lib/esm/content-fields/flow-ai-agent-router.d.ts +21 -0
- package/lib/esm/content-fields/flow-ai-agent-router.js +126 -0
- package/lib/esm/content-fields/flow-ai-agent-router.js.map +1 -0
- package/lib/esm/content-fields/flow-ai-agent.d.ts +17 -0
- package/lib/esm/content-fields/flow-ai-agent.js +65 -0
- package/lib/esm/content-fields/flow-ai-agent.js.map +1 -0
- package/lib/esm/content-fields/flow-bot-action.d.ts +14 -0
- package/lib/esm/content-fields/flow-bot-action.js +45 -0
- package/lib/esm/content-fields/flow-bot-action.js.map +1 -0
- package/lib/esm/content-fields/flow-button.d.ts +31 -0
- package/lib/esm/content-fields/flow-button.js +86 -0
- package/lib/esm/content-fields/flow-button.js.map +1 -0
- package/lib/esm/content-fields/flow-capture-user-input.d.ts +14 -0
- package/lib/esm/content-fields/flow-capture-user-input.js +45 -0
- package/lib/esm/content-fields/flow-capture-user-input.js.map +1 -0
- package/lib/esm/content-fields/flow-carousel.d.ts +22 -0
- package/lib/esm/content-fields/flow-carousel.js +152 -0
- package/lib/esm/content-fields/flow-carousel.js.map +1 -0
- package/lib/esm/content-fields/flow-channel-conditional.d.ts +14 -0
- package/lib/esm/content-fields/flow-channel-conditional.js +57 -0
- package/lib/esm/content-fields/flow-channel-conditional.js.map +1 -0
- package/lib/esm/content-fields/flow-contact-reasons-conditional.d.ts +17 -0
- package/lib/esm/content-fields/flow-contact-reasons-conditional.js +88 -0
- package/lib/esm/content-fields/flow-contact-reasons-conditional.js.map +1 -0
- package/lib/esm/content-fields/flow-country-conditional.d.ts +13 -0
- package/lib/esm/content-fields/flow-country-conditional.js +59 -0
- package/lib/esm/content-fields/flow-country-conditional.js.map +1 -0
- package/lib/esm/content-fields/flow-custom-conditional.d.ts +17 -0
- package/lib/esm/content-fields/flow-custom-conditional.js +89 -0
- package/lib/esm/content-fields/flow-custom-conditional.js.map +1 -0
- package/lib/esm/content-fields/flow-do-nothing.d.ts +9 -0
- package/lib/esm/content-fields/flow-do-nothing.js +27 -0
- package/lib/esm/content-fields/flow-do-nothing.js.map +1 -0
- package/lib/esm/content-fields/flow-element.d.ts +22 -0
- package/lib/esm/content-fields/flow-element.js +50 -0
- package/lib/esm/content-fields/flow-element.js.map +1 -0
- package/lib/esm/content-fields/flow-go-to-flow.d.ts +13 -0
- package/lib/esm/content-fields/flow-go-to-flow.js +51 -0
- package/lib/esm/content-fields/flow-go-to-flow.js.map +1 -0
- package/lib/esm/content-fields/flow-handoff.d.ts +23 -0
- package/lib/esm/content-fields/flow-handoff.js +104 -0
- package/lib/esm/content-fields/flow-handoff.js.map +1 -0
- package/lib/esm/content-fields/flow-image.d.ts +10 -0
- package/lib/esm/content-fields/flow-image.js +33 -0
- package/lib/esm/content-fields/flow-image.js.map +1 -0
- package/lib/esm/content-fields/flow-queue-status-conditional.d.ts +30 -0
- package/lib/esm/content-fields/flow-queue-status-conditional.js +95 -0
- package/lib/esm/content-fields/flow-queue-status-conditional.js.map +1 -0
- package/lib/esm/content-fields/flow-rating.d.ts +15 -0
- package/lib/esm/content-fields/flow-rating.js +66 -0
- package/lib/esm/content-fields/flow-rating.js.map +1 -0
- package/lib/esm/content-fields/flow-text.d.ts +15 -0
- package/lib/esm/content-fields/flow-text.js +60 -0
- package/lib/esm/content-fields/flow-text.js.map +1 -0
- package/lib/esm/content-fields/flow-video.d.ts +10 -0
- package/lib/esm/content-fields/flow-video.js +33 -0
- package/lib/esm/content-fields/flow-video.js.map +1 -0
- package/lib/esm/content-fields/flow-webview.d.ts +16 -0
- package/lib/esm/content-fields/flow-webview.js +78 -0
- package/lib/esm/content-fields/flow-webview.js.map +1 -0
- package/lib/esm/content-fields/flow-whatsapp-cta-url-button.d.ts +21 -0
- package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js +92 -0
- package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js.map +1 -0
- package/lib/esm/content-fields/flow-whatsapp-request-contact-info.d.ts +11 -0
- package/lib/esm/content-fields/flow-whatsapp-request-contact-info.js +46 -0
- package/lib/esm/content-fields/flow-whatsapp-request-contact-info.js.map +1 -0
- package/lib/esm/content-fields/flow-whatsapp-template.d.ts +37 -0
- package/lib/esm/content-fields/flow-whatsapp-template.js +264 -0
- package/lib/esm/content-fields/flow-whatsapp-template.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/ai-agent-router.d.ts +21 -0
- package/lib/esm/content-fields/hubtype-fields/ai-agent-router.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/ai-agent-router.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/ai-agent.d.ts +25 -0
- package/lib/esm/content-fields/hubtype-fields/ai-agent.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/ai-agent.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/bot-action.d.ts +10 -0
- package/lib/esm/content-fields/hubtype-fields/bot-action.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/bot-action.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/button.d.ts +8 -0
- package/lib/esm/content-fields/hubtype-fields/button.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/button.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/capture-user-input.d.ts +19 -0
- package/lib/esm/content-fields/hubtype-fields/capture-user-input.js +12 -0
- package/lib/esm/content-fields/hubtype-fields/capture-user-input.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/carousel.d.ts +17 -0
- package/lib/esm/content-fields/hubtype-fields/carousel.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/carousel.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/channel-conditional.d.ts +10 -0
- package/lib/esm/content-fields/hubtype-fields/channel-conditional.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/channel-conditional.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/common.d.ts +83 -0
- package/lib/esm/content-fields/hubtype-fields/common.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/common.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/contact-reasons-conditional.d.ts +19 -0
- package/lib/esm/content-fields/hubtype-fields/contact-reasons-conditional.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/contact-reasons-conditional.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/country-conditional.d.ts +10 -0
- package/lib/esm/content-fields/hubtype-fields/country-conditional.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/country-conditional.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/custom-conditional-v2.d.ts +56 -0
- package/lib/esm/content-fields/hubtype-fields/custom-conditional-v2.js +36 -0
- package/lib/esm/content-fields/hubtype-fields/custom-conditional-v2.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/custom-conditional.d.ts +11 -0
- package/lib/esm/content-fields/hubtype-fields/custom-conditional.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/custom-conditional.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/do-nothing.d.ts +6 -0
- package/lib/esm/content-fields/hubtype-fields/do-nothing.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/do-nothing.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/fallback.d.ts +9 -0
- package/lib/esm/content-fields/hubtype-fields/fallback.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/fallback.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/function.d.ts +30 -0
- package/lib/esm/content-fields/hubtype-fields/function.js +11 -0
- package/lib/esm/content-fields/hubtype-fields/function.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/go-to-flow.d.ts +9 -0
- package/lib/esm/content-fields/hubtype-fields/go-to-flow.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/go-to-flow.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/handoff.d.ts +21 -0
- package/lib/esm/content-fields/hubtype-fields/handoff.js +10 -0
- package/lib/esm/content-fields/hubtype-fields/handoff.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/image.d.ts +8 -0
- package/lib/esm/content-fields/hubtype-fields/image.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/image.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/index.d.ts +28 -0
- package/lib/esm/content-fields/hubtype-fields/index.js +32 -0
- package/lib/esm/content-fields/hubtype-fields/index.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/keyword.d.ts +9 -0
- package/lib/esm/content-fields/hubtype-fields/keyword.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/keyword.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/node-types.d.ts +33 -0
- package/lib/esm/content-fields/hubtype-fields/node-types.js +40 -0
- package/lib/esm/content-fields/hubtype-fields/node-types.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/nodes.d.ts +28 -0
- package/lib/esm/content-fields/hubtype-fields/nodes.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/nodes.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/payload.d.ts +8 -0
- package/lib/esm/content-fields/hubtype-fields/payload.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/payload.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.d.ts +25 -0
- package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/rating.d.ts +23 -0
- package/lib/esm/content-fields/hubtype-fields/rating.js +9 -0
- package/lib/esm/content-fields/hubtype-fields/rating.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/smart-intent.d.ts +12 -0
- package/lib/esm/content-fields/hubtype-fields/smart-intent.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/smart-intent.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/text.d.ts +11 -0
- package/lib/esm/content-fields/hubtype-fields/text.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/text.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/url.d.ts +8 -0
- package/lib/esm/content-fields/hubtype-fields/url.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/url.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/video.d.ts +8 -0
- package/lib/esm/content-fields/hubtype-fields/video.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/video.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/webview.d.ts +17 -0
- package/lib/esm/content-fields/hubtype-fields/webview.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/webview.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.d.ts +21 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.d.ts +17 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.d.ts +10 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-template.d.ts +96 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-template.js +9 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-template.js.map +1 -0
- package/lib/esm/content-fields/index.d.ts +27 -0
- package/lib/esm/content-fields/index.js +56 -0
- package/lib/esm/content-fields/index.js.map +1 -0
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +14 -0
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +41 -0
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +1 -0
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +13 -0
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +36 -0
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +1 -0
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +14 -0
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +46 -0
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +1 -0
- package/lib/esm/content-fields/whatsapp-button-list/index.d.ts +3 -0
- package/lib/esm/content-fields/whatsapp-button-list/index.js +10 -0
- package/lib/esm/content-fields/whatsapp-button-list/index.js.map +1 -0
- package/lib/esm/filters/index.d.ts +12 -0
- package/lib/esm/filters/index.js +17 -0
- package/lib/esm/filters/index.js.map +1 -0
- package/lib/esm/flow-factory.d.ts +12 -0
- package/lib/esm/flow-factory.js +73 -0
- package/lib/esm/flow-factory.js.map +1 -0
- package/lib/esm/functions/index.d.ts +11 -0
- package/lib/esm/functions/index.js +49 -0
- package/lib/esm/functions/index.js.map +1 -0
- package/lib/esm/index.d.ts +42 -0
- package/lib/esm/index.js +142 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/services/hubtype-queues-api.d.ts +14 -0
- package/lib/esm/services/hubtype-queues-api.js +26 -0
- package/lib/esm/services/hubtype-queues-api.js.map +1 -0
- package/lib/esm/structured-output/flow-builder-content.d.ts +13 -0
- package/lib/esm/structured-output/flow-builder-content.js +15 -0
- package/lib/esm/structured-output/flow-builder-content.js.map +1 -0
- package/lib/esm/tracking.d.ts +16 -0
- package/lib/esm/tracking.js +71 -0
- package/lib/esm/tracking.js.map +1 -0
- package/lib/esm/types.d.ts +62 -0
- package/lib/esm/types.js +14 -0
- package/lib/esm/types.js.map +1 -0
- package/lib/esm/user-input/capture-user-input-api.d.ts +21 -0
- package/lib/esm/user-input/capture-user-input-api.js +88 -0
- package/lib/esm/user-input/capture-user-input-api.js.map +1 -0
- package/lib/esm/user-input/index.d.ts +4 -0
- package/lib/esm/user-input/index.js +37 -0
- package/lib/esm/user-input/index.js.map +1 -0
- package/lib/esm/user-input/keyword.d.ts +27 -0
- package/lib/esm/user-input/keyword.js +84 -0
- package/lib/esm/user-input/keyword.js.map +1 -0
- package/lib/esm/user-input/smart-intent.d.ts +24 -0
- package/lib/esm/user-input/smart-intent.js +89 -0
- package/lib/esm/user-input/smart-intent.js.map +1 -0
- package/lib/esm/utils/ai-agent.d.ts +11 -0
- package/lib/esm/utils/ai-agent.js +28 -0
- package/lib/esm/utils/ai-agent.js.map +1 -0
- package/lib/esm/utils/authentication.d.ts +2 -0
- package/lib/esm/utils/authentication.js +21 -0
- package/lib/esm/utils/authentication.js.map +1 -0
- package/lib/esm/utils/flow-locale.d.ts +22 -0
- package/lib/esm/utils/flow-locale.js +79 -0
- package/lib/esm/utils/flow-locale.js.map +1 -0
- package/lib/esm/utils/get-flow-builder-plugin.d.ts +3 -0
- package/lib/esm/utils/get-flow-builder-plugin.js +16 -0
- package/lib/esm/utils/get-flow-builder-plugin.js.map +1 -0
- package/lib/esm/utils/hubtype-assistant-content.d.ts +13 -0
- package/lib/esm/utils/hubtype-assistant-content.js +184 -0
- package/lib/esm/utils/hubtype-assistant-content.js.map +1 -0
- package/lib/esm/utils/input.d.ts +6 -0
- package/lib/esm/utils/input.js +35 -0
- package/lib/esm/utils/input.js.map +1 -0
- package/lib/esm/webview/contents-context.d.ts +2 -0
- package/lib/esm/webview/contents-context.js +12 -0
- package/lib/esm/webview/contents-context.js.map +1 -0
- package/lib/esm/webview/index.d.ts +3 -0
- package/lib/esm/webview/index.js +10 -0
- package/lib/esm/webview/index.js.map +1 -0
- package/lib/esm/webview/types.d.ts +47 -0
- package/lib/esm/webview/types.js +9 -0
- package/lib/esm/webview/types.js.map +1 -0
- package/lib/esm/webview/use-webview-contents.d.ts +2 -0
- package/lib/esm/webview/use-webview-contents.js +83 -0
- package/lib/esm/webview/use-webview-contents.js.map +1 -0
- package/package.json +10 -12
- package/src/action/ai-agent-from-user-input.ts +7 -0
- package/src/action/first-interaction.ts +6 -0
- package/src/action/get-contents.ts +17 -2
- package/src/action/index.tsx +7 -0
- package/src/api.ts +52 -15
- package/src/bot-context-manager.ts +153 -0
- package/src/constants.ts +2 -1
- package/src/content-fields/contact-reasons-conditional-matcher.ts +24 -0
- package/src/content-fields/flow-ai-agent-base.tsx +1 -1
- package/src/content-fields/flow-ai-agent-router.tsx +1 -0
- package/src/content-fields/flow-ai-agent.tsx +1 -0
- package/src/content-fields/flow-contact-reasons-conditional.tsx +119 -0
- package/src/content-fields/flow-do-nothing.tsx +29 -0
- package/src/content-fields/flow-handoff.tsx +54 -7
- package/src/content-fields/flow-whatsapp-request-contact-info.tsx +2 -0
- package/src/content-fields/hubtype-fields/contact-reasons-conditional.ts +21 -0
- package/src/content-fields/hubtype-fields/do-nothing.ts +7 -0
- package/src/content-fields/hubtype-fields/handoff.ts +17 -1
- package/src/content-fields/hubtype-fields/index.ts +1 -0
- package/src/content-fields/hubtype-fields/node-types.ts +2 -0
- package/src/content-fields/hubtype-fields/nodes.ts +4 -0
- package/src/content-fields/hubtype-fields/whatsapp-request-contact-info.ts +2 -0
- package/src/content-fields/index.ts +6 -0
- package/src/flow-factory.ts +11 -0
- package/src/index.ts +26 -88
- package/src/types.ts +1 -2
- package/lib/action/ai-agent-from-user-input.d.ts +0 -3
- package/lib/action/ai-agent-from-user-input.js +0 -35
- package/lib/action/ai-agent-from-user-input.js.map +0 -1
- package/lib/action/context.d.ts +0 -11
- package/lib/action/context.js +0 -20
- package/lib/action/context.js.map +0 -1
- package/lib/action/fallback.d.ts +0 -3
- package/lib/action/fallback.js +0 -41
- package/lib/action/fallback.js.map +0 -1
- package/lib/action/first-interaction.d.ts +0 -3
- package/lib/action/first-interaction.js +0 -100
- package/lib/action/first-interaction.js.map +0 -1
- package/lib/action/get-contents.d.ts +0 -3
- package/lib/action/get-contents.js +0 -56
- package/lib/action/get-contents.js.map +0 -1
- package/lib/action/index.d.ts +0 -25
- package/lib/action/index.js +0 -126
- package/lib/action/index.js.map +0 -1
- package/lib/action/payload.d.ts +0 -3
- package/lib/action/payload.js +0 -78
- package/lib/action/payload.js.map +0 -1
- package/lib/api.d.ts +0 -40
- package/lib/api.js +0 -216
- package/lib/api.js.map +0 -1
- package/lib/constants.d.ts +0 -13
- package/lib/constants.js +0 -17
- package/lib/constants.js.map +0 -1
- package/lib/content-fields/content-fields-base.d.ts +0 -20
- package/lib/content-fields/content-fields-base.js +0 -78
- package/lib/content-fields/content-fields-base.js.map +0 -1
- package/lib/content-fields/custom-conditional/custom-conditional-v2-evaluators.d.ts +0 -15
- package/lib/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +0 -73
- package/lib/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +0 -1
- package/lib/content-fields/custom-conditional/custom-conditional-v2-resolver.d.ts +0 -9
- package/lib/content-fields/custom-conditional/custom-conditional-v2-resolver.js +0 -58
- package/lib/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +0 -1
- package/lib/content-fields/custom-conditional/flow-custom-condition-v2.d.ts +0 -17
- package/lib/content-fields/custom-conditional/flow-custom-condition-v2.js +0 -94
- package/lib/content-fields/custom-conditional/flow-custom-condition-v2.js.map +0 -1
- package/lib/content-fields/flow-ai-agent-base.d.ts +0 -25
- package/lib/content-fields/flow-ai-agent-base.js +0 -106
- package/lib/content-fields/flow-ai-agent-base.js.map +0 -1
- package/lib/content-fields/flow-ai-agent-router.d.ts +0 -21
- package/lib/content-fields/flow-ai-agent-router.js +0 -136
- package/lib/content-fields/flow-ai-agent-router.js.map +0 -1
- package/lib/content-fields/flow-ai-agent.d.ts +0 -17
- package/lib/content-fields/flow-ai-agent.js +0 -75
- package/lib/content-fields/flow-ai-agent.js.map +0 -1
- package/lib/content-fields/flow-bot-action.d.ts +0 -14
- package/lib/content-fields/flow-bot-action.js +0 -53
- package/lib/content-fields/flow-bot-action.js.map +0 -1
- package/lib/content-fields/flow-button.d.ts +0 -31
- package/lib/content-fields/flow-button.js +0 -105
- package/lib/content-fields/flow-button.js.map +0 -1
- package/lib/content-fields/flow-capture-user-input.d.ts +0 -14
- package/lib/content-fields/flow-capture-user-input.js +0 -46
- package/lib/content-fields/flow-capture-user-input.js.map +0 -1
- package/lib/content-fields/flow-carousel.d.ts +0 -22
- package/lib/content-fields/flow-carousel.js +0 -193
- package/lib/content-fields/flow-carousel.js.map +0 -1
- package/lib/content-fields/flow-channel-conditional.d.ts +0 -14
- package/lib/content-fields/flow-channel-conditional.js +0 -61
- package/lib/content-fields/flow-channel-conditional.js.map +0 -1
- package/lib/content-fields/flow-country-conditional.d.ts +0 -13
- package/lib/content-fields/flow-country-conditional.js +0 -64
- package/lib/content-fields/flow-country-conditional.js.map +0 -1
- package/lib/content-fields/flow-custom-conditional.d.ts +0 -17
- package/lib/content-fields/flow-custom-conditional.js +0 -87
- package/lib/content-fields/flow-custom-conditional.js.map +0 -1
- package/lib/content-fields/flow-element.d.ts +0 -22
- package/lib/content-fields/flow-element.js +0 -67
- package/lib/content-fields/flow-element.js.map +0 -1
- package/lib/content-fields/flow-go-to-flow.d.ts +0 -13
- package/lib/content-fields/flow-go-to-flow.js +0 -56
- package/lib/content-fields/flow-go-to-flow.js.map +0 -1
- package/lib/content-fields/flow-handoff.d.ts +0 -17
- package/lib/content-fields/flow-handoff.js +0 -79
- package/lib/content-fields/flow-handoff.js.map +0 -1
- package/lib/content-fields/flow-image.d.ts +0 -10
- package/lib/content-fields/flow-image.js +0 -42
- package/lib/content-fields/flow-image.js.map +0 -1
- package/lib/content-fields/flow-queue-status-conditional.d.ts +0 -30
- package/lib/content-fields/flow-queue-status-conditional.js +0 -100
- package/lib/content-fields/flow-queue-status-conditional.js.map +0 -1
- package/lib/content-fields/flow-rating.d.ts +0 -15
- package/lib/content-fields/flow-rating.js +0 -88
- package/lib/content-fields/flow-rating.js.map +0 -1
- package/lib/content-fields/flow-text.d.ts +0 -15
- package/lib/content-fields/flow-text.js +0 -82
- package/lib/content-fields/flow-text.js.map +0 -1
- package/lib/content-fields/flow-video.d.ts +0 -10
- package/lib/content-fields/flow-video.js +0 -42
- package/lib/content-fields/flow-video.js.map +0 -1
- package/lib/content-fields/flow-webview.d.ts +0 -16
- package/lib/content-fields/flow-webview.js +0 -81
- package/lib/content-fields/flow-webview.js.map +0 -1
- package/lib/content-fields/flow-whatsapp-cta-url-button.d.ts +0 -21
- package/lib/content-fields/flow-whatsapp-cta-url-button.js +0 -131
- package/lib/content-fields/flow-whatsapp-cta-url-button.js.map +0 -1
- package/lib/content-fields/flow-whatsapp-request-contact-info.d.ts +0 -11
- package/lib/content-fields/flow-whatsapp-request-contact-info.js +0 -61
- package/lib/content-fields/flow-whatsapp-request-contact-info.js.map +0 -1
- package/lib/content-fields/flow-whatsapp-template.d.ts +0 -37
- package/lib/content-fields/flow-whatsapp-template.js +0 -281
- package/lib/content-fields/flow-whatsapp-template.js.map +0 -1
- package/lib/content-fields/hubtype-fields/ai-agent-router.d.ts +0 -21
- package/lib/content-fields/hubtype-fields/ai-agent-router.js +0 -4
- package/lib/content-fields/hubtype-fields/ai-agent-router.js.map +0 -1
- package/lib/content-fields/hubtype-fields/ai-agent.d.ts +0 -25
- package/lib/content-fields/hubtype-fields/ai-agent.js +0 -4
- package/lib/content-fields/hubtype-fields/ai-agent.js.map +0 -1
- package/lib/content-fields/hubtype-fields/bot-action.d.ts +0 -10
- package/lib/content-fields/hubtype-fields/bot-action.js +0 -4
- package/lib/content-fields/hubtype-fields/bot-action.js.map +0 -1
- package/lib/content-fields/hubtype-fields/button.d.ts +0 -8
- package/lib/content-fields/hubtype-fields/button.js +0 -4
- package/lib/content-fields/hubtype-fields/button.js.map +0 -1
- package/lib/content-fields/hubtype-fields/capture-user-input.d.ts +0 -19
- package/lib/content-fields/hubtype-fields/capture-user-input.js +0 -12
- package/lib/content-fields/hubtype-fields/capture-user-input.js.map +0 -1
- package/lib/content-fields/hubtype-fields/carousel.d.ts +0 -17
- package/lib/content-fields/hubtype-fields/carousel.js +0 -4
- package/lib/content-fields/hubtype-fields/carousel.js.map +0 -1
- package/lib/content-fields/hubtype-fields/channel-conditional.d.ts +0 -10
- package/lib/content-fields/hubtype-fields/channel-conditional.js +0 -4
- package/lib/content-fields/hubtype-fields/channel-conditional.js.map +0 -1
- package/lib/content-fields/hubtype-fields/common.d.ts +0 -83
- package/lib/content-fields/hubtype-fields/common.js +0 -4
- package/lib/content-fields/hubtype-fields/common.js.map +0 -1
- package/lib/content-fields/hubtype-fields/country-conditional.d.ts +0 -10
- package/lib/content-fields/hubtype-fields/country-conditional.js +0 -4
- package/lib/content-fields/hubtype-fields/country-conditional.js.map +0 -1
- package/lib/content-fields/hubtype-fields/custom-conditional-v2.d.ts +0 -56
- package/lib/content-fields/hubtype-fields/custom-conditional-v2.js +0 -36
- package/lib/content-fields/hubtype-fields/custom-conditional-v2.js.map +0 -1
- package/lib/content-fields/hubtype-fields/custom-conditional.d.ts +0 -11
- package/lib/content-fields/hubtype-fields/custom-conditional.js +0 -4
- package/lib/content-fields/hubtype-fields/custom-conditional.js.map +0 -1
- package/lib/content-fields/hubtype-fields/fallback.d.ts +0 -9
- package/lib/content-fields/hubtype-fields/fallback.js +0 -4
- package/lib/content-fields/hubtype-fields/fallback.js.map +0 -1
- package/lib/content-fields/hubtype-fields/function.d.ts +0 -30
- package/lib/content-fields/hubtype-fields/function.js +0 -11
- package/lib/content-fields/hubtype-fields/function.js.map +0 -1
- package/lib/content-fields/hubtype-fields/go-to-flow.d.ts +0 -9
- package/lib/content-fields/hubtype-fields/go-to-flow.js +0 -4
- package/lib/content-fields/hubtype-fields/go-to-flow.js.map +0 -1
- package/lib/content-fields/hubtype-fields/handoff.d.ts +0 -11
- package/lib/content-fields/hubtype-fields/handoff.js +0 -4
- package/lib/content-fields/hubtype-fields/handoff.js.map +0 -1
- package/lib/content-fields/hubtype-fields/image.d.ts +0 -8
- package/lib/content-fields/hubtype-fields/image.js +0 -4
- package/lib/content-fields/hubtype-fields/image.js.map +0 -1
- package/lib/content-fields/hubtype-fields/index.d.ts +0 -27
- package/lib/content-fields/hubtype-fields/index.js +0 -57
- package/lib/content-fields/hubtype-fields/index.js.map +0 -1
- package/lib/content-fields/hubtype-fields/keyword.d.ts +0 -9
- package/lib/content-fields/hubtype-fields/keyword.js +0 -4
- package/lib/content-fields/hubtype-fields/keyword.js.map +0 -1
- package/lib/content-fields/hubtype-fields/node-types.d.ts +0 -31
- package/lib/content-fields/hubtype-fields/node-types.js +0 -38
- package/lib/content-fields/hubtype-fields/node-types.js.map +0 -1
- package/lib/content-fields/hubtype-fields/nodes.d.ts +0 -26
- package/lib/content-fields/hubtype-fields/nodes.js +0 -4
- package/lib/content-fields/hubtype-fields/nodes.js.map +0 -1
- package/lib/content-fields/hubtype-fields/payload.d.ts +0 -8
- package/lib/content-fields/hubtype-fields/payload.js +0 -4
- package/lib/content-fields/hubtype-fields/payload.js.map +0 -1
- package/lib/content-fields/hubtype-fields/queue-status-conditional.d.ts +0 -25
- package/lib/content-fields/hubtype-fields/queue-status-conditional.js +0 -4
- package/lib/content-fields/hubtype-fields/queue-status-conditional.js.map +0 -1
- package/lib/content-fields/hubtype-fields/rating.d.ts +0 -23
- package/lib/content-fields/hubtype-fields/rating.js +0 -9
- package/lib/content-fields/hubtype-fields/rating.js.map +0 -1
- package/lib/content-fields/hubtype-fields/smart-intent.d.ts +0 -12
- package/lib/content-fields/hubtype-fields/smart-intent.js +0 -4
- package/lib/content-fields/hubtype-fields/smart-intent.js.map +0 -1
- package/lib/content-fields/hubtype-fields/text.d.ts +0 -11
- package/lib/content-fields/hubtype-fields/text.js +0 -4
- package/lib/content-fields/hubtype-fields/text.js.map +0 -1
- package/lib/content-fields/hubtype-fields/url.d.ts +0 -8
- package/lib/content-fields/hubtype-fields/url.js +0 -4
- package/lib/content-fields/hubtype-fields/url.js.map +0 -1
- package/lib/content-fields/hubtype-fields/video.d.ts +0 -8
- package/lib/content-fields/hubtype-fields/video.js +0 -4
- package/lib/content-fields/hubtype-fields/video.js.map +0 -1
- package/lib/content-fields/hubtype-fields/webview.d.ts +0 -17
- package/lib/content-fields/hubtype-fields/webview.js +0 -4
- package/lib/content-fields/hubtype-fields/webview.js.map +0 -1
- package/lib/content-fields/hubtype-fields/whatsapp-button-list.d.ts +0 -21
- package/lib/content-fields/hubtype-fields/whatsapp-button-list.js +0 -4
- package/lib/content-fields/hubtype-fields/whatsapp-button-list.js.map +0 -1
- package/lib/content-fields/hubtype-fields/whatsapp-cta-url-button.d.ts +0 -17
- package/lib/content-fields/hubtype-fields/whatsapp-cta-url-button.js +0 -4
- package/lib/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +0 -1
- package/lib/content-fields/hubtype-fields/whatsapp-request-contact-info.d.ts +0 -8
- package/lib/content-fields/hubtype-fields/whatsapp-request-contact-info.js +0 -4
- package/lib/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +0 -1
- package/lib/content-fields/hubtype-fields/whatsapp-template.d.ts +0 -96
- package/lib/content-fields/hubtype-fields/whatsapp-template.js +0 -9
- package/lib/content-fields/hubtype-fields/whatsapp-template.js.map +0 -1
- package/lib/content-fields/index.d.ts +0 -25
- package/lib/content-fields/index.js +0 -73
- package/lib/content-fields/index.js.map +0 -1
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +0 -14
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +0 -43
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +0 -1
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +0 -13
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +0 -41
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +0 -1
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +0 -14
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +0 -66
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +0 -1
- package/lib/content-fields/whatsapp-button-list/index.d.ts +0 -3
- package/lib/content-fields/whatsapp-button-list/index.js +0 -12
- package/lib/content-fields/whatsapp-button-list/index.js.map +0 -1
- package/lib/filters/index.d.ts +0 -12
- package/lib/filters/index.js +0 -16
- package/lib/filters/index.js.map +0 -1
- package/lib/flow-factory.d.ts +0 -12
- package/lib/flow-factory.js +0 -75
- package/lib/flow-factory.js.map +0 -1
- package/lib/functions/index.d.ts +0 -11
- package/lib/functions/index.js +0 -55
- package/lib/functions/index.js.map +0 -1
- package/lib/index.d.ts +0 -45
- package/lib/index.js +0 -195
- package/lib/index.js.map +0 -1
- package/lib/services/hubtype-queues-api.js +0 -26
- package/lib/services/hubtype-queues-api.js.map +0 -1
- package/lib/structured-output/flow-builder-content.js +0 -16
- package/lib/structured-output/flow-builder-content.js.map +0 -1
- package/lib/tracking.d.ts +0 -16
- package/lib/tracking.js +0 -77
- package/lib/tracking.js.map +0 -1
- package/lib/types.d.ts +0 -62
- package/lib/types.js +0 -14
- package/lib/types.js.map +0 -1
- package/lib/user-input/capture-user-input-api.d.ts +0 -21
- package/lib/user-input/capture-user-input-api.js +0 -99
- package/lib/user-input/capture-user-input-api.js.map +0 -1
- package/lib/user-input/index.d.ts +0 -4
- package/lib/user-input/index.js +0 -46
- package/lib/user-input/index.js.map +0 -1
- package/lib/user-input/keyword.d.ts +0 -27
- package/lib/user-input/keyword.js +0 -89
- package/lib/user-input/keyword.js.map +0 -1
- package/lib/user-input/smart-intent.d.ts +0 -24
- package/lib/user-input/smart-intent.js +0 -93
- package/lib/user-input/smart-intent.js.map +0 -1
- package/lib/utils/ai-agent.d.ts +0 -11
- package/lib/utils/ai-agent.js +0 -33
- package/lib/utils/ai-agent.js.map +0 -1
- package/lib/utils/authentication.js +0 -24
- package/lib/utils/authentication.js.map +0 -1
- package/lib/utils/flow-locale.js +0 -75
- package/lib/utils/flow-locale.js.map +0 -1
- package/lib/utils/get-flow-builder-plugin.d.ts +0 -3
- package/lib/utils/get-flow-builder-plugin.js +0 -16
- package/lib/utils/get-flow-builder-plugin.js.map +0 -1
- package/lib/utils/hubtype-assistant-content.d.ts +0 -13
- package/lib/utils/hubtype-assistant-content.js +0 -200
- package/lib/utils/hubtype-assistant-content.js.map +0 -1
- package/lib/utils/input.js +0 -37
- package/lib/utils/input.js.map +0 -1
- package/lib/webview/contents-context.d.ts +0 -2
- package/lib/webview/contents-context.js +0 -14
- package/lib/webview/contents-context.js.map +0 -1
- package/lib/webview/index.d.ts +0 -3
- package/lib/webview/index.js +0 -11
- package/lib/webview/index.js.map +0 -1
- package/lib/webview/types.d.ts +0 -47
- package/lib/webview/types.js +0 -9
- package/lib/webview/types.js.map +0 -1
- package/lib/webview/use-webview-contents.d.ts +0 -2
- package/lib/webview/use-webview-contents.js +0 -90
- package/lib/webview/use-webview-contents.js.map +0 -1
- /package/lib/{services → cjs/services}/hubtype-queues-api.d.ts +0 -0
- /package/lib/{structured-output → cjs/structured-output}/flow-builder-content.d.ts +0 -0
- /package/lib/{utils → cjs/utils}/authentication.d.ts +0 -0
- /package/lib/{utils → cjs/utils}/flow-locale.d.ts +0 -0
- /package/lib/{utils → cjs/utils}/input.d.ts +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/flow-bot-action.js","sources":["../../src/content-fields/flow-bot-action.tsx"],"sourcesContent":["import {\n type BotContext,\n BotonicAction,\n EventAction,\n type EventBotAction,\n} from '@botonic/core'\nimport type { ActionRequest } from '@botonic/react'\n\nimport type { FlowBuilderApi } from '../api'\nimport {\n getCommonFlowContentEventArgsForContentId,\n trackEvent,\n} from '../tracking'\nimport { ContentFieldsBase } from './content-fields-base'\nimport type { HtBotActionNode } from './hubtype-fields'\n\nexport class FlowBotAction extends ContentFieldsBase {\n public code: string\n public payload: string\n\n static fromHubtypeCMS(\n cmsBotAction: HtBotActionNode,\n cmsApi: FlowBuilderApi\n ): FlowBotAction {\n const newBotAction = new FlowBotAction(cmsBotAction.id)\n newBotAction.code = cmsBotAction.code\n newBotAction.payload = cmsApi.createPayloadWithParams(cmsBotAction)\n newBotAction.followUp = cmsBotAction.follow_up\n\n return newBotAction\n }\n\n async trackFlow(botContext: BotContext): Promise<void> {\n const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } =\n getCommonFlowContentEventArgsForContentId(botContext, this.id)\n const eventBotAction: EventBotAction = {\n action: EventAction.BotAction,\n flowThreadId,\n flowId,\n flowName,\n flowNodeId,\n flowNodeContentId,\n flowNodeIsMeaningful: false,\n payload: this.payload,\n }\n const { action, ...eventArgs } = eventBotAction\n await trackEvent(botContext, action, eventArgs)\n }\n\n doBotAction(botContext: ActionRequest): void {\n botContext.session._botonic_action = `${BotonicAction.Redirect}:${this.payload}`\n }\n\n async processContent(botContext: BotContext): Promise<void> {\n await this.filterContent(botContext, this)\n this.doBotAction(botContext)\n await this.trackFlow(botContext)\n return\n }\n\n toBotonic(): JSX.Element {\n return <></>\n }\n}\n"],"names":["BotonicAction","EventAction","getCommonFlowContentEventArgsForContentId","trackEvent","ContentFieldsBase","FlowBotAction","cmsBotAction","cmsApi","newBotAction","botContext","flowThreadId","flowId","flowName","flowNodeId","flowNodeContentId","eventBotAction","action","eventArgs"],"mappings":";;;;;;;;;;AAKsB;AAOF;AACqC;AAGlD,MAAMK,aAAaA,SAASD,iBAAiBA;IAIlD,OAAO,eACLE,YAA6B,EAC7BC,MAAsB,EACP;QACf,MAAMC,eAAe,IAAIH,aAAaA,CAACC,aAAa,EAAE;QACtDE,aAAa,IAAI,GAAGF,aAAa,IAAI;QACrCE,aAAa,OAAO,GAAGD,OAAO,uBAAuB,CAACD;QACtDE,aAAa,QAAQ,GAAGF,aAAa,SAAS;QAE9C,OAAOE;IACT;IAEA,MAAM,UAAUC,UAAsB,EAAiB;QACrD,MAAM,EAAEC,YAAY,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,iBAAiB,EAAE,GACrEZ,yCAAyCA,CAACO,YAAY,IAAI,CAAC,EAAE;QAC/D,MAAMM,iBAAiC;YACrC,QAAQd,qBAAqB;YAC7BS;YACAC;YACAC;YACAC;YACAC;YACA,sBAAsB;YACtB,SAAS,IAAI,CAAC,OAAO;QACvB;QACA,MAAM,EAAEE,MAAM,EAAE,GAAGC,WAAW,GAAGF;QACjC,MAAMZ,UAAUA,CAACM,YAAYO,QAAQC;IACvC;IAEA,YAAYR,UAAyB,EAAQ;QAC3CA,WAAW,OAAO,CAAC,eAAe,GAAG,GAAGT,sBAAsB,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE;IAClF;IAEA,MAAM,eAAeS,UAAsB,EAAiB;QAC1D,MAAM,IAAI,CAAC,aAAa,CAACA,YAAY,IAAI;QACzC,IAAI,CAAC,WAAW,CAACA;QACjB,MAAM,IAAI,CAAC,SAAS,CAACA;QACrB;IACF;IAEA,YAAyB;QACvB,qBAAO;IACT;AACF"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { BotContext } from '@botonic/core';
|
|
2
|
-
import { type Webview } from '@botonic/react';
|
|
3
|
-
import type { FlowBuilderApi } from '../api.js';
|
|
4
|
-
import { ContentFieldsBase } from './content-fields-base.js';
|
|
5
|
-
import { FlowWebview } from './flow-webview.js';
|
|
6
|
-
import { type HtButton, HtButtonStyle } from './hubtype-fields/index.js';
|
|
7
|
-
import type { HtRatingButton } from './hubtype-fields/rating.js';
|
|
8
|
-
export declare class FlowButton extends ContentFieldsBase {
|
|
9
|
-
text: string;
|
|
10
|
-
url?: string;
|
|
11
|
-
payload?: string;
|
|
12
|
-
target?: string;
|
|
13
|
-
webview?: Webview;
|
|
14
|
-
flowWebview?: FlowWebview;
|
|
15
|
-
params?: Record<string, string>;
|
|
16
|
-
static fromHubtypeCMS(cmsButton: HtButton, locale: string, cmsApi: FlowBuilderApi, botContext: BotContext): FlowButton;
|
|
17
|
-
static fromAIAgent(button: {
|
|
18
|
-
id: string;
|
|
19
|
-
text: string;
|
|
20
|
-
payload?: string;
|
|
21
|
-
url?: string;
|
|
22
|
-
target?: string;
|
|
23
|
-
}): FlowButton;
|
|
24
|
-
static fromRating(button: HtRatingButton): FlowButton;
|
|
25
|
-
static getUrlId(cmsButton: HtButton, locale: string): string | undefined;
|
|
26
|
-
static getTargetWebview(cmsApi: FlowBuilderApi, targetId: string): FlowWebview | undefined;
|
|
27
|
-
trackFlow(botContext: BotContext): Promise<void>;
|
|
28
|
-
processContent(): Promise<void>;
|
|
29
|
-
renderButton(buttonIndex: number, buttonStyle?: HtButtonStyle): JSX.Element;
|
|
30
|
-
private getButtonPayload;
|
|
31
|
-
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Button, Reply } from "@botonic/react";
|
|
3
|
-
import { SOURCE_INFO_SEPARATOR } from "../constants.js";
|
|
4
|
-
import { ContentFieldsBase } from "./content-fields-base.js";
|
|
5
|
-
import { FlowWebview } from "./flow-webview.js";
|
|
6
|
-
import { HtButtonStyle, HtNodeWithContentType } from "./hubtype-fields/index.js";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class FlowButton extends ContentFieldsBase {
|
|
21
|
-
static fromHubtypeCMS(cmsButton, locale, cmsApi, botContext) {
|
|
22
|
-
const urlId = FlowButton.getUrlId(cmsButton, locale);
|
|
23
|
-
const newButton = new FlowButton(cmsButton.id);
|
|
24
|
-
newButton.text = FlowButton.getTextByLocale(locale, cmsButton.text);
|
|
25
|
-
if (cmsButton.target) {
|
|
26
|
-
const webview = FlowButton.getTargetWebview(cmsApi, cmsButton.target.id);
|
|
27
|
-
if (webview) {
|
|
28
|
-
newButton.flowWebview = webview;
|
|
29
|
-
newButton.webview = {
|
|
30
|
-
name: webview.webviewComponentName
|
|
31
|
-
};
|
|
32
|
-
newButton.params = webview.getParams(botContext);
|
|
33
|
-
} else {
|
|
34
|
-
newButton.payload = cmsApi.getPayload(cmsButton.target);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
if (cmsButton.url && urlId) {
|
|
38
|
-
const urlNode = cmsApi.getNodeById(urlId);
|
|
39
|
-
newButton.url = urlNode.content.url;
|
|
40
|
-
}
|
|
41
|
-
return newButton;
|
|
42
|
-
}
|
|
43
|
-
static fromAIAgent(button) {
|
|
44
|
-
const newButton = new FlowButton(button.id);
|
|
45
|
-
newButton.text = button.text;
|
|
46
|
-
if (button.url) {
|
|
47
|
-
newButton.url = button.url;
|
|
48
|
-
newButton.target = button.target;
|
|
49
|
-
} else {
|
|
50
|
-
newButton.payload = button.payload;
|
|
51
|
-
}
|
|
52
|
-
return newButton;
|
|
53
|
-
}
|
|
54
|
-
static fromRating(button) {
|
|
55
|
-
const newButton = new FlowButton(button.id);
|
|
56
|
-
newButton.text = button.text;
|
|
57
|
-
newButton.payload = button.payload;
|
|
58
|
-
newButton.target = button.target?.id;
|
|
59
|
-
return newButton;
|
|
60
|
-
}
|
|
61
|
-
static getUrlId(cmsButton, locale) {
|
|
62
|
-
return cmsButton.url.find((url)=>url.locale === locale)?.id;
|
|
63
|
-
}
|
|
64
|
-
static getTargetWebview(cmsApi, targetId) {
|
|
65
|
-
const targetNode = cmsApi.getNodeById(targetId);
|
|
66
|
-
if (targetNode.type !== HtNodeWithContentType.WEBVIEW) {
|
|
67
|
-
return undefined;
|
|
68
|
-
}
|
|
69
|
-
return FlowWebview.fromHubtypeCMS(targetNode);
|
|
70
|
-
}
|
|
71
|
-
async trackFlow(botContext) {
|
|
72
|
-
if (this.flowWebview) {
|
|
73
|
-
await this.flowWebview.trackFlow(botContext);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
async processContent() {
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
renderButton(buttonIndex, buttonStyle) {
|
|
80
|
-
if (buttonStyle === HtButtonStyle.QUICK_REPLY) {
|
|
81
|
-
return /*#__PURE__*/ jsx(Reply, {
|
|
82
|
-
payload: this.getButtonPayload(buttonIndex),
|
|
83
|
-
children: this.text
|
|
84
|
-
}, this.id);
|
|
85
|
-
}
|
|
86
|
-
return /*#__PURE__*/ jsx(Button, {
|
|
87
|
-
url: this.url,
|
|
88
|
-
payload: this.getButtonPayload(buttonIndex),
|
|
89
|
-
target: this.target,
|
|
90
|
-
webview: this.webview,
|
|
91
|
-
params: this.params,
|
|
92
|
-
children: this.text
|
|
93
|
-
}, this.id);
|
|
94
|
-
}
|
|
95
|
-
getButtonPayload(buttonIndex) {
|
|
96
|
-
return this.payload ? `${this.payload}${SOURCE_INFO_SEPARATOR}${buttonIndex}` : undefined;
|
|
97
|
-
}
|
|
98
|
-
constructor(...args){
|
|
99
|
-
super(...args), this.text = '';
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export { FlowButton };
|
|
104
|
-
|
|
105
|
-
//# sourceMappingURL=flow-button.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/flow-button.js","sources":["../../src/content-fields/flow-button.tsx"],"sourcesContent":["import type { BotContext } from '@botonic/core'\nimport { Button, Reply, type Webview } from '@botonic/react'\n\nimport type { FlowBuilderApi } from '../api'\nimport { SOURCE_INFO_SEPARATOR } from '../constants'\nimport { ContentFieldsBase } from './content-fields-base'\nimport { FlowWebview } from './flow-webview'\nimport {\n type HtButton,\n HtButtonStyle,\n HtNodeWithContentType,\n type HtUrlNode,\n} from './hubtype-fields'\nimport type { HtRatingButton } from './hubtype-fields/rating'\n\nexport class FlowButton extends ContentFieldsBase {\n public text = ''\n public url?: string\n public payload?: string\n public target?: string\n public webview?: Webview\n public flowWebview?: FlowWebview // Used for tracking\n public params?: Record<string, string>\n\n static fromHubtypeCMS(\n cmsButton: HtButton,\n locale: string,\n cmsApi: FlowBuilderApi,\n botContext: BotContext\n ): FlowButton {\n const urlId = FlowButton.getUrlId(cmsButton, locale)\n\n const newButton = new FlowButton(cmsButton.id)\n newButton.text = FlowButton.getTextByLocale(locale, cmsButton.text)\n if (cmsButton.target) {\n const webview = FlowButton.getTargetWebview(cmsApi, cmsButton.target.id)\n if (webview) {\n newButton.flowWebview = webview\n newButton.webview = { name: webview.webviewComponentName }\n newButton.params = webview.getParams(botContext)\n } else {\n newButton.payload = cmsApi.getPayload(cmsButton.target)\n }\n }\n\n if (cmsButton.url && urlId) {\n const urlNode = cmsApi.getNodeById<HtUrlNode>(urlId)\n newButton.url = urlNode.content.url\n }\n\n return newButton\n }\n\n static fromAIAgent(button: {\n id: string\n text: string\n payload?: string\n url?: string\n target?: string\n }): FlowButton {\n const newButton = new FlowButton(button.id)\n newButton.text = button.text\n if (button.url) {\n newButton.url = button.url\n newButton.target = button.target\n } else {\n newButton.payload = button.payload\n }\n return newButton\n }\n\n static fromRating(button: HtRatingButton): FlowButton {\n const newButton = new FlowButton(button.id)\n newButton.text = button.text\n newButton.payload = button.payload\n newButton.target = button.target?.id\n return newButton\n }\n\n static getUrlId(cmsButton: HtButton, locale: string): string | undefined {\n return cmsButton.url.find(url => url.locale === locale)?.id\n }\n\n static getTargetWebview(\n cmsApi: FlowBuilderApi,\n targetId: string\n ): FlowWebview | undefined {\n const targetNode = cmsApi.getNodeById(targetId)\n if (targetNode.type !== HtNodeWithContentType.WEBVIEW) {\n return undefined\n }\n return FlowWebview.fromHubtypeCMS(targetNode)\n }\n\n async trackFlow(botContext: BotContext): Promise<void> {\n if (this.flowWebview) {\n await this.flowWebview.trackFlow(botContext)\n }\n }\n\n async processContent(): Promise<void> {\n return\n }\n\n renderButton(buttonIndex: number, buttonStyle?: HtButtonStyle): JSX.Element {\n if (buttonStyle === HtButtonStyle.QUICK_REPLY) {\n return (\n <Reply key={this.id} payload={this.getButtonPayload(buttonIndex)}>\n {this.text}\n </Reply>\n )\n }\n\n return (\n <Button\n key={this.id}\n url={this.url}\n payload={this.getButtonPayload(buttonIndex)}\n target={this.target}\n webview={this.webview}\n params={this.params}\n >\n {this.text}\n </Button>\n )\n }\n\n private getButtonPayload(buttonIndex: number): string | undefined {\n return this.payload\n ? `${this.payload}${SOURCE_INFO_SEPARATOR}${buttonIndex}`\n : undefined\n }\n}\n"],"names":["Button","Reply","SOURCE_INFO_SEPARATOR","ContentFieldsBase","FlowWebview","HtButtonStyle","HtNodeWithContentType","FlowButton","cmsButton","locale","cmsApi","botContext","urlId","newButton","webview","urlNode","button","url","targetId","targetNode","undefined","buttonIndex","buttonStyle"],"mappings":"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"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { BotContext } from '@botonic/core';
|
|
2
|
-
import { ContentFieldsBase } from './content-fields-base.js';
|
|
3
|
-
import { HtAiValidationType, type HtCaptureUserInputNode } from './hubtype-fields/capture-user-input.js';
|
|
4
|
-
export declare class FlowCaptureUserInput extends ContentFieldsBase {
|
|
5
|
-
fieldName: string;
|
|
6
|
-
aiValidationType: HtAiValidationType;
|
|
7
|
-
aiValidationInstructions: string;
|
|
8
|
-
captureSuccessId: string;
|
|
9
|
-
captureFailId: string;
|
|
10
|
-
static fromHubtypeCMS(cmsText: HtCaptureUserInputNode): FlowCaptureUserInput;
|
|
11
|
-
trackFlow(_botContext: BotContext): Promise<void>;
|
|
12
|
-
processContent(): Promise<void>;
|
|
13
|
-
toBotonic(botContext: BotContext): JSX.Element;
|
|
14
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { getFlowBuilderPlugin } from "../utils/get-flow-builder-plugin.js";
|
|
3
|
-
import { ContentFieldsBase } from "./content-fields-base.js";
|
|
4
|
-
import { HtAiValidationType } from "./hubtype-fields/capture-user-input.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class FlowCaptureUserInput extends ContentFieldsBase {
|
|
15
|
-
static fromHubtypeCMS(cmsText) {
|
|
16
|
-
const newCaptureUserInput = new FlowCaptureUserInput(cmsText.id);
|
|
17
|
-
newCaptureUserInput.code = cmsText.code;
|
|
18
|
-
newCaptureUserInput.fieldName = cmsText.content.field_name;
|
|
19
|
-
newCaptureUserInput.aiValidationType = cmsText.content.ai_validation_type || HtAiValidationType.NONE;
|
|
20
|
-
newCaptureUserInput.aiValidationInstructions = cmsText.content.ai_validation_instructions || '';
|
|
21
|
-
newCaptureUserInput.captureSuccessId = cmsText.content.capture_success.id;
|
|
22
|
-
newCaptureUserInput.captureFailId = cmsText.content.capture_fail.id;
|
|
23
|
-
newCaptureUserInput.followUp = undefined;
|
|
24
|
-
return newCaptureUserInput;
|
|
25
|
-
}
|
|
26
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
27
|
-
async trackFlow(_botContext) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
async processContent() {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
toBotonic(botContext) {
|
|
34
|
-
const flowBuilderPlugin = getFlowBuilderPlugin(botContext.plugins);
|
|
35
|
-
const cmsApi = flowBuilderPlugin.cmsApi;
|
|
36
|
-
cmsApi.setCaptureUserInputId(this.id);
|
|
37
|
-
return /*#__PURE__*/ jsx(Fragment, {});
|
|
38
|
-
}
|
|
39
|
-
constructor(...args){
|
|
40
|
-
super(...args), this.fieldName = '', this.aiValidationType = HtAiValidationType.NONE, this.aiValidationInstructions = '', this.captureSuccessId = '', this.captureFailId = '';
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export { FlowCaptureUserInput };
|
|
45
|
-
|
|
46
|
-
//# sourceMappingURL=flow-capture-user-input.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/flow-capture-user-input.js","sources":["../../src/content-fields/flow-capture-user-input.tsx"],"sourcesContent":["import type { BotContext } from '@botonic/core'\n\nimport { getFlowBuilderPlugin } from '../utils/get-flow-builder-plugin'\nimport { ContentFieldsBase } from './content-fields-base'\nimport {\n HtAiValidationType,\n type HtCaptureUserInputNode,\n} from './hubtype-fields/capture-user-input'\n\nexport class FlowCaptureUserInput extends ContentFieldsBase {\n public fieldName = ''\n public aiValidationType = HtAiValidationType.NONE\n public aiValidationInstructions = ''\n public captureSuccessId = ''\n public captureFailId = ''\n\n static fromHubtypeCMS(cmsText: HtCaptureUserInputNode): FlowCaptureUserInput {\n const newCaptureUserInput = new FlowCaptureUserInput(cmsText.id)\n newCaptureUserInput.code = cmsText.code\n newCaptureUserInput.fieldName = cmsText.content.field_name\n newCaptureUserInput.aiValidationType =\n cmsText.content.ai_validation_type || HtAiValidationType.NONE\n newCaptureUserInput.aiValidationInstructions =\n cmsText.content.ai_validation_instructions || ''\n newCaptureUserInput.captureSuccessId = cmsText.content.capture_success.id\n newCaptureUserInput.captureFailId = cmsText.content.capture_fail.id\n newCaptureUserInput.followUp = undefined\n\n return newCaptureUserInput\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async trackFlow(_botContext: BotContext): Promise<void> {\n return\n }\n\n async processContent(): Promise<void> {\n return\n }\n\n toBotonic(botContext: BotContext): JSX.Element {\n const flowBuilderPlugin = getFlowBuilderPlugin(botContext.plugins)\n const cmsApi = flowBuilderPlugin.cmsApi\n cmsApi.setCaptureUserInputId(this.id)\n\n return <></>\n }\n}\n"],"names":["getFlowBuilderPlugin","ContentFieldsBase","HtAiValidationType","FlowCaptureUserInput","cmsText","newCaptureUserInput","undefined","_botContext","botContext","flowBuilderPlugin","cmsApi"],"mappings":";;;;;;;;;;AAEuE;AACd;AAIb;AAErC,MAAMG,oBAAoBA,SAASF,iBAAiBA;IAOzD,OAAO,eAAeG,OAA+B,EAAwB;QAC3E,MAAMC,sBAAsB,IAAIF,oBAAoBA,CAACC,QAAQ,EAAE;QAC/DC,oBAAoB,IAAI,GAAGD,QAAQ,IAAI;QACvCC,oBAAoB,SAAS,GAAGD,QAAQ,OAAO,CAAC,UAAU;QAC1DC,oBAAoB,gBAAgB,GAClCD,QAAQ,OAAO,CAAC,kBAAkB,IAAIF,uBAAuB;QAC/DG,oBAAoB,wBAAwB,GAC1CD,QAAQ,OAAO,CAAC,0BAA0B,IAAI;QAChDC,oBAAoB,gBAAgB,GAAGD,QAAQ,OAAO,CAAC,eAAe,CAAC,EAAE;QACzEC,oBAAoB,aAAa,GAAGD,QAAQ,OAAO,CAAC,YAAY,CAAC,EAAE;QACnEC,oBAAoB,QAAQ,GAAGC;QAE/B,OAAOD;IACT;IAEA,6DAA6D;IAC7D,MAAM,UAAUE,WAAuB,EAAiB;QACtD;IACF;IAEA,MAAM,iBAAgC;QACpC;IACF;IAEA,UAAUC,UAAsB,EAAe;QAC7C,MAAMC,oBAAoBT,oBAAoBA,CAACQ,WAAW,OAAO;QACjE,MAAME,SAASD,kBAAkB,MAAM;QACvCC,OAAO,qBAAqB,CAAC,IAAI,CAAC,EAAE;QAEpC,qBAAO;IACT;;QArCK,qBACE,YAAY,SACZ,mBAAmBR,uBAAuB,OAC1C,2BAA2B,SAC3B,mBAAmB,SACnB,gBAAgB;;AAiCzB"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { type BotContext, type CarouselMessage } from '@botonic/core';
|
|
2
|
-
import { type ActionRequest } from '@botonic/react';
|
|
3
|
-
import type { FlowBuilderApi } from '../api.js';
|
|
4
|
-
import { ContentFieldsBase } from './content-fields-base.js';
|
|
5
|
-
import { FlowElement } from './flow-element.js';
|
|
6
|
-
import type { HtCarouselNode } from './hubtype-fields/index.js';
|
|
7
|
-
export declare class FlowCarousel extends ContentFieldsBase {
|
|
8
|
-
whatsappText: string;
|
|
9
|
-
elements: FlowElement[];
|
|
10
|
-
static fromHubtypeCMS(component: HtCarouselNode, locale: string, cmsApi: FlowBuilderApi, botContext: BotContext): FlowCarousel;
|
|
11
|
-
trackFlow(request: ActionRequest): Promise<void>;
|
|
12
|
-
static areElementsValidForWhatsapp: (carouselMessage: CarouselMessage) => boolean;
|
|
13
|
-
static generateWhatsappElementText(element: {
|
|
14
|
-
title: string;
|
|
15
|
-
subtitle?: string;
|
|
16
|
-
}): string;
|
|
17
|
-
private static createCardsFromElements;
|
|
18
|
-
static fromAIAgent(id: string, carouselMessage: CarouselMessage, botContext: ActionRequest): JSX.Element;
|
|
19
|
-
private toCarouselMessage;
|
|
20
|
-
processContent(botContext: BotContext): Promise<void>;
|
|
21
|
-
toBotonic(botContext: BotContext): JSX.Element;
|
|
22
|
-
}
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { OutputMessageType, isWhatsapp } from "@botonic/core";
|
|
3
|
-
import { Button, CardType, Carousel, Text, WhatsappCTAUrlButton, WhatsappCTAUrlHeaderType, WhatsappInteractiveMediaCarousel } from "@botonic/react";
|
|
4
|
-
import { trackOneContent } from "../tracking.js";
|
|
5
|
-
import { ContentFieldsBase } from "./content-fields-base.js";
|
|
6
|
-
import { FlowElement } from "./flow-element.js";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const DEFAULT_TEXT_MESSAGE = 'These are the options';
|
|
21
|
-
class FlowCarousel extends ContentFieldsBase {
|
|
22
|
-
static fromHubtypeCMS(component, locale, cmsApi, botContext) {
|
|
23
|
-
const newCarousel = new FlowCarousel(component.id);
|
|
24
|
-
newCarousel.code = component.code;
|
|
25
|
-
newCarousel.elements = component.content.elements.map((element)=>FlowElement.fromHubtypeCMS(element, locale, cmsApi, botContext));
|
|
26
|
-
newCarousel.whatsappText = FlowCarousel.getTextByLocale(locale, component.content.whatsapp_text);
|
|
27
|
-
newCarousel.followUp = component.follow_up;
|
|
28
|
-
return newCarousel;
|
|
29
|
-
}
|
|
30
|
-
async trackFlow(request) {
|
|
31
|
-
await trackOneContent(request, this);
|
|
32
|
-
for (const element of this.elements){
|
|
33
|
-
await element.trackFlow(request);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
static generateWhatsappElementText(element) {
|
|
37
|
-
if (element.subtitle) {
|
|
38
|
-
return `*${element.title}*\n${element.subtitle}`;
|
|
39
|
-
}
|
|
40
|
-
return element.title;
|
|
41
|
-
}
|
|
42
|
-
static createCardsFromElements(elements) {
|
|
43
|
-
return elements.map((element)=>{
|
|
44
|
-
const text = FlowCarousel.generateWhatsappElementText(element);
|
|
45
|
-
if (element.button?.url) {
|
|
46
|
-
return {
|
|
47
|
-
imageLink: element.image,
|
|
48
|
-
text,
|
|
49
|
-
type: CardType.CTA_URL,
|
|
50
|
-
action: {
|
|
51
|
-
buttonText: element.button.text,
|
|
52
|
-
buttonUrl: element.button.url
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
if (element.button?.payload) {
|
|
57
|
-
return {
|
|
58
|
-
imageLink: element.image,
|
|
59
|
-
text,
|
|
60
|
-
type: CardType.QUICK_REPLY,
|
|
61
|
-
action: {
|
|
62
|
-
buttons: [
|
|
63
|
-
{
|
|
64
|
-
text: element.button.text,
|
|
65
|
-
payload: element.button.payload
|
|
66
|
-
}
|
|
67
|
-
]
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
throw new Error('Element must have a url or a payload');
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
static fromAIAgent(id, carouselMessage, botContext) {
|
|
75
|
-
if (isWhatsapp(botContext.session) && FlowCarousel.areElementsValidForWhatsapp(carouselMessage)) {
|
|
76
|
-
if (carouselMessage.content.elements.length === 1 && carouselMessage.content.elements[0].button?.url) {
|
|
77
|
-
const element = carouselMessage.content.elements[0];
|
|
78
|
-
const buttonText = element.button.text;
|
|
79
|
-
const url = carouselMessage.content.elements[0].button.url;
|
|
80
|
-
// TODO: Add a new fromAIAgent method in FlowWhatsappCtaUrlButtonNode to create a WhatsappCTAUrlButton from an AIAgent message
|
|
81
|
-
return /*#__PURE__*/ jsx(WhatsappCTAUrlButton, {
|
|
82
|
-
body: element.title,
|
|
83
|
-
headerType: WhatsappCTAUrlHeaderType.Image,
|
|
84
|
-
headerImage: element.image,
|
|
85
|
-
footer: element.subtitle,
|
|
86
|
-
displayText: buttonText,
|
|
87
|
-
url: url
|
|
88
|
-
}, id);
|
|
89
|
-
}
|
|
90
|
-
if (carouselMessage.content.elements.length === 1 && carouselMessage.content.elements[0].button?.payload) {
|
|
91
|
-
const element = carouselMessage.content.elements[0];
|
|
92
|
-
const text = FlowCarousel.generateWhatsappElementText(element);
|
|
93
|
-
const buttonPayload = carouselMessage.content.elements[0].button.payload;
|
|
94
|
-
const buttonText = carouselMessage.content.elements[0].button.text;
|
|
95
|
-
return /*#__PURE__*/ jsxs(Text, {
|
|
96
|
-
children: [
|
|
97
|
-
text,
|
|
98
|
-
/*#__PURE__*/ jsx(Button, {
|
|
99
|
-
payload: buttonPayload,
|
|
100
|
-
children: buttonText
|
|
101
|
-
})
|
|
102
|
-
]
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
const elements = carouselMessage.content.elements.map((element, index)=>FlowElement.fromAIAgent(`${id}-element-${index}`, element));
|
|
106
|
-
return /*#__PURE__*/ jsx(WhatsappInteractiveMediaCarousel, {
|
|
107
|
-
cards: FlowCarousel.createCardsFromElements(elements),
|
|
108
|
-
textMessage: carouselMessage.content.text || DEFAULT_TEXT_MESSAGE
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
return /*#__PURE__*/ jsx(Carousel, {
|
|
112
|
-
children: carouselMessage.content.elements.map((element, index)=>FlowElement.fromAIAgent(`${id}-element-${index}`, element).renderElement(id))
|
|
113
|
-
}, id);
|
|
114
|
-
}
|
|
115
|
-
toCarouselMessage(elements) {
|
|
116
|
-
return {
|
|
117
|
-
type: OutputMessageType.Carousel,
|
|
118
|
-
content: {
|
|
119
|
-
elements: elements.map((element)=>{
|
|
120
|
-
return {
|
|
121
|
-
button: {
|
|
122
|
-
text: element.button?.text || '',
|
|
123
|
-
payload: element.button?.payload,
|
|
124
|
-
url: element.button?.url
|
|
125
|
-
},
|
|
126
|
-
title: element.title,
|
|
127
|
-
subtitle: element.subtitle,
|
|
128
|
-
image: element.image
|
|
129
|
-
};
|
|
130
|
-
})
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
async processContent(botContext) {
|
|
135
|
-
await this.filterContent(botContext, this);
|
|
136
|
-
await this.trackFlow(botContext);
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
toBotonic(botContext) {
|
|
140
|
-
const carouselMessage = this.toCarouselMessage(this.elements);
|
|
141
|
-
if (isWhatsapp(botContext.session) && FlowCarousel.areElementsValidForWhatsapp(carouselMessage)) {
|
|
142
|
-
if (this.elements.length === 1 && this.elements[0].button?.url) {
|
|
143
|
-
const element = this.elements[0];
|
|
144
|
-
const buttonText = this.elements[0].button.text;
|
|
145
|
-
const url = this.elements[0].button.url;
|
|
146
|
-
return /*#__PURE__*/ jsx(WhatsappCTAUrlButton, {
|
|
147
|
-
body: element.title,
|
|
148
|
-
headerType: WhatsappCTAUrlHeaderType.Image,
|
|
149
|
-
headerImage: element.image,
|
|
150
|
-
displayText: buttonText,
|
|
151
|
-
url: url
|
|
152
|
-
}, this.id);
|
|
153
|
-
}
|
|
154
|
-
if (this.elements.length === 1 && this.elements[0].button && this.elements[0].button?.payload) {
|
|
155
|
-
const element = this.elements[0];
|
|
156
|
-
const text = FlowCarousel.generateWhatsappElementText(element);
|
|
157
|
-
const buttonPayload = this.elements[0].button.payload;
|
|
158
|
-
const buttonText = this.elements[0].button.text;
|
|
159
|
-
return /*#__PURE__*/ jsxs(Text, {
|
|
160
|
-
children: [
|
|
161
|
-
text,
|
|
162
|
-
/*#__PURE__*/ jsx(Button, {
|
|
163
|
-
payload: buttonPayload,
|
|
164
|
-
children: buttonText
|
|
165
|
-
})
|
|
166
|
-
]
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
return /*#__PURE__*/ jsx(WhatsappInteractiveMediaCarousel, {
|
|
170
|
-
cards: FlowCarousel.createCardsFromElements(this.elements),
|
|
171
|
-
// TODO: Add the text message in flow builder frontend and take it from the carousel node with different languages
|
|
172
|
-
textMessage: this.whatsappText || DEFAULT_TEXT_MESSAGE
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
return /*#__PURE__*/ jsx(Carousel, {
|
|
176
|
-
children: this.elements.map((element)=>element.renderElement(this.id))
|
|
177
|
-
}, this.id);
|
|
178
|
-
}
|
|
179
|
-
constructor(...args){
|
|
180
|
-
super(...args), this.whatsappText = '', this.elements = [];
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
FlowCarousel.areElementsValidForWhatsapp = (carouselMessage)=>{
|
|
184
|
-
const isValid = carouselMessage.content.elements.every((element)=>element.button.url) || carouselMessage.content.elements.every((element)=>element.button.payload);
|
|
185
|
-
if (!isValid) {
|
|
186
|
-
console.warn('Cannot use WhatsappInteractiveMediaCarousel for Whatsapp created by AIAgent, all elements must have either url or payload.', carouselMessage.content);
|
|
187
|
-
}
|
|
188
|
-
return isValid;
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
export { FlowCarousel };
|
|
192
|
-
|
|
193
|
-
//# sourceMappingURL=flow-carousel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/flow-carousel.js","sources":["../../src/content-fields/flow-carousel.tsx"],"sourcesContent":["import {\n type BotContext,\n type CarouselMessage,\n isWhatsapp,\n OutputMessageType,\n} from '@botonic/core'\nimport {\n type ActionRequest,\n Button,\n CardType,\n Carousel,\n Text,\n WhatsappCTAUrlButton,\n WhatsappCTAUrlHeaderType,\n type WhatsappInteractiveMediaCard,\n WhatsappInteractiveMediaCarousel,\n} from '@botonic/react'\n\nimport type { FlowBuilderApi } from '../api'\nimport { trackOneContent } from '../tracking'\nimport { ContentFieldsBase } from './content-fields-base'\nimport { FlowElement } from './flow-element'\nimport type { HtCarouselNode } from './hubtype-fields'\n\nconst DEFAULT_TEXT_MESSAGE = 'These are the options'\nexport class FlowCarousel extends ContentFieldsBase {\n public whatsappText: string = ''\n public elements: FlowElement[] = []\n\n static fromHubtypeCMS(\n component: HtCarouselNode,\n locale: string,\n cmsApi: FlowBuilderApi,\n botContext: BotContext\n ): FlowCarousel {\n const newCarousel = new FlowCarousel(component.id)\n newCarousel.code = component.code\n newCarousel.elements = component.content.elements.map(element =>\n FlowElement.fromHubtypeCMS(element, locale, cmsApi, botContext)\n )\n newCarousel.whatsappText = FlowCarousel.getTextByLocale(\n locale,\n component.content.whatsapp_text\n )\n newCarousel.followUp = component.follow_up\n\n return newCarousel\n }\n\n async trackFlow(request: ActionRequest): Promise<void> {\n await trackOneContent(request, this)\n for (const element of this.elements) {\n await element.trackFlow(request)\n }\n }\n\n static areElementsValidForWhatsapp = (carouselMessage: CarouselMessage) => {\n const isValid =\n carouselMessage.content.elements.every(element => element.button.url) ||\n carouselMessage.content.elements.every(element => element.button.payload)\n\n if (!isValid) {\n console.warn(\n 'Cannot use WhatsappInteractiveMediaCarousel for Whatsapp created by AIAgent, all elements must have either url or payload.',\n carouselMessage.content\n )\n }\n return isValid\n }\n\n static generateWhatsappElementText(element: {\n title: string\n subtitle?: string\n }): string {\n if (element.subtitle) {\n return `*${element.title}*\\n${element.subtitle}`\n }\n return element.title\n }\n\n private static createCardsFromElements(\n elements: FlowElement[]\n ): WhatsappInteractiveMediaCard[] {\n return elements.map(element => {\n const text = FlowCarousel.generateWhatsappElementText(element)\n\n if (element.button?.url) {\n return {\n imageLink: element.image,\n text,\n type: CardType.CTA_URL as const,\n action: {\n buttonText: element.button.text,\n buttonUrl: element.button.url,\n },\n }\n }\n if (element.button?.payload) {\n return {\n imageLink: element.image,\n text,\n type: CardType.QUICK_REPLY as const,\n action: {\n buttons: [\n {\n text: element.button.text,\n payload: element.button.payload,\n },\n ],\n },\n }\n }\n throw new Error('Element must have a url or a payload')\n })\n }\n\n static fromAIAgent(\n id: string,\n carouselMessage: CarouselMessage,\n botContext: ActionRequest\n ): JSX.Element {\n if (\n isWhatsapp(botContext.session) &&\n FlowCarousel.areElementsValidForWhatsapp(carouselMessage)\n ) {\n if (\n carouselMessage.content.elements.length === 1 &&\n carouselMessage.content.elements[0].button?.url\n ) {\n const element = carouselMessage.content.elements[0]\n const buttonText = element.button.text\n const url = carouselMessage.content.elements[0].button.url\n // TODO: Add a new fromAIAgent method in FlowWhatsappCtaUrlButtonNode to create a WhatsappCTAUrlButton from an AIAgent message\n return (\n <WhatsappCTAUrlButton\n key={id}\n body={element.title}\n headerType={WhatsappCTAUrlHeaderType.Image}\n headerImage={element.image}\n footer={element.subtitle}\n displayText={buttonText}\n url={url}\n />\n )\n }\n\n if (\n carouselMessage.content.elements.length === 1 &&\n carouselMessage.content.elements[0].button?.payload\n ) {\n const element = carouselMessage.content.elements[0]\n const text = FlowCarousel.generateWhatsappElementText(element)\n const buttonPayload = carouselMessage.content.elements[0].button.payload\n const buttonText = carouselMessage.content.elements[0].button.text\n\n return (\n <Text>\n {text}\n <Button payload={buttonPayload}>{buttonText}</Button>\n </Text>\n )\n }\n\n const elements = carouselMessage.content.elements.map((element, index) =>\n FlowElement.fromAIAgent(`${id}-element-${index}`, element)\n )\n return (\n <WhatsappInteractiveMediaCarousel\n cards={FlowCarousel.createCardsFromElements(elements)}\n textMessage={carouselMessage.content.text || DEFAULT_TEXT_MESSAGE}\n />\n )\n }\n return (\n <Carousel key={id}>\n {carouselMessage.content.elements.map((element, index) =>\n FlowElement.fromAIAgent(\n `${id}-element-${index}`,\n element\n ).renderElement(id)\n )}\n </Carousel>\n )\n }\n\n private toCarouselMessage(elements: FlowElement[]): CarouselMessage {\n return {\n type: OutputMessageType.Carousel,\n content: {\n elements: elements.map(element => {\n return {\n button: {\n text: element.button?.text || '',\n payload: element.button?.payload,\n url: element.button?.url,\n },\n title: element.title,\n subtitle: element.subtitle,\n image: element.image,\n }\n }),\n },\n }\n }\n\n async processContent(botContext: BotContext): Promise<void> {\n await this.filterContent(botContext, this)\n await this.trackFlow(botContext)\n return\n }\n\n toBotonic(botContext: BotContext): JSX.Element {\n const carouselMessage = this.toCarouselMessage(this.elements)\n if (\n isWhatsapp(botContext.session) &&\n FlowCarousel.areElementsValidForWhatsapp(carouselMessage)\n ) {\n if (this.elements.length === 1 && this.elements[0].button?.url) {\n const element = this.elements[0]\n const buttonText = this.elements[0].button.text\n const url = this.elements[0].button.url\n\n return (\n <WhatsappCTAUrlButton\n key={this.id}\n body={element.title}\n headerType={WhatsappCTAUrlHeaderType.Image}\n headerImage={element.image}\n displayText={buttonText}\n url={url}\n />\n )\n }\n\n if (\n this.elements.length === 1 &&\n this.elements[0].button &&\n this.elements[0].button?.payload\n ) {\n const element = this.elements[0]\n const text = FlowCarousel.generateWhatsappElementText(element)\n const buttonPayload = this.elements[0].button.payload\n const buttonText = this.elements[0].button.text\n\n return (\n <Text>\n {text}\n <Button payload={buttonPayload}>{buttonText}</Button>\n </Text>\n )\n }\n\n return (\n <WhatsappInteractiveMediaCarousel\n cards={FlowCarousel.createCardsFromElements(this.elements)}\n // TODO: Add the text message in flow builder frontend and take it from the carousel node with different languages\n textMessage={this.whatsappText || DEFAULT_TEXT_MESSAGE}\n />\n )\n }\n return (\n <Carousel key={this.id}>\n {this.elements.map(element => element.renderElement(this.id))}\n </Carousel>\n )\n }\n}\n"],"names":["isWhatsapp","OutputMessageType","Button","CardType","Carousel","Text","WhatsappCTAUrlButton","WhatsappCTAUrlHeaderType","WhatsappInteractiveMediaCarousel","trackOneContent","ContentFieldsBase","FlowElement","DEFAULT_TEXT_MESSAGE","FlowCarousel","component","locale","cmsApi","botContext","newCarousel","element","request","elements","text","Error","id","carouselMessage","buttonText","url","buttonPayload","index","isValid","console"],"mappings":"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"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type BotContext } from '@botonic/core';
|
|
2
|
-
import { ContentFieldsBase } from './content-fields-base.js';
|
|
3
|
-
import type { HtChannelConditionalNode } from './hubtype-fields/channel-conditional.js';
|
|
4
|
-
import type { HtFunctionResult } from './hubtype-fields/function.js';
|
|
5
|
-
export declare class FlowChannelConditional extends ContentFieldsBase {
|
|
6
|
-
resultMapping: HtFunctionResult[];
|
|
7
|
-
conditionalResult?: HtFunctionResult;
|
|
8
|
-
channelResult: string;
|
|
9
|
-
static fromHubtypeCMS(component: HtChannelConditionalNode, botContext: BotContext): FlowChannelConditional;
|
|
10
|
-
setConditionalResult(botContext: BotContext): void;
|
|
11
|
-
trackFlow(botContext: BotContext): Promise<void>;
|
|
12
|
-
processContent(botContext: BotContext): Promise<void>;
|
|
13
|
-
toBotonic(): JSX.Element;
|
|
14
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { EventAction } from "@botonic/core";
|
|
3
|
-
import { getCommonFlowContentEventArgsForContentId, trackEvent } from "../tracking.js";
|
|
4
|
-
import { ContentFieldsBase } from "./content-fields-base.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class FlowChannelConditional extends ContentFieldsBase {
|
|
15
|
-
static fromHubtypeCMS(component, botContext) {
|
|
16
|
-
const newChannelConditional = new FlowChannelConditional(component.id);
|
|
17
|
-
newChannelConditional.code = component.code;
|
|
18
|
-
newChannelConditional.resultMapping = component.content.result_mapping;
|
|
19
|
-
newChannelConditional.setConditionalResult(botContext);
|
|
20
|
-
return newChannelConditional;
|
|
21
|
-
}
|
|
22
|
-
setConditionalResult(botContext) {
|
|
23
|
-
const provider = botContext.session.user.provider;
|
|
24
|
-
const conditionalResult = this.resultMapping.find((rMap)=>rMap.result === provider) || this.resultMapping.find((rMap)=>rMap.result === 'default');
|
|
25
|
-
if (!conditionalResult) {
|
|
26
|
-
throw new Error(`No conditional result found for node ${this.code} with channel: ${provider}`);
|
|
27
|
-
}
|
|
28
|
-
this.conditionalResult = conditionalResult;
|
|
29
|
-
this.channelResult = conditionalResult.result;
|
|
30
|
-
this.followUp = conditionalResult.target;
|
|
31
|
-
}
|
|
32
|
-
async trackFlow(botContext) {
|
|
33
|
-
const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } = getCommonFlowContentEventArgsForContentId(botContext, this.id);
|
|
34
|
-
const eventChannelConditional = {
|
|
35
|
-
action: EventAction.ConditionalChannel,
|
|
36
|
-
flowThreadId,
|
|
37
|
-
flowId,
|
|
38
|
-
flowName,
|
|
39
|
-
flowNodeId,
|
|
40
|
-
flowNodeContentId,
|
|
41
|
-
flowNodeIsMeaningful: false,
|
|
42
|
-
channel: this.channelResult
|
|
43
|
-
};
|
|
44
|
-
const { action, ...eventArgs } = eventChannelConditional;
|
|
45
|
-
await trackEvent(botContext, action, eventArgs);
|
|
46
|
-
}
|
|
47
|
-
async processContent(botContext) {
|
|
48
|
-
await this.filterContent(botContext, this);
|
|
49
|
-
await this.trackFlow(botContext);
|
|
50
|
-
}
|
|
51
|
-
toBotonic() {
|
|
52
|
-
return /*#__PURE__*/ jsx(Fragment, {});
|
|
53
|
-
}
|
|
54
|
-
constructor(...args){
|
|
55
|
-
super(...args), this.resultMapping = [], this.conditionalResult = undefined, this.channelResult = '';
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export { FlowChannelConditional };
|
|
60
|
-
|
|
61
|
-
//# sourceMappingURL=flow-channel-conditional.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/flow-channel-conditional.js","sources":["../../src/content-fields/flow-channel-conditional.tsx"],"sourcesContent":["import {\n type BotContext,\n EventAction,\n type EventConditionalChannel,\n} from '@botonic/core'\n\nimport {\n getCommonFlowContentEventArgsForContentId,\n trackEvent,\n} from '../tracking'\nimport { ContentFieldsBase } from './content-fields-base'\nimport type { HtChannelConditionalNode } from './hubtype-fields/channel-conditional'\nimport type { HtFunctionResult } from './hubtype-fields/function'\n\nexport class FlowChannelConditional extends ContentFieldsBase {\n public resultMapping: HtFunctionResult[] = []\n public conditionalResult?: HtFunctionResult = undefined\n public channelResult: string = ''\n\n static fromHubtypeCMS(\n component: HtChannelConditionalNode,\n botContext: BotContext\n ): FlowChannelConditional {\n const newChannelConditional = new FlowChannelConditional(component.id)\n newChannelConditional.code = component.code\n newChannelConditional.resultMapping = component.content.result_mapping\n newChannelConditional.setConditionalResult(botContext)\n\n return newChannelConditional\n }\n\n setConditionalResult(botContext: BotContext): void {\n const provider = botContext.session.user.provider\n const conditionalResult =\n this.resultMapping.find(rMap => rMap.result === provider) ||\n this.resultMapping.find(rMap => rMap.result === 'default')\n if (!conditionalResult) {\n throw new Error(\n `No conditional result found for node ${this.code} with channel: ${provider}`\n )\n }\n this.conditionalResult = conditionalResult\n this.channelResult = conditionalResult.result as string\n this.followUp = conditionalResult.target\n }\n\n async trackFlow(botContext: BotContext): Promise<void> {\n const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } =\n getCommonFlowContentEventArgsForContentId(botContext, this.id)\n\n const eventChannelConditional: EventConditionalChannel = {\n action: EventAction.ConditionalChannel,\n flowThreadId,\n flowId,\n flowName,\n flowNodeId,\n flowNodeContentId,\n flowNodeIsMeaningful: false,\n channel: this.channelResult,\n }\n const { action, ...eventArgs } = eventChannelConditional\n await trackEvent(botContext, action, eventArgs)\n }\n\n async processContent(botContext: BotContext): Promise<void> {\n await this.filterContent(botContext, this)\n await this.trackFlow(botContext)\n }\n\n toBotonic(): JSX.Element {\n return <></>\n }\n}\n"],"names":["EventAction","getCommonFlowContentEventArgsForContentId","trackEvent","ContentFieldsBase","FlowChannelConditional","component","botContext","newChannelConditional","provider","conditionalResult","rMap","Error","flowThreadId","flowId","flowName","flowNodeId","flowNodeContentId","eventChannelConditional","action","eventArgs","undefined"],"mappings":";;;;;;;;;;AAIsB;AAKF;AACqC;AAIlD,MAAMI,sBAAsBA,SAASD,iBAAiBA;IAK3D,OAAO,eACLE,SAAmC,EACnCC,UAAsB,EACE;QACxB,MAAMC,wBAAwB,IAAIH,sBAAsBA,CAACC,UAAU,EAAE;QACrEE,sBAAsB,IAAI,GAAGF,UAAU,IAAI;QAC3CE,sBAAsB,aAAa,GAAGF,UAAU,OAAO,CAAC,cAAc;QACtEE,sBAAsB,oBAAoB,CAACD;QAE3C,OAAOC;IACT;IAEA,qBAAqBD,UAAsB,EAAQ;QACjD,MAAME,WAAWF,WAAW,OAAO,CAAC,IAAI,CAAC,QAAQ;QACjD,MAAMG,oBACJ,IAAI,CAAC,aAAa,CAAC,IAAI,CAACC,CAAAA,OAAQA,KAAK,MAAM,KAAKF,aAChD,IAAI,CAAC,aAAa,CAAC,IAAI,CAACE,CAAAA,OAAQA,KAAK,MAAM,KAAK;QAClD,IAAI,CAACD,mBAAmB;YACtB,MAAM,IAAIE,MACR,CAAC,qCAAqC,EAAE,IAAI,CAAC,IAAI,CAAC,eAAe,EAAEH,UAAU;QAEjF;QACA,IAAI,CAAC,iBAAiB,GAAGC;QACzB,IAAI,CAAC,aAAa,GAAGA,kBAAkB,MAAM;QAC7C,IAAI,CAAC,QAAQ,GAAGA,kBAAkB,MAAM;IAC1C;IAEA,MAAM,UAAUH,UAAsB,EAAiB;QACrD,MAAM,EAAEM,YAAY,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,iBAAiB,EAAE,GACrEf,yCAAyCA,CAACK,YAAY,IAAI,CAAC,EAAE;QAE/D,MAAMW,0BAAmD;YACvD,QAAQjB,8BAA8B;YACtCY;YACAC;YACAC;YACAC;YACAC;YACA,sBAAsB;YACtB,SAAS,IAAI,CAAC,aAAa;QAC7B;QACA,MAAM,EAAEE,MAAM,EAAE,GAAGC,WAAW,GAAGF;QACjC,MAAMf,UAAUA,CAACI,YAAYY,QAAQC;IACvC;IAEA,MAAM,eAAeb,UAAsB,EAAiB;QAC1D,MAAM,IAAI,CAAC,aAAa,CAACA,YAAY,IAAI;QACzC,MAAM,IAAI,CAAC,SAAS,CAACA;IACvB;IAEA,YAAyB;QACvB,qBAAO;IACT;;QAzDK,qBACE,gBAAoC,EAAE,OACtC,oBAAuCc,gBACvC,gBAAwB;;AAuDjC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type BotContext } from '@botonic/core';
|
|
2
|
-
import { ContentFieldsBase } from './content-fields-base.js';
|
|
3
|
-
import type { HtFunctionResult } from './hubtype-fields/index.js';
|
|
4
|
-
import type { HtCountryConditionalNode } from './hubtype-fields/country-conditional.js';
|
|
5
|
-
export declare class FlowCountryConditional extends ContentFieldsBase {
|
|
6
|
-
resultMapping: HtFunctionResult[];
|
|
7
|
-
conditionalResult?: HtFunctionResult;
|
|
8
|
-
static fromHubtypeCMS(component: HtCountryConditionalNode, botContext: BotContext): FlowCountryConditional;
|
|
9
|
-
setConditionalResult(botContext: BotContext): void;
|
|
10
|
-
trackFlow(botContext: BotContext): Promise<void>;
|
|
11
|
-
processContent(botContext: BotContext): Promise<void>;
|
|
12
|
-
toBotonic(): JSX.Element;
|
|
13
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { EventAction } from "@botonic/core";
|
|
3
|
-
import { getCommonFlowContentEventArgsForContentId, trackEvent } from "../tracking.js";
|
|
4
|
-
import { ContentFieldsBase } from "./content-fields-base.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class FlowCountryConditional extends ContentFieldsBase {
|
|
15
|
-
static fromHubtypeCMS(component, botContext) {
|
|
16
|
-
const newCountryConditional = new FlowCountryConditional(component.id);
|
|
17
|
-
newCountryConditional.code = component.code;
|
|
18
|
-
newCountryConditional.resultMapping = component.content.result_mapping;
|
|
19
|
-
newCountryConditional.setConditionalResult(botContext);
|
|
20
|
-
return newCountryConditional;
|
|
21
|
-
}
|
|
22
|
-
setConditionalResult(botContext) {
|
|
23
|
-
const country = botContext.getUserCountry();
|
|
24
|
-
const conditionalResult = this.resultMapping.find((rMap)=>rMap.result === country) || this.resultMapping.find((rMap)=>rMap.result === 'default');
|
|
25
|
-
if (!conditionalResult) {
|
|
26
|
-
throw new Error(`No conditional result found for node ${this.code} with country: ${country}`);
|
|
27
|
-
}
|
|
28
|
-
this.conditionalResult = conditionalResult;
|
|
29
|
-
this.followUp = conditionalResult.target;
|
|
30
|
-
}
|
|
31
|
-
async trackFlow(botContext) {
|
|
32
|
-
const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } = getCommonFlowContentEventArgsForContentId(botContext, this.id);
|
|
33
|
-
if (!this.conditionalResult?.result) {
|
|
34
|
-
console.warn(`Tracking event for node ${this.code} but no conditional result found`);
|
|
35
|
-
}
|
|
36
|
-
const eventCountryConditional = {
|
|
37
|
-
action: EventAction.ConditionalCountry,
|
|
38
|
-
flowThreadId,
|
|
39
|
-
flowId,
|
|
40
|
-
flowName,
|
|
41
|
-
flowNodeId,
|
|
42
|
-
flowNodeContentId,
|
|
43
|
-
flowNodeIsMeaningful: false,
|
|
44
|
-
country: this.conditionalResult?.result ?? ''
|
|
45
|
-
};
|
|
46
|
-
const { action, ...eventArgs } = eventCountryConditional;
|
|
47
|
-
await trackEvent(botContext, action, eventArgs);
|
|
48
|
-
}
|
|
49
|
-
async processContent(botContext) {
|
|
50
|
-
await this.filterContent(botContext, this);
|
|
51
|
-
await this.trackFlow(botContext);
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
toBotonic() {
|
|
55
|
-
return /*#__PURE__*/ jsx(Fragment, {});
|
|
56
|
-
}
|
|
57
|
-
constructor(...args){
|
|
58
|
-
super(...args), this.resultMapping = [], this.conditionalResult = undefined;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export { FlowCountryConditional };
|
|
63
|
-
|
|
64
|
-
//# sourceMappingURL=flow-country-conditional.js.map
|