@sap-cloud-sdk/connectivity
Version:
SAP Cloud SDK for JavaScript connectivity
35 lines (34 loc) • 1.5 kB
TypeScript
import type { Service } from './environment-accessor-types';
/**
* Services getter for a given service.
* @param service - Service name.
* @returns List of service bindings of the given type. Returns an empty array if no service binding exists for the given type.
* @internal
*/
export declare function getServiceBindings(service: string): Service[];
/**
* Returns the first found instance for the given service type.
* Internally uses xsenv library to read configurations from VCAP_SERVICES.
* @param service - The service type.
* @returns The first found service.
*/
export declare function getServiceBinding(service: string): Service | undefined;
/**
* Takes a string that represents the service type and resolves it by calling {@link getServiceBinding}.
* If the parameter is already an instance of {@link Service}, it is returned directly.
*
* Throws an error when no service can be found for the given type.
* @param service - A string representing the service type or a {@link Service} instance.
* @returns A {@link Service} instance.
* @internal
*/
export declare function resolveServiceBinding(service: string | Service): Service;
/**
* Filters services based on service instance name.
*
* Throws an error if no or multiple services exist.
* @param serviceInstanceName - A string representing the service instance name.
* @returns A {@link Service} instance.
* @internal
*/
export declare function getServiceBindingByInstanceName(serviceInstanceName: string): Service;