@botonic/plugin-flow-builder 0.50.2 → 0.51.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/content-fields/custom-conditional/custom-conditional-v2-evaluators.d.ts +15 -0
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +71 -0
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +1 -0
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.d.ts +9 -0
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.js +58 -0
- package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +1 -0
- package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.d.ts +17 -0
- package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.js +79 -0
- package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.js.map +1 -0
- package/lib/cjs/content-fields/flow-custom-conditional.js +1 -0
- package/lib/cjs/content-fields/flow-custom-conditional.js.map +1 -1
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.d.ts +56 -0
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.js +36 -0
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/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 +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/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.d.ts +15 -0
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +71 -0
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +1 -0
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.d.ts +9 -0
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.js +58 -0
- package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +1 -0
- package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.d.ts +17 -0
- package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.js +79 -0
- package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.js.map +1 -0
- package/lib/esm/content-fields/flow-custom-conditional.js +1 -0
- package/lib/esm/content-fields/flow-custom-conditional.js.map +1 -1
- package/lib/esm/content-fields/hubtype-fields/custom-conditional-v2.d.ts +56 -0
- package/lib/esm/content-fields/hubtype-fields/custom-conditional-v2.js +36 -0
- package/lib/esm/content-fields/hubtype-fields/custom-conditional-v2.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/index.d.ts +1 -0
- package/lib/esm/content-fields/hubtype-fields/index.js +1 -0
- package/lib/esm/content-fields/hubtype-fields/index.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/package.json +2 -2
- package/src/content-fields/custom-conditional/custom-conditional-v2-evaluators.ts +124 -0
- package/src/content-fields/custom-conditional/custom-conditional-v2-resolver.ts +92 -0
- package/src/content-fields/custom-conditional/flow-custom-condition-v2.tsx +136 -0
- package/src/content-fields/flow-custom-conditional.tsx +1 -0
- package/src/content-fields/hubtype-fields/custom-conditional-v2.ts +68 -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 +7 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BOOLEAN_CONDITION_EVALUATORS = exports.NUMBER_CONDITION_EVALUATORS = exports.STRING_CONDITION_EVALUATORS = void 0;
|
|
4
|
+
exports.getMinAndMax = getMinAndMax;
|
|
5
|
+
exports.evaluateStringCondition = evaluateStringCondition;
|
|
6
|
+
exports.evaluateNumberCondition = evaluateNumberCondition;
|
|
7
|
+
exports.evaluateBooleanCondition = evaluateBooleanCondition;
|
|
8
|
+
const hubtype_fields_1 = require("../hubtype-fields");
|
|
9
|
+
function getMinAndMax(condition) {
|
|
10
|
+
if (condition.min !== undefined && condition.max !== undefined) {
|
|
11
|
+
return { min: condition.min, max: condition.max };
|
|
12
|
+
}
|
|
13
|
+
throw new Error(`Min or max not found for number condition ${condition.operator}`);
|
|
14
|
+
}
|
|
15
|
+
exports.STRING_CONDITION_EVALUATORS = {
|
|
16
|
+
[hubtype_fields_1.StringConditionOperator.Contains]: (variable, value) => variable.includes(value),
|
|
17
|
+
[hubtype_fields_1.StringConditionOperator.NotContains]: (variable, value) => !variable.includes(value),
|
|
18
|
+
[hubtype_fields_1.StringConditionOperator.EqualsTo]: (variable, value) => variable === value,
|
|
19
|
+
[hubtype_fields_1.StringConditionOperator.NotEqualsTo]: (variable, value) => variable !== value,
|
|
20
|
+
[hubtype_fields_1.StringConditionOperator.StartsWith]: (variable, value) => variable.startsWith(value),
|
|
21
|
+
[hubtype_fields_1.StringConditionOperator.NotStartsWith]: (variable, value) => !variable.startsWith(value),
|
|
22
|
+
[hubtype_fields_1.StringConditionOperator.EndsWith]: (variable, value) => variable.endsWith(value),
|
|
23
|
+
[hubtype_fields_1.StringConditionOperator.NotEndsWith]: (variable, value) => !variable.endsWith(value),
|
|
24
|
+
};
|
|
25
|
+
exports.NUMBER_CONDITION_EVALUATORS = {
|
|
26
|
+
[hubtype_fields_1.NumberConditionOperator.EqualsTo]: (variable, value) => variable === value,
|
|
27
|
+
[hubtype_fields_1.NumberConditionOperator.NotEqualsTo]: (variable, value) => variable !== value,
|
|
28
|
+
[hubtype_fields_1.NumberConditionOperator.GreaterThan]: (variable, value) => variable > value,
|
|
29
|
+
[hubtype_fields_1.NumberConditionOperator.LessThan]: (variable, value) => variable < value,
|
|
30
|
+
[hubtype_fields_1.NumberConditionOperator.GreaterThanOrEqualTo]: (variable, value) => variable >= value,
|
|
31
|
+
[hubtype_fields_1.NumberConditionOperator.LessThanOrEqualTo]: (variable, value) => variable <= value,
|
|
32
|
+
[hubtype_fields_1.NumberConditionOperator.Between]: (variable, _value, condition) => {
|
|
33
|
+
const { min, max } = getMinAndMax(condition);
|
|
34
|
+
return variable >= min && variable <= max;
|
|
35
|
+
},
|
|
36
|
+
[hubtype_fields_1.NumberConditionOperator.NotBetween]: (variable, _value, condition) => {
|
|
37
|
+
const { min, max } = getMinAndMax(condition);
|
|
38
|
+
return variable < min || variable > max;
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
exports.BOOLEAN_CONDITION_EVALUATORS = {
|
|
42
|
+
[hubtype_fields_1.BooleanConditionOperator.IsTruthy]: variable => !!variable,
|
|
43
|
+
};
|
|
44
|
+
function evaluateStringCondition(variable, condition) {
|
|
45
|
+
if (condition.value === undefined) {
|
|
46
|
+
throw new Error(`Value not found for string condition ${condition.operator}`);
|
|
47
|
+
}
|
|
48
|
+
const evaluator = exports.STRING_CONDITION_EVALUATORS[condition.operator];
|
|
49
|
+
if (!evaluator) {
|
|
50
|
+
throw new Error(`Invalid string condition operator ${condition.operator}`);
|
|
51
|
+
}
|
|
52
|
+
return evaluator(variable, condition.value);
|
|
53
|
+
}
|
|
54
|
+
function evaluateNumberCondition(variable, condition) {
|
|
55
|
+
if (condition.value === undefined) {
|
|
56
|
+
throw new Error(`Value not found for number condition ${condition.operator}`);
|
|
57
|
+
}
|
|
58
|
+
const evaluator = exports.NUMBER_CONDITION_EVALUATORS[condition.operator];
|
|
59
|
+
if (!evaluator) {
|
|
60
|
+
throw new Error(`Invalid number condition operator ${condition.operator}`);
|
|
61
|
+
}
|
|
62
|
+
return evaluator(variable, condition.value, condition);
|
|
63
|
+
}
|
|
64
|
+
function evaluateBooleanCondition(variable, condition) {
|
|
65
|
+
const evaluator = exports.BOOLEAN_CONDITION_EVALUATORS[condition.operator];
|
|
66
|
+
if (!evaluator) {
|
|
67
|
+
throw new Error(`Invalid boolean condition operator ${condition.operator}`);
|
|
68
|
+
}
|
|
69
|
+
return evaluator(variable);
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=custom-conditional-v2-evaluators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-conditional-v2-evaluators.js","sourceRoot":"","sources":["../../../../src/content-fields/custom-conditional/custom-conditional-v2-evaluators.ts"],"names":[],"mappings":";;;AAmBA,oCAUC;AAqDD,0DAcC;AAED,0DAcC;AAED,4DASC;AA3HD,sDAO0B;AAY1B,SAAgB,YAAY,CAAC,SAA4B;IAIvD,IAAI,SAAS,CAAC,GAAG,KAAK,SAAS,IAAI,SAAS,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;QAC/D,OAAO,EAAE,GAAG,EAAE,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,SAAS,CAAC,GAAG,EAAE,CAAA;IACnD,CAAC;IACD,MAAM,IAAI,KAAK,CACb,6CAA6C,SAAS,CAAC,QAAQ,EAAE,CAClE,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
+
export type ConditionMatch = {
|
|
3
|
+
customResult: string;
|
|
4
|
+
target: HtNodeLink;
|
|
5
|
+
operator: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function getConditionCustomResult(condition: HtCondition, variableFormat: VariableFormat): string;
|
|
8
|
+
export declare function findLastMatchingCondition<T extends HtCondition>(conditions: T[], variable: unknown, variableFormat: VariableFormat, evaluate: (variable: unknown, condition: T) => boolean): ConditionMatch | undefined;
|
|
9
|
+
export declare function resolveWithDefaultTarget(match: ConditionMatch | undefined, defaultTarget: HtNodeLink, nodeCode: string, defaultCustomResult?: string): ConditionMatch;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getConditionCustomResult = getConditionCustomResult;
|
|
4
|
+
exports.findLastMatchingCondition = findLastMatchingCondition;
|
|
5
|
+
exports.resolveWithDefaultTarget = resolveWithDefaultTarget;
|
|
6
|
+
const hubtype_fields_1 = require("../hubtype-fields");
|
|
7
|
+
function getConditionCustomResult(condition, variableFormat) {
|
|
8
|
+
switch (variableFormat) {
|
|
9
|
+
case hubtype_fields_1.VariableFormat.String:
|
|
10
|
+
return String(condition.value);
|
|
11
|
+
case hubtype_fields_1.VariableFormat.Number:
|
|
12
|
+
return getNumberConditionCustomResult(condition);
|
|
13
|
+
case hubtype_fields_1.VariableFormat.Boolean:
|
|
14
|
+
// Only reached after evaluateBooleanCondition succeeds; today that is isTruthy → 'true'
|
|
15
|
+
return 'true';
|
|
16
|
+
default:
|
|
17
|
+
throw new Error(`Invalid variable format ${variableFormat}`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function getNumberConditionCustomResult(condition) {
|
|
21
|
+
const numberCondition = condition;
|
|
22
|
+
if (numberCondition.operator === hubtype_fields_1.NumberConditionOperator.Between ||
|
|
23
|
+
numberCondition.operator === hubtype_fields_1.NumberConditionOperator.NotBetween) {
|
|
24
|
+
return `min: ${numberCondition.min} - max: ${numberCondition.max}`;
|
|
25
|
+
}
|
|
26
|
+
return String(numberCondition.value);
|
|
27
|
+
}
|
|
28
|
+
function findLastMatchingCondition(conditions, variable, variableFormat, evaluate) {
|
|
29
|
+
let lastMatch;
|
|
30
|
+
for (const condition of conditions) {
|
|
31
|
+
if (!evaluate(variable, condition)) {
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
if (!condition.target) {
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
lastMatch = {
|
|
38
|
+
customResult: getConditionCustomResult(condition, variableFormat),
|
|
39
|
+
target: condition.target,
|
|
40
|
+
operator: condition.operator,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
return lastMatch;
|
|
44
|
+
}
|
|
45
|
+
function resolveWithDefaultTarget(match, defaultTarget, nodeCode, defaultCustomResult = 'default') {
|
|
46
|
+
if (match) {
|
|
47
|
+
return match;
|
|
48
|
+
}
|
|
49
|
+
if (!defaultTarget) {
|
|
50
|
+
throw new Error(`Default target not found for custom condition node ${nodeCode}`);
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
customResult: defaultCustomResult,
|
|
54
|
+
target: defaultTarget,
|
|
55
|
+
operator: '',
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=custom-conditional-v2-resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-conditional-v2-resolver.js","sourceRoot":"","sources":["../../../../src/content-fields/custom-conditional/custom-conditional-v2-resolver.ts"],"names":[],"mappings":";;AAeA,4DAeC;AAaD,8DAyBC;AAED,4DAqBC;AA3FD,sDAO0B;AAQ1B,SAAgB,wBAAwB,CACtC,SAAsB,EACtB,cAA8B;IAE9B,QAAQ,cAAc,EAAE,CAAC;QACvB,KAAK,+BAAc,CAAC,MAAM;YACxB,OAAO,MAAM,CAAE,SAA+B,CAAC,KAAK,CAAC,CAAA;QACvD,KAAK,+BAAc,CAAC,MAA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a,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CACb,sDAAsD,QAAQ,EAAE,CACjE,CAAA;IACH,CAAC;IAED,OAAO;QACL,YAAY,EAAE,mBAAmB;QACjC,MAAM,EAAE,aAAa;QACrB,QAAQ,EAAE,EAAE;KACb,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type BotContext } from '@botonic/core';
|
|
2
|
+
import { ContentFieldsBase } from '../content-fields-base';
|
|
3
|
+
import { type HtCondition, type HtCustomConditionalV2Node, type HtNodeLink, VariableFormat } from '../hubtype-fields';
|
|
4
|
+
export declare class FlowCustomConditionalV2 extends ContentFieldsBase {
|
|
5
|
+
variableFormat: VariableFormat;
|
|
6
|
+
keyPath: string;
|
|
7
|
+
conditions: HtCondition[];
|
|
8
|
+
defaultTarget: HtNodeLink;
|
|
9
|
+
customResult: string;
|
|
10
|
+
resolvedOperator: string;
|
|
11
|
+
static fromHubtypeCMS(component: HtCustomConditionalV2Node, botContext: BotContext): FlowCustomConditionalV2;
|
|
12
|
+
private setFollowUp;
|
|
13
|
+
private evaluateConditions;
|
|
14
|
+
trackFlow(botContext: BotContext): Promise<void>;
|
|
15
|
+
processContent(botContext: BotContext): Promise<void>;
|
|
16
|
+
toBotonic(): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlowCustomConditionalV2 = 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 content_fields_base_1 = require("../content-fields-base");
|
|
8
|
+
const hubtype_fields_1 = require("../hubtype-fields");
|
|
9
|
+
const custom_conditional_v2_evaluators_1 = require("./custom-conditional-v2-evaluators");
|
|
10
|
+
const custom_conditional_v2_resolver_1 = require("./custom-conditional-v2-resolver");
|
|
11
|
+
class FlowCustomConditionalV2 extends content_fields_base_1.ContentFieldsBase {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.customResult = '';
|
|
15
|
+
this.resolvedOperator = '';
|
|
16
|
+
}
|
|
17
|
+
static fromHubtypeCMS(component, botContext) {
|
|
18
|
+
const newCustomConditionalV2 = new FlowCustomConditionalV2(component.id);
|
|
19
|
+
newCustomConditionalV2.code = component.code;
|
|
20
|
+
newCustomConditionalV2.variableFormat = component.content.type;
|
|
21
|
+
newCustomConditionalV2.keyPath = component.content.key_path;
|
|
22
|
+
newCustomConditionalV2.conditions = component.content.conditions;
|
|
23
|
+
newCustomConditionalV2.defaultTarget = component.content.default_target;
|
|
24
|
+
newCustomConditionalV2.setFollowUp(botContext);
|
|
25
|
+
return newCustomConditionalV2;
|
|
26
|
+
}
|
|
27
|
+
setFollowUp(botContext) {
|
|
28
|
+
const botVariable = this.getValueFromKeyPath(botContext, this.keyPath);
|
|
29
|
+
const resolved = this.evaluateConditions(botVariable);
|
|
30
|
+
this.customResult = resolved.customResult;
|
|
31
|
+
this.resolvedOperator = resolved.operator;
|
|
32
|
+
this.followUp = resolved.target;
|
|
33
|
+
}
|
|
34
|
+
evaluateConditions(botVariable) {
|
|
35
|
+
switch (this.variableFormat) {
|
|
36
|
+
case hubtype_fields_1.VariableFormat.String: {
|
|
37
|
+
const match = (0, custom_conditional_v2_resolver_1.findLastMatchingCondition)(this.conditions, botVariable, this.variableFormat, (variable, condition) => (0, custom_conditional_v2_evaluators_1.evaluateStringCondition)(variable, condition));
|
|
38
|
+
return (0, custom_conditional_v2_resolver_1.resolveWithDefaultTarget)(match, this.defaultTarget, this.code);
|
|
39
|
+
}
|
|
40
|
+
case hubtype_fields_1.VariableFormat.Number: {
|
|
41
|
+
const match = (0, custom_conditional_v2_resolver_1.findLastMatchingCondition)(this.conditions, botVariable, this.variableFormat, (variable, condition) => (0, custom_conditional_v2_evaluators_1.evaluateNumberCondition)(variable, condition));
|
|
42
|
+
return (0, custom_conditional_v2_resolver_1.resolveWithDefaultTarget)(match, this.defaultTarget, this.code);
|
|
43
|
+
}
|
|
44
|
+
case hubtype_fields_1.VariableFormat.Boolean: {
|
|
45
|
+
const match = (0, custom_conditional_v2_resolver_1.findLastMatchingCondition)(this.conditions, botVariable, this.variableFormat, (variable, condition) => (0, custom_conditional_v2_evaluators_1.evaluateBooleanCondition)(variable, condition));
|
|
46
|
+
return (0, custom_conditional_v2_resolver_1.resolveWithDefaultTarget)(match, this.defaultTarget, this.code, 'false');
|
|
47
|
+
}
|
|
48
|
+
default:
|
|
49
|
+
throw new Error(`Invalid variable format ${this.variableFormat} for custom condition node ${this.code}`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
async trackFlow(botContext) {
|
|
53
|
+
const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } = (0, tracking_1.getCommonFlowContentEventArgsForContentId)(botContext, this.id);
|
|
54
|
+
const eventCustomConditional = {
|
|
55
|
+
action: core_1.EventAction.ConditionalCustom,
|
|
56
|
+
flowThreadId,
|
|
57
|
+
flowId,
|
|
58
|
+
flowName,
|
|
59
|
+
flowNodeId,
|
|
60
|
+
flowNodeContentId,
|
|
61
|
+
flowNodeIsMeaningful: false,
|
|
62
|
+
conditionalVariable: this.customResult,
|
|
63
|
+
variableFormat: this.variableFormat,
|
|
64
|
+
operator: this.resolvedOperator,
|
|
65
|
+
};
|
|
66
|
+
const { action, ...eventArgs } = eventCustomConditional;
|
|
67
|
+
await (0, tracking_1.trackEvent)(botContext, action, eventArgs);
|
|
68
|
+
}
|
|
69
|
+
async processContent(botContext) {
|
|
70
|
+
await this.filterContent(botContext, this);
|
|
71
|
+
await this.trackFlow(botContext);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
toBotonic() {
|
|
75
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
exports.FlowCustomConditionalV2 = FlowCustomConditionalV2;
|
|
79
|
+
//# sourceMappingURL=flow-custom-condition-v2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-custom-condition-v2.js","sourceRoot":"","sources":["../../../../src/content-fields/custom-conditional/flow-custom-condition-v2.tsx"],"names":[],"mappings":";;;;AAAA,wCAIsB;AACtB,6CAGuB;AACvB,gEAA0D;AAC1D,sDAQ0B;AAC1B,yFAI2C;AAC3C,qFAIyC;AAEzC,MAAa,uBAAwB,SAAQ,uCAAiB;IAA9D;;QAKS,iBAAY,GAAG,EAAE,CAAA;QACjB,qBAAgB,GAAG,EAAE,CAAA;IAmG9B,CAAC;IAjGC,MAAM,CAAC,cAAc,CACnB,SAAoC,EACpC,UAAsB;QAEtB,MAAM,sBAAsB,GAAG,IAAI,uBAAuB,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;QACxE,sBAAsB,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAA;QAC5C,sBAAsB,CAAC,cAAc,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,CAAA;QAC9D,sBAAsB,CAAC,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAA;QAC3D,sBAAsB,CAAC,UAAU,GAAG,SAAS,CAAC,OAAO,CAAC,UAAU,CAAA;QAChE,sBAAsB,CAAC,aAAa,GAAG,SAAS,CAAC,OAAO,CAAC,cAAc,CAAA;QACvE,sBAAsB,CAAC,WAAW,CAAC,UAAU,CAAC,CAAA;QAE9C,OAAO,sBAAsB,CAAA;IAC/B,CAAC;IAEO,WAAW,CAAC,UAAsB;QACxC,MAAM,WAAW,GAAG,IAAI,CAAC,mBAAmB,CAAC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;QACtE,MAAM,QAAQ,GAAG,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAA;QAErD,IAAI,CAAC,YAAY,GAAG,QAA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,yDAAwB,EAC7B,KAAK,EACL,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,IAAI,EACT,OAAO,CACR,CAAA;YACH,CAAC;YACD;gBACE,MAAM,IAAI,KAAK,CACb,2BAA2B,IAAI,CAAC,cAAc,8BAA8B,IAAI,CAAC,IAAI,EAAE,CACxF,CAAA;QACL,CAAC;IACH,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,UAAsB;QACpC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,iBAAiB,EAAE,GACrE,IAAA,oDAAyC,EAAC,UAAU,EAAE,IAAI,CAAC,EAAE,CAAC,CAAA;QAEhE,MAAM,sBAAsB,GAA2B;YACrD,MAAM,EAAE,kBAAW,CAAC,iBAAiB;YACrC,YAAY;YACZ,MAAM;YACN,QAAQ;YACR,UAAU;YACV,iBAAiB;YACjB,oBAAoB,EAAE,KAAK;YAC3B,mBAAmB,EAAE,IAAI,CAAC,YAAY;YACtC,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,QAAQ,EAAE,IAAI,CAAC,gBAAgB;SAChC,CAAA;QACD,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,GAAG,sBAAsB,CAAA;QACvD,MAAM,IAAA,qBAAU,EAAC,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,CAAA;IACjD,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;AAzGD,0DAyGC"}
|
|
@@ -66,6 +66,7 @@ class FlowCustomConditional extends content_fields_base_1.ContentFieldsBase {
|
|
|
66
66
|
flowNodeIsMeaningful: false,
|
|
67
67
|
conditionalVariable: this.customResult.toString(),
|
|
68
68
|
variableFormat: this.variableFormat,
|
|
69
|
+
operator: '',
|
|
69
70
|
};
|
|
70
71
|
const { action, ...eventArgs } = eventCustomConditional;
|
|
71
72
|
await (0, tracking_1.trackEvent)(botContext, action, eventArgs);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-custom-conditional.js","sourceRoot":"","sources":["../../../src/content-fields/flow-custom-conditional.tsx"],"names":[],"mappings":";;;;AAAA,wCAIsB;AAEtB,0CAGoB;AACpB,+DAAyD;AAQzD,MAAa,qBAAsB,SAAQ,uCAAiB;IAA5D;;QACS,cAAS,GAA0B,EAAE,CAAA;QAErC,sBAAiB,GAAsB,SAAS,CAAA;QAChD,iBAAY,GAAY,KAAK,CAAA;QAC7B,mBAAc,GAAW,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"flow-custom-conditional.js","sourceRoot":"","sources":["../../../src/content-fields/flow-custom-conditional.tsx"],"names":[],"mappings":";;;;AAAA,wCAIsB;AAEtB,0CAGoB;AACpB,+DAAyD;AAQzD,MAAa,qBAAsB,SAAQ,uCAAiB;IAA5D;;QACS,cAAS,GAA0B,EAAE,CAAA;QAErC,sBAAiB,GAAsB,SAAS,CAAA;QAChD,iBAAY,GAAY,KAAK,CAAA;QAC7B,mBAAc,GAAW,EAAE,CAAA;IAuGpC,CAAC;IArGC,MAAM,CAAC,cAAc,CACnB,SAAkC,EAClC,UAAsB;QAEtB,MAAM,oBAAoB,GAAG,IAAI,qBAAqB,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;QACpE,oBAAoB,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAA;QAC1C,oBAAoB,CAAC,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,SAAS,CAAA;QAC5D,oBAAoB,CAAC,aAAa,GAAG,SAAS,CAAC,OAAO,CAAC,cAAc,CAAA;QACrE,oBAAoB,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAA;QACrD,oBAAoB,CAAC,cAAc,GAC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AI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC;YAChD,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC;YACjD,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,SAAS,CAAC,CACtD,CAAA;IACH,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;AA5GD,sDA4GC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { HtBaseNode, HtNodeLink } from './common';
|
|
2
|
+
import type { HtNodeWithContentType } from './node-types';
|
|
3
|
+
export declare enum VariableFormat {
|
|
4
|
+
Boolean = "boolean",
|
|
5
|
+
Number = "number",
|
|
6
|
+
String = "string"
|
|
7
|
+
}
|
|
8
|
+
export declare enum StringConditionOperator {
|
|
9
|
+
Contains = "contains",
|
|
10
|
+
NotContains = "notContains",
|
|
11
|
+
EqualsTo = "equalsTo",
|
|
12
|
+
NotEqualsTo = "notEqualsTo",
|
|
13
|
+
StartsWith = "startsWith",
|
|
14
|
+
NotStartsWith = "notStartsWith",
|
|
15
|
+
EndsWith = "endsWith",
|
|
16
|
+
NotEndsWith = "notEndsWith"
|
|
17
|
+
}
|
|
18
|
+
export interface HtStringCondition {
|
|
19
|
+
operator: StringConditionOperator;
|
|
20
|
+
value?: string;
|
|
21
|
+
target?: HtNodeLink;
|
|
22
|
+
}
|
|
23
|
+
export declare enum NumberConditionOperator {
|
|
24
|
+
EqualsTo = "equalsTo",
|
|
25
|
+
NotEqualsTo = "notEqualsTo",
|
|
26
|
+
GreaterThan = "greaterThan",
|
|
27
|
+
LessThan = "lessThan",
|
|
28
|
+
GreaterThanOrEqualTo = "greaterThanOrEqualTo",
|
|
29
|
+
LessThanOrEqualTo = "lessThanOrEqualTo",
|
|
30
|
+
Between = "between",
|
|
31
|
+
NotBetween = "notBetween"
|
|
32
|
+
}
|
|
33
|
+
export interface HtNumberCondition {
|
|
34
|
+
operator: NumberConditionOperator;
|
|
35
|
+
value?: number;
|
|
36
|
+
min?: number;
|
|
37
|
+
max?: number;
|
|
38
|
+
target?: HtNodeLink;
|
|
39
|
+
}
|
|
40
|
+
export declare enum BooleanConditionOperator {
|
|
41
|
+
IsTruthy = "isTruthy"
|
|
42
|
+
}
|
|
43
|
+
export interface HtBooleanCondition {
|
|
44
|
+
operator: BooleanConditionOperator;
|
|
45
|
+
target?: HtNodeLink;
|
|
46
|
+
}
|
|
47
|
+
export type HtCondition = HtStringCondition | HtNumberCondition | HtBooleanCondition;
|
|
48
|
+
export interface HtCustomConditionalV2Node extends HtBaseNode {
|
|
49
|
+
type: HtNodeWithContentType.CUSTOM_CONDITION;
|
|
50
|
+
content: {
|
|
51
|
+
type: VariableFormat;
|
|
52
|
+
key_path: string;
|
|
53
|
+
conditions: HtCondition[];
|
|
54
|
+
default_target: HtNodeLink;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BooleanConditionOperator = exports.NumberConditionOperator = exports.StringConditionOperator = exports.VariableFormat = void 0;
|
|
4
|
+
var VariableFormat;
|
|
5
|
+
(function (VariableFormat) {
|
|
6
|
+
VariableFormat["Boolean"] = "boolean";
|
|
7
|
+
VariableFormat["Number"] = "number";
|
|
8
|
+
VariableFormat["String"] = "string";
|
|
9
|
+
})(VariableFormat || (exports.VariableFormat = VariableFormat = {}));
|
|
10
|
+
var StringConditionOperator;
|
|
11
|
+
(function (StringConditionOperator) {
|
|
12
|
+
StringConditionOperator["Contains"] = "contains";
|
|
13
|
+
StringConditionOperator["NotContains"] = "notContains";
|
|
14
|
+
StringConditionOperator["EqualsTo"] = "equalsTo";
|
|
15
|
+
StringConditionOperator["NotEqualsTo"] = "notEqualsTo";
|
|
16
|
+
StringConditionOperator["StartsWith"] = "startsWith";
|
|
17
|
+
StringConditionOperator["NotStartsWith"] = "notStartsWith";
|
|
18
|
+
StringConditionOperator["EndsWith"] = "endsWith";
|
|
19
|
+
StringConditionOperator["NotEndsWith"] = "notEndsWith";
|
|
20
|
+
})(StringConditionOperator || (exports.StringConditionOperator = StringConditionOperator = {}));
|
|
21
|
+
var NumberConditionOperator;
|
|
22
|
+
(function (NumberConditionOperator) {
|
|
23
|
+
NumberConditionOperator["EqualsTo"] = "equalsTo";
|
|
24
|
+
NumberConditionOperator["NotEqualsTo"] = "notEqualsTo";
|
|
25
|
+
NumberConditionOperator["GreaterThan"] = "greaterThan";
|
|
26
|
+
NumberConditionOperator["LessThan"] = "lessThan";
|
|
27
|
+
NumberConditionOperator["GreaterThanOrEqualTo"] = "greaterThanOrEqualTo";
|
|
28
|
+
NumberConditionOperator["LessThanOrEqualTo"] = "lessThanOrEqualTo";
|
|
29
|
+
NumberConditionOperator["Between"] = "between";
|
|
30
|
+
NumberConditionOperator["NotBetween"] = "notBetween";
|
|
31
|
+
})(NumberConditionOperator || (exports.NumberConditionOperator = NumberConditionOperator = {}));
|
|
32
|
+
var BooleanConditionOperator;
|
|
33
|
+
(function (BooleanConditionOperator) {
|
|
34
|
+
BooleanConditionOperator["IsTruthy"] = "isTruthy";
|
|
35
|
+
})(BooleanConditionOperator || (exports.BooleanConditionOperator = BooleanConditionOperator = {}));
|
|
36
|
+
//# sourceMappingURL=custom-conditional-v2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-conditional-v2.js","sourceRoot":"","sources":["../../../../src/content-fields/hubtype-fields/custom-conditional-v2.ts"],"names":[],"mappings":";;;AAGA,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,mCAAiB,CAAA;IACjB,mCAAiB,CAAA;AACnB,CAAC,EAJW,cAAc,8BAAd,cAAc,QAIzB;AAED,IAAY,uBASX;AATD,WAAY,uBAAuB;IACjC,gDAAqB,CAAA;IACrB,sDAA2B,CAAA;IAC3B,gDAAqB,CAAA;IACrB,sDAA2B,CAAA;IAC3B,oDAAyB,CAAA;IACzB,0DAA+B,CAAA;IAC/B,gDAAqB,CAAA;IACrB,sDAA2B,CAAA;AAC7B,CAAC,EATW,uBAAuB,uCAAvB,uBAAuB,QASlC;AAQD,IAAY,uBASX;AATD,WAAY,uBAAuB;IACjC,gDAAqB,CAAA;IACrB,sDAA2B,CAAA;IAC3B,sDAA2B,CAAA;IAC3B,gDAAqB,CAAA;IACrB,wEAA6C,CAAA;IAC7C,kEAAuC,CAAA;IACvC,8CAAmB,CAAA;IACnB,oDAAyB,CAAA;AAC3B,CAAC,EATW,uBAAuB,uCAAvB,uBAAuB,QASlC;AAUD,IAAY,wBAEX;AAFD,WAAY,wBAAwB;IAClC,iDAAqB,CAAA;AACvB,CAAC,EAFW,wBAAwB,wCAAxB,wBAAwB,QAEnC"}
|
|
@@ -8,6 +8,7 @@ tslib_1.__exportStar(require("./button"), exports);
|
|
|
8
8
|
tslib_1.__exportStar(require("./capture-user-input"), exports);
|
|
9
9
|
tslib_1.__exportStar(require("./carousel"), exports);
|
|
10
10
|
tslib_1.__exportStar(require("./common"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./custom-conditional-v2"), exports);
|
|
11
12
|
tslib_1.__exportStar(require("./fallback"), exports);
|
|
12
13
|
tslib_1.__exportStar(require("./function"), exports);
|
|
13
14
|
tslib_1.__exportStar(require("./go-to-flow"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/content-fields/hubtype-fields/index.ts"],"names":[],"mappings":";;;AAAA,qDAA0B;AAC1B,4DAAiC;AACjC,uDAA4B;AAC5B,mDAAwB;AACxB,+DAAoC;AACpC,qDAA0B;AAC1B,mDAAwB;AACxB,qDAA0B;AAC1B,qDAA0B;AAC1B,uDAA4B;AAC5B,oDAAyB;AACzB,kDAAuB;AACvB,oDAAyB;AACzB,2DAAgC;AAChC,uDAA4B;AAC5B,kDAAuB;AACvB,oDAAyB;AACzB,mDAAwB;AACxB,yDAA8B;AAC9B,iDAAsB;AACtB,gDAAqB;AACrB,kDAAuB;AACvB,oDAAyB;AACzB,iEAAsC;AACtC,oEAAyC;AACzC,8DAAmC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/content-fields/hubtype-fields/index.ts"],"names":[],"mappings":";;;AAAA,qDAA0B;AAC1B,4DAAiC;AACjC,uDAA4B;AAC5B,mDAAwB;AACxB,+DAAoC;AACpC,qDAA0B;AAC1B,mDAAwB;AACxB,kEAAuC;AACvC,qDAA0B;AAC1B,qDAA0B;AAC1B,uDAA4B;AAC5B,oDAAyB;AACzB,kDAAuB;AACvB,oDAAyB;AACzB,2DAAgC;AAChC,uDAA4B;AAC5B,kDAAuB;AACvB,oDAAyB;AACzB,mDAAwB;AACxB,yDAA8B;AAC9B,iDAAsB;AACtB,gDAAqB;AACrB,kDAAuB;AACvB,oDAAyB;AACzB,iEAAsC;AACtC,oEAAyC;AACzC,8DAAmC"}
|
|
@@ -18,7 +18,8 @@ export declare enum HtNodeWithContentType {
|
|
|
18
18
|
RATING = "rating",
|
|
19
19
|
WEBVIEW = "webview",
|
|
20
20
|
GO_TO_FLOW = "go-to-flow",
|
|
21
|
-
CAPTURE_USER_INPUT = "capture-user-input"
|
|
21
|
+
CAPTURE_USER_INPUT = "capture-user-input",
|
|
22
|
+
CUSTOM_CONDITION = "custom-condition"
|
|
22
23
|
}
|
|
23
24
|
export declare enum HtNodeWithoutContentType {
|
|
24
25
|
URL = "url",
|
|
@@ -23,6 +23,7 @@ var HtNodeWithContentType;
|
|
|
23
23
|
HtNodeWithContentType["WEBVIEW"] = "webview";
|
|
24
24
|
HtNodeWithContentType["GO_TO_FLOW"] = "go-to-flow";
|
|
25
25
|
HtNodeWithContentType["CAPTURE_USER_INPUT"] = "capture-user-input";
|
|
26
|
+
HtNodeWithContentType["CUSTOM_CONDITION"] = "custom-condition";
|
|
26
27
|
})(HtNodeWithContentType || (exports.HtNodeWithContentType = HtNodeWithContentType = {}));
|
|
27
28
|
var HtNodeWithoutContentType;
|
|
28
29
|
(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,qBAsBX;AAtBD,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,gEAAuC,CAAA;IACvC,0DAAiC,CAAA;IACjC,kDAAyB,CAAA;IACzB,8CAAqB,CAAA;IACrB,4DAAmC,CAAA;IACnC,0CAAiB,CAAA;IACjB,4CAAmB,CAAA;IACnB,kDAAyB,CAAA;IACzB,kEAAyC,CAAA;IACzC,8DAAqC,CAAA;AACvC,CAAC,EAtBW,qBAAqB,qCAArB,qBAAqB,QAsBhC;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 { HtCustomConditionalV2Node } from './custom-conditional-v2';
|
|
6
7
|
import type { HtFallbackNode } from './fallback';
|
|
7
8
|
import type { HtFunctionNode } from './function';
|
|
8
9
|
import type { HtGoToFlow } from './go-to-flow';
|
|
@@ -20,6 +21,6 @@ import type { HtWebviewNode } from './webview';
|
|
|
20
21
|
import type { HtWhatsappButtonListNode } from './whatsapp-button-list';
|
|
21
22
|
import type { HtWhatsappCTAUrlButtonNode } from './whatsapp-cta-url-button';
|
|
22
23
|
import type { HtWhatsappTemplateNode } from './whatsapp-template';
|
|
23
|
-
export type HtNodeWithContent = HtTextNode | HtImageNode | HtVideoNode | HtCarouselNode | HtHandoffNode | HtKeywordNode | HtFunctionNode | HtFallbackNode | HtWhatsappButtonListNode | HtWhatsappCTAUrlButtonNode | HtSmartIntentNode | HtKnowledgeBaseNode | HtBotActionNode | HtAiAgentNode | HtAiAgentRouterNode | HtRatingNode | HtWebviewNode | HtGoToFlow | HtWhatsappTemplateNode | HtCaptureUserInputNode;
|
|
24
|
+
export type HtNodeWithContent = HtTextNode | HtImageNode | HtVideoNode | HtCarouselNode | HtHandoffNode | HtKeywordNode | HtFunctionNode | HtFallbackNode | HtWhatsappButtonListNode | HtWhatsappCTAUrlButtonNode | HtSmartIntentNode | HtKnowledgeBaseNode | HtBotActionNode | HtAiAgentNode | HtAiAgentRouterNode | HtRatingNode | HtWebviewNode | HtGoToFlow | HtWhatsappTemplateNode | HtCaptureUserInputNode | HtCustomConditionalV2Node;
|
|
24
25
|
export type HtNodeWithoutContent = HtUrlNode | HtPayloadNode;
|
|
25
26
|
export type HtNodeComponent = HtNodeWithContent | HtNodeWithoutContent;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FlowCustomConditionalV2 } from './custom-conditional/flow-custom-condition-v2';
|
|
1
2
|
import { FlowAiAgent } from './flow-ai-agent';
|
|
2
3
|
import { FlowAiAgentRouter } from './flow-ai-agent-router';
|
|
3
4
|
import { FlowBotAction } from './flow-bot-action';
|
|
@@ -20,6 +21,6 @@ import { FlowWhatsappButtonList } from './whatsapp-button-list/flow-whatsapp-but
|
|
|
20
21
|
export { ContentFieldsBase } from './content-fields-base';
|
|
21
22
|
export { FlowButton } from './flow-button';
|
|
22
23
|
export { FlowElement } from './flow-element';
|
|
23
|
-
export { FlowAiAgentRouter, FlowAiAgent, FlowBotAction, FlowCaptureUserInput, FlowCarousel, FlowChannelConditional, FlowCountryConditional, FlowCustomConditional, FlowGoToFlow, FlowHandoff, FlowImage, FlowKnowledgeBase, FlowQueueStatusConditional, FlowRating, FlowText, FlowVideo, FlowWhatsappButtonList, FlowWhatsappCtaUrlButtonNode, FlowWhatsappTemplate, };
|
|
24
|
-
export type FlowContent = FlowCarousel | FlowImage | FlowText | FlowVideo | FlowWhatsappButtonList | FlowWhatsappCtaUrlButtonNode | FlowWhatsappTemplate | FlowHandoff | FlowKnowledgeBase | FlowBotAction | FlowAiAgent | FlowRating | FlowCountryConditional | FlowChannelConditional | FlowQueueStatusConditional | FlowCustomConditional | FlowGoToFlow | FlowCaptureUserInput | FlowAiAgentRouter;
|
|
24
|
+
export { FlowAiAgentRouter, FlowAiAgent, FlowBotAction, FlowCaptureUserInput, FlowCarousel, FlowChannelConditional, FlowCountryConditional, FlowCustomConditional, FlowGoToFlow, FlowHandoff, FlowImage, FlowKnowledgeBase, FlowQueueStatusConditional, FlowRating, FlowText, FlowVideo, FlowWhatsappButtonList, FlowWhatsappCtaUrlButtonNode, FlowWhatsappTemplate, FlowCustomConditionalV2, };
|
|
25
|
+
export type FlowContent = FlowCarousel | FlowImage | FlowText | FlowVideo | FlowWhatsappButtonList | FlowWhatsappCtaUrlButtonNode | FlowWhatsappTemplate | FlowHandoff | FlowKnowledgeBase | FlowBotAction | FlowAiAgent | FlowRating | FlowCountryConditional | FlowChannelConditional | FlowQueueStatusConditional | FlowCustomConditional | FlowGoToFlow | FlowCaptureUserInput | FlowAiAgentRouter | FlowCustomConditionalV2;
|
|
25
26
|
export { DISABLED_MEMORY_LENGTH };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DISABLED_MEMORY_LENGTH = exports.FlowWhatsappTemplate = exports.FlowWhatsappCtaUrlButtonNode = exports.FlowWhatsappButtonList = exports.FlowVideo = exports.FlowText = exports.FlowRating = exports.FlowQueueStatusConditional = exports.FlowKnowledgeBase = exports.FlowImage = exports.FlowHandoff = exports.FlowGoToFlow = exports.FlowCustomConditional = exports.FlowCountryConditional = exports.FlowChannelConditional = exports.FlowCarousel = exports.FlowCaptureUserInput = exports.FlowBotAction = exports.FlowAiAgent = exports.FlowAiAgentRouter = exports.FlowElement = exports.FlowButton = exports.ContentFieldsBase = void 0;
|
|
3
|
+
exports.DISABLED_MEMORY_LENGTH = exports.FlowCustomConditionalV2 = exports.FlowWhatsappTemplate = exports.FlowWhatsappCtaUrlButtonNode = exports.FlowWhatsappButtonList = exports.FlowVideo = exports.FlowText = exports.FlowRating = exports.FlowQueueStatusConditional = exports.FlowKnowledgeBase = exports.FlowImage = exports.FlowHandoff = exports.FlowGoToFlow = exports.FlowCustomConditional = exports.FlowCountryConditional = exports.FlowChannelConditional = exports.FlowCarousel = exports.FlowCaptureUserInput = exports.FlowBotAction = exports.FlowAiAgent = exports.FlowAiAgentRouter = exports.FlowElement = exports.FlowButton = exports.ContentFieldsBase = void 0;
|
|
4
|
+
const flow_custom_condition_v2_1 = require("./custom-conditional/flow-custom-condition-v2");
|
|
5
|
+
Object.defineProperty(exports, "FlowCustomConditionalV2", { enumerable: true, get: function () { return flow_custom_condition_v2_1.FlowCustomConditionalV2; } });
|
|
4
6
|
const flow_ai_agent_1 = require("./flow-ai-agent");
|
|
5
7
|
Object.defineProperty(exports, "FlowAiAgent", { enumerable: true, get: function () { return flow_ai_agent_1.FlowAiAgent; } });
|
|
6
8
|
const flow_ai_agent_router_1 = require("./flow-ai-agent-router");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/content-fields/index.ts"],"names":[],"mappings":";;;AAAA,mDAA6C;AA4B3C,4FA5BO,2BAAW,OA4BP;AA3Bb,iEAA0D;AA0BxD,kGA1BO,wCAAiB,OA0BP;AAzBnB,uDAAiD;AA2B/C,8FA3BO,+BAAa,OA2BP;AA1Bf,uEAAgE;AA2B9D,qGA3BO,8CAAoB,OA2BP;AA1BtB,mDAA8C;AA2B5C,6FA3BO,4BAAY,OA2BP;AA1Bd,yEAAmE;AA2BjE,uGA3BO,iDAAsB,OA2BP;AA1BxB,yEAAmE;AA2BjE,uGA3BO,iDAAsB,OA2BP;AA1BxB,uEAAiE;AA2B/D,sGA3BO,+CAAqB,OA2BP;AA1BvB,uDAAgD;AA2B9C,6FA3BO,8BAAY,OA2BP;AA1Bd,iDAA4C;AA2B1C,4FA3BO,0BAAW,OA2BP;AA1Bb,6CAAwC;AA2BtC,0FA3BO,sBAAS,OA2BP;AA1BX,+DAG8B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/content-fields/index.ts"],"names":[],"mappings":";;;AAAA,4FAAuF;AA+CrF,wGA/CO,kDAAuB,OA+CP;AA9CzB,mDAA6C;AA4B3C,4FA5BO,2BAAW,OA4BP;AA3Bb,iEAA0D;AA0BxD,kGA1BO,wCAAiB,OA0BP;AAzBnB,uDAAiD;AA2B/C,8FA3BO,+BAAa,OA2BP;AA1Bf,uEAAgE;AA2B9D,qGA3BO,8CAAoB,OA2BP;AA1BtB,mDAA8C;AA2B5C,6FA3BO,4BAAY,OA2BP;AA1Bd,yEAAmE;AA2BjE,uGA3BO,iDAAsB,OA2BP;AA1BxB,yEAAmE;AA2BjE,uGA3BO,iDAAsB,OA2BP;AA1BxB,uEAAiE;AA2B/D,sGA3BO,+CAAqB,OA2BP;AA1BvB,uDAAgD;AA2B9C,6FA3BO,8BAAY,OA2BP;AA1Bd,iDAA4C;AA2B1C,4FA3BO,0BAAW,OA2BP;AA1Bb,6CAAwC;AA2BtC,0FA3BO,sBAAS,OA2BP;AA1BX,+DAG8B;AAyDrB,uGA3DP,4CAAsB,OA2DO;AAjC7B,kGAzBA,uCAAiB,OAyBA;AAvBnB,mFAA4E;AAwB1E,2GAxBO,0DAA0B,OAwBP;AAvB5B,+CAA0C;AAwBxC,2FAxBO,wBAAU,OAwBP;AAvBZ,2CAAsC;AAwBpC,yFAxBO,oBAAQ,OAwBP;AAvBV,6CAAwC;AAwBtC,0FAxBO,sBAAS,OAwBP;AAvBX,iFAA6E;AAyB3E,6GAzBO,2DAA4B,OAyBP;AAxB9B,qEAA+D;AAyB7D,qGAzBO,6CAAoB,OAyBP;AAxBtB,gGAAyF;AAsBvF,uGAtBO,kDAAsB,OAsBP;AApBxB,6DAAyD;AAAhD,wHAAA,iBAAiB,OAAA;AAC1B,6CAA0C;AAAjC,yGAAA,UAAU,OAAA;AACnB,+CAA4C;AAAnC,2GAAA,WAAW,OAAA"}
|
package/lib/esm/flow-factory.js
CHANGED
|
@@ -44,6 +44,8 @@ class FlowFactory {
|
|
|
44
44
|
return content_fields_1.FlowWhatsappTemplate.fromHubtypeCMS(hubtypeContent, this.locale);
|
|
45
45
|
case hubtype_fields_1.HtNodeWithContentType.CAPTURE_USER_INPUT:
|
|
46
46
|
return flow_capture_user_input_1.FlowCaptureUserInput.fromHubtypeCMS(hubtypeContent);
|
|
47
|
+
case hubtype_fields_1.HtNodeWithContentType.CUSTOM_CONDITION:
|
|
48
|
+
return content_fields_1.FlowCustomConditionalV2.fromHubtypeCMS(hubtypeContent, this.botContext);
|
|
47
49
|
default:
|
|
48
50
|
return undefined;
|
|
49
51
|
}
|
|
@@ -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,qDAqByB;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,CAAC,cAAc,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;YAC1E,KAAK,sCAAqB,CAAC,KAAK;gBAC9B,OAAO,0BAAS,CAAC,cAAc,CAAC,cAAc,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;YAC9D,KAAK,sCAAqB,CAAC,QAAQ;gBACjC,OAAO,6BAAY,CAAC,cAAc,CAChC,cAAc,EACd,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,MAAM,CACZ,CAAA;YACH,KAAK,sCAAqB,CAAC,KAAK;gBAC9B,OAAO,0BAAS,CAAC,cAAc,CAAC,cAAc,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;YAC9D,KAAK,sCAAqB,CAAC,oBAAoB;gBAC7C,OAAO,uCAAsB,CAAC,cAAc,CAC1C,cAAc,EACd,IAAI,CAAC,MAAM,EACX,IA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,CAAC,cAAc,CAAC,cAAc,CAAC,CAAA;YAE5D,KAAK,sCAAqB,CAAC,gBAAgB;gBACzC,OAAO,wCAAuB,CAAC,cAAc,CAC3C,cAAc,EACd,IAAI,CAAC,UAAU,CAChB,CAAA;YAEH;gBACE,OAAO,SAAS,CAAA;QACpB,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,0BAA0B,CACtC,cAA8B;QAE9B,QAAQ,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;YACtC,KAAK,eAAe;gBAClB,OAAO,uCAAsB,CAAC,cAAc,CAC1C,cAAc,EACd,IAAI,CAAC,UAAU,CAChB,CAAA;YACH,KAAK,kBAAkB;gBACrB,OAAO,uCAAsB,CAAC,cAAc,CAC1C,cAAc,EACd,IAAI,CAAC,UAAU,CAChB,CAAA;YACH,KAAK,oBAAoB;gBACvB,OAAO,2CAA0B,CAAC,cAAc,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;AAhHD,kCAgHC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botonic/plugin-flow-builder",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.51.0",
|
|
4
4
|
"main": "./lib/cjs/index.js",
|
|
5
5
|
"module": "./lib/esm/index.js",
|
|
6
6
|
"description": "Use Flow Builder to show your contents",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"format": "biome format --write src/ tests/"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@botonic/react": "^0.
|
|
18
|
+
"@botonic/react": "^0.51.0",
|
|
19
19
|
"axios": "^1.15.2",
|
|
20
20
|
"uuid": "^10.0.0"
|
|
21
21
|
},
|