From 2c5ab087d926098cf5117938d63598f355fabb5d Mon Sep 17 00:00:00 2001 From: Brett Willis Date: Fri, 10 Nov 2023 10:13:44 +1300 Subject: [PATCH] Expose Got agent types in client options --- src/api/api.ts | 8 ++++---- src/client.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/api/api.ts b/src/api/api.ts index eccfdcd6..a80d507d 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 45bc830a..7783e8ee 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;