@botonic/plugin-flow-builder 0.56.0 → 0.57.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.
Files changed (87) hide show
  1. package/lib/cjs/api.d.ts +3 -2
  2. package/lib/cjs/api.js +20 -17
  3. package/lib/cjs/api.js.map +1 -1
  4. package/lib/cjs/bot-context-manager.d.ts +17 -0
  5. package/lib/cjs/bot-context-manager.js +93 -0
  6. package/lib/cjs/bot-context-manager.js.map +1 -0
  7. package/lib/cjs/constants.d.ts +2 -1
  8. package/lib/cjs/constants.js +3 -2
  9. package/lib/cjs/constants.js.map +1 -1
  10. package/lib/cjs/content-fields/contact-reasons-conditional-matcher.d.ts +4 -0
  11. package/lib/cjs/content-fields/contact-reasons-conditional-matcher.js +12 -0
  12. package/lib/cjs/content-fields/contact-reasons-conditional-matcher.js.map +1 -0
  13. package/lib/cjs/content-fields/flow-contact-reasons-conditional.d.ts +13 -0
  14. package/lib/cjs/content-fields/flow-contact-reasons-conditional.js +45 -0
  15. package/lib/cjs/content-fields/flow-contact-reasons-conditional.js.map +1 -0
  16. package/lib/cjs/content-fields/flow-handoff.d.ts +7 -1
  17. package/lib/cjs/content-fields/flow-handoff.js +38 -3
  18. package/lib/cjs/content-fields/flow-handoff.js.map +1 -1
  19. package/lib/cjs/content-fields/hubtype-fields/contact-reasons-conditional.d.ts +16 -0
  20. package/lib/cjs/content-fields/hubtype-fields/contact-reasons-conditional.js +3 -0
  21. package/lib/cjs/content-fields/hubtype-fields/contact-reasons-conditional.js.map +1 -0
  22. package/lib/cjs/content-fields/hubtype-fields/handoff.d.ts +6 -1
  23. package/lib/cjs/content-fields/hubtype-fields/node-types.d.ts +2 -1
  24. package/lib/cjs/content-fields/hubtype-fields/node-types.js +1 -0
  25. package/lib/cjs/content-fields/hubtype-fields/node-types.js.map +1 -1
  26. package/lib/cjs/content-fields/hubtype-fields/nodes.d.ts +2 -1
  27. package/lib/cjs/content-fields/index.d.ts +3 -2
  28. package/lib/cjs/content-fields/index.js +3 -1
  29. package/lib/cjs/content-fields/index.js.map +1 -1
  30. package/lib/cjs/flow-factory.js +2 -0
  31. package/lib/cjs/flow-factory.js.map +1 -1
  32. package/lib/cjs/index.d.ts +5 -9
  33. package/lib/cjs/index.js +16 -64
  34. package/lib/cjs/index.js.map +1 -1
  35. package/lib/cjs/types.d.ts +2 -2
  36. package/lib/cjs/types.js.map +1 -1
  37. package/lib/esm/api.d.ts +3 -2
  38. package/lib/esm/api.js +20 -17
  39. package/lib/esm/api.js.map +1 -1
  40. package/lib/esm/bot-context-manager.d.ts +17 -0
  41. package/lib/esm/bot-context-manager.js +93 -0
  42. package/lib/esm/bot-context-manager.js.map +1 -0
  43. package/lib/esm/constants.d.ts +2 -1
  44. package/lib/esm/constants.js +3 -2
  45. package/lib/esm/constants.js.map +1 -1
  46. package/lib/esm/content-fields/contact-reasons-conditional-matcher.d.ts +4 -0
  47. package/lib/esm/content-fields/contact-reasons-conditional-matcher.js +12 -0
  48. package/lib/esm/content-fields/contact-reasons-conditional-matcher.js.map +1 -0
  49. package/lib/esm/content-fields/flow-contact-reasons-conditional.d.ts +13 -0
  50. package/lib/esm/content-fields/flow-contact-reasons-conditional.js +45 -0
  51. package/lib/esm/content-fields/flow-contact-reasons-conditional.js.map +1 -0
  52. package/lib/esm/content-fields/flow-handoff.d.ts +7 -1
  53. package/lib/esm/content-fields/flow-handoff.js +38 -3
  54. package/lib/esm/content-fields/flow-handoff.js.map +1 -1
  55. package/lib/esm/content-fields/hubtype-fields/contact-reasons-conditional.d.ts +16 -0
  56. package/lib/esm/content-fields/hubtype-fields/contact-reasons-conditional.js +3 -0
  57. package/lib/esm/content-fields/hubtype-fields/contact-reasons-conditional.js.map +1 -0
  58. package/lib/esm/content-fields/hubtype-fields/handoff.d.ts +6 -1
  59. package/lib/esm/content-fields/hubtype-fields/node-types.d.ts +2 -1
  60. package/lib/esm/content-fields/hubtype-fields/node-types.js +1 -0
  61. package/lib/esm/content-fields/hubtype-fields/node-types.js.map +1 -1
  62. package/lib/esm/content-fields/hubtype-fields/nodes.d.ts +2 -1
  63. package/lib/esm/content-fields/index.d.ts +3 -2
  64. package/lib/esm/content-fields/index.js +3 -1
  65. package/lib/esm/content-fields/index.js.map +1 -1
  66. package/lib/esm/flow-factory.js +2 -0
  67. package/lib/esm/flow-factory.js.map +1 -1
  68. package/lib/esm/index.d.ts +5 -9
  69. package/lib/esm/index.js +16 -64
  70. package/lib/esm/index.js.map +1 -1
  71. package/lib/esm/types.d.ts +2 -2
  72. package/lib/esm/types.js.map +1 -1
  73. package/package.json +2 -2
  74. package/src/api.ts +29 -20
  75. package/src/bot-context-manager.ts +153 -0
  76. package/src/constants.ts +2 -1
  77. package/src/content-fields/contact-reasons-conditional-matcher.ts +24 -0
  78. package/src/content-fields/flow-contact-reasons-conditional.tsx +60 -0
  79. package/src/content-fields/flow-handoff.tsx +49 -7
  80. package/src/content-fields/hubtype-fields/contact-reasons-conditional.ts +18 -0
  81. package/src/content-fields/hubtype-fields/handoff.ts +11 -1
  82. package/src/content-fields/hubtype-fields/node-types.ts +1 -0
  83. package/src/content-fields/hubtype-fields/nodes.ts +2 -0
  84. package/src/content-fields/index.ts +3 -0
  85. package/src/flow-factory.ts +7 -0
  86. package/src/index.ts +26 -113
  87. package/src/types.ts +1 -2
