From 580d4897c94f0f19734e7cca4b1768c1bc1d276b Mon Sep 17 00:00:00 2001 From: Jonas Graterol Date: Tue, 21 Sep 2021 13:06:26 -0500 Subject: [PATCH 1/2] types: add missing agent option See inline comment. --- src/index.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/index.ts b/src/index.ts index ef223099..01707567 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,6 @@ import 'isomorphic-fetch'; + +import {Agent} from 'http'; import promiseRetry from 'promise-retry'; import getRequestOptions from './get_request_options'; @@ -6,6 +8,11 @@ import getRequestOptions from './get_request_options'; export type ShouldRetry = (responseOrError: Response | Error) => boolean; export interface JsonFetchOptions extends Omit { + // node-fetch extensions (not available in browsers, i.e. whatwg-fetch) – + // see https://github.com/node-fetch/node-fetch/blob/8721d79208ad52c44fffb4b5b5cfa13b936022c3/%40types/index.d.ts#L76: + agent?: Agent | ((parsedUrl: URL) => Agent); + + // goodeggs-fetch options: body?: Record; shouldRetry?: (responseOrError: Response | Error) => boolean; retry?: Parameters[0]; From e3473c3d9ad70b10500015ae376b54b1c176e57e Mon Sep 17 00:00:00 2001 From: Jonas Graterol Date: Thu, 23 Sep 2021 21:43:05 -0500 Subject: [PATCH 2/2] v9.0.6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e40a9214..4e7a1fce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "json-fetch", - "version": "9.0.5", + "version": "9.0.6", "description": "A wrapper around ES6 fetch to simplify interacting with JSON APIs.", "author": "Good Eggs ", "contributors": [