@telia-ace/knowledge-widget-bot-provider 0.0.1-alpha.49 → 0.0.1-alpha.51

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.
Files changed (45) hide show
  1. package/LICENSE.txt +5 -5
  2. package/README.md +12 -12
  3. package/dist/client/chat.client.d.ts +13 -16
  4. package/dist/client/contact-method.client.d.ts +35 -34
  5. package/dist/client/http.client.d.ts +26 -26
  6. package/dist/client/middleware.client.d.ts +14 -14
  7. package/dist/contact-method.js +14 -4
  8. package/dist/contact-method.js.map +1 -1
  9. package/dist/contract/custom-component/contact-method-item.d.ts +11 -9
  10. package/dist/contract/custom-component/contact-method-list.d.ts +8 -7
  11. package/dist/contract/custom-component/contact-method.d.ts +3 -3
  12. package/dist/contract/custom-component/entry-context.d.ts +5 -5
  13. package/dist/contract/enum/server-entry-type.enum.d.ts +7 -7
  14. package/dist/contract/model/conversation-api-model/list.model.d.ts +5 -5
  15. package/dist/contract/model/conversation-api-model/message.model.d.ts +7 -7
  16. package/dist/contract/model/http/action.model.d.ts +3 -3
  17. package/dist/contract/model/http/client-action.model.d.ts +4 -4
  18. package/dist/contract/model/http/client-envelope.model.d.ts +9 -9
  19. package/dist/contract/model/http/connect-options.model.d.ts +5 -5
  20. package/dist/contract/model/http/global-state.model.d.ts +8 -8
  21. package/dist/contract/model/http/http-client-options.model.d.ts +5 -5
  22. package/dist/contract/model/http/server-entry.model.d.ts +11 -11
  23. package/dist/contract/model/http/server-envelope.model.d.ts +10 -10
  24. package/dist/contract/model/middleware/aggregator-state.model.d.ts +4 -4
  25. package/dist/contract/model/shared/loose-object.model.d.ts +3 -3
  26. package/dist/feedback-list.js +4 -1
  27. package/dist/feedback-list.js.map +1 -1
  28. package/dist/helper/chat.helper.d.ts +8 -8
  29. package/dist/helper/http.helper.d.ts +13 -13
  30. package/dist/helper/middleware.helper.d.ts +12 -12
  31. package/dist/helper/store.helper.d.ts +23 -23
  32. package/dist/index.d.ts +2 -2
  33. package/dist/index.js +171 -149
  34. package/dist/index.js.map +1 -1
  35. package/dist/interface/entry.interface.d.ts +23 -20
  36. package/dist/interface/middleware/paging.interface.d.ts +4 -4
  37. package/dist/interface/middleware/processor.interface.d.ts +10 -10
  38. package/dist/no-good-alternative.js.map +1 -1
  39. package/dist/plugin.d.ts +3 -3
  40. package/dist/ui/feedback-list.d.ts +8 -8
  41. package/dist/ui/no-good-alternative.d.ts +6 -6
  42. package/dist/utils.d.ts +2 -2
  43. package/package.json +8 -8
  44. package/dist/components/feedback-list.d.ts +0 -8
  45. package/dist/components/no-good-alternative.d.ts +0 -6
