@rushstack/rush-sdk 5.144.0 → 5.144.1-pr5037.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/lib/utilities/WebClient.d.ts +26 -13
- package/package.json +10 -11
|
@@ -1,21 +1,30 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* For use with {@link WebClient}.
|
|
5
|
-
*/
|
|
6
|
-
export type WebClientResponse = fetch.Response;
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import { type RequestOptions } from 'node:https';
|
|
7
4
|
/**
|
|
8
5
|
* For use with {@link WebClient}.
|
|
9
6
|
*/
|
|
10
|
-
export
|
|
11
|
-
|
|
7
|
+
export interface IWebClientResponse {
|
|
8
|
+
ok: boolean;
|
|
9
|
+
status: number;
|
|
10
|
+
statusText?: string;
|
|
11
|
+
redirected: boolean;
|
|
12
|
+
headers: Record<string, string | string[] | undefined>;
|
|
13
|
+
getTextAsync: () => Promise<string>;
|
|
14
|
+
getJsonAsync: <TJson>() => Promise<TJson>;
|
|
15
|
+
getBufferAsync: () => Promise<Buffer>;
|
|
16
|
+
}
|
|
12
17
|
/**
|
|
13
18
|
* For use with {@link WebClient}.
|
|
14
19
|
*/
|
|
15
20
|
export interface IWebFetchOptionsBase {
|
|
16
21
|
timeoutMs?: number;
|
|
17
|
-
headers?:
|
|
18
|
-
redirect?:
|
|
22
|
+
headers?: Record<string, string>;
|
|
23
|
+
redirect?: 'follow' | 'error' | 'manual';
|
|
24
|
+
/**
|
|
25
|
+
* If true, the response will not be decoded if a Content-Encoding header is present.
|
|
26
|
+
*/
|
|
27
|
+
noDecode?: boolean;
|
|
19
28
|
}
|
|
20
29
|
/**
|
|
21
30
|
* For use with {@link WebClient}.
|
|
@@ -38,19 +47,23 @@ export declare enum WebClientProxy {
|
|
|
38
47
|
Detect = 1,
|
|
39
48
|
Fiddler = 2
|
|
40
49
|
}
|
|
50
|
+
export interface IRequestOptions extends RequestOptions, Pick<IFetchOptionsWithBody, 'body' | 'redirect' | 'noDecode'> {
|
|
51
|
+
}
|
|
52
|
+
export type FetchFn = (url: string, options: IRequestOptions, isRedirect?: boolean) => Promise<IWebClientResponse>;
|
|
53
|
+
export declare const AUTHORIZATION_HEADER_NAME: 'Authorization';
|
|
41
54
|
/**
|
|
42
55
|
* A helper for issuing HTTP requests.
|
|
43
56
|
*/
|
|
44
57
|
export declare class WebClient {
|
|
45
58
|
private static _requestFn;
|
|
46
|
-
readonly standardHeaders:
|
|
59
|
+
readonly standardHeaders: Record<string, string>;
|
|
47
60
|
accept: string | undefined;
|
|
48
61
|
userAgent: string | undefined;
|
|
49
62
|
proxy: WebClientProxy;
|
|
50
|
-
static mockRequestFn(fn:
|
|
63
|
+
static mockRequestFn(fn: FetchFn): void;
|
|
51
64
|
static resetMockRequestFn(): void;
|
|
52
|
-
static mergeHeaders(target:
|
|
65
|
+
static mergeHeaders(target: Record<string, string>, source: Record<string, string>): void;
|
|
53
66
|
addBasicAuthHeader(userName: string, password: string): void;
|
|
54
|
-
fetchAsync(url: string, options?: IGetFetchOptions | IFetchOptionsWithBody): Promise<
|
|
67
|
+
fetchAsync(url: string, options?: IGetFetchOptions | IFetchOptionsWithBody): Promise<IWebClientResponse>;
|
|
55
68
|
}
|
|
56
69
|
//# sourceMappingURL=WebClient.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rushstack/rush-sdk",
|
|
3
|
-
"version": "5.144.0",
|
|
3
|
+
"version": "5.144.1-pr5037.0",
|
|
4
4
|
"description": "An API for interacting with the Rush engine",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,24 +33,23 @@
|
|
|
33
33
|
},
|
|
34
34
|
"license": "MIT",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@types/node-fetch": "2.6.2",
|
|
37
36
|
"tapable": "2.2.1",
|
|
38
|
-
"@rushstack/lookup-by-path": "0.4.
|
|
37
|
+
"@rushstack/lookup-by-path": "0.4.6",
|
|
39
38
|
"@rushstack/node-core-library": "5.10.0",
|
|
40
|
-
"@rushstack/
|
|
41
|
-
"@rushstack/
|
|
39
|
+
"@rushstack/terminal": "0.14.3",
|
|
40
|
+
"@rushstack/package-deps-hash": "4.2.11"
|
|
42
41
|
},
|
|
43
42
|
"devDependencies": {
|
|
44
43
|
"@types/semver": "7.5.0",
|
|
45
44
|
"@types/webpack-env": "1.18.0",
|
|
46
45
|
"webpack": "~5.95.0",
|
|
47
|
-
"@microsoft/rush-lib": "5.144.0",
|
|
48
|
-
"@rushstack/heft": "0.68.
|
|
46
|
+
"@microsoft/rush-lib": "5.144.1-pr5037.0",
|
|
47
|
+
"@rushstack/heft": "0.68.10",
|
|
48
|
+
"@rushstack/heft-webpack5-plugin": "0.11.8",
|
|
49
49
|
"local-node-rig": "1.0.0",
|
|
50
|
-
"@rushstack/stream-collator": "4.1.
|
|
51
|
-
"@rushstack/
|
|
52
|
-
"@rushstack/ts-command-line": "4.23.1"
|
|
53
|
-
"@rushstack/webpack-preserve-dynamic-require-plugin": "0.11.76"
|
|
50
|
+
"@rushstack/stream-collator": "4.1.78",
|
|
51
|
+
"@rushstack/webpack-preserve-dynamic-require-plugin": "0.11.77",
|
|
52
|
+
"@rushstack/ts-command-line": "4.23.1"
|
|
54
53
|
},
|
|
55
54
|
"scripts": {
|
|
56
55
|
"build": "heft build --clean",
|