@botonic/plugin-flow-builder 0.56.1 → 0.57.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/api.d.ts +2 -2
- package/lib/cjs/api.js +17 -17
- package/lib/cjs/api.js.map +1 -1
- package/lib/cjs/bot-context-manager.d.ts +17 -0
- package/lib/cjs/bot-context-manager.js +93 -0
- package/lib/cjs/bot-context-manager.js.map +1 -0
- package/lib/cjs/constants.d.ts +2 -1
- package/lib/cjs/constants.js +3 -2
- package/lib/cjs/constants.js.map +1 -1
- package/lib/cjs/content-fields/contact-reasons-conditional-matcher.d.ts +4 -0
- package/lib/cjs/content-fields/contact-reasons-conditional-matcher.js +12 -0
- package/lib/cjs/content-fields/contact-reasons-conditional-matcher.js.map +1 -0
- package/lib/cjs/content-fields/flow-contact-reasons-conditional.d.ts +14 -0
- package/lib/cjs/content-fields/flow-contact-reasons-conditional.js +65 -0
- package/lib/cjs/content-fields/flow-contact-reasons-conditional.js.map +1 -0
- package/lib/cjs/content-fields/flow-handoff.d.ts +7 -1
- package/lib/cjs/content-fields/flow-handoff.js +39 -3
- package/lib/cjs/content-fields/flow-handoff.js.map +1 -1
- package/lib/cjs/content-fields/hubtype-fields/contact-reasons-conditional.d.ts +16 -0
- package/lib/cjs/content-fields/hubtype-fields/contact-reasons-conditional.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/contact-reasons-conditional.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/handoff.d.ts +11 -1
- package/lib/cjs/content-fields/hubtype-fields/handoff.js +7 -0
- package/lib/cjs/content-fields/hubtype-fields/handoff.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 +1 -0
- 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/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/flow-factory.js +2 -0
- package/lib/cjs/flow-factory.js.map +1 -1
- package/lib/cjs/index.d.ts +5 -9
- package/lib/cjs/index.js +16 -67
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/types.d.ts +2 -2
- package/lib/cjs/types.js.map +1 -1
- package/lib/esm/api.d.ts +2 -2
- package/lib/esm/api.js +17 -17
- package/lib/esm/api.js.map +1 -1
- package/lib/esm/bot-context-manager.d.ts +17 -0
- package/lib/esm/bot-context-manager.js +93 -0
- package/lib/esm/bot-context-manager.js.map +1 -0
- package/lib/esm/constants.d.ts +2 -1
- package/lib/esm/constants.js +3 -2
- package/lib/esm/constants.js.map +1 -1
- package/lib/esm/content-fields/contact-reasons-conditional-matcher.d.ts +4 -0
- package/lib/esm/content-fields/contact-reasons-conditional-matcher.js +12 -0
- package/lib/esm/content-fields/contact-reasons-conditional-matcher.js.map +1 -0
- package/lib/esm/content-fields/flow-contact-reasons-conditional.d.ts +14 -0
- package/lib/esm/content-fields/flow-contact-reasons-conditional.js +65 -0
- package/lib/esm/content-fields/flow-contact-reasons-conditional.js.map +1 -0
- package/lib/esm/content-fields/flow-handoff.d.ts +7 -1
- package/lib/esm/content-fields/flow-handoff.js +39 -3
- package/lib/esm/content-fields/flow-handoff.js.map +1 -1
- package/lib/esm/content-fields/hubtype-fields/contact-reasons-conditional.d.ts +16 -0
- package/lib/esm/content-fields/hubtype-fields/contact-reasons-conditional.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/contact-reasons-conditional.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/handoff.d.ts +11 -1
- package/lib/esm/content-fields/hubtype-fields/handoff.js +7 -0
- package/lib/esm/content-fields/hubtype-fields/handoff.js.map +1 -1
- package/lib/esm/content-fields/hubtype-fields/node-types.d.ts +2 -1
- package/lib/esm/content-fields/hubtype-fields/node-types.js +1 -0
- 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/index.d.ts +3 -2
- package/lib/esm/content-fields/index.js +3 -1
- package/lib/esm/content-fields/index.js.map +1 -1
- package/lib/esm/flow-factory.js +2 -0
- package/lib/esm/flow-factory.js.map +1 -1
- package/lib/esm/index.d.ts +5 -9
- package/lib/esm/index.js +16 -67
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/types.d.ts +2 -2
- package/lib/esm/types.js.map +1 -1
- package/package.json +2 -2
- package/src/api.ts +19 -19
- package/src/bot-context-manager.ts +153 -0
- package/src/constants.ts +2 -1
- package/src/content-fields/contact-reasons-conditional-matcher.ts +24 -0
- package/src/content-fields/flow-contact-reasons-conditional.tsx +90 -0
- package/src/content-fields/flow-handoff.tsx +54 -7
- package/src/content-fields/hubtype-fields/contact-reasons-conditional.ts +18 -0
- package/src/content-fields/hubtype-fields/handoff.ts +17 -1
- 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 +7 -0
- package/src/index.ts +26 -117
- package/src/types.ts +1 -2
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { HubtypeCaseContactReason } from '@botonic/core';
|
|
2
|
+
import type { HtContactReasonBranch } from './hubtype-fields/contact-reasons-conditional';
|
|
3
|
+
export declare function contactReasonMatchesBranch(sessionContactReason: HubtypeCaseContactReason, branch: HtContactReasonBranch): boolean;
|
|
4
|
+
export declare function findMatchingContactReasonBranch(sessionContactReasons: HubtypeCaseContactReason[], contactReasonBranches: HtContactReasonBranch[]): HtContactReasonBranch | undefined;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.contactReasonMatchesBranch = contactReasonMatchesBranch;
|
|
4
|
+
exports.findMatchingContactReasonBranch = findMatchingContactReasonBranch;
|
|
5
|
+
function contactReasonMatchesBranch(sessionContactReason, branch) {
|
|
6
|
+
return (sessionContactReason.project_id === branch.project_id &&
|
|
7
|
+
sessionContactReason.name === branch.name);
|
|
8
|
+
}
|
|
9
|
+
function findMatchingContactReasonBranch(sessionContactReasons, contactReasonBranches) {
|
|
10
|
+
return contactReasonBranches.find(branch => sessionContactReasons.some(sessionContactReason => contactReasonMatchesBranch(sessionContactReason, branch)));
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=contact-reasons-conditional-matcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contact-reasons-conditional-matcher.js","sourceRoot":"","sources":["../../../src/content-fields/contact-reasons-conditional-matcher.ts"],"names":[],"mappings":";;AAIA,gEAQC;AAED,0EASC;AAnBD,SAAgB,0BAA0B,CACxC,oBAA8C,EAC9C,MAA6B;IAE7B,OAAO,CACL,oBAAoB,CAAC,UAAU,KAAK,MAAM,CAAC,UAAU;QACrD,oBAAoB,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,CAC1C,CAAA;AACH,CAAC;AAED,SAAgB,+BAA+B,CAC7C,qBAAiD,EACjD,qBAA8C;IAE9C,OAAO,qBAAqB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CACzC,qBAAqB,CAAC,IAAI,CAAC,oBAAoB,CAAC,EAAE,CAChD,0BAA0B,CAAC,oBAAoB,EAAE,MAAM,CAAC,CACzD,CACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type BotContext } from '@botonic/core';
|
|
2
|
+
import { ContentFieldsBase } from './content-fields-base';
|
|
3
|
+
import type { HtNodeLink } from './hubtype-fields/common';
|
|
4
|
+
import type { HtContactReasonBranch, HtContactReasonsNode } from './hubtype-fields/contact-reasons-conditional';
|
|
5
|
+
export declare class FlowContactReasonsConditional extends ContentFieldsBase {
|
|
6
|
+
contactReasons: HtContactReasonBranch[];
|
|
7
|
+
conditionalResult: string;
|
|
8
|
+
defaultTarget: HtNodeLink;
|
|
9
|
+
static fromHubtypeCMS(component: HtContactReasonsNode, botContext: BotContext): FlowContactReasonsConditional;
|
|
10
|
+
private setFollowUp;
|
|
11
|
+
trackFlow(botContext: BotContext): Promise<void>;
|
|
12
|
+
processContent(botContext: BotContext): Promise<void>;
|
|
13
|
+
toBotonic(): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlowContactReasonsConditional = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const core_1 = require("@botonic/core");
|
|
6
|
+
const tracking_1 = require("../tracking");
|
|
7
|
+
const contact_reasons_conditional_matcher_1 = require("./contact-reasons-conditional-matcher");
|
|
8
|
+
const content_fields_base_1 = require("./content-fields-base");
|
|
9
|
+
class FlowContactReasonsConditional extends content_fields_base_1.ContentFieldsBase {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.contactReasons = [];
|
|
13
|
+
this.conditionalResult = '';
|
|
14
|
+
}
|
|
15
|
+
static fromHubtypeCMS(component, botContext) {
|
|
16
|
+
const newContactReasonsConditional = new FlowContactReasonsConditional(component.id);
|
|
17
|
+
newContactReasonsConditional.contactReasons =
|
|
18
|
+
component.content.contact_reasons;
|
|
19
|
+
newContactReasonsConditional.defaultTarget =
|
|
20
|
+
component.content.default_target;
|
|
21
|
+
newContactReasonsConditional.setFollowUp(botContext);
|
|
22
|
+
return newContactReasonsConditional;
|
|
23
|
+
}
|
|
24
|
+
setFollowUp(botContext) {
|
|
25
|
+
const sessionContactReasons = botContext.session._hubtype_case_contact_reasons;
|
|
26
|
+
const matchingBranch = sessionContactReasons
|
|
27
|
+
? (0, contact_reasons_conditional_matcher_1.findMatchingContactReasonBranch)(sessionContactReasons, this.contactReasons)
|
|
28
|
+
: undefined;
|
|
29
|
+
if (matchingBranch) {
|
|
30
|
+
this.conditionalResult = matchingBranch.name;
|
|
31
|
+
this.followUp = matchingBranch.target;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
this.conditionalResult = 'default';
|
|
35
|
+
this.followUp = this.defaultTarget;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
async trackFlow(botContext) {
|
|
39
|
+
const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } = (0, tracking_1.getCommonFlowContentEventArgsForContentId)(botContext, this.id);
|
|
40
|
+
const eventContactReasonsConditional = {
|
|
41
|
+
action: core_1.EventAction.ConditionalContactReasons,
|
|
42
|
+
flowThreadId,
|
|
43
|
+
flowId,
|
|
44
|
+
flowName,
|
|
45
|
+
flowNodeId,
|
|
46
|
+
flowNodeContentId,
|
|
47
|
+
flowNodeIsMeaningful: false,
|
|
48
|
+
contactReasons: botContext.session._hubtype_case_contact_reasons?.map(contactReason => contactReason.name) || [],
|
|
49
|
+
result: this.conditionalResult,
|
|
50
|
+
};
|
|
51
|
+
const { action, ...eventArgs } = eventContactReasonsConditional;
|
|
52
|
+
await (0, tracking_1.trackEvent)(botContext, action, eventArgs);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
async processContent(botContext) {
|
|
56
|
+
await this.filterContent(botContext, this);
|
|
57
|
+
await this.trackFlow(botContext);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
toBotonic() {
|
|
61
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.FlowContactReasonsConditional = FlowContactReasonsConditional;
|
|
65
|
+
//# sourceMappingURL=flow-contact-reasons-conditional.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-contact-reasons-conditional.js","sourceRoot":"","sources":["../../../src/content-fields/flow-contact-reas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UAAU,EAAE,IAAI,CAAC,EAAE,CAAC,CAAA;QAChE,MAAM,8BAA8B,GAAmC;YACrE,MAAM,EAAE,kBAAW,CAAC,yBAAyB;YAC7C,YAAY;YACZ,MAAM;YACN,QAAQ;YACR,UAAU;YACV,iBAAiB;YACjB,oBAAoB,EAAE,KAAK;YAC3B,cAAc,EACZ,UAAU,CAAC,OAAO,CAAC,6BAA6B,EAAE,GAAG,CACnD,aAAa,CAAC,EAAE,CAAC,aAAa,CAAC,IAAI,CACpC,IAAI,EAAE;YACT,MAAM,EAAE,IAAI,CAAC,iBAAiB;SAC/B,CAAA;QACD,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,GAAG,8BAA8B,CAAA;QAC/D,MAAM,IAAA,qBAAU,EAAC,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,CAAA;QAC/C,OAAM;IACR,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,UAAsB;QACzC,MAAM,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;QAC1C,MAAM,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;QAChC,OAAM;IACR,CAAC;IAED,SAAS;QACP,OAAO,kDAAK,CAAA;IACd,CAAC;CACF;AAvED,sEAuEC"}
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import { type BotContext } from '@botonic/core';
|
|
2
2
|
import type { FlowBuilderApi } from '../api';
|
|
3
3
|
import { ContentFieldsBase } from './content-fields-base';
|
|
4
|
-
import type
|
|
4
|
+
import { type HtHandoffNode, type HtNodeLink, type HtQueueLocale } from './hubtype-fields';
|
|
5
5
|
export declare class FlowHandoff extends ContentFieldsBase {
|
|
6
6
|
queue?: HtQueueLocale;
|
|
7
7
|
onFinishPayload?: string;
|
|
8
8
|
handoffAutoAssign: boolean;
|
|
9
9
|
hasQueuePositionChangedNotificationsEnabled: boolean;
|
|
10
|
+
hasDifferentiatedCloseTypes: boolean;
|
|
11
|
+
resolvedByAgent?: HtNodeLink;
|
|
12
|
+
discardedByAgent?: HtNodeLink;
|
|
13
|
+
discardedByUser?: HtNodeLink;
|
|
14
|
+
discardedBySystem?: HtNodeLink;
|
|
10
15
|
isTestIntegration: boolean;
|
|
11
16
|
static fromHubtypeCMS(cmsHandoff: HtHandoffNode, locale: string, cmsApi: FlowBuilderApi): FlowHandoff;
|
|
12
17
|
private static getOnFinishPayload;
|
|
18
|
+
resolveOnClosePayload(botContext: BotContext): string;
|
|
13
19
|
doHandoff(botContext: BotContext): Promise<void>;
|
|
14
20
|
trackFlow(_botContext: BotContext): Promise<void>;
|
|
15
21
|
processContent(botContext: BotContext): Promise<void>;
|
|
@@ -4,26 +4,62 @@ exports.FlowHandoff = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const core_1 = require("@botonic/core");
|
|
6
6
|
const react_1 = require("@botonic/react");
|
|
7
|
+
const constants_1 = require("../constants");
|
|
7
8
|
const tracking_1 = require("../tracking");
|
|
8
9
|
const content_fields_base_1 = require("./content-fields-base");
|
|
10
|
+
const hubtype_fields_1 = require("./hubtype-fields");
|
|
9
11
|
class FlowHandoff extends content_fields_base_1.ContentFieldsBase {
|
|
10
12
|
static fromHubtypeCMS(cmsHandoff, locale, cmsApi) {
|
|
11
13
|
const newHandoff = new FlowHandoff(cmsHandoff.id);
|
|
12
14
|
newHandoff.code = cmsHandoff.code;
|
|
13
15
|
newHandoff.queue = FlowHandoff.getQueueByLocale(locale, cmsHandoff.content.queue);
|
|
14
|
-
newHandoff.
|
|
16
|
+
newHandoff.hasDifferentiatedCloseTypes =
|
|
17
|
+
cmsHandoff.content.has_differentiated_close_types;
|
|
18
|
+
newHandoff.resolvedByAgent = cmsHandoff.content.resolved_by_agent;
|
|
19
|
+
newHandoff.discardedByAgent = cmsHandoff.content.discarded_by_agent;
|
|
20
|
+
newHandoff.discardedByUser = cmsHandoff.content.discarded_by_user;
|
|
21
|
+
newHandoff.discardedBySystem = cmsHandoff.content.discarded_by_system;
|
|
15
22
|
newHandoff.handoffAutoAssign = cmsHandoff.content.has_auto_assign;
|
|
16
23
|
newHandoff.hasQueuePositionChangedNotificationsEnabled =
|
|
17
24
|
cmsHandoff.content.has_queue_position_changed_notifications_enabled;
|
|
18
|
-
newHandoff.
|
|
25
|
+
newHandoff.onFinishPayload = FlowHandoff.getOnFinishPayload(cmsHandoff, cmsApi);
|
|
26
|
+
newHandoff.followUp = undefined;
|
|
19
27
|
return newHandoff;
|
|
20
28
|
}
|
|
21
29
|
static getOnFinishPayload(cmsHandoff, cmsApi) {
|
|
22
|
-
if (cmsHandoff.
|
|
30
|
+
if (cmsHandoff.content.has_differentiated_close_types) {
|
|
31
|
+
return `${constants_1.ON_CLOSE_HANDOFF_PAYLOAD}${constants_1.SEPARATOR}${cmsHandoff.id}`;
|
|
32
|
+
}
|
|
33
|
+
else if (cmsHandoff.target?.id) {
|
|
23
34
|
return cmsApi.getPayload(cmsHandoff.target);
|
|
24
35
|
}
|
|
25
36
|
return undefined;
|
|
26
37
|
}
|
|
38
|
+
resolveOnClosePayload(botContext) {
|
|
39
|
+
const contactReasons = botContext.session._hubtype_case_contact_reasons || [];
|
|
40
|
+
if (contactReasons.some(reason => reason.name === hubtype_fields_1.DiscardType.ByAgent)) {
|
|
41
|
+
if (this.discardedByAgent?.id) {
|
|
42
|
+
return this.discardedByAgent.id;
|
|
43
|
+
}
|
|
44
|
+
console.error('No discarded by agent target found');
|
|
45
|
+
}
|
|
46
|
+
if (contactReasons.some(reason => reason.name === hubtype_fields_1.DiscardType.ByUser)) {
|
|
47
|
+
if (this.discardedByUser?.id) {
|
|
48
|
+
return this.discardedByUser.id;
|
|
49
|
+
}
|
|
50
|
+
console.error('No discarded by user target found');
|
|
51
|
+
}
|
|
52
|
+
if (contactReasons.some(reason => reason.name === hubtype_fields_1.DiscardType.BySystem)) {
|
|
53
|
+
if (this.discardedBySystem?.id) {
|
|
54
|
+
return this.discardedBySystem.id;
|
|
55
|
+
}
|
|
56
|
+
console.error('No discarded by system target found');
|
|
57
|
+
}
|
|
58
|
+
if (this.resolvedByAgent?.id) {
|
|
59
|
+
return this.resolvedByAgent.id;
|
|
60
|
+
}
|
|
61
|
+
throw new Error('No resolved by agent target found');
|
|
62
|
+
}
|
|
27
63
|
async doHandoff(botContext) {
|
|
28
64
|
const handOffBuilder = new core_1.HandOffBuilder(botContext.session);
|
|
29
65
|
handOffBuilder.withAutoAssignOnWaiting(this.handoffAutoAssign);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-handoff.js","sourceRoot":"","sources":["../../../src/content-fields/flow-handoff.tsx"],"names":[],"mappings":";;;;AAAA,wCAMsB;AACtB,0CAAgD;
|
|
1
|
+
{"version":3,"file":"flow-handoff.js","sourceRoot":"","sources":["../../../src/content-fields/flow-handoff.tsx"],"names":[],"mappings":";;;;AAAA,wCAMsB;AACtB,0CAAgD;AAEhD,4CAAkE;AAClE,0CAAuE;AACvE,+DAAyD;AACzD,qDAKyB;AAEzB,MAAa,WAAY,SAAQ,uCAAiB;IAYhD,MAAM,CAAC,cAAc,CACnB,UAAyB,EACzB,MAAc,EACd,MAAsB;QAEtB,MAAM,UAAU,GAAG,IAAI,WAAW,CAAC,UAAU,CAAC,EAAE,CAAC,CAAA;QACjD,UAAU,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAA;QACjC,UAAU,CAAC,KAAK,GAAG,WAAW,CAAC,gBAAgB,CAC7C,MAAM,EACN,UAAU,CAAC,OAAO,CAAC,KAAK,CACzB,CAAA;QACD,UAAU,CAAC,2BAA2B;YACpC,UAAU,CAAC,OAAO,CAAC,8BAA8B,CAAA;QACnD,UAAU,CAAC,eAAe,GAAG,UAAU,CAAC,OAAO,CAAC,iBAAiB,CAAA;QACjE,UAAU,CAAC,gBAAgB,GAAG,UAAU,CAAC,OAAO,CAAC,kBAAkB,CAAA;QACnE,UAAU,CAAC,eAAe,GAAG,UAAU,CAAC,OAAO,CAAC,iBAAiB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C,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;YAEvC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,iBAAiB,EAAE,GACvD,IAAA,oDAAyC,EAAC,UAAU,EAAE,IAAI,CAAC,EAAE,CAAC,CAAA;YAEhE,cAAc,CAAC,YAAY,CAAC;gBAC1B,MAAM;gBACN,QAAQ;gBACR,UAAU;gBACV,iBAAiB;aAClB,CAAC,CAAA;YAEF,cAAc,CAAC,aAAa,CAAC;gBAC3B,QAAQ;aACT,CAAC,CAAA;YAEF,MAAM,cAAc,CAAC,OAAO,EAAE,CAAA;QAChC,CAAC;IACH,CAAC;IAED,6DAA6D;IAC7D,KAAK,CAAC,SAAS,CAAC,WAAuB;QACrC,+EAA+E;IACjF,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,UAAsB;QACzC,MAAM,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;QAC1C,MAAM,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;QAChC,OAAM;IACR,CAAC;IAED,SAAS,CAAC,UAAsB;QAC9B,OAAO,IAAA,YAAK,EAAC,UAAU,CAAC,OAAO,CAAC,IAAI,IAAA,gBAAS,EAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAClE,uBAAC,uBAAe,IAAe,eAAe,EAAE,IAAI,IAA9B,IAAI,CAAC,EAAE,CAA2B,CACzD,CAAC,CAAC,CAAC,CACF,kDAAK,CACN,CAAA;IACH,CAAC;CACF;AA1ID,kCA0IC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { HtBaseNode, HtNodeLink } from './common';
|
|
2
|
+
import type { HtNodeWithContentType } from './node-types';
|
|
3
|
+
export interface HtContactReasonBranch {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
project_id: string;
|
|
7
|
+
project_name: string;
|
|
8
|
+
target: HtNodeLink;
|
|
9
|
+
}
|
|
10
|
+
export interface HtContactReasonsNode extends HtBaseNode {
|
|
11
|
+
type: HtNodeWithContentType.CONTACT_REASONS_CONDITION;
|
|
12
|
+
content: {
|
|
13
|
+
contact_reasons: HtContactReasonBranch[];
|
|
14
|
+
default_target: HtNodeLink;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contact-reasons-conditional.js","sourceRoot":"","sources":["../../../../src/content-fields/hubtype-fields/contact-reasons-conditional.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import type { HtBaseNode, HtPayloadLocale, HtQueueLocale } from './common';
|
|
1
|
+
import type { HtBaseNode, HtNodeLink, HtPayloadLocale, HtQueueLocale } from './common';
|
|
2
2
|
import type { HtNodeWithContentType } from './node-types';
|
|
3
|
+
export declare enum DiscardType {
|
|
4
|
+
ByAgent = "discarded",
|
|
5
|
+
ByUser = "discarded_by_user",
|
|
6
|
+
BySystem = "discarded_by_system"
|
|
7
|
+
}
|
|
3
8
|
export interface HtHandoffNode extends HtBaseNode {
|
|
4
9
|
type: HtNodeWithContentType.HANDOFF;
|
|
5
10
|
content: {
|
|
@@ -7,5 +12,10 @@ export interface HtHandoffNode extends HtBaseNode {
|
|
|
7
12
|
payload: HtPayloadLocale[];
|
|
8
13
|
has_auto_assign: boolean;
|
|
9
14
|
has_queue_position_changed_notifications_enabled: boolean;
|
|
15
|
+
has_differentiated_close_types: boolean;
|
|
16
|
+
resolved_by_agent?: HtNodeLink;
|
|
17
|
+
discarded_by_agent?: HtNodeLink;
|
|
18
|
+
discarded_by_user?: HtNodeLink;
|
|
19
|
+
discarded_by_system?: HtNodeLink;
|
|
10
20
|
};
|
|
11
21
|
}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DiscardType = void 0;
|
|
4
|
+
var DiscardType;
|
|
5
|
+
(function (DiscardType) {
|
|
6
|
+
DiscardType["ByAgent"] = "discarded";
|
|
7
|
+
DiscardType["ByUser"] = "discarded_by_user";
|
|
8
|
+
DiscardType["BySystem"] = "discarded_by_system";
|
|
9
|
+
})(DiscardType || (exports.DiscardType = DiscardType = {}));
|
|
3
10
|
//# sourceMappingURL=handoff.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handoff.js","sourceRoot":"","sources":["../../../../src/content-fields/hubtype-fields/handoff.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"handoff.js","sourceRoot":"","sources":["../../../../src/content-fields/hubtype-fields/handoff.ts"],"names":[],"mappings":";;;AAQA,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,oCAAqB,CAAA;IACrB,2CAA4B,CAAA;IAC5B,+CAAgC,CAAA;AAClC,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB"}
|
|
@@ -20,7 +20,8 @@ export declare enum HtNodeWithContentType {
|
|
|
20
20
|
GO_TO_FLOW = "go-to-flow",
|
|
21
21
|
CAPTURE_USER_INPUT = "capture-user-input",
|
|
22
22
|
CUSTOM_CONDITION = "custom-condition",
|
|
23
|
-
DO_NOTHING = "do-nothing"
|
|
23
|
+
DO_NOTHING = "do-nothing",
|
|
24
|
+
CONTACT_REASONS_CONDITION = "contact-reasons-condition"
|
|
24
25
|
}
|
|
25
26
|
export declare enum HtNodeWithoutContentType {
|
|
26
27
|
URL = "url",
|
|
@@ -25,6 +25,7 @@ var HtNodeWithContentType;
|
|
|
25
25
|
HtNodeWithContentType["CAPTURE_USER_INPUT"] = "capture-user-input";
|
|
26
26
|
HtNodeWithContentType["CUSTOM_CONDITION"] = "custom-condition";
|
|
27
27
|
HtNodeWithContentType["DO_NOTHING"] = "do-nothing";
|
|
28
|
+
HtNodeWithContentType["CONTACT_REASONS_CONDITION"] = "contact-reasons-condition";
|
|
28
29
|
})(HtNodeWithContentType || (exports.HtNodeWithContentType = HtNodeWithContentType = {}));
|
|
29
30
|
var HtNodeWithoutContentType;
|
|
30
31
|
(function (HtNodeWithoutContentType) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-types.js","sourceRoot":"","sources":["../../../../src/content-fields/hubtype-fields/node-types.ts"],"names":[],"mappings":";;;AAAA,IAAY,
|
|
1
|
+
{"version":3,"file":"node-types.js","sourceRoot":"","sources":["../../../../src/content-fields/hubtype-fields/node-types.ts"],"names":[],"mappings":";;;AAAA,IAAY,qBAwBX;AAxBD,WAAY,qBAAqB;IAC/B,8CAAqB,CAAA;IACrB,4CAAmB,CAAA;IACnB,wCAAe,CAAA;IACf,sCAAa,CAAA;IACb,4CAAmB,CAAA;IACnB,sDAA6B,CAAA;IAC7B,8CAAqB,CAAA;IACrB,8CAAqB,CAAA;IACrB,wCAAe,CAAA;IACf,sEAA6C,CAAA;IAC7C,4EAAmD,CAAA;IACnD,wFAA+D,CAAA;IAC/D,gEAAuC,CAAA;IACvC,kDAAyB,CAAA;IACzB,8CAAqB,CAAA;IACrB,4DAAmC,CAAA;IACnC,0CAAiB,CAAA;IACjB,4CAAmB,CAAA;IACnB,kDAAyB,CAAA;IACzB,kEAAyC,CAAA;IACzC,8DAAqC,CAAA;IACrC,kDAAyB,CAAA;IACzB,gFAAuD,CAAA;AACzD,CAAC,EAxBW,qBAAqB,qCAArB,qBAAqB,QAwBhC;AAED,IAAY,wBAGX;AAHD,WAAY,wBAAwB;IAClC,uCAAW,CAAA;IACX,+CAAmB,CAAA;AACrB,CAAC,EAHW,wBAAwB,wCAAxB,wBAAwB,QAGnC;AAED,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,kCAAiB,CAAA;IACjB,4CAA2B,CAAA;AAC7B,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB"}
|
|
@@ -3,6 +3,7 @@ import type { HtAiAgentRouterNode } from './ai-agent-router';
|
|
|
3
3
|
import type { HtBotActionNode } from './bot-action';
|
|
4
4
|
import type { HtCaptureUserInputNode } from './capture-user-input';
|
|
5
5
|
import type { HtCarouselNode } from './carousel';
|
|
6
|
+
import type { HtContactReasonsNode } from './contact-reasons-conditional';
|
|
6
7
|
import type { HtCustomConditionalV2Node } from './custom-conditional-v2';
|
|
7
8
|
import type { HtDoNothingNode } from './do-nothing';
|
|
8
9
|
import type { HtFallbackNode } from './fallback';
|
|
@@ -22,6 +23,6 @@ import type { HtWhatsappButtonListNode } from './whatsapp-button-list';
|
|
|
22
23
|
import type { HtWhatsappCTAUrlButtonNode } from './whatsapp-cta-url-button';
|
|
23
24
|
import type { HtWhatsappRequestContactInfoNode } from './whatsapp-request-contact-info';
|
|
24
25
|
import type { HtWhatsappTemplateNode } from './whatsapp-template';
|
|
25
|
-
export type HtNodeWithContent = HtTextNode | HtImageNode | HtVideoNode | HtCarouselNode | HtHandoffNode | HtKeywordNode | HtFunctionNode | HtFallbackNode | HtWhatsappButtonListNode | HtWhatsappCTAUrlButtonNode | HtWhatsappRequestContactInfoNode | HtSmartIntentNode | HtBotActionNode | HtAiAgentNode | HtAiAgentRouterNode | HtRatingNode | HtWebviewNode | HtGoToFlow | HtWhatsappTemplateNode | HtCaptureUserInputNode | HtCustomConditionalV2Node | HtDoNothingNode;
|
|
26
|
+
export type HtNodeWithContent = HtTextNode | HtImageNode | HtVideoNode | HtCarouselNode | HtHandoffNode | HtKeywordNode | HtFunctionNode | HtFallbackNode | HtWhatsappButtonListNode | HtWhatsappCTAUrlButtonNode | HtWhatsappRequestContactInfoNode | HtSmartIntentNode | HtBotActionNode | HtAiAgentNode | HtAiAgentRouterNode | HtRatingNode | HtWebviewNode | HtGoToFlow | HtWhatsappTemplateNode | HtCaptureUserInputNode | HtCustomConditionalV2Node | HtDoNothingNode | HtContactReasonsNode;
|
|
26
27
|
export type HtNodeWithoutContent = HtUrlNode | HtPayloadNode;
|
|
27
28
|
export type HtNodeComponent = HtNodeWithContent | HtNodeWithoutContent;
|
|
@@ -5,6 +5,7 @@ import { FlowBotAction } from './flow-bot-action';
|
|
|
5
5
|
import { FlowCaptureUserInput } from './flow-capture-user-input';
|
|
6
6
|
import { FlowCarousel } from './flow-carousel';
|
|
7
7
|
import { FlowChannelConditional } from './flow-channel-conditional';
|
|
8
|
+
import { FlowContactReasonsConditional } from './flow-contact-reasons-conditional';
|
|
8
9
|
import { FlowCountryConditional } from './flow-country-conditional';
|
|
9
10
|
import { FlowCustomConditional } from './flow-custom-conditional';
|
|
10
11
|
import { FlowDoNothing } from './flow-do-nothing';
|
|
@@ -22,5 +23,5 @@ import { FlowWhatsappButtonList, FlowWhatsappButtonListRow, FlowWhatsappButtonLi
|
|
|
22
23
|
export { ContentFieldsBase } from './content-fields-base';
|
|
23
24
|
export { FlowButton } from './flow-button';
|
|
24
25
|
export { FlowElement } from './flow-element';
|
|
25
|
-
export { FlowAiAgent, FlowAiAgentRouter, FlowBotAction, FlowCaptureUserInput, FlowCarousel, FlowChannelConditional, FlowCountryConditional, FlowCustomConditional, FlowCustomConditionalV2, FlowDoNothing, FlowGoToFlow, FlowHandoff, FlowImage, FlowQueueStatusConditional, FlowRating, FlowText, FlowVideo, FlowWhatsappButtonList, FlowWhatsappButtonListRow, FlowWhatsappButtonListSection, FlowWhatsappCtaUrlButtonNode, FlowWhatsappRequestContactInfoNode, FlowWhatsappTemplate, };
|
|
26
|
-
export type FlowContent = FlowCarousel | FlowImage | FlowText | FlowVideo | FlowWhatsappButtonList | FlowWhatsappCtaUrlButtonNode | FlowWhatsappRequestContactInfoNode | FlowWhatsappTemplate | FlowHandoff | FlowBotAction | FlowAiAgent | FlowRating | FlowCountryConditional | FlowChannelConditional | FlowQueueStatusConditional | FlowCustomConditional | FlowGoToFlow | FlowCaptureUserInput | FlowAiAgentRouter | FlowCustomConditionalV2 | FlowDoNothing;
|
|
26
|
+
export { FlowAiAgent, FlowAiAgentRouter, FlowBotAction, FlowCaptureUserInput, FlowCarousel, FlowChannelConditional, FlowContactReasonsConditional, FlowCountryConditional, FlowCustomConditional, FlowCustomConditionalV2, FlowDoNothing, FlowGoToFlow, FlowHandoff, FlowImage, FlowQueueStatusConditional, FlowRating, FlowText, FlowVideo, FlowWhatsappButtonList, FlowWhatsappButtonListRow, FlowWhatsappButtonListSection, FlowWhatsappCtaUrlButtonNode, FlowWhatsappRequestContactInfoNode, FlowWhatsappTemplate, };
|
|
27
|
+
export type FlowContent = FlowCarousel | FlowImage | FlowText | FlowVideo | FlowWhatsappButtonList | FlowWhatsappCtaUrlButtonNode | FlowWhatsappRequestContactInfoNode | FlowWhatsappTemplate | FlowHandoff | FlowBotAction | FlowAiAgent | FlowRating | FlowCountryConditional | FlowChannelConditional | FlowQueueStatusConditional | FlowCustomConditional | FlowGoToFlow | FlowCaptureUserInput | FlowAiAgentRouter | FlowCustomConditionalV2 | FlowDoNothing | FlowContactReasonsConditional;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FlowWhatsappTemplate = exports.FlowWhatsappRequestContactInfoNode = exports.FlowWhatsappCtaUrlButtonNode = exports.FlowWhatsappButtonListSection = exports.FlowWhatsappButtonListRow = exports.FlowWhatsappButtonList = exports.FlowVideo = exports.FlowText = exports.FlowRating = exports.FlowQueueStatusConditional = exports.FlowImage = exports.FlowHandoff = exports.FlowGoToFlow = exports.FlowDoNothing = exports.FlowCustomConditionalV2 = exports.FlowCustomConditional = exports.FlowCountryConditional = exports.FlowChannelConditional = exports.FlowCarousel = exports.FlowCaptureUserInput = exports.FlowBotAction = exports.FlowAiAgentRouter = exports.FlowAiAgent = exports.FlowElement = exports.FlowButton = exports.ContentFieldsBase = void 0;
|
|
3
|
+
exports.FlowWhatsappTemplate = exports.FlowWhatsappRequestContactInfoNode = exports.FlowWhatsappCtaUrlButtonNode = exports.FlowWhatsappButtonListSection = exports.FlowWhatsappButtonListRow = exports.FlowWhatsappButtonList = exports.FlowVideo = exports.FlowText = exports.FlowRating = exports.FlowQueueStatusConditional = exports.FlowImage = exports.FlowHandoff = exports.FlowGoToFlow = exports.FlowDoNothing = exports.FlowCustomConditionalV2 = exports.FlowCustomConditional = exports.FlowCountryConditional = exports.FlowContactReasonsConditional = exports.FlowChannelConditional = exports.FlowCarousel = exports.FlowCaptureUserInput = exports.FlowBotAction = exports.FlowAiAgentRouter = exports.FlowAiAgent = exports.FlowElement = exports.FlowButton = exports.ContentFieldsBase = void 0;
|
|
4
4
|
const flow_custom_condition_v2_1 = require("./custom-conditional/flow-custom-condition-v2");
|
|
5
5
|
Object.defineProperty(exports, "FlowCustomConditionalV2", { enumerable: true, get: function () { return flow_custom_condition_v2_1.FlowCustomConditionalV2; } });
|
|
6
6
|
const flow_ai_agent_1 = require("./flow-ai-agent");
|
|
@@ -15,6 +15,8 @@ const flow_carousel_1 = require("./flow-carousel");
|
|
|
15
15
|
Object.defineProperty(exports, "FlowCarousel", { enumerable: true, get: function () { return flow_carousel_1.FlowCarousel; } });
|
|
16
16
|
const flow_channel_conditional_1 = require("./flow-channel-conditional");
|
|
17
17
|
Object.defineProperty(exports, "FlowChannelConditional", { enumerable: true, get: function () { return flow_channel_conditional_1.FlowChannelConditional; } });
|
|
18
|
+
const flow_contact_reasons_conditional_1 = require("./flow-contact-reasons-conditional");
|
|
19
|
+
Object.defineProperty(exports, "FlowContactReasonsConditional", { enumerable: true, get: function () { return flow_contact_reasons_conditional_1.FlowContactReasonsConditional; } });
|
|
18
20
|
const flow_country_conditional_1 = require("./flow-country-conditional");
|
|
19
21
|
Object.defineProperty(exports, "FlowCountryConditional", { enumerable: true, get: function () { return flow_country_conditional_1.FlowCountryConditional; } });
|
|
20
22
|
const flow_custom_conditional_1 = require("./flow-custom-conditional");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/content-fields/index.ts"],"names":[],"mappings":";;;AAAA,4FAAuF;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/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,UAAU,OAAA;AACnB,+CAA4C;AAAnC,2GAAA,WAAW,OAAA"}
|
package/lib/esm/flow-factory.js
CHANGED
|
@@ -48,6 +48,8 @@ class FlowFactory {
|
|
|
48
48
|
return content_fields_1.FlowCustomConditionalV2.fromHubtypeCMS(hubtypeContent, this.botContext);
|
|
49
49
|
case hubtype_fields_1.HtNodeWithContentType.DO_NOTHING:
|
|
50
50
|
return content_fields_1.FlowDoNothing.fromHubtypeCMS(hubtypeContent);
|
|
51
|
+
case hubtype_fields_1.HtNodeWithContentType.CONTACT_REASONS_CONDITION:
|
|
52
|
+
return content_fields_1.FlowContactReasonsConditional.fromHubtypeCMS(hubtypeContent, this.botContext);
|
|
51
53
|
default:
|
|
52
54
|
return undefined;
|
|
53
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-factory.js","sourceRoot":"","sources":["../../src/flow-factory.ts"],"names":[],"mappings":";;;AAGA,
|
|
1
|
+
{"version":3,"file":"flow-factory.js","sourceRoot":"","sources":["../../src/flow-factory.ts"],"names":[],"mappings":";;;AAGA,qDAuByB;AACzB,sFAA+E;AAC/E,oEAIwC;AAExC,MAAa,WAAW;IAKtB,YAAY,UAAsB,EAAE,MAAsB,EAAE,MAAc;QACxE,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED,KAAK,CAAC,cAAc,CAClB,cAA+B;QAE/B,QAAQ,cAAc,CAAC,IAAI,EAAE,CAAC;YAC5B,KAAK,sCAAqB,CAAC,IAAI;gBAC7B,OAAO,yBAAQ,CAAC,cAAc,CAC5B,cAAc,EACd,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,UAAU,CAChB,CAAA;YACH,KAAK,sCAAqB,CAAC,KAAK;gBAC9B,OAAO,0BAAS,CAAC,cAAc,CAAC,cAA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c,CAC9C,cAAc,EACd,IAAI,CAAC,MAAM,CACZ,CAAA;YACH,KAAK,oBAAoB;gBACvB,OAAO,sCAAqB,CAAC,cAAc,CACzC,cAAc,EACd,IAAI,CAAC,UAAU,CAChB,CAAA;YACH;gBACE,OAAO,SAAS,CAAA;QACpB,CAAC;IACH,CAAC;CACF;AAlID,kCAkIC"}
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { BotContext, Plugin, ResolvedPlugins, Session } from '@botonic/core';
|
|
2
2
|
import { FlowBuilderApi } from './api';
|
|
3
3
|
import type { FlowContent } from './content-fields';
|
|
4
4
|
import { type HtNodeWithContent } from './content-fields/hubtype-fields';
|
|
@@ -8,7 +8,7 @@ export default class BotonicPluginFlowBuilder implements Plugin {
|
|
|
8
8
|
cmsApi: FlowBuilderApi;
|
|
9
9
|
private flow?;
|
|
10
10
|
private functions;
|
|
11
|
-
private
|
|
11
|
+
private botContext;
|
|
12
12
|
getAccessToken: (session: Session) => string;
|
|
13
13
|
trackEvent?: TrackEventFunction;
|
|
14
14
|
getAiAgentResponse?: AiAgentFunction;
|
|
@@ -20,13 +20,9 @@ export default class BotonicPluginFlowBuilder implements Plugin {
|
|
|
20
20
|
customRatingMessageEnabled: boolean;
|
|
21
21
|
disableAIAgentInFirstInteraction: boolean;
|
|
22
22
|
constructor(options: BotonicPluginFlowBuilderOptions<ResolvedPlugins, any>);
|
|
23
|
-
resolveFlowUrl(
|
|
24
|
-
pre(
|
|
25
|
-
|
|
26
|
-
private convertWhatsappAiAgentEmptyPayloads;
|
|
27
|
-
private updateRequestBeforeRoutes;
|
|
28
|
-
private removeSourceSuffix;
|
|
29
|
-
post(request: PluginPreRequest): void;
|
|
23
|
+
resolveFlowUrl(botContext: BotContext): string;
|
|
24
|
+
pre(botContext: BotContext): Promise<void>;
|
|
25
|
+
post(botContext: BotContext): void;
|
|
30
26
|
getContentsByContentID(contentID: string, prevContents?: FlowContent[]): Promise<FlowContent[]>;
|
|
31
27
|
getUUIDByContentID(contentID: string): string;
|
|
32
28
|
private getContentsById;
|
package/lib/esm/index.js
CHANGED
|
@@ -2,17 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FlowBuilderJSONVersion = exports.trackFlowContent = exports.getCommonFlowContentEventArgsForContentId = exports.EMPTY_PAYLOAD = exports.AGENT_RATING_PAYLOAD = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const core_1 = require("@botonic/core");
|
|
6
5
|
const uuid_1 = require("uuid");
|
|
7
6
|
const api_1 = require("./api");
|
|
7
|
+
const bot_context_manager_1 = require("./bot-context-manager");
|
|
8
8
|
const constants_1 = require("./constants");
|
|
9
9
|
const hubtype_fields_1 = require("./content-fields/hubtype-fields");
|
|
10
10
|
const flow_factory_1 = require("./flow-factory");
|
|
11
11
|
const functions_1 = require("./functions");
|
|
12
12
|
const types_1 = require("./types");
|
|
13
|
-
const user_input_1 = require("./user-input");
|
|
14
13
|
const authentication_1 = require("./utils/authentication");
|
|
15
|
-
const input_1 = require("./utils/input");
|
|
16
14
|
// TODO: Create a proper service to wrap all calls and allow api versioning
|
|
17
15
|
class BotonicPluginFlowBuilder {
|
|
18
16
|
constructor(options) {
|
|
@@ -39,76 +37,27 @@ class BotonicPluginFlowBuilder {
|
|
|
39
37
|
this.disableAIAgentInFirstInteraction =
|
|
40
38
|
options.disableAIAgentInFirstInteraction || false;
|
|
41
39
|
}
|
|
42
|
-
resolveFlowUrl(
|
|
43
|
-
if (
|
|
40
|
+
resolveFlowUrl(botContext) {
|
|
41
|
+
if (botContext.session.is_test_integration) {
|
|
44
42
|
return `${this.apiUrl}/v1/bot_flows/{bot_id}/versions/${types_1.FlowBuilderJSONVersion.DRAFT}/`;
|
|
45
43
|
}
|
|
46
44
|
return `${this.apiUrl}/v1/bot_flows/{bot_id}/versions/${this.jsonVersion}/`;
|
|
47
45
|
}
|
|
48
|
-
async pre(
|
|
49
|
-
|
|
50
|
-
this.convertWhatsappAiAgentEmptyPayloads(request);
|
|
51
|
-
this.currentRequest = request;
|
|
46
|
+
async pre(botContext) {
|
|
47
|
+
this.botContext = botContext;
|
|
52
48
|
this.cmsApi = await api_1.FlowBuilderApi.create({
|
|
53
|
-
flowUrl: this.resolveFlowUrl(
|
|
49
|
+
flowUrl: this.resolveFlowUrl(botContext),
|
|
54
50
|
url: this.apiUrl,
|
|
55
51
|
flow: this.flow,
|
|
56
|
-
accessToken: this.getAccessToken(
|
|
57
|
-
|
|
52
|
+
accessToken: this.getAccessToken(botContext.session),
|
|
53
|
+
botContext: this.botContext,
|
|
58
54
|
});
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
this.resolveWhatsappContactRequestPayload(request);
|
|
63
|
-
const checkUserTextInput = (0, input_1.inputHasTextOrTranscript)(request.input) && !request.input.payload;
|
|
64
|
-
if (checkUserTextInput) {
|
|
65
|
-
const resolvedLocale = this.cmsApi.getResolvedLocale();
|
|
66
|
-
const nextPayload = await (0, user_input_1.getNextPayloadByUserInput)(this.cmsApi, resolvedLocale, request, this.smartIntentsConfig);
|
|
67
|
-
request.input.payload = nextPayload;
|
|
68
|
-
}
|
|
69
|
-
await this.updateRequestBeforeRoutes(request);
|
|
70
|
-
}
|
|
71
|
-
resolveWhatsappContactRequestPayload(request) {
|
|
72
|
-
if (request.input.type !== core_1.INPUT.CONTACT ||
|
|
73
|
-
request.input.origin !== core_1.WhatsappInputOrigin.ContactRequest) {
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
const whatsappRequestContactInfoNode = this.cmsApi.getWhatsappRequestContactInfoNode();
|
|
77
|
-
if (whatsappRequestContactInfoNode) {
|
|
78
|
-
request.input.payload = this.cmsApi.getPayload(whatsappRequestContactInfoNode.content.button.target);
|
|
79
|
-
}
|
|
80
|
-
this.cmsApi.removeWhatsappRequestContactId();
|
|
81
|
-
}
|
|
82
|
-
convertWhatsappAiAgentEmptyPayloads(request) {
|
|
83
|
-
if (request.session.user.provider === core_1.PROVIDER.WHATSAPP) {
|
|
84
|
-
const shouldUseReferral = request.input.referral &&
|
|
85
|
-
request.input.payload?.startsWith(constants_1.EMPTY_PAYLOAD);
|
|
86
|
-
if (shouldUseReferral) {
|
|
87
|
-
request.input.type = core_1.INPUT.TEXT;
|
|
88
|
-
request.input.data = request.input.referral;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
async updateRequestBeforeRoutes(request) {
|
|
93
|
-
this.cmsApi.removeCaptureUserInputId();
|
|
94
|
-
if (request.input.payload) {
|
|
95
|
-
request.input.payload = this.removeSourceSuffix(request.input.payload);
|
|
96
|
-
if (this.cmsApi.isBotAction(request.input.payload)) {
|
|
97
|
-
const cmsBotAction = this.cmsApi.getNodeById(request.input.payload);
|
|
98
|
-
request.input.payload =
|
|
99
|
-
this.cmsApi.createPayloadWithParams(cmsBotAction);
|
|
100
|
-
// Re-execute convertWhatsappAiAgentEmptyPayloads function to handle
|
|
101
|
-
// the case that a BotAction has a payload equals to EMPTY_PAYLOAD
|
|
102
|
-
this.convertWhatsappAiAgentEmptyPayloads(request);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
removeSourceSuffix(payload) {
|
|
107
|
-
return payload.split(constants_1.SOURCE_INFO_SEPARATOR)[0];
|
|
55
|
+
const botContextManager = new bot_context_manager_1.BotContextManager(this.cmsApi, this.smartIntentsConfig);
|
|
56
|
+
await botContextManager.prepareInputForRoutes(botContext);
|
|
108
57
|
}
|
|
109
|
-
post(
|
|
110
|
-
|
|
111
|
-
delete
|
|
58
|
+
post(botContext) {
|
|
59
|
+
botContext.input.nluResolution = undefined;
|
|
60
|
+
delete botContext.session.user.system_locale_updated;
|
|
112
61
|
}
|
|
113
62
|
async getContentsByContentID(contentID, prevContents) {
|
|
114
63
|
const node = this.cmsApi.getNodeByContentID(contentID);
|
|
@@ -124,7 +73,7 @@ class BotonicPluginFlowBuilder {
|
|
|
124
73
|
}
|
|
125
74
|
async getStartContents() {
|
|
126
75
|
const startNode = this.cmsApi.getStartNode();
|
|
127
|
-
this.
|
|
76
|
+
this.botContext.session.flow_thread_id = (0, uuid_1.v7)();
|
|
128
77
|
return await this.getContentsByNode(startNode);
|
|
129
78
|
}
|
|
130
79
|
async getContentsByNode(node, prevContents) {
|
|
@@ -132,11 +81,11 @@ class BotonicPluginFlowBuilder {
|
|
|
132
81
|
const resolvedLocale = this.cmsApi.getResolvedLocale();
|
|
133
82
|
if (node.type === hubtype_fields_1.HtNodeWithContentType.FUNCTION &&
|
|
134
83
|
!functions_1.DEFAULT_FUNCTION_NAMES.includes(node.content.action)) {
|
|
135
|
-
const customFunctionResolver = new functions_1.CustomFunction(this.functions, this.
|
|
84
|
+
const customFunctionResolver = new functions_1.CustomFunction(this.functions, this.botContext, resolvedLocale);
|
|
136
85
|
const targetId = await customFunctionResolver.call(node);
|
|
137
86
|
return this.getContentsById(targetId, contents);
|
|
138
87
|
}
|
|
139
|
-
const flowFactory = new flow_factory_1.FlowFactory(this.
|
|
88
|
+
const flowFactory = new flow_factory_1.FlowFactory(this.botContext, this.cmsApi, resolvedLocale);
|
|
140
89
|
const content = await flowFactory.getFlowContent(node);
|
|
141
90
|
if (content) {
|
|
142
91
|
contents.push(content);
|
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAMA,+BAAmC;AAEnC,+BAAsC;AACtC,+DAAyD;AACzD,2CAAkE;AAElE,oEAIwC;AACxC,iDAA4C;AAC5C,2CAAoE;AACpE,mCASgB;AAEhB,2DAA8D;AAE9D,2EAA2E;AAE3E,MAAqB,wBAAwB;IAkB3C,YAAY,OAA8D;QACxE,IAAI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