@telia-ace/knowledge-widget-bot-provider 0.0.1-alpha.23 → 0.0.1-alpha.24
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/client/contact-method.client.d.ts +2 -1
- package/lib/client/contact-method.client.js +14 -4
- package/lib/plugin.js +1 -1
- package/lib-esm/client/contact-method.client.d.ts +2 -1
- package/lib-esm/client/contact-method.client.js +14 -4
- package/lib-esm/plugin.js +1 -1
- package/package.json +1 -1
|
@@ -6,7 +6,8 @@ export declare class ContactMethodClient {
|
|
|
6
6
|
private static contactMessageEntryArray;
|
|
7
7
|
private static agent;
|
|
8
8
|
private chatClient;
|
|
9
|
-
static
|
|
9
|
+
private static container;
|
|
10
|
+
static initialize(container: any, dataClient: DataClient, contactMethodPlatform: ContactMethodPlatform, agent: any): void;
|
|
10
11
|
handleNewForm: (errors: any, entry: any) => Promise<void>;
|
|
11
12
|
handleContactMethod: (input?: string) => Promise<void>;
|
|
12
13
|
validate(form: any): void;
|
|
@@ -135,10 +135,11 @@ var ContactMethodClient = /** @class */ (function () {
|
|
|
135
135
|
return (contactMethod === null || contactMethod === void 0 ? void 0 : contactMethod.body) || {};
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
|
-
ContactMethodClient.initialize = function (dataClient, contactMethodPlatform, agent) {
|
|
138
|
+
ContactMethodClient.initialize = function (container, dataClient, contactMethodPlatform, agent) {
|
|
139
139
|
this.dataClient = dataClient;
|
|
140
140
|
this.contactMethodPlatform = contactMethodPlatform;
|
|
141
141
|
this.agent = agent;
|
|
142
|
+
this.container = container;
|
|
142
143
|
};
|
|
143
144
|
// validation of the form provided
|
|
144
145
|
ContactMethodClient.prototype.validate = function (form) {
|
|
@@ -241,9 +242,18 @@ var ContactMethodClient = /** @class */ (function () {
|
|
|
241
242
|
if (id === void 0) { id = undefined; }
|
|
242
243
|
switch (dataType) {
|
|
243
244
|
case DataType.ContactMethodCategories: {
|
|
244
|
-
return ContactMethodClient.
|
|
245
|
-
.
|
|
246
|
-
.then(function (
|
|
245
|
+
return ContactMethodClient.container
|
|
246
|
+
.getAsync('matchingClient')
|
|
247
|
+
.then(function (matchingClient) {
|
|
248
|
+
return matchingClient.customRequest('/contactmethods', 'GET', {});
|
|
249
|
+
})
|
|
250
|
+
.then(function (contactMethods) {
|
|
251
|
+
console.log('contactmethodsxxx', contactMethods);
|
|
252
|
+
return contactMethods;
|
|
253
|
+
});
|
|
254
|
+
// return ContactMethodClient.dataClient
|
|
255
|
+
// .fetch(DataType.ContactMethods, { contactMethodCategoryId: id })
|
|
256
|
+
// .then((contactMethods) => contactMethods);
|
|
247
257
|
}
|
|
248
258
|
case DataType.ContactMethods: {
|
|
249
259
|
if (!!id) {
|
package/lib/plugin.js
CHANGED
|
@@ -79,7 +79,7 @@ var KnowledgeBotProviderPlugin = function (container) { return __awaiter(void 0,
|
|
|
79
79
|
// passes the user and the agent to the Chat Helper
|
|
80
80
|
ChatClient.initialize(conversation.user, agent);
|
|
81
81
|
// passes the conversation provider to the Contact Method Client
|
|
82
|
-
ContactMethodClient.initialize(dataClient, contactMethodPlatform, agent);
|
|
82
|
+
ContactMethodClient.initialize(container, dataClient, contactMethodPlatform, agent);
|
|
83
83
|
// passes the container and the widget to the Middleware Store
|
|
84
84
|
MiddlewareClient.initialize(container, container.get('$widget'));
|
|
85
85
|
// executes to decide on what to do on first load
|
|
@@ -6,7 +6,8 @@ export declare class ContactMethodClient {
|
|
|
6
6
|
private static contactMessageEntryArray;
|
|
7
7
|
private static agent;
|
|
8
8
|
private chatClient;
|
|
9
|
-
static
|
|
9
|
+
private static container;
|
|
10
|
+
static initialize(container: any, dataClient: DataClient, contactMethodPlatform: ContactMethodPlatform, agent: any): void;
|
|
10
11
|
handleNewForm: (errors: any, entry: any) => Promise<void>;
|
|
11
12
|
handleContactMethod: (input?: string) => Promise<void>;
|
|
12
13
|
validate(form: any): void;
|
|
@@ -135,10 +135,11 @@ var ContactMethodClient = /** @class */ (function () {
|
|
|
135
135
|
return (contactMethod === null || contactMethod === void 0 ? void 0 : contactMethod.body) || {};
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
|
-
ContactMethodClient.initialize = function (dataClient, contactMethodPlatform, agent) {
|
|
138
|
+
ContactMethodClient.initialize = function (container, dataClient, contactMethodPlatform, agent) {
|
|
139
139
|
this.dataClient = dataClient;
|
|
140
140
|
this.contactMethodPlatform = contactMethodPlatform;
|
|
141
141
|
this.agent = agent;
|
|
142
|
+
this.container = container;
|
|
142
143
|
};
|
|
143
144
|
// validation of the form provided
|
|
144
145
|
ContactMethodClient.prototype.validate = function (form) {
|
|
@@ -241,9 +242,18 @@ var ContactMethodClient = /** @class */ (function () {
|
|
|
241
242
|
if (id === void 0) { id = undefined; }
|
|
242
243
|
switch (dataType) {
|
|
243
244
|
case DataType.ContactMethodCategories: {
|
|
244
|
-
return ContactMethodClient.
|
|
245
|
-
.
|
|
246
|
-
.then(function (
|
|
245
|
+
return ContactMethodClient.container
|
|
246
|
+
.getAsync('matchingClient')
|
|
247
|
+
.then(function (matchingClient) {
|
|
248
|
+
return matchingClient.customRequest('/contactmethods', 'GET', {});
|
|
249
|
+
})
|
|
250
|
+
.then(function (contactMethods) {
|
|
251
|
+
console.log('contactmethodsxxx', contactMethods);
|
|
252
|
+
return contactMethods;
|
|
253
|
+
});
|
|
254
|
+
// return ContactMethodClient.dataClient
|
|
255
|
+
// .fetch(DataType.ContactMethods, { contactMethodCategoryId: id })
|
|
256
|
+
// .then((contactMethods) => contactMethods);
|
|
247
257
|
}
|
|
248
258
|
case DataType.ContactMethods: {
|
|
249
259
|
if (!!id) {
|
package/lib-esm/plugin.js
CHANGED
|
@@ -79,7 +79,7 @@ var KnowledgeBotProviderPlugin = function (container) { return __awaiter(void 0,
|
|
|
79
79
|
// passes the user and the agent to the Chat Helper
|
|
80
80
|
ChatClient.initialize(conversation.user, agent);
|
|
81
81
|
// passes the conversation provider to the Contact Method Client
|
|
82
|
-
ContactMethodClient.initialize(dataClient, contactMethodPlatform, agent);
|
|
82
|
+
ContactMethodClient.initialize(container, dataClient, contactMethodPlatform, agent);
|
|
83
83
|
// passes the container and the widget to the Middleware Store
|
|
84
84
|
MiddlewareClient.initialize(container, container.get('$widget'));
|
|
85
85
|
// executes to decide on what to do on first load
|
package/package.json
CHANGED