@telia-ace/knowledge-data-client-flamingo 1.0.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.
- package/LICENSE.txt +0 -0
- package/README.md +3 -0
- package/dist/create-serviceclient.d.ts +3 -0
- package/dist/create-serviceclient.d.ts.map +1 -0
- package/dist/data-client.d.ts +94 -0
- package/dist/data-client.d.ts.map +1 -0
- package/dist/index-d70f1e69.js +884 -0
- package/dist/index-d70f1e69.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1769 -0
- package/dist/index.js.map +1 -0
- package/dist/legacy-conversion.d.ts +72 -0
- package/dist/legacy-conversion.d.ts.map +1 -0
- package/package.json +40 -0
package/LICENSE.txt
ADDED
|
File without changes
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-serviceclient.d.ts","sourceRoot":"","sources":["../src/create-serviceclient.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAU,MAAM,yBAAyB,CAAC;AAE5D,eAAO,MAAM,mBAAmB,cAAe,SAAS,iBAmCvD,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { ServiceClient } from '@telia-ace/knowledge-serviceclient';
|
|
2
|
+
import { Container, EventManager } from '@webprovisions/platform';
|
|
3
|
+
export 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 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 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 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
|
+
events: EventManager;
|
|
76
|
+
constructor(container: Container, matchingClient: ServiceClient);
|
|
77
|
+
static getInstance(container: Container, key?: string): Promise<DataClient>;
|
|
78
|
+
private getUnresolvedQueries;
|
|
79
|
+
fetch(type: DataType, params: QueryParameters, options?: {
|
|
80
|
+
noCache: boolean;
|
|
81
|
+
}): Promise<any>;
|
|
82
|
+
read(type: DataType, options: {
|
|
83
|
+
select?: (data: any) => any;
|
|
84
|
+
}): any[];
|
|
85
|
+
feedback(id: string, connection: string, feedback: FeedbackType): Promise<any>;
|
|
86
|
+
private setLoadingStatus;
|
|
87
|
+
private runQuery;
|
|
88
|
+
handleResponse(data: any, type: ServiceClientQueryType, params: QueryParameters, error?: DataError): void;
|
|
89
|
+
private fetchAllUnresolvedQueries;
|
|
90
|
+
private track;
|
|
91
|
+
static create(container: Container): Promise<DataClient>;
|
|
92
|
+
getClient(): ServiceClient;
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=data-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-client.d.ts","sourceRoot":"","sources":["../src/data-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAQnE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAU,MAAM,yBAAyB,CAAC;AAI1E,MAAM,MAAM,UAAU,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;AAElD,oBAAY,QAAQ;IAClB,KAAK,U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