@telia-ace/knowledge-widget-bot-provider 0.0.1-alpha.35 → 0.0.1-alpha.39

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 (129) hide show
  1. package/LICENSE.txt +5 -5
  2. package/README.md +12 -12
  3. package/lib/client/chat.client.d.ts +16 -16
  4. package/lib/client/chat.client.js +79 -79
  5. package/lib/client/contact-method.client.d.ts +30 -25
  6. package/lib/client/contact-method.client.js +292 -282
  7. package/lib/client/http.client.d.ts +25 -23
  8. package/lib/client/http.client.js +130 -113
  9. package/lib/client/middleware.client.d.ts +14 -14
  10. package/lib/client/middleware.client.js +115 -118
  11. package/lib/contract/custom-component/contact-method-item.d.ts +8 -8
  12. package/lib/contract/custom-component/contact-method-item.js +54 -54
  13. package/lib/contract/custom-component/contact-method-list.d.ts +7 -7
  14. package/lib/contract/custom-component/contact-method-list.js +13 -13
  15. package/lib/contract/custom-component/contact-method.d.ts +3 -3
  16. package/lib/contract/custom-component/contact-method.js +34 -34
  17. package/lib/contract/enum/server-entry-type.enum.d.ts +7 -7
  18. package/lib/contract/enum/server-entry-type.enum.js +8 -8
  19. package/lib/contract/model/conversation-api-model/list.model.d.ts +5 -5
  20. package/lib/contract/model/conversation-api-model/list.model.js +1 -0
  21. package/lib/contract/model/conversation-api-model/message.model.d.ts +7 -7
  22. package/lib/contract/model/conversation-api-model/message.model.js +1 -0
  23. package/lib/contract/model/http/action.model.d.ts +3 -3
  24. package/lib/contract/model/http/action.model.js +1 -0
  25. package/lib/contract/model/http/client-action.model.d.ts +4 -4
  26. package/lib/contract/model/http/client-action.model.js +2 -1
  27. package/lib/contract/model/http/client-envelope.model.d.ts +9 -9
  28. package/lib/contract/model/http/client-envelope.model.js +1 -0
  29. package/lib/contract/model/http/connect-options.model.d.ts +5 -5
  30. package/lib/contract/model/http/connect-options.model.js +1 -0
  31. package/lib/contract/model/http/global-state.model.d.ts +8 -8
  32. package/lib/contract/model/http/global-state.model.js +1 -0
  33. package/lib/contract/model/http/http-client-options.model.d.ts +5 -5
  34. package/lib/contract/model/http/http-client-options.model.js +1 -0
  35. package/lib/contract/model/http/server-entry.model.d.ts +11 -11
  36. package/lib/contract/model/http/server-entry.model.js +1 -0
  37. package/lib/contract/model/http/server-envelope.model.d.ts +10 -10
  38. package/lib/contract/model/http/server-envelope.model.js +1 -0
  39. package/lib/contract/model/middleware/aggregator-state.model.d.ts +4 -4
  40. package/lib/contract/model/middleware/aggregator-state.model.js +2 -1
  41. package/lib/contract/model/shared/loose-object.model.d.ts +3 -3
  42. package/lib/contract/model/shared/loose-object.model.js +1 -0
  43. package/lib/helper/chat.helper.d.ts +8 -8
  44. package/lib/helper/chat.helper.js +18 -18
  45. package/lib/helper/http.helper.d.ts +13 -13
  46. package/lib/helper/http.helper.js +28 -28
  47. package/lib/helper/middleware.helper.d.ts +12 -12
  48. package/lib/helper/middleware.helper.js +69 -67
  49. package/lib/helper/store.helper.d.ts +22 -22
  50. package/lib/helper/store.helper.js +77 -77
  51. package/lib/index.d.ts +2 -2
  52. package/lib/index.js +2 -2
  53. package/lib/interface/entry.interface.d.ts +20 -20
  54. package/lib/interface/entry.interface.js +258 -262
  55. package/lib/interface/middleware/paging.interface.d.ts +4 -4
  56. package/lib/interface/middleware/paging.interface.js +53 -53
  57. package/lib/interface/middleware/processor.interface.d.ts +10 -10
  58. package/lib/interface/middleware/processor.interface.js +118 -118
  59. package/lib/plugin.d.ts +3 -3
  60. package/lib/plugin.js +149 -139
  61. package/lib/utils.d.ts +1 -0
  62. package/lib/utils.js +5 -0
  63. package/lib-esm/client/chat.client.d.ts +16 -16
  64. package/lib-esm/client/chat.client.js +79 -79
  65. package/lib-esm/client/contact-method.client.d.ts +30 -25
  66. package/lib-esm/client/contact-method.client.js +292 -282
  67. package/lib-esm/client/http.client.d.ts +25 -23
  68. package/lib-esm/client/http.client.js +130 -113
  69. package/lib-esm/client/middleware.client.d.ts +14 -14
  70. package/lib-esm/client/middleware.client.js +115 -118
  71. package/lib-esm/contract/custom-component/contact-method-item.d.ts +8 -8
  72. package/lib-esm/contract/custom-component/contact-method-item.js +54 -54
  73. package/lib-esm/contract/custom-component/contact-method-list.d.ts +7 -7
  74. package/lib-esm/contract/custom-component/contact-method-list.js +13 -13
  75. package/lib-esm/contract/custom-component/contact-method.d.ts +3 -3
  76. package/lib-esm/contract/custom-component/contact-method.js +34 -34
  77. package/lib-esm/contract/enum/server-entry-type.enum.d.ts +7 -7
  78. package/lib-esm/contract/enum/server-entry-type.enum.js +8 -8
  79. package/lib-esm/contract/model/conversation-api-model/list.model.d.ts +5 -5
  80. package/lib-esm/contract/model/conversation-api-model/list.model.js +1 -0
  81. package/lib-esm/contract/model/conversation-api-model/message.model.d.ts +7 -7
  82. package/lib-esm/contract/model/conversation-api-model/message.model.js +1 -0
  83. package/lib-esm/contract/model/http/action.model.d.ts +3 -3
  84. package/lib-esm/contract/model/http/action.model.js +1 -0
  85. package/lib-esm/contract/model/http/client-action.model.d.ts +4 -4
  86. package/lib-esm/contract/model/http/client-action.model.js +2 -1
  87. package/lib-esm/contract/model/http/client-envelope.model.d.ts +9 -9
  88. package/lib-esm/contract/model/http/client-envelope.model.js +1 -0
  89. package/lib-esm/contract/model/http/connect-options.model.d.ts +5 -5
  90. package/lib-esm/contract/model/http/connect-options.model.js +1 -0
  91. package/lib-esm/contract/model/http/global-state.model.d.ts +8 -8
  92. package/lib-esm/contract/model/http/global-state.model.js +1 -0
  93. package/lib-esm/contract/model/http/http-client-options.model.d.ts +5 -5
  94. package/lib-esm/contract/model/http/http-client-options.model.js +1 -0
  95. package/lib-esm/contract/model/http/server-entry.model.d.ts +11 -11
  96. package/lib-esm/contract/model/http/server-entry.model.js +1 -0
  97. package/lib-esm/contract/model/http/server-envelope.model.d.ts +10 -10
  98. package/lib-esm/contract/model/http/server-envelope.model.js +1 -0
  99. package/lib-esm/contract/model/middleware/aggregator-state.model.d.ts +4 -4
  100. package/lib-esm/contract/model/middleware/aggregator-state.model.js +2 -1
  101. package/lib-esm/contract/model/shared/loose-object.model.d.ts +3 -3
  102. package/lib-esm/contract/model/shared/loose-object.model.js +1 -0
  103. package/lib-esm/helper/chat.helper.d.ts +8 -8
  104. package/lib-esm/helper/chat.helper.js +18 -18
  105. package/lib-esm/helper/http.helper.d.ts +13 -13
  106. package/lib-esm/helper/http.helper.js +28 -28
  107. package/lib-esm/helper/middleware.helper.d.ts +12 -12
  108. package/lib-esm/helper/middleware.helper.js +69 -67
  109. package/lib-esm/helper/store.helper.d.ts +22 -22
  110. package/lib-esm/helper/store.helper.js +77 -77
  111. package/lib-esm/index.d.ts +2 -2
  112. package/lib-esm/index.js +2 -2
  113. package/lib-esm/interface/entry.interface.d.ts +20 -20
  114. package/lib-esm/interface/entry.interface.js +258 -262
  115. package/lib-esm/interface/middleware/paging.interface.d.ts +4 -4
  116. package/lib-esm/interface/middleware/paging.interface.js +53 -53
  117. package/lib-esm/interface/middleware/processor.interface.d.ts +10 -10
  118. package/lib-esm/interface/middleware/processor.interface.js +118 -118
  119. package/lib-esm/plugin.d.ts +3 -3
  120. package/lib-esm/plugin.js +149 -139
  121. package/lib-esm/utils.d.ts +1 -0
  122. package/lib-esm/utils.js +5 -0
  123. package/package.json +15 -24
  124. package/lib/interface/_mocked-contact-method.json +0 -375
  125. package/lib/interface/convert.d.ts +0 -1
  126. package/lib/interface/convert.js +0 -68
  127. package/lib-esm/interface/_mocked-contact-method.json +0 -375
  128. package/lib-esm/interface/convert.d.ts +0 -1
  129. package/lib-esm/interface/convert.js +0 -68
