@telia-ace/knowledge-widget-bot-provider 0.0.1-alpha.18 → 0.0.1-alpha.21
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/LICENSE.txt +5 -5
- package/README.md +12 -12
- package/lib/client/chat.client.d.ts +15 -15
- package/lib/client/chat.client.js +84 -79
- package/lib/client/contact-method.client.d.ts +22 -22
- package/lib/client/contact-method.client.js +279 -273
- package/lib/client/http.client.d.ts +22 -22
- package/lib/client/http.client.js +119 -113
- package/lib/client/middleware.client.d.ts +13 -13
- package/lib/client/middleware.client.js +51 -46
- package/lib/contract/custom-component/contact-method-item.d.ts +8 -8
- package/lib/contract/custom-component/contact-method-item.js +72 -51
- package/lib/contract/custom-component/contact-method-list.d.ts +7 -7
- package/lib/contract/custom-component/contact-method-list.js +37 -13
- package/lib/contract/custom-component/contact-method.d.ts +3 -3
- package/lib/contract/custom-component/contact-method.js +38 -33
- package/lib/contract/enum/server-entry-type.enum.d.ts +6 -6
- package/lib/contract/enum/server-entry-type.enum.js +10 -7
- package/lib/contract/model/conversation-api-model/list.model.d.ts +5 -5
- package/lib/contract/model/conversation-api-model/list.model.js +2 -0
- package/lib/contract/model/conversation-api-model/message.model.d.ts +7 -7
- package/lib/contract/model/conversation-api-model/message.model.js +2 -0
- package/lib/contract/model/http/action.model.d.ts +3 -3
- package/lib/contract/model/http/action.model.js +2 -0
- package/lib/contract/model/http/client-action.model.d.ts +4 -4
- package/lib/contract/model/http/client-action.model.js +3 -1
- package/lib/contract/model/http/client-envelope.model.d.ts +9 -9
- package/lib/contract/model/http/client-envelope.model.js +2 -0
- package/lib/contract/model/http/connect-options.model.d.ts +5 -5
- package/lib/contract/model/http/connect-options.model.js +2 -0
- package/lib/contract/model/http/global-state.model.d.ts +8 -8
- package/lib/contract/model/http/global-state.model.js +2 -0
- package/lib/contract/model/http/http-client-options.model.d.ts +5 -5
- package/lib/contract/model/http/http-client-options.model.js +2 -0
- package/lib/contract/model/http/server-entry.model.d.ts +11 -11
- package/lib/contract/model/http/server-entry.model.js +2 -0
- package/lib/contract/model/http/server-envelope.model.d.ts +10 -10
- package/lib/contract/model/http/server-envelope.model.js +2 -0
- package/lib/contract/model/middleware/aggregator-state.model.d.ts +4 -4
- package/lib/contract/model/middleware/aggregator-state.model.js +3 -1
- package/lib/contract/model/shared/loose-object.model.d.ts +3 -3
- package/lib/contract/model/shared/loose-object.model.js +2 -0
- package/lib/helper/chat.helper.d.ts +8 -8
- package/lib/helper/chat.helper.js +21 -18
- package/lib/helper/http.helper.d.ts +13 -13
- package/lib/helper/http.helper.js +31 -28
- package/lib/helper/middleware.helper.d.ts +12 -12
- package/lib/helper/middleware.helper.js +70 -67
- package/lib/helper/store.helper.d.ts +22 -22
- package/lib/helper/store.helper.js +80 -77
- package/lib/index.d.ts +2 -2
- package/lib/index.js +8 -2
- package/lib/interface/entry.interface.d.ts +17 -17
- package/lib/interface/entry.interface.js +135 -133
- package/lib/interface/middleware/contact-expanded.interface.d.ts +0 -0
- package/lib/interface/middleware/contact-expanded.interface.js +50 -0
- package/lib/interface/middleware/legacy-contact-methods.interface.d.ts +0 -0
- package/lib/interface/middleware/legacy-contact-methods.interface.js +394 -0
- package/lib/interface/middleware/paging.interface.d.ts +4 -4
- package/lib/interface/middleware/paging.interface.js +55 -53
- package/lib/interface/middleware/processor.interface.d.ts +10 -10
- package/lib/interface/middleware/processor.interface.js +120 -118
- package/lib/plugin.d.ts +3 -3
- package/lib/plugin.js +172 -214
- package/lib-esm/client/chat.client.d.ts +15 -15
- package/lib-esm/client/chat.client.js +79 -79
- package/lib-esm/client/contact-method.client.d.ts +22 -22
- package/lib-esm/client/contact-method.client.js +273 -273
- package/lib-esm/client/http.client.d.ts +22 -22
- package/lib-esm/client/http.client.js +113 -113
- package/lib-esm/client/middleware.client.d.ts +13 -13
- package/lib-esm/client/middleware.client.js +46 -46
- package/lib-esm/contract/custom-component/contact-method-item.d.ts +8 -8
- package/lib-esm/contract/custom-component/contact-method-item.js +51 -51
- package/lib-esm/contract/custom-component/contact-method-list.d.ts +7 -7
- package/lib-esm/contract/custom-component/contact-method-list.js +13 -13
- package/lib-esm/contract/custom-component/contact-method.d.ts +3 -3
- package/lib-esm/contract/custom-component/contact-method.js +33 -33
- package/lib-esm/contract/enum/server-entry-type.enum.d.ts +6 -6
- package/lib-esm/contract/enum/server-entry-type.enum.js +7 -7
- package/lib-esm/contract/model/conversation-api-model/list.model.d.ts +5 -5
- package/lib-esm/contract/model/conversation-api-model/message.model.d.ts +7 -7
- package/lib-esm/contract/model/http/action.model.d.ts +3 -3
- package/lib-esm/contract/model/http/client-action.model.d.ts +4 -4
- package/lib-esm/contract/model/http/client-action.model.js +1 -1
- package/lib-esm/contract/model/http/client-envelope.model.d.ts +9 -9
- package/lib-esm/contract/model/http/connect-options.model.d.ts +5 -5
- package/lib-esm/contract/model/http/global-state.model.d.ts +8 -8
- package/lib-esm/contract/model/http/http-client-options.model.d.ts +5 -5
- package/lib-esm/contract/model/http/server-entry.model.d.ts +11 -11
- package/lib-esm/contract/model/http/server-envelope.model.d.ts +10 -10
- package/lib-esm/contract/model/middleware/aggregator-state.model.d.ts +4 -4
- package/lib-esm/contract/model/middleware/aggregator-state.model.js +1 -1
- package/lib-esm/contract/model/shared/loose-object.model.d.ts +3 -3
- package/lib-esm/helper/chat.helper.d.ts +8 -8
- package/lib-esm/helper/chat.helper.js +18 -18
- package/lib-esm/helper/http.helper.d.ts +13 -13
- package/lib-esm/helper/http.helper.js +28 -28
- package/lib-esm/helper/middleware.helper.d.ts +12 -12
- package/lib-esm/helper/middleware.helper.js +67 -67
- package/lib-esm/helper/store.helper.d.ts +22 -22
- package/lib-esm/helper/store.helper.js +77 -77
- package/lib-esm/index.d.ts +2 -2
- package/lib-esm/index.js +2 -2
- package/lib-esm/interface/entry.interface.d.ts +17 -17
- package/lib-esm/interface/entry.interface.js +133 -133
- package/lib-esm/interface/middleware/paging.interface.d.ts +4 -4
- package/lib-esm/interface/middleware/paging.interface.js +53 -53
- package/lib-esm/interface/middleware/processor.interface.d.ts +10 -10
- package/lib-esm/interface/middleware/processor.interface.js +118 -118
- package/lib-esm/plugin.d.ts +3 -3
- package/lib-esm/plugin.js +148 -214
- package/package.json +43 -52
|
@@ -1,33 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
var widget_types_grid_1 = require("@humany/widget-types-grid");
|
|
11
|
+
var react_1 = __importDefault(require("react"));
|
|
12
|
+
var styled_components_1 = __importDefault(require("styled-components"));
|
|
13
|
+
var contact_method_item_1 = __importDefault(require("./contact-method-item"));
|
|
14
|
+
var contact_method_list_1 = __importDefault(require("./contact-method-list"));
|
|
15
|
+
var ContactMethod = function (props) {
|
|
16
|
+
var _a, _b;
|
|
17
|
+
var type;
|
|
18
|
+
var methodList;
|
|
19
|
+
if (props.contactMethods && ((_a = props.contactMethods.contactMethods) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
20
|
+
type = widget_types_grid_1.DataType.ContactMethods;
|
|
21
|
+
methodList = props.contactMethods.contactMethods;
|
|
22
|
+
}
|
|
23
|
+
else if (props.contactMethods.categories && ((_b = props.contactMethods.categories) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
|
24
|
+
type = widget_types_grid_1.DataType.ContactMethodCategories;
|
|
25
|
+
methodList = props.contactMethods.categories.filter(function (o) { return o.matches > 0; });
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
type = widget_types_grid_1.DataType.ContactMethod;
|
|
29
|
+
methodList = props.contactMethods;
|
|
30
|
+
}
|
|
31
|
+
if (!methodList.length) {
|
|
32
|
+
return react_1.default.createElement(StyledContactMethodItem, { type: type, contactMethod: methodList });
|
|
33
|
+
}
|
|
34
|
+
return react_1.default.createElement(contact_method_list_1.default, { type: type, contactMethodList: methodList });
|
|
35
|
+
};
|
|
36
|
+
var StyledContactMethodItem = styled_components_1.default(contact_method_item_1.default)(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; });
|
|
37
|
+
exports.default = ContactMethod;
|
|
38
|
+
var templateObject_1;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare enum ServerEntryTypeEnum {
|
|
2
|
-
Widget = 0,
|
|
3
|
-
Text = 1,
|
|
4
|
-
List = 2,
|
|
5
|
-
Error = 3
|
|
6
|
-
}
|
|
1
|
+
export declare enum ServerEntryTypeEnum {
|
|
2
|
+
Widget = 0,
|
|
3
|
+
Text = 1,
|
|
4
|
+
List = 2,
|
|
5
|
+
Error = 3
|
|
6
|
+
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
(
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
ServerEntryTypeEnum[ServerEntryTypeEnum["
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ServerEntryTypeEnum = void 0;
|
|
4
|
+
var ServerEntryTypeEnum;
|
|
5
|
+
(function (ServerEntryTypeEnum) {
|
|
6
|
+
ServerEntryTypeEnum[ServerEntryTypeEnum["Widget"] = 0] = "Widget";
|
|
7
|
+
ServerEntryTypeEnum[ServerEntryTypeEnum["Text"] = 1] = "Text";
|
|
8
|
+
ServerEntryTypeEnum[ServerEntryTypeEnum["List"] = 2] = "List";
|
|
9
|
+
ServerEntryTypeEnum[ServerEntryTypeEnum["Error"] = 3] = "Error";
|
|
10
|
+
})(ServerEntryTypeEnum = exports.ServerEntryTypeEnum || (exports.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
|
+
}
|
|
@@ -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,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
|
+
}
|
|
@@ -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
|
+
};
|
|
@@ -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
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -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,3 +1,3 @@
|
|
|
1
|
-
export interface LooseObject {
|
|
2
|
-
[key: string]: any;
|
|
3
|
-
}
|
|
1
|
+
export interface LooseObject {
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
}
|
|
@@ -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,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
ChatHelper.
|
|
8
|
-
this.
|
|
9
|
-
};
|
|
10
|
-
ChatHelper.
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
ChatHelper.
|
|
14
|
-
return this.
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChatHelper = void 0;
|
|
4
|
+
var ChatHelper = /** @class */ (function () {
|
|
5
|
+
function ChatHelper() {
|
|
6
|
+
}
|
|
7
|
+
ChatHelper.setUser = function (user) {
|
|
8
|
+
this.user = user;
|
|
9
|
+
};
|
|
10
|
+
ChatHelper.setAgent = function (agent) {
|
|
11
|
+
this.agent = agent;
|
|
12
|
+
};
|
|
13
|
+
ChatHelper.getUser = function () {
|
|
14
|
+
return this.user;
|
|
15
|
+
};
|
|
16
|
+
ChatHelper.getAgent = function () {
|
|
17
|
+
return this.agent;
|
|
18
|
+
};
|
|
19
|
+
return ChatHelper;
|
|
20
|
+
}());
|
|
21
|
+
exports.ChatHelper = 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,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
HttpHelper.
|
|
8
|
-
return
|
|
9
|
-
};
|
|
10
|
-
HttpHelper.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HttpHelper = void 0;
|
|
4
|
+
var HttpHelper = /** @class */ (function () {
|
|
5
|
+
function HttpHelper() {
|
|
6
|
+
}
|
|
7
|
+
HttpHelper.combineUrl = function (basePath, path) {
|
|
8
|
+
return basePath + path;
|
|
9
|
+
};
|
|
10
|
+
HttpHelper.getCredentials = function () {
|
|
11
|
+
return 'same-origin';
|
|
12
|
+
};
|
|
13
|
+
HttpHelper.fetchOptions = {
|
|
14
|
+
method: 'POST',
|
|
15
|
+
headers: {
|
|
16
|
+
Accept: 'application/json',
|
|
17
|
+
'Content-Type': 'application/json',
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
HttpHelper.managedSubdomainSuffixes = ['stage', 'alpha', 'beta', 'gamma'];
|
|
21
|
+
HttpHelper.parseSubdomain = function (input) {
|
|
22
|
+
var index = input.lastIndexOf('-');
|
|
23
|
+
var lastPart = input.substr(index + 1);
|
|
24
|
+
if (HttpHelper.managedSubdomainSuffixes.indexOf(lastPart) > -1) {
|
|
25
|
+
return input.substr(0, index);
|
|
26
|
+
}
|
|
27
|
+
return input;
|
|
28
|
+
};
|
|
29
|
+
return HttpHelper;
|
|
30
|
+
}());
|
|
31
|
+
exports.HttpHelper = 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
|
+
}
|