@interopio/search-api 3.1.1-beta.0 → 3.1.2
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 +243 -243
- package/changelog.md +41 -39
- package/dist/search-api.es.js +1 -1
- package/dist/search-api.umd.js +1 -1
- package/license.md +9 -9
- package/package.json +3 -3
- package/search.d.ts +380 -380
package/README.md
CHANGED
|
@@ -1,244 +1,244 @@
|
|
|
1
|
-
# IO Connect Search API
|
|
2
|
-
|
|
3
|
-
Apps can perform searches and provide results for others' searches.
|
|
4
|
-
|
|
5
|
-
For example, let's say an app provides Seinfeld quotes, and wants to make those quotes available to any other app. The Seinfeld app could register itself as a search provider with this:
|
|
6
|
-
|
|
7
|
-
```js
|
|
8
|
-
// Registering as a provider
|
|
9
|
-
const provider = await glue.search.registerProvider({
|
|
10
|
-
name: "Seinfeld-Quotes"
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
// Registering how the provider will respond to queries
|
|
14
|
-
provider.onQuery(({search, sendResults, done}) => {
|
|
15
|
-
const textOfQuote = doStuffInternally(search);
|
|
16
|
-
|
|
17
|
-
sendResults({
|
|
18
|
-
type: {
|
|
19
|
-
name: "tv-quote",
|
|
20
|
-
displayName: "Seinfeld Quotes"
|
|
21
|
-
},
|
|
22
|
-
id: "quote-123",
|
|
23
|
-
description: textOfQuote
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
done();
|
|
27
|
-
})
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
Now, let's say an app is interested to see if there are any Seinfeld quotes with the word "architect". It would use the following function:
|
|
31
|
-
|
|
32
|
-
```js
|
|
33
|
-
const query = await glue.search.query({search: "architect"});
|
|
34
|
-
query.onResults((result) => {
|
|
35
|
-
/*
|
|
36
|
-
// Example value for result -
|
|
37
|
-
{
|
|
38
|
-
provider: {
|
|
39
|
-
id: "INTERNAL_ID",
|
|
40
|
-
interopId: "INTERNAL_INSTANCE_ID",
|
|
41
|
-
name: "Seinfeld-Quotes" // The search provider's name
|
|
42
|
-
appName: "seinfeld-app", // The app that registered the search provider
|
|
43
|
-
},
|
|
44
|
-
result: {
|
|
45
|
-
type: {
|
|
46
|
-
name: "tv-quote",
|
|
47
|
-
displayName: "Seinfeld Quotes"
|
|
48
|
-
},
|
|
49
|
-
id: "quote-123",
|
|
50
|
-
description: "You know I always wanted to pretend I was an architect.
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
*/
|
|
54
|
-
})
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
## Checklists
|
|
58
|
-
|
|
59
|
-
If you're writing a custom search provider, here are things to make sure you implement:
|
|
60
|
-
|
|
61
|
-
Basics
|
|
62
|
-
- [ ] Registering provider
|
|
63
|
-
- [ ] Generate and send results
|
|
64
|
-
|
|
65
|
-
Other considerations:
|
|
66
|
-
- [ ] Call `done()` once you are done (in case queriers are waiting on `onCompleted()`)
|
|
67
|
-
- [ ] Are you checking the `types` property? You don't want to ignore the restrictions the querier placed on their query.
|
|
68
|
-
- [ ] Are you checking the `maxResults` property? You don't want to return more that the querier asked for.
|
|
69
|
-
- [ ] Ditto for `maxResultsByType`
|
|
70
|
-
- [ ] Did you set up error handling, and include the `error()` callback if necessary?
|
|
71
|
-
- [ ] Do your queries take a long enough time that they might get cancelled? If so, are you handling `onQueryCancel`?
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
If you're querying a search providerm here are things to make sure you implement:
|
|
75
|
-
- [ ] Call the query (eg `const query = await glue.search.query({search: "My search string"})`)
|
|
76
|
-
- [ ] Handle `onResults` (eg `query.onResults(displaySearchResult)`)
|
|
77
|
-
- [ ] Handle `onError`
|
|
78
|
-
|
|
79
|
-
Other considerations:
|
|
80
|
-
- [ ] Is there a situation where you need to `cancel()` your query?
|
|
81
|
-
- [ ] Do you need to limit the quantity of results you receive (using `providerLimits`)?
|
|
82
|
-
- [ ] Do you need `onCompleted`, to see when different search providers have finished? If so, does it also make sense to include a timeout (in case a search provider *doesn't* indicate when they're `done()`?)
|
|
83
|
-
- [ ] Are you interested in only certain **types** of content? Would it make sense to call `listTypes()` to see if the type you're looking is being provided? Would it makse sense to limit your search results to a certain type?
|
|
84
|
-
- [ ] Are you interested in only certain **providers**? Would it make sense to call `listProviders()` to see if the provider you're looking is present? Would it makse sense to limit your search results to certain providers?
|
|
85
|
-
- [ ] Sometimes, search results include `actions`. If that makes sense for your use cases, are you handling incoming actions?
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
## API
|
|
89
|
-
|
|
90
|
-
glue.search has the following methods:
|
|
91
|
-
- getDebounceMS
|
|
92
|
-
- listProviders
|
|
93
|
-
- listTypes
|
|
94
|
-
- query
|
|
95
|
-
- registerProvider
|
|
96
|
-
- setDebounceMS
|
|
97
|
-
- version
|
|
98
|
-
|
|
99
|
-
### registerProvider
|
|
100
|
-
|
|
101
|
-
Config options for `.registerProvider()` are:
|
|
102
|
-
- `name` (required)
|
|
103
|
-
- `types` (optional but recommended). If you register a custom type, it will appear in the `.listTypes` method.
|
|
104
|
-
|
|
105
|
-
```js
|
|
106
|
-
const provider = await glue.search.registerProvider({name: "test"});
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
```js
|
|
110
|
-
const provider = await glue.search.registerProvider({
|
|
111
|
-
name: "test",
|
|
112
|
-
types: [
|
|
113
|
-
{name: "application"}
|
|
114
|
-
]
|
|
115
|
-
});
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
`registerProvider` returns a promise that resolves to a `Provider` object. This has the following available methods:
|
|
119
|
-
- `onQuery` - callback when search queries are executed
|
|
120
|
-
- `onQueryCancel` - callback when an app cancels its search query
|
|
121
|
-
- `unregister` - an unregistration method.
|
|
122
|
-
|
|
123
|
-
:::tip
|
|
124
|
-
Search providers are automatically unregistered when windows are closed. Unregistration is a good cleanup action, but may not be required.
|
|
125
|
-
:::
|
|
126
|
-
|
|
127
|
-
The `onQuery` callback provides a `ProviderQuery` object, with the following properties:
|
|
128
|
-
- id - referenced when cancelling the query
|
|
129
|
-
- search - the text being searched for
|
|
130
|
-
- providers - the providers the querier is interested in
|
|
131
|
-
- types - the SearchTypes the querier is interested in
|
|
132
|
-
- providerLimits.maxResults - the maximum number of results the querier wants to receive from each provider
|
|
133
|
-
- providerLimits.maxResultsPerType - the maximum number of results PER TYPE the querier wants to recevie from each provider
|
|
134
|
-
- sendResult - callback for sending an individual result. (The querier receives this with the `query.onResults()` callback)
|
|
135
|
-
- error - callback if there's an error (The querier receives this with the `query.onError()` callback)
|
|
136
|
-
- done - callback once all results have been sent (The querier receives this with the `query.done()` callback)
|
|
137
|
-
|
|
138
|
-
When sending a result, you supply a `QueryResult` object. The properties of that object are:
|
|
139
|
-
- type (required) - a `SearchType` (eg: `{name: "application"}`)
|
|
140
|
-
- id
|
|
141
|
-
- displayName
|
|
142
|
-
- description
|
|
143
|
-
- iconURL
|
|
144
|
-
- metadata
|
|
145
|
-
- action - metadata information about a method you'd want to invoke
|
|
146
|
-
- secondaryActions - more actions
|
|
147
|
-
|
|
148
|
-
### query
|
|
149
|
-
|
|
150
|
-
You create a query object with the `query()` method:
|
|
151
|
-
```js
|
|
152
|
-
const query = await glue.search.query({search: "My search query"});
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
The `query` method takes the following properties:
|
|
156
|
-
- `search` (required) (string) - what you're searching for
|
|
157
|
-
- `providers` (`ProviderData[]`) - providers you want to limit your search to
|
|
158
|
-
- `types` (`SearchType[]`) - the types of results you want to limit your search to
|
|
159
|
-
- `providerLimits.maxResults` (number) - the maximum number of results the querier wants to receive from each provider
|
|
160
|
-
- `providerLimits.maxResultsPerType` (number) - the maximum number of results PER TYPE the querier wants to recevie from each provider
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
The query object you receive has the following methods:
|
|
164
|
-
- `cancel()` - Cancels the query. (See provider's `onQueryCancel()`)
|
|
165
|
-
- `onResults()` - Callback to receive results (See provider's query handling for `sendResult()`)
|
|
166
|
-
- `onCompleted()` - Callback when provider is done (See provider's query handling for `done()`)
|
|
167
|
-
- `onError()` - Callback when provider has an error (See provider's query handling for `error()`)
|
|
168
|
-
|
|
169
|
-
### listProviders
|
|
170
|
-
|
|
171
|
-
```js
|
|
172
|
-
await glue.search.listProviders();
|
|
173
|
-
/*
|
|
174
|
-
Example results: [
|
|
175
|
-
{
|
|
176
|
-
appName: "fsbl-test-butler",
|
|
177
|
-
id: "INTERNAL_ID",
|
|
178
|
-
interopId: "INSTANCE_ID",
|
|
179
|
-
name: "registered-search-provider-custom-name",
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
appName: "tester",
|
|
183
|
-
id: "INTERNAL_ID",
|
|
184
|
-
interopId: "INSTANCE_ID",
|
|
185
|
-
name: "my-tester",
|
|
186
|
-
types: [{name: "test-type"}]
|
|
187
|
-
}
|
|
188
|
-
]
|
|
189
|
-
*/
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
### listTypes
|
|
193
|
-
|
|
194
|
-
You can see what search types are available. This is especially useful if you are relying on a custom search type from another app, and want to confirm that that app has already been registered.
|
|
195
|
-
|
|
196
|
-
```js
|
|
197
|
-
await glue.search.listTypes();
|
|
198
|
-
/*
|
|
199
|
-
Example results: [
|
|
200
|
-
{name: "customSearchType"},
|
|
201
|
-
{name: "application"},
|
|
202
|
-
{name: "layout"},
|
|
203
|
-
{name: "workspace"},
|
|
204
|
-
{name: "swimlane"},
|
|
205
|
-
{name: "action"}
|
|
206
|
-
]
|
|
207
|
-
*/
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
### getDebounceMS, setDebounceMS
|
|
211
|
-
|
|
212
|
-
**Default debounce: 0ms**
|
|
213
|
-
|
|
214
|
-
Queries can be debounced. If you plan on querying based on individual keystrokes or mouse movements, you can potentially generate an unnecessarily large message flurry. Debouncing the queries will reduce search query traffic.
|
|
215
|
-
|
|
216
|
-
Here are examples of getting/setting the debounce time:
|
|
217
|
-
```js
|
|
218
|
-
// Get the debounce time:
|
|
219
|
-
glue.search.getDebounceMS(); // returns 0 by default
|
|
220
|
-
|
|
221
|
-
// Set the debounce time to 20ms:
|
|
222
|
-
glue.search.setDebounceMS(20);
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
## Actions
|
|
226
|
-
TBD
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
## Developer notes
|
|
230
|
-
|
|
231
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
232
|
-
|
|
233
|
-
// package name: @interopio/search-api -> adds the Search API
|
|
234
|
-
|
|
235
|
-
// @interopio/browser-platform -> can use the package to register as a provider or use as a client, by default register as a provider for applications, workspaces, layouts and optionally actions
|
|
236
|
-
// @interopio/browser -> can use the package to register as a provider or use as a client
|
|
237
|
-
// GD3 -> by default register as a provider for applications, workspaces, layouts and optionally actions
|
|
238
|
-
|
|
239
|
-
// Foundation: Interop and Shared Context
|
|
240
|
-
// lib registers: lazily two methods
|
|
241
|
-
// lib uses: shared context to providers state management
|
|
242
|
-
// method used when registered as provider to accept queries
|
|
243
|
-
|
|
1
|
+
# IO Connect Search API
|
|
2
|
+
|
|
3
|
+
Apps can perform searches and provide results for others' searches.
|
|
4
|
+
|
|
5
|
+
For example, let's say an app provides Seinfeld quotes, and wants to make those quotes available to any other app. The Seinfeld app could register itself as a search provider with this:
|
|
6
|
+
|
|
7
|
+
```js
|
|
8
|
+
// Registering as a provider
|
|
9
|
+
const provider = await glue.search.registerProvider({
|
|
10
|
+
name: "Seinfeld-Quotes"
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
// Registering how the provider will respond to queries
|
|
14
|
+
provider.onQuery(({search, sendResults, done}) => {
|
|
15
|
+
const textOfQuote = doStuffInternally(search);
|
|
16
|
+
|
|
17
|
+
sendResults({
|
|
18
|
+
type: {
|
|
19
|
+
name: "tv-quote",
|
|
20
|
+
displayName: "Seinfeld Quotes"
|
|
21
|
+
},
|
|
22
|
+
id: "quote-123",
|
|
23
|
+
description: textOfQuote
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
done();
|
|
27
|
+
})
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Now, let's say an app is interested to see if there are any Seinfeld quotes with the word "architect". It would use the following function:
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
const query = await glue.search.query({search: "architect"});
|
|
34
|
+
query.onResults((result) => {
|
|
35
|
+
/*
|
|
36
|
+
// Example value for result -
|
|
37
|
+
{
|
|
38
|
+
provider: {
|
|
39
|
+
id: "INTERNAL_ID",
|
|
40
|
+
interopId: "INTERNAL_INSTANCE_ID",
|
|
41
|
+
name: "Seinfeld-Quotes" // The search provider's name
|
|
42
|
+
appName: "seinfeld-app", // The app that registered the search provider
|
|
43
|
+
},
|
|
44
|
+
result: {
|
|
45
|
+
type: {
|
|
46
|
+
name: "tv-quote",
|
|
47
|
+
displayName: "Seinfeld Quotes"
|
|
48
|
+
},
|
|
49
|
+
id: "quote-123",
|
|
50
|
+
description: "You know I always wanted to pretend I was an architect.
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
*/
|
|
54
|
+
})
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Checklists
|
|
58
|
+
|
|
59
|
+
If you're writing a custom search provider, here are things to make sure you implement:
|
|
60
|
+
|
|
61
|
+
Basics
|
|
62
|
+
- [ ] Registering provider
|
|
63
|
+
- [ ] Generate and send results
|
|
64
|
+
|
|
65
|
+
Other considerations:
|
|
66
|
+
- [ ] Call `done()` once you are done (in case queriers are waiting on `onCompleted()`)
|
|
67
|
+
- [ ] Are you checking the `types` property? You don't want to ignore the restrictions the querier placed on their query.
|
|
68
|
+
- [ ] Are you checking the `maxResults` property? You don't want to return more that the querier asked for.
|
|
69
|
+
- [ ] Ditto for `maxResultsByType`
|
|
70
|
+
- [ ] Did you set up error handling, and include the `error()` callback if necessary?
|
|
71
|
+
- [ ] Do your queries take a long enough time that they might get cancelled? If so, are you handling `onQueryCancel`?
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
If you're querying a search providerm here are things to make sure you implement:
|
|
75
|
+
- [ ] Call the query (eg `const query = await glue.search.query({search: "My search string"})`)
|
|
76
|
+
- [ ] Handle `onResults` (eg `query.onResults(displaySearchResult)`)
|
|
77
|
+
- [ ] Handle `onError`
|
|
78
|
+
|
|
79
|
+
Other considerations:
|
|
80
|
+
- [ ] Is there a situation where you need to `cancel()` your query?
|
|
81
|
+
- [ ] Do you need to limit the quantity of results you receive (using `providerLimits`)?
|
|
82
|
+
- [ ] Do you need `onCompleted`, to see when different search providers have finished? If so, does it also make sense to include a timeout (in case a search provider *doesn't* indicate when they're `done()`?)
|
|
83
|
+
- [ ] Are you interested in only certain **types** of content? Would it make sense to call `listTypes()` to see if the type you're looking is being provided? Would it makse sense to limit your search results to a certain type?
|
|
84
|
+
- [ ] Are you interested in only certain **providers**? Would it make sense to call `listProviders()` to see if the provider you're looking is present? Would it makse sense to limit your search results to certain providers?
|
|
85
|
+
- [ ] Sometimes, search results include `actions`. If that makes sense for your use cases, are you handling incoming actions?
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
## API
|
|
89
|
+
|
|
90
|
+
glue.search has the following methods:
|
|
91
|
+
- getDebounceMS
|
|
92
|
+
- listProviders
|
|
93
|
+
- listTypes
|
|
94
|
+
- query
|
|
95
|
+
- registerProvider
|
|
96
|
+
- setDebounceMS
|
|
97
|
+
- version
|
|
98
|
+
|
|
99
|
+
### registerProvider
|
|
100
|
+
|
|
101
|
+
Config options for `.registerProvider()` are:
|
|
102
|
+
- `name` (required)
|
|
103
|
+
- `types` (optional but recommended). If you register a custom type, it will appear in the `.listTypes` method.
|
|
104
|
+
|
|
105
|
+
```js
|
|
106
|
+
const provider = await glue.search.registerProvider({name: "test"});
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
```js
|
|
110
|
+
const provider = await glue.search.registerProvider({
|
|
111
|
+
name: "test",
|
|
112
|
+
types: [
|
|
113
|
+
{name: "application"}
|
|
114
|
+
]
|
|
115
|
+
});
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
`registerProvider` returns a promise that resolves to a `Provider` object. This has the following available methods:
|
|
119
|
+
- `onQuery` - callback when search queries are executed
|
|
120
|
+
- `onQueryCancel` - callback when an app cancels its search query
|
|
121
|
+
- `unregister` - an unregistration method.
|
|
122
|
+
|
|
123
|
+
:::tip
|
|
124
|
+
Search providers are automatically unregistered when windows are closed. Unregistration is a good cleanup action, but may not be required.
|
|
125
|
+
:::
|
|
126
|
+
|
|
127
|
+
The `onQuery` callback provides a `ProviderQuery` object, with the following properties:
|
|
128
|
+
- id - referenced when cancelling the query
|
|
129
|
+
- search - the text being searched for
|
|
130
|
+
- providers - the providers the querier is interested in
|
|
131
|
+
- types - the SearchTypes the querier is interested in
|
|
132
|
+
- providerLimits.maxResults - the maximum number of results the querier wants to receive from each provider
|
|
133
|
+
- providerLimits.maxResultsPerType - the maximum number of results PER TYPE the querier wants to recevie from each provider
|
|
134
|
+
- sendResult - callback for sending an individual result. (The querier receives this with the `query.onResults()` callback)
|
|
135
|
+
- error - callback if there's an error (The querier receives this with the `query.onError()` callback)
|
|
136
|
+
- done - callback once all results have been sent (The querier receives this with the `query.done()` callback)
|
|
137
|
+
|
|
138
|
+
When sending a result, you supply a `QueryResult` object. The properties of that object are:
|
|
139
|
+
- type (required) - a `SearchType` (eg: `{name: "application"}`)
|
|
140
|
+
- id
|
|
141
|
+
- displayName
|
|
142
|
+
- description
|
|
143
|
+
- iconURL
|
|
144
|
+
- metadata
|
|
145
|
+
- action - metadata information about a method you'd want to invoke
|
|
146
|
+
- secondaryActions - more actions
|
|
147
|
+
|
|
148
|
+
### query
|
|
149
|
+
|
|
150
|
+
You create a query object with the `query()` method:
|
|
151
|
+
```js
|
|
152
|
+
const query = await glue.search.query({search: "My search query"});
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
The `query` method takes the following properties:
|
|
156
|
+
- `search` (required) (string) - what you're searching for
|
|
157
|
+
- `providers` (`ProviderData[]`) - providers you want to limit your search to
|
|
158
|
+
- `types` (`SearchType[]`) - the types of results you want to limit your search to
|
|
159
|
+
- `providerLimits.maxResults` (number) - the maximum number of results the querier wants to receive from each provider
|
|
160
|
+
- `providerLimits.maxResultsPerType` (number) - the maximum number of results PER TYPE the querier wants to recevie from each provider
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
The query object you receive has the following methods:
|
|
164
|
+
- `cancel()` - Cancels the query. (See provider's `onQueryCancel()`)
|
|
165
|
+
- `onResults()` - Callback to receive results (See provider's query handling for `sendResult()`)
|
|
166
|
+
- `onCompleted()` - Callback when provider is done (See provider's query handling for `done()`)
|
|
167
|
+
- `onError()` - Callback when provider has an error (See provider's query handling for `error()`)
|
|
168
|
+
|
|
169
|
+
### listProviders
|
|
170
|
+
|
|
171
|
+
```js
|
|
172
|
+
await glue.search.listProviders();
|
|
173
|
+
/*
|
|
174
|
+
Example results: [
|
|
175
|
+
{
|
|
176
|
+
appName: "fsbl-test-butler",
|
|
177
|
+
id: "INTERNAL_ID",
|
|
178
|
+
interopId: "INSTANCE_ID",
|
|
179
|
+
name: "registered-search-provider-custom-name",
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
appName: "tester",
|
|
183
|
+
id: "INTERNAL_ID",
|
|
184
|
+
interopId: "INSTANCE_ID",
|
|
185
|
+
name: "my-tester",
|
|
186
|
+
types: [{name: "test-type"}]
|
|
187
|
+
}
|
|
188
|
+
]
|
|
189
|
+
*/
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### listTypes
|
|
193
|
+
|
|
194
|
+
You can see what search types are available. This is especially useful if you are relying on a custom search type from another app, and want to confirm that that app has already been registered.
|
|
195
|
+
|
|
196
|
+
```js
|
|
197
|
+
await glue.search.listTypes();
|
|
198
|
+
/*
|
|
199
|
+
Example results: [
|
|
200
|
+
{name: "customSearchType"},
|
|
201
|
+
{name: "application"},
|
|
202
|
+
{name: "layout"},
|
|
203
|
+
{name: "workspace"},
|
|
204
|
+
{name: "swimlane"},
|
|
205
|
+
{name: "action"}
|
|
206
|
+
]
|
|
207
|
+
*/
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### getDebounceMS, setDebounceMS
|
|
211
|
+
|
|
212
|
+
**Default debounce: 0ms**
|
|
213
|
+
|
|
214
|
+
Queries can be debounced. If you plan on querying based on individual keystrokes or mouse movements, you can potentially generate an unnecessarily large message flurry. Debouncing the queries will reduce search query traffic.
|
|
215
|
+
|
|
216
|
+
Here are examples of getting/setting the debounce time:
|
|
217
|
+
```js
|
|
218
|
+
// Get the debounce time:
|
|
219
|
+
glue.search.getDebounceMS(); // returns 0 by default
|
|
220
|
+
|
|
221
|
+
// Set the debounce time to 20ms:
|
|
222
|
+
glue.search.setDebounceMS(20);
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
## Actions
|
|
226
|
+
TBD
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
## Developer notes
|
|
230
|
+
|
|
231
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
232
|
+
|
|
233
|
+
// package name: @interopio/search-api -> adds the Search API
|
|
234
|
+
|
|
235
|
+
// @interopio/browser-platform -> can use the package to register as a provider or use as a client, by default register as a provider for applications, workspaces, layouts and optionally actions
|
|
236
|
+
// @interopio/browser -> can use the package to register as a provider or use as a client
|
|
237
|
+
// GD3 -> by default register as a provider for applications, workspaces, layouts and optionally actions
|
|
238
|
+
|
|
239
|
+
// Foundation: Interop and Shared Context
|
|
240
|
+
// lib registers: lazily two methods
|
|
241
|
+
// lib uses: shared context to providers state management
|
|
242
|
+
// method used when registered as provider to accept queries
|
|
243
|
+
|
|
244
244
|
// category = display name for type
|
package/changelog.md
CHANGED
|
@@ -1,40 +1,42 @@
|
|
|
1
|
-
3.
|
|
2
|
-
feat: io.Connect Browser 4.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
2.5.
|
|
6
|
-
chore:
|
|
7
|
-
2.
|
|
8
|
-
chore: bump for io.CB 3.
|
|
9
|
-
2.
|
|
10
|
-
chore:
|
|
11
|
-
2.3.
|
|
12
|
-
chore:
|
|
13
|
-
2.2
|
|
14
|
-
chore: bump for io.CB 3.
|
|
15
|
-
2.
|
|
16
|
-
chore: bump for io.CB 3.
|
|
17
|
-
2.0
|
|
18
|
-
chore: bump
|
|
19
|
-
2.0.
|
|
20
|
-
chore:
|
|
21
|
-
2.0.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
1.3.
|
|
26
|
-
|
|
27
|
-
1.3.
|
|
28
|
-
|
|
29
|
-
1.
|
|
30
|
-
chore: bump due to dependencies update
|
|
31
|
-
1.2.
|
|
32
|
-
chore: bump due to dependencies update
|
|
33
|
-
1.2.
|
|
34
|
-
|
|
35
|
-
1.
|
|
36
|
-
|
|
37
|
-
1.1.
|
|
38
|
-
|
|
39
|
-
1.
|
|
1
|
+
3.1.0
|
|
2
|
+
feat: io.Connect Browser 4.1
|
|
3
|
+
3.0.0
|
|
4
|
+
feat: io.Connect Browser 4.0
|
|
5
|
+
2.5.2
|
|
6
|
+
chore: Added descriptions for the d.ts
|
|
7
|
+
2.5.0
|
|
8
|
+
chore: bump for io.CB 3.5
|
|
9
|
+
2.4.0
|
|
10
|
+
chore: bump for io.CB 3.4
|
|
11
|
+
2.3.3
|
|
12
|
+
chore: unified repo bump
|
|
13
|
+
2.3.2
|
|
14
|
+
chore: bump for io.CB 3.3
|
|
15
|
+
2.2.3
|
|
16
|
+
chore: bump for io.CB 3.2
|
|
17
|
+
2.1.0
|
|
18
|
+
chore: bump for io.CB 3.1
|
|
19
|
+
2.0.3
|
|
20
|
+
chore: bump due to dependencies update
|
|
21
|
+
2.0.2
|
|
22
|
+
chore: updated .npmignore
|
|
23
|
+
2.0.1
|
|
24
|
+
feat: Introduce the new IO Connect Search API
|
|
25
|
+
1.3.2
|
|
26
|
+
chore: bump due to dependencies update
|
|
27
|
+
1.3.1
|
|
28
|
+
fix: fixed a bug where multiple providers in the same interop server did not report properly their supported types
|
|
29
|
+
1.3.0
|
|
30
|
+
chore: bump due to dependencies update
|
|
31
|
+
1.2.2
|
|
32
|
+
chore: bump due to dependencies update
|
|
33
|
+
1.2.1
|
|
34
|
+
chore: bump due to dependencies update
|
|
35
|
+
1.2.0
|
|
36
|
+
feat: validated support for the legacy protocol
|
|
37
|
+
1.1.1
|
|
38
|
+
chore: dependencies bump
|
|
39
|
+
1.1.0
|
|
40
|
+
feat: adds "metadata" to the QueryResult
|
|
41
|
+
1.0.0
|
|
40
42
|
feat: initial implementation of the package
|
package/dist/search-api.es.js
CHANGED
package/dist/search-api.umd.js
CHANGED
package/license.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2020 Tick42
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
-
|
|
7
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
-
|
|
9
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Tick42
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interopio/search-api",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.2",
|
|
4
4
|
"description": "Glue42 Search API",
|
|
5
5
|
"main": "./dist/search-api.umd.js",
|
|
6
6
|
"module": "./dist/search-api.es.js",
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
},
|
|
31
31
|
"license": "MIT",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@interopio/core": "^6.7.
|
|
33
|
+
"@interopio/core": "^6.7.2"
|
|
34
34
|
},
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"@interopio:registry": "https://registry.npmjs.org",
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "5e1b40c76048948db4ce39e3eb0133908c7ab048"
|
|
40
40
|
}
|