Initial commit

This commit is contained in:
root
2025-12-21 09:57:43 -05:00
committed by Sebastian Krupinski
commit db42b6699c
35 changed files with 6458 additions and 0 deletions
+48
View File
@@ -0,0 +1,48 @@
/**
* Service management service
*/
import { fileManagerApi } from './api';
import type { SourceSelector } from '@/types/common';
import type { ServiceInterface, ServiceRecord } from '@/types/service';
export const serviceService = {
/**
* List all available services
*
* @param sources - Optional source selector to filter services
* @returns Promise with service list grouped by provider
*/
async list(sources?: SourceSelector): Promise<ServiceRecord> {
return await fileManagerApi.execute<ServiceRecord>('service.list', {
sources: sources || null
});
},
/**
* Check which services exist/are available
*
* @param sources - Source selector with service IDs to check
* @returns Promise with service availability status
*/
async extant(sources: SourceSelector): Promise<Record<string, boolean>> {
return await fileManagerApi.execute<Record<string, boolean>>('service.extant', { sources });
},
/**
* Fetch a specific service
*
* @param provider - Provider identifier
* @param identifier - Service identifier
* @returns Promise with service details
*/
async fetch(provider: string, identifier: string): Promise<ServiceInterface> {
return await fileManagerApi.execute<ServiceInterface>('service.fetch', {
provider,
identifier
});
},
};
export default serviceService;