cocoda-sdk 3.3.0 → 3.3.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.
|
@@ -205,34 +205,34 @@ class ConceptApiProvider extends BaseProvider {
|
|
|
205
205
|
}
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
|
-
async suggest({ use = "notation,label", types = [], sort = "score", ...config }) {
|
|
208
|
+
async suggest({ use = "notation,label", types = [], sort = "score", params = {}, ...config }) {
|
|
209
209
|
return this._search({
|
|
210
210
|
...config,
|
|
211
211
|
endpoint: "suggest",
|
|
212
212
|
params: {
|
|
213
|
-
...
|
|
213
|
+
...params,
|
|
214
214
|
type: types.join("|"),
|
|
215
215
|
use,
|
|
216
216
|
sort
|
|
217
217
|
}
|
|
218
218
|
});
|
|
219
219
|
}
|
|
220
|
-
async search({ types = [], ...config }) {
|
|
220
|
+
async search({ types = [], params = {}, ...config }) {
|
|
221
221
|
return this._search({
|
|
222
222
|
...config,
|
|
223
223
|
endpoint: "search",
|
|
224
224
|
params: {
|
|
225
|
-
...
|
|
225
|
+
...params,
|
|
226
226
|
type: types.join("|")
|
|
227
227
|
}
|
|
228
228
|
});
|
|
229
229
|
}
|
|
230
|
-
async vocSuggest({ use = "notation,label", sort = "score", ...config }) {
|
|
230
|
+
async vocSuggest({ use = "notation,label", sort = "score", params = {}, ...config }) {
|
|
231
231
|
return this._search({
|
|
232
232
|
...config,
|
|
233
233
|
endpoint: "voc-suggest",
|
|
234
234
|
params: {
|
|
235
|
-
...
|
|
235
|
+
...params,
|
|
236
236
|
use,
|
|
237
237
|
sort
|
|
238
238
|
}
|
|
@@ -244,8 +244,8 @@ class ConceptApiProvider extends BaseProvider {
|
|
|
244
244
|
endpoint: "voc-search"
|
|
245
245
|
});
|
|
246
246
|
}
|
|
247
|
-
async _search({ endpoint, scheme, search, limit, offset, params, ...config }) {
|
|
248
|
-
|
|
247
|
+
async _search({ endpoint, scheme, search, limit, offset, params, url, ...config }) {
|
|
248
|
+
url = url ?? this._api[endpoint];
|
|
249
249
|
if (!url) {
|
|
250
250
|
throw new errors.MissingApiUrlError();
|
|
251
251
|
}
|
|
@@ -12,7 +12,7 @@ class LabelSearchSuggestionProvider extends BaseProvider {
|
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
supportsScheme(scheme) {
|
|
15
|
-
return _.get(scheme, "_registry.has.search", false);
|
|
15
|
+
return super.supportsScheme(scheme) && _.get(scheme, "_registry.has.search", false);
|
|
16
16
|
}
|
|
17
17
|
async getMappings({ from, to, mode, selected, limit = 10, ...config }) {
|
|
18
18
|
if (mode != "or") {
|
|
@@ -87,8 +87,10 @@ class LabelSearchSuggestionProvider extends BaseProvider {
|
|
|
87
87
|
if (!registry || registry.has.search === false) {
|
|
88
88
|
return [];
|
|
89
89
|
}
|
|
90
|
+
let url = (this._jskos.overrides || []).find((o) => jskos.compare(o, targetScheme))?.search;
|
|
90
91
|
const data = await registry.search({
|
|
91
92
|
...config,
|
|
93
|
+
url,
|
|
92
94
|
search: label,
|
|
93
95
|
scheme: targetScheme,
|
|
94
96
|
limit
|