@uniformdev/search 0.0.2 → 0.0.4
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/README.md +12 -0
- package/dist/client-DOew5kqb.d.mts +99 -0
- package/dist/client-DOew5kqb.d.ts +99 -0
- package/dist/index.d.mts +18 -3
- package/dist/index.d.ts +18 -3
- package/dist/index.js +48 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +47 -2
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +10 -1
- package/dist/react.d.ts +10 -1
- package/dist/react.js +41 -11
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +41 -11
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/client-CtTcEJUy.d.mts +0 -73
- package/dist/client-CtTcEJUy.d.ts +0 -73
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
type SearchCollection = 'entries' | 'compositions' | 'assets';
|
|
2
|
-
type SearchHit = {
|
|
3
|
-
id: string;
|
|
4
|
-
_collection: SearchCollection;
|
|
5
|
-
[key: string]: unknown;
|
|
6
|
-
};
|
|
7
|
-
type Pagination<Item> = {
|
|
8
|
-
items: Item[];
|
|
9
|
-
page: number;
|
|
10
|
-
perPage: number;
|
|
11
|
-
total: number;
|
|
12
|
-
totalPages: number;
|
|
13
|
-
};
|
|
14
|
-
type CollectionResult = {
|
|
15
|
-
data: Pagination<SearchHit>;
|
|
16
|
-
facets: Facets;
|
|
17
|
-
};
|
|
18
|
-
type FilterByItem = {
|
|
19
|
-
title: string;
|
|
20
|
-
value: string;
|
|
21
|
-
};
|
|
22
|
-
type FacetBy = {
|
|
23
|
-
type: 'select' | 'multiSelect' | 'range';
|
|
24
|
-
title: string;
|
|
25
|
-
fieldKey: string;
|
|
26
|
-
};
|
|
27
|
-
type OrderBy = {
|
|
28
|
-
title: string;
|
|
29
|
-
field: string;
|
|
30
|
-
direction: 'ASC' | 'DESC';
|
|
31
|
-
};
|
|
32
|
-
type PageSize = {
|
|
33
|
-
size: number;
|
|
34
|
-
};
|
|
35
|
-
type Facets = {
|
|
36
|
-
[key: string]: {
|
|
37
|
-
[key: string]: number;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
type FilterQuery = {
|
|
41
|
-
[K: string]: string[];
|
|
42
|
-
};
|
|
43
|
-
type SearchItemConfig = {
|
|
44
|
-
source: string;
|
|
45
|
-
type: string;
|
|
46
|
-
nodeId?: string;
|
|
47
|
-
urlTemplate?: string;
|
|
48
|
-
tokenMapping?: Record<string, string>;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
interface SearchParams {
|
|
52
|
-
projectId?: string;
|
|
53
|
-
page?: number;
|
|
54
|
-
perPage?: number;
|
|
55
|
-
filters?: Record<string, unknown>;
|
|
56
|
-
baseFilterBy?: string;
|
|
57
|
-
facetBy?: string;
|
|
58
|
-
queryBy?: string;
|
|
59
|
-
search?: string;
|
|
60
|
-
orderBy?: string;
|
|
61
|
-
locale?: string;
|
|
62
|
-
maxFacetValues?: number;
|
|
63
|
-
}
|
|
64
|
-
interface SearchClient {
|
|
65
|
-
performSearch(params: SearchParams): Promise<CollectionResult>;
|
|
66
|
-
}
|
|
67
|
-
declare function createSearchClient(config: {
|
|
68
|
-
apiUrl: string;
|
|
69
|
-
apiKey?: string;
|
|
70
|
-
projectId?: string;
|
|
71
|
-
}): SearchClient;
|
|
72
|
-
|
|
73
|
-
export { type CollectionResult as C, type FacetBy as F, type OrderBy as O, type PageSize as P, type SearchClient as S, type Facets as a, type FilterByItem as b, type FilterQuery as c, type Pagination as d, type SearchCollection as e, type SearchHit as f, type SearchItemConfig as g, type SearchParams as h, createSearchClient as i };
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
type SearchCollection = 'entries' | 'compositions' | 'assets';
|
|
2
|
-
type SearchHit = {
|
|
3
|
-
id: string;
|
|
4
|
-
_collection: SearchCollection;
|
|
5
|
-
[key: string]: unknown;
|
|
6
|
-
};
|
|
7
|
-
type Pagination<Item> = {
|
|
8
|
-
items: Item[];
|
|
9
|
-
page: number;
|
|
10
|
-
perPage: number;
|
|
11
|
-
total: number;
|
|
12
|
-
totalPages: number;
|
|
13
|
-
};
|
|
14
|
-
type CollectionResult = {
|
|
15
|
-
data: Pagination<SearchHit>;
|
|
16
|
-
facets: Facets;
|
|
17
|
-
};
|
|
18
|
-
type FilterByItem = {
|
|
19
|
-
title: string;
|
|
20
|
-
value: string;
|
|
21
|
-
};
|
|
22
|
-
type FacetBy = {
|
|
23
|
-
type: 'select' | 'multiSelect' | 'range';
|
|
24
|
-
title: string;
|
|
25
|
-
fieldKey: string;
|
|
26
|
-
};
|
|
27
|
-
type OrderBy = {
|
|
28
|
-
title: string;
|
|
29
|
-
field: string;
|
|
30
|
-
direction: 'ASC' | 'DESC';
|
|
31
|
-
};
|
|
32
|
-
type PageSize = {
|
|
33
|
-
size: number;
|
|
34
|
-
};
|
|
35
|
-
type Facets = {
|
|
36
|
-
[key: string]: {
|
|
37
|
-
[key: string]: number;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
type FilterQuery = {
|
|
41
|
-
[K: string]: string[];
|
|
42
|
-
};
|
|
43
|
-
type SearchItemConfig = {
|
|
44
|
-
source: string;
|
|
45
|
-
type: string;
|
|
46
|
-
nodeId?: string;
|
|
47
|
-
urlTemplate?: string;
|
|
48
|
-
tokenMapping?: Record<string, string>;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
interface SearchParams {
|
|
52
|
-
projectId?: string;
|
|
53
|
-
page?: number;
|
|
54
|
-
perPage?: number;
|
|
55
|
-
filters?: Record<string, unknown>;
|
|
56
|
-
baseFilterBy?: string;
|
|
57
|
-
facetBy?: string;
|
|
58
|
-
queryBy?: string;
|
|
59
|
-
search?: string;
|
|
60
|
-
orderBy?: string;
|
|
61
|
-
locale?: string;
|
|
62
|
-
maxFacetValues?: number;
|
|
63
|
-
}
|
|
64
|
-
interface SearchClient {
|
|
65
|
-
performSearch(params: SearchParams): Promise<CollectionResult>;
|
|
66
|
-
}
|
|
67
|
-
declare function createSearchClient(config: {
|
|
68
|
-
apiUrl: string;
|
|
69
|
-
apiKey?: string;
|
|
70
|
-
projectId?: string;
|
|
71
|
-
}): SearchClient;
|
|
72
|
-
|
|
73
|
-
export { type CollectionResult as C, type FacetBy as F, type OrderBy as O, type PageSize as P, type SearchClient as S, type Facets as a, type FilterByItem as b, type FilterQuery as c, type Pagination as d, type SearchCollection as e, type SearchHit as f, type SearchItemConfig as g, type SearchParams as h, createSearchClient as i };
|