mirror of
https://github.com/Eugeny/tabby.git
synced 2025-09-24 09:06:03 +00:00
use npms.io API to load plugins
This commit is contained in:
@@ -47,13 +47,9 @@ export class PluginManagerService {
|
|||||||
|
|
||||||
_listAvailableInternal (namePrefix: string, keyword: string, query?: string): Observable<PluginInfo[]> {
|
_listAvailableInternal (namePrefix: string, keyword: string, query?: string): Observable<PluginInfo[]> {
|
||||||
return from(
|
return from(
|
||||||
axios.get(`https://www.npmjs.com/search?q=keywords%3A${keyword}+${encodeURIComponent(query ?? '')}&from=0&size=1000`, {
|
axios.get(`https://api.npms.io/v2/search?q=keywords%3A${keyword}+${encodeURIComponent(query ?? '')}&size=250`)
|
||||||
headers: {
|
|
||||||
'x-spiferack': '1',
|
|
||||||
},
|
|
||||||
})
|
|
||||||
).pipe(
|
).pipe(
|
||||||
map(response => response.data.objects
|
map(response => response.data.results
|
||||||
.filter(item => !item.keywords?.includes('tabby-dummy-transition-plugin'))
|
.filter(item => !item.keywords?.includes('tabby-dummy-transition-plugin'))
|
||||||
.map(item => ({
|
.map(item => ({
|
||||||
name: item.package.name.substring(namePrefix.length),
|
name: item.package.name.substring(namePrefix.length),
|
||||||
|
Reference in New Issue
Block a user