@botonic/plugin-flow-builder 0.46.1 → 2.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +227 -0
- package/README.md +6 -274
- package/package.json +20 -44
- package/src/index.d.ts +2 -0
- package/src/index.js +3 -0
- package/src/index.js.map +1 -0
- package/src/lib/action/ai-agent.d.ts +3 -0
- package/src/lib/action/ai-agent.js +67 -0
- package/src/lib/action/ai-agent.js.map +1 -0
- package/src/lib/action/fallback.d.ts +3 -0
- package/src/lib/action/fallback.js +40 -0
- package/src/lib/action/fallback.js.map +1 -0
- package/src/lib/action/first-interaction.d.ts +3 -0
- package/src/lib/action/first-interaction.js +83 -0
- package/src/lib/action/first-interaction.js.map +1 -0
- package/src/lib/action/index.d.ts +20 -0
- package/src/lib/action/index.js +148 -0
- package/src/lib/action/index.js.map +1 -0
- package/src/lib/action/knowledge-bases.d.ts +3 -0
- package/src/lib/action/knowledge-bases.js +90 -0
- package/src/lib/action/knowledge-bases.js.map +1 -0
- package/src/lib/action/payload.d.ts +3 -0
- package/src/lib/action/payload.js +80 -0
- package/src/lib/action/payload.js.map +1 -0
- package/{lib/esm → src/lib}/api.d.ts +8 -19
- package/{lib/cjs → src/lib}/api.js +60 -101
- package/src/lib/api.js.map +1 -0
- package/{lib/cjs → src/lib}/constants.d.ts +3 -2
- package/src/lib/constants.js +19 -0
- package/src/lib/constants.js.map +1 -0
- package/{lib/esm → src/lib}/content-fields/content-fields-base.d.ts +9 -5
- package/src/lib/content-fields/content-fields-base.js +94 -0
- package/src/lib/content-fields/content-fields-base.js.map +1 -0
- package/{lib/cjs → src/lib}/content-fields/flow-ai-agent.d.ts +5 -7
- package/src/lib/content-fields/flow-ai-agent.js +50 -0
- package/src/lib/content-fields/flow-ai-agent.js.map +1 -0
- package/src/lib/content-fields/flow-bot-action.d.ts +11 -0
- package/src/lib/content-fields/flow-bot-action.js +43 -0
- package/src/lib/content-fields/flow-bot-action.js.map +1 -0
- package/{lib/esm → src/lib}/content-fields/flow-button.d.ts +13 -6
- package/src/lib/content-fields/flow-button.js +123 -0
- package/src/lib/content-fields/flow-button.js.map +1 -0
- package/{lib/esm → src/lib}/content-fields/flow-capture-user-input.d.ts +4 -4
- package/src/lib/content-fields/flow-capture-user-input.js +42 -0
- package/src/lib/content-fields/flow-capture-user-input.js.map +1 -0
- package/src/lib/content-fields/flow-carousel.d.ts +49 -0
- package/src/lib/content-fields/flow-carousel.js +181 -0
- package/src/lib/content-fields/flow-carousel.js.map +1 -0
- package/src/lib/content-fields/flow-channel-conditional.d.ts +13 -0
- package/src/lib/content-fields/flow-channel-conditional.js +53 -0
- package/src/lib/content-fields/flow-channel-conditional.js.map +1 -0
- package/src/lib/content-fields/flow-country-conditional.d.ts +12 -0
- package/src/lib/content-fields/flow-country-conditional.js +55 -0
- package/src/lib/content-fields/flow-country-conditional.js.map +1 -0
- package/src/lib/content-fields/flow-custom-conditional.d.ts +16 -0
- package/{lib/cjs → src/lib}/content-fields/flow-custom-conditional.js +36 -34
- package/src/lib/content-fields/flow-custom-conditional.js.map +1 -0
- package/{lib/cjs → src/lib}/content-fields/flow-element.d.ts +3 -10
- package/src/lib/content-fields/flow-element.js +38 -0
- package/src/lib/content-fields/flow-element.js.map +1 -0
- package/src/lib/content-fields/flow-go-to-flow.d.ts +12 -0
- package/src/lib/content-fields/flow-go-to-flow.js +46 -0
- package/src/lib/content-fields/flow-go-to-flow.js.map +1 -0
- package/{lib/cjs → src/lib}/content-fields/flow-handoff.d.ts +6 -6
- package/src/lib/content-fields/flow-handoff.js +77 -0
- package/src/lib/content-fields/flow-handoff.js.map +1 -0
- package/src/lib/content-fields/flow-image.d.ts +10 -0
- package/src/lib/content-fields/flow-image.js +28 -0
- package/src/lib/content-fields/flow-image.js.map +1 -0
- package/{lib/cjs → src/lib}/content-fields/flow-knowledge-base.d.ts +5 -4
- package/src/lib/content-fields/flow-knowledge-base.js +52 -0
- package/src/lib/content-fields/flow-knowledge-base.js.map +1 -0
- package/{lib/esm → src/lib}/content-fields/flow-queue-status-conditional.d.ts +6 -6
- package/src/lib/content-fields/flow-queue-status-conditional.js +97 -0
- package/src/lib/content-fields/flow-queue-status-conditional.js.map +1 -0
- package/{lib/esm → src/lib}/content-fields/flow-rating.d.ts +5 -4
- package/src/lib/content-fields/flow-rating.js +80 -0
- package/src/lib/content-fields/flow-rating.js.map +1 -0
- package/src/lib/content-fields/flow-text.d.ts +15 -0
- package/src/lib/content-fields/flow-text.js +76 -0
- package/src/lib/content-fields/flow-text.js.map +1 -0
- package/src/lib/content-fields/flow-video.d.ts +10 -0
- package/src/lib/content-fields/flow-video.js +28 -0
- package/src/lib/content-fields/flow-video.js.map +1 -0
- package/{lib/esm → src/lib}/content-fields/flow-webview.d.ts +3 -3
- package/src/lib/content-fields/flow-webview.js +41 -0
- package/src/lib/content-fields/flow-webview.js.map +1 -0
- package/{lib/cjs → src/lib}/content-fields/flow-whatsapp-cta-url-button.d.ts +8 -7
- package/src/lib/content-fields/flow-whatsapp-cta-url-button.js +76 -0
- package/src/lib/content-fields/flow-whatsapp-cta-url-button.js.map +1 -0
- package/{lib/esm → src/lib}/content-fields/flow-whatsapp-template.d.ts +7 -7
- package/src/lib/content-fields/flow-whatsapp-template.js +159 -0
- package/src/lib/content-fields/flow-whatsapp-template.js.map +1 -0
- package/{lib/cjs → src/lib}/content-fields/hubtype-fields/ai-agent.d.ts +2 -5
- package/src/lib/content-fields/hubtype-fields/ai-agent.js +2 -0
- package/src/lib/content-fields/hubtype-fields/ai-agent.js.map +1 -0
- package/{lib/cjs → src/lib}/content-fields/hubtype-fields/bot-action.d.ts +2 -2
- package/src/lib/content-fields/hubtype-fields/bot-action.js +2 -0
- package/src/lib/content-fields/hubtype-fields/bot-action.js.map +1 -0
- package/{lib/esm → src/lib}/content-fields/hubtype-fields/button.d.ts +1 -1
- package/src/lib/content-fields/hubtype-fields/button.js +2 -0
- package/src/lib/content-fields/hubtype-fields/button.js.map +1 -0
- package/{lib/esm → src/lib}/content-fields/hubtype-fields/capture-user-input.d.ts +2 -2
- package/src/lib/content-fields/hubtype-fields/capture-user-input.js +9 -0
- package/src/lib/content-fields/hubtype-fields/capture-user-input.js.map +1 -0
- package/{lib/esm → src/lib}/content-fields/hubtype-fields/carousel.d.ts +3 -3
- package/src/lib/content-fields/hubtype-fields/carousel.js +2 -0
- package/src/lib/content-fields/hubtype-fields/carousel.js.map +1 -0
- package/{lib/esm → src/lib}/content-fields/hubtype-fields/channel-conditional.d.ts +3 -3
- package/src/lib/content-fields/hubtype-fields/channel-conditional.js +2 -0
- package/src/lib/content-fields/hubtype-fields/channel-conditional.js.map +1 -0
- package/{lib/cjs → src/lib}/content-fields/hubtype-fields/common.d.ts +2 -2
- package/src/lib/content-fields/hubtype-fields/common.js +2 -0
- package/src/lib/content-fields/hubtype-fields/common.js.map +1 -0
- package/{lib/cjs → src/lib}/content-fields/hubtype-fields/country-conditional.d.ts +3 -3
- package/src/lib/content-fields/hubtype-fields/country-conditional.js +2 -0
- package/src/lib/content-fields/hubtype-fields/country-conditional.js.map +1 -0
- package/{lib/esm → src/lib}/content-fields/hubtype-fields/custom-conditional.d.ts +3 -3
- package/src/lib/content-fields/hubtype-fields/custom-conditional.js +2 -0
- package/src/lib/content-fields/hubtype-fields/custom-conditional.js.map +1 -0
- package/{lib/esm → src/lib}/content-fields/hubtype-fields/fallback.d.ts +2 -2
- package/src/lib/content-fields/hubtype-fields/fallback.js +2 -0
- package/src/lib/content-fields/hubtype-fields/fallback.js.map +1 -0
- package/{lib/cjs → src/lib}/content-fields/hubtype-fields/function.d.ts +3 -3
- package/src/lib/content-fields/hubtype-fields/function.js +8 -0
- package/src/lib/content-fields/hubtype-fields/function.js.map +1 -0
- package/{lib/cjs → src/lib}/content-fields/hubtype-fields/go-to-flow.d.ts +2 -2
- package/src/lib/content-fields/hubtype-fields/go-to-flow.js +2 -0
- package/src/lib/content-fields/hubtype-fields/go-to-flow.js.map +1 -0
- package/{lib/cjs → src/lib}/content-fields/hubtype-fields/handoff.d.ts +2 -2
- package/src/lib/content-fields/hubtype-fields/handoff.js +2 -0
- package/src/lib/content-fields/hubtype-fields/handoff.js.map +1 -0
- package/{lib/cjs → src/lib}/content-fields/hubtype-fields/image.d.ts +2 -2
- package/src/lib/content-fields/hubtype-fields/image.js +2 -0
- package/src/lib/content-fields/hubtype-fields/image.js.map +1 -0
- package/{lib/esm → src/lib}/content-fields/hubtype-fields/index.d.ts +1 -0
- package/{lib/cjs/content-fields/hubtype-fields/index.d.ts → src/lib/content-fields/hubtype-fields/index.js} +2 -0
- package/src/lib/content-fields/hubtype-fields/index.js.map +1 -0
- package/{lib/esm → src/lib}/content-fields/hubtype-fields/keyword.d.ts +2 -2
- package/src/lib/content-fields/hubtype-fields/keyword.js +2 -0
- package/src/lib/content-fields/hubtype-fields/keyword.js.map +1 -0
- package/{lib/cjs → src/lib}/content-fields/hubtype-fields/knowledge-base.d.ts +2 -2
- package/src/lib/content-fields/hubtype-fields/knowledge-base.js +2 -0
- package/src/lib/content-fields/hubtype-fields/knowledge-base.js.map +1 -0
- package/{lib/cjs → src/lib}/content-fields/hubtype-fields/node-types.d.ts +4 -4
- package/{lib/esm → src/lib}/content-fields/hubtype-fields/node-types.js +10 -13
- package/src/lib/content-fields/hubtype-fields/node-types.js.map +1 -0
- package/src/lib/content-fields/hubtype-fields/nodes.d.ts +24 -0
- package/src/lib/content-fields/hubtype-fields/nodes.js +2 -0
- package/src/lib/content-fields/hubtype-fields/nodes.js.map +1 -0
- package/{lib/esm → src/lib}/content-fields/hubtype-fields/payload.d.ts +1 -1
- package/src/lib/content-fields/hubtype-fields/payload.js +2 -0
- package/src/lib/content-fields/hubtype-fields/payload.js.map +1 -0
- package/{lib/esm → src/lib}/content-fields/hubtype-fields/queue-status-conditional.d.ts +3 -3
- package/src/lib/content-fields/hubtype-fields/queue-status-conditional.js +2 -0
- package/src/lib/content-fields/hubtype-fields/queue-status-conditional.js.map +1 -0
- package/{lib/cjs → src/lib}/content-fields/hubtype-fields/rating.d.ts +2 -2
- package/src/lib/content-fields/hubtype-fields/rating.js +6 -0
- package/src/lib/content-fields/hubtype-fields/rating.js.map +1 -0
- package/{lib/esm → src/lib}/content-fields/hubtype-fields/smart-intent.d.ts +2 -2
- package/src/lib/content-fields/hubtype-fields/smart-intent.js +2 -0
- package/src/lib/content-fields/hubtype-fields/smart-intent.js.map +1 -0
- package/{lib/esm → src/lib}/content-fields/hubtype-fields/text.d.ts +3 -3
- package/src/lib/content-fields/hubtype-fields/text.js +2 -0
- package/src/lib/content-fields/hubtype-fields/text.js.map +1 -0
- package/{lib/esm → src/lib}/content-fields/hubtype-fields/url.d.ts +1 -1
- package/src/lib/content-fields/hubtype-fields/url.js +2 -0
- package/src/lib/content-fields/hubtype-fields/url.js.map +1 -0
- package/{lib/cjs → src/lib}/content-fields/hubtype-fields/video.d.ts +2 -2
- package/src/lib/content-fields/hubtype-fields/video.js +2 -0
- package/src/lib/content-fields/hubtype-fields/video.js.map +1 -0
- package/{lib/cjs → src/lib}/content-fields/hubtype-fields/webview.d.ts +2 -2
- package/src/lib/content-fields/hubtype-fields/webview.js +2 -0
- package/src/lib/content-fields/hubtype-fields/webview.js.map +1 -0
- package/{lib/cjs → src/lib}/content-fields/hubtype-fields/whatsapp-button-list.d.ts +2 -2
- package/src/lib/content-fields/hubtype-fields/whatsapp-button-list.js +2 -0
- package/src/lib/content-fields/hubtype-fields/whatsapp-button-list.js.map +1 -0
- package/{lib/esm → src/lib}/content-fields/hubtype-fields/whatsapp-cta-url-button.d.ts +5 -5
- package/src/lib/content-fields/hubtype-fields/whatsapp-cta-url-button.js +2 -0
- package/src/lib/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +1 -0
- package/src/lib/content-fields/hubtype-fields/whatsapp-template.d.ts +72 -0
- package/src/lib/content-fields/hubtype-fields/whatsapp-template.js +2 -0
- package/src/lib/content-fields/hubtype-fields/whatsapp-template.js.map +1 -0
- package/{lib/cjs → src/lib}/content-fields/index.d.ts +1 -5
- package/{lib/esm/content-fields/index.d.ts → src/lib/content-fields/index.js} +3 -7
- package/src/lib/content-fields/index.js.map +1 -0
- package/src/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +14 -0
- package/src/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +38 -0
- package/src/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +1 -0
- package/{lib/cjs → src/lib}/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +6 -5
- package/src/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +33 -0
- package/src/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +1 -0
- package/{lib/cjs → src/lib}/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +5 -5
- package/src/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +48 -0
- package/src/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +1 -0
- package/src/lib/filters/index.d.ts +12 -0
- package/src/lib/filters/index.js +16 -0
- package/src/lib/filters/index.js.map +1 -0
- package/{lib/cjs → src/lib}/flow-factory.d.ts +3 -3
- package/src/lib/flow-factory.js +65 -0
- package/src/lib/flow-factory.js.map +1 -0
- package/{lib/esm → src/lib}/functions/index.d.ts +4 -4
- package/src/lib/functions/index.js +47 -0
- package/src/lib/functions/index.js.map +1 -0
- package/src/lib/helpers.d.ts +3 -0
- package/{lib/esm → src/lib}/helpers.js +1 -4
- package/src/lib/helpers.js.map +1 -0
- package/src/lib/index.d.ts +39 -0
- package/src/lib/index.js +158 -0
- package/src/lib/index.js.map +1 -0
- package/src/lib/services/capture-user-input-client.d.ts +16 -0
- package/src/lib/services/capture-user-input-client.js +38 -0
- package/src/lib/services/capture-user-input-client.js.map +1 -0
- package/src/lib/services/flow-client.d.ts +9 -0
- package/src/lib/services/flow-client.js +33 -0
- package/src/lib/services/flow-client.js.map +1 -0
- package/{lib/esm/services/hubtype-queues-api.d.ts → src/lib/services/hubtype-queues-client.d.ts} +1 -1
- package/src/lib/services/hubtype-queues-client.js +28 -0
- package/src/lib/services/hubtype-queues-client.js.map +1 -0
- package/src/lib/services/smart-intent-client.d.ts +7 -0
- package/src/lib/services/smart-intent-client.js +22 -0
- package/src/lib/services/smart-intent-client.js.map +1 -0
- package/src/lib/tests/helpers/flows/basic.d.ts +2 -0
- package/src/lib/tests/helpers/flows/basic.js +2437 -0
- package/src/lib/tests/helpers/flows/basic.js.map +1 -0
- package/src/lib/tests/helpers/flows/capture-user-input.d.ts +2 -0
- package/src/lib/tests/helpers/flows/capture-user-input.js +354 -0
- package/src/lib/tests/helpers/flows/capture-user-input.js.map +1 -0
- package/src/lib/tests/helpers/flows/whatsapp-template.d.ts +2 -0
- package/src/lib/tests/helpers/flows/whatsapp-template.js +513 -0
- package/src/lib/tests/helpers/flows/whatsapp-template.js.map +1 -0
- package/src/lib/tests/helpers/utils.d.ts +32 -0
- package/src/lib/tests/helpers/utils.js +71 -0
- package/src/lib/tests/helpers/utils.js.map +1 -0
- package/src/lib/tests/mocks/ai-agent-response.d.ts +3 -0
- package/src/lib/tests/mocks/ai-agent-response.js +18 -0
- package/src/lib/tests/mocks/ai-agent-response.js.map +1 -0
- package/src/lib/tests/mocks/capture-user-input-client.d.ts +1 -0
- package/src/lib/tests/mocks/capture-user-input-client.js +12 -0
- package/src/lib/tests/mocks/capture-user-input-client.js.map +1 -0
- package/src/lib/tests/mocks/hubtype-queue-client.d.ts +3 -0
- package/src/lib/tests/mocks/hubtype-queue-client.js +22 -0
- package/src/lib/tests/mocks/hubtype-queue-client.js.map +1 -0
- package/src/lib/tests/mocks/index.d.ts +1 -0
- package/src/lib/tests/mocks/index.js +2 -0
- package/src/lib/tests/mocks/index.js.map +1 -0
- package/src/lib/tests/mocks/smart-intent-client.d.ts +3 -0
- package/src/lib/tests/mocks/smart-intent-client.js +31 -0
- package/src/lib/tests/mocks/smart-intent-client.js.map +1 -0
- package/src/lib/tracking.d.ts +15 -0
- package/src/lib/tracking.js +85 -0
- package/src/lib/tracking.js.map +1 -0
- package/src/lib/types.d.ts +69 -0
- package/src/lib/types.js +11 -0
- package/src/lib/types.js.map +1 -0
- package/src/lib/user-input/capture-user-input.d.ts +10 -0
- package/src/lib/user-input/capture-user-input.js +62 -0
- package/src/lib/user-input/capture-user-input.js.map +1 -0
- package/src/lib/user-input/index.d.ts +4 -0
- package/src/lib/user-input/index.js +38 -0
- package/src/lib/user-input/index.js.map +1 -0
- package/{lib/cjs → src/lib}/user-input/keyword.d.ts +7 -9
- package/src/lib/user-input/keyword.js +86 -0
- package/src/lib/user-input/keyword.js.map +1 -0
- package/{lib/cjs → src/lib}/user-input/smart-intent.d.ts +6 -7
- package/src/lib/user-input/smart-intent.js +69 -0
- package/src/lib/user-input/smart-intent.js.map +1 -0
- package/src/lib/utils.d.ts +4 -0
- package/src/lib/utils.js +16 -0
- package/src/lib/utils.js.map +1 -0
- package/lib/cjs/action/ai-agent.d.ts +0 -3
- package/lib/cjs/action/ai-agent.js +0 -67
- package/lib/cjs/action/ai-agent.js.map +0 -1
- package/lib/cjs/action/fallback.d.ts +0 -3
- package/lib/cjs/action/fallback.js +0 -36
- 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 +0 -91
- package/lib/cjs/action/first-interaction.js.map +0 -1
- package/lib/cjs/action/index.d.ts +0 -28
- package/lib/cjs/action/index.js +0 -127
- package/lib/cjs/action/index.js.map +0 -1
- package/lib/cjs/action/knowledge-bases.d.ts +0 -3
- package/lib/cjs/action/knowledge-bases.js +0 -85
- package/lib/cjs/action/knowledge-bases.js.map +0 -1
- package/lib/cjs/action/payload.d.ts +0 -3
- package/lib/cjs/action/payload.js +0 -74
- package/lib/cjs/action/payload.js.map +0 -1
- package/lib/cjs/api.d.ts +0 -50
- package/lib/cjs/api.js.map +0 -1
- package/lib/cjs/constants.js +0 -20
- package/lib/cjs/constants.js.map +0 -1
- package/lib/cjs/content-fields/content-fields-base.d.ts +0 -17
- package/lib/cjs/content-fields/content-fields-base.js +0 -66
- package/lib/cjs/content-fields/content-fields-base.js.map +0 -1
- package/lib/cjs/content-fields/flow-ai-agent.js +0 -53
- package/lib/cjs/content-fields/flow-ai-agent.js.map +0 -1
- package/lib/cjs/content-fields/flow-bot-action.d.ts +0 -12
- package/lib/cjs/content-fields/flow-bot-action.js +0 -39
- package/lib/cjs/content-fields/flow-bot-action.js.map +0 -1
- package/lib/cjs/content-fields/flow-button.d.ts +0 -30
- package/lib/cjs/content-fields/flow-button.js +0 -103
- package/lib/cjs/content-fields/flow-button.js.map +0 -1
- package/lib/cjs/content-fields/flow-capture-user-input.d.ts +0 -13
- package/lib/cjs/content-fields/flow-capture-user-input.js +0 -43
- package/lib/cjs/content-fields/flow-capture-user-input.js.map +0 -1
- package/lib/cjs/content-fields/flow-carousel.d.ts +0 -21
- package/lib/cjs/content-fields/flow-carousel.js +0 -147
- package/lib/cjs/content-fields/flow-carousel.js.map +0 -1
- package/lib/cjs/content-fields/flow-channel-conditional.d.ts +0 -13
- package/lib/cjs/content-fields/flow-channel-conditional.js +0 -53
- package/lib/cjs/content-fields/flow-channel-conditional.js.map +0 -1
- package/lib/cjs/content-fields/flow-country-conditional.d.ts +0 -12
- package/lib/cjs/content-fields/flow-country-conditional.js +0 -54
- package/lib/cjs/content-fields/flow-country-conditional.js.map +0 -1
- package/lib/cjs/content-fields/flow-custom-conditional.d.ts +0 -16
- package/lib/cjs/content-fields/flow-custom-conditional.js.map +0 -1
- package/lib/cjs/content-fields/flow-element.js +0 -46
- 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 -58
- package/lib/cjs/content-fields/flow-go-to-flow.js.map +0 -1
- package/lib/cjs/content-fields/flow-handoff.js +0 -63
- package/lib/cjs/content-fields/flow-handoff.js.map +0 -1
- package/lib/cjs/content-fields/flow-image.d.ts +0 -9
- package/lib/cjs/content-fields/flow-image.js +0 -28
- package/lib/cjs/content-fields/flow-image.js.map +0 -1
- package/lib/cjs/content-fields/flow-knowledge-base.js +0 -39
- package/lib/cjs/content-fields/flow-knowledge-base.js.map +0 -1
- package/lib/cjs/content-fields/flow-queue-status-conditional.d.ts +0 -29
- package/lib/cjs/content-fields/flow-queue-status-conditional.js +0 -90
- package/lib/cjs/content-fields/flow-queue-status-conditional.js.map +0 -1
- package/lib/cjs/content-fields/flow-rating.d.ts +0 -14
- package/lib/cjs/content-fields/flow-rating.js +0 -61
- package/lib/cjs/content-fields/flow-rating.js.map +0 -1
- package/lib/cjs/content-fields/flow-text.d.ts +0 -15
- package/lib/cjs/content-fields/flow-text.js +0 -54
- package/lib/cjs/content-fields/flow-text.js.map +0 -1
- package/lib/cjs/content-fields/flow-video.d.ts +0 -9
- package/lib/cjs/content-fields/flow-video.js +0 -28
- package/lib/cjs/content-fields/flow-video.js.map +0 -1
- package/lib/cjs/content-fields/flow-webview.d.ts +0 -11
- package/lib/cjs/content-fields/flow-webview.js +0 -42
- package/lib/cjs/content-fields/flow-webview.js.map +0 -1
- package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js +0 -87
- package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js.map +0 -1
- package/lib/cjs/content-fields/flow-whatsapp-template.d.ts +0 -29
- package/lib/cjs/content-fields/flow-whatsapp-template.js +0 -183
- package/lib/cjs/content-fields/flow-whatsapp-template.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.d.ts +0 -8
- 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.d.ts +0 -19
- 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.d.ts +0 -10
- 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.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.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 -11
- 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.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.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/image.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/index.js +0 -28
- package/lib/cjs/content-fields/hubtype-fields/index.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/keyword.d.ts +0 -9
- 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/knowledge-base.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/knowledge-base.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/node-types.js +0 -36
- package/lib/cjs/content-fields/hubtype-fields/node-types.js.map +0 -1
- package/lib/cjs/content-fields/hubtype-fields/nodes.d.ts +0 -24
- 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.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 -11
- 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.d.ts +0 -8
- 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.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/video.js.map +0 -1
- 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.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.d.ts +0 -17
- 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-template.d.ts +0 -72
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.js +0 -3
- package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.js.map +0 -1
- package/lib/cjs/content-fields/index.js +0 -47
- package/lib/cjs/content-fields/index.js.map +0 -1
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +0 -13
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +0 -39
- 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 -34
- 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.js +0 -41
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +0 -1
- package/lib/cjs/filters/index.d.ts +0 -12
- package/lib/cjs/filters/index.js +0 -17
- package/lib/cjs/filters/index.js.map +0 -1
- package/lib/cjs/flow-factory.js +0 -65
- package/lib/cjs/flow-factory.js.map +0 -1
- package/lib/cjs/functions/index.d.ts +0 -11
- package/lib/cjs/functions/index.js +0 -49
- package/lib/cjs/functions/index.js.map +0 -1
- package/lib/cjs/helpers.d.ts +0 -3
- package/lib/cjs/helpers.js +0 -16
- package/lib/cjs/helpers.js.map +0 -1
- package/lib/cjs/index.d.ts +0 -46
- package/lib/cjs/index.js +0 -182
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/services/hubtype-queues-api.d.ts +0 -14
- package/lib/cjs/services/hubtype-queues-api.js +0 -26
- package/lib/cjs/services/hubtype-queues-api.js.map +0 -1
- package/lib/cjs/tracking.d.ts +0 -16
- package/lib/cjs/tracking.js +0 -72
- package/lib/cjs/tracking.js.map +0 -1
- package/lib/cjs/types.d.ts +0 -63
- 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 +0 -88
- 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.js +0 -84
- package/lib/cjs/user-input/keyword.js.map +0 -1
- package/lib/cjs/user-input/smart-intent.js +0 -85
- package/lib/cjs/user-input/smart-intent.js.map +0 -1
- package/lib/cjs/utils.d.ts +0 -8
- package/lib/cjs/utils.js +0 -57
- package/lib/cjs/utils.js.map +0 -1
- package/lib/cjs/webview/contents-context.d.ts +0 -2
- 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.d.ts +0 -2
- 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.d.ts +0 -3
- package/lib/esm/action/ai-agent.js +0 -67
- package/lib/esm/action/ai-agent.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 -91
- package/lib/esm/action/first-interaction.js.map +0 -1
- package/lib/esm/action/index.d.ts +0 -28
- package/lib/esm/action/index.js +0 -127
- package/lib/esm/action/index.js.map +0 -1
- package/lib/esm/action/knowledge-bases.d.ts +0 -3
- package/lib/esm/action/knowledge-bases.js +0 -85
- package/lib/esm/action/knowledge-bases.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.js +0 -254
- package/lib/esm/api.js.map +0 -1
- package/lib/esm/constants.d.ts +0 -14
- package/lib/esm/constants.js +0 -20
- package/lib/esm/constants.js.map +0 -1
- package/lib/esm/content-fields/content-fields-base.js +0 -66
- package/lib/esm/content-fields/content-fields-base.js.map +0 -1
- package/lib/esm/content-fields/flow-ai-agent.d.ts +0 -22
- package/lib/esm/content-fields/flow-ai-agent.js +0 -53
- package/lib/esm/content-fields/flow-ai-agent.js.map +0 -1
- package/lib/esm/content-fields/flow-bot-action.d.ts +0 -12
- package/lib/esm/content-fields/flow-bot-action.js +0 -39
- package/lib/esm/content-fields/flow-bot-action.js.map +0 -1
- package/lib/esm/content-fields/flow-button.js +0 -103
- package/lib/esm/content-fields/flow-button.js.map +0 -1
- package/lib/esm/content-fields/flow-capture-user-input.js +0 -43
- package/lib/esm/content-fields/flow-capture-user-input.js.map +0 -1
- package/lib/esm/content-fields/flow-carousel.d.ts +0 -21
- package/lib/esm/content-fields/flow-carousel.js +0 -147
- package/lib/esm/content-fields/flow-carousel.js.map +0 -1
- package/lib/esm/content-fields/flow-channel-conditional.d.ts +0 -13
- package/lib/esm/content-fields/flow-channel-conditional.js +0 -53
- package/lib/esm/content-fields/flow-channel-conditional.js.map +0 -1
- package/lib/esm/content-fields/flow-country-conditional.d.ts +0 -12
- package/lib/esm/content-fields/flow-country-conditional.js +0 -54
- package/lib/esm/content-fields/flow-country-conditional.js.map +0 -1
- package/lib/esm/content-fields/flow-custom-conditional.d.ts +0 -16
- package/lib/esm/content-fields/flow-custom-conditional.js +0 -83
- 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 -46
- package/lib/esm/content-fields/flow-element.js.map +0 -1
- package/lib/esm/content-fields/flow-go-to-flow.d.ts +0 -13
- package/lib/esm/content-fields/flow-go-to-flow.js +0 -58
- package/lib/esm/content-fields/flow-go-to-flow.js.map +0 -1
- package/lib/esm/content-fields/flow-handoff.d.ts +0 -16
- package/lib/esm/content-fields/flow-handoff.js +0 -63
- package/lib/esm/content-fields/flow-handoff.js.map +0 -1
- package/lib/esm/content-fields/flow-image.d.ts +0 -9
- package/lib/esm/content-fields/flow-image.js +0 -28
- package/lib/esm/content-fields/flow-image.js.map +0 -1
- package/lib/esm/content-fields/flow-knowledge-base.d.ts +0 -20
- package/lib/esm/content-fields/flow-knowledge-base.js +0 -39
- package/lib/esm/content-fields/flow-knowledge-base.js.map +0 -1
- package/lib/esm/content-fields/flow-queue-status-conditional.js +0 -90
- package/lib/esm/content-fields/flow-queue-status-conditional.js.map +0 -1
- package/lib/esm/content-fields/flow-rating.js +0 -61
- 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 -54
- package/lib/esm/content-fields/flow-text.js.map +0 -1
- package/lib/esm/content-fields/flow-video.d.ts +0 -9
- package/lib/esm/content-fields/flow-video.js +0 -28
- package/lib/esm/content-fields/flow-video.js.map +0 -1
- package/lib/esm/content-fields/flow-webview.js +0 -42
- package/lib/esm/content-fields/flow-webview.js.map +0 -1
- package/lib/esm/content-fields/flow-whatsapp-cta-url-button.d.ts +0 -19
- package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js +0 -87
- package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js.map +0 -1
- package/lib/esm/content-fields/flow-whatsapp-template.js +0 -183
- package/lib/esm/content-fields/flow-whatsapp-template.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.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.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.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/channel-conditional.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/common.d.ts +0 -78
- 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.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.d.ts +0 -30
- 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.d.ts +0 -8
- 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.js +0 -28
- package/lib/esm/content-fields/hubtype-fields/index.js.map +0 -1
- 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/knowledge-base.d.ts +0 -17
- package/lib/esm/content-fields/hubtype-fields/knowledge-base.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/knowledge-base.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/node-types.d.ts +0 -29
- package/lib/esm/content-fields/hubtype-fields/node-types.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/nodes.d.ts +0 -24
- 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.d.ts +0 -23
- 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.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/url.js.map +0 -1
- package/lib/esm/content-fields/hubtype-fields/video.d.ts +0 -8
- 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.d.ts +0 -16
- 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.d.ts +0 -21
- 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.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-template.d.ts +0 -72
- package/lib/esm/content-fields/hubtype-fields/whatsapp-template.js +0 -3
- package/lib/esm/content-fields/hubtype-fields/whatsapp-template.js.map +0 -1
- package/lib/esm/content-fields/index.js +0 -47
- 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 -13
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +0 -39
- 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 -12
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +0 -34
- 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.d.ts +0 -13
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +0 -41
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.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 -65
- 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/helpers.d.ts +0 -3
- package/lib/esm/helpers.js.map +0 -1
- package/lib/esm/index.d.ts +0 -46
- package/lib/esm/index.js +0 -182
- package/lib/esm/index.js.map +0 -1
- package/lib/esm/services/hubtype-queues-api.js +0 -26
- package/lib/esm/services/hubtype-queues-api.js.map +0 -1
- package/lib/esm/tracking.d.ts +0 -16
- package/lib/esm/tracking.js +0 -72
- package/lib/esm/tracking.js.map +0 -1
- package/lib/esm/types.d.ts +0 -63
- package/lib/esm/types.js +0 -14
- package/lib/esm/types.js.map +0 -1
- package/lib/esm/user-input/capture-user-input-api.d.ts +0 -21
- 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.d.ts +0 -4
- 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.d.ts +0 -27
- package/lib/esm/user-input/keyword.js +0 -84
- package/lib/esm/user-input/keyword.js.map +0 -1
- package/lib/esm/user-input/smart-intent.d.ts +0 -23
- package/lib/esm/user-input/smart-intent.js +0 -85
- package/lib/esm/user-input/smart-intent.js.map +0 -1
- package/lib/esm/utils.d.ts +0 -8
- package/lib/esm/utils.js +0 -57
- package/lib/esm/utils.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.d.ts +0 -47
- 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/src/action/ai-agent.ts +0 -102
- package/src/action/fallback.ts +0 -55
- package/src/action/first-interaction.ts +0 -131
- package/src/action/index.tsx +0 -205
- package/src/action/knowledge-bases.ts +0 -161
- package/src/action/payload.ts +0 -104
- package/src/api.ts +0 -364
- package/src/constants.ts +0 -20
- package/src/content-fields/content-fields-base.ts +0 -100
- package/src/content-fields/flow-ai-agent.tsx +0 -67
- package/src/content-fields/flow-bot-action.tsx +0 -52
- package/src/content-fields/flow-button.tsx +0 -163
- package/src/content-fields/flow-capture-user-input.tsx +0 -45
- package/src/content-fields/flow-carousel.tsx +0 -254
- package/src/content-fields/flow-channel-conditional.tsx +0 -65
- package/src/content-fields/flow-country-conditional.tsx +0 -67
- package/src/content-fields/flow-custom-conditional.tsx +0 -117
- package/src/content-fields/flow-element.tsx +0 -79
- package/src/content-fields/flow-go-to-flow.tsx +0 -75
- package/src/content-fields/flow-handoff.tsx +0 -99
- package/src/content-fields/flow-image.tsx +0 -26
- package/src/content-fields/flow-knowledge-base.tsx +0 -51
- package/src/content-fields/flow-queue-status-conditional.tsx +0 -130
- package/src/content-fields/flow-rating.tsx +0 -99
- package/src/content-fields/flow-text.tsx +0 -81
- package/src/content-fields/flow-video.tsx +0 -26
- package/src/content-fields/flow-webview.tsx +0 -46
- package/src/content-fields/flow-whatsapp-cta-url-button.tsx +0 -209
- package/src/content-fields/flow-whatsapp-template.tsx +0 -319
- package/src/content-fields/hubtype-fields/ai-agent.ts +0 -22
- package/src/content-fields/hubtype-fields/bot-action.ts +0 -11
- package/src/content-fields/hubtype-fields/button.ts +0 -9
- package/src/content-fields/hubtype-fields/capture-user-input.ts +0 -21
- package/src/content-fields/hubtype-fields/carousel.ts +0 -19
- package/src/content-fields/hubtype-fields/channel-conditional.ts +0 -11
- package/src/content-fields/hubtype-fields/common.ts +0 -94
- package/src/content-fields/hubtype-fields/country-conditional.ts +0 -11
- package/src/content-fields/hubtype-fields/custom-conditional.ts +0 -12
- package/src/content-fields/hubtype-fields/fallback.ts +0 -12
- package/src/content-fields/hubtype-fields/function.ts +0 -36
- package/src/content-fields/hubtype-fields/go-to-flow.ts +0 -10
- package/src/content-fields/hubtype-fields/handoff.ts +0 -12
- package/src/content-fields/hubtype-fields/image.ts +0 -9
- package/src/content-fields/hubtype-fields/index.ts +0 -24
- package/src/content-fields/hubtype-fields/keyword.ts +0 -10
- package/src/content-fields/hubtype-fields/knowledge-base.ts +0 -18
- package/src/content-fields/hubtype-fields/node-types.ts +0 -31
- package/src/content-fields/hubtype-fields/nodes.ts +0 -54
- package/src/content-fields/hubtype-fields/payload.ts +0 -9
- package/src/content-fields/hubtype-fields/queue-status-conditional.ts +0 -55
- package/src/content-fields/hubtype-fields/rating.ts +0 -26
- package/src/content-fields/hubtype-fields/smart-intent.ts +0 -12
- package/src/content-fields/hubtype-fields/text.ts +0 -12
- package/src/content-fields/hubtype-fields/url.ts +0 -9
- package/src/content-fields/hubtype-fields/video.ts +0 -9
- package/src/content-fields/hubtype-fields/webview.ts +0 -18
- package/src/content-fields/hubtype-fields/whatsapp-button-list.ts +0 -25
- package/src/content-fields/hubtype-fields/whatsapp-cta-url-button.ts +0 -19
- package/src/content-fields/hubtype-fields/whatsapp-template.ts +0 -90
- package/src/content-fields/index.ts +0 -67
- package/src/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.tsx +0 -55
- package/src/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.tsx +0 -51
- package/src/content-fields/whatsapp-button-list/flow-whatsapp-button-list.tsx +0 -78
- package/src/filters/index.ts +0 -27
- package/src/flow-factory.ts +0 -134
- package/src/functions/index.ts +0 -78
- package/src/helpers.ts +0 -25
- package/src/index.ts +0 -301
- package/src/services/hubtype-queues-api.ts +0 -36
- package/src/tracking.ts +0 -118
- package/src/types.ts +0 -117
- package/src/user-input/capture-user-input-api.ts +0 -144
- package/src/user-input/index.ts +0 -61
- package/src/user-input/keyword.ts +0 -134
- package/src/user-input/smart-intent.ts +0 -119
- package/src/utils.ts +0 -66
- package/src/webview/contents-context.ts +0 -11
- package/src/webview/index.ts +0 -3
- package/src/webview/types.ts +0 -52
- package/src/webview/use-webview-contents.ts +0 -120
package/src/types.ts
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AiAgentArgs,
|
|
3
|
-
type BotContext,
|
|
4
|
-
GuardrailRule,
|
|
5
|
-
type InferenceResponse,
|
|
6
|
-
type KnowledgeBasesResponse,
|
|
7
|
-
type PluginPreRequest,
|
|
8
|
-
type ResolvedPlugins,
|
|
9
|
-
} from '@botonic/core'
|
|
10
|
-
|
|
11
|
-
import type { FlowContent } from './content-fields'
|
|
12
|
-
import type {
|
|
13
|
-
HtFlowBuilderData,
|
|
14
|
-
HtRatingButton,
|
|
15
|
-
} from './content-fields/hubtype-fields'
|
|
16
|
-
|
|
17
|
-
export interface InShadowingConfig {
|
|
18
|
-
allowKeywords: boolean
|
|
19
|
-
allowSmartIntents: boolean
|
|
20
|
-
allowKnowledgeBases: boolean
|
|
21
|
-
allowAiAgents: boolean
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface BotonicPluginFlowBuilderOptions<
|
|
25
|
-
TPlugins extends ResolvedPlugins = ResolvedPlugins,
|
|
26
|
-
TExtraData = any,
|
|
27
|
-
> {
|
|
28
|
-
apiUrl?: string
|
|
29
|
-
jsonVersion?: FlowBuilderJSONVersion
|
|
30
|
-
flow?: HtFlowBuilderData
|
|
31
|
-
customFunctions?: Record<any, any>
|
|
32
|
-
getAccessToken: () => string
|
|
33
|
-
trackEvent?: TrackEventFunction<TPlugins, TExtraData>
|
|
34
|
-
getKnowledgeBaseResponse?: KnowledgeBaseFunction<TPlugins, TExtraData>
|
|
35
|
-
getAiAgentResponse?: AiAgentFunction<TPlugins, TExtraData>
|
|
36
|
-
smartIntentsConfig?: { numSmartIntentsToUse: number }
|
|
37
|
-
inShadowing?: Partial<InShadowingConfig>
|
|
38
|
-
contentFilters?: ContentFilter<TPlugins, TExtraData>[]
|
|
39
|
-
customRatingMessageEnabled?: boolean
|
|
40
|
-
disableAIAgentInFirstInteraction?: boolean
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export type TrackEventFunction<
|
|
44
|
-
TPlugins extends ResolvedPlugins = ResolvedPlugins,
|
|
45
|
-
TExtraData = any,
|
|
46
|
-
> = (
|
|
47
|
-
request: BotContext<TPlugins, TExtraData>,
|
|
48
|
-
eventAction: string,
|
|
49
|
-
args?: Record<string, any>
|
|
50
|
-
) => Promise<void>
|
|
51
|
-
|
|
52
|
-
export type KnowledgeBaseFunction<
|
|
53
|
-
TPlugins extends ResolvedPlugins = ResolvedPlugins,
|
|
54
|
-
TExtraData = any,
|
|
55
|
-
> = (
|
|
56
|
-
request: BotContext<TPlugins, TExtraData>,
|
|
57
|
-
sources: string[],
|
|
58
|
-
instructions: string,
|
|
59
|
-
messageId: string,
|
|
60
|
-
memoryLength: number
|
|
61
|
-
) => Promise<KnowledgeBasesResponse>
|
|
62
|
-
|
|
63
|
-
export type AiAgentFunction<
|
|
64
|
-
TPlugins extends ResolvedPlugins = ResolvedPlugins,
|
|
65
|
-
TExtraData = any,
|
|
66
|
-
> = (
|
|
67
|
-
request: BotContext<TPlugins, TExtraData>,
|
|
68
|
-
aiAgentArgs: AiAgentArgs
|
|
69
|
-
) => Promise<InferenceResponse>
|
|
70
|
-
|
|
71
|
-
export type ContentFilter<
|
|
72
|
-
TPlugins extends ResolvedPlugins = ResolvedPlugins,
|
|
73
|
-
TExtraData = any,
|
|
74
|
-
> = (
|
|
75
|
-
request: BotContext<TPlugins, TExtraData>,
|
|
76
|
-
content: FlowContent
|
|
77
|
-
) => Promise<FlowContent> | FlowContent
|
|
78
|
-
|
|
79
|
-
export interface FlowBuilderApiOptions {
|
|
80
|
-
url: string
|
|
81
|
-
flowUrl: string
|
|
82
|
-
flow?: HtFlowBuilderData
|
|
83
|
-
accessToken: string
|
|
84
|
-
request: PluginPreRequest
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export enum ProcessEnvNodeEnvs {
|
|
88
|
-
PRODUCTION = 'production',
|
|
89
|
-
DEVELOPMENT = 'development',
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export enum FlowBuilderJSONVersion {
|
|
93
|
-
DRAFT = 'draft',
|
|
94
|
-
LATEST = 'latest',
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export interface SmartIntentResponse {
|
|
98
|
-
data: {
|
|
99
|
-
smart_intent_title: string
|
|
100
|
-
text: string
|
|
101
|
-
smart_intents_used: {
|
|
102
|
-
title: string
|
|
103
|
-
description: string
|
|
104
|
-
}[]
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export interface PayloadParamsBase {
|
|
109
|
-
followUpContentID?: string
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export interface RatingSubmittedInfo extends HtRatingButton {
|
|
113
|
-
possibleOptions: string[]
|
|
114
|
-
possibleValues: number[]
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export { AiAgentArgs, GuardrailRule }
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import { EventAction, type EventCaptureUserInput } from '@botonic/core'
|
|
2
|
-
import type { ActionRequest } from '@botonic/react'
|
|
3
|
-
import axios from 'axios'
|
|
4
|
-
|
|
5
|
-
import type { FlowBuilderApi } from '../api'
|
|
6
|
-
import { FlowCaptureUserInput } from '../content-fields'
|
|
7
|
-
import {
|
|
8
|
-
HtAiValidationType,
|
|
9
|
-
type HtCaptureUserInputNode,
|
|
10
|
-
} from '../content-fields/hubtype-fields'
|
|
11
|
-
import { getFlowBuilderPlugin } from '../helpers'
|
|
12
|
-
import {
|
|
13
|
-
getCommonFlowContentEventArgsForContentId,
|
|
14
|
-
trackEvent,
|
|
15
|
-
} from '../tracking'
|
|
16
|
-
import { inputHasTextOrTranscript } from '../utils'
|
|
17
|
-
|
|
18
|
-
interface AiCaptureResponseSuccess {
|
|
19
|
-
success: true
|
|
20
|
-
value: string
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
interface AiCaptureResponseFailure {
|
|
24
|
-
success: false
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
type AiCaptureResponse = AiCaptureResponseSuccess | AiCaptureResponseFailure
|
|
28
|
-
|
|
29
|
-
export class CaptureUserInputApi {
|
|
30
|
-
private cmsApi: FlowBuilderApi
|
|
31
|
-
private request: ActionRequest
|
|
32
|
-
private textOrTranscript: string
|
|
33
|
-
|
|
34
|
-
constructor(
|
|
35
|
-
cmsApi: FlowBuilderApi,
|
|
36
|
-
request: ActionRequest,
|
|
37
|
-
textOrTranscript: string
|
|
38
|
-
) {
|
|
39
|
-
this.cmsApi = cmsApi
|
|
40
|
-
this.request = request
|
|
41
|
-
this.textOrTranscript = textOrTranscript
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
async getNextNodeId(): Promise<string | undefined> {
|
|
45
|
-
if (
|
|
46
|
-
inputHasTextOrTranscript(this.request.input) &&
|
|
47
|
-
this.cmsApi.shouldCaptureUserInput()
|
|
48
|
-
) {
|
|
49
|
-
const captureUserInputNode = this.cmsApi.getCaptureUserInputNode()
|
|
50
|
-
if (!captureUserInputNode || !this.textOrTranscript) {
|
|
51
|
-
return undefined
|
|
52
|
-
}
|
|
53
|
-
const captureUserInput =
|
|
54
|
-
FlowCaptureUserInput.fromHubtypeCMS(captureUserInputNode)
|
|
55
|
-
|
|
56
|
-
if (captureUserInput.aiValidationType === HtAiValidationType.NONE) {
|
|
57
|
-
this.cmsApi.setUserExtraDataVariable(
|
|
58
|
-
captureUserInputNode.content.field_name,
|
|
59
|
-
this.textOrTranscript
|
|
60
|
-
)
|
|
61
|
-
await this.trackUserInputCapture(captureUserInputNode, true)
|
|
62
|
-
return captureUserInput.captureSuccessId
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const aiCaptureResponse =
|
|
66
|
-
await this.getAiCaptureResponse(captureUserInputNode)
|
|
67
|
-
if (!aiCaptureResponse.success) {
|
|
68
|
-
await this.trackUserInputCapture(captureUserInputNode, false)
|
|
69
|
-
return captureUserInput.captureFailId
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
this.cmsApi.setUserExtraDataVariable(
|
|
73
|
-
captureUserInputNode.content.field_name,
|
|
74
|
-
aiCaptureResponse.value
|
|
75
|
-
)
|
|
76
|
-
await this.trackUserInputCapture(captureUserInputNode, true)
|
|
77
|
-
return captureUserInput.captureSuccessId
|
|
78
|
-
}
|
|
79
|
-
return undefined
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
async getAiCaptureResponse(
|
|
83
|
-
captureUserInputNode: HtCaptureUserInputNode
|
|
84
|
-
): Promise<AiCaptureResponse> {
|
|
85
|
-
try {
|
|
86
|
-
const url = `${process.env.HUBTYPE_API_URL}/external/v1/capture_user_input/`
|
|
87
|
-
const data = {
|
|
88
|
-
field_name: captureUserInputNode.content.field_name,
|
|
89
|
-
validation_instructions:
|
|
90
|
-
captureUserInputNode.content.ai_validation_instructions,
|
|
91
|
-
user_input: this.textOrTranscript,
|
|
92
|
-
}
|
|
93
|
-
const pluginFlowBuilder = getFlowBuilderPlugin(this.request.plugins)
|
|
94
|
-
const token = pluginFlowBuilder.getAccessToken(this.request.session)
|
|
95
|
-
|
|
96
|
-
const config = {
|
|
97
|
-
headers: {
|
|
98
|
-
'Content-Type': 'application/json',
|
|
99
|
-
Authorization: `Bearer ${token}`,
|
|
100
|
-
},
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
const aiCaptureResponse = await axios.post<AiCaptureResponse>(
|
|
104
|
-
url,
|
|
105
|
-
data,
|
|
106
|
-
config
|
|
107
|
-
)
|
|
108
|
-
|
|
109
|
-
return aiCaptureResponse.data
|
|
110
|
-
} catch (error) {
|
|
111
|
-
console.warn('Error getting ai/capture_user_input', error)
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
return {
|
|
115
|
-
success: false,
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
async trackUserInputCapture(
|
|
120
|
-
captureUserInputNode: HtCaptureUserInputNode,
|
|
121
|
-
captureSuccess: boolean
|
|
122
|
-
): Promise<void> {
|
|
123
|
-
const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } =
|
|
124
|
-
getCommonFlowContentEventArgsForContentId(
|
|
125
|
-
this.request,
|
|
126
|
-
captureUserInputNode.id
|
|
127
|
-
)
|
|
128
|
-
const event: EventCaptureUserInput = {
|
|
129
|
-
action: EventAction.CaptureUserInput,
|
|
130
|
-
flowThreadId,
|
|
131
|
-
flowId,
|
|
132
|
-
flowName,
|
|
133
|
-
flowNodeId,
|
|
134
|
-
flowNodeContentId,
|
|
135
|
-
flowNodeIsMeaningful: false,
|
|
136
|
-
fieldName: captureUserInputNode.content.field_name,
|
|
137
|
-
userInput: this.request.input.data as string,
|
|
138
|
-
captureSuccess,
|
|
139
|
-
messageId: this.request.input.message_id,
|
|
140
|
-
}
|
|
141
|
-
const { action, ...eventArgs } = event
|
|
142
|
-
await trackEvent(this.request, action, eventArgs)
|
|
143
|
-
}
|
|
144
|
-
}
|
package/src/user-input/index.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import type { ActionRequest } from '@botonic/react'
|
|
2
|
-
|
|
3
|
-
import type { FlowBuilderApi } from '../api'
|
|
4
|
-
import {
|
|
5
|
-
getTextOrTranscript,
|
|
6
|
-
isKeywordsAllowed,
|
|
7
|
-
isSmartIntentsAllowed,
|
|
8
|
-
} from '../utils'
|
|
9
|
-
import { CaptureUserInputApi } from './capture-user-input-api'
|
|
10
|
-
import { KeywordMatcher } from './keyword'
|
|
11
|
-
import {
|
|
12
|
-
SmartIntentsApi,
|
|
13
|
-
type SmartIntentsInferenceConfig,
|
|
14
|
-
} from './smart-intent'
|
|
15
|
-
|
|
16
|
-
export async function getNextPayloadByUserInput(
|
|
17
|
-
cmsApi: FlowBuilderApi,
|
|
18
|
-
locale: string,
|
|
19
|
-
request: ActionRequest,
|
|
20
|
-
smartIntentsConfig: SmartIntentsInferenceConfig
|
|
21
|
-
): Promise<string | undefined> {
|
|
22
|
-
const userTextOrTranscript = getTextOrTranscript(request.input)
|
|
23
|
-
if (userTextOrTranscript) {
|
|
24
|
-
if (cmsApi.shouldCaptureUserInput()) {
|
|
25
|
-
const captureUserInputApi = new CaptureUserInputApi(
|
|
26
|
-
cmsApi,
|
|
27
|
-
request,
|
|
28
|
-
userTextOrTranscript
|
|
29
|
-
)
|
|
30
|
-
return await captureUserInputApi.getNextNodeId()
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (isKeywordsAllowed(request)) {
|
|
34
|
-
const keywordMatcher = new KeywordMatcher({
|
|
35
|
-
cmsApi,
|
|
36
|
-
locale,
|
|
37
|
-
request,
|
|
38
|
-
userTextOrTranscript,
|
|
39
|
-
})
|
|
40
|
-
const keywordNode = await keywordMatcher.getNodeByInput()
|
|
41
|
-
if (keywordNode) {
|
|
42
|
-
return cmsApi.getPayload(keywordNode.target)
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (isSmartIntentsAllowed(request)) {
|
|
47
|
-
const smartIntentsApi = new SmartIntentsApi(
|
|
48
|
-
cmsApi,
|
|
49
|
-
request,
|
|
50
|
-
smartIntentsConfig,
|
|
51
|
-
userTextOrTranscript
|
|
52
|
-
)
|
|
53
|
-
const smartIntentNode = await smartIntentsApi.getNodeByInput()
|
|
54
|
-
if (smartIntentNode) {
|
|
55
|
-
return cmsApi.getPayload(smartIntentNode.target)
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return undefined
|
|
61
|
-
}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import { EventAction, type EventKeyword, NluType } from '@botonic/core'
|
|
2
|
-
import type { ActionRequest } from '@botonic/react'
|
|
3
|
-
|
|
4
|
-
import type { FlowBuilderApi } from '../api'
|
|
5
|
-
import { REG_EXP_PATTERN } from '../constants'
|
|
6
|
-
import type {
|
|
7
|
-
HtKeywordNode,
|
|
8
|
-
HtNodeWithContent,
|
|
9
|
-
} from '../content-fields/hubtype-fields'
|
|
10
|
-
import {
|
|
11
|
-
getCommonFlowContentEventArgsForContentId,
|
|
12
|
-
trackEvent,
|
|
13
|
-
} from '../tracking'
|
|
14
|
-
|
|
15
|
-
interface KeywordProps {
|
|
16
|
-
cmsApi: FlowBuilderApi
|
|
17
|
-
locale: string
|
|
18
|
-
request: ActionRequest
|
|
19
|
-
userTextOrTranscript: string
|
|
20
|
-
}
|
|
21
|
-
export class KeywordMatcher {
|
|
22
|
-
public cmsApi: FlowBuilderApi
|
|
23
|
-
public locale: string
|
|
24
|
-
public request: ActionRequest
|
|
25
|
-
public isRegExp: boolean
|
|
26
|
-
public matchedKeyword?: string
|
|
27
|
-
public keywordNodeId?: string
|
|
28
|
-
public flowId?: string
|
|
29
|
-
public userTextOrTranscript: string
|
|
30
|
-
|
|
31
|
-
constructor({ cmsApi, locale, request, userTextOrTranscript }: KeywordProps) {
|
|
32
|
-
this.cmsApi = cmsApi
|
|
33
|
-
this.locale = locale
|
|
34
|
-
this.request = request
|
|
35
|
-
this.isRegExp = false
|
|
36
|
-
this.userTextOrTranscript = userTextOrTranscript
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
async getNodeByInput(): Promise<HtKeywordNode | undefined> {
|
|
40
|
-
const keywordNodes = this.cmsApi.getKeywordNodes()
|
|
41
|
-
const keywordNode = this.getNodeByKeyword(
|
|
42
|
-
this.userTextOrTranscript,
|
|
43
|
-
keywordNodes
|
|
44
|
-
)
|
|
45
|
-
if (!keywordNode || !this.matchedKeyword) {
|
|
46
|
-
return undefined
|
|
47
|
-
}
|
|
48
|
-
const targetPayload = this.cmsApi.getPayload(keywordNode.target)
|
|
49
|
-
|
|
50
|
-
this.request.input.nluResolution = {
|
|
51
|
-
type: NluType.Keyword,
|
|
52
|
-
matchedValue: this.matchedKeyword,
|
|
53
|
-
payload: targetPayload,
|
|
54
|
-
}
|
|
55
|
-
await this.trackKeywordEvent()
|
|
56
|
-
return keywordNode
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
private getNodeByKeyword(
|
|
60
|
-
userInput: string,
|
|
61
|
-
keywordNodes: HtKeywordNode[]
|
|
62
|
-
): HtKeywordNode | undefined {
|
|
63
|
-
const matchedKeywordNode = keywordNodes.find(node =>
|
|
64
|
-
this.matchKeywords(userInput, node)
|
|
65
|
-
)
|
|
66
|
-
|
|
67
|
-
return matchedKeywordNode?.target ? matchedKeywordNode : undefined
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
private matchKeywords(userInput: string, node: HtKeywordNode): boolean {
|
|
71
|
-
const result = node.content.keywords.find(keywords => {
|
|
72
|
-
if (keywords.locale === this.locale) {
|
|
73
|
-
this.keywordNodeId = node.id
|
|
74
|
-
this.flowId = this.cmsApi.getNodeById<HtNodeWithContent>(
|
|
75
|
-
node.id
|
|
76
|
-
).flow_id
|
|
77
|
-
return this.inputMatchesAnyKeyword(userInput, keywords.values)
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
return false
|
|
81
|
-
})
|
|
82
|
-
|
|
83
|
-
return Boolean(result)
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
private inputMatchesAnyKeyword(
|
|
87
|
-
userInput: string,
|
|
88
|
-
keywords: string[]
|
|
89
|
-
): boolean {
|
|
90
|
-
return keywords.some(keyword => {
|
|
91
|
-
const regExpMatchArray = keyword.match(REG_EXP_PATTERN)
|
|
92
|
-
|
|
93
|
-
if (regExpMatchArray) {
|
|
94
|
-
const keywordAsRegExp = this.resolveKeywordAsRegExp(regExpMatchArray)
|
|
95
|
-
const match = userInput.match(keywordAsRegExp)
|
|
96
|
-
this.isRegExp = true
|
|
97
|
-
this.matchedKeyword = match ? match[0] : undefined
|
|
98
|
-
} else {
|
|
99
|
-
this.isRegExp = false
|
|
100
|
-
this.matchedKeyword = userInput.includes(keyword) ? keyword : undefined
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
return this.matchedKeyword !== undefined
|
|
104
|
-
})
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
private resolveKeywordAsRegExp(regExpMatchArray: RegExpMatchArray): RegExp {
|
|
108
|
-
const [, pattern, flags] = regExpMatchArray
|
|
109
|
-
return new RegExp(pattern, flags)
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
private async trackKeywordEvent() {
|
|
113
|
-
const { flowId, flowName, flowNodeId, flowNodeContentId } =
|
|
114
|
-
getCommonFlowContentEventArgsForContentId(
|
|
115
|
-
this.request,
|
|
116
|
-
this.keywordNodeId as string
|
|
117
|
-
)
|
|
118
|
-
|
|
119
|
-
const event: EventKeyword = {
|
|
120
|
-
action: EventAction.Keyword,
|
|
121
|
-
flowNodeId,
|
|
122
|
-
flowId,
|
|
123
|
-
flowName,
|
|
124
|
-
flowNodeContentId,
|
|
125
|
-
flowThreadId: this.request.session.flow_thread_id as string,
|
|
126
|
-
nluKeywordName: this.matchedKeyword as string,
|
|
127
|
-
nluKeywordIsRegex: this.isRegExp,
|
|
128
|
-
nluKeywordMessageId: this.request.input.message_id,
|
|
129
|
-
userInput: this.userTextOrTranscript,
|
|
130
|
-
}
|
|
131
|
-
const { action, ...eventArgs } = event
|
|
132
|
-
await trackEvent(this.request, action, eventArgs)
|
|
133
|
-
}
|
|
134
|
-
}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { EventAction, type EventIntentSmart, NluType } from '@botonic/core'
|
|
2
|
-
import type { ActionRequest } from '@botonic/react'
|
|
3
|
-
import axios from 'axios'
|
|
4
|
-
|
|
5
|
-
import type { FlowBuilderApi } from '../api'
|
|
6
|
-
import type { HtSmartIntentNode } from '../content-fields/hubtype-fields/smart-intent'
|
|
7
|
-
import { getFlowBuilderPlugin } from '../helpers'
|
|
8
|
-
import {
|
|
9
|
-
getCommonFlowContentEventArgsForContentId,
|
|
10
|
-
trackEvent,
|
|
11
|
-
} from '../tracking'
|
|
12
|
-
import type { SmartIntentResponse } from '../types'
|
|
13
|
-
|
|
14
|
-
export interface SmartIntentsInferenceParams {
|
|
15
|
-
bot_id: string
|
|
16
|
-
text: string
|
|
17
|
-
num_smart_intents_to_use?: number
|
|
18
|
-
use_latest: boolean
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface SmartIntentsInferenceConfig {
|
|
22
|
-
useLatest: boolean
|
|
23
|
-
numSmartIntentsToUse?: number
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export class SmartIntentsApi {
|
|
27
|
-
constructor(
|
|
28
|
-
public cmsApi: FlowBuilderApi,
|
|
29
|
-
public currentRequest: ActionRequest,
|
|
30
|
-
public smartIntentsConfig: SmartIntentsInferenceConfig,
|
|
31
|
-
public userTextOrTranscript: string
|
|
32
|
-
) {}
|
|
33
|
-
|
|
34
|
-
async getNodeByInput(): Promise<HtSmartIntentNode | undefined> {
|
|
35
|
-
if (!this.userTextOrTranscript) {
|
|
36
|
-
return undefined
|
|
37
|
-
}
|
|
38
|
-
const smartIntentNodes = this.cmsApi.getSmartIntentNodes()
|
|
39
|
-
if (!smartIntentNodes.length) {
|
|
40
|
-
return undefined
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const params = {
|
|
44
|
-
bot_id: this.currentRequest.session.bot.id,
|
|
45
|
-
text: this.userTextOrTranscript,
|
|
46
|
-
num_smart_intents_to_use: this.smartIntentsConfig.numSmartIntentsToUse,
|
|
47
|
-
use_latest: this.resolveUseLatest(),
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
try {
|
|
51
|
-
const response = await this.getInference(params)
|
|
52
|
-
const smartIntentNode = smartIntentNodes.find(
|
|
53
|
-
smartIntentNode =>
|
|
54
|
-
smartIntentNode.content.title === response.data.smart_intent_title
|
|
55
|
-
)
|
|
56
|
-
|
|
57
|
-
if (smartIntentNode) {
|
|
58
|
-
const targetPayload = this.cmsApi.getPayload(smartIntentNode.target)
|
|
59
|
-
this.currentRequest.input.nluResolution = {
|
|
60
|
-
type: NluType.SmartIntent,
|
|
61
|
-
matchedValue: smartIntentNode.content.title,
|
|
62
|
-
payload: targetPayload,
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const { flowId, flowName, flowNodeId, flowNodeContentId } =
|
|
66
|
-
getCommonFlowContentEventArgsForContentId(
|
|
67
|
-
this.currentRequest,
|
|
68
|
-
smartIntentNode.id
|
|
69
|
-
)
|
|
70
|
-
|
|
71
|
-
const event: EventIntentSmart = {
|
|
72
|
-
action: EventAction.IntentSmart,
|
|
73
|
-
nluIntentSmartTitle: response.data.smart_intent_title,
|
|
74
|
-
nluIntentSmartNumUsed: response.data.smart_intents_used.length,
|
|
75
|
-
nluIntentSmartMessageId: this.currentRequest.input.message_id,
|
|
76
|
-
userInput: this.userTextOrTranscript,
|
|
77
|
-
flowThreadId: this.currentRequest.session.flow_thread_id as string,
|
|
78
|
-
flowId,
|
|
79
|
-
flowName,
|
|
80
|
-
flowNodeContentId,
|
|
81
|
-
flowNodeId,
|
|
82
|
-
}
|
|
83
|
-
const { action, ...eventArgs } = event
|
|
84
|
-
|
|
85
|
-
await trackEvent(this.currentRequest, action, eventArgs)
|
|
86
|
-
|
|
87
|
-
return smartIntentNode
|
|
88
|
-
}
|
|
89
|
-
} catch (e) {
|
|
90
|
-
console.error(e)
|
|
91
|
-
}
|
|
92
|
-
return undefined
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
private resolveUseLatest(): boolean {
|
|
96
|
-
if (this.currentRequest.session.is_test_integration) {
|
|
97
|
-
return false
|
|
98
|
-
}
|
|
99
|
-
return this.smartIntentsConfig.useLatest
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
private async getInference(
|
|
103
|
-
inferenceParams: SmartIntentsInferenceParams
|
|
104
|
-
): Promise<SmartIntentResponse> {
|
|
105
|
-
const pluginFlowBuilder = getFlowBuilderPlugin(this.currentRequest.plugins)
|
|
106
|
-
const token = pluginFlowBuilder.getAccessToken(this.currentRequest.session)
|
|
107
|
-
|
|
108
|
-
return await axios({
|
|
109
|
-
method: 'POST',
|
|
110
|
-
url: `${process.env.HUBTYPE_API_URL}/external/v2/ai/smart_intents/inference/`,
|
|
111
|
-
headers: {
|
|
112
|
-
Authorization: `Bearer ${token}`,
|
|
113
|
-
'Content-Type': 'application/json',
|
|
114
|
-
},
|
|
115
|
-
data: inferenceParams,
|
|
116
|
-
timeout: 10000,
|
|
117
|
-
})
|
|
118
|
-
}
|
|
119
|
-
}
|
package/src/utils.ts
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { INPUT, type Input, type Session } from '@botonic/core'
|
|
2
|
-
import type { ActionRequest } from '@botonic/react'
|
|
3
|
-
|
|
4
|
-
import { getFlowBuilderPlugin } from './helpers'
|
|
5
|
-
import { type InShadowingConfig, ProcessEnvNodeEnvs } from './types'
|
|
6
|
-
|
|
7
|
-
function getAccessTokenFromSession(session: Session): string {
|
|
8
|
-
if (!session._access_token) {
|
|
9
|
-
throw new Error('No access token found in session')
|
|
10
|
-
}
|
|
11
|
-
return session._access_token
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function resolveGetAccessToken(
|
|
15
|
-
getAccessToken: (session: Session) => string
|
|
16
|
-
): (session: Session) => string {
|
|
17
|
-
switch (process.env.NODE_ENV) {
|
|
18
|
-
case ProcessEnvNodeEnvs.PRODUCTION:
|
|
19
|
-
return getAccessTokenFromSession
|
|
20
|
-
case ProcessEnvNodeEnvs.DEVELOPMENT:
|
|
21
|
-
return getAccessToken
|
|
22
|
-
default:
|
|
23
|
-
throw new Error('No method defined for getting access token')
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export function inputHasTextOrTranscript(input: Input): boolean {
|
|
28
|
-
const isTextInput = Boolean(input.data) && input.type === INPUT.TEXT
|
|
29
|
-
const isTranscriptText =
|
|
30
|
-
Boolean(input.transcript) && input.type === INPUT.AUDIO
|
|
31
|
-
|
|
32
|
-
return isTextInput || isTranscriptText
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export function getTextOrTranscript(input: Input): string | undefined {
|
|
36
|
-
if (input.type === INPUT.TEXT && input.data) {
|
|
37
|
-
return input.data
|
|
38
|
-
}
|
|
39
|
-
if (input.type === INPUT.AUDIO && input.transcript) {
|
|
40
|
-
return input.transcript
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
console.error('No text or transcript found in input', input)
|
|
44
|
-
return undefined
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function isNluAllowed(
|
|
48
|
-
request: ActionRequest,
|
|
49
|
-
nluFlag: keyof InShadowingConfig
|
|
50
|
-
): boolean {
|
|
51
|
-
const shadowing = Boolean(request.session._shadowing)
|
|
52
|
-
const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins)
|
|
53
|
-
return !shadowing || (shadowing && flowBuilderPlugin.inShadowing[nluFlag])
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export function isKeywordsAllowed(request: ActionRequest): boolean {
|
|
57
|
-
return isNluAllowed(request, 'allowKeywords')
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export function isSmartIntentsAllowed(request: ActionRequest): boolean {
|
|
61
|
-
return isNluAllowed(request, 'allowSmartIntents')
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export function isKnowledgeBasesAllowed(request: ActionRequest): boolean {
|
|
65
|
-
return isNluAllowed(request, 'allowKnowledgeBases')
|
|
66
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { createContext } from 'react'
|
|
2
|
-
|
|
3
|
-
import type { MapContentsType, WebviewContentsContextType } from './types'
|
|
4
|
-
|
|
5
|
-
export const createWebviewContentsContext = <T extends MapContentsType>() =>
|
|
6
|
-
createContext<WebviewContentsContextType<T>>({
|
|
7
|
-
getTextContent: () => '',
|
|
8
|
-
getImageSrc: () => '',
|
|
9
|
-
setCurrentLocale: () => undefined,
|
|
10
|
-
contents: {} as Record<keyof T, string>,
|
|
11
|
-
})
|
package/src/webview/index.ts
DELETED