@botonic/plugin-flow-builder 0.57.0-rslib-esm.2 → 0.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/cjs/action/ai-agent-from-user-input.d.ts +3 -0
- package/lib/cjs/action/ai-agent-from-user-input.js +38 -0
- package/lib/cjs/action/ai-agent-from-user-input.js.map +1 -0
- package/lib/cjs/action/context.d.ts +11 -0
- package/lib/cjs/action/context.js +17 -0
- package/lib/cjs/action/context.js.map +1 -0
- package/lib/cjs/action/fallback.d.ts +3 -0
- package/lib/cjs/action/fallback.js +36 -0
- package/lib/cjs/action/fallback.js.map +1 -0
- package/lib/cjs/action/first-interaction.d.ts +3 -0
- package/lib/cjs/action/first-interaction.js +93 -0
- package/lib/cjs/action/first-interaction.js.map +1 -0
- package/lib/cjs/action/get-contents.d.ts +3 -0
- package/lib/cjs/action/get-contents.js +44 -0
- package/lib/cjs/action/get-contents.js.map +1 -0
- package/lib/cjs/action/index.d.ts +25 -0
- package/lib/cjs/action/index.js +95 -0
- package/lib/cjs/action/index.js.map +1 -0
- package/lib/cjs/action/payload.d.ts +3 -0
- package/lib/cjs/action/payload.js +74 -0
- package/lib/cjs/action/payload.js.map +1 -0
- package/lib/cjs/api.d.ts +45 -0
- package/lib/cjs/api.js +227 -0
- package/lib/cjs/api.js.map +1 -0
- package/lib/cjs/bot-context-manager.d.ts +17 -0
- package/lib/cjs/bot-context-manager.js +93 -0
- package/lib/cjs/bot-context-manager.js.map +1 -0
- package/lib/cjs/constants.d.ts +14 -0
- package/lib/cjs/constants.js +20 -0
- package/lib/cjs/constants.js.map +1 -0
- package/lib/cjs/content-fields/contact-reasons-conditional-matcher.d.ts +4 -0
- package/lib/cjs/content-fields/contact-reasons-conditional-matcher.js +12 -0
- package/lib/cjs/content-fields/contact-reasons-conditional-matcher.js.map +1 -0
- package/lib/cjs/content-fields/content-fields-base.d.ts +20 -0
- package/lib/cjs/content-fields/content-fields-base.js +74 -0
- package/lib/cjs/content-fields/content-fields-base.js.map +1 -0
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.d.ts +15 -0
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +71 -0
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +1 -0
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.d.ts +9 -0
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.js +58 -0
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +1 -0
- package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.d.ts +17 -0
- package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.js +79 -0
- package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.js.map +1 -0
- package/lib/cjs/content-fields/flow-ai-agent-base.d.ts +25 -0
- package/lib/cjs/content-fields/flow-ai-agent-base.js +97 -0
- package/lib/cjs/content-fields/flow-ai-agent-base.js.map +1 -0
- package/lib/cjs/content-fields/flow-ai-agent-router.d.ts +21 -0
- package/lib/cjs/content-fields/flow-ai-agent-router.js +126 -0
- package/lib/cjs/content-fields/flow-ai-agent-router.js.map +1 -0
- package/lib/cjs/content-fields/flow-ai-agent.d.ts +17 -0
- package/lib/cjs/content-fields/flow-ai-agent.js +65 -0
- package/lib/cjs/content-fields/flow-ai-agent.js.map +1 -0
- package/lib/cjs/content-fields/flow-bot-action.d.ts +14 -0
- package/lib/cjs/content-fields/flow-bot-action.js +45 -0
- package/lib/cjs/content-fields/flow-bot-action.js.map +1 -0
- package/lib/cjs/content-fields/flow-button.d.ts +31 -0
- package/lib/cjs/content-fields/flow-button.js +86 -0
- package/lib/cjs/content-fields/flow-button.js.map +1 -0
- package/lib/cjs/content-fields/flow-capture-user-input.d.ts +14 -0
- package/lib/cjs/content-fields/flow-capture-user-input.js +45 -0
- package/lib/cjs/content-fields/flow-capture-user-input.js.map +1 -0
- package/lib/cjs/content-fields/flow-carousel.d.ts +22 -0
- package/lib/cjs/content-fields/flow-carousel.js +152 -0
- package/lib/cjs/content-fields/flow-carousel.js.map +1 -0
- package/lib/cjs/content-fields/flow-channel-conditional.d.ts +14 -0
- package/lib/cjs/content-fields/flow-channel-conditional.js +57 -0
- package/lib/cjs/content-fields/flow-channel-conditional.js.map +1 -0
- package/lib/cjs/content-fields/flow-contact-reasons-conditional.d.ts +14 -0
- package/lib/cjs/content-fields/flow-contact-reasons-conditional.js +65 -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 +16 -0
- package/lib/cjs/content-fields/hubtype-fields/contact-reasons-conditional.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/contact-reasons-conditional.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/country-conditional.d.ts +10 -0
- package/lib/cjs/content-fields/hubtype-fields/country-conditional.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/country-conditional.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.d.ts +56 -0
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.js +36 -0
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional.d.ts +11 -0
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/do-nothing.d.ts +6 -0
- package/lib/cjs/content-fields/hubtype-fields/do-nothing.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/do-nothing.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/fallback.d.ts +9 -0
- package/lib/cjs/content-fields/hubtype-fields/fallback.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/fallback.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/function.d.ts +30 -0
- package/lib/cjs/content-fields/hubtype-fields/function.js +11 -0
- package/lib/cjs/content-fields/hubtype-fields/function.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/go-to-flow.d.ts +9 -0
- package/lib/cjs/content-fields/hubtype-fields/go-to-flow.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/go-to-flow.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/handoff.d.ts +21 -0
- package/lib/cjs/content-fields/hubtype-fields/handoff.js +10 -0
- package/lib/cjs/content-fields/hubtype-fields/handoff.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/image.d.ts +8 -0
- package/lib/cjs/content-fields/hubtype-fields/image.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/image.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/index.d.ts +28 -0
- package/lib/cjs/content-fields/hubtype-fields/index.js +32 -0
- package/lib/cjs/content-fields/hubtype-fields/index.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/keyword.d.ts +9 -0
- package/lib/cjs/content-fields/hubtype-fields/keyword.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/keyword.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/node-types.d.ts +33 -0
- package/lib/cjs/content-fields/hubtype-fields/node-types.js +40 -0
- package/lib/cjs/content-fields/hubtype-fields/node-types.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/nodes.d.ts +28 -0
- package/lib/cjs/content-fields/hubtype-fields/nodes.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/nodes.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/payload.d.ts +8 -0
- package/lib/cjs/content-fields/hubtype-fields/payload.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/payload.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.d.ts +25 -0
- package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/rating.d.ts +23 -0
- package/lib/cjs/content-fields/hubtype-fields/rating.js +9 -0
- package/lib/cjs/content-fields/hubtype-fields/rating.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/smart-intent.d.ts +12 -0
- package/lib/cjs/content-fields/hubtype-fields/smart-intent.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/smart-intent.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/text.d.ts +11 -0
- package/lib/cjs/content-fields/hubtype-fields/text.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/text.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/url.d.ts +8 -0
- package/lib/cjs/content-fields/hubtype-fields/url.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/url.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/video.d.ts +8 -0
- package/lib/cjs/content-fields/hubtype-fields/video.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/video.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/webview.d.ts +17 -0
- package/lib/cjs/content-fields/hubtype-fields/webview.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/webview.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.d.ts +21 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.d.ts +17 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-request-contact-info.d.ts +10 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-request-contact-info.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.d.ts +96 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.js +9 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.js.map +1 -0
- package/lib/cjs/content-fields/index.d.ts +27 -0
- package/lib/cjs/content-fields/index.js +56 -0
- package/lib/cjs/content-fields/index.js.map +1 -0
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +14 -0
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +41 -0
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +1 -0
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +13 -0
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +36 -0
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +1 -0
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +14 -0
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +46 -0
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +1 -0
- package/lib/cjs/content-fields/whatsapp-button-list/index.d.ts +3 -0
- package/lib/cjs/content-fields/whatsapp-button-list/index.js +10 -0
- package/lib/cjs/content-fields/whatsapp-button-list/index.js.map +1 -0
- package/lib/cjs/filters/index.d.ts +12 -0
- package/lib/cjs/filters/index.js +17 -0
- package/lib/cjs/filters/index.js.map +1 -0
- package/lib/cjs/flow-factory.d.ts +12 -0
- package/lib/cjs/flow-factory.js +73 -0
- package/lib/cjs/flow-factory.js.map +1 -0
- package/lib/cjs/functions/index.d.ts +11 -0
- package/lib/cjs/functions/index.js +49 -0
- package/lib/cjs/functions/index.js.map +1 -0
- package/lib/cjs/index.d.ts +42 -0
- package/lib/cjs/index.js +142 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/services/hubtype-queues-api.js +26 -0
- package/lib/cjs/services/hubtype-queues-api.js.map +1 -0
- package/lib/cjs/structured-output/flow-builder-content.js +15 -0
- package/lib/cjs/structured-output/flow-builder-content.js.map +1 -0
- package/lib/cjs/tracking.d.ts +16 -0
- package/lib/cjs/tracking.js +71 -0
- package/lib/cjs/tracking.js.map +1 -0
- package/lib/cjs/types.d.ts +62 -0
- package/lib/cjs/types.js +14 -0
- package/lib/cjs/types.js.map +1 -0
- package/lib/cjs/user-input/capture-user-input-api.d.ts +21 -0
- package/lib/cjs/user-input/capture-user-input-api.js +88 -0
- package/lib/cjs/user-input/capture-user-input-api.js.map +1 -0
- package/lib/cjs/user-input/index.d.ts +4 -0
- package/lib/cjs/user-input/index.js +37 -0
- package/lib/cjs/user-input/index.js.map +1 -0
- package/lib/cjs/user-input/keyword.d.ts +27 -0
- package/lib/cjs/user-input/keyword.js +84 -0
- package/lib/cjs/user-input/keyword.js.map +1 -0
- package/lib/cjs/user-input/smart-intent.d.ts +24 -0
- package/lib/cjs/user-input/smart-intent.js +89 -0
- package/lib/cjs/user-input/smart-intent.js.map +1 -0
- package/lib/cjs/utils/ai-agent.d.ts +11 -0
- package/lib/cjs/utils/ai-agent.js +28 -0
- package/lib/cjs/utils/ai-agent.js.map +1 -0
- package/lib/cjs/utils/authentication.js +21 -0
- package/lib/cjs/utils/authentication.js.map +1 -0
- package/lib/cjs/utils/flow-locale.js +79 -0
- package/lib/cjs/utils/flow-locale.js.map +1 -0
- package/lib/cjs/utils/get-flow-builder-plugin.d.ts +3 -0
- package/lib/cjs/utils/get-flow-builder-plugin.js +16 -0
- package/lib/cjs/utils/get-flow-builder-plugin.js.map +1 -0
- package/lib/cjs/utils/hubtype-assistant-content.d.ts +13 -0
- package/lib/cjs/utils/hubtype-assistant-content.js +184 -0
- package/lib/cjs/utils/hubtype-assistant-content.js.map +1 -0
- package/lib/cjs/utils/input.js +35 -0
- package/lib/cjs/utils/input.js.map +1 -0
- package/lib/cjs/webview/contents-context.d.ts +2 -0
- package/lib/cjs/webview/contents-context.js +12 -0
- package/lib/cjs/webview/contents-context.js.map +1 -0
- package/lib/cjs/webview/index.d.ts +3 -0
- package/lib/cjs/webview/index.js +10 -0
- package/lib/cjs/webview/index.js.map +1 -0
- package/lib/cjs/webview/types.d.ts +47 -0
- package/lib/cjs/webview/types.js +9 -0
- package/lib/cjs/webview/types.js.map +1 -0
- package/lib/cjs/webview/use-webview-contents.d.ts +2 -0
- package/lib/cjs/webview/use-webview-contents.js +83 -0
- package/lib/cjs/webview/use-webview-contents.js.map +1 -0
- package/lib/esm/action/ai-agent-from-user-input.d.ts +3 -0
- package/lib/esm/action/ai-agent-from-user-input.js +38 -0
- package/lib/esm/action/ai-agent-from-user-input.js.map +1 -0
- package/lib/esm/action/context.d.ts +11 -0
- package/lib/esm/action/context.js +17 -0
- package/lib/esm/action/context.js.map +1 -0
- package/lib/esm/action/fallback.d.ts +3 -0
- package/lib/esm/action/fallback.js +36 -0
- package/lib/esm/action/fallback.js.map +1 -0
- package/lib/esm/action/first-interaction.d.ts +3 -0
- package/lib/esm/action/first-interaction.js +93 -0
- package/lib/esm/action/first-interaction.js.map +1 -0
- package/lib/esm/action/get-contents.d.ts +3 -0
- package/lib/esm/action/get-contents.js +44 -0
- package/lib/esm/action/get-contents.js.map +1 -0
- package/lib/esm/action/index.d.ts +25 -0
- package/lib/esm/action/index.js +95 -0
- package/lib/esm/action/index.js.map +1 -0
- package/lib/esm/action/payload.d.ts +3 -0
- package/lib/esm/action/payload.js +74 -0
- package/lib/esm/action/payload.js.map +1 -0
- package/lib/esm/api.d.ts +45 -0
- package/lib/esm/api.js +227 -0
- package/lib/esm/api.js.map +1 -0
- package/lib/esm/bot-context-manager.d.ts +17 -0
- package/lib/esm/bot-context-manager.js +93 -0
- package/lib/esm/bot-context-manager.js.map +1 -0
- package/lib/esm/constants.d.ts +14 -0
- package/lib/esm/constants.js +20 -0
- package/lib/esm/constants.js.map +1 -0
- package/lib/esm/content-fields/contact-reasons-conditional-matcher.d.ts +4 -0
- package/lib/esm/content-fields/contact-reasons-conditional-matcher.js +12 -0
- package/lib/esm/content-fields/contact-reasons-conditional-matcher.js.map +1 -0
- package/lib/esm/content-fields/content-fields-base.d.ts +20 -0
- package/lib/esm/content-fields/content-fields-base.js +74 -0
- package/lib/esm/content-fields/content-fields-base.js.map +1 -0
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.d.ts +15 -0
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +71 -0
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +1 -0
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.d.ts +9 -0
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.js +58 -0
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +1 -0
- package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.d.ts +17 -0
- package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.js +79 -0
- package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.js.map +1 -0
- package/lib/esm/content-fields/flow-ai-agent-base.d.ts +25 -0
- package/lib/esm/content-fields/flow-ai-agent-base.js +97 -0
- package/lib/esm/content-fields/flow-ai-agent-base.js.map +1 -0
- package/lib/esm/content-fields/flow-ai-agent-router.d.ts +21 -0
- package/lib/esm/content-fields/flow-ai-agent-router.js +126 -0
- package/lib/esm/content-fields/flow-ai-agent-router.js.map +1 -0
- package/lib/esm/content-fields/flow-ai-agent.d.ts +17 -0
- package/lib/esm/content-fields/flow-ai-agent.js +65 -0
- package/lib/esm/content-fields/flow-ai-agent.js.map +1 -0
- package/lib/esm/content-fields/flow-bot-action.d.ts +14 -0
- package/lib/esm/content-fields/flow-bot-action.js +45 -0
- package/lib/esm/content-fields/flow-bot-action.js.map +1 -0
- package/lib/esm/content-fields/flow-button.d.ts +31 -0
- package/lib/esm/content-fields/flow-button.js +86 -0
- package/lib/esm/content-fields/flow-button.js.map +1 -0
- package/lib/esm/content-fields/flow-capture-user-input.d.ts +14 -0
- package/lib/esm/content-fields/flow-capture-user-input.js +45 -0
- package/lib/esm/content-fields/flow-capture-user-input.js.map +1 -0
- package/lib/esm/content-fields/flow-carousel.d.ts +22 -0
- package/lib/esm/content-fields/flow-carousel.js +152 -0
- package/lib/esm/content-fields/flow-carousel.js.map +1 -0
- package/lib/esm/content-fields/flow-channel-conditional.d.ts +14 -0
- package/lib/esm/content-fields/flow-channel-conditional.js +57 -0
- package/lib/esm/content-fields/flow-channel-conditional.js.map +1 -0
- package/lib/esm/content-fields/flow-contact-reasons-conditional.d.ts +14 -0
- package/lib/esm/content-fields/flow-contact-reasons-conditional.js +65 -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 +16 -0
- package/lib/esm/content-fields/hubtype-fields/contact-reasons-conditional.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/contact-reasons-conditional.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/country-conditional.d.ts +10 -0
- package/lib/esm/content-fields/hubtype-fields/country-conditional.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/country-conditional.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/custom-conditional-v2.d.ts +56 -0
- package/lib/esm/content-fields/hubtype-fields/custom-conditional-v2.js +36 -0
- package/lib/esm/content-fields/hubtype-fields/custom-conditional-v2.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/custom-conditional.d.ts +11 -0
- package/lib/esm/content-fields/hubtype-fields/custom-conditional.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/custom-conditional.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/do-nothing.d.ts +6 -0
- package/lib/esm/content-fields/hubtype-fields/do-nothing.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/do-nothing.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/fallback.d.ts +9 -0
- package/lib/esm/content-fields/hubtype-fields/fallback.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/fallback.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/function.d.ts +30 -0
- package/lib/esm/content-fields/hubtype-fields/function.js +11 -0
- package/lib/esm/content-fields/hubtype-fields/function.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/go-to-flow.d.ts +9 -0
- package/lib/esm/content-fields/hubtype-fields/go-to-flow.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/go-to-flow.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/handoff.d.ts +21 -0
- package/lib/esm/content-fields/hubtype-fields/handoff.js +10 -0
- package/lib/esm/content-fields/hubtype-fields/handoff.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/image.d.ts +8 -0
- package/lib/esm/content-fields/hubtype-fields/image.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/image.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/index.d.ts +28 -0
- package/lib/esm/content-fields/hubtype-fields/index.js +32 -0
- package/lib/esm/content-fields/hubtype-fields/index.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/keyword.d.ts +9 -0
- package/lib/esm/content-fields/hubtype-fields/keyword.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/keyword.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/node-types.d.ts +33 -0
- package/lib/esm/content-fields/hubtype-fields/node-types.js +40 -0
- package/lib/esm/content-fields/hubtype-fields/node-types.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/nodes.d.ts +28 -0
- package/lib/esm/content-fields/hubtype-fields/nodes.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/nodes.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/payload.d.ts +8 -0
- package/lib/esm/content-fields/hubtype-fields/payload.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/payload.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.d.ts +25 -0
- package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/rating.d.ts +23 -0
- package/lib/esm/content-fields/hubtype-fields/rating.js +9 -0
- package/lib/esm/content-fields/hubtype-fields/rating.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/smart-intent.d.ts +12 -0
- package/lib/esm/content-fields/hubtype-fields/smart-intent.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/smart-intent.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/text.d.ts +11 -0
- package/lib/esm/content-fields/hubtype-fields/text.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/text.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/url.d.ts +8 -0
- package/lib/esm/content-fields/hubtype-fields/url.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/url.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/video.d.ts +8 -0
- package/lib/esm/content-fields/hubtype-fields/video.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/video.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/webview.d.ts +17 -0
- package/lib/esm/content-fields/hubtype-fields/webview.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/webview.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.d.ts +21 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.d.ts +17 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.d.ts +10 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-template.d.ts +96 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-template.js +9 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-template.js.map +1 -0
- package/lib/esm/content-fields/index.d.ts +27 -0
- package/lib/esm/content-fields/index.js +56 -0
- package/lib/esm/content-fields/index.js.map +1 -0
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +14 -0
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +41 -0
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +1 -0
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +13 -0
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +36 -0
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +1 -0
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +14 -0
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +46 -0
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +1 -0
- package/lib/esm/content-fields/whatsapp-button-list/index.d.ts +3 -0
- package/lib/esm/content-fields/whatsapp-button-list/index.js +10 -0
- package/lib/esm/content-fields/whatsapp-button-list/index.js.map +1 -0
- package/lib/esm/filters/index.d.ts +12 -0
- package/lib/esm/filters/index.js +17 -0
- package/lib/esm/filters/index.js.map +1 -0
- package/lib/esm/flow-factory.d.ts +12 -0
- package/lib/esm/flow-factory.js +73 -0
- package/lib/esm/flow-factory.js.map +1 -0
- package/lib/esm/functions/index.d.ts +11 -0
- package/lib/esm/functions/index.js +49 -0
- package/lib/esm/functions/index.js.map +1 -0
- package/lib/esm/index.d.ts +42 -0
- package/lib/esm/index.js +142 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/services/hubtype-queues-api.d.ts +14 -0
- package/lib/esm/services/hubtype-queues-api.js +26 -0
- package/lib/esm/services/hubtype-queues-api.js.map +1 -0
- package/lib/esm/structured-output/flow-builder-content.d.ts +13 -0
- package/lib/esm/structured-output/flow-builder-content.js +15 -0
- package/lib/esm/structured-output/flow-builder-content.js.map +1 -0
- package/lib/esm/tracking.d.ts +16 -0
- package/lib/esm/tracking.js +71 -0
- package/lib/esm/tracking.js.map +1 -0
- package/lib/esm/types.d.ts +62 -0
- package/lib/esm/types.js +14 -0
- package/lib/esm/types.js.map +1 -0
- package/lib/esm/user-input/capture-user-input-api.d.ts +21 -0
- package/lib/esm/user-input/capture-user-input-api.js +88 -0
- package/lib/esm/user-input/capture-user-input-api.js.map +1 -0
- package/lib/esm/user-input/index.d.ts +4 -0
- package/lib/esm/user-input/index.js +37 -0
- package/lib/esm/user-input/index.js.map +1 -0
- package/lib/esm/user-input/keyword.d.ts +27 -0
- package/lib/esm/user-input/keyword.js +84 -0
- package/lib/esm/user-input/keyword.js.map +1 -0
- package/lib/esm/user-input/smart-intent.d.ts +24 -0
- package/lib/esm/user-input/smart-intent.js +89 -0
- package/lib/esm/user-input/smart-intent.js.map +1 -0
- package/lib/esm/utils/ai-agent.d.ts +11 -0
- package/lib/esm/utils/ai-agent.js +28 -0
- package/lib/esm/utils/ai-agent.js.map +1 -0
- package/lib/esm/utils/authentication.d.ts +2 -0
- package/lib/esm/utils/authentication.js +21 -0
- package/lib/esm/utils/authentication.js.map +1 -0
- package/lib/esm/utils/flow-locale.d.ts +22 -0
- package/lib/esm/utils/flow-locale.js +79 -0
- package/lib/esm/utils/flow-locale.js.map +1 -0
- package/lib/esm/utils/get-flow-builder-plugin.d.ts +3 -0
- package/lib/esm/utils/get-flow-builder-plugin.js +16 -0
- package/lib/esm/utils/get-flow-builder-plugin.js.map +1 -0
- package/lib/esm/utils/hubtype-assistant-content.d.ts +13 -0
- package/lib/esm/utils/hubtype-assistant-content.js +184 -0
- package/lib/esm/utils/hubtype-assistant-content.js.map +1 -0
- package/lib/esm/utils/input.d.ts +6 -0
- package/lib/esm/utils/input.js +35 -0
- package/lib/esm/utils/input.js.map +1 -0
- package/lib/esm/webview/contents-context.d.ts +2 -0
- package/lib/esm/webview/contents-context.js +12 -0
- package/lib/esm/webview/contents-context.js.map +1 -0
- package/lib/esm/webview/index.d.ts +3 -0
- package/lib/esm/webview/index.js +10 -0
- package/lib/esm/webview/index.js.map +1 -0
- package/lib/esm/webview/types.d.ts +47 -0
- package/lib/esm/webview/types.js +9 -0
- package/lib/esm/webview/types.js.map +1 -0
- package/lib/esm/webview/use-webview-contents.d.ts +2 -0
- package/lib/esm/webview/use-webview-contents.js +83 -0
- package/lib/esm/webview/use-webview-contents.js.map +1 -0
- package/package.json +10 -12
- package/src/action/ai-agent-from-user-input.ts +7 -0
- package/src/action/first-interaction.ts +6 -0
- package/src/action/get-contents.ts +17 -2
- package/src/action/index.tsx +7 -0
- package/src/api.ts +52 -15
- package/src/bot-context-manager.ts +153 -0
- package/src/constants.ts +2 -1
- package/src/content-fields/contact-reasons-conditional-matcher.ts +24 -0
- package/src/content-fields/flow-ai-agent-base.tsx +1 -1
- package/src/content-fields/flow-ai-agent-router.tsx +1 -0
- package/src/content-fields/flow-ai-agent.tsx +1 -0
- package/src/content-fields/flow-contact-reasons-conditional.tsx +90 -0
- package/src/content-fields/flow-do-nothing.tsx +29 -0
- package/src/content-fields/flow-handoff.tsx +54 -7
- package/src/content-fields/flow-whatsapp-request-contact-info.tsx +2 -0
- package/src/content-fields/hubtype-fields/contact-reasons-conditional.ts +18 -0
- package/src/content-fields/hubtype-fields/do-nothing.ts +7 -0
- package/src/content-fields/hubtype-fields/handoff.ts +17 -1
- package/src/content-fields/hubtype-fields/index.ts +1 -0
- package/src/content-fields/hubtype-fields/node-types.ts +2 -0
- package/src/content-fields/hubtype-fields/nodes.ts +4 -0
- package/src/content-fields/hubtype-fields/whatsapp-request-contact-info.ts +2 -0
- package/src/content-fields/index.ts +6 -0
- package/src/flow-factory.ts +11 -0
- package/src/index.ts +26 -88
- package/src/types.ts +1 -2
- package/lib/action/ai-agent-from-user-input.d.ts +0 -3
- package/lib/action/ai-agent-from-user-input.js +0 -35
- package/lib/action/ai-agent-from-user-input.js.map +0 -1
- package/lib/action/context.d.ts +0 -11
- package/lib/action/context.js +0 -20
- package/lib/action/context.js.map +0 -1
- package/lib/action/fallback.d.ts +0 -3
- package/lib/action/fallback.js +0 -41
- package/lib/action/fallback.js.map +0 -1
- package/lib/action/first-interaction.d.ts +0 -3
- package/lib/action/first-interaction.js +0 -100
- package/lib/action/first-interaction.js.map +0 -1
- package/lib/action/get-contents.d.ts +0 -3
- package/lib/action/get-contents.js +0 -56
- package/lib/action/get-contents.js.map +0 -1
- package/lib/action/index.d.ts +0 -25
- package/lib/action/index.js +0 -126
- package/lib/action/index.js.map +0 -1
- package/lib/action/payload.d.ts +0 -3
- package/lib/action/payload.js +0 -78
- package/lib/action/payload.js.map +0 -1
- package/lib/api.d.ts +0 -40
- package/lib/api.js +0 -216
- package/lib/api.js.map +0 -1
- package/lib/constants.d.ts +0 -13
- package/lib/constants.js +0 -17
- package/lib/constants.js.map +0 -1
- package/lib/content-fields/content-fields-base.d.ts +0 -20
- package/lib/content-fields/content-fields-base.js +0 -78
- package/lib/content-fields/content-fields-base.js.map +0 -1
- package/lib/content-fields/custom-conditional/custom-conditional-v2-evaluators.d.ts +0 -15
- package/lib/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +0 -73
- package/lib/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +0 -1
- package/lib/content-fields/custom-conditional/custom-conditional-v2-resolver.d.ts +0 -9
- package/lib/content-fields/custom-conditional/custom-conditional-v2-resolver.js +0 -58
- package/lib/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +0 -1
- package/lib/content-fields/custom-conditional/flow-custom-condition-v2.d.ts +0 -17
- package/lib/content-fields/custom-conditional/flow-custom-condition-v2.js +0 -94
- package/lib/content-fields/custom-conditional/flow-custom-condition-v2.js.map +0 -1
- package/lib/content-fields/flow-ai-agent-base.d.ts +0 -25
- package/lib/content-fields/flow-ai-agent-base.js +0 -106
- package/lib/content-fields/flow-ai-agent-base.js.map +0 -1
- package/lib/content-fields/flow-ai-agent-router.d.ts +0 -21
- package/lib/content-fields/flow-ai-agent-router.js +0 -136
- package/lib/content-fields/flow-ai-agent-router.js.map +0 -1
- package/lib/content-fields/flow-ai-agent.d.ts +0 -17
- package/lib/content-fields/flow-ai-agent.js +0 -75
- package/lib/content-fields/flow-ai-agent.js.map +0 -1
- package/lib/content-fields/flow-bot-action.d.ts +0 -14
- package/lib/content-fields/flow-bot-action.js +0 -53
- package/lib/content-fields/flow-bot-action.js.map +0 -1
- package/lib/content-fields/flow-button.d.ts +0 -31
- package/lib/content-fields/flow-button.js +0 -105
- package/lib/content-fields/flow-button.js.map +0 -1
- package/lib/content-fields/flow-capture-user-input.d.ts +0 -14
- package/lib/content-fields/flow-capture-user-input.js +0 -46
- package/lib/content-fields/flow-capture-user-input.js.map +0 -1
- package/lib/content-fields/flow-carousel.d.ts +0 -22
- package/lib/content-fields/flow-carousel.js +0 -193
- package/lib/content-fields/flow-carousel.js.map +0 -1
- package/lib/content-fields/flow-channel-conditional.d.ts +0 -14
- package/lib/content-fields/flow-channel-conditional.js +0 -61
- package/lib/content-fields/flow-channel-conditional.js.map +0 -1
- package/lib/content-fields/flow-country-conditional.d.ts +0 -13
- package/lib/content-fields/flow-country-conditional.js +0 -64
- package/lib/content-fields/flow-country-conditional.js.map +0 -1
- package/lib/content-fields/flow-custom-conditional.d.ts +0 -17
- package/lib/content-fields/flow-custom-conditional.js +0 -87
- package/lib/content-fields/flow-custom-conditional.js.map +0 -1
- package/lib/content-fields/flow-element.d.ts +0 -22
- package/lib/content-fields/flow-element.js +0 -67
- package/lib/content-fields/flow-element.js.map +0 -1
- package/lib/content-fields/flow-go-to-flow.d.ts +0 -13
- package/lib/content-fields/flow-go-to-flow.js +0 -56
- package/lib/content-fields/flow-go-to-flow.js.map +0 -1
- package/lib/content-fields/flow-handoff.d.ts +0 -17
- package/lib/content-fields/flow-handoff.js +0 -79
- package/lib/content-fields/flow-handoff.js.map +0 -1
- package/lib/content-fields/flow-image.d.ts +0 -10
- package/lib/content-fields/flow-image.js +0 -42
- package/lib/content-fields/flow-image.js.map +0 -1
- package/lib/content-fields/flow-queue-status-conditional.d.ts +0 -30
- package/lib/content-fields/flow-queue-status-conditional.js +0 -100
- package/lib/content-fields/flow-queue-status-conditional.js.map +0 -1
- package/lib/content-fields/flow-rating.d.ts +0 -15
- package/lib/content-fields/flow-rating.js +0 -88
- package/lib/content-fields/flow-rating.js.map +0 -1
- package/lib/content-fields/flow-text.d.ts +0 -15
- package/lib/content-fields/flow-text.js +0 -82
- package/lib/content-fields/flow-text.js.map +0 -1
- package/lib/content-fields/flow-video.d.ts +0 -10
- package/lib/content-fields/flow-video.js +0 -42
- package/lib/content-fields/flow-video.js.map +0 -1
- package/lib/content-fields/flow-webview.d.ts +0 -16
- package/lib/content-fields/flow-webview.js +0 -81
- package/lib/content-fields/flow-webview.js.map +0 -1
- package/lib/content-fields/flow-whatsapp-cta-url-button.d.ts +0 -21
- package/lib/content-fields/flow-whatsapp-cta-url-button.js +0 -131
- package/lib/content-fields/flow-whatsapp-cta-url-button.js.map +0 -1
- package/lib/content-fields/flow-whatsapp-request-contact-info.d.ts +0 -11
- package/lib/content-fields/flow-whatsapp-request-contact-info.js +0 -61
- package/lib/content-fields/flow-whatsapp-request-contact-info.js.map +0 -1
- package/lib/content-fields/flow-whatsapp-template.d.ts +0 -37
- package/lib/content-fields/flow-whatsapp-template.js +0 -281
- package/lib/content-fields/flow-whatsapp-template.js.map +0 -1
- package/lib/content-fields/hubtype-fields/ai-agent-router.d.ts +0 -21
- package/lib/content-fields/hubtype-fields/ai-agent-router.js +0 -4
- package/lib/content-fields/hubtype-fields/ai-agent-router.js.map +0 -1
- package/lib/content-fields/hubtype-fields/ai-agent.d.ts +0 -25
- package/lib/content-fields/hubtype-fields/ai-agent.js +0 -4
- package/lib/content-fields/hubtype-fields/ai-agent.js.map +0 -1
- package/lib/content-fields/hubtype-fields/bot-action.d.ts +0 -10
- package/lib/content-fields/hubtype-fields/bot-action.js +0 -4
- package/lib/content-fields/hubtype-fields/bot-action.js.map +0 -1
- package/lib/content-fields/hubtype-fields/button.d.ts +0 -8
- package/lib/content-fields/hubtype-fields/button.js +0 -4
- package/lib/content-fields/hubtype-fields/button.js.map +0 -1
- package/lib/content-fields/hubtype-fields/capture-user-input.d.ts +0 -19
- package/lib/content-fields/hubtype-fields/capture-user-input.js +0 -12
- package/lib/content-fields/hubtype-fields/capture-user-input.js.map +0 -1
- package/lib/content-fields/hubtype-fields/carousel.d.ts +0 -17
- package/lib/content-fields/hubtype-fields/carousel.js +0 -4
- package/lib/content-fields/hubtype-fields/carousel.js.map +0 -1
- package/lib/content-fields/hubtype-fields/channel-conditional.d.ts +0 -10
- package/lib/content-fields/hubtype-fields/channel-conditional.js +0 -4
- package/lib/content-fields/hubtype-fields/channel-conditional.js.map +0 -1
- package/lib/content-fields/hubtype-fields/common.d.ts +0 -83
- package/lib/content-fields/hubtype-fields/common.js +0 -4
- package/lib/content-fields/hubtype-fields/common.js.map +0 -1
- package/lib/content-fields/hubtype-fields/country-conditional.d.ts +0 -10
- package/lib/content-fields/hubtype-fields/country-conditional.js +0 -4
- package/lib/content-fields/hubtype-fields/country-conditional.js.map +0 -1
- package/lib/content-fields/hubtype-fields/custom-conditional-v2.d.ts +0 -56
- package/lib/content-fields/hubtype-fields/custom-conditional-v2.js +0 -36
- package/lib/content-fields/hubtype-fields/custom-conditional-v2.js.map +0 -1
- package/lib/content-fields/hubtype-fields/custom-conditional.d.ts +0 -11
- package/lib/content-fields/hubtype-fields/custom-conditional.js +0 -4
- package/lib/content-fields/hubtype-fields/custom-conditional.js.map +0 -1
- package/lib/content-fields/hubtype-fields/fallback.d.ts +0 -9
- package/lib/content-fields/hubtype-fields/fallback.js +0 -4
- package/lib/content-fields/hubtype-fields/fallback.js.map +0 -1
- package/lib/content-fields/hubtype-fields/function.d.ts +0 -30
- package/lib/content-fields/hubtype-fields/function.js +0 -11
- package/lib/content-fields/hubtype-fields/function.js.map +0 -1
- package/lib/content-fields/hubtype-fields/go-to-flow.d.ts +0 -9
- package/lib/content-fields/hubtype-fields/go-to-flow.js +0 -4
- package/lib/content-fields/hubtype-fields/go-to-flow.js.map +0 -1
- package/lib/content-fields/hubtype-fields/handoff.d.ts +0 -11
- package/lib/content-fields/hubtype-fields/handoff.js +0 -4
- package/lib/content-fields/hubtype-fields/handoff.js.map +0 -1
- package/lib/content-fields/hubtype-fields/image.d.ts +0 -8
- package/lib/content-fields/hubtype-fields/image.js +0 -4
- package/lib/content-fields/hubtype-fields/image.js.map +0 -1
- package/lib/content-fields/hubtype-fields/index.d.ts +0 -27
- package/lib/content-fields/hubtype-fields/index.js +0 -57
- package/lib/content-fields/hubtype-fields/index.js.map +0 -1
- package/lib/content-fields/hubtype-fields/keyword.d.ts +0 -9
- package/lib/content-fields/hubtype-fields/keyword.js +0 -4
- package/lib/content-fields/hubtype-fields/keyword.js.map +0 -1
- package/lib/content-fields/hubtype-fields/node-types.d.ts +0 -31
- package/lib/content-fields/hubtype-fields/node-types.js +0 -38
- package/lib/content-fields/hubtype-fields/node-types.js.map +0 -1
- package/lib/content-fields/hubtype-fields/nodes.d.ts +0 -26
- package/lib/content-fields/hubtype-fields/nodes.js +0 -4
- package/lib/content-fields/hubtype-fields/nodes.js.map +0 -1
- package/lib/content-fields/hubtype-fields/payload.d.ts +0 -8
- package/lib/content-fields/hubtype-fields/payload.js +0 -4
- package/lib/content-fields/hubtype-fields/payload.js.map +0 -1
- package/lib/content-fields/hubtype-fields/queue-status-conditional.d.ts +0 -25
- package/lib/content-fields/hubtype-fields/queue-status-conditional.js +0 -4
- package/lib/content-fields/hubtype-fields/queue-status-conditional.js.map +0 -1
- package/lib/content-fields/hubtype-fields/rating.d.ts +0 -23
- package/lib/content-fields/hubtype-fields/rating.js +0 -9
- package/lib/content-fields/hubtype-fields/rating.js.map +0 -1
- package/lib/content-fields/hubtype-fields/smart-intent.d.ts +0 -12
- package/lib/content-fields/hubtype-fields/smart-intent.js +0 -4
- package/lib/content-fields/hubtype-fields/smart-intent.js.map +0 -1
- package/lib/content-fields/hubtype-fields/text.d.ts +0 -11
- package/lib/content-fields/hubtype-fields/text.js +0 -4
- package/lib/content-fields/hubtype-fields/text.js.map +0 -1
- package/lib/content-fields/hubtype-fields/url.d.ts +0 -8
- package/lib/content-fields/hubtype-fields/url.js +0 -4
- package/lib/content-fields/hubtype-fields/url.js.map +0 -1
- package/lib/content-fields/hubtype-fields/video.d.ts +0 -8
- package/lib/content-fields/hubtype-fields/video.js +0 -4
- package/lib/content-fields/hubtype-fields/video.js.map +0 -1
- package/lib/content-fields/hubtype-fields/webview.d.ts +0 -17
- package/lib/content-fields/hubtype-fields/webview.js +0 -4
- package/lib/content-fields/hubtype-fields/webview.js.map +0 -1
- package/lib/content-fields/hubtype-fields/whatsapp-button-list.d.ts +0 -21
- package/lib/content-fields/hubtype-fields/whatsapp-button-list.js +0 -4
- package/lib/content-fields/hubtype-fields/whatsapp-button-list.js.map +0 -1
- package/lib/content-fields/hubtype-fields/whatsapp-cta-url-button.d.ts +0 -17
- package/lib/content-fields/hubtype-fields/whatsapp-cta-url-button.js +0 -4
- package/lib/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +0 -1
- package/lib/content-fields/hubtype-fields/whatsapp-request-contact-info.d.ts +0 -8
- package/lib/content-fields/hubtype-fields/whatsapp-request-contact-info.js +0 -4
- package/lib/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +0 -1
- package/lib/content-fields/hubtype-fields/whatsapp-template.d.ts +0 -96
- package/lib/content-fields/hubtype-fields/whatsapp-template.js +0 -9
- package/lib/content-fields/hubtype-fields/whatsapp-template.js.map +0 -1
- package/lib/content-fields/index.d.ts +0 -25
- package/lib/content-fields/index.js +0 -73
- package/lib/content-fields/index.js.map +0 -1
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +0 -14
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +0 -43
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +0 -1
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +0 -13
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +0 -41
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +0 -1
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +0 -14
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +0 -66
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +0 -1
- package/lib/content-fields/whatsapp-button-list/index.d.ts +0 -3
- package/lib/content-fields/whatsapp-button-list/index.js +0 -12
- package/lib/content-fields/whatsapp-button-list/index.js.map +0 -1
- package/lib/filters/index.d.ts +0 -12
- package/lib/filters/index.js +0 -16
- package/lib/filters/index.js.map +0 -1
- package/lib/flow-factory.d.ts +0 -12
- package/lib/flow-factory.js +0 -75
- package/lib/flow-factory.js.map +0 -1
- package/lib/functions/index.d.ts +0 -11
- package/lib/functions/index.js +0 -55
- package/lib/functions/index.js.map +0 -1
- package/lib/index.d.ts +0 -45
- package/lib/index.js +0 -195
- package/lib/index.js.map +0 -1
- package/lib/services/hubtype-queues-api.js +0 -26
- package/lib/services/hubtype-queues-api.js.map +0 -1
- package/lib/structured-output/flow-builder-content.js +0 -16
- package/lib/structured-output/flow-builder-content.js.map +0 -1
- package/lib/tracking.d.ts +0 -16
- package/lib/tracking.js +0 -77
- package/lib/tracking.js.map +0 -1
- package/lib/types.d.ts +0 -62
- package/lib/types.js +0 -14
- package/lib/types.js.map +0 -1
- package/lib/user-input/capture-user-input-api.d.ts +0 -21
- package/lib/user-input/capture-user-input-api.js +0 -99
- package/lib/user-input/capture-user-input-api.js.map +0 -1
- package/lib/user-input/index.d.ts +0 -4
- package/lib/user-input/index.js +0 -46
- package/lib/user-input/index.js.map +0 -1
- package/lib/user-input/keyword.d.ts +0 -27
- package/lib/user-input/keyword.js +0 -89
- package/lib/user-input/keyword.js.map +0 -1
- package/lib/user-input/smart-intent.d.ts +0 -24
- package/lib/user-input/smart-intent.js +0 -93
- package/lib/user-input/smart-intent.js.map +0 -1
- package/lib/utils/ai-agent.d.ts +0 -11
- package/lib/utils/ai-agent.js +0 -33
- package/lib/utils/ai-agent.js.map +0 -1
- package/lib/utils/authentication.js +0 -24
- package/lib/utils/authentication.js.map +0 -1
- package/lib/utils/flow-locale.js +0 -75
- package/lib/utils/flow-locale.js.map +0 -1
- package/lib/utils/get-flow-builder-plugin.d.ts +0 -3
- package/lib/utils/get-flow-builder-plugin.js +0 -16
- package/lib/utils/get-flow-builder-plugin.js.map +0 -1
- package/lib/utils/hubtype-assistant-content.d.ts +0 -13
- package/lib/utils/hubtype-assistant-content.js +0 -200
- package/lib/utils/hubtype-assistant-content.js.map +0 -1
- package/lib/utils/input.js +0 -37
- package/lib/utils/input.js.map +0 -1
- package/lib/webview/contents-context.d.ts +0 -2
- package/lib/webview/contents-context.js +0 -14
- package/lib/webview/contents-context.js.map +0 -1
- package/lib/webview/index.d.ts +0 -3
- package/lib/webview/index.js +0 -11
- package/lib/webview/index.js.map +0 -1
- package/lib/webview/types.d.ts +0 -47
- package/lib/webview/types.js +0 -9
- package/lib/webview/types.js.map +0 -1
- package/lib/webview/use-webview-contents.d.ts +0 -2
- package/lib/webview/use-webview-contents.js +0 -90
- package/lib/webview/use-webview-contents.js.map +0 -1
- /package/lib/{services → cjs/services}/hubtype-queues-api.d.ts +0 -0
- /package/lib/{structured-output → cjs/structured-output}/flow-builder-content.d.ts +0 -0
- /package/lib/{utils → cjs/utils}/authentication.d.ts +0 -0
- /package/lib/{utils → cjs/utils}/flow-locale.d.ts +0 -0
- /package/lib/{utils → cjs/utils}/input.d.ts +0 -0
package/src/constants.ts
CHANGED
|
@@ -2,7 +2,6 @@ export const FLOW_BUILDER_API_URL_PROD =
|
|
|
2
2
|
process.env.HUBTYPE_API_URL || 'https://api.hubtype.com'
|
|
3
3
|
export const SEPARATOR = '|'
|
|
4
4
|
export const SOURCE_INFO_SEPARATOR = `${SEPARATOR}source_`
|
|
5
|
-
export const EMPTY_PAYLOAD = 'fb-empty-payload'
|
|
6
5
|
export const VARIABLE_PATTERN_GLOBAL = /{([^{}]+)}/g
|
|
7
6
|
export const ACCESS_TOKEN_VARIABLE_KEY = '_access_token'
|
|
8
7
|
export const REG_EXP_PATTERN = /^\/(.*)\/([gimyus]*)$/
|
|
@@ -10,6 +9,8 @@ export const UUID_REGEXP =
|
|
|
10
9
|
/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i
|
|
11
10
|
|
|
12
11
|
/* ********** PAYLOADS ********** */
|
|
12
|
+
export const EMPTY_PAYLOAD = 'fb-empty-payload'
|
|
13
|
+
export const ON_CLOSE_HANDOFF_PAYLOAD = 'fb-on-close-handoff'
|
|
13
14
|
export const AGENT_RATING_PAYLOAD = 'agent-rating'
|
|
14
15
|
export const PUSH_FLOW_PAYLOAD = 'push-flow'
|
|
15
16
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { HubtypeCaseContactReason } from '@botonic/core'
|
|
2
|
+
|
|
3
|
+
import type { HtContactReasonBranch } from './hubtype-fields/contact-reasons-conditional'
|
|
4
|
+
|
|
5
|
+
export function contactReasonMatchesBranch(
|
|
6
|
+
sessionContactReason: HubtypeCaseContactReason,
|
|
7
|
+
branch: HtContactReasonBranch
|
|
8
|
+
): boolean {
|
|
9
|
+
return (
|
|
10
|
+
sessionContactReason.project_id === branch.project_id &&
|
|
11
|
+
sessionContactReason.name === branch.name
|
|
12
|
+
)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function findMatchingContactReasonBranch(
|
|
16
|
+
sessionContactReasons: HubtypeCaseContactReason[],
|
|
17
|
+
contactReasonBranches: HtContactReasonBranch[]
|
|
18
|
+
): HtContactReasonBranch | undefined {
|
|
19
|
+
return contactReasonBranches.find(branch =>
|
|
20
|
+
sessionContactReasons.some(sessionContactReason =>
|
|
21
|
+
contactReasonMatchesBranch(sessionContactReason, branch)
|
|
22
|
+
)
|
|
23
|
+
)
|
|
24
|
+
}
|
|
@@ -118,7 +118,7 @@ export abstract class FlowAiAgentBase extends ContentFieldsBase {
|
|
|
118
118
|
botContext: BotContext,
|
|
119
119
|
previousContents?: FlowContent[]
|
|
120
120
|
): Promise<void> {
|
|
121
|
-
if (this.
|
|
121
|
+
if (!this.aiAgentResponse) {
|
|
122
122
|
await this.resolveAIAgentResponse(botContext, previousContents)
|
|
123
123
|
}
|
|
124
124
|
if (this.jsxElements.length === 0) {
|
|
@@ -194,6 +194,7 @@ export class FlowAiAgentRouter extends FlowAiAgentBase {
|
|
|
194
194
|
inputGuardrailsTriggered: [],
|
|
195
195
|
outputGuardrailsTriggered:
|
|
196
196
|
this.aiAgentResponse?.outputGuardrailsTriggered ?? [],
|
|
197
|
+
doNothing: this.aiAgentResponse?.doNothing ?? false,
|
|
197
198
|
}
|
|
198
199
|
const { action, ...specialistEventArgs } = specialistEvent
|
|
199
200
|
await trackEvent(botContext, action, specialistEventArgs)
|
|
@@ -94,6 +94,7 @@ export class FlowAiAgent extends FlowAiAgentBase {
|
|
|
94
94
|
this.aiAgentResponse?.inputGuardrailsTriggered ?? [],
|
|
95
95
|
outputGuardrailsTriggered: [], //aiAgentResponse.outputGuardrailsTriggered,
|
|
96
96
|
error: this.aiAgentResponse?.error ?? false,
|
|
97
|
+
doNothing: this.aiAgentResponse?.doNothing ?? false,
|
|
97
98
|
}
|
|
98
99
|
const { action, ...eventArgs } = event
|
|
99
100
|
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type BotContext,
|
|
3
|
+
EventAction,
|
|
4
|
+
type EventConditionalContactReasons,
|
|
5
|
+
} from '@botonic/core'
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
getCommonFlowContentEventArgsForContentId,
|
|
9
|
+
trackEvent,
|
|
10
|
+
} from '../tracking'
|
|
11
|
+
import { findMatchingContactReasonBranch } from './contact-reasons-conditional-matcher'
|
|
12
|
+
import { ContentFieldsBase } from './content-fields-base'
|
|
13
|
+
import type { HtNodeLink } from './hubtype-fields/common'
|
|
14
|
+
import type {
|
|
15
|
+
HtContactReasonBranch,
|
|
16
|
+
HtContactReasonsNode,
|
|
17
|
+
} from './hubtype-fields/contact-reasons-conditional'
|
|
18
|
+
|
|
19
|
+
export class FlowContactReasonsConditional extends ContentFieldsBase {
|
|
20
|
+
public contactReasons: HtContactReasonBranch[] = []
|
|
21
|
+
public conditionalResult: string = ''
|
|
22
|
+
public defaultTarget: HtNodeLink
|
|
23
|
+
|
|
24
|
+
static fromHubtypeCMS(
|
|
25
|
+
component: HtContactReasonsNode,
|
|
26
|
+
botContext: BotContext
|
|
27
|
+
): FlowContactReasonsConditional {
|
|
28
|
+
const newContactReasonsConditional = new FlowContactReasonsConditional(
|
|
29
|
+
component.id
|
|
30
|
+
)
|
|
31
|
+
newContactReasonsConditional.contactReasons =
|
|
32
|
+
component.content.contact_reasons
|
|
33
|
+
newContactReasonsConditional.defaultTarget =
|
|
34
|
+
component.content.default_target
|
|
35
|
+
newContactReasonsConditional.setFollowUp(botContext)
|
|
36
|
+
return newContactReasonsConditional
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
private setFollowUp(botContext: BotContext): void {
|
|
40
|
+
const sessionContactReasons =
|
|
41
|
+
botContext.session._hubtype_case_contact_reasons
|
|
42
|
+
|
|
43
|
+
const matchingBranch = sessionContactReasons
|
|
44
|
+
? findMatchingContactReasonBranch(
|
|
45
|
+
sessionContactReasons,
|
|
46
|
+
this.contactReasons
|
|
47
|
+
)
|
|
48
|
+
: undefined
|
|
49
|
+
|
|
50
|
+
if (matchingBranch) {
|
|
51
|
+
this.conditionalResult = matchingBranch.name
|
|
52
|
+
this.followUp = matchingBranch.target
|
|
53
|
+
} else {
|
|
54
|
+
this.conditionalResult = 'default'
|
|
55
|
+
this.followUp = this.defaultTarget
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async trackFlow(botContext: BotContext): Promise<void> {
|
|
60
|
+
const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } =
|
|
61
|
+
getCommonFlowContentEventArgsForContentId(botContext, this.id)
|
|
62
|
+
const eventContactReasonsConditional: EventConditionalContactReasons = {
|
|
63
|
+
action: EventAction.ConditionalContactReasons,
|
|
64
|
+
flowThreadId,
|
|
65
|
+
flowId,
|
|
66
|
+
flowName,
|
|
67
|
+
flowNodeId,
|
|
68
|
+
flowNodeContentId,
|
|
69
|
+
flowNodeIsMeaningful: false,
|
|
70
|
+
contactReasons:
|
|
71
|
+
botContext.session._hubtype_case_contact_reasons?.map(
|
|
72
|
+
contactReason => contactReason.name
|
|
73
|
+
) || [],
|
|
74
|
+
result: this.conditionalResult,
|
|
75
|
+
}
|
|
76
|
+
const { action, ...eventArgs } = eventContactReasonsConditional
|
|
77
|
+
await trackEvent(botContext, action, eventArgs)
|
|
78
|
+
return
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
async processContent(botContext: BotContext): Promise<void> {
|
|
82
|
+
await this.filterContent(botContext, this)
|
|
83
|
+
await this.trackFlow(botContext)
|
|
84
|
+
return
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
toBotonic() {
|
|
88
|
+
return <></>
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { BotContext } from '@botonic/core'
|
|
2
|
+
|
|
3
|
+
import { trackOneContent } from '../tracking'
|
|
4
|
+
import { ContentFieldsBase } from './content-fields-base'
|
|
5
|
+
import type { HtDoNothingNode } from './hubtype-fields'
|
|
6
|
+
|
|
7
|
+
export class FlowDoNothing extends ContentFieldsBase {
|
|
8
|
+
static fromHubtypeCMS(cmsDoNothing: HtDoNothingNode): FlowDoNothing {
|
|
9
|
+
const newDoNothing = new FlowDoNothing(cmsDoNothing.id)
|
|
10
|
+
newDoNothing.code = cmsDoNothing.code
|
|
11
|
+
newDoNothing.followUp = cmsDoNothing.follow_up
|
|
12
|
+
|
|
13
|
+
return newDoNothing
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
async trackFlow(botContext: BotContext): Promise<void> {
|
|
17
|
+
await trackOneContent(botContext, this)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async processContent(botContext: BotContext): Promise<void> {
|
|
21
|
+
await this.filterContent(botContext, this)
|
|
22
|
+
await this.trackFlow(botContext)
|
|
23
|
+
return
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
toBotonic(): JSX.Element {
|
|
27
|
+
return <></>
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -6,17 +6,27 @@ import {
|
|
|
6
6
|
isWebchat,
|
|
7
7
|
} from '@botonic/core'
|
|
8
8
|
import { WebchatSettings } from '@botonic/react'
|
|
9
|
-
|
|
10
9
|
import type { FlowBuilderApi } from '../api'
|
|
10
|
+
import { ON_CLOSE_HANDOFF_PAYLOAD, SEPARATOR } from '../constants'
|
|
11
11
|
import { getCommonFlowContentEventArgsForContentId } from '../tracking'
|
|
12
12
|
import { ContentFieldsBase } from './content-fields-base'
|
|
13
|
-
import
|
|
13
|
+
import {
|
|
14
|
+
DiscardType,
|
|
15
|
+
type HtHandoffNode,
|
|
16
|
+
type HtNodeLink,
|
|
17
|
+
type HtQueueLocale,
|
|
18
|
+
} from './hubtype-fields'
|
|
14
19
|
|
|
15
20
|
export class FlowHandoff extends ContentFieldsBase {
|
|
16
21
|
public queue?: HtQueueLocale
|
|
17
22
|
public onFinishPayload?: string
|
|
18
23
|
public handoffAutoAssign: boolean
|
|
19
24
|
public hasQueuePositionChangedNotificationsEnabled: boolean
|
|
25
|
+
public hasDifferentiatedCloseTypes: boolean
|
|
26
|
+
public resolvedByAgent?: HtNodeLink
|
|
27
|
+
public discardedByAgent?: HtNodeLink
|
|
28
|
+
public discardedByUser?: HtNodeLink
|
|
29
|
+
public discardedBySystem?: HtNodeLink
|
|
20
30
|
public isTestIntegration: boolean
|
|
21
31
|
|
|
22
32
|
static fromHubtypeCMS(
|
|
@@ -30,14 +40,21 @@ export class FlowHandoff extends ContentFieldsBase {
|
|
|
30
40
|
locale,
|
|
31
41
|
cmsHandoff.content.queue
|
|
32
42
|
)
|
|
43
|
+
newHandoff.hasDifferentiatedCloseTypes =
|
|
44
|
+
cmsHandoff.content.has_differentiated_close_types
|
|
45
|
+
newHandoff.resolvedByAgent = cmsHandoff.content.resolved_by_agent
|
|
46
|
+
newHandoff.discardedByAgent = cmsHandoff.content.discarded_by_agent
|
|
47
|
+
newHandoff.discardedByUser = cmsHandoff.content.discarded_by_user
|
|
48
|
+
newHandoff.discardedBySystem = cmsHandoff.content.discarded_by_system
|
|
49
|
+
newHandoff.handoffAutoAssign = cmsHandoff.content.has_auto_assign
|
|
50
|
+
newHandoff.hasQueuePositionChangedNotificationsEnabled =
|
|
51
|
+
cmsHandoff.content.has_queue_position_changed_notifications_enabled
|
|
52
|
+
|
|
33
53
|
newHandoff.onFinishPayload = FlowHandoff.getOnFinishPayload(
|
|
34
54
|
cmsHandoff,
|
|
35
55
|
cmsApi
|
|
36
56
|
)
|
|
37
|
-
newHandoff.
|
|
38
|
-
newHandoff.hasQueuePositionChangedNotificationsEnabled =
|
|
39
|
-
cmsHandoff.content.has_queue_position_changed_notifications_enabled
|
|
40
|
-
newHandoff.followUp = cmsHandoff.follow_up
|
|
57
|
+
newHandoff.followUp = undefined
|
|
41
58
|
|
|
42
59
|
return newHandoff
|
|
43
60
|
}
|
|
@@ -46,13 +63,43 @@ export class FlowHandoff extends ContentFieldsBase {
|
|
|
46
63
|
cmsHandoff: HtHandoffNode,
|
|
47
64
|
cmsApi: FlowBuilderApi
|
|
48
65
|
): string | undefined {
|
|
49
|
-
if (cmsHandoff.
|
|
66
|
+
if (cmsHandoff.content.has_differentiated_close_types) {
|
|
67
|
+
return `${ON_CLOSE_HANDOFF_PAYLOAD}${SEPARATOR}${cmsHandoff.id}`
|
|
68
|
+
} else if (cmsHandoff.target?.id) {
|
|
50
69
|
return cmsApi.getPayload(cmsHandoff.target)
|
|
51
70
|
}
|
|
52
71
|
|
|
53
72
|
return undefined
|
|
54
73
|
}
|
|
55
74
|
|
|
75
|
+
resolveOnClosePayload(botContext: BotContext): string {
|
|
76
|
+
const contactReasons =
|
|
77
|
+
botContext.session._hubtype_case_contact_reasons || []
|
|
78
|
+
|
|
79
|
+
if (contactReasons.some(reason => reason.name === DiscardType.ByAgent)) {
|
|
80
|
+
if (this.discardedByAgent?.id) {
|
|
81
|
+
return this.discardedByAgent.id
|
|
82
|
+
}
|
|
83
|
+
console.error('No discarded by agent target found')
|
|
84
|
+
}
|
|
85
|
+
if (contactReasons.some(reason => reason.name === DiscardType.ByUser)) {
|
|
86
|
+
if (this.discardedByUser?.id) {
|
|
87
|
+
return this.discardedByUser.id
|
|
88
|
+
}
|
|
89
|
+
console.error('No discarded by user target found')
|
|
90
|
+
}
|
|
91
|
+
if (contactReasons.some(reason => reason.name === DiscardType.BySystem)) {
|
|
92
|
+
if (this.discardedBySystem?.id) {
|
|
93
|
+
return this.discardedBySystem.id
|
|
94
|
+
}
|
|
95
|
+
console.error('No discarded by system target found')
|
|
96
|
+
}
|
|
97
|
+
if (this.resolvedByAgent?.id) {
|
|
98
|
+
return this.resolvedByAgent.id
|
|
99
|
+
}
|
|
100
|
+
throw new Error('No resolved by agent target found')
|
|
101
|
+
}
|
|
102
|
+
|
|
56
103
|
async doHandoff(botContext: BotContext): Promise<void> {
|
|
57
104
|
const handOffBuilder = new HandOffBuilder(botContext.session)
|
|
58
105
|
handOffBuilder.withAutoAssignOnWaiting(this.handoffAutoAssign)
|
|
@@ -35,6 +35,8 @@ export class FlowWhatsappRequestContactInfoNode extends ContentFieldsBase {
|
|
|
35
35
|
message: RequestContactInfoMessage,
|
|
36
36
|
botContext: BotContext
|
|
37
37
|
): JSX.Element {
|
|
38
|
+
botContext.session.whatsapp_request_contact = undefined
|
|
39
|
+
|
|
38
40
|
if (!isWhatsapp(botContext.session)) {
|
|
39
41
|
return <Text key={id}>{message.content.text}</Text>
|
|
40
42
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { HtBaseNode, HtNodeLink } from './common'
|
|
2
|
+
import type { HtNodeWithContentType } from './node-types'
|
|
3
|
+
|
|
4
|
+
export interface HtContactReasonBranch {
|
|
5
|
+
id: string
|
|
6
|
+
name: string
|
|
7
|
+
project_id: string
|
|
8
|
+
project_name: string
|
|
9
|
+
target: HtNodeLink
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface HtContactReasonsNode extends HtBaseNode {
|
|
13
|
+
type: HtNodeWithContentType.CONTACT_REASONS_CONDITION
|
|
14
|
+
content: {
|
|
15
|
+
contact_reasons: HtContactReasonBranch[]
|
|
16
|
+
default_target: HtNodeLink
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
HtBaseNode,
|
|
3
|
+
HtNodeLink,
|
|
4
|
+
HtPayloadLocale,
|
|
5
|
+
HtQueueLocale,
|
|
6
|
+
} from './common'
|
|
2
7
|
import type { HtNodeWithContentType } from './node-types'
|
|
3
8
|
|
|
9
|
+
export enum DiscardType {
|
|
10
|
+
ByAgent = 'discarded',
|
|
11
|
+
ByUser = 'discarded_by_user',
|
|
12
|
+
BySystem = 'discarded_by_system',
|
|
13
|
+
}
|
|
14
|
+
|
|
4
15
|
export interface HtHandoffNode extends HtBaseNode {
|
|
5
16
|
type: HtNodeWithContentType.HANDOFF
|
|
6
17
|
content: {
|
|
@@ -8,5 +19,10 @@ export interface HtHandoffNode extends HtBaseNode {
|
|
|
8
19
|
payload: HtPayloadLocale[]
|
|
9
20
|
has_auto_assign: boolean
|
|
10
21
|
has_queue_position_changed_notifications_enabled: boolean
|
|
22
|
+
has_differentiated_close_types: boolean
|
|
23
|
+
resolved_by_agent?: HtNodeLink
|
|
24
|
+
discarded_by_agent?: HtNodeLink
|
|
25
|
+
discarded_by_user?: HtNodeLink
|
|
26
|
+
discarded_by_system?: HtNodeLink
|
|
11
27
|
}
|
|
12
28
|
}
|
|
@@ -20,6 +20,8 @@ export enum HtNodeWithContentType {
|
|
|
20
20
|
GO_TO_FLOW = 'go-to-flow',
|
|
21
21
|
CAPTURE_USER_INPUT = 'capture-user-input',
|
|
22
22
|
CUSTOM_CONDITION = 'custom-condition',
|
|
23
|
+
DO_NOTHING = 'do-nothing',
|
|
24
|
+
CONTACT_REASONS_CONDITION = 'contact-reasons-condition',
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
export enum HtNodeWithoutContentType {
|
|
@@ -3,7 +3,9 @@ import type { HtAiAgentRouterNode } from './ai-agent-router'
|
|
|
3
3
|
import type { HtBotActionNode } from './bot-action'
|
|
4
4
|
import type { HtCaptureUserInputNode } from './capture-user-input'
|
|
5
5
|
import type { HtCarouselNode } from './carousel'
|
|
6
|
+
import type { HtContactReasonsNode } from './contact-reasons-conditional'
|
|
6
7
|
import type { HtCustomConditionalV2Node } from './custom-conditional-v2'
|
|
8
|
+
import type { HtDoNothingNode } from './do-nothing'
|
|
7
9
|
// import { HtChannelConditionalNode } from './channel-conditional'
|
|
8
10
|
// import { HtCountryConditionalNode } from './country-conditional'
|
|
9
11
|
// import { HtCustomConditionalNode } from './custom-conditional'
|
|
@@ -48,6 +50,8 @@ export type HtNodeWithContent =
|
|
|
48
50
|
| HtWhatsappTemplateNode
|
|
49
51
|
| HtCaptureUserInputNode
|
|
50
52
|
| HtCustomConditionalV2Node
|
|
53
|
+
| HtDoNothingNode
|
|
54
|
+
| HtContactReasonsNode
|
|
51
55
|
// | HtChannelConditionalNode
|
|
52
56
|
// | HtCountryConditionalNode
|
|
53
57
|
// | HtCustomConditionalNode
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { HtButton } from './button'
|
|
1
2
|
import type { HtBaseNode, HtTextLocale } from './common'
|
|
2
3
|
import type { HtNodeWithContentType } from './node-types'
|
|
3
4
|
|
|
@@ -5,5 +6,6 @@ export interface HtWhatsappRequestContactInfoNode extends HtBaseNode {
|
|
|
5
6
|
type: HtNodeWithContentType.WHATSAPP_REQUEST_CONTACT_INFO
|
|
6
7
|
content: {
|
|
7
8
|
text: HtTextLocale[]
|
|
9
|
+
button: HtButton
|
|
8
10
|
}
|
|
9
11
|
}
|
|
@@ -5,8 +5,10 @@ import { FlowBotAction } from './flow-bot-action'
|
|
|
5
5
|
import { FlowCaptureUserInput } from './flow-capture-user-input'
|
|
6
6
|
import { FlowCarousel } from './flow-carousel'
|
|
7
7
|
import { FlowChannelConditional } from './flow-channel-conditional'
|
|
8
|
+
import { FlowContactReasonsConditional } from './flow-contact-reasons-conditional'
|
|
8
9
|
import { FlowCountryConditional } from './flow-country-conditional'
|
|
9
10
|
import { FlowCustomConditional } from './flow-custom-conditional'
|
|
11
|
+
import { FlowDoNothing } from './flow-do-nothing'
|
|
10
12
|
import { FlowGoToFlow } from './flow-go-to-flow'
|
|
11
13
|
import { FlowHandoff } from './flow-handoff'
|
|
12
14
|
import { FlowImage } from './flow-image'
|
|
@@ -33,9 +35,11 @@ export {
|
|
|
33
35
|
FlowCaptureUserInput,
|
|
34
36
|
FlowCarousel,
|
|
35
37
|
FlowChannelConditional,
|
|
38
|
+
FlowContactReasonsConditional,
|
|
36
39
|
FlowCountryConditional,
|
|
37
40
|
FlowCustomConditional,
|
|
38
41
|
FlowCustomConditionalV2,
|
|
42
|
+
FlowDoNothing,
|
|
39
43
|
FlowGoToFlow,
|
|
40
44
|
FlowHandoff,
|
|
41
45
|
FlowImage,
|
|
@@ -72,3 +76,5 @@ export type FlowContent =
|
|
|
72
76
|
| FlowCaptureUserInput
|
|
73
77
|
| FlowAiAgentRouter
|
|
74
78
|
| FlowCustomConditionalV2
|
|
79
|
+
| FlowDoNothing
|
|
80
|
+
| FlowContactReasonsConditional
|
package/src/flow-factory.ts
CHANGED
|
@@ -7,10 +7,12 @@ import {
|
|
|
7
7
|
FlowBotAction,
|
|
8
8
|
FlowCarousel,
|
|
9
9
|
FlowChannelConditional,
|
|
10
|
+
FlowContactReasonsConditional,
|
|
10
11
|
type FlowContent,
|
|
11
12
|
FlowCountryConditional,
|
|
12
13
|
FlowCustomConditional,
|
|
13
14
|
FlowCustomConditionalV2,
|
|
15
|
+
FlowDoNothing,
|
|
14
16
|
FlowGoToFlow,
|
|
15
17
|
FlowHandoff,
|
|
16
18
|
FlowImage,
|
|
@@ -118,6 +120,15 @@ export class FlowFactory {
|
|
|
118
120
|
this.botContext
|
|
119
121
|
)
|
|
120
122
|
|
|
123
|
+
case HtNodeWithContentType.DO_NOTHING:
|
|
124
|
+
return FlowDoNothing.fromHubtypeCMS(hubtypeContent)
|
|
125
|
+
|
|
126
|
+
case HtNodeWithContentType.CONTACT_REASONS_CONDITION:
|
|
127
|
+
return FlowContactReasonsConditional.fromHubtypeCMS(
|
|
128
|
+
hubtypeContent,
|
|
129
|
+
this.botContext
|
|
130
|
+
)
|
|
131
|
+
|
|
121
132
|
default:
|
|
122
133
|
return undefined
|
|
123
134
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,24 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
type ResolvedPlugins,
|
|
7
|
-
type Session,
|
|
1
|
+
import type {
|
|
2
|
+
BotContext,
|
|
3
|
+
Plugin,
|
|
4
|
+
ResolvedPlugins,
|
|
5
|
+
Session,
|
|
8
6
|
} from '@botonic/core'
|
|
9
|
-
import type { ActionRequest } from '@botonic/react'
|
|
10
7
|
import { v7 as uuidv7 } from 'uuid'
|
|
11
8
|
|
|
12
9
|
import { FlowBuilderApi } from './api'
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
FLOW_BUILDER_API_URL_PROD,
|
|
16
|
-
SEPARATOR,
|
|
17
|
-
SOURCE_INFO_SEPARATOR,
|
|
18
|
-
} from './constants'
|
|
10
|
+
import { BotContextManager } from './bot-context-manager'
|
|
11
|
+
import { FLOW_BUILDER_API_URL_PROD, SEPARATOR } from './constants'
|
|
19
12
|
import type { FlowContent } from './content-fields'
|
|
20
13
|
import {
|
|
21
|
-
type HtBotActionNode,
|
|
22
14
|
type HtFlowBuilderData,
|
|
23
15
|
type HtNodeWithContent,
|
|
24
16
|
HtNodeWithContentType,
|
|
@@ -35,10 +27,8 @@ import {
|
|
|
35
27
|
type RatingSubmittedInfo,
|
|
36
28
|
type TrackEventFunction,
|
|
37
29
|
} from './types'
|
|
38
|
-
import { getNextPayloadByUserInput } from './user-input'
|
|
39
30
|
import type { SmartIntentsInferenceConfig } from './user-input/smart-intent'
|
|
40
31
|
import { resolveGetAccessToken } from './utils/authentication'
|
|
41
|
-
import { inputHasTextOrTranscript } from './utils/input'
|
|
42
32
|
|
|
43
33
|
// TODO: Create a proper service to wrap all calls and allow api versioning
|
|
44
34
|
|
|
@@ -46,7 +36,7 @@ export default class BotonicPluginFlowBuilder implements Plugin {
|
|
|
46
36
|
public cmsApi: FlowBuilderApi
|
|
47
37
|
private flow?: HtFlowBuilderData
|
|
48
38
|
private functions: Record<any, any>
|
|
49
|
-
private
|
|
39
|
+
private botContext: BotContext
|
|
50
40
|
public getAccessToken: (session: Session) => string
|
|
51
41
|
public trackEvent?: TrackEventFunction
|
|
52
42
|
public getAiAgentResponse?: AiAgentFunction
|
|
@@ -85,85 +75,33 @@ export default class BotonicPluginFlowBuilder implements Plugin {
|
|
|
85
75
|
options.disableAIAgentInFirstInteraction || false
|
|
86
76
|
}
|
|
87
77
|
|
|
88
|
-
resolveFlowUrl(
|
|
89
|
-
if (
|
|
78
|
+
resolveFlowUrl(botContext: BotContext): string {
|
|
79
|
+
if (botContext.session.is_test_integration) {
|
|
90
80
|
return `${this.apiUrl}/v1/bot_flows/{bot_id}/versions/${FlowBuilderJSONVersion.DRAFT}/`
|
|
91
81
|
}
|
|
92
82
|
return `${this.apiUrl}/v1/bot_flows/{bot_id}/versions/${this.jsonVersion}/`
|
|
93
83
|
}
|
|
94
84
|
|
|
95
|
-
async pre(
|
|
96
|
-
|
|
97
|
-
this.convertWhatsappAiAgentEmptyPayloads(request)
|
|
98
|
-
|
|
99
|
-
this.currentRequest = request
|
|
85
|
+
async pre(botContext: BotContext): Promise<void> {
|
|
86
|
+
this.botContext = botContext
|
|
100
87
|
this.cmsApi = await FlowBuilderApi.create({
|
|
101
|
-
flowUrl: this.resolveFlowUrl(
|
|
88
|
+
flowUrl: this.resolveFlowUrl(botContext),
|
|
102
89
|
url: this.apiUrl,
|
|
103
90
|
flow: this.flow,
|
|
104
|
-
accessToken: this.getAccessToken(
|
|
105
|
-
|
|
91
|
+
accessToken: this.getAccessToken(botContext.session),
|
|
92
|
+
botContext: this.botContext,
|
|
106
93
|
})
|
|
107
94
|
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
const nextPayload = await getNextPayloadByUserInput(
|
|
114
|
-
this.cmsApi,
|
|
115
|
-
resolvedLocale,
|
|
116
|
-
request as unknown as ActionRequest,
|
|
117
|
-
this.smartIntentsConfig
|
|
118
|
-
)
|
|
119
|
-
request.input.payload = nextPayload
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
await this.updateRequestBeforeRoutes(request)
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
private convertWhatsappAiAgentEmptyPayloads(request: PluginPreRequest): void {
|
|
126
|
-
if (request.session.user.provider === PROVIDER.WHATSAPP) {
|
|
127
|
-
const shouldUseReferral =
|
|
128
|
-
request.input.referral &&
|
|
129
|
-
request.input.payload?.startsWith(EMPTY_PAYLOAD)
|
|
130
|
-
|
|
131
|
-
if (shouldUseReferral) {
|
|
132
|
-
request.input.type = INPUT.TEXT
|
|
133
|
-
request.input.data = request.input.referral
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
private async updateRequestBeforeRoutes(
|
|
139
|
-
request: PluginPreRequest
|
|
140
|
-
): Promise<void> {
|
|
141
|
-
this.cmsApi.removeCaptureUserInputId()
|
|
142
|
-
if (request.input.payload) {
|
|
143
|
-
request.input.payload = this.removeSourceSuffix(request.input.payload)
|
|
144
|
-
|
|
145
|
-
if (this.cmsApi.isBotAction(request.input.payload)) {
|
|
146
|
-
const cmsBotAction = this.cmsApi.getNodeById<HtBotActionNode>(
|
|
147
|
-
request.input.payload
|
|
148
|
-
)
|
|
149
|
-
|
|
150
|
-
request.input.payload =
|
|
151
|
-
this.cmsApi.createPayloadWithParams(cmsBotAction)
|
|
152
|
-
|
|
153
|
-
// Re-execute convertWhatsappAiAgentEmptyPayloads function to handle
|
|
154
|
-
// the case that a BotAction has a payload equals to EMPTY_PAYLOAD
|
|
155
|
-
this.convertWhatsappAiAgentEmptyPayloads(request)
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
private removeSourceSuffix(payload: string): string {
|
|
161
|
-
return payload.split(SOURCE_INFO_SEPARATOR)[0]
|
|
95
|
+
const botContextManager = new BotContextManager(
|
|
96
|
+
this.cmsApi,
|
|
97
|
+
this.smartIntentsConfig
|
|
98
|
+
)
|
|
99
|
+
await botContextManager.prepareInputForRoutes(botContext)
|
|
162
100
|
}
|
|
163
101
|
|
|
164
|
-
post(
|
|
165
|
-
|
|
166
|
-
delete
|
|
102
|
+
post(botContext: BotContext): void {
|
|
103
|
+
botContext.input.nluResolution = undefined
|
|
104
|
+
delete botContext.session.user.system_locale_updated
|
|
167
105
|
}
|
|
168
106
|
|
|
169
107
|
async getContentsByContentID(
|
|
@@ -189,7 +127,7 @@ export default class BotonicPluginFlowBuilder implements Plugin {
|
|
|
189
127
|
|
|
190
128
|
async getStartContents(): Promise<FlowContent[]> {
|
|
191
129
|
const startNode = this.cmsApi.getStartNode()
|
|
192
|
-
this.
|
|
130
|
+
this.botContext.session.flow_thread_id = uuidv7()
|
|
193
131
|
return await this.getContentsByNode(startNode)
|
|
194
132
|
}
|
|
195
133
|
|
|
@@ -206,7 +144,7 @@ export default class BotonicPluginFlowBuilder implements Plugin {
|
|
|
206
144
|
) {
|
|
207
145
|
const customFunctionResolver = new CustomFunction(
|
|
208
146
|
this.functions,
|
|
209
|
-
this.
|
|
147
|
+
this.botContext,
|
|
210
148
|
resolvedLocale
|
|
211
149
|
)
|
|
212
150
|
const targetId = await customFunctionResolver.call(node)
|
|
@@ -214,7 +152,7 @@ export default class BotonicPluginFlowBuilder implements Plugin {
|
|
|
214
152
|
}
|
|
215
153
|
|
|
216
154
|
const flowFactory = new FlowFactory(
|
|
217
|
-
this.
|
|
155
|
+
this.botContext,
|
|
218
156
|
this.cmsApi,
|
|
219
157
|
resolvedLocale
|
|
220
158
|
)
|
package/src/types.ts
CHANGED
|
@@ -3,7 +3,6 @@ import type {
|
|
|
3
3
|
BotContext,
|
|
4
4
|
GuardrailRule,
|
|
5
5
|
InferenceResponse,
|
|
6
|
-
PluginPreRequest,
|
|
7
6
|
ResolvedPlugins,
|
|
8
7
|
} from '@botonic/core'
|
|
9
8
|
import type { FlowContent } from './content-fields'
|
|
@@ -67,7 +66,7 @@ export interface FlowBuilderApiOptions {
|
|
|
67
66
|
flowUrl: string
|
|
68
67
|
flow?: HtFlowBuilderData
|
|
69
68
|
accessToken: string
|
|
70
|
-
|
|
69
|
+
botContext: BotContext
|
|
71
70
|
}
|
|
72
71
|
|
|
73
72
|
export enum ProcessEnvNodeEnvs {
|