@telia-ace/knowledge-widget-bot-provider 0.0.1-alpha.3 → 0.0.1-alpha.32
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 +16 -15
- package/lib/client/chat.client.js +79 -80
- package/lib/client/contact-method.client.d.ts +25 -22
- package/lib/client/contact-method.client.js +282 -276
- package/lib/client/http.client.d.ts +23 -22
- package/lib/client/http.client.js +160 -115
- package/lib/client/middleware.client.d.ts +14 -13
- package/lib/client/middleware.client.js +104 -60
- package/lib/contract/custom-component/contact-method-item.d.ts +8 -8
- package/lib/contract/custom-component/contact-method-item.js +54 -76
- package/lib/contract/custom-component/contact-method-list.d.ts +7 -7
- package/lib/contract/custom-component/contact-method-list.js +13 -41
- package/lib/contract/custom-component/contact-method.d.ts +3 -3
- package/lib/contract/custom-component/contact-method.js +34 -38
- package/lib/contract/enum/server-entry-type.enum.d.ts +7 -6
- package/lib/contract/enum/server-entry-type.enum.js +8 -10
- package/lib/contract/model/conversation-api-model/list.model.d.ts +5 -5
- package/lib/contract/model/conversation-api-model/list.model.js +0 -2
- package/lib/contract/model/conversation-api-model/message.model.d.ts +7 -7
- package/lib/contract/model/conversation-api-model/message.model.js +0 -2
- package/lib/contract/model/http/action.model.d.ts +3 -3
- package/lib/contract/model/http/action.model.js +0 -2
- package/lib/contract/model/http/client-action.model.d.ts +4 -4
- package/lib/contract/model/http/client-action.model.js +1 -3
- package/lib/contract/model/http/client-envelope.model.d.ts +9 -9
- package/lib/contract/model/http/client-envelope.model.js +0 -2
- package/lib/contract/model/http/connect-options.model.d.ts +5 -5
- package/lib/contract/model/http/connect-options.model.js +0 -2
- package/lib/contract/model/http/global-state.model.d.ts +8 -8
- package/lib/contract/model/http/global-state.model.js +0 -2
- package/lib/contract/model/http/http-client-options.model.d.ts +5 -5
- package/lib/contract/model/http/http-client-options.model.js +0 -2
- package/lib/contract/model/http/server-entry.model.d.ts +11 -11
- package/lib/contract/model/http/server-entry.model.js +0 -2
- package/lib/contract/model/http/server-envelope.model.d.ts +10 -10
- package/lib/contract/model/http/server-envelope.model.js +0 -2
- package/lib/contract/model/middleware/aggregator-state.model.d.ts +4 -4
- package/lib/contract/model/middleware/aggregator-state.model.js +1 -3
- package/lib/contract/model/shared/loose-object.model.d.ts +3 -3
- package/lib/contract/model/shared/loose-object.model.js +0 -2
- package/lib/helper/chat.helper.d.ts +8 -8
- package/lib/helper/chat.helper.js +18 -21
- package/lib/helper/http.helper.d.ts +13 -13
- package/lib/helper/http.helper.js +28 -33
- package/lib/helper/middleware.helper.d.ts +12 -12
- package/lib/helper/middleware.helper.js +67 -72
- package/lib/helper/store.helper.d.ts +22 -22
- package/lib/helper/store.helper.js +77 -80
- package/lib/index.d.ts +2 -2
- package/lib/index.js +2 -8
- package/lib/interface/_mocked-contact-method.json +375 -0
- package/lib/interface/convert.d.ts +1 -0
- package/lib/interface/convert.js +68 -0
- package/lib/interface/entry.interface.d.ts +20 -17
- package/lib/interface/entry.interface.js +262 -139
- package/lib/interface/middleware/paging.interface.d.ts +4 -4
- package/lib/interface/middleware/paging.interface.js +53 -55
- package/lib/interface/middleware/processor.interface.d.ts +10 -10
- package/lib/interface/middleware/processor.interface.js +118 -120
- package/lib/plugin.d.ts +3 -3
- package/lib/plugin.js +147 -169
- package/lib-esm/client/chat.client.d.ts +16 -15
- package/lib-esm/client/chat.client.js +79 -75
- package/lib-esm/client/contact-method.client.d.ts +25 -22
- package/lib-esm/client/contact-method.client.js +282 -270
- package/lib-esm/client/http.client.d.ts +23 -22
- package/lib-esm/client/http.client.js +160 -109
- package/lib-esm/client/middleware.client.d.ts +14 -13
- package/lib-esm/client/middleware.client.js +104 -55
- package/lib-esm/contract/custom-component/contact-method-item.d.ts +8 -8
- package/lib-esm/contract/custom-component/contact-method-item.js +54 -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 +34 -33
- package/lib-esm/contract/enum/server-entry-type.enum.d.ts +7 -6
- package/lib-esm/contract/enum/server-entry-type.enum.js +8 -7
- package/lib-esm/contract/model/conversation-api-model/list.model.d.ts +5 -5
- package/lib-esm/contract/model/conversation-api-model/list.model.js +0 -1
- package/lib-esm/contract/model/conversation-api-model/message.model.d.ts +7 -7
- package/lib-esm/contract/model/conversation-api-model/message.model.js +0 -1
- package/lib-esm/contract/model/http/action.model.d.ts +3 -3
- package/lib-esm/contract/model/http/action.model.js +0 -1
- package/lib-esm/contract/model/http/client-action.model.d.ts +4 -4
- package/lib-esm/contract/model/http/client-action.model.js +1 -2
- package/lib-esm/contract/model/http/client-envelope.model.d.ts +9 -9
- package/lib-esm/contract/model/http/client-envelope.model.js +0 -1
- package/lib-esm/contract/model/http/connect-options.model.d.ts +5 -5
- package/lib-esm/contract/model/http/connect-options.model.js +0 -1
- package/lib-esm/contract/model/http/global-state.model.d.ts +8 -8
- package/lib-esm/contract/model/http/global-state.model.js +0 -1
- package/lib-esm/contract/model/http/http-client-options.model.d.ts +5 -5
- package/lib-esm/contract/model/http/http-client-options.model.js +0 -1
- package/lib-esm/contract/model/http/server-entry.model.d.ts +11 -11
- package/lib-esm/contract/model/http/server-entry.model.js +0 -1
- package/lib-esm/contract/model/http/server-envelope.model.d.ts +10 -10
- package/lib-esm/contract/model/http/server-envelope.model.js +0 -1
- package/lib-esm/contract/model/middleware/aggregator-state.model.d.ts +4 -4
- package/lib-esm/contract/model/middleware/aggregator-state.model.js +1 -2
- package/lib-esm/contract/model/shared/loose-object.model.d.ts +3 -3
- package/lib-esm/contract/model/shared/loose-object.model.js +0 -1
- 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 -30
- package/lib-esm/helper/middleware.helper.d.ts +12 -12
- package/lib-esm/helper/middleware.helper.js +67 -69
- 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/_mocked-contact-method.json +375 -0
- package/lib-esm/interface/convert.d.ts +1 -0
- package/lib-esm/interface/convert.js +68 -0
- package/lib-esm/interface/entry.interface.d.ts +20 -17
- package/lib-esm/interface/entry.interface.js +262 -137
- 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 +147 -141
- package/package.json +54 -45
- package/lib/interface/middleware/contact-expanded.interface.d.ts +0 -0
- package/lib/interface/middleware/contact-expanded.interface.js +0 -50
- package/lib/interface/middleware/legacy-contact-methods.interface.d.ts +0 -0
- package/lib/interface/middleware/legacy-contact-methods.interface.js +0 -394
|
@@ -1,76 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
s
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var
|
|
14
|
-
if (
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
var react_1 = __importStar(require("react"));
|
|
56
|
-
var ContactMethodItem = function (props) {
|
|
57
|
-
var dispatch = (0, widget_ui_1.useDispatch)();
|
|
58
|
-
var container = (0, widget_ui_1.useContainer)();
|
|
59
|
-
var _a = __read((0, react_1.useState)(props.contactMethod.body), 2), body = _a[0], setBody = _a[1];
|
|
60
|
-
(0, react_1.useEffect)(function () {
|
|
61
|
-
var events = container.get('$widget').events;
|
|
62
|
-
events.subscribe('form:validated', function (_event, _data) {
|
|
63
|
-
// TODO: this is a due to props not being updated when props.contactMethod.body changes
|
|
64
|
-
// perhaps there is a cleaner way of doing this
|
|
65
|
-
setBody(props.contactMethod.body);
|
|
66
|
-
});
|
|
67
|
-
}, [container]);
|
|
68
|
-
return (react_1.default.createElement(knowledge_widget_adapters_1.ContactMethod, __assign({ className: props.className, onClick: function () {
|
|
69
|
-
dispatch('action', "".concat(props.contactMethod.id, "/").concat(props.type.toString(), "/").concat(props.contactMethod.title));
|
|
70
|
-
// dispatch(
|
|
71
|
-
// "expand",
|
|
72
|
-
// `${props.contactMethod.id}/${props.type.toString()}`
|
|
73
|
-
// );
|
|
74
|
-
}, dispatch: dispatch }, props.contactMethod, { body: body, expanded: props.contactMethod.expanded })));
|
|
75
|
-
};
|
|
76
|
-
exports.default = ContactMethodItem;
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
13
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
14
|
+
if (!m) return o;
|
|
15
|
+
var i = m.call(o), r, ar = [], e;
|
|
16
|
+
try {
|
|
17
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
18
|
+
}
|
|
19
|
+
catch (error) { e = { error: error }; }
|
|
20
|
+
finally {
|
|
21
|
+
try {
|
|
22
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
23
|
+
}
|
|
24
|
+
finally { if (e) throw e.error; }
|
|
25
|
+
}
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
import { ContactMethod as GenericContactMethod } from '@humany/widget-adapters';
|
|
29
|
+
import { useContainer, useDispatch } from '@humany/widget-ui';
|
|
30
|
+
import React, { useEffect, useState } from 'react';
|
|
31
|
+
var ContactMethodItem = function (props) {
|
|
32
|
+
var dispatch = useDispatch();
|
|
33
|
+
var container = useContainer();
|
|
34
|
+
var _a = __read(useState(props.contactMethod.body), 2), body = _a[0], setBody = _a[1];
|
|
35
|
+
useEffect(function () {
|
|
36
|
+
if (!container || !container.get('$widget')) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
var events = container.get('$widget').events;
|
|
40
|
+
events.subscribe('form:validated', function (_event, _data) {
|
|
41
|
+
// TODO: this is a due to props not being updated when props.contactMethod.body changes
|
|
42
|
+
// perhaps there is a cleaner way of doing this
|
|
43
|
+
setBody(props.contactMethod.body);
|
|
44
|
+
});
|
|
45
|
+
}, [container]);
|
|
46
|
+
return (React.createElement(GenericContactMethod, __assign({ className: props.className, onClick: function () {
|
|
47
|
+
dispatch('action', props.contactMethod.id + "/" + props.type.toString() + "/" + props.contactMethod.title);
|
|
48
|
+
// dispatch(
|
|
49
|
+
// "expand",
|
|
50
|
+
// `${props.contactMethod.id}/${props.type.toString()}`
|
|
51
|
+
// );
|
|
52
|
+
}, dispatch: dispatch }, props.contactMethod, { body: body, expanded: props.contactMethod.expanded })));
|
|
53
|
+
};
|
|
54
|
+
export default ContactMethodItem;
|
|
@@ -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,41 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
o[k2] = m[k];
|
|
16
|
-
}));
|
|
17
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
-
}) : function(o, v) {
|
|
20
|
-
o["default"] = v;
|
|
21
|
-
});
|
|
22
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
-
if (mod && mod.__esModule) return mod;
|
|
24
|
-
var result = {};
|
|
25
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
-
__setModuleDefault(result, mod);
|
|
27
|
-
return result;
|
|
28
|
-
};
|
|
29
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
30
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
31
|
-
};
|
|
32
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
var react_1 = __importStar(require("react"));
|
|
34
|
-
var styled_components_1 = __importDefault(require("styled-components"));
|
|
35
|
-
var contact_method_item_1 = __importDefault(require("./contact-method-item"));
|
|
36
|
-
var ContactMethodList = function (props) {
|
|
37
|
-
return (react_1.default.createElement(react_1.Fragment, null, props.contactMethodList.map(function (contactMethod) { return (react_1.default.createElement(StyledContactMethod, { key: contactMethod.id, type: props.type, contactMethod: contactMethod })); })));
|
|
38
|
-
};
|
|
39
|
-
var StyledContactMethod = (0, styled_components_1.default)(contact_method_item_1.default)(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; });
|
|
40
|
-
exports.default = ContactMethodList;
|
|
41
|
-
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,38 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
type
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
};
|
|
36
|
-
var StyledContactMethodItem = (0, 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
|
+
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,6 +1,7 @@
|
|
|
1
|
-
export declare enum ServerEntryTypeEnum {
|
|
2
|
-
Widget = 0,
|
|
3
|
-
Text = 1,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
export declare enum ServerEntryTypeEnum {
|
|
2
|
+
Widget = 0,
|
|
3
|
+
Text = 1,
|
|
4
|
+
Contact = 2,
|
|
5
|
+
List = 3,
|
|
6
|
+
Error = 4
|
|
7
|
+
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
ServerEntryTypeEnum[ServerEntryTypeEnum["
|
|
7
|
-
ServerEntryTypeEnum[ServerEntryTypeEnum["
|
|
8
|
-
|
|
9
|
-
ServerEntryTypeEnum[ServerEntryTypeEnum["Error"] = 3] = "Error";
|
|
10
|
-
})(ServerEntryTypeEnum = exports.ServerEntryTypeEnum || (exports.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
|
+
}
|
|
@@ -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,21 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
ChatHelper.
|
|
8
|
-
this.
|
|
9
|
-
};
|
|
10
|
-
ChatHelper.
|
|
11
|
-
this.
|
|
12
|
-
};
|
|
13
|
-
ChatHelper.
|
|
14
|
-
return this.
|
|
15
|
-
};
|
|
16
|
-
ChatHelper
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return ChatHelper;
|
|
20
|
-
}());
|
|
21
|
-
exports.ChatHelper = 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 };
|