@telia-ace/knowledge-widget-types-grid 1.0.13 → 1.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +5 -5
- package/README.md +4 -4
- package/{lib-esm → dist}/data/data-client.d.ts +91 -91
- package/{lib → dist}/data/index.d.ts +3 -3
- package/{lib-esm → dist}/data/legacy-conversion.d.ts +75 -75
- package/{lib-esm → dist}/index.d.ts +3 -3
- package/dist/index.js +686 -0
- package/dist/index.js.map +1 -0
- package/dist/index2.js +6 -0
- package/dist/index2.js.map +1 -0
- package/{lib-esm → dist}/widget/extended-widget.d.ts +5 -5
- package/{lib → dist}/widget/index.d.ts +1 -1
- package/{lib-esm → dist}/widget/services.d.ts +3 -3
- package/package.json +14 -15
- package/lib/data/data-client.d.ts +0 -91
- package/lib/data/data-client.js +0 -504
- package/lib/data/index.js +0 -24
- package/lib/data/legacy-conversion.d.ts +0 -75
- package/lib/data/legacy-conversion.js +0 -308
- package/lib/index.d.ts +0 -3
- package/lib/index.js +0 -25
- package/lib/widget/extended-widget.d.ts +0 -5
- package/lib/widget/extended-widget.js +0 -32
- package/lib/widget/index.js +0 -8
- package/lib/widget/services.d.ts +0 -3
- package/lib/widget/services.js +0 -40
- package/lib-esm/data/data-client.js +0 -500
- package/lib-esm/data/index.d.ts +0 -3
- package/lib-esm/data/index.js +0 -3
- package/lib-esm/data/legacy-conversion.js +0 -304
- package/lib-esm/index.js +0 -3
- package/lib-esm/widget/extended-widget.js +0 -30
- package/lib-esm/widget/index.d.ts +0 -1
- package/lib-esm/widget/index.js +0 -1
- package/lib-esm/widget/services.js +0 -12
package/LICENSE.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Copyright © 2021, Telia Company AB. All rights reserved.
|
|
2
|
-
|
|
3
|
-
THIS PACKAGE AND CONTAINING SOFTWARE IS PART OF
|
|
4
|
-
THE HUMANY SERVICE. BY USING THIS SOFTWARE YOU
|
|
5
|
-
AGREE TO THE FOLLOWING TERMS AND CONDITIONS:
|
|
1
|
+
Copyright © 2021, Telia Company AB. All rights reserved.
|
|
2
|
+
|
|
3
|
+
THIS PACKAGE AND CONTAINING SOFTWARE IS PART OF
|
|
4
|
+
THE HUMANY SERVICE. BY USING THIS SOFTWARE YOU
|
|
5
|
+
AGREE TO THE FOLLOWING TERMS AND CONDITIONS:
|
|
6
6
|
http://www.humany.com/legal
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# `@telia-ace/knowledge-widget-types-grid`
|
|
2
|
-
|
|
3
|
-
Extended type definition for ACE One Widget (exported as `GridWidget`).
|
|
4
|
-
Adds DataClient and ContactMethodPlatform to the grid widget type.
|
|
1
|
+
# `@telia-ace/knowledge-widget-types-grid`
|
|
2
|
+
|
|
3
|
+
Extended type definition for ACE One Widget (exported as `GridWidget`).
|
|
4
|
+
Adds DataClient and ContactMethodPlatform to the grid widget type.
|
|
@@ -1,91 +1,91 @@
|
|
|
1
|
-
import { ServiceClient } from '@telia-ace/knowledge-serviceclient';
|
|
2
|
-
import { Container, EventManager } from '@webprovisions/platform';
|
|
3
|
-
export declare type Subscriber = (...args: any[]) => void;
|
|
4
|
-
export declare enum DataType {
|
|
5
|
-
Guide = "guide",
|
|
6
|
-
Guides = "guides",
|
|
7
|
-
GuidesByCategory = "guides-by-category",
|
|
8
|
-
RowNotifications = "row-notices",
|
|
9
|
-
NotificationLists = "notification-lists",
|
|
10
|
-
GuideCategories = "guide-categories",
|
|
11
|
-
ContactMethodCategories = "contact-method-categories",
|
|
12
|
-
ContactMethod = "contact-method",
|
|
13
|
-
ContactMethods = "contact-methods",
|
|
14
|
-
Tags = "tags",
|
|
15
|
-
TagsOnGuides = "tagsonguides"
|
|
16
|
-
}
|
|
17
|
-
export declare type DataError = {
|
|
18
|
-
status: number;
|
|
19
|
-
message: string;
|
|
20
|
-
};
|
|
21
|
-
export declare enum ServiceClientQueryType {
|
|
22
|
-
Match = "match",
|
|
23
|
-
Categories = "categories",
|
|
24
|
-
Guide = "guide",
|
|
25
|
-
Contacts = "contacts",
|
|
26
|
-
ContactMethod = "contact-method",
|
|
27
|
-
MatchByCategory = "match-by-category",
|
|
28
|
-
Tags = "tags",
|
|
29
|
-
TagsOnGuides = "tagsonguides",
|
|
30
|
-
Notifications = "notifications"
|
|
31
|
-
}
|
|
32
|
-
export declare enum FeedbackType {
|
|
33
|
-
Positive = "Positive",
|
|
34
|
-
Negative = "Negative"
|
|
35
|
-
}
|
|
36
|
-
export declare type QueryParameters = {
|
|
37
|
-
guideId?: string | number;
|
|
38
|
-
categories?: string | number | string[] | number[];
|
|
39
|
-
tagId?: string | number;
|
|
40
|
-
connection?: string;
|
|
41
|
-
contactMethodCategoryId?: string | number;
|
|
42
|
-
contactMethodId?: string | number;
|
|
43
|
-
searchPhrase?: string | number;
|
|
44
|
-
take?: string | number;
|
|
45
|
-
[key: string]: any;
|
|
46
|
-
expandCategories?: 'none' | 'children' | 'descendants';
|
|
47
|
-
sorting?: SortingType;
|
|
48
|
-
guideIds?: string[];
|
|
49
|
-
};
|
|
50
|
-
export declare enum SortingType {
|
|
51
|
-
POPULARITY_DESCENDING = "popularity-descending",
|
|
52
|
-
ALPHABETIC_ASCENDING = "alphabetic-ascending",
|
|
53
|
-
ALPHABETIC_DESCENDING = "alphabetic-descending",
|
|
54
|
-
MODIFIED_ASCENDING = "modified-ascending",
|
|
55
|
-
MODIFIED_DESCENDING = "modified-descending",
|
|
56
|
-
PUBLISHED_ASCENDING = "published-ascending",
|
|
57
|
-
PUBLISHED_DESCENDING = "published-descending"
|
|
58
|
-
}
|
|
59
|
-
export declare type Query = {
|
|
60
|
-
params: QueryParameters;
|
|
61
|
-
resolved: boolean;
|
|
62
|
-
loading: boolean;
|
|
63
|
-
error?: DataError;
|
|
64
|
-
data: any;
|
|
65
|
-
resolvers: {
|
|
66
|
-
resolve: (data: any) => void;
|
|
67
|
-
reject: (data: any) => void;
|
|
68
|
-
}[];
|
|
69
|
-
};
|
|
70
|
-
export declare const determineServiceClientQueryType: (type: DataType) => ServiceClientQueryType;
|
|
71
|
-
export default class DataClient {
|
|
72
|
-
private container;
|
|
73
|
-
private matchingClient;
|
|
74
|
-
private queries;
|
|
75
|
-
private lastTake;
|
|
76
|
-
events: EventManager;
|
|
77
|
-
constructor(container: Container, matchingClient: ServiceClient);
|
|
78
|
-
static getInstance(container: Container): Promise<DataClient>;
|
|
79
|
-
private getUnresolvedQueries;
|
|
80
|
-
fetch(type: DataType, params: QueryParameters): Promise<any>;
|
|
81
|
-
read(type: DataType, options: {
|
|
82
|
-
select?: (data: any) => any;
|
|
83
|
-
}): any[];
|
|
84
|
-
feedback(id: string, connection: string, feedback: FeedbackType): Promise<any>;
|
|
85
|
-
private setLoadingStatus;
|
|
86
|
-
private runQuery;
|
|
87
|
-
handleResponse(data: any, type: ServiceClientQueryType, params: QueryParameters, error?: DataError): void;
|
|
88
|
-
private fetchAllUnresolvedQueries;
|
|
89
|
-
private track;
|
|
90
|
-
static create(container: Container): Promise<DataClient>;
|
|
91
|
-
}
|
|
1
|
+
import { ServiceClient } from '@telia-ace/knowledge-serviceclient';
|
|
2
|
+
import { Container, EventManager } from '@webprovisions/platform';
|
|
3
|
+
export declare type Subscriber = (...args: any[]) => void;
|
|
4
|
+
export declare enum DataType {
|
|
5
|
+
Guide = "guide",
|
|
6
|
+
Guides = "guides",
|
|
7
|
+
GuidesByCategory = "guides-by-category",
|
|
8
|
+
RowNotifications = "row-notices",
|
|
9
|
+
NotificationLists = "notification-lists",
|
|
10
|
+
GuideCategories = "guide-categories",
|
|
11
|
+
ContactMethodCategories = "contact-method-categories",
|
|
12
|
+
ContactMethod = "contact-method",
|
|
13
|
+
ContactMethods = "contact-methods",
|
|
14
|
+
Tags = "tags",
|
|
15
|
+
TagsOnGuides = "tagsonguides"
|
|
16
|
+
}
|
|
17
|
+
export declare type DataError = {
|
|
18
|
+
status: number;
|
|
19
|
+
message: string;
|
|
20
|
+
};
|
|
21
|
+
export declare enum ServiceClientQueryType {
|
|
22
|
+
Match = "match",
|
|
23
|
+
Categories = "categories",
|
|
24
|
+
Guide = "guide",
|
|
25
|
+
Contacts = "contacts",
|
|
26
|
+
ContactMethod = "contact-method",
|
|
27
|
+
MatchByCategory = "match-by-category",
|
|
28
|
+
Tags = "tags",
|
|
29
|
+
TagsOnGuides = "tagsonguides",
|
|
30
|
+
Notifications = "notifications"
|
|
31
|
+
}
|
|
32
|
+
export declare enum FeedbackType {
|
|
33
|
+
Positive = "Positive",
|
|
34
|
+
Negative = "Negative"
|
|
35
|
+
}
|
|
36
|
+
export declare type QueryParameters = {
|
|
37
|
+
guideId?: string | number;
|
|
38
|
+
categories?: string | number | string[] | number[];
|
|
39
|
+
tagId?: string | number;
|
|
40
|
+
connection?: string;
|
|
41
|
+
contactMethodCategoryId?: string | number;
|
|
42
|
+
contactMethodId?: string | number;
|
|
43
|
+
searchPhrase?: string | number;
|
|
44
|
+
take?: string | number;
|
|
45
|
+
[key: string]: any;
|
|
46
|
+
expandCategories?: 'none' | 'children' | 'descendants';
|
|
47
|
+
sorting?: SortingType;
|
|
48
|
+
guideIds?: string[];
|
|
49
|
+
};
|
|
50
|
+
export declare enum SortingType {
|
|
51
|
+
POPULARITY_DESCENDING = "popularity-descending",
|
|
52
|
+
ALPHABETIC_ASCENDING = "alphabetic-ascending",
|
|
53
|
+
ALPHABETIC_DESCENDING = "alphabetic-descending",
|
|
54
|
+
MODIFIED_ASCENDING = "modified-ascending",
|
|
55
|
+
MODIFIED_DESCENDING = "modified-descending",
|
|
56
|
+
PUBLISHED_ASCENDING = "published-ascending",
|
|
57
|
+
PUBLISHED_DESCENDING = "published-descending"
|
|
58
|
+
}
|
|
59
|
+
export declare type Query = {
|
|
60
|
+
params: QueryParameters;
|
|
61
|
+
resolved: boolean;
|
|
62
|
+
loading: boolean;
|
|
63
|
+
error?: DataError;
|
|
64
|
+
data: any;
|
|
65
|
+
resolvers: {
|
|
66
|
+
resolve: (data: any) => void;
|
|
67
|
+
reject: (data: any) => void;
|
|
68
|
+
}[];
|
|
69
|
+
};
|
|
70
|
+
export declare const determineServiceClientQueryType: (type: DataType) => ServiceClientQueryType;
|
|
71
|
+
export default class DataClient {
|
|
72
|
+
private container;
|
|
73
|
+
private matchingClient;
|
|
74
|
+
private queries;
|
|
75
|
+
private lastTake;
|
|
76
|
+
events: EventManager;
|
|
77
|
+
constructor(container: Container, matchingClient: ServiceClient);
|
|
78
|
+
static getInstance(container: Container): Promise<DataClient>;
|
|
79
|
+
private getUnresolvedQueries;
|
|
80
|
+
fetch(type: DataType, params: QueryParameters): Promise<any>;
|
|
81
|
+
read(type: DataType, options: {
|
|
82
|
+
select?: (data: any) => any;
|
|
83
|
+
}): any[];
|
|
84
|
+
feedback(id: string, connection: string, feedback: FeedbackType): Promise<any>;
|
|
85
|
+
private setLoadingStatus;
|
|
86
|
+
private runQuery;
|
|
87
|
+
handleResponse(data: any, type: ServiceClientQueryType, params: QueryParameters, error?: DataError): void;
|
|
88
|
+
private fetchAllUnresolvedQueries;
|
|
89
|
+
private track;
|
|
90
|
+
static create(container: Container): Promise<DataClient>;
|
|
91
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './data-client';
|
|
2
|
-
export { default as DataClient } from './data-client';
|
|
3
|
-
export * from './legacy-conversion';
|
|
1
|
+
export * from './data-client';
|
|
2
|
+
export { default as DataClient } from './data-client';
|
|
3
|
+
export * from './legacy-conversion';
|
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
import { ContactMethodType as ContactMethod } from '@telia-ace/knowledge-widget-adapters';
|
|
2
|
-
import { Category, DialogItem, Guide, Notification, NotificationList, Tag } from '@telia-ace/knowledge-widget-core';
|
|
3
|
-
import { DataError, ServiceClientQueryType } from './data-client';
|
|
4
|
-
export declare type MatchResult = {
|
|
5
|
-
guides: Guide[];
|
|
6
|
-
matches: number;
|
|
7
|
-
topNotifications: Notification[];
|
|
8
|
-
middleNotifications: Notification[];
|
|
9
|
-
bottomNotifications: Notification[];
|
|
10
|
-
notificationLists: NotificationList[];
|
|
11
|
-
tags: Tag[];
|
|
12
|
-
byCategory: {
|
|
13
|
-
id: string;
|
|
14
|
-
guides: Guide[];
|
|
15
|
-
matches: number;
|
|
16
|
-
}[];
|
|
17
|
-
};
|
|
18
|
-
export declare type TagsResult = Tag[];
|
|
19
|
-
export declare type CategoriesResult = {
|
|
20
|
-
categories: Category[];
|
|
21
|
-
matches: number;
|
|
22
|
-
};
|
|
23
|
-
export declare type NotificationResults = Pick<MatchResult, 'topNotifications' | 'middleNotifications' | 'bottomNotifications' | 'notificationLists'>;
|
|
24
|
-
export declare type GuideResult = {
|
|
25
|
-
guide: {
|
|
26
|
-
id: string;
|
|
27
|
-
title: string;
|
|
28
|
-
body: string;
|
|
29
|
-
modified: string;
|
|
30
|
-
modifiedBy: string | null;
|
|
31
|
-
publishedBy: string | null;
|
|
32
|
-
published: string;
|
|
33
|
-
connection: string;
|
|
34
|
-
categories: number[];
|
|
35
|
-
hasHandover: boolean;
|
|
36
|
-
allowFeedback: boolean;
|
|
37
|
-
seoMetaDescription: string | null;
|
|
38
|
-
seoAllowIndex: boolean | null;
|
|
39
|
-
perspective: string | null;
|
|
40
|
-
perspectives: {
|
|
41
|
-
[key: string]: string;
|
|
42
|
-
};
|
|
43
|
-
translations?: {
|
|
44
|
-
[key: string]: string;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
related: Guide[];
|
|
48
|
-
dialog: DialogItem[];
|
|
49
|
-
contactMethods: ContactMethod[];
|
|
50
|
-
tags: Tag[];
|
|
51
|
-
error?: DataError;
|
|
52
|
-
};
|
|
53
|
-
export declare type ContactsResult = {
|
|
54
|
-
categories: Category[];
|
|
55
|
-
contactMethods: ContactMethod[];
|
|
56
|
-
topNotifications: Notification[];
|
|
57
|
-
middleNotifications: Notification[];
|
|
58
|
-
bottomNotifications: Notification[];
|
|
59
|
-
notificationLists: NotificationList[];
|
|
60
|
-
};
|
|
61
|
-
export declare type SubmissionResult = {
|
|
62
|
-
contactMethod?: ContactMethod;
|
|
63
|
-
valid: boolean;
|
|
64
|
-
};
|
|
65
|
-
export declare const formatLegacyData: (type: ServiceClientQueryType, data: any) => Tag[] | MatchResult | CategoriesResult | ContactMethod | GuideResult | ContactsResult | {
|
|
66
|
-
topNotifications: Notification[];
|
|
67
|
-
middleNotifications: Notification[];
|
|
68
|
-
bottomNotifications: Notification[];
|
|
69
|
-
notificationLists: NotificationList[];
|
|
70
|
-
} | {
|
|
71
|
-
topNotifications?: undefined;
|
|
72
|
-
middleNotifications?: undefined;
|
|
73
|
-
bottomNotifications?: undefined;
|
|
74
|
-
notificationLists?: undefined;
|
|
75
|
-
};
|
|
1
|
+
import { ContactMethodType as ContactMethod } from '@telia-ace/knowledge-widget-adapters';
|
|
2
|
+
import { Category, DialogItem, Guide, Notification, NotificationList, Tag } from '@telia-ace/knowledge-widget-core';
|
|
3
|
+
import { DataError, ServiceClientQueryType } from './data-client';
|
|
4
|
+
export declare type MatchResult = {
|
|
5
|
+
guides: Guide[];
|
|
6
|
+
matches: number;
|
|
7
|
+
topNotifications: Notification[];
|
|
8
|
+
middleNotifications: Notification[];
|
|
9
|
+
bottomNotifications: Notification[];
|
|
10
|
+
notificationLists: NotificationList[];
|
|
11
|
+
tags: Tag[];
|
|
12
|
+
byCategory: {
|
|
13
|
+
id: string;
|
|
14
|
+
guides: Guide[];
|
|
15
|
+
matches: number;
|
|
16
|
+
}[];
|
|
17
|
+
};
|
|
18
|
+
export declare type TagsResult = Tag[];
|
|
19
|
+
export declare type CategoriesResult = {
|
|
20
|
+
categories: Category[];
|
|
21
|
+
matches: number;
|
|
22
|
+
};
|
|
23
|
+
export declare type NotificationResults = Pick<MatchResult, 'topNotifications' | 'middleNotifications' | 'bottomNotifications' | 'notificationLists'>;
|
|
24
|
+
export declare type GuideResult = {
|
|
25
|
+
guide: {
|
|
26
|
+
id: string;
|
|
27
|
+
title: string;
|
|
28
|
+
body: string;
|
|
29
|
+
modified: string;
|
|
30
|
+
modifiedBy: string | null;
|
|
31
|
+
publishedBy: string | null;
|
|
32
|
+
published: string;
|
|
33
|
+
connection: string;
|
|
34
|
+
categories: number[];
|
|
35
|
+
hasHandover: boolean;
|
|
36
|
+
allowFeedback: boolean;
|
|
37
|
+
seoMetaDescription: string | null;
|
|
38
|
+
seoAllowIndex: boolean | null;
|
|
39
|
+
perspective: string | null;
|
|
40
|
+
perspectives: {
|
|
41
|
+
[key: string]: string;
|
|
42
|
+
};
|
|
43
|
+
translations?: {
|
|
44
|
+
[key: string]: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
related: Guide[];
|
|
48
|
+
dialog: DialogItem[];
|
|
49
|
+
contactMethods: ContactMethod[];
|
|
50
|
+
tags: Tag[];
|
|
51
|
+
error?: DataError;
|
|
52
|
+
};
|
|
53
|
+
export declare type ContactsResult = {
|
|
54
|
+
categories: Category[];
|
|
55
|
+
contactMethods: ContactMethod[];
|
|
56
|
+
topNotifications: Notification[];
|
|
57
|
+
middleNotifications: Notification[];
|
|
58
|
+
bottomNotifications: Notification[];
|
|
59
|
+
notificationLists: NotificationList[];
|
|
60
|
+
};
|
|
61
|
+
export declare type SubmissionResult = {
|
|
62
|
+
contactMethod?: ContactMethod;
|
|
63
|
+
valid: boolean;
|
|
64
|
+
};
|
|
65
|
+
export declare const formatLegacyData: (type: ServiceClientQueryType, data: any) => Tag[] | MatchResult | CategoriesResult | ContactMethod | GuideResult | ContactsResult | {
|
|
66
|
+
topNotifications: Notification[];
|
|
67
|
+
middleNotifications: Notification[];
|
|
68
|
+
bottomNotifications: Notification[];
|
|
69
|
+
notificationLists: NotificationList[];
|
|
70
|
+
} | {
|
|
71
|
+
topNotifications?: undefined;
|
|
72
|
+
middleNotifications?: undefined;
|
|
73
|
+
bottomNotifications?: undefined;
|
|
74
|
+
notificationLists?: undefined;
|
|
75
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { Component, DetachedComponent, genericComponentStyling, NotFound, } from '@telia-ace/widget-types-grid';
|
|
2
|
-
export * from './data';
|
|
3
|
-
export { GridWidget } from './widget';
|
|
1
|
+
export { Component, DetachedComponent, genericComponentStyling, NotFound, } from '@telia-ace/widget-types-grid';
|
|
2
|
+
export * from './data';
|
|
3
|
+
export { GridWidget } from './widget';
|