@backstage/plugin-search-common
Advanced tools
Comparing version 0.0.0-nightly-20220317022557 to 0.0.0-nightly-20220318022925
# @backstage/plugin-search-common | ||
## 0.0.0-nightly-20220317022557 | ||
## 0.0.0-nightly-20220318022925 | ||
### Patch Changes | ||
- 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. | ||
- `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. | ||
- Introduce `IndexableResultSet` type, which wraps `IndexableDocument` instances in the same way as `SearchResultSet`. | ||
## 0.3.2 | ||
### Patch Changes | ||
- Updated dependencies | ||
- @backstage/types@0.0.0-nightly-20220317022557 | ||
- @backstage/plugin-permission-common@0.0.0-nightly-20220317022557 | ||
- @backstage/types@1.0.0 | ||
- @backstage/plugin-permission-common@0.5.3 | ||
@@ -11,0 +19,0 @@ ## 0.3.1 |
@@ -18,5 +18,5 @@ /// <reference types="node" /> | ||
*/ | ||
interface SearchResult { | ||
interface Result<TDocument extends SearchDocument> { | ||
type: string; | ||
document: IndexableDocument; | ||
document: TDocument; | ||
} | ||
@@ -26,4 +26,4 @@ /** | ||
*/ | ||
interface SearchResultSet { | ||
results: SearchResult[]; | ||
interface ResultSet<TDocument extends SearchDocument> { | ||
results: Result<TDocument>[]; | ||
nextPageCursor?: string; | ||
@@ -33,7 +33,22 @@ previousPageCursor?: string; | ||
/** | ||
* Base properties that all indexed documents must include, as well as some | ||
* common properties that documents are encouraged to use where appropriate. | ||
* @beta | ||
*/ | ||
interface IndexableDocument { | ||
declare type SearchResult = Result<SearchDocument>; | ||
/** | ||
* @beta | ||
*/ | ||
declare type SearchResultSet = ResultSet<SearchDocument>; | ||
/** | ||
* @beta | ||
*/ | ||
declare type IndexableResult = Result<IndexableDocument>; | ||
/** | ||
* @beta | ||
*/ | ||
declare type IndexableResultSet = ResultSet<IndexableDocument>; | ||
/** | ||
* Base properties that all search documents must include. | ||
* @beta | ||
*/ | ||
interface SearchDocument { | ||
/** | ||
@@ -52,2 +67,11 @@ * The primary name of the document (e.g. name, title, identifier, etc). | ||
location: string; | ||
} | ||
/** | ||
* Properties related to indexing of documents. This type is only useful for | ||
* backends working directly with documents being inserted or retrieved from | ||
* search indexes. When dealing with documents in the frontend, use | ||
* {@link SearchDocument}. | ||
* @beta | ||
*/ | ||
declare type IndexableDocument = SearchDocument & { | ||
/** | ||
@@ -63,3 +87,3 @@ * Optional authorization information to be used when determining whether this | ||
}; | ||
} | ||
}; | ||
/** | ||
@@ -151,5 +175,5 @@ * Information about a specific document type. Intended to be used in the | ||
*/ | ||
query(query: SearchQuery, options?: QueryRequestOptions): Promise<SearchResultSet>; | ||
query(query: SearchQuery, options?: QueryRequestOptions): Promise<IndexableResultSet>; | ||
} | ||
export { DocumentCollatorFactory, DocumentDecoratorFactory, DocumentTypeInfo, IndexableDocument, QueryRequestOptions, QueryTranslator, SearchEngine, SearchQuery, SearchResult, SearchResultSet }; | ||
export { DocumentCollatorFactory, DocumentDecoratorFactory, DocumentTypeInfo, IndexableDocument, IndexableResult, IndexableResultSet, QueryRequestOptions, QueryTranslator, Result, ResultSet, SearchDocument, SearchEngine, SearchQuery, SearchResult, SearchResultSet }; |
{ | ||
"name": "@backstage/plugin-search-common", | ||
"description": "Common functionalities for Search, to be shared between various search-enabled plugins", | ||
"version": "0.0.0-nightly-20220317022557", | ||
"version": "0.0.0-nightly-20220318022925", | ||
"main": "dist/index.cjs.js", | ||
@@ -42,7 +42,7 @@ "types": "dist/index.d.ts", | ||
"dependencies": { | ||
"@backstage/types": "^0.0.0-nightly-20220317022557", | ||
"@backstage/plugin-permission-common": "^0.0.0-nightly-20220317022557" | ||
"@backstage/types": "^1.0.0", | ||
"@backstage/plugin-permission-common": "^0.5.3" | ||
}, | ||
"devDependencies": { | ||
"@backstage/cli": "^0.0.0-nightly-20220317022557" | ||
"@backstage/cli": "^0.16.0" | ||
}, | ||
@@ -49,0 +49,0 @@ "jest": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13115
174
+ Added@backstage/config@1.3.2(transitive)
+ Added@backstage/errors@1.2.7(transitive)
+ Added@backstage/plugin-permission-common@0.5.3(transitive)
+ Added@backstage/types@1.2.1(transitive)
+ Addedcross-fetch@3.2.0(transitive)
+ Addeduuid@8.3.2(transitive)
- Removed@backstage/config@0.0.0-nightly-20250114022708(transitive)
- Removed@backstage/errors@0.0.0-nightly-20250114022708(transitive)
- Removed@backstage/plugin-permission-common@0.0.0-nightly-20250114022708(transitive)
- Removed@backstage/types@0.0.0-nightly-20250114022708(transitive)
- Removedcross-fetch@4.1.0(transitive)
- Removeduuid@11.0.5(transitive)
- Removedzod-to-json-schema@3.24.1(transitive)
Updated@backstage/types@^1.0.0