@telia-ace/knowledge-widget-types-grid 1.0.31-next.7 → 1.0.31-next.9
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 @@
|
|
|
1
|
+
{"version":3,"file":"index.d1c8bb33.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
package/dist/index.js
CHANGED
|
@@ -2,114 +2,114 @@ var Y = Object.defineProperty, z = Object.defineProperties;
|
|
|
2
2
|
var J = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var F = Object.getOwnPropertySymbols;
|
|
4
4
|
var X = Object.prototype.hasOwnProperty, Z = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var
|
|
6
|
-
for (var
|
|
7
|
-
X.call(
|
|
5
|
+
var E = (i, t, e) => t in i ? Y(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, _ = (i, t) => {
|
|
6
|
+
for (var e in t || (t = {}))
|
|
7
|
+
X.call(t, e) && E(i, e, t[e]);
|
|
8
8
|
if (F)
|
|
9
|
-
for (var
|
|
10
|
-
Z.call(
|
|
9
|
+
for (var e of F(t))
|
|
10
|
+
Z.call(t, e) && E(i, e, t[e]);
|
|
11
11
|
return i;
|
|
12
|
-
},
|
|
13
|
-
var A = (i,
|
|
14
|
-
var
|
|
15
|
-
var
|
|
12
|
+
}, Q = (i, t) => z(i, J(t));
|
|
13
|
+
var A = (i, t, e) => (E(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
14
|
+
var R = (i, t, e) => new Promise((n, s) => {
|
|
15
|
+
var r = (d) => {
|
|
16
16
|
try {
|
|
17
|
-
o(
|
|
18
|
-
} catch (
|
|
19
|
-
s(
|
|
17
|
+
o(e.next(d));
|
|
18
|
+
} catch (u) {
|
|
19
|
+
s(u);
|
|
20
20
|
}
|
|
21
21
|
}, c = (d) => {
|
|
22
22
|
try {
|
|
23
|
-
o(
|
|
24
|
-
} catch (
|
|
25
|
-
s(
|
|
23
|
+
o(e.throw(d));
|
|
24
|
+
} catch (u) {
|
|
25
|
+
s(u);
|
|
26
26
|
}
|
|
27
|
-
}, o = (d) => d.done ? n(d.value) : Promise.resolve(d.value).then(
|
|
28
|
-
o((
|
|
27
|
+
}, o = (d) => d.done ? n(d.value) : Promise.resolve(d.value).then(r, c);
|
|
28
|
+
o((e = e.apply(i, t)).next());
|
|
29
29
|
});
|
|
30
|
-
import { Widget as
|
|
31
|
-
import { Component as
|
|
32
|
-
import { DialogItemType as G, WidgetRenderState as
|
|
33
|
-
import { removeNullAndUndefinedValues as
|
|
34
|
-
import { FormBuilder as
|
|
30
|
+
import { Widget as ee } from "@telia-ace/widget-types-grid";
|
|
31
|
+
import { Component as ve, DetachedComponent as Ne, NotFound as Me, genericComponentStyling as we } from "@telia-ace/widget-types-grid";
|
|
32
|
+
import { DialogItemType as G, WidgetRenderState as D } from "@telia-ace/knowledge-widget-core";
|
|
33
|
+
import { removeNullAndUndefinedValues as te, shallowCompare as q, deepClone as ie } from "@telia-ace/widget-utilities";
|
|
34
|
+
import { FormBuilder as j } from "@telia-ace/widget-forms";
|
|
35
35
|
const N = (i) => {
|
|
36
36
|
if (i) {
|
|
37
|
-
const { Type:
|
|
38
|
-
if (
|
|
39
|
-
return { type:
|
|
37
|
+
const { Type: t, Content: e } = i;
|
|
38
|
+
if (t && e)
|
|
39
|
+
return { type: t, content: e };
|
|
40
40
|
}
|
|
41
|
-
}, T = (i) => i.map((
|
|
42
|
-
const
|
|
43
|
-
id:
|
|
44
|
-
title:
|
|
45
|
-
symbol: N(
|
|
46
|
-
activeSymbol:
|
|
47
|
-
description:
|
|
48
|
-
matches:
|
|
41
|
+
}, T = (i) => i.map((t) => {
|
|
42
|
+
const e = {
|
|
43
|
+
id: t.Id.toString(),
|
|
44
|
+
title: t.Name,
|
|
45
|
+
symbol: N(t.DefaultIcon),
|
|
46
|
+
activeSymbol: t.ActiveIcon && N(t.ActiveIcon),
|
|
47
|
+
description: t.Description || t.Attributes && t.Attributes.description || "",
|
|
48
|
+
matches: t.GuidesCount
|
|
49
49
|
};
|
|
50
|
-
return
|
|
51
|
-
}), y = (i,
|
|
52
|
-
id:
|
|
50
|
+
return t.Children && t.Children.length && (e.items = T(t.Children)), e;
|
|
51
|
+
}), y = (i, t) => i.filter(({ Type: e }) => e === t).map(({ Id: e, Title: n, Body: s }) => ({
|
|
52
|
+
id: e.toString(),
|
|
53
53
|
title: n,
|
|
54
54
|
body: s
|
|
55
|
-
})), L = (i) => i.map(({ Id:
|
|
56
|
-
id:
|
|
57
|
-
title:
|
|
55
|
+
})), L = (i) => i.map(({ Id: t, Title: e, DefaultIcon: n, ListNotices: s, Notices: r }) => ({
|
|
56
|
+
id: t.toString(),
|
|
57
|
+
title: e,
|
|
58
58
|
symbol: N(n),
|
|
59
59
|
defaultHeaderOptions: {
|
|
60
60
|
visible: !!s.length
|
|
61
61
|
},
|
|
62
|
-
notifications: (s || []).concat(
|
|
62
|
+
notifications: (s || []).concat(r || []).map(({ Id: c, Title: o, Body: d, Type: u, Modified: l }) => ({
|
|
63
63
|
id: c.toString(),
|
|
64
64
|
title: o,
|
|
65
65
|
body: d,
|
|
66
|
-
modified:
|
|
67
|
-
expandable:
|
|
66
|
+
modified: l,
|
|
67
|
+
expandable: u === "listNotice"
|
|
68
68
|
}))
|
|
69
69
|
})), O = ({
|
|
70
70
|
Id: i,
|
|
71
|
-
Title:
|
|
72
|
-
DefaultIcon:
|
|
71
|
+
Title: t,
|
|
72
|
+
DefaultIcon: e,
|
|
73
73
|
Exits: [n],
|
|
74
74
|
ExitType: s,
|
|
75
|
-
ConfirmationText:
|
|
75
|
+
ConfirmationText: r,
|
|
76
76
|
ExpandFormAutomatically: c,
|
|
77
77
|
Form: o,
|
|
78
78
|
Description: d
|
|
79
|
-
},
|
|
80
|
-
const { Adapter:
|
|
79
|
+
}, u) => {
|
|
80
|
+
const { Adapter: l } = n || { Adapter: {} }, { ClientName: g = "", Settings: f = {}, CustomClientName: w = "" } = l, h = {
|
|
81
81
|
id: i.toString(),
|
|
82
|
-
title:
|
|
82
|
+
title: t,
|
|
83
83
|
description: d,
|
|
84
|
-
symbol: N(
|
|
85
|
-
clientName: g === "custom.adapter" ?
|
|
84
|
+
symbol: N(e),
|
|
85
|
+
clientName: g === "custom.adapter" ? w : g,
|
|
86
86
|
expanded: !0,
|
|
87
87
|
inline: !0,
|
|
88
88
|
body: {}
|
|
89
89
|
};
|
|
90
90
|
if (g.indexOf("phone") > -1 || g.indexOf("freetext") > -1) {
|
|
91
|
-
const { displayTextBeforeClick:
|
|
92
|
-
|
|
91
|
+
const { displayTextBeforeClick: p, textBeforeClick: a } = f;
|
|
92
|
+
p === "true" && (h.expanded = !1, h.title = a), g.indexOf("phone.text") > -1 ? h.body.phoneNumber = f.phoneNumber : h.body.freetext = f.freetext;
|
|
93
93
|
}
|
|
94
|
-
return (g.indexOf("chat.popup") > -1 || g.indexOf("link") > -1 || g === "custom.adapter" && s === "custom") && (
|
|
95
|
-
}, x = (i = []) => i.map(({ Id:
|
|
96
|
-
id:
|
|
97
|
-
title:
|
|
94
|
+
return (g.indexOf("chat.popup") > -1 || g.indexOf("link") > -1 || g === "custom.adapter" && s === "custom") && (h.body = f, h.body.confirmationFallback = r), g.indexOf("ace") > -1 && (h.body = f), o && o.HasValueComponents && (u ? h.body.form = j.fromLegacyForm(i.toString(), o, u).get() : h.body.form = j.fromLegacyForm(i.toString(), o).get(), c || (h.expanded = h.inline = !1)), h;
|
|
95
|
+
}, x = (i = []) => i.map(({ Id: t, Title: e, TotalMatches: n, Symbol: s, DefaultIcon: r, ActiveIcon: c }) => ({
|
|
96
|
+
id: t.toString(),
|
|
97
|
+
title: e,
|
|
98
98
|
matches: n,
|
|
99
|
-
symbol: N(
|
|
100
|
-
defaultIcon: N(
|
|
99
|
+
symbol: N(r || s),
|
|
100
|
+
defaultIcon: N(r),
|
|
101
101
|
activeIcon: N(c)
|
|
102
|
-
})),
|
|
103
|
-
id:
|
|
104
|
-
title:
|
|
102
|
+
})), B = (i) => i.map(({ Id: t, Title: e, Tags: n, FirstPublishedDate: s, Modified: r }) => ({
|
|
103
|
+
id: t.toString(),
|
|
104
|
+
title: e,
|
|
105
105
|
tags: x(n),
|
|
106
106
|
published: s,
|
|
107
|
-
modified:
|
|
108
|
-
})),
|
|
107
|
+
modified: r
|
|
108
|
+
})), se = (i, t) => {
|
|
109
109
|
switch (i) {
|
|
110
|
-
case
|
|
111
|
-
case
|
|
112
|
-
const
|
|
110
|
+
case b.MatchByCategory:
|
|
111
|
+
case b.Match: {
|
|
112
|
+
const e = {
|
|
113
113
|
guides: [],
|
|
114
114
|
matches: 0,
|
|
115
115
|
topNotifications: [],
|
|
@@ -121,87 +121,87 @@ const N = (i) => {
|
|
|
121
121
|
}, {
|
|
122
122
|
Matches: n,
|
|
123
123
|
TotalMatches: s,
|
|
124
|
-
Notices:
|
|
124
|
+
Notices: r,
|
|
125
125
|
NoticeLists: c,
|
|
126
126
|
Tags: o,
|
|
127
127
|
ByCategory: d
|
|
128
|
-
} =
|
|
129
|
-
return
|
|
130
|
-
id:
|
|
131
|
-
guides:
|
|
128
|
+
} = t;
|
|
129
|
+
return e.guides = B(n), e.matches = s, e.byCategory = (d || []).map(({ Id: u, Matches: l, TotalMatches: g }) => ({
|
|
130
|
+
id: u,
|
|
131
|
+
guides: B(l),
|
|
132
132
|
matches: g
|
|
133
|
-
})),
|
|
133
|
+
})), e.tags = x(o), e.notificationLists = L(c || []), e.topNotifications = y(r || [], "noticeRowTop"), e.middleNotifications = y(r || [], "noticeRowMiddle"), e.bottomNotifications = y(r || [], "footerNotice"), e;
|
|
134
134
|
}
|
|
135
|
-
case
|
|
136
|
-
const { Children:
|
|
135
|
+
case b.Categories: {
|
|
136
|
+
const { Children: e, GuidesCountTotal: n } = t;
|
|
137
137
|
return {
|
|
138
|
-
categories: T(
|
|
138
|
+
categories: T(e || []),
|
|
139
139
|
matches: n
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
|
-
case
|
|
142
|
+
case b.Guide: {
|
|
143
143
|
const {
|
|
144
|
-
Id:
|
|
144
|
+
Id: e,
|
|
145
145
|
Title: n,
|
|
146
146
|
Body: s,
|
|
147
|
-
Related:
|
|
147
|
+
Related: r,
|
|
148
148
|
Options: c,
|
|
149
149
|
ConnectionId: o,
|
|
150
150
|
ContactMethods: d,
|
|
151
|
-
EnableFeedback:
|
|
152
|
-
HandoverExists:
|
|
151
|
+
EnableFeedback: u,
|
|
152
|
+
HandoverExists: l,
|
|
153
153
|
FirstPublishedDate: g,
|
|
154
|
-
Modified:
|
|
155
|
-
ModifiedByDisplayName:
|
|
156
|
-
FirstPublishedByDisplayName:
|
|
157
|
-
Categories:
|
|
158
|
-
Tags:
|
|
159
|
-
SeoMetaDescription:
|
|
160
|
-
SeoAllowIndex:
|
|
161
|
-
Perspectives:
|
|
154
|
+
Modified: f,
|
|
155
|
+
ModifiedByDisplayName: w,
|
|
156
|
+
FirstPublishedByDisplayName: h,
|
|
157
|
+
Categories: p,
|
|
158
|
+
Tags: a,
|
|
159
|
+
SeoMetaDescription: m,
|
|
160
|
+
SeoAllowIndex: k,
|
|
161
|
+
Perspectives: I,
|
|
162
162
|
PerspectiveKey: U,
|
|
163
163
|
Translations: P
|
|
164
|
-
} =
|
|
164
|
+
} = t, $ = U || Object.values(I).find((v) => v === o) || I.Default || null, H = {
|
|
165
165
|
guide: {
|
|
166
|
-
id:
|
|
166
|
+
id: e.toString(),
|
|
167
167
|
title: n,
|
|
168
168
|
body: s,
|
|
169
|
-
modified:
|
|
169
|
+
modified: f,
|
|
170
170
|
published: g,
|
|
171
|
-
modifiedBy:
|
|
172
|
-
publishedBy:
|
|
171
|
+
modifiedBy: w,
|
|
172
|
+
publishedBy: h,
|
|
173
173
|
connection: o,
|
|
174
|
-
categories:
|
|
175
|
-
hasHandover:
|
|
176
|
-
allowFeedback:
|
|
177
|
-
seoMetaDescription:
|
|
178
|
-
seoAllowIndex:
|
|
179
|
-
perspectives:
|
|
180
|
-
perspective:
|
|
181
|
-
translations: Object.keys(P || {}).reduce((v,
|
|
174
|
+
categories: p,
|
|
175
|
+
hasHandover: l,
|
|
176
|
+
allowFeedback: u,
|
|
177
|
+
seoMetaDescription: m,
|
|
178
|
+
seoAllowIndex: k,
|
|
179
|
+
perspectives: I,
|
|
180
|
+
perspective: $,
|
|
181
|
+
translations: Object.keys(P || {}).reduce((v, S) => (v[S] = P[S].toString(), v), {})
|
|
182
182
|
},
|
|
183
|
-
related:
|
|
183
|
+
related: B(r || []),
|
|
184
184
|
dialog: [],
|
|
185
185
|
contactMethods: (d || []).map((v) => O(v)),
|
|
186
|
-
tags: x(
|
|
186
|
+
tags: x(a)
|
|
187
187
|
};
|
|
188
|
-
return (c || []).forEach(({ CanAccess: v, Description:
|
|
188
|
+
return (c || []).forEach(({ CanAccess: v, Description: S, ConnectionId: V, Properties: C }) => {
|
|
189
189
|
if (!v)
|
|
190
190
|
return;
|
|
191
191
|
const M = {
|
|
192
|
-
id:
|
|
193
|
-
title:
|
|
194
|
-
connection:
|
|
195
|
-
connectionKey:
|
|
192
|
+
id: e.toString(),
|
|
193
|
+
title: S,
|
|
194
|
+
connection: V,
|
|
195
|
+
connectionKey: C.ConnectionKey,
|
|
196
196
|
type: G.default,
|
|
197
197
|
parent: {
|
|
198
|
-
id:
|
|
198
|
+
id: e.toString(),
|
|
199
199
|
title: n,
|
|
200
|
-
tags: x(
|
|
200
|
+
tags: x(a)
|
|
201
201
|
}
|
|
202
202
|
};
|
|
203
|
-
if (
|
|
204
|
-
switch (
|
|
203
|
+
if (C.Type === "Guide" || C.Type === "Link")
|
|
204
|
+
switch (C.Id && (M.id = C.Id.toString()), C.Uri && (M.href = C.Uri), C.Target && (M.target = C.Target), C.Type) {
|
|
205
205
|
case "Guide":
|
|
206
206
|
M.type = G.guide;
|
|
207
207
|
break;
|
|
@@ -212,30 +212,30 @@ const N = (i) => {
|
|
|
212
212
|
H.dialog.push(M);
|
|
213
213
|
}), H;
|
|
214
214
|
}
|
|
215
|
-
case
|
|
216
|
-
const { Children:
|
|
215
|
+
case b.Contacts: {
|
|
216
|
+
const { Children: e, Matches: n, Notices: s, NoticeLists: r } = t;
|
|
217
217
|
return {
|
|
218
218
|
contactMethods: (n || []).map((o) => O(o)),
|
|
219
|
-
categories: T(
|
|
219
|
+
categories: T(e || []),
|
|
220
220
|
topNotifications: y(s || [], "noticeRowTop"),
|
|
221
221
|
middleNotifications: y(s || [], "noticeRowMiddle"),
|
|
222
222
|
bottomNotifications: y(s || [], "footerNotice"),
|
|
223
|
-
notificationLists: L(
|
|
223
|
+
notificationLists: L(r || [])
|
|
224
224
|
};
|
|
225
225
|
}
|
|
226
|
-
case
|
|
227
|
-
const { ContactMethod:
|
|
228
|
-
return O(
|
|
226
|
+
case b.ContactMethod: {
|
|
227
|
+
const { ContactMethod: e } = t;
|
|
228
|
+
return O(e || {});
|
|
229
229
|
}
|
|
230
|
-
case
|
|
231
|
-
case
|
|
232
|
-
return x(
|
|
233
|
-
case
|
|
234
|
-
const { Notices:
|
|
230
|
+
case b.Tags:
|
|
231
|
+
case b.TagsOnGuides:
|
|
232
|
+
return x(t || []);
|
|
233
|
+
case b.Notifications: {
|
|
234
|
+
const { Notices: e, NoticeLists: n } = t;
|
|
235
235
|
return {
|
|
236
|
-
topNotifications: y(
|
|
237
|
-
middleNotifications: y(
|
|
238
|
-
bottomNotifications: y(
|
|
236
|
+
topNotifications: y(e || [], "noticeRowTop"),
|
|
237
|
+
middleNotifications: y(e || [], "noticeRowMiddle"),
|
|
238
|
+
bottomNotifications: y(e || [], "footerNotice"),
|
|
239
239
|
notificationLists: L(n || [])
|
|
240
240
|
};
|
|
241
241
|
}
|
|
@@ -243,8 +243,8 @@ const N = (i) => {
|
|
|
243
243
|
return {};
|
|
244
244
|
}
|
|
245
245
|
};
|
|
246
|
-
var
|
|
247
|
-
const
|
|
246
|
+
var ne = /* @__PURE__ */ ((i) => (i.Guide = "guide", i.Guides = "guides", i.GuidesByCategory = "guides-by-category", i.RowNotifications = "row-notices", i.NotificationLists = "notification-lists", i.GuideCategories = "guide-categories", i.ContactMethodCategories = "contact-method-categories", i.ContactMethod = "contact-method", i.ContactMethods = "contact-methods", i.Tags = "tags", i.TagsOnGuides = "tagsonguides", i))(ne || {}), b = /* @__PURE__ */ ((i) => (i.Match = "match", i.Categories = "categories", i.Guide = "guide", i.Contacts = "contacts", i.ContactMethod = "contact-method", i.MatchByCategory = "match-by-category", i.Tags = "tags", i.TagsOnGuides = "tagsonguides", i.Notifications = "notifications", i))(b || {}), oe = /* @__PURE__ */ ((i) => (i.Positive = "Positive", i.Negative = "Negative", i))(oe || {}), re = /* @__PURE__ */ ((i) => (i.POPULARITY_DESCENDING = "popularity-descending", i.ALPHABETIC_ASCENDING = "alphabetic-ascending", i.ALPHABETIC_DESCENDING = "alphabetic-descending", i.MODIFIED_ASCENDING = "modified-ascending", i.MODIFIED_DESCENDING = "modified-descending", i.PUBLISHED_ASCENDING = "published-ascending", i.PUBLISHED_DESCENDING = "published-descending", i))(re || {});
|
|
247
|
+
const K = (i) => {
|
|
248
248
|
switch (i) {
|
|
249
249
|
case "guides":
|
|
250
250
|
return "match";
|
|
@@ -269,173 +269,173 @@ const W = (i) => {
|
|
|
269
269
|
default:
|
|
270
270
|
throw "error";
|
|
271
271
|
}
|
|
272
|
-
},
|
|
273
|
-
const { invoke:
|
|
274
|
-
return (yield
|
|
272
|
+
}, ae = (i) => R(void 0, null, function* () {
|
|
273
|
+
const { invoke: t } = i.get("$widget");
|
|
274
|
+
return (yield t("renderState")) === D.hidden;
|
|
275
275
|
});
|
|
276
|
-
class
|
|
277
|
-
constructor(
|
|
276
|
+
class W {
|
|
277
|
+
constructor(t, e) {
|
|
278
278
|
A(this, "queries", /* @__PURE__ */ new Map());
|
|
279
279
|
A(this, "lastTake", 0);
|
|
280
280
|
A(this, "events");
|
|
281
281
|
A(this, "getUnresolvedQueries", () => {
|
|
282
|
-
let
|
|
283
|
-
return this.queries.forEach((
|
|
284
|
-
|
|
285
|
-
}),
|
|
282
|
+
let t = 0;
|
|
283
|
+
return this.queries.forEach((e, n) => {
|
|
284
|
+
e.some((r) => !r.resolved) && (t = 1);
|
|
285
|
+
}), t;
|
|
286
286
|
});
|
|
287
|
-
this.container =
|
|
288
|
-
|
|
287
|
+
this.container = t, this.matchingClient = e, this.events = t.get("$widget").events, this.events.subscribe("widget:settings-updated", () => this.queries = /* @__PURE__ */ new Map()), this.events.subscribe("widget:render-state-changed", (n, { next: s, previous: r }) => {
|
|
288
|
+
r === D.hidden && s === D.open && this.fetchAllUnresolvedQueries();
|
|
289
289
|
});
|
|
290
290
|
}
|
|
291
|
-
static getInstance(
|
|
292
|
-
return
|
|
291
|
+
static getInstance(t) {
|
|
292
|
+
return t.getAsync("dataClient");
|
|
293
293
|
}
|
|
294
|
-
fetch(
|
|
294
|
+
fetch(t, e) {
|
|
295
295
|
return new Promise((n, s) => {
|
|
296
|
-
|
|
297
|
-
const
|
|
296
|
+
e.take && (this.lastTake = +(e.take || 0)), te(e);
|
|
297
|
+
const r = K(t), c = this.queries.get(r) || [], o = c.find((d) => q(d.params, e));
|
|
298
298
|
if (o) {
|
|
299
299
|
const d = c.indexOf(o);
|
|
300
300
|
if (o.resolved ? (this.events.dispatch("data-client:fetched", {
|
|
301
|
-
params:
|
|
302
|
-
type:
|
|
301
|
+
params: e,
|
|
302
|
+
type: r,
|
|
303
303
|
response: o.data,
|
|
304
304
|
unresolvedQueries: this.getUnresolvedQueries()
|
|
305
|
-
}), this.track(o.data,
|
|
306
|
-
return this.runQuery(
|
|
305
|
+
}), this.track(o.data, r, o.error), o.data && o.error ? s({ error: o.error }) : n(o.data)) : o.resolvers.push({ resolve: n, reject: s }), c.splice(d, 1), c.push(o), this.queries.set(r, c), !o.loading && !o.resolved)
|
|
306
|
+
return this.runQuery(r, e);
|
|
307
307
|
} else
|
|
308
308
|
return c.push({
|
|
309
|
-
params:
|
|
309
|
+
params: e,
|
|
310
310
|
resolved: !1,
|
|
311
311
|
loading: !0,
|
|
312
312
|
data: {},
|
|
313
313
|
resolvers: [{ resolve: n, reject: s }]
|
|
314
|
-
}), this.queries.set(
|
|
315
|
-
}).then((n) =>
|
|
314
|
+
}), this.queries.set(r, c), this.runQuery(r, e);
|
|
315
|
+
}).then((n) => ie(n));
|
|
316
316
|
}
|
|
317
|
-
read(
|
|
318
|
-
const { select: n } =
|
|
317
|
+
read(t, e) {
|
|
318
|
+
const { select: n } = e, s = K(t);
|
|
319
319
|
return (this.queries.get(s) || []).reduce((o, d) => {
|
|
320
320
|
if (typeof n == "function") {
|
|
321
|
-
const
|
|
322
|
-
|
|
321
|
+
const u = n(d.data);
|
|
322
|
+
u && o.push(u);
|
|
323
323
|
} else
|
|
324
324
|
o.push(d.data);
|
|
325
325
|
return o;
|
|
326
326
|
}, []);
|
|
327
327
|
}
|
|
328
|
-
feedback(
|
|
329
|
-
return this.matchingClient.giveFeedback(
|
|
328
|
+
feedback(t, e, n) {
|
|
329
|
+
return this.matchingClient.giveFeedback(t, e, n);
|
|
330
330
|
}
|
|
331
|
-
setLoadingStatus(
|
|
332
|
-
const s = this.queries.get(
|
|
333
|
-
|
|
331
|
+
setLoadingStatus(t, e, n) {
|
|
332
|
+
const s = this.queries.get(t) || [], r = s.find((c) => q(c.params, e));
|
|
333
|
+
r && (r.loading = n), this.queries.set(t, s);
|
|
334
334
|
}
|
|
335
|
-
runQuery(
|
|
336
|
-
return
|
|
335
|
+
runQuery(t, e) {
|
|
336
|
+
return R(this, null, function* () {
|
|
337
337
|
const {
|
|
338
338
|
searchPhrase: n = "",
|
|
339
339
|
categories: s = "0",
|
|
340
|
-
contactMethodCategoryId:
|
|
340
|
+
contactMethodCategoryId: r = "0",
|
|
341
341
|
contactMethodId: c = "0",
|
|
342
342
|
tagId: o = void 0,
|
|
343
343
|
take: d = 5,
|
|
344
|
-
connection:
|
|
345
|
-
guideId:
|
|
344
|
+
connection: u = "",
|
|
345
|
+
guideId: l,
|
|
346
346
|
expandCategories: g = "descendants",
|
|
347
|
-
currentCategory:
|
|
348
|
-
sorting:
|
|
349
|
-
guideIds:
|
|
350
|
-
} =
|
|
351
|
-
if (yield
|
|
347
|
+
currentCategory: f,
|
|
348
|
+
sorting: w = "popularity-descending",
|
|
349
|
+
guideIds: h = []
|
|
350
|
+
} = e, p = n.toString().trim();
|
|
351
|
+
if (yield ae(this.container))
|
|
352
352
|
return Promise.resolve();
|
|
353
|
-
switch (
|
|
353
|
+
switch (t) {
|
|
354
354
|
case "match": {
|
|
355
|
-
const
|
|
356
|
-
const [
|
|
355
|
+
const a = (m) => {
|
|
356
|
+
const [k, I] = m.split("-");
|
|
357
357
|
return {
|
|
358
358
|
type: (/* @__PURE__ */ new Map([
|
|
359
359
|
["popularity", "popularity"],
|
|
360
360
|
["alphabetic", "title"],
|
|
361
361
|
["modified", "lastModified"],
|
|
362
362
|
["published", "firstPublished"]
|
|
363
|
-
])).get(
|
|
364
|
-
direction:
|
|
363
|
+
])).get(k),
|
|
364
|
+
direction: I
|
|
365
365
|
};
|
|
366
366
|
};
|
|
367
|
-
return
|
|
368
|
-
configuration: { ids:
|
|
369
|
-
}).then((
|
|
367
|
+
return h.length ? this.matchingClient.customRequest("guides", "POST", {
|
|
368
|
+
configuration: { ids: h, take: +d }
|
|
369
|
+
}).then((m) => m && this.handleResponse(m, t, e)) : this.matchingClient.match(p, {
|
|
370
370
|
categories: s === "0" ? [] : Array.isArray(s) ? s : [+s],
|
|
371
371
|
take: +d,
|
|
372
372
|
tags: o,
|
|
373
|
-
sorting:
|
|
374
|
-
ids:
|
|
375
|
-
}).then((
|
|
373
|
+
sorting: a(w),
|
|
374
|
+
ids: h
|
|
375
|
+
}).then((m) => m && this.handleResponse(m, t, e));
|
|
376
376
|
}
|
|
377
377
|
case "match-by-category":
|
|
378
|
-
return this.matchingClient.match(
|
|
378
|
+
return this.matchingClient.match(p, {
|
|
379
379
|
groupByCategory: !0,
|
|
380
380
|
categories: s === "0" ? [] : Array.isArray(s) ? s : [+s],
|
|
381
381
|
take: +d,
|
|
382
382
|
tags: o
|
|
383
|
-
}).then((
|
|
383
|
+
}).then((a) => a && this.handleResponse(a, t, e));
|
|
384
384
|
case "guide":
|
|
385
|
-
return this.matchingClient.getGuide(
|
|
386
|
-
|
|
387
|
-
}).catch((
|
|
388
|
-
const
|
|
385
|
+
return this.matchingClient.getGuide(l, { connectionId: u }).then((a) => {
|
|
386
|
+
a && this.handleResponse(a, t, e);
|
|
387
|
+
}).catch((a) => {
|
|
388
|
+
const m = {
|
|
389
389
|
message: "Something went wrong.",
|
|
390
|
-
status:
|
|
390
|
+
status: a.status || 400
|
|
391
391
|
};
|
|
392
|
-
|
|
392
|
+
m.status === 404 && (m.message = "The guide could not be found."), this.handleResponse({}, t, e, m);
|
|
393
393
|
});
|
|
394
394
|
case "categories":
|
|
395
|
-
return this.matchingClient.getCategories({ phrase:
|
|
396
|
-
(
|
|
395
|
+
return this.matchingClient.getCategories({ phrase: p, expand: g, tags: o }).then(
|
|
396
|
+
(a) => a && this.handleResponse(a, t, e)
|
|
397
397
|
);
|
|
398
398
|
case "contacts":
|
|
399
|
-
return
|
|
399
|
+
return l ? this.matchingClient.contactMethods(+l, { phrase: p }).then((a) => a && this.handleResponse(a, t, e)) : this.matchingClient.contacts(+r, { phrase: p }).then((a) => a && this.handleResponse(a, t, e));
|
|
400
400
|
case "contact-method":
|
|
401
|
-
return this.matchingClient.getContactMethod(+c, { guideId:
|
|
401
|
+
return this.matchingClient.getContactMethod(+c, { guideId: l, currentCategory: f }).then((a) => a && this.handleResponse(a, t, e));
|
|
402
402
|
case "tags":
|
|
403
403
|
return this.matchingClient.customRequest("tags", "GET", {
|
|
404
404
|
configuration: {
|
|
405
405
|
take: 999999,
|
|
406
|
-
phrase:
|
|
406
|
+
phrase: p,
|
|
407
407
|
categories: s === "0" ? [] : Array.isArray(s) ? s : [+s]
|
|
408
408
|
}
|
|
409
|
-
}).then((
|
|
409
|
+
}).then((a) => a && this.handleResponse(a, t, e));
|
|
410
410
|
case "tagsonguides":
|
|
411
411
|
return this.matchingClient.customRequest("tagsonguides", "GET", {
|
|
412
412
|
configuration: {
|
|
413
413
|
take: 999999,
|
|
414
|
-
phrase:
|
|
414
|
+
phrase: p,
|
|
415
415
|
categories: s === "0" ? [] : Array.isArray(s) ? s : [+s],
|
|
416
416
|
tags: o
|
|
417
417
|
}
|
|
418
|
-
}).then((
|
|
418
|
+
}).then((a) => a && this.handleResponse(a, t, e));
|
|
419
419
|
case "notifications":
|
|
420
420
|
return this.matchingClient.customRequest("notices", "GET", {
|
|
421
421
|
configuration: {
|
|
422
|
-
phrase:
|
|
422
|
+
phrase: p,
|
|
423
423
|
categories: s === "0" ? [] : Array.isArray(s) ? s : [+s]
|
|
424
424
|
}
|
|
425
|
-
}).then((
|
|
425
|
+
}).then((a) => a && this.handleResponse(a, t, e));
|
|
426
426
|
}
|
|
427
427
|
});
|
|
428
428
|
}
|
|
429
|
-
handleResponse(
|
|
430
|
-
const
|
|
429
|
+
handleResponse(t = {}, e, n, s) {
|
|
430
|
+
const r = this.queries.get(e) || [], c = r.find((o) => q(o.params, n));
|
|
431
431
|
if (c) {
|
|
432
|
-
const o = s ||
|
|
433
|
-
this.track(o,
|
|
434
|
-
s ?
|
|
432
|
+
const o = s || se(e, t);
|
|
433
|
+
this.track(o, e, s), c.resolvers.forEach((u) => {
|
|
434
|
+
s ? u.reject({ error: o }) : u.resolve(o);
|
|
435
435
|
});
|
|
436
|
-
const d =
|
|
437
|
-
d > -1 &&
|
|
438
|
-
type:
|
|
436
|
+
const d = r.indexOf(c);
|
|
437
|
+
d > -1 && r.splice(d, 1), r.push(Q(_({}, c), { error: s, resolvers: [], data: o, resolved: !0 })), this.setLoadingStatus(e, n, !1), this.queries.set(e, r), s || this.events.dispatch("data-client:fetched", {
|
|
438
|
+
type: e,
|
|
439
439
|
params: n,
|
|
440
440
|
response: o,
|
|
441
441
|
unresolvedQueries: this.getUnresolvedQueries()
|
|
@@ -443,46 +443,68 @@ class $ {
|
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
445
|
fetchAllUnresolvedQueries() {
|
|
446
|
-
for (const [
|
|
447
|
-
|
|
448
|
-
this.runQuery(
|
|
446
|
+
for (const [t, e] of this.queries)
|
|
447
|
+
e.filter((n) => !n.resolved).forEach((n) => {
|
|
448
|
+
this.runQuery(t, n.params);
|
|
449
449
|
});
|
|
450
450
|
}
|
|
451
|
-
track(
|
|
451
|
+
track(t = {}, e, n) {
|
|
452
452
|
const s = this.container.get("$widget");
|
|
453
453
|
s && !n ? s.events.dispatch("tracking:service-client-response", {
|
|
454
|
-
type:
|
|
455
|
-
data:
|
|
454
|
+
type: e,
|
|
455
|
+
data: t
|
|
456
456
|
}) : s && s.events.dispatch("tracking:service-client-error", {
|
|
457
|
-
type:
|
|
457
|
+
type: e,
|
|
458
458
|
error: n
|
|
459
459
|
});
|
|
460
460
|
}
|
|
461
|
-
static create(
|
|
462
|
-
return
|
|
461
|
+
static create(t) {
|
|
462
|
+
return t.getAsync("matchingClient").then((e) => new W(t, e));
|
|
463
463
|
}
|
|
464
464
|
}
|
|
465
|
-
const
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
465
|
+
const ce = (i) => import("@telia-ace/knowledge-widget-adapters").then(({ ContactMethodPlatform: t }) => t.create(i)), de = (i) => import("./index.d1c8bb33.js").then(({ DataClient: t }) => t.create(i)), ue = (i) => import("@telia-ace/knowledge-serviceclient").then(({ ServiceClient: t, ServiceProxy: e }) => i.get("settings").then((n) => {
|
|
466
|
+
const { name: s, events: r } = i.get("$widget"), {
|
|
467
|
+
data: { projection: c = "", site: o = "current", forceHttps: d = !1 }
|
|
468
|
+
} = n, u = new e(c, { credentials: "same-origin" }), l = new t(
|
|
469
|
+
u,
|
|
470
|
+
{
|
|
471
|
+
funnel: s.replace("_contact-method", "").replace("_contact", ""),
|
|
472
|
+
site: he(o, d)
|
|
473
|
+
},
|
|
474
|
+
null,
|
|
475
|
+
i
|
|
476
|
+
);
|
|
477
|
+
return r.subscribe("widget:settings-updated", (g, { data: f }) => {
|
|
478
|
+
f && f.projection !== c && l.proxy.setBaseUrl(f.projection);
|
|
479
|
+
}), l;
|
|
480
|
+
})), he = (i, t) => () => {
|
|
481
|
+
const e = (s) => {
|
|
482
|
+
const r = document.createElement("a");
|
|
483
|
+
return r.href = s, r;
|
|
484
|
+
};
|
|
485
|
+
let n = window.location;
|
|
486
|
+
return i === "referrer" && document.referrer && (n = e(document.referrer)), [t ? "https:" : "", "//", n.host, n.pathname].join("");
|
|
487
|
+
};
|
|
488
|
+
class Ce extends ee {
|
|
489
|
+
constructor(t) {
|
|
490
|
+
super(t), this.container.registerAsync("matchingClient", () => ue(this.container)), this.container.registerAsync(
|
|
469
491
|
"contactMethods",
|
|
470
|
-
() =>
|
|
471
|
-
), this.container.registerAsync("dataClient", () =>
|
|
492
|
+
() => ce(this.container)
|
|
493
|
+
), this.container.registerAsync("dataClient", () => de(this.container));
|
|
472
494
|
}
|
|
473
495
|
}
|
|
474
496
|
export {
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
497
|
+
ve as Component,
|
|
498
|
+
W as DataClient,
|
|
499
|
+
ne as DataType,
|
|
500
|
+
Ne as DetachedComponent,
|
|
501
|
+
oe as FeedbackType,
|
|
502
|
+
Ce as GridWidget,
|
|
503
|
+
Me as NotFound,
|
|
504
|
+
b as ServiceClientQueryType,
|
|
505
|
+
re as SortingType,
|
|
506
|
+
K as determineServiceClientQueryType,
|
|
507
|
+
se as formatLegacyData,
|
|
508
|
+
we as genericComponentStyling
|
|
487
509
|
};
|
|
488
510
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/data/legacy-conversion.ts","../src/data/data-client.ts","../src/widget/services.ts","../src/widget/extended-widget.ts"],"sourcesContent":["import {\n CategoryApiResponse,\n ContactApiResponse,\n ContactCategoriesApiResponse,\n ContactMethodApiResponse,\n GuideApiResponse,\n GuideCategoriesApiResponse,\n GuideMatchApiResponse,\n GuideViewApiResponse,\n NoticeApiResponse,\n NoticeListApiResponse,\n TagListApiResponse,\n ValidationApiResult,\n} from '@telia-ace/knowledge-serviceclient';\nimport { ContactMethodType as ContactMethod } from '@telia-ace/knowledge-widget-adapters';\nimport {\n Category,\n DialogItem,\n DialogItemType,\n Guide,\n Notification,\n NotificationList,\n Symbol,\n Tag,\n} from '@telia-ace/knowledge-widget-core';\nimport { FormBuilder } from '@telia-ace/widget-forms';\nimport { DataError, ServiceClientQueryType } from './data-client';\n\nexport type MatchResult = {\n guides: Guide[];\n matches: number;\n topNotifications: Notification[];\n middleNotifications: Notification[];\n bottomNotifications: Notification[];\n notificationLists: NotificationList[];\n tags: Tag[];\n byCategory: { id: string; guides: Guide[]; matches: number }[];\n};\n\nexport type TagsResult = Tag[];\n\nexport type CategoriesResult = {\n categories: Category[];\n matches: number;\n};\n\nexport type NotificationResults = Pick<\n MatchResult,\n 'topNotifications' | 'middleNotifications' | 'bottomNotifications' | 'notificationLists'\n>;\n\nexport type GuideResult = {\n guide: {\n id: string;\n title: string;\n body: string;\n modified: string;\n modifiedBy: string | null;\n publishedBy: string | null;\n published: string;\n connection: string;\n categories: number[];\n hasHandover: boolean;\n allowFeedback: boolean;\n seoMetaDescription: string | null;\n seoAllowIndex: boolean | null;\n perspective: string | null;\n perspectives: { [key: string]: string };\n translations?: { [key: string]: string };\n };\n related: Guide[];\n dialog: DialogItem[];\n contactMethods: ContactMethod[];\n tags: Tag[];\n error?: DataError;\n};\n\nexport type ContactsResult = {\n categories: Category[];\n contactMethods: ContactMethod[];\n topNotifications: Notification[];\n middleNotifications: Notification[];\n bottomNotifications: Notification[];\n notificationLists: NotificationList[];\n};\n\nexport type SubmissionResult = {\n contactMethod?: ContactMethod;\n valid: boolean;\n};\n\nconst convertLegacySymbol = (symbol?: { Type: string; Content: string }): Symbol | undefined => {\n if (symbol) {\n const { Type, Content } = symbol;\n if (Type && Content) {\n return { type: Type, content: Content };\n }\n }\n};\n\nconst mapLegacyCategoriesRecursively = (categories: CategoryApiResponse[]): Category[] => {\n return categories.map((c) => {\n const category: Category = {\n id: c.Id.toString(),\n title: c.Name,\n symbol: convertLegacySymbol(c.DefaultIcon),\n activeSymbol: c.ActiveIcon && convertLegacySymbol(c.ActiveIcon),\n description: c.Description || (c.Attributes && c.Attributes.description) || '',\n matches: c.GuidesCount,\n };\n if (c.Children && c.Children.length) {\n category.items = mapLegacyCategoriesRecursively(c.Children);\n }\n return category;\n });\n};\n\nconst mapNotices = (source: NoticeApiResponse[], type: string): Notification[] => {\n return source\n .filter(({ Type }) => Type === type)\n .map(({ Id, Title, Body }) => ({\n id: Id.toString(),\n title: Title,\n body: Body,\n }));\n};\n\nconst mapNotificationLists = (source: NoticeListApiResponse[]): NotificationList[] => {\n return source.map(({ Id, Title, DefaultIcon, ListNotices, Notices }) => ({\n id: Id.toString(),\n title: Title,\n symbol: convertLegacySymbol(DefaultIcon),\n defaultHeaderOptions: {\n visible: !!ListNotices.length,\n },\n notifications: (ListNotices || [])\n .concat(Notices || [])\n .map(({ Id, Title, Body, Type, Modified }) => ({\n id: Id.toString(),\n title: Title,\n body: Body,\n modified: Modified,\n expandable: Type === 'listNotice',\n })),\n }));\n};\n\nconst mapContactMethodSettings = (\n {\n Id,\n Title,\n DefaultIcon,\n Exits: [Exit],\n ExitType,\n ConfirmationText,\n ExpandFormAutomatically,\n Form,\n Description,\n }: ContactApiResponse,\n Validation?: ValidationApiResult\n): ContactMethod => {\n const { Adapter } = Exit || { Adapter: {} };\n const { ClientName = '', Settings = {}, CustomClientName = '' } = Adapter;\n\n const settings: ContactMethod = {\n id: Id.toString(),\n title: Title,\n description: Description,\n symbol: convertLegacySymbol(DefaultIcon),\n clientName: ClientName === 'custom.adapter' ? CustomClientName : ClientName,\n expanded: true,\n inline: true,\n body: {},\n };\n\n if (ClientName.indexOf('phone') > -1 || ClientName.indexOf('freetext') > -1) {\n const { displayTextBeforeClick, textBeforeClick } = Settings;\n if (displayTextBeforeClick === 'true') {\n settings.expanded = false;\n settings.title = textBeforeClick;\n }\n\n if (ClientName.indexOf('phone.text') > -1) {\n settings.body.phoneNumber = Settings.phoneNumber;\n } else {\n settings.body.freetext = Settings.freetext;\n }\n }\n\n if (\n ClientName.indexOf('chat.popup') > -1 ||\n ClientName.indexOf('link') > -1 ||\n (ClientName === 'custom.adapter' && ExitType === 'custom')\n ) {\n settings.body = Settings;\n settings.body.confirmationFallback = ConfirmationText;\n }\n\n if (ClientName.indexOf('ace') > -1) {\n settings.body = Settings;\n }\n\n if (Form && Form.HasValueComponents) {\n if (Validation) {\n settings.body.form = FormBuilder.fromLegacyForm(Id.toString(), Form, Validation).get();\n } else {\n settings.body.form = FormBuilder.fromLegacyForm(Id.toString(), Form).get();\n }\n if (!ExpandFormAutomatically) {\n settings.expanded = settings.inline = false;\n }\n }\n\n return settings;\n};\n\ntype Modify<T, R> = Omit<T, keyof R> & R;\ntype ExtendedGuideMatchApiResponse = Modify<\n GuideMatchApiResponse,\n {\n ByCategory: { Id: string; Matches: GuideApiResponse[]; TotalMatches: number }[];\n }\n>;\n\nconst mapTags = (tags: TagListApiResponse[] = []): Tag[] => {\n return tags.map(({ Id, Title, TotalMatches, Symbol, DefaultIcon, ActiveIcon }) => ({\n id: Id.toString(),\n title: Title,\n matches: TotalMatches,\n symbol: convertLegacySymbol(DefaultIcon || Symbol),\n defaultIcon: convertLegacySymbol(DefaultIcon),\n activeIcon: convertLegacySymbol(ActiveIcon),\n }));\n};\n\nconst mapGuides = (guides: GuideApiResponse[]) => {\n return guides.map(({ Id, Title, Tags, FirstPublishedDate, Modified }) => ({\n id: Id.toString(),\n title: Title,\n tags: mapTags(Tags),\n published: FirstPublishedDate,\n modified: Modified,\n }));\n};\n\nexport const formatLegacyData = (type: ServiceClientQueryType, data: any) => {\n switch (type) {\n case ServiceClientQueryType.MatchByCategory:\n case ServiceClientQueryType.Match: {\n const result: MatchResult = {\n guides: [],\n matches: 0,\n topNotifications: [],\n middleNotifications: [],\n bottomNotifications: [],\n notificationLists: [],\n tags: [],\n byCategory: [],\n };\n const {\n Matches,\n TotalMatches,\n Notices,\n NoticeLists,\n Tags,\n ByCategory,\n }: ExtendedGuideMatchApiResponse = data;\n\n result.guides = mapGuides(Matches);\n\n result.matches = TotalMatches;\n\n result.byCategory = (ByCategory || []).map(({ Id, Matches, TotalMatches }) => ({\n id: Id,\n guides: mapGuides(Matches),\n matches: TotalMatches,\n }));\n\n result.tags = mapTags(Tags);\n\n result.notificationLists = mapNotificationLists(NoticeLists || []);\n\n result.topNotifications = mapNotices(Notices || [], 'noticeRowTop');\n\n result.middleNotifications = mapNotices(Notices || [], 'noticeRowMiddle');\n\n result.bottomNotifications = mapNotices(Notices || [], 'footerNotice');\n\n return result;\n }\n case ServiceClientQueryType.Categories: {\n const { Children, GuidesCountTotal }: GuideCategoriesApiResponse = data;\n\n const result: CategoriesResult = {\n categories: mapLegacyCategoriesRecursively(Children || []),\n matches: GuidesCountTotal,\n };\n\n return result;\n }\n case ServiceClientQueryType.Guide: {\n const {\n Id,\n Title,\n Body,\n Related,\n Options,\n ConnectionId,\n ContactMethods,\n EnableFeedback,\n HandoverExists,\n FirstPublishedDate,\n Modified,\n ModifiedByDisplayName,\n FirstPublishedByDisplayName,\n Categories,\n Tags,\n SeoMetaDescription,\n SeoAllowIndex,\n Perspectives,\n PerspectiveKey,\n Translations,\n }: GuideViewApiResponse = data;\n\n /* \n PerspectiveKey is always null when on the \"top level\" of a dialog tree\n OR when navigating down a dialog tree in the \"Default answer version\"\n Note: The \"Default answer version\" is not the same as a given guides\n default answer version. The \"Default answer version\" is always the answer\n version in Perspectives with the key \"Default\".\n */\n const perspective =\n PerspectiveKey ||\n Object.values(Perspectives).find((connection) => connection === ConnectionId) ||\n Perspectives['Default'] ||\n null;\n\n const result: GuideResult = {\n guide: {\n id: Id.toString(),\n title: Title,\n body: Body,\n modified: Modified,\n published: FirstPublishedDate,\n modifiedBy: ModifiedByDisplayName,\n publishedBy: FirstPublishedByDisplayName,\n connection: ConnectionId,\n categories: Categories,\n hasHandover: HandoverExists,\n allowFeedback: EnableFeedback,\n seoMetaDescription: SeoMetaDescription,\n seoAllowIndex: SeoAllowIndex,\n perspectives: Perspectives,\n perspective,\n translations: Object.keys(Translations || {}).reduce<{\n [key: string]: string;\n }>((acc, key) => {\n acc[key] = Translations[key].toString();\n return acc;\n }, {}),\n },\n related: mapGuides(Related || []),\n dialog: [],\n contactMethods: (ContactMethods || []).map((cm) => mapContactMethodSettings(cm)),\n tags: mapTags(Tags),\n };\n\n (Options || []).forEach(({ CanAccess, Description, ConnectionId, Properties }) => {\n if (!CanAccess) {\n return;\n }\n\n const item: DialogItem = {\n id: Id.toString(),\n title: Description,\n connection: ConnectionId,\n connectionKey: (Properties as any).ConnectionKey,\n type: DialogItemType.default,\n parent: {\n id: Id.toString(),\n title: Title,\n tags: mapTags(Tags),\n },\n };\n\n if (Properties.Type === 'Guide' || Properties.Type === 'Link') {\n Properties.Id && (item.id = Properties.Id.toString());\n Properties.Uri && (item.href = Properties.Uri);\n Properties.Target && (item.target = Properties.Target);\n switch (Properties.Type) {\n case 'Guide':\n item.type = DialogItemType.guide;\n break;\n case 'Link':\n item.type = DialogItemType.link;\n break;\n }\n }\n\n result.dialog.push(item);\n });\n\n return result;\n }\n case ServiceClientQueryType.Contacts: {\n const { Children, Matches, Notices, NoticeLists }: ContactCategoriesApiResponse = data;\n\n const result: ContactsResult = {\n contactMethods: (Matches || []).map((cm) => mapContactMethodSettings(cm)),\n categories: mapLegacyCategoriesRecursively(Children || []),\n topNotifications: mapNotices(Notices || [], 'noticeRowTop'),\n middleNotifications: mapNotices(Notices || [], 'noticeRowMiddle'),\n bottomNotifications: mapNotices(Notices || [], 'footerNotice'),\n notificationLists: mapNotificationLists(NoticeLists || []),\n };\n\n return result;\n }\n case ServiceClientQueryType.ContactMethod: {\n const { ContactMethod }: ContactMethodApiResponse = data;\n\n return mapContactMethodSettings(ContactMethod || {});\n }\n case ServiceClientQueryType.Tags:\n case ServiceClientQueryType.TagsOnGuides: {\n return mapTags(data || []);\n }\n case ServiceClientQueryType.Notifications: {\n const { Notices, NoticeLists } = data;\n\n return {\n topNotifications: mapNotices(Notices || [], 'noticeRowTop'),\n middleNotifications: mapNotices(Notices || [], 'noticeRowMiddle'),\n bottomNotifications: mapNotices(Notices || [], 'footerNotice'),\n notificationLists: mapNotificationLists(NoticeLists || []),\n };\n }\n default:\n return {};\n }\n};\n","import { ServiceClient } from '@telia-ace/knowledge-serviceclient';\nimport { WidgetRenderState } from '@telia-ace/knowledge-widget-core';\nimport {\n deepClone,\n removeNullAndUndefinedValues,\n shallowCompare,\n} from '@telia-ace/widget-utilities';\nimport { Container, EventManager, Widget } from '@webprovisions/platform';\nimport { formatLegacyData } from './legacy-conversion';\n\nexport type Subscriber = (...args: any[]) => void;\n\nexport enum DataType {\n Guide = 'guide',\n Guides = 'guides',\n GuidesByCategory = 'guides-by-category',\n RowNotifications = 'row-notices',\n NotificationLists = 'notification-lists',\n GuideCategories = 'guide-categories',\n ContactMethodCategories = 'contact-method-categories',\n ContactMethod = 'contact-method',\n ContactMethods = 'contact-methods',\n Tags = 'tags',\n TagsOnGuides = 'tagsonguides',\n}\n\nexport type DataError = {\n status: number;\n message: string;\n};\n\nexport enum ServiceClientQueryType {\n Match = 'match',\n Categories = 'categories',\n Guide = 'guide',\n Contacts = 'contacts',\n ContactMethod = 'contact-method',\n MatchByCategory = 'match-by-category',\n Tags = 'tags',\n TagsOnGuides = 'tagsonguides',\n Notifications = 'notifications',\n}\n\nexport enum FeedbackType {\n Positive = 'Positive',\n Negative = 'Negative',\n}\n\nexport type QueryParameters = {\n guideId?: string | number;\n categories?: string | number | string[] | number[];\n tagId?: string | number;\n connection?: string;\n\n contactMethodCategoryId?: string | number;\n contactMethodId?: string | number;\n\n searchPhrase?: string | number;\n take?: string | number;\n [key: string]: any;\n\n expandCategories?: 'none' | 'children' | 'descendants';\n sorting?: SortingType;\n guideIds?: string[];\n};\n\nexport enum SortingType {\n POPULARITY_DESCENDING = 'popularity-descending',\n ALPHABETIC_ASCENDING = 'alphabetic-ascending',\n ALPHABETIC_DESCENDING = 'alphabetic-descending',\n MODIFIED_ASCENDING = 'modified-ascending',\n MODIFIED_DESCENDING = 'modified-descending',\n PUBLISHED_ASCENDING = 'published-ascending',\n PUBLISHED_DESCENDING = 'published-descending',\n}\n\nexport type Query = {\n params: QueryParameters;\n resolved: boolean;\n loading: boolean;\n error?: DataError;\n data: any;\n resolvers: {\n resolve: (data: any) => void;\n reject: (data: any) => void;\n }[];\n};\n\nexport const determineServiceClientQueryType = (type: DataType): ServiceClientQueryType => {\n switch (type) {\n case DataType.Guides:\n return ServiceClientQueryType.Match;\n case DataType.GuidesByCategory:\n return ServiceClientQueryType.MatchByCategory;\n case DataType.Guide:\n return ServiceClientQueryType.Guide;\n case DataType.GuideCategories:\n return ServiceClientQueryType.Categories;\n case DataType.ContactMethodCategories:\n case DataType.ContactMethods:\n return ServiceClientQueryType.Contacts;\n case DataType.ContactMethod:\n return ServiceClientQueryType.ContactMethod;\n case DataType.Tags:\n return ServiceClientQueryType.Tags;\n case DataType.TagsOnGuides:\n return ServiceClientQueryType.TagsOnGuides;\n case DataType.NotificationLists:\n case DataType.RowNotifications:\n return ServiceClientQueryType.Notifications;\n default:\n throw 'error';\n }\n};\n\nconst widgetIsHidden = async (container: Container) => {\n const { invoke } = container.get('$widget');\n const renderState = await invoke('renderState');\n return renderState === WidgetRenderState.hidden;\n};\n\nexport default class DataClient {\n private queries: Map<ServiceClientQueryType, Query[]> = new Map();\n private lastTake: number = 0;\n public events: EventManager;\n constructor(private container: Container, private matchingClient: ServiceClient) {\n this.events = (<Widget>container.get('$widget')).events;\n\n this.events.subscribe('widget:settings-updated', () => (this.queries = new Map()));\n\n this.events.subscribe('widget:render-state-changed', (event, { next, previous }) => {\n if (previous === WidgetRenderState.hidden && next === WidgetRenderState.open) {\n this.fetchAllUnresolvedQueries();\n }\n });\n }\n\n static getInstance(container: Container): Promise<DataClient> {\n return container.getAsync('dataClient');\n }\n\n private getUnresolvedQueries = () => {\n let unresolvedCount = 0;\n this.queries.forEach((queries, type) => {\n const hasUnresolved = queries.some((query: Query) => !query.resolved);\n if (hasUnresolved) {\n unresolvedCount = +1;\n }\n });\n return unresolvedCount;\n };\n\n public fetch(type: DataType, params: QueryParameters): Promise<any> {\n return new Promise((resolve, reject) => {\n if (params.take) {\n this.lastTake = +(params.take || 0);\n }\n\n removeNullAndUndefinedValues(params);\n const serviceClientQueryType = determineServiceClientQueryType(type);\n const queries = this.queries.get(serviceClientQueryType) || [];\n const query = queries.find((q) => shallowCompare(q.params, params));\n\n if (query) {\n const index = queries.indexOf(query);\n if (query.resolved) {\n this.events.dispatch('data-client:fetched', {\n params,\n type: serviceClientQueryType,\n response: query.data,\n unresolvedQueries: this.getUnresolvedQueries(),\n });\n this.track(query.data, serviceClientQueryType, query.error);\n if (query.data && query.error) {\n reject({ error: query.error });\n } else {\n resolve(query.data);\n }\n } else {\n query.resolvers.push({ resolve, reject });\n }\n queries.splice(index, 1);\n queries.push(query);\n this.queries.set(serviceClientQueryType, queries);\n if (!query.loading && !query.resolved) {\n return this.runQuery(serviceClientQueryType, params);\n }\n } else {\n queries.push({\n params,\n resolved: false,\n loading: true,\n data: {},\n resolvers: [{ resolve, reject }],\n });\n this.queries.set(serviceClientQueryType, queries);\n\n return this.runQuery(serviceClientQueryType, params);\n }\n }).then((res) => deepClone(res));\n }\n\n // query the cached data\n public read(\n type: DataType,\n options: {\n select?: (data: any) => any; // either return all data by the DataType, or use an selector\n }\n ) {\n const { select } = options;\n const serviceClientQueryType = determineServiceClientQueryType(type);\n const queries = this.queries.get(serviceClientQueryType) || [];\n\n const result = queries.reduce<any[]>((acc, query) => {\n if (typeof select === 'function') {\n const match = select(query.data);\n if (match) {\n acc.push(match);\n }\n } else {\n acc.push(query.data);\n }\n return acc;\n }, []);\n return result;\n }\n\n public feedback(id: string, connection: string, feedback: FeedbackType): Promise<any> {\n return this.matchingClient.giveFeedback(id, connection, feedback);\n }\n\n private setLoadingStatus(\n type: ServiceClientQueryType,\n params: QueryParameters,\n loading: boolean\n ) {\n const queries = this.queries.get(type) || [];\n const query = queries.find((q) => shallowCompare(q.params, params));\n\n if (query) {\n query.loading = loading;\n }\n this.queries.set(type, queries);\n }\n\n private async runQuery(type: ServiceClientQueryType, params: QueryParameters) {\n const {\n searchPhrase = '',\n categories = '0',\n contactMethodCategoryId = '0',\n contactMethodId = '0',\n tagId = undefined,\n take = 5,\n connection = '',\n guideId,\n expandCategories = 'descendants',\n currentCategory,\n sorting = SortingType.POPULARITY_DESCENDING,\n guideIds = [],\n } = params;\n\n const trimmedPhrase = searchPhrase.toString().trim();\n if (await widgetIsHidden(this.container)) {\n return Promise.resolve();\n }\n\n switch (type) {\n case ServiceClientQueryType.Match: {\n const formatSortingValues = (sorting: string) => {\n const [type, direction] = sorting.split('-');\n const sortKeysMap = new Map([\n ['popularity', 'popularity'],\n ['alphabetic', 'title'],\n ['modified', 'lastModified'],\n ['published', 'firstPublished'],\n ]);\n\n return {\n type: sortKeysMap.get(type),\n direction: direction,\n };\n };\n\n if (guideIds.length) {\n return this.matchingClient\n .customRequest('guides', 'POST', {\n configuration: { ids: guideIds, take: +take },\n })\n .then((matches) => matches && this.handleResponse(matches, type, params));\n }\n\n return this.matchingClient\n .match(trimmedPhrase, {\n categories:\n categories === '0'\n ? []\n : Array.isArray(categories)\n ? categories\n : [+categories],\n take: +take,\n tags: tagId,\n sorting: formatSortingValues(sorting),\n ids: guideIds,\n })\n .then((matches) => matches && this.handleResponse(matches, type, params));\n }\n case ServiceClientQueryType.MatchByCategory: {\n return this.matchingClient\n .match(trimmedPhrase, {\n groupByCategory: true,\n categories:\n categories === '0'\n ? []\n : Array.isArray(categories)\n ? categories\n : [+categories],\n take: +take,\n tags: tagId,\n })\n .then((matches) => matches && this.handleResponse(matches, type, params));\n }\n case ServiceClientQueryType.Guide: {\n return this.matchingClient\n .getGuide(guideId, { connectionId: connection })\n .then((guide) => {\n if (guide) {\n this.handleResponse(guide, type, params);\n }\n })\n .catch((e) => {\n const error = {\n message: 'Something went wrong.',\n status: e.status || 400,\n };\n if (error.status === 404) {\n error.message = 'The guide could not be found.';\n }\n this.handleResponse({}, type, params, error);\n });\n }\n case ServiceClientQueryType.Categories: {\n return this.matchingClient\n .getCategories({ phrase: trimmedPhrase, expand: expandCategories, tags: tagId })\n .then(\n (categories) => categories && this.handleResponse(categories, type, params)\n );\n }\n case ServiceClientQueryType.Contacts: {\n if (guideId) {\n return this.matchingClient\n .contactMethods(+guideId, { phrase: trimmedPhrase })\n .then((result) => result && this.handleResponse(result, type, params));\n }\n return this.matchingClient\n .contacts(+contactMethodCategoryId, { phrase: trimmedPhrase })\n .then((result) => result && this.handleResponse(result, type, params));\n }\n case ServiceClientQueryType.ContactMethod: {\n return this.matchingClient\n .getContactMethod(+contactMethodId, { guideId, currentCategory })\n .then((result) => result && this.handleResponse(result, type, params));\n }\n case ServiceClientQueryType.Tags: {\n return this.matchingClient\n .customRequest('tags', 'GET', {\n configuration: {\n take: 999999,\n phrase: trimmedPhrase,\n categories:\n categories === '0'\n ? []\n : Array.isArray(categories)\n ? categories\n : [+categories],\n },\n })\n .then((result) => result && this.handleResponse(result, type, params));\n }\n case ServiceClientQueryType.TagsOnGuides: {\n return this.matchingClient\n .customRequest('tagsonguides', 'GET', {\n configuration: {\n take: 999999,\n phrase: trimmedPhrase,\n categories:\n categories === '0'\n ? []\n : Array.isArray(categories)\n ? categories\n : [+categories],\n tags: tagId,\n },\n })\n .then((result) => result && this.handleResponse(result, type, params));\n }\n case ServiceClientQueryType.Notifications: {\n return this.matchingClient\n .customRequest('notices', 'GET', {\n configuration: {\n phrase: trimmedPhrase,\n categories:\n categories === '0'\n ? []\n : Array.isArray(categories)\n ? categories\n : [+categories],\n },\n })\n .then((result) => result && this.handleResponse(result, type, params));\n }\n }\n }\n\n handleResponse(\n data: any = {},\n type: ServiceClientQueryType,\n params: QueryParameters,\n error?: DataError\n ) {\n const queries = this.queries.get(type) || [];\n const existing = queries.find((q) => shallowCompare(q.params, params));\n if (existing) {\n const formatted = error ? error : formatLegacyData(type, data);\n this.track(formatted, type, error);\n existing.resolvers.forEach((r) => {\n if (error) {\n r.reject({ error: formatted });\n } else {\n r.resolve(formatted);\n }\n });\n\n const index = queries.indexOf(existing);\n if (index > -1) {\n queries.splice(index, 1);\n }\n queries.push({ ...existing, error, resolvers: [], data: formatted, resolved: true });\n this.setLoadingStatus(type, params, false);\n this.queries.set(type, queries);\n if (!error) {\n this.events.dispatch('data-client:fetched', {\n type,\n params,\n response: formatted,\n unresolvedQueries: this.getUnresolvedQueries(),\n });\n }\n }\n }\n\n private fetchAllUnresolvedQueries() {\n for (const [queryType, queries] of this.queries) {\n queries\n .filter((query: Query) => !query.resolved)\n .forEach((query) => {\n this.runQuery(queryType, query.params);\n });\n }\n }\n\n private track(data: any = {}, type: ServiceClientQueryType, error?: DataError) {\n const widget = this.container.get('$widget');\n if (widget && !error) {\n widget.events.dispatch('tracking:service-client-response', {\n type,\n data,\n });\n } else if (widget) {\n widget.events.dispatch('tracking:service-client-error', {\n type,\n error,\n });\n }\n }\n\n static create(container: Container): Promise<DataClient> {\n return container\n .getAsync('matchingClient')\n .then((matchingClient) => new DataClient(container, matchingClient));\n }\n}\n","import { Container } from '@webprovisions/platform';\n\nexport const createContactMethodPlatform = (container: Container) => {\n return import('@telia-ace/knowledge-widget-adapters').then(({ ContactMethodPlatform }) => {\n return ContactMethodPlatform.create(container);\n });\n};\n\nexport const createDataClient = (container: Container) => {\n return import('../data').then(({ DataClient }) => {\n return DataClient.create(container);\n });\n};\n","import { Widget } from '@telia-ace/widget-types-grid';\nimport { Container } from '@webprovisions/platform';\nimport { createContactMethodPlatform, createDataClient } from './services';\n\nexport default class ExtendedWidget extends Widget {\n constructor(container: Container) {\n super(container);\n\n this.container.registerAsync('contactMethods', () =>\n createContactMethodPlatform(this.container)\n );\n this.container.registerAsync('dataClient', () => createDataClient(this.container));\n }\n}\n"],"names":["convertLegacySymbol","symbol","Type","Content","mapLegacyCategoriesRecursively","categories","c","category","mapNotices","source","type","Id","Title","Body","mapNotificationLists","DefaultIcon","ListNotices","Notices","Modified","mapContactMethodSettings","Exit","ExitType","ConfirmationText","ExpandFormAutomatically","Form","Description","Validation","Adapter","ClientName","Settings","CustomClientName","settings","displayTextBeforeClick","textBeforeClick","FormBuilder","mapTags","tags","TotalMatches","Symbol","ActiveIcon","mapGuides","guides","Tags","FirstPublishedDate","formatLegacyData","data","ServiceClientQueryType","result","Matches","NoticeLists","ByCategory","Children","GuidesCountTotal","Related","Options","ConnectionId","ContactMethods","EnableFeedback","HandoverExists","ModifiedByDisplayName","FirstPublishedByDisplayName","Categories","SeoMetaDescription","SeoAllowIndex","Perspectives","PerspectiveKey","Translations","perspective","connection","acc","key","cm","CanAccess","Properties","item","DialogItemType","ContactMethod","DataType","FeedbackType","SortingType","determineServiceClientQueryType","widgetIsHidden","container","__async","invoke","WidgetRenderState","DataClient","matchingClient","__publicField","unresolvedCount","queries","query","event","next","previous","params","resolve","reject","removeNullAndUndefinedValues","serviceClientQueryType","q","shallowCompare","index","res","deepClone","options","select","match","id","feedback","loading","searchPhrase","contactMethodCategoryId","contactMethodId","tagId","take","guideId","expandCategories","currentCategory","sorting","guideIds","trimmedPhrase","formatSortingValues","direction","matches","guide","e","error","existing","formatted","r","__spreadProps","__spreadValues","queryType","widget","createContactMethodPlatform","ContactMethodPlatform","createDataClient","ExtendedWidget","Widget"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2FA,MAAMA,IAAsB,CAACC,MAAmE;AAC5F,MAAIA,GAAQ;AACF,UAAA,EAAE,MAAAC,GAAM,SAAAC,EAAY,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S,CACrC;ACPL,MAAqBwD,WAAuBC,GAAO;AAAA,EAC/C,YAAYzD,GAAsB;AAC9B,UAAMA,CAAS,GAEf,KAAK,UAAU;AAAA,MAAc;AAAA,MAAkB,MAC3CqD,GAA4B,KAAK,SAAS;AAAA,IAAA,GAE9C,KAAK,UAAU,cAAc,cAAc,MAAME,GAAiB,KAAK,SAAS,CAAC;AAAA,EACrF;AACJ;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/data/legacy-conversion.ts","../src/data/data-client.ts","../src/widget/services.ts","../src/widget/extended-widget.ts"],"sourcesContent":["import {\n CategoryApiResponse,\n ContactApiResponse,\n ContactCategoriesApiResponse,\n ContactMethodApiResponse,\n GuideApiResponse,\n GuideCategoriesApiResponse,\n GuideMatchApiResponse,\n GuideViewApiResponse,\n NoticeApiResponse,\n NoticeListApiResponse,\n TagListApiResponse,\n ValidationApiResult,\n} from '@telia-ace/knowledge-serviceclient';\nimport { ContactMethodType as ContactMethod } from '@telia-ace/knowledge-widget-adapters';\nimport {\n Category,\n DialogItem,\n DialogItemType,\n Guide,\n Notification,\n NotificationList,\n Symbol,\n Tag,\n} from '@telia-ace/knowledge-widget-core';\nimport { FormBuilder } from '@telia-ace/widget-forms';\nimport { DataError, ServiceClientQueryType } from './data-client';\n\nexport type MatchResult = {\n guides: Guide[];\n matches: number;\n topNotifications: Notification[];\n middleNotifications: Notification[];\n bottomNotifications: Notification[];\n notificationLists: NotificationList[];\n tags: Tag[];\n byCategory: { id: string; guides: Guide[]; matches: number }[];\n};\n\nexport type TagsResult = Tag[];\n\nexport type CategoriesResult = {\n categories: Category[];\n matches: number;\n};\n\nexport type NotificationResults = Pick<\n MatchResult,\n 'topNotifications' | 'middleNotifications' | 'bottomNotifications' | 'notificationLists'\n>;\n\nexport type GuideResult = {\n guide: {\n id: string;\n title: string;\n body: string;\n modified: string;\n modifiedBy: string | null;\n publishedBy: string | null;\n published: string;\n connection: string;\n categories: number[];\n hasHandover: boolean;\n allowFeedback: boolean;\n seoMetaDescription: string | null;\n seoAllowIndex: boolean | null;\n perspective: string | null;\n perspectives: { [key: string]: string };\n translations?: { [key: string]: string };\n };\n related: Guide[];\n dialog: DialogItem[];\n contactMethods: ContactMethod[];\n tags: Tag[];\n error?: DataError;\n};\n\nexport type ContactsResult = {\n categories: Category[];\n contactMethods: ContactMethod[];\n topNotifications: Notification[];\n middleNotifications: Notification[];\n bottomNotifications: Notification[];\n notificationLists: NotificationList[];\n};\n\nexport type SubmissionResult = {\n contactMethod?: ContactMethod;\n valid: boolean;\n};\n\nconst convertLegacySymbol = (symbol?: { Type: string; Content: string }): Symbol | undefined => {\n if (symbol) {\n const { Type, Content } = symbol;\n if (Type && Content) {\n return { type: Type, content: Content };\n }\n }\n};\n\nconst mapLegacyCategoriesRecursively = (categories: CategoryApiResponse[]): Category[] => {\n return categories.map((c) => {\n const category: Category = {\n id: c.Id.toString(),\n title: c.Name,\n symbol: convertLegacySymbol(c.DefaultIcon),\n activeSymbol: c.ActiveIcon && convertLegacySymbol(c.ActiveIcon),\n description: c.Description || (c.Attributes && c.Attributes.description) || '',\n matches: c.GuidesCount,\n };\n if (c.Children && c.Children.length) {\n category.items = mapLegacyCategoriesRecursively(c.Children);\n }\n return category;\n });\n};\n\nconst mapNotices = (source: NoticeApiResponse[], type: string): Notification[] => {\n return source\n .filter(({ Type }) => Type === type)\n .map(({ Id, Title, Body }) => ({\n id: Id.toString(),\n title: Title,\n body: Body,\n }));\n};\n\nconst mapNotificationLists = (source: NoticeListApiResponse[]): NotificationList[] => {\n return source.map(({ Id, Title, DefaultIcon, ListNotices, Notices }) => ({\n id: Id.toString(),\n title: Title,\n symbol: convertLegacySymbol(DefaultIcon),\n defaultHeaderOptions: {\n visible: !!ListNotices.length,\n },\n notifications: (ListNotices || [])\n .concat(Notices || [])\n .map(({ Id, Title, Body, Type, Modified }) => ({\n id: Id.toString(),\n title: Title,\n body: Body,\n modified: Modified,\n expandable: Type === 'listNotice',\n })),\n }));\n};\n\nconst mapContactMethodSettings = (\n {\n Id,\n Title,\n DefaultIcon,\n Exits: [Exit],\n ExitType,\n ConfirmationText,\n ExpandFormAutomatically,\n Form,\n Description,\n }: ContactApiResponse,\n Validation?: ValidationApiResult\n): ContactMethod => {\n const { Adapter } = Exit || { Adapter: {} };\n const { ClientName = '', Settings = {}, CustomClientName = '' } = Adapter;\n\n const settings: ContactMethod = {\n id: Id.toString(),\n title: Title,\n description: Description,\n symbol: convertLegacySymbol(DefaultIcon),\n clientName: ClientName === 'custom.adapter' ? CustomClientName : ClientName,\n expanded: true,\n inline: true,\n body: {},\n };\n\n if (ClientName.indexOf('phone') > -1 || ClientName.indexOf('freetext') > -1) {\n const { displayTextBeforeClick, textBeforeClick } = Settings;\n if (displayTextBeforeClick === 'true') {\n settings.expanded = false;\n settings.title = textBeforeClick;\n }\n\n if (ClientName.indexOf('phone.text') > -1) {\n settings.body.phoneNumber = Settings.phoneNumber;\n } else {\n settings.body.freetext = Settings.freetext;\n }\n }\n\n if (\n ClientName.indexOf('chat.popup') > -1 ||\n ClientName.indexOf('link') > -1 ||\n (ClientName === 'custom.adapter' && ExitType === 'custom')\n ) {\n settings.body = Settings;\n settings.body.confirmationFallback = ConfirmationText;\n }\n\n if (ClientName.indexOf('ace') > -1) {\n settings.body = Settings;\n }\n\n if (Form && Form.HasValueComponents) {\n if (Validation) {\n settings.body.form = FormBuilder.fromLegacyForm(Id.toString(), Form, Validation).get();\n } else {\n settings.body.form = FormBuilder.fromLegacyForm(Id.toString(), Form).get();\n }\n if (!ExpandFormAutomatically) {\n settings.expanded = settings.inline = false;\n }\n }\n\n return settings;\n};\n\ntype Modify<T, R> = Omit<T, keyof R> & R;\ntype ExtendedGuideMatchApiResponse = Modify<\n GuideMatchApiResponse,\n {\n ByCategory: { Id: string; Matches: GuideApiResponse[]; TotalMatches: number }[];\n }\n>;\n\nconst mapTags = (tags: TagListApiResponse[] = []): Tag[] => {\n return tags.map(({ Id, Title, TotalMatches, Symbol, DefaultIcon, ActiveIcon }) => ({\n id: Id.toString(),\n title: Title,\n matches: TotalMatches,\n symbol: convertLegacySymbol(DefaultIcon || Symbol),\n defaultIcon: convertLegacySymbol(DefaultIcon),\n activeIcon: convertLegacySymbol(ActiveIcon),\n }));\n};\n\nconst mapGuides = (guides: GuideApiResponse[]) => {\n return guides.map(({ Id, Title, Tags, FirstPublishedDate, Modified }) => ({\n id: Id.toString(),\n title: Title,\n tags: mapTags(Tags),\n published: FirstPublishedDate,\n modified: Modified,\n }));\n};\n\nexport const formatLegacyData = (type: ServiceClientQueryType, data: any) => {\n switch (type) {\n case ServiceClientQueryType.MatchByCategory:\n case ServiceClientQueryType.Match: {\n const result: MatchResult = {\n guides: [],\n matches: 0,\n topNotifications: [],\n middleNotifications: [],\n bottomNotifications: [],\n notificationLists: [],\n tags: [],\n byCategory: [],\n };\n const {\n Matches,\n TotalMatches,\n Notices,\n NoticeLists,\n Tags,\n ByCategory,\n }: ExtendedGuideMatchApiResponse = data;\n\n result.guides = mapGuides(Matches);\n\n result.matches = TotalMatches;\n\n result.byCategory = (ByCategory || []).map(({ Id, Matches, TotalMatches }) => ({\n id: Id,\n guides: mapGuides(Matches),\n matches: TotalMatches,\n }));\n\n result.tags = mapTags(Tags);\n\n result.notificationLists = mapNotificationLists(NoticeLists || []);\n\n result.topNotifications = mapNotices(Notices || [], 'noticeRowTop');\n\n result.middleNotifications = mapNotices(Notices || [], 'noticeRowMiddle');\n\n result.bottomNotifications = mapNotices(Notices || [], 'footerNotice');\n\n return result;\n }\n case ServiceClientQueryType.Categories: {\n const { Children, GuidesCountTotal }: GuideCategoriesApiResponse = data;\n\n const result: CategoriesResult = {\n categories: mapLegacyCategoriesRecursively(Children || []),\n matches: GuidesCountTotal,\n };\n\n return result;\n }\n case ServiceClientQueryType.Guide: {\n const {\n Id,\n Title,\n Body,\n Related,\n Options,\n ConnectionId,\n ContactMethods,\n EnableFeedback,\n HandoverExists,\n FirstPublishedDate,\n Modified,\n ModifiedByDisplayName,\n FirstPublishedByDisplayName,\n Categories,\n Tags,\n SeoMetaDescription,\n SeoAllowIndex,\n Perspectives,\n PerspectiveKey,\n Translations,\n }: GuideViewApiResponse = data;\n\n /* \n PerspectiveKey is always null when on the \"top level\" of a dialog tree\n OR when navigating down a dialog tree in the \"Default answer version\"\n Note: The \"Default answer version\" is not the same as a given guides\n default answer version. The \"Default answer version\" is always the answer\n version in Perspectives with the key \"Default\".\n */\n const perspective =\n PerspectiveKey ||\n Object.values(Perspectives).find((connection) => connection === ConnectionId) ||\n Perspectives['Default'] ||\n null;\n\n const result: GuideResult = {\n guide: {\n id: Id.toString(),\n title: Title,\n body: Body,\n modified: Modified,\n published: FirstPublishedDate,\n modifiedBy: ModifiedByDisplayName,\n publishedBy: FirstPublishedByDisplayName,\n connection: ConnectionId,\n categories: Categories,\n hasHandover: HandoverExists,\n allowFeedback: EnableFeedback,\n seoMetaDescription: SeoMetaDescription,\n seoAllowIndex: SeoAllowIndex,\n perspectives: Perspectives,\n perspective,\n translations: Object.keys(Translations || {}).reduce<{\n [key: string]: string;\n }>((acc, key) => {\n acc[key] = Translations[key].toString();\n return acc;\n }, {}),\n },\n related: mapGuides(Related || []),\n dialog: [],\n contactMethods: (ContactMethods || []).map((cm) => mapContactMethodSettings(cm)),\n tags: mapTags(Tags),\n };\n\n (Options || []).forEach(({ CanAccess, Description, ConnectionId, Properties }) => {\n if (!CanAccess) {\n return;\n }\n\n const item: DialogItem = {\n id: Id.toString(),\n title: Description,\n connection: ConnectionId,\n connectionKey: (Properties as any).ConnectionKey,\n type: DialogItemType.default,\n parent: {\n id: Id.toString(),\n title: Title,\n tags: mapTags(Tags),\n },\n };\n\n if (Properties.Type === 'Guide' || Properties.Type === 'Link') {\n Properties.Id && (item.id = Properties.Id.toString());\n Properties.Uri && (item.href = Properties.Uri);\n Properties.Target && (item.target = Properties.Target);\n switch (Properties.Type) {\n case 'Guide':\n item.type = DialogItemType.guide;\n break;\n case 'Link':\n item.type = DialogItemType.link;\n break;\n }\n }\n\n result.dialog.push(item);\n });\n\n return result;\n }\n case ServiceClientQueryType.Contacts: {\n const { Children, Matches, Notices, NoticeLists }: ContactCategoriesApiResponse = data;\n\n const result: ContactsResult = {\n contactMethods: (Matches || []).map((cm) => mapContactMethodSettings(cm)),\n categories: mapLegacyCategoriesRecursively(Children || []),\n topNotifications: mapNotices(Notices || [], 'noticeRowTop'),\n middleNotifications: mapNotices(Notices || [], 'noticeRowMiddle'),\n bottomNotifications: mapNotices(Notices || [], 'footerNotice'),\n notificationLists: mapNotificationLists(NoticeLists || []),\n };\n\n return result;\n }\n case ServiceClientQueryType.ContactMethod: {\n const { ContactMethod }: ContactMethodApiResponse = data;\n\n return mapContactMethodSettings(ContactMethod || {});\n }\n case ServiceClientQueryType.Tags:\n case ServiceClientQueryType.TagsOnGuides: {\n return mapTags(data || []);\n }\n case ServiceClientQueryType.Notifications: {\n const { Notices, NoticeLists } = data;\n\n return {\n topNotifications: mapNotices(Notices || [], 'noticeRowTop'),\n middleNotifications: mapNotices(Notices || [], 'noticeRowMiddle'),\n bottomNotifications: mapNotices(Notices || [], 'footerNotice'),\n notificationLists: mapNotificationLists(NoticeLists || []),\n };\n }\n default:\n return {};\n }\n};\n","import { ServiceClient } from '@telia-ace/knowledge-serviceclient';\nimport { WidgetRenderState } from '@telia-ace/knowledge-widget-core';\nimport {\n deepClone,\n removeNullAndUndefinedValues,\n shallowCompare,\n} from '@telia-ace/widget-utilities';\nimport { Container, EventManager, Widget } from '@webprovisions/platform';\nimport { formatLegacyData } from './legacy-conversion';\n\nexport type Subscriber = (...args: any[]) => void;\n\nexport enum DataType {\n Guide = 'guide',\n Guides = 'guides',\n GuidesByCategory = 'guides-by-category',\n RowNotifications = 'row-notices',\n NotificationLists = 'notification-lists',\n GuideCategories = 'guide-categories',\n ContactMethodCategories = 'contact-method-categories',\n ContactMethod = 'contact-method',\n ContactMethods = 'contact-methods',\n Tags = 'tags',\n TagsOnGuides = 'tagsonguides',\n}\n\nexport type DataError = {\n status: number;\n message: string;\n};\n\nexport enum ServiceClientQueryType {\n Match = 'match',\n Categories = 'categories',\n Guide = 'guide',\n Contacts = 'contacts',\n ContactMethod = 'contact-method',\n MatchByCategory = 'match-by-category',\n Tags = 'tags',\n TagsOnGuides = 'tagsonguides',\n Notifications = 'notifications',\n}\n\nexport enum FeedbackType {\n Positive = 'Positive',\n Negative = 'Negative',\n}\n\nexport type QueryParameters = {\n guideId?: string | number;\n categories?: string | number | string[] | number[];\n tagId?: string | number;\n connection?: string;\n\n contactMethodCategoryId?: string | number;\n contactMethodId?: string | number;\n\n searchPhrase?: string | number;\n take?: string | number;\n [key: string]: any;\n\n expandCategories?: 'none' | 'children' | 'descendants';\n sorting?: SortingType;\n guideIds?: string[];\n};\n\nexport enum SortingType {\n POPULARITY_DESCENDING = 'popularity-descending',\n ALPHABETIC_ASCENDING = 'alphabetic-ascending',\n ALPHABETIC_DESCENDING = 'alphabetic-descending',\n MODIFIED_ASCENDING = 'modified-ascending',\n MODIFIED_DESCENDING = 'modified-descending',\n PUBLISHED_ASCENDING = 'published-ascending',\n PUBLISHED_DESCENDING = 'published-descending',\n}\n\nexport type Query = {\n params: QueryParameters;\n resolved: boolean;\n loading: boolean;\n error?: DataError;\n data: any;\n resolvers: {\n resolve: (data: any) => void;\n reject: (data: any) => void;\n }[];\n};\n\nexport const determineServiceClientQueryType = (type: DataType): ServiceClientQueryType => {\n switch (type) {\n case DataType.Guides:\n return ServiceClientQueryType.Match;\n case DataType.GuidesByCategory:\n return ServiceClientQueryType.MatchByCategory;\n case DataType.Guide:\n return ServiceClientQueryType.Guide;\n case DataType.GuideCategories:\n return ServiceClientQueryType.Categories;\n case DataType.ContactMethodCategories:\n case DataType.ContactMethods:\n return ServiceClientQueryType.Contacts;\n case DataType.ContactMethod:\n return ServiceClientQueryType.ContactMethod;\n case DataType.Tags:\n return ServiceClientQueryType.Tags;\n case DataType.TagsOnGuides:\n return ServiceClientQueryType.TagsOnGuides;\n case DataType.NotificationLists:\n case DataType.RowNotifications:\n return ServiceClientQueryType.Notifications;\n default:\n throw 'error';\n }\n};\n\nconst widgetIsHidden = async (container: Container) => {\n const { invoke } = container.get('$widget');\n const renderState = await invoke('renderState');\n return renderState === WidgetRenderState.hidden;\n};\n\nexport default class DataClient {\n private queries: Map<ServiceClientQueryType, Query[]> = new Map();\n private lastTake: number = 0;\n public events: EventManager;\n constructor(private container: Container, private matchingClient: ServiceClient) {\n this.events = (<Widget>container.get('$widget')).events;\n\n this.events.subscribe('widget:settings-updated', () => (this.queries = new Map()));\n\n this.events.subscribe('widget:render-state-changed', (event, { next, previous }) => {\n if (previous === WidgetRenderState.hidden && next === WidgetRenderState.open) {\n this.fetchAllUnresolvedQueries();\n }\n });\n }\n\n static getInstance(container: Container): Promise<DataClient> {\n return container.getAsync('dataClient');\n }\n\n private getUnresolvedQueries = () => {\n let unresolvedCount = 0;\n this.queries.forEach((queries, type) => {\n const hasUnresolved = queries.some((query: Query) => !query.resolved);\n if (hasUnresolved) {\n unresolvedCount = +1;\n }\n });\n return unresolvedCount;\n };\n\n public fetch(type: DataType, params: QueryParameters): Promise<any> {\n return new Promise((resolve, reject) => {\n if (params.take) {\n this.lastTake = +(params.take || 0);\n }\n\n removeNullAndUndefinedValues(params);\n const serviceClientQueryType = determineServiceClientQueryType(type);\n const queries = this.queries.get(serviceClientQueryType) || [];\n const query = queries.find((q) => shallowCompare(q.params, params));\n\n if (query) {\n const index = queries.indexOf(query);\n if (query.resolved) {\n this.events.dispatch('data-client:fetched', {\n params,\n type: serviceClientQueryType,\n response: query.data,\n unresolvedQueries: this.getUnresolvedQueries(),\n });\n this.track(query.data, serviceClientQueryType, query.error);\n if (query.data && query.error) {\n reject({ error: query.error });\n } else {\n resolve(query.data);\n }\n } else {\n query.resolvers.push({ resolve, reject });\n }\n queries.splice(index, 1);\n queries.push(query);\n this.queries.set(serviceClientQueryType, queries);\n if (!query.loading && !query.resolved) {\n return this.runQuery(serviceClientQueryType, params);\n }\n } else {\n queries.push({\n params,\n resolved: false,\n loading: true,\n data: {},\n resolvers: [{ resolve, reject }],\n });\n this.queries.set(serviceClientQueryType, queries);\n\n return this.runQuery(serviceClientQueryType, params);\n }\n }).then((res) => deepClone(res));\n }\n\n // query the cached data\n public read(\n type: DataType,\n options: {\n select?: (data: any) => any; // either return all data by the DataType, or use an selector\n }\n ) {\n const { select } = options;\n const serviceClientQueryType = determineServiceClientQueryType(type);\n const queries = this.queries.get(serviceClientQueryType) || [];\n\n const result = queries.reduce<any[]>((acc, query) => {\n if (typeof select === 'function') {\n const match = select(query.data);\n if (match) {\n acc.push(match);\n }\n } else {\n acc.push(query.data);\n }\n return acc;\n }, []);\n return result;\n }\n\n public feedback(id: string, connection: string, feedback: FeedbackType): Promise<any> {\n return this.matchingClient.giveFeedback(id, connection, feedback);\n }\n\n private setLoadingStatus(\n type: ServiceClientQueryType,\n params: QueryParameters,\n loading: boolean\n ) {\n const queries = this.queries.get(type) || [];\n const query = queries.find((q) => shallowCompare(q.params, params));\n\n if (query) {\n query.loading = loading;\n }\n this.queries.set(type, queries);\n }\n\n private async runQuery(type: ServiceClientQueryType, params: QueryParameters) {\n const {\n searchPhrase = '',\n categories = '0',\n contactMethodCategoryId = '0',\n contactMethodId = '0',\n tagId = undefined,\n take = 5,\n connection = '',\n guideId,\n expandCategories = 'descendants',\n currentCategory,\n sorting = SortingType.POPULARITY_DESCENDING,\n guideIds = [],\n } = params;\n\n const trimmedPhrase = searchPhrase.toString().trim();\n if (await widgetIsHidden(this.container)) {\n return Promise.resolve();\n }\n\n switch (type) {\n case ServiceClientQueryType.Match: {\n const formatSortingValues = (sorting: string) => {\n const [type, direction] = sorting.split('-');\n const sortKeysMap = new Map([\n ['popularity', 'popularity'],\n ['alphabetic', 'title'],\n ['modified', 'lastModified'],\n ['published', 'firstPublished'],\n ]);\n\n return {\n type: sortKeysMap.get(type),\n direction: direction,\n };\n };\n\n if (guideIds.length) {\n return this.matchingClient\n .customRequest('guides', 'POST', {\n configuration: { ids: guideIds, take: +take },\n })\n .then((matches) => matches && this.handleResponse(matches, type, params));\n }\n\n return this.matchingClient\n .match(trimmedPhrase, {\n categories:\n categories === '0'\n ? []\n : Array.isArray(categories)\n ? categories\n : [+categories],\n take: +take,\n tags: tagId,\n sorting: formatSortingValues(sorting),\n ids: guideIds,\n })\n .then((matches) => matches && this.handleResponse(matches, type, params));\n }\n case ServiceClientQueryType.MatchByCategory: {\n return this.matchingClient\n .match(trimmedPhrase, {\n groupByCategory: true,\n categories:\n categories === '0'\n ? []\n : Array.isArray(categories)\n ? categories\n : [+categories],\n take: +take,\n tags: tagId,\n })\n .then((matches) => matches && this.handleResponse(matches, type, params));\n }\n case ServiceClientQueryType.Guide: {\n return this.matchingClient\n .getGuide(guideId, { connectionId: connection })\n .then((guide) => {\n if (guide) {\n this.handleResponse(guide, type, params);\n }\n })\n .catch((e) => {\n const error = {\n message: 'Something went wrong.',\n status: e.status || 400,\n };\n if (error.status === 404) {\n error.message = 'The guide could not be found.';\n }\n this.handleResponse({}, type, params, error);\n });\n }\n case ServiceClientQueryType.Categories: {\n return this.matchingClient\n .getCategories({ phrase: trimmedPhrase, expand: expandCategories, tags: tagId })\n .then(\n (categories) => categories && this.handleResponse(categories, type, params)\n );\n }\n case ServiceClientQueryType.Contacts: {\n if (guideId) {\n return this.matchingClient\n .contactMethods(+guideId, { phrase: trimmedPhrase })\n .then((result) => result && this.handleResponse(result, type, params));\n }\n return this.matchingClient\n .contacts(+contactMethodCategoryId, { phrase: trimmedPhrase })\n .then((result) => result && this.handleResponse(result, type, params));\n }\n case ServiceClientQueryType.ContactMethod: {\n return this.matchingClient\n .getContactMethod(+contactMethodId, { guideId, currentCategory })\n .then((result) => result && this.handleResponse(result, type, params));\n }\n case ServiceClientQueryType.Tags: {\n return this.matchingClient\n .customRequest('tags', 'GET', {\n configuration: {\n take: 999999,\n phrase: trimmedPhrase,\n categories:\n categories === '0'\n ? []\n : Array.isArray(categories)\n ? categories\n : [+categories],\n },\n })\n .then((result) => result && this.handleResponse(result, type, params));\n }\n case ServiceClientQueryType.TagsOnGuides: {\n return this.matchingClient\n .customRequest('tagsonguides', 'GET', {\n configuration: {\n take: 999999,\n phrase: trimmedPhrase,\n categories:\n categories === '0'\n ? []\n : Array.isArray(categories)\n ? categories\n : [+categories],\n tags: tagId,\n },\n })\n .then((result) => result && this.handleResponse(result, type, params));\n }\n case ServiceClientQueryType.Notifications: {\n return this.matchingClient\n .customRequest('notices', 'GET', {\n configuration: {\n phrase: trimmedPhrase,\n categories:\n categories === '0'\n ? []\n : Array.isArray(categories)\n ? categories\n : [+categories],\n },\n })\n .then((result) => result && this.handleResponse(result, type, params));\n }\n }\n }\n\n handleResponse(\n data: any = {},\n type: ServiceClientQueryType,\n params: QueryParameters,\n error?: DataError\n ) {\n const queries = this.queries.get(type) || [];\n const existing = queries.find((q) => shallowCompare(q.params, params));\n if (existing) {\n const formatted = error ? error : formatLegacyData(type, data);\n this.track(formatted, type, error);\n existing.resolvers.forEach((r) => {\n if (error) {\n r.reject({ error: formatted });\n } else {\n r.resolve(formatted);\n }\n });\n\n const index = queries.indexOf(existing);\n if (index > -1) {\n queries.splice(index, 1);\n }\n queries.push({ ...existing, error, resolvers: [], data: formatted, resolved: true });\n this.setLoadingStatus(type, params, false);\n this.queries.set(type, queries);\n if (!error) {\n this.events.dispatch('data-client:fetched', {\n type,\n params,\n response: formatted,\n unresolvedQueries: this.getUnresolvedQueries(),\n });\n }\n }\n }\n\n private fetchAllUnresolvedQueries() {\n for (const [queryType, queries] of this.queries) {\n queries\n .filter((query: Query) => !query.resolved)\n .forEach((query) => {\n this.runQuery(queryType, query.params);\n });\n }\n }\n\n private track(data: any = {}, type: ServiceClientQueryType, error?: DataError) {\n const widget = this.container.get('$widget');\n if (widget && !error) {\n widget.events.dispatch('tracking:service-client-response', {\n type,\n data,\n });\n } else if (widget) {\n widget.events.dispatch('tracking:service-client-error', {\n type,\n error,\n });\n }\n }\n\n static create(container: Container): Promise<DataClient> {\n return container\n .getAsync('matchingClient')\n .then((matchingClient) => new DataClient(container, matchingClient));\n }\n}\n","import { WidgetSettings } from '@telia-ace/knowledge-widget-core';\nimport { Container, Widget } from '@webprovisions/platform';\n\nexport const createContactMethodPlatform = (container: Container) => {\n return import('@telia-ace/knowledge-widget-adapters').then(({ ContactMethodPlatform }) => {\n return ContactMethodPlatform.create(container);\n });\n};\n\nexport const createDataClient = (container: Container) => {\n return import('../data').then(({ DataClient }) => {\n return DataClient.create(container);\n });\n};\n\nexport const createServiceClient = (container: Container) => {\n return import('@telia-ace/knowledge-serviceclient').then(({ ServiceClient, ServiceProxy }) => {\n return container.get('settings').then((settings: WidgetSettings) => {\n const { name, events }: Widget = container.get('$widget');\n const {\n data: { projection = '', site = 'current', forceHttps = false },\n } = settings;\n\n const proxy = new ServiceProxy(projection, { credentials: 'same-origin' });\n\n // Replacing '_contact' & '_contact-method' while\n // still using the shadow widget concept\n const client = new ServiceClient(\n proxy,\n {\n funnel: name.replace('_contact-method', '').replace('_contact', ''),\n site: createSiteProvider(site, forceHttps),\n },\n null,\n container\n );\n\n events.subscribe('widget:settings-updated', (event, { data }: WidgetSettings) => {\n if (data && data.projection !== projection) {\n client.proxy.setBaseUrl(data.projection);\n }\n });\n\n return client;\n });\n });\n};\n\ntype SiteLocation = {\n host: string;\n pathname: string;\n};\n\nconst createSiteProvider = (site: 'current' | 'referrer', forceHttps: boolean): (() => string) => {\n return () => {\n const parseLocation = (href: string): SiteLocation => {\n const link = document.createElement('a');\n link.href = href;\n return link;\n };\n\n let location: SiteLocation = window.location;\n if (site === 'referrer' && document.referrer) {\n location = parseLocation(document.referrer);\n }\n return [forceHttps ? 'https:' : '', '//', location.host, location.pathname].join('');\n };\n};\n","import { Widget } from '@telia-ace/widget-types-grid';\nimport { Container } from '@webprovisions/platform';\nimport { createContactMethodPlatform, createDataClient, createServiceClient } from './services';\n\nexport default class ExtendedWidget extends Widget {\n constructor(container: Container) {\n super(container);\n\n this.container.registerAsync('matchingClient', () => createServiceClient(this.container));\n this.container.registerAsync('contactMethods', () =>\n createContactMethodPlatform(this.container)\n );\n this.container.registerAsync('dataClient', () => createDataClient(this.container));\n }\n}\n"],"names":["convertLegacySymbol","symbol","Type","Content","mapLegacyCategoriesRecursively","categories","c","category","mapNotices","source","type","Id","Title","Body","mapNotificationLists","DefaultIcon","ListNotices","Notices","Modified","mapContactMethodSettings","Exit","ExitType","ConfirmationText","ExpandFormAutomatically","Form","Description","Validation","Adapter","ClientName","Settings","CustomClientName","settings","displayTextBeforeClick","textBeforeClick","FormBuilder","mapTags","tags","TotalMatches","Symbol","ActiveIcon","mapGuides","guides","Tags","FirstPublishedDate","formatLegacyData","data","ServiceClientQueryType","result","Matches","NoticeLists","ByCategory","Children","GuidesCountTotal","Related","Options","ConnectionId","ContactMethods","EnableFeedback","HandoverExists","ModifiedByDisplayName","FirstPublishedByDisplayName","Categories","SeoMetaDescription","SeoAllowIndex","Perspectives","PerspectiveKey","Translations","perspective","connection","acc","key","cm","CanAccess","Properties","item","DialogItemType","ContactMethod","DataType","FeedbackType","SortingType","determineServiceClientQueryType","widgetIsHidden","container","__async","invoke","WidgetRenderState","DataClient","matchingClient","__publicField","unresolvedCount","queries","query","event","next","previous","params","resolve","reject","removeNullAndUndefinedValues","serviceClientQueryType","q","shallowCompare","index","res","deepClone","options","select","match","id","feedback","loading","searchPhrase","contactMethodCategoryId","contactMethodId","tagId","take","guideId","expandCategories","currentCategory","sorting","guideIds","trimmedPhrase","formatSortingValues","direction","matches","guide","e","error","existing","formatted","r","__spreadProps","__spreadValues","queryType","widget","createContactMethodPlatform","ContactMethodPlatform","createDataClient","createServiceClient","ServiceClient","ServiceProxy","name","events","projection","site","forceHttps","proxy","client","createSiteProvider","parseLocation","href","link","location","ExtendedWidget","Widget"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2FA,MAAMA,IAAsB,CAACC,MAAmE;AAC5F,MAAIA,GAAQ;AACF,UAAA,EAAE,MAAAC,GAAM,SAAA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AAkB,MAAMwD,GAAoB,KAAK,SAAS,CAAC,GACxF,KAAK,UAAU;AAAA,MAAc;AAAA,MAAkB,MAC3CH,GAA4B,KAAK,SAAS;AAAA,IAAA,GAE9C,KAAK,UAAU,cAAc,cAAc,MAAME,GAAiB,KAAK,SAAS,CAAC;AAAA,EACrF;AACJ;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { Container } from '@webprovisions/platform';
|
|
2
2
|
export declare const createContactMethodPlatform: (container: Container) => Promise<import("@telia-ace/knowledge-widget-adapters/dist/contact-methods/platform").default>;
|
|
3
3
|
export declare const createDataClient: (container: Container) => Promise<import("../data").DataClient>;
|
|
4
|
+
export declare const createServiceClient: (container: Container) => Promise<any>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telia-ace/knowledge-widget-types-grid",
|
|
3
|
-
"version": "1.0.31-next.
|
|
3
|
+
"version": "1.0.31-next.9",
|
|
4
4
|
"description": "Extended type definition for Grid widget.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"author": "Telia Company AB",
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
},
|
|
27
27
|
"sideEffects": false,
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@telia-ace/knowledge-serviceclient": "next",
|
|
30
|
-
"@telia-ace/knowledge-widget-adapters": "^1.0.30-next.
|
|
31
|
-
"@telia-ace/knowledge-widget-core": "^1.0.20-next.
|
|
29
|
+
"@telia-ace/knowledge-serviceclient": "^1.0.9-next.4",
|
|
30
|
+
"@telia-ace/knowledge-widget-adapters": "^1.0.30-next.9",
|
|
31
|
+
"@telia-ace/knowledge-widget-core": "^1.0.20-next.9",
|
|
32
32
|
"@telia-ace/widget-forms": "next",
|
|
33
33
|
"@telia-ace/widget-types-grid": "next",
|
|
34
34
|
"@telia-ace/widget-utilities": "next",
|
|
35
35
|
"@webprovisions/platform": "^1.1.2"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "f91538e9510f88a02bc0c392ed6d01417eb8a060"
|
|
38
38
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.0c114c82.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|