@sap-cloud-sdk/connectivity
Version:
SAP Cloud SDK for JavaScript connectivity
25 lines (24 loc) • 1.34 kB
TypeScript
import type { Service } from '../environment-accessor';
import type { AuthenticationType, Destination } from './destination-service-types';
import type { IasOptions } from './ias-types';
/**
* Builds destination based on supplied IAS options.
* Uses `targetUrl` as the destination URL if supplied and adds `mtlsKeyPair` if available.
* @param accessToken - The JWT token to access the service.
* @param service - Service binding for identity service.
* @param iasOptions - IAS options to build the destination.
* @returns A destination object.
* @internal
*/
export declare function buildIasDestination(accessToken: string, service: Service, iasOptions: IasOptions): Destination;
/**
* Builds a destination object with a token, name, and url.
* If no authentication type is provided, 'OAuth2ClientCredentials' is used by default.
* @internal
* @param token - The access token for the destination.
* @param url - The URL of the destination.
* @param name - The name of the destination.
* @param authentication - The authentication type for the destination. Defaults to 'OAuth2ClientCredentials'.
* @returns A destination object.
*/
export declare function buildDestination(token: string, url: string, name: string, authentication?: Extract<AuthenticationType, 'OAuth2ClientCredentials' | 'OAuth2JWTBearer'>): Destination;