@sap/cli-core
Version:
Command-Line Interface (CLI) Core Module
27 lines (26 loc) • 1.85 kB
TypeScript
import { URL } from "url";
import { AxiosResponseHeaders, RawAxiosResponseHeaders } from "axios";
import { HTTPConfig, HTTPMethod, KeyValuePair, ParameterMapping, ParameterMappings } from "../../../types";
export declare const checkConfiguration: (config: KeyValuePair) => void;
export declare const removeLeadingPathSegmentForPasscode: (path: string) => string;
export declare const handleMappingIn: (mapping: ParameterMapping, url: URL, value: any, headers: KeyValuePair, bodyWrapper: any) => void;
export declare const getValueFromMappping: (mapping: ParameterMapping, config: any) => any;
export declare const handleParameterMapping: (config: any, url: URL, headers: KeyValuePair, bodyWrapper: any) => (mapping: ParameterMapping) => void;
export declare const buildParameters: (path: string, parameterMappings?: ParameterMappings) => {
url: URL;
headers: KeyValuePair;
body: any;
};
/**
* If --output is present: Return value of --output if defined, otherwise take value from outputPath.
* If --output is not present, print response to console
* @param outputPath Optional path defined by server
* @returns Path to output file
*/
export declare function getOutputFileName(outputPath?: string): string;
export declare function checkResponseDataForInvalidLoginData(response: any): boolean;
export declare const handleResponseData: (data: any, outputPath?: string) => Promise<void>;
export declare function handleResponseHeaders(headers: RawAxiosResponseHeaders | AxiosResponseHeaders): void;
export declare const handleResponse: (data: any, headers?: RawAxiosResponseHeaders | AxiosResponseHeaders) => Promise<void>;
export declare const configRequiresBody: (method: HTTPMethod) => boolean;
export declare const buildHttpConfig: (method: HTTPMethod, path: string, parameterMappings?: ParameterMappings) => Promise<HTTPConfig>;