1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-09-11 13:13:59 +03:00

use npms.io API to load plugins

This commit is contained in:
Eugene Pankov 2022-05-21 19:48:27 -07:00
parent cfa6c104cd
commit 1aa45ddcdf
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4

View File

@ -47,13 +47,9 @@ export class PluginManagerService {
_listAvailableInternal (namePrefix: string, keyword: string, query?: string): Observable<PluginInfo[]> {
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 ?? '')}&size=250`)
).pipe(
map(response => response.data.objects
map(response => response.data.results
.filter(item => !item.keywords?.includes('tabby-dummy-transition-plugin'))
.map(item => ({
name: item.package.name.substring(namePrefix.length),