@telia-ace/knowledge-widget-core 0.0.1

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.
@@ -0,0 +1,88 @@
1
+ export type Symbol = {
2
+ type: 'Uri' | 'Svg' | 'FontAwesome' | 'Text' | string;
3
+ content: string;
4
+ };
5
+ export type Guide = {
6
+ id: string;
7
+ title: string;
8
+ tags: Tag[];
9
+ published?: string;
10
+ modified?: string;
11
+ publishedBy?: string;
12
+ modifiedBy?: string;
13
+ };
14
+ export type Category = {
15
+ id: string;
16
+ title: string;
17
+ symbol?: Symbol;
18
+ activeSymbol?: Symbol;
19
+ description?: string;
20
+ items?: Category[];
21
+ matches?: number;
22
+ };
23
+ export type Tag = {
24
+ id: string;
25
+ title: string;
26
+ symbol?: Symbol;
27
+ matches?: number;
28
+ defaultIcon?: Symbol;
29
+ activeIcon?: Symbol;
30
+ };
31
+ export declare enum DialogItemType {
32
+ guide = "guide",
33
+ link = "link",
34
+ default = "default"
35
+ }
36
+ export type DialogItem = {
37
+ id: string;
38
+ title: string;
39
+ parent: Guide;
40
+ type: DialogItemType;
41
+ connection?: string;
42
+ connectionKey?: string;
43
+ href?: string;
44
+ target?: string;
45
+ };
46
+ export type GuideCategoryBrowserList = {
47
+ id: string;
48
+ title: string;
49
+ symbol?: Symbol;
50
+ guides: Guide[];
51
+ paging: boolean;
52
+ pager?: string;
53
+ };
54
+ export type Notification = {
55
+ id: string;
56
+ title: string;
57
+ body: string;
58
+ modified?: string;
59
+ expandable?: boolean;
60
+ };
61
+ export type NotificationList = {
62
+ id: string;
63
+ title?: string;
64
+ symbol?: Symbol;
65
+ notifications: Notification[];
66
+ defaultHeaderOptions?: {
67
+ visible: boolean;
68
+ };
69
+ };
70
+ export type Tab = {
71
+ title: string;
72
+ name: string;
73
+ aliases: string[];
74
+ };
75
+ export type WidgetEntry = {
76
+ id: string;
77
+ type: string;
78
+ content: {
79
+ open: boolean;
80
+ };
81
+ origin: string;
82
+ };
83
+ export declare enum PickerTypes {
84
+ MODAL = "modal",
85
+ DRAWER = "drawer",
86
+ DROPDOWN = "dropdown",
87
+ NONE = "none"
88
+ }
package/index.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ export * from '../../../core/src/index.ts';
2
+ export { Environment as Humany } from '../../../core/src/index.ts';
3
+ export { supportBootstrapping } from '@webprovisions/bootstrapping';
4
+ export type { BootstrappingActivationData } from '@webprovisions/bootstrapping';
5
+ export { destroyWidget as destroy, Widget } from '@webprovisions/platform';
6
+ export * from './data-types';
7
+ export { default as loadImplementation } from './load-implementation';
8
+ export { default as verifyAuth } from './verify-auth';
package/index.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@telia-ace/widget-core"),d=require("@webprovisions/bootstrapping"),u=require("@webprovisions/platform");var i=(e=>(e.guide="guide",e.link="link",e.default="default",e))(i||{}),a=(e=>(e.MODAL="modal",e.DRAWER="drawer",e.DROPDOWN="dropdown",e.NONE="none",e))(a||{});const l=(e,r)=>fetch(r+"/config.json").then(t=>t.json()).then(t=>t.implementation).then(t=>e.createImplementation(t)),c=(e,r)=>{const t=`${e}${r}/interfaceauthorized`;return fetch(t,{method:"GET",credentials:"include"}).then(o=>o.status===200&&o.ok)};Object.defineProperty(exports,"Humany",{enumerable:!0,get:()=>n.Environment});Object.defineProperty(exports,"supportBootstrapping",{enumerable:!0,get:()=>d.supportBootstrapping});Object.defineProperty(exports,"Widget",{enumerable:!0,get:()=>u.Widget});Object.defineProperty(exports,"destroy",{enumerable:!0,get:()=>u.destroyWidget});exports.DialogItemType=i;exports.PickerTypes=a;exports.loadImplementation=l;exports.verifyAuth=c;Object.keys(n).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>n[e]})});
package/index.mjs ADDED
@@ -0,0 +1,24 @@
1
+ export * from "@telia-ace/widget-core";
2
+ import { Environment as l } from "@telia-ace/widget-core";
3
+ import { supportBootstrapping as s } from "@webprovisions/bootstrapping";
4
+ import { Widget as p, destroyWidget as x } from "@webprovisions/platform";
5
+ var r = /* @__PURE__ */ ((t) => (t.guide = "guide", t.link = "link", t.default = "default", t))(r || {}), a = /* @__PURE__ */ ((t) => (t.MODAL = "modal", t.DRAWER = "drawer", t.DROPDOWN = "dropdown", t.NONE = "none", t))(a || {});
6
+ const d = (t, e) => fetch(e + "/config.json").then((n) => n.json()).then((n) => n.implementation).then(
7
+ (n) => t.createImplementation(n)
8
+ ), u = (t, e) => {
9
+ const n = `${t}${e}/interfaceauthorized`;
10
+ return fetch(n, {
11
+ method: "GET",
12
+ credentials: "include"
13
+ }).then((o) => o.status === 200 && o.ok);
14
+ };
15
+ export {
16
+ r as DialogItemType,
17
+ l as Humany,
18
+ a as PickerTypes,
19
+ p as Widget,
20
+ x as destroy,
21
+ d as loadImplementation,
22
+ s as supportBootstrapping,
23
+ u as verifyAuth
24
+ };
@@ -0,0 +1,8 @@
1
+ import { Environment, Implementation } from '../../../core/src/index.ts';
2
+
3
+ /**
4
+ * Loads a Humany implementation by fetching the configuration from the specified URL.
5
+ * @param implementationPath Implementation URL.
6
+ */
7
+ declare const loadImplementation: (humany: Environment, url: string) => Promise<Implementation>;
8
+ export default loadImplementation;
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "@telia-ace/knowledge-widget-core",
3
+ "version": "0.0.1",
4
+ "dependencies": {
5
+ "@telia-ace/widget-core": "*",
6
+ "@webprovisions/bootstrapping": "^1.0.14",
7
+ "@webprovisions/platform": "^1.1.4"
8
+ },
9
+ "main": "./index.js",
10
+ "module": "./index.mjs",
11
+ "typings": "./index.d.ts"
12
+ }
@@ -0,0 +1,2 @@
1
+ declare const verifyAuth: (host: string, widgetName: string) => Promise<boolean>;
2
+ export default verifyAuth;