@telia-ace/knowledge-widget-bot-provider 0.0.1-alpha.62 → 0.0.1-alpha.63
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/dist/contact-method-list.d45b8f36.js +88 -0
- package/dist/contact-method-list.d45b8f36.js.map +1 -0
- package/dist/contact-method.fb45a5e2.js +119 -0
- package/dist/contact-method.fb45a5e2.js.map +1 -0
- package/dist/entry-handler.d.ts +2 -0
- package/dist/feedback-list.29c075b4.js +70 -0
- package/dist/feedback-list.29c075b4.js.map +1 -0
- package/dist/http-client.d.ts +43 -0
- package/dist/index.76a36f22.js +767 -0
- package/dist/index.76a36f22.js.map +1 -0
- package/dist/index.js +6 -669
- package/dist/index.js.map +1 -1
- package/dist/no-good-alternative.45aa0387.js +41 -0
- package/dist/no-good-alternative.45aa0387.js.map +1 -0
- package/dist/notification-list.cae1df51.js +62 -0
- package/dist/notification-list.cae1df51.js.map +1 -0
- package/dist/provider.d.ts +25 -0
- package/dist/store.d.ts +15 -0
- package/dist/styles.6c010dfc.js +15 -0
- package/dist/styles.6c010dfc.js.map +1 -0
- package/dist/types.d.ts +79 -0
- package/dist/ui/contact-method-list.d.ts +10 -0
- package/dist/ui/contact-method.d.ts +9 -0
- package/dist/ui/feedback-list.d.ts +8 -0
- package/dist/ui/no-good-alternative.d.ts +6 -0
- package/dist/ui/notification-list.d.ts +11 -0
- package/dist/ui/styles.d.ts +1 -0
- package/dist/utils.d.ts +26 -0
- package/package.json +11 -14
- package/dist/client/chat.client.d.ts +0 -16
- package/dist/client/contact-method.client.d.ts +0 -25
- package/dist/client/http.client.d.ts +0 -23
- package/dist/client/middleware.client.d.ts +0 -14
- package/dist/contact-method.15886c3d.js +0 -66
- package/dist/contact-method.15886c3d.js.map +0 -1
- package/dist/contract/custom-component/contact-method-item.d.ts +0 -8
- package/dist/contract/custom-component/contact-method-list.d.ts +0 -7
- package/dist/contract/custom-component/contact-method.d.ts +0 -3
- package/dist/contract/enum/server-entry-type.enum.d.ts +0 -7
- package/dist/contract/model/conversation-api-model/list.model.d.ts +0 -5
- package/dist/contract/model/conversation-api-model/message.model.d.ts +0 -7
- package/dist/contract/model/http/action.model.d.ts +0 -3
- package/dist/contract/model/http/client-action.model.d.ts +0 -4
- package/dist/contract/model/http/client-envelope.model.d.ts +0 -9
- package/dist/contract/model/http/connect-options.model.d.ts +0 -5
- package/dist/contract/model/http/global-state.model.d.ts +0 -8
- package/dist/contract/model/http/http-client-options.model.d.ts +0 -5
- package/dist/contract/model/http/server-entry.model.d.ts +0 -11
- package/dist/contract/model/http/server-envelope.model.d.ts +0 -10
- package/dist/contract/model/middleware/aggregator-state.model.d.ts +0 -4
- package/dist/contract/model/shared/loose-object.model.d.ts +0 -3
- package/dist/helper/chat.helper.d.ts +0 -8
- package/dist/helper/http.helper.d.ts +0 -13
- package/dist/helper/middleware.helper.d.ts +0 -12
- package/dist/helper/store.helper.d.ts +0 -22
- package/dist/interface/entry.interface.d.ts +0 -20
- package/dist/interface/middleware/paging.interface.d.ts +0 -4
- package/dist/interface/middleware/processor.interface.d.ts +0 -10
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
var g = Object.defineProperty, f = Object.defineProperties;
|
|
2
|
-
var u = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var s = Object.getOwnPropertySymbols;
|
|
4
|
-
var y = Object.prototype.hasOwnProperty, C = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var h = (t, e, o) => e in t ? g(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o, m = (t, e) => {
|
|
6
|
-
for (var o in e || (e = {}))
|
|
7
|
-
y.call(e, o) && h(t, o, e[o]);
|
|
8
|
-
if (s)
|
|
9
|
-
for (var o of s(e))
|
|
10
|
-
C.call(e, o) && h(t, o, e[o]);
|
|
11
|
-
return t;
|
|
12
|
-
}, M = (t, e) => f(t, u(e));
|
|
13
|
-
import { DataType as i } from "@telia-ace/knowledge-widget-types-grid";
|
|
14
|
-
import c, { useState as b, useEffect as $, Fragment as E } from "react";
|
|
15
|
-
import r from "styled-components";
|
|
16
|
-
import { ContactMethod as x } from "@telia-ace/knowledge-widget-adapters";
|
|
17
|
-
import { useDispatch as L, useContainer as S } from "@telia-ace/knowledge-widget-ui";
|
|
18
|
-
const l = (t) => {
|
|
19
|
-
const e = L(), o = S(), [n, a] = b(t.contactMethod.body);
|
|
20
|
-
return $(() => {
|
|
21
|
-
if (!o || !o.get("$widget"))
|
|
22
|
-
return;
|
|
23
|
-
const { events: d } = o.get("$widget");
|
|
24
|
-
d.subscribe("form:validated", (z, D) => {
|
|
25
|
-
a(t.contactMethod.body);
|
|
26
|
-
});
|
|
27
|
-
}, [o]), /* @__PURE__ */ c.createElement(x, M(m({
|
|
28
|
-
className: t.className,
|
|
29
|
-
onClick: () => {
|
|
30
|
-
e("action", `${t.contactMethod.id}/${t.type.toString()}/${t.contactMethod.title}`);
|
|
31
|
-
},
|
|
32
|
-
dispatch: e
|
|
33
|
-
}, t.contactMethod), {
|
|
34
|
-
body: n,
|
|
35
|
-
expanded: t.contactMethod.expanded
|
|
36
|
-
}));
|
|
37
|
-
}, v = (t) => /* @__PURE__ */ c.createElement(E, null, t.contactMethodList.map((e) => /* @__PURE__ */ c.createElement(k, {
|
|
38
|
-
key: e.id,
|
|
39
|
-
type: t.type,
|
|
40
|
-
contactMethod: e
|
|
41
|
-
}))), k = r(l)`
|
|
42
|
-
border-bottom: 1px solid rgb(239, 239, 239);
|
|
43
|
-
padding: ${(t) => {
|
|
44
|
-
var e;
|
|
45
|
-
return (e = t.theme.sizes) == null ? void 0 : e.medium;
|
|
46
|
-
}};
|
|
47
|
-
`, T = (t) => {
|
|
48
|
-
var n, a;
|
|
49
|
-
let e, o;
|
|
50
|
-
return t.contactMethods && ((n = t.contactMethods.contactMethods) == null ? void 0 : n.length) > 0 ? (e = i.ContactMethods, o = t.contactMethods.contactMethods) : t.contactMethods.categories && ((a = t.contactMethods.categories) == null ? void 0 : a.length) > 0 ? (e = i.ContactMethodCategories, o = t.contactMethods.categories.filter((d) => d.matches > 0)) : (e = i.ContactMethod, o = t.contactMethods), o.length ? /* @__PURE__ */ c.createElement(v, {
|
|
51
|
-
type: e,
|
|
52
|
-
contactMethodList: o
|
|
53
|
-
}) : /* @__PURE__ */ c.createElement(w, {
|
|
54
|
-
type: e,
|
|
55
|
-
contactMethod: o
|
|
56
|
-
});
|
|
57
|
-
}, w = r(l)`
|
|
58
|
-
padding: ${(t) => {
|
|
59
|
-
var e;
|
|
60
|
-
return (e = t.theme.sizes) == null ? void 0 : e.medium;
|
|
61
|
-
}};
|
|
62
|
-
`;
|
|
63
|
-
export {
|
|
64
|
-
T as default
|
|
65
|
-
};
|
|
66
|
-
//# sourceMappingURL=contact-method.15886c3d.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contact-method.15886c3d.js","sources":["../src/contract/custom-component/contact-method-item.tsx","../src/contract/custom-component/contact-method-list.tsx","../src/contract/custom-component/contact-method.tsx"],"sourcesContent":["import { ContactMethod as GenericContactMethod } from '@telia-ace/knowledge-widget-adapters';\r\nimport { useContainer, useDispatch } from '@telia-ace/knowledge-widget-ui';\r\nimport { Widget } from '@webprovisions/platform';\r\nimport React, { useEffect, useState } from 'react';\r\n\r\ninterface PropsType {\r\n contactMethod: any;\r\n type: any;\r\n className?: any;\r\n}\r\n\r\nconst ContactMethodItem: React.FC<PropsType> = (props: PropsType) => {\r\n const dispatch = useDispatch();\r\n const container = useContainer();\r\n\r\n const [body, setBody] = useState(props.contactMethod.body);\r\n\r\n useEffect(() => {\r\n if (!container || !container.get('$widget')) {\r\n return;\r\n }\r\n const { events } = container.get('$widget') as Widget;\r\n events.subscribe('form:validated', (_event, _data) => {\r\n // TODO: this is a due to props not being updated when props.contactMethod.body changes\r\n // perhaps there is a cleaner way of doing this\r\n setBody(props.contactMethod.body);\r\n });\r\n }, [container]);\r\n return (\r\n <GenericContactMethod\r\n className={props.className}\r\n onClick={() => {\r\n dispatch(\r\n 'action',\r\n `${props.contactMethod.id}/${props.type.toString()}/${\r\n props.contactMethod.title\r\n }`\r\n );\r\n // dispatch(\r\n // \"expand\",\r\n // `${props.contactMethod.id}/${props.type.toString()}`\r\n // );\r\n }}\r\n dispatch={dispatch}\r\n {...props.contactMethod}\r\n body={body}\r\n expanded={props.contactMethod.expanded}\r\n />\r\n );\r\n};\r\n\r\nexport default ContactMethodItem;\r\n","import React, { Fragment } from 'react';\r\nimport styled from 'styled-components';\r\nimport ContactMethodItem from './contact-method-item';\r\n\r\ninterface PropsType {\r\n contactMethodList: any;\r\n type: any;\r\n}\r\n\r\nconst ContactMethodList: React.FC<PropsType> = (props: PropsType) => {\r\n return (\r\n <Fragment>\r\n {props.contactMethodList.map((contactMethod: any) => (\r\n <StyledContactMethod\r\n key={contactMethod.id}\r\n type={props.type}\r\n contactMethod={contactMethod}\r\n />\r\n ))}\r\n </Fragment>\r\n );\r\n};\r\n\r\nconst StyledContactMethod = styled(ContactMethodItem)`\r\n border-bottom: 1px solid rgb(239, 239, 239);\r\n padding: ${(p) => p.theme.sizes?.medium};\r\n`;\r\n\r\nexport default ContactMethodList;\r\n","import { DataType } from '@telia-ace/knowledge-widget-types-grid';\r\nimport React from 'react';\r\nimport styled from 'styled-components';\r\nimport ContactMethodItem from './contact-method-item';\r\nimport ContactMethodList from './contact-method-list';\r\nconst ContactMethod: React.FC = (props: any) => {\r\n let type;\r\n let methodList;\r\n\r\n if (props.contactMethods && props.contactMethods.contactMethods?.length > 0) {\r\n type = DataType.ContactMethods;\r\n methodList = props.contactMethods.contactMethods;\r\n } else if (props.contactMethods.categories && props.contactMethods.categories?.length > 0) {\r\n type = DataType.ContactMethodCategories;\r\n methodList = props.contactMethods.categories.filter((o: any) => o.matches > 0);\r\n } else {\r\n type = DataType.ContactMethod;\r\n methodList = props.contactMethods;\r\n }\r\n\r\n // TODO: ContactMethodItem should not be passed a list as contact method?\r\n if (!methodList.length) {\r\n return <StyledContactMethodItem type={type} contactMethod={methodList} />;\r\n }\r\n\r\n return <ContactMethodList type={type} contactMethodList={methodList} />;\r\n};\r\n\r\nconst StyledContactMethodItem = styled(ContactMethodItem)`\r\n padding: ${(p) => p.theme.sizes?.medium};\r\n`;\r\n\r\nexport default ContactMethod;\r\n"],"names":["GenericContactMethod"],"mappings":";;;;;;;;;;;;;;;;;AAWA,MAAM,IAAyC,CAAC,MAAqB;AACjE,QAAM,IAAW,KACX,IAAY,KAEZ,CAAC,GAAM,KAAW,EAAS,EAAM,cAAc,IAAI;AAEzD,WAAU,MAAM;AACZ,QAAI,CAAC,KAAa,CAAC,EAAU,IAAI,SAAS;AACtC;AAEJ,UAAM,EAAE,cAAW,EAAU,IAAI,SAAS;AAC1C,MAAO,UAAU,kBAAkB,CAAC,GAAQ,MAAU;AAG1C,QAAA,EAAM,cAAc,IAAI;AAAA,IAAA,CACnC;AAAA,EAAA,GACF,CAAC,CAAS,CAAC,GAET,kBAAA,cAAAA,GAAA;AAAA,IACG,WAAW,EAAM;AAAA,IACjB,SAAS,MAAM;AAEP,QAAA,UACA,GAAG,EAAM,cAAc,MAAM,EAAM,KAAK,SAAS,KAC7C,EAAM,cAAc,OAE5B;AAAA,IAKJ;AAAA,IACA;AAAA,KACI,EAAM,gBAfb;AAAA,IAgBG;AAAA,IACA,UAAU,EAAM,cAAc;AAAA,EAAA,EAClC;AAER,GCxCM,IAAyC,CAAC,sCAEvC,GACI,MAAA,EAAM,kBAAkB,IAAI,CAAC,MACzB,kBAAA,cAAA,GAAA;AAAA,EACG,KAAK,EAAc;AAAA,EACnB,MAAM,EAAM;AAAA,EACZ;AACJ,CAAA,CACH,CACL,GAIF,IAAsB,EAAO,CAAiB;AAAA;AAAA,eAErC,CAAC,MAAM;;AAAA,gBAAE,MAAM,UAAR,kBAAe;AAAA;AAAA,GCpB/B,IAA0B,CAAC,MAAe;;AACxC,MAAA,GACA;AAcA,SAZJ,AAAI,EAAM,kBAAkB,QAAM,eAAe,mBAArB,kBAAqC,UAAS,IACtE,KAAO,EAAS,gBAChB,IAAa,EAAM,eAAe,kBACtC,AAAW,EAAM,eAAe,cAAc,QAAM,eAAe,eAArB,kBAAiC,UAAS,IACpF,KAAO,EAAS,yBACH,IAAA,EAAM,eAAe,WAAW,OAAO,CAAC,MAAW,EAAE,UAAU,CAAC,KAE7E,KAAO,EAAS,eAChB,IAAa,EAAM,iBAInB,AAAC,EAAW,SAIR,kBAAA,cAAA,GAAA;AAAA,IAAkB;AAAA,IAAY,mBAAmB;AAAA,EAAA,CAAY,IAHzD,kBAAA,cAAA,GAAA;AAAA,IAAwB;AAAA,IAAY,eAAe;AAAA,EAAA,CAAY;AAI/E,GAEM,IAA0B,EAAO,CAAiB;AAAA,eACzC,CAAC,MAAM;;AAAA,gBAAE,MAAM,UAAR,kBAAe;AAAA;AAAA;"}
|
|
@@ -1,9 +0,0 @@
|
|
|
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,10 +0,0 @@
|
|
|
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,13 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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,22 +0,0 @@
|
|
|
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): void;
|
|
11
|
-
private static insertMessageToStore;
|
|
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): 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
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Container } from '@webprovisions/platform';
|
|
2
|
-
import { Message } from '../contract/model/conversation-api-model/message.model';
|
|
3
|
-
import { ServerEntry } from '../contract/model/http/server-entry.model';
|
|
4
|
-
export default class EntryInterface {
|
|
5
|
-
private container;
|
|
6
|
-
private helpActionKey;
|
|
7
|
-
private nextActionKey;
|
|
8
|
-
constructor(container: Container);
|
|
9
|
-
transform(entry: ServerEntry): Promise<Message | undefined>;
|
|
10
|
-
transformContactMethod(entry: ServerEntry): Promise<any>;
|
|
11
|
-
transformArray(entryArray: ServerEntry[]): Promise<Message[]>;
|
|
12
|
-
getUserMessage(action: string): string | undefined;
|
|
13
|
-
private listTransform;
|
|
14
|
-
private getContentText;
|
|
15
|
-
private textTransform;
|
|
16
|
-
private getListActions;
|
|
17
|
-
private getListType;
|
|
18
|
-
private getTitleFromEntry;
|
|
19
|
-
private getTitleFromList;
|
|
20
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ServerEntry } from '../../contract/model/http/server-entry.model';
|
|
2
|
-
export default class ProcessorInterface {
|
|
3
|
-
process(entries: ServerEntry[]): ServerEntry[];
|
|
4
|
-
processUpdate(entry: ServerEntry | undefined, updateEntryArray: ServerEntry[]): ServerEntry[];
|
|
5
|
-
private handleActionUpdateOrInsert;
|
|
6
|
-
private deletePaging;
|
|
7
|
-
private delete;
|
|
8
|
-
private merge;
|
|
9
|
-
private moveLoader;
|
|
10
|
-
}
|