1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-12-24 19:13:31 +03:00

use npms.io instead of npmjs.org for plugin search

This commit is contained in:
Eugene Pankov 2018-07-02 19:53:27 +02:00
parent 1e902d734f
commit 9c6f2747aa

View File

@ -72,13 +72,9 @@ export class PluginManagerService {
listAvailable (query?: string): Observable<IPluginInfo[]> {
return from(
axios.get(`https://www.npmjs.com/search?q=keywords%3A${KEYWORD}+${encodeURIComponent(query || '')}&from=0&size=1000`, {
headers: {
'x-spiferack': '1',
}
})
axios.get(`https://api.npms.io/v2/search?q=keywords%3A${KEYWORD}+${encodeURIComponent(query || '')}&from=0&size=250`, {})
).pipe(
map(response => response.data.objects.map(item => ({
map(response => response.data.results.map(item => ({
name: item.package.name.substring(NAME_PREFIX.length),
packageName: item.package.name,
description: item.package.description,