@@ -1,7 +1,7 @@
1
- import React from 'react';
2
- interface PropsType {
3
- contactMethodList: any;
4
- type: any;
5
- }
6
- declare const ContactMethodList: React.FC<PropsType>;
7
- export default ContactMethodList;
1
+ import React from 'react';
2
+ interface PropsType {
3
+ contactMethodList: any;
4
+ type: any;
5
+ }
6
+ declare const ContactMethodList: React.FC<PropsType>;
7
+ export default ContactMethodList;
@@ -1,13 +1,13 @@
1
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
- return cooked;
4
- };
5
- import React, { Fragment } from 'react';
6
- import styled from 'styled-components';
7
- import ContactMethodItem from './contact-method-item';
8
- var ContactMethodList = function (props) {
9
- return (React.createElement(Fragment, null, props.contactMethodList.map(function (contactMethod) { return (React.createElement(StyledContactMethod, { key: contactMethod.id, type: props.type, contactMethod: contactMethod })); })));
10
- };
11
- var StyledContactMethod = styled(ContactMethodItem)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border-bottom: 1px solid rgb(239, 239, 239);\n padding: ", ";\n"], ["\n border-bottom: 1px solid rgb(239, 239, 239);\n padding: ", ";\n"])), function (p) { var _a; return (_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.medium; });
12
- export default ContactMethodList;
13
- var templateObject_1;
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
5
+ import React, { Fragment } from 'react';
6
+ import styled from 'styled-components';
7
+ import ContactMethodItem from './contact-method-item';
8
+ var ContactMethodList = function (props) {
9
+ return (React.createElement(Fragment, null, props.contactMethodList.map(function (contactMethod) { return (React.createElement(StyledContactMethod, { key: contactMethod.id, type: props.type, contactMethod: contactMethod })); })));
10
+ };
11
+ var StyledContactMethod = styled(ContactMethodItem)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border-bottom: 1px solid rgb(239, 239, 239);\n padding: ", ";\n"], ["\n border-bottom: 1px solid rgb(239, 239, 239);\n padding: ", ";\n"])), function (p) { var _a; return (_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.medium; });
12
+ export default ContactMethodList;
13
+ var templateObject_1;
@@ -1,3 +1,3 @@
1
- import React from 'react';
2
- declare const ContactMethod: React.FC;
3
- export default ContactMethod;
1
+ import React from 'react';
2
+ declare const ContactMethod: React.FC;
3
+ export default ContactMethod;
@@ -1,34 +1,34 @@
1
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
- return cooked;
4
- };
5
- import { DataType } from '@humany/widget-types-grid';
6
- import React from 'react';
7
- import styled from 'styled-components';
8
- import ContactMethodItem from './contact-method-item';
9
- import ContactMethodList from './contact-method-list';
10
- var ContactMethod = function (props) {
11
- var _a, _b;
12
- var type;
13
- var methodList;
14
- if (props.contactMethods && ((_a = props.contactMethods.contactMethods) === null || _a === void 0 ? void 0 : _a.length) > 0) {
15
- type = DataType.ContactMethods;
16
- methodList = props.contactMethods.contactMethods;
17
- }
18
- else if (props.contactMethods.categories && ((_b = props.contactMethods.categories) === null || _b === void 0 ? void 0 : _b.length) > 0) {
19
- type = DataType.ContactMethodCategories;
20
- methodList = props.contactMethods.categories.filter(function (o) { return o.matches > 0; });
21
- }
22
- else {
23
- type = DataType.ContactMethod;
24
- methodList = props.contactMethods;
25
- }
26
- // TODO: ContactMethodItem should not be passed a list as contact method?
27
- if (!methodList.length) {
28
- return React.createElement(StyledContactMethodItem, { type: type, contactMethod: methodList });
29
- }
30
- return React.createElement(ContactMethodList, { type: type, contactMethodList: methodList });
31
- };
32
- var StyledContactMethodItem = styled(ContactMethodItem)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: ", ";\n"], ["\n padding: ", ";\n"])), function (p) { var _a; return (_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.medium; });
33
- export default ContactMethod;
34
- var templateObject_1;
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
5
+ import { DataType } from '@telia-ace/knowledge-widget-types-grid';
6
+ import React from 'react';
7
+ import styled from 'styled-components';
8
+ import ContactMethodItem from './contact-method-item';
9
+ import ContactMethodList from './contact-method-list';
10
+ var ContactMethod = function (props) {
11
+ var _a, _b;
12
+ var type;
13
+ var methodList;
14
+ if (props.contactMethods && ((_a = props.contactMethods.contactMethods) === null || _a === void 0 ? void 0 : _a.length) > 0) {
15
+ type = DataType.ContactMethods;
16
+ methodList = props.contactMethods.contactMethods;
17
+ }
18
+ else if (props.contactMethods.categories && ((_b = props.contactMethods.categories) === null || _b === void 0 ? void 0 : _b.length) > 0) {
19
+ type = DataType.ContactMethodCategories;
20
+ methodList = props.contactMethods.categories.filter(function (o) { return o.matches > 0; });
21
+ }
22
+ else {
23
+ type = DataType.ContactMethod;
24
+ methodList = props.contactMethods;
25
+ }
26
+ // TODO: ContactMethodItem should not be passed a list as contact method?
27
+ if (!methodList.length) {
28
+ return React.createElement(StyledContactMethodItem, { type: type, contactMethod: methodList });
29
+ }
30
+ return React.createElement(ContactMethodList, { type: type, contactMethodList: methodList });
31
+ };
32
+ var StyledContactMethodItem = styled(ContactMethodItem)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: ", ";\n"], ["\n padding: ", ";\n"])), function (p) { var _a; return (_a = p.theme.sizes) === null || _a === void 0 ? void 0 : _a.medium; });
33
+ export default ContactMethod;
34
+ var templateObject_1;
@@ -1,7 +1,7 @@
1
- export declare enum ServerEntryTypeEnum {
2
- Widget = 0,
3
- Text = 1,
4
- Contact = 2,
5
- List = 3,
6
- Error = 4
7
- }
1
+ export declare enum ServerEntryTypeEnum {
2
+ Widget = 0,
3
+ Text = 1,
4
+ Contact = 2,
5
+ List = 3,
6
+ Error = 4
7
+ }
@@ -1,8 +1,8 @@
1
- export var ServerEntryTypeEnum;
2
- (function (ServerEntryTypeEnum) {
3
- ServerEntryTypeEnum[ServerEntryTypeEnum["Widget"] = 0] = "Widget";
4
- ServerEntryTypeEnum[ServerEntryTypeEnum["Text"] = 1] = "Text";
5
- ServerEntryTypeEnum[ServerEntryTypeEnum["Contact"] = 2] = "Contact";
6
- ServerEntryTypeEnum[ServerEntryTypeEnum["List"] = 3] = "List";
7
- ServerEntryTypeEnum[ServerEntryTypeEnum["Error"] = 4] = "Error";
8
- })(ServerEntryTypeEnum || (ServerEntryTypeEnum = {}));
1
+ export var ServerEntryTypeEnum;
2
+ (function (ServerEntryTypeEnum) {
3
+ ServerEntryTypeEnum[ServerEntryTypeEnum["Widget"] = 0] = "Widget";
4
+ ServerEntryTypeEnum[ServerEntryTypeEnum["Text"] = 1] = "Text";
5
+ ServerEntryTypeEnum[ServerEntryTypeEnum["Contact"] = 2] = "Contact";
6
+ ServerEntryTypeEnum[ServerEntryTypeEnum["List"] = 3] = "List";
7
+ ServerEntryTypeEnum[ServerEntryTypeEnum["Error"] = 4] = "Error";
8
+ })(ServerEntryTypeEnum || (ServerEntryTypeEnum = {}));
@@ -1,5 +1,5 @@
1
- export interface List {
2
- title?: string;
3
- body?: string;
4
- items: object;
5
- }
1
+ export interface List {
2
+ title?: string;
3
+ body?: string;
4
+ items: object;
5
+ }
@@ -1,7 +1,7 @@
1
- export interface Message {
2
- id: string;
3
- message: any;
4
- entry?: any;
5
- conversationEntry?: any;
6
- isUser: boolean;
7
- }
1
+ export interface Message {
2
+ id: string;
3
+ message: any;
4
+ entry?: any;
5
+ conversationEntry?: any;
6
+ isUser: boolean;
7
+ }
@@ -1,3 +1,3 @@
1
- export interface Action {
2
- [label: string]: any;
3
- }
1
+ export interface Action {
2
+ [label: string]: any;
3
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- export interface ClientAction {
2
- key: string;
3
- content: any;
4
- }
1
+ export interface ClientAction {
2
+ key: string;
3
+ content: any;
4
+ }
@@ -1 +1,2 @@
1
- ;
1
+ ;
2
+ export {};
@@ -1,9 +1,9 @@
1
- import { LooseObject } from "../shared/loose-object.model";
2
- import { ClientAction } from "./client-action.model";
3
- export interface ClientEnvelope {
4
- command?: LooseObject;
5
- action?: ClientAction;
6
- globalState?: LooseObject;
7
- localState?: LooseObject;
8
- clientId?: string;
9
- }
1
+ import { LooseObject } from "../shared/loose-object.model";
2
+ import { ClientAction } from "./client-action.model";
3
+ export interface ClientEnvelope {
4
+ command?: LooseObject;
5
+ action?: ClientAction;
6
+ globalState?: LooseObject;
7
+ localState?: LooseObject;
8
+ clientId?: string;
9
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,5 @@
1
- import { LooseObject } from "../shared/loose-object.model";
2
- export declare type ConnectOptions = {
3
- globalState?: LooseObject;
4
- command?: LooseObject;
5
- };
1
+ import { LooseObject } from "../shared/loose-object.model";
2
+ export declare type ConnectOptions = {
3
+ globalState?: LooseObject;
4
+ command?: LooseObject;
5
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,8 +1,8 @@
1
- export interface GlobalState {
2
- completedInteractionsCount: number;
3
- lastQuestion?: string;
4
- lastBotGuide: number;
5
- lastGuideTitle?: string;
6
- site: string;
7
- invincibleParameters: object;
8
- }
1
+ export interface GlobalState {
2
+ completedInteractionsCount: number;
3
+ lastQuestion?: string;
4
+ lastBotGuide: number;
5
+ lastGuideTitle?: string;
6
+ site: string;
7
+ invincibleParameters: object;
8
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,5 @@
1
- export interface HttpClientOptions {
2
- credentials: string | undefined;
3
- clientId?: string;
4
- onError?: (error: any) => void;
5
- }
1
+ export interface HttpClientOptions {
2
+ credentials: string | undefined;
3
+ clientId?: string;
4
+ onError?: (error: any) => void;
5
+ }
@@ -1,11 +1,11 @@
1
- import { Action } from "./action.model";
2
- export interface ServerEntry {
3
- id: string;
4
- type: string;
5
- content: any;
6
- actions: Action;
7
- tags: string[];
8
- relation: string;
9
- timestamp: string;
10
- localState: object;
11
- }
1
+ import { Action } from "./action.model";
2
+ export interface ServerEntry {
3
+ id: string;
4
+ type: string;
5
+ content: any;
6
+ actions: Action;
7
+ tags: string[];
8
+ relation: string;
9
+ timestamp: string;
10
+ localState: object;
11
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,10 +1,10 @@
1
- import { ClientEnvelope } from "./client-envelope.model";
2
- import { GlobalState } from "./global-state.model";
3
- import { ServerEntry } from "./server-entry.model";
4
- export interface ServerEnvelope {
5
- clientId: string | undefined;
6
- entries: ServerEntry[];
7
- globalState: GlobalState;
8
- resolveCommand?: string;
9
- clientEnvelope: ClientEnvelope;
10
- }
1
+ import { ClientEnvelope } from "./client-envelope.model";
2
+ import { GlobalState } from "./global-state.model";
3
+ import { ServerEntry } from "./server-entry.model";
4
+ export interface ServerEnvelope {
5
+ clientId: string | undefined;
6
+ entries: ServerEntry[];
7
+ globalState: GlobalState;
8
+ resolveCommand?: string;
9
+ clientEnvelope: ClientEnvelope;
10
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- import { ServerEntry } from "../http/server-entry.model";
2
- export interface AggregatorState {
3
- [key: string]: ServerEntry;
4
- }
1
+ import { ServerEntry } from "../http/server-entry.model";
2
+ export interface AggregatorState {
3
+ [key: string]: ServerEntry;
4
+ }
@@ -1 +1,2 @@
1
- ;
1
+ ;
2
+ export {};
@@ -1,3 +1,3 @@
1
- export interface LooseObject {
2
- [key: string]: any;
3
- }
1
+ export interface LooseObject {
2
+ [key: string]: any;
3
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,8 +1,8 @@
1
- export declare class ChatHelper {
2
- private static user;
3
- private static agent;
4
- static setUser(user: any): void;
5
- static setAgent(agent: any): void;
6
- static getUser(): any;
7
- static getAgent(): any;
8
- }
1
+ export declare class ChatHelper {
2
+ private static user;
3
+ private static agent;
4
+ static setUser(user: any): void;
5
+ static setAgent(agent: any): void;
6
+ static getUser(): any;
7
+ static getAgent(): any;
8
+ }
@@ -1,18 +1,18 @@
1
- var ChatHelper = /** @class */ (function () {
2
- function ChatHelper() {
3
- }
4
- ChatHelper.setUser = function (user) {
5
- this.user = user;
6
- };
7
- ChatHelper.setAgent = function (agent) {
8
- this.agent = agent;
9
- };
10
- ChatHelper.getUser = function () {
11
- return this.user;
12
- };
13
- ChatHelper.getAgent = function () {
14
- return this.agent;
15
- };
16
- return ChatHelper;
17
- }());
18
- export { ChatHelper };
1
+ var ChatHelper = /** @class */ (function () {
2
+ function ChatHelper() {
3
+ }
4
+ ChatHelper.setUser = function (user) {
5
+ this.user = user;
6
+ };
7
+ ChatHelper.setAgent = function (agent) {
8
+ this.agent = agent;
9
+ };
10
+ ChatHelper.getUser = function () {
11
+ return this.user;
12
+ };
13
+ ChatHelper.getAgent = function () {
14
+ return this.agent;
15
+ };
16
+ return ChatHelper;
17
+ }());
18
+ export { ChatHelper };
@@ -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,28 +1,28 @@
1
- var HttpHelper = /** @class */ (function () {
2
- function HttpHelper() {
3
- }
4
- HttpHelper.combineUrl = function (basePath, path) {
5
- return basePath + path;
6
- };
7
- HttpHelper.getCredentials = function () {
8
- return 'same-origin';
9
- };
10
- HttpHelper.fetchOptions = {
11
- method: 'POST',
12
- headers: {
13
- Accept: 'application/json',
14
- 'Content-Type': 'application/json',
15
- },
16
- };
17
- HttpHelper.managedSubdomainSuffixes = ['stage', 'alpha', 'beta', 'gamma'];
18
- HttpHelper.parseSubdomain = function (input) {
19
- var index = input.lastIndexOf('-');
20
- var lastPart = input.substr(index + 1);
21
- if (HttpHelper.managedSubdomainSuffixes.indexOf(lastPart) > -1) {
22
- return input.substr(0, index);
23
- }
24
- return input;
25
- };
26
- return HttpHelper;
27
- }());
28
- export { HttpHelper };
1
+ var HttpHelper = /** @class */ (function () {
2
+ function HttpHelper() {
3
+ }
4
+ HttpHelper.combineUrl = function (basePath, path) {
5
+ return basePath + path;
6
+ };
7
+ HttpHelper.getCredentials = function () {
8
+ return 'same-origin';
9
+ };
10
+ HttpHelper.fetchOptions = {
11
+ method: 'POST',
12
+ headers: {
13
+ Accept: 'application/json',
14
+ 'Content-Type': 'application/json',
15
+ },
16
+ };
17
+ HttpHelper.managedSubdomainSuffixes = ['stage', 'alpha', 'beta', 'gamma'];
18
+ HttpHelper.parseSubdomain = function (input) {
19
+ var index = input.lastIndexOf('-');
20
+ var lastPart = input.substr(index + 1);
21
+ if (HttpHelper.managedSubdomainSuffixes.indexOf(lastPart) > -1) {
22
+ return input.substr(0, index);
23
+ }
24
+ return input;
25
+ };
26
+ return HttpHelper;
27
+ }());
28
+ export { HttpHelper };
@@ -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
+ }