@botonic/plugin-flow-builder 0.43.2 → 0.44.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/action/ai-agent.js +55 -61
- package/lib/cjs/action/ai-agent.js.map +1 -1
- package/lib/cjs/action/fallback.js +28 -32
- package/lib/cjs/action/fallback.js.map +1 -1
- package/lib/cjs/action/first-interaction.js +61 -71
- package/lib/cjs/action/first-interaction.js.map +1 -1
- package/lib/cjs/action/index.js +66 -79
- package/lib/cjs/action/index.js.map +1 -1
- package/lib/cjs/action/knowledge-bases.js +64 -72
- package/lib/cjs/action/knowledge-bases.js.map +1 -1
- package/lib/cjs/action/payload.js +61 -70
- package/lib/cjs/action/payload.js.map +1 -1
- package/lib/cjs/api.d.ts +7 -2
- package/lib/cjs/api.js +58 -36
- package/lib/cjs/api.js.map +1 -1
- package/lib/cjs/constants.d.ts +1 -1
- package/lib/cjs/content-fields/content-fields-base.js +3 -6
- package/lib/cjs/content-fields/content-fields-base.js.map +1 -1
- package/lib/cjs/content-fields/flow-ai-agent.d.ts +0 -1
- package/lib/cjs/content-fields/flow-ai-agent.js +4 -7
- package/lib/cjs/content-fields/flow-ai-agent.js.map +1 -1
- package/lib/cjs/content-fields/flow-bot-action.d.ts +0 -1
- package/lib/cjs/content-fields/flow-bot-action.js +14 -17
- package/lib/cjs/content-fields/flow-bot-action.js.map +1 -1
- package/lib/cjs/content-fields/flow-button.d.ts +0 -1
- package/lib/cjs/content-fields/flow-button.js +10 -16
- package/lib/cjs/content-fields/flow-button.js.map +1 -1
- package/lib/cjs/content-fields/flow-capture-user-input.d.ts +13 -0
- package/lib/cjs/content-fields/flow-capture-user-input.js +43 -0
- package/lib/cjs/content-fields/flow-capture-user-input.js.map +1 -0
- package/lib/cjs/content-fields/flow-carousel.d.ts +0 -1
- package/lib/cjs/content-fields/flow-carousel.js +16 -23
- package/lib/cjs/content-fields/flow-carousel.js.map +1 -1
- package/lib/cjs/content-fields/flow-channel-conditional.d.ts +0 -1
- package/lib/cjs/content-fields/flow-channel-conditional.js +14 -17
- package/lib/cjs/content-fields/flow-channel-conditional.js.map +1 -1
- package/lib/cjs/content-fields/flow-country-conditional.d.ts +0 -1
- package/lib/cjs/content-fields/flow-country-conditional.js +17 -21
- package/lib/cjs/content-fields/flow-country-conditional.js.map +1 -1
- package/lib/cjs/content-fields/flow-custom-conditional.js +18 -22
- package/lib/cjs/content-fields/flow-custom-conditional.js.map +1 -1
- package/lib/cjs/content-fields/flow-element.d.ts +0 -1
- package/lib/cjs/content-fields/flow-element.js +5 -9
- package/lib/cjs/content-fields/flow-element.js.map +1 -1
- package/lib/cjs/content-fields/flow-go-to-flow.d.ts +0 -1
- package/lib/cjs/content-fields/flow-go-to-flow.js +15 -18
- package/lib/cjs/content-fields/flow-go-to-flow.js.map +1 -1
- package/lib/cjs/content-fields/flow-handoff.d.ts +0 -1
- package/lib/cjs/content-fields/flow-handoff.js +29 -35
- package/lib/cjs/content-fields/flow-handoff.js.map +1 -1
- package/lib/cjs/content-fields/flow-image.d.ts +0 -1
- package/lib/cjs/content-fields/flow-image.js +2 -5
- package/lib/cjs/content-fields/flow-image.js.map +1 -1
- package/lib/cjs/content-fields/flow-knowledge-base.d.ts +0 -1
- package/lib/cjs/content-fields/flow-knowledge-base.js +5 -8
- package/lib/cjs/content-fields/flow-knowledge-base.js.map +1 -1
- package/lib/cjs/content-fields/flow-queue-status-conditional.d.ts +0 -1
- package/lib/cjs/content-fields/flow-queue-status-conditional.js +55 -65
- package/lib/cjs/content-fields/flow-queue-status-conditional.js.map +1 -1
- package/lib/cjs/content-fields/flow-rating.d.ts +0 -1
- package/lib/cjs/content-fields/flow-rating.js +2 -5
- package/lib/cjs/content-fields/flow-rating.js.map +1 -1
- package/lib/cjs/content-fields/flow-text.d.ts +0 -1
- package/lib/cjs/content-fields/flow-text.js +5 -8
- package/lib/cjs/content-fields/flow-text.js.map +1 -1
- package/lib/cjs/content-fields/flow-video.d.ts +0 -1
- package/lib/cjs/content-fields/flow-video.js +2 -5
- package/lib/cjs/content-fields/flow-video.js.map +1 -1
- package/lib/cjs/content-fields/flow-webview.js +15 -18
- package/lib/cjs/content-fields/flow-webview.js.map +1 -1
- package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.d.ts +0 -1
- package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js +3 -6
- package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js.map +1 -1
- package/lib/cjs/content-fields/flow-whatsapp-template.d.ts +0 -1
- package/lib/cjs/content-fields/flow-whatsapp-template.js +6 -12
- package/lib/cjs/content-fields/flow-whatsapp-template.js.map +1 -1
- package/lib/cjs/content-fields/hubtype-fields/capture-user-input.d.ts +19 -0
- package/lib/cjs/content-fields/hubtype-fields/capture-user-input.js +12 -0
- package/lib/cjs/content-fields/hubtype-fields/capture-user-input.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/function.js +1 -1
- package/lib/cjs/content-fields/hubtype-fields/function.js.map +1 -1
- package/lib/cjs/content-fields/hubtype-fields/index.d.ts +1 -0
- package/lib/cjs/content-fields/hubtype-fields/index.js +1 -0
- package/lib/cjs/content-fields/hubtype-fields/index.js.map +1 -1
- package/lib/cjs/content-fields/hubtype-fields/node-types.d.ts +2 -1
- package/lib/cjs/content-fields/hubtype-fields/node-types.js +4 -3
- package/lib/cjs/content-fields/hubtype-fields/node-types.js.map +1 -1
- package/lib/cjs/content-fields/hubtype-fields/nodes.d.ts +2 -1
- package/lib/cjs/content-fields/hubtype-fields/rating.js +1 -1
- package/lib/cjs/content-fields/hubtype-fields/rating.js.map +1 -1
- package/lib/cjs/content-fields/index.d.ts +3 -2
- package/lib/cjs/content-fields/index.js +3 -1
- package/lib/cjs/content-fields/index.js.map +1 -1
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +2 -5
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +1 -1
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +2 -5
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +1 -1
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +0 -1
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +3 -6
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +1 -1
- package/lib/cjs/filters/index.js +5 -8
- package/lib/cjs/filters/index.js.map +1 -1
- package/lib/cjs/flow-factory.js +49 -51
- package/lib/cjs/flow-factory.js.map +1 -1
- package/lib/cjs/functions/index.js +18 -21
- package/lib/cjs/functions/index.js.map +1 -1
- package/lib/cjs/helpers.js +1 -2
- package/lib/cjs/helpers.js.map +1 -1
- package/lib/cjs/index.js +68 -73
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/services/hubtype-queues-api.js +10 -12
- package/lib/cjs/services/hubtype-queues-api.js.map +1 -1
- package/lib/cjs/tracking.d.ts +1 -1
- package/lib/cjs/tracking.js +33 -43
- package/lib/cjs/tracking.js.map +1 -1
- package/lib/cjs/types.js +2 -2
- package/lib/cjs/types.js.map +1 -1
- package/lib/cjs/user-input/capture-user-input-api.d.ts +20 -0
- package/lib/cjs/user-input/capture-user-input-api.js +84 -0
- package/lib/cjs/user-input/capture-user-input-api.js.map +1 -0
- package/lib/cjs/user-input/index.d.ts +1 -2
- package/lib/cjs/user-input/index.js +25 -24
- package/lib/cjs/user-input/index.js.map +1 -1
- package/lib/cjs/user-input/keyword.js +31 -36
- package/lib/cjs/user-input/keyword.js.map +1 -1
- package/lib/cjs/user-input/smart-intent.js +55 -59
- package/lib/cjs/user-input/smart-intent.js.map +1 -1
- package/lib/cjs/utils.js +7 -9
- package/lib/cjs/utils.js.map +1 -1
- package/lib/cjs/webview/contents-context.d.ts +0 -1
- package/lib/cjs/webview/types.js +1 -1
- package/lib/cjs/webview/types.js.map +1 -1
- package/lib/cjs/webview/use-webview-contents.js +10 -9
- package/lib/cjs/webview/use-webview-contents.js.map +1 -1
- package/lib/esm/action/ai-agent.js +61 -63
- package/lib/esm/action/ai-agent.js.map +1 -1
- package/lib/esm/action/fallback.js +32 -32
- package/lib/esm/action/fallback.js.map +1 -1
- package/lib/esm/action/first-interaction.js +69 -75
- package/lib/esm/action/first-interaction.js.map +1 -1
- package/lib/esm/action/index.js +93 -101
- package/lib/esm/action/index.js.map +1 -1
- package/lib/esm/action/knowledge-bases.js +71 -75
- package/lib/esm/action/knowledge-bases.js.map +1 -1
- package/lib/esm/action/payload.js +67 -72
- package/lib/esm/action/payload.js.map +1 -1
- package/lib/esm/api.d.ts +7 -2
- package/lib/esm/api.js +77 -51
- package/lib/esm/api.js.map +1 -1
- package/lib/esm/constants.d.ts +1 -1
- package/lib/esm/constants.js +17 -14
- package/lib/esm/constants.js.map +1 -1
- package/lib/esm/content-fields/content-fields-base.js +13 -12
- package/lib/esm/content-fields/content-fields-base.js.map +1 -1
- package/lib/esm/content-fields/flow-ai-agent.d.ts +0 -1
- package/lib/esm/content-fields/flow-ai-agent.js +18 -17
- package/lib/esm/content-fields/flow-ai-agent.js.map +1 -1
- package/lib/esm/content-fields/flow-bot-action.d.ts +0 -1
- package/lib/esm/content-fields/flow-bot-action.js +25 -24
- package/lib/esm/content-fields/flow-bot-action.js.map +1 -1
- package/lib/esm/content-fields/flow-button.d.ts +0 -1
- package/lib/esm/content-fields/flow-button.js +25 -27
- package/lib/esm/content-fields/flow-button.js.map +1 -1
- package/lib/esm/content-fields/flow-capture-user-input.d.ts +13 -0
- package/lib/esm/content-fields/flow-capture-user-input.js +43 -0
- package/lib/esm/content-fields/flow-capture-user-input.js.map +1 -0
- package/lib/esm/content-fields/flow-carousel.d.ts +0 -1
- package/lib/esm/content-fields/flow-carousel.js +39 -42
- package/lib/esm/content-fields/flow-carousel.js.map +1 -1
- package/lib/esm/content-fields/flow-channel-conditional.d.ts +0 -1
- package/lib/esm/content-fields/flow-channel-conditional.js +24 -23
- package/lib/esm/content-fields/flow-channel-conditional.js.map +1 -1
- package/lib/esm/content-fields/flow-country-conditional.d.ts +0 -1
- package/lib/esm/content-fields/flow-country-conditional.js +27 -27
- package/lib/esm/content-fields/flow-country-conditional.js.map +1 -1
- package/lib/esm/content-fields/flow-custom-conditional.js +30 -30
- package/lib/esm/content-fields/flow-custom-conditional.js.map +1 -1
- package/lib/esm/content-fields/flow-element.d.ts +0 -1
- package/lib/esm/content-fields/flow-element.js +16 -16
- package/lib/esm/content-fields/flow-element.js.map +1 -1
- package/lib/esm/content-fields/flow-go-to-flow.d.ts +0 -1
- package/lib/esm/content-fields/flow-go-to-flow.js +25 -24
- package/lib/esm/content-fields/flow-go-to-flow.js.map +1 -1
- package/lib/esm/content-fields/flow-handoff.d.ts +0 -1
- package/lib/esm/content-fields/flow-handoff.js +40 -42
- package/lib/esm/content-fields/flow-handoff.js.map +1 -1
- package/lib/esm/content-fields/flow-image.d.ts +0 -1
- package/lib/esm/content-fields/flow-image.js +12 -11
- package/lib/esm/content-fields/flow-image.js.map +1 -1
- package/lib/esm/content-fields/flow-knowledge-base.d.ts +0 -1
- package/lib/esm/content-fields/flow-knowledge-base.js +15 -14
- package/lib/esm/content-fields/flow-knowledge-base.js.map +1 -1
- package/lib/esm/content-fields/flow-queue-status-conditional.d.ts +0 -1
- package/lib/esm/content-fields/flow-queue-status-conditional.js +67 -73
- package/lib/esm/content-fields/flow-queue-status-conditional.js.map +1 -1
- package/lib/esm/content-fields/flow-rating.d.ts +0 -1
- package/lib/esm/content-fields/flow-rating.js +23 -22
- package/lib/esm/content-fields/flow-rating.js.map +1 -1
- package/lib/esm/content-fields/flow-text.d.ts +0 -1
- package/lib/esm/content-fields/flow-text.js +25 -24
- package/lib/esm/content-fields/flow-text.js.map +1 -1
- package/lib/esm/content-fields/flow-video.d.ts +0 -1
- package/lib/esm/content-fields/flow-video.js +12 -11
- package/lib/esm/content-fields/flow-video.js.map +1 -1
- package/lib/esm/content-fields/flow-webview.js +23 -22
- package/lib/esm/content-fields/flow-webview.js.map +1 -1
- package/lib/esm/content-fields/flow-whatsapp-cta-url-button.d.ts +0 -1
- package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js +31 -30
- package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js.map +1 -1
- package/lib/esm/content-fields/flow-whatsapp-template.d.ts +0 -1
- package/lib/esm/content-fields/flow-whatsapp-template.js +45 -47
- package/lib/esm/content-fields/flow-whatsapp-template.js.map +1 -1
- package/lib/esm/content-fields/hubtype-fields/ai-agent.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/bot-action.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/button.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/capture-user-input.d.ts +19 -0
- package/lib/esm/content-fields/hubtype-fields/capture-user-input.js +12 -0
- package/lib/esm/content-fields/hubtype-fields/capture-user-input.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/carousel.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/channel-conditional.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/common.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/country-conditional.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/custom-conditional.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/fallback.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/function.js +5 -2
- package/lib/esm/content-fields/hubtype-fields/function.js.map +1 -1
- package/lib/esm/content-fields/hubtype-fields/go-to-flow.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/handoff.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/image.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/index.d.ts +1 -0
- package/lib/esm/content-fields/hubtype-fields/index.js +27 -23
- package/lib/esm/content-fields/hubtype-fields/index.js.map +1 -1
- package/lib/esm/content-fields/hubtype-fields/keyword.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/knowledge-base.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/node-types.d.ts +2 -1
- package/lib/esm/content-fields/hubtype-fields/node-types.js +10 -6
- package/lib/esm/content-fields/hubtype-fields/node-types.js.map +1 -1
- package/lib/esm/content-fields/hubtype-fields/nodes.d.ts +2 -1
- package/lib/esm/content-fields/hubtype-fields/nodes.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/payload.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/rating.js +5 -2
- package/lib/esm/content-fields/hubtype-fields/rating.js.map +1 -1
- package/lib/esm/content-fields/hubtype-fields/smart-intent.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/text.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/url.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/video.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/webview.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/whatsapp-template.js +2 -1
- package/lib/esm/content-fields/index.d.ts +3 -2
- package/lib/esm/content-fields/index.js +46 -22
- package/lib/esm/content-fields/index.js.map +1 -1
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +10 -9
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +1 -1
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +10 -9
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +1 -1
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +0 -1
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +18 -17
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +1 -1
- package/lib/esm/filters/index.js +10 -9
- package/lib/esm/filters/index.js.map +1 -1
- package/lib/esm/flow-factory.js +56 -54
- package/lib/esm/flow-factory.js.map +1 -1
- package/lib/esm/functions/index.js +24 -22
- package/lib/esm/functions/index.js.map +1 -1
- package/lib/esm/helpers.js +4 -1
- package/lib/esm/helpers.js.map +1 -1
- package/lib/esm/index.js +101 -99
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/services/hubtype-queues-api.js +17 -15
- package/lib/esm/services/hubtype-queues-api.js.map +1 -1
- package/lib/esm/tracking.d.ts +1 -1
- package/lib/esm/tracking.js +42 -45
- package/lib/esm/tracking.js.map +1 -1
- package/lib/esm/types.js +7 -4
- package/lib/esm/types.js.map +1 -1
- package/lib/esm/user-input/capture-user-input-api.d.ts +20 -0
- package/lib/esm/user-input/capture-user-input-api.js +84 -0
- package/lib/esm/user-input/capture-user-input-api.js.map +1 -0
- package/lib/esm/user-input/index.d.ts +1 -2
- package/lib/esm/user-input/index.js +30 -25
- package/lib/esm/user-input/index.js.map +1 -1
- package/lib/esm/user-input/keyword.js +40 -41
- package/lib/esm/user-input/keyword.js.map +1 -1
- package/lib/esm/user-input/smart-intent.js +65 -65
- package/lib/esm/user-input/smart-intent.js.map +1 -1
- package/lib/esm/utils.js +22 -15
- package/lib/esm/utils.js.map +1 -1
- package/lib/esm/webview/contents-context.d.ts +0 -1
- package/lib/esm/webview/contents-context.js +6 -2
- package/lib/esm/webview/contents-context.js.map +1 -1
- package/lib/esm/webview/index.js +9 -3
- package/lib/esm/webview/index.js.map +1 -1
- package/lib/esm/webview/types.js +5 -2
- package/lib/esm/webview/types.js.map +1 -1
- package/lib/esm/webview/use-webview-contents.js +28 -23
- package/lib/esm/webview/use-webview-contents.js.map +1 -1
- package/package.json +2 -2
- package/src/api.ts +35 -1
- package/src/content-fields/flow-capture-user-input.tsx +45 -0
- package/src/content-fields/hubtype-fields/capture-user-input.ts +21 -0
- package/src/content-fields/hubtype-fields/index.ts +1 -0
- package/src/content-fields/hubtype-fields/node-types.ts +1 -0
- package/src/content-fields/hubtype-fields/nodes.ts +2 -0
- package/src/content-fields/index.ts +3 -0
- package/src/flow-factory.ts +4 -0
- package/src/index.ts +4 -3
- package/src/tracking.ts +2 -2
- package/src/user-input/capture-user-input-api.ts +134 -0
- package/src/user-input/index.ts +13 -8
package/lib/cjs/utils.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.resolveGetAccessToken = resolveGetAccessToken;
|
|
4
|
+
exports.getValueFromKeyPath = getValueFromKeyPath;
|
|
5
|
+
exports.inputHasTextData = inputHasTextData;
|
|
6
|
+
exports.isKeywordsAllowed = isKeywordsAllowed;
|
|
7
|
+
exports.isSmartIntentsAllowed = isSmartIntentsAllowed;
|
|
8
|
+
exports.isKnowledgeBasesAllowed = isKnowledgeBasesAllowed;
|
|
4
9
|
const core_1 = require("@botonic/core");
|
|
5
10
|
const helpers_1 = require("./helpers");
|
|
6
11
|
const types_1 = require("./types");
|
|
@@ -20,12 +25,10 @@ function resolveGetAccessToken(getAccessToken) {
|
|
|
20
25
|
throw new Error('No method defined for getting access token');
|
|
21
26
|
}
|
|
22
27
|
}
|
|
23
|
-
exports.resolveGetAccessToken = resolveGetAccessToken;
|
|
24
28
|
function getValueFromKeyPath(request, keyPath) {
|
|
25
|
-
var _a, _b;
|
|
26
29
|
if (keyPath.startsWith('session.user.contact_info.')) {
|
|
27
30
|
const name = keyPath.split('.').at(-1);
|
|
28
|
-
return
|
|
31
|
+
return request.session.user.contact_info?.find(contact => contact.name === name)?.value;
|
|
29
32
|
}
|
|
30
33
|
if (keyPath.startsWith('input.') || keyPath.startsWith('session.')) {
|
|
31
34
|
return keyPath
|
|
@@ -36,7 +39,6 @@ function getValueFromKeyPath(request, keyPath) {
|
|
|
36
39
|
.split('.')
|
|
37
40
|
.reduce((object, key) => resolveObjectKey(object, key), request.session.user.extra_data);
|
|
38
41
|
}
|
|
39
|
-
exports.getValueFromKeyPath = getValueFromKeyPath;
|
|
40
42
|
function resolveObjectKey(object, key) {
|
|
41
43
|
if (object && object[key] !== undefined) {
|
|
42
44
|
return object[key];
|
|
@@ -46,7 +48,6 @@ function resolveObjectKey(object, key) {
|
|
|
46
48
|
function inputHasTextData(input) {
|
|
47
49
|
return input.data !== undefined && input.type === core_1.INPUT.TEXT;
|
|
48
50
|
}
|
|
49
|
-
exports.inputHasTextData = inputHasTextData;
|
|
50
51
|
function isNluAllowed(request, nluFlag) {
|
|
51
52
|
const shadowing = Boolean(request.session._shadowing);
|
|
52
53
|
const flowBuilderPlugin = (0, helpers_1.getFlowBuilderPlugin)(request.plugins);
|
|
@@ -55,13 +56,10 @@ function isNluAllowed(request, nluFlag) {
|
|
|
55
56
|
function isKeywordsAllowed(request) {
|
|
56
57
|
return isNluAllowed(request, 'allowKeywords');
|
|
57
58
|
}
|
|
58
|
-
exports.isKeywordsAllowed = isKeywordsAllowed;
|
|
59
59
|
function isSmartIntentsAllowed(request) {
|
|
60
60
|
return isNluAllowed(request, 'allowSmartIntents');
|
|
61
61
|
}
|
|
62
|
-
exports.isSmartIntentsAllowed = isSmartIntentsAllowed;
|
|
63
62
|
function isKnowledgeBasesAllowed(request) {
|
|
64
63
|
return isNluAllowed(request, 'allowKnowledgeBases');
|
|
65
64
|
}
|
|
66
|
-
exports.isKnowledgeBasesAllowed = isKnowledgeBasesAllowed;
|
|
67
65
|
//# sourceMappingURL=utils.js.map
|
package/lib/cjs/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;AAaA,sDAWC;AAED,kDAuBC;AASD,4CAEC;AAWD,8CAEC;AAED,sDAEC;AAED,0DAEC;AAjFD,wCAAqD;AAGrD,uCAAgD;AAChD,mCAA+D;AAE/D,SAAS,yBAAyB,CA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AAM,EAAE,GAAG,CAAC,EAC9C,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAChC,CAAA;AACL,CAAC;AAED,SAAS,gBAAgB,CAAC,MAAW,EAAE,GAAW;IAChD,IAAI,MAAM,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE,CAAC;QACxC,OAAO,MAAM,CAAC,GAAG,CAAC,CAAA;IACpB,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,SAAgB,gBAAgB,CAAC,KAAY;IAC3C,OAAO,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,KAAK,YAAK,CAAC,IAAI,CAAA;AAC9D,CAAC;AAED,SAAS,YAAY,CACnB,OAAsB,EACtB,OAAgC;IAEhC,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;IACrD,MAAM,iBAAiB,GAAG,IAAA,8BAAoB,EAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IAC/D,OAAO,CAAC,SAAS,IAAI,CAAC,SAAS,IAAI,iBAAiB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAA;AAC5E,CAAC;AAED,SAAgB,iBAAiB,CAAC,OAAsB;IACtD,OAAO,YAAY,CAAC,OAAO,EAAE,eAAe,CAAC,CAAA;AAC/C,CAAC;AAED,SAAgB,qBAAqB,CAAC,OAAsB;IAC1D,OAAO,YAAY,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAA;AACnD,CAAC;AAED,SAAgB,uBAAuB,CAAC,OAAsB;IAC5D,OAAO,YAAY,CAAC,OAAO,EAAE,qBAAqB,CAAC,CAAA;AACrD,CAAC"}
|
package/lib/cjs/webview/types.js
CHANGED
|
@@ -5,5 +5,5 @@ var WebviewContentType;
|
|
|
5
5
|
(function (WebviewContentType) {
|
|
6
6
|
WebviewContentType["TEXT"] = "webview-text";
|
|
7
7
|
WebviewContentType["IMAGE"] = "webview-image";
|
|
8
|
-
})(WebviewContentType
|
|
8
|
+
})(WebviewContentType || (exports.WebviewContentType = WebviewContentType = {}));
|
|
9
9
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/webview/types.ts"],"names":[],"mappings":";;;AAEA,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,2CAAqB,CAAA;IACrB,6CAAuB,CAAA;AACzB,CAAC,EAHW,kBAAkB,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/webview/types.ts"],"names":[],"mappings":";;;AAEA,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,2CAAqB,CAAA;IACrB,6CAAuB,CAAA;AACzB,CAAC,EAHW,kBAAkB,kCAAlB,kBAAkB,QAG7B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useWebviewContents =
|
|
3
|
+
exports.useWebviewContents = useWebviewContents;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const axios_1 = tslib_1.__importDefault(require("axios"));
|
|
6
6
|
const react_1 = require("react");
|
|
@@ -31,13 +31,15 @@ function useWebviewContents({ apiUrl = constants_1.FLOW_BUILDER_API_URL_PROD, ve
|
|
|
31
31
|
console.error(`locale: ${currentLocale} cannot be resolved with: ${locales.join(', ')}`);
|
|
32
32
|
};
|
|
33
33
|
const getTextContent = (contentID) => {
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
return (textContents
|
|
35
|
+
?.find(textContent => textContent.code === contentID)
|
|
36
|
+
?.content.text.find(text => text.locale === currentLocale)?.message ||
|
|
36
37
|
'');
|
|
37
38
|
};
|
|
38
39
|
const getImageSrc = (contentID) => {
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
return (imageContents
|
|
41
|
+
?.find(imageContent => imageContent.code === contentID)
|
|
42
|
+
?.content.image.find(image => image.locale === currentLocale)?.file ||
|
|
41
43
|
'');
|
|
42
44
|
};
|
|
43
45
|
(0, react_1.useEffect)(() => {
|
|
@@ -50,10 +52,10 @@ function useWebviewContents({ apiUrl = constants_1.FLOW_BUILDER_API_URL_PROD, ve
|
|
|
50
52
|
}
|
|
51
53
|
}, [textContents, imageContents, currentLocale]);
|
|
52
54
|
(0, react_1.useEffect)(() => {
|
|
53
|
-
const getResponseContents = () =>
|
|
55
|
+
const getResponseContents = async () => {
|
|
54
56
|
const url = `${apiUrl}/v1/bot_flows/${botId}/versions/${version}/webviews/${webviewId}/?provider_id=${providerId}`;
|
|
55
57
|
try {
|
|
56
|
-
const response =
|
|
58
|
+
const response = await axios_1.default.get(url);
|
|
57
59
|
const textResponseContents = response.data.filter(webviewContent => webviewContent.type === types_2.WebviewContentType.TEXT);
|
|
58
60
|
setTextContents(textResponseContents);
|
|
59
61
|
const imageResponseContents = response.data.filter(webviewContent => webviewContent.type === types_2.WebviewContentType.IMAGE);
|
|
@@ -64,7 +66,7 @@ function useWebviewContents({ apiUrl = constants_1.FLOW_BUILDER_API_URL_PROD, ve
|
|
|
64
66
|
console.error('Error fetching webview contents:', error);
|
|
65
67
|
setError(true);
|
|
66
68
|
}
|
|
67
|
-
}
|
|
69
|
+
};
|
|
68
70
|
getResponseContents();
|
|
69
71
|
}, []);
|
|
70
72
|
return {
|
|
@@ -78,5 +80,4 @@ function useWebviewContents({ apiUrl = constants_1.FLOW_BUILDER_API_URL_PROD, ve
|
|
|
78
80
|
},
|
|
79
81
|
};
|
|
80
82
|
}
|
|
81
|
-
exports.useWebviewContents = useWebviewContents;
|
|
82
83
|
//# sourceMappingURL=use-webview-contents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-webview-contents.js","sourceRoot":"","sources":["../../../src/webview/use-webview-contents.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-webview-contents.js","sourceRoot":"","sources":["../../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CAAA;AACH,CAAC"}
|
|
@@ -1,67 +1,65 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return [];
|
|
32
|
-
}
|
|
33
|
-
yield trackAiAgentResponse(aiAgentResponse, request, aiAgentContent);
|
|
34
|
-
if (aiAgentResponse.exit) {
|
|
35
|
-
return [];
|
|
36
|
-
}
|
|
37
|
-
aiAgentContent.responses = aiAgentResponse.messages;
|
|
38
|
-
return contents;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getContentsByAiAgent = getContentsByAiAgent;
|
|
4
|
+
const core_1 = require("@botonic/core");
|
|
5
|
+
const content_fields_1 = require("../content-fields");
|
|
6
|
+
const helpers_1 = require("../helpers");
|
|
7
|
+
const tracking_1 = require("../tracking");
|
|
8
|
+
async function getContentsByAiAgent({ cmsApi, flowBuilderPlugin, request, }) {
|
|
9
|
+
const startNodeAiAgentFlow = cmsApi.getStartNodeAiAgentFlow();
|
|
10
|
+
const isAiAgentEnabled = cmsApi.isAiAgentEnabled();
|
|
11
|
+
if (!startNodeAiAgentFlow || !isAiAgentEnabled) {
|
|
12
|
+
return [];
|
|
13
|
+
}
|
|
14
|
+
const contents = await flowBuilderPlugin.getContentsByNode(startNodeAiAgentFlow);
|
|
15
|
+
const aiAgentContent = contents.find(content => content instanceof content_fields_1.FlowAiAgent);
|
|
16
|
+
if (!aiAgentContent) {
|
|
17
|
+
return [];
|
|
18
|
+
}
|
|
19
|
+
const activeInputGuardrailRules = aiAgentContent.inputGuardrailRules
|
|
20
|
+
?.filter(rule => rule.is_active)
|
|
21
|
+
?.map(rule => ({
|
|
22
|
+
name: rule.name,
|
|
23
|
+
description: rule.description,
|
|
24
|
+
})) || [];
|
|
25
|
+
const aiAgentResponse = await flowBuilderPlugin.getAiAgentResponse?.(request, {
|
|
26
|
+
name: aiAgentContent.name,
|
|
27
|
+
instructions: aiAgentContent.instructions,
|
|
28
|
+
activeTools: aiAgentContent.activeTools,
|
|
29
|
+
inputGuardrailRules: activeInputGuardrailRules,
|
|
30
|
+
sourceIds: aiAgentContent.sources?.map(source => source.id),
|
|
39
31
|
});
|
|
32
|
+
if (!aiAgentResponse) {
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
await trackAiAgentResponse(aiAgentResponse, request, aiAgentContent);
|
|
36
|
+
if (aiAgentResponse.exit) {
|
|
37
|
+
return [];
|
|
38
|
+
}
|
|
39
|
+
aiAgentContent.responses = aiAgentResponse.messages;
|
|
40
|
+
return contents;
|
|
40
41
|
}
|
|
41
|
-
function trackAiAgentResponse(aiAgentResponse, request, aiAgentContent) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const { action } = event, eventArgs = __rest(event, ["action"]);
|
|
64
|
-
yield trackEvent(request, action, eventArgs);
|
|
65
|
-
});
|
|
42
|
+
async function trackAiAgentResponse(aiAgentResponse, request, aiAgentContent) {
|
|
43
|
+
const flowBuilderPlugin = (0, helpers_1.getFlowBuilderPlugin)(request.plugins);
|
|
44
|
+
const flowId = flowBuilderPlugin.cmsApi.getNodeById(aiAgentContent.id).flow_id;
|
|
45
|
+
const flowName = flowBuilderPlugin.getFlowName(flowId);
|
|
46
|
+
const event = {
|
|
47
|
+
action: core_1.EventAction.AiAgent,
|
|
48
|
+
flowThreadId: request.session.flow_thread_id,
|
|
49
|
+
flowId: flowId,
|
|
50
|
+
flowName: flowName,
|
|
51
|
+
flowNodeId: aiAgentContent.id,
|
|
52
|
+
flowNodeContentId: aiAgentContent.name,
|
|
53
|
+
flowNodeIsMeaningful: true,
|
|
54
|
+
toolsExecuted: aiAgentResponse?.toolsExecuted ?? [],
|
|
55
|
+
memoryLength: aiAgentResponse?.memoryLength ?? 0,
|
|
56
|
+
inputMessageId: request.input.message_id,
|
|
57
|
+
exit: aiAgentResponse?.exit ?? true,
|
|
58
|
+
inputGuardrailsTriggered: aiAgentResponse?.inputGuardrailsTriggered ?? [],
|
|
59
|
+
outputGuardrailsTriggered: [], //aiAgentResponse.outputGuardrailsTriggered,
|
|
60
|
+
error: aiAgentResponse.error,
|
|
61
|
+
};
|
|
62
|
+
const { action, ...eventArgs } = event;
|
|
63
|
+
await (0, tracking_1.trackEvent)(request, action, eventArgs);
|
|
66
64
|
}
|
|
67
65
|
//# sourceMappingURL=ai-agent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-agent.js","sourceRoot":"","sources":["../../../src/action/ai-agent.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ai-agent.js","sourceRoot":"","sources":["../../../src/action/ai-agent.ts"],"names":[],"mappings":";;AAcA,oDAqDC;AAnED,wCAKsB;AAEtB,sDAA4D;AAE5D,wCAAiD;AACjD,0CAAwC;AAIjC,KAAK,UAAU,oBAAoB,CAAC,EACzC,MAAM,EACN,iBAAiB,EACjB,OAAO,GACY;IACnB,MAAM,oBAAoB,GAAG,MAAM,CAAC,uBAAuB,EAAE,CAAA;IAC7D,MAAM,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAA;IA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|
8
|
-
|
|
9
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getContentsByFallback = getContentsByFallback;
|
|
4
|
+
const core_1 = require("@botonic/core");
|
|
5
|
+
const tracking_1 = require("../tracking");
|
|
6
|
+
async function getContentsByFallback({ cmsApi, flowBuilderPlugin, request, }) {
|
|
7
|
+
const fallbackNode = await getFallbackNode(cmsApi, request);
|
|
8
|
+
const fallbackContents = await flowBuilderPlugin.getContentsByNode(fallbackNode);
|
|
9
|
+
return fallbackContents;
|
|
10
10
|
}
|
|
11
|
-
function getFallbackNode(cmsApi, request) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
const isFirstFallbackOption = !!request.session.user.extra_data.isFirstFallbackOption;
|
|
18
|
-
const fallbackNode = cmsApi.getFallbackNode(isFirstFallbackOption);
|
|
19
|
-
request.session.user.extra_data.isFirstFallbackOption = !isFirstFallbackOption;
|
|
20
|
-
const { flowId, flowName, flowNodeId, flowNodeContentId } = getCommonFlowContentEventArgsForContentId(request, fallbackNode.id);
|
|
21
|
-
const event = {
|
|
22
|
-
action: EventAction.Fallback,
|
|
23
|
-
flowId,
|
|
24
|
-
flowName,
|
|
25
|
-
flowNodeId,
|
|
26
|
-
flowNodeContentId,
|
|
27
|
-
userInput: request.input.data,
|
|
28
|
-
fallbackOut: isFirstFallbackOption ? 1 : 2,
|
|
29
|
-
fallbackMessageId: request.input.message_id,
|
|
11
|
+
async function getFallbackNode(cmsApi, request) {
|
|
12
|
+
if (request.session.user.extra_data?.isFirstFallbackOption === undefined) {
|
|
13
|
+
request.session.user.extra_data = {
|
|
14
|
+
...request.session.user.extra_data,
|
|
15
|
+
isFirstFallbackOption: true,
|
|
30
16
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
17
|
+
}
|
|
18
|
+
const isFirstFallbackOption = !!request.session.user.extra_data.isFirstFallbackOption;
|
|
19
|
+
const fallbackNode = cmsApi.getFallbackNode(isFirstFallbackOption);
|
|
20
|
+
request.session.user.extra_data.isFirstFallbackOption = !isFirstFallbackOption;
|
|
21
|
+
const { flowId, flowName, flowNodeId, flowNodeContentId } = (0, tracking_1.getCommonFlowContentEventArgsForContentId)(request, fallbackNode.id);
|
|
22
|
+
const event = {
|
|
23
|
+
action: core_1.EventAction.Fallback,
|
|
24
|
+
flowId,
|
|
25
|
+
flowName,
|
|
26
|
+
flowNodeId,
|
|
27
|
+
flowNodeContentId,
|
|
28
|
+
userInput: request.input.data,
|
|
29
|
+
fallbackOut: isFirstFallbackOption ? 1 : 2,
|
|
30
|
+
fallbackMessageId: request.input.message_id,
|
|
31
|
+
};
|
|
32
|
+
const { action, ...eventArgs } = event;
|
|
33
|
+
await (0, tracking_1.trackEvent)(request, action, eventArgs);
|
|
34
|
+
return fallbackNode;
|
|
35
35
|
}
|
|
36
36
|
//# sourceMappingURL=fallback.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fallback.js","sourceRoot":"","sources":["../../../src/action/fallback.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"fallback.js","sourceRoot":"","sources":["../../../src/action/fallback.ts"],"names":[],"mappings":";;AAWA,sDAUC;AArBD,wCAA0D;AAK1D,0CAGoB;AAGb,KAAK,UAAU,qBAAqB,CAAC,EAC1C,MAAM,EACN,iBAAiB,EACjB,OAAO,GACY;IACnB,MAAM,YAAY,GAAG,MAAM,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC3D,MAAM,gBAAgB,GACpB,MAAM,iBAAiB,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAA;IAEzD,OAAO,gBAAgB,CAAA;AACzB,CAAC;AAED,KAAK,UAAU,eAAe,CAAC,MAAsB,EAAE,OAAsB;IAC3E,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,qBAAqB,KA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|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getContentsByFirstInteraction = getContentsByFirstInteraction;
|
|
4
|
+
const constants_1 = require("../constants");
|
|
5
|
+
const content_fields_1 = require("../content-fields");
|
|
6
|
+
const utils_1 = require("../utils");
|
|
7
|
+
const ai_agent_1 = require("./ai-agent");
|
|
8
|
+
const knowledge_bases_1 = require("./knowledge-bases");
|
|
9
|
+
const payload_1 = require("./payload");
|
|
10
|
+
async function getContentsByFirstInteraction(context) {
|
|
11
|
+
const { contentID, flowBuilderPlugin, request } = context;
|
|
12
|
+
/*
|
|
13
|
+
* If the contentID is provided, the firstInteractionContents are obtained even if they are not used
|
|
14
|
+
* because when obtain this firstInteractionContents is when the session.flow_thread_id is updated.
|
|
15
|
+
* This is needed for example when send a WhatsApp campaign is sent,
|
|
16
|
+
* the bot not receives the message because this message is sent directly by the backend
|
|
17
|
+
* we expect the bot to respond only with the contents of the contentID and not with the firstInteractionContents.
|
|
18
|
+
*/
|
|
19
|
+
const firstInteractionContents = await flowBuilderPlugin.getStartContents();
|
|
20
|
+
if (contentID) {
|
|
21
|
+
try {
|
|
22
|
+
const contentsByContentID = await flowBuilderPlugin.getContentsByContentID(contentID);
|
|
23
|
+
if (contentsByContentID.length > 0) {
|
|
24
|
+
return contentsByContentID;
|
|
25
25
|
}
|
|
26
|
-
catch (error) {
|
|
27
|
-
console.warn(`The contentID ${contentID} is not found. Returning the firstInteractionContents`);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
/* If the first interaction has a FlowBotAction, it should be the last content
|
|
31
|
-
* and avoid to render the match with keywords,intents or knowledge base
|
|
32
|
-
*/
|
|
33
|
-
if (firstInteractionContents.at(-1) instanceof FlowBotAction) {
|
|
34
|
-
return firstInteractionContents;
|
|
35
26
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return [...firstInteractionContents, ...contentsByUserInput];
|
|
27
|
+
catch (error) {
|
|
28
|
+
console.warn(`The contentID ${contentID} is not found. Returning the firstInteractionContents`);
|
|
39
29
|
}
|
|
30
|
+
}
|
|
31
|
+
/* If the first interaction has a FlowBotAction, it should be the last content
|
|
32
|
+
* and avoid to render the match with keywords,intents or knowledge base
|
|
33
|
+
*/
|
|
34
|
+
if (firstInteractionContents.at(-1) instanceof content_fields_1.FlowBotAction) {
|
|
40
35
|
return firstInteractionContents;
|
|
41
|
-
}
|
|
36
|
+
}
|
|
37
|
+
if (request.input.nluResolution || (0, utils_1.inputHasTextData)(request.input)) {
|
|
38
|
+
const contentsByUserInput = await getContentsByUserInput(context);
|
|
39
|
+
return [...firstInteractionContents, ...contentsByUserInput];
|
|
40
|
+
}
|
|
41
|
+
return firstInteractionContents;
|
|
42
42
|
}
|
|
43
|
-
function getContentsByUserInput(context) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
if (request.input.payload === conversationStartId) {
|
|
52
|
-
return [];
|
|
53
|
-
}
|
|
54
|
-
const contentsByKeywordsOrIntents = yield getContentsByPayload({
|
|
55
|
-
cmsApi,
|
|
56
|
-
flowBuilderPlugin,
|
|
57
|
-
request,
|
|
58
|
-
resolvedLocale,
|
|
59
|
-
});
|
|
60
|
-
const hasRepeatedContent = yield checkRepeatedContents(flowBuilderPlugin, contentsByKeywordsOrIntents);
|
|
61
|
-
if (hasRepeatedContent) {
|
|
62
|
-
return [];
|
|
63
|
-
}
|
|
64
|
-
if (contentsByKeywordsOrIntents.length > 0) {
|
|
65
|
-
return contentsByKeywordsOrIntents;
|
|
66
|
-
}
|
|
43
|
+
async function getContentsByUserInput(context) {
|
|
44
|
+
const { cmsApi, flowBuilderPlugin, request, resolvedLocale } = context;
|
|
45
|
+
const payloadByNlu = request.input.nluResolution?.payload;
|
|
46
|
+
if (payloadByNlu) {
|
|
47
|
+
request.input.payload = payloadByNlu;
|
|
48
|
+
const conversationStartId = getConversationStartId(cmsApi);
|
|
49
|
+
if (request.input.payload === conversationStartId) {
|
|
50
|
+
return [];
|
|
67
51
|
}
|
|
68
|
-
const
|
|
52
|
+
const contentsByKeywordsOrIntents = await (0, payload_1.getContentsByPayload)({
|
|
69
53
|
cmsApi,
|
|
70
54
|
flowBuilderPlugin,
|
|
71
55
|
request,
|
|
72
56
|
resolvedLocale,
|
|
73
57
|
});
|
|
74
|
-
|
|
75
|
-
|
|
58
|
+
const hasRepeatedContent = await checkRepeatedContents(flowBuilderPlugin, contentsByKeywordsOrIntents);
|
|
59
|
+
if (hasRepeatedContent) {
|
|
60
|
+
return [];
|
|
76
61
|
}
|
|
77
|
-
|
|
78
|
-
|
|
62
|
+
if (contentsByKeywordsOrIntents.length > 0) {
|
|
63
|
+
return contentsByKeywordsOrIntents;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
const contentsByKnowledgeBase = await (0, knowledge_bases_1.getContentsByKnowledgeBase)({
|
|
67
|
+
cmsApi,
|
|
68
|
+
flowBuilderPlugin,
|
|
69
|
+
request,
|
|
70
|
+
resolvedLocale,
|
|
79
71
|
});
|
|
72
|
+
if (contentsByKnowledgeBase.length > 0) {
|
|
73
|
+
return contentsByKnowledgeBase;
|
|
74
|
+
}
|
|
75
|
+
const contentsByAiAgent = await (0, ai_agent_1.getContentsByAiAgent)(context);
|
|
76
|
+
return contentsByAiAgent;
|
|
80
77
|
}
|
|
81
78
|
function getConversationStartId(cmsApi) {
|
|
82
|
-
|
|
83
|
-
const conversationStartId = (_a = cmsApi.flow.flows.find(flow => flow.name === MAIN_FLOW_NAME)) === null || _a === void 0 ? void 0 : _a.start_node_id;
|
|
79
|
+
const conversationStartId = cmsApi.flow.flows.find(flow => flow.name === constants_1.MAIN_FLOW_NAME)?.start_node_id;
|
|
84
80
|
return conversationStartId;
|
|
85
81
|
}
|
|
86
|
-
function checkRepeatedContents(flowBuilderPlugin, contentsByKeywordsOrIntents) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
return hasRepeatedContent;
|
|
92
|
-
});
|
|
82
|
+
async function checkRepeatedContents(flowBuilderPlugin, contentsByKeywordsOrIntents) {
|
|
83
|
+
const startContents = await flowBuilderPlugin.getStartContents();
|
|
84
|
+
const contentIds = new Set(contentsByKeywordsOrIntents.map(content => content.id));
|
|
85
|
+
const hasRepeatedContent = startContents.some(content => contentIds.has(content.id));
|
|
86
|
+
return hasRepeatedContent;
|
|
93
87
|
}
|
|
94
88
|
//# sourceMappingURL=first-interaction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"first-interaction.js","sourceRoot":"","sources":["../../../src/action/first-interaction.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"first-interaction.js","sourceRoot":"","sources":["../../../src/action/first-interaction.ts"],"names":[],"mappings":";;AAUA,sEA2CC;AApDD,4CAA6C;AAC7C,sDAA8D;AAE9D,oCAA2C;AAC3C,yCAAiD;AAEjD,uDAA8D;AAC9D,uCAAgD;AAEzC,KAAK,UAAU,6BAA6B,CACjD,OAA2B;IAE3B,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,OAAO,EAAE,GAAG,OAAO,CAAA;IAEzD;;;;;;OAMG;IACH,MAAM,wBAAwB,GAAG,MAAM,iBAAiB,CAAC,gBAAgB,EAAE,CAAA;IAE3E,IAAI,SAAS,EAAE,CAAC;QACd,IAAI,CAAC;YACH,MAAM,mBAAmB,GACvB,MAAM,iBAAiB,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAA;YAE3D,IAAI,mBAAmB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACnC,OAAO,mBAAmB,CAAA;YAC5B,CAAC;QACH,CAAC;QAAC,OAAO,KAAK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