import type { Logger } from '@sap-ux/logger'; /** * Message detail object */ export interface MessageDetail { code: string; message: string; severity: string; longtext_url?: string; } /** * Structure of a Gateway response message */ export interface SuccessMessage { code: string; message: string; longtext_url?: string; details: MessageDetail[]; } /** * Structure of a Gateway error */ export interface ErrorMessage { code: string; message: { lang?: string; value: string; }; longtext_url?: string; innererror: { transactionid: string; timestamp: string; Error_Resolution: object; errordetails: MessageDetail[]; }; } /** * Log a Gateway response. * * @param options options * @param options.msg message string returned from gateway * @param options.log logger to be used * @param options.host optional url that should logged as clickable url * @param options.isDest optional destination flag */ export declare function prettyPrintMessage({ msg, log, host, isDest }: { msg: string; log: Logger; host?: string; isDest?: boolean; }): void; /** * Log Gateway errors returned from the S_MGW_ODATA_INNER_ERROR table which is a store of OData Inner Error data. In certain flows, * for example, when test mode is enabled, not all error details should be displayed to the user and need to be restricted. * * @param options options * @param options.error error message returned from gateway * @param options.log logger to be used * @param options.host optional host name to pretty print links * @param options.isDest optional value if additional info should be printed * @param showAllMessages optional, show all errors but restrict for certain flows i.e. test mode */ export declare function prettyPrintError({ error, log, host, isDest }: { error: ErrorMessage; log: Logger; host?: string; isDest?: boolean; }, showAllMessages?: boolean): void; /** * Print a user friendly time string. * * @param ms time in ms * @returns user friendly string */ export declare const prettyPrintTimeInMs: (ms: number) => string; /** * Log errors more user friendly if it is a standard Gateway error. * * @param e error thrown by Axios after sending a request * @param e.error error from Axios * @param e.log logger to be used * @param e.host optional hostname * @param e.isDest optional destination flag */ export declare function logError({ error, host, log, isDest }: { error: Error; host?: string; log: Logger; isDest?: boolean; }): void; /** * Get ErrorMessage object from response contain an error as a string. * * @param data string value * @returns undefined if an error object is not found or populated ErrorMessage object */ export declare function getErrorMessageFromString(data: unknown): ErrorMessage | undefined; //# sourceMappingURL=message.d.ts.map