@backstage/plugin-search-common 0.3.1 → 0.3.3-next.1
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 +23 -0
- package/dist/index.d.ts +34 -10
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @backstage/plugin-search-common
|
|
2
2
|
|
|
3
|
+
## 0.3.3-next.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @backstage/plugin-permission-common@0.6.0-next.0
|
|
9
|
+
|
|
10
|
+
## 0.3.3-next.0
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- c8b295f2fb: - Introduce `SearchDocument` type. This type contains the subset of `IndexableDocument` properties relevant to the frontend, and is intended to be used for documents returned to the frontend from the search API.
|
|
15
|
+
- `SearchResultSet` is now a wrapper for documents of type `SearchDocument`, and is intended to be used in the frontend. This isn't a breaking change, since `IndexableDocument`s are valid `SearchDocument`s, so the old and new types are compatible.
|
|
16
|
+
- Introduce `IndexableResultSet` type, which wraps `IndexableDocument` instances in the same way as `SearchResultSet`.
|
|
17
|
+
|
|
18
|
+
## 0.3.2
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
- @backstage/types@1.0.0
|
|
24
|
+
- @backstage/plugin-permission-common@0.5.3
|
|
25
|
+
|
|
3
26
|
## 0.3.1
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -15,24 +15,39 @@ interface SearchQuery {
|
|
|
15
15
|
/**
|
|
16
16
|
* @beta
|
|
17
17
|
*/
|
|
18
|
-
interface
|
|
18
|
+
interface Result<TDocument extends SearchDocument> {
|
|
19
19
|
type: string;
|
|
20
|
-
document:
|
|
20
|
+
document: TDocument;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* @beta
|
|
24
24
|
*/
|
|
25
|
-
interface
|
|
26
|
-
results:
|
|
25
|
+
interface ResultSet<TDocument extends SearchDocument> {
|
|
26
|
+
results: Result<TDocument>[];
|
|
27
27
|
nextPageCursor?: string;
|
|
28
28
|
previousPageCursor?: string;
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
|
-
* Base properties that all indexed documents must include, as well as some
|
|
32
|
-
* common properties that documents are encouraged to use where appropriate.
|
|
33
31
|
* @beta
|
|
34
32
|
*/
|
|
35
|
-
|
|
33
|
+
declare type SearchResult = Result<SearchDocument>;
|
|
34
|
+
/**
|
|
35
|
+
* @beta
|
|
36
|
+
*/
|
|
37
|
+
declare type SearchResultSet = ResultSet<SearchDocument>;
|
|
38
|
+
/**
|
|
39
|
+
* @beta
|
|
40
|
+
*/
|
|
41
|
+
declare type IndexableResult = Result<IndexableDocument>;
|
|
42
|
+
/**
|
|
43
|
+
* @beta
|
|
44
|
+
*/
|
|
45
|
+
declare type IndexableResultSet = ResultSet<IndexableDocument>;
|
|
46
|
+
/**
|
|
47
|
+
* Base properties that all search documents must include.
|
|
48
|
+
* @beta
|
|
49
|
+
*/
|
|
50
|
+
interface SearchDocument {
|
|
36
51
|
/**
|
|
37
52
|
* The primary name of the document (e.g. name, title, identifier, etc).
|
|
38
53
|
*/
|
|
@@ -46,6 +61,15 @@ interface IndexableDocument {
|
|
|
46
61
|
* is clicked).
|
|
47
62
|
*/
|
|
48
63
|
location: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Properties related to indexing of documents. This type is only useful for
|
|
67
|
+
* backends working directly with documents being inserted or retrieved from
|
|
68
|
+
* search indexes. When dealing with documents in the frontend, use
|
|
69
|
+
* {@link SearchDocument}.
|
|
70
|
+
* @beta
|
|
71
|
+
*/
|
|
72
|
+
declare type IndexableDocument = SearchDocument & {
|
|
49
73
|
/**
|
|
50
74
|
* Optional authorization information to be used when determining whether this
|
|
51
75
|
* search result should be visible to a given user.
|
|
@@ -56,7 +80,7 @@ interface IndexableDocument {
|
|
|
56
80
|
*/
|
|
57
81
|
resourceRef: string;
|
|
58
82
|
};
|
|
59
|
-
}
|
|
83
|
+
};
|
|
60
84
|
/**
|
|
61
85
|
* Information about a specific document type. Intended to be used in the
|
|
62
86
|
* {@link @backstage/search-backend-node#IndexBuilder} to collect information
|
|
@@ -143,7 +167,7 @@ interface SearchEngine {
|
|
|
143
167
|
/**
|
|
144
168
|
* Perform a search query against the SearchEngine.
|
|
145
169
|
*/
|
|
146
|
-
query(query: SearchQuery, options?: QueryRequestOptions): Promise<
|
|
170
|
+
query(query: SearchQuery, options?: QueryRequestOptions): Promise<IndexableResultSet>;
|
|
147
171
|
}
|
|
148
172
|
|
|
149
|
-
export { DocumentCollatorFactory, DocumentDecoratorFactory, DocumentTypeInfo, IndexableDocument, QueryRequestOptions, QueryTranslator, SearchEngine, SearchQuery, SearchResult, SearchResultSet };
|
|
173
|
+
export { DocumentCollatorFactory, DocumentDecoratorFactory, DocumentTypeInfo, IndexableDocument, IndexableResult, IndexableResultSet, QueryRequestOptions, QueryTranslator, Result, ResultSet, SearchDocument, SearchEngine, SearchQuery, SearchResult, SearchResultSet };
|
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.1",
|
|
4
|
+
"version": "0.3.3-next.1",
|
|
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.
|
|
43
|
-
"@backstage/types": "^0.
|
|
42
|
+
"@backstage/plugin-permission-common": "^0.6.0-next.0",
|
|
43
|
+
"@backstage/types": "^1.0.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@backstage/cli": "^0.
|
|
46
|
+
"@backstage/cli": "^0.17.0-next.1"
|
|
47
47
|
},
|
|
48
48
|
"jest": {
|
|
49
49
|
"roots": [
|
|
50
50
|
".."
|
|
51
51
|
]
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "57d12dcc35aeb6c33b09e51d1efc3408c574f109"
|
|
54
54
|
}
|