Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/client.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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;
Expand Down