@botonic/core 0.43.0 → 0.44.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/core-bot.js +83 -91
- package/lib/cjs/core-bot.js.map +1 -1
- package/lib/cjs/debug/inspector.js.map +1 -1
- package/lib/cjs/handoff.js +124 -140
- package/lib/cjs/handoff.js.map +1 -1
- package/lib/cjs/hubtype-service.js +36 -35
- package/lib/cjs/hubtype-service.js.map +1 -1
- package/lib/cjs/models/hubtype-analytics.d.ts +12 -4
- package/lib/cjs/models/hubtype-analytics.js +4 -3
- package/lib/cjs/models/hubtype-analytics.js.map +1 -1
- package/lib/cjs/models/legacy-types.d.ts +3 -0
- package/lib/cjs/models/legacy-types.js +7 -7
- package/lib/cjs/models/legacy-types.js.map +1 -1
- package/lib/cjs/plugins.js +17 -18
- package/lib/cjs/plugins.js.map +1 -1
- package/lib/cjs/pusher-utils.js +1 -2
- package/lib/cjs/pusher-utils.js.map +1 -1
- package/lib/cjs/routing/router-utils.js +19 -22
- package/lib/cjs/routing/router-utils.js.map +1 -1
- package/lib/cjs/routing/router.js +20 -16
- package/lib/cjs/routing/router.js.map +1 -1
- package/lib/cjs/utils.js +12 -13
- package/lib/cjs/utils.js.map +1 -1
- package/lib/esm/constants.js +7 -4
- package/lib/esm/constants.js.map +1 -1
- package/lib/esm/core-bot.js +94 -98
- package/lib/esm/core-bot.js.map +1 -1
- package/lib/esm/debug/index.js +4 -1
- package/lib/esm/debug/index.js.map +1 -1
- package/lib/esm/debug/inspector.js +11 -4
- package/lib/esm/debug/inspector.js.map +1 -1
- package/lib/esm/handoff.js +139 -143
- package/lib/esm/handoff.js.map +1 -1
- package/lib/esm/hubtype-service.js +46 -41
- package/lib/esm/hubtype-service.js.map +1 -1
- package/lib/esm/index.js +12 -9
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/models/ai-agents.js +2 -1
- package/lib/esm/models/hubtype-analytics.d.ts +12 -4
- package/lib/esm/models/hubtype-analytics.js +11 -7
- package/lib/esm/models/hubtype-analytics.js.map +1 -1
- package/lib/esm/models/index.js +7 -4
- package/lib/esm/models/index.js.map +1 -1
- package/lib/esm/models/knowledge-bases.js +2 -1
- package/lib/esm/models/legacy-types.d.ts +3 -0
- package/lib/esm/models/legacy-types.js +17 -14
- package/lib/esm/models/legacy-types.js.map +1 -1
- package/lib/esm/plugins.js +19 -16
- package/lib/esm/plugins.js.map +1 -1
- package/lib/esm/pusher-utils.js +6 -3
- package/lib/esm/pusher-utils.js.map +1 -1
- package/lib/esm/routing/index.js +5 -2
- package/lib/esm/routing/index.js.map +1 -1
- package/lib/esm/routing/router-utils.js +35 -28
- package/lib/esm/routing/router-utils.js.map +1 -1
- package/lib/esm/routing/router.js +45 -37
- package/lib/esm/routing/router.js.map +1 -1
- package/lib/esm/utils.js +44 -27
- package/lib/esm/utils.js.map +1 -1
- package/package.json +2 -2
- package/src/models/hubtype-analytics.ts +11 -3
- package/src/models/legacy-types.ts +3 -0
package/lib/cjs/utils.js
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.dirname = exports.join = exports.params2queryString = exports.isMobile = exports.isBrowser = exports.isNode = void 0;
|
|
4
|
+
exports.isFunction = isFunction;
|
|
5
|
+
exports.cloneObject = cloneObject;
|
|
6
|
+
exports.isDev = isDev;
|
|
7
|
+
exports.isWebchat = isWebchat;
|
|
8
|
+
exports.isWhatsapp = isWhatsapp;
|
|
9
|
+
exports.isTelegram = isTelegram;
|
|
10
|
+
exports.isFacebook = isFacebook;
|
|
11
|
+
exports.isInstagram = isInstagram;
|
|
12
|
+
exports.isTwitter = isTwitter;
|
|
4
13
|
const legacy_types_1 = require("./models/legacy-types");
|
|
5
14
|
const isNode = () => {
|
|
6
15
|
// @ts-ignore
|
|
@@ -13,14 +22,13 @@ const isNode = () => {
|
|
|
13
22
|
};
|
|
14
23
|
exports.isNode = isNode;
|
|
15
24
|
const isBrowser = () => {
|
|
16
|
-
var _a, _b;
|
|
17
25
|
// @ts-ignore
|
|
18
26
|
return typeof IS_BROWSER !== 'undefined'
|
|
19
27
|
? // @ts-ignore
|
|
20
28
|
IS_BROWSER
|
|
21
29
|
: typeof window !== 'undefined' &&
|
|
22
30
|
typeof window.document !== 'undefined' &&
|
|
23
|
-
!
|
|
31
|
+
!window.process?.versions?.node; // In Jest window.process?.versions?.node is defined
|
|
24
32
|
};
|
|
25
33
|
exports.isBrowser = isBrowser;
|
|
26
34
|
const isMobile = (mobileBreakpoint = 460) => {
|
|
@@ -36,13 +44,11 @@ exports.isMobile = isMobile;
|
|
|
36
44
|
function isFunction(o) {
|
|
37
45
|
return typeof o === 'function';
|
|
38
46
|
}
|
|
39
|
-
exports.isFunction = isFunction;
|
|
40
47
|
function cloneObject(object) {
|
|
41
48
|
if (!object)
|
|
42
49
|
return {};
|
|
43
|
-
return
|
|
50
|
+
return { ...object };
|
|
44
51
|
}
|
|
45
|
-
exports.cloneObject = cloneObject;
|
|
46
52
|
const params2queryString = (params) => Object.entries(params)
|
|
47
53
|
.map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`)
|
|
48
54
|
.join('&');
|
|
@@ -87,30 +93,23 @@ exports.dirname = dirname;
|
|
|
87
93
|
function isDev(session) {
|
|
88
94
|
return session.user.provider === legacy_types_1.PROVIDER.DEV;
|
|
89
95
|
}
|
|
90
|
-
exports.isDev = isDev;
|
|
91
96
|
function isWebchat(session) {
|
|
92
97
|
// When the provider is DEV should we return true because it is a webchat?
|
|
93
98
|
return session.user.provider === legacy_types_1.PROVIDER.WEBCHAT;
|
|
94
99
|
}
|
|
95
|
-
exports.isWebchat = isWebchat;
|
|
96
100
|
function isWhatsapp(session) {
|
|
97
101
|
return session.user.provider === legacy_types_1.PROVIDER.WHATSAPP;
|
|
98
102
|
}
|
|
99
|
-
exports.isWhatsapp = isWhatsapp;
|
|
100
103
|
function isTelegram(session) {
|
|
101
104
|
return session.user.provider === legacy_types_1.PROVIDER.TELEGRAM;
|
|
102
105
|
}
|
|
103
|
-
exports.isTelegram = isTelegram;
|
|
104
106
|
function isFacebook(session) {
|
|
105
107
|
return session.user.provider === legacy_types_1.PROVIDER.FACEBOOK;
|
|
106
108
|
}
|
|
107
|
-
exports.isFacebook = isFacebook;
|
|
108
109
|
function isInstagram(session) {
|
|
109
110
|
return session.user.provider === legacy_types_1.PROVIDER.INSTAGRAM;
|
|
110
111
|
}
|
|
111
|
-
exports.isInstagram = isInstagram;
|
|
112
112
|
function isTwitter(session) {
|
|
113
113
|
return session.user.provider === legacy_types_1.PROVIDER.TWITTER;
|
|
114
114
|
}
|
|
115
|
-
exports.isTwitter = isTwitter;
|
|
116
115
|
//# sourceMappingURL=utils.js.map
|
package/lib/cjs/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;;AAmCA,gCAEC;AAED,kCAGC;AAwCD,sBAEC;AAED,8BAGC;AAED,gCAEC;AAED,gCAEC;AAED,gCAEC;AAED,kCAEC;AAED,8BAEC;AA7GD,wDAAyD;AAElD,MAAM,MAAM,GAAG,GAAY,EAAE;IAClC,aAAa;IACb,OAAO,OAAO,OAAO,KAAK,WAAW;QACnC,CAAC,CAAC,aAAa;YACb,OAAO;QACT,CAAC,CAAC,OAAO,OAAO,KAAK,WAAW;YAC5B,OAAO,CAAC,QAAQ,KAAK,IAAI;YACzB,OAAO,CAAC,QAAQ,CAAC,IAAI,KAAK,IAAI,CAAA;AACtC,CAAC,CAAA;AARY,QAAA,MAAM,UAQlB;AAEM,MAAM,SAAS,GAAG,GAAY,EAAE;IACrC,aAAa;IACb,OAAO,OAAO,UAAU,KAAK,WAAW;Q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AAC,IAAI,EAAE,IAAI,CAAC,CAAA;AAApD,QAAA,OAAO,WAA6C;AAEjE,+BAA+B;AAC/B,SAAgB,KAAK,CAAC,OAAgB;IACpC,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,KAAK,uBAAQ,CAAC,GAAG,CAAA;AAC/C,CAAC;AAED,SAAgB,SAAS,CAAC,OAAgB;IACxC,0EAA0E;IAC1E,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,KAAK,uBAAQ,CAAC,OAAO,CAAA;AACnD,CAAC;AAED,SAAgB,UAAU,CAAC,OAAgB;IACzC,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,KAAK,uBAAQ,CAAC,QAAQ,CAAA;AACpD,CAAC;AAED,SAAgB,UAAU,CAAC,OAAgB;IACzC,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,KAAK,uBAAQ,CAAC,QAAQ,CAAA;AACpD,CAAC;AAED,SAAgB,UAAU,CAAC,OAAgB;IACzC,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,KAAK,uBAAQ,CAAC,QAAQ,CAAA;AACpD,CAAC;AAED,SAAgB,WAAW,CAAC,OAAgB;IAC1C,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,KAAK,uBAAQ,CAAC,SAAS,CAAA;AACrD,CAAC;AAED,SAAgB,SAAS,CAAC,OAAgB;IACxC,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,KAAK,uBAAQ,CAAC,OAAO,CAAA;AACnD,CAAC"}
|
package/lib/esm/constants.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PATH_PAYLOAD_REGEXP = exports.PATH_PAYLOAD_IDENTIFIER = exports.EMPTY_ACTION_PATH = exports.NOT_FOUND_PATH = void 0;
|
|
4
|
+
exports.NOT_FOUND_PATH = '404';
|
|
5
|
+
exports.EMPTY_ACTION_PATH = '';
|
|
6
|
+
exports.PATH_PAYLOAD_IDENTIFIER = '__PATH_PAYLOAD__';
|
|
7
|
+
exports.PATH_PAYLOAD_REGEXP = new RegExp(`\\b^${exports.PATH_PAYLOAD_IDENTIFIER}(.*)\\b`);
|
|
5
8
|
//# sourceMappingURL=constants.js.map
|
package/lib/esm/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG,KAAK,CAAA;AACtB,QAAA,iBAAiB,GAAG,EAAE,CAAA;AACtB,QAAA,uBAAuB,GAAG,kBAAkB,CAAA;AAC5C,QAAA,mBAAmB,GAAG,IAAI,MAAM,CAC3C,OAAO,+BAAuB,SAAS,CACxC,CAAA"}
|
package/lib/esm/core-bot.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CoreBot = void 0;
|
|
4
|
+
const debug_1 = require("./debug");
|
|
5
|
+
const models_1 = require("./models");
|
|
6
|
+
const plugins_1 = require("./plugins");
|
|
7
|
+
const routing_1 = require("./routing");
|
|
8
|
+
class CoreBot {
|
|
7
9
|
constructor({ renderer, routes, theme, plugins, appId, defaultTyping = 0.6, defaultDelay = 0.4, defaultRoutes, inspector, }) {
|
|
8
10
|
this.renderer = renderer;
|
|
9
11
|
this.plugins = plugins || {};
|
|
@@ -12,13 +14,13 @@ export class CoreBot {
|
|
|
12
14
|
this.defaultDelay = defaultDelay;
|
|
13
15
|
this.appId = appId || undefined;
|
|
14
16
|
this.rootElement = null;
|
|
15
|
-
this.inspector = inspector || new Inspector();
|
|
17
|
+
this.inspector = inspector || new debug_1.Inspector();
|
|
16
18
|
this.routes = routes;
|
|
17
19
|
this.defaultRoutes = defaultRoutes || [];
|
|
18
20
|
this.router =
|
|
19
21
|
this.routes instanceof Function
|
|
20
22
|
? null
|
|
21
|
-
: new Router([...this.routes, ...this.defaultRoutes], this.inspector.routeInspector);
|
|
23
|
+
: new routing_1.Router([...this.routes, ...this.defaultRoutes], this.inspector.routeInspector);
|
|
22
24
|
}
|
|
23
25
|
setSystemLocale(locale, session) {
|
|
24
26
|
session.user.system_locale = locale;
|
|
@@ -29,16 +31,13 @@ export class CoreBot {
|
|
|
29
31
|
setUserCountry(country, session) {
|
|
30
32
|
session.user.country = country;
|
|
31
33
|
}
|
|
32
|
-
input(request) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
return output;
|
|
41
|
-
});
|
|
34
|
+
async input(request) {
|
|
35
|
+
const botContext = this.getBotContext(request);
|
|
36
|
+
const output = await this.runInput(botContext);
|
|
37
|
+
if (botContext.session._botonic_action?.startsWith(models_1.BotonicAction.Redirect)) {
|
|
38
|
+
return await this.runRedirectAction(output, botContext);
|
|
39
|
+
}
|
|
40
|
+
return output;
|
|
42
41
|
}
|
|
43
42
|
getBotContext(request) {
|
|
44
43
|
const { input, session, lastRoutePath } = request;
|
|
@@ -58,44 +57,41 @@ export class CoreBot {
|
|
|
58
57
|
setSystemLocale: (locale) => this.setSystemLocale(locale, session),
|
|
59
58
|
};
|
|
60
59
|
}
|
|
61
|
-
runInput(botContext) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
if (botContext.input.type === INPUT.CHAT_EVENT) {
|
|
66
|
-
return {
|
|
67
|
-
input: botContext.input,
|
|
68
|
-
session: botContext.session,
|
|
69
|
-
lastRoutePath: botContext.lastRoutePath,
|
|
70
|
-
response: [],
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
yield this.runPrePlugins(botContext);
|
|
74
|
-
const output = yield this.getOutput(botContext);
|
|
75
|
-
botContext = this.updateRequestFromOutput(botContext, output);
|
|
76
|
-
const response = yield this.renderer({
|
|
77
|
-
request: botContext,
|
|
78
|
-
actions: [output.fallbackAction, output.action, output.emptyAction],
|
|
79
|
-
});
|
|
80
|
-
yield this.runPostPlugins(botContext, response);
|
|
81
|
-
botContext.session.is_first_interaction = false;
|
|
60
|
+
async runInput(botContext) {
|
|
61
|
+
// After first updateSession, user country locale and system_locale are always defined
|
|
62
|
+
this.updateSession(botContext.session);
|
|
63
|
+
if (botContext.input.type === models_1.INPUT.CHAT_EVENT) {
|
|
82
64
|
return {
|
|
83
65
|
input: botContext.input,
|
|
84
|
-
response,
|
|
85
66
|
session: botContext.session,
|
|
86
67
|
lastRoutePath: botContext.lastRoutePath,
|
|
68
|
+
response: [],
|
|
87
69
|
};
|
|
70
|
+
}
|
|
71
|
+
await this.runPrePlugins(botContext);
|
|
72
|
+
const output = await this.getOutput(botContext);
|
|
73
|
+
botContext = this.updateRequestFromOutput(botContext, output);
|
|
74
|
+
const response = await this.renderer({
|
|
75
|
+
request: botContext,
|
|
76
|
+
actions: [output.fallbackAction, output.action, output.emptyAction],
|
|
88
77
|
});
|
|
78
|
+
await this.runPostPlugins(botContext, response);
|
|
79
|
+
botContext.session.is_first_interaction = false;
|
|
80
|
+
return {
|
|
81
|
+
input: botContext.input,
|
|
82
|
+
response,
|
|
83
|
+
session: botContext.session,
|
|
84
|
+
lastRoutePath: botContext.lastRoutePath,
|
|
85
|
+
};
|
|
89
86
|
}
|
|
90
87
|
updateSession(session) {
|
|
91
|
-
var _a, _b;
|
|
92
88
|
// set new user fields (country, locale, system_locale) from old fields in extra_data
|
|
93
89
|
if (!session.user.country) {
|
|
94
|
-
const country =
|
|
90
|
+
const country = session.user.extra_data?.country;
|
|
95
91
|
this.setUserCountry(country, session);
|
|
96
92
|
}
|
|
97
93
|
if (!session.user.locale) {
|
|
98
|
-
const language =
|
|
94
|
+
const language = session.user.extra_data?.language;
|
|
99
95
|
this.setUserLocale(language, session);
|
|
100
96
|
}
|
|
101
97
|
if (!session.user.system_locale) {
|
|
@@ -105,67 +101,67 @@ export class CoreBot {
|
|
|
105
101
|
}
|
|
106
102
|
}
|
|
107
103
|
}
|
|
108
|
-
runPrePlugins(botContext) {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
});
|
|
104
|
+
async runPrePlugins(botContext) {
|
|
105
|
+
if (this.plugins) {
|
|
106
|
+
await (0, plugins_1.runPlugins)({ botContext, mode: 'pre' });
|
|
107
|
+
}
|
|
114
108
|
}
|
|
115
|
-
getOutput(botContext) {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
return output;
|
|
120
|
-
});
|
|
109
|
+
async getOutput(botContext) {
|
|
110
|
+
await this.setRouter(botContext);
|
|
111
|
+
const output = this.router.processInput(botContext.input, botContext.session, botContext.lastRoutePath);
|
|
112
|
+
return output;
|
|
121
113
|
}
|
|
122
|
-
setRouter(botContext) {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
this.
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
});
|
|
114
|
+
async setRouter(botContext) {
|
|
115
|
+
if (this.routes instanceof Function) {
|
|
116
|
+
this.router = new routing_1.Router([
|
|
117
|
+
...(await (0, routing_1.getComputedRoutes)(this.routes, botContext)),
|
|
118
|
+
...this.defaultRoutes,
|
|
119
|
+
], this.inspector.routeInspector);
|
|
120
|
+
}
|
|
131
121
|
}
|
|
132
122
|
updateRequestFromOutput(botContext, output) {
|
|
133
|
-
return
|
|
123
|
+
return {
|
|
124
|
+
...botContext,
|
|
125
|
+
params: output.params || {},
|
|
126
|
+
lastRoutePath: output.lastRoutePath,
|
|
127
|
+
};
|
|
134
128
|
}
|
|
135
|
-
runPostPlugins(botContext, response) {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
});
|
|
129
|
+
async runPostPlugins(botContext, response) {
|
|
130
|
+
if (this.plugins) {
|
|
131
|
+
await (0, plugins_1.runPlugins)({
|
|
132
|
+
botContext,
|
|
133
|
+
mode: 'post',
|
|
134
|
+
response,
|
|
135
|
+
});
|
|
136
|
+
}
|
|
145
137
|
}
|
|
146
|
-
runRedirectAction(previousResponse, botContext, numOfRedirects = 0) {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
138
|
+
async runRedirectAction(previousResponse, botContext, numOfRedirects = 0) {
|
|
139
|
+
if (numOfRedirects > 10) {
|
|
140
|
+
throw new Error('Maximum BotAction recursive calls reached (10)');
|
|
141
|
+
}
|
|
142
|
+
const nextPayload = botContext.session._botonic_action?.split(`${models_1.BotonicAction.Redirect}:`)[1];
|
|
143
|
+
const inputWithBotActionPayload = {
|
|
144
|
+
...botContext.input,
|
|
145
|
+
payload: nextPayload,
|
|
146
|
+
type: models_1.INPUT.POSTBACK,
|
|
147
|
+
data: undefined,
|
|
148
|
+
text: undefined,
|
|
149
|
+
};
|
|
150
|
+
botContext.session._botonic_action = undefined;
|
|
151
|
+
botContext.input = inputWithBotActionPayload;
|
|
152
|
+
const followUp = await this.runInput(botContext);
|
|
153
|
+
const response = {
|
|
154
|
+
input: followUp.input,
|
|
155
|
+
response: previousResponse.response.concat(followUp.response),
|
|
156
|
+
session: botContext.session,
|
|
157
|
+
lastRoutePath: followUp.lastRoutePath,
|
|
158
|
+
};
|
|
159
|
+
// Recursive call to handle multiple bot actions in a row
|
|
160
|
+
if (response.session._botonic_action?.startsWith(models_1.BotonicAction.Redirect)) {
|
|
161
|
+
return await this.runRedirectAction(response, botContext, numOfRedirects + 1);
|
|
162
|
+
}
|
|
163
|
+
return response;
|
|
169
164
|
}
|
|
170
165
|
}
|
|
166
|
+
exports.CoreBot = CoreBot;
|
|
171
167
|
//# sourceMappingURL=core-bot.js.map
|
package/lib/esm/core-bot.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-bot.js","sourceRoot":"","sources":["../../src/core-bot.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"core-bot.js","sourceRoot":"","sources":["../../src/core-bot.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,qCAYiB;AACjB,uCAAsC;AACtC,uCAAqD;AAcrD,MAAa,OAAO;IAalB,YAAY,EACV,QAAQ,EACR,MAAM,EACN,KAAK,EACL,OAAO,EACP,KAAK,EACL,aAAa,GAAG,GAAG,EACnB,YAAY,GAAG,GAAG,EAClB,aAAa,EACb,SAAS,GACK;QACd,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,OAAO,GAAG,OAAO,IAAI,EAAE,CAAA;QAC5B,IAAI,CAAC,KAAK,GAAG,KAAK,IAAI,EAAE,CAAA;QACxB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAA;QAClC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;QAChC,IAAI,CAAC,KAAK,GAAG,KAAK,IAAI,SAAS,CAAA;QAC/B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAA;QACvB,IAAI,CAAC,SAAS,GAAG,SAAS,IAAI,IAAI,iBAAS,EAAE,CAAA;QAC7C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,aAAa,GAAG,aAAa,IAAI,EAAE,CAAA;QACxC,IAAI,CAA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AAQ,GAAG,CAC7B,CAAC,CAAC,CAAC,CAAA;QAEJ,MAAM,yBAAyB,GAAU;YACvC,GAAG,UAAU,CAAC,KAAK;YACnB,OAAO,EAAE,WAAW;YACpB,IAAI,EAAE,cAAK,CAAC,QAAQ;YACpB,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,SAAS;SAChB,CAAA;QAED,UAAU,CAAC,OAAO,CAAC,eAAe,GAAG,SAAS,CAAA;QAC9C,UAAU,CAAC,KAAK,GAAG,yBAAyB,CAAA;QAE5C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAA;QAEhD,MAAM,QAAQ,GAAG;YACf,KAAK,EAAE,QAAQ,CAAC,KAAK;YACrB,QAAQ,EAAE,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC;YAC7D,OAAO,EAAE,UAAU,CAAC,OAAO;YAC3B,aAAa,EAAE,QAAQ,CAAC,aAAa;SACtC,CAAA;QAED,yDAAyD;QACzD,IAAI,QAAQ,CAAC,OAAO,CAAC,eAAe,EAAE,UAAU,CAAC,sBAAa,CAAC,QAAQ,CAAC,EAAE,CAAC;YACzE,OAAO,MAAM,IAAI,CAAC,iBAAiB,CACjC,QAAQ,EACR,UAAU,EACV,cAAc,GAAG,CAAC,CACnB,CAAA;QACH,CAAC;QAED,OAAO,QAAQ,CAAA;IACjB,CAAC;CACF;AA9OD,0BA8OC"}
|
package/lib/esm/debug/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/debug/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/debug/index.ts"],"names":[],"mappings":";;;AAAA,sDAA2B"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Inspector = exports.LogRouteInspector = exports.FocusRouteInspector = exports.RouteInspector = void 0;
|
|
4
|
+
class RouteInspector {
|
|
2
5
|
routeMatched(_route, _routeKey, _routeValue, _input) { }
|
|
3
6
|
routeNotMatched(_route, _routeKey, _routeValue, _input) { }
|
|
4
7
|
}
|
|
5
|
-
|
|
8
|
+
exports.RouteInspector = RouteInspector;
|
|
9
|
+
class FocusRouteInspector extends RouteInspector {
|
|
6
10
|
constructor() {
|
|
7
11
|
super();
|
|
8
12
|
this.focusRoutePaths = null;
|
|
@@ -24,7 +28,8 @@ export class FocusRouteInspector extends RouteInspector {
|
|
|
24
28
|
return this.focusRoutePaths.includes(route.path);
|
|
25
29
|
}
|
|
26
30
|
}
|
|
27
|
-
|
|
31
|
+
exports.FocusRouteInspector = FocusRouteInspector;
|
|
32
|
+
class LogRouteInspector extends FocusRouteInspector {
|
|
28
33
|
routeMatched(route, routeKey, routeValue, inputValue) {
|
|
29
34
|
if (!this._isOnFocus(route)) {
|
|
30
35
|
return;
|
|
@@ -54,7 +59,8 @@ export class LogRouteInspector extends FocusRouteInspector {
|
|
|
54
59
|
console.log(message, ...optionalParams);
|
|
55
60
|
}
|
|
56
61
|
}
|
|
57
|
-
|
|
62
|
+
exports.LogRouteInspector = LogRouteInspector;
|
|
63
|
+
class Inspector {
|
|
58
64
|
constructor(routeInspector = undefined) {
|
|
59
65
|
this.routeInspector = routeInspector || new RouteInspector();
|
|
60
66
|
}
|
|
@@ -62,4 +68,5 @@ export class Inspector {
|
|
|
62
68
|
return this.routeInspector;
|
|
63
69
|
}
|
|
64
70
|
}
|
|
71
|
+
exports.Inspector = Inspector;
|
|
65
72
|
//# sourceMappingURL=inspector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspector.js","sourceRoot":"","sources":["../../../src/debug/inspector.ts"],"names":[],"mappings":"AACA,
|
|
1
|
+
{"version":3,"file":"inspector.js","sourceRoot":"","sources":["../../../src/debug/insp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