urllib 3.18.0 → 3.18.1
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 +8 -3
- package/src/HttpAgent.ts +2 -2
- package/src/Request.ts +1 -1
- package/src/cjs/HttpAgent.d.ts +1 -3
- package/src/cjs/HttpClient.js +1 -1
- package/src/cjs/Request.d.ts +1 -1
- package/src/esm/HttpAgent.d.ts +1 -3
- package/src/esm/HttpClient.d.ts +3 -3
- package/src/esm/HttpClient.js +1 -1
- package/src/esm/Request.d.ts +2 -2
- package/src/esm/index.d.ts +6 -6
- package/src/esm/utils.d.ts +1 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "urllib",
|
3
|
-
"version": "3.18.
|
3
|
+
"version": "3.18.1",
|
4
4
|
"publishConfig": {
|
5
5
|
"tag": "latest"
|
6
6
|
},
|
@@ -50,8 +50,11 @@
|
|
50
50
|
"build:version": "node ./scripts/replace_urllib_version.js",
|
51
51
|
"build:cjs:test": "cd test/cjs && rm -rf node_modules && npm link ../.. && node index.js",
|
52
52
|
"build:esm:test": "cd test/esm && rm -rf node_modules && npm link ../.. && node index.js",
|
53
|
-
"build:test": "
|
54
|
-
"test
|
53
|
+
"build:mts:test": "cd test/mts && rm -rf node_modules && npm link ../.. && tsc",
|
54
|
+
"build:test": "npm run build && npm run build:cjs:test && npm run build:esm:test && npm run build:mts:test && npm run test-tsc",
|
55
|
+
"test-tsc": "npm run test-tsc:cjs",
|
56
|
+
"test-tsc:cjs": "tsc -p ./test/fixtures/ts/tsconfig.json",
|
57
|
+
"test-tsc:esm": "tsc -p ./test/fixtures/ts-esm/tsconfig.json",
|
55
58
|
"test": "npm run lint && vitest run",
|
56
59
|
"test-keepalive": "cross-env TEST_KEEPALIVE_COUNT=50 vitest run --test-timeout 180000 keep-alive-header.test.ts",
|
57
60
|
"cov": "vitest run --coverage",
|
@@ -82,6 +85,8 @@
|
|
82
85
|
"@types/selfsigned": "^2.0.1",
|
83
86
|
"@types/tar-stream": "^2.2.2",
|
84
87
|
"@vitest/coverage-v8": "^0.32.0",
|
88
|
+
"@tsconfig/node18": "^18.2.1",
|
89
|
+
"@tsconfig/strictest": "^2.0.2",
|
85
90
|
"busboy": "^1.6.0",
|
86
91
|
"cross-env": "^7.0.3",
|
87
92
|
"eslint": "^8.25.0",
|
package/src/HttpAgent.ts
CHANGED
@@ -2,9 +2,9 @@ import dns from 'node:dns';
|
|
2
2
|
import { LookupFunction, isIP } from 'node:net';
|
3
3
|
import {
|
4
4
|
Agent,
|
5
|
+
Dispatcher,
|
6
|
+
buildConnector,
|
5
7
|
} from 'undici';
|
6
|
-
import type Dispatcher from 'undici/types/dispatcher';
|
7
|
-
import type buildConnector from 'undici/types/connector';
|
8
8
|
|
9
9
|
export type CheckAddressFunction = (ip: string, family: number | string) => boolean;
|
10
10
|
|
package/src/Request.ts
CHANGED
package/src/cjs/HttpAgent.d.ts
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
/// <reference types="node" />
|
2
2
|
import { LookupFunction } from 'node:net';
|
3
|
-
import { Agent } from 'undici';
|
4
|
-
import type Dispatcher from 'undici/types/dispatcher';
|
5
|
-
import type buildConnector from 'undici/types/connector';
|
3
|
+
import { Agent, Dispatcher, buildConnector } from 'undici';
|
6
4
|
export type CheckAddressFunction = (ip: string, family: number | string) => boolean;
|
7
5
|
export type HttpAgentOptions = {
|
8
6
|
lookup?: LookupFunction;
|
package/src/cjs/HttpClient.js
CHANGED
@@ -73,7 +73,7 @@ class HttpClientRequestTimeoutError extends Error {
|
|
73
73
|
Error.captureStackTrace(this, this.constructor);
|
74
74
|
}
|
75
75
|
}
|
76
|
-
exports.HEADER_USER_AGENT = (0, default_user_agent_1.default)('node-urllib', '3.18.
|
76
|
+
exports.HEADER_USER_AGENT = (0, default_user_agent_1.default)('node-urllib', '3.18.1');
|
77
77
|
function getFileName(stream) {
|
78
78
|
const filePath = stream.path;
|
79
79
|
if (filePath) {
|
package/src/cjs/Request.d.ts
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
/// <reference types="node" />
|
5
5
|
import { Readable, Writable } from 'node:stream';
|
6
6
|
import type { IncomingHttpHeaders } from 'node:http';
|
7
|
-
import type Dispatcher from 'undici
|
7
|
+
import type { Dispatcher } from 'undici';
|
8
8
|
import type { HttpClientResponse } from './Response';
|
9
9
|
export type HttpMethod = Dispatcher.HttpMethod;
|
10
10
|
export type RequestURL = string | URL;
|
package/src/esm/HttpAgent.d.ts
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
/// <reference types="node" />
|
2
2
|
import { LookupFunction } from 'node:net';
|
3
|
-
import { Agent } from 'undici';
|
4
|
-
import type Dispatcher from 'undici/types/dispatcher';
|
5
|
-
import type buildConnector from 'undici/types/connector';
|
3
|
+
import { Agent, Dispatcher, buildConnector } from 'undici';
|
6
4
|
export type CheckAddressFunction = (ip: string, family: number | string) => boolean;
|
7
5
|
export type HttpAgentOptions = {
|
8
6
|
lookup?: LookupFunction;
|
package/src/esm/HttpClient.d.ts
CHANGED
@@ -3,9 +3,9 @@
|
|
3
3
|
/// <reference types="node" />
|
4
4
|
import { EventEmitter } from 'node:events';
|
5
5
|
import { LookupFunction } from 'node:net';
|
6
|
-
import { CheckAddressFunction } from './HttpAgent';
|
7
|
-
import { RequestURL, RequestOptions, RequestMeta } from './Request';
|
8
|
-
import { RawResponseWithMeta, HttpClientResponse } from './Response';
|
6
|
+
import { CheckAddressFunction } from './HttpAgent.js';
|
7
|
+
import { RequestURL, RequestOptions, RequestMeta } from './Request.js';
|
8
|
+
import { RawResponseWithMeta, HttpClientResponse } from './Response.js';
|
9
9
|
export type ClientOptions = {
|
10
10
|
defaultArgs?: RequestOptions;
|
11
11
|
/**
|
package/src/esm/HttpClient.js
CHANGED
@@ -67,7 +67,7 @@ class HttpClientRequestTimeoutError extends Error {
|
|
67
67
|
Error.captureStackTrace(this, this.constructor);
|
68
68
|
}
|
69
69
|
}
|
70
|
-
export const HEADER_USER_AGENT = createUserAgent('node-urllib', '3.18.
|
70
|
+
export const HEADER_USER_AGENT = createUserAgent('node-urllib', '3.18.1');
|
71
71
|
function getFileName(stream) {
|
72
72
|
const filePath = stream.path;
|
73
73
|
if (filePath) {
|
package/src/esm/Request.d.ts
CHANGED
@@ -4,8 +4,8 @@
|
|
4
4
|
/// <reference types="node" />
|
5
5
|
import { Readable, Writable } from 'node:stream';
|
6
6
|
import type { IncomingHttpHeaders } from 'node:http';
|
7
|
-
import type Dispatcher from 'undici
|
8
|
-
import type { HttpClientResponse } from './Response';
|
7
|
+
import type { Dispatcher } from 'undici';
|
8
|
+
import type { HttpClientResponse } from './Response.js';
|
9
9
|
export type HttpMethod = Dispatcher.HttpMethod;
|
10
10
|
export type RequestURL = string | URL;
|
11
11
|
export type FixJSONCtlCharsHandler = (data: string) => string;
|
package/src/esm/index.d.ts
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
import { RequestOptions, RequestURL } from './Request';
|
2
|
-
export declare function request<T = any>(url: RequestURL, options?: RequestOptions): Promise<import("./Response").HttpClientResponse<T>>;
|
3
|
-
export declare function curl<T = any>(url: RequestURL, options?: RequestOptions): Promise<import("./Response").HttpClientResponse<T>>;
|
1
|
+
import { RequestOptions, RequestURL } from './Request.js';
|
2
|
+
export declare function request<T = any>(url: RequestURL, options?: RequestOptions): Promise<import("./Response.js").HttpClientResponse<T>>;
|
3
|
+
export declare function curl<T = any>(url: RequestURL, options?: RequestOptions): Promise<import("./Response.js").HttpClientResponse<T>>;
|
4
4
|
export { MockAgent, ProxyAgent, Agent, Dispatcher, setGlobalDispatcher, getGlobalDispatcher, } from 'undici';
|
5
|
-
export { HttpClient, HttpClient as HttpClient2, HEADER_USER_AGENT as USER_AGENT, RequestDiagnosticsMessage, ResponseDiagnosticsMessage, } from './HttpClient';
|
6
|
-
export { RequestOptions, RequestOptions as RequestOptions2, RequestURL, HttpMethod, FixJSONCtlCharsHandler, FixJSONCtlChars, } from './Request';
|
7
|
-
export { SocketInfo, Timing, RawResponseWithMeta, HttpClientResponse } from './Response';
|
5
|
+
export { HttpClient, HttpClient as HttpClient2, HEADER_USER_AGENT as USER_AGENT, RequestDiagnosticsMessage, ResponseDiagnosticsMessage, } from './HttpClient.js';
|
6
|
+
export { RequestOptions, RequestOptions as RequestOptions2, RequestURL, HttpMethod, FixJSONCtlCharsHandler, FixJSONCtlChars, } from './Request.js';
|
7
|
+
export { SocketInfo, Timing, RawResponseWithMeta, HttpClientResponse } from './Response.js';
|
8
8
|
declare const _default: {
|
9
9
|
request: typeof request;
|
10
10
|
curl: typeof curl;
|
package/src/esm/utils.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { FixJSONCtlChars } from './Request';
|
1
|
+
import { FixJSONCtlChars } from './Request.js';
|
2
2
|
export declare function parseJSON(data: string, fixJSONCtlChars?: FixJSONCtlChars): string;
|
3
3
|
export declare function sleep(ms: number): Promise<void>;
|
4
4
|
export declare function digestAuthHeader(method: string, uri: string, wwwAuthenticate: string, userpass: string): string;
|