@@ -1,13 +1,13 @@
1
- export declare class HttpHelper {
2
- static fetchOptions: {
3
- method: string;
4
- headers: {
5
- Accept: string;
6
- 'Content-Type': string;
7
- };
8
- };
9
- static combineUrl(basePath: string, path: string): string;
10
- static managedSubdomainSuffixes: string[];
11
- static parseSubdomain: (input: string) => string;
12
- static getCredentials(): string | undefined;
13
- }
1
+ export declare class HttpHelper {
2
+ static fetchOptions: {
3
+ method: string;
4
+ headers: {
5
+ Accept: string;
6
+ 'Content-Type': string;
7
+ };
8
+ };
9
+ static combineUrl(basePath: string, path: string): string;
10
+ static managedSubdomainSuffixes: string[];
11
+ static parseSubdomain: (input: string) => string;
12
+ static getCredentials(): string | undefined;
13
+ }
@@ -1,12 +1,12 @@
1
- import { Message } from '../contract/model/conversation-api-model/message.model';
2
- export declare class MiddlewareHelper {
3
- private static sessionMessageStorageVariable;
4
- private static container;
5
- private static widget;
6
- static setContainer(container: any): void;
7
- static setWidget(widget: any): void;
8
- static getContainer(): any;
9
- static getWidget(): any;
10
- static setEntrySessionStorage: (messages: Message[]) => Promise<void>;
11
- static getEntrySessionStorage(): Promise<any>;
12
- }
1
+ import { Message } from '../contract/model/conversation-api-model/message.model';
2
+ export declare class MiddlewareHelper {
3
+ private static sessionMessageStorageVariable;
4
+ private static container;
5
+ private static widget;
6
+ static setContainer(container: any): void;
7
+ static setWidget(widget: any): void;
8
+ static getContainer(): any;
9
+ static getWidget(): any;
10
+ static setEntrySessionStorage: (messages: Message[]) => Promise<void>;
11
+ static getEntrySessionStorage(): Promise<any>;
12
+ }
@@ -1,23 +1,23 @@
1
- import { Message } from '../contract/model/conversation-api-model/message.model';
2
- import { ClientAction } from '../contract/model/http/client-action.model';
3
- import { GlobalState } from '../contract/model/http/global-state.model';
4
- import { ServerEntry } from '../contract/model/http/server-entry.model';
5
- import { LooseObject } from '../contract/model/shared/loose-object.model';
6
- export declare class StoreHelper {
7
- private static messageStore;
8
- private static globalState;
9
- constructor();
10
- static insertOrUpdateMessageArrayStore(messageArray: Message[], entry?: any): Promise<void>;
11
- static insertMessageToStore(message: Message): void;
12
- private static updateMessageInStore;
13
- static checkIdInMessageStore(id: string): boolean;
14
- static getLocalState(action: string): LooseObject | undefined;
15
- static getGlobalState(): GlobalState;
16
- static setGlobalState(state: GlobalState): Promise<void>;
17
- static getAction(action: string): ClientAction;
18
- static getCommand(text: string): LooseObject;
19
- static getEntry(action: string): ServerEntry | undefined;
20
- static getMessage(id: string): Message | undefined;
21
- static getEntryStore(): ServerEntry[];
22
- static rehydrateState(): Promise<void>;
23
- }
1
+ import { Message } from '../contract/model/conversation-api-model/message.model';
2
+ import { ClientAction } from '../contract/model/http/client-action.model';
3
+ import { GlobalState } from '../contract/model/http/global-state.model';
4
+ import { ServerEntry } from '../contract/model/http/server-entry.model';
5
+ import { LooseObject } from '../contract/model/shared/loose-object.model';
6
+ export declare class StoreHelper {
7
+ private static messageStore;
8
+ private static globalState;
9
+ constructor();
10
+ static insertOrUpdateMessageArrayStore(messageArray: Message[], entry?: any): Promise<void>;
11
+ static insertMessageToStore(message: Message): void;
12
+ private static updateMessageInStore;
13
+ static checkIdInMessageStore(id: string): boolean;
14
+ static getLocalState(action: string): LooseObject | undefined;
15
+ static getGlobalState(): GlobalState;
16
+ static setGlobalState(state: GlobalState): Promise<void>;
17
+ static getAction(action: string): ClientAction;
18
+ static getCommand(text: string): LooseObject;
19
+ static getEntry(action: string): ServerEntry | undefined;
20
+ static getMessage(id: string): Message | undefined;
21
+ static getEntryStore(): ServerEntry[];
22
+ static rehydrateState(): Promise<void>;
23
+ }
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import ConversationPlugin from './plugin';
2
- export { ConversationPlugin };
1
+ import ConversationPlugin from './plugin';
2
+ export { ConversationPlugin };
package/dist/index.js CHANGED
@@ -173,6 +173,72 @@ const _StoreHelper = class {
173
173
  };
174
174
  let StoreHelper = _StoreHelper;
175
175
  StoreHelper.messageStore = [];
