@botonic/plugin-flow-builder 0.44.1 → 0.45.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +2 -2
- package/lib/cjs/content-fields/flow-ai-agent.d.ts +3 -3
- 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 +5 -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.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 +4 -4
- 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 +5 -5
- package/lib/cjs/index.js +1 -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 +3 -3
- 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 -2
- 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 +2 -2
- package/lib/esm/content-fields/flow-ai-agent.d.ts +3 -3
- 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 +5 -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.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 +4 -4
- 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 +5 -5
- package/lib/esm/index.js +1 -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 +3 -3
- 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 -2
- 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 +2 -2
- package/src/content-fields/flow-ai-agent.tsx +6 -3
- package/src/content-fields/flow-bot-action.tsx +4 -4
- package/src/content-fields/flow-button.tsx +14 -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 +4 -4
- 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 +5 -6
- 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 +19 -19
- package/src/tracking.ts +5 -5
- package/src/types.ts +7 -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 -3
- package/src/webview/contents-context.ts +1 -1
- package/src/webview/types.ts +1 -1
- package/src/webview/use-webview-contents.ts +6 -6
package/src/api.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PluginPreRequest } from '@botonic/core'
|
|
1
|
+
import type { PluginPreRequest } from '@botonic/core'
|
|
2
2
|
import axios from 'axios'
|
|
3
3
|
|
|
4
4
|
import {
|
|
@@ -8,23 +8,23 @@ import {
|
|
|
8
8
|
UUID_REGEXP,
|
|
9
9
|
} from './constants'
|
|
10
10
|
import {
|
|
11
|
-
HtBotActionNode,
|
|
12
|
-
HtCaptureUserInputNode,
|
|
13
|
-
HtFallbackNode,
|
|
14
|
-
HtFlowBuilderData,
|
|
15
|
-
HtFlowWebview,
|
|
16
|
-
HtGoToFlow,
|
|
17
|
-
HtKeywordNode,
|
|
18
|
-
HtNodeComponent,
|
|
19
|
-
HtNodeLink,
|
|
20
|
-
HtNodeWithContent,
|
|
11
|
+
type HtBotActionNode,
|
|
12
|
+
type HtCaptureUserInputNode,
|
|
13
|
+
type HtFallbackNode,
|
|
14
|
+
type HtFlowBuilderData,
|
|
15
|
+
type HtFlowWebview,
|
|
16
|
+
type HtGoToFlow,
|
|
17
|
+
type HtKeywordNode,
|
|
18
|
+
type HtNodeComponent,
|
|
19
|
+
type HtNodeLink,
|
|
20
|
+
type HtNodeWithContent,
|
|
21
21
|
HtNodeWithContentType,
|
|
22
|
-
HtPayloadNode,
|
|
23
|
-
HtRatingButton,
|
|
24
|
-
HtRatingNode,
|
|
25
|
-
HtSmartIntentNode,
|
|
22
|
+
type HtPayloadNode,
|
|
23
|
+
type HtRatingButton,
|
|
24
|
+
type HtRatingNode,
|
|
25
|
+
type HtSmartIntentNode,
|
|
26
26
|
} from './content-fields/hubtype-fields'
|
|
27
|
-
import { FlowBuilderApiOptions, ProcessEnvNodeEnvs } from './types'
|
|
27
|
+
import { type FlowBuilderApiOptions, ProcessEnvNodeEnvs } from './types'
|
|
28
28
|
|
|
29
29
|
export class FlowBuilderApi {
|
|
30
30
|
url: string
|
|
@@ -70,19 +70,25 @@ export class FlowBuilderApi {
|
|
|
70
70
|
|
|
71
71
|
getNodeByFlowId(id: string): HtNodeWithContent {
|
|
72
72
|
const subFlow = this.flow.flows.find(subFlow => subFlow.id === id)
|
|
73
|
-
if (!subFlow)
|
|
73
|
+
if (!subFlow) {
|
|
74
|
+
throw Error(`SubFlow with id: '${id}' not found`)
|
|
75
|
+
}
|
|
74
76
|
return this.getNodeById<HtNodeWithContent>(subFlow.start_node_id)
|
|
75
77
|
}
|
|
76
78
|
|
|
77
79
|
getNodeByCampaignId<T extends HtNodeComponent>(id: string): T {
|
|
78
80
|
const campaign = this.flow.campaigns.find(campaign => campaign.id === id)
|
|
79
|
-
if (!campaign)
|
|
81
|
+
if (!campaign) {
|
|
82
|
+
throw Error(`Campaign with id: '${id}' not found`)
|
|
83
|
+
}
|
|
80
84
|
return this.getNodeById<T>(campaign.start_node_id)
|
|
81
85
|
}
|
|
82
86
|
|
|
83
87
|
getNodeById<T extends HtNodeComponent>(id: string): T {
|
|
84
88
|
const node = this.flow.nodes.find(node => node.id === id)
|
|
85
|
-
if (!node)
|
|
89
|
+
if (!node) {
|
|
90
|
+
console.error(`Node with id: '${id}' not found`)
|
|
91
|
+
}
|
|
86
92
|
|
|
87
93
|
return node as T
|
|
88
94
|
}
|
|
@@ -117,13 +123,17 @@ export class FlowBuilderApi {
|
|
|
117
123
|
const content = this.flow.nodes.find(node =>
|
|
118
124
|
'code' in node ? node.code === contentID : false
|
|
119
125
|
)
|
|
120
|
-
if (!content)
|
|
126
|
+
if (!content) {
|
|
127
|
+
throw Error(`Node with contentID: '${contentID}' not found`)
|
|
128
|
+
}
|
|
121
129
|
return content
|
|
122
130
|
}
|
|
123
131
|
|
|
124
132
|
getStartNode(): HtNodeWithContent {
|
|
125
133
|
const startNodeId = this.flow.start_node_id
|
|
126
|
-
if (!startNodeId)
|
|
134
|
+
if (!startNodeId) {
|
|
135
|
+
throw new Error('Start node id must be defined')
|
|
136
|
+
}
|
|
127
137
|
return this.getNodeById(startNodeId)
|
|
128
138
|
}
|
|
129
139
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ActionRequest } from '@botonic/react'
|
|
1
|
+
import type { ActionRequest } from '@botonic/react'
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
ACCESS_TOKEN_VARIABLE_KEY,
|
|
5
5
|
VARIABLE_PATTERN_GLOBAL,
|
|
6
6
|
} from '../constants'
|
|
7
7
|
import { getValueFromKeyPath } from '../utils'
|
|
8
|
-
import {
|
|
8
|
+
import type {
|
|
9
9
|
HtMediaFileLocale,
|
|
10
10
|
HtNodeLink,
|
|
11
11
|
HtQueueLocale,
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { AgenticOutputMessage } from '@botonic/core'
|
|
2
|
-
import { ActionRequest } from '@botonic/react'
|
|
1
|
+
import type { AgenticOutputMessage } from '@botonic/core'
|
|
2
|
+
import type { ActionRequest } from '@botonic/react'
|
|
3
3
|
|
|
4
4
|
import { trackOneContent } from '../tracking'
|
|
5
5
|
import { ContentFieldsBase } from './content-fields-base'
|
|
6
6
|
import { FlowCarousel } from './flow-carousel'
|
|
7
7
|
import { FlowText } from './flow-text'
|
|
8
|
-
import {
|
|
8
|
+
import type {
|
|
9
|
+
HtAiAgentNode,
|
|
10
|
+
HtInputGuardrailRule,
|
|
11
|
+
} from './hubtype-fields/ai-agent'
|
|
9
12
|
|
|
10
13
|
export class FlowAiAgent extends ContentFieldsBase {
|
|
11
14
|
public name: string = ''
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { BotonicAction, EventAction, EventBotAction } from '@botonic/core'
|
|
2
|
-
import { ActionRequest } from '@botonic/react'
|
|
1
|
+
import { BotonicAction, EventAction, type EventBotAction } 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 {
|
|
6
6
|
getCommonFlowContentEventArgsForContentId,
|
|
7
7
|
trackEvent,
|
|
8
8
|
} from '../tracking'
|
|
9
9
|
import { ContentFieldsBase } from './content-fields-base'
|
|
10
|
-
import { HtBotActionNode } from './hubtype-fields'
|
|
10
|
+
import type { HtBotActionNode } from './hubtype-fields'
|
|
11
11
|
|
|
12
12
|
export class FlowBotAction extends ContentFieldsBase {
|
|
13
13
|
public code: string
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import { ActionRequest, Button, Reply, Webview } from '@botonic/react'
|
|
2
|
-
import React from 'react'
|
|
1
|
+
import { type ActionRequest, Button, Reply, type Webview } from '@botonic/react'
|
|
3
2
|
|
|
4
|
-
import { FlowBuilderApi } from '../api'
|
|
3
|
+
import type { FlowBuilderApi } from '../api'
|
|
5
4
|
import { SOURCE_INFO_SEPARATOR } from '../constants'
|
|
6
5
|
import { ContentFieldsBase } from './content-fields-base'
|
|
7
6
|
import { FlowWebview } from './flow-webview'
|
|
8
7
|
import {
|
|
9
|
-
HtButton,
|
|
8
|
+
type HtButton,
|
|
10
9
|
HtButtonStyle,
|
|
11
|
-
HtNodeWithContent,
|
|
10
|
+
type HtNodeWithContent,
|
|
12
11
|
HtNodeWithContentType,
|
|
13
|
-
HtUrlNode,
|
|
12
|
+
type HtUrlNode,
|
|
14
13
|
} from './hubtype-fields'
|
|
15
|
-
import { HtRatingButton } from './hubtype-fields/rating'
|
|
14
|
+
import type { HtRatingButton } from './hubtype-fields/rating'
|
|
16
15
|
|
|
17
16
|
export class FlowButton extends ContentFieldsBase {
|
|
18
17
|
public text = ''
|
|
@@ -28,15 +27,15 @@ export class FlowButton extends ContentFieldsBase {
|
|
|
28
27
|
locale: string,
|
|
29
28
|
cmsApi: FlowBuilderApi
|
|
30
29
|
): FlowButton {
|
|
31
|
-
const urlId =
|
|
30
|
+
const urlId = FlowButton.getUrlId(cmsButton, locale)
|
|
32
31
|
|
|
33
32
|
const newButton = new FlowButton(cmsButton.id)
|
|
34
|
-
newButton.text =
|
|
33
|
+
newButton.text = FlowButton.getTextByLocale(locale, cmsButton.text)
|
|
35
34
|
if (cmsButton.target) {
|
|
36
|
-
const webview =
|
|
35
|
+
const webview = FlowButton.getTargetWebview(cmsApi, cmsButton.target.id)
|
|
37
36
|
if (webview) {
|
|
38
37
|
newButton.flowWebview = webview
|
|
39
|
-
const params =
|
|
38
|
+
const params = FlowButton.getWebviewParams(webview, cmsApi)
|
|
40
39
|
newButton.webview = { name: webview.webviewComponentName }
|
|
41
40
|
newButton.params = params
|
|
42
41
|
} else {
|
|
@@ -59,7 +58,10 @@ export class FlowButton extends ContentFieldsBase {
|
|
|
59
58
|
const params: Record<string, string> = {
|
|
60
59
|
webviewId: webview.webviewTargetId,
|
|
61
60
|
}
|
|
62
|
-
const exitSuccessContentID =
|
|
61
|
+
const exitSuccessContentID = FlowButton.getExitSuccessContentID(
|
|
62
|
+
webview,
|
|
63
|
+
cmsApi
|
|
64
|
+
)
|
|
63
65
|
|
|
64
66
|
if (exitSuccessContentID) {
|
|
65
67
|
params.exitSuccessContentID = exitSuccessContentID
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ActionRequest } from '@botonic/react'
|
|
1
|
+
import type { ActionRequest } from '@botonic/react'
|
|
2
2
|
|
|
3
3
|
import { getFlowBuilderPlugin } from '../helpers'
|
|
4
4
|
import { ContentFieldsBase } from './content-fields-base'
|
|
5
5
|
import {
|
|
6
6
|
HtAiValidationType,
|
|
7
|
-
HtCaptureUserInputNode,
|
|
7
|
+
type HtCaptureUserInputNode,
|
|
8
8
|
} from './hubtype-fields/capture-user-input'
|
|
9
9
|
|
|
10
10
|
export class FlowCaptureUserInput extends ContentFieldsBase {
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import { CarouselMessage, isWhatsapp } from '@botonic/core'
|
|
1
|
+
import { type CarouselMessage, isWhatsapp } from '@botonic/core'
|
|
2
2
|
import {
|
|
3
|
-
ActionRequest,
|
|
3
|
+
type ActionRequest,
|
|
4
4
|
Button,
|
|
5
5
|
CardType,
|
|
6
6
|
Carousel,
|
|
7
7
|
Text,
|
|
8
8
|
WhatsappCTAUrlButton,
|
|
9
9
|
WhatsappCTAUrlHeaderType,
|
|
10
|
-
WhatsappInteractiveMediaCard,
|
|
10
|
+
type WhatsappInteractiveMediaCard,
|
|
11
11
|
WhatsappInteractiveMediaCarousel,
|
|
12
12
|
} from '@botonic/react'
|
|
13
|
-
import React from 'react'
|
|
14
13
|
|
|
15
|
-
import { FlowBuilderApi } from '../api'
|
|
14
|
+
import type { FlowBuilderApi } from '../api'
|
|
16
15
|
import { trackOneContent } from '../tracking'
|
|
17
16
|
import { ContentFieldsBase } from './content-fields-base'
|
|
18
17
|
import { FlowElement } from './flow-element'
|
|
19
|
-
import { HtCarouselNode } from './hubtype-fields'
|
|
18
|
+
import type { HtCarouselNode } from './hubtype-fields'
|
|
20
19
|
|
|
21
20
|
const DEFAULT_TEXT_MESSAGE = 'These are the options'
|
|
22
21
|
export class FlowCarousel extends ContentFieldsBase {
|
|
@@ -33,7 +32,7 @@ export class FlowCarousel extends ContentFieldsBase {
|
|
|
33
32
|
newCarousel.elements = component.content.elements.map(element =>
|
|
34
33
|
FlowElement.fromHubtypeCMS(element, locale, cmsApi)
|
|
35
34
|
)
|
|
36
|
-
newCarousel.whatsappText =
|
|
35
|
+
newCarousel.whatsappText = FlowCarousel.getTextByLocale(
|
|
37
36
|
locale,
|
|
38
37
|
component.content.whatsapp_text
|
|
39
38
|
)
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { EventAction, EventConditionalChannel } from '@botonic/core'
|
|
2
|
-
import { ActionRequest } from '@botonic/react'
|
|
1
|
+
import { EventAction, type EventConditionalChannel } from '@botonic/core'
|
|
2
|
+
import type { ActionRequest } from '@botonic/react'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
getCommonFlowContentEventArgsForContentId,
|
|
6
6
|
trackEvent,
|
|
7
7
|
} from '../tracking'
|
|
8
8
|
import { ContentFieldsBase } from './content-fields-base'
|
|
9
|
-
import { HtChannelConditionalNode } from './hubtype-fields/channel-conditional'
|
|
10
|
-
import { HtFunctionResult } from './hubtype-fields/function'
|
|
9
|
+
import type { HtChannelConditionalNode } from './hubtype-fields/channel-conditional'
|
|
10
|
+
import type { HtFunctionResult } from './hubtype-fields/function'
|
|
11
11
|
|
|
12
12
|
export class FlowChannelConditional extends ContentFieldsBase {
|
|
13
13
|
public resultMapping: HtFunctionResult[] = []
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { EventAction, EventConditionalCountry } from '@botonic/core'
|
|
2
|
-
import { ActionRequest } from '@botonic/react'
|
|
1
|
+
import { EventAction, type EventConditionalCountry } from '@botonic/core'
|
|
2
|
+
import type { ActionRequest } from '@botonic/react'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
getCommonFlowContentEventArgsForContentId,
|
|
6
6
|
trackEvent,
|
|
7
7
|
} from '../tracking'
|
|
8
8
|
import { ContentFieldsBase } from './content-fields-base'
|
|
9
|
-
import { HtFunctionResult } from './hubtype-fields'
|
|
10
|
-
import { HtCountryConditionalNode } from './hubtype-fields/country-conditional'
|
|
9
|
+
import type { HtFunctionResult } from './hubtype-fields'
|
|
10
|
+
import type { HtCountryConditionalNode } from './hubtype-fields/country-conditional'
|
|
11
11
|
|
|
12
12
|
export class FlowCountryConditional extends ContentFieldsBase {
|
|
13
13
|
public resultMapping: HtFunctionResult[] = []
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EventAction, EventConditionalCustom } from '@botonic/core'
|
|
2
|
-
import { ActionRequest } from '@botonic/react'
|
|
1
|
+
import { EventAction, type EventConditionalCustom } from '@botonic/core'
|
|
2
|
+
import type { ActionRequest } from '@botonic/react'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
getCommonFlowContentEventArgsForContentId,
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
} from '../tracking'
|
|
8
8
|
import { getValueFromKeyPath } from '../utils'
|
|
9
9
|
import { ContentFieldsBase } from './content-fields-base'
|
|
10
|
-
import { HtCustomConditionalNode } from './hubtype-fields/custom-conditional'
|
|
11
|
-
import {
|
|
10
|
+
import type { HtCustomConditionalNode } from './hubtype-fields/custom-conditional'
|
|
11
|
+
import type {
|
|
12
12
|
HtFunctionArgument,
|
|
13
13
|
HtFunctionArguments,
|
|
14
14
|
HtFunctionResult,
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import { Button } from '@botonic/core'
|
|
2
|
-
import {
|
|
1
|
+
import type { Button } from '@botonic/core'
|
|
2
|
+
import {
|
|
3
|
+
type ActionRequest,
|
|
4
|
+
Element,
|
|
5
|
+
Pic,
|
|
6
|
+
Subtitle,
|
|
7
|
+
Title,
|
|
8
|
+
} from '@botonic/react'
|
|
3
9
|
|
|
4
|
-
import { FlowBuilderApi } from '../api'
|
|
10
|
+
import type { FlowBuilderApi } from '../api'
|
|
5
11
|
import { ContentFieldsBase } from './content-fields-base'
|
|
6
12
|
import { FlowButton } from './flow-button'
|
|
7
|
-
import { HtCarouselElement } from './hubtype-fields'
|
|
13
|
+
import type { HtCarouselElement } from './hubtype-fields'
|
|
8
14
|
|
|
9
15
|
export class FlowElement extends ContentFieldsBase {
|
|
10
16
|
public title = ''
|
|
@@ -19,9 +25,12 @@ export class FlowElement extends ContentFieldsBase {
|
|
|
19
25
|
cmsApi: FlowBuilderApi
|
|
20
26
|
): FlowElement {
|
|
21
27
|
const newElement = new FlowElement(component.id)
|
|
22
|
-
newElement.title =
|
|
23
|
-
newElement.subtitle =
|
|
24
|
-
|
|
28
|
+
newElement.title = FlowElement.getTextByLocale(locale, component.title)
|
|
29
|
+
newElement.subtitle = FlowElement.getTextByLocale(
|
|
30
|
+
locale,
|
|
31
|
+
component.subtitle
|
|
32
|
+
)
|
|
33
|
+
newElement.image = FlowElement.getAssetByLocale(locale, component.image)
|
|
25
34
|
newElement.button = FlowButton.fromHubtypeCMS(
|
|
26
35
|
component.button,
|
|
27
36
|
locale,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { EventAction, EventRedirectFlow } from '@botonic/core'
|
|
2
|
-
import { ActionRequest } from '@botonic/react'
|
|
1
|
+
import { EventAction, type EventRedirectFlow } 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 {
|
|
6
6
|
getCommonFlowContentEventArgsForContentId,
|
|
7
7
|
trackEvent,
|
|
8
8
|
} from '../tracking'
|
|
9
9
|
import { ContentFieldsBase } from './content-fields-base'
|
|
10
|
-
import { HtGoToFlow, HtNodeWithContent } from './hubtype-fields'
|
|
10
|
+
import type { HtGoToFlow, HtNodeWithContent } from './hubtype-fields'
|
|
11
11
|
|
|
12
12
|
export class FlowGoToFlow extends ContentFieldsBase {
|
|
13
13
|
public flowTargetId: string = ''
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { HandOffBuilder, HelpdeskEvent, isDev, isWebchat } from '@botonic/core'
|
|
2
|
-
import { ActionRequest, WebchatSettings } from '@botonic/react'
|
|
2
|
+
import { type ActionRequest, WebchatSettings } from '@botonic/react'
|
|
3
3
|
|
|
4
|
-
import { FlowBuilderApi } from '../api'
|
|
4
|
+
import type { FlowBuilderApi } from '../api'
|
|
5
5
|
import { getCommonFlowContentEventArgsForContentId } from '../tracking'
|
|
6
6
|
import { ContentFieldsBase } from './content-fields-base'
|
|
7
|
-
import { HtHandoffNode, HtQueueLocale } from './hubtype-fields'
|
|
7
|
+
import type { HtHandoffNode, HtQueueLocale } from './hubtype-fields'
|
|
8
8
|
|
|
9
9
|
export class FlowHandoff extends ContentFieldsBase {
|
|
10
10
|
public queue?: HtQueueLocale
|
|
@@ -20,8 +20,14 @@ export class FlowHandoff extends ContentFieldsBase {
|
|
|
20
20
|
): FlowHandoff {
|
|
21
21
|
const newHandoff = new FlowHandoff(cmsHandoff.id)
|
|
22
22
|
newHandoff.code = cmsHandoff.code
|
|
23
|
-
newHandoff.queue =
|
|
24
|
-
|
|
23
|
+
newHandoff.queue = FlowHandoff.getQueueByLocale(
|
|
24
|
+
locale,
|
|
25
|
+
cmsHandoff.content.queue
|
|
26
|
+
)
|
|
27
|
+
newHandoff.onFinishPayload = FlowHandoff.getOnFinishPayload(
|
|
28
|
+
cmsHandoff,
|
|
29
|
+
cmsApi
|
|
30
|
+
)
|
|
25
31
|
newHandoff.handoffAutoAssign = cmsHandoff.content.has_auto_assign
|
|
26
32
|
newHandoff.hasQueuePositionChangedNotificationsEnabled =
|
|
27
33
|
cmsHandoff.content.has_queue_position_changed_notifications_enabled
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { ActionRequest, Image } from '@botonic/react'
|
|
2
|
-
import React from 'react'
|
|
1
|
+
import { type ActionRequest, Image } from '@botonic/react'
|
|
3
2
|
|
|
4
3
|
import { trackOneContent } from '../tracking'
|
|
5
4
|
import { ContentFieldsBase } from './content-fields-base'
|
|
6
|
-
import { HtImageNode } from './hubtype-fields'
|
|
5
|
+
import type { HtImageNode } from './hubtype-fields'
|
|
7
6
|
|
|
8
7
|
export class FlowImage extends ContentFieldsBase {
|
|
9
8
|
public src = ''
|
|
@@ -11,7 +10,7 @@ export class FlowImage extends ContentFieldsBase {
|
|
|
11
10
|
static fromHubtypeCMS(component: HtImageNode, locale: string): FlowImage {
|
|
12
11
|
const newImage = new FlowImage(component.id)
|
|
13
12
|
newImage.code = component.code
|
|
14
|
-
newImage.src =
|
|
13
|
+
newImage.src = FlowImage.getAssetByLocale(locale, component.content.image)
|
|
15
14
|
newImage.followUp = component.follow_up
|
|
16
15
|
|
|
17
16
|
return newImage
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { ActionRequest, Text } from '@botonic/react'
|
|
2
|
-
import React from 'react'
|
|
1
|
+
import { type ActionRequest, Text } from '@botonic/react'
|
|
3
2
|
|
|
4
|
-
import { trackOneContent } from '../tracking'
|
|
5
3
|
import { ContentFieldsBase } from './content-fields-base'
|
|
6
|
-
import { HtKnowledgeBaseNode } from './hubtype-fields'
|
|
4
|
+
import type { HtKnowledgeBaseNode } from './hubtype-fields'
|
|
7
5
|
|
|
8
6
|
export const DISABLED_MEMORY_LENGTH = 1
|
|
9
7
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { EventAction, EventConditionalQueueStatus } from '@botonic/core'
|
|
2
|
-
import { ActionRequest } from '@botonic/react'
|
|
3
|
-
import React from 'react'
|
|
1
|
+
import { EventAction, type EventConditionalQueueStatus } from '@botonic/core'
|
|
2
|
+
import type { ActionRequest } from '@botonic/react'
|
|
4
3
|
|
|
5
4
|
import { getArgumentsByLocale } from '../functions'
|
|
6
5
|
import { HubtypeQueuesApi } from '../services/hubtype-queues-api'
|
|
@@ -9,11 +8,11 @@ import {
|
|
|
9
8
|
trackEvent,
|
|
10
9
|
} from '../tracking'
|
|
11
10
|
import { ContentFieldsBase } from './content-fields-base'
|
|
12
|
-
import {
|
|
11
|
+
import type {
|
|
13
12
|
HtFunctionArguments,
|
|
14
13
|
HtFunctionResult,
|
|
15
14
|
} from './hubtype-fields/function'
|
|
16
|
-
import {
|
|
15
|
+
import type {
|
|
17
16
|
HtQueueStatusConditionalNode,
|
|
18
17
|
HtQueueStatusConditionalResultMapping,
|
|
19
18
|
} from './hubtype-fields/queue-status-conditional'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isDev, isWebchat, isWhatsapp } from '@botonic/core'
|
|
2
2
|
import {
|
|
3
|
-
ActionRequest,
|
|
3
|
+
type ActionRequest,
|
|
4
4
|
CustomRatingMessage,
|
|
5
5
|
Text,
|
|
6
6
|
WhatsappButtonList,
|
|
@@ -10,7 +10,7 @@ import { getFlowBuilderPlugin } from '../helpers'
|
|
|
10
10
|
import { trackOneContent } from '../tracking'
|
|
11
11
|
import { ContentFieldsBase } from './content-fields-base'
|
|
12
12
|
import { FlowButton } from './flow-button'
|
|
13
|
-
import { HtRatingNode, RatingType } from './hubtype-fields'
|
|
13
|
+
import { type HtRatingNode, RatingType } from './hubtype-fields'
|
|
14
14
|
|
|
15
15
|
export class FlowRating extends ContentFieldsBase {
|
|
16
16
|
public text = ''
|
|
@@ -22,8 +22,8 @@ export class FlowRating extends ContentFieldsBase {
|
|
|
22
22
|
static fromHubtypeCMS(cmsText: HtRatingNode, locale: string): FlowRating {
|
|
23
23
|
const newRating = new FlowRating(cmsText.id)
|
|
24
24
|
newRating.code = cmsText.code
|
|
25
|
-
newRating.text =
|
|
26
|
-
newRating.sendButtonText =
|
|
25
|
+
newRating.text = FlowRating.getTextByLocale(locale, cmsText.content.text)
|
|
26
|
+
newRating.sendButtonText = FlowRating.getTextByLocale(
|
|
27
27
|
locale,
|
|
28
28
|
cmsText.content.send_button_text
|
|
29
29
|
)
|
|
@@ -31,7 +31,7 @@ export class FlowRating extends ContentFieldsBase {
|
|
|
31
31
|
newRating.buttons = cmsText.content.buttons.map(button =>
|
|
32
32
|
FlowButton.fromRating(button)
|
|
33
33
|
)
|
|
34
|
-
newRating.openListButtonText =
|
|
34
|
+
newRating.openListButtonText = FlowRating.getTextByLocale(
|
|
35
35
|
locale,
|
|
36
36
|
cmsText.content.open_list_button_text
|
|
37
37
|
)
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { TextMessage, TextWithButtonsMessage } from '@botonic/core'
|
|
2
|
-
import { ActionRequest, Text } from '@botonic/react'
|
|
3
|
-
import React from 'react'
|
|
1
|
+
import type { TextMessage, TextWithButtonsMessage } from '@botonic/core'
|
|
2
|
+
import { type ActionRequest, Text } from '@botonic/react'
|
|
4
3
|
|
|
5
|
-
import { FlowBuilderApi } from '../api'
|
|
4
|
+
import type { FlowBuilderApi } from '../api'
|
|
6
5
|
import { EMPTY_PAYLOAD, SOURCE_INFO_SEPARATOR } from '../constants'
|
|
7
6
|
import { trackOneContent } from '../tracking'
|
|
8
7
|
import { ContentFieldsBase } from './content-fields-base'
|
|
9
8
|
import { FlowButton } from './flow-button'
|
|
10
|
-
import { HtButtonStyle, HtTextNode } from './hubtype-fields'
|
|
9
|
+
import { HtButtonStyle, type HtTextNode } from './hubtype-fields'
|
|
11
10
|
|
|
12
11
|
export class FlowText extends ContentFieldsBase {
|
|
13
12
|
public text = ''
|
|
@@ -22,7 +21,7 @@ export class FlowText extends ContentFieldsBase {
|
|
|
22
21
|
const newText = new FlowText(cmsText.id)
|
|
23
22
|
newText.code = cmsText.code
|
|
24
23
|
newText.buttonStyle = cmsText.content.buttons_style || HtButtonStyle.BUTTON
|
|
25
|
-
newText.text =
|
|
24
|
+
newText.text = FlowText.getTextByLocale(locale, cmsText.content.text)
|
|
26
25
|
newText.buttons = cmsText.content.buttons.map(button =>
|
|
27
26
|
FlowButton.fromHubtypeCMS(button, locale, cmsApi)
|
|
28
27
|
)
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { ActionRequest, Video } from '@botonic/react'
|
|
2
|
-
import React from 'react'
|
|
1
|
+
import { type ActionRequest, Video } from '@botonic/react'
|
|
3
2
|
|
|
4
3
|
import { trackOneContent } from '../tracking'
|
|
5
4
|
import { ContentFieldsBase } from './content-fields-base'
|
|
6
|
-
import { HtVideoNode } from './hubtype-fields'
|
|
5
|
+
import type { HtVideoNode } from './hubtype-fields'
|
|
7
6
|
|
|
8
7
|
export class FlowVideo extends ContentFieldsBase {
|
|
9
8
|
public src = ''
|
|
@@ -11,7 +10,7 @@ export class FlowVideo extends ContentFieldsBase {
|
|
|
11
10
|
static fromHubtypeCMS(component: HtVideoNode, locale: string): FlowVideo {
|
|
12
11
|
const newVideo = new FlowVideo(component.id)
|
|
13
12
|
newVideo.code = component.code
|
|
14
|
-
newVideo.src =
|
|
13
|
+
newVideo.src = FlowVideo.getVideoByLocale(locale, component.content.video)
|
|
15
14
|
newVideo.followUp = component.follow_up
|
|
16
15
|
|
|
17
16
|
return newVideo
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { EventAction, EventWebviewActionTriggered } from '@botonic/core'
|
|
2
|
-
import { ActionRequest } from '@botonic/react'
|
|
1
|
+
import { EventAction, type EventWebviewActionTriggered } from '@botonic/core'
|
|
2
|
+
import type { ActionRequest } from '@botonic/react'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
getCommonFlowContentEventArgsForContentId,
|
|
6
6
|
trackEvent,
|
|
7
7
|
} from '../tracking'
|
|
8
8
|
import { ContentFieldsBase } from './content-fields-base'
|
|
9
|
-
import { HtWebviewExits, HtWebviewNode } from './hubtype-fields'
|
|
9
|
+
import type { HtWebviewExits, HtWebviewNode } from './hubtype-fields'
|
|
10
10
|
|
|
11
11
|
export class FlowWebview extends ContentFieldsBase {
|
|
12
12
|
public webviewTargetId: string = ''
|