@sap-cloud-sdk/core
Version:
SAP Cloud SDK for JavaScript core
59 lines • 2.34 kB
TypeScript
import { AuthenticationType, Destination, DestinationNameAndJwt } from './destination-service-types';
/**
* Takes an existing or a parsed destination and returns an SDK compatible destination object.
* @param destination - An object that adheres to the [[Destination]] interface.
* @returns An SDK compatible destination object.
*/
export declare function sanitizeDestination(destination: Record<string, any>): Destination;
/**
* Takes a JSON object returned by any of the calls to the destination service and returns an SDK compatible destination object.
* This function only accepts destination configurations of type 'HTTP' and will error if no 'URL' is given.
* @param destinationJson - A JSON object returned by the destination service.
* @returns An SDK compatible destination object.
*/
export declare function parseDestination(destinationJson: DestinationJson | DestinationConfiguration): Destination;
/**
* @hidden
*/
export declare function toDestinationNameUrl(destination: Destination | DestinationNameAndJwt): string;
/**
* Destination configuration alongside authtokens and certificates.
*/
export interface DestinationJson {
[key: string]: any;
destinationConfiguration: DestinationConfiguration;
authTokens?: Record<string, string>[];
certificates?: Record<string, string>[];
}
/**
* Configuration of a destination as it is available through the destination service.
*/
export interface DestinationConfiguration {
[key: string]: any;
URL: string;
Name?: string;
ProxyType?: string;
'sap-client'?: string;
User?: string;
Password?: string;
Authentication?: AuthenticationType;
TrustAll?: string;
tokenServiceURL?: string;
tokenServiceURLType?: 'Common' | 'Dedicated;';
tokenServiceUsername?: string;
tokenServicePass?: string;
clientId?: string;
clientSecret?: string;
SystemUser?: string;
Type?: 'HTTP' | 'LDAP' | 'MAIL' | 'RFC';
}
/**
* @hidden
*/
export declare function isDestinationConfiguration(destination: any): destination is DestinationConfiguration;
/**
* @hidden
*/
export declare function isDestinationJson(destination: any): destination is DestinationJson;
export declare function noDestinationErrorMessage(destination: Destination | DestinationNameAndJwt): string;
//# sourceMappingURL=destination.d.ts.map