import { type AmServiceSkeleton, type FullService } from '../api/ServiceApi'; import { State } from '../shared/State'; import { type ExportMetaData } from './OpsTypes'; export type Service = { createServiceExportTemplate(): ServiceExportInterface; /** * Get list of services * @param {boolean} globalConfig true if the list of global services is requested, false otherwise. Default: false. */ getListOfServices(globalConfig?: boolean): Promise; /** * Get all services including their descendents. * @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise. Default: false. * @returns Promise resolving to an array of services with their descendants */ getFullServices(globalConfig?: boolean): Promise; /** * Deletes the specified service * @param {string} serviceId The service to delete * @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise. Default: false. */ deleteFullService(serviceId: string, globalConfig?: boolean): Promise; /** * Deletes all services * @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise. Default: false. */ deleteFullServices(globalConfig?: boolean): Promise; /** * Export service. The response can be saved to file as is. * @param serviceId service id/name * @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise. Default: false. * @returns {Promise} Promise resolving to a ServiceExportInterface object. */ exportService(serviceId: string, globalConfig?: boolean): Promise; /** * Export all services * @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise. Default: false. */ exportServices(globalConfig?: boolean): Promise; /** * Imports a single service using a reference to the service and a file to read the data from. Optionally clean (remove) an existing service first * @param {string} serviceId The service id/name to add * @param {ServiceExportInterface} importData The service configuration export data to import * @param {ServiceImportOptions} options Import options * @returns {Promise} A promise resolving to a service object */ importService(serviceId: string, importData: ServiceExportInterface, options: ServiceImportOptions): Promise; /** * Imports multiple services from the same file. Optionally clean (remove) existing services first * @param {ServiceExportInterface} importData The service configuration export data to import * @param {ServiceImportOptions} options Import options * @returns {Promise} A promise resolving to an array of service objects */ importServices(importData: ServiceExportInterface, options: ServiceImportOptions): Promise; }; declare const _default: (state: State) => Service; export default _default; export interface ServiceExportInterface { meta?: ExportMetaData; service: Record; } /** * Service import options */ export interface ServiceImportOptions { /** * Indicates whether to remove previously existing services of the same id before importing */ clean: boolean; /** * Indicates whether to import service(s) as global services */ global: boolean; /** * Indicates whether to import service(s) to the current realm */ realm: boolean; } /** * Create an empty service export template * @returns {SingleTreeExportInterface} an empty service export template */ export declare function createServiceExportTemplate({ state, }: { state: State; }): ServiceExportInterface; /** * Get list of services * @param {boolean} globalConfig true if the list of global services is requested, false otherwise. Default: false. */ export declare function getListOfServices({ globalConfig, state, }: { globalConfig: boolean; state: State; }): Promise; /** * Get all services including their descendents. * @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise. Default: false. * @returns Promise resolving to an array of services with their descendants */ export declare function getFullServices({ globalConfig, state, }: { globalConfig: boolean; state: State; }): Promise; /** * Saves a service including descendents * @param {string} serviceId the service id / name * @param {FullService} fullServiceData service object including descendants * @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise. Default: false. * @returns promise resolving to a service object */ export declare function putFullService({ serviceId, fullServiceData, clean, globalConfig, state, }: { serviceId: string; fullServiceData: FullService; clean: boolean; globalConfig: boolean; state: State; }): Promise; /** * Saves multiple services using the serviceEntries which contain both id and data with descendants * @param {[string, FullService][]} serviceEntries The services to add * @param {boolean} clean Indicates whether to remove possible existing services first * @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise. Default: false. * @param {boolean} realmConfig true if the current realm service is the target of the operation, false otherwise. Default: false. * @returns {Promise} promise resolving to an array of service objects */ export declare function putFullServices({ serviceEntries, clean, globalConfig, realmConfig, state, }: { serviceEntries: [string, FullService][]; clean: boolean; globalConfig: boolean; realmConfig: boolean; state: State; }): Promise; /** * Deletes the specified service * @param {string} serviceId The service to delete * @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise. Default: false. */ export declare function deleteFullService({ serviceId, globalConfig, state, }: { serviceId: string; globalConfig: boolean; state: State; }): Promise; /** * Deletes all services * @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise. Default: false. * @return {Promise} a promise resolving to an array of deleted service objects */ export declare function deleteFullServices({ globalConfig, state, }: { globalConfig: boolean; state: State; }): Promise; /** * Export service. The response can be saved to file as is. * @param serviceId service id/name * @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise. Default: false. * @returns {Promise} Promise resolving to a ServiceExportInterface object. */ export declare function exportService({ serviceId, globalConfig, state, }: { serviceId: string; globalConfig: boolean; state: State; }): Promise; /** * Export all services * @param {boolean} globalConfig true if the global service is the target of the operation, false otherwise. Default: false. */ export declare function exportServices({ globalConfig, state, }: { globalConfig: boolean; state: State; }): Promise; /** * Imports a single service using a reference to the service and a file to read the data from. Optionally clean (remove) an existing service first * @param {string} serviceId The service id/name to add * @param {ServiceExportInterface} importData The service configuration export data to import * @param {ServiceImportOptions} options Import options * @returns {Promise} A promise resolving to a service object */ export declare function importService({ serviceId, importData, options, state, }: { serviceId: string; importData: ServiceExportInterface; options: ServiceImportOptions; state: State; }): Promise; /** * Imports multiple services from the same file. Optionally clean (remove) existing services first * @param {ServiceExportInterface} importData The service configuration export data to import * @param {ServiceImportOptions} options Import options * @returns {Promise} A promise resolving to an array of service objects */ export declare function importServices({ importData, options, state, }: { importData: ServiceExportInterface; options: ServiceImportOptions; state: State; }): Promise; //# sourceMappingURL=ServiceOps.d.ts.map