@agility/content-fetch
Version:
JS/TS library for the Agility Fetch API
34 lines (33 loc) • 1.38 kB
TypeScript
import { Config } from "./types/Config";
interface LogProps {
config: Config;
message: string;
}
declare function logDebug({ config, message }: LogProps): void;
declare function logInfo({ config, message }: LogProps): void;
declare function logWarning({ config, message }: LogProps): void;
declare function logError({ config, message }: LogProps): void;
interface DebugDetails {
type: 'request' | 'response' | 'error';
url?: string;
method?: string;
headers?: Record<string, any>;
statusCode?: number;
statusText?: string;
duration?: number;
timestamp?: string;
errorMessage?: string;
responsePreview?: string;
}
/**
* Logs detailed debug information about requests and responses
*/
declare function logDebugDetails({ config, details }: {
config: Config;
details: DebugDetails;
}): void;
declare function buildRequestUrlPath(config: any, locale: any): string;
declare function buildPathUrl(contentType: any, referenceName: any, skip: any, take: any, sort: any, direction: any, filters: any, filtersLogicOperator: any, filterString: any, contentLinkDepth: any, expandAllContentLinks: any): string;
declare function buildAuthHeader(config: any): any;
declare function isHttps(url: any): boolean;
export { buildPathUrl, buildAuthHeader, buildRequestUrlPath, isHttps, logError, logDebug, logInfo, logWarning, logDebugDetails };