@botonic/plugin-flow-builder 0.58.0-alpha-new-stack.0 → 0.58.0-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/contents-result.d.ts +5 -0
- package/lib/cjs/action/contents-result.js +3 -0
- package/lib/cjs/action/contents-result.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 +4 -0
- package/lib/cjs/action/get-contents.js +51 -0
- package/lib/cjs/action/get-contents.js.map +1 -0
- package/lib/cjs/action/index.d.ts +27 -0
- package/lib/cjs/action/index.js +105 -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 +58 -0
- package/lib/cjs/action/payload.js.map +1 -0
- package/lib/cjs/action/push-flow-resolver.d.ts +22 -0
- package/lib/cjs/action/push-flow-resolver.js +66 -0
- package/lib/cjs/action/push-flow-resolver.js.map +1 -0
- package/lib/cjs/api.d.ts +45 -0
- package/lib/cjs/api.js +232 -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.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.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/contents-result.d.ts +5 -0
- package/lib/esm/action/contents-result.js +3 -0
- package/lib/esm/action/contents-result.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 +4 -0
- package/lib/esm/action/get-contents.js +51 -0
- package/lib/esm/action/get-contents.js.map +1 -0
- package/lib/esm/action/index.d.ts +27 -0
- package/lib/esm/action/index.js +105 -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 +58 -0
- package/lib/esm/action/payload.js.map +1 -0
- package/lib/esm/action/push-flow-resolver.d.ts +22 -0
- package/lib/esm/action/push-flow-resolver.js +66 -0
- package/lib/esm/action/push-flow-resolver.js.map +1 -0
- package/lib/esm/api.d.ts +45 -0
- package/lib/esm/api.js +232 -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 +9 -11
- package/src/action/contents-result.ts +6 -0
- package/src/action/first-interaction.ts +7 -6
- package/src/action/get-contents.ts +17 -8
- package/src/action/index.tsx +40 -6
- package/src/action/payload.ts +16 -46
- package/src/action/push-flow-resolver.ts +101 -0
- package/src/api.ts +13 -3
- package/src/content-fields/flow-contact-reasons-conditional.tsx +34 -5
- package/src/content-fields/flow-do-nothing.tsx +1 -1
- package/src/content-fields/hubtype-fields/contact-reasons-conditional.ts +4 -1
- package/lib/action/ai-agent-from-user-input.d.ts +0 -3
- package/lib/action/ai-agent-from-user-input.js +0 -43
- 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 -110
- 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 -59
- package/lib/action/get-contents.js.map +0 -1
- package/lib/action/index.d.ts +0 -25
- package/lib/action/index.js +0 -133
- 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 -45
- package/lib/api.js +0 -240
- package/lib/api.js.map +0 -1
- package/lib/bot-context-manager.d.ts +0 -17
- package/lib/bot-context-manager.js +0 -101
- package/lib/bot-context-manager.js.map +0 -1
- package/lib/constants.js +0 -18
- package/lib/constants.js.map +0 -1
- package/lib/content-fields/contact-reasons-conditional-matcher.d.ts +0 -4
- package/lib/content-fields/contact-reasons-conditional-matcher.js +0 -10
- package/lib/content-fields/contact-reasons-conditional-matcher.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 -137
- 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 -76
- 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-contact-reasons-conditional.d.ts +0 -14
- package/lib/content-fields/flow-contact-reasons-conditional.js +0 -68
- package/lib/content-fields/flow-contact-reasons-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-do-nothing.d.ts +0 -9
- package/lib/content-fields/flow-do-nothing.js +0 -33
- package/lib/content-fields/flow-do-nothing.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 -23
- package/lib/content-fields/flow-handoff.js +0 -117
- 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 -62
- 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/contact-reasons-conditional.d.ts +0 -16
- package/lib/content-fields/hubtype-fields/contact-reasons-conditional.js +0 -4
- package/lib/content-fields/hubtype-fields/contact-reasons-conditional.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/do-nothing.d.ts +0 -6
- package/lib/content-fields/hubtype-fields/do-nothing.js +0 -4
- package/lib/content-fields/hubtype-fields/do-nothing.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 -21
- package/lib/content-fields/hubtype-fields/handoff.js +0 -10
- 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 -28
- package/lib/content-fields/hubtype-fields/index.js +0 -59
- 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.js +0 -40
- package/lib/content-fields/hubtype-fields/node-types.js.map +0 -1
- package/lib/content-fields/hubtype-fields/nodes.d.ts +0 -28
- 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 -10
- 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 -27
- package/lib/content-fields/index.js +0 -79
- 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 -79
- 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 -42
- package/lib/index.js +0 -157
- 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/{constants.d.ts → cjs/constants.d.ts} +0 -0
- /package/lib/{content-fields → cjs/content-fields}/hubtype-fields/node-types.d.ts +0 -0
- /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,17 +0,0 @@
|
|
|
1
|
-
import { type BotContext, type InferenceResponse } from '@botonic/core';
|
|
2
|
-
import { type FlowBuilderContentMessage } from '../structured-output/flow-builder-content.js';
|
|
3
|
-
import { FlowAiAgentBase } from './flow-ai-agent-base.js';
|
|
4
|
-
import type { HtAiAgentNode } from './hubtype-fields/ai-agent.js';
|
|
5
|
-
import type { FlowContent } from './index.js';
|
|
6
|
-
export declare class FlowAiAgent extends FlowAiAgentBase {
|
|
7
|
-
activeTools?: {
|
|
8
|
-
name: string;
|
|
9
|
-
}[];
|
|
10
|
-
sources?: {
|
|
11
|
-
id: string;
|
|
12
|
-
name: string;
|
|
13
|
-
}[];
|
|
14
|
-
static fromHubtypeCMS(component: HtAiAgentNode, botContext: BotContext): FlowAiAgent;
|
|
15
|
-
getAIAgentResponse(botContext: BotContext, previousContents?: FlowContent[]): Promise<InferenceResponse<FlowBuilderContentMessage> | undefined>;
|
|
16
|
-
trackAiAgentResponse(botContext: BotContext): Promise<void>;
|
|
17
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { AiAgentType, EventAction } from "@botonic/core";
|
|
2
|
-
import { FlowBuilderContentSchema } from "../structured-output/flow-builder-content.js";
|
|
3
|
-
import { getCommonFlowContentEventArgsForContentId, trackEvent } from "../tracking.js";
|
|
4
|
-
import { getFlowBuilderPlugin } from "../utils/get-flow-builder-plugin.js";
|
|
5
|
-
import { FlowAiAgentBase } from "./flow-ai-agent-base.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class FlowAiAgent extends FlowAiAgentBase {
|
|
18
|
-
static fromHubtypeCMS(component, botContext) {
|
|
19
|
-
const newAiAgent = new FlowAiAgent(component.id);
|
|
20
|
-
newAiAgent.code = component.code;
|
|
21
|
-
newAiAgent.name = component.content.name;
|
|
22
|
-
newAiAgent.instructions = newAiAgent.replaceVariables(component.content.instructions, botContext);
|
|
23
|
-
newAiAgent.model = component.content.model;
|
|
24
|
-
newAiAgent.verbosity = component.content.verbosity;
|
|
25
|
-
newAiAgent.activeTools = component.content.active_tools;
|
|
26
|
-
newAiAgent.inputGuardrailRules = component.content.input_guardrail_rules || [];
|
|
27
|
-
newAiAgent.sources = component.content.sources;
|
|
28
|
-
newAiAgent.followUp = component.follow_up;
|
|
29
|
-
return newAiAgent;
|
|
30
|
-
}
|
|
31
|
-
async getAIAgentResponse(botContext, previousContents) {
|
|
32
|
-
const activeInputGuardrailRules = this.getActiveInputGuardrailRules(this.inputGuardrailRules);
|
|
33
|
-
const flowBuilderPlugin = getFlowBuilderPlugin(botContext.plugins);
|
|
34
|
-
const aiAgentResponse = await flowBuilderPlugin.getAiAgentResponse?.(botContext, {
|
|
35
|
-
type: AiAgentType.Specialist,
|
|
36
|
-
name: this.name,
|
|
37
|
-
instructions: this.instructions,
|
|
38
|
-
model: this.model,
|
|
39
|
-
verbosity: this.verbosity,
|
|
40
|
-
activeTools: this.activeTools ?? [],
|
|
41
|
-
inputGuardrailRules: activeInputGuardrailRules,
|
|
42
|
-
sourceIds: this.sources?.map((source)=>source.id) ?? [],
|
|
43
|
-
outputMessagesSchemas: [
|
|
44
|
-
FlowBuilderContentSchema
|
|
45
|
-
],
|
|
46
|
-
previousHubtypeMessages: this.getPreviousHubtypeContents(previousContents)
|
|
47
|
-
});
|
|
48
|
-
return aiAgentResponse;
|
|
49
|
-
}
|
|
50
|
-
async trackAiAgentResponse(botContext) {
|
|
51
|
-
const { flowThreadId, flowId, flowName, flowNodeId } = getCommonFlowContentEventArgsForContentId(botContext, this.id);
|
|
52
|
-
const event = {
|
|
53
|
-
action: EventAction.AiAgent,
|
|
54
|
-
flowThreadId: flowThreadId,
|
|
55
|
-
flowId: flowId,
|
|
56
|
-
flowName: flowName,
|
|
57
|
-
flowNodeId: flowNodeId,
|
|
58
|
-
flowNodeContentId: this.name,
|
|
59
|
-
flowNodeIsMeaningful: true,
|
|
60
|
-
toolsExecuted: this.aiAgentResponse?.toolsExecuted ?? [],
|
|
61
|
-
memoryLength: this.aiAgentResponse?.memoryLength ?? 0,
|
|
62
|
-
inputMessageId: botContext.input.message_id,
|
|
63
|
-
exit: this.aiAgentResponse?.exit ?? true,
|
|
64
|
-
inputGuardrailsTriggered: this.aiAgentResponse?.inputGuardrailsTriggered ?? [],
|
|
65
|
-
outputGuardrailsTriggered: [],
|
|
66
|
-
error: this.aiAgentResponse?.error ?? false,
|
|
67
|
-
doNothing: this.aiAgentResponse?.doNothing ?? false
|
|
68
|
-
};
|
|
69
|
-
const { action, ...eventArgs } = event;
|
|
70
|
-
await trackEvent(botContext, action, eventArgs);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export { FlowAiAgent };
|
|
75
|
-
|
|
76
|
-
//# sourceMappingURL=flow-ai-agent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/flow-ai-agent.js","sources":["../../src/content-fields/flow-ai-agent.tsx"],"sourcesContent":["import {\n AiAgentType,\n type BotContext,\n EventAction,\n type EventAiAgent,\n type InferenceResponse,\n} from '@botonic/core'\nimport {\n type FlowBuilderContentMessage,\n FlowBuilderContentSchema,\n} from '../structured-output/flow-builder-content'\nimport {\n getCommonFlowContentEventArgsForContentId,\n trackEvent,\n} from '../tracking'\nimport { getFlowBuilderPlugin } from '../utils/get-flow-builder-plugin'\nimport { FlowAiAgentBase } from './flow-ai-agent-base'\nimport type { HtAiAgentNode } from './hubtype-fields/ai-agent'\nimport type { FlowContent } from './index'\n\nexport class FlowAiAgent extends FlowAiAgentBase {\n public activeTools?: { name: string }[]\n public sources?: { id: string; name: string }[]\n\n static fromHubtypeCMS(\n component: HtAiAgentNode,\n botContext: BotContext\n ): FlowAiAgent {\n const newAiAgent = new FlowAiAgent(component.id)\n newAiAgent.code = component.code\n newAiAgent.name = component.content.name\n newAiAgent.instructions = newAiAgent.replaceVariables(\n component.content.instructions,\n botContext\n )\n newAiAgent.model = component.content.model\n newAiAgent.verbosity = component.content.verbosity\n newAiAgent.activeTools = component.content.active_tools\n newAiAgent.inputGuardrailRules =\n component.content.input_guardrail_rules || []\n newAiAgent.sources = component.content.sources\n newAiAgent.followUp = component.follow_up\n\n return newAiAgent\n }\n\n async getAIAgentResponse(\n botContext: BotContext,\n previousContents?: FlowContent[]\n ): Promise<InferenceResponse<FlowBuilderContentMessage> | undefined> {\n const activeInputGuardrailRules = this.getActiveInputGuardrailRules(\n this.inputGuardrailRules\n )\n\n const flowBuilderPlugin = getFlowBuilderPlugin(botContext.plugins)\n\n const aiAgentResponse = await flowBuilderPlugin.getAiAgentResponse?.(\n botContext,\n {\n type: AiAgentType.Specialist,\n name: this.name,\n instructions: this.instructions,\n model: this.model,\n verbosity: this.verbosity,\n activeTools: this.activeTools ?? [],\n inputGuardrailRules: activeInputGuardrailRules,\n sourceIds: this.sources?.map(source => source.id) ?? [],\n outputMessagesSchemas: [FlowBuilderContentSchema],\n previousHubtypeMessages:\n this.getPreviousHubtypeContents(previousContents),\n }\n )\n\n return aiAgentResponse\n }\n\n async trackAiAgentResponse(botContext: BotContext) {\n const { flowThreadId, flowId, flowName, flowNodeId } =\n getCommonFlowContentEventArgsForContentId(botContext, this.id)\n\n const event: EventAiAgent = {\n action: EventAction.AiAgent,\n flowThreadId: flowThreadId,\n flowId: flowId,\n flowName: flowName,\n flowNodeId: flowNodeId,\n flowNodeContentId: this.name,\n flowNodeIsMeaningful: true,\n toolsExecuted: this.aiAgentResponse?.toolsExecuted ?? [],\n memoryLength: this.aiAgentResponse?.memoryLength ?? 0,\n inputMessageId: botContext.input.message_id!,\n exit: this.aiAgentResponse?.exit ?? true,\n inputGuardrailsTriggered:\n this.aiAgentResponse?.inputGuardrailsTriggered ?? [],\n outputGuardrailsTriggered: [], //aiAgentResponse.outputGuardrailsTriggered,\n error: this.aiAgentResponse?.error ?? false,\n doNothing: this.aiAgentResponse?.doNothing ?? false,\n }\n const { action, ...eventArgs } = event\n\n await trackEvent(botContext, action, eventArgs)\n }\n}\n"],"names":["AiAgentType","EventAction","FlowBuilderContentSchema","getCommonFlowContentEventArgsForContentId","trackEvent","getFlowBuilderPlugin","FlowAiAgentBase","FlowAiAgent","component","botContext","newAiAgent","previousContents","activeInputGuardrailRules","flowBuilderPlugin","aiAgentResponse","source","flowThreadId","flowId","flowName","flowNodeId","event","action","eventArgs"],"mappings":";;;;;;;;;;;AAMsB;AAI4B;AAI9B;AACmD;AACjB;AAI/C,MAAMO,WAAWA,SAASD,eAAeA;IAI9C,OAAO,eACLE,SAAwB,EACxBC,UAAsB,EACT;QACb,MAAMC,aAAa,IAAIH,WAAWA,CAACC,UAAU,EAAE;QAC/CE,WAAW,IAAI,GAAGF,UAAU,IAAI;QAChCE,WAAW,IAAI,GAAGF,UAAU,OAAO,CAAC,IAAI;QACxCE,WAAW,YAAY,GAAGA,WAAW,gBAAgB,CACnDF,UAAU,OAAO,CAAC,YAAY,EAC9BC;QAEFC,WAAW,KAAK,GAAGF,UAAU,OAAO,CAAC,KAAK;QAC1CE,WAAW,SAAS,GAAGF,UAAU,OAAO,CAAC,SAAS;QAClDE,WAAW,WAAW,GAAGF,UAAU,OAAO,CAAC,YAAY;QACvDE,WAAW,mBAAmB,GAC5BF,UAAU,OAAO,CAAC,qBAAqB,IAAI,EAAE;QAC/CE,WAAW,OAAO,GAAGF,UAAU,OAAO,CAAC,OAAO;QAC9CE,WAAW,QAAQ,GAAGF,UAAU,SAAS;QAEzC,OAAOE;IACT;IAEA,MAAM,mBACJD,UAAsB,EACtBE,gBAAgC,EACmC;QACnE,MAAMC,4BAA4B,IAAI,CAAC,4BAA4B,CACjE,IAAI,CAAC,mBAAmB;QAG1B,MAAMC,oBAAoBR,oBAAoBA,CAACI,WAAW,OAAO;QAEjE,MAAMK,kBAAkB,MAAMD,kBAAkB,kBAAkB,GAChEJ,YACA;YACE,MAAMT,sBAAsB;YAC5B,MAAM,IAAI,CAAC,IAAI;YACf,cAAc,IAAI,CAAC,YAAY;YAC/B,OAAO,IAAI,CAAC,KAAK;YACjB,WAAW,IAAI,CAAC,SAAS;YACzB,aAAa,IAAI,CAAC,WAAW,IAAI,EAAE;YACnC,qBAAqBY;YACrB,WAAW,IAAI,CAAC,OAAO,EAAE,IAAIG,CAAAA,SAAUA,OAAO,EAAE,KAAK,EAAE;YACvD,uBAAuB;gBAACb,wBAAwBA;aAAC;YACjD,yBACE,IAAI,CAAC,0BAA0B,CAACS;QACpC;QAGF,OAAOG;IACT;IAEA,MAAM,qBAAqBL,UAAsB,EAAE;QACjD,MAAM,EAAEO,YAAY,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,UAAU,EAAE,GAClDhB,yCAAyCA,CAACM,YAAY,IAAI,CAAC,EAAE;QAE/D,MAAMW,QAAsB;YAC1B,QAAQnB,mBAAmB;YAC3B,cAAce;YACd,QAAQC;YACR,UAAUC;YACV,YAAYC;YACZ,mBAAmB,IAAI,CAAC,IAAI;YAC5B,sBAAsB;YACtB,eAAe,IAAI,CAAC,eAAe,EAAE,iBAAiB,EAAE;YACxD,cAAc,IAAI,CAAC,eAAe,EAAE,gBAAgB;YACpD,gBAAgBV,WAAW,KAAK,CAAC,UAAU;YAC3C,MAAM,IAAI,CAAC,eAAe,EAAE,QAAQ;YACpC,0BACE,IAAI,CAAC,eAAe,EAAE,4BAA4B,EAAE;YACtD,2BAA2B,EAAE;YAC7B,OAAO,IAAI,CAAC,eAAe,EAAE,SAAS;YACtC,WAAW,IAAI,CAAC,eAAe,EAAE,aAAa;QAChD;QACA,MAAM,EAAEY,MAAM,EAAE,GAAGC,WAAW,GAAGF;QAEjC,MAAMhB,UAAUA,CAACK,YAAYY,QAAQC;IACvC;AACF"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type BotContext } 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 type { HtBotActionNode } from './hubtype-fields/index.js';
|
|
6
|
-
export declare class FlowBotAction extends ContentFieldsBase {
|
|
7
|
-
code: string;
|
|
8
|
-
payload: string;
|
|
9
|
-
static fromHubtypeCMS(cmsBotAction: HtBotActionNode, cmsApi: FlowBuilderApi): FlowBotAction;
|
|
10
|
-
trackFlow(botContext: BotContext): Promise<void>;
|
|
11
|
-
doBotAction(botContext: ActionRequest): void;
|
|
12
|
-
processContent(botContext: BotContext): Promise<void>;
|
|
13
|
-
toBotonic(): JSX.Element;
|
|
14
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { BotonicAction, 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 FlowBotAction extends ContentFieldsBase {
|
|
15
|
-
static fromHubtypeCMS(cmsBotAction, cmsApi) {
|
|
16
|
-
const newBotAction = new FlowBotAction(cmsBotAction.id);
|
|
17
|
-
newBotAction.code = cmsBotAction.code;
|
|
18
|
-
newBotAction.payload = cmsApi.createPayloadWithParams(cmsBotAction);
|
|
19
|
-
newBotAction.followUp = cmsBotAction.follow_up;
|
|
20
|
-
return newBotAction;
|
|
21
|
-
}
|
|
22
|
-
async trackFlow(botContext) {
|
|
23
|
-
const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } = getCommonFlowContentEventArgsForContentId(botContext, this.id);
|
|
24
|
-
const eventBotAction = {
|
|
25
|
-
action: EventAction.BotAction,
|
|
26
|
-
flowThreadId,
|
|
27
|
-
flowId,
|
|
28
|
-
flowName,
|
|
29
|
-
flowNodeId,
|
|
30
|
-
flowNodeContentId,
|
|
31
|
-
flowNodeIsMeaningful: false,
|
|
32
|
-
payload: this.payload
|
|
33
|
-
};
|
|
34
|
-
const { action, ...eventArgs } = eventBotAction;
|
|
35
|
-
await trackEvent(botContext, action, eventArgs);
|
|
36
|
-
}
|
|
37
|
-
doBotAction(botContext) {
|
|
38
|
-
botContext.session._botonic_action = `${BotonicAction.Redirect}:${this.payload}`;
|
|
39
|
-
}
|
|
40
|
-
async processContent(botContext) {
|
|
41
|
-
await this.filterContent(botContext, this);
|
|
42
|
-
this.doBotAction(botContext);
|
|
43
|
-
await this.trackFlow(botContext);
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
toBotonic() {
|
|
47
|
-
return /*#__PURE__*/ jsx(Fragment, {});
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export { FlowBotAction };
|
|
52
|
-
|
|
53
|
-
//# sourceMappingURL=flow-bot-action.js.map
|
|
@@ -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":";;;;;;;;;;;;;;AAC4D;AAGR;AACK;AACb;AAMnB;AAGlB,MAAMO,UAAUA,SAASJ,iBAAiBA;IAS/C,OAAO,eACLK,SAAmB,EACnBC,MAAc,EACdC,MAAsB,EACtBC,UAAsB,EACV;QACZ,MAAMC,QAAQL,UAAUA,CAAC,QAAQ,CAACC,WAAWC;QAE7C,MAAMI,YAAY,IAAIN,UAAUA,CAACC,UAAU,EAAE;QAC7CK,UAAU,IAAI,GAAGN,UAAUA,CAAC,eAAe,CAACE,QAAQD,UAAU,IAAI;QAClE,IAAIA,UAAU,MAAM,EAAE;YACpB,MAAMM,UAAUP,UAAUA,CAAC,gBAAgB,CAACG,QAAQF,UAAU,MAAM,CAAC,EAAE;YACvE,IAAIM,SAAS;gBACXD,UAAU,WAAW,GAAGC;gBACxBD,UAAU,OAAO,GAAG;oBAAE,MAAMC,QAAQ,oBAAoB;gBAAC;gBACzDD,UAAU,MAAM,GAAGC,QAAQ,SAAS,CAACH;YACvC,OAAO;gBACLE,UAAU,OAAO,GAAGH,OAAO,UAAU,CAACF,UAAU,MAAM;YACxD;QACF;QAEA,IAAIA,UAAU,GAAG,IAAII,OAAO;YAC1B,MAAMG,UAAUL,OAAO,WAAW,CAAYE;YAC9CC,UAAU,GAAG,GAAGE,QAAQ,OAAO,CAAC,GAAG;QACrC;QAEA,OAAOF;IACT;IAEA,OAAO,YAAYG,MAMlB,EAAc;QACb,MAAMH,YAAY,IAAIN,UAAUA,CAACS,OAAO,EAAE;QAC1CH,UAAU,IAAI,GAAGG,OAAO,IAAI;QAC5B,IAAIA,OAAO,GAAG,EAAE;YACdH,UAAU,GAAG,GAAGG,OAAO,GAAG;YAC1BH,UAAU,MAAM,GAAGG,OAAO,MAAM;QAClC,OAAO;YACLH,UAAU,OAAO,GAAGG,OAAO,OAAO;QACpC;QACA,OAAOH;IACT;IAEA,OAAO,WAAWG,MAAsB,EAAc;QACpD,MAAMH,YAAY,IAAIN,UAAUA,CAACS,OAAO,EAAE;QAC1CH,UAAU,IAAI,GAAGG,OAAO,IAAI;QAC5BH,UAAU,OAAO,GAAGG,OAAO,OAAO;QAClCH,UAAU,MAAM,GAAGG,OAAO,MAAM,EAAE;QAClC,OAAOH;IACT;IAEA,OAAO,SAASL,SAAmB,EAAEC,MAAc,EAAsB;QACvE,OAAOD,UAAU,GAAG,CAAC,IAAI,CAACS,CAAAA,MAAOA,IAAI,MAAM,KAAKR,SAAS;IAC3D;IAEA,OAAO,iBACLC,MAAsB,EACtBQ,QAAgB,EACS;QACzB,MAAMC,aAAaT,OAAO,WAAW,CAACQ;QACtC,IAAIC,WAAW,IAAI,KAAKb,6BAA6B,EAAE;YACrD,OAAOc;QACT;QACA,OAAOhB,0BAA0B,CAACe;IACpC;IAEA,MAAM,UAAUR,UAAsB,EAAiB;QACrD,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,MAAM,IAAI,CAAC,WAAW,CAAC,SAAS,CAACA;QACnC;IACF;IAEA,MAAM,iBAAgC;QACpC;IACF;IAEA,aAAaU,WAAmB,EAAEC,WAA2B,EAAe;QAC1E,IAAIA,gBAAgBjB,yBAAyB,EAAE;YAC7C,qBACE,IAACJ,KAAKA;gBAAe,SAAS,IAAI,CAAC,gBAAgB,CAACoB;0BACjD,IAAI,CAAC,IAAI;eADA,IAAI,CAAC,EAAE;QAIvB;QAEA,qBACE,IAACrB,MAAMA;YAEL,KAAK,IAAI,CAAC,GAAG;YACb,SAAS,IAAI,CAAC,gBAAgB,CAACqB;YAC/B,QAAQ,IAAI,CAAC,MAAM;YACnB,SAAS,IAAI,CAAC,OAAO;YACrB,QAAQ,IAAI,CAAC,MAAM;sBAElB,IAAI,CAAC,IAAI;WAPL,IAAI,CAAC,EAAE;IAUlB;IAEQ,iBAAiBA,WAAmB,EAAsB;QAChE,OAAO,IAAI,CAAC,OAAO,GACf,GAAG,IAAI,CAAC,OAAO,GAAGnB,qBAAqBA,GAAGmB,aAAa,GACvDD;IACN;;QApHK,qBACE,OAAO;;AAoHhB"}
|
|
@@ -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
|