@@ -0,0 +1,13 @@
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
+ defaultTarget?: HtNodeLink;
8
+ static fromHubtypeCMS(component: HtContactReasonsNode, botContext: BotContext): FlowContactReasonsConditional;
9
+ private setFollowUp;
10
+ trackFlow(_botContext: BotContext): Promise<void>;
11
+ processContent(_botContext: BotContext): Promise<void>;
12
+ toBotonic(): import("react/jsx-runtime").JSX.Element;
13
+ }
@@ -0,0 +1,45 @@
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 contact_reasons_conditional_matcher_1 = require("./contact-reasons-conditional-matcher");
6
+ const content_fields_base_1 = require("./content-fields-base");
7
+ class FlowContactReasonsConditional extends content_fields_base_1.ContentFieldsBase {
8
+ constructor() {
9
+ super(...arguments);
10
+ this.contactReasons = [];
11
+ }
12
+ static fromHubtypeCMS(component, botContext) {
13
+ const newContactReasonsConditional = new FlowContactReasonsConditional(component.id);
14
+ newContactReasonsConditional.contactReasons =
15
+ component.content.contact_reasons;
16
+ newContactReasonsConditional.defaultTarget =
17
+ component.content.default_target;
18
+ newContactReasonsConditional.setFollowUp(botContext);
19
+ return newContactReasonsConditional;
20
+ }
21
+ setFollowUp(botContext) {
22
+ const sessionContactReasons = botContext.session._hubtype_case_contact_reasons;
23
+ if (sessionContactReasons) {
24
+ const matchingBranch = (0, contact_reasons_conditional_matcher_1.findMatchingContactReasonBranch)(sessionContactReasons, this.contactReasons);
25
+ if (matchingBranch?.target) {
26
+ this.followUp = matchingBranch.target;
27
+ }
28
+ }
29
+ this.followUp ?? (this.followUp = this.defaultTarget);
30
+ }
31
+ async trackFlow(_botContext) {
32
+ // await trackFlow(botContext)
33
+ return;
34
+ }
35
+ async processContent(_botContext) {
36
+ // await this.filterContent(botContext, this)
37
+ // await this.trackFlow(botContext)
38
+ return;
39
+ }
40
+ toBotonic() {
41
+ return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
42
+ }
43
+ }
44
+ exports.FlowContactReasonsConditional = FlowContactReasonsConditional;
45
+ //# 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-reasons-conditional.tsx"],"names":[],"mappings":";;;;AACA,+FAAuF;AACvF,+DAAyD;AAOzD,MAAa,6BAA8B,SAAQ,uCAAiB;IAApE;;QACS,mBAAc,GAA4B,EAAE,CAAA;IAiDrD,CAAC;IA9CC,MAAM,CAAC,cAAc,CACnB,SAA+B,EAC/B,UAAsB;QAEtB,MAAM,4BAA4B,GAAG,IAAI,6BAA6B,CACpE,SAAS,CAAC,EAAE,CACb,CAAA;QACD,4BAA4B,CAAC,cAAc;YACzC,SAAS,CAAC,OAAO,CAAC,eAAe,CAAA;QACnC,4BAA4B,CAAC,aAAa;YACxC,SAAS,CAAC,OAAO,CAAC,cAAc,CAAA;QAClC,4BAA4B,CAAC,WAAW,CAAC,UAAU,CAAC,CAAA;QACpD,OAAO,4BAA4B,CAAA;IACrC,CAAC;IAEO,WAAW,CAAC,UAAsB;QACxC,MAAM,qBAAqB,GACzB,UAAU,CAAC,OAAO,CAAC,6BAA6B,CAAA;QAElD,IAAI,qBAAqB,EAAE,CAAC;YAC1B,MAAM,cAAc,GAAG,IAAA,qEAA+B,EACpD,qBAAqB,EACrB,IAAI,CAAC,cAAc,CACpB,CAAA;YACD,IAAI,cAAc,EAAE,MAAM,EAAE,CAAC;gBAC3B,IAAI,CAAC,QAAQ,GAAG,cAAc,CAAC,MAAM,CAAA;YACvC,CAAC;QACH,CAAC;QAED,IAAI,CAAC,QAAQ,KAAb,IAAI,CAAC,QAAQ,GAAK,IAAI,CAAC,aAAa,EAAA;IACtC,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,WAAuB;QACrC,8BAA8B;QAC9B,OAAM;IACR,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,WAAuB;QAC1C,6CAA6C;QAC7C,mCAAmC;QACnC,OAAM;IACR,CAAC;IAED,SAAS;QACP,OAAO,kDAAK,CAAA;IACd,CAAC;CACF;AAlDD,sEAkDC"}
@@ -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 { HtHandoffNode, HtQueueLocale } from './hubtype-fields';
4
+ import type { HtHandoffNode, HtNodeLink, 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,6 +4,7 @@ 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");
9
10
  class FlowHandoff extends content_fields_base_1.ContentFieldsBase {
@@ -11,19 +12,53 @@ class FlowHandoff extends content_fields_base_1.ContentFieldsBase {
11
12
  const newHandoff = new FlowHandoff(cmsHandoff.id);
12
13
  newHandoff.code = cmsHandoff.code;
13
14
  newHandoff.queue = FlowHandoff.getQueueByLocale(locale, cmsHandoff.content.queue);
14
- newHandoff.onFinishPayload = FlowHandoff.getOnFinishPayload(cmsHandoff, cmsApi);
15
+ newHandoff.hasDifferentiatedCloseTypes =
16
+ cmsHandoff.content.has_differentiated_close_types;
17
+ newHandoff.resolvedByAgent = cmsHandoff.content.resolved_by_agent;
18
+ newHandoff.discardedByAgent = cmsHandoff.content.discarded_by_agent;
19
+ newHandoff.discardedByUser = cmsHandoff.content.discarded_by_user;
20
+ newHandoff.discardedBySystem = cmsHandoff.content.discarded_by_system;
15
21
  newHandoff.handoffAutoAssign = cmsHandoff.content.has_auto_assign;
16
22
  newHandoff.hasQueuePositionChangedNotificationsEnabled =
17
23
  cmsHandoff.content.has_queue_position_changed_notifications_enabled;
18
- newHandoff.followUp = cmsHandoff.follow_up;
24
+ newHandoff.onFinishPayload = FlowHandoff.getOnFinishPayload(cmsHandoff, cmsApi);
25
+ newHandoff.followUp = undefined;
19
26
  return newHandoff;
20
27
  }
21
28
  static getOnFinishPayload(cmsHandoff, cmsApi) {
22
- if (cmsHandoff.target?.id) {
29
+ if (cmsHandoff.content.has_differentiated_close_types) {
30
+ return `${constants_1.ON_CLOSE_HANDOFF_PAYLOAD}${constants_1.SEPARATOR}${cmsHandoff.id}`;
31
+ }
32
+ else if (cmsHandoff.target?.id) {
23
33
  return cmsApi.getPayload(cmsHandoff.target);
24
34
  }
25
35
  return undefined;
26
36
  }
37
+ resolveOnClosePayload(botContext) {
38
+ const contactReasons = botContext.session._hubtype_case_contact_reasons || [];
39
+ if (contactReasons.some(reason => reason.name === 'discarded')) {
40
+ if (this.discardedByAgent?.id) {
41
+ return this.discardedByAgent.id;
42
+ }
43
+ console.error('No discarded by agent target found');
44
+ }
45
+ if (contactReasons.some(reason => reason.name === 'discarded_by_user')) {
46
+ if (this.discardedByUser?.id) {
47
+ return this.discardedByUser.id;
48
+ }
49
+ console.error('No discarded by user target found');
50
+ }
51
+ if (contactReasons.some(reason => reason.name === 'discarded_by_system')) {
52
+ if (this.discardedBySystem?.id) {
53
+ return this.discardedBySystem.id;
54
+ }
55
+ console.error('No discarded by system target found');
56
+ }
57
+ if (this.resolvedByAgent?.id) {
58
+ return this.resolvedByAgent.id;
59
+ }
60
+ throw new Error('No resolved by agent target found');
61
+ }
27
62
  async doHandoff(botContext) {
28
63
  const handOffBuilder = new core_1.HandOffBuilder(botContext.session);
29
64
  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;AAGhD,0CAAuE;AACvE,+DAAyD;AAGzD,MAAa,WAAY,SAAQ,uCAAiB;IAOhD,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,eAAe,GAAG,WAAW,CAAC,kBAAkB,CACzD,UAAU,EACV,MAAM,CACP,CAAA;QACD,UAAU,CAAC,iBAAiB,GAAG,UAAU,CAAC,OAAO,CAAC,eAAe,CAAA;QACjE,UAAU,CAAC,2CAA2C;YACpD,UAAU,CAAC,OAAO,CAAC,gDAAgD,CAAA;QACrE,UAAU,CAAC,QAAQ,GAAG,UAAU,CAAC,SAAS,CAAA;QAE1C,OAAO,UAAU,CAAA;IACnB,CAAC;IAEO,MAAM,CAAC,kBAAkB,CAC/B,UAAyB,EACzB,MAAsB;QAEtB,IAAI,UAAU,CAAC,MAAM,EAAE,EAAE,EAAE,CAAC;YAC1B,OAAO,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,CAAA;QAC7C,CAAC;QAED,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,UAAsB;QACpC,MAAM,cAAc,GAAG,IAAI,qBAAc,CAAC,UAAU,CAA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iB;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,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=contact-reasons-conditional.js.map
@@ -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,4 +1,4 @@
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
3
  export interface HtHandoffNode extends HtBaseNode {
4
4
  type: HtNodeWithContentType.HANDOFF;
@@ -7,5 +7,10 @@ export interface HtHandoffNode extends HtBaseNode {
7
7
  payload: HtPayloadLocale[];
8
8
  has_auto_assign: boolean;
9
9
  has_queue_position_changed_notifications_enabled: boolean;
10
+ has_differentiated_close_types: boolean;
11
+ resolved_by_agent?: HtNodeLink;
12
+ discarded_by_agent?: HtNodeLink;
13
+ discarded_by_user?: HtNodeLink;
14
+ discarded_by_system?: HtNodeLink;
10
15
  };
11
16
  }
@@ -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,qBAuBX;AAvBD,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;AAC3B,CAAC,EAvBW,qBAAqB,qCAArB,qBAAqB,QAuBhC;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"}
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;AAsCrF,wGAtCO,kDAAuB,OAsCP;AArCzB,mDAA6C;AA6B3C,4FA7BO,2BAAW,OA6BP;AA5Bb,iEAA0D;AA6BxD,kGA7BO,wCAAiB,OA6BP;AA5BnB,uDAAiD;AA6B/C,8FA7BO,+BAAa,OA6BP;AA5Bf,uEAAgE;AA6B9D,qGA7BO,8CAAoB,OA6BP;AA5BtB,mDAA8C;AA6B5C,6FA7BO,4BAAY,OA6BP;AA5Bd,yEAAmE;AA6BjE,uGA7BO,iDAAsB,OA6BP;AA5BxB,yEAAmE;AA6BjE,uGA7BO,iDAAsB,OA6BP;AA5BxB,uEAAiE;AA6B/D,sGA7BO,+CAAqB,OA6BP;AA5BvB,uDAAiD;AA8B/C,8FA9BO,+BAAa,OA8BP;AA7Bf,uDAAgD;AA8B9C,6FA9BO,8BAAY,OA8BP;AA7Bd,iDAA4C;AA8B1C,4FA9BO,0BAAW,OA8BP;AA7Bb,6CAAwC;AA8BtC,0FA9BO,sBAAS,OA8BP;AA7BX,mFAA4E;AA8B1E,2GA9BO,0DAA0B,OA8BP;AA7B5B,+CAA0C;AA8BxC,2FA9BO,wBAAU,OA8BP;AA7BZ,2CAAsC;AA8BpC,yFA9BO,oBAAQ,OA8BP;AA7BV,6CAAwC;AA8BtC,0FA9BO,sBAAS,OA8BP;AA7BX,iFAA6E;AAiC3E,6GAjCO,2DAA4B,OAiCP;AAhC9B,6FAAyF;AAiCvF,mHAjCO,uEAAkC,OAiCP;AAhCpC,qEAA+D;AAiC7D,qGAjCO,6CAAoB,OAiCP;AAhCtB,iEAI+B;AAuB7B,uGA1BA,6CAAsB,OA0BA;AACtB,0GA1BA,gDAAyB,OA0BA;AACzB,8GA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oB,OAkCP;AAjCtB,iEAI+B;AAwB7B,uGA3BA,6CAAsB,OA2BA;AACtB,0GA3BA,gDAAyB,OA2BA;AACzB,8GA3BA,oDAA6B,OA2BA;AAxB/B,6DAAyD;AAAhD,wHAAA,iBAAiB,OAAA;AAC1B,6CAA0C;AAAjC,yGAAA,UAAU,OAAA;AACnB,+CAA4C;AAAnC,2GAAA,WAAW,OAAA"}
@@ -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,qDAsByB;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,CAA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C,cAAc,CAAC,cAAc,CAAC,CAAA;YAE5D,KAAK,sCAAqB,CAAC,gBAAgB;gBACzC,OAAO,wCAAuB,CAAC,cAAc,CAC3C,cAAc,EACd,IAAI,CAAC,UAAU,CAChB,CAAA;YAEH,KAAK,sCAAqB,CAAC,UAAU;gBACnC,OAAO,8BAAa,CAAC,cAAc,CAAC,cAAc,CAAC,CAAA;YAErD,KAAK,sCAAqB,CAAC,yBAAyB;gBAClD,OAAO,8CAA6B,CAAC,cAAc,CACjD,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;AAlID,kCAkIC"}
@@ -1,4 +1,4 @@
1
- import { type Plugin, type PluginPreRequest, type ResolvedPlugins, type Session } from '@botonic/core';
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 currentRequest;
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(request: PluginPreRequest): string;
24
- pre(request: PluginPreRequest): Promise<void>;
25
- private resolveWhatsappContactRequestPayload;
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,73 +37,27 @@ class BotonicPluginFlowBuilder {
39
37
  this.disableAIAgentInFirstInteraction =
40
38
  options.disableAIAgentInFirstInteraction || false;
41
39
  }
42
- resolveFlowUrl(request) {
43
- if (request.session.is_test_integration) {
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(request) {
49
- // When AI Agent is executed in Whatsapp, button payloads come as referral and must be converted to text being processed by the agent.
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(request),
49
+ flowUrl: this.resolveFlowUrl(botContext),
54
50
  url: this.apiUrl,
55
51
  flow: this.flow,
56
- accessToken: this.getAccessToken(request.session),
57
- request: this.currentRequest,
52
+ accessToken: this.getAccessToken(botContext.session),
53
+ botContext: this.botContext,
58
54
  });
59
- this.resolveWhatsappContactRequestPayload(request);
60
- const checkUserTextInput = (0, input_1.inputHasTextOrTranscript)(request.input) && !request.input.payload;
61
- if (checkUserTextInput) {
62
- const resolvedLocale = this.cmsApi.getResolvedLocale();
63
- const nextPayload = await (0, user_input_1.getNextPayloadByUserInput)(this.cmsApi, resolvedLocale, request, this.smartIntentsConfig);
64
- request.input.payload = nextPayload;
65
- }
66
- await this.updateRequestBeforeRoutes(request);
67
- }
68
- resolveWhatsappContactRequestPayload(request) {
69
- if (request.input.type !== core_1.INPUT.CONTACT ||
70
- request.input.origin !== core_1.WhatsappInputOrigin.ContactRequest) {
71
- return;
72
- }
73
- const whatsappRequestContactInfoNode = this.cmsApi.getWhatsappRequestContactInfoNode();
74
- if (whatsappRequestContactInfoNode) {
75
- request.input.payload = this.cmsApi.getPayload(whatsappRequestContactInfoNode.content.button.target);
76
- }
77
- this.cmsApi.removeWhatsappRequestContactId();
78
- }
79
- convertWhatsappAiAgentEmptyPayloads(request) {
80
- if (request.session.user.provider === core_1.PROVIDER.WHATSAPP) {
81
- const shouldUseReferral = request.input.referral &&
82
- request.input.payload?.startsWith(constants_1.EMPTY_PAYLOAD);
83
- if (shouldUseReferral) {
84
- request.input.type = core_1.INPUT.TEXT;
85
- request.input.data = request.input.referral;
86
- }
87
- }
88
- }
89
- async updateRequestBeforeRoutes(request) {
90
- this.cmsApi.removeCaptureUserInputId();
91
- if (request.input.payload) {
92
- request.input.payload = this.removeSourceSuffix(request.input.payload);
93
- if (this.cmsApi.isBotAction(request.input.payload)) {
94
- const cmsBotAction = this.cmsApi.getNodeById(request.input.payload);
95
- request.input.payload =
96
- this.cmsApi.createPayloadWithParams(cmsBotAction);
97
- // Re-execute convertWhatsappAiAgentEmptyPayloads function to handle
98
- // the case that a BotAction has a payload equals to EMPTY_PAYLOAD
99
- this.convertWhatsappAiAgentEmptyPayloads(request);
100
- }
101
- }
102
- }
103
- removeSourceSuffix(payload) {
104
- 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.updateBeforeRoutes(botContext);
105
57
  }
106
- post(request) {
107
- request.input.nluResolution = undefined;
108
- delete request.session.user.system_locale_updated;
58
+ post(botContext) {
59
+ botContext.input.nluResolution = undefined;
60
+ delete botContext.session.user.system_locale_updated;
109
61
  }
110
62
  async getContentsByContentID(contentID, prevContents) {
111
63
  const node = this.cmsApi.getNodeByContentID(contentID);
@@ -121,7 +73,7 @@ class BotonicPluginFlowBuilder {
121
73
  }
122
74
  async getStartContents() {
123
75
  const startNode = this.cmsApi.getStartNode();
124
- this.currentRequest.session.flow_thread_id = (0, uuid_1.v7)();
76
+ this.botContext.session.flow_thread_id = (0, uuid_1.v7)();
125
77
  return await this.getContentsByNode(startNode);
126
78
  }
127
79
  async getContentsByNode(node, prevContents) {
@@ -129,11 +81,11 @@ class BotonicPluginFlowBuilder {
129
81
  const resolvedLocale = this.cmsApi.getResolvedLocale();
130
82
  if (node.type === hubtype_fields_1.HtNodeWithContentType.FUNCTION &&
131
83
  !functions_1.DEFAULT_FUNCTION_NAMES.includes(node.content.action)) {
132
- const customFunctionResolver = new functions_1.CustomFunction(this.functions, this.currentRequest, resolvedLocale);
84
+ const customFunctionResolver = new functions_1.CustomFunction(this.functions, this.botContext, resolvedLocale);
133
85
  const targetId = await customFunctionResolver.call(node);
134
86
  return this.getContentsById(targetId, contents);
135
87
  }
136
- const flowFactory = new flow_factory_1.FlowFactory(this.currentRequest, this.cmsApi, resolvedLocale);
88
+ const flowFactory = new flow_factory_1.FlowFactory(this.botContext, this.cmsApi, resolvedLocale);
137
89
  const content = await flowFactory.getFlowContent(node);
138
90
  if (content) {
139
91
  contents.push(content);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,wCAQsB;AAEtB,+BAAmC;AAEnC,+BAAsC;AACtC,2CAKoB;AAEpB,oEAKwC;AACxC,iDAA4C;AAC5C,2CAAoE;AACpE,mCASgB;AAChB,6CAAwD;AAExD,2DAA8D;AAC9D,yCAAwD;AAExD,2EAA2E;AAE3E,MAAqB,wBAAwB;IAkB3C,YAAY,OAA8D;QACxE,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,qCAAyB,CAAA;QACzD,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,8BAAsB,CAAC,MAAM,CAAA;QACvE,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAA;QACxB,IAAI,CAAC,cAAc,GAAG,IAAA,sCAAqB,EAA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G,OAAO,EAAE,KAAK,CAAC,qBAAS,CAAC,CAAC,CAAC,CAAC,CAAA;QAC7C,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,uBAAuB,CAAC,QAAQ,CAAC,CAAA;QAEhE,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAA;QAC1E,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CACpD,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CACtB,CAAA;QACD,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CACnD,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CACvB,CAAA;QAED,OAAO;YACL,GAAG,YAAY;YACf,eAAe;YACf,cAAc;SACf,CAAA;IACH,CAAC;IAED,cAAc,CAAC,WAA8B;QAC3C,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;IAChC,CAAC;CACF;AAhLD,2CAgLC;AAED,mDAAwB;AACxB,yCAAiE;AAAxD,iHAAA,oBAAoB,OAAA;AAAE,0GAAA,aAAa,OAAA;AAC5C,2DAAgC;AAEhC,uCAGmB;AAFjB,qIAAA,yCAAyC,OAAA;AACzC,4GAAA,gBAAgB,OAAA;AAElB,iCAMgB;AAHd,+GAAA,sBAAsB,OAAA;AAIxB,oDAAyB"}
@@ -1,4 +1,4 @@
1
- import type { AiAgentArgs, BotContext, GuardrailRule, InferenceResponse, PluginPreRequest, ResolvedPlugins } from '@botonic/core';
1
+ import type { AiAgentArgs, BotContext, GuardrailRule, InferenceResponse, ResolvedPlugins } from '@botonic/core';
2
2
  import type { FlowContent } from './content-fields';
3
3
  import type { HtFlowBuilderData, HtRatingButton } from './content-fields/hubtype-fields';
4
4
  import type { FlowBuilderContentMessage } from './structured-output/flow-builder-content';
@@ -31,7 +31,7 @@ export interface FlowBuilderApiOptions {
31
31
  flowUrl: string;
32
32
  flow?: HtFlowBuilderData;
33
33
  accessToken: string;
34
- request: PluginPreRequest;
34
+ botContext: BotContext;
35
35
  }
36
36
  export declare enum ProcessEnvNodeEnvs {
37
37
  PRODUCTION = "production",
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;AAwEA,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,+CAAyB,CAAA;IACzB,iDAA2B,CAAA;AAC7B,CAAC,EAHW,kBAAkB,kCAAlB,kBAAkB,QAG7B;AAED,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAChC,yCAAe,CAAA;IACf,2CAAiB,CAAA;AACnB,CAAC,EAHW,sBAAsB,sCAAtB,sBAAsB,QAGjC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;AAuEA,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,+CAAyB,CAAA;IACzB,iDAA2B,CAAA;AAC7B,CAAC,EAHW,kBAAkB,kCAAlB,kBAAkB,QAG7B;AAED,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAChC,yCAAe,CAAA;IACf,2CAAiB,CAAA;AACnB,CAAC,EAHW,sBAAsB,sCAAtB,sBAAsB,QAGjC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botonic/plugin-flow-builder",
3
- "version": "0.56.0",
3
+ "version": "0.57.0-alpha.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.56.0",
18
+ "@botonic/react": "^0.57.0-alpha.0",
19
19
  "axios": "^1.18.1",
20
20
  "uuid": "^10.0.0"
21
21
  },