@telia-ace/knowledge-widget-bot-provider 0.0.1-alpha.16 → 0.0.1-alpha.17
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/plugin.js +16 -13
- package/lib-esm/plugin.js +16 -13
- package/package.json +1 -1
package/lib/plugin.js
CHANGED
|
@@ -95,17 +95,20 @@ var ConversationPlugin = function (container) { return __awaiter(void 0, void 0,
|
|
|
95
95
|
}
|
|
96
96
|
});
|
|
97
97
|
}); };
|
|
98
|
-
execute = function (
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
endpoint
|
|
103
|
-
|
|
104
|
-
//
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
98
|
+
execute = function (endpoint) { return __awaiter(void 0, void 0, void 0, function () {
|
|
99
|
+
return __generator(this, function (_a) {
|
|
100
|
+
// let endpoint = '';
|
|
101
|
+
// console.log(
|
|
102
|
+
// 'getting endpoint',
|
|
103
|
+
// conversationComp,
|
|
104
|
+
// conversationComp?.attributes?.properties?.knowledgeBotEndpoint
|
|
105
|
+
// );
|
|
106
|
+
// // setTimeout(() => {
|
|
107
|
+
// if (conversationComp?.attributes?.properties?.knowledgeBotEndpoint) {
|
|
108
|
+
// endpoint = conversationComp.attributes.properties.knowledgeBotEndpoint;
|
|
109
|
+
// }
|
|
108
110
|
// });
|
|
111
|
+
console.log('executing with endpoint', endpoint);
|
|
109
112
|
platform.registerProvider('chat.bot', function (conversation, component) {
|
|
110
113
|
var clientId = v4();
|
|
111
114
|
registerCustomMessageComponent(container, 'ace-knowledge-contact-method', import('./contract/custom-component/contact-method'));
|
|
@@ -173,7 +176,7 @@ var ConversationPlugin = function (container) { return __awaiter(void 0, void 0,
|
|
|
173
176
|
getConversationComponent().then(function (conversationComp) {
|
|
174
177
|
if (conversationComp && (conversationComp === null || conversationComp === void 0 ? void 0 : conversationComp.attributes.properties.knowledgeBotEndpoint)) {
|
|
175
178
|
console.log('execute on first');
|
|
176
|
-
execute(conversationComp);
|
|
179
|
+
execute(conversationComp === null || conversationComp === void 0 ? void 0 : conversationComp.attributes.properties.knowledgeBotEndpoint);
|
|
177
180
|
}
|
|
178
181
|
else {
|
|
179
182
|
events.subscribe('components:node-mounted', function (event, data) {
|
|
@@ -182,7 +185,7 @@ var ConversationPlugin = function (container) { return __awaiter(void 0, void 0,
|
|
|
182
185
|
if (((_a = data.node) === null || _a === void 0 ? void 0 : _a.type) === 'conversation' && ((_b = data.node) === null || _b === void 0 ? void 0 : _b.attributes.properties.knowledgeBotEndpoint)) {
|
|
183
186
|
// const component = getConversationComponent();
|
|
184
187
|
console.log('execute on event');
|
|
185
|
-
execute(
|
|
188
|
+
execute(data.node.attributes.properties.knowledgeBotEndpoint);
|
|
186
189
|
}
|
|
187
190
|
});
|
|
188
191
|
compPlatform.events.subscribe('components:properties-changed', function (event, data) {
|
|
@@ -190,7 +193,7 @@ var ConversationPlugin = function (container) { return __awaiter(void 0, void 0,
|
|
|
190
193
|
console.log('component properties changed', data);
|
|
191
194
|
if (((_a = data.node) === null || _a === void 0 ? void 0 : _a.type) === 'conversation' && ((_b = data.node) === null || _b === void 0 ? void 0 : _b.attributes.properties.knowledgeBotEndpoint)) {
|
|
192
195
|
console.log('conversation component property change', data);
|
|
193
|
-
execute(
|
|
196
|
+
execute(data.node.attributes.properties.knowledgeBotEndpoint);
|
|
194
197
|
}
|
|
195
198
|
});
|
|
196
199
|
}
|
package/lib-esm/plugin.js
CHANGED
|
@@ -95,17 +95,20 @@ var ConversationPlugin = function (container) { return __awaiter(void 0, void 0,
|
|
|
95
95
|
}
|
|
96
96
|
});
|
|
97
97
|
}); };
|
|
98
|
-
execute = function (
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
endpoint
|
|
103
|
-
|
|
104
|
-
//
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
98
|
+
execute = function (endpoint) { return __awaiter(void 0, void 0, void 0, function () {
|
|
99
|
+
return __generator(this, function (_a) {
|
|
100
|
+
// let endpoint = '';
|
|
101
|
+
// console.log(
|
|
102
|
+
// 'getting endpoint',
|
|
103
|
+
// conversationComp,
|
|
104
|
+
// conversationComp?.attributes?.properties?.knowledgeBotEndpoint
|
|
105
|
+
// );
|
|
106
|
+
// // setTimeout(() => {
|
|
107
|
+
// if (conversationComp?.attributes?.properties?.knowledgeBotEndpoint) {
|
|
108
|
+
// endpoint = conversationComp.attributes.properties.knowledgeBotEndpoint;
|
|
109
|
+
// }
|
|
108
110
|
// });
|
|
111
|
+
console.log('executing with endpoint', endpoint);
|
|
109
112
|
platform.registerProvider('chat.bot', function (conversation, component) {
|
|
110
113
|
var clientId = v4();
|
|
111
114
|
registerCustomMessageComponent(container, 'ace-knowledge-contact-method', import('./contract/custom-component/contact-method'));
|
|
@@ -173,7 +176,7 @@ var ConversationPlugin = function (container) { return __awaiter(void 0, void 0,
|
|
|
173
176
|
getConversationComponent().then(function (conversationComp) {
|
|
174
177
|
if (conversationComp && (conversationComp === null || conversationComp === void 0 ? void 0 : conversationComp.attributes.properties.knowledgeBotEndpoint)) {
|
|
175
178
|
console.log('execute on first');
|
|
176
|
-
execute(conversationComp);
|
|
179
|
+
execute(conversationComp === null || conversationComp === void 0 ? void 0 : conversationComp.attributes.properties.knowledgeBotEndpoint);
|
|
177
180
|
}
|
|
178
181
|
else {
|
|
179
182
|
events.subscribe('components:node-mounted', function (event, data) {
|
|
@@ -182,7 +185,7 @@ var ConversationPlugin = function (container) { return __awaiter(void 0, void 0,
|
|
|
182
185
|
if (((_a = data.node) === null || _a === void 0 ? void 0 : _a.type) === 'conversation' && ((_b = data.node) === null || _b === void 0 ? void 0 : _b.attributes.properties.knowledgeBotEndpoint)) {
|
|
183
186
|
// const component = getConversationComponent();
|
|
184
187
|
console.log('execute on event');
|
|
185
|
-
execute(
|
|
188
|
+
execute(data.node.attributes.properties.knowledgeBotEndpoint);
|
|
186
189
|
}
|
|
187
190
|
});
|
|
188
191
|
compPlatform.events.subscribe('components:properties-changed', function (event, data) {
|
|
@@ -190,7 +193,7 @@ var ConversationPlugin = function (container) { return __awaiter(void 0, void 0,
|
|
|
190
193
|
console.log('component properties changed', data);
|
|
191
194
|
if (((_a = data.node) === null || _a === void 0 ? void 0 : _a.type) === 'conversation' && ((_b = data.node) === null || _b === void 0 ? void 0 : _b.attributes.properties.knowledgeBotEndpoint)) {
|
|
192
195
|
console.log('conversation component property change', data);
|
|
193
|
-
execute(
|
|
196
|
+
execute(data.node.attributes.properties.knowledgeBotEndpoint);
|
|
194
197
|
}
|
|
195
198
|
});
|
|
196
199
|
}
|
package/package.json
CHANGED