176
+ class ChatClient {
177
+ constructor() {
178
+ }
179
+ static initialize(user, agent) {
180
+ ChatHelper.setUser(user);
181
+ ChatHelper.setAgent(agent);
182
+ }
183
+ processMessageArrayAndStoreIt(messages) {
184
+ return __async(this, null, function* () {
185
+ for (const message of messages.filter((o) => o && o != null && !!o.message)) {
186
+ if (message.isUser)
187
+ this.postUserMessage(message);
188
+ else
189
+ this.postAgentMessage(message);
190
+ }
191
+ yield StoreHelper.insertOrUpdateMessageArrayStore(messages);
192
+ });
193
+ }
194
+ updateMessageArrayAndStoreIt(messages) {
195
+ let conversationEntry = void 0;
196
+ messages.forEach((o) => {
197
+ let message = StoreHelper.getMessage(o.id);
198
+ message == null ? void 0 : message.conversationEntry.update(o.message);
199
+ conversationEntry = message == null ? void 0 : message.conversationEntry;
200
+ });
201
+ StoreHelper.insertOrUpdateMessageArrayStore(messages, conversationEntry);
202
+ }
203
+ printUserMessageAndStoreIt(action) {
204
+ if (action == "next" || action == "help")
205
+ return;
206
+ let entry = StoreHelper.getEntry(action);
207
+ let message = {
208
+ id: v4(),
209
+ message: !entry ? action : this.getTitleFromEntry(entry, action),
210
+ isUser: true
211
+ };
212
+ this.postUserMessage(message);
213
+ StoreHelper.insertOrUpdateMessageArrayStore([message]);
214
+ }
215
+ postUserMessage(message) {
216
+ ChatHelper.getUser().print(message.message);
217
+ }
218
+ postAgentMessage(message) {
219
+ message.conversationEntry = ChatHelper.getAgent().print(message.message);
220
+ }
221
+ getTitleFromEntry(entry, action) {
222
+ const entryType = ServerEntryTypeEnum[entry.type];
223
+ switch (entryType) {
224
+ case ServerEntryTypeEnum.List:
225
+ return this.getTitleFromList(entry, action);
226
+ case ServerEntryTypeEnum.Text:
227
+ return this.getTitleFromText(entry, action);
228
+ default:
229
+ return "";
230
+ }
231
+ }
232
+ getTitleFromText(entry, action) {
233
+ if (!!entry.content.items)
234
+ return this.getTitleFromList(entry, action);
235
+ else
236
+ return entry.content.html;
237
+ }
238
+ getTitleFromList(entry, action) {
239
+ return entry.content.items.find((o) => o.actionKey == action).title;
240
+ }
241
+ }
176
242
  const _ContactMethodClient = class {
177
243
  constructor(container) {
178
244
  this.handleNewForm = (errors, entry) => __async(this, null, function* () {
@@ -225,7 +291,7 @@ const _ContactMethodClient = class {
225
291
  }
226
292
  return (contactMethod == null ? void 0 : contactMethod.body) || {};
227
293
  };
228
- this.chatClient = new ChatClient(container);
294
+ this.chatClient = new ChatClient();
229
295
  }
230
296
  static initialize(container, dataClient, contactMethodPlatform, agent) {
231
297
  this.dataClient = dataClient;
@@ -267,10 +333,7 @@ const _ContactMethodClient = class {
267
333
  if (messageItemIndex > -1) {
268
334
  const [messageItemType, messageItemContent] = message.message[messageItemIndex];
269
335
  const updatedMessageItemContent = __spreadProps(__spreadValues({}, messageItemContent), {
270
- contactMethods: messageItemContent.contactMethods.map((cm) => {
271
- cm.expanded = true;
272
- return cm;
273
- })
336
+ contactMethods: this.getNewContactMethods(messageItemContent.contactMethods)
274
337
  });
275
338
  const updatedMessageItems = [
276
339
  ...message.message.slice(0, messageItemIndex),
@@ -281,6 +344,17 @@ const _ContactMethodClient = class {
281
344
  }
282
345
  }
283
346
  }
347
+ getNewContactMethods(contactMethods) {
348
+ if (Array.isArray(contactMethods)) {
349
+ return contactMethods.map((cm) => {
350
+ cm.expanded = true;
351
+ return cm;
352
+ });
353
+ } else {
354
+ contactMethods.expanded = true;
355
+ return contactMethods;
356
+ }
357
+ }
284
358
  handleContactMethodList(input, contactMethods) {
285
359
  let title = input.split("/")[2];
286
360
  let newGuid = v4();
@@ -355,7 +429,7 @@ const _ContactMethodClient = class {
355
429
  return message;
356
430
  }
357
431
  }
358
- loadContactMethods(dataType, id = void 0) {
432
+ loadContactMethods(dataType, id = void 0, guideId = void 0) {
359
433
  switch (dataType) {
360
434
  case DataType.ContactMethodCategories: {
361
435
  return _ContactMethodClient.container.getAsync("matchingClient").then((matchingClient) => {
@@ -365,7 +439,9 @@ const _ContactMethodClient = class {
365
439
  });
366
440
  }
367
441
  case DataType.ContactMethods: {
368
- if (!!id) {
442
+ if (!!id && !!guideId) {
443
+ return _ContactMethodClient.dataClient.fetch(DataType.ContactMethod, { contactMethodId: id, guideId }).then((contactMethods) => contactMethods);
444
+ } else if (!!id) {
369
445
  return _ContactMethodClient.dataClient.fetch(DataType.ContactMethod, { contactMethodId: id }).then((contactMethods) => contactMethods);
370
446
  } else {
371
447
  return _ContactMethodClient.dataClient.fetch(DataType.ContactMethods, {}).then((contactMethods) => contactMethods);
@@ -382,6 +458,31 @@ const _ContactMethodClient = class {
382
458
  };
383
459
  let ContactMethodClient = _ContactMethodClient;
384
460
  ContactMethodClient.contactMessageEntryArray = [];
461
+ const _HttpHelper = class {
462
+ static combineUrl(basePath, path) {
463
+ return basePath + path;
464
+ }
465
+ static getCredentials() {
466
+ return "same-origin";
467
+ }
468
+ };
469
+ let HttpHelper = _HttpHelper;
470
+ HttpHelper.fetchOptions = {
471
+ method: "POST",
472
+ headers: {
473
+ Accept: "application/json",
474
+ "Content-Type": "application/json"
475
+ }
476
+ };
477
+ HttpHelper.managedSubdomainSuffixes = ["stage", "alpha", "beta", "gamma"];
478
+ HttpHelper.parseSubdomain = (input) => {
479
+ const index = input.lastIndexOf("-");
480
+ const lastPart = input.substr(index + 1);
481
+ if (_HttpHelper.managedSubdomainSuffixes.indexOf(lastPart) > -1) {
482
+ return input.substr(0, index);
483
+ }
484
+ return input;
485
+ };
385
486
  const getContactMethodEntry = (contactMethodId) => {
386
487
  const entries = StoreHelper.getEntryStore();
387
488
  return entries.find((e) => e.content.id === +contactMethodId);
@@ -448,11 +549,13 @@ const contactMethodFromLegacy = ({
448
549
  }
449
550
  return settings;
450
551
  };
451
- class EntryInterface {
552
+ const _EntryInterface = class {
452
553
  constructor(container) {
453
554
  this.container = container;
454
555
  this.helpActionKey = "help";
455
556
  this.nextActionKey = "next";
557
+ this.contactMethodClient = void 0;
558
+ this.contactMethodClient = new ContactMethodClient(container);
456
559
  }
457
560
  transform(entry, feedbackEntry) {
458
561
  return __async(this, null, function* () {
@@ -468,7 +571,7 @@ class EntryInterface {
468
571
  case ServerEntryTypeEnum.Text:
469
572
  return {
470
573
  id: entry.id,
471
- message: this.textTransform(entry, feedbackEntry),
574
+ message: yield this.textTransform(entry, feedbackEntry),
472
575
  entry,
473
576
  isUser: false
474
577
  };
@@ -484,12 +587,12 @@ class EntryInterface {
484
587
  }
485
588
  transformContactMethod(entry) {
486
589
  return __async(this, null, function* () {
590
+ var _a;
487
591
  const dataClient = yield this.container.getAsync("dataClient");
488
592
  const contactMethod = yield dataClient.fetch(DataType.ContactMethod, {
489
593
  contactMethodId: entry.content.id
490
594
  });
491
- const cmClient = new ContactMethodClient(this.container);
492
- cmClient.addContactMethod(contactMethod);
595
+ (_a = this.contactMethodClient) == null ? void 0 : _a.addContactMethod(contactMethod);
493
596
  });
494
597
  }
495
598
  transformArray(entryArray) {
@@ -505,26 +608,17 @@ class EntryInterface {
505
608
  });
506
609
  }
507
610
  getUserMessage(action) {
508
- let entry = StoreHelper.getEntry(action);
509
- return this.getTitleFromEntry(entry, action);
611
+ return __async(this, null, function* () {
612
+ let entry = StoreHelper.getEntry(action);
613
+ return yield this.getTitleFromEntry(entry, action);
614
+ });
510
615
  }
511
616
  listTransform(entry, feedbackEntry) {
512
- if (entry.type === "Contact") {
617
+ if (entry.type === "Contact" || !entry.content)
513
618
  return;
514
- }
515
- if (!entry.content)
516
- return;
517
- let object = this.getListActions(entry.content.items, this.getContentText(entry), entry.actions, entry.localState);
518
- if (!!feedbackEntry) {
519
- let feedbackObject = this.getListActions(feedbackEntry.content.items, this.getContentText(feedbackEntry), feedbackEntry.actions, feedbackEntry.localState);
520
- StoreHelper.insertMessageToStore({
521
- id: feedbackEntry.id,
522
- message: void 0,
523
- entry: feedbackEntry,
524
- isUser: false
525
- });
526
- return object.concat(feedbackObject);
527
- }
619
+ let object = this.getListActions(entry.content.items, this.getContentText(entry), entry.actions, entry.localState, entry.id);
620
+ if (!!feedbackEntry)
621
+ return this.addFeedbackToEntry(object, feedbackEntry);
528
622
  return object;
529
623
  }
530
624
  getContentText(entry) {
@@ -534,26 +628,30 @@ class EntryInterface {
534
628
  return { title: entry.content.header };
535
629
  }
536
630
  textTransform(entry, feedbackEntry) {
537
- if (!!entry.content.items)
538
- return this.listTransform(entry, feedbackEntry);
539
- let returnObj = [
540
- ConversationMessageListItemType.HTML,
541
- { body: entry.content.html.replace("\n", "") }
542
- ];
543
- if (!!feedbackEntry) {
544
- let feedbackObject = this.getListActions(feedbackEntry.content.items, this.getContentText(feedbackEntry), feedbackEntry.actions, feedbackEntry.localState);
545
- StoreHelper.insertMessageToStore({
546
- id: feedbackEntry.id,
547
- message: void 0,
548
- entry: feedbackEntry,
549
- isUser: false
550
- });
551
- feedbackObject.unshift(returnObj);
552
- return feedbackObject;
553
- }
554
- return returnObj;
631
+ return __async(this, null, function* () {
632
+ var _a;
633
+ if (!!entry.content.items)
634
+ return this.listTransform(entry, feedbackEntry);
635
+ let returnObj = [
636
+ [ConversationMessageListItemType.HTML, { body: entry.content.html.replace("\n", "") }]
637
+ ];
638
+ if (!!entry.actions.submitted) {
639
+ let contactMethod = yield (_a = this.contactMethodClient) == null ? void 0 : _a.loadContactMethods(DataType.ContactMethods, entry.actions.submitted.id.toString(), entry.actions.submitted.guideId.toString());
640
+ returnObj.push([
641
+ "ace-knowledge-contact-method",
642
+ {
643
+ contactMethods: contactMethod,
644
+ entry: { entryId: entry.id },
645
+ guideId: entry.actions.submitted.guideId
646
+ }
647
+ ]);
648
+ }
649
+ if (!!feedbackEntry)
650
+ return this.addFeedbackToEntry(returnObj, feedbackEntry);
651
+ return returnObj;
652
+ });
555
653
  }
556
- getListActions(items, text, actions, state) {
654
+ getListActions(items, text, actions, state, id) {
557
655
  let list = [];
558
656
  const mainListType = this.getListType(state);
559
657
  const createMainList = (type) => {
@@ -571,7 +669,7 @@ class EntryInterface {
571
669
  return formatted;
572
670
  }),
573
671
  entry: {
574
- entryId: state.entryId
672
+ entryId: id
575
673
  }
576
674
  });
577
675
  }
@@ -590,7 +688,9 @@ class EntryInterface {
590
688
  break;
591
689
  }
592
690
  case this.nextActionKey: {
593
- if (!!actions["next"] && actions["next"].take === items.filter((o2) => o2.actionKey !== "help").length + 2) {
691
+ if (!_EntryInterface.pagingAmount)
692
+ _EntryInterface.pagingAmount = actions["next"].take - items.filter((o2) => o2.actionKey !== "help" && o2.actionKey !== "next").length;
693
+ if (!!actions["next"] && actions["next"].take === items.filter((o2) => o2.actionKey !== "help" && o2.actionKey !== "next").length + _EntryInterface.pagingAmount) {
594
694
  if (Array.isArray(mainListContent)) {
595
695
  mainListContent.push({
596
696
  label: o.title,
@@ -628,112 +728,34 @@ class EntryInterface {
628
728
  return ConversationMessageListItemType.ButtonList;
629
729
  }
630
730
  getTitleFromEntry(entry, action) {
631
- if (!!entry) {
632
- const entryType = ServerEntryTypeEnum[entry.type];
633
- switch (entryType) {
634
- case ServerEntryTypeEnum.List:
635
- return this.getTitleFromList(entry, action);
636
- case ServerEntryTypeEnum.Text:
637
- return this.textTransform(entry);
638
- }
639
- }
640
- }
641
- getTitleFromList(entry, action) {
642
- return entry.content.items.find((o) => o.actionKey == action).title;
643
- }
644
- }
645
- class ChatClient {
646
- constructor(container) {
647
- this.entryInterface = new EntryInterface(container);
648
- }
649
- static initialize(user, agent) {
650
- ChatHelper.setUser(user);
651
- ChatHelper.setAgent(agent);
652
- }
653
- processMessageArrayAndStoreIt(messages) {
654
731
  return __async(this, null, function* () {
655
- for (const message of messages.filter((o) => o && o != null && !!o.message)) {
656
- if (message.isUser)
657
- this.postUserMessage(message);
658
- else
659
- this.postAgentMessage(message);
732
+ if (!!entry) {
733
+ const entryType = ServerEntryTypeEnum[entry.type];
734
+ switch (entryType) {
735
+ case ServerEntryTypeEnum.List:
736
+ return this.getTitleFromList(entry, action);
737
+ case ServerEntryTypeEnum.Text:
738
+ return yield this.textTransform(entry);
739
+ }
660
740
  }
661
- yield StoreHelper.insertOrUpdateMessageArrayStore(messages);
662
- });
663
- }
664
- updateMessageArrayAndStoreIt(messages) {
665
- let conversationEntry = void 0;
666
- messages.forEach((o) => {
667
- let message = StoreHelper.getMessage(o.id);
668
- message == null ? void 0 : message.conversationEntry.update(o.message);
669
- conversationEntry = message == null ? void 0 : message.conversationEntry;
670
741
  });
671
- StoreHelper.insertOrUpdateMessageArrayStore(messages, conversationEntry);
672
- }
673
- printUserMessageAndStoreIt(action) {
674
- if (action == "next" || action == "help")
675
- return;
676
- let entry = StoreHelper.getEntry(action);
677
- let message = {
678
- id: v4(),
679
- message: !entry ? action : this.getTitleFromEntry(entry, action),
680
- isUser: true
681
- };
682
- this.postUserMessage(message);
683
- StoreHelper.insertOrUpdateMessageArrayStore([message]);
684
- }
685
- postUserMessage(message) {
686
- ChatHelper.getUser().print(message.message);
687
- }
688
- postAgentMessage(message) {
689
- message.conversationEntry = ChatHelper.getAgent().print(message.message);
690
- }
691
- getTitleFromEntry(entry, action) {
692
- const entryType = ServerEntryTypeEnum[entry.type];
693
- switch (entryType) {
694
- case ServerEntryTypeEnum.List:
695
- return this.getTitleFromList(entry, action);
696
- case ServerEntryTypeEnum.Text:
697
- return this.getTitleFromText(entry, action);
698
- default:
699
- return "";
700
- }
701
- }
702
- getTitleFromText(entry, action) {
703
- if (!!entry.content.items)
704
- return this.getTitleFromList(entry, action);
705
- else
706
- return entry.content.html;
707
742
  }
708
743
  getTitleFromList(entry, action) {
709
744
  return entry.content.items.find((o) => o.actionKey == action).title;
710
745
  }
711
- }
712
- const _HttpHelper = class {
713
- static combineUrl(basePath, path) {
714
- return basePath + path;
715
- }
716
- static getCredentials() {
717
- return "same-origin";
718
- }
719
- };
720
- let HttpHelper = _HttpHelper;
721
- HttpHelper.fetchOptions = {
722
- method: "POST",
723
- headers: {
724
- Accept: "application/json",
725
- "Content-Type": "application/json"
726
- }
727
- };
728
- HttpHelper.managedSubdomainSuffixes = ["stage", "alpha", "beta", "gamma"];
729
- HttpHelper.parseSubdomain = (input) => {
730
- const index = input.lastIndexOf("-");
731
- const lastPart = input.substr(index + 1);
732
- if (_HttpHelper.managedSubdomainSuffixes.indexOf(lastPart) > -1) {
733
- return input.substr(0, index);
746
+ addFeedbackToEntry(current, feedbackEntry) {
747
+ let feedbackObject = this.getListActions(feedbackEntry.content.items, this.getContentText(feedbackEntry), feedbackEntry.actions, feedbackEntry.localState, feedbackEntry.id);
748
+ StoreHelper.insertMessageToStore({
749
+ id: feedbackEntry.id,
750
+ message: void 0,
751
+ entry: feedbackEntry,
752
+ isUser: false
753
+ });
754
+ return current.concat(feedbackObject);
734
755
  }
735
- return input;
736
756
  };
757
+ let EntryInterface = _EntryInterface;
758
+ EntryInterface.pagingAmount = void 0;
737
759
  class PagingInterface {
738
760
  process(entries) {
739
761
  const pagingEntry = entries.find((e) => e.tags.indexOf("paging") > -1);
@@ -876,7 +898,7 @@ class MiddlewareClient {
876
898
  this.paging = new PagingInterface();
877
899
  this.processor = new ProcessorInterface();
878
900
  this.entryInterface = new EntryInterface(container);
879
- this.chatClient = new ChatClient(container);
901
+ this.chatClient = new ChatClient();
880
902
  }
881
903
  static initialize(container, widget) {
882
904
  MiddlewareHelper.setContainer(container);
@@ -937,7 +959,7 @@ class HttpClient {
937
959
  this.endpointUrl = HttpHelper.combineUrl(this.projectionPath, "conversations");
938
960
  this.clientId = this.options.clientId;
939
961
  this.middlewareClient = new MiddlewareClient(container);
940
- this.chatClient = new ChatClient(container);
962
+ this.chatClient = new ChatClient();
941
963
  this.container = container;
942
964
  }
943
965
  firstHit() {
@@ -1125,7 +1147,7 @@ const KnowledgeBotProviderPlugin = (container) => __async(this, null, function*
1125
1147
  return next(input);
1126
1148
  });
1127
1149
  component.actions.watch("conversation.action", (input, next) => {
1128
- const chatClient = new ChatClient(container);
1150
+ const chatClient = new ChatClient();
1129
1151
  const cmClient = new ContactMethodClient(container);
1130
1152
  const loader = conversation.loading();
1131
1153
  if (input.split("/").length > 1) {