ipfs-utils
Advanced tools
Comparing version 6.0.8 to 7.0.0
@@ -0,1 +1,15 @@ | ||
# [7.0.0](https://github.com/ipfs/js-ipfs-utils/compare/v6.0.8...v7.0.0) (2021-05-04) | ||
### Bug Fixes | ||
* remove retyping of modules with types ([#125](https://github.com/ipfs/js-ipfs-utils/issues/125)) ([f6406c5](https://github.com/ipfs/js-ipfs-utils/commit/f6406c5af4abb83fa11113202f785e8a7c9f6941)), closes [#109](https://github.com/ipfs/js-ipfs-utils/issues/109) | ||
### BREAKING CHANGES | ||
* `ResponseWithURL` type is not exported any more as it uses a private name and causes an inconsistency between node and the browser | ||
## [6.0.8](https://github.com/ipfs/js-ipfs-utils/compare/v6.0.7...v6.0.8) (2021-04-30) | ||
@@ -2,0 +16,0 @@ |
@@ -1,3 +0,8 @@ | ||
declare const _exports: typeof import("electron-fetch"); | ||
declare const _exports: { | ||
default: any; | ||
Headers: any; | ||
Request: any; | ||
Response: any; | ||
}; | ||
export = _exports; | ||
//# sourceMappingURL=fetch.d.ts.map |
@@ -16,42 +16,37 @@ /// <reference types="node" /> | ||
* @param {HTTPOptions} options | ||
* @returns {Promise<Response>} | ||
* @returns {Promise<ExtendedResponse>} | ||
*/ | ||
fetch(resource: string | Request, options?: HTTPOptions): Promise<Response>; | ||
fetch(resource: string | Request, options?: HTTPOptions): Promise<ExtendedResponse>; | ||
/** | ||
* @param {string | Request} resource | ||
* @param {HTTPOptions} options | ||
* @returns {Promise<Response>} | ||
*/ | ||
post(resource: string | Request, options?: HTTPOptions): Promise<Response>; | ||
post(resource: string | Request, options?: HTTPOptions): Promise<import("./types").ExtendedResponse>; | ||
/** | ||
* @param {string | Request} resource | ||
* @param {HTTPOptions} options | ||
* @returns {Promise<Response>} | ||
*/ | ||
get(resource: string | Request, options?: HTTPOptions): Promise<Response>; | ||
get(resource: string | Request, options?: HTTPOptions): Promise<import("./types").ExtendedResponse>; | ||
/** | ||
* @param {string | Request} resource | ||
* @param {HTTPOptions} options | ||
* @returns {Promise<Response>} | ||
*/ | ||
put(resource: string | Request, options?: HTTPOptions): Promise<Response>; | ||
put(resource: string | Request, options?: HTTPOptions): Promise<import("./types").ExtendedResponse>; | ||
/** | ||
* @param {string | Request} resource | ||
* @param {HTTPOptions} options | ||
* @returns {Promise<Response>} | ||
*/ | ||
delete(resource: string | Request, options?: HTTPOptions): Promise<Response>; | ||
delete(resource: string | Request, options?: HTTPOptions): Promise<import("./types").ExtendedResponse>; | ||
/** | ||
* @param {string | Request} resource | ||
* @param {HTTPOptions} options | ||
* @returns {Promise<Response>} | ||
*/ | ||
options(resource: string | Request, options?: HTTPOptions): Promise<Response>; | ||
options(resource: string | Request, options?: HTTPOptions): Promise<import("./types").ExtendedResponse>; | ||
} | ||
declare namespace HTTP { | ||
export { HTTPError, TimeoutError, fromStream as streamToAsyncIterator, post, get, put, _delete as delete, options, Response, NodeReadableStream, NodeDuplexStream, HTTPOptions }; | ||
export { HTTPError, TimeoutError, fromStream as streamToAsyncIterator, post, get, put, _delete as delete, options, ExtendedResponse, NodeReadableStream, NodeDuplexStream, HTTPOptions }; | ||
} | ||
type HTTPOptions = import('./types').HTTPOptions; | ||
import { Request } from "./http/fetch.node"; | ||
type Response = import('native-fetch').Response; | ||
import { Request } from "./http/fetch.browser"; | ||
type ExtendedResponse = import('./types').ExtendedResponse; | ||
import { HTTPError } from "./http/error"; | ||
@@ -67,8 +62,8 @@ import { TimeoutError } from "./http/error"; | ||
declare function fromStream<TChunk>(source: import("stream").Readable | ReadableStream<TChunk> | null): AsyncIterable<TChunk>; | ||
declare function post(resource: string | Request, options?: import("./types").HTTPOptions | undefined): Promise<Response>; | ||
declare function get(resource: string | Request, options?: import("./types").HTTPOptions | undefined): Promise<Response>; | ||
declare function put(resource: string | Request, options?: import("./types").HTTPOptions | undefined): Promise<Response>; | ||
declare function options(resource: string | Request, options?: import("./types").HTTPOptions | undefined): Promise<Response>; | ||
declare function post(resource: string | Request, options?: import("./types").HTTPOptions | undefined): Promise<import("./types").ExtendedResponse>; | ||
declare function get(resource: string | Request, options?: import("./types").HTTPOptions | undefined): Promise<import("./types").ExtendedResponse>; | ||
declare function put(resource: string | Request, options?: import("./types").HTTPOptions | undefined): Promise<import("./types").ExtendedResponse>; | ||
declare function options(resource: string | Request, options?: import("./types").HTTPOptions | undefined): Promise<import("./types").ExtendedResponse>; | ||
type NodeReadableStream = import('stream').Readable; | ||
type NodeDuplexStream = import('stream').Duplex; | ||
//# sourceMappingURL=http.d.ts.map |
@@ -7,7 +7,7 @@ export class TimeoutError extends Error { | ||
/** | ||
* @param {import('native-fetch').Response} response | ||
* @param {Response} response | ||
*/ | ||
constructor(response: import('native-fetch').Response); | ||
response: import("native-fetch").Response; | ||
constructor(response: Response); | ||
response: Response; | ||
} | ||
//# sourceMappingURL=error.d.ts.map |
@@ -7,15 +7,6 @@ export type FetchOptions = import('../types').FetchOptions; | ||
*/ | ||
declare function fetchWith(url: string | Request, options?: FetchOptions): Promise<Response>; | ||
import { Request } from "../../types/electron-fetch"; | ||
import { Headers } from "../../types/electron-fetch"; | ||
export class ResponseWithURL extends Response { | ||
/** | ||
* @param {string} url | ||
* @param {BodyInit} body | ||
* @param {ResponseInit} options | ||
*/ | ||
constructor(url: string, body: BodyInit, options: ResponseInit); | ||
} | ||
import { Response } from "../../types/electron-fetch"; | ||
declare function fetchWith(url: string | Request, options?: FetchOptions): any; | ||
import { Request } from "native-fetch"; | ||
import { Headers } from "native-fetch"; | ||
export { fetchWith as fetch, Request, Headers }; | ||
//# sourceMappingURL=fetch.browser.d.ts.map |
@@ -1,3 +0,7 @@ | ||
declare const _exports: typeof import("./fetch.node"); | ||
declare const _exports: { | ||
fetch: (url: string | Request, options?: import("../types").FetchOptions) => any; | ||
Request: any; | ||
Headers: any; | ||
}; | ||
export = _exports; | ||
//# sourceMappingURL=fetch.d.ts.map |
@@ -1,2 +0,1 @@ | ||
export type BodyInit = import('native-fetch').BodyInit; | ||
export type NodeReadableStream = import('stream').Readable; | ||
@@ -6,3 +5,2 @@ export type FetchOptions = import('../types').FetchOptions; | ||
/** | ||
* @typedef {import('native-fetch').BodyInit} BodyInit | ||
* @typedef {import('stream').Readable} NodeReadableStream | ||
@@ -19,6 +17,6 @@ * | ||
export function fetch(url: string | Request, options?: import("../types").FetchOptions | undefined): Promise<Response>; | ||
import { Request } from "../../types/electron-fetch"; | ||
import { Headers } from "../../types/electron-fetch"; | ||
import { Response } from "../../types/electron-fetch"; | ||
import { Request } from "native-fetch"; | ||
import { Headers } from "native-fetch"; | ||
import { Response } from "native-fetch"; | ||
export { Request, Headers }; | ||
//# sourceMappingURL=fetch.node.d.ts.map |
@@ -1,2 +0,1 @@ | ||
import type { RequestInit, Response } from '../types/native-fetch' | ||
interface ProgressStatus { | ||
@@ -54,1 +53,7 @@ total: number | ||
} | ||
export interface ExtendedResponse extends Response { | ||
iterator: () => AsyncGenerator<Uint8Array, void, undefined> | ||
ndjson: () => AsyncGenerator<any, void, undefined> | ||
} |
{ | ||
"name": "ipfs-utils", | ||
"version": "6.0.8", | ||
"version": "7.0.0", | ||
"description": "Package to aggregate shared logic and dependencies for the IPFS ecosystem", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -12,3 +12,3 @@ /* eslint-disable no-undef */ | ||
/** | ||
* @typedef {import('native-fetch').Response} Response | ||
* @typedef {import('./types').ExtendedResponse} ExtendedResponse | ||
* @typedef {import('stream').Readable} NodeReadableStream | ||
@@ -92,3 +92,3 @@ * @typedef {import('stream').Duplex} NodeDuplexStream | ||
* @param {HTTPOptions} options | ||
* @returns {Promise<Response>} | ||
* @returns {Promise<ExtendedResponse>} | ||
*/ | ||
@@ -173,3 +173,2 @@ async fetch (resource, options = {}) { | ||
* @param {HTTPOptions} options | ||
* @returns {Promise<Response>} | ||
*/ | ||
@@ -183,3 +182,2 @@ post (resource, options = {}) { | ||
* @param {HTTPOptions} options | ||
* @returns {Promise<Response>} | ||
*/ | ||
@@ -193,3 +191,2 @@ get (resource, options = {}) { | ||
* @param {HTTPOptions} options | ||
* @returns {Promise<Response>} | ||
*/ | ||
@@ -203,3 +200,2 @@ put (resource, options = {}) { | ||
* @param {HTTPOptions} options | ||
* @returns {Promise<Response>} | ||
*/ | ||
@@ -213,3 +209,2 @@ delete (resource, options = {}) { | ||
* @param {HTTPOptions} options | ||
* @returns {Promise<Response>} | ||
*/ | ||
@@ -345,3 +340,2 @@ options (resource, options = {}) { | ||
* @param {HTTPOptions} [options] | ||
* @returns {Promise<Response>} | ||
*/ | ||
@@ -353,3 +347,2 @@ HTTP.post = (resource, options) => new HTTP(options).post(resource, options) | ||
* @param {HTTPOptions} [options] | ||
* @returns {Promise<Response>} | ||
*/ | ||
@@ -361,3 +354,2 @@ HTTP.get = (resource, options) => new HTTP(options).get(resource, options) | ||
* @param {HTTPOptions} [options] | ||
* @returns {Promise<Response>} | ||
*/ | ||
@@ -369,3 +361,2 @@ HTTP.put = (resource, options) => new HTTP(options).put(resource, options) | ||
* @param {HTTPOptions} [options] | ||
* @returns {Promise<Response>} | ||
*/ | ||
@@ -377,3 +368,2 @@ HTTP.delete = (resource, options) => new HTTP(options).delete(resource, options) | ||
* @param {HTTPOptions} [options] | ||
* @returns {Promise<Response>} | ||
*/ | ||
@@ -380,0 +370,0 @@ HTTP.options = (resource, options) => new HTTP(options).options(resource, options) |
@@ -21,3 +21,3 @@ 'use strict' | ||
/** | ||
* @param {import('native-fetch').Response} response | ||
* @param {Response} response | ||
*/ | ||
@@ -24,0 +24,0 @@ constructor (response) { |
@@ -139,4 +139,3 @@ 'use strict' | ||
Request, | ||
Headers, | ||
ResponseWithURL | ||
Headers | ||
} |
@@ -8,3 +8,2 @@ 'use strict' | ||
/** | ||
* @typedef {import('native-fetch').BodyInit} BodyInit | ||
* @typedef {import('stream').Readable} NodeReadableStream | ||
@@ -11,0 +10,0 @@ * |
@@ -1,2 +0,1 @@ | ||
import type { RequestInit, Response } from '../types/native-fetch' | ||
interface ProgressStatus { | ||
@@ -54,1 +53,7 @@ total: number | ||
} | ||
export interface ExtendedResponse extends Response { | ||
iterator: () => AsyncGenerator<Uint8Array, void, undefined> | ||
ndjson: () => AsyncGenerator<any, void, undefined> | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
58459
58
1100