@telia-ace/knowledge-widget-bot-provider 0.0.1-alpha.3 → 0.0.1-alpha.6

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.
@@ -15,7 +15,6 @@ var HttpClient = /** @class */ (function () {
15
15
  credentials: http_helper_1.HttpHelper.getCredentials(),
16
16
  clientId: '84d96a63-b8ba-33ec-22d5-515255f866f8',
17
17
  };
18
- console.log(endpoint);
19
18
  this.apiEndpoint = endpoint;
20
19
  this.projectionPath = window.location.href;
21
20
  this.endpointUrl = http_helper_1.HttpHelper.combineUrl(this.projectionPath, 'conversations');
@@ -54,7 +54,6 @@ var EntryInterface = /** @class */ (function () {
54
54
  EntryInterface.prototype.listTransform = function (entry) {
55
55
  if (!entry.content)
56
56
  return undefined;
57
- console.log(entry);
58
57
  var object = this.getListActions(entry.content.items, this.getContentText(entry), entry.actions, entry.localState);
59
58
  return object;
60
59
  };
package/lib/plugin.js CHANGED
@@ -78,7 +78,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
78
78
  return (mod && mod.__esModule) ? mod : { "default": mod };
79
79
  };
80
80
  Object.defineProperty(exports, "__esModule", { value: true });
81
- var knowledge_widget_adapters_1 = require("@telia-ace/knowledge-widget-adapters");
82
81
  var knowledge_widget_core_1 = require("@telia-ace/knowledge-widget-core");
83
82
  var knowledge_widget_types_grid_1 = require("@telia-ace/knowledge-widget-types-grid");
84
83
  var widget_conversation_1 = require("@telia-ace/widget-conversation");
@@ -93,7 +92,7 @@ var ConversationPlugin = function (container) { return __awaiter(void 0, void 0,
93
92
  case 0: return [4 /*yield*/, widget_conversation_1.ConversationPlatform.getInstance(container)];
94
93
  case 1:
95
94
  platform = _b.sent();
96
- return [4 /*yield*/, knowledge_widget_adapters_1.ContactMethodPlatform.getInstance(container)];
95
+ return [4 /*yield*/, container.getAsync('contactMethods')];
97
96
  case 2:
98
97
  contactMethodPlatform = _b.sent();
99
98
  return [4 /*yield*/, knowledge_widget_types_grid_1.DataClient.getInstance(container)];
@@ -109,7 +108,10 @@ var ConversationPlugin = function (container) { return __awaiter(void 0, void 0,
109
108
  });
110
109
  platform.registerProvider('chat.bot', function (conversation, component) {
111
110
  (0, widget_conversation_1.registerCustomMessageComponent)(container, 'ace-knowledge-contact-method', Promise.resolve().then(function () { return __importStar(require('./contract/custom-component/contact-method')); }));
112
- var agent = conversation.createAgent({ name: 'John Doe' });
111
+ var agent = conversation.createAgent({
112
+ name: 'John Doe',
113
+ avatar: 'https://www.site.com/avatar.jpg',
114
+ });
113
115
  // pases the user and the agent to the Chat Helper
114
116
  chat_client_1.default.initialize(conversation.user, agent);
115
117
  // passes the conversation provider to the Contact Method Client
@@ -9,7 +9,6 @@ var HttpClient = /** @class */ (function () {
9
9
  credentials: HttpHelper.getCredentials(),
10
10
  clientId: '84d96a63-b8ba-33ec-22d5-515255f866f8',
11
11
  };
12
- console.log(endpoint);
13
12
  this.apiEndpoint = endpoint;
14
13
  this.projectionPath = window.location.href;
15
14
  this.endpointUrl = HttpHelper.combineUrl(this.projectionPath, 'conversations');
@@ -52,7 +52,6 @@ var EntryInterface = /** @class */ (function () {
52
52
  EntryInterface.prototype.listTransform = function (entry) {
53
53
  if (!entry.content)
54
54
  return undefined;
55
- console.log(entry);
56
55
  var object = this.getListActions(entry.content.items, this.getContentText(entry), entry.actions, entry.localState);
57
56
  return object;
58
57
  };
package/lib-esm/plugin.js CHANGED
@@ -50,7 +50,6 @@ var __read = (this && this.__read) || function (o, n) {
50
50
  }
51
51
  return ar;
52
52
  };
53
- import { ContactMethodPlatform } from '@telia-ace/knowledge-widget-adapters';
54
53
  import { ComponentPlatform } from '@telia-ace/knowledge-widget-core';
55
54
  import { DataClient } from '@telia-ace/knowledge-widget-types-grid';
56
55
  import { ConversationPlatform, registerCustomMessageComponent, } from '@telia-ace/widget-conversation';
@@ -65,7 +64,7 @@ var ConversationPlugin = function (container) { return __awaiter(void 0, void 0,
65
64
  case 0: return [4 /*yield*/, ConversationPlatform.getInstance(container)];
66
65
  case 1:
67
66
  platform = _b.sent();
68
- return [4 /*yield*/, ContactMethodPlatform.getInstance(container)];
67
+ return [4 /*yield*/, container.getAsync('contactMethods')];
69
68
  case 2:
70
69
  contactMethodPlatform = _b.sent();
71
70
  return [4 /*yield*/, DataClient.getInstance(container)];
@@ -81,7 +80,10 @@ var ConversationPlugin = function (container) { return __awaiter(void 0, void 0,
81
80
  });
82
81
  platform.registerProvider('chat.bot', function (conversation, component) {
83
82
  registerCustomMessageComponent(container, 'ace-knowledge-contact-method', import('./contract/custom-component/contact-method'));
84
- var agent = conversation.createAgent({ name: 'John Doe' });
83
+ var agent = conversation.createAgent({
84
+ name: 'John Doe',
85
+ avatar: 'https://www.site.com/avatar.jpg',
86
+ });
85
87
  // pases the user and the agent to the Chat Helper
86
88
  ChatClient.initialize(conversation.user, agent);
87
89
  // passes the conversation provider to the Contact Method Client
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telia-ace/knowledge-widget-bot-provider",
3
- "version": "0.0.1-alpha.3",
3
+ "version": "0.0.1-alpha.6",
4
4
  "description": "Bot Provider Plugin ACE Knowledge Widgets.",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "author": "Telia Company AB",