import type { HttpOptions, HttpsOptions } from 'agentkeepalive' export class AgentConfig { // Sets the working socket to timeout after timeout milliseconds of inactivity on the working socket. timeout: number constructor(timeout = 8000) { this.timeout = timeout } } export type AgentOptions = AgentConfig | HttpOptions | HttpsOptions export interface ApiConfig { url: string timeout: { // sets maximum time to wait for the first byte to arrive from the server, but it does not limit how long the // entire download can take. response: number // sets a deadline for the entire request (including all uploads, redirects, server processing time) to complete. // If the response isn't fully downloaded within that time, the request will be aborted. deadline: number } /** * Configuration for the keepalive agent created by hmpps-rest-client. */ agent: AgentOptions }