@backstage/plugin-search-common 0.3.5-next.0 → 0.3.6-next.0

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 CHANGED
@@ -1,5 +1,27 @@
1
1
  # @backstage/plugin-search-common
2
2
 
3
+ ## 0.3.6-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @backstage/plugin-permission-common@0.6.3-next.0
9
+
10
+ ## 0.3.5
11
+
12
+ ### Patch Changes
13
+
14
+ - 7d8acfc32e: `@beta` exports now replaced with `@public` exports
15
+ - 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.
16
+ - Updated dependencies
17
+ - @backstage/plugin-permission-common@0.6.2
18
+
19
+ ## 0.3.5-next.1
20
+
21
+ ### Patch Changes
22
+
23
+ - 7d8acfc32e: `@beta` exports now replaced with `@public` exports
24
+
3
25
  ## 0.3.5-next.0
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
- * @beta
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
- * @beta
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
- * @beta
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
- * @beta
70
+ * @public
56
71
  */
57
72
  declare type SearchResult = Result<SearchDocument>;
58
73
  /**
59
- * @beta
74
+ * @public
60
75
  */
61
76
  declare type SearchResultSet = ResultSet<SearchDocument>;
62
77
  /**
63
- * @beta
78
+ * @public
64
79
  */
65
80
  declare type IndexableResult = Result<IndexableDocument>;
66
81
  /**
67
- * @beta
82
+ * @public
68
83
  */
69
84
  declare type IndexableResultSet = ResultSet<IndexableDocument>;
70
85
  /**
71
86
  * Base properties that all search documents must include.
72
- * @beta
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
- * @beta
109
+ * @public
95
110
  */
96
111
  declare type IndexableDocument = SearchDocument & {
97
112
  /**
@@ -109,7 +124,7 @@ declare type IndexableDocument = SearchDocument & {
109
124
  * Information about a specific document type. Intended to be used in the
110
125
  * {@link @backstage/plugin-search-backend-node#IndexBuilder} to collect information
111
126
  * about the types stored in the index.
112
- * @beta
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
- * @beta
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
- * @beta
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
- * @beta
175
+ * @public
161
176
  */
162
177
  declare type QueryTranslator = (query: SearchQuery) => unknown;
163
178
  /**
164
179
  * Options when querying a search engine.
165
- * @beta
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
- * @beta
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.5-next.0",
4
+ "version": "0.3.6-next.0",
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.2-next.0",
42
+ "@backstage/plugin-permission-common": "^0.6.3-next.0",
43
43
  "@backstage/types": "^1.0.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@backstage/cli": "^0.17.2-next.1"
46
+ "@backstage/cli": "^0.18.0-next.1"
47
47
  },
48
48
  "jest": {
49
49
  "roots": [
50
50
  ".."
51
51
  ]
52
52
  },
53
- "gitHead": "e15c24ddb5d14034629ced8a5a5d8f12b8f1a7dd"
53
+ "gitHead": "e0a993834c31487a97a1ae6878eaf3685f03fc1a"
54
54
  }