undici 6.16.0 → 6.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "undici",
3
- "version": "6.16.0",
3
+ "version": "6.17.0",
4
4
  "description": "An HTTP/1.1 client, written from scratch for Node.js",
5
5
  "homepage": "https://undici.nodejs.org",
6
6
  "bugs": {
@@ -88,6 +88,8 @@
88
88
  "test:typescript": "tsd && tsc --skipLibCheck test/imports/undici-import.ts",
89
89
  "test:webidl": "borp -p \"test/webidl/*.js\"",
90
90
  "test:websocket": "borp -p \"test/websocket/*.js\"",
91
+ "test:websocket:autobahn": "node test/autobahn/client.js",
92
+ "test:websocket:autobahn:report": "node test/autobahn/report.js",
91
93
  "test:wpt": "node test/wpt/start-fetch.mjs && node test/wpt/start-FileAPI.mjs && node test/wpt/start-mimesniff.mjs && node test/wpt/start-xhr.mjs && node test/wpt/start-websockets.mjs && node test/wpt/start-cacheStorage.mjs && node test/wpt/start-eventsource.mjs",
92
94
  "test:wpt:withoutintl": "node test/wpt/start-fetch.mjs && node test/wpt/start-mimesniff.mjs && node test/wpt/start-xhr.mjs && node test/wpt/start-cacheStorage.mjs && node test/wpt/start-eventsource.mjs",
93
95
  "coverage": "npm run coverage:clean && cross-env NODE_V8_COVERAGE=./coverage/tmp npm run test:javascript && npm run coverage:report",
@@ -135,7 +137,7 @@
135
137
  "ignore": [
136
138
  "lib/llhttp/constants.js",
137
139
  "lib/llhttp/utils.js",
138
- "test/wpt/tests"
140
+ "test/fixtures/wpt"
139
141
  ]
140
142
  },
141
143
  "tsd": {
@@ -19,8 +19,8 @@ declare class Dispatcher extends EventEmitter {
19
19
  connect(options: Dispatcher.ConnectOptions): Promise<Dispatcher.ConnectData>;
20
20
  connect(options: Dispatcher.ConnectOptions, callback: (err: Error | null, data: Dispatcher.ConnectData) => void): void;
21
21
  /** Compose a chain of dispatchers */
22
- compose(dispatchers: Dispatcher.DispatcherInterceptor[]): Dispatcher.ComposedDispatcher;
23
- compose(...dispatchers: Dispatcher.DispatcherInterceptor[]): Dispatcher.ComposedDispatcher;
22
+ compose(dispatchers: Dispatcher.DispatcherComposeInterceptor[]): Dispatcher.ComposedDispatcher;
23
+ compose(...dispatchers: Dispatcher.DispatcherComposeInterceptor[]): Dispatcher.ComposedDispatcher;
24
24
  /** Performs an HTTP request. */
25
25
  request(options: Dispatcher.RequestOptions): Promise<Dispatcher.ResponseData>;
26
26
  request(options: Dispatcher.RequestOptions, callback: (err: Error | null, data: Dispatcher.ResponseData) => void): void;
@@ -97,7 +97,7 @@ declare class Dispatcher extends EventEmitter {
97
97
 
98
98
  declare namespace Dispatcher {
99
99
  export interface ComposedDispatcher extends Dispatcher {}
100
- export type DispatcherInterceptor = (dispatch: Dispatcher['dispatch']) => Dispatcher['dispatch'];
100
+ export type DispatcherComposeInterceptor = (dispatch: Dispatcher['dispatch']) => Dispatcher['dispatch'];
101
101
  export interface DispatchOptions {
102
102
  origin?: string | URL;
103
103
  path: string;
package/types/index.d.ts CHANGED
@@ -66,4 +66,9 @@ declare namespace Undici {
66
66
  var File: typeof import('./file').File;
67
67
  var FileReader: typeof import('./filereader').FileReader;
68
68
  var caches: typeof import('./cache').caches;
69
+ var interceptors: {
70
+ dump: typeof import('./interceptors').dump;
71
+ retry: typeof import('./interceptors').retry;
72
+ redirect: typeof import('./interceptors').redirect;
73
+ }
69
74
  }
@@ -1,5 +1,11 @@
1
1
  import Dispatcher from "./dispatcher";
2
+ import RetryHandler from "./retry-handler";
2
3
 
3
- type RedirectInterceptorOpts = { maxRedirections?: number }
4
+ export type DumpInterceptorOpts = { maxSize?: number }
5
+ export type RetryInterceptorOpts = RetryHandler.RetryOptions
6
+ export type RedirectInterceptorOpts = { maxRedirections?: number }
4
7
 
5
- export declare function createRedirectInterceptor (opts: RedirectInterceptorOpts): Dispatcher.DispatchInterceptor
8
+ export declare function createRedirectInterceptor (opts: RedirectInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
9
+ export declare function dump(opts?: DumpInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
10
+ export declare function retry(opts?: RetryInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
11
+ export declare function redirect(opts?: RedirectInterceptorOpts): Dispatcher.DispatcherComposeInterceptor