import xmlParser from 'fast-xml-parser'; import { IEBayApiRequest } from '../../request'; import { Fields } from './fields'; export declare const defaultXML2JSONParseOptions: { attributeNamePrefix: string; textNodeName: string; ignoreAttributes: boolean; parseAttributeValue: boolean; parseNodeValue: boolean; ignoreNameSpace: boolean; parseTrueNumberOnly: boolean; arrayMode: (_: string, parentTageName: string) => boolean; }; declare type Headers = { [key: string]: string | number | undefined; }; export declare type BodyHeaders = { body: any; headers?: Headers; }; export declare type Options = { raw?: boolean; parseOptions?: object; useIaf?: boolean; headers?: Headers; hook?: (xml: string) => BodyHeaders; }; export declare type XMLReqConfig = Options & { headers: Headers; endpoint: string; xmlns: string; eBayAuthToken?: string | null; }; export declare const defaultOptions: Required>; export declare const defaultHeaders: { 'Content-Type': string; }; /** * XML request for making eBay API call. */ export default class XMLRequest { private readonly callName; private readonly fields; private readonly config; private readonly req; static j2x: xmlParser.j2xParser; /** * Creates the new Request object * * @private * @param {string} callName the callname * @param {Object} fields the fields * @param {Object} req the request * @param {XMLReqConfig} config */ constructor(callName: string, fields: Fields, config: XMLReqConfig, req: IEBayApiRequest); /** * returns the expected name of XML node of a Request * * @private * @return {String} callnameReponse */ private getResponseWrapper; /** * returns the XML structure for the SOAP auth * * @private * @return {Object} the RequesterCredentials */ private getCredentials; private getParseOptions; private getHeaders; /** * Converts an XML response to JSON * * @param {string} xml the xml * @return {JSON} resolves to a JSON representation of the HTML */ toJSON(xml: string): any; /** * returns the XML document for the request * * @private * @param {Fields} fields the fields * @return {String} The XML string of the Request */ toXML(fields: Fields): string; /** * Call the xml api endpoint. * * @private * @return {Promise} resolves to the response * */ request(): Promise; xml2JSON(xml: string): any; } export {};