@backstage/plugin-search-common 0.3.4 → 0.3.5
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/CHANGELOG.md +22 -0
- package/dist/index.d.ts +32 -17
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @backstage/plugin-search-common
|
|
2
2
|
|
|
3
|
+
## 0.3.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7d8acfc32e: `@beta` exports now replaced with `@public` exports
|
|
8
|
+
- 484afdf1dc: Added an optional `rank` attribute to the `Result` type. This represents the result rank (starting at 1) for a given result in a result set for a given search.
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
- @backstage/plugin-permission-common@0.6.2
|
|
11
|
+
|
|
12
|
+
## 0.3.5-next.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 7d8acfc32e: `@beta` exports now replaced with `@public` exports
|
|
17
|
+
|
|
18
|
+
## 0.3.5-next.0
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
- @backstage/plugin-permission-common@0.6.2-next.0
|
|
24
|
+
|
|
3
25
|
## 0.3.4
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { JsonObject } from '@backstage/types';
|
|
|
4
4
|
import { Readable, Transform, Writable } from 'stream';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* @
|
|
7
|
+
* @public
|
|
8
8
|
*/
|
|
9
9
|
interface SearchQuery {
|
|
10
10
|
term: string;
|
|
@@ -13,10 +13,10 @@ interface SearchQuery {
|
|
|
13
13
|
pageCursor?: string;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
* @beta
|
|
17
16
|
* Metadata for result relevant document fields with matched terms highlighted
|
|
18
17
|
* via wrapping in associated pre/post tags. The UI is expected to parse these
|
|
19
18
|
* field excerpts by replacing wrapping tags with applicable UI elements for rendering.
|
|
19
|
+
* @public
|
|
20
20
|
*/
|
|
21
21
|
interface ResultHighlight {
|
|
22
22
|
/**
|
|
@@ -36,15 +36,30 @@ interface ResultHighlight {
|
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
|
-
* @
|
|
39
|
+
* @public
|
|
40
40
|
*/
|
|
41
41
|
interface Result<TDocument extends SearchDocument> {
|
|
42
|
+
/**
|
|
43
|
+
* The "type" of the given document. See: {@link DocumentCollatorFactory."type"}
|
|
44
|
+
*/
|
|
42
45
|
type: string;
|
|
46
|
+
/**
|
|
47
|
+
* The raw value of the document, as indexed.
|
|
48
|
+
*/
|
|
43
49
|
document: TDocument;
|
|
50
|
+
/**
|
|
51
|
+
* Optional result highlight. Useful for improving the search result
|
|
52
|
+
* display/experience.
|
|
53
|
+
*/
|
|
44
54
|
highlight?: ResultHighlight;
|
|
55
|
+
/**
|
|
56
|
+
* Optional result rank, where 1 is the first/top result returned. Useful for
|
|
57
|
+
* understanding search effectiveness in analytics.
|
|
58
|
+
*/
|
|
59
|
+
rank?: number;
|
|
45
60
|
}
|
|
46
61
|
/**
|
|
47
|
-
* @
|
|
62
|
+
* @public
|
|
48
63
|
*/
|
|
49
64
|
interface ResultSet<TDocument extends SearchDocument> {
|
|
50
65
|
results: Result<TDocument>[];
|
|
@@ -52,24 +67,24 @@ interface ResultSet<TDocument extends SearchDocument> {
|
|
|
52
67
|
previousPageCursor?: string;
|
|
53
68
|
}
|
|
54
69
|
/**
|
|
55
|
-
* @
|
|
70
|
+
* @public
|
|
56
71
|
*/
|
|
57
72
|
declare type SearchResult = Result<SearchDocument>;
|
|
58
73
|
/**
|
|
59
|
-
* @
|
|
74
|
+
* @public
|
|
60
75
|
*/
|
|
61
76
|
declare type SearchResultSet = ResultSet<SearchDocument>;
|
|
62
77
|
/**
|
|
63
|
-
* @
|
|
78
|
+
* @public
|
|
64
79
|
*/
|
|
65
80
|
declare type IndexableResult = Result<IndexableDocument>;
|
|
66
81
|
/**
|
|
67
|
-
* @
|
|
82
|
+
* @public
|
|
68
83
|
*/
|
|
69
84
|
declare type IndexableResultSet = ResultSet<IndexableDocument>;
|
|
70
85
|
/**
|
|
71
86
|
* Base properties that all search documents must include.
|
|
72
|
-
* @
|
|
87
|
+
* @public
|
|
73
88
|
*/
|
|
74
89
|
interface SearchDocument {
|
|
75
90
|
/**
|
|
@@ -91,7 +106,7 @@ interface SearchDocument {
|
|
|
91
106
|
* backends working directly with documents being inserted or retrieved from
|
|
92
107
|
* search indexes. When dealing with documents in the frontend, use
|
|
93
108
|
* {@link SearchDocument}.
|
|
94
|
-
* @
|
|
109
|
+
* @public
|
|
95
110
|
*/
|
|
96
111
|
declare type IndexableDocument = SearchDocument & {
|
|
97
112
|
/**
|
|
@@ -107,9 +122,9 @@ declare type IndexableDocument = SearchDocument & {
|
|
|
107
122
|
};
|
|
108
123
|
/**
|
|
109
124
|
* Information about a specific document type. Intended to be used in the
|
|
110
|
-
* {@link @backstage/search-backend-node#IndexBuilder} to collect information
|
|
125
|
+
* {@link @backstage/plugin-search-backend-node#IndexBuilder} to collect information
|
|
111
126
|
* about the types stored in the index.
|
|
112
|
-
* @
|
|
127
|
+
* @public
|
|
113
128
|
*/
|
|
114
129
|
declare type DocumentTypeInfo = {
|
|
115
130
|
/**
|
|
@@ -120,7 +135,7 @@ declare type DocumentTypeInfo = {
|
|
|
120
135
|
};
|
|
121
136
|
/**
|
|
122
137
|
* Factory class for instantiating collators.
|
|
123
|
-
* @
|
|
138
|
+
* @public
|
|
124
139
|
*/
|
|
125
140
|
interface DocumentCollatorFactory {
|
|
126
141
|
/**
|
|
@@ -140,7 +155,7 @@ interface DocumentCollatorFactory {
|
|
|
140
155
|
}
|
|
141
156
|
/**
|
|
142
157
|
* Factory class for instantiating decorators.
|
|
143
|
-
* @
|
|
158
|
+
* @public
|
|
144
159
|
*/
|
|
145
160
|
interface DocumentDecoratorFactory {
|
|
146
161
|
/**
|
|
@@ -157,12 +172,12 @@ interface DocumentDecoratorFactory {
|
|
|
157
172
|
/**
|
|
158
173
|
* A type of function responsible for translating an abstract search query into
|
|
159
174
|
* a concrete query relevant to a particular search engine.
|
|
160
|
-
* @
|
|
175
|
+
* @public
|
|
161
176
|
*/
|
|
162
177
|
declare type QueryTranslator = (query: SearchQuery) => unknown;
|
|
163
178
|
/**
|
|
164
179
|
* Options when querying a search engine.
|
|
165
|
-
* @
|
|
180
|
+
* @public
|
|
166
181
|
*/
|
|
167
182
|
declare type QueryRequestOptions = {
|
|
168
183
|
token?: string;
|
|
@@ -171,7 +186,7 @@ declare type QueryRequestOptions = {
|
|
|
171
186
|
* Interface that must be implemented by specific search engines, responsible
|
|
172
187
|
* for performing indexing and querying and translating abstract queries into
|
|
173
188
|
* concrete, search engine-specific queries.
|
|
174
|
-
* @
|
|
189
|
+
* @public
|
|
175
190
|
*/
|
|
176
191
|
interface SearchEngine {
|
|
177
192
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-search-common",
|
|
3
3
|
"description": "Common functionalities for Search, to be shared between various search-enabled plugins",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.5",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"private": false,
|
|
@@ -39,16 +39,16 @@
|
|
|
39
39
|
"url": "https://github.com/backstage/backstage/issues"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@backstage/plugin-permission-common": "^0.6.
|
|
42
|
+
"@backstage/plugin-permission-common": "^0.6.2",
|
|
43
43
|
"@backstage/types": "^1.0.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@backstage/cli": "^0.17.
|
|
46
|
+
"@backstage/cli": "^0.17.2"
|
|
47
47
|
},
|
|
48
48
|
"jest": {
|
|
49
49
|
"roots": [
|
|
50
50
|
".."
|
|
51
51
|
]
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "e42cb3887e41f756c16380d757d93feda27f40ee"
|
|
54
54
|
}
|