@botonic/plugin-flow-builder 0.44.2 → 0.45.0-alpha.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/lib/cjs/action/ai-agent.d.ts +2 -2
- package/lib/cjs/action/ai-agent.js.map +1 -1
- package/lib/cjs/action/fallback.d.ts +2 -2
- package/lib/cjs/action/fallback.js.map +1 -1
- package/lib/cjs/action/first-interaction.d.ts +2 -2
- package/lib/cjs/action/first-interaction.js +1 -1
- package/lib/cjs/action/first-interaction.js.map +1 -1
- package/lib/cjs/action/index.d.ts +4 -4
- package/lib/cjs/action/index.js.map +1 -1
- package/lib/cjs/action/knowledge-bases.d.ts +2 -2
- package/lib/cjs/action/payload.d.ts +2 -2
- package/lib/cjs/action/payload.js.map +1 -1
- package/lib/cjs/api.d.ts +3 -3
- package/lib/cjs/api.js +10 -5
- package/lib/cjs/api.js.map +1 -1
- package/lib/cjs/content-fields/content-fields-base.d.ts +4 -2
- package/lib/cjs/content-fields/content-fields-base.js +21 -2
- package/lib/cjs/content-fields/content-fields-base.js.map +1 -1
- package/lib/cjs/content-fields/flow-ai-agent.d.ts +3 -3
- package/lib/cjs/content-fields/flow-ai-agent.js +3 -1
- package/lib/cjs/content-fields/flow-ai-agent.js.map +1 -1
- package/lib/cjs/content-fields/flow-bot-action.d.ts +3 -3
- package/lib/cjs/content-fields/flow-bot-action.js.map +1 -1
- package/lib/cjs/content-fields/flow-button.d.ts +4 -4
- package/lib/cjs/content-fields/flow-button.js +6 -5
- package/lib/cjs/content-fields/flow-button.js.map +1 -1
- package/lib/cjs/content-fields/flow-capture-user-input.d.ts +2 -2
- package/lib/cjs/content-fields/flow-carousel.d.ts +4 -4
- package/lib/cjs/content-fields/flow-carousel.js +1 -1
- package/lib/cjs/content-fields/flow-carousel.js.map +1 -1
- package/lib/cjs/content-fields/flow-channel-conditional.d.ts +3 -3
- package/lib/cjs/content-fields/flow-channel-conditional.js.map +1 -1
- package/lib/cjs/content-fields/flow-country-conditional.d.ts +3 -3
- package/lib/cjs/content-fields/flow-country-conditional.js.map +1 -1
- package/lib/cjs/content-fields/flow-custom-conditional.d.ts +3 -3
- package/lib/cjs/content-fields/flow-custom-conditional.js +1 -2
- package/lib/cjs/content-fields/flow-custom-conditional.js.map +1 -1
- package/lib/cjs/content-fields/flow-element.d.ts +4 -4
- package/lib/cjs/content-fields/flow-element.js +3 -3
- package/lib/cjs/content-fields/flow-element.js.map +1 -1
- package/lib/cjs/content-fields/flow-go-to-flow.d.ts +3 -3
- package/lib/cjs/content-fields/flow-go-to-flow.js.map +1 -1
- package/lib/cjs/content-fields/flow-handoff.d.ts +3 -3
- package/lib/cjs/content-fields/flow-handoff.js +2 -2
- package/lib/cjs/content-fields/flow-handoff.js.map +1 -1
- package/lib/cjs/content-fields/flow-image.d.ts +2 -2
- package/lib/cjs/content-fields/flow-image.js +1 -1
- package/lib/cjs/content-fields/flow-image.js.map +1 -1
- package/lib/cjs/content-fields/flow-knowledge-base.d.ts +2 -2
- package/lib/cjs/content-fields/flow-knowledge-base.js.map +1 -1
- package/lib/cjs/content-fields/flow-queue-status-conditional.d.ts +3 -3
- package/lib/cjs/content-fields/flow-queue-status-conditional.js.map +1 -1
- package/lib/cjs/content-fields/flow-rating.d.ts +2 -2
- package/lib/cjs/content-fields/flow-rating.js +3 -3
- package/lib/cjs/content-fields/flow-rating.js.map +1 -1
- package/lib/cjs/content-fields/flow-text.d.ts +5 -5
- package/lib/cjs/content-fields/flow-text.js +1 -1
- package/lib/cjs/content-fields/flow-text.js.map +1 -1
- package/lib/cjs/content-fields/flow-video.d.ts +2 -2
- package/lib/cjs/content-fields/flow-video.js +1 -1
- package/lib/cjs/content-fields/flow-video.js.map +1 -1
- package/lib/cjs/content-fields/flow-webview.d.ts +2 -2
- package/lib/cjs/content-fields/flow-webview.js.map +1 -1
- package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.d.ts +3 -3
- package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js +10 -6
- package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js.map +1 -1
- package/lib/cjs/content-fields/flow-whatsapp-template.d.ts +2 -2
- package/lib/cjs/content-fields/flow-whatsapp-template.js.map +1 -1
- package/lib/cjs/content-fields/hubtype-fields/ai-agent.d.ts +2 -2
- package/lib/cjs/content-fields/hubtype-fields/bot-action.d.ts +2 -2
- package/lib/cjs/content-fields/hubtype-fields/button.d.ts +1 -1
- package/lib/cjs/content-fields/hubtype-fields/capture-user-input.d.ts +2 -2
- package/lib/cjs/content-fields/hubtype-fields/carousel.d.ts +3 -3
- package/lib/cjs/content-fields/hubtype-fields/channel-conditional.d.ts +3 -3
- package/lib/cjs/content-fields/hubtype-fields/common.d.ts +2 -2
- package/lib/cjs/content-fields/hubtype-fields/country-conditional.d.ts +3 -3
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional.d.ts +3 -3
- package/lib/cjs/content-fields/hubtype-fields/fallback.d.ts +2 -2
- package/lib/cjs/content-fields/hubtype-fields/function.d.ts +2 -2
- package/lib/cjs/content-fields/hubtype-fields/go-to-flow.d.ts +2 -2
- package/lib/cjs/content-fields/hubtype-fields/handoff.d.ts +2 -2
- package/lib/cjs/content-fields/hubtype-fields/image.d.ts +2 -2
- package/lib/cjs/content-fields/hubtype-fields/keyword.d.ts +2 -2
- package/lib/cjs/content-fields/hubtype-fields/knowledge-base.d.ts +2 -2
- package/lib/cjs/content-fields/hubtype-fields/nodes.d.ts +21 -21
- package/lib/cjs/content-fields/hubtype-fields/payload.d.ts +1 -1
- package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.d.ts +3 -3
- package/lib/cjs/content-fields/hubtype-fields/rating.d.ts +2 -2
- package/lib/cjs/content-fields/hubtype-fields/smart-intent.d.ts +2 -2
- package/lib/cjs/content-fields/hubtype-fields/text.d.ts +3 -3
- package/lib/cjs/content-fields/hubtype-fields/url.d.ts +1 -1
- package/lib/cjs/content-fields/hubtype-fields/video.d.ts +2 -2
- package/lib/cjs/content-fields/hubtype-fields/webview.d.ts +2 -2
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.d.ts +2 -2
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.d.ts +4 -4
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.d.ts +4 -4
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +3 -3
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +2 -2
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +1 -1
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +3 -3
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +3 -2
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +1 -1
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +3 -3
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +3 -2
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +1 -1
- package/lib/cjs/filters/index.d.ts +3 -3
- package/lib/cjs/flow-factory.d.ts +4 -4
- package/lib/cjs/functions/index.d.ts +2 -2
- package/lib/cjs/helpers.d.ts +2 -2
- package/lib/cjs/index.d.ts +6 -5
- package/lib/cjs/index.js +5 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/tracking.d.ts +3 -3
- package/lib/cjs/tracking.js.map +1 -1
- package/lib/cjs/types.d.ts +4 -3
- package/lib/cjs/types.js.map +1 -1
- package/lib/cjs/user-input/capture-user-input-api.d.ts +3 -3
- package/lib/cjs/user-input/capture-user-input-api.js.map +1 -1
- package/lib/cjs/user-input/index.d.ts +3 -3
- package/lib/cjs/user-input/index.js.map +1 -1
- package/lib/cjs/user-input/keyword.d.ts +3 -3
- package/lib/cjs/user-input/keyword.js.map +1 -1
- package/lib/cjs/user-input/smart-intent.d.ts +3 -3
- package/lib/cjs/user-input/smart-intent.js +6 -3
- package/lib/cjs/user-input/smart-intent.js.map +1 -1
- package/lib/cjs/utils.d.ts +2 -3
- package/lib/cjs/utils.js +0 -21
- package/lib/cjs/utils.js.map +1 -1
- package/lib/cjs/webview/contents-context.d.ts +1 -1
- package/lib/cjs/webview/types.d.ts +1 -1
- package/lib/cjs/webview/use-webview-contents.d.ts +1 -1
- package/lib/esm/action/ai-agent.d.ts +2 -2
- package/lib/esm/action/ai-agent.js.map +1 -1
- package/lib/esm/action/fallback.d.ts +2 -2
- package/lib/esm/action/fallback.js.map +1 -1
- package/lib/esm/action/first-interaction.d.ts +2 -2
- package/lib/esm/action/first-interaction.js +1 -1
- package/lib/esm/action/first-interaction.js.map +1 -1
- package/lib/esm/action/index.d.ts +4 -4
- package/lib/esm/action/index.js.map +1 -1
- package/lib/esm/action/knowledge-bases.d.ts +2 -2
- package/lib/esm/action/payload.d.ts +2 -2
- package/lib/esm/action/payload.js.map +1 -1
- package/lib/esm/api.d.ts +3 -3
- package/lib/esm/api.js +10 -5
- package/lib/esm/api.js.map +1 -1
- package/lib/esm/content-fields/content-fields-base.d.ts +4 -2
- package/lib/esm/content-fields/content-fields-base.js +21 -2
- package/lib/esm/content-fields/content-fields-base.js.map +1 -1
- package/lib/esm/content-fields/flow-ai-agent.d.ts +3 -3
- package/lib/esm/content-fields/flow-ai-agent.js +3 -1
- package/lib/esm/content-fields/flow-ai-agent.js.map +1 -1
- package/lib/esm/content-fields/flow-bot-action.d.ts +3 -3
- package/lib/esm/content-fields/flow-bot-action.js.map +1 -1
- package/lib/esm/content-fields/flow-button.d.ts +4 -4
- package/lib/esm/content-fields/flow-button.js +6 -5
- package/lib/esm/content-fields/flow-button.js.map +1 -1
- package/lib/esm/content-fields/flow-capture-user-input.d.ts +2 -2
- package/lib/esm/content-fields/flow-carousel.d.ts +4 -4
- package/lib/esm/content-fields/flow-carousel.js +1 -1
- package/lib/esm/content-fields/flow-carousel.js.map +1 -1
- package/lib/esm/content-fields/flow-channel-conditional.d.ts +3 -3
- package/lib/esm/content-fields/flow-channel-conditional.js.map +1 -1
- package/lib/esm/content-fields/flow-country-conditional.d.ts +3 -3
- package/lib/esm/content-fields/flow-country-conditional.js.map +1 -1
- package/lib/esm/content-fields/flow-custom-conditional.d.ts +3 -3
- package/lib/esm/content-fields/flow-custom-conditional.js +1 -2
- package/lib/esm/content-fields/flow-custom-conditional.js.map +1 -1
- package/lib/esm/content-fields/flow-element.d.ts +4 -4
- package/lib/esm/content-fields/flow-element.js +3 -3
- package/lib/esm/content-fields/flow-element.js.map +1 -1
- package/lib/esm/content-fields/flow-go-to-flow.d.ts +3 -3
- package/lib/esm/content-fields/flow-go-to-flow.js.map +1 -1
- package/lib/esm/content-fields/flow-handoff.d.ts +3 -3
- package/lib/esm/content-fields/flow-handoff.js +2 -2
- package/lib/esm/content-fields/flow-handoff.js.map +1 -1
- package/lib/esm/content-fields/flow-image.d.ts +2 -2
- package/lib/esm/content-fields/flow-image.js +1 -1
- package/lib/esm/content-fields/flow-image.js.map +1 -1
- package/lib/esm/content-fields/flow-knowledge-base.d.ts +2 -2
- package/lib/esm/content-fields/flow-knowledge-base.js.map +1 -1
- package/lib/esm/content-fields/flow-queue-status-conditional.d.ts +3 -3
- package/lib/esm/content-fields/flow-queue-status-conditional.js.map +1 -1
- package/lib/esm/content-fields/flow-rating.d.ts +2 -2
- package/lib/esm/content-fields/flow-rating.js +3 -3
- package/lib/esm/content-fields/flow-rating.js.map +1 -1
- package/lib/esm/content-fields/flow-text.d.ts +5 -5
- package/lib/esm/content-fields/flow-text.js +1 -1
- package/lib/esm/content-fields/flow-text.js.map +1 -1
- package/lib/esm/content-fields/flow-video.d.ts +2 -2
- package/lib/esm/content-fields/flow-video.js +1 -1
- package/lib/esm/content-fields/flow-video.js.map +1 -1
- package/lib/esm/content-fields/flow-webview.d.ts +2 -2
- package/lib/esm/content-fields/flow-webview.js.map +1 -1
- package/lib/esm/content-fields/flow-whatsapp-cta-url-button.d.ts +3 -3
- package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js +10 -6
- package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js.map +1 -1
- package/lib/esm/content-fields/flow-whatsapp-template.d.ts +2 -2
- package/lib/esm/content-fields/flow-whatsapp-template.js.map +1 -1
- package/lib/esm/content-fields/hubtype-fields/ai-agent.d.ts +2 -2
- package/lib/esm/content-fields/hubtype-fields/bot-action.d.ts +2 -2
- package/lib/esm/content-fields/hubtype-fields/button.d.ts +1 -1
- package/lib/esm/content-fields/hubtype-fields/capture-user-input.d.ts +2 -2
- package/lib/esm/content-fields/hubtype-fields/carousel.d.ts +3 -3
- package/lib/esm/content-fields/hubtype-fields/channel-conditional.d.ts +3 -3
- package/lib/esm/content-fields/hubtype-fields/common.d.ts +2 -2
- package/lib/esm/content-fields/hubtype-fields/country-conditional.d.ts +3 -3
- package/lib/esm/content-fields/hubtype-fields/custom-conditional.d.ts +3 -3
- package/lib/esm/content-fields/hubtype-fields/fallback.d.ts +2 -2
- package/lib/esm/content-fields/hubtype-fields/function.d.ts +2 -2
- package/lib/esm/content-fields/hubtype-fields/go-to-flow.d.ts +2 -2
- package/lib/esm/content-fields/hubtype-fields/handoff.d.ts +2 -2
- package/lib/esm/content-fields/hubtype-fields/image.d.ts +2 -2
- package/lib/esm/content-fields/hubtype-fields/keyword.d.ts +2 -2
- package/lib/esm/content-fields/hubtype-fields/knowledge-base.d.ts +2 -2
- package/lib/esm/content-fields/hubtype-fields/nodes.d.ts +21 -21
- package/lib/esm/content-fields/hubtype-fields/payload.d.ts +1 -1
- package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.d.ts +3 -3
- package/lib/esm/content-fields/hubtype-fields/rating.d.ts +2 -2
- package/lib/esm/content-fields/hubtype-fields/smart-intent.d.ts +2 -2
- package/lib/esm/content-fields/hubtype-fields/text.d.ts +3 -3
- package/lib/esm/content-fields/hubtype-fields/url.d.ts +1 -1
- package/lib/esm/content-fields/hubtype-fields/video.d.ts +2 -2
- package/lib/esm/content-fields/hubtype-fields/webview.d.ts +2 -2
- package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.d.ts +2 -2
- package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.d.ts +4 -4
- package/lib/esm/content-fields/hubtype-fields/whatsapp-template.d.ts +4 -4
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +3 -3
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +2 -2
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +1 -1
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +3 -3
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +3 -2
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +1 -1
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +3 -3
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +3 -2
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +1 -1
- package/lib/esm/filters/index.d.ts +3 -3
- package/lib/esm/flow-factory.d.ts +4 -4
- package/lib/esm/functions/index.d.ts +2 -2
- package/lib/esm/helpers.d.ts +2 -2
- package/lib/esm/index.d.ts +6 -5
- package/lib/esm/index.js +5 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/tracking.d.ts +3 -3
- package/lib/esm/tracking.js.map +1 -1
- package/lib/esm/types.d.ts +4 -3
- package/lib/esm/types.js.map +1 -1
- package/lib/esm/user-input/capture-user-input-api.d.ts +3 -3
- package/lib/esm/user-input/capture-user-input-api.js.map +1 -1
- package/lib/esm/user-input/index.d.ts +3 -3
- package/lib/esm/user-input/index.js.map +1 -1
- package/lib/esm/user-input/keyword.d.ts +3 -3
- package/lib/esm/user-input/keyword.js.map +1 -1
- package/lib/esm/user-input/smart-intent.d.ts +3 -3
- package/lib/esm/user-input/smart-intent.js +6 -3
- package/lib/esm/user-input/smart-intent.js.map +1 -1
- package/lib/esm/utils.d.ts +2 -3
- package/lib/esm/utils.js +0 -21
- package/lib/esm/utils.js.map +1 -1
- package/lib/esm/webview/contents-context.d.ts +1 -1
- package/lib/esm/webview/types.d.ts +1 -1
- package/lib/esm/webview/use-webview-contents.d.ts +1 -1
- package/package.json +5 -8
- package/src/action/ai-agent.ts +7 -7
- package/src/action/fallback.ts +5 -5
- package/src/action/first-interaction.ts +5 -5
- package/src/action/index.tsx +6 -6
- package/src/action/knowledge-bases.ts +7 -7
- package/src/action/payload.ts +4 -4
- package/src/api.ts +31 -21
- package/src/content-fields/content-fields-base.ts +32 -4
- package/src/content-fields/flow-ai-agent.tsx +11 -4
- package/src/content-fields/flow-bot-action.tsx +4 -4
- package/src/content-fields/flow-button.tsx +15 -12
- package/src/content-fields/flow-capture-user-input.tsx +2 -2
- package/src/content-fields/flow-carousel.tsx +6 -7
- package/src/content-fields/flow-channel-conditional.tsx +4 -4
- package/src/content-fields/flow-country-conditional.tsx +4 -4
- package/src/content-fields/flow-custom-conditional.tsx +5 -6
- package/src/content-fields/flow-element.tsx +16 -7
- package/src/content-fields/flow-go-to-flow.tsx +4 -4
- package/src/content-fields/flow-handoff.tsx +11 -5
- package/src/content-fields/flow-image.tsx +3 -4
- package/src/content-fields/flow-knowledge-base.tsx +2 -4
- package/src/content-fields/flow-queue-status-conditional.tsx +4 -5
- package/src/content-fields/flow-rating.tsx +5 -5
- package/src/content-fields/flow-text.tsx +10 -7
- package/src/content-fields/flow-video.tsx +3 -4
- package/src/content-fields/flow-webview.tsx +3 -3
- package/src/content-fields/flow-whatsapp-cta-url-button.tsx +25 -22
- package/src/content-fields/flow-whatsapp-template.tsx +10 -11
- package/src/content-fields/hubtype-fields/ai-agent.ts +2 -2
- package/src/content-fields/hubtype-fields/bot-action.ts +2 -2
- package/src/content-fields/hubtype-fields/button.ts +1 -1
- package/src/content-fields/hubtype-fields/capture-user-input.ts +2 -2
- package/src/content-fields/hubtype-fields/carousel.ts +3 -3
- package/src/content-fields/hubtype-fields/channel-conditional.ts +3 -3
- package/src/content-fields/hubtype-fields/common.ts +5 -2
- package/src/content-fields/hubtype-fields/country-conditional.ts +3 -3
- package/src/content-fields/hubtype-fields/custom-conditional.ts +3 -3
- package/src/content-fields/hubtype-fields/fallback.ts +2 -2
- package/src/content-fields/hubtype-fields/function.ts +2 -2
- package/src/content-fields/hubtype-fields/go-to-flow.ts +2 -2
- package/src/content-fields/hubtype-fields/handoff.ts +2 -2
- package/src/content-fields/hubtype-fields/image.ts +2 -2
- package/src/content-fields/hubtype-fields/keyword.ts +2 -2
- package/src/content-fields/hubtype-fields/knowledge-base.ts +2 -2
- package/src/content-fields/hubtype-fields/nodes.ts +21 -21
- package/src/content-fields/hubtype-fields/payload.ts +1 -1
- package/src/content-fields/hubtype-fields/queue-status-conditional.ts +3 -3
- package/src/content-fields/hubtype-fields/rating.ts +2 -2
- package/src/content-fields/hubtype-fields/smart-intent.ts +2 -2
- package/src/content-fields/hubtype-fields/text.ts +3 -3
- package/src/content-fields/hubtype-fields/url.ts +1 -1
- package/src/content-fields/hubtype-fields/video.ts +2 -2
- package/src/content-fields/hubtype-fields/webview.ts +2 -2
- package/src/content-fields/hubtype-fields/whatsapp-button-list.ts +2 -2
- package/src/content-fields/hubtype-fields/whatsapp-cta-url-button.ts +4 -4
- package/src/content-fields/hubtype-fields/whatsapp-template.ts +4 -4
- package/src/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.tsx +11 -5
- package/src/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.tsx +10 -5
- package/src/content-fields/whatsapp-button-list/flow-whatsapp-button-list.tsx +14 -9
- package/src/filters/index.ts +3 -3
- package/src/flow-factory.ts +5 -5
- package/src/functions/index.ts +2 -2
- package/src/helpers.ts +2 -2
- package/src/index.ts +24 -19
- package/src/tracking.ts +5 -5
- package/src/types.ts +8 -7
- package/src/user-input/capture-user-input-api.ts +4 -4
- package/src/user-input/index.ts +6 -3
- package/src/user-input/keyword.ts +4 -4
- package/src/user-input/smart-intent.ts +14 -8
- package/src/utils.ts +3 -35
- package/src/webview/contents-context.ts +1 -1
- package/src/webview/types.ts +1 -1
- package/src/webview/use-webview-contents.ts +6 -6
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { HtAiAgentNode } from './ai-agent'
|
|
2
|
-
import { HtBotActionNode } from './bot-action'
|
|
3
|
-
import { HtCaptureUserInputNode } from './capture-user-input'
|
|
4
|
-
import { HtCarouselNode } from './carousel'
|
|
1
|
+
import type { HtAiAgentNode } from './ai-agent'
|
|
2
|
+
import type { HtBotActionNode } from './bot-action'
|
|
3
|
+
import type { HtCaptureUserInputNode } from './capture-user-input'
|
|
4
|
+
import type { HtCarouselNode } from './carousel'
|
|
5
5
|
// import { HtChannelConditionalNode } from './channel-conditional'
|
|
6
6
|
// import { HtCountryConditionalNode } from './country-conditional'
|
|
7
7
|
// import { HtCustomConditionalNode } from './custom-conditional'
|
|
8
|
-
import { HtFallbackNode } from './fallback'
|
|
9
|
-
import { HtFunctionNode } from './function'
|
|
10
|
-
import { HtGoToFlow } from './go-to-flow'
|
|
11
|
-
import { HtHandoffNode } from './handoff'
|
|
12
|
-
import { HtImageNode } from './image'
|
|
13
|
-
import { HtKeywordNode } from './keyword'
|
|
14
|
-
import { HtKnowledgeBaseNode } from './knowledge-base'
|
|
15
|
-
import { HtPayloadNode } from './payload'
|
|
8
|
+
import type { HtFallbackNode } from './fallback'
|
|
9
|
+
import type { HtFunctionNode } from './function'
|
|
10
|
+
import type { HtGoToFlow } from './go-to-flow'
|
|
11
|
+
import type { HtHandoffNode } from './handoff'
|
|
12
|
+
import type { HtImageNode } from './image'
|
|
13
|
+
import type { HtKeywordNode } from './keyword'
|
|
14
|
+
import type { HtKnowledgeBaseNode } from './knowledge-base'
|
|
15
|
+
import type { HtPayloadNode } from './payload'
|
|
16
16
|
// import { HtQueueStatusConditionalNode } from './queue-status-conditional'
|
|
17
|
-
import { HtRatingNode } from './rating'
|
|
18
|
-
import { HtSmartIntentNode } from './smart-intent'
|
|
19
|
-
import { HtTextNode } from './text'
|
|
20
|
-
import { HtUrlNode } from './url'
|
|
21
|
-
import { HtVideoNode } from './video'
|
|
22
|
-
import { HtWebviewNode } from './webview'
|
|
23
|
-
import { HtWhatsappButtonListNode } from './whatsapp-button-list'
|
|
24
|
-
import { HtWhatsappCTAUrlButtonNode } from './whatsapp-cta-url-button'
|
|
25
|
-
import { HtWhatsappTemplateNode } from './whatsapp-template'
|
|
17
|
+
import type { HtRatingNode } from './rating'
|
|
18
|
+
import type { HtSmartIntentNode } from './smart-intent'
|
|
19
|
+
import type { HtTextNode } from './text'
|
|
20
|
+
import type { HtUrlNode } from './url'
|
|
21
|
+
import type { HtVideoNode } from './video'
|
|
22
|
+
import type { HtWebviewNode } from './webview'
|
|
23
|
+
import type { HtWhatsappButtonListNode } from './whatsapp-button-list'
|
|
24
|
+
import type { HtWhatsappCTAUrlButtonNode } from './whatsapp-cta-url-button'
|
|
25
|
+
import type { HtWhatsappTemplateNode } from './whatsapp-template'
|
|
26
26
|
|
|
27
27
|
export type HtNodeWithContent =
|
|
28
28
|
| HtTextNode
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { HtBaseNode, HtNodeLink } from './common'
|
|
2
|
-
import { HtFunctionArguments, HtFunctionResult } from './function'
|
|
3
|
-
import { HtNodeWithContentType } from './node-types'
|
|
1
|
+
import type { HtBaseNode, HtNodeLink } from './common'
|
|
2
|
+
import type { HtFunctionArguments, HtFunctionResult } from './function'
|
|
3
|
+
import type { HtNodeWithContentType } from './node-types'
|
|
4
4
|
|
|
5
5
|
/* TODO: In the future, refactor the conditional nodes so they are not of type FUNCTION and can use type-hints for all exact arguments and results. */
|
|
6
6
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { HtBaseNode, HtNodeLink, HtTextLocale } from './common'
|
|
2
|
-
import { HtNodeWithContentType } from './node-types'
|
|
1
|
+
import type { HtBaseNode, HtNodeLink, HtTextLocale } from './common'
|
|
2
|
+
import type { HtNodeWithContentType } from './node-types'
|
|
3
3
|
|
|
4
4
|
export enum RatingType {
|
|
5
5
|
Stars = 'stars',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { HtButton } from './button'
|
|
2
|
-
import { HtBaseNode, HtTextLocale } from './common'
|
|
3
|
-
import { HtButtonStyle, HtNodeWithContentType } from './node-types'
|
|
1
|
+
import type { HtButton } from './button'
|
|
2
|
+
import type { HtBaseNode, HtTextLocale } from './common'
|
|
3
|
+
import type { HtButtonStyle, HtNodeWithContentType } from './node-types'
|
|
4
4
|
|
|
5
5
|
export interface HtTextNode extends HtBaseNode {
|
|
6
6
|
type: HtNodeWithContentType.TEXT
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { HtBaseNode, HtVideoLocale } from './common'
|
|
2
|
-
import { HtNodeWithContentType } from './node-types'
|
|
1
|
+
import type { HtBaseNode, HtVideoLocale } from './common'
|
|
2
|
+
import type { HtNodeWithContentType } from './node-types'
|
|
3
3
|
|
|
4
4
|
export interface HtVideoNode extends HtBaseNode {
|
|
5
5
|
type: HtNodeWithContentType.VIDEO
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { HtBaseNode, HtNodeLink } from './common'
|
|
2
|
-
import { HtNodeWithContentType } from './node-types'
|
|
1
|
+
import type { HtBaseNode, HtNodeLink } from './common'
|
|
2
|
+
import type { HtNodeWithContentType } from './node-types'
|
|
3
3
|
|
|
4
4
|
export interface HtWebviewExits {
|
|
5
5
|
id: string
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
|
-
import { HtBaseNode, HtNodeLink, HtTextLocale } from './common'
|
|
3
|
-
import { HtNodeWithContentType } from './node-types'
|
|
2
|
+
import type { HtBaseNode, HtNodeLink, HtTextLocale } from './common'
|
|
3
|
+
import type { HtNodeWithContentType } from './node-types'
|
|
4
4
|
|
|
5
5
|
export interface HtWhatsappButtonListRow {
|
|
6
6
|
id: string
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { WhatsappCTAUrlHeaderType } from '@botonic/react'
|
|
1
|
+
import type { WhatsappCTAUrlHeaderType } from '@botonic/react'
|
|
2
2
|
|
|
3
|
-
import { HtButton } from './button'
|
|
4
|
-
import { HtBaseNode, HtMediaFileLocale, HtTextLocale } from './common'
|
|
5
|
-
import { HtNodeWithContentType } from './node-types'
|
|
3
|
+
import type { HtButton } from './button'
|
|
4
|
+
import type { HtBaseNode, HtMediaFileLocale, HtTextLocale } from './common'
|
|
5
|
+
import type { HtNodeWithContentType } from './node-types'
|
|
6
6
|
|
|
7
7
|
export interface HtWhatsappCTAUrlButtonNode extends HtBaseNode {
|
|
8
8
|
type: HtNodeWithContentType.WHATSAPP_CTA_URL_BUTTON
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
WhatsAppTemplateButtonSubType,
|
|
3
3
|
WhatsAppTemplateComponentType,
|
|
4
4
|
WhatsAppTemplateParameterType,
|
|
5
5
|
} from '@botonic/react'
|
|
6
6
|
|
|
7
|
-
import { HtButton } from './button'
|
|
8
|
-
import { HtBaseNode, HtMediaFileLocale } from './common'
|
|
9
|
-
import { HtNodeWithContentType } from './node-types'
|
|
7
|
+
import type { HtButton } from './button'
|
|
8
|
+
import type { HtBaseNode, HtMediaFileLocale } from './common'
|
|
9
|
+
import type { HtNodeWithContentType } from './node-types'
|
|
10
10
|
|
|
11
11
|
type HtWhatsAppTemplateButton =
|
|
12
12
|
| {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ActionRequest, WhatsappButtonListRowProps } from '@botonic/react'
|
|
1
|
+
import type { ActionRequest, WhatsappButtonListRowProps } from '@botonic/react'
|
|
2
2
|
|
|
3
|
-
import { FlowBuilderApi } from '../../api'
|
|
3
|
+
import type { FlowBuilderApi } from '../../api'
|
|
4
4
|
import { SOURCE_INFO_SEPARATOR } from '../../constants'
|
|
5
5
|
import { ContentFieldsBase } from '../content-fields-base'
|
|
6
|
-
import { HtWhatsappButtonListRow } from '../hubtype-fields'
|
|
6
|
+
import type { HtWhatsappButtonListRow } from '../hubtype-fields'
|
|
7
7
|
|
|
8
8
|
export class FlowWhatsappButtonListRow extends ContentFieldsBase {
|
|
9
9
|
public title = ''
|
|
@@ -16,8 +16,14 @@ export class FlowWhatsappButtonListRow extends ContentFieldsBase {
|
|
|
16
16
|
cmsApi: FlowBuilderApi
|
|
17
17
|
): FlowWhatsappButtonListRow {
|
|
18
18
|
const newRow = new FlowWhatsappButtonListRow(component.id)
|
|
19
|
-
newRow.title =
|
|
20
|
-
|
|
19
|
+
newRow.title = FlowWhatsappButtonListRow.getTextByLocale(
|
|
20
|
+
locale,
|
|
21
|
+
component.text
|
|
22
|
+
)
|
|
23
|
+
newRow.description = FlowWhatsappButtonListRow.getTextByLocale(
|
|
24
|
+
locale,
|
|
25
|
+
component.description
|
|
26
|
+
)
|
|
21
27
|
newRow.targetId = cmsApi.getPayload(component.target)
|
|
22
28
|
|
|
23
29
|
return newRow
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
ActionRequest,
|
|
3
3
|
WhatsappButtonListRowProps,
|
|
4
4
|
WhatsappButtonListSectionProps,
|
|
5
5
|
} from '@botonic/react'
|
|
6
6
|
|
|
7
|
-
import { FlowBuilderApi } from '../../api'
|
|
7
|
+
import type { FlowBuilderApi } from '../../api'
|
|
8
8
|
import { ContentFieldsBase } from '../content-fields-base'
|
|
9
|
-
import { HtWhatsappButtonListSection } from '../hubtype-fields'
|
|
9
|
+
import type { HtWhatsappButtonListSection } from '../hubtype-fields'
|
|
10
10
|
import { FlowWhatsappButtonListRow } from './flow-whatsapp-button-list-row'
|
|
11
11
|
|
|
12
12
|
export class FlowWhatsappButtonListSection extends ContentFieldsBase {
|
|
@@ -19,7 +19,10 @@ export class FlowWhatsappButtonListSection extends ContentFieldsBase {
|
|
|
19
19
|
cmsApi: FlowBuilderApi
|
|
20
20
|
): FlowWhatsappButtonListSection {
|
|
21
21
|
const newButton = new FlowWhatsappButtonListSection(component.id)
|
|
22
|
-
newButton.title =
|
|
22
|
+
newButton.title = FlowWhatsappButtonListSection.getTextByLocale(
|
|
23
|
+
locale,
|
|
24
|
+
component.title
|
|
25
|
+
)
|
|
23
26
|
newButton.rows = component.rows.map(row =>
|
|
24
27
|
FlowWhatsappButtonListRow.fromHubtypeCMS(row, locale, cmsApi)
|
|
25
28
|
)
|
|
@@ -35,7 +38,9 @@ export class FlowWhatsappButtonListSection extends ContentFieldsBase {
|
|
|
35
38
|
const rows = this.rows.reduce(
|
|
36
39
|
(acc: WhatsappButtonListRowProps[], row, rowIndex) => {
|
|
37
40
|
const botonicRow = row.toBotonic(rowIndex, sectionIndex)
|
|
38
|
-
if (botonicRow)
|
|
41
|
+
if (botonicRow) {
|
|
42
|
+
acc.push(botonicRow)
|
|
43
|
+
}
|
|
39
44
|
return acc
|
|
40
45
|
},
|
|
41
46
|
[]
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { isWhatsapp } from '@botonic/core'
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
type ActionRequest,
|
|
4
|
+
Button,
|
|
5
|
+
Text,
|
|
6
|
+
WhatsappButtonList,
|
|
7
|
+
} from '@botonic/react'
|
|
4
8
|
|
|
5
|
-
import { FlowBuilderApi } from '../../api'
|
|
9
|
+
import type { FlowBuilderApi } from '../../api'
|
|
6
10
|
import { trackOneContent } from '../../tracking'
|
|
7
11
|
import { ContentFieldsBase } from '../content-fields-base'
|
|
8
|
-
import { HtWhatsappButtonListNode } from '../hubtype-fields'
|
|
12
|
+
import type { HtWhatsappButtonListNode } from '../hubtype-fields'
|
|
9
13
|
import { FlowWhatsappButtonListSection } from './flow-whatsapp-button-list-section'
|
|
10
14
|
|
|
11
15
|
export class FlowWhatsappButtonList extends ContentFieldsBase {
|
|
@@ -20,14 +24,15 @@ export class FlowWhatsappButtonList extends ContentFieldsBase {
|
|
|
20
24
|
): FlowWhatsappButtonList {
|
|
21
25
|
const newWhatsappButtonList = new FlowWhatsappButtonList(component.id)
|
|
22
26
|
newWhatsappButtonList.code = component.code
|
|
23
|
-
newWhatsappButtonList.text =
|
|
27
|
+
newWhatsappButtonList.text = FlowWhatsappButtonList.getTextByLocale(
|
|
24
28
|
locale,
|
|
25
29
|
component.content.text
|
|
26
30
|
)
|
|
27
|
-
newWhatsappButtonList.listButtonText =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
newWhatsappButtonList.listButtonText =
|
|
32
|
+
FlowWhatsappButtonList.getTextByLocale(
|
|
33
|
+
locale,
|
|
34
|
+
component.content.button_text
|
|
35
|
+
)
|
|
31
36
|
newWhatsappButtonList.sections = component.content.sections.map(section =>
|
|
32
37
|
FlowWhatsappButtonListSection.fromHubtypeCMS(section, locale, cmsApi)
|
|
33
38
|
)
|
package/src/filters/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { BotContext } from '@botonic/core'
|
|
1
|
+
import type { BotContext } from '@botonic/core'
|
|
2
2
|
|
|
3
|
-
import { FlowContent } from '../content-fields'
|
|
4
|
-
import { ContentFilter } from '../types'
|
|
3
|
+
import type { FlowContent } from '../content-fields'
|
|
4
|
+
import type { ContentFilter } from '../types'
|
|
5
5
|
|
|
6
6
|
interface ContentFilterExecutorOptions {
|
|
7
7
|
filters: ContentFilter[]
|
package/src/flow-factory.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ActionRequest } from '@botonic/react'
|
|
1
|
+
import type { ActionRequest } from '@botonic/react'
|
|
2
2
|
|
|
3
|
-
import { FlowBuilderApi } from './api'
|
|
3
|
+
import type { FlowBuilderApi } from './api'
|
|
4
4
|
import {
|
|
5
5
|
FlowAiAgent,
|
|
6
6
|
FlowBotAction,
|
|
7
7
|
FlowCarousel,
|
|
8
8
|
FlowChannelConditional,
|
|
9
|
-
FlowContent,
|
|
9
|
+
type FlowContent,
|
|
10
10
|
FlowCountryConditional,
|
|
11
11
|
FlowCustomConditional,
|
|
12
12
|
FlowGoToFlow,
|
|
@@ -23,8 +23,8 @@ import {
|
|
|
23
23
|
} from './content-fields'
|
|
24
24
|
import { FlowCaptureUserInput } from './content-fields/flow-capture-user-input'
|
|
25
25
|
import {
|
|
26
|
-
HtFunctionNode,
|
|
27
|
-
HtNodeComponent,
|
|
26
|
+
type HtFunctionNode,
|
|
27
|
+
type HtNodeComponent,
|
|
28
28
|
HtNodeWithContentType,
|
|
29
29
|
} from './content-fields/hubtype-fields'
|
|
30
30
|
|
package/src/functions/index.ts
CHANGED
package/src/helpers.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ResolvedPlugins } from '@botonic/core'
|
|
1
|
+
import type { ResolvedPlugins } from '@botonic/core'
|
|
2
2
|
|
|
3
|
-
import BotonicPluginFlowBuilder from './index'
|
|
3
|
+
import type BotonicPluginFlowBuilder from './index'
|
|
4
4
|
|
|
5
5
|
const FLOW_BUILDER_PLUGIN_NAME = 'BotonicPluginFlowBuilder'
|
|
6
6
|
|
package/src/index.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
INPUT,
|
|
3
|
-
Plugin,
|
|
4
|
-
PluginPreRequest,
|
|
3
|
+
type Plugin,
|
|
4
|
+
type PluginPreRequest,
|
|
5
5
|
PROVIDER,
|
|
6
|
-
ResolvedPlugins,
|
|
7
|
-
Session,
|
|
6
|
+
type ResolvedPlugins,
|
|
7
|
+
type Session,
|
|
8
8
|
} from '@botonic/core'
|
|
9
|
-
import { ActionRequest } from '@botonic/react'
|
|
9
|
+
import type { ActionRequest } from '@botonic/react'
|
|
10
10
|
import { v7 as uuidv7 } from 'uuid'
|
|
11
11
|
|
|
12
12
|
import { FlowBuilderApi } from './api'
|
|
@@ -16,28 +16,28 @@ import {
|
|
|
16
16
|
SEPARATOR,
|
|
17
17
|
SOURCE_INFO_SEPARATOR,
|
|
18
18
|
} from './constants'
|
|
19
|
-
import { FlowContent } from './content-fields'
|
|
19
|
+
import type { FlowContent } from './content-fields'
|
|
20
20
|
import {
|
|
21
|
-
HtBotActionNode,
|
|
22
|
-
HtFlowBuilderData,
|
|
23
|
-
HtNodeWithContent,
|
|
21
|
+
type HtBotActionNode,
|
|
22
|
+
type HtFlowBuilderData,
|
|
23
|
+
type HtNodeWithContent,
|
|
24
24
|
HtNodeWithContentType,
|
|
25
25
|
} from './content-fields/hubtype-fields'
|
|
26
26
|
import { FlowFactory } from './flow-factory'
|
|
27
27
|
import { CustomFunction, DEFAULT_FUNCTION_NAMES } from './functions'
|
|
28
28
|
import {
|
|
29
|
-
AiAgentFunction,
|
|
30
|
-
BotonicPluginFlowBuilderOptions,
|
|
31
|
-
ContentFilter,
|
|
29
|
+
type AiAgentFunction,
|
|
30
|
+
type BotonicPluginFlowBuilderOptions,
|
|
31
|
+
type ContentFilter,
|
|
32
32
|
FlowBuilderJSONVersion,
|
|
33
|
-
InShadowingConfig,
|
|
34
|
-
KnowledgeBaseFunction,
|
|
35
|
-
PayloadParamsBase,
|
|
36
|
-
RatingSubmittedInfo,
|
|
37
|
-
TrackEventFunction,
|
|
33
|
+
type InShadowingConfig,
|
|
34
|
+
type KnowledgeBaseFunction,
|
|
35
|
+
type PayloadParamsBase,
|
|
36
|
+
type RatingSubmittedInfo,
|
|
37
|
+
type TrackEventFunction,
|
|
38
38
|
} from './types'
|
|
39
39
|
import { getNextPayloadByUserInput } from './user-input'
|
|
40
|
-
import { SmartIntentsInferenceConfig } from './user-input/smart-intent'
|
|
40
|
+
import type { SmartIntentsInferenceConfig } from './user-input/smart-intent'
|
|
41
41
|
import { inputHasTextData, resolveGetAccessToken } from './utils'
|
|
42
42
|
|
|
43
43
|
// TODO: Create a proper service to wrap all calls and allow api versioning
|
|
@@ -79,6 +79,7 @@ export default class BotonicPluginFlowBuilder implements Plugin {
|
|
|
79
79
|
allowKeywords: options.inShadowing?.allowKeywords || false,
|
|
80
80
|
allowSmartIntents: options.inShadowing?.allowSmartIntents || false,
|
|
81
81
|
allowKnowledgeBases: options.inShadowing?.allowKnowledgeBases || false,
|
|
82
|
+
allowAiAgents: options.inShadowing?.allowAiAgents || false,
|
|
82
83
|
}
|
|
83
84
|
this.contentFilters = options.contentFilters || []
|
|
84
85
|
this.customRatingMessageEnabled =
|
|
@@ -228,7 +229,7 @@ export default class BotonicPluginFlowBuilder implements Plugin {
|
|
|
228
229
|
}
|
|
229
230
|
|
|
230
231
|
// TODO: prevent infinite recursive calls
|
|
231
|
-
if (content
|
|
232
|
+
if (content?.followUp) {
|
|
232
233
|
return this.getContentsById(content.followUp.id, contents)
|
|
233
234
|
} else if (node.follow_up) {
|
|
234
235
|
console.log('FOLLOWUP FROM NODE-------> OLD SYSTEM')
|
|
@@ -265,6 +266,10 @@ export default class BotonicPluginFlowBuilder implements Plugin {
|
|
|
265
266
|
possibleValues,
|
|
266
267
|
}
|
|
267
268
|
}
|
|
269
|
+
|
|
270
|
+
setInShadowing(inShadowing: InShadowingConfig): void {
|
|
271
|
+
this.inShadowing = inShadowing
|
|
272
|
+
}
|
|
268
273
|
}
|
|
269
274
|
|
|
270
275
|
export * from './action'
|
package/src/tracking.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { EventAction, EventFlow } from '@botonic/core'
|
|
2
|
-
import { ActionRequest } from '@botonic/react'
|
|
1
|
+
import { EventAction, type EventFlow } from '@botonic/core'
|
|
2
|
+
import type { ActionRequest } from '@botonic/react'
|
|
3
3
|
import { v7 as uuidv7 } from 'uuid'
|
|
4
4
|
|
|
5
|
-
import { FlowBuilderApi } from './api'
|
|
6
|
-
import { FlowContent } from './content-fields'
|
|
5
|
+
import type { FlowBuilderApi } from './api'
|
|
6
|
+
import type { FlowContent } from './content-fields'
|
|
7
7
|
import {
|
|
8
|
-
HtNodeWithContent,
|
|
8
|
+
type HtNodeWithContent,
|
|
9
9
|
HtNodeWithContentType,
|
|
10
10
|
} from './content-fields/hubtype-fields'
|
|
11
11
|
import { getFlowBuilderPlugin } from './helpers'
|
package/src/types.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AiAgentArgs,
|
|
3
|
-
BotContext,
|
|
3
|
+
type BotContext,
|
|
4
4
|
GuardrailRule,
|
|
5
|
-
InferenceResponse,
|
|
6
|
-
KnowledgeBasesResponse,
|
|
7
|
-
PluginPreRequest,
|
|
8
|
-
ResolvedPlugins,
|
|
5
|
+
type InferenceResponse,
|
|
6
|
+
type KnowledgeBasesResponse,
|
|
7
|
+
type PluginPreRequest,
|
|
8
|
+
type ResolvedPlugins,
|
|
9
9
|
} from '@botonic/core'
|
|
10
10
|
|
|
11
|
-
import { FlowContent } from './content-fields'
|
|
12
|
-
import {
|
|
11
|
+
import type { FlowContent } from './content-fields'
|
|
12
|
+
import type {
|
|
13
13
|
HtFlowBuilderData,
|
|
14
14
|
HtRatingButton,
|
|
15
15
|
} from './content-fields/hubtype-fields'
|
|
@@ -18,6 +18,7 @@ export interface InShadowingConfig {
|
|
|
18
18
|
allowKeywords: boolean
|
|
19
19
|
allowSmartIntents: boolean
|
|
20
20
|
allowKnowledgeBases: boolean
|
|
21
|
+
allowAiAgents: boolean
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
export interface BotonicPluginFlowBuilderOptions<
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { EventAction, EventCaptureUserInput } from '@botonic/core'
|
|
2
|
-
import { ActionRequest } from '@botonic/react'
|
|
1
|
+
import { EventAction, type EventCaptureUserInput } from '@botonic/core'
|
|
2
|
+
import type { ActionRequest } from '@botonic/react'
|
|
3
3
|
import axios from 'axios'
|
|
4
4
|
|
|
5
|
-
import { FlowBuilderApi } from '../api'
|
|
5
|
+
import type { FlowBuilderApi } from '../api'
|
|
6
6
|
import { FlowCaptureUserInput } from '../content-fields'
|
|
7
7
|
import {
|
|
8
8
|
HtAiValidationType,
|
|
9
|
-
HtCaptureUserInputNode,
|
|
9
|
+
type HtCaptureUserInputNode,
|
|
10
10
|
} from '../content-fields/hubtype-fields'
|
|
11
11
|
import { getFlowBuilderPlugin } from '../helpers'
|
|
12
12
|
import {
|
package/src/user-input/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ActionRequest } from '@botonic/react'
|
|
1
|
+
import type { ActionRequest } from '@botonic/react'
|
|
2
2
|
|
|
3
|
-
import { FlowBuilderApi } from '../api'
|
|
3
|
+
import type { FlowBuilderApi } from '../api'
|
|
4
4
|
import {
|
|
5
5
|
inputHasTextData,
|
|
6
6
|
isKeywordsAllowed,
|
|
@@ -8,7 +8,10 @@ import {
|
|
|
8
8
|
} from '../utils'
|
|
9
9
|
import { CaptureUserInputApi } from './capture-user-input-api'
|
|
10
10
|
import { KeywordMatcher } from './keyword'
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
SmartIntentsApi,
|
|
13
|
+
type SmartIntentsInferenceConfig,
|
|
14
|
+
} from './smart-intent'
|
|
12
15
|
|
|
13
16
|
export async function getNextPayloadByUserInput(
|
|
14
17
|
cmsApi: FlowBuilderApi,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { EventAction, EventKeyword, NluType } from '@botonic/core'
|
|
2
|
-
import { ActionRequest } from '@botonic/react'
|
|
1
|
+
import { EventAction, type EventKeyword, NluType } from '@botonic/core'
|
|
2
|
+
import type { ActionRequest } from '@botonic/react'
|
|
3
3
|
|
|
4
|
-
import { FlowBuilderApi } from '../api'
|
|
4
|
+
import type { FlowBuilderApi } from '../api'
|
|
5
5
|
import { REG_EXP_PATTERN } from '../constants'
|
|
6
|
-
import {
|
|
6
|
+
import type {
|
|
7
7
|
HtKeywordNode,
|
|
8
8
|
HtNodeWithContent,
|
|
9
9
|
} from '../content-fields/hubtype-fields'
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { EventAction, EventIntentSmart, NluType } from '@botonic/core'
|
|
2
|
-
import { ActionRequest } from '@botonic/react'
|
|
1
|
+
import { EventAction, type EventIntentSmart, NluType } from '@botonic/core'
|
|
2
|
+
import type { ActionRequest } from '@botonic/react'
|
|
3
3
|
import axios from 'axios'
|
|
4
4
|
|
|
5
|
-
import { FlowBuilderApi } from '../api'
|
|
6
|
-
import { HtSmartIntentNode } from '../content-fields/hubtype-fields/smart-intent'
|
|
5
|
+
import type { FlowBuilderApi } from '../api'
|
|
6
|
+
import type { HtSmartIntentNode } from '../content-fields/hubtype-fields/smart-intent'
|
|
7
7
|
import { getFlowBuilderPlugin } from '../helpers'
|
|
8
8
|
import {
|
|
9
9
|
getCommonFlowContentEventArgsForContentId,
|
|
10
10
|
trackEvent,
|
|
11
11
|
} from '../tracking'
|
|
12
|
-
import { SmartIntentResponse } from '../types'
|
|
12
|
+
import type { SmartIntentResponse } from '../types'
|
|
13
13
|
|
|
14
14
|
export interface SmartIntentsInferenceParams {
|
|
15
15
|
bot_id: string
|
|
@@ -32,9 +32,13 @@ export class SmartIntentsApi {
|
|
|
32
32
|
) {}
|
|
33
33
|
|
|
34
34
|
async getNodeByInput(): Promise<HtSmartIntentNode | undefined> {
|
|
35
|
-
if (!this.currentRequest.input.data)
|
|
35
|
+
if (!this.currentRequest.input.data) {
|
|
36
|
+
return undefined
|
|
37
|
+
}
|
|
36
38
|
const smartIntentNodes = this.cmsApi.getSmartIntentNodes()
|
|
37
|
-
if (!smartIntentNodes.length)
|
|
39
|
+
if (!smartIntentNodes.length) {
|
|
40
|
+
return undefined
|
|
41
|
+
}
|
|
38
42
|
|
|
39
43
|
const params = {
|
|
40
44
|
bot_id: this.currentRequest.session.bot.id,
|
|
@@ -89,7 +93,9 @@ export class SmartIntentsApi {
|
|
|
89
93
|
}
|
|
90
94
|
|
|
91
95
|
private resolveUseLatest(): boolean {
|
|
92
|
-
if (this.currentRequest.session.is_test_integration)
|
|
96
|
+
if (this.currentRequest.session.is_test_integration) {
|
|
97
|
+
return false
|
|
98
|
+
}
|
|
93
99
|
return this.smartIntentsConfig.useLatest
|
|
94
100
|
}
|
|
95
101
|
|
package/src/utils.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { INPUT, Input, Session } from '@botonic/core'
|
|
2
|
-
import { ActionRequest } from '@botonic/react'
|
|
1
|
+
import { INPUT, type Input, type Session } from '@botonic/core'
|
|
2
|
+
import type { ActionRequest } from '@botonic/react'
|
|
3
3
|
|
|
4
4
|
import { getFlowBuilderPlugin } from './helpers'
|
|
5
|
-
import { InShadowingConfig, ProcessEnvNodeEnvs } from './types'
|
|
5
|
+
import { type InShadowingConfig, ProcessEnvNodeEnvs } from './types'
|
|
6
6
|
|
|
7
7
|
function getAccessTokenFromSession(session: Session): string {
|
|
8
8
|
if (!session._access_token) {
|
|
@@ -24,38 +24,6 @@ export function resolveGetAccessToken(
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
export function getValueFromKeyPath(
|
|
28
|
-
request: ActionRequest,
|
|
29
|
-
keyPath: string
|
|
30
|
-
): any {
|
|
31
|
-
if (keyPath.startsWith('session.user.contact_info.')) {
|
|
32
|
-
const name = keyPath.split('.').at(-1)
|
|
33
|
-
return request.session.user.contact_info?.find(
|
|
34
|
-
contact => contact.name === name
|
|
35
|
-
)?.value
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
if (keyPath.startsWith('input.') || keyPath.startsWith('session.')) {
|
|
39
|
-
return keyPath
|
|
40
|
-
.split('.')
|
|
41
|
-
.reduce((object, key) => resolveObjectKey(object, key), request)
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return keyPath
|
|
45
|
-
.split('.')
|
|
46
|
-
.reduce(
|
|
47
|
-
(object, key) => resolveObjectKey(object, key),
|
|
48
|
-
request.session.user.extra_data
|
|
49
|
-
)
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function resolveObjectKey(object: any, key: string): any {
|
|
53
|
-
if (object && object[key] !== undefined) {
|
|
54
|
-
return object[key]
|
|
55
|
-
}
|
|
56
|
-
return undefined
|
|
57
|
-
}
|
|
58
|
-
|
|
59
27
|
export function inputHasTextData(input: Input): boolean {
|
|
60
28
|
return input.data !== undefined && input.type === INPUT.TEXT
|
|
61
29
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createContext } from 'react'
|
|
2
2
|
|
|
3
|
-
import { MapContentsType, WebviewContentsContextType } from './types'
|
|
3
|
+
import type { MapContentsType, WebviewContentsContextType } from './types'
|
|
4
4
|
|
|
5
5
|
export const createWebviewContentsContext = <T extends MapContentsType>() =>
|
|
6
6
|
createContext<WebviewContentsContextType<T>>({
|
package/src/webview/types.ts
CHANGED