@botonic/plugin-flow-builder 0.57.0-rslib-esm.1 → 0.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/cjs/action/ai-agent-from-user-input.d.ts +3 -0
- package/lib/cjs/action/ai-agent-from-user-input.js +38 -0
- package/lib/cjs/action/ai-agent-from-user-input.js.map +1 -0
- package/lib/cjs/action/context.d.ts +11 -0
- package/lib/cjs/action/context.js +17 -0
- package/lib/cjs/action/context.js.map +1 -0
- package/lib/cjs/action/fallback.d.ts +3 -0
- package/lib/cjs/action/fallback.js +36 -0
- package/lib/cjs/action/fallback.js.map +1 -0
- package/lib/cjs/action/first-interaction.d.ts +3 -0
- package/lib/cjs/action/first-interaction.js +93 -0
- package/lib/cjs/action/first-interaction.js.map +1 -0
- package/lib/cjs/action/get-contents.d.ts +3 -0
- package/lib/cjs/action/get-contents.js +44 -0
- package/lib/cjs/action/get-contents.js.map +1 -0
- package/lib/cjs/action/index.d.ts +25 -0
- package/lib/cjs/action/index.js +95 -0
- package/lib/cjs/action/index.js.map +1 -0
- package/lib/cjs/action/payload.d.ts +3 -0
- package/lib/cjs/action/payload.js +74 -0
- package/lib/cjs/action/payload.js.map +1 -0
- package/lib/cjs/api.d.ts +45 -0
- package/lib/cjs/api.js +227 -0
- package/lib/cjs/api.js.map +1 -0
- package/lib/cjs/bot-context-manager.d.ts +17 -0
- package/lib/cjs/bot-context-manager.js +93 -0
- package/lib/cjs/bot-context-manager.js.map +1 -0
- package/lib/cjs/constants.d.ts +14 -0
- package/lib/cjs/constants.js +20 -0
- package/lib/cjs/constants.js.map +1 -0
- package/lib/cjs/content-fields/contact-reasons-conditional-matcher.d.ts +4 -0
- package/lib/cjs/content-fields/contact-reasons-conditional-matcher.js +12 -0
- package/lib/cjs/content-fields/contact-reasons-conditional-matcher.js.map +1 -0
- package/lib/cjs/content-fields/content-fields-base.d.ts +20 -0
- package/lib/cjs/content-fields/content-fields-base.js +74 -0
- package/lib/cjs/content-fields/content-fields-base.js.map +1 -0
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.d.ts +15 -0
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +71 -0
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +1 -0
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.d.ts +9 -0
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.js +58 -0
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +1 -0
- package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.d.ts +17 -0
- package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.js +79 -0
- package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.js.map +1 -0
- package/lib/cjs/content-fields/flow-ai-agent-base.d.ts +25 -0
- package/lib/cjs/content-fields/flow-ai-agent-base.js +97 -0
- package/lib/cjs/content-fields/flow-ai-agent-base.js.map +1 -0
- package/lib/cjs/content-fields/flow-ai-agent-router.d.ts +21 -0
- package/lib/cjs/content-fields/flow-ai-agent-router.js +126 -0
- package/lib/cjs/content-fields/flow-ai-agent-router.js.map +1 -0
- package/lib/cjs/content-fields/flow-ai-agent.d.ts +17 -0
- package/lib/cjs/content-fields/flow-ai-agent.js +65 -0
- package/lib/cjs/content-fields/flow-ai-agent.js.map +1 -0
- package/lib/cjs/content-fields/flow-bot-action.d.ts +14 -0
- package/lib/cjs/content-fields/flow-bot-action.js +45 -0
- package/lib/cjs/content-fields/flow-bot-action.js.map +1 -0
- package/lib/cjs/content-fields/flow-button.d.ts +31 -0
- package/lib/cjs/content-fields/flow-button.js +86 -0
- package/lib/cjs/content-fields/flow-button.js.map +1 -0
- package/lib/cjs/content-fields/flow-capture-user-input.d.ts +14 -0
- package/lib/cjs/content-fields/flow-capture-user-input.js +45 -0
- package/lib/cjs/content-fields/flow-capture-user-input.js.map +1 -0
- package/lib/cjs/content-fields/flow-carousel.d.ts +22 -0
- package/lib/cjs/content-fields/flow-carousel.js +152 -0
- package/lib/cjs/content-fields/flow-carousel.js.map +1 -0
- package/lib/cjs/content-fields/flow-channel-conditional.d.ts +14 -0
- package/lib/cjs/content-fields/flow-channel-conditional.js +57 -0
- package/lib/cjs/content-fields/flow-channel-conditional.js.map +1 -0
- package/lib/cjs/content-fields/flow-contact-reasons-conditional.d.ts +14 -0
- package/lib/cjs/content-fields/flow-contact-reasons-conditional.js +65 -0
- package/lib/cjs/content-fields/flow-contact-reasons-conditional.js.map +1 -0
- package/lib/cjs/content-fields/flow-country-conditional.d.ts +13 -0
- package/lib/cjs/content-fields/flow-country-conditional.js +59 -0
- package/lib/cjs/content-fields/flow-country-conditional.js.map +1 -0
- package/lib/cjs/content-fields/flow-custom-conditional.d.ts +17 -0
- package/lib/cjs/content-fields/flow-custom-conditional.js +89 -0
- package/lib/cjs/content-fields/flow-custom-conditional.js.map +1 -0
- package/lib/cjs/content-fields/flow-do-nothing.d.ts +9 -0
- package/lib/cjs/content-fields/flow-do-nothing.js +27 -0
- package/lib/cjs/content-fields/flow-do-nothing.js.map +1 -0
- package/lib/cjs/content-fields/flow-element.d.ts +22 -0
- package/lib/cjs/content-fields/flow-element.js +50 -0
- package/lib/cjs/content-fields/flow-element.js.map +1 -0
- package/lib/cjs/content-fields/flow-go-to-flow.d.ts +13 -0
- package/lib/cjs/content-fields/flow-go-to-flow.js +51 -0
- package/lib/cjs/content-fields/flow-go-to-flow.js.map +1 -0
- package/lib/cjs/content-fields/flow-handoff.d.ts +23 -0
- package/lib/cjs/content-fields/flow-handoff.js +104 -0
- package/lib/cjs/content-fields/flow-handoff.js.map +1 -0
- package/lib/cjs/content-fields/flow-image.d.ts +10 -0
- package/lib/cjs/content-fields/flow-image.js +33 -0
- package/lib/cjs/content-fields/flow-image.js.map +1 -0
- package/lib/cjs/content-fields/flow-queue-status-conditional.d.ts +30 -0
- package/lib/cjs/content-fields/flow-queue-status-conditional.js +95 -0
- package/lib/cjs/content-fields/flow-queue-status-conditional.js.map +1 -0
- package/lib/cjs/content-fields/flow-rating.d.ts +15 -0
- package/lib/cjs/content-fields/flow-rating.js +66 -0
- package/lib/cjs/content-fields/flow-rating.js.map +1 -0
- package/lib/cjs/content-fields/flow-text.d.ts +15 -0
- package/lib/cjs/content-fields/flow-text.js +60 -0
- package/lib/cjs/content-fields/flow-text.js.map +1 -0
- package/lib/cjs/content-fields/flow-video.d.ts +10 -0
- package/lib/cjs/content-fields/flow-video.js +33 -0
- package/lib/cjs/content-fields/flow-video.js.map +1 -0
- package/lib/cjs/content-fields/flow-webview.d.ts +16 -0
- package/lib/cjs/content-fields/flow-webview.js +78 -0
- package/lib/cjs/content-fields/flow-webview.js.map +1 -0
- package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.d.ts +21 -0
- package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js +92 -0
- package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js.map +1 -0
- package/lib/cjs/content-fields/flow-whatsapp-request-contact-info.d.ts +11 -0
- package/lib/cjs/content-fields/flow-whatsapp-request-contact-info.js +46 -0
- package/lib/cjs/content-fields/flow-whatsapp-request-contact-info.js.map +1 -0
- package/lib/cjs/content-fields/flow-whatsapp-template.d.ts +37 -0
- package/lib/cjs/content-fields/flow-whatsapp-template.js +264 -0
- package/lib/cjs/content-fields/flow-whatsapp-template.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/ai-agent-router.d.ts +21 -0
- package/lib/cjs/content-fields/hubtype-fields/ai-agent-router.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/ai-agent-router.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/ai-agent.d.ts +25 -0
- package/lib/cjs/content-fields/hubtype-fields/ai-agent.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/ai-agent.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/bot-action.d.ts +10 -0
- package/lib/cjs/content-fields/hubtype-fields/bot-action.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/bot-action.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/button.d.ts +8 -0
- package/lib/cjs/content-fields/hubtype-fields/button.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/button.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/capture-user-input.d.ts +19 -0
- package/lib/cjs/content-fields/hubtype-fields/capture-user-input.js +12 -0
- package/lib/cjs/content-fields/hubtype-fields/capture-user-input.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/carousel.d.ts +17 -0
- package/lib/cjs/content-fields/hubtype-fields/carousel.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/carousel.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/channel-conditional.d.ts +10 -0
- package/lib/cjs/content-fields/hubtype-fields/channel-conditional.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/channel-conditional.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/common.d.ts +83 -0
- package/lib/cjs/content-fields/hubtype-fields/common.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/common.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/contact-reasons-conditional.d.ts +16 -0
- package/lib/cjs/content-fields/hubtype-fields/contact-reasons-conditional.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/contact-reasons-conditional.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/country-conditional.d.ts +10 -0
- package/lib/cjs/content-fields/hubtype-fields/country-conditional.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/country-conditional.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.d.ts +56 -0
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.js +36 -0
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional.d.ts +11 -0
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/do-nothing.d.ts +6 -0
- package/lib/cjs/content-fields/hubtype-fields/do-nothing.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/do-nothing.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/fallback.d.ts +9 -0
- package/lib/cjs/content-fields/hubtype-fields/fallback.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/fallback.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/function.d.ts +30 -0
- package/lib/cjs/content-fields/hubtype-fields/function.js +11 -0
- package/lib/cjs/content-fields/hubtype-fields/function.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/go-to-flow.d.ts +9 -0
- package/lib/cjs/content-fields/hubtype-fields/go-to-flow.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/go-to-flow.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/handoff.d.ts +21 -0
- package/lib/cjs/content-fields/hubtype-fields/handoff.js +10 -0
- package/lib/cjs/content-fields/hubtype-fields/handoff.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/image.d.ts +8 -0
- package/lib/cjs/content-fields/hubtype-fields/image.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/image.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/index.d.ts +28 -0
- package/lib/cjs/content-fields/hubtype-fields/index.js +32 -0
- package/lib/cjs/content-fields/hubtype-fields/index.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/keyword.d.ts +9 -0
- package/lib/cjs/content-fields/hubtype-fields/keyword.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/keyword.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/node-types.d.ts +33 -0
- package/lib/cjs/content-fields/hubtype-fields/node-types.js +40 -0
- package/lib/cjs/content-fields/hubtype-fields/node-types.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/nodes.d.ts +28 -0
- package/lib/cjs/content-fields/hubtype-fields/nodes.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/nodes.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/payload.d.ts +8 -0
- package/lib/cjs/content-fields/hubtype-fields/payload.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/payload.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.d.ts +25 -0
- package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/rating.d.ts +23 -0
- package/lib/cjs/content-fields/hubtype-fields/rating.js +9 -0
- package/lib/cjs/content-fields/hubtype-fields/rating.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/smart-intent.d.ts +12 -0
- package/lib/cjs/content-fields/hubtype-fields/smart-intent.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/smart-intent.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/text.d.ts +11 -0
- package/lib/cjs/content-fields/hubtype-fields/text.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/text.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/url.d.ts +8 -0
- package/lib/cjs/content-fields/hubtype-fields/url.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/url.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/video.d.ts +8 -0
- package/lib/cjs/content-fields/hubtype-fields/video.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/video.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/webview.d.ts +17 -0
- package/lib/cjs/content-fields/hubtype-fields/webview.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/webview.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.d.ts +21 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.d.ts +17 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-request-contact-info.d.ts +10 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-request-contact-info.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.d.ts +96 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.js +9 -0
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.js.map +1 -0
- package/lib/cjs/content-fields/index.d.ts +27 -0
- package/lib/cjs/content-fields/index.js +56 -0
- package/lib/cjs/content-fields/index.js.map +1 -0
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +14 -0
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +41 -0
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +1 -0
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +13 -0
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +36 -0
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +1 -0
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +14 -0
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +46 -0
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +1 -0
- package/lib/cjs/content-fields/whatsapp-button-list/index.d.ts +3 -0
- package/lib/cjs/content-fields/whatsapp-button-list/index.js +10 -0
- package/lib/cjs/content-fields/whatsapp-button-list/index.js.map +1 -0
- package/lib/cjs/filters/index.d.ts +12 -0
- package/lib/cjs/filters/index.js +17 -0
- package/lib/cjs/filters/index.js.map +1 -0
- package/lib/cjs/flow-factory.d.ts +12 -0
- package/lib/cjs/flow-factory.js +73 -0
- package/lib/cjs/flow-factory.js.map +1 -0
- package/lib/cjs/functions/index.d.ts +11 -0
- package/lib/cjs/functions/index.js +49 -0
- package/lib/cjs/functions/index.js.map +1 -0
- package/lib/cjs/index.d.ts +42 -0
- package/lib/cjs/index.js +142 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/services/hubtype-queues-api.js +26 -0
- package/lib/cjs/services/hubtype-queues-api.js.map +1 -0
- package/lib/cjs/structured-output/flow-builder-content.js +15 -0
- package/lib/cjs/structured-output/flow-builder-content.js.map +1 -0
- package/lib/cjs/tracking.d.ts +16 -0
- package/lib/cjs/tracking.js +71 -0
- package/lib/cjs/tracking.js.map +1 -0
- package/lib/cjs/types.d.ts +62 -0
- package/lib/cjs/types.js +14 -0
- package/lib/cjs/types.js.map +1 -0
- package/lib/cjs/user-input/capture-user-input-api.d.ts +21 -0
- package/lib/cjs/user-input/capture-user-input-api.js +88 -0
- package/lib/cjs/user-input/capture-user-input-api.js.map +1 -0
- package/lib/cjs/user-input/index.d.ts +4 -0
- package/lib/cjs/user-input/index.js +37 -0
- package/lib/cjs/user-input/index.js.map +1 -0
- package/lib/cjs/user-input/keyword.d.ts +27 -0
- package/lib/cjs/user-input/keyword.js +84 -0
- package/lib/cjs/user-input/keyword.js.map +1 -0
- package/lib/cjs/user-input/smart-intent.d.ts +24 -0
- package/lib/cjs/user-input/smart-intent.js +89 -0
- package/lib/cjs/user-input/smart-intent.js.map +1 -0
- package/lib/cjs/utils/ai-agent.d.ts +11 -0
- package/lib/cjs/utils/ai-agent.js +28 -0
- package/lib/cjs/utils/ai-agent.js.map +1 -0
- package/lib/cjs/utils/authentication.js +21 -0
- package/lib/cjs/utils/authentication.js.map +1 -0
- package/lib/cjs/utils/flow-locale.js +79 -0
- package/lib/cjs/utils/flow-locale.js.map +1 -0
- package/lib/cjs/utils/get-flow-builder-plugin.d.ts +3 -0
- package/lib/cjs/utils/get-flow-builder-plugin.js +16 -0
- package/lib/cjs/utils/get-flow-builder-plugin.js.map +1 -0
- package/lib/cjs/utils/hubtype-assistant-content.d.ts +13 -0
- package/lib/cjs/utils/hubtype-assistant-content.js +184 -0
- package/lib/cjs/utils/hubtype-assistant-content.js.map +1 -0
- package/lib/cjs/utils/input.js +35 -0
- package/lib/cjs/utils/input.js.map +1 -0
- package/lib/cjs/webview/contents-context.d.ts +2 -0
- package/lib/cjs/webview/contents-context.js +12 -0
- package/lib/cjs/webview/contents-context.js.map +1 -0
- package/lib/cjs/webview/index.d.ts +3 -0
- package/lib/cjs/webview/index.js +10 -0
- package/lib/cjs/webview/index.js.map +1 -0
- package/lib/cjs/webview/types.d.ts +47 -0
- package/lib/cjs/webview/types.js +9 -0
- package/lib/cjs/webview/types.js.map +1 -0
- package/lib/cjs/webview/use-webview-contents.d.ts +2 -0
- package/lib/cjs/webview/use-webview-contents.js +83 -0
- package/lib/cjs/webview/use-webview-contents.js.map +1 -0
- package/lib/esm/action/ai-agent-from-user-input.d.ts +3 -0
- package/lib/esm/action/ai-agent-from-user-input.js +38 -0
- package/lib/esm/action/ai-agent-from-user-input.js.map +1 -0
- package/lib/esm/action/context.d.ts +11 -0
- package/lib/esm/action/context.js +17 -0
- package/lib/esm/action/context.js.map +1 -0
- package/lib/esm/action/fallback.d.ts +3 -0
- package/lib/esm/action/fallback.js +36 -0
- package/lib/esm/action/fallback.js.map +1 -0
- package/lib/esm/action/first-interaction.d.ts +3 -0
- package/lib/esm/action/first-interaction.js +93 -0
- package/lib/esm/action/first-interaction.js.map +1 -0
- package/lib/esm/action/get-contents.d.ts +3 -0
- package/lib/esm/action/get-contents.js +44 -0
- package/lib/esm/action/get-contents.js.map +1 -0
- package/lib/esm/action/index.d.ts +25 -0
- package/lib/esm/action/index.js +95 -0
- package/lib/esm/action/index.js.map +1 -0
- package/lib/esm/action/payload.d.ts +3 -0
- package/lib/esm/action/payload.js +74 -0
- package/lib/esm/action/payload.js.map +1 -0
- package/lib/esm/api.d.ts +45 -0
- package/lib/esm/api.js +227 -0
- package/lib/esm/api.js.map +1 -0
- package/lib/esm/bot-context-manager.d.ts +17 -0
- package/lib/esm/bot-context-manager.js +93 -0
- package/lib/esm/bot-context-manager.js.map +1 -0
- package/lib/esm/constants.d.ts +14 -0
- package/lib/esm/constants.js +20 -0
- package/lib/esm/constants.js.map +1 -0
- package/lib/esm/content-fields/contact-reasons-conditional-matcher.d.ts +4 -0
- package/lib/esm/content-fields/contact-reasons-conditional-matcher.js +12 -0
- package/lib/esm/content-fields/contact-reasons-conditional-matcher.js.map +1 -0
- package/lib/esm/content-fields/content-fields-base.d.ts +20 -0
- package/lib/esm/content-fields/content-fields-base.js +74 -0
- package/lib/esm/content-fields/content-fields-base.js.map +1 -0
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.d.ts +15 -0
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +71 -0
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +1 -0
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.d.ts +9 -0
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.js +58 -0
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +1 -0
- package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.d.ts +17 -0
- package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.js +79 -0
- package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.js.map +1 -0
- package/lib/esm/content-fields/flow-ai-agent-base.d.ts +25 -0
- package/lib/esm/content-fields/flow-ai-agent-base.js +97 -0
- package/lib/esm/content-fields/flow-ai-agent-base.js.map +1 -0
- package/lib/esm/content-fields/flow-ai-agent-router.d.ts +21 -0
- package/lib/esm/content-fields/flow-ai-agent-router.js +126 -0
- package/lib/esm/content-fields/flow-ai-agent-router.js.map +1 -0
- package/lib/esm/content-fields/flow-ai-agent.d.ts +17 -0
- package/lib/esm/content-fields/flow-ai-agent.js +65 -0
- package/lib/esm/content-fields/flow-ai-agent.js.map +1 -0
- package/lib/esm/content-fields/flow-bot-action.d.ts +14 -0
- package/lib/esm/content-fields/flow-bot-action.js +45 -0
- package/lib/esm/content-fields/flow-bot-action.js.map +1 -0
- package/lib/esm/content-fields/flow-button.d.ts +31 -0
- package/lib/esm/content-fields/flow-button.js +86 -0
- package/lib/esm/content-fields/flow-button.js.map +1 -0
- package/lib/esm/content-fields/flow-capture-user-input.d.ts +14 -0
- package/lib/esm/content-fields/flow-capture-user-input.js +45 -0
- package/lib/esm/content-fields/flow-capture-user-input.js.map +1 -0
- package/lib/esm/content-fields/flow-carousel.d.ts +22 -0
- package/lib/esm/content-fields/flow-carousel.js +152 -0
- package/lib/esm/content-fields/flow-carousel.js.map +1 -0
- package/lib/esm/content-fields/flow-channel-conditional.d.ts +14 -0
- package/lib/esm/content-fields/flow-channel-conditional.js +57 -0
- package/lib/esm/content-fields/flow-channel-conditional.js.map +1 -0
- package/lib/esm/content-fields/flow-contact-reasons-conditional.d.ts +14 -0
- package/lib/esm/content-fields/flow-contact-reasons-conditional.js +65 -0
- package/lib/esm/content-fields/flow-contact-reasons-conditional.js.map +1 -0
- package/lib/esm/content-fields/flow-country-conditional.d.ts +13 -0
- package/lib/esm/content-fields/flow-country-conditional.js +59 -0
- package/lib/esm/content-fields/flow-country-conditional.js.map +1 -0
- package/lib/esm/content-fields/flow-custom-conditional.d.ts +17 -0
- package/lib/esm/content-fields/flow-custom-conditional.js +89 -0
- package/lib/esm/content-fields/flow-custom-conditional.js.map +1 -0
- package/lib/esm/content-fields/flow-do-nothing.d.ts +9 -0
- package/lib/esm/content-fields/flow-do-nothing.js +27 -0
- package/lib/esm/content-fields/flow-do-nothing.js.map +1 -0
- package/lib/esm/content-fields/flow-element.d.ts +22 -0
- package/lib/esm/content-fields/flow-element.js +50 -0
- package/lib/esm/content-fields/flow-element.js.map +1 -0
- package/lib/esm/content-fields/flow-go-to-flow.d.ts +13 -0
- package/lib/esm/content-fields/flow-go-to-flow.js +51 -0
- package/lib/esm/content-fields/flow-go-to-flow.js.map +1 -0
- package/lib/esm/content-fields/flow-handoff.d.ts +23 -0
- package/lib/esm/content-fields/flow-handoff.js +104 -0
- package/lib/esm/content-fields/flow-handoff.js.map +1 -0
- package/lib/esm/content-fields/flow-image.d.ts +10 -0
- package/lib/esm/content-fields/flow-image.js +33 -0
- package/lib/esm/content-fields/flow-image.js.map +1 -0
- package/lib/esm/content-fields/flow-queue-status-conditional.d.ts +30 -0
- package/lib/esm/content-fields/flow-queue-status-conditional.js +95 -0
- package/lib/esm/content-fields/flow-queue-status-conditional.js.map +1 -0
- package/lib/esm/content-fields/flow-rating.d.ts +15 -0
- package/lib/esm/content-fields/flow-rating.js +66 -0
- package/lib/esm/content-fields/flow-rating.js.map +1 -0
- package/lib/esm/content-fields/flow-text.d.ts +15 -0
- package/lib/esm/content-fields/flow-text.js +60 -0
- package/lib/esm/content-fields/flow-text.js.map +1 -0
- package/lib/esm/content-fields/flow-video.d.ts +10 -0
- package/lib/esm/content-fields/flow-video.js +33 -0
- package/lib/esm/content-fields/flow-video.js.map +1 -0
- package/lib/esm/content-fields/flow-webview.d.ts +16 -0
- package/lib/esm/content-fields/flow-webview.js +78 -0
- package/lib/esm/content-fields/flow-webview.js.map +1 -0
- package/lib/esm/content-fields/flow-whatsapp-cta-url-button.d.ts +21 -0
- package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js +92 -0
- package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js.map +1 -0
- package/lib/esm/content-fields/flow-whatsapp-request-contact-info.d.ts +11 -0
- package/lib/esm/content-fields/flow-whatsapp-request-contact-info.js +46 -0
- package/lib/esm/content-fields/flow-whatsapp-request-contact-info.js.map +1 -0
- package/lib/esm/content-fields/flow-whatsapp-template.d.ts +37 -0
- package/lib/esm/content-fields/flow-whatsapp-template.js +264 -0
- package/lib/esm/content-fields/flow-whatsapp-template.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/ai-agent-router.d.ts +21 -0
- package/lib/esm/content-fields/hubtype-fields/ai-agent-router.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/ai-agent-router.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/ai-agent.d.ts +25 -0
- package/lib/esm/content-fields/hubtype-fields/ai-agent.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/ai-agent.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/bot-action.d.ts +10 -0
- package/lib/esm/content-fields/hubtype-fields/bot-action.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/bot-action.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/button.d.ts +8 -0
- package/lib/esm/content-fields/hubtype-fields/button.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/button.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/capture-user-input.d.ts +19 -0
- package/lib/esm/content-fields/hubtype-fields/capture-user-input.js +12 -0
- package/lib/esm/content-fields/hubtype-fields/capture-user-input.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/carousel.d.ts +17 -0
- package/lib/esm/content-fields/hubtype-fields/carousel.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/carousel.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/channel-conditional.d.ts +10 -0
- package/lib/esm/content-fields/hubtype-fields/channel-conditional.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/channel-conditional.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/common.d.ts +83 -0
- package/lib/esm/content-fields/hubtype-fields/common.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/common.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/contact-reasons-conditional.d.ts +16 -0
- package/lib/esm/content-fields/hubtype-fields/contact-reasons-conditional.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/contact-reasons-conditional.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/country-conditional.d.ts +10 -0
- package/lib/esm/content-fields/hubtype-fields/country-conditional.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/country-conditional.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/custom-conditional-v2.d.ts +56 -0
- package/lib/esm/content-fields/hubtype-fields/custom-conditional-v2.js +36 -0
- package/lib/esm/content-fields/hubtype-fields/custom-conditional-v2.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/custom-conditional.d.ts +11 -0
- package/lib/esm/content-fields/hubtype-fields/custom-conditional.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/custom-conditional.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/do-nothing.d.ts +6 -0
- package/lib/esm/content-fields/hubtype-fields/do-nothing.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/do-nothing.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/fallback.d.ts +9 -0
- package/lib/esm/content-fields/hubtype-fields/fallback.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/fallback.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/function.d.ts +30 -0
- package/lib/esm/content-fields/hubtype-fields/function.js +11 -0
- package/lib/esm/content-fields/hubtype-fields/function.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/go-to-flow.d.ts +9 -0
- package/lib/esm/content-fields/hubtype-fields/go-to-flow.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/go-to-flow.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/handoff.d.ts +21 -0
- package/lib/esm/content-fields/hubtype-fields/handoff.js +10 -0
- package/lib/esm/content-fields/hubtype-fields/handoff.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/image.d.ts +8 -0
- package/lib/esm/content-fields/hubtype-fields/image.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/image.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/index.d.ts +28 -0
- package/lib/esm/content-fields/hubtype-fields/index.js +32 -0
- package/lib/esm/content-fields/hubtype-fields/index.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/keyword.d.ts +9 -0
- package/lib/esm/content-fields/hubtype-fields/keyword.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/keyword.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/node-types.d.ts +33 -0
- package/lib/esm/content-fields/hubtype-fields/node-types.js +40 -0
- package/lib/esm/content-fields/hubtype-fields/node-types.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/nodes.d.ts +28 -0
- package/lib/esm/content-fields/hubtype-fields/nodes.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/nodes.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/payload.d.ts +8 -0
- package/lib/esm/content-fields/hubtype-fields/payload.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/payload.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.d.ts +25 -0
- package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/rating.d.ts +23 -0
- package/lib/esm/content-fields/hubtype-fields/rating.js +9 -0
- package/lib/esm/content-fields/hubtype-fields/rating.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/smart-intent.d.ts +12 -0
- package/lib/esm/content-fields/hubtype-fields/smart-intent.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/smart-intent.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/text.d.ts +11 -0
- package/lib/esm/content-fields/hubtype-fields/text.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/text.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/url.d.ts +8 -0
- package/lib/esm/content-fields/hubtype-fields/url.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/url.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/video.d.ts +8 -0
- package/lib/esm/content-fields/hubtype-fields/video.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/video.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/webview.d.ts +17 -0
- package/lib/esm/content-fields/hubtype-fields/webview.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/webview.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.d.ts +21 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.d.ts +17 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.d.ts +10 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-template.d.ts +96 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-template.js +9 -0
- package/lib/esm/content-fields/hubtype-fields/whatsapp-template.js.map +1 -0
- package/lib/esm/content-fields/index.d.ts +27 -0
- package/lib/esm/content-fields/index.js +56 -0
- package/lib/esm/content-fields/index.js.map +1 -0
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +14 -0
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +41 -0
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +1 -0
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +13 -0
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +36 -0
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +1 -0
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +14 -0
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +46 -0
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +1 -0
- package/lib/esm/content-fields/whatsapp-button-list/index.d.ts +3 -0
- package/lib/esm/content-fields/whatsapp-button-list/index.js +10 -0
- package/lib/esm/content-fields/whatsapp-button-list/index.js.map +1 -0
- package/lib/esm/filters/index.d.ts +12 -0
- package/lib/esm/filters/index.js +17 -0
- package/lib/esm/filters/index.js.map +1 -0
- package/lib/esm/flow-factory.d.ts +12 -0
- package/lib/esm/flow-factory.js +73 -0
- package/lib/esm/flow-factory.js.map +1 -0
- package/lib/esm/functions/index.d.ts +11 -0
- package/lib/esm/functions/index.js +49 -0
- package/lib/esm/functions/index.js.map +1 -0
- package/lib/esm/index.d.ts +42 -0
- package/lib/esm/index.js +142 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/services/hubtype-queues-api.d.ts +14 -0
- package/lib/esm/services/hubtype-queues-api.js +26 -0
- package/lib/esm/services/hubtype-queues-api.js.map +1 -0
- package/lib/esm/structured-output/flow-builder-content.d.ts +13 -0
- package/lib/esm/structured-output/flow-builder-content.js +15 -0
- package/lib/esm/structured-output/flow-builder-content.js.map +1 -0
- package/lib/esm/tracking.d.ts +16 -0
- package/lib/esm/tracking.js +71 -0
- package/lib/esm/tracking.js.map +1 -0
- package/lib/esm/types.d.ts +62 -0
- package/lib/esm/types.js +14 -0
- package/lib/esm/types.js.map +1 -0
- package/lib/esm/user-input/capture-user-input-api.d.ts +21 -0
- package/lib/esm/user-input/capture-user-input-api.js +88 -0
- package/lib/esm/user-input/capture-user-input-api.js.map +1 -0
- package/lib/esm/user-input/index.d.ts +4 -0
- package/lib/esm/user-input/index.js +37 -0
- package/lib/esm/user-input/index.js.map +1 -0
- package/lib/esm/user-input/keyword.d.ts +27 -0
- package/lib/esm/user-input/keyword.js +84 -0
- package/lib/esm/user-input/keyword.js.map +1 -0
- package/lib/esm/user-input/smart-intent.d.ts +24 -0
- package/lib/esm/user-input/smart-intent.js +89 -0
- package/lib/esm/user-input/smart-intent.js.map +1 -0
- package/lib/esm/utils/ai-agent.d.ts +11 -0
- package/lib/esm/utils/ai-agent.js +28 -0
- package/lib/esm/utils/ai-agent.js.map +1 -0
- package/lib/esm/utils/authentication.d.ts +2 -0
- package/lib/esm/utils/authentication.js +21 -0
- package/lib/esm/utils/authentication.js.map +1 -0
- package/lib/esm/utils/flow-locale.d.ts +22 -0
- package/lib/esm/utils/flow-locale.js +79 -0
- package/lib/esm/utils/flow-locale.js.map +1 -0
- package/lib/esm/utils/get-flow-builder-plugin.d.ts +3 -0
- package/lib/esm/utils/get-flow-builder-plugin.js +16 -0
- package/lib/esm/utils/get-flow-builder-plugin.js.map +1 -0
- package/lib/esm/utils/hubtype-assistant-content.d.ts +13 -0
- package/lib/esm/utils/hubtype-assistant-content.js +184 -0
- package/lib/esm/utils/hubtype-assistant-content.js.map +1 -0
- package/lib/esm/utils/input.d.ts +6 -0
- package/lib/esm/utils/input.js +35 -0
- package/lib/esm/utils/input.js.map +1 -0
- package/lib/esm/webview/contents-context.d.ts +2 -0
- package/lib/esm/webview/contents-context.js +12 -0
- package/lib/esm/webview/contents-context.js.map +1 -0
- package/lib/esm/webview/index.d.ts +3 -0
- package/lib/esm/webview/index.js +10 -0
- package/lib/esm/webview/index.js.map +1 -0
- package/lib/esm/webview/types.d.ts +47 -0
- package/lib/esm/webview/types.js +9 -0
- package/lib/esm/webview/types.js.map +1 -0
- package/lib/esm/webview/use-webview-contents.d.ts +2 -0
- package/lib/esm/webview/use-webview-contents.js +83 -0
- package/lib/esm/webview/use-webview-contents.js.map +1 -0
- package/package.json +9 -11
- package/src/action/ai-agent-from-user-input.ts +7 -0
- package/src/action/first-interaction.ts +6 -0
- package/src/action/get-contents.ts +17 -2
- package/src/action/index.tsx +7 -0
- package/src/api.ts +52 -15
- package/src/bot-context-manager.ts +153 -0
- package/src/constants.ts +2 -1
- package/src/content-fields/contact-reasons-conditional-matcher.ts +24 -0
- package/src/content-fields/flow-ai-agent-base.tsx +12 -1
- package/src/content-fields/flow-ai-agent-router.tsx +1 -0
- package/src/content-fields/flow-ai-agent.tsx +1 -0
- package/src/content-fields/flow-contact-reasons-conditional.tsx +90 -0
- package/src/content-fields/flow-do-nothing.tsx +29 -0
- package/src/content-fields/flow-handoff.tsx +54 -7
- package/src/content-fields/flow-whatsapp-request-contact-info.tsx +19 -1
- package/src/content-fields/hubtype-fields/contact-reasons-conditional.ts +18 -0
- package/src/content-fields/hubtype-fields/do-nothing.ts +7 -0
- package/src/content-fields/hubtype-fields/handoff.ts +17 -1
- package/src/content-fields/hubtype-fields/index.ts +1 -0
- package/src/content-fields/hubtype-fields/node-types.ts +2 -0
- package/src/content-fields/hubtype-fields/nodes.ts +4 -0
- package/src/content-fields/hubtype-fields/whatsapp-request-contact-info.ts +2 -0
- package/src/content-fields/index.ts +6 -0
- package/src/flow-factory.ts +11 -0
- package/src/index.ts +26 -88
- package/src/types.ts +1 -2
- package/src/utils/hubtype-assistant-content.ts +14 -0
- package/lib/action/ai-agent-from-user-input.d.ts +0 -3
- package/lib/action/ai-agent-from-user-input.js +0 -35
- package/lib/action/ai-agent-from-user-input.js.map +0 -1
- package/lib/action/context.d.ts +0 -11
- package/lib/action/context.js +0 -20
- package/lib/action/context.js.map +0 -1
- package/lib/action/fallback.d.ts +0 -3
- package/lib/action/fallback.js +0 -41
- package/lib/action/fallback.js.map +0 -1
- package/lib/action/first-interaction.d.ts +0 -3
- package/lib/action/first-interaction.js +0 -100
- package/lib/action/first-interaction.js.map +0 -1
- package/lib/action/get-contents.d.ts +0 -3
- package/lib/action/get-contents.js +0 -56
- package/lib/action/get-contents.js.map +0 -1
- package/lib/action/index.d.ts +0 -25
- package/lib/action/index.js +0 -126
- package/lib/action/index.js.map +0 -1
- package/lib/action/payload.d.ts +0 -3
- package/lib/action/payload.js +0 -78
- package/lib/action/payload.js.map +0 -1
- package/lib/api.d.ts +0 -40
- package/lib/api.js +0 -216
- package/lib/api.js.map +0 -1
- package/lib/constants.d.ts +0 -13
- package/lib/constants.js +0 -17
- package/lib/constants.js.map +0 -1
- package/lib/content-fields/content-fields-base.d.ts +0 -20
- package/lib/content-fields/content-fields-base.js +0 -78
- package/lib/content-fields/content-fields-base.js.map +0 -1
- package/lib/content-fields/custom-conditional/custom-conditional-v2-evaluators.d.ts +0 -15
- package/lib/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +0 -73
- package/lib/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +0 -1
- package/lib/content-fields/custom-conditional/custom-conditional-v2-resolver.d.ts +0 -9
- package/lib/content-fields/custom-conditional/custom-conditional-v2-resolver.js +0 -58
- package/lib/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +0 -1
- package/lib/content-fields/custom-conditional/flow-custom-condition-v2.d.ts +0 -17
- package/lib/content-fields/custom-conditional/flow-custom-condition-v2.js +0 -94
- package/lib/content-fields/custom-conditional/flow-custom-condition-v2.js.map +0 -1
- package/lib/content-fields/flow-ai-agent-base.d.ts +0 -25
- package/lib/content-fields/flow-ai-agent-base.js +0 -100
- package/lib/content-fields/flow-ai-agent-base.js.map +0 -1
- package/lib/content-fields/flow-ai-agent-router.d.ts +0 -21
- package/lib/content-fields/flow-ai-agent-router.js +0 -136
- package/lib/content-fields/flow-ai-agent-router.js.map +0 -1
- package/lib/content-fields/flow-ai-agent.d.ts +0 -17
- package/lib/content-fields/flow-ai-agent.js +0 -75
- package/lib/content-fields/flow-ai-agent.js.map +0 -1
- package/lib/content-fields/flow-bot-action.d.ts +0 -14
- package/lib/content-fields/flow-bot-action.js +0 -53
- package/lib/content-fields/flow-bot-action.js.map +0 -1
- package/lib/content-fields/flow-button.d.ts +0 -31
- package/lib/content-fields/flow-button.js +0 -105
- package/lib/content-fields/flow-button.js.map +0 -1
- package/lib/content-fields/flow-capture-user-input.d.ts +0 -14
- package/lib/content-fields/flow-capture-user-input.js +0 -46
- package/lib/content-fields/flow-capture-user-input.js.map +0 -1
- package/lib/content-fields/flow-carousel.d.ts +0 -22
- package/lib/content-fields/flow-carousel.js +0 -193
- package/lib/content-fields/flow-carousel.js.map +0 -1
- package/lib/content-fields/flow-channel-conditional.d.ts +0 -14
- package/lib/content-fields/flow-channel-conditional.js +0 -61
- package/lib/content-fields/flow-channel-conditional.js.map +0 -1
- package/lib/content-fields/flow-country-conditional.d.ts +0 -13
- package/lib/content-fields/flow-country-conditional.js +0 -64
- package/lib/content-fields/flow-country-conditional.js.map +0 -1
- package/lib/content-fields/flow-custom-conditional.d.ts +0 -17
- package/lib/content-fields/flow-custom-conditional.js +0 -87
- package/lib/content-fields/flow-custom-conditional.js.map +0 -1
- package/lib/content-fields/flow-element.d.ts +0 -22
- package/lib/content-fields/flow-element.js +0 -67
- package/lib/content-fields/flow-element.js.map +0 -1
- package/lib/content-fields/flow-go-to-flow.d.ts +0 -13
- package/lib/content-fields/flow-go-to-flow.js +0 -56
- package/lib/content-fields/flow-go-to-flow.js.map +0 -1
- package/lib/content-fields/flow-handoff.d.ts +0 -17
- package/lib/content-fields/flow-handoff.js +0 -79
- package/lib/content-fields/flow-handoff.js.map +0 -1
- package/lib/content-fields/flow-image.d.ts +0 -10
- package/lib/content-fields/flow-image.js +0 -42
- package/lib/content-fields/flow-image.js.map +0 -1
- package/lib/content-fields/flow-queue-status-conditional.d.ts +0 -30
- package/lib/content-fields/flow-queue-status-conditional.js +0 -100
- package/lib/content-fields/flow-queue-status-conditional.js.map +0 -1
- package/lib/content-fields/flow-rating.d.ts +0 -15
- package/lib/content-fields/flow-rating.js +0 -88
- package/lib/content-fields/flow-rating.js.map +0 -1
- package/lib/content-fields/flow-text.d.ts +0 -15
- package/lib/content-fields/flow-text.js +0 -82
- package/lib/content-fields/flow-text.js.map +0 -1
- package/lib/content-fields/flow-video.d.ts +0 -10
- package/lib/content-fields/flow-video.js +0 -42
- package/lib/content-fields/flow-video.js.map +0 -1
- package/lib/content-fields/flow-webview.d.ts +0 -16
- package/lib/content-fields/flow-webview.js +0 -81
- package/lib/content-fields/flow-webview.js.map +0 -1
- package/lib/content-fields/flow-whatsapp-cta-url-button.d.ts +0 -21
- package/lib/content-fields/flow-whatsapp-cta-url-button.js +0 -131
- package/lib/content-fields/flow-whatsapp-cta-url-button.js.map +0 -1
- package/lib/content-fields/flow-whatsapp-request-contact-info.d.ts +0 -10
- package/lib/content-fields/flow-whatsapp-request-contact-info.js +0 -51
- package/lib/content-fields/flow-whatsapp-request-contact-info.js.map +0 -1
- package/lib/content-fields/flow-whatsapp-template.d.ts +0 -37
- package/lib/content-fields/flow-whatsapp-template.js +0 -281
- package/lib/content-fields/flow-whatsapp-template.js.map +0 -1
- package/lib/content-fields/hubtype-fields/ai-agent-router.d.ts +0 -21
- package/lib/content-fields/hubtype-fields/ai-agent-router.js +0 -4
- package/lib/content-fields/hubtype-fields/ai-agent-router.js.map +0 -1
- package/lib/content-fields/hubtype-fields/ai-agent.d.ts +0 -25
- package/lib/content-fields/hubtype-fields/ai-agent.js +0 -4
- package/lib/content-fields/hubtype-fields/ai-agent.js.map +0 -1
- package/lib/content-fields/hubtype-fields/bot-action.d.ts +0 -10
- package/lib/content-fields/hubtype-fields/bot-action.js +0 -4
- package/lib/content-fields/hubtype-fields/bot-action.js.map +0 -1
- package/lib/content-fields/hubtype-fields/button.d.ts +0 -8
- package/lib/content-fields/hubtype-fields/button.js +0 -4
- package/lib/content-fields/hubtype-fields/button.js.map +0 -1
- package/lib/content-fields/hubtype-fields/capture-user-input.d.ts +0 -19
- package/lib/content-fields/hubtype-fields/capture-user-input.js +0 -12
- package/lib/content-fields/hubtype-fields/capture-user-input.js.map +0 -1
- package/lib/content-fields/hubtype-fields/carousel.d.ts +0 -17
- package/lib/content-fields/hubtype-fields/carousel.js +0 -4
- package/lib/content-fields/hubtype-fields/carousel.js.map +0 -1
- package/lib/content-fields/hubtype-fields/channel-conditional.d.ts +0 -10
- package/lib/content-fields/hubtype-fields/channel-conditional.js +0 -4
- package/lib/content-fields/hubtype-fields/channel-conditional.js.map +0 -1
- package/lib/content-fields/hubtype-fields/common.d.ts +0 -83
- package/lib/content-fields/hubtype-fields/common.js +0 -4
- package/lib/content-fields/hubtype-fields/common.js.map +0 -1
- package/lib/content-fields/hubtype-fields/country-conditional.d.ts +0 -10
- package/lib/content-fields/hubtype-fields/country-conditional.js +0 -4
- package/lib/content-fields/hubtype-fields/country-conditional.js.map +0 -1
- package/lib/content-fields/hubtype-fields/custom-conditional-v2.d.ts +0 -56
- package/lib/content-fields/hubtype-fields/custom-conditional-v2.js +0 -36
- package/lib/content-fields/hubtype-fields/custom-conditional-v2.js.map +0 -1
- package/lib/content-fields/hubtype-fields/custom-conditional.d.ts +0 -11
- package/lib/content-fields/hubtype-fields/custom-conditional.js +0 -4
- package/lib/content-fields/hubtype-fields/custom-conditional.js.map +0 -1
- package/lib/content-fields/hubtype-fields/fallback.d.ts +0 -9
- package/lib/content-fields/hubtype-fields/fallback.js +0 -4
- package/lib/content-fields/hubtype-fields/fallback.js.map +0 -1
- package/lib/content-fields/hubtype-fields/function.d.ts +0 -30
- package/lib/content-fields/hubtype-fields/function.js +0 -11
- package/lib/content-fields/hubtype-fields/function.js.map +0 -1
- package/lib/content-fields/hubtype-fields/go-to-flow.d.ts +0 -9
- package/lib/content-fields/hubtype-fields/go-to-flow.js +0 -4
- package/lib/content-fields/hubtype-fields/go-to-flow.js.map +0 -1
- package/lib/content-fields/hubtype-fields/handoff.d.ts +0 -11
- package/lib/content-fields/hubtype-fields/handoff.js +0 -4
- package/lib/content-fields/hubtype-fields/handoff.js.map +0 -1
- package/lib/content-fields/hubtype-fields/image.d.ts +0 -8
- package/lib/content-fields/hubtype-fields/image.js +0 -4
- package/lib/content-fields/hubtype-fields/image.js.map +0 -1
- package/lib/content-fields/hubtype-fields/index.d.ts +0 -27
- package/lib/content-fields/hubtype-fields/index.js +0 -57
- package/lib/content-fields/hubtype-fields/index.js.map +0 -1
- package/lib/content-fields/hubtype-fields/keyword.d.ts +0 -9
- package/lib/content-fields/hubtype-fields/keyword.js +0 -4
- package/lib/content-fields/hubtype-fields/keyword.js.map +0 -1
- package/lib/content-fields/hubtype-fields/node-types.d.ts +0 -31
- package/lib/content-fields/hubtype-fields/node-types.js +0 -38
- package/lib/content-fields/hubtype-fields/node-types.js.map +0 -1
- package/lib/content-fields/hubtype-fields/nodes.d.ts +0 -26
- package/lib/content-fields/hubtype-fields/nodes.js +0 -4
- package/lib/content-fields/hubtype-fields/nodes.js.map +0 -1
- package/lib/content-fields/hubtype-fields/payload.d.ts +0 -8
- package/lib/content-fields/hubtype-fields/payload.js +0 -4
- package/lib/content-fields/hubtype-fields/payload.js.map +0 -1
- package/lib/content-fields/hubtype-fields/queue-status-conditional.d.ts +0 -25
- package/lib/content-fields/hubtype-fields/queue-status-conditional.js +0 -4
- package/lib/content-fields/hubtype-fields/queue-status-conditional.js.map +0 -1
- package/lib/content-fields/hubtype-fields/rating.d.ts +0 -23
- package/lib/content-fields/hubtype-fields/rating.js +0 -9
- package/lib/content-fields/hubtype-fields/rating.js.map +0 -1
- package/lib/content-fields/hubtype-fields/smart-intent.d.ts +0 -12
- package/lib/content-fields/hubtype-fields/smart-intent.js +0 -4
- package/lib/content-fields/hubtype-fields/smart-intent.js.map +0 -1
- package/lib/content-fields/hubtype-fields/text.d.ts +0 -11
- package/lib/content-fields/hubtype-fields/text.js +0 -4
- package/lib/content-fields/hubtype-fields/text.js.map +0 -1
- package/lib/content-fields/hubtype-fields/url.d.ts +0 -8
- package/lib/content-fields/hubtype-fields/url.js +0 -4
- package/lib/content-fields/hubtype-fields/url.js.map +0 -1
- package/lib/content-fields/hubtype-fields/video.d.ts +0 -8
- package/lib/content-fields/hubtype-fields/video.js +0 -4
- package/lib/content-fields/hubtype-fields/video.js.map +0 -1
- package/lib/content-fields/hubtype-fields/webview.d.ts +0 -17
- package/lib/content-fields/hubtype-fields/webview.js +0 -4
- package/lib/content-fields/hubtype-fields/webview.js.map +0 -1
- package/lib/content-fields/hubtype-fields/whatsapp-button-list.d.ts +0 -21
- package/lib/content-fields/hubtype-fields/whatsapp-button-list.js +0 -4
- package/lib/content-fields/hubtype-fields/whatsapp-button-list.js.map +0 -1
- package/lib/content-fields/hubtype-fields/whatsapp-cta-url-button.d.ts +0 -17
- package/lib/content-fields/hubtype-fields/whatsapp-cta-url-button.js +0 -4
- package/lib/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +0 -1
- package/lib/content-fields/hubtype-fields/whatsapp-request-contact-info.d.ts +0 -8
- package/lib/content-fields/hubtype-fields/whatsapp-request-contact-info.js +0 -4
- package/lib/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +0 -1
- package/lib/content-fields/hubtype-fields/whatsapp-template.d.ts +0 -96
- package/lib/content-fields/hubtype-fields/whatsapp-template.js +0 -9
- package/lib/content-fields/hubtype-fields/whatsapp-template.js.map +0 -1
- package/lib/content-fields/index.d.ts +0 -25
- package/lib/content-fields/index.js +0 -73
- package/lib/content-fields/index.js.map +0 -1
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +0 -14
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +0 -43
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +0 -1
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +0 -13
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +0 -41
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +0 -1
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +0 -14
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +0 -66
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +0 -1
- package/lib/content-fields/whatsapp-button-list/index.d.ts +0 -3
- package/lib/content-fields/whatsapp-button-list/index.js +0 -12
- package/lib/content-fields/whatsapp-button-list/index.js.map +0 -1
- package/lib/filters/index.d.ts +0 -12
- package/lib/filters/index.js +0 -16
- package/lib/filters/index.js.map +0 -1
- package/lib/flow-factory.d.ts +0 -12
- package/lib/flow-factory.js +0 -75
- package/lib/flow-factory.js.map +0 -1
- package/lib/functions/index.d.ts +0 -11
- package/lib/functions/index.js +0 -55
- package/lib/functions/index.js.map +0 -1
- package/lib/index.d.ts +0 -45
- package/lib/index.js +0 -195
- package/lib/index.js.map +0 -1
- package/lib/services/hubtype-queues-api.js +0 -26
- package/lib/services/hubtype-queues-api.js.map +0 -1
- package/lib/structured-output/flow-builder-content.js +0 -16
- package/lib/structured-output/flow-builder-content.js.map +0 -1
- package/lib/tracking.d.ts +0 -16
- package/lib/tracking.js +0 -77
- package/lib/tracking.js.map +0 -1
- package/lib/types.d.ts +0 -62
- package/lib/types.js +0 -14
- package/lib/types.js.map +0 -1
- package/lib/user-input/capture-user-input-api.d.ts +0 -21
- package/lib/user-input/capture-user-input-api.js +0 -99
- package/lib/user-input/capture-user-input-api.js.map +0 -1
- package/lib/user-input/index.d.ts +0 -4
- package/lib/user-input/index.js +0 -46
- package/lib/user-input/index.js.map +0 -1
- package/lib/user-input/keyword.d.ts +0 -27
- package/lib/user-input/keyword.js +0 -89
- package/lib/user-input/keyword.js.map +0 -1
- package/lib/user-input/smart-intent.d.ts +0 -24
- package/lib/user-input/smart-intent.js +0 -93
- package/lib/user-input/smart-intent.js.map +0 -1
- package/lib/utils/ai-agent.d.ts +0 -11
- package/lib/utils/ai-agent.js +0 -33
- package/lib/utils/ai-agent.js.map +0 -1
- package/lib/utils/authentication.js +0 -24
- package/lib/utils/authentication.js.map +0 -1
- package/lib/utils/flow-locale.js +0 -75
- package/lib/utils/flow-locale.js.map +0 -1
- package/lib/utils/get-flow-builder-plugin.d.ts +0 -3
- package/lib/utils/get-flow-builder-plugin.js +0 -16
- package/lib/utils/get-flow-builder-plugin.js.map +0 -1
- package/lib/utils/hubtype-assistant-content.d.ts +0 -12
- package/lib/utils/hubtype-assistant-content.js +0 -187
- package/lib/utils/hubtype-assistant-content.js.map +0 -1
- package/lib/utils/input.js +0 -37
- package/lib/utils/input.js.map +0 -1
- package/lib/webview/contents-context.d.ts +0 -2
- package/lib/webview/contents-context.js +0 -14
- package/lib/webview/contents-context.js.map +0 -1
- package/lib/webview/index.d.ts +0 -3
- package/lib/webview/index.js +0 -11
- package/lib/webview/index.js.map +0 -1
- package/lib/webview/types.d.ts +0 -47
- package/lib/webview/types.js +0 -9
- package/lib/webview/types.js.map +0 -1
- package/lib/webview/use-webview-contents.d.ts +0 -2
- package/lib/webview/use-webview-contents.js +0 -90
- package/lib/webview/use-webview-contents.js.map +0 -1
- /package/lib/{services → cjs/services}/hubtype-queues-api.d.ts +0 -0
- /package/lib/{structured-output → cjs/structured-output}/flow-builder-content.d.ts +0 -0
- /package/lib/{utils → cjs/utils}/authentication.d.ts +0 -0
- /package/lib/{utils → cjs/utils}/flow-locale.d.ts +0 -0
- /package/lib/{utils → cjs/utils}/input.d.ts +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-fields/whatsapp-button-list/index.js","sources":["../../../src/content-fields/whatsapp-button-list/index.ts"],"sourcesContent":["export { FlowWhatsappButtonList } from './flow-whatsapp-button-list'\nexport { FlowWhatsappButtonListRow } from './flow-whatsapp-button-list-row'\nexport { FlowWhatsappButtonListSection } from './flow-whatsapp-button-list-section'\n"],"names":["FlowWhatsappButtonList","FlowWhatsappButtonListRow","FlowWhatsappButtonListSection"],"mappings":";;;AAAoE;AACO;AACQ"}
|
package/lib/filters/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { BotContext } from '@botonic/core';
|
|
2
|
-
import type { FlowContent } from '../content-fields/index.js';
|
|
3
|
-
import type { ContentFilter } from '../types.js';
|
|
4
|
-
interface ContentFilterExecutorOptions {
|
|
5
|
-
filters: ContentFilter[];
|
|
6
|
-
}
|
|
7
|
-
export declare class ContentFilterExecutor {
|
|
8
|
-
private filters;
|
|
9
|
-
constructor(options: ContentFilterExecutorOptions);
|
|
10
|
-
filter(request: BotContext, content: FlowContent): Promise<FlowContent>;
|
|
11
|
-
}
|
|
12
|
-
export {};
|
package/lib/filters/index.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
class ContentFilterExecutor {
|
|
2
|
-
async filter(request, content) {
|
|
3
|
-
for (const filter of this.filters){
|
|
4
|
-
content = await filter(request, content);
|
|
5
|
-
}
|
|
6
|
-
return content;
|
|
7
|
-
}
|
|
8
|
-
constructor(options){
|
|
9
|
-
this.filters = [];
|
|
10
|
-
this.filters = options.filters;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export { ContentFilterExecutor };
|
|
15
|
-
|
|
16
|
-
//# sourceMappingURL=index.js.map
|
package/lib/filters/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"filters/index.js","sources":["../../src/filters/index.ts"],"sourcesContent":["import type { BotContext } from '@botonic/core'\n\nimport type { FlowContent } from '../content-fields'\nimport type { ContentFilter } from '../types'\n\ninterface ContentFilterExecutorOptions {\n filters: ContentFilter[]\n}\n\nexport class ContentFilterExecutor {\n private filters: ContentFilter[] = []\n\n constructor(options: ContentFilterExecutorOptions) {\n this.filters = options.filters\n }\n\n async filter(\n request: BotContext,\n content: FlowContent\n ): Promise<FlowContent> {\n for (const filter of this.filters) {\n content = await filter(request, content)\n }\n\n return content\n }\n}\n"],"names":["ContentFilterExecutor","request","content","filter","options"],"mappings":"AASO,MAAMA,qBAAqBA;IAOhC,MAAM,OACJC,OAAmB,EACnBC,OAAoB,EACE;QACtB,KAAK,MAAMC,UAAU,IAAI,CAAC,OAAO,CAAE;YACjCD,UAAU,MAAMC,OAAOF,SAASC;QAClC;QAEA,OAAOA;IACT;IAbA,YAAYE,OAAqC,CAAE;aAF3C,UAA2B,EAAE;QAGnC,IAAI,CAAC,OAAO,GAAGA,QAAQ,OAAO;IAChC;AAYF"}
|
package/lib/flow-factory.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { BotContext } from '@botonic/core';
|
|
2
|
-
import type { FlowBuilderApi } from './api.js';
|
|
3
|
-
import { type FlowContent } from './content-fields/index.js';
|
|
4
|
-
import { type HtNodeComponent } from './content-fields/hubtype-fields/index.js';
|
|
5
|
-
export declare class FlowFactory {
|
|
6
|
-
botContext: BotContext;
|
|
7
|
-
cmsApi: FlowBuilderApi;
|
|
8
|
-
locale: string;
|
|
9
|
-
constructor(botContext: BotContext, cmsApi: FlowBuilderApi, locale: string);
|
|
10
|
-
getFlowContent(hubtypeContent: HtNodeComponent): Promise<FlowContent | undefined>;
|
|
11
|
-
private resolveFlowFunctionContent;
|
|
12
|
-
}
|
package/lib/flow-factory.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { FlowAiAgent, FlowAiAgentRouter, FlowBotAction, FlowCarousel, FlowChannelConditional, FlowCountryConditional, FlowCustomConditional, FlowCustomConditionalV2, FlowGoToFlow, FlowHandoff, FlowImage, FlowQueueStatusConditional, FlowRating, FlowText, FlowVideo, FlowWhatsappButtonList, FlowWhatsappCtaUrlButtonNode, FlowWhatsappRequestContactInfoNode, FlowWhatsappTemplate } from "./content-fields/index.js";
|
|
2
|
-
import { FlowCaptureUserInput } from "./content-fields/flow-capture-user-input.js";
|
|
3
|
-
import { HtNodeWithContentType } from "./content-fields/hubtype-fields/index.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class FlowFactory {
|
|
12
|
-
async getFlowContent(hubtypeContent) {
|
|
13
|
-
switch(hubtypeContent.type){
|
|
14
|
-
case HtNodeWithContentType.TEXT:
|
|
15
|
-
return FlowText.fromHubtypeCMS(hubtypeContent, this.locale, this.cmsApi, this.botContext);
|
|
16
|
-
case HtNodeWithContentType.IMAGE:
|
|
17
|
-
return FlowImage.fromHubtypeCMS(hubtypeContent, this.locale);
|
|
18
|
-
case HtNodeWithContentType.CAROUSEL:
|
|
19
|
-
return FlowCarousel.fromHubtypeCMS(hubtypeContent, this.locale, this.cmsApi, this.botContext);
|
|
20
|
-
case HtNodeWithContentType.VIDEO:
|
|
21
|
-
return FlowVideo.fromHubtypeCMS(hubtypeContent, this.locale);
|
|
22
|
-
case HtNodeWithContentType.WHATSAPP_BUTTON_LIST:
|
|
23
|
-
return FlowWhatsappButtonList.fromHubtypeCMS(hubtypeContent, this.locale, this.cmsApi);
|
|
24
|
-
case HtNodeWithContentType.WHATSAPP_CTA_URL_BUTTON:
|
|
25
|
-
return FlowWhatsappCtaUrlButtonNode.fromHubtypeCMS(hubtypeContent, this.locale, this.cmsApi, this.botContext);
|
|
26
|
-
case HtNodeWithContentType.WHATSAPP_REQUEST_CONTACT_INFO:
|
|
27
|
-
return FlowWhatsappRequestContactInfoNode.fromHubtypeCMS(hubtypeContent, this.locale);
|
|
28
|
-
case HtNodeWithContentType.HANDOFF:
|
|
29
|
-
return FlowHandoff.fromHubtypeCMS(hubtypeContent, this.locale, this.cmsApi);
|
|
30
|
-
case HtNodeWithContentType.AI_AGENT_ROUTER:
|
|
31
|
-
return FlowAiAgentRouter.fromHubtypeCMS(hubtypeContent, this.botContext);
|
|
32
|
-
case HtNodeWithContentType.AI_AGENT:
|
|
33
|
-
return FlowAiAgent.fromHubtypeCMS(hubtypeContent, this.botContext);
|
|
34
|
-
case HtNodeWithContentType.RATING:
|
|
35
|
-
return FlowRating.fromHubtypeCMS(hubtypeContent, this.locale);
|
|
36
|
-
case HtNodeWithContentType.BOT_ACTION:
|
|
37
|
-
return FlowBotAction.fromHubtypeCMS(hubtypeContent, this.cmsApi);
|
|
38
|
-
case HtNodeWithContentType.FUNCTION:
|
|
39
|
-
return this.resolveFlowFunctionContent(hubtypeContent);
|
|
40
|
-
case HtNodeWithContentType.GO_TO_FLOW:
|
|
41
|
-
return FlowGoToFlow.fromHubtypeCMS(hubtypeContent, this.cmsApi);
|
|
42
|
-
case HtNodeWithContentType.WHATSAPP_TEMPLATE:
|
|
43
|
-
return FlowWhatsappTemplate.fromHubtypeCMS(hubtypeContent, this.locale);
|
|
44
|
-
case HtNodeWithContentType.CAPTURE_USER_INPUT:
|
|
45
|
-
return FlowCaptureUserInput.fromHubtypeCMS(hubtypeContent);
|
|
46
|
-
case HtNodeWithContentType.CUSTOM_CONDITION:
|
|
47
|
-
return FlowCustomConditionalV2.fromHubtypeCMS(hubtypeContent, this.botContext);
|
|
48
|
-
default:
|
|
49
|
-
return undefined;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
async resolveFlowFunctionContent(hubtypeContent) {
|
|
53
|
-
switch(hubtypeContent.content.action){
|
|
54
|
-
case 'check-country':
|
|
55
|
-
return FlowCountryConditional.fromHubtypeCMS(hubtypeContent, this.botContext);
|
|
56
|
-
case 'get-channel-type':
|
|
57
|
-
return FlowChannelConditional.fromHubtypeCMS(hubtypeContent, this.botContext);
|
|
58
|
-
case 'check-queue-status':
|
|
59
|
-
return FlowQueueStatusConditional.fromHubtypeCMS(hubtypeContent, this.locale);
|
|
60
|
-
case 'check-bot-variable':
|
|
61
|
-
return FlowCustomConditional.fromHubtypeCMS(hubtypeContent, this.botContext);
|
|
62
|
-
default:
|
|
63
|
-
return undefined;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
constructor(botContext, cmsApi, locale){
|
|
67
|
-
this.botContext = botContext;
|
|
68
|
-
this.cmsApi = cmsApi;
|
|
69
|
-
this.locale = locale;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export { FlowFactory };
|
|
74
|
-
|
|
75
|
-
//# sourceMappingURL=flow-factory.js.map
|
package/lib/flow-factory.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flow-factory.js","sources":["../src/flow-factory.ts"],"sourcesContent":["import type { BotContext } from '@botonic/core'\n\nimport type { FlowBuilderApi } from './api'\nimport {\n FlowAiAgent,\n FlowAiAgentRouter,\n FlowBotAction,\n FlowCarousel,\n FlowChannelConditional,\n type FlowContent,\n FlowCountryConditional,\n FlowCustomConditional,\n FlowCustomConditionalV2,\n FlowGoToFlow,\n FlowHandoff,\n FlowImage,\n FlowQueueStatusConditional,\n FlowRating,\n FlowText,\n FlowVideo,\n FlowWhatsappButtonList,\n FlowWhatsappCtaUrlButtonNode,\n FlowWhatsappRequestContactInfoNode,\n FlowWhatsappTemplate,\n} from './content-fields'\nimport { FlowCaptureUserInput } from './content-fields/flow-capture-user-input'\nimport {\n type HtFunctionNode,\n type HtNodeComponent,\n HtNodeWithContentType,\n} from './content-fields/hubtype-fields'\n\nexport class FlowFactory {\n public botContext: BotContext\n public cmsApi: FlowBuilderApi\n public locale: string\n\n constructor(botContext: BotContext, cmsApi: FlowBuilderApi, locale: string) {\n this.botContext = botContext\n this.cmsApi = cmsApi\n this.locale = locale\n }\n\n async getFlowContent(\n hubtypeContent: HtNodeComponent\n ): Promise<FlowContent | undefined> {\n switch (hubtypeContent.type) {\n case HtNodeWithContentType.TEXT:\n return FlowText.fromHubtypeCMS(\n hubtypeContent,\n this.locale,\n this.cmsApi,\n this.botContext\n )\n case HtNodeWithContentType.IMAGE:\n return FlowImage.fromHubtypeCMS(hubtypeContent, this.locale)\n case HtNodeWithContentType.CAROUSEL:\n return FlowCarousel.fromHubtypeCMS(\n hubtypeContent,\n this.locale,\n this.cmsApi,\n this.botContext\n )\n case HtNodeWithContentType.VIDEO:\n return FlowVideo.fromHubtypeCMS(hubtypeContent, this.locale)\n case HtNodeWithContentType.WHATSAPP_BUTTON_LIST:\n return FlowWhatsappButtonList.fromHubtypeCMS(\n hubtypeContent,\n this.locale,\n this.cmsApi\n )\n case HtNodeWithContentType.WHATSAPP_CTA_URL_BUTTON:\n return FlowWhatsappCtaUrlButtonNode.fromHubtypeCMS(\n hubtypeContent,\n this.locale,\n this.cmsApi,\n this.botContext\n )\n case HtNodeWithContentType.WHATSAPP_REQUEST_CONTACT_INFO:\n return FlowWhatsappRequestContactInfoNode.fromHubtypeCMS(\n hubtypeContent,\n this.locale\n )\n case HtNodeWithContentType.HANDOFF:\n return FlowHandoff.fromHubtypeCMS(\n hubtypeContent,\n this.locale,\n this.cmsApi\n )\n\n case HtNodeWithContentType.AI_AGENT_ROUTER:\n return FlowAiAgentRouter.fromHubtypeCMS(hubtypeContent, this.botContext)\n\n case HtNodeWithContentType.AI_AGENT:\n return FlowAiAgent.fromHubtypeCMS(hubtypeContent, this.botContext)\n\n case HtNodeWithContentType.RATING:\n return FlowRating.fromHubtypeCMS(hubtypeContent, this.locale)\n\n case HtNodeWithContentType.BOT_ACTION:\n return FlowBotAction.fromHubtypeCMS(hubtypeContent, this.cmsApi)\n\n case HtNodeWithContentType.FUNCTION:\n return this.resolveFlowFunctionContent(hubtypeContent)\n\n case HtNodeWithContentType.GO_TO_FLOW:\n return FlowGoToFlow.fromHubtypeCMS(hubtypeContent, this.cmsApi)\n\n case HtNodeWithContentType.WHATSAPP_TEMPLATE:\n return FlowWhatsappTemplate.fromHubtypeCMS(hubtypeContent, this.locale)\n\n case HtNodeWithContentType.CAPTURE_USER_INPUT:\n return FlowCaptureUserInput.fromHubtypeCMS(hubtypeContent)\n\n case HtNodeWithContentType.CUSTOM_CONDITION:\n return FlowCustomConditionalV2.fromHubtypeCMS(\n hubtypeContent,\n this.botContext\n )\n\n default:\n return undefined\n }\n }\n\n private async resolveFlowFunctionContent(\n hubtypeContent: HtFunctionNode\n ): Promise<FlowContent | undefined> {\n switch (hubtypeContent.content.action) {\n case 'check-country':\n return FlowCountryConditional.fromHubtypeCMS(\n hubtypeContent,\n this.botContext\n )\n case 'get-channel-type':\n return FlowChannelConditional.fromHubtypeCMS(\n hubtypeContent,\n this.botContext\n )\n case 'check-queue-status':\n return FlowQueueStatusConditional.fromHubtypeCMS(\n hubtypeContent,\n this.locale\n )\n case 'check-bot-variable':\n return FlowCustomConditional.fromHubtypeCMS(\n hubtypeContent,\n this.botContext\n )\n default:\n return undefined\n }\n }\n}\n"],"names":["FlowAiAgent","FlowAiAgentRouter","FlowBotAction","FlowCarousel","FlowChannelConditional","FlowCountryConditional","FlowCustomConditional","FlowCustomConditionalV2","FlowGoToFlow","FlowHandoff","FlowImage","FlowQueueStatusConditional","FlowRating","FlowText","FlowVideo","FlowWhatsappButtonList","FlowWhatsappCtaUrlButtonNode","FlowWhatsappRequestContactInfoNode","FlowWhatsappTemplate","FlowCaptureUserInput","HtNodeWithContentType","FlowFactory","hubtypeContent","undefined","botContext","cmsApi","locale"],"mappings":";;;;;;;AAwByB;AACsD;AAKvC;AAEjC,MAAMqB,WAAWA;IAWtB,MAAM,eACJC,cAA+B,EACG;QAClC,OAAQA,eAAe,IAAI;YACzB,KAAKF,0BAA0B;gBAC7B,OAAOP,uBAAuB,CAC5BS,gBACA,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,UAAU;YAEnB,KAAKF,2BAA2B;gBAC9B,OAAOV,wBAAwB,CAACY,gBAAgB,IAAI,CAAC,MAAM;YAC7D,KAAKF,8BAA8B;gBACjC,OAAOjB,2BAA2B,CAChCmB,gBACA,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,UAAU;YAEnB,KAAKF,2BAA2B;gBAC9B,OAAON,wBAAwB,CAACQ,gBAAgB,IAAI,CAAC,MAAM;YAC7D,KAAKF,0CAA0C;gBAC7C,OAAOL,qCAAqC,CAC1CO,gBACA,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,MAAM;YAEf,KAAKF,6CAA6C;gBAChD,OAAOJ,2CAA2C,CAChDM,gBACA,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,UAAU;YAEnB,KAAKF,mDAAmD;gBACtD,OAAOH,iDAAiD,CACtDK,gBACA,IAAI,CAAC,MAAM;YAEf,KAAKF,6BAA6B;gBAChC,OAAOX,0BAA0B,CAC/Ba,gBACA,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,MAAM;YAGf,KAAKF,qCAAqC;gBACxC,OAAOnB,gCAAgC,CAACqB,gBAAgB,IAAI,CAAC,UAAU;YAEzE,KAAKF,8BAA8B;gBACjC,OAAOpB,0BAA0B,CAACsB,gBAAgB,IAAI,CAAC,UAAU;YAEnE,KAAKF,4BAA4B;gBAC/B,OAAOR,yBAAyB,CAACU,gBAAgB,IAAI,CAAC,MAAM;YAE9D,KAAKF,gCAAgC;gBACnC,OAAOlB,4BAA4B,CAACoB,gBAAgB,IAAI,CAAC,MAAM;YAEjE,KAAKF,8BAA8B;gBACjC,OAAO,IAAI,CAAC,0BAA0B,CAACE;YAEzC,KAAKF,gCAAgC;gBACnC,OAAOZ,2BAA2B,CAACc,gBAAgB,IAAI,CAAC,MAAM;YAEhE,KAAKF,uCAAuC;gBAC1C,OAAOF,mCAAmC,CAACI,gBAAgB,IAAI,CAAC,MAAM;YAExE,KAAKF,wCAAwC;gBAC3C,OAAOD,mCAAmC,CAACG;YAE7C,KAAKF,sCAAsC;gBACzC,OAAOb,sCAAsC,CAC3Ce,gBACA,IAAI,CAAC,UAAU;YAGnB;gBACE,OAAOC;QACX;IACF;IAEA,MAAc,2BACZD,cAA8B,EACI;QAClC,OAAQA,eAAe,OAAO,CAAC,MAAM;YACnC,KAAK;gBACH,OAAOjB,qCAAqC,CAC1CiB,gBACA,IAAI,CAAC,UAAU;YAEnB,KAAK;gBACH,OAAOlB,qCAAqC,CAC1CkB,gBACA,IAAI,CAAC,UAAU;YAEnB,KAAK;gBACH,OAAOX,yCAAyC,CAC9CW,gBACA,IAAI,CAAC,MAAM;YAEf,KAAK;gBACH,OAAOhB,oCAAoC,CACzCgB,gBACA,IAAI,CAAC,UAAU;YAEnB;gBACE,OAAOC;QACX;IACF;IAnHA,YAAYC,UAAsB,EAAEC,MAAsB,EAAEC,MAAc,CAAE;QAC1E,IAAI,CAAC,UAAU,GAAGF;QAClB,IAAI,CAAC,MAAM,GAAGC;QACd,IAAI,CAAC,MAAM,GAAGC;IAChB;AAgHF"}
|
package/lib/functions/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { ActionRequest } from '@botonic/react';
|
|
2
|
-
import type { HtFunctionArgument, HtFunctionArguments, HtFunctionNode } from '../content-fields/hubtype-fields/index.js';
|
|
3
|
-
export declare const DEFAULT_FUNCTION_NAMES: string[];
|
|
4
|
-
export declare class CustomFunction {
|
|
5
|
-
functions: Record<any, any>;
|
|
6
|
-
currentRequest: ActionRequest;
|
|
7
|
-
locale: string;
|
|
8
|
-
constructor(functions: Record<any, any>, currentRequest: ActionRequest, locale: string);
|
|
9
|
-
call(functionNode: HtFunctionNode): Promise<string>;
|
|
10
|
-
}
|
|
11
|
-
export declare function getArgumentsByLocale(args: HtFunctionArguments[], locale: string): HtFunctionArgument[];
|
package/lib/functions/index.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
const DEFAULT_FUNCTION_NAMES = [
|
|
2
|
-
'check-queue-status',
|
|
3
|
-
'get-channel-type',
|
|
4
|
-
'check-country',
|
|
5
|
-
'check-bot-variable'
|
|
6
|
-
];
|
|
7
|
-
class CustomFunction {
|
|
8
|
-
async call(functionNode) {
|
|
9
|
-
const functionNodeId = functionNode.id;
|
|
10
|
-
const functionArguments = getArgumentsByLocale(functionNode.content.arguments, this.locale);
|
|
11
|
-
const nameValues = functionArguments.map((arg)=>{
|
|
12
|
-
return {
|
|
13
|
-
[arg.name]: arg.value
|
|
14
|
-
};
|
|
15
|
-
});
|
|
16
|
-
const args = Object.assign({
|
|
17
|
-
request: this.currentRequest,
|
|
18
|
-
results: functionNode.content.result_mapping.map((r)=>r.result)
|
|
19
|
-
}, ...nameValues);
|
|
20
|
-
const functionResult = await this.functions[functionNode.content.action](args);
|
|
21
|
-
// TODO define result_mapping per locale??
|
|
22
|
-
const result = functionNode.content.result_mapping.find((r)=>r.result === functionResult);
|
|
23
|
-
if (!result?.target) {
|
|
24
|
-
throw new Error(`No result found for result_mapping for node with id: ${functionNodeId}`);
|
|
25
|
-
}
|
|
26
|
-
return result.target.id;
|
|
27
|
-
}
|
|
28
|
-
constructor(functions, currentRequest, locale){
|
|
29
|
-
this.functions = functions;
|
|
30
|
-
this.currentRequest = currentRequest;
|
|
31
|
-
this.locale = locale;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
function getArgumentsByLocale(args, locale) {
|
|
35
|
-
let resultArguments = [];
|
|
36
|
-
for (const arg of args){
|
|
37
|
-
if ('locale' in arg && arg.locale === locale) {
|
|
38
|
-
resultArguments = [
|
|
39
|
-
...resultArguments,
|
|
40
|
-
...arg.values
|
|
41
|
-
];
|
|
42
|
-
}
|
|
43
|
-
if ('type' in arg) {
|
|
44
|
-
resultArguments = [
|
|
45
|
-
...resultArguments,
|
|
46
|
-
arg
|
|
47
|
-
];
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return resultArguments;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export { CustomFunction, DEFAULT_FUNCTION_NAMES, getArgumentsByLocale };
|
|
54
|
-
|
|
55
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"functions/index.js","sources":["../../src/functions/index.ts"],"sourcesContent":["import type { ActionRequest } from '@botonic/react'\n\nimport type {\n HtFunctionArgument,\n HtFunctionArguments,\n HtFunctionNode,\n} from '../content-fields/hubtype-fields'\n\nexport const DEFAULT_FUNCTION_NAMES = [\n 'check-queue-status',\n 'get-channel-type',\n 'check-country',\n 'check-bot-variable',\n]\n\nexport class CustomFunction {\n public functions: Record<any, any>\n public currentRequest: ActionRequest\n public locale: string\n\n constructor(\n functions: Record<any, any>,\n currentRequest: ActionRequest,\n locale: string\n ) {\n this.functions = functions\n this.currentRequest = currentRequest\n this.locale = locale\n }\n\n async call(functionNode: HtFunctionNode): Promise<string> {\n const functionNodeId = functionNode.id\n const functionArguments = getArgumentsByLocale(\n functionNode.content.arguments,\n this.locale\n )\n const nameValues = functionArguments.map(arg => {\n return { [arg.name]: arg.value }\n })\n\n const args = Object.assign(\n {\n request: this.currentRequest,\n results: functionNode.content.result_mapping.map(r => r.result),\n },\n ...nameValues\n )\n const functionResult =\n await this.functions[functionNode.content.action](args)\n // TODO define result_mapping per locale??\n const result = functionNode.content.result_mapping.find(\n r => r.result === functionResult\n )\n if (!result?.target) {\n throw new Error(\n `No result found for result_mapping for node with id: ${functionNodeId}`\n )\n }\n return result.target.id\n }\n}\n\nexport function getArgumentsByLocale(\n args: HtFunctionArguments[],\n locale: string\n): HtFunctionArgument[] {\n let resultArguments: HtFunctionArgument[] = []\n for (const arg of args) {\n if ('locale' in arg && arg.locale === locale) {\n resultArguments = [...resultArguments, ...arg.values]\n }\n if ('type' in arg) {\n resultArguments = [...resultArguments, arg]\n }\n }\n\n return resultArguments\n}\n"],"names":["DEFAULT_FUNCTION_NAMES","CustomFunction","functionNode","functionNodeId","functionArguments","getArgumentsByLocale","nameValues","arg","args","Object","r","functionResult","result","Error","functions","currentRequest","locale","resultArguments"],"mappings":"AAQO,MAAMA,sBAAsBA,GAAG;IACpC;IACA;IACA;IACA;CACD;AAEM,MAAMC,cAAcA;IAezB,MAAM,KAAKC,YAA4B,EAAmB;QACxD,MAAMC,iBAAiBD,aAAa,EAAE;QACtC,MAAME,oBAAoBC,oBAAoBA,CAC5CH,aAAa,OAAO,CAAC,SAAS,EAC9B,IAAI,CAAC,MAAM;QAEb,MAAMI,aAAaF,kBAAkB,GAAG,CAACG,CAAAA;YACvC,OAAO;gBAAE,CAACA,IAAI,IAAI,CAAC,EAAEA,IAAI,KAAK;YAAC;QACjC;QAEA,MAAMC,OAAOC,OAAO,MAAM,CACxB;YACE,SAAS,IAAI,CAAC,cAAc;YAC5B,SAASP,aAAa,OAAO,CAAC,cAAc,CAAC,GAAG,CAACQ,CAAAA,IAAKA,EAAE,MAAM;QAChE,MACGJ;QAEL,MAAMK,iBACJ,MAAM,IAAI,CAAC,SAAS,CAACT,aAAa,OAAO,CAAC,MAAM,CAAC,CAACM;QACpD,0CAA0C;QAC1C,MAAMI,SAASV,aAAa,OAAO,CAAC,cAAc,CAAC,IAAI,CACrDQ,CAAAA,IAAKA,EAAE,MAAM,KAAKC;QAEpB,IAAI,CAACC,QAAQ,QAAQ;YACnB,MAAM,IAAIC,MACR,CAAC,qDAAqD,EAAEV,gBAAgB;QAE5E;QACA,OAAOS,OAAO,MAAM,CAAC,EAAE;IACzB;IAvCA,YACEE,SAA2B,EAC3BC,cAA6B,EAC7BC,MAAc,CACd;QACA,IAAI,CAAC,SAAS,GAAGF;QACjB,IAAI,CAAC,cAAc,GAAGC;QACtB,IAAI,CAAC,MAAM,GAAGC;IAChB;AAgCF;AAEO,SAASX,oBAAoBA,CAClCG,IAA2B,EAC3BQ,MAAc;IAEd,IAAIC,kBAAwC,EAAE;IAC9C,KAAK,MAAMV,OAAOC,KAAM;QACtB,IAAI,YAAYD,OAAOA,IAAI,MAAM,KAAKS,QAAQ;YAC5CC,kBAAkB;mBAAIA;mBAAoBV,IAAI,MAAM;aAAC;QACvD;QACA,IAAI,UAAUA,KAAK;YACjBU,kBAAkB;mBAAIA;gBAAiBV;aAAI;QAC7C;IACF;IAEA,OAAOU;AACT"}
|
package/lib/index.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { type Plugin, type PluginPreRequest, type ResolvedPlugins, type Session } from '@botonic/core';
|
|
2
|
-
import { FlowBuilderApi } from './api.js';
|
|
3
|
-
import type { FlowContent } from './content-fields/index.js';
|
|
4
|
-
import { type HtNodeWithContent } from './content-fields/hubtype-fields/index.js';
|
|
5
|
-
import { type AiAgentFunction, type BotonicPluginFlowBuilderOptions, type ContentFilter, FlowBuilderJSONVersion, type InShadowingConfig, type PayloadParamsBase, type RatingSubmittedInfo, type TrackEventFunction } from './types.js';
|
|
6
|
-
import type { SmartIntentsInferenceConfig } from './user-input/smart-intent.js';
|
|
7
|
-
export default class BotonicPluginFlowBuilder implements Plugin {
|
|
8
|
-
cmsApi: FlowBuilderApi;
|
|
9
|
-
private flow?;
|
|
10
|
-
private functions;
|
|
11
|
-
private currentRequest;
|
|
12
|
-
getAccessToken: (session: Session) => string;
|
|
13
|
-
trackEvent?: TrackEventFunction;
|
|
14
|
-
getAiAgentResponse?: AiAgentFunction;
|
|
15
|
-
smartIntentsConfig: SmartIntentsInferenceConfig;
|
|
16
|
-
inShadowing: InShadowingConfig;
|
|
17
|
-
contentFilters: ContentFilter[];
|
|
18
|
-
jsonVersion: FlowBuilderJSONVersion;
|
|
19
|
-
apiUrl: string;
|
|
20
|
-
customRatingMessageEnabled: boolean;
|
|
21
|
-
disableAIAgentInFirstInteraction: boolean;
|
|
22
|
-
constructor(options: BotonicPluginFlowBuilderOptions<ResolvedPlugins, any>);
|
|
23
|
-
resolveFlowUrl(request: PluginPreRequest): string;
|
|
24
|
-
pre(request: PluginPreRequest): Promise<void>;
|
|
25
|
-
private convertWhatsappAiAgentEmptyPayloads;
|
|
26
|
-
private updateRequestBeforeRoutes;
|
|
27
|
-
private removeSourceSuffix;
|
|
28
|
-
post(request: PluginPreRequest): void;
|
|
29
|
-
getContentsByContentID(contentID: string, prevContents?: FlowContent[]): Promise<FlowContent[]>;
|
|
30
|
-
getUUIDByContentID(contentID: string): string;
|
|
31
|
-
private getContentsById;
|
|
32
|
-
getStartContents(): Promise<FlowContent[]>;
|
|
33
|
-
getContentsByNode(node: HtNodeWithContent, prevContents?: FlowContent[]): Promise<FlowContent[]>;
|
|
34
|
-
getPayloadParams<T extends PayloadParamsBase>(payload: string): T;
|
|
35
|
-
getFlowName(flowId: string): string;
|
|
36
|
-
getRatingSubmittedInfo(payload: string): RatingSubmittedInfo;
|
|
37
|
-
setInShadowing(inShadowing: InShadowingConfig): void;
|
|
38
|
-
}
|
|
39
|
-
export * from './action/index.js';
|
|
40
|
-
export { AGENT_RATING_PAYLOAD, EMPTY_PAYLOAD } from './constants.js';
|
|
41
|
-
export * from './content-fields/index.js';
|
|
42
|
-
export type { HtBotActionNode } from './content-fields/hubtype-fields/index.js';
|
|
43
|
-
export { getCommonFlowContentEventArgsForContentId, trackFlowContent, } from './tracking.js';
|
|
44
|
-
export { type BotonicPluginFlowBuilderOptions, type ContentFilter, FlowBuilderJSONVersion, type PayloadParamsBase, type RatingSubmittedInfo, } from './types.js';
|
|
45
|
-
export * from './webview/index.js';
|
package/lib/index.js
DELETED
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
import { INPUT, PROVIDER } from "@botonic/core";
|
|
2
|
-
import { v7 } from "uuid";
|
|
3
|
-
import { FlowBuilderApi } from "./api.js";
|
|
4
|
-
import { AGENT_RATING_PAYLOAD, EMPTY_PAYLOAD, FLOW_BUILDER_API_URL_PROD, SEPARATOR, SOURCE_INFO_SEPARATOR } from "./constants.js";
|
|
5
|
-
import { HtNodeWithContentType } from "./content-fields/hubtype-fields/index.js";
|
|
6
|
-
import { FlowFactory } from "./flow-factory.js";
|
|
7
|
-
import { CustomFunction, DEFAULT_FUNCTION_NAMES } from "./functions/index.js";
|
|
8
|
-
import { FlowBuilderJSONVersion } from "./types.js";
|
|
9
|
-
import { getNextPayloadByUserInput } from "./user-input/index.js";
|
|
10
|
-
import { resolveGetAccessToken } from "./utils/authentication.js";
|
|
11
|
-
import { inputHasTextOrTranscript } from "./utils/input.js";
|
|
12
|
-
|
|
13
|
-
export * from "./action/index.js";
|
|
14
|
-
export * from "./content-fields/index.js";
|
|
15
|
-
export * from "./webview/index.js";
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
class BotonicPluginFlowBuilder {
|
|
40
|
-
resolveFlowUrl(request) {
|
|
41
|
-
if (request.session.is_test_integration) {
|
|
42
|
-
return `${this.apiUrl}/v1/bot_flows/{bot_id}/versions/${FlowBuilderJSONVersion.DRAFT}/`;
|
|
43
|
-
}
|
|
44
|
-
return `${this.apiUrl}/v1/bot_flows/{bot_id}/versions/${this.jsonVersion}/`;
|
|
45
|
-
}
|
|
46
|
-
async pre(request) {
|
|
47
|
-
// When AI Agent is executed in Whatsapp, button payloads come as referral and must be converted to text being processed by the agent.
|
|
48
|
-
this.convertWhatsappAiAgentEmptyPayloads(request);
|
|
49
|
-
this.currentRequest = request;
|
|
50
|
-
this.cmsApi = await FlowBuilderApi.create({
|
|
51
|
-
flowUrl: this.resolveFlowUrl(request),
|
|
52
|
-
url: this.apiUrl,
|
|
53
|
-
flow: this.flow,
|
|
54
|
-
accessToken: this.getAccessToken(request.session),
|
|
55
|
-
request: this.currentRequest
|
|
56
|
-
});
|
|
57
|
-
const checkUserTextInput = inputHasTextOrTranscript(request.input) && !request.input.payload;
|
|
58
|
-
if (checkUserTextInput) {
|
|
59
|
-
const resolvedLocale = this.cmsApi.getResolvedLocale();
|
|
60
|
-
const nextPayload = await getNextPayloadByUserInput(this.cmsApi, resolvedLocale, request, this.smartIntentsConfig);
|
|
61
|
-
request.input.payload = nextPayload;
|
|
62
|
-
}
|
|
63
|
-
await this.updateRequestBeforeRoutes(request);
|
|
64
|
-
}
|
|
65
|
-
convertWhatsappAiAgentEmptyPayloads(request) {
|
|
66
|
-
if (request.session.user.provider === PROVIDER.WHATSAPP) {
|
|
67
|
-
const shouldUseReferral = request.input.referral && request.input.payload?.startsWith(EMPTY_PAYLOAD);
|
|
68
|
-
if (shouldUseReferral) {
|
|
69
|
-
request.input.type = INPUT.TEXT;
|
|
70
|
-
request.input.data = request.input.referral;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
async updateRequestBeforeRoutes(request) {
|
|
75
|
-
this.cmsApi.removeCaptureUserInputId();
|
|
76
|
-
if (request.input.payload) {
|
|
77
|
-
request.input.payload = this.removeSourceSuffix(request.input.payload);
|
|
78
|
-
if (this.cmsApi.isBotAction(request.input.payload)) {
|
|
79
|
-
const cmsBotAction = this.cmsApi.getNodeById(request.input.payload);
|
|
80
|
-
request.input.payload = this.cmsApi.createPayloadWithParams(cmsBotAction);
|
|
81
|
-
// Re-execute convertWhatsappAiAgentEmptyPayloads function to handle
|
|
82
|
-
// the case that a BotAction has a payload equals to EMPTY_PAYLOAD
|
|
83
|
-
this.convertWhatsappAiAgentEmptyPayloads(request);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
removeSourceSuffix(payload) {
|
|
88
|
-
return payload.split(SOURCE_INFO_SEPARATOR)[0];
|
|
89
|
-
}
|
|
90
|
-
post(request) {
|
|
91
|
-
request.input.nluResolution = undefined;
|
|
92
|
-
delete request.session.user.system_locale_updated;
|
|
93
|
-
}
|
|
94
|
-
async getContentsByContentID(contentID, prevContents) {
|
|
95
|
-
const node = this.cmsApi.getNodeByContentID(contentID);
|
|
96
|
-
return await this.getContentsByNode(node, prevContents);
|
|
97
|
-
}
|
|
98
|
-
getUUIDByContentID(contentID) {
|
|
99
|
-
const node = this.cmsApi.getNodeByContentID(contentID);
|
|
100
|
-
return node.id;
|
|
101
|
-
}
|
|
102
|
-
async getContentsById(id, prevContents) {
|
|
103
|
-
const node = this.cmsApi.getNodeById(id);
|
|
104
|
-
return await this.getContentsByNode(node, prevContents);
|
|
105
|
-
}
|
|
106
|
-
async getStartContents() {
|
|
107
|
-
const startNode = this.cmsApi.getStartNode();
|
|
108
|
-
this.currentRequest.session.flow_thread_id = v7();
|
|
109
|
-
return await this.getContentsByNode(startNode);
|
|
110
|
-
}
|
|
111
|
-
async getContentsByNode(node, prevContents) {
|
|
112
|
-
const contents = prevContents || [];
|
|
113
|
-
const resolvedLocale = this.cmsApi.getResolvedLocale();
|
|
114
|
-
if (node.type === HtNodeWithContentType.FUNCTION && !DEFAULT_FUNCTION_NAMES.includes(node.content.action)) {
|
|
115
|
-
const customFunctionResolver = new CustomFunction(this.functions, this.currentRequest, resolvedLocale);
|
|
116
|
-
const targetId = await customFunctionResolver.call(node);
|
|
117
|
-
return this.getContentsById(targetId, contents);
|
|
118
|
-
}
|
|
119
|
-
const flowFactory = new FlowFactory(this.currentRequest, this.cmsApi, resolvedLocale);
|
|
120
|
-
const content = await flowFactory.getFlowContent(node);
|
|
121
|
-
if (content) {
|
|
122
|
-
contents.push(content);
|
|
123
|
-
}
|
|
124
|
-
// If node is BOT_ACTION not add more contents to render, next nodes render after execute action
|
|
125
|
-
if (node.type === HtNodeWithContentType.BOT_ACTION) {
|
|
126
|
-
return contents;
|
|
127
|
-
}
|
|
128
|
-
// TODO: prevent infinite recursive calls
|
|
129
|
-
if (content?.followUp) {
|
|
130
|
-
return this.getContentsById(content.followUp.id, contents);
|
|
131
|
-
} else if (node.follow_up) {
|
|
132
|
-
console.log('FOLLOWUP FROM NODE-------> OLD SYSTEM');
|
|
133
|
-
return this.getContentsById(node.follow_up.id, contents);
|
|
134
|
-
}
|
|
135
|
-
return contents;
|
|
136
|
-
}
|
|
137
|
-
getPayloadParams(payload) {
|
|
138
|
-
const payloadParams = JSON.parse(payload.split(SEPARATOR)[1] || '{}');
|
|
139
|
-
return payloadParams;
|
|
140
|
-
}
|
|
141
|
-
getFlowName(flowId) {
|
|
142
|
-
return this.cmsApi.getFlowName(flowId);
|
|
143
|
-
}
|
|
144
|
-
getRatingSubmittedInfo(payload) {
|
|
145
|
-
const buttonId = payload?.split(SEPARATOR)[1];
|
|
146
|
-
const ratingNode = this.cmsApi.getRatingNodeByButtonId(buttonId);
|
|
147
|
-
const ratingButton = this.cmsApi.getRatingButtonById(ratingNode, buttonId);
|
|
148
|
-
const possibleOptions = ratingNode.content.buttons.map((button)=>button.text);
|
|
149
|
-
const possibleValues = ratingNode.content.buttons.map((button)=>button.value);
|
|
150
|
-
return {
|
|
151
|
-
...ratingButton,
|
|
152
|
-
possibleOptions,
|
|
153
|
-
possibleValues
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
setInShadowing(inShadowing) {
|
|
157
|
-
this.inShadowing = inShadowing;
|
|
158
|
-
}
|
|
159
|
-
constructor(options){
|
|
160
|
-
this.apiUrl = options.apiUrl || FLOW_BUILDER_API_URL_PROD;
|
|
161
|
-
this.jsonVersion = options.jsonVersion || FlowBuilderJSONVersion.LATEST;
|
|
162
|
-
this.flow = options.flow;
|
|
163
|
-
this.getAccessToken = resolveGetAccessToken(options.getAccessToken);
|
|
164
|
-
this.trackEvent = options.trackEvent;
|
|
165
|
-
this.getAiAgentResponse = options.getAiAgentResponse;
|
|
166
|
-
this.smartIntentsConfig = {
|
|
167
|
-
...options?.smartIntentsConfig,
|
|
168
|
-
useLatest: this.jsonVersion === FlowBuilderJSONVersion.LATEST
|
|
169
|
-
};
|
|
170
|
-
const customFunctions = options.customFunctions || {};
|
|
171
|
-
this.functions = customFunctions;
|
|
172
|
-
this.inShadowing = {
|
|
173
|
-
allowKeywords: options.inShadowing?.allowKeywords || false,
|
|
174
|
-
allowSmartIntents: options.inShadowing?.allowSmartIntents || false,
|
|
175
|
-
allowAiAgents: options.inShadowing?.allowAiAgents || false
|
|
176
|
-
};
|
|
177
|
-
this.contentFilters = options.contentFilters || [];
|
|
178
|
-
this.customRatingMessageEnabled = options.customRatingMessageEnabled || false;
|
|
179
|
-
this.disableAIAgentInFirstInteraction = options.disableAIAgentInFirstInteraction || false;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
// TODO: Create a proper service to wrap all calls and allow api versioning
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
export { AGENT_RATING_PAYLOAD, EMPTY_PAYLOAD, FlowBuilderJSONVersion };
|
|
192
|
-
export { getCommonFlowContentEventArgsForContentId, trackFlowContent } from "./tracking.js";
|
|
193
|
-
export default BotonicPluginFlowBuilder;
|
|
194
|
-
|
|
195
|
-
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import {\n INPUT,\n type Plugin,\n type PluginPreRequest,\n PROVIDER,\n type ResolvedPlugins,\n type Session,\n} from '@botonic/core'\nimport type { ActionRequest } from '@botonic/react'\nimport { v7 as uuidv7 } from 'uuid'\n\nimport { FlowBuilderApi } from './api'\nimport {\n EMPTY_PAYLOAD,\n FLOW_BUILDER_API_URL_PROD,\n SEPARATOR,\n SOURCE_INFO_SEPARATOR,\n} from './constants'\nimport type { FlowContent } from './content-fields'\nimport {\n type HtBotActionNode,\n type HtFlowBuilderData,\n type HtNodeWithContent,\n HtNodeWithContentType,\n} from './content-fields/hubtype-fields'\nimport { FlowFactory } from './flow-factory'\nimport { CustomFunction, DEFAULT_FUNCTION_NAMES } from './functions'\nimport {\n type AiAgentFunction,\n type BotonicPluginFlowBuilderOptions,\n type ContentFilter,\n FlowBuilderJSONVersion,\n type InShadowingConfig,\n type PayloadParamsBase,\n type RatingSubmittedInfo,\n type TrackEventFunction,\n} from './types'\nimport { getNextPayloadByUserInput } from './user-input'\nimport type { SmartIntentsInferenceConfig } from './user-input/smart-intent'\nimport { resolveGetAccessToken } from './utils/authentication'\nimport { inputHasTextOrTranscript } from './utils/input'\n\n// TODO: Create a proper service to wrap all calls and allow api versioning\n\nexport default class BotonicPluginFlowBuilder implements Plugin {\n public cmsApi: FlowBuilderApi\n private flow?: HtFlowBuilderData\n private functions: Record<any, any>\n private currentRequest: PluginPreRequest\n public getAccessToken: (session: Session) => string\n public trackEvent?: TrackEventFunction\n public getAiAgentResponse?: AiAgentFunction\n public smartIntentsConfig: SmartIntentsInferenceConfig\n public inShadowing: InShadowingConfig\n public contentFilters: ContentFilter[]\n\n // TODO: Rethink how we construct FlowBuilderApi to be simpler\n public jsonVersion: FlowBuilderJSONVersion\n public apiUrl: string\n public customRatingMessageEnabled: boolean\n public disableAIAgentInFirstInteraction: boolean\n\n constructor(options: BotonicPluginFlowBuilderOptions<ResolvedPlugins, any>) {\n this.apiUrl = options.apiUrl || FLOW_BUILDER_API_URL_PROD\n this.jsonVersion = options.jsonVersion || FlowBuilderJSONVersion.LATEST\n this.flow = options.flow\n this.getAccessToken = resolveGetAccessToken(options.getAccessToken)\n this.trackEvent = options.trackEvent\n this.getAiAgentResponse = options.getAiAgentResponse\n this.smartIntentsConfig = {\n ...options?.smartIntentsConfig,\n useLatest: this.jsonVersion === FlowBuilderJSONVersion.LATEST,\n }\n const customFunctions = options.customFunctions || {}\n this.functions = customFunctions\n this.inShadowing = {\n allowKeywords: options.inShadowing?.allowKeywords || false,\n allowSmartIntents: options.inShadowing?.allowSmartIntents || false,\n allowAiAgents: options.inShadowing?.allowAiAgents || false,\n }\n this.contentFilters = options.contentFilters || []\n this.customRatingMessageEnabled =\n options.customRatingMessageEnabled || false\n this.disableAIAgentInFirstInteraction =\n options.disableAIAgentInFirstInteraction || false\n }\n\n resolveFlowUrl(request: PluginPreRequest): string {\n if (request.session.is_test_integration) {\n return `${this.apiUrl}/v1/bot_flows/{bot_id}/versions/${FlowBuilderJSONVersion.DRAFT}/`\n }\n return `${this.apiUrl}/v1/bot_flows/{bot_id}/versions/${this.jsonVersion}/`\n }\n\n async pre(request: PluginPreRequest): Promise<void> {\n // When AI Agent is executed in Whatsapp, button payloads come as referral and must be converted to text being processed by the agent.\n this.convertWhatsappAiAgentEmptyPayloads(request)\n\n this.currentRequest = request\n this.cmsApi = await FlowBuilderApi.create({\n flowUrl: this.resolveFlowUrl(request),\n url: this.apiUrl,\n flow: this.flow,\n accessToken: this.getAccessToken(request.session),\n request: this.currentRequest,\n })\n\n const checkUserTextInput =\n inputHasTextOrTranscript(request.input) && !request.input.payload\n\n if (checkUserTextInput) {\n const resolvedLocale = this.cmsApi.getResolvedLocale()\n const nextPayload = await getNextPayloadByUserInput(\n this.cmsApi,\n resolvedLocale,\n request as unknown as ActionRequest,\n this.smartIntentsConfig\n )\n request.input.payload = nextPayload\n }\n\n await this.updateRequestBeforeRoutes(request)\n }\n\n private convertWhatsappAiAgentEmptyPayloads(request: PluginPreRequest): void {\n if (request.session.user.provider === PROVIDER.WHATSAPP) {\n const shouldUseReferral =\n request.input.referral &&\n request.input.payload?.startsWith(EMPTY_PAYLOAD)\n\n if (shouldUseReferral) {\n request.input.type = INPUT.TEXT\n request.input.data = request.input.referral\n }\n }\n }\n\n private async updateRequestBeforeRoutes(\n request: PluginPreRequest\n ): Promise<void> {\n this.cmsApi.removeCaptureUserInputId()\n if (request.input.payload) {\n request.input.payload = this.removeSourceSuffix(request.input.payload)\n\n if (this.cmsApi.isBotAction(request.input.payload)) {\n const cmsBotAction = this.cmsApi.getNodeById<HtBotActionNode>(\n request.input.payload\n )\n\n request.input.payload =\n this.cmsApi.createPayloadWithParams(cmsBotAction)\n\n // Re-execute convertWhatsappAiAgentEmptyPayloads function to handle\n // the case that a BotAction has a payload equals to EMPTY_PAYLOAD\n this.convertWhatsappAiAgentEmptyPayloads(request)\n }\n }\n }\n\n private removeSourceSuffix(payload: string): string {\n return payload.split(SOURCE_INFO_SEPARATOR)[0]\n }\n\n post(request: PluginPreRequest): void {\n request.input.nluResolution = undefined\n delete request.session.user.system_locale_updated\n }\n\n async getContentsByContentID(\n contentID: string,\n prevContents?: FlowContent[]\n ): Promise<FlowContent[]> {\n const node = this.cmsApi.getNodeByContentID(contentID) as HtNodeWithContent\n return await this.getContentsByNode(node, prevContents)\n }\n\n getUUIDByContentID(contentID: string): string {\n const node = this.cmsApi.getNodeByContentID(contentID)\n return node.id\n }\n\n private async getContentsById(\n id: string,\n prevContents?: FlowContent[]\n ): Promise<FlowContent[]> {\n const node = this.cmsApi.getNodeById(id) as HtNodeWithContent\n return await this.getContentsByNode(node, prevContents)\n }\n\n async getStartContents(): Promise<FlowContent[]> {\n const startNode = this.cmsApi.getStartNode()\n this.currentRequest.session.flow_thread_id = uuidv7()\n return await this.getContentsByNode(startNode)\n }\n\n async getContentsByNode(\n node: HtNodeWithContent,\n prevContents?: FlowContent[]\n ): Promise<FlowContent[]> {\n const contents = prevContents || []\n const resolvedLocale = this.cmsApi.getResolvedLocale()\n\n if (\n node.type === HtNodeWithContentType.FUNCTION &&\n !DEFAULT_FUNCTION_NAMES.includes(node.content.action)\n ) {\n const customFunctionResolver = new CustomFunction(\n this.functions,\n this.currentRequest,\n resolvedLocale\n )\n const targetId = await customFunctionResolver.call(node)\n return this.getContentsById(targetId, contents)\n }\n\n const flowFactory = new FlowFactory(\n this.currentRequest,\n this.cmsApi,\n resolvedLocale\n )\n const content = await flowFactory.getFlowContent(node)\n if (content) {\n contents.push(content)\n }\n\n // If node is BOT_ACTION not add more contents to render, next nodes render after execute action\n if (node.type === HtNodeWithContentType.BOT_ACTION) {\n return contents\n }\n\n // TODO: prevent infinite recursive calls\n if (content?.followUp) {\n return this.getContentsById(content.followUp.id, contents)\n } else if (node.follow_up) {\n console.log('FOLLOWUP FROM NODE-------> OLD SYSTEM')\n return this.getContentsById(node.follow_up.id, contents)\n }\n\n return contents\n }\n\n getPayloadParams<T extends PayloadParamsBase>(payload: string): T {\n const payloadParams = JSON.parse(payload.split(SEPARATOR)[1] || '{}')\n return payloadParams\n }\n\n getFlowName(flowId: string): string {\n return this.cmsApi.getFlowName(flowId)\n }\n\n getRatingSubmittedInfo(payload: string): RatingSubmittedInfo {\n const buttonId = payload?.split(SEPARATOR)[1]\n const ratingNode = this.cmsApi.getRatingNodeByButtonId(buttonId)\n\n const ratingButton = this.cmsApi.getRatingButtonById(ratingNode, buttonId)\n const possibleOptions = ratingNode.content.buttons.map(\n button => button.text\n )\n const possibleValues = ratingNode.content.buttons.map(\n button => button.value\n )\n\n return {\n ...ratingButton,\n possibleOptions,\n possibleValues,\n }\n }\n\n setInShadowing(inShadowing: InShadowingConfig): void {\n this.inShadowing = inShadowing\n }\n}\n\nexport * from './action'\nexport { AGENT_RATING_PAYLOAD, EMPTY_PAYLOAD } from './constants'\nexport * from './content-fields'\nexport type { HtBotActionNode } from './content-fields/hubtype-fields'\nexport {\n getCommonFlowContentEventArgsForContentId,\n trackFlowContent,\n} from './tracking'\nexport {\n type BotonicPluginFlowBuilderOptions,\n type ContentFilter,\n FlowBuilderJSONVersion,\n type PayloadParamsBase,\n type RatingSubmittedInfo,\n} from './types'\nexport * from './webview'\n"],"names":["INPUT","PROVIDER","v7","uuidv7","FlowBuilderApi","EMPTY_PAYLOAD","FLOW_BUILDER_API_URL_PROD","SEPARATOR","SOURCE_INFO_SEPARATOR","HtNodeWithContentType","FlowFactory","CustomFunction","DEFAULT_FUNCTION_NAMES","FlowBuilderJSONVersion","getNextPayloadByUserInput","resolveGetAccessToken","inputHasTextOrTranscript","BotonicPluginFlowBuilder","request","checkUserTextInput","resolvedLocale","nextPayload","shouldUseReferral","cmsBotAction","payload","undefined","contentID","prevContents","node","id","startNode","contents","customFunctionResolver","targetId","flowFactory","content","console","payloadParams","JSON","flowId","buttonId","ratingNode","ratingButton","possibleOptions","button","possibleValues","inShadowing","options","customFunctions","AGENT_RATING_PAYLOAD","getCommonFlowContentEventArgsForContentId","trackFlowContent"],"mappings":"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"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import axios from "axios";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const HUBTYPE_API_URL = process.env.HUBTYPE_API_URL || 'https://api.hubtype.com';
|
|
6
|
-
class HubtypeQueuesApi {
|
|
7
|
-
async getAvailability() {
|
|
8
|
-
const response = await axios.get(`${HUBTYPE_API_URL}/external/v1/queues/${this.queueId}/availability/`, // TODO: Make it configurable in the future
|
|
9
|
-
{
|
|
10
|
-
params: {
|
|
11
|
-
check_queue_schedule: true,
|
|
12
|
-
check_waiting_cases: false,
|
|
13
|
-
check_available_agents: this.checkAvailableAgents
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
return response.data;
|
|
17
|
-
}
|
|
18
|
-
constructor(queueId, checkAvailableAgents){
|
|
19
|
-
this.queueId = queueId;
|
|
20
|
-
this.checkAvailableAgents = checkAvailableAgents || false;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export { HubtypeQueuesApi };
|
|
25
|
-
|
|
26
|
-
//# sourceMappingURL=hubtype-queues-api.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"services/hubtype-queues-api.js","sources":["../../src/services/hubtype-queues-api.ts"],"sourcesContent":["import axios from 'axios'\n\nconst HUBTYPE_API_URL = process.env.HUBTYPE_API_URL || 'https://api.hubtype.com'\n\nexport interface AvailabilityData {\n available: boolean\n waiting_cases: number\n availability_threshold_waiting_cases: number\n open: boolean\n name: string\n available_agents: number\n}\nexport class HubtypeQueuesApi {\n public queueId: string\n public checkAvailableAgents: boolean\n\n constructor(queueId: string, checkAvailableAgents?: boolean) {\n this.queueId = queueId\n this.checkAvailableAgents = checkAvailableAgents || false\n }\n\n async getAvailability(): Promise<AvailabilityData> {\n const response = await axios.get(\n `${HUBTYPE_API_URL}/external/v1/queues/${this.queueId}/availability/`,\n // TODO: Make it configurable in the future\n {\n params: {\n check_queue_schedule: true,\n check_waiting_cases: false,\n check_available_agents: this.checkAvailableAgents,\n },\n }\n )\n return response.data\n }\n}\n"],"names":["axios","HUBTYPE_API_URL","process","HubtypeQueuesApi","response","queueId","checkAvailableAgents"],"mappings":";;;AAAyB;AAEzB,MAAMC,eAAeA,GAAGC,QAAQ,GAAG,CAAC,eAAe,IAAI;AAUhD,MAAMC,gBAAgBA;IAS3B,MAAM,kBAA6C;QACjD,MAAMC,WAAW,MAAMJ,SAAS,CAC9B,GAAGC,eAAeA,CAAC,oBAAoB,EAAE,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,EACrE,2CAA2C;QAC3C;YACE,QAAQ;gBACN,sBAAsB;gBACtB,qBAAqB;gBACrB,wBAAwB,IAAI,CAAC,oBAAoB;YACnD;QACF;QAEF,OAAOG,SAAS,IAAI;IACtB;IAlBA,YAAYC,OAAe,EAAEC,oBAA8B,CAAE;QAC3D,IAAI,CAAC,OAAO,GAAGD;QACf,IAAI,CAAC,oBAAoB,GAAGC,wBAAwB;IACtD;AAgBF"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var flow_builder_content_FlowBuilderOutputMessageType = /*#__PURE__*/ function(FlowBuilderOutputMessageType) {
|
|
6
|
-
FlowBuilderOutputMessageType["FlowBuilderContent"] = "flowBuilderContent";
|
|
7
|
-
return FlowBuilderOutputMessageType;
|
|
8
|
-
}({});
|
|
9
|
-
const FlowBuilderContentSchema = z.object({
|
|
10
|
-
type: z.literal("flowBuilderContent"),
|
|
11
|
-
contentId: z.string()
|
|
12
|
-
}).describe('A Flow Builder content ID. Use it only when asked explicitly in the prompt');
|
|
13
|
-
|
|
14
|
-
export { FlowBuilderContentSchema, flow_builder_content_FlowBuilderOutputMessageType as FlowBuilderOutputMessageType };
|
|
15
|
-
|
|
16
|
-
//# sourceMappingURL=flow-builder-content.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"structured-output/flow-builder-content.js","sources":["../../src/structured-output/flow-builder-content.ts"],"sourcesContent":["import type { BaseMessage } from '@botonic/core'\nimport { z } from 'zod'\n\nexport enum FlowBuilderOutputMessageType {\n FlowBuilderContent = 'flowBuilderContent',\n}\n\nexport interface FlowBuilderContentMessage\n extends BaseMessage<FlowBuilderOutputMessageType.FlowBuilderContent> {\n type: FlowBuilderOutputMessageType.FlowBuilderContent\n contentId: string\n}\n\nexport const FlowBuilderContentSchema = z\n .object({\n type: z.literal(FlowBuilderOutputMessageType.FlowBuilderContent),\n contentId: z.string(),\n })\n .describe(\n 'A Flow Builder content ID. Use it only when asked explicitly in the prompt'\n )\n"],"names":["z","FlowBuilderOutputMessageType","FlowBuilderContentSchema"],"mappings":";;;AACuB;AAEhB,IAAKC,iDAA4BA,0BAA5BA;;WAAAA;MAEX;AAQM,MAAMC,wBAAwBA,GAAGF,QAC/B,CAAC;IACN,MAAMA,SAAS;IACf,WAAWA,QAAQ;AACrB,GACC,QAAQ,CACP,8EACD"}
|
package/lib/tracking.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { type BotContext, EventAction } from '@botonic/core';
|
|
2
|
-
import type { ActionRequest } from '@botonic/react';
|
|
3
|
-
import type { FlowBuilderApi } from './api.js';
|
|
4
|
-
import type { FlowContent } from './content-fields/index.js';
|
|
5
|
-
export declare function trackEvent(request: ActionRequest, eventAction: EventAction, args?: Record<string, any>): Promise<void>;
|
|
6
|
-
export declare function trackFlowContent(request: ActionRequest, contents: FlowContent[]): Promise<void>;
|
|
7
|
-
export declare function trackOneContent(request: ActionRequest, content: FlowContent, cmsApi?: FlowBuilderApi): Promise<void>;
|
|
8
|
-
type CommonFlowContentEventArgs = {
|
|
9
|
-
flowThreadId: string;
|
|
10
|
-
flowId: string;
|
|
11
|
-
flowName: string;
|
|
12
|
-
flowNodeId: string;
|
|
13
|
-
flowNodeContentId: string;
|
|
14
|
-
};
|
|
15
|
-
export declare function getCommonFlowContentEventArgsForContentId(botContext: BotContext, id: string): CommonFlowContentEventArgs;
|
|
16
|
-
export {};
|