mirror of
https://github.com/Eugeny/tabby.git
synced 2025-02-05 14:29:47 +08:00
use npms.io API to load plugins
This commit is contained in:
parent
cfa6c104cd
commit
1aa45ddcdf
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user