@botonic/plugin-flow-builder 0.56.0-alpha.0 → 0.57.0-rslib-esm.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/{cjs/action → action}/ai-agent-from-user-input.d.ts +2 -2
- package/lib/{cjs/action → action}/ai-agent-from-user-input.js +9 -6
- package/lib/action/ai-agent-from-user-input.js.map +1 -0
- package/lib/{esm/action → action}/context.d.ts +2 -2
- package/lib/action/context.js +20 -0
- package/lib/action/context.js.map +1 -0
- package/lib/{cjs/action → action}/fallback.d.ts +2 -2
- package/lib/{cjs/action → action}/fallback.js +16 -11
- package/lib/action/fallback.js.map +1 -0
- package/lib/action/first-interaction.d.ts +3 -0
- package/lib/{cjs/action → action}/first-interaction.js +39 -27
- package/lib/action/first-interaction.js.map +1 -0
- package/lib/{cjs/action → action}/get-contents.d.ts +1 -1
- package/lib/action/get-contents.js +56 -0
- package/lib/action/get-contents.js.map +1 -0
- package/lib/{esm/action → action}/index.d.ts +1 -1
- package/lib/{esm/action → action}/index.js +68 -32
- package/lib/action/index.js.map +1 -0
- package/lib/action/payload.d.ts +3 -0
- package/lib/{cjs/action → action}/payload.js +27 -23
- package/lib/action/payload.js.map +1 -0
- package/lib/{cjs/api.d.ts → api.d.ts} +2 -2
- package/lib/{esm/api.js → api.js} +55 -44
- package/lib/api.js.map +1 -0
- package/lib/constants.js +17 -0
- package/lib/constants.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/content-fields-base.d.ts +2 -2
- package/lib/content-fields/content-fields-base.js +78 -0
- package/lib/content-fields/content-fields-base.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/custom-conditional/custom-conditional-v2-evaluators.d.ts +1 -1
- package/lib/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +73 -0
- package/lib/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/custom-conditional/custom-conditional-v2-resolver.d.ts +1 -1
- package/lib/{cjs/content-fields → content-fields}/custom-conditional/custom-conditional-v2-resolver.js +15 -15
- package/lib/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/custom-conditional/flow-custom-condition-v2.d.ts +3 -3
- package/lib/content-fields/custom-conditional/flow-custom-condition-v2.js +94 -0
- package/lib/content-fields/custom-conditional/flow-custom-condition-v2.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-ai-agent-base.d.ts +4 -4
- package/lib/content-fields/flow-ai-agent-base.js +100 -0
- package/lib/content-fields/flow-ai-agent-base.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-ai-agent-router.d.ts +5 -5
- package/lib/{esm/content-fields → content-fields}/flow-ai-agent-router.js +57 -46
- package/lib/content-fields/flow-ai-agent-router.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/flow-ai-agent.d.ts +4 -4
- package/lib/{cjs/content-fields → content-fields}/flow-ai-agent.js +33 -22
- package/lib/content-fields/flow-ai-agent.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-bot-action.d.ts +3 -3
- package/lib/{esm/content-fields → content-fields}/flow-bot-action.js +23 -15
- package/lib/content-fields/flow-bot-action.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-button.d.ts +5 -5
- package/lib/{esm/content-fields → content-fields}/flow-button.js +48 -29
- package/lib/content-fields/flow-button.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/flow-capture-user-input.d.ts +2 -2
- package/lib/content-fields/flow-capture-user-input.js +46 -0
- package/lib/content-fields/flow-capture-user-input.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-carousel.d.ts +4 -4
- package/lib/content-fields/flow-carousel.js +193 -0
- package/lib/content-fields/flow-carousel.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-channel-conditional.d.ts +3 -3
- package/lib/{esm/content-fields → content-fields}/flow-channel-conditional.js +26 -22
- package/lib/content-fields/flow-channel-conditional.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/flow-country-conditional.d.ts +3 -3
- package/lib/{esm/content-fields → content-fields}/flow-country-conditional.js +26 -21
- package/lib/content-fields/flow-country-conditional.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/flow-custom-conditional.d.ts +4 -4
- package/lib/{esm/content-fields → content-fields}/flow-custom-conditional.js +31 -33
- package/lib/content-fields/flow-custom-conditional.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/flow-element.d.ts +4 -4
- package/lib/content-fields/flow-element.js +67 -0
- package/lib/content-fields/flow-element.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-go-to-flow.d.ts +3 -3
- package/lib/{esm/content-fields → content-fields}/flow-go-to-flow.js +25 -20
- package/lib/content-fields/flow-go-to-flow.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/flow-handoff.d.ts +3 -3
- package/lib/{cjs/content-fields → content-fields}/flow-handoff.js +30 -19
- package/lib/content-fields/flow-handoff.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/flow-image.d.ts +2 -2
- package/lib/content-fields/flow-image.js +42 -0
- package/lib/content-fields/flow-image.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/flow-queue-status-conditional.d.ts +3 -3
- package/lib/{cjs/content-fields → content-fields}/flow-queue-status-conditional.js +45 -40
- package/lib/content-fields/flow-queue-status-conditional.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-rating.d.ts +3 -3
- package/lib/content-fields/flow-rating.js +88 -0
- package/lib/content-fields/flow-rating.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/flow-text.d.ts +4 -4
- package/lib/content-fields/flow-text.js +82 -0
- package/lib/content-fields/flow-text.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-video.d.ts +2 -2
- package/lib/content-fields/flow-video.js +42 -0
- package/lib/content-fields/flow-video.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-webview.d.ts +2 -2
- package/lib/{cjs/content-fields → content-fields}/flow-webview.js +31 -28
- package/lib/content-fields/flow-webview.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-whatsapp-cta-url-button.d.ts +3 -3
- package/lib/content-fields/flow-whatsapp-cta-url-button.js +131 -0
- package/lib/content-fields/flow-whatsapp-cta-url-button.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/flow-whatsapp-request-contact-info.d.ts +3 -4
- package/lib/content-fields/flow-whatsapp-request-contact-info.js +51 -0
- package/lib/content-fields/flow-whatsapp-request-contact-info.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/flow-whatsapp-template.d.ts +2 -2
- package/lib/{esm/content-fields → content-fields}/flow-whatsapp-template.js +119 -102
- package/lib/content-fields/flow-whatsapp-template.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/ai-agent-router.d.ts +3 -3
- package/lib/content-fields/hubtype-fields/ai-agent-router.js +4 -0
- package/lib/content-fields/hubtype-fields/ai-agent-router.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/ai-agent.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/ai-agent.js +4 -0
- package/lib/content-fields/hubtype-fields/ai-agent.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/bot-action.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/bot-action.js +4 -0
- package/lib/content-fields/hubtype-fields/bot-action.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/button.d.ts +1 -1
- package/lib/content-fields/hubtype-fields/button.js +4 -0
- package/lib/content-fields/hubtype-fields/button.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/capture-user-input.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/capture-user-input.js +12 -0
- package/lib/content-fields/hubtype-fields/capture-user-input.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/carousel.d.ts +3 -3
- package/lib/content-fields/hubtype-fields/carousel.js +4 -0
- package/lib/content-fields/hubtype-fields/carousel.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/channel-conditional.d.ts +3 -3
- package/lib/content-fields/hubtype-fields/channel-conditional.js +4 -0
- package/lib/content-fields/hubtype-fields/channel-conditional.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/common.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/common.js +4 -0
- package/lib/content-fields/hubtype-fields/common.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/country-conditional.d.ts +3 -3
- package/lib/content-fields/hubtype-fields/country-conditional.js +4 -0
- package/lib/content-fields/hubtype-fields/country-conditional.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/custom-conditional-v2.d.ts +2 -2
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/custom-conditional-v2.js +15 -15
- package/lib/content-fields/hubtype-fields/custom-conditional-v2.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/custom-conditional.d.ts +3 -3
- package/lib/content-fields/hubtype-fields/custom-conditional.js +4 -0
- package/lib/content-fields/hubtype-fields/custom-conditional.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/fallback.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/fallback.js +4 -0
- package/lib/content-fields/hubtype-fields/fallback.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/function.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/function.js +11 -0
- package/lib/content-fields/hubtype-fields/function.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/go-to-flow.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/go-to-flow.js +4 -0
- package/lib/content-fields/hubtype-fields/go-to-flow.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/handoff.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/handoff.js +4 -0
- package/lib/content-fields/hubtype-fields/handoff.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/image.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/image.js +4 -0
- package/lib/content-fields/hubtype-fields/image.js.map +1 -0
- package/lib/content-fields/hubtype-fields/index.d.ts +27 -0
- package/lib/content-fields/hubtype-fields/index.js +57 -0
- package/lib/content-fields/hubtype-fields/index.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/keyword.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/keyword.js +4 -0
- package/lib/content-fields/hubtype-fields/keyword.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/node-types.js +12 -12
- package/lib/content-fields/hubtype-fields/node-types.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/nodes.d.ts +23 -23
- package/lib/content-fields/hubtype-fields/nodes.js +4 -0
- package/lib/content-fields/hubtype-fields/nodes.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/payload.d.ts +1 -1
- package/lib/content-fields/hubtype-fields/payload.js +4 -0
- package/lib/content-fields/hubtype-fields/payload.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/queue-status-conditional.d.ts +3 -3
- package/lib/content-fields/hubtype-fields/queue-status-conditional.js +4 -0
- package/lib/content-fields/hubtype-fields/queue-status-conditional.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/rating.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/rating.js +9 -0
- package/lib/content-fields/hubtype-fields/rating.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/smart-intent.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/smart-intent.js +4 -0
- package/lib/content-fields/hubtype-fields/smart-intent.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/text.d.ts +3 -3
- package/lib/content-fields/hubtype-fields/text.js +4 -0
- package/lib/content-fields/hubtype-fields/text.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/url.d.ts +1 -1
- package/lib/content-fields/hubtype-fields/url.js +4 -0
- package/lib/content-fields/hubtype-fields/url.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/video.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/video.js +4 -0
- package/lib/content-fields/hubtype-fields/video.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/webview.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/webview.js +4 -0
- package/lib/content-fields/hubtype-fields/webview.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/hubtype-fields/whatsapp-button-list.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/whatsapp-button-list.js +4 -0
- package/lib/content-fields/hubtype-fields/whatsapp-button-list.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/whatsapp-cta-url-button.d.ts +3 -3
- package/lib/content-fields/hubtype-fields/whatsapp-cta-url-button.js +4 -0
- package/lib/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/whatsapp-request-contact-info.d.ts +2 -2
- package/lib/content-fields/hubtype-fields/whatsapp-request-contact-info.js +4 -0
- package/lib/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/hubtype-fields/whatsapp-template.d.ts +3 -3
- package/lib/content-fields/hubtype-fields/whatsapp-template.js +9 -0
- package/lib/content-fields/hubtype-fields/whatsapp-template.js.map +1 -0
- package/lib/content-fields/index.d.ts +25 -0
- package/lib/content-fields/index.js +73 -0
- package/lib/content-fields/index.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +3 -3
- package/lib/{esm/content-fields → content-fields}/whatsapp-button-list/flow-whatsapp-button-list-row.js +16 -14
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +1 -0
- package/lib/{cjs/content-fields → content-fields}/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +4 -4
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +41 -0
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/whatsapp-button-list/flow-whatsapp-button-list.d.ts +4 -4
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +66 -0
- package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +1 -0
- package/lib/{esm/content-fields → content-fields}/whatsapp-button-list/index.d.ts +3 -3
- package/lib/content-fields/whatsapp-button-list/index.js +12 -0
- package/lib/content-fields/whatsapp-button-list/index.js.map +1 -0
- package/lib/{cjs/filters → filters}/index.d.ts +2 -2
- package/lib/filters/index.js +16 -0
- package/lib/filters/index.js.map +1 -0
- package/lib/{cjs/flow-factory.d.ts → flow-factory.d.ts} +3 -3
- package/lib/flow-factory.js +75 -0
- package/lib/flow-factory.js.map +1 -0
- package/lib/{esm/functions → functions}/index.d.ts +1 -1
- package/lib/{cjs/functions → functions}/index.js +25 -19
- package/lib/functions/index.js.map +1 -0
- package/lib/{cjs/index.d.ts → index.d.ts} +12 -12
- package/lib/{esm/index.js → index.js} +94 -77
- package/lib/index.js.map +1 -0
- package/lib/services/hubtype-queues-api.js +26 -0
- package/lib/services/hubtype-queues-api.js.map +1 -0
- package/lib/structured-output/flow-builder-content.js +16 -0
- package/lib/structured-output/flow-builder-content.js.map +1 -0
- package/lib/{cjs/tracking.d.ts → tracking.d.ts} +2 -2
- package/lib/{cjs/tracking.js → tracking.js} +27 -21
- package/lib/tracking.js.map +1 -0
- package/lib/{esm/types.d.ts → types.d.ts} +5 -5
- package/lib/types.js +14 -0
- package/lib/types.js.map +1 -0
- package/lib/{esm/user-input → user-input}/capture-user-input-api.d.ts +2 -2
- package/lib/{cjs/user-input → user-input}/capture-user-input-api.js +44 -33
- package/lib/user-input/capture-user-input-api.js.map +1 -0
- package/lib/{esm/user-input → user-input}/index.d.ts +2 -2
- package/lib/user-input/index.js +46 -0
- package/lib/user-input/index.js.map +1 -0
- package/lib/{esm/user-input → user-input}/keyword.d.ts +2 -2
- package/lib/{esm/user-input → user-input}/keyword.js +31 -26
- package/lib/user-input/keyword.js.map +1 -0
- package/lib/{cjs/user-input → user-input}/smart-intent.d.ts +2 -2
- package/lib/{cjs/user-input → user-input}/smart-intent.js +36 -32
- package/lib/user-input/smart-intent.js.map +1 -0
- package/lib/{cjs/utils → utils}/ai-agent.d.ts +3 -3
- package/lib/utils/ai-agent.js +33 -0
- package/lib/utils/ai-agent.js.map +1 -0
- package/lib/{cjs/utils → utils}/authentication.js +10 -7
- package/lib/utils/authentication.js.map +1 -0
- package/lib/{cjs/utils → utils}/flow-locale.js +14 -18
- package/lib/utils/flow-locale.js.map +1 -0
- package/lib/{cjs/utils → utils}/get-flow-builder-plugin.d.ts +1 -1
- package/lib/{cjs/utils → utils}/get-flow-builder-plugin.js +4 -4
- package/lib/utils/get-flow-builder-plugin.js.map +1 -0
- package/lib/{cjs/utils → utils}/hubtype-assistant-content.d.ts +1 -2
- package/lib/{cjs/utils → utils}/hubtype-assistant-content.js +57 -54
- package/lib/utils/hubtype-assistant-content.js.map +1 -0
- package/lib/utils/input.js +37 -0
- package/lib/utils/input.js.map +1 -0
- package/lib/{cjs/webview → webview}/contents-context.d.ts +1 -1
- package/lib/webview/contents-context.js +14 -0
- package/lib/webview/contents-context.js.map +1 -0
- package/lib/webview/index.d.ts +3 -0
- package/lib/webview/index.js +11 -0
- package/lib/webview/index.js.map +1 -0
- package/lib/{esm/webview → webview}/types.d.ts +1 -1
- package/lib/webview/types.js +9 -0
- package/lib/webview/types.js.map +1 -0
- package/lib/{cjs/webview → webview}/use-webview-contents.d.ts +1 -1
- package/lib/webview/use-webview-contents.js +90 -0
- package/lib/webview/use-webview-contents.js.map +1 -0
- package/package.json +10 -8
- package/src/content-fields/flow-ai-agent-base.tsx +0 -11
- package/src/content-fields/flow-whatsapp-request-contact-info.tsx +1 -17
- package/src/content-fields/index.ts +2 -2
- package/src/index.ts +5 -5
- package/src/types.ts +6 -6
- package/src/utils/hubtype-assistant-content.ts +0 -14
- package/lib/cjs/action/ai-agent-from-user-input.js.map +0 -1
- package/lib/cjs/action/context.d.ts +0 -11
- package/lib/cjs/action/context.js +0 -17
- package/lib/cjs/action/context.js.map +0 -1
- package/lib/cjs/action/fallback.js.map +0 -1
- package/lib/cjs/action/first-interaction.d.ts +0 -3
- package/lib/cjs/action/first-interaction.js.map +0 -1
- package/lib/cjs/action/get-contents.js +0 -39
- package/lib/cjs/action/get-contents.js.map +0 -1
- package/lib/cjs/action/index.d.ts +0 -25
- package/lib/cjs/action/index.js +0 -90
- package/lib/cjs/action/index.js.map +0 -1
- package/lib/cjs/action/payload.d.ts +0 -3
- package/lib/cjs/action/payload.js.map +0 -1
- package/lib/cjs/api.js +0 -205
- package/lib/cjs/api.js.map +0 -1
- package/lib/cjs/constants.js +0 -19
- package/lib/cjs/constants.js.map +0 -1
- package/lib/cjs/content-fields/content-fields-base.d.ts +0 -20
- package/lib/cjs/content-fields/content-fields-base.js +0 -74
- package/lib/cjs/content-fields/content-fields-base.js.map +0 -1
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.d.ts +0 -15
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +0 -71
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +0 -1
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.d.ts +0 -9
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +0 -1
- package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.js +0 -79
- package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.js.map +0 -1
- package/lib/cjs/content-fields/flow-ai-agent-base.d.ts +0 -25
- package/lib/cjs/content-fields/flow-ai-agent-base.js +0 -97
- package/lib/cjs/content-fields/flow-ai-agent-base.js.map +0 -1
- package/lib/cjs/content-fields/flow-ai-agent-router.d.ts +0 -21
- package/lib/cjs/content-fields/flow-ai-agent-router.js +0 -125
- package/lib/cjs/content-fields/flow-ai-agent-router.js.map +0 -1
- package/lib/cjs/content-fields/flow-ai-agent.js.map +0 -1
- package/lib/cjs/content-fields/flow-bot-action.d.ts +0 -14
- package/lib/cjs/content-fields/flow-bot-action.js +0 -45
- package/lib/cjs/content-fields/flow-bot-action.js.map +0 -1
- package/lib/cjs/content-fields/flow-button.d.ts +0 -31
- package/lib/cjs/content-fields/flow-button.js +0 -86
- package/lib/cjs/content-fields/flow-button.js.map +0 -1
- package/lib/cjs/content-fields/flow-capture-user-input.js +0 -45
- package/lib/cjs/content-fields/flow-capture-user-input.js.map +0 -1
- package/lib/cjs/content-fields/flow-carousel.d.ts +0 -22
- package/lib/cjs/content-fields/flow-carousel.js +0 -152
- package/lib/cjs/content-fields/flow-carousel.js.map +0 -1
- package/lib/cjs/content-fields/flow-channel-conditional.d.ts +0 -14
- package/lib/cjs/content-fields/flow-channel-conditional.js +0 -57
- package/lib/cjs/content-fields/flow-channel-conditional.js.map +0 -1
- package/lib/cjs/content-fields/flow-country-conditional.js +0 -59
- package/lib/cjs/content-fields/flow-country-conditional.js.map +0 -1
- package/lib/cjs/content-fields/flow-custom-conditional.js +0 -89
- package/lib/cjs/content-fields/flow-custom-conditional.js.map +0 -1
- package/lib/cjs/content-fields/flow-element.js +0 -50
- package/lib/cjs/content-fields/flow-element.js.map +0 -1
- package/lib/cjs/content-fields/flow-go-to-flow.d.ts +0 -13
- package/lib/cjs/content-fields/flow-go-to-flow.js +0 -51
- package/lib/cjs/content-fields/flow-go-to-flow.js.map +0 -1
- package/lib/cjs/content-fields/flow-handoff.js.map +0 -1
- package/lib/cjs/content-fields/flow-image.js +0 -33
- package/lib/cjs/content-fields/flow-image.js.map +0 -1
- package/lib/cjs/content-fields/flow-queue-status-conditional.js.map +0 -1
- package/lib/cjs/content-fields/flow-rating.d.ts +0 -15
- package/lib/cjs/content-fields/flow-rating.js +0 -66
- package/lib/cjs/content-fields/flow-rating.js.map +0 -1
- package/lib/cjs/content-fields/flow-text.js +0 -60
- package/lib/cjs/content-fields/flow-text.js.map +0 -1
- package/lib/cjs/content-fields/flow-video.d.ts +0 -10
- package/lib/cjs/content-fields/flow-video.js +0 -33
- package/lib/cjs/content-fields/flow-video.js.map +0 -1
- package/lib/cjs/content-fields/flow-webview.d.ts +0 -16
- package/lib/cjs/content-fields/flow-webview.js.map +0 -1
- package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.d.ts +0 -21
- package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js +0 -92
- package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js.map +0 -1
- package/lib/cjs/content-fields/flow-whatsapp-request-contact-info.d.ts +0 -11
- package/lib/cjs/content-fields/flow-whatsapp-request-contact-info.js +0 -45
- package/lib/cjs/content-fields/flow-whatsapp-request-contact-info.js.map +0 -1
- package/lib/cjs/content-fields/flow-whatsapp-template.js +0 -264
- package/lib/cjs/content-fields/flow-whatsapp-template.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/ai-agent-router.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/ai-agent-router.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/ai-agent.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/ai-agent.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/bot-action.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/bot-action.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/button.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/button.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/capture-user-input.js +0 -12
- package/lib/cjs/content-fields/hubtype-fields/capture-user-input.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/carousel.d.ts +0 -17
- package/lib/cjs/content-fields/hubtype-fields/carousel.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/carousel.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/channel-conditional.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/channel-conditional.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/common.d.ts +0 -83
- package/lib/cjs/content-fields/hubtype-fields/common.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/common.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/country-conditional.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/country-conditional.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.d.ts +0 -56
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.js +0 -36
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional.d.ts +0 -11
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/fallback.d.ts +0 -9
- package/lib/cjs/content-fields/hubtype-fields/fallback.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/fallback.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/function.d.ts +0 -30
- package/lib/cjs/content-fields/hubtype-fields/function.js +0 -11
- package/lib/cjs/content-fields/hubtype-fields/function.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/go-to-flow.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/go-to-flow.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/handoff.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/handoff.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/image.d.ts +0 -8
- package/lib/cjs/content-fields/hubtype-fields/image.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/image.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/index.d.ts +0 -27
- package/lib/cjs/content-fields/hubtype-fields/index.js +0 -31
- package/lib/cjs/content-fields/hubtype-fields/index.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/keyword.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/keyword.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/node-types.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/nodes.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/nodes.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/payload.d.ts +0 -8
- package/lib/cjs/content-fields/hubtype-fields/payload.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/payload.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.d.ts +0 -25
- package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/rating.d.ts +0 -23
- package/lib/cjs/content-fields/hubtype-fields/rating.js +0 -9
- package/lib/cjs/content-fields/hubtype-fields/rating.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/smart-intent.d.ts +0 -12
- package/lib/cjs/content-fields/hubtype-fields/smart-intent.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/smart-intent.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/text.d.ts +0 -11
- package/lib/cjs/content-fields/hubtype-fields/text.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/text.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/url.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/url.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/video.d.ts +0 -8
- package/lib/cjs/content-fields/hubtype-fields/video.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/video.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/webview.d.ts +0 -17
- package/lib/cjs/content-fields/hubtype-fields/webview.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/webview.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.d.ts +0 -21
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-request-contact-info.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.js +0 -9
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.js.map +0 -1
- package/lib/cjs/content-fields/index.d.ts +0 -25
- package/lib/cjs/content-fields/index.js +0 -52
- package/lib/cjs/content-fields/index.js.map +0 -1
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +0 -41
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +0 -1
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +0 -36
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +0 -1
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +0 -14
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +0 -46
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +0 -1
- package/lib/cjs/content-fields/whatsapp-button-list/index.d.ts +0 -3
- package/lib/cjs/content-fields/whatsapp-button-list/index.js +0 -10
- package/lib/cjs/content-fields/whatsapp-button-list/index.js.map +0 -1
- package/lib/cjs/filters/index.js +0 -17
- package/lib/cjs/filters/index.js.map +0 -1
- package/lib/cjs/flow-factory.js +0 -69
- package/lib/cjs/flow-factory.js.map +0 -1
- package/lib/cjs/functions/index.d.ts +0 -11
- package/lib/cjs/functions/index.js.map +0 -1
- package/lib/cjs/index.js +0 -178
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/services/hubtype-queues-api.js +0 -26
- package/lib/cjs/services/hubtype-queues-api.js.map +0 -1
- package/lib/cjs/structured-output/flow-builder-content.js +0 -15
- package/lib/cjs/structured-output/flow-builder-content.js.map +0 -1
- package/lib/cjs/tracking.js.map +0 -1
- package/lib/cjs/types.d.ts +0 -62
- package/lib/cjs/types.js +0 -14
- package/lib/cjs/types.js.map +0 -1
- package/lib/cjs/user-input/capture-user-input-api.d.ts +0 -21
- package/lib/cjs/user-input/capture-user-input-api.js.map +0 -1
- package/lib/cjs/user-input/index.d.ts +0 -4
- package/lib/cjs/user-input/index.js +0 -37
- package/lib/cjs/user-input/index.js.map +0 -1
- package/lib/cjs/user-input/keyword.d.ts +0 -27
- package/lib/cjs/user-input/keyword.js +0 -84
- package/lib/cjs/user-input/keyword.js.map +0 -1
- package/lib/cjs/user-input/smart-intent.js.map +0 -1
- package/lib/cjs/utils/ai-agent.js +0 -28
- package/lib/cjs/utils/ai-agent.js.map +0 -1
- package/lib/cjs/utils/authentication.js.map +0 -1
- package/lib/cjs/utils/flow-locale.js.map +0 -1
- package/lib/cjs/utils/get-flow-builder-plugin.js.map +0 -1
- package/lib/cjs/utils/hubtype-assistant-content.js.map +0 -1
- package/lib/cjs/utils/input.js +0 -35
- package/lib/cjs/utils/input.js.map +0 -1
- package/lib/cjs/webview/contents-context.js +0 -12
- package/lib/cjs/webview/contents-context.js.map +0 -1
- package/lib/cjs/webview/index.d.ts +0 -3
- package/lib/cjs/webview/index.js +0 -10
- package/lib/cjs/webview/index.js.map +0 -1
- package/lib/cjs/webview/types.d.ts +0 -47
- package/lib/cjs/webview/types.js +0 -9
- package/lib/cjs/webview/types.js.map +0 -1
- package/lib/cjs/webview/use-webview-contents.js +0 -83
- package/lib/cjs/webview/use-webview-contents.js.map +0 -1
- package/lib/esm/action/ai-agent-from-user-input.d.ts +0 -3
- package/lib/esm/action/ai-agent-from-user-input.js +0 -32
- package/lib/esm/action/ai-agent-from-user-input.js.map +0 -1
- package/lib/esm/action/context.js +0 -17
- package/lib/esm/action/context.js.map +0 -1
- package/lib/esm/action/fallback.d.ts +0 -3
- package/lib/esm/action/fallback.js +0 -36
- package/lib/esm/action/fallback.js.map +0 -1
- package/lib/esm/action/first-interaction.d.ts +0 -3
- package/lib/esm/action/first-interaction.js +0 -88
- package/lib/esm/action/first-interaction.js.map +0 -1
- package/lib/esm/action/get-contents.d.ts +0 -3
- package/lib/esm/action/get-contents.js +0 -39
- package/lib/esm/action/get-contents.js.map +0 -1
- package/lib/esm/action/index.js.map +0 -1
- package/lib/esm/action/payload.d.ts +0 -3
- package/lib/esm/action/payload.js +0 -74
- package/lib/esm/action/payload.js.map +0 -1
- package/lib/esm/api.d.ts +0 -40
- package/lib/esm/api.js.map +0 -1
- package/lib/esm/constants.d.ts +0 -13
- package/lib/esm/constants.js +0 -19
- package/lib/esm/constants.js.map +0 -1
- package/lib/esm/content-fields/content-fields-base.js +0 -74
- package/lib/esm/content-fields/content-fields-base.js.map +0 -1
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +0 -71
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +0 -1
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.js +0 -58
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +0 -1
- package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.d.ts +0 -17
- package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.js +0 -79
- package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.js.map +0 -1
- package/lib/esm/content-fields/flow-ai-agent-base.js +0 -97
- package/lib/esm/content-fields/flow-ai-agent-base.js.map +0 -1
- package/lib/esm/content-fields/flow-ai-agent-router.js.map +0 -1
- package/lib/esm/content-fields/flow-ai-agent.d.ts +0 -17
- package/lib/esm/content-fields/flow-ai-agent.js +0 -64
- package/lib/esm/content-fields/flow-ai-agent.js.map +0 -1
- package/lib/esm/content-fields/flow-bot-action.js.map +0 -1
- package/lib/esm/content-fields/flow-button.js.map +0 -1
- package/lib/esm/content-fields/flow-capture-user-input.d.ts +0 -14
- package/lib/esm/content-fields/flow-capture-user-input.js +0 -45
- package/lib/esm/content-fields/flow-capture-user-input.js.map +0 -1
- package/lib/esm/content-fields/flow-carousel.js +0 -152
- package/lib/esm/content-fields/flow-carousel.js.map +0 -1
- package/lib/esm/content-fields/flow-channel-conditional.js.map +0 -1
- package/lib/esm/content-fields/flow-country-conditional.d.ts +0 -13
- package/lib/esm/content-fields/flow-country-conditional.js.map +0 -1
- package/lib/esm/content-fields/flow-custom-conditional.d.ts +0 -17
- package/lib/esm/content-fields/flow-custom-conditional.js.map +0 -1
- package/lib/esm/content-fields/flow-element.d.ts +0 -22
- package/lib/esm/content-fields/flow-element.js +0 -50
- package/lib/esm/content-fields/flow-element.js.map +0 -1
- package/lib/esm/content-fields/flow-go-to-flow.js.map +0 -1
- package/lib/esm/content-fields/flow-handoff.d.ts +0 -17
- package/lib/esm/content-fields/flow-handoff.js +0 -68
- package/lib/esm/content-fields/flow-handoff.js.map +0 -1
- package/lib/esm/content-fields/flow-image.d.ts +0 -10
- package/lib/esm/content-fields/flow-image.js +0 -33
- package/lib/esm/content-fields/flow-image.js.map +0 -1
- package/lib/esm/content-fields/flow-queue-status-conditional.d.ts +0 -30
- package/lib/esm/content-fields/flow-queue-status-conditional.js +0 -95
- package/lib/esm/content-fields/flow-queue-status-conditional.js.map +0 -1
- package/lib/esm/content-fields/flow-rating.js +0 -66
- package/lib/esm/content-fields/flow-rating.js.map +0 -1
- package/lib/esm/content-fields/flow-text.d.ts +0 -15
- package/lib/esm/content-fields/flow-text.js +0 -60
- package/lib/esm/content-fields/flow-text.js.map +0 -1
- package/lib/esm/content-fields/flow-video.js +0 -33
- package/lib/esm/content-fields/flow-video.js.map +0 -1
- package/lib/esm/content-fields/flow-webview.js +0 -78
- package/lib/esm/content-fields/flow-webview.js.map +0 -1
- package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js +0 -92
- package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js.map +0 -1
- package/lib/esm/content-fields/flow-whatsapp-request-contact-info.js +0 -45
- package/lib/esm/content-fields/flow-whatsapp-request-contact-info.js.map +0 -1
- package/lib/esm/content-fields/flow-whatsapp-template.d.ts +0 -37
- package/lib/esm/content-fields/flow-whatsapp-template.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/ai-agent-router.d.ts +0 -21
- package/lib/esm/content-fields/hubtype-fields/ai-agent-router.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/ai-agent-router.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/ai-agent.d.ts +0 -25
- package/lib/esm/content-fields/hubtype-fields/ai-agent.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/ai-agent.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/bot-action.d.ts +0 -10
- package/lib/esm/content-fields/hubtype-fields/bot-action.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/bot-action.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/button.d.ts +0 -8
- package/lib/esm/content-fields/hubtype-fields/button.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/button.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/capture-user-input.d.ts +0 -19
- package/lib/esm/content-fields/hubtype-fields/capture-user-input.js +0 -12
- package/lib/esm/content-fields/hubtype-fields/capture-user-input.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/carousel.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/carousel.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/channel-conditional.d.ts +0 -10
- package/lib/esm/content-fields/hubtype-fields/channel-conditional.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/channel-conditional.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/common.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/common.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/country-conditional.d.ts +0 -10
- package/lib/esm/content-fields/hubtype-fields/country-conditional.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/country-conditional.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/custom-conditional-v2.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/custom-conditional.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/custom-conditional.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/fallback.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/fallback.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/function.js +0 -11
- package/lib/esm/content-fields/hubtype-fields/function.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/go-to-flow.d.ts +0 -9
- package/lib/esm/content-fields/hubtype-fields/go-to-flow.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/go-to-flow.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/handoff.d.ts +0 -11
- package/lib/esm/content-fields/hubtype-fields/handoff.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/handoff.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/image.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/image.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/index.d.ts +0 -27
- package/lib/esm/content-fields/hubtype-fields/index.js +0 -31
- package/lib/esm/content-fields/hubtype-fields/index.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/keyword.d.ts +0 -9
- package/lib/esm/content-fields/hubtype-fields/keyword.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/keyword.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/node-types.d.ts +0 -31
- package/lib/esm/content-fields/hubtype-fields/node-types.js +0 -38
- package/lib/esm/content-fields/hubtype-fields/node-types.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/nodes.d.ts +0 -26
- package/lib/esm/content-fields/hubtype-fields/nodes.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/nodes.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/payload.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/payload.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/rating.js +0 -9
- package/lib/esm/content-fields/hubtype-fields/rating.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/smart-intent.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/smart-intent.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/text.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/text.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/url.d.ts +0 -8
- package/lib/esm/content-fields/hubtype-fields/url.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/url.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/video.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/video.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/webview.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/webview.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.d.ts +0 -17
- package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.d.ts +0 -8
- package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/whatsapp-template.d.ts +0 -96
- package/lib/esm/content-fields/hubtype-fields/whatsapp-template.js +0 -9
- package/lib/esm/content-fields/hubtype-fields/whatsapp-template.js.map +0 -1
- package/lib/esm/content-fields/index.d.ts +0 -25
- package/lib/esm/content-fields/index.js +0 -52
- package/lib/esm/content-fields/index.js.map +0 -1
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +0 -14
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +0 -1
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +0 -13
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +0 -36
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +0 -1
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +0 -46
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +0 -1
- package/lib/esm/content-fields/whatsapp-button-list/index.js +0 -10
- package/lib/esm/content-fields/whatsapp-button-list/index.js.map +0 -1
- package/lib/esm/filters/index.d.ts +0 -12
- package/lib/esm/filters/index.js +0 -17
- package/lib/esm/filters/index.js.map +0 -1
- package/lib/esm/flow-factory.d.ts +0 -12
- package/lib/esm/flow-factory.js +0 -69
- package/lib/esm/flow-factory.js.map +0 -1
- package/lib/esm/functions/index.js +0 -49
- package/lib/esm/functions/index.js.map +0 -1
- package/lib/esm/index.d.ts +0 -45
- package/lib/esm/index.js.map +0 -1
- package/lib/esm/services/hubtype-queues-api.d.ts +0 -14
- package/lib/esm/services/hubtype-queues-api.js +0 -26
- package/lib/esm/services/hubtype-queues-api.js.map +0 -1
- package/lib/esm/structured-output/flow-builder-content.d.ts +0 -13
- package/lib/esm/structured-output/flow-builder-content.js +0 -15
- package/lib/esm/structured-output/flow-builder-content.js.map +0 -1
- package/lib/esm/tracking.d.ts +0 -16
- package/lib/esm/tracking.js +0 -71
- package/lib/esm/tracking.js.map +0 -1
- package/lib/esm/types.js +0 -14
- package/lib/esm/types.js.map +0 -1
- package/lib/esm/user-input/capture-user-input-api.js +0 -88
- package/lib/esm/user-input/capture-user-input-api.js.map +0 -1
- package/lib/esm/user-input/index.js +0 -37
- package/lib/esm/user-input/index.js.map +0 -1
- package/lib/esm/user-input/keyword.js.map +0 -1
- package/lib/esm/user-input/smart-intent.d.ts +0 -24
- package/lib/esm/user-input/smart-intent.js +0 -89
- package/lib/esm/user-input/smart-intent.js.map +0 -1
- package/lib/esm/utils/ai-agent.d.ts +0 -11
- package/lib/esm/utils/ai-agent.js +0 -28
- package/lib/esm/utils/ai-agent.js.map +0 -1
- package/lib/esm/utils/authentication.d.ts +0 -2
- package/lib/esm/utils/authentication.js +0 -21
- package/lib/esm/utils/authentication.js.map +0 -1
- package/lib/esm/utils/flow-locale.d.ts +0 -22
- package/lib/esm/utils/flow-locale.js +0 -79
- package/lib/esm/utils/flow-locale.js.map +0 -1
- package/lib/esm/utils/get-flow-builder-plugin.d.ts +0 -3
- package/lib/esm/utils/get-flow-builder-plugin.js +0 -16
- package/lib/esm/utils/get-flow-builder-plugin.js.map +0 -1
- package/lib/esm/utils/hubtype-assistant-content.d.ts +0 -13
- package/lib/esm/utils/hubtype-assistant-content.js +0 -184
- package/lib/esm/utils/hubtype-assistant-content.js.map +0 -1
- package/lib/esm/utils/input.d.ts +0 -6
- package/lib/esm/utils/input.js +0 -35
- package/lib/esm/utils/input.js.map +0 -1
- package/lib/esm/webview/contents-context.d.ts +0 -2
- package/lib/esm/webview/contents-context.js +0 -12
- package/lib/esm/webview/contents-context.js.map +0 -1
- package/lib/esm/webview/index.d.ts +0 -3
- package/lib/esm/webview/index.js +0 -10
- package/lib/esm/webview/index.js.map +0 -1
- package/lib/esm/webview/types.js +0 -9
- package/lib/esm/webview/types.js.map +0 -1
- package/lib/esm/webview/use-webview-contents.d.ts +0 -2
- package/lib/esm/webview/use-webview-contents.js +0 -83
- package/lib/esm/webview/use-webview-contents.js.map +0 -1
- /package/lib/{cjs/constants.d.ts → constants.d.ts} +0 -0
- /package/lib/{cjs/content-fields → content-fields}/hubtype-fields/node-types.d.ts +0 -0
- /package/lib/{cjs/services → services}/hubtype-queues-api.d.ts +0 -0
- /package/lib/{cjs/structured-output → structured-output}/flow-builder-content.d.ts +0 -0
- /package/lib/{cjs/utils → utils}/authentication.d.ts +0 -0
- /package/lib/{cjs/utils → utils}/flow-locale.d.ts +0 -0
- /package/lib/{cjs/utils → utils}/input.d.ts +0 -0
|
@@ -1,49 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CustomFunction = exports.DEFAULT_FUNCTION_NAMES = void 0;
|
|
4
|
-
exports.getArgumentsByLocale = getArgumentsByLocale;
|
|
5
|
-
exports.DEFAULT_FUNCTION_NAMES = [
|
|
1
|
+
const DEFAULT_FUNCTION_NAMES = [
|
|
6
2
|
'check-queue-status',
|
|
7
3
|
'get-channel-type',
|
|
8
4
|
'check-country',
|
|
9
|
-
'check-bot-variable'
|
|
5
|
+
'check-bot-variable'
|
|
10
6
|
];
|
|
11
7
|
class CustomFunction {
|
|
12
|
-
constructor(functions, currentRequest, locale) {
|
|
13
|
-
this.functions = functions;
|
|
14
|
-
this.currentRequest = currentRequest;
|
|
15
|
-
this.locale = locale;
|
|
16
|
-
}
|
|
17
8
|
async call(functionNode) {
|
|
18
9
|
const functionNodeId = functionNode.id;
|
|
19
10
|
const functionArguments = getArgumentsByLocale(functionNode.content.arguments, this.locale);
|
|
20
|
-
const nameValues = functionArguments.map(arg
|
|
21
|
-
return {
|
|
11
|
+
const nameValues = functionArguments.map((arg)=>{
|
|
12
|
+
return {
|
|
13
|
+
[arg.name]: arg.value
|
|
14
|
+
};
|
|
22
15
|
});
|
|
23
16
|
const args = Object.assign({
|
|
24
17
|
request: this.currentRequest,
|
|
25
|
-
results: functionNode.content.result_mapping.map(r
|
|
18
|
+
results: functionNode.content.result_mapping.map((r)=>r.result)
|
|
26
19
|
}, ...nameValues);
|
|
27
20
|
const functionResult = await this.functions[functionNode.content.action](args);
|
|
28
21
|
// TODO define result_mapping per locale??
|
|
29
|
-
const result = functionNode.content.result_mapping.find(r
|
|
22
|
+
const result = functionNode.content.result_mapping.find((r)=>r.result === functionResult);
|
|
30
23
|
if (!result?.target) {
|
|
31
24
|
throw new Error(`No result found for result_mapping for node with id: ${functionNodeId}`);
|
|
32
25
|
}
|
|
33
26
|
return result.target.id;
|
|
34
27
|
}
|
|
28
|
+
constructor(functions, currentRequest, locale){
|
|
29
|
+
this.functions = functions;
|
|
30
|
+
this.currentRequest = currentRequest;
|
|
31
|
+
this.locale = locale;
|
|
32
|
+
}
|
|
35
33
|
}
|
|
36
|
-
exports.CustomFunction = CustomFunction;
|
|
37
34
|
function getArgumentsByLocale(args, locale) {
|
|
38
35
|
let resultArguments = [];
|
|
39
|
-
for (const arg of args)
|
|
36
|
+
for (const arg of args){
|
|
40
37
|
if ('locale' in arg && arg.locale === locale) {
|
|
41
|
-
resultArguments = [
|
|
38
|
+
resultArguments = [
|
|
39
|
+
...resultArguments,
|
|
40
|
+
...arg.values
|
|
41
|
+
];
|
|
42
42
|
}
|
|
43
43
|
if ('type' in arg) {
|
|
44
|
-
resultArguments = [
|
|
44
|
+
resultArguments = [
|
|
45
|
+
...resultArguments,
|
|
46
|
+
arg
|
|
47
|
+
];
|
|
45
48
|
}
|
|
46
49
|
}
|
|
47
50
|
return resultArguments;
|
|
48
51
|
}
|
|
52
|
+
|
|
53
|
+
export { CustomFunction, DEFAULT_FUNCTION_NAMES, getArgumentsByLocale };
|
|
54
|
+
|
|
49
55
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type Plugin, type PluginPreRequest, type ResolvedPlugins, type Session } from '@botonic/core';
|
|
2
|
-
import { FlowBuilderApi } from './api';
|
|
3
|
-
import type { FlowContent } from './content-fields';
|
|
4
|
-
import { type HtNodeWithContent } from './content-fields/hubtype-fields';
|
|
5
|
-
import { type AiAgentFunction, type BotonicPluginFlowBuilderOptions, type ContentFilter, FlowBuilderJSONVersion, type InShadowingConfig, type PayloadParamsBase, type RatingSubmittedInfo, type TrackEventFunction } from './types';
|
|
6
|
-
import type { SmartIntentsInferenceConfig } from './user-input/smart-intent';
|
|
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
7
|
export default class BotonicPluginFlowBuilder implements Plugin {
|
|
8
8
|
cmsApi: FlowBuilderApi;
|
|
9
9
|
private flow?;
|
|
@@ -36,10 +36,10 @@ export default class BotonicPluginFlowBuilder implements Plugin {
|
|
|
36
36
|
getRatingSubmittedInfo(payload: string): RatingSubmittedInfo;
|
|
37
37
|
setInShadowing(inShadowing: InShadowingConfig): void;
|
|
38
38
|
}
|
|
39
|
-
export * from './action';
|
|
40
|
-
export { AGENT_RATING_PAYLOAD, EMPTY_PAYLOAD } from './constants';
|
|
41
|
-
export * from './content-fields';
|
|
42
|
-
export { HtBotActionNode } from './content-fields/hubtype-fields';
|
|
43
|
-
export { getCommonFlowContentEventArgsForContentId, trackFlowContent, } from './tracking';
|
|
44
|
-
export { BotonicPluginFlowBuilderOptions, ContentFilter, FlowBuilderJSONVersion, PayloadParamsBase, RatingSubmittedInfo, } from './types';
|
|
45
|
-
export * from './webview';
|
|
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';
|
|
@@ -1,47 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
+
|
|
17
39
|
class BotonicPluginFlowBuilder {
|
|
18
|
-
constructor(options) {
|
|
19
|
-
this.apiUrl = options.apiUrl || constants_1.FLOW_BUILDER_API_URL_PROD;
|
|
20
|
-
this.jsonVersion = options.jsonVersion || types_1.FlowBuilderJSONVersion.LATEST;
|
|
21
|
-
this.flow = options.flow;
|
|
22
|
-
this.getAccessToken = (0, authentication_1.resolveGetAccessToken)(options.getAccessToken);
|
|
23
|
-
this.trackEvent = options.trackEvent;
|
|
24
|
-
this.getAiAgentResponse = options.getAiAgentResponse;
|
|
25
|
-
this.smartIntentsConfig = {
|
|
26
|
-
...options?.smartIntentsConfig,
|
|
27
|
-
useLatest: this.jsonVersion === types_1.FlowBuilderJSONVersion.LATEST,
|
|
28
|
-
};
|
|
29
|
-
const customFunctions = options.customFunctions || {};
|
|
30
|
-
this.functions = customFunctions;
|
|
31
|
-
this.inShadowing = {
|
|
32
|
-
allowKeywords: options.inShadowing?.allowKeywords || false,
|
|
33
|
-
allowSmartIntents: options.inShadowing?.allowSmartIntents || false,
|
|
34
|
-
allowAiAgents: options.inShadowing?.allowAiAgents || false,
|
|
35
|
-
};
|
|
36
|
-
this.contentFilters = options.contentFilters || [];
|
|
37
|
-
this.customRatingMessageEnabled =
|
|
38
|
-
options.customRatingMessageEnabled || false;
|
|
39
|
-
this.disableAIAgentInFirstInteraction =
|
|
40
|
-
options.disableAIAgentInFirstInteraction || false;
|
|
41
|
-
}
|
|
42
40
|
resolveFlowUrl(request) {
|
|
43
41
|
if (request.session.is_test_integration) {
|
|
44
|
-
return `${this.apiUrl}/v1/bot_flows/{bot_id}/versions/${
|
|
42
|
+
return `${this.apiUrl}/v1/bot_flows/{bot_id}/versions/${FlowBuilderJSONVersion.DRAFT}/`;
|
|
45
43
|
}
|
|
46
44
|
return `${this.apiUrl}/v1/bot_flows/{bot_id}/versions/${this.jsonVersion}/`;
|
|
47
45
|
}
|
|
@@ -49,27 +47,26 @@ class BotonicPluginFlowBuilder {
|
|
|
49
47
|
// When AI Agent is executed in Whatsapp, button payloads come as referral and must be converted to text being processed by the agent.
|
|
50
48
|
this.convertWhatsappAiAgentEmptyPayloads(request);
|
|
51
49
|
this.currentRequest = request;
|
|
52
|
-
this.cmsApi = await
|
|
50
|
+
this.cmsApi = await FlowBuilderApi.create({
|
|
53
51
|
flowUrl: this.resolveFlowUrl(request),
|
|
54
52
|
url: this.apiUrl,
|
|
55
53
|
flow: this.flow,
|
|
56
54
|
accessToken: this.getAccessToken(request.session),
|
|
57
|
-
request: this.currentRequest
|
|
55
|
+
request: this.currentRequest
|
|
58
56
|
});
|
|
59
|
-
const checkUserTextInput =
|
|
57
|
+
const checkUserTextInput = inputHasTextOrTranscript(request.input) && !request.input.payload;
|
|
60
58
|
if (checkUserTextInput) {
|
|
61
59
|
const resolvedLocale = this.cmsApi.getResolvedLocale();
|
|
62
|
-
const nextPayload = await
|
|
60
|
+
const nextPayload = await getNextPayloadByUserInput(this.cmsApi, resolvedLocale, request, this.smartIntentsConfig);
|
|
63
61
|
request.input.payload = nextPayload;
|
|
64
62
|
}
|
|
65
63
|
await this.updateRequestBeforeRoutes(request);
|
|
66
64
|
}
|
|
67
65
|
convertWhatsappAiAgentEmptyPayloads(request) {
|
|
68
|
-
if (request.session.user.provider ===
|
|
69
|
-
const shouldUseReferral = request.input.referral &&
|
|
70
|
-
request.input.payload?.startsWith(constants_1.EMPTY_PAYLOAD);
|
|
66
|
+
if (request.session.user.provider === PROVIDER.WHATSAPP) {
|
|
67
|
+
const shouldUseReferral = request.input.referral && request.input.payload?.startsWith(EMPTY_PAYLOAD);
|
|
71
68
|
if (shouldUseReferral) {
|
|
72
|
-
request.input.type =
|
|
69
|
+
request.input.type = INPUT.TEXT;
|
|
73
70
|
request.input.data = request.input.referral;
|
|
74
71
|
}
|
|
75
72
|
}
|
|
@@ -80,8 +77,7 @@ class BotonicPluginFlowBuilder {
|
|
|
80
77
|
request.input.payload = this.removeSourceSuffix(request.input.payload);
|
|
81
78
|
if (this.cmsApi.isBotAction(request.input.payload)) {
|
|
82
79
|
const cmsBotAction = this.cmsApi.getNodeById(request.input.payload);
|
|
83
|
-
request.input.payload =
|
|
84
|
-
this.cmsApi.createPayloadWithParams(cmsBotAction);
|
|
80
|
+
request.input.payload = this.cmsApi.createPayloadWithParams(cmsBotAction);
|
|
85
81
|
// Re-execute convertWhatsappAiAgentEmptyPayloads function to handle
|
|
86
82
|
// the case that a BotAction has a payload equals to EMPTY_PAYLOAD
|
|
87
83
|
this.convertWhatsappAiAgentEmptyPayloads(request);
|
|
@@ -89,7 +85,7 @@ class BotonicPluginFlowBuilder {
|
|
|
89
85
|
}
|
|
90
86
|
}
|
|
91
87
|
removeSourceSuffix(payload) {
|
|
92
|
-
return payload.split(
|
|
88
|
+
return payload.split(SOURCE_INFO_SEPARATOR)[0];
|
|
93
89
|
}
|
|
94
90
|
post(request) {
|
|
95
91
|
request.input.nluResolution = undefined;
|
|
@@ -109,70 +105,91 @@ class BotonicPluginFlowBuilder {
|
|
|
109
105
|
}
|
|
110
106
|
async getStartContents() {
|
|
111
107
|
const startNode = this.cmsApi.getStartNode();
|
|
112
|
-
this.currentRequest.session.flow_thread_id =
|
|
108
|
+
this.currentRequest.session.flow_thread_id = v7();
|
|
113
109
|
return await this.getContentsByNode(startNode);
|
|
114
110
|
}
|
|
115
111
|
async getContentsByNode(node, prevContents) {
|
|
116
112
|
const contents = prevContents || [];
|
|
117
113
|
const resolvedLocale = this.cmsApi.getResolvedLocale();
|
|
118
|
-
if (node.type ===
|
|
119
|
-
|
|
120
|
-
const customFunctionResolver = new functions_1.CustomFunction(this.functions, this.currentRequest, resolvedLocale);
|
|
114
|
+
if (node.type === HtNodeWithContentType.FUNCTION && !DEFAULT_FUNCTION_NAMES.includes(node.content.action)) {
|
|
115
|
+
const customFunctionResolver = new CustomFunction(this.functions, this.currentRequest, resolvedLocale);
|
|
121
116
|
const targetId = await customFunctionResolver.call(node);
|
|
122
117
|
return this.getContentsById(targetId, contents);
|
|
123
118
|
}
|
|
124
|
-
const flowFactory = new
|
|
119
|
+
const flowFactory = new FlowFactory(this.currentRequest, this.cmsApi, resolvedLocale);
|
|
125
120
|
const content = await flowFactory.getFlowContent(node);
|
|
126
121
|
if (content) {
|
|
127
122
|
contents.push(content);
|
|
128
123
|
}
|
|
129
124
|
// If node is BOT_ACTION not add more contents to render, next nodes render after execute action
|
|
130
|
-
if (node.type ===
|
|
125
|
+
if (node.type === HtNodeWithContentType.BOT_ACTION) {
|
|
131
126
|
return contents;
|
|
132
127
|
}
|
|
133
128
|
// TODO: prevent infinite recursive calls
|
|
134
129
|
if (content?.followUp) {
|
|
135
130
|
return this.getContentsById(content.followUp.id, contents);
|
|
136
|
-
}
|
|
137
|
-
else if (node.follow_up) {
|
|
131
|
+
} else if (node.follow_up) {
|
|
138
132
|
console.log('FOLLOWUP FROM NODE-------> OLD SYSTEM');
|
|
139
133
|
return this.getContentsById(node.follow_up.id, contents);
|
|
140
134
|
}
|
|
141
135
|
return contents;
|
|
142
136
|
}
|
|
143
137
|
getPayloadParams(payload) {
|
|
144
|
-
const payloadParams = JSON.parse(payload.split(
|
|
138
|
+
const payloadParams = JSON.parse(payload.split(SEPARATOR)[1] || '{}');
|
|
145
139
|
return payloadParams;
|
|
146
140
|
}
|
|
147
141
|
getFlowName(flowId) {
|
|
148
142
|
return this.cmsApi.getFlowName(flowId);
|
|
149
143
|
}
|
|
150
144
|
getRatingSubmittedInfo(payload) {
|
|
151
|
-
const buttonId = payload?.split(
|
|
145
|
+
const buttonId = payload?.split(SEPARATOR)[1];
|
|
152
146
|
const ratingNode = this.cmsApi.getRatingNodeByButtonId(buttonId);
|
|
153
147
|
const ratingButton = this.cmsApi.getRatingButtonById(ratingNode, buttonId);
|
|
154
|
-
const possibleOptions = ratingNode.content.buttons.map(button
|
|
155
|
-
const possibleValues = ratingNode.content.buttons.map(button
|
|
148
|
+
const possibleOptions = ratingNode.content.buttons.map((button)=>button.text);
|
|
149
|
+
const possibleValues = ratingNode.content.buttons.map((button)=>button.value);
|
|
156
150
|
return {
|
|
157
151
|
...ratingButton,
|
|
158
152
|
possibleOptions,
|
|
159
|
-
possibleValues
|
|
153
|
+
possibleValues
|
|
160
154
|
};
|
|
161
155
|
}
|
|
162
156
|
setInShadowing(inShadowing) {
|
|
163
157
|
this.inShadowing = inShadowing;
|
|
164
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
|
+
}
|
|
165
181
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
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
|
+
|
|
178
195
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
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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"}
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type BotContext, EventAction } from '@botonic/core';
|
|
2
2
|
import type { ActionRequest } from '@botonic/react';
|
|
3
|
-
import type { FlowBuilderApi } from './api';
|
|
4
|
-
import type { FlowContent } from './content-fields';
|
|
3
|
+
import type { FlowBuilderApi } from './api.js';
|
|
4
|
+
import type { FlowContent } from './content-fields/index.js';
|
|
5
5
|
export declare function trackEvent(request: ActionRequest, eventAction: EventAction, args?: Record<string, any>): Promise<void>;
|
|
6
6
|
export declare function trackFlowContent(request: ActionRequest, contents: FlowContent[]): Promise<void>;
|
|
7
7
|
export declare function trackOneContent(request: ActionRequest, content: FlowContent, cmsApi?: FlowBuilderApi): Promise<void>;
|
|
@@ -1,34 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { EventAction } from "@botonic/core";
|
|
2
|
+
import { v7 } from "uuid";
|
|
3
|
+
import { HtNodeWithContentType } from "./content-fields/hubtype-fields/index.js";
|
|
4
|
+
import { getFlowBuilderPlugin } from "./utils/get-flow-builder-plugin.js";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
11
14
|
async function trackEvent(request, eventAction, args) {
|
|
12
|
-
const flowBuilderPlugin =
|
|
15
|
+
const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins);
|
|
13
16
|
if (flowBuilderPlugin.trackEvent) {
|
|
14
17
|
await flowBuilderPlugin.trackEvent(request, eventAction, args);
|
|
15
18
|
}
|
|
16
19
|
return;
|
|
17
20
|
}
|
|
18
21
|
async function trackFlowContent(request, contents) {
|
|
19
|
-
const flowBuilderPlugin =
|
|
22
|
+
const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins);
|
|
20
23
|
const cmsApi = flowBuilderPlugin.cmsApi;
|
|
21
|
-
for (const content of contents)
|
|
24
|
+
for (const content of contents){
|
|
22
25
|
await trackOneContent(request, content, cmsApi);
|
|
23
26
|
}
|
|
24
27
|
}
|
|
25
28
|
async function trackOneContent(request, content, cmsApi) {
|
|
26
29
|
if (!cmsApi) {
|
|
27
|
-
const flowBuilderPlugin =
|
|
30
|
+
const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins);
|
|
28
31
|
cmsApi = flowBuilderPlugin.cmsApi;
|
|
29
32
|
}
|
|
30
33
|
const nodeContent = cmsApi.getNodeById(content.id);
|
|
31
|
-
if (nodeContent.type !==
|
|
34
|
+
if (nodeContent.type !== HtNodeWithContentType.AI_AGENT) {
|
|
32
35
|
const event = getContentEventArgs(request, nodeContent);
|
|
33
36
|
const { action, ...eventArgs } = event;
|
|
34
37
|
await trackEvent(request, action, eventArgs);
|
|
@@ -41,31 +44,34 @@ function getContentEventArgs(request, nodeContent) {
|
|
|
41
44
|
const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } = getCommonFlowContentEventArgs(request, nodeContent);
|
|
42
45
|
setSessionFlowThreadId(request, flowThreadId);
|
|
43
46
|
return {
|
|
44
|
-
action:
|
|
47
|
+
action: EventAction.FlowNode,
|
|
45
48
|
flowId,
|
|
46
49
|
flowName,
|
|
47
50
|
flowNodeId,
|
|
48
51
|
flowNodeContentId,
|
|
49
52
|
flowThreadId,
|
|
50
|
-
flowNodeIsMeaningful: nodeContent.is_meaningful ?? false
|
|
53
|
+
flowNodeIsMeaningful: nodeContent.is_meaningful ?? false
|
|
51
54
|
};
|
|
52
55
|
}
|
|
53
56
|
function getCommonFlowContentEventArgs(request, nodeContent) {
|
|
54
|
-
const flowBuilderPlugin =
|
|
57
|
+
const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins);
|
|
55
58
|
const flowName = flowBuilderPlugin.getFlowName(nodeContent.flow_id);
|
|
56
|
-
const flowThreadId = request.session.flow_thread_id ??
|
|
59
|
+
const flowThreadId = request.session.flow_thread_id ?? v7();
|
|
57
60
|
return {
|
|
58
61
|
flowThreadId,
|
|
59
62
|
flowId: nodeContent.flow_id,
|
|
60
63
|
flowName,
|
|
61
64
|
flowNodeId: nodeContent.id,
|
|
62
|
-
flowNodeContentId: nodeContent.code ?? ''
|
|
65
|
+
flowNodeContentId: nodeContent.code ?? ''
|
|
63
66
|
};
|
|
64
67
|
}
|
|
65
68
|
function getCommonFlowContentEventArgsForContentId(botContext, id) {
|
|
66
|
-
const flowBuilderPlugin =
|
|
69
|
+
const flowBuilderPlugin = getFlowBuilderPlugin(botContext.plugins);
|
|
67
70
|
const cmsApi = flowBuilderPlugin.cmsApi;
|
|
68
71
|
const nodeContent = cmsApi.getNodeById(id);
|
|
69
72
|
return getCommonFlowContentEventArgs(botContext, nodeContent);
|
|
70
73
|
}
|
|
74
|
+
|
|
75
|
+
export { getCommonFlowContentEventArgsForContentId, trackEvent, trackFlowContent, trackOneContent };
|
|
76
|
+
|
|
71
77
|
//# sourceMappingURL=tracking.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracking.js","sources":["../src/tracking.ts"],"sourcesContent":["import { type BotContext, EventAction, type EventFlow } from '@botonic/core'\nimport type { ActionRequest } from '@botonic/react'\nimport { v7 as uuidv7 } from 'uuid'\n\nimport type { FlowBuilderApi } from './api'\nimport type { FlowContent } from './content-fields'\nimport {\n type HtNodeWithContent,\n HtNodeWithContentType,\n} from './content-fields/hubtype-fields'\nimport { getFlowBuilderPlugin } from './utils/get-flow-builder-plugin'\n\nexport async function trackEvent(\n request: ActionRequest,\n eventAction: EventAction,\n args?: Record<string, any>\n): Promise<void> {\n const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins)\n if (flowBuilderPlugin.trackEvent) {\n await flowBuilderPlugin.trackEvent(request, eventAction, args)\n }\n return\n}\n\nexport async function trackFlowContent(\n request: ActionRequest,\n contents: FlowContent[]\n) {\n const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins)\n const cmsApi = flowBuilderPlugin.cmsApi\n for (const content of contents) {\n await trackOneContent(request, content, cmsApi)\n }\n}\n\nexport async function trackOneContent(\n request: ActionRequest,\n content: FlowContent,\n cmsApi?: FlowBuilderApi\n) {\n if (!cmsApi) {\n const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins)\n cmsApi = flowBuilderPlugin.cmsApi\n }\n\n const nodeContent = cmsApi.getNodeById<HtNodeWithContent>(content.id)\n if (nodeContent.type !== HtNodeWithContentType.AI_AGENT) {\n const event = getContentEventArgs(request, nodeContent)\n const { action, ...eventArgs } = event\n await trackEvent(request, action, eventArgs)\n }\n}\n\nfunction setSessionFlowThreadId(\n request: ActionRequest,\n flowThreadId: string\n): void {\n request.session.flow_thread_id = flowThreadId\n}\n\nfunction getContentEventArgs(\n request: ActionRequest,\n nodeContent: HtNodeWithContent\n): EventFlow {\n const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } =\n getCommonFlowContentEventArgs(request, nodeContent)\n\n setSessionFlowThreadId(request, flowThreadId)\n\n return {\n action: EventAction.FlowNode,\n flowId,\n flowName,\n flowNodeId,\n flowNodeContentId,\n flowThreadId,\n flowNodeIsMeaningful: nodeContent.is_meaningful ?? false,\n }\n}\n\ntype CommonFlowContentEventArgs = {\n flowThreadId: string\n flowId: string\n flowName: string\n flowNodeId: string\n flowNodeContentId: string\n}\n\nfunction getCommonFlowContentEventArgs(\n request: ActionRequest,\n nodeContent: HtNodeWithContent\n): CommonFlowContentEventArgs {\n const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins)\n const flowName = flowBuilderPlugin.getFlowName(nodeContent.flow_id)\n const flowThreadId = request.session.flow_thread_id ?? uuidv7()\n\n return {\n flowThreadId,\n flowId: nodeContent.flow_id,\n flowName,\n flowNodeId: nodeContent.id,\n flowNodeContentId: nodeContent.code ?? '',\n }\n}\n\nexport function getCommonFlowContentEventArgsForContentId(\n botContext: BotContext,\n id: string\n): CommonFlowContentEventArgs {\n const flowBuilderPlugin = getFlowBuilderPlugin(botContext.plugins)\n const cmsApi = flowBuilderPlugin.cmsApi\n const nodeContent = cmsApi.getNodeById<HtNodeWithContent>(id)\n\n return getCommonFlowContentEventArgs(botContext, nodeContent)\n}\n"],"names":["EventAction","v7","uuidv7","HtNodeWithContentType","getFlowBuilderPlugin","trackEvent","request","eventAction","args","flowBuilderPlugin","trackFlowContent","contents","cmsApi","content","trackOneContent","nodeContent","event","getContentEventArgs","action","eventArgs","setSessionFlowThreadId","flowThreadId","flowId","flowName","flowNodeId","flowNodeContentId","getCommonFlowContentEventArgs","getCommonFlowContentEventArgsForContentId","botContext","id"],"mappings":";;;;;;;;;AAA4E;AAEzC;AAOK;AAC8B;AAE/D,eAAeK,UAAUA,CAC9BC,OAAsB,EACtBC,WAAwB,EACxBC,IAA0B;IAE1B,MAAMC,oBAAoBL,oBAAoBA,CAACE,QAAQ,OAAO;IAC9D,IAAIG,kBAAkB,UAAU,EAAE;QAChC,MAAMA,kBAAkB,UAAU,CAACH,SAASC,aAAaC;IAC3D;IACA;AACF;AAEO,eAAeE,gBAAgBA,CACpCJ,OAAsB,EACtBK,QAAuB;IAEvB,MAAMF,oBAAoBL,oBAAoBA,CAACE,QAAQ,OAAO;IAC9D,MAAMM,SAASH,kBAAkB,MAAM;IACvC,KAAK,MAAMI,WAAWF,SAAU;QAC9B,MAAMG,eAAeA,CAACR,SAASO,SAASD;IAC1C;AACF;AAEO,eAAeE,eAAeA,CACnCR,OAAsB,EACtBO,OAAoB,EACpBD,MAAuB;IAEvB,IAAI,CAACA,QAAQ;QACX,MAAMH,oBAAoBL,oBAAoBA,CAACE,QAAQ,OAAO;QAC9DM,SAASH,kBAAkB,MAAM;IACnC;IAEA,MAAMM,cAAcH,OAAO,WAAW,CAAoBC,QAAQ,EAAE;IACpE,IAAIE,YAAY,IAAI,KAAKZ,8BAA8B,EAAE;QACvD,MAAMa,QAAQC,mBAAmBA,CAACX,SAASS;QAC3C,MAAM,EAAEG,MAAM,EAAE,GAAGC,WAAW,GAAGH;QACjC,MAAMX,UAAUA,CAACC,SAASY,QAAQC;IACpC;AACF;AAEA,SAASC,sBAAsBA,CAC7Bd,OAAsB,EACtBe,YAAoB;IAEpBf,QAAQ,OAAO,CAAC,cAAc,GAAGe;AACnC;AAEA,SAASJ,mBAAmBA,CAC1BX,OAAsB,EACtBS,WAA8B;IAE9B,MAAM,EAAEM,YAAY,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,iBAAiB,EAAE,GACrEC,6BAA6BA,CAACpB,SAASS;IAEzCK,sBAAsBA,CAACd,SAASe;IAEhC,OAAO;QACL,QAAQrB,oBAAoB;QAC5BsB;QACAC;QACAC;QACAC;QACAJ;QACA,sBAAsBN,YAAY,aAAa,IAAI;IACrD;AACF;AAUA,SAASW,6BAA6BA,CACpCpB,OAAsB,EACtBS,WAA8B;IAE9B,MAAMN,oBAAoBL,oBAAoBA,CAACE,QAAQ,OAAO;IAC9D,MAAMiB,WAAWd,kBAAkB,WAAW,CAACM,YAAY,OAAO;IAClE,MAAMM,eAAef,QAAQ,OAAO,CAAC,cAAc,IAAIJ,EAAMA;IAE7D,OAAO;QACLmB;QACA,QAAQN,YAAY,OAAO;QAC3BQ;QACA,YAAYR,YAAY,EAAE;QAC1B,mBAAmBA,YAAY,IAAI,IAAI;IACzC;AACF;AAEO,SAASY,yCAAyCA,CACvDC,UAAsB,EACtBC,EAAU;IAEV,MAAMpB,oBAAoBL,oBAAoBA,CAACwB,WAAW,OAAO;IACjE,MAAMhB,SAASH,kBAAkB,MAAM;IACvC,MAAMM,cAAcH,OAAO,WAAW,CAAoBiB;IAE1D,OAAOH,6BAA6BA,CAACE,YAAYb;AACnD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AiAgentArgs,
|
|
2
|
-
import type { FlowContent } from './content-fields';
|
|
3
|
-
import type { HtFlowBuilderData, HtRatingButton } from './content-fields/hubtype-fields';
|
|
4
|
-
import type { FlowBuilderContentMessage } from './structured-output/flow-builder-content';
|
|
1
|
+
import type { AiAgentArgs, BotContext, GuardrailRule, InferenceResponse, PluginPreRequest, ResolvedPlugins } from '@botonic/core';
|
|
2
|
+
import type { FlowContent } from './content-fields/index.js';
|
|
3
|
+
import type { HtFlowBuilderData, HtRatingButton } from './content-fields/hubtype-fields/index.js';
|
|
4
|
+
import type { FlowBuilderContentMessage } from './structured-output/flow-builder-content.js';
|
|
5
5
|
export interface InShadowingConfig {
|
|
6
6
|
allowKeywords: boolean;
|
|
7
7
|
allowSmartIntents: boolean;
|
|
@@ -59,4 +59,4 @@ export interface RatingSubmittedInfo extends HtRatingButton {
|
|
|
59
59
|
possibleOptions: string[];
|
|
60
60
|
possibleValues: number[];
|
|
61
61
|
}
|
|
62
|
-
export { AiAgentArgs, GuardrailRule };
|
|
62
|
+
export type { AiAgentArgs, GuardrailRule };
|
package/lib/types.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
var types_ProcessEnvNodeEnvs = /*#__PURE__*/ function(ProcessEnvNodeEnvs) {
|
|
2
|
+
ProcessEnvNodeEnvs["PRODUCTION"] = "production";
|
|
3
|
+
ProcessEnvNodeEnvs["DEVELOPMENT"] = "development";
|
|
4
|
+
return ProcessEnvNodeEnvs;
|
|
5
|
+
}({});
|
|
6
|
+
var types_FlowBuilderJSONVersion = /*#__PURE__*/ function(FlowBuilderJSONVersion) {
|
|
7
|
+
FlowBuilderJSONVersion["DRAFT"] = "draft";
|
|
8
|
+
FlowBuilderJSONVersion["LATEST"] = "latest";
|
|
9
|
+
return FlowBuilderJSONVersion;
|
|
10
|
+
}({});
|
|
11
|
+
|
|
12
|
+
export { types_FlowBuilderJSONVersion as FlowBuilderJSONVersion, types_ProcessEnvNodeEnvs as ProcessEnvNodeEnvs };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=types.js.map
|