diff --git a/src/api/api.ts b/src/api/api.ts index eccfdcd..a80d507 100644 --- a/src/api/api.ts +++ b/src/api/api.ts @@ -5,14 +5,14 @@ import process = require('process'); import _ = require('lodash'); import { v4 as uuidv4 } from 'uuid'; import * as url from 'url'; -import got from 'got'; +import got, { Agents } from 'got'; import qs from 'qs'; import { Environments, CLIENT_VERSION, API_VERSION } from '../constants'; import * as GoCardlessErrors from '../errors'; -interface APIOptions { - proxy?: object; +export interface APIOptions { + proxy?: Agents; raiseOnIdempotencyConflict?: boolean; } @@ -36,7 +36,7 @@ export class Api { private _token: string; private _environment: Environments; private _baseUrl: string; - private _agent: object; + private _agent: Agents | undefined; private raiseOnIdempotencyConflict: boolean; private processVersion: string; diff --git a/src/client.ts b/src/client.ts index 45bc830..7783e8e 100644 --- a/src/client.ts +++ b/src/client.ts @@ -1,7 +1,7 @@ 'use strict'; import { Environments } from './constants'; -import { Api } from './api/api'; +import { Api, APIOptions } from './api/api'; import { BankAuthorisationService } from './services/bankAuthorisationService'; import { BankDetailsLookupService } from './services/bankDetailsLookupService'; import { BillingRequestService } from './services/billingRequestService'; @@ -71,7 +71,7 @@ export class GoCardlessClient { private _verificationDetails: VerificationDetailService; private _webhooks: WebhookService; - constructor(token: string, environment = Environments.Live, options = {}) { + constructor(token: string, environment = Environments.Live, options: APIOptions = {}) { this._api = new Api(token, environment, options); this._bankAuthorisations = undefined;