Initial commit
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* Provider management service
|
||||
*/
|
||||
|
||||
import { fileManagerApi } from './api';
|
||||
import type { SourceSelector } from '@/types/common';
|
||||
import type { ProviderRecord } from '@/types/provider';
|
||||
|
||||
export const providerService = {
|
||||
|
||||
/**
|
||||
* List all available providers
|
||||
*
|
||||
* @param sources - Optional source selector to filter providers
|
||||
* @returns Promise with provider list keyed by provider ID
|
||||
*/
|
||||
async list(sources?: SourceSelector): Promise<ProviderRecord> {
|
||||
return await fileManagerApi.execute<ProviderRecord>('provider.list', {
|
||||
sources: sources || null
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Check which providers exist/are available
|
||||
*
|
||||
* @param sources - Source selector with provider IDs to check
|
||||
* @returns Promise with provider availability status
|
||||
*/
|
||||
async extant(sources: SourceSelector): Promise<Record<string, boolean>> {
|
||||
return await fileManagerApi.execute<Record<string, boolean>>('provider.extant', { sources });
|
||||
},
|
||||
};
|
||||
|
||||
export default providerService;
|
||||
Reference in New Issue
Block a user