ipfs-utils
Advanced tools
Comparing version 6.0.4 to 6.0.5
@@ -0,1 +1,10 @@ | ||
## [6.0.5](https://github.com/ipfs/js-ipfs-utils/compare/v6.0.4...v6.0.5) (2021-04-01) | ||
### Bug Fixes | ||
* do not use electron-fetch types ([#113](https://github.com/ipfs/js-ipfs-utils/issues/113)) ([658a725](https://github.com/ipfs/js-ipfs-utils/commit/658a725148715b3c6e3653e01d8ed6dab53d8401)) | ||
## [6.0.4](https://github.com/ipfs/js-ipfs-utils/compare/v6.0.3...v6.0.4) (2021-03-22) | ||
@@ -2,0 +11,0 @@ |
@@ -55,3 +55,3 @@ /// <reference types="node" /> | ||
import { Request } from "./http/fetch.node"; | ||
type Response = import("../types/electron-fetch").Response; | ||
type Response = import("../types/native-fetch").Response; | ||
import { HTTPError } from "./http/error"; | ||
@@ -58,0 +58,0 @@ import { TimeoutError } from "./http/error"; |
@@ -9,7 +9,7 @@ export class TimeoutError extends Error { | ||
/** | ||
* @param {import('electron-fetch').Response} response | ||
* @param {import('native-fetch').Response} response | ||
*/ | ||
constructor(response: import('electron-fetch').Response); | ||
response: import("../../types/electron-fetch").Response; | ||
constructor(response: import('native-fetch').Response); | ||
response: import("../../types/native-fetch").Response; | ||
} | ||
//# sourceMappingURL=error.d.ts.map |
@@ -7,3 +7,3 @@ /// <reference types="node" /> | ||
/** | ||
* @typedef {import('electron-fetch').BodyInit} BodyInit | ||
* @typedef {import('native-fetch').BodyInit} BodyInit | ||
* @typedef {import('stream').Readable} NodeReadableStream | ||
@@ -10,0 +10,0 @@ * |
@@ -1,54 +0,53 @@ | ||
import type { RequestInit, Response } from 'electron-fetch'; | ||
import type { RequestInit, Response } from '../types/native-fetch' | ||
interface ProgressStatus { | ||
total: number; | ||
loaded: number; | ||
lengthComputable: boolean; | ||
total: number | ||
loaded: number | ||
lengthComputable: boolean | ||
} | ||
export interface ProgressFn { | ||
(status: ProgressStatus): void; | ||
} | ||
export interface ProgressFn { (status: ProgressStatus): void } | ||
export interface FetchOptions extends RequestInit { | ||
/** | ||
* Amount of time until request should timeout in ms. | ||
*/ | ||
timeout?: number; | ||
/** | ||
* URL search param. | ||
*/ | ||
searchParams?: URLSearchParams; | ||
/** | ||
* Can be passed to track upload progress. | ||
* Note that if this option in passed underlying request will be performed using `XMLHttpRequest` and response will not be streamed. | ||
*/ | ||
onUploadProgress?: ProgressFn; | ||
/** | ||
* Can be passed to track download progress. | ||
*/ | ||
onDownloadProgress?: ProgressFn; | ||
overrideMimeType?: string; | ||
/** | ||
* Amount of time until request should timeout in ms. | ||
*/ | ||
timeout?: number | ||
/** | ||
* URL search param. | ||
*/ | ||
searchParams?: URLSearchParams | ||
/** | ||
* Can be passed to track upload progress. | ||
* Note that if this option in passed underlying request will be performed using `XMLHttpRequest` and response will not be streamed. | ||
*/ | ||
onUploadProgress?: ProgressFn | ||
/** | ||
* Can be passed to track download progress. | ||
*/ | ||
onDownloadProgress?: ProgressFn | ||
overrideMimeType?: string | ||
} | ||
export interface HTTPOptions extends FetchOptions { | ||
json?: any; | ||
/** | ||
* The base URL to use in case url is a relative URL | ||
*/ | ||
base?: string; | ||
/** | ||
* Throw not ok responses as Errors | ||
*/ | ||
throwHttpErrors?: boolean; | ||
/** | ||
* Transform search params | ||
*/ | ||
transformSearchParams?: (params: URLSearchParams) => URLSearchParams; | ||
/** | ||
* When iterating the response body, transform each chunk with this function. | ||
*/ | ||
transform?: (chunk: any) => any; | ||
/** | ||
* Handle errors | ||
*/ | ||
handleError?: (rsp: Response) => Promise<void>; | ||
json?: any | ||
/** | ||
* The base URL to use in case url is a relative URL | ||
*/ | ||
base?: string | ||
/** | ||
* Throw not ok responses as Errors | ||
*/ | ||
throwHttpErrors?: boolean | ||
/** | ||
* Transform search params | ||
*/ | ||
transformSearchParams?: (params: URLSearchParams) => URLSearchParams | ||
/** | ||
* When iterating the response body, transform each chunk with this function. | ||
*/ | ||
transform?: (chunk: any) => any | ||
/** | ||
* Handle errors | ||
*/ | ||
handleError?: (rsp: Response) => Promise<void> | ||
} | ||
export {}; | ||
//# sourceMappingURL=types.d.ts.map |
{ | ||
"name": "ipfs-utils", | ||
"version": "6.0.4", | ||
"version": "6.0.5", | ||
"description": "Package to aggregate shared logic and dependencies for the IPFS ecosystem", | ||
@@ -19,3 +19,5 @@ "main": "src/index.js", | ||
"./test/files/glob-source.spec.js": false, | ||
"electron-fetch": false | ||
"electron-fetch": false, | ||
"fs-extra": false, | ||
"graceful-fs": false | ||
}, | ||
@@ -67,4 +69,5 @@ "types": "dist/src/index.d.ts", | ||
"@types/fs-extra": "^9.0.5", | ||
"aegir": "^30.3.0", | ||
"aegir": "^32.2.0", | ||
"delay": "^5.0.0", | ||
"events": "^3.3.0", | ||
"ipfs-unixfs": "^4.0.1", | ||
@@ -74,3 +77,5 @@ "it-all": "^1.0.4", | ||
"it-last": "^1.0.4", | ||
"uint8arrays": "^2.0.5" | ||
"readable-stream": "^3.6.0", | ||
"uint8arrays": "^2.0.5", | ||
"util": "^0.12.3" | ||
}, | ||
@@ -77,0 +82,0 @@ "eslintConfig": { |
@@ -13,3 +13,3 @@ /* eslint-disable no-undef */ | ||
/** | ||
* @typedef {import('electron-fetch').Response} Response | ||
* @typedef {import('native-fetch').Response} Response | ||
* @typedef {import('stream').Readable} NodeReadableStream | ||
@@ -16,0 +16,0 @@ * @typedef {import('stream').Duplex} NodeDuplexStream |
@@ -21,3 +21,3 @@ 'use strict' | ||
/** | ||
* @param {import('electron-fetch').Response} response | ||
* @param {import('native-fetch').Response} response | ||
*/ | ||
@@ -24,0 +24,0 @@ constructor (response) { |
@@ -8,3 +8,3 @@ 'use strict' | ||
/** | ||
* @typedef {import('electron-fetch').BodyInit} BodyInit | ||
* @typedef {import('native-fetch').BodyInit} BodyInit | ||
* @typedef {import('stream').Readable} NodeReadableStream | ||
@@ -11,0 +11,0 @@ * |
Sorry, the diff of this file is not supported yet
66079
12
61
1334