@telia-ace/knowledge-widget-bot-provider 0.0.1-alpha.34 → 0.0.1-alpha.35
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.
|
@@ -34,6 +34,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
34
34
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
+
import { ChatHelper } from '../helper/chat.helper';
|
|
37
38
|
import { MiddlewareHelper } from '../helper/middleware.helper';
|
|
38
39
|
import { StoreHelper } from '../helper/store.helper';
|
|
39
40
|
import EntryInterface from '../interface/entry.interface';
|
|
@@ -51,13 +52,26 @@ var MiddlewareClient = /** @class */ (function () {
|
|
|
51
52
|
MiddlewareHelper.setContainer(container);
|
|
52
53
|
MiddlewareHelper.setWidget(widget);
|
|
53
54
|
};
|
|
54
|
-
// called on all
|
|
55
|
+
// called on all standard scenarios like actions and user messages
|
|
55
56
|
MiddlewareClient.prototype.handleEntries = function (entries, action) {
|
|
56
57
|
return __awaiter(this, void 0, void 0, function () {
|
|
57
|
-
var o, messageArray;
|
|
58
|
+
var widgetEntry, agent, o, messageArray;
|
|
58
59
|
return __generator(this, function (_a) {
|
|
59
60
|
switch (_a.label) {
|
|
60
61
|
case 0:
|
|
62
|
+
widgetEntry = (entries || []).find(function (e) { return e.type === 'Widget'; });
|
|
63
|
+
console.log('widgetentry', widgetEntry);
|
|
64
|
+
if (widgetEntry) {
|
|
65
|
+
agent = ChatHelper.getAgent();
|
|
66
|
+
console.log('current agent', agent);
|
|
67
|
+
if (agent) {
|
|
68
|
+
agent.update({
|
|
69
|
+
name: 'RockstarBot',
|
|
70
|
+
avatar: '',
|
|
71
|
+
});
|
|
72
|
+
console.log('asdf', ChatHelper.getAgent());
|
|
73
|
+
}
|
|
74
|
+
}
|
|
61
75
|
o = this.executeMiddlewares(entries, false, action);
|
|
62
76
|
return [4 /*yield*/, this.entryInterface.transformArray(o)];
|
|
63
77
|
case 1:
|
|
@@ -34,6 +34,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
34
34
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
+
import { ChatHelper } from '../helper/chat.helper';
|
|
37
38
|
import { MiddlewareHelper } from '../helper/middleware.helper';
|
|
38
39
|
import { StoreHelper } from '../helper/store.helper';
|
|
39
40
|
import EntryInterface from '../interface/entry.interface';
|
|
@@ -51,13 +52,26 @@ var MiddlewareClient = /** @class */ (function () {
|
|
|
51
52
|
MiddlewareHelper.setContainer(container);
|
|
52
53
|
MiddlewareHelper.setWidget(widget);
|
|
53
54
|
};
|
|
54
|
-
// called on all
|
|
55
|
+
// called on all standard scenarios like actions and user messages
|
|
55
56
|
MiddlewareClient.prototype.handleEntries = function (entries, action) {
|
|
56
57
|
return __awaiter(this, void 0, void 0, function () {
|
|
57
|
-
var o, messageArray;
|
|
58
|
+
var widgetEntry, agent, o, messageArray;
|
|
58
59
|
return __generator(this, function (_a) {
|
|
59
60
|
switch (_a.label) {
|
|
60
61
|
case 0:
|
|
62
|
+
widgetEntry = (entries || []).find(function (e) { return e.type === 'Widget'; });
|
|
63
|
+
console.log('widgetentry', widgetEntry);
|
|
64
|
+
if (widgetEntry) {
|
|
65
|
+
agent = ChatHelper.getAgent();
|
|
66
|
+
console.log('current agent', agent);
|
|
67
|
+
if (agent) {
|
|
68
|
+
agent.update({
|
|
69
|
+
name: 'RockstarBot',
|
|
70
|
+
avatar: '',
|
|
71
|
+
});
|
|
72
|
+
console.log('asdf', ChatHelper.getAgent());
|
|
73
|
+
}
|
|
74
|
+
}
|
|
61
75
|
o = this.executeMiddlewares(entries, false, action);
|
|
62
76
|
return [4 /*yield*/, this.entryInterface.transformArray(o)];
|
|
63
77
|
case 1:
|
package/package.json
CHANGED