@botonic/plugin-flow-builder 0.56.0-alpha.0 → 0.57.0-rslib-esm.1
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 → action}/ai-agent-from-user-input.d.ts +2 -2
- package/lib/{cjs/action → action}/ai-agent-from-user-input.js +9 -6
- package/lib/action/ai-agent-from-user-input.js.map +1 -0
- package/lib/{esm/action → action}/context.d.ts +2 -2
- package/lib/action/context.js +20 -0
- package/lib/action/context.js.map +1 -0
- package/lib/{cjs/action → action}/fallback.d.ts +2 -2
- package/lib/{cjs/action → action}/fallback.js +16 -11
- package/lib/action/fallback.js.map +1 -0
- package/lib/action/first-interaction.d.ts +3 -0
- package/lib/{cjs/action → action}/first-interaction.js +39 -27
- package/lib/action/first-interaction.js.map +1 -0
- package/lib/{cjs/action → action}/get-contents.d.ts +1 -1
- package/lib/action/get-contents.js +56 -0
- package/lib/action/get-contents.js.map +1 -0
- package/lib/{esm/action → action}/index.d.ts +1 -1
- package/lib/{esm/action → action}/index.js +68 -32
- package/lib/action/index.js.map +1 -0
- package/lib/action/payload.d.ts +3 -0
- package/lib/{cjs/action → action}/payload.js +27 -23
- package/lib/action/payload.js.map +1 -0
- package/lib/{cjs/api.d.ts → api.d.ts} +2 -2
- package/lib/{esm/api.js → api.js} +55 -44
- package/lib/api.js.map +1 -0
- package/lib/constants.js +17 -0
- package/lib/constants.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/content-fields-base.d.ts +2 -2
- package/lib/content-fields/content-fields-base.js +78 -0
- package/lib/content-fields/content-fields-base.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/custom-conditional/custom-conditional-v2-evaluators.d.ts +1 -1
- package/lib/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +73 -0
- package/lib/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/custom-conditional/custom-conditional-v2-resolver.d.ts +1 -1
- package/lib/{cjs/content-fields → content-fields}/custom-conditional/custom-conditional-v2-resolver.js +15 -15
- package/lib/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/custom-conditional/flow-custom-condition-v2.d.ts +3 -3
- package/lib/content-fields/custom-conditional/flow-custom-condition-v2.js +94 -0
- package/lib/content-fields/custom-conditional/flow-custom-condition-v2.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-ai-agent-base.d.ts +4 -4
- package/lib/content-fields/flow-ai-agent-base.js +100 -0
- package/lib/content-fields/flow-ai-agent-base.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-ai-agent-router.d.ts +5 -5
- package/lib/{esm/content-fields → content-fields}/flow-ai-agent-router.js +57 -46
- package/lib/content-fields/flow-ai-agent-router.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/flow-ai-agent.d.ts +4 -4
- package/lib/{cjs/content-fields → content-fields}/flow-ai-agent.js +33 -22
- package/lib/content-fields/flow-ai-agent.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-bot-action.d.ts +3 -3
- package/lib/{esm/content-fields → content-fields}/flow-bot-action.js +23 -15
- package/lib/content-fields/flow-bot-action.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-button.d.ts +5 -5
- package/lib/{esm/content-fields → content-fields}/flow-button.js +48 -29
- package/lib/content-fields/flow-button.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/flow-capture-user-input.d.ts +2 -2
- package/lib/content-fields/flow-capture-user-input.js +46 -0
- package/lib/content-fields/flow-capture-user-input.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-carousel.d.ts +4 -4
- package/lib/content-fields/flow-carousel.js +193 -0
- package/lib/content-fields/flow-carousel.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-channel-conditional.d.ts +3 -3
- package/lib/{esm/content-fields → content-fields}/flow-channel-conditional.js +26 -22
- package/lib/content-fields/flow-channel-conditional.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/flow-country-conditional.d.ts +3 -3
- package/lib/{esm/content-fields → content-fields}/flow-country-conditional.js +26 -21
- package/lib/content-fields/flow-country-conditional.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/flow-custom-conditional.d.ts +4 -4
- package/lib/{esm/content-fields → content-fields}/flow-custom-conditional.js +31 -33
- package/lib/content-fields/flow-custom-conditional.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/flow-element.d.ts +4 -4
- package/lib/content-fields/flow-element.js +67 -0
- package/lib/content-fields/flow-element.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-go-to-flow.d.ts +3 -3
- package/lib/{esm/content-fields → content-fields}/flow-go-to-flow.js +25 -20
- package/lib/content-fields/flow-go-to-flow.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/flow-handoff.d.ts +3 -3
- package/lib/{cjs/content-fields → content-fields}/flow-handoff.js +30 -19
- package/lib/content-fields/flow-handoff.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/flow-image.d.ts +2 -2
- package/lib/content-fields/flow-image.js +42 -0
- package/lib/content-fields/flow-image.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/flow-queue-status-conditional.d.ts +3 -3
- package/lib/{cjs/content-fields → content-fields}/flow-queue-status-conditional.js +45 -40
- package/lib/content-fields/flow-queue-status-conditional.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-rating.d.ts +3 -3
- package/lib/content-fields/flow-rating.js +88 -0
- package/lib/content-fields/flow-rating.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/flow-text.d.ts +4 -4
- package/lib/content-fields/flow-text.js +82 -0
- package/lib/content-fields/flow-text.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-video.d.ts +2 -2
- package/lib/content-fields/flow-video.js +42 -0
- package/lib/content-fields/flow-video.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-webview.d.ts +2 -2
- package/lib/{cjs/content-fields → content-fields}/flow-webview.js +31 -28
- package/lib/content-fields/flow-webview.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-whatsapp-cta-url-button.d.ts +3 -3
- package/lib/content-fields/flow-whatsapp-cta-url-button.js +131 -0
- package/lib/content-fields/flow-whatsapp-cta-url-button.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-whatsapp-request-contact-info.d.ts +3 -4
- package/lib/content-fields/flow-whatsapp-request-contact-info.js +51 -0
- package/lib/content-fields/flow-whatsapp-request-contact-info.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/flow-whatsapp-template.d.ts +2 -2
- package/lib/{esm/content-fields → content-fields}/flow-whatsapp-template.js +119 -102
- package/lib/content-fields/flow-whatsapp-template.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/ai-agent-router.d.ts +3 -3
- package/lib/content-fields/hubtype-fields/ai-agent-router.js +4 -0
- package/lib/content-fields/hubtype-fields/ai-agent-router.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/ai-agent.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/ai-agent.js +4 -0
- package/lib/content-fields/hubtype-fields/ai-agent.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/bot-action.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/bot-action.js +4 -0
- package/lib/content-fields/hubtype-fields/bot-action.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/button.d.ts +1 -1
- package/lib/content-fields/hubtype-fields/button.js +4 -0
- package/lib/content-fields/hubtype-fields/button.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/capture-user-input.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/capture-user-input.js +12 -0
- package/lib/content-fields/hubtype-fields/capture-user-input.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/carousel.d.ts +3 -3
- package/lib/content-fields/hubtype-fields/carousel.js +4 -0
- package/lib/content-fields/hubtype-fields/carousel.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/channel-conditional.d.ts +3 -3
- package/lib/content-fields/hubtype-fields/channel-conditional.js +4 -0
- package/lib/content-fields/hubtype-fields/channel-conditional.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/common.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/common.js +4 -0
- package/lib/content-fields/hubtype-fields/common.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/country-conditional.d.ts +3 -3
- package/lib/content-fields/hubtype-fields/country-conditional.js +4 -0
- package/lib/content-fields/hubtype-fields/country-conditional.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/custom-conditional-v2.d.ts +2 -2
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/custom-conditional-v2.js +15 -15
- package/lib/content-fields/hubtype-fields/custom-conditional-v2.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/custom-conditional.d.ts +3 -3
- package/lib/content-fields/hubtype-fields/custom-conditional.js +4 -0
- package/lib/content-fields/hubtype-fields/custom-conditional.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/fallback.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/fallback.js +4 -0
- package/lib/content-fields/hubtype-fields/fallback.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/function.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/function.js +11 -0
- package/lib/content-fields/hubtype-fields/function.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/go-to-flow.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/go-to-flow.js +4 -0
- package/lib/content-fields/hubtype-fields/go-to-flow.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/handoff.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/handoff.js +4 -0
- package/lib/content-fields/hubtype-fields/handoff.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/image.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/image.js +4 -0
- package/lib/content-fields/hubtype-fields/image.js.map +1 -0
- package/lib/content-fields/hubtype-fields/index.d.ts +27 -0
- package/lib/content-fields/hubtype-fields/index.js +57 -0
- package/lib/content-fields/hubtype-fields/index.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/keyword.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/keyword.js +4 -0
- package/lib/content-fields/hubtype-fields/keyword.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/node-types.js +12 -12
- package/lib/content-fields/hubtype-fields/node-types.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/nodes.d.ts +23 -23
- package/lib/content-fields/hubtype-fields/nodes.js +4 -0
- package/lib/content-fields/hubtype-fields/nodes.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/payload.d.ts +1 -1
- package/lib/content-fields/hubtype-fields/payload.js +4 -0
- package/lib/content-fields/hubtype-fields/payload.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/queue-status-conditional.d.ts +3 -3
- package/lib/content-fields/hubtype-fields/queue-status-conditional.js +4 -0
- package/lib/content-fields/hubtype-fields/queue-status-conditional.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/rating.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/rating.js +9 -0
- package/lib/content-fields/hubtype-fields/rating.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/smart-intent.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/smart-intent.js +4 -0
- package/lib/content-fields/hubtype-fields/smart-intent.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/text.d.ts +3 -3
- package/lib/content-fields/hubtype-fields/text.js +4 -0
- package/lib/content-fields/hubtype-fields/text.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/url.d.ts +1 -1
- package/lib/content-fields/hubtype-fields/url.js +4 -0
- package/lib/content-fields/hubtype-fields/url.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/video.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/video.js +4 -0
- package/lib/content-fields/hubtype-fields/video.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/webview.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/webview.js +4 -0
- package/lib/content-fields/hubtype-fields/webview.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/whatsapp-button-list.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/whatsapp-button-list.js +4 -0
- package/lib/content-fields/hubtype-fields/whatsapp-button-list.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/whatsapp-cta-url-button.d.ts +3 -3
- package/lib/content-fields/hubtype-fields/whatsapp-cta-url-button.js +4 -0
- package/lib/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/whatsapp-request-contact-info.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/whatsapp-request-contact-info.js +4 -0
- package/lib/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/whatsapp-template.d.ts +3 -3
- package/lib/content-fields/hubtype-fields/whatsapp-template.js +9 -0
- package/lib/content-fields/hubtype-fields/whatsapp-template.js.map +1 -0
- package/lib/content-fields/index.d.ts +25 -0
- package/lib/content-fields/index.js +73 -0
- package/lib/content-fields/index.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +3 -3
- package/lib/{esm/content-fields → content-fields}/whatsapp-button-list/flow-whatsapp-button-list-row.js +16 -14
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +4 -4
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +41 -0
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/whatsapp-button-list/flow-whatsapp-button-list.d.ts +4 -4
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +66 -0
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/whatsapp-button-list/index.d.ts +3 -3
- package/lib/content-fields/whatsapp-button-list/index.js +12 -0
- package/lib/content-fields/whatsapp-button-list/index.js.map +1 -0
- package/lib/{cjs/filters → filters}/index.d.ts +2 -2
- package/lib/filters/index.js +16 -0
- package/lib/filters/index.js.map +1 -0
- package/lib/{cjs/flow-factory.d.ts → flow-factory.d.ts} +3 -3
- package/lib/flow-factory.js +75 -0
- package/lib/flow-factory.js.map +1 -0
- package/lib/{esm/functions → functions}/index.d.ts +1 -1
- package/lib/{cjs/functions → functions}/index.js +25 -19
- package/lib/functions/index.js.map +1 -0
- package/lib/{cjs/index.d.ts → index.d.ts} +12 -12
- package/lib/{esm/index.js → index.js} +94 -77
- package/lib/index.js.map +1 -0
- package/lib/services/hubtype-queues-api.js +26 -0
- package/lib/services/hubtype-queues-api.js.map +1 -0
- package/lib/structured-output/flow-builder-content.js +16 -0
- package/lib/structured-output/flow-builder-content.js.map +1 -0
- package/lib/{cjs/tracking.d.ts → tracking.d.ts} +2 -2
- package/lib/{cjs/tracking.js → tracking.js} +27 -21
- package/lib/tracking.js.map +1 -0
- package/lib/{esm/types.d.ts → types.d.ts} +5 -5
- package/lib/types.js +14 -0
- package/lib/types.js.map +1 -0
- package/lib/{esm/user-input → user-input}/capture-user-input-api.d.ts +2 -2
- package/lib/{cjs/user-input → user-input}/capture-user-input-api.js +44 -33
- package/lib/user-input/capture-user-input-api.js.map +1 -0
- package/lib/{esm/user-input → user-input}/index.d.ts +2 -2
- package/lib/user-input/index.js +46 -0
- package/lib/user-input/index.js.map +1 -0
- package/lib/{esm/user-input → user-input}/keyword.d.ts +2 -2
- package/lib/{esm/user-input → user-input}/keyword.js +31 -26
- package/lib/user-input/keyword.js.map +1 -0
- package/lib/{cjs/user-input → user-input}/smart-intent.d.ts +2 -2
- package/lib/{cjs/user-input → user-input}/smart-intent.js +36 -32
- package/lib/user-input/smart-intent.js.map +1 -0
- package/lib/{cjs/utils → utils}/ai-agent.d.ts +3 -3
- package/lib/utils/ai-agent.js +33 -0
- package/lib/utils/ai-agent.js.map +1 -0
- package/lib/{cjs/utils → utils}/authentication.js +10 -7
- package/lib/utils/authentication.js.map +1 -0
- package/lib/{cjs/utils → utils}/flow-locale.js +14 -18
- package/lib/utils/flow-locale.js.map +1 -0
- package/lib/{cjs/utils → utils}/get-flow-builder-plugin.d.ts +1 -1
- package/lib/{cjs/utils → utils}/get-flow-builder-plugin.js +4 -4
- package/lib/utils/get-flow-builder-plugin.js.map +1 -0
- package/lib/{cjs/utils → utils}/hubtype-assistant-content.d.ts +1 -2
- package/lib/{cjs/utils → utils}/hubtype-assistant-content.js +57 -54
- package/lib/utils/hubtype-assistant-content.js.map +1 -0
- package/lib/utils/input.js +37 -0
- package/lib/utils/input.js.map +1 -0
- package/lib/{cjs/webview → webview}/contents-context.d.ts +1 -1
- package/lib/webview/contents-context.js +14 -0
- package/lib/webview/contents-context.js.map +1 -0
- package/lib/webview/index.d.ts +3 -0
- package/lib/webview/index.js +11 -0
- package/lib/webview/index.js.map +1 -0
- package/lib/{esm/webview → webview}/types.d.ts +1 -1
- package/lib/webview/types.js +9 -0
- package/lib/webview/types.js.map +1 -0
- package/lib/{cjs/webview → webview}/use-webview-contents.d.ts +1 -1
- package/lib/webview/use-webview-contents.js +90 -0
- package/lib/webview/use-webview-contents.js.map +1 -0
- package/package.json +10 -8
- package/src/content-fields/flow-ai-agent-base.tsx +0 -11
- package/src/content-fields/flow-whatsapp-request-contact-info.tsx +1 -17
- package/src/content-fields/index.ts +2 -2
- package/src/index.ts +5 -5
- package/src/types.ts +6 -6
- package/src/utils/hubtype-assistant-content.ts +0 -14
- package/lib/cjs/action/ai-agent-from-user-input.js.map +0 -1
- package/lib/cjs/action/context.d.ts +0 -11
- package/lib/cjs/action/context.js +0 -17
- package/lib/cjs/action/context.js.map +0 -1
- package/lib/cjs/action/fallback.js.map +0 -1
- package/lib/cjs/action/first-interaction.d.ts +0 -3
- package/lib/cjs/action/first-interaction.js.map +0 -1
- package/lib/cjs/action/get-contents.js +0 -39
- package/lib/cjs/action/get-contents.js.map +0 -1
- package/lib/cjs/action/index.d.ts +0 -25
- package/lib/cjs/action/index.js +0 -90
- package/lib/cjs/action/index.js.map +0 -1
- package/lib/cjs/action/payload.d.ts +0 -3
- package/lib/cjs/action/payload.js.map +0 -1
- package/lib/cjs/api.js +0 -205
- package/lib/cjs/api.js.map +0 -1
- package/lib/cjs/constants.js +0 -19
- package/lib/cjs/constants.js.map +0 -1
- package/lib/cjs/content-fields/content-fields-base.d.ts +0 -20
- package/lib/cjs/content-fields/content-fields-base.js +0 -74
- package/lib/cjs/content-fields/content-fields-base.js.map +0 -1
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.d.ts +0 -15
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +0 -71
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +0 -1
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.d.ts +0 -9
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +0 -1
- package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.js +0 -79
- package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.js.map +0 -1
- package/lib/cjs/content-fields/flow-ai-agent-base.d.ts +0 -25
- package/lib/cjs/content-fields/flow-ai-agent-base.js +0 -97
- package/lib/cjs/content-fields/flow-ai-agent-base.js.map +0 -1
- package/lib/cjs/content-fields/flow-ai-agent-router.d.ts +0 -21
- package/lib/cjs/content-fields/flow-ai-agent-router.js +0 -125
- package/lib/cjs/content-fields/flow-ai-agent-router.js.map +0 -1
- package/lib/cjs/content-fields/flow-ai-agent.js.map +0 -1
- package/lib/cjs/content-fields/flow-bot-action.d.ts +0 -14
- package/lib/cjs/content-fields/flow-bot-action.js +0 -45
- package/lib/cjs/content-fields/flow-bot-action.js.map +0 -1
- package/lib/cjs/content-fields/flow-button.d.ts +0 -31
- package/lib/cjs/content-fields/flow-button.js +0 -86
- package/lib/cjs/content-fields/flow-button.js.map +0 -1
- package/lib/cjs/content-fields/flow-capture-user-input.js +0 -45
- package/lib/cjs/content-fields/flow-capture-user-input.js.map +0 -1
- package/lib/cjs/content-fields/flow-carousel.d.ts +0 -22
- package/lib/cjs/content-fields/flow-carousel.js +0 -152
- package/lib/cjs/content-fields/flow-carousel.js.map +0 -1
- package/lib/cjs/content-fields/flow-channel-conditional.d.ts +0 -14
- package/lib/cjs/content-fields/flow-channel-conditional.js +0 -57
- package/lib/cjs/content-fields/flow-channel-conditional.js.map +0 -1
- package/lib/cjs/content-fields/flow-country-conditional.js +0 -59
- package/lib/cjs/content-fields/flow-country-conditional.js.map +0 -1
- package/lib/cjs/content-fields/flow-custom-conditional.js +0 -89
- package/lib/cjs/content-fields/flow-custom-conditional.js.map +0 -1
- package/lib/cjs/content-fields/flow-element.js +0 -50
- package/lib/cjs/content-fields/flow-element.js.map +0 -1
- package/lib/cjs/content-fields/flow-go-to-flow.d.ts +0 -13
- package/lib/cjs/content-fields/flow-go-to-flow.js +0 -51
- package/lib/cjs/content-fields/flow-go-to-flow.js.map +0 -1
- package/lib/cjs/content-fields/flow-handoff.js.map +0 -1
- package/lib/cjs/content-fields/flow-image.js +0 -33
- package/lib/cjs/content-fields/flow-image.js.map +0 -1
- package/lib/cjs/content-fields/flow-queue-status-conditional.js.map +0 -1
- package/lib/cjs/content-fields/flow-rating.d.ts +0 -15
- package/lib/cjs/content-fields/flow-rating.js +0 -66
- package/lib/cjs/content-fields/flow-rating.js.map +0 -1
- package/lib/cjs/content-fields/flow-text.js +0 -60
- package/lib/cjs/content-fields/flow-text.js.map +0 -1
- package/lib/cjs/content-fields/flow-video.d.ts +0 -10
- package/lib/cjs/content-fields/flow-video.js +0 -33
- package/lib/cjs/content-fields/flow-video.js.map +0 -1
- package/lib/cjs/content-fields/flow-webview.d.ts +0 -16
- package/lib/cjs/content-fields/flow-webview.js.map +0 -1
- package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.d.ts +0 -21
- package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js +0 -92
- package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js.map +0 -1
- package/lib/cjs/content-fields/flow-whatsapp-request-contact-info.d.ts +0 -11
- package/lib/cjs/content-fields/flow-whatsapp-request-contact-info.js +0 -45
- package/lib/cjs/content-fields/flow-whatsapp-request-contact-info.js.map +0 -1
- package/lib/cjs/content-fields/flow-whatsapp-template.js +0 -264
- package/lib/cjs/content-fields/flow-whatsapp-template.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/ai-agent-router.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/ai-agent-router.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/ai-agent.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/ai-agent.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/bot-action.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/bot-action.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/button.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/button.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/capture-user-input.js +0 -12
- package/lib/cjs/content-fields/hubtype-fields/capture-user-input.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/carousel.d.ts +0 -17
- package/lib/cjs/content-fields/hubtype-fields/carousel.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/carousel.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/channel-conditional.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/channel-conditional.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/common.d.ts +0 -83
- package/lib/cjs/content-fields/hubtype-fields/common.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/common.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/country-conditional.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/country-conditional.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.d.ts +0 -56
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.js +0 -36
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional.d.ts +0 -11
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/fallback.d.ts +0 -9
- package/lib/cjs/content-fields/hubtype-fields/fallback.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/fallback.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/function.d.ts +0 -30
- package/lib/cjs/content-fields/hubtype-fields/function.js +0 -11
- package/lib/cjs/content-fields/hubtype-fields/function.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/go-to-flow.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/go-to-flow.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/handoff.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/handoff.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/image.d.ts +0 -8
- package/lib/cjs/content-fields/hubtype-fields/image.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/image.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/index.d.ts +0 -27
- package/lib/cjs/content-fields/hubtype-fields/index.js +0 -31
- package/lib/cjs/content-fields/hubtype-fields/index.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/keyword.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/keyword.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/node-types.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/nodes.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/nodes.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/payload.d.ts +0 -8
- package/lib/cjs/content-fields/hubtype-fields/payload.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/payload.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.d.ts +0 -25
- package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/rating.d.ts +0 -23
- package/lib/cjs/content-fields/hubtype-fields/rating.js +0 -9
- package/lib/cjs/content-fields/hubtype-fields/rating.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/smart-intent.d.ts +0 -12
- package/lib/cjs/content-fields/hubtype-fields/smart-intent.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/smart-intent.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/text.d.ts +0 -11
- package/lib/cjs/content-fields/hubtype-fields/text.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/text.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/url.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/url.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/video.d.ts +0 -8
- package/lib/cjs/content-fields/hubtype-fields/video.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/video.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/webview.d.ts +0 -17
- package/lib/cjs/content-fields/hubtype-fields/webview.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/webview.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.d.ts +0 -21
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-request-contact-info.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.js +0 -9
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.js.map +0 -1
- package/lib/cjs/content-fields/index.d.ts +0 -25
- package/lib/cjs/content-fields/index.js +0 -52
- package/lib/cjs/content-fields/index.js.map +0 -1
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +0 -41
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +0 -1
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +0 -36
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +0 -1
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +0 -14
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +0 -46
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +0 -1
- package/lib/cjs/content-fields/whatsapp-button-list/index.d.ts +0 -3
- package/lib/cjs/content-fields/whatsapp-button-list/index.js +0 -10
- package/lib/cjs/content-fields/whatsapp-button-list/index.js.map +0 -1
- package/lib/cjs/filters/index.js +0 -17
- package/lib/cjs/filters/index.js.map +0 -1
- package/lib/cjs/flow-factory.js +0 -69
- package/lib/cjs/flow-factory.js.map +0 -1
- package/lib/cjs/functions/index.d.ts +0 -11
- package/lib/cjs/functions/index.js.map +0 -1
- package/lib/cjs/index.js +0 -178
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/services/hubtype-queues-api.js +0 -26
- package/lib/cjs/services/hubtype-queues-api.js.map +0 -1
- package/lib/cjs/structured-output/flow-builder-content.js +0 -15
- package/lib/cjs/structured-output/flow-builder-content.js.map +0 -1
- package/lib/cjs/tracking.js.map +0 -1
- package/lib/cjs/types.d.ts +0 -62
- package/lib/cjs/types.js +0 -14
- package/lib/cjs/types.js.map +0 -1
- package/lib/cjs/user-input/capture-user-input-api.d.ts +0 -21
- package/lib/cjs/user-input/capture-user-input-api.js.map +0 -1
- package/lib/cjs/user-input/index.d.ts +0 -4
- package/lib/cjs/user-input/index.js +0 -37
- package/lib/cjs/user-input/index.js.map +0 -1
- package/lib/cjs/user-input/keyword.d.ts +0 -27
- package/lib/cjs/user-input/keyword.js +0 -84
- package/lib/cjs/user-input/keyword.js.map +0 -1
- package/lib/cjs/user-input/smart-intent.js.map +0 -1
- package/lib/cjs/utils/ai-agent.js +0 -28
- package/lib/cjs/utils/ai-agent.js.map +0 -1
- package/lib/cjs/utils/authentication.js.map +0 -1
- package/lib/cjs/utils/flow-locale.js.map +0 -1
- package/lib/cjs/utils/get-flow-builder-plugin.js.map +0 -1
- package/lib/cjs/utils/hubtype-assistant-content.js.map +0 -1
- package/lib/cjs/utils/input.js +0 -35
- package/lib/cjs/utils/input.js.map +0 -1
- package/lib/cjs/webview/contents-context.js +0 -12
- package/lib/cjs/webview/contents-context.js.map +0 -1
- package/lib/cjs/webview/index.d.ts +0 -3
- package/lib/cjs/webview/index.js +0 -10
- package/lib/cjs/webview/index.js.map +0 -1
- package/lib/cjs/webview/types.d.ts +0 -47
- package/lib/cjs/webview/types.js +0 -9
- package/lib/cjs/webview/types.js.map +0 -1
- package/lib/cjs/webview/use-webview-contents.js +0 -83
- package/lib/cjs/webview/use-webview-contents.js.map +0 -1
- package/lib/esm/action/ai-agent-from-user-input.d.ts +0 -3
- package/lib/esm/action/ai-agent-from-user-input.js +0 -32
- package/lib/esm/action/ai-agent-from-user-input.js.map +0 -1
- package/lib/esm/action/context.js +0 -17
- package/lib/esm/action/context.js.map +0 -1
- package/lib/esm/action/fallback.d.ts +0 -3
- package/lib/esm/action/fallback.js +0 -36
- package/lib/esm/action/fallback.js.map +0 -1
- package/lib/esm/action/first-interaction.d.ts +0 -3
- package/lib/esm/action/first-interaction.js +0 -88
- package/lib/esm/action/first-interaction.js.map +0 -1
- package/lib/esm/action/get-contents.d.ts +0 -3
- package/lib/esm/action/get-contents.js +0 -39
- package/lib/esm/action/get-contents.js.map +0 -1
- package/lib/esm/action/index.js.map +0 -1
- package/lib/esm/action/payload.d.ts +0 -3
- package/lib/esm/action/payload.js +0 -74
- package/lib/esm/action/payload.js.map +0 -1
- package/lib/esm/api.d.ts +0 -40
- package/lib/esm/api.js.map +0 -1
- package/lib/esm/constants.d.ts +0 -13
- package/lib/esm/constants.js +0 -19
- package/lib/esm/constants.js.map +0 -1
- package/lib/esm/content-fields/content-fields-base.js +0 -74
- package/lib/esm/content-fields/content-fields-base.js.map +0 -1
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +0 -71
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +0 -1
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.js +0 -58
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +0 -1
- package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.d.ts +0 -17
- package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.js +0 -79
- package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.js.map +0 -1
- package/lib/esm/content-fields/flow-ai-agent-base.js +0 -97
- package/lib/esm/content-fields/flow-ai-agent-base.js.map +0 -1
- package/lib/esm/content-fields/flow-ai-agent-router.js.map +0 -1
- package/lib/esm/content-fields/flow-ai-agent.d.ts +0 -17
- package/lib/esm/content-fields/flow-ai-agent.js +0 -64
- package/lib/esm/content-fields/flow-ai-agent.js.map +0 -1
- package/lib/esm/content-fields/flow-bot-action.js.map +0 -1
- package/lib/esm/content-fields/flow-button.js.map +0 -1
- package/lib/esm/content-fields/flow-capture-user-input.d.ts +0 -14
- package/lib/esm/content-fields/flow-capture-user-input.js +0 -45
- package/lib/esm/content-fields/flow-capture-user-input.js.map +0 -1
- package/lib/esm/content-fields/flow-carousel.js +0 -152
- package/lib/esm/content-fields/flow-carousel.js.map +0 -1
- package/lib/esm/content-fields/flow-channel-conditional.js.map +0 -1
- package/lib/esm/content-fields/flow-country-conditional.d.ts +0 -13
- package/lib/esm/content-fields/flow-country-conditional.js.map +0 -1
- package/lib/esm/content-fields/flow-custom-conditional.d.ts +0 -17
- package/lib/esm/content-fields/flow-custom-conditional.js.map +0 -1
- package/lib/esm/content-fields/flow-element.d.ts +0 -22
- package/lib/esm/content-fields/flow-element.js +0 -50
- package/lib/esm/content-fields/flow-element.js.map +0 -1
- package/lib/esm/content-fields/flow-go-to-flow.js.map +0 -1
- package/lib/esm/content-fields/flow-handoff.d.ts +0 -17
- package/lib/esm/content-fields/flow-handoff.js +0 -68
- package/lib/esm/content-fields/flow-handoff.js.map +0 -1
- package/lib/esm/content-fields/flow-image.d.ts +0 -10
- package/lib/esm/content-fields/flow-image.js +0 -33
- package/lib/esm/content-fields/flow-image.js.map +0 -1
- package/lib/esm/content-fields/flow-queue-status-conditional.d.ts +0 -30
- package/lib/esm/content-fields/flow-queue-status-conditional.js +0 -95
- package/lib/esm/content-fields/flow-queue-status-conditional.js.map +0 -1
- package/lib/esm/content-fields/flow-rating.js +0 -66
- package/lib/esm/content-fields/flow-rating.js.map +0 -1
- package/lib/esm/content-fields/flow-text.d.ts +0 -15
- package/lib/esm/content-fields/flow-text.js +0 -60
- package/lib/esm/content-fields/flow-text.js.map +0 -1
- package/lib/esm/content-fields/flow-video.js +0 -33
- package/lib/esm/content-fields/flow-video.js.map +0 -1
- package/lib/esm/content-fields/flow-webview.js +0 -78
- package/lib/esm/content-fields/flow-webview.js.map +0 -1
- package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js +0 -92
- package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js.map +0 -1
- package/lib/esm/content-fields/flow-whatsapp-request-contact-info.js +0 -45
- package/lib/esm/content-fields/flow-whatsapp-request-contact-info.js.map +0 -1
- package/lib/esm/content-fields/flow-whatsapp-template.d.ts +0 -37
- package/lib/esm/content-fields/flow-whatsapp-template.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/ai-agent-router.d.ts +0 -21
- package/lib/esm/content-fields/hubtype-fields/ai-agent-router.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/ai-agent-router.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/ai-agent.d.ts +0 -25
- package/lib/esm/content-fields/hubtype-fields/ai-agent.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/ai-agent.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/bot-action.d.ts +0 -10
- package/lib/esm/content-fields/hubtype-fields/bot-action.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/bot-action.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/button.d.ts +0 -8
- package/lib/esm/content-fields/hubtype-fields/button.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/button.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/capture-user-input.d.ts +0 -19
- package/lib/esm/content-fields/hubtype-fields/capture-user-input.js +0 -12
- package/lib/esm/content-fields/hubtype-fields/capture-user-input.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/carousel.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/carousel.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/channel-conditional.d.ts +0 -10
- package/lib/esm/content-fields/hubtype-fields/channel-conditional.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/channel-conditional.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/common.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/common.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/country-conditional.d.ts +0 -10
- package/lib/esm/content-fields/hubtype-fields/country-conditional.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/country-conditional.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/custom-conditional-v2.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/custom-conditional.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/custom-conditional.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/fallback.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/fallback.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/function.js +0 -11
- package/lib/esm/content-fields/hubtype-fields/function.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/go-to-flow.d.ts +0 -9
- package/lib/esm/content-fields/hubtype-fields/go-to-flow.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/go-to-flow.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/handoff.d.ts +0 -11
- package/lib/esm/content-fields/hubtype-fields/handoff.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/handoff.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/image.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/image.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/index.d.ts +0 -27
- package/lib/esm/content-fields/hubtype-fields/index.js +0 -31
- package/lib/esm/content-fields/hubtype-fields/index.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/keyword.d.ts +0 -9
- package/lib/esm/content-fields/hubtype-fields/keyword.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/keyword.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/node-types.d.ts +0 -31
- package/lib/esm/content-fields/hubtype-fields/node-types.js +0 -38
- package/lib/esm/content-fields/hubtype-fields/node-types.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/nodes.d.ts +0 -26
- package/lib/esm/content-fields/hubtype-fields/nodes.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/nodes.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/payload.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/payload.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/rating.js +0 -9
- package/lib/esm/content-fields/hubtype-fields/rating.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/smart-intent.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/smart-intent.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/text.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/text.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/url.d.ts +0 -8
- package/lib/esm/content-fields/hubtype-fields/url.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/url.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/video.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/video.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/webview.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/webview.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.d.ts +0 -17
- package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.d.ts +0 -8
- package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/whatsapp-template.d.ts +0 -96
- package/lib/esm/content-fields/hubtype-fields/whatsapp-template.js +0 -9
- package/lib/esm/content-fields/hubtype-fields/whatsapp-template.js.map +0 -1
- package/lib/esm/content-fields/index.d.ts +0 -25
- package/lib/esm/content-fields/index.js +0 -52
- package/lib/esm/content-fields/index.js.map +0 -1
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +0 -14
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +0 -1
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +0 -13
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +0 -36
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +0 -1
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +0 -46
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +0 -1
- package/lib/esm/content-fields/whatsapp-button-list/index.js +0 -10
- package/lib/esm/content-fields/whatsapp-button-list/index.js.map +0 -1
- package/lib/esm/filters/index.d.ts +0 -12
- package/lib/esm/filters/index.js +0 -17
- package/lib/esm/filters/index.js.map +0 -1
- package/lib/esm/flow-factory.d.ts +0 -12
- package/lib/esm/flow-factory.js +0 -69
- package/lib/esm/flow-factory.js.map +0 -1
- package/lib/esm/functions/index.js +0 -49
- package/lib/esm/functions/index.js.map +0 -1
- package/lib/esm/index.d.ts +0 -45
- package/lib/esm/index.js.map +0 -1
- package/lib/esm/services/hubtype-queues-api.d.ts +0 -14
- package/lib/esm/services/hubtype-queues-api.js +0 -26
- package/lib/esm/services/hubtype-queues-api.js.map +0 -1
- package/lib/esm/structured-output/flow-builder-content.d.ts +0 -13
- package/lib/esm/structured-output/flow-builder-content.js +0 -15
- package/lib/esm/structured-output/flow-builder-content.js.map +0 -1
- package/lib/esm/tracking.d.ts +0 -16
- package/lib/esm/tracking.js +0 -71
- package/lib/esm/tracking.js.map +0 -1
- package/lib/esm/types.js +0 -14
- package/lib/esm/types.js.map +0 -1
- package/lib/esm/user-input/capture-user-input-api.js +0 -88
- package/lib/esm/user-input/capture-user-input-api.js.map +0 -1
- package/lib/esm/user-input/index.js +0 -37
- package/lib/esm/user-input/index.js.map +0 -1
- package/lib/esm/user-input/keyword.js.map +0 -1
- package/lib/esm/user-input/smart-intent.d.ts +0 -24
- package/lib/esm/user-input/smart-intent.js +0 -89
- package/lib/esm/user-input/smart-intent.js.map +0 -1
- package/lib/esm/utils/ai-agent.d.ts +0 -11
- package/lib/esm/utils/ai-agent.js +0 -28
- package/lib/esm/utils/ai-agent.js.map +0 -1
- package/lib/esm/utils/authentication.d.ts +0 -2
- package/lib/esm/utils/authentication.js +0 -21
- package/lib/esm/utils/authentication.js.map +0 -1
- package/lib/esm/utils/flow-locale.d.ts +0 -22
- package/lib/esm/utils/flow-locale.js +0 -79
- package/lib/esm/utils/flow-locale.js.map +0 -1
- package/lib/esm/utils/get-flow-builder-plugin.d.ts +0 -3
- package/lib/esm/utils/get-flow-builder-plugin.js +0 -16
- package/lib/esm/utils/get-flow-builder-plugin.js.map +0 -1
- package/lib/esm/utils/hubtype-assistant-content.d.ts +0 -13
- package/lib/esm/utils/hubtype-assistant-content.js +0 -184
- package/lib/esm/utils/hubtype-assistant-content.js.map +0 -1
- package/lib/esm/utils/input.d.ts +0 -6
- package/lib/esm/utils/input.js +0 -35
- package/lib/esm/utils/input.js.map +0 -1
- package/lib/esm/webview/contents-context.d.ts +0 -2
- package/lib/esm/webview/contents-context.js +0 -12
- package/lib/esm/webview/contents-context.js.map +0 -1
- package/lib/esm/webview/index.d.ts +0 -3
- package/lib/esm/webview/index.js +0 -10
- package/lib/esm/webview/index.js.map +0 -1
- package/lib/esm/webview/types.js +0 -9
- package/lib/esm/webview/types.js.map +0 -1
- package/lib/esm/webview/use-webview-contents.d.ts +0 -2
- package/lib/esm/webview/use-webview-contents.js +0 -83
- package/lib/esm/webview/use-webview-contents.js.map +0 -1
- /package/lib/{cjs/constants.d.ts → constants.d.ts} +0 -0
- /package/lib/{cjs/content-fields → content-fields}/hubtype-fields/node-types.d.ts +0 -0
- /package/lib/{cjs/services → services}/hubtype-queues-api.d.ts +0 -0
- /package/lib/{cjs/structured-output → structured-output}/flow-builder-content.d.ts +0 -0
- /package/lib/{cjs/utils → utils}/authentication.d.ts +0 -0
- /package/lib/{cjs/utils → utils}/flow-locale.d.ts +0 -0
- /package/lib/{cjs/utils → utils}/input.d.ts +0 -0
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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 {
|
|
10
18
|
static fromHubtypeCMS(component, botContext) {
|
|
11
19
|
const newAiAgent = new FlowAiAgent(component.id);
|
|
12
20
|
newAiAgent.code = component.code;
|
|
@@ -15,33 +23,34 @@ class FlowAiAgent extends flow_ai_agent_base_1.FlowAiAgentBase {
|
|
|
15
23
|
newAiAgent.model = component.content.model;
|
|
16
24
|
newAiAgent.verbosity = component.content.verbosity;
|
|
17
25
|
newAiAgent.activeTools = component.content.active_tools;
|
|
18
|
-
newAiAgent.inputGuardrailRules =
|
|
19
|
-
component.content.input_guardrail_rules || [];
|
|
26
|
+
newAiAgent.inputGuardrailRules = component.content.input_guardrail_rules || [];
|
|
20
27
|
newAiAgent.sources = component.content.sources;
|
|
21
28
|
newAiAgent.followUp = component.follow_up;
|
|
22
29
|
return newAiAgent;
|
|
23
30
|
}
|
|
24
31
|
async getAIAgentResponse(botContext, previousContents) {
|
|
25
32
|
const activeInputGuardrailRules = this.getActiveInputGuardrailRules(this.inputGuardrailRules);
|
|
26
|
-
const flowBuilderPlugin =
|
|
33
|
+
const flowBuilderPlugin = getFlowBuilderPlugin(botContext.plugins);
|
|
27
34
|
const aiAgentResponse = await flowBuilderPlugin.getAiAgentResponse?.(botContext, {
|
|
28
|
-
type:
|
|
35
|
+
type: AiAgentType.Specialist,
|
|
29
36
|
name: this.name,
|
|
30
37
|
instructions: this.instructions,
|
|
31
38
|
model: this.model,
|
|
32
39
|
verbosity: this.verbosity,
|
|
33
40
|
activeTools: this.activeTools ?? [],
|
|
34
41
|
inputGuardrailRules: activeInputGuardrailRules,
|
|
35
|
-
sourceIds: this.sources?.map(source
|
|
36
|
-
outputMessagesSchemas: [
|
|
37
|
-
|
|
42
|
+
sourceIds: this.sources?.map((source)=>source.id) ?? [],
|
|
43
|
+
outputMessagesSchemas: [
|
|
44
|
+
FlowBuilderContentSchema
|
|
45
|
+
],
|
|
46
|
+
previousHubtypeMessages: this.getPreviousHubtypeContents(previousContents)
|
|
38
47
|
});
|
|
39
48
|
return aiAgentResponse;
|
|
40
49
|
}
|
|
41
50
|
async trackAiAgentResponse(botContext) {
|
|
42
|
-
const { flowThreadId, flowId, flowName, flowNodeId } =
|
|
51
|
+
const { flowThreadId, flowId, flowName, flowNodeId } = getCommonFlowContentEventArgsForContentId(botContext, this.id);
|
|
43
52
|
const event = {
|
|
44
|
-
action:
|
|
53
|
+
action: EventAction.AiAgent,
|
|
45
54
|
flowThreadId: flowThreadId,
|
|
46
55
|
flowId: flowId,
|
|
47
56
|
flowName: flowName,
|
|
@@ -53,12 +62,14 @@ class FlowAiAgent extends flow_ai_agent_base_1.FlowAiAgentBase {
|
|
|
53
62
|
inputMessageId: botContext.input.message_id,
|
|
54
63
|
exit: this.aiAgentResponse?.exit ?? true,
|
|
55
64
|
inputGuardrailsTriggered: this.aiAgentResponse?.inputGuardrailsTriggered ?? [],
|
|
56
|
-
outputGuardrailsTriggered: [],
|
|
57
|
-
error: this.aiAgentResponse?.error ?? false
|
|
65
|
+
outputGuardrailsTriggered: [],
|
|
66
|
+
error: this.aiAgentResponse?.error ?? false
|
|
58
67
|
};
|
|
59
68
|
const { action, ...eventArgs } = event;
|
|
60
|
-
await
|
|
69
|
+
await trackEvent(botContext, action, eventArgs);
|
|
61
70
|
}
|
|
62
71
|
}
|
|
63
|
-
|
|
72
|
+
|
|
73
|
+
export { FlowAiAgent };
|
|
74
|
+
|
|
64
75
|
//# sourceMappingURL=flow-ai-agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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 }\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;QACxC;QACA,MAAM,EAAEY,MAAM,EAAE,GAAGC,WAAW,GAAGF;QAEjC,MAAMhB,UAAUA,CAACK,YAAYY,QAAQC;IACvC;AACF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type BotContext } from '@botonic/core';
|
|
2
2
|
import type { ActionRequest } from '@botonic/react';
|
|
3
|
-
import type { FlowBuilderApi } from '../api';
|
|
4
|
-
import { ContentFieldsBase } from './content-fields-base';
|
|
5
|
-
import type { HtBotActionNode } from './hubtype-fields';
|
|
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
6
|
export declare class FlowBotAction extends ContentFieldsBase {
|
|
7
7
|
code: string;
|
|
8
8
|
payload: string;
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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 {
|
|
9
15
|
static fromHubtypeCMS(cmsBotAction, cmsApi) {
|
|
10
16
|
const newBotAction = new FlowBotAction(cmsBotAction.id);
|
|
11
17
|
newBotAction.code = cmsBotAction.code;
|
|
@@ -14,22 +20,22 @@ class FlowBotAction extends content_fields_base_1.ContentFieldsBase {
|
|
|
14
20
|
return newBotAction;
|
|
15
21
|
}
|
|
16
22
|
async trackFlow(botContext) {
|
|
17
|
-
const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } =
|
|
23
|
+
const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } = getCommonFlowContentEventArgsForContentId(botContext, this.id);
|
|
18
24
|
const eventBotAction = {
|
|
19
|
-
action:
|
|
25
|
+
action: EventAction.BotAction,
|
|
20
26
|
flowThreadId,
|
|
21
27
|
flowId,
|
|
22
28
|
flowName,
|
|
23
29
|
flowNodeId,
|
|
24
30
|
flowNodeContentId,
|
|
25
31
|
flowNodeIsMeaningful: false,
|
|
26
|
-
payload: this.payload
|
|
32
|
+
payload: this.payload
|
|
27
33
|
};
|
|
28
34
|
const { action, ...eventArgs } = eventBotAction;
|
|
29
|
-
await
|
|
35
|
+
await trackEvent(botContext, action, eventArgs);
|
|
30
36
|
}
|
|
31
37
|
doBotAction(botContext) {
|
|
32
|
-
botContext.session._botonic_action = `${
|
|
38
|
+
botContext.session._botonic_action = `${BotonicAction.Redirect}:${this.payload}`;
|
|
33
39
|
}
|
|
34
40
|
async processContent(botContext) {
|
|
35
41
|
await this.filterContent(botContext, this);
|
|
@@ -38,8 +44,10 @@ class FlowBotAction extends content_fields_base_1.ContentFieldsBase {
|
|
|
38
44
|
return;
|
|
39
45
|
}
|
|
40
46
|
toBotonic() {
|
|
41
|
-
return
|
|
47
|
+
return /*#__PURE__*/ jsx(Fragment, {});
|
|
42
48
|
}
|
|
43
49
|
}
|
|
44
|
-
|
|
50
|
+
|
|
51
|
+
export { FlowBotAction };
|
|
52
|
+
|
|
45
53
|
//# sourceMappingURL=flow-bot-action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,10 +1,10 @@
|
|
|
1
1
|
import type { BotContext } from '@botonic/core';
|
|
2
2
|
import { type Webview } from '@botonic/react';
|
|
3
|
-
import type { FlowBuilderApi } from '../api';
|
|
4
|
-
import { ContentFieldsBase } from './content-fields-base';
|
|
5
|
-
import { FlowWebview } from './flow-webview';
|
|
6
|
-
import { type HtButton, HtButtonStyle } from './hubtype-fields';
|
|
7
|
-
import type { HtRatingButton } from './hubtype-fields/rating';
|
|
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
8
|
export declare class FlowButton extends ContentFieldsBase {
|
|
9
9
|
text: string;
|
|
10
10
|
url?: string;
|
|
@@ -1,17 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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 {
|
|
15
21
|
static fromHubtypeCMS(cmsButton, locale, cmsApi, botContext) {
|
|
16
22
|
const urlId = FlowButton.getUrlId(cmsButton, locale);
|
|
17
23
|
const newButton = new FlowButton(cmsButton.id);
|
|
@@ -20,10 +26,11 @@ class FlowButton extends content_fields_base_1.ContentFieldsBase {
|
|
|
20
26
|
const webview = FlowButton.getTargetWebview(cmsApi, cmsButton.target.id);
|
|
21
27
|
if (webview) {
|
|
22
28
|
newButton.flowWebview = webview;
|
|
23
|
-
newButton.webview = {
|
|
29
|
+
newButton.webview = {
|
|
30
|
+
name: webview.webviewComponentName
|
|
31
|
+
};
|
|
24
32
|
newButton.params = webview.getParams(botContext);
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
33
|
+
} else {
|
|
27
34
|
newButton.payload = cmsApi.getPayload(cmsButton.target);
|
|
28
35
|
}
|
|
29
36
|
}
|
|
@@ -39,8 +46,7 @@ class FlowButton extends content_fields_base_1.ContentFieldsBase {
|
|
|
39
46
|
if (button.url) {
|
|
40
47
|
newButton.url = button.url;
|
|
41
48
|
newButton.target = button.target;
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
49
|
+
} else {
|
|
44
50
|
newButton.payload = button.payload;
|
|
45
51
|
}
|
|
46
52
|
return newButton;
|
|
@@ -53,14 +59,14 @@ class FlowButton extends content_fields_base_1.ContentFieldsBase {
|
|
|
53
59
|
return newButton;
|
|
54
60
|
}
|
|
55
61
|
static getUrlId(cmsButton, locale) {
|
|
56
|
-
return cmsButton.url.find(url
|
|
62
|
+
return cmsButton.url.find((url)=>url.locale === locale)?.id;
|
|
57
63
|
}
|
|
58
64
|
static getTargetWebview(cmsApi, targetId) {
|
|
59
65
|
const targetNode = cmsApi.getNodeById(targetId);
|
|
60
|
-
if (targetNode.type !==
|
|
66
|
+
if (targetNode.type !== HtNodeWithContentType.WEBVIEW) {
|
|
61
67
|
return undefined;
|
|
62
68
|
}
|
|
63
|
-
return
|
|
69
|
+
return FlowWebview.fromHubtypeCMS(targetNode);
|
|
64
70
|
}
|
|
65
71
|
async trackFlow(botContext) {
|
|
66
72
|
if (this.flowWebview) {
|
|
@@ -71,16 +77,29 @@ class FlowButton extends content_fields_base_1.ContentFieldsBase {
|
|
|
71
77
|
return;
|
|
72
78
|
}
|
|
73
79
|
renderButton(buttonIndex, buttonStyle) {
|
|
74
|
-
if (buttonStyle ===
|
|
75
|
-
return
|
|
80
|
+
if (buttonStyle === HtButtonStyle.QUICK_REPLY) {
|
|
81
|
+
return /*#__PURE__*/ jsx(Reply, {
|
|
82
|
+
payload: this.getButtonPayload(buttonIndex),
|
|
83
|
+
children: this.text
|
|
84
|
+
}, this.id);
|
|
76
85
|
}
|
|
77
|
-
return
|
|
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);
|
|
78
94
|
}
|
|
79
95
|
getButtonPayload(buttonIndex) {
|
|
80
|
-
return this.payload
|
|
81
|
-
|
|
82
|
-
|
|
96
|
+
return this.payload ? `${this.payload}${SOURCE_INFO_SEPARATOR}${buttonIndex}` : undefined;
|
|
97
|
+
}
|
|
98
|
+
constructor(...args){
|
|
99
|
+
super(...args), this.text = '';
|
|
83
100
|
}
|
|
84
101
|
}
|
|
85
|
-
|
|
102
|
+
|
|
103
|
+
export { FlowButton };
|
|
104
|
+
|
|
86
105
|
//# sourceMappingURL=flow-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,6 +1,6 @@
|
|
|
1
1
|
import type { BotContext } from '@botonic/core';
|
|
2
|
-
import { ContentFieldsBase } from './content-fields-base';
|
|
3
|
-
import { HtAiValidationType, type HtCaptureUserInputNode } from './hubtype-fields/capture-user-input';
|
|
2
|
+
import { ContentFieldsBase } from './content-fields-base.js';
|
|
3
|
+
import { HtAiValidationType, type HtCaptureUserInputNode } from './hubtype-fields/capture-user-input.js';
|
|
4
4
|
export declare class FlowCaptureUserInput extends ContentFieldsBase {
|
|
5
5
|
fieldName: string;
|
|
6
6
|
aiValidationType: HtAiValidationType;
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,9 +1,9 @@
|
|
|
1
1
|
import { type BotContext, type CarouselMessage } from '@botonic/core';
|
|
2
2
|
import { type ActionRequest } from '@botonic/react';
|
|
3
|
-
import type { FlowBuilderApi } from '../api';
|
|
4
|
-
import { ContentFieldsBase } from './content-fields-base';
|
|
5
|
-
import { FlowElement } from './flow-element';
|
|
6
|
-
import type { HtCarouselNode } from './hubtype-fields';
|
|
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
7
|
export declare class FlowCarousel extends ContentFieldsBase {
|
|
8
8
|
whatsappText: string;
|
|
9
9
|
elements: FlowElement[];
|
|
@@ -0,0 +1,193 @@
|
|
|
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
|