import { Config, ClientRequestParser, HttpOptions } from '../providers'; import { AuthClient } from './auth.client'; /** * D4H API Request Parser * ============================================================================= * This client extends Angular's HttpClient to offer the signing functionality * required for the D4H API. ApiHttpClient populates the complete server URL based * on configured region and version. */ export declare class ParserClient implements ClientRequestParser { private readonly config; private readonly auth; constructor(config: Config, auth: AuthClient); /** * Build Full API URL * =========================================================================== */ url(config: Config, url: string): string; /** * Prepare Request Options * =========================================================================== */ options(config: Config, url: string, options?: HttpOptions): HttpOptions; /** * Add D4H Headers * =========================================================================== * Add configured client version and name to headers, and insert bearer token * if required. */ private headers; /** * Stringify Date Parameters * =========================================================================== * Traverse request params and stringify Date and Moment objects in ISO 8601 * format based on a shallow copy of the parameters options. * * As well as returning dates in ISO 8601 format, the D4H API expects query * parameters and body payloads to encode dates in this format. * encodeURIComponent is used to encode URL parameters: * * @example * * // output -> Sat Nov 24 2018 10:22:35 GMT 0000 * encodeURIComponent(moment('Sat Nov 24 2018 10:22:35 GMT 0000')) * * Calling .toISOString() on a Date or Moment before this will return the * correct format: * * @example * * // output -> 2018-11-24T10:19:13.535Z * moment('Sat Nov 24 2018 10:22:35 GMT 0000').toISOString(); */ private stringifyDates; }