@nomicfoundation/hardhat-utils 4.1.9 → 4.3.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/CHANGELOG.md +18 -0
- package/dist/src/errors/request.d.ts +4 -0
- package/dist/src/errors/request.d.ts.map +1 -1
- package/dist/src/errors/request.js +7 -0
- package/dist/src/errors/request.js.map +1 -1
- package/dist/src/eth.d.ts +9 -0
- package/dist/src/eth.d.ts.map +1 -1
- package/dist/src/eth.js +16 -1
- package/dist/src/eth.js.map +1 -1
- package/dist/src/internal/eth.d.ts +14 -5
- package/dist/src/internal/eth.d.ts.map +1 -1
- package/dist/src/internal/eth.js +16 -6
- package/dist/src/internal/eth.js.map +1 -1
- package/dist/src/internal/request.d.ts +37 -1
- package/dist/src/internal/request.d.ts.map +1 -1
- package/dist/src/internal/request.js +199 -9
- package/dist/src/internal/request.js.map +1 -1
- package/dist/src/request.d.ts +26 -9
- package/dist/src/request.d.ts.map +1 -1
- package/dist/src/request.js +31 -38
- package/dist/src/request.js.map +1 -1
- package/package.json +3 -3
- package/src/errors/request.ts +12 -0
- package/src/eth.ts +22 -0
- package/src/internal/eth.ts +23 -6
- package/src/internal/request.ts +257 -9
- package/src/request.ts +38 -45
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @nomicfoundation/hardhat-utils
|
|
2
2
|
|
|
3
|
+
## 4.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#8616](https://github.com/NomicFoundation/hardhat/pull/8616) [`8b73917`](https://github.com/NomicFoundation/hardhat/commit/8b73917cbf830b58c773ea7580d2d30c4fb11b43) Thanks [@rome-xi](https://github.com/rome-xi)! - Fixed invalid `HTTPS_PROXY`/`HTTP_PROXY` values being reported as unexpected errors instead of a Hardhat error.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [#8601](https://github.com/NomicFoundation/hardhat/pull/8601) [`34087dd`](https://github.com/NomicFoundation/hardhat/commit/34087dd349e40be5bf4d5dbdce557b23b98cfefd) Thanks [@cdesch](https://github.com/cdesch)! - Improved HTTP proxy support.
|
|
12
|
+
|
|
13
|
+
## 4.2.0
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- [#8583](https://github.com/NomicFoundation/hardhat/pull/8583) [`2c98fa5`](https://github.com/NomicFoundation/hardhat/commit/2c98fa5b05c3f2b8d06b44aae4ebea88b82ae132) Thanks [@schaable](https://github.com/schaable)! - Updated undici to v7.
|
|
18
|
+
|
|
19
|
+
- [#8210](https://github.com/NomicFoundation/hardhat/pull/8210) [`024b422`](https://github.com/NomicFoundation/hardhat/commit/024b422340705f1ff5fc14b9dcc6a1f143487d86) Thanks [@renovate](https://github.com/apps/renovate)! - Update the cryptography dependencies to their latest major versions: `@noble/hashes` and `@noble/ciphers` to 2, `ethereum-cryptography` to 3, and `micro-eth-signer` to 0.19.
|
|
20
|
+
|
|
3
21
|
## 4.1.9
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -9,6 +9,10 @@ export declare class DownloadError extends CustomError {
|
|
|
9
9
|
export declare class DispatcherError extends CustomError {
|
|
10
10
|
constructor(message: string, cause?: Error);
|
|
11
11
|
}
|
|
12
|
+
export declare class InvalidProxyUrlError extends CustomError {
|
|
13
|
+
readonly envVarName: string;
|
|
14
|
+
constructor(envVarName: string, cause?: Error);
|
|
15
|
+
}
|
|
12
16
|
export declare class RequestTimeoutError extends CustomError {
|
|
13
17
|
constructor(url: string, cause?: Error);
|
|
14
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../src/errors/request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,QAAQ,CAAC;AAElC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI1C,qBAAa,YAAa,SA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E,KAAK,CAAC,EAAE,KAAK;CAGvC;AAED,qBAAa,eAAgB,SAAQ,WAAW;gBAClC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAG3C;AAED,qBAAa,oBAAqB,SAAQ,WAAW;IACnD,SAAgB,UAAU,EAAE,MAAM,CAAC;gBAEvB,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAO9C;AAED,qBAAa,mBAAoB,SAAQ,WAAW;gBACtC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAGvC;AAED,qBAAa,sBAAuB,SAAQ,WAAW;gBACzC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAGvC;AAED,qBAAa,uBAAwB,SAAQ,WAAW;;IACtD,SAAgB,UAAU,EAAE,MAAM,CAAC;IACnC,SAAgB,OAAO,EACrB,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,GAAG,IAAI,CAAC;IAClE,SAAgB,IAAI,EAAE,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC;gBAE9C,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK;CAuCtC"}
|
|
@@ -16,6 +16,13 @@ export class DispatcherError extends CustomError {
|
|
|
16
16
|
super(`Failed to create dispatcher: ${message}`, cause);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
+
export class InvalidProxyUrlError extends CustomError {
|
|
20
|
+
envVarName;
|
|
21
|
+
constructor(envVarName, cause) {
|
|
22
|
+
super(`The proxy url configured in the ${envVarName} environment variable is not a valid url`, cause);
|
|
23
|
+
this.envVarName = envVarName;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
19
26
|
export class RequestTimeoutError extends CustomError {
|
|
20
27
|
constructor(url, cause) {
|
|
21
28
|
super(`Request to ${sanitizeUrl(url)} timed out`, cause);
|
|
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AAE,EAAE,CACT,OAAO,MAAM,KAAK,QAAQ;YAC1B,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;gBACpB,MAAM,CAAC,KAAK,CAAC,CAAC,IAAa,EAAE,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC;YAC5D,MAAM,KAAK,SAAS,CACvB,CAAC;IACJ,CAAC;CACF"}
|
package/dist/src/eth.d.ts
CHANGED
|
@@ -13,6 +13,15 @@ export declare function isAddress(value: unknown): value is PrefixedHexString;
|
|
|
13
13
|
* @returns True if the value is an Ethereum address with a valid checksum, false otherwise.
|
|
14
14
|
*/
|
|
15
15
|
export declare function isValidChecksumAddress(value: unknown): Promise<boolean>;
|
|
16
|
+
/**
|
|
17
|
+
* Converts an Ethereum address to its EIP-55 checksummed representation.
|
|
18
|
+
*
|
|
19
|
+
* @param address The address to convert. It can be checksummed or not, but it
|
|
20
|
+
* must be a valid Ethereum address.
|
|
21
|
+
* @returns The EIP-55 checksummed representation of the address.
|
|
22
|
+
* @throws InvalidParameterError If the input is not an Ethereum address.
|
|
23
|
+
*/
|
|
24
|
+
export declare function toChecksumAddress(address: string): Promise<PrefixedHexString>;
|
|
16
25
|
/**
|
|
17
26
|
* Checks if a value is an Ethereum hash.
|
|
18
27
|
*
|
package/dist/src/eth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eth.d.ts","sourceRoot":"","sources":["../../src/eth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"eth.d.ts","sourceRoot":"","sources":["../../src/eth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAWlD;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,iBAAiB,CAEpE;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAE7E;AAED;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,iBAAiB,CAAC,CAQ5B;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,iBAAiB,CAEjE;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,iBAAiB,CAEnE;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,UAAU,CAAC,CAG7D;AAED;;;;GAIG;AACH,wBAAsB,UAAU,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAG7D;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,UAAU,CAAC,CAIhE;AAED;;;;GAIG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAGhE"}
|
package/dist/src/eth.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { InvalidParameterError } from "./common-errors.js";
|
|
1
2
|
import { bytesToHexString, numberToHexString, setLengthLeft } from "./hex.js";
|
|
2
|
-
import { getAddressGenerator, getHashGenerator, isValidChecksum, } from "./internal/eth.js";
|
|
3
|
+
import { getAddressGenerator, getHashGenerator, isValidChecksum, toChecksumAddress as toChecksumAddressImpl, } from "./internal/eth.js";
|
|
3
4
|
/**
|
|
4
5
|
* Checks if a value is an Ethereum address.
|
|
5
6
|
*
|
|
@@ -18,6 +19,20 @@ export function isAddress(value) {
|
|
|
18
19
|
export async function isValidChecksumAddress(value) {
|
|
19
20
|
return await (isAddress(value) && isValidChecksum(value));
|
|
20
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Converts an Ethereum address to its EIP-55 checksummed representation.
|
|
24
|
+
*
|
|
25
|
+
* @param address The address to convert. It can be checksummed or not, but it
|
|
26
|
+
* must be a valid Ethereum address.
|
|
27
|
+
* @returns The EIP-55 checksummed representation of the address.
|
|
28
|
+
* @throws InvalidParameterError If the input is not an Ethereum address.
|
|
29
|
+
*/
|
|
30
|
+
export async function toChecksumAddress(address) {
|
|
31
|
+
if (!isAddress(address)) {
|
|
32
|
+
throw new InvalidParameterError(`Expected an Ethereum address. Received: ${address}`);
|
|
33
|
+
}
|
|
34
|
+
return await toChecksumAddressImpl(address);
|
|
35
|
+
}
|
|
21
36
|
/**
|
|
22
37
|
* Checks if a value is an Ethereum hash.
|
|
23
38
|
*
|
package/dist/src/eth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eth.js","sourceRoot":"","sources":["../../src/eth.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9E,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,
|
|
1
|
+
{"version":3,"file":"eth.js","sourceRoot":"","sources":["../../src/eth.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9E,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,IAAI,qBAAqB,GAC3C,MAAM,mBAAmB,CAAC;AAE3B;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,KAAc;IACtC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACtE,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,KAAc;IACzD,OAAO,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,eAAe,CAAC,KAAK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M,oBAAoB,EAAE,CAAC;IAClD,OAAO,gBAAgB,CAAC,YAAY,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PrefixedHexString } from "../hex.js";
|
|
1
2
|
declare class RandomBytesGenerator {
|
|
2
3
|
#private;
|
|
3
4
|
private constructor();
|
|
@@ -7,15 +8,23 @@ declare class RandomBytesGenerator {
|
|
|
7
8
|
export declare function getHashGenerator(): Promise<RandomBytesGenerator>;
|
|
8
9
|
export declare function getAddressGenerator(): Promise<RandomBytesGenerator>;
|
|
9
10
|
/**
|
|
10
|
-
*
|
|
11
|
-
* This method is
|
|
11
|
+
* Converts an Ethereum address to its EIP-55 checksummed representation.
|
|
12
|
+
* This method is an adaptation of the ethereumjs methods at this link:
|
|
12
13
|
* https://github.com/ethereumjs/ethereumjs-monorepo/blob/47f388bfeec553519d11259fee7e7161a77b29b2/packages/util/src/account.ts#L440-L478
|
|
13
14
|
* The main differences are:
|
|
14
|
-
* - the
|
|
15
|
-
* - tha `eip1191ChainId` parameter has been removed.
|
|
15
|
+
* - the `eip1191ChainId` parameter has been removed.
|
|
16
16
|
* - the code has been modified to use the `hardhat-utils` methods
|
|
17
17
|
*
|
|
18
|
+
* It doesn't validate that the input is an Ethereum address; callers must
|
|
19
|
+
* check that first (see the public wrappers in `../eth.ts`).
|
|
18
20
|
*/
|
|
19
|
-
export declare function
|
|
21
|
+
export declare function toChecksumAddress(hexAddress: PrefixedHexString): Promise<PrefixedHexString>;
|
|
22
|
+
/**
|
|
23
|
+
* Checks if the checksum of an address is valid.
|
|
24
|
+
*
|
|
25
|
+
* It doesn't validate that the input is an Ethereum address; callers must
|
|
26
|
+
* check that first (see the public wrappers in `../eth.ts`).
|
|
27
|
+
*/
|
|
28
|
+
export declare function isValidChecksum(hexAddress: PrefixedHexString): Promise<boolean>;
|
|
20
29
|
export {};
|
|
21
30
|
//# sourceMappingURL=eth.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eth.d.ts","sourceRoot":"","sources":["../../../src/internal/eth.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"eth.d.ts","sourceRoot":"","sources":["../../../src/internal/eth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAMnD,cAAM,oBAAoB;;IAGxB,OAAO;WAIa,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAM1D,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC;CAOzC;AAKD,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,oBAAoB,CAAC,CAKtE;AAED,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,oBAAoB,CAAC,CAKzE;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,iBAAiB,CACrC,UAAU,EAAE,iBAAiB,GAC5B,OAAO,CAAC,iBAAiB,CAAC,CAiB5B;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CACnC,UAAU,EAAE,iBAAiB,GAC5B,OAAO,CAAC,OAAO,CAAC,CAElB"}
|
package/dist/src/internal/eth.js
CHANGED
|
@@ -31,16 +31,17 @@ export async function getAddressGenerator() {
|
|
|
31
31
|
return addressGenerator;
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
35
|
-
* This method is
|
|
34
|
+
* Converts an Ethereum address to its EIP-55 checksummed representation.
|
|
35
|
+
* This method is an adaptation of the ethereumjs methods at this link:
|
|
36
36
|
* https://github.com/ethereumjs/ethereumjs-monorepo/blob/47f388bfeec553519d11259fee7e7161a77b29b2/packages/util/src/account.ts#L440-L478
|
|
37
37
|
* The main differences are:
|
|
38
|
-
* - the
|
|
39
|
-
* - tha `eip1191ChainId` parameter has been removed.
|
|
38
|
+
* - the `eip1191ChainId` parameter has been removed.
|
|
40
39
|
* - the code has been modified to use the `hardhat-utils` methods
|
|
41
40
|
*
|
|
41
|
+
* It doesn't validate that the input is an Ethereum address; callers must
|
|
42
|
+
* check that first (see the public wrappers in `../eth.ts`).
|
|
42
43
|
*/
|
|
43
|
-
export async function
|
|
44
|
+
export async function toChecksumAddress(hexAddress) {
|
|
44
45
|
const address = getUnprefixedHexString(hexAddress).toLowerCase();
|
|
45
46
|
const bytes = utf8StringToBytes(address);
|
|
46
47
|
const hash = bytesToHexString(await keccak256(bytes)).slice(2);
|
|
@@ -53,6 +54,15 @@ export async function isValidChecksum(hexAddress) {
|
|
|
53
54
|
ret += address[i];
|
|
54
55
|
}
|
|
55
56
|
}
|
|
56
|
-
return `0x${ret}
|
|
57
|
+
return `0x${ret}`;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Checks if the checksum of an address is valid.
|
|
61
|
+
*
|
|
62
|
+
* It doesn't validate that the input is an Ethereum address; callers must
|
|
63
|
+
* check that first (see the public wrappers in `../eth.ts`).
|
|
64
|
+
*/
|
|
65
|
+
export async function isValidChecksum(hexAddress) {
|
|
66
|
+
return (await toChecksumAddress(hexAddress)) === hexAddress;
|
|
57
67
|
}
|
|
58
68
|
//# sourceMappingURL=eth.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eth.js","sourceRoot":"","sources":["../../../src/internal/eth.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"eth.js","sourceRoot":"","sources":["../../../src/internal/eth.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAErE,MAAM,oBAAoB;IACxB,UAAU,CAAa;IAEvB,YAAoB,SAAqB;QACvC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAC9B,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAY;QACrC,MAAM,SAAS,GAA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AE,CAAC,EAAE,EAAE,CAAC;QACxC,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;YAC/B,GAAG,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QAClC,CAAC;aAAM,CAAC;YACN,GAAG,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;IACH,CAAC;IAED,OAAO,KAAK,GAAG,EAAE,CAAC;AACpB,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,UAA6B;IAE7B,OAAO,CAAC,MAAM,iBAAiB,CAAC,UAAU,CAAC,CAAC,KAAK,UAAU,CAAC;AAC9D,CAAC"}
|
|
@@ -1,16 +1,52 @@
|
|
|
1
1
|
import type { DispatcherOptions, RequestOptions } from "../request.js";
|
|
2
2
|
import type EventEmitter from "node:events";
|
|
3
3
|
import type * as UndiciT from "undici";
|
|
4
|
+
export interface ProxyEnvVar {
|
|
5
|
+
name: string;
|
|
6
|
+
value: string;
|
|
7
|
+
}
|
|
4
8
|
export declare function generateTempFilePath(filePath: string): Promise<string>;
|
|
5
9
|
export declare function getBaseRequestOptions(requestUrl: string, { extraHeaders, abortSignal, queryParams }?: RequestOptions, dispatcherOrDispatcherOptions?: UndiciT.Dispatcher | DispatcherOptions): Promise<{
|
|
6
10
|
query?: Record<string, any> | undefined;
|
|
7
11
|
signal?: EventEmitter | AbortSignal | undefined;
|
|
8
12
|
dispatcher: UndiciT.Dispatcher;
|
|
9
13
|
headers: Record<string, string>;
|
|
10
|
-
throwOnError: true;
|
|
11
14
|
}>;
|
|
12
15
|
export declare function getHeaders(requestUrl: string, extraHeaders?: Record<string, string>): Record<string, string>;
|
|
13
16
|
export declare function getAuthHeader(requestUrl: string): string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Determines whether a url points at the loopback interface.
|
|
19
|
+
*/
|
|
20
|
+
export declare function isLoopbackUrl(parsedUrl: URL): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Determines whether `NO_PROXY` (or `no_proxy`) excludes a url from being
|
|
23
|
+
* proxied. A value of `*` excludes everything; the other entries are matched as
|
|
24
|
+
* described in {@link parseNoProxy}.
|
|
25
|
+
*/
|
|
26
|
+
export declare function isExcludedByNoProxy(parsedUrl: URL): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Finds the environment variable that configures the proxy for a given url,
|
|
29
|
+
* following the usual precedence: the variable matching the url's protocol
|
|
30
|
+
* first, lowercase before uppercase, then the other protocol's as a fallback.
|
|
31
|
+
*
|
|
32
|
+
* Empty and whitespace-only values are treated as unset, as that's how users
|
|
33
|
+
* disable a variable inherited from a parent environment. The returned value is
|
|
34
|
+
* trimmed, but not validated.
|
|
35
|
+
*
|
|
36
|
+
* @param requestUrl The url the proxy would be used for.
|
|
37
|
+
* @returns The variable's name and value, or `undefined` if none is set or the
|
|
38
|
+
* url's protocol isn't proxyable.
|
|
39
|
+
*/
|
|
40
|
+
export declare function findProxyEnvVar(requestUrl: string): ProxyEnvVar | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Resolves the proxy to use for a given url from the environment.
|
|
43
|
+
*
|
|
44
|
+
* @param requestUrl The url the proxy would be used for.
|
|
45
|
+
* @returns The proxy url, or `undefined` if the environment configures none,
|
|
46
|
+
* `NO_PROXY` excludes the url, or the url can't be proxied.
|
|
47
|
+
* @throws InvalidProxyUrlError If the configured proxy isn't a valid http(s) url.
|
|
48
|
+
*/
|
|
49
|
+
export declare function resolveProxyFromEnv(requestUrl: string): string | undefined;
|
|
14
50
|
export declare function getProxyDispatcher(proxy: string, options: Omit<UndiciT.ProxyAgent.Options, "uri">): Promise<UndiciT.ProxyAgent>;
|
|
15
51
|
export declare function getPoolDispatcher(requestUrl: string, options: UndiciT.Pool.Options): Promise<UndiciT.Pool>;
|
|
16
52
|
export declare function getBasicDispatcher(options: UndiciT.Agent.Options): Promise<UndiciT.Agent>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../src/internal/request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,KAAK,YAAY,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,KAAK,OAAO,MAAM,QAAQ,CAAC;AAqBvC,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAU5E;AAED,wBAAsB,qBAAqB,CACzC,UAAU,EAAE,MAAM,EAClB,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,GAAE,cAAmB,EAC/D,6BAA6B,CAAC,EAAE,OAAO,CAAC,UAAU,GAAG,iBAAiB,GACrE,OAAO,CAAC;IACT,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC;IACxC,MAAM,CAAC,EAAE,YAAY,GAAG,WAAW,GAAG,SAAS,CAAC;IAChD,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC;IAC/B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../src/internal/request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,KAAK,YAAY,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,KAAK,OAAO,MAAM,QAAQ,CAAC;AAqBvC,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AA4BD,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAU5E;AAED,wBAAsB,qBAAqB,CACzC,UAAU,EAAE,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I,CAAC,OAAO,GAC5B,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAOvB;AAED,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,OAAO,GAC7B,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAMxB;AAED,wBAAgB,wBAAwB,CACtC,OAAO,GAAE,MAAwC,EACjD,gBAAgB,GAAE,OAAe,GAChC,OAAO,CAAC,MAAM,CAAC,OAAO,CAaxB;AAED,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAItD;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAuB9D"}
|
|
@@ -1,11 +1,26 @@
|
|
|
1
1
|
import crypto from "node:crypto";
|
|
2
|
+
import { STATUS_CODES } from "node:http";
|
|
2
3
|
import path from "node:path";
|
|
3
4
|
import { mkdir } from "../fs.js";
|
|
4
5
|
import { isObject } from "../lang.js";
|
|
5
|
-
import { ConnectionRefusedError, DEFAULT_MAX_REDIRECTS, DEFAULT_TIMEOUT_IN_MILLISECONDS, DEFAULT_USER_AGENT, getDispatcher, RequestTimeoutError, ResponseStatusCodeError, } from "../request.js";
|
|
6
|
+
import { ConnectionRefusedError, DEFAULT_MAX_REDIRECTS, DEFAULT_TIMEOUT_IN_MILLISECONDS, DEFAULT_USER_AGENT, getDispatcher, InvalidProxyUrlError, isValidUrl, RequestTimeoutError, ResponseStatusCodeError, shouldUseProxy, } from "../request.js";
|
|
6
7
|
// We don't load undici on startup because this package is transitively imported
|
|
7
8
|
// from too many places and it's too complex to optimize case by case.
|
|
8
9
|
let undici;
|
|
10
|
+
const HTTPS_PROXY_ENV_VARS = ["https_proxy", "HTTPS_PROXY"];
|
|
11
|
+
const HTTP_PROXY_ENV_VARS = ["http_proxy", "HTTP_PROXY"];
|
|
12
|
+
const NO_PROXY_ENV_VARS = ["no_proxy", "NO_PROXY"];
|
|
13
|
+
// `URL` normalizes IPv6 loopback to `[::1]` and alternate IPv4 forms to
|
|
14
|
+
// dotted decimal. Only IPv6 hostnames include brackets.
|
|
15
|
+
const LOOPBACK_HOSTNAMES = new Set([
|
|
16
|
+
"localhost",
|
|
17
|
+
"0.0.0.0",
|
|
18
|
+
"[::1]",
|
|
19
|
+
]);
|
|
20
|
+
const DEFAULT_PORTS = new Map([
|
|
21
|
+
["http:", 80],
|
|
22
|
+
["https:", 443],
|
|
23
|
+
]);
|
|
9
24
|
export async function generateTempFilePath(filePath) {
|
|
10
25
|
const { dir, ext, name } = path.parse(filePath);
|
|
11
26
|
await mkdir(dir);
|
|
@@ -22,13 +37,15 @@ export async function getBaseRequestOptions(requestUrl, { extraHeaders, abortSig
|
|
|
22
37
|
const dispatcher = dispatcherOrDispatcherOptions instanceof undici.Dispatcher
|
|
23
38
|
? dispatcherOrDispatcherOptions
|
|
24
39
|
: await getDispatcher(requestUrl, dispatcherOrDispatcherOptions);
|
|
25
|
-
// We
|
|
26
|
-
//
|
|
27
|
-
//
|
|
40
|
+
// We always build our own dispatcher instead of letting undici fall back to
|
|
41
|
+
// the global one, which is a bare `new Agent()` and would drop our timeouts.
|
|
42
|
+
// Configuring it with `setGlobalDispatcher` would affect the whole process.
|
|
43
|
+
// https://github.com/nodejs/undici/blob/v7.29.0/lib/global.js#L10-L12
|
|
28
44
|
return {
|
|
29
|
-
dispatcher,
|
|
45
|
+
dispatcher: dispatcher.compose(undici.interceptors.redirect({ maxRedirections: DEFAULT_MAX_REDIRECTS }),
|
|
46
|
+
// responseError is what makes 4xx and 5xx responses throw
|
|
47
|
+
undici.interceptors.responseError()),
|
|
30
48
|
headers: getHeaders(requestUrl, extraHeaders),
|
|
31
|
-
throwOnError: true,
|
|
32
49
|
...(abortSignal !== undefined ? { signal: abortSignal } : {}),
|
|
33
50
|
...(queryParams !== undefined ? { query: queryParams } : {}),
|
|
34
51
|
};
|
|
@@ -51,6 +68,125 @@ export function getAuthHeader(requestUrl) {
|
|
|
51
68
|
}
|
|
52
69
|
return `Basic ${Buffer.from(`${parsedUrl.username}:${parsedUrl.password}`).toString("base64")}`;
|
|
53
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Determines whether a url points at the loopback interface.
|
|
73
|
+
*/
|
|
74
|
+
export function isLoopbackUrl(parsedUrl) {
|
|
75
|
+
const hostname = parsedUrl.hostname.toLowerCase();
|
|
76
|
+
if (LOOPBACK_HOSTNAMES.has(hostname)) {
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
// Subdomains of localhost, e.g. `api.localhost`.
|
|
80
|
+
if (hostname.endsWith(".localhost")) {
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
// The whole 127.0.0.0/8 range is loopback, not just 127.0.0.1.
|
|
84
|
+
return /^127(?:\.\d{1,3}){3}$/.test(hostname);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Determines whether `NO_PROXY` (or `no_proxy`) excludes a url from being
|
|
88
|
+
* proxied. A value of `*` excludes everything; the other entries are matched as
|
|
89
|
+
* described in {@link parseNoProxy}.
|
|
90
|
+
*/
|
|
91
|
+
export function isExcludedByNoProxy(parsedUrl) {
|
|
92
|
+
// An empty or whitespace-only value means unset, so it falls through to the
|
|
93
|
+
// other casing instead of shadowing it.
|
|
94
|
+
const noProxy = NO_PROXY_ENV_VARS.map((name) => process.env[name]?.trim()).find((value) => value !== undefined && value !== "");
|
|
95
|
+
if (noProxy === undefined) {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
if (noProxy === "*") {
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
const hostname = normalizeHostname(parsedUrl.hostname);
|
|
102
|
+
const parsedPort = Number.parseInt(parsedUrl.port, 10);
|
|
103
|
+
const port = Number.isNaN(parsedPort)
|
|
104
|
+
? DEFAULT_PORTS.get(parsedUrl.protocol)
|
|
105
|
+
: parsedPort;
|
|
106
|
+
for (const entry of parseNoProxy(noProxy)) {
|
|
107
|
+
// A portless entry matches every port.
|
|
108
|
+
if (entry.port !== 0 && entry.port !== port) {
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
if (hostname === entry.hostname ||
|
|
112
|
+
hostname.endsWith(`.${entry.hostname}`)) {
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Finds the environment variable that configures the proxy for a given url,
|
|
120
|
+
* following the usual precedence: the variable matching the url's protocol
|
|
121
|
+
* first, lowercase before uppercase, then the other protocol's as a fallback.
|
|
122
|
+
*
|
|
123
|
+
* Empty and whitespace-only values are treated as unset, as that's how users
|
|
124
|
+
* disable a variable inherited from a parent environment. The returned value is
|
|
125
|
+
* trimmed, but not validated.
|
|
126
|
+
*
|
|
127
|
+
* @param requestUrl The url the proxy would be used for.
|
|
128
|
+
* @returns The variable's name and value, or `undefined` if none is set or the
|
|
129
|
+
* url's protocol isn't proxyable.
|
|
130
|
+
*/
|
|
131
|
+
export function findProxyEnvVar(requestUrl) {
|
|
132
|
+
const { protocol } = new URL(requestUrl);
|
|
133
|
+
let names;
|
|
134
|
+
if (protocol === "https:") {
|
|
135
|
+
names = HTTPS_PROXY_ENV_VARS.concat(HTTP_PROXY_ENV_VARS);
|
|
136
|
+
}
|
|
137
|
+
else if (protocol === "http:") {
|
|
138
|
+
names = HTTP_PROXY_ENV_VARS.concat(HTTPS_PROXY_ENV_VARS);
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
return undefined;
|
|
142
|
+
}
|
|
143
|
+
for (const name of names) {
|
|
144
|
+
const value = process.env[name]?.trim();
|
|
145
|
+
if (value !== undefined && value !== "") {
|
|
146
|
+
return { name, value };
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return undefined;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Resolves the proxy to use for a given url from the environment.
|
|
153
|
+
*
|
|
154
|
+
* @param requestUrl The url the proxy would be used for.
|
|
155
|
+
* @returns The proxy url, or `undefined` if the environment configures none,
|
|
156
|
+
* `NO_PROXY` excludes the url, or the url can't be proxied.
|
|
157
|
+
* @throws InvalidProxyUrlError If the configured proxy isn't a valid http(s) url.
|
|
158
|
+
*/
|
|
159
|
+
export function resolveProxyFromEnv(requestUrl) {
|
|
160
|
+
// `shouldUseProxy` and `findProxyEnvVar` both parse the url. Requests to an
|
|
161
|
+
// invalid one fail later with a better error than anything we'd raise here.
|
|
162
|
+
if (!isValidUrl(requestUrl) || !shouldUseProxy(requestUrl)) {
|
|
163
|
+
return undefined;
|
|
164
|
+
}
|
|
165
|
+
const proxyEnvVar = findProxyEnvVar(requestUrl);
|
|
166
|
+
if (proxyEnvVar === undefined) {
|
|
167
|
+
return undefined;
|
|
168
|
+
}
|
|
169
|
+
if (!isValidProxyUrl(proxyEnvVar.value)) {
|
|
170
|
+
throw new InvalidProxyUrlError(proxyEnvVar.name);
|
|
171
|
+
}
|
|
172
|
+
return proxyEnvVar.value;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Determines whether a value can be used as a proxy url.
|
|
176
|
+
*
|
|
177
|
+
* undici's `ProxyAgent` only speaks http(s). Checking the protocol here, rather
|
|
178
|
+
* than leaving it to undici, catches two cases that would otherwise surface as
|
|
179
|
+
* opaque errors: a scheme-less `host:port`, which parses as a url whose
|
|
180
|
+
* protocol is the host and so never looks like a missing scheme, and `socks5:`,
|
|
181
|
+
* which undici accepts before failing at request time.
|
|
182
|
+
*/
|
|
183
|
+
function isValidProxyUrl(value) {
|
|
184
|
+
if (!isValidUrl(value)) {
|
|
185
|
+
return false;
|
|
186
|
+
}
|
|
187
|
+
const { protocol } = new URL(value);
|
|
188
|
+
return protocol === "http:" || protocol === "https:";
|
|
189
|
+
}
|
|
54
190
|
export async function getProxyDispatcher(proxy, options) {
|
|
55
191
|
if (undici === undefined) {
|
|
56
192
|
undici = await import("undici");
|
|
@@ -75,7 +211,7 @@ export async function getBasicDispatcher(options) {
|
|
|
75
211
|
}
|
|
76
212
|
export function getBaseDispatcherOptions(timeout = DEFAULT_TIMEOUT_IN_MILLISECONDS, isTestDispatcher = false) {
|
|
77
213
|
// These have good defaults for production, but need to be tweaked to avoid hanging tests.
|
|
78
|
-
// https://github.com/nodejs/undici/blob/
|
|
214
|
+
// https://github.com/nodejs/undici/blob/v7.29.0/docs/docs/best-practices/writing-tests.md
|
|
79
215
|
const keepAliveTimeouts = isTestDispatcher
|
|
80
216
|
? { keepAliveTimeout: 10, keepAliveMaxTimeout: 10 }
|
|
81
217
|
: {};
|
|
@@ -83,7 +219,6 @@ export function getBaseDispatcherOptions(timeout = DEFAULT_TIMEOUT_IN_MILLISECON
|
|
|
83
219
|
headersTimeout: timeout,
|
|
84
220
|
bodyTimeout: timeout,
|
|
85
221
|
connectTimeout: timeout,
|
|
86
|
-
maxRedirections: DEFAULT_MAX_REDIRECTS,
|
|
87
222
|
...keepAliveTimeouts,
|
|
88
223
|
};
|
|
89
224
|
}
|
|
@@ -106,8 +241,63 @@ export function handleError(e, requestUrl) {
|
|
|
106
241
|
errorCode === "UND_ERR_BODY_TIMEOUT") {
|
|
107
242
|
throw new RequestTimeoutError(requestUrl, e);
|
|
108
243
|
}
|
|
109
|
-
if (errorCode === "
|
|
244
|
+
if (errorCode === "UND_ERR_RESPONSE") {
|
|
245
|
+
describeResponseError(e);
|
|
110
246
|
throw new ResponseStatusCodeError(requestUrl, e);
|
|
111
247
|
}
|
|
112
248
|
}
|
|
249
|
+
/**
|
|
250
|
+
* Restores the message that undici used to produce for status code errors.
|
|
251
|
+
*
|
|
252
|
+
* Until v7, undici's `throwOnError` described the failure as
|
|
253
|
+
* `Response status code <code>: <reason>`. The `responseError` interceptor that
|
|
254
|
+
* replaced it always uses the generic "Response Error" instead, dropping the
|
|
255
|
+
* only actionable part of the message. Consumers surface this message to users,
|
|
256
|
+
* so we describe the error again.
|
|
257
|
+
*/
|
|
258
|
+
function describeResponseError(e) {
|
|
259
|
+
if (e.message !== "Response Error") {
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
const statusCode = "statusCode" in e ? e.statusCode : undefined;
|
|
263
|
+
if (typeof statusCode !== "number") {
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
const reason = STATUS_CODES[statusCode];
|
|
267
|
+
e.message = `Response status code ${statusCode}${reason !== undefined ? `: ${reason}` : ""}`;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Strips the brackets an IPv6 literal carries in a url, so that an entry can be
|
|
271
|
+
* written either way. `URL` keeps them on `hostname`, while `NO_PROXY` entries
|
|
272
|
+
* are commonly written without them.
|
|
273
|
+
*/
|
|
274
|
+
function normalizeHostname(hostname) {
|
|
275
|
+
return hostname.replace(/^\[|\]$/g, "").toLowerCase();
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Parses a `NO_PROXY` value into its entries.
|
|
279
|
+
*
|
|
280
|
+
* Entries are separated by commas or whitespace. A leading `.` or `*.` marks
|
|
281
|
+
* the suffix form (`.example.com`), but a bare `example.com` matches its
|
|
282
|
+
* subdomains too, so both are stored the same way. An entry may carry a port,
|
|
283
|
+
* as in `example.com:8080`, which restricts it to that port. CIDR ranges aren't
|
|
284
|
+
* supported.
|
|
285
|
+
*/
|
|
286
|
+
function parseNoProxy(noProxy) {
|
|
287
|
+
const entries = [];
|
|
288
|
+
for (const rawEntry of noProxy.split(/[,\s]/)) {
|
|
289
|
+
const entry = rawEntry.trim();
|
|
290
|
+
if (entry === "") {
|
|
291
|
+
continue;
|
|
292
|
+
}
|
|
293
|
+
// Only a bracketed literal or a colon-free host can carry a port, so that
|
|
294
|
+
// the trailing group of a bare IPv6 entry isn't read as one.
|
|
295
|
+
const withPort = entry.match(/^(\[[^\]]+\]|[^:]+):(\d+)$/);
|
|
296
|
+
entries.push({
|
|
297
|
+
hostname: normalizeHostname((withPort !== null ? withPort[1] : entry).replace(/^\*?\./, "")),
|
|
298
|
+
port: withPort !== null ? Number.parseInt(withPort[2], 10) : 0,
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
return entries;
|
|
302
|
+
}
|
|
113
303
|
//# sourceMappingURL=request.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/internal/request.ts"],"names":[],"mappings":"AAIA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,+BAA+B,EAC/B,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,uBAAuB,
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/internal/request.ts"],"names":[],"mappings":"AAIA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,+BAA+B,EAC/B,kBAAkB,EAClB,aAAa,EACb,oBAAoB,EACpB,UAAU,EACV,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,GACf,MAAM,eAAe,CAAC;AAYvB,gFAAgF;AAChF,sEAAsE;AACtE,IAAI,MAAkC,CAAC;AAEvC,MAAM,oBAAoB,GAAa,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;AACtE,MAAM,mBAAmB,GAAa,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;AACnE,MAAM,iBAAiB,GAAa,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;AAE7D,wEAA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