Initial commit
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* Service management service
|
||||
*/
|
||||
|
||||
import { transceivePost } from './transceive';
|
||||
import type {
|
||||
ServiceListRequest,
|
||||
ServiceListResponse,
|
||||
ServiceExtantRequest,
|
||||
ServiceExtantResponse,
|
||||
ServiceFetchRequest,
|
||||
ServiceFetchResponse,
|
||||
} from '../types/service';
|
||||
|
||||
export const serviceService = {
|
||||
|
||||
/**
|
||||
* List all available services
|
||||
*
|
||||
* @param request - Service list request parameters
|
||||
* @returns Promise with service list grouped by provider
|
||||
*/
|
||||
async list(request: ServiceListRequest = {}): Promise<ServiceListResponse> {
|
||||
return await transceivePost<ServiceListRequest, ServiceListResponse>('service.list', request);
|
||||
},
|
||||
|
||||
/**
|
||||
* Check which services exist/are available
|
||||
*
|
||||
* @param request - Service extant request with source selector
|
||||
* @returns Promise with service availability status
|
||||
*/
|
||||
async extant(request: ServiceExtantRequest): Promise<ServiceExtantResponse> {
|
||||
return await transceivePost('service.extant', request);
|
||||
},
|
||||
|
||||
/**
|
||||
* Fetch a specific service
|
||||
*
|
||||
* @param request - Service fetch request with provider and service IDs
|
||||
* @returns Promise with service details
|
||||
*/
|
||||
async fetch(request: ServiceFetchRequest): Promise<ServiceFetchResponse> {
|
||||
return await transceivePost('service.fetch', request);
|
||||
},
|
||||
};
|
||||
|
||||
export default serviceService;
|
||||
Reference in New Issue
Block a user